oneentry 1.0.138 → 1.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/configure.js +40 -21
- package/package.json +15 -12
- package/dist/admins/adminsApi.d.ts +0 -50
- package/dist/admins/adminsApi.js +0 -65
- package/dist/admins/adminsInterfaces.d.ts +0 -99
- package/dist/admins/adminsInterfaces.js +0 -2
- package/dist/admins/adminsSchemas.d.ts +0 -30
- package/dist/admins/adminsSchemas.js +0 -27
- package/dist/attribute-sets/attributeSetsApi.d.ts +0 -63
- package/dist/attribute-sets/attributeSetsApi.js +0 -98
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +0 -187
- package/dist/attribute-sets/attributeSetsInterfaces.js +0 -2
- package/dist/attribute-sets/attributeSetsSchemas.d.ts +0 -90
- package/dist/attribute-sets/attributeSetsSchemas.js +0 -74
- package/dist/auth-provider/authProviderApi.d.ts +0 -249
- package/dist/auth-provider/authProviderApi.js +0 -351
- package/dist/auth-provider/authProviderSchemas.d.ts +0 -137
- package/dist/auth-provider/authProviderSchemas.js +0 -85
- package/dist/auth-provider/authProvidersInterfaces.d.ts +0 -417
- package/dist/auth-provider/authProvidersInterfaces.js +0 -2
- package/dist/base/asyncModules.d.ts +0 -80
- package/dist/base/asyncModules.js +0 -440
- package/dist/base/result.d.ts +0 -39
- package/dist/base/result.js +0 -154
- package/dist/base/stateModule.d.ts +0 -41
- package/dist/base/stateModule.js +0 -128
- package/dist/base/syncModules.d.ts +0 -148
- package/dist/base/syncModules.js +0 -530
- package/dist/base/utils.d.ts +0 -197
- package/dist/base/utils.js +0 -2
- package/dist/base/validation.d.ts +0 -118
- package/dist/base/validation.js +0 -132
- package/dist/blocks/blocksApi.d.ts +0 -74
- package/dist/blocks/blocksApi.js +0 -184
- package/dist/blocks/blocksInterfaces.d.ts +0 -173
- package/dist/blocks/blocksInterfaces.js +0 -2
- package/dist/blocks/blocksSchemas.d.ts +0 -187
- package/dist/blocks/blocksSchemas.js +0 -43
- package/dist/events/eventsApi.d.ts +0 -60
- package/dist/events/eventsApi.js +0 -97
- package/dist/events/eventsInterfaces.d.ts +0 -87
- package/dist/events/eventsInterfaces.js +0 -2
- package/dist/file-uploading/fileUploadingApi.d.ts +0 -88
- package/dist/file-uploading/fileUploadingApi.js +0 -132
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +0 -117
- package/dist/file-uploading/fileUploadingInterfaces.js +0 -2
- package/dist/file-uploading/fileUploadingSchemas.d.ts +0 -22
- package/dist/file-uploading/fileUploadingSchemas.js +0 -21
- package/dist/forms/formsApi.d.ts +0 -42
- package/dist/forms/formsApi.js +0 -57
- package/dist/forms/formsInterfaces.d.ts +0 -132
- package/dist/forms/formsInterfaces.js +0 -2
- package/dist/forms/formsSchemas.d.ts +0 -65
- package/dist/forms/formsSchemas.js +0 -36
- package/dist/forms-data/formsDataApi.d.ts +0 -106
- package/dist/forms-data/formsDataApi.js +0 -189
- package/dist/forms-data/formsDataInterfaces.d.ts +0 -525
- package/dist/forms-data/formsDataInterfaces.js +0 -2
- package/dist/forms-data/formsDataSchemas.d.ts +0 -115
- package/dist/forms-data/formsDataSchemas.js +0 -86
- package/dist/general-types/generalTypesApi.d.ts +0 -28
- package/dist/general-types/generalTypesApi.js +0 -38
- package/dist/general-types/generalTypesInterfaces.d.ts +0 -30
- package/dist/general-types/generalTypesInterfaces.js +0 -2
- package/dist/general-types/generalTypesSchemas.d.ts +0 -50
- package/dist/general-types/generalTypesSchemas.js +0 -35
- package/dist/index.d.ts +0 -94
- package/dist/index.js +0 -97
- package/dist/integration-collections/integrationCollectionsApi.d.ts +0 -173
- package/dist/integration-collections/integrationCollectionsApi.js +0 -220
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +0 -313
- package/dist/integration-collections/integrationCollectionsInterfaces.js +0 -2
- package/dist/integration-collections/integrationCollectionsSchemas.d.ts +0 -84
- package/dist/integration-collections/integrationCollectionsSchemas.js +0 -63
- package/dist/locales/localesApi.d.ts +0 -27
- package/dist/locales/localesApi.js +0 -37
- package/dist/locales/localesInterfaces.d.ts +0 -41
- package/dist/locales/localesInterfaces.js +0 -2
- package/dist/locales/localesSchemas.d.ts +0 -32
- package/dist/locales/localesSchemas.js +0 -26
- package/dist/menus/menusApi.d.ts +0 -29
- package/dist/menus/menusApi.js +0 -39
- package/dist/menus/menusInterfaces.d.ts +0 -88
- package/dist/menus/menusInterfaces.js +0 -4
- package/dist/menus/menusSchemas.d.ts +0 -16
- package/dist/menus/menusSchemas.js +0 -28
- package/dist/orders/ordersApi.d.ts +0 -126
- package/dist/orders/ordersApi.js +0 -169
- package/dist/orders/ordersInterfaces.d.ts +0 -427
- package/dist/orders/ordersInterfaces.js +0 -2
- package/dist/orders/ordersSchemas.d.ts +0 -158
- package/dist/orders/ordersSchemas.js +0 -120
- package/dist/pages/pagesApi.d.ts +0 -151
- package/dist/pages/pagesApi.js +0 -390
- package/dist/pages/pagesInterfaces.d.ts +0 -292
- package/dist/pages/pagesInterfaces.js +0 -2
- package/dist/pages/pagesSchemas.d.ts +0 -85
- package/dist/pages/pagesSchemas.js +0 -46
- package/dist/payments/paymentsApi.d.ts +0 -82
- package/dist/payments/paymentsApi.js +0 -121
- package/dist/payments/paymentsInterfaces.d.ts +0 -206
- package/dist/payments/paymentsInterfaces.js +0 -2
- package/dist/payments/paymentsSchemas.d.ts +0 -137
- package/dist/payments/paymentsSchemas.js +0 -78
- package/dist/product-statuses/productStatusesApi.d.ts +0 -47
- package/dist/product-statuses/productStatusesApi.js +0 -70
- package/dist/product-statuses/productStatusesInterfaces.d.ts +0 -66
- package/dist/product-statuses/productStatusesInterfaces.js +0 -2
- package/dist/product-statuses/productStatusesSchemas.d.ts +0 -34
- package/dist/product-statuses/productStatusesSchemas.js +0 -30
- package/dist/products/productsApi.d.ts +0 -365
- package/dist/products/productsApi.js +0 -464
- package/dist/products/productsInterfaces.d.ts +0 -583
- package/dist/products/productsInterfaces.js +0 -2
- package/dist/products/productsSchemas.d.ts +0 -212
- package/dist/products/productsSchemas.js +0 -85
- package/dist/system/systemApi.d.ts +0 -65
- package/dist/system/systemApi.js +0 -82
- package/dist/system/systemInterfaces.d.ts +0 -23
- package/dist/system/systemInterfaces.js +0 -2
- package/dist/templates/templatesApi.d.ts +0 -49
- package/dist/templates/templatesApi.js +0 -75
- package/dist/templates/templatesInterfaces.d.ts +0 -70
- package/dist/templates/templatesInterfaces.js +0 -2
- package/dist/templates/templatesSchemas.d.ts +0 -48
- package/dist/templates/templatesSchemas.js +0 -31
- package/dist/templates-preview/templatesPreviewApi.d.ts +0 -38
- package/dist/templates-preview/templatesPreviewApi.js +0 -53
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -121
- package/dist/templates-preview/templatesPreviewInterfaces.js +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -83
- package/dist/templates-preview/templatesPreviewSchemas.js +0 -48
- package/dist/users/usersApi.d.ts +0 -143
- package/dist/users/usersApi.js +0 -174
- package/dist/users/usersInterfaces.d.ts +0 -235
- package/dist/users/usersInterfaces.js +0 -2
- package/dist/users/usersSchemas.d.ts +0 -38
- package/dist/users/usersSchemas.js +0 -28
- package/dist/web-socket/wsApi.d.ts +0 -25
- package/dist/web-socket/wsApi.js +0 -45
- package/dist/web-socket/wsInterfaces.d.ts +0 -17
- package/dist/web-socket/wsInterfaces.js +0 -2
package/dist/orders/ordersApi.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
-
const ordersSchemas_1 = require("./ordersSchemas");
|
|
8
|
-
/**
|
|
9
|
-
* Controllers for working with orders.
|
|
10
|
-
* @handle /api/content/orders-storage
|
|
11
|
-
* @module OrdersApi
|
|
12
|
-
* @description This module provides methods for working with orders, including retrieving, creating, and updating orders in the order storage.
|
|
13
|
-
*/
|
|
14
|
-
class OrdersApi extends asyncModules_1.default {
|
|
15
|
-
/**
|
|
16
|
-
* Constructs an instance of the OrdersApi class.
|
|
17
|
-
* @param {StateModule} state - The state module containing the necessary information for making API calls.
|
|
18
|
-
* @description Constructor initializes the OrdersApi with a given state.
|
|
19
|
-
*/
|
|
20
|
-
constructor(state) {
|
|
21
|
-
super(state);
|
|
22
|
-
this._url = state.url + '/api/content/orders-storage';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Getting all the order storage objects.
|
|
26
|
-
* @handleName getAllOrdersStorage
|
|
27
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
28
|
-
* @param {number} [offset] - Optional parameter for pagination. Default: 0.
|
|
29
|
-
* @param {number} [limit] - Optional parameter for pagination. Default: 30.
|
|
30
|
-
* @returns {Promise<IOrdersEntity[] | IError>} Returns an array of order storage objects.
|
|
31
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
32
|
-
* @description This method requires user authorization.
|
|
33
|
-
* @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}.
|
|
34
|
-
*/
|
|
35
|
-
async getAllOrdersStorage(langCode = this.state.lang, offset = 0, limit = 30) {
|
|
36
|
-
const result = await this._fetchGet(`?langCode=${langCode}&limit=${limit}&offset=${offset}`);
|
|
37
|
-
return this._normalizeData(result);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Getting all orders from the orders storage object created by the user.
|
|
41
|
-
* @handleName getAllOrdersByMarker
|
|
42
|
-
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
43
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
44
|
-
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
45
|
-
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
46
|
-
* @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with the orders.
|
|
47
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
48
|
-
* @description This method requires user authorization.
|
|
49
|
-
* @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}.
|
|
50
|
-
*/
|
|
51
|
-
async getAllOrdersByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
52
|
-
const result = await this._fetchGet(`/marker/${marker}/orders?langCode=${langCode}&limit=${limit}&offset=${offset}`);
|
|
53
|
-
// Validate response if validation is enabled
|
|
54
|
-
const validated = this._validateResponse(result, ordersSchemas_1.OrdersResponseSchema);
|
|
55
|
-
return this._normalizeData(validated);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Retrieve one order storage object by marker.
|
|
59
|
-
* @handleName getOrderByMarker
|
|
60
|
-
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
61
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
62
|
-
* @returns {Promise<IOrdersEntity | IError>} Return object of order information.
|
|
63
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
64
|
-
* @description This method requires user authorization.
|
|
65
|
-
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
66
|
-
*/
|
|
67
|
-
async getOrderByMarker(marker, langCode = this.state.lang) {
|
|
68
|
-
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
69
|
-
return this._normalizeData(result);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Getting a single order from the order storage object created by the user.
|
|
73
|
-
* @handleName getOrderByMarkerAndId
|
|
74
|
-
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
75
|
-
* @param {number} id - ID of the order object. Example: 12345.
|
|
76
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
77
|
-
* @returns {Promise<IOrderByMarkerEntity | IError>} Returns an object with the order.
|
|
78
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
79
|
-
* @description This method requires user authorization.
|
|
80
|
-
* @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}.
|
|
81
|
-
*/
|
|
82
|
-
async getOrderByMarkerAndId(marker, id, langCode = this.state.lang) {
|
|
83
|
-
const result = await this._fetchGet(`/marker/${marker}/orders/${id}?langCode=${langCode}`);
|
|
84
|
-
// Validate response if validation is enabled
|
|
85
|
-
const validated = this._validateResponse(result, ordersSchemas_1.OrderEntitySchema);
|
|
86
|
-
return this._normalizeData(validated);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Creation of an order in the order storage.
|
|
90
|
-
* @handleName createOrder
|
|
91
|
-
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
92
|
-
* @param {IOrderData} body - Object for creating an order.
|
|
93
|
-
* @example
|
|
94
|
-
{
|
|
95
|
-
"formIdentifier": "bar-orders-form",
|
|
96
|
-
"paymentAccountIdentifier": "usd-payment",
|
|
97
|
-
"formData": {
|
|
98
|
-
"marker": "name_1",
|
|
99
|
-
"value": "Name",
|
|
100
|
-
"type": "string"
|
|
101
|
-
},
|
|
102
|
-
"products": [
|
|
103
|
-
{
|
|
104
|
-
"productId": 1,
|
|
105
|
-
"quantity": 2
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
110
|
-
* @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the created order.
|
|
111
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
112
|
-
* @description This method requires user authorization.
|
|
113
|
-
* @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}.
|
|
114
|
-
*/
|
|
115
|
-
async createOrder(marker, body, langCode = this.state.lang) {
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
117
|
-
const formData = {};
|
|
118
|
-
formData[langCode] = Array.isArray(body.formData)
|
|
119
|
-
? body.formData
|
|
120
|
-
: [body.formData];
|
|
121
|
-
body.formData = formData;
|
|
122
|
-
const result = await this._fetchPost(`/marker/${marker}/orders`, body);
|
|
123
|
-
// Validate response if validation is enabled
|
|
124
|
-
const validated = this._validateResponse(result, ordersSchemas_1.CreateOrderResponseSchema);
|
|
125
|
-
return this._normalizeData(validated);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Changing an order in the orders storage
|
|
129
|
-
* @handleName updateOrderByMarkerAndId
|
|
130
|
-
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
131
|
-
* @param {number} id - ID of the order object. Example: 12345.
|
|
132
|
-
* @param {IOrderData} body - Object for updating an order.
|
|
133
|
-
* @example
|
|
134
|
-
{
|
|
135
|
-
"formIdentifier": "bar-orders-form",
|
|
136
|
-
"paymentAccountIdentifier": "usd-payment",
|
|
137
|
-
"formData": {
|
|
138
|
-
"marker": "name_1",
|
|
139
|
-
"value": "Name",
|
|
140
|
-
"type": "string"
|
|
141
|
-
},
|
|
142
|
-
"products": [
|
|
143
|
-
{
|
|
144
|
-
"productId": 1,
|
|
145
|
-
"quantity": 2
|
|
146
|
-
}
|
|
147
|
-
],
|
|
148
|
-
"currency": "USD"
|
|
149
|
-
}
|
|
150
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
151
|
-
* @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the updated order.
|
|
152
|
-
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
153
|
-
* @description This method requires user authorization.
|
|
154
|
-
* @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}.
|
|
155
|
-
*/
|
|
156
|
-
async updateOrderByMarkerAndId(marker, id, body, langCode = this.state.lang) {
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
|
-
const formData = {};
|
|
159
|
-
formData[langCode] = Array.isArray(body.formData)
|
|
160
|
-
? body.formData
|
|
161
|
-
: [body.formData];
|
|
162
|
-
body.formData = formData;
|
|
163
|
-
const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, body);
|
|
164
|
-
// Validate response if validation is enabled
|
|
165
|
-
const validated = this._validateResponse(result, ordersSchemas_1.UpdateOrderResponseSchema);
|
|
166
|
-
return this._normalizeData(validated);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
exports.default = OrdersApi;
|
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
|
-
/**
|
|
3
|
-
* @interface IOrdersApi
|
|
4
|
-
* @property {Function} getOrderByMarker - Retrieve one order storage object by marker.
|
|
5
|
-
* @property {Function} createOrder - Creation of an order in the order storage.
|
|
6
|
-
* @property {Function} updateOrderByMarkerAndId - Changing an order in the order store.
|
|
7
|
-
* @property {Function} getOrderByMarkerAndId - Getting a single order from the order storage object created by the user.
|
|
8
|
-
* @property {Function} getAllOrders - Getting all the order storage objects.
|
|
9
|
-
* @property {Function} getAllOrdersByMarker - Getting one order storage object by marker.
|
|
10
|
-
* @property {Function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
|
|
11
|
-
* @description Represents the API for managing orders in the order storage.
|
|
12
|
-
*/
|
|
13
|
-
interface IOrdersApi {
|
|
14
|
-
/**
|
|
15
|
-
* Getting all the order storage objects.
|
|
16
|
-
* @handleName getAllOrdersStorage
|
|
17
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
18
|
-
* @param {number} [offset] - Optional parameter for pagination. Default: 0.
|
|
19
|
-
* @param {number} [limit] - Optional parameter for pagination. Default: 30.
|
|
20
|
-
* @returns {Promise<IOrdersEntity[] | IError>} Returns an array of order storage objects.
|
|
21
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
22
|
-
* @description This method gets all the order storage objects. This method requires user authorization.
|
|
23
|
-
* @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}.
|
|
24
|
-
*/
|
|
25
|
-
getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
|
|
26
|
-
/**
|
|
27
|
-
* Getting all orders from the orders storage object created by the user.
|
|
28
|
-
* @handleName getAllOrdersByMarker
|
|
29
|
-
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
30
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
31
|
-
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
32
|
-
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
33
|
-
* @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with the orders.
|
|
34
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
35
|
-
* @description This method gets all orders from the orders storage object created by the user. This method requires user authorization.
|
|
36
|
-
* @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}.
|
|
37
|
-
*/
|
|
38
|
-
getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
|
|
39
|
-
/**
|
|
40
|
-
* Retrieve one order storage object by marker.
|
|
41
|
-
* @handleName getOrderByMarker
|
|
42
|
-
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
43
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
44
|
-
* @returns {Promise<IOrdersEntity | IError>} Return object of order information.
|
|
45
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
46
|
-
* @description This method retrieves one order storage object by marker. This method requires user authorization.
|
|
47
|
-
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
48
|
-
*/
|
|
49
|
-
getOrderByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
|
|
50
|
-
/**
|
|
51
|
-
* Getting a single order from the order storage object created by the user.
|
|
52
|
-
* @handleName getOrderByMarkerAndId
|
|
53
|
-
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
54
|
-
* @param {number} id - ID of the order object. Example: 12345.
|
|
55
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
56
|
-
* @returns {Promise<IOrderByMarkerEntity | IError>} Returns an object with the order.
|
|
57
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
58
|
-
* @description This method gets a single order from the order storage object created by the user. This method requires user authorization.
|
|
59
|
-
* @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}.
|
|
60
|
-
*/
|
|
61
|
-
getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrderByMarkerEntity | IError>;
|
|
62
|
-
/**
|
|
63
|
-
* Creation of an order in the order storage.
|
|
64
|
-
* @handleName createOrder
|
|
65
|
-
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
66
|
-
* @param {IOrderData} body - Object for creating an order.
|
|
67
|
-
* @example
|
|
68
|
-
{
|
|
69
|
-
"formIdentifier": "bar-orders-form",
|
|
70
|
-
"paymentAccountIdentifier": "usd-payment",
|
|
71
|
-
"formData": {
|
|
72
|
-
"marker": "name_1",
|
|
73
|
-
"value": "Name",
|
|
74
|
-
"type": "string"
|
|
75
|
-
},
|
|
76
|
-
"products": [
|
|
77
|
-
{
|
|
78
|
-
"productId": 1,
|
|
79
|
-
"quantity": 2
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
84
|
-
* @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the created order.
|
|
85
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
86
|
-
* @description This method requires user authorization.
|
|
87
|
-
* @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}.
|
|
88
|
-
*/
|
|
89
|
-
createOrder(marker: string, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
90
|
-
/**
|
|
91
|
-
* Changing an order in the orders storage
|
|
92
|
-
* @handleName updateOrderByMarkerAndId
|
|
93
|
-
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
94
|
-
* @param {number} id - ID of the order object. Example: 12345.
|
|
95
|
-
* @param {IOrderData} body - Object for updating an order.
|
|
96
|
-
* @example
|
|
97
|
-
{
|
|
98
|
-
"formIdentifier": "bar-orders-form",
|
|
99
|
-
"paymentAccountIdentifier": "usd-payment",
|
|
100
|
-
"formData": {
|
|
101
|
-
"marker": "name_1",
|
|
102
|
-
"value": "Name",
|
|
103
|
-
"type": "string"
|
|
104
|
-
},
|
|
105
|
-
"products": [
|
|
106
|
-
{
|
|
107
|
-
"productId": 1,
|
|
108
|
-
"quantity": 2
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
"currency": "USD"
|
|
112
|
-
}
|
|
113
|
-
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
114
|
-
* @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the updated order.
|
|
115
|
-
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
116
|
-
* @description This method requires user authorization.
|
|
117
|
-
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
118
|
-
*/
|
|
119
|
-
updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Interface for the orders storage object.
|
|
123
|
-
* @interface IOrdersByMarkerEntity
|
|
124
|
-
* @property {IOrderByMarkerEntity[]} items - Array of order storage objects.
|
|
125
|
-
* @example
|
|
126
|
-
[
|
|
127
|
-
{
|
|
128
|
-
"id": 55,
|
|
129
|
-
"storageId": 1,
|
|
130
|
-
"createdDate": "2025-03-22T21:12:42.371Z",
|
|
131
|
-
"statusIdentifier": "inProgress",
|
|
132
|
-
"formIdentifier": "orderForm",
|
|
133
|
-
"formData": [
|
|
134
|
-
{
|
|
135
|
-
"marker": "order_name",
|
|
136
|
-
"value": "Ivan",
|
|
137
|
-
"type": "string"
|
|
138
|
-
}
|
|
139
|
-
],
|
|
140
|
-
"attributeSetIdentifier": "order_form",
|
|
141
|
-
"totalSum": "300.00",
|
|
142
|
-
"currency": "",
|
|
143
|
-
"paymentAccountIdentifier": "cash",
|
|
144
|
-
"paymentAccountLocalizeInfos": {
|
|
145
|
-
"title": "Cash"
|
|
146
|
-
},
|
|
147
|
-
"products": [
|
|
148
|
-
{
|
|
149
|
-
"id": 2957,
|
|
150
|
-
"title": "Cosmo",
|
|
151
|
-
"sku": null,
|
|
152
|
-
"previewImage": null,
|
|
153
|
-
"price": 150,
|
|
154
|
-
"quantity": 2
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
"isCompleted": false
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
* @property {number} total - Total number of found records. Example: 100.
|
|
161
|
-
* @description Represents a response from the order storage by marker.
|
|
162
|
-
*/
|
|
163
|
-
interface IOrdersByMarkerEntity {
|
|
164
|
-
total: number;
|
|
165
|
-
items: IOrderByMarkerEntity[];
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Interface representing a picture entity.
|
|
169
|
-
* @interface IPicture
|
|
170
|
-
* @property {string} filename - The name of the file. Example: "image.jpg".
|
|
171
|
-
* @property {string} downloadLink - The URL link to download the picture. Example: "https://example.com/image.jpg".
|
|
172
|
-
* @property {number} size - The size of the picture in bytes. Example: 102400.
|
|
173
|
-
* @property {string} previewLink - The URL link to preview the picture. Example: "https://example.com/image-preview.jpg".
|
|
174
|
-
* @description This interface defines the structure for a picture entity, including its filename, download link, size, and preview link.
|
|
175
|
-
*/
|
|
176
|
-
interface IPicture {
|
|
177
|
-
filename: string;
|
|
178
|
-
downloadLink: string;
|
|
179
|
-
size: number;
|
|
180
|
-
previewLink: string;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Interface representing a product in an order.
|
|
184
|
-
* @interface IOrderProducts
|
|
185
|
-
* @property {number} id - Product id. Example: 2957.
|
|
186
|
-
* @property {number} quantity - Product quantity. Example: 1.
|
|
187
|
-
* @property {string} title - Product title. Example: "Cosmo".
|
|
188
|
-
* @property {string | null} sku - Product sku. Example: "SKU".
|
|
189
|
-
* @property {any} previewImage - Product previewImage.
|
|
190
|
-
* @example
|
|
191
|
-
{
|
|
192
|
-
"filename": "image.jpg",
|
|
193
|
-
"downloadLink": "https://example.com/image.jpg",
|
|
194
|
-
"size": 102400,
|
|
195
|
-
"previewLink": "https://example.com/image-preview.jpg"
|
|
196
|
-
}
|
|
197
|
-
* @property {number} price - Product price. Example: 150.
|
|
198
|
-
* @description Represents a product in an order.
|
|
199
|
-
*/
|
|
200
|
-
interface IOrderProducts {
|
|
201
|
-
id: number;
|
|
202
|
-
quantity: number;
|
|
203
|
-
title: string;
|
|
204
|
-
sku: string | null;
|
|
205
|
-
previewImage: any;
|
|
206
|
-
price: number;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Interface representing form data for orders.
|
|
210
|
-
* @interface IOrdersFormData
|
|
211
|
-
* @property {string} marker - Marker of form field. Example: "name_1".
|
|
212
|
-
* @property {string} type - Type of value. Example: "string".
|
|
213
|
-
* @property {string} value - Value. Example: "Name".
|
|
214
|
-
* @description Represents a form data for orders.
|
|
215
|
-
*/
|
|
216
|
-
interface IOrdersFormData {
|
|
217
|
-
marker: string;
|
|
218
|
-
type: string;
|
|
219
|
-
value: any;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Interface representing product data in an order.
|
|
223
|
-
* @interface IOrderProductData
|
|
224
|
-
* @property {number} productId - Product identifier. Example: 1.
|
|
225
|
-
* @property {number} quantity - Quantity of the product. Example: 2.
|
|
226
|
-
* @description Represents a product data in an order.
|
|
227
|
-
*/
|
|
228
|
-
interface IOrderProductData {
|
|
229
|
-
productId: number;
|
|
230
|
-
quantity: number;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Interface representing product data in an order.
|
|
234
|
-
* @interface IOrderProductsData
|
|
235
|
-
* @property {number} productId - Product identifier. Example: 1.
|
|
236
|
-
* @property {number} quantity - Quantity of the product. Example: 2.
|
|
237
|
-
* @description Represents a product data in an order.
|
|
238
|
-
*/
|
|
239
|
-
interface IOrderProductsData {
|
|
240
|
-
productId: number;
|
|
241
|
-
quantity: number;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Interface representing an order storage object.
|
|
245
|
-
* @interface IBaseOrdersEntity
|
|
246
|
-
* @property {number} id - Object identifier. Example: 1.
|
|
247
|
-
* @property {string} formIdentifier - Text identifier of the form. Example: "bar-orders-form".
|
|
248
|
-
* @property {string} paymentAccountIdentifier - Text identifier of the order payment. Example: "payment-1".
|
|
249
|
-
* @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store.
|
|
250
|
-
* @example
|
|
251
|
-
[
|
|
252
|
-
{
|
|
253
|
-
"marker": "name_1",
|
|
254
|
-
"value": "Name",
|
|
255
|
-
"type": "string"
|
|
256
|
-
}
|
|
257
|
-
]
|
|
258
|
-
* @property {IOrderProductsData[]} products - Array of products added to order.
|
|
259
|
-
* @example
|
|
260
|
-
[
|
|
261
|
-
{
|
|
262
|
-
"id": 2957,
|
|
263
|
-
"title": "Cosmo",
|
|
264
|
-
"sku": null,
|
|
265
|
-
"previewImage": null,
|
|
266
|
-
"price": 150,
|
|
267
|
-
"quantity": 2
|
|
268
|
-
}
|
|
269
|
-
]
|
|
270
|
-
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
271
|
-
* @property {number} totalSum - Total order amount. Example: "150".
|
|
272
|
-
* @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
|
|
273
|
-
* @property {string} [statusIdentifier] - Text identifier of order status object (if not set, default status will be assigned). Example: "status-1".
|
|
274
|
-
*/
|
|
275
|
-
interface IBaseOrdersEntity {
|
|
276
|
-
id: number;
|
|
277
|
-
formIdentifier: string;
|
|
278
|
-
paymentAccountIdentifier: string;
|
|
279
|
-
formData: IOrdersFormData[];
|
|
280
|
-
products: IOrderProductsData[];
|
|
281
|
-
currency: string;
|
|
282
|
-
totalSum: number;
|
|
283
|
-
createdDate?: string;
|
|
284
|
-
statusIdentifier?: string;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Interface representing a response from the order storage.
|
|
288
|
-
* @interface IBaseOrdersEntityResponse
|
|
289
|
-
* @property {IBaseOrdersEntity[]} items - Array of order storage objects.
|
|
290
|
-
* @example
|
|
291
|
-
[
|
|
292
|
-
{
|
|
293
|
-
"id": 2957,
|
|
294
|
-
"title": "Cosmo",
|
|
295
|
-
"sku": null,
|
|
296
|
-
"previewImage": null,
|
|
297
|
-
"price": 150,
|
|
298
|
-
"quantity": 2
|
|
299
|
-
}
|
|
300
|
-
]
|
|
301
|
-
* @property {string | number} total - Total number of found records. Example: 100.
|
|
302
|
-
* @description Represents a response from the order storage.
|
|
303
|
-
*/
|
|
304
|
-
interface IBaseOrdersEntityResponse {
|
|
305
|
-
items: IBaseOrdersEntity[];
|
|
306
|
-
total: string | number;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Interface representing an order storage object.
|
|
310
|
-
* @interface IOrdersEntity
|
|
311
|
-
* @property {number} id - Object identifier. Example: 1.
|
|
312
|
-
* @property {ILocalizeInfo} localizeInfos - Name considering localization.
|
|
313
|
-
* @example
|
|
314
|
-
{
|
|
315
|
-
"title": "Cash"
|
|
316
|
-
}
|
|
317
|
-
* @property {number | null} position - Position in orders storage. Example: 1.
|
|
318
|
-
* @property {string} identifier - Textual identifier for the record field. Example: "order_storage_1".
|
|
319
|
-
* @property {string} formIdentifier - Textual identifier for the form used by the order storage. Example: "bar-orders-form".
|
|
320
|
-
* @property {number | null} generalTypeId - Type identifier. Example: 1.
|
|
321
|
-
* @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage.
|
|
322
|
-
* @example
|
|
323
|
-
[
|
|
324
|
-
{
|
|
325
|
-
"identifier": "payment-1"
|
|
326
|
-
}
|
|
327
|
-
]
|
|
328
|
-
* @description Represents an order storage object.
|
|
329
|
-
*/
|
|
330
|
-
interface IOrdersEntity {
|
|
331
|
-
id: number;
|
|
332
|
-
localizeInfos: ILocalizeInfo;
|
|
333
|
-
position: number | null;
|
|
334
|
-
identifier: string | null;
|
|
335
|
-
formIdentifier: string | null;
|
|
336
|
-
generalTypeId: number | null;
|
|
337
|
-
paymentAccountIdentifiers: IPaymentAccountIdentifiers[];
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Interface representing an identifier for a payment account used in an order.
|
|
341
|
-
* @interface IPaymentAccountIdentifiers
|
|
342
|
-
* @property {string} identifier - Textual identifier of the payment account. Example: "payment-1".
|
|
343
|
-
* @description Represents an identifier for a payment account used in an order.
|
|
344
|
-
*/
|
|
345
|
-
interface IPaymentAccountIdentifiers {
|
|
346
|
-
identifier: string;
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Interface representing the data required to create or update an order in the order storage.
|
|
350
|
-
* @interface IOrderData
|
|
351
|
-
* @property {string} formIdentifier - Text identifier of the form object linked to the order repository. Example: "bar-orders-form".
|
|
352
|
-
* @property {string} paymentAccountIdentifier - Text identifier of the payment object linked to the order repository. Example: "payment-1".
|
|
353
|
-
* @property {IOrdersFormData | IOrdersFormData[]} formData - Form data linked to the order repository.
|
|
354
|
-
* @example
|
|
355
|
-
[
|
|
356
|
-
{
|
|
357
|
-
"marker": "name_1",
|
|
358
|
-
"value": "Name",
|
|
359
|
-
"type": "string"
|
|
360
|
-
}
|
|
361
|
-
]
|
|
362
|
-
* @property {IOrderProductData[]} products - An array of ordered products. Example: [].
|
|
363
|
-
* @description Represents the data required to create or update an order in the order storage.
|
|
364
|
-
*/
|
|
365
|
-
interface IOrderData {
|
|
366
|
-
formIdentifier: string;
|
|
367
|
-
paymentAccountIdentifier: string;
|
|
368
|
-
formData: IOrdersFormData | IOrdersFormData[];
|
|
369
|
-
products: IOrderProductData[];
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Interface representing an order product data.
|
|
373
|
-
* @interface IOrderByMarkerEntity
|
|
374
|
-
* @property {number} id - Object identifier. Example: 125.
|
|
375
|
-
* @property {number} storageId - Identifier of the order storage object. Example: 1.
|
|
376
|
-
* @property {string} createdDate - Date when the order was created. Example: "2023-10-01T12:00:00Z".
|
|
377
|
-
* @property {string} [statusIdentifier] - Text identifier of the order status. Example: "order-status-1".
|
|
378
|
-
* @property {string} [formIdentifier] - Text identifier of the form. Example: "bar-orders-form".
|
|
379
|
-
* @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store.
|
|
380
|
-
* @example
|
|
381
|
-
[
|
|
382
|
-
{
|
|
383
|
-
"marker": "order_name",
|
|
384
|
-
"value": "Ivan",
|
|
385
|
-
"type": "string"
|
|
386
|
-
}
|
|
387
|
-
]
|
|
388
|
-
* @property {string | null} [attributeSetIdentifier] - Text identifier of the attribute set. Example: "attribute-set-1".
|
|
389
|
-
* @property {string} totalSum - Total order amount. Example: "100.00".
|
|
390
|
-
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
391
|
-
* @property {string | null} [paymentAccountIdentifier] - Textual identifier for the order payment. Example: "payment-1".
|
|
392
|
-
* @property {Record<string, any>} paymentAccountLocalizeInfos - Payment account name considering localization.
|
|
393
|
-
* @example
|
|
394
|
-
{
|
|
395
|
-
"en_US": "USD Payment",
|
|
396
|
-
"ru_RU": "Оплата в долларах США"
|
|
397
|
-
}
|
|
398
|
-
* @property {IOrderProducts[]} products - Array of products added to order.
|
|
399
|
-
* @example
|
|
400
|
-
[
|
|
401
|
-
{
|
|
402
|
-
"id": 1,
|
|
403
|
-
"name": "Product 1",
|
|
404
|
-
"quantity": 2
|
|
405
|
-
}
|
|
406
|
-
]
|
|
407
|
-
* @property {string | null} paymentUrl - Payment link. Example: "https://example.com/pay/123".
|
|
408
|
-
* @property {boolean | null} isCompleted - Indicates that the order has been completed. Example: true.
|
|
409
|
-
* @description Represents an order storage object created by the user.
|
|
410
|
-
*/
|
|
411
|
-
interface IOrderByMarkerEntity {
|
|
412
|
-
id: number;
|
|
413
|
-
storageId: number;
|
|
414
|
-
createdDate: string;
|
|
415
|
-
statusIdentifier?: string;
|
|
416
|
-
formIdentifier?: string;
|
|
417
|
-
formData: IOrdersFormData[];
|
|
418
|
-
attributeSetIdentifier?: string;
|
|
419
|
-
totalSum: string;
|
|
420
|
-
currency: string;
|
|
421
|
-
paymentAccountIdentifier?: string;
|
|
422
|
-
paymentAccountLocalizeInfos?: Record<string, any>;
|
|
423
|
-
paymentUrl: string | null;
|
|
424
|
-
products: IOrderProducts[];
|
|
425
|
-
isCompleted: boolean | null;
|
|
426
|
-
}
|
|
427
|
-
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, IOrderByMarkerEntity, IOrderData, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IPaymentAccountIdentifiers, IPicture, };
|