@wix/data 1.0.144 → 1.0.145
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/build/cjs/index.d.ts +5 -4
- package/build/cjs/index.js +8 -4
- package/build/cjs/index.js.map +1 -1
- package/build/es/index.d.ts +5 -4
- package/build/es/index.js +5 -4
- package/build/es/index.js.map +1 -1
- package/package.json +6 -6
- package/type-bundles/context.bundle.d.ts +567 -78
- package/type-bundles/index.bundle.d.ts +567 -78
- package/type-bundles/meta.bundle.d.ts +16 -4
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
+
interface HttpClient {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
|
+
fetchWithAuth: typeof fetch;
|
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
|
+
}
|
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
+
type HttpResponse<T = any> = {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: any;
|
|
13
|
+
request?: any;
|
|
14
|
+
};
|
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
|
+
url: string;
|
|
18
|
+
data?: Data;
|
|
19
|
+
params?: URLSearchParams;
|
|
20
|
+
} & APIMetadata;
|
|
21
|
+
type APIMetadata = {
|
|
22
|
+
methodFqn?: string;
|
|
23
|
+
entityFqdn?: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
};
|
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
+
__type: 'event-definition';
|
|
29
|
+
type: Type;
|
|
30
|
+
isDomainEvent?: boolean;
|
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
|
32
|
+
__payload: Payload;
|
|
33
|
+
};
|
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
|
+
interface SymbolConstructor {
|
|
41
|
+
readonly observable: symbol;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
1
45
|
/** An external database connection defines a connection between an external database and a Wix site or project. */
|
|
2
46
|
interface ExternalDatabaseConnection {
|
|
3
47
|
/**
|
|
@@ -415,55 +459,64 @@ interface UpdateExternalDatabaseConnection {
|
|
|
415
459
|
capabilities?: Capabilities;
|
|
416
460
|
}
|
|
417
461
|
|
|
418
|
-
|
|
419
|
-
interface
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
462
|
+
declare function getExternalDatabaseConnection$1(httpClient: HttpClient): GetExternalDatabaseConnectionSignature;
|
|
463
|
+
interface GetExternalDatabaseConnectionSignature {
|
|
464
|
+
/**
|
|
465
|
+
* Retrieves an external database connection by name.
|
|
466
|
+
* @param - Name of the external database connection to retrieve.
|
|
467
|
+
* @returns Details of the external database connection requested.
|
|
468
|
+
*/
|
|
469
|
+
(name: string): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
|
|
423
470
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
471
|
+
declare function listExternalDatabaseConnections$1(httpClient: HttpClient): ListExternalDatabaseConnectionsSignature;
|
|
472
|
+
interface ListExternalDatabaseConnectionsSignature {
|
|
473
|
+
/**
|
|
474
|
+
* Retrieves a list of all external database collections associated with the site or project.
|
|
475
|
+
*/
|
|
476
|
+
(options?: ListExternalDatabaseConnectionsOptions | undefined): Promise<ListExternalDatabaseConnectionsResponse & ListExternalDatabaseConnectionsResponseNonNullableFields>;
|
|
477
|
+
}
|
|
478
|
+
declare function createExternalDatabaseConnection$1(httpClient: HttpClient): CreateExternalDatabaseConnectionSignature;
|
|
479
|
+
interface CreateExternalDatabaseConnectionSignature {
|
|
480
|
+
/**
|
|
481
|
+
* Creates a new external database connection.
|
|
482
|
+
*
|
|
483
|
+
* The `externalDatabaseConnection` parameter must include a `name`, `endpoint`, and `configuration` details for the external database.
|
|
484
|
+
* If any of these are missing, the external database connection isn't created.
|
|
485
|
+
* @param - External database connection details.
|
|
486
|
+
* @param - Options for creating an external database connection.
|
|
487
|
+
* @returns Details of external database connection created.
|
|
488
|
+
*/
|
|
489
|
+
(externalDatabaseConnection: ExternalDatabaseConnection, options: CreateExternalDatabaseConnectionOptions): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
|
|
490
|
+
}
|
|
491
|
+
declare function updateExternalDatabaseConnection$1(httpClient: HttpClient): UpdateExternalDatabaseConnectionSignature;
|
|
492
|
+
interface UpdateExternalDatabaseConnectionSignature {
|
|
493
|
+
/**
|
|
494
|
+
* Updates an external database connection.
|
|
495
|
+
*
|
|
496
|
+
* An external database collection name must be provided in `name`.
|
|
497
|
+
* If an existing external database connection is found with the same name, that connection's details are updated.
|
|
498
|
+
* If no external database connection has that name, the request fails.
|
|
499
|
+
*
|
|
500
|
+
* > **Note:** After an external database connection is updated, it only contains the values provided in the request. All previous values are lost.
|
|
501
|
+
* @param - Name of the external database connection.
|
|
502
|
+
* An external database connection may connect to one or more external data collections or tables.
|
|
503
|
+
* These are represented as `connectionName/dataCollectionId`.
|
|
504
|
+
* @param - Options for updating an external database connection.
|
|
505
|
+
* @param - Updated external database connection details. The existing connection is replaced with this version.
|
|
506
|
+
* @returns Updated external database connection details.
|
|
507
|
+
*/
|
|
508
|
+
(name: string, externalDatabaseConnection: UpdateExternalDatabaseConnection): Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
|
|
509
|
+
}
|
|
510
|
+
declare function deleteExternalDatabaseConnection$1(httpClient: HttpClient): DeleteExternalDatabaseConnectionSignature;
|
|
511
|
+
interface DeleteExternalDatabaseConnectionSignature {
|
|
512
|
+
/**
|
|
513
|
+
* Deletes an external database connection.
|
|
514
|
+
*
|
|
515
|
+
* > **Note:** Once an external database connection is deleted, it can't be restored. To reconnect the database you need to create a new external database connection.
|
|
516
|
+
* @param - Name of the external database connection to delete.
|
|
517
|
+
*/
|
|
518
|
+
(name: string): Promise<void>;
|
|
460
519
|
}
|
|
461
|
-
|
|
462
|
-
declare function getExternalDatabaseConnection$1(httpClient: HttpClient): (name: string) => Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
|
|
463
|
-
declare function listExternalDatabaseConnections$1(httpClient: HttpClient): (options?: ListExternalDatabaseConnectionsOptions) => Promise<ListExternalDatabaseConnectionsResponse & ListExternalDatabaseConnectionsResponseNonNullableFields>;
|
|
464
|
-
declare function createExternalDatabaseConnection$1(httpClient: HttpClient): (externalDatabaseConnection: ExternalDatabaseConnection, options: CreateExternalDatabaseConnectionOptions) => Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
|
|
465
|
-
declare function updateExternalDatabaseConnection$1(httpClient: HttpClient): (name: string, externalDatabaseConnection: UpdateExternalDatabaseConnection) => Promise<ExternalDatabaseConnection & ExternalDatabaseConnectionNonNullableFields>;
|
|
466
|
-
declare function deleteExternalDatabaseConnection$1(httpClient: HttpClient): (name: string) => Promise<void>;
|
|
467
520
|
declare const onExternalDatabaseConnectionCreated$1: EventDefinition<ExternalDatabaseConnectionCreatedEnvelope, "wix.data.v1.external_database_connection_created">;
|
|
468
521
|
declare const onExternalDatabaseConnectionUpdated$1: EventDefinition<ExternalDatabaseConnectionUpdatedEnvelope, "wix.data.v1.external_database_connection_updated">;
|
|
469
522
|
declare const onExternalDatabaseConnectionDeleted$1: EventDefinition<ExternalDatabaseConnectionDeletedEnvelope, "wix.data.v1.external_database_connection_deleted">;
|
|
@@ -484,12 +537,21 @@ type _publicDeleteExternalDatabaseConnectionType = typeof deleteExternalDatabase
|
|
|
484
537
|
declare const deleteExternalDatabaseConnection: ReturnType<typeof createRESTModule$3<_publicDeleteExternalDatabaseConnectionType>>;
|
|
485
538
|
|
|
486
539
|
type _publicOnExternalDatabaseConnectionCreatedType = typeof onExternalDatabaseConnectionCreated$1;
|
|
540
|
+
/**
|
|
541
|
+
* Triggered when an external database connection is created.
|
|
542
|
+
*/
|
|
487
543
|
declare const onExternalDatabaseConnectionCreated: ReturnType<typeof createEventModule$2<_publicOnExternalDatabaseConnectionCreatedType>>;
|
|
488
544
|
|
|
489
545
|
type _publicOnExternalDatabaseConnectionUpdatedType = typeof onExternalDatabaseConnectionUpdated$1;
|
|
546
|
+
/**
|
|
547
|
+
* Triggered when an external database connection is updated.
|
|
548
|
+
*/
|
|
490
549
|
declare const onExternalDatabaseConnectionUpdated: ReturnType<typeof createEventModule$2<_publicOnExternalDatabaseConnectionUpdatedType>>;
|
|
491
550
|
|
|
492
551
|
type _publicOnExternalDatabaseConnectionDeletedType = typeof onExternalDatabaseConnectionDeleted$1;
|
|
552
|
+
/**
|
|
553
|
+
* Triggered when an external database connection is deleted.
|
|
554
|
+
*/
|
|
493
555
|
declare const onExternalDatabaseConnectionDeleted: ReturnType<typeof createEventModule$2<_publicOnExternalDatabaseConnectionDeletedType>>;
|
|
494
556
|
|
|
495
557
|
type context$3_Capabilities = Capabilities;
|
|
@@ -1004,7 +1066,10 @@ declare enum Role {
|
|
|
1004
1066
|
ANYONE = "ANYONE"
|
|
1005
1067
|
}
|
|
1006
1068
|
interface Plugin extends PluginOptionsOneOf {
|
|
1007
|
-
/**
|
|
1069
|
+
/**
|
|
1070
|
+
* Options for the Publish plugin.
|
|
1071
|
+
* This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
|
|
1072
|
+
*/
|
|
1008
1073
|
publishOptions?: PublishPluginOptions$1;
|
|
1009
1074
|
/** Options for the Single Item plugin. */
|
|
1010
1075
|
singleItemOptions?: SingleItemPluginOptions;
|
|
@@ -1029,7 +1094,10 @@ interface Plugin extends PluginOptionsOneOf {
|
|
|
1029
1094
|
}
|
|
1030
1095
|
/** @oneof */
|
|
1031
1096
|
interface PluginOptionsOneOf {
|
|
1032
|
-
/**
|
|
1097
|
+
/**
|
|
1098
|
+
* Options for the Publish plugin.
|
|
1099
|
+
* This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
|
|
1100
|
+
*/
|
|
1033
1101
|
publishOptions?: PublishPluginOptions$1;
|
|
1034
1102
|
/** Options for the Single Item plugin. */
|
|
1035
1103
|
singleItemOptions?: SingleItemPluginOptions;
|
|
@@ -1847,11 +1915,69 @@ interface ListDataCollectionsOptions {
|
|
|
1847
1915
|
consistentRead?: boolean;
|
|
1848
1916
|
}
|
|
1849
1917
|
|
|
1850
|
-
declare function createDataCollection$1(httpClient: HttpClient):
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1918
|
+
declare function createDataCollection$1(httpClient: HttpClient): CreateDataCollectionSignature;
|
|
1919
|
+
interface CreateDataCollectionSignature {
|
|
1920
|
+
/**
|
|
1921
|
+
* Creates a new data collection.
|
|
1922
|
+
*
|
|
1923
|
+
* The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created.
|
|
1924
|
+
* @param - Collection details.
|
|
1925
|
+
* @param - Options for creating a data collection.
|
|
1926
|
+
* @returns Details of collection created.
|
|
1927
|
+
*/
|
|
1928
|
+
(collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
|
|
1929
|
+
}
|
|
1930
|
+
declare function getDataCollection$1(httpClient: HttpClient): GetDataCollectionSignature;
|
|
1931
|
+
interface GetDataCollectionSignature {
|
|
1932
|
+
/**
|
|
1933
|
+
* Retrieves a data collection by ID.
|
|
1934
|
+
* @param - ID of the collection to retrieve.
|
|
1935
|
+
* @param - Options for retrieving a data collection.
|
|
1936
|
+
* @returns Details of the collection requested.
|
|
1937
|
+
*/
|
|
1938
|
+
(dataCollectionId: string, options?: GetDataCollectionOptions | undefined): Promise<DataCollection & DataCollectionNonNullableFields>;
|
|
1939
|
+
}
|
|
1940
|
+
declare function listDataCollections$1(httpClient: HttpClient): ListDataCollectionsSignature;
|
|
1941
|
+
interface ListDataCollectionsSignature {
|
|
1942
|
+
/**
|
|
1943
|
+
* Retrieves a list of all data collections associated with the site or project.
|
|
1944
|
+
*
|
|
1945
|
+
* By default, the list is ordered by ID in ascending order.
|
|
1946
|
+
* @param - Options for retrieving a list of data collections.
|
|
1947
|
+
*/
|
|
1948
|
+
(options?: ListDataCollectionsOptions | undefined): Promise<ListDataCollectionsResponse & ListDataCollectionsResponseNonNullableFields>;
|
|
1949
|
+
}
|
|
1950
|
+
declare function updateDataCollection$1(httpClient: HttpClient): UpdateDataCollectionSignature;
|
|
1951
|
+
interface UpdateDataCollectionSignature {
|
|
1952
|
+
/**
|
|
1953
|
+
* Updates a data collection.
|
|
1954
|
+
*
|
|
1955
|
+
* A collection ID, revision number, permissions, and at least 1 field must be provided within `options.collection`.
|
|
1956
|
+
* If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
|
|
1957
|
+
* Otherwise, the request fails.
|
|
1958
|
+
*
|
|
1959
|
+
* When a collection is updated, its `_updatedDate` property is changed to the current date and its `revision` property is incremented.
|
|
1960
|
+
*
|
|
1961
|
+
* > **Note:**
|
|
1962
|
+
* > After a collection is updated, it only contains the properties included in the `updateDataCollection()` call. If the existing collection has properties with values and those properties
|
|
1963
|
+
* > aren't included in the updated collection details, their values are lost.
|
|
1964
|
+
* @param - Updated collection details. The existing collection is replaced with this version.
|
|
1965
|
+
* @param - Options for updating a data collection.
|
|
1966
|
+
* @returns Updated collection details.
|
|
1967
|
+
*/
|
|
1968
|
+
(collection: DataCollection): Promise<DataCollection & DataCollectionNonNullableFields>;
|
|
1969
|
+
}
|
|
1970
|
+
declare function deleteDataCollection$1(httpClient: HttpClient): DeleteDataCollectionSignature;
|
|
1971
|
+
interface DeleteDataCollectionSignature {
|
|
1972
|
+
/**
|
|
1973
|
+
* Deletes a data collection.
|
|
1974
|
+
*
|
|
1975
|
+
* > **Note:**
|
|
1976
|
+
* > Once a collection is deleted, it can't be restored.
|
|
1977
|
+
* @param - ID of the collection to delete.
|
|
1978
|
+
*/
|
|
1979
|
+
(dataCollectionId: string): Promise<void>;
|
|
1980
|
+
}
|
|
1855
1981
|
declare const onDataCollectionClonedEvent$1: EventDefinition<DataCollectionClonedEnvelope, "wix.data.v2.data_collection_data_collection_cloned_event">;
|
|
1856
1982
|
declare const onDataCollectionChangedEvent$1: EventDefinition<DataCollectionChangedEnvelope, "wix.data.v2.data_collection_data_collection_changed_event">;
|
|
1857
1983
|
declare const onDataCollectionCreated$1: EventDefinition<DataCollectionCreatedEnvelope, "wix.data.v2.data_collection_created">;
|
|
@@ -1874,18 +2000,29 @@ type _publicDeleteDataCollectionType = typeof deleteDataCollection$1;
|
|
|
1874
2000
|
declare const deleteDataCollection: ReturnType<typeof createRESTModule$2<_publicDeleteDataCollectionType>>;
|
|
1875
2001
|
|
|
1876
2002
|
type _publicOnDataCollectionClonedEventType = typeof onDataCollectionClonedEvent$1;
|
|
2003
|
+
/**
|
|
2004
|
+
* Event triggered when collection is cloned from other instance
|
|
2005
|
+
* CREATED event will be also triggered along with this action
|
|
2006
|
+
*/
|
|
1877
2007
|
declare const onDataCollectionClonedEvent: ReturnType<typeof createEventModule$1<_publicOnDataCollectionClonedEventType>>;
|
|
1878
2008
|
|
|
1879
2009
|
type _publicOnDataCollectionChangedEventType = typeof onDataCollectionChangedEvent$1;
|
|
2010
|
+
/**
|
|
2011
|
+
* Event triggered when collection is changed, describing some of changes
|
|
2012
|
+
* UPDATED event will be also triggered along with this action
|
|
2013
|
+
*/
|
|
1880
2014
|
declare const onDataCollectionChangedEvent: ReturnType<typeof createEventModule$1<_publicOnDataCollectionChangedEventType>>;
|
|
1881
2015
|
|
|
1882
2016
|
type _publicOnDataCollectionCreatedType = typeof onDataCollectionCreated$1;
|
|
2017
|
+
/** */
|
|
1883
2018
|
declare const onDataCollectionCreated: ReturnType<typeof createEventModule$1<_publicOnDataCollectionCreatedType>>;
|
|
1884
2019
|
|
|
1885
2020
|
type _publicOnDataCollectionUpdatedType = typeof onDataCollectionUpdated$1;
|
|
2021
|
+
/** */
|
|
1886
2022
|
declare const onDataCollectionUpdated: ReturnType<typeof createEventModule$1<_publicOnDataCollectionUpdatedType>>;
|
|
1887
2023
|
|
|
1888
2024
|
type _publicOnDataCollectionDeletedType = typeof onDataCollectionDeleted$1;
|
|
2025
|
+
/** */
|
|
1889
2026
|
declare const onDataCollectionDeleted: ReturnType<typeof createEventModule$1<_publicOnDataCollectionDeletedType>>;
|
|
1890
2027
|
|
|
1891
2028
|
type context$2_AccessLevel = AccessLevel;
|
|
@@ -2110,6 +2247,12 @@ interface RemoveFromArray {
|
|
|
2110
2247
|
value?: any;
|
|
2111
2248
|
}
|
|
2112
2249
|
interface DataPublishPluginOptions {
|
|
2250
|
+
/**
|
|
2251
|
+
* Whether to include draft items.
|
|
2252
|
+
* When `true`, the response includes both published and draft items. Default: `false`.
|
|
2253
|
+
*
|
|
2254
|
+
* **Note:** This option is only relevant for [data collections](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) that use the Publish plugin.
|
|
2255
|
+
*/
|
|
2113
2256
|
includeDraftItems?: boolean;
|
|
2114
2257
|
}
|
|
2115
2258
|
interface PatchDataItemResponse {
|
|
@@ -3566,27 +3709,322 @@ interface ReplaceDataItemReferencesOptions {
|
|
|
3566
3709
|
newReferencedItemIds?: string[];
|
|
3567
3710
|
}
|
|
3568
3711
|
|
|
3569
|
-
declare function insertDataItem$1(httpClient: HttpClient):
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
declare function
|
|
3588
|
-
|
|
3589
|
-
|
|
3712
|
+
declare function insertDataItem$1(httpClient: HttpClient): InsertDataItemSignature;
|
|
3713
|
+
interface InsertDataItemSignature {
|
|
3714
|
+
/**
|
|
3715
|
+
* Adds an item to a collection.
|
|
3716
|
+
*
|
|
3717
|
+
*
|
|
3718
|
+
* An item can only be inserted into an existing connection.
|
|
3719
|
+
* You can create a new collection using the Data Collections API.
|
|
3720
|
+
*
|
|
3721
|
+
* When an item is inserted into a collection, the item's ID is automatically assigned a random value.
|
|
3722
|
+
* You can optionally provide a custom ID in `dataItem.id` when inserting the item.
|
|
3723
|
+
* If you specify an ID that already exists in the collection, the insertion will fail.
|
|
3724
|
+
*
|
|
3725
|
+
* If `options.dataItem.data` is empty, a new item is created with no data fields.
|
|
3726
|
+
* @param - Options for adding an item to a collection.
|
|
3727
|
+
*/
|
|
3728
|
+
(options: InsertDataItemOptions): Promise<InsertDataItemResponse & InsertDataItemResponseNonNullableFields>;
|
|
3729
|
+
}
|
|
3730
|
+
declare function updateDataItem$1(httpClient: HttpClient): UpdateDataItemSignature;
|
|
3731
|
+
interface UpdateDataItemSignature {
|
|
3732
|
+
/**
|
|
3733
|
+
* Updates an item in a collection.
|
|
3734
|
+
*
|
|
3735
|
+
*
|
|
3736
|
+
* This function replaces the data item's existing data with the payload provided in `options.dataItem.data` in the request.
|
|
3737
|
+
*
|
|
3738
|
+
* To update an item, you need to specify an item ID and a collection ID.
|
|
3739
|
+
* If an item is found in the specified collection with the specified ID, that item is updated.
|
|
3740
|
+
* If the collection doesn't contain an item with that ID, the request fails.
|
|
3741
|
+
*
|
|
3742
|
+
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
3743
|
+
*
|
|
3744
|
+
* > **Note:**
|
|
3745
|
+
* > After an item is updated, it only contains the fields included in the `options.dataItem.data` payload in the `updateDataItem()` call.
|
|
3746
|
+
* > If the existing item has fields with values and those fields aren't included in the updated item, their values are lost.
|
|
3747
|
+
* @param - Data item ID.
|
|
3748
|
+
* @param - Options for updating an item in a collection.
|
|
3749
|
+
*/
|
|
3750
|
+
(_id: string, options: UpdateDataItemOptions): Promise<UpdateDataItemResponse & UpdateDataItemResponseNonNullableFields>;
|
|
3751
|
+
}
|
|
3752
|
+
declare function saveDataItem$1(httpClient: HttpClient): SaveDataItemSignature;
|
|
3753
|
+
interface SaveDataItemSignature {
|
|
3754
|
+
/**
|
|
3755
|
+
* Inserts or updates an item in a collection.
|
|
3756
|
+
*
|
|
3757
|
+
*
|
|
3758
|
+
* The `saveDataItem()` function inserts or updates the specified item, depending on whether it already exists in the collection.
|
|
3759
|
+
*
|
|
3760
|
+
* + If you don't provide an ID, a new item is created.
|
|
3761
|
+
*
|
|
3762
|
+
* + If you provide an ID that does not exist in the collection, a new item is created with that ID.
|
|
3763
|
+
*
|
|
3764
|
+
* + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
3765
|
+
*
|
|
3766
|
+
* > **Note:** When you provide an item with an ID that already exists in the collection, the payload you provide in `options.dataItem.data` replaces the existing item with that ID.
|
|
3767
|
+
* > This means that the item's previous fields and values are lost.
|
|
3768
|
+
* @param - Options for saving an item in a collection.
|
|
3769
|
+
*/
|
|
3770
|
+
(options: SaveDataItemOptions): Promise<SaveDataItemResponse & SaveDataItemResponseNonNullableFields>;
|
|
3771
|
+
}
|
|
3772
|
+
declare function getDataItem$1(httpClient: HttpClient): GetDataItemSignature;
|
|
3773
|
+
interface GetDataItemSignature {
|
|
3774
|
+
/**
|
|
3775
|
+
* Retrieves an item from a collection.
|
|
3776
|
+
*
|
|
3777
|
+
*
|
|
3778
|
+
* > **Note**: When calling `getDataItem()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
3779
|
+
* @param - ID of the data item to retrieve.
|
|
3780
|
+
* @param - Options for retrieving an item from a collection.
|
|
3781
|
+
* @returns Retrieved item.
|
|
3782
|
+
*/
|
|
3783
|
+
(dataItemId: string, options?: GetDataItemOptions | undefined): Promise<DataItem & DataItemNonNullableFields>;
|
|
3784
|
+
}
|
|
3785
|
+
declare function removeDataItem$1(httpClient: HttpClient): RemoveDataItemSignature;
|
|
3786
|
+
interface RemoveDataItemSignature {
|
|
3787
|
+
/**
|
|
3788
|
+
* Removes an item from a collection.
|
|
3789
|
+
*
|
|
3790
|
+
*
|
|
3791
|
+
* If any items in other collections reference the removed item in reference or multi-reference fields, those fields are cleared.
|
|
3792
|
+
*
|
|
3793
|
+
* > **Note:**
|
|
3794
|
+
* > Once an item has been removed from a collection, it can't be restored.
|
|
3795
|
+
* @param - ID of the item to remove.
|
|
3796
|
+
* @param - Options for removing an item from a collection.
|
|
3797
|
+
*/
|
|
3798
|
+
(dataItemId: string, options: RemoveDataItemOptions): Promise<RemoveDataItemResponse & RemoveDataItemResponseNonNullableFields>;
|
|
3799
|
+
}
|
|
3800
|
+
declare function truncateDataItems$1(httpClient: HttpClient): TruncateDataItemsSignature;
|
|
3801
|
+
interface TruncateDataItemsSignature {
|
|
3802
|
+
/**
|
|
3803
|
+
* Removes all items from a collection.
|
|
3804
|
+
*
|
|
3805
|
+
*
|
|
3806
|
+
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
3807
|
+
*
|
|
3808
|
+
* > **Note:**
|
|
3809
|
+
* > Once items have been removed from a collection, they can't be restored.
|
|
3810
|
+
* @param - Options for truncating data items from a collection.
|
|
3811
|
+
*/
|
|
3812
|
+
(options: TruncateDataItemsOptions): Promise<void>;
|
|
3813
|
+
}
|
|
3814
|
+
declare function queryDataItems$1(httpClient: HttpClient): QueryDataItemsSignature;
|
|
3815
|
+
interface QueryDataItemsSignature {
|
|
3816
|
+
/**
|
|
3817
|
+
* Creates a query to retrieve items from a database collection.
|
|
3818
|
+
*
|
|
3819
|
+
* The `queryDataItems()` function builds a query to retrieve data items from a collection and returns a `DataItemsQueryBuilder` object.
|
|
3820
|
+
*
|
|
3821
|
+
* The returned object contains the query definition which is typically used to run the query using the `find()` function.
|
|
3822
|
+
*
|
|
3823
|
+
* You can refine the query by chaining `DataItemsQueryBuilder` functions onto the query. `DataItemsQueryBuilder` functions enable you to sort, filter, and control the results that `queryDataItems()` returns.
|
|
3824
|
+
*
|
|
3825
|
+
* The `queryDataItems()` function runs with the following `DataItemsQueryBuilder` defaults that you can override:
|
|
3826
|
+
*
|
|
3827
|
+
* + `skip`: 0
|
|
3828
|
+
* + `limit`: 50
|
|
3829
|
+
* + `descending`: by `_createdDate`
|
|
3830
|
+
*
|
|
3831
|
+
* The functions that are chained to `queryDataItems()` are applied in the order they are called. For example, if you sort on an `age` field in ascending order and then on a `name` field in descending order, the results are sorted first by the age of the items and then, if there are multiple results with the same age, the items are sorted by name in descending order, per age value.
|
|
3832
|
+
*
|
|
3833
|
+
* If the collection that you are querying has references to other collections, by default the data from referenced collections is not retrieved. To get the data from referenced items, specify them in the `options.includeReferencedItems` parameter.
|
|
3834
|
+
*
|
|
3835
|
+
* > **Note**: When calling `queryDataItems()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
3836
|
+
*
|
|
3837
|
+
*
|
|
3838
|
+
* @param - Options for querying data items.
|
|
3839
|
+
*/
|
|
3840
|
+
(options: QueryDataItemsOptions): DataItemsQueryBuilder;
|
|
3841
|
+
}
|
|
3842
|
+
declare function aggregateDataItems$1(httpClient: HttpClient): AggregateDataItemsSignature;
|
|
3843
|
+
interface AggregateDataItemsSignature {
|
|
3844
|
+
/**
|
|
3845
|
+
* Runs an aggregation on a data collection and returns the resulting list of items.
|
|
3846
|
+
*
|
|
3847
|
+
*
|
|
3848
|
+
* An aggregation enables you to perform certain calculations on your collection data, or on groups of items that you define, to retrieve meaningful summaries.
|
|
3849
|
+
* You can also add paging, filtering, and sorting preferences to your aggregation to retrieve exactly what you need.
|
|
3850
|
+
* @param - Options for running an aggregation.
|
|
3851
|
+
*/
|
|
3852
|
+
(options?: AggregateDataItemsOptions | undefined): Promise<AggregateDataItemsResponse>;
|
|
3853
|
+
}
|
|
3854
|
+
declare function countDataItems$1(httpClient: HttpClient): CountDataItemsSignature;
|
|
3855
|
+
interface CountDataItemsSignature {
|
|
3856
|
+
/**
|
|
3857
|
+
* Counts the number of items in a data collection that match the provided filtering preferences.
|
|
3858
|
+
*
|
|
3859
|
+
* > **Note**: When calling `countDataItems()` following an update to your collection, the result returned may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
3860
|
+
* @param - Options for counting the number of items in a data collection.
|
|
3861
|
+
*/
|
|
3862
|
+
(options?: CountDataItemsOptions | undefined): Promise<CountDataItemsResponse & CountDataItemsResponseNonNullableFields>;
|
|
3863
|
+
}
|
|
3864
|
+
declare function queryDistinctValues$1(httpClient: HttpClient): QueryDistinctValuesSignature;
|
|
3865
|
+
interface QueryDistinctValuesSignature {
|
|
3866
|
+
/**
|
|
3867
|
+
* Retrieves a list of distinct values for a given field in all items that match a query, without duplicates.
|
|
3868
|
+
*
|
|
3869
|
+
*
|
|
3870
|
+
* As with `queryDataItems()`, this endpoint retrieves items based on the filtering, sorting, and paging preferences you provide.
|
|
3871
|
+
* However, `queryDistinctValues()` doesn't return all of the full items that match the query.
|
|
3872
|
+
* Rather, it returns all unique values of the field you specify in `options.fieldName` for items that match the query.
|
|
3873
|
+
* If more than one item has the same value for that field, that value appears only once.
|
|
3874
|
+
*
|
|
3875
|
+
* For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
3876
|
+
*
|
|
3877
|
+
* > **Note**: When calling `queryDistinctValues()` following an update to your collection, the data retrieved may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
3878
|
+
* @param - Options for querying distinct values.
|
|
3879
|
+
*/
|
|
3880
|
+
(options?: QueryDistinctValuesOptions | undefined): Promise<QueryDistinctValuesResponse>;
|
|
3881
|
+
}
|
|
3882
|
+
declare function bulkInsertDataItems$1(httpClient: HttpClient): BulkInsertDataItemsSignature;
|
|
3883
|
+
interface BulkInsertDataItemsSignature {
|
|
3884
|
+
/**
|
|
3885
|
+
* Adds multiple items to a collection.
|
|
3886
|
+
*
|
|
3887
|
+
*
|
|
3888
|
+
* When each item is inserted into a collection, its ID is automatically assigned a random value.
|
|
3889
|
+
* You can optionally provide your own ID when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail.
|
|
3890
|
+
* @param - Options for adding multiple items to a collection.
|
|
3891
|
+
*/
|
|
3892
|
+
(options?: BulkInsertDataItemsOptions | undefined): Promise<BulkInsertDataItemsResponse & BulkInsertDataItemsResponseNonNullableFields>;
|
|
3893
|
+
}
|
|
3894
|
+
declare function bulkUpdateDataItems$1(httpClient: HttpClient): BulkUpdateDataItemsSignature;
|
|
3895
|
+
interface BulkUpdateDataItemsSignature {
|
|
3896
|
+
/**
|
|
3897
|
+
* Updates multiple items in a collection.
|
|
3898
|
+
*
|
|
3899
|
+
*
|
|
3900
|
+
* This function replaces each specified data item's existing data with the payload provided in the request.
|
|
3901
|
+
*
|
|
3902
|
+
* Each item in the request must include an ID. If an item is found in the specified collection with
|
|
3903
|
+
* the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails.
|
|
3904
|
+
*
|
|
3905
|
+
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
3906
|
+
*
|
|
3907
|
+
* > **Note:**
|
|
3908
|
+
* > After each item is updated, it only contains the fields included in the request. If the existing item has fields with values and those fields
|
|
3909
|
+
* > aren't included in the updated item, their values are lost.
|
|
3910
|
+
* @param - Options for updating multiple items in a collection.
|
|
3911
|
+
*/
|
|
3912
|
+
(options?: BulkUpdateDataItemsOptions | undefined): Promise<BulkUpdateDataItemsResponse & BulkUpdateDataItemsResponseNonNullableFields>;
|
|
3913
|
+
}
|
|
3914
|
+
declare function bulkSaveDataItems$1(httpClient: HttpClient): BulkSaveDataItemsSignature;
|
|
3915
|
+
interface BulkSaveDataItemsSignature {
|
|
3916
|
+
/**
|
|
3917
|
+
* Inserts or updates multiple items in a collection.
|
|
3918
|
+
*
|
|
3919
|
+
*
|
|
3920
|
+
* This function inserts or updates each item provided, depending on whether it already exists in the collection. For each item:
|
|
3921
|
+
*
|
|
3922
|
+
* + If you don't provide an ID, a new item is created.
|
|
3923
|
+
*
|
|
3924
|
+
* + If you provide an ID that doesn't exist in the collection, a new item is created with that ID.
|
|
3925
|
+
*
|
|
3926
|
+
* + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
3927
|
+
*
|
|
3928
|
+
* > **Note:** When you provide an item with an ID that already exists in the collection, the item you provide completely replaces the existing item with that ID.
|
|
3929
|
+
* > This means that all of the item's previous fields and values are lost.
|
|
3930
|
+
* @param - Options for saving multiple items in a collection.
|
|
3931
|
+
*/
|
|
3932
|
+
(options?: BulkSaveDataItemsOptions | undefined): Promise<BulkSaveDataItemsResponse & BulkSaveDataItemsResponseNonNullableFields>;
|
|
3933
|
+
}
|
|
3934
|
+
declare function bulkRemoveDataItems$1(httpClient: HttpClient): BulkRemoveDataItemsSignature;
|
|
3935
|
+
interface BulkRemoveDataItemsSignature {
|
|
3936
|
+
/**
|
|
3937
|
+
* Removes multiple items from a collection.
|
|
3938
|
+
*
|
|
3939
|
+
*
|
|
3940
|
+
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
3941
|
+
*
|
|
3942
|
+
* > **Note:** Once an item has been removed from a collection, it can't be restored.
|
|
3943
|
+
* @param - Options for removing multiple items from a collection.
|
|
3944
|
+
*/
|
|
3945
|
+
(options: BulkRemoveDataItemsOptions): Promise<BulkRemoveDataItemsResponse & BulkRemoveDataItemsResponseNonNullableFields>;
|
|
3946
|
+
}
|
|
3947
|
+
declare function queryReferencedDataItems$1(httpClient: HttpClient): QueryReferencedDataItemsSignature;
|
|
3948
|
+
interface QueryReferencedDataItemsSignature {
|
|
3949
|
+
/**
|
|
3950
|
+
* Retrieves the full items referenced in the specified field of an item.
|
|
3951
|
+
*
|
|
3952
|
+
*
|
|
3953
|
+
* Reference and multi-reference fields refer to items in different collections.
|
|
3954
|
+
* Use this function to retrieve the full details of the referenced items themselves.
|
|
3955
|
+
*
|
|
3956
|
+
* For example, suppose you have a **Movies** collection with an **Actors** field that contains references to items in a **People** collection.
|
|
3957
|
+
* Querying the **Movies** collection using `queryReferencedDataItems()` returns the relevant **People** items referenced in the **Actors** field of the specified **Movie** item.
|
|
3958
|
+
* This gives you information from the **People** collection about each of the actors in the specified movie.
|
|
3959
|
+
*
|
|
3960
|
+
* > **Note**: When calling `queryReferencedDataItems()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
3961
|
+
* @param - Options for querying referenced data items.
|
|
3962
|
+
*/
|
|
3963
|
+
(options?: QueryReferencedDataItemsOptions | undefined): Promise<QueryReferencedDataItemsResponse & QueryReferencedDataItemsResponseNonNullableFields>;
|
|
3964
|
+
}
|
|
3965
|
+
declare function isReferencedDataItem$1(httpClient: HttpClient): IsReferencedDataItemSignature;
|
|
3966
|
+
interface IsReferencedDataItemSignature {
|
|
3967
|
+
/**
|
|
3968
|
+
* Checks whether a field in a referring item contains a reference to a specified item.
|
|
3969
|
+
*
|
|
3970
|
+
* > **Note**: When calling `isReferencedDataItem()` following an update to your collection, the result returned may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
3971
|
+
* @param - Options for checking whether a field contains a reference to an item.
|
|
3972
|
+
*/
|
|
3973
|
+
(options?: IsReferencedDataItemOptions | undefined): Promise<IsReferencedDataItemResponse & IsReferencedDataItemResponseNonNullableFields>;
|
|
3974
|
+
}
|
|
3975
|
+
declare function insertDataItemReference$1(httpClient: HttpClient): InsertDataItemReferenceSignature;
|
|
3976
|
+
interface InsertDataItemReferenceSignature {
|
|
3977
|
+
/**
|
|
3978
|
+
* Inserts a reference in the specified field in an item in a collection.
|
|
3979
|
+
*
|
|
3980
|
+
*
|
|
3981
|
+
* A reference in `options.dataItemReference` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
3982
|
+
* @param - Options for inserting a reference.
|
|
3983
|
+
*/
|
|
3984
|
+
(options?: InsertDataItemReferenceOptions | undefined): Promise<InsertDataItemReferenceResponse & InsertDataItemReferenceResponseNonNullableFields>;
|
|
3985
|
+
}
|
|
3986
|
+
declare function removeDataItemReference$1(httpClient: HttpClient): RemoveDataItemReferenceSignature;
|
|
3987
|
+
interface RemoveDataItemReferenceSignature {
|
|
3988
|
+
/**
|
|
3989
|
+
* Removes the specified reference from the specified field.
|
|
3990
|
+
* @param - Options for removing a reference.
|
|
3991
|
+
*/
|
|
3992
|
+
(options: RemoveDataItemReferenceOptions): Promise<RemoveDataItemReferenceResponse & RemoveDataItemReferenceResponseNonNullableFields>;
|
|
3993
|
+
}
|
|
3994
|
+
declare function bulkInsertDataItemReferences$1(httpClient: HttpClient): BulkInsertDataItemReferencesSignature;
|
|
3995
|
+
interface BulkInsertDataItemReferencesSignature {
|
|
3996
|
+
/**
|
|
3997
|
+
* Inserts one or more references in the specified fields of items in a collection.
|
|
3998
|
+
*
|
|
3999
|
+
*
|
|
4000
|
+
* This endpoint adds one or more references to a collection.
|
|
4001
|
+
* Each new reference in `options.dataItemReferences` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
4002
|
+
* @param - Options for inserting one or more references.
|
|
4003
|
+
*/
|
|
4004
|
+
(options?: BulkInsertDataItemReferencesOptions | undefined): Promise<BulkInsertDataItemReferencesResponse & BulkInsertDataItemReferencesResponseNonNullableFields>;
|
|
4005
|
+
}
|
|
4006
|
+
declare function bulkRemoveDataItemReferences$1(httpClient: HttpClient): BulkRemoveDataItemReferencesSignature;
|
|
4007
|
+
interface BulkRemoveDataItemReferencesSignature {
|
|
4008
|
+
/**
|
|
4009
|
+
* Removes one or more references.
|
|
4010
|
+
* @param - Options for removing one or more references.
|
|
4011
|
+
*/
|
|
4012
|
+
(options: BulkRemoveDataItemReferencesOptions): Promise<BulkRemoveDataItemReferencesResponse & BulkRemoveDataItemReferencesResponseNonNullableFields>;
|
|
4013
|
+
}
|
|
4014
|
+
declare function replaceDataItemReferences$1(httpClient: HttpClient): ReplaceDataItemReferencesSignature;
|
|
4015
|
+
interface ReplaceDataItemReferencesSignature {
|
|
4016
|
+
/**
|
|
4017
|
+
* Replaces references in a specified field of a specified data item.
|
|
4018
|
+
*
|
|
4019
|
+
*
|
|
4020
|
+
* This function replaces the existing reference or references contained in the field specified in `options.referringItemFieldName` within the data item specified in `options.referringItemId`.
|
|
4021
|
+
* The function removes existing references and in their place it adds references to the items specified in `options.newReferencedItemIds`.
|
|
4022
|
+
*
|
|
4023
|
+
* > **Note:** If you pass an empty array in `options.newReferencedItemIds`, all existing references are removed.
|
|
4024
|
+
* @param - Options for replacing references.
|
|
4025
|
+
*/
|
|
4026
|
+
(options?: ReplaceDataItemReferencesOptions | undefined): Promise<ReplaceDataItemReferencesResponse & ReplaceDataItemReferencesResponseNonNullableFields>;
|
|
4027
|
+
}
|
|
3590
4028
|
declare const onDataItemCreated$1: EventDefinition<DataItemCreatedEnvelope, "wix.data.v2.data_item_created">;
|
|
3591
4029
|
declare const onDataItemUpdated$1: EventDefinition<DataItemUpdatedEnvelope, "wix.data.v2.data_item_updated">;
|
|
3592
4030
|
declare const onDataItemDeleted$1: EventDefinition<DataItemDeletedEnvelope, "wix.data.v2.data_item_deleted">;
|
|
@@ -3639,12 +4077,21 @@ type _publicReplaceDataItemReferencesType = typeof replaceDataItemReferences$1;
|
|
|
3639
4077
|
declare const replaceDataItemReferences: ReturnType<typeof createRESTModule$1<_publicReplaceDataItemReferencesType>>;
|
|
3640
4078
|
|
|
3641
4079
|
type _publicOnDataItemCreatedType = typeof onDataItemCreated$1;
|
|
4080
|
+
/**
|
|
4081
|
+
* Triggered when a data item is inserted.
|
|
4082
|
+
*/
|
|
3642
4083
|
declare const onDataItemCreated: ReturnType<typeof createEventModule<_publicOnDataItemCreatedType>>;
|
|
3643
4084
|
|
|
3644
4085
|
type _publicOnDataItemUpdatedType = typeof onDataItemUpdated$1;
|
|
4086
|
+
/**
|
|
4087
|
+
* Triggered when a data item is updated.
|
|
4088
|
+
*/
|
|
3645
4089
|
declare const onDataItemUpdated: ReturnType<typeof createEventModule<_publicOnDataItemUpdatedType>>;
|
|
3646
4090
|
|
|
3647
4091
|
type _publicOnDataItemDeletedType = typeof onDataItemDeleted$1;
|
|
4092
|
+
/**
|
|
4093
|
+
* Triggered when a data item is deleted.
|
|
4094
|
+
*/
|
|
3648
4095
|
declare const onDataItemDeleted: ReturnType<typeof createEventModule<_publicOnDataItemDeletedType>>;
|
|
3649
4096
|
|
|
3650
4097
|
type context$1_ACTION = ACTION;
|
|
@@ -4023,9 +4470,51 @@ interface ListIndexesOptions {
|
|
|
4023
4470
|
paging?: Paging;
|
|
4024
4471
|
}
|
|
4025
4472
|
|
|
4026
|
-
declare function createIndex$1(httpClient: HttpClient):
|
|
4027
|
-
|
|
4028
|
-
|
|
4473
|
+
declare function createIndex$1(httpClient: HttpClient): CreateIndexSignature;
|
|
4474
|
+
interface CreateIndexSignature {
|
|
4475
|
+
/**
|
|
4476
|
+
* Creates an index for a data collection.
|
|
4477
|
+
*
|
|
4478
|
+
* The index can't be used immediately, as the process of generating the index takes time.
|
|
4479
|
+
* You can check whether your index is ready using `listIndexes()`.
|
|
4480
|
+
*
|
|
4481
|
+
* Note that when an index fails to create, the failed index still occupies a slot.
|
|
4482
|
+
* To remove the failed index and free up the slot for a new index, use `dropIndex()`.
|
|
4483
|
+
* @param - ID of the data collection for which to generate the index.
|
|
4484
|
+
* @param - Details of the index to be created.
|
|
4485
|
+
* @param - Options for creating an index.
|
|
4486
|
+
* @returns Details of the index being generated.
|
|
4487
|
+
*/
|
|
4488
|
+
(dataCollectionId: string, index: Index): Promise<Index & IndexNonNullableFields>;
|
|
4489
|
+
}
|
|
4490
|
+
declare function dropIndex$1(httpClient: HttpClient): DropIndexSignature;
|
|
4491
|
+
interface DropIndexSignature {
|
|
4492
|
+
/**
|
|
4493
|
+
* Removes an index from a data collection.
|
|
4494
|
+
*
|
|
4495
|
+
* The process of dropping an index from a collection takes time.
|
|
4496
|
+
* You can check whether your index has been dropped by calling `listIndexes()`.
|
|
4497
|
+
* @param - ID of the data collection for which the index to be dropped is defined.
|
|
4498
|
+
* @param - Name of the index to drop.
|
|
4499
|
+
* @param - Options for dropping an index.
|
|
4500
|
+
*/
|
|
4501
|
+
(dataCollectionId: string, indexName: string): Promise<void>;
|
|
4502
|
+
}
|
|
4503
|
+
declare function listIndexes$1(httpClient: HttpClient): ListIndexesSignature;
|
|
4504
|
+
interface ListIndexesSignature {
|
|
4505
|
+
/**
|
|
4506
|
+
* Lists all indexes defined for a data collection.
|
|
4507
|
+
*
|
|
4508
|
+
* When an index's status is `ACTIVE`, it is ready to use.
|
|
4509
|
+
* While it is still being created, its status is `BUILDING`.
|
|
4510
|
+
*
|
|
4511
|
+
* When an index's status is `DROPPED`, it has been dropped successfully.
|
|
4512
|
+
* While it is still in the process of being removed, its status is `DROPPING`.
|
|
4513
|
+
* @param - ID of the data collection for which to list indexes.
|
|
4514
|
+
* @param - Options for retrieving a list of indexes.
|
|
4515
|
+
*/
|
|
4516
|
+
(dataCollectionId: string, options?: ListIndexesOptions | undefined): Promise<ListIndexesResponse & ListIndexesResponseNonNullableFields>;
|
|
4517
|
+
}
|
|
4029
4518
|
|
|
4030
4519
|
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
4031
4520
|
|