@fonoster/ctl 0.7.43 → 0.7.44
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/bin/run.js +21 -3
- package/package.json +6 -7
- package/dist/BaseCommand.d.ts +0 -15
- package/dist/BaseCommand.js +0 -80
- package/dist/Help.d.ts +0 -6
- package/dist/Help.js +0 -52
- package/dist/commands/applications/create.d.ts +0 -6
- package/dist/commands/applications/create.js +0 -164
- package/dist/commands/applications/delete.d.ts +0 -9
- package/dist/commands/applications/delete.js +0 -99
- package/dist/commands/applications/get.d.ts +0 -9
- package/dist/commands/applications/get.js +0 -120
- package/dist/commands/applications/list.d.ts +0 -9
- package/dist/commands/applications/list.js +0 -112
- package/dist/commands/applications/update.d.ts +0 -9
- package/dist/commands/applications/update.js +0 -187
- package/dist/commands/bug.d.ts +0 -6
- package/dist/commands/bug.js +0 -42
- package/dist/commands/feedback.d.ts +0 -6
- package/dist/commands/feedback.js +0 -45
- package/dist/commands/numbers/get.d.ts +0 -9
- package/dist/commands/numbers/get.js +0 -125
- package/dist/commands/numbers/linkTwilioNumber.d.ts +0 -10
- package/dist/commands/numbers/linkTwilioNumber.js +0 -155
- package/dist/commands/numbers/list.d.ts +0 -9
- package/dist/commands/numbers/list.js +0 -116
- package/dist/commands/workspaces/current.d.ts +0 -6
- package/dist/commands/workspaces/current.js +0 -46
- package/dist/commands/workspaces/list.d.ts +0 -6
- package/dist/commands/workspaces/list.js +0 -53
- package/dist/commands/workspaces/login.d.ts +0 -8
- package/dist/commands/workspaces/login.js +0 -145
- package/dist/commands/workspaces/logout.d.ts +0 -9
- package/dist/commands/workspaces/logout.js +0 -54
- package/dist/commands/workspaces/use.d.ts +0 -9
- package/dist/commands/workspaces/use.js +0 -57
- package/dist/config/addWorkspace.d.ts +0 -3
- package/dist/config/addWorkspace.js +0 -15
- package/dist/config/getConfig.d.ts +0 -3
- package/dist/config/getConfig.js +0 -34
- package/dist/config/getCurrentWorkspace.d.ts +0 -3
- package/dist/config/getCurrentWorkspace.js +0 -10
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -41
- package/dist/config/removeWorkspace.d.ts +0 -3
- package/dist/config/removeWorkspace.js +0 -6
- package/dist/config/saveConfig.d.ts +0 -3
- package/dist/config/saveConfig.js +0 -32
- package/dist/config/setCurrentWorkspace.d.ts +0 -3
- package/dist/config/setCurrentWorkspace.js +0 -11
- package/dist/config/types.d.ts +0 -4
- package/dist/config/types.js +0 -2
- package/dist/config/validations.d.ts +0 -27
- package/dist/config/validations.js +0 -34
- package/dist/constants.d.ts +0 -6
- package/dist/constants.js +0 -29
- package/dist/utils/assignTwilioNumberToTrunk.d.ts +0 -3
- package/dist/utils/assignTwilioNumberToTrunk.js +0 -33
- package/dist/utils/createTwilioTrunk.d.ts +0 -4
- package/dist/utils/createTwilioTrunk.js +0 -54
- package/dist/utils/getFonosterNumberByTelUrl.d.ts +0 -4
- package/dist/utils/getFonosterNumberByTelUrl.js +0 -76
- package/dist/utils/getFonosterTrunkByInboundUri.d.ts +0 -4
- package/dist/utils/getFonosterTrunkByInboundUri.js +0 -76
- package/dist/utils/getTwilioNumber.d.ts +0 -4
- package/dist/utils/getTwilioNumber.js +0 -23
- package/dist/utils/getTwilioTrunk.d.ts +0 -4
- package/dist/utils/getTwilioTrunk.js +0 -23
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.js +0 -42
- package/dist/utils/linkTwilioNumberToApplication.d.ts +0 -5
- package/dist/utils/linkTwilioNumberToApplication.js +0 -128
- package/dist/utils/types.d.ts +0 -14
- package/dist/utils/types.js +0 -2
package/bin/run.js
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
#!/usr/bin/env node
|
|
2
20
|
|
|
3
21
|
// eslint-disable-next-line unicorn/prefer-top-level-await
|
|
4
22
|
(async () => {
|
|
5
|
-
const oclif = await import(
|
|
6
|
-
await oclif.execute({dir: __dirname})
|
|
7
|
-
})()
|
|
23
|
+
const oclif = await import("@oclif/core")
|
|
24
|
+
await oclif.execute({ dir: __dirname });
|
|
25
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/ctl",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.44",
|
|
4
4
|
"description": "Fonoster Control Tool",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "020f1c745ce93acc27bbc1b8c9c0bdce1012cac4",
|
|
34
34
|
"bin": {
|
|
35
35
|
"fonoster": "./bin/run.js"
|
|
36
36
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"helpClass": "./dist/help"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@fonoster/sdk": "^0.7.
|
|
45
|
+
"@fonoster/sdk": "^0.7.44",
|
|
46
46
|
"@inquirer/prompts": "^7.1.0",
|
|
47
47
|
"@oclif/core": "^4.0.34",
|
|
48
48
|
"cliui": "^8.0.1",
|
|
@@ -50,13 +50,12 @@
|
|
|
50
50
|
"moment": "^2.30.1",
|
|
51
51
|
"phone": "^3.1.55",
|
|
52
52
|
"terminal-link": "^3.0.0",
|
|
53
|
-
"twilio": "^5.
|
|
54
|
-
"zod": "^3.
|
|
53
|
+
"twilio": "^5.4.0",
|
|
54
|
+
"zod": "^3.24.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@oclif/test": "^4.1.3",
|
|
58
58
|
"@types/figlet": "^1.7.0",
|
|
59
|
-
"@types/node": "22.10.1"
|
|
60
|
-
"ts-node": "^10.9.2"
|
|
59
|
+
"@types/node": "22.10.1"
|
|
61
60
|
}
|
|
62
61
|
}
|
package/dist/BaseCommand.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command, Interfaces } from "@oclif/core";
|
|
2
|
-
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
|
|
3
|
-
export declare abstract class BaseCommand<T extends typeof Command> extends Command {
|
|
4
|
-
static baseFlags: {
|
|
5
|
-
insecure: Interfaces.BooleanFlag<boolean>;
|
|
6
|
-
};
|
|
7
|
-
protected flags: Flags<T>;
|
|
8
|
-
protected args: Args<T>;
|
|
9
|
-
init(): Promise<void>;
|
|
10
|
-
protected catch(err: Error & {
|
|
11
|
-
exitCode?: number;
|
|
12
|
-
}): Promise<any>;
|
|
13
|
-
protected finally(_: Error | undefined): Promise<any>;
|
|
14
|
-
}
|
|
15
|
-
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
|
package/dist/BaseCommand.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.BaseCommand = void 0;
|
|
13
|
-
/* eslint-disable import/no-unresolved */
|
|
14
|
-
/*
|
|
15
|
-
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
16
|
-
* http://github.com/fonoster/fonoster
|
|
17
|
-
*
|
|
18
|
-
* This file is part of Fonoster
|
|
19
|
-
*
|
|
20
|
-
* Licensed under the MIT License (the "License");
|
|
21
|
-
* you may not use this file except in compliance with
|
|
22
|
-
* the License. You may obtain a copy of the License at
|
|
23
|
-
*
|
|
24
|
-
* https://opensource.org/licenses/MIT
|
|
25
|
-
*
|
|
26
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
-
* See the License for the specific language governing permissions and
|
|
30
|
-
* limitations under the License.
|
|
31
|
-
*/
|
|
32
|
-
const core_1 = require("@oclif/core");
|
|
33
|
-
class BaseCommand extends core_1.Command {
|
|
34
|
-
init() {
|
|
35
|
-
const _super = Object.create(null, {
|
|
36
|
-
init: { get: () => super.init },
|
|
37
|
-
ctor: { get: () => super.ctor }
|
|
38
|
-
});
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
yield _super.init.call(this);
|
|
41
|
-
const { args, flags } = yield this.parse({
|
|
42
|
-
flags: this.ctor.flags,
|
|
43
|
-
baseFlags: _super.ctor.baseFlags,
|
|
44
|
-
enableJsonFlag: this.ctor.enableJsonFlag,
|
|
45
|
-
args: this.ctor.args,
|
|
46
|
-
strict: this.ctor.strict
|
|
47
|
-
});
|
|
48
|
-
this.flags = flags;
|
|
49
|
-
this.args = args;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch(err) {
|
|
53
|
-
const _super = Object.create(null, {
|
|
54
|
-
catch: { get: () => super.catch }
|
|
55
|
-
});
|
|
56
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
// add any custom logic to handle errors from the command
|
|
58
|
-
// or simply return the parent class error handling
|
|
59
|
-
return _super.catch.call(this, err);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
finally(_) {
|
|
63
|
-
const _super = Object.create(null, {
|
|
64
|
-
finally: { get: () => super.finally }
|
|
65
|
-
});
|
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
// called after run and catch regardless of whether or not the command errored
|
|
68
|
-
return _super.finally.call(this, _);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.BaseCommand = BaseCommand;
|
|
73
|
-
// define flags that can be inherited by any command that extends BaseCommand
|
|
74
|
-
BaseCommand.baseFlags = {
|
|
75
|
-
insecure: core_1.Flags.boolean({
|
|
76
|
-
char: "i",
|
|
77
|
-
description: "allow connections to a server without TLS enabled",
|
|
78
|
-
default: false
|
|
79
|
-
})
|
|
80
|
-
};
|
package/dist/Help.d.ts
DELETED
package/dist/Help.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/*
|
|
7
|
-
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
8
|
-
* http://github.com/fonoster/fonoster
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Fonoster
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the MIT License (the "License");
|
|
13
|
-
* you may not use this file except in compliance with
|
|
14
|
-
* the License. You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* https://opensource.org/licenses/MIT
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line import/no-unresolved
|
|
25
|
-
const core_1 = require("@oclif/core");
|
|
26
|
-
const figlet_1 = __importDefault(require("figlet"));
|
|
27
|
-
class CustomHelp extends core_1.Help {
|
|
28
|
-
showRootHelp() {
|
|
29
|
-
this.showLogo();
|
|
30
|
-
this.log(this.formatRoot());
|
|
31
|
-
this.log("");
|
|
32
|
-
this.log(this.formatCommands(this.customCommands));
|
|
33
|
-
this.log("");
|
|
34
|
-
return Promise.resolve();
|
|
35
|
-
}
|
|
36
|
-
showLogo() {
|
|
37
|
-
this.log("\x1b[32m");
|
|
38
|
-
this.log(figlet_1.default.textSync("Fonoster", {
|
|
39
|
-
horizontalLayout: "default",
|
|
40
|
-
verticalLayout: "default",
|
|
41
|
-
width: 60,
|
|
42
|
-
whitespaceBreak: true
|
|
43
|
-
}));
|
|
44
|
-
this.log("\x1b[0m");
|
|
45
|
-
}
|
|
46
|
-
get customCommands() {
|
|
47
|
-
return this.sortedCommands
|
|
48
|
-
.filter((c) => c.id)
|
|
49
|
-
.sort((a, b) => (a.id.includes(":") ? 1 : b.id.includes(":") ? -1 : 0));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.default = CustomHelp;
|
|
@@ -1,164 +0,0 @@
|
|
|
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;
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
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;
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
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,9 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from "../../BaseCommand";
|
|
2
|
-
export default class List extends BaseCommand<typeof List> {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
"page-size": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
-
};
|
|
8
|
-
run(): Promise<void>;
|
|
9
|
-
}
|