n8n-nodes-paaalleeee 1.1.0 → 1.1.1

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.
@@ -2,6 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PalatineSpeechNode = void 0;
4
4
  const n8n_workflow_1 = require("n8n-workflow");
5
+ // Polling defaults (by task)
6
+ const TASK_POLL_DEFAULTS = {
7
+ transcribe: { pollIntervalMs: 500, maxPollAttempts: 200 },
8
+ diarize: { pollIntervalMs: 500, maxPollAttempts: 200 },
9
+ sentiment: { pollIntervalMs: 500, maxPollAttempts: 200 },
10
+ summarize: { pollIntervalMs: 20000, maxPollAttempts: 500 },
11
+ };
5
12
  class PalatineSpeechNode {
6
13
  description = {
7
14
  displayName: 'Palatine Speech',
@@ -33,9 +40,21 @@ class PalatineSpeechNode {
33
40
  type: 'options',
34
41
  options: [
35
42
  { name: 'Transcribe', value: 'transcribe', description: 'Convert speech in audio file to text' },
36
- { name: 'Diarize', value: 'diarize', description: 'Split audio by speakers and return timestamps for each segment' },
37
- { name: 'Sentiment Analysis', value: 'sentiment', description: 'Detect sentiment/emotion in audio and return scores' },
38
- { name: 'Summarize', value: 'summarize', description: 'Generate an AI summary of audio (notes, decisions, action items)' },
43
+ {
44
+ name: 'Diarize',
45
+ value: 'diarize',
46
+ description: 'Split audio by speakers and return timestamps for each segment',
47
+ },
48
+ {
49
+ name: 'Sentiment Analysis',
50
+ value: 'sentiment',
51
+ description: 'Detect sentiment/emotion in audio and return scores',
52
+ },
53
+ {
54
+ name: 'Summarize',
55
+ value: 'summarize',
56
+ description: 'Generate an AI summary of audio (notes, decisions, action items)',
57
+ },
39
58
  ],
40
59
  default: 'transcribe',
41
60
  description: 'Select what to do with audio file',
@@ -46,7 +65,11 @@ class PalatineSpeechNode {
46
65
  type: 'options',
47
66
  options: [
48
67
  { name: 'palatine_small', value: 'palatine_small', description: 'Model used for transcription processing' },
49
- { name: 'palatine_large_highspeed', value: 'palatine_large_highspeed', description: 'Model used for transcription processing' },
68
+ {
69
+ name: 'palatine_large_highspeed',
70
+ value: 'palatine_large_highspeed',
71
+ description: 'Model used for transcription processing',
72
+ },
50
73
  ],
51
74
  displayOptions: {
52
75
  show: {
@@ -64,8 +87,8 @@ class PalatineSpeechNode {
64
87
  minValue: 500,
65
88
  maxValue: 900000,
66
89
  },
67
- default: 1000,
68
- description: 'How often node polls API to retrieve result. Minimum 500 ms, maximum 900000 ms',
90
+ default: 500,
91
+ description: 'How often node polls API to retrieve result. Minimum 500 ms, maximum 900000 ms. (Summarize: if left unchanged, node uses 20000 ms by default)',
69
92
  },
70
93
  {
71
94
  displayName: 'Max Poll Attempts',
@@ -75,8 +98,8 @@ class PalatineSpeechNode {
75
98
  minValue: 1,
76
99
  maxValue: 1000,
77
100
  },
78
- default: 300,
79
- description: 'How many times node polls API before giving up. Minimum 1 attempt, maximum 1000 attempts',
101
+ default: 200,
102
+ description: 'How many times node polls API before giving up. Minimum 1 attempt, maximum 1000 attempts. (Summarize: if left unchanged, node uses 500 by default)',
80
103
  },
81
104
  // Summarize-only
82
105
  {
@@ -84,8 +107,16 @@ class PalatineSpeechNode {
84
107
  name: 'summarizeTask',
85
108
  type: 'options',
86
109
  options: [
87
- { name: 'Meeting Summary', value: 'meeting_summary', description: 'Ready-made meeting summary: key points, decisions, and action items' },
88
- { name: 'User Prompt', value: 'user_prompt', description: 'Use your own prompt to control summary format/content' },
110
+ {
111
+ name: 'Meeting Summary',
112
+ value: 'meeting_summary',
113
+ description: 'Ready-made meeting summary: key points, decisions, and action items',
114
+ },
115
+ {
116
+ name: 'User Prompt',
117
+ value: 'user_prompt',
118
+ description: 'Use your own prompt to control summary format/content',
119
+ },
89
120
  ],
90
121
  default: 'meeting_summary',
91
122
  description: 'Summarization mode',
@@ -117,11 +148,6 @@ class PalatineSpeechNode {
117
148
  async execute() {
118
149
  const items = this.getInputData();
119
150
  const returnData = [];
120
- // Polling
121
- const defaultPollIntervalMsFast = 500;
122
- const defaultMaxPollAttemptsFast = 200;
123
- const defaultPollIntervalMsSummarize = 20000;
124
- const defaultMaxPollAttemptsSummarize = 500;
125
151
  const credentials = await this.getCredentials('PalatineSpeechNodeApi');
126
152
  const baseUrl = String(credentials.baseUrl || '').replace(/\/$/, '');
127
153
  if (!baseUrl) {
@@ -182,10 +208,6 @@ class PalatineSpeechNode {
182
208
  let summarizeTask;
183
209
  let summarizeThinking = false;
184
210
  let summarizePromptRaw = '';
185
- const taskDefaultPollIntervalMs = task === 'summarize' ? defaultPollIntervalMsSummarize : defaultPollIntervalMsFast;
186
- const taskDefaultMaxPollAttempts = task === 'summarize' ? defaultMaxPollAttemptsSummarize : defaultMaxPollAttemptsFast;
187
- let pollIntervalMs = taskDefaultPollIntervalMs;
188
- let maxPollAttempts = taskDefaultMaxPollAttempts;
189
211
  if (task === 'summarize') {
190
212
  summarizeTask = this.getNodeParameter('summarizeTask', i);
191
213
  summarizeThinking = this.getNodeParameter('summarizeThinking', i);
@@ -193,9 +215,27 @@ class PalatineSpeechNode {
193
215
  summarizePromptRaw = this.getNodeParameter('summarizePrompt', i, '') || '';
194
216
  }
195
217
  }
196
- pollIntervalMs = this.getNodeParameter('pollIntervalMs', i, taskDefaultPollIntervalMs);
218
+ // Polling params from UI
219
+ let pollIntervalMs = this.getNodeParameter('pollIntervalMs', i);
220
+ let maxPollAttempts = this.getNodeParameter('maxPollAttempts', i);
221
+ // Task-specific defaults (also supports old saved defaults 1000/300)
222
+ const taskDefaults = TASK_POLL_DEFAULTS[task];
223
+ if (task === 'summarize') {
224
+ // if user left UI default (500/200) OR old defaults (1000/300) → use summarize defaults
225
+ if (pollIntervalMs === 500 || pollIntervalMs === 1000)
226
+ pollIntervalMs = taskDefaults.pollIntervalMs; // 20000
227
+ if (maxPollAttempts === 200 || maxPollAttempts === 300)
228
+ maxPollAttempts = taskDefaults.maxPollAttempts; // 500
229
+ }
230
+ else {
231
+ // if old flows have 1000/300 → switch to new non-summarize defaults
232
+ if (pollIntervalMs === 1000)
233
+ pollIntervalMs = taskDefaults.pollIntervalMs; // 500
234
+ if (maxPollAttempts === 300)
235
+ maxPollAttempts = taskDefaults.maxPollAttempts; // 200
236
+ }
237
+ // clamp
197
238
  pollIntervalMs = Math.min(900000, Math.max(500, pollIntervalMs));
198
- maxPollAttempts = this.getNodeParameter('maxPollAttempts', i, taskDefaultMaxPollAttempts);
199
239
  maxPollAttempts = Math.min(1000, Math.max(1, maxPollAttempts));
200
240
  const audioBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
201
241
  // Endpoints (polling API)
@@ -217,9 +257,7 @@ class PalatineSpeechNode {
217
257
  itemIndex: i,
218
258
  });
219
259
  }
220
- const promptToSend = summarizeTask === 'meeting_summary'
221
- ? '*'
222
- : (summarizePromptRaw || '').trim() || '*';
260
+ const promptToSend = summarizeTask === 'meeting_summary' ? '*' : (summarizePromptRaw || '').trim() || '*';
223
261
  url = `${baseUrl}/api/v1/ai_service/summarize_file`;
224
262
  qs = {
225
263
  task: summarizeTask,
@@ -316,7 +354,6 @@ class PalatineSpeechNode {
316
354
  });
317
355
  continue;
318
356
  }
319
- // If it's already a NodeOperationError/NodeApiError — rethrow
320
357
  throw error;
321
358
  }
322
359
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-paaalleeee",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Custom n8n node for Palatine Speech API: transcription, diarization, sentiment analysis, summarization and more",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",