@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.
- package/README.md +760 -0
- package/bin/cli.js +152 -0
- package/dist/auth/auth-type.enum.d.ts +22 -0
- package/dist/auth/auth-type.enum.js +32 -0
- package/dist/auth/auth-type.enum.js.map +1 -0
- package/dist/auth/auth.controller.d.ts +70 -0
- package/dist/auth/auth.controller.js +434 -0
- package/dist/auth/auth.controller.js.map +1 -0
- package/dist/auth/auth.module.d.ts +9 -0
- package/dist/auth/auth.module.js +193 -0
- package/dist/auth/auth.module.js.map +1 -0
- package/dist/auth/auth.service.d.ts +180 -0
- package/dist/auth/auth.service.js +695 -0
- package/dist/auth/auth.service.js.map +1 -0
- package/dist/auth/core/auth-mapper.d.ts +6 -0
- package/dist/auth/core/auth-mapper.js +17 -0
- package/dist/auth/core/auth-mapper.js.map +1 -0
- package/dist/auth/core/jwt.strategy.d.ts +13 -0
- package/dist/auth/core/jwt.strategy.js +59 -0
- package/dist/auth/core/jwt.strategy.js.map +1 -0
- package/dist/auth/core/registration.d.ts +3 -0
- package/dist/auth/core/registration.js +60 -0
- package/dist/auth/core/registration.js.map +1 -0
- package/dist/auth/current-user-interface.d.ts +4 -0
- package/dist/auth/current-user-interface.js +4 -0
- package/dist/auth/current-user-interface.js.map +1 -0
- package/dist/auth/current-user.decorator.d.ts +2 -0
- package/dist/auth/current-user.decorator.js +16 -0
- package/dist/auth/current-user.decorator.js.map +1 -0
- package/dist/auth/decorator/current-user.decorator.d.ts +2 -0
- package/dist/auth/decorator/current-user.decorator.js +13 -0
- package/dist/auth/decorator/current-user.decorator.js.map +1 -0
- package/dist/auth/decorator/email-or-phone.decorator.d.ts +2 -0
- package/dist/auth/decorator/email-or-phone.decorator.js +26 -0
- package/dist/auth/decorator/email-or-phone.decorator.js.map +1 -0
- package/dist/auth/decorator/optional.decorator.d.ts +2 -0
- package/dist/auth/decorator/optional.decorator.js +9 -0
- package/dist/auth/decorator/optional.decorator.js.map +1 -0
- package/dist/auth/decorator/public.decorator.d.ts +2 -0
- package/dist/auth/decorator/public.decorator.js +9 -0
- package/dist/auth/decorator/public.decorator.js.map +1 -0
- package/dist/auth/dto/auth-response.dto.d.ts +17 -0
- package/dist/auth/dto/auth-response.dto.js +83 -0
- package/dist/auth/dto/auth-response.dto.js.map +1 -0
- package/dist/auth/dto/identifier-response.dto.d.ts +8 -0
- package/dist/auth/dto/identifier-response.dto.js +46 -0
- package/dist/auth/dto/identifier-response.dto.js.map +1 -0
- package/dist/auth/dto/login.dto.d.ts +11 -0
- package/dist/auth/dto/login.dto.js +68 -0
- package/dist/auth/dto/login.dto.js.map +1 -0
- package/dist/auth/dto/mfa.dto.d.ts +8 -0
- package/dist/auth/dto/mfa.dto.js +51 -0
- package/dist/auth/dto/mfa.dto.js.map +1 -0
- package/dist/auth/dto/oauth-provider-response.dto.d.ts +5 -0
- package/dist/auth/dto/oauth-provider-response.dto.js +30 -0
- package/dist/auth/dto/oauth-provider-response.dto.js.map +1 -0
- package/dist/auth/dto/refresh-token.dto.d.ts +3 -0
- package/dist/auth/dto/refresh-token.dto.js +28 -0
- package/dist/auth/dto/refresh-token.dto.js.map +1 -0
- package/dist/auth/dto/requests/forgot-password.dto.d.ts +5 -0
- package/dist/auth/dto/requests/forgot-password.dto.js +36 -0
- package/dist/auth/dto/requests/forgot-password.dto.js.map +1 -0
- package/dist/auth/dto/requests/login.dto.d.ts +11 -0
- package/dist/auth/dto/requests/login.dto.js +68 -0
- package/dist/auth/dto/requests/login.dto.js.map +1 -0
- package/dist/auth/dto/requests/magic-link.dto.d.ts +6 -0
- package/dist/auth/dto/requests/magic-link.dto.js +33 -0
- package/dist/auth/dto/requests/magic-link.dto.js.map +1 -0
- package/dist/auth/dto/requests/mfa.dto.d.ts +8 -0
- package/dist/auth/dto/requests/mfa.dto.js +51 -0
- package/dist/auth/dto/requests/mfa.dto.js.map +1 -0
- package/dist/auth/dto/requests/refresh-token.dto.d.ts +3 -0
- package/dist/auth/dto/requests/refresh-token.dto.js +29 -0
- package/dist/auth/dto/requests/refresh-token.dto.js.map +1 -0
- package/dist/auth/dto/requests/reset-password.dto.d.ts +5 -0
- package/dist/auth/dto/requests/reset-password.dto.js +36 -0
- package/dist/auth/dto/requests/reset-password.dto.js.map +1 -0
- package/dist/auth/dto/requests/secure-account.dto.d.ts +3 -0
- package/dist/auth/dto/requests/secure-account.dto.js +24 -0
- package/dist/auth/dto/requests/secure-account.dto.js.map +1 -0
- package/dist/auth/dto/requests/signup.dto.d.ts +13 -0
- package/dist/auth/dto/requests/signup.dto.js +70 -0
- package/dist/auth/dto/requests/signup.dto.js.map +1 -0
- package/dist/auth/dto/requests/update-password.dto.d.ts +4 -0
- package/dist/auth/dto/requests/update-password.dto.js +30 -0
- package/dist/auth/dto/requests/update-password.dto.js.map +1 -0
- package/dist/auth/dto/requests/verify.dto.d.ts +7 -0
- package/dist/auth/dto/requests/verify.dto.js +48 -0
- package/dist/auth/dto/requests/verify.dto.js.map +1 -0
- package/dist/auth/dto/responses/auth-response.dto.d.ts +17 -0
- package/dist/auth/dto/responses/auth-response.dto.js +83 -0
- package/dist/auth/dto/responses/auth-response.dto.js.map +1 -0
- package/dist/auth/dto/responses/identifier-response.dto.d.ts +10 -0
- package/dist/auth/dto/responses/identifier-response.dto.js +56 -0
- package/dist/auth/dto/responses/identifier-response.dto.js.map +1 -0
- package/dist/auth/dto/responses/oauth-provider-response.dto.d.ts +10 -0
- package/dist/auth/dto/responses/oauth-provider-response.dto.js +55 -0
- package/dist/auth/dto/responses/oauth-provider-response.dto.js.map +1 -0
- package/dist/auth/dto/signup.dto.d.ts +13 -0
- package/dist/auth/dto/signup.dto.js +70 -0
- package/dist/auth/dto/signup.dto.js.map +1 -0
- package/dist/auth/dto/verify.dto.d.ts +7 -0
- package/dist/auth/dto/verify.dto.js +48 -0
- package/dist/auth/dto/verify.dto.js.map +1 -0
- package/dist/auth/entities/auth-identify.entity.d.ts +33 -0
- package/dist/auth/entities/auth-identify.entity.js +73 -0
- package/dist/auth/entities/auth-identify.entity.js.map +1 -0
- package/dist/auth/entities/auth.entity.d.ts +45 -0
- package/dist/auth/entities/auth.entity.js +129 -0
- package/dist/auth/entities/auth.entity.js.map +1 -0
- package/dist/auth/entities/base.entity.d.ts +6 -0
- package/dist/auth/entities/base.entity.js +41 -0
- package/dist/auth/entities/base.entity.js.map +1 -0
- package/dist/auth/entities/mfa-method.entity.d.ts +23 -0
- package/dist/auth/entities/mfa-method.entity.js +69 -0
- package/dist/auth/entities/mfa-method.entity.js.map +1 -0
- package/dist/auth/entities/oauth-provider.entity.d.ts +38 -0
- package/dist/auth/entities/oauth-provider.entity.js +88 -0
- package/dist/auth/entities/oauth-provider.entity.js.map +1 -0
- package/dist/auth/entities/otp-token.entity.d.ts +22 -0
- package/dist/auth/entities/otp-token.entity.js +61 -0
- package/dist/auth/entities/otp-token.entity.js.map +1 -0
- package/dist/auth/entities/session.entity.d.ts +19 -0
- package/dist/auth/entities/session.entity.js +65 -0
- package/dist/auth/entities/session.entity.js.map +1 -0
- package/dist/auth/enums/auth-type.enum.d.ts +23 -0
- package/dist/auth/enums/auth-type.enum.js +34 -0
- package/dist/auth/enums/auth-type.enum.js.map +1 -0
- package/dist/auth/guards/jwt-auth.guard.d.ts +10 -0
- package/dist/auth/guards/jwt-auth.guard.js +68 -0
- package/dist/auth/guards/jwt-auth.guard.js.map +1 -0
- package/dist/auth/guards/optional-auth.guard.d.ts +8 -0
- package/dist/auth/guards/optional-auth.guard.js +45 -0
- package/dist/auth/guards/optional-auth.guard.js.map +1 -0
- package/dist/auth/guards/ws-jwt-auth.guard.d.ts +0 -0
- package/dist/auth/guards/ws-jwt-auth.guard.js +31 -0
- package/dist/auth/guards/ws-jwt-auth.guard.js.map +1 -0
- package/dist/auth/interfaces/auth-module-async-options.interface.d.ts +7 -0
- package/dist/auth/interfaces/auth-module-async-options.interface.js +3 -0
- package/dist/auth/interfaces/auth-module-async-options.interface.js.map +1 -0
- package/dist/auth/interfaces/auth-module-options.interface.d.ts +132 -0
- package/dist/auth/interfaces/auth-module-options.interface.js +5 -0
- package/dist/auth/interfaces/auth-module-options.interface.js.map +1 -0
- package/dist/auth/interfaces/auth-notification-provider.interface.d.ts +29 -0
- package/dist/auth/interfaces/auth-notification-provider.interface.js +5 -0
- package/dist/auth/interfaces/auth-notification-provider.interface.js.map +1 -0
- package/dist/auth/interfaces/auth-user-service.interface.d.ts +13 -0
- package/dist/auth/interfaces/auth-user-service.interface.js +7 -0
- package/dist/auth/interfaces/auth-user-service.interface.js.map +1 -0
- package/dist/auth/interfaces/current-user-interface.d.ts +4 -0
- package/dist/auth/interfaces/current-user-interface.js +4 -0
- package/dist/auth/interfaces/current-user-interface.js.map +1 -0
- package/dist/auth/interfaces/current-user.decorator.d.ts +2 -0
- package/dist/auth/interfaces/current-user.decorator.js +16 -0
- package/dist/auth/interfaces/current-user.decorator.js.map +1 -0
- package/dist/auth/interfaces/jwt-payload-interface.d.ts +4 -0
- package/dist/auth/interfaces/jwt-payload-interface.js +3 -0
- package/dist/auth/interfaces/jwt-payload-interface.js.map +1 -0
- package/dist/auth/interfaces/oauth-strategy.interface.d.ts +14 -0
- package/dist/auth/interfaces/oauth-strategy.interface.js +3 -0
- package/dist/auth/interfaces/oauth-strategy.interface.js.map +1 -0
- package/dist/auth/jwt-payload-interface.d.ts +4 -0
- package/dist/auth/jwt-payload-interface.js +3 -0
- package/dist/auth/jwt-payload-interface.js.map +1 -0
- package/dist/auth/jwt.strategy.d.ts +13 -0
- package/dist/auth/jwt.strategy.js +60 -0
- package/dist/auth/jwt.strategy.js.map +1 -0
- package/dist/auth/strategies/company.strategy.d.ts +0 -0
- package/dist/auth/strategies/company.strategy.js +1 -0
- package/dist/auth/strategies/company.strategy.js.map +1 -0
- package/dist/auth/strategies/google.strategy.d.ts +7 -0
- package/dist/auth/strategies/google.strategy.js +23 -0
- package/dist/auth/strategies/google.strategy.js.map +1 -0
- package/dist/auth/strategies/local-auth.strategy.d.ts +24 -0
- package/dist/auth/strategies/local-auth.strategy.js +244 -0
- package/dist/auth/strategies/local-auth.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/apple.strategy.d.ts +27 -0
- package/dist/auth/strategies/oauth/apple.strategy.js +176 -0
- package/dist/auth/strategies/oauth/apple.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/facebook.strategy.d.ts +24 -0
- package/dist/auth/strategies/oauth/facebook.strategy.js +150 -0
- package/dist/auth/strategies/oauth/facebook.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/google.strategy.d.ts +25 -0
- package/dist/auth/strategies/oauth/google.strategy.js +225 -0
- package/dist/auth/strategies/oauth/google.strategy.js.map +1 -0
- package/dist/auth/strategies/oauth/oauth-strategy.interface.d.ts +14 -0
- package/dist/auth/strategies/oauth/oauth-strategy.interface.js +3 -0
- package/dist/auth/strategies/oauth/oauth-strategy.interface.js.map +1 -0
- package/dist/auth/strategies/oauth/oauth.strategy.d.ts +25 -0
- package/dist/auth/strategies/oauth/oauth.strategy.js +70 -0
- package/dist/auth/strategies/oauth/oauth.strategy.js.map +1 -0
- package/dist/auth/strategies/otp.strategy.d.ts +7 -0
- package/dist/auth/strategies/otp.strategy.js +23 -0
- package/dist/auth/strategies/otp.strategy.js.map +1 -0
- package/dist/auth/strategies/password.strategy.d.ts +14 -0
- package/dist/auth/strategies/password.strategy.js +130 -0
- package/dist/auth/strategies/password.strategy.js.map +1 -0
- package/dist/auth/utils/duration.util.d.ts +8 -0
- package/dist/auth/utils/duration.util.js +29 -0
- package/dist/auth/utils/duration.util.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/auth-entities.d.ts +7 -0
- package/dist/migrations/auth-entities.js +18 -0
- package/dist/migrations/auth-entities.js.map +1 -0
- package/dist/migrations/auth-schema.initializer.d.ts +9 -0
- package/dist/migrations/auth-schema.initializer.js +36 -0
- package/dist/migrations/auth-schema.initializer.js.map +1 -0
- package/dist/migrations/auth.migration.v1.d.ts +12 -0
- package/dist/migrations/auth.migration.v1.js +157 -0
- package/dist/migrations/auth.migration.v1.js.map +1 -0
- package/dist/migrations/auth.migration.v2.d.ts +8 -0
- package/dist/migrations/auth.migration.v2.js +39 -0
- package/dist/migrations/auth.migration.v2.js.map +1 -0
- package/dist/migrations/auth.migrations.d.ts +2 -0
- package/dist/migrations/auth.migrations.js +8 -0
- package/dist/migrations/auth.migrations.js.map +1 -0
- package/dist/migrations/migration.runner.d.ts +9 -0
- package/dist/migrations/migration.runner.js +67 -0
- package/dist/migrations/migration.runner.js.map +1 -0
- package/dist/migrations/migration.service.d.ts +9 -0
- package/dist/migrations/migration.service.js +71 -0
- package/dist/migrations/migration.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthIdentifier = exports.IdentifierSource = exports.IdentifierType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const auth_entity_1 = require("./auth.entity");
|
|
15
|
+
const base_entity_1 = require("./base.entity");
|
|
16
|
+
var IdentifierType;
|
|
17
|
+
(function (IdentifierType) {
|
|
18
|
+
IdentifierType["EMAIL"] = "EMAIL";
|
|
19
|
+
IdentifierType["PHONE"] = "PHONE";
|
|
20
|
+
IdentifierType["USERNAME"] = "USERNAME";
|
|
21
|
+
})(IdentifierType || (exports.IdentifierType = IdentifierType = {}));
|
|
22
|
+
var IdentifierSource;
|
|
23
|
+
(function (IdentifierSource) {
|
|
24
|
+
IdentifierSource["APPLE"] = "APPLE";
|
|
25
|
+
IdentifierSource["FACEBOOK"] = "FACEBOOK";
|
|
26
|
+
IdentifierSource["GOOGLE"] = "GOOGLE";
|
|
27
|
+
IdentifierSource["LOCAL"] = "LOCAL";
|
|
28
|
+
})(IdentifierSource || (exports.IdentifierSource = IdentifierSource = {}));
|
|
29
|
+
let AuthIdentifier = class AuthIdentifier extends base_entity_1.BaseEntity {
|
|
30
|
+
toMap() {
|
|
31
|
+
return {
|
|
32
|
+
id: this.id,
|
|
33
|
+
type: this.type,
|
|
34
|
+
value: this.value,
|
|
35
|
+
isVerified: this.isVerified,
|
|
36
|
+
// auth: this.auth.toMap(),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.AuthIdentifier = AuthIdentifier;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.ManyToOne)(() => auth_entity_1.Auth, (auth) => auth.identifiers, { onDelete: 'CASCADE' }),
|
|
43
|
+
__metadata("design:type", auth_entity_1.Auth)
|
|
44
|
+
], AuthIdentifier.prototype, "auth", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: IdentifierType }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], AuthIdentifier.prototype, "type", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
51
|
+
(0, typeorm_1.Column)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], AuthIdentifier.prototype, "value", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], AuthIdentifier.prototype, "isVerified", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({
|
|
60
|
+
type: 'enum',
|
|
61
|
+
enum: IdentifierSource,
|
|
62
|
+
default: IdentifierSource.LOCAL,
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], AuthIdentifier.prototype, "source", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], AuthIdentifier.prototype, "verifiedBy", void 0);
|
|
70
|
+
exports.AuthIdentifier = AuthIdentifier = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)('auth_identifiers')
|
|
72
|
+
], AuthIdentifier);
|
|
73
|
+
//# sourceMappingURL=auth-identify.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-identify.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/auth-identify.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAKiB;AACjB,+CAAqC;AACrC,+CAA2C;AAG3C,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AACD,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,mCAA0B,CAAA;IAC1B,yCAAgC,CAAA;IAChC,qCAA4B,CAAA;IAC5B,mCAA0B,CAAA;AAC5B,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,wBAAU;IAiC5C,KAAK;QACH,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,2BAA2B;SAC5B,CAAC;IACJ,CAAC;CACF,CAAA;AA1CY,wCAAc;AAGzB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BACrE,kBAAI;4CAAC;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;4CAC1B;AAMrB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,GAAE;;6CACK;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACP;AAUpB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,gBAAgB,CAAC,KAAK;KAChC,CAAC;;8CACuB;AAMzB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACe;yBA/B/B,cAAc;IAD1B,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,cAAc,CA0C1B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import { AuthIdentifier } from './auth-identify.entity';
|
|
3
|
+
import { OAuthProvider } from './oauth-provider.entity';
|
|
4
|
+
import { AuthStrategy } from '../enums/auth-type.enum';
|
|
5
|
+
export declare class Auth extends BaseEntity {
|
|
6
|
+
uid: string;
|
|
7
|
+
strategy: AuthStrategy;
|
|
8
|
+
identifiers: AuthIdentifier[];
|
|
9
|
+
secretHash?: string;
|
|
10
|
+
isPrimary: boolean;
|
|
11
|
+
isVerified: boolean;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
meta?: Record<string, any>;
|
|
14
|
+
lastUsedAt?: Date;
|
|
15
|
+
oauthProviders?: OAuthProvider[];
|
|
16
|
+
toMap(): {
|
|
17
|
+
id: string;
|
|
18
|
+
strategy: AuthStrategy;
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
isVerified: boolean;
|
|
21
|
+
isPrimary: boolean;
|
|
22
|
+
meta: Record<string, any>;
|
|
23
|
+
lastUsedAt: Date;
|
|
24
|
+
identifiers: {
|
|
25
|
+
id: string;
|
|
26
|
+
type: import("./auth-identify.entity").IdentifierType;
|
|
27
|
+
value: string;
|
|
28
|
+
isVerified: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
oauthProviders: {
|
|
31
|
+
id: string;
|
|
32
|
+
provider: import("../enums/auth-type.enum").OAuthProviderType;
|
|
33
|
+
providerUserId: string;
|
|
34
|
+
accessToken: string;
|
|
35
|
+
refreshToken: string;
|
|
36
|
+
expiresAt: Date;
|
|
37
|
+
createdAt: Date;
|
|
38
|
+
updatedAt: Date;
|
|
39
|
+
deletedAt: Date;
|
|
40
|
+
}[];
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
deletedAt: Date;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Auth = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const base_entity_1 = require("./base.entity");
|
|
16
|
+
const auth_identify_entity_1 = require("./auth-identify.entity");
|
|
17
|
+
const oauth_provider_entity_1 = require("./oauth-provider.entity");
|
|
18
|
+
const auth_type_enum_1 = require("../enums/auth-type.enum");
|
|
19
|
+
let Auth = class Auth extends base_entity_1.BaseEntity {
|
|
20
|
+
toMap() {
|
|
21
|
+
return {
|
|
22
|
+
id: this.id,
|
|
23
|
+
strategy: this.strategy,
|
|
24
|
+
isActive: this.isActive,
|
|
25
|
+
isVerified: this.isVerified,
|
|
26
|
+
isPrimary: this.isPrimary,
|
|
27
|
+
meta: this.meta,
|
|
28
|
+
lastUsedAt: this.lastUsedAt,
|
|
29
|
+
// user: this.user.toMap(),
|
|
30
|
+
identifiers: this.identifiers?.map((id) => id?.toMap()),
|
|
31
|
+
oauthProviders: this.oauthProviders?.map((provider) => provider?.toMap()),
|
|
32
|
+
createdAt: this.createdAt,
|
|
33
|
+
updatedAt: this.updatedAt,
|
|
34
|
+
deletedAt: this.deletedAt,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.Auth = Auth;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'Unique identity ID (UID) of this account. Multiple auth methods can share the same UID.',
|
|
42
|
+
type: 'string',
|
|
43
|
+
example: 'uuid-string',
|
|
44
|
+
}),
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
+
(0, typeorm_1.Index)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], Auth.prototype, "uid", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: auth_type_enum_1.AuthStrategy }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], Auth.prototype, "strategy", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.OneToMany)(() => auth_identify_entity_1.AuthIdentifier, (identifier) => identifier.auth, {
|
|
55
|
+
cascade: true,
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], Auth.prototype, "identifiers", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiProperty)({
|
|
61
|
+
example: '$2b$10$hashedpassword...',
|
|
62
|
+
description: 'Hashed secret (password, TOTP secret). Null for OAuth',
|
|
63
|
+
nullable: true,
|
|
64
|
+
}),
|
|
65
|
+
(0, typeorm_1.Column)({ nullable: true, select: false }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], Auth.prototype, "secretHash", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, swagger_1.ApiProperty)({
|
|
70
|
+
example: true,
|
|
71
|
+
description: 'Primary login method for the user',
|
|
72
|
+
}),
|
|
73
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
74
|
+
__metadata("design:type", Boolean)
|
|
75
|
+
], Auth.prototype, "isPrimary", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiProperty)({
|
|
78
|
+
example: true,
|
|
79
|
+
description: 'Whether the identifier is verified',
|
|
80
|
+
}),
|
|
81
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
82
|
+
__metadata("design:type", Boolean)
|
|
83
|
+
], Auth.prototype, "isVerified", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, swagger_1.ApiProperty)({
|
|
86
|
+
example: true,
|
|
87
|
+
description: 'Whether this auth method is enabled',
|
|
88
|
+
}),
|
|
89
|
+
(0, typeorm_1.Column)({ default: true }),
|
|
90
|
+
__metadata("design:type", Boolean)
|
|
91
|
+
], Auth.prototype, "isActive", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiProperty)({
|
|
94
|
+
example: { device: 'iPhone', ip: '192.168.1.1' },
|
|
95
|
+
description: 'Additional metadata (JSON)',
|
|
96
|
+
}),
|
|
97
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], Auth.prototype, "meta", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, swagger_1.ApiProperty)({
|
|
102
|
+
example: '2025-09-30T12:00:00Z',
|
|
103
|
+
description: 'Last successful usage timestamp',
|
|
104
|
+
}),
|
|
105
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
106
|
+
__metadata("design:type", Date)
|
|
107
|
+
], Auth.prototype, "lastUsedAt", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, swagger_1.ApiProperty)({
|
|
110
|
+
type: () => oauth_provider_entity_1.OAuthProvider,
|
|
111
|
+
description: 'OAuth provider details (only for OAUTH method)',
|
|
112
|
+
required: false,
|
|
113
|
+
}),
|
|
114
|
+
(0, typeorm_1.OneToMany)(() => oauth_provider_entity_1.OAuthProvider, (provider) => provider.auth, {
|
|
115
|
+
cascade: true,
|
|
116
|
+
nullable: true,
|
|
117
|
+
}),
|
|
118
|
+
__metadata("design:type", Array)
|
|
119
|
+
], Auth.prototype, "oauthProviders", void 0);
|
|
120
|
+
exports.Auth = Auth = __decorate([
|
|
121
|
+
(0, typeorm_1.Entity)('auth'),
|
|
122
|
+
(0, typeorm_1.Index)('IDX_user_primary_auth', ['uid'], {
|
|
123
|
+
unique: true,
|
|
124
|
+
where: `"isPrimary" = true`,
|
|
125
|
+
}),
|
|
126
|
+
(0, typeorm_1.Index)(['strategy']),
|
|
127
|
+
(0, typeorm_1.Index)(['isActive'])
|
|
128
|
+
], Auth);
|
|
129
|
+
//# sourceMappingURL=auth.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/auth.entity.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BaseEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
class BaseEntity {
|
|
16
|
+
}
|
|
17
|
+
exports.BaseEntity = BaseEntity;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
example: 'uuid-string',
|
|
21
|
+
description: 'Unique identifier',
|
|
22
|
+
}),
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], BaseEntity.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'Creation date' }),
|
|
28
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamp' }),
|
|
29
|
+
__metadata("design:type", Date)
|
|
30
|
+
], BaseEntity.prototype, "createdAt", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, swagger_1.ApiProperty)({ description: 'Last update date' }),
|
|
33
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamp' }),
|
|
34
|
+
__metadata("design:type", Date)
|
|
35
|
+
], BaseEntity.prototype, "updatedAt", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({ description: 'Deletion date (soft delete)' }),
|
|
38
|
+
(0, typeorm_1.DeleteDateColumn)({ type: 'timestamp', nullable: true }),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], BaseEntity.prototype, "deletedAt", void 0);
|
|
41
|
+
//# sourceMappingURL=base.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/base.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAKiB;AACjB,6CAA8C;AAE9C,MAAsB,UAAU;CAmB/B;AAnBD,gCAmBC;AAbG;IALC,IAAA,qBAAW,EAAC;QACT,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,mBAAmB;KACnC,CAAC;IACD,IAAA,gCAAsB,EAAC,MAAM,CAAC;;sCACpB;AAIX;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;6CAAC;AAIhB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAChD,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;6CAAC;AAIhB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC3D,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC7C,IAAI;6CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum MfaType {
|
|
2
|
+
TOTP = "TOTP",// Authenticator App
|
|
3
|
+
SMS = "SMS",
|
|
4
|
+
EMAIL = "EMAIL"
|
|
5
|
+
}
|
|
6
|
+
export declare class MfaMethod {
|
|
7
|
+
id: string;
|
|
8
|
+
uid: string;
|
|
9
|
+
type: MfaType;
|
|
10
|
+
secret: string;
|
|
11
|
+
isEnabled: boolean;
|
|
12
|
+
isDefault: boolean;
|
|
13
|
+
lastUsedAt: Date;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
toMap(): {
|
|
16
|
+
id: string;
|
|
17
|
+
type: MfaType;
|
|
18
|
+
isEnabled: boolean;
|
|
19
|
+
isDefault: boolean;
|
|
20
|
+
lastUsedAt: Date;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MfaMethod = exports.MfaType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
var MfaType;
|
|
15
|
+
(function (MfaType) {
|
|
16
|
+
MfaType["TOTP"] = "TOTP";
|
|
17
|
+
MfaType["SMS"] = "SMS";
|
|
18
|
+
MfaType["EMAIL"] = "EMAIL";
|
|
19
|
+
})(MfaType || (exports.MfaType = MfaType = {}));
|
|
20
|
+
let MfaMethod = class MfaMethod {
|
|
21
|
+
toMap() {
|
|
22
|
+
return {
|
|
23
|
+
id: this.id,
|
|
24
|
+
type: this.type,
|
|
25
|
+
isEnabled: this.isEnabled,
|
|
26
|
+
isDefault: this.isDefault,
|
|
27
|
+
lastUsedAt: this.lastUsedAt,
|
|
28
|
+
createdAt: this.createdAt,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.MfaMethod = MfaMethod;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], MfaMethod.prototype, "id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)(),
|
|
39
|
+
(0, typeorm_1.Index)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], MfaMethod.prototype, "uid", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: MfaType }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], MfaMethod.prototype, "type", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ select: false }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], MfaMethod.prototype, "secret", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
52
|
+
__metadata("design:type", Boolean)
|
|
53
|
+
], MfaMethod.prototype, "isEnabled", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], MfaMethod.prototype, "isDefault", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], MfaMethod.prototype, "lastUsedAt", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], MfaMethod.prototype, "createdAt", void 0);
|
|
66
|
+
exports.MfaMethod = MfaMethod = __decorate([
|
|
67
|
+
(0, typeorm_1.Entity)('auth_mfa_methods')
|
|
68
|
+
], MfaMethod);
|
|
69
|
+
//# sourceMappingURL=mfa-method.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfa-method.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/mfa-method.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAEjB,IAAY,OAIX;AAJD,WAAY,OAAO;IACjB,wBAAa,CAAA;IACb,sBAAW,CAAA;IACX,0BAAe,CAAA;AACjB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB;AAGM,IAAM,SAAS,GAAf,MAAM,SAAS;IA4BpB,KAAK;QACH,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF,CAAA;AAtCY,8BAAS;AAEpB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;qCACpB;AAIX;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,GAAE;;sCACI;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;uCAC1B;AAKd;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;yCACX;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4CACR;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4CACR;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;6CAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;4CAAC;oBA1BL,SAAS;IADrB,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,SAAS,CAsCrB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import { Auth } from './auth.entity';
|
|
3
|
+
import { OAuthProviderType } from '../enums/auth-type.enum';
|
|
4
|
+
export declare class OAuthProvider extends BaseEntity {
|
|
5
|
+
auth: Auth;
|
|
6
|
+
provider: OAuthProviderType;
|
|
7
|
+
providerUserId: string;
|
|
8
|
+
accessToken?: string;
|
|
9
|
+
refreshToken?: string;
|
|
10
|
+
expiresAt?: Date;
|
|
11
|
+
/**
|
|
12
|
+
* Display name from provider (e.g. "John Doe")
|
|
13
|
+
*/
|
|
14
|
+
displayName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Avatar/profile picture URL
|
|
17
|
+
*/
|
|
18
|
+
avatarUrl?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether provider verified the email
|
|
21
|
+
*/
|
|
22
|
+
emailVerified?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Raw provider response (for debugging/future-proofing)
|
|
25
|
+
*/
|
|
26
|
+
rawProfile?: Record<string, any>;
|
|
27
|
+
toMap(): {
|
|
28
|
+
id: string;
|
|
29
|
+
provider: OAuthProviderType;
|
|
30
|
+
providerUserId: string;
|
|
31
|
+
accessToken: string;
|
|
32
|
+
refreshToken: string;
|
|
33
|
+
expiresAt: Date;
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
updatedAt: Date;
|
|
36
|
+
deletedAt: Date;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OAuthProvider = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const base_entity_1 = require("./base.entity");
|
|
16
|
+
const auth_entity_1 = require("./auth.entity");
|
|
17
|
+
const auth_type_enum_1 = require("../enums/auth-type.enum");
|
|
18
|
+
let OAuthProvider = class OAuthProvider extends base_entity_1.BaseEntity {
|
|
19
|
+
toMap() {
|
|
20
|
+
return {
|
|
21
|
+
id: this.id,
|
|
22
|
+
provider: this.provider,
|
|
23
|
+
providerUserId: this.providerUserId,
|
|
24
|
+
accessToken: this.accessToken,
|
|
25
|
+
refreshToken: this.refreshToken,
|
|
26
|
+
expiresAt: this.expiresAt,
|
|
27
|
+
createdAt: this.createdAt,
|
|
28
|
+
updatedAt: this.updatedAt,
|
|
29
|
+
deletedAt: this.deletedAt,
|
|
30
|
+
// auth: this.auth.toMap(),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.OAuthProvider = OAuthProvider;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => auth_entity_1.Auth, (auth) => auth.oauthProviders, { onDelete: 'CASCADE' }),
|
|
37
|
+
(0, typeorm_1.JoinColumn)({ name: 'authId' }),
|
|
38
|
+
__metadata("design:type", auth_entity_1.Auth)
|
|
39
|
+
], OAuthProvider.prototype, "auth", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiProperty)({ enum: auth_type_enum_1.OAuthProviderType, example: auth_type_enum_1.OAuthProviderType.GOOGLE }),
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: auth_type_enum_1.OAuthProviderType }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], OAuthProvider.prototype, "provider", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiProperty)({ example: '1234567890' }),
|
|
47
|
+
(0, typeorm_1.Column)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], OAuthProvider.prototype, "providerUserId", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiProperty)({ example: 'ya29.a0ARrdaM...' }),
|
|
52
|
+
(0, typeorm_1.Column)({ nullable: true, select: false }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], OAuthProvider.prototype, "accessToken", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, swagger_1.ApiProperty)({ example: '1//0gdf1234...' }),
|
|
57
|
+
(0, typeorm_1.Column)({ nullable: true, select: false }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], OAuthProvider.prototype, "refreshToken", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, swagger_1.ApiProperty)({ example: '2025-10-01T12:00:00Z' }),
|
|
62
|
+
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], OAuthProvider.prototype, "expiresAt", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiProperty)({ example: 'John Doe', required: false }),
|
|
67
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], OAuthProvider.prototype, "displayName", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, swagger_1.ApiProperty)({ example: 'https://lh3.googleusercontent.com/...', required: false }),
|
|
72
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], OAuthProvider.prototype, "avatarUrl", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, swagger_1.ApiProperty)({ example: true, required: false }),
|
|
77
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
78
|
+
__metadata("design:type", Boolean)
|
|
79
|
+
], OAuthProvider.prototype, "emailVerified", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, swagger_1.ApiProperty)({ required: false }),
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], OAuthProvider.prototype, "rawProfile", void 0);
|
|
85
|
+
exports.OAuthProvider = OAuthProvider = __decorate([
|
|
86
|
+
(0, typeorm_1.Entity)('oauth_providers')
|
|
87
|
+
], OAuthProvider);
|
|
88
|
+
//# sourceMappingURL=oauth-provider.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-provider.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/oauth-provider.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgE;AAChE,6CAA8C;AAC9C,+CAA2C;AAC3C,+CAAqC;AACrC,4DAA4D;AAGrD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,wBAAU;IA0D3C,KAAK;QACH,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,2BAA2B;SAC5B,CAAC;IACJ,CAAC;CACF,CAAA;AAxEY,sCAAa;AAGxB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC7E,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;8BACzB,kBAAI;2CAAC;AAIX;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,kCAAiB,EAAE,OAAO,EAAE,kCAAiB,CAAC,MAAM,EAAE,CAAC;IAC3E,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kCAAiB,EAAE,CAAC;;+CACtB;AAK5B;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACtC,IAAA,gBAAM,GAAE;;qDACc;AAIvB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;kDACrB;AAIrB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC1C,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;mDACpB;AAItB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAChD,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAClC,IAAI;gDAAC;AAWjB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACrD,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAOrB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,uCAAuC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClF,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACR;AAOnB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC/C,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACH;AAOxB;IAFC,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAChC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACT;wBAxDtB,aAAa;IADzB,IAAA,gBAAM,EAAC,iBAAiB,CAAC;GACb,aAAa,CAwEzB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
export declare enum OtpPurpose {
|
|
3
|
+
VERIFY_EMAIL = "VERIFY_EMAIL",// For registration
|
|
4
|
+
VERIFY_PHONE = "VERIFY_PHONE",// For registration
|
|
5
|
+
PASSWORD_RESET = "PASSWORD_RESET",// For recovery
|
|
6
|
+
LOGIN_2FA = "LOGIN_2FA",// For logging in
|
|
7
|
+
MAGIC_LINK = "MAGIC_LINK",// For magic link login
|
|
8
|
+
SECURE_ACCOUNT = "SECURE_ACCOUNT"
|
|
9
|
+
}
|
|
10
|
+
export declare class OtpToken extends BaseEntity {
|
|
11
|
+
identifier: string;
|
|
12
|
+
purpose: OtpPurpose;
|
|
13
|
+
codeHash: string;
|
|
14
|
+
expiresAt: Date;
|
|
15
|
+
isUsed: boolean;
|
|
16
|
+
requestUserId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The ID of the primary Auth record that triggered this verification.
|
|
19
|
+
* This is used to mark the specific Auth method as verified upon success.
|
|
20
|
+
*/
|
|
21
|
+
requestAuthId?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OtpToken = exports.OtpPurpose = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
var OtpPurpose;
|
|
16
|
+
(function (OtpPurpose) {
|
|
17
|
+
OtpPurpose["VERIFY_EMAIL"] = "VERIFY_EMAIL";
|
|
18
|
+
OtpPurpose["VERIFY_PHONE"] = "VERIFY_PHONE";
|
|
19
|
+
OtpPurpose["PASSWORD_RESET"] = "PASSWORD_RESET";
|
|
20
|
+
OtpPurpose["LOGIN_2FA"] = "LOGIN_2FA";
|
|
21
|
+
OtpPurpose["MAGIC_LINK"] = "MAGIC_LINK";
|
|
22
|
+
OtpPurpose["SECURE_ACCOUNT"] = "SECURE_ACCOUNT";
|
|
23
|
+
})(OtpPurpose || (exports.OtpPurpose = OtpPurpose = {}));
|
|
24
|
+
let OtpToken = class OtpToken extends base_entity_1.BaseEntity {
|
|
25
|
+
};
|
|
26
|
+
exports.OtpToken = OtpToken;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], OtpToken.prototype, "identifier", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: OtpPurpose }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], OtpToken.prototype, "purpose", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], OtpToken.prototype, "codeHash", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'timestamp' }),
|
|
41
|
+
__metadata("design:type", Date)
|
|
42
|
+
], OtpToken.prototype, "expiresAt", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], OtpToken.prototype, "isUsed", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], OtpToken.prototype, "requestUserId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], OtpToken.prototype, "requestAuthId", void 0);
|
|
55
|
+
exports.OtpToken = OtpToken = __decorate([
|
|
56
|
+
(0, typeorm_1.Entity)('otp_tokens')
|
|
57
|
+
// Index makes lookup fast: "Find latest unused OTP for john@gmail.com"
|
|
58
|
+
,
|
|
59
|
+
(0, typeorm_1.Index)(['identifier', 'purpose', 'isUsed'])
|
|
60
|
+
], OtpToken);
|
|
61
|
+
//# sourceMappingURL=otp-token.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp-token.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/otp-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgD;AAChD,+CAA2C;AAE3C,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,2CAA6B,CAAA;IAC7B,2CAA6B,CAAA;IAC7B,+CAAiC,CAAA;IACjC,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,+CAAiC,CAAA;AACnC,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB;AAKM,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,wBAAU;CAgCvC,CAAA;AAhCY,4BAAQ;AAInB;IADC,IAAA,gBAAM,GAAE;;4CACU;AAInB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;;yCACvB;AAKpB;IADC,IAAA,gBAAM,GAAE;;0CACQ;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BACnB,IAAI;2CAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wCACX;AAKhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACJ;AAOvB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACJ;mBA/BZ,QAAQ;IAHpB,IAAA,gBAAM,EAAC,YAAY,CAAC;IACrB,uEAAuE;;IACtE,IAAA,eAAK,EAAC,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;GAC9B,QAAQ,CAgCpB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class Session {
|
|
2
|
+
id: string;
|
|
3
|
+
uid: string;
|
|
4
|
+
refreshTokenHash: string;
|
|
5
|
+
userAgent: string;
|
|
6
|
+
deviceFingerprint: string;
|
|
7
|
+
ipAddress: string;
|
|
8
|
+
expiresAt: Date;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
toMap(): {
|
|
11
|
+
id: string;
|
|
12
|
+
uid: string;
|
|
13
|
+
userAgent: string;
|
|
14
|
+
deviceFingerprint: string;
|
|
15
|
+
ipAddress: string;
|
|
16
|
+
expiresAt: Date;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
};
|
|
19
|
+
}
|