oneentry 1.0.159 → 1.0.161

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