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:
|
2017-08-28 00:24:06 +00:00
|
|
|
plugins.beautylog.error(`>>npmci cloudflare ...<< action >>${action}<< not supported`);
|
2017-08-28 11:25:22 +00:00
|
|
|
process.exit(1);
|
2017-08-27 13:24:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2017-08-28 00:24:06 +00:00
|
|
|
plugins.beautylog.log(`>>npmci cloudflare ...<< cli arguments invalid... Please read the documentation.`);
|
2017-08-28 11:25:22 +00:00
|
|
|
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]);
|
|
|
|
});
|
2018-04-04 20:25:13 +00:00
|
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