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.
Files changed (87) hide show
  1. package/README.md +18 -0
  2. package/changelog.md +80 -3
  3. package/dist/admins/adminsInterfaces.d.ts +2 -0
  4. package/dist/admins/adminsSchemas.d.ts +8 -22
  5. package/dist/admins/adminsSchemas.js +3 -9
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +8 -6
  7. package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
  8. package/dist/auth-provider/authProvidersInterfaces.d.ts +4 -4
  9. package/dist/base/attributes.d.ts +105 -0
  10. package/dist/base/attributes.js +172 -0
  11. package/dist/base/utils.d.ts +95 -2
  12. package/dist/base/validation.d.ts +30 -0
  13. package/dist/base/validation.js +94 -1
  14. package/dist/blocks/blocksApi.d.ts +16 -8
  15. package/dist/blocks/blocksApi.js +24 -15
  16. package/dist/blocks/blocksInterfaces.d.ts +17 -9
  17. package/dist/blocks/blocksSchemas.d.ts +6 -6
  18. package/dist/blocks/blocksSchemas.js +2 -1
  19. package/dist/discounts/discountsInterfaces.d.ts +3 -1
  20. package/dist/forms-data/formsDataApi.d.ts +16 -6
  21. package/dist/forms-data/formsDataApi.js +14 -4
  22. package/dist/forms-data/formsDataInterfaces.d.ts +57 -20
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +9 -1
  25. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +6 -6
  26. package/dist/menus/menusInterfaces.d.ts +5 -1
  27. package/dist/menus/menusSchemas.js +4 -1
  28. package/dist/orders/ordersInterfaces.d.ts +3 -1
  29. package/dist/orders/ordersSchemas.d.ts +2 -0
  30. package/dist/orders/ordersSchemas.js +1 -0
  31. package/dist/pages/pagesApi.d.ts +1 -11
  32. package/dist/pages/pagesApi.js +0 -17
  33. package/dist/pages/pagesInterfaces.d.ts +3 -20
  34. package/dist/pages/pagesSchemas.d.ts +6 -10
  35. package/dist/pages/pagesSchemas.js +4 -9
  36. package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -2
  37. package/dist/products/productsSchemas.d.ts +5 -5
  38. package/dist/products/productsSchemas.js +3 -2
  39. package/dist/templates/templatesInterfaces.d.ts +1 -1
  40. package/dist/templates/templatesSchemas.d.ts +3 -3
  41. package/dist/templates/templatesSchemas.js +2 -1
  42. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
  43. package/dist/users/usersInterfaces.d.ts +2 -0
  44. package/dist/users/usersSchemas.d.ts +1 -0
  45. package/esm/admins/adminsInterfaces.d.ts +2 -0
  46. package/esm/admins/adminsSchemas.d.ts +8 -22
  47. package/esm/admins/adminsSchemas.js +3 -9
  48. package/esm/attribute-sets/attributeSetsInterfaces.d.ts +8 -6
  49. package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
  50. package/esm/auth-provider/authProvidersInterfaces.d.ts +4 -4
  51. package/esm/base/attributes.d.ts +105 -0
  52. package/esm/base/attributes.js +163 -0
  53. package/esm/base/utils.d.ts +95 -2
  54. package/esm/base/validation.d.ts +30 -0
  55. package/esm/base/validation.js +93 -0
  56. package/esm/blocks/blocksApi.d.ts +16 -8
  57. package/esm/blocks/blocksApi.js +24 -15
  58. package/esm/blocks/blocksInterfaces.d.ts +17 -9
  59. package/esm/blocks/blocksSchemas.d.ts +6 -6
  60. package/esm/blocks/blocksSchemas.js +2 -1
  61. package/esm/discounts/discountsInterfaces.d.ts +3 -1
  62. package/esm/forms-data/formsDataApi.d.ts +16 -6
  63. package/esm/forms-data/formsDataApi.js +14 -4
  64. package/esm/forms-data/formsDataInterfaces.d.ts +57 -20
  65. package/esm/index.d.ts +1 -0
  66. package/esm/index.js +1 -0
  67. package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +6 -6
  68. package/esm/menus/menusInterfaces.d.ts +5 -1
  69. package/esm/menus/menusSchemas.js +4 -1
  70. package/esm/orders/ordersInterfaces.d.ts +3 -1
  71. package/esm/orders/ordersSchemas.d.ts +2 -0
  72. package/esm/orders/ordersSchemas.js +1 -0
  73. package/esm/pages/pagesApi.d.ts +1 -11
  74. package/esm/pages/pagesApi.js +0 -17
  75. package/esm/pages/pagesInterfaces.d.ts +3 -20
  76. package/esm/pages/pagesSchemas.d.ts +6 -10
  77. package/esm/pages/pagesSchemas.js +3 -8
  78. package/esm/product-statuses/productStatusesInterfaces.d.ts +2 -2
  79. package/esm/products/productsSchemas.d.ts +5 -5
  80. package/esm/products/productsSchemas.js +3 -2
  81. package/esm/templates/templatesInterfaces.d.ts +1 -1
  82. package/esm/templates/templatesSchemas.d.ts +3 -3
  83. package/esm/templates/templatesSchemas.js +2 -1
  84. package/esm/templates-preview/templatesPreviewInterfaces.d.ts +2 -2
  85. package/esm/users/usersInterfaces.d.ts +2 -0
  86. package/esm/users/usersSchemas.d.ts +1 -0
  87. package/package.json +2 -2
@@ -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: string, userQuery?: ICollectionQuery): Promise<ICollectionEntity[] | IError>;
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: string): Promise<ICollectionEntity | IError>;
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: string, userQuery?: ICollectionQuery): Promise<ICollectionRowsResponce | IError>;
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: string): Promise<ICollectionRow | IError>;
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: string): Promise<ICollectionRow | IError>;
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: string): Promise<ICollectionRow | IError>;
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: string): Promise<IMenusEntity | IError>;
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
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { AttributeValuesSchema } from '../base/validation.js';
2
3
  /**
3
4
  * Menu pages schema (recursive)
4
5
  * Can have children that are also menu pages
@@ -9,9 +10,11 @@ export const MenusPagesSchema = z.lazy(() => z.object({
9
10
  id: z.number().nullable(),
10
11
  pageUrl: z.string().nullable(),
11
12
  localizeInfos: z.record(z.string(), z.any()),
12
- attributeValues: z.record(z.string(), z.any()),
13
+ attributeValues: AttributeValuesSchema,
13
14
  position: z.number(),
14
15
  parentId: z.number().nullable(),
16
+ parentType: z.enum(['page', 'custom']).nullable().optional(),
17
+ itemType: z.enum(['page', 'custom']).optional(),
15
18
  }));
16
19
  /**
17
20
  * 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: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
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>;
@@ -97,6 +97,7 @@ export const OrderEntitySchema = z.object({
97
97
  })),
98
98
  })
99
99
  .optional(),
100
+ distance: z.number().optional(),
100
101
  });
101
102
  /**
102
103
  * Orders list response schema
@@ -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 { IPageConfig, IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock } from './pagesInterfaces.js';
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
@@ -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 { IPageConfig, IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock, IPositionForm, PageType, };
327
+ export type { IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock, IPositionForm, PageType, };
@@ -22,7 +22,7 @@ export declare const PageEntitySchema: z.ZodObject<{
22
22
  }>;
23
23
  templateIdentifier: z.ZodNullable<z.ZodString>;
24
24
  attributeSetIdentifier: z.ZodNullable<z.ZodString>;
25
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
25
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
26
26
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
27
27
  rating: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
28
  isSync: z.ZodBoolean;
@@ -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)
@@ -53,7 +54,7 @@ export declare const PagesResponseSchema: z.ZodArray<z.ZodObject<{
53
54
  }>;
54
55
  templateIdentifier: z.ZodNullable<z.ZodString>;
55
56
  attributeSetIdentifier: z.ZodNullable<z.ZodString>;
56
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
57
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
57
58
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
58
59
  rating: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
60
  isSync: z.ZodBoolean;
@@ -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
@@ -99,7 +101,7 @@ export declare const SinglePageSchema: z.ZodObject<{
99
101
  }>;
100
102
  templateIdentifier: z.ZodNullable<z.ZodString>;
101
103
  attributeSetIdentifier: z.ZodNullable<z.ZodString>;
102
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
104
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
103
105
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
104
106
  rating: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
105
107
  isSync: z.ZodBoolean;
@@ -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
- }, z.core.$strip>;
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>;
@@ -3,6 +3,7 @@
3
3
  * @description Zod schemas for validating pages-related API responses
4
4
  */
5
5
  import { z } from 'zod';
6
+ import { AttributeValuesSchema } from '../base/validation.js';
6
7
  /**
7
8
  * Page entity schema
8
9
  * Includes all fields returned by the API
@@ -18,7 +19,7 @@ export const PageEntitySchema = z.object({
18
19
  type: z.enum(['catalog_page', 'common_page', 'error_page', 'external_page']),
19
20
  templateIdentifier: z.string().nullable(),
20
21
  attributeSetIdentifier: z.string().nullable(),
21
- attributeValues: z.record(z.string(), z.any()),
22
+ attributeValues: AttributeValuesSchema,
22
23
  moduleFormConfigs: z.array(z.any()).optional(),
23
24
  rating: z.record(z.string(), z.unknown()).optional(),
24
25
  isSync: z.boolean(),
@@ -30,6 +31,7 @@ export const PageEntitySchema = z.object({
30
31
  childrenCount: z.number().optional(),
31
32
  total: z.string().optional(),
32
33
  categoryPath: z.string().nullable().optional(),
34
+ distance: z.number().optional(),
33
35
  });
34
36
  /**
35
37
  * Pages response schema (array of pages)
@@ -51,10 +53,3 @@ export const PageSearchResponseSchema = z.array(PageSearchResultSchema);
51
53
  * Single page response schema
52
54
  */
53
55
  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
- });
@@ -12,7 +12,7 @@ interface IProductStatusesApi {
12
12
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
13
13
  * @description This method searches for all product status objects.
14
14
  */
15
- getProductStatuses(langCode: string): Promise<IProductStatusEntity[] | IError>;
15
+ getProductStatuses(langCode?: string): Promise<IProductStatusEntity[] | IError>;
16
16
  /**
17
17
  * Search for a product status object by its textual identifier (marker).
18
18
  * @handleName getProductsByStatusMarker
@@ -22,7 +22,7 @@ interface IProductStatusesApi {
22
22
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
23
23
  * @description This method searches for a product status object by its textual identifier (marker).
24
24
  */
25
- getProductsByStatusMarker(marker: string, langCode: string): Promise<IProductStatusEntity | IError>;
25
+ getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity | IError>;
26
26
  /**
27
27
  * Check the existence of a textual identifier.
28
28
  * @handleName validateMarker
@@ -41,7 +41,7 @@ export declare const ProductEntitySchema: z.ZodObject<{
41
41
  }, z.core.$strip>;
42
42
  sku: z.ZodNullable<z.ZodString>;
43
43
  isSync: z.ZodBoolean;
44
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
44
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
45
45
  categories: z.ZodArray<z.ZodString>;
46
46
  isVisible: z.ZodBoolean;
47
47
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -83,7 +83,7 @@ export declare const ProductsResponseSchema: z.ZodObject<{
83
83
  }, z.core.$strip>;
84
84
  sku: z.ZodNullable<z.ZodString>;
85
85
  isSync: z.ZodBoolean;
86
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
86
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
87
87
  categories: z.ZodArray<z.ZodString>;
88
88
  isVisible: z.ZodBoolean;
89
89
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -127,7 +127,7 @@ export declare const SingleProductSchema: 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.ZodAny>;
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>>;
@@ -189,7 +189,7 @@ export declare const ProductBlockSchema: z.ZodObject<{
189
189
  templateIdentifier: z.ZodNullable<z.ZodString>;
190
190
  isVisible: z.ZodBoolean;
191
191
  isSync: z.ZodBoolean;
192
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
192
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
193
193
  }, z.core.$strip>;
194
194
  /**
195
195
  * Related products schema
@@ -210,7 +210,7 @@ export declare const RelatedProductsSchema: z.ZodArray<z.ZodObject<{
210
210
  }, z.core.$strip>;
211
211
  sku: z.ZodNullable<z.ZodString>;
212
212
  isSync: z.ZodBoolean;
213
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
213
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
214
214
  categories: z.ZodArray<z.ZodString>;
215
215
  isVisible: z.ZodBoolean;
216
216
  moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
@@ -3,6 +3,7 @@
3
3
  * @description Zod schemas for validating products-related API responses
4
4
  */
5
5
  import { z } from 'zod';
6
+ import { AttributeValuesSchema } from '../base/validation.js';
6
7
  /**
7
8
  * Product price schema
8
9
  */
@@ -41,7 +42,7 @@ export const ProductEntitySchema = z.object({
41
42
  }),
42
43
  sku: z.string().nullable(),
43
44
  isSync: z.boolean(),
44
- attributeValues: z.record(z.string(), z.any()),
45
+ attributeValues: AttributeValuesSchema,
45
46
  categories: z.array(z.string()),
46
47
  isVisible: z.boolean(),
47
48
  moduleFormConfigs: z.array(z.any()).optional(),
@@ -113,7 +114,7 @@ export const ProductBlockSchema = z.object({
113
114
  templateIdentifier: z.string().nullable(),
114
115
  isVisible: z.boolean(),
115
116
  isSync: z.boolean(),
116
- attributeValues: z.record(z.string(), z.any()),
117
+ attributeValues: AttributeValuesSchema,
117
118
  });
118
119
  /**
119
120
  * Related products schema
@@ -23,7 +23,7 @@ interface ITemplatesApi {
23
23
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
24
24
  * @description This method gets template objects by type.
25
25
  */
26
- getTemplateByType(type: BlockType, langCode: string): Promise<ITemplateEntity[] | IError>;
26
+ getTemplateByType(type: BlockType, langCode?: string): Promise<ITemplateEntity[] | IError>;
27
27
  /**
28
28
  * Get one template object by id.
29
29
  * @handleName getTemplateByMarker
@@ -15,7 +15,7 @@ export declare const TemplateEntitySchema: z.ZodObject<{
15
15
  identifier: z.ZodString;
16
16
  version: z.ZodNumber;
17
17
  generalTypeName: z.ZodString;
18
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
18
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
19
19
  position: z.ZodNumber;
20
20
  }, z.core.$strip>;
21
21
  /**
@@ -29,7 +29,7 @@ export declare const TemplatesResponseSchema: z.ZodArray<z.ZodObject<{
29
29
  identifier: z.ZodString;
30
30
  version: z.ZodNumber;
31
31
  generalTypeName: z.ZodString;
32
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
32
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
33
33
  position: z.ZodNumber;
34
34
  }, z.core.$strip>>;
35
35
  /**
@@ -43,6 +43,6 @@ export declare const GroupedTemplatesResponseSchema: z.ZodRecord<z.ZodString, z.
43
43
  identifier: z.ZodString;
44
44
  version: z.ZodNumber;
45
45
  generalTypeName: z.ZodString;
46
- attributeValues: z.ZodRecord<z.ZodString, z.ZodAny>;
46
+ attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
47
47
  position: z.ZodNumber;
48
48
  }, z.core.$strip>>>;
@@ -3,6 +3,7 @@
3
3
  * @description Zod schemas for validating templates-related API responses
4
4
  */
5
5
  import { z } from 'zod';
6
+ import { AttributeValuesSchema } from '../base/validation.js';
6
7
  /**
7
8
  * Template entity schema
8
9
  * Includes all fields returned by the API
@@ -15,7 +16,7 @@ export const TemplateEntitySchema = z.object({
15
16
  identifier: z.string(),
16
17
  version: z.number(),
17
18
  generalTypeName: z.string(),
18
- attributeValues: z.record(z.string(), z.any()),
19
+ attributeValues: AttributeValuesSchema,
19
20
  position: z.number(),
20
21
  });
21
22
  /**
@@ -10,7 +10,7 @@ interface ITemplatesPreviewApi {
10
10
  * @returns {ITemplatesPreviewEntity[]} A promise resolving to an array of template preview entities or an error.
11
11
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
12
12
  */
13
- getTemplatePreviews(langCode: string): Promise<ITemplatesPreviewEntity[] | IError>;
13
+ getTemplatePreviews(langCode?: string): Promise<ITemplatesPreviewEntity[] | IError>;
14
14
  /**
15
15
  * Retrieves a specific template preview object by its marker.
16
16
  * @handleName getTemplatePreviewByMarker
@@ -20,7 +20,7 @@ interface ITemplatesPreviewApi {
20
20
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
21
21
  * @description This method retrieves a specific template preview object by its marker.
22
22
  */
23
- getTemplatePreviewByMarker(marker: string, langCode: string): Promise<ITemplatesPreviewEntity | IError>;
23
+ getTemplatePreviewByMarker(marker: string, langCode?: string): Promise<ITemplatesPreviewEntity | IError>;
24
24
  }
25
25
  /**
26
26
  * The `ITemplatesPreview` interface defines the structure of template preview entities.
@@ -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.161",
3
+ "version": "1.0.163",
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.161"
51
+ "postpublish": "node ../scripts/verify-published.js --named defineOneEntry --expect 1.0.163"
52
52
  },
53
53
  "sideEffects": false,
54
54
  "files": [