oneentry 1.0.124 → 1.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -22
- package/dist/admins/adminsApi.d.ts +17 -4
- package/dist/admins/adminsApi.js +16 -3
- package/dist/admins/adminsInterfaces.d.ts +47 -26
- package/dist/attribute-sets/attributeSetsApi.d.ts +10 -18
- package/dist/attribute-sets/attributeSetsApi.js +9 -17
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +92 -44
- package/dist/auth-provider/authProviderApi.d.ts +146 -36
- package/dist/auth-provider/authProviderApi.js +163 -37
- package/dist/auth-provider/authProvidersInterfaces.d.ts +189 -40
- package/dist/base/asyncModules.d.ts +7 -1
- package/dist/base/asyncModules.js +127 -21
- package/dist/base/result.js +23 -0
- package/dist/base/syncModules.d.ts +4 -0
- package/dist/base/syncModules.js +19 -1
- package/dist/base/utils.d.ts +1 -1
- package/dist/blocks/blocksApi.d.ts +7 -17
- package/dist/blocks/blocksApi.js +7 -17
- package/dist/blocks/blocksInterfaces.d.ts +77 -32
- package/dist/events/eventsApi.d.ts +7 -8
- package/dist/events/eventsApi.js +12 -7
- package/dist/events/eventsInterfaces.d.ts +16 -11
- package/dist/file-uploading/fileUploadingApi.d.ts +22 -14
- package/dist/file-uploading/fileUploadingApi.js +20 -12
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +42 -18
- package/dist/forms/formsApi.d.ts +3 -7
- package/dist/forms/formsApi.js +2 -6
- package/dist/forms/formsInterfaces.d.ts +44 -28
- package/dist/{formsData → forms-data}/formsDataApi.d.ts +31 -15
- package/dist/{formsData → forms-data}/formsDataApi.js +30 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +462 -0
- package/dist/general-types/generalTypesApi.d.ts +1 -3
- package/dist/general-types/generalTypesApi.js +0 -2
- package/dist/general-types/generalTypesInterfaces.d.ts +2 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/integration-collections/integrationCollectionsApi.d.ts +74 -47
- package/dist/integration-collections/integrationCollectionsApi.js +64 -45
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +144 -63
- package/dist/locales/localesApi.d.ts +1 -2
- package/dist/locales/localesApi.js +1 -2
- package/dist/locales/localesInterfaces.d.ts +2 -4
- package/dist/menus/menusApi.d.ts +1 -3
- package/dist/menus/menusApi.js +1 -3
- package/dist/menus/menusInterfaces.d.ts +39 -13
- package/dist/orders/ordersApi.d.ts +36 -18
- package/dist/orders/ordersApi.js +40 -22
- package/dist/orders/ordersInterfaces.d.ts +163 -81
- package/dist/pages/pagesApi.d.ts +48 -48
- package/dist/pages/pagesApi.js +40 -45
- package/dist/pages/pagesInterfaces.d.ts +147 -98
- package/dist/payments/paymentsApi.d.ts +25 -45
- package/dist/payments/paymentsApi.js +27 -46
- package/dist/payments/paymentsInterfaces.d.ts +42 -60
- package/dist/product-statuses/productStatusesApi.d.ts +6 -12
- package/dist/product-statuses/productStatusesApi.js +5 -11
- package/dist/product-statuses/productStatusesInterfaces.d.ts +16 -15
- package/dist/products/productsApi.d.ts +256 -104
- package/dist/products/productsApi.js +263 -97
- package/dist/products/productsInterfaces.d.ts +343 -160
- package/dist/system/systemApi.d.ts +21 -10
- package/dist/system/systemApi.js +22 -8
- package/dist/system/systemInterfaces.d.ts +0 -1
- package/dist/templates/templatesApi.d.ts +6 -12
- package/dist/templates/templatesApi.js +4 -10
- package/dist/templates/templatesInterfaces.d.ts +20 -20
- package/dist/templates-preview/templatesPreviewApi.d.ts +2 -6
- package/dist/templates-preview/templatesPreviewApi.js +1 -5
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +50 -25
- package/dist/users/usersApi.d.ts +33 -13
- package/dist/users/usersApi.js +38 -15
- package/dist/users/usersInterfaces.d.ts +78 -27
- package/dist/web-socket/wsApi.d.ts +1 -5
- package/dist/web-socket/wsApi.js +1 -5
- package/dist/web-socket/wsInterfaces.d.ts +0 -1
- package/package.json +18 -16
- package/dist/formsData/formsDataInterfaces.d.ts +0 -267
- /package/dist/{formsData → forms-data}/formsDataInterfaces.js +0 -0
package/dist/users/usersApi.js
CHANGED
|
@@ -20,11 +20,9 @@ class UsersApi extends asyncModules_1.default {
|
|
|
20
20
|
* @handleName getUser
|
|
21
21
|
*
|
|
22
22
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
-
*
|
|
24
23
|
* @return {IUserEntity} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
|
|
25
24
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
26
|
-
*
|
|
27
|
-
* @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.
|
|
25
|
+
* @description Getting the data of an authorized user. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
28
26
|
*/
|
|
29
27
|
async getUser(langCode = this.state.lang) {
|
|
30
28
|
const result = await this._fetchGet(`/me?langCode=${langCode}`);
|
|
@@ -35,14 +33,31 @@ class UsersApi extends asyncModules_1.default {
|
|
|
35
33
|
*
|
|
36
34
|
* @handleName updateUser
|
|
37
35
|
*
|
|
38
|
-
* @param {
|
|
36
|
+
* @param {IUserBody} body - Request body. Example:
|
|
37
|
+
{
|
|
38
|
+
"formIdentifier": "reg",
|
|
39
|
+
"authData": [
|
|
40
|
+
{
|
|
41
|
+
"marker": "password",
|
|
42
|
+
"value": "12345"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"formData": {
|
|
46
|
+
"marker": "last_name",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"value": "Username"
|
|
49
|
+
},
|
|
50
|
+
"notificationData": {
|
|
51
|
+
"email": "example@oneentry.cloud",
|
|
52
|
+
"phonePush": ["+99999999999"],
|
|
53
|
+
"phoneSMS": "+99999999999"
|
|
54
|
+
},
|
|
55
|
+
"state": {}
|
|
56
|
+
}
|
|
39
57
|
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
40
|
-
*
|
|
41
58
|
* @return {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
|
|
42
59
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
43
|
-
*
|
|
44
|
-
* @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
|
-
*
|
|
60
|
+
* @description Updating a single user object. This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
46
61
|
*/
|
|
47
62
|
async updateUser(body, langCode = this.state.lang) {
|
|
48
63
|
if (!('langCode' in body))
|
|
@@ -55,17 +70,29 @@ class UsersApi extends asyncModules_1.default {
|
|
|
55
70
|
return result;
|
|
56
71
|
}
|
|
57
72
|
/**
|
|
58
|
-
*
|
|
73
|
+
* Archiving one user object (marked for deletion).
|
|
59
74
|
*
|
|
60
|
-
* @handleName
|
|
75
|
+
* @handleName archiveUser
|
|
61
76
|
*
|
|
62
77
|
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
63
78
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
79
|
+
* @description Archiving one user object (marked for deletion). This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
|
|
80
|
+
*/
|
|
81
|
+
async archiveUser() {
|
|
82
|
+
const result = await this._fetchDelete('/me');
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Delete a single user.
|
|
87
|
+
*
|
|
88
|
+
* @handleName deleteUser
|
|
64
89
|
*
|
|
90
|
+
* @return {boolean} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
91
|
+
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
65
92
|
* @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.
|
|
66
93
|
*/
|
|
67
94
|
async deleteUser() {
|
|
68
|
-
const result = await this._fetchDelete('/me');
|
|
95
|
+
const result = await this._fetchDelete('/me/account');
|
|
69
96
|
return result;
|
|
70
97
|
}
|
|
71
98
|
/**
|
|
@@ -74,10 +101,8 @@ class UsersApi extends asyncModules_1.default {
|
|
|
74
101
|
* @handleName addFCMToken
|
|
75
102
|
*
|
|
76
103
|
* @param {string} token - The cloud messaging token to be added. This token is used to identify the user's device for push notifications. Example: "fcm_token_1234567890abcdefg".
|
|
77
|
-
*
|
|
78
104
|
* @return {boolean} Returns `true` if the token was successfully added; otherwise, returns an error object.
|
|
79
105
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
80
|
-
*
|
|
81
106
|
* @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.
|
|
82
107
|
*/
|
|
83
108
|
async addFCMToken(token) {
|
|
@@ -90,10 +115,8 @@ class UsersApi extends asyncModules_1.default {
|
|
|
90
115
|
* @handleName deleteFCMToken
|
|
91
116
|
*
|
|
92
117
|
* @param {string} token - The cloud messaging token to be deleted. This token is used to identify the user's device for push notifications and will be removed. Example: "fcm_token_1234567890abcdefg".
|
|
93
|
-
*
|
|
94
118
|
* @return {boolean} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
|
|
95
119
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
96
|
-
*
|
|
97
120
|
* @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.
|
|
98
121
|
*/
|
|
99
122
|
async deleteFCMToken(token) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { IFormConfig } from 'forms/formsInterfaces';
|
|
1
2
|
import type { IAuthFormData } from '../auth-provider/authProvidersInterfaces';
|
|
2
3
|
import type { IError } from '../base/utils';
|
|
3
|
-
import type { FormDataType } from '../
|
|
4
|
+
import type { FormDataType } from '../forms-data/formsDataInterfaces';
|
|
4
5
|
/**
|
|
5
6
|
* Interface representing user-related operations.
|
|
6
7
|
*
|
|
@@ -8,10 +9,10 @@ import type { FormDataType } from '../formsData/formsDataInterfaces';
|
|
|
8
9
|
*
|
|
9
10
|
* @property {function} getUser - Retrieves the data of an authorized user, optionally based on a language code.
|
|
10
11
|
* @property {function} updateUser - Updates the user's data with the provided information.
|
|
12
|
+
* @property {function} archiveUser - Archiving one user object (marked for deletion).
|
|
11
13
|
* @property {function} deleteUser - Deletes the user from the system.
|
|
12
14
|
* @property {function} addFCMToken - Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
13
15
|
* @property {function} deleteFCMToken - Deletes an existing FCM token.
|
|
14
|
-
*
|
|
15
16
|
* @description This interface defines methods for managing user data and handling Firebase Cloud Messaging tokens.
|
|
16
17
|
*/
|
|
17
18
|
interface IUsers {
|
|
@@ -19,31 +20,54 @@ interface IUsers {
|
|
|
19
20
|
* Retrieves the data of an authorized user.
|
|
20
21
|
*
|
|
21
22
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
22
|
-
*
|
|
23
23
|
* @return {IUserEntity} A promise resolving to the user entity or an error.
|
|
24
24
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
25
|
-
*
|
|
26
25
|
* @description Retrieves the data of an authorized user.
|
|
27
26
|
*/
|
|
28
27
|
getUser(langCode?: string): Promise<IUserEntity | IError>;
|
|
29
28
|
/**
|
|
30
29
|
* Updates the user's data.
|
|
31
30
|
*
|
|
32
|
-
* @param {IUserBody} data - The new data for the user. Example:
|
|
31
|
+
* @param {IUserBody} data - The new data for the user. Example:
|
|
32
|
+
{
|
|
33
|
+
"formIdentifier": "reg",
|
|
34
|
+
"authData": [
|
|
35
|
+
{
|
|
36
|
+
"marker": "password",
|
|
37
|
+
"value": "12345"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"formData": {
|
|
41
|
+
"marker": "last_name",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"value": "Username"
|
|
44
|
+
},
|
|
45
|
+
"notificationData": {
|
|
46
|
+
"email": "example@oneentry.cloud",
|
|
47
|
+
"phonePush": ["+99999999999"],
|
|
48
|
+
"phoneSMS": "+99999999999"
|
|
49
|
+
},
|
|
50
|
+
"state": {}
|
|
51
|
+
}
|
|
33
52
|
* @param {string} [langCode] - Optional language code for localization. Default: "en_US".
|
|
34
|
-
*
|
|
35
53
|
* @return {boolean} A promise resolving to true if successful, or an error.
|
|
36
54
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
37
|
-
*
|
|
38
55
|
* @description Updates the user's data.
|
|
39
56
|
*/
|
|
40
57
|
updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
|
|
41
58
|
/**
|
|
42
|
-
*
|
|
59
|
+
* Archiving one user object (marked for deletion).
|
|
43
60
|
*
|
|
44
61
|
* @return {boolean} A promise resolving to true if successful, or an error.
|
|
45
62
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
63
|
+
* @description Deletes the user from the system.
|
|
64
|
+
*/
|
|
65
|
+
archiveUser(): Promise<boolean | IError>;
|
|
66
|
+
/**
|
|
67
|
+
* Deletes the user from the system.
|
|
46
68
|
*
|
|
69
|
+
* @return {boolean} A promise resolving to true if successful, or an error.
|
|
70
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
47
71
|
* @description Deletes the user from the system.
|
|
48
72
|
*/
|
|
49
73
|
deleteUser(): Promise<boolean | IError>;
|
|
@@ -53,7 +77,6 @@ interface IUsers {
|
|
|
53
77
|
* @param {string} token - The FCM token to be added. Example: "fcm_token_1234567890abcdefg".
|
|
54
78
|
* @return {boolean} A promise resolving to true if successful, or an error.
|
|
55
79
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
56
|
-
*
|
|
57
80
|
* @description Adds an FCM token for sending push notifications.
|
|
58
81
|
*/
|
|
59
82
|
addFCMToken(token: string): Promise<boolean | IError>;
|
|
@@ -63,7 +86,6 @@ interface IUsers {
|
|
|
63
86
|
* @param {string} token - The FCM token to be deleted. Example: "fcm_token_1234567890abcdefg".
|
|
64
87
|
* @return {boolean} A promise resolving to true if successful, or an error.
|
|
65
88
|
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
66
|
-
*
|
|
67
89
|
* @description Deletes an existing FCM token.
|
|
68
90
|
*/
|
|
69
91
|
deleteFCMToken(token: string): Promise<boolean | IError>;
|
|
@@ -72,34 +94,63 @@ interface IUsers {
|
|
|
72
94
|
* @interface IUserEntity
|
|
73
95
|
*
|
|
74
96
|
* @property {number} id - Object identifier. Example: 12345.
|
|
75
|
-
* @property {string} identifier - Text identifier for record field. Example:
|
|
76
|
-
* @property {
|
|
77
|
-
* @property {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
97
|
+
* @property {string} identifier - Text identifier for record field. Example: "user_12345".
|
|
98
|
+
* @property {string} authProviderIdentifier - Text identifier of the authentication provider. Example: "auth_provider_12345".
|
|
99
|
+
* @property {FormDataType[]} formData - Array of data form objects with the following values. Example:
|
|
100
|
+
[
|
|
101
|
+
{
|
|
102
|
+
"marker": "last_name",
|
|
103
|
+
"type": "string",
|
|
104
|
+
"value": "Username"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
* @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
|
|
108
|
+
* @property {any[]} groups - Array of user groups. Example: ["group_1", "group_2"].
|
|
109
|
+
* @property {any} state - Object containing additional user state information. Example: {"key": "value"}
|
|
82
110
|
* @description Represents a user entity with various properties, including identifiers, form data, and user groups.
|
|
83
111
|
*/
|
|
84
112
|
interface IUserEntity {
|
|
85
113
|
id: number;
|
|
86
114
|
identifier: string;
|
|
87
|
-
formData: Array<FormDataType>;
|
|
88
|
-
formIdentifier: string;
|
|
89
115
|
authProviderIdentifier: string;
|
|
116
|
+
formData: FormDataType[];
|
|
117
|
+
formIdentifier: string;
|
|
90
118
|
groups: Array<string | number>;
|
|
91
119
|
state: Record<string, any>;
|
|
120
|
+
moduleFormConfigs: IFormConfig;
|
|
92
121
|
}
|
|
93
122
|
/**
|
|
94
123
|
* @interface IUserBody
|
|
95
124
|
*
|
|
96
|
-
* @property {string} formIdentifier - Text identifier of the form. Example:
|
|
125
|
+
* @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
|
|
97
126
|
* @property {string} [langCode] - Language code for localization. Default: "en_US".
|
|
98
|
-
* @property {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
127
|
+
* @property {{ marker: string; value: string }[]} [authData] - Array of authentication data objects with markers and values. Example:
|
|
128
|
+
[
|
|
129
|
+
{
|
|
130
|
+
"marker": "password",
|
|
131
|
+
"value": "12345"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
* @property {IAuthFormData | IAuthFormData[]} [formData] - Form data object or array of form data objects. Example:
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
"marker": "first_name",
|
|
138
|
+
"type": "string",
|
|
139
|
+
"value": "John"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"marker": "last_name",
|
|
143
|
+
"type": "string",
|
|
144
|
+
"value": "Doe"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
* @property {object} [notificationData] - Object containing notification data, including email and phone information. Example:
|
|
148
|
+
{
|
|
149
|
+
"email": "example@oneentry.cloud",
|
|
150
|
+
"phonePush": ["+99999999999"],
|
|
151
|
+
"phoneSMS": "+99999999999"
|
|
152
|
+
}
|
|
153
|
+
* @property {any} [state] - Object containing additional state information. Example: {"key": "value"}
|
|
103
154
|
* @description Represents the body of a user request, including form identifiers, authentication data, form data, notification data, and state information.
|
|
104
155
|
*/
|
|
105
156
|
interface IUserBody {
|
|
@@ -109,10 +160,10 @@ interface IUserBody {
|
|
|
109
160
|
marker: string;
|
|
110
161
|
value: string;
|
|
111
162
|
}>;
|
|
112
|
-
formData?: IAuthFormData |
|
|
163
|
+
formData?: IAuthFormData | IAuthFormData[];
|
|
113
164
|
notificationData?: {
|
|
114
165
|
email: string;
|
|
115
|
-
phonePush:
|
|
166
|
+
phonePush: string[];
|
|
116
167
|
phoneSMS: string;
|
|
117
168
|
};
|
|
118
169
|
state?: Record<string, any>;
|
|
@@ -16,11 +16,7 @@ export default class WsApi extends AsyncModules implements IWS {
|
|
|
16
16
|
* @handleName connect
|
|
17
17
|
*
|
|
18
18
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
19
|
-
*
|
|
20
|
-
* @description
|
|
21
|
-
* @example
|
|
22
|
-
* const socket = WS.connect()
|
|
23
|
-
* socket.on('my_event', callback)
|
|
19
|
+
* @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
|
|
24
20
|
*/
|
|
25
21
|
connect(): Socket;
|
|
26
22
|
}
|
package/dist/web-socket/wsApi.js
CHANGED
|
@@ -20,11 +20,7 @@ class WsApi extends asyncModules_1.default {
|
|
|
20
20
|
* @handleName connect
|
|
21
21
|
*
|
|
22
22
|
* @throws {IError} If there is an error during the fetch operation, it will return an error object.
|
|
23
|
-
*
|
|
24
|
-
* @description
|
|
25
|
-
* @example
|
|
26
|
-
* const socket = WS.connect()
|
|
27
|
-
* socket.on('my_event', callback)
|
|
23
|
+
* @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
|
|
28
24
|
*/
|
|
29
25
|
connect() {
|
|
30
26
|
if (!this.state.accessToken) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
4
4
|
"description": "OneEntry NPM package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"productionBuild": "run-s lint testAll build",
|
|
12
|
-
"testAll": "run-s admins attributesets authProvider blocks
|
|
12
|
+
"testAll": "run-s admins attributesets authProvider blocks fileuploading forms formsdata generaltypes integrationcollections locales menus orders pages payments productstatuses products templates templatespreview users",
|
|
13
13
|
"admins": "npx jest src/admins/tests/admins.spec.ts",
|
|
14
14
|
"attributesets": "npx jest src/attribute-sets/tests/attributesets.spec.ts",
|
|
15
15
|
"authProvider": "npx jest src/auth-provider/tests/authProvider.spec.ts",
|
|
16
16
|
"blocks": "npx jest src/blocks/tests/blocks.spec.ts",
|
|
17
|
-
"
|
|
17
|
+
"fileuploading": "npx jest src/file-uploading/tests/fileuploading.spec.ts",
|
|
18
18
|
"forms": "npx jest src/forms/tests/forms.spec.ts",
|
|
19
|
-
"formsdata": "npx jest src/
|
|
19
|
+
"formsdata": "npx jest src/forms-data/tests/formsdata.spec.ts",
|
|
20
20
|
"generaltypes": "npx jest src/general-types/tests/generaltypes.spec.ts",
|
|
21
21
|
"integrationcollections": "npx jest src/integration-collections/tests/integrationcollections.spec.ts",
|
|
22
22
|
"locales": "npx jest src/locales/tests/locales.spec.ts",
|
|
@@ -38,26 +38,28 @@
|
|
|
38
38
|
"author": "ONEENTRY PORTAL CO.",
|
|
39
39
|
"license": "ISC",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"io": "^1.5.
|
|
41
|
+
"io": "^1.5.7",
|
|
42
42
|
"socket.io-client": "^4.8.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@jest/globals": "^
|
|
45
|
+
"@jest/globals": "^30.0.5",
|
|
46
46
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
47
|
-
"@types/jest": "^
|
|
48
|
-
"@types/node": "^
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
50
|
-
"@typescript-eslint/parser": "^8.
|
|
47
|
+
"@types/jest": "^30.0.0",
|
|
48
|
+
"@types/node": "^24.2.1",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
50
|
+
"@typescript-eslint/parser": "^8.39.1",
|
|
51
51
|
"eslint": "^8.57.1",
|
|
52
|
-
"eslint-config-prettier": "^10.1.
|
|
52
|
+
"eslint-config-prettier": "^10.1.8",
|
|
53
53
|
"eslint-plugin-import": "^2.32.0",
|
|
54
54
|
"eslint-plugin-jest": "^29.0.1",
|
|
55
|
-
"eslint-plugin-
|
|
55
|
+
"eslint-plugin-jest-extended": "^3.0.0",
|
|
56
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
56
57
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
57
|
-
"jest": "^
|
|
58
|
+
"jest": "^30.0.5",
|
|
59
|
+
"jest-extended": "^6.0.0",
|
|
58
60
|
"npm-run-all": "^4.1.5",
|
|
59
61
|
"prettier": "^3.6.2",
|
|
60
|
-
"ts-jest": "^29.4.
|
|
61
|
-
"typescript": "^5.
|
|
62
|
+
"ts-jest": "^29.4.1",
|
|
63
|
+
"typescript": "^5.9.2"
|
|
62
64
|
}
|
|
63
|
-
}
|
|
65
|
+
}
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import type { IUploadingQuery } from 'file-uploading/fileUploadingInterfaces';
|
|
2
|
-
import type { IError } from '../base/utils';
|
|
3
|
-
/**
|
|
4
|
-
* Interface for retrieving and posting form data in the system.
|
|
5
|
-
*
|
|
6
|
-
* @interface IFormsData
|
|
7
|
-
*
|
|
8
|
-
* @property {function} getFormsData - Get all forms data.
|
|
9
|
-
* @property {function} postFormsData - Find all product page objects with pagination and multiple filtering.
|
|
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.
|
|
13
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
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
|
-
*/
|
|
47
|
-
getFormsDataByMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Represents the structure of a form data entity.
|
|
51
|
-
*
|
|
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.
|
|
62
|
-
*/
|
|
63
|
-
interface IFormDataEntity {
|
|
64
|
-
id: number;
|
|
65
|
-
formIdentifier: string;
|
|
66
|
-
time: Date | string;
|
|
67
|
-
formData: IFormsPost;
|
|
68
|
-
attributeSetIdentifier?: string;
|
|
69
|
-
actionMessage?: string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Represents a collection of form data entities.
|
|
73
|
-
*
|
|
74
|
-
* @interface IFormsDataEntity
|
|
75
|
-
*
|
|
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.
|
|
80
|
-
*/
|
|
81
|
-
interface IFormsDataEntity {
|
|
82
|
-
total: number;
|
|
83
|
-
items: Array<IFormDataEntity>;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Contains an array of data form objects with the following values
|
|
87
|
-
*/
|
|
88
|
-
type FormDataType = IBodyTypeStringNumberFloat | IBodyTypeTimeDate | IBodyTypeText | IBodyTypeTextWithHeader | IBodyTypeImageGroupOfImages | IBodyTypeFile | IBodyTypeRadioButtonList | Record<string, any>;
|
|
89
|
-
/**
|
|
90
|
-
* Represents the structure of a form post object.
|
|
91
|
-
*
|
|
92
|
-
* @interface IFormsPost
|
|
93
|
-
*
|
|
94
|
-
* @property {number} [id] - Optional identifier of the form post.
|
|
95
|
-
* @property {string} formIdentifier - The identifier of the page.
|
|
96
|
-
* @property {Date | string} [time] - Date and time of form modification.
|
|
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.
|
|
101
|
-
*/
|
|
102
|
-
interface IFormsPost {
|
|
103
|
-
id?: number;
|
|
104
|
-
formIdentifier: string;
|
|
105
|
-
time?: Date | string;
|
|
106
|
-
formData: Array<FormDataType>;
|
|
107
|
-
fileQuery?: IUploadingQuery;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
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.
|
|
119
|
-
*/
|
|
120
|
-
interface IBodyTypeStringNumberFloat {
|
|
121
|
-
marker: string;
|
|
122
|
-
type: 'string' | 'number' | 'float';
|
|
123
|
-
value: string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
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.
|
|
135
|
-
*/
|
|
136
|
-
interface IBodyTypeTimeDate {
|
|
137
|
-
marker: string;
|
|
138
|
-
type: 'date' | 'dateTime' | 'time';
|
|
139
|
-
value: {
|
|
140
|
-
fullDate: string;
|
|
141
|
-
formattedValue: string;
|
|
142
|
-
formatString: string;
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
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.
|
|
155
|
-
*/
|
|
156
|
-
interface IBodyTypeText {
|
|
157
|
-
marker: string;
|
|
158
|
-
type: 'text';
|
|
159
|
-
value: {
|
|
160
|
-
htmlValue: string;
|
|
161
|
-
plainValue: string;
|
|
162
|
-
params: {
|
|
163
|
-
isEditorDisabled: boolean;
|
|
164
|
-
isImageCompressed: boolean;
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
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.
|
|
178
|
-
*/
|
|
179
|
-
interface IBodyTypeTextWithHeader {
|
|
180
|
-
marker: string;
|
|
181
|
-
type: 'textWithHeader';
|
|
182
|
-
value: {
|
|
183
|
-
header: string;
|
|
184
|
-
htmlValue: string;
|
|
185
|
-
plainValue: string;
|
|
186
|
-
params: {
|
|
187
|
-
isEditorDisabled: boolean;
|
|
188
|
-
isImageCompressed: boolean;
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
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.
|
|
202
|
-
*/
|
|
203
|
-
interface IBodyTypeImageGroupOfImages {
|
|
204
|
-
marker: string;
|
|
205
|
-
type: 'image' | 'groupOfImage';
|
|
206
|
-
value: {
|
|
207
|
-
filename: string;
|
|
208
|
-
downloadLink: string;
|
|
209
|
-
size: number;
|
|
210
|
-
previewLink: string;
|
|
211
|
-
params: {
|
|
212
|
-
isImageCompressed: boolean;
|
|
213
|
-
};
|
|
214
|
-
} | Array<{
|
|
215
|
-
filename: string;
|
|
216
|
-
downloadLink: string;
|
|
217
|
-
size: number;
|
|
218
|
-
previewLink: string;
|
|
219
|
-
params: {
|
|
220
|
-
isImageCompressed: boolean;
|
|
221
|
-
};
|
|
222
|
-
}>;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
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.
|
|
234
|
-
*/
|
|
235
|
-
interface IBodyTypeFile {
|
|
236
|
-
marker: string;
|
|
237
|
-
type: 'file';
|
|
238
|
-
value: {
|
|
239
|
-
filename: string;
|
|
240
|
-
downloadLink: string;
|
|
241
|
-
size: number;
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
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.
|
|
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.
|
|
254
|
-
*/
|
|
255
|
-
interface IBodyTypeRadioButtonList {
|
|
256
|
-
marker: string;
|
|
257
|
-
type: 'list' | 'radioButton';
|
|
258
|
-
value: Array<{
|
|
259
|
-
title: string;
|
|
260
|
-
value: string;
|
|
261
|
-
extended: {
|
|
262
|
-
value: string;
|
|
263
|
-
type: string;
|
|
264
|
-
};
|
|
265
|
-
}>;
|
|
266
|
-
}
|
|
267
|
-
export type { FormDataType, IBodyTypeFile, IBodyTypeImageGroupOfImages, IBodyTypeRadioButtonList, IBodyTypeStringNumberFloat, IBodyTypeText, IBodyTypeTextWithHeader, IBodyTypeTimeDate, IFormDataEntity, IFormsData, IFormsDataEntity, IFormsPost, };
|
|
File without changes
|