@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
|
@@ -14,9 +14,9 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const roles_decorator_1 = require("../../../core/common/decorators/roles.decorator");
|
|
15
15
|
const role_enum_1 = require("../../../core/common/enums/role.enum");
|
|
16
16
|
const config_service_1 = require("../../../core/common/services/config.service");
|
|
17
|
-
const
|
|
18
|
-
const better_auth_service_1 = require("../../../core/modules/better-auth/better-auth.service");
|
|
17
|
+
const core_better_auth_user_mapper_1 = require("../../../core/modules/better-auth/core-better-auth-user.mapper");
|
|
19
18
|
const core_better_auth_controller_1 = require("../../../core/modules/better-auth/core-better-auth.controller");
|
|
19
|
+
const core_better_auth_service_1 = require("../../../core/modules/better-auth/core-better-auth.service");
|
|
20
20
|
let BetterAuthController = class BetterAuthController extends core_better_auth_controller_1.CoreBetterAuthController {
|
|
21
21
|
constructor(betterAuthService, userMapper, configService) {
|
|
22
22
|
super(betterAuthService, userMapper, configService);
|
|
@@ -29,8 +29,8 @@ exports.BetterAuthController = BetterAuthController;
|
|
|
29
29
|
exports.BetterAuthController = BetterAuthController = __decorate([
|
|
30
30
|
(0, common_1.Controller)('iam'),
|
|
31
31
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.ADMIN),
|
|
32
|
-
__metadata("design:paramtypes", [
|
|
33
|
-
|
|
32
|
+
__metadata("design:paramtypes", [core_better_auth_service_1.CoreBetterAuthService,
|
|
33
|
+
core_better_auth_user_mapper_1.CoreBetterAuthUserMapper,
|
|
34
34
|
config_service_1.ConfigService])
|
|
35
35
|
], BetterAuthController);
|
|
36
36
|
//# sourceMappingURL=better-auth.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.controller.js","sourceRoot":"","sources":["../../../../src/server/modules/better-auth/better-auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,qFAAwE;AACxE,oEAAgE;AAChE,iFAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"better-auth.controller.js","sourceRoot":"","sources":["../../../../src/server/modules/better-auth/better-auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,qFAAwE;AACxE,oEAAgE;AAChE,iFAA6E;AAC7E,iHAA0G;AAC1G,+GAAyG;AACzG,yGAAmG;AAyB5F,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sDAAwB;IAChE,YAC8B,iBAAwC,EACxC,UAAoC,EACpC,aAA4B;QAExD,KAAK,CAAC,iBAAiB,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QAJxB,sBAAiB,GAAjB,iBAAiB,CAAuB;QACxC,eAAU,GAAV,UAAU,CAA0B;QACpC,kBAAa,GAAb,aAAa,CAAe;IAG1D,CAAC;CACF,CAAA;AARY,oDAAoB;+BAApB,oBAAoB;IAFhC,IAAA,mBAAU,EAAC,KAAK,CAAC;IACjB,IAAA,uBAAK,EAAC,oBAAQ,CAAC,KAAK,CAAC;qCAG6B,gDAAqB;QAC5B,uDAAwB;QACrB,8BAAa;GAJ/C,oBAAoB,CAQhC"}
|
|
@@ -9,7 +9,7 @@ var BetterAuthModule_1;
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.BetterAuthModule = void 0;
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
|
-
const
|
|
12
|
+
const core_better_auth_module_1 = require("../../../core/modules/better-auth/core-better-auth.module");
|
|
13
13
|
const better_auth_controller_1 = require("./better-auth.controller");
|
|
14
14
|
const better_auth_resolver_1 = require("./better-auth.resolver");
|
|
15
15
|
let BetterAuthModule = BetterAuthModule_1 = class BetterAuthModule {
|
|
@@ -24,9 +24,9 @@ let BetterAuthModule = BetterAuthModule_1 = class BetterAuthModule {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
|
-
exports: [
|
|
27
|
+
exports: [core_better_auth_module_1.CoreBetterAuthModule],
|
|
28
28
|
imports: [
|
|
29
|
-
|
|
29
|
+
core_better_auth_module_1.CoreBetterAuthModule.forRoot({
|
|
30
30
|
config,
|
|
31
31
|
controller: better_auth_controller_1.BetterAuthController,
|
|
32
32
|
fallbackSecrets,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.module.js","sourceRoot":"","sources":["../../../../src/server/modules/better-auth/better-auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AAGvD,
|
|
1
|
+
{"version":3,"file":"better-auth.module.js","sourceRoot":"","sources":["../../../../src/server/modules/better-auth/better-auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AAGvD,uGAAiG;AACjG,qEAAgE;AAChE,iEAA4D;AAqDrD,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAO3B,MAAM,CAAC,OAAO,CAAC,OAAsC;QACnD,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;QAI5C,MAAM,UAAU,GAAG,MAAM,KAAK,KAAK,IAAI,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC;QACjG,IAAI,UAAU,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE,kBAAgB;gBACxB,SAAS,EAAE,EAAE;aACd,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,8CAAoB,CAAC;YAC/B,OAAO,EAAE;gBACP,8CAAoB,CAAC,OAAO,CAAC;oBAC3B,MAAM;oBACN,UAAU,EAAE,6CAAoB;oBAChC,eAAe;oBACf,QAAQ,EAAE,yCAAkB;iBAC7B,CAAC;aACH;YACD,MAAM,EAAE,kBAAgB;YACxB,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF,CAAA;AAnCY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CAmC5B"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { BetterAuthService } from '../../../core/modules/better-auth/better-auth.service';
|
|
2
|
+
import { CoreBetterAuthAuthModel } from '../../../core/modules/better-auth/core-better-auth-auth.model';
|
|
3
|
+
import { CoreBetterAuthMigrationStatusModel } from '../../../core/modules/better-auth/core-better-auth-migration-status.model';
|
|
4
|
+
import { CoreBetterAuth2FASetupModel, CoreBetterAuthFeaturesModel, CoreBetterAuthPasskeyChallengeModel, CoreBetterAuthPasskeyModel, CoreBetterAuthSessionModel } from '../../../core/modules/better-auth/core-better-auth-models';
|
|
5
|
+
import { CoreBetterAuthUserMapper } from '../../../core/modules/better-auth/core-better-auth-user.mapper';
|
|
7
6
|
import { CoreBetterAuthResolver } from '../../../core/modules/better-auth/core-better-auth.resolver';
|
|
7
|
+
import { CoreBetterAuthService } from '../../../core/modules/better-auth/core-better-auth.service';
|
|
8
8
|
export declare class BetterAuthResolver extends CoreBetterAuthResolver {
|
|
9
|
-
protected readonly betterAuthService:
|
|
10
|
-
protected readonly userMapper:
|
|
11
|
-
constructor(betterAuthService:
|
|
9
|
+
protected readonly betterAuthService: CoreBetterAuthService;
|
|
10
|
+
protected readonly userMapper: CoreBetterAuthUserMapper;
|
|
11
|
+
constructor(betterAuthService: CoreBetterAuthService, userMapper: CoreBetterAuthUserMapper);
|
|
12
12
|
betterAuthSession(ctx: {
|
|
13
13
|
req: Request;
|
|
14
|
-
}): Promise<
|
|
14
|
+
}): Promise<CoreBetterAuthSessionModel | null>;
|
|
15
15
|
betterAuthEnabled(): boolean;
|
|
16
|
-
betterAuthFeatures():
|
|
17
|
-
betterAuthMigrationStatus(): Promise<
|
|
16
|
+
betterAuthFeatures(): CoreBetterAuthFeaturesModel;
|
|
17
|
+
betterAuthMigrationStatus(): Promise<CoreBetterAuthMigrationStatusModel>;
|
|
18
18
|
betterAuthToken(ctx: {
|
|
19
19
|
req: Request;
|
|
20
20
|
}): Promise<null | string>;
|
|
21
21
|
betterAuthListPasskeys(ctx: {
|
|
22
22
|
req: Request;
|
|
23
|
-
}): Promise<
|
|
23
|
+
}): Promise<CoreBetterAuthPasskeyModel[] | null>;
|
|
24
24
|
betterAuthSignIn(email: string, password: string, ctx: {
|
|
25
25
|
req: Request;
|
|
26
26
|
res: Response;
|
|
27
|
-
}): Promise<
|
|
28
|
-
betterAuthSignUp(email: string, password: string, name?: string): Promise<
|
|
27
|
+
}): Promise<CoreBetterAuthAuthModel>;
|
|
28
|
+
betterAuthSignUp(email: string, password: string, name?: string): Promise<CoreBetterAuthAuthModel>;
|
|
29
29
|
betterAuthSignOut(ctx: {
|
|
30
30
|
req: Request;
|
|
31
31
|
}): Promise<boolean>;
|
|
32
32
|
betterAuthVerify2FA(code: string, ctx: {
|
|
33
33
|
req: Request;
|
|
34
|
-
}): Promise<
|
|
34
|
+
}): Promise<CoreBetterAuthAuthModel>;
|
|
35
35
|
betterAuthEnable2FA(password: string, ctx: {
|
|
36
36
|
req: Request;
|
|
37
|
-
}): Promise<
|
|
37
|
+
}): Promise<CoreBetterAuth2FASetupModel>;
|
|
38
38
|
betterAuthDisable2FA(password: string, ctx: {
|
|
39
39
|
req: Request;
|
|
40
40
|
}): Promise<boolean>;
|
|
@@ -43,7 +43,7 @@ export declare class BetterAuthResolver extends CoreBetterAuthResolver {
|
|
|
43
43
|
}): Promise<null | string[]>;
|
|
44
44
|
betterAuthGetPasskeyChallenge(ctx: {
|
|
45
45
|
req: Request;
|
|
46
|
-
}): Promise<
|
|
46
|
+
}): Promise<CoreBetterAuthPasskeyChallengeModel>;
|
|
47
47
|
betterAuthDeletePasskey(passkeyId: string, ctx: {
|
|
48
48
|
req: Request;
|
|
49
49
|
}): Promise<boolean>;
|
|
@@ -16,12 +16,12 @@ exports.BetterAuthResolver = void 0;
|
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const roles_decorator_1 = require("../../../core/common/decorators/roles.decorator");
|
|
18
18
|
const role_enum_1 = require("../../../core/common/enums/role.enum");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const better_auth_service_1 = require("../../../core/modules/better-auth/better-auth.service");
|
|
19
|
+
const core_better_auth_auth_model_1 = require("../../../core/modules/better-auth/core-better-auth-auth.model");
|
|
20
|
+
const core_better_auth_migration_status_model_1 = require("../../../core/modules/better-auth/core-better-auth-migration-status.model");
|
|
21
|
+
const core_better_auth_models_1 = require("../../../core/modules/better-auth/core-better-auth-models");
|
|
22
|
+
const core_better_auth_user_mapper_1 = require("../../../core/modules/better-auth/core-better-auth-user.mapper");
|
|
24
23
|
const core_better_auth_resolver_1 = require("../../../core/modules/better-auth/core-better-auth.resolver");
|
|
24
|
+
const core_better_auth_service_1 = require("../../../core/modules/better-auth/core-better-auth.service");
|
|
25
25
|
let BetterAuthResolver = class BetterAuthResolver extends core_better_auth_resolver_1.CoreBetterAuthResolver {
|
|
26
26
|
constructor(betterAuthService, userMapper) {
|
|
27
27
|
super(betterAuthService, userMapper);
|
|
@@ -76,7 +76,7 @@ let BetterAuthResolver = class BetterAuthResolver extends core_better_auth_resol
|
|
|
76
76
|
};
|
|
77
77
|
exports.BetterAuthResolver = BetterAuthResolver;
|
|
78
78
|
__decorate([
|
|
79
|
-
(0, graphql_1.Query)(() =>
|
|
79
|
+
(0, graphql_1.Query)(() => core_better_auth_models_1.CoreBetterAuthSessionModel, {
|
|
80
80
|
description: 'Get current Better-Auth session',
|
|
81
81
|
nullable: true,
|
|
82
82
|
}),
|
|
@@ -94,14 +94,14 @@ __decorate([
|
|
|
94
94
|
__metadata("design:returntype", Boolean)
|
|
95
95
|
], BetterAuthResolver.prototype, "betterAuthEnabled", null);
|
|
96
96
|
__decorate([
|
|
97
|
-
(0, graphql_1.Query)(() =>
|
|
97
|
+
(0, graphql_1.Query)(() => core_better_auth_models_1.CoreBetterAuthFeaturesModel, { description: 'Get enabled Better-Auth features' }),
|
|
98
98
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
|
|
99
99
|
__metadata("design:type", Function),
|
|
100
100
|
__metadata("design:paramtypes", []),
|
|
101
|
-
__metadata("design:returntype",
|
|
101
|
+
__metadata("design:returntype", core_better_auth_models_1.CoreBetterAuthFeaturesModel)
|
|
102
102
|
], BetterAuthResolver.prototype, "betterAuthFeatures", null);
|
|
103
103
|
__decorate([
|
|
104
|
-
(0, graphql_1.Query)(() =>
|
|
104
|
+
(0, graphql_1.Query)(() => core_better_auth_migration_status_model_1.CoreBetterAuthMigrationStatusModel, {
|
|
105
105
|
description: 'Get migration status from Legacy Auth to Better-Auth (IAM) - Admin only',
|
|
106
106
|
}),
|
|
107
107
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.ADMIN),
|
|
@@ -121,7 +121,7 @@ __decorate([
|
|
|
121
121
|
__metadata("design:returntype", Promise)
|
|
122
122
|
], BetterAuthResolver.prototype, "betterAuthToken", null);
|
|
123
123
|
__decorate([
|
|
124
|
-
(0, graphql_1.Query)(() => [
|
|
124
|
+
(0, graphql_1.Query)(() => [core_better_auth_models_1.CoreBetterAuthPasskeyModel], {
|
|
125
125
|
description: 'List passkeys for the current user',
|
|
126
126
|
nullable: true,
|
|
127
127
|
}),
|
|
@@ -132,7 +132,7 @@ __decorate([
|
|
|
132
132
|
__metadata("design:returntype", Promise)
|
|
133
133
|
], BetterAuthResolver.prototype, "betterAuthListPasskeys", null);
|
|
134
134
|
__decorate([
|
|
135
|
-
(0, graphql_1.Mutation)(() =>
|
|
135
|
+
(0, graphql_1.Mutation)(() => core_better_auth_auth_model_1.CoreBetterAuthAuthModel, {
|
|
136
136
|
description: 'Sign in via Better-Auth (email/password)',
|
|
137
137
|
}),
|
|
138
138
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
|
|
@@ -144,7 +144,7 @@ __decorate([
|
|
|
144
144
|
__metadata("design:returntype", Promise)
|
|
145
145
|
], BetterAuthResolver.prototype, "betterAuthSignIn", null);
|
|
146
146
|
__decorate([
|
|
147
|
-
(0, graphql_1.Mutation)(() =>
|
|
147
|
+
(0, graphql_1.Mutation)(() => core_better_auth_auth_model_1.CoreBetterAuthAuthModel, {
|
|
148
148
|
description: 'Sign up via Better-Auth (email/password)',
|
|
149
149
|
}),
|
|
150
150
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
|
|
@@ -164,7 +164,7 @@ __decorate([
|
|
|
164
164
|
__metadata("design:returntype", Promise)
|
|
165
165
|
], BetterAuthResolver.prototype, "betterAuthSignOut", null);
|
|
166
166
|
__decorate([
|
|
167
|
-
(0, graphql_1.Mutation)(() =>
|
|
167
|
+
(0, graphql_1.Mutation)(() => core_better_auth_auth_model_1.CoreBetterAuthAuthModel, {
|
|
168
168
|
description: 'Verify 2FA code during sign-in',
|
|
169
169
|
}),
|
|
170
170
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
|
|
@@ -175,7 +175,7 @@ __decorate([
|
|
|
175
175
|
__metadata("design:returntype", Promise)
|
|
176
176
|
], BetterAuthResolver.prototype, "betterAuthVerify2FA", null);
|
|
177
177
|
__decorate([
|
|
178
|
-
(0, graphql_1.Mutation)(() =>
|
|
178
|
+
(0, graphql_1.Mutation)(() => core_better_auth_models_1.CoreBetterAuth2FASetupModel, {
|
|
179
179
|
description: 'Enable 2FA for the current user',
|
|
180
180
|
}),
|
|
181
181
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_USER),
|
|
@@ -208,7 +208,7 @@ __decorate([
|
|
|
208
208
|
__metadata("design:returntype", Promise)
|
|
209
209
|
], BetterAuthResolver.prototype, "betterAuthGenerateBackupCodes", null);
|
|
210
210
|
__decorate([
|
|
211
|
-
(0, graphql_1.Mutation)(() =>
|
|
211
|
+
(0, graphql_1.Mutation)(() => core_better_auth_models_1.CoreBetterAuthPasskeyChallengeModel, {
|
|
212
212
|
description: 'Get passkey registration challenge for WebAuthn',
|
|
213
213
|
}),
|
|
214
214
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_USER),
|
|
@@ -229,9 +229,9 @@ __decorate([
|
|
|
229
229
|
__metadata("design:returntype", Promise)
|
|
230
230
|
], BetterAuthResolver.prototype, "betterAuthDeletePasskey", null);
|
|
231
231
|
exports.BetterAuthResolver = BetterAuthResolver = __decorate([
|
|
232
|
-
(0, graphql_1.Resolver)(() =>
|
|
232
|
+
(0, graphql_1.Resolver)(() => core_better_auth_auth_model_1.CoreBetterAuthAuthModel),
|
|
233
233
|
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.ADMIN),
|
|
234
|
-
__metadata("design:paramtypes", [
|
|
235
|
-
|
|
234
|
+
__metadata("design:paramtypes", [core_better_auth_service_1.CoreBetterAuthService,
|
|
235
|
+
core_better_auth_user_mapper_1.CoreBetterAuthUserMapper])
|
|
236
236
|
], BetterAuthResolver);
|
|
237
237
|
//# sourceMappingURL=better-auth.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.resolver.js","sourceRoot":"","sources":["../../../../src/server/modules/better-auth/better-auth.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA2E;AAG3E,qFAAwE;AACxE,oEAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"better-auth.resolver.js","sourceRoot":"","sources":["../../../../src/server/modules/better-auth/better-auth.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA2E;AAG3E,qFAAwE;AACxE,oEAAgE;AAChE,+GAAwG;AACxG,uIAA+H;AAC/H,uGAMmE;AACnE,iHAA0G;AAC1G,2GAAqG;AACrG,yGAAmG;AA4B5F,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,kDAAsB;IAC5D,YAC8B,iBAAwC,EACxC,UAAoC;QAEhE,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QAHT,sBAAiB,GAAjB,iBAAiB,CAAuB;QACxC,eAAU,GAAV,UAAU,CAA0B;IAGlE,CAAC;IAWc,AAAN,KAAK,CAAC,iBAAiB,CAAY,GAAqB;QAC/D,OAAO,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAIQ,iBAAiB;QACxB,OAAO,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAIQ,kBAAkB;QACzB,OAAO,KAAK,CAAC,kBAAkB,EAAE,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,IAAA,uBAAK,EAAC,oBAAQ,CAAC,MAAM,CAAC;IAEpB,WAAA,IAAA,cAAI,EAAC,WAAW,CAAC,CAAA;IACjB,WAAA,IAAA,iBAAO,GAAE,CAAA;;;;iEAGX;6BAlKU,kBAAkB;IAF9B,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,qDAAuB,CAAC;IACvC,IAAA,uBAAK,EAAC,oBAAQ,CAAC,KAAK,CAAC;qCAG6B,gDAAqB;QAC5B,uDAAwB;GAHvD,kBAAkB,CAmK9B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IErrorTranslationResponse } from '../../../core/modules/error-code/interfaces/error-code.interfaces';
|
|
2
|
+
import { ErrorCodeService } from './error-code.service';
|
|
3
|
+
export declare class ErrorCodeController {
|
|
4
|
+
protected readonly errorCodeService: ErrorCodeService;
|
|
5
|
+
constructor(errorCodeService: ErrorCodeService);
|
|
6
|
+
getAllCodes(): string[];
|
|
7
|
+
getTranslations(locale: string): IErrorTranslationResponse;
|
|
8
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.ErrorCodeController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const roles_decorator_1 = require("../../../core/common/decorators/roles.decorator");
|
|
18
|
+
const role_enum_1 = require("../../../core/common/enums/role.enum");
|
|
19
|
+
const error_code_service_1 = require("./error-code.service");
|
|
20
|
+
let ErrorCodeController = class ErrorCodeController {
|
|
21
|
+
constructor(errorCodeService) {
|
|
22
|
+
this.errorCodeService = errorCodeService;
|
|
23
|
+
}
|
|
24
|
+
getAllCodes() {
|
|
25
|
+
return this.errorCodeService.getErrorCodes();
|
|
26
|
+
}
|
|
27
|
+
getTranslations(locale) {
|
|
28
|
+
if (!this.errorCodeService.isLocaleSupported(locale)) {
|
|
29
|
+
throw new common_1.NotFoundException(`Locale "${locale}" is not supported. ` +
|
|
30
|
+
`Supported locales: ${this.errorCodeService.getSupportedLocales().join(', ')}`);
|
|
31
|
+
}
|
|
32
|
+
return this.errorCodeService.getTranslations(locale);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.ErrorCodeController = ErrorCodeController;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, common_1.Get)('codes'),
|
|
38
|
+
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", []),
|
|
41
|
+
__metadata("design:returntype", Array)
|
|
42
|
+
], ErrorCodeController.prototype, "getAllCodes", null);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, common_1.Get)(':locale'),
|
|
45
|
+
(0, roles_decorator_1.Roles)(role_enum_1.RoleEnum.S_EVERYONE),
|
|
46
|
+
__param(0, (0, common_1.Param)('locale')),
|
|
47
|
+
__metadata("design:type", Function),
|
|
48
|
+
__metadata("design:paramtypes", [String]),
|
|
49
|
+
__metadata("design:returntype", Object)
|
|
50
|
+
], ErrorCodeController.prototype, "getTranslations", null);
|
|
51
|
+
exports.ErrorCodeController = ErrorCodeController = __decorate([
|
|
52
|
+
(0, common_1.Controller)('api/i18n/errors'),
|
|
53
|
+
__metadata("design:paramtypes", [error_code_service_1.ErrorCodeService])
|
|
54
|
+
], ErrorCodeController);
|
|
55
|
+
//# sourceMappingURL=error-code.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-code.controller.js","sourceRoot":"","sources":["../../../../src/server/modules/error-code/error-code.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2E;AAE3E,qFAAwE;AACxE,oEAAgE;AAEhE,6DAAwD;AA4BjD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA+B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAmBrE,WAAW;QACT,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC;IAC/C,CAAC;IAyBD,eAAe,CAAkB,MAAc;QAC7C,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,0BAAiB,CACzB,WAAW,MAAM,sBAAsB;gBACrC,sBAAsB,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,MAAyB,CAAC,CAAC;IAC1E,CAAC;CACF,CAAA;AAzDY,kDAAmB;AAoB9B;IAFC,IAAA,YAAG,EAAC,OAAO,CAAC;IACZ,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;;;;sDAG1B;AAyBD;IAFC,IAAA,YAAG,EAAC,SAAS,CAAC;IACd,IAAA,uBAAK,EAAC,oBAAQ,CAAC,UAAU,CAAC;IACV,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;0DAS/B;8BAxDU,mBAAmB;IAD/B,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEqB,qCAAgB;GADtD,mBAAmB,CAyD/B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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.ErrorCodeService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_error_code_service_1 = require("../../../core/modules/error-code/core-error-code.service");
|
|
15
|
+
const error_codes_1 = require("./error-codes");
|
|
16
|
+
let ErrorCodeService = class ErrorCodeService extends core_error_code_service_1.CoreErrorCodeService {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.registerErrorRegistry(error_codes_1.ServerErrors);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.ErrorCodeService = ErrorCodeService;
|
|
23
|
+
exports.ErrorCodeService = ErrorCodeService = __decorate([
|
|
24
|
+
(0, common_1.Injectable)(),
|
|
25
|
+
__metadata("design:paramtypes", [])
|
|
26
|
+
], ErrorCodeService);
|
|
27
|
+
//# sourceMappingURL=error-code.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-code.service.js","sourceRoot":"","sources":["../../../../src/server/modules/error-code/error-code.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,sGAAgG;AAChG,+CAA6C;AAgCtC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,8CAAoB;IACxD;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,qBAAqB,CAAC,0BAAY,CAAC,CAAC;IAC3C,CAAC;CACF,CAAA;AANY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;;GACA,gBAAgB,CAM5B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const ServerErrors: {
|
|
2
|
+
readonly DEMO_ERROR: {
|
|
3
|
+
readonly code: "SRV_0001";
|
|
4
|
+
readonly message: "Demo error for testing";
|
|
5
|
+
readonly translations: {
|
|
6
|
+
readonly de: "Dies ist ein Demo-Fehler zu Testzwecken.";
|
|
7
|
+
readonly en: "This is a demo error for testing purposes.";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
readonly FEATURE_NOT_AVAILABLE: {
|
|
11
|
+
readonly code: "SRV_0002";
|
|
12
|
+
readonly message: "Feature not available in this environment";
|
|
13
|
+
readonly translations: {
|
|
14
|
+
readonly de: "Diese Funktion ist in dieser Umgebung nicht verfügbar.";
|
|
15
|
+
readonly en: "This feature is not available in this environment.";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const ErrorCode: {
|
|
20
|
+
USER_NOT_FOUND: string;
|
|
21
|
+
INVALID_PASSWORD: string;
|
|
22
|
+
INVALID_TOKEN: string;
|
|
23
|
+
TOKEN_EXPIRED: string;
|
|
24
|
+
REFRESH_TOKEN_REQUIRED: string;
|
|
25
|
+
USER_NOT_VERIFIED: string;
|
|
26
|
+
UNAUTHORIZED: string;
|
|
27
|
+
ACCESS_DENIED: string;
|
|
28
|
+
RESOURCE_FORBIDDEN: string;
|
|
29
|
+
EMAIL_ALREADY_EXISTS: string;
|
|
30
|
+
USERNAME_ALREADY_EXISTS: string;
|
|
31
|
+
VALIDATION_FAILED: string;
|
|
32
|
+
REQUIRED_FIELD_MISSING: string;
|
|
33
|
+
INVALID_FIELD_FORMAT: string;
|
|
34
|
+
RESOURCE_NOT_FOUND: string;
|
|
35
|
+
RESOURCE_ALREADY_EXISTS: string;
|
|
36
|
+
FILE_NOT_FOUND: string;
|
|
37
|
+
FILE_UPLOAD_FAILED: string;
|
|
38
|
+
FILE_TYPE_NOT_ALLOWED: string;
|
|
39
|
+
INTERNAL_ERROR: string;
|
|
40
|
+
SERVICE_UNAVAILABLE: string;
|
|
41
|
+
LEGACY_AUTH_DISABLED: string;
|
|
42
|
+
DEMO_ERROR: string;
|
|
43
|
+
FEATURE_NOT_AVAILABLE: string;
|
|
44
|
+
};
|
|
45
|
+
export type ServerErrorCodeKey = keyof typeof ErrorCode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorCode = exports.ServerErrors = void 0;
|
|
4
|
+
const error_codes_1 = require("../../../core/modules/error-code/error-codes");
|
|
5
|
+
exports.ServerErrors = {
|
|
6
|
+
DEMO_ERROR: {
|
|
7
|
+
code: 'SRV_0001',
|
|
8
|
+
message: 'Demo error for testing',
|
|
9
|
+
translations: {
|
|
10
|
+
de: 'Dies ist ein Demo-Fehler zu Testzwecken.',
|
|
11
|
+
en: 'This is a demo error for testing purposes.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
FEATURE_NOT_AVAILABLE: {
|
|
15
|
+
code: 'SRV_0002',
|
|
16
|
+
message: 'Feature not available in this environment',
|
|
17
|
+
translations: {
|
|
18
|
+
de: 'Diese Funktion ist in dieser Umgebung nicht verfügbar.',
|
|
19
|
+
en: 'This feature is not available in this environment.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.ErrorCode = (0, error_codes_1.mergeErrorCodes)(exports.ServerErrors);
|
|
24
|
+
//# sourceMappingURL=error-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../../../src/server/modules/error-code/error-codes.ts"],"names":[],"mappings":";;;AAAA,8EAA+F;AAqBlF,QAAA,YAAY,GAAG;IAK1B,UAAU,EAAE;QACV,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,wBAAwB;QACjC,YAAY,EAAE;YACZ,EAAE,EAAE,0CAA0C;YAC9C,EAAE,EAAE,4CAA4C;SACjD;KACF;IAED,qBAAqB,EAAE;QACrB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,2CAA2C;QACpD,YAAY,EAAE;YACZ,EAAE,EAAE,wDAAwD;YAC5D,EAAE,EAAE,oDAAoD;SACzD;KACF;CACgC,CAAC;AAgBvB,QAAA,SAAS,GAAG,IAAA,6BAAe,EAAC,oBAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./error-code.controller"), exports);
|
|
18
|
+
__exportStar(require("./error-code.service"), exports);
|
|
19
|
+
__exportStar(require("./error-codes"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/modules/error-code/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,0DAAwC;AAGxC,uDAAqC;AAGrC,gDAA8B"}
|
|
@@ -4,7 +4,7 @@ import { ServiceOptions } from '../../../core/common/interfaces/service-options.
|
|
|
4
4
|
import { ConfigService } from '../../../core/common/services/config.service';
|
|
5
5
|
import { EmailService } from '../../../core/common/services/email.service';
|
|
6
6
|
import { CoreModelConstructor } from '../../../core/common/types/core-model-constructor.type';
|
|
7
|
-
import {
|
|
7
|
+
import { CoreBetterAuthUserMapper } from '../../../core/modules/better-auth/core-better-auth-user.mapper';
|
|
8
8
|
import { CoreUserService } from '../../../core/modules/user/core-user.service';
|
|
9
9
|
import { UserCreateInput } from './inputs/user-create.input';
|
|
10
10
|
import { UserInput } from './inputs/user.input';
|
|
@@ -16,7 +16,7 @@ export declare class UserService extends CoreUserService<User, UserInput, UserCr
|
|
|
16
16
|
protected readonly mainDbModel: Model<UserDocument>;
|
|
17
17
|
protected readonly pubSub: PubSub;
|
|
18
18
|
private readonly betterAuthUserMapper?;
|
|
19
|
-
constructor(configService: ConfigService, emailService: EmailService, mainModelConstructor: CoreModelConstructor<User>, mainDbModel: Model<UserDocument>, pubSub: PubSub, betterAuthUserMapper?:
|
|
19
|
+
constructor(configService: ConfigService, emailService: EmailService, mainModelConstructor: CoreModelConstructor<User>, mainDbModel: Model<UserDocument>, pubSub: PubSub, betterAuthUserMapper?: CoreBetterAuthUserMapper);
|
|
20
20
|
create(input: UserCreateInput, serviceOptions?: ServiceOptions): Promise<User>;
|
|
21
21
|
update(id: string, input: UserInput, serviceOptions?: ServiceOptions): Promise<User>;
|
|
22
22
|
sendPasswordResetMail(email: string, serviceOptions?: ServiceOptions): Promise<User>;
|
|
@@ -21,7 +21,7 @@ const mongoose_2 = require("mongoose");
|
|
|
21
21
|
const translatable_decorator_1 = require("../../../core/common/decorators/translatable.decorator");
|
|
22
22
|
const config_service_1 = require("../../../core/common/services/config.service");
|
|
23
23
|
const email_service_1 = require("../../../core/common/services/email.service");
|
|
24
|
-
const
|
|
24
|
+
const core_better_auth_user_mapper_1 = require("../../../core/modules/better-auth/core-better-auth-user.mapper");
|
|
25
25
|
const core_user_service_1 = require("../../../core/modules/user/core-user.service");
|
|
26
26
|
const user_model_1 = require("./user.model");
|
|
27
27
|
let UserService = class UserService extends core_user_service_1.CoreUserService {
|
|
@@ -93,6 +93,6 @@ exports.UserService = UserService = __decorate([
|
|
|
93
93
|
__metadata("design:paramtypes", [config_service_1.ConfigService,
|
|
94
94
|
email_service_1.EmailService, Object, mongoose_2.Model,
|
|
95
95
|
graphql_subscriptions_1.PubSub,
|
|
96
|
-
|
|
96
|
+
core_better_auth_user_mapper_1.CoreBetterAuthUserMapper])
|
|
97
97
|
], UserService);
|
|
98
98
|
//# sourceMappingURL=user.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../../../src/server/modules/user/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmH;AACnH,+CAA+C;AAC/C,yBAA0B;AAC1B,iEAA+C;AAC/C,uCAAiC;AAEjC,mGAAqH;AAErH,iFAA6E;AAC7E,+EAA2E;AAE3E,
|
|
1
|
+
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../../../src/server/modules/user/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmH;AACnH,+CAA+C;AAC/C,yBAA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,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,8BAAqB,CAAC,uCAAuC,CAAC,CAAC;QAC3E,CAAC;QAGD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,qCAA4B,CAAC,qBAAqB,CAAC,CAAC;QAChE,CAAC;QAGD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,YAAY,CAAC,IAAI,YAAY,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxG,IAAI,GAAG,EAAE,CAAC;oBACR,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAGD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE9B,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAGpB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF,CAAA;AA1GY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAYR,WAAA,IAAA,eAAM,EAAC,YAAY,CAAC,CAAA;IACpB,WAAA,IAAA,sBAAW,EAAC,MAAM,CAAC,CAAA;IACnB,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;IACjB,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCALgC,8BAAa;QACd,4BAAY,UAEQ,gBAAK;QACrB,8BAAM;QACA,uDAAwB;GAdnE,WAAW,CA0GvB"}
|
|
@@ -15,11 +15,14 @@ const any_scalar_1 = require("../core/common/scalars/any.scalar");
|
|
|
15
15
|
const date_scalar_1 = require("../core/common/scalars/date.scalar");
|
|
16
16
|
const json_scalar_1 = require("../core/common/scalars/json.scalar");
|
|
17
17
|
const core_auth_service_1 = require("../core/modules/auth/services/core-auth.service");
|
|
18
|
+
const error_code_module_1 = require("../core/modules/error-code/error-code.module");
|
|
18
19
|
const tus_1 = require("../core/modules/tus");
|
|
19
20
|
const cron_jobs_service_1 = require("./common/services/cron-jobs.service");
|
|
20
21
|
const auth_controller_1 = require("./modules/auth/auth.controller");
|
|
21
22
|
const auth_module_1 = require("./modules/auth/auth.module");
|
|
22
23
|
const better_auth_module_1 = require("./modules/better-auth/better-auth.module");
|
|
24
|
+
const error_code_controller_1 = require("./modules/error-code/error-code.controller");
|
|
25
|
+
const error_code_service_1 = require("./modules/error-code/error-code.service");
|
|
23
26
|
const file_module_1 = require("./modules/file/file.module");
|
|
24
27
|
const server_controller_1 = require("./server.controller");
|
|
25
28
|
let ServerModule = class ServerModule {
|
|
@@ -37,6 +40,10 @@ exports.ServerModule = ServerModule = __decorate([
|
|
|
37
40
|
config: config_env_1.default.betterAuth,
|
|
38
41
|
fallbackSecrets: [config_env_1.default.jwt?.secret, config_env_1.default.jwt?.refresh?.secret],
|
|
39
42
|
}),
|
|
43
|
+
error_code_module_1.ErrorCodeModule.forRoot({
|
|
44
|
+
controller: error_code_controller_1.ErrorCodeController,
|
|
45
|
+
service: error_code_service_1.ErrorCodeService,
|
|
46
|
+
}),
|
|
40
47
|
file_module_1.FileModule,
|
|
41
48
|
tus_1.TusModule.forRoot(),
|
|
42
49
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.module.js","sourceRoot":"","sources":["../../src/server/server.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAElD,8CAAsC;AACtC,gDAA4C;AAC5C,kEAAwD;AACxD,oEAAgE;AAChE,oEAA0D;AAC1D,uFAAkF;AAClF,6CAAgD;AAChD,2EAA+D;AAC/D,oEAAgE;AAChE,4DAAwD;AACxD,iFAA4E;AAC5E,4DAAwD;AACxD,2DAAuD;
|
|
1
|
+
{"version":3,"file":"server.module.js","sourceRoot":"","sources":["../../src/server/server.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;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TestHelper {
|
|
|
178
178
|
logError: false,
|
|
179
179
|
method: options?.attachments ? 'POST' : 'GET',
|
|
180
180
|
payload: null,
|
|
181
|
+
returnResponse: false,
|
|
181
182
|
statusCode: 200,
|
|
182
183
|
token: null,
|
|
183
184
|
...options,
|
|
184
185
|
};
|
|
185
|
-
const { attachments, log, logError, statusCode, token } = config;
|
|
186
|
+
const { attachments, log, logError, returnResponse, statusCode, token } = config;
|
|
186
187
|
const requestConfig = {
|
|
187
188
|
headers: config.headers,
|
|
188
189
|
method: config.method,
|
|
@@ -192,6 +193,9 @@ class TestHelper {
|
|
|
192
193
|
requestConfig.payload = config.payload;
|
|
193
194
|
}
|
|
194
195
|
const response = await this.getResponse(token, requestConfig, statusCode, log, logError, null, attachments);
|
|
196
|
+
if (returnResponse) {
|
|
197
|
+
return response;
|
|
198
|
+
}
|
|
195
199
|
let result = response.text;
|
|
196
200
|
if (response.text === '') {
|
|
197
201
|
return null;
|