@wix/data 1.0.0
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 +4 -0
- package/build/cjs/index.js +27 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.http.d.ts +29 -0
- package/build/cjs/src/data-v1-external-database-connection.http.js +397 -0
- package/build/cjs/src/data-v1-external-database-connection.http.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.public.d.ts +11 -0
- package/build/cjs/src/data-v1-external-database-connection.public.js +36 -0
- package/build/cjs/src/data-v1-external-database-connection.public.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.types.d.ts +53 -0
- package/build/cjs/src/data-v1-external-database-connection.types.js +3 -0
- package/build/cjs/src/data-v1-external-database-connection.types.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +129 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.js +334 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.http.d.ts +37 -0
- package/build/cjs/src/data-v2-data-collection.http.js +458 -0
- package/build/cjs/src/data-v2-data-collection.http.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.public.d.ts +12 -0
- package/build/cjs/src/data-v2-data-collection.public.js +48 -0
- package/build/cjs/src/data-v2-data-collection.public.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.types.d.ts +638 -0
- package/build/cjs/src/data-v2-data-collection.types.js +143 -0
- package/build/cjs/src/data-v2-data-collection.types.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.universal.d.ts +732 -0
- package/build/cjs/src/data-v2-data-collection.universal.js +532 -0
- package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.http.d.ts +192 -0
- package/build/cjs/src/data-v2-data-item.http.js +944 -0
- package/build/cjs/src/data-v2-data-item.http.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.public.d.ts +28 -0
- package/build/cjs/src/data-v2-data-item.public.js +137 -0
- package/build/cjs/src/data-v2-data-item.public.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.types.d.ts +656 -0
- package/build/cjs/src/data-v2-data-item.types.js +27 -0
- package/build/cjs/src/data-v2-data-item.types.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.universal.d.ts +1343 -0
- package/build/cjs/src/data-v2-data-item.universal.js +1435 -0
- package/build/cjs/src/data-v2-data-item.universal.js.map +1 -0
- package/build/cjs/src/data-v2-index.http.d.ts +29 -0
- package/build/cjs/src/data-v2-index.http.js +349 -0
- package/build/cjs/src/data-v2-index.http.js.map +1 -0
- package/build/cjs/src/data-v2-index.public.d.ts +10 -0
- package/build/cjs/src/data-v2-index.public.js +28 -0
- package/build/cjs/src/data-v2-index.public.js.map +1 -0
- package/build/cjs/src/data-v2-index.types.d.ts +120 -0
- package/build/cjs/src/data-v2-index.types.js +35 -0
- package/build/cjs/src/data-v2-index.types.js.map +1 -0
- package/build/cjs/src/data-v2-index.universal.d.ts +182 -0
- package/build/cjs/src/data-v2-index.universal.js +261 -0
- package/build/cjs/src/data-v2-index.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -0
- package/build/es/index.js +5 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.http.d.ts +29 -0
- package/build/es/src/data-v1-external-database-connection.http.js +389 -0
- package/build/es/src/data-v1-external-database-connection.http.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.public.d.ts +11 -0
- package/build/es/src/data-v1-external-database-connection.public.js +28 -0
- package/build/es/src/data-v1-external-database-connection.public.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.types.d.ts +53 -0
- package/build/es/src/data-v1-external-database-connection.types.js +2 -0
- package/build/es/src/data-v1-external-database-connection.types.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.universal.d.ts +129 -0
- package/build/es/src/data-v1-external-database-connection.universal.js +307 -0
- package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -0
- package/build/es/src/data-v2-data-collection.http.d.ts +37 -0
- package/build/es/src/data-v2-data-collection.http.js +450 -0
- package/build/es/src/data-v2-data-collection.http.js.map +1 -0
- package/build/es/src/data-v2-data-collection.public.d.ts +12 -0
- package/build/es/src/data-v2-data-collection.public.js +29 -0
- package/build/es/src/data-v2-data-collection.public.js.map +1 -0
- package/build/es/src/data-v2-data-collection.types.d.ts +638 -0
- package/build/es/src/data-v2-data-collection.types.js +140 -0
- package/build/es/src/data-v2-data-collection.types.js.map +1 -0
- package/build/es/src/data-v2-data-collection.universal.d.ts +732 -0
- package/build/es/src/data-v2-data-collection.universal.js +505 -0
- package/build/es/src/data-v2-data-collection.universal.js.map +1 -0
- package/build/es/src/data-v2-data-item.http.d.ts +192 -0
- package/build/es/src/data-v2-data-item.http.js +920 -0
- package/build/es/src/data-v2-data-item.http.js.map +1 -0
- package/build/es/src/data-v2-data-item.public.d.ts +28 -0
- package/build/es/src/data-v2-data-item.public.js +109 -0
- package/build/es/src/data-v2-data-item.public.js.map +1 -0
- package/build/es/src/data-v2-data-item.types.d.ts +656 -0
- package/build/es/src/data-v2-data-item.types.js +24 -0
- package/build/es/src/data-v2-data-item.types.js.map +1 -0
- package/build/es/src/data-v2-data-item.universal.d.ts +1343 -0
- package/build/es/src/data-v2-data-item.universal.js +1392 -0
- package/build/es/src/data-v2-data-item.universal.js.map +1 -0
- package/build/es/src/data-v2-index.http.d.ts +29 -0
- package/build/es/src/data-v2-index.http.js +343 -0
- package/build/es/src/data-v2-index.http.js.map +1 -0
- package/build/es/src/data-v2-index.public.d.ts +10 -0
- package/build/es/src/data-v2-index.public.js +19 -0
- package/build/es/src/data-v2-index.public.js.map +1 -0
- package/build/es/src/data-v2-index.types.d.ts +120 -0
- package/build/es/src/data-v2-index.types.js +32 -0
- package/build/es/src/data-v2-index.types.js.map +1 -0
- package/build/es/src/data-v2-index.universal.d.ts +182 -0
- package/build/es/src/data-v2-index.universal.js +236 -0
- package/build/es/src/data-v2-index.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { AggregateDataItemsRequest, AggregateDataItemsResponse, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesResponse, BulkInsertDataItemsRequest, BulkInsertDataItemsResponse, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesResponse, BulkRemoveDataItemsRequest, BulkRemoveDataItemsResponse, BulkSaveDataItemsRequest, BulkSaveDataItemsResponse, BulkUpdateDataItemsRequest, BulkUpdateDataItemsResponse, CountDataItemsRequest, CountDataItemsResponse, GetDataItemRequest, GetDataItemResponse, InsertDataItemReferenceRequest, InsertDataItemReferenceResponse, InsertDataItemRequest, InsertDataItemResponse, IsReferencedDataItemRequest, IsReferencedDataItemResponse, QueryDataItemsRequest, QueryDataItemsResponse, QueryDistinctValuesRequest, QueryDistinctValuesResponse, QueryReferencedDataItemsRequest, QueryReferencedDataItemsResponse, RemoveDataItemReferenceRequest, RemoveDataItemReferenceResponse, RemoveDataItemRequest, RemoveDataItemResponse, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesResponse, SaveDataItemRequest, SaveDataItemResponse, TruncateDataItemsRequest, TruncateDataItemsResponse, UpdateDataItemRequest, UpdateDataItemResponse } from './data-v2-data-item.types';
|
|
3
|
+
/**
|
|
4
|
+
* Adds an item to a collection.
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* An item can only be inserted into an existing connection.
|
|
8
|
+
* You can create a new collection using the [Data Collections API](https://dev.wix.com/api/rest/wix-data/wix-data/data-collections).
|
|
9
|
+
*
|
|
10
|
+
* When an item is inserted into a collection, the item's ID is automatically assigned a random value.
|
|
11
|
+
* You can optionally provide a custom ID in `dataItem.id` when inserting the item.
|
|
12
|
+
* If you specify an ID that already exists in the collection, the insertion will fail.
|
|
13
|
+
*
|
|
14
|
+
* If `dataItem.data` is empty, a new item is created with no data fields.
|
|
15
|
+
*/
|
|
16
|
+
export declare function insertDataItem(payload: InsertDataItemRequest): RequestOptionsFactory<InsertDataItemResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Updates an item in a collection.
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* This endpoint replaces the data item's existing data with the payload provided in `dataItem.data` in the request.
|
|
22
|
+
*
|
|
23
|
+
* To update an item, you need to specify an item ID and a collection ID.
|
|
24
|
+
* If an item is found in the specified collection with the specified ID, that item is updated.
|
|
25
|
+
* If the collection doesn't contain an item with that ID, the request fails.
|
|
26
|
+
*
|
|
27
|
+
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
28
|
+
*
|
|
29
|
+
* > **Note:**
|
|
30
|
+
* > After an item is updated, it only contains the fields included in the `dataItem.data` payload in Update Data Item request.
|
|
31
|
+
* > If the existing item has fields with values and those fields aren't included in the updated item, their values are lost.
|
|
32
|
+
*/
|
|
33
|
+
export declare function updateDataItem(payload: UpdateDataItemRequest): RequestOptionsFactory<UpdateDataItemResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Inserts or updates an item in a collection.
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* The Save Data Item endpoint inserts or updates the specified item, depending on whether it already exists in the collection.
|
|
39
|
+
*
|
|
40
|
+
* + If you don't provide an ID, a new item is created.
|
|
41
|
+
*
|
|
42
|
+
* + If you provide an ID that does not exist in the collection, a new item is created with that ID.
|
|
43
|
+
*
|
|
44
|
+
* + 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.
|
|
45
|
+
*
|
|
46
|
+
* > **Note:** When you provide an item with an ID that already exists in the collection, the payload you provide in `dataItem.data` replaces the existing item with that ID.
|
|
47
|
+
* > This means that the item's previous fields and values are lost.
|
|
48
|
+
*/
|
|
49
|
+
export declare function saveDataItem(payload: SaveDataItemRequest): RequestOptionsFactory<SaveDataItemResponse>;
|
|
50
|
+
/** Retrieves an item from a collection. */
|
|
51
|
+
export declare function getDataItem(payload: GetDataItemRequest): RequestOptionsFactory<GetDataItemResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Removes an item from a collection.
|
|
54
|
+
*
|
|
55
|
+
*
|
|
56
|
+
* If any items in other collections reference the removed item in reference or multi-reference fields, those fields are cleared.
|
|
57
|
+
*
|
|
58
|
+
* > **Note:**
|
|
59
|
+
* > Once an item has been removed from a collection, it can't be restored.
|
|
60
|
+
*/
|
|
61
|
+
export declare function removeDataItem(payload: RemoveDataItemRequest): RequestOptionsFactory<RemoveDataItemResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Removes all items from a collection.
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
67
|
+
*
|
|
68
|
+
* > **Note:**
|
|
69
|
+
* > Once items have been removed from a collection, they can't be restored.
|
|
70
|
+
*/
|
|
71
|
+
export declare function truncateDataItems(payload: TruncateDataItemsRequest): RequestOptionsFactory<TruncateDataItemsResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Retrieves a list of items, on the basis of the filtering, sorting, and paging preferences you provide.
|
|
74
|
+
*
|
|
75
|
+
*
|
|
76
|
+
* For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
77
|
+
*/
|
|
78
|
+
export declare function queryDataItems(payload: QueryDataItemsRequest): RequestOptionsFactory<QueryDataItemsResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* Runs an aggregation on a data collection and returns the resulting list of items.
|
|
81
|
+
*
|
|
82
|
+
*
|
|
83
|
+
* An aggregation enables you to perform certain calculations on your collection data, or on groups of items that you define, to retrieve meaningful summaries.
|
|
84
|
+
* You can also add paging, filtering, and sorting preferences to your aggregation to retrieve exactly what you need.
|
|
85
|
+
*/
|
|
86
|
+
export declare function aggregateDataItems(payload: AggregateDataItemsRequest): RequestOptionsFactory<AggregateDataItemsResponse>;
|
|
87
|
+
/** Counts the number of items in a data collection that match the provided filtering preferences. */
|
|
88
|
+
export declare function countDataItems(payload: CountDataItemsRequest): RequestOptionsFactory<CountDataItemsResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves a list of distinct values for a given field in all items that match a query, without duplicates.
|
|
91
|
+
*
|
|
92
|
+
*
|
|
93
|
+
* As with the [Query Data Items](https://dev.wix.com/api/rest/wix-data/wix-data/data-items/query-data-items) endpoint, this endpoint retrieves items based on the filtering, sorting, and paging preferences you provide.
|
|
94
|
+
* However, the Query Distinct Values endpoint doesn't return all of the full items that match the query.
|
|
95
|
+
* Rather, it returns all unique values of the field you specify in `fieldName` for items that match the query.
|
|
96
|
+
* If more than one item has the same value for that field, that value appears only once.
|
|
97
|
+
*
|
|
98
|
+
* For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
99
|
+
*/
|
|
100
|
+
export declare function queryDistinctValues(payload: QueryDistinctValuesRequest): RequestOptionsFactory<QueryDistinctValuesResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* Adds multiple items to a collection.
|
|
103
|
+
*
|
|
104
|
+
*
|
|
105
|
+
* When each item is inserted into a collection, its ID is automatically assigned to random value.
|
|
106
|
+
* 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.
|
|
107
|
+
*/
|
|
108
|
+
export declare function bulkInsertDataItems(payload: BulkInsertDataItemsRequest): RequestOptionsFactory<BulkInsertDataItemsResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Updates multiple items in a collection.
|
|
111
|
+
*
|
|
112
|
+
*
|
|
113
|
+
* This endpoint replaces each specified data item's existing data with the payload provided in the request.
|
|
114
|
+
*
|
|
115
|
+
* Each item in the request must include an ID. If an item is found in the specified collection with
|
|
116
|
+
* the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails.
|
|
117
|
+
*
|
|
118
|
+
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
119
|
+
*
|
|
120
|
+
* > **Note:**
|
|
121
|
+
* > 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
|
|
122
|
+
* > aren't included in the updated item, their values are lost.
|
|
123
|
+
*/
|
|
124
|
+
export declare function bulkUpdateDataItems(payload: BulkUpdateDataItemsRequest): RequestOptionsFactory<BulkUpdateDataItemsResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Inserts or updates multiple items in a collection.
|
|
127
|
+
*
|
|
128
|
+
*
|
|
129
|
+
* The Bulk Save Data Items endpoint inserts or updates each item provided, depending on whether it already exists in the collection. For each item:
|
|
130
|
+
*
|
|
131
|
+
* + If you don't provide an ID, a new item is created.
|
|
132
|
+
*
|
|
133
|
+
* + If you provide an ID that doesn't exist in the collection, a new item is created with that ID.
|
|
134
|
+
*
|
|
135
|
+
* + 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.
|
|
136
|
+
*
|
|
137
|
+
* > **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.
|
|
138
|
+
* > This means that all of the item's previous fields and values are lost.
|
|
139
|
+
*/
|
|
140
|
+
export declare function bulkSaveDataItems(payload: BulkSaveDataItemsRequest): RequestOptionsFactory<BulkSaveDataItemsResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* Removes multiple items from a collection.
|
|
143
|
+
*
|
|
144
|
+
*
|
|
145
|
+
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
146
|
+
*
|
|
147
|
+
* > **Note:** Once an item has been removed from a collection, it can't be restored.
|
|
148
|
+
*/
|
|
149
|
+
export declare function bulkRemoveDataItems(payload: BulkRemoveDataItemsRequest): RequestOptionsFactory<BulkRemoveDataItemsResponse>;
|
|
150
|
+
/**
|
|
151
|
+
* Retrieves the full items referenced in the specified field of an item.
|
|
152
|
+
*
|
|
153
|
+
*
|
|
154
|
+
* Reference and multi-reference fields refer to items in different collections.
|
|
155
|
+
* Use this endpoint to retrieve the full details of the referenced items themselves.
|
|
156
|
+
*
|
|
157
|
+
* For example, suppose you have a **Movies** collection with an **Actors** field that contains references to items in a **People** collection.
|
|
158
|
+
* Querying the **Movies** collection using the Query Referenced Data Items endpoint returns the relevant **People** items referenced in the **Actors** field of the specified **Movie** item.
|
|
159
|
+
* This gives you information from the **People** collection about each of the actors in the specified movie.
|
|
160
|
+
*/
|
|
161
|
+
export declare function queryReferencedDataItems(payload: QueryReferencedDataItemsRequest): RequestOptionsFactory<QueryReferencedDataItemsResponse>;
|
|
162
|
+
/** Checks whether a field in a referring item contains a reference to a specified item. */
|
|
163
|
+
export declare function isReferencedDataItem(payload: IsReferencedDataItemRequest): RequestOptionsFactory<IsReferencedDataItemResponse>;
|
|
164
|
+
/**
|
|
165
|
+
* Inserts a reference in the specified field in an item in a collection.
|
|
166
|
+
*
|
|
167
|
+
*
|
|
168
|
+
* A reference in the `dataItemReference` field specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
169
|
+
*/
|
|
170
|
+
export declare function insertDataItemReference(payload: InsertDataItemReferenceRequest): RequestOptionsFactory<InsertDataItemReferenceResponse>;
|
|
171
|
+
/** Removes the specified reference from the specified field. */
|
|
172
|
+
export declare function removeDataItemReference(payload: RemoveDataItemReferenceRequest): RequestOptionsFactory<RemoveDataItemReferenceResponse>;
|
|
173
|
+
/**
|
|
174
|
+
* Inserts one or more references in the specified fields of items in a collection.
|
|
175
|
+
*
|
|
176
|
+
*
|
|
177
|
+
* This endpoint adds one or more references to a collection.
|
|
178
|
+
* Each new reference in the `dataItemReferences` field specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
179
|
+
*/
|
|
180
|
+
export declare function bulkInsertDataItemReferences(payload: BulkInsertDataItemReferencesRequest): RequestOptionsFactory<BulkInsertDataItemReferencesResponse>;
|
|
181
|
+
/** Removes one or more references. */
|
|
182
|
+
export declare function bulkRemoveDataItemReferences(payload: BulkRemoveDataItemReferencesRequest): RequestOptionsFactory<BulkRemoveDataItemReferencesResponse>;
|
|
183
|
+
/**
|
|
184
|
+
* Replaces references in a specified field of a specified data item.
|
|
185
|
+
*
|
|
186
|
+
*
|
|
187
|
+
* This endpoint replaces the existing reference or references contained in the field specified in `referringItemFieldName` within the data item specified in `referringItemId`.
|
|
188
|
+
* The endpoint removes existing references and in their place it adds references to the items specified in `newReferencedItemIds`.
|
|
189
|
+
*
|
|
190
|
+
* > **Note:** If you pass an empty array in `newReferencedItemIds`, all existing references are removed.
|
|
191
|
+
*/
|
|
192
|
+
export declare function replaceDataItemReferences(payload: ReplaceDataItemReferencesRequest): RequestOptionsFactory<ReplaceDataItemReferencesResponse>;
|