oneentry 1.0.123 → 1.0.124
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/dist/admins/adminsApi.d.ts +16 -8
- package/dist/admins/adminsApi.js +17 -9
- package/dist/admins/adminsInterfaces.d.ts +49 -25
- package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
- package/dist/attribute-sets/attributeSetsApi.js +49 -25
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
- package/dist/auth-provider/authProviderApi.d.ts +94 -83
- package/dist/auth-provider/authProviderApi.js +96 -83
- package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
- package/dist/base/asyncModules.d.ts +32 -28
- package/dist/base/asyncModules.js +61 -36
- package/dist/base/syncModules.d.ts +44 -44
- package/dist/base/syncModules.js +65 -63
- package/dist/blocks/blocksApi.d.ts +56 -25
- package/dist/blocks/blocksApi.js +56 -25
- package/dist/blocks/blocksInterfaces.d.ts +71 -22
- package/dist/events/eventsApi.d.ts +45 -11
- package/dist/events/eventsApi.js +47 -17
- package/dist/events/eventsInterfaces.d.ts +44 -2
- package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
- package/dist/file-uploading/fileUploadingApi.js +46 -27
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
- package/dist/forms/formsApi.d.ts +23 -8
- package/dist/forms/formsApi.js +23 -8
- package/dist/forms/formsInterfaces.d.ts +62 -15
- package/dist/formsData/formsDataApi.d.ts +33 -33
- package/dist/formsData/formsDataApi.js +33 -33
- package/dist/formsData/formsDataInterfaces.d.ts +123 -35
- package/dist/general-types/generalTypesApi.d.ts +12 -1
- package/dist/general-types/generalTypesApi.js +12 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
- package/dist/integration-collections/integrationCollectionsApi.js +114 -81
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
- package/dist/locales/localesApi.d.ts +6 -1
- package/dist/locales/localesApi.js +6 -1
- package/dist/locales/localesInterfaces.d.ts +20 -11
- package/dist/menus/menusApi.d.ts +8 -3
- package/dist/menus/menusApi.js +8 -3
- package/dist/menus/menusInterfaces.d.ts +30 -17
- package/dist/orders/ordersApi.d.ts +64 -64
- package/dist/orders/ordersApi.js +67 -65
- package/dist/orders/ordersInterfaces.d.ts +174 -60
- package/dist/pages/pagesApi.d.ts +87 -28
- package/dist/pages/pagesApi.js +87 -28
- package/dist/pages/pagesInterfaces.d.ts +117 -23
- package/dist/payments/paymentsApi.d.ts +56 -22
- package/dist/payments/paymentsApi.js +56 -22
- package/dist/payments/paymentsInterfaces.d.ts +119 -36
- package/dist/product-statuses/productStatusesApi.d.ts +21 -15
- package/dist/product-statuses/productStatusesApi.js +21 -18
- package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
- package/dist/products/productsApi.d.ts +137 -157
- package/dist/products/productsApi.js +137 -157
- package/dist/products/productsInterfaces.d.ts +240 -57
- package/dist/system/systemApi.d.ts +29 -10
- package/dist/system/systemApi.js +29 -10
- package/dist/system/systemInterfaces.d.ts +8 -0
- package/dist/templates/templatesApi.d.ts +26 -16
- package/dist/templates/templatesApi.js +26 -19
- package/dist/templates/templatesInterfaces.d.ts +40 -14
- package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
- package/dist/templates-preview/templatesPreviewApi.js +18 -17
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +54 -26
- package/dist/users/usersApi.d.ts +37 -33
- package/dist/users/usersApi.js +37 -33
- package/dist/users/usersInterfaces.d.ts +80 -9
- package/dist/web-socket/wsApi.d.ts +6 -3
- package/dist/web-socket/wsApi.js +6 -3
- package/dist/web-socket/wsInterfaces.d.ts +3 -1
- package/package.json +11 -11
|
@@ -3,15 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
8
7
|
/**
|
|
9
8
|
* Controllers for working with attributes.
|
|
9
|
+
*
|
|
10
10
|
* @handle /api/content/integration-collections
|
|
11
|
+
* @class IntegrationCollectionsApi
|
|
12
|
+
* @extends AsyncModules
|
|
13
|
+
* @implements {ICollectionsApi}
|
|
14
|
+
*
|
|
15
|
+
* @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
|
|
11
16
|
*/
|
|
12
17
|
class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
13
18
|
constructor(state) {
|
|
14
19
|
super(state);
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
21
|
this._defaultQuery = {
|
|
16
22
|
langCode: 'en_US',
|
|
17
23
|
offset: 0,
|
|
@@ -20,149 +26,176 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
|
|
|
20
26
|
this._url = state.url + '/api/content/integration-collections';
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
|
-
* Get all collections
|
|
29
|
+
* Get all collections.
|
|
24
30
|
*
|
|
25
|
-
* @
|
|
31
|
+
* @handleName getICollections
|
|
32
|
+
*
|
|
33
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
26
34
|
* @param {any} [userQuery] - Optional set query parameters.
|
|
35
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
36
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
37
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: 1.
|
|
38
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: orders.
|
|
27
39
|
*
|
|
28
|
-
* @
|
|
29
|
-
* @
|
|
40
|
+
* @return {ICollection[]} Returns an array of ICollection objects or an error object if there was an issue.
|
|
41
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
30
42
|
*
|
|
31
|
-
* @
|
|
43
|
+
* @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.
|
|
32
44
|
*/
|
|
33
|
-
async getICollections(langCode = this.state.lang,
|
|
45
|
+
async getICollections(langCode = this.state.lang,
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
userQuery) {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
49
|
const query = { ...this._defaultQuery, ...userQuery, langCode };
|
|
35
|
-
const result = await this._fetchGet(
|
|
50
|
+
const result = await this._fetchGet(`?` + this._queryParamsToString(query));
|
|
36
51
|
return this._dataPostProcess(result, langCode);
|
|
37
52
|
}
|
|
38
53
|
/**
|
|
39
54
|
* Get a single collection object by id.
|
|
40
55
|
*
|
|
41
|
-
* @
|
|
42
|
-
*
|
|
56
|
+
* @handleName getICollectionById
|
|
57
|
+
*
|
|
58
|
+
* @param {number} id - Collection id. Example: 1.
|
|
59
|
+
* @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.
|
|
62
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
43
63
|
*
|
|
44
|
-
* @
|
|
64
|
+
* @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.
|
|
45
65
|
*/
|
|
46
66
|
async getICollectionById(id, langCode = this.state.lang) {
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
68
|
const query = { langCode };
|
|
48
|
-
const result = await this._fetchGet(`/${id}
|
|
69
|
+
const result = await this._fetchGet(`/${id}?` + this._queryParamsToString(query));
|
|
49
70
|
return this._dataPostProcess(result, langCode);
|
|
50
71
|
}
|
|
51
72
|
/**
|
|
52
73
|
* Get all records belonging to the collection by collection id.
|
|
53
74
|
*
|
|
54
|
-
* @
|
|
55
|
-
*
|
|
56
|
-
* @param {
|
|
75
|
+
* @handleName getICollectionRowsById
|
|
76
|
+
*
|
|
77
|
+
* @param {number} id - Collection id. Example: 1.
|
|
78
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
79
|
+
* @param {any} [userQuery] - Optional set query parameters. Example: .
|
|
80
|
+
*
|
|
81
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
82
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
83
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: 1.
|
|
84
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: "orders".
|
|
57
85
|
*
|
|
58
|
-
* @
|
|
59
|
-
* @
|
|
60
|
-
* @param {number} [userQuery.entityType] - Entity type. Example: 1
|
|
61
|
-
* @param {number} [userQuery.entityId] - Entity identifier. Example: orders
|
|
86
|
+
* @return {ICollectionResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
87
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
62
88
|
*
|
|
63
|
-
* @
|
|
89
|
+
* @description Get all records belonging to the collection by collection id.
|
|
64
90
|
*/
|
|
65
|
-
async getICollectionRowsById(id, langCode = this.state.lang,
|
|
91
|
+
async getICollectionRowsById(id, langCode = this.state.lang,
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
|
+
userQuery) {
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
95
|
const query = { ...this._defaultQuery, ...userQuery, langCode };
|
|
67
|
-
const result = await this._fetchGet(`/${id}/rows
|
|
96
|
+
const result = await this._fetchGet(`/${id}/rows?` + this._queryParamsToString(query));
|
|
68
97
|
return this._dataPostProcess(result, langCode);
|
|
69
98
|
}
|
|
70
99
|
/**
|
|
71
|
-
* Check for the existence of a text identifier (marker)
|
|
100
|
+
* Check for the existence of a text identifier (marker).
|
|
72
101
|
*
|
|
73
|
-
* @
|
|
102
|
+
* @handleName validateICollectionMarker
|
|
74
103
|
*
|
|
75
|
-
* @
|
|
104
|
+
* @param {string} marker - Collection marker. Example: "collection1".
|
|
105
|
+
*
|
|
106
|
+
* @return {any} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
|
|
107
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
108
|
+
*
|
|
109
|
+
* @description
|
|
76
110
|
*/
|
|
77
111
|
async validateICollectionMarker(marker) {
|
|
78
|
-
const result = await this._fetchGet(`/marker-validation/${marker}
|
|
112
|
+
const result = await this._fetchGet(`/marker-validation/${marker}`);
|
|
79
113
|
return this._dataPostProcess(result);
|
|
80
114
|
}
|
|
81
115
|
/**
|
|
82
116
|
* Getting all records from the collection.
|
|
83
117
|
*
|
|
84
|
-
* @
|
|
85
|
-
*
|
|
118
|
+
* @handleName getICollectionRowsByMarker
|
|
119
|
+
*
|
|
120
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
121
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
86
122
|
*
|
|
87
|
-
* @
|
|
123
|
+
* @return {any} Returns CollectionRowEntity object.
|
|
124
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
125
|
+
*
|
|
126
|
+
* @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
127
|
*/
|
|
89
128
|
async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
|
|
90
|
-
const result = await this._fetchGet(`/marker/${marker}/rows
|
|
129
|
+
const result = await this._fetchGet(`/marker/${marker}/rows?langCode=${langCode}`);
|
|
91
130
|
return this._dataPostProcess(result, langCode);
|
|
92
131
|
}
|
|
93
132
|
/**
|
|
94
133
|
* Getting one record from the collection.
|
|
95
134
|
*
|
|
96
|
-
* @
|
|
97
|
-
*
|
|
98
|
-
* @param {string}
|
|
135
|
+
* @handleName getICollectionRowByMarkerAndId
|
|
136
|
+
*
|
|
137
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
138
|
+
* @param {number} id - Collection record identifier. Example: 1.
|
|
139
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
99
140
|
*
|
|
100
|
-
* @
|
|
141
|
+
* @return {any} Returns CollectionRowEntity object.
|
|
142
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
143
|
+
*
|
|
144
|
+
* @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.
|
|
101
145
|
*/
|
|
102
146
|
async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
|
|
103
|
-
const result = await this._fetchGet(`/marker/${marker}/rows/${id}
|
|
147
|
+
const result = await this._fetchGet(`/marker/${marker}/rows/${id}?langCode=${langCode}`);
|
|
104
148
|
return this._dataPostProcess(result, langCode);
|
|
105
149
|
}
|
|
106
150
|
/**
|
|
107
|
-
* Create a record in the collection
|
|
108
|
-
*
|
|
109
|
-
* @
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
* @param {string} [langCode] - Language code.
|
|
124
|
-
*
|
|
125
|
-
* @description Create a record in the collection
|
|
151
|
+
* Create a record in the collection.
|
|
152
|
+
*
|
|
153
|
+
* @handleName createICollectionRow
|
|
154
|
+
*
|
|
155
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
156
|
+
* @param {ICollectionFormObject} body - Object for creating a record. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
|
|
157
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
158
|
+
*
|
|
159
|
+
* @return {any} Returns object of type ICollectionRow.
|
|
160
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
161
|
+
*
|
|
162
|
+
* @description Create a record in the collection.
|
|
126
163
|
*/
|
|
127
164
|
async createICollectionRow(marker, body, langCode = this.state.lang) {
|
|
128
|
-
const response = await this._fetchPost(`/marker/${marker}/rows
|
|
165
|
+
const response = await this._fetchPost(`/marker/${marker}/rows?langCode=${langCode}`, body);
|
|
129
166
|
return this._normalizeData(response, langCode);
|
|
130
167
|
}
|
|
131
168
|
/**
|
|
132
|
-
* Edit a record in the collection
|
|
133
|
-
*
|
|
134
|
-
* @
|
|
135
|
-
*
|
|
136
|
-
* @param {
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"value": "Collection marker"
|
|
146
|
-
}
|
|
147
|
-
]
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
*
|
|
151
|
-
* @param {string} [langCode] - language code
|
|
152
|
-
*
|
|
153
|
-
* @returns Returns object
|
|
169
|
+
* Edit a record in the collection.
|
|
170
|
+
*
|
|
171
|
+
* @handleName updateICollectionRow
|
|
172
|
+
*
|
|
173
|
+
* @param {string} marker - Text identifier of the collection. Example: "collection1".
|
|
174
|
+
* @param {number} id - Row identifier in the collection. Example: 12.
|
|
175
|
+
* @param {object} body - Object for updating a record in the collection. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
|
|
176
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
177
|
+
*
|
|
178
|
+
* @return {ICollectionRow} Returns object of type ICollectionRow.
|
|
179
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
180
|
+
*
|
|
181
|
+
* @description Edit a record in the collection.
|
|
154
182
|
*/
|
|
155
183
|
async updateICollectionRow(marker, id, body, langCode = this.state.lang) {
|
|
156
|
-
const response = await this._fetchPut(`/marker/${marker}/rows/${id}
|
|
184
|
+
const response = await this._fetchPut(`/marker/${marker}/rows/${id}?` + `langCode=${langCode}`, body);
|
|
157
185
|
return this._normalizeData(response, langCode);
|
|
158
186
|
}
|
|
159
187
|
/**
|
|
160
188
|
* Deletion of collection record object
|
|
161
189
|
*
|
|
162
|
-
* @
|
|
163
|
-
*
|
|
190
|
+
* @handleName deleteICollectionRowByMarkerAndId
|
|
191
|
+
*
|
|
192
|
+
* @param {string} marker - text identifier of the collection Example: "collection1".
|
|
193
|
+
* @param {number} id - record identifier in the collection Example: 12.
|
|
194
|
+
*
|
|
195
|
+
* @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
196
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
164
197
|
*
|
|
165
|
-
* @
|
|
198
|
+
* @description
|
|
166
199
|
*/
|
|
167
200
|
async deleteICollectionRowByMarkerAndId(marker, id) {
|
|
168
201
|
const result = await this._fetchDelete(`/marker/${marker}/rows/${id}`);
|
|
@@ -1,35 +1,135 @@
|
|
|
1
1
|
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* @interface ICollectionsApi
|
|
4
4
|
*
|
|
5
|
-
* @property {function}
|
|
6
|
-
* @property {function}
|
|
7
|
-
* @property {function}
|
|
8
|
-
* @property {function}
|
|
9
|
-
* @property {function}
|
|
10
|
-
* @property {function}
|
|
11
|
-
* @property {function}
|
|
12
|
-
* @property {function}
|
|
5
|
+
* @property {function} getICollections - Get all collections.
|
|
6
|
+
* @property {function} getICollectionById - Get a single collection object.
|
|
7
|
+
* @property {function} getICollectionRowsById - Get all records belonging to the collection by collection id.
|
|
8
|
+
* @property {function} validateICollectionMarker - Check for the existence of a text identifier (marker).
|
|
9
|
+
* @property {function} getICollectionRowsByMarker - Getting all records (row) from the collection.
|
|
10
|
+
* @property {function} getICollectionRowByMarkerAndId - Getting one record (rows) from the collection.
|
|
11
|
+
* @property {function} createICollectionRow - Create a record (row) in the collection.
|
|
12
|
+
* @property {function} updateICollectionRow - Edit a record (row) in the collection.
|
|
13
|
+
* @property {function} deleteICollectionRowByMarkerAndId - Deletion of collection record object (row).
|
|
14
|
+
*
|
|
15
|
+
* @description This interface defines methods for managing collections and their records in the system.
|
|
13
16
|
*/
|
|
14
17
|
interface ICollectionsApi {
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Get all collections.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
22
|
+
* @param {any} [userQuery] - Optional set query parameters.
|
|
23
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
24
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
25
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: .
|
|
26
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: .
|
|
27
|
+
*
|
|
28
|
+
* @return {ICollection[]} Returns an array of ICollection objects or an error object if there was an issue.
|
|
29
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
30
|
+
*/
|
|
31
|
+
getICollections(marker: string, langCode: string, userQuery?: any): Promise<Array<ICollection> | IError>;
|
|
32
|
+
/**
|
|
33
|
+
* Get a single collection object by id.
|
|
34
|
+
*
|
|
35
|
+
* @param {number} id - Collection id. Example: 1.
|
|
36
|
+
* @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.
|
|
39
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
40
|
+
*/
|
|
41
|
+
getICollectionById(id: number, langCode: string): Promise<ICollection | IError>;
|
|
42
|
+
/**
|
|
43
|
+
* Get all records belonging to the collection by collection id.
|
|
44
|
+
*
|
|
45
|
+
* @param {number} id - Collection id.
|
|
46
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
47
|
+
* @param {any} [userQuery] - Optional set query parameters.
|
|
48
|
+
*
|
|
49
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
50
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
51
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: .
|
|
52
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: .
|
|
53
|
+
*
|
|
54
|
+
* @return {ICollectionResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
55
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
56
|
+
*/
|
|
17
57
|
getICollectionRowsById(id: number, langCode: string, userQuery?: any): Promise<any | IError>;
|
|
58
|
+
/**
|
|
59
|
+
* Check for the existence of a text identifier (marker).
|
|
60
|
+
*
|
|
61
|
+
* @param {string} marker - Collection marker. Example: "collection1".
|
|
62
|
+
*
|
|
63
|
+
* @return {any} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
|
|
64
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
65
|
+
*/
|
|
18
66
|
validateICollectionMarker(marker: string): Promise<any | IError>;
|
|
67
|
+
/**
|
|
68
|
+
* Getting all records from the collection.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
71
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
72
|
+
*
|
|
73
|
+
* @return {any} Returns CollectionRowEntity object.
|
|
74
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
75
|
+
*/
|
|
76
|
+
getICollectionRowsByMarker(marker: string, langCode?: string): Promise<any | IError>;
|
|
77
|
+
/**
|
|
78
|
+
* Getting one record from the collection.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
81
|
+
* @param {number} id - Collection record identifier. Example: 1.
|
|
82
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
83
|
+
*
|
|
84
|
+
* @return {any} Returns CollectionRowEntity object.
|
|
85
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
86
|
+
*/
|
|
19
87
|
getICollectionRowByMarkerAndId(marker: string, id: number, langCode: string): Promise<any | IError>;
|
|
88
|
+
/**
|
|
89
|
+
* Create a record in the collection.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
92
|
+
* @param {ICollectionFormObject} body - Object for creating a record. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
|
|
93
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
94
|
+
*
|
|
95
|
+
* @return {any} Returns object of type ICollectionRow.
|
|
96
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
97
|
+
*/
|
|
20
98
|
createICollectionRow(marker: string, body: any, langCode: string): Promise<Array<any> | IError>;
|
|
99
|
+
/**
|
|
100
|
+
* Edit a record in the collection.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} marker - Text identifier of the collection. Example: "collection1".
|
|
103
|
+
* @param {number} id - Row id. Example: 12.
|
|
104
|
+
* @param {object} body - Object for updating a record in the collection. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
|
|
105
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
106
|
+
*
|
|
107
|
+
* @return {ICollectionRow} Returns object of type ICollectionRow.
|
|
108
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
109
|
+
*/
|
|
21
110
|
updateICollectionRow(marker: string, id: number, body: any, langCode: string): Promise<any | IError>;
|
|
111
|
+
/**
|
|
112
|
+
* Deletion of collection record object
|
|
113
|
+
*
|
|
114
|
+
* @param {string} marker - text identifier of the collection Example: "collection1".
|
|
115
|
+
* @param {number} id - record identifier in the collection Example: 12.
|
|
116
|
+
*
|
|
117
|
+
* @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
118
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
119
|
+
*/
|
|
22
120
|
deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<any | IError>;
|
|
23
121
|
}
|
|
24
122
|
/**
|
|
25
|
-
* ICollection
|
|
123
|
+
* @interface ICollection
|
|
124
|
+
*
|
|
125
|
+
* @property {number} id - Object identifier. Example: 1.
|
|
126
|
+
* @property {string | null} identifier - Text identifier for record field. Example: "collection1".
|
|
127
|
+
* @property {number | null} formId - Identifier for the form used by the order storage. Example: 1234.
|
|
128
|
+
* @property {object} localizeInfos - Localized information about the collection. Example: .
|
|
129
|
+
* @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
|
+
* @property {string | null} selectedAttributeMarkers - Text identifiers of form object attributes for display in the data table. Example: "collection_marker".
|
|
26
131
|
*
|
|
27
|
-
* @
|
|
28
|
-
* @property {object} [localizeInfos] - Name considering localization
|
|
29
|
-
* @property {string | null} [identifier] - Text identifier for record field
|
|
30
|
-
* @property {number | null} [formId] - Identifier for the form used by the order storage
|
|
31
|
-
* @property {string | null} [attributeSetId] - Identifier of the set of attributes used by the form attached to the collection
|
|
32
|
-
* @property {string | null} [selectedAttributeMarkers] - Text identifiers of form object attributes for display in the data table
|
|
132
|
+
* @description Represents a collection object with various properties, including identifiers, form information, and localized data.
|
|
33
133
|
*/
|
|
34
134
|
interface ICollection {
|
|
35
135
|
id: number;
|
|
@@ -40,21 +140,25 @@ interface ICollection {
|
|
|
40
140
|
selectedAttributeMarkers: string | null;
|
|
41
141
|
}
|
|
42
142
|
/**
|
|
43
|
-
* ICollectionResponce
|
|
143
|
+
* @interface ICollectionResponce
|
|
144
|
+
*
|
|
145
|
+
* @property {ICollection[]} items - Array of collection objects. Example: [{ id: 1, identifier: "collection1", ... }].
|
|
146
|
+
* @property {number} total - Total number of found records. Example: 10.
|
|
44
147
|
*
|
|
45
|
-
* @
|
|
46
|
-
* @property {number} total -
|
|
148
|
+
* @description Represents a response from the collections API containing a total count and an array of collection objects.
|
|
47
149
|
*/
|
|
48
150
|
interface ICollectionResponce {
|
|
49
151
|
items: ICollection[];
|
|
50
152
|
total: number;
|
|
51
153
|
}
|
|
52
154
|
/**
|
|
53
|
-
* ICollectionFormData
|
|
155
|
+
* @interface ICollectionFormData
|
|
54
156
|
*
|
|
55
|
-
* @property {string} marker -
|
|
56
|
-
* @property {string} type -
|
|
57
|
-
* @property {string} value -
|
|
157
|
+
* @property {string} marker - Text identifier (marker) of the form field. Example: "collection_marker".
|
|
158
|
+
* @property {string} type - Type of the form field, such as 'text', 'number', 'date', etc. Example: "string".
|
|
159
|
+
* @property {string} value - Value of the form field, which can be a string, number, date, etc. Example: "Collection marker".
|
|
160
|
+
*
|
|
161
|
+
* @description Represents a form data object within a collection, containing a marker, type, and value.
|
|
58
162
|
*/
|
|
59
163
|
interface ICollectionFormData {
|
|
60
164
|
marker: string;
|
|
@@ -62,10 +166,12 @@ interface ICollectionFormData {
|
|
|
62
166
|
value: string;
|
|
63
167
|
}
|
|
64
168
|
/**
|
|
65
|
-
* ICollectionFormObject
|
|
169
|
+
* @interface ICollectionFormObject
|
|
170
|
+
*
|
|
171
|
+
* @property {string} formIdentifier - Text identifier (marker) of the form. Example: "collection-form".
|
|
172
|
+
* @property {ICollectionFormData[]} formData - An object where keys are form field markers and values are arrays of ICollectionFormData objects. Example: .
|
|
66
173
|
*
|
|
67
|
-
* @
|
|
68
|
-
* @property {object} formData -
|
|
174
|
+
* @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.
|
|
69
175
|
*/
|
|
70
176
|
interface ICollectionFormObject {
|
|
71
177
|
formIdentifier: string;
|
|
@@ -74,7 +180,18 @@ interface ICollectionFormObject {
|
|
|
74
180
|
};
|
|
75
181
|
}
|
|
76
182
|
/**
|
|
77
|
-
* ICollectionRow
|
|
183
|
+
* @interface ICollectionRow
|
|
184
|
+
*
|
|
185
|
+
* @property {number} id - Object identifier. Example: 1.
|
|
186
|
+
* @property {string} createdDate - Date of creation of the record. Example: "2023-01-01T00:00:00Z".
|
|
187
|
+
* @property {string} updatedDate - Date of last update of the record. Example: "2023-01-02T00:00:00Z".
|
|
188
|
+
* @property {any} entityId - Identifier of the entity associated with the collection row. Example: 12345.
|
|
189
|
+
* @property {any} entityType - Type of the entity associated with the collection row. Example: "product", "order", etc.
|
|
190
|
+
* @property {ICollectionFormData[]} formData - Array of form data objects associated with the collection row. Example: .
|
|
191
|
+
* @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.
|
|
192
|
+
* @property {string} [total] - Total value associated with the collection row, if applicable. Example: "100.00".
|
|
193
|
+
*
|
|
194
|
+
* @description Represents a row in a collection, containing various properties such as identifiers, dates, form data, and an optional total value.
|
|
78
195
|
*/
|
|
79
196
|
interface ICollectionRow {
|
|
80
197
|
id: number;
|
|
@@ -87,7 +204,12 @@ interface ICollectionRow {
|
|
|
87
204
|
total?: string;
|
|
88
205
|
}
|
|
89
206
|
/**
|
|
90
|
-
*
|
|
207
|
+
* @interface ICollectionRowsResponce
|
|
208
|
+
*
|
|
209
|
+
* @property {ICollectionRow[]} items - Array of collection row objects. Example: .
|
|
210
|
+
* @property {number} total - Total number of found records. Example: 10.
|
|
211
|
+
*
|
|
212
|
+
* @description Represents a response from the collections API containing a total count and an array of collection row objects.
|
|
91
213
|
*/
|
|
92
214
|
interface ICollectionRowsResponce {
|
|
93
215
|
items: ICollectionRow[];
|
|
@@ -13,7 +13,12 @@ export default class LocalesApi extends AsyncModules implements ILocales {
|
|
|
13
13
|
/**
|
|
14
14
|
* Find all active language localization objects.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
16
|
+
* @handleName getLocales
|
|
17
|
+
*
|
|
18
|
+
* @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
|
|
19
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
20
|
+
*
|
|
21
|
+
* @description
|
|
17
22
|
*/
|
|
18
23
|
getLocales(): Promise<Array<ILocalEntity> | IError>;
|
|
19
24
|
}
|
|
@@ -16,7 +16,12 @@ class LocalesApi extends asyncModules_1.default {
|
|
|
16
16
|
/**
|
|
17
17
|
* Find all active language localization objects.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
19
|
+
* @handleName getLocales
|
|
20
|
+
*
|
|
21
|
+
* @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
|
|
22
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
23
|
+
*
|
|
24
|
+
* @description
|
|
20
25
|
*/
|
|
21
26
|
async getLocales() {
|
|
22
27
|
const result = await this._fetchGet('/active/all');
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
import type { IError } from '../base/utils';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* @interface ILocales
|
|
4
4
|
*
|
|
5
5
|
* @property {function} getLocales - Find all active language localization objects.
|
|
6
|
+
*
|
|
7
|
+
* @description This interface defines a method for retrieving all active language localization objects in the system.
|
|
6
8
|
*/
|
|
7
9
|
interface ILocales {
|
|
10
|
+
/**
|
|
11
|
+
* Find all active language localization objects.
|
|
12
|
+
*
|
|
13
|
+
* @return {ILocalEntity[]} Returns an array of LocaleEntity objects.
|
|
14
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
|
+
*/
|
|
8
16
|
getLocales(): Promise<Array<ILocalEntity> | IError>;
|
|
9
17
|
}
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
19
|
+
* @interface ILocalEntity
|
|
20
|
+
*
|
|
21
|
+
* @property {number} id - The unique identifier of the locales. Example: 1.
|
|
22
|
+
* @property {string} shortCode - The shortCode of locales. Example: "en".
|
|
23
|
+
* @property {string} code - The full language code. Example: "en_US".
|
|
24
|
+
* @property {string} name - The language name. Example: "English".
|
|
25
|
+
* @property {string} nativeName - The native language name. Example: "English".
|
|
26
|
+
* @property {boolean} isActive - Active language flag. Example: true.
|
|
27
|
+
* @property {string} image - The language image. Example: "https://example.com/images/en.png".
|
|
28
|
+
* @property {number} position - The language position. Example: 1.
|
|
12
29
|
*
|
|
13
|
-
* @interface
|
|
14
|
-
* @property {number} id - The unique identifier of the locales.
|
|
15
|
-
* @property {string} shortCode - The shortCode of locales.
|
|
16
|
-
* @property {string} code - The full language code.
|
|
17
|
-
* @property {string} name - The language name.
|
|
18
|
-
* @property {string} nativeName - The native language name.
|
|
19
|
-
* @property {boolean} isActive - Active language flag.
|
|
20
|
-
* @property {string} image - The language image.
|
|
21
|
-
* @property {number} position - The language position.
|
|
30
|
+
* @description This interface defines the structure of a locales entity, including its identifiers, name, and other properties.
|
|
22
31
|
*/
|
|
23
32
|
interface ILocalEntity {
|
|
24
33
|
id: number;
|
package/dist/menus/menusApi.d.ts
CHANGED
|
@@ -13,10 +13,15 @@ export default class MenusApi extends AsyncModules implements IMenus {
|
|
|
13
13
|
/**
|
|
14
14
|
* Get pages includes in menu by marker.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @param {string} [langCode] - Language code
|
|
16
|
+
* @handleName getMenusByMarker
|
|
18
17
|
*
|
|
19
|
-
* @
|
|
18
|
+
* @param {string} marker - Menu marker. Example: "main_menu".
|
|
19
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
20
|
+
*
|
|
21
|
+
* @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
|
|
22
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
23
|
+
*
|
|
24
|
+
* @description
|
|
20
25
|
*/
|
|
21
26
|
getMenusByMarker(marker: string, langCode?: string): Promise<IMenusEntity | IError>;
|
|
22
27
|
}
|
package/dist/menus/menusApi.js
CHANGED
|
@@ -16,10 +16,15 @@ class MenusApi extends asyncModules_1.default {
|
|
|
16
16
|
/**
|
|
17
17
|
* Get pages includes in menu by marker.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
20
|
-
* @param {string} [langCode] - Language code
|
|
19
|
+
* @handleName getMenusByMarker
|
|
21
20
|
*
|
|
22
|
-
* @
|
|
21
|
+
* @param {string} marker - Menu marker. Example: "main_menu".
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
*
|
|
24
|
+
* @return {IMenusEntity} Returns a single menu object as a ContentMenu object with included pages.
|
|
25
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
|
+
*
|
|
27
|
+
* @description
|
|
23
28
|
*/
|
|
24
29
|
async getMenusByMarker(marker, langCode = this.state.lang) {
|
|
25
30
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|