oneentry 1.0.139 → 1.0.141
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 +16 -1
- package/configure.js +40 -21
- package/dist/auth-provider/authProviderSchemas.d.ts +24 -30
- package/dist/auth-provider/authProviderSchemas.js +12 -15
- package/dist/auth-provider/authProvidersInterfaces.d.ts +10 -2
- package/dist/base/syncModules.js +1 -1
- package/dist/blocks/blocksApi.d.ts +2 -0
- package/dist/blocks/blocksApi.js +6 -2
- package/dist/discounts/discountsApi.d.ts +56 -0
- package/dist/discounts/discountsApi.js +82 -0
- package/dist/discounts/discountsInterfaces.d.ts +145 -0
- package/dist/discounts/discountsInterfaces.js +2 -0
- package/dist/forms/formsSchemas.d.ts +18 -33
- package/dist/forms/formsSchemas.js +6 -11
- package/dist/index.d.ts +11 -5
- package/dist/index.js +6 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +2 -2
- package/dist/integration-collections/integrationCollectionsSchemas.d.ts +2 -6
- package/dist/integration-collections/integrationCollectionsSchemas.js +1 -3
- package/dist/orders/ordersApi.d.ts +26 -3
- package/dist/orders/ordersApi.js +36 -2
- package/dist/orders/ordersInterfaces.d.ts +104 -4
- package/dist/orders/ordersSchemas.d.ts +34 -72
- package/dist/orders/ordersSchemas.js +16 -35
- package/dist/pages/pagesApi.d.ts +2 -2
- package/dist/pages/pagesApi.js +3 -3
- package/dist/pages/pagesInterfaces.d.ts +3 -3
- package/dist/payments/paymentsInterfaces.d.ts +1 -1
- package/dist/payments/paymentsSchemas.d.ts +53 -90
- package/dist/payments/paymentsSchemas.js +21 -34
- package/dist/product-statuses/productStatusesApi.d.ts +2 -2
- package/dist/product-statuses/productStatusesInterfaces.d.ts +2 -2
- package/dist/products/productsApi.d.ts +5 -4
- package/dist/products/productsApi.js +9 -5
- package/dist/products/productsInterfaces.d.ts +11 -8
- package/dist/products/productsSchemas.d.ts +14 -34
- package/dist/products/productsSchemas.js +14 -3
- package/dist/sitemap/sitemapApi.d.ts +35 -0
- package/dist/sitemap/sitemapApi.js +45 -0
- package/dist/sitemap/sitemapInterfaces.d.ts +40 -0
- package/dist/sitemap/sitemapInterfaces.js +2 -0
- package/dist/system/systemApi.d.ts +3 -25
- package/dist/system/systemApi.js +0 -24
- package/dist/system/systemInterfaces.d.ts +13 -5
- package/dist/system/systemInterfaces.js +3 -0
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -2
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +3 -3
- package/dist/users/usersApi.d.ts +2 -2
- package/dist/users/usersApi.js +0 -1
- package/dist/users/usersInterfaces.d.ts +3 -3
- package/dist/users/usersSchemas.d.ts +1 -1
- package/dist/users/usersSchemas.js +1 -1
- package/package.json +3 -78
|
@@ -7,18 +7,13 @@ export declare const FormEntitySchema: z.ZodObject<{
|
|
|
7
7
|
id: z.ZodNumber;
|
|
8
8
|
identifier: z.ZodString;
|
|
9
9
|
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
version: z.ZodNumber;
|
|
11
|
+
position: z.ZodNumber;
|
|
12
|
+
processingType: z.ZodString;
|
|
13
|
+
type: z.ZodNullable<z.ZodString>;
|
|
14
|
+
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
15
|
+
templateId: z.ZodNullable<z.ZodNumber>;
|
|
16
16
|
attributes: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
17
|
-
attributeSetId: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
position: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
processingType: z.ZodOptional<z.ZodString>;
|
|
20
|
-
templateId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
21
|
-
type: z.ZodOptional<z.ZodString>;
|
|
22
17
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
23
18
|
}, z.core.$strip>;
|
|
24
19
|
/**
|
|
@@ -28,18 +23,13 @@ export declare const FormsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
28
23
|
id: z.ZodNumber;
|
|
29
24
|
identifier: z.ZodString;
|
|
30
25
|
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
version: z.ZodNumber;
|
|
27
|
+
position: z.ZodNumber;
|
|
28
|
+
processingType: z.ZodString;
|
|
29
|
+
type: z.ZodNullable<z.ZodString>;
|
|
30
|
+
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
templateId: z.ZodNullable<z.ZodNumber>;
|
|
37
32
|
attributes: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
38
|
-
attributeSetId: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
position: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
processingType: z.ZodOptional<z.ZodString>;
|
|
41
|
-
templateId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
42
|
-
type: z.ZodOptional<z.ZodString>;
|
|
43
33
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
44
34
|
}, z.core.$strip>>;
|
|
45
35
|
/**
|
|
@@ -49,17 +39,12 @@ export declare const SingleFormSchema: z.ZodObject<{
|
|
|
49
39
|
id: z.ZodNumber;
|
|
50
40
|
identifier: z.ZodString;
|
|
51
41
|
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
version: z.ZodNumber;
|
|
43
|
+
position: z.ZodNumber;
|
|
44
|
+
processingType: z.ZodString;
|
|
45
|
+
type: z.ZodNullable<z.ZodString>;
|
|
46
|
+
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
47
|
+
templateId: z.ZodNullable<z.ZodNumber>;
|
|
58
48
|
attributes: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
|
|
59
|
-
attributeSetId: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
position: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
processingType: z.ZodOptional<z.ZodString>;
|
|
62
|
-
templateId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
63
|
-
type: z.ZodOptional<z.ZodString>;
|
|
64
49
|
moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
65
50
|
}, z.core.$strip>;
|
|
@@ -10,20 +10,15 @@ exports.FormEntitySchema = zod_1.z.object({
|
|
|
10
10
|
id: zod_1.z.number(),
|
|
11
11
|
identifier: zod_1.z.string(),
|
|
12
12
|
localizeInfos: zod_1.z.union([zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z.array(zod_1.z.any())]),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
version: zod_1.z.number(),
|
|
14
|
+
position: zod_1.z.number(),
|
|
15
|
+
processingType: zod_1.z.string(),
|
|
16
|
+
type: zod_1.z.string().nullable(),
|
|
17
|
+
attributeSetId: zod_1.z.number().nullable(),
|
|
18
|
+
templateId: zod_1.z.number().nullable(),
|
|
19
19
|
attributes: zod_1.z
|
|
20
20
|
.union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])
|
|
21
21
|
.optional(),
|
|
22
|
-
attributeSetId: zod_1.z.number().optional(),
|
|
23
|
-
position: zod_1.z.number().optional(),
|
|
24
|
-
processingType: zod_1.z.string().optional(),
|
|
25
|
-
templateId: zod_1.z.number().nullable().optional(),
|
|
26
|
-
type: zod_1.z.string().optional(),
|
|
27
22
|
moduleFormConfigs: zod_1.z.array(zod_1.z.any()).optional(),
|
|
28
23
|
});
|
|
29
24
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import AttributesSetsApi from './attribute-sets/attributeSetsApi';
|
|
|
6
6
|
import AuthProviderApi from './auth-provider/authProviderApi';
|
|
7
7
|
import type { IConfig } from './base/utils';
|
|
8
8
|
import BlocksApi from './blocks/blocksApi';
|
|
9
|
+
import DiscountsApi from './discounts/discountsApi';
|
|
9
10
|
import EventsApi from './events/eventsApi';
|
|
10
11
|
import FileUploadingApi from './file-uploading/fileUploadingApi';
|
|
11
12
|
import FormsApi from './forms/formsApi';
|
|
@@ -15,10 +16,11 @@ import IntegrationCollectionsApi from './integration-collections/integrationColl
|
|
|
15
16
|
import LocalesApi from './locales/localesApi';
|
|
16
17
|
import MenusApi from './menus/menusApi';
|
|
17
18
|
import OrdersApi from './orders/ordersApi';
|
|
18
|
-
import
|
|
19
|
+
import PagesApi from './pages/pagesApi';
|
|
19
20
|
import PaymentsApi from './payments/paymentsApi';
|
|
20
21
|
import ProductStatusesApi from './product-statuses/productStatusesApi';
|
|
21
|
-
import
|
|
22
|
+
import ProductsApi from './products/productsApi';
|
|
23
|
+
import SitemapApi from './sitemap/sitemapApi';
|
|
22
24
|
import SystemApi from './system/systemApi';
|
|
23
25
|
import TemplatesApi from './templates/templatesApi';
|
|
24
26
|
import TemplatePreviewsApi from './templates-preview/templatesPreviewApi';
|
|
@@ -32,6 +34,7 @@ import WsApi from './web-socket/wsApi';
|
|
|
32
34
|
* @property {AuthProviderApi} AuthProvider - Auth provider API module.
|
|
33
35
|
* @property {BlocksApi} Blocks - Blocks API module.
|
|
34
36
|
* @property {EventsApi} Events - Events API module.
|
|
37
|
+
* @property {DiscountsApi} Discounts - Discounts API module.
|
|
35
38
|
* @property {FileUploadingApi} FileUploading - File uploading API module.
|
|
36
39
|
* @property {FormsApi} Forms - Forms API module.
|
|
37
40
|
* @property {FormsDataApi} FormData - Form data API module.
|
|
@@ -42,8 +45,9 @@ import WsApi from './web-socket/wsApi';
|
|
|
42
45
|
* @property {OrdersApi} Orders - Orders API module.
|
|
43
46
|
* @property {PageApi} Pages - Pages API module.
|
|
44
47
|
* @property {PaymentsApi} Payments - Payments API module.
|
|
45
|
-
* @property {
|
|
48
|
+
* @property {ProductsApi} Products - Products API module.
|
|
46
49
|
* @property {ProductStatusesApi} ProductStatuses - Product statuses API module.
|
|
50
|
+
* @property {SitemapApi} Sitemap - Sitemap API module.
|
|
47
51
|
* @property {SystemApi} System - System API module.
|
|
48
52
|
* @property {TemplatesApi} Templates - Templates API module.
|
|
49
53
|
* @property {TemplatePreviewsApi} TemplatePreviews - Template previews API module.
|
|
@@ -56,6 +60,7 @@ interface IDefineApi {
|
|
|
56
60
|
AuthProvider: AuthProviderApi;
|
|
57
61
|
Blocks: BlocksApi;
|
|
58
62
|
Events: EventsApi;
|
|
63
|
+
Discounts: DiscountsApi;
|
|
59
64
|
FileUploading: FileUploadingApi;
|
|
60
65
|
Forms: FormsApi;
|
|
61
66
|
FormData: FormsDataApi;
|
|
@@ -64,10 +69,11 @@ interface IDefineApi {
|
|
|
64
69
|
Locales: LocalesApi;
|
|
65
70
|
Menus: MenusApi;
|
|
66
71
|
Orders: OrdersApi;
|
|
67
|
-
Pages:
|
|
72
|
+
Pages: PagesApi;
|
|
68
73
|
Payments: PaymentsApi;
|
|
69
|
-
Products:
|
|
74
|
+
Products: ProductsApi;
|
|
70
75
|
ProductStatuses: ProductStatusesApi;
|
|
76
|
+
Sitemap: SitemapApi;
|
|
71
77
|
System: SystemApi;
|
|
72
78
|
Templates: TemplatesApi;
|
|
73
79
|
TemplatePreviews: TemplatePreviewsApi;
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const attributeSetsApi_1 = __importDefault(require("./attribute-sets/attributeSe
|
|
|
12
12
|
const authProviderApi_1 = __importDefault(require("./auth-provider/authProviderApi"));
|
|
13
13
|
const stateModule_1 = __importDefault(require("./base/stateModule"));
|
|
14
14
|
const blocksApi_1 = __importDefault(require("./blocks/blocksApi"));
|
|
15
|
+
const discountsApi_1 = __importDefault(require("./discounts/discountsApi"));
|
|
15
16
|
const eventsApi_1 = __importDefault(require("./events/eventsApi"));
|
|
16
17
|
const fileUploadingApi_1 = __importDefault(require("./file-uploading/fileUploadingApi"));
|
|
17
18
|
const formsApi_1 = __importDefault(require("./forms/formsApi"));
|
|
@@ -25,6 +26,7 @@ const pagesApi_1 = __importDefault(require("./pages/pagesApi"));
|
|
|
25
26
|
const paymentsApi_1 = __importDefault(require("./payments/paymentsApi"));
|
|
26
27
|
const productStatusesApi_1 = __importDefault(require("./product-statuses/productStatusesApi"));
|
|
27
28
|
const productsApi_1 = __importDefault(require("./products/productsApi"));
|
|
29
|
+
const sitemapApi_1 = __importDefault(require("./sitemap/sitemapApi"));
|
|
28
30
|
const systemApi_1 = __importDefault(require("./system/systemApi"));
|
|
29
31
|
const templatesApi_1 = __importDefault(require("./templates/templatesApi"));
|
|
30
32
|
const templatesPreviewApi_1 = __importDefault(require("./templates-preview/templatesPreviewApi"));
|
|
@@ -52,6 +54,7 @@ function defineOneEntry(url, config) {
|
|
|
52
54
|
const AttributesSets = new attributeSetsApi_1.default(stateModule);
|
|
53
55
|
const AuthProvider = new authProviderApi_1.default(stateModule);
|
|
54
56
|
const Blocks = new blocksApi_1.default(stateModule);
|
|
57
|
+
const Discounts = new discountsApi_1.default(stateModule);
|
|
55
58
|
const Events = new eventsApi_1.default(stateModule);
|
|
56
59
|
const FileUploading = new fileUploadingApi_1.default(stateModule);
|
|
57
60
|
const Forms = new formsApi_1.default(stateModule);
|
|
@@ -65,6 +68,7 @@ function defineOneEntry(url, config) {
|
|
|
65
68
|
const Payments = new paymentsApi_1.default(stateModule);
|
|
66
69
|
const Products = new productsApi_1.default(stateModule);
|
|
67
70
|
const ProductStatuses = new productStatusesApi_1.default(stateModule);
|
|
71
|
+
const Sitemap = new sitemapApi_1.default(stateModule);
|
|
68
72
|
const System = new systemApi_1.default(stateModule);
|
|
69
73
|
const Templates = new templatesApi_1.default(stateModule);
|
|
70
74
|
const TemplatePreviews = new templatesPreviewApi_1.default(stateModule);
|
|
@@ -75,6 +79,7 @@ function defineOneEntry(url, config) {
|
|
|
75
79
|
AttributesSets,
|
|
76
80
|
AuthProvider,
|
|
77
81
|
Blocks,
|
|
82
|
+
Discounts,
|
|
78
83
|
Events,
|
|
79
84
|
FileUploading,
|
|
80
85
|
Forms,
|
|
@@ -88,6 +93,7 @@ function defineOneEntry(url, config) {
|
|
|
88
93
|
Payments,
|
|
89
94
|
Products,
|
|
90
95
|
ProductStatuses,
|
|
96
|
+
Sitemap,
|
|
91
97
|
System,
|
|
92
98
|
Templates,
|
|
93
99
|
TemplatePreviews,
|
|
@@ -172,7 +172,7 @@ interface ICollectionsApi {
|
|
|
172
172
|
{
|
|
173
173
|
"title": "Admins text"
|
|
174
174
|
}
|
|
175
|
-
* @property {
|
|
175
|
+
* @property {number | null} attributeSetId - Identifier of the set of attributes used by the form attached to the collection. Example: 1234 or null if not applicable.
|
|
176
176
|
* @property {string | null} selectedAttributeMarkers - Text identifiers of form object attributes for display in the data table. Example: "collection_marker".
|
|
177
177
|
* @description Represents a collection object with various properties, including identifiers, form information, and localized data.
|
|
178
178
|
*/
|
|
@@ -181,7 +181,7 @@ interface ICollectionEntity {
|
|
|
181
181
|
identifier: string | null;
|
|
182
182
|
formId: number | null;
|
|
183
183
|
localizeInfos: ILocalizeInfo;
|
|
184
|
-
attributeSetId:
|
|
184
|
+
attributeSetId: number | null;
|
|
185
185
|
selectedAttributeMarkers: string | null;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
@@ -11,7 +11,7 @@ export declare const CollectionEntitySchema: z.ZodObject<{
|
|
|
11
11
|
identifier: z.ZodNullable<z.ZodString>;
|
|
12
12
|
formId: z.ZodNullable<z.ZodNumber>;
|
|
13
13
|
localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
14
|
-
attributeSetId: z.ZodNullable<z.
|
|
14
|
+
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
15
15
|
selectedAttributeMarkers: z.ZodNullable<z.ZodString>;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
17
|
/**
|
|
@@ -22,7 +22,7 @@ export declare const CollectionsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
22
22
|
identifier: z.ZodNullable<z.ZodString>;
|
|
23
23
|
formId: z.ZodNullable<z.ZodNumber>;
|
|
24
24
|
localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
25
|
-
attributeSetId: z.ZodNullable<z.
|
|
25
|
+
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
26
26
|
selectedAttributeMarkers: z.ZodNullable<z.ZodString>;
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
/**
|
|
@@ -50,8 +50,6 @@ export declare const CollectionRowSchema: z.ZodObject<{
|
|
|
50
50
|
entityId: z.ZodNullable<z.ZodNumber>;
|
|
51
51
|
attributeSetIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
52
|
total: z.ZodOptional<z.ZodString>;
|
|
53
|
-
langCode: z.ZodOptional<z.ZodString>;
|
|
54
|
-
formIdentifier: z.ZodOptional<z.ZodString>;
|
|
55
53
|
}, z.core.$strip>;
|
|
56
54
|
/**
|
|
57
55
|
* Collection rows response schema
|
|
@@ -71,8 +69,6 @@ export declare const CollectionRowsResponseSchema: z.ZodObject<{
|
|
|
71
69
|
entityId: z.ZodNullable<z.ZodNumber>;
|
|
72
70
|
attributeSetIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
71
|
total: z.ZodOptional<z.ZodString>;
|
|
74
|
-
langCode: z.ZodOptional<z.ZodString>;
|
|
75
|
-
formIdentifier: z.ZodOptional<z.ZodString>;
|
|
76
72
|
}, z.core.$strip>>;
|
|
77
73
|
total: z.ZodNumber;
|
|
78
74
|
}, z.core.$strip>;
|
|
@@ -14,7 +14,7 @@ exports.CollectionEntitySchema = zod_1.z.object({
|
|
|
14
14
|
identifier: zod_1.z.string().nullable(),
|
|
15
15
|
formId: zod_1.z.number().nullable(),
|
|
16
16
|
localizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
17
|
-
attributeSetId: zod_1.z.
|
|
17
|
+
attributeSetId: zod_1.z.number().nullable(),
|
|
18
18
|
selectedAttributeMarkers: zod_1.z.string().nullable(),
|
|
19
19
|
});
|
|
20
20
|
/**
|
|
@@ -45,8 +45,6 @@ exports.CollectionRowSchema = zod_1.z.object({
|
|
|
45
45
|
entityId: zod_1.z.number().nullable(),
|
|
46
46
|
attributeSetIdentifier: zod_1.z.string().nullable().optional(),
|
|
47
47
|
total: zod_1.z.string().optional(),
|
|
48
|
-
langCode: zod_1.z.string().optional(),
|
|
49
|
-
formIdentifier: zod_1.z.string().optional(),
|
|
50
48
|
});
|
|
51
49
|
/**
|
|
52
50
|
* Collection rows response schema
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import AsyncModules from '../base/asyncModules';
|
|
2
2
|
import type StateModule from '../base/stateModule';
|
|
3
3
|
import type { IError } from '../base/utils';
|
|
4
|
-
import type { IBaseOrdersEntity, IOrderByMarkerEntity, IOrderData, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity } from './ordersInterfaces';
|
|
4
|
+
import type { IBaseOrdersEntity, ICreateOrderPreview, IOrderByMarkerEntity, IOrderData, IOrderPreviewResponse, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrderStatus } from './ordersInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with orders.
|
|
7
7
|
* @handle /api/content/orders-storage
|
|
@@ -44,7 +44,7 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
44
44
|
getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
|
|
45
45
|
/**
|
|
46
46
|
* Retrieve one order storage object by marker.
|
|
47
|
-
* @handleName
|
|
47
|
+
* @handleName getOrdersStorageByMarker
|
|
48
48
|
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
49
49
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
50
50
|
* @returns {Promise<IOrdersEntity | IError>} Return object of order information.
|
|
@@ -52,7 +52,7 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
52
52
|
* @description This method requires user authorization.
|
|
53
53
|
* @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}.
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
getOrdersStorageByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
|
|
56
56
|
/**
|
|
57
57
|
* Getting a single order from the order storage object created by the user.
|
|
58
58
|
* @handleName getOrderByMarkerAndId
|
|
@@ -65,6 +65,17 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
65
65
|
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
66
66
|
*/
|
|
67
67
|
getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrderByMarkerEntity | IError>;
|
|
68
|
+
/**
|
|
69
|
+
* Preview order calculation with discounts and coupons (without saving).
|
|
70
|
+
* @handleName previewOrder
|
|
71
|
+
* @param {ICreateOrderPreview} body - Order preview body.
|
|
72
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
73
|
+
* @returns {Promise<IOrderPreviewResponse | IError>} Returns an object with the order preview.
|
|
74
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
75
|
+
* @description This method requires user authorization ???.
|
|
76
|
+
* @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}.
|
|
77
|
+
*/
|
|
78
|
+
previewOrder(body: ICreateOrderPreview, langCode?: string): Promise<IOrderPreviewResponse | IError>;
|
|
68
79
|
/**
|
|
69
80
|
* Creation of an order in the order storage.
|
|
70
81
|
* @handleName createOrder
|
|
@@ -123,4 +134,16 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
|
|
|
123
134
|
* @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}.
|
|
124
135
|
*/
|
|
125
136
|
updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
137
|
+
/**
|
|
138
|
+
* Get all orders statuses by Storage marker
|
|
139
|
+
* @handleName getAllStatusesByStorageMarker
|
|
140
|
+
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
141
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
142
|
+
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
143
|
+
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
144
|
+
* @returns {Promise<IOrderStatus[] | IError>} Returns an object with the orders statuses.
|
|
145
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
146
|
+
* @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}.
|
|
147
|
+
*/
|
|
148
|
+
getAllStatusesByStorageMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
|
|
126
149
|
}
|
package/dist/orders/ordersApi.js
CHANGED
|
@@ -56,7 +56,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Retrieve one order storage object by marker.
|
|
59
|
-
* @handleName
|
|
59
|
+
* @handleName getOrdersStorageByMarker
|
|
60
60
|
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
61
61
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
62
|
* @returns {Promise<IOrdersEntity | IError>} Return object of order information.
|
|
@@ -64,7 +64,7 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
64
64
|
* @description This method requires user authorization.
|
|
65
65
|
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
66
66
|
*/
|
|
67
|
-
async
|
|
67
|
+
async getOrdersStorageByMarker(marker, langCode = this.state.lang) {
|
|
68
68
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
69
69
|
return this._normalizeData(result);
|
|
70
70
|
}
|
|
@@ -85,6 +85,20 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
85
85
|
const validated = this._validateResponse(result, ordersSchemas_1.OrderEntitySchema);
|
|
86
86
|
return this._normalizeData(validated);
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Preview order calculation with discounts and coupons (without saving).
|
|
90
|
+
* @handleName previewOrder
|
|
91
|
+
* @param {ICreateOrderPreview} body - Order preview body.
|
|
92
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
93
|
+
* @returns {Promise<IOrderPreviewResponse | IError>} Returns an object with the order preview.
|
|
94
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
95
|
+
* @description This method requires user authorization ???.
|
|
96
|
+
* @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}.
|
|
97
|
+
*/
|
|
98
|
+
async previewOrder(body, langCode = this.state.lang) {
|
|
99
|
+
const result = await this._fetchPost(`/orders/preview?langCode=${langCode}`, body);
|
|
100
|
+
return this._normalizeData(result);
|
|
101
|
+
}
|
|
88
102
|
/**
|
|
89
103
|
* Creation of an order in the order storage.
|
|
90
104
|
* @handleName createOrder
|
|
@@ -165,5 +179,25 @@ class OrdersApi extends asyncModules_1.default {
|
|
|
165
179
|
const validated = this._validateResponse(result, ordersSchemas_1.UpdateOrderResponseSchema);
|
|
166
180
|
return this._normalizeData(validated);
|
|
167
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Get all orders statuses by Storage marker
|
|
184
|
+
* @handleName getAllStatusesByStorageMarker
|
|
185
|
+
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
186
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
187
|
+
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
188
|
+
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
189
|
+
* @returns {Promise<IOrderStatus[] | IError>} Returns an object with the orders statuses.
|
|
190
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
191
|
+
* @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}.
|
|
192
|
+
*/
|
|
193
|
+
async getAllStatusesByStorageMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
194
|
+
const query = {
|
|
195
|
+
langCode,
|
|
196
|
+
offset,
|
|
197
|
+
limit,
|
|
198
|
+
};
|
|
199
|
+
const data = await this._fetchGet(`/marker/${marker}/order-statuses?` + this._queryParamsToString(query));
|
|
200
|
+
return this._normalizeData(data);
|
|
201
|
+
}
|
|
168
202
|
}
|
|
169
203
|
exports.default = OrdersApi;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IOrdersApi
|
|
4
|
-
* @property {Function}
|
|
4
|
+
* @property {Function} getOrdersStorageByMarker - Retrieve one order storage object by marker.
|
|
5
5
|
* @property {Function} createOrder - Creation of an order in the order storage.
|
|
6
6
|
* @property {Function} updateOrderByMarkerAndId - Changing an order in the order store.
|
|
7
7
|
* @property {Function} getOrderByMarkerAndId - Getting a single order from the order storage object created by the user.
|
|
@@ -38,7 +38,7 @@ interface IOrdersApi {
|
|
|
38
38
|
getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
|
|
39
39
|
/**
|
|
40
40
|
* Retrieve one order storage object by marker.
|
|
41
|
-
* @handleName
|
|
41
|
+
* @handleName getOrdersStorageByMarker
|
|
42
42
|
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
43
43
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
44
44
|
* @returns {Promise<IOrdersEntity | IError>} Return object of order information.
|
|
@@ -46,7 +46,7 @@ interface IOrdersApi {
|
|
|
46
46
|
* @description This method retrieves one order storage object by marker. 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
|
-
|
|
49
|
+
getOrdersStorageByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
|
|
50
50
|
/**
|
|
51
51
|
* Getting a single order from the order storage object created by the user.
|
|
52
52
|
* @handleName getOrderByMarkerAndId
|
|
@@ -117,6 +117,29 @@ interface IOrdersApi {
|
|
|
117
117
|
* @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}.
|
|
118
118
|
*/
|
|
119
119
|
updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
120
|
+
/**
|
|
121
|
+
* Preview order calculation with discounts and coupons (without saving).
|
|
122
|
+
* @handleName previewOrder
|
|
123
|
+
* @param {ICreateOrderPreview} body - Order preview body.
|
|
124
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
125
|
+
* @returns {Promise<IOrderPreviewResponse | IError>} Returns an object with the order preview.
|
|
126
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
127
|
+
* @description This method requires user authorization ???.
|
|
128
|
+
* @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}.
|
|
129
|
+
*/
|
|
130
|
+
previewOrder(body: ICreateOrderPreview, langCode?: string): Promise<IOrderPreviewResponse | IError>;
|
|
131
|
+
/**
|
|
132
|
+
* Get all orders statuses by Storage marker
|
|
133
|
+
* @handleName getAllStatusesByStorageMarker
|
|
134
|
+
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
135
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
136
|
+
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
137
|
+
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
138
|
+
* @returns {Promise<IOrderStatus[] | IError>} Returns an object with the orders statuses.
|
|
139
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
140
|
+
* @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}.
|
|
141
|
+
*/
|
|
142
|
+
getAllStatusesByStorageMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
|
|
120
143
|
}
|
|
121
144
|
/**
|
|
122
145
|
* Interface for the orders storage object.
|
|
@@ -195,6 +218,7 @@ interface IPicture {
|
|
|
195
218
|
"previewLink": "https://example.com/image-preview.jpg"
|
|
196
219
|
}
|
|
197
220
|
* @property {number} price - Product price. Example: 150.
|
|
221
|
+
* @property {boolean} isGift - Whether the product is a gift. Example: false.
|
|
198
222
|
* @description Represents a product in an order.
|
|
199
223
|
*/
|
|
200
224
|
interface IOrderProducts {
|
|
@@ -204,6 +228,7 @@ interface IOrderProducts {
|
|
|
204
228
|
sku: string | null;
|
|
205
229
|
previewImage: any;
|
|
206
230
|
price: number;
|
|
231
|
+
isGift: boolean;
|
|
207
232
|
}
|
|
208
233
|
/**
|
|
209
234
|
* Interface representing form data for orders.
|
|
@@ -271,6 +296,9 @@ interface IOrderProductsData {
|
|
|
271
296
|
* @property {number} totalSum - Total order amount. Example: "150".
|
|
272
297
|
* @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
|
|
273
298
|
* @property {string} [statusIdentifier] - Text identifier of order status object (if not set, default status will be assigned). Example: "status-1".
|
|
299
|
+
* @property {string} [couponCode] -
|
|
300
|
+
* @property {string[]} [additionalDiscountsMarkers] -
|
|
301
|
+
* @property {unknown} [discountConfig] -
|
|
274
302
|
*/
|
|
275
303
|
interface IBaseOrdersEntity {
|
|
276
304
|
id: number;
|
|
@@ -282,6 +310,9 @@ interface IBaseOrdersEntity {
|
|
|
282
310
|
totalSum: number;
|
|
283
311
|
createdDate?: string;
|
|
284
312
|
statusIdentifier?: string;
|
|
313
|
+
couponCode?: string;
|
|
314
|
+
additionalDiscountsMarkers?: string[];
|
|
315
|
+
discountConfig?: unknown;
|
|
285
316
|
}
|
|
286
317
|
/**
|
|
287
318
|
* Interface representing a response from the order storage.
|
|
@@ -360,6 +391,8 @@ interface IPaymentAccountIdentifiers {
|
|
|
360
391
|
}
|
|
361
392
|
]
|
|
362
393
|
* @property {IOrderProductData[]} products - An array of ordered products. Example: [].
|
|
394
|
+
* @property {string} [couponCode] - Coupon code.
|
|
395
|
+
* @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
|
|
363
396
|
* @description Represents the data required to create or update an order in the order storage.
|
|
364
397
|
*/
|
|
365
398
|
interface IOrderData {
|
|
@@ -367,6 +400,8 @@ interface IOrderData {
|
|
|
367
400
|
paymentAccountIdentifier: string;
|
|
368
401
|
formData: IOrdersFormData | IOrdersFormData[];
|
|
369
402
|
products: IOrderProductData[];
|
|
403
|
+
couponCode?: string;
|
|
404
|
+
additionalDiscountsMarkers?: string[];
|
|
370
405
|
}
|
|
371
406
|
/**
|
|
372
407
|
* Interface representing an order product data.
|
|
@@ -406,6 +441,7 @@ interface IOrderData {
|
|
|
406
441
|
]
|
|
407
442
|
* @property {string | null} paymentUrl - Payment link. Example: "https://example.com/pay/123".
|
|
408
443
|
* @property {boolean | null} isCompleted - Indicates that the order has been completed. Example: true.
|
|
444
|
+
* @property {object} [statusLocalizeInfos] - Localization information.
|
|
409
445
|
* @description Represents an order storage object created by the user.
|
|
410
446
|
*/
|
|
411
447
|
interface IOrderByMarkerEntity {
|
|
@@ -423,5 +459,69 @@ interface IOrderByMarkerEntity {
|
|
|
423
459
|
paymentUrl: string | null;
|
|
424
460
|
products: IOrderProducts[];
|
|
425
461
|
isCompleted: boolean | null;
|
|
462
|
+
statusLocalizeInfos?: object;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Interface representing an order status object.
|
|
466
|
+
* @interface IOrderStatus
|
|
467
|
+
* @property {number} [id] - Status identifier. Example: 1.
|
|
468
|
+
* @property {object} [localizeInfos] - Localized information for the status.
|
|
469
|
+
* @property {string} [identifier] - Text identifier of the status. Example: "inProgress".
|
|
470
|
+
* @property {Record<string, unknown>} [position] - Position of the status.
|
|
471
|
+
* @property {boolean} [isUsed] - Whether the status is in use. Example: true.
|
|
472
|
+
*/
|
|
473
|
+
interface IOrderStatus {
|
|
474
|
+
id?: number;
|
|
475
|
+
localizeInfos?: object;
|
|
476
|
+
identifier?: string;
|
|
477
|
+
position?: Record<string, unknown>;
|
|
478
|
+
isUsed?: boolean;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Interface representing a product in an order preview.
|
|
482
|
+
* @interface IPreviewOrderProduct
|
|
483
|
+
* @property {number} [productId] - Product identifier. Example: 1.
|
|
484
|
+
* @property {number} [quantity] - Quantity of the product. Example: 2.
|
|
485
|
+
*/
|
|
486
|
+
interface IPreviewOrderProduct {
|
|
487
|
+
productId?: number;
|
|
488
|
+
quantity?: number;
|
|
489
|
+
[key: string]: any;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Interface representing the body for order preview calculation.
|
|
493
|
+
* @interface ICreateOrderPreview
|
|
494
|
+
* @property {IPreviewOrderProduct[]} [products] - Array of products to preview.
|
|
495
|
+
* @property {string} [couponCode] - Coupon code to apply.
|
|
496
|
+
* @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
|
|
497
|
+
*/
|
|
498
|
+
interface ICreateOrderPreview {
|
|
499
|
+
products?: IPreviewOrderProduct[];
|
|
500
|
+
couponCode?: string;
|
|
501
|
+
additionalDiscountsMarkers?: string[];
|
|
502
|
+
[key: string]: any;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Interface representing a single item in an order preview.
|
|
506
|
+
* @interface IOrderPreviewItem
|
|
507
|
+
*/
|
|
508
|
+
interface IOrderPreviewItem {
|
|
509
|
+
[key: string]: any;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Interface representing the response from an order preview calculation.
|
|
513
|
+
* @interface IOrderPreviewResponse
|
|
514
|
+
* @property {number} totalSum - Total order amount before discounts. Example: 300.
|
|
515
|
+
* @property {number} totalSumWithDiscount - Total order amount after discounts. Example: 250.
|
|
516
|
+
* @property {unknown} discountConfig - Discount configuration applied to the order.
|
|
517
|
+
* @property {string} currency - Currency of the order. Example: "USD".
|
|
518
|
+
* @property {IOrderPreviewItem[]} orderPreview - Array of order preview items.
|
|
519
|
+
*/
|
|
520
|
+
interface IOrderPreviewResponse {
|
|
521
|
+
totalSum: number;
|
|
522
|
+
totalSumWithDiscount: number;
|
|
523
|
+
discountConfig: unknown;
|
|
524
|
+
currency: string;
|
|
525
|
+
orderPreview: IOrderPreviewItem[];
|
|
426
526
|
}
|
|
427
|
-
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, IOrderByMarkerEntity, IOrderData, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IPaymentAccountIdentifiers, IPicture, };
|
|
527
|
+
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, ICreateOrderPreview, IOrderByMarkerEntity, IOrderData, IOrderPreviewItem, IOrderPreviewResponse, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IOrderStatus, IPaymentAccountIdentifiers, IPicture, IPreviewOrderProduct, };
|