@routr/ctl 2.0.8-alpha.22 → 2.0.8-alpha.24
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 +1 -1
- package/dist/commands/acl/create.js +43 -43
- package/dist/commands/acl/get.js +1 -1
- package/dist/commands/acl/update.js +43 -43
- package/dist/commands/agents/create.js +97 -97
- package/dist/commands/agents/update.js +88 -88
- package/dist/commands/credentials/update.js +39 -39
- package/dist/commands/domains/create.js +105 -105
- package/dist/commands/domains/update.js +99 -99
- package/dist/commands/numbers/create.js +88 -88
- package/dist/commands/numbers/update.js +69 -69
- package/dist/commands/peers/create.js +100 -97
- package/dist/commands/peers/update.js +97 -94
- package/dist/commands/trunks/create.js +148 -148
- package/dist/commands/trunks/update.js +151 -151
- package/dist/delete.js +8 -3
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -59,56 +59,56 @@ class CreateCommand extends base_1.BaseCommand {
|
|
|
59
59
|
async run() {
|
|
60
60
|
const { flags } = await this.parse(CreateCommand);
|
|
61
61
|
const { endpoint, insecure } = flags;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
62
|
+
try {
|
|
63
|
+
this.log("This utility will help you create a new ACL");
|
|
64
|
+
this.log("Press ^C at any time to quit.");
|
|
65
|
+
const answers = await inquirer_1.default.prompt([
|
|
66
|
+
{
|
|
67
|
+
name: "name",
|
|
68
|
+
message: "Friendly Name",
|
|
69
|
+
type: "input",
|
|
70
|
+
validate: validators_1.nameValidator
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "deny",
|
|
74
|
+
message: "Deny CIDR Networks",
|
|
75
|
+
type: "input",
|
|
76
|
+
default: "0.0.0.0/0",
|
|
77
|
+
validate: validators_1.aclRuleValidator
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "allow",
|
|
81
|
+
message: "Allow CIDR Networks",
|
|
82
|
+
type: "input",
|
|
83
|
+
validate: validators_1.aclRuleValidator
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "confirm",
|
|
87
|
+
message: "Ready?",
|
|
88
|
+
type: "confirm"
|
|
89
|
+
}
|
|
90
|
+
]);
|
|
91
|
+
// Re-assign allow and deny rules as arrays
|
|
92
|
+
answers.allow = (0, utils_1.stringToACL)(answers.allow);
|
|
93
|
+
answers.deny = (0, utils_1.stringToACL)(answers.deny);
|
|
94
|
+
if (!answers.confirm) {
|
|
95
|
+
this.warn("Aborted");
|
|
88
96
|
}
|
|
89
|
-
|
|
90
|
-
// Re-assign allow and deny rules as arrays
|
|
91
|
-
answers.allow = (0, utils_1.stringToACL)(answers.allow);
|
|
92
|
-
answers.deny = (0, utils_1.stringToACL)(answers.deny);
|
|
93
|
-
if (!answers.confirm) {
|
|
94
|
-
this.warn("Aborted");
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
try {
|
|
97
|
+
else {
|
|
98
98
|
core_1.CliUx.ux.action.start(`Creating ACL ${answers.name}`);
|
|
99
99
|
const api = new sdk_1.default.ACL({ endpoint, insecure });
|
|
100
100
|
const acl = await api.createACL(answers);
|
|
101
101
|
await core_1.CliUx.ux.wait(1000);
|
|
102
102
|
core_1.CliUx.ux.action.stop(acl.ref);
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
core_1.CliUx.ux.action.stop();
|
|
107
|
+
if (e.code === grpc.status.ALREADY_EXISTS) {
|
|
108
|
+
throw new errors_1.CLIError("This ACL already exist");
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
throw new errors_1.CLIError(e.message);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
package/dist/commands/acl/get.js
CHANGED
|
@@ -42,12 +42,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
42
42
|
* limitations under the License.
|
|
43
43
|
*/
|
|
44
44
|
/* eslint-disable require-jsdoc */
|
|
45
|
+
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
45
46
|
const core_1 = require("@oclif/core");
|
|
46
47
|
const base_1 = require("../../base");
|
|
47
48
|
const utils_1 = require("../../utils");
|
|
48
49
|
const common_1 = require("@routr/common");
|
|
49
50
|
const errors_1 = require("@oclif/core/lib/errors");
|
|
50
|
-
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
51
51
|
class GetCommand extends base_1.BaseCommand {
|
|
52
52
|
async run() {
|
|
53
53
|
const { args, flags } = await this.parse(GetCommand);
|
|
@@ -36,55 +36,55 @@ class UpdateCommand extends base_1.BaseCommand {
|
|
|
36
36
|
const { args, flags } = await this.parse(UpdateCommand);
|
|
37
37
|
const { endpoint, insecure } = flags;
|
|
38
38
|
const api = new sdk_1.default.ACL({ endpoint, insecure });
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
39
|
+
try {
|
|
40
|
+
const aclFromDB = await api.getACL(args.ref);
|
|
41
|
+
this.log("This utility will help you update an existing ACL.");
|
|
42
|
+
this.log("Press ^C at any time to quit.");
|
|
43
|
+
const answers = await inquirer_1.default.prompt([
|
|
44
|
+
{
|
|
45
|
+
name: "name",
|
|
46
|
+
message: "Friendly Name",
|
|
47
|
+
type: "input",
|
|
48
|
+
default: aclFromDB.name,
|
|
49
|
+
validate: validators_1.nameValidator
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "deny",
|
|
53
|
+
message: "Deny CIDR Networks",
|
|
54
|
+
type: "input",
|
|
55
|
+
default: aclFromDB.deny.join(","),
|
|
56
|
+
validate: validators_1.aclRuleValidator
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "allow",
|
|
60
|
+
message: "Allow CIDR Networks",
|
|
61
|
+
type: "input",
|
|
62
|
+
default: aclFromDB.allow.join(","),
|
|
63
|
+
validate: validators_1.aclRuleValidator
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "confirm",
|
|
67
|
+
message: "Ready?",
|
|
68
|
+
type: "confirm"
|
|
69
|
+
}
|
|
70
|
+
]);
|
|
71
|
+
answers.ref = args.ref;
|
|
72
|
+
// Re-assign allow and deny rules as arrays
|
|
73
|
+
answers.allow = (0, utils_1.stringToACL)(answers.allow);
|
|
74
|
+
answers.deny = (0, utils_1.stringToACL)(answers.deny);
|
|
75
|
+
if (!answers.confirm) {
|
|
76
|
+
this.warn("Aborted");
|
|
68
77
|
}
|
|
69
|
-
|
|
70
|
-
answers.ref = args.ref;
|
|
71
|
-
// Re-assign allow and deny rules as arrays
|
|
72
|
-
answers.allow = (0, utils_1.stringToACL)(answers.allow);
|
|
73
|
-
answers.deny = (0, utils_1.stringToACL)(answers.deny);
|
|
74
|
-
if (!answers.confirm) {
|
|
75
|
-
this.warn("Aborted");
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
try {
|
|
78
|
+
else {
|
|
79
79
|
core_1.CliUx.ux.action.start(`Updating ACL ${answers.name}`);
|
|
80
80
|
const acl = await api.updateACL(answers);
|
|
81
81
|
await core_1.CliUx.ux.wait(1000);
|
|
82
82
|
core_1.CliUx.ux.action.stop(acl.ref);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
core_1.CliUx.ux.action.stop();
|
|
87
|
+
throw new errors_1.CLIError(e.message);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -62,110 +62,110 @@ class CreateAgentCommand extends base_1.BaseCommand {
|
|
|
62
62
|
async run() {
|
|
63
63
|
const { flags } = await this.parse(CreateAgentCommand);
|
|
64
64
|
const { endpoint, insecure } = flags;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
65
|
+
try {
|
|
66
|
+
// TODO: Fix hardcoded pageSize
|
|
67
|
+
const domains = await new sdk_1.default.Domains({ endpoint, insecure }).listDomains({
|
|
68
|
+
pageSize: 25,
|
|
69
|
+
pageToken: ""
|
|
70
|
+
});
|
|
71
|
+
// TODO: Fix hardcoded pageSize
|
|
72
|
+
const credentials = await new sdk_1.default.Credentials({
|
|
73
|
+
endpoint,
|
|
74
|
+
insecure
|
|
75
|
+
}).listCredentials({
|
|
76
|
+
pageSize: 25,
|
|
77
|
+
pageToken: ""
|
|
78
|
+
});
|
|
79
|
+
const domainsList = domains.items.map((domain) => {
|
|
80
|
+
return {
|
|
81
|
+
name: domain.domainUri,
|
|
82
|
+
description: domain.name,
|
|
83
|
+
value: domain.ref
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
const credentialsList = credentials.items.map((credential) => {
|
|
87
|
+
return { name: credential.name, value: credential.ref };
|
|
88
|
+
});
|
|
89
|
+
const searcher = new fuzzy_search_1.default(domainsList, ["name", "value", "description"], {
|
|
90
|
+
caseSensitive: false
|
|
91
|
+
});
|
|
92
|
+
this.log("This utility will help you create a new Agent.");
|
|
93
|
+
this.log("Press ^C at any time to quit.");
|
|
94
|
+
const answers = await inquirer_1.default.prompt([
|
|
95
|
+
{
|
|
96
|
+
name: "name",
|
|
97
|
+
message: "Friendly Name",
|
|
98
|
+
type: "input",
|
|
99
|
+
validate: validators_1.nameValidator
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "autocomplete",
|
|
103
|
+
name: "domainRef",
|
|
104
|
+
message: "Select a Domain",
|
|
105
|
+
source: (_, input) => searcher.search(input),
|
|
106
|
+
when: () => domains.items.length > 0
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "username",
|
|
110
|
+
message: "Username",
|
|
111
|
+
type: "input",
|
|
112
|
+
validate: validators_1.usernameValidator
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "credentialsRef",
|
|
116
|
+
message: "Credentials Name",
|
|
117
|
+
type: "list",
|
|
118
|
+
choices: [{ name: "None", value: undefined }, ...credentialsList]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "privacy",
|
|
122
|
+
message: "Privacy",
|
|
123
|
+
type: "list",
|
|
124
|
+
choices: [
|
|
125
|
+
{
|
|
126
|
+
name: "None",
|
|
127
|
+
value: common_1.CommonTypes.Privacy.NONE
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "Private",
|
|
131
|
+
value: common_1.CommonTypes.Privacy.PRIVATE
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
default: common_1.CommonTypes.Privacy.NONE
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "enabled",
|
|
138
|
+
message: "Enabled",
|
|
139
|
+
type: "confirm",
|
|
140
|
+
default: true
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "confirm",
|
|
144
|
+
message: "Ready?",
|
|
145
|
+
type: "confirm"
|
|
146
|
+
}
|
|
147
|
+
]);
|
|
148
|
+
// Re-write privacy to enum
|
|
149
|
+
answers.privacy =
|
|
150
|
+
common_1.CommonTypes.Privacy[answers.privacy.toUpperCase()];
|
|
151
|
+
if (!answers.confirm) {
|
|
152
|
+
this.warn("Aborted");
|
|
145
153
|
}
|
|
146
|
-
|
|
147
|
-
// Re-write privacy to enum
|
|
148
|
-
answers.privacy =
|
|
149
|
-
common_1.CommonTypes.Privacy[answers.privacy.toUpperCase()];
|
|
150
|
-
if (!answers.confirm) {
|
|
151
|
-
this.warn("Aborted");
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
try {
|
|
154
|
+
else {
|
|
155
155
|
core_1.CliUx.ux.action.start(`Creating Agent ${answers.name}`);
|
|
156
156
|
const api = new sdk_1.default.Agents({ endpoint, insecure });
|
|
157
157
|
const agent = await api.createAgent(answers);
|
|
158
158
|
await core_1.CliUx.ux.wait(1000);
|
|
159
159
|
core_1.CliUx.ux.action.stop(agent.ref);
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
core_1.CliUx.ux.action.stop();
|
|
164
|
+
if (e.code === grpc.status.ALREADY_EXISTS) {
|
|
165
|
+
throw new errors_1.CLIError("This Agent already exist");
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
throw new errors_1.CLIError(e.message);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -37,100 +37,100 @@ class UpdateCommand extends base_1.BaseCommand {
|
|
|
37
37
|
var _a, _b;
|
|
38
38
|
const { args, flags } = await this.parse(UpdateCommand);
|
|
39
39
|
const { endpoint, insecure } = flags;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
40
|
+
try {
|
|
41
|
+
const api = new sdk_1.default.Agents({ endpoint, insecure });
|
|
42
|
+
const agentFromDB = await api.getAgent(args.ref);
|
|
43
|
+
// TODO: Fix hardcoded pageSize
|
|
44
|
+
const domains = await new sdk_1.default.Domains({ endpoint, insecure }).listDomains({
|
|
45
|
+
pageSize: 25,
|
|
46
|
+
pageToken: ""
|
|
47
|
+
});
|
|
48
|
+
// TODO: Fix hardcoded pageSize
|
|
49
|
+
const credentials = await new sdk_1.default.Credentials({
|
|
50
|
+
endpoint,
|
|
51
|
+
insecure
|
|
52
|
+
}).listCredentials({
|
|
53
|
+
pageSize: 25,
|
|
54
|
+
pageToken: ""
|
|
55
|
+
});
|
|
56
|
+
const domainsList = (_a = domains.items) === null || _a === void 0 ? void 0 : _a.map((domain) => {
|
|
57
|
+
return { name: domain.domainUri, value: domain.ref };
|
|
58
|
+
});
|
|
59
|
+
const credentialsList = (_b = credentials.items) === null || _b === void 0 ? void 0 : _b.map((credential) => {
|
|
60
|
+
return { name: credential.name, value: credential.ref };
|
|
61
|
+
});
|
|
62
|
+
const searcher = new fuzzy_search_1.default(domainsList, ["name", "value", "description"], {
|
|
63
|
+
caseSensitive: false
|
|
64
|
+
});
|
|
65
|
+
this.log("This utility will help you update an existing Agent.");
|
|
66
|
+
this.log("Press ^C at any time to quit.");
|
|
67
|
+
const answers = await inquirer_1.default.prompt([
|
|
68
|
+
{
|
|
69
|
+
name: "name",
|
|
70
|
+
message: "Friendly Name",
|
|
71
|
+
type: "input",
|
|
72
|
+
default: agentFromDB.name,
|
|
73
|
+
validate: validators_1.nameValidator
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "autocomplete",
|
|
77
|
+
name: "domainRef",
|
|
78
|
+
message: "Select a Domain",
|
|
79
|
+
source: (_, input) => searcher.search(input),
|
|
80
|
+
when: () => domains.items.length > 0
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "credentialsRef",
|
|
84
|
+
message: "Credentials Name",
|
|
85
|
+
type: "list",
|
|
86
|
+
choices: [{ name: "None", value: undefined }, ...credentialsList],
|
|
87
|
+
default: agentFromDB.credentialsRef
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "privacy",
|
|
91
|
+
message: "Privacy",
|
|
92
|
+
type: "list",
|
|
93
|
+
choices: [
|
|
94
|
+
{
|
|
95
|
+
name: "None",
|
|
96
|
+
value: common_1.CommonTypes.Privacy.NONE
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "Private",
|
|
100
|
+
value: common_1.CommonTypes.Privacy.PRIVATE
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
default: agentFromDB.privacy
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "enabled",
|
|
107
|
+
message: "Enabled",
|
|
108
|
+
type: "confirm",
|
|
109
|
+
default: agentFromDB.enabled
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "confirm",
|
|
113
|
+
message: "Ready?",
|
|
114
|
+
type: "confirm"
|
|
115
|
+
}
|
|
116
|
+
]);
|
|
117
|
+
// Re-write privacy to enum
|
|
118
|
+
answers.privacy =
|
|
119
|
+
common_1.CommonTypes.Privacy[answers.privacy.toUpperCase()];
|
|
120
|
+
answers.ref = args.ref;
|
|
121
|
+
if (!answers.confirm) {
|
|
122
|
+
this.warn("Aborted");
|
|
114
123
|
}
|
|
115
|
-
|
|
116
|
-
// Re-write privacy to enum
|
|
117
|
-
answers.privacy =
|
|
118
|
-
common_1.CommonTypes.Privacy[answers.privacy.toUpperCase()];
|
|
119
|
-
answers.ref = args.ref;
|
|
120
|
-
if (!answers.confirm) {
|
|
121
|
-
this.warn("Aborted");
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
try {
|
|
124
|
+
else {
|
|
125
125
|
core_1.CliUx.ux.action.start(`Updating Agent ${answers.name}`);
|
|
126
126
|
const agent = await api.updateAgent(answers);
|
|
127
127
|
await core_1.CliUx.ux.wait(1000);
|
|
128
128
|
core_1.CliUx.ux.action.stop(agent.ref);
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
core_1.CliUx.ux.action.stop();
|
|
133
|
+
throw new errors_1.CLIError(e.message);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|