serverless-aliyun-function-compute-wnj
Version:
Provider plugin for the Serverless Framework v1.x which adds support for Aliyun Function Compute
32 lines (26 loc) • 712 B
JavaScript
;
const BbPromise = require('bluebird');
module.exports = {
getFunctionsAndService() {
this.fcService = undefined;
this.fcFunctions = [];
return BbPromise.bind(this)
.then(this.getService)
.then(this.getFunctions);
},
getService() {
const serviceName = this.provider.getServiceName();
return this.provider.getService(serviceName).then((service) => {
this.fcService = service;
});
},
getFunctions() {
if (!this.fcService) {
return BbPromise.resolve();
}
const serviceName = this.fcService.serviceName;
return this.provider.getFunctions(serviceName).then((functions) => {
this.fcFunctions = functions;
});
}
};