oneentry 1.0.176 → 1.0.178

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 (199) 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 +27 -1
  44. package/dist/forms-data/formsDataApi.js +119 -68
  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 +8 -6
  59. package/dist/pages/pagesApi.js +48 -33
  60. package/dist/pages/pagesInterfaces.d.ts +20 -16
  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 +50 -64
  72. package/dist/products/productsApi.js +79 -80
  73. package/dist/products/productsInterfaces.d.ts +59 -90
  74. package/dist/search/searchApi.d.ts +3 -2
  75. package/dist/search/searchApi.js +7 -4
  76. package/dist/search/searchInterfaces.d.ts +2 -1
  77. package/dist/sitemap/sitemapInterfaces.d.ts +10 -6
  78. package/dist/subscriptions/subscriptionsApi.d.ts +1 -1
  79. package/dist/subscriptions/subscriptionsApi.js +1 -1
  80. package/dist/subscriptions/subscriptionsInterfaces.d.ts +1 -1
  81. package/dist/system/systemApi.d.ts +2 -0
  82. package/dist/system/systemApi.js +2 -0
  83. package/dist/system/systemInterfaces.d.ts +2 -0
  84. package/dist/templates/templatesApi.d.ts +2 -2
  85. package/dist/templates/templatesApi.js +12 -11
  86. package/dist/templates/templatesInterfaces.d.ts +2 -2
  87. package/dist/templates-preview/templatesPreviewApi.js +2 -2
  88. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
  89. package/dist/templates-preview/templatesPreviewSchemas.d.ts +7 -0
  90. package/dist/templates-preview/templatesPreviewSchemas.js +2 -0
  91. package/dist/user-groups/userGroupsApi.js +5 -5
  92. package/dist/user-groups/userGroupsSchemas.d.ts +4 -4
  93. package/dist/users/usersApi.d.ts +1 -1
  94. package/dist/users/usersApi.js +28 -15
  95. package/dist/users/usersInterfaces.d.ts +2 -9
  96. package/dist/web-socket/lazySocket.d.ts +6 -5
  97. package/dist/web-socket/lazySocket.js +212 -15
  98. package/dist/web-socket/wsApi.d.ts +7 -4
  99. package/dist/web-socket/wsApi.js +49 -12
  100. package/dist/web-socket/wsInterfaces.d.ts +41 -4
  101. package/esm/admins/adminsApi.js +2 -9
  102. package/esm/admins/adminsInterfaces.d.ts +5 -5
  103. package/esm/admins/adminsSchemas.d.ts +4 -4
  104. package/esm/admins/adminsSchemas.js +2 -2
  105. package/esm/attribute-sets/attributeSetsApi.d.ts +1 -1
  106. package/esm/attribute-sets/attributeSetsApi.js +4 -4
  107. package/esm/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
  108. package/esm/attribute-sets/attributeSetsSchemas.d.ts +8 -6
  109. package/esm/attribute-sets/attributeSetsSchemas.js +6 -9
  110. package/esm/auth-provider/authProviderApi.d.ts +4 -4
  111. package/esm/auth-provider/authProviderApi.js +90 -23
  112. package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
  113. package/esm/auth-provider/authProviderSchemas.js +1 -0
  114. package/esm/auth-provider/authProvidersInterfaces.d.ts +8 -6
  115. package/esm/base/asyncModules.d.ts +62 -1
  116. package/esm/base/asyncModules.js +219 -37
  117. package/esm/base/stateModule.d.ts +2 -0
  118. package/esm/base/stateModule.js +22 -12
  119. package/esm/base/syncModules.d.ts +18 -10
  120. package/esm/base/syncModules.js +99 -29
  121. package/esm/base/utils.d.ts +26 -21
  122. package/esm/base/validation.d.ts +3 -3
  123. package/esm/base/validation.js +6 -7
  124. package/esm/blocks/blocksApi.d.ts +20 -17
  125. package/esm/blocks/blocksApi.js +82 -64
  126. package/esm/blocks/blocksInterfaces.d.ts +8 -8
  127. package/esm/discounts/discountsApi.d.ts +9 -7
  128. package/esm/discounts/discountsApi.js +16 -13
  129. package/esm/discounts/discountsInterfaces.d.ts +14 -10
  130. package/esm/events/eventsApi.d.ts +3 -3
  131. package/esm/events/eventsApi.js +3 -3
  132. package/esm/events/eventsInterfaces.d.ts +10 -14
  133. package/esm/file-uploading/fileUploadingApi.d.ts +4 -4
  134. package/esm/file-uploading/fileUploadingApi.js +13 -5
  135. package/esm/file-uploading/fileUploadingInterfaces.d.ts +5 -6
  136. package/esm/filters/filtersApi.js +2 -2
  137. package/esm/forms/formsApi.js +2 -2
  138. package/esm/forms/formsInterfaces.d.ts +1 -3
  139. package/esm/forms/formsSchemas.d.ts +3 -6
  140. package/esm/forms/formsSchemas.js +2 -4
  141. package/esm/forms-data/formsDataApi.d.ts +27 -1
  142. package/esm/forms-data/formsDataApi.js +119 -68
  143. package/esm/forms-data/formsDataInterfaces.d.ts +17 -13
  144. package/esm/general-types/generalTypesInterfaces.d.ts +1 -1
  145. package/esm/index.d.ts +7 -6
  146. package/esm/index.js +50 -7
  147. package/esm/integration-collections/integrationCollectionsApi.d.ts +15 -4
  148. package/esm/integration-collections/integrationCollectionsApi.js +41 -14
  149. package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
  150. package/esm/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
  151. package/esm/integration-collections/integrationCollectionsSchemas.js +0 -1
  152. package/esm/menus/menusApi.js +1 -1
  153. package/esm/orders/ordersApi.d.ts +1 -13
  154. package/esm/orders/ordersApi.js +21 -42
  155. package/esm/orders/ordersInterfaces.d.ts +21 -14
  156. package/esm/pages/pagesApi.d.ts +8 -6
  157. package/esm/pages/pagesApi.js +48 -33
  158. package/esm/pages/pagesInterfaces.d.ts +20 -16
  159. package/esm/pages/pagesSchemas.d.ts +0 -3
  160. package/esm/pages/pagesSchemas.js +0 -1
  161. package/esm/payments/paymentsApi.d.ts +10 -11
  162. package/esm/payments/paymentsApi.js +22 -18
  163. package/esm/payments/paymentsInterfaces.d.ts +12 -14
  164. package/esm/payments/paymentsSchemas.d.ts +21 -20
  165. package/esm/payments/paymentsSchemas.js +5 -8
  166. package/esm/product-statuses/productStatusesApi.d.ts +1 -1
  167. package/esm/product-statuses/productStatusesApi.js +3 -3
  168. package/esm/product-statuses/productStatusesInterfaces.d.ts +1 -4
  169. package/esm/products/productsApi.d.ts +50 -64
  170. package/esm/products/productsApi.js +79 -80
  171. package/esm/products/productsInterfaces.d.ts +59 -90
  172. package/esm/search/searchApi.d.ts +3 -2
  173. package/esm/search/searchApi.js +7 -4
  174. package/esm/search/searchInterfaces.d.ts +2 -1
  175. package/esm/sitemap/sitemapInterfaces.d.ts +10 -6
  176. package/esm/subscriptions/subscriptionsApi.d.ts +1 -1
  177. package/esm/subscriptions/subscriptionsApi.js +1 -1
  178. package/esm/subscriptions/subscriptionsInterfaces.d.ts +1 -1
  179. package/esm/system/systemApi.d.ts +2 -0
  180. package/esm/system/systemApi.js +2 -0
  181. package/esm/system/systemInterfaces.d.ts +2 -0
  182. package/esm/templates/templatesApi.d.ts +2 -2
  183. package/esm/templates/templatesApi.js +11 -10
  184. package/esm/templates/templatesInterfaces.d.ts +2 -2
  185. package/esm/templates-preview/templatesPreviewApi.js +2 -2
  186. package/esm/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
  187. package/esm/templates-preview/templatesPreviewSchemas.d.ts +7 -0
  188. package/esm/templates-preview/templatesPreviewSchemas.js +2 -0
  189. package/esm/user-groups/userGroupsApi.js +5 -5
  190. package/esm/user-groups/userGroupsSchemas.d.ts +4 -4
  191. package/esm/users/usersApi.d.ts +1 -1
  192. package/esm/users/usersApi.js +28 -15
  193. package/esm/users/usersInterfaces.d.ts +2 -9
  194. package/esm/web-socket/lazySocket.d.ts +6 -5
  195. package/esm/web-socket/lazySocket.js +212 -15
  196. package/esm/web-socket/wsApi.d.ts +7 -4
  197. package/esm/web-socket/wsApi.js +49 -12
  198. package/esm/web-socket/wsInterfaces.d.ts +41 -4
  199. package/package.json +2 -2
@@ -86,21 +86,23 @@ class PaymentsApi extends asyncModules_1.default {
86
86
  * @see {@link https://js-sdk.oneentry.cloud/docs/payments/getSessionById getSessionById} documentation.
87
87
  */
88
88
  async getSessionById(id) {
89
- const result = await this._fetchGet(`/sessions/${id}`);
90
- return result;
89
+ const result = await this._fetchGet(`/sessions/${this._pathSegment(String(id))}`);
90
+ // Validate response if validation is enabled
91
+ const validated = await this._validateResponse(result, schema('PaymentSessionSchema'));
92
+ return validated;
91
93
  }
92
94
  /**
93
95
  * Get one payment session object by order identifier
94
96
  * @handleName getSessionByOrderId
95
97
  * @param {number} id - Order ID. Example: 12345.
96
- * @returns {Promise<IAccountsEntity | IError>} Returns a single payment account object.
98
+ * @returns {Promise<ISessionEntity[] | IError>} Returns the payment sessions of the order — an **array**, `[]` (with `200`) for an order without sessions, an order that does not exist or an order of another user.
97
99
  * @throws {IError} When isShell=false and an error occurs during the fetch
98
- * @description This method gets one payment session object by order identifier. This method requires user authorization.
100
+ * @description This method gets the payment sessions of an order by its identifier. The answer is an array even for one session. This method requires user authorization.
99
101
  * @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}.
100
102
  * @see {@link https://js-sdk.oneentry.cloud/docs/payments/getSessionByOrderId getSessionByOrderId} documentation.
101
103
  */
102
104
  async getSessionByOrderId(id) {
103
- const result = await this._fetchGet(`/sessions/order/${id}`);
105
+ const result = await this._fetchGet(`/sessions/order/${this._pathSegment(String(id))}`);
104
106
  // Validate response if validation is enabled
105
107
  const validated = await this._validateResponse(result, schema('SinglePaymentSessionSchema'));
106
108
  return validated;
@@ -130,32 +132,34 @@ class PaymentsApi extends asyncModules_1.default {
130
132
  /**
131
133
  * Get all payment accounts as an array.
132
134
  * @handleName getAccounts
133
- * @returns {Promise<IAccountsEntity | IError>} Returns all created payment accounts as an array of PaymentAccountEntity objects.
135
+ * @param {string} [langCode] - Language code. Default: the client's language.
136
+ * @returns {Promise<IAccountsEntity[] | IError>} Returns all created payment accounts as an array of PaymentAccountEntity objects.
134
137
  * @throws {IError} When isShell=false and an error occurs during the fetch
135
- * @description This method gets all payment accounts as an array. This method requires user authorization.
136
- * @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}.
138
+ * @description This method gets all payment accounts as an array. It does not require user authorization: a guest gets the accounts too.
137
139
  * @see {@link https://js-sdk.oneentry.cloud/docs/payments/getAccounts getAccounts} documentation.
138
140
  */
139
- async getAccounts() {
140
- const result = await this._fetchGet('/accounts');
141
+ async getAccounts(langCode = this.state.lang) {
142
+ const result = await this._fetchGet('/accounts?' + this._queryParamsToString({ langCode }));
141
143
  // Validate response if validation is enabled
142
144
  const validated = await this._validateResponse(result, schema('PaymentAccountsResponseSchema'));
143
- return this._normalizeData(validated);
145
+ return this._normalizeData(validated, langCode);
144
146
  }
145
147
  /**
146
148
  * Get a single payment account object by its identifier.
147
149
  * @handleName getAccountById
148
150
  * @param {number} id - Payment account ID. Example: 12345.
151
+ * @param {string} [langCode] - Language code. Default: the client's language.
149
152
  * @returns {Promise<IAccountsEntity | IError>} Returns a single payment account object.
150
153
  * @throws {IError} When isShell=false and an error occurs during the fetch
151
- * @description Get a single payment account object by its identifier.
152
- * @description This method requires user authorization.
153
- * @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}.
154
+ * @description Get a single payment account object by its identifier. It does not require user authorization: a guest gets the account too.
154
155
  * @see {@link https://js-sdk.oneentry.cloud/docs/payments/getAccountById getAccountById} documentation.
155
156
  */
156
- async getAccountById(id) {
157
- const result = await this._fetchGet(`/accounts/${id}`);
158
- return this._normalizeData(result);
157
+ async getAccountById(id, langCode = this.state.lang) {
158
+ const result = await this._fetchGet(`/accounts/${this._pathSegment(String(id))}?` +
159
+ this._queryParamsToString({ langCode }));
160
+ // Validate response if validation is enabled
161
+ const validated = await this._validateResponse(result, schema('PaymentAccountSchema'));
162
+ return this._normalizeData(validated, langCode);
159
163
  }
160
164
  /**
161
165
  * Get the payment progress of an order: its stages and whether they are paid.
@@ -170,7 +174,7 @@ class PaymentsApi extends asyncModules_1.default {
170
174
  * @see {@link https://js-sdk.oneentry.cloud/docs/payments/getPaymentStagesByOrderId getPaymentStagesByOrderId} documentation.
171
175
  */
172
176
  async getPaymentStagesByOrderId(id) {
173
- const result = await this._fetchGet(`/stages/order/${id}`);
177
+ const result = await this._fetchGet(`/stages/order/${this._pathSegment(String(id))}`);
174
178
  // Validate response if validation is enabled
175
179
  const validated = await this._validateResponse(result, schema('PaymentProgressSchema'));
176
180
  return this._normalizeData(validated);
@@ -29,12 +29,12 @@ interface IPaymentsApi {
29
29
  * Get one payment session object by order identifier 🔐
30
30
  * @handleName getSessionByOrderId
31
31
  * @param {number} id - Order ID. Example: 12345.
32
- * @returns {ISessionEntity} Returns a single payment session object.
32
+ * @returns {ISessionEntity[]} The payment sessions of the order — an **array**, `[]` (with `200`) for an order without sessions or one that does not exist.
33
33
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
34
- * @description This method gets one payment session object by order identifier. This method requires user authorization.
34
+ * @description This method gets the payment sessions of an order by its identifier. The answer is an array even for one session. This method requires user authorization.
35
35
  * @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}.
36
36
  */
37
- getSessionByOrderId(id: number): Promise<ISessionEntity | ISessionEntity[] | IError>;
37
+ getSessionByOrderId(id: number): Promise<ISessionEntity[] | IError>;
38
38
  /**
39
39
  * Creation of payment session.
40
40
  * @handleName createSession
@@ -50,22 +50,22 @@ interface IPaymentsApi {
50
50
  /**
51
51
  * Get all payment accounts as an array.
52
52
  * @handleName getAccounts
53
- * @returns {IAccountsEntity} Returns all created payment accounts as an array of PaymentAccountEntity objects.
53
+ * @param {string} [langCode] - Language code. Default: the client's language.
54
+ * @returns {IAccountsEntity[]} Returns all created payment accounts as an array of PaymentAccountEntity objects.
54
55
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
55
- * @description This method gets all payment accounts as an array. This method requires user authorization.
56
- * @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}.
56
+ * @description This method gets all payment accounts as an array. It does not require user authorization: a guest gets the accounts too.
57
57
  */
58
- getAccounts(): Promise<IAccountsEntity[] | IError>;
58
+ getAccounts(langCode?: string): Promise<IAccountsEntity[] | IError>;
59
59
  /**
60
60
  * Get a single payment account object by its identifier.
61
61
  * @handleName getAccountById
62
62
  * @param {number} id - Payment account ID. Example: 12345.
63
+ * @param {string} [langCode] - Language code. Default: the client's language.
63
64
  * @returns {IAccountsEntity} Returns a single payment account object.
64
65
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
65
- * @description This method gets a single payment account object by its identifier. This method requires user authorization.
66
- * @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}.
66
+ * @description This method gets a single payment account object by its identifier. It does not require user authorization: a guest gets the account too.
67
67
  */
68
- getAccountById(id: number): Promise<IAccountsEntity | IError>;
68
+ getAccountById(id: number, langCode?: string): Promise<IAccountsEntity | IError>;
69
69
  /**
70
70
  * Get the payment progress of an order: its stages and whether they are paid.
71
71
  * @handleName getPaymentStagesByOrderId
@@ -108,7 +108,7 @@ interface ISessionsEntity {
108
108
  * @property {'session' | 'intent'} type - Session type: "session" or "intent". Example: "session".
109
109
  * @property {string} status - Payment status. Example: "completed".
110
110
  * @property {number} paymentAccountId - ID of the payment account. Example: 1.
111
- * @property {number} orderId - ID of the order. Example: 1.
111
+ * @property {number | null} orderId - ID of the order; `null` for the session of a subscription, which has no order. Example: 1.
112
112
  * @property {string | null} paymentUrl - Payment page URL. Example: " https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M".
113
113
  * @property {number | null} [amount] - Payment session amount. Example: 100.
114
114
  * @property {string} [clientSecret] - Client secret returned by the payment provider (for example, Stripe) when the session is created. Example: "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH".
@@ -121,7 +121,7 @@ interface ISessionEntity {
121
121
  type: 'session' | 'intent';
122
122
  status: string;
123
123
  paymentAccountId: number;
124
- orderId: number;
124
+ orderId: number | null;
125
125
  paymentUrl: string | null;
126
126
  amount?: number | null;
127
127
  clientSecret?: string;
@@ -180,7 +180,6 @@ interface IPaymentAccountSettings {
180
180
  * @property {string} [stripeRedirectUrl] - Stripe onboarding redirect URL.
181
181
  * @property {boolean} [stripeOnboardingComplete] - Whether Stripe onboarding finished. Example: true.
182
182
  * @property {string} [stripePublishableKey] - Stripe publishable key.
183
- * @property {string} [signingSecretKey] - Stripe webhook signing secret. Example: "whsec_...".
184
183
  * @property {boolean} [useWebHookValidation] - Whether incoming webhooks must be signature-validated. Example: true.
185
184
  * @description Test-mode configuration of a payment account; field set depends on the provider (Stripe-specific fields are optional).
186
185
  */
@@ -193,7 +192,6 @@ interface IPaymentAccountTestSettings {
193
192
  stripeRedirectUrl?: string;
194
193
  stripeOnboardingComplete?: boolean;
195
194
  stripePublishableKey?: string;
196
- signingSecretKey?: string;
197
195
  useWebHookValidation?: boolean;
198
196
  }
199
197
  /**
@@ -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>;
@@ -8,7 +8,7 @@ const zod_1 = require("zod");
8
8
  */
9
9
  exports.PaymentSessionSchema = zod_1.z.object({
10
10
  id: zod_1.z.number(),
11
- orderId: zod_1.z.number(),
11
+ orderId: zod_1.z.number().nullable(),
12
12
  amount: zod_1.z.number().nullable().optional(),
13
13
  status: zod_1.z.string(),
14
14
  createdDate: zod_1.z.string(),
@@ -27,13 +27,10 @@ exports.PaymentSessionsResponseSchema = zod_1.z.object({
27
27
  total: zod_1.z.number(),
28
28
  });
29
29
  /**
30
- * Single payment session response schema
31
- * @description Schema for a single payment session or array of sessions by order
30
+ * Sessions of one order
31
+ * @description The answer of `/sessions/order/{id}` is always an array (`[]` when there are none)
32
32
  */
33
- exports.SinglePaymentSessionSchema = zod_1.z.union([
34
- exports.PaymentSessionSchema,
35
- zod_1.z.array(exports.PaymentSessionSchema),
36
- ]);
33
+ exports.SinglePaymentSessionSchema = zod_1.z.array(exports.PaymentSessionSchema);
37
34
  /**
38
35
  * Payment account schema
39
36
  * @description Schema for a payment account
@@ -44,7 +41,7 @@ exports.PaymentAccountSchema = zod_1.z.object({
44
41
  isVisible: zod_1.z.boolean(),
45
42
  isUsed: zod_1.z.boolean(),
46
43
  testMode: zod_1.z.boolean(),
47
- type: zod_1.z.string(),
44
+ type: zod_1.z.enum(['stripe', 'yookassa', 'midtrans', 'xendit', 'custom']),
48
45
  settings: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
49
46
  testSettings: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
50
47
  localizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.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>;
@@ -64,7 +64,7 @@ class ProductStatusesApi extends asyncModules_1.default {
64
64
  * @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductStatuses getProductStatuses} documentation.
65
65
  */
66
66
  async getProductStatuses(langCode = this.state.lang) {
67
- const result = await this._fetchGet('');
67
+ const result = await this._fetchGet(`?langCode=${encodeURIComponent(langCode)}`);
68
68
  // Validate response if validation is enabled
69
69
  const validated = await this._validateResponse(result, schema('ProductStatusesResponseSchema'));
70
70
  return this._normalizeData(validated, langCode);
@@ -76,11 +76,11 @@ class ProductStatusesApi extends asyncModules_1.default {
76
76
  * @param {string} [langCode] - Language code. Default: "en_US".
77
77
  * @returns {Promise<IProductStatusEntity | IError>} Returns a product status object.
78
78
  * @throws {IError} When isShell=false and an error occurs during the fetch
79
- * @description Search for a product status object by its textual identifier (marker).
79
+ * @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`.
80
80
  * @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductsByStatusMarker getProductsByStatusMarker} documentation.
81
81
  */
82
82
  async getProductsByStatusMarker(marker, langCode = this.state.lang) {
83
- const result = await this._fetchGet(`/marker/${this._pathSegment(marker)}`);
83
+ const result = await this._fetchGet(`/marker/${this._pathSegment(marker)}?langCode=${encodeURIComponent(langCode)}`);
84
84
  // Validate response if validation is enabled
85
85
  const validated = await this._validateResponse(result, schema('ProductStatusEntitySchema'));
86
86
  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,104 +246,77 @@ 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
+ * @param {string} [signPrice] - Marker of an orders storage to fix the price for. When set, the product comes with a `signedPrice` holding the price for a limited time; an unknown marker fails the request with `404 Specified orders storage for price signature not found`.
250
251
  * @returns {Promise<IProductsEntity | IError>} ProductEntity object.
251
252
  * @throws {IError} When isShell=false and an error occurs during the fetch
252
- * @description Retrieve one product object.
253
+ * @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
254
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductById getProductById} documentation.
254
255
  */
255
- getProductById(id: number, langCode?: string, isNormalized?: boolean): Promise<IProductsEntity | IError>;
256
+ getProductById(id: number, langCode?: string, isNormalized?: boolean, signPrice?: string): Promise<IProductsEntity | IError>;
256
257
  /**
257
258
  * Getting a product block object by product id.
258
259
  * @handleName getProductBlockById
259
260
  * @param {number} id - Product ID. Example: 12345.
260
- * @returns {Promise<IProductBlock | IError>} - Product block object.
261
+ * @param {string} [langCode] - Language code. Default: the client's language.
262
+ * @returns {Promise<IProductBlock[] | IError>} - Array of the product's block objects.
261
263
  * @throws {IError} When isShell=false and an error occurs during the fetch
262
264
  * @description Getting a product block object by product id.
263
265
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductBlockById getProductBlockById} documentation.
264
266
  */
265
- getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
267
+ getProductBlockById(id: number, langCode?: string): Promise<IProductBlock[] | IError>;
266
268
  /**
267
269
  * Quick search for product page objects with limited output.
268
270
  * @handleName searchProduct
269
271
  * @param {string} name - Text to search for in product titles (`localizeInfos.title`) in the requested language. Example: "laminat".
270
272
  * @param {string} [langCode] - Language code. Default: "en_US".
273
+ * @param {string} [url] - URL of a catalog page to search within that category. Default: the whole catalog.
274
+ * @param {boolean} [correct] - Correct typos by the project's search dictionary first. The API defaults to `true`; pass `false` to search the query as is.
271
275
  * @returns {Promise<IProductsEntity[] | IProductSearchResult[] | IError>} Array with ProductEntity objects, or an array with short ProductSearchResult cards when the traficLimit config option is enabled
272
276
  * @throws {IError} When isShell=false and an error occurs during the fetch
273
277
  * @description Quick search for product page objects with limited output. The quick search endpoint returns short cards ({ id, title, pageId }); with traficLimit enabled they are returned as is, otherwise full product entities are fetched for the found ids.
274
278
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/searchProduct searchProduct} documentation.
275
279
  */
276
- searchProduct(name: string, langCode?: string): Promise<IProductsEntity[] | IProductSearchResult[] | IError>;
280
+ searchProduct(name: string, langCode?: string, url?: string, correct?: boolean): Promise<IProductsEntity[] | IProductSearchResult[] | IError>;
277
281
  /**
278
282
  * Getting the number of products for the entire catalog.
279
283
  * @handleName getProductsCount
280
- * @param {any[]} body - Filter objects with search conditions. Default: `[]`.
284
+ * @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
285
+ * @param {string} [langCode] - Language code. Default: "en_US". Must be one of the project's active languages — an inactive one answers `400 langCode must be one of the active languages`. The count reflects the products visible in that language.
281
286
  * @example
282
287
  [
283
288
  {
284
289
  "attributeMarker": "price",
285
- "conditionMarker": "in",
286
- "statusMarker": "status_1",
287
- "conditionValue": {},
288
- "pageUrls": [
289
- "23-laminat-floorwood-maxima"
290
- ],
291
- "title": "Iphone 17 Pro"
290
+ "conditionMarker": "eq",
291
+ "conditionValue": 51
292
292
  }
293
293
  ]
294
294
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
295
295
  * @throws {IError} When isShell=false and an error occurs during the fetch
296
- * @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters.
296
+ * @description This method calculates and returns the total number of products present across the entire catalog, optionally applying specified filters. The request carries `langCode`; it must be an active language of the project, otherwise the API answers `400`.
297
297
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCount getProductsCount} documentation.
298
298
  */
299
- getProductsCount(body?: any[]): Promise<IProductsCount | IError>;
299
+ getProductsCount(body?: any[], langCode?: string): Promise<IProductsCount | IError>;
300
300
  /**
301
301
  * Getting the number of products on a catalog page by page ID.
302
302
  * @handleName getProductsCountByPageId
303
303
  * @param {number | string} id - Page ID. Example: 12345.
304
304
  * @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
305
+ * @param {string} [langCode] - Language code. Default: "en_US". Must be one of the project's active languages — an inactive one answers `400 langCode must be one of the active languages`. The count reflects the products visible in that language.
305
306
  * @example
306
307
  [
307
308
  {
308
309
  "attributeMarker": "price",
309
- "conditionMarker": "in",
310
- "statusMarker": "status_1",
311
- "conditionValue": {},
312
- "pageUrls": [
313
- "23-laminat-floorwood-maxima"
314
- ],
315
- "title": "Iphone 17 Pro"
310
+ "conditionMarker": "eq",
311
+ "conditionValue": 51
316
312
  }
317
313
  ]
318
314
  * @returns {Promise<IProductsCount | IError>} Object with product items count.
319
315
  * @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.
316
+ * @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 request carries `langCode`; it must be an active language of the project (an inactive one answers `400`), and the count reflects the products visible in that language.
321
317
  * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageId getProductsCountByPageId} documentation.
322
318
  */
323
- 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
- */
319
+ getProductsCountByPageId(id: number | string, body?: any[], langCode?: string): Promise<IProductsCount | IError>;
347
320
  /**
348
321
  * Semantic (vector) search for products.
349
322
  * @handleName getProductsByVectorSearch
@@ -358,10 +331,23 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
358
331
  */
359
332
  getProductsByVectorSearch(body: IVectorSearchProducts, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IProductsResponse> | IError>;
360
333
  /**
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.
334
+ * Getting the number of products for the catalog page by page url.
335
+ * @handleName getProductsCountByPageUrl
336
+ * @param {string} url - Page URL. Example: "catalog".
337
+ * @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
338
+ * @param {string} [langCode] - Language code. Default: "en_US". Must be one of the project's active languages — an inactive one answers `400 langCode must be one of the active languages`. The count reflects the products visible in that language.
339
+ * @example
340
+ [
341
+ {
342
+ "attributeMarker": "price",
343
+ "conditionMarker": "eq",
344
+ "conditionValue": 51
345
+ }
346
+ ]
347
+ * @returns {Promise<IProductsCount | IError>} Object with product items count.
348
+ * @throws {IError} When isShell=false and an error occurs during the fetch
349
+ * @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering. The request carries `langCode`; it must be an active language of the project (an inactive one answers `400`), and the count reflects the products visible in that language.
350
+ * @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
365
351
  */
366
- getProductsCountByPageUrl(url: string, body?: any[]): Promise<IProductsCount | IError>;
352
+ getProductsCountByPageUrl(url: string, body?: any[], langCode?: string): Promise<IProductsCount | IError>;
367
353
  }