oneentry 1.0.146 → 1.0.148

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 (37) hide show
  1. package/dist/admins/adminsApi.d.ts +4 -3
  2. package/dist/admins/adminsApi.js +1 -1
  3. package/dist/admins/adminsInterfaces.d.ts +4 -4
  4. package/dist/admins/adminsSchemas.d.ts +24 -8
  5. package/dist/admins/adminsSchemas.js +11 -5
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +122 -25
  7. package/dist/auth-provider/authProvidersInterfaces.d.ts +34 -25
  8. package/dist/base/utils.d.ts +147 -71
  9. package/dist/blocks/blocksApi.d.ts +3 -3
  10. package/dist/blocks/blocksApi.js +1 -1
  11. package/dist/blocks/blocksInterfaces.d.ts +8 -8
  12. package/dist/blocks/blocksSchemas.d.ts +52 -8
  13. package/dist/discounts/discountsInterfaces.d.ts +53 -19
  14. package/dist/forms/formsInterfaces.d.ts +89 -14
  15. package/dist/forms-data/formsDataInterfaces.d.ts +141 -66
  16. package/dist/general-types/generalTypesSchemas.d.ts +2 -2
  17. package/dist/menus/menusInterfaces.d.ts +1 -1
  18. package/dist/orders/ordersInterfaces.d.ts +81 -19
  19. package/dist/orders/ordersSchemas.d.ts +73 -2
  20. package/dist/orders/ordersSchemas.js +32 -3
  21. package/dist/pages/pagesApi.js +1 -1
  22. package/dist/pages/pagesInterfaces.d.ts +12 -12
  23. package/dist/payments/paymentsInterfaces.d.ts +41 -16
  24. package/dist/products/productsApi.d.ts +26 -19
  25. package/dist/products/productsApi.js +27 -20
  26. package/dist/products/productsInterfaces.d.ts +118 -41
  27. package/dist/products/productsSchemas.d.ts +52 -8
  28. package/dist/products/productsSchemas.js +15 -2
  29. package/dist/sitemap/sitemapApi.d.ts +4 -4
  30. package/dist/sitemap/sitemapApi.js +2 -2
  31. package/dist/sitemap/sitemapInterfaces.d.ts +13 -11
  32. package/dist/templates/templatesApi.d.ts +6 -5
  33. package/dist/templates/templatesApi.js +10 -5
  34. package/dist/templates/templatesInterfaces.d.ts +10 -9
  35. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +25 -11
  36. package/dist/users/usersInterfaces.d.ts +4 -8
  37. package/package.json +2 -2
@@ -90,6 +90,33 @@ export declare const OrdersStorageResponseSchema: z.ZodArray<z.ZodObject<{
90
90
  }, z.core.$strip>>;
91
91
  position: z.ZodNullable<z.ZodNumber>;
92
92
  }, z.core.$strip>>;
93
+ /**
94
+ * Order discount config schema
95
+ * @description Resolved discount configuration returned with an order or order preview.
96
+ */
97
+ export declare const OrderDiscountConfigSchema: z.ZodObject<{
98
+ bonus: z.ZodNullable<z.ZodObject<{
99
+ availableBalance: z.ZodNumber;
100
+ bonusApplied: z.ZodNumber;
101
+ maxBonusDiscount: z.ZodNumber;
102
+ minBonusAmount: z.ZodNullable<z.ZodNumber>;
103
+ minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
104
+ }, z.core.$strip>>;
105
+ coupon: z.ZodNullable<z.ZodUnknown>;
106
+ orderDiscounts: z.ZodArray<z.ZodUnknown>;
107
+ productDiscounts: z.ZodArray<z.ZodUnknown>;
108
+ settings: z.ZodObject<{
109
+ allowGiftStacking: z.ZodBoolean;
110
+ allowStacking: z.ZodBoolean;
111
+ maxDiscountValue: z.ZodNullable<z.ZodNumber>;
112
+ }, z.core.$strip>;
113
+ additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ bonusApplied: z.ZodOptional<z.ZodNumber>;
115
+ excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
+ totalDue: z.ZodOptional<z.ZodNumber>;
117
+ totalRaw: z.ZodOptional<z.ZodNumber>;
118
+ totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
119
+ }, z.core.$strip>;
93
120
  /**
94
121
  * Create order response schema
95
122
  * API returns a simplified order object after creation
@@ -107,7 +134,29 @@ export declare const CreateOrderResponseSchema: z.ZodObject<{
107
134
  statusIdentifier: z.ZodOptional<z.ZodString>;
108
135
  couponCode: z.ZodOptional<z.ZodString>;
109
136
  additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
- discountConfig: z.ZodOptional<z.ZodUnknown>;
137
+ discountConfig: z.ZodOptional<z.ZodObject<{
138
+ bonus: z.ZodNullable<z.ZodObject<{
139
+ availableBalance: z.ZodNumber;
140
+ bonusApplied: z.ZodNumber;
141
+ maxBonusDiscount: z.ZodNumber;
142
+ minBonusAmount: z.ZodNullable<z.ZodNumber>;
143
+ minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
144
+ }, z.core.$strip>>;
145
+ coupon: z.ZodNullable<z.ZodUnknown>;
146
+ orderDiscounts: z.ZodArray<z.ZodUnknown>;
147
+ productDiscounts: z.ZodArray<z.ZodUnknown>;
148
+ settings: z.ZodObject<{
149
+ allowGiftStacking: z.ZodBoolean;
150
+ allowStacking: z.ZodBoolean;
151
+ maxDiscountValue: z.ZodNullable<z.ZodNumber>;
152
+ }, z.core.$strip>;
153
+ additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
+ bonusApplied: z.ZodOptional<z.ZodNumber>;
155
+ excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
156
+ totalDue: z.ZodOptional<z.ZodNumber>;
157
+ totalRaw: z.ZodOptional<z.ZodNumber>;
158
+ totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
159
+ }, z.core.$strip>>;
111
160
  bonusAmount: z.ZodOptional<z.ZodNumber>;
112
161
  bonusApplied: z.ZodOptional<z.ZodNumber>;
113
162
  totalDue: z.ZodOptional<z.ZodNumber>;
@@ -128,7 +177,29 @@ export declare const UpdateOrderResponseSchema: z.ZodObject<{
128
177
  statusIdentifier: z.ZodOptional<z.ZodString>;
129
178
  couponCode: z.ZodOptional<z.ZodString>;
130
179
  additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
131
- discountConfig: z.ZodOptional<z.ZodUnknown>;
180
+ discountConfig: z.ZodOptional<z.ZodObject<{
181
+ bonus: z.ZodNullable<z.ZodObject<{
182
+ availableBalance: z.ZodNumber;
183
+ bonusApplied: z.ZodNumber;
184
+ maxBonusDiscount: z.ZodNumber;
185
+ minBonusAmount: z.ZodNullable<z.ZodNumber>;
186
+ minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
187
+ }, z.core.$strip>>;
188
+ coupon: z.ZodNullable<z.ZodUnknown>;
189
+ orderDiscounts: z.ZodArray<z.ZodUnknown>;
190
+ productDiscounts: z.ZodArray<z.ZodUnknown>;
191
+ settings: z.ZodObject<{
192
+ allowGiftStacking: z.ZodBoolean;
193
+ allowStacking: z.ZodBoolean;
194
+ maxDiscountValue: z.ZodNullable<z.ZodNumber>;
195
+ }, z.core.$strip>;
196
+ additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
197
+ bonusApplied: z.ZodOptional<z.ZodNumber>;
198
+ excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
199
+ totalDue: z.ZodOptional<z.ZodNumber>;
200
+ totalRaw: z.ZodOptional<z.ZodNumber>;
201
+ totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
202
+ }, z.core.$strip>>;
132
203
  bonusAmount: z.ZodOptional<z.ZodNumber>;
133
204
  bonusApplied: z.ZodOptional<z.ZodNumber>;
134
205
  totalDue: z.ZodOptional<z.ZodNumber>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateOrderResponseSchema = exports.CreateOrderResponseSchema = exports.OrdersStorageResponseSchema = exports.OrderStorageSchema = exports.OrdersResponseSchema = exports.OrderEntitySchema = exports.OrderItemSchema = void 0;
3
+ exports.UpdateOrderResponseSchema = exports.CreateOrderResponseSchema = exports.OrderDiscountConfigSchema = exports.OrdersStorageResponseSchema = exports.OrderStorageSchema = exports.OrdersResponseSchema = exports.OrderEntitySchema = exports.OrderItemSchema = void 0;
4
4
  /**
5
5
  * Validation schemas for Orders module
6
6
  * @description Zod schemas for validating orders-related API responses
@@ -65,6 +65,35 @@ exports.OrderStorageSchema = zod_1.z.object({
65
65
  * @returns Orders storage list response schema
66
66
  */
67
67
  exports.OrdersStorageResponseSchema = zod_1.z.array(exports.OrderStorageSchema);
68
+ /**
69
+ * Order discount config schema
70
+ * @description Resolved discount configuration returned with an order or order preview.
71
+ */
72
+ exports.OrderDiscountConfigSchema = zod_1.z.object({
73
+ bonus: zod_1.z
74
+ .object({
75
+ availableBalance: zod_1.z.number(),
76
+ bonusApplied: zod_1.z.number(),
77
+ maxBonusDiscount: zod_1.z.number(),
78
+ minBonusAmount: zod_1.z.number().nullable(),
79
+ minOrderAmountForBonus: zod_1.z.number().nullable(),
80
+ })
81
+ .nullable(),
82
+ coupon: zod_1.z.unknown().nullable(),
83
+ orderDiscounts: zod_1.z.array(zod_1.z.unknown()),
84
+ productDiscounts: zod_1.z.array(zod_1.z.unknown()),
85
+ settings: zod_1.z.object({
86
+ allowGiftStacking: zod_1.z.boolean(),
87
+ allowStacking: zod_1.z.boolean(),
88
+ maxDiscountValue: zod_1.z.number().nullable(),
89
+ }),
90
+ additionalDiscountsMarkers: zod_1.z.array(zod_1.z.string()).optional(),
91
+ bonusApplied: zod_1.z.number().optional(),
92
+ excludedGiftProductIds: zod_1.z.array(zod_1.z.string()).optional(),
93
+ totalDue: zod_1.z.number().optional(),
94
+ totalRaw: zod_1.z.number().optional(),
95
+ totalSumWithDiscount: zod_1.z.number().optional(),
96
+ });
68
97
  /**
69
98
  * Create order response schema
70
99
  * API returns a simplified order object after creation
@@ -82,7 +111,7 @@ exports.CreateOrderResponseSchema = zod_1.z.object({
82
111
  statusIdentifier: zod_1.z.string().optional(),
83
112
  couponCode: zod_1.z.string().optional(),
84
113
  additionalDiscountsMarkers: zod_1.z.array(zod_1.z.string()).optional(),
85
- discountConfig: zod_1.z.unknown().optional(),
114
+ discountConfig: exports.OrderDiscountConfigSchema.optional(),
86
115
  bonusAmount: zod_1.z.number().optional(),
87
116
  bonusApplied: zod_1.z.number().optional(),
88
117
  totalDue: zod_1.z.number().optional(),
@@ -103,7 +132,7 @@ exports.UpdateOrderResponseSchema = zod_1.z.object({
103
132
  statusIdentifier: zod_1.z.string().optional(),
104
133
  couponCode: zod_1.z.string().optional(),
105
134
  additionalDiscountsMarkers: zod_1.z.array(zod_1.z.string()).optional(),
106
- discountConfig: zod_1.z.unknown().optional(),
135
+ discountConfig: exports.OrderDiscountConfigSchema.optional(),
107
136
  bonusAmount: zod_1.z.number().optional(),
108
137
  bonusApplied: zod_1.z.number().optional(),
109
138
  totalDue: zod_1.z.number().optional(),
@@ -216,7 +216,7 @@ class PagesApi extends asyncModules_1.default {
216
216
  const data = await this._fetchGet(`/quick/search?${url && 'url=' + url}&lang=${langCode}&name=${name}`);
217
217
  // /quick/search?url=catalog&langCode=en_US&name=cat
218
218
  // Check if there is no traffic limit set in the state
219
- if (!this.state.traficLimit) {
219
+ if (!this.state.traficLimit && Array.isArray(data)) {
220
220
  // Initialize an empty array to store detailed page information
221
221
  const pageList = [];
222
222
  // Use Promise.all to fetch detailed information for each page concurrently
@@ -1,5 +1,5 @@
1
- import type { AttributeType, IAttributes, IError, ILocalizeInfo, LangType, Types } from '../base/utils';
2
- import type { IBlockEntity } from '../blocks/blocksInterfaces';
1
+ import type { IAttributes, IAttributeValues, IError, ILocalizeInfo, IRating, LangType } from '../base/utils';
2
+ import type { BlockType, IBlockEntity } from '../blocks/blocksInterfaces';
3
3
  import type { IFormConfig } from '../forms/formsInterfaces';
4
4
  import type { ITemplateEntity } from '../templates/templatesInterfaces';
5
5
  /**
@@ -169,11 +169,11 @@ interface IPositionForm {
169
169
  * @property {number} version - The version number of the object. Example: 0.
170
170
  * @property {number} position - The position of the object. Example: 1.
171
171
  * @property {string} identifier - The textual identifier for the record field. Example: "product_block".
172
- * @property {Types} type - Page type. Example: "product".
172
+ * @property {BlockType} type - Page type. Example: "product".
173
173
  * @property {string | null} templateIdentifier - User id of the linked template. Example: null.
174
174
  * @property {boolean} isVisible - A sign of page visibility. Example: true.
175
175
  * @property {boolean} isSync - Indication of page indexing. Example: false.
176
- * @property {AttributeType} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
176
+ * @property {IAttributeValues} attributeValues - Map of attribute values keyed by marker; empty object when none.
177
177
  * @example
178
178
  {
179
179
  "block-text": {
@@ -194,11 +194,11 @@ interface IPositionBlock {
194
194
  version: number;
195
195
  position: number;
196
196
  identifier: string;
197
- type: string;
197
+ type: BlockType;
198
198
  templateIdentifier: string | null;
199
199
  isVisible: boolean;
200
200
  isSync: boolean;
201
- attributeValues: AttributeType;
201
+ attributeValues: IAttributeValues;
202
202
  countElementsPerRow?: number;
203
203
  quantity?: number;
204
204
  }
@@ -217,10 +217,10 @@ interface IPositionBlock {
217
217
  "plainContent": ""
218
218
  }
219
219
  * @property {boolean} isVisible - A sign of page visibility. Example: true.
220
- * @property {Types} type - Page type. Example: "common_page".
220
+ * @property {BlockType} type - Page type. Example: "common_page".
221
221
  * @property {string | null} templateIdentifier - User id of the linked template. Example: "template".
222
222
  * @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "page".
223
- * @property {AttributeType} attributeValues - Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
223
+ * @property {IAttributeValues} attributeValues - Map of attribute values keyed by marker; empty object when none.
224
224
  * @example
225
225
  {
226
226
  "text": {
@@ -255,7 +255,7 @@ interface IPositionBlock {
255
255
  "position": 1
256
256
  }
257
257
  * @property {Array<IFormConfig>} [moduleFormConfigs] - Module form configurations linked to the page.
258
- * @property {Record<string, unknown>} [rating] - Rating data.
258
+ * @property {IRating} [rating] - Rating data.
259
259
  * @property {string} [total] - Total number of products linked to the page. Example: "10".
260
260
  * @property {string} [categoryPath] - Category path string. Example: "catalog".
261
261
  * @description This interface defines the structure of a page entity, including its identifiers, attributes, and hierarchical relationships.
@@ -267,12 +267,12 @@ interface IPagesEntity {
267
267
  depth: number;
268
268
  localizeInfos: ILocalizeInfo;
269
269
  isVisible: boolean;
270
- type: Types;
270
+ type: BlockType;
271
271
  templateIdentifier: string | null;
272
272
  attributeSetIdentifier: string | null;
273
- attributeValues: AttributeType;
273
+ attributeValues: IAttributeValues;
274
274
  moduleFormConfigs?: IFormConfig[];
275
- rating?: Record<string, unknown>;
275
+ rating?: IRating;
276
276
  isSync: boolean;
277
277
  template?: ITemplateEntity;
278
278
  blocks?: IBlockEntity[] | string[];
@@ -95,7 +95,7 @@ interface ISessionsEntity {
95
95
  * @property {number} id - Object identifier. Example: 1764.
96
96
  * @property {string} createdDate - Object creation date. Example: "2025-02-26T10:13:16.839Z".
97
97
  * @property {string} updatedDate - Object modification date. Example: "2025-02-26T10:13:16.839Z".
98
- * @property {string} type - Type may be 'session' or 'intent'. Example: "session".
98
+ * @property {'session' | 'intent'} type - Type may be 'session' or 'intent'. Example: "session".
99
99
  * @property {string} status - Payment status. Example: "completed".
100
100
  * @property {number} paymentAccountId - Payment account identifier. Example: 1.
101
101
  * @property {number} orderId - Order identifier. Example: 1.
@@ -108,7 +108,7 @@ interface ISessionEntity {
108
108
  id: number;
109
109
  createdDate: string;
110
110
  updatedDate: string;
111
- type: string;
111
+ type: 'session' | 'intent';
112
112
  status: string;
113
113
  paymentAccountId: number;
114
114
  orderId: number;
@@ -135,8 +135,8 @@ interface IIntent {
135
135
  * @property {boolean} isVisible - Visibility indicator of the payment account. Example: true.
136
136
  * @property {boolean} isUsed - Usage indicator of the payment account. Example: false.
137
137
  * @property {boolean} testMode - Indicates whether the payment account is in test mode. Example: true.
138
- * @property {object} settings - Payment account settings. Example: {}.
139
- * @property {object} [testSettings] - Test mode settings for the payment account. Example: {}.
138
+ * @property {IPaymentAccountSettings} settings - Payment account settings. Example: `{ "status": "connected" }`.
139
+ * @property {object} [testSettings] - Test mode settings for the payment account.
140
140
  * @property {string} updatedDate - Object modification date. Example: "2025-02-26T10:13:16.839Z".
141
141
  * @description This interface defines the structure of a payment account entity, including its identifiers, localization information, type, visibility, and usage status.
142
142
  */
@@ -148,17 +148,42 @@ interface IAccountsEntity {
148
148
  isVisible: boolean;
149
149
  isUsed: boolean;
150
150
  testMode: boolean;
151
- settings: object;
152
- testSettings?: {
153
- cancelUrl?: string;
154
- successUrl?: string;
155
- sessionTimeout?: number;
156
- stripeAccountId?: string;
157
- stripeRedirectUrl?: string;
158
- stripeOnboardingComplete?: boolean;
159
- stripePublishableKey?: string;
160
- status: string;
161
- };
151
+ settings: IPaymentAccountSettings;
152
+ testSettings?: IPaymentAccountTestSettings;
162
153
  updatedDate: string;
163
154
  }
164
- export type { IAccountsEntity, IIntent, IPaymentsApi, ISessionEntity, ISessionsEntity, };
155
+ /**
156
+ * @interface IPaymentAccountSettings
157
+ * @property {string} status - Connection status of the live (non-test) payment account. Example: "connected".
158
+ * @description Live-mode configuration of a payment account; identical shape to test settings minus secrets.
159
+ */
160
+ interface IPaymentAccountSettings {
161
+ status: string;
162
+ }
163
+ /**
164
+ * @interface IPaymentAccountTestSettings
165
+ * @property {string} status - Connection status of the test account. Example: "connected".
166
+ * @property {string} [cancelUrl] - URL the user is redirected to on payment cancellation.
167
+ * @property {string} [successUrl] - URL the user is redirected to on successful payment.
168
+ * @property {number} [sessionTimeout] - Stripe checkout session timeout in minutes. Example: 15.
169
+ * @property {string} [stripeAccountId] - Stripe-issued account identifier. Example: "acct_1QwkKrAcSoNc7iev".
170
+ * @property {string} [stripeRedirectUrl] - Stripe onboarding redirect URL.
171
+ * @property {boolean} [stripeOnboardingComplete] - Whether Stripe onboarding finished. Example: true.
172
+ * @property {string} [stripePublishableKey] - Stripe publishable key.
173
+ * @property {string} [signingSecretKey] - Stripe webhook signing secret. Example: "whsec_...".
174
+ * @property {boolean} [useWebHookValidation] - Whether incoming webhooks must be signature-validated. Example: true.
175
+ * @description Test-mode configuration of a payment account; field set depends on the provider (Stripe-specific fields are optional).
176
+ */
177
+ interface IPaymentAccountTestSettings {
178
+ status: string;
179
+ cancelUrl?: string;
180
+ successUrl?: string;
181
+ sessionTimeout?: number;
182
+ stripeAccountId?: string;
183
+ stripeRedirectUrl?: string;
184
+ stripeOnboardingComplete?: boolean;
185
+ stripePublishableKey?: string;
186
+ signingSecretKey?: string;
187
+ useWebHookValidation?: boolean;
188
+ }
189
+ export type { IAccountsEntity, IIntent, IPaymentAccountSettings, IPaymentAccountTestSettings, IPaymentsApi, ISessionEntity, ISessionsEntity, };
@@ -48,17 +48,19 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
48
48
  * @param {IProductsQuery} [userQuery] - Optional set query parameters.
49
49
  * @example
50
50
  {
51
- "signPrice": "orders",
52
- "sortOrder": "DESC",
53
- "sortKey": "id",
54
51
  "limit": 30,
55
52
  "offset": 0,
56
- "statusId": 123,
53
+ "sortOrder": "DESC",
54
+ "sortKey": "id",
55
+ "signPrice": "orders",
56
+ "templateMarker": "template_12345",
57
57
  "statusMarker": "in_stock",
58
58
  "conditionValue": "new",
59
- "conditionMarker": "equals",
59
+ "conditionMarker": "eq",
60
60
  "attributeMarker": "color"
61
61
  }
62
+ * @param {string} [userQuery.signPrice] - Order storage marker for price fixing.
63
+ * @param {string} [userQuery.sortOrder] - Sorting order parameter.
62
64
  * @returns {Promise<IProductsResponse | IError>} Products response, or IError when isShell=true
63
65
  * @throws {IError} When isShell=false and an error occurs during the fetch
64
66
  * @description Fetch products with optional filters and pagination.
@@ -76,10 +78,11 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
76
78
  "offset": 0,
77
79
  "sortOrder": "DESC",
78
80
  "sortKey": "id",
79
- "statusId": 123,
81
+ "signPrice": "orders",
82
+ "templateMarker": "template_12345",
80
83
  "statusMarker": "in_stock",
81
84
  "conditionValue": "new",
82
- "conditionMarker": "equals",
85
+ "conditionMarker": "eq",
83
86
  "attributeMarker": "color"
84
87
  }
85
88
  * @returns {Promise<IAggregatedProductGroup[] | IError>} Array with AggregatedProductGroup objects.
@@ -124,10 +127,11 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
124
127
  "offset": 0,
125
128
  "sortOrder": "DESC",
126
129
  "sortKey": "id",
127
- "statusId": 123,
130
+ "signPrice": "orders",
131
+ "templateMarker": "template_12345",
128
132
  "statusMarker": "in_stock",
129
133
  "conditionValue": "new",
130
- "conditionMarker": "equals",
134
+ "conditionMarker": "eq",
131
135
  "attributeMarker": "color"
132
136
  }
133
137
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
@@ -147,10 +151,11 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
147
151
  "offset": 0,
148
152
  "sortOrder": "DESC",
149
153
  "sortKey": "id",
150
- "statusId": 123,
154
+ "signPrice": "orders",
155
+ "templateMarker": "template_12345",
151
156
  "statusMarker": "in_stock",
152
157
  "conditionValue": "new",
153
- "conditionMarker": "equals",
158
+ "conditionMarker": "eq",
154
159
  "attributeMarker": "color"
155
160
  }
156
161
  * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
@@ -195,10 +200,11 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
195
200
  "offset": 0,
196
201
  "sortOrder": "DESC",
197
202
  "sortKey": "id",
198
- "statusId": 123,
203
+ "signPrice": "orders",
204
+ "templateMarker": "template_12345",
199
205
  "statusMarker": "in_stock",
200
206
  "conditionValue": "new",
201
- "conditionMarker": "equals",
207
+ "conditionMarker": "eq",
202
208
  "attributeMarker": "color"
203
209
  }
204
210
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
@@ -218,10 +224,11 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
218
224
  "offset": 0,
219
225
  "sortOrder": "DESC",
220
226
  "sortKey": "id",
221
- "statusId": 123,
227
+ "signPrice": "orders",
228
+ "templateMarker": "template_12345",
222
229
  "statusMarker": "in_stock",
223
230
  "conditionValue": "new",
224
- "conditionMarker": "equals",
231
+ "conditionMarker": "eq",
225
232
  "attributeMarker": "color"
226
233
  }
227
234
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
@@ -245,20 +252,20 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
245
252
  "offset": 0,
246
253
  "sortOrder": "DESC",
247
254
  "sortKey": "id",
248
- "statusId": 123,
255
+ "signPrice": "orders",
256
+ "templateMarker": "template_12345",
249
257
  "statusMarker": "in_stock",
250
258
  "conditionValue": "new",
251
- "conditionMarker": "equals",
259
+ "conditionMarker": "eq",
252
260
  "attributeMarker": "color"
253
261
  }
254
262
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
255
263
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
256
264
  * @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
257
265
  * @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
258
- * @param {number} [userQuery.statusId] - Optional parameter - search by status id. Example: 123.
259
266
  * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
260
267
  * @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
261
- * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "equals".
268
+ * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "eq".
262
269
  * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: "color".
263
270
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
264
271
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -53,17 +53,19 @@ class ProductsApi extends asyncModules_1.default {
53
53
  * @param {IProductsQuery} [userQuery] - Optional set query parameters.
54
54
  * @example
55
55
  {
56
- "signPrice": "orders",
57
- "sortOrder": "DESC",
58
- "sortKey": "id",
59
56
  "limit": 30,
60
57
  "offset": 0,
61
- "statusId": 123,
58
+ "sortOrder": "DESC",
59
+ "sortKey": "id",
60
+ "signPrice": "orders",
61
+ "templateMarker": "template_12345",
62
62
  "statusMarker": "in_stock",
63
63
  "conditionValue": "new",
64
- "conditionMarker": "equals",
64
+ "conditionMarker": "eq",
65
65
  "attributeMarker": "color"
66
66
  }
67
+ * @param {string} [userQuery.signPrice] - Order storage marker for price fixing.
68
+ * @param {string} [userQuery.sortOrder] - Sorting order parameter.
67
69
  * @returns {Promise<IProductsResponse | IError>} Products response, or IError when isShell=true
68
70
  * @throws {IError} When isShell=false and an error occurs during the fetch
69
71
  * @description Fetch products with optional filters and pagination.
@@ -90,10 +92,11 @@ class ProductsApi extends asyncModules_1.default {
90
92
  "offset": 0,
91
93
  "sortOrder": "DESC",
92
94
  "sortKey": "id",
93
- "statusId": 123,
95
+ "signPrice": "orders",
96
+ "templateMarker": "template_12345",
94
97
  "statusMarker": "in_stock",
95
98
  "conditionValue": "new",
96
- "conditionMarker": "equals",
99
+ "conditionMarker": "eq",
97
100
  "attributeMarker": "color"
98
101
  }
99
102
  * @returns {Promise<IAggregatedProductGroup[] | IError>} Array with AggregatedProductGroup objects.
@@ -142,10 +145,11 @@ class ProductsApi extends asyncModules_1.default {
142
145
  "offset": 0,
143
146
  "sortOrder": "DESC",
144
147
  "sortKey": "id",
145
- "statusId": 123,
148
+ "signPrice": "orders",
149
+ "templateMarker": "template_12345",
146
150
  "statusMarker": "in_stock",
147
151
  "conditionValue": "new",
148
- "conditionMarker": "equals",
152
+ "conditionMarker": "eq",
149
153
  "attributeMarker": "color"
150
154
  }
151
155
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects
@@ -171,10 +175,11 @@ class ProductsApi extends asyncModules_1.default {
171
175
  "offset": 0,
172
176
  "sortOrder": "DESC",
173
177
  "sortKey": "id",
174
- "statusId": 123,
178
+ "signPrice": "orders",
179
+ "templateMarker": "template_12345",
175
180
  "statusMarker": "in_stock",
176
181
  "conditionValue": "new",
177
- "conditionMarker": "equals",
182
+ "conditionMarker": "eq",
178
183
  "attributeMarker": "color"
179
184
  }
180
185
  * @returns {Promise<IProductsInfo | IError>} Array with ProductInformation objects.
@@ -226,10 +231,11 @@ class ProductsApi extends asyncModules_1.default {
226
231
  "offset": 0,
227
232
  "sortOrder": "DESC",
228
233
  "sortKey": "id",
229
- "statusId": 123,
234
+ "signPrice": "orders",
235
+ "templateMarker": "template_12345",
230
236
  "statusMarker": "in_stock",
231
237
  "conditionValue": "new",
232
- "conditionMarker": "equals",
238
+ "conditionMarker": "eq",
233
239
  "attributeMarker": "color"
234
240
  }
235
241
  * @returns {Promise<IProductsResponse | IError>} Array with ProductEntity objects.
@@ -256,10 +262,11 @@ class ProductsApi extends asyncModules_1.default {
256
262
  "offset": 0,
257
263
  "sortOrder": "DESC",
258
264
  "sortKey": "id",
259
- "statusId": 123,
265
+ "signPrice": "orders",
266
+ "templateMarker": "template_12345",
260
267
  "statusMarker": "in_stock",
261
268
  "conditionValue": "new",
262
- "conditionMarker": "equals",
269
+ "conditionMarker": "eq",
263
270
  "attributeMarker": "color"
264
271
  }
265
272
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
@@ -289,20 +296,20 @@ class ProductsApi extends asyncModules_1.default {
289
296
  "offset": 0,
290
297
  "sortOrder": "DESC",
291
298
  "sortKey": "id",
292
- "statusId": 123,
299
+ "signPrice": "orders",
300
+ "templateMarker": "template_12345",
293
301
  "statusMarker": "in_stock",
294
302
  "conditionValue": "new",
295
- "conditionMarker": "equals",
303
+ "conditionMarker": "eq",
296
304
  "attributeMarker": "color"
297
305
  }
298
306
  * @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
299
307
  * @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
300
308
  * @param {string} [userQuery.sortOrder] - Optional sorting order "DESC" | "ASC". Example: "DESC".
301
309
  * @param {string} [userQuery.sortKey] - Optional field to sort by ("id", "title", "date", "price", "position", "status"). Example: "id".
302
- * @param {number} [userQuery.statusId] - Optional parameter - search by status id. Example: 123.
303
310
  * @param {string} [userQuery.statusMarker] - Optional identifier of the product page status. Example: "in_stock".
304
311
  * @param {string} [userQuery.conditionValue] - Optional value that is being searched. Example: "new".
305
- * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "equals".
312
+ * @param {string} [userQuery.conditionMarker] - Optional identifier of the filter condition by which values are filtered. Example: "eq".
306
313
  * @param {string} [userQuery.attributeMarker] - Optional text identifier of the indexed attribute by which values are filtered. Example: "color".
307
314
  * @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
308
315
  * @throws {IError} When isShell=false and an error occurs during the fetch
@@ -359,7 +366,7 @@ class ProductsApi extends asyncModules_1.default {
359
366
  */
360
367
  async searchProduct(name, langCode = this.state.lang) {
361
368
  const searchProducts = await this._fetchGet(`/quick/search?langCode=${langCode}&name=${name}`);
362
- if (!this.state.traficLimit) {
369
+ if (!this.state.traficLimit && Array.isArray(searchProducts)) {
363
370
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
364
371
  const productsList = [];
365
372
  await Promise.all(searchProducts.map(async (product) => {