oneentry 1.0.143 → 1.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/configure.js +2 -2
  2. package/dist/admins/adminsInterfaces.d.ts +3 -0
  3. package/dist/admins/adminsSchemas.d.ts +2 -0
  4. package/dist/admins/adminsSchemas.js +2 -1
  5. package/dist/attribute-sets/attributeSetsSchemas.d.ts +0 -2
  6. package/dist/attribute-sets/attributeSetsSchemas.js +0 -3
  7. package/dist/auth-provider/authProviderSchemas.d.ts +27 -36
  8. package/dist/auth-provider/authProviderSchemas.js +17 -6
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +22 -15
  10. package/dist/base/syncModules.js +17 -5
  11. package/dist/base/utils.d.ts +1 -1
  12. package/dist/base/validation.d.ts +10 -30
  13. package/dist/base/validation.js +10 -17
  14. package/dist/blocks/blocksApi.d.ts +12 -0
  15. package/dist/blocks/blocksApi.js +19 -0
  16. package/dist/blocks/blocksInterfaces.d.ts +12 -1
  17. package/dist/blocks/blocksSchemas.d.ts +68 -100
  18. package/dist/discounts/discountsApi.d.ts +22 -2
  19. package/dist/discounts/discountsApi.js +34 -0
  20. package/dist/discounts/discountsInterfaces.d.ts +82 -6
  21. package/dist/forms/formsApi.d.ts +3 -3
  22. package/dist/forms/formsApi.js +1 -1
  23. package/dist/forms/formsInterfaces.d.ts +33 -7
  24. package/dist/forms/formsSchemas.d.ts +20 -14
  25. package/dist/forms/formsSchemas.js +6 -2
  26. package/dist/forms-data/formsDataInterfaces.d.ts +3 -3
  27. package/dist/forms-data/formsDataSchemas.d.ts +4 -12
  28. package/dist/forms-data/formsDataSchemas.js +3 -3
  29. package/dist/general-types/generalTypesSchemas.d.ts +2 -0
  30. package/dist/general-types/generalTypesSchemas.js +1 -0
  31. package/dist/index.d.ts +24 -0
  32. package/dist/orders/ordersApi.d.ts +27 -1
  33. package/dist/orders/ordersApi.js +44 -0
  34. package/dist/orders/ordersInterfaces.d.ts +78 -3
  35. package/dist/orders/ordersSchemas.d.ts +49 -34
  36. package/dist/orders/ordersSchemas.js +38 -29
  37. package/dist/pages/pagesInterfaces.d.ts +2 -0
  38. package/dist/pages/pagesSchemas.d.ts +7 -1
  39. package/dist/pages/pagesSchemas.js +5 -1
  40. package/dist/payments/paymentsSchemas.d.ts +4 -4
  41. package/dist/payments/paymentsSchemas.js +1 -1
  42. package/dist/products/productsApi.d.ts +6 -5
  43. package/dist/products/productsApi.js +11 -12
  44. package/dist/products/productsInterfaces.d.ts +19 -3
  45. package/dist/products/productsSchemas.d.ts +68 -100
  46. package/dist/products/productsSchemas.js +17 -19
  47. package/dist/system/systemApi.d.ts +2 -2
  48. package/dist/system/systemApi.js +2 -2
  49. package/dist/system/systemInterfaces.d.ts +1 -1
  50. package/dist/users/usersInterfaces.d.ts +2 -0
  51. package/dist/users/usersSchemas.d.ts +8 -14
  52. package/dist/users/usersSchemas.js +1 -4
  53. package/package.json +2 -2
@@ -241,10 +241,10 @@ interface IFormsByMarkerDataEntity {
241
241
  "value": "Jack"
242
242
  }
243
243
  ]
244
- * @property {string} actionMessage - Action message for the form data. Example: "Form submitted successfully".
244
+ * @property {string | Record<string, string>} actionMessage - Action message for the form data (can be localized). Example: "Form submitted successfully" or { "en_US": "Success" }.
245
245
  */
246
246
  interface IPostFormResponse {
247
- actionMessage: string;
247
+ actionMessage: string | Record<string, any>;
248
248
  formData: {
249
249
  id: number;
250
250
  formIdentifier: string;
@@ -255,7 +255,7 @@ interface IPostFormResponse {
255
255
  formModuleId: number;
256
256
  userIdentifier: string | null;
257
257
  parentId: number | null;
258
- formData: FormDataType[];
258
+ formData: FormDataType[] | Record<string, any>;
259
259
  };
260
260
  }
261
261
  /**
@@ -27,11 +27,7 @@ export declare const FormByMarkerDataEntitySchema: z.ZodObject<{
27
27
  marker: z.ZodString;
28
28
  type: z.ZodString;
29
29
  value: z.ZodAny;
30
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
31
- marker: z.ZodString;
32
- type: z.ZodString;
33
- value: z.ZodAny;
34
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>>]>;
30
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
35
31
  attributeSetIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
32
  time: z.ZodUnion<readonly [z.ZodDate, z.ZodString]>;
37
33
  entityIdentifier: z.ZodOptional<z.ZodString>;
@@ -57,11 +53,7 @@ export declare const FormsByMarkerDataResponseSchema: z.ZodObject<{
57
53
  marker: z.ZodString;
58
54
  type: z.ZodString;
59
55
  value: z.ZodAny;
60
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
61
- marker: z.ZodString;
62
- type: z.ZodString;
63
- value: z.ZodAny;
64
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>>]>;
56
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodAny>]>>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
65
57
  attributeSetIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
58
  time: z.ZodUnion<readonly [z.ZodDate, z.ZodString]>;
67
59
  entityIdentifier: z.ZodOptional<z.ZodString>;
@@ -85,8 +77,8 @@ export declare const PostFormResponseSchema: z.ZodObject<{
85
77
  fingerprint: z.ZodString;
86
78
  isUserAdmin: z.ZodBoolean;
87
79
  formModuleId: z.ZodNumber;
88
- userIdentifier: z.ZodAny;
89
- parentId: z.ZodAny;
80
+ userIdentifier: z.ZodNullable<z.ZodString>;
81
+ parentId: z.ZodNullable<z.ZodNumber>;
90
82
  formData: z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
91
83
  marker: z.ZodString;
92
84
  type: z.ZodString;
@@ -31,7 +31,7 @@ exports.FormByMarkerDataEntitySchema = zod_1.z.object({
31
31
  userIdentifier: zod_1.z.string().nullish(),
32
32
  formData: zod_1.z.union([
33
33
  zod_1.z.array(exports.FormDataTypeSchema),
34
- zod_1.z.record(zod_1.z.string(), zod_1.z.array(exports.FormDataTypeSchema)),
34
+ zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
35
35
  ]),
36
36
  attributeSetIdentifier: zod_1.z.string().nullish(),
37
37
  time: zod_1.z.union([zod_1.z.date(), zod_1.z.string()]),
@@ -61,8 +61,8 @@ exports.PostFormResponseSchema = zod_1.z.object({
61
61
  fingerprint: zod_1.z.string(),
62
62
  isUserAdmin: zod_1.z.boolean(),
63
63
  formModuleId: zod_1.z.number(),
64
- userIdentifier: zod_1.z.any(),
65
- parentId: zod_1.z.any(),
64
+ userIdentifier: zod_1.z.string().nullable(),
65
+ parentId: zod_1.z.number().nullable(),
66
66
  formData: zod_1.z.union([
67
67
  zod_1.z.array(exports.FormDataTypeSchema),
68
68
  zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
@@ -24,6 +24,7 @@ export declare const GeneralTypeEntitySchema: z.ZodObject<{
24
24
  service: "service";
25
25
  external_page: "external_page";
26
26
  discount: "discount";
27
+ frequently_ordered_block: "frequently_ordered_block";
27
28
  }>;
28
29
  }, z.core.$strip>;
29
30
  /**
@@ -46,5 +47,6 @@ export declare const GeneralTypesResponseSchema: z.ZodArray<z.ZodObject<{
46
47
  service: "service";
47
48
  external_page: "external_page";
48
49
  discount: "discount";
50
+ frequently_ordered_block: "frequently_ordered_block";
49
51
  }>;
50
52
  }, z.core.$strip>>;
@@ -26,6 +26,7 @@ exports.GeneralTypeEntitySchema = zod_1.z.object({
26
26
  'service',
27
27
  'external_page',
28
28
  'discount',
29
+ 'frequently_ordered_block',
29
30
  'none',
30
31
  ]),
31
32
  });
package/dist/index.d.ts CHANGED
@@ -55,29 +55,53 @@ import WsApi from './web-socket/wsApi';
55
55
  * @property {WsApi} WS - WebSocket API module.
56
56
  */
57
57
  interface IDefineApi {
58
+ /** Admin panel users management */
58
59
  Admins: AdminsApi;
60
+ /** Attribute set schemas: getAttributesByMarker, getAttributeSetByMarker, getSingleAttributeByMarkerSet */
59
61
  AttributesSets: AttributesSetsApi;
62
+ /** User registration, login, logout, OAuth, token refresh */
60
63
  AuthProvider: AuthProviderApi;
64
+ /** Page blocks: getBlocksByPageUrl, getBlockByMarker */
61
65
  Blocks: BlocksApi;
66
+ /** Subscription events: subscribe to real-time entity changes */
62
67
  Events: EventsApi;
68
+ /** Discounts and promo codes */
63
69
  Discounts: DiscountsApi;
70
+ /** File upload helpers: createFileFromUrl */
64
71
  FileUploading: FileUploadingApi;
72
+ /** Form schemas: getFormByMarker — use for rendering dynamic forms */
65
73
  Forms: FormsApi;
74
+ /** Submit form data: postFormsData */
66
75
  FormData: FormsDataApi;
76
+ /** General types / custom types defined in admin panel */
67
77
  GeneralTypes: GeneralTypesApi;
78
+ /** Integration collections */
68
79
  IntegrationCollections: IntegrationCollectionsApi;
80
+ /** Project locales: getLocales */
69
81
  Locales: LocalesApi;
82
+ /** Navigation menus: getMenusByMarker */
70
83
  Menus: MenusApi;
84
+ /** Orders: createOrder, getAllOrdersByMarker, getAllOrdersStorage */
71
85
  Orders: OrdersApi;
86
+ /** Pages: getPageByUrl, getPageById, getChildPages, getRootPages */
72
87
  Pages: PagesApi;
88
+ /** Payments: createSession, getSessionByOrderId */
73
89
  Payments: PaymentsApi;
90
+ /** Products: getProducts, getProductById, filterProducts, searchProducts */
74
91
  Products: ProductsApi;
92
+ /** Product statuses: getProductStatuses */
75
93
  ProductStatuses: ProductStatusesApi;
94
+ /** Sitemap generation */
76
95
  Sitemap: SitemapApi;
96
+ /** System info */
77
97
  System: SystemApi;
98
+ /** Page templates */
78
99
  Templates: TemplatesApi;
100
+ /** Template previews */
79
101
  TemplatePreviews: TemplatePreviewsApi;
102
+ /** Current authenticated user: getUser, updateUser */
80
103
  Users: UsersApi;
104
+ /** WebSocket real-time updates */
81
105
  WS: WsApi;
82
106
  }
83
107
  /**
@@ -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, ICreateOrderPreview, IOrderByMarkerEntity, IOrderData, IOrderPreviewResponse, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrderStatus } from './ordersInterfaces';
4
+ import type { IBaseOrdersEntity, ICreateOrderPreview, ICreateRefundRequest, IOrderByMarkerEntity, IOrderData, IOrderPreviewResponse, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrderStatus, IRefundRequest } from './ordersInterfaces';
5
5
  /**
6
6
  * Controllers for working with orders.
7
7
  * @handle /api/content/orders-storage
@@ -11,6 +11,7 @@ import type { IBaseOrdersEntity, ICreateOrderPreview, IOrderByMarkerEntity, IOrd
11
11
  export default class OrdersApi extends AsyncModules implements IOrdersApi {
12
12
  protected state: StateModule;
13
13
  protected _url: string;
14
+ private _ordersUrl;
14
15
  /**
15
16
  * Constructs an instance of the OrdersApi class.
16
17
  * @param {StateModule} state - The state module containing the necessary information for making API calls.
@@ -146,4 +147,29 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
146
147
  * @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
  */
148
149
  getAllStatusesByStorageMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
150
+ /**
151
+ * Get all refund requests for an order.
152
+ * @handleName getRefunds
153
+ * @param {number} id - Order id. Example: 1.
154
+ * @returns {Promise<IRefundRequest[] | IError>} Returns array of refund requests.
155
+ * @throws {IError} When isShell=false and an error occurs during the fetch
156
+ */
157
+ getRefunds(id: number): Promise<IRefundRequest[] | IError>;
158
+ /**
159
+ * Create a refund request for an order.
160
+ * @handleName createRefundRequest
161
+ * @param {number} id - Order id. Example: 1.
162
+ * @param {ICreateRefundRequest} body - Refund request body.
163
+ * @returns {Promise<IOrdersEntity | IError>} Returns order entity.
164
+ * @throws {IError} When isShell=false and an error occurs during the fetch
165
+ */
166
+ createRefundRequest(id: number, body: ICreateRefundRequest): Promise<IOrdersEntity | IError>;
167
+ /**
168
+ * Cancel a refund request for an order.
169
+ * @handleName cancelRefundRequest
170
+ * @param {number} id - Order id. Example: 1.
171
+ * @returns {Promise<IOrdersEntity | IError>} Returns order entity.
172
+ * @throws {IError} When isShell=false and an error occurs during the fetch
173
+ */
174
+ cancelRefundRequest(id: number): Promise<IOrdersEntity | IError>;
149
175
  }
@@ -20,6 +20,7 @@ class OrdersApi extends asyncModules_1.default {
20
20
  constructor(state) {
21
21
  super(state);
22
22
  this._url = state.url + '/api/content/orders-storage';
23
+ this._ordersUrl = state.url + '/api/content/orders';
23
24
  }
24
25
  /**
25
26
  * Getting all the order storage objects.
@@ -199,5 +200,48 @@ class OrdersApi extends asyncModules_1.default {
199
200
  const data = await this._fetchGet(`/marker/${marker}/order-statuses?` + this._queryParamsToString(query));
200
201
  return this._normalizeData(data);
201
202
  }
203
+ /**
204
+ * Get all refund requests for an order.
205
+ * @handleName getRefunds
206
+ * @param {number} id - Order id. Example: 1.
207
+ * @returns {Promise<IRefundRequest[] | IError>} Returns array of refund requests.
208
+ * @throws {IError} When isShell=false and an error occurs during the fetch
209
+ */
210
+ async getRefunds(id) {
211
+ const savedUrl = this._url;
212
+ this._url = this._ordersUrl;
213
+ const data = await this._fetchGet(`/${id}/refund`);
214
+ this._url = savedUrl;
215
+ return this._normalizeData(data);
216
+ }
217
+ /**
218
+ * Create a refund request for an order.
219
+ * @handleName createRefundRequest
220
+ * @param {number} id - Order id. Example: 1.
221
+ * @param {ICreateRefundRequest} body - Refund request body.
222
+ * @returns {Promise<IOrdersEntity | IError>} Returns order entity.
223
+ * @throws {IError} When isShell=false and an error occurs during the fetch
224
+ */
225
+ async createRefundRequest(id, body) {
226
+ const savedUrl = this._url;
227
+ this._url = this._ordersUrl;
228
+ const data = await this._fetchPost(`/${id}/refund`, body);
229
+ this._url = savedUrl;
230
+ return this._normalizeData(data);
231
+ }
232
+ /**
233
+ * Cancel a refund request for an order.
234
+ * @handleName cancelRefundRequest
235
+ * @param {number} id - Order id. Example: 1.
236
+ * @returns {Promise<IOrdersEntity | IError>} Returns order entity.
237
+ * @throws {IError} When isShell=false and an error occurs during the fetch
238
+ */
239
+ async cancelRefundRequest(id) {
240
+ const savedUrl = this._url;
241
+ this._url = this._ordersUrl;
242
+ const data = await this._fetchDelete(`/${id}/refund`);
243
+ this._url = savedUrl;
244
+ return this._normalizeData(data);
245
+ }
202
246
  }
203
247
  exports.default = OrdersApi;
@@ -133,6 +133,31 @@ interface IOrdersApi {
133
133
  * @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}.
134
134
  */
135
135
  getAllStatusesByStorageMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
136
+ /**
137
+ * Get all refund requests for an order.
138
+ * @handleName getOrderRefunds
139
+ * @param {number} id - Order id.
140
+ * @returns {Promise<IRefundRequest[] | IError>} Returns array of refund requests.
141
+ * @throws {IError} When isShell=false and an error occurs during the fetch
142
+ */
143
+ getRefunds(id: number): Promise<IRefundRequest[] | IError>;
144
+ /**
145
+ * Create a refund request for an order.
146
+ * @handleName createRefundRequest
147
+ * @param {number} id - Order id.
148
+ * @param {ICreateRefundRequest} body - Refund request body.
149
+ * @returns {Promise<IOrdersEntity | IError>} Returns order entity.
150
+ * @throws {IError} When isShell=false and an error occurs during the fetch
151
+ */
152
+ createRefundRequest(id: number, body: ICreateRefundRequest): Promise<IOrdersEntity | IError>;
153
+ /**
154
+ * Cancel a refund request for an order.
155
+ * @handleName cancelRefundRequest
156
+ * @param {number} id - Order id.
157
+ * @returns {Promise<IOrdersEntity | IError>} Returns order entity.
158
+ * @throws {IError} When isShell=false and an error occurs during the fetch
159
+ */
160
+ cancelRefundRequest(id: number): Promise<IOrdersEntity | IError>;
136
161
  }
137
162
  /**
138
163
  * Interface for the orders storage object.
@@ -292,6 +317,9 @@ interface IOrderProductsData {
292
317
  * @property {string} [couponCode] -
293
318
  * @property {string[]} [additionalDiscountsMarkers] -
294
319
  * @property {unknown} [discountConfig] -
320
+ * @property {number} [bonusAmount] - Bonus amount applied to the order.
321
+ * @property {number} [bonusApplied] - Bonus applied to the order.
322
+ * @property {number} [totalDue] - Total due after bonuses.
295
323
  */
296
324
  interface IBaseOrdersEntity {
297
325
  id: number;
@@ -306,6 +334,9 @@ interface IBaseOrdersEntity {
306
334
  couponCode?: string;
307
335
  additionalDiscountsMarkers?: string[];
308
336
  discountConfig?: unknown;
337
+ bonusAmount?: number;
338
+ bonusApplied?: number;
339
+ totalDue?: number;
309
340
  }
310
341
  /**
311
342
  * Interface representing a response from the order storage.
@@ -386,6 +417,7 @@ interface IPaymentAccountIdentifiers {
386
417
  * @property {IOrderProductData[]} products - An array of ordered products. Example: [].
387
418
  * @property {string} [couponCode] - Coupon code.
388
419
  * @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
420
+ * @property {number} [bonusAmount] - Bonus amount to apply.
389
421
  * @description Represents the data required to create or update an order in the order storage.
390
422
  */
391
423
  interface IOrderData {
@@ -395,6 +427,7 @@ interface IOrderData {
395
427
  products: IOrderProductData[];
396
428
  couponCode?: string;
397
429
  additionalDiscountsMarkers?: string[];
430
+ bonusAmount?: number;
398
431
  }
399
432
  /**
400
433
  * Interface representing an order product data.
@@ -460,15 +493,17 @@ interface IOrderByMarkerEntity {
460
493
  * @property {number} [id] - Status identifier. Example: 1.
461
494
  * @property {object} [localizeInfos] - Localized information for the status.
462
495
  * @property {string} [identifier] - Text identifier of the status. Example: "inProgress".
463
- * @property {Record<string, unknown>} [position] - Position of the status.
496
+ * @property {number} [position] - Position of the status. Example: 1.
464
497
  * @property {boolean} [isUsed] - Whether the status is in use. Example: true.
498
+ * @property {boolean} [isDefault] - Whether the status is the default status. Example: true.
465
499
  */
466
500
  interface IOrderStatus {
467
501
  id?: number;
468
502
  localizeInfos?: object;
469
503
  identifier?: string;
470
- position?: Record<string, unknown>;
504
+ position?: number;
471
505
  isUsed?: boolean;
506
+ isDefault?: boolean;
472
507
  }
473
508
  /**
474
509
  * Interface representing a product in an order preview.
@@ -487,11 +522,13 @@ interface IPreviewOrderProduct {
487
522
  * @property {IPreviewOrderProduct[]} [products] - Array of products to preview.
488
523
  * @property {string} [couponCode] - Coupon code to apply.
489
524
  * @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
525
+ * @property {number} [bonusAmount] - Bonus amount to apply.
490
526
  */
491
527
  interface ICreateOrderPreview {
492
528
  products?: IPreviewOrderProduct[];
493
529
  couponCode?: string;
494
530
  additionalDiscountsMarkers?: string[];
531
+ bonusAmount?: number;
495
532
  [key: string]: unknown;
496
533
  }
497
534
  /**
@@ -509,6 +546,8 @@ interface IOrderPreviewItem {
509
546
  * @property {unknown} discountConfig - Discount configuration applied to the order.
510
547
  * @property {string} currency - Currency of the order. Example: "USD".
511
548
  * @property {IOrderPreviewItem[]} orderPreview - Array of order preview items.
549
+ * @property {number} bonusApplied - Bonus applied to the order.
550
+ * @property {number} totalDue - Total due after bonuses.
512
551
  */
513
552
  interface IOrderPreviewResponse {
514
553
  totalSum: number;
@@ -516,5 +555,41 @@ interface IOrderPreviewResponse {
516
555
  discountConfig: unknown;
517
556
  currency: string;
518
557
  orderPreview: IOrderPreviewItem[];
558
+ bonusApplied: number;
559
+ totalDue: number;
560
+ }
561
+ /**
562
+ * @interface IRefundRequest
563
+ * @property {number} id - Refund request id.
564
+ * @property {string} createdDate - Creation date.
565
+ * @property {string} status - Refund status.
566
+ * @property {number} amount - Refund amount.
567
+ * @property {string} note - Refund note.
568
+ * @property {Record<string, unknown>} products - Products for refund.
569
+ * @property {number} orderId - Order id.
570
+ * @property {number} orderStorageId - Order storage id.
571
+ * @property {number} userId - User id.
572
+ * @property {unknown} orderStorage - Order storage data.
573
+ * @property {unknown} user - User data.
574
+ */
575
+ interface IRefundRequest {
576
+ id: number;
577
+ createdDate: string;
578
+ status: string;
579
+ amount: number;
580
+ note: string;
581
+ products: Record<string, unknown>;
582
+ orderId: number;
583
+ orderStorageId: number;
584
+ userId: number;
585
+ orderStorage: unknown;
586
+ user: unknown;
587
+ }
588
+ /**
589
+ * @interface ICreateRefundRequest
590
+ * @description Body for creating a refund request.
591
+ */
592
+ interface ICreateRefundRequest {
593
+ [key: string]: unknown;
519
594
  }
520
- export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, ICreateOrderPreview, IOrderByMarkerEntity, IOrderData, IOrderPreviewItem, IOrderPreviewResponse, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IOrderStatus, IPaymentAccountIdentifiers, IPicture, IPreviewOrderProduct, };
595
+ export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, ICreateOrderPreview, ICreateRefundRequest, IOrderByMarkerEntity, IOrderData, IOrderPreviewItem, IOrderPreviewResponse, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IOrderStatus, IPaymentAccountIdentifiers, IPicture, IPreviewOrderProduct, IRefundRequest, };
@@ -21,19 +21,19 @@ export declare const OrderItemSchema: z.ZodObject<{
21
21
  */
22
22
  export declare const OrderEntitySchema: z.ZodObject<{
23
23
  id: z.ZodNumber;
24
- storageId: z.ZodOptional<z.ZodNumber>;
25
- createdDate: z.ZodOptional<z.ZodString>;
24
+ storageId: z.ZodNumber;
25
+ createdDate: z.ZodString;
26
26
  statusIdentifier: z.ZodOptional<z.ZodString>;
27
27
  formIdentifier: z.ZodOptional<z.ZodString>;
28
- formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
29
- attributeSetIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
30
- totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
31
- currency: z.ZodOptional<z.ZodString>;
32
- paymentAccountIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
33
- paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
34
- paymentUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
- products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
36
- isCompleted: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
28
+ formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
29
+ attributeSetIdentifier: z.ZodOptional<z.ZodString>;
30
+ totalSum: z.ZodString;
31
+ currency: z.ZodString;
32
+ paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
33
+ paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
34
+ paymentUrl: z.ZodNullable<z.ZodString>;
35
+ products: z.ZodArray<z.ZodAny>;
36
+ isCompleted: z.ZodNullable<z.ZodBoolean>;
37
37
  statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
38
  }, z.core.$strip>;
39
39
  /**
@@ -43,19 +43,19 @@ export declare const OrderEntitySchema: z.ZodObject<{
43
43
  export declare const OrdersResponseSchema: z.ZodObject<{
44
44
  items: z.ZodArray<z.ZodObject<{
45
45
  id: z.ZodNumber;
46
- storageId: z.ZodOptional<z.ZodNumber>;
47
- createdDate: z.ZodOptional<z.ZodString>;
46
+ storageId: z.ZodNumber;
47
+ createdDate: z.ZodString;
48
48
  statusIdentifier: z.ZodOptional<z.ZodString>;
49
49
  formIdentifier: z.ZodOptional<z.ZodString>;
50
- formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
51
- attributeSetIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
52
- totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
53
- currency: z.ZodOptional<z.ZodString>;
54
- paymentAccountIdentifier: z.ZodNullable<z.ZodOptional<z.ZodString>>;
55
- paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
56
- paymentUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
57
- products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
58
- isCompleted: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
50
+ formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
51
+ attributeSetIdentifier: z.ZodOptional<z.ZodString>;
52
+ totalSum: z.ZodString;
53
+ currency: z.ZodString;
54
+ paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
55
+ paymentAccountLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
56
+ paymentUrl: z.ZodNullable<z.ZodString>;
57
+ products: z.ZodArray<z.ZodAny>;
58
+ isCompleted: z.ZodNullable<z.ZodBoolean>;
59
59
  statusLocalizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
60
60
  }, z.core.$strip>>;
61
61
  total: z.ZodNumber;
@@ -97,13 +97,20 @@ export declare const OrdersStorageResponseSchema: z.ZodArray<z.ZodObject<{
97
97
  */
98
98
  export declare const CreateOrderResponseSchema: z.ZodObject<{
99
99
  id: z.ZodNumber;
100
- formIdentifier: z.ZodOptional<z.ZodString>;
101
- paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
102
- formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
103
- products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
104
- currency: z.ZodOptional<z.ZodString>;
105
- totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
100
+ formIdentifier: z.ZodString;
101
+ paymentAccountIdentifier: z.ZodString;
102
+ formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
103
+ products: z.ZodArray<z.ZodAny>;
104
+ currency: z.ZodString;
105
+ totalSum: z.ZodNumber;
106
106
  createdDate: z.ZodOptional<z.ZodString>;
107
+ statusIdentifier: z.ZodOptional<z.ZodString>;
108
+ couponCode: z.ZodOptional<z.ZodString>;
109
+ additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
+ discountConfig: z.ZodOptional<z.ZodUnknown>;
111
+ bonusAmount: z.ZodOptional<z.ZodNumber>;
112
+ bonusApplied: z.ZodOptional<z.ZodNumber>;
113
+ totalDue: z.ZodOptional<z.ZodNumber>;
107
114
  }, z.core.$strip>;
108
115
  /**
109
116
  * Update order response schema
@@ -111,10 +118,18 @@ export declare const CreateOrderResponseSchema: z.ZodObject<{
111
118
  */
112
119
  export declare const UpdateOrderResponseSchema: z.ZodObject<{
113
120
  id: z.ZodNumber;
114
- formIdentifier: z.ZodOptional<z.ZodString>;
115
- paymentAccountIdentifier: z.ZodOptional<z.ZodString>;
116
- formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
117
- products: z.ZodOptional<z.ZodArray<z.ZodAny>>;
118
- currency: z.ZodOptional<z.ZodString>;
119
- totalSum: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
121
+ formIdentifier: z.ZodString;
122
+ paymentAccountIdentifier: z.ZodString;
123
+ formData: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
124
+ products: z.ZodArray<z.ZodAny>;
125
+ currency: z.ZodString;
126
+ totalSum: z.ZodNumber;
127
+ createdDate: z.ZodOptional<z.ZodString>;
128
+ statusIdentifier: z.ZodOptional<z.ZodString>;
129
+ couponCode: z.ZodOptional<z.ZodString>;
130
+ additionalDiscountsMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
131
+ discountConfig: z.ZodOptional<z.ZodUnknown>;
132
+ bonusAmount: z.ZodOptional<z.ZodNumber>;
133
+ bonusApplied: z.ZodOptional<z.ZodNumber>;
134
+ totalDue: z.ZodOptional<z.ZodNumber>;
120
135
  }, z.core.$strip>;
@@ -24,21 +24,19 @@ exports.OrderItemSchema = zod_1.z.object({
24
24
  */
25
25
  exports.OrderEntitySchema = zod_1.z.object({
26
26
  id: zod_1.z.number(),
27
- storageId: zod_1.z.number().optional(),
28
- createdDate: zod_1.z.string().optional(),
27
+ storageId: zod_1.z.number(),
28
+ createdDate: zod_1.z.string(),
29
29
  statusIdentifier: zod_1.z.string().optional(),
30
30
  formIdentifier: zod_1.z.string().optional(),
31
- formData: zod_1.z
32
- .union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])
33
- .optional(),
34
- attributeSetIdentifier: zod_1.z.string().optional().nullable(),
35
- totalSum: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
36
- currency: zod_1.z.string().optional(),
37
- paymentAccountIdentifier: zod_1.z.string().optional().nullable(),
38
- paymentAccountLocalizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
39
- paymentUrl: zod_1.z.string().optional().nullable(),
40
- products: zod_1.z.array(zod_1.z.any()).optional(),
41
- isCompleted: zod_1.z.boolean().optional().nullable(),
31
+ formData: zod_1.z.union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())]),
32
+ attributeSetIdentifier: zod_1.z.string().optional(),
33
+ totalSum: zod_1.z.string(),
34
+ currency: zod_1.z.string(),
35
+ paymentAccountIdentifier: zod_1.z.string().optional(),
36
+ paymentAccountLocalizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
37
+ paymentUrl: zod_1.z.string().nullable(),
38
+ products: zod_1.z.array(zod_1.z.any()),
39
+ isCompleted: zod_1.z.boolean().nullable(),
42
40
  statusLocalizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
43
41
  });
44
42
  /**
@@ -74,15 +72,20 @@ exports.OrdersStorageResponseSchema = zod_1.z.array(exports.OrderStorageSchema);
74
72
  */
75
73
  exports.CreateOrderResponseSchema = zod_1.z.object({
76
74
  id: zod_1.z.number(),
77
- formIdentifier: zod_1.z.string().optional(),
78
- paymentAccountIdentifier: zod_1.z.string().optional(),
79
- formData: zod_1.z
80
- .union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])
81
- .optional(),
82
- products: zod_1.z.array(zod_1.z.any()).optional(),
83
- currency: zod_1.z.string().optional(),
84
- totalSum: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
75
+ formIdentifier: zod_1.z.string(),
76
+ paymentAccountIdentifier: zod_1.z.string(),
77
+ formData: zod_1.z.union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())]),
78
+ products: zod_1.z.array(zod_1.z.any()),
79
+ currency: zod_1.z.string(),
80
+ totalSum: zod_1.z.number(),
85
81
  createdDate: zod_1.z.string().optional(),
82
+ statusIdentifier: zod_1.z.string().optional(),
83
+ couponCode: zod_1.z.string().optional(),
84
+ additionalDiscountsMarkers: zod_1.z.array(zod_1.z.string()).optional(),
85
+ discountConfig: zod_1.z.unknown().optional(),
86
+ bonusAmount: zod_1.z.number().optional(),
87
+ bonusApplied: zod_1.z.number().optional(),
88
+ totalDue: zod_1.z.number().optional(),
86
89
  });
87
90
  /**
88
91
  * Update order response schema
@@ -90,12 +93,18 @@ exports.CreateOrderResponseSchema = zod_1.z.object({
90
93
  */
91
94
  exports.UpdateOrderResponseSchema = zod_1.z.object({
92
95
  id: zod_1.z.number(),
93
- formIdentifier: zod_1.z.string().optional(),
94
- paymentAccountIdentifier: zod_1.z.string().optional(),
95
- formData: zod_1.z
96
- .union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])
97
- .optional(),
98
- products: zod_1.z.array(zod_1.z.any()).optional(),
99
- currency: zod_1.z.string().optional(),
100
- totalSum: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
96
+ formIdentifier: zod_1.z.string(),
97
+ paymentAccountIdentifier: zod_1.z.string(),
98
+ formData: zod_1.z.union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())]),
99
+ products: zod_1.z.array(zod_1.z.any()),
100
+ currency: zod_1.z.string(),
101
+ totalSum: zod_1.z.number(),
102
+ createdDate: zod_1.z.string().optional(),
103
+ statusIdentifier: zod_1.z.string().optional(),
104
+ couponCode: zod_1.z.string().optional(),
105
+ additionalDiscountsMarkers: zod_1.z.array(zod_1.z.string()).optional(),
106
+ discountConfig: zod_1.z.unknown().optional(),
107
+ bonusAmount: zod_1.z.number().optional(),
108
+ bonusApplied: zod_1.z.number().optional(),
109
+ totalDue: zod_1.z.number().optional(),
101
110
  });
@@ -255,6 +255,7 @@ interface IPositionBlock {
255
255
  "position": 1
256
256
  }
257
257
  * @property {Array<IFormConfig>} [moduleFormConfigs] - Module form configurations linked to the page.
258
+ * @property {Record<string, unknown>} [rating] - Rating data.
258
259
  * @property {string} [total] - Total number of products linked to the page. Example: "10".
259
260
  * @property {string} [categoryPath] - Category path string. Example: "catalog".
260
261
  * @description This interface defines the structure of a page entity, including its identifiers, attributes, and hierarchical relationships.
@@ -271,6 +272,7 @@ interface IPagesEntity {
271
272
  attributeSetIdentifier: string | null;
272
273
  attributeValues: AttributeType;
273
274
  moduleFormConfigs?: IFormConfig[];
275
+ rating?: Record<string, unknown>;
274
276
  isSync: boolean;
275
277
  template?: ITemplateEntity;
276
278
  blocks?: IBlockEntity[] | string[];