From f5118ae9d140563ccd6bed3fc43da9376e7f8c15 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 3 Apr 2019 21:34:21 -0600 Subject: [PATCH] v1.0.1: bugfix back-compat bluebird support --- index.js | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index b64208f..1ed95c2 100644 --- a/index.js +++ b/index.js @@ -85,9 +85,9 @@ module.exports.create = function (config) { // Just to show that any options set in approveDomains() will be available here // (the same is true for all of the hooks in this file) - if (opts.exampleThrowError) { return Promise.reject(new Error("You want an error? You got it!")); } - if (opts.exampleReturnNull) { return Promise.resolve(null); } - if (opts.exampleReturnCerts) { return Promise.resolve(opts.exampleReturnCerts); } + if (opts.exampleThrowError) { return PromiseA.reject(new Error("You want an error? You got it!")); } + if (opts.exampleReturnNull) { return PromiseA.resolve(null); } + if (opts.exampleReturnCerts) { return PromiseA.resolve(opts.exampleReturnCerts); } var liveDir = opts.liveDir || path.join(opts.configDir, 'live', opts.subject); // TODO this shouldn't be necessary here (we should get it from checkKeypairAsync) @@ -136,7 +136,7 @@ module.exports.create = function (config) { store.accounts.checkAsync = function (/*opts*/) { //var id = opts.account.id || 'single-user'; //console.log('accounts.checkAsync for', id); - return Promise.resolve(null); + return PromiseA.resolve(null); }; // accounts.checkKeypairAsync({ email, ... }): @@ -149,7 +149,7 @@ module.exports.create = function (config) { store.accounts.checkKeypairAsync = function (opts) { var id = opts.account.id || 'single-user'; console.log('accounts.checkKeypairAsync for', id); - if (!opts.account.id) { return Promise.reject(new Error("'account.id' should have been set in approveDomains()")); } + if (!opts.account.id) { return PromiseA.reject(new Error("'account.id' should have been set in approveDomains()")); } var pathname = path.join(tameWild(opts.accountsDir, opts.subject), sanitizeFilename(id) + '.json'); return readFileAsync(tameWild(pathname, opts.subject), 'utf8').then(function (blob) { @@ -172,7 +172,7 @@ module.exports.create = function (config) { var id = opts.account.id || 'single-user'; console.log('accounts.setKeypairAsync for', id); keypair = opts.keypair || keypair; - if (!opts.account.id) { return Promise.reject(new Error("'account.id' should have been set in approveDomains()")); } + if (!opts.account.id) { return PromiseA.reject(new Error("'account.id' should have been set in approveDomains()")); } return mkdirpAsync(tameWild(opts.accountsDir, opts.subject)).then(function () { // keypair is an opaque object that should be treated as blob var pathname = tameWild(path.join(opts.accountsDir, sanitizeFilename(id) + '.json'), opts.subject); @@ -190,7 +190,7 @@ module.exports.create = function (config) { store.accounts.setAsync = function (/*opts, receipt*/) { //receipt = opts.receipt || receipt; //console.log('account.setAsync:', receipt); - return Promise.resolve(null); + return PromiseA.resolve(null); }; // certificates.checkKeypairAsync({ subject, ... }): diff --git a/package.json b/package.json index 00b9009..a77538d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "le-store-fs", - "version": "1.0.0", + "version": "1.0.1", "description": "A file-based certificate store for greenlock that supports wildcards.", "homepage": "https://git.coolaj86.com/coolaj86/le-store-fs.js", "main": "index.js",