@wix/data 1.0.115 → 1.0.116
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.
- package/context/package.json +2 -1
- package/meta/package.json +2 -1
- package/package.json +14 -8
- package/type-bundles/context.bundle.d.ts +2840 -0
- package/type-bundles/index.bundle.d.ts +4634 -0
- package/type-bundles/meta.bundle.d.ts +5177 -0
|
@@ -0,0 +1,2840 @@
|
|
|
1
|
+
/** An external database connection defines a connection between an external database and a Wix site or project. */
|
|
2
|
+
interface ExternalDatabaseConnection {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the external database connection.
|
|
5
|
+
* An external database connection may connect to one or more external data collections or tables.
|
|
6
|
+
* These are represented as `connectionName/dataCollectionId`.
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
|
|
10
|
+
endpoint?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Settings passed to the external database connection as part of each request.
|
|
13
|
+
* These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
|
|
14
|
+
* Their content and structure depend on the specific requirements of the external database's API.
|
|
15
|
+
*/
|
|
16
|
+
configuration?: Record<string, any> | null;
|
|
17
|
+
/**
|
|
18
|
+
* Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
connectionStatus?: ConnectionStatus;
|
|
22
|
+
/**
|
|
23
|
+
* The external database's capabilities.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
capabilities?: Capabilities;
|
|
27
|
+
}
|
|
28
|
+
declare enum CauseOfFailure {
|
|
29
|
+
/** No connection failure. */
|
|
30
|
+
NONE = "NONE",
|
|
31
|
+
/** General communication failure. */
|
|
32
|
+
COMMUNICATION_FAILURE = "COMMUNICATION_FAILURE",
|
|
33
|
+
/** External database host is unreachable. */
|
|
34
|
+
DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
|
|
35
|
+
/** Unauthorized to access the external database. */
|
|
36
|
+
UNAUTHORIZED = "UNAUTHORIZED",
|
|
37
|
+
/** `endpoint` is not set. */
|
|
38
|
+
DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
|
|
39
|
+
}
|
|
40
|
+
declare enum CollectionsFound {
|
|
41
|
+
UNKNOWN = "UNKNOWN",
|
|
42
|
+
YES = "YES",
|
|
43
|
+
NO = "NO"
|
|
44
|
+
}
|
|
45
|
+
declare enum FieldType {
|
|
46
|
+
UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
|
|
47
|
+
TEXT = "TEXT",
|
|
48
|
+
NUMBER = "NUMBER",
|
|
49
|
+
DATE = "DATE",
|
|
50
|
+
DATETIME = "DATETIME",
|
|
51
|
+
IMAGE = "IMAGE",
|
|
52
|
+
BOOLEAN = "BOOLEAN",
|
|
53
|
+
DOCUMENT = "DOCUMENT",
|
|
54
|
+
URL = "URL",
|
|
55
|
+
RICH_TEXT = "RICH_TEXT",
|
|
56
|
+
VIDEO = "VIDEO",
|
|
57
|
+
ANY = "ANY",
|
|
58
|
+
ARRAY_STRING = "ARRAY_STRING",
|
|
59
|
+
ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
|
|
60
|
+
AUDIO = "AUDIO",
|
|
61
|
+
TIME = "TIME",
|
|
62
|
+
LANGUAGE = "LANGUAGE",
|
|
63
|
+
RICH_CONTENT = "RICH_CONTENT",
|
|
64
|
+
MEDIA_GALLERY = "MEDIA_GALLERY",
|
|
65
|
+
ADDRESS = "ADDRESS",
|
|
66
|
+
PAGE_LINK = "PAGE_LINK",
|
|
67
|
+
REFERENCE = "REFERENCE",
|
|
68
|
+
MULTI_REFERENCE = "MULTI_REFERENCE",
|
|
69
|
+
OBJECT = "OBJECT",
|
|
70
|
+
ARRAY = "ARRAY",
|
|
71
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
72
|
+
LEGACY_TIME = "LEGACY_TIME",
|
|
73
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
74
|
+
LEGACY_BOOK = "LEGACY_BOOK",
|
|
75
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
76
|
+
LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
|
|
77
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
78
|
+
LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
|
|
79
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
80
|
+
LEGACY_IMAGE = "LEGACY_IMAGE",
|
|
81
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
82
|
+
LEGACY_COLOR = "LEGACY_COLOR",
|
|
83
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
84
|
+
LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
|
|
85
|
+
}
|
|
86
|
+
interface ConnectionStatus {
|
|
87
|
+
/** Whether the connection was established successfully. */
|
|
88
|
+
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
|
+
*/
|
|
97
|
+
causeOfFailure?: CauseOfFailure;
|
|
98
|
+
/**
|
|
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.
|
|
103
|
+
* @readonly
|
|
104
|
+
*/
|
|
105
|
+
hasCollections?: CollectionsFound;
|
|
106
|
+
}
|
|
107
|
+
interface Capabilities {
|
|
108
|
+
/** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */
|
|
109
|
+
collectionModificationsSupported?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Field types the external database supports.
|
|
112
|
+
* This field only applies when `collectionModificationsSupported` is `true`.
|
|
113
|
+
*/
|
|
114
|
+
fieldTypes?: FieldType[];
|
|
115
|
+
}
|
|
116
|
+
interface Paging$3 {
|
|
117
|
+
/** Number of items to load. */
|
|
118
|
+
limit?: number | null;
|
|
119
|
+
/** Number of items to skip in the current sort order. */
|
|
120
|
+
offset?: number | null;
|
|
121
|
+
}
|
|
122
|
+
interface ListExternalDatabaseConnectionsResponse {
|
|
123
|
+
/** List of external database connections. */
|
|
124
|
+
externalDatabaseConnections?: ExternalDatabaseConnection[];
|
|
125
|
+
/** Paging metadata */
|
|
126
|
+
pagingMetadata?: PagingMetadata$1;
|
|
127
|
+
}
|
|
128
|
+
interface PagingMetadata$1 {
|
|
129
|
+
/** Number of items returned in the response. */
|
|
130
|
+
count?: number | null;
|
|
131
|
+
/** Offset that was requested. */
|
|
132
|
+
offset?: number | null;
|
|
133
|
+
/** Total number of items that match the query. */
|
|
134
|
+
total?: number | null;
|
|
135
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
136
|
+
tooManyToCount?: boolean | null;
|
|
137
|
+
}
|
|
138
|
+
declare enum ConnectionType {
|
|
139
|
+
/** Unknown connection type. */
|
|
140
|
+
UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
|
|
141
|
+
/**
|
|
142
|
+
* Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
|
|
143
|
+
* https://www.wix.com/velo/reference/spis/external-database-collections/introduction
|
|
144
|
+
*/
|
|
145
|
+
STANDALONE = "STANDALONE",
|
|
146
|
+
/**
|
|
147
|
+
* Connection to database adapter that implements External Database SPI (protocol version 3)
|
|
148
|
+
* https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
|
|
149
|
+
* https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
|
|
150
|
+
*/
|
|
151
|
+
WIX_SPI = "WIX_SPI"
|
|
152
|
+
}
|
|
153
|
+
interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
|
|
154
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
155
|
+
anonymousVisitorId?: string;
|
|
156
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
157
|
+
memberId?: string;
|
|
158
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
159
|
+
wixUserId?: string;
|
|
160
|
+
/** ID of an app. */
|
|
161
|
+
appId?: string;
|
|
162
|
+
/** @readonly */
|
|
163
|
+
identityType?: WebhookIdentityType$2;
|
|
164
|
+
}
|
|
165
|
+
/** @oneof */
|
|
166
|
+
interface IdentificationDataIdOneOf$2 {
|
|
167
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
168
|
+
anonymousVisitorId?: string;
|
|
169
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
170
|
+
memberId?: string;
|
|
171
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
172
|
+
wixUserId?: string;
|
|
173
|
+
/** ID of an app. */
|
|
174
|
+
appId?: string;
|
|
175
|
+
}
|
|
176
|
+
declare enum WebhookIdentityType$2 {
|
|
177
|
+
UNKNOWN = "UNKNOWN",
|
|
178
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
179
|
+
MEMBER = "MEMBER",
|
|
180
|
+
WIX_USER = "WIX_USER",
|
|
181
|
+
APP = "APP"
|
|
182
|
+
}
|
|
183
|
+
interface ListExternalDatabaseConnectionsResponseNonNullableFields {
|
|
184
|
+
externalDatabaseConnections: {
|
|
185
|
+
name: string;
|
|
186
|
+
connectionStatus?: {
|
|
187
|
+
successful: boolean;
|
|
188
|
+
causeOfFailure: CauseOfFailure;
|
|
189
|
+
hasCollections: CollectionsFound;
|
|
190
|
+
};
|
|
191
|
+
capabilities?: {
|
|
192
|
+
collectionModificationsSupported: boolean;
|
|
193
|
+
fieldTypes: FieldType[];
|
|
194
|
+
};
|
|
195
|
+
}[];
|
|
196
|
+
}
|
|
197
|
+
interface BaseEventMetadata$2 {
|
|
198
|
+
/** App instance ID. */
|
|
199
|
+
instanceId?: string | null;
|
|
200
|
+
/** Event type. */
|
|
201
|
+
eventType?: string;
|
|
202
|
+
/** The identification type and identity data. */
|
|
203
|
+
identity?: IdentificationData$2;
|
|
204
|
+
}
|
|
205
|
+
interface EventMetadata$2 extends BaseEventMetadata$2 {
|
|
206
|
+
/**
|
|
207
|
+
* Unique event ID.
|
|
208
|
+
* Allows clients to ignore duplicate webhooks.
|
|
209
|
+
*/
|
|
210
|
+
_id?: string;
|
|
211
|
+
/**
|
|
212
|
+
* Assumes actions are also always typed to an entity_type
|
|
213
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
214
|
+
*/
|
|
215
|
+
entityFqdn?: string;
|
|
216
|
+
/**
|
|
217
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
218
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
219
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
220
|
+
*/
|
|
221
|
+
slug?: string;
|
|
222
|
+
/** ID of the entity associated with the event. */
|
|
223
|
+
entityId?: string;
|
|
224
|
+
/** Event timestamp. */
|
|
225
|
+
eventTime?: Date;
|
|
226
|
+
/**
|
|
227
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
228
|
+
* (for example, GDPR).
|
|
229
|
+
*/
|
|
230
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
231
|
+
/** If present, indicates the action that triggered the event. */
|
|
232
|
+
originatedFrom?: string | null;
|
|
233
|
+
/**
|
|
234
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
235
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
236
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
237
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
238
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
239
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
240
|
+
*/
|
|
241
|
+
entityEventSequence?: string | null;
|
|
242
|
+
}
|
|
243
|
+
interface ExternalDatabaseConnectionCreatedEnvelope {
|
|
244
|
+
entity: ExternalDatabaseConnection;
|
|
245
|
+
metadata: EventMetadata$2;
|
|
246
|
+
}
|
|
247
|
+
interface ExternalDatabaseConnectionUpdatedEnvelope {
|
|
248
|
+
entity: ExternalDatabaseConnection;
|
|
249
|
+
metadata: EventMetadata$2;
|
|
250
|
+
}
|
|
251
|
+
interface ExternalDatabaseConnectionDeletedEnvelope {
|
|
252
|
+
metadata: EventMetadata$2;
|
|
253
|
+
}
|
|
254
|
+
interface ListExternalDatabaseConnectionsOptions {
|
|
255
|
+
/** Paging */
|
|
256
|
+
paging?: Paging$3;
|
|
257
|
+
}
|
|
258
|
+
interface CreateExternalDatabaseConnectionOptions {
|
|
259
|
+
/** Connection type. */
|
|
260
|
+
connectionType: ConnectionType;
|
|
261
|
+
}
|
|
262
|
+
interface UpdateExternalDatabaseConnection {
|
|
263
|
+
/** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
|
|
264
|
+
endpoint?: string | null;
|
|
265
|
+
/**
|
|
266
|
+
* Settings passed to the external database connection as part of each request.
|
|
267
|
+
* These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
|
|
268
|
+
* Their content and structure depend on the specific requirements of the external database's API.
|
|
269
|
+
*/
|
|
270
|
+
configuration?: Record<string, any> | null;
|
|
271
|
+
/**
|
|
272
|
+
* Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
|
|
273
|
+
* @readonly
|
|
274
|
+
*/
|
|
275
|
+
connectionStatus?: ConnectionStatus;
|
|
276
|
+
/**
|
|
277
|
+
* The external database's capabilities.
|
|
278
|
+
* @readonly
|
|
279
|
+
*/
|
|
280
|
+
capabilities?: Capabilities;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
284
|
+
interface HttpClient {
|
|
285
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
286
|
+
}
|
|
287
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
288
|
+
type HttpResponse<T = any> = {
|
|
289
|
+
data: T;
|
|
290
|
+
status: number;
|
|
291
|
+
statusText: string;
|
|
292
|
+
headers: any;
|
|
293
|
+
request?: any;
|
|
294
|
+
};
|
|
295
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
296
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
297
|
+
url: string;
|
|
298
|
+
data?: Data;
|
|
299
|
+
params?: URLSearchParams;
|
|
300
|
+
} & APIMetadata;
|
|
301
|
+
type APIMetadata = {
|
|
302
|
+
methodFqn?: string;
|
|
303
|
+
entityFqdn?: string;
|
|
304
|
+
packageName?: string;
|
|
305
|
+
};
|
|
306
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
307
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
308
|
+
__type: 'event-definition';
|
|
309
|
+
type: Type;
|
|
310
|
+
isDomainEvent?: boolean;
|
|
311
|
+
transformations?: unknown;
|
|
312
|
+
__payload: Payload;
|
|
313
|
+
};
|
|
314
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
315
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
316
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
317
|
+
|
|
318
|
+
declare function getExternalDatabaseConnection$1(httpClient: HttpClient): (name: string) => Promise<ExternalDatabaseConnection & {
|
|
319
|
+
name: string;
|
|
320
|
+
connectionStatus?: {
|
|
321
|
+
successful: boolean;
|
|
322
|
+
causeOfFailure: CauseOfFailure;
|
|
323
|
+
hasCollections: CollectionsFound;
|
|
324
|
+
} | undefined;
|
|
325
|
+
capabilities?: {
|
|
326
|
+
collectionModificationsSupported: boolean;
|
|
327
|
+
fieldTypes: FieldType[];
|
|
328
|
+
} | undefined;
|
|
329
|
+
}>;
|
|
330
|
+
declare function listExternalDatabaseConnections$1(httpClient: HttpClient): (options?: ListExternalDatabaseConnectionsOptions) => Promise<ListExternalDatabaseConnectionsResponse & ListExternalDatabaseConnectionsResponseNonNullableFields>;
|
|
331
|
+
declare function createExternalDatabaseConnection$1(httpClient: HttpClient): (externalDatabaseConnection: ExternalDatabaseConnection, options: CreateExternalDatabaseConnectionOptions) => Promise<ExternalDatabaseConnection & {
|
|
332
|
+
name: string;
|
|
333
|
+
connectionStatus?: {
|
|
334
|
+
successful: boolean;
|
|
335
|
+
causeOfFailure: CauseOfFailure;
|
|
336
|
+
hasCollections: CollectionsFound;
|
|
337
|
+
} | undefined;
|
|
338
|
+
capabilities?: {
|
|
339
|
+
collectionModificationsSupported: boolean;
|
|
340
|
+
fieldTypes: FieldType[];
|
|
341
|
+
} | undefined;
|
|
342
|
+
}>;
|
|
343
|
+
declare function updateExternalDatabaseConnection$1(httpClient: HttpClient): (name: string, externalDatabaseConnection: UpdateExternalDatabaseConnection) => Promise<ExternalDatabaseConnection & {
|
|
344
|
+
name: string;
|
|
345
|
+
connectionStatus?: {
|
|
346
|
+
successful: boolean;
|
|
347
|
+
causeOfFailure: CauseOfFailure;
|
|
348
|
+
hasCollections: CollectionsFound;
|
|
349
|
+
} | undefined;
|
|
350
|
+
capabilities?: {
|
|
351
|
+
collectionModificationsSupported: boolean;
|
|
352
|
+
fieldTypes: FieldType[];
|
|
353
|
+
} | undefined;
|
|
354
|
+
}>;
|
|
355
|
+
declare function deleteExternalDatabaseConnection$1(httpClient: HttpClient): (name: string) => Promise<void>;
|
|
356
|
+
declare const onExternalDatabaseConnectionCreated$1: EventDefinition<ExternalDatabaseConnectionCreatedEnvelope, "wix.data.v1.external_database_connection_created">;
|
|
357
|
+
declare const onExternalDatabaseConnectionUpdated$1: EventDefinition<ExternalDatabaseConnectionUpdatedEnvelope, "wix.data.v1.external_database_connection_updated">;
|
|
358
|
+
declare const onExternalDatabaseConnectionDeleted$1: EventDefinition<ExternalDatabaseConnectionDeletedEnvelope, "wix.data.v1.external_database_connection_deleted">;
|
|
359
|
+
|
|
360
|
+
declare const getExternalDatabaseConnection: BuildRESTFunction<typeof getExternalDatabaseConnection$1>;
|
|
361
|
+
declare const listExternalDatabaseConnections: BuildRESTFunction<typeof listExternalDatabaseConnections$1>;
|
|
362
|
+
declare const createExternalDatabaseConnection: BuildRESTFunction<typeof createExternalDatabaseConnection$1>;
|
|
363
|
+
declare const updateExternalDatabaseConnection: BuildRESTFunction<typeof updateExternalDatabaseConnection$1>;
|
|
364
|
+
declare const deleteExternalDatabaseConnection: BuildRESTFunction<typeof deleteExternalDatabaseConnection$1>;
|
|
365
|
+
declare const onExternalDatabaseConnectionCreated: BuildEventDefinition<typeof onExternalDatabaseConnectionCreated$1>;
|
|
366
|
+
declare const onExternalDatabaseConnectionUpdated: BuildEventDefinition<typeof onExternalDatabaseConnectionUpdated$1>;
|
|
367
|
+
declare const onExternalDatabaseConnectionDeleted: BuildEventDefinition<typeof onExternalDatabaseConnectionDeleted$1>;
|
|
368
|
+
|
|
369
|
+
declare const context$3_createExternalDatabaseConnection: typeof createExternalDatabaseConnection;
|
|
370
|
+
declare const context$3_deleteExternalDatabaseConnection: typeof deleteExternalDatabaseConnection;
|
|
371
|
+
declare const context$3_getExternalDatabaseConnection: typeof getExternalDatabaseConnection;
|
|
372
|
+
declare const context$3_listExternalDatabaseConnections: typeof listExternalDatabaseConnections;
|
|
373
|
+
declare const context$3_onExternalDatabaseConnectionCreated: typeof onExternalDatabaseConnectionCreated;
|
|
374
|
+
declare const context$3_onExternalDatabaseConnectionDeleted: typeof onExternalDatabaseConnectionDeleted;
|
|
375
|
+
declare const context$3_onExternalDatabaseConnectionUpdated: typeof onExternalDatabaseConnectionUpdated;
|
|
376
|
+
declare const context$3_updateExternalDatabaseConnection: typeof updateExternalDatabaseConnection;
|
|
377
|
+
declare namespace context$3 {
|
|
378
|
+
export { context$3_createExternalDatabaseConnection as createExternalDatabaseConnection, context$3_deleteExternalDatabaseConnection as deleteExternalDatabaseConnection, context$3_getExternalDatabaseConnection as getExternalDatabaseConnection, context$3_listExternalDatabaseConnections as listExternalDatabaseConnections, context$3_onExternalDatabaseConnectionCreated as onExternalDatabaseConnectionCreated, context$3_onExternalDatabaseConnectionDeleted as onExternalDatabaseConnectionDeleted, context$3_onExternalDatabaseConnectionUpdated as onExternalDatabaseConnectionUpdated, context$3_updateExternalDatabaseConnection as updateExternalDatabaseConnection };
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** A data collection determines the structure of data to be stored in a database. */
|
|
382
|
+
interface DataCollection {
|
|
383
|
+
/** Collection ID. For example, `my-first-collection`. May include a namespace. */
|
|
384
|
+
_id?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Collection type. Indicates how the collection was created and is stored.
|
|
387
|
+
*
|
|
388
|
+
* * `NATIVE`: User-created collection.
|
|
389
|
+
* * `WIX_APP`: [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app, including [starter collections](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-starter-collections) created when a Wix app is installed.
|
|
390
|
+
* * `BLOCKS_APP`: Collection created by a Wix Blocks app.
|
|
391
|
+
* * `EXTERNAL`: Collection located in externally connected storage.
|
|
392
|
+
* @readonly
|
|
393
|
+
*/
|
|
394
|
+
collectionType?: CollectionType;
|
|
395
|
+
/**
|
|
396
|
+
* ID of the app that defined this collection. For user-defined collections, this value is null.
|
|
397
|
+
* @readonly
|
|
398
|
+
*/
|
|
399
|
+
ownerAppId?: string | null;
|
|
400
|
+
/**
|
|
401
|
+
* Maximum number of items returned in a single query, based on the underlying storage.
|
|
402
|
+
* Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
|
|
403
|
+
* External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
|
|
404
|
+
* @readonly
|
|
405
|
+
*/
|
|
406
|
+
maxPageSize?: number | null;
|
|
407
|
+
/** Collection's display name as shown in the CMS. For example, `My First Collection`. */
|
|
408
|
+
displayName?: string | null;
|
|
409
|
+
/**
|
|
410
|
+
* Indicates how the collection's items are sorted by default when a query doesn't specify an order.
|
|
411
|
+
* @readonly
|
|
412
|
+
*/
|
|
413
|
+
defaultDisplayOrder?: Sort;
|
|
414
|
+
/**
|
|
415
|
+
* UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
|
|
416
|
+
* Empty for all data collections not owned by internal Wix apps.
|
|
417
|
+
* @readonly
|
|
418
|
+
*/
|
|
419
|
+
displayNamespace?: string | null;
|
|
420
|
+
/** The field whose value the CMS displays to represent the collection item when referenced in a different collection. */
|
|
421
|
+
displayField?: string | null;
|
|
422
|
+
/**
|
|
423
|
+
* Capabilities the collection supports.
|
|
424
|
+
* @readonly
|
|
425
|
+
*/
|
|
426
|
+
capabilities?: CollectionCapabilities;
|
|
427
|
+
/** Collection's field structure. */
|
|
428
|
+
fields?: Field$1[];
|
|
429
|
+
/** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
|
|
430
|
+
permissions?: Permissions;
|
|
431
|
+
/**
|
|
432
|
+
* Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must pass the latest revision number.
|
|
433
|
+
* @readonly
|
|
434
|
+
*/
|
|
435
|
+
revision?: string | null;
|
|
436
|
+
/** All plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
|
|
437
|
+
plugins?: Plugin[];
|
|
438
|
+
/**
|
|
439
|
+
* All paging modes the collection supports. In native collections, offset-based paging is supported by default.
|
|
440
|
+
* @readonly
|
|
441
|
+
*/
|
|
442
|
+
pagingModes?: PagingMode[];
|
|
443
|
+
/**
|
|
444
|
+
* Date the collection was created.
|
|
445
|
+
* @readonly
|
|
446
|
+
*/
|
|
447
|
+
_createdDate?: Date;
|
|
448
|
+
/**
|
|
449
|
+
* Date the collection was last updated.
|
|
450
|
+
* @readonly
|
|
451
|
+
*/
|
|
452
|
+
_updatedDate?: Date;
|
|
453
|
+
}
|
|
454
|
+
declare enum CollectionType {
|
|
455
|
+
/** User-created collection. */
|
|
456
|
+
NATIVE = "NATIVE",
|
|
457
|
+
/** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */
|
|
458
|
+
WIX_APP = "WIX_APP",
|
|
459
|
+
/** Collection created by a Wix Blocks app. */
|
|
460
|
+
BLOCKS_APP = "BLOCKS_APP",
|
|
461
|
+
/** Collection located in externally connected storage. */
|
|
462
|
+
EXTERNAL = "EXTERNAL"
|
|
463
|
+
}
|
|
464
|
+
interface Sort {
|
|
465
|
+
/** Field to sort by. */
|
|
466
|
+
fieldKey?: string;
|
|
467
|
+
/**
|
|
468
|
+
* Sort order. Use `ASC` for ascending order or `DESC` for descending order.
|
|
469
|
+
*
|
|
470
|
+
* Default: `ASC`
|
|
471
|
+
*/
|
|
472
|
+
direction?: Direction;
|
|
473
|
+
}
|
|
474
|
+
declare enum Direction {
|
|
475
|
+
ASC = "ASC",
|
|
476
|
+
DESC = "DESC"
|
|
477
|
+
}
|
|
478
|
+
interface CollectionCapabilities {
|
|
479
|
+
/**
|
|
480
|
+
* Data operations the collection supports. The listed operations can be performed on data the collection contains.
|
|
481
|
+
*
|
|
482
|
+
* Supported values: `AGGREGATE`, `BULK_INSERT`, `BULK_REMOVE`, `BULK_SAVE`, `BULK_UPDATE`, `COUNT`, `DISTINCT`, `FIND`, `GET`, `INSERT`, `INSERT_REFERENCE`, `IS_REFERENCED`, `QUERY_REFERENCED`, `REMOVE`, `REMOVE_REFERENCE`, `REPLACE_REFERENCES`, `SAVE`, `TRUNCATE`, `UPDATE`.
|
|
483
|
+
*/
|
|
484
|
+
dataOperations?: DataOperation[];
|
|
485
|
+
/**
|
|
486
|
+
* Collection operations supported. The listed operations can be performed on the collection itself.
|
|
487
|
+
* + `UPDATE`: Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed.
|
|
488
|
+
* + `REMOVE`: Allows deleting the entire collection. If not included, the collection can't be deleted.
|
|
489
|
+
*/
|
|
490
|
+
collectionOperations?: CollectionOperation[];
|
|
491
|
+
/** Maximum number of indexes for the collection. */
|
|
492
|
+
indexLimits?: IndexLimits;
|
|
493
|
+
}
|
|
494
|
+
declare enum DataOperation {
|
|
495
|
+
AGGREGATE = "AGGREGATE",
|
|
496
|
+
BULK_INSERT = "BULK_INSERT",
|
|
497
|
+
BULK_REMOVE = "BULK_REMOVE",
|
|
498
|
+
BULK_SAVE = "BULK_SAVE",
|
|
499
|
+
BULK_UPDATE = "BULK_UPDATE",
|
|
500
|
+
COUNT = "COUNT",
|
|
501
|
+
DISTINCT = "DISTINCT",
|
|
502
|
+
FIND = "FIND",
|
|
503
|
+
GET = "GET",
|
|
504
|
+
INSERT = "INSERT",
|
|
505
|
+
INSERT_REFERENCE = "INSERT_REFERENCE",
|
|
506
|
+
IS_REFERENCED = "IS_REFERENCED",
|
|
507
|
+
QUERY_REFERENCED = "QUERY_REFERENCED",
|
|
508
|
+
REMOVE = "REMOVE",
|
|
509
|
+
REMOVE_REFERENCE = "REMOVE_REFERENCE",
|
|
510
|
+
REPLACE_REFERENCES = "REPLACE_REFERENCES",
|
|
511
|
+
SAVE = "SAVE",
|
|
512
|
+
TRUNCATE = "TRUNCATE",
|
|
513
|
+
UPDATE = "UPDATE",
|
|
514
|
+
PATCH = "PATCH",
|
|
515
|
+
BULK_PATCH = "BULK_PATCH"
|
|
516
|
+
}
|
|
517
|
+
declare enum CollectionOperation {
|
|
518
|
+
/** Supports updating this collection. */
|
|
519
|
+
UPDATE = "UPDATE",
|
|
520
|
+
/** Supports removing this collections. */
|
|
521
|
+
REMOVE = "REMOVE"
|
|
522
|
+
}
|
|
523
|
+
interface IndexLimits {
|
|
524
|
+
/** Maximum number of regular (non-unique) indexes allowed for this collection. */
|
|
525
|
+
regular?: number;
|
|
526
|
+
/** Maximum number of unique indexes allowed for this collection. */
|
|
527
|
+
unique?: number;
|
|
528
|
+
/** Maximum number of regular and unique indexes allowed for this collection. */
|
|
529
|
+
total?: number;
|
|
530
|
+
}
|
|
531
|
+
interface Field$1 extends FieldRangeValidationsOneOf {
|
|
532
|
+
/** Range of possible values for a numerical field. */
|
|
533
|
+
numberRange?: NumberRange;
|
|
534
|
+
/** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
|
|
535
|
+
stringLengthRange?: StringLengthRange;
|
|
536
|
+
/** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
|
|
537
|
+
arraySizeRange?: ArraySizeRange;
|
|
538
|
+
/** Unique identifier for the field. For example, `firstName`. */
|
|
539
|
+
key?: string;
|
|
540
|
+
/** Field's display name when shown in the CMS. For example, `First Name`. */
|
|
541
|
+
displayName?: string | null;
|
|
542
|
+
/** Field's data type. */
|
|
543
|
+
type?: Type;
|
|
544
|
+
/** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
|
|
545
|
+
typeMetadata?: TypeMetadata;
|
|
546
|
+
/**
|
|
547
|
+
* Whether the field is a system field (created automatically).
|
|
548
|
+
* @readonly
|
|
549
|
+
*/
|
|
550
|
+
systemField?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Capabilities the field supports.
|
|
553
|
+
* @readonly
|
|
554
|
+
*/
|
|
555
|
+
capabilities?: FieldCapabilities;
|
|
556
|
+
/** Indicates if field is encrypted. */
|
|
557
|
+
encrypted?: boolean;
|
|
558
|
+
/** Description of the field. */
|
|
559
|
+
description?: string | null;
|
|
560
|
+
plugin?: string | null;
|
|
561
|
+
/**
|
|
562
|
+
* Whether the field is read-only. A read-only field can't be changed.
|
|
563
|
+
*
|
|
564
|
+
* Default: `false`
|
|
565
|
+
*/
|
|
566
|
+
readOnly?: boolean | null;
|
|
567
|
+
/**
|
|
568
|
+
* Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
|
|
569
|
+
*
|
|
570
|
+
* Default: `false`
|
|
571
|
+
*/
|
|
572
|
+
immutable?: boolean | null;
|
|
573
|
+
/**
|
|
574
|
+
* Whether the field is required.
|
|
575
|
+
*
|
|
576
|
+
* Default: `false`
|
|
577
|
+
*/
|
|
578
|
+
required?: boolean | null;
|
|
579
|
+
/** Additional optional plugins for the field. */
|
|
580
|
+
plugins?: FieldPlugin[];
|
|
581
|
+
}
|
|
582
|
+
/** @oneof */
|
|
583
|
+
interface FieldRangeValidationsOneOf {
|
|
584
|
+
/** Range of possible values for a numerical field. */
|
|
585
|
+
numberRange?: NumberRange;
|
|
586
|
+
/** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
|
|
587
|
+
stringLengthRange?: StringLengthRange;
|
|
588
|
+
/** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
|
|
589
|
+
arraySizeRange?: ArraySizeRange;
|
|
590
|
+
}
|
|
591
|
+
declare enum Type {
|
|
592
|
+
UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
|
|
593
|
+
TEXT = "TEXT",
|
|
594
|
+
NUMBER = "NUMBER",
|
|
595
|
+
DATE = "DATE",
|
|
596
|
+
DATETIME = "DATETIME",
|
|
597
|
+
IMAGE = "IMAGE",
|
|
598
|
+
BOOLEAN = "BOOLEAN",
|
|
599
|
+
DOCUMENT = "DOCUMENT",
|
|
600
|
+
URL = "URL",
|
|
601
|
+
RICH_TEXT = "RICH_TEXT",
|
|
602
|
+
VIDEO = "VIDEO",
|
|
603
|
+
ANY = "ANY",
|
|
604
|
+
ARRAY_STRING = "ARRAY_STRING",
|
|
605
|
+
ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
|
|
606
|
+
AUDIO = "AUDIO",
|
|
607
|
+
TIME = "TIME",
|
|
608
|
+
LANGUAGE = "LANGUAGE",
|
|
609
|
+
RICH_CONTENT = "RICH_CONTENT",
|
|
610
|
+
MEDIA_GALLERY = "MEDIA_GALLERY",
|
|
611
|
+
ADDRESS = "ADDRESS",
|
|
612
|
+
PAGE_LINK = "PAGE_LINK",
|
|
613
|
+
REFERENCE = "REFERENCE",
|
|
614
|
+
MULTI_REFERENCE = "MULTI_REFERENCE",
|
|
615
|
+
OBJECT = "OBJECT",
|
|
616
|
+
ARRAY = "ARRAY",
|
|
617
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
618
|
+
LEGACY_TIME = "LEGACY_TIME",
|
|
619
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
620
|
+
LEGACY_BOOK = "LEGACY_BOOK",
|
|
621
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
622
|
+
LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
|
|
623
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
624
|
+
LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
|
|
625
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
626
|
+
LEGACY_IMAGE = "LEGACY_IMAGE",
|
|
627
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
628
|
+
LEGACY_COLOR = "LEGACY_COLOR",
|
|
629
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
630
|
+
LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
|
|
631
|
+
}
|
|
632
|
+
interface TypeMetadata extends TypeMetadataMetadataOneOf {
|
|
633
|
+
/** Metadata for a reference field. */
|
|
634
|
+
reference?: Reference;
|
|
635
|
+
/** Metadata for a multi-reference field. */
|
|
636
|
+
multiReference?: MultiReference;
|
|
637
|
+
/** Metadata for an object field. */
|
|
638
|
+
object?: _Object;
|
|
639
|
+
/** Metadata for an array field. */
|
|
640
|
+
array?: _Array;
|
|
641
|
+
/** Metadata for a page link field. */
|
|
642
|
+
pageLink?: PageLink;
|
|
643
|
+
}
|
|
644
|
+
/** @oneof */
|
|
645
|
+
interface TypeMetadataMetadataOneOf {
|
|
646
|
+
/** Metadata for a reference field. */
|
|
647
|
+
reference?: Reference;
|
|
648
|
+
/** Metadata for a multi-reference field. */
|
|
649
|
+
multiReference?: MultiReference;
|
|
650
|
+
/** Metadata for an object field. */
|
|
651
|
+
object?: _Object;
|
|
652
|
+
/** Metadata for an array field. */
|
|
653
|
+
array?: _Array;
|
|
654
|
+
/** Metadata for a page link field. */
|
|
655
|
+
pageLink?: PageLink;
|
|
656
|
+
}
|
|
657
|
+
interface FieldCapabilities {
|
|
658
|
+
/**
|
|
659
|
+
* Whether the collection can be sorted by this field.
|
|
660
|
+
*
|
|
661
|
+
* Default: `false`
|
|
662
|
+
*/
|
|
663
|
+
sortable?: boolean;
|
|
664
|
+
/**
|
|
665
|
+
* Query operators that can be used for this field.
|
|
666
|
+
*
|
|
667
|
+
* Supported values: `EQ`, `LT`, `GT`, `NE`, `LTE`, `GTE`, `STARTS_WITH`, `ENDS_WITH`, `CONTAINS`, `HAS_SOME`, `HAS_ALL`, `EXISTS`, `URLIZED`.
|
|
668
|
+
*/
|
|
669
|
+
queryOperators?: QueryOperator[];
|
|
670
|
+
}
|
|
671
|
+
declare enum QueryOperator {
|
|
672
|
+
EQ = "EQ",
|
|
673
|
+
LT = "LT",
|
|
674
|
+
GT = "GT",
|
|
675
|
+
NE = "NE",
|
|
676
|
+
LTE = "LTE",
|
|
677
|
+
GTE = "GTE",
|
|
678
|
+
STARTS_WITH = "STARTS_WITH",
|
|
679
|
+
ENDS_WITH = "ENDS_WITH",
|
|
680
|
+
CONTAINS = "CONTAINS",
|
|
681
|
+
HAS_SOME = "HAS_SOME",
|
|
682
|
+
HAS_ALL = "HAS_ALL",
|
|
683
|
+
EXISTS = "EXISTS",
|
|
684
|
+
URLIZED = "URLIZED"
|
|
685
|
+
}
|
|
686
|
+
interface ObjectField {
|
|
687
|
+
/** Field key. */
|
|
688
|
+
key?: string;
|
|
689
|
+
/** Display name for the field. */
|
|
690
|
+
displayName?: string | null;
|
|
691
|
+
/** Field type. */
|
|
692
|
+
type?: Type;
|
|
693
|
+
/** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
|
|
694
|
+
typeMetadata?: TypeMetadata;
|
|
695
|
+
/**
|
|
696
|
+
* Capabilities the object field supports.
|
|
697
|
+
* @readonly
|
|
698
|
+
*/
|
|
699
|
+
capabilities?: FieldCapabilities;
|
|
700
|
+
}
|
|
701
|
+
interface FieldsPattern {
|
|
702
|
+
pattern?: string;
|
|
703
|
+
lowercase?: boolean;
|
|
704
|
+
}
|
|
705
|
+
interface UrlizedOnlyPattern {
|
|
706
|
+
pattern?: string;
|
|
707
|
+
}
|
|
708
|
+
interface Calculator extends CalculatorPatternOneOf {
|
|
709
|
+
/** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
|
|
710
|
+
fieldsPattern?: FieldsPattern;
|
|
711
|
+
/** Value is only URL encoded. */
|
|
712
|
+
urlizedOnlyPattern?: UrlizedOnlyPattern;
|
|
713
|
+
}
|
|
714
|
+
/** @oneof */
|
|
715
|
+
interface CalculatorPatternOneOf {
|
|
716
|
+
/** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
|
|
717
|
+
fieldsPattern?: FieldsPattern;
|
|
718
|
+
/** Value is only URL encoded. */
|
|
719
|
+
urlizedOnlyPattern?: UrlizedOnlyPattern;
|
|
720
|
+
}
|
|
721
|
+
interface Reference {
|
|
722
|
+
/** Referenced collection ID. */
|
|
723
|
+
referencedCollectionId?: string;
|
|
724
|
+
}
|
|
725
|
+
interface MultiReference {
|
|
726
|
+
/** Referenced collection ID. */
|
|
727
|
+
referencedCollectionId?: string;
|
|
728
|
+
/** Referencing field key. */
|
|
729
|
+
referencingFieldKey?: string;
|
|
730
|
+
/** Display name in the CMS for the referenced data. */
|
|
731
|
+
referencingDisplayName?: string;
|
|
732
|
+
}
|
|
733
|
+
interface _Object {
|
|
734
|
+
/** Fields within the object. */
|
|
735
|
+
fields?: ObjectField[];
|
|
736
|
+
}
|
|
737
|
+
interface _Array {
|
|
738
|
+
/** Element's data type. */
|
|
739
|
+
elementType?: Type;
|
|
740
|
+
/** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
|
|
741
|
+
typeMetadata?: TypeMetadata;
|
|
742
|
+
}
|
|
743
|
+
interface PageLink {
|
|
744
|
+
calculator?: Calculator;
|
|
745
|
+
/** Defines reference to router pattern in the site document. */
|
|
746
|
+
linkedRouterPage?: string | null;
|
|
747
|
+
}
|
|
748
|
+
interface NumberRange {
|
|
749
|
+
/**
|
|
750
|
+
* Minimum permitted value for a numerical field.
|
|
751
|
+
*
|
|
752
|
+
* Default: No validation
|
|
753
|
+
*/
|
|
754
|
+
min?: number | null;
|
|
755
|
+
/**
|
|
756
|
+
* Maximum permitted value for a numerical field.
|
|
757
|
+
*
|
|
758
|
+
* Default: No validation
|
|
759
|
+
*/
|
|
760
|
+
max?: number | null;
|
|
761
|
+
}
|
|
762
|
+
interface StringLengthRange {
|
|
763
|
+
/**
|
|
764
|
+
* Minimum permitted length for a text field.
|
|
765
|
+
*
|
|
766
|
+
* Default: No validation
|
|
767
|
+
*/
|
|
768
|
+
minLength?: number | null;
|
|
769
|
+
/**
|
|
770
|
+
* Maximum permitted length for a text field.
|
|
771
|
+
*
|
|
772
|
+
* Default: No validation
|
|
773
|
+
*/
|
|
774
|
+
maxLength?: number | null;
|
|
775
|
+
}
|
|
776
|
+
interface ArraySizeRange {
|
|
777
|
+
/**
|
|
778
|
+
* Minimum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
|
|
779
|
+
*
|
|
780
|
+
* Default: No validation
|
|
781
|
+
*/
|
|
782
|
+
minSize?: number | null;
|
|
783
|
+
/**
|
|
784
|
+
* Maximum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
|
|
785
|
+
*
|
|
786
|
+
* Default: No validation
|
|
787
|
+
*/
|
|
788
|
+
maxSize?: number | null;
|
|
789
|
+
}
|
|
790
|
+
/** Optional plug-in aspects for fields */
|
|
791
|
+
interface FieldPlugin extends FieldPluginOptionsOneOf {
|
|
792
|
+
/** Options for the CMS plugin. */
|
|
793
|
+
cmsOptions?: CmsOptions;
|
|
794
|
+
type?: FieldPluginType;
|
|
795
|
+
}
|
|
796
|
+
/** @oneof */
|
|
797
|
+
interface FieldPluginOptionsOneOf {
|
|
798
|
+
/** Options for the CMS plugin. */
|
|
799
|
+
cmsOptions?: CmsOptions;
|
|
800
|
+
}
|
|
801
|
+
declare enum FieldPluginType {
|
|
802
|
+
UNKNOWN = "UNKNOWN",
|
|
803
|
+
/** CMS-related field attributes */
|
|
804
|
+
CMS = "CMS"
|
|
805
|
+
}
|
|
806
|
+
/** Options for the CMS plugin. */
|
|
807
|
+
interface CmsOptions {
|
|
808
|
+
/**
|
|
809
|
+
* Indicates an internal CMS field. The CMS does not display internal fields.
|
|
810
|
+
*
|
|
811
|
+
* Default: `false`
|
|
812
|
+
*/
|
|
813
|
+
internal?: boolean;
|
|
814
|
+
}
|
|
815
|
+
/** Permissions defined by the lowest role needed to perform each action. */
|
|
816
|
+
interface Permissions {
|
|
817
|
+
/** Lowest role needed to add a collection. */
|
|
818
|
+
insert?: Role;
|
|
819
|
+
/** Lowest role needed to update a collection. */
|
|
820
|
+
update?: Role;
|
|
821
|
+
/** Lowest role needed to remove a collection. */
|
|
822
|
+
remove?: Role;
|
|
823
|
+
/** Lowest role needed to read a collection. */
|
|
824
|
+
read?: Role;
|
|
825
|
+
}
|
|
826
|
+
declare enum Role {
|
|
827
|
+
/** Unknown. */
|
|
828
|
+
UNKNOWN_ROLE = "UNKNOWN_ROLE",
|
|
829
|
+
/** Site administrator. */
|
|
830
|
+
ADMIN = "ADMIN",
|
|
831
|
+
/** Signed-in user who added content to this collection. */
|
|
832
|
+
SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
|
|
833
|
+
/** Any signed-in user. */
|
|
834
|
+
SITE_MEMBER = "SITE_MEMBER",
|
|
835
|
+
/** Any site visitor. */
|
|
836
|
+
ANYONE = "ANYONE"
|
|
837
|
+
}
|
|
838
|
+
interface Plugin extends PluginOptionsOneOf {
|
|
839
|
+
/** Options for the Publish plugin. */
|
|
840
|
+
publishOptions?: PublishPluginOptions;
|
|
841
|
+
/** Options for the Single Item plugin. */
|
|
842
|
+
singleItemOptions?: SingleItemPluginOptions;
|
|
843
|
+
/** Options for the Urlized plugin. */
|
|
844
|
+
urlizedOptions?: UrlizedPluginOptions;
|
|
845
|
+
/** Options for the Multilingual plugin. */
|
|
846
|
+
multilingualOptions?: MultilingualOptions;
|
|
847
|
+
/** Options for the PageLink plugin. */
|
|
848
|
+
editablePageLinkOptions?: PageLinkPluginOptions;
|
|
849
|
+
/** Options for the CMS plugin. */
|
|
850
|
+
cmsOptions?: PluginCmsOptions;
|
|
851
|
+
/**
|
|
852
|
+
* Plugin types. The following plugins are supported:
|
|
853
|
+
*
|
|
854
|
+
* * `PUBLISH`: Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors.
|
|
855
|
+
* * `SINGLE_ITEM`: Ensures the collection can have one item at most. Can only be applied to a new collection.
|
|
856
|
+
* * `URLIZED`: Generates item URLs for collections used by dynamic pages.
|
|
857
|
+
* * `MULTILINGUAL`: Indicates that the collection is translatable. This allows you to manage translation for selected fields using [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
858
|
+
* * `CMS`: Contains CMS-related collection attributes
|
|
859
|
+
*/
|
|
860
|
+
type?: PluginType;
|
|
861
|
+
}
|
|
862
|
+
/** @oneof */
|
|
863
|
+
interface PluginOptionsOneOf {
|
|
864
|
+
/** Options for the Publish plugin. */
|
|
865
|
+
publishOptions?: PublishPluginOptions;
|
|
866
|
+
/** Options for the Single Item plugin. */
|
|
867
|
+
singleItemOptions?: SingleItemPluginOptions;
|
|
868
|
+
/** Options for the Urlized plugin. */
|
|
869
|
+
urlizedOptions?: UrlizedPluginOptions;
|
|
870
|
+
/** Options for the Multilingual plugin. */
|
|
871
|
+
multilingualOptions?: MultilingualOptions;
|
|
872
|
+
/** Options for the PageLink plugin. */
|
|
873
|
+
editablePageLinkOptions?: PageLinkPluginOptions;
|
|
874
|
+
/** Options for the CMS plugin. */
|
|
875
|
+
cmsOptions?: PluginCmsOptions;
|
|
876
|
+
}
|
|
877
|
+
declare enum Status$1 {
|
|
878
|
+
UNKNOWN_PUBLISH_PLUGIN_STATUS = "UNKNOWN_PUBLISH_PLUGIN_STATUS",
|
|
879
|
+
PUBLISHED = "PUBLISHED",
|
|
880
|
+
DRAFT = "DRAFT"
|
|
881
|
+
}
|
|
882
|
+
declare enum Format {
|
|
883
|
+
UNKNOWN_URLIZED_PLUGIN_FORMAT = "UNKNOWN_URLIZED_PLUGIN_FORMAT",
|
|
884
|
+
ORIGINAL = "ORIGINAL",
|
|
885
|
+
PLAIN = "PLAIN"
|
|
886
|
+
}
|
|
887
|
+
/** if CMS-defined sort is enabled and should be used in site */
|
|
888
|
+
interface SiteSort {
|
|
889
|
+
/** Field and order for the site sort. */
|
|
890
|
+
sort?: Sort[];
|
|
891
|
+
}
|
|
892
|
+
declare enum PluginType {
|
|
893
|
+
/** Unknown plugin type. */
|
|
894
|
+
UNKNOWN_PLUGIN_TYPE = "UNKNOWN_PLUGIN_TYPE",
|
|
895
|
+
/** Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors. */
|
|
896
|
+
PUBLISH = "PUBLISH",
|
|
897
|
+
/** Ensures the collection can have one item at most. Can only be applied to a new collection. */
|
|
898
|
+
SINGLE_ITEM = "SINGLE_ITEM",
|
|
899
|
+
/** Generates item URLs for collections used by dynamic pages. */
|
|
900
|
+
URLIZED = "URLIZED",
|
|
901
|
+
/** Deprecated. Will be removed in the future. */
|
|
902
|
+
GRIDAPPLESS = "GRIDAPPLESS",
|
|
903
|
+
/** Indicates that the collection is translatable. This allows you to manage translation for selected fields using [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). */
|
|
904
|
+
MULTILINGUAL = "MULTILINGUAL",
|
|
905
|
+
/** Indicates that collection is shared with current site */
|
|
906
|
+
SHARED = "SHARED",
|
|
907
|
+
/** Indicates that page link fields are persisted and can be updated */
|
|
908
|
+
EDITABLE_PAGE_LINK = "EDITABLE_PAGE_LINK",
|
|
909
|
+
/** CMS-specific collection properties */
|
|
910
|
+
CMS = "CMS"
|
|
911
|
+
}
|
|
912
|
+
interface PublishPluginOptions {
|
|
913
|
+
/** Default status. */
|
|
914
|
+
defaultStatus?: Status$1;
|
|
915
|
+
}
|
|
916
|
+
interface SingleItemPluginOptions {
|
|
917
|
+
/** ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this. */
|
|
918
|
+
singleItemId?: string;
|
|
919
|
+
}
|
|
920
|
+
interface UrlizedPluginOptions {
|
|
921
|
+
/**
|
|
922
|
+
* Encoding method for generating a URL in ASCII characters.
|
|
923
|
+
*
|
|
924
|
+
* * `ORIGINAL`: Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL.
|
|
925
|
+
* * `PLAIN`: No changes are made before generating the encoded URL.
|
|
926
|
+
*/
|
|
927
|
+
format?: Format;
|
|
928
|
+
}
|
|
929
|
+
interface MultilingualOptions {
|
|
930
|
+
/** IDs of fields to allow translation. */
|
|
931
|
+
translatableFieldKeys?: string[];
|
|
932
|
+
}
|
|
933
|
+
interface PageLinkPluginOptions {
|
|
934
|
+
isPersisted?: boolean;
|
|
935
|
+
isMutable?: boolean;
|
|
936
|
+
}
|
|
937
|
+
interface PluginCmsOptions {
|
|
938
|
+
/** CMS sort, applied when a collection is displayed on a site. */
|
|
939
|
+
siteSort?: SiteSort;
|
|
940
|
+
}
|
|
941
|
+
declare enum PagingMode {
|
|
942
|
+
/** Offset-based paging. */
|
|
943
|
+
OFFSET = "OFFSET",
|
|
944
|
+
/** Cursor-based paging. */
|
|
945
|
+
CURSOR = "CURSOR"
|
|
946
|
+
}
|
|
947
|
+
interface DataCollectionClonedEvent {
|
|
948
|
+
/** original instance collection is cloned from */
|
|
949
|
+
originInstanceId?: string;
|
|
950
|
+
/** original collection ID, may be same as current one */
|
|
951
|
+
originId?: string;
|
|
952
|
+
}
|
|
953
|
+
interface DataCollectionChangedEvent {
|
|
954
|
+
/** list of new fields */
|
|
955
|
+
fieldsAdded?: Field$1[];
|
|
956
|
+
/** list of changed fields */
|
|
957
|
+
fieldsUpdated?: FieldUpdate[];
|
|
958
|
+
/** list of removed fields */
|
|
959
|
+
fieldsRemoved?: Field$1[];
|
|
960
|
+
/** list of new plugins */
|
|
961
|
+
pluginsAdded?: Plugin[];
|
|
962
|
+
/** list of changed plugins */
|
|
963
|
+
pluginsUpdated?: PluginUpdate[];
|
|
964
|
+
/** list of removed plugins */
|
|
965
|
+
pluginsRemoved?: Plugin[];
|
|
966
|
+
}
|
|
967
|
+
interface FieldUpdate {
|
|
968
|
+
/** previous state of the field */
|
|
969
|
+
previous?: Field$1;
|
|
970
|
+
/** current state of the field */
|
|
971
|
+
current?: Field$1;
|
|
972
|
+
}
|
|
973
|
+
interface PluginUpdate {
|
|
974
|
+
/** previous state of the plugin */
|
|
975
|
+
previous?: Plugin;
|
|
976
|
+
/** current state of the plugin */
|
|
977
|
+
current?: Plugin;
|
|
978
|
+
}
|
|
979
|
+
interface Sorting$1 {
|
|
980
|
+
/** Name of the field to sort by. */
|
|
981
|
+
fieldName?: string;
|
|
982
|
+
/** Sort order. */
|
|
983
|
+
order?: SortOrder$1;
|
|
984
|
+
}
|
|
985
|
+
declare enum SortOrder$1 {
|
|
986
|
+
ASC = "ASC",
|
|
987
|
+
DESC = "DESC"
|
|
988
|
+
}
|
|
989
|
+
interface Paging$2 {
|
|
990
|
+
/** Number of items to load. */
|
|
991
|
+
limit?: number | null;
|
|
992
|
+
/** Number of items to skip in the current sort order. */
|
|
993
|
+
offset?: number | null;
|
|
994
|
+
}
|
|
995
|
+
interface ListDataCollectionsResponse {
|
|
996
|
+
/** List of collections. */
|
|
997
|
+
collections?: DataCollection[];
|
|
998
|
+
/** Paging information. */
|
|
999
|
+
pagingMetadata?: PagingMetadataV2$1;
|
|
1000
|
+
}
|
|
1001
|
+
interface PagingMetadataV2$1 {
|
|
1002
|
+
/** Number of items returned in the response. */
|
|
1003
|
+
count?: number | null;
|
|
1004
|
+
/** Offset that was requested. */
|
|
1005
|
+
offset?: number | null;
|
|
1006
|
+
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
|
|
1007
|
+
total?: number | null;
|
|
1008
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
1009
|
+
tooManyToCount?: boolean | null;
|
|
1010
|
+
}
|
|
1011
|
+
interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
|
|
1012
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1013
|
+
anonymousVisitorId?: string;
|
|
1014
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1015
|
+
memberId?: string;
|
|
1016
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1017
|
+
wixUserId?: string;
|
|
1018
|
+
/** ID of an app. */
|
|
1019
|
+
appId?: string;
|
|
1020
|
+
/** @readonly */
|
|
1021
|
+
identityType?: WebhookIdentityType$1;
|
|
1022
|
+
}
|
|
1023
|
+
/** @oneof */
|
|
1024
|
+
interface IdentificationDataIdOneOf$1 {
|
|
1025
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1026
|
+
anonymousVisitorId?: string;
|
|
1027
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1028
|
+
memberId?: string;
|
|
1029
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1030
|
+
wixUserId?: string;
|
|
1031
|
+
/** ID of an app. */
|
|
1032
|
+
appId?: string;
|
|
1033
|
+
}
|
|
1034
|
+
declare enum WebhookIdentityType$1 {
|
|
1035
|
+
UNKNOWN = "UNKNOWN",
|
|
1036
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1037
|
+
MEMBER = "MEMBER",
|
|
1038
|
+
WIX_USER = "WIX_USER",
|
|
1039
|
+
APP = "APP"
|
|
1040
|
+
}
|
|
1041
|
+
interface ListDataCollectionsResponseNonNullableFields {
|
|
1042
|
+
collections: {
|
|
1043
|
+
_id: string;
|
|
1044
|
+
collectionType: CollectionType;
|
|
1045
|
+
defaultDisplayOrder?: {
|
|
1046
|
+
fieldKey: string;
|
|
1047
|
+
direction: Direction;
|
|
1048
|
+
};
|
|
1049
|
+
capabilities?: {
|
|
1050
|
+
dataOperations: DataOperation[];
|
|
1051
|
+
collectionOperations: CollectionOperation[];
|
|
1052
|
+
indexLimits?: {
|
|
1053
|
+
regular: number;
|
|
1054
|
+
unique: number;
|
|
1055
|
+
total: number;
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1058
|
+
fields: {
|
|
1059
|
+
key: string;
|
|
1060
|
+
type: Type;
|
|
1061
|
+
typeMetadata?: {
|
|
1062
|
+
reference?: {
|
|
1063
|
+
referencedCollectionId: string;
|
|
1064
|
+
};
|
|
1065
|
+
multiReference?: {
|
|
1066
|
+
referencedCollectionId: string;
|
|
1067
|
+
referencingFieldKey: string;
|
|
1068
|
+
referencingDisplayName: string;
|
|
1069
|
+
};
|
|
1070
|
+
object?: {
|
|
1071
|
+
fields: {
|
|
1072
|
+
key: string;
|
|
1073
|
+
type: Type;
|
|
1074
|
+
capabilities?: {
|
|
1075
|
+
sortable: boolean;
|
|
1076
|
+
queryOperators: QueryOperator[];
|
|
1077
|
+
};
|
|
1078
|
+
}[];
|
|
1079
|
+
};
|
|
1080
|
+
array?: {
|
|
1081
|
+
elementType: Type;
|
|
1082
|
+
};
|
|
1083
|
+
pageLink?: {
|
|
1084
|
+
calculator?: {
|
|
1085
|
+
fieldsPattern?: {
|
|
1086
|
+
pattern: string;
|
|
1087
|
+
lowercase: boolean;
|
|
1088
|
+
};
|
|
1089
|
+
urlizedOnlyPattern?: {
|
|
1090
|
+
pattern: string;
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
systemField: boolean;
|
|
1096
|
+
capabilities?: {
|
|
1097
|
+
sortable: boolean;
|
|
1098
|
+
queryOperators: QueryOperator[];
|
|
1099
|
+
};
|
|
1100
|
+
encrypted: boolean;
|
|
1101
|
+
plugins: {
|
|
1102
|
+
cmsOptions?: {
|
|
1103
|
+
internal: boolean;
|
|
1104
|
+
};
|
|
1105
|
+
type: FieldPluginType;
|
|
1106
|
+
}[];
|
|
1107
|
+
}[];
|
|
1108
|
+
permissions?: {
|
|
1109
|
+
insert: Role;
|
|
1110
|
+
update: Role;
|
|
1111
|
+
remove: Role;
|
|
1112
|
+
read: Role;
|
|
1113
|
+
};
|
|
1114
|
+
plugins: {
|
|
1115
|
+
publishOptions?: {
|
|
1116
|
+
defaultStatus: Status$1;
|
|
1117
|
+
};
|
|
1118
|
+
singleItemOptions?: {
|
|
1119
|
+
singleItemId: string;
|
|
1120
|
+
};
|
|
1121
|
+
urlizedOptions?: {
|
|
1122
|
+
format: Format;
|
|
1123
|
+
};
|
|
1124
|
+
multilingualOptions?: {
|
|
1125
|
+
translatableFieldKeys: string[];
|
|
1126
|
+
};
|
|
1127
|
+
editablePageLinkOptions?: {
|
|
1128
|
+
isPersisted: boolean;
|
|
1129
|
+
isMutable: boolean;
|
|
1130
|
+
};
|
|
1131
|
+
cmsOptions?: {
|
|
1132
|
+
siteSort?: {
|
|
1133
|
+
sort: {
|
|
1134
|
+
fieldKey: string;
|
|
1135
|
+
direction: Direction;
|
|
1136
|
+
}[];
|
|
1137
|
+
};
|
|
1138
|
+
};
|
|
1139
|
+
type: PluginType;
|
|
1140
|
+
}[];
|
|
1141
|
+
pagingModes: PagingMode[];
|
|
1142
|
+
}[];
|
|
1143
|
+
}
|
|
1144
|
+
interface BaseEventMetadata$1 {
|
|
1145
|
+
/** App instance ID. */
|
|
1146
|
+
instanceId?: string | null;
|
|
1147
|
+
/** Event type. */
|
|
1148
|
+
eventType?: string;
|
|
1149
|
+
/** The identification type and identity data. */
|
|
1150
|
+
identity?: IdentificationData$1;
|
|
1151
|
+
}
|
|
1152
|
+
interface EventMetadata$1 extends BaseEventMetadata$1 {
|
|
1153
|
+
/**
|
|
1154
|
+
* Unique event ID.
|
|
1155
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1156
|
+
*/
|
|
1157
|
+
_id?: string;
|
|
1158
|
+
/**
|
|
1159
|
+
* Assumes actions are also always typed to an entity_type
|
|
1160
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1161
|
+
*/
|
|
1162
|
+
entityFqdn?: string;
|
|
1163
|
+
/**
|
|
1164
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1165
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1166
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1167
|
+
*/
|
|
1168
|
+
slug?: string;
|
|
1169
|
+
/** ID of the entity associated with the event. */
|
|
1170
|
+
entityId?: string;
|
|
1171
|
+
/** Event timestamp. */
|
|
1172
|
+
eventTime?: Date;
|
|
1173
|
+
/**
|
|
1174
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1175
|
+
* (for example, GDPR).
|
|
1176
|
+
*/
|
|
1177
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1178
|
+
/** If present, indicates the action that triggered the event. */
|
|
1179
|
+
originatedFrom?: string | null;
|
|
1180
|
+
/**
|
|
1181
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1182
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1183
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1184
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1185
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1186
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1187
|
+
*/
|
|
1188
|
+
entityEventSequence?: string | null;
|
|
1189
|
+
}
|
|
1190
|
+
interface DataCollectionClonedEnvelope {
|
|
1191
|
+
data: DataCollectionClonedEvent;
|
|
1192
|
+
metadata: EventMetadata$1;
|
|
1193
|
+
}
|
|
1194
|
+
interface DataCollectionChangedEnvelope {
|
|
1195
|
+
data: DataCollectionChangedEvent;
|
|
1196
|
+
metadata: EventMetadata$1;
|
|
1197
|
+
}
|
|
1198
|
+
interface DataCollectionCreatedEnvelope {
|
|
1199
|
+
entity: DataCollection;
|
|
1200
|
+
metadata: EventMetadata$1;
|
|
1201
|
+
}
|
|
1202
|
+
interface DataCollectionUpdatedEnvelope {
|
|
1203
|
+
entity: DataCollection;
|
|
1204
|
+
metadata: EventMetadata$1;
|
|
1205
|
+
}
|
|
1206
|
+
interface DataCollectionDeletedEnvelope {
|
|
1207
|
+
metadata: EventMetadata$1;
|
|
1208
|
+
}
|
|
1209
|
+
interface GetDataCollectionOptions {
|
|
1210
|
+
/**
|
|
1211
|
+
* Whether to retrieve data from the primary database instance.
|
|
1212
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
1213
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
1214
|
+
*
|
|
1215
|
+
* Default: `false`
|
|
1216
|
+
*/
|
|
1217
|
+
consistentRead?: boolean;
|
|
1218
|
+
}
|
|
1219
|
+
interface ListDataCollectionsOptions {
|
|
1220
|
+
/**
|
|
1221
|
+
* Defines how collections in the response are sorted.
|
|
1222
|
+
*
|
|
1223
|
+
* Default: Ordered by ID in ascending order.
|
|
1224
|
+
*/
|
|
1225
|
+
sort?: Sorting$1;
|
|
1226
|
+
/** Pagination information. */
|
|
1227
|
+
paging?: Paging$2;
|
|
1228
|
+
/**
|
|
1229
|
+
* Whether to retrieve data from the primary database instance.
|
|
1230
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
1231
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
1232
|
+
*
|
|
1233
|
+
* Default: `false`
|
|
1234
|
+
*/
|
|
1235
|
+
consistentRead?: boolean;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
declare function createDataCollection$1(httpClient: HttpClient): (collection: DataCollection) => Promise<DataCollection & {
|
|
1239
|
+
_id: string;
|
|
1240
|
+
collectionType: CollectionType;
|
|
1241
|
+
defaultDisplayOrder?: {
|
|
1242
|
+
fieldKey: string;
|
|
1243
|
+
direction: Direction;
|
|
1244
|
+
} | undefined;
|
|
1245
|
+
capabilities?: {
|
|
1246
|
+
dataOperations: DataOperation[];
|
|
1247
|
+
collectionOperations: CollectionOperation[];
|
|
1248
|
+
indexLimits?: {
|
|
1249
|
+
regular: number;
|
|
1250
|
+
unique: number;
|
|
1251
|
+
total: number;
|
|
1252
|
+
} | undefined;
|
|
1253
|
+
} | undefined;
|
|
1254
|
+
fields: {
|
|
1255
|
+
key: string;
|
|
1256
|
+
type: Type;
|
|
1257
|
+
typeMetadata?: {
|
|
1258
|
+
reference?: {
|
|
1259
|
+
referencedCollectionId: string;
|
|
1260
|
+
} | undefined;
|
|
1261
|
+
multiReference?: {
|
|
1262
|
+
referencedCollectionId: string;
|
|
1263
|
+
referencingFieldKey: string;
|
|
1264
|
+
referencingDisplayName: string;
|
|
1265
|
+
} | undefined;
|
|
1266
|
+
object?: {
|
|
1267
|
+
fields: {
|
|
1268
|
+
key: string;
|
|
1269
|
+
type: Type;
|
|
1270
|
+
capabilities?: {
|
|
1271
|
+
sortable: boolean;
|
|
1272
|
+
queryOperators: QueryOperator[];
|
|
1273
|
+
} | undefined;
|
|
1274
|
+
}[];
|
|
1275
|
+
} | undefined;
|
|
1276
|
+
array?: {
|
|
1277
|
+
elementType: Type;
|
|
1278
|
+
} | undefined;
|
|
1279
|
+
pageLink?: {
|
|
1280
|
+
calculator?: {
|
|
1281
|
+
fieldsPattern?: {
|
|
1282
|
+
pattern: string;
|
|
1283
|
+
lowercase: boolean;
|
|
1284
|
+
} | undefined;
|
|
1285
|
+
urlizedOnlyPattern?: {
|
|
1286
|
+
pattern: string;
|
|
1287
|
+
} | undefined;
|
|
1288
|
+
} | undefined;
|
|
1289
|
+
} | undefined;
|
|
1290
|
+
} | undefined;
|
|
1291
|
+
systemField: boolean;
|
|
1292
|
+
capabilities?: {
|
|
1293
|
+
sortable: boolean;
|
|
1294
|
+
queryOperators: QueryOperator[];
|
|
1295
|
+
} | undefined;
|
|
1296
|
+
encrypted: boolean;
|
|
1297
|
+
plugins: {
|
|
1298
|
+
cmsOptions?: {
|
|
1299
|
+
internal: boolean;
|
|
1300
|
+
} | undefined;
|
|
1301
|
+
type: FieldPluginType;
|
|
1302
|
+
}[];
|
|
1303
|
+
}[];
|
|
1304
|
+
permissions?: {
|
|
1305
|
+
insert: Role;
|
|
1306
|
+
update: Role;
|
|
1307
|
+
remove: Role;
|
|
1308
|
+
read: Role;
|
|
1309
|
+
} | undefined;
|
|
1310
|
+
plugins: {
|
|
1311
|
+
publishOptions?: {
|
|
1312
|
+
defaultStatus: Status$1;
|
|
1313
|
+
} | undefined;
|
|
1314
|
+
singleItemOptions?: {
|
|
1315
|
+
singleItemId: string;
|
|
1316
|
+
} | undefined;
|
|
1317
|
+
urlizedOptions?: {
|
|
1318
|
+
format: Format;
|
|
1319
|
+
} | undefined;
|
|
1320
|
+
multilingualOptions?: {
|
|
1321
|
+
translatableFieldKeys: string[];
|
|
1322
|
+
} | undefined;
|
|
1323
|
+
editablePageLinkOptions?: {
|
|
1324
|
+
isPersisted: boolean;
|
|
1325
|
+
isMutable: boolean;
|
|
1326
|
+
} | undefined;
|
|
1327
|
+
cmsOptions?: {
|
|
1328
|
+
siteSort?: {
|
|
1329
|
+
sort: {
|
|
1330
|
+
fieldKey: string;
|
|
1331
|
+
direction: Direction;
|
|
1332
|
+
}[];
|
|
1333
|
+
} | undefined;
|
|
1334
|
+
} | undefined;
|
|
1335
|
+
type: PluginType;
|
|
1336
|
+
}[];
|
|
1337
|
+
pagingModes: PagingMode[];
|
|
1338
|
+
}>;
|
|
1339
|
+
declare function getDataCollection$1(httpClient: HttpClient): (dataCollectionId: string, options?: GetDataCollectionOptions) => Promise<DataCollection & {
|
|
1340
|
+
_id: string;
|
|
1341
|
+
collectionType: CollectionType;
|
|
1342
|
+
defaultDisplayOrder?: {
|
|
1343
|
+
fieldKey: string;
|
|
1344
|
+
direction: Direction;
|
|
1345
|
+
} | undefined;
|
|
1346
|
+
capabilities?: {
|
|
1347
|
+
dataOperations: DataOperation[];
|
|
1348
|
+
collectionOperations: CollectionOperation[];
|
|
1349
|
+
indexLimits?: {
|
|
1350
|
+
regular: number;
|
|
1351
|
+
unique: number;
|
|
1352
|
+
total: number;
|
|
1353
|
+
} | undefined;
|
|
1354
|
+
} | undefined;
|
|
1355
|
+
fields: {
|
|
1356
|
+
key: string;
|
|
1357
|
+
type: Type;
|
|
1358
|
+
typeMetadata?: {
|
|
1359
|
+
reference?: {
|
|
1360
|
+
referencedCollectionId: string;
|
|
1361
|
+
} | undefined;
|
|
1362
|
+
multiReference?: {
|
|
1363
|
+
referencedCollectionId: string;
|
|
1364
|
+
referencingFieldKey: string;
|
|
1365
|
+
referencingDisplayName: string;
|
|
1366
|
+
} | undefined;
|
|
1367
|
+
object?: {
|
|
1368
|
+
fields: {
|
|
1369
|
+
key: string;
|
|
1370
|
+
type: Type;
|
|
1371
|
+
capabilities?: {
|
|
1372
|
+
sortable: boolean;
|
|
1373
|
+
queryOperators: QueryOperator[];
|
|
1374
|
+
} | undefined;
|
|
1375
|
+
}[];
|
|
1376
|
+
} | undefined;
|
|
1377
|
+
array?: {
|
|
1378
|
+
elementType: Type;
|
|
1379
|
+
} | undefined;
|
|
1380
|
+
pageLink?: {
|
|
1381
|
+
calculator?: {
|
|
1382
|
+
fieldsPattern?: {
|
|
1383
|
+
pattern: string;
|
|
1384
|
+
lowercase: boolean;
|
|
1385
|
+
} | undefined;
|
|
1386
|
+
urlizedOnlyPattern?: {
|
|
1387
|
+
pattern: string;
|
|
1388
|
+
} | undefined;
|
|
1389
|
+
} | undefined;
|
|
1390
|
+
} | undefined;
|
|
1391
|
+
} | undefined;
|
|
1392
|
+
systemField: boolean;
|
|
1393
|
+
capabilities?: {
|
|
1394
|
+
sortable: boolean;
|
|
1395
|
+
queryOperators: QueryOperator[];
|
|
1396
|
+
} | undefined;
|
|
1397
|
+
encrypted: boolean;
|
|
1398
|
+
plugins: {
|
|
1399
|
+
cmsOptions?: {
|
|
1400
|
+
internal: boolean;
|
|
1401
|
+
} | undefined;
|
|
1402
|
+
type: FieldPluginType;
|
|
1403
|
+
}[];
|
|
1404
|
+
}[];
|
|
1405
|
+
permissions?: {
|
|
1406
|
+
insert: Role;
|
|
1407
|
+
update: Role;
|
|
1408
|
+
remove: Role;
|
|
1409
|
+
read: Role;
|
|
1410
|
+
} | undefined;
|
|
1411
|
+
plugins: {
|
|
1412
|
+
publishOptions?: {
|
|
1413
|
+
defaultStatus: Status$1;
|
|
1414
|
+
} | undefined;
|
|
1415
|
+
singleItemOptions?: {
|
|
1416
|
+
singleItemId: string;
|
|
1417
|
+
} | undefined;
|
|
1418
|
+
urlizedOptions?: {
|
|
1419
|
+
format: Format;
|
|
1420
|
+
} | undefined;
|
|
1421
|
+
multilingualOptions?: {
|
|
1422
|
+
translatableFieldKeys: string[];
|
|
1423
|
+
} | undefined;
|
|
1424
|
+
editablePageLinkOptions?: {
|
|
1425
|
+
isPersisted: boolean;
|
|
1426
|
+
isMutable: boolean;
|
|
1427
|
+
} | undefined;
|
|
1428
|
+
cmsOptions?: {
|
|
1429
|
+
siteSort?: {
|
|
1430
|
+
sort: {
|
|
1431
|
+
fieldKey: string;
|
|
1432
|
+
direction: Direction;
|
|
1433
|
+
}[];
|
|
1434
|
+
} | undefined;
|
|
1435
|
+
} | undefined;
|
|
1436
|
+
type: PluginType;
|
|
1437
|
+
}[];
|
|
1438
|
+
pagingModes: PagingMode[];
|
|
1439
|
+
}>;
|
|
1440
|
+
declare function listDataCollections$1(httpClient: HttpClient): (options?: ListDataCollectionsOptions) => Promise<ListDataCollectionsResponse & ListDataCollectionsResponseNonNullableFields>;
|
|
1441
|
+
declare function updateDataCollection$1(httpClient: HttpClient): (collection: DataCollection) => Promise<DataCollection & {
|
|
1442
|
+
_id: string;
|
|
1443
|
+
collectionType: CollectionType;
|
|
1444
|
+
defaultDisplayOrder?: {
|
|
1445
|
+
fieldKey: string;
|
|
1446
|
+
direction: Direction;
|
|
1447
|
+
} | undefined;
|
|
1448
|
+
capabilities?: {
|
|
1449
|
+
dataOperations: DataOperation[];
|
|
1450
|
+
collectionOperations: CollectionOperation[];
|
|
1451
|
+
indexLimits?: {
|
|
1452
|
+
regular: number;
|
|
1453
|
+
unique: number;
|
|
1454
|
+
total: number;
|
|
1455
|
+
} | undefined;
|
|
1456
|
+
} | undefined;
|
|
1457
|
+
fields: {
|
|
1458
|
+
key: string;
|
|
1459
|
+
type: Type;
|
|
1460
|
+
typeMetadata?: {
|
|
1461
|
+
reference?: {
|
|
1462
|
+
referencedCollectionId: string;
|
|
1463
|
+
} | undefined;
|
|
1464
|
+
multiReference?: {
|
|
1465
|
+
referencedCollectionId: string;
|
|
1466
|
+
referencingFieldKey: string;
|
|
1467
|
+
referencingDisplayName: string;
|
|
1468
|
+
} | undefined;
|
|
1469
|
+
object?: {
|
|
1470
|
+
fields: {
|
|
1471
|
+
key: string;
|
|
1472
|
+
type: Type;
|
|
1473
|
+
capabilities?: {
|
|
1474
|
+
sortable: boolean;
|
|
1475
|
+
queryOperators: QueryOperator[];
|
|
1476
|
+
} | undefined;
|
|
1477
|
+
}[];
|
|
1478
|
+
} | undefined;
|
|
1479
|
+
array?: {
|
|
1480
|
+
elementType: Type;
|
|
1481
|
+
} | undefined;
|
|
1482
|
+
pageLink?: {
|
|
1483
|
+
calculator?: {
|
|
1484
|
+
fieldsPattern?: {
|
|
1485
|
+
pattern: string;
|
|
1486
|
+
lowercase: boolean;
|
|
1487
|
+
} | undefined;
|
|
1488
|
+
urlizedOnlyPattern?: {
|
|
1489
|
+
pattern: string;
|
|
1490
|
+
} | undefined;
|
|
1491
|
+
} | undefined;
|
|
1492
|
+
} | undefined;
|
|
1493
|
+
} | undefined;
|
|
1494
|
+
systemField: boolean;
|
|
1495
|
+
capabilities?: {
|
|
1496
|
+
sortable: boolean;
|
|
1497
|
+
queryOperators: QueryOperator[];
|
|
1498
|
+
} | undefined;
|
|
1499
|
+
encrypted: boolean;
|
|
1500
|
+
plugins: {
|
|
1501
|
+
cmsOptions?: {
|
|
1502
|
+
internal: boolean;
|
|
1503
|
+
} | undefined;
|
|
1504
|
+
type: FieldPluginType;
|
|
1505
|
+
}[];
|
|
1506
|
+
}[];
|
|
1507
|
+
permissions?: {
|
|
1508
|
+
insert: Role;
|
|
1509
|
+
update: Role;
|
|
1510
|
+
remove: Role;
|
|
1511
|
+
read: Role;
|
|
1512
|
+
} | undefined;
|
|
1513
|
+
plugins: {
|
|
1514
|
+
publishOptions?: {
|
|
1515
|
+
defaultStatus: Status$1;
|
|
1516
|
+
} | undefined;
|
|
1517
|
+
singleItemOptions?: {
|
|
1518
|
+
singleItemId: string;
|
|
1519
|
+
} | undefined;
|
|
1520
|
+
urlizedOptions?: {
|
|
1521
|
+
format: Format;
|
|
1522
|
+
} | undefined;
|
|
1523
|
+
multilingualOptions?: {
|
|
1524
|
+
translatableFieldKeys: string[];
|
|
1525
|
+
} | undefined;
|
|
1526
|
+
editablePageLinkOptions?: {
|
|
1527
|
+
isPersisted: boolean;
|
|
1528
|
+
isMutable: boolean;
|
|
1529
|
+
} | undefined;
|
|
1530
|
+
cmsOptions?: {
|
|
1531
|
+
siteSort?: {
|
|
1532
|
+
sort: {
|
|
1533
|
+
fieldKey: string;
|
|
1534
|
+
direction: Direction;
|
|
1535
|
+
}[];
|
|
1536
|
+
} | undefined;
|
|
1537
|
+
} | undefined;
|
|
1538
|
+
type: PluginType;
|
|
1539
|
+
}[];
|
|
1540
|
+
pagingModes: PagingMode[];
|
|
1541
|
+
}>;
|
|
1542
|
+
declare function deleteDataCollection$1(httpClient: HttpClient): (dataCollectionId: string) => Promise<void>;
|
|
1543
|
+
declare const onDataCollectionClonedEvent$1: EventDefinition<DataCollectionClonedEnvelope, "wix.data.v2.data_collection_data_collection_cloned_event">;
|
|
1544
|
+
declare const onDataCollectionChangedEvent$1: EventDefinition<DataCollectionChangedEnvelope, "wix.data.v2.data_collection_data_collection_changed_event">;
|
|
1545
|
+
declare const onDataCollectionCreated$1: EventDefinition<DataCollectionCreatedEnvelope, "wix.data.v2.data_collection_created">;
|
|
1546
|
+
declare const onDataCollectionUpdated$1: EventDefinition<DataCollectionUpdatedEnvelope, "wix.data.v2.data_collection_updated">;
|
|
1547
|
+
declare const onDataCollectionDeleted$1: EventDefinition<DataCollectionDeletedEnvelope, "wix.data.v2.data_collection_deleted">;
|
|
1548
|
+
|
|
1549
|
+
declare const createDataCollection: BuildRESTFunction<typeof createDataCollection$1>;
|
|
1550
|
+
declare const getDataCollection: BuildRESTFunction<typeof getDataCollection$1>;
|
|
1551
|
+
declare const listDataCollections: BuildRESTFunction<typeof listDataCollections$1>;
|
|
1552
|
+
declare const updateDataCollection: BuildRESTFunction<typeof updateDataCollection$1>;
|
|
1553
|
+
declare const deleteDataCollection: BuildRESTFunction<typeof deleteDataCollection$1>;
|
|
1554
|
+
declare const onDataCollectionClonedEvent: BuildEventDefinition<typeof onDataCollectionClonedEvent$1>;
|
|
1555
|
+
declare const onDataCollectionChangedEvent: BuildEventDefinition<typeof onDataCollectionChangedEvent$1>;
|
|
1556
|
+
declare const onDataCollectionCreated: BuildEventDefinition<typeof onDataCollectionCreated$1>;
|
|
1557
|
+
declare const onDataCollectionUpdated: BuildEventDefinition<typeof onDataCollectionUpdated$1>;
|
|
1558
|
+
declare const onDataCollectionDeleted: BuildEventDefinition<typeof onDataCollectionDeleted$1>;
|
|
1559
|
+
|
|
1560
|
+
declare const context$2_createDataCollection: typeof createDataCollection;
|
|
1561
|
+
declare const context$2_deleteDataCollection: typeof deleteDataCollection;
|
|
1562
|
+
declare const context$2_getDataCollection: typeof getDataCollection;
|
|
1563
|
+
declare const context$2_listDataCollections: typeof listDataCollections;
|
|
1564
|
+
declare const context$2_onDataCollectionChangedEvent: typeof onDataCollectionChangedEvent;
|
|
1565
|
+
declare const context$2_onDataCollectionClonedEvent: typeof onDataCollectionClonedEvent;
|
|
1566
|
+
declare const context$2_onDataCollectionCreated: typeof onDataCollectionCreated;
|
|
1567
|
+
declare const context$2_onDataCollectionDeleted: typeof onDataCollectionDeleted;
|
|
1568
|
+
declare const context$2_onDataCollectionUpdated: typeof onDataCollectionUpdated;
|
|
1569
|
+
declare const context$2_updateDataCollection: typeof updateDataCollection;
|
|
1570
|
+
declare namespace context$2 {
|
|
1571
|
+
export { context$2_createDataCollection as createDataCollection, context$2_deleteDataCollection as deleteDataCollection, context$2_getDataCollection as getDataCollection, context$2_listDataCollections as listDataCollections, context$2_onDataCollectionChangedEvent as onDataCollectionChangedEvent, context$2_onDataCollectionClonedEvent as onDataCollectionClonedEvent, context$2_onDataCollectionCreated as onDataCollectionCreated, context$2_onDataCollectionDeleted as onDataCollectionDeleted, context$2_onDataCollectionUpdated as onDataCollectionUpdated, context$2_updateDataCollection as updateDataCollection };
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
interface DataItem {
|
|
1575
|
+
/** Data item ID. */
|
|
1576
|
+
_id?: string;
|
|
1577
|
+
/**
|
|
1578
|
+
* ID of the collection this item belongs to
|
|
1579
|
+
* @readonly
|
|
1580
|
+
*/
|
|
1581
|
+
dataCollectionId?: string;
|
|
1582
|
+
/**
|
|
1583
|
+
* Data item contents.
|
|
1584
|
+
*
|
|
1585
|
+
* Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
|
|
1586
|
+
*
|
|
1587
|
+
* + `_id`: Item ID.
|
|
1588
|
+
* + `_createdDate`: Date and time the item was added to the collection.
|
|
1589
|
+
* + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
|
|
1590
|
+
* + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
|
|
1591
|
+
*/
|
|
1592
|
+
data?: Record<string, any> | null;
|
|
1593
|
+
}
|
|
1594
|
+
interface InsertDataItemResponse {
|
|
1595
|
+
/** Inserted data item. */
|
|
1596
|
+
dataItem?: DataItem;
|
|
1597
|
+
}
|
|
1598
|
+
interface BulkDataItemResult {
|
|
1599
|
+
/**
|
|
1600
|
+
* The action attempted for the data item.
|
|
1601
|
+
*
|
|
1602
|
+
* Supported values: `UNKNOWN_ACTION_TYPE`, `INSERT`, `UPDATE`, `DELETE`.
|
|
1603
|
+
*/
|
|
1604
|
+
action?: BulkActionType;
|
|
1605
|
+
/** Metadata related to the data item for which the action was attempted. */
|
|
1606
|
+
itemMetadata?: ItemMetadata;
|
|
1607
|
+
/** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
|
|
1608
|
+
dataItem?: DataItem;
|
|
1609
|
+
}
|
|
1610
|
+
declare enum BulkActionType {
|
|
1611
|
+
UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
|
|
1612
|
+
INSERT = "INSERT",
|
|
1613
|
+
UPDATE = "UPDATE",
|
|
1614
|
+
DELETE = "DELETE",
|
|
1615
|
+
PATCH = "PATCH"
|
|
1616
|
+
}
|
|
1617
|
+
interface ItemMetadata {
|
|
1618
|
+
/** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */
|
|
1619
|
+
_id?: string | null;
|
|
1620
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
1621
|
+
originalIndex?: number;
|
|
1622
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
1623
|
+
success?: boolean;
|
|
1624
|
+
/** Details about the error in case of failure. */
|
|
1625
|
+
error?: ApplicationError;
|
|
1626
|
+
}
|
|
1627
|
+
interface ApplicationError {
|
|
1628
|
+
/** Error code. */
|
|
1629
|
+
code?: string;
|
|
1630
|
+
/** Description of the error. */
|
|
1631
|
+
description?: string;
|
|
1632
|
+
/** Data related to the error. */
|
|
1633
|
+
data?: Record<string, any> | null;
|
|
1634
|
+
}
|
|
1635
|
+
interface BulkActionMetadata {
|
|
1636
|
+
/** Number of items successfully processed. */
|
|
1637
|
+
totalSuccesses?: number;
|
|
1638
|
+
/** Number of items that couldn't be processed. */
|
|
1639
|
+
totalFailures?: number;
|
|
1640
|
+
}
|
|
1641
|
+
interface UpdateDataItemResponse {
|
|
1642
|
+
/** Updated data item. */
|
|
1643
|
+
dataItem?: DataItem;
|
|
1644
|
+
}
|
|
1645
|
+
interface SaveDataItemResponse {
|
|
1646
|
+
/**
|
|
1647
|
+
* The action carried out for the item.
|
|
1648
|
+
*
|
|
1649
|
+
* + `INSERTED`: A new item was added to the collection.
|
|
1650
|
+
* + `UPDATED`: An existing item in the collection was updated.
|
|
1651
|
+
*/
|
|
1652
|
+
action?: Action;
|
|
1653
|
+
/** Inserted or updated data item. */
|
|
1654
|
+
dataItem?: DataItem;
|
|
1655
|
+
}
|
|
1656
|
+
declare enum Action {
|
|
1657
|
+
UNKNOWN_ACTION = "UNKNOWN_ACTION",
|
|
1658
|
+
INSERTED = "INSERTED",
|
|
1659
|
+
UPDATED = "UPDATED"
|
|
1660
|
+
}
|
|
1661
|
+
interface RemoveDataItemResponse {
|
|
1662
|
+
/** Removed item. */
|
|
1663
|
+
dataItem?: DataItem;
|
|
1664
|
+
}
|
|
1665
|
+
interface Sorting {
|
|
1666
|
+
/** Name of the field to sort by. */
|
|
1667
|
+
fieldName?: string;
|
|
1668
|
+
/**
|
|
1669
|
+
* Sort order.
|
|
1670
|
+
*
|
|
1671
|
+
* Supported values: `ASC`, `DESC`.
|
|
1672
|
+
*/
|
|
1673
|
+
order?: SortOrder;
|
|
1674
|
+
}
|
|
1675
|
+
declare enum SortOrder {
|
|
1676
|
+
ASC = "ASC",
|
|
1677
|
+
DESC = "DESC"
|
|
1678
|
+
}
|
|
1679
|
+
interface Paging$1 {
|
|
1680
|
+
/** Number of items to load. */
|
|
1681
|
+
limit?: number | null;
|
|
1682
|
+
/** Number of items to skip in the current sort order. */
|
|
1683
|
+
offset?: number | null;
|
|
1684
|
+
}
|
|
1685
|
+
interface CursorPaging {
|
|
1686
|
+
/** Number of items to load. */
|
|
1687
|
+
limit?: number | null;
|
|
1688
|
+
/**
|
|
1689
|
+
* Pointer to the next or previous page in the list of results.
|
|
1690
|
+
*
|
|
1691
|
+
* You can get the relevant cursor token
|
|
1692
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
1693
|
+
* Not relevant for the first request.
|
|
1694
|
+
*/
|
|
1695
|
+
cursor?: string | null;
|
|
1696
|
+
}
|
|
1697
|
+
interface PagingMetadataV2 {
|
|
1698
|
+
/** Number of items returned in the response. */
|
|
1699
|
+
count?: number | null;
|
|
1700
|
+
/** Offset that was requested. */
|
|
1701
|
+
offset?: number | null;
|
|
1702
|
+
/** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */
|
|
1703
|
+
total?: number | null;
|
|
1704
|
+
/** Whether the server failed to calculate the `total` field. */
|
|
1705
|
+
tooManyToCount?: boolean | null;
|
|
1706
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
1707
|
+
cursors?: Cursors;
|
|
1708
|
+
}
|
|
1709
|
+
interface Cursors {
|
|
1710
|
+
/** Cursor pointing to next page in the list of results. */
|
|
1711
|
+
next?: string | null;
|
|
1712
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
1713
|
+
prev?: string | null;
|
|
1714
|
+
}
|
|
1715
|
+
/** @oneof */
|
|
1716
|
+
interface AggregateDataItemsRequestPagingMethodOneOf {
|
|
1717
|
+
/** Paging options to limit and skip the number of items. */
|
|
1718
|
+
paging?: Paging$1;
|
|
1719
|
+
/** 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`. */
|
|
1720
|
+
cursorPaging?: CursorPaging;
|
|
1721
|
+
}
|
|
1722
|
+
interface Average {
|
|
1723
|
+
/** Name of the field for which to calculate the average value. */
|
|
1724
|
+
itemFieldName?: string;
|
|
1725
|
+
}
|
|
1726
|
+
interface Min {
|
|
1727
|
+
/** Name of the field for which to calculate the minimum value. */
|
|
1728
|
+
itemFieldName?: string;
|
|
1729
|
+
}
|
|
1730
|
+
interface Max {
|
|
1731
|
+
/** Name of the field for which to calculate the maximum value. */
|
|
1732
|
+
itemFieldName?: string;
|
|
1733
|
+
}
|
|
1734
|
+
interface Sum {
|
|
1735
|
+
/** Name of the field for which to calculate the sum. */
|
|
1736
|
+
itemFieldName?: string;
|
|
1737
|
+
}
|
|
1738
|
+
interface Count {
|
|
1739
|
+
}
|
|
1740
|
+
interface Operation extends OperationCalculateOneOf {
|
|
1741
|
+
/** Calculate the average value of a specified field for all items in the grouping. */
|
|
1742
|
+
average?: Average;
|
|
1743
|
+
/** Calculate the minimum value of a specified field for all items in the grouping. */
|
|
1744
|
+
min?: Min;
|
|
1745
|
+
/** Calculate the maximum value of a specified field for all items in the grouping. */
|
|
1746
|
+
max?: Max;
|
|
1747
|
+
/** Calculate the sum of values of a specified field for all items in the grouping. */
|
|
1748
|
+
sum?: Sum;
|
|
1749
|
+
/** Calculate the number of items in the grouping. */
|
|
1750
|
+
itemCount?: Count;
|
|
1751
|
+
/** Name of the field containing results of the operation. */
|
|
1752
|
+
resultFieldName?: string;
|
|
1753
|
+
}
|
|
1754
|
+
/** @oneof */
|
|
1755
|
+
interface OperationCalculateOneOf {
|
|
1756
|
+
/** Calculate the average value of a specified field for all items in the grouping. */
|
|
1757
|
+
average?: Average;
|
|
1758
|
+
/** Calculate the minimum value of a specified field for all items in the grouping. */
|
|
1759
|
+
min?: Min;
|
|
1760
|
+
/** Calculate the maximum value of a specified field for all items in the grouping. */
|
|
1761
|
+
max?: Max;
|
|
1762
|
+
/** Calculate the sum of values of a specified field for all items in the grouping. */
|
|
1763
|
+
sum?: Sum;
|
|
1764
|
+
/** Calculate the number of items in the grouping. */
|
|
1765
|
+
itemCount?: Count;
|
|
1766
|
+
}
|
|
1767
|
+
interface Aggregation {
|
|
1768
|
+
/** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */
|
|
1769
|
+
groupingFields?: string[];
|
|
1770
|
+
/** Operations to carry out on the data in each grouping. */
|
|
1771
|
+
operations?: Operation[];
|
|
1772
|
+
}
|
|
1773
|
+
interface AggregateDataItemsResponse {
|
|
1774
|
+
/** Aggregation results. */
|
|
1775
|
+
results?: Record<string, any>[] | null;
|
|
1776
|
+
/** Paging information. */
|
|
1777
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1778
|
+
}
|
|
1779
|
+
interface CountDataItemsResponse {
|
|
1780
|
+
/** Number of items matching the query. */
|
|
1781
|
+
totalCount?: number;
|
|
1782
|
+
}
|
|
1783
|
+
/** @oneof */
|
|
1784
|
+
interface QueryDistinctValuesRequestPagingMethodOneOf {
|
|
1785
|
+
/** Paging options to limit and skip the number of items. */
|
|
1786
|
+
paging?: Paging$1;
|
|
1787
|
+
/** 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`. */
|
|
1788
|
+
cursorPaging?: CursorPaging;
|
|
1789
|
+
}
|
|
1790
|
+
interface QueryDistinctValuesResponse {
|
|
1791
|
+
/** List of distinct values contained in the field specified in `fieldName`. */
|
|
1792
|
+
distinctValues?: any[];
|
|
1793
|
+
/** Paging information. */
|
|
1794
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1795
|
+
}
|
|
1796
|
+
interface BulkInsertDataItemsResponse {
|
|
1797
|
+
/** Information about the inserted items. */
|
|
1798
|
+
results?: BulkDataItemResult[];
|
|
1799
|
+
/** Bulk action metadata. */
|
|
1800
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1801
|
+
}
|
|
1802
|
+
interface BulkUpdateDataItemsResponse {
|
|
1803
|
+
/** Information about the updated items. */
|
|
1804
|
+
results?: BulkDataItemResult[];
|
|
1805
|
+
/** Bulk action metadata. */
|
|
1806
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1807
|
+
}
|
|
1808
|
+
interface BulkSaveDataItemsResponse {
|
|
1809
|
+
/** Information about the saved items. */
|
|
1810
|
+
results?: BulkDataItemResult[];
|
|
1811
|
+
/** Bulk action metadata. */
|
|
1812
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1813
|
+
}
|
|
1814
|
+
interface BulkRemoveDataItemsResponse {
|
|
1815
|
+
/** Information about the removed data items. */
|
|
1816
|
+
results?: BulkDataItemResult[];
|
|
1817
|
+
/** Bulk action metadata. */
|
|
1818
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1819
|
+
}
|
|
1820
|
+
/** @oneof */
|
|
1821
|
+
interface QueryReferencedDataItemsRequestPagingMethodOneOf {
|
|
1822
|
+
/** Paging options to limit and skip the number of items. */
|
|
1823
|
+
paging?: Paging$1;
|
|
1824
|
+
/** 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`. */
|
|
1825
|
+
cursorPaging?: CursorPaging;
|
|
1826
|
+
}
|
|
1827
|
+
interface QueryReferencedDataItemsResponse {
|
|
1828
|
+
/** 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. */
|
|
1829
|
+
results?: ReferencedResult[];
|
|
1830
|
+
/** Paging information. */
|
|
1831
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1832
|
+
}
|
|
1833
|
+
interface UnresolvedReference {
|
|
1834
|
+
/** ID of the referring item. */
|
|
1835
|
+
referringItemId?: string;
|
|
1836
|
+
/** Field specified to query for references. */
|
|
1837
|
+
referringItemFieldName?: string;
|
|
1838
|
+
}
|
|
1839
|
+
interface ReferencedResult extends ReferencedResultEntityOneOf {
|
|
1840
|
+
/** Data item referenced. */
|
|
1841
|
+
dataItem?: DataItem;
|
|
1842
|
+
/** 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. */
|
|
1843
|
+
unresolvedReference?: UnresolvedReference;
|
|
1844
|
+
}
|
|
1845
|
+
/** @oneof */
|
|
1846
|
+
interface ReferencedResultEntityOneOf {
|
|
1847
|
+
/** Data item referenced. */
|
|
1848
|
+
dataItem?: DataItem;
|
|
1849
|
+
/** 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. */
|
|
1850
|
+
unresolvedReference?: UnresolvedReference;
|
|
1851
|
+
}
|
|
1852
|
+
interface IsReferencedDataItemResponse {
|
|
1853
|
+
/** Whether the specified reference exists. */
|
|
1854
|
+
isReferenced?: boolean;
|
|
1855
|
+
}
|
|
1856
|
+
interface DataItemReference {
|
|
1857
|
+
/** Referring item field containing the references to the referenced items. */
|
|
1858
|
+
referringItemFieldName?: string;
|
|
1859
|
+
/** ID of the referring item. */
|
|
1860
|
+
referringItemId?: string;
|
|
1861
|
+
/** ID of the referenced item. */
|
|
1862
|
+
referencedItemId?: string;
|
|
1863
|
+
}
|
|
1864
|
+
interface InsertDataItemReferenceResponse {
|
|
1865
|
+
/** Inserted reference. */
|
|
1866
|
+
dataItemReference?: DataItemReference;
|
|
1867
|
+
}
|
|
1868
|
+
interface RemoveDataItemReferenceResponse {
|
|
1869
|
+
/** Removed reference. */
|
|
1870
|
+
dataItemReference?: DataItemReference;
|
|
1871
|
+
}
|
|
1872
|
+
interface BulkInsertDataItemReferencesResponse {
|
|
1873
|
+
/** Information about the inserted references. */
|
|
1874
|
+
results?: BulkDataItemReferenceResult[];
|
|
1875
|
+
/** Bulk action metadata. */
|
|
1876
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1877
|
+
}
|
|
1878
|
+
interface BulkDataItemReferenceResult {
|
|
1879
|
+
/**
|
|
1880
|
+
* The action attempted for the reference.
|
|
1881
|
+
*
|
|
1882
|
+
* Supported values: `UNKNOWN_ACTION_TYPE`, `INSERT`, `UPDATE`, `DELETE`.
|
|
1883
|
+
*/
|
|
1884
|
+
action?: BulkActionType;
|
|
1885
|
+
/** Metadata related to the reference for which the action was attempted. */
|
|
1886
|
+
referenceMetadata?: ItemMetadata;
|
|
1887
|
+
/** The reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
|
|
1888
|
+
dataItemReference?: DataItemReference;
|
|
1889
|
+
}
|
|
1890
|
+
interface BulkRemoveDataItemReferencesResponse {
|
|
1891
|
+
/** Information about the removed references. */
|
|
1892
|
+
results?: BulkDataItemReferenceResult[];
|
|
1893
|
+
/** Bulk action metadata. */
|
|
1894
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1895
|
+
}
|
|
1896
|
+
interface ReplaceDataItemReferencesResponse {
|
|
1897
|
+
/** Updated references. */
|
|
1898
|
+
dataItemReferences?: DataItemReference[];
|
|
1899
|
+
}
|
|
1900
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
1901
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1902
|
+
anonymousVisitorId?: string;
|
|
1903
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1904
|
+
memberId?: string;
|
|
1905
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1906
|
+
wixUserId?: string;
|
|
1907
|
+
/** ID of an app. */
|
|
1908
|
+
appId?: string;
|
|
1909
|
+
/** @readonly */
|
|
1910
|
+
identityType?: WebhookIdentityType;
|
|
1911
|
+
}
|
|
1912
|
+
/** @oneof */
|
|
1913
|
+
interface IdentificationDataIdOneOf {
|
|
1914
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1915
|
+
anonymousVisitorId?: string;
|
|
1916
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1917
|
+
memberId?: string;
|
|
1918
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1919
|
+
wixUserId?: string;
|
|
1920
|
+
/** ID of an app. */
|
|
1921
|
+
appId?: string;
|
|
1922
|
+
}
|
|
1923
|
+
declare enum WebhookIdentityType {
|
|
1924
|
+
UNKNOWN = "UNKNOWN",
|
|
1925
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1926
|
+
MEMBER = "MEMBER",
|
|
1927
|
+
WIX_USER = "WIX_USER",
|
|
1928
|
+
APP = "APP"
|
|
1929
|
+
}
|
|
1930
|
+
interface InsertDataItemResponseNonNullableFields {
|
|
1931
|
+
dataItem?: {
|
|
1932
|
+
_id: string;
|
|
1933
|
+
dataCollectionId: string;
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
interface UpdateDataItemResponseNonNullableFields {
|
|
1937
|
+
dataItem?: {
|
|
1938
|
+
_id: string;
|
|
1939
|
+
dataCollectionId: string;
|
|
1940
|
+
};
|
|
1941
|
+
}
|
|
1942
|
+
interface SaveDataItemResponseNonNullableFields {
|
|
1943
|
+
action: Action;
|
|
1944
|
+
dataItem?: {
|
|
1945
|
+
_id: string;
|
|
1946
|
+
dataCollectionId: string;
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
interface RemoveDataItemResponseNonNullableFields {
|
|
1950
|
+
dataItem?: {
|
|
1951
|
+
_id: string;
|
|
1952
|
+
dataCollectionId: string;
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
interface CountDataItemsResponseNonNullableFields {
|
|
1956
|
+
totalCount: number;
|
|
1957
|
+
}
|
|
1958
|
+
interface BulkInsertDataItemsResponseNonNullableFields {
|
|
1959
|
+
results: {
|
|
1960
|
+
action: BulkActionType;
|
|
1961
|
+
itemMetadata?: {
|
|
1962
|
+
originalIndex: number;
|
|
1963
|
+
success: boolean;
|
|
1964
|
+
error?: {
|
|
1965
|
+
code: string;
|
|
1966
|
+
description: string;
|
|
1967
|
+
};
|
|
1968
|
+
};
|
|
1969
|
+
dataItem?: {
|
|
1970
|
+
_id: string;
|
|
1971
|
+
dataCollectionId: string;
|
|
1972
|
+
};
|
|
1973
|
+
}[];
|
|
1974
|
+
bulkActionMetadata?: {
|
|
1975
|
+
totalSuccesses: number;
|
|
1976
|
+
totalFailures: number;
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
interface BulkUpdateDataItemsResponseNonNullableFields {
|
|
1980
|
+
results: {
|
|
1981
|
+
action: BulkActionType;
|
|
1982
|
+
itemMetadata?: {
|
|
1983
|
+
originalIndex: number;
|
|
1984
|
+
success: boolean;
|
|
1985
|
+
error?: {
|
|
1986
|
+
code: string;
|
|
1987
|
+
description: string;
|
|
1988
|
+
};
|
|
1989
|
+
};
|
|
1990
|
+
dataItem?: {
|
|
1991
|
+
_id: string;
|
|
1992
|
+
dataCollectionId: string;
|
|
1993
|
+
};
|
|
1994
|
+
}[];
|
|
1995
|
+
bulkActionMetadata?: {
|
|
1996
|
+
totalSuccesses: number;
|
|
1997
|
+
totalFailures: number;
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
interface BulkSaveDataItemsResponseNonNullableFields {
|
|
2001
|
+
results: {
|
|
2002
|
+
action: BulkActionType;
|
|
2003
|
+
itemMetadata?: {
|
|
2004
|
+
originalIndex: number;
|
|
2005
|
+
success: boolean;
|
|
2006
|
+
error?: {
|
|
2007
|
+
code: string;
|
|
2008
|
+
description: string;
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
dataItem?: {
|
|
2012
|
+
_id: string;
|
|
2013
|
+
dataCollectionId: string;
|
|
2014
|
+
};
|
|
2015
|
+
}[];
|
|
2016
|
+
bulkActionMetadata?: {
|
|
2017
|
+
totalSuccesses: number;
|
|
2018
|
+
totalFailures: number;
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
interface BulkRemoveDataItemsResponseNonNullableFields {
|
|
2022
|
+
results: {
|
|
2023
|
+
action: BulkActionType;
|
|
2024
|
+
itemMetadata?: {
|
|
2025
|
+
originalIndex: number;
|
|
2026
|
+
success: boolean;
|
|
2027
|
+
error?: {
|
|
2028
|
+
code: string;
|
|
2029
|
+
description: string;
|
|
2030
|
+
};
|
|
2031
|
+
};
|
|
2032
|
+
dataItem?: {
|
|
2033
|
+
_id: string;
|
|
2034
|
+
dataCollectionId: string;
|
|
2035
|
+
};
|
|
2036
|
+
}[];
|
|
2037
|
+
bulkActionMetadata?: {
|
|
2038
|
+
totalSuccesses: number;
|
|
2039
|
+
totalFailures: number;
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
interface QueryReferencedDataItemsResponseNonNullableFields {
|
|
2043
|
+
results: {
|
|
2044
|
+
dataItem?: {
|
|
2045
|
+
_id: string;
|
|
2046
|
+
dataCollectionId: string;
|
|
2047
|
+
};
|
|
2048
|
+
unresolvedReference?: {
|
|
2049
|
+
referringItemId: string;
|
|
2050
|
+
referringItemFieldName: string;
|
|
2051
|
+
};
|
|
2052
|
+
}[];
|
|
2053
|
+
}
|
|
2054
|
+
interface IsReferencedDataItemResponseNonNullableFields {
|
|
2055
|
+
isReferenced: boolean;
|
|
2056
|
+
}
|
|
2057
|
+
interface InsertDataItemReferenceResponseNonNullableFields {
|
|
2058
|
+
dataItemReference?: {
|
|
2059
|
+
referringItemFieldName: string;
|
|
2060
|
+
referringItemId: string;
|
|
2061
|
+
referencedItemId: string;
|
|
2062
|
+
};
|
|
2063
|
+
}
|
|
2064
|
+
interface RemoveDataItemReferenceResponseNonNullableFields {
|
|
2065
|
+
dataItemReference?: {
|
|
2066
|
+
referringItemFieldName: string;
|
|
2067
|
+
referringItemId: string;
|
|
2068
|
+
referencedItemId: string;
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
interface BulkInsertDataItemReferencesResponseNonNullableFields {
|
|
2072
|
+
results: {
|
|
2073
|
+
action: BulkActionType;
|
|
2074
|
+
referenceMetadata?: {
|
|
2075
|
+
originalIndex: number;
|
|
2076
|
+
success: boolean;
|
|
2077
|
+
error?: {
|
|
2078
|
+
code: string;
|
|
2079
|
+
description: string;
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
dataItemReference?: {
|
|
2083
|
+
referringItemFieldName: string;
|
|
2084
|
+
referringItemId: string;
|
|
2085
|
+
referencedItemId: string;
|
|
2086
|
+
};
|
|
2087
|
+
}[];
|
|
2088
|
+
bulkActionMetadata?: {
|
|
2089
|
+
totalSuccesses: number;
|
|
2090
|
+
totalFailures: number;
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
interface BulkRemoveDataItemReferencesResponseNonNullableFields {
|
|
2094
|
+
results: {
|
|
2095
|
+
action: BulkActionType;
|
|
2096
|
+
referenceMetadata?: {
|
|
2097
|
+
originalIndex: number;
|
|
2098
|
+
success: boolean;
|
|
2099
|
+
error?: {
|
|
2100
|
+
code: string;
|
|
2101
|
+
description: string;
|
|
2102
|
+
};
|
|
2103
|
+
};
|
|
2104
|
+
dataItemReference?: {
|
|
2105
|
+
referringItemFieldName: string;
|
|
2106
|
+
referringItemId: string;
|
|
2107
|
+
referencedItemId: string;
|
|
2108
|
+
};
|
|
2109
|
+
}[];
|
|
2110
|
+
bulkActionMetadata?: {
|
|
2111
|
+
totalSuccesses: number;
|
|
2112
|
+
totalFailures: number;
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
interface ReplaceDataItemReferencesResponseNonNullableFields {
|
|
2116
|
+
dataItemReferences: {
|
|
2117
|
+
referringItemFieldName: string;
|
|
2118
|
+
referringItemId: string;
|
|
2119
|
+
referencedItemId: string;
|
|
2120
|
+
}[];
|
|
2121
|
+
}
|
|
2122
|
+
interface BaseEventMetadata {
|
|
2123
|
+
/** App instance ID. */
|
|
2124
|
+
instanceId?: string | null;
|
|
2125
|
+
/** Event type. */
|
|
2126
|
+
eventType?: string;
|
|
2127
|
+
/** The identification type and identity data. */
|
|
2128
|
+
identity?: IdentificationData;
|
|
2129
|
+
}
|
|
2130
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
2131
|
+
/**
|
|
2132
|
+
* Unique event ID.
|
|
2133
|
+
* Allows clients to ignore duplicate webhooks.
|
|
2134
|
+
*/
|
|
2135
|
+
_id?: string;
|
|
2136
|
+
/**
|
|
2137
|
+
* Assumes actions are also always typed to an entity_type
|
|
2138
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
2139
|
+
*/
|
|
2140
|
+
entityFqdn?: string;
|
|
2141
|
+
/**
|
|
2142
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
2143
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
2144
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
2145
|
+
*/
|
|
2146
|
+
slug?: string;
|
|
2147
|
+
/** ID of the entity associated with the event. */
|
|
2148
|
+
entityId?: string;
|
|
2149
|
+
/** Event timestamp. */
|
|
2150
|
+
eventTime?: Date;
|
|
2151
|
+
/**
|
|
2152
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
2153
|
+
* (for example, GDPR).
|
|
2154
|
+
*/
|
|
2155
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
2156
|
+
/** If present, indicates the action that triggered the event. */
|
|
2157
|
+
originatedFrom?: string | null;
|
|
2158
|
+
/**
|
|
2159
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
2160
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
2161
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
2162
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
2163
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
2164
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
2165
|
+
*/
|
|
2166
|
+
entityEventSequence?: string | null;
|
|
2167
|
+
}
|
|
2168
|
+
interface DataItemCreatedEnvelope {
|
|
2169
|
+
entity: DataItem;
|
|
2170
|
+
metadata: EventMetadata;
|
|
2171
|
+
}
|
|
2172
|
+
interface DataItemUpdatedEnvelope {
|
|
2173
|
+
entity: DataItem;
|
|
2174
|
+
metadata: EventMetadata;
|
|
2175
|
+
}
|
|
2176
|
+
interface DataItemDeletedEnvelope {
|
|
2177
|
+
metadata: EventMetadata;
|
|
2178
|
+
}
|
|
2179
|
+
interface InsertDataItemOptions {
|
|
2180
|
+
/** ID of the collection in which to insert the item. */
|
|
2181
|
+
dataCollectionId: string;
|
|
2182
|
+
/** Item to insert. */
|
|
2183
|
+
dataItem: DataItem;
|
|
2184
|
+
}
|
|
2185
|
+
interface UpdateDataItemOptions {
|
|
2186
|
+
/** Updated data item content. The existing data item's content is replaced entirely. */
|
|
2187
|
+
dataItem: {
|
|
2188
|
+
/** Data item ID. */
|
|
2189
|
+
_id?: string;
|
|
2190
|
+
/**
|
|
2191
|
+
* ID of the collection this item belongs to
|
|
2192
|
+
* @readonly
|
|
2193
|
+
*/
|
|
2194
|
+
dataCollectionId?: string;
|
|
2195
|
+
/**
|
|
2196
|
+
* Data item contents.
|
|
2197
|
+
*
|
|
2198
|
+
* Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
|
|
2199
|
+
*
|
|
2200
|
+
* + `_id`: Item ID.
|
|
2201
|
+
* + `_createdDate`: Date and time the item was added to the collection.
|
|
2202
|
+
* + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
|
|
2203
|
+
* + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
|
|
2204
|
+
*/
|
|
2205
|
+
data?: Record<string, any> | null;
|
|
2206
|
+
};
|
|
2207
|
+
/** ID of the collection containing the existing item. */
|
|
2208
|
+
dataCollectionId: string;
|
|
2209
|
+
}
|
|
2210
|
+
interface SaveDataItemOptions {
|
|
2211
|
+
/** ID of the collection in which to insert or update the item. */
|
|
2212
|
+
dataCollectionId: string;
|
|
2213
|
+
/** Data item to insert or update. */
|
|
2214
|
+
dataItem: DataItem;
|
|
2215
|
+
}
|
|
2216
|
+
interface GetDataItemOptions {
|
|
2217
|
+
/** ID of the collection from which to retrieve the data item. */
|
|
2218
|
+
dataCollectionId: string;
|
|
2219
|
+
/**
|
|
2220
|
+
* Whether to retrieve data from the primary database instance.
|
|
2221
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2222
|
+
*
|
|
2223
|
+
* Default: `false`
|
|
2224
|
+
*/
|
|
2225
|
+
consistentRead?: boolean;
|
|
2226
|
+
/**
|
|
2227
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2228
|
+
* If provided, the result text is returned in the specified language.
|
|
2229
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
2230
|
+
*
|
|
2231
|
+
* If not provided, result text is not translated.
|
|
2232
|
+
*/
|
|
2233
|
+
language?: string | null;
|
|
2234
|
+
/**
|
|
2235
|
+
* 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.
|
|
2236
|
+
* **Note:** The `_id` system field is always returned.
|
|
2237
|
+
*/
|
|
2238
|
+
fields?: string[];
|
|
2239
|
+
}
|
|
2240
|
+
interface RemoveDataItemOptions {
|
|
2241
|
+
/** ID of the collection from which to remove the item. */
|
|
2242
|
+
dataCollectionId: string;
|
|
2243
|
+
}
|
|
2244
|
+
interface TruncateDataItemsOptions {
|
|
2245
|
+
/** ID of the collection to truncate. */
|
|
2246
|
+
dataCollectionId: string;
|
|
2247
|
+
}
|
|
2248
|
+
interface QueryDataItemsOptions {
|
|
2249
|
+
/** ID of the collection to query. */
|
|
2250
|
+
dataCollectionId: string;
|
|
2251
|
+
/**
|
|
2252
|
+
* Whether to return the total count in the response for a query with offset paging.
|
|
2253
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
2254
|
+
*
|
|
2255
|
+
* Default: `false`
|
|
2256
|
+
*/
|
|
2257
|
+
returnTotalCount?: boolean | undefined;
|
|
2258
|
+
/**
|
|
2259
|
+
* Properties for which to include referenced items in the query's results.
|
|
2260
|
+
* Up to 50 referenced items can be included for each item that matches the query.
|
|
2261
|
+
*/
|
|
2262
|
+
includeReferencedItems?: string[] | undefined;
|
|
2263
|
+
/**
|
|
2264
|
+
* Whether to retrieve data from the primary database instance.
|
|
2265
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2266
|
+
*
|
|
2267
|
+
* Default: `false`
|
|
2268
|
+
*/
|
|
2269
|
+
consistentRead?: boolean | undefined;
|
|
2270
|
+
/**
|
|
2271
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2272
|
+
* If provided, the result text is returned in the specified language.
|
|
2273
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
2274
|
+
*
|
|
2275
|
+
* If not provided, result text is not translated.
|
|
2276
|
+
*/
|
|
2277
|
+
language?: string | null | undefined;
|
|
2278
|
+
}
|
|
2279
|
+
interface QueryOffsetResult {
|
|
2280
|
+
currentPage: number | undefined;
|
|
2281
|
+
totalPages: number | undefined;
|
|
2282
|
+
totalCount: number | undefined;
|
|
2283
|
+
hasNext: () => boolean;
|
|
2284
|
+
hasPrev: () => boolean;
|
|
2285
|
+
length: number;
|
|
2286
|
+
pageSize: number;
|
|
2287
|
+
}
|
|
2288
|
+
interface DataItemsQueryResult extends QueryOffsetResult {
|
|
2289
|
+
items: DataItem[];
|
|
2290
|
+
query: DataItemsQueryBuilder;
|
|
2291
|
+
next: () => Promise<DataItemsQueryResult>;
|
|
2292
|
+
prev: () => Promise<DataItemsQueryResult>;
|
|
2293
|
+
}
|
|
2294
|
+
interface DataItemsQueryBuilder {
|
|
2295
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2296
|
+
* @param value - Value to compare against.
|
|
2297
|
+
* @documentationMaturity preview
|
|
2298
|
+
*/
|
|
2299
|
+
eq: (propertyName: '_id' | 'dataCollectionId' | 'data' | string, value: any) => DataItemsQueryBuilder;
|
|
2300
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2301
|
+
* @param value - Value to compare against.
|
|
2302
|
+
* @documentationMaturity preview
|
|
2303
|
+
*/
|
|
2304
|
+
ne: (propertyName: '_id' | 'dataCollectionId' | 'data' | string, value: any) => DataItemsQueryBuilder;
|
|
2305
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
2306
|
+
* @param string - String to compare against. Case-insensitive.
|
|
2307
|
+
* @documentationMaturity preview
|
|
2308
|
+
*/
|
|
2309
|
+
startsWith: (propertyName: '_id' | 'dataCollectionId' | string, value: string) => DataItemsQueryBuilder;
|
|
2310
|
+
/** @documentationMaturity preview */
|
|
2311
|
+
in: (propertyName: '_id' | 'dataCollectionId' | 'data' | string, value: any) => DataItemsQueryBuilder;
|
|
2312
|
+
/** @documentationMaturity preview */
|
|
2313
|
+
exists: (propertyName: '_id' | 'dataCollectionId' | 'data' | string, value: boolean) => DataItemsQueryBuilder;
|
|
2314
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
2315
|
+
* @documentationMaturity preview
|
|
2316
|
+
*/
|
|
2317
|
+
ascending: (...propertyNames: Array<'_id' | 'dataCollectionId' | 'data' | string>) => DataItemsQueryBuilder;
|
|
2318
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
2319
|
+
* @documentationMaturity preview
|
|
2320
|
+
*/
|
|
2321
|
+
descending: (...propertyNames: Array<'_id' | 'dataCollectionId' | 'data' | string>) => DataItemsQueryBuilder;
|
|
2322
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
2323
|
+
* @documentationMaturity preview
|
|
2324
|
+
*/
|
|
2325
|
+
limit: (limit: number) => DataItemsQueryBuilder;
|
|
2326
|
+
/** @param skip - Number of items to skip in the query results before returning the results.
|
|
2327
|
+
* @documentationMaturity preview
|
|
2328
|
+
*/
|
|
2329
|
+
skip: (skip: number) => DataItemsQueryBuilder;
|
|
2330
|
+
/** @documentationMaturity preview */
|
|
2331
|
+
find: () => Promise<DataItemsQueryResult>;
|
|
2332
|
+
}
|
|
2333
|
+
interface AggregateDataItemsOptions extends AggregateDataItemsRequestPagingMethodOneOf {
|
|
2334
|
+
/** ID of the collection on which to run the aggregation. */
|
|
2335
|
+
dataCollectionId: string;
|
|
2336
|
+
/** 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. */
|
|
2337
|
+
initialFilter?: Record<string, any> | null;
|
|
2338
|
+
/** Aggregation applied to the data. */
|
|
2339
|
+
aggregation?: Aggregation;
|
|
2340
|
+
/** 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. */
|
|
2341
|
+
finalFilter?: Record<string, any> | null;
|
|
2342
|
+
/** Paging options to limit and skip the number of items. */
|
|
2343
|
+
paging?: Paging$1;
|
|
2344
|
+
/** 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`. */
|
|
2345
|
+
cursorPaging?: CursorPaging;
|
|
2346
|
+
/**
|
|
2347
|
+
* Sort object in the following format:
|
|
2348
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
2349
|
+
*/
|
|
2350
|
+
sort?: Sorting[];
|
|
2351
|
+
/**
|
|
2352
|
+
* Whether to return the total count in the response for a query with offset paging.
|
|
2353
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
2354
|
+
*
|
|
2355
|
+
* Default: `false`
|
|
2356
|
+
*/
|
|
2357
|
+
returnTotalCount?: boolean;
|
|
2358
|
+
/**
|
|
2359
|
+
* Whether to retrieve data from the primary database instance.
|
|
2360
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2361
|
+
*
|
|
2362
|
+
* Default: `false`
|
|
2363
|
+
*/
|
|
2364
|
+
consistentRead?: boolean;
|
|
2365
|
+
/**
|
|
2366
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2367
|
+
* If provided, the result text is returned in the specified language.
|
|
2368
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
2369
|
+
*
|
|
2370
|
+
* If not provided, result text is not translated.
|
|
2371
|
+
*/
|
|
2372
|
+
language?: string | null;
|
|
2373
|
+
}
|
|
2374
|
+
interface CountDataItemsOptions {
|
|
2375
|
+
/** ID of the collection for which to count query results. */
|
|
2376
|
+
dataCollectionId: string;
|
|
2377
|
+
/**
|
|
2378
|
+
* Filter object in the following format:
|
|
2379
|
+
*
|
|
2380
|
+
* `"filter" : {
|
|
2381
|
+
* "fieldName1": "value1",
|
|
2382
|
+
* "fieldName2":{"$operator":"value2"}
|
|
2383
|
+
* }`.
|
|
2384
|
+
*
|
|
2385
|
+
* Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
|
|
2386
|
+
*/
|
|
2387
|
+
filter?: Record<string, any> | null;
|
|
2388
|
+
/**
|
|
2389
|
+
* Whether to retrieve data from the primary database instance.
|
|
2390
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2391
|
+
*
|
|
2392
|
+
* Default: `false`
|
|
2393
|
+
*/
|
|
2394
|
+
consistentRead?: boolean;
|
|
2395
|
+
/**
|
|
2396
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2397
|
+
* If provided, the result text is returned in the specified language.
|
|
2398
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
2399
|
+
*
|
|
2400
|
+
* If not provided, result text is not translated.
|
|
2401
|
+
*/
|
|
2402
|
+
language?: string | null;
|
|
2403
|
+
}
|
|
2404
|
+
interface QueryDistinctValuesOptions extends QueryDistinctValuesRequestPagingMethodOneOf {
|
|
2405
|
+
/** ID of the collection to query. */
|
|
2406
|
+
dataCollectionId: string;
|
|
2407
|
+
/** Item field name for which to return all distinct values. */
|
|
2408
|
+
fieldName?: string;
|
|
2409
|
+
/**
|
|
2410
|
+
* Filter object in the following format:
|
|
2411
|
+
*
|
|
2412
|
+
* `"filter" : {
|
|
2413
|
+
* "fieldName1": "value1",
|
|
2414
|
+
* "fieldName2":{"$operator":"value2"}
|
|
2415
|
+
* }`.
|
|
2416
|
+
*
|
|
2417
|
+
* Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
|
|
2418
|
+
*/
|
|
2419
|
+
filter?: Record<string, any> | null;
|
|
2420
|
+
/**
|
|
2421
|
+
* Sort order.
|
|
2422
|
+
*
|
|
2423
|
+
* Supported values: `ASC`, `DESC`.
|
|
2424
|
+
*/
|
|
2425
|
+
order?: SortOrder;
|
|
2426
|
+
/** Paging options to limit and skip the number of items. */
|
|
2427
|
+
paging?: Paging$1;
|
|
2428
|
+
/** 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`. */
|
|
2429
|
+
cursorPaging?: CursorPaging;
|
|
2430
|
+
/**
|
|
2431
|
+
* Whether to return the total count in the response for a query with offset paging.
|
|
2432
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
2433
|
+
*
|
|
2434
|
+
* Default: `false`
|
|
2435
|
+
*/
|
|
2436
|
+
returnTotalCount?: boolean;
|
|
2437
|
+
/**
|
|
2438
|
+
* Whether to retrieve data from the primary database instance.
|
|
2439
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2440
|
+
*
|
|
2441
|
+
* Default: `false`
|
|
2442
|
+
*/
|
|
2443
|
+
consistentRead?: boolean;
|
|
2444
|
+
/**
|
|
2445
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2446
|
+
* If provided, the result text is returned in the specified language.
|
|
2447
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
2448
|
+
*
|
|
2449
|
+
* If not provided, result text is not translated.
|
|
2450
|
+
*/
|
|
2451
|
+
language?: string | null;
|
|
2452
|
+
}
|
|
2453
|
+
interface BulkInsertDataItemsOptions {
|
|
2454
|
+
/** ID of the collection in which to insert the items. */
|
|
2455
|
+
dataCollectionId: string;
|
|
2456
|
+
/** Data items to insert. */
|
|
2457
|
+
dataItems: DataItem[];
|
|
2458
|
+
/**
|
|
2459
|
+
* Whether to return the inserted data items.
|
|
2460
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
2461
|
+
*
|
|
2462
|
+
* Default: `false`
|
|
2463
|
+
*/
|
|
2464
|
+
returnEntity?: boolean;
|
|
2465
|
+
}
|
|
2466
|
+
interface BulkUpdateDataItemsOptions {
|
|
2467
|
+
/** ID of the collection in which to update items. */
|
|
2468
|
+
dataCollectionId: string;
|
|
2469
|
+
/** Data items to update. */
|
|
2470
|
+
dataItems: DataItem[];
|
|
2471
|
+
/**
|
|
2472
|
+
* Whether to return the updated data items.
|
|
2473
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
2474
|
+
*
|
|
2475
|
+
* Default: `false`
|
|
2476
|
+
*/
|
|
2477
|
+
returnEntity?: boolean;
|
|
2478
|
+
}
|
|
2479
|
+
interface BulkSaveDataItemsOptions {
|
|
2480
|
+
/** ID of the collection in which to insert or update the items. */
|
|
2481
|
+
dataCollectionId: string;
|
|
2482
|
+
/** Data items to insert or update. */
|
|
2483
|
+
dataItems: DataItem[];
|
|
2484
|
+
/**
|
|
2485
|
+
* Whether to return the saved data item.
|
|
2486
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
2487
|
+
*
|
|
2488
|
+
* Default: `false`
|
|
2489
|
+
*/
|
|
2490
|
+
returnEntity?: boolean;
|
|
2491
|
+
}
|
|
2492
|
+
interface BulkRemoveDataItemsOptions {
|
|
2493
|
+
/** ID of the collection from which to remove the item. */
|
|
2494
|
+
dataCollectionId: string;
|
|
2495
|
+
/** IDs of data items to remove. */
|
|
2496
|
+
dataItemIds: string[];
|
|
2497
|
+
}
|
|
2498
|
+
interface QueryReferencedDataItemsOptions extends QueryReferencedDataItemsRequestPagingMethodOneOf {
|
|
2499
|
+
/** ID of the collection containing the referring item. */
|
|
2500
|
+
dataCollectionId: string;
|
|
2501
|
+
/** ID of the referring item. */
|
|
2502
|
+
referringItemId?: string;
|
|
2503
|
+
/** Field containing references in the referring item. */
|
|
2504
|
+
referringItemFieldName?: string;
|
|
2505
|
+
/** Order of the returned referenced items. Sorted by the date each item was referenced. */
|
|
2506
|
+
order?: SortOrder;
|
|
2507
|
+
/** Paging options to limit and skip the number of items. */
|
|
2508
|
+
paging?: Paging$1;
|
|
2509
|
+
/** 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`. */
|
|
2510
|
+
cursorPaging?: CursorPaging;
|
|
2511
|
+
/**
|
|
2512
|
+
* Whether to return the total count in the response.
|
|
2513
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
2514
|
+
*
|
|
2515
|
+
* Default: `false`
|
|
2516
|
+
*/
|
|
2517
|
+
returnTotalCount?: boolean;
|
|
2518
|
+
/**
|
|
2519
|
+
* Whether to retrieve data from the primary database instance.
|
|
2520
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2521
|
+
*
|
|
2522
|
+
* Default: `false`
|
|
2523
|
+
*/
|
|
2524
|
+
consistentRead?: boolean;
|
|
2525
|
+
/**
|
|
2526
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
2527
|
+
* If provided, the result text is returned in the specified language.
|
|
2528
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
2529
|
+
*
|
|
2530
|
+
* If not provided, result text is not translated.
|
|
2531
|
+
*/
|
|
2532
|
+
language?: string | null;
|
|
2533
|
+
/**
|
|
2534
|
+
* 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.
|
|
2535
|
+
* **Note:** The `_id` system field is always returned.
|
|
2536
|
+
*/
|
|
2537
|
+
fields?: string[];
|
|
2538
|
+
}
|
|
2539
|
+
interface IsReferencedDataItemOptions {
|
|
2540
|
+
/** ID of the collection containing the referring data item. */
|
|
2541
|
+
dataCollectionId: string;
|
|
2542
|
+
/** Field to check for a reference to the item that may be referenced. */
|
|
2543
|
+
referringItemFieldName: string;
|
|
2544
|
+
/** ID of the referring item. */
|
|
2545
|
+
referringItemId: string;
|
|
2546
|
+
/** ID of the item that may be referenced. */
|
|
2547
|
+
referencedItemId: string;
|
|
2548
|
+
/**
|
|
2549
|
+
* Whether to retrieve data from the primary database instance.
|
|
2550
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
2551
|
+
*
|
|
2552
|
+
* Default: `false`
|
|
2553
|
+
*/
|
|
2554
|
+
consistentRead?: boolean;
|
|
2555
|
+
}
|
|
2556
|
+
interface InsertDataItemReferenceOptions {
|
|
2557
|
+
/** ID of the collection in which to insert the reference. */
|
|
2558
|
+
dataCollectionId: string;
|
|
2559
|
+
/** Reference to insert */
|
|
2560
|
+
dataItemReference?: DataItemReference;
|
|
2561
|
+
}
|
|
2562
|
+
interface RemoveDataItemReferenceOptions {
|
|
2563
|
+
/** ID of the collection containing the referring item. */
|
|
2564
|
+
dataCollectionId: string;
|
|
2565
|
+
/** Reference to remove. */
|
|
2566
|
+
dataItemReference: DataItemReference;
|
|
2567
|
+
}
|
|
2568
|
+
interface BulkInsertDataItemReferencesOptions {
|
|
2569
|
+
/** ID of the collection containing the referring items. */
|
|
2570
|
+
dataCollectionId: string;
|
|
2571
|
+
/** References to insert. */
|
|
2572
|
+
dataItemReferences: DataItemReference[];
|
|
2573
|
+
/**
|
|
2574
|
+
* Whether to return the inserted data item references.
|
|
2575
|
+
* When `true`, the `results` objects contain a `dataItemReference` field.
|
|
2576
|
+
*
|
|
2577
|
+
* Default: `false`
|
|
2578
|
+
*/
|
|
2579
|
+
returnEntity?: boolean;
|
|
2580
|
+
}
|
|
2581
|
+
interface BulkRemoveDataItemReferencesOptions {
|
|
2582
|
+
/** ID of the collection containing the referring items. */
|
|
2583
|
+
dataCollectionId: string;
|
|
2584
|
+
/** References to remove. */
|
|
2585
|
+
dataItemReferences: DataItemReference[];
|
|
2586
|
+
}
|
|
2587
|
+
interface ReplaceDataItemReferencesOptions {
|
|
2588
|
+
/** ID of the collection containing the referring item. */
|
|
2589
|
+
dataCollectionId: string;
|
|
2590
|
+
/** Field containing references in the referring item. */
|
|
2591
|
+
referringItemFieldName: string;
|
|
2592
|
+
/** ID of the referring item. */
|
|
2593
|
+
referringItemId: string;
|
|
2594
|
+
/** List of new referenced item IDs to replace the existing ones. */
|
|
2595
|
+
newReferencedItemIds?: string[];
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
declare function insertDataItem$1(httpClient: HttpClient): (options: InsertDataItemOptions) => Promise<InsertDataItemResponse & InsertDataItemResponseNonNullableFields>;
|
|
2599
|
+
declare function updateDataItem$1(httpClient: HttpClient): (_id: string, options: UpdateDataItemOptions) => Promise<UpdateDataItemResponse & UpdateDataItemResponseNonNullableFields>;
|
|
2600
|
+
declare function saveDataItem$1(httpClient: HttpClient): (options: SaveDataItemOptions) => Promise<SaveDataItemResponse & SaveDataItemResponseNonNullableFields>;
|
|
2601
|
+
declare function getDataItem$1(httpClient: HttpClient): (dataItemId: string, options?: GetDataItemOptions) => Promise<DataItem & {
|
|
2602
|
+
_id: string;
|
|
2603
|
+
dataCollectionId: string;
|
|
2604
|
+
}>;
|
|
2605
|
+
declare function removeDataItem$1(httpClient: HttpClient): (dataItemId: string, options: RemoveDataItemOptions) => Promise<RemoveDataItemResponse & RemoveDataItemResponseNonNullableFields>;
|
|
2606
|
+
declare function truncateDataItems$1(httpClient: HttpClient): (options: TruncateDataItemsOptions) => Promise<void>;
|
|
2607
|
+
declare function queryDataItems$1(httpClient: HttpClient): (options: QueryDataItemsOptions) => DataItemsQueryBuilder;
|
|
2608
|
+
declare function aggregateDataItems$1(httpClient: HttpClient): (options?: AggregateDataItemsOptions) => Promise<AggregateDataItemsResponse>;
|
|
2609
|
+
declare function countDataItems$1(httpClient: HttpClient): (options?: CountDataItemsOptions) => Promise<CountDataItemsResponse & CountDataItemsResponseNonNullableFields>;
|
|
2610
|
+
declare function queryDistinctValues$1(httpClient: HttpClient): (options?: QueryDistinctValuesOptions) => Promise<QueryDistinctValuesResponse>;
|
|
2611
|
+
declare function bulkInsertDataItems$1(httpClient: HttpClient): (options?: BulkInsertDataItemsOptions) => Promise<BulkInsertDataItemsResponse & BulkInsertDataItemsResponseNonNullableFields>;
|
|
2612
|
+
declare function bulkUpdateDataItems$1(httpClient: HttpClient): (options?: BulkUpdateDataItemsOptions) => Promise<BulkUpdateDataItemsResponse & BulkUpdateDataItemsResponseNonNullableFields>;
|
|
2613
|
+
declare function bulkSaveDataItems$1(httpClient: HttpClient): (options?: BulkSaveDataItemsOptions) => Promise<BulkSaveDataItemsResponse & BulkSaveDataItemsResponseNonNullableFields>;
|
|
2614
|
+
declare function bulkRemoveDataItems$1(httpClient: HttpClient): (options: BulkRemoveDataItemsOptions) => Promise<BulkRemoveDataItemsResponse & BulkRemoveDataItemsResponseNonNullableFields>;
|
|
2615
|
+
declare function queryReferencedDataItems$1(httpClient: HttpClient): (options?: QueryReferencedDataItemsOptions) => Promise<QueryReferencedDataItemsResponse & QueryReferencedDataItemsResponseNonNullableFields>;
|
|
2616
|
+
declare function isReferencedDataItem$1(httpClient: HttpClient): (options?: IsReferencedDataItemOptions) => Promise<IsReferencedDataItemResponse & IsReferencedDataItemResponseNonNullableFields>;
|
|
2617
|
+
declare function insertDataItemReference$1(httpClient: HttpClient): (options?: InsertDataItemReferenceOptions) => Promise<InsertDataItemReferenceResponse & InsertDataItemReferenceResponseNonNullableFields>;
|
|
2618
|
+
declare function removeDataItemReference$1(httpClient: HttpClient): (options: RemoveDataItemReferenceOptions) => Promise<RemoveDataItemReferenceResponse & RemoveDataItemReferenceResponseNonNullableFields>;
|
|
2619
|
+
declare function bulkInsertDataItemReferences$1(httpClient: HttpClient): (options?: BulkInsertDataItemReferencesOptions) => Promise<BulkInsertDataItemReferencesResponse & BulkInsertDataItemReferencesResponseNonNullableFields>;
|
|
2620
|
+
declare function bulkRemoveDataItemReferences$1(httpClient: HttpClient): (options: BulkRemoveDataItemReferencesOptions) => Promise<BulkRemoveDataItemReferencesResponse & BulkRemoveDataItemReferencesResponseNonNullableFields>;
|
|
2621
|
+
declare function replaceDataItemReferences$1(httpClient: HttpClient): (options?: ReplaceDataItemReferencesOptions) => Promise<ReplaceDataItemReferencesResponse & ReplaceDataItemReferencesResponseNonNullableFields>;
|
|
2622
|
+
declare const onDataItemCreated$1: EventDefinition<DataItemCreatedEnvelope, "wix.data.v2.data_item_created">;
|
|
2623
|
+
declare const onDataItemUpdated$1: EventDefinition<DataItemUpdatedEnvelope, "wix.data.v2.data_item_updated">;
|
|
2624
|
+
declare const onDataItemDeleted$1: EventDefinition<DataItemDeletedEnvelope, "wix.data.v2.data_item_deleted">;
|
|
2625
|
+
|
|
2626
|
+
declare const insertDataItem: BuildRESTFunction<typeof insertDataItem$1>;
|
|
2627
|
+
declare const updateDataItem: BuildRESTFunction<typeof updateDataItem$1>;
|
|
2628
|
+
declare const saveDataItem: BuildRESTFunction<typeof saveDataItem$1>;
|
|
2629
|
+
declare const getDataItem: BuildRESTFunction<typeof getDataItem$1>;
|
|
2630
|
+
declare const removeDataItem: BuildRESTFunction<typeof removeDataItem$1>;
|
|
2631
|
+
declare const truncateDataItems: BuildRESTFunction<typeof truncateDataItems$1>;
|
|
2632
|
+
declare const queryDataItems: BuildRESTFunction<typeof queryDataItems$1>;
|
|
2633
|
+
declare const aggregateDataItems: BuildRESTFunction<typeof aggregateDataItems$1>;
|
|
2634
|
+
declare const countDataItems: BuildRESTFunction<typeof countDataItems$1>;
|
|
2635
|
+
declare const queryDistinctValues: BuildRESTFunction<typeof queryDistinctValues$1>;
|
|
2636
|
+
declare const bulkInsertDataItems: BuildRESTFunction<typeof bulkInsertDataItems$1>;
|
|
2637
|
+
declare const bulkUpdateDataItems: BuildRESTFunction<typeof bulkUpdateDataItems$1>;
|
|
2638
|
+
declare const bulkSaveDataItems: BuildRESTFunction<typeof bulkSaveDataItems$1>;
|
|
2639
|
+
declare const bulkRemoveDataItems: BuildRESTFunction<typeof bulkRemoveDataItems$1>;
|
|
2640
|
+
declare const queryReferencedDataItems: BuildRESTFunction<typeof queryReferencedDataItems$1>;
|
|
2641
|
+
declare const isReferencedDataItem: BuildRESTFunction<typeof isReferencedDataItem$1>;
|
|
2642
|
+
declare const insertDataItemReference: BuildRESTFunction<typeof insertDataItemReference$1>;
|
|
2643
|
+
declare const removeDataItemReference: BuildRESTFunction<typeof removeDataItemReference$1>;
|
|
2644
|
+
declare const bulkInsertDataItemReferences: BuildRESTFunction<typeof bulkInsertDataItemReferences$1>;
|
|
2645
|
+
declare const bulkRemoveDataItemReferences: BuildRESTFunction<typeof bulkRemoveDataItemReferences$1>;
|
|
2646
|
+
declare const replaceDataItemReferences: BuildRESTFunction<typeof replaceDataItemReferences$1>;
|
|
2647
|
+
declare const onDataItemCreated: BuildEventDefinition<typeof onDataItemCreated$1>;
|
|
2648
|
+
declare const onDataItemUpdated: BuildEventDefinition<typeof onDataItemUpdated$1>;
|
|
2649
|
+
declare const onDataItemDeleted: BuildEventDefinition<typeof onDataItemDeleted$1>;
|
|
2650
|
+
|
|
2651
|
+
declare const context$1_aggregateDataItems: typeof aggregateDataItems;
|
|
2652
|
+
declare const context$1_bulkInsertDataItemReferences: typeof bulkInsertDataItemReferences;
|
|
2653
|
+
declare const context$1_bulkInsertDataItems: typeof bulkInsertDataItems;
|
|
2654
|
+
declare const context$1_bulkRemoveDataItemReferences: typeof bulkRemoveDataItemReferences;
|
|
2655
|
+
declare const context$1_bulkRemoveDataItems: typeof bulkRemoveDataItems;
|
|
2656
|
+
declare const context$1_bulkSaveDataItems: typeof bulkSaveDataItems;
|
|
2657
|
+
declare const context$1_bulkUpdateDataItems: typeof bulkUpdateDataItems;
|
|
2658
|
+
declare const context$1_countDataItems: typeof countDataItems;
|
|
2659
|
+
declare const context$1_getDataItem: typeof getDataItem;
|
|
2660
|
+
declare const context$1_insertDataItem: typeof insertDataItem;
|
|
2661
|
+
declare const context$1_insertDataItemReference: typeof insertDataItemReference;
|
|
2662
|
+
declare const context$1_isReferencedDataItem: typeof isReferencedDataItem;
|
|
2663
|
+
declare const context$1_onDataItemCreated: typeof onDataItemCreated;
|
|
2664
|
+
declare const context$1_onDataItemDeleted: typeof onDataItemDeleted;
|
|
2665
|
+
declare const context$1_onDataItemUpdated: typeof onDataItemUpdated;
|
|
2666
|
+
declare const context$1_queryDataItems: typeof queryDataItems;
|
|
2667
|
+
declare const context$1_queryDistinctValues: typeof queryDistinctValues;
|
|
2668
|
+
declare const context$1_queryReferencedDataItems: typeof queryReferencedDataItems;
|
|
2669
|
+
declare const context$1_removeDataItem: typeof removeDataItem;
|
|
2670
|
+
declare const context$1_removeDataItemReference: typeof removeDataItemReference;
|
|
2671
|
+
declare const context$1_replaceDataItemReferences: typeof replaceDataItemReferences;
|
|
2672
|
+
declare const context$1_saveDataItem: typeof saveDataItem;
|
|
2673
|
+
declare const context$1_truncateDataItems: typeof truncateDataItems;
|
|
2674
|
+
declare const context$1_updateDataItem: typeof updateDataItem;
|
|
2675
|
+
declare namespace context$1 {
|
|
2676
|
+
export { context$1_aggregateDataItems as aggregateDataItems, context$1_bulkInsertDataItemReferences as bulkInsertDataItemReferences, context$1_bulkInsertDataItems as bulkInsertDataItems, context$1_bulkRemoveDataItemReferences as bulkRemoveDataItemReferences, context$1_bulkRemoveDataItems as bulkRemoveDataItems, context$1_bulkSaveDataItems as bulkSaveDataItems, context$1_bulkUpdateDataItems as bulkUpdateDataItems, context$1_countDataItems as countDataItems, context$1_getDataItem as getDataItem, context$1_insertDataItem as insertDataItem, context$1_insertDataItemReference as insertDataItemReference, context$1_isReferencedDataItem as isReferencedDataItem, context$1_onDataItemCreated as onDataItemCreated, context$1_onDataItemDeleted as onDataItemDeleted, context$1_onDataItemUpdated as onDataItemUpdated, context$1_queryDataItems as queryDataItems, context$1_queryDistinctValues as queryDistinctValues, context$1_queryReferencedDataItems as queryReferencedDataItems, context$1_removeDataItem as removeDataItem, context$1_removeDataItemReference as removeDataItemReference, context$1_replaceDataItemReferences as replaceDataItemReferences, context$1_saveDataItem as saveDataItem, context$1_truncateDataItems as truncateDataItems, context$1_updateDataItem as updateDataItem };
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
/** An index is a map of a collection's data, organized according to specific fields to increase query speed. */
|
|
2680
|
+
interface Index {
|
|
2681
|
+
/** Name of the index. */
|
|
2682
|
+
name?: string;
|
|
2683
|
+
/**
|
|
2684
|
+
* Fields for which the index is defined.
|
|
2685
|
+
*
|
|
2686
|
+
* Max: 3 fields (for a unique index: 1 field)
|
|
2687
|
+
*/
|
|
2688
|
+
fields?: Field[];
|
|
2689
|
+
/**
|
|
2690
|
+
* Current status of the index.
|
|
2691
|
+
* - `BUILDING`: Index creation is in progress.
|
|
2692
|
+
* - `ACTIVE`: Index has been successfully created and can be used in queries.
|
|
2693
|
+
* - `DROPPING`: Index is in the process of being dropped.
|
|
2694
|
+
* - `DROPPED`: Index has been dropped successfully.
|
|
2695
|
+
* - `FAILED`: Index creation has failed.
|
|
2696
|
+
* - `INVALID`: Index contains incorrectly indexed data.
|
|
2697
|
+
* @readonly
|
|
2698
|
+
*/
|
|
2699
|
+
status?: Status;
|
|
2700
|
+
/**
|
|
2701
|
+
* Contains details about the reasons for failure when `status` is `FAILED`.
|
|
2702
|
+
* @readonly
|
|
2703
|
+
*/
|
|
2704
|
+
failure?: Failure;
|
|
2705
|
+
/**
|
|
2706
|
+
* Whether the index enforces uniqueness of values in the field for which it is defined.
|
|
2707
|
+
* If `true`, the index can have only one field.
|
|
2708
|
+
*
|
|
2709
|
+
* Default: `false`
|
|
2710
|
+
*/
|
|
2711
|
+
unique?: boolean;
|
|
2712
|
+
/**
|
|
2713
|
+
* Whether the index ignores case.
|
|
2714
|
+
*
|
|
2715
|
+
* Default: `false`
|
|
2716
|
+
*/
|
|
2717
|
+
caseInsensitive?: boolean;
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
2720
|
+
* Order determines how values are ordered in the index. This is important when
|
|
2721
|
+
* ordering and/or range querying by indexed fields.
|
|
2722
|
+
*/
|
|
2723
|
+
declare enum Order {
|
|
2724
|
+
ASC = "ASC",
|
|
2725
|
+
DESC = "DESC"
|
|
2726
|
+
}
|
|
2727
|
+
interface Field {
|
|
2728
|
+
/** Path of the field to index. For example: `title` or `options.price`. */
|
|
2729
|
+
path?: string;
|
|
2730
|
+
/**
|
|
2731
|
+
* Sort order for the index. Base on how the data is regularly queried.
|
|
2732
|
+
*
|
|
2733
|
+
* Default: `ASC`
|
|
2734
|
+
*/
|
|
2735
|
+
order?: Order;
|
|
2736
|
+
}
|
|
2737
|
+
declare enum Status {
|
|
2738
|
+
/** Place holder. Never returned by the service. */
|
|
2739
|
+
UNKNOWN = "UNKNOWN",
|
|
2740
|
+
/** Index creation is in progress. */
|
|
2741
|
+
BUILDING = "BUILDING",
|
|
2742
|
+
/** Index has been successfully created and can be used in queries. */
|
|
2743
|
+
ACTIVE = "ACTIVE",
|
|
2744
|
+
/** Index is in the process of being dropped. */
|
|
2745
|
+
DROPPING = "DROPPING",
|
|
2746
|
+
/** Index has been dropped successfully. */
|
|
2747
|
+
DROPPED = "DROPPED",
|
|
2748
|
+
/** Index creation has failed. */
|
|
2749
|
+
FAILED = "FAILED",
|
|
2750
|
+
/** Index contains incorrectly indexed data. */
|
|
2751
|
+
INVALID = "INVALID"
|
|
2752
|
+
}
|
|
2753
|
+
interface Failure {
|
|
2754
|
+
/**
|
|
2755
|
+
* Error code.
|
|
2756
|
+
* - `WDE0112`: Unknown error while building collection index.
|
|
2757
|
+
* - `WDE0113`: Duplicate key error while building collection index.
|
|
2758
|
+
* - `WDE0114`: Document too large while building collection index.
|
|
2759
|
+
*/
|
|
2760
|
+
code?: string;
|
|
2761
|
+
/** Description of the failure. */
|
|
2762
|
+
description?: string;
|
|
2763
|
+
/**
|
|
2764
|
+
* ID of the data item that caused the failure.
|
|
2765
|
+
* For example, if `unique` is `true`, the ID of an item containing a duplicate value.
|
|
2766
|
+
*/
|
|
2767
|
+
itemId?: string | null;
|
|
2768
|
+
}
|
|
2769
|
+
interface Paging {
|
|
2770
|
+
/** Number of items to load. */
|
|
2771
|
+
limit?: number | null;
|
|
2772
|
+
/** Number of items to skip in the current sort order. */
|
|
2773
|
+
offset?: number | null;
|
|
2774
|
+
}
|
|
2775
|
+
interface ListIndexesResponse {
|
|
2776
|
+
/** List of all indexes for the requested data collection. */
|
|
2777
|
+
indexes?: Index[];
|
|
2778
|
+
/** Paging metadata */
|
|
2779
|
+
pagingMetadata?: PagingMetadata;
|
|
2780
|
+
}
|
|
2781
|
+
interface PagingMetadata {
|
|
2782
|
+
/** Number of items returned in the response. */
|
|
2783
|
+
count?: number | null;
|
|
2784
|
+
/** Offset that was requested. */
|
|
2785
|
+
offset?: number | null;
|
|
2786
|
+
/** Total number of items that match the query. */
|
|
2787
|
+
total?: number | null;
|
|
2788
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
2789
|
+
tooManyToCount?: boolean | null;
|
|
2790
|
+
}
|
|
2791
|
+
interface ListIndexesResponseNonNullableFields {
|
|
2792
|
+
indexes: {
|
|
2793
|
+
name: string;
|
|
2794
|
+
fields: {
|
|
2795
|
+
path: string;
|
|
2796
|
+
order: Order;
|
|
2797
|
+
}[];
|
|
2798
|
+
status: Status;
|
|
2799
|
+
failure?: {
|
|
2800
|
+
code: string;
|
|
2801
|
+
description: string;
|
|
2802
|
+
};
|
|
2803
|
+
unique: boolean;
|
|
2804
|
+
caseInsensitive: boolean;
|
|
2805
|
+
}[];
|
|
2806
|
+
}
|
|
2807
|
+
interface ListIndexesOptions {
|
|
2808
|
+
/** paging */
|
|
2809
|
+
paging?: Paging;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
declare function createIndex$1(httpClient: HttpClient): (dataCollectionId: string, index: Index) => Promise<Index & {
|
|
2813
|
+
name: string;
|
|
2814
|
+
fields: {
|
|
2815
|
+
path: string;
|
|
2816
|
+
order: Order;
|
|
2817
|
+
}[];
|
|
2818
|
+
status: Status;
|
|
2819
|
+
failure?: {
|
|
2820
|
+
code: string;
|
|
2821
|
+
description: string;
|
|
2822
|
+
} | undefined;
|
|
2823
|
+
unique: boolean;
|
|
2824
|
+
caseInsensitive: boolean;
|
|
2825
|
+
}>;
|
|
2826
|
+
declare function dropIndex$1(httpClient: HttpClient): (dataCollectionId: string, indexName: string) => Promise<void>;
|
|
2827
|
+
declare function listIndexes$1(httpClient: HttpClient): (dataCollectionId: string, options?: ListIndexesOptions) => Promise<ListIndexesResponse & ListIndexesResponseNonNullableFields>;
|
|
2828
|
+
|
|
2829
|
+
declare const createIndex: BuildRESTFunction<typeof createIndex$1>;
|
|
2830
|
+
declare const dropIndex: BuildRESTFunction<typeof dropIndex$1>;
|
|
2831
|
+
declare const listIndexes: BuildRESTFunction<typeof listIndexes$1>;
|
|
2832
|
+
|
|
2833
|
+
declare const context_createIndex: typeof createIndex;
|
|
2834
|
+
declare const context_dropIndex: typeof dropIndex;
|
|
2835
|
+
declare const context_listIndexes: typeof listIndexes;
|
|
2836
|
+
declare namespace context {
|
|
2837
|
+
export { context_createIndex as createIndex, context_dropIndex as dropIndex, context_listIndexes as listIndexes };
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
export { context$2 as collections, context$3 as externalDatabaseConnections, context as indexes, context$1 as items };
|