@routr/ctl 2.15.4 → 2.17.0

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.
Files changed (71) hide show
  1. package/README.md +170 -120
  2. package/bin/dev +12 -12
  3. package/bin/run +5 -3
  4. package/dist/base.d.ts +3 -3
  5. package/dist/base.js +1 -1
  6. package/dist/commands/acl/create.js +7 -7
  7. package/dist/commands/acl/delete.d.ts +1 -1
  8. package/dist/commands/acl/delete.js +6 -6
  9. package/dist/commands/acl/describe.d.ts +2 -4
  10. package/dist/commands/acl/describe.js +5 -9
  11. package/dist/commands/acl/get.d.ts +6 -8
  12. package/dist/commands/acl/get.js +9 -10
  13. package/dist/commands/acl/update.d.ts +2 -4
  14. package/dist/commands/acl/update.js +8 -8
  15. package/dist/commands/agents/create.js +7 -7
  16. package/dist/commands/agents/delete.js +1 -1
  17. package/dist/commands/agents/describe.d.ts +2 -4
  18. package/dist/commands/agents/describe.js +5 -9
  19. package/dist/commands/agents/get.d.ts +6 -8
  20. package/dist/commands/agents/get.js +9 -10
  21. package/dist/commands/agents/update.d.ts +2 -4
  22. package/dist/commands/agents/update.js +11 -12
  23. package/dist/commands/credentials/create.js +7 -7
  24. package/dist/commands/credentials/delete.js +1 -1
  25. package/dist/commands/credentials/describe.d.ts +2 -4
  26. package/dist/commands/credentials/describe.js +6 -7
  27. package/dist/commands/credentials/get.d.ts +6 -8
  28. package/dist/commands/credentials/get.js +9 -10
  29. package/dist/commands/credentials/update.d.ts +2 -4
  30. package/dist/commands/credentials/update.js +9 -10
  31. package/dist/commands/domains/create.js +7 -7
  32. package/dist/commands/domains/delete.js +1 -1
  33. package/dist/commands/domains/describe.d.ts +2 -4
  34. package/dist/commands/domains/describe.js +6 -7
  35. package/dist/commands/domains/get.d.ts +6 -8
  36. package/dist/commands/domains/get.js +9 -10
  37. package/dist/commands/domains/update.d.ts +2 -4
  38. package/dist/commands/domains/update.js +10 -11
  39. package/dist/commands/numbers/create.js +7 -7
  40. package/dist/commands/numbers/delete.js +1 -1
  41. package/dist/commands/numbers/describe.d.ts +2 -4
  42. package/dist/commands/numbers/describe.js +6 -7
  43. package/dist/commands/numbers/get.d.ts +6 -8
  44. package/dist/commands/numbers/get.js +9 -10
  45. package/dist/commands/numbers/update.d.ts +2 -4
  46. package/dist/commands/numbers/update.js +10 -11
  47. package/dist/commands/peers/create.js +7 -7
  48. package/dist/commands/peers/delete.js +1 -1
  49. package/dist/commands/peers/describe.d.ts +2 -4
  50. package/dist/commands/peers/describe.js +5 -9
  51. package/dist/commands/peers/get.d.ts +6 -8
  52. package/dist/commands/peers/get.js +9 -10
  53. package/dist/commands/peers/update.d.ts +2 -4
  54. package/dist/commands/peers/update.js +11 -12
  55. package/dist/commands/trunks/create.js +7 -7
  56. package/dist/commands/trunks/delete.js +1 -1
  57. package/dist/commands/trunks/describe.d.ts +2 -4
  58. package/dist/commands/trunks/describe.js +5 -9
  59. package/dist/commands/trunks/get.d.ts +6 -8
  60. package/dist/commands/trunks/get.js +9 -10
  61. package/dist/commands/trunks/update.d.ts +2 -4
  62. package/dist/commands/trunks/update.js +12 -13
  63. package/dist/delete.d.ts +2 -2
  64. package/dist/delete.js +10 -8
  65. package/dist/help.js +2 -1
  66. package/dist/lib/table.d.ts +15 -0
  67. package/dist/lib/table.js +75 -0
  68. package/dist/lib/wait.d.ts +1 -0
  69. package/dist/lib/wait.js +25 -0
  70. package/oclif.manifest.json +1171 -772
  71. package/package.json +15 -14
@@ -55,10 +55,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
55
55
  * limitations under the License.
56
56
  */
57
57
  /* eslint-disable require-jsdoc */
58
- const grpc = __importStar(require("@grpc/grpc-js"));
59
58
  const core_1 = require("@oclif/core");
59
+ const wait_1 = require("../../lib/wait");
60
+ const grpc = __importStar(require("@grpc/grpc-js"));
60
61
  const base_1 = require("../../base");
61
- const errors_1 = require("@oclif/core/lib/errors");
62
62
  const common_1 = require("@routr/common");
63
63
  const sdk_1 = __importDefault(require("@routr/sdk"));
64
64
  // NOTE: Newer versions of inquirer have a bug that causes the following error:
@@ -178,22 +178,22 @@ class CreateCommand extends base_1.BaseCommand {
178
178
  this.warn("Aborted");
179
179
  }
180
180
  else {
181
- core_1.CliUx.ux.action.start(`Creating Peer ${answers.name}`);
181
+ core_1.ux.action.start(`Creating Peer ${answers.name}`);
182
182
  const api = new sdk_1.default.Peers({ endpoint, insecure, cacert });
183
183
  answers.maxContacts = answers.maxContacts
184
184
  ? parseInt(answers.maxContacts)
185
185
  : -1;
186
186
  const peer = await api.createPeer(answers);
187
- await core_1.CliUx.ux.wait(1000);
188
- core_1.CliUx.ux.action.stop(peer.ref);
187
+ await (0, wait_1.wait)(1000);
188
+ core_1.ux.action.stop(peer.ref);
189
189
  }
190
190
  }
191
191
  catch (e) {
192
192
  if (e.code === grpc.status.ALREADY_EXISTS) {
193
- throw new errors_1.CLIError("This Peer already exist");
193
+ throw new core_1.Errors.CLIError("This Peer already exist");
194
194
  }
195
195
  else {
196
- throw new errors_1.CLIError(e.message);
196
+ throw new core_1.Errors.CLIError(e.message);
197
197
  }
198
198
  }
199
199
  }
@@ -26,7 +26,7 @@ const delete_1 = __importDefault(require("../../delete"));
26
26
  const sdk_1 = __importDefault(require("@routr/sdk"));
27
27
  class DeletePeerCommand extends delete_1.default {
28
28
  async run() {
29
- const { flags } = await this.parse(DeletePeerCommand);
29
+ const { flags } = await this.parse(delete_1.default);
30
30
  const { endpoint, insecure, cacert } = flags;
31
31
  await super.deleteResource(new sdk_1.default.Peers({ endpoint, insecure, cacert }), "deletePeer");
32
32
  }
@@ -2,9 +2,7 @@ import { BaseCommand } from "../../base";
2
2
  export default class DescribeCommand extends BaseCommand {
3
3
  static readonly description = "shows details for a Peer";
4
4
  static readonly args: {
5
- name: string;
6
- required: boolean;
7
- description: string;
8
- }[];
5
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
9
7
  run(): Promise<void>;
10
8
  }
@@ -22,8 +22,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  * limitations under the License.
23
23
  */
24
24
  /* eslint-disable require-jsdoc */
25
+ const core_1 = require("@oclif/core");
25
26
  const base_1 = require("../../base");
26
- const errors_1 = require("@oclif/core/lib/errors");
27
27
  const prettyjson_1 = require("prettyjson");
28
28
  const utils_1 = require("../../utils");
29
29
  const sdk_1 = __importDefault(require("@routr/sdk"));
@@ -67,16 +67,12 @@ class DescribeCommand extends base_1.BaseCommand {
67
67
  this.log((0, prettyjson_1.render)(jsonObj, { noColor: true }));
68
68
  }
69
69
  catch (e) {
70
- throw new errors_1.CLIError(e.message);
70
+ throw new core_1.Errors.CLIError(e.message);
71
71
  }
72
72
  }
73
73
  }
74
74
  DescribeCommand.description = "shows details for a Peer";
75
- DescribeCommand.args = [
76
- {
77
- name: "ref",
78
- required: false,
79
- description: "reference to the Peer"
80
- }
81
- ];
75
+ DescribeCommand.args = {
76
+ ref: core_1.Args.string({ required: false, description: "reference to the Peer" })
77
+ };
82
78
  exports.default = DescribeCommand;
@@ -1,20 +1,18 @@
1
+ import { Interfaces } from "@oclif/core";
1
2
  import { BaseCommand } from "../../base";
2
- import { CommandError } from "@oclif/core/lib/interfaces";
3
3
  export default class GetCommand extends BaseCommand {
4
4
  static readonly description = "Shows a list of paginated Peers or a single Peer if ref is provided";
5
5
  static readonly examples: string[];
6
6
  static readonly flags: {
7
- size: import("@oclif/core/lib/interfaces").OptionFlag<number>;
8
- extended: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ size: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
8
+ extended: Interfaces.BooleanFlag<boolean>;
9
9
  };
10
10
  static args: {
11
- name: string;
12
- required: boolean;
13
- description: string;
14
- }[];
11
+ ref: Interfaces.Arg<string, Record<string, unknown>>;
12
+ };
15
13
  run(): Promise<void>;
16
14
  catch(error: {
17
15
  code: number;
18
16
  message: string;
19
- } | CommandError): Promise<void>;
17
+ } | Interfaces.CommandError): Promise<void>;
20
18
  }
@@ -52,18 +52,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
52
52
  * limitations under the License.
53
53
  */
54
54
  /* eslint-disable require-jsdoc */
55
- const grpc = __importStar(require("@grpc/grpc-js"));
56
55
  const core_1 = require("@oclif/core");
56
+ const table_1 = require("../../lib/table");
57
+ const grpc = __importStar(require("@grpc/grpc-js"));
57
58
  const base_1 = require("../../base");
58
59
  const utils_1 = require("../../utils");
59
60
  const common_1 = require("@routr/common");
60
- const errors_1 = require("@oclif/core/lib/errors");
61
61
  class GetCommand extends base_1.BaseCommand {
62
62
  async run() {
63
63
  const { args, flags } = await this.parse(GetCommand);
64
64
  const showTable = (request) => {
65
65
  const { showHeader, data, self, flags } = request;
66
- core_1.CliUx.ux.table(data, {
66
+ (0, table_1.printTable)(data, {
67
67
  ref: {
68
68
  minWidth: 7,
69
69
  extended: true
@@ -107,9 +107,9 @@ class GetCommand extends base_1.BaseCommand {
107
107
  // To be handled globally
108
108
  if ("code" in error && error.code === grpc.status.NOT_FOUND) {
109
109
  const { args } = await this.parse(GetCommand);
110
- throw new errors_1.CLIError("the Peer you are looking for does not exist: " + args.ref);
110
+ throw new core_1.Errors.CLIError("the Peer you are looking for does not exist: " + args.ref);
111
111
  }
112
- throw new errors_1.CLIError(error.message);
112
+ throw new core_1.Errors.CLIError(error.message);
113
113
  }
114
114
  }
115
115
  GetCommand.description = "Shows a list of paginated Peers or a single Peer if ref is provided";
@@ -130,11 +130,10 @@ GetCommand.flags = {
130
130
  description: "extended output format"
131
131
  })
132
132
  };
133
- GetCommand.args = [
134
- {
135
- name: "ref",
133
+ GetCommand.args = {
134
+ ref: core_1.Args.string({
136
135
  required: false,
137
136
  description: "optional reference to a Peer"
138
- }
139
- ];
137
+ })
138
+ };
140
139
  exports.default = GetCommand;
@@ -3,9 +3,7 @@ export default class UpdatePeerCommand extends BaseCommand {
3
3
  static readonly description = "Updates an existing Peer";
4
4
  static readonly examples: string[];
5
5
  static readonly args: {
6
- name: string;
7
- required: boolean;
8
- description: string;
9
- }[];
6
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
10
8
  run(): Promise<void>;
11
9
  }
@@ -23,8 +23,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  */
24
24
  /* eslint-disable require-jsdoc */
25
25
  const core_1 = require("@oclif/core");
26
+ const wait_1 = require("../../lib/wait");
26
27
  const base_1 = require("../../base");
27
- const errors_1 = require("@oclif/core/lib/errors");
28
28
  const common_1 = require("@routr/common");
29
29
  const validators_1 = require("../../validators");
30
30
  const sdk_1 = __importDefault(require("@routr/sdk"));
@@ -93,14 +93,14 @@ class UpdatePeerCommand extends base_1.BaseCommand {
93
93
  {
94
94
  name: "accessControlListRef",
95
95
  message: "IP Access Control List",
96
- choices: [{ name: "None", value: undefined }, ...aclList],
96
+ choices: [{ name: "None", value: "" }, ...aclList],
97
97
  type: "list",
98
98
  default: peerFromDB.accessControlListRef
99
99
  },
100
100
  {
101
101
  name: "credentialsRef",
102
102
  message: "Credentials Name",
103
- choices: [{ name: "None", value: undefined }, ...credentialsList],
103
+ choices: [{ name: "None", value: "" }, ...credentialsList],
104
104
  type: "list",
105
105
  default: peerFromDB.credentialsRef
106
106
  },
@@ -143,17 +143,17 @@ class UpdatePeerCommand extends base_1.BaseCommand {
143
143
  this.warn("Aborted");
144
144
  }
145
145
  else {
146
- core_1.CliUx.ux.action.start(`Updating Peer ${answers.name}`);
146
+ core_1.ux.action.start(`Updating Peer ${answers.name}`);
147
147
  answers.maxContacts = answers.maxContacts
148
148
  ? parseInt(answers.maxContacts)
149
149
  : -1;
150
150
  const acl = await api.updatePeer(answers);
151
- await core_1.CliUx.ux.wait(1000);
152
- core_1.CliUx.ux.action.stop(acl.ref);
151
+ await (0, wait_1.wait)(1000);
152
+ core_1.ux.action.stop(acl.ref);
153
153
  }
154
154
  }
155
155
  catch (e) {
156
- throw new errors_1.CLIError(e.message);
156
+ throw new core_1.Errors.CLIError(e.message);
157
157
  }
158
158
  }
159
159
  }
@@ -163,11 +163,10 @@ UpdatePeerCommand.examples = [
163
163
  Updating Peer Asterisk Conf... 80181ca6-d4aa-4575-9375-8f72b07d5555
164
164
  `
165
165
  ];
166
- UpdatePeerCommand.args = [
167
- {
168
- name: "ref",
166
+ UpdatePeerCommand.args = {
167
+ ref: core_1.Args.string({
169
168
  required: true,
170
169
  description: "reference to an existing Peer"
171
- }
172
- ];
170
+ })
171
+ };
173
172
  exports.default = UpdatePeerCommand;
@@ -55,10 +55,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
55
55
  * limitations under the License.
56
56
  */
57
57
  /* eslint-disable require-jsdoc */
58
- const grpc = __importStar(require("@grpc/grpc-js"));
59
58
  const core_1 = require("@oclif/core");
59
+ const wait_1 = require("../../lib/wait");
60
+ const grpc = __importStar(require("@grpc/grpc-js"));
60
61
  const base_1 = require("../../base");
61
- const errors_1 = require("@oclif/core/lib/errors");
62
62
  const common_1 = require("@routr/common");
63
63
  const validators_1 = require("../../validators");
64
64
  const sdk_1 = __importDefault(require("@routr/sdk"));
@@ -216,22 +216,22 @@ class CreateTrunkCommand extends base_1.BaseCommand {
216
216
  this.warn("Aborted");
217
217
  }
218
218
  else {
219
- core_1.CliUx.ux.action.start(`Creating Trunk ${group1.name}`);
219
+ core_1.ux.action.start(`Creating Trunk ${group1.name}`);
220
220
  const api = new sdk_1.default.Trunks({ endpoint, insecure, cacert });
221
221
  const trunk = await api.createTrunk({
222
222
  ...group1,
223
223
  uris
224
224
  });
225
- await core_1.CliUx.ux.wait(1000);
226
- core_1.CliUx.ux.action.stop(trunk.ref);
225
+ await (0, wait_1.wait)(1000);
226
+ core_1.ux.action.stop(trunk.ref);
227
227
  }
228
228
  }
229
229
  catch (e) {
230
230
  if (e.code === grpc.status.ALREADY_EXISTS) {
231
- throw new errors_1.CLIError("This Trunk already exist");
231
+ throw new core_1.Errors.CLIError("This Trunk already exist");
232
232
  }
233
233
  else {
234
- throw new errors_1.CLIError(e.message);
234
+ throw new core_1.Errors.CLIError(e.message);
235
235
  }
236
236
  }
237
237
  }
@@ -26,7 +26,7 @@ const delete_1 = __importDefault(require("../../delete"));
26
26
  const sdk_1 = __importDefault(require("@routr/sdk"));
27
27
  class DeleteTrunkCommand extends delete_1.default {
28
28
  async run() {
29
- const { flags } = await this.parse(DeleteTrunkCommand);
29
+ const { flags } = await this.parse(delete_1.default);
30
30
  const { endpoint, insecure, cacert } = flags;
31
31
  await super.deleteResource(new sdk_1.default.Trunks({ endpoint, insecure, cacert }), "deleteTrunk");
32
32
  }
@@ -2,9 +2,7 @@ import { BaseCommand } from "../../base";
2
2
  export default class DescribeCommand extends BaseCommand {
3
3
  static description: string;
4
4
  static args: {
5
- name: string;
6
- required: boolean;
7
- description: string;
8
- }[];
5
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
9
7
  run(): Promise<void>;
10
8
  }
@@ -22,8 +22,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  * limitations under the License.
23
23
  */
24
24
  /* eslint-disable require-jsdoc */
25
+ const core_1 = require("@oclif/core");
25
26
  const base_1 = require("../../base");
26
- const errors_1 = require("@oclif/core/lib/errors");
27
27
  const prettyjson_1 = require("prettyjson");
28
28
  const sdk_1 = __importDefault(require("@routr/sdk"));
29
29
  const moment_1 = __importDefault(require("moment"));
@@ -70,16 +70,12 @@ class DescribeCommand extends base_1.BaseCommand {
70
70
  this.log((0, prettyjson_1.render)(jsonObj, { noColor: true }));
71
71
  }
72
72
  catch (e) {
73
- throw new errors_1.CLIError(e.message);
73
+ throw new core_1.Errors.CLIError(e.message);
74
74
  }
75
75
  }
76
76
  }
77
77
  DescribeCommand.description = "shows details for a Trunk";
78
- DescribeCommand.args = [
79
- {
80
- name: "ref",
81
- required: false,
82
- description: "reference to the Trunk"
83
- }
84
- ];
78
+ DescribeCommand.args = {
79
+ ref: core_1.Args.string({ required: false, description: "reference to the Trunk" })
80
+ };
85
81
  exports.default = DescribeCommand;
@@ -1,20 +1,18 @@
1
+ import { Interfaces } from "@oclif/core";
1
2
  import { BaseCommand } from "../../base";
2
- import { CommandError } from "@oclif/core/lib/interfaces";
3
3
  export default class GetTrunksCommand extends BaseCommand {
4
4
  static readonly description = "Shows a list of paginated Trunks or a single Trunk if ref is provided";
5
5
  static readonly examples: string[];
6
6
  static readonly flags: {
7
- size: import("@oclif/core/lib/interfaces").OptionFlag<number>;
8
- extended: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ size: Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
8
+ extended: Interfaces.BooleanFlag<boolean>;
9
9
  };
10
10
  static args: {
11
- name: string;
12
- required: boolean;
13
- description: string;
14
- }[];
11
+ ref: Interfaces.Arg<string, Record<string, unknown>>;
12
+ };
15
13
  run(): Promise<void>;
16
14
  catch(error: {
17
15
  code: number;
18
16
  message: string;
19
- } | CommandError): Promise<void>;
17
+ } | Interfaces.CommandError): Promise<void>;
20
18
  }
@@ -52,18 +52,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
52
52
  * limitations under the License.
53
53
  */
54
54
  /* eslint-disable require-jsdoc */
55
- const grpc = __importStar(require("@grpc/grpc-js"));
56
55
  const core_1 = require("@oclif/core");
56
+ const table_1 = require("../../lib/table");
57
+ const grpc = __importStar(require("@grpc/grpc-js"));
57
58
  const base_1 = require("../../base");
58
59
  const utils_1 = require("../../utils");
59
60
  const common_1 = require("@routr/common");
60
- const errors_1 = require("@oclif/core/lib/errors");
61
61
  class GetTrunksCommand extends base_1.BaseCommand {
62
62
  async run() {
63
63
  const { args, flags } = await this.parse(GetTrunksCommand);
64
64
  const showTable = (request) => {
65
65
  const { showHeader, data, self, flags } = request;
66
- core_1.CliUx.ux.table(data, {
66
+ (0, table_1.printTable)(data, {
67
67
  ref: {
68
68
  minWidth: 7,
69
69
  extended: true
@@ -95,9 +95,9 @@ class GetTrunksCommand extends base_1.BaseCommand {
95
95
  // To be handled globally
96
96
  if ("code" in error && error.code === grpc.status.NOT_FOUND) {
97
97
  const { args } = await this.parse(GetTrunksCommand);
98
- throw new errors_1.CLIError("the Trunk you are looking for does not exist: " + args.ref);
98
+ throw new core_1.Errors.CLIError("the Trunk you are looking for does not exist: " + args.ref);
99
99
  }
100
- throw new errors_1.CLIError(error.message);
100
+ throw new core_1.Errors.CLIError(error.message);
101
101
  }
102
102
  }
103
103
  GetTrunksCommand.description = "Shows a list of paginated Trunks or a single Trunk if ref is provided";
@@ -118,11 +118,10 @@ GetTrunksCommand.flags = {
118
118
  description: "extended output format"
119
119
  })
120
120
  };
121
- GetTrunksCommand.args = [
122
- {
123
- name: "ref",
121
+ GetTrunksCommand.args = {
122
+ ref: core_1.Args.string({
124
123
  required: false,
125
124
  description: "optional reference to a Trunk"
126
- }
127
- ];
125
+ })
126
+ };
128
127
  exports.default = GetTrunksCommand;
@@ -3,9 +3,7 @@ export default class UpdateCommand extends BaseCommand {
3
3
  static readonly description = "Updates an existing Trunk";
4
4
  static readonly examples: string[];
5
5
  static readonly args: {
6
- name: string;
7
- required: boolean;
8
- description: string;
9
- }[];
6
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
10
8
  run(): Promise<void>;
11
9
  }
@@ -23,8 +23,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  */
24
24
  /* eslint-disable require-jsdoc */
25
25
  const core_1 = require("@oclif/core");
26
+ const wait_1 = require("../../lib/wait");
26
27
  const base_1 = require("../../base");
27
- const errors_1 = require("@oclif/core/lib/errors");
28
28
  const common_1 = require("@routr/common");
29
29
  const validators_1 = require("../../validators");
30
30
  const sdk_1 = __importDefault(require("@routr/sdk"));
@@ -86,21 +86,21 @@ class UpdateCommand extends base_1.BaseCommand {
86
86
  message: "IP Access Control List",
87
87
  type: "list",
88
88
  default: trunkFromDB.accessControlListRef,
89
- choices: [{ name: "None", value: undefined }, ...aclChoices]
89
+ choices: [{ name: "None", value: "" }, ...aclChoices]
90
90
  },
91
91
  {
92
92
  name: "inboundCredentialsRef",
93
93
  message: "Inbound Credentials",
94
94
  type: "list",
95
95
  default: trunkFromDB.inboundCredentialsRef,
96
- choices: [{ name: "None", value: undefined }, ...credentialsChoice]
96
+ choices: [{ name: "None", value: "" }, ...credentialsChoice]
97
97
  },
98
98
  {
99
99
  name: "outboundCredentialsRef",
100
100
  message: "Outbound Credentials",
101
101
  type: "list",
102
102
  default: trunkFromDB.outboundCredentialsRef,
103
- choices: [{ name: "None", value: undefined }, ...credentialsChoice]
103
+ choices: [{ name: "None", value: "" }, ...credentialsChoice]
104
104
  },
105
105
  {
106
106
  name: "sendRegister",
@@ -190,18 +190,18 @@ class UpdateCommand extends base_1.BaseCommand {
190
190
  this.warn("Aborted");
191
191
  }
192
192
  else {
193
- core_1.CliUx.ux.action.start(`Updating Trunk ${group1.name}`);
193
+ core_1.ux.action.start(`Updating Trunk ${group1.name}`);
194
194
  const trunk = await api.updateTrunk({
195
195
  ref: trunkFromDB.ref,
196
196
  ...group1,
197
197
  uris
198
198
  });
199
- await core_1.CliUx.ux.wait(1000);
200
- core_1.CliUx.ux.action.stop(trunk.ref);
199
+ await (0, wait_1.wait)(1000);
200
+ core_1.ux.action.stop(trunk.ref);
201
201
  }
202
202
  }
203
203
  catch (e) {
204
- throw new errors_1.CLIError(e.message);
204
+ throw new core_1.Errors.CLIError(e.message);
205
205
  }
206
206
  }
207
207
  }
@@ -211,11 +211,10 @@ UpdateCommand.examples = [
211
211
  Updating Trunk T01... 80181ca6-d4aa-4575-9375-8f72b07d5555
212
212
  `
213
213
  ];
214
- UpdateCommand.args = [
215
- {
216
- name: "ref",
214
+ UpdateCommand.args = {
215
+ ref: core_1.Args.string({
217
216
  required: true,
218
217
  description: "reference to an existing Trunk"
219
- }
220
- ];
218
+ })
219
+ };
221
220
  exports.default = UpdateCommand;
package/dist/delete.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BaseCommand } from "./base";
2
2
  export default abstract class DeleteCommand extends BaseCommand {
3
3
  static readonly args: {
4
- name: string;
5
- }[];
4
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
6
  deleteResource(API: any, funcName: string): Promise<void>;
7
7
  catch(err: Error): Promise<any>;
8
8
  finally(err: Error): Promise<any>;
package/dist/delete.js CHANGED
@@ -21,23 +21,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  /* eslint-disable require-jsdoc */
22
22
  const core_1 = require("@oclif/core");
23
23
  const base_1 = require("./base");
24
- const errors_1 = require("@oclif/core/lib/errors");
24
+ const wait_1 = require("./lib/wait");
25
25
  class DeleteCommand extends base_1.BaseCommand {
26
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
27
  async deleteResource(API, funcName) {
28
28
  const { args } = await this.parse(DeleteCommand);
29
29
  if (!args.ref) {
30
- core_1.CliUx.ux.action.stop();
31
- throw new errors_1.CLIError("You must provide a resource ref before continuing");
30
+ core_1.ux.action.stop();
31
+ throw new core_1.Errors.CLIError("You must provide a resource ref before continuing");
32
32
  }
33
- core_1.CliUx.ux.action.start(`Deleting item ${args.ref}`);
33
+ core_1.ux.action.start(`Deleting item ${args.ref}`);
34
34
  try {
35
35
  await API[funcName](args.ref);
36
- await core_1.CliUx.ux.wait(1000);
37
- core_1.CliUx.ux.action.stop("Done");
36
+ await (0, wait_1.wait)(1000);
37
+ core_1.ux.action.stop("Done");
38
38
  }
39
39
  catch (e) {
40
- throw new errors_1.CLIError(e.message);
40
+ throw new core_1.Errors.CLIError(e.message);
41
41
  }
42
42
  }
43
43
  async catch(err) {
@@ -47,5 +47,7 @@ class DeleteCommand extends base_1.BaseCommand {
47
47
  return super.finally(err);
48
48
  }
49
49
  }
50
- DeleteCommand.args = [{ name: "ref" }];
50
+ DeleteCommand.args = {
51
+ ref: core_1.Args.string({ required: false })
52
+ };
51
53
  exports.default = DeleteCommand;
package/dist/help.js CHANGED
@@ -82,7 +82,8 @@ class MyHelpClass extends core_1.Help {
82
82
  .filter((c) => c.id)
83
83
  .sort((a, b) => (a.id.includes(":") ? 1 : b.id.includes(":") ? -1 : 0))
84
84
  .map((c) => {
85
- const { description } = c;
85
+ var _a;
86
+ const description = (_a = c.description) !== null && _a !== void 0 ? _a : "";
86
87
  return {
87
88
  ...c,
88
89
  description: removeLastDot(lowercaseFirstLetter(description))
@@ -0,0 +1,15 @@
1
+ export type TableRow = Record<string, any>;
2
+ export interface TableColumn {
3
+ header?: string;
4
+ minWidth?: number;
5
+ extended?: boolean;
6
+ get?: (row: TableRow) => unknown;
7
+ }
8
+ export type TableColumns = Record<string, TableColumn>;
9
+ export interface TableOptions {
10
+ "no-header"?: boolean;
11
+ extended?: boolean;
12
+ printLine?: (line: string) => void;
13
+ [key: string]: unknown;
14
+ }
15
+ export declare function printTable(data: TableRow[], columns: TableColumns, options?: TableOptions): void;