@stellartech/voice-widget-directus 1.0.1 → 1.0.2
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/dist/index.js +4 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -461,14 +461,13 @@ function useVoicingApi(api) {
|
|
|
461
461
|
try {
|
|
462
462
|
const response = await api.get(`/items/${collection}`, {
|
|
463
463
|
params: {
|
|
464
|
-
filter: { status: { _eq: "published" } },
|
|
465
464
|
sort: ["sort", "name"],
|
|
466
|
-
fields: ["
|
|
465
|
+
fields: ["*"]
|
|
467
466
|
}
|
|
468
467
|
});
|
|
469
468
|
return response.data.data || [];
|
|
470
469
|
} catch (error) {
|
|
471
|
-
console.error("Failed to fetch voices:", error);
|
|
470
|
+
console.error("Failed to fetch voices:", error?.response?.data || error?.message || error);
|
|
472
471
|
return [];
|
|
473
472
|
}
|
|
474
473
|
}
|
|
@@ -486,7 +485,6 @@ function useVoicingApi(api) {
|
|
|
486
485
|
try {
|
|
487
486
|
const response = await api.get(`/items/${collection}`, {
|
|
488
487
|
params: {
|
|
489
|
-
filter: { status: { _eq: "published" } },
|
|
490
488
|
sort: ["sort", "name"],
|
|
491
489
|
fields: ["id", "name", "prompt", "sort", "is_custom"]
|
|
492
490
|
}
|
|
@@ -502,19 +500,13 @@ function useVoicingApi(api) {
|
|
|
502
500
|
return tones;
|
|
503
501
|
} catch (error) {
|
|
504
502
|
console.error("Failed to fetch tones:", error);
|
|
505
|
-
return [
|
|
506
|
-
{ id: "teacher", name: "Teacher", prompt: "Speak in a clear, educational, and patient manner", sort: 1, is_custom: false },
|
|
507
|
-
{ id: "storyteller", name: "Storyteller", prompt: "Speak in an engaging, narrative style with varied pacing", sort: 2, is_custom: false },
|
|
508
|
-
{ id: "podcaster", name: "Podcaster", prompt: "Speak in a conversational, informal yet professional tone", sort: 3, is_custom: false },
|
|
509
|
-
{ id: "other", name: "Other (Custom)", prompt: "", sort: 9999, is_custom: true }
|
|
510
|
-
];
|
|
503
|
+
return [];
|
|
511
504
|
}
|
|
512
505
|
}
|
|
513
506
|
async function fetchStyles(collection = "VoiceStyles") {
|
|
514
507
|
try {
|
|
515
508
|
const response = await api.get(`/items/${collection}`, {
|
|
516
509
|
params: {
|
|
517
|
-
filter: { status: { _eq: "published" } },
|
|
518
510
|
sort: ["sort", "name"],
|
|
519
511
|
fields: ["id", "name", "prompt", "sort", "is_custom"]
|
|
520
512
|
}
|
|
@@ -530,12 +522,7 @@ function useVoicingApi(api) {
|
|
|
530
522
|
return styles;
|
|
531
523
|
} catch (error) {
|
|
532
524
|
console.error("Failed to fetch styles:", error);
|
|
533
|
-
return [
|
|
534
|
-
{ id: "happy", name: "Happy", prompt: "enthusiastic and cheerful", sort: 1, is_custom: false },
|
|
535
|
-
{ id: "chill", name: "Chill", prompt: "relaxed and calm", sort: 2, is_custom: false },
|
|
536
|
-
{ id: "excited", name: "Excited", prompt: "energetic and animated", sort: 3, is_custom: false },
|
|
537
|
-
{ id: "other", name: "Other (Custom)", prompt: "", sort: 9999, is_custom: true }
|
|
538
|
-
];
|
|
525
|
+
return [];
|
|
539
526
|
}
|
|
540
527
|
}
|
|
541
528
|
async function generateVoiceSample(voiceId, provider, flowId = DEFAULT_FLOW_ID) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stellartech/voice-widget-directus",
|
|
3
3
|
"description": "Voice generation widget with model/voice selection and audio preview for Directus",
|
|
4
4
|
"icon": "mic",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.2",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"readme": "README.md",
|
|
8
8
|
"repository": {
|