@heejun/auth-nest 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 heejun
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,19 @@
1
+ import { AuthService } from '@heejun/auth';
2
+ import { Principal } from '@heejun/contracts';
3
+ import { AuthedRequest } from './http-types';
4
+ export declare class AuthController {
5
+ private readonly auth;
6
+ constructor(auth: AuthService);
7
+ register(body: unknown, req: AuthedRequest): Promise<import("@heejun/auth").AuthResult>;
8
+ login(body: unknown, req: AuthedRequest): Promise<import("@heejun/auth").AuthResult>;
9
+ google(body: unknown, req: AuthedRequest): Promise<import("@heejun/auth").AuthResult>;
10
+ refresh(body: unknown, req: AuthedRequest): Promise<import("@heejun/auth").AuthResult>;
11
+ logout(body: unknown): Promise<void>;
12
+ me(user: Principal | null): {
13
+ userId: string;
14
+ roles: ("guest" | "member" | "moderator" | "admin" | "owner")[];
15
+ orgId?: string | undefined;
16
+ email?: string | undefined;
17
+ } | null;
18
+ }
19
+ //# sourceMappingURL=auth.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../src/auth.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAI7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAO5C,qBACa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAG9C,QAAQ,CAAS,IAAI,EAAE,OAAO,EAAS,GAAG,EAAE,aAAa;IAKzD,KAAK,CAAS,IAAI,EAAE,OAAO,EAAS,GAAG,EAAE,aAAa;IAKtD,MAAM,CAAS,IAAI,EAAE,OAAO,EAAS,GAAG,EAAE,aAAa;IAKvD,OAAO,CAAS,IAAI,EAAE,OAAO,EAAS,GAAG,EAAE,aAAa;IAMlD,MAAM,CAAS,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlD,EAAE,CAAgB,IAAI,EAAE,SAAS,GAAG,IAAI;;;;;;CAGzC"}
@@ -0,0 +1,99 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AuthController = void 0;
16
+ const auth_1 = require("@heejun/auth");
17
+ const common_1 = require("@nestjs/common");
18
+ const current_user_decorator_1 = require("./current-user.decorator");
19
+ const jwt_auth_guard_1 = require("./jwt-auth.guard");
20
+ function userAgent(req) {
21
+ return req.headers['user-agent'];
22
+ }
23
+ let AuthController = class AuthController {
24
+ constructor(auth) {
25
+ this.auth = auth;
26
+ }
27
+ register(body, req) {
28
+ return this.auth.register(body, userAgent(req));
29
+ }
30
+ login(body, req) {
31
+ return this.auth.login(body, userAgent(req));
32
+ }
33
+ google(body, req) {
34
+ return this.auth.loginWithGoogle(body, userAgent(req));
35
+ }
36
+ refresh(body, req) {
37
+ return this.auth.refresh(body, userAgent(req));
38
+ }
39
+ async logout(body) {
40
+ await this.auth.logout(body);
41
+ }
42
+ me(user) {
43
+ return user;
44
+ }
45
+ };
46
+ exports.AuthController = AuthController;
47
+ __decorate([
48
+ (0, common_1.Post)('register'),
49
+ __param(0, (0, common_1.Body)()),
50
+ __param(1, (0, common_1.Req)()),
51
+ __metadata("design:type", Function),
52
+ __metadata("design:paramtypes", [Object, Object]),
53
+ __metadata("design:returntype", void 0)
54
+ ], AuthController.prototype, "register", null);
55
+ __decorate([
56
+ (0, common_1.Post)('login'),
57
+ __param(0, (0, common_1.Body)()),
58
+ __param(1, (0, common_1.Req)()),
59
+ __metadata("design:type", Function),
60
+ __metadata("design:paramtypes", [Object, Object]),
61
+ __metadata("design:returntype", void 0)
62
+ ], AuthController.prototype, "login", null);
63
+ __decorate([
64
+ (0, common_1.Post)('google'),
65
+ __param(0, (0, common_1.Body)()),
66
+ __param(1, (0, common_1.Req)()),
67
+ __metadata("design:type", Function),
68
+ __metadata("design:paramtypes", [Object, Object]),
69
+ __metadata("design:returntype", void 0)
70
+ ], AuthController.prototype, "google", null);
71
+ __decorate([
72
+ (0, common_1.Post)('refresh'),
73
+ __param(0, (0, common_1.Body)()),
74
+ __param(1, (0, common_1.Req)()),
75
+ __metadata("design:type", Function),
76
+ __metadata("design:paramtypes", [Object, Object]),
77
+ __metadata("design:returntype", void 0)
78
+ ], AuthController.prototype, "refresh", null);
79
+ __decorate([
80
+ (0, common_1.Post)('logout'),
81
+ (0, common_1.HttpCode)(204),
82
+ __param(0, (0, common_1.Body)()),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", [Object]),
85
+ __metadata("design:returntype", Promise)
86
+ ], AuthController.prototype, "logout", null);
87
+ __decorate([
88
+ (0, common_1.Get)('me'),
89
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
90
+ __param(0, (0, current_user_decorator_1.CurrentUser)()),
91
+ __metadata("design:type", Function),
92
+ __metadata("design:paramtypes", [Object]),
93
+ __metadata("design:returntype", void 0)
94
+ ], AuthController.prototype, "me", null);
95
+ exports.AuthController = AuthController = __decorate([
96
+ (0, common_1.Controller)('auth'),
97
+ __metadata("design:paramtypes", [auth_1.AuthService])
98
+ ], AuthController);
99
+ //# sourceMappingURL=auth.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../src/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA0C;AAE1C,2CAAsF;AAEtF,qEAAsD;AAEtD,qDAA+C;AAE/C,SAAS,SAAS,CAAC,GAAkB;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;AAClC,CAAC;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAGlD,QAAQ,CAAS,IAAa,EAAS,GAAkB;QACvD,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IACjD,CAAC;IAGD,KAAK,CAAS,IAAa,EAAS,GAAkB;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IAC9C,CAAC;IAGD,MAAM,CAAS,IAAa,EAAS,GAAkB;QACrD,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IACxD,CAAC;IAGD,OAAO,CAAS,IAAa,EAAS,GAAkB;QACtD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IAChD,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CAAS,IAAa;QAChC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAID,EAAE,CAAgB,IAAsB;QACtC,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAlCY,wCAAc;AAIzB;IADC,IAAA,aAAI,EAAC,UAAU,CAAC;IACP,WAAA,IAAA,aAAI,GAAE,CAAA;IAAiB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;8CAErC;AAGD;IADC,IAAA,aAAI,EAAC,OAAO,CAAC;IACP,WAAA,IAAA,aAAI,GAAE,CAAA;IAAiB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;2CAElC;AAGD;IADC,IAAA,aAAI,EAAC,QAAQ,CAAC;IACP,WAAA,IAAA,aAAI,GAAE,CAAA;IAAiB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;4CAEnC;AAGD;IADC,IAAA,aAAI,EAAC,SAAS,CAAC;IACP,WAAA,IAAA,aAAI,GAAE,CAAA;IAAiB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6CAEpC;AAIK;IAFL,IAAA,aAAI,EAAC,QAAQ,CAAC;IACd,IAAA,iBAAQ,EAAC,GAAG,CAAC;IACA,WAAA,IAAA,aAAI,GAAE,CAAA;;;;4CAEnB;AAID;IAFC,IAAA,YAAG,EAAC,IAAI,CAAC;IACT,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACpB,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;wCAEhB;yBAjCU,cAAc;IAD1B,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAEkB,kBAAW;GADnC,cAAc,CAkC1B"}
@@ -0,0 +1,22 @@
1
+ import { AuthServiceConfig, JwtConfig, OAuthVerifier, PasswordHasher, SessionStore, UserStore } from '@heejun/auth';
2
+ import { DynamicModule } from '@nestjs/common';
3
+ export interface AuthModuleOptions {
4
+ jwt: JwtConfig;
5
+ users: UserStore;
6
+ sessions: SessionStore;
7
+ hasher?: PasswordHasher;
8
+ oauth?: OAuthVerifier;
9
+ config?: AuthServiceConfig;
10
+ /** false 면 컨트롤러를 등록하지 않음(서비스/가드만 사용). */
11
+ registerController?: boolean;
12
+ /** DomainError→HTTP 필터 자동 등록(기본 true). */
13
+ registerExceptionFilter?: boolean;
14
+ }
15
+ /**
16
+ * AuthModule.forRoot({ jwt, users, sessions, oauth }) 로 인증 일체를 마운트.
17
+ * users/sessions 는 호스트가 어댑터(in-memory·@heejun/auth/drizzle 등)로 주입.
18
+ */
19
+ export declare class AuthModule {
20
+ static forRoot(options: AuthModuleOptions): DynamicModule;
21
+ }
22
+ //# sourceMappingURL=auth.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EAET,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,SAAS,EACV,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAoB,MAAM,gBAAgB,CAAA;AAQhE,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,SAAS,CAAA;IACd,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,0CAA0C;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC;AAED;;;GAGG;AACH,qBACa,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa;CA0B1D"}
@@ -0,0 +1,51 @@
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 AuthModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AuthModule = void 0;
11
+ const auth_1 = require("@heejun/auth");
12
+ const common_1 = require("@nestjs/common");
13
+ const core_1 = require("@nestjs/core");
14
+ const auth_controller_1 = require("./auth.controller");
15
+ const domain_exception_filter_1 = require("./domain-exception.filter");
16
+ const jwt_auth_guard_1 = require("./jwt-auth.guard");
17
+ const roles_guard_1 = require("./roles.guard");
18
+ /**
19
+ * AuthModule.forRoot({ jwt, users, sessions, oauth }) 로 인증 일체를 마운트.
20
+ * users/sessions 는 호스트가 어댑터(in-memory·@heejun/auth/drizzle 등)로 주입.
21
+ */
22
+ let AuthModule = AuthModule_1 = class AuthModule {
23
+ static forRoot(options) {
24
+ const authServiceProvider = {
25
+ provide: auth_1.AuthService,
26
+ useFactory: () => new auth_1.AuthService({
27
+ users: options.users,
28
+ sessions: options.sessions,
29
+ hasher: options.hasher ?? new auth_1.ScryptHasher(),
30
+ jwt: new auth_1.JwtService(options.jwt),
31
+ oauth: options.oauth,
32
+ config: options.config,
33
+ }),
34
+ };
35
+ const providers = [authServiceProvider, jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard];
36
+ if (options.registerExceptionFilter !== false) {
37
+ providers.push({ provide: core_1.APP_FILTER, useClass: domain_exception_filter_1.DomainExceptionFilter });
38
+ }
39
+ return {
40
+ module: AuthModule_1,
41
+ controllers: options.registerController === false ? [] : [auth_controller_1.AuthController],
42
+ providers,
43
+ exports: [auth_1.AuthService, jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard],
44
+ };
45
+ }
46
+ };
47
+ exports.AuthModule = AuthModule;
48
+ exports.AuthModule = AuthModule = AuthModule_1 = __decorate([
49
+ (0, common_1.Module)({})
50
+ ], AuthModule);
51
+ //# sourceMappingURL=auth.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uCAUqB;AACrB,2CAAgE;AAChE,uCAAyC;AAEzC,uDAAkD;AAClD,uEAAiE;AACjE,qDAA+C;AAC/C,+CAA0C;AAe1C;;;GAGG;AAEI,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,OAA0B;QACvC,MAAM,mBAAmB,GAAa;YACpC,OAAO,EAAE,kBAAW;YACpB,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,kBAAW,CAAC;gBACd,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI,mBAAY,EAAE;gBAC5C,GAAG,EAAE,IAAI,iBAAU,CAAC,OAAO,CAAC,GAAG,CAAC;gBAChC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC;SACL,CAAA;QAED,MAAM,SAAS,GAAe,CAAC,mBAAmB,EAAE,6BAAY,EAAE,wBAAU,CAAC,CAAA;QAC7E,IAAI,OAAO,CAAC,uBAAuB,KAAK,KAAK,EAAE,CAAC;YAC9C,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,iBAAU,EAAE,QAAQ,EAAE,+CAAqB,EAAE,CAAC,CAAA;QAC1E,CAAC;QAED,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,WAAW,EAAE,OAAO,CAAC,kBAAkB,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gCAAc,CAAC;YACzE,SAAS;YACT,OAAO,EAAE,CAAC,kBAAW,EAAE,6BAAY,EAAE,wBAAU,CAAC;SACjD,CAAA;IACH,CAAC;CACF,CAAA;AA3BY,gCAAU;qBAAV,UAAU;IADtB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CA2BtB"}
@@ -0,0 +1,3 @@
1
+ /** Authorization 헤더에서 Bearer 토큰 추출(순수 함수, 테스트 대상). */
2
+ export declare function extractBearerToken(authorization?: string | null): string | null;
3
+ //# sourceMappingURL=bearer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bearer.d.ts","sourceRoot":"","sources":["../src/bearer.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAM/E"}
package/dist/bearer.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractBearerToken = extractBearerToken;
4
+ /** Authorization 헤더에서 Bearer 토큰 추출(순수 함수, 테스트 대상). */
5
+ function extractBearerToken(authorization) {
6
+ if (!authorization)
7
+ return null;
8
+ const [scheme, token] = authorization.split(' ');
9
+ if (!scheme || scheme.toLowerCase() !== 'bearer' || !token)
10
+ return null;
11
+ const trimmed = token.trim();
12
+ return trimmed.length > 0 ? trimmed : null;
13
+ }
14
+ //# sourceMappingURL=bearer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bearer.js","sourceRoot":"","sources":["../src/bearer.ts"],"names":[],"mappings":";;AACA,gDAMC;AAPD,sDAAsD;AACtD,SAAgB,kBAAkB,CAAC,aAA6B;IAC9D,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAA;IAC/B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAChD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC5B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;AAC5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** 가드가 주입한 principal 을 핸들러 인자로 꺼낸다. */
2
+ export declare const CurrentUser: (...dataOrPipes: unknown[]) => ParameterDecorator;
3
+ //# sourceMappingURL=current-user.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-user.decorator.d.ts","sourceRoot":"","sources":["../src/current-user.decorator.ts"],"names":[],"mappings":"AAIA,uCAAuC;AACvC,eAAO,MAAM,WAAW,mDAKvB,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CurrentUser = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ /** 가드가 주입한 principal 을 핸들러 인자로 꺼낸다. */
6
+ exports.CurrentUser = (0, common_1.createParamDecorator)((_data, ctx) => {
7
+ const req = ctx.switchToHttp().getRequest();
8
+ return req.principal ?? null;
9
+ });
10
+ //# sourceMappingURL=current-user.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-user.decorator.js","sourceRoot":"","sources":["../src/current-user.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AAIvE,uCAAuC;AAC1B,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC7C,CAAC,KAAc,EAAE,GAAqB,EAAoB,EAAE;IAC1D,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAA6B,CAAA;IACtE,OAAO,GAAG,CAAC,SAAS,IAAI,IAAI,CAAA;AAC9B,CAAC,CACF,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { DomainError } from '@heejun/core-server';
2
+ import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
3
+ /** core-server DomainError 를 적절한 HTTP 상태/바디로 매핑. */
4
+ export declare class DomainExceptionFilter implements ExceptionFilter {
5
+ catch(err: DomainError, host: ArgumentsHost): void;
6
+ }
7
+ //# sourceMappingURL=domain-exception.filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-exception.filter.d.ts","sourceRoot":"","sources":["../src/domain-exception.filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAS,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAItE,oDAAoD;AACpD,qBACa,qBAAsB,YAAW,eAAe;IAC3D,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI;CAInD"}
@@ -0,0 +1,23 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DomainExceptionFilter = void 0;
10
+ const core_server_1 = require("@heejun/core-server");
11
+ const common_1 = require("@nestjs/common");
12
+ /** core-server DomainError 를 적절한 HTTP 상태/바디로 매핑. */
13
+ let DomainExceptionFilter = class DomainExceptionFilter {
14
+ catch(err, host) {
15
+ const res = host.switchToHttp().getResponse();
16
+ res.status(err.httpStatus).json(err.toBody());
17
+ }
18
+ };
19
+ exports.DomainExceptionFilter = DomainExceptionFilter;
20
+ exports.DomainExceptionFilter = DomainExceptionFilter = __decorate([
21
+ (0, common_1.Catch)(core_server_1.DomainError)
22
+ ], DomainExceptionFilter);
23
+ //# sourceMappingURL=domain-exception.filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-exception.filter.js","sourceRoot":"","sources":["../src/domain-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAAiD;AACjD,2CAAsE;AAItE,oDAAoD;AAE7C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,KAAK,CAAC,GAAgB,EAAE,IAAmB;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,WAAW,EAAgB,CAAA;QAC3D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/C,CAAC;CACF,CAAA;AALY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,cAAK,EAAC,yBAAW,CAAC;GACN,qBAAqB,CAKjC"}
@@ -0,0 +1,12 @@
1
+ import type { Principal } from '@heejun/contracts';
2
+ /** 프레임워크 비의존 요청/응답 최소 형태(express 타입 의존 회피). */
3
+ export interface AuthedRequest {
4
+ headers: Record<string, string | undefined>;
5
+ principal?: Principal;
6
+ }
7
+ export interface JsonResponse {
8
+ status(code: number): {
9
+ json(body: unknown): void;
10
+ };
11
+ }
12
+ //# sourceMappingURL=http-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-types.d.ts","sourceRoot":"","sources":["../src/http-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,+CAA+C;AAC/C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC3C,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAA;CACpD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=http-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-types.js","sourceRoot":"","sources":["../src/http-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export { AuthModule, type AuthModuleOptions } from './auth.module';
2
+ export { AuthController } from './auth.controller';
3
+ export { JwtAuthGuard } from './jwt-auth.guard';
4
+ export { RolesGuard, Roles, ROLES_KEY } from './roles.guard';
5
+ export { CurrentUser } from './current-user.decorator';
6
+ export { DomainExceptionFilter } from './domain-exception.filter';
7
+ export { extractBearerToken } from './bearer';
8
+ export type { AuthedRequest, JsonResponse } from './http-types';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC7C,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractBearerToken = exports.DomainExceptionFilter = exports.CurrentUser = exports.ROLES_KEY = exports.Roles = exports.RolesGuard = exports.JwtAuthGuard = exports.AuthController = exports.AuthModule = void 0;
4
+ var auth_module_1 = require("./auth.module");
5
+ Object.defineProperty(exports, "AuthModule", { enumerable: true, get: function () { return auth_module_1.AuthModule; } });
6
+ var auth_controller_1 = require("./auth.controller");
7
+ Object.defineProperty(exports, "AuthController", { enumerable: true, get: function () { return auth_controller_1.AuthController; } });
8
+ var jwt_auth_guard_1 = require("./jwt-auth.guard");
9
+ Object.defineProperty(exports, "JwtAuthGuard", { enumerable: true, get: function () { return jwt_auth_guard_1.JwtAuthGuard; } });
10
+ var roles_guard_1 = require("./roles.guard");
11
+ Object.defineProperty(exports, "RolesGuard", { enumerable: true, get: function () { return roles_guard_1.RolesGuard; } });
12
+ Object.defineProperty(exports, "Roles", { enumerable: true, get: function () { return roles_guard_1.Roles; } });
13
+ Object.defineProperty(exports, "ROLES_KEY", { enumerable: true, get: function () { return roles_guard_1.ROLES_KEY; } });
14
+ var current_user_decorator_1 = require("./current-user.decorator");
15
+ Object.defineProperty(exports, "CurrentUser", { enumerable: true, get: function () { return current_user_decorator_1.CurrentUser; } });
16
+ var domain_exception_filter_1 = require("./domain-exception.filter");
17
+ Object.defineProperty(exports, "DomainExceptionFilter", { enumerable: true, get: function () { return domain_exception_filter_1.DomainExceptionFilter; } });
18
+ var bearer_1 = require("./bearer");
19
+ Object.defineProperty(exports, "extractBearerToken", { enumerable: true, get: function () { return bearer_1.extractBearerToken; } });
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6CAAkE;AAAzD,yGAAA,UAAU,OAAA;AACnB,qDAAkD;AAAzC,iHAAA,cAAc,OAAA;AACvB,mDAA+C;AAAtC,8GAAA,YAAY,OAAA;AACrB,6CAA4D;AAAnD,yGAAA,UAAU,OAAA;AAAE,oGAAA,KAAK,OAAA;AAAE,wGAAA,SAAS,OAAA;AACrC,mEAAsD;AAA7C,qHAAA,WAAW,OAAA;AACpB,qEAAiE;AAAxD,gIAAA,qBAAqB,OAAA;AAC9B,mCAA6C;AAApC,4GAAA,kBAAkB,OAAA"}
@@ -0,0 +1,9 @@
1
+ import { AuthService } from '@heejun/auth';
2
+ import { CanActivate, ExecutionContext } from '@nestjs/common';
3
+ /** Bearer 액세스 토큰을 검증해 req.principal 주입. */
4
+ export declare class JwtAuthGuard implements CanActivate {
5
+ private readonly auth;
6
+ constructor(auth: AuthService);
7
+ canActivate(ctx: ExecutionContext): Promise<boolean>;
8
+ }
9
+ //# sourceMappingURL=jwt-auth.guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-auth.guard.d.ts","sourceRoot":"","sources":["../src/jwt-auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAqC,MAAM,gBAAgB,CAAA;AAKjG,2CAA2C;AAC3C,qBACa,YAAa,YAAW,WAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAExC,WAAW,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CAW3D"}
@@ -0,0 +1,40 @@
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.JwtAuthGuard = void 0;
13
+ const auth_1 = require("@heejun/auth");
14
+ const common_1 = require("@nestjs/common");
15
+ const bearer_1 = require("./bearer");
16
+ /** Bearer 액세스 토큰을 검증해 req.principal 주입. */
17
+ let JwtAuthGuard = class JwtAuthGuard {
18
+ constructor(auth) {
19
+ this.auth = auth;
20
+ }
21
+ async canActivate(ctx) {
22
+ const req = ctx.switchToHttp().getRequest();
23
+ const token = (0, bearer_1.extractBearerToken)(req.headers.authorization);
24
+ if (!token)
25
+ throw new common_1.UnauthorizedException();
26
+ try {
27
+ req.principal = await this.auth.verifyAccessToken(token);
28
+ return true;
29
+ }
30
+ catch {
31
+ throw new common_1.UnauthorizedException();
32
+ }
33
+ }
34
+ };
35
+ exports.JwtAuthGuard = JwtAuthGuard;
36
+ exports.JwtAuthGuard = JwtAuthGuard = __decorate([
37
+ (0, common_1.Injectable)(),
38
+ __metadata("design:paramtypes", [auth_1.AuthService])
39
+ ], JwtAuthGuard);
40
+ //# sourceMappingURL=jwt-auth.guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-auth.guard.js","sourceRoot":"","sources":["../src/jwt-auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAA0C;AAC1C,2CAAiG;AAEjG,qCAA6C;AAG7C,2CAA2C;AAEpC,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAA6B,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAElD,KAAK,CAAC,WAAW,CAAC,GAAqB;QACrC,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAiB,CAAA;QAC1D,MAAM,KAAK,GAAG,IAAA,2BAAkB,EAAC,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAC3D,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,8BAAqB,EAAE,CAAA;QAC7C,IAAI,CAAC;YACH,GAAG,CAAC,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;YACxD,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,8BAAqB,EAAE,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAA;AAdY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAEwB,kBAAW;GADnC,YAAY,CAcxB"}
@@ -0,0 +1,12 @@
1
+ import { Role } from '@heejun/contracts';
2
+ import { CanActivate, ExecutionContext } from '@nestjs/common';
3
+ import { Reflector } from '@nestjs/core';
4
+ export declare const ROLES_KEY = "heejun:roles";
5
+ /** 핸들러/컨트롤러에 필요한 역할 표시. JwtAuthGuard 뒤에 둔다. */
6
+ export declare const Roles: (...roles: Role[]) => import("@nestjs/common").CustomDecorator<string>;
7
+ export declare class RolesGuard implements CanActivate {
8
+ private readonly reflector;
9
+ constructor(reflector: Reflector);
10
+ canActivate(ctx: ExecutionContext): boolean;
11
+ }
12
+ //# sourceMappingURL=roles.guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.guard.d.ts","sourceRoot":"","sources":["../src/roles.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EACL,WAAW,EACX,gBAAgB,EAIjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,eAAO,MAAM,SAAS,iBAAiB,CAAA;AAEvC,+CAA+C;AAC/C,eAAO,MAAM,KAAK,GAAI,GAAG,OAAO,IAAI,EAAE,qDAAkC,CAAA;AAExE,qBACa,UAAW,YAAW,WAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,WAAW,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;CAa5C"}
@@ -0,0 +1,44 @@
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.RolesGuard = exports.Roles = exports.ROLES_KEY = void 0;
13
+ const contracts_1 = require("@heejun/contracts");
14
+ const common_1 = require("@nestjs/common");
15
+ const core_1 = require("@nestjs/core");
16
+ exports.ROLES_KEY = 'heejun:roles';
17
+ /** 핸들러/컨트롤러에 필요한 역할 표시. JwtAuthGuard 뒤에 둔다. */
18
+ const Roles = (...roles) => (0, common_1.SetMetadata)(exports.ROLES_KEY, roles);
19
+ exports.Roles = Roles;
20
+ let RolesGuard = class RolesGuard {
21
+ constructor(reflector) {
22
+ this.reflector = reflector;
23
+ }
24
+ canActivate(ctx) {
25
+ const required = this.reflector.getAllAndOverride(exports.ROLES_KEY, [
26
+ ctx.getHandler(),
27
+ ctx.getClass(),
28
+ ]);
29
+ if (!required || required.length === 0)
30
+ return true;
31
+ const req = ctx.switchToHttp().getRequest();
32
+ const principal = req.principal;
33
+ if (!principal || !required.some((role) => (0, contracts_1.hasRole)(principal, role))) {
34
+ throw new common_1.ForbiddenException();
35
+ }
36
+ return true;
37
+ }
38
+ };
39
+ exports.RolesGuard = RolesGuard;
40
+ exports.RolesGuard = RolesGuard = __decorate([
41
+ (0, common_1.Injectable)(),
42
+ __metadata("design:paramtypes", [core_1.Reflector])
43
+ ], RolesGuard);
44
+ //# sourceMappingURL=roles.guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.guard.js","sourceRoot":"","sources":["../src/roles.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA4D;AAC5D,2CAMuB;AACvB,uCAAwC;AAE3B,QAAA,SAAS,GAAG,cAAc,CAAA;AAEvC,+CAA+C;AACxC,MAAM,KAAK,GAAG,CAAC,GAAG,KAAa,EAAE,EAAE,CAAC,IAAA,oBAAW,EAAC,iBAAS,EAAE,KAAK,CAAC,CAAA;AAA3D,QAAA,KAAK,SAAsD;AAGjE,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAA6B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAErD,WAAW,CAAC,GAAqB;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAqB,iBAAS,EAAE;YAC/E,GAAG,CAAC,UAAU,EAAE;YAChB,GAAG,CAAC,QAAQ,EAAE;SACf,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QACnD,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAA6B,CAAA;QACtE,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAA;QAC/B,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAO,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;YACrE,MAAM,IAAI,2BAAkB,EAAE,CAAA;QAChC,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAhBY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;qCAE6B,gBAAS;GADtC,UAAU,CAgBtB"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@heejun/auth-nest",
3
+ "version": "0.1.0",
4
+ "description": "NestJS 어댑터: AuthModule·AuthController·JwtAuthGuard·RolesGuard·@CurrentUser (tsc 빌드, 데코레이터 메타데이터 보존)",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "dependencies": {
11
+ "@heejun/auth": "0.1.0",
12
+ "@heejun/core-server": "0.1.0",
13
+ "@heejun/contracts": "0.1.0"
14
+ },
15
+ "peerDependencies": {
16
+ "@nestjs/common": "^11.0.0",
17
+ "@nestjs/core": "^11.0.0",
18
+ "reflect-metadata": "^0.2.0"
19
+ },
20
+ "devDependencies": {
21
+ "@nestjs/common": "^11.0.0",
22
+ "@nestjs/core": "^11.0.0",
23
+ "reflect-metadata": "^0.2.2",
24
+ "rxjs": "^7.8.0"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc -p tsconfig.build.json",
31
+ "dev": "tsc -p tsconfig.build.json --watch",
32
+ "typecheck": "tsc --noEmit",
33
+ "test": "vitest run"
34
+ }
35
+ }