@wix/ditto-codegen-public 1.0.162 → 1.0.163
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/dist/docs-output/api-docs/bookings-bookings-onBookingCanceled-doc.txt +169 -0
- package/dist/docs-output/api-docs/bookings-bookings-onBookingCreated-doc.txt +154 -0
- package/dist/docs-output/api-docs/crm-contacts-onContactCreated-doc.txt +87 -171
- package/dist/docs-output/api-docs/crm-contacts-onContactDeleted-doc.txt +58 -0
- package/dist/docs-output/api-docs/crm-contacts-onContactUpdated-doc.txt +99 -0
- package/dist/docs-output/api-docs/data-items-get-doc.txt +95 -54
- package/dist/docs-output/api-docs/data-items-insert-doc.txt +235 -43
- package/dist/docs-output/api-docs/data-items-onDataItemCreated-doc.txt +61 -0
- package/dist/docs-output/api-docs/data-items-onDataItemDeleted-doc.txt +58 -0
- package/dist/docs-output/api-docs/data-items-onDataItemUpdated-doc.txt +61 -0
- package/dist/docs-output/api-docs/data-items-query-doc.txt +507 -302
- package/dist/docs-output/api-docs/data-items-remove-doc.txt +120 -40
- package/dist/docs-output/api-docs/data-items-update-doc.txt +425 -46
- package/dist/docs-output/api-docs/ecom-cart-addToCart-doc.txt +488 -0
- package/dist/docs-output/api-docs/ecom-cart-createCart-doc.txt +518 -0
- package/dist/docs-output/api-docs/ecom-cart-createCheckout-doc.txt +155 -0
- package/dist/docs-output/api-docs/ecom-cart-deleteCart-doc.txt +92 -0
- package/dist/docs-output/api-docs/ecom-cart-getCart-doc.txt +376 -0
- package/dist/docs-output/api-docs/ecom-cart-onCartCreated-doc.txt +89 -80
- package/dist/docs-output/api-docs/ecom-cart-onCartUpdated-doc.txt +91 -81
- package/dist/docs-output/api-docs/ecom-cart-removeLineItemsFromCart-doc.txt +321 -0
- package/dist/docs-output/api-docs/ecom-cart-updateCart-doc.txt +539 -0
- package/dist/docs-output/api-docs/ecom-checkout-addToCheckout-doc.txt +1005 -0
- package/dist/docs-output/api-docs/ecom-checkout-createCheckout-doc.txt +1641 -0
- package/dist/docs-output/api-docs/ecom-checkout-getCheckout-doc.txt +1027 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCompleted-doc.txt +151 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCreated-doc.txt +150 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutUpdated-doc.txt +150 -0
- package/dist/docs-output/api-docs/ecom-checkout-removeLineItemsFromCheckout-doc.txt +879 -0
- package/dist/docs-output/api-docs/ecom-checkout-updateCheckout-doc.txt +1011 -0
- package/dist/docs-output/api-docs/ecom-currentCart-getCurrentCart-doc.txt +368 -322
- package/dist/docs-output/api-docs/ecom-currentCart-updateCurrentCart-doc.txt +506 -321
- package/dist/docs-output/api-docs/ecom-orders-bulkUpdateOrders-doc.txt +1040 -0
- package/dist/docs-output/api-docs/ecom-orders-cancelOrder-doc.txt +608 -0
- package/dist/docs-output/api-docs/ecom-orders-getOrder-doc.txt +926 -0
- package/dist/docs-output/api-docs/ecom-orders-onOrderCreated-doc.txt +245 -0
- package/dist/docs-output/api-docs/ecom-orders-onOrderUpdated-doc.txt +244 -0
- package/dist/docs-output/api-docs/ecom-orders-searchOrders-doc.txt +670 -0
- package/dist/docs-output/api-docs/ecom-orders-updateOrder-doc.txt +818 -0
- package/dist/docs-output/api-docs/search-wixSiteSearch-search-doc.txt +162 -0
- package/dist/docs-output/api-docs/stores-collections-addProductsToCollection-doc.txt +86 -0
- package/dist/docs-output/api-docs/stores-collections-createCollection-doc.txt +108 -0
- package/dist/docs-output/api-docs/stores-collections-getCollection-doc.txt +102 -0
- package/dist/docs-output/api-docs/stores-collections-queryCollections-doc.txt +209 -0
- package/dist/docs-output/api-docs/stores-collections-removeProductsFromCollection-doc.txt +86 -0
- package/dist/docs-output/api-docs/stores-collections-updateCollection-doc.txt +110 -0
- package/dist/docs-output/api-docs/stores-inventory-queryInventory-doc.txt +98 -0
- package/dist/docs-output/api-docs/stores-inventory-updateInventoryVariants-doc.txt +249 -0
- package/dist/docs-output/api-docs/stores-inventoryItemsV3-queryInventoryItems-doc.txt +236 -0
- package/dist/docs-output/api-docs/stores-inventoryItemsV3-updateInventoryItem-doc.txt +139 -0
- package/dist/docs-output/api-docs/stores-productsV3-createProduct-doc.txt +1697 -0
- package/dist/docs-output/api-docs/stores-productsV3-deleteProduct-doc.txt +73 -0
- package/dist/docs-output/api-docs/stores-productsV3-getProduct-doc.txt +933 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductCreated-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductDeleted-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductUpdated-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-queryProducts-doc.txt +1051 -0
- package/dist/docs-output/api-docs/stores-productsV3-searchProducts-doc.txt +1144 -0
- package/dist/docs-output/api-docs/stores-productsV3-updateProduct-doc.txt +1730 -1600
- package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-queryVariants-doc.txt +290 -0
- package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-searchVariants-doc.txt +353 -0
- package/dist/out.js +929 -79
- package/package.json +2 -2
- package/dist/docs-output/api-docs/data-items-onDataItemCreated.txt +0 -103
- package/dist/docs-output/api-docs/stores-product-onProductCreated-doc.txt +0 -118
- package/dist/docs-output/api-docs/stores-productV3-onProductCreated-doc.txt +0 -184
|
@@ -1,55 +1,247 @@
|
|
|
1
1
|
<data_items_insert>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
- Store form submissions or user-generated content in a collection
|
|
5
|
-
- Create new records when processing e-commerce orders or bookings
|
|
6
|
-
- Populate collections with data from external APIs or imports
|
|
7
|
-
- Add items with custom IDs for integration with external systems
|
|
8
|
-
- Store user preferences or settings in a collection
|
|
9
|
-
- Create audit logs or activity records
|
|
10
|
-
- Add items with references to other collections
|
|
11
|
-
</use_cases>
|
|
12
|
-
|
|
13
|
-
<usage>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
14
4
|
|
|
5
|
+
data.items.insert(dataCollectionId: string, item: Partial, options: WixDataInsertOptions)
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/data/items/insert
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Adds an item to a collection.
|
|
14
|
+
|
|
15
|
+
An item can only be inserted into an existing collection. You can create a new collection using the
|
|
16
|
+
Data Collections API.
|
|
17
|
+
|
|
18
|
+
The `insert()` method returns a Promise that resolves to the inserted item
|
|
19
|
+
after it has been added to the specified collection. The Promise is rejected
|
|
20
|
+
if the current user does not have "create" permissions for the collection or
|
|
21
|
+
the specified item includes an `_id` property whose value matches an
|
|
22
|
+
existing ID in the collection. Meaning, `insert()` cannot overwrite an
|
|
23
|
+
existing item in the collection.
|
|
24
|
+
|
|
25
|
+
Calling the `insert()` method triggers the [`beforeInsert()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/before-insert) and [`afterInsert()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/after-insert) hooks if they have been defined.
|
|
26
|
+
|
|
27
|
+
When inserting an item into a collection that has a reference field, set the
|
|
28
|
+
value of the reference field to the referenced item's `_id` value or the entire referenced item object.
|
|
29
|
+
|
|
30
|
+
The `insert()` method adds the following properties and values to the item
|
|
31
|
+
when it adds it to the collection:
|
|
32
|
+
- `_id`: A unique identifier for an item in a collection, if the item
|
|
33
|
+
doesn't have one or has one that is `undefined`. You can optionally provide
|
|
34
|
+
your own ID. Once an ID is assigned to an item it cannot be changed.
|
|
35
|
+
- `_createdDate`: The date the item was added to the collection.
|
|
36
|
+
- `_updatedDate`: The date the item was modified. When the item is first
|
|
37
|
+
added, the `_createdDate` and `_updatedDate` are the same.
|
|
38
|
+
|
|
39
|
+
Any valid JavaScript object can be added as a property value. The `insert()`
|
|
40
|
+
method maintains the structure of the specified object. For example, objects that contain nested objects, arrays, or arrays with nested objects are all added to the collection as defined.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
> **Notes:**
|
|
44
|
+
> - The maximum size of an item that you can add to a collection is 500kb.
|
|
45
|
+
> - If an item's `_id` property value is set to `null` or an empty string, an error is thrown.
|
|
46
|
+
> - When creating a [single-item collection](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection), an item with the system field `_id` is pre-inserted into the collection. [Single-item collections](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection) may contain only one item.
|
|
47
|
+
> - If there is a pre-existing item in a [single-item collection](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection), the `insert()` method will not run. To update or change an item in a single-item collection see the `update()` and `save()` methods.
|
|
48
|
+
> - The `insert()` method does not support multi-reference fields. For multi-reference fields, use `insertReference()`.
|
|
49
|
+
> - [Translatable collections](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content) do not allow insertion and modification of items when working in a non-primary language. For example, if a collection's primary language is English, and the site visitor is viewing the site in French, calling `insert()` fails and issues an error.
|
|
50
|
+
|
|
51
|
+
# Method Permissions:
|
|
52
|
+
|
|
53
|
+
- Write Data Items
|
|
54
|
+
|
|
55
|
+
# Method Permissions Scopes IDs:
|
|
56
|
+
|
|
57
|
+
- SCOPE.DC-DATA.WRITE
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# Method Code Examples:
|
|
62
|
+
|
|
63
|
+
## Insert an item into a collection
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
15
66
|
import { items } from "@wix/data";
|
|
16
67
|
|
|
17
68
|
async function insertItem() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
69
|
+
const toInsert = {
|
|
70
|
+
"title": "Mr.",
|
|
71
|
+
"first_name": "John",
|
|
72
|
+
"last_name": "Doe"
|
|
73
|
+
};
|
|
74
|
+
const inserted = await items.insert("myCollection", toInsert);
|
|
75
|
+
console.log(inserted); // See below
|
|
25
76
|
}
|
|
26
77
|
|
|
27
78
|
/* item is:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
79
|
+
*
|
|
80
|
+
* {
|
|
81
|
+
* "_id": "rifk4nrk-dj4o-djhe-oidk-fnoqw4oiglk4i",
|
|
82
|
+
* "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
|
|
83
|
+
* "_createdDate": "2017-05-24T12:33:18.938Z",
|
|
84
|
+
* "_updatedDate": "2017-05-24T12:33:18.938Z",
|
|
85
|
+
* "title": "Mr.",
|
|
86
|
+
* "first_name": "John",
|
|
87
|
+
* "last_name": "Doe"
|
|
88
|
+
* }
|
|
89
|
+
*/
|
|
90
|
+
```
|
|
91
|
+
|
|
40
92
|
|
|
93
|
+
|
|
94
|
+
## Insert an item with a specified ID into a collection
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
import { items } from "@wix/data";
|
|
98
|
+
|
|
99
|
+
async function insertItem() {
|
|
100
|
+
const toInsert = {
|
|
101
|
+
"_id": "00001",
|
|
102
|
+
"title": "Mr.",
|
|
103
|
+
"first_name": "John",
|
|
104
|
+
"last_name": "Doe"
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const inserted = await items.insert("myCollection", toInsert);
|
|
108
|
+
console.log(inserted);
|
|
109
|
+
}
|
|
110
|
+
/* item is:
|
|
111
|
+
*
|
|
112
|
+
* {
|
|
113
|
+
* "_id": "00001",
|
|
114
|
+
* "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
|
|
115
|
+
* "_createdDate": "2017-05-24T12:33:18.938Z",
|
|
116
|
+
* "_updatedDate": "2017-05-24T12:33:18.938Z",
|
|
117
|
+
* "title": "Mr.",
|
|
118
|
+
* "first_name": "John",
|
|
119
|
+
* "last_name": "Doe"
|
|
120
|
+
* }
|
|
121
|
+
*/
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Insert an item including a reference to another item using the referenced item's ID
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
import { items } from "@wix/data";
|
|
128
|
+
|
|
129
|
+
async function insertItem() {
|
|
130
|
+
const countryId = "id-of-usa-item";
|
|
131
|
+
|
|
132
|
+
const toInsert = {
|
|
133
|
+
"title": "Mr.",
|
|
134
|
+
"first_name": "John",
|
|
135
|
+
"last_name": "Doe",
|
|
136
|
+
"country": countryId
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const inserted = await items.insert("myCollection", toInsert);
|
|
140
|
+
console.log(inserted); // See below
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* item is:
|
|
144
|
+
*
|
|
145
|
+
* {
|
|
146
|
+
* "_id": "rifk4nrk-dj4o-djhe-oidk-fnoqw4oiglk4i",
|
|
147
|
+
* "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
|
|
148
|
+
* "_createdDate": "2017-05-24T12:33:18.938Z",
|
|
149
|
+
* "_updatedDate": "2017-05-24T12:33:18.938Z",
|
|
150
|
+
* "title": "Mr.",
|
|
151
|
+
* "first_name": "John",
|
|
152
|
+
* "last_name": "Doe",
|
|
153
|
+
* "country": "id-of-usa-item"
|
|
154
|
+
* }
|
|
155
|
+
*/
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Insert an item including a reference to another item using the reference item
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
import { items } from "@wix/data";
|
|
162
|
+
|
|
163
|
+
async function insertItem() {
|
|
164
|
+
const countryItem = // Get country item
|
|
165
|
+
|
|
166
|
+
const toInsert = {
|
|
167
|
+
"title": "Mr.",
|
|
168
|
+
"first_name": "John",
|
|
169
|
+
"last_name": "Doe",
|
|
170
|
+
"country": countryItem
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const inserted = await items.insert("myCollection", toInsert);
|
|
174
|
+
console.log(inserted); // See below
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* item is:
|
|
178
|
+
*
|
|
179
|
+
* {
|
|
180
|
+
* "_id": "rifk4nrk-dj4o-djhe-oidk-fnoqw4oiglk4i",
|
|
181
|
+
* "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
|
|
182
|
+
* "_createdDate": "2017-05-24T12:33:18.938Z",
|
|
183
|
+
* "_updatedDate": "2017-05-24T12:33:18.938Z",
|
|
184
|
+
* "title": "Mr.",
|
|
185
|
+
* "first_name": "John",
|
|
186
|
+
* "last_name": "Doe",
|
|
187
|
+
* "country": "id-of-usa-item"
|
|
188
|
+
* }
|
|
189
|
+
*/
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Insert an item into a collection using a custom function
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
import { items } from "@wix/data";
|
|
196
|
+
|
|
197
|
+
// Create an operation using insert() //
|
|
198
|
+
|
|
199
|
+
function createGreeting(language, greeting) {
|
|
200
|
+
const toInsert = {
|
|
201
|
+
language,
|
|
202
|
+
greeting
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
return items.insert('Greetings', toInsert);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## default
|
|
211
|
+
|
|
212
|
+
```javascript
|
|
213
|
+
try {
|
|
214
|
+
const result = await items.insert("collection-0.28758841360566656", {
|
|
215
|
+
_id: "1ad20d72-f217-4663-b1c1-47fe7b9fcde5",
|
|
216
|
+
name: "Sample Item",
|
|
217
|
+
phone: "+972501234567",
|
|
218
|
+
image: "https://static.wixstatic.com/media/503ea4_ed9a38760ae04aab86b47e82525fdcac~mv2.jpg",
|
|
219
|
+
createdDate: Date.now(),
|
|
220
|
+
updatedDate: Date.now()
|
|
221
|
+
}, {
|
|
222
|
+
suppressHooks: false
|
|
223
|
+
});
|
|
224
|
+
return result;
|
|
225
|
+
} catch (error) {
|
|
226
|
+
console.error(error);
|
|
227
|
+
throw error;
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
</description>
|
|
41
231
|
<type_definition>
|
|
232
|
+
```
|
|
42
233
|
Method: data.items.insert(dataCollectionId, item, options)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</type_definition>
|
|
54
|
-
</data_items_insert>
|
|
234
|
+
Description: Adds an item to a collection. An item can only be inserted into an existing collection. You can create a new collection using the Data Collections API. The `insert()` method returns a Promise that resolves to the inserted item after it has been added to the specified collection. The Promise is rejected if the current user does not have "create" permissions for the collection or the specified item includes an `_id` property whose value matches an existing GUID in the collection. Meaning, `insert()` cannot overwrite an existing item in the collection. Calling the `insert()` method triggers the [`beforeInsert()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/before-insert) and [`afterInsert()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/after-insert) hooks if they have been defined. When inserting an item into a collection that has a reference field, set the value of the reference field to the referenced item's `_id` value or the entire referenced item object. The `insert()` method adds the following properties and values to the item when it adds it to the collection: - `_id`: A unique identifier for an item in a collection, if the item doesn't have one or has one that is `undefined`. You can optionally provide your own GUID. Once an GUID is assigned to an item it cannot be changed. - `_createdDate`: The date the item was added to the collection. - `_updatedDate`: The date the item was modified. When the item is first added, the `_createdDate` and `_updatedDate` are the same. Any valid JavaScript object can be added as a property value. The `insert()` method maintains the structure of the specified object. For example, objects that contain nested objects, arrays, or arrays with nested objects are all added to the collection as defined. > **Notes:** > - The maximum size of an item that you can add to a collection is 500kb. > - If an item's `_id` property value is set to `null` or an empty string, an error is thrown. > - When creating a [single-item collection](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection), an item with the system field `_id` is pre-inserted into the collection. [Single-item collections](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection) may contain only one item. > - If there is a pre-existing item in a [single-item collection](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection), the `insert()` method will not run. To update or change an item in a single-item collection see the `update()` and `save()` methods. > - The `insert()` method does not support multi-reference fields. For multi-reference fields, use `insertReference()`. > - [Translatable collections](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content) do not allow insertion and modification of items when working in a non-primary language. For example, if a collection's primary language is English, and the site visitor is viewing the site in French, calling `insert()` fails and issues an error.
|
|
235
|
+
Method parameters:
|
|
236
|
+
param name: dataCollectionId | type: string | description: GUID of the collection item belongs to. | required: true
|
|
237
|
+
param name: item | type: Partial | description: Data item to insert. | required: true
|
|
238
|
+
param name: options | type: WixDataInsertOptions | description: Options to use when processing this operation.
|
|
239
|
+
Return type: PROMISE<WixDataItem>
|
|
240
|
+
- name: _createdDate | type: Date | description: Date and time the item was added to the collection.
|
|
241
|
+
- name: _id | type: string | description: Data item GUID.
|
|
242
|
+
- name: _owner | type: string | description: GUID of the user who created the item. Can be modified with site owner permissions.
|
|
243
|
+
- name: _updatedDate | type: Date | description: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
|
|
55
244
|
|
|
245
|
+
```
|
|
246
|
+
</type_definition>
|
|
247
|
+
</data_items_insert>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<data_items_onDataItemCreated>
|
|
2
|
+
<description>
|
|
3
|
+
# This is a Webhook method
|
|
4
|
+
|
|
5
|
+
# Method name:
|
|
6
|
+
|
|
7
|
+
data.items.onDataItemCreated(handler: OnDataItemCreatedHandler)
|
|
8
|
+
|
|
9
|
+
# Method Link:
|
|
10
|
+
|
|
11
|
+
https://dev.wix.com/docs/sdk/backend-modules/data/items/on-data-item-created
|
|
12
|
+
|
|
13
|
+
# Method Description:
|
|
14
|
+
|
|
15
|
+
Triggered when a data item is inserted.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
</description>
|
|
19
|
+
<usage>
|
|
20
|
+
import { items } from "@wix/data";
|
|
21
|
+
|
|
22
|
+
items.onDataItemCreated((event) => {
|
|
23
|
+
// handle your event here
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
</usage>
|
|
27
|
+
<type_definition>
|
|
28
|
+
```
|
|
29
|
+
Method: data.items.onDataItemCreated(handler)
|
|
30
|
+
Description: Triggered when a data item is inserted.
|
|
31
|
+
Method parameters:
|
|
32
|
+
param name: handler | type: OnDataItemCreatedHandler | description: none
|
|
33
|
+
- name: event | type: DataItemCreatedEnvelope | description: none
|
|
34
|
+
- name: entity | type: DataItemEntity | description: none
|
|
35
|
+
- name: _id | type: string | description: Data item GUID.
|
|
36
|
+
- name: data | type: WixDataItem | description: Data item contents.
|
|
37
|
+
- name: _id | type: string | description: Data item GUID.
|
|
38
|
+
- name: _owner | type: string | description: GUID of the user who created the item. Can be modified with site owner permissions.
|
|
39
|
+
- name: dataCollectionId | type: string | description: GUID of the collection to which this item belongs.
|
|
40
|
+
- name: metadata | type: EventMetadata | description: none
|
|
41
|
+
- name: _id | type: string | description: Unique event GUID. Allows clients to ignore duplicate webhooks.
|
|
42
|
+
- name: entityEventSequence | type: string | description: A sequence number defining the order of updates to the underlying entity. For example, given that some entity was updated at 16:00 and than again at 16:01, it is guaranteed that the sequence number of the second update is strictly higher than the first. As the consumer, you can use this value to ensure that you handle messages in the correct order. To do so, you will need to persist this number on your end, and compare the sequence number from the message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
43
|
+
- name: entityFqdn | type: string | description: Assumes actions are also always typed to an entity_type Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
44
|
+
- name: entityId | type: string | description: GUID of the entity associated with the event.
|
|
45
|
+
- name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z
|
|
46
|
+
- name: eventType | type: string | description: Event type.
|
|
47
|
+
- name: identity | type: IdentificationData | description: The identification type and identity data.
|
|
48
|
+
- ONE-OF:
|
|
49
|
+
- name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
|
|
50
|
+
- name: appId | type: string | description: GUID of an app.
|
|
51
|
+
- name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
|
|
52
|
+
- name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
|
|
53
|
+
- name: instanceId | type: string | description: App instance GUID.
|
|
54
|
+
- name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
|
|
55
|
+
- name: slug | type: string | description: This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) This is although the created/updated/deleted notion is duplication of the oneof types Example: created/updated/deleted/started/completed/email_opened
|
|
56
|
+
- name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
|
|
57
|
+
Return type: PRIMITIVE<void>
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
</type_definition>
|
|
61
|
+
</data_items_onDataItemCreated>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<data_items_onDataItemDeleted>
|
|
2
|
+
<description>
|
|
3
|
+
# This is a Webhook method
|
|
4
|
+
|
|
5
|
+
# Method name:
|
|
6
|
+
|
|
7
|
+
data.items.onDataItemDeleted(handler: OnDataItemDeletedHandler)
|
|
8
|
+
|
|
9
|
+
# Method Link:
|
|
10
|
+
|
|
11
|
+
https://dev.wix.com/docs/sdk/backend-modules/data/items/on-data-item-deleted
|
|
12
|
+
|
|
13
|
+
# Method Description:
|
|
14
|
+
|
|
15
|
+
Triggered when a data item is deleted or truncated.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
</description>
|
|
19
|
+
<usage>
|
|
20
|
+
import { items } from "@wix/data";
|
|
21
|
+
|
|
22
|
+
items.onDataItemDeleted((event) => {
|
|
23
|
+
// handle your event here
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
</usage>
|
|
27
|
+
<type_definition>
|
|
28
|
+
```
|
|
29
|
+
Method: data.items.onDataItemDeleted(handler)
|
|
30
|
+
Description: Triggered when a data item is deleted or truncated.
|
|
31
|
+
Method parameters:
|
|
32
|
+
param name: handler | type: OnDataItemDeletedHandler | description: none
|
|
33
|
+
- name: event | type: DataItemDeletedEnvelope | description: none
|
|
34
|
+
- name: entity | type: DataItemDeletedEntity | description: none
|
|
35
|
+
- name: _id | type: string | description: Data item GUID.
|
|
36
|
+
- name: dataCollectionId | type: string | description: GUID of the collection to which this item belongs.
|
|
37
|
+
- name: metadata | type: EventMetadata | description: none
|
|
38
|
+
- name: _id | type: string | description: Unique event GUID. Allows clients to ignore duplicate webhooks.
|
|
39
|
+
- name: entityEventSequence | type: string | description: A sequence number defining the order of updates to the underlying entity. For example, given that some entity was updated at 16:00 and than again at 16:01, it is guaranteed that the sequence number of the second update is strictly higher than the first. As the consumer, you can use this value to ensure that you handle messages in the correct order. To do so, you will need to persist this number on your end, and compare the sequence number from the message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
40
|
+
- name: entityFqdn | type: string | description: Assumes actions are also always typed to an entity_type Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
41
|
+
- name: entityId | type: string | description: GUID of the entity associated with the event.
|
|
42
|
+
- name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z
|
|
43
|
+
- name: eventType | type: string | description: Event type.
|
|
44
|
+
- name: identity | type: IdentificationData | description: The identification type and identity data.
|
|
45
|
+
- ONE-OF:
|
|
46
|
+
- name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
|
|
47
|
+
- name: appId | type: string | description: GUID of an app.
|
|
48
|
+
- name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
|
|
49
|
+
- name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
|
|
50
|
+
- name: instanceId | type: string | description: App instance GUID.
|
|
51
|
+
- name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
|
|
52
|
+
- name: slug | type: string | description: This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) This is although the created/updated/deleted notion is duplication of the oneof types Example: created/updated/deleted/started/completed/email_opened
|
|
53
|
+
- name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
|
|
54
|
+
Return type: PRIMITIVE<void>
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
</type_definition>
|
|
58
|
+
</data_items_onDataItemDeleted>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<data_items_onDataItemUpdated>
|
|
2
|
+
<description>
|
|
3
|
+
# This is a Webhook method
|
|
4
|
+
|
|
5
|
+
# Method name:
|
|
6
|
+
|
|
7
|
+
data.items.onDataItemUpdated(handler: OnDataItemUpdatedHandler)
|
|
8
|
+
|
|
9
|
+
# Method Link:
|
|
10
|
+
|
|
11
|
+
https://dev.wix.com/docs/sdk/backend-modules/data/items/on-data-item-updated
|
|
12
|
+
|
|
13
|
+
# Method Description:
|
|
14
|
+
|
|
15
|
+
Triggered when a data item is updated or patched.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
</description>
|
|
19
|
+
<usage>
|
|
20
|
+
import { items } from "@wix/data";
|
|
21
|
+
|
|
22
|
+
items.onDataItemUpdated((event) => {
|
|
23
|
+
// handle your event here
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
</usage>
|
|
27
|
+
<type_definition>
|
|
28
|
+
```
|
|
29
|
+
Method: data.items.onDataItemUpdated(handler)
|
|
30
|
+
Description: Triggered when a data item is updated or patched.
|
|
31
|
+
Method parameters:
|
|
32
|
+
param name: handler | type: OnDataItemUpdatedHandler | description: none
|
|
33
|
+
- name: event | type: DataItemUpdatedEnvelope | description: none
|
|
34
|
+
- name: entity | type: DataItemEntity | description: none
|
|
35
|
+
- name: _id | type: string | description: Data item GUID.
|
|
36
|
+
- name: data | type: WixDataItem | description: Data item contents.
|
|
37
|
+
- name: _id | type: string | description: Data item GUID.
|
|
38
|
+
- name: _owner | type: string | description: GUID of the user who created the item. Can be modified with site owner permissions.
|
|
39
|
+
- name: dataCollectionId | type: string | description: GUID of the collection to which this item belongs.
|
|
40
|
+
- name: metadata | type: EventMetadata | description: none
|
|
41
|
+
- name: _id | type: string | description: Unique event GUID. Allows clients to ignore duplicate webhooks.
|
|
42
|
+
- name: entityEventSequence | type: string | description: A sequence number defining the order of updates to the underlying entity. For example, given that some entity was updated at 16:00 and than again at 16:01, it is guaranteed that the sequence number of the second update is strictly higher than the first. As the consumer, you can use this value to ensure that you handle messages in the correct order. To do so, you will need to persist this number on your end, and compare the sequence number from the message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
43
|
+
- name: entityFqdn | type: string | description: Assumes actions are also always typed to an entity_type Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
44
|
+
- name: entityId | type: string | description: GUID of the entity associated with the event.
|
|
45
|
+
- name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z
|
|
46
|
+
- name: eventType | type: string | description: Event type.
|
|
47
|
+
- name: identity | type: IdentificationData | description: The identification type and identity data.
|
|
48
|
+
- ONE-OF:
|
|
49
|
+
- name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
|
|
50
|
+
- name: appId | type: string | description: GUID of an app.
|
|
51
|
+
- name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
|
|
52
|
+
- name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
|
|
53
|
+
- name: instanceId | type: string | description: App instance GUID.
|
|
54
|
+
- name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
|
|
55
|
+
- name: slug | type: string | description: This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) This is although the created/updated/deleted notion is duplication of the oneof types Example: created/updated/deleted/started/completed/email_opened
|
|
56
|
+
- name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
|
|
57
|
+
Return type: PRIMITIVE<void>
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
</type_definition>
|
|
61
|
+
</data_items_onDataItemUpdated>
|