@nauth-toolkit/database-typeorm-mysql 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.
Files changed (71) hide show
  1. package/LICENSE +90 -0
  2. package/README.md +78 -0
  3. package/dist/entities/auth-audit.entity.d.ts +32 -0
  4. package/dist/entities/auth-audit.entity.d.ts.map +1 -0
  5. package/dist/entities/auth-audit.entity.js +141 -0
  6. package/dist/entities/auth-audit.entity.js.map +1 -0
  7. package/dist/entities/challenge-session.entity.d.ts +20 -0
  8. package/dist/entities/challenge-session.entity.d.ts.map +1 -0
  9. package/dist/entities/challenge-session.entity.js +88 -0
  10. package/dist/entities/challenge-session.entity.js.map +1 -0
  11. package/dist/entities/index.d.ts +14 -0
  12. package/dist/entities/index.d.ts.map +1 -0
  13. package/dist/entities/index.js +57 -0
  14. package/dist/entities/index.js.map +1 -0
  15. package/dist/entities/login-attempt.entity.d.ts +16 -0
  16. package/dist/entities/login-attempt.entity.d.ts.map +1 -0
  17. package/dist/entities/login-attempt.entity.js +70 -0
  18. package/dist/entities/login-attempt.entity.js.map +1 -0
  19. package/dist/entities/mfa-device.entity.d.ts +23 -0
  20. package/dist/entities/mfa-device.entity.d.ts.map +1 -0
  21. package/dist/entities/mfa-device.entity.js +105 -0
  22. package/dist/entities/mfa-device.entity.js.map +1 -0
  23. package/dist/entities/rate-limit.entity.d.ts +10 -0
  24. package/dist/entities/rate-limit.entity.d.ts.map +1 -0
  25. package/dist/entities/rate-limit.entity.js +53 -0
  26. package/dist/entities/rate-limit.entity.js.map +1 -0
  27. package/dist/entities/session.entity.d.ts +35 -0
  28. package/dist/entities/session.entity.d.ts.map +1 -0
  29. package/dist/entities/session.entity.js +158 -0
  30. package/dist/entities/session.entity.js.map +1 -0
  31. package/dist/entities/social-account.entity.d.ts +16 -0
  32. package/dist/entities/social-account.entity.d.ts.map +1 -0
  33. package/dist/entities/social-account.entity.js +76 -0
  34. package/dist/entities/social-account.entity.js.map +1 -0
  35. package/dist/entities/storage-lock.entity.d.ts +9 -0
  36. package/dist/entities/storage-lock.entity.d.ts.map +1 -0
  37. package/dist/entities/storage-lock.entity.js +43 -0
  38. package/dist/entities/storage-lock.entity.js.map +1 -0
  39. package/dist/entities/trusted-device.entity.d.ts +20 -0
  40. package/dist/entities/trusted-device.entity.d.ts.map +1 -0
  41. package/dist/entities/trusted-device.entity.js +94 -0
  42. package/dist/entities/trusted-device.entity.js.map +1 -0
  43. package/dist/entities/user.entity.d.ts +43 -0
  44. package/dist/entities/user.entity.d.ts.map +1 -0
  45. package/dist/entities/user.entity.js +229 -0
  46. package/dist/entities/user.entity.js.map +1 -0
  47. package/dist/entities/verification-token.entity.d.ts +21 -0
  48. package/dist/entities/verification-token.entity.d.ts.map +1 -0
  49. package/dist/entities/verification-token.entity.js +90 -0
  50. package/dist/entities/verification-token.entity.js.map +1 -0
  51. package/dist/index.d.ts +5 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +26 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/migrations/1734600000000-Initial.d.ts +7 -0
  56. package/dist/migrations/1734600000000-Initial.d.ts.map +1 -0
  57. package/dist/migrations/1734600000000-Initial.js +107 -0
  58. package/dist/migrations/1734600000000-Initial.js.map +1 -0
  59. package/dist/migrations/index.d.ts +6 -0
  60. package/dist/migrations/index.d.ts.map +1 -0
  61. package/dist/migrations/index.js +6 -0
  62. package/dist/migrations/index.js.map +1 -0
  63. package/dist/typeorm-cli.datasource.d.ts +5 -0
  64. package/dist/typeorm-cli.datasource.d.ts.map +1 -0
  65. package/dist/typeorm-cli.datasource.js +20 -0
  66. package/dist/typeorm-cli.datasource.js.map +1 -0
  67. package/dist/utils/run-migrations.d.ts +4 -0
  68. package/dist/utils/run-migrations.d.ts.map +1 -0
  69. package/dist/utils/run-migrations.js +28 -0
  70. package/dist/utils/run-migrations.js.map +1 -0
  71. package/package.json +48 -0
@@ -0,0 +1,23 @@
1
+ import { BaseMFADevice, MFADeviceMethod } from '@nauth-toolkit/core';
2
+ import { User } from './user.entity';
3
+ export declare class MFADevice extends BaseMFADevice {
4
+ id: number;
5
+ user: User;
6
+ userId: number;
7
+ type: MFADeviceMethod;
8
+ name: string;
9
+ secret?: string | null;
10
+ phoneNumber?: string | null;
11
+ credentialId?: string | null;
12
+ publicKey?: string | null;
13
+ counter?: number | null;
14
+ transports?: string[] | null;
15
+ isActive: boolean;
16
+ isPrimary: boolean;
17
+ lastUsedAt?: Date | null;
18
+ usageCount: number;
19
+ metadata?: Record<string, unknown> | null;
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ }
23
+ //# sourceMappingURL=mfa-device.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-device.entity.d.ts","sourceRoot":"","sources":["../../src/entities/mfa-device.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAYrC,qBAKa,SAAU,SAAQ,aAAa;IAElC,EAAE,EAAE,MAAM,CAAC;IAInB,IAAI,EAAG,IAAI,CAAC;IAGJ,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,eAAe,CAAC;IAGtB,IAAI,EAAE,MAAM,CAAC;IAGb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAG7B,QAAQ,EAAE,OAAO,CAAC;IAGlB,SAAS,EAAE,OAAO,CAAC;IAGnB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGzB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG1C,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACzB"}
@@ -0,0 +1,105 @@
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.MFADevice = 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 MFADevice = class MFADevice extends core_1.BaseMFADevice {
17
+ user;
18
+ };
19
+ exports.MFADevice = MFADevice;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
22
+ __metadata("design:type", Number)
23
+ ], MFADevice.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
26
+ (0, typeorm_1.JoinColumn)({ name: 'userId' }),
27
+ __metadata("design:type", user_entity_1.User)
28
+ ], MFADevice.prototype, "user", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ type: 'int' }),
31
+ __metadata("design:type", Number)
32
+ ], MFADevice.prototype, "userId", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20 }),
35
+ __metadata("design:type", String)
36
+ ], MFADevice.prototype, "type", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
39
+ __metadata("design:type", String)
40
+ ], MFADevice.prototype, "name", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
43
+ __metadata("design:type", Object)
44
+ ], MFADevice.prototype, "secret", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: true }),
47
+ __metadata("design:type", Object)
48
+ ], MFADevice.prototype, "phoneNumber", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
51
+ __metadata("design:type", Object)
52
+ ], MFADevice.prototype, "credentialId", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], MFADevice.prototype, "publicKey", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
59
+ __metadata("design:type", Object)
60
+ ], MFADevice.prototype, "counter", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
63
+ __metadata("design:type", Object)
64
+ ], MFADevice.prototype, "transports", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'tinyint', width: 1, default: 1 }),
67
+ __metadata("design:type", Boolean)
68
+ ], MFADevice.prototype, "isActive", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: 'tinyint', width: 1, default: 0 }),
71
+ __metadata("design:type", Boolean)
72
+ ], MFADevice.prototype, "isPrimary", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6, nullable: true }),
75
+ __metadata("design:type", Object)
76
+ ], MFADevice.prototype, "lastUsedAt", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: 'int', default: 0 }),
79
+ __metadata("design:type", Number)
80
+ ], MFADevice.prototype, "usageCount", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
83
+ __metadata("design:type", Object)
84
+ ], MFADevice.prototype, "metadata", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamp', precision: 6, default: () => 'CURRENT_TIMESTAMP(6)' }),
87
+ __metadata("design:type", Date)
88
+ ], MFADevice.prototype, "createdAt", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.UpdateDateColumn)({
91
+ type: 'timestamp',
92
+ precision: 6,
93
+ default: () => 'CURRENT_TIMESTAMP(6)',
94
+ onUpdate: 'CURRENT_TIMESTAMP(6)',
95
+ }),
96
+ __metadata("design:type", Date)
97
+ ], MFADevice.prototype, "updatedAt", void 0);
98
+ exports.MFADevice = MFADevice = __decorate([
99
+ (0, typeorm_1.Entity)('nauth_mfa_devices'),
100
+ (0, typeorm_1.Index)(['userId']),
101
+ (0, typeorm_1.Index)(['type']),
102
+ (0, typeorm_1.Index)(['isActive']),
103
+ (0, typeorm_1.Unique)('uq_mfa_device_user_type', ['userId', 'type'])
104
+ ], MFADevice);
105
+ //# sourceMappingURL=mfa-device.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa-device.entity.js","sourceRoot":"","sources":["../../src/entities/mfa-device.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAUiB;AACjB,8CAAqE;AACrE,+CAAqC;AAiB9B,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,oBAAa;IAM1C,IAAI,CAAQ;CAsDb,CAAA;AA5DY,8BAAS;AAEZ;IADP,IAAA,gCAAsB,GAAE;;qCACN;AAInB;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;8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,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAGzB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;6CACT;AAGnB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACS;AAG1C;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;8BAC1E,IAAI;4CAAC;AAQhB;IANP,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB;QACrC,QAAQ,EAAE,sBAAsB;KACjC,CAAC;8BACiB,IAAI;4CAAC;oBA3Db,SAAS;IALrB,IAAA,gBAAM,EAAC,mBAAmB,CAAC;IAC3B,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;IACjB,IAAA,eAAK,EAAC,CAAC,MAAM,CAAC,CAAC;IACf,IAAA,eAAK,EAAC,CAAC,UAAU,CAAC,CAAC;IACnB,IAAA,gBAAM,EAAC,yBAAyB,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;GACzC,SAAS,CA4DrB"}
@@ -0,0 +1,10 @@
1
+ import { BaseRateLimit } from '@nauth-toolkit/core';
2
+ export declare class RateLimit extends BaseRateLimit {
3
+ id: number;
4
+ key: string;
5
+ value: string;
6
+ expiresAt: Date | null;
7
+ createdAt: Date;
8
+ updatedAt: Date;
9
+ }
10
+ //# sourceMappingURL=rate-limit.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limit.entity.d.ts","sourceRoot":"","sources":["../../src/entities/rate-limit.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,qBAGa,SAAU,SAAQ,aAAa;IAElC,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,MAAM,CAAC;IAGd,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,SAAS,EAAE,IAAI,CAAC;IAShB,SAAS,EAAE,IAAI,CAAC;CACzB"}
@@ -0,0 +1,53 @@
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.RateLimit = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const core_1 = require("@nauth-toolkit/core");
15
+ let RateLimit = class RateLimit extends core_1.BaseRateLimit {
16
+ };
17
+ exports.RateLimit = RateLimit;
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
20
+ __metadata("design:type", Number)
21
+ ], RateLimit.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
24
+ __metadata("design:type", String)
25
+ ], RateLimit.prototype, "key", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: 'text' }),
28
+ __metadata("design:type", String)
29
+ ], RateLimit.prototype, "value", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6, name: 'expiresAt', nullable: true }),
32
+ __metadata("design:type", Object)
33
+ ], RateLimit.prototype, "expiresAt", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamp', precision: 6, name: 'createdAt', default: () => 'CURRENT_TIMESTAMP(6)' }),
36
+ __metadata("design:type", Date)
37
+ ], RateLimit.prototype, "createdAt", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.UpdateDateColumn)({
40
+ type: 'timestamp',
41
+ precision: 6,
42
+ name: 'updatedAt',
43
+ default: () => 'CURRENT_TIMESTAMP(6)',
44
+ onUpdate: 'CURRENT_TIMESTAMP(6)',
45
+ }),
46
+ __metadata("design:type", Date)
47
+ ], RateLimit.prototype, "updatedAt", void 0);
48
+ exports.RateLimit = RateLimit = __decorate([
49
+ (0, typeorm_1.Entity)('nauth_rate_limits'),
50
+ (0, typeorm_1.Index)(['key'], { unique: true }),
51
+ (0, typeorm_1.Index)(['expiresAt'])
52
+ ], RateLimit);
53
+ //# sourceMappingURL=rate-limit.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limit.entity.js","sourceRoot":"","sources":["../../src/entities/rate-limit.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4G;AAC5G,8CAAoD;AAW7C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,oBAAa;CAwB3C,CAAA;AAxBY,8BAAS;AAEZ;IADP,IAAA,gCAAsB,GAAE;;qCACN;AAGX;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;sCACrB;AAGZ;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACH;AAGd;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAChD;AAGvB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;8BAC7F,IAAI;4CAAC;AAShB;IAPP,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB;QACrC,QAAQ,EAAE,sBAAsB;KACjC,CAAC;8BACiB,IAAI;4CAAC;oBAvBb,SAAS;IAHrB,IAAA,gBAAM,EAAC,mBAAmB,CAAC;IAC3B,IAAA,eAAK,EAAC,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChC,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;GACR,SAAS,CAwBrB"}
@@ -0,0 +1,35 @@
1
+ import { BaseSession } from '@nauth-toolkit/core';
2
+ import { User } from './user.entity';
3
+ export declare class Session extends BaseSession {
4
+ id: number;
5
+ version: number;
6
+ userId: number;
7
+ user: User;
8
+ accessTokenHash: string;
9
+ refreshTokenHash: string;
10
+ tokenFamily?: string | null;
11
+ deviceId?: string | null;
12
+ deviceName?: string | null;
13
+ deviceType?: string | null;
14
+ deviceFingerprint?: string | null;
15
+ ipAddress?: string | null;
16
+ ipCountry?: string | null;
17
+ ipCity?: string | null;
18
+ ipLatitude?: number | null;
19
+ ipLongitude?: number | null;
20
+ ipIsp?: string | null;
21
+ userAgent?: string | null;
22
+ platform?: string | null;
23
+ browser?: string | null;
24
+ authMethod?: string | null;
25
+ isRemembered: boolean;
26
+ isTrustedDevice: boolean;
27
+ expiresAt: Date;
28
+ lastActivityAt?: Date | null;
29
+ isRevoked: boolean;
30
+ revokedAt?: Date | null;
31
+ revokeReason?: string | null;
32
+ metadata?: Record<string, unknown> | null;
33
+ createdAt: Date;
34
+ }
35
+ //# sourceMappingURL=session.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.entity.d.ts","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQrC,qBAgBa,OAAQ,SAAQ,WAAW;IAE9B,EAAE,EAAE,MAAM,CAAC;IAGX,OAAO,EAAE,MAAM,CAAC;IAGhB,MAAM,EAAE,MAAM,CAAC;IAIvB,IAAI,EAAG,IAAI,CAAC;IAGJ,eAAe,EAAE,MAAM,CAAC;IAGxB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGlC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,YAAY,EAAE,OAAO,CAAC;IAGtB,eAAe,EAAE,OAAO,CAAC;IAGzB,SAAS,EAAE,IAAI,CAAC;IAGhB,cAAc,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAG7B,SAAS,EAAE,OAAO,CAAC;IAGnB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGxB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG1C,SAAS,EAAE,IAAI,CAAC;CACzB"}
@@ -0,0 +1,158 @@
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.Session = 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 Session = class Session extends core_1.BaseSession {
17
+ user;
18
+ };
19
+ exports.Session = Session;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
22
+ __metadata("design:type", Number)
23
+ ], Session.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.VersionColumn)(),
26
+ __metadata("design:type", Number)
27
+ ], Session.prototype, "version", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'int' }),
30
+ __metadata("design:type", Number)
31
+ ], Session.prototype, "userId", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
34
+ (0, typeorm_1.JoinColumn)({ name: 'userId' }),
35
+ __metadata("design:type", user_entity_1.User)
36
+ ], Session.prototype, "user", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
39
+ __metadata("design:type", String)
40
+ ], Session.prototype, "accessTokenHash", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
43
+ __metadata("design:type", String)
44
+ ], Session.prototype, "refreshTokenHash", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
47
+ __metadata("design:type", Object)
48
+ ], Session.prototype, "tokenFamily", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
51
+ __metadata("design:type", Object)
52
+ ], Session.prototype, "deviceId", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], Session.prototype, "deviceName", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
59
+ __metadata("design:type", Object)
60
+ ], Session.prototype, "deviceType", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
63
+ __metadata("design:type", Object)
64
+ ], Session.prototype, "deviceFingerprint", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'varchar', length: 45, nullable: true }),
67
+ __metadata("design:type", Object)
68
+ ], Session.prototype, "ipAddress", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
71
+ __metadata("design:type", Object)
72
+ ], Session.prototype, "ipCountry", void 0);
73
+ __decorate([
74
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
75
+ __metadata("design:type", Object)
76
+ ], Session.prototype, "ipCity", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 6, nullable: true }),
79
+ __metadata("design:type", Object)
80
+ ], Session.prototype, "ipLatitude", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({ type: 'decimal', precision: 10, scale: 6, nullable: true }),
83
+ __metadata("design:type", Object)
84
+ ], Session.prototype, "ipLongitude", void 0);
85
+ __decorate([
86
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
87
+ __metadata("design:type", Object)
88
+ ], Session.prototype, "ipIsp", void 0);
89
+ __decorate([
90
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
91
+ __metadata("design:type", Object)
92
+ ], Session.prototype, "userAgent", void 0);
93
+ __decorate([
94
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
95
+ __metadata("design:type", Object)
96
+ ], Session.prototype, "platform", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
99
+ __metadata("design:type", Object)
100
+ ], Session.prototype, "browser", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
103
+ __metadata("design:type", Object)
104
+ ], Session.prototype, "authMethod", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.Column)({ type: 'tinyint', width: 1, default: 0 }),
107
+ __metadata("design:type", Boolean)
108
+ ], Session.prototype, "isRemembered", void 0);
109
+ __decorate([
110
+ (0, typeorm_1.Column)({ type: 'tinyint', width: 1, default: 0 }),
111
+ __metadata("design:type", Boolean)
112
+ ], Session.prototype, "isTrustedDevice", void 0);
113
+ __decorate([
114
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6 }),
115
+ __metadata("design:type", Date)
116
+ ], Session.prototype, "expiresAt", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6, nullable: true }),
119
+ __metadata("design:type", Object)
120
+ ], Session.prototype, "lastActivityAt", void 0);
121
+ __decorate([
122
+ (0, typeorm_1.Column)({ type: 'tinyint', width: 1, default: 0 }),
123
+ __metadata("design:type", Boolean)
124
+ ], Session.prototype, "isRevoked", void 0);
125
+ __decorate([
126
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6, nullable: true }),
127
+ __metadata("design:type", Object)
128
+ ], Session.prototype, "revokedAt", void 0);
129
+ __decorate([
130
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
131
+ __metadata("design:type", Object)
132
+ ], Session.prototype, "revokeReason", void 0);
133
+ __decorate([
134
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
135
+ __metadata("design:type", Object)
136
+ ], Session.prototype, "metadata", void 0);
137
+ __decorate([
138
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamp', precision: 6, default: () => 'CURRENT_TIMESTAMP(6)' }),
139
+ __metadata("design:type", Date)
140
+ ], Session.prototype, "createdAt", void 0);
141
+ exports.Session = Session = __decorate([
142
+ (0, typeorm_1.Entity)('nauth_sessions'),
143
+ (0, typeorm_1.Index)(['userId']),
144
+ (0, typeorm_1.Index)(['accessTokenHash']),
145
+ (0, typeorm_1.Index)(['refreshTokenHash']),
146
+ (0, typeorm_1.Index)(['deviceId']),
147
+ (0, typeorm_1.Index)(['expiresAt']),
148
+ (0, typeorm_1.Index)(['isRevoked']),
149
+ (0, typeorm_1.Index)(['refreshTokenHash', 'isRevoked']),
150
+ (0, typeorm_1.Index)(['userId', 'isRevoked']),
151
+ (0, typeorm_1.Index)(['userId', 'isRevoked', 'createdAt']),
152
+ (0, typeorm_1.Index)(['userId', 'isRevoked', 'expiresAt']),
153
+ (0, typeorm_1.Index)(['userId', 'deviceId']),
154
+ (0, typeorm_1.Index)(['userId', 'ipAddress']),
155
+ (0, typeorm_1.Index)(['userId', 'ipCountry']),
156
+ (0, typeorm_1.Index)(['tokenFamily', 'isRevoked'])
157
+ ], Session);
158
+ //# sourceMappingURL=session.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;AACjB,8CAAkD;AAClD,+CAAqC;AAwB9B,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,kBAAW;IAYtC,IAAI,CAAQ;CA+Eb,CAAA;AA3FY,0BAAO;AAEV;IADP,IAAA,gCAAsB,GAAE;;mCACN;AAGX;IADP,IAAA,uBAAa,GAAE;;wCACQ;AAGhB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;uCACD;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;qCAAC;AAGJ;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;gDACT;AAGxB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;iDACR;AAGzB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACrB;AAG5B;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACxB;AAGzB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE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AAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACS;AAG1C;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;8BAC1E,IAAI;0CAAC;kBA1Fb,OAAO;IAhBnB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;IACxB,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;IACjB,IAAA,eAAK,EAAC,CAAC,iBAAiB,CAAC,CAAC;IAC1B,IAAA,eAAK,EAAC,CAAC,kBAAkB,CAAC,CAAC;IAC3B,IAAA,eAAK,EAAC,CAAC,UAAU,CAAC,CAAC;IACnB,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;IACpB,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;IAEpB,IAAA,eAAK,EAAC,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACxC,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC9B,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAC3C,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAC3C,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7B,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC9B,IAAA,eAAK,EAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC9B,IAAA,eAAK,EAAC,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;GACvB,OAAO,CA2FnB"}
@@ -0,0 +1,16 @@
1
+ import { BaseSocialAccount } from '@nauth-toolkit/core';
2
+ import { User } from './user.entity';
3
+ export declare class SocialAccount extends BaseSocialAccount {
4
+ id: number;
5
+ userId: number;
6
+ provider: string;
7
+ providerId: string;
8
+ providerEmail?: string | null;
9
+ linkedAt: Date;
10
+ lastUsedAt?: Date | null;
11
+ metadata?: Record<string, unknown> | null;
12
+ createdAt: Date;
13
+ updatedAt: Date;
14
+ user: User;
15
+ }
16
+ //# sourceMappingURL=social-account.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-account.entity.d.ts","sourceRoot":"","sources":["../../src/entities/social-account.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQrC,qBAIa,aAAc,SAAQ,iBAAiB;IAE1C,EAAE,EAAE,MAAM,CAAC;IAGX,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B,QAAQ,EAAE,IAAI,CAAC;IAGf,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAG1C,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;IAIxB,IAAI,EAAG,IAAI,CAAC;CACb"}
@@ -0,0 +1,76 @@
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.SocialAccount = 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 SocialAccount = class SocialAccount extends core_1.BaseSocialAccount {
17
+ user;
18
+ };
19
+ exports.SocialAccount = SocialAccount;
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
22
+ __metadata("design:type", Number)
23
+ ], SocialAccount.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'int' }),
26
+ __metadata("design:type", Number)
27
+ ], SocialAccount.prototype, "userId", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
30
+ __metadata("design:type", String)
31
+ ], SocialAccount.prototype, "provider", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
34
+ __metadata("design:type", String)
35
+ ], SocialAccount.prototype, "providerId", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
38
+ __metadata("design:type", Object)
39
+ ], SocialAccount.prototype, "providerEmail", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6 }),
42
+ __metadata("design:type", Date)
43
+ ], SocialAccount.prototype, "linkedAt", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6, nullable: true }),
46
+ __metadata("design:type", Object)
47
+ ], SocialAccount.prototype, "lastUsedAt", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
50
+ __metadata("design:type", Object)
51
+ ], SocialAccount.prototype, "metadata", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamp', precision: 6, default: () => 'CURRENT_TIMESTAMP(6)' }),
54
+ __metadata("design:type", Date)
55
+ ], SocialAccount.prototype, "createdAt", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.UpdateDateColumn)({
58
+ type: 'timestamp',
59
+ precision: 6,
60
+ default: () => 'CURRENT_TIMESTAMP(6)',
61
+ onUpdate: 'CURRENT_TIMESTAMP(6)',
62
+ }),
63
+ __metadata("design:type", Date)
64
+ ], SocialAccount.prototype, "updatedAt", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
67
+ (0, typeorm_1.JoinColumn)({ name: 'userId' }),
68
+ __metadata("design:type", user_entity_1.User)
69
+ ], SocialAccount.prototype, "user", void 0);
70
+ exports.SocialAccount = SocialAccount = __decorate([
71
+ (0, typeorm_1.Entity)('nauth_social_accounts'),
72
+ (0, typeorm_1.Unique)(['provider', 'providerId']),
73
+ (0, typeorm_1.Index)(['userId']),
74
+ (0, typeorm_1.Index)(['providerEmail'])
75
+ ], SocialAccount);
76
+ //# sourceMappingURL=social-account.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-account.entity.js","sourceRoot":"","sources":["../../src/entities/social-account.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAUiB;AACjB,8CAAwD;AACxD,+CAAqC;AAY9B,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,wBAAiB;IAsClD,IAAI,CAAQ;CACb,CAAA;AAvCY,sCAAa;AAEhB;IADP,IAAA,gCAAsB,GAAE;;yCACN;AAGX;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;6CACD;AAGf;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;+CACf;AAGjB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,G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;GACZ,aAAa,CAuCzB"}
@@ -0,0 +1,9 @@
1
+ import { BaseStorageLock } from '@nauth-toolkit/core';
2
+ export declare class StorageLock extends BaseStorageLock {
3
+ id: number;
4
+ key: string;
5
+ value: string;
6
+ expiresAt: Date | null;
7
+ createdAt: Date;
8
+ }
9
+ //# sourceMappingURL=storage-lock.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-lock.entity.d.ts","sourceRoot":"","sources":["../../src/entities/storage-lock.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAQtD,qBAGa,WAAY,SAAQ,eAAe;IAEtC,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,MAAM,CAAC;IAGd,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,SAAS,EAAE,IAAI,CAAC;CACzB"}
@@ -0,0 +1,43 @@
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.StorageLock = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const core_1 = require("@nauth-toolkit/core");
15
+ let StorageLock = class StorageLock extends core_1.BaseStorageLock {
16
+ };
17
+ exports.StorageLock = StorageLock;
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
20
+ __metadata("design:type", Number)
21
+ ], StorageLock.prototype, "id", void 0);
22
+ __decorate([
23
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
24
+ __metadata("design:type", String)
25
+ ], StorageLock.prototype, "key", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.Column)({ type: 'text' }),
28
+ __metadata("design:type", String)
29
+ ], StorageLock.prototype, "value", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6, name: 'expiresAt', nullable: true }),
32
+ __metadata("design:type", Object)
33
+ ], StorageLock.prototype, "expiresAt", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamp', precision: 6, name: 'createdAt', default: () => 'CURRENT_TIMESTAMP(6)' }),
36
+ __metadata("design:type", Date)
37
+ ], StorageLock.prototype, "createdAt", void 0);
38
+ exports.StorageLock = StorageLock = __decorate([
39
+ (0, typeorm_1.Entity)('nauth_storage_locks'),
40
+ (0, typeorm_1.Index)(['key'], { unique: true }),
41
+ (0, typeorm_1.Index)(['expiresAt'])
42
+ ], StorageLock);
43
+ //# sourceMappingURL=storage-lock.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-lock.entity.js","sourceRoot":"","sources":["../../src/entities/storage-lock.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0F;AAC1F,8CAAsD;AAW/C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,sBAAe;CAe/C,CAAA;AAfY,kCAAW;AAEd;IADP,IAAA,gCAAsB,GAAE;;uCACN;AAGX;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;wCACrB;AAGZ;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACH;AAGd;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAChD;AAGvB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;8BAC7F,IAAI;8CAAC;sBAdb,WAAW;IAHvB,IAAA,gBAAM,EAAC,qBAAqB,CAAC;IAC7B,IAAA,eAAK,EAAC,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChC,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;GACR,WAAW,CAevB"}
@@ -0,0 +1,20 @@
1
+ import { BaseTrustedDevice } from '@nauth-toolkit/core';
2
+ import { User } from './user.entity';
3
+ export declare class TrustedDevice extends BaseTrustedDevice {
4
+ id: number;
5
+ userId: number;
6
+ user: User;
7
+ deviceTokenHash: string;
8
+ deviceId?: string | null;
9
+ deviceName?: string | null;
10
+ deviceType?: string | null;
11
+ ipAddress?: string | null;
12
+ userAgent?: string | null;
13
+ platform?: string | null;
14
+ browser?: string | null;
15
+ trustedUntil: Date;
16
+ lastUsedAt?: Date | null;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }
20
+ //# sourceMappingURL=trusted-device.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-device.entity.d.ts","sourceRoot":"","sources":["../../src/entities/trusted-device.entity.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQrC,qBAMa,aAAc,SAAQ,iBAAiB;IAE1C,EAAE,EAAE,MAAM,CAAC;IAGX,MAAM,EAAE,MAAM,CAAC;IAIvB,IAAI,EAAG,IAAI,CAAC;IAGJ,eAAe,EAAE,MAAM,CAAC;IAGxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,YAAY,EAAE,IAAI,CAAC;IAGnB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGzB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACzB"}