n8n-nodes-apexapi 0.1.6 → 0.1.8

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.
@@ -137,7 +137,16 @@ class ApexApi {
137
137
  placeholder: 'Add Option',
138
138
  displayOptions: { show: { resource: ['image'] } },
139
139
  default: {},
140
- options: [{ displayName: 'Number of Images', name: 'n', type: 'number', default: 1 }],
140
+ options: [
141
+ { displayName: 'Number of Images', name: 'n', type: 'number', default: 1 },
142
+ {
143
+ displayName: 'Reference Image URL',
144
+ name: 'imageUrl',
145
+ type: 'string',
146
+ default: '',
147
+ description: 'Source image for image-editing / img2img models (e.g. fal flux/edit, nano-banana/edit). Ignored by text-to-image models.',
148
+ },
149
+ ],
141
150
  },
142
151
  // ---- Video ----
143
152
  {
@@ -191,13 +200,28 @@ class ApexApi {
191
200
  description: 'Output resolution. Higher resolutions depend on the model (e.g. Seedance Fast tops out at 720p) — the API returns a clear error if unsupported.',
192
201
  },
193
202
  {
194
- displayName: 'Duration (Seconds)',
203
+ displayName: 'Duration',
195
204
  name: 'videoDuration',
205
+ type: 'options',
206
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
207
+ options: [
208
+ { name: '5 seconds', value: '5' },
209
+ { name: '10 seconds', value: '10' },
210
+ { name: 'Custom…', value: 'custom' },
211
+ ],
212
+ default: '5',
213
+ description: 'Clip length. Supported values depend on the model — the API validates and errors clearly if a model does not support the chosen length.',
214
+ },
215
+ {
216
+ displayName: 'Custom Duration (Seconds)',
217
+ name: 'videoDurationCustom',
196
218
  type: 'number',
197
219
  typeOptions: { minValue: 1, maxValue: 60 },
198
- displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
220
+ displayOptions: {
221
+ show: { resource: ['video'], operation: ['generate'], videoDuration: ['custom'] },
222
+ },
199
223
  default: 5,
200
- description: 'Clip length in seconds. Supported values depend on the model (commonly 5 or 10) — the API validates.',
224
+ description: '1–60 seconds. The model/provider enforces its own supported values.',
201
225
  },
202
226
  {
203
227
  displayName: 'Job ID',
@@ -291,6 +315,7 @@ class ApexApi {
291
315
  prompt: this.getNodeParameter('prompt', i),
292
316
  size,
293
317
  n: options.n,
318
+ imageUrl: options.imageUrl || undefined,
294
319
  });
295
320
  const resp = await (0, transport_1.apexApiRequest)(ctx, 'POST', '/images/generations', body);
296
321
  const parsed = (0, image_1.parseImageResponse)(resp);
@@ -323,7 +348,9 @@ class ApexApi {
323
348
  prompt: this.getNodeParameter('prompt', i),
324
349
  aspectRatio: this.getNodeParameter('videoAspectRatio', i, ''),
325
350
  resolution: this.getNodeParameter('videoResolution', i, ''),
326
- duration: this.getNodeParameter('videoDuration', i, 5),
351
+ duration: this.getNodeParameter('videoDuration', i, '5') === 'custom'
352
+ ? this.getNodeParameter('videoDurationCustom', i, 5)
353
+ : Number(this.getNodeParameter('videoDuration', i, '5')),
327
354
  audio: options.audio,
328
355
  imageUrl: options.imageUrl || undefined,
329
356
  endImageUrl: options.endImageUrl || undefined,
@@ -8,6 +8,8 @@ function buildImageBody(params) {
8
8
  body.size = params.size;
9
9
  if (params.n !== undefined)
10
10
  body.n = params.n;
11
+ if (params.imageUrl)
12
+ body.image_url = params.imageUrl;
11
13
  return body;
12
14
  }
13
15
  const DATA_URL_RE = /^data:([^;,]+);base64,(.+)$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-apexapi",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "n8n community node for ApexApi — call 14 AI providers (OpenAI, Anthropic, Google, Mistral, and more) through one OpenAI-compatible API.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",