import { GetAsyncJobRequest as GetAsyncJobRequest$1, GetAsyncJobResponse as GetAsyncJobResponse$1, ListAsyncJobItemsRequest as ListAsyncJobItemsRequest$1, ListAsyncJobItemsResponse as ListAsyncJobItemsResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; interface AsyncJob { /** * Job ID. * @format GUID * @readonly */ id?: string; /** Optional job metadata, used to store any parameters used during job execution, user-defined statuses, etc. */ metadata?: Record | null; /** Current job execution status. */ status?: StatusWithLiterals; /** * Current counters. * @deprecated Current counters. * @replacedBy wix.infra.asyncjobs.v1.AsyncJob.counts * @targetRemovalDate 2024-12-12 */ counters?: Counters; /** * Date and time the job was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. * @readonly */ createdDate?: Date | null; /** * Date and time the job was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. * @readonly */ updatedDate?: Date | null; /** * Job owner. * @readonly * @deprecated Job owner. * @replacedBy wix.infra.asyncjobs.v1.AsyncJob.created_by * @targetRemovalDate 2024-12-12 */ owner?: Owner; /** * Job creator. * @readonly */ createdBy?: CreatedBy; /** Current execution counts. */ counts?: Counts; } declare enum Type { UNKNOWN_TYPE = "UNKNOWN_TYPE", /** Job was created by a site visitor that was **not** logged in. */ ANONYMOUS_VISITOR_ID = "ANONYMOUS_VISITOR_ID", /** Job was created by a **logged in** site visitor. */ MEMBER_ID = "MEMBER_ID", /** Job was created by a Wix user. */ WIX_USER_ID = "WIX_USER_ID", /** Job was created by an external app or app by Wix. */ APP_ID = "APP_ID" } /** @enumType */ type TypeWithLiterals = Type | 'UNKNOWN_TYPE' | 'ANONYMOUS_VISITOR_ID' | 'MEMBER_ID' | 'WIX_USER_ID' | 'APP_ID'; interface AnonymousVisitorIdOptions { /** * Visitor ID - When the job is owned by a site visitor that was **not** logged in. * @format GUID */ anonymousVisitorId?: string; } interface MemberIdOptions { /** * Member ID - When the job is owned by a by a **logged in** site visitor. * @format GUID */ memberId?: string; } interface WixUserIdOptions { /** * User ID - When the job is owned by a site owner or contributor. * @format GUID */ wixUserId?: string; } interface AppIdOptions { /** * App ID - When the job is owned by an external app. or app by Wix. * @format GUID */ appId?: string; } declare enum Status { UNKNOWN = "UNKNOWN", /** Job is created, but hasn't started yet. */ INITIALIZED = "INITIALIZED", /** Job has started and is in progress. */ PROCESSING = "PROCESSING", /** Job is finished. */ FINISHED = "FINISHED", /** Job has failed. */ FAILED = "FAILED" } /** @enumType */ type StatusWithLiterals = Status | 'UNKNOWN' | 'INITIALIZED' | 'PROCESSING' | 'FINISHED' | 'FAILED'; interface Counters { /** Optional count of the dataset size, as specified during job creation. Can be used for progress bars, etc. */ itemsToProcess?: number | null; /** Amount of items that were successfully processed. */ itemsSucceeded?: number; /** Amount of items whose processing failed. */ itemsFailed?: number; /** Mapping between an error code and the number of failures associated with it. */ errorCountByCode?: Record; } interface Owner extends OwnerIdOneOf { /** * Visitor ID - when the job is owned by a site visitor that was **not** logged in. * @format GUID */ anonymousVisitorId?: string; /** * Member ID - When the job is owned by a by a **logged in** site visitor. * @format GUID */ memberId?: string; /** * User ID - When the job is owned by a Wix user. * @format GUID */ wixUserId?: string; /** * App ID - When the job is owned by an external app or app by Wix. * @format GUID */ appId?: string; /** * Service ID. * @format GUID */ serviceId?: string; } /** @oneof */ interface OwnerIdOneOf { /** * Visitor ID - when the job is owned by a site visitor that was **not** logged in. * @format GUID */ anonymousVisitorId?: string; /** * Member ID - When the job is owned by a by a **logged in** site visitor. * @format GUID */ memberId?: string; /** * User ID - When the job is owned by a Wix user. * @format GUID */ wixUserId?: string; /** * App ID - When the job is owned by an external app or app by Wix. * @format GUID */ appId?: string; /** * Service ID. * @format GUID */ serviceId?: string; } interface CreatedBy extends CreatedByOptionsOneOf { /** Visitor ID - when the job is created by a site visitor that was **not** logged in. */ anonymousVisitorIdOptions?: AnonymousVisitorIdOptions; /** Member ID - When the job is created by a by a **logged in** site visitor. */ memberIdOptions?: MemberIdOptions; /** User ID - When the job is created by a Wix user. */ wixUserIdOptions?: WixUserIdOptions; /** App ID - When the job is created by an external app or app by Wix. */ appIdOptions?: AppIdOptions; /** The type of the creator. */ type?: TypeWithLiterals; } /** @oneof */ interface CreatedByOptionsOneOf { /** Visitor ID - when the job is created by a site visitor that was **not** logged in. */ anonymousVisitorIdOptions?: AnonymousVisitorIdOptions; /** Member ID - When the job is created by a by a **logged in** site visitor. */ memberIdOptions?: MemberIdOptions; /** User ID - When the job is created by a Wix user. */ wixUserIdOptions?: WixUserIdOptions; /** App ID - When the job is created by an external app or app by Wix. */ appIdOptions?: AppIdOptions; } interface Counts { /** Optional count of the dataset size, specified during job creation. Can be used for progress bars, etc. */ total?: number | null; /** Amount of items that were successfully processed. */ successCount?: number; /** Amount of items whose processing failed. */ failCount?: number; /** Mapping between an error code and the number of failures associated with it. */ errorByCodeCount?: Record; } /** Events */ interface AsyncJobFinishedEvent { /** * Job ID. * @format GUID */ jobId?: string; } interface AsyncJobFailedEvent { /** * Job ID. * @format GUID */ jobId?: string; } interface AsyncJobItemFailedEvent { /** * Job ID. * @format GUID */ jobId?: string; /** Job items. */ jobItem?: AsyncJobItem; } interface AsyncJobItem { /** * Job item ID. * @format GUID * @readonly */ id?: string; /** Job item data, as passed by the originating service. */ data?: Record | null; /** * ID of the entity being processed, as passed by the originating service. * @minLength 1 * @maxLength 128 * @immutable */ entityId?: string | null; /** * Whether the job item was processed successfully. * @readonly */ success?: boolean; /** * Error that prevented the item from being processed, if relevant. * @immutable */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface CreateAsyncJobRequest { /** Job to create. */ job?: AsyncJob; } interface CreateAsyncJobResponse { /** Created job. */ job?: AsyncJob; } interface GetAsyncJobRequest { /** * Job ID. * @format GUID */ jobId: string; } interface GetAsyncJobResponse { /** Returned job. */ job?: AsyncJob; } interface UpdateAsyncJobRequest { /** Job to update. */ job?: AsyncJob; } interface UpdateAsyncJobResponse { /** Updated job. */ job?: AsyncJob; } interface DeleteAsyncJobRequest { /** * Job ID. * @format GUID */ jobId?: string; } interface DeleteAsyncJobResponse { } interface CompleteAsyncJobRequest { /** * Job ID. * @format GUID */ jobId?: string; /** Job status. */ status?: CompleteStatusWithLiterals; } declare enum CompleteStatus { /** Job is finished. */ FINISHED = "FINISHED", /** Job has failed. */ FAILED = "FAILED" } /** @enumType */ type CompleteStatusWithLiterals = CompleteStatus | 'FINISHED' | 'FAILED'; interface CompleteAsyncJobResponse { } interface ReportAsyncJobProgressRequest { /** * Job ID. * @format GUID */ jobId?: string; /** * Job items being reported. * @maxSize 1000 */ items?: AsyncJobItem[]; } interface ReportAsyncJobProgressResponse { } interface AsyncJobItemAddedEvent { /** * Job ID. * @format GUID */ jobId?: string; /** Job items. */ jobItem?: AsyncJobItem; } interface ListAsyncJobItemsRequest { /** * Job ID. * @format GUID */ jobId: string; /** Pagination options. */ paging?: CursorPaging; /** async job item status filter. */ statusFilter?: StatusFilterWithLiterals; } 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; } declare enum StatusFilter { /** Return all items. */ ALL = "ALL", /** Return only failed items. */ FAILED_ONLY = "FAILED_ONLY", /** Return only successful items. */ SUCCESSFUL_ONLY = "SUCCESSFUL_ONLY" } /** @enumType */ type StatusFilterWithLiterals = StatusFilter | 'ALL' | 'FAILED_ONLY' | 'SUCCESSFUL_ONLY'; interface ListAsyncJobItemsResponse { /** Job items. */ results?: AsyncJobItem[]; /** Paging metadata. */ pagingMetadata?: PagingMetadataV2; } interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } interface Cursors { /** * Cursor pointing to next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to 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 { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } 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. */ currentEntityAsJson?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntityAsJson?: string | null; } interface ActionEvent { bodyAsJson?: 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; } type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function getAsyncJob(): __PublicMethodMetaInfo<'GET', { jobId: string; }, GetAsyncJobRequest$1, GetAsyncJobRequest, GetAsyncJobResponse$1, GetAsyncJobResponse>; declare function listAsyncJobItems(): __PublicMethodMetaInfo<'GET', { jobId: string; }, ListAsyncJobItemsRequest$1, ListAsyncJobItemsRequest, ListAsyncJobItemsResponse$1, ListAsyncJobItemsResponse>; export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type AnonymousVisitorIdOptions as AnonymousVisitorIdOptionsOriginal, type AppIdOptions as AppIdOptionsOriginal, type ApplicationError as ApplicationErrorOriginal, type AsyncJobFailedEvent as AsyncJobFailedEventOriginal, type AsyncJobFinishedEvent as AsyncJobFinishedEventOriginal, type AsyncJobItemAddedEvent as AsyncJobItemAddedEventOriginal, type AsyncJobItemFailedEvent as AsyncJobItemFailedEventOriginal, type AsyncJobItem as AsyncJobItemOriginal, type AsyncJob as AsyncJobOriginal, type CompleteAsyncJobRequest as CompleteAsyncJobRequestOriginal, type CompleteAsyncJobResponse as CompleteAsyncJobResponseOriginal, CompleteStatus as CompleteStatusOriginal, type CompleteStatusWithLiterals as CompleteStatusWithLiteralsOriginal, type Counters as CountersOriginal, type Counts as CountsOriginal, type CreateAsyncJobRequest as CreateAsyncJobRequestOriginal, type CreateAsyncJobResponse as CreateAsyncJobResponseOriginal, type CreatedByOptionsOneOf as CreatedByOptionsOneOfOriginal, type CreatedBy as CreatedByOriginal, type CursorPaging as CursorPagingOriginal, type Cursors as CursorsOriginal, type DeleteAsyncJobRequest as DeleteAsyncJobRequestOriginal, type DeleteAsyncJobResponse as DeleteAsyncJobResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type GetAsyncJobRequest as GetAsyncJobRequestOriginal, type GetAsyncJobResponse as GetAsyncJobResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type ListAsyncJobItemsRequest as ListAsyncJobItemsRequestOriginal, type ListAsyncJobItemsResponse as ListAsyncJobItemsResponseOriginal, type MemberIdOptions as MemberIdOptionsOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type OwnerIdOneOf as OwnerIdOneOfOriginal, type Owner as OwnerOriginal, type PagingMetadataV2 as PagingMetadataV2Original, type ReportAsyncJobProgressRequest as ReportAsyncJobProgressRequestOriginal, type ReportAsyncJobProgressResponse as ReportAsyncJobProgressResponseOriginal, type RestoreInfo as RestoreInfoOriginal, StatusFilter as StatusFilterOriginal, type StatusFilterWithLiterals as StatusFilterWithLiteralsOriginal, Status as StatusOriginal, type StatusWithLiterals as StatusWithLiteralsOriginal, Type as TypeOriginal, type TypeWithLiterals as TypeWithLiteralsOriginal, type UpdateAsyncJobRequest as UpdateAsyncJobRequestOriginal, type UpdateAsyncJobResponse as UpdateAsyncJobResponseOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type WixUserIdOptions as WixUserIdOptionsOriginal, type __PublicMethodMetaInfo, getAsyncJob, listAsyncJobItems };