@darraghor/nest-backend-libs 3.12.4 → 4.0.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/authorization/authz.module.d.ts +4 -0
- package/dist/authorization/authz.module.js +31 -20
- package/dist/authorization/authz.module.js.map +1 -1
- package/dist/authorization/authz.options.d.ts +12 -0
- package/dist/authorization/authz.options.js +2 -0
- package/dist/authorization/authz.options.js.map +1 -0
- package/dist/authorization/config/AuthConfigurationService.d.ts +3 -3
- package/dist/authorization/config/AuthConfigurationService.js +13 -17
- package/dist/authorization/config/AuthConfigurationService.js.map +1 -1
- package/dist/authzclient/AuthClientConfigurationService.d.ts +3 -3
- package/dist/authzclient/AuthClientConfigurationService.js +12 -9
- package/dist/authzclient/AuthClientConfigurationService.js.map +1 -1
- package/dist/authzclient/authz-client.module.d.ts +4 -0
- package/dist/authzclient/authz-client.module.js +27 -14
- package/dist/authzclient/authz-client.module.js.map +1 -1
- package/dist/authzclient/authz-client.options.d.ts +11 -0
- package/dist/authzclient/authz-client.options.js +2 -0
- package/dist/authzclient/authz-client.options.js.map +1 -0
- package/dist/core-config/CoreConfig.module.d.ts +4 -0
- package/dist/core-config/CoreConfig.module.js +24 -9
- package/dist/core-config/CoreConfig.module.js.map +1 -1
- package/dist/core-config/CoreConfigurationService.d.ts +3 -3
- package/dist/core-config/CoreConfigurationService.js +19 -17
- package/dist/core-config/CoreConfigurationService.js.map +1 -1
- package/dist/core-config/core-config.options.d.ts +18 -0
- package/dist/core-config/core-config.options.js +2 -0
- package/dist/core-config/core-config.options.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/invitations/InvitationConfigurationService.d.ts +3 -3
- package/dist/invitations/InvitationConfigurationService.js +11 -8
- package/dist/invitations/InvitationConfigurationService.js.map +1 -1
- package/dist/invitations/invitation.module.d.ts +4 -0
- package/dist/invitations/invitation.module.js +34 -16
- package/dist/invitations/invitation.module.js.map +1 -1
- package/dist/invitations/invitation.options.d.ts +10 -0
- package/dist/invitations/invitation.options.js +2 -0
- package/dist/invitations/invitation.options.js.map +1 -0
- package/dist/logger/LoggingConfigurationService.d.ts +3 -3
- package/dist/logger/LoggingConfigurationService.js +14 -11
- package/dist/logger/LoggingConfigurationService.js.map +1 -1
- package/dist/logger/logger.module.d.ts +4 -0
- package/dist/logger/logger.module.js +24 -9
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/logger/logger.options.d.ts +13 -0
- package/dist/logger/logger.options.js +2 -0
- package/dist/logger/logger.options.js.map +1 -0
- package/dist/root-app/core-app.module.d.ts +9 -1
- package/dist/root-app/core-app.module.js +89 -65
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/smtp-email-client/EmailConfigurationService.d.ts +3 -3
- package/dist/smtp-email-client/EmailConfigurationService.js +18 -16
- package/dist/smtp-email-client/EmailConfigurationService.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.module.d.ts +4 -0
- package/dist/smtp-email-client/smtp-email-client.module.js +34 -21
- package/dist/smtp-email-client/smtp-email-client.module.js.map +1 -1
- package/dist/smtp-email-client/smtp-email-client.options.d.ts +17 -0
- package/dist/smtp-email-client/smtp-email-client.options.js +2 -0
- package/dist/smtp-email-client/smtp-email-client.options.js.map +1 -0
- package/dist/stripe-client/StripeClientConfigurationService.d.ts +3 -3
- package/dist/stripe-client/StripeClientConfigurationService.js +13 -10
- package/dist/stripe-client/StripeClientConfigurationService.js.map +1 -1
- package/dist/stripe-client/stripe-account.module.d.ts +4 -0
- package/dist/stripe-client/stripe-account.module.js +50 -39
- package/dist/stripe-client/stripe-account.module.js.map +1 -1
- package/dist/stripe-client/stripe-account.options.d.ts +12 -0
- package/dist/stripe-client/stripe-account.options.js +2 -0
- package/dist/stripe-client/stripe-account.options.js.map +1 -0
- package/dist/twitter-client/TwitterClientConfigurationService.d.ts +3 -3
- package/dist/twitter-client/TwitterClientConfigurationService.js +14 -11
- package/dist/twitter-client/TwitterClientConfigurationService.js.map +1 -1
- package/dist/twitter-client/twitter-account.module.d.ts +4 -0
- package/dist/twitter-client/twitter-account.module.js +26 -14
- package/dist/twitter-client/twitter-account.module.js.map +1 -1
- package/dist/twitter-client/twitter-account.options.d.ts +13 -0
- package/dist/twitter-client/twitter-account.options.js +2 -0
- package/dist/twitter-client/twitter-account.options.js.map +1 -0
- package/package.json +1 -1
- package/dist/authorization/config/AuthConfigurationVariables.d.ts +0 -10
- package/dist/authorization/config/AuthConfigurationVariables.js +0 -7
- package/dist/authorization/config/AuthConfigurationVariables.js.map +0 -1
- package/dist/authzclient/AuthClientConfigurationVariables.d.ts +0 -8
- package/dist/authzclient/AuthClientConfigurationVariables.js +0 -6
- package/dist/authzclient/AuthClientConfigurationVariables.js.map +0 -1
- package/dist/core-config/CoreConfigurationVariables.d.ts +0 -26
- package/dist/core-config/CoreConfigurationVariables.js +0 -15
- package/dist/core-config/CoreConfigurationVariables.js.map +0 -1
- package/dist/invitations/InvitationConfigurationVariables.d.ts +0 -6
- package/dist/invitations/InvitationConfigurationVariables.js +0 -5
- package/dist/invitations/InvitationConfigurationVariables.js.map +0 -1
- package/dist/logger/LoggingConfigurationVariables.d.ts +0 -12
- package/dist/logger/LoggingConfigurationVariables.js +0 -8
- package/dist/logger/LoggingConfigurationVariables.js.map +0 -1
- package/dist/smtp-email-client/EmailConfigurationVariables.d.ts +0 -20
- package/dist/smtp-email-client/EmailConfigurationVariables.js +0 -12
- package/dist/smtp-email-client/EmailConfigurationVariables.js.map +0 -1
- package/dist/stripe-client/StripeConfigurationVariables.d.ts +0 -10
- package/dist/stripe-client/StripeConfigurationVariables.js +0 -7
- package/dist/stripe-client/StripeConfigurationVariables.js.map +0 -1
- package/dist/twitter-client/TwitterConfigurationVariables.d.ts +0 -12
- package/dist/twitter-client/TwitterConfigurationVariables.js +0 -8
- package/dist/twitter-client/TwitterConfigurationVariables.js.map +0 -1
|
@@ -7,19 +7,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
13
14
|
import { IsDefined, IsString } from "class-validator";
|
|
14
15
|
import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService.js";
|
|
16
|
+
import { INVITATION_MODULE_OPTIONS, } from "./invitation.options.js";
|
|
15
17
|
let InvitationsConfigurationService = class InvitationsConfigurationService extends ValidatedConfigurationService {
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
+
options;
|
|
19
|
+
constructor(options) {
|
|
18
20
|
super();
|
|
19
|
-
this.
|
|
21
|
+
this.options = options;
|
|
20
22
|
}
|
|
21
23
|
get baseUrl() {
|
|
22
|
-
return this.
|
|
24
|
+
return this.options.baseUrl;
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
__decorate([
|
|
@@ -30,7 +32,8 @@ __decorate([
|
|
|
30
32
|
], InvitationsConfigurationService.prototype, "baseUrl", null);
|
|
31
33
|
InvitationsConfigurationService = __decorate([
|
|
32
34
|
Injectable(),
|
|
33
|
-
|
|
35
|
+
__param(0, Inject(INVITATION_MODULE_OPTIONS)),
|
|
36
|
+
__metadata("design:paramtypes", [Object])
|
|
34
37
|
], InvitationsConfigurationService);
|
|
35
38
|
export { InvitationsConfigurationService };
|
|
36
39
|
//# sourceMappingURL=InvitationConfigurationService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvitationConfigurationService.js","sourceRoot":"","sources":["../../src/invitations/InvitationConfigurationService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvitationConfigurationService.js","sourceRoot":"","sources":["../../src/invitations/InvitationConfigurationService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,6BAA6B,EAAC,MAAM,mDAAmD,CAAC;AAChG,OAAO,EACH,yBAAyB,GAE5B,MAAM,yBAAyB,CAAC;AAG1B,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,6BAA6B;IAGlE;IAFZ,YAEY,OAAgC;QAExC,KAAK,EAAE,CAAC;QAFA,YAAO,GAAP,OAAO,CAAyB;IAG5C,CAAC;IAED,IAEI,OAAO;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC,CAAC;CACJ,CAAA;AALG;IAAC,SAAS,EAAE;IACX,QAAQ,EAAE;;;8DAGV;AAZQ,+BAA+B;IAD3C,UAAU,EAAE;IAGJ,WAAA,MAAM,CAAC,yBAAyB,CAAC,CAAA;;GAF7B,+BAA+B,CAa3C"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import { DynamicModule } from "@nestjs/common";
|
|
2
|
+
import { InvitationModuleAsyncOptions } from "./invitation.options.js";
|
|
1
3
|
export declare class InvitationModule {
|
|
4
|
+
static forRoot(): never;
|
|
5
|
+
static forRootAsync(options: InvitationModuleAsyncOptions): DynamicModule;
|
|
2
6
|
}
|
|
@@ -4,32 +4,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var InvitationModule_1;
|
|
7
8
|
import { Module } from "@nestjs/common";
|
|
8
9
|
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
9
10
|
import { Invitation } from "./entities/invitation.entity.js";
|
|
10
11
|
import { InvitationController } from "./invitation.controller.js";
|
|
11
12
|
import { InvitationService } from "./invitation.service.js";
|
|
12
|
-
import { SmtpEmailClientModule } from "../smtp-email-client/smtp-email-client.module.js";
|
|
13
13
|
import { OrganisationModule } from "../organisation/organisation.module.js";
|
|
14
|
-
import { ConfigModule } from "@nestjs/config";
|
|
15
|
-
import configVariables from "./InvitationConfigurationVariables.js";
|
|
16
14
|
import { InvitationsConfigurationService } from "./InvitationConfigurationService.js";
|
|
17
15
|
import { OrganisationMembership } from "../organisation-memberships/entities/organisation-membership.entity.js";
|
|
18
16
|
import { User } from "../user/entities/user.entity.js";
|
|
19
|
-
|
|
17
|
+
import { INVITATION_MODULE_OPTIONS, } from "./invitation.options.js";
|
|
18
|
+
let InvitationModule = InvitationModule_1 = class InvitationModule {
|
|
19
|
+
static forRoot() {
|
|
20
|
+
throw new Error("InvitationModule.forRoot() is not supported. Use forRootAsync() instead.");
|
|
21
|
+
}
|
|
22
|
+
static forRootAsync(options) {
|
|
23
|
+
return {
|
|
24
|
+
module: InvitationModule_1,
|
|
25
|
+
global: options.isGlobal ?? false,
|
|
26
|
+
imports: [
|
|
27
|
+
...(options.imports || []),
|
|
28
|
+
OrganisationModule,
|
|
29
|
+
TypeOrmModule.forFeature([
|
|
30
|
+
OrganisationMembership,
|
|
31
|
+
User,
|
|
32
|
+
Invitation,
|
|
33
|
+
]),
|
|
34
|
+
],
|
|
35
|
+
controllers: [InvitationController],
|
|
36
|
+
providers: [
|
|
37
|
+
{
|
|
38
|
+
provide: INVITATION_MODULE_OPTIONS,
|
|
39
|
+
useFactory: options.useFactory,
|
|
40
|
+
inject: options.inject || [],
|
|
41
|
+
},
|
|
42
|
+
InvitationsConfigurationService,
|
|
43
|
+
InvitationService,
|
|
44
|
+
],
|
|
45
|
+
exports: [InvitationService],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
20
48
|
};
|
|
21
|
-
InvitationModule = __decorate([
|
|
22
|
-
Module({
|
|
23
|
-
imports: [
|
|
24
|
-
ConfigModule.forFeature(configVariables),
|
|
25
|
-
OrganisationModule,
|
|
26
|
-
SmtpEmailClientModule,
|
|
27
|
-
TypeOrmModule.forFeature([OrganisationMembership, User, Invitation]),
|
|
28
|
-
],
|
|
29
|
-
controllers: [InvitationController],
|
|
30
|
-
providers: [InvitationsConfigurationService, InvitationService],
|
|
31
|
-
exports: [InvitationService],
|
|
32
|
-
})
|
|
49
|
+
InvitationModule = InvitationModule_1 = __decorate([
|
|
50
|
+
Module({})
|
|
33
51
|
], InvitationModule);
|
|
34
52
|
export { InvitationModule };
|
|
35
53
|
//# sourceMappingURL=invitation.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.module.js","sourceRoot":"","sources":["../../src/invitations/invitation.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitation.module.js","sourceRoot":"","sources":["../../src/invitations/invitation.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAgB,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAC,+BAA+B,EAAC,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAC,sBAAsB,EAAC,MAAM,wEAAwE,CAAC;AAC9G,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AACrD,OAAO,EACH,yBAAyB,GAE5B,MAAM,yBAAyB,CAAC;AAG1B,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IACzB,MAAM,CAAC,OAAO;QACV,MAAM,IAAI,KAAK,CACX,0EAA0E,CAC7E,CAAC;IACN,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAqC;QACrD,OAAO;YACH,MAAM,EAAE,kBAAgB;YACxB,MAAM,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;YACjC,OAAO,EAAE;gBACL,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;gBAC1B,kBAAkB;gBAClB,aAAa,CAAC,UAAU,CAAC;oBACrB,sBAAsB;oBACtB,IAAI;oBACJ,UAAU;iBACb,CAAC;aACL;YACD,WAAW,EAAE,CAAC,oBAAoB,CAAC;YACnC,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,yBAAyB;oBAClC,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;iBAC/B;gBACD,+BAA+B;gBAC/B,iBAAiB;aACpB;YACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC/B,CAAC;IACN,CAAC;CACJ,CAAA;AAjCY,gBAAgB;IAD5B,MAAM,CAAC,EAAE,CAAC;GACE,gBAAgB,CAiC5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModuleMetadata } from "@nestjs/common";
|
|
2
|
+
export declare const INVITATION_MODULE_OPTIONS: unique symbol;
|
|
3
|
+
export interface InvitationModuleOptions {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
}
|
|
6
|
+
export interface InvitationModuleAsyncOptions extends Pick<ModuleMetadata, "imports"> {
|
|
7
|
+
useFactory: (...args: any[]) => Promise<InvitationModuleOptions> | InvitationModuleOptions;
|
|
8
|
+
inject?: any[];
|
|
9
|
+
isGlobal?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.options.js","sourceRoot":"","sources":["../../src/invitations/invitation.options.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ConfigService } from "@nestjs/config";
|
|
2
1
|
import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService.js";
|
|
2
|
+
import { LoggerModuleOptions } from "./logger.options.js";
|
|
3
3
|
export declare class LoggingConfigurationService extends ValidatedConfigurationService {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private options;
|
|
5
|
+
constructor(options: LoggerModuleOptions);
|
|
6
6
|
get shouldLogForDevelopment(): boolean;
|
|
7
7
|
get loggerName(): string;
|
|
8
8
|
get minLevel(): string;
|
|
@@ -7,28 +7,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
12
14
|
import { IsBoolean, IsDefined, IsOptional, IsString } from "class-validator";
|
|
13
15
|
import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService.js";
|
|
16
|
+
import { LOGGER_MODULE_OPTIONS } from "./logger.options.js";
|
|
14
17
|
let LoggingConfigurationService = class LoggingConfigurationService extends ValidatedConfigurationService {
|
|
15
|
-
|
|
16
|
-
constructor(
|
|
18
|
+
options;
|
|
19
|
+
constructor(options) {
|
|
17
20
|
super();
|
|
18
|
-
this.
|
|
21
|
+
this.options = options;
|
|
19
22
|
}
|
|
20
23
|
get shouldLogForDevelopment() {
|
|
21
|
-
return this.
|
|
24
|
+
return this.options.nodeEnv === "dev";
|
|
22
25
|
}
|
|
23
26
|
get loggerName() {
|
|
24
|
-
return
|
|
25
|
-
"DefaultLogger");
|
|
27
|
+
return this.options.loggerName ?? "DefaultLogger";
|
|
26
28
|
}
|
|
27
29
|
get minLevel() {
|
|
28
|
-
return
|
|
30
|
+
return this.options.minLevel ?? "debug";
|
|
29
31
|
}
|
|
30
32
|
get usePrettyLogs() {
|
|
31
|
-
return
|
|
33
|
+
return this.options.usePrettyLogs ?? false;
|
|
32
34
|
}
|
|
33
35
|
};
|
|
34
36
|
__decorate([
|
|
@@ -57,7 +59,8 @@ __decorate([
|
|
|
57
59
|
], LoggingConfigurationService.prototype, "usePrettyLogs", null);
|
|
58
60
|
LoggingConfigurationService = __decorate([
|
|
59
61
|
Injectable(),
|
|
60
|
-
|
|
62
|
+
__param(0, Inject(LOGGER_MODULE_OPTIONS)),
|
|
63
|
+
__metadata("design:paramtypes", [Object])
|
|
61
64
|
], LoggingConfigurationService);
|
|
62
65
|
export { LoggingConfigurationService };
|
|
63
66
|
//# sourceMappingURL=LoggingConfigurationService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggingConfigurationService.js","sourceRoot":"","sources":["../../src/logger/LoggingConfigurationService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoggingConfigurationService.js","sourceRoot":"","sources":["../../src/logger/LoggingConfigurationService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAC,6BAA6B,EAAC,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAC,qBAAqB,EAAsB,MAAM,qBAAqB,CAAC;AAGxE,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,6BAA6B;IAG9D;IAFZ,YAEY,OAA4B;QAEpC,KAAK,EAAE,CAAC;QAFA,YAAO,GAAP,OAAO,CAAqB;IAGxC,CAAC;IAED,IAEI,uBAAuB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC;IAC1C,CAAC;IAED,IAEI,UAAU;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,eAAe,CAAC;IACtD,CAAC;IAED,IAEI,QAAQ;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IAC5C,CAAC;IAED,IAEI,aAAa;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC;IAC/C,CAAC;CACJ,CAAA;AAvBG;IAAC,SAAS,EAAE;IACX,SAAS,EAAE;;;0EAGX;AAED;IAAC,QAAQ,EAAE;IACV,SAAS,EAAE;;;6DAGX;AAED;IAAC,QAAQ,EAAE;IACV,UAAU,EAAE;;;2DAGZ;AAED;IAAC,SAAS,EAAE;IACX,UAAU,EAAE;;;gEAGZ;AA9BQ,2BAA2B;IADvC,UAAU,EAAE;IAGJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;;GAFzB,2BAA2B,CA+BvC"}
|
|
@@ -4,19 +4,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var LoggerModule_1;
|
|
7
8
|
import { Global, Module } from "@nestjs/common";
|
|
8
|
-
import { ConfigModule } from "@nestjs/config";
|
|
9
9
|
import { LoggingConfigurationService } from "./LoggingConfigurationService.js";
|
|
10
|
-
import
|
|
11
|
-
let LoggerModule = class LoggerModule {
|
|
10
|
+
import { LOGGER_MODULE_OPTIONS, } from "./logger.options.js";
|
|
11
|
+
let LoggerModule = LoggerModule_1 = class LoggerModule {
|
|
12
|
+
static forRoot() {
|
|
13
|
+
throw new Error("LoggerModule.forRoot() is not supported. Use forRootAsync() instead.");
|
|
14
|
+
}
|
|
15
|
+
static forRootAsync(options) {
|
|
16
|
+
return {
|
|
17
|
+
module: LoggerModule_1,
|
|
18
|
+
global: options.isGlobal ?? true,
|
|
19
|
+
imports: [...(options.imports || [])],
|
|
20
|
+
providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: LOGGER_MODULE_OPTIONS,
|
|
23
|
+
useFactory: options.useFactory,
|
|
24
|
+
inject: options.inject || [],
|
|
25
|
+
},
|
|
26
|
+
LoggingConfigurationService,
|
|
27
|
+
],
|
|
28
|
+
exports: [LoggingConfigurationService],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
12
31
|
};
|
|
13
|
-
LoggerModule = __decorate([
|
|
32
|
+
LoggerModule = LoggerModule_1 = __decorate([
|
|
14
33
|
Global(),
|
|
15
|
-
Module({
|
|
16
|
-
imports: [ConfigModule.forFeature(configVariables)],
|
|
17
|
-
providers: [LoggingConfigurationService],
|
|
18
|
-
exports: [LoggingConfigurationService],
|
|
19
|
-
})
|
|
34
|
+
Module({})
|
|
20
35
|
], LoggerModule);
|
|
21
36
|
export { LoggerModule };
|
|
22
37
|
//# sourceMappingURL=logger.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../src/logger/logger.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.module.js","sourceRoot":"","sources":["../../src/logger/logger.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,2BAA2B,EAAC,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACH,qBAAqB,GAExB,MAAM,qBAAqB,CAAC;AAItB,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACrB,MAAM,CAAC,OAAO;QACV,MAAM,IAAI,KAAK,CACX,sEAAsE,CACzE,CAAC;IACN,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAiC;QACjD,OAAO;YACH,MAAM,EAAE,cAAY;YACpB,MAAM,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI;YAChC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YACrC,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,qBAAqB;oBAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;iBAC/B;gBACD,2BAA2B;aAC9B;YACD,OAAO,EAAE,CAAC,2BAA2B,CAAC;SACzC,CAAC;IACN,CAAC;CACJ,CAAA;AAvBY,YAAY;IAFxB,MAAM,EAAE;IACR,MAAM,CAAC,EAAE,CAAC;GACE,YAAY,CAuBxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModuleMetadata } from "@nestjs/common";
|
|
2
|
+
export declare const LOGGER_MODULE_OPTIONS: unique symbol;
|
|
3
|
+
export interface LoggerModuleOptions {
|
|
4
|
+
nodeEnv: string;
|
|
5
|
+
loggerName?: string;
|
|
6
|
+
minLevel?: string;
|
|
7
|
+
usePrettyLogs?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface LoggerModuleAsyncOptions extends Pick<ModuleMetadata, "imports"> {
|
|
10
|
+
useFactory: (...args: any[]) => Promise<LoggerModuleOptions> | LoggerModuleOptions;
|
|
11
|
+
inject?: any[];
|
|
12
|
+
isGlobal?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.options.js","sourceRoot":"","sources":["../../src/logger/logger.options.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { INestApplication, NestApplicationOptions } from "@nestjs/common";
|
|
2
|
+
import { DynamicModule, INestApplication, NestApplicationOptions } from "@nestjs/common";
|
|
3
|
+
import { CoreModuleAsyncOptions } from "../core-config/core-config.options.js";
|
|
4
|
+
import { LoggerModuleAsyncOptions } from "../logger/logger.options.js";
|
|
5
|
+
export interface CoreModuleForRootAsyncOptions {
|
|
6
|
+
core: CoreModuleAsyncOptions;
|
|
7
|
+
logger: LoggerModuleAsyncOptions;
|
|
8
|
+
}
|
|
3
9
|
export declare class CoreModule {
|
|
10
|
+
static forRoot(): never;
|
|
11
|
+
static forRootAsync(options: CoreModuleForRootAsyncOptions): DynamicModule;
|
|
4
12
|
static initApplication(rootModule: any, callback: (appModule: INestApplication) => void | Promise<void>, options?: NestApplicationOptions): void;
|
|
5
13
|
}
|
|
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var CoreModule_1;
|
|
7
8
|
import "reflect-metadata";
|
|
8
9
|
import helmet from "helmet";
|
|
9
10
|
import { BadRequestException, ClassSerializerInterceptor, Module, ValidationPipe, } from "@nestjs/common";
|
|
@@ -14,15 +15,92 @@ import { SwaggerGen } from "./SwaggerGen.js";
|
|
|
14
15
|
import { NestFactory, Reflector } from "@nestjs/core";
|
|
15
16
|
import { CoreConfigurationService } from "../core-config/CoreConfigurationService.js";
|
|
16
17
|
import { CoreConfigModule } from "../core-config/CoreConfig.module.js";
|
|
17
|
-
import { ConfigModule } from "@nestjs/config";
|
|
18
18
|
import { BullModule } from "@nestjs/bull";
|
|
19
19
|
import { HealthModule } from "../health/Health.module.js";
|
|
20
|
-
import { LoggerModule as LoggingConfigModule } from "../logger/logger.module.js";
|
|
21
|
-
import { LoggingConfigurationService } from "../logger/LoggingConfigurationService.js";
|
|
22
|
-
import { AuthzModule } from "../authorization/authz.module.js";
|
|
23
20
|
import { CacheModule } from "@nestjs/cache-manager";
|
|
24
21
|
import KeyvRedis from "@keyv/redis";
|
|
25
|
-
|
|
22
|
+
import { LOGGER_MODULE_OPTIONS, } from "../logger/logger.options.js";
|
|
23
|
+
import { LoggingConfigurationService } from "../logger/LoggingConfigurationService.js";
|
|
24
|
+
let CoreModule = CoreModule_1 = class CoreModule {
|
|
25
|
+
static forRoot() {
|
|
26
|
+
throw new Error("CoreModule.forRoot() is not supported. Use forRootAsync() instead.");
|
|
27
|
+
}
|
|
28
|
+
static forRootAsync(options) {
|
|
29
|
+
return {
|
|
30
|
+
module: CoreModule_1,
|
|
31
|
+
global: true,
|
|
32
|
+
imports: [
|
|
33
|
+
// Core config
|
|
34
|
+
CoreConfigModule.forRootAsync(options.core),
|
|
35
|
+
// Bull queue - uses core config
|
|
36
|
+
BullModule.forRootAsync({
|
|
37
|
+
imports: [CoreConfigModule.forRootAsync(options.core)],
|
|
38
|
+
useFactory: (configService) => {
|
|
39
|
+
const redisUrl = new URL(configService.bullQueueHost);
|
|
40
|
+
return {
|
|
41
|
+
redis: {
|
|
42
|
+
host: redisUrl.hostname,
|
|
43
|
+
password: redisUrl.password,
|
|
44
|
+
port: Number(redisUrl.port),
|
|
45
|
+
username: redisUrl.username,
|
|
46
|
+
maxRetriesPerRequest: 3,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
inject: [CoreConfigurationService],
|
|
51
|
+
}),
|
|
52
|
+
// Cache - uses core config
|
|
53
|
+
CacheModule.registerAsync({
|
|
54
|
+
imports: [CoreConfigModule.forRootAsync(options.core)],
|
|
55
|
+
useFactory: (configService) => {
|
|
56
|
+
const redis = new KeyvRedis(configService.bullQueueHost);
|
|
57
|
+
return {
|
|
58
|
+
stores: [redis],
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
isGlobal: true,
|
|
62
|
+
inject: [CoreConfigurationService],
|
|
63
|
+
}),
|
|
64
|
+
// Health check
|
|
65
|
+
HealthModule,
|
|
66
|
+
// Pino logger - uses logger config
|
|
67
|
+
LoggerModule.forRootAsync({
|
|
68
|
+
imports: [...(options.logger.imports || [])],
|
|
69
|
+
inject: [LOGGER_MODULE_OPTIONS],
|
|
70
|
+
useFactory: (loggerOptions) => {
|
|
71
|
+
return {
|
|
72
|
+
pinoHttp: {
|
|
73
|
+
level: loggerOptions.minLevel ?? "debug",
|
|
74
|
+
transport: loggerOptions.usePrettyLogs
|
|
75
|
+
? { target: "pino-pretty" }
|
|
76
|
+
: undefined,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
],
|
|
82
|
+
controllers: [AppController],
|
|
83
|
+
providers: [
|
|
84
|
+
// Provide logger options for pino config
|
|
85
|
+
{
|
|
86
|
+
provide: LOGGER_MODULE_OPTIONS,
|
|
87
|
+
useFactory: options.logger.useFactory,
|
|
88
|
+
inject: options.logger.inject || [],
|
|
89
|
+
},
|
|
90
|
+
LoggingConfigurationService,
|
|
91
|
+
AppService,
|
|
92
|
+
SwaggerGen,
|
|
93
|
+
],
|
|
94
|
+
exports: [
|
|
95
|
+
BullModule,
|
|
96
|
+
CacheModule,
|
|
97
|
+
CoreConfigModule,
|
|
98
|
+
LoggerModule,
|
|
99
|
+
LoggingConfigurationService,
|
|
100
|
+
SwaggerGen,
|
|
101
|
+
],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
26
104
|
static initApplication(
|
|
27
105
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
106
|
rootModule, callback,
|
|
@@ -54,22 +132,22 @@ let CoreModule = class CoreModule {
|
|
|
54
132
|
whitelist: true,
|
|
55
133
|
forbidNonWhitelisted: true,
|
|
56
134
|
forbidUnknownValues: true,
|
|
57
|
-
exceptionFactory: (
|
|
58
|
-
loggerService.error(
|
|
135
|
+
exceptionFactory: (error) => {
|
|
136
|
+
loggerService.error(error);
|
|
59
137
|
throw new BadRequestException("Bad request, please check your input");
|
|
60
138
|
},
|
|
61
139
|
}));
|
|
62
140
|
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
|
|
63
141
|
const swaggerGen = app.get(SwaggerGen);
|
|
64
142
|
swaggerGen.generate(app, "open-api/swagger.json");
|
|
65
|
-
const baseUrl = `http://localhost:${configService.webPort}`;
|
|
143
|
+
const baseUrl = `http://localhost:${String(configService.webPort)}`;
|
|
66
144
|
const prefixPath = configService.globalPrefix
|
|
67
145
|
? `/${configService.globalPrefix}`
|
|
68
146
|
: "";
|
|
69
147
|
const swaggerPath = configService.globalPrefix
|
|
70
148
|
? `/${configService.globalPrefix}/swagger`
|
|
71
149
|
: "/swagger";
|
|
72
|
-
loggerService.log(`will listen on port ${configService.webPort} (DEV: ${baseUrl}${prefixPath} )`);
|
|
150
|
+
loggerService.log(`will listen on port ${String(configService.webPort)} (DEV: ${baseUrl}${prefixPath} )`);
|
|
73
151
|
loggerService.log(`swagger will be available at (DEV: ${baseUrl}${swaggerPath} )`);
|
|
74
152
|
app.enableShutdownHooks();
|
|
75
153
|
await callback(app);
|
|
@@ -84,62 +162,8 @@ let CoreModule = class CoreModule {
|
|
|
84
162
|
})();
|
|
85
163
|
}
|
|
86
164
|
};
|
|
87
|
-
CoreModule = __decorate([
|
|
88
|
-
Module({
|
|
89
|
-
imports: [
|
|
90
|
-
AuthzModule,
|
|
91
|
-
BullModule.forRootAsync({
|
|
92
|
-
imports: [CoreConfigModule],
|
|
93
|
-
useFactory: (configService) => {
|
|
94
|
-
const redisUrl = new URL(configService.bullQueueHost || "redis://localhost");
|
|
95
|
-
return {
|
|
96
|
-
redis: {
|
|
97
|
-
host: redisUrl.hostname,
|
|
98
|
-
password: redisUrl.password,
|
|
99
|
-
port: Number(redisUrl.port),
|
|
100
|
-
username: redisUrl.username,
|
|
101
|
-
maxRetriesPerRequest: 3,
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
},
|
|
105
|
-
inject: [CoreConfigurationService],
|
|
106
|
-
}),
|
|
107
|
-
CacheModule.registerAsync({
|
|
108
|
-
imports: [CoreConfigModule],
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
110
|
-
useFactory: async (configService) => {
|
|
111
|
-
console.debug("Loading cache module with url", configService.bullQueueHost);
|
|
112
|
-
const redis = new KeyvRedis(configService.bullQueueHost);
|
|
113
|
-
return {
|
|
114
|
-
stores: [redis],
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
isGlobal: true,
|
|
118
|
-
inject: [CoreConfigurationService],
|
|
119
|
-
}),
|
|
120
|
-
ConfigModule.forRoot({ cache: true, isGlobal: true }),
|
|
121
|
-
CoreConfigModule,
|
|
122
|
-
HealthModule,
|
|
123
|
-
LoggerModule.forRootAsync({
|
|
124
|
-
imports: [LoggingConfigModule],
|
|
125
|
-
inject: [LoggingConfigurationService],
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
127
|
-
useFactory: async (config) => {
|
|
128
|
-
return {
|
|
129
|
-
pinoHttp: {
|
|
130
|
-
level: config.minLevel,
|
|
131
|
-
transport: config.usePrettyLogs
|
|
132
|
-
? { target: "pino-pretty" }
|
|
133
|
-
: undefined,
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
}),
|
|
138
|
-
],
|
|
139
|
-
controllers: [AppController],
|
|
140
|
-
providers: [AppService, SwaggerGen],
|
|
141
|
-
exports: [AuthzModule, BullModule, CacheModule, LoggerModule, SwaggerGen],
|
|
142
|
-
})
|
|
165
|
+
CoreModule = CoreModule_1 = __decorate([
|
|
166
|
+
Module({})
|
|
143
167
|
], CoreModule);
|
|
144
168
|
export { CoreModule };
|
|
145
169
|
//# sourceMappingURL=core-app.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-app.module.js","sourceRoot":"","sources":["../../src/root-app/core-app.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-app.module.js","sourceRoot":"","sources":["../../src/root-app/core-app.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACH,mBAAmB,EACnB,0BAA0B,EAG1B,MAAM,EAEN,cAAc,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,wBAAwB,EAAC,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAEH,qBAAqB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAC;AAQ9E,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACnB,MAAM,CAAC,OAAO;QACV,MAAM,IAAI,KAAK,CACX,oEAAoE,CACvE,CAAC;IACN,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAsC;QACtD,OAAO;YACH,MAAM,EAAE,YAAU;YAClB,MAAM,EAAE,IAAI;YAC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AY,UAAU;oBAC1C,CAAC,CAAC,UAAU,CAAC;gBAEjB,aAAa,CAAC,GAAG,CACb,uBAAuB,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,OAAO,GAAG,UAAU,IAAI,CACzF,CAAC;gBACF,aAAa,CAAC,GAAG,CACb,sCAAsC,OAAO,GAAG,WAAW,IAAI,CAClE,CAAC;gBACF,GAAG,CAAC,mBAAmB,EAAE,CAAC;gBAC1B,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC;YAAC,OAAO,mBAAmB,EAAE,CAAC;gBAC3B,uEAAuE;gBACvE,OAAO,CAAC,KAAK;gBACT,4EAA4E;gBAC5E,iCAAiC,mBAAmB,EAAE,CACzD,CAAC;gBAEF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,CAAC;QACL,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;CACJ,CAAA;AAvKY,UAAU;IADtB,MAAM,CAAC,EAAE,CAAC;GACE,UAAU,CAuKtB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ConfigService } from "@nestjs/config";
|
|
2
1
|
import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService.js";
|
|
2
|
+
import { SmtpEmailModuleOptions } from "./smtp-email-client.options.js";
|
|
3
3
|
export declare class EmailConfigurationService extends ValidatedConfigurationService {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private options;
|
|
5
|
+
constructor(options: SmtpEmailModuleOptions);
|
|
6
6
|
get isEmailSyncSendEnabled(): boolean;
|
|
7
7
|
get extraEmailBcc(): string;
|
|
8
8
|
get emailPassword(): string;
|
|
@@ -7,41 +7,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
13
14
|
import { IsBoolean, IsDefined, IsInt, IsString } from "class-validator";
|
|
14
15
|
import { ValidatedConfigurationService } from "../configuration/ValidatedConfigurationService.js";
|
|
16
|
+
import { SMTP_EMAIL_MODULE_OPTIONS, } from "./smtp-email-client.options.js";
|
|
15
17
|
let EmailConfigurationService = class EmailConfigurationService extends ValidatedConfigurationService {
|
|
16
|
-
|
|
17
|
-
constructor(
|
|
18
|
+
options;
|
|
19
|
+
constructor(options) {
|
|
18
20
|
super();
|
|
19
|
-
this.
|
|
21
|
+
this.options = options;
|
|
20
22
|
}
|
|
21
23
|
get isEmailSyncSendEnabled() {
|
|
22
|
-
return
|
|
23
|
-
"true");
|
|
24
|
+
return this.options.isEmailSyncSendEnabled;
|
|
24
25
|
}
|
|
25
26
|
get extraEmailBcc() {
|
|
26
|
-
return this.
|
|
27
|
+
return this.options.extraEmailBcc;
|
|
27
28
|
}
|
|
28
29
|
get emailPassword() {
|
|
29
|
-
return this.
|
|
30
|
+
return this.options.emailPassword;
|
|
30
31
|
}
|
|
31
32
|
get smtpHost() {
|
|
32
|
-
return this.
|
|
33
|
+
return this.options.smtpHost;
|
|
33
34
|
}
|
|
34
35
|
get smtpPort() {
|
|
35
|
-
return
|
|
36
|
+
return this.options.smtpPort;
|
|
36
37
|
}
|
|
37
38
|
get emailUsername() {
|
|
38
|
-
return this.
|
|
39
|
+
return this.options.emailUsername;
|
|
39
40
|
}
|
|
40
41
|
get senderEmailAddress() {
|
|
41
|
-
return this.
|
|
42
|
+
return this.options.senderEmailAddress;
|
|
42
43
|
}
|
|
43
44
|
get senderName() {
|
|
44
|
-
return this.
|
|
45
|
+
return this.options.senderName;
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
__decorate([
|
|
@@ -94,7 +95,8 @@ __decorate([
|
|
|
94
95
|
], EmailConfigurationService.prototype, "senderName", null);
|
|
95
96
|
EmailConfigurationService = __decorate([
|
|
96
97
|
Injectable(),
|
|
97
|
-
|
|
98
|
+
__param(0, Inject(SMTP_EMAIL_MODULE_OPTIONS)),
|
|
99
|
+
__metadata("design:paramtypes", [Object])
|
|
98
100
|
], EmailConfigurationService);
|
|
99
101
|
export { EmailConfigurationService };
|
|
100
102
|
//# sourceMappingURL=EmailConfigurationService.js.map
|