@fonoster/ctl 0.3.6-alpha.4 → 0.3.6-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -38
- package/dist/base/delete.js +5 -5
- package/dist/commands/agents/create.js +5 -5
- package/dist/commands/agents/get.js +4 -4
- package/dist/commands/agents/list.js +2 -2
- package/dist/commands/agents/update.js +5 -5
- package/dist/commands/apps/create.js +5 -5
- package/dist/commands/apps/list.js +2 -3
- package/dist/commands/apps/update.js +5 -5
- package/dist/commands/auth/login.js +7 -7
- package/dist/commands/auth/logout.js +5 -5
- package/dist/commands/bug.js +2 -5
- package/dist/commands/domains/create.js +5 -5
- package/dist/commands/domains/get.js +4 -4
- package/dist/commands/domains/list.js +2 -2
- package/dist/commands/domains/update.js +5 -5
- package/dist/commands/feedback.js +2 -5
- package/dist/commands/numbers/create.js +5 -5
- package/dist/commands/numbers/get.js +4 -4
- package/dist/commands/numbers/list.js +2 -2
- package/dist/commands/numbers/update.js +6 -6
- package/dist/commands/projects/create.js +5 -5
- package/dist/commands/projects/get.js +4 -4
- package/dist/commands/projects/list.js +2 -2
- package/dist/commands/projects/renew.js +5 -5
- package/dist/commands/projects/use.js +5 -5
- package/dist/commands/providers/create.js +6 -6
- package/dist/commands/providers/get.js +4 -4
- package/dist/commands/providers/list.js +2 -2
- package/dist/commands/providers/update.js +5 -5
- package/dist/commands/secrets/delete.js +4 -4
- package/oclif.manifest.json +1 -1
- package/package.json +11 -11
|
@@ -4,7 +4,7 @@ require("../../config");
|
|
|
4
4
|
const domains_1 = require("@fonoster/domains");
|
|
5
5
|
const errors_1 = require("@oclif/errors");
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Numbers = require("@fonoster/numbers");
|
|
10
10
|
const Domains = require("@fonoster/domains");
|
|
@@ -87,14 +87,14 @@ class CreateCommand extends command_1.Command {
|
|
|
87
87
|
delete answers.egressRule;
|
|
88
88
|
delete answers.egressNumberRef;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
core_1.CliUx.ux.action.start(`Creating Domain ${answers.name}`);
|
|
91
91
|
const domains = new Domains((0, config_1.getProjectConfig)());
|
|
92
92
|
const domain = await domains.createDomain(answers);
|
|
93
|
-
await
|
|
94
|
-
|
|
93
|
+
await core_1.CliUx.ux.wait(1000);
|
|
94
|
+
core_1.CliUx.ux.action.stop(domain.ref);
|
|
95
95
|
}
|
|
96
96
|
catch (e) {
|
|
97
|
-
|
|
97
|
+
core_1.CliUx.ux.action.stop();
|
|
98
98
|
if (e.code === 9) {
|
|
99
99
|
throw new errors_1.CLIError("This Domain already exist");
|
|
100
100
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const prettyjson_1 = require("prettyjson");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Domains = require("@fonoster/domains");
|
|
@@ -16,7 +16,7 @@ class GetCommand extends command_1.Command {
|
|
|
16
16
|
const { args } = this.parse(GetCommand);
|
|
17
17
|
try {
|
|
18
18
|
const domains = new Domains((0, config_1.getProjectConfig)());
|
|
19
|
-
|
|
19
|
+
core_1.CliUx.ux.action.start(`Getting domain ${args.ref}`);
|
|
20
20
|
const domain = await domains.getDomain(args.ref);
|
|
21
21
|
console.log("geting domain: ");
|
|
22
22
|
const allow = domain.accessDeny.length > 0 ? domain.accessDeny.join(",") : "None";
|
|
@@ -31,8 +31,8 @@ class GetCommand extends command_1.Command {
|
|
|
31
31
|
Created: moment(domain.createTime).fromNow(),
|
|
32
32
|
Updated: moment(domain.updateTime).fromNow()
|
|
33
33
|
};
|
|
34
|
-
await
|
|
35
|
-
|
|
34
|
+
await core_1.CliUx.ux.wait(1000);
|
|
35
|
+
core_1.CliUx.ux.action.stop("");
|
|
36
36
|
console.log((0, prettyjson_1.render)(jsonObj, { noColor: true }));
|
|
37
37
|
}
|
|
38
38
|
catch (e) {
|
|
@@ -4,7 +4,7 @@ require("../../config");
|
|
|
4
4
|
const domains_1 = require("@fonoster/domains");
|
|
5
5
|
const errors_1 = require("@oclif/errors");
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Domains = require("@fonoster/domains");
|
|
10
10
|
const inquirer = require("inquirer");
|
|
@@ -36,7 +36,7 @@ class ListCommand extends command_1.Command {
|
|
|
36
36
|
if (list.length < 1)
|
|
37
37
|
break;
|
|
38
38
|
const showTable = (showHeader, data) => {
|
|
39
|
-
|
|
39
|
+
core_1.CliUx.ux.table(data, {
|
|
40
40
|
ref: { minWidth: 15 },
|
|
41
41
|
name: { header: "Name", minWidth: 15 },
|
|
42
42
|
domainUri: { header: "Domain URI", minWidth: 15 },
|
|
@@ -4,7 +4,7 @@ require("../../config");
|
|
|
4
4
|
const domains_1 = require("@fonoster/domains");
|
|
5
5
|
const errors_1 = require("@oclif/errors");
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Numbers = require("@fonoster/numbers");
|
|
10
10
|
const Domains = require("@fonoster/domains");
|
|
@@ -86,13 +86,13 @@ class UpdateCommand extends command_1.Command {
|
|
|
86
86
|
const accessAllow = answers.accessAllow;
|
|
87
87
|
answers.accessDeny = accessDeny ? accessDeny.split(",") : [];
|
|
88
88
|
answers.accessAllow = accessAllow ? accessAllow.split(",") : [];
|
|
89
|
-
|
|
89
|
+
core_1.CliUx.ux.action.start(`Updating domain ${answers.name}`);
|
|
90
90
|
await domains.updateDomain(answers);
|
|
91
|
-
await
|
|
92
|
-
|
|
91
|
+
await core_1.CliUx.ux.wait(1000);
|
|
92
|
+
core_1.CliUx.ux.action.stop("Done");
|
|
93
93
|
}
|
|
94
94
|
catch (e) {
|
|
95
|
-
|
|
95
|
+
core_1.CliUx.ux.action.stop();
|
|
96
96
|
throw new errors_1.CLIError(e.message);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
require("../config");
|
|
7
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
8
5
|
const command_1 = require("@oclif/command");
|
|
9
6
|
class default_1 extends command_1.Command {
|
|
10
7
|
async run() {
|
|
11
|
-
await
|
|
8
|
+
await core_1.CliUx.ux.open("https://docs.google.com/forms/d/e/1FAIpQLSd1G2ahRYqkbksOvz7XhNHfSLepUh3KzRHsXh2HXfZr68nhtQ/viewform?vc=0&c=0&w=1&flr=0");
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
exports.default = default_1;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const numbers_1 = require("@fonoster/numbers");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Providers = require("@fonoster/providers");
|
|
@@ -74,15 +74,15 @@ class CreateCommand extends command_1.Command {
|
|
|
74
74
|
console.log("Aborted");
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
|
|
77
|
+
core_1.CliUx.ux.action.start(`Creating Number ${answers.e164Number}`);
|
|
78
78
|
const numbers = new Numbers((0, config_1.getProjectConfig)());
|
|
79
79
|
const result = await numbers.createNumber(answers);
|
|
80
|
-
await
|
|
81
|
-
|
|
80
|
+
await core_1.CliUx.ux.wait(1000);
|
|
81
|
+
core_1.CliUx.ux.action.stop(result.ref);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
catch (e) {
|
|
85
|
-
|
|
85
|
+
core_1.CliUx.ux.action.stop();
|
|
86
86
|
if (e.code === 9) {
|
|
87
87
|
throw new errors_1.CLIError("This Number already exist");
|
|
88
88
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const prettyjson_1 = require("prettyjson");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Numbers = require("@fonoster/numbers");
|
|
@@ -16,7 +16,7 @@ class GetCommand extends command_1.Command {
|
|
|
16
16
|
const { args } = this.parse(GetCommand);
|
|
17
17
|
try {
|
|
18
18
|
const numbers = new Numbers((0, config_1.getProjectConfig)());
|
|
19
|
-
|
|
19
|
+
core_1.CliUx.ux.action.start(`Getting number ${args.ref}`);
|
|
20
20
|
const number = await numbers.getNumber(args.ref);
|
|
21
21
|
const jsonObj = {
|
|
22
22
|
Ref: number.ref,
|
|
@@ -27,8 +27,8 @@ class GetCommand extends command_1.Command {
|
|
|
27
27
|
Created: moment(number.createTime).fromNow(),
|
|
28
28
|
Updated: moment(number.updateTime).fromNow()
|
|
29
29
|
};
|
|
30
|
-
await
|
|
31
|
-
|
|
30
|
+
await core_1.CliUx.ux.wait(1000);
|
|
31
|
+
core_1.CliUx.ux.action.stop("");
|
|
32
32
|
console.log((0, prettyjson_1.render)(jsonObj, { noColor: true }));
|
|
33
33
|
}
|
|
34
34
|
catch (e) {
|
|
@@ -4,7 +4,7 @@ require("../../config");
|
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
6
|
const numbers_1 = require("@fonoster/numbers");
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Numbers = require("@fonoster/numbers");
|
|
10
10
|
const inquirer = require("inquirer");
|
|
@@ -40,7 +40,7 @@ class ListCommand extends command_1.Command {
|
|
|
40
40
|
if (list.length < 1)
|
|
41
41
|
break;
|
|
42
42
|
const showTable = (showHeader, data) => {
|
|
43
|
-
|
|
43
|
+
core_1.CliUx.ux.table(data, {
|
|
44
44
|
ref: { minWidth: 15 },
|
|
45
45
|
providerRef: { header: "Provider Ref", minWidth: 15 },
|
|
46
46
|
e164Number: { header: "E164 Number", minWidth: 15 },
|
|
@@ -10,7 +10,7 @@ exports.UpdateCommand = void 0;
|
|
|
10
10
|
require("../../config");
|
|
11
11
|
const errors_1 = require("@oclif/errors");
|
|
12
12
|
const command_1 = require("@oclif/command");
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@oclif/core");
|
|
14
14
|
const config_1 = require("../../config");
|
|
15
15
|
const project_guard_1 = require("../../decorators/project_guard");
|
|
16
16
|
const Numbers = require("@fonoster/numbers");
|
|
@@ -21,7 +21,7 @@ class UpdateCommand extends command_1.Command {
|
|
|
21
21
|
console.log("Press ^C at any time to quit.");
|
|
22
22
|
const { args } = this.parse(UpdateCommand);
|
|
23
23
|
if (!args.ref) {
|
|
24
|
-
|
|
24
|
+
core_1.CliUx.ux.action.stop();
|
|
25
25
|
throw new errors_1.CLIError("You must provide a Number ref before continuing");
|
|
26
26
|
}
|
|
27
27
|
const numbers = new Numbers((0, config_1.getProjectConfig)());
|
|
@@ -63,13 +63,13 @@ class UpdateCommand extends command_1.Command {
|
|
|
63
63
|
const accessAllow = answers.accessAllow;
|
|
64
64
|
answers.accessDeny = accessDeny ? accessDeny.split(",") : [];
|
|
65
65
|
answers.accessAllow = accessAllow ? accessAllow.split(",") : [];
|
|
66
|
-
|
|
66
|
+
core_1.CliUx.ux.action.start(`Updating number`);
|
|
67
67
|
await numbers.updateNumber(answers);
|
|
68
|
-
await
|
|
69
|
-
|
|
68
|
+
await core_1.CliUx.ux.wait(1000);
|
|
69
|
+
core_1.CliUx.ux.action.stop("Done");
|
|
70
70
|
}
|
|
71
71
|
catch (e) {
|
|
72
|
-
|
|
72
|
+
core_1.CliUx.ux.action.stop();
|
|
73
73
|
throw new errors_1.CLIError(e.message);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -4,7 +4,7 @@ require("../../config");
|
|
|
4
4
|
const Projects = require("@fonoster/projects");
|
|
5
5
|
const errors_1 = require("@oclif/errors");
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const inquirer = require("inquirer");
|
|
9
9
|
class default_1 extends command_1.Command {
|
|
10
10
|
async run() {
|
|
@@ -32,14 +32,14 @@ class default_1 extends command_1.Command {
|
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
try {
|
|
35
|
-
|
|
35
|
+
core_1.CliUx.ux.action.start(`Creating Project ${answers.name}`);
|
|
36
36
|
const projects = new Projects();
|
|
37
37
|
const project = await projects.createProject(answers);
|
|
38
|
-
await
|
|
39
|
-
|
|
38
|
+
await core_1.CliUx.ux.wait(1000);
|
|
39
|
+
core_1.CliUx.ux.action.stop(project.ref);
|
|
40
40
|
}
|
|
41
41
|
catch (e) {
|
|
42
|
-
|
|
42
|
+
core_1.CliUx.ux.action.stop();
|
|
43
43
|
if (e.code === 9) {
|
|
44
44
|
throw new errors_1.CLIError("This Project already exist");
|
|
45
45
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const prettyjson_1 = require("prettyjson");
|
|
8
8
|
const Projects = require("@fonoster/projects");
|
|
9
9
|
const moment = require("moment");
|
|
@@ -12,7 +12,7 @@ class GetCommand extends command_1.Command {
|
|
|
12
12
|
const { args } = this.parse(GetCommand);
|
|
13
13
|
try {
|
|
14
14
|
const projects = new Projects();
|
|
15
|
-
|
|
15
|
+
core_1.CliUx.ux.action.start(`Getting Project ${args.ref}`);
|
|
16
16
|
const p = await projects.getProject(args.ref);
|
|
17
17
|
const jsonObj = {
|
|
18
18
|
Name: p.name,
|
|
@@ -23,8 +23,8 @@ class GetCommand extends command_1.Command {
|
|
|
23
23
|
Created: moment(p.createTime).fromNow(),
|
|
24
24
|
Updated: moment(p.updateTime).fromNow()
|
|
25
25
|
};
|
|
26
|
-
await
|
|
27
|
-
|
|
26
|
+
await core_1.CliUx.ux.wait(1000);
|
|
27
|
+
core_1.CliUx.ux.action.stop("");
|
|
28
28
|
console.log((0, prettyjson_1.render)(jsonObj, { noColor: true }));
|
|
29
29
|
}
|
|
30
30
|
catch (e) {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const Projects = require("@fonoster/projects");
|
|
8
8
|
class ListCommand extends command_1.Command {
|
|
9
9
|
async run() {
|
|
@@ -11,7 +11,7 @@ class ListCommand extends command_1.Command {
|
|
|
11
11
|
const projects = new Projects();
|
|
12
12
|
// Gets the list
|
|
13
13
|
const result = await projects.listProjects({});
|
|
14
|
-
|
|
14
|
+
core_1.CliUx.ux.table(result.projects, {
|
|
15
15
|
accessKeyId: { header: "Ref / Access Key Id", minWidth: 30 },
|
|
16
16
|
name: { header: "Name", minWidth: 12 }
|
|
17
17
|
});
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const Projects = require("@fonoster/projects");
|
|
8
8
|
class UpdateCommand extends command_1.Command {
|
|
9
9
|
async run() {
|
|
@@ -11,12 +11,12 @@ class UpdateCommand extends command_1.Command {
|
|
|
11
11
|
try {
|
|
12
12
|
const projects = new Projects();
|
|
13
13
|
const project = await projects.renewAccessKeySecret({ ref: args.ref });
|
|
14
|
-
|
|
15
|
-
await
|
|
16
|
-
|
|
14
|
+
core_1.CliUx.ux.action.start(`Renewing credentials for ${args.ref}`);
|
|
15
|
+
await core_1.CliUx.ux.wait(1000);
|
|
16
|
+
core_1.CliUx.ux.action.stop(project.accessKeySecret);
|
|
17
17
|
}
|
|
18
18
|
catch (e) {
|
|
19
|
-
|
|
19
|
+
core_1.CliUx.ux.action.stop();
|
|
20
20
|
throw new errors_1.CLIError(e.message);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const config_1 = require("../../config");
|
|
8
8
|
const Projects = require("@fonoster/projects");
|
|
9
9
|
class UpdateCommand extends command_1.Command {
|
|
@@ -12,7 +12,7 @@ class UpdateCommand extends command_1.Command {
|
|
|
12
12
|
try {
|
|
13
13
|
const projects = new Projects();
|
|
14
14
|
const project = await projects.getProject(args.ref);
|
|
15
|
-
|
|
15
|
+
core_1.CliUx.ux.action.start(`Setting default Project to ${args.ref}`);
|
|
16
16
|
const config = (0, config_1.getConfig)();
|
|
17
17
|
const { accessKeyId, accessKeySecret, endpoint } = config;
|
|
18
18
|
(0, config_1.setConfig)({
|
|
@@ -25,11 +25,11 @@ class UpdateCommand extends command_1.Command {
|
|
|
25
25
|
accessKeySecret: project.accessKeySecret
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
await
|
|
29
|
-
|
|
28
|
+
await core_1.CliUx.ux.wait(1000);
|
|
29
|
+
core_1.CliUx.ux.action.stop("Done");
|
|
30
30
|
}
|
|
31
31
|
catch (e) {
|
|
32
|
-
|
|
32
|
+
core_1.CliUx.ux.action.stop();
|
|
33
33
|
throw new errors_1.CLIError(e.message);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const config_1 = require("../../config");
|
|
8
8
|
const Providers = require("@fonoster/providers");
|
|
9
9
|
const inquirer = require("inquirer");
|
|
@@ -53,7 +53,7 @@ class CreateCommand extends command_1.Command {
|
|
|
53
53
|
}
|
|
54
54
|
return true;
|
|
55
55
|
},
|
|
56
|
-
default:
|
|
56
|
+
default: 600
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
name: "confirm",
|
|
@@ -66,14 +66,14 @@ class CreateCommand extends command_1.Command {
|
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
core_1.CliUx.ux.action.start(`Creating Provider ${answers.name}`);
|
|
70
70
|
const providers = new Providers((0, config_1.getProjectConfig)());
|
|
71
71
|
const provider = await providers.createProvider(answers);
|
|
72
|
-
await
|
|
73
|
-
|
|
72
|
+
await core_1.CliUx.ux.wait(1000);
|
|
73
|
+
core_1.CliUx.ux.action.stop(provider.ref);
|
|
74
74
|
}
|
|
75
75
|
catch (e) {
|
|
76
|
-
|
|
76
|
+
core_1.CliUx.ux.action.stop();
|
|
77
77
|
if (e.code === 9) {
|
|
78
78
|
throw new errors_1.CLIError("This Provider already exist");
|
|
79
79
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const prettyjson_1 = require("prettyjson");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Providers = require("@fonoster/providers");
|
|
@@ -16,7 +16,7 @@ class GetCommand extends command_1.Command {
|
|
|
16
16
|
const { args } = this.parse(GetCommand);
|
|
17
17
|
try {
|
|
18
18
|
const providers = new Providers((0, config_1.getProjectConfig)());
|
|
19
|
-
|
|
19
|
+
core_1.CliUx.ux.action.start(`getting provider ${args.ref}`);
|
|
20
20
|
const provider = await providers.getProvider(args.ref);
|
|
21
21
|
const jsonObj = {
|
|
22
22
|
Ref: provider.ref,
|
|
@@ -28,8 +28,8 @@ class GetCommand extends command_1.Command {
|
|
|
28
28
|
Created: moment(provider.createTime).fromNow(),
|
|
29
29
|
Updated: moment(provider.updateTime).fromNow()
|
|
30
30
|
};
|
|
31
|
-
await
|
|
32
|
-
|
|
31
|
+
await core_1.CliUx.ux.wait(1000);
|
|
32
|
+
core_1.CliUx.ux.action.stop("");
|
|
33
33
|
console.log((0, prettyjson_1.render)(jsonObj, { noColor: true }));
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
@@ -4,7 +4,7 @@ require("../../config");
|
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
6
|
const providers_1 = require("@fonoster/providers");
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const config_1 = require("../../config");
|
|
9
9
|
const Providers = require("@fonoster/providers");
|
|
10
10
|
const inquirer = require("inquirer");
|
|
@@ -40,7 +40,7 @@ class ListCommand extends command_1.Command {
|
|
|
40
40
|
if (list.length < 1)
|
|
41
41
|
break;
|
|
42
42
|
const showTable = (showHeader, data) => {
|
|
43
|
-
|
|
43
|
+
core_1.CliUx.ux.table(data, {
|
|
44
44
|
ref: { minWidth: 13 },
|
|
45
45
|
name: { header: "Name", minWidth: 13 },
|
|
46
46
|
username: {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../config");
|
|
4
4
|
const errors_1 = require("@oclif/errors");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const config_1 = require("../../config");
|
|
8
8
|
const Providers = require("@fonoster/providers");
|
|
9
9
|
const inquirer = require("inquirer");
|
|
@@ -69,13 +69,13 @@ class UpdateCommand extends command_1.Command {
|
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
try {
|
|
72
|
-
|
|
72
|
+
core_1.CliUx.ux.action.start(`Updating Provider ${answers.name}`);
|
|
73
73
|
await providers.updateProvider(answers);
|
|
74
|
-
await
|
|
75
|
-
|
|
74
|
+
await core_1.CliUx.ux.wait(1000);
|
|
75
|
+
core_1.CliUx.ux.action.stop("Done");
|
|
76
76
|
}
|
|
77
77
|
catch (e) {
|
|
78
|
-
|
|
78
|
+
core_1.CliUx.ux.action.stop();
|
|
79
79
|
throw new errors_1.CLIError(e.message);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
*/
|
|
27
27
|
require("../../config");
|
|
28
28
|
const command_1 = require("@oclif/command");
|
|
29
|
-
const
|
|
29
|
+
const core_1 = require("@oclif/core");
|
|
30
30
|
const config_1 = require("../../config");
|
|
31
31
|
const project_guard_1 = require("../../decorators/project_guard");
|
|
32
32
|
const errors_1 = require("@oclif/errors");
|
|
@@ -38,10 +38,10 @@ class DeleteCommand extends command_1.Command {
|
|
|
38
38
|
if (!args.name)
|
|
39
39
|
throw new errors_1.CLIError("You must specify a secret name");
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
core_1.CliUx.ux.action.start("Removing the secret...");
|
|
42
42
|
await secretsManager.deleteSecret(args.name);
|
|
43
|
-
await
|
|
44
|
-
|
|
43
|
+
await core_1.CliUx.ux.wait(1000);
|
|
44
|
+
core_1.CliUx.ux.action.stop("Done");
|
|
45
45
|
}
|
|
46
46
|
catch (e) {
|
|
47
47
|
console.error("Unable to remove!");
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.3.6-alpha.
|
|
1
|
+
{"version":"0.3.6-alpha.7","commands":{"bug":{"id":"bug","description":"start a bug report 🐞\n ...\n Opens github issues with a predefine bug template\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"feedback":{"id":"feedback","description":"let us know how we're doing\n ...\n Help us improve by providing some feedback\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"agents:create":{"id":"agents:create","description":"create a new Fonoster Agent\n ...\n Create a new Fonoster Agent\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"agents:delete":{"id":"agents:delete","description":"delete a Fonoster Agent","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["agents:del","agents:rm"],"flags":{},"args":[{"name":"ref"}]},"agents:get":{"id":"agents:get","description":"get a Fonoster Agent","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"agents:list":{"id":"agents:list","description":"list all Fonoster Agents you have access to\n ...\n List all Fonoster Agents you have access to\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["agents:ls"],"flags":{"size":{"name":"size","type":"option","char":"s","description":"agent of result per page","default":25}},"args":[]},"agents:update":{"id":"agents:update","description":"update a Fonoster Agent\n ...\n Update a Fonoster Agent\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"apps:create":{"id":"apps:create","description":"create a new Fonoster App\n ...\n Create a new Fonoster App\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"apps:delete":{"id":"apps:delete","description":"delete a Fonoster Application","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["apps:del","apps:rm"],"flags":{},"args":[{"name":"ref"}]},"apps:list":{"id":"apps:list","description":"list all Fonoster Apps you have access to\n ...\n List all Fonoster Apps you have access to\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["apps:ls"],"flags":{"size":{"name":"size","type":"option","char":"s","description":"number of result per page","default":25}},"args":[]},"apps:update":{"id":"apps:update","description":"update a new Fonoster App\n ...\n Update a new Fonoster App\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"auth:login":{"id":"auth:login","description":"log in to a Fonoster deployment","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"auth:logout":{"id":"auth:logout","description":"log out from a fonoster deployment","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"domains:create":{"id":"domains:create","description":"create a new Fonoster Domain\n ...\n Create a new Fonoster Domain\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"domains:delete":{"id":"domains:delete","description":"delete a Fonoster Domain","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["domains:del","domains:rm"],"flags":{},"args":[{"name":"ref"}]},"domains:get":{"id":"domains:get","description":"get a Fonoster Domain","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"domains:list":{"id":"domains:list","description":"list all Fonoster Domains you have access to\n ...\n List all Fonoster Domains you have access to\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["domains:ls"],"flags":{"size":{"name":"size","type":"option","char":"s","description":"number of result per page","default":25}},"args":[]},"domains:update":{"id":"domains:update","description":"update a Fonoster Domain\n ...\n Update a Fonoster Domain\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"numbers:create":{"id":"numbers:create","description":"create a new Fonoster Number\n ...\n Create a new Fonoster Number\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"numbers:delete":{"id":"numbers:delete","description":"delete a Fonoster Number","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["numbers:del","numbers:rm"],"flags":{},"args":[{"name":"ref"}]},"numbers:get":{"id":"numbers:get","description":"get a Fonoster Number","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"numbers:list":{"id":"numbers:list","description":"list all Fonoster Numbers you have access to\n ...\n List all Fonoster Numbers you have access to\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["numbers:ls"],"flags":{"size":{"name":"size","type":"option","char":"s","description":"number of result per page","default":25}},"args":[]},"numbers:update":{"id":"numbers:update","description":"update a Fonoster Number\n ...\n Update a Fonoster Number\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"projects:create":{"id":"projects:create","description":"create a new Fonoster Project\n ...\n Create a new Fonoster Project\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"projects:delete":{"id":"projects:delete","description":"delete a Fonoster Project","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["projects:del","projects:rm"],"flags":{},"args":[{"name":"ref"}]},"projects:get":{"id":"projects:get","description":"get a Fonoster Project","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"projects:list":{"id":"projects:list","description":"list all Fonoster Projects you have access to\n ...\n List all Fonoster Projects you have access to\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["projects:ls"],"flags":{},"args":[]},"projects:renew":{"id":"projects:renew","description":"renew the credentials of a Fonoster Project\n ...\n Renew the credentials of a Fonoster Project\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"projects:use":{"id":"projects:use","description":"set a default Fonoster Project\n ...\n Set a default Fonoster Project\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"providers:create":{"id":"providers:create","description":"create a new Fonoster Provider (trunk)\n ...\n Create a new Fonoster Provider\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[]},"providers:delete":{"id":"providers:delete","description":"delete a Fonoster Provider","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["providers:del","providers:rm"],"flags":{},"args":[{"name":"ref"}]},"providers:get":{"id":"providers:get","description":"get a Fonoster Provider","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"providers:list":{"id":"providers:list","description":"list all Fonoster Providers you have access to\n ...\n List all Fonoster Providers you have access to\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["providers:ls"],"flags":{"size":{"name":"size","type":"option","char":"s","description":"provider of result per page","default":25}},"args":[]},"providers:update":{"id":"providers:update","description":"update a Fonoster Provider\n ...\n Update a Fonoster Provider\n ","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"ref"}]},"secrets:create":{"id":"secrets:create","description":"create a Fonoster secret.","pluginName":"@fonoster/ctl","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"from-literal":{"name":"from-literal","type":"option","char":"l","description":"pass from literal"},"from-stdin":{"name":"from-stdin","type":"boolean","char":"s","description":"pass from stdin","allowNo":false}},"args":[{"name":"name"}]},"secrets:delete":{"id":"secrets:delete","description":"remove Fonoster secret","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["secrets:del","secrets:rm"],"flags":{},"args":[{"name":"name"}]},"secrets:list":{"id":"secrets:list","description":"list of the secrets you have access to","pluginName":"@fonoster/ctl","pluginType":"core","aliases":["secrets:ls"],"flags":{"size":{"name":"size","type":"option","char":"s","description":"secrets of result per page","default":25}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/ctl",
|
|
3
|
-
"version": "0.3.6-alpha.
|
|
3
|
+
"version": "0.3.6-alpha.7",
|
|
4
4
|
"description": "Command-Line for Fonoster",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -58,22 +58,22 @@
|
|
|
58
58
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@fonoster/agents": "^0.3.6-alpha.
|
|
62
|
-
"@fonoster/apps": "^0.3.6-alpha.
|
|
63
|
-
"@fonoster/domains": "^0.3.6-alpha.
|
|
64
|
-
"@fonoster/logger": "^0.3.6-alpha.
|
|
65
|
-
"@fonoster/numbers": "^0.3.6-alpha.
|
|
61
|
+
"@fonoster/agents": "^0.3.6-alpha.7",
|
|
62
|
+
"@fonoster/apps": "^0.3.6-alpha.7",
|
|
63
|
+
"@fonoster/domains": "^0.3.6-alpha.7",
|
|
64
|
+
"@fonoster/logger": "^0.3.6-alpha.7",
|
|
65
|
+
"@fonoster/numbers": "^0.3.6-alpha.7",
|
|
66
66
|
"@fonoster/plugin-warn-if-update-available": "github:fonoster/plugin-warn-if-update-available",
|
|
67
|
-
"@fonoster/projects": "^0.3.6-alpha.
|
|
68
|
-
"@fonoster/providers": "^0.3.6-alpha.
|
|
69
|
-
"@fonoster/secrets": "^0.3.6-alpha.
|
|
67
|
+
"@fonoster/projects": "^0.3.6-alpha.7",
|
|
68
|
+
"@fonoster/providers": "^0.3.6-alpha.7",
|
|
69
|
+
"@fonoster/secrets": "^0.3.6-alpha.7",
|
|
70
70
|
"@oclif/command": "^1.8.16",
|
|
71
71
|
"@oclif/config": "^1.18.3",
|
|
72
|
+
"@oclif/core": "^1.3.4",
|
|
72
73
|
"@oclif/errors": "^1.3.5",
|
|
73
74
|
"@oclif/plugin-help": "^3.3.1",
|
|
74
75
|
"@oclif/plugin-not-found": "^2.3.1",
|
|
75
76
|
"@oclif/plugin-plugins": "^2.1.0",
|
|
76
|
-
"cli-ux": "5.5.1",
|
|
77
77
|
"easy-table": "^1.2.0",
|
|
78
78
|
"figlet": "^1.5.0",
|
|
79
79
|
"get-stdin-with-tty": "^6.0.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"@types/prettyjson": "0.0.29",
|
|
88
88
|
"rimraf": "^3.0.2"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "dcb8f5198df2df00a733394327402e0fe71d4ad3"
|
|
91
91
|
}
|