oneentry 1.0.161 → 1.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/changelog.md +80 -3
- package/dist/admins/adminsInterfaces.d.ts +2 -0
- package/dist/admins/adminsSchemas.d.ts +8 -22
- package/dist/admins/adminsSchemas.js +3 -9
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +8 -6
- package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
- package/dist/auth-provider/authProvidersInterfaces.d.ts +4 -4
- package/dist/base/attributes.d.ts +105 -0
- package/dist/base/attributes.js +172 -0
- package/dist/base/utils.d.ts +95 -2
- package/dist/base/validation.d.ts +30 -0
- package/dist/base/validation.js +94 -1
- package/dist/blocks/blocksApi.d.ts +16 -8
- package/dist/blocks/blocksApi.js +24 -15
- package/dist/blocks/blocksInterfaces.d.ts +17 -9
- package/dist/blocks/blocksSchemas.d.ts +6 -6
- package/dist/blocks/blocksSchemas.js +2 -1
- package/dist/discounts/discountsInterfaces.d.ts +3 -1
- package/dist/forms-data/formsDataApi.d.ts +16 -6
- package/dist/forms-data/formsDataApi.js +14 -4
- package/dist/forms-data/formsDataInterfaces.d.ts +57 -20
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -1
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +6 -6
- package/dist/menus/menusInterfaces.d.ts +5 -1
- package/dist/menus/menusSchemas.js +4 -1
- package/dist/orders/ordersInterfaces.d.ts +3 -1
- package/dist/orders/ordersSchemas.d.ts +2 -0
- package/dist/orders/ordersSchemas.js +1 -0
- package/dist/pages/pagesApi.d.ts +1 -11
- package/dist/pages/pagesApi.js +0 -17
- package/dist/pages/pagesInterfaces.d.ts +3 -20
- package/dist/pages/pagesSchemas.d.ts +6 -10
- package/dist/pages/pagesSchemas.js +4 -9
- package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -2
- package/dist/products/productsSchemas.d.ts +5 -5
- package/dist/products/productsSchemas.js +3 -2
- package/dist/templates/templatesInterfaces.d.ts +1 -1
- package/dist/templates/templatesSchemas.d.ts +3 -3
- package/dist/templates/templatesSchemas.js +2 -1
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
- package/dist/users/usersInterfaces.d.ts +2 -0
- package/dist/users/usersSchemas.d.ts +1 -0
- package/esm/admins/adminsInterfaces.d.ts +2 -0
- package/esm/admins/adminsSchemas.d.ts +8 -22
- package/esm/admins/adminsSchemas.js +3 -9
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +8 -6
- package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +4 -4
- package/esm/base/attributes.d.ts +105 -0
- package/esm/base/attributes.js +163 -0
- package/esm/base/utils.d.ts +95 -2
- package/esm/base/validation.d.ts +30 -0
- package/esm/base/validation.js +93 -0
- package/esm/blocks/blocksApi.d.ts +16 -8
- package/esm/blocks/blocksApi.js +24 -15
- package/esm/blocks/blocksInterfaces.d.ts +17 -9
- package/esm/blocks/blocksSchemas.d.ts +6 -6
- package/esm/blocks/blocksSchemas.js +2 -1
- package/esm/discounts/discountsInterfaces.d.ts +3 -1
- package/esm/forms-data/formsDataApi.d.ts +16 -6
- package/esm/forms-data/formsDataApi.js +14 -4
- package/esm/forms-data/formsDataInterfaces.d.ts +57 -20
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +6 -6
- package/esm/menus/menusInterfaces.d.ts +5 -1
- package/esm/menus/menusSchemas.js +4 -1
- package/esm/orders/ordersInterfaces.d.ts +3 -1
- package/esm/orders/ordersSchemas.d.ts +2 -0
- package/esm/orders/ordersSchemas.js +1 -0
- package/esm/pages/pagesApi.d.ts +1 -11
- package/esm/pages/pagesApi.js +0 -17
- package/esm/pages/pagesInterfaces.d.ts +3 -20
- package/esm/pages/pagesSchemas.d.ts +6 -10
- package/esm/pages/pagesSchemas.js +3 -8
- package/esm/product-statuses/productStatusesInterfaces.d.ts +2 -2
- package/esm/products/productsSchemas.d.ts +5 -5
- package/esm/products/productsSchemas.js +3 -2
- package/esm/templates/templatesInterfaces.d.ts +1 -1
- package/esm/templates/templatesSchemas.d.ts +3 -3
- package/esm/templates/templatesSchemas.js +2 -1
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
- package/esm/users/usersInterfaces.d.ts +2 -0
- package/esm/users/usersSchemas.d.ts +1 -0
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
|
|
|
12
12
|
type: z.ZodString;
|
|
13
13
|
templateIdentifier: z.ZodNullable<z.ZodString>;
|
|
14
14
|
isVisible: z.ZodBoolean;
|
|
15
|
-
attributeValues: z.ZodRecord<z.ZodString, z.
|
|
15
|
+
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
16
|
similarProducts: z.ZodOptional<z.ZodObject<{
|
|
17
17
|
items: z.ZodArray<z.ZodObject<{
|
|
18
18
|
id: z.ZodNumber;
|
|
@@ -30,7 +30,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
|
|
|
30
30
|
}, z.core.$strip>;
|
|
31
31
|
sku: z.ZodNullable<z.ZodString>;
|
|
32
32
|
isSync: z.ZodBoolean;
|
|
33
|
-
attributeValues: z.ZodRecord<z.ZodString, z.
|
|
33
|
+
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
34
34
|
categories: z.ZodArray<z.ZodString>;
|
|
35
35
|
isVisible: z.ZodBoolean;
|
|
36
36
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
@@ -73,7 +73,7 @@ export declare const BlockEntitySchema: z.ZodObject<{
|
|
|
73
73
|
}, z.core.$strip>;
|
|
74
74
|
sku: z.ZodNullable<z.ZodString>;
|
|
75
75
|
isSync: z.ZodBoolean;
|
|
76
|
-
attributeValues: z.ZodRecord<z.ZodString, z.
|
|
76
|
+
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
77
77
|
categories: z.ZodArray<z.ZodString>;
|
|
78
78
|
isVisible: z.ZodBoolean;
|
|
79
79
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
@@ -109,7 +109,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
|
|
|
109
109
|
type: z.ZodString;
|
|
110
110
|
templateIdentifier: z.ZodNullable<z.ZodString>;
|
|
111
111
|
isVisible: z.ZodBoolean;
|
|
112
|
-
attributeValues: z.ZodRecord<z.ZodString, z.
|
|
112
|
+
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
113
113
|
similarProducts: z.ZodOptional<z.ZodObject<{
|
|
114
114
|
items: z.ZodArray<z.ZodObject<{
|
|
115
115
|
id: z.ZodNumber;
|
|
@@ -127,7 +127,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
|
|
|
127
127
|
}, z.core.$strip>;
|
|
128
128
|
sku: z.ZodNullable<z.ZodString>;
|
|
129
129
|
isSync: z.ZodBoolean;
|
|
130
|
-
attributeValues: z.ZodRecord<z.ZodString, z.
|
|
130
|
+
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
131
131
|
categories: z.ZodArray<z.ZodString>;
|
|
132
132
|
isVisible: z.ZodBoolean;
|
|
133
133
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
@@ -170,7 +170,7 @@ export declare const BlocksResponseSchema: z.ZodObject<{
|
|
|
170
170
|
}, z.core.$strip>;
|
|
171
171
|
sku: z.ZodNullable<z.ZodString>;
|
|
172
172
|
isSync: z.ZodBoolean;
|
|
173
|
-
attributeValues: z.ZodRecord<z.ZodString, z.
|
|
173
|
+
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
174
174
|
categories: z.ZodArray<z.ZodString>;
|
|
175
175
|
isVisible: z.ZodBoolean;
|
|
176
176
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SearchBlocksResponseSchema = exports.SearchBlockSchema = exports.BlocksResponseSchema = exports.BlockEntitySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const validation_1 = require("../base/validation");
|
|
5
6
|
const productsSchemas_1 = require("../products/productsSchemas");
|
|
6
7
|
/**
|
|
7
8
|
* Block entity schema
|
|
@@ -16,7 +17,7 @@ exports.BlockEntitySchema = zod_1.z.object({
|
|
|
16
17
|
type: zod_1.z.string(),
|
|
17
18
|
templateIdentifier: zod_1.z.string().nullable(),
|
|
18
19
|
isVisible: zod_1.z.boolean(),
|
|
19
|
-
attributeValues:
|
|
20
|
+
attributeValues: validation_1.AttributeValuesSchema,
|
|
20
21
|
similarProducts: productsSchemas_1.ProductsResponseSchema.optional(),
|
|
21
22
|
countElementsPerRow: zod_1.z.number().optional(),
|
|
22
23
|
quantity: zod_1.z.number().optional(),
|
|
@@ -29,7 +29,7 @@ interface IDiscountsApi {
|
|
|
29
29
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
30
30
|
* @description Fetches a discount by its marker.
|
|
31
31
|
*/
|
|
32
|
-
getDiscountByMarker(marker: string, langCode
|
|
32
|
+
getDiscountByMarker(marker: string, langCode?: string): Promise<IDiscountsEntity | IError>;
|
|
33
33
|
/**
|
|
34
34
|
* Validate discounts coupon
|
|
35
35
|
* @handleName validateDiscountsCoupon
|
|
@@ -134,6 +134,7 @@ interface IDiscountCondition {
|
|
|
134
134
|
* @property {Record<string, unknown>} [bonusEvent] - Bonus event configuration.
|
|
135
135
|
* @property {number} [position] - Position number for sorting. Example: 1.
|
|
136
136
|
* @property {number | string} [total] - Total count of related entries. Example: "1".
|
|
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.
|
|
137
138
|
*/
|
|
138
139
|
interface IDiscountsEntity {
|
|
139
140
|
id: number;
|
|
@@ -157,6 +158,7 @@ interface IDiscountsEntity {
|
|
|
157
158
|
bonusEvent?: Record<string, unknown> | null;
|
|
158
159
|
position?: number;
|
|
159
160
|
total?: number | string;
|
|
161
|
+
distance?: number;
|
|
160
162
|
}
|
|
161
163
|
/**
|
|
162
164
|
* @interface IDiscountValue
|
|
@@ -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 { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IFormsDataSearchResponse, IFormsDataVectorSearch, IPostFormResponse, IUpdateFormsData } from './formsDataInterfaces';
|
|
4
|
+
import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IFormsDataFilter, IFormsDataSearchResponse, IFormsDataVectorSearch, IPostFormResponse, IUpdateFormsData } from './formsDataInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with form data
|
|
7
7
|
* @handle /api/content/form-data
|
|
@@ -56,6 +56,7 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
56
56
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
57
57
|
* @returns {Promise<IPostFormResponse | IError>} Returns an object containing the created form data entry and message.
|
|
58
58
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
59
|
+
* @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects. Passing a `File`/`FileList` as the value is also supported — the SDK uploads it first, then strips `contentType` from the resulting value.
|
|
59
60
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/postFormsData postFormsData} documentation.
|
|
60
61
|
*/
|
|
61
62
|
postFormsData(body: IBodyPostFormData, langCode?: string): Promise<IPostFormResponse | IError>;
|
|
@@ -64,25 +65,34 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
64
65
|
* @handleName getFormsDataByMarker
|
|
65
66
|
* @param {string} marker - Marker of the form. Example: "contact_form".
|
|
66
67
|
* @param {number} formModuleConfigId - Form module configuration ID. Example: 4.
|
|
67
|
-
* @param {
|
|
68
|
+
* @param {IFormsDataFilter} [body] - Filter for the records to return. Every field is optional; an omitted or empty one is not applied.
|
|
68
69
|
* @example
|
|
69
70
|
{
|
|
70
|
-
"entityIdentifier":
|
|
71
|
-
"
|
|
71
|
+
"entityIdentifier": "blog",
|
|
72
|
+
"parentId": 10,
|
|
72
73
|
"userIdentifier": "",
|
|
73
|
-
"status": ["
|
|
74
|
+
"status": ["moderation", "approved"],
|
|
74
75
|
"dateFrom": "2025-01-01",
|
|
75
76
|
"dateTo": ""
|
|
76
77
|
}
|
|
78
|
+
* @param {string} [body.entityIdentifier] - Text identifier (marker) of the entity the records belong to. Example: "blog".
|
|
79
|
+
* @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
|
|
80
|
+
* @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
|
|
81
|
+
* @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"].
|
|
82
|
+
* @param {string} [body.dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`. An unparsable value fails the request with a `500`. Example: "2025-01-01".
|
|
83
|
+
* @param {string} [body.dateTo] - Upper bound of the submission date, `YYYY-MM-DD`. Example: "2025-12-31".
|
|
77
84
|
* @param {number} [isExtended] - Flag for getting additional fields. Example: 1.
|
|
78
85
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
79
86
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
80
87
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
81
88
|
* @returns {Promise<IFormsByMarkerDataEntity | IError>} Returns an object containing the form data or an error object if there was an issue.
|
|
82
89
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
90
|
+
* @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`.
|
|
91
|
+
*
|
|
92
|
+
* The filter body is typed for a reason: the API silently ignores a field it does not know, so a misspelled `statuses` returns every record — unmoderated ones included — and the code looks like it works.
|
|
83
93
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/getFormsDataByMarker getFormsDataByMarker} documentation.
|
|
84
94
|
*/
|
|
85
|
-
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?:
|
|
95
|
+
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: IFormsDataFilter, isExtended?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
|
|
86
96
|
/**
|
|
87
97
|
* Update one object of form data by id. Requires user authentication.
|
|
88
98
|
* @handleName updateFormsDataByid
|
|
@@ -96,6 +96,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
96
96
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
97
97
|
* @returns {Promise<IPostFormResponse | IError>} Returns an object containing the created form data entry and message.
|
|
98
98
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
99
|
+
* @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects. Passing a `File`/`FileList` as the value is also supported — the SDK uploads it first, then strips `contentType` from the resulting value.
|
|
99
100
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/postFormsData postFormsData} documentation.
|
|
100
101
|
*/
|
|
101
102
|
async postFormsData(body, langCode = this.state.lang) {
|
|
@@ -164,22 +165,31 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
164
165
|
* @handleName getFormsDataByMarker
|
|
165
166
|
* @param {string} marker - Marker of the form. Example: "contact_form".
|
|
166
167
|
* @param {number} formModuleConfigId - Form module configuration ID. Example: 4.
|
|
167
|
-
* @param {
|
|
168
|
+
* @param {IFormsDataFilter} [body] - Filter for the records to return. Every field is optional; an omitted or empty one is not applied.
|
|
168
169
|
* @example
|
|
169
170
|
{
|
|
170
|
-
"entityIdentifier":
|
|
171
|
-
"
|
|
171
|
+
"entityIdentifier": "blog",
|
|
172
|
+
"parentId": 10,
|
|
172
173
|
"userIdentifier": "",
|
|
173
|
-
"status": ["
|
|
174
|
+
"status": ["moderation", "approved"],
|
|
174
175
|
"dateFrom": "2025-01-01",
|
|
175
176
|
"dateTo": ""
|
|
176
177
|
}
|
|
178
|
+
* @param {string} [body.entityIdentifier] - Text identifier (marker) of the entity the records belong to. Example: "blog".
|
|
179
|
+
* @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
|
|
180
|
+
* @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
|
|
181
|
+
* @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"].
|
|
182
|
+
* @param {string} [body.dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`. An unparsable value fails the request with a `500`. Example: "2025-01-01".
|
|
183
|
+
* @param {string} [body.dateTo] - Upper bound of the submission date, `YYYY-MM-DD`. Example: "2025-12-31".
|
|
177
184
|
* @param {number} [isExtended] - Flag for getting additional fields. Example: 1.
|
|
178
185
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
179
186
|
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
180
187
|
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
181
188
|
* @returns {Promise<IFormsByMarkerDataEntity | IError>} Returns an object containing the form data or an error object if there was an issue.
|
|
182
189
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
190
|
+
* @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`.
|
|
191
|
+
*
|
|
192
|
+
* The filter body is typed for a reason: the API silently ignores a field it does not know, so a misspelled `statuses` returns every record — unmoderated ones included — and the code looks like it works.
|
|
183
193
|
* @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/getFormsDataByMarker getFormsDataByMarker} documentation.
|
|
184
194
|
*/
|
|
185
195
|
async getFormsDataByMarker(marker, formModuleConfigId, body = {}, isExtended = 0, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
@@ -52,24 +52,24 @@ interface IFormsData {
|
|
|
52
52
|
* @handleName getFormsDataByMarker
|
|
53
53
|
* @param {string} marker - The marker identifying the form data. Example: "contact_form_data".
|
|
54
54
|
* @param {number} formModuleConfigId - The form module configuration ID. Example: 4.
|
|
55
|
-
* @param {
|
|
55
|
+
* @param {IFormsDataFilter} [body] - Filter for the records to return. Default: {}. Every field is optional; an omitted or empty one is not applied. Valid `status` values: "sent", "moderation", "approved", "banned", "deleted".
|
|
56
56
|
* @example
|
|
57
57
|
{
|
|
58
|
-
"entityIdentifier": "
|
|
58
|
+
"entityIdentifier": "blog",
|
|
59
59
|
"userIdentifier": "",
|
|
60
|
-
"status": "",
|
|
60
|
+
"status": ["approved"],
|
|
61
61
|
"dateFrom": "2025-08-11",
|
|
62
62
|
"dateTo": ""
|
|
63
63
|
}
|
|
64
|
-
* @param {number} [
|
|
64
|
+
* @param {number} [isExtended] - Flag for getting additional fields. Example: 1.
|
|
65
65
|
* @param {string} [langCode] - The language code for localization. Default: "en_US".
|
|
66
66
|
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
67
67
|
* @param {number} [limit] - Optional limit for pagination. 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
|
-
* @description This method retrieves form data by its marker.
|
|
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]`.
|
|
71
71
|
*/
|
|
72
|
-
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?:
|
|
72
|
+
getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: IFormsDataFilter, isExtended?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
|
|
73
73
|
/**
|
|
74
74
|
* Semantic (vector) search for form data.
|
|
75
75
|
* @handleName getFormsDataByVectorSearch
|
|
@@ -97,6 +97,39 @@ interface IFormsDataVectorSearch {
|
|
|
97
97
|
maxHits?: number;
|
|
98
98
|
debug?: boolean;
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* FormDataStatus — moderation status of a form data record.
|
|
102
|
+
*
|
|
103
|
+
* The set the API accepts and returns: a submission arrives as `sent`, may be
|
|
104
|
+
* routed to `moderation`, and ends up `approved`, `banned` or `deleted`. Any
|
|
105
|
+
* other value is rejected with `400 each value in status must be a valid enum
|
|
106
|
+
* value` — an error that does not list the valid ones.
|
|
107
|
+
*/
|
|
108
|
+
type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
|
|
109
|
+
/**
|
|
110
|
+
* Represents the filter body of `getFormsDataByMarker`.
|
|
111
|
+
* @interface IFormsDataFilter
|
|
112
|
+
* @property {string} [entityIdentifier] - Text identifier (marker) of the entity the records belong to; an empty string means "no filter". Example: "blog".
|
|
113
|
+
* @property {number} [parentId] - Identifier of the parent record — the way to fetch replies to one comment. Example: 10.
|
|
114
|
+
* @property {string} [userIdentifier] - Text identifier of the sender; an empty string means "no filter". Example: "admin".
|
|
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"].
|
|
116
|
+
* @property {string} [dateFrom] - Lower bound of the submission date, `YYYY-MM-DD`; an empty string means "no bound". A value the API cannot parse fails the request with a `500`. Example: "2025-01-01".
|
|
117
|
+
* @property {string} [dateTo] - Upper bound of the submission date, `YYYY-MM-DD`; an empty string means "no bound". Example: "2025-12-31".
|
|
118
|
+
* @description Filter for reading form submissions. Every field is optional and an omitted one is simply not applied.
|
|
119
|
+
*
|
|
120
|
+
* Typed rather than left as `object` on purpose: the API **ignores** a field it
|
|
121
|
+
* does not know, so `statuses: ['approved']` (note the "s") is not an error —
|
|
122
|
+
* it returns every record, unmoderated ones included. That is premoderation
|
|
123
|
+
* leaking onto a public page, from one typo the compiler used to accept.
|
|
124
|
+
*/
|
|
125
|
+
interface IFormsDataFilter {
|
|
126
|
+
entityIdentifier?: string;
|
|
127
|
+
parentId?: number;
|
|
128
|
+
userIdentifier?: string;
|
|
129
|
+
status?: FormDataStatus[];
|
|
130
|
+
dateFrom?: string;
|
|
131
|
+
dateTo?: string;
|
|
132
|
+
}
|
|
100
133
|
/**
|
|
101
134
|
* Represents a form data record returned by the vector search endpoint.
|
|
102
135
|
* @interface IFormDataSearchEntity
|
|
@@ -112,13 +145,15 @@ interface IFormsDataVectorSearch {
|
|
|
112
145
|
"value": "Test"
|
|
113
146
|
}
|
|
114
147
|
]
|
|
115
|
-
* @property {string} [userIdentifier] - Text identifier of the user who submitted the form. Example:
|
|
116
|
-
* @property {string} [entityIdentifier] - Text identifier of the entity the record belongs to. Example: "
|
|
117
|
-
* @property {number} [parentId] - Identifier of the parent form data record. Example:
|
|
148
|
+
* @property {string | null} [userIdentifier] - Text identifier of the user who submitted the form, or `null` for an anonymous submission. Example: null.
|
|
149
|
+
* @property {string} [entityIdentifier] - Text identifier of the entity the record belongs to. Example: "blog".
|
|
150
|
+
* @property {number | null} [parentId] - Identifier of the parent form data record, or `null` for a top-level record. Example: null.
|
|
118
151
|
* @property {string} [ip] - IP address the form was submitted from. Example: "127.0.0.1".
|
|
119
152
|
* @property {string} [fingerprint] - Device fingerprint of the sender. Example: "UQ_123456_abcdef".
|
|
120
153
|
* @property {boolean} [isUserAdmin] - Whether the record was submitted by an admin. Example: false.
|
|
121
|
-
* @property {
|
|
154
|
+
* @property {FormDataStatus} [status] - Moderation status of the record. Example: "sent".
|
|
155
|
+
* @property {number} [formModuleId] - Identifier of the form module the record belongs to. Example: 2.
|
|
156
|
+
* @property {number} [distance] - Cosine distance to the query. Returned only when `debug: true` is passed in the search body. Example: 0.12.
|
|
122
157
|
* @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.
|
|
123
158
|
*/
|
|
124
159
|
interface IFormDataSearchEntity {
|
|
@@ -126,13 +161,15 @@ interface IFormDataSearchEntity {
|
|
|
126
161
|
formIdentifier?: string;
|
|
127
162
|
time?: Date | string;
|
|
128
163
|
formData?: FormDataType[];
|
|
129
|
-
userIdentifier?: string;
|
|
164
|
+
userIdentifier?: string | null;
|
|
130
165
|
entityIdentifier?: string;
|
|
131
|
-
parentId?: number;
|
|
166
|
+
parentId?: number | null;
|
|
132
167
|
ip?: string;
|
|
133
168
|
fingerprint?: string;
|
|
134
169
|
isUserAdmin?: boolean;
|
|
135
|
-
status?:
|
|
170
|
+
status?: FormDataStatus;
|
|
171
|
+
formModuleId?: number;
|
|
172
|
+
distance?: number;
|
|
136
173
|
}
|
|
137
174
|
/**
|
|
138
175
|
* @interface IFormsDataSearchResponse
|
|
@@ -150,7 +187,7 @@ interface IFormsDataSearchResponse {
|
|
|
150
187
|
* @property {number} id - The unique identifier of the form page. Example: 12345.
|
|
151
188
|
* @property {string} formIdentifier - The identifier of the page. Example: "contact_form".
|
|
152
189
|
* @property {Date | string} time - The identifier of the form. Example: "2023-10-01T12:00:00Z".
|
|
153
|
-
* @property {FormDataType[]} formData -
|
|
190
|
+
* @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`.
|
|
154
191
|
* @example
|
|
155
192
|
[
|
|
156
193
|
{
|
|
@@ -202,9 +239,9 @@ interface IFormsDataEntity {
|
|
|
202
239
|
* @property {number} depth - Example: 1.
|
|
203
240
|
* @property {string | null} ip - Ip. Example: '127.0.0.1'.
|
|
204
241
|
* @property {string | null} fingerprint - Fingerprint. Example: 'fingerprint'.
|
|
205
|
-
* @property {string | null} status -
|
|
242
|
+
* @property {string | null} status - Moderation status of the record: "sent", "moderation", "approved", "banned" or "deleted"; `null` when the form does not moderate. Example: 'approved'.
|
|
206
243
|
* @property {string | null} userIdentifier - Text identifier (marker) of the user. Example: "admin".
|
|
207
|
-
* @property {FormDataType[]} formData -
|
|
244
|
+
* @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`.
|
|
208
245
|
* @example
|
|
209
246
|
[
|
|
210
247
|
{
|
|
@@ -543,7 +580,7 @@ interface ITextWithHeaderValue {
|
|
|
543
580
|
* Represents an image or group of images form data entity.
|
|
544
581
|
* @interface IBodyTypeImageGroupOfImages
|
|
545
582
|
* @property {string} marker - marker name. Example: "avatar".
|
|
546
|
-
* @property {'image' | '
|
|
583
|
+
* @property {'image' | 'groupOfImages'} type - Type value — must match the attribute type in the set, note the plural in "groupOfImages". Example: "image".
|
|
547
584
|
* @property {object} value - Image Object. Contains image information.
|
|
548
585
|
* @example
|
|
549
586
|
[
|
|
@@ -561,7 +598,7 @@ interface ITextWithHeaderValue {
|
|
|
561
598
|
*/
|
|
562
599
|
interface IBodyTypeImageGroupOfImages {
|
|
563
600
|
marker: string;
|
|
564
|
-
type: 'image' | '
|
|
601
|
+
type: 'image' | 'groupOfImages';
|
|
565
602
|
value: IImageValue | IImageValue[];
|
|
566
603
|
}
|
|
567
604
|
/**
|
|
@@ -579,7 +616,7 @@ interface IImageValueParams {
|
|
|
579
616
|
* @property {number} size - File size in bytes. Example: 392585.
|
|
580
617
|
* @property {string} previewLink - URL to a preview-sized version (may be empty).
|
|
581
618
|
* @property {IImageValueParams} params - Image-specific parameters.
|
|
582
|
-
* @description Value payload for `image`/`
|
|
619
|
+
* @description Value payload for `image`/`groupOfImages` form fields. Note it is **not** the object `FileUploading.upload` returns: that one carries `contentType`, which the form-data endpoint rejects. Build the value from `filename`, `downloadLink`, `size` and `previewLink` (the SDK also strips `contentType` from an image value passed to `postFormsData`).
|
|
583
620
|
*/
|
|
584
621
|
interface IImageValue {
|
|
585
622
|
filename: string;
|
|
@@ -667,4 +704,4 @@ interface IListOptionValue {
|
|
|
667
704
|
value: string;
|
|
668
705
|
extended: IListOptionExtended;
|
|
669
706
|
}
|
|
670
|
-
export type { FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFileValue, IFormByMarkerDataEntity, IFormDataEntity, IFormDataSearchEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IFormsDataSearchResponse, IFormsDataVectorSearch, IImageValue, IImageValueParams, IListOptionExtended, IListOptionValue, IPostFormResponse, IPostFormResponseData, ITextEditorParams, ITextValue, ITextWithHeaderValue, ITimeDateValue, IUpdateFormsData, };
|
|
707
|
+
export type { FormDataStatus, FormDataType, IBodyPostFormData, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFileValue, IFormByMarkerDataEntity, IFormDataEntity, IFormDataSearchEntity, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IFormsDataFilter, IFormsDataSearchResponse, IFormsDataVectorSearch, IImageValue, IImageValueParams, IListOptionExtended, IListOptionValue, IPostFormResponse, IPostFormResponseData, ITextEditorParams, ITextValue, ITextWithHeaderValue, ITimeDateValue, IUpdateFormsData, };
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ import TemplatePreviewsApi from './templates-preview/templatesPreviewApi';
|
|
|
30
30
|
import UserActivityApi from './user-activity/userActivityApi';
|
|
31
31
|
import UsersApi from './users/usersApi';
|
|
32
32
|
import WsApi from './web-socket/wsApi';
|
|
33
|
+
export { getAdditionalFields, getAttributeFile, getAttributeFiles, isFileAttribute, isListAttribute, isNumberAttribute, isStringAttribute, } from './base/attributes';
|
|
33
34
|
export { expandAttributeTimeIntervals, expandTimeIntervals, isTimeIntervalAttribute, } from './base/timeIntervals';
|
|
34
35
|
export type * from './types';
|
|
35
36
|
/**
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isTimeIntervalAttribute = exports.expandTimeIntervals = exports.expandAttributeTimeIntervals = void 0;
|
|
6
|
+
exports.isTimeIntervalAttribute = exports.expandTimeIntervals = exports.expandAttributeTimeIntervals = exports.isStringAttribute = exports.isNumberAttribute = exports.isListAttribute = exports.isFileAttribute = exports.getAttributeFiles = exports.getAttributeFile = exports.getAdditionalFields = void 0;
|
|
7
7
|
exports.defineOneEntry = defineOneEntry;
|
|
8
8
|
/**
|
|
9
9
|
* OneEntry SDK
|
|
@@ -37,6 +37,14 @@ const templatesPreviewApi_1 = __importDefault(require("./templates-preview/templ
|
|
|
37
37
|
const userActivityApi_1 = __importDefault(require("./user-activity/userActivityApi"));
|
|
38
38
|
const usersApi_1 = __importDefault(require("./users/usersApi"));
|
|
39
39
|
const wsApi_1 = __importDefault(require("./web-socket/wsApi"));
|
|
40
|
+
var attributes_1 = require("./base/attributes");
|
|
41
|
+
Object.defineProperty(exports, "getAdditionalFields", { enumerable: true, get: function () { return attributes_1.getAdditionalFields; } });
|
|
42
|
+
Object.defineProperty(exports, "getAttributeFile", { enumerable: true, get: function () { return attributes_1.getAttributeFile; } });
|
|
43
|
+
Object.defineProperty(exports, "getAttributeFiles", { enumerable: true, get: function () { return attributes_1.getAttributeFiles; } });
|
|
44
|
+
Object.defineProperty(exports, "isFileAttribute", { enumerable: true, get: function () { return attributes_1.isFileAttribute; } });
|
|
45
|
+
Object.defineProperty(exports, "isListAttribute", { enumerable: true, get: function () { return attributes_1.isListAttribute; } });
|
|
46
|
+
Object.defineProperty(exports, "isNumberAttribute", { enumerable: true, get: function () { return attributes_1.isNumberAttribute; } });
|
|
47
|
+
Object.defineProperty(exports, "isStringAttribute", { enumerable: true, get: function () { return attributes_1.isStringAttribute; } });
|
|
40
48
|
var timeIntervals_1 = require("./base/timeIntervals");
|
|
41
49
|
Object.defineProperty(exports, "expandAttributeTimeIntervals", { enumerable: true, get: function () { return timeIntervals_1.expandAttributeTimeIntervals; } });
|
|
42
50
|
Object.defineProperty(exports, "expandTimeIntervals", { enumerable: true, get: function () { return timeIntervals_1.expandTimeIntervals; } });
|
|
@@ -24,7 +24,7 @@ interface ICollectionsApi {
|
|
|
24
24
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
25
|
* @description This method gets all collections.
|
|
26
26
|
*/
|
|
27
|
-
getICollections(langCode
|
|
27
|
+
getICollections(langCode?: string, userQuery?: ICollectionQuery): Promise<ICollectionEntity[] | IError>;
|
|
28
28
|
/**
|
|
29
29
|
* Get a single collection object by id.
|
|
30
30
|
* @handleName getICollectionById
|
|
@@ -34,7 +34,7 @@ interface ICollectionsApi {
|
|
|
34
34
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
35
35
|
* @description This method gets a single collection object by id.
|
|
36
36
|
*/
|
|
37
|
-
getICollectionById(id: number, langCode
|
|
37
|
+
getICollectionById(id: number, langCode?: string): Promise<ICollectionEntity | IError>;
|
|
38
38
|
/**
|
|
39
39
|
* Get all records belonging to the collection by collection id.
|
|
40
40
|
* @handleName getICollectionRowsById
|
|
@@ -56,7 +56,7 @@ interface ICollectionsApi {
|
|
|
56
56
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
57
57
|
* @description This method gets all records belonging to the collection by collection id.
|
|
58
58
|
*/
|
|
59
|
-
getICollectionRowsById(id: number, langCode
|
|
59
|
+
getICollectionRowsById(id: number, langCode?: string, userQuery?: ICollectionQuery): Promise<ICollectionRowsResponce | IError>;
|
|
60
60
|
/**
|
|
61
61
|
* Check for the existence of a text identifier (marker).
|
|
62
62
|
* @handleName validateICollectionMarker
|
|
@@ -90,7 +90,7 @@ interface ICollectionsApi {
|
|
|
90
90
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
91
91
|
* @description This method gets one record from the collection.
|
|
92
92
|
*/
|
|
93
|
-
getICollectionRowByMarkerAndId(marker: string, id: number, langCode
|
|
93
|
+
getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<ICollectionRow | IError>;
|
|
94
94
|
/**
|
|
95
95
|
* Create a record in the collection.
|
|
96
96
|
* @handleName createICollectionRow
|
|
@@ -112,7 +112,7 @@ interface ICollectionsApi {
|
|
|
112
112
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
113
113
|
* @description This method creates a record in the collection.
|
|
114
114
|
*/
|
|
115
|
-
createICollectionRow(marker: string, body: ICollectionFormObject, langCode
|
|
115
|
+
createICollectionRow(marker: string, body: ICollectionFormObject, langCode?: string): Promise<ICollectionRow | IError>;
|
|
116
116
|
/**
|
|
117
117
|
* Edit a record in the collection.
|
|
118
118
|
* @handleName updateICollectionRow
|
|
@@ -135,7 +135,7 @@ interface ICollectionsApi {
|
|
|
135
135
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
136
136
|
* @description This method edits a record in the collection.
|
|
137
137
|
*/
|
|
138
|
-
updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode
|
|
138
|
+
updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode?: string): Promise<ICollectionRow | IError>;
|
|
139
139
|
/**
|
|
140
140
|
* Deletion of collection record object
|
|
141
141
|
* @handleName deleteICollectionRowByMarkerAndId
|
|
@@ -13,7 +13,7 @@ interface IMenus {
|
|
|
13
13
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
14
14
|
* @description This method gets pages includes in menu by marker.
|
|
15
15
|
*/
|
|
16
|
-
getMenusByMarker(marker: string, langCode
|
|
16
|
+
getMenusByMarker(marker: string, langCode?: string): Promise<IMenusEntity | IError>;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* @interface IMenusPages
|
|
@@ -44,6 +44,8 @@ interface IMenus {
|
|
|
44
44
|
}
|
|
45
45
|
* @property {number} position - The menu position. Example: 1.
|
|
46
46
|
* @property {number | null} parentId - The menu parent id. Example: null.
|
|
47
|
+
* @property {'page' | 'custom' | null} [parentType] - Kind of the parent item: `page` for a menu page, `custom` for a custom item; `null` together with `parentId` means top level. Page ids and custom item ids overlap, so the parent is ambiguous without it. Example: null.
|
|
48
|
+
* @property {'page' | 'custom'} [itemType] - Kind of this item itself: `page` or `custom`. This is the value the item's children must pass in `parentType`. Example: "page".
|
|
47
49
|
* @description This interface defines the structure of a menu page entity, including its identifiers, localization information, attributes, and hierarchical relationships.
|
|
48
50
|
*/
|
|
49
51
|
interface IMenusPages {
|
|
@@ -54,6 +56,8 @@ interface IMenusPages {
|
|
|
54
56
|
attributeValues: IAttributeValues;
|
|
55
57
|
position: number;
|
|
56
58
|
parentId: number | null;
|
|
59
|
+
parentType?: 'page' | 'custom' | null;
|
|
60
|
+
itemType?: 'page' | 'custom';
|
|
57
61
|
}
|
|
58
62
|
/**
|
|
59
63
|
* @interface IMenusEntity
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MenuEntitySchema = exports.MenusPagesSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const validation_1 = require("../base/validation");
|
|
5
6
|
/**
|
|
6
7
|
* Menu pages schema (recursive)
|
|
7
8
|
* Can have children that are also menu pages
|
|
@@ -12,9 +13,11 @@ exports.MenusPagesSchema = zod_1.z.lazy(() => zod_1.z.object({
|
|
|
12
13
|
id: zod_1.z.number().nullable(),
|
|
13
14
|
pageUrl: zod_1.z.string().nullable(),
|
|
14
15
|
localizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
15
|
-
attributeValues:
|
|
16
|
+
attributeValues: validation_1.AttributeValuesSchema,
|
|
16
17
|
position: zod_1.z.number(),
|
|
17
18
|
parentId: zod_1.z.number().nullable(),
|
|
19
|
+
parentType: zod_1.z.enum(['page', 'custom']).nullable().optional(),
|
|
20
|
+
itemType: zod_1.z.enum(['page', 'custom']).optional(),
|
|
18
21
|
}));
|
|
19
22
|
/**
|
|
20
23
|
* Menu entity schema
|
|
@@ -132,7 +132,7 @@ interface IOrdersApi {
|
|
|
132
132
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
133
133
|
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
134
134
|
*/
|
|
135
|
-
getAllStatusesByStorageMarker(marker: string, langCode
|
|
135
|
+
getAllStatusesByStorageMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
|
|
136
136
|
/**
|
|
137
137
|
* Get all refund requests for an order.
|
|
138
138
|
* @handleName getOrderRefunds
|
|
@@ -601,6 +601,7 @@ interface IOrderSplit {
|
|
|
601
601
|
* @property {ILocalizeInfo | null} [paymentStatusLocalizeInfos] - Localized payment status name; null while no payment status is assigned.
|
|
602
602
|
* @property {IOrderDiscountConfig | null} [discountConfig] - Resolved discount configuration applied to the order (orderDiscounts, productDiscounts, coupon, settings, bonus, totals); null on older orders without a resolved discount config.
|
|
603
603
|
* @property {IOrderSplit} [split] - Split (staged) payment configuration; present on the by-id order endpoint.
|
|
604
|
+
* @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.
|
|
604
605
|
* @description Represents an order storage object created by the user.
|
|
605
606
|
*/
|
|
606
607
|
interface IOrderByMarkerEntity {
|
|
@@ -628,6 +629,7 @@ interface IOrderByMarkerEntity {
|
|
|
628
629
|
paymentStatusLocalizeInfos?: ILocalizeInfo | null;
|
|
629
630
|
discountConfig?: IOrderDiscountConfig | null;
|
|
630
631
|
split?: IOrderSplit;
|
|
632
|
+
distance?: number;
|
|
631
633
|
}
|
|
632
634
|
/**
|
|
633
635
|
* Interface representing an order status object.
|
|
@@ -112,6 +112,7 @@ export declare const OrderEntitySchema: z.ZodObject<{
|
|
|
112
112
|
status: z.ZodString;
|
|
113
113
|
}, z.core.$strip>>;
|
|
114
114
|
}, z.core.$strip>>;
|
|
115
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
115
116
|
}, z.core.$strip>;
|
|
116
117
|
/**
|
|
117
118
|
* Orders list response schema
|
|
@@ -180,6 +181,7 @@ export declare const OrdersResponseSchema: z.ZodObject<{
|
|
|
180
181
|
status: z.ZodString;
|
|
181
182
|
}, z.core.$strip>>;
|
|
182
183
|
}, z.core.$strip>>;
|
|
184
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
183
185
|
}, z.core.$strip>>;
|
|
184
186
|
total: z.ZodNumber;
|
|
185
187
|
}, z.core.$strip>;
|
package/dist/pages/pagesApi.d.ts
CHANGED
|
@@ -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 {
|
|
4
|
+
import type { IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock } from './pagesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with page objects, including catalog pages
|
|
7
7
|
* @handle /api/content/pages
|
|
@@ -80,16 +80,6 @@ export default class PagesApi extends AsyncModules implements IPagesApi {
|
|
|
80
80
|
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getBlocksByPageUrl getBlocksByPageUrl} documentation.
|
|
81
81
|
*/
|
|
82
82
|
getBlocksByPageUrl(url: string, langCode?: string): Promise<IPositionBlock[] | IError>;
|
|
83
|
-
/**
|
|
84
|
-
* Get settings for the page.
|
|
85
|
-
* @handleName getConfigPageByUrl
|
|
86
|
-
* @param {string} url - Page URL. Example: "about".
|
|
87
|
-
* @returns {Promise<IPageConfig | IError>} Returns a ConfigPage object with page display settings
|
|
88
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
89
|
-
* @description Get settings for the page.
|
|
90
|
-
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getConfigPageByUrl getConfigPageByUrl} documentation.
|
|
91
|
-
*/
|
|
92
|
-
getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
|
|
93
83
|
/**
|
|
94
84
|
* Quick search for page objects with limited output.
|
|
95
85
|
* @handleName searchPage
|
package/dist/pages/pagesApi.js
CHANGED
|
@@ -212,23 +212,6 @@ class PagesApi extends asyncModules_1.default {
|
|
|
212
212
|
}));
|
|
213
213
|
return normalizeResponse;
|
|
214
214
|
}
|
|
215
|
-
/**
|
|
216
|
-
* Get settings for the page.
|
|
217
|
-
* @handleName getConfigPageByUrl
|
|
218
|
-
* @param {string} url - Page URL. Example: "about".
|
|
219
|
-
* @returns {Promise<IPageConfig | IError>} Returns a ConfigPage object with page display settings
|
|
220
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
221
|
-
* @description Get settings for the page.
|
|
222
|
-
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getConfigPageByUrl getConfigPageByUrl} documentation.
|
|
223
|
-
*/
|
|
224
|
-
async getConfigPageByUrl(url) {
|
|
225
|
-
// Fetch data from the server using a GET request to retrieve forms for the specified page URL and language code
|
|
226
|
-
const result = await this._fetchGet(`/${url}/config`);
|
|
227
|
-
// Validate response if validation is enabled
|
|
228
|
-
const validated = await this._validateResponse(result, schema('PageConfigSchema'));
|
|
229
|
-
// return fetched data
|
|
230
|
-
return validated;
|
|
231
|
-
}
|
|
232
215
|
/**
|
|
233
216
|
* Quick search for page objects with limited output.
|
|
234
217
|
* @handleName searchPage
|