npmci/dist/mod_cloudflare/index.js

38 lines
2.7 KiB
JavaScript
Raw Normal View History

2017-08-27 13:24:17 +00:00
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./mod.plugins");
let npmciCflare = new plugins.cflare.CflareAccount();
/**
* handle cli input
* @param argvArg
*/
exports.handleCli = (argvArg) => __awaiter(this, void 0, void 0, function* () {
if (argvArg._.length >= 2) {
let action = argvArg._[1];
switch (action) {
default:
plugins.beautylog.error(`>>npmci cloudflare ...<< action >>${action}<< not supported`);
process.exit(1);
2017-08-27 13:24:17 +00:00
}
}
else {
plugins.beautylog.log(`>>npmci cloudflare ...<< cli arguments invalid... Please read the documentation.`);
process.exit(1);
2017-08-27 13:24:17 +00:00
}
});
exports.purge = (argvArg) => __awaiter(this, void 0, void 0, function* () {
npmciCflare.auth({
email: '',
key: ''
});
npmciCflare.purgeZone(argvArg._[1]);
});
2017-10-09 16:10:01 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfY2xvdWRmbGFyZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEseUNBQXdDO0FBRXhDLElBQUksV0FBVyxHQUFHLElBQUksT0FBTyxDQUFDLE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQTtBQUVwRDs7O0dBR0c7QUFDUSxRQUFBLFNBQVMsR0FBRyxDQ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