Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
execute() {
// Take a clone so that we don't modify this instance during execution.
let builder = this.clone();
let promiseCtx = {builder};
let promise = Promise.bind(promiseCtx);
let context = builder.context() || {};
let internalContext = builder.internalContext();
if (builder.isFindQuery()) {
// If no write operations have been called at this point this query is a
// find query and we need to call the custom find implementation.
callFindOperation(builder);
}
if (builder.isEagerQuery()) {
callEagerFetchOperation(builder);
}
promise = chainBefore1Operations(promise, builder._operations);
promise = chainHooks(promise, context.runBefore);
promise = chainHooks(promise, internalContext.runBefore);
IridiumDatabase.prototype.close = IridiumDatabase.prototype.disconnect = function disconnect() {
/// <summary>Closes the active database connection</summary>
"use strict";
return Promise.bind(this).then(function() {
if(!this.connection) return this;
var conn = this.connection;
this.connection = conn;
conn.close();
return this;
});
};
auth: function(options) {
return BB.bind({ userInfo: null, options:options.raw })
.then(_setUserInfoFromSocialAccount)
.then(_linkOrCreateUser)
.then(_createNewToken)
.then(function(obj){
return obj._id; //Return valid token
})
.catch(function(err) {
var e = new Error(err.message);
e.code = strings.group('codes').forbidden;
throw(err);
});
}
};
'elastic-beanstalk:deploy': () => BPromise.bind(this)
.then(validate)
.then(configure)
.then(build)
.then(deploy),
};
run(options) {
this.options = options;
return BbPromise.bind(this)
.then(this.validateOptions)
.then(this.extractFunctions)
.then(this.createFunctionResources)
.then(this.addFunctionResourcesToServiceResourcesObject)
.catch((exception) => {
throw new this.serverless.classes.Error(exception);
});
}
cleanupS3Bucket() {
return BbPromise.bind(this)
.then(this.getObjectsToRemove)
.then(this.removeObjects);
},
};
'before:package:compileEvents': () => BbPromise.bind(this)
.then(this.setup)
.then(this.mergeEventTriggers),
'package:compileEvents': this.compileTriggers.bind(this),
"after:package:initialize": () => BbPromise.bind(this)
.then(this.setRelease)
.then(this.instrumentFunctions),
getModels(vendorId) {
return BbPromise.bind(this)
.then(function () {
return BbPromise.resolve(this.getSkills(vendorId));
})
.map(function (skill) {
const skillLocales = skill.manifest.publishingInformation.locales;
const locales = Object.keys(skillLocales).map(function (locale) {
return { id: this.skillId, locale };
}, skill);
return BbPromise.bind(this)
.then(() => BbPromise.resolve(locales))
.map(function (locale) {
return this.get(`/skills/${locale.id}/stages/development/interactionModel/locales/${locale.locale}`).then(body => BbPromise.resolve({
id: locale.id,
locale: locale.locale,
model: JSON.parse(body),
}))
.catch(e => {
if (_.includes(e.message, 'does not exist')) {
if (this._serverless.service.provider.deploymentBucket) {
this._createLater = true;
return BbPromise.resolve();
}
return BbPromise.bind(this)
.then(this.createAlias);
}
return BbPromise.reject(e);
});