import { NonNullablePaths } from '@wix/sdk-types'; /** * A scheduled data workflow that automatically runs [data workflows](https://dev.wix.com/docs/api-reference/business-solutions/cms/operations/data-workflows/introduction) on a schedule. * * Scheduled data workflows use cron expressions to define when to move data between sources and destinations. Each scheduled execution creates a new [data workflow](https://dev.wix.com/docs/api-reference/business-solutions/cms/operations/data-workflows/introduction) that can be tracked separately. */ interface ScheduledDataWorkflow { /** * Scheduled data workflow ID. * @format GUID * @readonly */ _id?: string; /** * Revision number that increments by 1 each time the scheduled data workflow updates. * To prevent conflicting changes, pass the current revision when updating. * * Ignored when creating a scheduled data workflow. * @readonly */ revision?: string | null; /** * Scheduled data workflow name. * @maxLength 1024 */ name?: string; /** * Whether the scheduled data workflow is enabled for execution. * * When `true`, it runs according to the schedule defined by `cronExpression`. When `false`, it doesn't run. */ enabled?: boolean; /** * [Cron expression](https://en.wikipedia.org/wiki/Cron#Cron_expression) defining when the scheduled data workflow should run. * * Uses standard 5-field cron format (minute, hour, day of month, month, day of week) in [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). Supports using `H` for minute randomization. For example, `0 2 * * *` runs daily at 2\:00 AM UTC, or `H 2 * * *` runs daily at 2\:XX AM UTC where XX is a random minute. * @maxLength 200 */ cronExpression?: string; /** * Date and time when the scheduled data movement workflow was last run. * @readonly */ lastExecutionDate?: Date | null; /** * Date and time when the scheduled data movement workflow is scheduled to run next. * * Calculated based on the cron expression and current time. Returned only when the request includes `nextScheduleExecution` in the `fields` parameter. * @readonly */ nextExecutionDate?: Date | null; /** Ordered workflow specification describing what should run when the schedule fires. */ workflow?: ScheduledDataWorkflowSpec; /** * ID of the data movement workflow created by the most recent execution. * @format GUID * @readonly */ lastWorkflowId?: string; } /** Ordered workflow definition for scheduled execution. */ interface ScheduledDataWorkflowSpec { /** * Ordered workflow steps. * @minSize 1 * @maxSize 100 */ steps?: JobSpec[]; } /** Immutable specification for a single data movement step. */ interface JobSpec extends JobSpecSiteOverrideOneOf { /** * When moving data from the Wix data collection of a site other than the current site, the ID of the site to read from. * * By default, the `source` site is the current site. However, you can move data from any site in the same [Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account). * * > **Note**: You can specify the ID of a `source` site or a `destination` site other than the current site, but not both. * @format GUID */ sourceSiteId?: string; /** * When moving data to the Wix data collection of a site other than the current site, the ID of the site to write to. * * By default, the `destination` site is the current site. However, you can move data to any site in the same [Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account). * * > **Note**: You can specify the ID of a `destination` site or a `source` site other than the current site, but not both. * @format GUID */ destinationSiteId?: string; /** Source to read data from. */ source?: Source; /** Destination to write data to. */ destination?: Destination; } /** @oneof */ interface JobSpecSiteOverrideOneOf { /** * When moving data from the Wix data collection of a site other than the current site, the ID of the site to read from. * * By default, the `source` site is the current site. However, you can move data from any site in the same [Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account). * * > **Note**: You can specify the ID of a `source` site or a `destination` site other than the current site, but not both. * @format GUID */ sourceSiteId?: string; /** * When moving data to the Wix data collection of a site other than the current site, the ID of the site to write to. * * By default, the `destination` site is the current site. However, you can move data to any site in the same [Wix Account](https://support.wix.com/en/article/managing-multiple-sites-under-one-account). * * > **Note**: You can specify the ID of a `destination` site or a `source` site other than the current site, but not both. * @format GUID */ destinationSiteId?: string; } interface Source extends SourceSourceOneOf { /** * Wix data collection. * * You can move items from native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site). */ wixDataCollection?: WixDataSource; /** * Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. * * Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). */ localization?: LocalizationSource; /** * Source file. * * You can import data from files in CSV or JSONL formats. Uploading a file with an invalid format causes the movement job to fail. * * To upload a file, call Create File Upload Url ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/movement-jobs/create-file-upload-url) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-movement-jobs/create-file-upload-url)) and use the `uploadUrl` from the response. For example: * * `curl --request PUT --upload-file "${path_to_file}" "${uploadUrl}"` */ file?: FileSource; } /** @oneof */ interface SourceSourceOneOf { /** * Wix data collection. * * You can move items from native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site). */ wixDataCollection?: WixDataSource; /** * Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. * * Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). */ localization?: LocalizationSource; /** * Source file. * * You can import data from files in CSV or JSONL formats. Uploading a file with an invalid format causes the movement job to fail. * * To upload a file, call Create File Upload Url ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/movement-jobs/create-file-upload-url) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-movement-jobs/create-file-upload-url)) and use the `uploadUrl` from the response. For example: * * `curl --request PUT --upload-file "${path_to_file}" "${uploadUrl}"` */ file?: FileSource; } declare enum WixDataEnvironment { /** Collection's [live environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing#sandbox-collections). */ LIVE = "LIVE", /** Collection's [sandbox environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing#live-collections). */ SANDBOX = "SANDBOX" } /** @enumType */ type WixDataEnvironmentWithLiterals = WixDataEnvironment | 'LIVE' | 'SANDBOX'; declare enum FileFormat { /** Unknown format. */ UNKNOWN = "UNKNOWN", /** CSV format. */ CSV = "CSV", /** JSONL format. */ JSONL = "JSONL" } /** @enumType */ type FileFormatWithLiterals = FileFormat | 'UNKNOWN' | 'CSV' | 'JSONL'; declare enum MediaType { /** All media types. */ ALL = "ALL", /** Images. */ IMAGE = "IMAGE", /** Videos. */ VIDEO = "VIDEO", /** Audio files. */ AUDIO = "AUDIO", /** Documents. */ DOCUMENT = "DOCUMENT" } /** @enumType */ type MediaTypeWithLiterals = MediaType | 'ALL' | 'IMAGE' | 'VIDEO' | 'AUDIO' | 'DOCUMENT'; /** Wix data collection. */ interface WixDataSource { /** * ID of the data collection. * @minLength 1 * @maxLength 256 */ collectionId?: string; /** * Filter to apply to the items. Only items that pass the filter are moved. * * Learn more about building a query filter using [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters). */ filter?: Record | null; /** Item fields to move. If not set, the method moves the full items. */ fields?: string[]; } interface LocalizationSource { /** * Translated CMS content in the specified languages. Content in these languages is exported to the destination, with the first specified language treated as the main one. * * Use two-letter language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. You can also specify a two-letter country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. * * Learn more about [available languages in Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-languages-available). * @format LANGUAGE_TAG * @minSize 2 * @maxSize 64 */ languages?: string[]; } /** * File. * * To create a file upload URL, call the Create File Upload Url method and use the `uploadURL` in the response to upload the source file. */ interface FileSource { /** File format. If not specified, automatically determined by Wix. */ format?: FileFormatWithLiterals; /** * File ID as returned in the `fileId` property of the Create File Upload URL method's response. * @maxLength 512 */ fileId?: string; /** * URL where the source file is uploaded. Automatically generated by Wix. * @readonly * @maxLength 2048 */ url?: string; } interface TestSource { /** * Discriminator value for a particular test source. * @maxLength 512 */ type?: string; /** Test source details. */ details?: Record | null; } /** Job logs. */ interface DataMovementJobLogs { /** * ID of the job from which to export logs. * @format GUID */ jobId?: string; } /** File. */ interface ExternalFileSource { /** File format. If not specified, automatically determined by Wix. */ format?: FileFormatWithLiterals; /** * URL where the source file is located. * @maxLength 2048 * @format WEB_URL */ url?: string; } /** Google Sheets source. */ interface GoogleSheetsSource { /** * ID of the Google Sheets spreadsheet. * @minLength 1 * @maxLength 256 */ spreadsheetId?: string; /** * Name of the sheet within the spreadsheet. * @maxLength 256 */ sheetName?: string | null; /** * Range of cells within the sheet. * @maxLength 256 */ range?: string | null; /** * Entity ID of the saved OAuth token. * @format GUID */ oauthTokenId?: string; } /** Wix Media Manager source. */ interface WixMediaSource { /** * ID of the source folder in the Media Manager. If not specified, all media items are included. * @maxLength 256 */ sourceFolderId?: string | null; } /** Exports collection structure (fields, permissions, etc.) from a site. */ interface WixDataCollectionDefinitionSource { /** * IDs of collections whose definitions to read. * @minSize 1 * @maxSize 1000 * @maxLength 256 */ collectionIds?: string[]; } interface Destination extends DestinationDestinationOneOf { /** * Wix data collection. * * You can move items to native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site). */ wixDataCollection?: WixDataDestination; /** * Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. * * Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). */ localization?: LocalizationDestination; /** Downloadable file with the moved items. */ file?: FileDestination; } /** @oneof */ interface DestinationDestinationOneOf { /** * Wix data collection. * * You can move items to native Wix collections, [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code), and [external database collections](https://dev.wix.com/docs/develop-websites/articles/databases/external-databases/overview/integrating-external-databases-with-your-wix-site). */ wixDataCollection?: WixDataDestination; /** * Localized CMS content. Available when the site has [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-an-overview) installed. * * Learn more about working with [translated CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content). */ localization?: LocalizationDestination; /** Downloadable file with the moved items. */ file?: FileDestination; } /** Wix data collection. */ interface WixDataDestination { /** * ID of the destination collection. * @maxLength 256 */ collectionId?: string; /** * When items already exist in the destination collection, the data writing policy. * * Default: `OVERWRITE`. */ writePolicy?: WixDataDestinationWritePolicyWithLiterals; } declare enum WixDataDestinationWritePolicy { /** When an item with the same ID exists in the collection, overwrite it. */ OVERWRITE = "OVERWRITE", /** When an item with the same ID exists in the collection, skip it. */ SKIP_EXISTING = "SKIP_EXISTING", /** Clear the destination collection before moving data. When the job completes, the collection contains only the moved data. */ TRUNCATE_BEFORE = "TRUNCATE_BEFORE" } /** @enumType */ type WixDataDestinationWritePolicyWithLiterals = WixDataDestinationWritePolicy | 'OVERWRITE' | 'SKIP_EXISTING' | 'TRUNCATE_BEFORE'; interface LocalizationDestination { /** * Translated CMS content in the specified languages. Content in these languages is imported from the source, with the first specified language treated as the main one. * * Use two-letter language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format. You can also specify a two-letter country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. * * Learn more about [available languages in Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-languages-available). * @minSize 2 * @maxSize 64 * @format LANGUAGE_TAG */ languages?: string[]; } /** Destination file. Creates a file and generates a download URL. */ interface FileDestination { /** File format. */ format?: FileFormatWithLiterals; /** * File name. * @maxLength 512 */ fileName?: string | null; /** * File download URL. * @readonly * @maxLength 2048 */ url?: string; /** * Formatting schema for the destination file. * * When moving data to CSV files, use each field's `key` to specify the path of the data in the source item. Use each field's `display_name` property to set the header in the CSV file's first row. * * For example, a source item of the [type](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data) `Object` with the nested properties `data: {address: {city: cityName}}` can be mapped to the CSV file by specifying the field's `key` as `data.address.city` and its `display_name` as `City`. * * If the schema isn't set, the source file schema is used. * @internal */ schema?: Schema; } /** Schema used to specify item format. */ interface Schema { /** * Item fields to move to the destination file. * @maxSize 1000 */ fields?: Field[]; } interface Field { /** * Field ID. * * If the field type is `Array`, specify the item index. If the field type is `Object`, specify the field path. Use dot notation to specify nested fields, for example: `data.address.city`. * @maxLength 1024 */ key?: string; /** * Field display name. * * When moving items to CSV files, use this to set the header of the target column. * @maxLength 1024 */ displayName?: string; /** * Field data type. Default: `ANY`. * * Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data). */ fieldType?: FieldTypeWithLiterals; } declare enum FieldType { /** Any data type. */ ANY = "ANY", /** String. */ STRING = "STRING", /** Number. */ NUMBER = "NUMBER", /** Boolean. */ BOOLEAN = "BOOLEAN", /** Date string in ISO 8601 date format: `YYYY-MM-DD`. */ DATE = "DATE", /** [Date object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) (SDK) or an object in the following format: `"someFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. */ DATETIME = "DATETIME", /** Binary file. */ BINARY = "BINARY", /** object. */ OBJECT = "OBJECT", /** Array. */ ARRAY = "ARRAY", /** Web URL. */ URL = "URL", WIX_MEDIA_URL = "WIX_MEDIA_URL", WIX_MEDIA_IMAGE_URL = "WIX_MEDIA_IMAGE_URL", WIX_MEDIA_VIDEO_URL = "WIX_MEDIA_VIDEO_URL", WIX_MEDIA_DOCUMENT_URL = "WIX_MEDIA_DOCUMENT_URL", IMAGE_URL = "IMAGE_URL", VIDEO_URL = "VIDEO_URL" } /** @enumType */ type FieldTypeWithLiterals = FieldType | 'ANY' | 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATETIME' | 'BINARY' | 'OBJECT' | 'ARRAY' | 'URL' | 'WIX_MEDIA_URL' | 'WIX_MEDIA_IMAGE_URL' | 'WIX_MEDIA_VIDEO_URL' | 'WIX_MEDIA_DOCUMENT_URL' | 'IMAGE_URL' | 'VIDEO_URL'; interface StoresCatalogProductsDestination { } /** Wix Media Manager destination. */ interface WixMediaDestination { /** * ID of the target folder in the Media Manager. If not specified, media is imported to the root folder. * @maxLength 256 */ targetFolderId?: string | null; } declare enum WixMediaDestinationWritePolicy { /** Overwrite existing media with the same name. */ OVERWRITE = "OVERWRITE", /** Skip media that already exists. */ SKIP_EXISTING = "SKIP_EXISTING" } /** @enumType */ type WixMediaDestinationWritePolicyWithLiterals = WixMediaDestinationWritePolicy | 'OVERWRITE' | 'SKIP_EXISTING'; /** Creates empty Wix data collections (no data items are inserted). */ interface WixDataCollectionDefinitionDestination { /** Policy for handling collections that already exist on the target site. */ writePolicy?: WritePolicyWithLiterals; } declare enum WritePolicy { /** Only create new collections. Skip collections that already exist on the target site. */ SKIP_EXISTING = "SKIP_EXISTING", /** Create new collections and overwrite existing ones. */ OVERWRITE = "OVERWRITE" } /** @enumType */ type WritePolicyWithLiterals = WritePolicy | 'SKIP_EXISTING' | 'OVERWRITE'; interface StoresCatalogInventoryDestination { } interface TestDestination { /** * Discriminator value for a particular test destination. * @maxLength 512 */ type?: string; /** Test destination details. */ details?: Record | null; } interface Transformation extends TransformationTransformationOneOf { } /** @oneof */ interface TransformationTransformationOneOf { } interface TestTransformation { } interface CreateScheduledDataWorkflowRequest { /** Scheduled data movement workflow to create. */ scheduledDataWorkflow: ScheduledDataWorkflow; /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } /** Additional fields to include in the response. */ declare enum Fields { /** Date of the next scheduled execution. */ NEXT_SCHEDULE_EXECUTION = "NEXT_SCHEDULE_EXECUTION" } /** @enumType */ type FieldsWithLiterals = Fields | 'NEXT_SCHEDULE_EXECUTION'; interface CreateScheduledDataWorkflowResponse { /** Created scheduled data movement workflow. */ scheduledDataWorkflow?: ScheduledDataWorkflow; } interface RescheduleScheduledDataWorkflowRequest { /** * ID of the scheduled data movement workflow to reschedule. * @format GUID */ scheduledDataWorkflowId: string; /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } interface RescheduleScheduledDataWorkflowResponse { /** * Date and time when the scheduled data movement workflow is next scheduled to run. * @readonly */ nextExecutionDate?: Date | null; } interface TriggerScheduledDataWorkflowNowRequest { /** * ID of the scheduled data movement workflow to run immediately. * @format GUID */ scheduledDataWorkflowId: string; } interface TriggerScheduledDataWorkflowNowResponse { } interface UpdateScheduledDataWorkflowRequest { /** Scheduled data movement workflow information to update. */ scheduledDataWorkflow: ScheduledDataWorkflow; /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } interface UpdateScheduledDataWorkflowResponse { /** Updated scheduled data movement workflow. */ scheduledDataWorkflow?: ScheduledDataWorkflow; } interface DeleteScheduledDataWorkflowRequest { /** * ID of the scheduled data movement workflow to delete. * @format GUID */ scheduledDataWorkflowId: string; } interface DeleteScheduledDataWorkflowResponse { } interface GetScheduledDataWorkflowRequest { /** * ID of the scheduled data movement workflow to retrieve. * @format GUID */ scheduledDataWorkflowId: string; /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } interface GetScheduledDataWorkflowResponse { /** Retrieved scheduled data movement workflow. */ scheduledDataWorkflow?: ScheduledDataWorkflow; } interface ListScheduledDataWorkflowsRequest { /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; /** Reserved for future server-side paging support. Currently ignored. */ paging?: CursorPaging; /** Reserved for future server-side filtering support. Currently ignored. */ filter?: Record | 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 ListScheduledDataWorkflowsResponse { /** Retrieved scheduled data movement workflows. */ scheduledDataWorkflows?: ScheduledDataWorkflow[]; /** Paging metadata, when available. Currently omitted because server-side paging is not applied. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in current page. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } 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 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 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; } interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** 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; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface JobsCreatedEnvelope { entity: ScheduledDataWorkflow; metadata: EventMetadata; } /** @permissionScope Data Mover Manage Jobs * @permissionScopeId SCOPE.DC-DATA.MANAGE_MOVEMENT_JOBS * @permissionId WIX_DATA.DATA_SYNC_SCHEDULE * @webhook * @eventType wix.data.sync.v1.jobs_created * @slug created * @documentationMaturity preview */ declare function onJobsCreated(handler: (event: JobsCreatedEnvelope) => void | Promise): void; interface JobsDeletedEnvelope { metadata: EventMetadata; } /** @permissionScope Data Mover Manage Jobs * @permissionScopeId SCOPE.DC-DATA.MANAGE_MOVEMENT_JOBS * @permissionId WIX_DATA.DATA_SYNC_SCHEDULE * @webhook * @eventType wix.data.sync.v1.jobs_deleted * @slug deleted * @documentationMaturity preview */ declare function onJobsDeleted(handler: (event: JobsDeletedEnvelope) => void | Promise): void; interface JobsUpdatedEnvelope { entity: ScheduledDataWorkflow; metadata: EventMetadata; } /** @permissionScope Data Mover Manage Jobs * @permissionScopeId SCOPE.DC-DATA.MANAGE_MOVEMENT_JOBS * @permissionId WIX_DATA.DATA_SYNC_SCHEDULE * @webhook * @eventType wix.data.sync.v1.jobs_updated * @slug updated * @documentationMaturity preview */ declare function onJobsUpdated(handler: (event: JobsUpdatedEnvelope) => void | Promise): void; /** * Creates a scheduled data workflow with a cron schedule. * * The scheduled data workflow automatically runs according to the specified cron expression. * Each execution creates a new [data workflow](https://dev.wix.com/docs/api-reference/business-solutions/cms/operations/data-movement-jobs/introduction) with its `scheduleId` set to this scheduled data workflow's ID. * @param scheduledDataWorkflow - Scheduled data movement workflow to create. * @public * @documentationMaturity preview * @requiredField scheduledDataWorkflow * @requiredField scheduledDataWorkflow._id * @requiredField scheduledDataWorkflow.workflow * @requiredField scheduledDataWorkflow.workflow.steps * @permissionId data:sync:v1:jobs:create_scheduled_data_workflow * @returns Created scheduled data movement workflow. * @fqn wix.hub.v1.DataMovementSchedulerService.CreateScheduledDataWorkflow */ declare function createScheduledDataWorkflow(scheduledDataWorkflow: NonNullablePaths, options?: CreateScheduledDataWorkflowOptions): Promise>; interface CreateScheduledDataWorkflowOptions { /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } /** * Reinitializes a scheduled data workflow based on the current cron expression. * * This is needed in case an [updated](https://dev.wix.com/docs/api-reference/business-solutions/cms/operations/data-sync-jobs/update-data-sync-job) scheduled data workflow gets out of sync. * For example, if you update the cron expression, it may not initially run according to the new expression. * This reschedules it to run according to the new expression. * * Only applies to `enabled` scheduled data workflows. * @param scheduledDataWorkflowId - ID of the scheduled data movement workflow to reschedule. * @public * @documentationMaturity preview * @requiredField scheduledDataWorkflowId * @permissionId data:sync:v1:jobs:reschedule_scheduled_data_workflow * @fqn wix.hub.v1.DataMovementSchedulerService.RescheduleScheduledDataWorkflow */ declare function rescheduleScheduledDataWorkflow(scheduledDataWorkflowId: string, options?: RescheduleScheduledDataWorkflowOptions): Promise; interface RescheduleScheduledDataWorkflowOptions { /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } /** * Enqueues an immediate execution for a scheduled data workflow. * * This custom action doesn't change the cron schedule. * It triggers the same data workflow execution path used by scheduled * TimeCapsule runs. * @param scheduledDataWorkflowId - ID of the scheduled data movement workflow to run immediately. * @public * @documentationMaturity preview * @requiredField scheduledDataWorkflowId * @permissionId data:sync:v1:jobs:trigger_scheduled_data_workflow_now * @fqn wix.hub.v1.DataMovementSchedulerService.TriggerScheduledDataWorkflowNow */ declare function triggerScheduledDataWorkflowNow(scheduledDataWorkflowId: string): Promise; /** * Updates an existing scheduled data workflow. * @param scheduledDataWorkflow - Scheduled data movement workflow information to update. * @public * @documentationMaturity preview * @requiredField scheduledDataWorkflow * @requiredField scheduledDataWorkflow.workflow * @requiredField scheduledDataWorkflow.workflow.steps * @permissionId data:sync:v1:jobs:update_scheduled_data_workflow * @returns Updated scheduled data movement workflow. * @fqn wix.hub.v1.DataMovementSchedulerService.UpdateScheduledDataWorkflow */ declare function updateScheduledDataWorkflow(scheduledDataWorkflow: NonNullablePaths, options?: UpdateScheduledDataWorkflowOptions): Promise>; interface UpdateScheduledDataWorkflowOptions { /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } /** * Deletes a scheduled data workflow. * * This permanently removes the schedule and prevents future executions. Any currently running data workflows triggered by the schedule continue to completion. * @param scheduledDataWorkflowId - ID of the scheduled data movement workflow to delete. * @public * @documentationMaturity preview * @requiredField scheduledDataWorkflowId * @permissionId data:sync:v1:jobs:delete_scheduled_data_workflow * @fqn wix.hub.v1.DataMovementSchedulerService.DeleteScheduledDataWorkflow */ declare function deleteScheduledDataWorkflow(scheduledDataWorkflowId: string): Promise; /** * Retrieves a scheduled data workflow by ID. * @param scheduledDataWorkflowId - ID of the scheduled data movement workflow to retrieve. * @public * @documentationMaturity preview * @requiredField scheduledDataWorkflowId * @permissionId data:sync:v1:jobs:get_scheduled_data_workflow * @returns Retrieved scheduled data movement workflow. * @fqn wix.hub.v1.DataMovementSchedulerService.GetScheduledDataWorkflow */ declare function getScheduledDataWorkflow(scheduledDataWorkflowId: string, options?: GetScheduledDataWorkflowOptions): Promise>; interface GetScheduledDataWorkflowOptions { /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; } /** * Retrieves all scheduled data workflows for the current site. * * The current implementation returns both enabled and disabled schedules. Request `paging` and `filter` fields are accepted for forward compatibility but are not applied by the service. * @public * @documentationMaturity preview * @permissionId data:sync:v1:jobs:list_scheduled_data_workflows * @fqn wix.hub.v1.DataMovementSchedulerService.ListScheduledDataWorkflows */ declare function listScheduledDataWorkflows(options?: ListScheduledDataWorkflowsOptions): Promise>; interface ListScheduledDataWorkflowsOptions { /** * Additional fields to include in the response. * @maxSize 1 */ fields?: FieldsWithLiterals[]; /** Reserved for future server-side paging support. Currently ignored. */ paging?: CursorPaging; /** Reserved for future server-side filtering support. Currently ignored. */ filter?: Record | null; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type CreateScheduledDataWorkflowOptions, type CreateScheduledDataWorkflowRequest, type CreateScheduledDataWorkflowResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DataMovementJobLogs, type DeleteScheduledDataWorkflowRequest, type DeleteScheduledDataWorkflowResponse, type Destination, type DestinationDestinationOneOf, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExternalFileSource, type Field, FieldType, type FieldTypeWithLiterals, Fields, type FieldsWithLiterals, type FileDestination, FileFormat, type FileFormatWithLiterals, type FileSource, type GetScheduledDataWorkflowOptions, type GetScheduledDataWorkflowRequest, type GetScheduledDataWorkflowResponse, type GoogleSheetsSource, type IdentificationData, type IdentificationDataIdOneOf, type JobSpec, type JobSpecSiteOverrideOneOf, type JobsCreatedEnvelope, type JobsDeletedEnvelope, type JobsUpdatedEnvelope, type ListScheduledDataWorkflowsOptions, type ListScheduledDataWorkflowsRequest, type ListScheduledDataWorkflowsResponse, type LocalizationDestination, type LocalizationSource, MediaType, type MediaTypeWithLiterals, type MessageEnvelope, type RescheduleScheduledDataWorkflowOptions, type RescheduleScheduledDataWorkflowRequest, type RescheduleScheduledDataWorkflowResponse, type RestoreInfo, type ScheduledDataWorkflow, type ScheduledDataWorkflowSpec, type Schema, type Source, type SourceSourceOneOf, type StoresCatalogInventoryDestination, type StoresCatalogProductsDestination, type TestDestination, type TestSource, type TestTransformation, type Transformation, type TransformationTransformationOneOf, type TriggerScheduledDataWorkflowNowRequest, type TriggerScheduledDataWorkflowNowResponse, type UpdateScheduledDataWorkflowOptions, type UpdateScheduledDataWorkflowRequest, type UpdateScheduledDataWorkflowResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WixDataCollectionDefinitionDestination, type WixDataCollectionDefinitionSource, type WixDataDestination, WixDataDestinationWritePolicy, type WixDataDestinationWritePolicyWithLiterals, WixDataEnvironment, type WixDataEnvironmentWithLiterals, type WixDataSource, type WixMediaDestination, WixMediaDestinationWritePolicy, type WixMediaDestinationWritePolicyWithLiterals, type WixMediaSource, WritePolicy, type WritePolicyWithLiterals, createScheduledDataWorkflow, deleteScheduledDataWorkflow, getScheduledDataWorkflow, listScheduledDataWorkflows, onJobsCreated, onJobsDeleted, onJobsUpdated, rescheduleScheduledDataWorkflow, triggerScheduledDataWorkflowNow, updateScheduledDataWorkflow };