oneentry 1.0.175 → 1.0.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/changelog.md +140 -0
- package/dist/admins/adminsApi.js +2 -9
- package/dist/admins/adminsInterfaces.d.ts +5 -5
- package/dist/admins/adminsSchemas.d.ts +4 -4
- package/dist/admins/adminsSchemas.js +2 -2
- package/dist/attribute-sets/attributeSetsApi.d.ts +1 -1
- package/dist/attribute-sets/attributeSetsApi.js +4 -4
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
- package/dist/attribute-sets/attributeSetsSchemas.d.ts +8 -6
- package/dist/attribute-sets/attributeSetsSchemas.js +6 -9
- package/dist/auth-provider/authProviderApi.d.ts +4 -4
- package/dist/auth-provider/authProviderApi.js +96 -29
- package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
- package/dist/auth-provider/authProviderSchemas.js +1 -0
- package/dist/auth-provider/authProvidersInterfaces.d.ts +8 -6
- package/dist/base/asyncModules.d.ts +73 -1
- package/dist/base/asyncModules.js +233 -37
- package/dist/base/stateModule.d.ts +2 -0
- package/dist/base/stateModule.js +22 -12
- package/dist/base/syncModules.d.ts +18 -10
- package/dist/base/syncModules.js +100 -29
- package/dist/base/utils.d.ts +26 -21
- package/dist/base/validation.d.ts +3 -3
- package/dist/base/validation.js +6 -7
- package/dist/blocks/blocksApi.d.ts +20 -17
- package/dist/blocks/blocksApi.js +101 -74
- package/dist/blocks/blocksInterfaces.d.ts +8 -8
- package/dist/discounts/discountsApi.d.ts +9 -7
- package/dist/discounts/discountsApi.js +18 -14
- package/dist/discounts/discountsInterfaces.d.ts +14 -10
- package/dist/events/eventsApi.d.ts +3 -3
- package/dist/events/eventsApi.js +7 -7
- package/dist/events/eventsInterfaces.d.ts +10 -14
- package/dist/file-uploading/fileUploadingApi.d.ts +4 -4
- package/dist/file-uploading/fileUploadingApi.js +13 -5
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +5 -6
- package/dist/filters/filtersApi.js +2 -2
- package/dist/forms/formsApi.js +2 -2
- package/dist/forms/formsInterfaces.d.ts +1 -3
- package/dist/forms/formsSchemas.d.ts +3 -6
- package/dist/forms/formsSchemas.js +2 -4
- package/dist/forms-data/formsDataApi.d.ts +26 -8
- package/dist/forms-data/formsDataApi.js +45 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +91 -66
- package/dist/general-types/generalTypesInterfaces.d.ts +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +50 -7
- package/dist/integration-collections/integrationCollectionsApi.d.ts +15 -4
- package/dist/integration-collections/integrationCollectionsApi.js +42 -14
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
- package/dist/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
- package/dist/integration-collections/integrationCollectionsSchemas.js +0 -1
- package/dist/menus/menusApi.js +1 -1
- package/dist/orders/ordersApi.d.ts +1 -13
- package/dist/orders/ordersApi.js +24 -44
- package/dist/orders/ordersInterfaces.d.ts +21 -14
- package/dist/pages/pagesApi.d.ts +6 -5
- package/dist/pages/pagesApi.js +44 -31
- package/dist/pages/pagesInterfaces.d.ts +18 -15
- package/dist/pages/pagesSchemas.d.ts +0 -3
- package/dist/pages/pagesSchemas.js +0 -1
- package/dist/payments/paymentsApi.d.ts +10 -11
- package/dist/payments/paymentsApi.js +22 -18
- package/dist/payments/paymentsInterfaces.d.ts +12 -14
- package/dist/payments/paymentsSchemas.d.ts +21 -20
- package/dist/payments/paymentsSchemas.js +5 -8
- package/dist/product-statuses/productStatusesApi.d.ts +1 -1
- package/dist/product-statuses/productStatusesApi.js +4 -4
- package/dist/product-statuses/productStatusesInterfaces.d.ts +1 -4
- package/dist/products/productsApi.d.ts +38 -58
- package/dist/products/productsApi.js +59 -72
- package/dist/products/productsInterfaces.d.ts +48 -85
- package/dist/search/searchApi.d.ts +1 -1
- package/dist/search/searchApi.js +4 -3
- package/dist/sitemap/sitemapInterfaces.d.ts +10 -6
- package/dist/subscriptions/subscriptionsApi.d.ts +1 -1
- package/dist/subscriptions/subscriptionsApi.js +1 -1
- package/dist/subscriptions/subscriptionsInterfaces.d.ts +1 -1
- package/dist/system/systemApi.d.ts +2 -0
- package/dist/system/systemApi.js +2 -0
- package/dist/system/systemInterfaces.d.ts +2 -0
- package/dist/templates/templatesApi.d.ts +2 -2
- package/dist/templates/templatesApi.js +12 -11
- package/dist/templates/templatesInterfaces.d.ts +2 -2
- package/dist/templates-preview/templatesPreviewApi.js +2 -2
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +7 -0
- package/dist/templates-preview/templatesPreviewSchemas.js +2 -0
- package/dist/user-groups/userGroupsApi.js +5 -5
- package/dist/user-groups/userGroupsSchemas.d.ts +4 -4
- package/dist/users/usersApi.d.ts +1 -1
- package/dist/users/usersApi.js +28 -15
- package/dist/users/usersInterfaces.d.ts +2 -9
- package/dist/web-socket/lazySocket.d.ts +6 -5
- package/dist/web-socket/lazySocket.js +212 -15
- package/dist/web-socket/wsApi.d.ts +7 -4
- package/dist/web-socket/wsApi.js +49 -12
- package/dist/web-socket/wsInterfaces.d.ts +41 -4
- package/esm/admins/adminsApi.js +2 -9
- package/esm/admins/adminsInterfaces.d.ts +5 -5
- package/esm/admins/adminsSchemas.d.ts +4 -4
- package/esm/admins/adminsSchemas.js +2 -2
- package/esm/attribute-sets/attributeSetsApi.d.ts +1 -1
- package/esm/attribute-sets/attributeSetsApi.js +4 -4
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
- package/esm/attribute-sets/attributeSetsSchemas.d.ts +8 -6
- package/esm/attribute-sets/attributeSetsSchemas.js +6 -9
- package/esm/auth-provider/authProviderApi.d.ts +4 -4
- package/esm/auth-provider/authProviderApi.js +96 -29
- package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
- package/esm/auth-provider/authProviderSchemas.js +1 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +8 -6
- package/esm/base/asyncModules.d.ts +73 -1
- package/esm/base/asyncModules.js +233 -37
- package/esm/base/stateModule.d.ts +2 -0
- package/esm/base/stateModule.js +22 -12
- package/esm/base/syncModules.d.ts +18 -10
- package/esm/base/syncModules.js +99 -29
- package/esm/base/utils.d.ts +26 -21
- package/esm/base/validation.d.ts +3 -3
- package/esm/base/validation.js +6 -7
- package/esm/blocks/blocksApi.d.ts +20 -17
- package/esm/blocks/blocksApi.js +101 -74
- package/esm/blocks/blocksInterfaces.d.ts +8 -8
- package/esm/discounts/discountsApi.d.ts +9 -7
- package/esm/discounts/discountsApi.js +18 -14
- package/esm/discounts/discountsInterfaces.d.ts +14 -10
- package/esm/events/eventsApi.d.ts +3 -3
- package/esm/events/eventsApi.js +7 -7
- package/esm/events/eventsInterfaces.d.ts +10 -14
- package/esm/file-uploading/fileUploadingApi.d.ts +4 -4
- package/esm/file-uploading/fileUploadingApi.js +13 -5
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +5 -6
- package/esm/filters/filtersApi.js +2 -2
- package/esm/forms/formsApi.js +2 -2
- package/esm/forms/formsInterfaces.d.ts +1 -3
- package/esm/forms/formsSchemas.d.ts +3 -6
- package/esm/forms/formsSchemas.js +2 -4
- package/esm/forms-data/formsDataApi.d.ts +26 -8
- package/esm/forms-data/formsDataApi.js +45 -14
- package/esm/forms-data/formsDataInterfaces.d.ts +91 -66
- package/esm/general-types/generalTypesInterfaces.d.ts +1 -1
- package/esm/index.d.ts +7 -6
- package/esm/index.js +50 -7
- package/esm/integration-collections/integrationCollectionsApi.d.ts +15 -4
- package/esm/integration-collections/integrationCollectionsApi.js +42 -14
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
- package/esm/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
- package/esm/integration-collections/integrationCollectionsSchemas.js +0 -1
- package/esm/menus/menusApi.js +1 -1
- package/esm/orders/ordersApi.d.ts +1 -13
- package/esm/orders/ordersApi.js +24 -44
- package/esm/orders/ordersInterfaces.d.ts +21 -14
- package/esm/pages/pagesApi.d.ts +6 -5
- package/esm/pages/pagesApi.js +44 -31
- package/esm/pages/pagesInterfaces.d.ts +18 -15
- package/esm/pages/pagesSchemas.d.ts +0 -3
- package/esm/pages/pagesSchemas.js +0 -1
- package/esm/payments/paymentsApi.d.ts +10 -11
- package/esm/payments/paymentsApi.js +22 -18
- package/esm/payments/paymentsInterfaces.d.ts +12 -14
- package/esm/payments/paymentsSchemas.d.ts +21 -20
- package/esm/payments/paymentsSchemas.js +5 -8
- package/esm/product-statuses/productStatusesApi.d.ts +1 -1
- package/esm/product-statuses/productStatusesApi.js +4 -4
- package/esm/product-statuses/productStatusesInterfaces.d.ts +1 -4
- package/esm/products/productsApi.d.ts +38 -58
- package/esm/products/productsApi.js +59 -72
- package/esm/products/productsInterfaces.d.ts +48 -85
- package/esm/search/searchApi.d.ts +1 -1
- package/esm/search/searchApi.js +4 -3
- package/esm/sitemap/sitemapInterfaces.d.ts +10 -6
- package/esm/subscriptions/subscriptionsApi.d.ts +1 -1
- package/esm/subscriptions/subscriptionsApi.js +1 -1
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +1 -1
- package/esm/system/systemApi.d.ts +2 -0
- package/esm/system/systemApi.js +2 -0
- package/esm/system/systemInterfaces.d.ts +2 -0
- package/esm/templates/templatesApi.d.ts +2 -2
- package/esm/templates/templatesApi.js +11 -10
- package/esm/templates/templatesInterfaces.d.ts +2 -2
- package/esm/templates-preview/templatesPreviewApi.js +2 -2
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
- package/esm/templates-preview/templatesPreviewSchemas.d.ts +7 -0
- package/esm/templates-preview/templatesPreviewSchemas.js +2 -0
- package/esm/user-groups/userGroupsApi.js +5 -5
- package/esm/user-groups/userGroupsSchemas.d.ts +4 -4
- package/esm/users/usersApi.d.ts +1 -1
- package/esm/users/usersApi.js +28 -15
- package/esm/users/usersInterfaces.d.ts +2 -9
- package/esm/web-socket/lazySocket.d.ts +6 -5
- package/esm/web-socket/lazySocket.js +212 -15
- package/esm/web-socket/wsApi.d.ts +7 -4
- package/esm/web-socket/wsApi.js +49 -12
- package/esm/web-socket/wsInterfaces.d.ts +41 -4
- package/package.json +2 -2
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const PaymentSessionSchema: z.ZodObject<{
|
|
7
7
|
id: z.ZodNumber;
|
|
8
|
-
orderId: z.ZodNumber
|
|
8
|
+
orderId: z.ZodNullable<z.ZodNumber>;
|
|
9
9
|
amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
10
|
status: z.ZodString;
|
|
11
11
|
createdDate: z.ZodString;
|
|
@@ -22,7 +22,7 @@ export declare const PaymentSessionSchema: z.ZodObject<{
|
|
|
22
22
|
export declare const PaymentSessionsResponseSchema: z.ZodObject<{
|
|
23
23
|
items: z.ZodArray<z.ZodObject<{
|
|
24
24
|
id: z.ZodNumber;
|
|
25
|
-
orderId: z.ZodNumber
|
|
25
|
+
orderId: z.ZodNullable<z.ZodNumber>;
|
|
26
26
|
amount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
27
27
|
status: z.ZodString;
|
|
28
28
|
createdDate: z.ZodString;
|
|
@@ -35,12 +35,12 @@ export declare const PaymentSessionsResponseSchema: z.ZodObject<{
|
|
|
35
35
|
total: z.ZodNumber;
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @description
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
84
|
+
type: z.ZodEnum<{
|
|
85
|
+
custom: "custom";
|
|
86
|
+
stripe: "stripe";
|
|
87
|
+
yookassa: "yookassa";
|
|
88
|
+
midtrans: "midtrans";
|
|
89
|
+
xendit: "xendit";
|
|
90
|
+
}>;
|
|
90
91
|
settings: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
91
92
|
testSettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
92
93
|
localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
*/
|
|
6
6
|
export const PaymentSessionSchema = z.object({
|
|
7
7
|
id: z.number(),
|
|
8
|
-
orderId: z.number(),
|
|
8
|
+
orderId: z.number().nullable(),
|
|
9
9
|
amount: z.number().nullable().optional(),
|
|
10
10
|
status: z.string(),
|
|
11
11
|
createdDate: z.string(),
|
|
@@ -24,13 +24,10 @@ export const PaymentSessionsResponseSchema = z.object({
|
|
|
24
24
|
total: z.number(),
|
|
25
25
|
});
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @description
|
|
27
|
+
* Sessions of one order
|
|
28
|
+
* @description The answer of `/sessions/order/{id}` is always an array (`[]` when there are none)
|
|
29
29
|
*/
|
|
30
|
-
export const SinglePaymentSessionSchema = z.
|
|
31
|
-
PaymentSessionSchema,
|
|
32
|
-
z.array(PaymentSessionSchema),
|
|
33
|
-
]);
|
|
30
|
+
export const SinglePaymentSessionSchema = z.array(PaymentSessionSchema);
|
|
34
31
|
/**
|
|
35
32
|
* Payment account schema
|
|
36
33
|
* @description Schema for a payment account
|
|
@@ -41,7 +38,7 @@ export const PaymentAccountSchema = z.object({
|
|
|
41
38
|
isVisible: z.boolean(),
|
|
42
39
|
isUsed: z.boolean(),
|
|
43
40
|
testMode: z.boolean(),
|
|
44
|
-
type: z.
|
|
41
|
+
type: z.enum(['stripe', 'yookassa', 'midtrans', 'xendit', 'custom']),
|
|
45
42
|
settings: z.record(z.string(), z.any()),
|
|
46
43
|
testSettings: z.record(z.string(), z.any()).optional(),
|
|
47
44
|
localizeInfos: z.record(z.string(), z.any()),
|
|
@@ -33,7 +33,7 @@ export default class ProductStatusesApi extends AsyncModules implements IProduct
|
|
|
33
33
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
34
34
|
* @returns {Promise<IProductStatusEntity | IError>} Returns a product status object.
|
|
35
35
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
36
|
-
* @description Search for a product status object by its textual identifier (marker).
|
|
36
|
+
* @description Search for a product status object by its textual identifier (marker). Despite the name it returns the status itself, not products — to list products with a status, filter `Products.getProducts` by `statusMarker`.
|
|
37
37
|
* @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductsByStatusMarker getProductsByStatusMarker} documentation.
|
|
38
38
|
*/
|
|
39
39
|
getProductsByStatusMarker(marker: string, langCode?: string): Promise<IProductStatusEntity | IError>;
|
|
@@ -26,7 +26,7 @@ export default class ProductStatusesApi extends AsyncModules {
|
|
|
26
26
|
* @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductStatuses getProductStatuses} documentation.
|
|
27
27
|
*/
|
|
28
28
|
async getProductStatuses(langCode = this.state.lang) {
|
|
29
|
-
const result = await this._fetchGet(
|
|
29
|
+
const result = await this._fetchGet(`?langCode=${encodeURIComponent(langCode)}`);
|
|
30
30
|
// Validate response if validation is enabled
|
|
31
31
|
const validated = await this._validateResponse(result, schema('ProductStatusesResponseSchema'));
|
|
32
32
|
return this._normalizeData(validated, langCode);
|
|
@@ -38,11 +38,11 @@ export default class ProductStatusesApi extends AsyncModules {
|
|
|
38
38
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
39
39
|
* @returns {Promise<IProductStatusEntity | IError>} Returns a product status object.
|
|
40
40
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
41
|
-
* @description Search for a product status object by its textual identifier (marker).
|
|
41
|
+
* @description Search for a product status object by its textual identifier (marker). Despite the name it returns the status itself, not products — to list products with a status, filter `Products.getProducts` by `statusMarker`.
|
|
42
42
|
* @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/getProductsByStatusMarker getProductsByStatusMarker} documentation.
|
|
43
43
|
*/
|
|
44
44
|
async getProductsByStatusMarker(marker, langCode = this.state.lang) {
|
|
45
|
-
const result = await this._fetchGet(`/marker/${marker}`);
|
|
45
|
+
const result = await this._fetchGet(`/marker/${this._pathSegment(marker)}?langCode=${encodeURIComponent(langCode)}`);
|
|
46
46
|
// Validate response if validation is enabled
|
|
47
47
|
const validated = await this._validateResponse(result, schema('ProductStatusEntitySchema'));
|
|
48
48
|
return this._normalizeData(validated, langCode);
|
|
@@ -57,7 +57,7 @@ export default class ProductStatusesApi extends AsyncModules {
|
|
|
57
57
|
* @see {@link https://js-sdk.oneentry.cloud/docs/product-statuses/validateMarker validateMarker} documentation.
|
|
58
58
|
*/
|
|
59
59
|
async validateMarker(marker) {
|
|
60
|
-
const result = await this._fetchGet(`/marker-validation/${marker}`);
|
|
60
|
+
const result = await this._fetchGet(`/marker-validation/${this._pathSegment(marker)}`);
|
|
61
61
|
// Validate response if validation is enabled
|
|
62
62
|
const validated = await this._validateResponse(result, schema('ValidateMarkerResponseSchema'));
|
|
63
63
|
// Extract the 'valid' boolean value from the response object
|
|
@@ -41,10 +41,7 @@ interface IProductStatusesApi {
|
|
|
41
41
|
* @property {ILocalizeInfo} localizeInfos - Localized name of the product status.
|
|
42
42
|
* @example
|
|
43
43
|
{
|
|
44
|
-
"title": "
|
|
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": "
|
|
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.
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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": "
|
|
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
|
|
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": "
|
|
233
|
+
"signPrice": "my_order"
|
|
234
234
|
}
|
|
235
235
|
* @param {number} [userQuery.limit] - Maximum number of records to return. Default: 30.
|
|
236
236
|
* @param {number} [userQuery.offset] - Number of records to skip. Default: 0.
|
|
237
|
-
* @param {string} [userQuery.signPrice] - Marker of the order storage to fix prices for. When set, each product comes with a `signedPrice` that holds the price for a limited time.
|
|
237
|
+
* @param {string} [userQuery.signPrice] - Marker of the order storage to fix prices for. When set, each product comes with a `signedPrice` that holds the price for a limited time. Must be an existing orders storage marker of the project, e.g. "my_order"; a marker with no such storage fails the whole request with `404 Specified orders storage for price signature not found`.
|
|
238
238
|
* @returns {Promise<IProductsEntity[] | IError>} Array with ProductEntity objects
|
|
239
239
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
240
240
|
* @description Find products by its ids.
|
|
@@ -246,10 +246,10 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
|
|
|
246
246
|
* @handleName getProductById
|
|
247
247
|
* @param {number} id - Product ID. Example: 12345.
|
|
248
248
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
249
|
-
* @param {boolean} [isNormalized] -
|
|
249
|
+
* @param {boolean} [isNormalized] - Deprecated: the API no longer reads it, the answer is the same with `true`, `false` or without it. Kept for compatibility.
|
|
250
250
|
* @returns {Promise<IProductsEntity | IError>} ProductEntity object.
|
|
251
251
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
252
|
-
* @description Retrieve one product object.
|
|
252
|
+
* @description Retrieve one product object. A product with no translation in `langCode` answers `404 Product not found` — there is no fallback to another language.
|
|
253
253
|
* @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductById getProductById} documentation.
|
|
254
254
|
*/
|
|
255
255
|
getProductById(id: number, langCode?: string, isNormalized?: boolean): Promise<IProductsEntity | IError>;
|
|
@@ -257,12 +257,13 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
|
|
|
257
257
|
* Getting a product block object by product id.
|
|
258
258
|
* @handleName getProductBlockById
|
|
259
259
|
* @param {number} id - Product ID. Example: 12345.
|
|
260
|
-
* @
|
|
260
|
+
* @param {string} [langCode] - Language code. Default: the client's language.
|
|
261
|
+
* @returns {Promise<IProductBlock[] | IError>} - Array of the product's block objects.
|
|
261
262
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
262
263
|
* @description Getting a product block object by product id.
|
|
263
264
|
* @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductBlockById getProductBlockById} documentation.
|
|
264
265
|
*/
|
|
265
|
-
getProductBlockById(id: number): Promise<IProductBlock[] | IError>;
|
|
266
|
+
getProductBlockById(id: number, langCode?: string): Promise<IProductBlock[] | IError>;
|
|
266
267
|
/**
|
|
267
268
|
* Quick search for product page objects with limited output.
|
|
268
269
|
* @handleName searchProduct
|
|
@@ -277,18 +278,13 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
|
|
|
277
278
|
/**
|
|
278
279
|
* Getting the number of products for the entire catalog.
|
|
279
280
|
* @handleName getProductsCount
|
|
280
|
-
* @param {any[]} body - Filter objects with search conditions. Default: `[]`.
|
|
281
|
+
* @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
|
|
281
282
|
* @example
|
|
282
283
|
[
|
|
283
284
|
{
|
|
284
285
|
"attributeMarker": "price",
|
|
285
|
-
"conditionMarker": "
|
|
286
|
-
"
|
|
287
|
-
"conditionValue": {},
|
|
288
|
-
"pageUrls": [
|
|
289
|
-
"23-laminat-floorwood-maxima"
|
|
290
|
-
],
|
|
291
|
-
"title": "Iphone 17 Pro"
|
|
286
|
+
"conditionMarker": "eq",
|
|
287
|
+
"conditionValue": 51
|
|
292
288
|
}
|
|
293
289
|
]
|
|
294
290
|
* @returns {Promise<IProductsCount | IError>} Object with product items count.
|
|
@@ -306,44 +302,16 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
|
|
|
306
302
|
[
|
|
307
303
|
{
|
|
308
304
|
"attributeMarker": "price",
|
|
309
|
-
"conditionMarker": "
|
|
310
|
-
"
|
|
311
|
-
"conditionValue": {},
|
|
312
|
-
"pageUrls": [
|
|
313
|
-
"23-laminat-floorwood-maxima"
|
|
314
|
-
],
|
|
315
|
-
"title": "Iphone 17 Pro"
|
|
305
|
+
"conditionMarker": "eq",
|
|
306
|
+
"conditionValue": 51
|
|
316
307
|
}
|
|
317
308
|
]
|
|
318
309
|
* @returns {Promise<IProductsCount | IError>} Object with product items count.
|
|
319
310
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
320
|
-
* @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering.
|
|
311
|
+
* @description This method calculates and returns the number of products available on a given catalog page, identified by its page ID, with optional filtering. The counts do not depend on the language: on a language where the catalog is empty they still count every product (CMS-1201).
|
|
321
312
|
* @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageId getProductsCountByPageId} documentation.
|
|
322
313
|
*/
|
|
323
314
|
getProductsCountByPageId(id: number | string, body?: any[]): Promise<IProductsCount | IError>;
|
|
324
|
-
/**
|
|
325
|
-
* Getting the number of products for the catalog page by page url.
|
|
326
|
-
* @handleName getProductsCountByPageUrl
|
|
327
|
-
* @param {string} url - Page URL.
|
|
328
|
-
* @param {any[]} body - Filter objects with search conditions. Default: `[]`.
|
|
329
|
-
* @example
|
|
330
|
-
[
|
|
331
|
-
{
|
|
332
|
-
"attributeMarker": "price",
|
|
333
|
-
"conditionMarker": "in",
|
|
334
|
-
"statusMarker": "status_1",
|
|
335
|
-
"conditionValue": {},
|
|
336
|
-
"pageUrls": [
|
|
337
|
-
"23-laminat-floorwood-maxima"
|
|
338
|
-
],
|
|
339
|
-
"title": "Iphone 17 Pro"
|
|
340
|
-
}
|
|
341
|
-
]
|
|
342
|
-
* @returns {Promise<IProductsCount | IError>} Object with product items count.
|
|
343
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
344
|
-
* @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering.
|
|
345
|
-
* @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
|
|
346
|
-
*/
|
|
347
315
|
/**
|
|
348
316
|
* Semantic (vector) search for products.
|
|
349
317
|
* @handleName getProductsByVectorSearch
|
|
@@ -358,10 +326,22 @@ export default class ProductsApi extends AsyncModules implements IProductsApi {
|
|
|
358
326
|
*/
|
|
359
327
|
getProductsByVectorSearch(body: IVectorSearchProducts, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IProductsResponse> | IError>;
|
|
360
328
|
/**
|
|
361
|
-
*
|
|
362
|
-
* @
|
|
363
|
-
* @param {
|
|
364
|
-
* @
|
|
329
|
+
* Getting the number of products for the catalog page by page url.
|
|
330
|
+
* @handleName getProductsCountByPageUrl
|
|
331
|
+
* @param {string} url - Page URL. Example: "catalog".
|
|
332
|
+
* @param {any[]} [body] - Filter objects with search conditions. Default: `[]`.
|
|
333
|
+
* @example
|
|
334
|
+
[
|
|
335
|
+
{
|
|
336
|
+
"attributeMarker": "price",
|
|
337
|
+
"conditionMarker": "eq",
|
|
338
|
+
"conditionValue": 51
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
* @returns {Promise<IProductsCount | IError>} Object with product items count.
|
|
342
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
343
|
+
* @description This method calculates and returns the number of products available on a given catalog page, identified by its URL, with optional filtering. The counts do not depend on the language: on a language where the catalog is empty they still count every product (CMS-1201).
|
|
344
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/products/getProductsCountByPageUrl getProductsCountByPageUrl} documentation.
|
|
365
345
|
*/
|
|
366
346
|
getProductsCountByPageUrl(url: string, body?: any[]): Promise<IProductsCount | IError>;
|
|
367
347
|
}
|