@vynelix/nestjs-multi-auth 0.0.2

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 (226) hide show
  1. package/README.md +760 -0
  2. package/bin/cli.js +152 -0
  3. package/dist/auth/auth-type.enum.d.ts +22 -0
  4. package/dist/auth/auth-type.enum.js +32 -0
  5. package/dist/auth/auth-type.enum.js.map +1 -0
  6. package/dist/auth/auth.controller.d.ts +70 -0
  7. package/dist/auth/auth.controller.js +434 -0
  8. package/dist/auth/auth.controller.js.map +1 -0
  9. package/dist/auth/auth.module.d.ts +9 -0
  10. package/dist/auth/auth.module.js +193 -0
  11. package/dist/auth/auth.module.js.map +1 -0
  12. package/dist/auth/auth.service.d.ts +180 -0
  13. package/dist/auth/auth.service.js +695 -0
  14. package/dist/auth/auth.service.js.map +1 -0
  15. package/dist/auth/core/auth-mapper.d.ts +6 -0
  16. package/dist/auth/core/auth-mapper.js +17 -0
  17. package/dist/auth/core/auth-mapper.js.map +1 -0
  18. package/dist/auth/core/jwt.strategy.d.ts +13 -0
  19. package/dist/auth/core/jwt.strategy.js +59 -0
  20. package/dist/auth/core/jwt.strategy.js.map +1 -0
  21. package/dist/auth/core/registration.d.ts +3 -0
  22. package/dist/auth/core/registration.js +60 -0
  23. package/dist/auth/core/registration.js.map +1 -0
  24. package/dist/auth/current-user-interface.d.ts +4 -0
  25. package/dist/auth/current-user-interface.js +4 -0
  26. package/dist/auth/current-user-interface.js.map +1 -0
  27. package/dist/auth/current-user.decorator.d.ts +2 -0
  28. package/dist/auth/current-user.decorator.js +16 -0
  29. package/dist/auth/current-user.decorator.js.map +1 -0
  30. package/dist/auth/decorator/current-user.decorator.d.ts +2 -0
  31. package/dist/auth/decorator/current-user.decorator.js +13 -0
  32. package/dist/auth/decorator/current-user.decorator.js.map +1 -0
  33. package/dist/auth/decorator/email-or-phone.decorator.d.ts +2 -0
  34. package/dist/auth/decorator/email-or-phone.decorator.js +26 -0
  35. package/dist/auth/decorator/email-or-phone.decorator.js.map +1 -0
  36. package/dist/auth/decorator/optional.decorator.d.ts +2 -0
  37. package/dist/auth/decorator/optional.decorator.js +9 -0
  38. package/dist/auth/decorator/optional.decorator.js.map +1 -0
  39. package/dist/auth/decorator/public.decorator.d.ts +2 -0
  40. package/dist/auth/decorator/public.decorator.js +9 -0
  41. package/dist/auth/decorator/public.decorator.js.map +1 -0
  42. package/dist/auth/dto/auth-response.dto.d.ts +17 -0
  43. package/dist/auth/dto/auth-response.dto.js +83 -0
  44. package/dist/auth/dto/auth-response.dto.js.map +1 -0
  45. package/dist/auth/dto/identifier-response.dto.d.ts +8 -0
  46. package/dist/auth/dto/identifier-response.dto.js +46 -0
  47. package/dist/auth/dto/identifier-response.dto.js.map +1 -0
  48. package/dist/auth/dto/login.dto.d.ts +11 -0
  49. package/dist/auth/dto/login.dto.js +68 -0
  50. package/dist/auth/dto/login.dto.js.map +1 -0
  51. package/dist/auth/dto/mfa.dto.d.ts +8 -0
  52. package/dist/auth/dto/mfa.dto.js +51 -0
  53. package/dist/auth/dto/mfa.dto.js.map +1 -0
  54. package/dist/auth/dto/oauth-provider-response.dto.d.ts +5 -0
  55. package/dist/auth/dto/oauth-provider-response.dto.js +30 -0
  56. package/dist/auth/dto/oauth-provider-response.dto.js.map +1 -0
  57. package/dist/auth/dto/refresh-token.dto.d.ts +3 -0
  58. package/dist/auth/dto/refresh-token.dto.js +28 -0
  59. package/dist/auth/dto/refresh-token.dto.js.map +1 -0
  60. package/dist/auth/dto/requests/forgot-password.dto.d.ts +5 -0
  61. package/dist/auth/dto/requests/forgot-password.dto.js +36 -0
  62. package/dist/auth/dto/requests/forgot-password.dto.js.map +1 -0
  63. package/dist/auth/dto/requests/login.dto.d.ts +11 -0
  64. package/dist/auth/dto/requests/login.dto.js +68 -0
  65. package/dist/auth/dto/requests/login.dto.js.map +1 -0
  66. package/dist/auth/dto/requests/magic-link.dto.d.ts +6 -0
  67. package/dist/auth/dto/requests/magic-link.dto.js +33 -0
  68. package/dist/auth/dto/requests/magic-link.dto.js.map +1 -0
  69. package/dist/auth/dto/requests/mfa.dto.d.ts +8 -0
  70. package/dist/auth/dto/requests/mfa.dto.js +51 -0
  71. package/dist/auth/dto/requests/mfa.dto.js.map +1 -0
  72. package/dist/auth/dto/requests/refresh-token.dto.d.ts +3 -0
  73. package/dist/auth/dto/requests/refresh-token.dto.js +29 -0
  74. package/dist/auth/dto/requests/refresh-token.dto.js.map +1 -0
  75. package/dist/auth/dto/requests/reset-password.dto.d.ts +5 -0
  76. package/dist/auth/dto/requests/reset-password.dto.js +36 -0
  77. package/dist/auth/dto/requests/reset-password.dto.js.map +1 -0
  78. package/dist/auth/dto/requests/secure-account.dto.d.ts +3 -0
  79. package/dist/auth/dto/requests/secure-account.dto.js +24 -0
  80. package/dist/auth/dto/requests/secure-account.dto.js.map +1 -0
  81. package/dist/auth/dto/requests/signup.dto.d.ts +13 -0
  82. package/dist/auth/dto/requests/signup.dto.js +70 -0
  83. package/dist/auth/dto/requests/signup.dto.js.map +1 -0
  84. package/dist/auth/dto/requests/update-password.dto.d.ts +4 -0
  85. package/dist/auth/dto/requests/update-password.dto.js +30 -0
  86. package/dist/auth/dto/requests/update-password.dto.js.map +1 -0
  87. package/dist/auth/dto/requests/verify.dto.d.ts +7 -0
  88. package/dist/auth/dto/requests/verify.dto.js +48 -0
  89. package/dist/auth/dto/requests/verify.dto.js.map +1 -0
  90. package/dist/auth/dto/responses/auth-response.dto.d.ts +17 -0
  91. package/dist/auth/dto/responses/auth-response.dto.js +83 -0
  92. package/dist/auth/dto/responses/auth-response.dto.js.map +1 -0
  93. package/dist/auth/dto/responses/identifier-response.dto.d.ts +10 -0
  94. package/dist/auth/dto/responses/identifier-response.dto.js +56 -0
  95. package/dist/auth/dto/responses/identifier-response.dto.js.map +1 -0
  96. package/dist/auth/dto/responses/oauth-provider-response.dto.d.ts +10 -0
  97. package/dist/auth/dto/responses/oauth-provider-response.dto.js +55 -0
  98. package/dist/auth/dto/responses/oauth-provider-response.dto.js.map +1 -0
  99. package/dist/auth/dto/signup.dto.d.ts +13 -0
  100. package/dist/auth/dto/signup.dto.js +70 -0
  101. package/dist/auth/dto/signup.dto.js.map +1 -0
  102. package/dist/auth/dto/verify.dto.d.ts +7 -0
  103. package/dist/auth/dto/verify.dto.js +48 -0
  104. package/dist/auth/dto/verify.dto.js.map +1 -0
  105. package/dist/auth/entities/auth-identify.entity.d.ts +33 -0
  106. package/dist/auth/entities/auth-identify.entity.js +73 -0
  107. package/dist/auth/entities/auth-identify.entity.js.map +1 -0
  108. package/dist/auth/entities/auth.entity.d.ts +45 -0
  109. package/dist/auth/entities/auth.entity.js +129 -0
  110. package/dist/auth/entities/auth.entity.js.map +1 -0
  111. package/dist/auth/entities/base.entity.d.ts +6 -0
  112. package/dist/auth/entities/base.entity.js +41 -0
  113. package/dist/auth/entities/base.entity.js.map +1 -0
  114. package/dist/auth/entities/mfa-method.entity.d.ts +23 -0
  115. package/dist/auth/entities/mfa-method.entity.js +69 -0
  116. package/dist/auth/entities/mfa-method.entity.js.map +1 -0
  117. package/dist/auth/entities/oauth-provider.entity.d.ts +38 -0
  118. package/dist/auth/entities/oauth-provider.entity.js +88 -0
  119. package/dist/auth/entities/oauth-provider.entity.js.map +1 -0
  120. package/dist/auth/entities/otp-token.entity.d.ts +22 -0
  121. package/dist/auth/entities/otp-token.entity.js +61 -0
  122. package/dist/auth/entities/otp-token.entity.js.map +1 -0
  123. package/dist/auth/entities/session.entity.d.ts +19 -0
  124. package/dist/auth/entities/session.entity.js +65 -0
  125. package/dist/auth/entities/session.entity.js.map +1 -0
  126. package/dist/auth/enums/auth-type.enum.d.ts +23 -0
  127. package/dist/auth/enums/auth-type.enum.js +34 -0
  128. package/dist/auth/enums/auth-type.enum.js.map +1 -0
  129. package/dist/auth/guards/jwt-auth.guard.d.ts +10 -0
  130. package/dist/auth/guards/jwt-auth.guard.js +68 -0
  131. package/dist/auth/guards/jwt-auth.guard.js.map +1 -0
  132. package/dist/auth/guards/optional-auth.guard.d.ts +8 -0
  133. package/dist/auth/guards/optional-auth.guard.js +45 -0
  134. package/dist/auth/guards/optional-auth.guard.js.map +1 -0
  135. package/dist/auth/guards/ws-jwt-auth.guard.d.ts +0 -0
  136. package/dist/auth/guards/ws-jwt-auth.guard.js +31 -0
  137. package/dist/auth/guards/ws-jwt-auth.guard.js.map +1 -0
  138. package/dist/auth/interfaces/auth-module-async-options.interface.d.ts +7 -0
  139. package/dist/auth/interfaces/auth-module-async-options.interface.js +3 -0
  140. package/dist/auth/interfaces/auth-module-async-options.interface.js.map +1 -0
  141. package/dist/auth/interfaces/auth-module-options.interface.d.ts +132 -0
  142. package/dist/auth/interfaces/auth-module-options.interface.js +5 -0
  143. package/dist/auth/interfaces/auth-module-options.interface.js.map +1 -0
  144. package/dist/auth/interfaces/auth-notification-provider.interface.d.ts +29 -0
  145. package/dist/auth/interfaces/auth-notification-provider.interface.js +5 -0
  146. package/dist/auth/interfaces/auth-notification-provider.interface.js.map +1 -0
  147. package/dist/auth/interfaces/auth-user-service.interface.d.ts +13 -0
  148. package/dist/auth/interfaces/auth-user-service.interface.js +7 -0
  149. package/dist/auth/interfaces/auth-user-service.interface.js.map +1 -0
  150. package/dist/auth/interfaces/current-user-interface.d.ts +4 -0
  151. package/dist/auth/interfaces/current-user-interface.js +4 -0
  152. package/dist/auth/interfaces/current-user-interface.js.map +1 -0
  153. package/dist/auth/interfaces/current-user.decorator.d.ts +2 -0
  154. package/dist/auth/interfaces/current-user.decorator.js +16 -0
  155. package/dist/auth/interfaces/current-user.decorator.js.map +1 -0
  156. package/dist/auth/interfaces/jwt-payload-interface.d.ts +4 -0
  157. package/dist/auth/interfaces/jwt-payload-interface.js +3 -0
  158. package/dist/auth/interfaces/jwt-payload-interface.js.map +1 -0
  159. package/dist/auth/interfaces/oauth-strategy.interface.d.ts +14 -0
  160. package/dist/auth/interfaces/oauth-strategy.interface.js +3 -0
  161. package/dist/auth/interfaces/oauth-strategy.interface.js.map +1 -0
  162. package/dist/auth/jwt-payload-interface.d.ts +4 -0
  163. package/dist/auth/jwt-payload-interface.js +3 -0
  164. package/dist/auth/jwt-payload-interface.js.map +1 -0
  165. package/dist/auth/jwt.strategy.d.ts +13 -0
  166. package/dist/auth/jwt.strategy.js +60 -0
  167. package/dist/auth/jwt.strategy.js.map +1 -0
  168. package/dist/auth/strategies/company.strategy.d.ts +0 -0
  169. package/dist/auth/strategies/company.strategy.js +1 -0
  170. package/dist/auth/strategies/company.strategy.js.map +1 -0
  171. package/dist/auth/strategies/google.strategy.d.ts +7 -0
  172. package/dist/auth/strategies/google.strategy.js +23 -0
  173. package/dist/auth/strategies/google.strategy.js.map +1 -0
  174. package/dist/auth/strategies/local-auth.strategy.d.ts +24 -0
  175. package/dist/auth/strategies/local-auth.strategy.js +244 -0
  176. package/dist/auth/strategies/local-auth.strategy.js.map +1 -0
  177. package/dist/auth/strategies/oauth/apple.strategy.d.ts +27 -0
  178. package/dist/auth/strategies/oauth/apple.strategy.js +176 -0
  179. package/dist/auth/strategies/oauth/apple.strategy.js.map +1 -0
  180. package/dist/auth/strategies/oauth/facebook.strategy.d.ts +24 -0
  181. package/dist/auth/strategies/oauth/facebook.strategy.js +150 -0
  182. package/dist/auth/strategies/oauth/facebook.strategy.js.map +1 -0
  183. package/dist/auth/strategies/oauth/google.strategy.d.ts +25 -0
  184. package/dist/auth/strategies/oauth/google.strategy.js +225 -0
  185. package/dist/auth/strategies/oauth/google.strategy.js.map +1 -0
  186. package/dist/auth/strategies/oauth/oauth-strategy.interface.d.ts +14 -0
  187. package/dist/auth/strategies/oauth/oauth-strategy.interface.js +3 -0
  188. package/dist/auth/strategies/oauth/oauth-strategy.interface.js.map +1 -0
  189. package/dist/auth/strategies/oauth/oauth.strategy.d.ts +25 -0
  190. package/dist/auth/strategies/oauth/oauth.strategy.js +70 -0
  191. package/dist/auth/strategies/oauth/oauth.strategy.js.map +1 -0
  192. package/dist/auth/strategies/otp.strategy.d.ts +7 -0
  193. package/dist/auth/strategies/otp.strategy.js +23 -0
  194. package/dist/auth/strategies/otp.strategy.js.map +1 -0
  195. package/dist/auth/strategies/password.strategy.d.ts +14 -0
  196. package/dist/auth/strategies/password.strategy.js +130 -0
  197. package/dist/auth/strategies/password.strategy.js.map +1 -0
  198. package/dist/auth/utils/duration.util.d.ts +8 -0
  199. package/dist/auth/utils/duration.util.js +29 -0
  200. package/dist/auth/utils/duration.util.js.map +1 -0
  201. package/dist/index.d.ts +21 -0
  202. package/dist/index.js +39 -0
  203. package/dist/index.js.map +1 -0
  204. package/dist/migrations/auth-entities.d.ts +7 -0
  205. package/dist/migrations/auth-entities.js +18 -0
  206. package/dist/migrations/auth-entities.js.map +1 -0
  207. package/dist/migrations/auth-schema.initializer.d.ts +9 -0
  208. package/dist/migrations/auth-schema.initializer.js +36 -0
  209. package/dist/migrations/auth-schema.initializer.js.map +1 -0
  210. package/dist/migrations/auth.migration.v1.d.ts +12 -0
  211. package/dist/migrations/auth.migration.v1.js +157 -0
  212. package/dist/migrations/auth.migration.v1.js.map +1 -0
  213. package/dist/migrations/auth.migration.v2.d.ts +8 -0
  214. package/dist/migrations/auth.migration.v2.js +39 -0
  215. package/dist/migrations/auth.migration.v2.js.map +1 -0
  216. package/dist/migrations/auth.migrations.d.ts +2 -0
  217. package/dist/migrations/auth.migrations.js +8 -0
  218. package/dist/migrations/auth.migrations.js.map +1 -0
  219. package/dist/migrations/migration.runner.d.ts +9 -0
  220. package/dist/migrations/migration.runner.js +67 -0
  221. package/dist/migrations/migration.runner.js.map +1 -0
  222. package/dist/migrations/migration.service.d.ts +9 -0
  223. package/dist/migrations/migration.service.js +71 -0
  224. package/dist/migrations/migration.service.js.map +1 -0
  225. package/dist/tsconfig.tsbuildinfo +1 -0
  226. package/package.json +82 -0
package/bin/cli.js ADDED
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { Command } = require('commander');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const program = new Command();
8
+
9
+ program
10
+ .name('nestjs-multi-auth')
11
+ .description('Auth CLI tools')
12
+ .version('1.0.0');
13
+
14
+
15
+ // 🔍 Resolve DataSource path
16
+ function resolveDataSource() {
17
+ const cwd = process.cwd();
18
+
19
+ const possiblePaths = [
20
+ 'dist/data-source.js',
21
+ 'dist/database/data-source.js',
22
+ 'src/data-source.ts',
23
+ 'src/database/data-source.ts',
24
+ ];
25
+
26
+ for (const p of possiblePaths) {
27
+ const fullPath = path.join(cwd, p);
28
+ if (fs.existsSync(fullPath)) {
29
+ return fullPath;
30
+ }
31
+ }
32
+
33
+ throw new Error(
34
+ '[!] Could not find data-source file. Expected one of:\n' +
35
+ possiblePaths.map(p => ` - ${p}`).join('\n')
36
+ );
37
+ }
38
+
39
+
40
+ // 🔧 Extract or create DataSource
41
+ function extractDataSource(exported) {
42
+ const { DataSource } = require('typeorm');
43
+
44
+ if (!exported) {
45
+ throw new Error('No exports found in data-source file');
46
+ }
47
+
48
+ // ✅ Already a DataSource instance
49
+ if (exported.AppDataSource instanceof DataSource) {
50
+ return exported.AppDataSource;
51
+ }
52
+
53
+ if (exported.dataSource instanceof DataSource) {
54
+ return exported.dataSource;
55
+ }
56
+
57
+ if (exported.default instanceof DataSource) {
58
+ return exported.default;
59
+ }
60
+
61
+ // ✅ Config object → wrap it
62
+ const config =
63
+ exported.default ||
64
+ exported.databaseConfig ||
65
+ exported;
66
+
67
+ return new DataSource(config);
68
+ }
69
+
70
+
71
+ // 🔧 Load DataSource (TS + JS support)
72
+ async function loadDataSource() {
73
+ const dataSourcePath = resolveDataSource();
74
+
75
+ console.log('[i] Using DataSource at:', dataSourcePath);
76
+
77
+ if (dataSourcePath.endsWith('.ts')) {
78
+ require('ts-node/register');
79
+ }
80
+
81
+ const exported = require(dataSourcePath);
82
+
83
+ const dataSource = extractDataSource(exported);
84
+
85
+ if (!dataSource.isInitialized) {
86
+ await dataSource.initialize();
87
+ }
88
+
89
+ return dataSource;
90
+ }
91
+
92
+
93
+ // 🔁 Shared runner
94
+ async function runWithDataSource(fn) {
95
+ const dataSource = await loadDataSource();
96
+
97
+ try {
98
+ await fn(dataSource);
99
+ } finally {
100
+ if (dataSource.isInitialized) {
101
+ await dataSource.destroy();
102
+ }
103
+ }
104
+ }
105
+
106
+
107
+ // 🚀 MIGRATE COMMAND
108
+ program
109
+ .command('migrate')
110
+ .description('Run auth migrations')
111
+ .action(async () => {
112
+ try {
113
+ const { AuthMigrationService } = require('../dist/migrations/migration.service');
114
+
115
+ await runWithDataSource(async (dataSource) => {
116
+ const service = new AuthMigrationService(dataSource);
117
+ await service.runMigrations();
118
+ });
119
+
120
+ console.log('[i] Auth migrations completed');
121
+ process.exit(0);
122
+ } catch (err) {
123
+ console.error('[!] Migration failed:\n', err);
124
+ process.exit(1);
125
+ }
126
+ });
127
+
128
+
129
+ // 🔍 DOCTOR COMMAND
130
+ program
131
+ .command('doctor')
132
+ .description('Check auth schema status')
133
+ .action(async () => {
134
+ try {
135
+ const { AuthMigrationService } = require('../dist/migrations/migration.service');
136
+
137
+ await runWithDataSource(async (dataSource) => {
138
+ const service = new AuthMigrationService(dataSource);
139
+ const version = await service.getCurrentVersion();
140
+
141
+ console.log('[i] Current auth schema version:', version);
142
+ });
143
+
144
+ process.exit(0);
145
+ } catch (err) {
146
+ console.error('[!] Doctor check failed:\n', err);
147
+ process.exit(1);
148
+ }
149
+ });
150
+
151
+
152
+ program.parse(process.argv);
@@ -0,0 +1,22 @@
1
+ export declare enum AuthStrategy {
2
+ EMAIL = "EMAIL",
3
+ PHONE = "PHONE",
4
+ USERNAME = "USERNAME",
5
+ GOOGLE = "GOOGLE",
6
+ FACEBOOK = "FACEBOOK",
7
+ APPLE = "APPLE",
8
+ /** @deprecated Use granular types instead */
9
+ LOCAL = "LOCAL",
10
+ /** @deprecated Use granular types instead */
11
+ OAUTH = "OAUTH"
12
+ }
13
+ export declare enum OAuthProviderType {
14
+ GOOGLE = "GOOGLE",
15
+ FACEBOOK = "FACEBOOK",
16
+ APPLE = "APPLE"
17
+ }
18
+ export declare enum AuthTransport {
19
+ COOKIE = "cookie",
20
+ BEARER = "bearer",
21
+ BOTH = "both"
22
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ // src/auth/enums/auth-types.enum.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AuthTransport = exports.OAuthProviderType = exports.AuthStrategy = void 0;
5
+ var AuthStrategy;
6
+ (function (AuthStrategy) {
7
+ // Local / Password-based
8
+ AuthStrategy["EMAIL"] = "EMAIL";
9
+ AuthStrategy["PHONE"] = "PHONE";
10
+ AuthStrategy["USERNAME"] = "USERNAME";
11
+ // Social / OAuth
12
+ AuthStrategy["GOOGLE"] = "GOOGLE";
13
+ AuthStrategy["FACEBOOK"] = "FACEBOOK";
14
+ AuthStrategy["APPLE"] = "APPLE";
15
+ /** @deprecated Use granular types instead */
16
+ AuthStrategy["LOCAL"] = "LOCAL";
17
+ /** @deprecated Use granular types instead */
18
+ AuthStrategy["OAUTH"] = "OAUTH";
19
+ })(AuthStrategy || (exports.AuthStrategy = AuthStrategy = {}));
20
+ var OAuthProviderType;
21
+ (function (OAuthProviderType) {
22
+ OAuthProviderType["GOOGLE"] = "GOOGLE";
23
+ OAuthProviderType["FACEBOOK"] = "FACEBOOK";
24
+ OAuthProviderType["APPLE"] = "APPLE";
25
+ })(OAuthProviderType || (exports.OAuthProviderType = OAuthProviderType = {}));
26
+ var AuthTransport;
27
+ (function (AuthTransport) {
28
+ AuthTransport["COOKIE"] = "cookie";
29
+ AuthTransport["BEARER"] = "bearer";
30
+ AuthTransport["BOTH"] = "both";
31
+ })(AuthTransport || (exports.AuthTransport = AuthTransport = {}));
32
+ //# sourceMappingURL=auth-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-type.enum.js","sourceRoot":"","sources":["../../src/auth/auth-type.enum.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;AAEpC,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,yBAAyB;IACzB,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,qCAAqB,CAAA;IAErB,iBAAiB;IACjB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IAEf,6CAA6C;IAC7C,+BAAe,CAAA;IACf,6CAA6C;IAC7C,+BAAe,CAAA;AACjB,CAAC,EAfW,YAAY,4BAAZ,YAAY,QAevB;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,oCAAe,CAAA;AACjB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
@@ -0,0 +1,70 @@
1
+ import { AuthService } from './auth.service';
2
+ import { LoginDto } from './dto/requests/login.dto';
3
+ import { SignupDto } from './dto/requests/signup.dto';
4
+ import { VerifyDto, ResendVerificationDto } from './dto/requests/verify.dto';
5
+ import { EnrollMfaDto, ActivateMfaDto } from './dto/requests/mfa.dto';
6
+ import { RefreshTokenDto } from './dto/requests/refresh-token.dto';
7
+ import { ForgotPasswordDto } from './dto/requests/forgot-password.dto';
8
+ import { ResetPasswordDto } from './dto/requests/reset-password.dto';
9
+ import { UpdatePasswordDto } from './dto/requests/update-password.dto';
10
+ import { MagicLinkRequestDto } from './dto/requests/magic-link.dto';
11
+ import { SecureAccountDto } from './dto/requests/secure-account.dto';
12
+ import { AuthModuleOptions } from './interfaces/auth-module-options.interface';
13
+ import type { Response, Request } from 'express';
14
+ export declare class AuthController {
15
+ private authService;
16
+ private options;
17
+ constructor(authService: AuthService, options: AuthModuleOptions);
18
+ private getTransports;
19
+ private getDynamicPath;
20
+ private setCookies;
21
+ signup(dto: SignupDto, res: Response, req: Request): Promise<any>;
22
+ login(dto: LoginDto, res: Response, req: Request): Promise<any>;
23
+ verify(dto: VerifyDto, res: Response, req: Request): Promise<any>;
24
+ resendVerification(dto: ResendVerificationDto): Promise<{
25
+ message: string;
26
+ }>;
27
+ forgotPassword(dto: ForgotPasswordDto): Promise<{
28
+ message: string;
29
+ }>;
30
+ resetPassword(dto: ResetPasswordDto): Promise<{
31
+ message: string;
32
+ }>;
33
+ updatePassword(req: any, dto: UpdatePasswordDto): Promise<{
34
+ message: string;
35
+ }>;
36
+ secureAccount(uid: string, dto: SecureAccountDto): Promise<{
37
+ message: string;
38
+ }>;
39
+ requestMagicLink(dto: MagicLinkRequestDto): Promise<{
40
+ message: string;
41
+ }>;
42
+ verifyMagicLink(token: string, res: Response, req: Request): Promise<any>;
43
+ link(dto: SignupDto, req: any, res: Response): Promise<any>;
44
+ refresh(req: Request, res: Response, dto: RefreshTokenDto): Promise<{
45
+ message: string;
46
+ tokens: {
47
+ accessToken: string;
48
+ refreshToken: string;
49
+ };
50
+ } | {
51
+ message: string;
52
+ tokens?: undefined;
53
+ }>;
54
+ enrollMfa(req: any, dto: EnrollMfaDto): Promise<{
55
+ secret: string;
56
+ otpauth: string;
57
+ }>;
58
+ activateMfa(req: any, dto: ActivateMfaDto): Promise<{
59
+ message: string;
60
+ }>;
61
+ logout(req: Request, res: Response, dto: RefreshTokenDto): Promise<{
62
+ message: string;
63
+ }>;
64
+ me(req: any): Promise<import("./dto/responses/auth-response.dto").AuthResponseDto>;
65
+ viewAll(req: any): Promise<import("./dto/responses/auth-response.dto").AuthResponseDto[]>;
66
+ deleteAccount(req: any, res: Response): Promise<{
67
+ message: string;
68
+ }>;
69
+ deleteAuthMethod(req: any, authId: string): Promise<void>;
70
+ }