oneentry 1.0.139 → 1.0.140

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 (143) hide show
  1. package/README.md +16 -1
  2. package/configure.js +40 -21
  3. package/package.json +15 -12
  4. package/dist/admins/adminsApi.d.ts +0 -50
  5. package/dist/admins/adminsApi.js +0 -65
  6. package/dist/admins/adminsInterfaces.d.ts +0 -99
  7. package/dist/admins/adminsInterfaces.js +0 -2
  8. package/dist/admins/adminsSchemas.d.ts +0 -30
  9. package/dist/admins/adminsSchemas.js +0 -27
  10. package/dist/attribute-sets/attributeSetsApi.d.ts +0 -63
  11. package/dist/attribute-sets/attributeSetsApi.js +0 -98
  12. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +0 -187
  13. package/dist/attribute-sets/attributeSetsInterfaces.js +0 -2
  14. package/dist/attribute-sets/attributeSetsSchemas.d.ts +0 -90
  15. package/dist/attribute-sets/attributeSetsSchemas.js +0 -74
  16. package/dist/auth-provider/authProviderApi.d.ts +0 -249
  17. package/dist/auth-provider/authProviderApi.js +0 -351
  18. package/dist/auth-provider/authProviderSchemas.d.ts +0 -137
  19. package/dist/auth-provider/authProviderSchemas.js +0 -85
  20. package/dist/auth-provider/authProvidersInterfaces.d.ts +0 -417
  21. package/dist/auth-provider/authProvidersInterfaces.js +0 -2
  22. package/dist/base/asyncModules.d.ts +0 -80
  23. package/dist/base/asyncModules.js +0 -440
  24. package/dist/base/result.d.ts +0 -39
  25. package/dist/base/result.js +0 -154
  26. package/dist/base/stateModule.d.ts +0 -41
  27. package/dist/base/stateModule.js +0 -128
  28. package/dist/base/syncModules.d.ts +0 -149
  29. package/dist/base/syncModules.js +0 -549
  30. package/dist/base/utils.d.ts +0 -197
  31. package/dist/base/utils.js +0 -2
  32. package/dist/base/validation.d.ts +0 -118
  33. package/dist/base/validation.js +0 -132
  34. package/dist/blocks/blocksApi.d.ts +0 -74
  35. package/dist/blocks/blocksApi.js +0 -184
  36. package/dist/blocks/blocksInterfaces.d.ts +0 -173
  37. package/dist/blocks/blocksInterfaces.js +0 -2
  38. package/dist/blocks/blocksSchemas.d.ts +0 -187
  39. package/dist/blocks/blocksSchemas.js +0 -43
  40. package/dist/events/eventsApi.d.ts +0 -60
  41. package/dist/events/eventsApi.js +0 -97
  42. package/dist/events/eventsInterfaces.d.ts +0 -87
  43. package/dist/events/eventsInterfaces.js +0 -2
  44. package/dist/file-uploading/fileUploadingApi.d.ts +0 -88
  45. package/dist/file-uploading/fileUploadingApi.js +0 -132
  46. package/dist/file-uploading/fileUploadingInterfaces.d.ts +0 -117
  47. package/dist/file-uploading/fileUploadingInterfaces.js +0 -2
  48. package/dist/file-uploading/fileUploadingSchemas.d.ts +0 -22
  49. package/dist/file-uploading/fileUploadingSchemas.js +0 -21
  50. package/dist/forms/formsApi.d.ts +0 -42
  51. package/dist/forms/formsApi.js +0 -57
  52. package/dist/forms/formsInterfaces.d.ts +0 -132
  53. package/dist/forms/formsInterfaces.js +0 -2
  54. package/dist/forms/formsSchemas.d.ts +0 -65
  55. package/dist/forms/formsSchemas.js +0 -36
  56. package/dist/forms-data/formsDataApi.d.ts +0 -106
  57. package/dist/forms-data/formsDataApi.js +0 -189
  58. package/dist/forms-data/formsDataInterfaces.d.ts +0 -525
  59. package/dist/forms-data/formsDataInterfaces.js +0 -2
  60. package/dist/forms-data/formsDataSchemas.d.ts +0 -115
  61. package/dist/forms-data/formsDataSchemas.js +0 -86
  62. package/dist/general-types/generalTypesApi.d.ts +0 -28
  63. package/dist/general-types/generalTypesApi.js +0 -38
  64. package/dist/general-types/generalTypesInterfaces.d.ts +0 -30
  65. package/dist/general-types/generalTypesInterfaces.js +0 -2
  66. package/dist/general-types/generalTypesSchemas.d.ts +0 -50
  67. package/dist/general-types/generalTypesSchemas.js +0 -35
  68. package/dist/index.d.ts +0 -94
  69. package/dist/index.js +0 -97
  70. package/dist/integration-collections/integrationCollectionsApi.d.ts +0 -173
  71. package/dist/integration-collections/integrationCollectionsApi.js +0 -220
  72. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +0 -313
  73. package/dist/integration-collections/integrationCollectionsInterfaces.js +0 -2
  74. package/dist/integration-collections/integrationCollectionsSchemas.d.ts +0 -84
  75. package/dist/integration-collections/integrationCollectionsSchemas.js +0 -63
  76. package/dist/locales/localesApi.d.ts +0 -27
  77. package/dist/locales/localesApi.js +0 -37
  78. package/dist/locales/localesInterfaces.d.ts +0 -41
  79. package/dist/locales/localesInterfaces.js +0 -2
  80. package/dist/locales/localesSchemas.d.ts +0 -32
  81. package/dist/locales/localesSchemas.js +0 -26
  82. package/dist/menus/menusApi.d.ts +0 -29
  83. package/dist/menus/menusApi.js +0 -39
  84. package/dist/menus/menusInterfaces.d.ts +0 -88
  85. package/dist/menus/menusInterfaces.js +0 -4
  86. package/dist/menus/menusSchemas.d.ts +0 -16
  87. package/dist/menus/menusSchemas.js +0 -28
  88. package/dist/orders/ordersApi.d.ts +0 -126
  89. package/dist/orders/ordersApi.js +0 -169
  90. package/dist/orders/ordersInterfaces.d.ts +0 -427
  91. package/dist/orders/ordersInterfaces.js +0 -2
  92. package/dist/orders/ordersSchemas.d.ts +0 -158
  93. package/dist/orders/ordersSchemas.js +0 -120
  94. package/dist/pages/pagesApi.d.ts +0 -151
  95. package/dist/pages/pagesApi.js +0 -390
  96. package/dist/pages/pagesInterfaces.d.ts +0 -292
  97. package/dist/pages/pagesInterfaces.js +0 -2
  98. package/dist/pages/pagesSchemas.d.ts +0 -85
  99. package/dist/pages/pagesSchemas.js +0 -46
  100. package/dist/payments/paymentsApi.d.ts +0 -82
  101. package/dist/payments/paymentsApi.js +0 -121
  102. package/dist/payments/paymentsInterfaces.d.ts +0 -206
  103. package/dist/payments/paymentsInterfaces.js +0 -2
  104. package/dist/payments/paymentsSchemas.d.ts +0 -137
  105. package/dist/payments/paymentsSchemas.js +0 -78
  106. package/dist/product-statuses/productStatusesApi.d.ts +0 -47
  107. package/dist/product-statuses/productStatusesApi.js +0 -70
  108. package/dist/product-statuses/productStatusesInterfaces.d.ts +0 -66
  109. package/dist/product-statuses/productStatusesInterfaces.js +0 -2
  110. package/dist/product-statuses/productStatusesSchemas.d.ts +0 -34
  111. package/dist/product-statuses/productStatusesSchemas.js +0 -30
  112. package/dist/products/productsApi.d.ts +0 -364
  113. package/dist/products/productsApi.js +0 -455
  114. package/dist/products/productsInterfaces.d.ts +0 -583
  115. package/dist/products/productsInterfaces.js +0 -2
  116. package/dist/products/productsSchemas.d.ts +0 -212
  117. package/dist/products/productsSchemas.js +0 -85
  118. package/dist/system/systemApi.d.ts +0 -65
  119. package/dist/system/systemApi.js +0 -82
  120. package/dist/system/systemInterfaces.d.ts +0 -23
  121. package/dist/system/systemInterfaces.js +0 -2
  122. package/dist/templates/templatesApi.d.ts +0 -49
  123. package/dist/templates/templatesApi.js +0 -75
  124. package/dist/templates/templatesInterfaces.d.ts +0 -70
  125. package/dist/templates/templatesInterfaces.js +0 -2
  126. package/dist/templates/templatesSchemas.d.ts +0 -48
  127. package/dist/templates/templatesSchemas.js +0 -31
  128. package/dist/templates-preview/templatesPreviewApi.d.ts +0 -38
  129. package/dist/templates-preview/templatesPreviewApi.js +0 -53
  130. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -121
  131. package/dist/templates-preview/templatesPreviewInterfaces.js +0 -2
  132. package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -83
  133. package/dist/templates-preview/templatesPreviewSchemas.js +0 -48
  134. package/dist/users/usersApi.d.ts +0 -143
  135. package/dist/users/usersApi.js +0 -174
  136. package/dist/users/usersInterfaces.d.ts +0 -235
  137. package/dist/users/usersInterfaces.js +0 -2
  138. package/dist/users/usersSchemas.d.ts +0 -38
  139. package/dist/users/usersSchemas.js +0 -28
  140. package/dist/web-socket/wsApi.d.ts +0 -25
  141. package/dist/web-socket/wsApi.js +0 -45
  142. package/dist/web-socket/wsInterfaces.d.ts +0 -17
  143. package/dist/web-socket/wsInterfaces.js +0 -2
@@ -1,137 +0,0 @@
1
- /**
2
- * Validation schemas for Auth Provider module
3
- * @description Zod schemas for validating auth-related API responses
4
- */
5
- import { z } from 'zod';
6
- /**
7
- * Sign up response schema
8
- * @description Schema for validating sign up response
9
- */
10
- export declare const SignUpResponseSchema: z.ZodObject<{
11
- id: z.ZodNumber;
12
- identifier: z.ZodOptional<z.ZodString>;
13
- email: z.ZodOptional<z.ZodString>;
14
- phoneMask: z.ZodOptional<z.ZodString>;
15
- phoneCode: z.ZodOptional<z.ZodString>;
16
- phoneNumber: z.ZodOptional<z.ZodString>;
17
- statusMarker: z.ZodOptional<z.ZodString>;
18
- }, z.core.$strip>;
19
- /**
20
- * Auth response schema (login/refresh)
21
- * @description Schema for validating auth response
22
- */
23
- export declare const AuthResponseSchema: z.ZodObject<{
24
- accessToken: z.ZodString;
25
- refreshToken: z.ZodString;
26
- userIdentifier: z.ZodOptional<z.ZodString>;
27
- authProviderIdentifier: z.ZodOptional<z.ZodString>;
28
- user: z.ZodOptional<z.ZodObject<{
29
- id: z.ZodNumber;
30
- identifier: z.ZodOptional<z.ZodString>;
31
- email: z.ZodOptional<z.ZodString>;
32
- phoneMask: z.ZodOptional<z.ZodString>;
33
- phoneCode: z.ZodOptional<z.ZodString>;
34
- phoneNumber: z.ZodOptional<z.ZodString>;
35
- statusMarker: z.ZodOptional<z.ZodString>;
36
- formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
37
- total: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
38
- authProviderIdentifier: z.ZodOptional<z.ZodString>;
39
- formIdentifier: z.ZodOptional<z.ZodString>;
40
- groups: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
41
- state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
42
- moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
43
- }, z.core.$strip>>;
44
- }, z.core.$strip>;
45
- /**
46
- * User response schema
47
- * @description Schema for validating user response
48
- */
49
- export declare const UserResponseSchema: z.ZodObject<{
50
- id: z.ZodNumber;
51
- identifier: z.ZodOptional<z.ZodString>;
52
- email: z.ZodOptional<z.ZodString>;
53
- phoneMask: z.ZodOptional<z.ZodString>;
54
- phoneCode: z.ZodOptional<z.ZodString>;
55
- phoneNumber: z.ZodOptional<z.ZodString>;
56
- statusMarker: z.ZodOptional<z.ZodString>;
57
- formData: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>>;
58
- total: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
59
- authProviderIdentifier: z.ZodOptional<z.ZodString>;
60
- formIdentifier: z.ZodOptional<z.ZodString>;
61
- groups: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
62
- state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
63
- moduleFormConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
64
- }, z.core.$strip>;
65
- /**
66
- * Auth provider entity schema
67
- * @description Schema for validating auth provider entity
68
- * Includes all fields returned by the API
69
- */
70
- export declare const AuthProviderEntitySchema: z.ZodObject<{
71
- id: z.ZodNumber;
72
- identifier: z.ZodString;
73
- type: z.ZodOptional<z.ZodString>;
74
- formIdentifier: z.ZodOptional<z.ZodString>;
75
- userGroupIdentifier: z.ZodOptional<z.ZodString>;
76
- isActive: z.ZodBoolean;
77
- isCheckCode: z.ZodOptional<z.ZodBoolean>;
78
- version: z.ZodOptional<z.ZodNumber>;
79
- localizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
80
- config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
81
- marker: z.ZodOptional<z.ZodString>;
82
- name: z.ZodOptional<z.ZodString>;
83
- position: z.ZodOptional<z.ZodNumber>;
84
- }, z.core.$strip>;
85
- /**
86
- * Auth providers list response schema
87
- * @description Schema for validating auth providers list response
88
- */
89
- export declare const AuthProvidersResponseSchema: z.ZodArray<z.ZodObject<{
90
- id: z.ZodNumber;
91
- identifier: z.ZodString;
92
- type: z.ZodOptional<z.ZodString>;
93
- formIdentifier: z.ZodOptional<z.ZodString>;
94
- userGroupIdentifier: z.ZodOptional<z.ZodString>;
95
- isActive: z.ZodBoolean;
96
- isCheckCode: z.ZodOptional<z.ZodBoolean>;
97
- version: z.ZodOptional<z.ZodNumber>;
98
- localizeInfos: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
99
- config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
100
- marker: z.ZodOptional<z.ZodString>;
101
- name: z.ZodOptional<z.ZodString>;
102
- position: z.ZodOptional<z.ZodNumber>;
103
- }, z.core.$strip>>;
104
- /**
105
- * Generate code response schema
106
- * @description Schema for validating generate code response
107
- */
108
- export declare const GenerateCodeResponseSchema: z.ZodObject<{
109
- success: z.ZodBoolean;
110
- message: z.ZodOptional<z.ZodString>;
111
- }, z.core.$strip>;
112
- /**
113
- * Logout response schema
114
- * @description Schema for validating logout response
115
- */
116
- export declare const LogoutResponseSchema: z.ZodObject<{
117
- success: z.ZodBoolean;
118
- message: z.ZodOptional<z.ZodString>;
119
- }, z.core.$strip>;
120
- /**
121
- * Active sessions response schema
122
- * @description Schema for validating active sessions response
123
- */
124
- export declare const ActiveSessionSchema: z.ZodObject<{
125
- id: z.ZodString;
126
- deviceInfo: z.ZodOptional<z.ZodString>;
127
- ipAddress: z.ZodOptional<z.ZodString>;
128
- lastActive: z.ZodOptional<z.ZodString>;
129
- createdAt: z.ZodString;
130
- }, z.core.$strip>;
131
- export declare const ActiveSessionsResponseSchema: z.ZodArray<z.ZodObject<{
132
- id: z.ZodString;
133
- deviceInfo: z.ZodOptional<z.ZodString>;
134
- ipAddress: z.ZodOptional<z.ZodString>;
135
- lastActive: z.ZodOptional<z.ZodString>;
136
- createdAt: z.ZodString;
137
- }, z.core.$strip>>;
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActiveSessionsResponseSchema = exports.ActiveSessionSchema = exports.LogoutResponseSchema = exports.GenerateCodeResponseSchema = exports.AuthProvidersResponseSchema = exports.AuthProviderEntitySchema = exports.UserResponseSchema = exports.AuthResponseSchema = exports.SignUpResponseSchema = void 0;
4
- /**
5
- * Validation schemas for Auth Provider module
6
- * @description Zod schemas for validating auth-related API responses
7
- */
8
- const zod_1 = require("zod");
9
- const validation_1 = require("../base/validation");
10
- /**
11
- * Sign up response schema
12
- * @description Schema for validating sign up response
13
- */
14
- exports.SignUpResponseSchema = zod_1.z.object({
15
- id: zod_1.z.number(),
16
- identifier: zod_1.z.string().optional(),
17
- email: zod_1.z.string().email().optional(),
18
- phoneMask: zod_1.z.string().optional(),
19
- phoneCode: zod_1.z.string().optional(),
20
- phoneNumber: zod_1.z.string().optional(),
21
- statusMarker: zod_1.z.string().optional(),
22
- });
23
- /**
24
- * Auth response schema (login/refresh)
25
- * @description Schema for validating auth response
26
- */
27
- exports.AuthResponseSchema = validation_1.AuthEntitySchema;
28
- /**
29
- * User response schema
30
- * @description Schema for validating user response
31
- */
32
- exports.UserResponseSchema = validation_1.UserEntitySchema;
33
- /**
34
- * Auth provider entity schema
35
- * @description Schema for validating auth provider entity
36
- * Includes all fields returned by the API
37
- */
38
- exports.AuthProviderEntitySchema = zod_1.z.object({
39
- id: zod_1.z.number(),
40
- identifier: zod_1.z.string(),
41
- type: zod_1.z.string().optional(),
42
- formIdentifier: zod_1.z.string().optional(),
43
- userGroupIdentifier: zod_1.z.string().optional(),
44
- isActive: zod_1.z.boolean(),
45
- isCheckCode: zod_1.z.boolean().optional(),
46
- version: zod_1.z.number().optional(),
47
- localizeInfos: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
48
- config: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
49
- marker: zod_1.z.string().optional(),
50
- name: zod_1.z.string().optional(),
51
- position: zod_1.z.number().optional(),
52
- });
53
- /**
54
- * Auth providers list response schema
55
- * @description Schema for validating auth providers list response
56
- */
57
- exports.AuthProvidersResponseSchema = zod_1.z.array(exports.AuthProviderEntitySchema);
58
- /**
59
- * Generate code response schema
60
- * @description Schema for validating generate code response
61
- */
62
- exports.GenerateCodeResponseSchema = zod_1.z.object({
63
- success: zod_1.z.boolean(),
64
- message: zod_1.z.string().optional(),
65
- });
66
- /**
67
- * Logout response schema
68
- * @description Schema for validating logout response
69
- */
70
- exports.LogoutResponseSchema = zod_1.z.object({
71
- success: zod_1.z.boolean(),
72
- message: zod_1.z.string().optional(),
73
- });
74
- /**
75
- * Active sessions response schema
76
- * @description Schema for validating active sessions response
77
- */
78
- exports.ActiveSessionSchema = zod_1.z.object({
79
- id: zod_1.z.string(),
80
- deviceInfo: zod_1.z.string().optional(),
81
- ipAddress: zod_1.z.string().optional(),
82
- lastActive: zod_1.z.string().optional(),
83
- createdAt: zod_1.z.string(),
84
- });
85
- exports.ActiveSessionsResponseSchema = zod_1.z.array(exports.ActiveSessionSchema);
@@ -1,417 +0,0 @@
1
- import type { IError, ILocalizeInfo } from '../base/utils';
2
- /**
3
- * @interface IAuthProvider
4
- * @property {Function} signUp - User registration.
5
- * @property {Function} generateCode - Getting a user activation code.
6
- * @property {Function} checkCode - User activation code verification.
7
- * @property {Function} activateUser - User activate.
8
- * @property {Function} auth - User authorization.
9
- * @property {Function} refresh - Refresh token.
10
- * @property {Function} logout - User logout.
11
- * @property {Function} logoutAll - User logout.
12
- * @property {Function} changePassword - Change password.
13
- * @property {Function} getAuthProviders - Get all auth providers objects.
14
- * @property {Function} getAuthProviderByMarker - Get one auth provider object by marker.
15
- * @property {Function} getActiveSessionsByMarker - Get one auth provider object by marker.
16
- * @property {Function} oauth - User registration (authorization) via OAUTH.
17
- * @description This interface defines methods for user authentication and registration through various auth providers.
18
- */
19
- interface IAuthProvider {
20
- /**
21
- * Registers a new user.
22
- * @handleName signUp
23
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
24
- * @param {ISignUpData} data - The data required for user registration.
25
- * @example
26
- {
27
- "formIdentifier": "reg",
28
- "authData": [
29
- {
30
- "marker": "login",
31
- "value": "example@oneentry.cloud"
32
- },
33
- {
34
- "marker": "password",
35
- "value": "12345"
36
- }
37
- ],
38
- "formData": [
39
- {
40
- "marker": "last_name",
41
- "type": "string",
42
- "value": "Name"
43
- }
44
- ],
45
- "notificationData": {
46
- "email": "example@oneentry.cloud",
47
- "phonePush": ["+99999999999"],
48
- "phoneSMS": "+99999999999"
49
- }
50
- }
51
- * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
52
- * @returns {ISignUpEntity} A promise that resolves to a sign-up entity or an error.
53
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
54
- * @description This method registers a new user.
55
- */
56
- signUp(marker: string, data: ISignUpData, langCode?: string): Promise<ISignUpEntity | IError>;
57
- /**
58
- * Generates an activation code for a user.
59
- * @handleName generateCode
60
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
61
- * @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
62
- * @param {string} eventIdentifier - The event identifier related to the code generation. Example: "user_registration".
63
- * @returns {void} A promise that resolves to void or an error.
64
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
65
- * @description This method generates an activation code for a user.
66
- */
67
- generateCode(marker: string, userIdentifier: string, eventIdentifier: string): Promise<void | IError>;
68
- /**
69
- * Verifies a user activation code.
70
- * @handleName checkCode
71
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
72
- * @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
73
- * @param {string} eventIdentifier - The event identifier related to the code verification. Example: "user_registration".
74
- * @param {string} code - The activation code to verify. Example: "123456".
75
- * @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
76
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
77
- * @description This method verifies a user activation code.
78
- */
79
- checkCode(marker: string, userIdentifier: string, eventIdentifier: string, code: string): Promise<boolean | IError>;
80
- /**
81
- * Activates a user account.
82
- * @handleName activateUser
83
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
84
- * @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
85
- * @param {string} code - The activation code. Example: "123456".
86
- * @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
87
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
88
- * @description This method activates a user account.
89
- */
90
- activateUser(marker: string, userIdentifier: string, code: string): Promise<boolean | IError>;
91
- /**
92
- * Authorizes a user.
93
- * @handleName auth
94
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
95
- * @param {IAuthPostBody} data - The data required for user authorization. Example: .
96
- * @returns {IAuthEntity} A promise that resolves to an auth entity or an error.
97
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
98
- * @description This method authorizes a user.
99
- */
100
- auth(marker: string, data: IAuthPostBody): Promise<IAuthEntity | IError>;
101
- /**
102
- * Refreshes a user's access token.
103
- * @handleName refresh
104
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
105
- * @param {string} token - The refresh token. Example: "abcdef123456".
106
- * @returns {IAuthEntity} A promise that resolves to an auth entity or an error.
107
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
108
- * @description This method refreshes a user's access token.
109
- */
110
- refresh(marker: string, token: string): Promise<IAuthEntity | IError>;
111
- /**
112
- * Logs out a user.
113
- * @handleName logout
114
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
115
- * @param {string} token - The access token. Example: "abcdef123456".
116
- * @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
117
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
118
- * @description This method logs out a user.
119
- */
120
- logout(marker: string, token: string): Promise<boolean | IError>;
121
- /**
122
- * Logout of user account on all devices.
123
- * @handleName logoutAll
124
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
125
- * @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
126
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
127
- * @description This method logs out a user account on all devices.
128
- */
129
- logoutAll(marker: string): Promise<boolean | IError>;
130
- /**
131
- * Changes a user's password.
132
- * @handleName changePassword
133
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
134
- * @param {string} userIdentifier - The user's identifier. Example: "example@oneentry.cloud".
135
- * @param {string} eventIdentifier - The event identifier. Example: "reg".
136
- * @param {number} type - The type of password change. 1 for changing password, 2 for recovery. Example: 1.
137
- * @param {string} code - The code for password change verification. Example: "123456".
138
- * @param {string} newPassword - The new password. Example: "newPassword123".
139
- * @param {string} [repeatPassword] - Optional repeat of the new password for confirmation. Example: "newPassword123".
140
- * @returns {boolean} A promise that resolves to a boolean indicating success or failure, or an error.
141
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
142
- * @description This method changes a user's password.
143
- */
144
- changePassword(marker: string, userIdentifier: string, eventIdentifier: string, type: number, code: string, newPassword: string, repeatPassword?: string): Promise<boolean | IError>;
145
- /**
146
- * Retrieves all authentication providers.
147
- * @handleName getAuthProviders
148
- * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
149
- * @param {number} [offset] - Optional offset for pagination. Default: 0.
150
- * @param {number} [limit] - Optional limit for pagination. Default: 30.
151
- * @returns {IAuthProvidersEntity[]} A promise that resolves to an array of auth provider entities or an error.
152
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
153
- * @description This method retrieves all authentication providers.
154
- */
155
- getAuthProviders(langCode?: string, offset?: number, limit?: number): Promise<IAuthProvidersEntity[] | IError>;
156
- /**
157
- * Retrieves a specific auth provider by its marker.
158
- * @handleName getAuthProviderByMarker
159
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
160
- * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
161
- * @returns {IAuthProvidersEntity} A promise that resolves to an auth provider entity or an error.
162
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
163
- * @description This method retrieves a specific auth provider by its marker.
164
- */
165
- getAuthProviderByMarker(marker: string, langCode?: string): Promise<IAuthProvidersEntity | IError>;
166
- /**
167
- * Retrieves active user sessions data object.
168
- * @handleName getActiveSessionsByMarker
169
- * @param {string} marker - The marker identifying the auth provider. Example: "email".
170
- * @returns {any} A promise that resolves to active user sessions data object.
171
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
172
- * @description This method retrieves active user sessions data object.
173
- */
174
- getActiveSessionsByMarker(marker: string): Promise<any | IError>;
175
- /**
176
- * User registration (authorization) via OAUTH.
177
- * @handleName oauthSignUp
178
- * @param {string} marker - The text identifier of the authorization provider. Example: "email".
179
- * @param {IOauthData} body - Object contains OAuth information for registration.
180
- * @example
181
- {
182
- "client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com",
183
- "client_secret": "43434343434",
184
- "code": "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g",
185
- "grant_type": "authorization_code",
186
- "redirect_uri": "http://localhost:3000"
187
- }
188
- * @param {string} [langCode] - Language code. Default: "en_US".
189
- * @returns {ISignUpEntity} Returns a user object.
190
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
191
- * @description User registration (authorization) via OAUTH.
192
- */
193
- oauth(marker: string, body: IOauthData, langCode?: string): Promise<IAuthEntity | IError>;
194
- }
195
- /**
196
- * Interface representing the structure of authentication form data.
197
- * @interface IAuthFormData
198
- * @property {string} marker - A unique identifier for the form field. Example: "email".
199
- * @property {string} type - The type of the form field, such as 'string', 'email', etc. Example: "string".
200
- * @property {string} value - The value entered in the form field. Example: "example@oneentry.cloud".
201
- * @description This interface defines the structure of authentication form data used in user registration and authentication processes.
202
- */
203
- interface IAuthFormData {
204
- marker: string;
205
- type: string;
206
- value: string;
207
- }
208
- /**
209
- * Interface representing the data required for user registration.
210
- * @interface ISignUpData
211
- * @property {string} formIdentifier - The identifier for the registration form. Example: "reg".
212
- * @property {string} [langCode] - Language code. Default: "en_US".
213
- * @property {Array} authData - An array of authentication data objects, each containing a marker and its corresponding value.
214
- * @property {IAuthFormData | IAuthFormData[]} formData - The form data for the registration.
215
- * @property {object} notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
216
- * @description User registration (❗️For a provider with user activation, the activation code is sent through the corresponding user notification method).
217
- */
218
- interface ISignUpData {
219
- formIdentifier: string;
220
- langCode?: string;
221
- authData: Array<{
222
- marker: string;
223
- value: string;
224
- }>;
225
- formData: IAuthFormData | IAuthFormData[];
226
- notificationData: {
227
- email: string;
228
- phonePush: Array<string>;
229
- phoneSMS: string;
230
- };
231
- }
232
- /**
233
- * Interface representing the data required for user registration via OAUTH.
234
- * @interface IOauthData
235
- * @property {string} client_id - The client ID for the OAuth application. Example: "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com".
236
- * @property {string} client_secret - The client secret for the OAuth application. Example: "43434343434".
237
- * @property {string} code - The authorization code received from the OAuth provider. Example: "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g".
238
- * @property {string} grant_type - The grant type for the OAuth request. Example: "authorization_code".
239
- * @property {string} redirect_uri - The redirect URI for the OAuth application. Example: "http://localhost:3000".
240
- * @description User registration (❗️For a provider with user activation, the activation code is sent through the corresponding user notification method).
241
- */
242
- interface IOauthData {
243
- client_id: string;
244
- client_secret: string;
245
- code: string;
246
- grant_type: string;
247
- redirect_uri: string;
248
- }
249
- /**
250
- * Interface representing a sign-up entity.
251
- * @interface ISignUpEntity
252
- * @property {number} id - The unique identifier of the sign-up entity. Example: 12345.
253
- * @property {string} updatedDate - The date when the sign-up entity was last updated. Example: "2023-10-01T12:00:00Z".
254
- * @property {number} version - The version number of the sign-up entity. Example: 1.
255
- * @property {string} identifier - A unique string that identifies the sign-up entity. Example: "signup_12345".
256
- * @property {boolean} isActive - Indicates whether the sign-up entity is active. Example: true.
257
- * @property {Array<object>} formData - An array of objects representing the form data, each containing a marker and its corresponding value.
258
- * @example
259
- [
260
- {
261
- "marker": "first_name",
262
- "value": "John"
263
- },
264
- {
265
- "marker": "last_name",
266
- "value": "Doe"
267
- }
268
- ]
269
- * @property {object} notificationData - An object containing notification data, including email, phonePush, and phoneSMS.
270
- * @example
271
- {
272
- "email": "example@oneentry.cloud",
273
- "phonePush": ["+99999999999"],
274
- "phoneSMS": "+99999999999"
275
- }
276
- * @property {string} [locale] - The locale or language code associated with the sign-up entity. Example: "en_US".
277
- * @description This interface defines the structure of a sign-up entity.
278
- */
279
- interface ISignUpEntity {
280
- id: number;
281
- updatedDate: string;
282
- version: number;
283
- identifier: string;
284
- isActive: boolean;
285
- formData: Array<{
286
- marker: string;
287
- value: string;
288
- }>;
289
- notificationData: {
290
- email: string;
291
- phonePush: Array<string>;
292
- phoneSMS: string;
293
- };
294
- locale?: string;
295
- }
296
- /**
297
- * Interface representing a code entity used for user registration or verification processes.
298
- * @interface ICodeEntity
299
- * @property {string} code - The activation code for user registration or verification. Example: "123456".
300
- * @property {string} expiredDate - The date when the activation code expires. Example: "2023-10-01T12:00:00Z".
301
- * @description This interface defines the structure of a code entity used for user registration or verification processes.
302
- */
303
- interface ICodeEntity {
304
- code: string;
305
- expiredDate: string;
306
- }
307
- /**
308
- * Interface representing an authentication entity.
309
- * @interface IAuthEntity
310
- * @property {string} userIdentifier - The unique identifier for the user. Example: "user12345".
311
- * @property {string} authProviderIdentifier - The identifier for the authentication provider. Example: "email".
312
- * @property {string} accessToken - The access token for the user session. Example: "abcdef123456".
313
- * @property {string} refreshToken - The refresh token for renewing the access token. Example: "ghijkl789012".
314
- * @description This interface defines the structure of an authentication entity.
315
- */
316
- interface IAuthEntity {
317
- userIdentifier: string;
318
- authProviderIdentifier: string;
319
- accessToken: string;
320
- refreshToken: string;
321
- }
322
- /**
323
- * Interface representing an authentication provider entity.
324
- * @interface IAuthProvidersEntity
325
- * @property {number} id - The unique identifier of the auth provider entity. Example: 194.
326
- * @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider.
327
- * @example
328
- {
329
- "key": "value"
330
- }
331
- * @property {IAuthProvidersEntityConfig} config - Configuration settings for the auth provider, stored as a key-value pair object.
332
- * @example
333
- {
334
- "key": "value"
335
- }
336
- * @property {number} version - The version number of the auth provider entity. Example: 1.
337
- * @property {string} identifier - A unique string that identifies the auth provider. Example: "email".
338
- * @property {string} type - The type of the auth provider (e.g., 'email', 'google', etc.). Example: "email".
339
- * @property {string | null} formIdentifier - The identifier for the form associated with the auth provider, or null if not applicable. Example: "reg_form".
340
- * @property {string} userGroupIdentifier - The identifier for the userGroup associated with the auth provider. Example: "guest".
341
- * @property {boolean} isActive - Indicates whether the auth provider is active. Example: true.
342
- * @property {boolean} isCheckCode - Indicates whether the auth provider requires code verification. Example: false.
343
- * @description This interface defines the structure of an authentication provider entity.
344
- */
345
- interface IAuthProvidersEntity {
346
- id: number;
347
- localizeInfos: ILocalizeInfo;
348
- config: IAuthProvidersEntityConfig;
349
- version: number;
350
- identifier: string;
351
- type: string;
352
- formIdentifier: string | null;
353
- userGroupIdentifier: string;
354
- isActive: boolean;
355
- isCheckCode: boolean;
356
- }
357
- /**
358
- * Interface representing an authentication provider config.
359
- * @interface IAuthProvidersEntityConfig
360
- * @property {string} accessTokenTtlSec - Access token time to live in seconds. Example: "3600".
361
- * @property {string} refreshTokenTtlMc - Refresh token time to live in milliseconds. Example: "86400000".
362
- * @property {string} tokenSecretKey - Token secret key. Example: "secret_key".
363
- * @property {string} deleteNoneActiveUsersAfterDays - Delete none active users after days. Example: "30".
364
- * @property {string} systemCodeTlsSec - System code time to live in seconds. Example: "86400".
365
- * @property {string} systemCodeLength - System code length. Example: "6".
366
- */
367
- interface IAuthProvidersEntityConfig {
368
- accessTokenTtlSec: string;
369
- refreshTokenTtlMc: string;
370
- tokenSecretKey: string;
371
- deleteNoneActiveUsersAfterDays: string;
372
- systemCodeTlsSec: string;
373
- systemCodeLength: string;
374
- }
375
- interface IAuthData {
376
- marker: string;
377
- value: string;
378
- }
379
- /**
380
- * Interface representing the body used in authentication requests.
381
- * @interface IAuthPostBody
382
- * @property {IAuthData[]} authData - An array of authentication data objects, each containing a marker and its corresponding value.
383
- * @example
384
- [
385
- {
386
- "marker": "login",
387
- "value": "user@example.com"
388
- }
389
- ]
390
- * @description This interface defines the structure of the body used in authentication requests, containing an array of authentication data.
391
- */
392
- interface IAuthPostBody {
393
- authData: IAuthData[];
394
- }
395
- /**
396
- * Interface representing the active session data.
397
- * @interface IActiveSession
398
- * @property {object} deviceInfo - Information about the device used in the active session.
399
- * @example
400
- {
401
- "os": "Win32",
402
- "browser": "Node.js/22",
403
- "location": "ru-RU"
404
- }
405
- * @property {string} deviceInfo.os - The operating system of the active session. Example: "Win32".
406
- * @property {string} deviceInfo.browser - The browser used in the active session. Example: "Node.js/22".
407
- * @property {string} deviceInfo.location - The location of the active session. Example: "ru-RU".
408
- * @description This interface defines the structure of the body used in authentication requests, containing an array of authentication data.
409
- */
410
- interface IActiveSession {
411
- deviceInfo: {
412
- os: string;
413
- browser: string;
414
- location: string;
415
- };
416
- }
417
- export type { IActiveSession, IAuthData, IAuthEntity, IAuthFormData, IAuthPostBody, IAuthProvider, IAuthProvidersEntity, ICodeEntity, IOauthData, ISignUpData, ISignUpEntity, };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });