@nauth-toolkit/database-typeorm-postgres 0.1.3
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/LICENSE +90 -0
- package/README.md +63 -0
- package/dist/entities/auth-audit.entity.d.ts +32 -0
- package/dist/entities/auth-audit.entity.d.ts.map +1 -0
- package/dist/entities/auth-audit.entity.js +141 -0
- package/dist/entities/auth-audit.entity.js.map +1 -0
- package/dist/entities/challenge-session.entity.d.ts +20 -0
- package/dist/entities/challenge-session.entity.d.ts.map +1 -0
- package/dist/entities/challenge-session.entity.js +88 -0
- package/dist/entities/challenge-session.entity.js.map +1 -0
- package/dist/entities/index.d.ts +14 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +57 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/login-attempt.entity.d.ts +16 -0
- package/dist/entities/login-attempt.entity.d.ts.map +1 -0
- package/dist/entities/login-attempt.entity.js +70 -0
- package/dist/entities/login-attempt.entity.js.map +1 -0
- package/dist/entities/mfa-device.entity.d.ts +23 -0
- package/dist/entities/mfa-device.entity.d.ts.map +1 -0
- package/dist/entities/mfa-device.entity.js +100 -0
- package/dist/entities/mfa-device.entity.js.map +1 -0
- package/dist/entities/rate-limit.entity.d.ts +10 -0
- package/dist/entities/rate-limit.entity.d.ts.map +1 -0
- package/dist/entities/rate-limit.entity.js +47 -0
- package/dist/entities/rate-limit.entity.js.map +1 -0
- package/dist/entities/session.entity.d.ts +35 -0
- package/dist/entities/session.entity.d.ts.map +1 -0
- package/dist/entities/session.entity.js +158 -0
- package/dist/entities/session.entity.js.map +1 -0
- package/dist/entities/social-account.entity.d.ts +16 -0
- package/dist/entities/social-account.entity.d.ts.map +1 -0
- package/dist/entities/social-account.entity.js +71 -0
- package/dist/entities/social-account.entity.js.map +1 -0
- package/dist/entities/storage-lock.entity.d.ts +9 -0
- package/dist/entities/storage-lock.entity.d.ts.map +1 -0
- package/dist/entities/storage-lock.entity.js +43 -0
- package/dist/entities/storage-lock.entity.js.map +1 -0
- package/dist/entities/trusted-device.entity.d.ts +20 -0
- package/dist/entities/trusted-device.entity.d.ts.map +1 -0
- package/dist/entities/trusted-device.entity.js +89 -0
- package/dist/entities/trusted-device.entity.js.map +1 -0
- package/dist/entities/user.entity.d.ts +42 -0
- package/dist/entities/user.entity.d.ts.map +1 -0
- package/dist/entities/user.entity.js +180 -0
- package/dist/entities/user.entity.js.map +1 -0
- package/dist/entities/verification-token.entity.d.ts +21 -0
- package/dist/entities/verification-token.entity.d.ts.map +1 -0
- package/dist/entities/verification-token.entity.js +90 -0
- package/dist/entities/verification-token.entity.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/1734600000000-Initial.d.ts +7 -0
- package/dist/migrations/1734600000000-Initial.d.ts.map +1 -0
- package/dist/migrations/1734600000000-Initial.js +157 -0
- package/dist/migrations/1734600000000-Initial.js.map +1 -0
- package/dist/migrations/index.d.ts +6 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +6 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/typeorm-cli.datasource.d.ts +5 -0
- package/dist/typeorm-cli.datasource.d.ts.map +1 -0
- package/dist/typeorm-cli.datasource.js +19 -0
- package/dist/typeorm-cli.datasource.js.map +1 -0
- package/dist/utils/run-migrations.d.ts +4 -0
- package/dist/utils/run-migrations.d.ts.map +1 -0
- package/dist/utils/run-migrations.js +28 -0
- package/dist/utils/run-migrations.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,89 @@
|
|
|
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.TrustedDevice = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const core_1 = require("@nauth-toolkit/core");
|
|
15
|
+
const user_entity_1 = require("./user.entity");
|
|
16
|
+
let TrustedDevice = class TrustedDevice extends core_1.BaseTrustedDevice {
|
|
17
|
+
user;
|
|
18
|
+
};
|
|
19
|
+
exports.TrustedDevice = TrustedDevice;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], TrustedDevice.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], TrustedDevice.prototype, "userId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
31
|
+
__metadata("design:type", user_entity_1.User)
|
|
32
|
+
], TrustedDevice.prototype, "user", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], TrustedDevice.prototype, "deviceTokenHash", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], TrustedDevice.prototype, "deviceId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], TrustedDevice.prototype, "deviceName", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], TrustedDevice.prototype, "deviceType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], TrustedDevice.prototype, "ipAddress", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], TrustedDevice.prototype, "userAgent", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], TrustedDevice.prototype, "platform", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], TrustedDevice.prototype, "browser", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'timestamptz' }),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], TrustedDevice.prototype, "trustedUntil", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], TrustedDevice.prototype, "lastUsedAt", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
75
|
+
__metadata("design:type", Date)
|
|
76
|
+
], TrustedDevice.prototype, "createdAt", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
79
|
+
__metadata("design:type", Date)
|
|
80
|
+
], TrustedDevice.prototype, "updatedAt", void 0);
|
|
81
|
+
exports.TrustedDevice = TrustedDevice = __decorate([
|
|
82
|
+
(0, typeorm_1.Entity)('nauth_trusted_devices'),
|
|
83
|
+
(0, typeorm_1.Index)(['userId']),
|
|
84
|
+
(0, typeorm_1.Index)(['deviceTokenHash']),
|
|
85
|
+
(0, typeorm_1.Index)(['deviceId']),
|
|
86
|
+
(0, typeorm_1.Index)(['trustedUntil']),
|
|
87
|
+
(0, typeorm_1.Index)(['userId', 'deviceTokenHash'], { unique: true })
|
|
88
|
+
], TrustedDevice);
|
|
89
|
+
//# sourceMappingURL=trusted-device.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-device.entity.js","sourceRoot":"","sources":["../../src/entities/trusted-device.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;AACjB,8CAAwD;AACxD,+CAAqC;AAc9B,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,wBAAiB;IASlD,IAAI,CAAQ;CAqCb,CAAA;AA9CY,sCAAa;AAEhB;IADP,IAAA,gCAAsB,GAAE;;yCACN;AAGX;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;6CACD;AAIvB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;8BACxB,kBAAI;2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AGhB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACvB,IAAI;gDAAC;wBA7Cb,aAAa;IANzB,IAAA,gBAAM,EAAC,uBAAuB,CAAC;IAC/B,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;IACjB,IAAA,eAAK,EAAC,CAAC,iBAAiB,CAAC,CAAC;IAC1B,IAAA,eAAK,EAAC,CAAC,UAAU,CAAC,CAAC;IACnB,IAAA,eAAK,EAAC,CAAC,cAAc,CAAC,CAAC;IACvB,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC1C,aAAa,CA8CzB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BaseUser } from '@nauth-toolkit/core';
|
|
2
|
+
export declare class User extends BaseUser {
|
|
3
|
+
id: number;
|
|
4
|
+
sub: string;
|
|
5
|
+
username?: string | null;
|
|
6
|
+
firstName?: string | null;
|
|
7
|
+
lastName?: string | null;
|
|
8
|
+
email: string;
|
|
9
|
+
phone?: string | null;
|
|
10
|
+
passwordHash?: string | null;
|
|
11
|
+
passwordChangedAt?: Date | null;
|
|
12
|
+
passwordHistory?: string[] | null;
|
|
13
|
+
mustChangePassword: boolean;
|
|
14
|
+
isEmailVerified: boolean;
|
|
15
|
+
isPhoneVerified: boolean;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
isLocked: boolean;
|
|
18
|
+
lockReason?: string | null;
|
|
19
|
+
lockedAt?: Date | null;
|
|
20
|
+
lockedUntil?: Date | null;
|
|
21
|
+
failedLoginAttempts: number;
|
|
22
|
+
lastFailedLoginAt?: Date | null;
|
|
23
|
+
lastLoginAt?: Date | null;
|
|
24
|
+
lastLoginIp?: string | null;
|
|
25
|
+
mfaEnabled: boolean;
|
|
26
|
+
mfaMethods?: string[] | null;
|
|
27
|
+
mfaEnforcedAt?: Date | null;
|
|
28
|
+
totpSecret?: string | null;
|
|
29
|
+
backupCodes?: string[] | null;
|
|
30
|
+
preferredMfaMethod?: string | null;
|
|
31
|
+
mfaExempt?: boolean;
|
|
32
|
+
mfaExemptReason?: string | null;
|
|
33
|
+
mfaExemptGrantedAt?: Date | null;
|
|
34
|
+
mfaExemptGrantedBy?: string | null;
|
|
35
|
+
hasSocialAuth: boolean;
|
|
36
|
+
socialProviders?: string[] | null;
|
|
37
|
+
metadata?: Record<string, unknown> | null;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
40
|
+
deletedAt?: Date | null;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=user.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAY/C,qBAOa,IAAK,SAAQ,QAAQ;IAExB,EAAE,EAAE,MAAM,CAAC;IAIX,GAAG,EAAE,MAAM,CAAC;IAGZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGhC,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAGlC,kBAAkB,EAAE,OAAO,CAAC;IAG5B,eAAe,EAAE,OAAO,CAAC;IAGzB,eAAe,EAAE,OAAO,CAAC;IAGzB,QAAQ,EAAE,OAAO,CAAC;IAGlB,QAAQ,EAAE,OAAO,CAAC;IAGl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c === 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.User = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const core_1 = require("@nauth-toolkit/core");
|
|
15
|
+
let User = class User extends core_1.BaseUser {
|
|
16
|
+
};
|
|
17
|
+
exports.User = User;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], User.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Generated)('uuid'),
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'uuid', unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], User.prototype, "sub", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true, unique: true }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], User.prototype, "username", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], User.prototype, "firstName", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], User.prototype, "lastName", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, unique: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], User.prototype, "email", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: true }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], User.prototype, "phone", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], User.prototype, "passwordHash", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], User.prototype, "passwordChangedAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: 'simple-array', nullable: true }),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], User.prototype, "passwordHistory", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
61
|
+
__metadata("design:type", Boolean)
|
|
62
|
+
], User.prototype, "mustChangePassword", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
65
|
+
__metadata("design:type", Boolean)
|
|
66
|
+
], User.prototype, "isEmailVerified", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
69
|
+
__metadata("design:type", Boolean)
|
|
70
|
+
], User.prototype, "isPhoneVerified", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
73
|
+
__metadata("design:type", Boolean)
|
|
74
|
+
], User.prototype, "isActive", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
77
|
+
__metadata("design:type", Boolean)
|
|
78
|
+
], User.prototype, "isLocked", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], User.prototype, "lockReason", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], User.prototype, "lockedAt", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
89
|
+
__metadata("design:type", Object)
|
|
90
|
+
], User.prototype, "lockedUntil", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], User.prototype, "failedLoginAttempts", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
97
|
+
__metadata("design:type", Object)
|
|
98
|
+
], User.prototype, "lastFailedLoginAt", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], User.prototype, "lastLoginAt", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], User.prototype, "lastLoginIp", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
109
|
+
__metadata("design:type", Boolean)
|
|
110
|
+
], User.prototype, "mfaEnabled", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, typeorm_1.Column)({ type: 'simple-array', nullable: true }),
|
|
113
|
+
__metadata("design:type", Object)
|
|
114
|
+
], User.prototype, "mfaMethods", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
117
|
+
__metadata("design:type", Object)
|
|
118
|
+
], User.prototype, "mfaEnforcedAt", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
121
|
+
__metadata("design:type", Object)
|
|
122
|
+
], User.prototype, "totpSecret", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, typeorm_1.Column)({ type: 'simple-array', nullable: true }),
|
|
125
|
+
__metadata("design:type", Object)
|
|
126
|
+
], User.prototype, "backupCodes", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: true }),
|
|
129
|
+
__metadata("design:type", Object)
|
|
130
|
+
], User.prototype, "preferredMfaMethod", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
133
|
+
__metadata("design:type", Boolean)
|
|
134
|
+
], User.prototype, "mfaExempt", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], User.prototype, "mfaExemptReason", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
141
|
+
__metadata("design:type", Object)
|
|
142
|
+
], User.prototype, "mfaExemptGrantedAt", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
145
|
+
__metadata("design:type", Object)
|
|
146
|
+
], User.prototype, "mfaExemptGrantedBy", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
149
|
+
__metadata("design:type", Boolean)
|
|
150
|
+
], User.prototype, "hasSocialAuth", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, typeorm_1.Column)({ type: 'simple-array', nullable: true }),
|
|
153
|
+
__metadata("design:type", Object)
|
|
154
|
+
], User.prototype, "socialProviders", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
157
|
+
__metadata("design:type", Object)
|
|
158
|
+
], User.prototype, "metadata", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
161
|
+
__metadata("design:type", Date)
|
|
162
|
+
], User.prototype, "createdAt", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
165
|
+
__metadata("design:type", Date)
|
|
166
|
+
], User.prototype, "updatedAt", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, typeorm_1.DeleteDateColumn)({ type: 'timestamptz' }),
|
|
169
|
+
__metadata("design:type", Object)
|
|
170
|
+
], User.prototype, "deletedAt", void 0);
|
|
171
|
+
exports.User = User = __decorate([
|
|
172
|
+
(0, typeorm_1.Entity)('nauth_users'),
|
|
173
|
+
(0, typeorm_1.Index)(['sub'], { unique: true }),
|
|
174
|
+
(0, typeorm_1.Index)(['email']),
|
|
175
|
+
(0, typeorm_1.Index)(['username']),
|
|
176
|
+
(0, typeorm_1.Index)(['phone']),
|
|
177
|
+
(0, typeorm_1.Index)(['isActive']),
|
|
178
|
+
(0, typeorm_1.Index)(['hasSocialAuth'])
|
|
179
|
+
], User);
|
|
180
|
+
//# sourceMappingURL=user.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.ent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AS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;2CACb;AAGvB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACP;AAGlC;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACQ;AAG1C;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACvB,IAAI;uCAAC;AAGhB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACvB,IAAI;uCAAC;AAGhB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;uCACV;eAlHrB,IAAI;IAPhB,IAAA,gBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,eAAK,EAAC,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChC,IAAA,eAAK,EAAC,CAAC,OAAO,CAAC,CAAC;IAChB,IAAA,eAAK,EAAC,CAAC,UAAU,CAAC,CAAC;IACnB,IAAA,eAAK,EAAC,CAAC,OAAO,CAAC,CAAC;IAChB,IAAA,eAAK,EAAC,CAAC,UAAU,CAAC,CAAC;IACnB,IAAA,eAAK,EAAC,CAAC,eAAe,CAAC,CAAC;GACZ,IAAI,CAmHhB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseVerificationToken } from '@nauth-toolkit/core';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
import { ChallengeSession } from './challenge-session.entity';
|
|
4
|
+
export declare class VerificationToken extends BaseVerificationToken {
|
|
5
|
+
id: number;
|
|
6
|
+
userId: number;
|
|
7
|
+
user: User;
|
|
8
|
+
challengeSessionId?: number | null;
|
|
9
|
+
challengeSession?: ChallengeSession | null;
|
|
10
|
+
type: 'email' | 'phone' | 'password_reset';
|
|
11
|
+
token: string;
|
|
12
|
+
code?: string | null;
|
|
13
|
+
expiresAt: Date;
|
|
14
|
+
attempts: number;
|
|
15
|
+
usedAt?: Date | null;
|
|
16
|
+
ipAddress?: string | null;
|
|
17
|
+
userAgent?: string | null;
|
|
18
|
+
metadata?: Record<string, unknown> | null;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=verification-token.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-token.entity.d.ts","sourceRoot":"","sources":["../../src/entities/verification-token.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,qBAIa,iBAAkB,SAAQ,qBAAqB;IAElD,EAAE,EAAE,MAAM,CAAC;IAGX,MAAM,EAAE,MAAM,CAAC;IAIvB,IAAI,EAAG,IAAI,CAAC;IAGJ,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI3C,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAGnC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAAC;IAG3C,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,SAAS,EAAE,IAAI,CAAC;IAGhB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG1C,SAAS,EAAE,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.VerificationToken = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const core_1 = require("@nauth-toolkit/core");
|
|
15
|
+
const user_entity_1 = require("./user.entity");
|
|
16
|
+
const challenge_session_entity_1 = require("./challenge-session.entity");
|
|
17
|
+
let VerificationToken = class VerificationToken extends core_1.BaseVerificationToken {
|
|
18
|
+
user;
|
|
19
|
+
challengeSession;
|
|
20
|
+
};
|
|
21
|
+
exports.VerificationToken = VerificationToken;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], VerificationToken.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], VerificationToken.prototype, "userId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
33
|
+
__metadata("design:type", user_entity_1.User)
|
|
34
|
+
], VerificationToken.prototype, "user", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], VerificationToken.prototype, "challengeSessionId", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.ManyToOne)(() => challenge_session_entity_1.ChallengeSession, { nullable: true, onDelete: 'CASCADE' }),
|
|
41
|
+
(0, typeorm_1.JoinColumn)({ name: 'challengeSessionId' }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], VerificationToken.prototype, "challengeSession", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 20 }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], VerificationToken.prototype, "type", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], VerificationToken.prototype, "token", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 10, nullable: true }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], VerificationToken.prototype, "code", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'timestamptz' }),
|
|
58
|
+
__metadata("design:type", Date)
|
|
59
|
+
], VerificationToken.prototype, "expiresAt", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
62
|
+
__metadata("design:type", Number)
|
|
63
|
+
], VerificationToken.prototype, "attempts", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], VerificationToken.prototype, "usedAt", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], VerificationToken.prototype, "ipAddress", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], VerificationToken.prototype, "userAgent", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], VerificationToken.prototype, "metadata", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
82
|
+
__metadata("design:type", Date)
|
|
83
|
+
], VerificationToken.prototype, "createdAt", void 0);
|
|
84
|
+
exports.VerificationToken = VerificationToken = __decorate([
|
|
85
|
+
(0, typeorm_1.Entity)('nauth_verification_tokens'),
|
|
86
|
+
(0, typeorm_1.Index)(['userId', 'type']),
|
|
87
|
+
(0, typeorm_1.Index)(['token']),
|
|
88
|
+
(0, typeorm_1.Index)(['expiresAt'])
|
|
89
|
+
], VerificationToken);
|
|
90
|
+
//# sourceMappingURL=verification-token.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-token.entity.js","sourceRoot":"","sources":["../../src/entities/verification-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiH;AACjH,8CAA4D;AAC5D,+CAAqC;AACrC,yEAA8D;AAYvD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,4BAAqB;IAS1D,IAAI,CAAQ;IAOZ,gBAAgB,CAA2B;CA+B5C,CAAA;AA/CY,8CAAiB;AAEpB;IADP,IAAA,gCAAsB,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SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACtB;AAG1B;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACP;AAG1B;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACQ;AAG1C;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACvB,IAAI;oDAAC;4BA9Cb,iBAAiB;IAJ7B,IAAA,gBAAM,EAAC,2BAA2B,CAAC;IACnC,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzB,IAAA,eAAK,EAAC,CAAC,OAAO,CAAC,CAAC;IAChB,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;GACR,iBAAiB,CA+C7B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAGhF,cAAc,YAAY,CAAC;AAa3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.runNAuthMigrations = exports.getNAuthTransientStorageEntities = exports.getNAuthEntities = void 0;
|
|
18
|
+
var entities_1 = require("./entities");
|
|
19
|
+
Object.defineProperty(exports, "getNAuthEntities", { enumerable: true, get: function () { return entities_1.getNAuthEntities; } });
|
|
20
|
+
Object.defineProperty(exports, "getNAuthTransientStorageEntities", { enumerable: true, get: function () { return entities_1.getNAuthTransientStorageEntities; } });
|
|
21
|
+
__exportStar(require("./entities"), exports);
|
|
22
|
+
var run_migrations_1 = require("./utils/run-migrations");
|
|
23
|
+
Object.defineProperty(exports, "runNAuthMigrations", { enumerable: true, get: function () { return run_migrations_1.runNAuthMigrations; } });
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAQA,uCAAgF;AAAvE,4GAAA,gBAAgB,OAAA;AAAE,4HAAA,gCAAgC,OAAA;AAG3D,6CAA2B;AAa3B,yDAA4D;AAAnD,oHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class Initial1734600000000 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1734600000000-Initial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1734600000000-Initial.d.ts","sourceRoot":"","sources":["../../src/migrations/1734600000000-Initial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,IAAI,SAA0B;IAEjB,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAsH3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CA0E3D"}
|