oneentry 1.0.123 → 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 +30 -9
- package/dist/admins/adminsApi.js +30 -9
- package/dist/admins/adminsInterfaces.d.ts +77 -32
- package/dist/attribute-sets/attributeSetsApi.d.ts +36 -22
- package/dist/attribute-sets/attributeSetsApi.js +41 -25
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +133 -39
- package/dist/auth-provider/authProviderApi.d.ts +209 -88
- package/dist/auth-provider/authProviderApi.js +226 -87
- package/dist/auth-provider/authProvidersInterfaces.d.ts +345 -18
- package/dist/base/asyncModules.d.ts +38 -28
- package/dist/base/asyncModules.js +178 -47
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +48 -44
- package/dist/base/syncModules.js +84 -64
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +48 -27
- package/dist/blocks/blocksApi.js +48 -27
- package/dist/blocks/blocksInterfaces.d.ts +126 -32
- package/dist/events/eventsApi.d.ts +45 -12
- package/dist/events/eventsApi.js +47 -12
- package/dist/events/eventsInterfaces.d.ts +50 -3
- package/dist/file-uploading/fileUploadingApi.d.ts +57 -29
- package/dist/file-uploading/fileUploadingApi.js +57 -30
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +90 -17
- package/dist/forms/formsApi.d.ts +20 -9
- package/dist/forms/formsApi.js +19 -8
- package/dist/forms/formsInterfaces.d.ts +86 -23
- package/dist/formsData/formsDataApi.d.ts +33 -21
- package/dist/formsData/formsDataApi.js +33 -21
- package/dist/formsData/formsDataInterfaces.d.ts +212 -41
- package/dist/general-types/generalTypesApi.d.ts +11 -2
- package/dist/general-types/generalTypesApi.js +10 -1
- package/dist/general-types/generalTypesInterfaces.d.ts +17 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/integration-collections/integrationCollectionsApi.d.ts +134 -81
- package/dist/integration-collections/integrationCollectionsApi.js +135 -83
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +246 -43
- package/dist/locales/localesApi.d.ts +5 -1
- package/dist/locales/localesApi.js +5 -1
- package/dist/locales/localesInterfaces.d.ts +19 -12
- package/dist/menus/menusApi.d.ts +6 -3
- package/dist/menus/menusApi.js +6 -3
- package/dist/menus/menusInterfaces.d.ts +60 -21
- package/dist/orders/ordersApi.d.ts +84 -66
- package/dist/orders/ordersApi.js +91 -71
- package/dist/orders/ordersInterfaces.d.ts +282 -86
- package/dist/pages/pagesApi.d.ts +101 -42
- package/dist/pages/pagesApi.js +93 -39
- package/dist/pages/pagesInterfaces.d.ts +218 -75
- package/dist/payments/paymentsApi.d.ts +53 -39
- package/dist/payments/paymentsApi.js +55 -40
- package/dist/payments/paymentsInterfaces.d.ts +121 -56
- package/dist/product-statuses/productStatusesApi.d.ts +17 -17
- package/dist/product-statuses/productStatusesApi.js +16 -19
- package/dist/product-statuses/productStatusesInterfaces.d.ts +43 -14
- package/dist/products/productsApi.d.ts +309 -177
- package/dist/products/productsApi.js +313 -167
- package/dist/products/productsInterfaces.d.ts +447 -81
- package/dist/system/systemApi.d.ts +42 -12
- package/dist/system/systemApi.js +43 -10
- package/dist/system/systemInterfaces.d.ts +7 -0
- package/dist/templates/templatesApi.d.ts +24 -20
- package/dist/templates/templatesApi.js +22 -21
- package/dist/templates/templatesInterfaces.d.ts +48 -22
- package/dist/templates-preview/templatesPreviewApi.d.ts +17 -17
- package/dist/templates-preview/templatesPreviewApi.js +16 -19
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +85 -32
- package/dist/users/usersApi.d.ts +59 -35
- package/dist/users/usersApi.js +62 -35
- package/dist/users/usersInterfaces.d.ts +136 -14
- package/dist/web-socket/wsApi.d.ts +4 -5
- package/dist/web-socket/wsApi.js +4 -5
- package/dist/web-socket/wsInterfaces.d.ts +2 -1
- package/package.json +20 -18
|
@@ -4,7 +4,12 @@ import type { IError } from '../base/utils';
|
|
|
4
4
|
import type { IFormDataEntity, IFormsData, IFormsDataEntity, IFormsPost } from './formsDataInterfaces';
|
|
5
5
|
/**
|
|
6
6
|
* Controllers for working with form data
|
|
7
|
+
*
|
|
7
8
|
* @handle /api/content/form-data
|
|
9
|
+
* @class FormsDataApi
|
|
10
|
+
* @extends AsyncModules
|
|
11
|
+
* @implements {IFormsData}
|
|
12
|
+
* @description This class provides methods to interact with form data, including retrieving all forms data, creating new form data entries, and fetching form data by marker.
|
|
8
13
|
*/
|
|
9
14
|
export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
10
15
|
protected state: StateModule;
|
|
@@ -13,53 +18,60 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
13
18
|
/**
|
|
14
19
|
* Get all forms data.
|
|
15
20
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
18
|
-
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
21
|
+
* @handleName getFormsData
|
|
19
22
|
*
|
|
20
|
-
* @
|
|
23
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
24
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
25
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
26
|
+
* @return {IFormsDataEntity} Returns an object containing all forms data or an error object if there was an issue.
|
|
27
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
+
* @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.
|
|
21
29
|
*/
|
|
22
30
|
getFormsData(langCode?: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
23
31
|
/**
|
|
24
32
|
* Creating an object of data save information by form
|
|
25
33
|
*
|
|
26
|
-
* @
|
|
27
|
-
* @param {string} [langCode] - Optional language field
|
|
34
|
+
* @handleName postFormsData
|
|
28
35
|
*
|
|
29
|
-
* @
|
|
30
|
-
|
|
36
|
+
* @param {object} body - Request body. Example:
|
|
37
|
+
{
|
|
31
38
|
"formIdentifier": "file",
|
|
32
39
|
"formData": [
|
|
33
40
|
{
|
|
34
41
|
"marker": "name",
|
|
35
42
|
"type": "string",
|
|
36
|
-
"value": "filesArray"
|
|
43
|
+
"value": "filesArray"
|
|
37
44
|
},
|
|
38
45
|
{
|
|
39
46
|
"marker": "file",
|
|
40
47
|
"type": "file",
|
|
41
48
|
"value": filesArray,
|
|
42
|
-
fileQuery: {
|
|
43
|
-
type:
|
|
44
|
-
entity:
|
|
45
|
-
id: 3492,
|
|
46
|
-
}
|
|
49
|
+
"fileQuery": {
|
|
50
|
+
"type": "page",
|
|
51
|
+
"entity": "editor",
|
|
52
|
+
"id": 3492,
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
]
|
|
49
56
|
}
|
|
50
|
-
*
|
|
51
|
-
* @
|
|
57
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
58
|
+
* @return {IFormDataEntity} Returns an object containing the created form data entry or an error object if there was an issue.
|
|
59
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
60
|
+
* @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
52
61
|
*/
|
|
53
62
|
postFormsData(body: IFormsPost, langCode?: string): Promise<IFormDataEntity | IError>;
|
|
54
63
|
/**
|
|
55
64
|
* Get one object of form data by marker.
|
|
56
65
|
*
|
|
57
|
-
* @
|
|
58
|
-
* @param {string} [langCode] - Language code. Default "en_US"
|
|
59
|
-
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
60
|
-
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
66
|
+
* @handleName getFormsDataByMarker
|
|
61
67
|
*
|
|
62
|
-
* @
|
|
68
|
+
* @param {string} marker - Marker of the form data. Example: "contact_form_data".
|
|
69
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
70
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
71
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
72
|
+
* @return {IFormsDataEntity} Returns an object containing the form data or an error object if there was an issue.
|
|
73
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
74
|
+
* @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.
|
|
63
75
|
*/
|
|
64
76
|
getFormsDataByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
65
77
|
}
|
|
@@ -8,7 +8,12 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
|
8
8
|
const fileUploadingApi_1 = __importDefault(require("../file-uploading/fileUploadingApi"));
|
|
9
9
|
/**
|
|
10
10
|
* Controllers for working with form data
|
|
11
|
+
*
|
|
11
12
|
* @handle /api/content/form-data
|
|
13
|
+
* @class FormsDataApi
|
|
14
|
+
* @extends AsyncModules
|
|
15
|
+
* @implements {IFormsData}
|
|
16
|
+
* @description This class provides methods to interact with form data, including retrieving all forms data, creating new form data entries, and fetching form data by marker.
|
|
12
17
|
*/
|
|
13
18
|
class FormsDataApi extends asyncModules_1.default {
|
|
14
19
|
constructor(state) {
|
|
@@ -18,11 +23,14 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
18
23
|
/**
|
|
19
24
|
* Get all forms data.
|
|
20
25
|
*
|
|
21
|
-
* @
|
|
22
|
-
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
23
|
-
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
26
|
+
* @handleName getFormsData
|
|
24
27
|
*
|
|
25
|
-
* @
|
|
28
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
29
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
30
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
31
|
+
* @return {IFormsDataEntity} Returns an object containing all forms data or an error object if there was an issue.
|
|
32
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
33
|
+
* @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.
|
|
26
34
|
*/
|
|
27
35
|
async getFormsData(langCode = this.state.lang, offset = 0, limit = 30) {
|
|
28
36
|
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
@@ -31,32 +39,33 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
31
39
|
/**
|
|
32
40
|
* Creating an object of data save information by form
|
|
33
41
|
*
|
|
34
|
-
* @
|
|
35
|
-
* @param {string} [langCode] - Optional language field
|
|
42
|
+
* @handleName postFormsData
|
|
36
43
|
*
|
|
37
|
-
* @
|
|
38
|
-
|
|
44
|
+
* @param {object} body - Request body. Example:
|
|
45
|
+
{
|
|
39
46
|
"formIdentifier": "file",
|
|
40
47
|
"formData": [
|
|
41
48
|
{
|
|
42
49
|
"marker": "name",
|
|
43
50
|
"type": "string",
|
|
44
|
-
"value": "filesArray"
|
|
51
|
+
"value": "filesArray"
|
|
45
52
|
},
|
|
46
53
|
{
|
|
47
54
|
"marker": "file",
|
|
48
55
|
"type": "file",
|
|
49
56
|
"value": filesArray,
|
|
50
|
-
fileQuery: {
|
|
51
|
-
type:
|
|
52
|
-
entity:
|
|
53
|
-
id: 3492,
|
|
54
|
-
}
|
|
57
|
+
"fileQuery": {
|
|
58
|
+
"type": "page",
|
|
59
|
+
"entity": "editor",
|
|
60
|
+
"id": 3492,
|
|
61
|
+
}
|
|
55
62
|
}
|
|
56
63
|
]
|
|
57
64
|
}
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
65
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
66
|
+
* @return {IFormDataEntity} Returns an object containing the created form data entry or an error object if there was an issue.
|
|
67
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
68
|
+
* @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.
|
|
60
69
|
*/
|
|
61
70
|
async postFormsData(body, langCode = this.state.lang) {
|
|
62
71
|
const formData = {};
|
|
@@ -114,12 +123,15 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
114
123
|
/**
|
|
115
124
|
* Get one object of form data by marker.
|
|
116
125
|
*
|
|
117
|
-
* @
|
|
118
|
-
* @param {string} [langCode] - Language code. Default "en_US"
|
|
119
|
-
* @param {number} [offset] - Parameter for pagination. Default 0
|
|
120
|
-
* @param {number} [limit] - Parameter for pagination. Default 30
|
|
126
|
+
* @handleName getFormsDataByMarker
|
|
121
127
|
*
|
|
122
|
-
* @
|
|
128
|
+
* @param {string} marker - Marker of the form data. Example: "contact_form_data".
|
|
129
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
130
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
131
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
132
|
+
* @return {IFormsDataEntity} Returns an object containing the form data or an error object if there was an issue.
|
|
133
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
134
|
+
* @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.
|
|
123
135
|
*/
|
|
124
136
|
async getFormsDataByMarker(marker, langCode = this.state.lang, offset = 0, limit = 30) {
|
|
125
137
|
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
@@ -1,26 +1,83 @@
|
|
|
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
|
+
* @description This interface defines methods for retrieving and posting form data in the system.
|
|
9
12
|
*/
|
|
10
13
|
interface IFormsData {
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves all forms data.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} langCode - The language code for localization. Default: "en_US".
|
|
18
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
19
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
20
|
+
* @return {IFormsDataEntity} A promise that resolves to a collection of form data entities or an error.
|
|
21
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
22
|
+
*/
|
|
11
23
|
getFormsData(langCode: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
24
|
+
/**
|
|
25
|
+
* Posts form data to the system.
|
|
26
|
+
*
|
|
27
|
+
* @param {IFormsPost} data - The form data to be posted. Example:
|
|
28
|
+
{
|
|
29
|
+
"id": 1,
|
|
30
|
+
"formIdentifier": "string",
|
|
31
|
+
"time": "string",
|
|
32
|
+
"formData": [],
|
|
33
|
+
"fileQuery": {
|
|
34
|
+
"type": null;
|
|
35
|
+
"entity": null;
|
|
36
|
+
"id": null;
|
|
37
|
+
"key": null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
41
|
+
* @return {IFormDataEntity} A promise that resolves to a form data entity or an error.
|
|
42
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
43
|
+
*/
|
|
12
44
|
postFormsData(data: IFormsPost, langCode?: string): Promise<IFormDataEntity | IError>;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves form data by its marker.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} marker - The marker identifying the form data. Example: "contact_form_data".
|
|
49
|
+
* @param {string} langCode - The language code for localization. Default: "en_US".
|
|
50
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
51
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
52
|
+
* @returns {IFormsDataEntity} A promise that resolves to a form data entity or an error.
|
|
53
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
54
|
+
*/
|
|
13
55
|
getFormsDataByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
14
56
|
}
|
|
15
57
|
/**
|
|
16
|
-
* Represents a form data.
|
|
17
|
-
*
|
|
18
|
-
* @interface
|
|
19
|
-
*
|
|
20
|
-
* @property {
|
|
21
|
-
* @property {
|
|
22
|
-
* @property {
|
|
23
|
-
* @property {
|
|
58
|
+
* Represents the structure of a form data entity.
|
|
59
|
+
*
|
|
60
|
+
* @interface IFormDataEntity
|
|
61
|
+
*
|
|
62
|
+
* @property {number} id - The unique identifier of the form page. Example: 12345.
|
|
63
|
+
* @property {string} formIdentifier - The identifier of the page. Example: "contact_form".
|
|
64
|
+
* @property {Date | string} time - The identifier of the form. Example: "2023-10-01T12:00:00Z".
|
|
65
|
+
* @property {IFormsPost} formData - The identifier of the position. Example:
|
|
66
|
+
{
|
|
67
|
+
"id": 1,
|
|
68
|
+
"formIdentifier": "string",
|
|
69
|
+
"time": "string",
|
|
70
|
+
"formData": [],
|
|
71
|
+
"fileQuery": {
|
|
72
|
+
"type": null;
|
|
73
|
+
"entity": null;
|
|
74
|
+
"id": null;
|
|
75
|
+
"key": null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
* @property {string} [attributeSetIdentifier] - Text identifier (marker) of the used attribute set. Example: "product_attributes".
|
|
79
|
+
* @property {string} [actionMessage] - Action message for the form data. Example: "Form submitted successfully".
|
|
80
|
+
* @description This interface defines the structure of a form data entity, including its identifiers, form data, and optional attributes.
|
|
24
81
|
*/
|
|
25
82
|
interface IFormDataEntity {
|
|
26
83
|
id: number;
|
|
@@ -31,39 +88,73 @@ interface IFormDataEntity {
|
|
|
31
88
|
actionMessage?: string;
|
|
32
89
|
}
|
|
33
90
|
/**
|
|
34
|
-
* Represents a form data.
|
|
91
|
+
* Represents a collection of form data entities.
|
|
35
92
|
*
|
|
36
|
-
* @interface
|
|
37
|
-
*
|
|
38
|
-
* @property {
|
|
93
|
+
* @interface IFormsDataEntity
|
|
94
|
+
*
|
|
95
|
+
* @property {number} total - Total number of found records. Example: 100.
|
|
96
|
+
* @property {IFormDataEntity[]} items - Array of form data objects. Example:
|
|
97
|
+
[
|
|
98
|
+
{
|
|
99
|
+
"id": 1,
|
|
100
|
+
"formIdentifier": "string",
|
|
101
|
+
"time": "string",
|
|
102
|
+
"formData": "IFormsPost",
|
|
103
|
+
"attributeSetIdentifier": "string",
|
|
104
|
+
"actionMessage": "string"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
* @description This interface defines the structure of a collection of form data entities, including a total count and an array of items.
|
|
39
108
|
*/
|
|
40
109
|
interface IFormsDataEntity {
|
|
41
110
|
total: number;
|
|
42
|
-
items:
|
|
111
|
+
items: IFormDataEntity[];
|
|
43
112
|
}
|
|
44
113
|
/**
|
|
45
114
|
* Contains an array of data form objects with the following values
|
|
46
115
|
*/
|
|
47
116
|
type FormDataType = IBodyTypeStringNumberFloat | IBodyTypeTimeDate | IBodyTypeText | IBodyTypeTextWithHeader | IBodyTypeImageGroupOfImages | IBodyTypeFile | IBodyTypeRadioButtonList | Record<string, any>;
|
|
48
117
|
/**
|
|
49
|
-
*
|
|
118
|
+
* Represents the structure of a form post object.
|
|
119
|
+
*
|
|
120
|
+
* @interface IFormsPost
|
|
50
121
|
*
|
|
51
|
-
* @property {number} id
|
|
52
|
-
* @property {string} formIdentifier - The identifier of the page.
|
|
53
|
-
* @property {Date | string} time - Date and time of form modification
|
|
54
|
-
* @property {
|
|
122
|
+
* @property {number} [id] - Optional identifier of the form post. Example: 1.
|
|
123
|
+
* @property {string} formIdentifier - The identifier of the page. Example: "string".
|
|
124
|
+
* @property {Date | string} [time] - Date and time of form modification. Example: "string".
|
|
125
|
+
* @property {FormDataType[]} formData - The form data object. Example:
|
|
126
|
+
[
|
|
127
|
+
{
|
|
128
|
+
"marker": "string",
|
|
129
|
+
"type": "string",
|
|
130
|
+
"value": "string"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
* @property {IUploadingQuery} [fileQuery] - Optional file query for uploading files. Example:
|
|
134
|
+
{
|
|
135
|
+
"type": null,
|
|
136
|
+
"entity": null,
|
|
137
|
+
"id": null,
|
|
138
|
+
"key": null,
|
|
139
|
+
}
|
|
140
|
+
* @description This interface defines the structure of a form post object, including its identifiers, time, form data, and optional file query.
|
|
55
141
|
*/
|
|
56
142
|
interface IFormsPost {
|
|
57
143
|
id?: number;
|
|
58
144
|
formIdentifier: string;
|
|
59
145
|
time?: Date | string;
|
|
60
|
-
formData:
|
|
146
|
+
formData: FormDataType[];
|
|
61
147
|
fileQuery?: IUploadingQuery;
|
|
62
148
|
}
|
|
63
149
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @
|
|
150
|
+
* Represents a form data entity with a simple value.
|
|
151
|
+
*
|
|
152
|
+
* @interface IBodyTypeStringNumberFloat
|
|
153
|
+
*
|
|
154
|
+
* @property {string} marker - marker name. Example: "some_marker".
|
|
155
|
+
* @property {string} type - Type value. "string" | "number" | "float". Example: "string".
|
|
156
|
+
* @property {string} value - Value of the form data entity, which can be a "string", "number", or "float". Example: "string".
|
|
157
|
+
* @description Represents a form data entity with a marker, type, and value.
|
|
67
158
|
*/
|
|
68
159
|
interface IBodyTypeStringNumberFloat {
|
|
69
160
|
marker: string;
|
|
@@ -71,9 +162,19 @@ interface IBodyTypeStringNumberFloat {
|
|
|
71
162
|
value: string;
|
|
72
163
|
}
|
|
73
164
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* @
|
|
165
|
+
* Represents a date/time form data entity.
|
|
166
|
+
*
|
|
167
|
+
* @interface IBodyTypeTimeDate
|
|
168
|
+
*
|
|
169
|
+
* @property {string} marker - marker name. Example: "ome_marker".
|
|
170
|
+
* @property {string} type - Type value. 'date' | 'dateTime' | 'time' Example: "date".
|
|
171
|
+
* @property {object} value - Date object. Contains fullDate, formattedValue, formatString. Example:
|
|
172
|
+
{
|
|
173
|
+
"fullDate": "2024-05-07T21:02:00.000Z",
|
|
174
|
+
"formattedValue": "08-05-2024 00:02",
|
|
175
|
+
"formatString": "DD-MM-YYYY HH:mm"
|
|
176
|
+
}
|
|
177
|
+
* @description Represents a date, dateTime, or time value in a structured format.
|
|
77
178
|
*/
|
|
78
179
|
interface IBodyTypeTimeDate {
|
|
79
180
|
marker: string;
|
|
@@ -85,9 +186,22 @@ interface IBodyTypeTimeDate {
|
|
|
85
186
|
};
|
|
86
187
|
}
|
|
87
188
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
189
|
+
* Represents a text form data entity.
|
|
190
|
+
*
|
|
191
|
+
* @interface IBodyTypeText
|
|
192
|
+
*
|
|
193
|
+
* @property {string} marker - marker name. Example: "some_marker".
|
|
194
|
+
* @property {string} type - Type value. Example: "text".
|
|
195
|
+
* @property {object} value - Text Object. Contains html as string, plain text and params. Example:
|
|
196
|
+
{
|
|
197
|
+
"htmlValue": "<p>Hello world</p>",
|
|
198
|
+
"plainValue": "",
|
|
199
|
+
"params": {
|
|
200
|
+
"isEditorDisabled": false,
|
|
201
|
+
"isImageCompressed": true
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
* @description Represents a text value with HTML and plain text representations, along with parameters for editor and image compression settings.
|
|
91
205
|
*/
|
|
92
206
|
interface IBodyTypeText {
|
|
93
207
|
marker: string;
|
|
@@ -102,9 +216,23 @@ interface IBodyTypeText {
|
|
|
102
216
|
};
|
|
103
217
|
}
|
|
104
218
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
219
|
+
* Represents a text with header form data entity.
|
|
220
|
+
*
|
|
221
|
+
* @interface IBodyTypeTextWithHeader
|
|
222
|
+
*
|
|
223
|
+
* @property {string} marker - marker name. Example: "about".
|
|
224
|
+
* @property {string} type - Type value. Example: "textWithHeader".
|
|
225
|
+
* @property {object} value - Text Object. Contains html as string, header and params. Example:
|
|
226
|
+
{
|
|
227
|
+
"header": "Headline",
|
|
228
|
+
"htmlValue": "<p>Hello World</p>",
|
|
229
|
+
"plainValue": "",
|
|
230
|
+
"params": {
|
|
231
|
+
"isEditorDisabled": false,
|
|
232
|
+
"isImageCompressed": true
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
* @description Represents a text value with a header, HTML and plain text representations, along with parameters for editor and image compression settings.
|
|
108
236
|
*/
|
|
109
237
|
interface IBodyTypeTextWithHeader {
|
|
110
238
|
marker: string;
|
|
@@ -120,9 +248,25 @@ interface IBodyTypeTextWithHeader {
|
|
|
120
248
|
};
|
|
121
249
|
}
|
|
122
250
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @
|
|
251
|
+
* Represents an image or group of images form data entity.
|
|
252
|
+
*
|
|
253
|
+
* @interface IBodyTypeImageGroupOfImages
|
|
254
|
+
*
|
|
255
|
+
* @property {string} marker - marker name. Example: "avatar".
|
|
256
|
+
* @property {'image' | 'groupOfImage'} type - Type value. Example: "image".
|
|
257
|
+
* @property {object} value - Image Object. Contains image information. Example:
|
|
258
|
+
[
|
|
259
|
+
{
|
|
260
|
+
"filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
|
|
261
|
+
"downloadLink": "http://my-site.com/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
|
|
262
|
+
"size": 392585,
|
|
263
|
+
"previewLink": "",
|
|
264
|
+
"params": {
|
|
265
|
+
"isImageCompressed": true
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
* @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
270
|
*/
|
|
127
271
|
interface IBodyTypeImageGroupOfImages {
|
|
128
272
|
marker: string;
|
|
@@ -146,9 +290,21 @@ interface IBodyTypeImageGroupOfImages {
|
|
|
146
290
|
}>;
|
|
147
291
|
}
|
|
148
292
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @
|
|
293
|
+
* Represents a file form data entity.
|
|
294
|
+
*
|
|
295
|
+
* @interface IBodyTypeFile
|
|
296
|
+
*
|
|
297
|
+
* @property {string} marker - marker name. Example: "picture".
|
|
298
|
+
* @property {'file'} type - Type value. Example: "file".
|
|
299
|
+
* @property {object} value - File Object. Contains file information. Example:
|
|
300
|
+
[
|
|
301
|
+
{
|
|
302
|
+
"filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
|
|
303
|
+
"downloadLink": "http://my-site.com/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
|
|
304
|
+
"size": 392585
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
* @description Represents a file with its details, including filename, download link, and size.
|
|
152
308
|
*/
|
|
153
309
|
interface IBodyTypeFile {
|
|
154
310
|
marker: string;
|
|
@@ -160,9 +316,24 @@ interface IBodyTypeFile {
|
|
|
160
316
|
};
|
|
161
317
|
}
|
|
162
318
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* @
|
|
319
|
+
* Represents a radio button or list selection form data entity.
|
|
320
|
+
*
|
|
321
|
+
* @interface IBodyTypeRadioButtonList
|
|
322
|
+
*
|
|
323
|
+
* @property {string} marker - marker name. Example: "selector".
|
|
324
|
+
* @property {string} type - Type value. Example: 'list'.
|
|
325
|
+
* @property {array} value - Array of list or radioButton bojects. Example:
|
|
326
|
+
[
|
|
327
|
+
{
|
|
328
|
+
"title": "red",
|
|
329
|
+
"value": "1",
|
|
330
|
+
"extended": {
|
|
331
|
+
"value": "red",
|
|
332
|
+
"type": "string"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
* @description Represents a list or radio button selection with multiple options, each containing a title, value, and extended information.
|
|
166
337
|
*/
|
|
167
338
|
interface IBodyTypeRadioButtonList {
|
|
168
339
|
marker: string;
|
|
@@ -4,7 +4,12 @@ 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
|
+
* @description This class provides methods to interact with general types, including retrieving all types.
|
|
8
13
|
*/
|
|
9
14
|
export default class GeneralTypesApi extends AsyncModules implements IGeneralTypes {
|
|
10
15
|
protected state: StateModule;
|
|
@@ -13,7 +18,11 @@ export default class GeneralTypesApi extends AsyncModules implements IGeneralTyp
|
|
|
13
18
|
/**
|
|
14
19
|
* Get all types.
|
|
15
20
|
*
|
|
16
|
-
* @
|
|
21
|
+
* @handleName getAllTypes
|
|
22
|
+
*
|
|
23
|
+
* @return {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
24
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
|
+
* @description This method retrieves all general types available in the system.
|
|
17
26
|
*/
|
|
18
|
-
getAllTypes(): Promise<
|
|
27
|
+
getAllTypes(): Promise<IGeneralTypesEntity[] | IError>;
|
|
19
28
|
}
|
|
@@ -6,7 +6,12 @@ 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
|
+
* @description This class provides methods to interact with general types, including retrieving all types.
|
|
10
15
|
*/
|
|
11
16
|
class GeneralTypesApi extends asyncModules_1.default {
|
|
12
17
|
constructor(state) {
|
|
@@ -16,7 +21,11 @@ class GeneralTypesApi extends asyncModules_1.default {
|
|
|
16
21
|
/**
|
|
17
22
|
* Get all types.
|
|
18
23
|
*
|
|
19
|
-
* @
|
|
24
|
+
* @handleName getAllTypes
|
|
25
|
+
*
|
|
26
|
+
* @return {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
27
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
+
* @description This method retrieves all general types available in the system.
|
|
20
29
|
*/
|
|
21
30
|
async getAllTypes() {
|
|
22
31
|
const result = await this._fetchGet('');
|
|
@@ -1,19 +1,30 @@
|
|
|
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
|
+
* @description This interface defines a method for retrieving all general types in the system.
|
|
7
10
|
*/
|
|
8
11
|
interface IGeneralTypes {
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Get all types.
|
|
14
|
+
*
|
|
15
|
+
* @return {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
16
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
17
|
+
*/
|
|
18
|
+
getAllTypes(): Promise<IGeneralTypesEntity[] | IError>;
|
|
10
19
|
}
|
|
11
20
|
/**
|
|
12
|
-
* Represents a general
|
|
21
|
+
* Represents a general type entity.
|
|
22
|
+
*
|
|
23
|
+
* @interface IGeneralTypesEntity
|
|
13
24
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @property {
|
|
16
|
-
* @
|
|
25
|
+
* @property {number} id - Type id. Example: 1.
|
|
26
|
+
* @property {Types} type - Types enum. Example: "product", "category", "etc".
|
|
27
|
+
* @description Represents a general type entity with an identifier and a type.
|
|
17
28
|
*/
|
|
18
29
|
interface IGeneralTypesEntity {
|
|
19
30
|
id: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import BlocksApi from './blocks/blocksApi';
|
|
|
9
9
|
import EventsApi from './events/eventsApi';
|
|
10
10
|
import FileUploadingApi from './file-uploading/fileUploadingApi';
|
|
11
11
|
import FormsApi from './forms/formsApi';
|
|
12
|
-
import FormsDataApi from './
|
|
12
|
+
import FormsDataApi from './forms-data/formsDataApi';
|
|
13
13
|
import GeneralTypesApi from './general-types/generalTypesApi';
|
|
14
14
|
import IntegrationCollectionsApi from './integration-collections/integrationCollectionsApi';
|
|
15
15
|
import LocalesApi from './locales/localesApi';
|
|
@@ -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
|
@@ -15,7 +15,7 @@ const blocksApi_1 = __importDefault(require("./blocks/blocksApi"));
|
|
|
15
15
|
const eventsApi_1 = __importDefault(require("./events/eventsApi"));
|
|
16
16
|
const fileUploadingApi_1 = __importDefault(require("./file-uploading/fileUploadingApi"));
|
|
17
17
|
const formsApi_1 = __importDefault(require("./forms/formsApi"));
|
|
18
|
-
const formsDataApi_1 = __importDefault(require("./
|
|
18
|
+
const formsDataApi_1 = __importDefault(require("./forms-data/formsDataApi"));
|
|
19
19
|
const generalTypesApi_1 = __importDefault(require("./general-types/generalTypesApi"));
|
|
20
20
|
const integrationCollectionsApi_1 = __importDefault(require("./integration-collections/integrationCollectionsApi"));
|
|
21
21
|
const localesApi_1 = __importDefault(require("./locales/localesApi"));
|
|
@@ -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);
|