nestjs-slack-webhook
Advanced tools
Comparing version 0.0.4 to 1.0.0
@@ -8,2 +8,3 @@ "use strict"; | ||
}; | ||
var SlackCoreModule_1; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -15,67 +16,63 @@ exports.SlackCoreModule = void 0; | ||
const createSlackProvider_1 = require("./createSlackProvider"); | ||
let SlackCoreModule = (() => { | ||
var SlackCoreModule_1; | ||
let SlackCoreModule = SlackCoreModule_1 = class SlackCoreModule { | ||
static forRoot(options) { | ||
const provider = createSlackProvider_1.createSlackProvider(options); | ||
return { | ||
exports: [provider], | ||
module: SlackCoreModule_1, | ||
providers: [provider], | ||
}; | ||
let SlackCoreModule = SlackCoreModule_1 = class SlackCoreModule { | ||
static forRoot(options) { | ||
const provider = createSlackProvider_1.createSlackProvider(options); | ||
return { | ||
exports: [provider], | ||
module: SlackCoreModule_1, | ||
providers: [provider], | ||
}; | ||
} | ||
static forRootAsync(options) { | ||
const slackProvider = { | ||
inject: [slackConstants_1.SLACK_MODULE], | ||
provide: slackConstants_1.SLACK_TOKEN, | ||
useFactory: (slackOptions) => getSlackClient_1.getSlackClient(slackOptions), | ||
}; | ||
return { | ||
exports: [slackProvider], | ||
imports: options.imports, | ||
module: SlackCoreModule_1, | ||
providers: [...this.createAsyncProviders(options), slackProvider], | ||
}; | ||
} | ||
static createAsyncProviders(options) { | ||
var _a; | ||
if (options.useExisting || options.useFactory) { | ||
return [this.createAsyncOptionsProvider(options)]; | ||
} | ||
static forRootAsync(options) { | ||
const slackProvider = { | ||
inject: [slackConstants_1.SLACK_MODULE], | ||
provide: slackConstants_1.SLACK_TOKEN, | ||
useFactory: (slackOptions) => getSlackClient_1.getSlackClient(slackOptions), | ||
}; | ||
return [ | ||
this.createAsyncOptionsProvider(options), | ||
{ | ||
provide: options.useClass, | ||
useClass: options.useClass, | ||
inject: [(_a = options.inject) !== null && _a !== void 0 ? _a : []], | ||
}, | ||
]; | ||
} | ||
static createAsyncOptionsProvider(options) { | ||
var _a; | ||
if (options.useFactory) { | ||
return { | ||
exports: [slackProvider], | ||
imports: options.imports, | ||
module: SlackCoreModule_1, | ||
providers: [...this.createAsyncProviders(options), slackProvider], | ||
}; | ||
} | ||
static createAsyncProviders(options) { | ||
var _a; | ||
if (options.useExisting || options.useFactory) { | ||
return [this.createAsyncOptionsProvider(options)]; | ||
} | ||
return [ | ||
this.createAsyncOptionsProvider(options), | ||
{ | ||
provide: options.useClass, | ||
useClass: options.useClass, | ||
inject: [(_a = options.inject) !== null && _a !== void 0 ? _a : []], | ||
}, | ||
]; | ||
} | ||
static createAsyncOptionsProvider(options) { | ||
var _a; | ||
if (options.useFactory) { | ||
return { | ||
inject: (_a = options.inject) !== null && _a !== void 0 ? _a : [], | ||
provide: slackConstants_1.SLACK_MODULE, | ||
useFactory: options.useFactory, | ||
}; | ||
} | ||
return { | ||
inject: options.useExisting | ||
? [options.useExisting] | ||
: options.useClass | ||
? [options.useClass] | ||
: [], | ||
inject: (_a = options.inject) !== null && _a !== void 0 ? _a : [], | ||
provide: slackConstants_1.SLACK_MODULE, | ||
useFactory: (optionsFactory) => optionsFactory.createSlackOptions(), | ||
useFactory: options.useFactory, | ||
}; | ||
} | ||
}; | ||
SlackCoreModule = SlackCoreModule_1 = __decorate([ | ||
common_1.Global(), | ||
common_1.Module({}) | ||
], SlackCoreModule); | ||
return SlackCoreModule; | ||
})(); | ||
return { | ||
inject: options.useExisting | ||
? [options.useExisting] | ||
: options.useClass | ||
? [options.useClass] | ||
: [], | ||
provide: slackConstants_1.SLACK_MODULE, | ||
useFactory: (optionsFactory) => optionsFactory.createSlackOptions(), | ||
}; | ||
} | ||
}; | ||
SlackCoreModule = SlackCoreModule_1 = __decorate([ | ||
common_1.Global(), | ||
common_1.Module({}) | ||
], SlackCoreModule); | ||
exports.SlackCoreModule = SlackCoreModule; | ||
//# sourceMappingURL=slackCoreModule.js.map |
@@ -8,2 +8,3 @@ "use strict"; | ||
}; | ||
var SlackModule_1; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -13,24 +14,20 @@ exports.SlackModule = void 0; | ||
const slackCoreModule_1 = require("./slackCoreModule"); | ||
let SlackModule = (() => { | ||
var SlackModule_1; | ||
let SlackModule = SlackModule_1 = class SlackModule { | ||
static forRoot(options) { | ||
return { | ||
module: SlackModule_1, | ||
imports: [slackCoreModule_1.SlackCoreModule.forRoot(options)], | ||
}; | ||
} | ||
static forRootAsync(options) { | ||
return { | ||
module: SlackModule_1, | ||
imports: [slackCoreModule_1.SlackCoreModule.forRootAsync(options)], | ||
}; | ||
} | ||
}; | ||
SlackModule = SlackModule_1 = __decorate([ | ||
common_1.Module({}) | ||
], SlackModule); | ||
return SlackModule; | ||
})(); | ||
let SlackModule = SlackModule_1 = class SlackModule { | ||
static forRoot(options) { | ||
return { | ||
module: SlackModule_1, | ||
imports: [slackCoreModule_1.SlackCoreModule.forRoot(options)], | ||
}; | ||
} | ||
static forRootAsync(options) { | ||
return { | ||
module: SlackModule_1, | ||
imports: [slackCoreModule_1.SlackCoreModule.forRootAsync(options)], | ||
}; | ||
} | ||
}; | ||
SlackModule = SlackModule_1 = __decorate([ | ||
common_1.Module({}) | ||
], SlackModule); | ||
exports.SlackModule = SlackModule; | ||
//# sourceMappingURL=slackModule.js.map |
{ | ||
"name": "nestjs-slack-webhook", | ||
"version": "0.0.4", | ||
"version": "1.0.0", | ||
"description": "Nest.js + slack-webhook", | ||
@@ -25,5 +25,5 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@nestjs/common": "7.1.2", | ||
"@nestjs/core": "7.1.2", | ||
"@nestjs/testing": "7.1.2", | ||
"@nestjs/common": "7.1.3", | ||
"@nestjs/core": "7.1.3", | ||
"@nestjs/testing": "7.1.3", | ||
"@slack/webhook": "5.0.3", | ||
@@ -30,0 +30,0 @@ "reflect-metadata": "0.1.13", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
23497
485