oneentry 1.0.173 → 1.0.175
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/changelog.md +35 -0
- package/dist/admins/adminsApi.d.ts +7 -7
- package/dist/admins/adminsApi.js +7 -7
- package/dist/admins/adminsInterfaces.d.ts +22 -22
- package/dist/attribute-sets/attributeSetsApi.d.ts +8 -8
- package/dist/attribute-sets/attributeSetsApi.js +8 -8
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +31 -31
- package/dist/auth-provider/authProviderApi.d.ts +30 -30
- package/dist/auth-provider/authProviderApi.js +30 -30
- package/dist/auth-provider/authProviderSchemas.d.ts +1 -1
- package/dist/auth-provider/authProvidersInterfaces.d.ts +54 -53
- package/dist/base/asyncModules.d.ts +6 -6
- package/dist/base/asyncModules.js +6 -6
- package/dist/base/syncModules.d.ts +1 -1
- package/dist/base/syncModules.js +1 -1
- package/dist/base/utils.d.ts +3 -3
- package/dist/base/validation.d.ts +1 -1
- package/dist/base/validation.js +1 -1
- package/dist/blocks/blocksApi.d.ts +35 -35
- package/dist/blocks/blocksApi.js +35 -35
- package/dist/blocks/blocksInterfaces.d.ts +55 -55
- package/dist/discounts/discountsApi.d.ts +14 -14
- package/dist/discounts/discountsApi.js +14 -14
- package/dist/discounts/discountsInterfaces.d.ts +52 -52
- package/dist/events/eventsApi.d.ts +13 -13
- package/dist/events/eventsApi.js +13 -13
- package/dist/events/eventsInterfaces.d.ts +18 -18
- package/dist/file-uploading/fileUploadingApi.d.ts +14 -14
- package/dist/file-uploading/fileUploadingApi.js +14 -14
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +25 -25
- package/dist/filters/filtersApi.d.ts +1 -1
- package/dist/filters/filtersApi.js +1 -1
- package/dist/filters/filtersInterfaces.d.ts +7 -7
- package/dist/forms/formsApi.d.ts +3 -3
- package/dist/forms/formsApi.js +3 -3
- package/dist/forms/formsInterfaces.d.ts +42 -42
- package/dist/forms-data/formsDataApi.d.ts +14 -14
- package/dist/forms-data/formsDataApi.js +14 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +67 -68
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -2
- package/dist/integration-collections/integrationCollectionsApi.d.ts +20 -20
- package/dist/integration-collections/integrationCollectionsApi.js +20 -20
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +44 -44
- package/dist/locales/localesInterfaces.d.ts +8 -8
- package/dist/menus/menusApi.d.ts +1 -1
- package/dist/menus/menusApi.js +1 -1
- package/dist/menus/menusInterfaces.d.ts +12 -12
- package/dist/orders/ordersApi.d.ts +26 -26
- package/dist/orders/ordersApi.js +26 -26
- package/dist/orders/ordersInterfaces.d.ts +99 -99
- package/dist/pages/pagesApi.d.ts +6 -6
- package/dist/pages/pagesApi.js +6 -6
- package/dist/pages/pagesInterfaces.d.ts +46 -46
- package/dist/payments/paymentsApi.d.ts +8 -8
- package/dist/payments/paymentsApi.js +8 -8
- package/dist/payments/paymentsInterfaces.d.ts +31 -31
- package/dist/product-statuses/productStatusesApi.d.ts +2 -2
- package/dist/product-statuses/productStatusesApi.js +2 -2
- package/dist/product-statuses/productStatusesInterfaces.d.ts +8 -8
- package/dist/products/productsApi.d.ts +37 -37
- package/dist/products/productsApi.js +36 -36
- package/dist/products/productsInterfaces.d.ts +96 -96
- package/dist/search/searchApi.d.ts +3 -3
- package/dist/search/searchApi.js +3 -3
- package/dist/search/searchInterfaces.d.ts +4 -4
- package/dist/sitemap/sitemapApi.d.ts +1 -1
- package/dist/sitemap/sitemapApi.js +1 -1
- package/dist/sitemap/sitemapInterfaces.d.ts +2 -2
- package/dist/subscriptions/subscriptionsApi.d.ts +3 -3
- package/dist/subscriptions/subscriptionsApi.js +3 -3
- package/dist/subscriptions/subscriptionsInterfaces.d.ts +11 -11
- package/dist/templates/templatesApi.d.ts +2 -2
- package/dist/templates/templatesApi.js +2 -2
- package/dist/templates/templatesInterfaces.d.ts +10 -10
- package/dist/templates-preview/templatesPreviewApi.d.ts +1 -1
- package/dist/templates-preview/templatesPreviewApi.js +1 -1
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +17 -17
- package/dist/user-activity/userActivityApi.d.ts +1 -1
- package/dist/user-activity/userActivityApi.js +1 -1
- package/dist/user-activity/userActivityInterfaces.d.ts +4 -4
- package/dist/user-groups/userGroupsApi.d.ts +1 -1
- package/dist/user-groups/userGroupsApi.js +1 -1
- package/dist/user-groups/userGroupsInterfaces.d.ts +5 -5
- package/dist/users/usersApi.d.ts +9 -9
- package/dist/users/usersApi.js +9 -9
- package/dist/users/usersInterfaces.d.ts +40 -39
- package/dist/users/usersSchemas.d.ts +1 -1
- package/esm/admins/adminsApi.d.ts +7 -7
- package/esm/admins/adminsApi.js +7 -7
- package/esm/admins/adminsInterfaces.d.ts +22 -22
- package/esm/attribute-sets/attributeSetsApi.d.ts +8 -8
- package/esm/attribute-sets/attributeSetsApi.js +8 -8
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +31 -31
- package/esm/auth-provider/authProviderApi.d.ts +30 -30
- package/esm/auth-provider/authProviderApi.js +30 -30
- package/esm/auth-provider/authProviderSchemas.d.ts +1 -1
- package/esm/auth-provider/authProvidersInterfaces.d.ts +54 -53
- package/esm/base/asyncModules.d.ts +6 -6
- package/esm/base/asyncModules.js +6 -6
- package/esm/base/syncModules.d.ts +1 -1
- package/esm/base/syncModules.js +1 -1
- package/esm/base/utils.d.ts +3 -3
- package/esm/base/validation.d.ts +1 -1
- package/esm/base/validation.js +1 -1
- package/esm/blocks/blocksApi.d.ts +35 -35
- package/esm/blocks/blocksApi.js +35 -35
- package/esm/blocks/blocksInterfaces.d.ts +55 -55
- package/esm/discounts/discountsApi.d.ts +14 -14
- package/esm/discounts/discountsApi.js +14 -14
- package/esm/discounts/discountsInterfaces.d.ts +52 -52
- package/esm/events/eventsApi.d.ts +13 -13
- package/esm/events/eventsApi.js +13 -13
- package/esm/events/eventsInterfaces.d.ts +18 -18
- package/esm/file-uploading/fileUploadingApi.d.ts +14 -14
- package/esm/file-uploading/fileUploadingApi.js +14 -14
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +25 -25
- package/esm/filters/filtersApi.d.ts +1 -1
- package/esm/filters/filtersApi.js +1 -1
- package/esm/filters/filtersInterfaces.d.ts +7 -7
- package/esm/forms/formsApi.d.ts +3 -3
- package/esm/forms/formsApi.js +3 -3
- package/esm/forms/formsInterfaces.d.ts +42 -42
- package/esm/forms-data/formsDataApi.d.ts +14 -14
- package/esm/forms-data/formsDataApi.js +14 -14
- package/esm/forms-data/formsDataInterfaces.d.ts +67 -68
- package/esm/general-types/generalTypesInterfaces.d.ts +2 -2
- package/esm/integration-collections/integrationCollectionsApi.d.ts +20 -20
- package/esm/integration-collections/integrationCollectionsApi.js +20 -20
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +44 -44
- package/esm/locales/localesInterfaces.d.ts +8 -8
- package/esm/menus/menusApi.d.ts +1 -1
- package/esm/menus/menusApi.js +1 -1
- package/esm/menus/menusInterfaces.d.ts +12 -12
- package/esm/orders/ordersApi.d.ts +26 -26
- package/esm/orders/ordersApi.js +26 -26
- package/esm/orders/ordersInterfaces.d.ts +99 -99
- package/esm/pages/pagesApi.d.ts +6 -6
- package/esm/pages/pagesApi.js +6 -6
- package/esm/pages/pagesInterfaces.d.ts +46 -46
- package/esm/payments/paymentsApi.d.ts +8 -8
- package/esm/payments/paymentsApi.js +8 -8
- package/esm/payments/paymentsInterfaces.d.ts +31 -31
- package/esm/product-statuses/productStatusesApi.d.ts +2 -2
- package/esm/product-statuses/productStatusesApi.js +2 -2
- package/esm/product-statuses/productStatusesInterfaces.d.ts +8 -8
- package/esm/products/productsApi.d.ts +37 -37
- package/esm/products/productsApi.js +36 -36
- package/esm/products/productsInterfaces.d.ts +96 -96
- package/esm/search/searchApi.d.ts +3 -3
- package/esm/search/searchApi.js +3 -3
- package/esm/search/searchInterfaces.d.ts +4 -4
- package/esm/sitemap/sitemapApi.d.ts +1 -1
- package/esm/sitemap/sitemapApi.js +1 -1
- package/esm/sitemap/sitemapInterfaces.d.ts +2 -2
- package/esm/subscriptions/subscriptionsApi.d.ts +3 -3
- package/esm/subscriptions/subscriptionsApi.js +3 -3
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +11 -11
- package/esm/templates/templatesApi.d.ts +2 -2
- package/esm/templates/templatesApi.js +2 -2
- package/esm/templates/templatesInterfaces.d.ts +10 -10
- package/esm/templates-preview/templatesPreviewApi.d.ts +1 -1
- package/esm/templates-preview/templatesPreviewApi.js +1 -1
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +17 -17
- package/esm/user-activity/userActivityApi.d.ts +1 -1
- package/esm/user-activity/userActivityApi.js +1 -1
- package/esm/user-activity/userActivityInterfaces.d.ts +4 -4
- package/esm/user-groups/userGroupsApi.d.ts +1 -1
- package/esm/user-groups/userGroupsApi.js +1 -1
- package/esm/user-groups/userGroupsInterfaces.d.ts +5 -5
- package/esm/users/usersApi.d.ts +9 -9
- package/esm/users/usersApi.js +9 -9
- package/esm/users/usersInterfaces.d.ts +40 -39
- package/esm/users/usersSchemas.d.ts +1 -1
- package/package.json +2 -2
|
@@ -12,9 +12,9 @@ interface IDiscountsApi {
|
|
|
12
12
|
* Return all discounts.
|
|
13
13
|
* @handleName getAllSubscriptions
|
|
14
14
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
15
|
-
* @param {number} [offset] -
|
|
16
|
-
* @param {number} [limit] -
|
|
17
|
-
* @param {IDiscountType} [type] -
|
|
15
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
16
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
17
|
+
* @param {IDiscountType} [type] - Discount type to filter by. Optional.
|
|
18
18
|
* @returns {Promise<IDiscountsResponse | IError>} Returns an object containing all discounts or an error object if there was an issue.
|
|
19
19
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
20
20
|
* @description Fetches all discounts from the server.
|
|
@@ -23,7 +23,7 @@ interface IDiscountsApi {
|
|
|
23
23
|
/**
|
|
24
24
|
* Get discount by marker
|
|
25
25
|
* @handleName getDiscountByMarker
|
|
26
|
-
* @param {string} marker -
|
|
26
|
+
* @param {string} marker - Marker of the discount storage. Example: "discount_storage".
|
|
27
27
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
28
28
|
* @returns {Promise<IDiscountsEntity | IError>} Returns an object containing discount by marker or an error object if there was an issue.
|
|
29
29
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -33,7 +33,7 @@ interface IDiscountsApi {
|
|
|
33
33
|
/**
|
|
34
34
|
* Validate discounts coupon
|
|
35
35
|
* @handleName validateDiscountsCoupon
|
|
36
|
-
* @param {string} code -
|
|
36
|
+
* @param {string} code - Coupon code to validate.
|
|
37
37
|
* @returns {Promise<ICouponValidationResult | IError>} Returns an coupon validation result or an error object if there was an issue.
|
|
38
38
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
39
39
|
* @description This function validates a coupon code and returns the result.
|
|
@@ -49,12 +49,12 @@ interface IDiscountsApi {
|
|
|
49
49
|
/**
|
|
50
50
|
* Get bonus transaction history of the current user.
|
|
51
51
|
* @handleName getBonusHistory
|
|
52
|
-
* @param {string} [type] - Transaction type filter.
|
|
53
|
-
* @param {string} [dateFrom] - Start date
|
|
54
|
-
* @param {string} [dateTo] - End date
|
|
55
|
-
* @param {number} [discountId] -
|
|
56
|
-
* @param {number} [moduleId] -
|
|
57
|
-
* @param {boolean} [isAdmin] -
|
|
52
|
+
* @param {string} [type] - Transaction type to filter by.
|
|
53
|
+
* @param {string} [dateFrom] - Start of the date range.
|
|
54
|
+
* @param {string} [dateTo] - End of the date range.
|
|
55
|
+
* @param {number} [discountId] - Return only transactions of this discount ID.
|
|
56
|
+
* @param {number} [moduleId] - Filter by module ID.
|
|
57
|
+
* @param {boolean} [isAdmin] - Filter by the transaction's `isAdmin` flag.
|
|
58
58
|
* @returns {Promise<IBonusHistoryResponse | IError>} Returns the container with the transactions and their total, or an error object.
|
|
59
59
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
60
60
|
*/
|
|
@@ -62,10 +62,10 @@ interface IDiscountsApi {
|
|
|
62
62
|
/**
|
|
63
63
|
* Semantic (vector) search for discounts.
|
|
64
64
|
* @handleName getDiscountsByVectorSearch
|
|
65
|
-
* @param {IDiscountsVectorSearch} body - Vector search
|
|
65
|
+
* @param {IDiscountsVectorSearch} body - Vector search parameters. Example: `{ queryText: "winter sale" }`.
|
|
66
66
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
67
|
-
* @param {number} [offset] -
|
|
68
|
-
* @param {number} [limit] -
|
|
67
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
68
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
69
69
|
* @returns {Promise<IVectorSearchResponse<IDiscountsResponse> | IError>} Returns an object with an array of found discounts and total count.
|
|
70
70
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
71
71
|
*/
|
|
@@ -76,8 +76,8 @@ interface IDiscountsApi {
|
|
|
76
76
|
* @interface IDiscountsVectorSearch
|
|
77
77
|
* @property {string} queryText - Natural-language search query. Example: "winter sale".
|
|
78
78
|
* @property {number} [vectorDistanceThreshold] - Override of the cosine distance threshold (0..2). Example: 0.3.
|
|
79
|
-
* @property {number} [maxHits] -
|
|
80
|
-
* @property {boolean} [debug] - When true
|
|
79
|
+
* @property {number} [maxHits] - Number of top candidates fetched before pagination. Default: 100. Maximum: 500. Example: 10.
|
|
80
|
+
* @property {boolean} [debug] - When `true`, each returned item gets a `distance` field. Example: false.
|
|
81
81
|
* @description Body for the discounts vector/search endpoint.
|
|
82
82
|
*/
|
|
83
83
|
interface IDiscountsVectorSearch {
|
|
@@ -113,26 +113,26 @@ interface IDiscountCondition {
|
|
|
113
113
|
/**
|
|
114
114
|
* Represents a discount entity.
|
|
115
115
|
* @interface IDiscountsEntity
|
|
116
|
-
* @property {number} id -
|
|
117
|
-
* @property {number | null} [attributeSetId] -
|
|
118
|
-
* @property {ILocalizeInfo} [localizeInfos] -
|
|
119
|
-
* @property {number} [version] -
|
|
120
|
-
* @property {string} [identifier] -
|
|
116
|
+
* @property {number} id - ID of the discount.
|
|
117
|
+
* @property {number | null} [attributeSetId] - ID of the attribute set linked to the discount, or `null` when no set is linked.
|
|
118
|
+
* @property {ILocalizeInfo} [localizeInfos] - Localized name of the discount.
|
|
119
|
+
* @property {number} [version] - Version number of the discount.
|
|
120
|
+
* @property {string} [identifier] - Marker of the discount.
|
|
121
121
|
* @property {IDiscountType} type - The type of the discount.
|
|
122
122
|
* @property {string} [startDate] - The start date of the discount.
|
|
123
|
-
* @property {string} [endDate] -
|
|
124
|
-
* @property {IDiscountValue} [discountValue] -
|
|
125
|
-
* @property {string} [conditionLogic] -
|
|
126
|
-
* @property {IDiscountCondition[]} [conditions] -
|
|
127
|
-
* @property {Record<string, unknown> | null} [exclusions] -
|
|
128
|
-
* @property {Record<string, unknown> | null} [gifts] -
|
|
123
|
+
* @property {string} [endDate] - End date of the discount.
|
|
124
|
+
* @property {IDiscountValue} [discountValue] - Discount value with its type and amount limits.
|
|
125
|
+
* @property {string} [conditionLogic] - How the conditions combine: `AND` or `OR`.
|
|
126
|
+
* @property {IDiscountCondition[]} [conditions] - Conditions of the discount.
|
|
127
|
+
* @property {Record<string, unknown> | null} [exclusions] - Exclusions of the discount.
|
|
128
|
+
* @property {Record<string, unknown> | null} [gifts] - Gifts of the discount.
|
|
129
129
|
* @property {boolean} [giftsReplaceCartItems] - Whether the gifts replace cart items.
|
|
130
|
-
* @property {Record<string, unknown> | null} [userGroups] -
|
|
131
|
-
* @property {Record<string, unknown> | null} [userExclusions] -
|
|
132
|
-
* @property {IAttributeValues} [attributeValues] -
|
|
133
|
-
* @property {string} [attributeSetIdentifier] -
|
|
130
|
+
* @property {Record<string, unknown> | null} [userGroups] - User groups the discount applies to.
|
|
131
|
+
* @property {Record<string, unknown> | null} [userExclusions] - Users excluded from the discount.
|
|
132
|
+
* @property {IAttributeValues} [attributeValues] - Attribute values of the discount.
|
|
133
|
+
* @property {string} [attributeSetIdentifier] - Marker of the attribute set.
|
|
134
134
|
* @property {Record<string, unknown>} [bonusEvent] - Bonus event configuration.
|
|
135
|
-
* @property {number} [position] - Position
|
|
135
|
+
* @property {number} [position] - Position used for sorting. Example: 1.
|
|
136
136
|
* @property {number | string} [total] - Total count of related entries. Example: "1".
|
|
137
137
|
* @property {number} [distance] - Cosine distance to the query. Returned only by the semantic (vector) search endpoint when `debug: true` is passed in the search body. Example: 0.12.
|
|
138
138
|
*/
|
|
@@ -163,7 +163,7 @@ interface IDiscountsEntity {
|
|
|
163
163
|
/**
|
|
164
164
|
* @interface IDiscountValue
|
|
165
165
|
* @property {'TO_PRODUCT' | 'TO_ORDER'} applicability - What the discount applies to. Example: "TO_PRODUCT".
|
|
166
|
-
* @property {'FIXED_AMOUNT' | 'PERCENT'} discountType - How the discount value is
|
|
166
|
+
* @property {'FIXED_AMOUNT' | 'PERCENT'} discountType - How the discount value is applied. Example: "FIXED_AMOUNT".
|
|
167
167
|
* @property {number} value - Discount amount (currency units for FIXED_AMOUNT, percentage points for PERCENT). Example: 10.
|
|
168
168
|
* @property {number | null} [maxAmount] - Cap on the absolute discount applied, or `null` when uncapped. Example: 5.
|
|
169
169
|
* @description Configuration of the discount calculation.
|
|
@@ -176,12 +176,12 @@ interface IDiscountValue {
|
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* @interface ICouponEntity
|
|
179
|
-
* @property {number} id - Coupon record
|
|
180
|
-
* @property {number} discountId -
|
|
179
|
+
* @property {number} id - Coupon record ID. Example: 1.
|
|
180
|
+
* @property {number} discountId - ID of the discount the coupon belongs to. Example: 1.
|
|
181
181
|
* @property {string} code - Coupon code. Example: "SUMMER-KBWZ-2428".
|
|
182
182
|
* @property {boolean} isReusable - Whether the coupon can be used more than once. Example: false.
|
|
183
183
|
* @property {boolean} isUsed - Whether the coupon has already been used. Example: false.
|
|
184
|
-
* @property {number | null} orderId -
|
|
184
|
+
* @property {number | null} orderId - ID of the order the coupon was applied to, or `null`. Example: null.
|
|
185
185
|
* @property {string | null} usedAt - When the coupon was used, or null. Example: null.
|
|
186
186
|
* @description Coupon entity returned by the discounts API.
|
|
187
187
|
*/
|
|
@@ -197,7 +197,7 @@ interface ICouponEntity {
|
|
|
197
197
|
/**
|
|
198
198
|
* Paginated response for discounts list.
|
|
199
199
|
* @interface IDiscountsResponse
|
|
200
|
-
* @property {IDiscountsEntity[]} items -
|
|
200
|
+
* @property {IDiscountsEntity[]} items - Discounts in this response.
|
|
201
201
|
* @property {number} total - Total number of discounts.
|
|
202
202
|
*/
|
|
203
203
|
interface IDiscountsResponse {
|
|
@@ -207,7 +207,7 @@ interface IDiscountsResponse {
|
|
|
207
207
|
/**
|
|
208
208
|
* Request body for coupon validation.
|
|
209
209
|
* @interface IDiscountsValidateCoupon
|
|
210
|
-
* @property {string} code -
|
|
210
|
+
* @property {string} code - Coupon code to validate.
|
|
211
211
|
*/
|
|
212
212
|
interface IDiscountsValidateCoupon {
|
|
213
213
|
code: string;
|
|
@@ -216,8 +216,8 @@ interface IDiscountsValidateCoupon {
|
|
|
216
216
|
* Result of coupon validation.
|
|
217
217
|
* @interface ICouponValidationResult
|
|
218
218
|
* @property {boolean} valid - Whether the coupon is valid.
|
|
219
|
-
* @property {ICouponEntity} [coupon] - Coupon data if the coupon is valid.
|
|
220
|
-
* @property {string} [error] - Error message if the coupon is invalid.
|
|
219
|
+
* @property {ICouponEntity} [coupon] - Coupon data, if the coupon is valid.
|
|
220
|
+
* @property {string} [error] - Error message, if the coupon is invalid.
|
|
221
221
|
*/
|
|
222
222
|
interface ICouponValidationResult {
|
|
223
223
|
valid: boolean;
|
|
@@ -240,12 +240,12 @@ interface IDiscountByMarkerQuery {
|
|
|
240
240
|
type IBonusTransactionType = 'ACCRUAL' | 'USAGE' | 'REDUCE' | 'REVERSAL_ACCRUAL' | 'REVERSAL_USAGE' | 'EXPIRATION';
|
|
241
241
|
/**
|
|
242
242
|
* @interface IBonusHistoryQuery
|
|
243
|
-
* @property {IBonusTransactionType} [type] - Transaction type filter.
|
|
244
|
-
* @property {string} [dateFrom] - Start date
|
|
245
|
-
* @property {string} [dateTo] - End date
|
|
246
|
-
* @property {number} [discountId] -
|
|
247
|
-
* @property {number} [moduleId] -
|
|
248
|
-
* @property {boolean} [isAdmin] -
|
|
243
|
+
* @property {IBonusTransactionType} [type] - Transaction type to filter by.
|
|
244
|
+
* @property {string} [dateFrom] - Start of the date range.
|
|
245
|
+
* @property {string} [dateTo] - End of the date range.
|
|
246
|
+
* @property {number} [discountId] - Return only transactions of this discount ID.
|
|
247
|
+
* @property {number} [moduleId] - Filter by module ID.
|
|
248
|
+
* @property {boolean} [isAdmin] - Filter by the transaction's `isAdmin` flag.
|
|
249
249
|
*/
|
|
250
250
|
interface IBonusHistoryQuery {
|
|
251
251
|
type?: IBonusTransactionType;
|
|
@@ -257,16 +257,16 @@ interface IBonusHistoryQuery {
|
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
259
|
* @interface IBonusTransactionEntity
|
|
260
|
-
* @property {number} balanceId -
|
|
260
|
+
* @property {number} balanceId - ID of the bonus balance.
|
|
261
261
|
* @property {number} amount - Transaction amount.
|
|
262
262
|
* @property {IBonusTransactionType} type - Transaction type.
|
|
263
|
-
* @property {number} [discountId] - Discount
|
|
264
|
-
* @property {number} [moduleId] -
|
|
263
|
+
* @property {number} [discountId] - Discount ID.
|
|
264
|
+
* @property {number} [moduleId] - ID of the module.
|
|
265
265
|
* @property {string} [entityIdentifier] - Entity identifier.
|
|
266
266
|
* @property {string} [comment] - Comment.
|
|
267
267
|
* @property {boolean} isAdmin - Admin flag.
|
|
268
268
|
* @property {number} [remainingAmount] - Remaining amount.
|
|
269
|
-
* @property {'EVENT' | 'SCHEDULED'} [triggerType] -
|
|
269
|
+
* @property {'EVENT' | 'SCHEDULED'} [triggerType] - What triggered the transaction: `"EVENT"` or `"SCHEDULED"`.
|
|
270
270
|
* @property {string} [expiresAt] - Expiration date.
|
|
271
271
|
* @property {string} [createdAt] - Creation date.
|
|
272
272
|
*/
|
|
@@ -286,7 +286,7 @@ interface IBonusTransactionEntity {
|
|
|
286
286
|
}
|
|
287
287
|
/**
|
|
288
288
|
* @interface IBonusHistoryResponse
|
|
289
|
-
* @property {IBonusTransactionEntity[]} items -
|
|
289
|
+
* @property {IBonusTransactionEntity[]} items - Transactions on the current page.
|
|
290
290
|
* @property {number} total - How many transactions the filter matches in total.
|
|
291
291
|
* @description Container the bonus history arrives in. The endpoint answers
|
|
292
292
|
* `{ items, total }`, not a bare array — measured on the SDK test stand,
|
|
@@ -299,7 +299,7 @@ interface IBonusHistoryResponse {
|
|
|
299
299
|
/**
|
|
300
300
|
* @interface IBonusBalanceEntity
|
|
301
301
|
* @description Represents the balance of bonus points.
|
|
302
|
-
* @property {number} balance -
|
|
302
|
+
* @property {number} balance - Bonus point balance. Example: 100
|
|
303
303
|
*/
|
|
304
304
|
interface IBonusBalanceEntity {
|
|
305
305
|
balance: number;
|
|
@@ -25,8 +25,8 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
25
25
|
/**
|
|
26
26
|
* Return all subscriptions to product.
|
|
27
27
|
* @handleName getAllSubscriptions
|
|
28
|
-
* @param {number} [offset] -
|
|
29
|
-
* @param {number} [limit] -
|
|
28
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
29
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
30
30
|
* @returns {Promise<ISubscriptions | IError>} Returns an object containing all subscriptions or an error object if there was an issue.
|
|
31
31
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
32
32
|
* @description This method requires user authorization.
|
|
@@ -37,9 +37,9 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
37
37
|
/**
|
|
38
38
|
* Subscribing to an event on a product.
|
|
39
39
|
* @handleName subscribeByMarker
|
|
40
|
-
* @param {string} marker -
|
|
41
|
-
* @param {number} productId - Product
|
|
42
|
-
* @param {string} [langCode] - Language code. Default: "en_US"
|
|
40
|
+
* @param {string} marker - Marker of the event. Example: "product_price_change".
|
|
41
|
+
* @param {number} productId - Product ID. Example: 12345.
|
|
42
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
43
43
|
* @returns {Promise<boolean | IError>} Returns true if subscription was successful, or an error object if there was an issue.
|
|
44
44
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
45
45
|
* @description This method requires user authorization.
|
|
@@ -50,8 +50,8 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
50
50
|
/**
|
|
51
51
|
* Unsubscribing to an event on a product.
|
|
52
52
|
* @handleName unsubscribeByMarker
|
|
53
|
-
* @param {string} marker -
|
|
54
|
-
* @param {number} productId -
|
|
53
|
+
* @param {string} marker - Marker of the event to unsubscribe from. Example: "product_price_change".
|
|
54
|
+
* @param {number} productId - ID of the product to unsubscribe from. Example: 12345.
|
|
55
55
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
56
56
|
* @returns {Promise<boolean | IError>} - Returns true if the unsubscription succeeded, or an error object if there was an issue.
|
|
57
57
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -72,8 +72,8 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
72
72
|
/**
|
|
73
73
|
* Subscribe to a form event by marker.
|
|
74
74
|
* @handleName subscribeToForm
|
|
75
|
-
* @param {string} marker -
|
|
76
|
-
* @param {ISubscribeFormEvent} body - Subscription
|
|
75
|
+
* @param {string} marker - Marker of the event. Example: "form_marker".
|
|
76
|
+
* @param {ISubscribeFormEvent} body - Subscription parameters. Example: `{ formDataId: 123 }`.
|
|
77
77
|
* @returns {Promise<boolean | IError>} Returns true if the subscription was successful, or an error object.
|
|
78
78
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
79
79
|
* @description This method requires user authorization.
|
|
@@ -84,8 +84,8 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
84
84
|
/**
|
|
85
85
|
* Returns all form subscriptions.
|
|
86
86
|
* @handleName getFormSubscriptions
|
|
87
|
-
* @param {number} [offset] -
|
|
88
|
-
* @param {number} [limit] -
|
|
87
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
88
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
89
89
|
* @returns {Promise<IFormSubscriptionsResponse | IError>} Returns an object with an array of form subscriptions and total count.
|
|
90
90
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
91
91
|
* @description This method requires user authorization.
|
|
@@ -96,8 +96,8 @@ export default class EventsApi extends AsyncModules implements IEvents {
|
|
|
96
96
|
/**
|
|
97
97
|
* Unsubscribe from form notifications by marker.
|
|
98
98
|
* @handleName unsubscribeFromForm
|
|
99
|
-
* @param {string} marker -
|
|
100
|
-
* @param {ISubscribeFormEvent} body - Subscription
|
|
99
|
+
* @param {string} marker - Marker of the event. Example: "form_marker".
|
|
100
|
+
* @param {ISubscribeFormEvent} body - Subscription parameters. Example: `{ formDataId: 123 }`.
|
|
101
101
|
* @returns {Promise<boolean | IError>} Returns true if the unsubscription was successful, or an error object.
|
|
102
102
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
103
103
|
* @description This method requires user authorization.
|
package/dist/events/eventsApi.js
CHANGED
|
@@ -29,8 +29,8 @@ class EventsApi extends asyncModules_1.default {
|
|
|
29
29
|
/**
|
|
30
30
|
* Return all subscriptions to product.
|
|
31
31
|
* @handleName getAllSubscriptions
|
|
32
|
-
* @param {number} [offset] -
|
|
33
|
-
* @param {number} [limit] -
|
|
32
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
33
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
34
34
|
* @returns {Promise<ISubscriptions | IError>} Returns an object containing all subscriptions or an error object if there was an issue.
|
|
35
35
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
36
36
|
* @description This method requires user authorization.
|
|
@@ -48,9 +48,9 @@ class EventsApi extends asyncModules_1.default {
|
|
|
48
48
|
/**
|
|
49
49
|
* Subscribing to an event on a product.
|
|
50
50
|
* @handleName subscribeByMarker
|
|
51
|
-
* @param {string} marker -
|
|
52
|
-
* @param {number} productId - Product
|
|
53
|
-
* @param {string} [langCode] - Language code. Default: "en_US"
|
|
51
|
+
* @param {string} marker - Marker of the event. Example: "product_price_change".
|
|
52
|
+
* @param {number} productId - Product ID. Example: 12345.
|
|
53
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
54
54
|
* @returns {Promise<boolean | IError>} Returns true if subscription was successful, or an error object if there was an issue.
|
|
55
55
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
56
56
|
* @description This method requires user authorization.
|
|
@@ -67,8 +67,8 @@ class EventsApi extends asyncModules_1.default {
|
|
|
67
67
|
/**
|
|
68
68
|
* Unsubscribing to an event on a product.
|
|
69
69
|
* @handleName unsubscribeByMarker
|
|
70
|
-
* @param {string} marker -
|
|
71
|
-
* @param {number} productId -
|
|
70
|
+
* @param {string} marker - Marker of the event to unsubscribe from. Example: "product_price_change".
|
|
71
|
+
* @param {number} productId - ID of the product to unsubscribe from. Example: 12345.
|
|
72
72
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
73
73
|
* @returns {Promise<boolean | IError>} - Returns true if the unsubscription succeeded, or an error object if there was an issue.
|
|
74
74
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -98,8 +98,8 @@ class EventsApi extends asyncModules_1.default {
|
|
|
98
98
|
/**
|
|
99
99
|
* Subscribe to a form event by marker.
|
|
100
100
|
* @handleName subscribeToForm
|
|
101
|
-
* @param {string} marker -
|
|
102
|
-
* @param {ISubscribeFormEvent} body - Subscription
|
|
101
|
+
* @param {string} marker - Marker of the event. Example: "form_marker".
|
|
102
|
+
* @param {ISubscribeFormEvent} body - Subscription parameters. Example: `{ formDataId: 123 }`.
|
|
103
103
|
* @returns {Promise<boolean | IError>} Returns true if the subscription was successful, or an error object.
|
|
104
104
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
105
105
|
* @description This method requires user authorization.
|
|
@@ -112,8 +112,8 @@ class EventsApi extends asyncModules_1.default {
|
|
|
112
112
|
/**
|
|
113
113
|
* Returns all form subscriptions.
|
|
114
114
|
* @handleName getFormSubscriptions
|
|
115
|
-
* @param {number} [offset] -
|
|
116
|
-
* @param {number} [limit] -
|
|
115
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
116
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
117
117
|
* @returns {Promise<IFormSubscriptionsResponse | IError>} Returns an object with an array of form subscriptions and total count.
|
|
118
118
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
119
119
|
* @description This method requires user authorization.
|
|
@@ -131,8 +131,8 @@ class EventsApi extends asyncModules_1.default {
|
|
|
131
131
|
/**
|
|
132
132
|
* Unsubscribe from form notifications by marker.
|
|
133
133
|
* @handleName unsubscribeFromForm
|
|
134
|
-
* @param {string} marker -
|
|
135
|
-
* @param {ISubscribeFormEvent} body - Subscription
|
|
134
|
+
* @param {string} marker - Marker of the event. Example: "form_marker".
|
|
135
|
+
* @param {ISubscribeFormEvent} body - Subscription parameters. Example: `{ formDataId: 123 }`.
|
|
136
136
|
* @returns {Promise<boolean | IError>} Returns true if the unsubscription was successful, or an error object.
|
|
137
137
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
138
138
|
* @description This method requires user authorization.
|
|
@@ -8,8 +8,8 @@ interface IEvents {
|
|
|
8
8
|
/**
|
|
9
9
|
* Retrieves all subscriptions to products.
|
|
10
10
|
* @handleName getAllSubscriptions
|
|
11
|
-
* @param {number} [offset] -
|
|
12
|
-
* @param {number} [limit] -
|
|
11
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
12
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
13
13
|
* @returns {Promise<ISubscriptions | IError>} A promise that resolves to a subscriptions object or an error.
|
|
14
14
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
15
|
* @description This method retrieves all subscriptions to products.
|
|
@@ -30,7 +30,7 @@ interface IEvents {
|
|
|
30
30
|
* Unsubscribes from an event on a product by its marker.
|
|
31
31
|
* @handleName unsubscribeByMarker
|
|
32
32
|
* @param {string} marker - The marker identifying the event. Example: "product_price_change".
|
|
33
|
-
* @param {number} productId -
|
|
33
|
+
* @param {number} productId - ID of the product to unsubscribe from. Example: 12345.
|
|
34
34
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
35
35
|
* @returns {Promise<boolean | IError>} A promise that resolves to any type or an error.
|
|
36
36
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
@@ -48,8 +48,8 @@ interface IEvents {
|
|
|
48
48
|
/**
|
|
49
49
|
* Subscribe to a form event by marker.
|
|
50
50
|
* @handleName subscribeToForm
|
|
51
|
-
* @param {string} marker -
|
|
52
|
-
* @param {ISubscribeFormEvent} body - Subscription
|
|
51
|
+
* @param {string} marker - Marker of the event. Example: "form_marker".
|
|
52
|
+
* @param {ISubscribeFormEvent} body - Subscription parameters. Example: `{ formDataId: 123 }`.
|
|
53
53
|
* @returns {Promise<boolean | IError>} A promise that resolves to true on success, or an error.
|
|
54
54
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
55
55
|
* @description This method subscribes to a form event by marker. This method requires user authorization.
|
|
@@ -59,8 +59,8 @@ interface IEvents {
|
|
|
59
59
|
/**
|
|
60
60
|
* Returns all form subscriptions.
|
|
61
61
|
* @handleName getFormSubscriptions
|
|
62
|
-
* @param {number} [offset] -
|
|
63
|
-
* @param {number} [limit] -
|
|
62
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
63
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
64
64
|
* @returns {Promise<IFormSubscriptionsResponse | IError>} A promise that resolves to an object with an array of form subscriptions and total count, or an error.
|
|
65
65
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
66
66
|
* @description This method returns all form subscriptions. This method requires user authorization.
|
|
@@ -70,8 +70,8 @@ interface IEvents {
|
|
|
70
70
|
/**
|
|
71
71
|
* Unsubscribe from form notifications by marker.
|
|
72
72
|
* @handleName unsubscribeFromForm
|
|
73
|
-
* @param {string} marker -
|
|
74
|
-
* @param {ISubscribeFormEvent} body - Subscription
|
|
73
|
+
* @param {string} marker - Marker of the event. Example: "form_marker".
|
|
74
|
+
* @param {ISubscribeFormEvent} body - Subscription parameters. Example: `{ formDataId: 123 }`.
|
|
75
75
|
* @returns {Promise<boolean | IError>} A promise that resolves to true on success, or an error.
|
|
76
76
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
77
77
|
* @description This method unsubscribes from form notifications by marker. This method requires user authorization.
|
|
@@ -83,7 +83,7 @@ interface IEvents {
|
|
|
83
83
|
* Represents a response from the events API containing a total count and an array of subscription items.
|
|
84
84
|
* @interface ISubscriptions
|
|
85
85
|
* @property {number} total - Total number of found records. Example: 100.
|
|
86
|
-
* @property {ISubscriptionItem[]} items -
|
|
86
|
+
* @property {ISubscriptionItem[]} items - Subscriptions, each with an event marker and a product ID.
|
|
87
87
|
* @example
|
|
88
88
|
[
|
|
89
89
|
{
|
|
@@ -128,10 +128,10 @@ interface ISubscribeBody {
|
|
|
128
128
|
/**
|
|
129
129
|
* Represents an event returned by the events API.
|
|
130
130
|
* @interface IContentApiEvent
|
|
131
|
-
* @property {number} id - Event
|
|
132
|
-
* @property {string} identifier -
|
|
133
|
-
* @property {Record<string, unknown>} localizeInfos - Localized
|
|
134
|
-
* @property {string} [module] - Module the event belongs to; absent on system events not bound to a module
|
|
131
|
+
* @property {number} id - Event ID. Example: 1.
|
|
132
|
+
* @property {string} identifier - Marker of the event. Example: "price_change".
|
|
133
|
+
* @property {Record<string, unknown>} localizeInfos - Localized data of the event.
|
|
134
|
+
* @property {string} [module] - Module the event belongs to; absent on system events that are not bound to a module, such as `send_code`. Example: "catalog".
|
|
135
135
|
* @description Represents a single available event.
|
|
136
136
|
*/
|
|
137
137
|
interface IContentApiEvent {
|
|
@@ -144,7 +144,7 @@ interface IContentApiEvent {
|
|
|
144
144
|
* Represents a form subscription item.
|
|
145
145
|
* @interface IListFormSubscription
|
|
146
146
|
* @property {string} eventMarker - Event marker. Example: "form_marker".
|
|
147
|
-
* @property {number} formDataId - Form data
|
|
147
|
+
* @property {number} formDataId - Form data ID. Example: 123.
|
|
148
148
|
* @description Represents a single form subscription.
|
|
149
149
|
*/
|
|
150
150
|
interface IListFormSubscription {
|
|
@@ -154,7 +154,7 @@ interface IListFormSubscription {
|
|
|
154
154
|
/**
|
|
155
155
|
* Represents the response of the form subscriptions list endpoint.
|
|
156
156
|
* @interface IFormSubscriptionsResponse
|
|
157
|
-
* @property {IListFormSubscription[]} items -
|
|
157
|
+
* @property {IListFormSubscription[]} items - Form subscriptions of the current user.
|
|
158
158
|
* @property {number} total - Total number of subscriptions. Example: 0.
|
|
159
159
|
* @description Container returned by `getFormSubscriptions`.
|
|
160
160
|
*/
|
|
@@ -165,8 +165,8 @@ interface IFormSubscriptionsResponse {
|
|
|
165
165
|
/**
|
|
166
166
|
* Body for subscribing to / unsubscribing from a form event.
|
|
167
167
|
* @interface ISubscribeFormEvent
|
|
168
|
-
* @property {number} formDataId - Form data
|
|
169
|
-
* @property {string} [status] -
|
|
168
|
+
* @property {number} formDataId - Form data ID. Example: 123.
|
|
169
|
+
* @property {string} [status] - Moderation status of the form data to subscribe to, for example `"approved"`. Optional.
|
|
170
170
|
* @description Body for the form subscribe/unsubscribe methods.
|
|
171
171
|
*/
|
|
172
172
|
interface ISubscribeFormEvent {
|
|
@@ -23,7 +23,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
|
|
|
23
23
|
* Upload file function.
|
|
24
24
|
* @handleName upload
|
|
25
25
|
* @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
|
|
26
|
-
* @param {IUploadingQuery} fileQuery - Where the file
|
|
26
|
+
* @param {IUploadingQuery} fileQuery - Where the file is stored. Required: without `type`, `entity` and `id` the endpoint answers `400 … should not be empty`.
|
|
27
27
|
* @example
|
|
28
28
|
{
|
|
29
29
|
"type": "page",
|
|
@@ -34,9 +34,9 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
|
|
|
34
34
|
"compress": true,
|
|
35
35
|
"template": 1
|
|
36
36
|
}
|
|
37
|
-
* @param {string} fileQuery.type -
|
|
38
|
-
* @param {string} fileQuery.entity -
|
|
39
|
-
* @param {number} fileQuery.id -
|
|
37
|
+
* @param {string} fileQuery.type - Storage type; determines the folder the file is stored in, for example `"page"`. Example: "page".
|
|
38
|
+
* @param {string} fileQuery.entity - Name of the entity the file belongs to; sets the folder name in the storage. Example: "editor".
|
|
39
|
+
* @param {number} fileQuery.id - ID of the object the file belongs to; sets the folder name in the storage. Example: 3787.
|
|
40
40
|
* @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
|
|
41
41
|
* @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
|
|
42
42
|
* @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
|
|
@@ -50,7 +50,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
|
|
|
50
50
|
* Deletes a file from the cloud file storage.
|
|
51
51
|
* @handleName delete
|
|
52
52
|
* @param {string} filename - File name. Example: "file.png".
|
|
53
|
-
* @param {IUploadingQuery} fileQuery - Where the file
|
|
53
|
+
* @param {IUploadingQuery} fileQuery - Where the file is stored. Required: without `type`, `entity` and `id` the endpoint answers `400 … should not be empty`.
|
|
54
54
|
* @example
|
|
55
55
|
{
|
|
56
56
|
"type": "page",
|
|
@@ -58,9 +58,9 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
|
|
|
58
58
|
"id": 3787,
|
|
59
59
|
"template": 1
|
|
60
60
|
}
|
|
61
|
-
* @param {string} fileQuery.type -
|
|
62
|
-
* @param {string} fileQuery.entity -
|
|
63
|
-
* @param {number} fileQuery.id -
|
|
61
|
+
* @param {string} fileQuery.type - Storage type; determines the folder the file is stored in, for example `"page"`. Example: "page".
|
|
62
|
+
* @param {string} fileQuery.entity - Name of the entity the file belongs to; sets the folder name in the storage. Example: "editor".
|
|
63
|
+
* @param {number} fileQuery.id - ID of the object the file belongs to; sets the folder name in the storage. Example: 3787.
|
|
64
64
|
* @param {number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
65
65
|
* @returns {Promise<boolean | IError>} Returns a promise that resolves to true when the file was deleted or an error object if there was an issue.
|
|
66
66
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -76,7 +76,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
|
|
|
76
76
|
* @param {string[]} [ownerTables] - Filter by the section the attached record belongs to, sent comma-separated. Example: ["products", "pages"].
|
|
77
77
|
* @param {string[]} [localeCodes] - Filter by the locale of the link, not of the file content. Example: ["en_US"].
|
|
78
78
|
* @param {boolean} [onlyTruncated] - Return only files whose extracted text was cut at the size ceiling.
|
|
79
|
-
* @param {number} [offset] -
|
|
79
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
80
80
|
* @param {number} [limit] - Parameter for pagination. Default: 10, maximum 50 — a larger value is rejected with 400 "limit must not be greater than 50".
|
|
81
81
|
* @returns {Promise<IFileSearchResponse | IError>} Returns the found files with their matching fragments.
|
|
82
82
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -104,11 +104,11 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
|
|
|
104
104
|
/**
|
|
105
105
|
* Get file by parameters.
|
|
106
106
|
* @handleName getFile
|
|
107
|
-
* @param {number} id -
|
|
108
|
-
* @param {string} type -
|
|
109
|
-
* @param {string} entity -
|
|
110
|
-
* @param {string} filename -
|
|
111
|
-
* @param {string} [template] - Preview template
|
|
107
|
+
* @param {number} id - ID of the object the file belongs to; sets the folder name in the storage. Example: 3787.
|
|
108
|
+
* @param {string} type - Storage type; determines the folder the file is stored in, for example `"page"`. Example: "page".
|
|
109
|
+
* @param {string} entity - Name of the entity the file belongs to; sets the folder name in the storage. Example: "editor".
|
|
110
|
+
* @param {string} filename - File name. Example: "file.png".
|
|
111
|
+
* @param {string} [template] - Preview template: its numeric ID or its marker, for example `"preview"`. Without it, no preview is generated. Example: "preview_template".
|
|
112
112
|
* @returns {Promise<Response | IError>} Returns a promise that resolves to a Response object containing the file data or an error object if there was an issue.
|
|
113
113
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
114
114
|
* @see {@link https://js-sdk.oneentry.cloud/docs/file-uploading/getFile getFile} documentation.
|
|
@@ -66,7 +66,7 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
66
66
|
* Upload file function.
|
|
67
67
|
* @handleName upload
|
|
68
68
|
* @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
|
|
69
|
-
* @param {IUploadingQuery} fileQuery - Where the file
|
|
69
|
+
* @param {IUploadingQuery} fileQuery - Where the file is stored. Required: without `type`, `entity` and `id` the endpoint answers `400 … should not be empty`.
|
|
70
70
|
* @example
|
|
71
71
|
{
|
|
72
72
|
"type": "page",
|
|
@@ -77,9 +77,9 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
77
77
|
"compress": true,
|
|
78
78
|
"template": 1
|
|
79
79
|
}
|
|
80
|
-
* @param {string} fileQuery.type -
|
|
81
|
-
* @param {string} fileQuery.entity -
|
|
82
|
-
* @param {number} fileQuery.id -
|
|
80
|
+
* @param {string} fileQuery.type - Storage type; determines the folder the file is stored in, for example `"page"`. Example: "page".
|
|
81
|
+
* @param {string} fileQuery.entity - Name of the entity the file belongs to; sets the folder name in the storage. Example: "editor".
|
|
82
|
+
* @param {number} fileQuery.id - ID of the object the file belongs to; sets the folder name in the storage. Example: 3787.
|
|
83
83
|
* @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
|
|
84
84
|
* @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
|
|
85
85
|
* @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
|
|
@@ -101,7 +101,7 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
101
101
|
* Deletes a file from the cloud file storage.
|
|
102
102
|
* @handleName delete
|
|
103
103
|
* @param {string} filename - File name. Example: "file.png".
|
|
104
|
-
* @param {IUploadingQuery} fileQuery - Where the file
|
|
104
|
+
* @param {IUploadingQuery} fileQuery - Where the file is stored. Required: without `type`, `entity` and `id` the endpoint answers `400 … should not be empty`.
|
|
105
105
|
* @example
|
|
106
106
|
{
|
|
107
107
|
"type": "page",
|
|
@@ -109,9 +109,9 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
109
109
|
"id": 3787,
|
|
110
110
|
"template": 1
|
|
111
111
|
}
|
|
112
|
-
* @param {string} fileQuery.type -
|
|
113
|
-
* @param {string} fileQuery.entity -
|
|
114
|
-
* @param {number} fileQuery.id -
|
|
112
|
+
* @param {string} fileQuery.type - Storage type; determines the folder the file is stored in, for example `"page"`. Example: "page".
|
|
113
|
+
* @param {string} fileQuery.entity - Name of the entity the file belongs to; sets the folder name in the storage. Example: "editor".
|
|
114
|
+
* @param {number} fileQuery.id - ID of the object the file belongs to; sets the folder name in the storage. Example: 3787.
|
|
115
115
|
* @param {number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
116
116
|
* @returns {Promise<boolean | IError>} Returns a promise that resolves to true when the file was deleted or an error object if there was an issue.
|
|
117
117
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -132,7 +132,7 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
132
132
|
* @param {string[]} [ownerTables] - Filter by the section the attached record belongs to, sent comma-separated. Example: ["products", "pages"].
|
|
133
133
|
* @param {string[]} [localeCodes] - Filter by the locale of the link, not of the file content. Example: ["en_US"].
|
|
134
134
|
* @param {boolean} [onlyTruncated] - Return only files whose extracted text was cut at the size ceiling.
|
|
135
|
-
* @param {number} [offset] -
|
|
135
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
136
136
|
* @param {number} [limit] - Parameter for pagination. Default: 10, maximum 50 — a larger value is rejected with 400 "limit must not be greater than 50".
|
|
137
137
|
* @returns {Promise<IFileSearchResponse | IError>} Returns the found files with their matching fragments.
|
|
138
138
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -182,11 +182,11 @@ class FileUploadingApi extends asyncModules_1.default {
|
|
|
182
182
|
/**
|
|
183
183
|
* Get file by parameters.
|
|
184
184
|
* @handleName getFile
|
|
185
|
-
* @param {number} id -
|
|
186
|
-
* @param {string} type -
|
|
187
|
-
* @param {string} entity -
|
|
188
|
-
* @param {string} filename -
|
|
189
|
-
* @param {string} [template] - Preview template
|
|
185
|
+
* @param {number} id - ID of the object the file belongs to; sets the folder name in the storage. Example: 3787.
|
|
186
|
+
* @param {string} type - Storage type; determines the folder the file is stored in, for example `"page"`. Example: "page".
|
|
187
|
+
* @param {string} entity - Name of the entity the file belongs to; sets the folder name in the storage. Example: "editor".
|
|
188
|
+
* @param {string} filename - File name. Example: "file.png".
|
|
189
|
+
* @param {string} [template] - Preview template: its numeric ID or its marker, for example `"preview"`. Without it, no preview is generated. Example: "preview_template".
|
|
190
190
|
* @returns {Promise<Response | IError>} Returns a promise that resolves to a Response object containing the file data or an error object if there was an issue.
|
|
191
191
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
192
192
|
* @see {@link https://js-sdk.oneentry.cloud/docs/file-uploading/getFile getFile} documentation.
|