@anarchitects/auth-nest 0.0.1 → 0.4.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.
- package/README.md +181 -16
- package/package.json +7 -4
- package/src/application/application.module.d.ts +6 -9
- package/src/application/application.module.js +17 -21
- package/src/application/application.module.js.map +1 -1
- package/src/auth.module.d.ts +14 -0
- package/src/auth.module.js +44 -0
- package/src/auth.module.js.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/infrastructure-mailer/adapters/node-mailer.adapter.d.ts +1 -8
- package/src/infrastructure-mailer/adapters/node-mailer.adapter.js +2 -19
- package/src/infrastructure-mailer/adapters/node-mailer.adapter.js.map +1 -1
- package/src/infrastructure-mailer/index.d.ts +0 -1
- package/src/infrastructure-mailer/index.js +0 -1
- package/src/infrastructure-mailer/index.js.map +1 -1
- package/src/infrastructure-mailer/mailer.module.d.ts +1 -1
- package/src/infrastructure-mailer/mailer.module.js +9 -15
- package/src/infrastructure-mailer/mailer.module.js.map +1 -1
- package/src/infrastructure-persistence/index.d.ts +1 -0
- package/src/infrastructure-persistence/index.js +1 -0
- package/src/infrastructure-persistence/index.js.map +1 -1
- package/src/infrastructure-persistence/migrations/{1720200000000-create-invalidated-tokens-cache.table.d.ts → 1720200000000-create-auth-schema.d.ts} +1 -1
- package/src/infrastructure-persistence/migrations/1720200000000-create-auth-schema.js +312 -0
- package/src/infrastructure-persistence/migrations/1720200000000-create-auth-schema.js.map +1 -0
- package/src/infrastructure-persistence/persistence.module.d.ts +1 -3
- package/src/infrastructure-persistence/persistence.module.js +12 -18
- package/src/infrastructure-persistence/persistence.module.js.map +1 -1
- package/src/presentation/controllers/auth.controller.d.ts +9 -27
- package/src/presentation/controllers/auth.controller.js +18 -30
- package/src/presentation/controllers/auth.controller.js.map +1 -1
- package/src/presentation/presentation.module.d.ts +1 -1
- package/src/presentation/presentation.module.js +5 -5
- package/src/presentation/presentation.module.js.map +1 -1
- package/src/infrastructure-mailer/adapters/mailer.adapter.d.ts +0 -4
- package/src/infrastructure-mailer/adapters/mailer.adapter.js +0 -7
- package/src/infrastructure-mailer/adapters/mailer.adapter.js.map +0 -1
- package/src/infrastructure-persistence/migrations/1720200000000-create-invalidated-tokens-cache.table.js +0 -29
- package/src/infrastructure-persistence/migrations/1720200000000-create-invalidated-tokens-cache.table.js.map +0 -1
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateAuthSchema1720200000000 = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
const schema_1 = require("../schema");
|
|
6
|
+
const USERS_TABLE = `${schema_1.AUTH_SCHEMA}.users`;
|
|
7
|
+
const ROLES_TABLE = `${schema_1.AUTH_SCHEMA}.roles`;
|
|
8
|
+
const PERMISSIONS_TABLE = `${schema_1.AUTH_SCHEMA}.permissions`;
|
|
9
|
+
const USER_ROLES_TABLE = `${schema_1.AUTH_SCHEMA}.user_roles`;
|
|
10
|
+
const ROLE_PERMISSIONS_TABLE = `${schema_1.AUTH_SCHEMA}.role_permissions`;
|
|
11
|
+
const INVALIDATED_TOKENS_TABLE = `${schema_1.AUTH_SCHEMA}.invalidated_tokens`;
|
|
12
|
+
class CreateAuthSchema1720200000000 {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.name = 'CreateAuthSchema1720200000000';
|
|
15
|
+
}
|
|
16
|
+
async up(queryRunner) {
|
|
17
|
+
await queryRunner.createSchema(schema_1.AUTH_SCHEMA, true);
|
|
18
|
+
if (!(await queryRunner.hasTable(USERS_TABLE))) {
|
|
19
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
20
|
+
schema: schema_1.AUTH_SCHEMA,
|
|
21
|
+
name: 'users',
|
|
22
|
+
columns: [
|
|
23
|
+
{
|
|
24
|
+
name: 'id',
|
|
25
|
+
type: 'uuid',
|
|
26
|
+
isPrimary: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'email',
|
|
30
|
+
type: 'varchar',
|
|
31
|
+
length: '255',
|
|
32
|
+
isNullable: false,
|
|
33
|
+
isUnique: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'userName',
|
|
37
|
+
type: 'varchar',
|
|
38
|
+
length: '100',
|
|
39
|
+
isNullable: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'passwordHash',
|
|
43
|
+
type: 'varchar',
|
|
44
|
+
length: '255',
|
|
45
|
+
isNullable: false,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'token',
|
|
49
|
+
type: 'varchar',
|
|
50
|
+
length: '500',
|
|
51
|
+
isNullable: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'isActive',
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
default: false,
|
|
57
|
+
isNullable: false,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'createdAt',
|
|
61
|
+
type: 'timestamptz',
|
|
62
|
+
default: 'CURRENT_TIMESTAMP',
|
|
63
|
+
isNullable: false,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'updatedAt',
|
|
67
|
+
type: 'timestamptz',
|
|
68
|
+
default: 'CURRENT_TIMESTAMP',
|
|
69
|
+
isNullable: false,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
}), true);
|
|
73
|
+
}
|
|
74
|
+
if (!(await queryRunner.hasTable(ROLES_TABLE))) {
|
|
75
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
76
|
+
schema: schema_1.AUTH_SCHEMA,
|
|
77
|
+
name: 'roles',
|
|
78
|
+
columns: [
|
|
79
|
+
{
|
|
80
|
+
name: 'id',
|
|
81
|
+
type: 'uuid',
|
|
82
|
+
isPrimary: true,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'name',
|
|
86
|
+
type: 'varchar',
|
|
87
|
+
length: '100',
|
|
88
|
+
isNullable: false,
|
|
89
|
+
isUnique: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'description',
|
|
93
|
+
type: 'text',
|
|
94
|
+
isNullable: true,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'createdAt',
|
|
98
|
+
type: 'timestamptz',
|
|
99
|
+
default: 'CURRENT_TIMESTAMP',
|
|
100
|
+
isNullable: false,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'updatedAt',
|
|
104
|
+
type: 'timestamptz',
|
|
105
|
+
default: 'CURRENT_TIMESTAMP',
|
|
106
|
+
isNullable: false,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
}), true);
|
|
110
|
+
}
|
|
111
|
+
if (!(await queryRunner.hasTable(PERMISSIONS_TABLE))) {
|
|
112
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
113
|
+
schema: schema_1.AUTH_SCHEMA,
|
|
114
|
+
name: 'permissions',
|
|
115
|
+
columns: [
|
|
116
|
+
{
|
|
117
|
+
name: 'id',
|
|
118
|
+
type: 'uuid',
|
|
119
|
+
isPrimary: true,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'name',
|
|
123
|
+
type: 'varchar',
|
|
124
|
+
length: '100',
|
|
125
|
+
isNullable: false,
|
|
126
|
+
isUnique: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'description',
|
|
130
|
+
type: 'text',
|
|
131
|
+
isNullable: true,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'action',
|
|
135
|
+
type: 'varchar',
|
|
136
|
+
length: '100',
|
|
137
|
+
isNullable: false,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'subject',
|
|
141
|
+
type: 'varchar',
|
|
142
|
+
length: '100',
|
|
143
|
+
isNullable: false,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'conditions',
|
|
147
|
+
type: 'jsonb',
|
|
148
|
+
isNullable: true,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'fields',
|
|
152
|
+
type: 'jsonb',
|
|
153
|
+
isNullable: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'inverted',
|
|
157
|
+
type: 'boolean',
|
|
158
|
+
default: false,
|
|
159
|
+
isNullable: false,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'reason',
|
|
163
|
+
type: 'text',
|
|
164
|
+
isNullable: true,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'createdAt',
|
|
168
|
+
type: 'timestamptz',
|
|
169
|
+
default: 'CURRENT_TIMESTAMP',
|
|
170
|
+
isNullable: false,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: 'updatedAt',
|
|
174
|
+
type: 'timestamptz',
|
|
175
|
+
default: 'CURRENT_TIMESTAMP',
|
|
176
|
+
isNullable: false,
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
}), true);
|
|
180
|
+
}
|
|
181
|
+
if (!(await queryRunner.hasTable(USER_ROLES_TABLE))) {
|
|
182
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
183
|
+
schema: schema_1.AUTH_SCHEMA,
|
|
184
|
+
name: 'user_roles',
|
|
185
|
+
columns: [
|
|
186
|
+
{
|
|
187
|
+
name: 'user_id',
|
|
188
|
+
type: 'uuid',
|
|
189
|
+
isPrimary: true,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'role_id',
|
|
193
|
+
type: 'uuid',
|
|
194
|
+
isPrimary: true,
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
foreignKeys: [
|
|
198
|
+
{
|
|
199
|
+
name: 'fk_auth_user_roles_user_id',
|
|
200
|
+
columnNames: ['user_id'],
|
|
201
|
+
referencedTableName: USERS_TABLE,
|
|
202
|
+
referencedColumnNames: ['id'],
|
|
203
|
+
onDelete: 'CASCADE',
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'fk_auth_user_roles_role_id',
|
|
207
|
+
columnNames: ['role_id'],
|
|
208
|
+
referencedTableName: ROLES_TABLE,
|
|
209
|
+
referencedColumnNames: ['id'],
|
|
210
|
+
onDelete: 'CASCADE',
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
}), true);
|
|
214
|
+
}
|
|
215
|
+
if (!(await queryRunner.hasTable(ROLE_PERMISSIONS_TABLE))) {
|
|
216
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
217
|
+
schema: schema_1.AUTH_SCHEMA,
|
|
218
|
+
name: 'role_permissions',
|
|
219
|
+
columns: [
|
|
220
|
+
{
|
|
221
|
+
name: 'role_id',
|
|
222
|
+
type: 'uuid',
|
|
223
|
+
isPrimary: true,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'permission_id',
|
|
227
|
+
type: 'uuid',
|
|
228
|
+
isPrimary: true,
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
foreignKeys: [
|
|
232
|
+
{
|
|
233
|
+
name: 'fk_auth_role_permissions_role_id',
|
|
234
|
+
columnNames: ['role_id'],
|
|
235
|
+
referencedTableName: ROLES_TABLE,
|
|
236
|
+
referencedColumnNames: ['id'],
|
|
237
|
+
onDelete: 'CASCADE',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'fk_auth_role_permissions_permission_id',
|
|
241
|
+
columnNames: ['permission_id'],
|
|
242
|
+
referencedTableName: PERMISSIONS_TABLE,
|
|
243
|
+
referencedColumnNames: ['id'],
|
|
244
|
+
onDelete: 'CASCADE',
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
}), true);
|
|
248
|
+
}
|
|
249
|
+
if (!(await queryRunner.hasTable(INVALIDATED_TOKENS_TABLE))) {
|
|
250
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
|
251
|
+
schema: schema_1.AUTH_SCHEMA,
|
|
252
|
+
name: 'invalidated_tokens',
|
|
253
|
+
columns: [
|
|
254
|
+
{
|
|
255
|
+
name: 'tokenId',
|
|
256
|
+
type: 'varchar',
|
|
257
|
+
length: '128',
|
|
258
|
+
isPrimary: true,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: 'userId',
|
|
262
|
+
type: 'uuid',
|
|
263
|
+
isNullable: true,
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: 'expires_at',
|
|
267
|
+
type: 'timestamptz',
|
|
268
|
+
isNullable: false,
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
name: 'invalidated_at',
|
|
272
|
+
type: 'timestamptz',
|
|
273
|
+
default: 'CURRENT_TIMESTAMP',
|
|
274
|
+
isNullable: false,
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
}), true);
|
|
278
|
+
}
|
|
279
|
+
const invalidatedTokensIndexName = 'invalidated_tokens_expires_at_idx';
|
|
280
|
+
const invalidatedTokensTable = await queryRunner.getTable(INVALIDATED_TOKENS_TABLE);
|
|
281
|
+
const hasInvalidatedTokensIndex = invalidatedTokensTable?.indices.some((index) => index.name === invalidatedTokensIndexName);
|
|
282
|
+
if (!hasInvalidatedTokensIndex) {
|
|
283
|
+
await queryRunner.createIndex(INVALIDATED_TOKENS_TABLE, new typeorm_1.TableIndex({
|
|
284
|
+
name: invalidatedTokensIndexName,
|
|
285
|
+
columnNames: ['expires_at'],
|
|
286
|
+
isUnique: false,
|
|
287
|
+
}));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async down(queryRunner) {
|
|
291
|
+
if (await queryRunner.hasTable(ROLE_PERMISSIONS_TABLE)) {
|
|
292
|
+
await queryRunner.dropTable(ROLE_PERMISSIONS_TABLE, true, true, true);
|
|
293
|
+
}
|
|
294
|
+
if (await queryRunner.hasTable(USER_ROLES_TABLE)) {
|
|
295
|
+
await queryRunner.dropTable(USER_ROLES_TABLE, true, true, true);
|
|
296
|
+
}
|
|
297
|
+
if (await queryRunner.hasTable(INVALIDATED_TOKENS_TABLE)) {
|
|
298
|
+
await queryRunner.dropTable(INVALIDATED_TOKENS_TABLE, true, true, true);
|
|
299
|
+
}
|
|
300
|
+
if (await queryRunner.hasTable(PERMISSIONS_TABLE)) {
|
|
301
|
+
await queryRunner.dropTable(PERMISSIONS_TABLE, true, true, true);
|
|
302
|
+
}
|
|
303
|
+
if (await queryRunner.hasTable(ROLES_TABLE)) {
|
|
304
|
+
await queryRunner.dropTable(ROLES_TABLE, true, true, true);
|
|
305
|
+
}
|
|
306
|
+
if (await queryRunner.hasTable(USERS_TABLE)) {
|
|
307
|
+
await queryRunner.dropTable(USERS_TABLE, true, true, true);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
exports.CreateAuthSchema1720200000000 = CreateAuthSchema1720200000000;
|
|
312
|
+
//# sourceMappingURL=1720200000000-create-auth-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1720200000000-create-auth-schema.js","sourceRoot":"","sources":["../../../../../../../libs/auth/nest/src/infrastructure-persistence/migrations/1720200000000-create-auth-schema.ts"],"names":[],"mappings":";;;AAAA,qCAA6E;AAC7E,sCAAwC;AAExC,MAAM,WAAW,GAAG,GAAG,oBAAW,QAAQ,CAAC;AAC3C,MAAM,WAAW,GAAG,GAAG,oBAAW,QAAQ,CAAC;AAC3C,MAAM,iBAAiB,GAAG,GAAG,oBAAW,cAAc,CAAC;AACvD,MAAM,gBAAgB,GAAG,GAAG,oBAAW,aAAa,CAAC;AACrD,MAAM,sBAAsB,GAAG,GAAG,oBAAW,mBAAmB,CAAC;AACjE,MAAM,wBAAwB,GAAG,GAAG,oBAAW,qBAAqB,CAAC;AAErE,MAAa,6BAA6B;IAA1C;QACE,SAAI,GAAG,+BAA+B,CAAC;IA+UzC,CAAC;IA7UQ,KAAK,CAAC,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Module } from '@nestjs/common';
|
|
2
2
|
import { ConfigurableModuleClass, OPTIONS_TYPE } from './persistence.module-definition';
|
|
3
|
-
export declare class
|
|
4
|
-
private options;
|
|
5
|
-
constructor(options: string | symbol);
|
|
3
|
+
export declare class AuthPersistenceModule extends ConfigurableModuleClass {
|
|
6
4
|
static forRoot(options: typeof OPTIONS_TYPE): DynamicModule;
|
|
7
5
|
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AuthPersistenceModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
|
-
const auth_user_repository_1 = require("./repositories/auth-user.repository");
|
|
7
|
-
const typeorm_auth_user_repository_1 = require("./repositories/typeorm-auth-user.repository");
|
|
8
|
-
const persistence_module_definition_1 = require("./persistence.module-definition");
|
|
9
6
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
10
|
-
const user_entity_1 = require("./entities/user.entity");
|
|
11
|
-
const role_entity_1 = require("./entities/role.entity");
|
|
12
|
-
const permission_entity_1 = require("./entities/permission.entity");
|
|
13
7
|
const invalidated_token_entity_1 = require("./entities/invalidated-token.entity");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const permission_entity_1 = require("./entities/permission.entity");
|
|
9
|
+
const role_entity_1 = require("./entities/role.entity");
|
|
10
|
+
const user_entity_1 = require("./entities/user.entity");
|
|
11
|
+
const persistence_module_definition_1 = require("./persistence.module-definition");
|
|
12
|
+
const auth_user_repository_1 = require("./repositories/auth-user.repository");
|
|
13
|
+
const typeorm_auth_user_repository_1 = require("./repositories/typeorm-auth-user.repository");
|
|
14
|
+
let AuthPersistenceModule = class AuthPersistenceModule extends persistence_module_definition_1.ConfigurableModuleClass {
|
|
19
15
|
static forRoot(options) {
|
|
20
16
|
switch (options.persistence) {
|
|
21
17
|
case 'typeorm':
|
|
@@ -43,10 +39,8 @@ let PersistenceModule = class PersistenceModule extends persistence_module_defin
|
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
41
|
};
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
(0, common_1.Module)({})
|
|
49
|
-
|
|
50
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
51
|
-
], PersistenceModule);
|
|
42
|
+
exports.AuthPersistenceModule = AuthPersistenceModule;
|
|
43
|
+
exports.AuthPersistenceModule = AuthPersistenceModule = tslib_1.__decorate([
|
|
44
|
+
(0, common_1.Module)({})
|
|
45
|
+
], AuthPersistenceModule);
|
|
52
46
|
//# sourceMappingURL=persistence.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.module.js","sourceRoot":"","sources":["../../../../../../libs/auth/nest/src/infrastructure-persistence/persistence.module.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"persistence.module.js","sourceRoot":"","sources":["../../../../../../libs/auth/nest/src/infrastructure-persistence/persistence.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAuD;AACvD,6CAAgD;AAChD,kFAA6E;AAC7E,oEAAgE;AAChE,wDAAoD;AACpD,wDAAoD;AACpD,mFAGyC;AACzC,8EAAyE;AACzE,8FAAwF;AAGjF,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,uDAAuB;IAChE,MAAM,CAAC,OAAO,CAAC,OAA4B;QACzC,QAAQ,OAAO,CAAC,WAAW,EAAE,CAAC;YAC5B,KAAK,SAAS;gBACZ,OAAO;oBACL,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;oBACzB,OAAO,EAAE;wBACP,uBAAa,CAAC,UAAU,CAAC;4BACvB,wBAAU;4BACV,wBAAU;4BACV,oCAAgB;4BAChB,iDAAsB;yBACvB,CAAC;qBACH;oBACD,SAAS,EAAE;wBACT,wDAAyB;wBACzB;4BACE,OAAO,EAAE,yCAAkB;4BAC3B,WAAW,EAAE,wDAAyB;yBACvC;qBACF;oBACD,OAAO,EAAE,CAAC,yCAAkB,EAAE,uBAAa,CAAC;iBAC7C,CAAC;YACJ;gBACE,MAAM,IAAI,KAAK,CAAC,iCAAiC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;CACF,CAAA;AA3BY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,qBAAqB,CA2BjC"}
|
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
import { ActivateUserRequestDTO, ChangePasswordRequestDTO, ForgotPasswordRequestDTO, LoginRequestDTO, LoginResponseDTO, LogoutRequestDTO, RefreshTokenRequestDTO, RegisterRequestDTO, RegisterResponseDTO, ResetPasswordRequestDTO, UpdateEmailRequestDTO, VerifyEmailRequestDTO } from '@anarchitects/auth-ts/dtos';
|
|
2
|
-
import { PolicyRule, User } from '@anarchitects/auth-ts/models';
|
|
1
|
+
import { ActivateUserRequestDTO, ChangePasswordRequestDTO, ForgotPasswordRequestDTO, LoginRequestDTO, LoginResponseDTO, LoggedInUserInfoResponseDTO, LogoutRequestDTO, RefreshTokenRequestDTO, RegisterRequestDTO, RegisterResponseDTO, ResetPasswordRequestDTO, SuccessResponseDTO, UpdateEmailRequestDTO, VerifyEmailRequestDTO } from '@anarchitects/auth-ts/dtos';
|
|
3
2
|
import { AuthService } from '../../application/services/auth.service';
|
|
4
3
|
export declare class AuthController {
|
|
5
4
|
private readonly authService;
|
|
6
5
|
constructor(authService: AuthService);
|
|
7
6
|
registerUser(dto: RegisterRequestDTO): Promise<RegisterResponseDTO>;
|
|
8
|
-
activateUser(dto: ActivateUserRequestDTO): Promise<
|
|
9
|
-
success: boolean;
|
|
10
|
-
}>;
|
|
7
|
+
activateUser(dto: ActivateUserRequestDTO): Promise<SuccessResponseDTO>;
|
|
11
8
|
login(dto: LoginRequestDTO): Promise<LoginResponseDTO>;
|
|
12
|
-
logout(dto: LogoutRequestDTO): Promise<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
forgotPassword(dto: ForgotPasswordRequestDTO): Promise<{
|
|
19
|
-
success: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
resetPassword(dto: ResetPasswordRequestDTO): Promise<{
|
|
22
|
-
success: boolean;
|
|
23
|
-
}>;
|
|
24
|
-
verifyEmail(dto: VerifyEmailRequestDTO): Promise<{
|
|
25
|
-
success: boolean;
|
|
26
|
-
}>;
|
|
27
|
-
updateEmail(userId: string, dto: UpdateEmailRequestDTO): Promise<{
|
|
28
|
-
success: boolean;
|
|
29
|
-
}>;
|
|
9
|
+
logout(dto: LogoutRequestDTO): Promise<SuccessResponseDTO>;
|
|
10
|
+
changePassword(userId: string, dto: ChangePasswordRequestDTO): Promise<SuccessResponseDTO>;
|
|
11
|
+
forgotPassword(dto: ForgotPasswordRequestDTO): Promise<SuccessResponseDTO>;
|
|
12
|
+
resetPassword(dto: ResetPasswordRequestDTO): Promise<SuccessResponseDTO>;
|
|
13
|
+
verifyEmail(dto: VerifyEmailRequestDTO): Promise<SuccessResponseDTO>;
|
|
14
|
+
updateEmail(userId: string, dto: UpdateEmailRequestDTO): Promise<SuccessResponseDTO>;
|
|
30
15
|
refreshTokens(userId: string, dto: RefreshTokenRequestDTO): Promise<LoginResponseDTO>;
|
|
31
16
|
getLoggedInUserInfo(req: {
|
|
32
17
|
user: {
|
|
33
18
|
sub: string;
|
|
34
19
|
};
|
|
35
|
-
}): Promise<
|
|
36
|
-
user: User;
|
|
37
|
-
rbac: PolicyRule[];
|
|
38
|
-
}>;
|
|
20
|
+
}): Promise<LoggedInUserInfoResponseDTO>;
|
|
39
21
|
}
|
|
@@ -47,6 +47,7 @@ let AuthController = class AuthController {
|
|
|
47
47
|
};
|
|
48
48
|
exports.AuthController = AuthController;
|
|
49
49
|
tslib_1.__decorate([
|
|
50
|
+
(0, common_1.HttpCode)(200),
|
|
50
51
|
(0, common_1.Post)('/register'),
|
|
51
52
|
(0, platform_fastify_1.RouteSchema)({
|
|
52
53
|
body: dtos_1.RegisterRequestSchema,
|
|
@@ -61,9 +62,7 @@ tslib_1.__decorate([
|
|
|
61
62
|
(0, common_1.Patch)('/activate'),
|
|
62
63
|
(0, platform_fastify_1.RouteSchema)({
|
|
63
64
|
body: dtos_1.ActivateUserRequestSchema,
|
|
64
|
-
response: {
|
|
65
|
-
200: { success: { type: 'boolean' } },
|
|
66
|
-
},
|
|
65
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
67
66
|
}),
|
|
68
67
|
tslib_1.__param(0, (0, common_1.Body)()),
|
|
69
68
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -71,6 +70,7 @@ tslib_1.__decorate([
|
|
|
71
70
|
tslib_1.__metadata("design:returntype", Promise)
|
|
72
71
|
], AuthController.prototype, "activateUser", null);
|
|
73
72
|
tslib_1.__decorate([
|
|
73
|
+
(0, common_1.HttpCode)(200),
|
|
74
74
|
(0, common_1.Post)('/login'),
|
|
75
75
|
(0, platform_fastify_1.RouteSchema)({
|
|
76
76
|
body: dtos_1.LoginRequestSchema,
|
|
@@ -82,10 +82,11 @@ tslib_1.__decorate([
|
|
|
82
82
|
tslib_1.__metadata("design:returntype", Promise)
|
|
83
83
|
], AuthController.prototype, "login", null);
|
|
84
84
|
tslib_1.__decorate([
|
|
85
|
+
(0, common_1.HttpCode)(200),
|
|
85
86
|
(0, common_1.Post)('/logout'),
|
|
86
87
|
(0, platform_fastify_1.RouteSchema)({
|
|
87
88
|
body: dtos_1.LogoutRequestSchema,
|
|
88
|
-
response: { 200:
|
|
89
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
89
90
|
}),
|
|
90
91
|
tslib_1.__param(0, (0, common_1.Body)()),
|
|
91
92
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -96,10 +97,8 @@ tslib_1.__decorate([
|
|
|
96
97
|
(0, common_1.Patch)('/change-password/:userId'),
|
|
97
98
|
(0, platform_fastify_1.RouteSchema)({
|
|
98
99
|
body: dtos_1.ChangePasswordRequestSchema,
|
|
99
|
-
params:
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
response: { 200: { success: { type: 'boolean' } } },
|
|
100
|
+
params: dtos_1.UserIdParamsSchema,
|
|
101
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
103
102
|
}),
|
|
104
103
|
tslib_1.__param(0, (0, common_1.Param)('userId')),
|
|
105
104
|
tslib_1.__param(1, (0, common_1.Body)()),
|
|
@@ -108,10 +107,11 @@ tslib_1.__decorate([
|
|
|
108
107
|
tslib_1.__metadata("design:returntype", Promise)
|
|
109
108
|
], AuthController.prototype, "changePassword", null);
|
|
110
109
|
tslib_1.__decorate([
|
|
110
|
+
(0, common_1.HttpCode)(200),
|
|
111
111
|
(0, common_1.Post)('/forgot-password'),
|
|
112
112
|
(0, platform_fastify_1.RouteSchema)({
|
|
113
113
|
body: dtos_1.ForgotPasswordRequestSchema,
|
|
114
|
-
response: { 200:
|
|
114
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
115
115
|
}),
|
|
116
116
|
tslib_1.__param(0, (0, common_1.Body)()),
|
|
117
117
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -119,10 +119,11 @@ tslib_1.__decorate([
|
|
|
119
119
|
tslib_1.__metadata("design:returntype", Promise)
|
|
120
120
|
], AuthController.prototype, "forgotPassword", null);
|
|
121
121
|
tslib_1.__decorate([
|
|
122
|
+
(0, common_1.HttpCode)(200),
|
|
122
123
|
(0, common_1.Post)('/reset-password'),
|
|
123
124
|
(0, platform_fastify_1.RouteSchema)({
|
|
124
125
|
body: dtos_1.ResetPasswordRequestSchema,
|
|
125
|
-
response: { 200:
|
|
126
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
126
127
|
}),
|
|
127
128
|
tslib_1.__param(0, (0, common_1.Body)()),
|
|
128
129
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -130,10 +131,11 @@ tslib_1.__decorate([
|
|
|
130
131
|
tslib_1.__metadata("design:returntype", Promise)
|
|
131
132
|
], AuthController.prototype, "resetPassword", null);
|
|
132
133
|
tslib_1.__decorate([
|
|
134
|
+
(0, common_1.HttpCode)(200),
|
|
133
135
|
(0, common_1.Post)('/verify-email'),
|
|
134
136
|
(0, platform_fastify_1.RouteSchema)({
|
|
135
137
|
body: dtos_1.VerifyEmailRequestSchema,
|
|
136
|
-
response: { 200:
|
|
138
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
137
139
|
}),
|
|
138
140
|
tslib_1.__param(0, (0, common_1.Body)()),
|
|
139
141
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -144,10 +146,8 @@ tslib_1.__decorate([
|
|
|
144
146
|
(0, common_1.Patch)('/update-email/:userId'),
|
|
145
147
|
(0, platform_fastify_1.RouteSchema)({
|
|
146
148
|
body: dtos_1.UpdateEmailRequestSchema,
|
|
147
|
-
params:
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
response: { 200: { success: { type: 'boolean' } } },
|
|
149
|
+
params: dtos_1.UserIdParamsSchema,
|
|
150
|
+
response: { 200: dtos_1.SuccessResponseSchema },
|
|
151
151
|
}),
|
|
152
152
|
tslib_1.__param(0, (0, common_1.Param)('userId')),
|
|
153
153
|
tslib_1.__param(1, (0, common_1.Body)()),
|
|
@@ -156,12 +156,11 @@ tslib_1.__decorate([
|
|
|
156
156
|
tslib_1.__metadata("design:returntype", Promise)
|
|
157
157
|
], AuthController.prototype, "updateEmail", null);
|
|
158
158
|
tslib_1.__decorate([
|
|
159
|
+
(0, common_1.HttpCode)(200),
|
|
159
160
|
(0, common_1.Post)('/refresh-tokens/:userId'),
|
|
160
161
|
(0, platform_fastify_1.RouteSchema)({
|
|
161
162
|
body: dtos_1.RefreshTokenRequestSchema,
|
|
162
|
-
params:
|
|
163
|
-
userId: { type: 'string' },
|
|
164
|
-
},
|
|
163
|
+
params: dtos_1.UserIdParamsSchema,
|
|
165
164
|
response: { 200: dtos_1.LoginResponseSchema },
|
|
166
165
|
}),
|
|
167
166
|
tslib_1.__param(0, (0, common_1.Param)('userId')),
|
|
@@ -173,18 +172,7 @@ tslib_1.__decorate([
|
|
|
173
172
|
tslib_1.__decorate([
|
|
174
173
|
(0, common_1.Get)('/me'),
|
|
175
174
|
(0, platform_fastify_1.RouteSchema)({
|
|
176
|
-
response: {
|
|
177
|
-
200: {
|
|
178
|
-
type: 'object',
|
|
179
|
-
properties: {
|
|
180
|
-
user: { type: 'object' }, // Define user schema as needed
|
|
181
|
-
rbac: {
|
|
182
|
-
type: 'array',
|
|
183
|
-
items: { type: 'object' }, // Define PolicyRule schema as needed
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
175
|
+
response: { 200: dtos_1.LoggedInUserInfoResponseSchema },
|
|
188
176
|
}),
|
|
189
177
|
tslib_1.__param(0, (0, common_1.Req)()),
|
|
190
178
|
tslib_1.__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../../../../../libs/auth/nest/src/presentation/controllers/auth.controller.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../../../../../libs/auth/nest/src/presentation/controllers/auth.controller.ts"],"names":[],"mappings":";;;;AAAA,qDA8BoC;AACpC,2CASwB;AACxB,+DAAuD;AACvD,0EAAsE;AAG/D,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAQnD,AAAN,KAAK,CAAC,YAAY,CACR,GAAuB;QAE/B,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAOK,AAAN,KAAK,CAAC,YAAY,CACR,GAA2B;QAEnC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;QAC/B,MAAM,EAAE,yBAAkB;QAC1B,QAAQ,EAAE,EAAE,GAAG,EAAE,0BAAmB,EAAE;KACvC,CAAC;IAEC,mBAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;IACf,mBAAA,IAAA,aAAI,GAAE,CAAA;;;;mDAGR;AAMK;IAJL,IAAA,YAAG,EAAC,KAAK,CAAC;IACV,IAAA,8BAAW,EAAC;QACX,QAAQ,EAAE,EAAE,GAAG,EAAE,qCAA8B,EAAE;KAClD,CAAC;IAEC,mBAAA,IAAA,YAAG,GAAE,CAAA;;;;yDAIP;yBAnIU,cAAc;IAD1B,IAAA,mBAAU,EAAC,MAAM,CAAC;6CAEyB,0BAAW;GAD1C,cAAc,CAoI1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class AuthPresentationModule {
|
|
2
2
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AuthPresentationModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
const auth_controller_1 = require("./controllers/auth.controller");
|
|
7
|
-
let
|
|
7
|
+
let AuthPresentationModule = class AuthPresentationModule {
|
|
8
8
|
};
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
9
|
+
exports.AuthPresentationModule = AuthPresentationModule;
|
|
10
|
+
exports.AuthPresentationModule = AuthPresentationModule = tslib_1.__decorate([
|
|
11
11
|
(0, common_1.Module)({
|
|
12
12
|
controllers: [auth_controller_1.AuthController],
|
|
13
13
|
})
|
|
14
|
-
],
|
|
14
|
+
], AuthPresentationModule);
|
|
15
15
|
//# sourceMappingURL=presentation.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation.module.js","sourceRoot":"","sources":["../../../../../../libs/auth/nest/src/presentation/presentation.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,mEAA+D;AAKxD,IAAM,
|
|
1
|
+
{"version":3,"file":"presentation.module.js","sourceRoot":"","sources":["../../../../../../libs/auth/nest/src/presentation/presentation.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,mEAA+D;AAKxD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAG,CAAA;AAAzB,wDAAsB;iCAAtB,sBAAsB;IAHlC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,gCAAc,CAAC;KAC9B,CAAC;GACW,sBAAsB,CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mailer.adapter.js","sourceRoot":"","sources":["../../../../../../../libs/auth/nest/src/infrastructure-mailer/adapters/mailer.adapter.ts"],"names":[],"mappings":";;;AAAA,MAAsB,aAAa;CAQlC;AARD,sCAQC"}
|