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.
- 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/formsDataApi.d.ts +21 -9
- package/dist/formsData/formsDataApi.js +21 -9
- package/dist/formsData/formsDataInterfaces.d.ts +128 -45
- 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
|
@@ -11,7 +11,6 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
|
11
11
|
* @class IntegrationCollectionsApi
|
|
12
12
|
* @extends AsyncModules
|
|
13
13
|
* @implements {ICollectionsApi}
|
|
14
|
-
*
|
|
15
14
|
* @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
|
|
16
15
|
*/
|
|
17
16
|
class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
@@ -31,15 +30,19 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
31
30
|
* @handleName getICollections
|
|
32
31
|
*
|
|
33
32
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
34
|
-
* @param {
|
|
33
|
+
* @param {object} [userQuery] - Optional set query parameters. Example:
|
|
34
|
+
{
|
|
35
|
+
"limit": 0,
|
|
36
|
+
"offset": 30,
|
|
37
|
+
"entityType": "orders",
|
|
38
|
+
"entityId": 1
|
|
39
|
+
}
|
|
35
40
|
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
36
41
|
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
37
|
-
* @param {
|
|
38
|
-
* @param {number} [userQuery.entityId] - Entity identifier. Example:
|
|
39
|
-
*
|
|
40
|
-
* @return {ICollection[]} Returns an array of ICollection objects or an error object if there was an issue.
|
|
42
|
+
* @param {string} [userQuery.entityType] - Entity type. Example: "orders".
|
|
43
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
44
|
+
* @return {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
|
|
41
45
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
42
|
-
*
|
|
43
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.
|
|
44
47
|
*/
|
|
45
48
|
async getICollections(langCode = this.state.lang,
|
|
@@ -57,16 +60,13 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
57
60
|
*
|
|
58
61
|
* @param {number} id - Collection id. Example: 1.
|
|
59
62
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
60
|
-
*
|
|
61
|
-
* @return {ICollection} Returns an ICollection object or an error object if there was an issue.
|
|
63
|
+
* @return {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
|
|
62
64
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
63
|
-
*
|
|
64
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.
|
|
65
66
|
*/
|
|
66
67
|
async getICollectionById(id, langCode = this.state.lang) {
|
|
67
68
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
-
const
|
|
69
|
-
const result = await this._fetchGet(`/${id}?` + this._queryParamsToString(query));
|
|
69
|
+
const result = await this._fetchGet(`/${id}?` + this._queryParamsToString({ langCode }));
|
|
70
70
|
return this._dataPostProcess(result, langCode);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
@@ -76,24 +76,28 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
76
76
|
*
|
|
77
77
|
* @param {number} id - Collection id. Example: 1.
|
|
78
78
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
79
|
-
* @param {any} [userQuery] - Optional set query parameters. Example:
|
|
80
|
-
|
|
79
|
+
* @param {any} [userQuery] - Optional set query parameters. Example:
|
|
80
|
+
{
|
|
81
|
+
"limit": 0,
|
|
82
|
+
"offset": 30,
|
|
83
|
+
"entityType": "orders",
|
|
84
|
+
"entityId": 1
|
|
85
|
+
}
|
|
81
86
|
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
82
87
|
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
83
|
-
* @param {number} [userQuery.entityType] - Entity type. Example:
|
|
84
|
-
* @param {number} [userQuery.entityId] - Entity identifier. Example:
|
|
85
|
-
*
|
|
86
|
-
* @return {ICollectionResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
88
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: "orders".
|
|
89
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
90
|
+
* @return {ICollectionRowsResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
87
91
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
88
|
-
*
|
|
89
92
|
* @description Get all records belonging to the collection by collection id.
|
|
90
93
|
*/
|
|
91
|
-
async getICollectionRowsById(id, langCode = this.state.lang,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
async getICollectionRowsById(id, langCode = this.state.lang, userQuery) {
|
|
95
|
+
const result = await this._fetchGet(`/${id}/rows?` +
|
|
96
|
+
this._queryParamsToString({
|
|
97
|
+
...this._defaultQuery,
|
|
98
|
+
...userQuery,
|
|
99
|
+
langCode,
|
|
100
|
+
}));
|
|
97
101
|
return this._dataPostProcess(result, langCode);
|
|
98
102
|
}
|
|
99
103
|
/**
|
|
@@ -102,11 +106,12 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
102
106
|
* @handleName validateICollectionMarker
|
|
103
107
|
*
|
|
104
108
|
* @param {string} marker - Collection marker. Example: "collection1".
|
|
105
|
-
*
|
|
106
|
-
|
|
109
|
+
* @return {ICollectionIsValid} Returns an object with a boolean property `valid` indicating whether the marker is valid or not. Example:
|
|
110
|
+
{
|
|
111
|
+
"valid": true
|
|
112
|
+
}
|
|
107
113
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
108
|
-
*
|
|
109
|
-
* @description
|
|
114
|
+
* @description Check for the existence of a text identifier (marker).
|
|
110
115
|
*/
|
|
111
116
|
async validateICollectionMarker(marker) {
|
|
112
117
|
const result = await this._fetchGet(`/marker-validation/${marker}`);
|
|
@@ -119,10 +124,8 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
119
124
|
*
|
|
120
125
|
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
121
126
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
122
|
-
*
|
|
123
|
-
* @return {any} Returns CollectionRowEntity object.
|
|
127
|
+
* @return {ICollectionRowsResponce} Returns CollectionRowEntity object.
|
|
124
128
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
125
|
-
*
|
|
126
129
|
* @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.
|
|
127
130
|
*/
|
|
128
131
|
async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
|
|
@@ -137,10 +140,8 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
137
140
|
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
138
141
|
* @param {number} id - Collection record identifier. Example: 1.
|
|
139
142
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
140
|
-
*
|
|
141
|
-
* @return {any} Returns CollectionRowEntity object.
|
|
143
|
+
* @return {ICollectionRow} Returns CollectionRowEntity object.
|
|
142
144
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
143
|
-
*
|
|
144
145
|
* @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.
|
|
145
146
|
*/
|
|
146
147
|
async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
|
|
@@ -153,12 +154,22 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
153
154
|
* @handleName createICollectionRow
|
|
154
155
|
*
|
|
155
156
|
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
156
|
-
* @param {ICollectionFormObject} body - Object for creating a record. Example:
|
|
157
|
+
* @param {ICollectionFormObject} body - Object for creating a record. Example:
|
|
158
|
+
{
|
|
159
|
+
"formIdentifier": "collection-form",
|
|
160
|
+
"formData": {
|
|
161
|
+
"en_US": [
|
|
162
|
+
{
|
|
163
|
+
"marker": "collection_marker",
|
|
164
|
+
"type": "string",
|
|
165
|
+
"value": "Collection marker"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
157
170
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
158
|
-
*
|
|
159
|
-
* @return {any} Returns object of type ICollectionRow.
|
|
171
|
+
* @return {ICollectionRow} Returns object of type ICollectionRow.
|
|
160
172
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
161
|
-
*
|
|
162
173
|
* @description Create a record in the collection.
|
|
163
174
|
*/
|
|
164
175
|
async createICollectionRow(marker, body, langCode = this.state.lang) {
|
|
@@ -172,12 +183,22 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
172
183
|
*
|
|
173
184
|
* @param {string} marker - Text identifier of the collection. Example: "collection1".
|
|
174
185
|
* @param {number} id - Row identifier in the collection. Example: 12.
|
|
175
|
-
* @param {object} body - Object for updating a record in the collection. Example:
|
|
186
|
+
* @param {object} body - Object for updating a record in the collection. Example:
|
|
187
|
+
{
|
|
188
|
+
"formIdentifier": "collection-form",
|
|
189
|
+
"formData": {
|
|
190
|
+
"en_US": [
|
|
191
|
+
{
|
|
192
|
+
"marker": "collection_marker",
|
|
193
|
+
"type": "string",
|
|
194
|
+
"value": "Collection marker"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
}
|
|
176
199
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
177
|
-
*
|
|
178
200
|
* @return {ICollectionRow} Returns object of type ICollectionRow.
|
|
179
201
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
180
|
-
*
|
|
181
202
|
* @description Edit a record in the collection.
|
|
182
203
|
*/
|
|
183
204
|
async updateICollectionRow(marker, id, body, langCode = this.state.lang) {
|
|
@@ -191,11 +212,9 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
191
212
|
*
|
|
192
213
|
* @param {string} marker - text identifier of the collection Example: "collection1".
|
|
193
214
|
* @param {number} id - record identifier in the collection Example: 12.
|
|
194
|
-
*
|
|
195
215
|
* @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
196
216
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
197
|
-
*
|
|
198
|
-
* @description
|
|
217
|
+
* @description Deletion of collection record object
|
|
199
218
|
*/
|
|
200
219
|
async deleteICollectionRowByMarkerAndId(marker, id) {
|
|
201
220
|
const result = await this._fetchDelete(`/marker/${marker}/rows/${id}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IError } from '../base/utils';
|
|
1
|
+
import type { IError, ILocalizeInfo } from '../base/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @interface ICollectionsApi
|
|
4
4
|
*
|
|
@@ -11,7 +11,6 @@ import type { IError } from '../base/utils';
|
|
|
11
11
|
* @property {function} createICollectionRow - Create a record (row) in the collection.
|
|
12
12
|
* @property {function} updateICollectionRow - Edit a record (row) in the collection.
|
|
13
13
|
* @property {function} deleteICollectionRowByMarkerAndId - Deletion of collection record object (row).
|
|
14
|
-
*
|
|
15
14
|
* @description This interface defines methods for managing collections and their records in the system.
|
|
16
15
|
*/
|
|
17
16
|
interface ICollectionsApi {
|
|
@@ -19,48 +18,63 @@ interface ICollectionsApi {
|
|
|
19
18
|
* Get all collections.
|
|
20
19
|
*
|
|
21
20
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
22
|
-
* @param {any} [userQuery] -
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
* @param {any} [userQuery] - Query parameters. Example:
|
|
22
|
+
{
|
|
23
|
+
"limit": 30,
|
|
24
|
+
"offset": 0,
|
|
25
|
+
"entityType": "orders",
|
|
26
|
+
"entityId": 1
|
|
27
|
+
}
|
|
28
|
+
* @param {number} [userQuery.limit] - Parameter for pagination. Default: 0.
|
|
29
|
+
* @param {number} [userQuery.offset] - Parameter for pagination. Default: 30.
|
|
30
|
+
* @param {string} [userQuery.entityType] - Entity type. Example: "orders".
|
|
31
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
32
|
+
* @return {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
|
|
29
33
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
30
34
|
*/
|
|
31
|
-
getICollections(
|
|
35
|
+
getICollections(langCode: string, userQuery?: {
|
|
36
|
+
limit: number;
|
|
37
|
+
offset: number;
|
|
38
|
+
entityType: string;
|
|
39
|
+
entityId: number;
|
|
40
|
+
}): Promise<ICollectionEntity[] | IError>;
|
|
32
41
|
/**
|
|
33
42
|
* Get a single collection object by id.
|
|
34
43
|
*
|
|
35
44
|
* @param {number} id - Collection id. Example: 1.
|
|
36
45
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
37
|
-
*
|
|
38
|
-
* @return {ICollection} Returns an ICollection object or an error object if there was an issue.
|
|
46
|
+
* @return {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
|
|
39
47
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
40
48
|
*/
|
|
41
|
-
getICollectionById(id: number, langCode: string): Promise<
|
|
49
|
+
getICollectionById(id: number, langCode: string): Promise<ICollectionEntity | IError>;
|
|
42
50
|
/**
|
|
43
51
|
* Get all records belonging to the collection by collection id.
|
|
44
52
|
*
|
|
45
53
|
* @param {number} id - Collection id.
|
|
46
54
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
47
|
-
* @param {any} [userQuery] - Optional set query parameters.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* @
|
|
55
|
+
* @param {any} [userQuery] - Optional set query parameters. Example:
|
|
56
|
+
{
|
|
57
|
+
"limit": 30,
|
|
58
|
+
"offset": 0,
|
|
59
|
+
"entityType": "orders",
|
|
60
|
+
"entityId": 1
|
|
61
|
+
}
|
|
62
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 30.
|
|
63
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 0.
|
|
64
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: "orders".
|
|
65
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
66
|
+
* @return {ICollectionRowsResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
55
67
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
56
68
|
*/
|
|
57
|
-
getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<
|
|
69
|
+
getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<ICollectionRowsResponce | IError>;
|
|
58
70
|
/**
|
|
59
71
|
* Check for the existence of a text identifier (marker).
|
|
60
72
|
*
|
|
61
73
|
* @param {string} marker - Collection marker. Example: "collection1".
|
|
62
|
-
*
|
|
63
|
-
|
|
74
|
+
* @return {ICollectionIsValid} Returns an object with a boolean property `valid` indicating whether the marker is valid or not. Example:
|
|
75
|
+
{
|
|
76
|
+
"valid": true
|
|
77
|
+
}
|
|
64
78
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
65
79
|
*/
|
|
66
80
|
validateICollectionMarker(marker: string): Promise<any | IError>;
|
|
@@ -69,95 +83,120 @@ interface ICollectionsApi {
|
|
|
69
83
|
*
|
|
70
84
|
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
71
85
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
72
|
-
*
|
|
73
|
-
* @return {any} Returns CollectionRowEntity object.
|
|
86
|
+
* @return {ICollectionRowsResponce} Returns collection row entity object.
|
|
74
87
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
75
88
|
*/
|
|
76
|
-
getICollectionRowsByMarker(marker: string, langCode?: string): Promise<
|
|
89
|
+
getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
|
|
77
90
|
/**
|
|
78
91
|
* Getting one record from the collection.
|
|
79
92
|
*
|
|
80
93
|
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
81
94
|
* @param {number} id - Collection record identifier. Example: 1.
|
|
82
95
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
83
|
-
*
|
|
84
|
-
* @return {any} Returns CollectionRowEntity object.
|
|
96
|
+
* @return {ICollectionRow} Returns collection row entity object.
|
|
85
97
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
86
98
|
*/
|
|
87
|
-
getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<
|
|
99
|
+
getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<ICollectionRow | IError>;
|
|
88
100
|
/**
|
|
89
101
|
* Create a record in the collection.
|
|
90
102
|
*
|
|
91
103
|
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
92
|
-
* @param {ICollectionFormObject} body - Object for creating a record. Example:
|
|
104
|
+
* @param {ICollectionFormObject} body - Object for creating a record. Example:
|
|
105
|
+
{
|
|
106
|
+
"formIdentifier": "collection-form",
|
|
107
|
+
"formData": {
|
|
108
|
+
"en_US": [
|
|
109
|
+
{
|
|
110
|
+
"marker": "collection_marker",
|
|
111
|
+
"type": "string",
|
|
112
|
+
"value": "Collection marker"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
93
117
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
94
|
-
*
|
|
95
118
|
* @return {any} Returns object of type ICollectionRow.
|
|
96
119
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
97
120
|
*/
|
|
98
|
-
createICollectionRow(marker: string, body:
|
|
121
|
+
createICollectionRow(marker: string, body: ICollectionFormObject, langCode: string): Promise<any | IError>;
|
|
99
122
|
/**
|
|
100
123
|
* Edit a record in the collection.
|
|
101
124
|
*
|
|
102
125
|
* @param {string} marker - Text identifier of the collection. Example: "collection1".
|
|
103
126
|
* @param {number} id - Row id. Example: 12.
|
|
104
|
-
* @param {
|
|
127
|
+
* @param {ICollectionFormObject} body - Object for updating a record in the collection. Example:
|
|
128
|
+
{
|
|
129
|
+
"formIdentifier": "collection-form",
|
|
130
|
+
"formData": {
|
|
131
|
+
"en_US": [
|
|
132
|
+
{
|
|
133
|
+
"marker": "collection_marker",
|
|
134
|
+
"type": "string",
|
|
135
|
+
"value": "Collection marker"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
105
140
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
106
|
-
*
|
|
107
141
|
* @return {ICollectionRow} Returns object of type ICollectionRow.
|
|
108
142
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
109
143
|
*/
|
|
110
|
-
updateICollectionRow(marker: string, id: number, body:
|
|
144
|
+
updateICollectionRow(marker: string, id: number, body: ICollectionFormObject, langCode: string): Promise<any | IError>;
|
|
111
145
|
/**
|
|
112
146
|
* Deletion of collection record object
|
|
113
147
|
*
|
|
114
148
|
* @param {string} marker - text identifier of the collection Example: "collection1".
|
|
115
149
|
* @param {number} id - record identifier in the collection Example: 12.
|
|
116
|
-
*
|
|
117
150
|
* @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
118
151
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
119
152
|
*/
|
|
120
153
|
deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<any | IError>;
|
|
121
154
|
}
|
|
122
155
|
/**
|
|
123
|
-
* @interface
|
|
156
|
+
* @interface ICollectionEntity
|
|
124
157
|
*
|
|
125
158
|
* @property {number} id - Object identifier. Example: 1.
|
|
126
159
|
* @property {string | null} identifier - Text identifier for record field. Example: "collection1".
|
|
127
160
|
* @property {number | null} formId - Identifier for the form used by the order storage. Example: 1234.
|
|
128
|
-
* @property {
|
|
161
|
+
* @property {ILocalizeInfo} localizeInfos - Localized information about the collection. Example:
|
|
162
|
+
{
|
|
163
|
+
"title": "Admins text"
|
|
164
|
+
}
|
|
129
165
|
* @property {string | null} attributeSetId - Identifier of the set of attributes used by the form attached to the collection. Example: "attributeSet1" or null if not applicable.
|
|
130
166
|
* @property {string | null} selectedAttributeMarkers - Text identifiers of form object attributes for display in the data table. Example: "collection_marker".
|
|
131
|
-
*
|
|
132
167
|
* @description Represents a collection object with various properties, including identifiers, form information, and localized data.
|
|
133
168
|
*/
|
|
134
|
-
interface
|
|
169
|
+
interface ICollectionEntity {
|
|
135
170
|
id: number;
|
|
136
171
|
identifier: string | null;
|
|
137
172
|
formId: number | null;
|
|
138
|
-
localizeInfos:
|
|
173
|
+
localizeInfos: ILocalizeInfo;
|
|
139
174
|
attributeSetId: string | null;
|
|
140
175
|
selectedAttributeMarkers: string | null;
|
|
141
176
|
}
|
|
142
177
|
/**
|
|
143
178
|
* @interface ICollectionResponce
|
|
144
179
|
*
|
|
145
|
-
* @property {
|
|
180
|
+
* @property {ICollectionEntity[]} items - Array of collection objects. Example:
|
|
181
|
+
[
|
|
182
|
+
{
|
|
183
|
+
"id": 1,
|
|
184
|
+
"identifier": "collection1"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
146
187
|
* @property {number} total - Total number of found records. Example: 10.
|
|
147
|
-
*
|
|
148
188
|
* @description Represents a response from the collections API containing a total count and an array of collection objects.
|
|
149
189
|
*/
|
|
150
190
|
interface ICollectionResponce {
|
|
151
|
-
items:
|
|
191
|
+
items: ICollectionEntity[];
|
|
152
192
|
total: number;
|
|
153
193
|
}
|
|
154
194
|
/**
|
|
155
195
|
* @interface ICollectionFormData
|
|
156
196
|
*
|
|
157
197
|
* @property {string} marker - Text identifier (marker) of the form field. Example: "collection_marker".
|
|
158
|
-
* @property {string} type - Type of the form field, such as
|
|
159
|
-
* @property {string} value - Value of the form field, which can be a string, number, date, etc. Example: "Collection marker".
|
|
160
|
-
*
|
|
198
|
+
* @property {string} type - Type of the form field, such as "text", "number", "date", "etc". Example: "number".
|
|
199
|
+
* @property {string} value - Value of the form field, which can be a "string", "number", "date", "etc". Example: "Collection marker".
|
|
161
200
|
* @description Represents a form data object within a collection, containing a marker, type, and value.
|
|
162
201
|
*/
|
|
163
202
|
interface ICollectionFormData {
|
|
@@ -169,8 +208,17 @@ interface ICollectionFormData {
|
|
|
169
208
|
* @interface ICollectionFormObject
|
|
170
209
|
*
|
|
171
210
|
* @property {string} formIdentifier - Text identifier (marker) of the form. Example: "collection-form".
|
|
172
|
-
* @property {ICollectionFormData
|
|
173
|
-
|
|
211
|
+
* @property {Record<string, ICollectionFormData>} formData - An object where keys are form field markers and values are arrays of ICollectionFormData objects. Example:
|
|
212
|
+
[
|
|
213
|
+
{
|
|
214
|
+
"marker": "name_1",
|
|
215
|
+
"type": "string",
|
|
216
|
+
"value": "Value"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
* @property {string} formData[index].marker - Text identifier (marker) of the form field. Example: "name_1".
|
|
220
|
+
* @property {string} formData[index].type - Type of the form field. Example: "string".
|
|
221
|
+
* @property {string} formData[index].value - Value of the form field. Example: "Value".
|
|
174
222
|
* @description Represents a collection form object that contains a form identifier and associated form data. This interface defines the structure of a collection form object, which includes a form identifier and a set of form data organized by markers.
|
|
175
223
|
*/
|
|
176
224
|
interface ICollectionFormObject {
|
|
@@ -185,34 +233,67 @@ interface ICollectionFormObject {
|
|
|
185
233
|
* @property {number} id - Object identifier. Example: 1.
|
|
186
234
|
* @property {string} createdDate - Date of creation of the record. Example: "2023-01-01T00:00:00Z".
|
|
187
235
|
* @property {string} updatedDate - Date of last update of the record. Example: "2023-01-02T00:00:00Z".
|
|
188
|
-
* @property {
|
|
189
|
-
* @property {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
236
|
+
* @property {number | null} [collectionId] - collectionId associated with the collection row. Example: "product", "order", "etc".
|
|
237
|
+
* @property {ICollectionFormData[]} formData - Array of form data objects associated with the collection row. Example:
|
|
238
|
+
[
|
|
239
|
+
{
|
|
240
|
+
"marker": "name_1",
|
|
241
|
+
"type": "string",
|
|
242
|
+
"value": "Value"
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
* @property {string | null} entityType - Type of the entity associated with the collection row. Example: "product", "order", "etc".
|
|
246
|
+
* @property {number | null} entityId - Identifier of the entity associated with the collection row. Example: 12345.
|
|
247
|
+
* @property {string | null} [attributeSetIdentifier] - Identifier of the attribute set used by the form attached to the collection row, or null if not applicable. Example: "attributeSet1" or null.
|
|
248
|
+
* @property {string} total - Total count. Example: "1".
|
|
194
249
|
* @description Represents a row in a collection, containing various properties such as identifiers, dates, form data, and an optional total value.
|
|
195
250
|
*/
|
|
196
251
|
interface ICollectionRow {
|
|
197
252
|
id: number;
|
|
198
253
|
createdDate: string;
|
|
199
254
|
updatedDate: string;
|
|
200
|
-
|
|
201
|
-
entityType: any;
|
|
255
|
+
collectionId?: number | null;
|
|
202
256
|
formData: ICollectionFormData[];
|
|
203
|
-
|
|
204
|
-
|
|
257
|
+
entityType: string | null;
|
|
258
|
+
entityId: number | null;
|
|
259
|
+
attributeSetIdentifier?: string | null;
|
|
260
|
+
total: string;
|
|
205
261
|
}
|
|
206
262
|
/**
|
|
207
263
|
* @interface ICollectionRowsResponce
|
|
208
264
|
*
|
|
209
|
-
* @property {ICollectionRow[]} items - Array of collection row objects. Example:
|
|
265
|
+
* @property {ICollectionRow[]} items - Array of collection row objects. Example:
|
|
266
|
+
[
|
|
267
|
+
{
|
|
268
|
+
"id": 1,
|
|
269
|
+
"createdDate": "2025-06-06T19:08:54.616Z",
|
|
270
|
+
"updatedDate": "2025-06-06T19:08:54.616Z",
|
|
271
|
+
"entityId": null,
|
|
272
|
+
"entityType": null,
|
|
273
|
+
"formData": [
|
|
274
|
+
{
|
|
275
|
+
"marker": "name_1",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"value": "Value"
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"attributeSetIdentifier": null
|
|
281
|
+
}
|
|
282
|
+
]
|
|
210
283
|
* @property {number} total - Total number of found records. Example: 10.
|
|
211
|
-
*
|
|
212
284
|
* @description Represents a response from the collections API containing a total count and an array of collection row objects.
|
|
213
285
|
*/
|
|
214
286
|
interface ICollectionRowsResponce {
|
|
215
287
|
items: ICollectionRow[];
|
|
216
288
|
total: number;
|
|
217
289
|
}
|
|
218
|
-
|
|
290
|
+
/**
|
|
291
|
+
* @interface ICollectionIsValid
|
|
292
|
+
*
|
|
293
|
+
* @property {boolean} valid - Valid marker object. Example: true.
|
|
294
|
+
* @description Represents a response from the validateICollectionMarker.
|
|
295
|
+
*/
|
|
296
|
+
interface ICollectionIsValid {
|
|
297
|
+
valid: boolean;
|
|
298
|
+
}
|
|
299
|
+
export type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionResponce, ICollectionRow, ICollectionRowsResponce, ICollectionsApi, };
|
|
@@ -17,8 +17,7 @@ export default class LocalesApi extends AsyncModules implements ILocales {
|
|
|
17
17
|
*
|
|
18
18
|
* @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
|
|
19
19
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
20
|
-
*
|
|
21
|
-
* @description
|
|
20
|
+
* @description Find all active language localization objects.
|
|
22
21
|
*/
|
|
23
22
|
getLocales(): Promise<Array<ILocalEntity> | IError>;
|
|
24
23
|
}
|
|
@@ -20,8 +20,7 @@ class LocalesApi extends asyncModules_1.default {
|
|
|
20
20
|
*
|
|
21
21
|
* @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
|
|
22
22
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
23
|
-
*
|
|
24
|
-
* @description
|
|
23
|
+
* @description Find all active language localization objects.
|
|
25
24
|
*/
|
|
26
25
|
async getLocales() {
|
|
27
26
|
const result = await this._fetchGet('/active/all');
|
|
@@ -3,7 +3,6 @@ import type { IError } from '../base/utils';
|
|
|
3
3
|
* @interface ILocales
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getLocales - Find all active language localization objects.
|
|
6
|
-
*
|
|
7
6
|
* @description This interface defines a method for retrieving all active language localization objects in the system.
|
|
8
7
|
*/
|
|
9
8
|
interface ILocales {
|
|
@@ -13,7 +12,7 @@ interface ILocales {
|
|
|
13
12
|
* @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
|
|
14
13
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
14
|
*/
|
|
16
|
-
getLocales(): Promise<
|
|
15
|
+
getLocales(): Promise<ILocalEntity[] | IError>;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* @interface ILocalEntity
|
|
@@ -24,9 +23,8 @@ interface ILocales {
|
|
|
24
23
|
* @property {string} name - The language name. Example: "English".
|
|
25
24
|
* @property {string} nativeName - The native language name. Example: "English".
|
|
26
25
|
* @property {boolean} isActive - Active language flag. Example: true.
|
|
27
|
-
* @property {string} image - The language image. Example: "https://example.com/images/en.png".
|
|
26
|
+
* @property {string | null} image - The language image. Example: "https://example.com/images/en.png".
|
|
28
27
|
* @property {number} position - The language position. Example: 1.
|
|
29
|
-
*
|
|
30
28
|
* @description This interface defines the structure of a locales entity, including its identifiers, name, and other properties.
|
|
31
29
|
*/
|
|
32
30
|
interface ILocalEntity {
|
package/dist/menus/menusApi.d.ts
CHANGED
|
@@ -17,11 +17,9 @@ export default class MenusApi extends AsyncModules implements IMenus {
|
|
|
17
17
|
*
|
|
18
18
|
* @param {string} marker - Menu marker. Example: "main_menu".
|
|
19
19
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
20
|
-
*
|
|
21
20
|
* @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
|
|
22
21
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
23
|
-
*
|
|
24
|
-
* @description
|
|
22
|
+
* @description Get pages includes in menu by marker.
|
|
25
23
|
*/
|
|
26
24
|
getMenusByMarker(marker: string, langCode?: string): Promise<IMenusEntity | IError>;
|
|
27
25
|
}
|
package/dist/menus/menusApi.js
CHANGED
|
@@ -20,11 +20,9 @@ class MenusApi extends asyncModules_1.default {
|
|
|
20
20
|
*
|
|
21
21
|
* @param {string} marker - Menu marker. Example: "main_menu".
|
|
22
22
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
-
*
|
|
24
23
|
* @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
|
|
25
24
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
|
-
*
|
|
27
|
-
* @description
|
|
25
|
+
* @description Get pages includes in menu by marker.
|
|
28
26
|
*/
|
|
29
27
|
async getMenusByMarker(marker, langCode = this.state.lang) {
|
|
30
28
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|