@kontent-ai/management-sdk
Version:
Official Kontent.ai management SDK
91 lines (90 loc) • 3.81 kB
TypeScript
import { SharedContracts } from './shared-contracts';
export declare namespace WebhookContracts {
type WebhookWorkflowStepOperationContract = 'publish' | 'unpublish' | 'archive' | 'restore' | 'upsert';
type WebhookManagementContentChangesOperation = 'archive' | 'create' | 'restore';
type WebhookPreviewContentChangesOperation = 'archive' | 'upsert' | 'restore';
type WebhookContentTypeAction = 'created' | 'changed' | 'deleted';
type WebhookAssetAction = 'created' | 'changed' | 'metadata_changed' | 'deleted';
type WebhookTaxonomyAction = 'created' | 'metadata_changed' | 'deleted' | 'term_created' | 'term_changed' | 'term_deleted' | 'terms_moved';
type WebhookLanguageAction = 'created' | 'changed' | 'deleted';
type WebhookContentItemAction = 'published' | 'unpublished' | 'created' | 'changed' | 'metadata_changed' | 'deleted' | 'workflow_step_changed';
type WebhookDeliveryTriggerSlot = 'published' | 'preview';
type WebhookDeliveryTriggersEvent = 'all' | 'specific';
interface IDeleteWebhookResponseContract {
}
type WebhookAction<T extends WebhookContentTypeAction | WebhookAssetAction | WebhookTaxonomyAction | WebhookLanguageAction | WebhookContentItemAction> = {
action: T;
};
interface IWebhookContentTypeContract {
enabled: boolean;
actions?: WebhookAction<WebhookContentTypeAction>[];
filters?: IContentTypeFilters;
}
interface IWebhookAssetContract {
enabled: boolean;
actions?: WebhookAction<WebhookAssetAction>[];
}
interface IWebhookTaxonomyContract {
enabled: boolean;
actions?: WebhookAction<WebhookTaxonomyAction>[];
filters?: ITaxonomyFilters;
}
interface IWebhookLanguageContract {
enabled: boolean;
actions?: WebhookAction<WebhookLanguageAction>[];
filters?: ILanguageFilters;
}
interface IContentItemFilters {
collections?: SharedContracts.IReferenceObjectContract[];
content_types?: SharedContracts.IReferenceObjectContract[];
languages?: SharedContracts.IReferenceObjectContract[];
}
interface IContentTypeFilters {
content_types?: SharedContracts.IReferenceObjectContract[];
}
interface ITaxonomyFilters {
taxonomies?: SharedContracts.IReferenceObjectContract[];
}
interface ILanguageFilters {
languages?: SharedContracts.IReferenceObjectContract[];
}
type ContentItemTransitionTo = {
workflow_identifier: SharedContracts.ICodenameIdReferenceContract;
step_identifier: SharedContracts.ICodenameIdReferenceContract;
};
interface IWebhookContentItemContract {
enabled: boolean;
actions?: (WebhookAction<WebhookContentItemAction> & {
transition_to?: ContentItemTransitionTo[];
})[];
filters?: IContentItemFilters;
}
interface IWebhookHeaderContract {
key: string;
value: string;
}
interface IWebhookContract {
id: string;
name: string;
secret: string;
url: string;
last_modified?: string;
enabled?: boolean;
headers?: IWebhookHeaderContract[];
health_status?: string;
delivery_triggers: {
slot: WebhookDeliveryTriggerSlot;
events: WebhookDeliveryTriggersEvent;
asset?: IWebhookAssetContract;
content_type?: IWebhookContentTypeContract;
taxonomy?: IWebhookTaxonomyContract;
language?: IWebhookLanguageContract;
content_item?: IWebhookContentItemContract;
};
}
interface IGetWebhookContract extends IWebhookContract {
}
interface IAddWebhookContract extends IWebhookContract {
}
type IWebhookListContract = IWebhookContract[];
}