oneentry 1.0.124 → 1.0.126
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 +24 -22
- package/dist/admins/adminsApi.d.ts +17 -4
- package/dist/admins/adminsApi.js +16 -3
- package/dist/admins/adminsInterfaces.d.ts +47 -26
- package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
- package/dist/attribute-sets/attributeSetsApi.js +9 -17
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
- package/dist/auth-provider/authProviderApi.d.ts +146 -36
- package/dist/auth-provider/authProviderApi.js +163 -37
- package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
- package/dist/base/asyncModules.d.ts +7 -1
- package/dist/base/asyncModules.js +127 -21
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +19 -1
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +7 -17
- package/dist/blocks/blocksApi.js +7 -17
- package/dist/blocks/blocksInterfaces.d.ts +77 -32
- package/dist/events/eventsApi.d.ts +7 -8
- package/dist/events/eventsApi.js +12 -7
- package/dist/events/eventsInterfaces.d.ts +16 -11
- package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
- package/dist/file-uploading/fileUploadingApi.js +20 -12
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
- package/dist/forms/formsApi.d.ts +3 -7
- package/dist/forms/formsApi.js +2 -6
- package/dist/forms/formsInterfaces.d.ts +44 -28
- package/dist/{formsData → forms-data}/formsDataApi.d.ts +31 -15
- package/dist/{formsData → forms-data}/formsDataApi.js +30 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +462 -0
- package/dist/general-types/generalTypesApi.d.ts +1 -3
- package/dist/general-types/generalTypesApi.js +0 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
- package/dist/integration-collections/integrationCollectionsApi.js +64 -45
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
- package/dist/locales/localesApi.d.ts +1 -2
- package/dist/locales/localesApi.js +1 -2
- package/dist/locales/localesInterfaces.d.ts +2 -4
- package/dist/menus/menusApi.d.ts +1 -3
- package/dist/menus/menusApi.js +1 -3
- package/dist/menus/menusInterfaces.d.ts +39 -13
- package/dist/orders/ordersApi.d.ts +36 -18
- package/dist/orders/ordersApi.js +40 -22
- package/dist/orders/ordersInterfaces.d.ts +163 -81
- package/dist/pages/pagesApi.d.ts +48 -48
- package/dist/pages/pagesApi.js +40 -45
- package/dist/pages/pagesInterfaces.d.ts +147 -98
- package/dist/payments/paymentsApi.d.ts +25 -45
- package/dist/payments/paymentsApi.js +27 -46
- package/dist/payments/paymentsInterfaces.d.ts +42 -60
- package/dist/product-statuses/productStatusesApi.d.ts +6 -12
- package/dist/product-statuses/productStatusesApi.js +5 -11
- package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
- package/dist/products/productsApi.d.ts +256 -104
- package/dist/products/productsApi.js +263 -97
- package/dist/products/productsInterfaces.d.ts +343 -160
- package/dist/system/systemApi.d.ts +21 -10
- package/dist/system/systemApi.js +22 -8
- package/dist/system/systemInterfaces.d.ts +0 -1
- package/dist/templates/templatesApi.d.ts +6 -12
- package/dist/templates/templatesApi.js +4 -10
- package/dist/templates/templatesInterfaces.d.ts +20 -20
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
- package/dist/templates-preview/templatesPreviewApi.js +1 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
- package/dist/users/usersApi.d.ts +33 -13
- package/dist/users/usersApi.js +38 -15
- package/dist/users/usersInterfaces.d.ts +78 -27
- package/dist/web-socket/wsApi.d.ts +1 -5
- package/dist/web-socket/wsApi.js +1 -5
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +18 -16
- package/dist/formsData/formsDataInterfaces.d.ts +0 -267
- /package/dist/{formsData → forms-data}/formsDataInterfaces.js +0 -0
package/dist/orders/ordersApi.js
CHANGED
|
@@ -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 {
|
|
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}
|
|
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,
|
|
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(
|
|
111
|
-
?
|
|
112
|
-
: [
|
|
113
|
-
|
|
114
|
-
const result = await this._fetchPost(`/marker/${marker}/orders`,
|
|
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:
|
|
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) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IError } from '../base/utils';
|
|
1
|
+
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface IOrdersApi
|
|
4
4
|
*
|
|
@@ -9,7 +9,6 @@ import type { IError } from '../base/utils';
|
|
|
9
9
|
* @property {function} getAllOrders - Getting all the order storage objects.
|
|
10
10
|
* @property {function} getAllOrdersByMarker - Getting one order storage object by marker.
|
|
11
11
|
* @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
|
|
12
|
-
*
|
|
13
12
|
* @description Represents the API for managing orders in the order storage.
|
|
14
13
|
*/
|
|
15
14
|
interface IOrdersApi {
|
|
@@ -19,11 +18,10 @@ interface IOrdersApi {
|
|
|
19
18
|
* @param {number} [langCode] - Language code. Default: "en_US".
|
|
20
19
|
* @param {number} [offset] - Optional parameter for pagination. Default: 0.
|
|
21
20
|
* @param {number} [limit] - Optional parameter for pagination. Default: 30.
|
|
22
|
-
*
|
|
23
21
|
* @return {IOrdersEntity[]} Returns an array of order storage objects.
|
|
24
22
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
23
|
*/
|
|
26
|
-
getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<
|
|
24
|
+
getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
|
|
27
25
|
/**
|
|
28
26
|
* Getting all orders from the orders storage object created by the user.
|
|
29
27
|
*
|
|
@@ -31,7 +29,6 @@ interface IOrdersApi {
|
|
|
31
29
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
32
30
|
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
33
31
|
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
34
|
-
*
|
|
35
32
|
* @return {IOrdersByMarkerEntity} Returns an object with the orders.
|
|
36
33
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
37
34
|
*/
|
|
@@ -41,7 +38,6 @@ interface IOrdersApi {
|
|
|
41
38
|
*
|
|
42
39
|
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
43
40
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
44
|
-
*
|
|
45
41
|
* @return {IOrdersEntity} Return object of order information.
|
|
46
42
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
47
43
|
*/
|
|
@@ -52,7 +48,6 @@ interface IOrdersApi {
|
|
|
52
48
|
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
53
49
|
* @param {number} id - ID of the order object. Example: 12345.
|
|
54
50
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
55
|
-
*
|
|
56
51
|
* @return {IOrderByMarkerEntity} Returns an object with the order.
|
|
57
52
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
58
53
|
*/
|
|
@@ -61,41 +56,101 @@ interface IOrdersApi {
|
|
|
61
56
|
* Creation of an order in the order storage.
|
|
62
57
|
*
|
|
63
58
|
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
64
|
-
* @param {IOrderData}
|
|
59
|
+
* @param {IOrderData} body - Object for creating an order. Example:
|
|
60
|
+
{
|
|
61
|
+
"formIdentifier": "bar-orders-form",
|
|
62
|
+
"paymentAccountIdentifier": "usd-payment",
|
|
63
|
+
"formData": {
|
|
64
|
+
"marker": "name_1",
|
|
65
|
+
"value": "Name",
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"products": [
|
|
69
|
+
{
|
|
70
|
+
"productId": 1,
|
|
71
|
+
"quantity": 2
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
65
75
|
* @param {String} [langCode] - Language code. Default: "en_US".
|
|
66
|
-
*
|
|
67
76
|
* @return {IBaseOrdersEntity} Returns an object with the created order.
|
|
68
77
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
69
|
-
*
|
|
70
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.
|
|
71
79
|
*/
|
|
72
|
-
createOrder(marker: string,
|
|
80
|
+
createOrder(marker: string, body: IOrderData, langCode: string): Promise<IBaseOrdersEntity | IError>;
|
|
73
81
|
/**
|
|
74
82
|
* Changing an order in the orders storage
|
|
75
83
|
*
|
|
76
84
|
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
77
85
|
* @param {number} id - ID of the order object. Example: 12345.
|
|
78
|
-
* @param {IOrderData}
|
|
86
|
+
* @param {IOrderData} body - Object for updating an order. Example:
|
|
87
|
+
{
|
|
88
|
+
"formIdentifier": "bar-orders-form",
|
|
89
|
+
"paymentAccountIdentifier": "usd-payment",
|
|
90
|
+
"formData": {
|
|
91
|
+
"marker": "name_1",
|
|
92
|
+
"value": "Name",
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"products": [
|
|
96
|
+
{
|
|
97
|
+
"productId": 1,
|
|
98
|
+
"quantity": 2
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"currency": "USD"
|
|
102
|
+
}
|
|
79
103
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
80
|
-
*
|
|
81
104
|
* @return {IBaseOrdersEntity} Returns an object with the updated order.
|
|
82
105
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
83
|
-
*
|
|
84
106
|
* @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.
|
|
85
107
|
*/
|
|
86
|
-
updateOrderByMarkerAndId(marker: string, id: number,
|
|
108
|
+
updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
87
109
|
}
|
|
88
110
|
/**
|
|
89
111
|
* @interface IOrdersByMarkerEntity
|
|
90
112
|
*
|
|
113
|
+
* @property {IOrderByMarkerEntity[]} items - Array of order storage objects. Example:
|
|
114
|
+
[
|
|
115
|
+
{
|
|
116
|
+
"id": 55,
|
|
117
|
+
"storageId": 1,
|
|
118
|
+
"createdDate": "2025-03-22T21:12:42.371Z",
|
|
119
|
+
"statusIdentifier": "inProgress",
|
|
120
|
+
"formIdentifier": "orderForm",
|
|
121
|
+
"formData": [
|
|
122
|
+
{
|
|
123
|
+
"marker": "order_name",
|
|
124
|
+
"value": "Ivan",
|
|
125
|
+
"type": "string"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"attributeSetIdentifier": "order_form",
|
|
129
|
+
"totalSum": "300.00",
|
|
130
|
+
"currency": "",
|
|
131
|
+
"paymentAccountIdentifier": "cash",
|
|
132
|
+
"paymentAccountLocalizeInfos": {
|
|
133
|
+
"title": "Cash"
|
|
134
|
+
},
|
|
135
|
+
"products": [
|
|
136
|
+
{
|
|
137
|
+
"id": 2957,
|
|
138
|
+
"title": "Cosmo",
|
|
139
|
+
"sku": null,
|
|
140
|
+
"previewImage": null,
|
|
141
|
+
"price": 150,
|
|
142
|
+
"quantity": 2
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"isCompleted": false
|
|
146
|
+
}
|
|
147
|
+
]
|
|
91
148
|
* @property {number} total - Total number of found records. Example: 100.
|
|
92
|
-
* @property {Array<IOrderByMarkerEntity>} items - Array of order storage objects. Example: .
|
|
93
|
-
*
|
|
94
149
|
* @description Represents a response from the order storage by marker.
|
|
95
150
|
*/
|
|
96
151
|
interface IOrdersByMarkerEntity {
|
|
97
152
|
total: number;
|
|
98
|
-
items:
|
|
153
|
+
items: IOrderByMarkerEntity[];
|
|
99
154
|
}
|
|
100
155
|
/**
|
|
101
156
|
* Interface representing a picture entity.
|
|
@@ -106,7 +161,6 @@ interface IOrdersByMarkerEntity {
|
|
|
106
161
|
* @property {string} downloadLink - The URL link to download the picture. Example: "https://example.com/image.jpg".
|
|
107
162
|
* @property {number} size - The size of the picture in bytes. Example: 102400.
|
|
108
163
|
* @property {string} previewLink - The URL link to preview the picture. Example: "https://example.com/image-preview.jpg".
|
|
109
|
-
*
|
|
110
164
|
* @description This interface defines the structure for a picture entity, including its filename, download link, size, and preview link.
|
|
111
165
|
*/
|
|
112
166
|
interface IPicture {
|
|
@@ -118,43 +172,32 @@ interface IPicture {
|
|
|
118
172
|
/**
|
|
119
173
|
* @interface IOrderProducts
|
|
120
174
|
*
|
|
121
|
-
* @property {number}
|
|
122
|
-
* @property {
|
|
123
|
-
* @property {string | null} sku - Product SKU. Example: "SKU-123".
|
|
124
|
-
* @property {number} price - Product price. Example: 99.99.
|
|
125
|
-
* @property {number | null} quantity - Product quantity. Example: 2.
|
|
126
|
-
* @property {Array<IPicture>} previewImage - Array of product images.
|
|
127
|
-
*
|
|
175
|
+
* @property {number} productId - Product title. Example: 2957.
|
|
176
|
+
* @property {number} quantity - Product quantity. Example: 1.
|
|
128
177
|
* @description Represents a product in an order.
|
|
129
178
|
*/
|
|
130
179
|
interface IOrderProducts {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
sku: string | null;
|
|
134
|
-
price: number;
|
|
135
|
-
quantity: number | null;
|
|
136
|
-
previewImage: Array<IPicture> | null;
|
|
180
|
+
productId: number;
|
|
181
|
+
quantity: number;
|
|
137
182
|
}
|
|
138
183
|
/**
|
|
139
184
|
* @interface IOrdersFormData
|
|
140
185
|
*
|
|
141
186
|
* @property {string} marker - Marker of form field. Example: "name_1".
|
|
142
|
-
* @property {string} value - Value. Example: "Name".
|
|
143
187
|
* @property {string} type - Type of value. Example: "string".
|
|
144
|
-
*
|
|
188
|
+
* @property {string} value - Value. Example: "Name".
|
|
145
189
|
* @description Represents a form data for orders.
|
|
146
190
|
*/
|
|
147
191
|
interface IOrdersFormData {
|
|
148
192
|
marker: string;
|
|
149
|
-
value: any;
|
|
150
193
|
type: string;
|
|
194
|
+
value: any;
|
|
151
195
|
}
|
|
152
196
|
/**
|
|
153
197
|
* @interface IOrderProductData
|
|
154
198
|
*
|
|
155
199
|
* @property {number} productId - Product identifier. Example: 1.
|
|
156
200
|
* @property {number} quantity - Quantity of the product. Example: 2.
|
|
157
|
-
*
|
|
158
201
|
* @description Represents a product data in an order.
|
|
159
202
|
*/
|
|
160
203
|
interface IOrderProductData {
|
|
@@ -165,65 +208,92 @@ interface IOrderProductData {
|
|
|
165
208
|
* @interface IBaseOrdersEntity
|
|
166
209
|
*
|
|
167
210
|
* @property {number} id - Object identifier. Example: 1.
|
|
168
|
-
* @property {string} formIdentifier - Text identifier of the form
|
|
211
|
+
* @property {string} formIdentifier - Text identifier of the form. Example: "bar-orders-form".
|
|
169
212
|
* @property {string} paymentAccountIdentifier - Text identifier of the order payment. Example: "payment-1".
|
|
170
|
-
* @property {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
213
|
+
* @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store. Example:
|
|
214
|
+
[
|
|
215
|
+
{
|
|
216
|
+
"marker": "name_1",
|
|
217
|
+
"value": "Name",
|
|
218
|
+
"type": "string"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
* @property {IOrderProducts[]} products - Array of products added to order. Example:
|
|
222
|
+
[
|
|
223
|
+
{
|
|
224
|
+
"id": 2957,
|
|
225
|
+
"title": "Cosmo",
|
|
226
|
+
"sku": null,
|
|
227
|
+
"previewImage": null,
|
|
228
|
+
"price": 150,
|
|
229
|
+
"quantity": 2
|
|
230
|
+
}
|
|
231
|
+
]
|
|
174
232
|
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
233
|
+
* @property {number} totalSum - Total order amount. Example: "99.99".
|
|
234
|
+
* @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
|
|
175
235
|
* @property {string} [statusIdentifier] - Text identifier of order status object (if not set, default status will be assigned). Example: "status-1".
|
|
176
236
|
*/
|
|
177
237
|
interface IBaseOrdersEntity {
|
|
178
238
|
id: number;
|
|
179
239
|
formIdentifier: string;
|
|
180
240
|
paymentAccountIdentifier: string;
|
|
181
|
-
formData:
|
|
182
|
-
products:
|
|
183
|
-
createdDate?: string;
|
|
184
|
-
totalSum: number;
|
|
241
|
+
formData: IOrdersFormData[];
|
|
242
|
+
products: IOrderProductData[];
|
|
185
243
|
currency: string;
|
|
244
|
+
totalSum: number;
|
|
245
|
+
createdDate?: string;
|
|
186
246
|
statusIdentifier?: string;
|
|
187
247
|
}
|
|
188
248
|
/**
|
|
189
249
|
* @interface IBaseOrdersEntityResponse
|
|
190
250
|
*
|
|
191
|
-
* @property {
|
|
251
|
+
* @property {IBaseOrdersEntity[]} items - Array of order storage objects. Example:
|
|
252
|
+
[
|
|
253
|
+
{
|
|
254
|
+
"id": 2957,
|
|
255
|
+
"title": "Cosmo",
|
|
256
|
+
"sku": null,
|
|
257
|
+
"previewImage": null,
|
|
258
|
+
"price": 150,
|
|
259
|
+
"quantity": 2
|
|
260
|
+
}
|
|
261
|
+
]
|
|
192
262
|
* @property {string | number} total - Total number of found records. Example: 100.
|
|
193
|
-
*
|
|
194
263
|
* @description Represents a response from the order storage.
|
|
195
264
|
*/
|
|
196
265
|
interface IBaseOrdersEntityResponse {
|
|
197
|
-
items:
|
|
266
|
+
items: IBaseOrdersEntity[];
|
|
198
267
|
total: string | number;
|
|
199
268
|
}
|
|
200
269
|
/**
|
|
201
270
|
* @interface IOrdersEntity
|
|
202
271
|
*
|
|
203
272
|
* @property {number} id - Object identifier. Example: 1.
|
|
204
|
-
* @property {
|
|
273
|
+
* @property {ILocalizeInfo} localizeInfos - Name considering localization. Example:
|
|
274
|
+
{
|
|
275
|
+
"title": "Cash"
|
|
276
|
+
}
|
|
277
|
+
* @property {number | null} position - Position in orders storage. Example: 1.
|
|
205
278
|
* @property {string} identifier - Textual identifier for the record field. Example: "order_storage_1".
|
|
206
|
-
* @property {number | null} generalTypeId - Type identifier. Example: 1
|
|
207
279
|
* @property {string} formIdentifier - Textual identifier for the form used by the order storage. Example: "bar-orders-form".
|
|
208
|
-
* @property {
|
|
209
|
-
* @property {
|
|
210
|
-
*
|
|
280
|
+
* @property {number | null} generalTypeId - Type identifier. Example: 1.
|
|
281
|
+
* @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage. Example: [{ "identifier": "payment-1" }].
|
|
211
282
|
* @description Represents an order storage object.
|
|
212
283
|
*/
|
|
213
284
|
interface IOrdersEntity {
|
|
214
285
|
id: number;
|
|
215
|
-
localizeInfos:
|
|
286
|
+
localizeInfos: ILocalizeInfo;
|
|
287
|
+
position: number | null;
|
|
216
288
|
identifier: string | null;
|
|
217
|
-
generalTypeId: number | null;
|
|
218
289
|
formIdentifier: string | null;
|
|
219
|
-
|
|
220
|
-
|
|
290
|
+
generalTypeId: number | null;
|
|
291
|
+
paymentAccountIdentifiers: IPaymentAccountIdentifiers[];
|
|
221
292
|
}
|
|
222
293
|
/**
|
|
223
294
|
* @interface IPaymentAccountIdentifiers
|
|
224
295
|
*
|
|
225
296
|
* @property {string} identifier - Textual identifier of the payment account. Example: "payment-1".
|
|
226
|
-
*
|
|
227
297
|
* @description Represents an identifier for a payment account used in an order.
|
|
228
298
|
*/
|
|
229
299
|
interface IPaymentAccountIdentifiers {
|
|
@@ -234,49 +304,61 @@ interface IPaymentAccountIdentifiers {
|
|
|
234
304
|
*
|
|
235
305
|
* @property {string} formIdentifier - Text identifier of the form object linked to the order repository. Example: "bar-orders-form".
|
|
236
306
|
* @property {string} paymentAccountIdentifier - Text identifier of the payment object linked to the order repository. Example: "payment-1".
|
|
237
|
-
* @property {IOrdersFormData |
|
|
238
|
-
|
|
239
|
-
|
|
307
|
+
* @property {IOrdersFormData | IOrdersFormData[]} formData - Form data linked to the order repository. Example:
|
|
308
|
+
[
|
|
309
|
+
{
|
|
310
|
+
"marker": "name_1",
|
|
311
|
+
"value": "Name",
|
|
312
|
+
"type": "string"
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
* @property {IOrderProductData[]} products - An array of ordered products. Example: .
|
|
240
316
|
* @description Represents the data required to create or update an order in the order storage.
|
|
241
317
|
*/
|
|
242
318
|
interface IOrderData {
|
|
243
319
|
formIdentifier: string;
|
|
244
320
|
paymentAccountIdentifier: string;
|
|
245
|
-
formData: IOrdersFormData |
|
|
246
|
-
products:
|
|
321
|
+
formData: IOrdersFormData | IOrdersFormData[];
|
|
322
|
+
products: IOrderProductData[];
|
|
247
323
|
}
|
|
248
324
|
/**
|
|
249
325
|
* @interface IOrderByMarkerEntity
|
|
250
326
|
*
|
|
251
|
-
* @property {
|
|
252
|
-
* @property {
|
|
253
|
-
* @property {string}
|
|
254
|
-
* @property {
|
|
255
|
-
* @property {
|
|
327
|
+
* @property {number} id - Object identifier. Example: 125.
|
|
328
|
+
* @property {number} storageId - Identifier of the order storage object. Example: 1.
|
|
329
|
+
* @property {string} createdDate - Date when the order was created. Example: "2023-10-01T12:00:00Z".
|
|
330
|
+
* @property {string} [statusIdentifier] - Text identifier of the order status. Example: "order-status-1".
|
|
331
|
+
* @property {string} [formIdentifier] - Text identifier of the form. Example: "bar-orders-form".
|
|
332
|
+
* @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store. Example:
|
|
333
|
+
[
|
|
334
|
+
{
|
|
335
|
+
"marker": "order_name",
|
|
336
|
+
"value": "Ivan",
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
* @property {string | null} [attributeSetIdentifier] - Text identifier of the attribute set. Example: "attribute-set-1".
|
|
256
341
|
* @property {string} totalSum - Total order amount. Example: "100.00".
|
|
257
342
|
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
258
|
-
* @property {string}
|
|
259
|
-
* @property {string} paymentAccountIdentifier - Textual identifier for the order payment. Example: "payment-1".
|
|
343
|
+
* @property {string | null} [paymentAccountIdentifier] - Textual identifier for the order payment. Example: "payment-1".
|
|
260
344
|
* @property {Record<string, any>} paymentAccountLocalizeInfos - Payment account name considering localization. Example: { "en_US": "USD Payment", "ru_RU": "Оплата в долларах США" }.
|
|
261
|
-
* @property {
|
|
262
|
-
* @property {number} storageId - Identifier of the order storage object. Example: 1.
|
|
345
|
+
* @property {IOrderProducts[]} products - Array of products added to order. Example: [{ "id": 1, "name": "Product 1", "quantity": 2 }].
|
|
263
346
|
* @property {boolean} isCompleted - Indicates that the order has been completed. Example: true.
|
|
264
|
-
*
|
|
265
347
|
* @description Represents an order storage object created by the user.
|
|
266
348
|
*/
|
|
267
349
|
interface IOrderByMarkerEntity {
|
|
350
|
+
id: number;
|
|
351
|
+
storageId: number;
|
|
352
|
+
createdDate: string;
|
|
353
|
+
statusIdentifier?: string;
|
|
354
|
+
formIdentifier?: string;
|
|
355
|
+
formData: IOrdersFormData[];
|
|
268
356
|
attributeSetIdentifier?: string;
|
|
269
|
-
statusIdentifier: string;
|
|
270
|
-
formIdentifier: string;
|
|
271
|
-
formData: Array<IOrdersFormData>;
|
|
272
|
-
products: Array<IOrderProducts>;
|
|
273
357
|
totalSum: string;
|
|
274
358
|
currency: string;
|
|
275
|
-
|
|
276
|
-
paymentAccountIdentifier: string;
|
|
359
|
+
paymentAccountIdentifier?: string;
|
|
277
360
|
paymentAccountLocalizeInfos?: Record<string, any>;
|
|
278
|
-
|
|
279
|
-
storageId: number;
|
|
361
|
+
products: IOrderProducts[];
|
|
280
362
|
isCompleted: boolean;
|
|
281
363
|
}
|
|
282
364
|
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, IOrderByMarkerEntity, IOrderData, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IPaymentAccountIdentifiers, IPicture, };
|