@fonoster/ctl 0.7.40 → 0.7.42

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 (43) hide show
  1. package/dist/commands/applications/create.d.ts +6 -0
  2. package/dist/commands/applications/create.js +164 -0
  3. package/dist/commands/applications/delete.d.ts +9 -0
  4. package/dist/commands/applications/delete.js +99 -0
  5. package/dist/commands/applications/get.d.ts +9 -0
  6. package/dist/commands/applications/get.js +120 -0
  7. package/dist/commands/applications/list.d.ts +5 -2
  8. package/dist/commands/applications/list.js +18 -7
  9. package/dist/commands/applications/update.d.ts +9 -0
  10. package/dist/commands/applications/update.js +187 -0
  11. package/dist/commands/bug.js +1 -1
  12. package/dist/commands/feedback.js +1 -1
  13. package/dist/commands/numbers/get.d.ts +9 -0
  14. package/dist/commands/numbers/get.js +125 -0
  15. package/dist/commands/numbers/linkTwilioNumber.d.ts +10 -0
  16. package/dist/commands/numbers/linkTwilioNumber.js +155 -0
  17. package/dist/commands/numbers/list.d.ts +9 -0
  18. package/dist/commands/numbers/list.js +116 -0
  19. package/dist/commands/workspaces/login.js +1 -2
  20. package/dist/commands/workspaces/logout.js +1 -2
  21. package/dist/commands/workspaces/{set.d.ts → use.d.ts} +1 -1
  22. package/dist/commands/workspaces/{set.js → use.js} +6 -6
  23. package/dist/constants.d.ts +3 -0
  24. package/dist/constants.js +4 -1
  25. package/dist/utils/assignTwilioNumberToTrunk.d.ts +3 -0
  26. package/dist/utils/assignTwilioNumberToTrunk.js +33 -0
  27. package/dist/utils/createTwilioTrunk.d.ts +4 -0
  28. package/dist/utils/createTwilioTrunk.js +54 -0
  29. package/dist/utils/getFonosterNumberByTelUrl.d.ts +4 -0
  30. package/dist/utils/getFonosterNumberByTelUrl.js +76 -0
  31. package/dist/utils/getFonosterTrunkByInboundUri.d.ts +4 -0
  32. package/dist/utils/getFonosterTrunkByInboundUri.js +76 -0
  33. package/dist/utils/getTwilioNumber.d.ts +4 -0
  34. package/dist/utils/getTwilioNumber.js +23 -0
  35. package/dist/utils/getTwilioTrunk.d.ts +4 -0
  36. package/dist/utils/getTwilioTrunk.js +23 -0
  37. package/dist/utils/index.d.ts +8 -0
  38. package/dist/utils/index.js +42 -0
  39. package/dist/utils/linkTwilioNumberToApplication.d.ts +5 -0
  40. package/dist/utils/linkTwilioNumberToApplication.js +128 -0
  41. package/dist/utils/types.d.ts +14 -0
  42. package/dist/utils/types.js +2 -0
  43. package/package.json +7 -3
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from "../../BaseCommand";
2
+ export default class Create extends BaseCommand<typeof Create> {
3
+ static description: string;
4
+ static examples: string[];
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ /* eslint-disable import/no-unresolved */
46
+ /*
47
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
48
+ * http://github.com/fonoster/fonoster
49
+ *
50
+ * This file is part of Fonoster
51
+ *
52
+ * Licensed under the MIT License (the "License");
53
+ * you may not use this file except in compliance with
54
+ * the License. You may obtain a copy of the License at
55
+ *
56
+ * https://opensource.org/licenses/MIT
57
+ *
58
+ * Unless required by applicable law or agreed to in writing, software
59
+ * distributed under the License is distributed on an "AS IS" BASIS,
60
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
61
+ * See the License for the specific language governing permissions and
62
+ * limitations under the License.
63
+ */
64
+ const SDK = __importStar(require("@fonoster/sdk"));
65
+ const prompts_1 = require("@inquirer/prompts");
66
+ const BaseCommand_1 = require("../../BaseCommand");
67
+ const config_1 = require("../../config");
68
+ const constants_1 = require("../../constants");
69
+ class Create extends BaseCommand_1.BaseCommand {
70
+ run() {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const { flags } = yield this.parse(Create);
73
+ const workspaces = (0, config_1.getConfig)(constants_1.CONFIG_FILE);
74
+ const currentWorkspace = workspaces.find((w) => w.active);
75
+ if (!currentWorkspace) {
76
+ this.error("No active workspace found.");
77
+ }
78
+ this.log("This utility will help you create an Application.");
79
+ this.log("Press ^C at any time to quit.");
80
+ const answers = {
81
+ name: yield (0, prompts_1.input)({
82
+ message: "Name",
83
+ required: true
84
+ }),
85
+ type: yield (0, prompts_1.select)({
86
+ message: "Type",
87
+ choices: [{ name: "External", value: "External" }]
88
+ }),
89
+ endpoint: yield (0, prompts_1.input)({
90
+ message: "Endpoint",
91
+ required: true
92
+ }),
93
+ speechToText: {
94
+ productRef: yield (0, prompts_1.select)({
95
+ message: "SST Vendor",
96
+ choices: [{ name: "Deepgram", value: "stt.deepgram" }]
97
+ }),
98
+ config: {
99
+ languageCode: yield (0, prompts_1.select)({
100
+ message: "STT Language",
101
+ choices: [
102
+ { name: "English", value: "en-US" },
103
+ { name: "Spanish", value: "es-ES" }
104
+ ]
105
+ }),
106
+ model: yield (0, prompts_1.select)({
107
+ message: "STT Model",
108
+ choices: [
109
+ { name: "Nova 2", value: "nova-2" },
110
+ { name: "Nova 2 Phone Call", value: "nova-2-phonecall" },
111
+ {
112
+ name: "Nova 2 Conversational AI",
113
+ value: "nova-2-conversationalai"
114
+ }
115
+ ],
116
+ default: "nova-2"
117
+ })
118
+ }
119
+ },
120
+ textToSpeech: {
121
+ productRef: yield (0, prompts_1.select)({
122
+ message: "TTV Vendor",
123
+ choices: [
124
+ { name: "Deepgram", value: "tts.deepgram" },
125
+ { name: "ElevenLabs", value: "tts.elevenlabs" },
126
+ { name: "Google", value: "tts.google" },
127
+ { name: "Azure", value: "tts.azure" }
128
+ ]
129
+ }),
130
+ config: {
131
+ voice: yield (0, prompts_1.input)({
132
+ message: "TTS Voice",
133
+ required: true
134
+ })
135
+ }
136
+ },
137
+ confirm: yield (0, prompts_1.confirm)({
138
+ message: "Ready?"
139
+ })
140
+ };
141
+ if (!answers.confirm) {
142
+ this.log("Aborted!");
143
+ return;
144
+ }
145
+ try {
146
+ const client = new SDK.Client({
147
+ endpoint: currentWorkspace.endpoint,
148
+ accessKeyId: `WO${currentWorkspace.workspaceRef.replaceAll("-", "")}`,
149
+ allowInsecure: flags.insecure
150
+ });
151
+ yield client.loginWithApiKey(currentWorkspace.accessKeyId, currentWorkspace.accessKeySecret);
152
+ const applications = new SDK.Applications(client);
153
+ yield applications.createApplication(answers);
154
+ this.log("Done!");
155
+ }
156
+ catch (e) {
157
+ this.error(e);
158
+ }
159
+ });
160
+ }
161
+ }
162
+ Create.description = "create a new Application";
163
+ Create.examples = ["<%= config.bin %> <%= command.id %>"];
164
+ exports.default = Create;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from "../../BaseCommand";
2
+ export default class Delete extends BaseCommand<typeof Delete> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ /* eslint-disable import/no-unresolved */
46
+ /*
47
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
48
+ * http://github.com/fonoster/fonoster
49
+ *
50
+ * This file is part of Fonoster
51
+ *
52
+ * Licensed under the MIT License (the "License");
53
+ * you may not use this file except in compliance with
54
+ * the License. You may obtain a copy of the License at
55
+ *
56
+ * https://opensource.org/licenses/MIT
57
+ *
58
+ * Unless required by applicable law or agreed to in writing, software
59
+ * distributed under the License is distributed on an "AS IS" BASIS,
60
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
61
+ * See the License for the specific language governing permissions and
62
+ * limitations under the License.
63
+ */
64
+ const SDK = __importStar(require("@fonoster/sdk"));
65
+ const core_1 = require("@oclif/core");
66
+ const BaseCommand_1 = require("../../BaseCommand");
67
+ const config_1 = require("../../config");
68
+ const constants_1 = require("../../constants");
69
+ class Delete extends BaseCommand_1.BaseCommand {
70
+ run() {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const { args, flags } = yield this.parse(Delete);
73
+ const workspaces = (0, config_1.getConfig)(constants_1.CONFIG_FILE);
74
+ const currentWorkspace = workspaces.find((w) => w.active);
75
+ if (!currentWorkspace) {
76
+ this.error("No active workspace found.");
77
+ }
78
+ if (!args.ref) {
79
+ this.error("Missing Application reference");
80
+ return;
81
+ }
82
+ const client = new SDK.Client({
83
+ endpoint: currentWorkspace.endpoint,
84
+ accessKeyId: `WO${currentWorkspace.workspaceRef.replaceAll("-", "")}`,
85
+ allowInsecure: flags.insecure
86
+ });
87
+ yield client.loginWithApiKey(currentWorkspace.accessKeyId, currentWorkspace.accessKeySecret);
88
+ const applications = new SDK.Applications(client);
89
+ yield applications.deleteApplication(args.ref);
90
+ this.log("Done!");
91
+ });
92
+ }
93
+ }
94
+ Delete.description = "remove an Application from the system";
95
+ Delete.examples = ["<%= config.bin %> <%= command.id %>"];
96
+ Delete.args = {
97
+ ref: core_1.Args.string({ description: "the Application to delete" })
98
+ };
99
+ exports.default = Delete;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from "../../BaseCommand";
2
+ export default class Get extends BaseCommand<typeof Get> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ /* eslint-disable import/no-unresolved */
49
+ /*
50
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
51
+ * http://github.com/fonoster/fonoster
52
+ *
53
+ * This file is part of Fonoster
54
+ *
55
+ * Licensed under the MIT License (the "License");
56
+ * you may not use this file except in compliance with
57
+ * the License. You may obtain a copy of the License at
58
+ *
59
+ * https://opensource.org/licenses/MIT
60
+ *
61
+ * Unless required by applicable law or agreed to in writing, software
62
+ * distributed under the License is distributed on an "AS IS" BASIS,
63
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64
+ * See the License for the specific language governing permissions and
65
+ * limitations under the License.
66
+ */
67
+ const SDK = __importStar(require("@fonoster/sdk"));
68
+ const core_1 = require("@oclif/core");
69
+ const cliui_1 = __importDefault(require("cliui"));
70
+ const moment_1 = __importDefault(require("moment"));
71
+ const BaseCommand_1 = require("../../BaseCommand");
72
+ const config_1 = require("../../config");
73
+ const constants_1 = require("../../constants");
74
+ class Get extends BaseCommand_1.BaseCommand {
75
+ run() {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c, _d;
78
+ const { flags } = yield this.parse(Get);
79
+ const { args } = yield this.parse(Get);
80
+ const workspaces = (0, config_1.getConfig)(constants_1.CONFIG_FILE);
81
+ const currentWorkspace = workspaces.find((w) => w.active);
82
+ if (!currentWorkspace) {
83
+ this.error("No active workspace found.");
84
+ }
85
+ const client = new SDK.Client({
86
+ endpoint: currentWorkspace.endpoint,
87
+ accessKeyId: `WO${currentWorkspace.workspaceRef.replaceAll("-", "")}`,
88
+ allowInsecure: flags.insecure
89
+ });
90
+ yield client.loginWithApiKey(currentWorkspace.accessKeyId, currentWorkspace.accessKeySecret);
91
+ const applications = new SDK.Applications(client);
92
+ const response = yield applications.getApplication(args.ref);
93
+ const ui = (0, cliui_1.default)({ width: 200 });
94
+ // STT or none of productRef is undefined
95
+ const stt = ((_a = response.speechToText) === null || _a === void 0 ? void 0 : _a.productRef)
96
+ ? (_b = response.speechToText) === null || _b === void 0 ? void 0 : _b.productRef.replace("stt.", "")
97
+ : "none";
98
+ const tts = ((_c = response.textToSpeech) === null || _c === void 0 ? void 0 : _c.productRef)
99
+ ? (_d = response.textToSpeech) === null || _d === void 0 ? void 0 : _d.productRef.replace("tts.", "")
100
+ : "none";
101
+ ui.div("APPLICATION DETAILS\n" +
102
+ "------------------\n" +
103
+ `NAME: \t${response.name}\n` +
104
+ `REF: \t${response.ref}\n` +
105
+ `STT: \t${stt}\n` +
106
+ `TTS: \t${tts}\n` +
107
+ `TYPE: \t${response.type}\n` +
108
+ `ENDPOINT: \t${response.endpoint}\n` +
109
+ `CREATED: \t${(0, moment_1.default)(response.createdAt).format("YYYY-MM-DD HH:mm:ss")}\n` +
110
+ `UPDATED: \t${(0, moment_1.default)(response.updatedAt).format("YYYY-MM-DD HH:mm:ss")}`);
111
+ this.log(ui.toString());
112
+ });
113
+ }
114
+ }
115
+ Get.description = "get an Application by reference";
116
+ Get.examples = ["<%= config.bin %> <%= command.id %>"];
117
+ Get.args = {
118
+ ref: core_1.Args.string({ description: "The Application to show details about" })
119
+ };
120
+ exports.default = Get;
@@ -1,6 +1,9 @@
1
- import { Command } from "@oclif/core";
2
- export default class List extends Command {
1
+ import { BaseCommand } from "../../BaseCommand";
2
+ export default class List extends BaseCommand<typeof List> {
3
3
  static description: string;
4
4
  static examples: string[];
5
+ static flags: {
6
+ "page-size": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ };
5
8
  run(): Promise<void>;
6
9
  }
@@ -67,11 +67,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
67
67
  const SDK = __importStar(require("@fonoster/sdk"));
68
68
  const core_1 = require("@oclif/core");
69
69
  const cliui_1 = __importDefault(require("cliui"));
70
+ const BaseCommand_1 = require("../../BaseCommand");
70
71
  const config_1 = require("../../config");
71
72
  const constants_1 = require("../../constants");
72
- class List extends core_1.Command {
73
+ class List extends BaseCommand_1.BaseCommand {
73
74
  run() {
74
75
  return __awaiter(this, void 0, void 0, function* () {
76
+ const { flags } = yield this.parse(List);
75
77
  const workspaces = (0, config_1.getConfig)(constants_1.CONFIG_FILE);
76
78
  const currentWorkspace = workspaces.find((w) => w.active);
77
79
  if (!currentWorkspace) {
@@ -79,18 +81,19 @@ class List extends core_1.Command {
79
81
  }
80
82
  const client = new SDK.Client({
81
83
  endpoint: currentWorkspace.endpoint,
82
- accessKeyId: currentWorkspace.workspaceRef
84
+ accessKeyId: `WO${currentWorkspace.workspaceRef.replaceAll("-", "")}`,
85
+ allowInsecure: flags.insecure
83
86
  });
84
87
  yield client.loginWithApiKey(currentWorkspace.accessKeyId, currentWorkspace.accessKeySecret);
85
88
  const applications = new SDK.Applications(client);
86
89
  const response = yield applications.listApplications({
87
- pageSize: 1000,
90
+ pageSize: parseInt(flags["page-size"]),
88
91
  pageToken: ""
89
92
  });
90
- const ui = (0, cliui_1.default)({ width: 120 });
91
- ui.div({ text: "REF", padding: [0, 0, 0, 0] }, { text: "NAME", padding: [0, 0, 0, 0] }, { text: "TYPE", padding: [0, 0, 0, 0] });
92
- response.items.forEach((workspace) => {
93
- ui.div({ text: workspace.ref, padding: [0, 0, 0, 0] }, { text: workspace.name, padding: [0, 0, 0, 0] }, { text: workspace.type, padding: [0, 0, 0, 0] });
93
+ const ui = (0, cliui_1.default)({ width: 170 });
94
+ ui.div({ text: "REF", padding: [0, 0, 0, 0], width: 40 }, { text: "NAME", padding: [0, 0, 0, 0], width: 30 }, { text: "TYPE", padding: [0, 0, 0, 0], width: 10 }, { text: "ENDPOINT", padding: [0, 0, 0, 0] });
95
+ response.items.forEach((application) => {
96
+ ui.div({ text: application.ref, padding: [0, 0, 0, 0], width: 40 }, { text: application.name, padding: [0, 0, 0, 0], width: 30 }, { text: application.type, padding: [0, 0, 0, 0], width: 10 }, { text: application.endpoint, padding: [0, 0, 0, 0] });
94
97
  });
95
98
  this.log(ui.toString());
96
99
  });
@@ -98,4 +101,12 @@ class List extends core_1.Command {
98
101
  }
99
102
  List.description = "list all existing Applications";
100
103
  List.examples = ["<%= config.bin %> <%= command.id %>"];
104
+ List.flags = {
105
+ "page-size": core_1.Flags.string({
106
+ char: "s",
107
+ description: "the number of items to show",
108
+ default: "1000",
109
+ required: false
110
+ })
111
+ };
101
112
  exports.default = List;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from "../../BaseCommand";
2
+ export default class Update extends BaseCommand<typeof Update> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ run(): Promise<void>;
9
+ }