import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; interface Trigger { /** * Trigger ID. * @format GUID * @readonly */ _id?: string | null; /** * ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @format GUID * @immutable */ appId?: string; /** * Trigger key. * * Learn about [setting up a trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app#step-1--set-up-the-trigger). * @minLength 1 * @maxLength 100 * @immutable */ triggerKey?: string; /** * Trigger [payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema). * @immutable */ payloadDataSchema?: Record | null; /** * Trigger display name. Users see this name when they [choose a trigger for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger). * @minLength 5 * @maxLength 80 * @readonly */ displayName?: string; /** * [Filter fields](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers#filter-fields) applied to the trigger payload schema. * @maxSize 5 */ filters?: Filter[]; /** Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction#implement-the-service-plugin-methods) implemented for this trigger. */ implementedMethods?: ImplementedMethods; /** * Date and time the trigger was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the trigger was last updated. * @readonly */ _updatedDate?: Date | null; /** * Trigger base URI. Wix calls your trigger at this base address. * * Learn more about the [Wix Automations Trigger Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction). * @maxLength 256 */ baseUri?: string | null; } declare enum TimeUnit { UNKNOWN_TIME_UNIT = "UNKNOWN_TIME_UNIT", /** Minutes. */ MINUTES = "MINUTES", /** Hours. */ HOURS = "HOURS", /** Days. */ DAYS = "DAYS", /** Weeks. */ WEEKS = "WEEKS", /** Months. */ MONTHS = "MONTHS" } /** @enumType */ type TimeUnitWithLiterals = TimeUnit | 'UNKNOWN_TIME_UNIT' | 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS'; /** @see https://bo.wix.com/wix-docs/rnd/p13n-guidelines---aips/guidance-aips/design-patterns/[7016]-events#p13n-guidelines---aips_guidance-aips_design-patterns_[7016]-events_12-choose-the-right-segment */ declare enum Segment { UNKNOWN = "UNKNOWN", /** * For events that are consumed in 42 and uw2 only. * This also includes a case where an event is produced from 84/AE1 via toMainDC */ USERS = "USERS", /** * For events that are consumed in all DCs. * This includes both cases where an event is published from 84/AE1 and cases where it's published from 42/uw2 and replicated via Raven to 84/AE1 */ PUBLIC = "PUBLIC", /** * For DevEx services/migrations. * Deployed on 42, uw2. */ OTHERS = "OTHERS" } /** @enumType */ type SegmentWithLiterals = Segment | 'UNKNOWN' | 'USERS' | 'PUBLIC' | 'OTHERS'; declare enum SourceType { UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE", DEV_CENTER = "DEV_CENTER", DOMAIN_EVENT = "DOMAIN_EVENT" } /** @enumType */ type SourceTypeWithLiterals = SourceType | 'UNKNOWN_SOURCE_TYPE' | 'DEV_CENTER' | 'DOMAIN_EVENT'; interface DomainEventOptions { /** * fqdn of the entity * @minLength 1 * @maxLength 100 */ fqdn?: string; /** * the topic of the domain event * @minLength 1 * @maxLength 100 */ topic?: string; /** * the slug of the domain event * @minLength 1 * @maxLength 100 */ slug?: string; /** segment of the domain event */ segment?: SegmentWithLiterals; } declare enum Maturity { /** Unknown maturity. */ UNKNOWN_MATURITY = "UNKNOWN_MATURITY", /** The trigger component was created. The component is exposed only when the app is installed in test mode. */ CREATED = "CREATED", /** The trigger passed approval and the translation process has started. The trigger is exposed to EN Wix users. */ BETA = "BETA", /** The trigger passed translations and final approval and is exposed to all users. */ GA = "GA", /** The trigger is archived. */ ARCHIVED = "ARCHIVED" } /** @enumType */ type MaturityWithLiterals = Maturity | 'UNKNOWN_MATURITY' | 'CREATED' | 'BETA' | 'GA' | 'ARCHIVED'; interface Filter extends FilterFieldKeyOneOf { /** The static field key. */ staticFieldKey?: string; /** Dynamic field key data. */ dynamicFieldKey?: DynamicFieldKey; /** * Filter ID. * @format GUID */ _id?: string; /** Field key type. */ fieldKeyType?: FieldKeyTypeWithLiterals; /** Input field metadata. */ valueInput?: ValueInput; /** * Filters to display after first selection is made. * @maxSize 5 */ followUpFilters?: Filter[]; } /** @oneof */ interface FilterFieldKeyOneOf { /** The static field key. */ staticFieldKey?: string; /** Dynamic field key data. */ dynamicFieldKey?: DynamicFieldKey; } interface EntitySelector { /** Entity selector ID. */ _id?: string; /** * Mapping of the entity selector query fields to filter IDs. * * For example, let's say the Workflows `Card moved` trigger has 2 filters: * * - Select a workflow, with filter ID `466d2067-05bd-44f9-99c7-d029b93e4feb`. * - Select a step, with filter ID `b45f8475-bd44-4971-8820-7031ee12a708`. * * The step entity selector requires the workflow ID as input in order to return the list of relevant steps. * We can map the `workflowId` field to the workflow filter in `queryFieldToFilterIdMapping`. * * When the Wix user selects a workflow in the workflow filter in the automation builder, * Wix passes the selected workflow's ID in the `workflowId` field to the step entity selector. * The step filter then shows the relevant steps of the selected workflow for the user to select. */ queryFieldToFilterIdMapping?: Record; /** * Whether a Wix user can select multiple items. * * Default: `false` */ multiSelect?: boolean; /** * Mapping of the entity selector query fields to predefined values. * This is useful when using the same entity selector in different triggers. * * For example: Let's say the `RSVPed to event` trigger has one filter, `Select a specific event`. * This filter has an ID `e91733fc-81b7-45ca-b50c-f0c292a23af5`. * * The events entity selector has a query field of `eventType`, that should be passed in order to return the list of relevant events. * Otherwise, all events will be returned regardless of type. Map the `eventType` field to `RSVP`. * * When the Wix user selects an event in the event filter in the automation builder, * the client shows only `RSVP` events in the selection options because the `eventType` field was set to `RSVP`. */ queryFieldToValueMapping?: Record; } /** The type of input the filter field expects. */ declare enum ValueInputType { /** Unknown filter field input. */ UNKNOWN_VALUE_INPUT = "UNKNOWN_VALUE_INPUT", /** Filter field input is a selection of one from multiple entities, such as a form. */ ENTITY_SELECTOR = "ENTITY_SELECTOR", /** Filter field value is input from a Wix user. */ USER_INPUT = "USER_INPUT", /** Filter field value is a static value defined in the payload schema. */ STATIC_ITEMS = "STATIC_ITEMS" } /** @enumType */ type ValueInputTypeWithLiterals = ValueInputType | 'UNKNOWN_VALUE_INPUT' | 'ENTITY_SELECTOR' | 'USER_INPUT' | 'STATIC_ITEMS'; interface UserInput extends UserInputInputOptionsOneOf { /** Options for user input of type `number`. */ numberInputOptions?: NumberInputOptions; /** Options for user input of type `boolean`. */ booleanInputOptions?: BooleanInputOptions; /** User input type. */ type?: TypeWithLiterals; } /** @oneof */ interface UserInputInputOptionsOneOf { /** Options for user input of type `number`. */ numberInputOptions?: NumberInputOptions; /** Options for user input of type `boolean`. */ booleanInputOptions?: BooleanInputOptions; } declare enum Type { /** Unknown input type. */ UNKNOWN_USER_INPUT = "UNKNOWN_USER_INPUT", /** Number input type. */ NUMBER = "NUMBER", /** Boolean input type. */ BOOLEAN = "BOOLEAN" } /** @enumType */ type TypeWithLiterals = Type | 'UNKNOWN_USER_INPUT' | 'NUMBER' | 'BOOLEAN'; interface NumberInputOptions { /** Default number value. */ defaultValue?: number | null; /** Minimum number value. */ minValue?: number | null; /** Maximum number value. */ maxValue?: number | null; } interface BooleanInputOptions { /** Default boolean value. */ defaultValue?: boolean | null; } interface StaticItems { /** * Whether the Wix user can select multiple items * * Default: `false`. */ multiSelect?: boolean; /** * Static list of values for the Wix user to select. * * The value is saved on the automation-level trigger filter, and shown to Wix users at setup time if `displayName` is missing. * `displayName` is optionally shown to users to help select a value. */ staticValues?: StaticItemValue[]; } interface StaticItemValue { /** * item identifier * @format GUID */ _id?: string; /** static value */ value?: string; /** optional displayName for the value */ displayName?: string | null; } declare enum FieldKeyType { /** The field key type is unknown. */ UNKNOWN_FIELD_KEY_TYPE = "UNKNOWN_FIELD_KEY_TYPE", /** The field key is a static value. */ STATIC_FIELD_KEY = "STATIC_FIELD_KEY", /** The field key changes depending on the filter selection. */ DYNAMIC_FIELD_KEY = "DYNAMIC_FIELD_KEY" } /** @enumType */ type FieldKeyTypeWithLiterals = FieldKeyType | 'UNKNOWN_FIELD_KEY_TYPE' | 'STATIC_FIELD_KEY' | 'DYNAMIC_FIELD_KEY'; interface DynamicFieldKey { /** Field key label. */ label?: string; /** Field key description. */ description?: string | null; /** Selects the entity to be used as a dynamic field key. */ entitySelector?: EntitySelector; } interface ValueInput extends ValueInputInputOptionsOneOf { /** Entity selector details. */ entitySelector?: EntitySelector; /** User input details. */ userInput?: UserInput; /** Static value details. */ staticItems?: StaticItems; /** Input value type. */ type?: ValueInputTypeWithLiterals; /** Input field label. */ label?: string; /** Input field description. May be used for a tooltip. */ description?: string | null; /** * Whether the Wix user is required to enter a value in the field. * * Default: `false` */ required?: boolean; /** * Whether Wix should reevaluate the dynamic schema when the field value changes. * * Default: `false` */ reevaluateDynamicSchema?: boolean; } /** @oneof */ interface ValueInputInputOptionsOneOf { /** Entity selector details. */ entitySelector?: EntitySelector; /** User input details. */ userInput?: UserInput; /** Static value details. */ staticItems?: StaticItems; } interface Metadata { /** Whether the trigger is hidden from Wix users. */ hidden?: boolean; } interface ImplementedMethods { /** * Whether [Validate Configuration](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/validate-configuration) is implemented. * * Default: `false`. */ validateConfiguration?: boolean; /** * Whether [Get Dynamic Schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/get-dynamic-schema) is implemented. * * Default: `false`. */ getDynamicSchema?: boolean; /** * Whether [Refresh Payload](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/refresh-payload) is implemented. * * Default: `false`. */ refreshPayload?: boolean | null; } interface DebounceConfiguration { /** * UI Label for the time field configuration. * @minLength 1 * @maxLength 110 */ timeFieldLabel?: string; /** * UI Tooltip to explain the time field. * @minLength 1 * @maxLength 250 */ timeFieldTooltip?: string | null; /** * The field key in the trigger payload of the entity/event to debounce on. * For example, if the trigger is "user logged in", the resource is a contact and the resource key is "contactId". * Another example: if the trigger is "visitor logged in", the resource is a visitor and the resource key is "visitorId". * @minLength 1 * @maxLength 110 */ fieldKey?: string; /** * Which time units the Wix user is allowed to select and use. * @minSize 2 */ availableTimeUnits?: TimeUnitWithLiterals[]; /** The default time value to use. */ defaultTimeValueInDefaultTimeUnit?: number; /** The default time unit to use. */ defaultTimeUnit?: TimeUnitWithLiterals; } interface Source extends SourceOptionsOneOf { /** source information for domain events */ domainEventOptions?: DomainEventOptions; /** the source type */ type?: SourceTypeWithLiterals; } /** @oneof */ interface SourceOptionsOneOf { /** source information for domain events */ domainEventOptions?: DomainEventOptions; } interface RetryExperimentCreation { /** trigger spec info */ triggerSpecInfo?: TriggerSpecInfo; /** * app id * @format GUID */ appId?: string; /** experiment action type */ experimentActionType?: ExperimentActionTypeWithLiterals; /** * component id * @format GUID */ componentId?: string; } interface TriggerSpecInfo { /** * Spec to conduct on for the automation * @maxLength 128 */ spec?: string; /** * Value the spec should return in order to affect the user with the operation * e.g. creation - show the users the automation, update - show the users the updated automation, deletion - not show the users the automation * @maxLength 128 */ variantValue?: string | null; /** * Version from which the experiment should decide whether to expose it to users when !conduct(spec).contains(variant_value) * For example, if 50 is set, version 49 and below (including 49) will not expose the preinstalled automation to the user. */ experimentVersion?: number; } declare enum ExperimentActionType { UNKNOWN_ACTION = "UNKNOWN_ACTION", CREATE_COMPONENT = "CREATE_COMPONENT", UPDATE_COMPONENT = "UPDATE_COMPONENT", DELETE_COMPONENT = "DELETE_COMPONENT" } /** @enumType */ type ExperimentActionTypeWithLiterals = ExperimentActionType | 'UNKNOWN_ACTION' | 'CREATE_COMPONENT' | 'UPDATE_COMPONENT' | 'DELETE_COMPONENT'; interface CreateTriggerRequest { /** Trigger to add to the app. */ trigger?: Trigger; } interface CreateTriggerResponse { /** Created trigger. */ trigger?: Trigger; } interface GetTriggerRequest { /** * Trigger ID * @format GUID */ triggerId?: string; } interface GetTriggerResponse { /** Trigger Configuration */ trigger?: Trigger; } interface UpdateTriggerRequest { /** Trigger to update. */ trigger?: Trigger; } interface UpdateTriggerResponse { /** Updated trigger. */ updatedTrigger?: Trigger; } interface UpdateTriggerComponentRequest { /** Trigger Configuration */ trigger?: Trigger; /** Trigger spec info */ triggerSpecInfo?: TriggerSpecInfo; } interface UpdateTriggerComponentResponse { /** Trigger Configuration */ updatedTrigger?: Trigger; } interface UpdateTriggerMaturityRequest { /** * The trigger id * @format GUID */ _id?: string; /** maturity */ maturity?: MaturityWithLiterals; } interface UpdateTriggerMaturityResponse { /** Trigger Configuration */ updatedTrigger?: Trigger; } interface DeleteTriggerRequest { /** * The trigger id * @format GUID */ _id?: string; } interface DeleteTriggerResponse { } interface DeleteTriggerByAppIdAndKeyRequest { /** * ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @format GUID */ triggerAppId: string; /** * Trigger key. * * Learn more about how trigger providers [add triggers to their app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @minLength 1 * @maxLength 100 */ triggerKey: string; } interface DeleteTriggerByAppIdAndKeyResponse { } interface MigrateComponentToTriggerRequest { /** * The trigger App Id * @format GUID */ appId?: string; /** * The component id * @format GUID */ componentId?: string; } interface MigrateComponentToTriggerResponse { } interface RemoveComponentDataRequest { /** * The trigger App Id * @format GUID */ appId?: string; /** * The component id * @format GUID */ componentId?: string; } interface RemoveComponentDataResponse { } interface GetTriggerByAppIdAndKeyRequest { /** ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). */ appId: string; /** * Trigger key. * * Learn more about [adding a trigger to your app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). */ triggerKey: string; /** * When the trigger payload schema includes the [`identityType` annotation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema#identitytype), whether to include the full schema of that identity type. For example, when `true` and the `identityType` is `contact`, the full [contact schema](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-object) is returned. * * Default: `false` */ enrichWithIdentitySchema?: boolean | null; } interface GetTriggerByAppIdAndKeyResponse { /** The requested trigger. */ trigger?: Trigger; } interface GetRuntimeTriggerRequest { /** * The trigger App Id * @format GUID */ appId?: string; /** Trigger Configuration key */ triggerKey?: string; } interface GetRuntimeTriggerResponse { /** Trigger Configuration */ trigger?: Trigger; } interface GetLatestTriggerRequest { /** * The trigger App Id * @format GUID */ appId?: string; /** * Trigger Configuration key * @minLength 1 * @maxLength 100 */ triggerKey?: string; } interface GetLatestTriggerResponse { /** Trigger Configuration */ trigger?: Trigger; } interface QueryRuntimeTriggersRequest { /** WQL expression - support filter, sort, paging, fields and field sets */ query?: QueryV2; } interface QueryV2 extends QueryV2PagingMethodOneOf { /** Paging options to limit and offset the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object. * * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters). */ filter?: Record | null; /** * Sort object. * * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting). */ sort?: Sorting[]; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } /** @oneof */ interface QueryV2PagingMethodOneOf { /** Paging options to limit and offset the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryRuntimeTriggersResponse { /** Queried triggers configuration */ results?: Trigger[]; /** paging data of the response */ paging?: PagingMetadataV2; } interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface QueryTriggersRequest { /** * Query options. * * See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) for more information. */ query: QueryV2; } interface QueryTriggersResponse { /** Retrieved triggers. */ results?: Trigger[]; /** Paging metadata. */ paging?: PagingMetadataV2; } interface ResolveTriggersRequest { /** Query options. */ query?: QueryV2; /** If provided, all triggers associated with the app ID are retrieved, regardless of maturity. The app must be installed on the site. */ appId?: string | null; } interface ResolveTriggersResponse { /** List of retrieved triggers. */ results?: Trigger[]; /** Paging metadata of the response. */ paging?: PagingMetadataV2; } interface GetTriggerDynamicSchemaRequest { /** * ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @format GUID */ appId: string; /** * Trigger key. * * Learn more about [adding a trigger to your app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @minLength 1 * @maxLength 100 */ triggerKey: string; /** * When the trigger includes [filter fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields), the trigger schema only includes the schemas of the specified filter fields. * * When empty, the full trigger's payload schema is returned. * @maxSize 5 */ selectedFilterOptions?: SelectedFilterOptions[]; } interface SelectedFilterOptions { /** * Key representing a field from the trigger's [payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema) that has been configured as an [item selection filter](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields#item-selection). For example `formId`. * @minLength 1 * @maxLength 110 */ fieldKey?: string; /** * Values selected for the filter field. * @maxSize 100 */ values?: string[]; } interface GetDynamicSchemaResponse { /** A [JSON schema](https://json-schema.org/) corresponding to the filter selection sent in the request. */ dynamicSchema?: Record | null; } interface GetIdentitiesSchemaRequest { } interface GetIdentitiesSchemaResponse { /** * identities schema with a property per identity (currently only "contact"): * the schema would look like this: * { * "type": "object", * "properties": { * "contact": { * "type": "object", * "properties": { * ...contact identity fields * } * } * } * } */ identitiesSchema?: Record | null; } interface ListMarketplaceAndWhitelistTriggersRequest { /** If true, include hidden triggers. If false or unset, only show non-hidden triggers. default is false. */ showHidden?: boolean | null; } interface ListMarketplaceAndWhitelistTriggersResponse { results?: Trigger[]; } interface ListWhitelistTriggerAppsRequest { } interface ListWhitelistTriggerAppsResponse { results?: string[]; } interface BulkCreateWhitelistTriggerAppsRequest { apps?: string[]; } interface BulkCreateWhitelistTriggerAppsResponse { } interface BulkDeleteWhitelistTriggerAppsRequest { apps?: string[]; } interface BulkDeleteWhitelistTriggerAppsResponse { } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface Empty { } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** * Creates a trigger for the specified app. Once created, users can [create automations](https://support.wix.com/en/wix-automations-7067897) that run when this trigger occurs. * * Learn more about [triggers](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers). * * > **Note:** You can only create triggers for [apps you own or collaborate on](https://dev.wix.com/docs/build-apps/develop-your-app/app-dashboard-setup/manage-collaborators). * @public * @documentationMaturity preview * @requiredField options.trigger.appId * @requiredField options.trigger.displayName * @requiredField options.trigger.payloadDataSchema * @requiredField options.trigger.triggerKey * @returns Created trigger. * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.CreateTrigger */ declare function createTrigger(options?: NonNullablePaths): Promise>; interface CreateTriggerOptions { /** Trigger to add to the app. */ trigger?: Trigger; } /** * Updates the specified trigger for the specified app. * * After the trigger is updated, it only contains the values specified in the request. Earlier values are replaced. * @param _id - Trigger ID. * @public * @documentationMaturity preview * @requiredField _id * @requiredField options.trigger.appId * @requiredField options.trigger.triggerKey * @returns Updated trigger. * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.UpdateTrigger */ declare function updateTrigger(_id: string, options?: NonNullablePaths): Promise>; interface UpdateTriggerOptions { trigger: { /** * Trigger ID. * @format GUID * @readonly */ _id?: string | null; /** * ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @format GUID * @immutable */ appId?: string; /** * Trigger key. * * Learn about [setting up a trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app#step-1--set-up-the-trigger). * @minLength 1 * @maxLength 100 * @immutable */ triggerKey?: string; /** * Trigger [payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema). * @immutable */ payloadDataSchema?: Record | null; /** * Trigger display name. Users see this name when they [choose a trigger for an automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger). * @minLength 5 * @maxLength 80 * @readonly */ displayName?: string; /** * [Filter fields](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/about-triggers#filter-fields) applied to the trigger payload schema. * @maxSize 5 */ filters?: Filter[]; /** Additional [service plugin methods](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction#implement-the-service-plugin-methods) implemented for this trigger. */ implementedMethods?: ImplementedMethods; /** * Date and time the trigger was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the trigger was last updated. * @readonly */ _updatedDate?: Date | null; /** * Trigger base URI. Wix calls your trigger at this base address. * * Learn more about the [Wix Automations Trigger Provider service plugin](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/trigger-provider-service-plugin/introduction). * @maxLength 256 */ baseUri?: string | null; }; } /** * Deletes a trigger from the specified app. * * > **Note**: [Automations that have the deleted trigger](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-2-choose-a-trigger) no longer run. * @param triggerAppId - ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @public * @documentationMaturity preview * @requiredField options * @requiredField options.triggerKey * @requiredField triggerAppId * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.DeleteTriggerByAppIdAndKey */ declare function deleteTriggerByAppIdAndKey(triggerAppId: string, options: NonNullablePaths): Promise; interface DeleteTriggerByAppIdAndKeyOptions { /** * Trigger key. * * Learn more about how trigger providers [add triggers to their app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @minLength 1 * @maxLength 100 */ triggerKey: string; } /** * Retrieves the specified trigger. * @public * @documentationMaturity preview * @requiredField identifiers * @requiredField identifiers.appId * @requiredField identifiers.triggerKey * @permissionId AUTOMATIONS.TRIGGER_READ * @applicableIdentity APP * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.GetTriggerByAppIdAndKey */ declare function getTriggerByAppIdAndKey(identifiers: NonNullablePaths, options?: GetTriggerByAppIdAndKeyOptions): Promise>; interface GetTriggerByAppIdAndKeyIdentifiers { /** ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). */ appId: string; /** * Trigger key. * * Learn more about [adding a trigger to your app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). */ triggerKey: string; } interface GetTriggerByAppIdAndKeyOptions { /** * When the trigger payload schema includes the [`identityType` annotation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema#identitytype), whether to include the full schema of that identity type. For example, when `true` and the `identityType` is `contact`, the full [contact schema](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-object) is returned. * * Default: `false` */ enrichWithIdentitySchema?: boolean | null; } /** * Retrieves a list of triggers, given the provided paging, filtering, and sorting. * * To query all triggers by a particular app, specify its `appId` in the query's `filter` object. * * * Query Triggers runs with these defaults, which you can override: * * - `createdDate` is sorted in `DESC` order. * - `paging.limit` is `50`. * - `paging.offset` is `0`. * * To learn about working with query methods, see: * - [API Query Language](https://dev.wix.com/docs/api-reference/articles/getting-started/api-query-language) * - [Sorting and Paging](https://dev.wix.com/api/api-reference/getting-started/pagination) * - [Field projection](https://dev.wix.com/api/api-reference/getting-started/field-projection) * @public * @documentationMaturity preview * @permissionId AUTOMATIONS.TRIGGER_READ * @applicableIdentity APP * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.QueryTriggers */ declare function queryTriggers(): ResultsQueryBuilder; interface QueryOffsetResult { currentPage: number | undefined; totalPages: number | undefined; totalCount: number | undefined; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface ResultsQueryResult extends QueryOffsetResult { items: Trigger[]; query: ResultsQueryBuilder; next: () => Promise; prev: () => Promise; } interface ResultsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type', value: any) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type', value: any) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName', value: any) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName', value: any) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName', value: any) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName', value: any) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName', value: string) => ResultsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. * @documentationMaturity preview */ hasSome: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type', value: any[]) => ResultsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type', value: any) => ResultsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: '_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type', value: boolean) => ResultsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type'>) => ResultsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'_id' | 'appId' | 'triggerKey' | 'displayName' | 'metadata.hidden' | 'implementedMethods.validateConfiguration' | 'implementedMethods.getDynamicSchema' | 'implementedMethods.refreshPayload' | 'source.type'>) => ResultsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => ResultsQueryBuilder; /** @param skip - Number of items to skip in the query results before returning the results. * @documentationMaturity preview */ skip: (skip: number) => ResultsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * @hidden * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.QueryTriggers * @requiredField query */ declare function typedQueryTriggers(query: TriggerQuery): Promise>; interface TriggerQuerySpec extends QuerySpec { paging: 'offset'; wql: [ { fields: [ '_id', 'appId', 'displayName', 'implementedMethods.getDynamicSchema', 'implementedMethods.refreshPayload', 'implementedMethods.validateConfiguration', 'metadata.hidden', 'source.type', 'triggerKey' ]; operators: '*'; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query; type TriggerQuery = { /** Paging options to limit and offset the number of items. */ paging?: { /** Number of items to load. */ limit?: NonNullable['limit'] | null; /** Number of items to skip in the current sort order. */ offset?: NonNullable['offset'] | null; }; /** Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters). */ filter?: CommonQueryWithEntityContext['filter'] | null; /** Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting). */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; }; declare const utils: { query: { QueryBuilder: () => _wix_sdk_types.QueryBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; }; }; /** * Returns triggers that are installed on the site and have sufficient maturity. * @public * @documentationMaturity preview * @permissionId AUTOMATIONS.TRIGGER_READ * @applicableIdentity APP * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.ResolveTriggers */ declare function resolveTriggers(options?: ResolveTriggersOptions): Promise>; interface ResolveTriggersOptions { /** Query options. */ query?: QueryV2; /** If provided, all triggers associated with the app ID are retrieved, regardless of maturity. The app must be installed on the site. */ appId?: string | null; } /** * Retrieves a trigger's payload schema with the user's [filter field](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields) selections applied. * * Learn more about [the trigger payload schema](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/the-trigger-payload-schema). * @param appId - ID of the [app that created the trigger](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @public * @documentationMaturity preview * @requiredField appId * @requiredField options.triggerKey * @permissionId AUTOMATIONS.TRIGGER_READ * @applicableIdentity APP * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.GetTriggerDynamicSchema */ declare function getTriggerDynamicSchema(appId: string, options?: NonNullablePaths): Promise; interface GetTriggerDynamicSchemaOptions { /** * Trigger key. * * Learn more about [adding a trigger to your app](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/add-a-trigger-to-your-app). * @minLength 1 * @maxLength 100 */ triggerKey: string; /** * When the trigger includes [filter fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields), the trigger schema only includes the schemas of the specified filter fields. * * When empty, the full trigger's payload schema is returned. * @maxSize 5 */ selectedFilterOptions?: SelectedFilterOptions[]; } /** * Returns trigger identities schema * @public * @documentationMaturity preview * @permissionId AUTOMATIONS.TRIGGER_READ * @applicableIdentity APP * @fqn wix.automations.triggercatalog.v1.TriggerCatalogService.GetIdentitiesSchema */ declare function getIdentitiesSchema(): Promise; export { type AccountInfo, type ActionEvent, type BooleanInputOptions, type BulkCreateWhitelistTriggerAppsRequest, type BulkCreateWhitelistTriggerAppsResponse, type BulkDeleteWhitelistTriggerAppsRequest, type BulkDeleteWhitelistTriggerAppsResponse, type CommonQueryWithEntityContext, type CreateTriggerOptions, type CreateTriggerRequest, type CreateTriggerResponse, type CursorPaging, type Cursors, type DebounceConfiguration, type DeleteTriggerByAppIdAndKeyOptions, type DeleteTriggerByAppIdAndKeyRequest, type DeleteTriggerByAppIdAndKeyResponse, type DeleteTriggerRequest, type DeleteTriggerResponse, type DomainEvent, type DomainEventBodyOneOf, type DomainEventOptions, type DynamicFieldKey, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntitySelector, type EntityUpdatedEvent, ExperimentActionType, type ExperimentActionTypeWithLiterals, FieldKeyType, type FieldKeyTypeWithLiterals, type Filter, type FilterFieldKeyOneOf, type GetDynamicSchemaResponse, type GetIdentitiesSchemaRequest, type GetIdentitiesSchemaResponse, type GetLatestTriggerRequest, type GetLatestTriggerResponse, type GetRuntimeTriggerRequest, type GetRuntimeTriggerResponse, type GetTriggerByAppIdAndKeyIdentifiers, type GetTriggerByAppIdAndKeyOptions, type GetTriggerByAppIdAndKeyRequest, type GetTriggerByAppIdAndKeyResponse, type GetTriggerDynamicSchemaOptions, type GetTriggerDynamicSchemaRequest, type GetTriggerRequest, type GetTriggerResponse, type IdentificationData, type IdentificationDataIdOneOf, type ImplementedMethods, type ListMarketplaceAndWhitelistTriggersRequest, type ListMarketplaceAndWhitelistTriggersResponse, type ListWhitelistTriggerAppsRequest, type ListWhitelistTriggerAppsResponse, Maturity, type MaturityWithLiterals, type MessageEnvelope, type Metadata, type MigrateComponentToTriggerRequest, type MigrateComponentToTriggerResponse, type NumberInputOptions, type Paging, type PagingMetadataV2, type QueryRuntimeTriggersRequest, type QueryRuntimeTriggersResponse, type QueryTriggersRequest, type QueryTriggersResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RemoveComponentDataRequest, type RemoveComponentDataResponse, type ResolveTriggersOptions, type ResolveTriggersRequest, type ResolveTriggersResponse, type RestoreInfo, type ResultsQueryBuilder, type ResultsQueryResult, type RetryExperimentCreation, Segment, type SegmentWithLiterals, type SelectedFilterOptions, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, type SourceOptionsOneOf, SourceType, type SourceTypeWithLiterals, type StaticItemValue, type StaticItems, TimeUnit, type TimeUnitWithLiterals, type Trigger, type TriggerQuery, type TriggerQuerySpec, type TriggerSpecInfo, Type, type TypeWithLiterals, type UpdateTriggerComponentRequest, type UpdateTriggerComponentResponse, type UpdateTriggerMaturityRequest, type UpdateTriggerMaturityResponse, type UpdateTriggerOptions, type UpdateTriggerRequest, type UpdateTriggerResponse, type UserInput, type UserInputInputOptionsOneOf, type ValueInput, type ValueInputInputOptionsOneOf, ValueInputType, type ValueInputTypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createTrigger, deleteTriggerByAppIdAndKey, getIdentitiesSchema, getTriggerByAppIdAndKey, getTriggerDynamicSchema, queryTriggers, resolveTriggers, typedQueryTriggers, updateTrigger, utils };