@fonoster/ctl 0.7.56 → 0.8.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.
- package/README.md +1268 -2
- package/dist/commands/applications/create.js +28 -1
- package/dist/commands/applications/update.js +32 -4
- package/package.json +18 -5
|
@@ -123,7 +123,33 @@ class Create extends AuthenticatedCommand_1.AuthenticatedCommand {
|
|
|
123
123
|
{ name: "Azure", value: "tts.azure" }
|
|
124
124
|
]
|
|
125
125
|
}),
|
|
126
|
+
config: {}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const answersPartTwo = {
|
|
130
|
+
textToSpeech: {
|
|
126
131
|
config: {
|
|
132
|
+
model: answers.textToSpeech.productRef === "tts.elevenlabs"
|
|
133
|
+
? yield (0, prompts_1.select)({
|
|
134
|
+
message: "TTS Model",
|
|
135
|
+
choices: [
|
|
136
|
+
{
|
|
137
|
+
name: "Multilingual v2",
|
|
138
|
+
value: "eleven_multilingual_v2"
|
|
139
|
+
},
|
|
140
|
+
{ name: "Flash v2.5", value: "eleven_flash_v2_5" },
|
|
141
|
+
{ name: "Flash v2", value: "eleven_flash_v" },
|
|
142
|
+
{ name: "Turbo v2", value: "eleven_turbo_v2" },
|
|
143
|
+
{ name: "Turbo v2.5", value: "eleven_turbo_v2_5" },
|
|
144
|
+
{
|
|
145
|
+
name: "Multilingual Speech to Speech",
|
|
146
|
+
value: "eleven_multilingual_sts_v2"
|
|
147
|
+
}
|
|
148
|
+
// { name: "English Speech to Speech", value: "eleven_english_sts_v2" }
|
|
149
|
+
],
|
|
150
|
+
default: null
|
|
151
|
+
})
|
|
152
|
+
: null,
|
|
127
153
|
voice: yield (0, prompts_1.input)({
|
|
128
154
|
message: "TTS Voice",
|
|
129
155
|
required: true
|
|
@@ -134,10 +160,11 @@ class Create extends AuthenticatedCommand_1.AuthenticatedCommand {
|
|
|
134
160
|
message: "Ready?"
|
|
135
161
|
})
|
|
136
162
|
};
|
|
137
|
-
if (!
|
|
163
|
+
if (!answersPartTwo.confirm) {
|
|
138
164
|
this.log("Aborted!");
|
|
139
165
|
return;
|
|
140
166
|
}
|
|
167
|
+
answers.textToSpeech.config = Object.assign(Object.assign({}, answers.textToSpeech.config), answersPartTwo.textToSpeech.config);
|
|
141
168
|
try {
|
|
142
169
|
const client = yield this.createSdkClient();
|
|
143
170
|
const applications = new SDK.Applications(client);
|
|
@@ -72,8 +72,9 @@ const errorHandler_1 = __importDefault(require("../../errorHandler"));
|
|
|
72
72
|
class Update extends AuthenticatedCommand_1.AuthenticatedCommand {
|
|
73
73
|
run() {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
var _a, _b, _c, _d, _e;
|
|
75
|
+
var _a, _b, _c, _d, _e, _f;
|
|
76
76
|
const { args } = yield this.parse(Update);
|
|
77
|
+
const { ref } = args;
|
|
77
78
|
const client = yield this.createSdkClient();
|
|
78
79
|
const applications = new SDK.Applications(client);
|
|
79
80
|
const applicationFromDB = yield applications.getApplication(args.ref);
|
|
@@ -138,11 +139,37 @@ class Update extends AuthenticatedCommand_1.AuthenticatedCommand {
|
|
|
138
139
|
],
|
|
139
140
|
default: (_d = applicationFromDB.textToSpeech) === null || _d === void 0 ? void 0 : _d.productRef
|
|
140
141
|
}),
|
|
142
|
+
config: {}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const answersPartTwo = {
|
|
146
|
+
textToSpeech: {
|
|
141
147
|
config: {
|
|
148
|
+
model: answers.textToSpeech.productRef === "tts.elevenlabs"
|
|
149
|
+
? yield (0, prompts_1.select)({
|
|
150
|
+
message: "TTS Model",
|
|
151
|
+
choices: [
|
|
152
|
+
{
|
|
153
|
+
name: "Multilingual v2",
|
|
154
|
+
value: "eleven_multilingual_v2"
|
|
155
|
+
},
|
|
156
|
+
{ name: "Flash v2.5", value: "eleven_flash_v2_5" },
|
|
157
|
+
{ name: "Flash v2", value: "eleven_flash_v" },
|
|
158
|
+
{ name: "Turbo v2", value: "eleven_turbo_v2" },
|
|
159
|
+
{ name: "Turbo v2.5", value: "eleven_turbo_v2_5" },
|
|
160
|
+
{
|
|
161
|
+
name: "Multilingual Speech to Speech",
|
|
162
|
+
value: "eleven_multilingual_sts_v2"
|
|
163
|
+
}
|
|
164
|
+
// { name: "English Speech to Speech", value: "eleven_english_sts_v2" }
|
|
165
|
+
],
|
|
166
|
+
default: null
|
|
167
|
+
})
|
|
168
|
+
: null,
|
|
142
169
|
voice: yield (0, prompts_1.input)({
|
|
143
170
|
message: "TTS Voice",
|
|
144
171
|
required: true,
|
|
145
|
-
default: (_e = applicationFromDB.textToSpeech) === null || _e === void 0 ? void 0 : _e.config.voice
|
|
172
|
+
default: (_f = (_e = applicationFromDB.textToSpeech) === null || _e === void 0 ? void 0 : _e.config) === null || _f === void 0 ? void 0 : _f.voice
|
|
146
173
|
})
|
|
147
174
|
}
|
|
148
175
|
},
|
|
@@ -150,12 +177,13 @@ class Update extends AuthenticatedCommand_1.AuthenticatedCommand {
|
|
|
150
177
|
message: "Ready?"
|
|
151
178
|
})
|
|
152
179
|
};
|
|
153
|
-
if (!
|
|
180
|
+
if (!answersPartTwo.confirm) {
|
|
154
181
|
this.log("Aborted!");
|
|
155
182
|
return;
|
|
156
183
|
}
|
|
184
|
+
answers.textToSpeech.config = Object.assign(Object.assign({}, answers.textToSpeech.config), answersPartTwo.textToSpeech.config);
|
|
157
185
|
try {
|
|
158
|
-
yield applications.updateApplication(Object.assign({ ref
|
|
186
|
+
yield applications.updateApplication(Object.assign({ ref }, answers));
|
|
159
187
|
this.log("Done!");
|
|
160
188
|
}
|
|
161
189
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/ctl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Fonoster Control Tool",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"prebuild": "rimraf ./dist tsconfig.tsbuildinfo",
|
|
16
16
|
"build": "tsc -b tsconfig.json",
|
|
17
17
|
"clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo",
|
|
18
|
-
"
|
|
18
|
+
"postpack": "rimraf oclif.manifest.json",
|
|
19
|
+
"prepack": "oclif manifest && oclif readme",
|
|
20
|
+
"generate:readme": "oclif readme"
|
|
19
21
|
},
|
|
20
22
|
"files": [
|
|
21
23
|
"dist"
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"bugs": {
|
|
31
33
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
32
34
|
},
|
|
33
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "9d8a6fc044fe23f4f75356c142d1ca412db5af15",
|
|
34
36
|
"bin": {
|
|
35
37
|
"fonoster": "./bin/run.js"
|
|
36
38
|
},
|
|
@@ -39,15 +41,26 @@
|
|
|
39
41
|
"commands": "./dist/commands",
|
|
40
42
|
"dirname": "fonoster",
|
|
41
43
|
"topicSeparator": ":",
|
|
42
|
-
"helpClass": "./dist/help"
|
|
44
|
+
"helpClass": "./dist/help",
|
|
45
|
+
"plugins": [
|
|
46
|
+
"@oclif/plugin-warn-if-update-available"
|
|
47
|
+
],
|
|
48
|
+
"warn-if-update-available": {
|
|
49
|
+
"timeoutInDays": 7,
|
|
50
|
+
"message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>.",
|
|
51
|
+
"frequency": 1,
|
|
52
|
+
"frequencyUnit": "days"
|
|
53
|
+
}
|
|
43
54
|
},
|
|
44
55
|
"dependencies": {
|
|
45
|
-
"@fonoster/sdk": "^0.
|
|
56
|
+
"@fonoster/sdk": "^0.8.0",
|
|
46
57
|
"@inquirer/prompts": "^7.1.0",
|
|
47
58
|
"@oclif/core": "^4.0.34",
|
|
59
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.28",
|
|
48
60
|
"cliui": "^8.0.1",
|
|
49
61
|
"figlet": "^1.8.0",
|
|
50
62
|
"moment": "^2.30.1",
|
|
63
|
+
"oclif": "^4.17.3",
|
|
51
64
|
"phone": "^3.1.55",
|
|
52
65
|
"terminal-link": "^3.0.0",
|
|
53
66
|
"twilio": "^5.4.0",
|