oneentry 1.0.145 → 1.0.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admins/adminsApi.d.ts +4 -3
- package/dist/admins/adminsApi.js +1 -1
- package/dist/admins/adminsInterfaces.d.ts +4 -4
- package/dist/admins/adminsSchemas.d.ts +24 -8
- package/dist/admins/adminsSchemas.js +11 -5
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +121 -24
- package/dist/auth-provider/authProvidersInterfaces.d.ts +43 -36
- package/dist/base/utils.d.ts +159 -53
- package/dist/blocks/blocksApi.d.ts +3 -3
- package/dist/blocks/blocksApi.js +1 -1
- package/dist/blocks/blocksInterfaces.d.ts +7 -7
- package/dist/blocks/blocksSchemas.d.ts +52 -8
- package/dist/discounts/discountsApi.d.ts +7 -7
- package/dist/discounts/discountsApi.js +3 -3
- package/dist/discounts/discountsInterfaces.d.ts +79 -33
- package/dist/forms/formsInterfaces.d.ts +85 -15
- package/dist/forms-data/formsDataInterfaces.d.ts +142 -67
- package/dist/menus/menusInterfaces.d.ts +1 -1
- package/dist/orders/ordersApi.d.ts +4 -4
- package/dist/orders/ordersApi.js +2 -2
- package/dist/orders/ordersInterfaces.d.ts +97 -24
- package/dist/orders/ordersSchemas.d.ts +73 -2
- package/dist/orders/ordersSchemas.js +32 -3
- package/dist/pages/pagesApi.js +1 -1
- package/dist/pages/pagesInterfaces.d.ts +8 -8
- package/dist/payments/paymentsApi.d.ts +3 -3
- package/dist/payments/paymentsApi.js +2 -2
- package/dist/payments/paymentsInterfaces.d.ts +45 -56
- package/dist/payments/paymentsSchemas.d.ts +4 -10
- package/dist/payments/paymentsSchemas.js +2 -11
- package/dist/products/productsApi.d.ts +26 -19
- package/dist/products/productsApi.js +27 -20
- package/dist/products/productsInterfaces.d.ts +109 -33
- package/dist/products/productsSchemas.d.ts +52 -8
- package/dist/products/productsSchemas.js +15 -2
- package/dist/sitemap/sitemapApi.d.ts +5 -5
- package/dist/sitemap/sitemapApi.js +2 -2
- package/dist/sitemap/sitemapInterfaces.d.ts +32 -21
- package/dist/templates/templatesApi.js +8 -3
- package/dist/templates/templatesInterfaces.d.ts +3 -3
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +22 -8
- package/dist/users/usersInterfaces.d.ts +7 -11
- package/package.json +1 -1
|
@@ -41,12 +41,12 @@ interface IPaymentsApi {
|
|
|
41
41
|
* @param {number} orderId - Order identifier. Example: 12345.
|
|
42
42
|
* @param {'session' | 'intent'} type - Session type. Possible values: "session" or "intent". Example: "session".
|
|
43
43
|
* @param {boolean} [automaticTaxEnabled] - Automatic calculation of the tax rate. Default: false.
|
|
44
|
-
* @returns {
|
|
44
|
+
* @returns {ISessionEntity} Returns a single payment session object.
|
|
45
45
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
46
46
|
* @description This method creates a payment session. This method requires user authorization.
|
|
47
47
|
* @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}.
|
|
48
48
|
*/
|
|
49
|
-
createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<
|
|
49
|
+
createSession(orderId: number, type: 'session' | 'intent', automaticTaxEnabled?: boolean): Promise<ISessionEntity | IError>;
|
|
50
50
|
/**
|
|
51
51
|
* Get all payment accounts as an array.
|
|
52
52
|
* @handleName getAccounts
|
|
@@ -95,24 +95,26 @@ 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 {
|
|
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.
|
|
102
102
|
* @property {string | null} paymentUrl - payment link. Example: " https://www.sandbox.paypal.com/checkoutnow?token=9BE88048TU058770M".
|
|
103
103
|
* @property {number | null} [amount] - Amount of the payment session. Example: 100.
|
|
104
|
+
* @property {string} [clientSecret] - Client secret key returned by payment provider (e.g. Stripe) when creating a session. Example: "pi_3MtwBwLkdIwHu7ix28a3tqPa_secret_YrKJUKribcBjcG8HVhfZluoGH".
|
|
104
105
|
* @description This interface defines the structure of a session entity, including its quantity, amount, currency, name, and description.
|
|
105
106
|
*/
|
|
106
107
|
interface ISessionEntity {
|
|
107
108
|
id: number;
|
|
108
109
|
createdDate: string;
|
|
109
110
|
updatedDate: string;
|
|
110
|
-
type:
|
|
111
|
+
type: 'session' | 'intent';
|
|
111
112
|
status: string;
|
|
112
113
|
paymentAccountId: number;
|
|
113
114
|
orderId: number;
|
|
114
115
|
paymentUrl: string | null;
|
|
115
116
|
amount?: number | null;
|
|
117
|
+
clientSecret?: string;
|
|
116
118
|
}
|
|
117
119
|
/**
|
|
118
120
|
* @interface IIntent
|
|
@@ -124,44 +126,6 @@ interface IIntent {
|
|
|
124
126
|
amount: number;
|
|
125
127
|
currency: string;
|
|
126
128
|
}
|
|
127
|
-
/**
|
|
128
|
-
* @interface ISessionItem
|
|
129
|
-
* @property {number} id - Object identifier. Example: 12345.
|
|
130
|
-
* @property {string} updatedDate - Object modification date. Example: "2023-10-01T12:00:00Z".
|
|
131
|
-
* @property {string} type - Type may be 'session' or 'intent'. Example: 'session'.
|
|
132
|
-
* @property {number} orderId - Order identifier. Example: 12345.
|
|
133
|
-
* @property {number} paymentAccountId - Payment account object identifier. Example: 12345.
|
|
134
|
-
* @property {string} paymentUrl - Payment link. Example: "https://example.com/payment/12345".
|
|
135
|
-
* @property {string} clientSecret - Client secret key. Example: "sk_test_4eC39HqLyjWDarjtT1zdp7dc".
|
|
136
|
-
* @property {string} status - payment status. Example: "pending".
|
|
137
|
-
* @description This interface defines the structure of a session item, which includes identifiers, payment details, and status information.
|
|
138
|
-
*/
|
|
139
|
-
interface ISessionItem {
|
|
140
|
-
id: number;
|
|
141
|
-
updatedDate: string;
|
|
142
|
-
type: 'session' | 'intent';
|
|
143
|
-
orderId: number;
|
|
144
|
-
paymentAccountId: number;
|
|
145
|
-
paymentUrl: string;
|
|
146
|
-
clientSecret: string;
|
|
147
|
-
status: string;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* @interface ICreateSessionEntity
|
|
151
|
-
* @property {number} id - Object identifier. Example: 12345.
|
|
152
|
-
* @property {string} updatedDate - Object modification date. Example: "2023-10-01T12:00:00Z".
|
|
153
|
-
* @property {number} version - Version of the object. Example: 1.
|
|
154
|
-
* @property {string} identifier - Text identifier for the recording field. Example: "payment_12345".
|
|
155
|
-
* @property {string} paymentUrl - Payment link. Example: "https://example.com/payment/12345".
|
|
156
|
-
* @description This interface defines the structure of a session entity created during the payment process, including its identifiers, version, and payment URL.
|
|
157
|
-
*/
|
|
158
|
-
interface ICreateSessionEntity {
|
|
159
|
-
id: number;
|
|
160
|
-
updatedDate: string;
|
|
161
|
-
version: number;
|
|
162
|
-
identifier: string;
|
|
163
|
-
paymentUrl: string;
|
|
164
|
-
}
|
|
165
129
|
/**
|
|
166
130
|
* @interface IAccountsEntity
|
|
167
131
|
* @property {number} id - Object identifier. Example: 12345.
|
|
@@ -171,8 +135,8 @@ interface ICreateSessionEntity {
|
|
|
171
135
|
* @property {boolean} isVisible - Visibility indicator of the payment account. Example: true.
|
|
172
136
|
* @property {boolean} isUsed - Usage indicator of the payment account. Example: false.
|
|
173
137
|
* @property {boolean} testMode - Indicates whether the payment account is in test mode. Example: true.
|
|
174
|
-
* @property {
|
|
175
|
-
* @property {object} [testSettings] - Test mode settings for the payment account.
|
|
138
|
+
* @property {IPaymentAccountSettings} settings - Payment account settings. Example: { "status": "connected" }.
|
|
139
|
+
* @property {object} [testSettings] - Test mode settings for the payment account.
|
|
176
140
|
* @property {string} updatedDate - Object modification date. Example: "2025-02-26T10:13:16.839Z".
|
|
177
141
|
* @description This interface defines the structure of a payment account entity, including its identifiers, localization information, type, visibility, and usage status.
|
|
178
142
|
*/
|
|
@@ -184,17 +148,42 @@ interface IAccountsEntity {
|
|
|
184
148
|
isVisible: boolean;
|
|
185
149
|
isUsed: boolean;
|
|
186
150
|
testMode: boolean;
|
|
187
|
-
settings:
|
|
188
|
-
testSettings?:
|
|
189
|
-
cancelUrl?: string;
|
|
190
|
-
successUrl?: string;
|
|
191
|
-
sessionTimeout?: number;
|
|
192
|
-
stripeAccountId?: string;
|
|
193
|
-
stripeRedirectUrl?: string;
|
|
194
|
-
stripeOnboardingComplete?: boolean;
|
|
195
|
-
stripePublishableKey?: string;
|
|
196
|
-
status: string;
|
|
197
|
-
};
|
|
151
|
+
settings: IPaymentAccountSettings;
|
|
152
|
+
testSettings?: IPaymentAccountTestSettings;
|
|
198
153
|
updatedDate: string;
|
|
199
154
|
}
|
|
200
|
-
|
|
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, };
|
|
@@ -13,6 +13,7 @@ export declare const PaymentSessionSchema: z.ZodObject<{
|
|
|
13
13
|
type: z.ZodString;
|
|
14
14
|
paymentAccountId: z.ZodNumber;
|
|
15
15
|
paymentUrl: z.ZodNullable<z.ZodString>;
|
|
16
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
16
17
|
}, z.core.$strip>;
|
|
17
18
|
/**
|
|
18
19
|
* Payment sessions response schema
|
|
@@ -29,6 +30,7 @@ export declare const PaymentSessionsResponseSchema: z.ZodObject<{
|
|
|
29
30
|
type: z.ZodString;
|
|
30
31
|
paymentAccountId: z.ZodNumber;
|
|
31
32
|
paymentUrl: z.ZodNullable<z.ZodString>;
|
|
33
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
32
34
|
}, z.core.$strip>>;
|
|
33
35
|
total: z.ZodNumber;
|
|
34
36
|
}, z.core.$strip>;
|
|
@@ -46,6 +48,7 @@ export declare const SinglePaymentSessionSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
46
48
|
type: z.ZodString;
|
|
47
49
|
paymentAccountId: z.ZodNumber;
|
|
48
50
|
paymentUrl: z.ZodNullable<z.ZodString>;
|
|
51
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
49
52
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
50
53
|
id: z.ZodNumber;
|
|
51
54
|
orderId: z.ZodNumber;
|
|
@@ -56,6 +59,7 @@ export declare const SinglePaymentSessionSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
56
59
|
type: z.ZodString;
|
|
57
60
|
paymentAccountId: z.ZodNumber;
|
|
58
61
|
paymentUrl: z.ZodNullable<z.ZodString>;
|
|
62
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
59
63
|
}, z.core.$strip>>]>;
|
|
60
64
|
/**
|
|
61
65
|
* Payment account schema
|
|
@@ -88,13 +92,3 @@ export declare const PaymentAccountsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
88
92
|
localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
89
93
|
updatedDate: z.ZodString;
|
|
90
94
|
}, z.core.$strip>>;
|
|
91
|
-
/**
|
|
92
|
-
* Create session response schema
|
|
93
|
-
*/
|
|
94
|
-
export declare const CreateSessionResponseSchema: z.ZodObject<{
|
|
95
|
-
id: z.ZodNumber;
|
|
96
|
-
updatedDate: z.ZodString;
|
|
97
|
-
version: z.ZodNumber;
|
|
98
|
-
identifier: z.ZodString;
|
|
99
|
-
paymentUrl: z.ZodString;
|
|
100
|
-
}, z.core.$strip>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PaymentAccountsResponseSchema = exports.PaymentAccountSchema = exports.SinglePaymentSessionSchema = exports.PaymentSessionsResponseSchema = exports.PaymentSessionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
6
|
* Payment session schema
|
|
@@ -16,6 +16,7 @@ exports.PaymentSessionSchema = zod_1.z.object({
|
|
|
16
16
|
type: zod_1.z.string(),
|
|
17
17
|
paymentAccountId: zod_1.z.number(),
|
|
18
18
|
paymentUrl: zod_1.z.string().nullable(),
|
|
19
|
+
clientSecret: zod_1.z.string().optional(),
|
|
19
20
|
});
|
|
20
21
|
/**
|
|
21
22
|
* Payment sessions response schema
|
|
@@ -53,13 +54,3 @@ exports.PaymentAccountSchema = zod_1.z.object({
|
|
|
53
54
|
* Payment accounts response schema
|
|
54
55
|
*/
|
|
55
56
|
exports.PaymentAccountsResponseSchema = zod_1.z.array(exports.PaymentAccountSchema);
|
|
56
|
-
/**
|
|
57
|
-
* Create session response schema
|
|
58
|
-
*/
|
|
59
|
-
exports.CreateSessionResponseSchema = zod_1.z.object({
|
|
60
|
-
id: zod_1.z.number(),
|
|
61
|
-
updatedDate: zod_1.z.string(),
|
|
62
|
-
version: zod_1.z.number(),
|
|
63
|
-
identifier: zod_1.z.string(),
|
|
64
|
-
paymentUrl: zod_1.z.string(),
|
|
65
|
-
});
|
|
@@ -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
|
-
"
|
|
53
|
+
"sortOrder": "DESC",
|
|
54
|
+
"sortKey": "id",
|
|
55
|
+
"signPrice": "orders",
|
|
56
|
+
"templateMarker": "template_12345",
|
|
57
57
|
"statusMarker": "in_stock",
|
|
58
58
|
"conditionValue": "new",
|
|
59
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
81
|
+
"signPrice": "orders",
|
|
82
|
+
"templateMarker": "template_12345",
|
|
80
83
|
"statusMarker": "in_stock",
|
|
81
84
|
"conditionValue": "new",
|
|
82
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
130
|
+
"signPrice": "orders",
|
|
131
|
+
"templateMarker": "template_12345",
|
|
128
132
|
"statusMarker": "in_stock",
|
|
129
133
|
"conditionValue": "new",
|
|
130
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
154
|
+
"signPrice": "orders",
|
|
155
|
+
"templateMarker": "template_12345",
|
|
151
156
|
"statusMarker": "in_stock",
|
|
152
157
|
"conditionValue": "new",
|
|
153
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
203
|
+
"signPrice": "orders",
|
|
204
|
+
"templateMarker": "template_12345",
|
|
199
205
|
"statusMarker": "in_stock",
|
|
200
206
|
"conditionValue": "new",
|
|
201
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
227
|
+
"signPrice": "orders",
|
|
228
|
+
"templateMarker": "template_12345",
|
|
222
229
|
"statusMarker": "in_stock",
|
|
223
230
|
"conditionValue": "new",
|
|
224
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
255
|
+
"signPrice": "orders",
|
|
256
|
+
"templateMarker": "template_12345",
|
|
249
257
|
"statusMarker": "in_stock",
|
|
250
258
|
"conditionValue": "new",
|
|
251
|
-
"conditionMarker": "
|
|
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: "
|
|
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
|
-
"
|
|
58
|
+
"sortOrder": "DESC",
|
|
59
|
+
"sortKey": "id",
|
|
60
|
+
"signPrice": "orders",
|
|
61
|
+
"templateMarker": "template_12345",
|
|
62
62
|
"statusMarker": "in_stock",
|
|
63
63
|
"conditionValue": "new",
|
|
64
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
95
|
+
"signPrice": "orders",
|
|
96
|
+
"templateMarker": "template_12345",
|
|
94
97
|
"statusMarker": "in_stock",
|
|
95
98
|
"conditionValue": "new",
|
|
96
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
148
|
+
"signPrice": "orders",
|
|
149
|
+
"templateMarker": "template_12345",
|
|
146
150
|
"statusMarker": "in_stock",
|
|
147
151
|
"conditionValue": "new",
|
|
148
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
178
|
+
"signPrice": "orders",
|
|
179
|
+
"templateMarker": "template_12345",
|
|
175
180
|
"statusMarker": "in_stock",
|
|
176
181
|
"conditionValue": "new",
|
|
177
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
234
|
+
"signPrice": "orders",
|
|
235
|
+
"templateMarker": "template_12345",
|
|
230
236
|
"statusMarker": "in_stock",
|
|
231
237
|
"conditionValue": "new",
|
|
232
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
265
|
+
"signPrice": "orders",
|
|
266
|
+
"templateMarker": "template_12345",
|
|
260
267
|
"statusMarker": "in_stock",
|
|
261
268
|
"conditionValue": "new",
|
|
262
|
-
"conditionMarker": "
|
|
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
|
-
"
|
|
299
|
+
"signPrice": "orders",
|
|
300
|
+
"templateMarker": "template_12345",
|
|
293
301
|
"statusMarker": "in_stock",
|
|
294
302
|
"conditionValue": "new",
|
|
295
|
-
"conditionMarker": "
|
|
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: "
|
|
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) => {
|