oneentry 1.0.126 → 1.0.127

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.
Files changed (83) hide show
  1. package/README.md +0 -2
  2. package/configure.js +25 -18
  3. package/dist/admins/adminsApi.d.ts +30 -25
  4. package/dist/admins/adminsApi.js +30 -25
  5. package/dist/admins/adminsInterfaces.d.ts +45 -54
  6. package/dist/attribute-sets/attributeSetsApi.d.ts +26 -27
  7. package/dist/attribute-sets/attributeSetsApi.js +26 -27
  8. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +101 -109
  9. package/dist/auth-provider/authProviderApi.d.ts +132 -158
  10. package/dist/auth-provider/authProviderApi.js +131 -157
  11. package/dist/auth-provider/authProvidersInterfaces.d.ts +241 -237
  12. package/dist/base/asyncModules.d.ts +23 -21
  13. package/dist/base/asyncModules.js +30 -25
  14. package/dist/base/result.d.ts +31 -0
  15. package/dist/base/result.js +32 -1
  16. package/dist/base/stateModule.d.ts +10 -0
  17. package/dist/base/stateModule.js +50 -2
  18. package/dist/base/syncModules.d.ts +41 -49
  19. package/dist/base/syncModules.js +49 -48
  20. package/dist/base/utils.d.ts +38 -7
  21. package/dist/blocks/blocksApi.d.ts +27 -36
  22. package/dist/blocks/blocksApi.js +27 -36
  23. package/dist/blocks/blocksInterfaces.d.ts +92 -97
  24. package/dist/config.d.ts +13 -0
  25. package/dist/config.js +30 -0
  26. package/dist/events/eventsApi.d.ts +16 -33
  27. package/dist/events/eventsApi.js +32 -46
  28. package/dist/events/eventsInterfaces.d.ts +42 -37
  29. package/dist/file-uploading/fileUploadingApi.d.ts +42 -47
  30. package/dist/file-uploading/fileUploadingApi.js +44 -47
  31. package/dist/file-uploading/fileUploadingInterfaces.d.ts +49 -60
  32. package/dist/forms/formsApi.d.ts +15 -14
  33. package/dist/forms/formsApi.js +15 -14
  34. package/dist/forms/formsInterfaces.d.ts +36 -40
  35. package/dist/forms-data/formsDataApi.d.ts +40 -44
  36. package/dist/forms-data/formsDataApi.js +42 -44
  37. package/dist/forms-data/formsDataInterfaces.d.ts +231 -231
  38. package/dist/general-types/generalTypesApi.d.ts +5 -5
  39. package/dist/general-types/generalTypesApi.js +5 -5
  40. package/dist/general-types/generalTypesInterfaces.d.ts +6 -9
  41. package/dist/index.d.ts +12 -13
  42. package/dist/index.js +12 -13
  43. package/dist/integration-collections/integrationCollectionsApi.d.ts +84 -98
  44. package/dist/integration-collections/integrationCollectionsApi.js +86 -102
  45. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +177 -169
  46. package/dist/locales/localesApi.d.ts +7 -3
  47. package/dist/locales/localesApi.js +7 -3
  48. package/dist/locales/localesInterfaces.d.ts +14 -13
  49. package/dist/menus/menusApi.d.ts +9 -5
  50. package/dist/menus/menusApi.js +9 -5
  51. package/dist/menus/menusInterfaces.d.ts +43 -48
  52. package/dist/menus/menusInterfaces.js +1 -0
  53. package/dist/orders/ordersApi.d.ts +62 -70
  54. package/dist/orders/ordersApi.js +62 -71
  55. package/dist/orders/ordersInterfaces.d.ts +238 -203
  56. package/dist/pages/pagesApi.d.ts +67 -80
  57. package/dist/pages/pagesApi.js +71 -81
  58. package/dist/pages/pagesInterfaces.d.ts +164 -160
  59. package/dist/payments/paymentsApi.d.ts +24 -34
  60. package/dist/payments/paymentsApi.js +24 -38
  61. package/dist/payments/paymentsInterfaces.d.ts +82 -76
  62. package/dist/product-statuses/productStatusesApi.d.ts +13 -13
  63. package/dist/product-statuses/productStatusesApi.js +13 -13
  64. package/dist/product-statuses/productStatusesInterfaces.d.ts +29 -27
  65. package/dist/products/productsApi.d.ts +246 -267
  66. package/dist/products/productsApi.js +247 -267
  67. package/dist/products/productsInterfaces.d.ts +333 -339
  68. package/dist/system/systemApi.d.ts +19 -21
  69. package/dist/system/systemApi.js +20 -21
  70. package/dist/system/systemInterfaces.d.ts +14 -3
  71. package/dist/templates/templatesApi.d.ts +13 -16
  72. package/dist/templates/templatesApi.js +13 -16
  73. package/dist/templates/templatesInterfaces.d.ts +30 -29
  74. package/dist/templates-preview/templatesPreviewApi.d.ts +10 -11
  75. package/dist/templates-preview/templatesPreviewApi.js +10 -11
  76. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +61 -64
  77. package/dist/users/usersApi.d.ts +36 -43
  78. package/dist/users/usersApi.js +36 -43
  79. package/dist/users/usersInterfaces.d.ts +92 -96
  80. package/dist/web-socket/wsApi.d.ts +5 -3
  81. package/dist/web-socket/wsApi.js +6 -3
  82. package/dist/web-socket/wsInterfaces.d.ts +7 -2
  83. package/package.json +16 -12
@@ -4,109 +4,106 @@ import type { IError } from '../base/utils';
4
4
  import type { FormDataType } from '../forms-data/formsDataInterfaces';
5
5
  /**
6
6
  * Interface representing user-related operations.
7
- *
8
7
  * @interface IUsers
9
- *
10
- * @property {function} getUser - Retrieves the data of an authorized user, optionally based on a language code.
11
- * @property {function} updateUser - Updates the user's data with the provided information.
12
- * @property {function} archiveUser - Archiving one user object (marked for deletion).
13
- * @property {function} deleteUser - Deletes the user from the system.
14
- * @property {function} addFCMToken - Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
15
- * @property {function} deleteFCMToken - Deletes an existing FCM token.
8
+ * @property {Function} getUser - Retrieves the data of an authorized user, optionally based on a language code.
9
+ * @property {Function} updateUser - Updates the user's data with the provided information.
10
+ * @property {Function} archiveUser - Archiving one user object (marked for deletion).
11
+ * @property {Function} deleteUser - Deletes the user from the system.
12
+ * @property {Function} addFCMToken - Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
13
+ * @property {Function} deleteFCMToken - Deletes an existing FCM token.
16
14
  * @description This interface defines methods for managing user data and handling Firebase Cloud Messaging tokens.
17
15
  */
18
16
  interface IUsers {
19
17
  /**
20
18
  * Retrieves the data of an authorized user.
21
- *
22
- * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
23
- * @return {IUserEntity} A promise resolving to the user entity or an error.
19
+ * @handleName getUser
20
+ * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
21
+ * @returns {IUserEntity} A promise resolving to the user entity or an error.
24
22
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
- * @description Retrieves the data of an authorized user.
23
+ * @description This method retrieves the data of an authorized user.
26
24
  */
27
25
  getUser(langCode?: string): Promise<IUserEntity | IError>;
28
26
  /**
29
27
  * Updates the user's data.
30
- *
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
- }
52
- * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
53
- * @return {boolean} A promise resolving to true if successful, or an error.
28
+ * @handleName updateUser
29
+ * @param {IUserBody} data - The new data for the user. Example:
30
+ {
31
+ "formIdentifier": "reg",
32
+ "authData": [
33
+ {
34
+ "marker": "password",
35
+ "value": "12345"
36
+ }
37
+ ],
38
+ "formData": {
39
+ "marker": "last_name",
40
+ "type": "string",
41
+ "value": "Username"
42
+ },
43
+ "notificationData": {
44
+ "email": "example@oneentry.cloud",
45
+ "phonePush": ["+99999999999"],
46
+ "phoneSMS": "+99999999999"
47
+ },
48
+ "state": {}
49
+ }
50
+ * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
51
+ * @returns {boolean} A promise resolving to true if successful, or an error.
54
52
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
55
- * @description Updates the user's data.
53
+ * @description This method updates the user's data.
56
54
  */
57
55
  updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
58
56
  /**
59
57
  * Archiving one user object (marked for deletion).
60
- *
61
- * @return {boolean} A promise resolving to true if successful, or an error.
58
+ * @handleName archiveUser
59
+ * @returns {boolean} A promise resolving to true if successful, or an error.
62
60
  * @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.
61
+ * @description This method archives a user object (marks it for deletion).
64
62
  */
65
63
  archiveUser(): Promise<boolean | IError>;
66
64
  /**
67
65
  * Deletes the user from the system.
68
- *
69
- * @return {boolean} A promise resolving to true if successful, or an error.
66
+ * @handleName deleteUser
67
+ * @returns {boolean} A promise resolving to true if successful, or an error.
70
68
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
71
- * @description Deletes the user from the system.
69
+ * @description This method deletes the user from the system.
72
70
  */
73
71
  deleteUser(): Promise<boolean | IError>;
74
72
  /**
75
73
  * Adds an FCM token for sending push notifications.
76
- *
77
- * @param {string} token - The FCM token to be added. Example: "fcm_token_1234567890abcdefg".
78
- * @return {boolean} A promise resolving to true if successful, or an error.
74
+ * @handleName addFCMToken
75
+ * @param {string} token - The FCM token to be added. Example: "fcm_token_1234567890abcdefg".
76
+ * @returns {boolean} A promise resolving to true if successful, or an error.
79
77
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
80
- * @description Adds an FCM token for sending push notifications.
78
+ * @description This method adds an FCM token for sending push notifications.
81
79
  */
82
80
  addFCMToken(token: string): Promise<boolean | IError>;
83
81
  /**
84
82
  * Deletes an existing FCM token.
85
- *
86
- * @param {string} token - The FCM token to be deleted. Example: "fcm_token_1234567890abcdefg".
87
- * @return {boolean} A promise resolving to true if successful, or an error.
83
+ * @handleName deleteFCMToken
84
+ * @param {string} token - The FCM token to be deleted. Example: "fcm_token_1234567890abcdefg".
85
+ * @returns {boolean} A promise resolving to true if successful, or an error.
88
86
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
89
- * @description Deletes an existing FCM token.
87
+ * @description This method deletes an existing FCM token.
90
88
  */
91
89
  deleteFCMToken(token: string): Promise<boolean | IError>;
92
90
  }
93
91
  /**
94
92
  * @interface IUserEntity
95
- *
96
- * @property {number} id - Object identifier. Example: 12345.
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"}
93
+ * @property {number} id - Object identifier. Example: 12345.
94
+ * @property {string} identifier - Text identifier for record field. Example: "user_12345".
95
+ * @property {string} authProviderIdentifier - Text identifier of the authentication provider. Example: "auth_provider_12345".
96
+ * @property {FormDataType[]} formData - Array of data form objects with the following values. Example:
97
+ [
98
+ {
99
+ "marker": "last_name",
100
+ "type": "string",
101
+ "value": "Username"
102
+ }
103
+ ]
104
+ * @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
105
+ * @property {any[]} groups - Array of user groups. Example: ["group_1", "group_2"].
106
+ * @property {any} state - Object containing additional user state information. Example: {"key": "value"}
110
107
  * @description Represents a user entity with various properties, including identifiers, form data, and user groups.
111
108
  */
112
109
  interface IUserEntity {
@@ -121,36 +118,35 @@ interface IUserEntity {
121
118
  }
122
119
  /**
123
120
  * @interface IUserBody
124
- *
125
- * @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
126
- * @property {string} [langCode] - Language code for localization. Default: "en_US".
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"}
121
+ * @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
122
+ * @property {string} [langCode] - Language code for localization. Default: "en_US".
123
+ * @property {{ marker: string; value: string }[]} [authData] - Array of authentication data objects with markers and values. Example:
124
+ [
125
+ {
126
+ "marker": "password",
127
+ "value": "12345"
128
+ }
129
+ ]
130
+ * @property {IAuthFormData | IAuthFormData[]} [formData] - Form data object or array of form data objects. Example:
131
+ [
132
+ {
133
+ "marker": "first_name",
134
+ "type": "string",
135
+ "value": "John"
136
+ },
137
+ {
138
+ "marker": "last_name",
139
+ "type": "string",
140
+ "value": "Doe"
141
+ }
142
+ ]
143
+ * @property {object} [notificationData] - Object containing notification data, including email and phone information. Example:
144
+ {
145
+ "email": "example@oneentry.cloud",
146
+ "phonePush": ["+99999999999"],
147
+ "phoneSMS": "+99999999999"
148
+ }
149
+ * @property {any} [state] - Object containing additional state information. Example: {"key": "value"}
154
150
  * @description Represents the body of a user request, including form identifiers, authentication data, form data, notification data, and state information.
155
151
  */
156
152
  interface IUserBody {
@@ -9,13 +9,15 @@ import type { IWS } from './wsInterfaces';
9
9
  export default class WsApi extends AsyncModules implements IWS {
10
10
  protected state: StateModule;
11
11
  protected _url: string;
12
+ /**
13
+ * Constructor
14
+ * @param {StateModule} state - StateModule
15
+ */
12
16
  constructor(state: StateModule);
13
17
  /**
14
18
  * Creates an instance of an object Socket.io with a connection. This method requires user authorization.
15
- *
16
19
  * @handleName connect
17
- *
18
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
20
+ * @returns {Socket} Returns a Socket instance.
19
21
  * @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
20
22
  */
21
23
  connect(): Socket;
@@ -10,20 +10,23 @@ const asyncModules_1 = __importDefault(require("../base/asyncModules"));
10
10
  * @handle /api/content/ws
11
11
  */
12
12
  class WsApi extends asyncModules_1.default {
13
+ /**
14
+ * Constructor
15
+ * @param {StateModule} state - StateModule
16
+ */
13
17
  constructor(state) {
14
18
  super(state);
15
19
  this._url = state.url + '/api/content/ws';
16
20
  }
17
21
  /**
18
22
  * Creates an instance of an object Socket.io with a connection. This method requires user authorization.
19
- *
20
23
  * @handleName connect
21
- *
22
- * @throws {IError} If there is an error during the fetch operation, it will return an error object.
24
+ * @returns {Socket} Returns a Socket instance.
23
25
  * @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
24
26
  */
25
27
  connect() {
26
28
  if (!this.state.accessToken) {
29
+ // eslint-disable-next-line no-undef, no-console
27
30
  console.error('User is unauthorized');
28
31
  }
29
32
  const socket = (0, socket_io_client_1.io)(this.state.url, {
@@ -1,11 +1,16 @@
1
1
  import type { Socket } from 'socket.io-client';
2
2
  /**
3
3
  * @interface IWS
4
- *
5
- * @property {function} connect - WebSocket Connection.
4
+ * @property {Function} connect - WebSocket Connection.
6
5
  * @description This interface defines a method for establishing a WebSocket connection.
7
6
  */
8
7
  interface IWS {
8
+ /**
9
+ * WebSocket Connection.
10
+ * @handleName connect
11
+ * @returns {Socket} Returns a Socket instance.
12
+ * @description This method establishes a WebSocket connection.
13
+ */
9
14
  connect(): Socket;
10
15
  }
11
16
  export type { IWS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.126",
3
+ "version": "1.0.127",
4
4
  "description": "OneEntry NPM package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,11 +9,12 @@
9
9
  ],
10
10
  "scripts": {
11
11
  "productionBuild": "run-s lint testAll build",
12
- "testAll": "run-s admins attributesets authProvider blocks fileuploading forms formsdata generaltypes integrationcollections locales menus orders pages payments productstatuses products templates templatespreview users",
12
+ "testAll": "run-s admins attributesets authProvider blocks events 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
+ "events": "npx jest src/events/tests/events.spec.ts",
17
18
  "fileuploading": "npx jest src/file-uploading/tests/fileuploading.spec.ts",
18
19
  "forms": "npx jest src/forms/tests/forms.spec.ts",
19
20
  "formsdata": "npx jest src/forms-data/tests/formsdata.spec.ts",
@@ -29,7 +30,8 @@
29
30
  "templates": "npx jest src/templates/tests/templates.spec.ts",
30
31
  "templatespreview": "npx jest src/templates-preview/tests/templatespreview.spec.ts",
31
32
  "users": "npx jest src/users/tests/users.spec.ts",
32
- "lint": "npx eslint",
33
+ "lint": "npx eslint .",
34
+ "lintFix": "npx eslint . --fix",
33
35
  "build": "npx tsc"
34
36
  },
35
37
  "bin": {
@@ -42,24 +44,26 @@
42
44
  "socket.io-client": "^4.8.1"
43
45
  },
44
46
  "devDependencies": {
45
- "@jest/globals": "^30.0.5",
47
+ "@jest/globals": "^30.2.0",
46
48
  "@types/eslint-config-prettier": "^6.11.3",
47
49
  "@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
- "eslint": "^8.57.1",
50
+ "@types/node": "^24.6.2",
51
+ "@typescript-eslint/eslint-plugin": "^8.45.0",
52
+ "@typescript-eslint/parser": "^8.45.0",
53
+ "eslint": "^9.37.0",
52
54
  "eslint-config-prettier": "^10.1.8",
53
55
  "eslint-plugin-import": "^2.32.0",
54
56
  "eslint-plugin-jest": "^29.0.1",
55
- "eslint-plugin-jest-extended": "^3.0.0",
57
+ "eslint-plugin-jest-extended": "^3.0.1",
58
+ "eslint-plugin-jsdoc": "^60.8.2",
56
59
  "eslint-plugin-prettier": "^5.5.4",
57
60
  "eslint-plugin-simple-import-sort": "^12.1.1",
58
- "jest": "^30.0.5",
61
+ "jest": "^30.2.0",
59
62
  "jest-extended": "^6.0.0",
63
+ "jsdoc": "^4.0.4",
60
64
  "npm-run-all": "^4.1.5",
61
65
  "prettier": "^3.6.2",
62
- "ts-jest": "^29.4.1",
63
- "typescript": "^5.9.2"
66
+ "ts-jest": "^29.4.4",
67
+ "typescript": "^5.9.3"
64
68
  }
65
69
  }