@neosapience/n8n-nodes-typecast 1.2.6 → 1.3.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.
@@ -156,12 +156,10 @@ export class Typecast implements INodeType {
156
156
  ? voice.age.replace(/_/g, ' ').replace(/\b\w/g, (c: string) => c.toUpperCase())
157
157
  : 'Unknown';
158
158
 
159
- // Get supported emotions from models array (prefer ssfm-v30)
159
+ // Display only emotions supported by the selected model.
160
160
  let emotions: string[] = [];
161
161
  if (voice.models && Array.isArray(voice.models)) {
162
- // Try to find ssfm-v30 first, then fall back to first model
163
- const v30Model = voice.models.find((m: IDataObject) => m.version === 'ssfm-v30');
164
- const modelToUse = v30Model || voice.models[0];
162
+ const modelToUse = voice.models.find((m: IDataObject) => m.version === model);
165
163
  if (modelToUse && Array.isArray(modelToUse.emotions)) {
166
164
  emotions = modelToUse.emotions as string[];
167
165
  }
@@ -469,8 +467,8 @@ export class Typecast implements INodeType {
469
467
  // Build prompt object based on model and emotion type
470
468
  const prompt: IDataObject = {};
471
469
 
472
- if (model === 'ssfm-v30') {
473
- // Get emotion type for ssfm-v30
470
+ if (model === 'ssfm-v30' || model === 'ssfm-v31') {
471
+ // Get emotion type for SSFM 3.x
474
472
  const emotionType = this.getNodeParameter('emotionType', i, 'preset') as string;
475
473
 
476
474
  if (emotionType === 'smart') {
@@ -605,7 +603,7 @@ export class Typecast implements INodeType {
605
603
 
606
604
  // Build prompt (mirrors textToSpeech)
607
605
  const prompt: IDataObject = {};
608
- if (model === 'ssfm-v30') {
606
+ if (model === 'ssfm-v30' || model === 'ssfm-v31') {
609
607
  const emotionType = this.getNodeParameter('emotionType', i, 'preset') as string;
610
608
  if (emotionType === 'smart') {
611
609
  prompt.emotion_type = 'smart';
@@ -733,7 +731,7 @@ export class Typecast implements INodeType {
733
731
 
734
732
  // Build prompt (mirrors textToSpeech)
735
733
  const prompt: IDataObject = {};
736
- if (model === 'ssfm-v30') {
734
+ if (model === 'ssfm-v30' || model === 'ssfm-v31') {
737
735
  const emotionType = this.getNodeParameter('emotionType', i, 'preset') as string;
738
736
  if (emotionType === 'smart') {
739
737
  prompt.emotion_type = 'smart';
@@ -44,6 +44,9 @@ export const speechDescription: INodeProperties[] = [
44
44
  displayName: 'Voice ID',
45
45
  name: 'voiceId',
46
46
  type: 'resourceLocator',
47
+ typeOptions: {
48
+ loadOptionsDependsOn: ['model'],
49
+ },
47
50
  required: true,
48
51
  displayOptions: {
49
52
  show: {
@@ -54,7 +57,7 @@ export const speechDescription: INodeProperties[] = [
54
57
  default: { mode: 'list', value: '' },
55
58
 
56
59
  description:
57
- 'Select a voice from the list or enter a Voice ID directly. For quick-cloned voices, switch to By ID and use the Clone Voice output voice_id (uc_...).',
60
+ 'Select a voice from the list or enter a Voice ID directly. Choose Model first: changing it resets Voice ID, including By ID values and expressions. For quick-cloned voices, switch to By ID and use the Clone Voice output voice_id (uc_...).',
58
61
  modes: [
59
62
  {
60
63
  displayName: 'From List',
@@ -115,10 +118,14 @@ export const speechDescription: INodeProperties[] = [
115
118
  },
116
119
  options: [
117
120
  {
118
- name: 'SSFM-V30 (Latest)',
121
+ name: 'SSFM-V31',
122
+ value: 'ssfm-v31',
123
+ description: 'SSFM 3.1; select a compatible voice and supported emotions',
124
+ },
125
+ {
126
+ name: 'SSFM-V30',
119
127
  value: 'ssfm-v30',
120
- description:
121
- 'Latest model with improved prosody, Smart Emotion, and 37 language support (recommended)',
128
+ description: 'SSFM 3.0 with Smart Emotion; select a compatible voice',
122
129
  },
123
130
  {
124
131
  name: 'SSFM-V21',
@@ -128,7 +135,7 @@ export const speechDescription: INodeProperties[] = [
128
135
  ],
129
136
  default: 'ssfm-v30',
130
137
  description:
131
- 'Voice model to use for speech synthesis. ssfm-v30 is recommended for best quality and Smart Emotion features. For quick-cloned voices, use the same model returned by Clone Voice.',
138
+ 'Voice model to use for speech synthesis. Select a compatible voice for ssfm-v31 or ssfm-v30 Smart Emotion features. For quick-cloned voices, use the same model returned by Clone Voice.',
132
139
  },
133
140
  {
134
141
  displayName: 'Emotion Type',
@@ -138,7 +145,7 @@ export const speechDescription: INodeProperties[] = [
138
145
  show: {
139
146
  resource: ['speech'],
140
147
  operation: ['textToSpeech', 'textToSpeechStream', 'textToSpeechWithTimestamps'],
141
- model: ['ssfm-v30'],
148
+ model: ['ssfm-v30', 'ssfm-v31'],
142
149
  },
143
150
  },
144
151
  options: [
@@ -156,7 +163,7 @@ export const speechDescription: INodeProperties[] = [
156
163
  ],
157
164
  default: 'smart',
158
165
  description:
159
- 'How to control emotional expression (ssfm-v30 only) Smart: AI detects emotion automatically from context. Preset: Manual selection with 7 emotion options.',
166
+ 'How to control emotional expression (ssfm-v30/ssfm-v31) Smart: AI detects emotion automatically from context. Preset: Select an emotion supported by the voice and model.',
160
167
  },
161
168
  {
162
169
  displayName: 'Previous Text',
@@ -166,7 +173,7 @@ export const speechDescription: INodeProperties[] = [
166
173
  show: {
167
174
  resource: ['speech'],
168
175
  operation: ['textToSpeech', 'textToSpeechStream', 'textToSpeechWithTimestamps'],
169
- model: ['ssfm-v30'],
176
+ model: ['ssfm-v30', 'ssfm-v31'],
170
177
  emotionType: ['smart'],
171
178
  },
172
179
  },
@@ -186,7 +193,7 @@ export const speechDescription: INodeProperties[] = [
186
193
  show: {
187
194
  resource: ['speech'],
188
195
  operation: ['textToSpeech', 'textToSpeechStream', 'textToSpeechWithTimestamps'],
189
- model: ['ssfm-v30'],
196
+ model: ['ssfm-v30', 'ssfm-v31'],
190
197
  emotionType: ['smart'],
191
198
  },
192
199
  },
@@ -206,7 +213,7 @@ export const speechDescription: INodeProperties[] = [
206
213
  show: {
207
214
  resource: ['speech'],
208
215
  operation: ['textToSpeech', 'textToSpeechStream', 'textToSpeechWithTimestamps'],
209
- model: ['ssfm-v30'],
216
+ model: ['ssfm-v30', 'ssfm-v31'],
210
217
  emotionType: ['preset'],
211
218
  },
212
219
  },
@@ -259,7 +266,7 @@ export const speechDescription: INodeProperties[] = [
259
266
  show: {
260
267
  resource: ['speech'],
261
268
  operation: ['textToSpeech', 'textToSpeechStream', 'textToSpeechWithTimestamps'],
262
- model: ['ssfm-v30'],
269
+ model: ['ssfm-v30', 'ssfm-v31'],
263
270
  emotionType: ['preset'],
264
271
  },
265
272
  },
@@ -208,7 +208,12 @@ export const voiceDescription: INodeProperties[] = [
208
208
  description: 'List all available voices for all models',
209
209
  },
210
210
  {
211
- name: 'SSFM-V30 (Latest)',
211
+ name: 'SSFM-V31',
212
+ value: 'ssfm-v31',
213
+ description: 'List voices compatible with SSFM 3.1',
214
+ },
215
+ {
216
+ name: 'SSFM-V30',
212
217
  value: 'ssfm-v30',
213
218
  description: 'Latest model with improved prosody and additional emotion presets',
214
219
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neosapience/n8n-nodes-typecast",
3
- "version": "1.2.6",
3
+ "version": "1.3.0",
4
4
  "description": "n8n node for Typecast TTS API integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",