n8n-nodes-apexapi 0.1.5 → 0.1.6

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.
@@ -161,6 +161,44 @@ class ApexApi {
161
161
  default: '',
162
162
  required: true,
163
163
  },
164
+ {
165
+ displayName: 'Aspect Ratio',
166
+ name: 'videoAspectRatio',
167
+ type: 'options',
168
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
169
+ options: [
170
+ { name: 'Landscape 16:9', value: '16:9' },
171
+ { name: 'Portrait 9:16', value: '9:16' },
172
+ { name: 'Square 1:1', value: '1:1' },
173
+ { name: 'Landscape 4:3', value: '4:3' },
174
+ { name: 'Portrait 3:4', value: '3:4' },
175
+ { name: 'Cinematic 21:9', value: '21:9' },
176
+ ],
177
+ default: '16:9',
178
+ description: 'Output aspect ratio. The API validates support per model.',
179
+ },
180
+ {
181
+ displayName: 'Resolution',
182
+ name: 'videoResolution',
183
+ type: 'options',
184
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
185
+ options: [
186
+ { name: '480p', value: '480p' },
187
+ { name: '720p', value: '720p' },
188
+ { name: '1080p', value: '1080p' },
189
+ ],
190
+ default: '720p',
191
+ 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
+ },
193
+ {
194
+ displayName: 'Duration (Seconds)',
195
+ name: 'videoDuration',
196
+ type: 'number',
197
+ typeOptions: { minValue: 1, maxValue: 60 },
198
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
199
+ default: 5,
200
+ description: 'Clip length in seconds. Supported values depend on the model (commonly 5 or 10) — the API validates.',
201
+ },
164
202
  {
165
203
  displayName: 'Job ID',
166
204
  name: 'jobId',
@@ -178,6 +216,28 @@ class ApexApi {
178
216
  displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
179
217
  default: {},
180
218
  options: [
219
+ {
220
+ displayName: 'Reference Image URL',
221
+ name: 'imageUrl',
222
+ type: 'string',
223
+ default: '',
224
+ description: 'Starting/reference image for image-to-video models (e.g. Seedance image-to-video).',
225
+ },
226
+ {
227
+ displayName: 'End Image URL',
228
+ name: 'endImageUrl',
229
+ type: 'string',
230
+ default: '',
231
+ description: 'Last-frame image (supported by fal Seedance end-frame models).',
232
+ },
233
+ {
234
+ displayName: 'Reference Video URL',
235
+ name: 'videoUrl',
236
+ type: 'string',
237
+ default: '',
238
+ description: 'Reference video for reference-to-video models.',
239
+ },
240
+ { displayName: 'Generate Audio', name: 'audio', type: 'boolean', default: false },
181
241
  { displayName: 'Wait for Completion', name: 'waitForCompletion', type: 'boolean', default: true },
182
242
  { displayName: 'Max Poll Seconds', name: 'maxPollSeconds', type: 'number', default: 300 },
183
243
  { displayName: 'Poll Interval Seconds', name: 'pollIntervalSeconds', type: 'number', default: 5 },
@@ -261,6 +321,13 @@ class ApexApi {
261
321
  const body = (0, video_1.buildVideoBody)({
262
322
  model: this.getNodeParameter('model', i),
263
323
  prompt: this.getNodeParameter('prompt', i),
324
+ aspectRatio: this.getNodeParameter('videoAspectRatio', i, ''),
325
+ resolution: this.getNodeParameter('videoResolution', i, ''),
326
+ duration: this.getNodeParameter('videoDuration', i, 5),
327
+ audio: options.audio,
328
+ imageUrl: options.imageUrl || undefined,
329
+ endImageUrl: options.endImageUrl || undefined,
330
+ videoUrl: options.videoUrl || undefined,
264
331
  });
265
332
  json = (await (0, transport_1.generateVideo)(ctx, body, {
266
333
  waitForCompletion: options.waitForCompletion ?? true,
@@ -3,7 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildVideoBody = buildVideoBody;
4
4
  exports.isTerminalVideoStatus = isTerminalVideoStatus;
5
5
  function buildVideoBody(params) {
6
- return { model: params.model, prompt: params.prompt };
6
+ const body = { model: params.model, prompt: params.prompt };
7
+ if (params.aspectRatio)
8
+ body.aspect_ratio = params.aspectRatio;
9
+ if (params.resolution)
10
+ body.resolution = params.resolution;
11
+ if (params.duration !== undefined)
12
+ body.duration = params.duration;
13
+ if (params.audio !== undefined)
14
+ body.audio = params.audio;
15
+ if (params.imageUrl)
16
+ body.image_url = params.imageUrl;
17
+ if (params.endImageUrl)
18
+ body.end_image_url = params.endImageUrl;
19
+ if (params.videoUrl)
20
+ body.video_url = params.videoUrl;
21
+ return body;
7
22
  }
8
23
  const TERMINAL_STATUSES = new Set(['completed', 'failed']);
9
24
  function isTerminalVideoStatus(status) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-apexapi",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
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",