@nest-boot/auth 7.9.2 → 7.9.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/dist/adapters/mikro-orm-adapter.d.ts +4 -0
- package/dist/adapters/mikro-orm-adapter.js.map +1 -1
- package/dist/auth-module-options.interface.d.ts +9 -0
- package/dist/auth.constants.d.ts +2 -0
- package/dist/auth.constants.js +2 -0
- package/dist/auth.constants.js.map +1 -1
- package/dist/auth.guard.d.ts +15 -0
- package/dist/auth.guard.js +15 -0
- package/dist/auth.guard.js.map +1 -1
- package/dist/auth.middleware.d.ts +21 -0
- package/dist/auth.middleware.js +21 -0
- package/dist/auth.middleware.js.map +1 -1
- package/dist/auth.module-definition.d.ts +1 -1
- package/dist/auth.module-definition.js +2 -2
- package/dist/auth.module-definition.js.map +1 -1
- package/dist/auth.module.d.ts +28 -1
- package/dist/auth.module.js +30 -0
- package/dist/auth.module.js.map +1 -1
- package/dist/auth.service.d.ts +7 -0
- package/dist/auth.service.js +6 -0
- package/dist/auth.service.js.map +1 -1
- package/dist/auth.transaction-context.d.ts +24 -5
- package/dist/auth.transaction-context.js +16 -0
- package/dist/auth.transaction-context.js.map +1 -1
- package/dist/decorators/current-session.decorator.d.ts +1 -0
- package/dist/decorators/current-session.decorator.js +1 -0
- package/dist/decorators/current-session.decorator.js.map +1 -1
- package/dist/decorators/current-user.decorator.d.ts +1 -0
- package/dist/decorators/current-user.decorator.js +1 -0
- package/dist/decorators/current-user.decorator.js.map +1 -1
- package/dist/decorators/public.decorator.d.ts +1 -0
- package/dist/decorators/public.decorator.js +1 -0
- package/dist/decorators/public.decorator.js.map +1 -1
- package/dist/entities/account.entity.d.ts +20 -0
- package/dist/entities/account.entity.js +10 -0
- package/dist/entities/account.entity.js.map +1 -1
- package/dist/entities/session.entity.d.ts +15 -0
- package/dist/entities/session.entity.js +10 -0
- package/dist/entities/session.entity.js.map +1 -1
- package/dist/entities/user.entity.d.ts +14 -0
- package/dist/entities/user.entity.js +10 -0
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/verification.entity.d.ts +13 -0
- package/dist/entities/verification.entity.js +10 -0
- package/dist/entities/verification.entity.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -6
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { BaseEntity, Opt } from "@mikro-orm/core";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base entity for user session records.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maps to the better-auth `session` model. Each session is tied to a
|
|
7
|
+
* {@link BaseUser} and identified by a unique token.
|
|
8
|
+
*/
|
|
2
9
|
export declare class BaseSession extends BaseEntity {
|
|
10
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
3
11
|
id: Opt<string>;
|
|
12
|
+
/** Unique session token used for authentication. */
|
|
4
13
|
token: string;
|
|
14
|
+
/** Foreign key referencing the owning {@link BaseUser}. */
|
|
5
15
|
userId: string;
|
|
16
|
+
/** Timestamp when the session expires. */
|
|
6
17
|
expiresAt: Date;
|
|
18
|
+
/** IP address of the client that created or last used this session. */
|
|
7
19
|
ipAddress?: Opt<string>;
|
|
20
|
+
/** User-Agent header from the client that created or last used this session. */
|
|
8
21
|
userAgent?: Opt<string>;
|
|
22
|
+
/** Timestamp when the session was created. */
|
|
9
23
|
createdAt: Opt<Date>;
|
|
24
|
+
/** Timestamp of the last update. */
|
|
10
25
|
updatedAt: Opt<Date>;
|
|
11
26
|
}
|
|
@@ -12,11 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BaseSession = void 0;
|
|
13
13
|
const core_1 = require("@mikro-orm/core");
|
|
14
14
|
const crypto_1 = require("crypto");
|
|
15
|
+
/**
|
|
16
|
+
* Abstract base entity for user session records.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Maps to the better-auth `session` model. Each session is tied to a
|
|
20
|
+
* {@link BaseUser} and identified by a unique token.
|
|
21
|
+
*/
|
|
15
22
|
let BaseSession = class BaseSession extends core_1.BaseEntity {
|
|
16
23
|
constructor() {
|
|
17
24
|
super(...arguments);
|
|
25
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
18
26
|
this.id = (0, crypto_1.randomUUID)();
|
|
27
|
+
/** Timestamp when the session was created. */
|
|
19
28
|
this.createdAt = new Date();
|
|
29
|
+
/** Timestamp of the last update. */
|
|
20
30
|
this.updatedAt = new Date();
|
|
21
31
|
}
|
|
22
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAUyB;AACzB,mCAAoC;
|
|
1
|
+
{"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAUyB;AACzB,mCAAoC;AAEpC;;;;;;GAMG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,iBAAU;IAApC;;QACL,6CAA6C;QAE7C,OAAE,GAAgB,IAAA,mBAAU,GAAE,CAAC;QA2B/B,8CAA8C;QAE9C,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;QAElC,oCAAoC;QAMpC,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IACpC,CAAC;CAAA,CAAA;AAzCY,kCAAW;AAGtB;IADC,IAAA,iBAAU,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;uCACE;AAK/B;IAFC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAA,aAAM,GAAE;;0CACM;AAQf;IALC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACvB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,cAAO,CAAC,MAAM,CAAC;KAC1B,CAAC;;2CACc;AAIhB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,CAAC;8BACnB,IAAI;8CAAC;AAIjB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACnB;AAIxB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACnB;AAIxB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;8CAClB;AAQlC;IALC,IAAA,eAAQ,EAAC;QACR,IAAI,EAAE,QAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;8CACgC;sBAxCvB,WAAW;IADvB,IAAA,aAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACd,WAAW,CAyCvB"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { BaseEntity, Opt } from "@mikro-orm/core";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base entity for user records.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maps to the better-auth `user` model. Provides core identity fields
|
|
7
|
+
* such as name, email, and avatar, intended to be extended by the application.
|
|
8
|
+
*/
|
|
2
9
|
export declare class BaseUser extends BaseEntity {
|
|
10
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
3
11
|
id: Opt<string>;
|
|
12
|
+
/** Display name of the user. */
|
|
4
13
|
name: string;
|
|
14
|
+
/** Unique email address of the user. */
|
|
5
15
|
email: string;
|
|
16
|
+
/** Whether the email address has been verified. */
|
|
6
17
|
emailVerified: boolean;
|
|
18
|
+
/** URL of the user's avatar image. */
|
|
7
19
|
image?: Opt<string>;
|
|
20
|
+
/** Timestamp when the user was created. */
|
|
8
21
|
createdAt: Opt<Date>;
|
|
22
|
+
/** Timestamp of the last update. */
|
|
9
23
|
updatedAt: Opt<Date>;
|
|
10
24
|
}
|
|
@@ -12,11 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BaseUser = void 0;
|
|
13
13
|
const core_1 = require("@mikro-orm/core");
|
|
14
14
|
const crypto_1 = require("crypto");
|
|
15
|
+
/**
|
|
16
|
+
* Abstract base entity for user records.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Maps to the better-auth `user` model. Provides core identity fields
|
|
20
|
+
* such as name, email, and avatar, intended to be extended by the application.
|
|
21
|
+
*/
|
|
15
22
|
let BaseUser = class BaseUser extends core_1.BaseEntity {
|
|
16
23
|
constructor() {
|
|
17
24
|
super(...arguments);
|
|
25
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
18
26
|
this.id = (0, crypto_1.randomUUID)();
|
|
27
|
+
/** Timestamp when the user was created. */
|
|
19
28
|
this.createdAt = new Date();
|
|
29
|
+
/** Timestamp of the last update. */
|
|
20
30
|
this.updatedAt = new Date();
|
|
21
31
|
}
|
|
22
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAQyB;AACzB,mCAAoC;
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAQyB;AACzB,mCAAoC;AAEpC;;;;;;GAMG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,iBAAU;IAAjC;;QACL,6CAA6C;QAE7C,OAAE,GAAgB,IAAA,mBAA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tokens, password reset tokens, and similar
|
|
7
|
+
* time-limited verification flows managed by better-auth.
|
|
8
|
+
*/
|
|
2
9
|
export declare abstract class BaseVerification extends BaseEntity {
|
|
10
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
3
11
|
id: Opt<string>;
|
|
12
|
+
/** Identifier associated with this verification (e.g. email address). */
|
|
4
13
|
identifier: string;
|
|
14
|
+
/** Verification token value. */
|
|
5
15
|
value: string;
|
|
16
|
+
/** Timestamp when this verification expires. */
|
|
6
17
|
expiresAt: Date;
|
|
18
|
+
/** Timestamp when the verification was created. */
|
|
7
19
|
createdAt: Opt<Date>;
|
|
20
|
+
/** Timestamp of the last update. */
|
|
8
21
|
updatedAt: Opt<Date>;
|
|
9
22
|
}
|
|
@@ -12,11 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BaseVerification = void 0;
|
|
13
13
|
const core_1 = require("@mikro-orm/core");
|
|
14
14
|
const crypto_1 = require("crypto");
|
|
15
|
+
/**
|
|
16
|
+
* Abstract base entity for verification records.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Used for email verification tokens, password reset tokens, and similar
|
|
20
|
+
* time-limited verification flows managed by better-auth.
|
|
21
|
+
*/
|
|
15
22
|
let BaseVerification = class BaseVerification extends core_1.BaseEntity {
|
|
16
23
|
constructor() {
|
|
17
24
|
super(...arguments);
|
|
25
|
+
/** Primary key (UUID v4, auto-generated). */
|
|
18
26
|
this.id = (0, crypto_1.randomUUID)();
|
|
27
|
+
/** Timestamp when the verification was created. */
|
|
19
28
|
this.createdAt = new Date();
|
|
29
|
+
/** Timestamp of the last update. */
|
|
20
30
|
this.updatedAt = new Date();
|
|
21
31
|
}
|
|
22
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.entity.js","sourceRoot":"","sources":["../../src/entities/verification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAOyB;AACzB,mCAAoC;
|
|
1
|
+
{"version":3,"file":"verification.entity.js","sourceRoot":"","sources":["../../src/entities/verification.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAOyB;AACzB,mCAAoC;AAEpC;;;;;;GAMG;AAEI,IAAe,gBAAgB,GAA/B,MAAe,gBAAiB,SAAQ,iBAAU;IAAlD;;QACL,6CAA6C;QAE7C,OAAE,GAAgB,IAAA,mBAAU,GAAE,CAAC;QAc/B,mDAAmD;QAEnD,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;QAElC,oCAAoC;QAMpC,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IACpC,CAAC;CAAA,CAAA;AA5BqB,4CAAgB;AAGpC;IADC,IAAA,iBAAU,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;4CACE;AAI/B;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;oDACP;AAIpB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;+CACZ;AAIf;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,CAAC;8BACnB,IAAI;mDAAC;AAIjB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;mDAClB;AAQlC;IALC,IAAA,eAAQ,EAAC;QACR,IAAI,EAAE,QAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;mDACgC;2BA3Bd,gBAAgB;IADrC,IAAA,aAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACL,gBAAgB,CA4BrC"}
|