import { CreateIndexRequest as CreateIndexRequest$1, CreateIndexResponse as CreateIndexResponse$1, DropIndexRequest as DropIndexRequest$1, DropIndexResponse as DropIndexResponse$1, ListIndexesRequest as ListIndexesRequest$1, ListIndexesResponse as ListIndexesResponse$1, ListAvailableIndexesRequest as ListAvailableIndexesRequest$1, ListAvailableIndexesResponse as ListAvailableIndexesResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */ interface Index { /** * ID of the index. * @readonly * @format GUID */ id?: string; /** * Name of the index. * @minLength 1 * @maxLength 128 */ name?: string; /** * Fields for which the index is defined. * * Max: 3 fields (for a unique index: 1 field) * @minSize 1 * @maxSize 3 */ fields?: Field[]; /** * Current status of the index. * @readonly */ status?: StatusWithLiterals; /** * Contains details about the reasons for failure when `status` is `FAILED`. * @readonly */ failure?: Failure; /** * Whether the index enforces uniqueness of values in the field for which it's defined. * If `true`, the index can have only 1 field. * * Default: `false` */ unique?: boolean; /** * Whether the index ignores case. * * Default: `false` */ caseInsensitive?: boolean; /** * Source of the index. See index sources in [Index Types](https://dev.wix.com/docs/api-reference/business-solutions/cms/indexes/index-types#index-sources). * * Default: `USER` */ source?: IndexSourceWithLiterals; } /** * Order determines how values are ordered in the index. This is important when * ordering and/or range querying by indexed fields. */ declare enum Order { ASC = "ASC", DESC = "DESC" } /** @enumType */ type OrderWithLiterals = Order | 'ASC' | 'DESC'; interface Field { /** * Path of the field to index. For example: `title` or `options.price`. * @minLength 1 * @maxLength 128 */ path?: string; /** * Sort order for the index. Base on how the data is regularly queried. * * Default: `ASC` */ order?: OrderWithLiterals; } declare enum Status { /** Place holder. Never returned by the service. */ UNKNOWN = "UNKNOWN", /** Index creation is in progress. */ BUILDING = "BUILDING", /** Index has been successfully created and can be used in queries. */ ACTIVE = "ACTIVE", /** Index is in the process of being dropped. */ DROPPING = "DROPPING", /** Index has been dropped successfully. */ DROPPED = "DROPPED", /** Index creation has failed. */ FAILED = "FAILED", /** Index contains incorrectly indexed data. */ INVALID = "INVALID" } /** @enumType */ type StatusWithLiterals = Status | 'UNKNOWN' | 'BUILDING' | 'ACTIVE' | 'DROPPING' | 'DROPPED' | 'FAILED' | 'INVALID'; interface Failure { /** * Error code. * - `WDE0112`: Unknown error while building collection index. * - `WDE0113`: Duplicate key error while building collection index. * - `WDE0114`: Document too large while building collection index. * @maxLength 7 */ code?: string; /** * Description of the failure. * @maxLength 1024 */ description?: string; /** * ID of the data item that caused the failure. * For example, if `unique` is `true`, the ID of an item containing a duplicate value. * @maxLength 16000 */ itemId?: string | null; } declare enum IndexSource { /** Place holder. Never returned by the service. */ UNKNOWN_INDEX_SOURCE = "UNKNOWN_INDEX_SOURCE", /** * Automatically created by Wix for all collections. * * System indexes are created for essential attributes, such as ID and creation date. * You can't delete them and they don't count towards the index limit. */ SYSTEM = "SYSTEM", /** Created by a Wix user via the API or in the dashboard. */ USER = "USER", /** * Created automatically by Wix based on a Wix user's queries. * * For large collections, Wix identifies slow-running queries and creates indexes automatically to improve performance. * These indexes don't count towards the index limit. They're created dynamically, and may be deleted if they no longer fit * the system's parameters. To keep an automatic index permanently, manually create an identical `USER` index. */ AUTO = "AUTO" } /** @enumType */ type IndexSourceWithLiterals = IndexSource | 'UNKNOWN_INDEX_SOURCE' | 'SYSTEM' | 'USER' | 'AUTO'; interface CreateIndexRequest { /** Details of the index to be created. */ index: Index; /** * ID of the data collection for which to generate the index. * @maxLength 256 */ dataCollectionId: string; } declare enum Environment { /** Place holder. Never returned by the service. */ UNKNOWN_ENVIRONMENT = "UNKNOWN_ENVIRONMENT", /** Collection [sandbox environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing#sandbox-collections). */ SANDBOX = "SANDBOX", /** If the [collection's sandbox environment is enabled](https://support.wix.com/en/article/cms-accessing-and-syncing-your-sandbox-and-live-collections#enabling-sandbox-collections), run the task in the collection's sandbox environment. If not, run the task in the collection's live environment. */ SANDBOX_PREFERRED = "SANDBOX_PREFERRED", /** Collection [live environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing#live-collections). */ LIVE = "LIVE" } /** @enumType */ type EnvironmentWithLiterals = Environment | 'UNKNOWN_ENVIRONMENT' | 'SANDBOX' | 'SANDBOX_PREFERRED' | 'LIVE'; interface CreateIndexResponse { /** Details of the index being generated. */ index?: Index; } interface DropIndexRequest { /** * Name of the index to drop. * @minLength 1 * @maxLength 128 */ indexName: string; /** * ID of the data collection for which the index to be dropped is defined. * @maxLength 1024 */ dataCollectionId: string; } interface DropIndexResponse { } interface ListIndexesRequest { /** * ID of the data collection for which to list indexes. * @maxLength 1024 */ dataCollectionId: string; /** Paging options to limit and skip the number of items. */ paging?: Paging; } interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface ListIndexesResponse { /** List of all indexes for the requested data collection. */ indexes?: Index[]; /** Paging metadata. */ pagingMetadata?: PagingMetadata; } interface PagingMetadata { /** 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. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; } interface ListAvailableIndexesRequest { /** * Data collection to show available indexes for * @maxLength 256 */ dataCollectionId: string; } interface ListAvailableIndexesResponse { /** * limit of regular single-field indexes, even if 0 1-field indices may be created using * 3-field quota (if available) */ regular1Field?: number; /** limit of regular indexes up to 3-fields (in addition to 1-field indexes quota) */ regular3Field?: number; /** limit of unique indexes */ unique1Field?: number; /** Overall index limit, missing value means there's no overall limit */ total?: number | 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 createIndex(): __PublicMethodMetaInfo<'POST', {}, CreateIndexRequest$1, CreateIndexRequest, CreateIndexResponse$1, CreateIndexResponse>; declare function dropIndex(): __PublicMethodMetaInfo<'DELETE', {}, DropIndexRequest$1, DropIndexRequest, DropIndexResponse$1, DropIndexResponse>; declare function listIndexes(): __PublicMethodMetaInfo<'GET', {}, ListIndexesRequest$1, ListIndexesRequest, ListIndexesResponse$1, ListIndexesResponse>; declare function listAvailableIndexes(): __PublicMethodMetaInfo<'GET', {}, ListAvailableIndexesRequest$1, ListAvailableIndexesRequest, ListAvailableIndexesResponse$1, ListAvailableIndexesResponse>; export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type CreateIndexRequest as CreateIndexRequestOriginal, type CreateIndexResponse as CreateIndexResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type DropIndexRequest as DropIndexRequestOriginal, type DropIndexResponse as DropIndexResponseOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, Environment as EnvironmentOriginal, type EnvironmentWithLiterals as EnvironmentWithLiteralsOriginal, type Failure as FailureOriginal, type Field as FieldOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type Index as IndexOriginal, IndexSource as IndexSourceOriginal, type IndexSourceWithLiterals as IndexSourceWithLiteralsOriginal, type ListAvailableIndexesRequest as ListAvailableIndexesRequestOriginal, type ListAvailableIndexesResponse as ListAvailableIndexesResponseOriginal, type ListIndexesRequest as ListIndexesRequestOriginal, type ListIndexesResponse as ListIndexesResponseOriginal, type MessageEnvelope as MessageEnvelopeOriginal, Order as OrderOriginal, type OrderWithLiterals as OrderWithLiteralsOriginal, type PagingMetadata as PagingMetadataOriginal, type Paging as PagingOriginal, type RestoreInfo as RestoreInfoOriginal, Status as StatusOriginal, type StatusWithLiterals as StatusWithLiteralsOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, createIndex, dropIndex, listAvailableIndexes, listIndexes };