/** A data collection determines the structure of data to be stored in a database. */ export interface DataCollection { /** Collection ID. For example, `my-first-collection`. May include a namespace. */ _id?: string; /** * Collection type. Indicates how the collection was created and how it is stored. * @readonly */ collectionType?: CollectionType; /** * ID of the app that defined this collection. For collections defined by Wix users, this value is null. * @readonly */ ownerAppId?: string | null; /** * Maximum number of items returned in a single query, based on the underlying storage. * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries. * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000. * @readonly */ maxPageSize?: number | null; /** Collection's display name as shown in the CMS. For example, `My First Collection`. */ displayName?: string | null; /** * Default item sorting order when a query doesn't specify one. * @readonly */ defaultDisplayOrder?: Sort; /** * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings. * Empty for all data collections not owned by Wix apps. * @readonly */ displayNamespace?: string | null; /** Field whose value the CMS displays to represent the collection item when referenced in a different collection. */ displayField?: string | null; /** * Capabilities the collection supports. * @readonly */ capabilities?: CollectionCapabilities; /** Collection's field structure. */ fields?: Field[]; /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */ permissions?: Permissions; /** * Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must specify the latest revision number. * @readonly */ revision?: string | null; /** Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */ plugins?: Plugin[]; /** * Paging modes the collection supports. In native collections, offset-based paging is supported by default. * @readonly */ pagingModes?: PagingMode[]; /** * Date the collection was created. * @readonly */ _createdDate?: Date | null; /** * Date the collection was last updated. * @readonly */ _updatedDate?: Date | null; } export declare enum CollectionType { /** User-created collection. */ NATIVE = "NATIVE", /** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */ WIX_APP = "WIX_APP", /** Collection created by a Wix Blocks app. */ BLOCKS_APP = "BLOCKS_APP", /** Collection located in externally connected storage. */ EXTERNAL = "EXTERNAL" } export interface Sort { /** Field to sort by. */ fieldKey?: string; /** * Sort order. Use `ASC` for ascending order or `DESC` for descending order. * * Default: `ASC` */ direction?: Direction; } export declare enum Direction { ASC = "ASC", DESC = "DESC" } export interface CollectionCapabilities { /** * Data operations the collection supports. The listed operations can be performed on data the collection contains. * * > **Note**: The `PATCH` and `BULK_PATCH` oeprations aren't currently supported. */ dataOperations?: DataOperation[]; /** Collection operations supported. The listed operations can be performed on the collection itself. */ collectionOperations?: CollectionOperation[]; /** Maximum number of indexes for the collection. */ indexLimits?: IndexLimits; } export declare enum DataOperation { AGGREGATE = "AGGREGATE", BULK_INSERT = "BULK_INSERT", BULK_REMOVE = "BULK_REMOVE", BULK_SAVE = "BULK_SAVE", BULK_UPDATE = "BULK_UPDATE", COUNT = "COUNT", DISTINCT = "DISTINCT", FIND = "FIND", GET = "GET", INSERT = "INSERT", INSERT_REFERENCE = "INSERT_REFERENCE", IS_REFERENCED = "IS_REFERENCED", QUERY_REFERENCED = "QUERY_REFERENCED", REMOVE = "REMOVE", REMOVE_REFERENCE = "REMOVE_REFERENCE", REPLACE_REFERENCES = "REPLACE_REFERENCES", SAVE = "SAVE", TRUNCATE = "TRUNCATE", UPDATE = "UPDATE", PATCH = "PATCH", BULK_PATCH = "BULK_PATCH" } export declare enum CollectionOperation { /** Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed. */ UPDATE = "UPDATE", /** Allows deleting the entire collection. If not included, the collection can't be deleted. */ REMOVE = "REMOVE" } export interface IndexLimits { /** Maximum number of regular (non-unique) indexes allowed for this collection. */ regular?: number; /** Maximum number of unique indexes allowed for this collection. */ unique?: number; /** Maximum number of regular and unique indexes allowed for this collection. */ total?: number; } export interface Field extends FieldRangeValidationsOneOf { /** Range of possible values for a numerical field. */ numberRange?: NumberRange; /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */ stringLengthRange?: StringLengthRange; /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */ arraySizeRange?: ArraySizeRange; /** Unique identifier for the field. For example, `firstName`. */ key?: string; /** Field's display name when displayed in the CMS. For example, `First Name`. */ displayName?: string | null; /** Field's data type. */ type?: Type; /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */ typeMetadata?: TypeMetadata; /** * Whether the field is a system field. * @readonly */ systemField?: boolean; /** * Capabilities the field supports. * @readonly */ capabilities?: FieldCapabilities; /** Whether the field is encrypted. */ encrypted?: boolean; /** Field description. */ description?: string | null; /** * Whether the field is read-only. A read-only field can't be changed. * * Default: `false` */ readOnly?: boolean | null; /** * Whether the field is immutable. An immutable field can be set once, but then cannot be updated. * * Default: `false` */ immutable?: boolean | null; /** * Whether the field is required. * * Default: `false` */ required?: boolean | null; /** Additional optional plugins for the field. */ plugins?: FieldPlugin[]; } /** @oneof */ export interface FieldRangeValidationsOneOf { /** Range of possible values for a numerical field. */ numberRange?: NumberRange; /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */ stringLengthRange?: StringLengthRange; /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */ arraySizeRange?: ArraySizeRange; } export declare enum Type { 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", PAGE_LINK = "PAGE_LINK", REFERENCE = "REFERENCE", MULTI_REFERENCE = "MULTI_REFERENCE", OBJECT = "OBJECT", ARRAY = "ARRAY", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_TIME = "LEGACY_TIME", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_BOOK = "LEGACY_BOOK", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_IMAGE = "LEGACY_IMAGE", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_COLOR = "LEGACY_COLOR", /** Deprecated - can’t be added to collections. Can only appear in older collections. */ LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO" } export interface TypeMetadata extends TypeMetadataMetadataOneOf { /** Metadata for a reference field. */ reference?: Reference; /** Metadata for a multi-reference field. */ multiReference?: MultiReference; /** Metadata for an object field. */ object?: _Object; /** Metadata for an array field. */ array?: _Array; /** Metadata for a page link field. */ pageLink?: PageLink; } /** @oneof */ export interface TypeMetadataMetadataOneOf { /** Metadata for a reference field. */ reference?: Reference; /** Metadata for a multi-reference field. */ multiReference?: MultiReference; /** Metadata for an object field. */ object?: _Object; /** Metadata for an array field. */ array?: _Array; /** Metadata for a page link field. */ pageLink?: PageLink; } export interface FieldCapabilities { /** * Whether the collection can be sorted by this field. * * 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 ObjectField { /** Field ID. */ key?: string; /** Display name for the field. */ displayName?: string | null; /** Field type. */ type?: Type; /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */ typeMetadata?: TypeMetadata; /** * Capabilities the object field supports. * @readonly */ capabilities?: FieldCapabilities; } export interface FieldsPattern { pattern?: string; lowercase?: boolean; } export interface UrlizedOnlyPattern { pattern?: string; } export interface Calculator extends CalculatorPatternOneOf { /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */ fieldsPattern?: FieldsPattern; /** Value is only URL encoded. */ urlizedOnlyPattern?: UrlizedOnlyPattern; } /** @oneof */ export interface CalculatorPatternOneOf { /** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */ fieldsPattern?: FieldsPattern; /** Value is only URL encoded. */ urlizedOnlyPattern?: UrlizedOnlyPattern; } export interface Reference { /** Referenced collection ID. */ referencedCollectionId?: string; } export interface MultiReference { /** Referenced collection ID. */ referencedCollectionId?: string; /** Referencing field ID. */ referencingFieldKey?: string; /** Display name in the CMS for the referenced data. */ referencingDisplayName?: string; } export interface _Object { /** Fields within the object. */ fields?: ObjectField[]; } export interface _Array { /** Element's data type. */ elementType?: Type; /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */ typeMetadata?: TypeMetadata; } export interface PageLink { calculator?: Calculator; /** Defines reference to router pattern in the site document. */ linkedRouterPage?: string | null; } export interface NumberRange { /** * Minimum permitted value for a numerical field. * * Default: No validation */ min?: number | null; /** * Maximum permitted value for a numerical field. * * Default: No validation */ max?: number | null; } export interface StringLengthRange { /** * Minimum permitted length for a text field. * * Default: No validation */ minLength?: number | null; /** * Maximum permitted length for a text field. * * Default: No validation */ maxLength?: number | null; } export interface ArraySizeRange { /** * Minimum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. * * Default: No validation */ minSize?: number | null; /** * Maximum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. * * Default: No validation */ maxSize?: number | null; } /** Optional plug-in aspects for fields */ export interface FieldPlugin extends FieldPluginOptionsOneOf { /** Options for the CMS plugin. */ cmsOptions?: CmsOptions; type?: FieldPluginType; } /** @oneof */ export interface FieldPluginOptionsOneOf { /** Options for the CMS plugin. */ cmsOptions?: CmsOptions; } export declare enum FieldPluginType { /** Uknown plugin type. */ UNKNOWN = "UNKNOWN", /** CMS-related field attributes */ CMS = "CMS" } /** Options for the CMS plugin. */ export interface CmsOptions { /** * Indicates an internal CMS field. The CMS does not display internal fields. * * Default: `false` */ internal?: boolean; } /** Permissions defined by the lowest role needed to perform each action. */ export interface Permissions { /** Lowest role needed to add a collection. */ insert?: Role; /** Lowest role needed to update a collection. */ update?: Role; /** Lowest role needed to remove a collection. */ remove?: Role; /** Lowest role needed to read a collection. */ read?: Role; } export declare enum Role { /** Unknown role. */ UNKNOWN_ROLE = "UNKNOWN_ROLE", /** Site administrator. */ ADMIN = "ADMIN", /** Signed-in user who added content to this collection. */ SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR", /** Any signed-in user. */ SITE_MEMBER = "SITE_MEMBER", /** Any site visitor. */ ANYONE = "ANYONE" } export interface Plugin extends PluginOptionsOneOf { /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishOptions?: PublishPluginOptions; /** Options for the Single Item plugin. */ singleItemOptions?: SingleItemPluginOptions; /** Options for the Urlized plugin. */ urlizedOptions?: UrlizedPluginOptions; /** Options for the Multilingual plugin. */ multilingualOptions?: MultilingualOptions; /** Options for the PageLink plugin. */ editablePageLinkOptions?: PageLinkPluginOptions; /** Options for the CMS plugin. */ cmsOptions?: PluginCmsOptions; /** Plugin types. */ type?: PluginType; } /** @oneof */ export interface PluginOptionsOneOf { /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishOptions?: PublishPluginOptions; /** Options for the Single Item plugin. */ singleItemOptions?: SingleItemPluginOptions; /** Options for the Urlized plugin. */ urlizedOptions?: UrlizedPluginOptions; /** Options for the Multilingual plugin. */ multilingualOptions?: MultilingualOptions; /** Options for the PageLink plugin. */ editablePageLinkOptions?: PageLinkPluginOptions; /** Options for the CMS plugin. */ cmsOptions?: PluginCmsOptions; } export declare enum Status { UNKNOWN_PUBLISH_PLUGIN_STATUS = "UNKNOWN_PUBLISH_PLUGIN_STATUS", PUBLISHED = "PUBLISHED", DRAFT = "DRAFT" } export declare enum Format { UNKNOWN_URLIZED_PLUGIN_FORMAT = "UNKNOWN_URLIZED_PLUGIN_FORMAT", /** Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL. */ ORIGINAL = "ORIGINAL", /** No changes are made before generating the encoded URL. */ PLAIN = "PLAIN" } /** if CMS-defined sort is enabled and should be used in site */ export interface SiteSort { /** Field and order for the site sort. */ sort?: Sort[]; } export declare enum PluginType { /** Unknown plugin type. */ UNKNOWN_PLUGIN_TYPE = "UNKNOWN_PLUGIN_TYPE", /** Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors. */ PUBLISH = "PUBLISH", /** Ensures the collection can have one item at most. Can only be applied to a new collection. */ SINGLE_ITEM = "SINGLE_ITEM", /** Generates item URLs for collections used by dynamic pages. */ URLIZED = "URLIZED", /** Deprecated. Will be removed in the future. */ GRIDAPPLESS = "GRIDAPPLESS", /** Indicates that the collection is translatable. This allows you to manage translation for selected fields using [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). */ MULTILINGUAL = "MULTILINGUAL", /** Indicates that collection is shared with current site. */ SHARED = "SHARED", /** Indicates that page link fields are persisted and can be updated. */ EDITABLE_PAGE_LINK = "EDITABLE_PAGE_LINK", /** CMS-specific collection properties. */ CMS = "CMS" } export interface PublishPluginOptions { /** Default status. */ defaultStatus?: Status; } export interface SingleItemPluginOptions { /** ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this. */ singleItemId?: string; } export interface UrlizedPluginOptions { /** Encoding method for generating a URL in ASCII characters. */ format?: Format; } export interface MultilingualOptions { /** IDs of fields to allow translation. */ translatableFieldKeys?: string[]; } export interface PageLinkPluginOptions { isPersisted?: boolean; isMutable?: boolean; } export interface PluginCmsOptions { /** CMS sort, applied when a collection is displayed on a site. */ siteSort?: SiteSort; } export declare enum PagingMode { /** Offset-based paging. */ OFFSET = "OFFSET", /** Cursor-based paging. */ CURSOR = "CURSOR" } /** Data permissions defined by access level for each action. */ export interface DataPermissions { /** Access level for data items read */ itemRead?: AccessLevel; /** Access level for data items insert */ itemInsert?: AccessLevel; /** Access level for data items update */ itemUpdate?: AccessLevel; /** Access level for data items removal */ itemRemove?: AccessLevel; } /** * Describes who can perform certain action. * Each level includes all levels below it (except UNDEFINED). */ export declare enum AccessLevel { /** Not set. */ UNDEFINED = "UNDEFINED", /** Any subject, including visitors. */ ANYONE = "ANYONE", /** Any signed-in user (both site members and collaborators). */ SITE_MEMBER = "SITE_MEMBER", /** Any signed-in user, but site members only have access to own items. */ SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR", /** Site collaborator that has a role with CMS Access permission. */ CMS_EDITOR = "CMS_EDITOR", /** CMS administrators and users or roles granted with special access. */ PRIVILEGED = "PRIVILEGED" } export interface AllowedDataPermissions { /** If data items read permitted */ itemRead?: boolean; /** If for data items insert permitted */ itemInsert?: boolean; /** If data items update permitted */ itemUpdate?: boolean; /** If data items removal permitted */ itemRemove?: boolean; } export interface DataCollectionClonedEvent { /** Instance ID of the collection from which the data is cloned. */ originInstanceId?: string; /** ID of the collection from which the data is cloned. */ originId?: string; } export interface DataCollectionChangedEvent { /** list of new fields */ fieldsAdded?: Field[]; /** list of changed fields */ fieldsUpdated?: FieldUpdate[]; /** list of removed fields */ fieldsRemoved?: Field[]; /** list of new plugins */ pluginsAdded?: Plugin[]; /** list of changed plugins */ pluginsUpdated?: PluginUpdate[]; /** list of removed plugins */ pluginsRemoved?: Plugin[]; } export interface FieldUpdate { /** previous state of the field */ previous?: Field; /** current state of the field */ current?: Field; } export interface PluginUpdate { /** previous state of the plugin */ previous?: Plugin; /** current state of the plugin */ current?: Plugin; } export interface DataCollectionEvictedEvent { /** ID of the collection that was permanently deleted. */ _id?: string; } export interface CreateDataCollectionRequest { /** Collection details. */ collection: DataCollection; } export interface CreateDataCollectionResponse { /** Details of collection created. */ collection?: DataCollection; } export interface GetDataCollectionRequest { /** ID of the collection to retrieve. */ dataCollectionId: 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. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * List of specific field names to return, if empty all fields are returned. * Affects all returned collections */ fields?: string[]; } export declare enum Segment { UNKNOWN_SEGMENT = "UNKNOWN_SEGMENT", PUBLIC = "PUBLIC", DEV = "DEV" } export interface GetDataCollectionResponse { /** Details of the collection requested. */ collection?: DataCollection; /** * Details of collections referenced by the collection requested. * Only populated when `includeReferencedCollections` is `true` in the request. */ referencedCollections?: DataCollection[]; } export interface ListDataCollectionsRequest { /** * Defines how collections in the response are sorted. * * Default: Ordered by ID in ascending order. */ sort?: Sorting; /** Pagination information. */ paging?: Paging; /** * 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. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * List of specific field names to return, if empty all fields are returned. * Affects all returned collections */ fields?: string[]; } 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 ListDataCollectionsResponse { /** List of collections. */ collections?: DataCollection[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; } export interface BulkGetDataCollectionsRequest { /** IDs of the collections to retrieve. */ dataCollectionIds?: string[]; /** * Whether to include deleted collections. * * Default: `false` */ showDeletedCollections?: boolean; /** * Whether the returned collection list should include referenced collections. * * Default: `false` */ includeReferencedCollections?: boolean; /** Sorting preferences. */ 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. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * List of specific field names to return, if empty all fields are returned. * Affects all returned collections */ fields?: string[]; } export interface BulkGetDataCollectionsResponse { /** * List of requested collections. * When `include_referenced_collections` is `true` in the request, referenced collections are included here. */ activeCollections?: DataCollection[]; /** List of requested deleted collections. Only populated when `showDeletedCollections` is true in the request. */ deletedCollections?: DataCollection[]; } export interface UpdateDataCollectionRequest { /** Updated collection details. The existing collection is replaced with this version. */ collection: DataCollection; } export interface UpdateDataCollectionResponse { /** Updated collection details. */ collection?: DataCollection; } export interface DeleteDataCollectionRequest { /** ID of the collection to delete. */ dataCollectionId: string; } export interface DeleteDataCollectionResponse { } export interface RestoreDataCollectionRequest { /** Data Collection ID to restore */ dataCollectionId?: string; } export interface RestoreDataCollectionResponse { /** Restored data collection */ dataCollection?: DataCollection; } export interface CreateDataCollectionFieldRequest { /** ID of data collection to update */ dataCollectionId?: string; /** field to create */ field?: Field; } export interface CreateDataCollectionFieldResponse { /** updated data collection */ dataCollection?: DataCollection; } export interface UpdateDataCollectionFieldRequest { /** ID of data collection to update */ dataCollectionId?: string; /** Field to update */ field?: Field; } export interface UpdateDataCollectionFieldResponse { /** updated data collection */ dataCollection?: DataCollection; } export interface DeleteDataCollectionFieldRequest { /** ID of data collection to update */ dataCollectionId?: string; /** Field ID to delete */ fieldKey?: string; } export interface DeleteDataCollectionFieldResponse { /** updated data collection */ dataCollection?: DataCollection; } export interface UpdateDataPermissionsRequest { /** ID of data collections to update */ dataCollectionId?: string; /** Data permissions to set */ dataPermissions?: DataPermissions; } export interface UpdateDataPermissionsResponse { /** Updated data collection */ dataCollection?: DataCollection; } export interface BulkGetDataCollectionsPageBySnapshotsRequest { /** Ids of schema snapshot */ snapshotIds?: string[]; /** Pagination information. */ paging?: Paging; } export interface BulkGetDataCollectionsPageBySnapshotsResponse { /** List of snapshot collection map */ snapshotCollections?: SnapshotCollection[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface SnapshotCollection { /** snapshot to which collection belongs */ snapshotId?: string; /** snapshot collection */ collection?: DataCollection; /** snapshot of collection indexes */ indexes?: Index[]; } /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */ export interface Index { /** Name of the index. */ name?: string; /** * Fields for which the index is defined. * * Max: 3 fields (for a unique index: 1 field) */ fields?: IndexField[]; /** * Current status of the index. * @readonly */ status?: IndexStatus; /** * 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 is defined. * If `true`, the index can have only one field. * * Default: `false` */ unique?: boolean; /** * Whether the index ignores case. * * Default: `false` */ caseInsensitive?: boolean; } /** * 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 { /** Path of the field to index. For example: `title` or `options.price`. */ path?: string; /** * Sort order for the index. Base on how the data is regularly queried. * * Default: `ASC` */ order?: Order; } export declare enum IndexStatus { /** 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" } export 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. */ code?: string; /** Description of the failure. */ 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. */ itemId?: string | null; } export interface CreateDataCollectionsSnapshotRequest { } export interface CreateDataCollectionsSnapshotResponse { /** created snapshot ID */ snapshotId?: string; /** data collections in snapshot */ snapshotCollections?: DataCollection[]; } export interface RestoreDataCollectionsFromSnapshotRequest { /** snapshot ID to restore */ snapshotId?: string; /** * collection IDs to restore, if empty – all collections would be restored * @deprecated * @replacedBy restoration_collections * @targetRemovalDate 2025-12-31 */ dataCollectionIds?: string[]; /** collection to restore, if empty – all collections would be restored */ restorationCollections?: RestorationCollection[]; } export interface Destination { /** Collection id. */ dataCollectionId?: string; /** Display name. When not specified value is taken from the snapshot. */ displayName?: string | null; } export interface RestorationCollection { /** Collection ID to restore */ dataCollectionId?: string; /** * Destination where to restore the collection. * When not specified destination is taken from snapshot. */ destination?: Destination; } export interface RestoreDataCollectionsFromSnapshotResponse { /** restored collections */ restoredCollections?: DataCollection[]; } export interface DeleteDataCollectionsSnapshotRequest { /** snapshot ID to delete */ snapshotId?: string; } export interface DeleteDataCollectionsSnapshotResponse { } export interface CreateMigratedCollectionsSnapshotRequest { existingSnapshotId?: string; newNamespace?: string; existingNamespace?: string; } export interface CreateMigratedCollectionsSnapshotResponse { snapshotId?: string; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export 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; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } 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?: WebhookIdentityType; } /** @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; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface SortNonNullableFields { fieldKey: string; direction: Direction; } interface IndexLimitsNonNullableFields { regular: number; unique: number; total: number; } interface CollectionCapabilitiesNonNullableFields { dataOperations: DataOperation[]; collectionOperations: CollectionOperation[]; indexLimits?: IndexLimitsNonNullableFields; } interface ReferenceNonNullableFields { referencedCollectionId: string; } interface MultiReferenceNonNullableFields { referencedCollectionId: string; referencingFieldKey: string; referencingDisplayName: string; } interface FieldCapabilitiesNonNullableFields { sortable: boolean; queryOperators: QueryOperator[]; } interface ObjectFieldNonNullableFields { key: string; type: Type; typeMetadata?: TypeMetadataNonNullableFields; capabilities?: FieldCapabilitiesNonNullableFields; } interface _ObjectNonNullableFields { fields: ObjectFieldNonNullableFields[]; } interface _ArrayNonNullableFields { elementType: Type; typeMetadata?: TypeMetadataNonNullableFields; } interface FieldsPatternNonNullableFields { pattern: string; lowercase: boolean; } interface UrlizedOnlyPatternNonNullableFields { pattern: string; } interface CalculatorNonNullableFields { fieldsPattern?: FieldsPatternNonNullableFields; urlizedOnlyPattern?: UrlizedOnlyPatternNonNullableFields; } interface PageLinkNonNullableFields { calculator?: CalculatorNonNullableFields; } interface TypeMetadataNonNullableFields { reference?: ReferenceNonNullableFields; multiReference?: MultiReferenceNonNullableFields; object?: _ObjectNonNullableFields; array?: _ArrayNonNullableFields; pageLink?: PageLinkNonNullableFields; } interface CmsOptionsNonNullableFields { internal: boolean; } interface FieldPluginNonNullableFields { cmsOptions?: CmsOptionsNonNullableFields; type: FieldPluginType; } interface FieldNonNullableFields { key: string; type: Type; typeMetadata?: TypeMetadataNonNullableFields; systemField: boolean; capabilities?: FieldCapabilitiesNonNullableFields; encrypted: boolean; plugins: FieldPluginNonNullableFields[]; } interface PermissionsNonNullableFields { insert: Role; update: Role; remove: Role; read: Role; } interface PublishPluginOptionsNonNullableFields { defaultStatus: Status; } interface SingleItemPluginOptionsNonNullableFields { singleItemId: string; } interface UrlizedPluginOptionsNonNullableFields { format: Format; } interface MultilingualOptionsNonNullableFields { translatableFieldKeys: string[]; } interface PageLinkPluginOptionsNonNullableFields { isPersisted: boolean; isMutable: boolean; } interface SiteSortNonNullableFields { sort: SortNonNullableFields[]; } interface PluginCmsOptionsNonNullableFields { siteSort?: SiteSortNonNullableFields; } interface PluginNonNullableFields { publishOptions?: PublishPluginOptionsNonNullableFields; singleItemOptions?: SingleItemPluginOptionsNonNullableFields; urlizedOptions?: UrlizedPluginOptionsNonNullableFields; multilingualOptions?: MultilingualOptionsNonNullableFields; editablePageLinkOptions?: PageLinkPluginOptionsNonNullableFields; cmsOptions?: PluginCmsOptionsNonNullableFields; type: PluginType; } interface DataPermissionsNonNullableFields { itemRead: AccessLevel; itemInsert: AccessLevel; itemUpdate: AccessLevel; itemRemove: AccessLevel; } interface AllowedDataPermissionsNonNullableFields { itemRead: boolean; itemInsert: boolean; itemUpdate: boolean; itemRemove: boolean; } export interface DataCollectionNonNullableFields { _id: string; collectionType: CollectionType; defaultDisplayOrder?: SortNonNullableFields; capabilities?: CollectionCapabilitiesNonNullableFields; fields: FieldNonNullableFields[]; permissions?: PermissionsNonNullableFields; plugins: PluginNonNullableFields[]; pagingModes: PagingMode[]; dataPermissions?: DataPermissionsNonNullableFields; allowedDataPermissions?: AllowedDataPermissionsNonNullableFields; } export interface CreateDataCollectionResponseNonNullableFields { collection?: DataCollectionNonNullableFields; } export interface GetDataCollectionResponseNonNullableFields { collection?: DataCollectionNonNullableFields; referencedCollections: DataCollectionNonNullableFields[]; } export interface ListDataCollectionsResponseNonNullableFields { collections: DataCollectionNonNullableFields[]; } export interface UpdateDataCollectionResponseNonNullableFields { collection?: DataCollectionNonNullableFields; } /** * Creates a new data collection. * * The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created. * @param collection - Collection details. * @public * @requiredField collection * @requiredField collection._id * @requiredField collection.fields.key * @requiredField collection.fields.type * @requiredField collection.permissions.insert * @requiredField collection.permissions.read * @requiredField collection.permissions.remove * @requiredField collection.permissions.update * @param options - Options for creating a data collection. * @permissionId WIX_DATA.CREATE_COLLECTION * @permissionScope Manage All Data Resources * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL * @permissionScope Manage Data Collections * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE * @applicableIdentity APP * @returns Details of collection created. * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollection */ export declare function createDataCollection(collection: DataCollection): Promise; /** * Retrieves a data collection by ID. * @param dataCollectionId - ID of the collection to retrieve. * @public * @requiredField dataCollectionId * @param options - Options for retrieving a data collection. * @permissionId WIX_DATA.GET_COLLECTION * @permissionScope Manage All Data Resources * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL * @permissionScope Manage Data Collections * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE * @applicableIdentity APP * @applicableIdentity VISITOR * @returns Details of the collection requested. * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.GetDataCollection */ export declare function getDataCollection(dataCollectionId: string, options?: GetDataCollectionOptions): Promise; export interface GetDataCollectionOptions { /** * 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. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * List of specific field names to return, if empty all fields are returned. * Affects all returned collections */ fields?: string[]; } /** * Retrieves a list of all data collections associated with the site or project. * * By default, the list is ordered by ID in ascending order. * @public * @param options - Options for retrieving a list of data collections. * @permissionId WIX_DATA.LIST_COLLECTIONS * @permissionScope Manage All Data Resources * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL * @permissionScope Manage Data Collections * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE * @applicableIdentity APP * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.ListDataCollections */ export declare function listDataCollections(options?: ListDataCollectionsOptions): Promise; export interface ListDataCollectionsOptions { /** * Defines how collections in the response are sorted. * * Default: Ordered by ID in ascending order. */ sort?: Sorting; /** Pagination information. */ paging?: Paging; /** * 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. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * List of specific field names to return, if empty all fields are returned. * Affects all returned collections */ fields?: string[]; } /** * Updates a data collection. * * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter. * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated. * Otherwise, the request fails. * * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented. * * > **Note:** * > After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection has properties with values and those properties * > aren't included in the updated collection details, their values are lost. * @param collection - Updated collection details. The existing collection is replaced with this version. * @public * @requiredField collection * @requiredField collection._id * @requiredField collection.fields.key * @requiredField collection.fields.type * @requiredField collection.permissions.insert * @requiredField collection.permissions.read * @requiredField collection.permissions.remove * @requiredField collection.permissions.update * @requiredField collection.revision * @param options - Options for updating a data collection. * @permissionId WIX_DATA.UPDATE_COLLECTION * @permissionScope Manage All Data Resources * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL * @permissionScope Manage Data Collections * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE * @applicableIdentity APP * @returns Updated collection details. * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollection */ export declare function updateDataCollection(collection: DataCollection): Promise; /** * Deletes a data collection. * * > **Note:** * > Once a collection is deleted, it can only be restored for limited amount of time. * @param dataCollectionId - ID of the collection to delete. * @public * @requiredField dataCollectionId * @permissionId WIX_DATA.DELETE_COLLECTION * @permissionScope Manage All Data Resources * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL * @permissionScope Manage Data Collections * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE * @applicableIdentity APP * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollection */ export declare function deleteDataCollection(dataCollectionId: string): Promise; export {};