oneentry 1.0.122 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/admins/adminsApi.d.ts +16 -8
  2. package/dist/admins/adminsApi.js +18 -10
  3. package/dist/admins/adminsInterfaces.d.ts +49 -25
  4. package/dist/attribute-sets/attributeSetsApi.d.ts +43 -21
  5. package/dist/attribute-sets/attributeSetsApi.js +49 -25
  6. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +70 -24
  7. package/dist/auth-provider/authProviderApi.d.ts +94 -83
  8. package/dist/auth-provider/authProviderApi.js +96 -83
  9. package/dist/auth-provider/authProvidersInterfaces.d.ts +188 -10
  10. package/dist/base/asyncModules.d.ts +32 -28
  11. package/dist/base/asyncModules.js +62 -38
  12. package/dist/base/syncModules.d.ts +44 -44
  13. package/dist/base/syncModules.js +65 -63
  14. package/dist/blocks/blocksApi.d.ts +56 -25
  15. package/dist/blocks/blocksApi.js +56 -25
  16. package/dist/blocks/blocksInterfaces.d.ts +71 -22
  17. package/dist/events/eventsApi.d.ts +45 -11
  18. package/dist/events/eventsApi.js +47 -17
  19. package/dist/events/eventsInterfaces.d.ts +44 -2
  20. package/dist/file-uploading/fileUploadingApi.d.ts +44 -24
  21. package/dist/file-uploading/fileUploadingApi.js +46 -27
  22. package/dist/file-uploading/fileUploadingInterfaces.d.ts +63 -14
  23. package/dist/forms/formsApi.d.ts +23 -8
  24. package/dist/forms/formsApi.js +23 -8
  25. package/dist/forms/formsInterfaces.d.ts +62 -15
  26. package/dist/formsData/formsDataApi.d.ts +33 -33
  27. package/dist/formsData/formsDataApi.js +33 -33
  28. package/dist/formsData/formsDataInterfaces.d.ts +123 -35
  29. package/dist/general-types/generalTypesApi.d.ts +12 -1
  30. package/dist/general-types/generalTypesApi.js +12 -1
  31. package/dist/general-types/generalTypesInterfaces.d.ts +18 -5
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/integration-collections/integrationCollectionsApi.d.ts +96 -70
  35. package/dist/integration-collections/integrationCollectionsApi.js +114 -81
  36. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +152 -30
  37. package/dist/locales/localesApi.d.ts +6 -1
  38. package/dist/locales/localesApi.js +6 -1
  39. package/dist/locales/localesInterfaces.d.ts +20 -11
  40. package/dist/menus/menusApi.d.ts +8 -3
  41. package/dist/menus/menusApi.js +8 -3
  42. package/dist/menus/menusInterfaces.d.ts +30 -17
  43. package/dist/orders/ordersApi.d.ts +64 -64
  44. package/dist/orders/ordersApi.js +67 -65
  45. package/dist/orders/ordersInterfaces.d.ts +174 -60
  46. package/dist/pages/pagesApi.d.ts +89 -30
  47. package/dist/pages/pagesApi.js +181 -57
  48. package/dist/pages/pagesInterfaces.d.ts +117 -23
  49. package/dist/payments/paymentsApi.d.ts +56 -22
  50. package/dist/payments/paymentsApi.js +56 -22
  51. package/dist/payments/paymentsInterfaces.d.ts +119 -36
  52. package/dist/product-statuses/productStatusesApi.d.ts +21 -15
  53. package/dist/product-statuses/productStatusesApi.js +21 -18
  54. package/dist/product-statuses/productStatusesInterfaces.d.ts +37 -9
  55. package/dist/products/productsApi.d.ts +137 -157
  56. package/dist/products/productsApi.js +137 -157
  57. package/dist/products/productsInterfaces.d.ts +240 -57
  58. package/dist/system/systemApi.d.ts +29 -10
  59. package/dist/system/systemApi.js +29 -10
  60. package/dist/system/systemInterfaces.d.ts +8 -0
  61. package/dist/templates/templatesApi.d.ts +26 -16
  62. package/dist/templates/templatesApi.js +26 -19
  63. package/dist/templates/templatesInterfaces.d.ts +40 -14
  64. package/dist/templates-preview/templatesPreviewApi.d.ts +18 -14
  65. package/dist/templates-preview/templatesPreviewApi.js +18 -17
  66. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +57 -29
  67. package/dist/users/usersApi.d.ts +37 -33
  68. package/dist/users/usersApi.js +37 -33
  69. package/dist/users/usersInterfaces.d.ts +80 -9
  70. package/dist/web-socket/wsApi.d.ts +6 -3
  71. package/dist/web-socket/wsApi.js +6 -3
  72. package/dist/web-socket/wsInterfaces.d.ts +3 -1
  73. package/package.json +11 -11
@@ -2,22 +2,84 @@ import type { IAuthFormData } from '../auth-provider/authProvidersInterfaces';
2
2
  import type { IError } from '../base/utils';
3
3
  import type { FormDataType } from '../formsData/formsDataInterfaces';
4
4
  /**
5
- * Represents a interface object of Users Api.
5
+ * Interface representing user-related operations.
6
6
  *
7
- * @property {function} subscribeByMarker - Getting the data of an authorized user.
8
- * @property {function} unsubscribeByMarker - Updating a single user object.
9
- * @property {function} addFCMToken - Adds FCM token for sending Push notification.
10
- * @property {function} deleteFCMToken - Delete FCM token.
11
- * @property {function} setAccessToken - Only for custom authorization. An intermediate method for setting up an access token.
7
+ * @interface IUsers
8
+ *
9
+ * @property {function} getUser - Retrieves the data of an authorized user, optionally based on a language code.
10
+ * @property {function} updateUser - Updates the user's data with the provided information.
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.
14
+ *
15
+ * @description This interface defines methods for managing user data and handling Firebase Cloud Messaging tokens.
12
16
  */
13
17
  interface IUsers {
18
+ /**
19
+ * Retrieves the data of an authorized user.
20
+ *
21
+ * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
22
+ *
23
+ * @return {IUserEntity} A promise resolving to the user entity or an error.
24
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
25
+ *
26
+ * @description Retrieves the data of an authorized user.
27
+ */
14
28
  getUser(langCode?: string): Promise<IUserEntity | IError>;
29
+ /**
30
+ * Updates the user's data.
31
+ *
32
+ * @param {IUserBody} data - The new data for the user. Example: {"formIdentifier": "reg", "authData": [{"marker": "password", "value": "12345"}], "formData": {"marker": "last_name", "type": "string", "value": "Username"}, "notificationData": {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999"}, "state": {}}
33
+ * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
34
+ *
35
+ * @return {boolean} A promise resolving to true if successful, or an error.
36
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
37
+ *
38
+ * @description Updates the user's data.
39
+ */
15
40
  updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
41
+ /**
42
+ * Deletes the user from the system.
43
+ *
44
+ * @return {boolean} A promise resolving to true if successful, or an error.
45
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
46
+ *
47
+ * @description Deletes the user from the system.
48
+ */
49
+ deleteUser(): Promise<boolean | IError>;
50
+ /**
51
+ * Adds an FCM token for sending push notifications.
52
+ *
53
+ * @param {string} token - The FCM token to be added. Example: "fcm_token_1234567890abcdefg".
54
+ * @return {boolean} A promise resolving to true if successful, or an error.
55
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
56
+ *
57
+ * @description Adds an FCM token for sending push notifications.
58
+ */
16
59
  addFCMToken(token: string): Promise<boolean | IError>;
60
+ /**
61
+ * Deletes an existing FCM token.
62
+ *
63
+ * @param {string} token - The FCM token to be deleted. Example: "fcm_token_1234567890abcdefg".
64
+ * @return {boolean} A promise resolving to true if successful, or an error.
65
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
66
+ *
67
+ * @description Deletes an existing FCM token.
68
+ */
17
69
  deleteFCMToken(token: string): Promise<boolean | IError>;
18
70
  }
19
71
  /**
20
- * IUserEntity
72
+ * @interface IUserEntity
73
+ *
74
+ * @property {number} id - Object identifier. Example: 12345.
75
+ * @property {string} identifier - Text identifier for record field. Example: 'user_12345'.
76
+ * @property {Array<FormDataType>} formData - Array of data form objects with the following values. Example: [{"marker": "last_name", "type": "string", "value": "Username"}].
77
+ * @property {string} formIdentifier - Text identifier of the form. Example: 'form_12345'.
78
+ * @property {string} authProviderIdentifier - Text identifier of the authentication provider. Example: 'auth_provider_12345'.
79
+ * @property {Array<string | number>} groups - Array of user groups. Example: ['group_1', 'group_2'].
80
+ * @property {Record<string, any>} state - Object containing additional user state information. Example: {"key": "value"}.
81
+ *
82
+ * @description Represents a user entity with various properties, including identifiers, form data, and user groups.
21
83
  */
22
84
  interface IUserEntity {
23
85
  id: number;
@@ -25,11 +87,20 @@ interface IUserEntity {
25
87
  formData: Array<FormDataType>;
26
88
  formIdentifier: string;
27
89
  authProviderIdentifier: string;
28
- groups: Array<string>;
90
+ groups: Array<string | number>;
29
91
  state: Record<string, any>;
30
92
  }
31
93
  /**
32
- * IUserBody
94
+ * @interface IUserBody
95
+ *
96
+ * @property {string} formIdentifier - Text identifier of the form. Example: 'form_12345'.
97
+ * @property {string} [langCode] - Language code for localization. Default: "en_US".
98
+ * @property {Array<{ marker: string; value: string }>} [authData] - Array of authentication data objects with markers and values. Example: [{"marker": "password", "value": "12345"}].
99
+ * @property {IAuthFormData | Array<IAuthFormData>} [formData] - Form data object or array of form data objects. Example: {"marker": "last_name", "type": "string", "value": "Username"} or [{"marker": "first_name", "type": "string", "value": "John"}, {"marker": "last_name", "type": "string", "value": "Doe"}].
100
+ * @property {object} [notificationData] - Object containing notification data, including email and phone information. Example: {"email": "example@oneentry.cloud", "phonePush": ["+99999999999"], "phoneSMS": "+99999999999"}.
101
+ * @property {Record<string, any>} [state] - Object containing additional state information. Example: {"key": "value"}.
102
+ *
103
+ * @description Represents the body of a user request, including form identifiers, authentication data, form data, notification data, and state information.
33
104
  */
34
105
  interface IUserBody {
35
106
  formIdentifier: string;
@@ -11,12 +11,15 @@ export default class WsApi extends AsyncModules implements IWS {
11
11
  protected _url: string;
12
12
  constructor(state: StateModule);
13
13
  /**
14
- * Creates an instance of an object Socket.io with a connection.
15
- * This method requires mandatory user authorization
14
+ * Creates an instance of an object Socket.io with a connection. This method requires user authorization.
16
15
  *
16
+ * @handleName connect
17
+ *
18
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
19
+ *
20
+ * @description
17
21
  * @example
18
22
  * const socket = WS.connect()
19
- *
20
23
  * socket.on('my_event', callback)
21
24
  */
22
25
  connect(): Socket;
@@ -15,12 +15,15 @@ class WsApi extends asyncModules_1.default {
15
15
  this._url = state.url + '/api/content/ws';
16
16
  }
17
17
  /**
18
- * Creates an instance of an object Socket.io with a connection.
19
- * This method requires mandatory user authorization
18
+ * Creates an instance of an object Socket.io with a connection. This method requires user authorization.
20
19
  *
20
+ * @handleName connect
21
+ *
22
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
23
+ *
24
+ * @description
21
25
  * @example
22
26
  * const socket = WS.connect()
23
- *
24
27
  * socket.on('my_event', callback)
25
28
  */
26
29
  connect() {
@@ -1,8 +1,10 @@
1
1
  import type { Socket } from 'socket.io-client';
2
2
  /**
3
- * Represents a interface object of WebSocket IO.
3
+ * @interface IWS
4
4
  *
5
5
  * @property {function} connect - WebSocket Connection.
6
+ *
7
+ * @description This interface defines a method for establishing a WebSocket connection.
6
8
  */
7
9
  interface IWS {
8
10
  connect(): Socket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.122",
3
+ "version": "1.0.124",
4
4
  "description": "OneEntry NPM package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,12 +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 payments productstatuses products templates templatespreview users",
12
+ "testAll": "run-s admins attributesets authProvider blocks file-uploading forms formsdata generaltypes integrationcollections locales menus orders pages payments 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
- "fileuploading": "npx jest src/file-uploading/tests/fileuploading.spec.ts",
17
+ "file-uploading": "npx jest src/file-uploading/tests/fileuploading.spec.ts",
18
18
  "forms": "npx jest src/forms/tests/forms.spec.ts",
19
19
  "formsdata": "npx jest src/formsData/tests/formsdata.spec.ts",
20
20
  "generaltypes": "npx jest src/general-types/tests/generaltypes.spec.ts",
@@ -45,19 +45,19 @@
45
45
  "@jest/globals": "^29.7.0",
46
46
  "@types/eslint-config-prettier": "^6.11.3",
47
47
  "@types/jest": "^29.5.14",
48
- "@types/node": "^22.15.17",
49
- "@typescript-eslint/eslint-plugin": "^8.32.1",
50
- "@typescript-eslint/parser": "^8.32.1",
48
+ "@types/node": "^22.16.0",
49
+ "@typescript-eslint/eslint-plugin": "^8.35.1",
50
+ "@typescript-eslint/parser": "^8.35.1",
51
51
  "eslint": "^8.57.1",
52
52
  "eslint-config-prettier": "^10.1.5",
53
- "eslint-plugin-import": "^2.31.0",
54
- "eslint-plugin-jest": "^28.11.0",
55
- "eslint-plugin-prettier": "^5.4.0",
53
+ "eslint-plugin-import": "^2.32.0",
54
+ "eslint-plugin-jest": "^29.0.1",
55
+ "eslint-plugin-prettier": "^5.5.1",
56
56
  "eslint-plugin-simple-import-sort": "^12.1.1",
57
57
  "jest": "^29.7.0",
58
58
  "npm-run-all": "^4.1.5",
59
- "prettier": "^3.5.3",
60
- "ts-jest": "^29.3.2",
59
+ "prettier": "^3.6.2",
60
+ "ts-jest": "^29.4.0",
61
61
  "typescript": "^5.8.3"
62
62
  }
63
63
  }