@wix/ditto-codegen-public 1.0.162 → 1.0.164
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 +24996 -553
- 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
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<stores_collections_queryCollections>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
4
|
+
|
|
5
|
+
stores.collections.queryCollections()
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/stores/collections/query-collections
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.
|
|
14
|
+
See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|PROPERTY |SUPPORTED FILTERS & SORTING
|
|
18
|
+
|:---:|:---:|
|
|
19
|
+
|`_id`|[`eq()`](/collections-query-builder/eq),[`ne()`](/collections-query-builder/ne),[`exists()`](/collections-query-builder/exists),[`in()`](/collections-query-builder/in),[`hasSome()`](/collections-query-builder/has-some),[`startsWith()`](/collections-query-builder/starts-with),[`gt()`](/collections-query-builder/gt),[`lt()`](/collections-query-builder/lt),[`le()`](/collections-query-builder/le),[`ge()`](/collections-query-builder/ge),[`ascending()`](/collections-query-builder/ascending),[`descending()`](/collections-query-builder/descending)|
|
|
20
|
+
|`name`|[`eq()`](/collections-query-builder/eq),[`ne()`](/collections-query-builder/ne),[`exists()`](/collections-query-builder/exists),[`in()`](/collections-query-builder/in),[`hasSome()`](/collections-query-builder/has-some),[`startsWith()`](/collections-query-builder/starts-with),[`gt()`](/collections-query-builder/gt),[`lt()`](/collections-query-builder/lt),[`le()`](/collections-query-builder/le),[`ge()`](/collections-query-builder/ge),[`ascending()`](/collections-query-builder/ascending),[`descending()`](/collections-query-builder/descending)|
|
|
21
|
+
|
|
22
|
+
# Method Permissions:
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Method Permissions Scopes IDs:
|
|
27
|
+
|
|
28
|
+
undefined
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Method Code Examples:
|
|
33
|
+
|
|
34
|
+
## queryCollections
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
import { collections } from '@wix/stores';
|
|
38
|
+
|
|
39
|
+
async function queryCollections() {
|
|
40
|
+
const { items } = await collections.queryCollections().find();
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## queryCollections (with elevated permissions)
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
import { collections } from '@wix/stores';
|
|
48
|
+
import { auth } from '@wix/essentials';
|
|
49
|
+
|
|
50
|
+
async function myQueryCollectionsMethod(query) {
|
|
51
|
+
const elevatedQueryCollections = auth.elevate(collections.queryCollections);
|
|
52
|
+
const response = await elevatedQueryCollections(query);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## default
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
try {
|
|
62
|
+
const { items } = await collections.queryCollections().find();
|
|
63
|
+
return items;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error(error);
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
</description>
|
|
70
|
+
<type_definition>
|
|
71
|
+
```
|
|
72
|
+
Method: stores.collections.queryCollections()
|
|
73
|
+
Description: Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering. See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information. |PROPERTY |SUPPORTED FILTERS & SORTING |:---:|:---:| |`_id`|[`eq()`](/collections-query-builder/eq),[`ne()`](/collections-query-builder/ne),[`exists()`](/collections-query-builder/exists),[`in()`](/collections-query-builder/in),[`hasSome()`](/collections-query-builder/has-some),[`startsWith()`](/collections-query-builder/starts-with),[`gt()`](/collections-query-builder/gt),[`lt()`](/collections-query-builder/lt),[`le()`](/collections-query-builder/le),[`ge()`](/collections-query-builder/ge),[`ascending()`](/collections-query-builder/ascending),[`descending()`](/collections-query-builder/descending)| |`name`|[`eq()`](/collections-query-builder/eq),[`ne()`](/collections-query-builder/ne),[`exists()`](/collections-query-builder/exists),[`in()`](/collections-query-builder/in),[`hasSome()`](/collections-query-builder/has-some),[`startsWith()`](/collections-query-builder/starts-with),[`gt()`](/collections-query-builder/gt),[`lt()`](/collections-query-builder/lt),[`le()`](/collections-query-builder/le),[`ge()`](/collections-query-builder/ge),[`ascending()`](/collections-query-builder/ascending),[`descending()`](/collections-query-builder/descending)|
|
|
74
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
75
|
+
Method: stores.collections.queryCollections().ascending(propertyNames)
|
|
76
|
+
Description: Adds a sort to a query, sorting by the specified properties in ascending order. The `ascending()` function refines a `CollectionsQueryBuilder` to sort by the value of `propertyName` in ascending order. You can specify multiple properties for sorting in ascending order by passing each property name as an additional argument. `ascending()` sorts the results in the order the properties are passed. You can sort the following types: - Number: Sorts numerically. - Date: Sorts by date and time. - String: Sorts lexicographically, so `'abc'` comes after `'XYZ'`. If a property contains a number stored as a string (for example, `'0'`), that value is sorted alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest.
|
|
77
|
+
Method parameters:
|
|
78
|
+
param name: propertyNames | type: Array<string> | description: Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
79
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
80
|
+
Method: stores.collections.queryCollections().descending(propertyNames)
|
|
81
|
+
Description: Adds a sort to a query, sorting by the specified properties in descending order. The `descending()` function refines a `CollectionsQueryBuilder` to sort by the value of `propertyName` in descending order. You can specify multiple properties for sorting in descending order by passing each property name as an additional argument. `descending()` sorts the results in the order the properties are passed. You can sort the following types: - Number: Sorts numerically. - Date: Sorts by date and time. - String: Sorts lexicographically, so `'abc'` comes after `'XYZ'`. If a property contains a number stored as a string (for example, `'0'`), that value is sorted alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest.
|
|
82
|
+
Method parameters:
|
|
83
|
+
param name: propertyNames | type: Array<string> | description: Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
84
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
85
|
+
Method: stores.collections.queryCollections().eq(propertyName, value)
|
|
86
|
+
Description: Refines a query to match items where the specified property equals the specified value. The `eq()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` equals the specified `value`. `eq()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. Matching strings with `eq()` is case-sensitive, so `'text'` isn't equal to `'Text'`.
|
|
87
|
+
Method parameters:
|
|
88
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
89
|
+
param name: value | type: any | description: Value to compare against.
|
|
90
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
91
|
+
Method: stores.collections.queryCollections().exists(propertyName, value)
|
|
92
|
+
Description: Refines a query to match items where the specified property contains a value. The `exists()` function refines a `CollectionsQueryBuilder` to only match items where the value of the specified `propertyName` doesn't equal null or undefined. `exists()` checks for either existence or non-existence based on the boolean parameter. Note that `exists()` does match items where the value of the specified `propertyName` is an empty string or an invalid value. `exists()` is only useful for properties which don't contain default values and therefore their values may be unassigned.
|
|
93
|
+
Method parameters:
|
|
94
|
+
param name: propertyName | type: string | description: none
|
|
95
|
+
param name: value | type: boolean | description: none
|
|
96
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
97
|
+
Method: stores.collections.queryCollections().find()
|
|
98
|
+
Description: Returns the query results. The `find()` function returns a Promise that resolves to the query results and metadata. The Promise is rejected if `find()` is called with insufficient permissions or if any of the previous functions used to refine the query are invalid.
|
|
99
|
+
Return type: PROMISE<CollectionsQueryResult>
|
|
100
|
+
- name: currentPage | type: number | description: Returns the index of the current page of results. `currentPage` is a zero-based index of the current page of results, meaning the 1st page is `0`, the 2nd page is `1`, and so on. If no results match the query, `currentPage` is undefined. The page size is defined by the [`limit()`](/collections-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result.
|
|
101
|
+
- name: items | type: Array<Collection> | description: Returns an array of `collections` items that match the query. `items` contains the current page of results retrieved by the query. If no results match the query, `items` is an empty array. The page size is defined by the [`limit()`](/collections-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result.
|
|
102
|
+
- name: items[]._id | type: string | description: Collection GUID (generated automatically by the catalog).
|
|
103
|
+
- name: items[].description | type: string | description: Collection description.
|
|
104
|
+
- name: items[].media | type: Media | description: Media items (images, videos etc) associated with this collection. Read only.
|
|
105
|
+
- name: items[].media.items | type: Array<MediaItem> | description: Media (images, videos etc) associated with this product.
|
|
106
|
+
- name: items[].media.items[]._id | type: string | description: Media GUID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).
|
|
107
|
+
- name: items[].media.items[].mediaType | type: MediaItemType | description: Media item type (image, video, etc.).
|
|
108
|
+
enum:
|
|
109
|
+
audio: Audio media type.
|
|
110
|
+
document: Document media type.
|
|
111
|
+
image: Image media type.
|
|
112
|
+
unspecified_media_item_type, video: Video media type.
|
|
113
|
+
zip: Zip media type.
|
|
114
|
+
- name: items[].media.items[].thumbnail | type: MediaItemUrlAndSize | description: Media item thumbnail details.
|
|
115
|
+
- name: items[].media.items[].thumbnail.altText | type: string | description: Alt text. This text will be shown in case the image is not available.
|
|
116
|
+
- name: items[].media.items[].thumbnail.format | type: string | description: Media format (mp4, png, etc.).
|
|
117
|
+
- name: items[].media.items[].thumbnail.height | type: number | description: Media item height.
|
|
118
|
+
- name: items[].media.items[].thumbnail.url | type: string | description: Media item URL.
|
|
119
|
+
- name: items[].media.items[].thumbnail.width | type: number | description: Media item width.
|
|
120
|
+
- name: items[].media.items[].title | type: string | description: Media item title.
|
|
121
|
+
- ONE-OF:
|
|
122
|
+
- name: items[].media.items[].image | type: MediaItemUrlAndSize | description: Image data (URL, size).
|
|
123
|
+
- name: items[].media.items[].video | type: MediaItemVideo | description: Video data (URL, size).
|
|
124
|
+
- name: items[].media.items[].video.files | type: Array<MediaItemUrlAndSize> | description: Data (URL, size) about each resolution for which this video is available.
|
|
125
|
+
- name: items[].media.items[].video.stillFrameMediaId | type: string | description: GUID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.
|
|
126
|
+
- name: items[].media.mainMedia | type: MediaItem | description: Primary media (image, video etc) associated with this product.
|
|
127
|
+
- name: items[].name | type: string | description: Collection name.
|
|
128
|
+
- name: items[].numberOfProducts | type: number | description: Number of products in the collection. Read only.
|
|
129
|
+
- name: items[].slug | type: string | description: Collection slug.
|
|
130
|
+
- name: items[].visible | type: boolean | description: Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`.
|
|
131
|
+
- name: length | type: number | description: Returns the number of items in the current page of results. `length` returns just the number of items in the current page, not the total number of items that match the query. For the total number of items that match the query, see [`totalCount`](#total-count). The page size is defined by the [`limit()`](/collections-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result.
|
|
132
|
+
- name: pageSize | type: number | description: Returns the requested page size. `pageSize` returns the page size set in [`limit()`](/collections-query-builder/limit) in `CollectionsQueryBuilder`.
|
|
133
|
+
- name: query | type: CollectionsQueryBuilder | description: Returns the `CollectionsQueryBuilder` object used to get the current results. Use `query` to create and run a new query by chaining additional `CollectionsQueryBuilder` functions to it. You can filter only on properties that haven't already been used in the previous `CollectionsQueryBuilder`.
|
|
134
|
+
- name: totalCount | type: number | description: Returns the total number of items that match the query. `totalCount` returns the total number of items that match the query, not just the number of items in the current page. For the number of items in the current page, see [`length`](#length).
|
|
135
|
+
- name: totalPages | type: number | description: Returns the total number of pages the query produced. The page size is defined by the [`limit()`](/collections-query-builder/limit) function and can be retrieved using the [`pageSize`](page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result.
|
|
136
|
+
Method: stores.collections.hasNext()
|
|
137
|
+
Description: Indicates whether the query has more results. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result.
|
|
138
|
+
Return type: PRIMITIVE<boolean>
|
|
139
|
+
Method: stores.collections.hasPrev()
|
|
140
|
+
Description: Indicates whether the query has previous results. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result.
|
|
141
|
+
Return type: PRIMITIVE<boolean>
|
|
142
|
+
Method: stores.collections.queryCollections().next()
|
|
143
|
+
Description: Retrieves the next page of query results. The `next()` function retrieves the next page of query results. The page size is defined by the [`limit()`](/collections-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result. If items are added or removed between calls to `next()`, the values returned by `CollectionsQueryBuilder` may change.
|
|
144
|
+
Return type: PROMISE<CollectionsQueryResult>
|
|
145
|
+
Method: stores.collections.queryCollections().prev()
|
|
146
|
+
Description: Retrieves the previous page of query results. The `prev()` function retrieves the previous page of query results. The page size is defined by the [`limit()`](/collections-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `collections` to navigate the pages of a query result. If items are added or removed between calls to `prev()`, the values returned may change.
|
|
147
|
+
Return type: PROMISE<CollectionsQueryResult>
|
|
148
|
+
Method: stores.collections.queryCollections().ge(propertyName, value)
|
|
149
|
+
Description: Refines a query to match items where the specified property is greater than or equal to the specified value. The `ge()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` is greater than or equal to the specified `value`. `ge()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'abc'` is greater than `'ABC'`.
|
|
150
|
+
Method parameters:
|
|
151
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
152
|
+
param name: value | type: any | description: Value to compare against.
|
|
153
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
154
|
+
Method: stores.collections.queryCollections().gt(propertyName, value)
|
|
155
|
+
Description: Refines a query to match items where the specified property is greater than the specified value. The `gt()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` is greater than the specified `value`. `gt()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'abc'` is greater than `'ABC'`.
|
|
156
|
+
Method parameters:
|
|
157
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
158
|
+
param name: value | type: any | description: Value to compare against.
|
|
159
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
160
|
+
Method: stores.collections.queryCollections().hasSome(propertyName, value)
|
|
161
|
+
Description: Refines a query to match items whose specified property contains any of the specified values. The `hasSome()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` equals any of the specified `values`. Matching strings with `hasSome()` is case-sensitive, so `'text'` isn't equal to `'Text'`. If the specified property is an array, `hasSome()` matches if any of that array's elements equal any of the specified values.
|
|
162
|
+
Method parameters:
|
|
163
|
+
param name: propertyName | type: string | description: Property whose value is compared with `values`.
|
|
164
|
+
param name: value | type: Array<any> | description: none
|
|
165
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
166
|
+
Method: stores.collections.queryCollections().in(propertyName, value)
|
|
167
|
+
Description: Refines a query to only match items where the specified property contains any of the values in the provided array of values. The `in()` function refines a `CollectionsQueryBuilder` to match only items where the specified `propertyName` is equal to any of the values in the provided array. Matching strings with `in()` is case-sensitive, so `'text'` isn't equal to `'Text'`.
|
|
168
|
+
Method parameters:
|
|
169
|
+
param name: propertyName | type: string | description: none
|
|
170
|
+
param name: value | type: any | description: none
|
|
171
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
172
|
+
Method: stores.collections.queryCollections().le(propertyName, value)
|
|
173
|
+
Description: Refines a query to match items where the specified property is less than or equal to the specified value. The `le()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` is less than or equal to the specified `value`. `le()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'ABC'` is less than `'abc'`.
|
|
174
|
+
Method parameters:
|
|
175
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
176
|
+
param name: value | type: any | description: Value to compare against.
|
|
177
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
178
|
+
Method: stores.collections.queryCollections().limit(limit)
|
|
179
|
+
Description: Limits the number of items the query returns. The `limit()` function defines the number of results a query returns in each page. Only one page of results is retrieved at a time. You can use the `next()` and `prev()` functions to navigate the pages of a query result.
|
|
180
|
+
Method parameters:
|
|
181
|
+
param name: limit | type: number | description: Number of items to return, which is also the `pageSize` of the results object.
|
|
182
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
183
|
+
Method: stores.collections.queryCollections().lt(propertyName, value)
|
|
184
|
+
Description: Refines a query to match items where the specified property is less than the specified value. The `le()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` is less than the specified `value`. `le()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'ABC'` is less than `'abc'`.
|
|
185
|
+
Method parameters:
|
|
186
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
187
|
+
param name: value | type: any | description: Value to compare against.
|
|
188
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
189
|
+
Method: stores.collections.queryCollections().ne(propertyName, value)
|
|
190
|
+
Description: Refines a query to match items where the specified property doesn't equal the specified value. The `ne()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` doesn't equal the specified `value`. `ne()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. Matching strings with `ne()` is case-sensitive, so `'text'` isn't equal to `'Text'`.
|
|
191
|
+
Method parameters:
|
|
192
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
193
|
+
param name: value | type: any | description: Value to compare against.
|
|
194
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
195
|
+
Method: stores.collections.queryCollections().skip(skip)
|
|
196
|
+
Description: Sets the number of items to skip before returning query results. The `skip()` function defines the number of results to skip before returning new query results. For example, if you query a collection and 50 items match your query, but you set `skip()` to `10`, the first 10 items that match are ignored, and the 11th through 50th items are returned.
|
|
197
|
+
Method parameters:
|
|
198
|
+
param name: skip | type: number | description: Number of items to skip in the query results before returning the results.
|
|
199
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
200
|
+
Method: stores.collections.queryCollections().startsWith(propertyName, value)
|
|
201
|
+
Description: Refines a query to match items where the specified property starts with the specified value. The `startsWith()` function refines a `CollectionsQueryBuilder` to match only items where the value of the specified `propertyName` starts with the specified `string`. Matching with `startsWith()` is case-sensitive, so `'TEXT'` doesn't start with `'text'`. You can only use `startsWith()` with a property whose value is a string.
|
|
202
|
+
Method parameters:
|
|
203
|
+
param name: propertyName | type: string | description: Property whose value is compared with `string`.
|
|
204
|
+
param name: value | type: string | description: none
|
|
205
|
+
Return type: REFERENCE<CollectionsQueryBuilder>
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
</type_definition>
|
|
209
|
+
</stores_collections_queryCollections>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<stores_collections_removeProductsFromCollection>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
4
|
+
|
|
5
|
+
stores.products.removeProductsFromCollection(_id: string, productIds: Array<string>)
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/stores/products/remove-products-from-collection
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Deletes products from a specified collection.
|
|
14
|
+
|
|
15
|
+
# Method Permissions:
|
|
16
|
+
|
|
17
|
+
- WIX_STORES.MODIFY_PRODUCTS
|
|
18
|
+
|
|
19
|
+
# Method Permissions Scopes IDs:
|
|
20
|
+
|
|
21
|
+
undefined
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Method Code Examples:
|
|
26
|
+
|
|
27
|
+
## Remove products from a product collection
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
/**************************************
|
|
31
|
+
* Backend code - products.web.js/ts *
|
|
32
|
+
**************************************/
|
|
33
|
+
|
|
34
|
+
import { Permissions, webMethod } from '@wix/web-methods';
|
|
35
|
+
import { products } from '@wix/stores';
|
|
36
|
+
|
|
37
|
+
export const removeProductsFromCollection = webMethod(Permissions.Anyone, (_id, productIds) => {
|
|
38
|
+
return products.removeProductsFromCollection(_id, productIds);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/*************
|
|
42
|
+
* Page code *
|
|
43
|
+
*************/
|
|
44
|
+
|
|
45
|
+
import { removeProductsFromCollection } from 'backend/products.web';
|
|
46
|
+
|
|
47
|
+
// ...
|
|
48
|
+
|
|
49
|
+
const _id = ... // get collection ID
|
|
50
|
+
const productIds = ["id1", "id2", "id3"];
|
|
51
|
+
|
|
52
|
+
removeProductsFromCollection(_id, productIds)
|
|
53
|
+
.then(() => {
|
|
54
|
+
// products removed from the collection
|
|
55
|
+
})
|
|
56
|
+
.catch((error) => {
|
|
57
|
+
// products not removed from the collection
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## default
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
try {
|
|
67
|
+
const result = await products.removeProductsFromCollection("4d87a788-6d4a-436e-9775-14f747d55784", ["7bb38a7a-70b7-9cf3-fc80-584205694465"]);
|
|
68
|
+
return result;
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.error(error);
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
</description>
|
|
75
|
+
<type_definition>
|
|
76
|
+
```
|
|
77
|
+
Method: stores.products.removeProductsFromCollection(_id, productIds)
|
|
78
|
+
Description: Deletes products from a specified collection.
|
|
79
|
+
Method parameters:
|
|
80
|
+
param name: _id | type: string | description: GUID of the collection from which to remove products. | required: true
|
|
81
|
+
param name: productIds | type: Array<string> | description: IDs of the products to remove from the collection. | required: true
|
|
82
|
+
Return type: PROMISE<void>
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
</type_definition>
|
|
86
|
+
</stores_collections_removeProductsFromCollection>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<stores_collections_updateCollection>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
4
|
+
|
|
5
|
+
stores.products.updateCollection(_id: string, collection: UpdateCollection)
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/stores/products/update-collection
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Updates specified properties of a collection. To add products to a collection, call the [addProductsToCollection](#addproductstocollection) function.
|
|
14
|
+
|
|
15
|
+
# Method Permissions:
|
|
16
|
+
|
|
17
|
+
- WIX_STORES.MODIFY_PRODUCTS
|
|
18
|
+
|
|
19
|
+
# Method Permissions Scopes IDs:
|
|
20
|
+
|
|
21
|
+
undefined
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Method Code Examples:
|
|
26
|
+
|
|
27
|
+
## updateCollection
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
import { products } from '@wix/stores';
|
|
31
|
+
|
|
32
|
+
async function updateCollection(id, collection) {
|
|
33
|
+
const response = await products.updateCollection(id, collection);
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## updateCollection (with elevated permissions)
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import { products } from '@wix/stores';
|
|
41
|
+
import { auth } from '@wix/essentials';
|
|
42
|
+
|
|
43
|
+
async function myUpdateCollectionMethod(id, collection) {
|
|
44
|
+
const elevatedUpdateCollection = auth.elevate(products.updateCollection);
|
|
45
|
+
const response = await elevatedUpdateCollection(id, collection);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## default
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
try {
|
|
55
|
+
const result = await products.updateCollection("f582efb2-c3d8-44e0-8cb2-26d5e58bda64", {
|
|
56
|
+
name: "Updated Collection " + Math.random()
|
|
57
|
+
});
|
|
58
|
+
return result;
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(error);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
</description>
|
|
65
|
+
<type_definition>
|
|
66
|
+
```
|
|
67
|
+
Method: stores.products.updateCollection(_id, collection)
|
|
68
|
+
Description: Updates specified properties of a collection. To add products to a collection, call the [addProductsToCollection](#addproductstocollection) function.
|
|
69
|
+
Method parameters:
|
|
70
|
+
param name: _id | type: string | description: Collection GUID (generated automatically by the catalog). | required: true
|
|
71
|
+
param name: collection | type: UpdateCollection | description: Collection info to update. | required: true
|
|
72
|
+
- name: description | type: string | description: Collection description.
|
|
73
|
+
- name: name | type: string | description: Collection name.
|
|
74
|
+
- name: slug | type: string | description: Collection slug.
|
|
75
|
+
- name: visible | type: boolean | description: Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`.
|
|
76
|
+
Return type: PROMISE<UpdateCollectionResponse>
|
|
77
|
+
- name: collection | type: Collection | description: Updated collection.
|
|
78
|
+
- name: collection._id | type: string | description: Collection GUID (generated automatically by the catalog).
|
|
79
|
+
- name: collection.description | type: string | description: Collection description.
|
|
80
|
+
- name: collection.media | type: Media | description: Media items (images, videos etc) associated with this collection. Read only.
|
|
81
|
+
- name: collection.media.items | type: Array<MediaItem> | description: Media (images, videos etc) associated with this product.
|
|
82
|
+
- name: collection.media.items[]._id | type: string | description: Media GUID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).
|
|
83
|
+
- name: collection.media.items[].mediaType | type: MediaItemType | description: Media item type (image, video, etc.).
|
|
84
|
+
enum:
|
|
85
|
+
audio: Audio media type.
|
|
86
|
+
document: Document media type.
|
|
87
|
+
image: Image media type.
|
|
88
|
+
unspecified_media_item_type, video: Video media type.
|
|
89
|
+
zip: Zip media type.
|
|
90
|
+
- name: collection.media.items[].thumbnail | type: MediaItemUrlAndSize | description: Media item thumbnail details.
|
|
91
|
+
- name: collection.media.items[].thumbnail.altText | type: string | description: Alt text. This text will be shown in case the image is not available.
|
|
92
|
+
- name: collection.media.items[].thumbnail.format | type: string | description: Media format (mp4, png, etc.).
|
|
93
|
+
- name: collection.media.items[].thumbnail.height | type: number | description: Media item height.
|
|
94
|
+
- name: collection.media.items[].thumbnail.url | type: string | description: Media item URL.
|
|
95
|
+
- name: collection.media.items[].thumbnail.width | type: number | description: Media item width.
|
|
96
|
+
- name: collection.media.items[].title | type: string | description: Media item title.
|
|
97
|
+
- ONE-OF:
|
|
98
|
+
- name: collection.media.items[].image | type: MediaItemUrlAndSize | description: Image data (URL, size).
|
|
99
|
+
- name: collection.media.items[].video | type: MediaItemVideo | description: Video data (URL, size).
|
|
100
|
+
- name: collection.media.items[].video.files | type: Array<MediaItemUrlAndSize> | description: Data (URL, size) about each resolution for which this video is available.
|
|
101
|
+
- name: collection.media.items[].video.stillFrameMediaId | type: string | description: GUID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.
|
|
102
|
+
- name: collection.media.mainMedia | type: MediaItem | description: Primary media (image, video etc) associated with this product.
|
|
103
|
+
- name: collection.name | type: string | description: Collection name.
|
|
104
|
+
- name: collection.numberOfProducts | type: number | description: Number of products in the collection. Read only.
|
|
105
|
+
- name: collection.slug | type: string | description: Collection slug.
|
|
106
|
+
- name: collection.visible | type: boolean | description: Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`.
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
</type_definition>
|
|
110
|
+
</stores_collections_updateCollection>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<stores_inventory_queryInventory>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
4
|
+
|
|
5
|
+
stores.inventory.queryInventory(options: QueryInventoryOptions)
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/stores/inventory/query-inventory
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Returns a list of inventory items, given the provided paging, sorting and filtering.
|
|
14
|
+
|
|
15
|
+
# Method Permissions:
|
|
16
|
+
|
|
17
|
+
- WIX_STORES.READ_INVENTORY
|
|
18
|
+
|
|
19
|
+
# Method Permissions Scopes IDs:
|
|
20
|
+
|
|
21
|
+
undefined
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Method Code Examples:
|
|
26
|
+
|
|
27
|
+
## queryInventory
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
import { inventory } from '@wix/stores';
|
|
31
|
+
|
|
32
|
+
async function queryInventory(options) {
|
|
33
|
+
const response = await inventory.queryInventory(options);
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## queryInventory (with elevated permissions)
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import { inventory } from '@wix/stores';
|
|
41
|
+
import { auth } from '@wix/essentials';
|
|
42
|
+
|
|
43
|
+
async function myQueryInventoryMethod(options) {
|
|
44
|
+
const elevatedQueryInventory = auth.elevate(inventory.queryInventory);
|
|
45
|
+
const response = await elevatedQueryInventory(options);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## default
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
try {
|
|
55
|
+
const result = await inventory.queryInventory();
|
|
56
|
+
return result;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error(error);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
</description>
|
|
63
|
+
<type_definition>
|
|
64
|
+
```
|
|
65
|
+
Method: stores.inventory.queryInventory(options)
|
|
66
|
+
Description: Returns a list of inventory items, given the provided paging, sorting and filtering.
|
|
67
|
+
Method parameters:
|
|
68
|
+
param name: options | type: QueryInventoryOptions | description: none
|
|
69
|
+
- name: query | type: Query | description: Information about paging, filters, sorting.
|
|
70
|
+
- name: filter | type: string | description: Filter string
|
|
71
|
+
- name: paging | type: Paging | description: Paging options to limit and skip the number of items.
|
|
72
|
+
- name: limit | type: number | description: Amount of items to load per page
|
|
73
|
+
- name: offset | type: number | description: Number of items to skip in the display (relevant for all pages after the first)
|
|
74
|
+
- name: sort | type: string | description: Sort string
|
|
75
|
+
Return type: PROMISE<QueryInventoryResponse>
|
|
76
|
+
- name: inventoryItems | type: Array<InventoryItemV2> | description: Inventory items.
|
|
77
|
+
- name: inventoryItems[]._id | type: string | description: Inventory item GUID.
|
|
78
|
+
- name: inventoryItems[].lastUpdated | type: Date | description: Last updated timestamp.
|
|
79
|
+
- name: inventoryItems[].numericId | type: string | description: Inventory’s unique numeric GUID (assigned in ascending order). Primarily for sorting and filtering when crawling all inventories.
|
|
80
|
+
- name: inventoryItems[].preorderInfo | type: PreorderInfo | description: Preorder information.
|
|
81
|
+
- name: inventoryItems[].preorderInfo.enabled | type: boolean | description: Whether the item is available for preorder.
|
|
82
|
+
- name: inventoryItems[].preorderInfo.limit | type: number | description: Number of products that can be preordered after stock reaches zero.
|
|
83
|
+
- name: inventoryItems[].preorderInfo.message | type: string | description: A message the buyer will see when the item is out of stock and preorder is enabled.
|
|
84
|
+
- name: inventoryItems[].productId | type: string | description: Product GUID.
|
|
85
|
+
- name: inventoryItems[].trackQuantity | type: boolean | description: Whether quantity is being tracked.
|
|
86
|
+
- name: inventoryItems[].variants | type: Array<InventoryVariantV2> | description: Variants associated with this inventory item.
|
|
87
|
+
- name: inventoryItems[].variants[].availableForPreorder | type: boolean | description: Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level.
|
|
88
|
+
- name: inventoryItems[].variants[].inStock | type: boolean | description: Whether the product is listed as in stock.
|
|
89
|
+
- name: inventoryItems[].variants[].quantity | type: number | description: Quantity currently left in inventory.
|
|
90
|
+
- name: inventoryItems[].variants[].variantId | type: string | description: Variant GUID.
|
|
91
|
+
- name: metadata | type: PagingMetadata | description: Display metadata.
|
|
92
|
+
- name: metadata.items | type: number | description: Amount of items to load per page
|
|
93
|
+
- name: metadata.offset | type: number | description: Number of items to skip in the display (relevant for all pages after the first)
|
|
94
|
+
- name: totalResults | type: number | description: Number of total results.
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
</type_definition>
|
|
98
|
+
</stores_inventory_queryInventory>
|