@hedhog/mail 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/interfaces/mail-module-options.interface.d.ts +2 -6
- package/dist/interfaces/mail-module-options.interface.d.ts.map +1 -1
- package/dist/mail.module.d.ts +2 -3
- package/dist/mail.module.d.ts.map +1 -1
- package/dist/mail.module.js +12 -37
- package/dist/mail.module.js.map +1 -1
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ModuleMetadata
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
2
2
|
export type MailModuleOptions = {
|
3
3
|
global?: boolean;
|
4
4
|
type: 'AWS';
|
@@ -26,11 +26,7 @@ export interface MailOptionsFactory {
|
|
26
26
|
createMailOptions(): Promise<MailModuleOptions> | MailModuleOptions;
|
27
27
|
}
|
28
28
|
export interface MailModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
29
|
-
|
30
|
-
useExisting?: Type<MailOptionsFactory>;
|
31
|
-
useClass?: Type<MailOptionsFactory>;
|
32
|
-
useFactory?: (...args: any[]) => Promise<MailModuleOptions> | MailModuleOptions;
|
29
|
+
useFactory: (...args: any[]) => Promise<MailModuleOptions> | MailModuleOptions;
|
33
30
|
inject?: any[];
|
34
|
-
extraProviders?: Provider[];
|
35
31
|
}
|
36
32
|
//# sourceMappingURL=mail-module-options.interface.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mail-module-options.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/mail-module-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
1
|
+
{"version":3,"file":"mail-module-options.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/mail-module-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GACzB;IACE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEN,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;CACrE;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;IACvC,UAAU,EAAE,CACV,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;IACpD,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;CAChB"}
|
package/dist/mail.module.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
2
2
|
import { MailModuleAsyncOptions, MailModuleOptions } from './interfaces/mail-module-options.interface';
|
3
3
|
export declare class MailModule {
|
4
|
-
static
|
5
|
-
static
|
6
|
-
private static createAsyncProviders;
|
4
|
+
static forRoot(options: MailModuleOptions): DynamicModule;
|
5
|
+
static forRootAsync(options: MailModuleAsyncOptions): DynamicModule;
|
7
6
|
private static createAsyncOptionsProvider;
|
8
7
|
}
|
9
8
|
//# sourceMappingURL=mail.module.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mail.module.d.ts","sourceRoot":"","sources":["../src/mail.module.ts"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"mail.module.d.ts","sourceRoot":"","sources":["../src/mail.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAA4B,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,4CAA4C,CAAC;AAIpD,qBAEa,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa;IAgBzD,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa;IASnE,OAAO,CAAC,MAAM,CAAC,0BAA0B;CAS1C"}
|
package/dist/mail.module.js
CHANGED
@@ -13,65 +13,40 @@ const common_1 = require("@nestjs/common");
|
|
13
13
|
const mail_consts_1 = require("./mail.consts");
|
14
14
|
const mail_service_1 = require("./mail.service");
|
15
15
|
let MailModule = MailModule_1 = class MailModule {
|
16
|
-
static
|
16
|
+
static forRoot(options) {
|
17
17
|
console.log('MailModule.register', { options });
|
18
18
|
return {
|
19
19
|
module: MailModule_1,
|
20
|
-
|
20
|
+
imports: [axios_1.HttpModule],
|
21
21
|
providers: [
|
22
|
+
mail_service_1.MailService,
|
22
23
|
{
|
23
24
|
provide: mail_consts_1.MAIL_MODULE_OPTIONS,
|
24
|
-
useValue: options
|
25
|
+
useValue: options,
|
25
26
|
},
|
26
27
|
],
|
28
|
+
exports: [mail_service_1.MailService],
|
27
29
|
};
|
28
30
|
}
|
29
|
-
static
|
30
|
-
var _a;
|
31
|
+
static forRootAsync(options) {
|
31
32
|
return {
|
32
33
|
module: MailModule_1,
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
...this.createAsyncProviders(options),
|
37
|
-
...((_a = options.extraProviders) !== null && _a !== void 0 ? _a : []),
|
38
|
-
],
|
34
|
+
imports: [...(options.imports || []), axios_1.HttpModule],
|
35
|
+
providers: [mail_service_1.MailService, this.createAsyncOptionsProvider(options)],
|
36
|
+
exports: [mail_service_1.MailService],
|
39
37
|
};
|
40
38
|
}
|
41
|
-
static createAsyncProviders(options) {
|
42
|
-
if (options.useExisting || options.useFactory) {
|
43
|
-
return [this.createAsyncOptionsProvider(options)];
|
44
|
-
}
|
45
|
-
return [
|
46
|
-
this.createAsyncOptionsProvider(options),
|
47
|
-
{
|
48
|
-
provide: options.useClass,
|
49
|
-
useClass: options.useClass,
|
50
|
-
},
|
51
|
-
];
|
52
|
-
}
|
53
39
|
static createAsyncOptionsProvider(options) {
|
54
|
-
if (options.useFactory) {
|
55
|
-
return {
|
56
|
-
provide: mail_consts_1.MAIL_MODULE_OPTIONS,
|
57
|
-
useFactory: options.useFactory,
|
58
|
-
inject: options.inject || [],
|
59
|
-
};
|
60
|
-
}
|
61
40
|
return {
|
62
41
|
provide: mail_consts_1.MAIL_MODULE_OPTIONS,
|
63
|
-
useFactory:
|
64
|
-
inject:
|
42
|
+
useFactory: options.useFactory,
|
43
|
+
inject: options.inject || [],
|
65
44
|
};
|
66
45
|
}
|
67
46
|
};
|
68
47
|
exports.MailModule = MailModule;
|
69
48
|
exports.MailModule = MailModule = MailModule_1 = __decorate([
|
70
49
|
(0, common_1.Global)(),
|
71
|
-
(0, common_1.Module)({
|
72
|
-
imports: [(0, common_1.forwardRef)(() => axios_1.HttpModule)],
|
73
|
-
providers: [mail_service_1.MailService],
|
74
|
-
exports: [mail_service_1.MailService],
|
75
|
-
})
|
50
|
+
(0, common_1.Module)({})
|
76
51
|
], MailModule);
|
77
52
|
//# sourceMappingURL=mail.module.js.map
|
package/dist/mail.module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mail.module.js","sourceRoot":"","sources":["../src/mail.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yCAA2C;AAC3C,
|
1
|
+
{"version":3,"file":"mail.module.js","sourceRoot":"","sources":["../src/mail.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yCAA2C;AAC3C,2CAAyE;AAKzE,+CAAoD;AACpD,iDAA6C;AAItC,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,OAA0B;QACvC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAChD,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,CAAC,kBAAU,CAAC;YACrB,SAAS,EAAE;gBACT,0BAAW;gBACX;oBACE,OAAO,EAAE,iCAAmB;oBAC5B,QAAQ,EAAE,OAAO;iBAClB;aACF;YACD,OAAO,EAAE,CAAC,0BAAW,CAAC;SACvB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAA+B;QACjD,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,kBAAU,CAAC;YACjD,SAAS,EAAE,CAAC,0BAAW,EAAE,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;YAClE,OAAO,EAAE,CAAC,0BAAW,CAAC;SACvB,CAAC;IACJ,CAAC;IAEO,MAAM,CAAC,0BAA0B,CACvC,OAA+B;QAE/B,OAAO;YACL,OAAO,EAAE,iCAAmB;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;SAC7B,CAAC;IACJ,CAAC;CACF,CAAA;AAnCY,gCAAU;qBAAV,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAmCtB"}
|