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
|
@@ -1,26 +1,64 @@
|
|
|
1
1
|
import type { IUploadingQuery } from 'file-uploading/fileUploadingInterfaces';
|
|
2
2
|
import type { IError } from '../base/utils';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Interface for retrieving and posting form data in the system.
|
|
5
|
+
*
|
|
6
|
+
* @interface IFormsData
|
|
5
7
|
*
|
|
6
8
|
* @property {function} getFormsData - Get all forms data.
|
|
7
9
|
* @property {function} postFormsData - Find all product page objects with pagination and multiple filtering.
|
|
8
10
|
* @property {function} getFormsDataByMarker - Get one object of form data by marker.
|
|
11
|
+
*
|
|
12
|
+
* @description This interface defines methods for retrieving and posting form data in the system.
|
|
9
13
|
*/
|
|
10
14
|
interface IFormsData {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves all forms data.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} langCode - The language code for localization. Default: "en_US".
|
|
19
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
20
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
21
|
+
*
|
|
22
|
+
* @return {IFormsDataEntity} A promise that resolves to a collection of form data entities or an error.
|
|
23
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
24
|
+
*/
|
|
11
25
|
getFormsData(langCode: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
26
|
+
/**
|
|
27
|
+
* Posts form data to the system.
|
|
28
|
+
*
|
|
29
|
+
* @param {IFormsPost} data - The form data to be posted.
|
|
30
|
+
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
31
|
+
*
|
|
32
|
+
* @return {IFormDataEntity} A promise that resolves to a form data entity or an error.
|
|
33
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
34
|
+
*/
|
|
12
35
|
postFormsData(data: IFormsPost, langCode?: string): Promise<IFormDataEntity | IError>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves form data by its marker.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} marker - The marker identifying the form data. Example: "contact_form_data".
|
|
40
|
+
* @param {string} langCode - The language code for localization. Default: "en_US".
|
|
41
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
42
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
43
|
+
*
|
|
44
|
+
* @returns {IFormsDataEntity} A promise that resolves to a form data entity or an error.
|
|
45
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
46
|
+
*/
|
|
13
47
|
getFormsDataByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
14
48
|
}
|
|
15
49
|
/**
|
|
16
|
-
* Represents a form data.
|
|
50
|
+
* Represents the structure of a form data entity.
|
|
17
51
|
*
|
|
18
|
-
* @interface
|
|
19
|
-
*
|
|
20
|
-
* @property {
|
|
21
|
-
* @property {
|
|
22
|
-
* @property {
|
|
23
|
-
* @property {
|
|
52
|
+
* @interface IFormDataEntity
|
|
53
|
+
*
|
|
54
|
+
* @property {number} id - The unique identifier of the form page. Example: 12345.
|
|
55
|
+
* @property {string} formIdentifier - The identifier of the page. Example: "contact_form".
|
|
56
|
+
* @property {Date | string} time - The identifier of the form. Example: "2023-10-01T12:00:00Z".
|
|
57
|
+
* @property {IFormsPost} formData - The identifier of the position. Example: .
|
|
58
|
+
* @property {string} [attributeSetIdentifier] - Text identifier (marker) of the used attribute set. Example: "product_attributes".
|
|
59
|
+
* @property {string} [actionMessage] - Action message for the form data. Example: "Form submitted successfully".
|
|
60
|
+
*
|
|
61
|
+
* @description This interface defines the structure of a form data entity, including its identifiers, form data, and optional attributes.
|
|
24
62
|
*/
|
|
25
63
|
interface IFormDataEntity {
|
|
26
64
|
id: number;
|
|
@@ -31,11 +69,14 @@ interface IFormDataEntity {
|
|
|
31
69
|
actionMessage?: string;
|
|
32
70
|
}
|
|
33
71
|
/**
|
|
34
|
-
* Represents a form data.
|
|
72
|
+
* Represents a collection of form data entities.
|
|
73
|
+
*
|
|
74
|
+
* @interface IFormsDataEntity
|
|
35
75
|
*
|
|
36
|
-
* @
|
|
37
|
-
* @property {
|
|
38
|
-
*
|
|
76
|
+
* @property {number} total - Total number of found records. Example: 100.
|
|
77
|
+
* @property {Array<IFormDataEntity>} items - Array of form data objects. Example: .
|
|
78
|
+
*
|
|
79
|
+
* @description This interface defines the structure of a collection of form data entities, including a total count and an array of items.
|
|
39
80
|
*/
|
|
40
81
|
interface IFormsDataEntity {
|
|
41
82
|
total: number;
|
|
@@ -46,12 +87,17 @@ interface IFormsDataEntity {
|
|
|
46
87
|
*/
|
|
47
88
|
type FormDataType = IBodyTypeStringNumberFloat | IBodyTypeTimeDate | IBodyTypeText | IBodyTypeTextWithHeader | IBodyTypeImageGroupOfImages | IBodyTypeFile | IBodyTypeRadioButtonList | Record<string, any>;
|
|
48
89
|
/**
|
|
49
|
-
*
|
|
90
|
+
* Represents the structure of a form post object.
|
|
91
|
+
*
|
|
92
|
+
* @interface IFormsPost
|
|
50
93
|
*
|
|
51
|
-
* @property {number} id
|
|
94
|
+
* @property {number} [id] - Optional identifier of the form post.
|
|
52
95
|
* @property {string} formIdentifier - The identifier of the page.
|
|
53
|
-
* @property {Date | string} time - Date and time of form modification
|
|
96
|
+
* @property {Date | string} [time] - Date and time of form modification.
|
|
54
97
|
* @property {Array<FormDataType>} formData - The identifier of the page.
|
|
98
|
+
* @property {IUploadingQuery} [fileQuery] - Optional file query for uploading files.
|
|
99
|
+
*
|
|
100
|
+
* @description This interface defines the structure of a form post object, including its identifiers, time, form data, and optional file query.
|
|
55
101
|
*/
|
|
56
102
|
interface IFormsPost {
|
|
57
103
|
id?: number;
|
|
@@ -61,9 +107,15 @@ interface IFormsPost {
|
|
|
61
107
|
fileQuery?: IUploadingQuery;
|
|
62
108
|
}
|
|
63
109
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @
|
|
110
|
+
* Represents a form data entity with a simple value.
|
|
111
|
+
*
|
|
112
|
+
* @interface IBodyTypeStringNumberFloat
|
|
113
|
+
*
|
|
114
|
+
* @property {string} marker - marker name.
|
|
115
|
+
* @property {'string' | 'number' | 'float'} type - Type value.
|
|
116
|
+
* @property {string} value - Value of the form data entity, which can be a string, number, or float.
|
|
117
|
+
*
|
|
118
|
+
* @description Represents a form data entity with a marker, type, and value.
|
|
67
119
|
*/
|
|
68
120
|
interface IBodyTypeStringNumberFloat {
|
|
69
121
|
marker: string;
|
|
@@ -71,9 +123,15 @@ interface IBodyTypeStringNumberFloat {
|
|
|
71
123
|
value: string;
|
|
72
124
|
}
|
|
73
125
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* @
|
|
126
|
+
* Represents a date/time form data entity.
|
|
127
|
+
*
|
|
128
|
+
* @interface IBodyTypeTimeDate
|
|
129
|
+
*
|
|
130
|
+
* @property {string} marker - marker name.
|
|
131
|
+
* @property {'date' | 'dateTime' | 'time'} type - Type value.
|
|
132
|
+
* @property {object} value - Date object. Contains fullDate, formattedValue, formatString.
|
|
133
|
+
*
|
|
134
|
+
* @description Represents a date, dateTime, or time value in a structured format.
|
|
77
135
|
*/
|
|
78
136
|
interface IBodyTypeTimeDate {
|
|
79
137
|
marker: string;
|
|
@@ -85,9 +143,15 @@ interface IBodyTypeTimeDate {
|
|
|
85
143
|
};
|
|
86
144
|
}
|
|
87
145
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
146
|
+
* Represents a text form data entity.
|
|
147
|
+
*
|
|
148
|
+
* @interface IBodyTypeText
|
|
149
|
+
*
|
|
150
|
+
* @property {string} marker - marker name.
|
|
151
|
+
* @property {'text'} type - Type value.
|
|
152
|
+
* @property {object} value - Text Object. Contains html as string, plain text and params.
|
|
153
|
+
*
|
|
154
|
+
* @description Represents a text value with HTML and plain text representations, along with parameters for editor and image compression settings.
|
|
91
155
|
*/
|
|
92
156
|
interface IBodyTypeText {
|
|
93
157
|
marker: string;
|
|
@@ -102,9 +166,15 @@ interface IBodyTypeText {
|
|
|
102
166
|
};
|
|
103
167
|
}
|
|
104
168
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
169
|
+
* Represents a text with header form data entity.
|
|
170
|
+
*
|
|
171
|
+
* @interface IBodyTypeTextWithHeader
|
|
172
|
+
*
|
|
173
|
+
* @property {string} marker - marker name.
|
|
174
|
+
* @property {'textWithHeader'} type - Type value.
|
|
175
|
+
* @property {object} value - Text Object. Contains html as string, header and params.
|
|
176
|
+
*
|
|
177
|
+
* @description Represents a text value with a header, HTML and plain text representations, along with parameters for editor and image compression settings.
|
|
108
178
|
*/
|
|
109
179
|
interface IBodyTypeTextWithHeader {
|
|
110
180
|
marker: string;
|
|
@@ -120,9 +190,15 @@ interface IBodyTypeTextWithHeader {
|
|
|
120
190
|
};
|
|
121
191
|
}
|
|
122
192
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @
|
|
193
|
+
* Represents an image or group of images form data entity.
|
|
194
|
+
*
|
|
195
|
+
* @interface IBodyTypeImageGroupOfImages
|
|
196
|
+
*
|
|
197
|
+
* @property {string} marker - marker name.
|
|
198
|
+
* @property {'image' | 'groupOfImage'} type - Type value.
|
|
199
|
+
* @property {object} value - Image Object. Contains image information.
|
|
200
|
+
*
|
|
201
|
+
* @description Represents an image or a group of images with their details, including filename, download link, size, preview link, and parameters for image compression.
|
|
126
202
|
*/
|
|
127
203
|
interface IBodyTypeImageGroupOfImages {
|
|
128
204
|
marker: string;
|
|
@@ -146,9 +222,15 @@ interface IBodyTypeImageGroupOfImages {
|
|
|
146
222
|
}>;
|
|
147
223
|
}
|
|
148
224
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @
|
|
225
|
+
* Represents a file form data entity.
|
|
226
|
+
*
|
|
227
|
+
* @interface IBodyTypeFile
|
|
228
|
+
*
|
|
229
|
+
* @property {string} marker - marker name.
|
|
230
|
+
* @property {'file'} type - Type value.
|
|
231
|
+
* @property {object} value - File Object. Contains file information.
|
|
232
|
+
*
|
|
233
|
+
* @description Represents a file with its details, including filename, download link, and size.
|
|
152
234
|
*/
|
|
153
235
|
interface IBodyTypeFile {
|
|
154
236
|
marker: string;
|
|
@@ -160,9 +242,15 @@ interface IBodyTypeFile {
|
|
|
160
242
|
};
|
|
161
243
|
}
|
|
162
244
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
245
|
+
* Represents a radio button or list selection form data entity.
|
|
246
|
+
*
|
|
247
|
+
* @interface IBodyTypeRadioButtonList
|
|
248
|
+
*
|
|
249
|
+
* @property {string} marker - marker name.
|
|
250
|
+
* @property {'file'} type - Type value.
|
|
165
251
|
* @property {array} value - Array of list or radioButton bojects.
|
|
252
|
+
*
|
|
253
|
+
* @description Represents a list or radio button selection with multiple options, each containing a title, value, and extended information.
|
|
166
254
|
*/
|
|
167
255
|
interface IBodyTypeRadioButtonList {
|
|
168
256
|
marker: string;
|
|
@@ -4,7 +4,13 @@ import type { IError } from '../base/utils';
|
|
|
4
4
|
import type { IGeneralTypes, IGeneralTypesEntity } from './generalTypesInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with types
|
|
7
|
+
*
|
|
7
8
|
* @handle /api/content/general-types
|
|
9
|
+
* @class GeneralTypesApi
|
|
10
|
+
* @extends AsyncModules
|
|
11
|
+
* @implements {IGeneralTypes}
|
|
12
|
+
*
|
|
13
|
+
* @description This class provides methods to interact with general types, including retrieving all types.
|
|
8
14
|
*/
|
|
9
15
|
export default class GeneralTypesApi extends AsyncModules implements IGeneralTypes {
|
|
10
16
|
protected state: StateModule;
|
|
@@ -13,7 +19,12 @@ export default class GeneralTypesApi extends AsyncModules implements IGeneralTyp
|
|
|
13
19
|
/**
|
|
14
20
|
* Get all types.
|
|
15
21
|
*
|
|
16
|
-
* @
|
|
22
|
+
* @handleName getAllTypes
|
|
23
|
+
*
|
|
24
|
+
* @return {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
25
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
26
|
+
*
|
|
27
|
+
* @description This method retrieves all general types available in the system.
|
|
17
28
|
*/
|
|
18
29
|
getAllTypes(): Promise<Array<IGeneralTypesEntity> | IError>;
|
|
19
30
|
}
|
|
@@ -6,7 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
7
|
/**
|
|
8
8
|
* Controllers for working with types
|
|
9
|
+
*
|
|
9
10
|
* @handle /api/content/general-types
|
|
11
|
+
* @class GeneralTypesApi
|
|
12
|
+
* @extends AsyncModules
|
|
13
|
+
* @implements {IGeneralTypes}
|
|
14
|
+
*
|
|
15
|
+
* @description This class provides methods to interact with general types, including retrieving all types.
|
|
10
16
|
*/
|
|
11
17
|
class GeneralTypesApi extends asyncModules_1.default {
|
|
12
18
|
constructor(state) {
|
|
@@ -16,7 +22,12 @@ class GeneralTypesApi extends asyncModules_1.default {
|
|
|
16
22
|
/**
|
|
17
23
|
* Get all types.
|
|
18
24
|
*
|
|
19
|
-
* @
|
|
25
|
+
* @handleName getAllTypes
|
|
26
|
+
*
|
|
27
|
+
* @return {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
28
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
29
|
+
*
|
|
30
|
+
* @description This method retrieves all general types available in the system.
|
|
20
31
|
*/
|
|
21
32
|
async getAllTypes() {
|
|
22
33
|
const result = await this._fetchGet('');
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import type { BlockType } from 'blocks/blocksInterfaces';
|
|
2
2
|
import type { IError } from '../base/utils';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Interface for retrieving all general types in the system.
|
|
5
|
+
*
|
|
6
|
+
* @interface IGeneralTypes
|
|
5
7
|
*
|
|
6
8
|
* @property {function} getAllTypes - Get all types.
|
|
9
|
+
*
|
|
10
|
+
* @description This interface defines a method for retrieving all general types in the system.
|
|
7
11
|
*/
|
|
8
12
|
interface IGeneralTypes {
|
|
13
|
+
/**
|
|
14
|
+
* Get all types.
|
|
15
|
+
*
|
|
16
|
+
* @return {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
17
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
18
|
+
*/
|
|
9
19
|
getAllTypes(): Promise<Array<IGeneralTypesEntity> | IError>;
|
|
10
20
|
}
|
|
11
21
|
/**
|
|
12
|
-
* Represents a general
|
|
22
|
+
* Represents a general type entity.
|
|
23
|
+
*
|
|
24
|
+
* @interface IGeneralTypesEntity
|
|
25
|
+
*
|
|
26
|
+
* @property {number} id - Type id. Example: 1.
|
|
27
|
+
* @property {Types} type - Types enum. Example: 'product', 'category', etc.
|
|
13
28
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @property {number} id - Type id.
|
|
16
|
-
* @property {Types} type - Types enum.
|
|
29
|
+
* @description Represents a general type entity with an identifier and a type.
|
|
17
30
|
*/
|
|
18
31
|
interface IGeneralTypesEntity {
|
|
19
32
|
id: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ interface IDefineApi {
|
|
|
66
66
|
* @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
|
|
67
67
|
* @param {string} [config.auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated.
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
69
|
+
* @return List of methods set.
|
|
70
70
|
*/
|
|
71
71
|
export declare function defineOneEntry(url: string, config: IConfig): IDefineApi;
|
|
72
72
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ const wsApi_1 = __importDefault(require("./web-socket/wsApi"));
|
|
|
44
44
|
* @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
|
|
45
45
|
* @param {string} [config.auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated.
|
|
46
46
|
*
|
|
47
|
-
* @
|
|
47
|
+
* @return List of methods set.
|
|
48
48
|
*/
|
|
49
49
|
function defineOneEntry(url, config) {
|
|
50
50
|
const stateModule = new stateModule_1.default(url.endsWith('/') ? url.slice(0, -1) : url, config);
|
|
@@ -4,7 +4,13 @@ import type { IError } from '../base/utils';
|
|
|
4
4
|
import type { ICollection, ICollectionFormObject, ICollectionResponce, ICollectionRow, ICollectionsApi } from './integrationCollectionsInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with attributes.
|
|
7
|
+
*
|
|
7
8
|
* @handle /api/content/integration-collections
|
|
9
|
+
* @class IntegrationCollectionsApi
|
|
10
|
+
* @extends AsyncModules
|
|
11
|
+
* @implements {ICollectionsApi}
|
|
12
|
+
*
|
|
13
|
+
* @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
|
|
8
14
|
*/
|
|
9
15
|
export default class IntegrationCollectionsApi extends AsyncModules implements ICollectionsApi {
|
|
10
16
|
protected state: StateModule;
|
|
@@ -12,47 +18,68 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
12
18
|
constructor(state: StateModule);
|
|
13
19
|
private _defaultQuery;
|
|
14
20
|
/**
|
|
15
|
-
* Get all collections
|
|
21
|
+
* Get all collections.
|
|
16
22
|
*
|
|
17
|
-
* @
|
|
23
|
+
* @handleName getICollections
|
|
24
|
+
*
|
|
25
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
18
26
|
* @param {any} [userQuery] - Optional set query parameters.
|
|
27
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
28
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
29
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: 1.
|
|
30
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: orders.
|
|
19
31
|
*
|
|
20
|
-
* @
|
|
21
|
-
* @
|
|
32
|
+
* @return {ICollection[]} Returns an array of ICollection objects or an error object if there was an issue.
|
|
33
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
22
34
|
*
|
|
23
|
-
* @
|
|
35
|
+
* @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.
|
|
24
36
|
*/
|
|
25
37
|
getICollections(langCode?: string, userQuery?: any): Promise<Array<ICollection> | IError>;
|
|
26
38
|
/**
|
|
27
39
|
* Get a single collection object by id.
|
|
28
40
|
*
|
|
29
|
-
* @
|
|
30
|
-
*
|
|
41
|
+
* @handleName getICollectionById
|
|
42
|
+
*
|
|
43
|
+
* @param {number} id - Collection id. Example: 1.
|
|
44
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
45
|
+
*
|
|
46
|
+
* @return {ICollection} Returns an ICollection object or an error object if there was an issue.
|
|
47
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
31
48
|
*
|
|
32
|
-
* @
|
|
49
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
33
50
|
*/
|
|
34
51
|
getICollectionById(id: number, langCode?: string): Promise<ICollection | IError>;
|
|
35
52
|
/**
|
|
36
53
|
* Get all records belonging to the collection by collection id.
|
|
37
54
|
*
|
|
38
|
-
* @
|
|
39
|
-
*
|
|
40
|
-
* @param {
|
|
55
|
+
* @handleName getICollectionRowsById
|
|
56
|
+
*
|
|
57
|
+
* @param {number} id - Collection id. Example: 1.
|
|
58
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
59
|
+
* @param {any} [userQuery] - Optional set query parameters. Example: .
|
|
60
|
+
*
|
|
61
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
62
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
63
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: 1.
|
|
64
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: "orders".
|
|
41
65
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @
|
|
44
|
-
* @param {number} [userQuery.entityType] - Entity type. Example: 1
|
|
45
|
-
* @param {number} [userQuery.entityId] - Entity identifier. Example: orders
|
|
66
|
+
* @return {ICollectionResponce} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
67
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
46
68
|
*
|
|
47
|
-
* @
|
|
69
|
+
* @description Get all records belonging to the collection by collection id.
|
|
48
70
|
*/
|
|
49
71
|
getICollectionRowsById(id: number, langCode?: string, userQuery?: any): Promise<ICollectionResponce | IError>;
|
|
50
72
|
/**
|
|
51
|
-
* Check for the existence of a text identifier (marker)
|
|
73
|
+
* Check for the existence of a text identifier (marker).
|
|
52
74
|
*
|
|
53
|
-
* @
|
|
75
|
+
* @handleName validateICollectionMarker
|
|
54
76
|
*
|
|
55
|
-
* @
|
|
77
|
+
* @param {string} marker - Collection marker. Example: "collection1".
|
|
78
|
+
*
|
|
79
|
+
* @return {any} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
|
|
80
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
81
|
+
*
|
|
82
|
+
* @description
|
|
56
83
|
*/
|
|
57
84
|
validateICollectionMarker(marker: string): Promise<{
|
|
58
85
|
valid: boolean;
|
|
@@ -60,67 +87,61 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
60
87
|
/**
|
|
61
88
|
* Getting all records from the collection.
|
|
62
89
|
*
|
|
63
|
-
* @
|
|
64
|
-
*
|
|
90
|
+
* @handleName getICollectionRowsByMarker
|
|
91
|
+
*
|
|
92
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
93
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
65
94
|
*
|
|
66
|
-
* @
|
|
95
|
+
* @return {any} Returns CollectionRowEntity object.
|
|
96
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
97
|
+
*
|
|
98
|
+
* @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.
|
|
67
99
|
*/
|
|
68
100
|
getICollectionRowsByMarker(marker: string, langCode?: string): Promise<any | IError>;
|
|
69
101
|
/**
|
|
70
102
|
* Getting one record from the collection.
|
|
71
103
|
*
|
|
72
|
-
* @
|
|
73
|
-
*
|
|
74
|
-
* @param {string}
|
|
104
|
+
* @handleName getICollectionRowByMarkerAndId
|
|
105
|
+
*
|
|
106
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
107
|
+
* @param {number} id - Collection record identifier. Example: 1.
|
|
108
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
75
109
|
*
|
|
76
|
-
* @
|
|
110
|
+
* @return {any} Returns CollectionRowEntity object.
|
|
111
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
112
|
+
*
|
|
113
|
+
* @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.
|
|
77
114
|
*/
|
|
78
115
|
getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<any | IError>;
|
|
79
116
|
/**
|
|
80
|
-
* Create a record in the collection
|
|
81
|
-
*
|
|
82
|
-
* @
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
* @param {string} [langCode] - Language code.
|
|
97
|
-
*
|
|
98
|
-
* @description Create a record in the collection
|
|
117
|
+
* Create a record in the collection.
|
|
118
|
+
*
|
|
119
|
+
* @handleName createICollectionRow
|
|
120
|
+
*
|
|
121
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
122
|
+
* @param {ICollectionFormObject} body - Object for creating a record. Example: { "formIdentifier": "collection-form", "formData": { "en_US": [ { "marker": "collection_marker", "type": "string", "value": "Collection marker" } ] } }
|
|
123
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
124
|
+
*
|
|
125
|
+
* @return {any} Returns object of type ICollectionRow.
|
|
126
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
127
|
+
*
|
|
128
|
+
* @description Create a record in the collection.
|
|
99
129
|
*/
|
|
100
130
|
createICollectionRow(marker: string, body: ICollectionFormObject, langCode?: string): Promise<any | IError>;
|
|
101
131
|
/**
|
|
102
|
-
* Edit a record in the collection
|
|
103
|
-
*
|
|
104
|
-
* @
|
|
105
|
-
*
|
|
106
|
-
* @param {
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"value": "Collection marker"
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
*
|
|
121
|
-
* @param {string} [langCode] - language code
|
|
122
|
-
*
|
|
123
|
-
* @returns Returns object
|
|
132
|
+
* Edit a record in the collection.
|
|
133
|
+
*
|
|
134
|
+
* @handleName updateICollectionRow
|
|
135
|
+
*
|
|
136
|
+
* @param {string} marker - Text identifier of the collection. Example: "collection1".
|
|
137
|
+
* @param {number} id - Row identifier in the collection. Example: 12.
|
|
138
|
+
* @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" } ] } }
|
|
139
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
140
|
+
*
|
|
141
|
+
* @return {ICollectionRow} Returns object of type ICollectionRow.
|
|
142
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
143
|
+
*
|
|
144
|
+
* @description Edit a record in the collection.
|
|
124
145
|
*/
|
|
125
146
|
updateICollectionRow(marker: string, id: number, body: {
|
|
126
147
|
formIdentifier: string;
|
|
@@ -129,10 +150,15 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
|
|
|
129
150
|
/**
|
|
130
151
|
* Deletion of collection record object
|
|
131
152
|
*
|
|
132
|
-
* @
|
|
133
|
-
*
|
|
153
|
+
* @handleName deleteICollectionRowByMarkerAndId
|
|
154
|
+
*
|
|
155
|
+
* @param {string} marker - text identifier of the collection Example: "collection1".
|
|
156
|
+
* @param {number} id - record identifier in the collection Example: 12.
|
|
157
|
+
*
|
|
158
|
+
* @return {boolean} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
159
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
134
160
|
*
|
|
135
|
-
* @
|
|
161
|
+
* @description
|
|
136
162
|
*/
|
|
137
163
|
deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<boolean | IError>;
|
|
138
164
|
}
|