@venturialstd/slack 0.1.12 → 0.1.13
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.
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { DynamicModule, Type } from '@nestjs/common';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
botToken: string;
|
|
6
|
-
logger: Type<any>;
|
|
7
|
-
}> | {
|
|
8
|
-
botToken: string;
|
|
9
|
-
logger: Type<any>;
|
|
10
|
-
};
|
|
2
|
+
export interface SlackModuleOptions {
|
|
3
|
+
botToken: string;
|
|
4
|
+
logger: Type<any>;
|
|
11
5
|
}
|
|
12
6
|
export declare class SlackModule {
|
|
13
|
-
static forRootAsync(options:
|
|
7
|
+
static forRootAsync(options: {
|
|
8
|
+
logger: Type<any>;
|
|
9
|
+
useExistingTokenProvider: any;
|
|
10
|
+
}): DynamicModule;
|
|
14
11
|
}
|
|
@@ -15,20 +15,10 @@ let SlackModule = SlackModule_1 = class SlackModule {
|
|
|
15
15
|
return {
|
|
16
16
|
module: SlackModule_1,
|
|
17
17
|
providers: [
|
|
18
|
-
{
|
|
19
|
-
provide: 'SLACK_OPTIONS',
|
|
20
|
-
inject: options.inject,
|
|
21
|
-
useFactory: options.useFactory,
|
|
22
|
-
},
|
|
18
|
+
{ provide: 'SLACK_LOGGER', useClass: options.logger },
|
|
23
19
|
{
|
|
24
20
|
provide: 'SLACK_BOT_TOKEN',
|
|
25
|
-
|
|
26
|
-
useFactory: (opts) => opts.botToken,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
provide: 'SLACK_LOGGER',
|
|
30
|
-
inject: ['SLACK_OPTIONS'],
|
|
31
|
-
useFactory: (opts) => opts.logger,
|
|
21
|
+
useExisting: options.useExistingTokenProvider,
|
|
32
22
|
},
|
|
33
23
|
slack_client_1.SlackClient,
|
|
34
24
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.module.js","sourceRoot":"","sources":["../../slack.module.ts"],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"slack.module.js","sourceRoot":"","sources":["../../slack.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA6D;AAE7D,yDAAqD;AAQ9C,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,YAAY,CAAC,OAGnB;QACC,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE;gBAGrD;oBACE,OAAO,EAAE,iBAAiB;oBAC1B,WAAW,EAAE,OAAO,CAAC,wBAAwB;iBAC9C;gBAED,0BAAW;aACZ;YACD,OAAO,EAAE,CAAC,0BAAW,CAAC;SACvB,CAAC;IACJ,CAAC;CACF,CAAA;AArBY,kCAAW;sBAAX,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,WAAW,CAqBvB","sourcesContent":["import { DynamicModule, Module, Type } from '@nestjs/common';\r\n\r\nimport { SlackClient } from './clients/slack.client';\r\n\r\nexport interface SlackModuleOptions {\r\n botToken: string;\r\n logger: Type<any>;\r\n}\r\n\r\n@Module({})\r\nexport class SlackModule {\r\n static forRootAsync(options: {\r\n logger: Type<any>;\r\n useExistingTokenProvider: any;\r\n }): DynamicModule {\r\n return {\r\n module: SlackModule,\r\n providers: [\r\n { provide: 'SLACK_LOGGER', useClass: options.logger },\r\n\r\n // 👇 Aquí usamos el provider externo que tú creaste\r\n {\r\n provide: 'SLACK_BOT_TOKEN',\r\n useExisting: options.useExistingTokenProvider,\r\n },\r\n\r\n SlackClient,\r\n ],\r\n exports: [SlackClient],\r\n };\r\n }\r\n}\r\n"]}
|