@lenne.tech/nest-server 11.8.0 → 11.10.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/dist/config.env.js +5 -0
- package/dist/config.env.js.map +1 -1
- package/dist/core/common/helpers/logging.helper.d.ts +6 -0
- package/dist/core/common/helpers/logging.helper.js +55 -0
- package/dist/core/common/helpers/logging.helper.js.map +1 -0
- package/dist/core/common/interfaces/server-options.interface.d.ts +50 -19
- package/dist/core/modules/auth/guards/roles.guard.js +37 -5
- package/dist/core/modules/auth/guards/roles.guard.js.map +1 -1
- package/dist/core/modules/auth/services/core-auth.service.d.ts +5 -5
- package/dist/core/modules/auth/services/core-auth.service.js +9 -8
- package/dist/core/modules/auth/services/core-auth.service.js.map +1 -1
- package/dist/core/modules/auth/tokens.decorator.d.ts +1 -1
- package/dist/core/modules/better-auth/better-auth.config.js +32 -10
- package/dist/core/modules/better-auth/better-auth.config.js.map +1 -1
- package/dist/core/modules/better-auth/better-auth.resolver.d.ts +16 -16
- package/dist/core/modules/better-auth/better-auth.resolver.js +34 -34
- package/dist/core/modules/better-auth/better-auth.resolver.js.map +1 -1
- package/dist/core/modules/better-auth/better-auth.types.d.ts +2 -1
- package/dist/core/modules/better-auth/better-auth.types.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-api.middleware.d.ts +10 -0
- package/dist/core/modules/better-auth/core-better-auth-api.middleware.js +91 -0
- package/dist/core/modules/better-auth/core-better-auth-api.middleware.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth-auth.model.d.ts +9 -0
- package/dist/core/modules/better-auth/{better-auth-auth.model.js → core-better-auth-auth.model.js} +17 -17
- package/dist/core/modules/better-auth/core-better-auth-auth.model.js.map +1 -0
- package/dist/core/modules/better-auth/{better-auth-migration-status.model.d.ts → core-better-auth-migration-status.model.d.ts} +1 -1
- package/dist/core/modules/better-auth/{better-auth-migration-status.model.js → core-better-auth-migration-status.model.js} +14 -14
- package/dist/core/modules/better-auth/core-better-auth-migration-status.model.js.map +1 -0
- package/dist/core/modules/better-auth/{better-auth-models.d.ts → core-better-auth-models.d.ts} +8 -8
- package/dist/core/modules/better-auth/{better-auth-models.js → core-better-auth-models.js} +61 -61
- package/dist/core/modules/better-auth/core-better-auth-models.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth-rate-limit.middleware.d.ts +12 -0
- package/dist/core/modules/better-auth/{better-auth-rate-limit.middleware.js → core-better-auth-rate-limit.middleware.js} +10 -10
- package/dist/core/modules/better-auth/core-better-auth-rate-limit.middleware.js.map +1 -0
- package/dist/core/modules/better-auth/{better-auth-rate-limiter.service.d.ts → core-better-auth-rate-limiter.service.d.ts} +1 -1
- package/dist/core/modules/better-auth/{better-auth-rate-limiter.service.js → core-better-auth-rate-limiter.service.js} +8 -8
- package/dist/core/modules/better-auth/core-better-auth-rate-limiter.service.js.map +1 -0
- package/dist/core/modules/better-auth/{better-auth-user.mapper.d.ts → core-better-auth-user.mapper.d.ts} +1 -1
- package/dist/core/modules/better-auth/{better-auth-user.mapper.js → core-better-auth-user.mapper.js} +10 -9
- package/dist/core/modules/better-auth/core-better-auth-user.mapper.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth-web.helper.d.ts +19 -0
- package/dist/core/modules/better-auth/core-better-auth-web.helper.js +152 -0
- package/dist/core/modules/better-auth/core-better-auth-web.helper.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth.controller.d.ts +23 -32
- package/dist/core/modules/better-auth/core-better-auth.controller.js +184 -201
- package/dist/core/modules/better-auth/core-better-auth.controller.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth.middleware.d.ts +22 -0
- package/dist/core/modules/better-auth/{better-auth.middleware.js → core-better-auth.middleware.js} +45 -18
- package/dist/core/modules/better-auth/core-better-auth.middleware.js.map +1 -0
- package/dist/core/modules/better-auth/{better-auth.module.d.ts → core-better-auth.module.d.ts} +6 -6
- package/dist/core/modules/better-auth/{better-auth.module.js → core-better-auth.module.js} +65 -60
- package/dist/core/modules/better-auth/core-better-auth.module.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth.resolver.d.ts +19 -19
- package/dist/core/modules/better-auth/core-better-auth.resolver.js +18 -18
- package/dist/core/modules/better-auth/core-better-auth.resolver.js.map +1 -1
- package/dist/core/modules/better-auth/{better-auth.service.d.ts → core-better-auth.service.d.ts} +3 -2
- package/dist/core/modules/better-auth/{better-auth.service.js → core-better-auth.service.js} +75 -35
- package/dist/core/modules/better-auth/core-better-auth.service.js.map +1 -0
- package/dist/core/modules/better-auth/index.d.ts +11 -9
- package/dist/core/modules/better-auth/index.js +11 -9
- package/dist/core/modules/better-auth/index.js.map +1 -1
- package/dist/core/modules/error-code/core-error-code.controller.d.ts +7 -0
- package/dist/core/modules/error-code/core-error-code.controller.js +45 -0
- package/dist/core/modules/error-code/core-error-code.controller.js.map +1 -0
- package/dist/core/modules/error-code/core-error-code.service.d.ts +16 -0
- package/dist/core/modules/error-code/core-error-code.service.js +65 -0
- package/dist/core/modules/error-code/core-error-code.service.js.map +1 -0
- package/dist/core/modules/error-code/error-code.module.d.ts +7 -0
- package/dist/core/modules/error-code/error-code.module.js +64 -0
- package/dist/core/modules/error-code/error-code.module.js.map +1 -0
- package/dist/core/modules/error-code/error-codes.d.ts +219 -0
- package/dist/core/modules/error-code/error-codes.js +204 -0
- package/dist/core/modules/error-code/error-codes.js.map +1 -0
- package/dist/core/modules/error-code/index.d.ts +5 -0
- package/dist/core/modules/error-code/index.js +22 -0
- package/dist/core/modules/error-code/index.js.map +1 -0
- package/dist/core/modules/error-code/interfaces/error-code.interfaces.d.ts +12 -0
- package/dist/core/modules/error-code/interfaces/error-code.interfaces.js +3 -0
- package/dist/core/modules/error-code/interfaces/error-code.interfaces.js.map +1 -0
- package/dist/core/modules/user/interfaces/core-user-service-options.interface.d.ts +2 -2
- package/dist/core.module.js +14 -6
- package/dist/core.module.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/server/modules/better-auth/better-auth.controller.d.ts +5 -5
- package/dist/server/modules/better-auth/better-auth.controller.js +4 -4
- package/dist/server/modules/better-auth/better-auth.controller.js.map +1 -1
- package/dist/server/modules/better-auth/better-auth.module.js +3 -3
- package/dist/server/modules/better-auth/better-auth.module.js.map +1 -1
- package/dist/server/modules/better-auth/better-auth.resolver.d.ts +17 -17
- package/dist/server/modules/better-auth/better-auth.resolver.js +18 -18
- package/dist/server/modules/better-auth/better-auth.resolver.js.map +1 -1
- package/dist/server/modules/error-code/error-code.controller.d.ts +8 -0
- package/dist/server/modules/error-code/error-code.controller.js +55 -0
- package/dist/server/modules/error-code/error-code.controller.js.map +1 -0
- package/dist/server/modules/error-code/error-code.service.d.ts +4 -0
- package/dist/server/modules/error-code/error-code.service.js +27 -0
- package/dist/server/modules/error-code/error-code.service.js.map +1 -0
- package/dist/server/modules/error-code/error-codes.d.ts +45 -0
- package/dist/server/modules/error-code/error-codes.js +24 -0
- package/dist/server/modules/error-code/error-codes.js.map +1 -0
- package/dist/server/modules/error-code/index.d.ts +3 -0
- package/dist/server/modules/error-code/index.js +20 -0
- package/dist/server/modules/error-code/index.js.map +1 -0
- package/dist/server/modules/user/user.service.d.ts +2 -2
- package/dist/server/modules/user/user.service.js +2 -2
- package/dist/server/modules/user/user.service.js.map +1 -1
- package/dist/server/server.module.js +7 -0
- package/dist/server/server.module.js.map +1 -1
- package/dist/test/test.helper.d.ts +1 -0
- package/dist/test/test.helper.js +5 -1
- package/dist/test/test.helper.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/src/config.env.ts +19 -0
- package/src/core/common/helpers/logging.helper.ts +134 -0
- package/src/core/common/interfaces/server-options.interface.ts +511 -237
- package/src/core/modules/auth/guards/roles.guard.ts +49 -7
- package/src/core/modules/auth/services/core-auth.service.ts +9 -8
- package/src/core/modules/better-auth/ARCHITECTURE.md +102 -0
- package/src/core/modules/better-auth/INTEGRATION-CHECKLIST.md +277 -8
- package/src/core/modules/better-auth/README.md +97 -53
- package/src/core/modules/better-auth/better-auth.config.ts +66 -18
- package/src/core/modules/better-auth/better-auth.resolver.ts +32 -32
- package/src/core/modules/better-auth/better-auth.types.ts +3 -2
- package/src/core/modules/better-auth/core-better-auth-api.middleware.ts +134 -0
- package/src/core/modules/better-auth/{better-auth-auth.model.ts → core-better-auth-auth.model.ts} +6 -6
- package/src/core/modules/better-auth/{better-auth-migration-status.model.ts → core-better-auth-migration-status.model.ts} +1 -1
- package/src/core/modules/better-auth/{better-auth-models.ts → core-better-auth-models.ts} +9 -9
- package/src/core/modules/better-auth/{better-auth-rate-limit.middleware.ts → core-better-auth-rate-limit.middleware.ts} +5 -5
- package/src/core/modules/better-auth/{better-auth-rate-limiter.service.ts → core-better-auth-rate-limiter.service.ts} +2 -2
- package/src/core/modules/better-auth/{better-auth-user.mapper.ts → core-better-auth-user.mapper.ts} +4 -3
- package/src/core/modules/better-auth/core-better-auth-web.helper.ts +272 -0
- package/src/core/modules/better-auth/core-better-auth.controller.ts +386 -230
- package/src/core/modules/better-auth/{better-auth.middleware.ts → core-better-auth.middleware.ts} +57 -17
- package/src/core/modules/better-auth/{better-auth.module.ts → core-better-auth.module.ts} +77 -66
- package/src/core/modules/better-auth/core-better-auth.resolver.ts +42 -42
- package/src/core/modules/better-auth/{better-auth.service.ts → core-better-auth.service.ts} +86 -40
- package/src/core/modules/better-auth/index.ts +18 -11
- package/src/core/modules/error-code/INTEGRATION-CHECKLIST.md +291 -0
- package/src/core/modules/error-code/core-error-code.controller.ts +55 -0
- package/src/core/modules/error-code/core-error-code.service.ts +135 -0
- package/src/core/modules/error-code/error-code.module.ts +119 -0
- package/src/core/modules/error-code/error-codes.ts +405 -0
- package/src/core/modules/error-code/index.ts +14 -0
- package/src/core/modules/error-code/interfaces/error-code.interfaces.ts +99 -0
- package/src/core/modules/user/interfaces/core-user-service-options.interface.ts +3 -3
- package/src/core.module.ts +28 -12
- package/src/index.ts +7 -0
- package/src/server/modules/better-auth/better-auth.controller.ts +4 -4
- package/src/server/modules/better-auth/better-auth.module.ts +1 -1
- package/src/server/modules/better-auth/better-auth.resolver.ts +31 -31
- package/src/server/modules/error-code/README.md +131 -0
- package/src/server/modules/error-code/error-code.controller.ts +91 -0
- package/src/server/modules/error-code/error-code.service.ts +42 -0
- package/src/server/modules/error-code/error-codes.ts +65 -0
- package/src/server/modules/error-code/index.ts +8 -0
- package/src/server/modules/user/user.service.ts +2 -2
- package/src/server/server.module.ts +10 -0
- package/src/test/test.helper.ts +13 -1
- package/dist/core/modules/better-auth/better-auth-auth.model.d.ts +0 -9
- package/dist/core/modules/better-auth/better-auth-auth.model.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth-migration-status.model.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth-models.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth-rate-limit.middleware.d.ts +0 -12
- package/dist/core/modules/better-auth/better-auth-rate-limit.middleware.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth-rate-limiter.service.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth-user.mapper.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth.middleware.d.ts +0 -21
- package/dist/core/modules/better-auth/better-auth.middleware.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth.module.js.map +0 -1
- package/dist/core/modules/better-auth/better-auth.service.js.map +0 -1
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lenne Tech Nest Server Error Codes - Structured Registry
|
|
3
|
+
*
|
|
4
|
+
* Single Source of Truth for all error codes, messages, and translations.
|
|
5
|
+
* This file serves as the central registry that:
|
|
6
|
+
* - Defines error codes with human-readable messages
|
|
7
|
+
* - Provides translations for multiple languages
|
|
8
|
+
* - Generates the i18n JSON endpoint automatically
|
|
9
|
+
*
|
|
10
|
+
* API Response Format: #PREFIX_XXXX: Short technical description
|
|
11
|
+
* - # = Marker for machine parsing
|
|
12
|
+
* - PREFIX = LTNS (Lenne Tech Nest Server) or project-specific
|
|
13
|
+
* - XXXX = Unique number within range
|
|
14
|
+
* - : = Separator
|
|
15
|
+
* - Description = English developer-friendly message
|
|
16
|
+
*
|
|
17
|
+
* Error code ranges:
|
|
18
|
+
* - LTNS_0001-LTNS_0099: Authentication errors
|
|
19
|
+
* - LTNS_0100-LTNS_0199: Authorization errors
|
|
20
|
+
* - LTNS_0200-LTNS_0299: User errors
|
|
21
|
+
* - LTNS_0300-LTNS_0399: Validation errors
|
|
22
|
+
* - LTNS_0400-LTNS_0499: Resource errors
|
|
23
|
+
* - LTNS_0500-LTNS_0599: File errors
|
|
24
|
+
* - LTNS_0900-LTNS_0999: Internal errors
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { UnauthorizedException } from '@nestjs/common';
|
|
29
|
+
* import { ErrorCode } from '@lenne.tech/nest-server';
|
|
30
|
+
*
|
|
31
|
+
* throw new UnauthorizedException(ErrorCode.UNAUTHORIZED);
|
|
32
|
+
* // Response: { statusCode: 401, message: "#LTNS_0100: Unauthorized - User is not logged in" }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
// =====================================================
|
|
37
|
+
// Type Definitions
|
|
38
|
+
// =====================================================
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Structure for a single error definition
|
|
42
|
+
*/
|
|
43
|
+
export interface IErrorDefinition {
|
|
44
|
+
/** Unique error code (e.g., LTNS_0100) */
|
|
45
|
+
code: string;
|
|
46
|
+
/** English developer message */
|
|
47
|
+
message: string;
|
|
48
|
+
/** Translations for end users */
|
|
49
|
+
translations: {
|
|
50
|
+
[locale: string]: string;
|
|
51
|
+
de: string;
|
|
52
|
+
en: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Registry type for error definitions
|
|
58
|
+
*/
|
|
59
|
+
export type IErrorRegistry = Record<string, IErrorDefinition>;
|
|
60
|
+
|
|
61
|
+
// =====================================================
|
|
62
|
+
// Core Error Registry (Single Source of Truth)
|
|
63
|
+
// =====================================================
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* LTNS Error Registry - Contains all core error definitions
|
|
67
|
+
*
|
|
68
|
+
* Each entry includes:
|
|
69
|
+
* - code: The unique identifier
|
|
70
|
+
* - message: English technical description for developers
|
|
71
|
+
* - translations: Localized messages for end users
|
|
72
|
+
*
|
|
73
|
+
* NOTE: Entries are grouped by error code range for maintainability.
|
|
74
|
+
* Do not sort alphabetically - the numeric grouping is intentional.
|
|
75
|
+
*/
|
|
76
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
77
|
+
export const LtnsErrors = {
|
|
78
|
+
// =====================================================
|
|
79
|
+
// Authentication Errors (LTNS_0001-LTNS_0099)
|
|
80
|
+
// =====================================================
|
|
81
|
+
|
|
82
|
+
USER_NOT_FOUND: {
|
|
83
|
+
code: 'LTNS_0001',
|
|
84
|
+
message: 'User not found',
|
|
85
|
+
translations: {
|
|
86
|
+
de: 'Benutzer wurde nicht gefunden.',
|
|
87
|
+
en: 'User not found.',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
INVALID_PASSWORD: {
|
|
92
|
+
code: 'LTNS_0002',
|
|
93
|
+
message: 'Invalid password',
|
|
94
|
+
translations: {
|
|
95
|
+
de: 'Das eingegebene Passwort ist ungültig.',
|
|
96
|
+
en: 'The provided password is invalid.',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
INVALID_TOKEN: {
|
|
101
|
+
code: 'LTNS_0003',
|
|
102
|
+
message: 'Invalid or malformed token',
|
|
103
|
+
translations: {
|
|
104
|
+
de: 'Der Token ist ungültig oder fehlerhaft.',
|
|
105
|
+
en: 'The token is invalid or malformed.',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
TOKEN_EXPIRED: {
|
|
110
|
+
code: 'LTNS_0004',
|
|
111
|
+
message: 'Token has expired',
|
|
112
|
+
translations: {
|
|
113
|
+
de: 'Der Token ist abgelaufen. Bitte melden Sie sich erneut an.',
|
|
114
|
+
en: 'The token has expired. Please sign in again.',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
REFRESH_TOKEN_REQUIRED: {
|
|
119
|
+
code: 'LTNS_0005',
|
|
120
|
+
message: 'Refresh token required',
|
|
121
|
+
translations: {
|
|
122
|
+
de: 'Ein Refresh-Token wird benötigt.',
|
|
123
|
+
en: 'A refresh token is required.',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
USER_NOT_VERIFIED: {
|
|
128
|
+
code: 'LTNS_0006',
|
|
129
|
+
message: 'User email not verified',
|
|
130
|
+
translations: {
|
|
131
|
+
de: 'Ihre E-Mail-Adresse wurde noch nicht verifiziert.',
|
|
132
|
+
en: 'Your email address has not been verified yet.',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
// =====================================================
|
|
137
|
+
// Authorization Errors (LTNS_0100-LTNS_0199)
|
|
138
|
+
// =====================================================
|
|
139
|
+
|
|
140
|
+
UNAUTHORIZED: {
|
|
141
|
+
code: 'LTNS_0100',
|
|
142
|
+
message: 'Unauthorized - User is not logged in',
|
|
143
|
+
translations: {
|
|
144
|
+
de: 'Sie sind nicht angemeldet.',
|
|
145
|
+
en: 'You are not logged in.',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
ACCESS_DENIED: {
|
|
150
|
+
code: 'LTNS_0101',
|
|
151
|
+
message: 'Access denied - Insufficient permissions',
|
|
152
|
+
translations: {
|
|
153
|
+
de: 'Zugriff verweigert. Sie haben nicht die erforderlichen Berechtigungen.',
|
|
154
|
+
en: 'Access denied. You do not have the required permissions.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
RESOURCE_FORBIDDEN: {
|
|
159
|
+
code: 'LTNS_0102',
|
|
160
|
+
message: 'Resource access forbidden',
|
|
161
|
+
translations: {
|
|
162
|
+
de: 'Der Zugriff auf diese Ressource ist nicht erlaubt.',
|
|
163
|
+
en: 'Access to this resource is forbidden.',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// =====================================================
|
|
168
|
+
// User Errors (LTNS_0200-LTNS_0299)
|
|
169
|
+
// =====================================================
|
|
170
|
+
|
|
171
|
+
EMAIL_ALREADY_EXISTS: {
|
|
172
|
+
code: 'LTNS_0200',
|
|
173
|
+
message: 'Email already registered',
|
|
174
|
+
translations: {
|
|
175
|
+
de: 'Diese E-Mail-Adresse ist bereits registriert.',
|
|
176
|
+
en: 'This email address is already registered.',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
USERNAME_ALREADY_EXISTS: {
|
|
181
|
+
code: 'LTNS_0201',
|
|
182
|
+
message: 'Username already taken',
|
|
183
|
+
translations: {
|
|
184
|
+
de: 'Dieser Benutzername ist bereits vergeben.',
|
|
185
|
+
en: 'This username is already taken.',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
// =====================================================
|
|
190
|
+
// Validation Errors (LTNS_0300-LTNS_0399)
|
|
191
|
+
// =====================================================
|
|
192
|
+
|
|
193
|
+
VALIDATION_FAILED: {
|
|
194
|
+
code: 'LTNS_0300',
|
|
195
|
+
message: 'Validation failed',
|
|
196
|
+
translations: {
|
|
197
|
+
de: 'Die Validierung ist fehlgeschlagen.',
|
|
198
|
+
en: 'Validation failed.',
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
REQUIRED_FIELD_MISSING: {
|
|
203
|
+
code: 'LTNS_0301',
|
|
204
|
+
message: 'Required field missing',
|
|
205
|
+
translations: {
|
|
206
|
+
de: 'Ein erforderliches Feld fehlt.',
|
|
207
|
+
en: 'A required field is missing.',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
INVALID_FIELD_FORMAT: {
|
|
212
|
+
code: 'LTNS_0302',
|
|
213
|
+
message: 'Invalid field format',
|
|
214
|
+
translations: {
|
|
215
|
+
de: 'Das Feldformat ist ungültig.',
|
|
216
|
+
en: 'The field format is invalid.',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
// =====================================================
|
|
221
|
+
// Resource Errors (LTNS_0400-LTNS_0499)
|
|
222
|
+
// =====================================================
|
|
223
|
+
|
|
224
|
+
RESOURCE_NOT_FOUND: {
|
|
225
|
+
code: 'LTNS_0400',
|
|
226
|
+
message: 'Resource not found',
|
|
227
|
+
translations: {
|
|
228
|
+
de: 'Die angeforderte Ressource wurde nicht gefunden.',
|
|
229
|
+
en: 'The requested resource was not found.',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
RESOURCE_ALREADY_EXISTS: {
|
|
234
|
+
code: 'LTNS_0401',
|
|
235
|
+
message: 'Resource already exists',
|
|
236
|
+
translations: {
|
|
237
|
+
de: 'Diese Ressource existiert bereits.',
|
|
238
|
+
en: 'This resource already exists.',
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
// =====================================================
|
|
243
|
+
// File Errors (LTNS_0500-LTNS_0599)
|
|
244
|
+
// =====================================================
|
|
245
|
+
|
|
246
|
+
FILE_NOT_FOUND: {
|
|
247
|
+
code: 'LTNS_0500',
|
|
248
|
+
message: 'File not found',
|
|
249
|
+
translations: {
|
|
250
|
+
de: 'Die Datei wurde nicht gefunden.',
|
|
251
|
+
en: 'The file was not found.',
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
FILE_UPLOAD_FAILED: {
|
|
256
|
+
code: 'LTNS_0501',
|
|
257
|
+
message: 'File upload failed',
|
|
258
|
+
translations: {
|
|
259
|
+
de: 'Der Datei-Upload ist fehlgeschlagen.',
|
|
260
|
+
en: 'The file upload failed.',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
FILE_TYPE_NOT_ALLOWED: {
|
|
265
|
+
code: 'LTNS_0502',
|
|
266
|
+
message: 'File type not allowed',
|
|
267
|
+
translations: {
|
|
268
|
+
de: 'Dieser Dateityp ist nicht erlaubt.',
|
|
269
|
+
en: 'This file type is not allowed.',
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
// =====================================================
|
|
274
|
+
// Internal Errors (LTNS_0900-LTNS_0999)
|
|
275
|
+
// =====================================================
|
|
276
|
+
|
|
277
|
+
INTERNAL_ERROR: {
|
|
278
|
+
code: 'LTNS_0900',
|
|
279
|
+
message: 'Internal server error',
|
|
280
|
+
translations: {
|
|
281
|
+
de: 'Ein interner Serverfehler ist aufgetreten.',
|
|
282
|
+
en: 'An internal server error occurred.',
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
SERVICE_UNAVAILABLE: {
|
|
287
|
+
code: 'LTNS_0901',
|
|
288
|
+
message: 'Service temporarily unavailable',
|
|
289
|
+
translations: {
|
|
290
|
+
de: 'Der Dienst ist vorübergehend nicht verfügbar.',
|
|
291
|
+
en: 'The service is temporarily unavailable.',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
LEGACY_AUTH_DISABLED: {
|
|
296
|
+
code: 'LTNS_0902',
|
|
297
|
+
message: 'Legacy authentication is disabled',
|
|
298
|
+
translations: {
|
|
299
|
+
de: 'Die Legacy-Authentifizierung ist deaktiviert. Bitte nutzen Sie die neue Authentifizierung.',
|
|
300
|
+
en: 'Legacy authentication is disabled. Please use the new authentication.',
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
} as const satisfies IErrorRegistry;
|
|
304
|
+
/* eslint-enable perfectionist/sort-objects */
|
|
305
|
+
|
|
306
|
+
// =====================================================
|
|
307
|
+
// Generated ErrorCode Object
|
|
308
|
+
// =====================================================
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Generate formatted error message from definition
|
|
312
|
+
* Format: #CODE: Message
|
|
313
|
+
*/
|
|
314
|
+
function formatErrorMessage(def: IErrorDefinition): string {
|
|
315
|
+
return `#${def.code}: ${def.message}`;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Generate ErrorCode object from registry
|
|
320
|
+
* Maps each key to its formatted error string
|
|
321
|
+
*/
|
|
322
|
+
function generateErrorCodes<T extends IErrorRegistry>(registry: T): { [K in keyof T]: string } {
|
|
323
|
+
const result = {} as { [K in keyof T]: string };
|
|
324
|
+
for (const key of Object.keys(registry) as Array<keyof T>) {
|
|
325
|
+
result[key] = formatErrorMessage(registry[key]);
|
|
326
|
+
}
|
|
327
|
+
return result;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* ErrorCode - Use this in your code with NestJS exceptions
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* throw new UnauthorizedException(ErrorCode.UNAUTHORIZED);
|
|
336
|
+
* // Response: { statusCode: 401, message: "#LTNS_0100: Unauthorized - User is not logged in" }
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
export const ErrorCode = generateErrorCodes(LtnsErrors);
|
|
340
|
+
|
|
341
|
+
// =====================================================
|
|
342
|
+
// Type Exports
|
|
343
|
+
// =====================================================
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Type for error code keys (readable names like USER_NOT_FOUND)
|
|
347
|
+
*/
|
|
348
|
+
export type ErrorCodeKey = keyof typeof ErrorCode;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Type for all error code formatted strings
|
|
352
|
+
*/
|
|
353
|
+
export type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Type for raw error codes (like LTNS_0100)
|
|
357
|
+
*/
|
|
358
|
+
export type RawErrorCode = (typeof LtnsErrors)[keyof typeof LtnsErrors]['code'];
|
|
359
|
+
|
|
360
|
+
// =====================================================
|
|
361
|
+
// Helper Functions
|
|
362
|
+
// =====================================================
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Get all error definitions (for i18n endpoint)
|
|
366
|
+
*
|
|
367
|
+
* @returns All error definitions from the registry
|
|
368
|
+
*/
|
|
369
|
+
export function getAllErrorDefinitions(): typeof LtnsErrors {
|
|
370
|
+
return LtnsErrors;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// =====================================================
|
|
374
|
+
// Extension Support
|
|
375
|
+
// =====================================================
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Merge project-specific errors with core errors
|
|
379
|
+
*
|
|
380
|
+
* @param projectErrors - Project-specific error registry
|
|
381
|
+
* @returns Merged error codes object
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```typescript
|
|
385
|
+
* // In your project
|
|
386
|
+
* const ProjectErrors = {
|
|
387
|
+
* ORDER_NOT_FOUND: {
|
|
388
|
+
* code: 'PROJ_0001',
|
|
389
|
+
* message: 'Order not found',
|
|
390
|
+
* translations: { de: 'Bestellung nicht gefunden.', en: 'Order not found.' }
|
|
391
|
+
* }
|
|
392
|
+
* } as const satisfies IErrorRegistry;
|
|
393
|
+
*
|
|
394
|
+
* export const ErrorCode = mergeErrorCodes(ProjectErrors);
|
|
395
|
+
* // Contains both LTNS_* and PROJ_* errors
|
|
396
|
+
* ```
|
|
397
|
+
*/
|
|
398
|
+
export function mergeErrorCodes<T extends IErrorRegistry>(
|
|
399
|
+
projectErrors: T,
|
|
400
|
+
): { [K in keyof T | keyof typeof LtnsErrors]: string } {
|
|
401
|
+
return {
|
|
402
|
+
...ErrorCode,
|
|
403
|
+
...generateErrorCodes(projectErrors),
|
|
404
|
+
} as { [K in keyof T | keyof typeof LtnsErrors]: string };
|
|
405
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Controller
|
|
2
|
+
export * from './core-error-code.controller';
|
|
3
|
+
|
|
4
|
+
// Service
|
|
5
|
+
export * from './core-error-code.service';
|
|
6
|
+
|
|
7
|
+
// Module
|
|
8
|
+
export * from './error-code.module';
|
|
9
|
+
|
|
10
|
+
// Error Codes
|
|
11
|
+
export * from './error-codes';
|
|
12
|
+
|
|
13
|
+
// Interfaces
|
|
14
|
+
export * from './interfaces/error-code.interfaces';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Type } from '@nestjs/common';
|
|
2
|
+
|
|
3
|
+
import { CoreErrorCodeService } from '../core-error-code.service';
|
|
4
|
+
import { IErrorRegistry } from '../error-codes';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for the error code module
|
|
8
|
+
*/
|
|
9
|
+
export interface IErrorCodeModuleConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Additional error registry to merge with core errors
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const ProjectErrors = {
|
|
16
|
+
* ORDER_NOT_FOUND: {
|
|
17
|
+
* code: 'PROJ_0001',
|
|
18
|
+
* message: 'Order not found',
|
|
19
|
+
* translations: { de: 'Bestellung nicht gefunden.', en: 'Order not found.' }
|
|
20
|
+
* }
|
|
21
|
+
* } as const satisfies IErrorRegistry;
|
|
22
|
+
*
|
|
23
|
+
* ErrorCodeModule.forRoot({ additionalErrorRegistry: ProjectErrors })
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
additionalErrorRegistry?: IErrorRegistry;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Custom controller class to use instead of CoreErrorCodeController.
|
|
30
|
+
*
|
|
31
|
+
* **Note:** Use a standalone controller (not extending CoreErrorCodeController)
|
|
32
|
+
* to ensure correct route registration order when adding new routes.
|
|
33
|
+
* NestJS registers parent routes first, which can cause parameterized routes
|
|
34
|
+
* to intercept static routes.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // Standalone controller (RECOMMENDED)
|
|
39
|
+
* @Controller('api/i18n/errors')
|
|
40
|
+
* export class ErrorCodeController {
|
|
41
|
+
* constructor(protected readonly errorCodeService: ErrorCodeService) {}
|
|
42
|
+
*
|
|
43
|
+
* @Get('codes') // Must be defined BEFORE :locale
|
|
44
|
+
* @Roles(RoleEnum.S_EVERYONE)
|
|
45
|
+
* getAllCodes(): string[] {
|
|
46
|
+
* return this.errorCodeService.getErrorCodes();
|
|
47
|
+
* }
|
|
48
|
+
*
|
|
49
|
+
* @Get(':locale')
|
|
50
|
+
* @Roles(RoleEnum.S_EVERYONE)
|
|
51
|
+
* getTranslations(@Param('locale') locale: string) { ... }
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* // In your module
|
|
55
|
+
* ErrorCodeModule.forRoot({
|
|
56
|
+
* controller: ErrorCodeController,
|
|
57
|
+
* service: ErrorCodeService,
|
|
58
|
+
* })
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
controller?: Type<any>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Custom service class to use instead of CoreErrorCodeService.
|
|
65
|
+
* The class must extend CoreErrorCodeService.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* // Your custom service with additional locales
|
|
70
|
+
* @Injectable()
|
|
71
|
+
* export class ErrorCodeService extends CoreErrorCodeService {
|
|
72
|
+
* protected override supportedLocales: SupportedLocale[] = ['de', 'en', 'fr', 'es'];
|
|
73
|
+
*
|
|
74
|
+
* constructor() {
|
|
75
|
+
* super();
|
|
76
|
+
* this.registerErrorRegistry(ProjectErrors);
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
*
|
|
80
|
+
* // In your module
|
|
81
|
+
* ErrorCodeModule.forRoot({
|
|
82
|
+
* service: ErrorCodeService,
|
|
83
|
+
* })
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
service?: Type<CoreErrorCodeService>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Response format for the translation endpoint
|
|
91
|
+
*/
|
|
92
|
+
export interface IErrorTranslationResponse {
|
|
93
|
+
errors: Record<string, string>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Supported locales for error translations
|
|
98
|
+
*/
|
|
99
|
+
export type SupportedLocale = 'de' | 'en';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CoreBetterAuthUserMapper } from '../../better-auth/core-better-auth-user.mapper';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Optional configuration for CoreUserService
|
|
@@ -8,8 +8,8 @@ import { BetterAuthUserMapper } from '../../better-auth/better-auth-user.mapper'
|
|
|
8
8
|
*/
|
|
9
9
|
export interface CoreUserServiceOptions {
|
|
10
10
|
/**
|
|
11
|
-
* Optional
|
|
11
|
+
* Optional CoreBetterAuthUserMapper for syncing between Legacy and IAM auth systems.
|
|
12
12
|
* When provided, email changes and user deletions are automatically synced.
|
|
13
13
|
*/
|
|
14
|
-
betterAuthUserMapper?:
|
|
14
|
+
betterAuthUserMapper?: CoreBetterAuthUserMapper;
|
|
15
15
|
}
|
package/src/core.module.ts
CHANGED
|
@@ -19,9 +19,10 @@ import { EmailService } from './core/common/services/email.service';
|
|
|
19
19
|
import { MailjetService } from './core/common/services/mailjet.service';
|
|
20
20
|
import { ModelDocService } from './core/common/services/model-doc.service';
|
|
21
21
|
import { TemplateService } from './core/common/services/template.service';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
import { CoreBetterAuthUserMapper } from './core/modules/better-auth/core-better-auth-user.mapper';
|
|
23
|
+
import { CoreBetterAuthModule } from './core/modules/better-auth/core-better-auth.module';
|
|
24
|
+
import { CoreBetterAuthService } from './core/modules/better-auth/core-better-auth.service';
|
|
25
|
+
import { ErrorCodeModule } from './core/modules/error-code/error-code.module';
|
|
25
26
|
import { CoreHealthCheckModule } from './core/modules/health-check/core-health-check.module';
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -85,8 +86,8 @@ export class CoreModule implements NestModule {
|
|
|
85
86
|
*
|
|
86
87
|
* **Requirements:**
|
|
87
88
|
* - Configure `betterAuth` in your config (enabled by default)
|
|
88
|
-
* - Create
|
|
89
|
-
* - Inject
|
|
89
|
+
* - Create CoreBetterAuthModule, Resolver, and Controller in your project
|
|
90
|
+
* - Inject CoreBetterAuthUserMapper in UserService
|
|
90
91
|
*
|
|
91
92
|
* ### Legacy + IAM Signature (For existing projects)
|
|
92
93
|
*
|
|
@@ -226,12 +227,27 @@ export class CoreModule implements NestModule {
|
|
|
226
227
|
Object.assign({ driver: ApolloDriver }, config.graphQl.driver, config.graphQl.options),
|
|
227
228
|
),
|
|
228
229
|
];
|
|
230
|
+
|
|
231
|
+
// Add ErrorCodeModule based on configuration
|
|
232
|
+
// autoRegister defaults to true (backward compatible)
|
|
233
|
+
const errorCodeConfig = config.errorCode;
|
|
234
|
+
const isErrorCodeAutoRegister = errorCodeConfig?.autoRegister !== false;
|
|
235
|
+
|
|
236
|
+
if (isErrorCodeAutoRegister) {
|
|
237
|
+
// Always use forRoot() - it registers the controller and handles configuration
|
|
238
|
+
imports.push(
|
|
239
|
+
ErrorCodeModule.forRoot({
|
|
240
|
+
additionalErrorRegistry: errorCodeConfig?.additionalErrorRegistry,
|
|
241
|
+
}),
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
229
245
|
if (config.healthCheck) {
|
|
230
246
|
imports.push(CoreHealthCheckModule);
|
|
231
247
|
}
|
|
232
248
|
|
|
233
|
-
// Add
|
|
234
|
-
// IAM-only mode: Always register
|
|
249
|
+
// Add CoreBetterAuthModule based on mode
|
|
250
|
+
// IAM-only mode: Always register CoreBetterAuthModule (required for subscription auth)
|
|
235
251
|
// Legacy mode: Only register if autoRegister is explicitly true
|
|
236
252
|
// betterAuth can be: boolean | IBetterAuth | undefined
|
|
237
253
|
const betterAuthConfig = config.betterAuth;
|
|
@@ -242,7 +258,7 @@ export class CoreModule implements NestModule {
|
|
|
242
258
|
if (isBetterAuthEnabled) {
|
|
243
259
|
if (isIamOnlyMode || isAutoRegister) {
|
|
244
260
|
imports.push(
|
|
245
|
-
|
|
261
|
+
CoreBetterAuthModule.forRoot({
|
|
246
262
|
config: betterAuthConfig === true ? {} : betterAuthConfig || {},
|
|
247
263
|
// Pass JWT secrets for backwards compatibility fallback
|
|
248
264
|
fallbackSecrets: [config.jwt?.secret, config.jwt?.refresh?.secret],
|
|
@@ -273,14 +289,14 @@ export class CoreModule implements NestModule {
|
|
|
273
289
|
/**
|
|
274
290
|
* Build GraphQL driver configuration for IAM-only mode
|
|
275
291
|
*
|
|
276
|
-
* Uses
|
|
292
|
+
* Uses CoreBetterAuthService for subscription authentication via JWT tokens.
|
|
277
293
|
* This is the recommended mode for new projects.
|
|
278
294
|
*/
|
|
279
295
|
private static buildIamOnlyGraphQlDriver(cors: object, options: Partial<IServerOptions>) {
|
|
280
296
|
return {
|
|
281
|
-
imports: [
|
|
282
|
-
inject: [
|
|
283
|
-
useFactory: async (betterAuthService:
|
|
297
|
+
imports: [CoreBetterAuthModule],
|
|
298
|
+
inject: [CoreBetterAuthService, CoreBetterAuthUserMapper],
|
|
299
|
+
useFactory: async (betterAuthService: CoreBetterAuthService, userMapper: CoreBetterAuthUserMapper) =>
|
|
284
300
|
Object.assign(
|
|
285
301
|
{
|
|
286
302
|
autoSchemaFile: 'schema.gql',
|
package/src/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from './core/common/helpers/filter.helper';
|
|
|
36
36
|
export * from './core/common/helpers/graphql.helper';
|
|
37
37
|
export * from './core/common/helpers/gridfs.helper';
|
|
38
38
|
export * from './core/common/helpers/input.helper';
|
|
39
|
+
export * from './core/common/helpers/logging.helper';
|
|
39
40
|
export * from './core/common/helpers/model.helper';
|
|
40
41
|
export * from './core/common/helpers/register-enum.helper';
|
|
41
42
|
export * from './core/common/helpers/scim.helper';
|
|
@@ -131,6 +132,12 @@ export * from './core/modules/auth/tokens.decorator';
|
|
|
131
132
|
|
|
132
133
|
export * from './core/modules/better-auth';
|
|
133
134
|
|
|
135
|
+
// =====================================================================================================================
|
|
136
|
+
// Core - Modules - ErrorCode
|
|
137
|
+
// =====================================================================================================================
|
|
138
|
+
|
|
139
|
+
export * from './core/modules/error-code';
|
|
140
|
+
|
|
134
141
|
// =====================================================================================================================
|
|
135
142
|
// Core - Modules - File
|
|
136
143
|
// =====================================================================================================================
|
|
@@ -3,9 +3,9 @@ import { Controller } from '@nestjs/common';
|
|
|
3
3
|
import { Roles } from '../../../core/common/decorators/roles.decorator';
|
|
4
4
|
import { RoleEnum } from '../../../core/common/enums/role.enum';
|
|
5
5
|
import { ConfigService } from '../../../core/common/services/config.service';
|
|
6
|
-
import {
|
|
7
|
-
import { BetterAuthService } from '../../../core/modules/better-auth/better-auth.service';
|
|
6
|
+
import { CoreBetterAuthUserMapper } from '../../../core/modules/better-auth/core-better-auth-user.mapper';
|
|
8
7
|
import { CoreBetterAuthController } from '../../../core/modules/better-auth/core-better-auth.controller';
|
|
8
|
+
import { CoreBetterAuthService } from '../../../core/modules/better-auth/core-better-auth.service';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Server BetterAuth REST Controller
|
|
@@ -32,8 +32,8 @@ import { CoreBetterAuthController } from '../../../core/modules/better-auth/core
|
|
|
32
32
|
@Roles(RoleEnum.ADMIN)
|
|
33
33
|
export class BetterAuthController extends CoreBetterAuthController {
|
|
34
34
|
constructor(
|
|
35
|
-
protected override readonly betterAuthService:
|
|
36
|
-
protected override readonly userMapper:
|
|
35
|
+
protected override readonly betterAuthService: CoreBetterAuthService,
|
|
36
|
+
protected override readonly userMapper: CoreBetterAuthUserMapper,
|
|
37
37
|
protected override readonly configService: ConfigService,
|
|
38
38
|
) {
|
|
39
39
|
super(betterAuthService, userMapper, configService);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicModule, Module } from '@nestjs/common';
|
|
2
2
|
|
|
3
3
|
import { IBetterAuth } from '../../../core/common/interfaces/server-options.interface';
|
|
4
|
-
import {
|
|
4
|
+
import { CoreBetterAuthModule } from '../../../core/modules/better-auth/core-better-auth.module';
|
|
5
5
|
import { BetterAuthController } from './better-auth.controller';
|
|
6
6
|
import { BetterAuthResolver } from './better-auth.resolver';
|
|
7
7
|
|