oneentry 1.0.161 → 1.0.162
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 +21 -3
- package/dist/admins/adminsInterfaces.d.ts +2 -0
- package/dist/admins/adminsSchemas.d.ts +2 -0
- package/dist/admins/adminsSchemas.js +1 -0
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +2 -0
- package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
- package/dist/base/validation.d.ts +1 -0
- package/dist/base/validation.js +1 -0
- package/dist/blocks/blocksApi.d.ts +16 -8
- package/dist/blocks/blocksApi.js +24 -15
- package/dist/blocks/blocksInterfaces.d.ts +16 -8
- package/dist/discounts/discountsInterfaces.d.ts +2 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +9 -5
- package/dist/menus/menusInterfaces.d.ts +4 -0
- package/dist/menus/menusSchemas.js +2 -0
- package/dist/orders/ordersInterfaces.d.ts +2 -0
- 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 +3 -7
- package/dist/pages/pagesSchemas.js +2 -8
- 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 +2 -0
- package/esm/admins/adminsSchemas.js +1 -0
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +2 -0
- package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
- package/esm/base/validation.d.ts +1 -0
- package/esm/base/validation.js +1 -0
- package/esm/blocks/blocksApi.d.ts +16 -8
- package/esm/blocks/blocksApi.js +24 -15
- package/esm/blocks/blocksInterfaces.d.ts +16 -8
- package/esm/discounts/discountsInterfaces.d.ts +2 -0
- package/esm/forms-data/formsDataInterfaces.d.ts +9 -5
- package/esm/menus/menusInterfaces.d.ts +4 -0
- package/esm/menus/menusSchemas.js +2 -0
- package/esm/orders/ordersInterfaces.d.ts +2 -0
- 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 +3 -7
- package/esm/pages/pagesSchemas.js +1 -7
- package/esm/users/usersInterfaces.d.ts +2 -0
- package/esm/users/usersSchemas.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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
|
|
@@ -112,13 +112,15 @@ interface IFormsDataVectorSearch {
|
|
|
112
112
|
"value": "Test"
|
|
113
113
|
}
|
|
114
114
|
]
|
|
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:
|
|
115
|
+
* @property {string | null} [userIdentifier] - Text identifier of the user who submitted the form, or `null` for an anonymous submission. Example: null.
|
|
116
|
+
* @property {string} [entityIdentifier] - Text identifier of the entity the record belongs to. Example: "blog".
|
|
117
|
+
* @property {number | null} [parentId] - Identifier of the parent form data record, or `null` for a top-level record. Example: null.
|
|
118
118
|
* @property {string} [ip] - IP address the form was submitted from. Example: "127.0.0.1".
|
|
119
119
|
* @property {string} [fingerprint] - Device fingerprint of the sender. Example: "UQ_123456_abcdef".
|
|
120
120
|
* @property {boolean} [isUserAdmin] - Whether the record was submitted by an admin. Example: false.
|
|
121
121
|
* @property {'sent' | 'banned' | 'deleted' | 'moderation' | 'approved'} [status] - Moderation status of the record. Example: "sent".
|
|
122
|
+
* @property {number} [formModuleId] - Identifier of the form module the record belongs to. Example: 2.
|
|
123
|
+
* @property {number} [distance] - Cosine distance to the query. Returned only when `debug: true` is passed in the search body. Example: 0.12.
|
|
122
124
|
* @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
125
|
*/
|
|
124
126
|
interface IFormDataSearchEntity {
|
|
@@ -126,13 +128,15 @@ interface IFormDataSearchEntity {
|
|
|
126
128
|
formIdentifier?: string;
|
|
127
129
|
time?: Date | string;
|
|
128
130
|
formData?: FormDataType[];
|
|
129
|
-
userIdentifier?: string;
|
|
131
|
+
userIdentifier?: string | null;
|
|
130
132
|
entityIdentifier?: string;
|
|
131
|
-
parentId?: number;
|
|
133
|
+
parentId?: number | null;
|
|
132
134
|
ip?: string;
|
|
133
135
|
fingerprint?: string;
|
|
134
136
|
isUserAdmin?: boolean;
|
|
135
137
|
status?: 'sent' | 'banned' | 'deleted' | 'moderation' | 'approved';
|
|
138
|
+
formModuleId?: number;
|
|
139
|
+
distance?: number;
|
|
136
140
|
}
|
|
137
141
|
/**
|
|
138
142
|
* @interface IFormsDataSearchResponse
|
|
@@ -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
|
|
@@ -12,6 +12,8 @@ export const MenusPagesSchema = z.lazy(() => z.object({
|
|
|
12
12
|
attributeValues: z.record(z.string(), z.any()),
|
|
13
13
|
position: z.number(),
|
|
14
14
|
parentId: z.number().nullable(),
|
|
15
|
+
parentType: z.enum(['page', 'custom']).nullable().optional(),
|
|
16
|
+
itemType: z.enum(['page', 'custom']).optional(),
|
|
15
17
|
}));
|
|
16
18
|
/**
|
|
17
19
|
* Menu entity schema
|
|
@@ -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/esm/pages/pagesApi.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules.js';
|
|
2
2
|
import type StateModule from '../base/stateModule.js';
|
|
3
3
|
import type { IError } from '../base/utils.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock } from './pagesInterfaces.js';
|
|
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/esm/pages/pagesApi.js
CHANGED
|
@@ -174,23 +174,6 @@ export default class PagesApi extends AsyncModules {
|
|
|
174
174
|
}));
|
|
175
175
|
return normalizeResponse;
|
|
176
176
|
}
|
|
177
|
-
/**
|
|
178
|
-
* Get settings for the page.
|
|
179
|
-
* @handleName getConfigPageByUrl
|
|
180
|
-
* @param {string} url - Page URL. Example: "about".
|
|
181
|
-
* @returns {Promise<IPageConfig | IError>} Returns a ConfigPage object with page display settings
|
|
182
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
183
|
-
* @description Get settings for the page.
|
|
184
|
-
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getConfigPageByUrl getConfigPageByUrl} documentation.
|
|
185
|
-
*/
|
|
186
|
-
async getConfigPageByUrl(url) {
|
|
187
|
-
// Fetch data from the server using a GET request to retrieve forms for the specified page URL and language code
|
|
188
|
-
const result = await this._fetchGet(`/${url}/config`);
|
|
189
|
-
// Validate response if validation is enabled
|
|
190
|
-
const validated = await this._validateResponse(result, schema('PageConfigSchema'));
|
|
191
|
-
// return fetched data
|
|
192
|
-
return validated;
|
|
193
|
-
}
|
|
194
177
|
/**
|
|
195
178
|
* Quick search for page objects with limited output.
|
|
196
179
|
* @handleName searchPage
|
|
@@ -66,15 +66,6 @@ interface IPagesApi {
|
|
|
66
66
|
* @description This method gets all blocks by page url.
|
|
67
67
|
*/
|
|
68
68
|
getBlocksByPageUrl(url: string, langCode?: LangType): Promise<IPositionBlock[] | IError>;
|
|
69
|
-
/**
|
|
70
|
-
* Get settings for the page.
|
|
71
|
-
* @handleName getConfigPageByUrl
|
|
72
|
-
* @param {string} url - Page URL. Example: "about".
|
|
73
|
-
* @returns {IPageConfig} Returns a ConfigPage object with page display settings
|
|
74
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
75
|
-
* @description This method gets settings for the page.
|
|
76
|
-
*/
|
|
77
|
-
getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
|
|
78
69
|
/**
|
|
79
70
|
* Quick search for page objects with limited output.
|
|
80
71
|
* @handleName searchPage
|
|
@@ -124,16 +115,6 @@ interface IPagesResponse {
|
|
|
124
115
|
items: IPagesEntity[];
|
|
125
116
|
total: number;
|
|
126
117
|
}
|
|
127
|
-
/**
|
|
128
|
-
* @interface IPageConfig
|
|
129
|
-
* @property {number | null} rowsPerPage - Number of lines per page. Example: 1.
|
|
130
|
-
* @property {number | null} productsPerRow - Number of products per page. Example: 1.
|
|
131
|
-
* @description This interface defines the configuration for pagination in pages, including the number of rows and products displayed per page.
|
|
132
|
-
*/
|
|
133
|
-
interface IPageConfig {
|
|
134
|
-
rowsPerPage: number | null;
|
|
135
|
-
productsPerRow: number | null;
|
|
136
|
-
}
|
|
137
118
|
/**
|
|
138
119
|
* @interface IPositionForm
|
|
139
120
|
* @property {number} id - The identifier of the object. Example: 1764.
|
|
@@ -306,6 +287,7 @@ type PageType = 'catalog_page' | 'common_page' | 'error_page' | 'external_page';
|
|
|
306
287
|
* @property {IRating} [rating] - Rating data.
|
|
307
288
|
* @property {string} [total] - Total number of products linked to the page. Example: "10".
|
|
308
289
|
* @property {string | null} [categoryPath] - Category path string; null for nested pages that have no own category path. Example: "catalog".
|
|
290
|
+
* @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.
|
|
309
291
|
* @description This interface defines the structure of a page entity, including its identifiers, attributes, and hierarchical relationships.
|
|
310
292
|
*/
|
|
311
293
|
interface IPagesEntity {
|
|
@@ -330,6 +312,7 @@ interface IPagesEntity {
|
|
|
330
312
|
childrenCount?: number;
|
|
331
313
|
total?: string;
|
|
332
314
|
categoryPath?: string | null;
|
|
315
|
+
distance?: number;
|
|
333
316
|
}
|
|
334
317
|
/**
|
|
335
318
|
* @interface IPageSearchResult
|
|
@@ -341,4 +324,4 @@ interface IPageSearchResult {
|
|
|
341
324
|
id: number;
|
|
342
325
|
title: string;
|
|
343
326
|
}
|
|
344
|
-
export type {
|
|
327
|
+
export type { IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock, IPositionForm, PageType, };
|
|
@@ -34,6 +34,7 @@ export declare const PageEntitySchema: z.ZodObject<{
|
|
|
34
34
|
childrenCount: z.ZodOptional<z.ZodNumber>;
|
|
35
35
|
total: z.ZodOptional<z.ZodString>;
|
|
36
36
|
categoryPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
37
38
|
}, z.core.$strip>;
|
|
38
39
|
/**
|
|
39
40
|
* Pages response schema (array of pages)
|
|
@@ -65,6 +66,7 @@ export declare const PagesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
65
66
|
childrenCount: z.ZodOptional<z.ZodNumber>;
|
|
66
67
|
total: z.ZodOptional<z.ZodString>;
|
|
67
68
|
categoryPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
68
70
|
}, z.core.$strip>>;
|
|
69
71
|
/**
|
|
70
72
|
* Page search result schema
|
|
@@ -111,11 +113,5 @@ export declare const SinglePageSchema: z.ZodObject<{
|
|
|
111
113
|
childrenCount: z.ZodOptional<z.ZodNumber>;
|
|
112
114
|
total: z.ZodOptional<z.ZodString>;
|
|
113
115
|
categoryPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Page config schema
|
|
117
|
-
*/
|
|
118
|
-
export declare const PageConfigSchema: z.ZodObject<{
|
|
119
|
-
rowsPerPage: z.ZodNullable<z.ZodNumber>;
|
|
120
|
-
productsPerRow: z.ZodNullable<z.ZodNumber>;
|
|
116
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
121
117
|
}, z.core.$strip>;
|
|
@@ -30,6 +30,7 @@ export const PageEntitySchema = z.object({
|
|
|
30
30
|
childrenCount: z.number().optional(),
|
|
31
31
|
total: z.string().optional(),
|
|
32
32
|
categoryPath: z.string().nullable().optional(),
|
|
33
|
+
distance: z.number().optional(),
|
|
33
34
|
});
|
|
34
35
|
/**
|
|
35
36
|
* Pages response schema (array of pages)
|
|
@@ -51,10 +52,3 @@ export const PageSearchResponseSchema = z.array(PageSearchResultSchema);
|
|
|
51
52
|
* Single page response schema
|
|
52
53
|
*/
|
|
53
54
|
export const SinglePageSchema = PageEntitySchema;
|
|
54
|
-
/**
|
|
55
|
-
* Page config schema
|
|
56
|
-
*/
|
|
57
|
-
export const PageConfigSchema = z.object({
|
|
58
|
-
rowsPerPage: z.number().nullable(),
|
|
59
|
-
productsPerRow: z.number().nullable(),
|
|
60
|
-
});
|
|
@@ -278,6 +278,7 @@ interface IUsersResponse {
|
|
|
278
278
|
}
|
|
279
279
|
* @property {Array<IFormConfig>} [moduleFormConfigs] - Optional array of form configuration objects associated with the user.
|
|
280
280
|
* @property {IRating} [rating] - Rating data.
|
|
281
|
+
* @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.
|
|
281
282
|
* @description Represents a user entity with various properties, including identifiers, form data, and user groups.
|
|
282
283
|
*/
|
|
283
284
|
interface IUserEntity {
|
|
@@ -291,6 +292,7 @@ interface IUserEntity {
|
|
|
291
292
|
state: Record<string, unknown>;
|
|
292
293
|
moduleFormConfigs?: Array<IFormConfig>;
|
|
293
294
|
rating?: IRating;
|
|
295
|
+
distance?: number;
|
|
294
296
|
}
|
|
295
297
|
/**
|
|
296
298
|
* @interface IUserBody
|
|
@@ -18,6 +18,7 @@ export declare const UserResponseSchema: z.ZodObject<{
|
|
|
18
18
|
state: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
19
19
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
20
20
|
rating: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
21
22
|
}, z.core.$strip>;
|
|
22
23
|
/**
|
|
23
24
|
* Update user response schema (returns true on success)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.162",
|
|
4
4
|
"description": "OneEntry NPM package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"prepublishOnly": "node ../scripts/smoke-pack.js --files-only",
|
|
51
|
-
"postpublish": "node ../scripts/verify-published.js --named defineOneEntry --expect 1.0.
|
|
51
|
+
"postpublish": "node ../scripts/verify-published.js --named defineOneEntry --expect 1.0.162"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
54
|
"files": [
|