oneentry 1.0.159 → 1.0.161
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 +2 -0
- package/changelog.md +56 -1
- package/dist/admins/adminsApi.d.ts +15 -1
- package/dist/admins/adminsApi.js +29 -0
- package/dist/admins/adminsInterfaces.d.ts +37 -1
- package/dist/base/lazySchema.d.ts +15 -0
- package/dist/base/lazySchema.js +20 -0
- package/dist/discounts/discountsApi.d.ts +14 -1
- package/dist/discounts/discountsApi.js +21 -0
- package/dist/discounts/discountsInterfaces.d.ts +27 -1
- package/dist/filters/filtersInterfaces.d.ts +2 -2
- package/dist/filters/filtersSchemas.d.ts +1 -1
- package/dist/filters/filtersSchemas.js +4 -1
- package/dist/forms-data/formsDataApi.d.ts +14 -1
- package/dist/forms-data/formsDataApi.js +21 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +74 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/orders/ordersApi.d.ts +15 -1
- package/dist/orders/ordersApi.js +22 -0
- package/dist/orders/ordersInterfaces.d.ts +27 -1
- package/dist/pages/pagesApi.d.ts +14 -1
- package/dist/pages/pagesApi.js +21 -0
- package/dist/pages/pagesInterfaces.d.ts +38 -1
- package/dist/payments/paymentsInterfaces.d.ts +2 -2
- package/dist/products/productsInterfaces.d.ts +1 -1
- package/dist/search/searchApi.d.ts +35 -0
- package/dist/search/searchApi.js +86 -0
- package/dist/search/searchInterfaces.d.ts +94 -0
- package/dist/search/searchInterfaces.js +2 -0
- package/dist/search/searchSchemas.d.ts +73 -0
- package/dist/search/searchSchemas.js +44 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.js +0 -1
- package/dist/types.d.ts +35 -0
- package/dist/types.js +2 -0
- package/dist/users/usersApi.d.ts +15 -1
- package/dist/users/usersApi.js +22 -0
- package/dist/users/usersInterfaces.d.ts +39 -1
- package/dist/web-socket/lazySocket.d.ts +18 -0
- package/dist/web-socket/lazySocket.js +70 -0
- package/esm/admins/adminsApi.d.ts +66 -0
- package/esm/admins/adminsApi.js +90 -0
- package/esm/admins/adminsInterfaces.d.ts +137 -0
- package/esm/admins/adminsInterfaces.js +1 -0
- package/esm/admins/adminsSchemas.d.ts +48 -0
- package/esm/admins/adminsSchemas.js +31 -0
- package/esm/attribute-sets/attributeSetsApi.d.ts +67 -0
- package/esm/attribute-sets/attributeSetsApi.js +97 -0
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +285 -0
- package/esm/attribute-sets/attributeSetsInterfaces.js +1 -0
- package/esm/attribute-sets/attributeSetsSchemas.d.ts +84 -0
- package/esm/attribute-sets/attributeSetsSchemas.js +66 -0
- package/esm/auth-provider/authProviderApi.d.ts +262 -0
- package/esm/auth-provider/authProviderApi.js +362 -0
- package/esm/auth-provider/authProviderSchemas.d.ts +124 -0
- package/esm/auth-provider/authProviderSchemas.js +92 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +430 -0
- package/esm/auth-provider/authProvidersInterfaces.js +1 -0
- package/esm/base/asyncModules.d.ts +123 -0
- package/esm/base/asyncModules.js +382 -0
- package/esm/base/lazySchema.d.ts +15 -0
- package/esm/base/lazySchema.js +17 -0
- package/esm/base/stateModule.d.ts +35 -0
- package/esm/base/stateModule.js +51 -0
- package/esm/base/syncModules.d.ts +245 -0
- package/esm/base/syncModules.js +555 -0
- package/esm/base/timeIntervals.d.ts +95 -0
- package/esm/base/timeIntervals.js +317 -0
- package/esm/base/utils.d.ts +354 -0
- package/esm/base/utils.js +1 -0
- package/esm/base/validation.d.ts +98 -0
- package/esm/base/validation.js +118 -0
- package/esm/blocks/blocksApi.d.ts +252 -0
- package/esm/blocks/blocksApi.js +394 -0
- package/esm/blocks/blocksInterfaces.d.ts +361 -0
- package/esm/blocks/blocksInterfaces.js +1 -0
- package/esm/blocks/blocksSchemas.d.ts +213 -0
- package/esm/blocks/blocksSchemas.js +40 -0
- package/esm/discounts/discountsApi.d.ts +94 -0
- package/esm/discounts/discountsApi.js +136 -0
- package/esm/discounts/discountsInterfaces.d.ts +293 -0
- package/esm/discounts/discountsInterfaces.js +1 -0
- package/esm/events/eventsApi.d.ts +108 -0
- package/esm/events/eventsApi.js +141 -0
- package/esm/events/eventsInterfaces.d.ts +176 -0
- package/esm/events/eventsInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingApi.d.ts +91 -0
- package/esm/file-uploading/fileUploadingApi.js +127 -0
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +116 -0
- package/esm/file-uploading/fileUploadingInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingSchemas.d.ts +24 -0
- package/esm/file-uploading/fileUploadingSchemas.js +19 -0
- package/esm/filters/filtersApi.d.ts +32 -0
- package/esm/filters/filtersApi.js +36 -0
- package/esm/filters/filtersInterfaces.d.ts +56 -0
- package/esm/filters/filtersInterfaces.js +1 -0
- package/esm/filters/filtersSchemas.d.ts +32 -0
- package/esm/filters/filtersSchemas.js +29 -0
- package/esm/forms/formsApi.d.ts +44 -0
- package/esm/forms/formsApi.js +54 -0
- package/esm/forms/formsInterfaces.d.ts +237 -0
- package/esm/forms/formsInterfaces.js +1 -0
- package/esm/forms/formsSchemas.d.ts +56 -0
- package/esm/forms/formsSchemas.js +32 -0
- package/esm/forms-data/formsDataApi.d.ts +124 -0
- package/esm/forms-data/formsDataApi.js +210 -0
- package/esm/forms-data/formsDataInterfaces.d.ts +670 -0
- package/esm/forms-data/formsDataInterfaces.js +1 -0
- package/esm/forms-data/formsDataSchemas.d.ts +107 -0
- package/esm/forms-data/formsDataSchemas.js +83 -0
- package/esm/general-types/generalTypesApi.d.ts +29 -0
- package/esm/general-types/generalTypesApi.js +34 -0
- package/esm/general-types/generalTypesInterfaces.d.ts +29 -0
- package/esm/general-types/generalTypesInterfaces.js +1 -0
- package/esm/general-types/generalTypesSchemas.d.ts +68 -0
- package/esm/general-types/generalTypesSchemas.js +42 -0
- package/esm/index.d.ts +143 -0
- package/esm/index.js +124 -0
- package/esm/integration-collections/integrationCollectionsApi.d.ts +172 -0
- package/esm/integration-collections/integrationCollectionsApi.js +224 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +317 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.js +1 -0
- package/esm/integration-collections/integrationCollectionsSchemas.d.ts +84 -0
- package/esm/integration-collections/integrationCollectionsSchemas.js +60 -0
- package/esm/locales/localesApi.d.ts +28 -0
- package/esm/locales/localesApi.js +33 -0
- package/esm/locales/localesInterfaces.d.ts +40 -0
- package/esm/locales/localesInterfaces.js +1 -0
- package/esm/locales/localesSchemas.d.ts +32 -0
- package/esm/locales/localesSchemas.js +23 -0
- package/esm/menus/menusApi.d.ts +30 -0
- package/esm/menus/menusApi.js +35 -0
- package/esm/menus/menusInterfaces.d.ts +87 -0
- package/esm/menus/menusInterfaces.js +2 -0
- package/esm/menus/menusSchemas.d.ts +16 -0
- package/esm/menus/menusSchemas.js +25 -0
- package/esm/orders/ordersApi.d.ts +213 -0
- package/esm/orders/ordersApi.js +288 -0
- package/esm/orders/ordersInterfaces.d.ts +763 -0
- package/esm/orders/ordersInterfaces.js +1 -0
- package/esm/orders/ordersSchemas.d.ts +312 -0
- package/esm/orders/ordersSchemas.js +171 -0
- package/esm/package.json +4 -0
- package/esm/pages/pagesApi.d.ts +173 -0
- package/esm/pages/pagesApi.js +414 -0
- package/esm/pages/pagesInterfaces.d.ts +344 -0
- package/esm/pages/pagesInterfaces.js +1 -0
- package/esm/pages/pagesSchemas.d.ts +121 -0
- package/esm/pages/pagesSchemas.js +60 -0
- package/esm/payments/paymentsApi.d.ts +88 -0
- package/esm/payments/paymentsApi.js +122 -0
- package/esm/payments/paymentsInterfaces.d.ts +189 -0
- package/esm/payments/paymentsInterfaces.js +1 -0
- package/esm/payments/paymentsSchemas.d.ts +94 -0
- package/esm/payments/paymentsSchemas.js +53 -0
- package/esm/product-statuses/productStatusesApi.d.ts +50 -0
- package/esm/product-statuses/productStatusesApi.js +68 -0
- package/esm/product-statuses/productStatusesInterfaces.d.ts +62 -0
- package/esm/product-statuses/productStatusesInterfaces.js +1 -0
- package/esm/product-statuses/productStatusesSchemas.d.ts +34 -0
- package/esm/product-statuses/productStatusesSchemas.js +27 -0
- package/esm/products/productsApi.d.ts +366 -0
- package/esm/products/productsApi.js +468 -0
- package/esm/products/productsInterfaces.d.ts +723 -0
- package/esm/products/productsInterfaces.js +1 -0
- package/esm/products/productsSchemas.d.ts +234 -0
- package/esm/products/productsSchemas.js +121 -0
- package/esm/search/searchApi.d.ts +35 -0
- package/esm/search/searchApi.js +47 -0
- package/esm/search/searchInterfaces.d.ts +94 -0
- package/esm/search/searchInterfaces.js +1 -0
- package/esm/search/searchSchemas.d.ts +73 -0
- package/esm/search/searchSchemas.js +41 -0
- package/esm/sitemap/sitemapApi.d.ts +37 -0
- package/esm/sitemap/sitemapApi.js +41 -0
- package/esm/sitemap/sitemapInterfaces.d.ts +51 -0
- package/esm/sitemap/sitemapInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsApi.d.ts +74 -0
- package/esm/subscriptions/subscriptionsApi.js +90 -0
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +111 -0
- package/esm/subscriptions/subscriptionsInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsSchemas.d.ts +46 -0
- package/esm/subscriptions/subscriptionsSchemas.js +38 -0
- package/esm/system/systemApi.d.ts +46 -0
- package/esm/system/systemApi.js +53 -0
- package/esm/system/systemInterfaces.d.ts +29 -0
- package/esm/system/systemInterfaces.js +1 -0
- package/esm/templates/templatesApi.d.ts +53 -0
- package/esm/templates/templatesApi.js +78 -0
- package/esm/templates/templatesInterfaces.d.ts +68 -0
- package/esm/templates/templatesInterfaces.js +1 -0
- package/esm/templates/templatesSchemas.d.ts +48 -0
- package/esm/templates/templatesSchemas.js +28 -0
- package/esm/templates-preview/templatesPreviewApi.d.ts +40 -0
- package/esm/templates-preview/templatesPreviewApi.js +50 -0
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +129 -0
- package/esm/templates-preview/templatesPreviewInterfaces.js +1 -0
- package/esm/templates-preview/templatesPreviewSchemas.d.ts +79 -0
- package/esm/templates-preview/templatesPreviewSchemas.js +43 -0
- package/esm/types.d.ts +35 -0
- package/esm/types.js +1 -0
- package/esm/user-activity/userActivityApi.d.ts +31 -0
- package/esm/user-activity/userActivityApi.js +37 -0
- package/esm/user-activity/userActivityInterfaces.d.ts +42 -0
- package/esm/user-activity/userActivityInterfaces.js +1 -0
- package/esm/users/usersApi.d.ts +249 -0
- package/esm/users/usersApi.js +312 -0
- package/esm/users/usersInterfaces.d.ts +419 -0
- package/esm/users/usersInterfaces.js +1 -0
- package/esm/users/usersSchemas.d.ts +72 -0
- package/esm/users/usersSchemas.js +55 -0
- package/esm/web-socket/lazySocket.d.ts +18 -0
- package/esm/web-socket/lazySocket.js +67 -0
- package/esm/web-socket/wsApi.d.ts +27 -0
- package/esm/web-socket/wsApi.js +43 -0
- package/esm/web-socket/wsInterfaces.d.ts +16 -0
- package/esm/web-socket/wsInterfaces.js +1 -0
- package/package.json +47 -2
- package/types.d.ts +1 -0
- package/types.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation schemas for Orders module
|
|
3
|
+
* @description Zod schemas for validating orders-related API responses
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Order item schema
|
|
8
|
+
* @description Order item schema for validating orders-related API responses
|
|
9
|
+
*/
|
|
10
|
+
export declare const OrderItemSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
productId: z.ZodNumber;
|
|
13
|
+
quantity: z.ZodNumber;
|
|
14
|
+
price: z.ZodNumber;
|
|
15
|
+
total: z.ZodNumber;
|
|
16
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
/**
|
|
19
|
+
* Order discount config schema
|
|
20
|
+
* @description Resolved discount configuration returned with an order or order preview.
|
|
21
|
+
*/
|
|
22
|
+
export declare const OrderDiscountConfigSchema: z.ZodObject<{
|
|
23
|
+
bonus: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
24
|
+
availableBalance: z.ZodNumber;
|
|
25
|
+
bonusApplied: z.ZodNumber;
|
|
26
|
+
maxBonusDiscount: z.ZodNumber;
|
|
27
|
+
minBonusAmount: z.ZodNullable<z.ZodNumber>;
|
|
28
|
+
minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
coupon: z.ZodNullable<z.ZodUnknown>;
|
|
31
|
+
orderDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
32
|
+
productDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
33
|
+
settings: z.ZodObject<{
|
|
34
|
+
allowGiftStacking: z.ZodBoolean;
|
|
35
|
+
allowStacking: z.ZodBoolean;
|
|
36
|
+
maxDiscountValue: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
giftRefundPolicy: z.ZodOptional<z.ZodString>;
|
|
38
|
+
maxBonusPaymentPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
39
|
+
minBonusAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
40
|
+
minOrderAmountForBonus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
totalRaw: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
/**
|
|
50
|
+
* Order entity schema
|
|
51
|
+
* @description Order entity schema for validating orders-related API responses
|
|
52
|
+
*/
|
|
53
|
+
export declare const OrderEntitySchema: z.ZodObject<{
|
|
54
|
+
id: z.ZodNumber;
|
|
55
|
+
storageId: z.ZodNumber;
|
|
56
|
+
createdDate: z.ZodString;
|
|
57
|
+
statusIdentifier: z.ZodOptional<z.ZodString>;
|
|
58
|
+
formIdentifier: z.ZodOptional<z.ZodString>;
|
|
59
|
+
formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
60
|
+
attributeSetIdentifier: z.ZodOptional<z.ZodString>;
|
|
61
|
+
totalSum: z.ZodString;
|
|
62
|
+
totalSumRaw: z.ZodOptional<z.ZodString>;
|
|
63
|
+
currency: z.ZodString;
|
|
64
|
+
paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
|
|
65
|
+
paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
|
+
paymentUrl: z.ZodNullable<z.ZodString>;
|
|
67
|
+
products: z.ZodArray<z.ZodAny>;
|
|
68
|
+
isCompleted: z.ZodNullable<z.ZodBoolean>;
|
|
69
|
+
isPartial: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
70
|
+
paymentStrategy: z.ZodOptional<z.ZodString>;
|
|
71
|
+
statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
72
|
+
fulfillmentStatusIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
fulfillmentStatusLocalizeInfos: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
74
|
+
paymentStatusIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
paymentStatusLocalizeInfos: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
76
|
+
discountConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
77
|
+
bonus: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
78
|
+
availableBalance: z.ZodNumber;
|
|
79
|
+
bonusApplied: z.ZodNumber;
|
|
80
|
+
maxBonusDiscount: z.ZodNumber;
|
|
81
|
+
minBonusAmount: z.ZodNullable<z.ZodNumber>;
|
|
82
|
+
minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
coupon: z.ZodNullable<z.ZodUnknown>;
|
|
85
|
+
orderDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
86
|
+
productDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
87
|
+
settings: z.ZodObject<{
|
|
88
|
+
allowGiftStacking: z.ZodBoolean;
|
|
89
|
+
allowStacking: z.ZodBoolean;
|
|
90
|
+
maxDiscountValue: z.ZodNullable<z.ZodNumber>;
|
|
91
|
+
giftRefundPolicy: z.ZodOptional<z.ZodString>;
|
|
92
|
+
maxBonusPaymentPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
93
|
+
minBonusAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
94
|
+
minOrderAmountForBonus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
97
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
totalRaw: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
103
|
+
split: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
completed: z.ZodBoolean;
|
|
105
|
+
partial: z.ZodBoolean;
|
|
106
|
+
stages: z.ZodArray<z.ZodObject<{
|
|
107
|
+
marker: z.ZodString;
|
|
108
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
109
|
+
productId: z.ZodNumber;
|
|
110
|
+
title: z.ZodString;
|
|
111
|
+
value: z.ZodNumber;
|
|
112
|
+
status: z.ZodString;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
/**
|
|
117
|
+
* Orders list response schema
|
|
118
|
+
* @returns Orders list response schema
|
|
119
|
+
*/
|
|
120
|
+
export declare const OrdersResponseSchema: z.ZodObject<{
|
|
121
|
+
items: z.ZodArray<z.ZodObject<{
|
|
122
|
+
id: z.ZodNumber;
|
|
123
|
+
storageId: z.ZodNumber;
|
|
124
|
+
createdDate: z.ZodString;
|
|
125
|
+
statusIdentifier: z.ZodOptional<z.ZodString>;
|
|
126
|
+
formIdentifier: z.ZodOptional<z.ZodString>;
|
|
127
|
+
formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
128
|
+
attributeSetIdentifier: z.ZodOptional<z.ZodString>;
|
|
129
|
+
totalSum: z.ZodString;
|
|
130
|
+
totalSumRaw: z.ZodOptional<z.ZodString>;
|
|
131
|
+
currency: z.ZodString;
|
|
132
|
+
paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
|
|
133
|
+
paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
134
|
+
paymentUrl: z.ZodNullable<z.ZodString>;
|
|
135
|
+
products: z.ZodArray<z.ZodAny>;
|
|
136
|
+
isCompleted: z.ZodNullable<z.ZodBoolean>;
|
|
137
|
+
isPartial: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
138
|
+
paymentStrategy: z.ZodOptional<z.ZodString>;
|
|
139
|
+
statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
140
|
+
fulfillmentStatusIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
fulfillmentStatusLocalizeInfos: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
142
|
+
paymentStatusIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
|
+
paymentStatusLocalizeInfos: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
144
|
+
discountConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
145
|
+
bonus: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
146
|
+
availableBalance: z.ZodNumber;
|
|
147
|
+
bonusApplied: z.ZodNumber;
|
|
148
|
+
maxBonusDiscount: z.ZodNumber;
|
|
149
|
+
minBonusAmount: z.ZodNullable<z.ZodNumber>;
|
|
150
|
+
minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
|
|
151
|
+
}, z.core.$strip>>>;
|
|
152
|
+
coupon: z.ZodNullable<z.ZodUnknown>;
|
|
153
|
+
orderDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
154
|
+
productDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
155
|
+
settings: z.ZodObject<{
|
|
156
|
+
allowGiftStacking: z.ZodBoolean;
|
|
157
|
+
allowStacking: z.ZodBoolean;
|
|
158
|
+
maxDiscountValue: z.ZodNullable<z.ZodNumber>;
|
|
159
|
+
giftRefundPolicy: z.ZodOptional<z.ZodString>;
|
|
160
|
+
maxBonusPaymentPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
161
|
+
minBonusAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
162
|
+
minOrderAmountForBonus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
167
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
totalRaw: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
}, z.core.$strip>>>;
|
|
171
|
+
split: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
completed: z.ZodBoolean;
|
|
173
|
+
partial: z.ZodBoolean;
|
|
174
|
+
stages: z.ZodArray<z.ZodObject<{
|
|
175
|
+
marker: z.ZodString;
|
|
176
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
177
|
+
productId: z.ZodNumber;
|
|
178
|
+
title: z.ZodString;
|
|
179
|
+
value: z.ZodNumber;
|
|
180
|
+
status: z.ZodString;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
total: z.ZodNumber;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
/**
|
|
187
|
+
* Order storage schema
|
|
188
|
+
* @returns Order storage validation schema
|
|
189
|
+
*/
|
|
190
|
+
export declare const OrderStorageSchema: z.ZodObject<{
|
|
191
|
+
id: z.ZodNumber;
|
|
192
|
+
identifier: z.ZodNullable<z.ZodString>;
|
|
193
|
+
localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
194
|
+
formIdentifier: z.ZodNullable<z.ZodString>;
|
|
195
|
+
generalTypeId: z.ZodNullable<z.ZodNumber>;
|
|
196
|
+
paymentAccountIdentifiers: z.ZodArray<z.ZodObject<{
|
|
197
|
+
identifier: z.ZodString;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
/**
|
|
202
|
+
* Orders storage list response schema
|
|
203
|
+
* @returns Orders storage list response schema
|
|
204
|
+
*/
|
|
205
|
+
export declare const OrdersStorageResponseSchema: z.ZodArray<z.ZodObject<{
|
|
206
|
+
id: z.ZodNumber;
|
|
207
|
+
identifier: z.ZodNullable<z.ZodString>;
|
|
208
|
+
localizeInfos: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
209
|
+
formIdentifier: z.ZodNullable<z.ZodString>;
|
|
210
|
+
generalTypeId: z.ZodNullable<z.ZodNumber>;
|
|
211
|
+
paymentAccountIdentifiers: z.ZodArray<z.ZodObject<{
|
|
212
|
+
identifier: z.ZodString;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
/**
|
|
217
|
+
* Create order response schema
|
|
218
|
+
* API returns a simplified order object after creation
|
|
219
|
+
* @returns Create order response schema
|
|
220
|
+
*/
|
|
221
|
+
export declare const CreateOrderResponseSchema: z.ZodObject<{
|
|
222
|
+
id: z.ZodNumber;
|
|
223
|
+
formIdentifier: z.ZodString;
|
|
224
|
+
paymentAccountIdentifier: z.ZodString;
|
|
225
|
+
formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
226
|
+
products: z.ZodArray<z.ZodAny>;
|
|
227
|
+
currency: z.ZodString;
|
|
228
|
+
totalSum: z.ZodNumber;
|
|
229
|
+
createdDate: z.ZodOptional<z.ZodString>;
|
|
230
|
+
statusIdentifier: z.ZodOptional<z.ZodString>;
|
|
231
|
+
statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
232
|
+
couponCode: z.ZodOptional<z.ZodString>;
|
|
233
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
discountConfig: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
bonus: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
236
|
+
availableBalance: z.ZodNumber;
|
|
237
|
+
bonusApplied: z.ZodNumber;
|
|
238
|
+
maxBonusDiscount: z.ZodNumber;
|
|
239
|
+
minBonusAmount: z.ZodNullable<z.ZodNumber>;
|
|
240
|
+
minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
|
|
241
|
+
}, z.core.$strip>>>;
|
|
242
|
+
coupon: z.ZodNullable<z.ZodUnknown>;
|
|
243
|
+
orderDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
244
|
+
productDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
245
|
+
settings: z.ZodObject<{
|
|
246
|
+
allowGiftStacking: z.ZodBoolean;
|
|
247
|
+
allowStacking: z.ZodBoolean;
|
|
248
|
+
maxDiscountValue: z.ZodNullable<z.ZodNumber>;
|
|
249
|
+
giftRefundPolicy: z.ZodOptional<z.ZodString>;
|
|
250
|
+
maxBonusPaymentPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
251
|
+
minBonusAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
252
|
+
minOrderAmountForBonus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
255
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
257
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
totalRaw: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
bonusAmount: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
/**
|
|
266
|
+
* Update order response schema
|
|
267
|
+
* API returns the full order object after update
|
|
268
|
+
*/
|
|
269
|
+
export declare const UpdateOrderResponseSchema: z.ZodObject<{
|
|
270
|
+
id: z.ZodNumber;
|
|
271
|
+
formIdentifier: z.ZodString;
|
|
272
|
+
paymentAccountIdentifier: z.ZodString;
|
|
273
|
+
formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
274
|
+
products: z.ZodArray<z.ZodAny>;
|
|
275
|
+
currency: z.ZodString;
|
|
276
|
+
totalSum: z.ZodNumber;
|
|
277
|
+
createdDate: z.ZodOptional<z.ZodString>;
|
|
278
|
+
statusIdentifier: z.ZodOptional<z.ZodString>;
|
|
279
|
+
statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
280
|
+
couponCode: z.ZodOptional<z.ZodString>;
|
|
281
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
282
|
+
discountConfig: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
bonus: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
284
|
+
availableBalance: z.ZodNumber;
|
|
285
|
+
bonusApplied: z.ZodNumber;
|
|
286
|
+
maxBonusDiscount: z.ZodNumber;
|
|
287
|
+
minBonusAmount: z.ZodNullable<z.ZodNumber>;
|
|
288
|
+
minOrderAmountForBonus: z.ZodNullable<z.ZodNumber>;
|
|
289
|
+
}, z.core.$strip>>>;
|
|
290
|
+
coupon: z.ZodNullable<z.ZodUnknown>;
|
|
291
|
+
orderDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
292
|
+
productDiscounts: z.ZodArray<z.ZodUnknown>;
|
|
293
|
+
settings: z.ZodObject<{
|
|
294
|
+
allowGiftStacking: z.ZodBoolean;
|
|
295
|
+
allowStacking: z.ZodBoolean;
|
|
296
|
+
maxDiscountValue: z.ZodNullable<z.ZodNumber>;
|
|
297
|
+
giftRefundPolicy: z.ZodOptional<z.ZodString>;
|
|
298
|
+
maxBonusPaymentPercent: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
299
|
+
minBonusAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
300
|
+
minOrderAmountForBonus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
303
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
excludedGiftProductIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
305
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
totalRaw: z.ZodOptional<z.ZodNumber>;
|
|
307
|
+
totalSumWithDiscount: z.ZodOptional<z.ZodNumber>;
|
|
308
|
+
}, z.core.$strip>>;
|
|
309
|
+
bonusAmount: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
bonusApplied: z.ZodOptional<z.ZodNumber>;
|
|
311
|
+
totalDue: z.ZodOptional<z.ZodNumber>;
|
|
312
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation schemas for Orders module
|
|
3
|
+
* @description Zod schemas for validating orders-related API responses
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Order item schema
|
|
8
|
+
* @description Order item schema for validating orders-related API responses
|
|
9
|
+
*/
|
|
10
|
+
export const OrderItemSchema = z.object({
|
|
11
|
+
id: z.number(),
|
|
12
|
+
productId: z.number(),
|
|
13
|
+
quantity: z.number(),
|
|
14
|
+
price: z.number(),
|
|
15
|
+
total: z.number(),
|
|
16
|
+
attributes: z.record(z.string(), z.any()).optional(),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Order discount config schema
|
|
20
|
+
* @description Resolved discount configuration returned with an order or order preview.
|
|
21
|
+
*/
|
|
22
|
+
export const OrderDiscountConfigSchema = z.object({
|
|
23
|
+
bonus: z
|
|
24
|
+
.object({
|
|
25
|
+
availableBalance: z.number(),
|
|
26
|
+
bonusApplied: z.number(),
|
|
27
|
+
maxBonusDiscount: z.number(),
|
|
28
|
+
minBonusAmount: z.number().nullable(),
|
|
29
|
+
minOrderAmountForBonus: z.number().nullable(),
|
|
30
|
+
})
|
|
31
|
+
.nullable()
|
|
32
|
+
.optional(),
|
|
33
|
+
coupon: z.unknown().nullable(),
|
|
34
|
+
orderDiscounts: z.array(z.unknown()),
|
|
35
|
+
productDiscounts: z.array(z.unknown()),
|
|
36
|
+
settings: z.object({
|
|
37
|
+
allowGiftStacking: z.boolean(),
|
|
38
|
+
allowStacking: z.boolean(),
|
|
39
|
+
maxDiscountValue: z.number().nullable(),
|
|
40
|
+
giftRefundPolicy: z.string().optional(),
|
|
41
|
+
maxBonusPaymentPercent: z.number().nullable().optional(),
|
|
42
|
+
minBonusAmount: z.number().nullable().optional(),
|
|
43
|
+
minOrderAmountForBonus: z.number().nullable().optional(),
|
|
44
|
+
}),
|
|
45
|
+
additionalDiscountsMarkers: z.array(z.string()).optional(),
|
|
46
|
+
bonusApplied: z.number().optional(),
|
|
47
|
+
excludedGiftProductIds: z.array(z.string()).optional(),
|
|
48
|
+
totalDue: z.number().optional(),
|
|
49
|
+
totalRaw: z.number().optional(),
|
|
50
|
+
totalSumWithDiscount: z.number().optional(),
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Order entity schema
|
|
54
|
+
* @description Order entity schema for validating orders-related API responses
|
|
55
|
+
*/
|
|
56
|
+
export const OrderEntitySchema = z.object({
|
|
57
|
+
id: z.number(),
|
|
58
|
+
storageId: z.number(),
|
|
59
|
+
createdDate: z.string(),
|
|
60
|
+
statusIdentifier: z.string().optional(),
|
|
61
|
+
formIdentifier: z.string().optional(),
|
|
62
|
+
formData: z.union([z.array(z.any()), z.record(z.string(), z.any())]),
|
|
63
|
+
attributeSetIdentifier: z.string().optional(),
|
|
64
|
+
totalSum: z.string(),
|
|
65
|
+
totalSumRaw: z.string().optional(),
|
|
66
|
+
currency: z.string(),
|
|
67
|
+
paymentAccountIdentifier: z.string().optional(),
|
|
68
|
+
paymentAccountLocalizeInfos: z.record(z.string(), z.unknown()).optional(),
|
|
69
|
+
paymentUrl: z.string().nullable(),
|
|
70
|
+
products: z.array(z.any()),
|
|
71
|
+
isCompleted: z.boolean().nullable(),
|
|
72
|
+
isPartial: z.boolean().nullable().optional(),
|
|
73
|
+
paymentStrategy: z.string().optional(),
|
|
74
|
+
statusLocalizeInfos: z.record(z.string(), z.any()).optional(),
|
|
75
|
+
fulfillmentStatusIdentifier: z.string().nullable().optional(),
|
|
76
|
+
fulfillmentStatusLocalizeInfos: z
|
|
77
|
+
.record(z.string(), z.any())
|
|
78
|
+
.nullable()
|
|
79
|
+
.optional(),
|
|
80
|
+
paymentStatusIdentifier: z.string().nullable().optional(),
|
|
81
|
+
paymentStatusLocalizeInfos: z
|
|
82
|
+
.record(z.string(), z.any())
|
|
83
|
+
.nullable()
|
|
84
|
+
.optional(),
|
|
85
|
+
discountConfig: OrderDiscountConfigSchema.nullable().optional(),
|
|
86
|
+
split: z
|
|
87
|
+
.object({
|
|
88
|
+
completed: z.boolean(),
|
|
89
|
+
partial: z.boolean(),
|
|
90
|
+
stages: z.array(z.object({
|
|
91
|
+
marker: z.string(),
|
|
92
|
+
sessionId: z.string().nullable(),
|
|
93
|
+
productId: z.number(),
|
|
94
|
+
title: z.string(),
|
|
95
|
+
value: z.number(),
|
|
96
|
+
status: z.string(),
|
|
97
|
+
})),
|
|
98
|
+
})
|
|
99
|
+
.optional(),
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* Orders list response schema
|
|
103
|
+
* @returns Orders list response schema
|
|
104
|
+
*/
|
|
105
|
+
export const OrdersResponseSchema = z.object({
|
|
106
|
+
items: z.array(OrderEntitySchema),
|
|
107
|
+
total: z.number(),
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Order storage schema
|
|
111
|
+
* @returns Order storage validation schema
|
|
112
|
+
*/
|
|
113
|
+
export const OrderStorageSchema = z.object({
|
|
114
|
+
id: z.number(),
|
|
115
|
+
identifier: z.string().nullable(),
|
|
116
|
+
localizeInfos: z.record(z.string(), z.any()),
|
|
117
|
+
formIdentifier: z.string().nullable(),
|
|
118
|
+
generalTypeId: z.number().nullable(),
|
|
119
|
+
paymentAccountIdentifiers: z.array(z.object({ identifier: z.string() })),
|
|
120
|
+
position: z.number().nullable(),
|
|
121
|
+
});
|
|
122
|
+
/**
|
|
123
|
+
* Orders storage list response schema
|
|
124
|
+
* @returns Orders storage list response schema
|
|
125
|
+
*/
|
|
126
|
+
export const OrdersStorageResponseSchema = z.array(OrderStorageSchema);
|
|
127
|
+
/**
|
|
128
|
+
* Create order response schema
|
|
129
|
+
* API returns a simplified order object after creation
|
|
130
|
+
* @returns Create order response schema
|
|
131
|
+
*/
|
|
132
|
+
export const CreateOrderResponseSchema = z.object({
|
|
133
|
+
id: z.number(),
|
|
134
|
+
formIdentifier: z.string(),
|
|
135
|
+
paymentAccountIdentifier: z.string(),
|
|
136
|
+
formData: z.union([z.array(z.any()), z.record(z.string(), z.any())]),
|
|
137
|
+
products: z.array(z.any()),
|
|
138
|
+
currency: z.string(),
|
|
139
|
+
totalSum: z.number(),
|
|
140
|
+
createdDate: z.string().optional(),
|
|
141
|
+
statusIdentifier: z.string().optional(),
|
|
142
|
+
statusLocalizeInfos: z.record(z.string(), z.any()).optional(),
|
|
143
|
+
couponCode: z.string().optional(),
|
|
144
|
+
additionalDiscountsMarkers: z.array(z.string()).optional(),
|
|
145
|
+
discountConfig: OrderDiscountConfigSchema.optional(),
|
|
146
|
+
bonusAmount: z.number().optional(),
|
|
147
|
+
bonusApplied: z.number().optional(),
|
|
148
|
+
totalDue: z.number().optional(),
|
|
149
|
+
});
|
|
150
|
+
/**
|
|
151
|
+
* Update order response schema
|
|
152
|
+
* API returns the full order object after update
|
|
153
|
+
*/
|
|
154
|
+
export const UpdateOrderResponseSchema = z.object({
|
|
155
|
+
id: z.number(),
|
|
156
|
+
formIdentifier: z.string(),
|
|
157
|
+
paymentAccountIdentifier: z.string(),
|
|
158
|
+
formData: z.union([z.array(z.any()), z.record(z.string(), z.any())]),
|
|
159
|
+
products: z.array(z.any()),
|
|
160
|
+
currency: z.string(),
|
|
161
|
+
totalSum: z.number(),
|
|
162
|
+
createdDate: z.string().optional(),
|
|
163
|
+
statusIdentifier: z.string().optional(),
|
|
164
|
+
statusLocalizeInfos: z.record(z.string(), z.any()).optional(),
|
|
165
|
+
couponCode: z.string().optional(),
|
|
166
|
+
additionalDiscountsMarkers: z.array(z.string()).optional(),
|
|
167
|
+
discountConfig: OrderDiscountConfigSchema.optional(),
|
|
168
|
+
bonusAmount: z.number().optional(),
|
|
169
|
+
bonusApplied: z.number().optional(),
|
|
170
|
+
totalDue: z.number().optional(),
|
|
171
|
+
});
|
package/esm/package.json
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules.js';
|
|
2
|
+
import type StateModule from '../base/stateModule.js';
|
|
3
|
+
import type { IError } from '../base/utils.js';
|
|
4
|
+
import type { IPageConfig, IPagesApi, IPageSearchResult, IPagesEntity, IPagesResponse, IPagesVectorSearch, IPositionBlock } from './pagesInterfaces.js';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for working with page objects, including catalog pages
|
|
7
|
+
* @handle /api/content/pages
|
|
8
|
+
* @description Controllers for working with page objects, including catalog pages
|
|
9
|
+
*/
|
|
10
|
+
export default class PagesApi extends AsyncModules implements IPagesApi {
|
|
11
|
+
protected state: StateModule;
|
|
12
|
+
protected _url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param {StateModule} state - The state module.
|
|
16
|
+
* @description Constructor initializes the PageApi with a given state.
|
|
17
|
+
*/
|
|
18
|
+
constructor(state: StateModule);
|
|
19
|
+
/**
|
|
20
|
+
* Get all top-level page objects.
|
|
21
|
+
* @handleName getRootPages
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
* @returns {Promise<IPagesEntity[] | IError>} Returns all created pages without parents as an array of PageEntity objects or an empty array [] (if there is no data)
|
|
24
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
25
|
+
* @description Get all top-level page objects.
|
|
26
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getRootPages getRootPages} documentation.
|
|
27
|
+
*/
|
|
28
|
+
getRootPages(langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
29
|
+
/**
|
|
30
|
+
* Get all page objects with product information as an array.
|
|
31
|
+
* @handleName getPages
|
|
32
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
33
|
+
* @returns {Promise<IPagesEntity[] | IError>} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data).
|
|
34
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
35
|
+
* @description Get all page objects with product information as an array.
|
|
36
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getPages getPages} documentation.
|
|
37
|
+
*/
|
|
38
|
+
getPages(langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
39
|
+
/**
|
|
40
|
+
* Get page object with information about forms, blocks, menus, linked to the page.
|
|
41
|
+
* @handleName getPageById
|
|
42
|
+
* @param {number} id - The unique identifier of the page to be fetched. Example: 1.
|
|
43
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
44
|
+
* @returns {Promise<IPagesEntity | IError>} Returns PageEntity object
|
|
45
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
46
|
+
* @description Get page object with information about forms, blocks, menus, linked to the page.
|
|
47
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getPageById getPageById} documentation.
|
|
48
|
+
*/
|
|
49
|
+
getPageById(id: number, langCode?: string): Promise<IPagesEntity | IError>;
|
|
50
|
+
/**
|
|
51
|
+
* Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
52
|
+
* @handleName getPageByUrl
|
|
53
|
+
* @param {string} url - Page URL. Example: "about".
|
|
54
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
55
|
+
* @returns {Promise<IPagesEntity | IError>} Returns PageEntity object
|
|
56
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
57
|
+
* @description Get page object with information about forms, blocks, menus, linked to the page by URL.
|
|
58
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getPageByUrl getPageByUrl} documentation.
|
|
59
|
+
*/
|
|
60
|
+
getPageByUrl(url: string, langCode?: string): Promise<IPagesEntity | IError>;
|
|
61
|
+
/**
|
|
62
|
+
* Get child pages object with information as an array.
|
|
63
|
+
* @handleName getChildPagesByParentUrl
|
|
64
|
+
* @param {string} url - The URL of the parent page for which child pages are to be fetched. Example: "about/our-team".
|
|
65
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
66
|
+
* @returns {Promise<IPagesEntity | IError>} Returns all created pages as an array of PageEntity objects or an empty array [] (if there is no data) for the selected parent
|
|
67
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
68
|
+
* @description Get child pages object with information as an array.
|
|
69
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getChildPagesByParentUrl getChildPagesByParentUrl} documentation.
|
|
70
|
+
*/
|
|
71
|
+
getChildPagesByParentUrl(url: string, langCode?: string): Promise<IPagesEntity[] | IError>;
|
|
72
|
+
/**
|
|
73
|
+
* Get all blocks by page url.
|
|
74
|
+
* @handleName getBlocksByPageUrl
|
|
75
|
+
* @param {string} url - Page URL. Example: "about".
|
|
76
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
77
|
+
* @returns {Promise<IPositionBlock[] | IError>} Returns all blocks as an array of PositionBlock objects or an empty array [] (if there is no data) for the selected parent
|
|
78
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
79
|
+
* @description Get all blocks by page url.
|
|
80
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getBlocksByPageUrl getBlocksByPageUrl} documentation.
|
|
81
|
+
*/
|
|
82
|
+
getBlocksByPageUrl(url: string, langCode?: string): Promise<IPositionBlock[] | IError>;
|
|
83
|
+
/**
|
|
84
|
+
* Get settings for the page.
|
|
85
|
+
* @handleName getConfigPageByUrl
|
|
86
|
+
* @param {string} url - Page URL. Example: "about".
|
|
87
|
+
* @returns {Promise<IPageConfig | IError>} Returns a ConfigPage object with page display settings
|
|
88
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
89
|
+
* @description Get settings for the page.
|
|
90
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getConfigPageByUrl getConfigPageByUrl} documentation.
|
|
91
|
+
*/
|
|
92
|
+
getConfigPageByUrl(url: string): Promise<IPageConfig | IError>;
|
|
93
|
+
/**
|
|
94
|
+
* Quick search for page objects with limited output.
|
|
95
|
+
* @handleName searchPage
|
|
96
|
+
* @param {string} name - Text for searching page objects (search is performed on the title field of the localizeInfos object with the language taken into account). Example: "About Us".
|
|
97
|
+
* @param {string} [url] - Page URL. Example: "catalog".
|
|
98
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
99
|
+
* @returns {Promise<IPagesEntity[] | IPageSearchResult[] | IError>} Returns found pages as an array of PageEntity objects, an array of short PageSearchResult cards when the traficLimit config option is enabled, or an empty array [] (if there is no data)
|
|
100
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
101
|
+
* @description Quick search for page objects with limited output. The quick search endpoint returns short cards ({ id, title }); with traficLimit enabled they are returned as is, otherwise full page entities are fetched for the found ids.
|
|
102
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/searchPage searchPage} documentation.
|
|
103
|
+
*/
|
|
104
|
+
searchPage(name: string, url?: string, langCode?: string): Promise<IPagesEntity[] | IPageSearchResult[] | IError>;
|
|
105
|
+
/**
|
|
106
|
+
* Semantic (vector) search for pages.
|
|
107
|
+
* @handleName getPagesByVectorSearch
|
|
108
|
+
* @param {IPagesVectorSearch} body - Vector search body. Example: `{ queryText: "winter sale" }`.
|
|
109
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
110
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
111
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
112
|
+
* @returns {Promise<IPagesResponse | IError>} Returns an object with an array of found pages and total count.
|
|
113
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
114
|
+
* @description This method performs a semantic (vector) search for pages.
|
|
115
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/getPagesByVectorSearch getPagesByVectorSearch} documentation.
|
|
116
|
+
*/
|
|
117
|
+
getPagesByVectorSearch(body: IPagesVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IPagesResponse | IError>;
|
|
118
|
+
/**
|
|
119
|
+
* Add template data to pages
|
|
120
|
+
* @handleName addTemplateToPages
|
|
121
|
+
* @param {IPagesEntity[]} data - An array of page objects (IPagesEntity[]) to which template data will be added.
|
|
122
|
+
* @example
|
|
123
|
+
[
|
|
124
|
+
{
|
|
125
|
+
"id": 8,
|
|
126
|
+
"parentId": null,
|
|
127
|
+
"moduleFormConfigs": [],
|
|
128
|
+
"pageUrl": "blog",
|
|
129
|
+
"depth": 0,
|
|
130
|
+
"localizeInfos": {
|
|
131
|
+
"title": "Blog",
|
|
132
|
+
"menuTitle": "Blog",
|
|
133
|
+
"htmlContent": "",
|
|
134
|
+
"plainContent": "",
|
|
135
|
+
},
|
|
136
|
+
"isVisible": true,
|
|
137
|
+
"forms": [],
|
|
138
|
+
"blocks": [],
|
|
139
|
+
"type": "common_page",
|
|
140
|
+
"templateIdentifier": "template",
|
|
141
|
+
"attributeSetIdentifier": "page",
|
|
142
|
+
"attributeValues": {},
|
|
143
|
+
"isSync": true,
|
|
144
|
+
"template": {
|
|
145
|
+
"id": 4,
|
|
146
|
+
"attributeSetIdentifier": null,
|
|
147
|
+
"title": "Template",
|
|
148
|
+
"generalTypeId": 4,
|
|
149
|
+
"identifier": "template",
|
|
150
|
+
"version": 0,
|
|
151
|
+
"generalTypeName": "catalog_page",
|
|
152
|
+
"attributeValues": {},
|
|
153
|
+
"position": 1,
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
* @returns {Promise<any | IError>} An array of page objects with template data added
|
|
158
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
159
|
+
* @description Add template data to pages. Optimized to avoid N+1 query problem by fetching only unique templates in parallel.
|
|
160
|
+
* For example, if 100 pages use 3 different templates, this method makes 3 requests instead of 100.
|
|
161
|
+
*/
|
|
162
|
+
protected addTemplateToPages(data: IPagesEntity[]): Promise<any | IError>;
|
|
163
|
+
/**
|
|
164
|
+
* Add template data to page by page templateIdentifier
|
|
165
|
+
* @handleName addTemplateToPage
|
|
166
|
+
* @param {IPagesEntity} data - Page object (IPagesEntity) to which template data will be added.
|
|
167
|
+
* @returns {Promise<any | IError>} An array of page objects with template data added
|
|
168
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
169
|
+
* @description Add template data to page by page templateIdentifier
|
|
170
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/pages/addTemplateToPage addTemplateToPage} documentation.
|
|
171
|
+
*/
|
|
172
|
+
protected addTemplateToPage(data: IPagesEntity): Promise<any | IError>;
|
|
173
|
+
}
|