@wix/data 1.0.179 → 1.0.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,8 +38,11 @@ declare enum CauseOfFailure$1 {
38
38
  DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
39
39
  }
40
40
  declare enum CollectionsFound$1 {
41
+ /** Attempt to connect to the external database failed, so status is unknown. */
41
42
  UNKNOWN = "UNKNOWN",
43
+ /** External database has existing collections. */
42
44
  YES = "YES",
45
+ /** External database does not have any existing collections. */
43
46
  NO = "NO"
44
47
  }
45
48
  declare enum FieldType$1 {
@@ -86,20 +89,10 @@ declare enum FieldType$1 {
86
89
  interface ConnectionStatus$1 {
87
90
  /** Whether the connection was established successfully. */
88
91
  successful?: boolean;
89
- /**
90
- * If and why a connection attempt failed.
91
- * + `NONE`: No connection failure.
92
- * + `COMMUNICATION_FAILURE`: General communication failure.
93
- * + `DESTINATION_HOST_UNREACHABLE`: External database host is unreachable.
94
- * + `UNAUTHORIZED`: Unauthorized to access external database.
95
- * + `DESTINATION_ENDPOINT_NOT_DEFINED`: `Endpoint` property is not set.
96
- */
92
+ /** Whether and why a connection attempt failed. */
97
93
  causeOfFailure?: CauseOfFailure$1;
98
94
  /**
99
- * Whether the external database has existing collections. Possible values are:
100
- * + `UNKNOWN`: The attempt to connect to the external database failed, so status is unknown.
101
- * + `NO`: External database does not have any existing collections.
102
- * + `YES`: External database has existing collections.
95
+ * Whether the external database has existing collections.
103
96
  * @readonly
104
97
  */
105
98
  hasCollections?: CollectionsFound$1;
@@ -129,9 +122,9 @@ interface GetExternalDatabaseConnectionResponse$1 {
129
122
  }
130
123
  interface ListExternalDatabaseConnectionsRequest$1 {
131
124
  /** Paging */
132
- paging?: Paging$7;
125
+ paging?: Paging$5;
133
126
  }
134
- interface Paging$7 {
127
+ interface Paging$5 {
135
128
  /** Number of items to load. */
136
129
  limit?: number | null;
137
130
  /** Number of items to skip in the current sort order. */
@@ -260,8 +253,11 @@ declare enum CauseOfFailure {
260
253
  DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
261
254
  }
262
255
  declare enum CollectionsFound {
256
+ /** Attempt to connect to the external database failed, so status is unknown. */
263
257
  UNKNOWN = "UNKNOWN",
258
+ /** External database has existing collections. */
264
259
  YES = "YES",
260
+ /** External database does not have any existing collections. */
265
261
  NO = "NO"
266
262
  }
267
263
  declare enum FieldType {
@@ -308,20 +304,10 @@ declare enum FieldType {
308
304
  interface ConnectionStatus {
309
305
  /** Whether the connection was established successfully. */
310
306
  successful?: boolean;
311
- /**
312
- * If and why a connection attempt failed.
313
- * + `NONE`: No connection failure.
314
- * + `COMMUNICATION_FAILURE`: General communication failure.
315
- * + `DESTINATION_HOST_UNREACHABLE`: External database host is unreachable.
316
- * + `UNAUTHORIZED`: Unauthorized to access external database.
317
- * + `DESTINATION_ENDPOINT_NOT_DEFINED`: `Endpoint` property is not set.
318
- */
307
+ /** Whether and why a connection attempt failed. */
319
308
  causeOfFailure?: CauseOfFailure;
320
309
  /**
321
- * Whether the external database has existing collections. Possible values are:
322
- * + `UNKNOWN`: The attempt to connect to the external database failed, so status is unknown.
323
- * + `NO`: External database does not have any existing collections.
324
- * + `YES`: External database has existing collections.
310
+ * Whether the external database has existing collections.
325
311
  * @readonly
326
312
  */
327
313
  hasCollections?: CollectionsFound;
@@ -351,9 +337,9 @@ interface GetExternalDatabaseConnectionResponse {
351
337
  }
352
338
  interface ListExternalDatabaseConnectionsRequest {
353
339
  /** Paging */
354
- paging?: Paging$6;
340
+ paging?: Paging$4;
355
341
  }
356
- interface Paging$6 {
342
+ interface Paging$4 {
357
343
  /** Number of items to load. */
358
344
  limit?: number | null;
359
345
  /** Number of items to skip in the current sort order. */
@@ -464,13 +450,13 @@ declare function deleteExternalDatabaseConnection(): __PublicMethodMetaInfo$3<'D
464
450
  name: string;
465
451
  }, DeleteExternalDatabaseConnectionRequest, DeleteExternalDatabaseConnectionRequest$1, DeleteExternalDatabaseConnectionResponse, DeleteExternalDatabaseConnectionResponse$1>;
466
452
 
467
- declare const meta$3_createExternalDatabaseConnection: typeof createExternalDatabaseConnection;
468
- declare const meta$3_deleteExternalDatabaseConnection: typeof deleteExternalDatabaseConnection;
469
- declare const meta$3_getExternalDatabaseConnection: typeof getExternalDatabaseConnection;
470
- declare const meta$3_listExternalDatabaseConnections: typeof listExternalDatabaseConnections;
471
- declare const meta$3_updateExternalDatabaseConnection: typeof updateExternalDatabaseConnection;
472
- declare namespace meta$3 {
473
- export { type __PublicMethodMetaInfo$3 as __PublicMethodMetaInfo, meta$3_createExternalDatabaseConnection as createExternalDatabaseConnection, meta$3_deleteExternalDatabaseConnection as deleteExternalDatabaseConnection, meta$3_getExternalDatabaseConnection as getExternalDatabaseConnection, meta$3_listExternalDatabaseConnections as listExternalDatabaseConnections, meta$3_updateExternalDatabaseConnection as updateExternalDatabaseConnection };
453
+ declare const meta$2_createExternalDatabaseConnection: typeof createExternalDatabaseConnection;
454
+ declare const meta$2_deleteExternalDatabaseConnection: typeof deleteExternalDatabaseConnection;
455
+ declare const meta$2_getExternalDatabaseConnection: typeof getExternalDatabaseConnection;
456
+ declare const meta$2_listExternalDatabaseConnections: typeof listExternalDatabaseConnections;
457
+ declare const meta$2_updateExternalDatabaseConnection: typeof updateExternalDatabaseConnection;
458
+ declare namespace meta$2 {
459
+ export { type __PublicMethodMetaInfo$3 as __PublicMethodMetaInfo, meta$2_createExternalDatabaseConnection as createExternalDatabaseConnection, meta$2_deleteExternalDatabaseConnection as deleteExternalDatabaseConnection, meta$2_getExternalDatabaseConnection as getExternalDatabaseConnection, meta$2_listExternalDatabaseConnections as listExternalDatabaseConnections, meta$2_updateExternalDatabaseConnection as updateExternalDatabaseConnection };
474
460
  }
475
461
 
476
462
  /** A data collection determines the structure of data to be stored in a database. */
@@ -922,7 +908,7 @@ interface Plugin$1 extends PluginOptionsOneOf$1 {
922
908
  * Options for the Publish plugin.
923
909
  * 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.
924
910
  */
925
- publishOptions?: PublishPluginOptions$1;
911
+ publishOptions?: PublishPluginOptions$2;
926
912
  /** Options for the Single Item plugin. */
927
913
  singleItemOptions?: SingleItemPluginOptions$1;
928
914
  /** Options for the Urlized plugin. */
@@ -942,7 +928,7 @@ interface PluginOptionsOneOf$1 {
942
928
  * Options for the Publish plugin.
943
929
  * 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.
944
930
  */
945
- publishOptions?: PublishPluginOptions$1;
931
+ publishOptions?: PublishPluginOptions$2;
946
932
  /** Options for the Single Item plugin. */
947
933
  singleItemOptions?: SingleItemPluginOptions$1;
948
934
  /** Options for the Urlized plugin. */
@@ -991,7 +977,7 @@ declare enum PluginType$1 {
991
977
  /** CMS-specific collection properties. */
992
978
  CMS = "CMS"
993
979
  }
994
- interface PublishPluginOptions$1 {
980
+ interface PublishPluginOptions$2 {
995
981
  /** Default status. */
996
982
  defaultStatus?: Status$3;
997
983
  }
@@ -1079,9 +1065,9 @@ interface ListDataCollectionsRequest$1 {
1079
1065
  *
1080
1066
  * Default: Ordered by ID in ascending order.
1081
1067
  */
1082
- sort?: Sorting$3;
1068
+ sort?: Sorting$1;
1083
1069
  /** Pagination information. */
1084
- paging?: Paging$5;
1070
+ paging?: Paging$3;
1085
1071
  /**
1086
1072
  * Whether to retrieve data from the primary database instance.
1087
1073
  * This decreases performance but ensures data retrieved is up to date even immediately after an update.
@@ -1096,17 +1082,17 @@ interface ListDataCollectionsRequest$1 {
1096
1082
  */
1097
1083
  fields?: string[];
1098
1084
  }
1099
- interface Sorting$3 {
1085
+ interface Sorting$1 {
1100
1086
  /** Name of the field to sort by. */
1101
1087
  fieldName?: string;
1102
1088
  /** Sort order. */
1103
- order?: SortOrder$3;
1089
+ order?: SortOrder$1;
1104
1090
  }
1105
- declare enum SortOrder$3 {
1091
+ declare enum SortOrder$1 {
1106
1092
  ASC = "ASC",
1107
1093
  DESC = "DESC"
1108
1094
  }
1109
- interface Paging$5 {
1095
+ interface Paging$3 {
1110
1096
  /** Number of items to load. */
1111
1097
  limit?: number | null;
1112
1098
  /** Number of items to skip in the current sort order. */
@@ -1116,9 +1102,9 @@ interface ListDataCollectionsResponse$1 {
1116
1102
  /** List of collections. */
1117
1103
  collections?: DataCollection$1[];
1118
1104
  /** Paging information. */
1119
- pagingMetadata?: PagingMetadataV2$3;
1105
+ pagingMetadata?: PagingMetadataV2$1;
1120
1106
  }
1121
- interface PagingMetadataV2$3 {
1107
+ interface PagingMetadataV2$1 {
1122
1108
  /** Number of items returned in the response. */
1123
1109
  count?: number | null;
1124
1110
  /** Offset that was requested. */
@@ -1742,7 +1728,7 @@ interface Plugin extends PluginOptionsOneOf {
1742
1728
  * Options for the Publish plugin.
1743
1729
  * 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.
1744
1730
  */
1745
- publishOptions?: PublishPluginOptions;
1731
+ publishOptions?: PublishPluginOptions$1;
1746
1732
  /** Options for the Single Item plugin. */
1747
1733
  singleItemOptions?: SingleItemPluginOptions;
1748
1734
  /** Options for the Urlized plugin. */
@@ -1762,7 +1748,7 @@ interface PluginOptionsOneOf {
1762
1748
  * Options for the Publish plugin.
1763
1749
  * 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.
1764
1750
  */
1765
- publishOptions?: PublishPluginOptions;
1751
+ publishOptions?: PublishPluginOptions$1;
1766
1752
  /** Options for the Single Item plugin. */
1767
1753
  singleItemOptions?: SingleItemPluginOptions;
1768
1754
  /** Options for the Urlized plugin. */
@@ -1811,7 +1797,7 @@ declare enum PluginType {
1811
1797
  /** CMS-specific collection properties. */
1812
1798
  CMS = "CMS"
1813
1799
  }
1814
- interface PublishPluginOptions {
1800
+ interface PublishPluginOptions$1 {
1815
1801
  /** Default status. */
1816
1802
  defaultStatus?: Status$2;
1817
1803
  }
@@ -1899,9 +1885,9 @@ interface ListDataCollectionsRequest {
1899
1885
  *
1900
1886
  * Default: Ordered by ID in ascending order.
1901
1887
  */
1902
- sort?: Sorting$2;
1888
+ sort?: Sorting;
1903
1889
  /** Pagination information. */
1904
- paging?: Paging$4;
1890
+ paging?: Paging$2;
1905
1891
  /**
1906
1892
  * Whether to retrieve data from the primary database instance.
1907
1893
  * This decreases performance but ensures data retrieved is up to date even immediately after an update.
@@ -1916,17 +1902,17 @@ interface ListDataCollectionsRequest {
1916
1902
  */
1917
1903
  fields?: string[];
1918
1904
  }
1919
- interface Sorting$2 {
1905
+ interface Sorting {
1920
1906
  /** Name of the field to sort by. */
1921
1907
  fieldName?: string;
1922
1908
  /** Sort order. */
1923
- order?: SortOrder$2;
1909
+ order?: SortOrder;
1924
1910
  }
1925
- declare enum SortOrder$2 {
1911
+ declare enum SortOrder {
1926
1912
  ASC = "ASC",
1927
1913
  DESC = "DESC"
1928
1914
  }
1929
- interface Paging$4 {
1915
+ interface Paging$2 {
1930
1916
  /** Number of items to load. */
1931
1917
  limit?: number | null;
1932
1918
  /** Number of items to skip in the current sort order. */
@@ -1936,9 +1922,9 @@ interface ListDataCollectionsResponse {
1936
1922
  /** List of collections. */
1937
1923
  collections?: DataCollection[];
1938
1924
  /** Paging information. */
1939
- pagingMetadata?: PagingMetadataV2$2;
1925
+ pagingMetadata?: PagingMetadataV2;
1940
1926
  }
1941
- interface PagingMetadataV2$2 {
1927
+ interface PagingMetadataV2 {
1942
1928
  /** Number of items returned in the response. */
1943
1929
  count?: number | null;
1944
1930
  /** Offset that was requested. */
@@ -2133,752 +2119,734 @@ declare function deleteDataCollection(): __PublicMethodMetaInfo$2<'DELETE', {
2133
2119
  dataCollectionId: string;
2134
2120
  }, DeleteDataCollectionRequest, DeleteDataCollectionRequest$1, DeleteDataCollectionResponse, DeleteDataCollectionResponse$1>;
2135
2121
 
2136
- declare const meta$2_createDataCollection: typeof createDataCollection;
2137
- declare const meta$2_deleteDataCollection: typeof deleteDataCollection;
2138
- declare const meta$2_getDataCollection: typeof getDataCollection;
2139
- declare const meta$2_listDataCollections: typeof listDataCollections;
2140
- declare const meta$2_updateDataCollection: typeof updateDataCollection;
2141
- declare namespace meta$2 {
2142
- export { type __PublicMethodMetaInfo$2 as __PublicMethodMetaInfo, meta$2_createDataCollection as createDataCollection, meta$2_deleteDataCollection as deleteDataCollection, meta$2_getDataCollection as getDataCollection, meta$2_listDataCollections as listDataCollections, meta$2_updateDataCollection as updateDataCollection };
2122
+ declare const meta$1_createDataCollection: typeof createDataCollection;
2123
+ declare const meta$1_deleteDataCollection: typeof deleteDataCollection;
2124
+ declare const meta$1_getDataCollection: typeof getDataCollection;
2125
+ declare const meta$1_listDataCollections: typeof listDataCollections;
2126
+ declare const meta$1_updateDataCollection: typeof updateDataCollection;
2127
+ declare namespace meta$1 {
2128
+ export { type __PublicMethodMetaInfo$2 as __PublicMethodMetaInfo, meta$1_createDataCollection as createDataCollection, meta$1_deleteDataCollection as deleteDataCollection, meta$1_getDataCollection as getDataCollection, meta$1_listDataCollections as listDataCollections, meta$1_updateDataCollection as updateDataCollection };
2143
2129
  }
2144
2130
 
2145
- interface DataItem$1 {
2146
- /** Data item ID. */
2147
- id?: string;
2131
+ /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2132
+ interface Index$1 {
2133
+ /** Name of the index. */
2134
+ name?: string;
2135
+ /**
2136
+ * Fields for which the index is defined.
2137
+ *
2138
+ * Max: 3 fields (for a unique index: 1 field)
2139
+ */
2140
+ fields?: Field$1[];
2148
2141
  /**
2149
- * ID of the collection this item belongs to
2142
+ * Current status of the index.
2150
2143
  * @readonly
2151
2144
  */
2152
- dataCollectionId?: string;
2145
+ status?: Status$1;
2153
2146
  /**
2154
- * Data item contents.
2147
+ * Contains details about the reasons for failure when `status` is `FAILED`.
2148
+ * @readonly
2149
+ */
2150
+ failure?: Failure$1;
2151
+ /**
2152
+ * Whether the index enforces uniqueness of values in the field for which it is defined.
2153
+ * If `true`, the index can have only one field.
2155
2154
  *
2156
- * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
2155
+ * Default: `false`
2156
+ */
2157
+ unique?: boolean;
2158
+ /**
2159
+ * Whether the index ignores case.
2157
2160
  *
2158
- * + `_id`: Item ID.
2159
- * + `_createdDate`: Date and time the item was added to the collection.
2160
- * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
2161
- * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
2161
+ * Default: `false`
2162
2162
  */
2163
- data?: Record<string, any> | null;
2163
+ caseInsensitive?: boolean;
2164
2164
  }
2165
- interface InsertDataItemRequest$1 {
2166
- /** ID of the collection in which to insert the item. */
2167
- dataCollectionId: string;
2168
- /** Item to insert. */
2169
- dataItem: DataItem$1;
2165
+ /**
2166
+ * Order determines how values are ordered in the index. This is important when
2167
+ * ordering and/or range querying by indexed fields.
2168
+ */
2169
+ declare enum Order$1 {
2170
+ ASC = "ASC",
2171
+ DESC = "DESC"
2172
+ }
2173
+ interface Field$1 {
2174
+ /** Path of the field to index. For example: `title` or `options.price`. */
2175
+ path?: string;
2170
2176
  /**
2171
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2177
+ * Sort order for the index. Base on how the data is regularly queried.
2172
2178
  *
2173
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2174
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2175
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2179
+ * Default: `ASC`
2176
2180
  */
2177
- appOptions?: Record<string, any> | null;
2181
+ order?: Order$1;
2178
2182
  }
2179
- interface InsertDataItemResponse$1 {
2180
- /** Inserted data item. */
2181
- dataItem?: DataItem$1;
2183
+ declare enum Status$1 {
2184
+ /** Place holder. Never returned by the service. */
2185
+ UNKNOWN = "UNKNOWN",
2186
+ /** Index creation is in progress. */
2187
+ BUILDING = "BUILDING",
2188
+ /** Index has been successfully created and can be used in queries. */
2189
+ ACTIVE = "ACTIVE",
2190
+ /** Index is in the process of being dropped. */
2191
+ DROPPING = "DROPPING",
2192
+ /** Index has been dropped successfully. */
2193
+ DROPPED = "DROPPED",
2194
+ /** Index creation has failed. */
2195
+ FAILED = "FAILED",
2196
+ /** Index contains incorrectly indexed data. */
2197
+ INVALID = "INVALID"
2182
2198
  }
2183
- interface DataPublishPluginOptions$1 {
2199
+ interface Failure$1 {
2184
2200
  /**
2185
- * Whether to include draft items.
2186
- * When `true`, the response includes both published and draft items. Default: `false`.
2201
+ * Error code.
2202
+ * - `WDE0112`: Unknown error while building collection index.
2203
+ * - `WDE0113`: Duplicate key error while building collection index.
2204
+ * - `WDE0114`: Document too large while building collection index.
2187
2205
  */
2188
- includeDraftItems?: boolean;
2189
- }
2190
- interface BulkDataItemResult$1 {
2191
- /** The action attempted for the data item. */
2192
- action?: BulkActionType$1;
2193
- /** Metadata related to the data item for which the action was attempted. */
2194
- itemMetadata?: ItemMetadata$1;
2195
- /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
2196
- dataItem?: DataItem$1;
2206
+ code?: string;
2207
+ /** Description of the failure. */
2208
+ description?: string;
2209
+ /**
2210
+ * ID of the data item that caused the failure.
2211
+ * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
2212
+ */
2213
+ itemId?: string | null;
2197
2214
  }
2198
- declare enum BulkActionType$1 {
2199
- UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
2200
- INSERT = "INSERT",
2201
- UPDATE = "UPDATE",
2202
- DELETE = "DELETE",
2203
- PATCH = "PATCH"
2215
+ interface CreateIndexRequest$1 {
2216
+ /** Details of the index to be created. */
2217
+ index: Index$1;
2218
+ /** ID of the data collection for which to generate the index. */
2219
+ dataCollectionId: string;
2204
2220
  }
2205
- interface ItemMetadata$1 {
2206
- /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */
2207
- id?: string | null;
2208
- /** Index of the item within the request array. Allows for correlation between request and response items. */
2209
- originalIndex?: number;
2210
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
2211
- success?: boolean;
2212
- /** Details about the error in case of failure. */
2213
- error?: ApplicationError$1;
2221
+ interface CreateIndexResponse$1 {
2222
+ /** Details of the index being generated. */
2223
+ index?: Index$1;
2214
2224
  }
2215
- interface ApplicationError$1 {
2216
- /** Error code. */
2217
- code?: string;
2218
- /** Description of the error. */
2219
- description?: string;
2220
- /** Data related to the error. */
2221
- data?: Record<string, any> | null;
2225
+ interface DropIndexRequest$1 {
2226
+ /** Name of the index to drop. */
2227
+ indexName: string;
2228
+ /** ID of the data collection for which the index to be dropped is defined. */
2229
+ dataCollectionId: string;
2222
2230
  }
2223
- interface BulkActionMetadata$1 {
2224
- /** Number of items successfully processed. */
2225
- totalSuccesses?: number;
2226
- /** Number of items that couldn't be processed. */
2227
- totalFailures?: number;
2231
+ interface DropIndexResponse$1 {
2228
2232
  }
2229
- interface UpdateDataItemRequest$1 {
2230
- /** ID of the collection containing the existing item. */
2233
+ interface ListIndexesRequest$1 {
2234
+ /** ID of the data collection for which to list indexes. */
2231
2235
  dataCollectionId: string;
2232
- /** Updated data item content. The existing data item's content is replaced entirely. */
2233
- dataItem: DataItem$1;
2236
+ /** Paging options to limit and skip the number of items. */
2237
+ paging?: Paging$1;
2238
+ }
2239
+ interface Paging$1 {
2240
+ /** Number of items to load. */
2241
+ limit?: number | null;
2242
+ /** Number of items to skip in the current sort order. */
2243
+ offset?: number | null;
2244
+ }
2245
+ interface ListIndexesResponse$1 {
2246
+ /** List of all indexes for the requested data collection. */
2247
+ indexes?: Index$1[];
2248
+ /** Paging metadata. */
2249
+ pagingMetadata?: PagingMetadata$1;
2250
+ }
2251
+ interface PagingMetadata$1 {
2252
+ /** Number of items returned in the response. */
2253
+ count?: number | null;
2254
+ /** Offset that was requested. */
2255
+ offset?: number | null;
2256
+ /** Total number of items that match the query. */
2257
+ total?: number | null;
2258
+ /** Flag that indicates the server failed to calculate the `total` field. */
2259
+ tooManyToCount?: boolean | null;
2260
+ }
2261
+ interface FieldNonNullableFields$1 {
2262
+ path: string;
2263
+ order: Order$1;
2264
+ }
2265
+ interface FailureNonNullableFields$1 {
2266
+ code: string;
2267
+ broadCode: string;
2268
+ description: string;
2269
+ }
2270
+ interface IndexNonNullableFields$1 {
2271
+ name: string;
2272
+ fields: FieldNonNullableFields$1[];
2273
+ status: Status$1;
2274
+ failure?: FailureNonNullableFields$1;
2275
+ unique: boolean;
2276
+ caseInsensitive: boolean;
2277
+ }
2278
+ interface CreateIndexResponseNonNullableFields$1 {
2279
+ index?: IndexNonNullableFields$1;
2280
+ }
2281
+ interface ListIndexesResponseNonNullableFields$1 {
2282
+ indexes: IndexNonNullableFields$1[];
2283
+ }
2284
+
2285
+ /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
2286
+ interface Index {
2287
+ /** Name of the index. */
2288
+ name?: string;
2234
2289
  /**
2235
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2290
+ * Fields for which the index is defined.
2236
2291
  *
2237
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2238
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2239
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2292
+ * Max: 3 fields (for a unique index: 1 field)
2240
2293
  */
2241
- appOptions?: Record<string, any> | null;
2294
+ fields?: Field[];
2242
2295
  /**
2243
- * Options for the Publish plugin.
2244
- * 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.
2296
+ * Current status of the index.
2297
+ * @readonly
2245
2298
  */
2246
- publishPluginOptions?: DataPublishPluginOptions$1;
2247
- }
2248
- interface UpdateDataItemResponse$1 {
2249
- /** Updated data item. */
2250
- dataItem?: DataItem$1;
2251
- }
2252
- interface SaveDataItemRequest$1 {
2253
- /** ID of the collection in which to insert or update the item. */
2254
- dataCollectionId: string;
2255
- /** Data item to insert or update. */
2256
- dataItem: DataItem$1;
2299
+ status?: Status;
2257
2300
  /**
2258
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2301
+ * Contains details about the reasons for failure when `status` is `FAILED`.
2302
+ * @readonly
2303
+ */
2304
+ failure?: Failure;
2305
+ /**
2306
+ * Whether the index enforces uniqueness of values in the field for which it is defined.
2307
+ * If `true`, the index can have only one field.
2259
2308
  *
2260
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2261
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2262
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2309
+ * Default: `false`
2263
2310
  */
2264
- appOptions?: Record<string, any> | null;
2311
+ unique?: boolean;
2265
2312
  /**
2266
- * Options for the Publish plugin.
2267
- * 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.
2313
+ * Whether the index ignores case.
2314
+ *
2315
+ * Default: `false`
2268
2316
  */
2269
- publishPluginOptions?: DataPublishPluginOptions$1;
2317
+ caseInsensitive?: boolean;
2270
2318
  }
2271
- interface SaveDataItemResponse$1 {
2272
- /** The action carried out for the item. */
2273
- action?: Action$1;
2274
- /** Inserted or updated data item. */
2275
- dataItem?: DataItem$1;
2319
+ /**
2320
+ * Order determines how values are ordered in the index. This is important when
2321
+ * ordering and/or range querying by indexed fields.
2322
+ */
2323
+ declare enum Order {
2324
+ ASC = "ASC",
2325
+ DESC = "DESC"
2276
2326
  }
2277
- declare enum Action$1 {
2278
- /** Undefined action. */
2279
- UNKNOWN_ACTION = "UNKNOWN_ACTION",
2280
- /** A new item was added to the collection. */
2281
- INSERTED = "INSERTED",
2282
- /** An existing item in the collection was updated. */
2283
- UPDATED = "UPDATED"
2284
- }
2285
- interface GetDataItemRequest$1 {
2286
- /** ID of the collection from which to retrieve the data item. */
2287
- dataCollectionId: string;
2288
- /** ID of the data item to retrieve. */
2289
- dataItemId: string;
2290
- /**
2291
- * Whether to retrieve data from the primary database instance.
2292
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2293
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2294
- *
2295
- * Default: `false`
2296
- */
2297
- consistentRead?: boolean;
2298
- /**
2299
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2300
- * If provided, the result text is returned in the specified language.
2301
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2302
- *
2303
- * If not provided, result text is not translated.
2304
- */
2305
- language?: string | null;
2306
- /**
2307
- * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
2308
- * **Note:** The `_id` system field is always returned.
2309
- */
2310
- fields?: string[];
2327
+ interface Field {
2328
+ /** Path of the field to index. For example: `title` or `options.price`. */
2329
+ path?: string;
2311
2330
  /**
2312
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2331
+ * Sort order for the index. Base on how the data is regularly queried.
2313
2332
  *
2314
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2315
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2316
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2317
- */
2318
- appOptions?: Record<string, any> | null;
2319
- /**
2320
- * Options for the Publish plugin.
2321
- * 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.
2333
+ * Default: `ASC`
2322
2334
  */
2323
- publishPluginOptions?: DataPublishPluginOptions$1;
2335
+ order?: Order;
2324
2336
  }
2325
- interface GetDataItemResponse$1 {
2326
- /** Retrieved item. */
2327
- dataItem?: DataItem$1;
2337
+ declare enum Status {
2338
+ /** Place holder. Never returned by the service. */
2339
+ UNKNOWN = "UNKNOWN",
2340
+ /** Index creation is in progress. */
2341
+ BUILDING = "BUILDING",
2342
+ /** Index has been successfully created and can be used in queries. */
2343
+ ACTIVE = "ACTIVE",
2344
+ /** Index is in the process of being dropped. */
2345
+ DROPPING = "DROPPING",
2346
+ /** Index has been dropped successfully. */
2347
+ DROPPED = "DROPPED",
2348
+ /** Index creation has failed. */
2349
+ FAILED = "FAILED",
2350
+ /** Index contains incorrectly indexed data. */
2351
+ INVALID = "INVALID"
2328
2352
  }
2329
- interface RemoveDataItemRequest$1 {
2330
- /** ID of the collection from which to remove the item. */
2331
- dataCollectionId: string;
2332
- /** ID of the item to remove. */
2333
- dataItemId: string;
2353
+ interface Failure {
2334
2354
  /**
2335
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2336
- *
2337
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2338
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2339
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2355
+ * Error code.
2356
+ * - `WDE0112`: Unknown error while building collection index.
2357
+ * - `WDE0113`: Duplicate key error while building collection index.
2358
+ * - `WDE0114`: Document too large while building collection index.
2340
2359
  */
2341
- appOptions?: Record<string, any> | null;
2360
+ code?: string;
2361
+ /** Description of the failure. */
2362
+ description?: string;
2342
2363
  /**
2343
- * Options for the Publish plugin.
2344
- * 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.
2364
+ * ID of the data item that caused the failure.
2365
+ * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
2345
2366
  */
2346
- publishPluginOptions?: DataPublishPluginOptions$1;
2347
- }
2348
- interface RemoveDataItemResponse$1 {
2349
- /** Removed item. */
2350
- dataItem?: DataItem$1;
2367
+ itemId?: string | null;
2351
2368
  }
2352
- interface TruncateDataItemsRequest$1 {
2353
- /** ID of the collection to truncate. */
2369
+ interface CreateIndexRequest {
2370
+ /** Details of the index to be created. */
2371
+ index: Index;
2372
+ /** ID of the data collection for which to generate the index. */
2354
2373
  dataCollectionId: string;
2355
2374
  }
2356
- interface TruncateDataItemsResponse$1 {
2375
+ interface CreateIndexResponse {
2376
+ /** Details of the index being generated. */
2377
+ index?: Index;
2357
2378
  }
2358
- interface QueryDataItemsRequest$1 {
2359
- /** ID of the collection to query. */
2379
+ interface DropIndexRequest {
2380
+ /** Name of the index to drop. */
2381
+ indexName: string;
2382
+ /** ID of the data collection for which the index to be dropped is defined. */
2360
2383
  dataCollectionId: string;
2361
- /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
2362
- query?: QueryV2$1;
2363
- /**
2364
- * Whether to return the total count in the response for a query with offset paging.
2365
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
2366
- *
2367
- * Default: `false`
2368
- */
2369
- returnTotalCount?: boolean;
2370
- /**
2371
- * Properties for which to include referenced items in the query's results.
2372
- * Up to 50 referenced items can be included for each item that matches the query.
2373
- * @deprecated
2374
- * @replacedBy referenced_item_options
2375
- * @targetRemovalDate 2025-08-01
2376
- */
2377
- includeReferencedItems?: string[];
2378
- /**
2379
- * Whether to retrieve data from the primary database instance.
2380
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2381
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2382
- *
2383
- * Default: `false`
2384
- */
2385
- consistentRead?: boolean;
2386
- /**
2387
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2388
- * If provided, the result text is returned in the specified language.
2389
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2390
- *
2391
- * If not provided, result text is not translated.
2392
- */
2393
- language?: string | null;
2394
- /**
2395
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2396
- *
2397
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2398
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2399
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2400
- */
2401
- appOptions?: Record<string, any> | null;
2402
- /**
2403
- * Options for the Publish plugin.
2404
- * 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.
2405
- */
2406
- publishPluginOptions?: DataPublishPluginOptions$1;
2407
- /** Options for retrieving referenced items. */
2408
- referencedItemOptions?: ReferencedItemOptions$1[];
2409
2384
  }
2410
- interface QueryV2$1 extends QueryV2PagingMethodOneOf$1 {
2411
- /** Paging options to limit and skip the number of items. */
2412
- paging?: Paging$3;
2413
- /** 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`. */
2414
- cursorPaging?: CursorPaging$1;
2415
- /**
2416
- * Filter object in the following format:
2417
- *
2418
- * `"filter" : {
2419
- * "fieldName1": "value1",
2420
- * "fieldName2":{"$operator":"value2"}
2421
- * }`
2422
- *
2423
- * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
2424
- *
2425
- * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2426
- */
2427
- filter?: Record<string, any> | null;
2428
- /**
2429
- * Sort object in the following format:
2430
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
2431
- */
2432
- sort?: Sorting$1[];
2433
- /**
2434
- * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
2435
- * **Note:** The `_id` system field is always returned.
2436
- */
2437
- fields?: string[];
2385
+ interface DropIndexResponse {
2438
2386
  }
2439
- /** @oneof */
2440
- interface QueryV2PagingMethodOneOf$1 {
2387
+ interface ListIndexesRequest {
2388
+ /** ID of the data collection for which to list indexes. */
2389
+ dataCollectionId: string;
2441
2390
  /** Paging options to limit and skip the number of items. */
2442
- paging?: Paging$3;
2443
- /** 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`. */
2444
- cursorPaging?: CursorPaging$1;
2445
- }
2446
- interface Sorting$1 {
2447
- /** Name of the field to sort by. */
2448
- fieldName?: string;
2449
- /** Sort order. */
2450
- order?: SortOrder$1;
2451
- }
2452
- declare enum SortOrder$1 {
2453
- ASC = "ASC",
2454
- DESC = "DESC"
2391
+ paging?: Paging;
2455
2392
  }
2456
- interface Paging$3 {
2393
+ interface Paging {
2457
2394
  /** Number of items to load. */
2458
2395
  limit?: number | null;
2459
2396
  /** Number of items to skip in the current sort order. */
2460
2397
  offset?: number | null;
2461
2398
  }
2462
- interface CursorPaging$1 {
2463
- /** Number of items to load. */
2464
- limit?: number | null;
2465
- /**
2466
- * Pointer to the next or previous page in the list of results.
2467
- *
2468
- * You can get the relevant cursor token
2469
- * from the `pagingMetadata` object in the previous call's response.
2470
- * Not relevant for the first request.
2471
- */
2472
- cursor?: string | null;
2473
- }
2474
- interface ReferencedItemOptions$1 {
2475
- /** Field containing references in the queried item. */
2476
- fieldName?: string;
2477
- /** Maximum number of referenced items to include for each queried item. */
2478
- limit?: number | null;
2479
- }
2480
- interface QueryDataItemsResponse$1 {
2481
- /** Retrieved items. */
2482
- dataItems?: DataItem$1[];
2483
- /** Paging information. */
2484
- pagingMetadata?: PagingMetadataV2$1;
2399
+ interface ListIndexesResponse {
2400
+ /** List of all indexes for the requested data collection. */
2401
+ indexes?: Index[];
2402
+ /** Paging metadata. */
2403
+ pagingMetadata?: PagingMetadata;
2485
2404
  }
2486
- interface PagingMetadataV2$1 {
2405
+ interface PagingMetadata {
2487
2406
  /** Number of items returned in the response. */
2488
2407
  count?: number | null;
2489
2408
  /** Offset that was requested. */
2490
2409
  offset?: number | null;
2491
- /** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */
2410
+ /** Total number of items that match the query. */
2492
2411
  total?: number | null;
2493
- /** Whether the server failed to calculate the `total` field. */
2412
+ /** Flag that indicates the server failed to calculate the `total` field. */
2494
2413
  tooManyToCount?: boolean | null;
2495
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
2496
- cursors?: Cursors$1;
2497
2414
  }
2498
- interface Cursors$1 {
2499
- /** Cursor pointing to next page in the list of results. */
2500
- next?: string | null;
2501
- /** Cursor pointing to previous page in the list of results. */
2502
- prev?: string | null;
2415
+ interface FieldNonNullableFields {
2416
+ path: string;
2417
+ order: Order;
2503
2418
  }
2504
- interface AggregateDataItemsRequest$1 extends AggregateDataItemsRequestPagingMethodOneOf$1 {
2505
- /** Paging options to limit and skip the number of items. */
2506
- paging?: Paging$3;
2507
- /** 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`. */
2508
- cursorPaging?: CursorPaging$1;
2509
- /** ID of the collection on which to run the aggregation. */
2510
- dataCollectionId: string;
2419
+ interface FailureNonNullableFields {
2420
+ code: string;
2421
+ broadCode: string;
2422
+ description: string;
2423
+ }
2424
+ interface IndexNonNullableFields {
2425
+ name: string;
2426
+ fields: FieldNonNullableFields[];
2427
+ status: Status;
2428
+ failure?: FailureNonNullableFields;
2429
+ unique: boolean;
2430
+ caseInsensitive: boolean;
2431
+ }
2432
+ interface CreateIndexResponseNonNullableFields {
2433
+ index?: IndexNonNullableFields;
2434
+ }
2435
+ interface ListIndexesResponseNonNullableFields {
2436
+ indexes: IndexNonNullableFields[];
2437
+ }
2438
+
2439
+ type __PublicMethodMetaInfo$1<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
2440
+ getUrl: (context: any) => string;
2441
+ httpMethod: K;
2442
+ path: string;
2443
+ pathParams: M;
2444
+ __requestType: T;
2445
+ __originalRequestType: S;
2446
+ __responseType: Q;
2447
+ __originalResponseType: R;
2448
+ };
2449
+ declare function createIndex(): __PublicMethodMetaInfo$1<'POST', {}, CreateIndexRequest, CreateIndexRequest$1, CreateIndexResponse & CreateIndexResponseNonNullableFields, CreateIndexResponse$1 & CreateIndexResponseNonNullableFields$1>;
2450
+ declare function dropIndex(): __PublicMethodMetaInfo$1<'DELETE', {}, DropIndexRequest, DropIndexRequest$1, DropIndexResponse, DropIndexResponse$1>;
2451
+ declare function listIndexes(): __PublicMethodMetaInfo$1<'GET', {}, ListIndexesRequest, ListIndexesRequest$1, ListIndexesResponse & ListIndexesResponseNonNullableFields, ListIndexesResponse$1 & ListIndexesResponseNonNullableFields$1>;
2452
+
2453
+ declare const meta_createIndex: typeof createIndex;
2454
+ declare const meta_dropIndex: typeof dropIndex;
2455
+ declare const meta_listIndexes: typeof listIndexes;
2456
+ declare namespace meta {
2457
+ export { type __PublicMethodMetaInfo$1 as __PublicMethodMetaInfo, meta_createIndex as createIndex, meta_dropIndex as dropIndex, meta_listIndexes as listIndexes };
2458
+ }
2459
+
2460
+ declare global {
2461
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2462
+ interface SymbolConstructor {
2463
+ readonly observable: symbol;
2464
+ }
2465
+ }
2466
+
2467
+ declare global {
2468
+ interface ContextualClient {
2469
+ }
2470
+ }
2471
+
2472
+ interface DataItem {
2473
+ /** Data item ID. */
2474
+ id?: string;
2511
2475
  /**
2512
- * Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
2513
- *
2514
- * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2476
+ * ID of the collection to which this item belongs.
2477
+ * @readonly
2515
2478
  */
2516
- initialFilter?: Record<string, any> | null;
2517
- /** Aggregation applied to the data. */
2518
- aggregation?: Aggregation$1;
2479
+ dataCollectionId?: string;
2519
2480
  /**
2520
- * Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
2521
- * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2481
+ * Data item contents.
2482
+ *
2483
+ * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
2484
+ *
2485
+ * + `_id`: Item ID.
2486
+ * + `_createdDate`: Date and time the item was added to the collection.
2487
+ * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
2488
+ * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
2522
2489
  */
2523
- finalFilter?: Record<string, any> | null;
2490
+ data?: Record<string, any> | null;
2491
+ }
2492
+ interface InsertDataItemRequest {
2524
2493
  /**
2525
- * Sort object in the following format:
2526
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
2494
+ * Environment: `LIVE` or `SANDBOX`.
2495
+ * @internal
2527
2496
  */
2528
- sort?: Sorting$1[];
2497
+ environment?: Environment;
2498
+ /** ID of the collection in which to insert the item. */
2499
+ dataCollectionId: string;
2500
+ /** Item to insert. */
2501
+ dataItem: DataItem;
2529
2502
  /**
2530
- * Whether to return the total count in the response for a query with offset paging.
2531
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
2532
- *
2533
- * Default: `false`
2503
+ * Grid app id. Optional in Live segment.
2504
+ * @internal
2534
2505
  */
2535
- returnTotalCount?: boolean;
2506
+ appId?: string | null;
2536
2507
  /**
2537
- * Whether to retrieve data from the primary database instance.
2538
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2539
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2540
- *
2541
- * Default: `false`
2508
+ * If true, referenced items will be included.
2509
+ * @internal
2542
2510
  */
2543
- consistentRead?: boolean;
2511
+ includeReferencedItems?: boolean;
2544
2512
  /**
2545
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2546
- * If provided, the result text is returned in the specified language.
2547
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2548
- *
2549
- * If not provided, result text is not translated.
2513
+ * Data access options
2514
+ * @internal
2515
+ * @deprecated
2516
+ * @replacedBy inlined
2517
+ * @removalDate 2024-07-12
2550
2518
  */
2551
- language?: string | null;
2519
+ options?: Options;
2552
2520
  /**
2553
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2554
- *
2555
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2556
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2557
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2521
+ * Should hooks execution be suppressed.
2522
+ * This option can only be used with Corvid backend
2523
+ * code identity.
2524
+ * @internal
2558
2525
  */
2526
+ suppressHooks?: boolean;
2527
+ /** @internal */
2559
2528
  appOptions?: Record<string, any> | null;
2529
+ }
2530
+ declare enum Environment {
2531
+ LIVE = "LIVE",
2532
+ SANDBOX = "SANDBOX",
2533
+ SANDBOX_PREFERRED = "SANDBOX_PREFERRED"
2534
+ }
2535
+ interface Options {
2560
2536
  /**
2561
- * Options for the Publish plugin.
2562
- * 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.
2537
+ * Should hooks execution be suppressed.
2538
+ * This option can only be used with Corvid backend
2539
+ * code identity.
2540
+ * @internal
2563
2541
  */
2564
- publishPluginOptions?: DataPublishPluginOptions$1;
2542
+ suppressHooks?: boolean;
2543
+ /** @internal */
2544
+ appOptions?: Record<string, any> | null;
2545
+ /** @internal */
2546
+ publishPluginOptions?: PublishPluginOptions;
2565
2547
  }
2566
- /** @oneof */
2567
- interface AggregateDataItemsRequestPagingMethodOneOf$1 {
2568
- /** Paging options to limit and skip the number of items. */
2569
- paging?: Paging$3;
2570
- /** 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`. */
2571
- cursorPaging?: CursorPaging$1;
2572
- }
2573
- interface Average$1 {
2574
- /** Name of the field for which to calculate the average value. */
2575
- itemFieldName?: string;
2576
- }
2577
- interface Min$1 {
2578
- /** Name of the field for which to calculate the minimum value. */
2579
- itemFieldName?: string;
2580
- }
2581
- interface Max$1 {
2582
- /** Name of the field for which to calculate the maximum value. */
2583
- itemFieldName?: string;
2584
- }
2585
- interface Sum$1 {
2586
- /** Name of the field for which to calculate the sum. */
2587
- itemFieldName?: string;
2588
- }
2589
- interface Count$1 {
2590
- }
2591
- interface Operation$1 extends OperationCalculateOneOf$1 {
2592
- /** Calculate the average value of a specified field for all items in the grouping. */
2593
- average?: Average$1;
2594
- /** Calculate the minimum value of a specified field for all items in the grouping. */
2595
- min?: Min$1;
2596
- /** Calculate the maximum value of a specified field for all items in the grouping. */
2597
- max?: Max$1;
2598
- /** Calculate the sum of values of a specified field for all items in the grouping. */
2599
- sum?: Sum$1;
2600
- /** Calculate the number of items in the grouping. */
2601
- itemCount?: Count$1;
2602
- /** Name of the field containing results of the operation. */
2603
- resultFieldName?: string;
2548
+ interface PublishPluginOptions {
2549
+ showDraftItems?: boolean;
2604
2550
  }
2605
- /** @oneof */
2606
- interface OperationCalculateOneOf$1 {
2607
- /** Calculate the average value of a specified field for all items in the grouping. */
2608
- average?: Average$1;
2609
- /** Calculate the minimum value of a specified field for all items in the grouping. */
2610
- min?: Min$1;
2611
- /** Calculate the maximum value of a specified field for all items in the grouping. */
2612
- max?: Max$1;
2613
- /** Calculate the sum of values of a specified field for all items in the grouping. */
2614
- sum?: Sum$1;
2615
- /** Calculate the number of items in the grouping. */
2616
- itemCount?: Count$1;
2617
- }
2618
- interface Aggregation$1 {
2619
- /** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */
2620
- groupingFields?: string[];
2621
- /** Operations to carry out on the data in each grouping. */
2622
- operations?: Operation$1[];
2623
- }
2624
- interface AggregateDataItemsResponse$1 {
2625
- /** Aggregation results. */
2626
- results?: Record<string, any>[] | null;
2627
- /** Paging information. */
2628
- pagingMetadata?: PagingMetadataV2$1;
2551
+ interface InsertDataItemResponse {
2552
+ /** Inserted data item. */
2553
+ dataItem?: DataItem;
2629
2554
  }
2630
- interface CountDataItemsRequest$1 {
2631
- /** ID of the collection for which to count query results. */
2632
- dataCollectionId: string;
2555
+ interface PatchDataItemRequest {
2633
2556
  /**
2634
- * Filter object in the following format:
2635
- *
2636
- * `"filter" : {
2637
- * "fieldName1": "value1",
2638
- * "fieldName2":{"$operator":"value2"}
2639
- * }`.
2640
- *
2641
- * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
2642
- *
2643
- * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2557
+ * Environment: `LIVE` or `SANDBOX`.
2558
+ * @internal
2644
2559
  */
2645
- filter?: Record<string, any> | null;
2560
+ environment?: Environment;
2561
+ /** ID of the collection containing the existing item. */
2562
+ dataCollectionId: string;
2563
+ /** Patch set applied during item update. */
2564
+ patchSet: PatchSet;
2646
2565
  /**
2647
- * Whether to retrieve data from the primary database instance.
2648
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2649
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2650
- *
2651
- * Default: `false`
2566
+ * Grid app id. Optional in Live segment.
2567
+ * @internal
2652
2568
  */
2653
- consistentRead?: boolean;
2569
+ appId?: string | null;
2654
2570
  /**
2655
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2656
- * If provided, the result text is returned in the specified language.
2657
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2658
- *
2659
- * If not provided, result text is not translated.
2571
+ * Data access options
2572
+ * @internal
2573
+ * @deprecated
2574
+ * @replacedBy inlined
2575
+ * @removalDate 2024-07-12
2660
2576
  */
2661
- language?: string | null;
2577
+ options?: Options;
2662
2578
  /**
2663
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2664
- *
2665
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2666
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2667
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2579
+ * Should hooks execution be suppressed.
2580
+ * This option can only be used with Corvid backend
2581
+ * code identity.
2582
+ * @internal
2668
2583
  */
2584
+ suppressHooks?: boolean;
2585
+ /** @internal */
2669
2586
  appOptions?: Record<string, any> | null;
2670
- /**
2671
- * Options for the Publish plugin.
2672
- * 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.
2673
- */
2674
- publishPluginOptions?: DataPublishPluginOptions$1;
2587
+ /** @internal */
2588
+ publishPluginOptions?: DataPublishPluginOptions;
2675
2589
  }
2676
- interface CountDataItemsResponse$1 {
2677
- /** Number of items matching the query. */
2678
- totalCount?: number;
2590
+ interface PatchSet {
2591
+ /** Data item ID. */
2592
+ dataItemId?: string;
2593
+ /** Set of field updates to be applied. */
2594
+ fieldUpdates?: FieldUpdate[];
2595
+ }
2596
+ interface FieldUpdate extends FieldUpdateActionOptionsOneOf {
2597
+ setField?: SetField;
2598
+ incrementField?: IncrementField;
2599
+ appendToArray?: AppendToArray;
2600
+ removeFromArray?: RemoveFromArray;
2601
+ /** Field key to be patched. For ex "title", "address.street" */
2602
+ fieldPath?: string;
2603
+ /** Action to be applied */
2604
+ action?: ACTION;
2679
2605
  }
2680
- interface QueryDistinctValuesRequest$1 extends QueryDistinctValuesRequestPagingMethodOneOf$1 {
2681
- /** Paging options to limit and skip the number of items. */
2682
- paging?: Paging$3;
2683
- /** 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`. */
2684
- cursorPaging?: CursorPaging$1;
2685
- /** ID of the collection to query. */
2686
- dataCollectionId: string;
2687
- /** Item field name for which to return all distinct values. */
2688
- fieldName?: string;
2689
- /**
2690
- * Filter object in the following format:
2691
- *
2692
- * `"filter" : {
2693
- * "fieldName1": "value1",
2694
- * "fieldName2":{"$operator":"value2"}
2695
- * }`.
2696
- *
2697
- * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
2698
- *
2699
- * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2700
- */
2701
- filter?: Record<string, any> | null;
2702
- /** Sort order. */
2703
- order?: SortOrder$1;
2704
- /**
2705
- * Whether to return the total count in the response for a query with offset paging.
2706
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
2707
- *
2708
- * Default: `false`
2709
- */
2710
- returnTotalCount?: boolean;
2606
+ /** @oneof */
2607
+ interface FieldUpdateActionOptionsOneOf {
2608
+ setField?: SetField;
2609
+ incrementField?: IncrementField;
2610
+ appendToArray?: AppendToArray;
2611
+ removeFromArray?: RemoveFromArray;
2612
+ }
2613
+ declare enum ACTION {
2614
+ UNKNOWN_ACTION = "UNKNOWN_ACTION",
2615
+ SET_FIELD = "SET_FIELD",
2616
+ REMOVE_FIELD = "REMOVE_FIELD",
2617
+ INCREMENT_FIELD = "INCREMENT_FIELD",
2618
+ APPEND_TO_ARRAY = "APPEND_TO_ARRAY",
2619
+ REMOVE_FROM_ARRAY = "REMOVE_FROM_ARRAY"
2620
+ }
2621
+ interface SetField {
2622
+ value?: any;
2623
+ }
2624
+ interface IncrementField {
2625
+ value?: number;
2626
+ }
2627
+ interface AppendToArray {
2628
+ value?: any;
2629
+ }
2630
+ interface RemoveFromArray {
2631
+ value?: any;
2632
+ }
2633
+ interface DataPublishPluginOptions {
2634
+ includeDraftItems?: boolean;
2635
+ }
2636
+ interface PatchDataItemResponse {
2637
+ /** Updated data item. */
2638
+ dataItem?: DataItem;
2639
+ }
2640
+ interface BulkPatchDataItemsRequest {
2711
2641
  /**
2712
- * Whether to retrieve data from the primary database instance.
2713
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
2714
- * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
2715
- *
2716
- * Default: `false`
2642
+ * Environment: `LIVE` or `SANDBOX`.
2643
+ * @internal
2717
2644
  */
2718
- consistentRead?: boolean;
2645
+ environment?: Environment;
2646
+ /** ID of the collection in which to update items. */
2647
+ dataCollectionId: string;
2648
+ /** Patch sets to apply. */
2649
+ patchSets: PatchSet[];
2719
2650
  /**
2720
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2721
- * If provided, the result text is returned in the specified language.
2722
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2723
- *
2724
- * If not provided, result text is not translated.
2651
+ * Grid app id. Optional in Live segment.
2652
+ * @internal
2725
2653
  */
2726
- language?: string | null;
2654
+ appId?: string | null;
2727
2655
  /**
2728
- * Options for the Publish plugin.
2729
- * 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.
2656
+ * Data access options
2657
+ * @internal
2658
+ * @deprecated
2659
+ * @replacedBy inlined
2660
+ * @removalDate 2024-07-12
2730
2661
  */
2731
- publishPluginOptions?: DataPublishPluginOptions$1;
2732
- }
2733
- /** @oneof */
2734
- interface QueryDistinctValuesRequestPagingMethodOneOf$1 {
2735
- /** Paging options to limit and skip the number of items. */
2736
- paging?: Paging$3;
2737
- /** 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`. */
2738
- cursorPaging?: CursorPaging$1;
2739
- }
2740
- interface QueryDistinctValuesResponse$1 {
2741
- /** List of distinct values contained in the field specified in `fieldName`. */
2742
- distinctValues?: any[];
2743
- /** Paging information. */
2744
- pagingMetadata?: PagingMetadataV2$1;
2745
- }
2746
- interface BulkInsertDataItemsRequest$1 {
2747
- /** ID of the collection in which to insert the items. */
2748
- dataCollectionId: string;
2749
- /** Data items to insert. */
2750
- dataItems: DataItem$1[];
2662
+ options?: Options;
2751
2663
  /**
2752
- * Whether to return the inserted data items.
2664
+ * Whether to return the updated data items.
2753
2665
  * When `true`, the `results` objects contain a `dataItem` field.
2754
2666
  *
2755
2667
  * Default: `false`
2756
2668
  */
2757
2669
  returnEntity?: boolean;
2758
2670
  /**
2759
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2760
- *
2761
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2762
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2763
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2671
+ * Should hooks execution be suppressed.
2672
+ * This option can only be used with Corvid backend
2673
+ * code identity.
2674
+ * @internal
2764
2675
  */
2676
+ suppressHooks?: boolean;
2677
+ /** @internal */
2765
2678
  appOptions?: Record<string, any> | null;
2679
+ /** @internal */
2680
+ publishPluginOptions?: DataPublishPluginOptions;
2766
2681
  }
2767
- interface BulkInsertDataItemsResponse$1 {
2768
- /** Information about the inserted items. */
2769
- results?: BulkDataItemResult$1[];
2682
+ interface BulkPatchDataItemsResponse {
2683
+ /** Information about the updated items. */
2684
+ results?: BulkDataItemResult[];
2770
2685
  /** Bulk action metadata. */
2771
- bulkActionMetadata?: BulkActionMetadata$1;
2686
+ bulkActionMetadata?: BulkActionMetadata;
2772
2687
  }
2773
- interface BulkUpdateDataItemsRequest$1 {
2774
- /** ID of the collection in which to update items. */
2688
+ interface BulkDataItemResult {
2689
+ /** The action attempted for the data item. */
2690
+ action?: BulkActionType;
2691
+ /** Metadata related to the data item for which the action was attempted. */
2692
+ itemMetadata?: ItemMetadata;
2693
+ /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
2694
+ dataItem?: DataItem;
2695
+ }
2696
+ declare enum BulkActionType {
2697
+ UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
2698
+ INSERT = "INSERT",
2699
+ UPDATE = "UPDATE",
2700
+ DELETE = "DELETE",
2701
+ PATCH = "PATCH"
2702
+ }
2703
+ interface ItemMetadata {
2704
+ /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */
2705
+ id?: string | null;
2706
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
2707
+ originalIndex?: number;
2708
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
2709
+ success?: boolean;
2710
+ /** Details about the error in case of failure. */
2711
+ error?: ApplicationError;
2712
+ }
2713
+ interface ApplicationError {
2714
+ /** Error code. */
2715
+ code?: string;
2716
+ /** Description of the error. */
2717
+ description?: string;
2718
+ /** Data related to the error. */
2719
+ data?: Record<string, any> | null;
2720
+ }
2721
+ interface BulkActionMetadata {
2722
+ /** Number of items successfully processed. */
2723
+ totalSuccesses?: number;
2724
+ /** Number of items that couldn't be processed. */
2725
+ totalFailures?: number;
2726
+ }
2727
+ interface UpdateDataItemRequest {
2728
+ /**
2729
+ * Environment: `LIVE` or `SANDBOX`.
2730
+ * @internal
2731
+ */
2732
+ environment?: Environment;
2733
+ /** ID of the collection containing the existing item. */
2775
2734
  dataCollectionId: string;
2776
- /** Data items to update. */
2777
- dataItems: DataItem$1[];
2735
+ /** Updated data item content. The existing data item's content is replaced entirely. */
2736
+ dataItem: DataItem;
2778
2737
  /**
2779
- * Whether to return the updated data items.
2780
- * When `true`, the `results` objects contain a `dataItem` field.
2781
- *
2782
- * Default: `false`
2738
+ * Grid app id. Optional in Live segment.
2739
+ * @internal
2783
2740
  */
2784
- returnEntity?: boolean;
2741
+ appId?: string | null;
2785
2742
  /**
2786
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2787
- *
2788
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2789
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2790
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2743
+ * If true, referenced items will be included.
2744
+ * @internal
2791
2745
  */
2792
- appOptions?: Record<string, any> | null;
2746
+ includeReferencedItems?: boolean;
2793
2747
  /**
2794
- * Options for the Publish plugin.
2795
- * 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.
2748
+ * Data access options
2749
+ * @internal
2750
+ * @deprecated
2751
+ * @replacedBy inlined
2752
+ * @removalDate 2024-07-12
2753
+ */
2754
+ options?: Options;
2755
+ /**
2756
+ * Should hooks execution be suppressed.
2757
+ * This option can only be used with Corvid backend
2758
+ * code identity.
2759
+ * @internal
2796
2760
  */
2797
- publishPluginOptions?: DataPublishPluginOptions$1;
2761
+ suppressHooks?: boolean;
2762
+ /** @internal */
2763
+ appOptions?: Record<string, any> | null;
2764
+ /** @internal */
2765
+ publishPluginOptions?: DataPublishPluginOptions;
2798
2766
  }
2799
- interface BulkUpdateDataItemsResponse$1 {
2800
- /** Information about the updated items. */
2801
- results?: BulkDataItemResult$1[];
2802
- /** Bulk action metadata. */
2803
- bulkActionMetadata?: BulkActionMetadata$1;
2767
+ interface UpdateDataItemResponse {
2768
+ /** Updated data item. */
2769
+ dataItem?: DataItem;
2804
2770
  }
2805
- interface BulkSaveDataItemsRequest$1 {
2806
- /** ID of the collection in which to insert or update the items. */
2771
+ interface SaveDataItemRequest {
2772
+ /**
2773
+ * Environment: `LIVE` or `SANDBOX`.
2774
+ * @internal
2775
+ */
2776
+ environment?: Environment;
2777
+ /** ID of the collection in which to insert or update the item. */
2807
2778
  dataCollectionId: string;
2808
- /** Data items to insert or update. */
2809
- dataItems: DataItem$1[];
2779
+ /** Data item to insert or update. */
2780
+ dataItem: DataItem;
2810
2781
  /**
2811
- * Whether to return the saved data item.
2812
- * When `true`, the `results` objects contain a `dataItem` field.
2813
- *
2814
- * Default: `false`
2782
+ * Grid app id. Optional in Live segment.
2783
+ * @internal
2815
2784
  */
2816
- returnEntity?: boolean;
2785
+ appId?: string | null;
2817
2786
  /**
2818
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2819
- *
2820
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2821
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2822
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2787
+ * If true, referenced items will be included.
2788
+ * @internal
2823
2789
  */
2824
- appOptions?: Record<string, any> | null;
2790
+ includeReferencedItems?: boolean;
2825
2791
  /**
2826
- * Options for the Publish plugin.
2827
- * 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.
2792
+ * Data access options
2793
+ * @internal
2794
+ * @deprecated
2795
+ * @replacedBy inlined
2796
+ * @removalDate 2024-07-12
2828
2797
  */
2829
- publishPluginOptions?: DataPublishPluginOptions$1;
2830
- }
2831
- interface BulkSaveDataItemsResponse$1 {
2832
- /** Information about the saved items. */
2833
- results?: BulkDataItemResult$1[];
2834
- /** Bulk action metadata. */
2835
- bulkActionMetadata?: BulkActionMetadata$1;
2836
- }
2837
- interface BulkRemoveDataItemsRequest$1 {
2838
- /** ID of the collection from which to remove the item. */
2839
- dataCollectionId: string;
2840
- /** IDs of data items to remove. */
2841
- dataItemIds: string[];
2798
+ options?: Options;
2842
2799
  /**
2843
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2844
- *
2845
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2846
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2847
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2800
+ * Should hooks execution be suppressed.
2801
+ * This option can only be used with Corvid backend
2802
+ * code identity.
2803
+ * @internal
2848
2804
  */
2805
+ suppressHooks?: boolean;
2806
+ /** @internal */
2849
2807
  appOptions?: Record<string, any> | null;
2808
+ /** @internal */
2809
+ publishPluginOptions?: DataPublishPluginOptions;
2810
+ }
2811
+ interface SaveDataItemResponse {
2850
2812
  /**
2851
- * Options for the Publish plugin.
2852
- * 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.
2813
+ * Action carried out for the item.
2814
+ *
2815
+ * + `INSERTED`: A new item was added to the collection.
2816
+ * + `UPDATED`: An existing item in the collection was updated.
2853
2817
  */
2854
- publishPluginOptions?: DataPublishPluginOptions$1;
2818
+ action?: Action;
2819
+ /** Inserted or updated data item. */
2820
+ dataItem?: DataItem;
2855
2821
  }
2856
- interface BulkRemoveDataItemsResponse$1 {
2857
- /** Information about the removed data items. */
2858
- results?: BulkDataItemResult$1[];
2859
- /** Bulk action metadata. */
2860
- bulkActionMetadata?: BulkActionMetadata$1;
2822
+ declare enum Action {
2823
+ UNKNOWN_ACTION = "UNKNOWN_ACTION",
2824
+ INSERTED = "INSERTED",
2825
+ UPDATED = "UPDATED"
2861
2826
  }
2862
- interface QueryReferencedDataItemsRequest$1 extends QueryReferencedDataItemsRequestPagingMethodOneOf$1 {
2863
- /** Paging options to limit and skip the number of items. */
2864
- paging?: Paging$3;
2865
- /** 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`. */
2866
- cursorPaging?: CursorPaging$1;
2867
- /** ID of the collection containing the referring item. */
2827
+ interface GetDataItemRequest {
2828
+ /**
2829
+ * Environment: `LIVE` or `SANDBOX`.
2830
+ * @internal
2831
+ */
2832
+ environment?: Environment;
2833
+ /** ID of the collection from which to retrieve the data item. */
2868
2834
  dataCollectionId: string;
2869
- /** ID of the referring item. */
2870
- referringItemId?: string;
2871
- /** Field containing references in the referring item. */
2872
- referringItemFieldName?: string;
2873
- /** Order of the returned referenced items. Sorted by the date each item was referenced. */
2874
- order?: SortOrder$1;
2835
+ /** ID of the data item to retrieve. */
2836
+ dataItemId: string;
2875
2837
  /**
2876
- * Whether to return the total count in the response.
2877
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
2878
- *
2879
- * Default: `false`
2838
+ * Grid app id. Optional in Live segment.
2839
+ * @internal
2880
2840
  */
2881
- returnTotalCount?: boolean;
2841
+ appId?: string | null;
2842
+ /**
2843
+ * Data access options
2844
+ * @internal
2845
+ * @deprecated
2846
+ * @replacedBy inlined
2847
+ * @removalDate 2024-07-12
2848
+ */
2849
+ options?: Options;
2882
2850
  /**
2883
2851
  * Whether to retrieve data from the primary database instance.
2884
2852
  * This decreases performance but ensures data retrieved is up to date even immediately after an update.
@@ -2889,78 +2857,286 @@ interface QueryReferencedDataItemsRequest$1 extends QueryReferencedDataItemsRequ
2889
2857
  consistentRead?: boolean;
2890
2858
  /**
2891
2859
  * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
2892
- * If provided, the result text is returned in the specified language.
2860
+ * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.
2861
+ *
2893
2862
  * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
2894
2863
  *
2895
- * If not provided, result text is not translated.
2896
2864
  */
2897
2865
  language?: string | null;
2898
2866
  /**
2899
- * Fields to return for each referenced item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
2867
+ * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
2868
+ *
2900
2869
  * **Note:** The `_id` system field is always returned.
2901
2870
  */
2902
2871
  fields?: string[];
2903
2872
  /**
2904
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying:
2905
- *
2906
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2907
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2908
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2873
+ * Should hooks execution be suppressed.
2874
+ * This option can only be used with Corvid backend
2875
+ * code identity.
2876
+ * @internal
2909
2877
  */
2878
+ suppressHooks?: boolean;
2879
+ /** @internal */
2910
2880
  appOptions?: Record<string, any> | null;
2911
- /**
2912
- * Options for the Publish plugin.
2913
- * 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.
2914
- */
2915
- publishPluginOptions?: DataPublishPluginOptions$1;
2916
- }
2917
- /** @oneof */
2918
- interface QueryReferencedDataItemsRequestPagingMethodOneOf$1 {
2919
- /** Paging options to limit and skip the number of items. */
2920
- paging?: Paging$3;
2921
- /** 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`. */
2922
- cursorPaging?: CursorPaging$1;
2881
+ /** @internal */
2882
+ publishPluginOptions?: DataPublishPluginOptions;
2923
2883
  }
2924
- interface QueryReferencedDataItemsResponse$1 {
2925
- /** Referenced items and/or IDs. For successfully resolved references, the referenced data item is returned. For references that can't be resolved, the ID is returned. */
2926
- results?: ReferencedResult$1[];
2927
- /** Paging information. */
2928
- pagingMetadata?: PagingMetadataV2$1;
2884
+ interface GetDataItemResponse {
2885
+ /** Retrieved item. */
2886
+ dataItem?: DataItem;
2929
2887
  }
2930
- interface UnresolvedReference$1 {
2888
+ interface RemoveDataItemRequest {
2931
2889
  /**
2932
- * ID of the referring item.
2933
- * @deprecated
2934
- * @targetRemovalDate 2025-03-01
2890
+ * Environment: `LIVE` or `SANDBOX`
2891
+ * @internal
2935
2892
  */
2936
- referringItemId?: string;
2893
+ environment?: Environment;
2894
+ /** ID of the collection from which to remove the item. */
2895
+ dataCollectionId: string;
2896
+ /** ID of the item to remove. */
2897
+ dataItemId: string;
2937
2898
  /**
2938
- * Field specified to query for references.
2899
+ * Grid app id. Optional in Live segment.
2900
+ * @internal
2901
+ */
2902
+ appId?: string | null;
2903
+ /**
2904
+ * Data access options
2905
+ * @internal
2939
2906
  * @deprecated
2940
- * @targetRemovalDate 2025-03-01
2907
+ * @replacedBy inlined
2908
+ * @removalDate 2024-07-12
2941
2909
  */
2942
- referringItemFieldName?: string;
2943
- /** ID of unresolved referenced item */
2944
- referencedItemId?: string;
2945
- /** Flag is set if item exists, but user is not authorized to read it */
2946
- unauthorized?: boolean;
2947
- }
2948
- interface ReferencedResult$1 extends ReferencedResultEntityOneOf$1 {
2949
- /** Data item referenced. */
2950
- dataItem?: DataItem$1;
2951
- /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */
2952
- unresolvedReference?: UnresolvedReference$1;
2953
- /** ID of the referring item. */
2954
- referringItemId?: string;
2955
- }
2956
- /** @oneof */
2957
- interface ReferencedResultEntityOneOf$1 {
2958
- /** Data item referenced. */
2959
- dataItem?: DataItem$1;
2960
- /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */
2961
- unresolvedReference?: UnresolvedReference$1;
2910
+ options?: Options;
2911
+ /**
2912
+ * Should hooks execution be suppressed.
2913
+ * This option can only be used with Corvid backend
2914
+ * code identity.
2915
+ * @internal
2916
+ */
2917
+ suppressHooks?: boolean;
2918
+ /** @internal */
2919
+ appOptions?: Record<string, any> | null;
2920
+ /** @internal */
2921
+ publishPluginOptions?: DataPublishPluginOptions;
2922
+ }
2923
+ interface RemoveDataItemResponse {
2924
+ /** Removed item. */
2925
+ dataItem?: DataItem;
2926
+ }
2927
+ interface TruncateDataItemsRequest {
2928
+ /**
2929
+ * Environment: `LIVE` or `SANDBOX`.
2930
+ * @internal
2931
+ */
2932
+ environment?: Environment;
2933
+ /** ID of the collection to truncate. */
2934
+ dataCollectionId: string;
2935
+ /**
2936
+ * Grid app id. Optional in Live segment.
2937
+ * @internal
2938
+ */
2939
+ appId?: string | null;
2940
+ /**
2941
+ * Data access options
2942
+ * @internal
2943
+ * @deprecated
2944
+ * @replacedBy inlined
2945
+ * @removalDate 2024-07-12
2946
+ */
2947
+ options?: Options;
2948
+ }
2949
+ interface TruncateDataItemsResponse {
2950
+ }
2951
+ interface BulkInsertDataItemsRequest {
2952
+ /**
2953
+ * Environment: `LIVE` or `SANDBOX`.
2954
+ * @internal
2955
+ */
2956
+ environment?: Environment;
2957
+ /** ID of the collection in which to insert the items. */
2958
+ dataCollectionId: string;
2959
+ /** Data items to insert. */
2960
+ dataItems: DataItem[];
2961
+ /**
2962
+ * Grid app ID. Optional in `LIVE` segment.
2963
+ * @internal
2964
+ */
2965
+ appId?: string | null;
2966
+ /**
2967
+ * Data access options.
2968
+ * @internal
2969
+ * @deprecated
2970
+ * @replacedBy inlined
2971
+ * @removalDate 2024-07-12
2972
+ */
2973
+ options?: Options;
2974
+ /**
2975
+ * Whether to return the inserted data items.
2976
+ * When `true`, the `results` objects contain a `dataItem` field.
2977
+ *
2978
+ * Default: `false`
2979
+ */
2980
+ returnEntity?: boolean;
2981
+ /**
2982
+ * Should hooks execution be suppressed.
2983
+ * This option can only be used with Corvid backend
2984
+ * code identity.
2985
+ * @internal
2986
+ */
2987
+ suppressHooks?: boolean;
2988
+ /** @internal */
2989
+ appOptions?: Record<string, any> | null;
2990
+ }
2991
+ interface BulkInsertDataItemsResponse {
2992
+ /** Information about the inserted items. */
2993
+ results?: BulkDataItemResult[];
2994
+ /** Bulk action metadata. */
2995
+ bulkActionMetadata?: BulkActionMetadata;
2996
+ }
2997
+ interface BulkUpdateDataItemsRequest {
2998
+ /**
2999
+ * Environment: `LIVE` or `SANDBOX`.
3000
+ * @internal
3001
+ */
3002
+ environment?: Environment;
3003
+ /** ID of the collection in which to update items. */
3004
+ dataCollectionId: string;
3005
+ /** Data items to update. */
3006
+ dataItems: DataItem[];
3007
+ /**
3008
+ * Grid app id. Optional in Live segment.
3009
+ * @internal
3010
+ */
3011
+ appId?: string | null;
3012
+ /**
3013
+ * Data access options
3014
+ * @internal
3015
+ * @deprecated
3016
+ * @replacedBy inlined
3017
+ * @removalDate 2024-07-12
3018
+ */
3019
+ options?: Options;
3020
+ /**
3021
+ * Whether to return the updated data items.
3022
+ * When `true`, the `results` objects contain a `dataItem` field.
3023
+ *
3024
+ * Default: `false`
3025
+ */
3026
+ returnEntity?: boolean;
3027
+ /**
3028
+ * Should hooks execution be suppressed.
3029
+ * This option can only be used with Corvid backend
3030
+ * code identity.
3031
+ * @internal
3032
+ */
3033
+ suppressHooks?: boolean;
3034
+ /** @internal */
3035
+ appOptions?: Record<string, any> | null;
3036
+ /** @internal */
3037
+ publishPluginOptions?: DataPublishPluginOptions;
3038
+ }
3039
+ interface BulkUpdateDataItemsResponse {
3040
+ /** Information about the updated items. */
3041
+ results?: BulkDataItemResult[];
3042
+ /** Bulk action metadata. */
3043
+ bulkActionMetadata?: BulkActionMetadata;
3044
+ }
3045
+ interface BulkSaveDataItemsRequest {
3046
+ /**
3047
+ * Environment: LIVE or SANDBOX
3048
+ * @internal
3049
+ */
3050
+ environment?: Environment;
3051
+ /** ID of the collection in which to insert or update the items. */
3052
+ dataCollectionId: string;
3053
+ /** Data items to insert or update. */
3054
+ dataItems: DataItem[];
3055
+ /**
3056
+ * Grid app id. Optional in Live segment.
3057
+ * @internal
3058
+ */
3059
+ appId?: string | null;
3060
+ /**
3061
+ * Data access options
3062
+ * @internal
3063
+ * @deprecated
3064
+ * @replacedBy inlined
3065
+ * @removalDate 2024-07-12
3066
+ */
3067
+ options?: Options;
3068
+ /**
3069
+ * Whether to return the saved data item.
3070
+ * When `true`, the `results` objects contain a `dataItem` field.
3071
+ *
3072
+ * Default: `false`
3073
+ */
3074
+ returnEntity?: boolean;
3075
+ /**
3076
+ * Should hooks execution be suppressed.
3077
+ * This option can only be used with Corvid backend
3078
+ * code identity.
3079
+ * @internal
3080
+ */
3081
+ suppressHooks?: boolean;
3082
+ /** @internal */
3083
+ appOptions?: Record<string, any> | null;
3084
+ /** @internal */
3085
+ publishPluginOptions?: DataPublishPluginOptions;
3086
+ }
3087
+ interface BulkSaveDataItemsResponse {
3088
+ /** Information about the saved items. */
3089
+ results?: BulkDataItemResult[];
3090
+ /** Bulk action metadata. */
3091
+ bulkActionMetadata?: BulkActionMetadata;
3092
+ }
3093
+ interface BulkRemoveDataItemsRequest {
3094
+ /**
3095
+ * Environment: `LIVE` or `SANDBOX`.
3096
+ * @internal
3097
+ */
3098
+ environment?: Environment;
3099
+ /** ID of the collection from which to remove the item. */
3100
+ dataCollectionId: string;
3101
+ /** IDs of data items to remove. */
3102
+ dataItemIds: string[];
3103
+ /**
3104
+ * Grid app id. Optional in Live segment.
3105
+ * @internal
3106
+ */
3107
+ appId?: string | null;
3108
+ /**
3109
+ * Data access options
3110
+ * @internal
3111
+ * @deprecated
3112
+ * @replacedBy inlined
3113
+ * @removalDate 2024-07-12
3114
+ */
3115
+ options?: Options;
3116
+ /**
3117
+ * Should hooks execution be suppressed.
3118
+ * This option can only be used with Corvid backend
3119
+ * code identity.
3120
+ * @internal
3121
+ */
3122
+ suppressHooks?: boolean;
3123
+ /** @internal */
3124
+ appOptions?: Record<string, any> | null;
3125
+ /** @internal */
3126
+ publishPluginOptions?: DataPublishPluginOptions;
3127
+ }
3128
+ interface BulkRemoveDataItemsResponse {
3129
+ /** Information about the removed data items. */
3130
+ results?: BulkDataItemResult[];
3131
+ /** Bulk action metadata. */
3132
+ bulkActionMetadata?: BulkActionMetadata;
2962
3133
  }
2963
- interface IsReferencedDataItemRequest$1 {
3134
+ interface IsReferencedDataItemRequest {
3135
+ /**
3136
+ * Environment: `LIVE` or `SANDBOX`.
3137
+ * @internal
3138
+ */
3139
+ environment?: Environment;
2964
3140
  /** ID of the collection containing the referring data item. */
2965
3141
  dataCollectionId: string;
2966
3142
  /** Field to check for a reference to the item that may be referenced. */
@@ -2969,6 +3145,19 @@ interface IsReferencedDataItemRequest$1 {
2969
3145
  referringItemId: string;
2970
3146
  /** ID of the item that may be referenced. */
2971
3147
  referencedItemId: string;
3148
+ /**
3149
+ * Grid app id. Optional in Live segment.
3150
+ * @internal
3151
+ */
3152
+ appId?: string | null;
3153
+ /**
3154
+ * Data access options
3155
+ * @internal
3156
+ * @deprecated
3157
+ * @replacedBy inlined
3158
+ * @removalDate 2024-07-12
3159
+ */
3160
+ options?: Options;
2972
3161
  /**
2973
3162
  * Whether to retrieve data from the primary database instance.
2974
3163
  * This decreases performance but ensures data retrieved is up to date even immediately after an update.
@@ -2977,26 +3166,14 @@ interface IsReferencedDataItemRequest$1 {
2977
3166
  * Default: `false`
2978
3167
  */
2979
3168
  consistentRead?: boolean;
3169
+ /** @internal */
3170
+ appOptions?: Record<string, any> | null;
2980
3171
  }
2981
- interface IsReferencedDataItemResponse$1 {
3172
+ interface IsReferencedDataItemResponse {
2982
3173
  /** Whether the specified reference exists. */
2983
3174
  isReferenced?: boolean;
2984
3175
  }
2985
- interface InsertDataItemReferenceRequest$1 {
2986
- /** ID of the collection in which to insert the reference. */
2987
- dataCollectionId: string;
2988
- /** Reference to insert */
2989
- dataItemReference?: DataItemReference$1;
2990
- /**
2991
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
2992
- *
2993
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
2994
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
2995
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
2996
- */
2997
- appOptions?: Record<string, any> | null;
2998
- }
2999
- interface DataItemReference$1 {
3176
+ interface DataItemReference {
3000
3177
  /** Referring item field containing the references to the referenced items. */
3001
3178
  referringItemFieldName?: string;
3002
3179
  /** ID of the referring item. */
@@ -3004,25 +3181,29 @@ interface DataItemReference$1 {
3004
3181
  /** ID of the referenced item. */
3005
3182
  referencedItemId?: string;
3006
3183
  }
3007
- interface InsertDataItemReferenceResponse$1 {
3008
- /** Inserted reference. */
3009
- dataItemReference?: DataItemReference$1;
3010
- }
3011
- interface RemoveDataItemReferenceRequest$1 {
3012
- /** ID of the collection containing the referring item. */
3013
- dataCollectionId: string;
3014
- /** Reference to remove. */
3015
- dataItemReference: DataItemReference$1;
3016
- }
3017
- interface RemoveDataItemReferenceResponse$1 {
3018
- /** Removed reference. */
3019
- dataItemReference?: DataItemReference$1;
3020
- }
3021
- interface BulkInsertDataItemReferencesRequest$1 {
3184
+ interface BulkInsertDataItemReferencesRequest {
3185
+ /**
3186
+ * Environment: `LIVE` or `SANDBOX`.
3187
+ * @internal
3188
+ */
3189
+ environment?: Environment;
3022
3190
  /** ID of the collection containing the referring items. */
3023
3191
  dataCollectionId: string;
3024
3192
  /** References to insert. */
3025
- dataItemReferences: DataItemReference$1[];
3193
+ dataItemReferences: DataItemReference[];
3194
+ /**
3195
+ * Grid app ID. Optional in `LIVE` segment.
3196
+ * @internal
3197
+ */
3198
+ appId?: string | null;
3199
+ /**
3200
+ * Data access options
3201
+ * @internal
3202
+ * @deprecated
3203
+ * @replacedBy inlined
3204
+ * @removalDate 2024-07-12
3205
+ */
3206
+ options?: Options;
3026
3207
  /**
3027
3208
  * Whether to return the inserted data item references.
3028
3209
  * When `true`, the `results` objects contain a `dataItemReference` field.
@@ -3030,34 +3211,61 @@ interface BulkInsertDataItemReferencesRequest$1 {
3030
3211
  * Default: `false`
3031
3212
  */
3032
3213
  returnEntity?: boolean;
3214
+ /** @internal */
3215
+ appOptions?: Record<string, any> | null;
3033
3216
  }
3034
- interface BulkInsertDataItemReferencesResponse$1 {
3217
+ interface BulkInsertDataItemReferencesResponse {
3035
3218
  /** Information about the inserted references. */
3036
- results?: BulkDataItemReferenceResult$1[];
3219
+ results?: BulkDataItemReferenceResult[];
3037
3220
  /** Bulk action metadata. */
3038
- bulkActionMetadata?: BulkActionMetadata$1;
3221
+ bulkActionMetadata?: BulkActionMetadata;
3039
3222
  }
3040
- interface BulkDataItemReferenceResult$1 {
3041
- /** The action attempted for the reference. */
3042
- action?: BulkActionType$1;
3223
+ interface BulkDataItemReferenceResult {
3224
+ /** Action attempted for the reference. */
3225
+ action?: BulkActionType;
3043
3226
  /** Metadata related to the reference for which the action was attempted. */
3044
- referenceMetadata?: ItemMetadata$1;
3045
- /** The reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
3046
- dataItemReference?: DataItemReference$1;
3227
+ referenceMetadata?: ItemMetadata;
3228
+ /** Reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
3229
+ dataItemReference?: DataItemReference;
3047
3230
  }
3048
- interface BulkRemoveDataItemReferencesRequest$1 {
3231
+ interface BulkRemoveDataItemReferencesRequest {
3232
+ /**
3233
+ * Environment: `LIVE` or `SANDBOX`.
3234
+ * @internal
3235
+ */
3236
+ environment?: Environment;
3049
3237
  /** ID of the collection containing the referring items. */
3050
3238
  dataCollectionId: string;
3051
3239
  /** References to remove. */
3052
- dataItemReferences: DataItemReference$1[];
3240
+ dataItemReferences: DataItemReference[];
3241
+ /**
3242
+ * Grid app ID. Optional in `LIVE` segment.
3243
+ * @internal
3244
+ */
3245
+ appId?: string | null;
3246
+ /**
3247
+ * Data access options
3248
+ * @internal
3249
+ * @deprecated
3250
+ * @replacedBy inlined
3251
+ * @removalDate 2024-07-12
3252
+ */
3253
+ options?: Options;
3254
+ /** @internal */
3255
+ appOptions?: Record<string, any> | null;
3053
3256
  }
3054
- interface BulkRemoveDataItemReferencesResponse$1 {
3257
+ interface BulkRemoveDataItemReferencesResponse {
3055
3258
  /** Information about the removed references. */
3056
- results?: BulkDataItemReferenceResult$1[];
3259
+ results?: BulkDataItemReferenceResult[];
3057
3260
  /** Bulk action metadata. */
3058
- bulkActionMetadata?: BulkActionMetadata$1;
3261
+ bulkActionMetadata?: BulkActionMetadata;
3059
3262
  }
3060
- interface ReplaceDataItemReferencesRequest$1 {
3263
+ interface ReplaceDataItemReferencesRequest {
3264
+ /**
3265
+ * Environment: `LIVE` or `SANDBOX`.
3266
+ * @internal
3267
+ */
3268
+ environment?: Environment;
3061
3269
  /** ID of the collection containing the referring item. */
3062
3270
  dataCollectionId: string;
3063
3271
  /** Field containing references in the referring item. */
@@ -3066,1536 +3274,25 @@ interface ReplaceDataItemReferencesRequest$1 {
3066
3274
  referringItemId: string;
3067
3275
  /** List of new referenced item IDs to replace the existing ones. */
3068
3276
  newReferencedItemIds?: string[];
3069
- }
3070
- interface ReplaceDataItemReferencesResponse$1 {
3071
- /** Updated references. */
3072
- dataItemReferences?: DataItemReference$1[];
3073
- }
3074
- interface DataItemNonNullableFields$1 {
3075
- id: string;
3076
- dataCollectionId: string;
3077
- }
3078
- interface InsertDataItemResponseNonNullableFields$1 {
3079
- dataItem?: DataItemNonNullableFields$1;
3080
- }
3081
- interface UpdateDataItemResponseNonNullableFields$1 {
3082
- dataItem?: DataItemNonNullableFields$1;
3083
- }
3084
- interface SaveDataItemResponseNonNullableFields$1 {
3085
- action: Action$1;
3086
- dataItem?: DataItemNonNullableFields$1;
3087
- }
3088
- interface GetDataItemResponseNonNullableFields$1 {
3089
- dataItem?: DataItemNonNullableFields$1;
3090
- }
3091
- interface RemoveDataItemResponseNonNullableFields$1 {
3092
- dataItem?: DataItemNonNullableFields$1;
3093
- }
3094
- interface CachingInfoNonNullableFields$1 {
3095
- tags: string[];
3096
- }
3097
- interface QueryDataItemsResponseNonNullableFields$1 {
3098
- dataItems: DataItemNonNullableFields$1[];
3099
- cachingInfo?: CachingInfoNonNullableFields$1;
3100
- }
3101
- interface CountDataItemsResponseNonNullableFields$1 {
3102
- totalCount: number;
3103
- }
3104
- interface ApplicationErrorNonNullableFields$1 {
3105
- code: string;
3106
- description: string;
3107
- }
3108
- interface ItemMetadataNonNullableFields$1 {
3109
- originalIndex: number;
3110
- success: boolean;
3111
- error?: ApplicationErrorNonNullableFields$1;
3112
- }
3113
- interface BulkDataItemResultNonNullableFields$1 {
3114
- action: BulkActionType$1;
3115
- itemMetadata?: ItemMetadataNonNullableFields$1;
3116
- dataItem?: DataItemNonNullableFields$1;
3117
- }
3118
- interface BulkActionMetadataNonNullableFields$1 {
3119
- totalSuccesses: number;
3120
- totalFailures: number;
3121
- }
3122
- interface BulkInsertDataItemsResponseNonNullableFields$1 {
3123
- results: BulkDataItemResultNonNullableFields$1[];
3124
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3125
- }
3126
- interface BulkUpdateDataItemsResponseNonNullableFields$1 {
3127
- results: BulkDataItemResultNonNullableFields$1[];
3128
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3129
- }
3130
- interface BulkSaveDataItemsResponseNonNullableFields$1 {
3131
- results: BulkDataItemResultNonNullableFields$1[];
3132
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3133
- }
3134
- interface BulkRemoveDataItemsResponseNonNullableFields$1 {
3135
- results: BulkDataItemResultNonNullableFields$1[];
3136
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3137
- }
3138
- interface UnresolvedReferenceNonNullableFields$1 {
3139
- referringItemId: string;
3140
- referringItemFieldName: string;
3141
- referencedItemId: string;
3142
- unauthorized: boolean;
3143
- }
3144
- interface ReferencedResultNonNullableFields$1 {
3145
- dataItem?: DataItemNonNullableFields$1;
3146
- unresolvedReference?: UnresolvedReferenceNonNullableFields$1;
3147
- referringItemId: string;
3148
- }
3149
- interface QueryReferencedDataItemsResponseNonNullableFields$1 {
3150
- results: ReferencedResultNonNullableFields$1[];
3151
- }
3152
- interface IsReferencedDataItemResponseNonNullableFields$1 {
3153
- isReferenced: boolean;
3154
- }
3155
- interface DataItemReferenceNonNullableFields$1 {
3156
- referringItemFieldName: string;
3157
- referringItemId: string;
3158
- referencedItemId: string;
3159
- }
3160
- interface InsertDataItemReferenceResponseNonNullableFields$1 {
3161
- dataItemReference?: DataItemReferenceNonNullableFields$1;
3162
- }
3163
- interface RemoveDataItemReferenceResponseNonNullableFields$1 {
3164
- dataItemReference?: DataItemReferenceNonNullableFields$1;
3165
- }
3166
- interface BulkDataItemReferenceResultNonNullableFields$1 {
3167
- action: BulkActionType$1;
3168
- referenceMetadata?: ItemMetadataNonNullableFields$1;
3169
- dataItemReference?: DataItemReferenceNonNullableFields$1;
3170
- }
3171
- interface BulkInsertDataItemReferencesResponseNonNullableFields$1 {
3172
- results: BulkDataItemReferenceResultNonNullableFields$1[];
3173
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3174
- }
3175
- interface BulkRemoveDataItemReferencesResponseNonNullableFields$1 {
3176
- results: BulkDataItemReferenceResultNonNullableFields$1[];
3177
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3178
- }
3179
- interface ReplaceDataItemReferencesResponseNonNullableFields$1 {
3180
- dataItemReferences: DataItemReferenceNonNullableFields$1[];
3181
- }
3182
-
3183
- interface DataItem {
3184
- /** Data item ID. */
3185
- _id?: string;
3186
- /**
3187
- * ID of the collection this item belongs to
3188
- * @readonly
3189
- */
3190
- dataCollectionId?: string;
3191
3277
  /**
3192
- * Data item contents.
3193
- *
3194
- * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
3195
- *
3196
- * + `_id`: Item ID.
3197
- * + `_createdDate`: Date and time the item was added to the collection.
3198
- * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
3199
- * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
3278
+ * Grid app ID. Optional in `LIVE` segment.
3279
+ * @internal
3200
3280
  */
3201
- data?: Record<string, any> | null;
3202
- }
3203
- interface InsertDataItemRequest {
3204
- /** ID of the collection in which to insert the item. */
3205
- dataCollectionId: string;
3206
- /** Item to insert. */
3207
- dataItem: DataItem;
3281
+ appId?: string | null;
3208
3282
  /**
3209
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3210
- *
3211
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3212
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3213
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3283
+ * Data access options
3284
+ * @internal
3285
+ * @deprecated
3286
+ * @replacedBy inlined
3287
+ * @removalDate 2024-07-12
3214
3288
  */
3289
+ options?: Options;
3290
+ /** @internal */
3215
3291
  appOptions?: Record<string, any> | null;
3216
3292
  }
3217
- interface InsertDataItemResponse {
3218
- /** Inserted data item. */
3219
- dataItem?: DataItem;
3220
- }
3221
- interface DataPublishPluginOptions {
3222
- /**
3223
- * Whether to include draft items.
3224
- * When `true`, the response includes both published and draft items. Default: `false`.
3225
- */
3226
- includeDraftItems?: boolean;
3227
- }
3228
- interface BulkDataItemResult {
3229
- /**
3230
- * The action attempted for the data item.
3231
- *
3232
- * Supported values: `UNKNOWN_ACTION_TYPE`, `INSERT`, `UPDATE`, `DELETE`.
3233
- */
3234
- action?: BulkActionType;
3235
- /** Metadata related to the data item for which the action was attempted. */
3236
- itemMetadata?: ItemMetadata;
3237
- /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
3238
- dataItem?: DataItem;
3239
- }
3240
- declare enum BulkActionType {
3241
- UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
3242
- INSERT = "INSERT",
3243
- UPDATE = "UPDATE",
3244
- DELETE = "DELETE",
3245
- PATCH = "PATCH"
3246
- }
3247
- interface ItemMetadata {
3248
- /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */
3249
- _id?: string | null;
3250
- /** Index of the item within the request array. Allows for correlation between request and response items. */
3251
- originalIndex?: number;
3252
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
3253
- success?: boolean;
3254
- /** Details about the error in case of failure. */
3255
- error?: ApplicationError;
3256
- }
3257
- interface ApplicationError {
3258
- /** Error code. */
3259
- code?: string;
3260
- /** Description of the error. */
3261
- description?: string;
3262
- /** Data related to the error. */
3263
- data?: Record<string, any> | null;
3264
- }
3265
- interface BulkActionMetadata {
3266
- /** Number of items successfully processed. */
3267
- totalSuccesses?: number;
3268
- /** Number of items that couldn't be processed. */
3269
- totalFailures?: number;
3270
- }
3271
- interface UpdateDataItemRequest {
3272
- /** ID of the collection containing the existing item. */
3273
- dataCollectionId: string;
3274
- /** Updated data item content. The existing data item's content is replaced entirely. */
3275
- dataItem: DataItem;
3276
- /**
3277
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3278
- *
3279
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3280
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3281
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3282
- */
3283
- appOptions?: Record<string, any> | null;
3284
- /**
3285
- * Options for the Publish plugin.
3286
- * 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.
3287
- */
3288
- publishPluginOptions?: DataPublishPluginOptions;
3289
- }
3290
- interface UpdateDataItemResponse {
3291
- /** Updated data item. */
3292
- dataItem?: DataItem;
3293
- }
3294
- interface SaveDataItemRequest {
3295
- /** ID of the collection in which to insert or update the item. */
3296
- dataCollectionId: string;
3297
- /** Data item to insert or update. */
3298
- dataItem: DataItem;
3299
- /**
3300
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3301
- *
3302
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3303
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3304
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3305
- */
3306
- appOptions?: Record<string, any> | null;
3307
- /**
3308
- * Options for the Publish plugin.
3309
- * 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.
3310
- */
3311
- publishPluginOptions?: DataPublishPluginOptions;
3312
- }
3313
- interface SaveDataItemResponse {
3314
- /** The action carried out for the item. */
3315
- action?: Action;
3316
- /** Inserted or updated data item. */
3317
- dataItem?: DataItem;
3318
- }
3319
- declare enum Action {
3320
- /** Undefined action. */
3321
- UNKNOWN_ACTION = "UNKNOWN_ACTION",
3322
- /** A new item was added to the collection. */
3323
- INSERTED = "INSERTED",
3324
- /** An existing item in the collection was updated. */
3325
- UPDATED = "UPDATED"
3326
- }
3327
- interface GetDataItemRequest {
3328
- /** ID of the collection from which to retrieve the data item. */
3329
- dataCollectionId: string;
3330
- /** ID of the data item to retrieve. */
3331
- dataItemId: string;
3332
- /**
3333
- * Whether to retrieve data from the primary database instance.
3334
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3335
- *
3336
- * Default: `false`
3337
- */
3338
- consistentRead?: boolean;
3339
- /**
3340
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3341
- * If provided, the result text is returned in the specified language.
3342
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
3343
- *
3344
- * If not provided, result text is not translated.
3345
- */
3346
- language?: string | null;
3347
- /**
3348
- * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
3349
- * **Note:** The `_id` system field is always returned.
3350
- */
3351
- fields?: string[];
3352
- /**
3353
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3354
- *
3355
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3356
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3357
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3358
- */
3359
- appOptions?: Record<string, any> | null;
3360
- /**
3361
- * Options for the Publish plugin.
3362
- * 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.
3363
- */
3364
- publishPluginOptions?: DataPublishPluginOptions;
3365
- }
3366
- interface GetDataItemResponse {
3367
- /** Retrieved item. */
3368
- dataItem?: DataItem;
3369
- }
3370
- interface RemoveDataItemRequest {
3371
- /** ID of the collection from which to remove the item. */
3372
- dataCollectionId: string;
3373
- /** ID of the item to remove. */
3374
- dataItemId: string;
3375
- /**
3376
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3377
- *
3378
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3379
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3380
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3381
- */
3382
- appOptions?: Record<string, any> | null;
3383
- /**
3384
- * Options for the Publish plugin.
3385
- * 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.
3386
- */
3387
- publishPluginOptions?: DataPublishPluginOptions;
3388
- }
3389
- interface RemoveDataItemResponse {
3390
- /** Removed item. */
3391
- dataItem?: DataItem;
3392
- }
3393
- interface TruncateDataItemsRequest {
3394
- /** ID of the collection to truncate. */
3395
- dataCollectionId: string;
3396
- }
3397
- interface TruncateDataItemsResponse {
3398
- }
3399
- interface QueryDataItemsRequest {
3400
- /** ID of the collection to query. */
3401
- dataCollectionId: string;
3402
- /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
3403
- query?: QueryV2;
3404
- /**
3405
- * Whether to return the total count in the response for a query with offset paging.
3406
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
3407
- *
3408
- * Default: `false`
3409
- */
3410
- returnTotalCount?: boolean;
3411
- /**
3412
- * Properties for which to include referenced items in the query's results.
3413
- * Up to 50 referenced items can be included for each item that matches the query.
3414
- * @deprecated
3415
- * @replacedBy referenced_item_options
3416
- * @targetRemovalDate 2025-08-01
3417
- */
3418
- includeReferencedItems?: string[];
3419
- /**
3420
- * Whether to retrieve data from the primary database instance.
3421
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3422
- *
3423
- * Default: `false`
3424
- */
3425
- consistentRead?: boolean;
3426
- /**
3427
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3428
- * If provided, the result text is returned in the specified language.
3429
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
3430
- *
3431
- * If not provided, result text is not translated.
3432
- */
3433
- language?: string | null;
3434
- /**
3435
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3436
- *
3437
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3438
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3439
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3440
- */
3441
- appOptions?: Record<string, any> | null;
3442
- /**
3443
- * Options for the Publish plugin.
3444
- * 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.
3445
- */
3446
- publishPluginOptions?: DataPublishPluginOptions;
3447
- /** Options for retrieving referenced items. */
3448
- referencedItemOptions?: ReferencedItemOptions[];
3449
- }
3450
- interface QueryV2 extends QueryV2PagingMethodOneOf {
3451
- /** Paging options to limit and skip the number of items. */
3452
- paging?: Paging$2;
3453
- /** 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`. */
3454
- cursorPaging?: CursorPaging;
3455
- /**
3456
- * Filter object in the following format:
3457
- *
3458
- * `"filter" : {
3459
- * "fieldName1": "value1",
3460
- * "fieldName2":{"$operator":"value2"}
3461
- * }`
3462
- *
3463
- * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
3464
- *
3465
- * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
3466
- */
3467
- filter?: Record<string, any> | null;
3468
- /**
3469
- * Sort object in the following format:
3470
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
3471
- */
3472
- sort?: Sorting[];
3473
- /**
3474
- * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
3475
- * **Note:** The `_id` system field is always returned.
3476
- */
3477
- fields?: string[];
3478
- }
3479
- /** @oneof */
3480
- interface QueryV2PagingMethodOneOf {
3481
- /** Paging options to limit and skip the number of items. */
3482
- paging?: Paging$2;
3483
- /** 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`. */
3484
- cursorPaging?: CursorPaging;
3485
- }
3486
- interface Sorting {
3487
- /** Name of the field to sort by. */
3488
- fieldName?: string;
3489
- /**
3490
- * Sort order.
3491
- *
3492
- * Supported values: `ASC`, `DESC`.
3493
- */
3494
- order?: SortOrder;
3495
- }
3496
- declare enum SortOrder {
3497
- ASC = "ASC",
3498
- DESC = "DESC"
3499
- }
3500
- interface Paging$2 {
3501
- /** Number of items to load. */
3502
- limit?: number | null;
3503
- /** Number of items to skip in the current sort order. */
3504
- offset?: number | null;
3505
- }
3506
- interface CursorPaging {
3507
- /** Number of items to load. */
3508
- limit?: number | null;
3509
- /**
3510
- * Pointer to the next or previous page in the list of results.
3511
- *
3512
- * You can get the relevant cursor token
3513
- * from the `pagingMetadata` object in the previous call's response.
3514
- * Not relevant for the first request.
3515
- */
3516
- cursor?: string | null;
3517
- }
3518
- interface ReferencedItemOptions {
3519
- /** Field containing references in the queried item. */
3520
- fieldName?: string;
3521
- /** Maximum number of referenced items to include for each queried item. */
3522
- limit?: number | null;
3523
- }
3524
- interface QueryDataItemsResponse {
3525
- /** Retrieved items. */
3526
- dataItems?: DataItem[];
3527
- /** Paging information. */
3528
- pagingMetadata?: PagingMetadataV2;
3529
- }
3530
- interface PagingMetadataV2 {
3531
- /** Number of items returned in the response. */
3532
- count?: number | null;
3533
- /** Offset that was requested. */
3534
- offset?: number | null;
3535
- /** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */
3536
- total?: number | null;
3537
- /** Whether the server failed to calculate the `total` field. */
3538
- tooManyToCount?: boolean | null;
3539
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
3540
- cursors?: Cursors;
3541
- }
3542
- interface Cursors {
3543
- /** Cursor pointing to next page in the list of results. */
3544
- next?: string | null;
3545
- /** Cursor pointing to previous page in the list of results. */
3546
- prev?: string | null;
3547
- }
3548
- interface AggregateDataItemsRequest extends AggregateDataItemsRequestPagingMethodOneOf {
3549
- /** Paging options to limit and skip the number of items. */
3550
- paging?: Paging$2;
3551
- /** 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`. */
3552
- cursorPaging?: CursorPaging;
3553
- /** ID of the collection on which to run the aggregation. */
3554
- dataCollectionId: string;
3555
- /**
3556
- * Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
3557
- *
3558
- * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
3559
- */
3560
- initialFilter?: Record<string, any> | null;
3561
- /** Aggregation applied to the data. */
3562
- aggregation?: Aggregation;
3563
- /**
3564
- * Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
3565
- * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
3566
- */
3567
- finalFilter?: Record<string, any> | null;
3568
- /**
3569
- * Sort object in the following format:
3570
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
3571
- */
3572
- sort?: Sorting[];
3573
- /**
3574
- * Whether to return the total count in the response for a query with offset paging.
3575
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
3576
- *
3577
- * Default: `false`
3578
- */
3579
- returnTotalCount?: boolean;
3580
- /**
3581
- * Whether to retrieve data from the primary database instance.
3582
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3583
- *
3584
- * Default: `false`
3585
- */
3586
- consistentRead?: boolean;
3587
- /**
3588
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3589
- * If provided, the result text is returned in the specified language.
3590
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
3591
- *
3592
- * If not provided, result text is not translated.
3593
- */
3594
- language?: string | null;
3595
- /**
3596
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3597
- *
3598
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3599
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3600
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3601
- */
3602
- appOptions?: Record<string, any> | null;
3603
- /**
3604
- * Options for the Publish plugin.
3605
- * 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.
3606
- */
3607
- publishPluginOptions?: DataPublishPluginOptions;
3608
- }
3609
- /** @oneof */
3610
- interface AggregateDataItemsRequestPagingMethodOneOf {
3611
- /** Paging options to limit and skip the number of items. */
3612
- paging?: Paging$2;
3613
- /** 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`. */
3614
- cursorPaging?: CursorPaging;
3615
- }
3616
- interface Average {
3617
- /** Name of the field for which to calculate the average value. */
3618
- itemFieldName?: string;
3619
- }
3620
- interface Min {
3621
- /** Name of the field for which to calculate the minimum value. */
3622
- itemFieldName?: string;
3623
- }
3624
- interface Max {
3625
- /** Name of the field for which to calculate the maximum value. */
3626
- itemFieldName?: string;
3627
- }
3628
- interface Sum {
3629
- /** Name of the field for which to calculate the sum. */
3630
- itemFieldName?: string;
3631
- }
3632
- interface Count {
3633
- }
3634
- interface Operation extends OperationCalculateOneOf {
3635
- /** Calculate the average value of a specified field for all items in the grouping. */
3636
- average?: Average;
3637
- /** Calculate the minimum value of a specified field for all items in the grouping. */
3638
- min?: Min;
3639
- /** Calculate the maximum value of a specified field for all items in the grouping. */
3640
- max?: Max;
3641
- /** Calculate the sum of values of a specified field for all items in the grouping. */
3642
- sum?: Sum;
3643
- /** Calculate the number of items in the grouping. */
3644
- itemCount?: Count;
3645
- /** Name of the field containing results of the operation. */
3646
- resultFieldName?: string;
3647
- }
3648
- /** @oneof */
3649
- interface OperationCalculateOneOf {
3650
- /** Calculate the average value of a specified field for all items in the grouping. */
3651
- average?: Average;
3652
- /** Calculate the minimum value of a specified field for all items in the grouping. */
3653
- min?: Min;
3654
- /** Calculate the maximum value of a specified field for all items in the grouping. */
3655
- max?: Max;
3656
- /** Calculate the sum of values of a specified field for all items in the grouping. */
3657
- sum?: Sum;
3658
- /** Calculate the number of items in the grouping. */
3659
- itemCount?: Count;
3660
- }
3661
- interface Aggregation {
3662
- /** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */
3663
- groupingFields?: string[];
3664
- /** Operations to carry out on the data in each grouping. */
3665
- operations?: Operation[];
3666
- }
3667
- interface AggregateDataItemsResponse {
3668
- /** Aggregation results. */
3669
- results?: Record<string, any>[] | null;
3670
- /** Paging information. */
3671
- pagingMetadata?: PagingMetadataV2;
3672
- }
3673
- interface CountDataItemsRequest {
3674
- /** ID of the collection for which to count query results. */
3675
- dataCollectionId: string;
3676
- /**
3677
- * Filter object in the following format:
3678
- *
3679
- * `"filter" : {
3680
- * "fieldName1": "value1",
3681
- * "fieldName2":{"$operator":"value2"}
3682
- * }`.
3683
- *
3684
- * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
3685
- *
3686
- * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
3687
- */
3688
- filter?: Record<string, any> | null;
3689
- /**
3690
- * Whether to retrieve data from the primary database instance.
3691
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3692
- *
3693
- * Default: `false`
3694
- */
3695
- consistentRead?: boolean;
3696
- /**
3697
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3698
- * If provided, the result text is returned in the specified language.
3699
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
3700
- *
3701
- * If not provided, result text is not translated.
3702
- */
3703
- language?: string | null;
3704
- /**
3705
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3706
- *
3707
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3708
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3709
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3710
- */
3711
- appOptions?: Record<string, any> | null;
3712
- /**
3713
- * Options for the Publish plugin.
3714
- * 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.
3715
- */
3716
- publishPluginOptions?: DataPublishPluginOptions;
3717
- }
3718
- interface CountDataItemsResponse {
3719
- /** Number of items matching the query. */
3720
- totalCount?: number;
3721
- }
3722
- interface QueryDistinctValuesRequest extends QueryDistinctValuesRequestPagingMethodOneOf {
3723
- /** Paging options to limit and skip the number of items. */
3724
- paging?: Paging$2;
3725
- /** 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`. */
3726
- cursorPaging?: CursorPaging;
3727
- /** ID of the collection to query. */
3728
- dataCollectionId: string;
3729
- /** Item field name for which to return all distinct values. */
3730
- fieldName?: string;
3731
- /**
3732
- * Filter object in the following format:
3733
- *
3734
- * `"filter" : {
3735
- * "fieldName1": "value1",
3736
- * "fieldName2":{"$operator":"value2"}
3737
- * }`.
3738
- *
3739
- * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
3740
- *
3741
- * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
3742
- */
3743
- filter?: Record<string, any> | null;
3744
- /**
3745
- * Sort order.
3746
- *
3747
- * Supported values: `ASC`, `DESC`.
3748
- */
3749
- order?: SortOrder;
3750
- /**
3751
- * Whether to return the total count in the response for a query with offset paging.
3752
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
3753
- *
3754
- * Default: `false`
3755
- */
3756
- returnTotalCount?: boolean;
3757
- /**
3758
- * Whether to retrieve data from the primary database instance.
3759
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3760
- *
3761
- * Default: `false`
3762
- */
3763
- consistentRead?: boolean;
3764
- /**
3765
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3766
- * If provided, the result text is returned in the specified language.
3767
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
3768
- *
3769
- * If not provided, result text is not translated.
3770
- */
3771
- language?: string | null;
3772
- /**
3773
- * Options for the Publish plugin.
3774
- * 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.
3775
- */
3776
- publishPluginOptions?: DataPublishPluginOptions;
3777
- }
3778
- /** @oneof */
3779
- interface QueryDistinctValuesRequestPagingMethodOneOf {
3780
- /** Paging options to limit and skip the number of items. */
3781
- paging?: Paging$2;
3782
- /** 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`. */
3783
- cursorPaging?: CursorPaging;
3784
- }
3785
- interface QueryDistinctValuesResponse {
3786
- /** List of distinct values contained in the field specified in `fieldName`. */
3787
- distinctValues?: any[];
3788
- /** Paging information. */
3789
- pagingMetadata?: PagingMetadataV2;
3790
- }
3791
- interface BulkInsertDataItemsRequest {
3792
- /** ID of the collection in which to insert the items. */
3793
- dataCollectionId: string;
3794
- /** Data items to insert. */
3795
- dataItems: DataItem[];
3796
- /**
3797
- * Whether to return the inserted data items.
3798
- * When `true`, the `results` objects contain a `dataItem` field.
3799
- *
3800
- * Default: `false`
3801
- */
3802
- returnEntity?: boolean;
3803
- /**
3804
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3805
- *
3806
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3807
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3808
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3809
- */
3810
- appOptions?: Record<string, any> | null;
3811
- }
3812
- interface BulkInsertDataItemsResponse {
3813
- /** Information about the inserted items. */
3814
- results?: BulkDataItemResult[];
3815
- /** Bulk action metadata. */
3816
- bulkActionMetadata?: BulkActionMetadata;
3817
- }
3818
- interface BulkUpdateDataItemsRequest {
3819
- /** ID of the collection in which to update items. */
3820
- dataCollectionId: string;
3821
- /** Data items to update. */
3822
- dataItems: DataItem[];
3823
- /**
3824
- * Whether to return the updated data items.
3825
- * When `true`, the `results` objects contain a `dataItem` field.
3826
- *
3827
- * Default: `false`
3828
- */
3829
- returnEntity?: boolean;
3830
- /**
3831
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3832
- *
3833
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3834
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3835
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3836
- */
3837
- appOptions?: Record<string, any> | null;
3838
- /**
3839
- * Options for the Publish plugin.
3840
- * 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.
3841
- */
3842
- publishPluginOptions?: DataPublishPluginOptions;
3843
- }
3844
- interface BulkUpdateDataItemsResponse {
3845
- /** Information about the updated items. */
3846
- results?: BulkDataItemResult[];
3847
- /** Bulk action metadata. */
3848
- bulkActionMetadata?: BulkActionMetadata;
3849
- }
3850
- interface BulkSaveDataItemsRequest {
3851
- /** ID of the collection in which to insert or update the items. */
3852
- dataCollectionId: string;
3853
- /** Data items to insert or update. */
3854
- dataItems: DataItem[];
3855
- /**
3856
- * Whether to return the saved data item.
3857
- * When `true`, the `results` objects contain a `dataItem` field.
3858
- *
3859
- * Default: `false`
3860
- */
3861
- returnEntity?: boolean;
3862
- /**
3863
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3864
- *
3865
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3866
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3867
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3868
- */
3869
- appOptions?: Record<string, any> | null;
3870
- /**
3871
- * Options for the Publish plugin.
3872
- * 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.
3873
- */
3874
- publishPluginOptions?: DataPublishPluginOptions;
3875
- }
3876
- interface BulkSaveDataItemsResponse {
3877
- /** Information about the saved items. */
3878
- results?: BulkDataItemResult[];
3879
- /** Bulk action metadata. */
3880
- bulkActionMetadata?: BulkActionMetadata;
3881
- }
3882
- interface BulkRemoveDataItemsRequest {
3883
- /** ID of the collection from which to remove the item. */
3884
- dataCollectionId: string;
3885
- /** IDs of data items to remove. */
3886
- dataItemIds: string[];
3887
- /**
3888
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
3889
- *
3890
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3891
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3892
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3893
- */
3894
- appOptions?: Record<string, any> | null;
3895
- /**
3896
- * Options for the Publish plugin.
3897
- * 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.
3898
- */
3899
- publishPluginOptions?: DataPublishPluginOptions;
3900
- }
3901
- interface BulkRemoveDataItemsResponse {
3902
- /** Information about the removed data items. */
3903
- results?: BulkDataItemResult[];
3904
- /** Bulk action metadata. */
3905
- bulkActionMetadata?: BulkActionMetadata;
3906
- }
3907
- interface QueryReferencedDataItemsRequest extends QueryReferencedDataItemsRequestPagingMethodOneOf {
3908
- /** Paging options to limit and skip the number of items. */
3909
- paging?: Paging$2;
3910
- /** 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`. */
3911
- cursorPaging?: CursorPaging;
3912
- /** ID of the collection containing the referring item. */
3913
- dataCollectionId: string;
3914
- /** ID of the referring item. */
3915
- referringItemId?: string;
3916
- /** Field containing references in the referring item. */
3917
- referringItemFieldName?: string;
3918
- /** Order of the returned referenced items. Sorted by the date each item was referenced. */
3919
- order?: SortOrder;
3920
- /**
3921
- * Whether to return the total count in the response.
3922
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
3923
- *
3924
- * Default: `false`
3925
- */
3926
- returnTotalCount?: boolean;
3927
- /**
3928
- * Whether to retrieve data from the primary database instance.
3929
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
3930
- *
3931
- * Default: `false`
3932
- */
3933
- consistentRead?: boolean;
3934
- /**
3935
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
3936
- * If provided, the result text is returned in the specified language.
3937
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
3938
- *
3939
- * If not provided, result text is not translated.
3940
- */
3941
- language?: string | null;
3942
- /**
3943
- * Fields to return for each referenced item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
3944
- * **Note:** The `_id` system field is always returned.
3945
- */
3946
- fields?: string[];
3947
- /**
3948
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying:
3949
- *
3950
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
3951
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
3952
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
3953
- */
3954
- appOptions?: Record<string, any> | null;
3955
- /**
3956
- * Options for the Publish plugin.
3957
- * 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.
3958
- */
3959
- publishPluginOptions?: DataPublishPluginOptions;
3960
- }
3961
- /** @oneof */
3962
- interface QueryReferencedDataItemsRequestPagingMethodOneOf {
3963
- /** Paging options to limit and skip the number of items. */
3964
- paging?: Paging$2;
3965
- /** 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`. */
3966
- cursorPaging?: CursorPaging;
3967
- }
3968
- interface QueryReferencedDataItemsResponse {
3969
- /** Referenced items and/or IDs. For successfully resolved references, the referenced data item is returned. For references that can't be resolved, the ID is returned. */
3970
- results?: ReferencedResult[];
3971
- /** Paging information. */
3972
- pagingMetadata?: PagingMetadataV2;
3973
- }
3974
- interface UnresolvedReference {
3975
- /**
3976
- * ID of the referring item.
3977
- * @deprecated
3978
- * @targetRemovalDate 2025-03-01
3979
- */
3980
- referringItemId?: string;
3981
- /**
3982
- * Field specified to query for references.
3983
- * @deprecated
3984
- * @targetRemovalDate 2025-03-01
3985
- */
3986
- referringItemFieldName?: string;
3987
- /** ID of unresolved referenced item */
3988
- referencedItemId?: string;
3989
- /** Flag is set if item exists, but user is not authorized to read it */
3990
- unauthorized?: boolean;
3991
- }
3992
- interface ReferencedResult extends ReferencedResultEntityOneOf {
3993
- /** Data item referenced. */
3994
- dataItem?: DataItem;
3995
- /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */
3996
- unresolvedReference?: UnresolvedReference;
3997
- /** ID of the referring item. */
3998
- referringItemId?: string;
3999
- }
4000
- /** @oneof */
4001
- interface ReferencedResultEntityOneOf {
4002
- /** Data item referenced. */
4003
- dataItem?: DataItem;
4004
- /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */
4005
- unresolvedReference?: UnresolvedReference;
4006
- }
4007
- interface IsReferencedDataItemRequest {
4008
- /** ID of the collection containing the referring data item. */
4009
- dataCollectionId: string;
4010
- /** Field to check for a reference to the item that may be referenced. */
4011
- referringItemFieldName: string;
4012
- /** ID of the referring item. */
4013
- referringItemId: string;
4014
- /** ID of the item that may be referenced. */
4015
- referencedItemId: string;
4016
- /**
4017
- * Whether to retrieve data from the primary database instance.
4018
- * This decreases performance but ensures data retrieved is up to date even immediately after an update.
4019
- *
4020
- * Default: `false`
4021
- */
4022
- consistentRead?: boolean;
4023
- }
4024
- interface IsReferencedDataItemResponse {
4025
- /** Whether the specified reference exists. */
4026
- isReferenced?: boolean;
4027
- }
4028
- interface InsertDataItemReferenceRequest {
4029
- /** ID of the collection in which to insert the reference. */
4030
- dataCollectionId: string;
4031
- /** Reference to insert */
4032
- dataItemReference?: DataItemReference;
4033
- /**
4034
- * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
4035
- *
4036
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
4037
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
4038
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
4039
- */
4040
- appOptions?: Record<string, any> | null;
4041
- }
4042
- interface DataItemReference {
4043
- /** Referring item field containing the references to the referenced items. */
4044
- referringItemFieldName?: string;
4045
- /** ID of the referring item. */
4046
- referringItemId?: string;
4047
- /** ID of the referenced item. */
4048
- referencedItemId?: string;
4049
- }
4050
- interface InsertDataItemReferenceResponse {
4051
- /** Inserted reference. */
4052
- dataItemReference?: DataItemReference;
4053
- }
4054
- interface RemoveDataItemReferenceRequest {
4055
- /** ID of the collection containing the referring item. */
4056
- dataCollectionId: string;
4057
- /** Reference to remove. */
4058
- dataItemReference: DataItemReference;
4059
- }
4060
- interface RemoveDataItemReferenceResponse {
4061
- /** Removed reference. */
4062
- dataItemReference?: DataItemReference;
4063
- }
4064
- interface BulkInsertDataItemReferencesRequest {
4065
- /** ID of the collection containing the referring items. */
4066
- dataCollectionId: string;
4067
- /** References to insert. */
4068
- dataItemReferences: DataItemReference[];
4069
- /**
4070
- * Whether to return the inserted data item references.
4071
- * When `true`, the `results` objects contain a `dataItemReference` field.
4072
- *
4073
- * Default: `false`
4074
- */
4075
- returnEntity?: boolean;
4076
- }
4077
- interface BulkInsertDataItemReferencesResponse {
4078
- /** Information about the inserted references. */
4079
- results?: BulkDataItemReferenceResult[];
4080
- /** Bulk action metadata. */
4081
- bulkActionMetadata?: BulkActionMetadata;
4082
- }
4083
- interface BulkDataItemReferenceResult {
4084
- /**
4085
- * The action attempted for the reference.
4086
- *
4087
- * Supported values: `UNKNOWN_ACTION_TYPE`, `INSERT`, `UPDATE`, `DELETE`.
4088
- */
4089
- action?: BulkActionType;
4090
- /** Metadata related to the reference for which the action was attempted. */
4091
- referenceMetadata?: ItemMetadata;
4092
- /** The reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
4093
- dataItemReference?: DataItemReference;
4094
- }
4095
- interface BulkRemoveDataItemReferencesRequest {
4096
- /** ID of the collection containing the referring items. */
4097
- dataCollectionId: string;
4098
- /** References to remove. */
4099
- dataItemReferences: DataItemReference[];
4100
- }
4101
- interface BulkRemoveDataItemReferencesResponse {
4102
- /** Information about the removed references. */
4103
- results?: BulkDataItemReferenceResult[];
4104
- /** Bulk action metadata. */
4105
- bulkActionMetadata?: BulkActionMetadata;
4106
- }
4107
- interface ReplaceDataItemReferencesRequest {
4108
- /** ID of the collection containing the referring item. */
4109
- dataCollectionId: string;
4110
- /** Field containing references in the referring item. */
4111
- referringItemFieldName: string;
4112
- /** ID of the referring item. */
4113
- referringItemId: string;
4114
- /** List of new referenced item IDs to replace the existing ones. */
4115
- newReferencedItemIds?: string[];
4116
- }
4117
- interface ReplaceDataItemReferencesResponse {
4118
- /** Updated references. */
4119
- dataItemReferences?: DataItemReference[];
4120
- }
4121
- interface DataItemNonNullableFields {
4122
- _id: string;
4123
- dataCollectionId: string;
4124
- }
4125
- interface InsertDataItemResponseNonNullableFields {
4126
- dataItem?: DataItemNonNullableFields;
4127
- }
4128
- interface UpdateDataItemResponseNonNullableFields {
4129
- dataItem?: DataItemNonNullableFields;
4130
- }
4131
- interface SaveDataItemResponseNonNullableFields {
4132
- action: Action;
4133
- dataItem?: DataItemNonNullableFields;
4134
- }
4135
- interface GetDataItemResponseNonNullableFields {
4136
- dataItem?: DataItemNonNullableFields;
4137
- }
4138
- interface RemoveDataItemResponseNonNullableFields {
4139
- dataItem?: DataItemNonNullableFields;
4140
- }
4141
- interface CachingInfoNonNullableFields {
4142
- tags: string[];
4143
- }
4144
- interface QueryDataItemsResponseNonNullableFields {
4145
- dataItems: DataItemNonNullableFields[];
4146
- cachingInfo?: CachingInfoNonNullableFields;
4147
- }
4148
- interface CountDataItemsResponseNonNullableFields {
4149
- totalCount: number;
4150
- }
4151
- interface ApplicationErrorNonNullableFields {
4152
- code: string;
4153
- description: string;
4154
- }
4155
- interface ItemMetadataNonNullableFields {
4156
- originalIndex: number;
4157
- success: boolean;
4158
- error?: ApplicationErrorNonNullableFields;
4159
- }
4160
- interface BulkDataItemResultNonNullableFields {
4161
- action: BulkActionType;
4162
- itemMetadata?: ItemMetadataNonNullableFields;
4163
- dataItem?: DataItemNonNullableFields;
4164
- }
4165
- interface BulkActionMetadataNonNullableFields {
4166
- totalSuccesses: number;
4167
- totalFailures: number;
4168
- }
4169
- interface BulkInsertDataItemsResponseNonNullableFields {
4170
- results: BulkDataItemResultNonNullableFields[];
4171
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
4172
- }
4173
- interface BulkUpdateDataItemsResponseNonNullableFields {
4174
- results: BulkDataItemResultNonNullableFields[];
4175
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
4176
- }
4177
- interface BulkSaveDataItemsResponseNonNullableFields {
4178
- results: BulkDataItemResultNonNullableFields[];
4179
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
4180
- }
4181
- interface BulkRemoveDataItemsResponseNonNullableFields {
4182
- results: BulkDataItemResultNonNullableFields[];
4183
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
4184
- }
4185
- interface UnresolvedReferenceNonNullableFields {
4186
- referringItemId: string;
4187
- referringItemFieldName: string;
4188
- referencedItemId: string;
4189
- unauthorized: boolean;
4190
- }
4191
- interface ReferencedResultNonNullableFields {
4192
- dataItem?: DataItemNonNullableFields;
4193
- unresolvedReference?: UnresolvedReferenceNonNullableFields;
4194
- referringItemId: string;
4195
- }
4196
- interface QueryReferencedDataItemsResponseNonNullableFields {
4197
- results: ReferencedResultNonNullableFields[];
4198
- }
4199
- interface IsReferencedDataItemResponseNonNullableFields {
4200
- isReferenced: boolean;
4201
- }
4202
- interface DataItemReferenceNonNullableFields {
4203
- referringItemFieldName: string;
4204
- referringItemId: string;
4205
- referencedItemId: string;
4206
- }
4207
- interface InsertDataItemReferenceResponseNonNullableFields {
4208
- dataItemReference?: DataItemReferenceNonNullableFields;
4209
- }
4210
- interface RemoveDataItemReferenceResponseNonNullableFields {
4211
- dataItemReference?: DataItemReferenceNonNullableFields;
4212
- }
4213
- interface BulkDataItemReferenceResultNonNullableFields {
4214
- action: BulkActionType;
4215
- referenceMetadata?: ItemMetadataNonNullableFields;
4216
- dataItemReference?: DataItemReferenceNonNullableFields;
4217
- }
4218
- interface BulkInsertDataItemReferencesResponseNonNullableFields {
4219
- results: BulkDataItemReferenceResultNonNullableFields[];
4220
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
4221
- }
4222
- interface BulkRemoveDataItemReferencesResponseNonNullableFields {
4223
- results: BulkDataItemReferenceResultNonNullableFields[];
4224
- bulkActionMetadata?: BulkActionMetadataNonNullableFields;
4225
- }
4226
- interface ReplaceDataItemReferencesResponseNonNullableFields {
4227
- dataItemReferences: DataItemReferenceNonNullableFields[];
4228
- }
4229
-
4230
- type __PublicMethodMetaInfo$1<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4231
- getUrl: (context: any) => string;
4232
- httpMethod: K;
4233
- path: string;
4234
- pathParams: M;
4235
- __requestType: T;
4236
- __originalRequestType: S;
4237
- __responseType: Q;
4238
- __originalResponseType: R;
4239
- };
4240
- declare function insertDataItem(): __PublicMethodMetaInfo$1<'POST', {}, InsertDataItemRequest, InsertDataItemRequest$1, InsertDataItemResponse & InsertDataItemResponseNonNullableFields, InsertDataItemResponse$1 & InsertDataItemResponseNonNullableFields$1>;
4241
- declare function updateDataItem(): __PublicMethodMetaInfo$1<'PUT', {
4242
- dataItemId: string;
4243
- }, UpdateDataItemRequest, UpdateDataItemRequest$1, UpdateDataItemResponse & UpdateDataItemResponseNonNullableFields, UpdateDataItemResponse$1 & UpdateDataItemResponseNonNullableFields$1>;
4244
- declare function saveDataItem(): __PublicMethodMetaInfo$1<'POST', {}, SaveDataItemRequest, SaveDataItemRequest$1, SaveDataItemResponse & SaveDataItemResponseNonNullableFields, SaveDataItemResponse$1 & SaveDataItemResponseNonNullableFields$1>;
4245
- declare function getDataItem(): __PublicMethodMetaInfo$1<'GET', {
4246
- dataItemId: string;
4247
- }, GetDataItemRequest, GetDataItemRequest$1, GetDataItemResponse & GetDataItemResponseNonNullableFields, GetDataItemResponse$1 & GetDataItemResponseNonNullableFields$1>;
4248
- declare function removeDataItem(): __PublicMethodMetaInfo$1<'DELETE', {
4249
- dataItemId: string;
4250
- }, RemoveDataItemRequest, RemoveDataItemRequest$1, RemoveDataItemResponse & RemoveDataItemResponseNonNullableFields, RemoveDataItemResponse$1 & RemoveDataItemResponseNonNullableFields$1>;
4251
- declare function truncateDataItems(): __PublicMethodMetaInfo$1<'POST', {}, TruncateDataItemsRequest, TruncateDataItemsRequest$1, TruncateDataItemsResponse, TruncateDataItemsResponse$1>;
4252
- declare function queryDataItems(): __PublicMethodMetaInfo$1<'GET', {}, QueryDataItemsRequest, QueryDataItemsRequest$1, QueryDataItemsResponse & QueryDataItemsResponseNonNullableFields, QueryDataItemsResponse$1 & QueryDataItemsResponseNonNullableFields$1>;
4253
- declare function aggregateDataItems(): __PublicMethodMetaInfo$1<'GET', {}, AggregateDataItemsRequest, AggregateDataItemsRequest$1, AggregateDataItemsResponse, AggregateDataItemsResponse$1>;
4254
- declare function countDataItems(): __PublicMethodMetaInfo$1<'GET', {}, CountDataItemsRequest, CountDataItemsRequest$1, CountDataItemsResponse & CountDataItemsResponseNonNullableFields, CountDataItemsResponse$1 & CountDataItemsResponseNonNullableFields$1>;
4255
- declare function queryDistinctValues(): __PublicMethodMetaInfo$1<'GET', {}, QueryDistinctValuesRequest, QueryDistinctValuesRequest$1, QueryDistinctValuesResponse, QueryDistinctValuesResponse$1>;
4256
- declare function bulkInsertDataItems(): __PublicMethodMetaInfo$1<'POST', {}, BulkInsertDataItemsRequest, BulkInsertDataItemsRequest$1, BulkInsertDataItemsResponse & BulkInsertDataItemsResponseNonNullableFields, BulkInsertDataItemsResponse$1 & BulkInsertDataItemsResponseNonNullableFields$1>;
4257
- declare function bulkUpdateDataItems(): __PublicMethodMetaInfo$1<'POST', {}, BulkUpdateDataItemsRequest, BulkUpdateDataItemsRequest$1, BulkUpdateDataItemsResponse & BulkUpdateDataItemsResponseNonNullableFields, BulkUpdateDataItemsResponse$1 & BulkUpdateDataItemsResponseNonNullableFields$1>;
4258
- declare function bulkSaveDataItems(): __PublicMethodMetaInfo$1<'POST', {}, BulkSaveDataItemsRequest, BulkSaveDataItemsRequest$1, BulkSaveDataItemsResponse & BulkSaveDataItemsResponseNonNullableFields, BulkSaveDataItemsResponse$1 & BulkSaveDataItemsResponseNonNullableFields$1>;
4259
- declare function bulkRemoveDataItems(): __PublicMethodMetaInfo$1<'POST', {}, BulkRemoveDataItemsRequest, BulkRemoveDataItemsRequest$1, BulkRemoveDataItemsResponse & BulkRemoveDataItemsResponseNonNullableFields, BulkRemoveDataItemsResponse$1 & BulkRemoveDataItemsResponseNonNullableFields$1>;
4260
- declare function queryReferencedDataItems(): __PublicMethodMetaInfo$1<'GET', {}, QueryReferencedDataItemsRequest, QueryReferencedDataItemsRequest$1, QueryReferencedDataItemsResponse & QueryReferencedDataItemsResponseNonNullableFields, QueryReferencedDataItemsResponse$1 & QueryReferencedDataItemsResponseNonNullableFields$1>;
4261
- declare function isReferencedDataItem(): __PublicMethodMetaInfo$1<'GET', {}, IsReferencedDataItemRequest, IsReferencedDataItemRequest$1, IsReferencedDataItemResponse & IsReferencedDataItemResponseNonNullableFields, IsReferencedDataItemResponse$1 & IsReferencedDataItemResponseNonNullableFields$1>;
4262
- declare function insertDataItemReference(): __PublicMethodMetaInfo$1<'POST', {}, InsertDataItemReferenceRequest, InsertDataItemReferenceRequest$1, InsertDataItemReferenceResponse & InsertDataItemReferenceResponseNonNullableFields, InsertDataItemReferenceResponse$1 & InsertDataItemReferenceResponseNonNullableFields$1>;
4263
- declare function removeDataItemReference(): __PublicMethodMetaInfo$1<'POST', {}, RemoveDataItemReferenceRequest, RemoveDataItemReferenceRequest$1, RemoveDataItemReferenceResponse & RemoveDataItemReferenceResponseNonNullableFields, RemoveDataItemReferenceResponse$1 & RemoveDataItemReferenceResponseNonNullableFields$1>;
4264
- declare function bulkInsertDataItemReferences(): __PublicMethodMetaInfo$1<'POST', {}, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesRequest$1, BulkInsertDataItemReferencesResponse & BulkInsertDataItemReferencesResponseNonNullableFields, BulkInsertDataItemReferencesResponse$1 & BulkInsertDataItemReferencesResponseNonNullableFields$1>;
4265
- declare function bulkRemoveDataItemReferences(): __PublicMethodMetaInfo$1<'POST', {}, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesRequest$1, BulkRemoveDataItemReferencesResponse & BulkRemoveDataItemReferencesResponseNonNullableFields, BulkRemoveDataItemReferencesResponse$1 & BulkRemoveDataItemReferencesResponseNonNullableFields$1>;
4266
- declare function replaceDataItemReferences(): __PublicMethodMetaInfo$1<'POST', {}, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesRequest$1, ReplaceDataItemReferencesResponse & ReplaceDataItemReferencesResponseNonNullableFields, ReplaceDataItemReferencesResponse$1 & ReplaceDataItemReferencesResponseNonNullableFields$1>;
4267
-
4268
- declare const meta$1_aggregateDataItems: typeof aggregateDataItems;
4269
- declare const meta$1_bulkInsertDataItemReferences: typeof bulkInsertDataItemReferences;
4270
- declare const meta$1_bulkInsertDataItems: typeof bulkInsertDataItems;
4271
- declare const meta$1_bulkRemoveDataItemReferences: typeof bulkRemoveDataItemReferences;
4272
- declare const meta$1_bulkRemoveDataItems: typeof bulkRemoveDataItems;
4273
- declare const meta$1_bulkSaveDataItems: typeof bulkSaveDataItems;
4274
- declare const meta$1_bulkUpdateDataItems: typeof bulkUpdateDataItems;
4275
- declare const meta$1_countDataItems: typeof countDataItems;
4276
- declare const meta$1_getDataItem: typeof getDataItem;
4277
- declare const meta$1_insertDataItem: typeof insertDataItem;
4278
- declare const meta$1_insertDataItemReference: typeof insertDataItemReference;
4279
- declare const meta$1_isReferencedDataItem: typeof isReferencedDataItem;
4280
- declare const meta$1_queryDataItems: typeof queryDataItems;
4281
- declare const meta$1_queryDistinctValues: typeof queryDistinctValues;
4282
- declare const meta$1_queryReferencedDataItems: typeof queryReferencedDataItems;
4283
- declare const meta$1_removeDataItem: typeof removeDataItem;
4284
- declare const meta$1_removeDataItemReference: typeof removeDataItemReference;
4285
- declare const meta$1_replaceDataItemReferences: typeof replaceDataItemReferences;
4286
- declare const meta$1_saveDataItem: typeof saveDataItem;
4287
- declare const meta$1_truncateDataItems: typeof truncateDataItems;
4288
- declare const meta$1_updateDataItem: typeof updateDataItem;
4289
- declare namespace meta$1 {
4290
- export { type __PublicMethodMetaInfo$1 as __PublicMethodMetaInfo, meta$1_aggregateDataItems as aggregateDataItems, meta$1_bulkInsertDataItemReferences as bulkInsertDataItemReferences, meta$1_bulkInsertDataItems as bulkInsertDataItems, meta$1_bulkRemoveDataItemReferences as bulkRemoveDataItemReferences, meta$1_bulkRemoveDataItems as bulkRemoveDataItems, meta$1_bulkSaveDataItems as bulkSaveDataItems, meta$1_bulkUpdateDataItems as bulkUpdateDataItems, meta$1_countDataItems as countDataItems, meta$1_getDataItem as getDataItem, meta$1_insertDataItem as insertDataItem, meta$1_insertDataItemReference as insertDataItemReference, meta$1_isReferencedDataItem as isReferencedDataItem, meta$1_queryDataItems as queryDataItems, meta$1_queryDistinctValues as queryDistinctValues, meta$1_queryReferencedDataItems as queryReferencedDataItems, meta$1_removeDataItem as removeDataItem, meta$1_removeDataItemReference as removeDataItemReference, meta$1_replaceDataItemReferences as replaceDataItemReferences, meta$1_saveDataItem as saveDataItem, meta$1_truncateDataItems as truncateDataItems, meta$1_updateDataItem as updateDataItem };
4291
- }
4292
-
4293
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
4294
- interface Index$1 {
4295
- /** Name of the index. */
4296
- name?: string;
4297
- /**
4298
- * Fields for which the index is defined.
4299
- *
4300
- * Max: 3 fields (for a unique index: 1 field)
4301
- */
4302
- fields?: Field$1[];
4303
- /**
4304
- * Current status of the index.
4305
- * @readonly
4306
- */
4307
- status?: Status$1;
4308
- /**
4309
- * Contains details about the reasons for failure when `status` is `FAILED`.
4310
- * @readonly
4311
- */
4312
- failure?: Failure$1;
4313
- /**
4314
- * Whether the index enforces uniqueness of values in the field for which it is defined.
4315
- * If `true`, the index can have only one field.
4316
- *
4317
- * Default: `false`
4318
- */
4319
- unique?: boolean;
4320
- /**
4321
- * Whether the index ignores case.
4322
- *
4323
- * Default: `false`
4324
- */
4325
- caseInsensitive?: boolean;
4326
- }
4327
- /**
4328
- * Order determines how values are ordered in the index. This is important when
4329
- * ordering and/or range querying by indexed fields.
4330
- */
4331
- declare enum Order$1 {
4332
- ASC = "ASC",
4333
- DESC = "DESC"
4334
- }
4335
- interface Field$1 {
4336
- /** Path of the field to index. For example: `title` or `options.price`. */
4337
- path?: string;
4338
- /**
4339
- * Sort order for the index. Base on how the data is regularly queried.
4340
- *
4341
- * Default: `ASC`
4342
- */
4343
- order?: Order$1;
4344
- }
4345
- declare enum Status$1 {
4346
- /** Place holder. Never returned by the service. */
4347
- UNKNOWN = "UNKNOWN",
4348
- /** Index creation is in progress. */
4349
- BUILDING = "BUILDING",
4350
- /** Index has been successfully created and can be used in queries. */
4351
- ACTIVE = "ACTIVE",
4352
- /** Index is in the process of being dropped. */
4353
- DROPPING = "DROPPING",
4354
- /** Index has been dropped successfully. */
4355
- DROPPED = "DROPPED",
4356
- /** Index creation has failed. */
4357
- FAILED = "FAILED",
4358
- /** Index contains incorrectly indexed data. */
4359
- INVALID = "INVALID"
4360
- }
4361
- interface Failure$1 {
4362
- /**
4363
- * Error code.
4364
- * - `WDE0112`: Unknown error while building collection index.
4365
- * - `WDE0113`: Duplicate key error while building collection index.
4366
- * - `WDE0114`: Document too large while building collection index.
4367
- */
4368
- code?: string;
4369
- /** Description of the failure. */
4370
- description?: string;
4371
- /**
4372
- * ID of the data item that caused the failure.
4373
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
4374
- */
4375
- itemId?: string | null;
4376
- }
4377
- interface CreateIndexRequest$1 {
4378
- /** Details of the index to be created. */
4379
- index: Index$1;
4380
- /** ID of the data collection for which to generate the index. */
4381
- dataCollectionId: string;
4382
- }
4383
- interface CreateIndexResponse$1 {
4384
- /** Details of the index being generated. */
4385
- index?: Index$1;
4386
- }
4387
- interface DropIndexRequest$1 {
4388
- /** Name of the index to drop. */
4389
- indexName: string;
4390
- /** ID of the data collection for which the index to be dropped is defined. */
4391
- dataCollectionId: string;
4392
- }
4393
- interface DropIndexResponse$1 {
4394
- }
4395
- interface ListIndexesRequest$1 {
4396
- /** ID of the data collection for which to list indexes. */
4397
- dataCollectionId: string;
4398
- /** Paging options to limit and skip the number of items. */
4399
- paging?: Paging$1;
4400
- }
4401
- interface Paging$1 {
4402
- /** Number of items to load. */
4403
- limit?: number | null;
4404
- /** Number of items to skip in the current sort order. */
4405
- offset?: number | null;
4406
- }
4407
- interface ListIndexesResponse$1 {
4408
- /** List of all indexes for the requested data collection. */
4409
- indexes?: Index$1[];
4410
- /** Paging metadata. */
4411
- pagingMetadata?: PagingMetadata$1;
4412
- }
4413
- interface PagingMetadata$1 {
4414
- /** Number of items returned in the response. */
4415
- count?: number | null;
4416
- /** Offset that was requested. */
4417
- offset?: number | null;
4418
- /** Total number of items that match the query. */
4419
- total?: number | null;
4420
- /** Flag that indicates the server failed to calculate the `total` field. */
4421
- tooManyToCount?: boolean | null;
4422
- }
4423
- interface FieldNonNullableFields$1 {
4424
- path: string;
4425
- order: Order$1;
4426
- }
4427
- interface FailureNonNullableFields$1 {
4428
- code: string;
4429
- broadCode: string;
4430
- description: string;
4431
- }
4432
- interface IndexNonNullableFields$1 {
4433
- name: string;
4434
- fields: FieldNonNullableFields$1[];
4435
- status: Status$1;
4436
- failure?: FailureNonNullableFields$1;
4437
- unique: boolean;
4438
- caseInsensitive: boolean;
4439
- }
4440
- interface CreateIndexResponseNonNullableFields$1 {
4441
- index?: IndexNonNullableFields$1;
4442
- }
4443
- interface ListIndexesResponseNonNullableFields$1 {
4444
- indexes: IndexNonNullableFields$1[];
4445
- }
4446
-
4447
- /** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
4448
- interface Index {
4449
- /** Name of the index. */
4450
- name?: string;
4451
- /**
4452
- * Fields for which the index is defined.
4453
- *
4454
- * Max: 3 fields (for a unique index: 1 field)
4455
- */
4456
- fields?: Field[];
4457
- /**
4458
- * Current status of the index.
4459
- * @readonly
4460
- */
4461
- status?: Status;
4462
- /**
4463
- * Contains details about the reasons for failure when `status` is `FAILED`.
4464
- * @readonly
4465
- */
4466
- failure?: Failure;
4467
- /**
4468
- * Whether the index enforces uniqueness of values in the field for which it is defined.
4469
- * If `true`, the index can have only one field.
4470
- *
4471
- * Default: `false`
4472
- */
4473
- unique?: boolean;
4474
- /**
4475
- * Whether the index ignores case.
4476
- *
4477
- * Default: `false`
4478
- */
4479
- caseInsensitive?: boolean;
4480
- }
4481
- /**
4482
- * Order determines how values are ordered in the index. This is important when
4483
- * ordering and/or range querying by indexed fields.
4484
- */
4485
- declare enum Order {
4486
- ASC = "ASC",
4487
- DESC = "DESC"
4488
- }
4489
- interface Field {
4490
- /** Path of the field to index. For example: `title` or `options.price`. */
4491
- path?: string;
4492
- /**
4493
- * Sort order for the index. Base on how the data is regularly queried.
4494
- *
4495
- * Default: `ASC`
4496
- */
4497
- order?: Order;
4498
- }
4499
- declare enum Status {
4500
- /** Place holder. Never returned by the service. */
4501
- UNKNOWN = "UNKNOWN",
4502
- /** Index creation is in progress. */
4503
- BUILDING = "BUILDING",
4504
- /** Index has been successfully created and can be used in queries. */
4505
- ACTIVE = "ACTIVE",
4506
- /** Index is in the process of being dropped. */
4507
- DROPPING = "DROPPING",
4508
- /** Index has been dropped successfully. */
4509
- DROPPED = "DROPPED",
4510
- /** Index creation has failed. */
4511
- FAILED = "FAILED",
4512
- /** Index contains incorrectly indexed data. */
4513
- INVALID = "INVALID"
4514
- }
4515
- interface Failure {
4516
- /**
4517
- * Error code.
4518
- * - `WDE0112`: Unknown error while building collection index.
4519
- * - `WDE0113`: Duplicate key error while building collection index.
4520
- * - `WDE0114`: Document too large while building collection index.
4521
- */
4522
- code?: string;
4523
- /** Description of the failure. */
4524
- description?: string;
4525
- /**
4526
- * ID of the data item that caused the failure.
4527
- * For example, if `unique` is `true`, the ID of an item containing a duplicate value.
4528
- */
4529
- itemId?: string | null;
4530
- }
4531
- interface CreateIndexRequest {
4532
- /** Details of the index to be created. */
4533
- index: Index;
4534
- /** ID of the data collection for which to generate the index. */
4535
- dataCollectionId: string;
4536
- }
4537
- interface CreateIndexResponse {
4538
- /** Details of the index being generated. */
4539
- index?: Index;
4540
- }
4541
- interface DropIndexRequest {
4542
- /** Name of the index to drop. */
4543
- indexName: string;
4544
- /** ID of the data collection for which the index to be dropped is defined. */
4545
- dataCollectionId: string;
4546
- }
4547
- interface DropIndexResponse {
4548
- }
4549
- interface ListIndexesRequest {
4550
- /** ID of the data collection for which to list indexes. */
4551
- dataCollectionId: string;
4552
- /** Paging options to limit and skip the number of items. */
4553
- paging?: Paging;
4554
- }
4555
- interface Paging {
4556
- /** Number of items to load. */
4557
- limit?: number | null;
4558
- /** Number of items to skip in the current sort order. */
4559
- offset?: number | null;
4560
- }
4561
- interface ListIndexesResponse {
4562
- /** List of all indexes for the requested data collection. */
4563
- indexes?: Index[];
4564
- /** Paging metadata. */
4565
- pagingMetadata?: PagingMetadata;
4566
- }
4567
- interface PagingMetadata {
4568
- /** Number of items returned in the response. */
4569
- count?: number | null;
4570
- /** Offset that was requested. */
4571
- offset?: number | null;
4572
- /** Total number of items that match the query. */
4573
- total?: number | null;
4574
- /** Flag that indicates the server failed to calculate the `total` field. */
4575
- tooManyToCount?: boolean | null;
4576
- }
4577
- interface FieldNonNullableFields {
4578
- path: string;
4579
- order: Order;
4580
- }
4581
- interface FailureNonNullableFields {
4582
- code: string;
4583
- broadCode: string;
4584
- description: string;
4585
- }
4586
- interface IndexNonNullableFields {
4587
- name: string;
4588
- fields: FieldNonNullableFields[];
4589
- status: Status;
4590
- failure?: FailureNonNullableFields;
4591
- unique: boolean;
4592
- caseInsensitive: boolean;
4593
- }
4594
- interface CreateIndexResponseNonNullableFields {
4595
- index?: IndexNonNullableFields;
4596
- }
4597
- interface ListIndexesResponseNonNullableFields {
4598
- indexes: IndexNonNullableFields[];
3293
+ interface ReplaceDataItemReferencesResponse {
3294
+ /** Updated references. */
3295
+ dataItemReferences?: DataItemReference[];
4599
3296
  }
4600
3297
 
4601
3298
  type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
@@ -4608,16 +3305,42 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
4608
3305
  __responseType: Q;
4609
3306
  __originalResponseType: R;
4610
3307
  };
4611
- declare function createIndex(): __PublicMethodMetaInfo<'POST', {}, CreateIndexRequest, CreateIndexRequest$1, CreateIndexResponse & CreateIndexResponseNonNullableFields, CreateIndexResponse$1 & CreateIndexResponseNonNullableFields$1>;
4612
- declare function dropIndex(): __PublicMethodMetaInfo<'DELETE', {}, DropIndexRequest, DropIndexRequest$1, DropIndexResponse, DropIndexResponse$1>;
4613
- declare function listIndexes(): __PublicMethodMetaInfo<'GET', {}, ListIndexesRequest, ListIndexesRequest$1, ListIndexesResponse & ListIndexesResponseNonNullableFields, ListIndexesResponse$1 & ListIndexesResponseNonNullableFields$1>;
3308
+ declare function insert(): __PublicMethodMetaInfo<'POST', {}, InsertDataItemRequest, InsertDataItemRequest, InsertDataItemResponse, InsertDataItemResponse>;
3309
+ declare function update(): __PublicMethodMetaInfo<'POST', {}, UpdateDataItemRequest, UpdateDataItemRequest, UpdateDataItemResponse, UpdateDataItemResponse>;
3310
+ declare function save(): __PublicMethodMetaInfo<'POST', {}, SaveDataItemRequest, SaveDataItemRequest, SaveDataItemResponse, SaveDataItemResponse>;
3311
+ declare function get(): __PublicMethodMetaInfo<'GET', {}, GetDataItemRequest, GetDataItemRequest, GetDataItemResponse, GetDataItemResponse>;
3312
+ declare function remove(): __PublicMethodMetaInfo<'POST', {}, RemoveDataItemRequest, RemoveDataItemRequest, RemoveDataItemResponse, RemoveDataItemResponse>;
3313
+ declare function truncate(): __PublicMethodMetaInfo<'POST', {}, TruncateDataItemsRequest, TruncateDataItemsRequest, TruncateDataItemsResponse, TruncateDataItemsResponse>;
3314
+ declare function bulkInsert(): __PublicMethodMetaInfo<'POST', {}, BulkInsertDataItemsRequest, BulkInsertDataItemsRequest, BulkInsertDataItemsResponse, BulkInsertDataItemsResponse>;
3315
+ declare function patch(): __PublicMethodMetaInfo<'POST', {}, PatchDataItemRequest, PatchDataItemRequest, PatchDataItemResponse, PatchDataItemResponse>;
3316
+ declare function bulkPatch(): __PublicMethodMetaInfo<'POST', {}, BulkPatchDataItemsRequest, BulkPatchDataItemsRequest, BulkPatchDataItemsResponse, BulkPatchDataItemsResponse>;
3317
+ declare function bulkUpdate(): __PublicMethodMetaInfo<'POST', {}, BulkUpdateDataItemsRequest, BulkUpdateDataItemsRequest, BulkUpdateDataItemsResponse, BulkUpdateDataItemsResponse>;
3318
+ declare function bulkSave(): __PublicMethodMetaInfo<'POST', {}, BulkSaveDataItemsRequest, BulkSaveDataItemsRequest, BulkSaveDataItemsResponse, BulkSaveDataItemsResponse>;
3319
+ declare function bulkRemove(): __PublicMethodMetaInfo<'POST', {}, BulkRemoveDataItemsRequest, BulkRemoveDataItemsRequest, BulkRemoveDataItemsResponse, BulkRemoveDataItemsResponse>;
3320
+ declare function isReferenced(): __PublicMethodMetaInfo<'POST', {}, IsReferencedDataItemRequest, IsReferencedDataItemRequest, IsReferencedDataItemResponse, IsReferencedDataItemResponse>;
3321
+ declare function insertReference(): __PublicMethodMetaInfo<'POST', {}, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesResponse, BulkInsertDataItemReferencesResponse>;
3322
+ declare function removeReference(): __PublicMethodMetaInfo<'POST', {}, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesResponse, BulkRemoveDataItemReferencesResponse>;
3323
+ declare function replaceReferences(): __PublicMethodMetaInfo<'POST', {}, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesResponse, ReplaceDataItemReferencesResponse>;
4614
3324
 
4615
- type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
4616
- declare const meta_createIndex: typeof createIndex;
4617
- declare const meta_dropIndex: typeof dropIndex;
4618
- declare const meta_listIndexes: typeof listIndexes;
4619
- declare namespace meta {
4620
- export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_createIndex as createIndex, meta_dropIndex as dropIndex, meta_listIndexes as listIndexes };
3325
+ type meta_d___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
3326
+ declare const meta_d_bulkInsert: typeof bulkInsert;
3327
+ declare const meta_d_bulkPatch: typeof bulkPatch;
3328
+ declare const meta_d_bulkRemove: typeof bulkRemove;
3329
+ declare const meta_d_bulkSave: typeof bulkSave;
3330
+ declare const meta_d_bulkUpdate: typeof bulkUpdate;
3331
+ declare const meta_d_get: typeof get;
3332
+ declare const meta_d_insert: typeof insert;
3333
+ declare const meta_d_insertReference: typeof insertReference;
3334
+ declare const meta_d_isReferenced: typeof isReferenced;
3335
+ declare const meta_d_patch: typeof patch;
3336
+ declare const meta_d_remove: typeof remove;
3337
+ declare const meta_d_removeReference: typeof removeReference;
3338
+ declare const meta_d_replaceReferences: typeof replaceReferences;
3339
+ declare const meta_d_save: typeof save;
3340
+ declare const meta_d_truncate: typeof truncate;
3341
+ declare const meta_d_update: typeof update;
3342
+ declare namespace meta_d {
3343
+ export { type meta_d___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_d_bulkInsert as bulkInsert, meta_d_bulkPatch as bulkPatch, meta_d_bulkRemove as bulkRemove, meta_d_bulkSave as bulkSave, meta_d_bulkUpdate as bulkUpdate, meta_d_get as get, meta_d_insert as insert, meta_d_insertReference as insertReference, meta_d_isReferenced as isReferenced, meta_d_patch as patch, meta_d_remove as remove, meta_d_removeReference as removeReference, meta_d_replaceReferences as replaceReferences, meta_d_save as save, meta_d_truncate as truncate, meta_d_update as update };
4621
3344
  }
4622
3345
 
4623
- export { meta$2 as collections, meta$3 as externalDatabaseConnections, meta as indexes, meta$1 as items };
3346
+ export { meta$1 as collections, meta$2 as externalDatabaseConnections, meta as indexes, meta_d as items };