oneentry 1.0.176 → 1.0.177

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 (197) hide show
  1. package/README.md +12 -5
  2. package/changelog.md +116 -0
  3. package/dist/admins/adminsApi.js +2 -9
  4. package/dist/admins/adminsInterfaces.d.ts +5 -5
  5. package/dist/admins/adminsSchemas.d.ts +4 -4
  6. package/dist/admins/adminsSchemas.js +2 -2
  7. package/dist/attribute-sets/attributeSetsApi.d.ts +1 -1
  8. package/dist/attribute-sets/attributeSetsApi.js +4 -4
  9. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
  10. package/dist/attribute-sets/attributeSetsSchemas.d.ts +8 -6
  11. package/dist/attribute-sets/attributeSetsSchemas.js +6 -9
  12. package/dist/auth-provider/authProviderApi.d.ts +4 -4
  13. package/dist/auth-provider/authProviderApi.js +90 -23
  14. package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
  15. package/dist/auth-provider/authProviderSchemas.js +1 -0
  16. package/dist/auth-provider/authProvidersInterfaces.d.ts +8 -6
  17. package/dist/base/asyncModules.d.ts +62 -1
  18. package/dist/base/asyncModules.js +219 -37
  19. package/dist/base/stateModule.d.ts +2 -0
  20. package/dist/base/stateModule.js +22 -12
  21. package/dist/base/syncModules.d.ts +18 -10
  22. package/dist/base/syncModules.js +100 -29
  23. package/dist/base/utils.d.ts +26 -21
  24. package/dist/base/validation.d.ts +3 -3
  25. package/dist/base/validation.js +6 -7
  26. package/dist/blocks/blocksApi.d.ts +20 -17
  27. package/dist/blocks/blocksApi.js +82 -64
  28. package/dist/blocks/blocksInterfaces.d.ts +8 -8
  29. package/dist/discounts/discountsApi.d.ts +9 -7
  30. package/dist/discounts/discountsApi.js +16 -13
  31. package/dist/discounts/discountsInterfaces.d.ts +14 -10
  32. package/dist/events/eventsApi.d.ts +3 -3
  33. package/dist/events/eventsApi.js +3 -3
  34. package/dist/events/eventsInterfaces.d.ts +10 -14
  35. package/dist/file-uploading/fileUploadingApi.d.ts +4 -4
  36. package/dist/file-uploading/fileUploadingApi.js +13 -5
  37. package/dist/file-uploading/fileUploadingInterfaces.d.ts +5 -6
  38. package/dist/filters/filtersApi.js +2 -2
  39. package/dist/forms/formsApi.js +2 -2
  40. package/dist/forms/formsInterfaces.d.ts +1 -3
  41. package/dist/forms/formsSchemas.d.ts +3 -6
  42. package/dist/forms/formsSchemas.js +2 -4
  43. package/dist/forms-data/formsDataApi.d.ts +16 -0
  44. package/dist/forms-data/formsDataApi.js +32 -5
  45. package/dist/forms-data/formsDataInterfaces.d.ts +17 -13
  46. package/dist/general-types/generalTypesInterfaces.d.ts +1 -1
  47. package/dist/index.d.ts +7 -6
  48. package/dist/index.js +50 -7
  49. package/dist/integration-collections/integrationCollectionsApi.d.ts +15 -4
  50. package/dist/integration-collections/integrationCollectionsApi.js +41 -14
  51. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
  52. package/dist/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
  53. package/dist/integration-collections/integrationCollectionsSchemas.js +0 -1
  54. package/dist/menus/menusApi.js +1 -1
  55. package/dist/orders/ordersApi.d.ts +1 -13
  56. package/dist/orders/ordersApi.js +21 -42
  57. package/dist/orders/ordersInterfaces.d.ts +21 -14
  58. package/dist/pages/pagesApi.d.ts +6 -5
  59. package/dist/pages/pagesApi.js +44 -31
  60. package/dist/pages/pagesInterfaces.d.ts +18 -15
  61. package/dist/pages/pagesSchemas.d.ts +0 -3
  62. package/dist/pages/pagesSchemas.js +0 -1
  63. package/dist/payments/paymentsApi.d.ts +10 -11
  64. package/dist/payments/paymentsApi.js +22 -18
  65. package/dist/payments/paymentsInterfaces.d.ts +12 -14
  66. package/dist/payments/paymentsSchemas.d.ts +21 -20
  67. package/dist/payments/paymentsSchemas.js +5 -8
  68. package/dist/product-statuses/productStatusesApi.d.ts +1 -1
  69. package/dist/product-statuses/productStatusesApi.js +3 -3
  70. package/dist/product-statuses/productStatusesInterfaces.d.ts +1 -4
  71. package/dist/products/productsApi.d.ts +38 -58
  72. package/dist/products/productsApi.js +59 -72
  73. package/dist/products/productsInterfaces.d.ts +48 -85
  74. package/dist/search/searchApi.d.ts +1 -1
  75. package/dist/search/searchApi.js +4 -3
  76. package/dist/sitemap/sitemapInterfaces.d.ts +10 -6
  77. package/dist/subscriptions/subscriptionsApi.d.ts +1 -1
  78. package/dist/subscriptions/subscriptionsApi.js +1 -1
  79. package/dist/subscriptions/subscriptionsInterfaces.d.ts +1 -1
  80. package/dist/system/systemApi.d.ts +2 -0
  81. package/dist/system/systemApi.js +2 -0
  82. package/dist/system/systemInterfaces.d.ts +2 -0
  83. package/dist/templates/templatesApi.d.ts +2 -2
  84. package/dist/templates/templatesApi.js +12 -11
  85. package/dist/templates/templatesInterfaces.d.ts +2 -2
  86. package/dist/templates-preview/templatesPreviewApi.js +2 -2
  87. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
  88. package/dist/templates-preview/templatesPreviewSchemas.d.ts +7 -0
  89. package/dist/templates-preview/templatesPreviewSchemas.js +2 -0
  90. package/dist/user-groups/userGroupsApi.js +5 -5
  91. package/dist/user-groups/userGroupsSchemas.d.ts +4 -4
  92. package/dist/users/usersApi.d.ts +1 -1
  93. package/dist/users/usersApi.js +28 -15
  94. package/dist/users/usersInterfaces.d.ts +2 -9
  95. package/dist/web-socket/lazySocket.d.ts +6 -5
  96. package/dist/web-socket/lazySocket.js +212 -15
  97. package/dist/web-socket/wsApi.d.ts +7 -4
  98. package/dist/web-socket/wsApi.js +49 -12
  99. package/dist/web-socket/wsInterfaces.d.ts +41 -4
  100. package/esm/admins/adminsApi.js +2 -9
  101. package/esm/admins/adminsInterfaces.d.ts +5 -5
  102. package/esm/admins/adminsSchemas.d.ts +4 -4
  103. package/esm/admins/adminsSchemas.js +2 -2
  104. package/esm/attribute-sets/attributeSetsApi.d.ts +1 -1
  105. package/esm/attribute-sets/attributeSetsApi.js +4 -4
  106. package/esm/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
  107. package/esm/attribute-sets/attributeSetsSchemas.d.ts +8 -6
  108. package/esm/attribute-sets/attributeSetsSchemas.js +6 -9
  109. package/esm/auth-provider/authProviderApi.d.ts +4 -4
  110. package/esm/auth-provider/authProviderApi.js +90 -23
  111. package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
  112. package/esm/auth-provider/authProviderSchemas.js +1 -0
  113. package/esm/auth-provider/authProvidersInterfaces.d.ts +8 -6
  114. package/esm/base/asyncModules.d.ts +62 -1
  115. package/esm/base/asyncModules.js +219 -37
  116. package/esm/base/stateModule.d.ts +2 -0
  117. package/esm/base/stateModule.js +22 -12
  118. package/esm/base/syncModules.d.ts +18 -10
  119. package/esm/base/syncModules.js +99 -29
  120. package/esm/base/utils.d.ts +26 -21
  121. package/esm/base/validation.d.ts +3 -3
  122. package/esm/base/validation.js +6 -7
  123. package/esm/blocks/blocksApi.d.ts +20 -17
  124. package/esm/blocks/blocksApi.js +82 -64
  125. package/esm/blocks/blocksInterfaces.d.ts +8 -8
  126. package/esm/discounts/discountsApi.d.ts +9 -7
  127. package/esm/discounts/discountsApi.js +16 -13
  128. package/esm/discounts/discountsInterfaces.d.ts +14 -10
  129. package/esm/events/eventsApi.d.ts +3 -3
  130. package/esm/events/eventsApi.js +3 -3
  131. package/esm/events/eventsInterfaces.d.ts +10 -14
  132. package/esm/file-uploading/fileUploadingApi.d.ts +4 -4
  133. package/esm/file-uploading/fileUploadingApi.js +13 -5
  134. package/esm/file-uploading/fileUploadingInterfaces.d.ts +5 -6
  135. package/esm/filters/filtersApi.js +2 -2
  136. package/esm/forms/formsApi.js +2 -2
  137. package/esm/forms/formsInterfaces.d.ts +1 -3
  138. package/esm/forms/formsSchemas.d.ts +3 -6
  139. package/esm/forms/formsSchemas.js +2 -4
  140. package/esm/forms-data/formsDataApi.d.ts +16 -0
  141. package/esm/forms-data/formsDataApi.js +32 -5
  142. package/esm/forms-data/formsDataInterfaces.d.ts +17 -13
  143. package/esm/general-types/generalTypesInterfaces.d.ts +1 -1
  144. package/esm/index.d.ts +7 -6
  145. package/esm/index.js +50 -7
  146. package/esm/integration-collections/integrationCollectionsApi.d.ts +15 -4
  147. package/esm/integration-collections/integrationCollectionsApi.js +41 -14
  148. package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
  149. package/esm/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
  150. package/esm/integration-collections/integrationCollectionsSchemas.js +0 -1
  151. package/esm/menus/menusApi.js +1 -1
  152. package/esm/orders/ordersApi.d.ts +1 -13
  153. package/esm/orders/ordersApi.js +21 -42
  154. package/esm/orders/ordersInterfaces.d.ts +21 -14
  155. package/esm/pages/pagesApi.d.ts +6 -5
  156. package/esm/pages/pagesApi.js +44 -31
  157. package/esm/pages/pagesInterfaces.d.ts +18 -15
  158. package/esm/pages/pagesSchemas.d.ts +0 -3
  159. package/esm/pages/pagesSchemas.js +0 -1
  160. package/esm/payments/paymentsApi.d.ts +10 -11
  161. package/esm/payments/paymentsApi.js +22 -18
  162. package/esm/payments/paymentsInterfaces.d.ts +12 -14
  163. package/esm/payments/paymentsSchemas.d.ts +21 -20
  164. package/esm/payments/paymentsSchemas.js +5 -8
  165. package/esm/product-statuses/productStatusesApi.d.ts +1 -1
  166. package/esm/product-statuses/productStatusesApi.js +3 -3
  167. package/esm/product-statuses/productStatusesInterfaces.d.ts +1 -4
  168. package/esm/products/productsApi.d.ts +38 -58
  169. package/esm/products/productsApi.js +59 -72
  170. package/esm/products/productsInterfaces.d.ts +48 -85
  171. package/esm/search/searchApi.d.ts +1 -1
  172. package/esm/search/searchApi.js +4 -3
  173. package/esm/sitemap/sitemapInterfaces.d.ts +10 -6
  174. package/esm/subscriptions/subscriptionsApi.d.ts +1 -1
  175. package/esm/subscriptions/subscriptionsApi.js +1 -1
  176. package/esm/subscriptions/subscriptionsInterfaces.d.ts +1 -1
  177. package/esm/system/systemApi.d.ts +2 -0
  178. package/esm/system/systemApi.js +2 -0
  179. package/esm/system/systemInterfaces.d.ts +2 -0
  180. package/esm/templates/templatesApi.d.ts +2 -2
  181. package/esm/templates/templatesApi.js +11 -10
  182. package/esm/templates/templatesInterfaces.d.ts +2 -2
  183. package/esm/templates-preview/templatesPreviewApi.js +2 -2
  184. package/esm/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
  185. package/esm/templates-preview/templatesPreviewSchemas.d.ts +7 -0
  186. package/esm/templates-preview/templatesPreviewSchemas.js +2 -0
  187. package/esm/user-groups/userGroupsApi.js +5 -5
  188. package/esm/user-groups/userGroupsSchemas.d.ts +4 -4
  189. package/esm/users/usersApi.d.ts +1 -1
  190. package/esm/users/usersApi.js +28 -15
  191. package/esm/users/usersInterfaces.d.ts +2 -9
  192. package/esm/web-socket/lazySocket.d.ts +6 -5
  193. package/esm/web-socket/lazySocket.js +212 -15
  194. package/esm/web-socket/wsApi.d.ts +7 -4
  195. package/esm/web-socket/wsApi.js +49 -12
  196. package/esm/web-socket/wsInterfaces.d.ts +41 -4
  197. package/package.json +2 -2
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  */
6
6
  export declare const PaymentSessionSchema: z.ZodObject<{
7
7
  id: z.ZodNumber;
8
- orderId: z.ZodNumber;
8
+ orderId: z.ZodNullable<z.ZodNumber>;
9
9
  amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
10
10
  status: z.ZodString;
11
11
  createdDate: z.ZodString;
@@ -22,7 +22,7 @@ export declare const PaymentSessionSchema: z.ZodObject<{
22
22
  export declare const PaymentSessionsResponseSchema: z.ZodObject<{
23
23
  items: z.ZodArray<z.ZodObject<{
24
24
  id: z.ZodNumber;
25
- orderId: z.ZodNumber;
25
+ orderId: z.ZodNullable<z.ZodNumber>;
26
26
  amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
27
27
  status: z.ZodString;
28
28
  createdDate: z.ZodString;
@@ -35,12 +35,12 @@ export declare const PaymentSessionsResponseSchema: z.ZodObject<{
35
35
  total: z.ZodNumber;
36
36
  }, z.core.$strip>;
37
37
  /**
38
- * Single payment session response schema
39
- * @description Schema for a single payment session or array of sessions by order
38
+ * Sessions of one order
39
+ * @description The answer of `/sessions/order/{id}` is always an array (`[]` when there are none)
40
40
  */
41
- export declare const SinglePaymentSessionSchema: z.ZodUnion<readonly [z.ZodObject<{
41
+ export declare const SinglePaymentSessionSchema: z.ZodArray<z.ZodObject<{
42
42
  id: z.ZodNumber;
43
- orderId: z.ZodNumber;
43
+ orderId: z.ZodNullable<z.ZodNumber>;
44
44
  amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
45
  status: z.ZodString;
46
46
  createdDate: z.ZodString;
@@ -49,18 +49,7 @@ export declare const SinglePaymentSessionSchema: z.ZodUnion<readonly [z.ZodObjec
49
49
  paymentAccountId: z.ZodNumber;
50
50
  paymentUrl: z.ZodNullable<z.ZodString>;
51
51
  clientSecret: z.ZodOptional<z.ZodString>;
52
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
53
- id: z.ZodNumber;
54
- orderId: z.ZodNumber;
55
- amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
56
- status: z.ZodString;
57
- createdDate: z.ZodString;
58
- updatedDate: z.ZodString;
59
- type: z.ZodString;
60
- paymentAccountId: z.ZodNumber;
61
- paymentUrl: z.ZodNullable<z.ZodString>;
62
- clientSecret: z.ZodOptional<z.ZodString>;
63
- }, z.core.$strip>>]>;
52
+ }, z.core.$strip>>;
64
53
  /**
65
54
  * Payment account schema
66
55
  * @description Schema for a payment account
@@ -71,7 +60,13 @@ export declare const PaymentAccountSchema: z.ZodObject<{
71
60
  isVisible: z.ZodBoolean;
72
61
  isUsed: z.ZodBoolean;
73
62
  testMode: z.ZodBoolean;
74
- type: z.ZodString;
63
+ type: z.ZodEnum<{
64
+ custom: "custom";
65
+ stripe: "stripe";
66
+ yookassa: "yookassa";
67
+ midtrans: "midtrans";
68
+ xendit: "xendit";
69
+ }>;
75
70
  settings: z.ZodRecord<z.ZodString, z.ZodAny>;
76
71
  testSettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
77
72
  localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
@@ -86,7 +81,13 @@ export declare const PaymentAccountsResponseSchema: z.ZodArray<z.ZodObject<{
86
81
  isVisible: z.ZodBoolean;
87
82
  isUsed: z.ZodBoolean;
88
83
  testMode: z.ZodBoolean;
89
- type: z.ZodString;
84
+ type: z.ZodEnum<{
85
+ custom: "custom";
86
+ stripe: "stripe";
87
+ yookassa: "yookassa";
88
+ midtrans: "midtrans";
89
+ xendit: "xendit";
90
+ }>;
90
91
  settings: z.ZodRecord<z.ZodString, z.ZodAny>;
91
92
  testSettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
92
93
  localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  */
6
6
  export const PaymentSessionSchema = z.object({
7
7
  id: z.number(),
8
- orderId: z.number(),
8
+ orderId: z.number().nullable(),
9
9
  amount: z.number().nullable().optional(),
10
10
  status: z.string(),
11
11
  createdDate: z.string(),
@@ -24,13 +24,10 @@ export const PaymentSessionsResponseSchema = z.object({
24
24
  total: z.number(),
25
25
  });
26
26
  /**
27
- * Single payment session response schema
28
- * @description Schema for a single payment session or array of sessions by order
27
+ * Sessions of one order
28
+ * @description The answer of `/sessions/order/{id}` is always an array (`[]` when there are none)
29
29
  */
30
- export const SinglePaymentSessionSchema = z.union([
31
- PaymentSessionSchema,
32
- z.array(PaymentSessionSchema),
33
- ]);
30
+ export const SinglePaymentSessionSchema = z.array(PaymentSessionSchema);
34
31
  /**
35
32
  * Payment account schema
36
33
  * @description Schema for a payment account
@@ -41,7 +38,7 @@ export const PaymentAccountSchema = z.object({
41
38
  isVisible: z.boolean(),
42
39
  isUsed: z.boolean(),
43
40
  testMode: z.boolean(),
44
- type: z.string(),
41
+ type: z.enum(['stripe', 'yookassa', 'midtrans', 'xendit', 'custom']),
45
42
  settings: z.record(z.string(), z.any()),
46
43
  testSettings: z.record(z.string(), z.any()).optional(),
47
44
  localizeInfos: z.record(z.string(), z.any()),
@@ -33,7 +33,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
33
33
  * @param {string} [langCode] - Language code. Default: "en_US".
34
34
  * @returns {Promise<IProductStatusEntity | IError>} Returns a product status object.
35
35
  * @throws {IError} When isShell=false and an error occurs during the fetch
36
- * @description Search for a product status object by its textual identifier (marker).
36
+ * @description Search for a product status object by its textual identifier (marker). Despite the name it returns the status itself, not products — to list products with a status, filter `Products.getProducts` by `statusMarker`.
37
37
  * @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductsByStatusMarker getProductsByStatusMarker} documentation.
38
38
  */
39
39
  getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity | IError>;
@@ -26,7 +26,7 @@ export default class ProductStatusesApi extends AsyncModules {
26
26
  * @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductStatuses getProductStatuses} documentation.
27
27
  */
28
28
  async getProductStatuses(langCode = this.state.lang) {
29
- const result = await this._fetchGet('');
29
+ const result = await this._fetchGet(`?langCode=${encodeURIComponent(langCode)}`);
30
30
  // Validate response if validation is enabled
31
31
  const validated = await this._validateResponse(result, schema('ProductStatusesResponseSchema'));
32
32
  return this._normalizeData(validated, langCode);
@@ -38,11 +38,11 @@ export default class ProductStatusesApi extends AsyncModules {
38
38
  * @param {string} [langCode] - Language code. Default: "en_US".
39
39
  * @returns {Promise<IProductStatusEntity | IError>} Returns a product status object.
40
40
  * @throws {IError} When isShell=false and an error occurs during the fetch
41
- * @description Search for a product status object by its textual identifier (marker).
41
+ * @description Search for a product status object by its textual identifier (marker). Despite the name it returns the status itself, not products — to list products with a status, filter `Products.getProducts` by `statusMarker`.
42
42
  * @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductsByStatusMarker getProductsByStatusMarker} documentation.
43
43
  */
44
44
  async getProductsByStatusMarker(marker, langCode = this.state.lang) {
45
- const result = await this._fetchGet(`/marker/${this._pathSegment(marker)}`);
45
+ const result = await this._fetchGet(`/marker/${this._pathSegment(marker)}?langCode=${encodeURIComponent(langCode)}`);
46
46
  // Validate response if validation is enabled
47
47
  const validated = await this._validateResponse(result, schema('ProductStatusEntitySchema'));
48
48
  return this._normalizeData(validated, langCode);
@@ -41,10 +41,7 @@ interface IProductStatusesApi {
41
41
  * @property {ILocalizeInfo} localizeInfos - Localized name of the product status.
42
42
  * @example
43
43
  {
44
- "title": "Catalog",
45
- "plainContent": "Content for catalog",
46
- "htmlContent": "<b>Content for catalog</b>",
47
- "menuTitle": "Catalog"
44
+ "title": "Sold"
48
45
  }
49
46
  * @property {boolean} isDefault - Whether this is the default status. Example: true.
50
47
  * @property {number} version - Version number of the object; changes with each update. Example: 1.
@@ -52,14 +52,14 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
52
52
  "offset": 0,
53
53
  "sortOrder": "DESC",
54
54
  "sortKey": "id",
55
- "signPrice": "orders"
55
+ "signPrice": "my_order"
56
56
  }
57
- * @param {string} [userQuery.signPrice] - Marker of the order storage to fix prices for. When set, each product comes with a `signedPrice` that holds the price for a limited time. Example: "orders_storage".
57
+ * @param {string} [userQuery.signPrice] - Marker of the order storage to fix prices for. When set, each product comes with a `signedPrice` that holds the price for a limited time. Must be an existing orders storage marker of the project, e.g. "my_order"; a marker with no such storage fails the whole request with `404 Specified orders storage for price signature not found`.
58
58
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/#Fixing-the-price-signPrice Fixing the price} documentation.
59
59
  * @param {string} [userQuery.sortOrder] - Sorting order parameter.
60
60
  * @returns {Promise<IProductsResponse | IError>} Products response, or IError when isShell=true
61
61
  * @throws {IError} When isShell=false and an error occurs during the fetch
62
- * @description Fetch products with optional filters and pagination.
62
+ * @description Fetch products with optional filters and pagination. `limit` is an integer from `1` (`0` or `1.5` answer `400`). A `signPrice` naming no orders storage fails the whole request with `404 Specified orders storage for price signature not found`. Products without a translation in `langCode` are left out.
63
63
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProducts getProducts} documentation.
64
64
  */
65
65
  getProducts(body?: IFilterParams[], langCode?: string, userQuery?: IProductsQueryBase): Promise<IProductsResponse | IError>;
@@ -75,7 +75,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
75
75
  "offset": 0,
76
76
  "sortOrder": "DESC",
77
77
  "sortKey": "id",
78
- "signPrice": "orders"
78
+ "signPrice": "my_order"
79
79
  }
80
80
  * @returns {Promise<IProductsResponse | IError>} Products without a category: `{ items, total }`, the same container as getProducts.
81
81
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -120,7 +120,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
120
120
  "offset": 0,
121
121
  "sortOrder": "DESC",
122
122
  "sortKey": "id",
123
- "signPrice": "orders"
123
+ "signPrice": "my_order"
124
124
  }
125
125
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
126
126
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -139,7 +139,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
139
139
  "limit": 30,
140
140
  "offset": 0,
141
141
  "sortOrder": "DESC",
142
- "signPrice": "orders",
142
+ "signPrice": "my_order",
143
143
  "statusMarker": "in_stock"
144
144
  }
145
145
  * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
@@ -185,7 +185,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
185
185
  "offset": 0,
186
186
  "sortOrder": "DESC",
187
187
  "sortKey": "id",
188
- "signPrice": "orders"
188
+ "signPrice": "my_order"
189
189
  }
190
190
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
191
191
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -205,7 +205,7 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
205
205
  "offset": 0,
206
206
  "sortOrder": "DESC",
207
207
  "sortKey": "id",
208
- "signPrice": "orders",
208
+ "signPrice": "my_order",
209
209
  "statusMarker": "in_stock",
210
210
  "templateMarker": "template_12345"
211
211
  }
@@ -223,18 +223,18 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
223
223
  /**
224
224
  * Find products by its ids.
225
225
  * @handleName getProductsByIds
226
- * @param {string} ids - Comma-separated IDs of the product pages to fetch. Example: "12345,67890".
226
+ * @param {string} ids - Comma-separated product IDs. Unknown ids are dropped and repeated ones collapsed; a non-numeric one answers `400 Incorrect request`. Example: "12345,67890".
227
227
  * @param {string} [langCode] - Language code. Default: "en_US".
228
228
  * @param {IProductsByIdsQuery} [userQuery] - Optional query parameters.
229
229
  * @example
230
230
  {
231
231
  "limit": 30,
232
232
  "offset": 0,
233
- "signPrice": "orders"
233
+ "signPrice": "my_order"
234
234
  }
235
235
  * @param {number} [userQuery.limit] - Maximum number of records to return. Default: 30.
236
236
  * @param {number} [userQuery.offset] - Number of records to skip. Default: 0.
237
- * @param {string} [userQuery.signPrice] - Marker of the order storage to fix prices for. When set, each product comes with a `signedPrice` that holds the price for a limited time.
237
+ * @param {string} [userQuery.signPrice] - Marker of the order storage to fix prices for. When set, each product comes with a `signedPrice` that holds the price for a limited time. Must be an existing orders storage marker of the project, e.g. "my_order"; a marker with no such storage fails the whole request with `404 Specified orders storage for price signature not found`.
238
238
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
239
239
  * @throws {IError} When isShell=false and an error occurs during the fetch
240
240
  * @description Find products by its ids.
@@ -246,10 +246,10 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
246
246
  * @handleName getProductById
247
247
  * @param {number} id - Product ID. Example: 12345.
248
248
  * @param {string} [langCode] - Language code. Default: "en_US".
249
- * @param {boolean} [isNormalized] - When `true`, the product is returned in normalized form.
249
+ * @param {boolean} [isNormalized] - Deprecated: the API no longer reads it, the answer is the same with `true`, `false` or without it. Kept for compatibility.
250
250
  * @returns {Promise<IProductsEntity | IError>} ProductEntity object.
251
251
  * @throws {IError} When isShell=false and an error occurs during the fetch
252
- * @description Retrieve one product object.
252
+ * @description Retrieve one product object. A product with no translation in `langCode` answers `404 Product not found` — there is no fallback to another language.
253
253
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductById getProductById} documentation.
254
254
  */
255
255
  getProductById(id: number, langCode?: string, isNormalized?: boolean): Promise<IProductsEntity | IError>;
@@ -257,12 +257,13 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
257
257
  * Getting a product block object by product id.
258
258
  * @handleName getProductBlockById
259
259
  * @param {number} id - Product ID. Example: 12345.
260
- * @returns {Promise<IProductBlock | IError>} - Product block object.
260
+ * @param {string} [langCode] - Language code. Default: the client's language.
261
+ * @returns {Promise<IProductBlock[] | IError>} - Array of the product's block objects.
261
262
  * @throws {IError} When isShell=false and an error occurs during the fetch
262
263
  * @description Getting a product block object by product id.
263
264
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductBlockById getProductBlockById} documentation.
264
265
  */
265
- getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
266
+ getProductBlockById(id: number, langCode?: string): Promise<IProductBlock[] | IError>;
266
267
  /**
267
268
  * Quick search for product page objects with limited output.
268
269
  * @handleName searchProduct
@@ -277,18 +278,13 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
277
278
  /**
278
279
  * Getting the number of products for the entire catalog.
279
280
  * @handleName getProductsCount
280
- * @param {any[]} body - Filter objects with search conditions. Default: `[]`.
281
+ * @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
281
282
  * @example
282
283
  [
283
284
  {
284
285
  "attributeMarker": "price",
285
- "conditionMarker": "in",
286
- "statusMarker": "status_1",
287
- "conditionValue": {},
288
- "pageUrls": [
289
- "23-laminat-floorwood-maxima"
290
- ],
291
- "title": "Iphone 17 Pro"
286
+ "conditionMarker": "eq",
287
+ "conditionValue": 51
292
288
  }
293
289
  ]
294
290
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
@@ -306,44 +302,16 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
306
302
  [
307
303
  {
308
304
  "attributeMarker": "price",
309
- "conditionMarker": "in",
310
- "statusMarker": "status_1",
311
- "conditionValue": {},
312
- "pageUrls": [
313
- "23-laminat-floorwood-maxima"
314
- ],
315
- "title": "Iphone 17 Pro"
305
+ "conditionMarker": "eq",
306
+ "conditionValue": 51
316
307
  }
317
308
  ]
318
309
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
319
310
  * @throws {IError} When isShell=false and an error occurs during the fetch
320
- * @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
311
+ * @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering. The counts do not depend on the language: on a language where the catalog is empty they still count every product (CMS-1201).
321
312
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageId getProductsCountByPageId} documentation.
322
313
  */
323
314
  getProductsCountByPageId(id: number | string, body?: any[]): Promise<IProductsCount | IError>;
324
- /**
325
- * Getting the number of products for the catalog page by page url.
326
- * @handleName getProductsCountByPageUrl
327
- * @param {string} url - Page URL.
328
- * @param {any[]} body - Filter objects with search conditions. Default: `[]`.
329
- * @example
330
- [
331
- {
332
- "attributeMarker": "price",
333
- "conditionMarker": "in",
334
- "statusMarker": "status_1",
335
- "conditionValue": {},
336
- "pageUrls": [
337
- "23-laminat-floorwood-maxima"
338
- ],
339
- "title": "Iphone 17 Pro"
340
- }
341
- ]
342
- * @returns {Promise<IProductsCount | IError>} Object with product items count.
343
- * @throws {IError} When isShell=false and an error occurs during the fetch
344
- * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
345
- * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
346
- */
347
315
  /**
348
316
  * Semantic (vector) search for products.
349
317
  * @handleName getProductsByVectorSearch
@@ -358,10 +326,22 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
358
326
  */
359
327
  getProductsByVectorSearch(body: IVectorSearchProducts, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IProductsResponse> | IError>;
360
328
  /**
361
- * Get products by page url.
362
- * @param {string} url - Page URL.
363
- * @param {any[]} body - Request body.
364
- * @returns {IProductsEntity[] | IError} Returns an array of products or an error object.
329
+ * Getting the number of products for the catalog page by page url.
330
+ * @handleName getProductsCountByPageUrl
331
+ * @param {string} url - Page URL. Example: "catalog".
332
+ * @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
333
+ * @example
334
+ [
335
+ {
336
+ "attributeMarker": "price",
337
+ "conditionMarker": "eq",
338
+ "conditionValue": 51
339
+ }
340
+ ]
341
+ * @returns {Promise<IProductsCount | IError>} Object with product items count.
342
+ * @throws {IError} When isShell=false and an error occurs during the fetch
343
+ * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering. The counts do not depend on the language: on a language where the catalog is empty they still count every product (CMS-1201).
344
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
365
345
  */
366
346
  getProductsCountByPageUrl(url: string, body?: any[]): Promise<IProductsCount | IError>;
367
347
  }