/** Dummy entity. */ export interface MainEntity { /** * Dummy ID. * @readonly */ _id?: string; } export interface QueryDataItemsRequest { /** ID of the collection to query. */ collectionId: string; /** Query preferences. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) for information about handling data queries. */ query: QueryV2; /** * Fields for which to include the full referenced items in the query's results, rather than just their IDs. * Returned items are sorted in ascending order by the creation date of the reference. * If the field being querried is a multi-reference field and the array is empty, the response does not return any items. */ includeReferencedItems?: ReferencedItemToInclude[]; /** Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent. */ consistentRead: boolean; /** When `true`, the query response must include the total number of items that match the query. */ returnTotalCount: boolean; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. Paging mode is defined when the collection is created. */ 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`. Paging mode is defined when the collection is created. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Array of projected fields. A list of specific field names to return. */ fields?: string[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. Paging mode is defined when the collection is created. */ 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`. Paging mode is defined when the collection is created. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface CursorPaging { /** Number of items to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface ReferencedItemToInclude { /** Field name in the referencing collection. */ fieldKey?: string; /** Maximum number of referenced items to return. */ limit?: number; /** Filter criteria to specify which items to include in the response. */ filter?: Record | null; } export interface QueryDataItemsResponse { /** Retrieved items. */ items?: Record[] | null; /** Pagination information. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface ItemAlreadyExistsError { /** ID of the item that already exists. */ itemId?: string; } export interface ItemNotFoundError { /** ID of the item that was not found. */ itemId?: string; } export interface CollectionAlreadyExistsError { /** ID of the collection that already exists. */ collectionId?: string; } export interface CollectionNotFoundError { /** ID of the collection that was not found. */ collectionId?: string; } export interface ReferenceAlreadyExistsError { /** ID of the referring item. */ referringItemId?: string; /** ID of the referenced item. */ referencedItemId?: string; } export interface ReferenceNotFoundError { /** ID of the referring item. */ referringItemId?: string; /** ID of the referenced item. */ referencedItemId?: string; } export interface ValidationError { /** Violations that caused the validation to fail. */ violations?: ValidationViolation[]; } export interface ValidationViolation { /** Path to the invalid field that caused the violation. */ fieldPath?: string | null; /** The rejected value. */ rejectedValue?: string | null; /** Error message that describes the violation. */ message?: string; } export interface CollectionChangeNotSupported { /** Errors that caused the change to fail. Learn more about [errors](data/cloud-data-spi/proto-spi/docs/errors.md) in the External Database Connections service plugin. */ errors?: CollectionChangeNotSupportedError[]; } export interface CollectionChangeNotSupportedError { /** Key of collection field that can't be changed. */ fieldKey?: string | null; /** Error message with additional details. */ message?: string; } export interface CountDataItemsRequest { /** ID of the collection to query. */ collectionId: string; /** Filter to specify which items to count. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section) for more information about handling data queries. */ filter: Record | null; /** Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent. */ consistentRead: boolean; } export interface CountDataItemsResponse { /** Number of items that match the query. */ totalCount?: number; } export interface AggregateDataItemsRequest extends AggregateDataItemsRequestPagingMethodOneOf { paging?: Paging; cursorPaging?: CursorPaging; /** ID of the collection on which to run the aggregation. */ collectionId: string; /** Filter to apply to the collection's data before aggregation. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section) for more information about handling data queries. */ initialFilter?: Record | null; /** Aggregation to apply to the data. */ aggregation?: Aggregation; /** Filter to apply to the processed data after aggregation. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section) for more information about handling data queries. */ finalFilter?: Record | null; /** Sorting configuration. */ sort?: Sorting[]; /** Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent. */ consistentRead: boolean; /** When `true`, the query response must include the total number of items that match the query. */ returnTotalCount: boolean; } /** @oneof */ export interface AggregateDataItemsRequestPagingMethodOneOf { paging?: Paging; cursorPaging?: CursorPaging; } export interface Operation extends OperationCalculateOneOf { /** Calculate the average value of a specified field for all items in the grouping. */ average?: Average; /** Calculate the minimum value of a specified field for all items in the grouping. */ min?: Min; /** Calculate the maximum value of a specified field for all items in the grouping. */ max?: Max; /** Calculate the sum of values of a specified field for all items in the grouping. */ sum?: Sum; /** Calculate the number of items in the grouping. */ itemCount?: Count; /** Name of the field that contains the results of the operation. */ resultFieldName?: string; } /** @oneof */ export interface OperationCalculateOneOf { /** Calculate the average value of a specified field for all items in the grouping. */ average?: Average; /** Calculate the minimum value of a specified field for all items in the grouping. */ min?: Min; /** Calculate the maximum value of a specified field for all items in the grouping. */ max?: Max; /** Calculate the sum of values of a specified field for all items in the grouping. */ sum?: Sum; /** Calculate the number of items in the grouping. */ itemCount?: Count; } export interface Average { /** Name of the field for which to calculate the average value. */ itemFieldName?: string; } export interface Min { /** Name of the field for which to calculate the minimum value. */ itemFieldName?: string; } export interface Max { /** Name of the field for which to calculate the maximum value. */ itemFieldName?: string; } export interface Sum { /** Name of the field for which to calculate the sum. */ itemFieldName?: string; } export interface Count { } export interface Aggregation { /** Fields by which to group items for the aggregation, in the order they appear in the array. If empty, the aggregation must be applied to the entire collection. */ groupingFields?: string[]; /** Operations to carry out on the data in each grouping. */ operations?: Operation[]; } export interface AggregateDataItemsResponse { /** Aggregation results. Each result must contain a field for each `groupingFields` value, and a field for each `operations.resultFieldName` value. */ items?: Record[] | null; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface QueryDistinctValuesRequest extends QueryDistinctValuesRequestPagingMethodOneOf { paging?: Paging; cursorPaging?: CursorPaging; /** ID of the collection to query. */ collectionId: string; /** Filter to apply to the collection's data before aggregation. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section) for more information about handling data queries. */ filter?: Record | null; /** Item field name for which to return all distinct values. */ fieldName: string; /** Order to by which to sort the results. Valid values are `ASC` and `DESC`. */ order?: SortOrder; /** Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent. */ consistentRead: boolean; /** When `true`, the query response must include the total number of items that match the query. */ returnTotalCount: boolean; } /** @oneof */ export interface QueryDistinctValuesRequestPagingMethodOneOf { paging?: Paging; cursorPaging?: CursorPaging; } export interface QueryDistinctValuesResponse { /** * List of distinct values contained in the field specified in `fieldName`. Values can be of any JSON type. * If the field is an array, values must be unwound, independent values. For example, if the field name contains `["a", "b", "c"]`, the result must contain `"a"`, `"b"` and `"c"` as separate values. */ distinctValues?: any[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface InsertDataItemsRequest { /** ID of the collection in which to insert the items. */ collectionId: string; /** Items to insert. */ items: Record[] | null; } export interface InsertDataItemsResponse { /** Response must include either the inserted item or an error. */ results?: DataItemModificationResult[]; } export interface DataItemModificationResult extends DataItemModificationResultResultOneOf { /** Item that was inserted, updated or removed. */ item?: Record | null; /** Error indicating why the operation failed for a particular item. Learn more about [error types](https://dev.wix.com/docs/rest/assets/data/external-database-spi/understanding-error-types-in-the-external-database-connections-spi) in the External Database Connections service plugin. */ error?: Error; } /** @oneof */ export interface DataItemModificationResultResultOneOf { /** Item that was inserted, updated or removed. */ item?: Record | null; /** Error indicating why the operation failed for a particular item. Learn more about [error types](https://dev.wix.com/docs/rest/assets/data/external-database-spi/understanding-error-types-in-the-external-database-connections-spi) in the External Database Connections service plugin. */ error?: Error; } export interface Error { /** Error code. */ errorCode?: string; /** Error description. */ errorMessage?: string | null; /** Additional error data specific to the error code. */ data?: Record | null; } export interface UpdateDataItemsRequest { /** ID of the collection in which to update the items. */ collectionId: string; /** Items to update. */ items: Record[] | null; } export interface UpdateDataItemsResponse { /** Response must include either the updated item or an error. */ results?: DataItemModificationResult[]; } export interface RemoveDataItemsRequest { /** ID of the collection from which to remove items. */ collectionId: string; /** IDs of items to remove. */ itemIds: string[]; } export interface RemoveDataItemsResponse { /** Response must include either the removed item or an error. */ results?: DataItemModificationResult[]; } export interface TruncateDataItemsRequest { /** ID of the collection from which to remove all items. */ collectionId: string; } export interface TruncateDataItemsResponse { } export interface QueryReferencedDataItemsRequest extends QueryReferencedDataItemsRequestPagingMethodOneOf { /** Offset-based paging */ paging?: Paging; /** Cursor-based paging */ cursorPaging?: CursorPaging; /** ID of the collection to query. */ collectionId: string; /** IDs of the referring items. If the array is empty, return results for all referring items. */ referringItemIds?: string[]; /** IDs of the referenced items. If the array is empty, return all referenced items for the referring items. */ referencedItemIds?: string[]; /** Order to by which to sort the results. Valid values are `ASC` and `DESC`. */ order?: SortOrder; /** Field key to query in the referring collection. */ referringFieldKey: string; /** Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent. */ consistentRead: boolean; /** Fields to return in the referenced item. If the array is empty or not provided, all fields in the referenced item are returned. */ fieldsToReturn?: string[]; /** When `true`, the response includes the total number of the items that match the query. */ returnTotalCount: boolean; /** When `true`, the response includes the full referenced items. When `false`, only the IDs of referenced items be returned. */ includeReferencedItems: boolean; } /** @oneof */ export interface QueryReferencedDataItemsRequestPagingMethodOneOf { /** Offset-based paging */ paging?: Paging; /** Cursor-based paging */ cursorPaging?: CursorPaging; } export interface QueryReferencedDataItemsResponse { /** Retrieved references. */ items?: ReferencedItem[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface ReferencedItem { /** ID of the item in the referring collection. */ referringItemId?: string; /** ID of the item in the referenced collection. */ referencedItemId?: string; /** Item in the referenced collection. If the external database does not support returning referenced items, this field can remain empty. */ referencedItem?: Record | null; } export interface InsertDataItemReferencesRequest { /** ID of the referring collection. */ collectionId: string; /** Field key of the field in the referring collection to insert references into. */ referringFieldKey: string; /** References to insert. */ references: ReferenceId[]; } export interface ReferenceId { /** ID of the item in the referring collection. */ referringItemId?: string; /** ID of the item in the referenced collection. */ referencedItemId?: string; } export interface InsertDataItemReferencesResponse { /** Response must include either the inserted reference or an error. */ results?: ReferenceModificationResult[]; } export interface ReferenceModificationResult extends ReferenceModificationResultResultOneOf { /** Reference that was inserted or removed. */ reference?: ReferenceId; /** Error indicating why the operation failed for a particular item. Learn more about [error types](https://dev.wix.com/docs/rest/assets/data/external-database-spi/understanding-error-types-in-the-external-database-connections-spi) in the External Database Connections service plugin. */ error?: Error; } /** @oneof */ export interface ReferenceModificationResultResultOneOf { /** Reference that was inserted or removed. */ reference?: ReferenceId; /** Error indicating why the operation failed for a particular item. Learn more about [error types](https://dev.wix.com/docs/rest/assets/data/external-database-spi/understanding-error-types-in-the-external-database-connections-spi) in the External Database Connections service plugin. */ error?: Error; } export interface RemoveDataItemReferencesRequest { /** ID of the referring collection. */ collectionId: string; /** Field key of the field in the referring collection to remove references from. */ referringFieldKey: string; /** References to remove. */ references: ReferenceId[]; } export interface RemoveDataItemReferencesResponse { /** Response must include either the removed reference or an error. */ results?: ReferenceModificationResult[]; } export interface ListCollectionsRequest { /** IDs of collections to retrieve. If empty, all available collections are retrieved. */ collectionIds?: string[]; } export interface ListCollectionsResponse { /** List of the retrieved collections. */ collections?: Collection[]; } export interface Collection { /** ID of the collection. */ _id?: string; /** Collection display name as it appears in the CMS. For example, `My First Collection`. */ displayName?: string | null; /** Collection fields. */ fields?: Field[]; /** * Capabilities the collection supports. This is set by the external database, and is ignored in the body of the request. * @readonly */ capabilities?: CollectionCapabilities; /** Levels of permission for accessing and modifying data. These are defined by the lowest role needed to perform each action. */ permissions?: Permissions; /** * Whether the collection supports cursor- or offset-based paging. Each paging mode requires different configuration parameters. * @readonly */ pagingMode?: PagingMode; } export interface Field extends FieldTypeOptionsOneOf { singleReferenceOptions?: SingleReferenceOptions; multiReferenceOptions?: MultiReferenceOptions; arrayOptions?: ArrayOptions; objectOptions?: ObjectOptions; /** Field identifier. */ key?: string; /** Field display name as it appears in the CMS. For example, `First Name`. */ displayName?: string | null; /** Field description. */ description?: string | null; /** Field type. */ type?: FieldType; /** * Capabilities the collection supports. This is set by the external database and is ignored in the body of the request. * @readonly */ capabilities?: FieldCapabilities; /** Whether the field value is encrypted and sent as an object. Encryption and decryption are handled by Wix. Default: `false`. */ encrypted?: boolean; } /** @oneof */ export interface FieldTypeOptionsOneOf { singleReferenceOptions?: SingleReferenceOptions; multiReferenceOptions?: MultiReferenceOptions; arrayOptions?: ArrayOptions; objectOptions?: ObjectOptions; } export declare enum FieldType { UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE", TEXT = "TEXT", NUMBER = "NUMBER", DATE = "DATE", DATETIME = "DATETIME", IMAGE = "IMAGE", BOOLEAN = "BOOLEAN", DOCUMENT = "DOCUMENT", URL = "URL", RICH_TEXT = "RICH_TEXT", VIDEO = "VIDEO", ANY = "ANY", ARRAY_STRING = "ARRAY_STRING", ARRAY_DOCUMENT = "ARRAY_DOCUMENT", AUDIO = "AUDIO", TIME = "TIME", LANGUAGE = "LANGUAGE", RICH_CONTENT = "RICH_CONTENT", MEDIA_GALLERY = "MEDIA_GALLERY", ADDRESS = "ADDRESS", REFERENCE = "REFERENCE", MULTI_REFERENCE = "MULTI_REFERENCE", OBJECT = "OBJECT", ARRAY = "ARRAY" } export interface FieldCapabilities { /** Whether the field can be used to sort the items in a collection. Default: `false`. */ sortable?: boolean; /** Query operators that can be used for this field. */ queryOperators?: QueryOperator[]; } export declare enum QueryOperator { EQ = "EQ", LT = "LT", GT = "GT", NE = "NE", LTE = "LTE", GTE = "GTE", STARTS_WITH = "STARTS_WITH", ENDS_WITH = "ENDS_WITH", CONTAINS = "CONTAINS", HAS_SOME = "HAS_SOME", HAS_ALL = "HAS_ALL", EXISTS = "EXISTS", URLIZED = "URLIZED" } export interface SingleReferenceOptions { /** * ID of the referenced collection. * * When the referring field is a single-reference field, it refers to the `_id` field of the referenced collection. */ referencedCollectionId?: string; } export interface MultiReferenceOptions { /** ID of the referenced collection. */ referencedCollectionId?: string; /** Field key of the referenced field in the referenced collection. */ referencedCollectionFieldKey?: string | null; /** Field display name of the referenced field in the referenced collection. */ referencedCollectionFieldDisplayName?: string | null; } export interface ArrayOptions extends ArrayOptionsTypeOptionsOneOf { singleReferenceOptions?: SingleReferenceOptions; multiReferenceOptions?: MultiReferenceOptions; arrayOptions?: ArrayOptions; objectOptions?: ObjectOptions; /** Element data type. */ elementType?: FieldType; } /** @oneof */ export interface ArrayOptionsTypeOptionsOneOf { singleReferenceOptions?: SingleReferenceOptions; multiReferenceOptions?: MultiReferenceOptions; arrayOptions?: ArrayOptions; objectOptions?: ObjectOptions; } export interface ObjectOptions { /** Fields within the object. */ fields?: ObjectField[]; } export interface ObjectField extends ObjectFieldTypeOptionsOneOf { singleReferenceOptions?: SingleReferenceOptions; multiReferenceOptions?: MultiReferenceOptions; arrayOptions?: ArrayOptions; objectOptions?: ObjectOptions; /** Field key. */ key?: string; /** Field display name. */ displayName?: string | null; /** Field type. */ type?: FieldType; /** * Capabilities the object field supports. * @readonly */ capabilities?: FieldCapabilities; } /** @oneof */ export interface ObjectFieldTypeOptionsOneOf { singleReferenceOptions?: SingleReferenceOptions; multiReferenceOptions?: MultiReferenceOptions; arrayOptions?: ArrayOptions; objectOptions?: ObjectOptions; } export interface CollectionCapabilities { /** Data operations that can be performed on items in the collection. */ dataOperations?: DataOperation[]; } export declare enum DataOperation { QUERY = "QUERY", COUNT = "COUNT", QUERY_REFERENCED = "QUERY_REFERENCED", AGGREGATE = "AGGREGATE", DISTINCT = "DISTINCT", INSERT = "INSERT", UPDATE = "UPDATE", REMOVE = "REMOVE", TRUNCATE = "TRUNCATE", INSERT_REFERENCES = "INSERT_REFERENCES", REMOVE_REFERENCES = "REMOVE_REFERENCES" } export interface Permissions { /** Lowest role required to add a collection. */ insert?: Role; /** Lowest role required to update a collection. */ update?: Role; /** Lowest role required to remove a collection. */ remove?: Role; /** Lowest role required to read a collection. */ read?: Role; } export declare enum Role { /** Site administrator. */ ADMIN = "ADMIN", /** A signed-in user who inserted content to this collection. */ SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR", /** Any signed-in user. */ SITE_MEMBER = "SITE_MEMBER", /** Any site visitor. */ ANYONE = "ANYONE" } export declare enum PagingMode { UNKNOWN_PAGING_MODE = "UNKNOWN_PAGING_MODE", /** Offset-based paging. */ OFFSET = "OFFSET", /** Cursor-based paging. */ CURSOR = "CURSOR" } export interface CreateCollectionRequest { /** Details of the collection to create. */ collection?: Collection; } export interface CreateCollectionResponse { /** Details of the created collection. */ collection?: Collection; } export interface UpdateCollectionRequest { /** Updated structure details for the specified collection. */ collection?: Collection; } export interface UpdateCollectionResponse { /** Updated collection details. */ collection?: Collection; } export interface DeleteCollectionRequest { /** ID of the collection to delete. */ collectionId: string; } export interface DeleteCollectionResponse { } export interface GetCapabilitiesRequest { } export interface GetCapabilitiesResponse { /** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */ supportsCollectionModifications?: boolean; /** Field types the external database supports. This field only applies when `supportsCollectionModifications` is true. */ supportedFieldTypes?: FieldType[]; } export interface IndexOptions { /** Whether the external database supports creating, listing and removing indexes. */ supportsIndexes?: boolean; /** Maximum number of regular (non-unique) indexes allowed for this collection. */ maxNumberOfRegularIndexesPerCollection?: number; /** Maximum number of unique indexes allowed for this collection. */ maxNumberOfUniqueIndexesPerCollection?: number; /** Maximum number of regular and unique indexes allowed for this collection. */ maxNumberOfIndexesPerCollection?: number; } export interface ListIndexesRequest { /** collection to list indexes from */ collectionId: string; } export interface ListIndexesResponse { /** list of indexes */ indexes?: Index[]; } export interface Index { /** Index name */ name?: string; /** Fields over which the index is defined */ fields?: IndexField[]; /** * Indicates current status of index * @readonly */ status?: Status; /** If true index will enforce that values in the field are unique in scope of a collection. Default is false. */ unique?: boolean; /** If true index will be case-insensitive. Default is false. */ caseInsensitive?: boolean; /** * Contains details about failure reason when index is in *FAILED* status * @readonly */ failure?: Error; } /** * Order determines how values are ordered in the index. This is important when * ordering and/or range querying by indexed fields. */ export declare enum Order { ASC = "ASC", DESC = "DESC" } export interface IndexField { /** Field to index. For example: title, options.price */ path?: string; /** Order in which to keep the values. Default is ASC. */ order?: Order; } export declare enum Status { /** Place holder. Never returned by the service. */ UNKNOWN = "UNKNOWN", /** Index creation is in progress. */ BUILDING = "BUILDING", /** Index has been successfully created. It can be used in queries. */ ACTIVE = "ACTIVE", /** Index is being dropped. */ DROPPING = "DROPPING", /** Index is successfully dropped. */ DROPPED = "DROPPED", /** Index creation has failed. */ FAILED = "FAILED", /** Index contains incorrectly indexed data. */ INVALID = "INVALID" } export interface CreateIndexRequest { /** collection to list indexes from */ collectionId: string; /** index definition */ index: Index; } export interface CreateIndexResponse { /** created index and it's status */ index?: Index; } export interface RemoveIndexRequest { /** collection to delete index from */ collectionId: string; /** index name */ indexName: string; } export interface RemoveIndexResponse { } export interface ExternalDatabaseSpiConfig { /** The URI where the service provider is deployed. */ uriConfig?: SpiBaseUri; /** The namespace of the external database. This can be used to access collections within the database, for example `namespace/collectionId`. */ namespace?: string; } export interface SpiBaseUri { /** URI that will be used by the host to call the implementer. The path-suffix defined on the method will be appended to it */ baseUri?: string; /** override method mappings per method */ alternativeUris?: AlternativeUri[]; } export interface AlternativeUri { /** name of the method as it appears in the proto */ methodName?: string; /** absolute uri that will be used by the host to call that method. The path-suffix mapped from the method http option will NOT be appended to this URI. For TPAs. it must be https */ absoluteUri?: string; } /** * this message is not directly used by any service, * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. * e.g. SPIs, event-handlers, etc.. * NOTE: this context object MUST be provided as the last argument in each Velo method signature. * * Example: * ```typescript * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { * ... * } * ``` */ export interface Context { /** A unique identifier for each request. Can be used for logging / troubleshooting */ requestId?: string | null; /** 3 capital letters string representing a currency according to ISO-4217 */ currency?: string | null; /** The identification type and identity data */ identity?: IdentificationData; /** A string representing a language and region in the format of "xx-XX". First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2 */ languages?: string[]; /** App instance ID of SPI in context */ instanceId?: string | null; } export declare enum IdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: IdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; }