oneentry 1.0.124 → 1.0.125

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 (76) hide show
  1. package/README.md +24 -22
  2. package/dist/admins/adminsApi.d.ts +17 -4
  3. package/dist/admins/adminsApi.js +16 -3
  4. package/dist/admins/adminsInterfaces.d.ts +47 -26
  5. package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
  6. package/dist/attribute-sets/attributeSetsApi.js +9 -17
  7. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
  8. package/dist/auth-provider/authProviderApi.d.ts +146 -36
  9. package/dist/auth-provider/authProviderApi.js +163 -37
  10. package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
  11. package/dist/base/asyncModules.d.ts +7 -1
  12. package/dist/base/asyncModules.js +127 -21
  13. package/dist/base/result.js +23 -0
  14. package/dist/base/syncModules.d.ts +4 -0
  15. package/dist/base/syncModules.js +19 -1
  16. package/dist/base/utils.d.ts +1 -1
  17. package/dist/blocks/blocksApi.d.ts +7 -17
  18. package/dist/blocks/blocksApi.js +7 -17
  19. package/dist/blocks/blocksInterfaces.d.ts +77 -32
  20. package/dist/events/eventsApi.d.ts +7 -8
  21. package/dist/events/eventsApi.js +12 -7
  22. package/dist/events/eventsInterfaces.d.ts +16 -11
  23. package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
  24. package/dist/file-uploading/fileUploadingApi.js +20 -12
  25. package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
  26. package/dist/forms/formsApi.d.ts +3 -7
  27. package/dist/forms/formsApi.js +2 -6
  28. package/dist/forms/formsInterfaces.d.ts +44 -28
  29. package/dist/formsData/formsDataApi.d.ts +21 -9
  30. package/dist/formsData/formsDataApi.js +21 -9
  31. package/dist/formsData/formsDataInterfaces.d.ts +128 -45
  32. package/dist/general-types/generalTypesApi.d.ts +1 -3
  33. package/dist/general-types/generalTypesApi.js +0 -2
  34. package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
  38. package/dist/integration-collections/integrationCollectionsApi.js +64 -45
  39. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
  40. package/dist/locales/localesApi.d.ts +1 -2
  41. package/dist/locales/localesApi.js +1 -2
  42. package/dist/locales/localesInterfaces.d.ts +2 -4
  43. package/dist/menus/menusApi.d.ts +1 -3
  44. package/dist/menus/menusApi.js +1 -3
  45. package/dist/menus/menusInterfaces.d.ts +39 -13
  46. package/dist/orders/ordersApi.d.ts +36 -18
  47. package/dist/orders/ordersApi.js +40 -22
  48. package/dist/orders/ordersInterfaces.d.ts +163 -81
  49. package/dist/pages/pagesApi.d.ts +48 -48
  50. package/dist/pages/pagesApi.js +40 -45
  51. package/dist/pages/pagesInterfaces.d.ts +147 -98
  52. package/dist/payments/paymentsApi.d.ts +25 -45
  53. package/dist/payments/paymentsApi.js +27 -46
  54. package/dist/payments/paymentsInterfaces.d.ts +42 -60
  55. package/dist/product-statuses/productStatusesApi.d.ts +6 -12
  56. package/dist/product-statuses/productStatusesApi.js +5 -11
  57. package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
  58. package/dist/products/productsApi.d.ts +256 -104
  59. package/dist/products/productsApi.js +263 -97
  60. package/dist/products/productsInterfaces.d.ts +343 -160
  61. package/dist/system/systemApi.d.ts +21 -10
  62. package/dist/system/systemApi.js +22 -8
  63. package/dist/system/systemInterfaces.d.ts +0 -1
  64. package/dist/templates/templatesApi.d.ts +6 -12
  65. package/dist/templates/templatesApi.js +4 -10
  66. package/dist/templates/templatesInterfaces.d.ts +20 -20
  67. package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
  68. package/dist/templates-preview/templatesPreviewApi.js +1 -5
  69. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
  70. package/dist/users/usersApi.d.ts +33 -13
  71. package/dist/users/usersApi.js +38 -15
  72. package/dist/users/usersInterfaces.d.ts +78 -27
  73. package/dist/web-socket/wsApi.d.ts +1 -5
  74. package/dist/web-socket/wsApi.js +1 -5
  75. package/dist/web-socket/wsInterfaces.d.ts +0 -1
  76. package/package.json +18 -16
@@ -1,9 +1,8 @@
1
- import type { IError, ILocalizeInfo } from '../base/utils';
1
+ import type { IAttributeValues, IError, ILocalizeInfo } from '../base/utils';
2
2
  /**
3
3
  * @interface IMenus
4
4
  *
5
5
  * @property {function} getMenusByMarker - Get pages includes in menu by marker.
6
- *
7
6
  * @description This interface defines a method for retrieving menu pages by a specific marker and language code.
8
7
  */
9
8
  interface IMenus {
@@ -12,7 +11,6 @@ interface IMenus {
12
11
  *
13
12
  * @param {string} marker - Menu marker. Example: "main_menu".
14
13
  * @param {string} [langCode] - Language code. Default: "en_US".
15
- *
16
14
  * @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
17
15
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
18
16
  */
@@ -21,22 +19,38 @@ interface IMenus {
21
19
  /**
22
20
  * @interface IMenusPages
23
21
  *
24
- * @property {Array<IMenusPages>} [children] - The optional parameter. Contains array with child page objects.
22
+ * @property {IMenusPages[]} children - Contains array with child page objects. Example:
23
+ [
24
+ {
25
+ "id": null,
26
+ "pageUrl": null,
27
+ "localizeInfos": {},
28
+ "attributeValues": {},
29
+ "parentId": null,
30
+ "position": 1
31
+ }
32
+ ]
25
33
  * @property {number} id - The unique identifier of the menu. Example: 1.
26
34
  * @property {string} pageUrl - The page url string. Example: "about".
27
- * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization. Example: .
28
- * @property {IAttributesSets} attributeValues - Attributes sets. Example: { "color": "red", "size": "large" }.
35
+ * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization. Example:
36
+ {
37
+ "title": "menu"
38
+ }
39
+ * @property {IAttributeValues} attributeValues - Attributes sets. Example:
40
+ {
41
+ "color": "red",
42
+ "size": "large"
43
+ }
29
44
  * @property {number} position - The menu position. Example: 1.
30
45
  * @property {number | null} parentId - The menu parent id. Example: null.
31
- *
32
46
  * @description This interface defines the structure of a menu page entity, including its identifiers, localization information, attributes, and hierarchical relationships.
33
47
  */
34
48
  interface IMenusPages {
35
- children?: Array<IMenusPages> | IMenusPages;
49
+ children?: IMenusPages[] | IMenusPages;
36
50
  id: number | null;
37
51
  pageUrl: string | null;
38
52
  localizeInfos: ILocalizeInfo;
39
- attributeValues: any;
53
+ attributeValues: IAttributeValues;
40
54
  position: number;
41
55
  parentId: number | null;
42
56
  }
@@ -45,15 +59,27 @@ interface IMenusPages {
45
59
  *
46
60
  * @property {number} id - The unique identifier of the menu. Example: 1.
47
61
  * @property {string} identifier - The menu identifier. Example: "main_menu".
48
- * @property {Record<string, any>} localizeInfos - The menu data, taking into account localization. Example: .
49
- * @property {Array<IMenusPages>} pages - Array of menu pages. Example: .
50
- *
62
+ * @property {ILocalizeInfo} localizeInfos - The menu data, taking into account localization. Example:
63
+ {
64
+ "title": "menu"
65
+ }
66
+ * @property {IMenusPages[]} pages - Array of menu pages. Example:
67
+ [
68
+ {
69
+ "id": null,
70
+ "pageUrl": null,
71
+ "localizeInfos": {},
72
+ "attributeValues": {},
73
+ "parentId": null,
74
+ "position": 1
75
+ }
76
+ ]
51
77
  * @description This interface defines the structure of a menu entity, including its identifiers, localization information, and associated pages.
52
78
  */
53
79
  interface IMenusEntity {
54
80
  id: number;
55
81
  identifier: string;
56
82
  localizeInfos: ILocalizeInfo;
57
- pages: Array<IMenusPages> | IMenusPages;
83
+ pages: IMenusPages[] | IMenusPages;
58
84
  }
59
85
  export type { IMenus, IMenusEntity, IMenusPages };
@@ -7,7 +7,6 @@ import type { IBaseOrdersEntity, IOrderByMarkerEntity, IOrderData, IOrdersApi, I
7
7
  *
8
8
  * @handle /api/content/orders-storage
9
9
  * @module OrdersApi
10
- *
11
10
  * @description This module provides methods for working with orders, including retrieving, creating, and updating orders in the order storage.
12
11
  */
13
12
  export default class OrdersApi extends AsyncModules implements IOrdersApi {
@@ -19,16 +18,14 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
19
18
  *
20
19
  * @handleName getAllOrdersStorage
21
20
  *
22
- * @param {number} [langCode] - Language code. Default: "en_US".
21
+ * @param {string} [langCode] - Language code. Default: "en_US".
23
22
  * @param {number} [offset] - Optional parameter for pagination. Default: 0.
24
23
  * @param {number} [limit] - Optional parameter for pagination. Default: 30.
25
- *
26
24
  * @return {IOrdersEntity[]} Returns an array of order storage objects.
27
25
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
28
- *
29
26
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
30
27
  **/
31
- getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<Array<IOrdersEntity> | IError>;
28
+ getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
32
29
  /**
33
30
  * Getting all orders from the orders storage object created by the user.
34
31
  *
@@ -38,10 +35,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
38
35
  * @param {string} [langCode] - Language code. Default: "en_US".
39
36
  * @param {number} [offset] - Offset parameter. Default: 0.
40
37
  * @param {number} [limit] - Limit parameter. Default: 30.
41
- *
42
38
  * @return {IOrdersByMarkerEntity} Returns an object with the orders.
43
39
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
44
- *
45
40
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
46
41
  */
47
42
  getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
@@ -52,10 +47,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
52
47
  *
53
48
  * @param {string} marker - Marker of the order object. Example: "order_storage_1".
54
49
  * @param {string} [langCode] - Language code. Default: "en_US".
55
- *
56
50
  * @return {IOrdersEntity} Return object of order information.
57
51
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
- *
59
52
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
60
53
  */
61
54
  getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
@@ -67,10 +60,8 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
67
60
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
68
61
  * @param {number} id - ID of the order object. Example: 12345.
69
62
  * @param {string} [langCode] - Language code. Default: "en_US".
70
- *
71
63
  * @return {IOrderByMarkerEntity} Returns an object with the order.
72
64
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
73
- *
74
65
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
75
66
  */
76
67
  getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrderByMarkerEntity | IError>;
@@ -80,15 +71,28 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
80
71
  * @handleName createOrder
81
72
  *
82
73
  * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
83
- * @param {IOrderData} data - Object for creating an order. Example: "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ] }.
74
+ * @param {IOrderData} body - Object for creating an order. Example:
75
+ {
76
+ "formIdentifier": "bar-orders-form",
77
+ "paymentAccountIdentifier": "usd-payment",
78
+ "formData": {
79
+ "marker": "name_1",
80
+ "value": "Name",
81
+ "type": "string"
82
+ },
83
+ "products": [
84
+ {
85
+ "productId": 1,
86
+ "quantity": 2
87
+ }
88
+ ]
89
+ }
84
90
  * @param {String} [langCode] - Language code. Default: "en_US".
85
- *
86
91
  * @return {IBaseOrdersEntity} Returns an object with the created order.
87
92
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
88
- *
89
93
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
90
94
  */
91
- createOrder(marker: string, data: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
95
+ createOrder(marker: string, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
92
96
  /**
93
97
  * Changing an order in the orders storage
94
98
  *
@@ -96,12 +100,26 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
96
100
  *
97
101
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
98
102
  * @param {number} id - ID of the order object. Example: 12345.
99
- * @param {IOrderData} body - Object for updating an order. Example: { "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ], "currency": "USD" }.
103
+ * @param {IOrderData} body - Object for updating an order. Example:
104
+ {
105
+ "formIdentifier": "bar-orders-form",
106
+ "paymentAccountIdentifier": "usd-payment",
107
+ "formData": {
108
+ "marker": "name_1",
109
+ "value": "Name",
110
+ "type": "string"
111
+ },
112
+ "products": [
113
+ {
114
+ "productId": 1,
115
+ "quantity": 2
116
+ }
117
+ ],
118
+ "currency": "USD"
119
+ }
100
120
  * @param {string} [langCode] - Language code. Default: "en_US".
101
- *
102
121
  * @return {IBaseOrdersEntity} Returns an object with the updated order.
103
122
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
104
- *
105
123
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
106
124
  */
107
125
  updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
@@ -9,7 +9,6 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
9
9
  *
10
10
  * @handle /api/content/orders-storage
11
11
  * @module OrdersApi
12
- *
13
12
  * @description This module provides methods for working with orders, including retrieving, creating, and updating orders in the order storage.
14
13
  */
15
14
  class OrdersApi extends asyncModules_1.default {
@@ -22,13 +21,11 @@ class OrdersApi extends asyncModules_1.default {
22
21
  *
23
22
  * @handleName getAllOrdersStorage
24
23
  *
25
- * @param {number} [langCode] - Language code. Default: "en_US".
24
+ * @param {string} [langCode] - Language code. Default: "en_US".
26
25
  * @param {number} [offset] - Optional parameter for pagination. Default: 0.
27
26
  * @param {number} [limit] - Optional parameter for pagination. Default: 30.
28
- *
29
27
  * @return {IOrdersEntity[]} Returns an array of order storage objects.
30
28
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
31
- *
32
29
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
33
30
  **/
34
31
  async getAllOrdersStorage(langCode = this.state.lang, offset = 0, limit = 30) {
@@ -44,10 +41,8 @@ class OrdersApi extends asyncModules_1.default {
44
41
  * @param {string} [langCode] - Language code. Default: "en_US".
45
42
  * @param {number} [offset] - Offset parameter. Default: 0.
46
43
  * @param {number} [limit] - Limit parameter. Default: 30.
47
- *
48
44
  * @return {IOrdersByMarkerEntity} Returns an object with the orders.
49
45
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
50
- *
51
46
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
52
47
  */
53
48
  async getAllOrdersByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
@@ -62,10 +57,8 @@ class OrdersApi extends asyncModules_1.default {
62
57
  *
63
58
  * @param {string} marker - Marker of the order object. Example: "order_storage_1".
64
59
  * @param {string} [langCode] - Language code. Default: "en_US".
65
- *
66
60
  * @return {IOrdersEntity} Return object of order information.
67
61
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
68
- *
69
62
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
70
63
  */
71
64
  async getOrderByMarker(marker, langCode = this.state.lang) {
@@ -80,10 +73,8 @@ class OrdersApi extends asyncModules_1.default {
80
73
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
81
74
  * @param {number} id - ID of the order object. Example: 12345.
82
75
  * @param {string} [langCode] - Language code. Default: "en_US".
83
- *
84
76
  * @return {IOrderByMarkerEntity} Returns an object with the order.
85
77
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
86
- *
87
78
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
88
79
  */
89
80
  async getOrderByMarkerAndId(marker, id, langCode = this.state.lang) {
@@ -96,22 +87,35 @@ class OrdersApi extends asyncModules_1.default {
96
87
  * @handleName createOrder
97
88
  *
98
89
  * @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
99
- * @param {IOrderData} data - Object for creating an order. Example: "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ] }.
90
+ * @param {IOrderData} body - Object for creating an order. Example:
91
+ {
92
+ "formIdentifier": "bar-orders-form",
93
+ "paymentAccountIdentifier": "usd-payment",
94
+ "formData": {
95
+ "marker": "name_1",
96
+ "value": "Name",
97
+ "type": "string"
98
+ },
99
+ "products": [
100
+ {
101
+ "productId": 1,
102
+ "quantity": 2
103
+ }
104
+ ]
105
+ }
100
106
  * @param {String} [langCode] - Language code. Default: "en_US".
101
- *
102
107
  * @return {IBaseOrdersEntity} Returns an object with the created order.
103
108
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
104
- *
105
109
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
106
110
  */
107
- async createOrder(marker, data, langCode = this.state.lang) {
111
+ async createOrder(marker, body, langCode = this.state.lang) {
108
112
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
109
113
  const formData = {};
110
- formData[langCode] = Array.isArray(data.formData)
111
- ? data.formData
112
- : [data.formData];
113
- data.formData = formData;
114
- const result = await this._fetchPost(`/marker/${marker}/orders`, data);
114
+ formData[langCode] = Array.isArray(body.formData)
115
+ ? body.formData
116
+ : [body.formData];
117
+ body.formData = formData;
118
+ const result = await this._fetchPost(`/marker/${marker}/orders`, body);
115
119
  return this._normalizeData(result);
116
120
  }
117
121
  /**
@@ -121,12 +125,26 @@ class OrdersApi extends asyncModules_1.default {
121
125
  *
122
126
  * @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
123
127
  * @param {number} id - ID of the order object. Example: 12345.
124
- * @param {IOrderData} body - Object for updating an order. Example: { "formIdentifier": "bar-orders-form", "paymentAccountIdentifier": "usd-payment", "formData": { "marker": "name_1", "value": "Name", "type": "string" }, "products": [ { "productId": 1, "quantity": 2 } ], "currency": "USD" }.
128
+ * @param {IOrderData} body - Object for updating an order. Example:
129
+ {
130
+ "formIdentifier": "bar-orders-form",
131
+ "paymentAccountIdentifier": "usd-payment",
132
+ "formData": {
133
+ "marker": "name_1",
134
+ "value": "Name",
135
+ "type": "string"
136
+ },
137
+ "products": [
138
+ {
139
+ "productId": 1,
140
+ "quantity": 2
141
+ }
142
+ ],
143
+ "currency": "USD"
144
+ }
125
145
  * @param {string} [langCode] - Language code. Default: "en_US".
126
- *
127
146
  * @return {IBaseOrdersEntity} Returns an object with the updated order.
128
147
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
129
- *
130
148
  * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
131
149
  */
132
150
  async updateOrderByMarkerAndId(marker, id, body, langCode = this.state.lang) {