oneentry 1.0.172 → 1.0.174
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 +48 -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 +31 -31
- package/dist/auth-provider/authProviderApi.js +31 -31
- package/dist/auth-provider/authProvidersInterfaces.d.ts +54 -54
- 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 +4 -4
- 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 +16 -16
- package/dist/file-uploading/fileUploadingApi.js +14 -17
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +30 -30
- 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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +26 -30
- package/dist/integration-collections/integrationCollectionsApi.js +24 -28
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +61 -60
- 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 +101 -101
- 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 +100 -100
- 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/system/systemApi.d.ts +4 -4
- package/dist/system/systemApi.js +2 -2
- package/dist/system/systemInterfaces.d.ts +11 -5
- package/dist/templates/templatesApi.d.ts +5 -5
- package/dist/templates/templatesApi.js +5 -5
- package/dist/templates/templatesInterfaces.d.ts +13 -13
- 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 +7 -7
- package/dist/users/usersApi.js +7 -7
- package/dist/users/usersInterfaces.d.ts +34 -34
- 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 +31 -31
- package/esm/auth-provider/authProviderApi.js +31 -31
- package/esm/auth-provider/authProvidersInterfaces.d.ts +54 -54
- 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 +4 -4
- 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 +16 -16
- package/esm/file-uploading/fileUploadingApi.js +14 -17
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +30 -30
- 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/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/integration-collections/integrationCollectionsApi.d.ts +26 -30
- package/esm/integration-collections/integrationCollectionsApi.js +24 -28
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +61 -60
- 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 +101 -101
- 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 +100 -100
- 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/system/systemApi.d.ts +4 -4
- package/esm/system/systemApi.js +2 -2
- package/esm/system/systemInterfaces.d.ts +11 -5
- package/esm/templates/templatesApi.d.ts +5 -5
- package/esm/templates/templatesApi.js +5 -5
- package/esm/templates/templatesInterfaces.d.ts +13 -13
- 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 +7 -7
- package/esm/users/usersApi.js +7 -7
- package/esm/users/usersInterfaces.d.ts +34 -34
- package/package.json +2 -2
|
@@ -79,9 +79,9 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
79
79
|
* @param {string} body.formIdentifier - The identifier for the form. Example: "form".
|
|
80
80
|
* @param {number} body.formModuleConfigId - The ID of the form module configuration. Example: 2.
|
|
81
81
|
* @param {string} body.moduleEntityIdentifier - The identifier of the module entity. Example: "form".
|
|
82
|
-
* @param {
|
|
82
|
+
* @param {number | null} [body.replayTo] - Identifier of the parent form data record this one replies to (for threaded data such as comments); `null` for a top-level record. The platform stores it as `parentId`.
|
|
83
83
|
* @param {string | null} [body.status] - The status of the form submission.
|
|
84
|
-
* @param {FormDataType[]} body.formData - Form
|
|
84
|
+
* @param {FormDataType[]} body.formData - Form fields.
|
|
85
85
|
* @example
|
|
86
86
|
[
|
|
87
87
|
{
|
|
@@ -193,7 +193,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
193
193
|
* so it is stripped from an array of values and from a lone value object alike. A value
|
|
194
194
|
* of any other shape is returned untouched and the endpoint names the field it cannot
|
|
195
195
|
* read — instead of the library dying on `value.map is not a function` before the
|
|
196
|
-
* request is made
|
|
196
|
+
* request is made.
|
|
197
197
|
*/
|
|
198
198
|
_stripContentType(value) {
|
|
199
199
|
// An entry carrying `contentType` is copied without it rather than edited:
|
|
@@ -237,8 +237,8 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
237
237
|
* Get one object of form data by marker.
|
|
238
238
|
* @handleName getFormsDataByMarker
|
|
239
239
|
* @param {string} marker - Marker of the form. Example: "contact_form".
|
|
240
|
-
* @param {number} formModuleConfigId -
|
|
241
|
-
* @param {IFormsDataFilter} [body] - Filter for the records to return. Every field is optional; an omitted or empty
|
|
240
|
+
* @param {number} formModuleConfigId - ID of the form module configuration. Example: 4.
|
|
241
|
+
* @param {IFormsDataFilter} [body] - Filter for the records to return. Every field is optional; an omitted or empty field is not applied.
|
|
242
242
|
* @example
|
|
243
243
|
{
|
|
244
244
|
"entityIdentifier": "blog",
|
|
@@ -254,10 +254,10 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
254
254
|
* @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
|
|
255
255
|
* @param {string} [body.dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`. An empty string means "no bound" — the SDK removes it from the body, because the endpoint answers `400 dateFrom must be a valid date in format "YYYY-MM-DD"` to one. An unparsable non-empty value still fails the request. Example: "2025-01-01".
|
|
256
256
|
* @param {string} [body.dateTo] - Upper bound of the submission date, `YYYY-MM-DD`. An empty string means "no bound", handled like `dateFrom`. Example: "2025-12-31".
|
|
257
|
-
* @param {number} [isExtended] -
|
|
257
|
+
* @param {number} [isExtended] - Pass `1` to return additional fields for each record. Default: `0`. Example: 1.
|
|
258
258
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
259
|
-
* @param {number} [offset] -
|
|
260
|
-
* @param {number} [limit] -
|
|
259
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
260
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
261
261
|
* @returns {Promise<IFormsByMarkerDataEntity | IError>} Returns an object containing the form data or an error object if there was an issue.
|
|
262
262
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
263
263
|
* @description Each record's `formData` comes back **already unwrapped from its locale**. The API sends `formData: { "en_US": [ … ] }`; the SDK normalizes the response and hands over the array for `langCode`, so read `record.formData` — `record.formData[langCode]` is `undefined` and yields an empty list with no error. This holds for both values of `isExtended`.
|
|
@@ -276,7 +276,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
276
276
|
/**
|
|
277
277
|
* Update one object of form data by id. Requires user authentication.
|
|
278
278
|
* @handleName updateFormsDataByid
|
|
279
|
-
* @param {number} id -
|
|
279
|
+
* @param {number} id - Form data ID. Example: 1.
|
|
280
280
|
* @returns {Promise<IUpdateFormsData | IError>} Returns an object containing the updated form data or an error object if there was an issue.
|
|
281
281
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/updateFormsDataByid updateFormsDataByid} documentation.
|
|
282
282
|
*/
|
|
@@ -289,7 +289,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
289
289
|
/**
|
|
290
290
|
* Update form data status by id. Requires user authentication.
|
|
291
291
|
* @handleName updateFormsDataStatusByid
|
|
292
|
-
* @param {number} id -
|
|
292
|
+
* @param {number} id - Form data ID. Example: 1.
|
|
293
293
|
* @param {object} body - Request body.
|
|
294
294
|
* @returns {Promise<boolean | IError>} Returns an object containing the updated form data or an error object if there was an issue.
|
|
295
295
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/updateFormsDataStatusByid updateFormsDataStatusByid} documentation.
|
|
@@ -301,7 +301,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
301
301
|
/**
|
|
302
302
|
* Delete one object of form data by id. Requires user authentication.
|
|
303
303
|
* @handleName deleteFormsDataByid
|
|
304
|
-
* @param {number} id -
|
|
304
|
+
* @param {number} id - Form data ID. Example: 1.
|
|
305
305
|
* @returns {Promise<boolean | IError>} Returns an object containing the deleted form data or an error object if there was an issue.
|
|
306
306
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/deleteFormsDataByid deleteFormsDataByid} documentation.
|
|
307
307
|
*/
|
|
@@ -312,10 +312,10 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
312
312
|
/**
|
|
313
313
|
* Semantic (vector) search for form data.
|
|
314
314
|
* @handleName getFormsDataByVectorSearch
|
|
315
|
-
* @param {IFormsDataVectorSearch} body - Vector search
|
|
315
|
+
* @param {IFormsDataVectorSearch} body - Vector search parameters. Example: `{ queryText: "order confirmation" }`.
|
|
316
316
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
317
|
-
* @param {number} [offset] -
|
|
318
|
-
* @param {number} [limit] -
|
|
317
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
318
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
319
319
|
* @returns {Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>} Returns an object with an array of found form data records and total count.
|
|
320
320
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
321
321
|
* @description This method performs a semantic (vector) search for form data.
|
|
@@ -28,9 +28,9 @@ interface IFormsData {
|
|
|
28
28
|
* @param {string} body.formIdentifier - The identifier for the form. Example: "form".
|
|
29
29
|
* @param {number} body.formModuleConfigId - The ID of the form module configuration. Example: 2.
|
|
30
30
|
* @param {string} body.moduleEntityIdentifier - The identifier of the module entity. Example: "form".
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {number | null} [body.replayTo] - Identifier of the parent form data record this one replies to (for threaded data such as comments); `null` for a top-level record. The platform stores it as `parentId`. Example: null.
|
|
32
32
|
* @param {string | null} [body.status] - The status of the form submission. Example: "sent".
|
|
33
|
-
* @param {FormDataType[]} body.formData - Form
|
|
33
|
+
* @param {FormDataType[]} body.formData - Form fields.
|
|
34
34
|
* @example
|
|
35
35
|
[
|
|
36
36
|
{
|
|
@@ -61,10 +61,10 @@ interface IFormsData {
|
|
|
61
61
|
"dateFrom": "2025-08-11",
|
|
62
62
|
"dateTo": ""
|
|
63
63
|
}
|
|
64
|
-
* @param {number} [isExtended] -
|
|
64
|
+
* @param {number} [isExtended] - Pass `1` to return additional fields for each record. Default: `0`. Example: 1.
|
|
65
65
|
* @param {string} [langCode] - The language code for localization. Default: "en_US".
|
|
66
|
-
* @param {number} [offset] -
|
|
67
|
-
* @param {number} [limit] -
|
|
66
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
67
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
68
68
|
* @returns {IFormsByMarkerDataEntity} A promise that resolves to a form data entity or an error.
|
|
69
69
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
70
70
|
* @description This method retrieves form data by its marker. Each record's `formData` is returned **already unwrapped from its locale**: the API sends `{ "en_US": [ … ] }`, the SDK hands over the array for `langCode` — read `record.formData`, not `record.formData[langCode]`.
|
|
@@ -73,10 +73,10 @@ interface IFormsData {
|
|
|
73
73
|
/**
|
|
74
74
|
* Semantic (vector) search for form data.
|
|
75
75
|
* @handleName getFormsDataByVectorSearch
|
|
76
|
-
* @param {IFormsDataVectorSearch} body - Vector search
|
|
76
|
+
* @param {IFormsDataVectorSearch} body - Vector search parameters. Example: `{ queryText: "order confirmation" }`.
|
|
77
77
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
78
|
-
* @param {number} [offset] -
|
|
79
|
-
* @param {number} [limit] -
|
|
78
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
79
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
80
80
|
* @returns {Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>} Returns an object with an array of found form data records and total count.
|
|
81
81
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
82
82
|
*/
|
|
@@ -87,8 +87,8 @@ interface IFormsData {
|
|
|
87
87
|
* @interface IFormsDataVectorSearch
|
|
88
88
|
* @property {string} queryText - Natural-language search query. Example: "order confirmation".
|
|
89
89
|
* @property {number} [vectorDistanceThreshold] - Override of the cosine distance threshold (0..2). Example: 0.3.
|
|
90
|
-
* @property {number} [maxHits] -
|
|
91
|
-
* @property {boolean} [debug] - When true
|
|
90
|
+
* @property {number} [maxHits] - Number of top candidates fetched before pagination. Default: 100. Maximum: 500. Example: 10.
|
|
91
|
+
* @property {boolean} [debug] - When `true`, each returned item gets a `distance` field. Example: false.
|
|
92
92
|
* @description Body for the form-data vector/search endpoint.
|
|
93
93
|
*/
|
|
94
94
|
interface IFormsDataVectorSearch {
|
|
@@ -109,7 +109,7 @@ type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
|
|
|
109
109
|
/**
|
|
110
110
|
* Represents the filter body of `getFormsDataByMarker`.
|
|
111
111
|
* @interface IFormsDataFilter
|
|
112
|
-
* @property {string | number} [entityIdentifier] - Identifier of the entity the records belong to; an empty string means
|
|
112
|
+
* @property {string | number} [entityIdentifier] - Identifier of the entity the records belong to; an empty string means no filter. A marker for content entities (`blog`), the **numeric ID for products** (`2954`), the login for users and admins. Example: "blog".
|
|
113
113
|
* @property {number} [parentId] - Identifier of the parent record — the way to fetch replies to one comment. Example: 10.
|
|
114
114
|
* @property {string} [userIdentifier] - Text identifier of the sender; an empty string means "no filter". Example: "admin".
|
|
115
115
|
* @property {FormDataStatus[]} [status] - Moderation statuses to keep. Must be an array — a bare string is rejected with `400`. An empty array means "no filter". Example: ["approved"].
|
|
@@ -140,10 +140,10 @@ interface IFormsDataFilter {
|
|
|
140
140
|
/**
|
|
141
141
|
* Represents a form data record returned by the vector search endpoint.
|
|
142
142
|
* @interface IFormDataSearchEntity
|
|
143
|
-
* @property {number} [id] -
|
|
144
|
-
* @property {string} [formIdentifier] -
|
|
143
|
+
* @property {number} [id] - ID of the form data record. Example: 12345.
|
|
144
|
+
* @property {string} [formIdentifier] - Marker of the form. Example: "contact_form".
|
|
145
145
|
* @property {Date | string} [time] - Date and time the form data was last changed. Example: "2023-02-12 10:56".
|
|
146
|
-
* @property {FormDataType[]} [formData] -
|
|
146
|
+
* @property {FormDataType[]} [formData] - Submitted form fields.
|
|
147
147
|
* @example
|
|
148
148
|
[
|
|
149
149
|
{
|
|
@@ -153,13 +153,13 @@ interface IFormsDataFilter {
|
|
|
153
153
|
}
|
|
154
154
|
]
|
|
155
155
|
* @property {string | null} [userIdentifier] - Text identifier of the user who submitted the form, or `null` for an anonymous submission. Example: null.
|
|
156
|
-
* @property {string} [entityIdentifier] -
|
|
156
|
+
* @property {string} [entityIdentifier] - Marker of the entity the record belongs to. Example: "blog".
|
|
157
157
|
* @property {number | null} [parentId] - Identifier of the parent form data record, or `null` for a top-level record. Example: null.
|
|
158
158
|
* @property {string} [ip] - IP address the form was submitted from. Example: "127.0.0.1".
|
|
159
159
|
* @property {string} [fingerprint] - Device fingerprint of the sender. Example: "UQ_123456_abcdef".
|
|
160
160
|
* @property {boolean} [isUserAdmin] - Whether the record was submitted by an admin. Example: false.
|
|
161
161
|
* @property {FormDataStatus} [status] - Moderation status of the record. Example: "sent".
|
|
162
|
-
* @property {number} [formModuleId] -
|
|
162
|
+
* @property {number} [formModuleId] - ID of the form module the record belongs to. Example: 2.
|
|
163
163
|
* @property {number} [distance] - Cosine distance to the query. Returned only when `debug: true` is passed in the search body. Example: 0.12.
|
|
164
164
|
* @description This interface defines a form data record as returned by the semantic (vector) search endpoint. Unlike IFormDataEntity it carries the moderation and sender fields of the raw record.
|
|
165
165
|
*/
|
|
@@ -180,7 +180,7 @@ interface IFormDataSearchEntity {
|
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* @interface IFormsDataSearchResponse
|
|
183
|
-
* @property {IFormDataSearchEntity[]} items -
|
|
183
|
+
* @property {IFormDataSearchEntity[]} items - Form data records that match the query.
|
|
184
184
|
* @property {number} total - Total number of found records. Example: 100.
|
|
185
185
|
* @description This interface defines the structure of the response returned by the form data vector search endpoint.
|
|
186
186
|
*/
|
|
@@ -191,9 +191,9 @@ interface IFormsDataSearchResponse {
|
|
|
191
191
|
/**
|
|
192
192
|
* Represents the structure of a form data entity.
|
|
193
193
|
* @interface IFormDataEntity
|
|
194
|
-
* @property {number} id -
|
|
195
|
-
* @property {string} formIdentifier -
|
|
196
|
-
* @property {Date | string} time -
|
|
194
|
+
* @property {number} id - ID of the form data record. Example: 12345.
|
|
195
|
+
* @property {string} formIdentifier - Marker of the form. Example: "contact_form".
|
|
196
|
+
* @property {Date | string} time - Date and time the form data was last changed. Example: "2023-10-01T12:00:00Z".
|
|
197
197
|
* @property {FormDataType[]} formData - Submitted fields, **already unwrapped from the locale**: the API returns `{ "en_US": [ … ] }` and the SDK hands over the array for the requested `langCode`.
|
|
198
198
|
* @example
|
|
199
199
|
[
|
|
@@ -203,8 +203,8 @@ interface IFormsDataSearchResponse {
|
|
|
203
203
|
"value": "Test"
|
|
204
204
|
}
|
|
205
205
|
]
|
|
206
|
-
* @property {string | null} [attributeSetIdentifier] -
|
|
207
|
-
* @property {string} [moduleIdentifier] -
|
|
206
|
+
* @property {string | null} [attributeSetIdentifier] - Marker of the attribute set used by the form. Example: "product_attributes".
|
|
207
|
+
* @property {string} [moduleIdentifier] - Marker of the module. Example: "blog".
|
|
208
208
|
* @description This interface defines the structure of a form data entity, including its identifiers, form data, and optional attributes.
|
|
209
209
|
*/
|
|
210
210
|
interface IFormDataEntity {
|
|
@@ -218,7 +218,7 @@ interface IFormDataEntity {
|
|
|
218
218
|
/**
|
|
219
219
|
* Represents a collection of form data entities.
|
|
220
220
|
* @interface IFormsDataEntity
|
|
221
|
-
* @property {IFormDataEntity[]} items -
|
|
221
|
+
* @property {IFormDataEntity[]} items - Form data records.
|
|
222
222
|
* @example
|
|
223
223
|
[
|
|
224
224
|
{
|
|
@@ -240,12 +240,12 @@ interface IFormsDataEntity {
|
|
|
240
240
|
/**
|
|
241
241
|
* Represents the structure of a form data entity.
|
|
242
242
|
* @interface IFormByMarkerDataEntity
|
|
243
|
-
* @property {number} id -
|
|
244
|
-
* @property {null | number} parentId -
|
|
245
|
-
* @property {string} formIdentifier -
|
|
243
|
+
* @property {number} id - ID of the form data record. Example: 12345.
|
|
244
|
+
* @property {null | number} parentId - ID of the parent form data record; `null` for a top-level record. Example: 123.
|
|
245
|
+
* @property {string} formIdentifier - Marker of the form. Example: "contact_form".
|
|
246
246
|
* @property {number} depth - Example: 1.
|
|
247
|
-
* @property {string | null} ip -
|
|
248
|
-
* @property {string | null} fingerprint -
|
|
247
|
+
* @property {string | null} ip - IP address the form was submitted from. Example: '127.0.0.1'.
|
|
248
|
+
* @property {string | null} fingerprint - Device fingerprint of the sender. Example: 'fingerprint'.
|
|
249
249
|
* @property {string | null} status - Moderation status of the record: "sent", "moderation", "approved", "banned" or "deleted"; `null` when the form does not moderate. Example: 'approved'.
|
|
250
250
|
* @property {string | null} userIdentifier - Text identifier (marker) of the user. Example: "admin".
|
|
251
251
|
* @property {FormDataType[]} formData - Submitted fields, **already unwrapped from the locale**: the API returns `{ "en_US": [ … ] }` and the SDK hands over the array for the requested `langCode`. Read `formData` directly — `formData[langCode]` is `undefined`.
|
|
@@ -257,13 +257,13 @@ interface IFormsDataEntity {
|
|
|
257
257
|
"value": "Test"
|
|
258
258
|
}
|
|
259
259
|
]
|
|
260
|
-
* @property {string | null} attributeSetIdentifier -
|
|
261
|
-
* @property {Date | string} time -
|
|
262
|
-
* @property {string} entityIdentifier -
|
|
263
|
-
* @property {boolean} isUserAdmin -
|
|
264
|
-
* @property {number} formModuleConfigId -
|
|
265
|
-
* @property {string} [moduleIdentifier] -
|
|
266
|
-
* @property {number} entityId -
|
|
260
|
+
* @property {string | null} attributeSetIdentifier - Marker of the attribute set used by the form. Example: "product_attributes".
|
|
261
|
+
* @property {Date | string} time - Date and time the form data was last changed. Example: "2023-10-01T12:00:00Z".
|
|
262
|
+
* @property {string} entityIdentifier - Marker of the entity the record belongs to. Example: "test".
|
|
263
|
+
* @property {boolean} isUserAdmin - Whether the record was submitted by an admin. Example: true.
|
|
264
|
+
* @property {number} formModuleConfigId - ID of the form module configuration. Example: 2.
|
|
265
|
+
* @property {string} [moduleIdentifier] - Marker of the module. Example: "blog".
|
|
266
|
+
* @property {number} entityId - ID of the entity the record belongs to. Example: 2.
|
|
267
267
|
* @description This interface defines the structure of a form data entity, including its identifiers, form data, and optional attributes.
|
|
268
268
|
*/
|
|
269
269
|
interface IFormByMarkerDataEntity {
|
|
@@ -287,7 +287,7 @@ interface IFormByMarkerDataEntity {
|
|
|
287
287
|
/**
|
|
288
288
|
* Represents a collection of form data entities.
|
|
289
289
|
* @interface IFormsByMarkerDataEntity
|
|
290
|
-
* @property {IFormByMarkerDataEntity[]} items -
|
|
290
|
+
* @property {IFormByMarkerDataEntity[]} items - Form data records.
|
|
291
291
|
* @example
|
|
292
292
|
[
|
|
293
293
|
{
|
|
@@ -322,7 +322,7 @@ interface IFormsByMarkerDataEntity {
|
|
|
322
322
|
/**
|
|
323
323
|
* Represents the structure of the response after posting form data.
|
|
324
324
|
* @interface IPostFormResponse
|
|
325
|
-
* @property {object} formData - Form
|
|
325
|
+
* @property {object} formData - Form fields.
|
|
326
326
|
* @example
|
|
327
327
|
{
|
|
328
328
|
"id": 42,
|
|
@@ -341,15 +341,15 @@ interface IFormsByMarkerDataEntity {
|
|
|
341
341
|
}
|
|
342
342
|
]
|
|
343
343
|
}
|
|
344
|
-
* @property {number} formData.id -
|
|
345
|
-
* @property {string} formData.formIdentifier -
|
|
346
|
-
* @property {string} formData.time -
|
|
347
|
-
* @property {string} formData.entityIdentifier -
|
|
348
|
-
* @property {boolean} formData.isUserAdmin -
|
|
349
|
-
* @property {number} formData.formModuleId -
|
|
350
|
-
* @property {string | null} formData.userIdentifier -
|
|
351
|
-
* @property {number | null} formData.parentId -
|
|
352
|
-
* @property {FormDataType[]} formData.formData - Form fields
|
|
344
|
+
* @property {number} formData.id - ID of the form data record. Example: 12345.
|
|
345
|
+
* @property {string} formData.formIdentifier - Marker of the form. Example: "contact_form".
|
|
346
|
+
* @property {string} formData.time - Date and time of the submission. Example: "2023-10-01T12:00:00Z".
|
|
347
|
+
* @property {string} formData.entityIdentifier - Identifier of the entity. Example: "blog".
|
|
348
|
+
* @property {boolean} formData.isUserAdmin - Whether the record was submitted by an admin. Example: false.
|
|
349
|
+
* @property {number} formData.formModuleId - ID of the form module. Example: 2.
|
|
350
|
+
* @property {string | null} formData.userIdentifier - Identifier (login) of the user who submitted the form. Example: null.
|
|
351
|
+
* @property {number | null} formData.parentId - ID of the parent record. Example: null.
|
|
352
|
+
* @property {FormDataType[]} formData.formData - Form fields.
|
|
353
353
|
* @example
|
|
354
354
|
[
|
|
355
355
|
{
|
|
@@ -358,7 +358,7 @@ interface IFormsByMarkerDataEntity {
|
|
|
358
358
|
"value": "Jack"
|
|
359
359
|
}
|
|
360
360
|
]
|
|
361
|
-
* @property {string} actionMessage -
|
|
361
|
+
* @property {string} actionMessage - Message shown after the form is submitted; can be localized. Example: "Form submitted successfully".
|
|
362
362
|
*/
|
|
363
363
|
interface IPostFormResponse {
|
|
364
364
|
formData: IPostFormResponseData;
|
|
@@ -393,16 +393,16 @@ interface IPostFormResponseData {
|
|
|
393
393
|
/**
|
|
394
394
|
* Represents the structure of the response after updating form data.
|
|
395
395
|
* @interface IUpdateFormsData
|
|
396
|
-
* @property {number} id -
|
|
397
|
-
* @property {string} formIdentifier -
|
|
398
|
-
* @property {string} time -
|
|
399
|
-
* @property {FormDataType[]} formData - Form fields
|
|
400
|
-
* @property {string} userIdentifier -
|
|
401
|
-
* @property {string} entityIdentifier -
|
|
402
|
-
* @property {null | number} parentId -
|
|
403
|
-
* @property {null | string} fingerprint -
|
|
404
|
-
* @property {boolean} isUserAdmin -
|
|
405
|
-
* @property {number} formModuleId -
|
|
396
|
+
* @property {number} id - ID of the form data record. Example: 12345.
|
|
397
|
+
* @property {string} formIdentifier - Marker of the form. Example: "contact_form".
|
|
398
|
+
* @property {string} time - Date and time of the submission. Example: "2023-10-01T12:00:00Z".
|
|
399
|
+
* @property {FormDataType[]} formData - Form fields.
|
|
400
|
+
* @property {string} userIdentifier - Identifier (login) of the user who submitted the form. Example: null.
|
|
401
|
+
* @property {string} entityIdentifier - Identifier of the entity. Example: "blog".
|
|
402
|
+
* @property {null | number} parentId - ID of the parent record. Example: null.
|
|
403
|
+
* @property {null | string} fingerprint - Device fingerprint of the sender. Example: null.
|
|
404
|
+
* @property {boolean} isUserAdmin - Whether the record was submitted by an admin. Example: false.
|
|
405
|
+
* @property {number} formModuleId - ID of the form module. Example: 2.
|
|
406
406
|
*/
|
|
407
407
|
interface IUpdateFormsData {
|
|
408
408
|
id: number;
|
|
@@ -424,8 +424,7 @@ type FormDataType = IBodyTypeStringNumberFloat | IBodyTypeTimeDate | IBodyTypeTe
|
|
|
424
424
|
* Value shapes accepted by a SUBMISSION (`POST /form-data`).
|
|
425
425
|
*
|
|
426
426
|
* For three field kinds they are not the shapes a page attribute uses, and a
|
|
427
|
-
* body written from the read types is refused.
|
|
428
|
-
* rwah2o.oneentry.cloud, 2026-09-12 and again 2026-09-28 (CMS-888).
|
|
427
|
+
* body written from the read types is refused.
|
|
429
428
|
*
|
|
430
429
|
* `list` takes a list of strings; the `[{ title, value }]` form of a page
|
|
431
430
|
* attribute answers `400 formData's marker '<marker>' value[0] must be a string`.
|
|
@@ -550,12 +549,12 @@ interface ICaptchaValue {
|
|
|
550
549
|
/**
|
|
551
550
|
* Represents the structure of the body for posting form data.
|
|
552
551
|
* @interface IBodyPostFormData
|
|
553
|
-
* @property {string} formIdentifier -
|
|
554
|
-
* @property {number} formModuleConfigId -
|
|
552
|
+
* @property {string} formIdentifier - Marker of the form. Example: "form".
|
|
553
|
+
* @property {number} formModuleConfigId - ID of the form module configuration. Example: 2.
|
|
555
554
|
* @property {string} moduleEntityIdentifier - Text identifier (marker) of the module entity. Example: "blog".
|
|
556
|
-
* @property {
|
|
557
|
-
* @property {string} status - Status of the
|
|
558
|
-
* @property {FormDataPostType[]} formData -
|
|
555
|
+
* @property {number | null} replayTo - Identifier of the parent form data record this one replies to (for threaded data such as comments); `null` for a top-level record. The platform stores it as `parentId`. Example: null.
|
|
556
|
+
* @property {string} status - Status of the submitted data, for example `"sent"`. Example: "sent".
|
|
557
|
+
* @property {FormDataPostType[]} formData - Form fields to submit. Submission value shapes differ from the read shapes; see `FormDataPostType`.
|
|
559
558
|
* @example
|
|
560
559
|
[
|
|
561
560
|
{
|
|
@@ -567,7 +566,7 @@ interface ICaptchaValue {
|
|
|
567
566
|
* @property {string} formData[].marker - The marker identifying the form field. Example: "name".
|
|
568
567
|
* @property {string} formData[].type - The type of the form field. Example: "string".
|
|
569
568
|
* @property {string} formData[].value - The value of the form field. Example: "name".
|
|
570
|
-
* @property {IUploadingQuery} [fileQuery] -
|
|
569
|
+
* @property {IUploadingQuery} [fileQuery] - File storage parameters. Kept for compatibility: the SDK reads `fileQuery` from the **file field itself** (see `IBodyTypeFile`), not from the body, so setting it here does not change where the file is uploaded.
|
|
571
570
|
* @example
|
|
572
571
|
{
|
|
573
572
|
"type": "page",
|
|
@@ -580,7 +579,7 @@ interface IBodyPostFormData {
|
|
|
580
579
|
formIdentifier: string;
|
|
581
580
|
formModuleConfigId: number;
|
|
582
581
|
moduleEntityIdentifier: string;
|
|
583
|
-
replayTo:
|
|
582
|
+
replayTo: number | null;
|
|
584
583
|
status: string;
|
|
585
584
|
formData: FormDataPostType[];
|
|
586
585
|
fileQuery?: IUploadingQuery;
|
|
@@ -715,7 +714,7 @@ interface ITextWithHeaderValue {
|
|
|
715
714
|
* @interface IBodyTypeImageGroupOfImages
|
|
716
715
|
* @property {string} marker - marker name. Example: "avatar".
|
|
717
716
|
* @property {'image' | 'groupOfImages'} type - Type value — must match the attribute type in the set, note the plural in "groupOfImages". Example: "image".
|
|
718
|
-
* @property {object} value - The attached image. The same three shapes as a `file` field accepts, mixable in one array: a `File`/`Blob` (also a `FileList`), which the SDK uploads first; the descriptor `FileUploading.upload` returns for an image **already in storage**, passed through as it is; or a hand-built {@link IImageValue}. In a SUBMISSION the value must be an **array**, as for `file` — a lone object answers `400 formData's marker '<marker>' value must be an array`.
|
|
717
|
+
* @property {object} value - The attached image. The same three shapes as a `file` field accepts, mixable in one array: a `File`/`Blob` (also a `FileList`), which the SDK uploads first; the descriptor `FileUploading.upload` returns for an image **already in storage**, passed through as it is; or a hand-built {@link IImageValue}. In a SUBMISSION the value must be an **array**, as for `file` — a lone object answers `400 formData's marker '<marker>' value must be an array`.
|
|
719
718
|
* @example
|
|
720
719
|
[
|
|
721
720
|
{
|
|
@@ -766,7 +765,7 @@ interface IImageValue {
|
|
|
766
765
|
* @interface IBodyTypeFile
|
|
767
766
|
* @property {string} marker - marker name. Example: "picture".
|
|
768
767
|
* @property {'file'} type - Type value. Example: "file".
|
|
769
|
-
* @property {object} value - The attached file. Three shapes are accepted and may be mixed in one array: a `File`/`Blob` (also a `FileList`), which the SDK uploads first; the descriptor `FileUploading.upload` returns for a file **already in storage**, which is passed through as it is; or a hand-built {@link IFileValue}. In a SUBMISSION the value must be an **array** — a lone descriptor or {@link IFileValue} answers `400 formData's marker '<marker>' value must be an array`, while a lone `File`/`Blob` is fine because the SDK wraps the upload result. A READ returns a single attached file as the object itself.
|
|
768
|
+
* @property {object} value - The attached file. Three shapes are accepted and may be mixed in one array: a `File`/`Blob` (also a `FileList`), which the SDK uploads first; the descriptor `FileUploading.upload` returns for a file **already in storage**, which is passed through as it is; or a hand-built {@link IFileValue}. In a SUBMISSION the value must be an **array** — a lone descriptor or {@link IFileValue} answers `400 formData's marker '<marker>' value must be an array`, while a lone `File`/`Blob` is fine because the SDK wraps the upload result. A READ returns a single attached file as the object itself.
|
|
770
769
|
* @example
|
|
771
770
|
[
|
|
772
771
|
{
|
|
@@ -18,8 +18,8 @@ interface IGeneralTypes {
|
|
|
18
18
|
/**
|
|
19
19
|
* Represents a general type entity.
|
|
20
20
|
* @interface IGeneralTypesEntity
|
|
21
|
-
* @property {number} id -
|
|
22
|
-
* @property {BlockType} type -
|
|
21
|
+
* @property {number} id - ID of the type. Example: 1.
|
|
22
|
+
* @property {BlockType} type - Type name: a `BlockType` value such as `"product"` or `"service"`. Example: "product", "category", "etc".
|
|
23
23
|
* @description Represents a general type entity with an identifier and a type.
|
|
24
24
|
*/
|
|
25
25
|
interface IGeneralTypesEntity {
|
package/dist/index.d.ts
CHANGED
|
@@ -136,7 +136,7 @@ interface IDefineApi {
|
|
|
136
136
|
* @param {string} [config.guestId] - Optional guest identifier sent as the `x-guest-id` header for guest cart/wishlist/activity flows (only while unauthenticated). In the browser, if omitted, a stable per-device id is generated and persisted in localStorage. On the server you MUST pass a per-visitor `guestId` (or call `setGuestId`): the SDK never auto-generates a server id, to avoid sharing one guest across visitors.
|
|
137
137
|
* @param {string} [config.deviceMetadata] - Optional device-metadata string sent as the `x-device-metadata` header instead of the environment-derived fingerprint. Refresh tokens are bound to this header, so a server issuing tokens for a browser (OAuth code exchange) must pass the browser's string (from `getDeviceMetadata()`), or the token will not be refreshable from that browser.
|
|
138
138
|
* @param {string} [config.langCode] - Optional langCode parameter
|
|
139
|
-
* @param {boolean} [config.traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set
|
|
139
|
+
* @param {boolean} [config.traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set it to `true` to save traffic and decide for yourself what data you need: the SDK then skips its follow-up requests, and some results change shape (e.g. `searchPage` returns short `{ id, title }` cards). Default: false.
|
|
140
140
|
* @param {string} [config.auth] - An object with authorization settings.
|
|
141
141
|
* @param {boolean} [config.auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal.
|
|
142
142
|
* @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ Object.defineProperty(exports, "isTimeIntervalAttribute", { enumerable: true, ge
|
|
|
59
59
|
* @param {string} [config.guestId] - Optional guest identifier sent as the `x-guest-id` header for guest cart/wishlist/activity flows (only while unauthenticated). In the browser, if omitted, a stable per-device id is generated and persisted in localStorage. On the server you MUST pass a per-visitor `guestId` (or call `setGuestId`): the SDK never auto-generates a server id, to avoid sharing one guest across visitors.
|
|
60
60
|
* @param {string} [config.deviceMetadata] - Optional device-metadata string sent as the `x-device-metadata` header instead of the environment-derived fingerprint. Refresh tokens are bound to this header, so a server issuing tokens for a browser (OAuth code exchange) must pass the browser's string (from `getDeviceMetadata()`), or the token will not be refreshable from that browser.
|
|
61
61
|
* @param {string} [config.langCode] - Optional langCode parameter
|
|
62
|
-
* @param {boolean} [config.traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set
|
|
62
|
+
* @param {boolean} [config.traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set it to `true` to save traffic and decide for yourself what data you need: the SDK then skips its follow-up requests, and some results change shape (e.g. `searchPage` returns short `{ id, title }` cards). Default: false.
|
|
63
63
|
* @param {string} [config.auth] - An object with authorization settings.
|
|
64
64
|
* @param {boolean} [config.auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal.
|
|
65
65
|
* @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
2
|
import type StateModule from '../base/stateModule';
|
|
3
3
|
import type { IError } from '../base/utils';
|
|
4
|
-
import type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionQuery, ICollectionRow, ICollectionRowsResponce, ICollectionsApi } from './integrationCollectionsInterfaces';
|
|
4
|
+
import type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionQuery, ICollectionRow, ICollectionRowsResponce, ICollectionsApi, ICollectionsListQuery } from './integrationCollectionsInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with attributes.
|
|
7
7
|
* @handle /api/content/integration-collections
|
|
@@ -22,26 +22,22 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
22
22
|
* Get all collections.
|
|
23
23
|
* @handleName getICollections
|
|
24
24
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
-
* @param {
|
|
25
|
+
* @param {ICollectionsListQuery} [userQuery] - Optional query parameters.
|
|
26
26
|
* @example
|
|
27
27
|
{
|
|
28
|
-
"limit":
|
|
29
|
-
"offset":
|
|
30
|
-
"entityType": "orders",
|
|
31
|
-
"entityId": 1
|
|
28
|
+
"limit": 30,
|
|
29
|
+
"offset": 0
|
|
32
30
|
}
|
|
33
|
-
* @param {number} [userQuery.limit] -
|
|
34
|
-
* @param {number} [userQuery.offset] -
|
|
35
|
-
* @param {string} [userQuery.entityType] - Entity type. Example: "orders".
|
|
36
|
-
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
31
|
+
* @param {number} [userQuery.limit] - Maximum number of records to return. Default: 30.
|
|
32
|
+
* @param {number} [userQuery.offset] - Number of records to skip. Default: 0.
|
|
37
33
|
* @returns {Promise<ICollectionEntity[] | IError>} Returns an array of ICollection objects or an error object if there was an issue.
|
|
38
34
|
* @see {@link https://js-sdk.oneentry.cloud/docs/integration-collections/getICollections getICollections} documentation.
|
|
39
35
|
*/
|
|
40
|
-
getICollections(langCode?: string, userQuery?:
|
|
36
|
+
getICollections(langCode?: string, userQuery?: ICollectionsListQuery): Promise<ICollectionEntity[] | IError>;
|
|
41
37
|
/**
|
|
42
38
|
* Get a single collection object by id.
|
|
43
39
|
* @handleName getICollectionById
|
|
44
|
-
* @param {number} id - Collection
|
|
40
|
+
* @param {number} id - Collection ID. Example: 1.
|
|
45
41
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
46
42
|
* @returns {Promise<ICollectionEntity | IError>} Returns an ICollection object or an error object if there was an issue.
|
|
47
43
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -51,20 +47,20 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
51
47
|
/**
|
|
52
48
|
* Get all records belonging to the collection by collection id.
|
|
53
49
|
* @handleName getICollectionRowsById
|
|
54
|
-
* @param {number} id - Collection
|
|
50
|
+
* @param {number} id - Collection ID. Example: 1.
|
|
55
51
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
56
|
-
* @param {
|
|
52
|
+
* @param {ICollectionQuery} [userQuery] - Optional query parameters.
|
|
57
53
|
* @example
|
|
58
54
|
{
|
|
59
|
-
"limit":
|
|
60
|
-
"offset":
|
|
55
|
+
"limit": 30,
|
|
56
|
+
"offset": 0,
|
|
61
57
|
"entityType": "orders",
|
|
62
58
|
"entityId": 1
|
|
63
59
|
}
|
|
64
|
-
* @param {number} [userQuery.limit] -
|
|
65
|
-
* @param {number} [userQuery.offset] -
|
|
60
|
+
* @param {number} [userQuery.limit] - Maximum number of records to return. Default: 30.
|
|
61
|
+
* @param {number} [userQuery.offset] - Number of records to skip. Default: 0.
|
|
66
62
|
* @param {string} [userQuery.entityType] - Entity type. Example: "orders".
|
|
67
|
-
* @param {number} [userQuery.entityId] - Entity
|
|
63
|
+
* @param {number} [userQuery.entityId] - Entity ID. Example: 1.
|
|
68
64
|
* @returns {Promise<ICollectionRowsResponce | IError>} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
69
65
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
70
66
|
* @description Get all records belonging to the collection by collection id.
|
|
@@ -74,7 +70,7 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
74
70
|
/**
|
|
75
71
|
* Check for the existence of a text identifier (marker).
|
|
76
72
|
* @handleName validateICollectionMarker
|
|
77
|
-
* @param {string} marker -
|
|
73
|
+
* @param {string} marker - Marker of the collection. Example: "collection1".
|
|
78
74
|
* @returns {Promise<ICollectionIsValid | IError>} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
|
|
79
75
|
* @example
|
|
80
76
|
{
|
|
@@ -88,7 +84,7 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
88
84
|
/**
|
|
89
85
|
* Getting all records from the collection.
|
|
90
86
|
* @handleName getICollectionRowsByMarker
|
|
91
|
-
* @param {string} marker -
|
|
87
|
+
* @param {string} marker - Marker of the collection. Example: "collection1".
|
|
92
88
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
93
89
|
* @returns {Promise<ICollectionRowsResponce | IError>} Returns CollectionRowEntity object.
|
|
94
90
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -98,8 +94,8 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
98
94
|
/**
|
|
99
95
|
* Getting one record from the collection.
|
|
100
96
|
* @handleName getICollectionRowByMarkerAndId
|
|
101
|
-
* @param {string} marker -
|
|
102
|
-
* @param {number} id - Collection record
|
|
97
|
+
* @param {string} marker - Marker of the collection. Example: "collection1".
|
|
98
|
+
* @param {number} id - Collection record ID. Example: 1.
|
|
103
99
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
104
100
|
* @returns {Promise<ICollectionRow | IError>} Returns CollectionRowEntity object.
|
|
105
101
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
@@ -109,8 +105,8 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
109
105
|
/**
|
|
110
106
|
* Create a record in the collection.
|
|
111
107
|
* @handleName createICollectionRow
|
|
112
|
-
* @param {string} marker -
|
|
113
|
-
* @param {ICollectionFormObject} body -
|
|
108
|
+
* @param {string} marker - Marker of the collection. Example: "collection1".
|
|
109
|
+
* @param {ICollectionFormObject} body - Data for the new record.
|
|
114
110
|
* @example
|
|
115
111
|
{
|
|
116
112
|
"formIdentifier": "collection-form",
|
|
@@ -132,9 +128,9 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
132
128
|
/**
|
|
133
129
|
* Edit a record in the collection.
|
|
134
130
|
* @handleName updateICollectionRow
|
|
135
|
-
* @param {string} marker -
|
|
136
|
-
* @param {number} id - Row
|
|
137
|
-
* @param {object} body -
|
|
131
|
+
* @param {string} marker - Marker of the collection. Example: "collection1".
|
|
132
|
+
* @param {number} id - Row ID in the collection. Example: 12.
|
|
133
|
+
* @param {object} body - Data for updating the collection record.
|
|
138
134
|
* @example
|
|
139
135
|
{
|
|
140
136
|
"formIdentifier": "collection-form",
|
|
@@ -161,8 +157,8 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
161
157
|
/**
|
|
162
158
|
* Deletion of collection record object
|
|
163
159
|
* @handleName deleteICollectionRowByMarkerAndId
|
|
164
|
-
* @param {string} marker -
|
|
165
|
-
* @param {number} id -
|
|
160
|
+
* @param {string} marker - Marker of the collection. Example: "collection1".
|
|
161
|
+
* @param {number} id - ID of the collection row. Example: 12.
|
|
166
162
|
* @returns {Promise<boolean | IError>} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
167
163
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
168
164
|
* @description Deletion of collection record object
|