@cloudconvert/n8n-nodes-cloudconvert 1.0.1 → 1.1.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.
- package/dist/credentials/CloudConvertApi.credentials.js +1 -1
- package/dist/credentials/CloudConvertApi.credentials.js.map +1 -1
- package/dist/nodes/CloudConvert/CloudConvert.node.d.ts +1 -2
- package/dist/nodes/CloudConvert/CloudConvert.node.js +260 -40
- package/dist/nodes/CloudConvert/CloudConvert.node.js.map +1 -1
- package/dist/nodes/CloudConvert/operations/command/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/command/execute.js +90 -0
- package/dist/nodes/CloudConvert/operations/command/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/command/fields.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/command/fields.js +73 -0
- package/dist/nodes/CloudConvert/operations/command/fields.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/metadata/execute.js +71 -21
- package/dist/nodes/CloudConvert/operations/metadata/execute.js.map +1 -1
- package/dist/nodes/CloudConvert/operations/pdf/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/pdf/execute.js +112 -0
- package/dist/nodes/CloudConvert/operations/pdf/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/pdf/fields.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/pdf/fields.js +191 -0
- package/dist/nodes/CloudConvert/operations/pdf/fields.js.map +1 -0
- package/dist/package.json +2 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudConvertApi.credentials.js","sourceRoot":"","sources":["../../credentials/CloudConvertApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAG,iBAAiB,CAAC;QAEzB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,qBAAgB,GAAG,gDAAgD,CAAC;QAEpE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACV,8HAA8H;gBAC/H,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,iCAAiC;gBAC1C,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"CloudConvertApi.credentials.js","sourceRoot":"","sources":["../../credentials/CloudConvertApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAG,iBAAiB,CAAC;QAEzB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,qBAAgB,GAAG,gDAAgD,CAAC;QAEpE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACV,8HAA8H;gBAC/H,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,iCAAiC;gBAC1C,GAAG,EAAE,WAAW;aAChB;SACD,CAAC;IACH,CAAC;CAAA;AAlCD,0CAkCC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { IExecuteFunctions } from 'n8n-
|
|
2
|
-
import type { ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
1
|
+
import type { ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription, IExecuteFunctions } from 'n8n-workflow';
|
|
3
2
|
export declare class CloudConvert implements INodeType {
|
|
4
3
|
description: INodeTypeDescription;
|
|
5
4
|
methods: {
|
|
@@ -13,6 +13,10 @@ const execute_6 = require("./operations/watermark/execute");
|
|
|
13
13
|
const execute_7 = require("./operations/metadata/execute");
|
|
14
14
|
const execute_8 = require("./operations/capture-website/execute");
|
|
15
15
|
const fields_3 = require("./operations/capture-website/fields");
|
|
16
|
+
const execute_9 = require("./operations/pdf/execute");
|
|
17
|
+
const fields_4 = require("./operations/pdf/fields");
|
|
18
|
+
const execute_10 = require("./operations/command/execute");
|
|
19
|
+
const fields_5 = require("./operations/command/fields");
|
|
16
20
|
class CloudConvert {
|
|
17
21
|
constructor() {
|
|
18
22
|
this.description = {
|
|
@@ -28,6 +32,7 @@ class CloudConvert {
|
|
|
28
32
|
},
|
|
29
33
|
inputs: ['main'],
|
|
30
34
|
outputs: ['main'],
|
|
35
|
+
usableAsTool: true,
|
|
31
36
|
credentials: [
|
|
32
37
|
{
|
|
33
38
|
name: 'cloudConvertApi',
|
|
@@ -65,10 +70,44 @@ class CloudConvert {
|
|
|
65
70
|
],
|
|
66
71
|
default: 'oAuth2',
|
|
67
72
|
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Resource',
|
|
75
|
+
name: 'resource',
|
|
76
|
+
type: 'options',
|
|
77
|
+
noDataExpression: true,
|
|
78
|
+
options: [
|
|
79
|
+
{
|
|
80
|
+
name: 'Command',
|
|
81
|
+
value: 'command',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'File',
|
|
85
|
+
value: 'file',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Metadata',
|
|
89
|
+
value: 'metadata',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'PDF',
|
|
93
|
+
value: 'pdf',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'Website',
|
|
97
|
+
value: 'website',
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
default: 'file',
|
|
101
|
+
},
|
|
68
102
|
{
|
|
69
103
|
displayName: 'Operation',
|
|
70
104
|
name: 'operation',
|
|
71
105
|
type: 'options',
|
|
106
|
+
displayOptions: {
|
|
107
|
+
show: {
|
|
108
|
+
resource: ['file'],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
72
111
|
options: [
|
|
73
112
|
{
|
|
74
113
|
name: 'Add Watermark',
|
|
@@ -76,12 +115,6 @@ class CloudConvert {
|
|
|
76
115
|
description: 'Add a watermark to a PDF file, to an image or to a video',
|
|
77
116
|
action: 'Add watermark to a file',
|
|
78
117
|
},
|
|
79
|
-
{
|
|
80
|
-
name: 'Capture Website',
|
|
81
|
-
value: 'capture-website',
|
|
82
|
-
description: 'Creates job to capture a website as PDF or create a website screenshot as JPG or PNG',
|
|
83
|
-
action: 'Capture website',
|
|
84
|
-
},
|
|
85
118
|
{
|
|
86
119
|
name: 'Convert File',
|
|
87
120
|
value: 'convert',
|
|
@@ -100,26 +133,142 @@ class CloudConvert {
|
|
|
100
133
|
description: 'Create a thumbnail of a file',
|
|
101
134
|
action: 'Create a thumbnail',
|
|
102
135
|
},
|
|
136
|
+
{
|
|
137
|
+
name: 'Optimize File',
|
|
138
|
+
value: 'optimize',
|
|
139
|
+
description: 'Optimize / compress a file to reduce its size',
|
|
140
|
+
action: 'Optimize a file',
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
default: 'convert',
|
|
144
|
+
noDataExpression: true,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
displayName: 'Operation',
|
|
148
|
+
name: 'operation',
|
|
149
|
+
type: 'options',
|
|
150
|
+
displayOptions: {
|
|
151
|
+
show: {
|
|
152
|
+
resource: ['metadata'],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
options: [
|
|
103
156
|
{
|
|
104
157
|
name: 'Get Metadata',
|
|
105
158
|
value: 'metadata',
|
|
106
159
|
description: 'Extract metadata from files',
|
|
107
160
|
action: 'Get metadata from a file',
|
|
108
161
|
},
|
|
162
|
+
{
|
|
163
|
+
name: 'Write Metadata',
|
|
164
|
+
value: 'metadata/write',
|
|
165
|
+
description: 'Write metadata to files',
|
|
166
|
+
action: 'Write metadata to a file',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
default: 'metadata',
|
|
170
|
+
noDataExpression: true,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Operation',
|
|
174
|
+
name: 'operation',
|
|
175
|
+
type: 'options',
|
|
176
|
+
displayOptions: {
|
|
177
|
+
show: {
|
|
178
|
+
resource: ['pdf'],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
options: [
|
|
182
|
+
{
|
|
183
|
+
name: 'Add PDF OCR Layer',
|
|
184
|
+
value: 'pdf/ocr',
|
|
185
|
+
description: 'Add an OCR text layer to scanned PDF files',
|
|
186
|
+
action: 'Add OCR layer to PDF',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'Convert PDF to PDF/A',
|
|
190
|
+
value: 'pdf/a',
|
|
191
|
+
description: 'Convert a PDF file to PDF/A-1B, PDF/A-2B or PDF/A-3B',
|
|
192
|
+
action: 'Convert PDF to PDF/A',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'Decrypt PDF',
|
|
196
|
+
value: 'pdf/decrypt',
|
|
197
|
+
description: 'Decrypt a password-protected PDF file',
|
|
198
|
+
action: 'Decrypt PDF',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'Encrypt PDF',
|
|
202
|
+
value: 'pdf/encrypt',
|
|
203
|
+
description: 'Encrypt a PDF file and optionally set a password and restrictions',
|
|
204
|
+
action: 'Encrypt PDF',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'Extract Pages From PDF',
|
|
208
|
+
value: 'pdf/extract-pages',
|
|
209
|
+
description: 'Extract specific pages or page ranges from a PDF file',
|
|
210
|
+
action: 'Extract pages from PDF',
|
|
211
|
+
},
|
|
109
212
|
{
|
|
110
213
|
name: 'Merge Files',
|
|
111
|
-
value: 'merge',
|
|
214
|
+
value: 'pdf/merge',
|
|
112
215
|
description: 'Merge multiple files into a single PDF',
|
|
113
216
|
action: 'Merge files to PDF',
|
|
114
217
|
},
|
|
115
218
|
{
|
|
116
|
-
name: '
|
|
117
|
-
value: '
|
|
118
|
-
description: '
|
|
119
|
-
action: '
|
|
219
|
+
name: 'Rotate PDF Pages',
|
|
220
|
+
value: 'pdf/rotate-pages',
|
|
221
|
+
description: 'Rotate single pages or all pages of a PDF file',
|
|
222
|
+
action: 'Rotate PDF pages',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'Split PDF Into Pages',
|
|
226
|
+
value: 'pdf/split-pages',
|
|
227
|
+
description: 'Split a PDF into one PDF file per page',
|
|
228
|
+
action: 'Split PDF into pages',
|
|
120
229
|
},
|
|
121
230
|
],
|
|
122
|
-
default: '
|
|
231
|
+
default: 'pdf/a',
|
|
232
|
+
noDataExpression: true,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
displayName: 'Operation',
|
|
236
|
+
name: 'operation',
|
|
237
|
+
type: 'options',
|
|
238
|
+
displayOptions: {
|
|
239
|
+
show: {
|
|
240
|
+
resource: ['command'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
options: [
|
|
244
|
+
{
|
|
245
|
+
name: 'Execute Command',
|
|
246
|
+
value: 'command',
|
|
247
|
+
description: 'Execute a custom ffmpeg, ImageMagick or GraphicsMagick command on the input file',
|
|
248
|
+
action: 'Execute command',
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
default: 'command',
|
|
252
|
+
noDataExpression: true,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
displayName: 'Operation',
|
|
256
|
+
name: 'operation',
|
|
257
|
+
type: 'options',
|
|
258
|
+
displayOptions: {
|
|
259
|
+
show: {
|
|
260
|
+
resource: ['website'],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
options: [
|
|
264
|
+
{
|
|
265
|
+
name: 'Capture Website',
|
|
266
|
+
value: 'capture-website',
|
|
267
|
+
description: 'Creates job to capture a website as PDF or create a website screenshot as JPG or PNG',
|
|
268
|
+
action: 'Capture website',
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
default: 'capture-website',
|
|
123
272
|
noDataExpression: true,
|
|
124
273
|
},
|
|
125
274
|
{
|
|
@@ -154,14 +303,23 @@ class CloudConvert {
|
|
|
154
303
|
'thumbnail',
|
|
155
304
|
'optimize',
|
|
156
305
|
'metadata',
|
|
306
|
+
'metadata/write',
|
|
157
307
|
'watermark',
|
|
308
|
+
'command',
|
|
309
|
+
'pdf/a',
|
|
310
|
+
'pdf/ocr',
|
|
311
|
+
'pdf/encrypt',
|
|
312
|
+
'pdf/decrypt',
|
|
313
|
+
'pdf/split-pages',
|
|
314
|
+
'pdf/extract-pages',
|
|
315
|
+
'pdf/rotate-pages',
|
|
158
316
|
],
|
|
159
317
|
},
|
|
160
318
|
},
|
|
161
319
|
description: 'Whether the input file to upload should be taken from binary field',
|
|
162
320
|
},
|
|
163
321
|
{
|
|
164
|
-
displayName: 'Input File
|
|
322
|
+
displayName: 'Input File Contents',
|
|
165
323
|
name: 'inputFileContent',
|
|
166
324
|
type: 'string',
|
|
167
325
|
default: '',
|
|
@@ -175,7 +333,16 @@ class CloudConvert {
|
|
|
175
333
|
'thumbnail',
|
|
176
334
|
'optimize',
|
|
177
335
|
'metadata',
|
|
336
|
+
'metadata/write',
|
|
178
337
|
'watermark',
|
|
338
|
+
'command',
|
|
339
|
+
'pdf/a',
|
|
340
|
+
'pdf/ocr',
|
|
341
|
+
'pdf/encrypt',
|
|
342
|
+
'pdf/decrypt',
|
|
343
|
+
'pdf/split-pages',
|
|
344
|
+
'pdf/extract-pages',
|
|
345
|
+
'pdf/rotate-pages',
|
|
179
346
|
],
|
|
180
347
|
inputBinaryData: [false],
|
|
181
348
|
},
|
|
@@ -184,7 +351,7 @@ class CloudConvert {
|
|
|
184
351
|
description: 'The text content of the file to upload',
|
|
185
352
|
},
|
|
186
353
|
{
|
|
187
|
-
displayName: 'Input
|
|
354
|
+
displayName: 'Input File Name',
|
|
188
355
|
name: 'inputFilename',
|
|
189
356
|
type: 'string',
|
|
190
357
|
default: '',
|
|
@@ -198,7 +365,9 @@ class CloudConvert {
|
|
|
198
365
|
'thumbnail',
|
|
199
366
|
'optimize',
|
|
200
367
|
'metadata',
|
|
368
|
+
'metadata/write',
|
|
201
369
|
'watermark',
|
|
370
|
+
'command',
|
|
202
371
|
],
|
|
203
372
|
inputBinaryData: [false],
|
|
204
373
|
},
|
|
@@ -221,7 +390,16 @@ class CloudConvert {
|
|
|
221
390
|
'thumbnail',
|
|
222
391
|
'optimize',
|
|
223
392
|
'metadata',
|
|
393
|
+
'metadata/write',
|
|
224
394
|
'watermark',
|
|
395
|
+
'command',
|
|
396
|
+
'pdf/a',
|
|
397
|
+
'pdf/ocr',
|
|
398
|
+
'pdf/encrypt',
|
|
399
|
+
'pdf/decrypt',
|
|
400
|
+
'pdf/split-pages',
|
|
401
|
+
'pdf/extract-pages',
|
|
402
|
+
'pdf/rotate-pages',
|
|
225
403
|
],
|
|
226
404
|
inputBinaryData: [true],
|
|
227
405
|
},
|
|
@@ -232,6 +410,22 @@ class CloudConvert {
|
|
|
232
410
|
...fields_3.captureWebsiteFields,
|
|
233
411
|
...fields_1.thumbnailFields,
|
|
234
412
|
...fields_2.watermarkFields,
|
|
413
|
+
...fields_4.pdfFields,
|
|
414
|
+
...fields_5.commandFields,
|
|
415
|
+
{
|
|
416
|
+
displayName: 'Metadata',
|
|
417
|
+
name: 'metadata',
|
|
418
|
+
type: 'json',
|
|
419
|
+
default: '',
|
|
420
|
+
displayOptions: {
|
|
421
|
+
show: {
|
|
422
|
+
resource: ['metadata'],
|
|
423
|
+
operation: ['metadata/write'],
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
placeholder: '{ "Author": "Jane Doe", "Title": "My Document" }',
|
|
427
|
+
description: 'JSON dictionary of metadata keys and values to write, for example Title, Author, Creator, Producer',
|
|
428
|
+
},
|
|
235
429
|
{
|
|
236
430
|
displayName: 'Additional Options',
|
|
237
431
|
name: 'additionalOptions',
|
|
@@ -243,9 +437,9 @@ class CloudConvert {
|
|
|
243
437
|
'convert',
|
|
244
438
|
'thumbnail',
|
|
245
439
|
'optimize',
|
|
246
|
-
'metadata',
|
|
247
440
|
'watermark',
|
|
248
441
|
'capture-website',
|
|
442
|
+
'command',
|
|
249
443
|
],
|
|
250
444
|
},
|
|
251
445
|
},
|
|
@@ -278,32 +472,58 @@ class CloudConvert {
|
|
|
278
472
|
}
|
|
279
473
|
async execute() {
|
|
280
474
|
const operation = this.getNodeParameter('operation', 0);
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
475
|
+
try {
|
|
476
|
+
if (operation === 'convert') {
|
|
477
|
+
return await execute_2.executeConvert.call(this);
|
|
478
|
+
}
|
|
479
|
+
else if (operation === 'thumbnail') {
|
|
480
|
+
return await execute_1.executeThumbnail.call(this);
|
|
481
|
+
}
|
|
482
|
+
else if (operation === 'merge') {
|
|
483
|
+
return await execute_3.executeMerge.call(this);
|
|
484
|
+
}
|
|
485
|
+
else if (operation === 'archive') {
|
|
486
|
+
return await execute_4.executeArchive.call(this);
|
|
487
|
+
}
|
|
488
|
+
else if (operation === 'optimize') {
|
|
489
|
+
return await execute_5.executeOptimize.call(this);
|
|
490
|
+
}
|
|
491
|
+
else if (operation === 'watermark') {
|
|
492
|
+
return await execute_6.executeWatermark.call(this);
|
|
493
|
+
}
|
|
494
|
+
else if (operation === 'metadata' || operation === 'metadata/write') {
|
|
495
|
+
return await execute_7.executeMetadata.call(this);
|
|
496
|
+
}
|
|
497
|
+
else if (operation === 'capture-website') {
|
|
498
|
+
return await execute_8.executeCaptureWebsite.call(this);
|
|
499
|
+
}
|
|
500
|
+
else if (operation === 'command') {
|
|
501
|
+
return await execute_10.executeCommand.call(this);
|
|
502
|
+
}
|
|
503
|
+
else if (operation === 'pdf/a' ||
|
|
504
|
+
operation === 'pdf/ocr' ||
|
|
505
|
+
operation === 'pdf/encrypt' ||
|
|
506
|
+
operation === 'pdf/decrypt' ||
|
|
507
|
+
operation === 'pdf/split-pages' ||
|
|
508
|
+
operation === 'pdf/extract-pages' ||
|
|
509
|
+
operation === 'pdf/rotate-pages') {
|
|
510
|
+
return await execute_9.executePdfOperation.call(this);
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Invalid operation ${operation}`);
|
|
514
|
+
}
|
|
289
515
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
else if (operation === 'capture-website') {
|
|
303
|
-
return execute_8.executeCaptureWebsite.call(this);
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Invalid operation ${operation}`);
|
|
516
|
+
catch (error) {
|
|
517
|
+
if (this.continueOnFail()) {
|
|
518
|
+
return this.prepareOutputData([
|
|
519
|
+
{
|
|
520
|
+
json: {
|
|
521
|
+
error: error.message,
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
]);
|
|
525
|
+
}
|
|
526
|
+
throw error;
|
|
307
527
|
}
|
|
308
528
|
}
|
|
309
529
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudConvert.node.js","sourceRoot":"","sources":["../../../nodes/CloudConvert/CloudConvert.node.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"CloudConvert.node.js","sourceRoot":"","sources":["../../../nodes/CloudConvert/CloudConvert.node.ts"],"names":[],"mappings":";;;AAQA,+CAAkD;AAElD,0DAAgE;AAChE,4DAAkE;AAClE,0DAA8D;AAC9D,wDAA0D;AAC1D,0DAA8D;AAC9D,2DAAgE;AAChE,0DAAgE;AAChE,4DAAkE;AAClE,2DAAgE;AAChE,kEAA6E;AAC7E,gEAA2E;AAC3E,sDAA+D;AAC/D,oDAAoD;AACpD,2DAA8D;AAC9D,wDAA4D;AAE5D,MAAa,YAAY;IAAzB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,cAAc;YAEpB,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gCAAgC;YAC1C,WAAW,EACV,6FAA6F;YAC9F,QAAQ,EAAE;gBACT,IAAI,EAAE,cAAc;aACpB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,YAAY,EAAE,IAAI;YAIlB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,iBAAiB;oBACvB,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC1B;qBACD;iBACD;gBACD;oBACC,IAAI,EAAE,uBAAuB;oBAC7B,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACf,IAAI,EAAE;4BACL,cAAc,EAAE,CAAC,QAAQ,CAAC;yBAC1B;qBACD;iBACD;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,gBAAgB;oBAC7B,IAAI,EAAE,gBAAgB;o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CAAC;aACxC;iBAAM,IAAI,SAAS,KAAK,iBAAiB,EAAE;gBAC3C,OAAO,MAAM,+BAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9C;iBAAM,IAAI,SAAS,KAAK,SAAS,EAAE;gBACnC,OAAO,MAAM,yBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvC;iBAAM,IACN,SAAS,KAAK,OAAO;gBACrB,SAAS,KAAK,SAAS;gBACvB,SAAS,KAAK,aAAa;gBAC3B,SAAS,KAAK,aAAa;gBAC3B,SAAS,KAAK,iBAAiB;gBAC/B,SAAS,KAAK,mBAAmB;gBACjC,SAAS,KAAK,kBAAkB,EAC/B;gBACD,OAAO,MAAM,6BAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC5C;iBAAM;gBACN,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,qBAAqB,SAAS,EAAE,CAAC,CAAC;aAC/E;SACD;QAAC,OAAO,KAAK,EAAE;YACf,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE;gBAC1B,OAAO,IAAI,CAAC,iBAAiB,CAAC;oBAC7B;wBACC,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,CAAC,OAAO;yBACpB;qBACD;iBACD,CAAC,CAAC;aACH;YACD,MAAM,KAAK,CAAC;SACZ;IACF,CAAC;CACD;AAziBD,oCAyiBC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeCommand = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const Utils_1 = require("../../Utils");
|
|
6
|
+
async function executeCommand() {
|
|
7
|
+
const items = this.getInputData();
|
|
8
|
+
const returnData = [];
|
|
9
|
+
for (let i = 0; i < items.length; i++) {
|
|
10
|
+
const engine = this.getNodeParameter('commandEngine', i);
|
|
11
|
+
const commandBase = this.getNodeParameter('commandBase', i);
|
|
12
|
+
const argumentsParam = this.getNodeParameter('commandArguments', i, '');
|
|
13
|
+
const captureOutput = this.getNodeParameter('commandCaptureOutput', i, false);
|
|
14
|
+
if (!engine) {
|
|
15
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Engine must be set for command operations');
|
|
16
|
+
}
|
|
17
|
+
if (!commandBase) {
|
|
18
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Command must be set for command operations');
|
|
19
|
+
}
|
|
20
|
+
const tasks = {
|
|
21
|
+
'n8n-upload': {
|
|
22
|
+
operation: 'import/upload',
|
|
23
|
+
},
|
|
24
|
+
'n8n-process': {
|
|
25
|
+
input: 'n8n-upload',
|
|
26
|
+
operation: 'command',
|
|
27
|
+
engine,
|
|
28
|
+
command: commandBase,
|
|
29
|
+
},
|
|
30
|
+
'n8n-export': {
|
|
31
|
+
input: 'n8n-process',
|
|
32
|
+
operation: 'export/url',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
if (argumentsParam) {
|
|
36
|
+
tasks['n8n-process'].arguments = argumentsParam;
|
|
37
|
+
}
|
|
38
|
+
if (captureOutput) {
|
|
39
|
+
tasks['n8n-process'].capture_output = true;
|
|
40
|
+
}
|
|
41
|
+
if (this.getNodeParameter('additionalOptions', i, null)) {
|
|
42
|
+
let additionalOptions = this.getNodeParameter('additionalOptions', i);
|
|
43
|
+
try {
|
|
44
|
+
additionalOptions = JSON.parse(additionalOptions);
|
|
45
|
+
}
|
|
46
|
+
catch (exception) {
|
|
47
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional Options must be a valid JSON');
|
|
48
|
+
}
|
|
49
|
+
tasks['n8n-process'] = (0, Utils_1.mergeObjects)(tasks['n8n-process'], additionalOptions);
|
|
50
|
+
}
|
|
51
|
+
const createdJob = await Utils_1.createJob.call(this, tasks);
|
|
52
|
+
const uploadTask = (0, Utils_1.getJobUploadTask)(createdJob);
|
|
53
|
+
if (uploadTask) {
|
|
54
|
+
await Utils_1.uploadInputFile.call(this, uploadTask, i);
|
|
55
|
+
}
|
|
56
|
+
const completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
57
|
+
const exportUrls = (0, Utils_1.getJobExportUrls)(completedJob);
|
|
58
|
+
let baseJson = {};
|
|
59
|
+
if (captureOutput) {
|
|
60
|
+
const commandTask = completedJob.tasks.find((task) => task.operation === 'command' && task.status === 'finished');
|
|
61
|
+
if (commandTask === null || commandTask === void 0 ? void 0 : commandTask.result) {
|
|
62
|
+
baseJson = commandTask.result;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (exportUrls.length === 0) {
|
|
66
|
+
returnData.push({
|
|
67
|
+
json: baseJson,
|
|
68
|
+
pairedItem: {
|
|
69
|
+
item: i,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
for (const exportUrl of exportUrls) {
|
|
75
|
+
returnData.push({
|
|
76
|
+
json: baseJson,
|
|
77
|
+
binary: {
|
|
78
|
+
data: await Utils_1.downloadOutputFile.call(this, exportUrl),
|
|
79
|
+
},
|
|
80
|
+
pairedItem: {
|
|
81
|
+
item: i,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return this.prepareOutputData(returnData);
|
|
88
|
+
}
|
|
89
|
+
exports.executeCommand = executeCommand;
|
|
90
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/command/execute.ts"],"names":[],"mappings":";;;AACA,+CAAkD;AAElD,uCAQqB;AAEd,KAAK,UAAU,cAAc;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CA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AAE;oBACX,IAAI,EAAE,CAAC;iBACP;aACD,CAAC,CAAC;SACH;aAAM;YACN,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;gBACnC,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACP,IAAI,EAAE,MAAM,0BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;qBACpD;oBACD,UAAU,EAAE;wBACX,IAAI,EAAE,CAAC;qBACP;iBACD,CAAC,CAAC;aACH;SACD;KACD;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAlGD,wCAkGC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandFields = void 0;
|
|
4
|
+
exports.commandFields = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Engine',
|
|
7
|
+
name: 'commandEngine',
|
|
8
|
+
type: 'options',
|
|
9
|
+
default: 'ffmpeg',
|
|
10
|
+
options: [
|
|
11
|
+
{
|
|
12
|
+
name: 'FFmpeg',
|
|
13
|
+
value: 'ffmpeg',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'ImageMagick',
|
|
17
|
+
value: 'imagemagick',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'GraphicsMagick',
|
|
21
|
+
value: 'graphicsmagick',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
displayOptions: {
|
|
25
|
+
show: {
|
|
26
|
+
operation: ['command'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
description: 'Engine to use for executing the command, for example ffmpeg or ImageMagick',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Command',
|
|
33
|
+
name: 'commandBase',
|
|
34
|
+
type: 'string',
|
|
35
|
+
default: '',
|
|
36
|
+
required: true,
|
|
37
|
+
displayOptions: {
|
|
38
|
+
show: {
|
|
39
|
+
operation: ['command'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
description: 'Base command to execute, for example "ffmpeg" or "convert"; see CloudConvert docs for supported commands',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Arguments',
|
|
46
|
+
name: 'commandArguments',
|
|
47
|
+
type: 'string',
|
|
48
|
+
typeOptions: {
|
|
49
|
+
rows: 4,
|
|
50
|
+
},
|
|
51
|
+
default: '',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
operation: ['command'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
placeholder: '-i /input/n8n-upload/file.mp4 -vcodec libx264 -acodec copy /output/output.mp4',
|
|
58
|
+
description: 'Arguments to pass to the command. You can access input files via /input/{taskName}/ and must write output files to /output/ (see CloudConvert Execute Commands API).',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Capture Console Output',
|
|
62
|
+
name: 'commandCaptureOutput',
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
default: false,
|
|
65
|
+
displayOptions: {
|
|
66
|
+
show: {
|
|
67
|
+
operation: ['command'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
description: 'Whether to capture the console output of the command and return it in the result',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
//# sourceMappingURL=fields.js.map
|