Skip to content

Commit

Permalink
Uses singular naming for webhook types
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Jan 29, 2024
1 parent 3afcb45 commit dc65a8f
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions lib/contracts/webhook-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ import { SharedContracts } from './shared-contracts';

export namespace WebhookContracts {
export type WebhookWorkflowStepOperationContract = 'publish' | 'unpublish' | 'archive' | 'restore' | 'upsert';
export type WebhookManagementContentChangesOperations = 'archive' | 'create' | 'restore';
export type WebhookPreviewContentChangesOperations = 'archive' | 'upsert' | 'restore';
export type WebhookContentTypeActions = 'created' | 'changed' | 'deleted';
export type WebhookAssetActions = 'created' | 'changed' | 'metadata_changed' | 'deleted';
export type WebhookTaxonomyActions =
export type WebhookManagementContentChangesOperation = 'archive' | 'create' | 'restore';
export type WebhookPreviewContentChangesOperation = 'archive' | 'upsert' | 'restore';
export type WebhookContentTypeAction = 'created' | 'changed' | 'deleted';
export type WebhookAssetAction = 'created' | 'changed' | 'metadata_changed' | 'deleted';
export type WebhookTaxonomyAction =
| 'created'
| 'metadata_changed'
| 'deleted'
| 'term_created'
| 'term_changed'
| 'term_deleted'
| 'terms_moved';
export type WebhookLanguageActions = 'created' | 'changed' | 'deleted';
export type WebhookContentItemActions =
export type WebhookLanguageAction = 'created' | 'changed' | 'deleted';
export type WebhookContentItemAction =
| 'published'
| 'unpublished'
| 'created'
| 'changed'
| 'metadata_changed'
| 'deleted'
| 'workflow_step_changed';
export type WebhookDeliveryTriggerSlots = 'published' | 'preview';
export type WebhookDeliveryTriggersEvents = 'all' | 'specific';
export type WebhookDeliveryTriggerSlot = 'published' | 'preview';
export type WebhookDeliveryTriggersEvent = 'all' | 'specific';

export interface IDeleteWebhookResponseContract {}

Expand All @@ -39,7 +39,7 @@ export namespace WebhookContracts {

export interface ILegacyWebhookManagementApiContentChangesContract {
type: 'content_item_variant';
operations: WebhookManagementContentChangesOperations[];
operations: WebhookManagementContentChangesOperation[];
}

export interface ILegacyWebhookDeliveryApiContentChangesContract {
Expand All @@ -49,27 +49,27 @@ export namespace WebhookContracts {

export interface ILegacyWebhookPreviewDeliveryApiContentChangesContract {
type: 'taxonomy' | 'content_item_variant';
operations: WebhookPreviewContentChangesOperations[];
operations: WebhookPreviewContentChangesOperation[];
}

export interface IWebhookContentTypeContract {
enabled: boolean;
actions?: WebhookContentTypeActions[];
actions?: WebhookContentTypeAction[];
}

export interface IWebhookAssetContract {
enabled: boolean;
actions?: WebhookAssetActions[];
actions?: WebhookAssetAction[];
}

export interface IWebhookTaxonomyContract {
enabled: boolean;
actions?: WebhookTaxonomyActions[];
actions?: WebhookTaxonomyAction[];
}

export interface IWebhookLanguageContract {
enabled: boolean;
actions?: WebhookLanguageActions[];
actions?: WebhookLanguageAction[];
}

export interface IContentItemFilters {
Expand All @@ -78,7 +78,7 @@ export namespace WebhookContracts {
languages?: SharedContracts.IReferenceObjectContract[];
}
export interface IContentItemActions {
action: WebhookContentItemActions;
action: WebhookContentItemAction;
transition_to: {
workflow_identifier: SharedContracts.ICodenameIdReferenceContract;
step_identifier: SharedContracts.ICodenameIdReferenceContract;
Expand Down Expand Up @@ -114,8 +114,8 @@ export namespace WebhookContracts {
enabled?: boolean;
health_status?: string;
delivery_triggers: {
slot: WebhookDeliveryTriggerSlots;
events: WebhookDeliveryTriggersEvents;
slot: WebhookDeliveryTriggerSlot;
events: WebhookDeliveryTriggersEvent;
asset?: IWebhookAssetContract;
content_type?: IWebhookContentTypeContract;
taxonomy?: IWebhookTaxonomyContract;
Expand Down

0 comments on commit dc65a8f

Please sign in to comment.