@cloudconvert/n8n-nodes-cloudconvert 1.0.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/LICENSE.md +19 -0
- package/README.md +68 -0
- package/dist/credentials/CloudConvertApi.credentials.d.ts +9 -0
- package/dist/credentials/CloudConvertApi.credentials.js +36 -0
- package/dist/credentials/CloudConvertApi.credentials.js.map +1 -0
- package/dist/credentials/CloudConvertOAuth2Api.credentials.d.ts +8 -0
- package/dist/credentials/CloudConvertOAuth2Api.credentials.js +52 -0
- package/dist/credentials/CloudConvertOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.d.ts +8 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.js +46 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.js.map +1 -0
- package/dist/credentials/HttpBinApi.credentials.d.ts +9 -0
- package/dist/credentials/HttpBinApi.credentials.js +40 -0
- package/dist/credentials/HttpBinApi.credentials.js.map +1 -0
- package/dist/nodes/CloudConvert/CloudConvert.node.d.ts +11 -0
- package/dist/nodes/CloudConvert/CloudConvert.node.js +315 -0
- package/dist/nodes/CloudConvert/CloudConvert.node.js.map +1 -0
- package/dist/nodes/CloudConvert/CloudConvert.node.json +22 -0
- package/dist/nodes/CloudConvert/Interfaces.d.ts +37 -0
- package/dist/nodes/CloudConvert/Interfaces.js +3 -0
- package/dist/nodes/CloudConvert/Interfaces.js.map +1 -0
- package/dist/nodes/CloudConvert/Utils.d.ts +9 -0
- package/dist/nodes/CloudConvert/Utils.js +117 -0
- package/dist/nodes/CloudConvert/Utils.js.map +1 -0
- package/dist/nodes/CloudConvert/cloudconvert.png +0 -0
- package/dist/nodes/CloudConvert/convert/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/convert/execute.js +64 -0
- package/dist/nodes/CloudConvert/convert/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/archive/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/archive/execute.js +41 -0
- package/dist/nodes/CloudConvert/operations/archive/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/capture-website/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/capture-website/execute.js +53 -0
- package/dist/nodes/CloudConvert/operations/capture-website/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/capture-website/fields.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/capture-website/fields.js +19 -0
- package/dist/nodes/CloudConvert/operations/capture-website/fields.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/convert/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/convert/execute.js +60 -0
- package/dist/nodes/CloudConvert/operations/convert/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/execute.js +7 -0
- package/dist/nodes/CloudConvert/operations/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/merge/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/merge/execute.js +41 -0
- package/dist/nodes/CloudConvert/operations/merge/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/metadata/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/metadata/execute.js +36 -0
- package/dist/nodes/CloudConvert/operations/metadata/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/optimize/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/optimize/execute.js +59 -0
- package/dist/nodes/CloudConvert/operations/optimize/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/description.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/description.js +58 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/description.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/execute.js +65 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/fields.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/fields.js +58 -0
- package/dist/nodes/CloudConvert/operations/thumbnail/fields.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/watermark/execute.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/watermark/execute.js +80 -0
- package/dist/nodes/CloudConvert/operations/watermark/execute.js.map +1 -0
- package/dist/nodes/CloudConvert/operations/watermark/fields.d.ts +2 -0
- package/dist/nodes/CloudConvert/operations/watermark/fields.js +164 -0
- package/dist/nodes/CloudConvert/operations/watermark/fields.js.map +1 -0
- package/dist/nodes/CloudConvert/test/CloudConvert.node.test.d.ts +1 -0
- package/dist/nodes/CloudConvert/test/CloudConvert.node.test.js +103 -0
- package/dist/nodes/CloudConvert/test/CloudConvert.node.test.js.map +1 -0
- package/dist/nodes/CloudConvert/test/CloudConvert.workflow.test.json +354 -0
- package/dist/nodes/CloudConvert/test/ExecuteWorkflow.d.ts +7 -0
- package/dist/nodes/CloudConvert/test/ExecuteWorkflow.js +48 -0
- package/dist/nodes/CloudConvert/test/ExecuteWorkflow.js.map +1 -0
- package/dist/nodes/CloudConvert/test/FakeCredentialsMap.d.ts +8 -0
- package/dist/nodes/CloudConvert/test/FakeCredentialsMap.js +12 -0
- package/dist/nodes/CloudConvert/test/FakeCredentialsMap.js.map +1 -0
- package/dist/nodes/CloudConvert/test/Helpers.d.ts +32 -0
- package/dist/nodes/CloudConvert/test/Helpers.js +240 -0
- package/dist/nodes/CloudConvert/test/Helpers.js.map +1 -0
- package/dist/nodes/CloudConvert/test/types.d.ts +16 -0
- package/dist/nodes/CloudConvert/test/types.js +3 -0
- package/dist/nodes/CloudConvert/test/types.js.map +1 -0
- package/dist/package.json +67 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +67 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.CloudConvert",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": [
|
|
6
|
+
"Productivity",
|
|
7
|
+
"Data & Storage",
|
|
8
|
+
"Utility"
|
|
9
|
+
],
|
|
10
|
+
"resources": {
|
|
11
|
+
"credentialDocumentation": [
|
|
12
|
+
{
|
|
13
|
+
"url": "https://cloudconvert.com/api/v2#authentication"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"primaryDocumentation": [
|
|
17
|
+
{
|
|
18
|
+
"url": "https://cloudconvert.com/api/v2"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface CreateTasksPayload {
|
|
2
|
+
[taskName: string]: {
|
|
3
|
+
operation: string;
|
|
4
|
+
input?: string | string[];
|
|
5
|
+
[option: string]: any;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface Task {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
operation: string;
|
|
12
|
+
status: string;
|
|
13
|
+
message: string;
|
|
14
|
+
code: string;
|
|
15
|
+
result?: {
|
|
16
|
+
form?: TaskResultUploadForm;
|
|
17
|
+
metadata?: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
files?: TaskResultFile[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface TaskResultFile {
|
|
24
|
+
url: string;
|
|
25
|
+
filename: string;
|
|
26
|
+
}
|
|
27
|
+
export interface TaskResultUploadForm {
|
|
28
|
+
url: string;
|
|
29
|
+
parameters: {
|
|
30
|
+
[key: string]: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface Job {
|
|
34
|
+
id: string;
|
|
35
|
+
status: string;
|
|
36
|
+
tasks: Task[];
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../../../nodes/CloudConvert/Interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import type { CreateTasksPayload, Job, Task, TaskResultFile } from './Interfaces';
|
|
3
|
+
export declare function createJob(this: IExecuteFunctions, tasks: CreateTasksPayload): Promise<Job>;
|
|
4
|
+
export declare function uploadInputFile(this: IExecuteFunctions, uploadTask: Task, itemIndex?: number): Promise<void>;
|
|
5
|
+
export declare function getJobErrorMessage(job: Job): string;
|
|
6
|
+
export declare function waitForJob(this: IExecuteFunctions, id: string): Promise<Job>;
|
|
7
|
+
export declare function downloadOutputFile(this: IExecuteFunctions, exportUrl: TaskResultFile): Promise<import("n8n-workflow").IBinaryData>;
|
|
8
|
+
export declare function getJobUploadTask(job: Job, index?: number): Task | null;
|
|
9
|
+
export declare function getJobExportUrls(job: Job): TaskResultFile[];
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getJobExportUrls = exports.getJobUploadTask = exports.downloadOutputFile = exports.waitForJob = exports.getJobErrorMessage = exports.uploadInputFile = exports.createJob = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
9
|
+
async function createJob(tasks) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const credentialsType = this.getNodeParameter('authentication', 0) === 'oAuth2'
|
|
12
|
+
? 'cloudConvertOAuth2Api'
|
|
13
|
+
: 'cloudConvertApi';
|
|
14
|
+
let createResponseData;
|
|
15
|
+
try {
|
|
16
|
+
createResponseData = await this.helpers.httpRequestWithAuthentication.call(this, credentialsType, {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
url: 'https://api.cloudconvert.com/v2/jobs',
|
|
19
|
+
json: true,
|
|
20
|
+
body: {
|
|
21
|
+
tag: 'n8n',
|
|
22
|
+
tasks,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
if ((_b = (_a = e.cause.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.code) {
|
|
28
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${e.cause.response.data.message} (Code: ${e.cause.response.data.code})`);
|
|
29
|
+
}
|
|
30
|
+
throw e;
|
|
31
|
+
}
|
|
32
|
+
return createResponseData.data;
|
|
33
|
+
}
|
|
34
|
+
exports.createJob = createJob;
|
|
35
|
+
async function uploadInputFile(uploadTask, itemIndex = 0) {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const formData = new form_data_1.default();
|
|
38
|
+
for (const parameter in ((_b = (_a = uploadTask.result) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.parameters) || []) {
|
|
39
|
+
formData.append(parameter, uploadTask.result.form.parameters[parameter]);
|
|
40
|
+
}
|
|
41
|
+
if (this.getNodeParameter('inputBinaryData', itemIndex)) {
|
|
42
|
+
const binaryPropertyName = this.getNodeParameter('inputBinaryPropertyName', itemIndex);
|
|
43
|
+
const binaryData = this.helpers.assertBinaryData(itemIndex, binaryPropertyName);
|
|
44
|
+
const buffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
|
|
45
|
+
if (!binaryData.fileName)
|
|
46
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No file name given for input file.');
|
|
47
|
+
formData.append('file', buffer, {
|
|
48
|
+
contentType: binaryData.mimeType,
|
|
49
|
+
filename: binaryData.fileName,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
formData.append('file', this.getNodeParameter('inputFileContent', itemIndex), {
|
|
54
|
+
contentType: 'text/plain',
|
|
55
|
+
filename: this.getNodeParameter('inputFilename', itemIndex),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
await this.helpers.httpRequest({
|
|
59
|
+
method: 'POST',
|
|
60
|
+
url: uploadTask.result.form.url,
|
|
61
|
+
body: formData,
|
|
62
|
+
headers: {
|
|
63
|
+
...formData.getHeaders(),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.uploadInputFile = uploadInputFile;
|
|
68
|
+
function getJobErrorMessage(job) {
|
|
69
|
+
return job.tasks
|
|
70
|
+
.map((task) => {
|
|
71
|
+
var _a;
|
|
72
|
+
if (task.status === 'error' && task.code !== 'INPUT_TASK_FAILED') {
|
|
73
|
+
return task.message + ' (Code: ' + ((_a = task.code) !== null && _a !== void 0 ? _a : '?') + ')';
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
})
|
|
77
|
+
.filter((msg) => msg !== null)
|
|
78
|
+
.join('; ');
|
|
79
|
+
}
|
|
80
|
+
exports.getJobErrorMessage = getJobErrorMessage;
|
|
81
|
+
async function waitForJob(id) {
|
|
82
|
+
const credentialsType = this.getNodeParameter('authentication', 0) === 'oAuth2'
|
|
83
|
+
? 'cloudConvertOAuth2Api'
|
|
84
|
+
: 'cloudConvertApi';
|
|
85
|
+
const waitResponseData = await this.helpers.httpRequestWithAuthentication.call(this, credentialsType, {
|
|
86
|
+
method: 'GET',
|
|
87
|
+
url: `https://sync.api.cloudconvert.com/v2/jobs/${id}`,
|
|
88
|
+
});
|
|
89
|
+
const job = waitResponseData.data;
|
|
90
|
+
if (job.status === 'error') {
|
|
91
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), getJobErrorMessage(job));
|
|
92
|
+
}
|
|
93
|
+
return job;
|
|
94
|
+
}
|
|
95
|
+
exports.waitForJob = waitForJob;
|
|
96
|
+
async function downloadOutputFile(exportUrl) {
|
|
97
|
+
const downloadResponse = (await this.helpers.httpRequest({
|
|
98
|
+
method: 'GET',
|
|
99
|
+
url: exportUrl.url,
|
|
100
|
+
returnFullResponse: true,
|
|
101
|
+
encoding: 'stream',
|
|
102
|
+
}));
|
|
103
|
+
return this.helpers.prepareBinaryData(downloadResponse.body, exportUrl.filename, downloadResponse.headers['content-type']);
|
|
104
|
+
}
|
|
105
|
+
exports.downloadOutputFile = downloadOutputFile;
|
|
106
|
+
function getJobUploadTask(job, index = 0) {
|
|
107
|
+
const uploadTasks = job.tasks.filter((task) => task.operation === 'import/upload');
|
|
108
|
+
return uploadTasks[index] !== undefined ? uploadTasks[index] : null;
|
|
109
|
+
}
|
|
110
|
+
exports.getJobUploadTask = getJobUploadTask;
|
|
111
|
+
function getJobExportUrls(job) {
|
|
112
|
+
return job.tasks
|
|
113
|
+
.filter((task) => task.operation === 'export/url' && task.status === 'finished')
|
|
114
|
+
.flatMap((task) => { var _a, _b; return (_b = (_a = task.result) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []; });
|
|
115
|
+
}
|
|
116
|
+
exports.getJobExportUrls = getJobExportUrls;
|
|
117
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../nodes/CloudConvert/Utils.ts"],"names":[],"mappings":";;;;;;AACA,+CAAkD;AAClD,0DAAiC;AAI1B,KAAK,UAAU,SAAS,CAA0B,KAAyB;;IACjF,MAAM,eAAe,GACnB,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAY,KAAK,QAAQ;QAClE,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,iBAAiB,CAAC;IACtB,IAAI,kBAAkB,CAAC;IACvB,IAAI;QACH,kBAAkB,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CACzE,IAAI,EACJ,eAAe,EACf;YACC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,sCAAs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,KAAK,eAAe,CAAC,CAAC;IACnF,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC;AAHD,4CAGC;AAED,SAAgB,gBAAgB,CAAC,GAAQ;IACxC,OAAO,GAAG,CAAC,KAAK;SACd,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,YAAY,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC;SAC/E,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,KAAK,mCAAI,EAAE,CAAA,EAAA,CAAC,CAAC;AAC/C,CAAC;AAJD,4CAIC"}
|
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeThumbnail = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
9
|
+
const Utils_1 = require("../../Utils");
|
|
10
|
+
async function executeThumbnail() {
|
|
11
|
+
const items = this.getInputData();
|
|
12
|
+
const returnData = [];
|
|
13
|
+
for (let i = 0; i < items.length; i++) {
|
|
14
|
+
let tasks = {
|
|
15
|
+
'n8n-upload': {
|
|
16
|
+
operation: 'import/upload',
|
|
17
|
+
},
|
|
18
|
+
'n8n-process': {
|
|
19
|
+
operation: 'thumbnail',
|
|
20
|
+
output_format: this.getNodeParameter('outputFormat', i),
|
|
21
|
+
},
|
|
22
|
+
'n8n-export': {
|
|
23
|
+
input: 'n8n-process',
|
|
24
|
+
operation: 'export/url',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
for (let option of ['width', 'height', 'fit']) {
|
|
28
|
+
if (this.getNodeParameter(option, i, null)) {
|
|
29
|
+
tasks['n8n-process'][option] = this.getNodeParameter(option, i);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (this.getNodeParameter('additionalOptions', i, null)) {
|
|
33
|
+
let additionalOptions = this.getNodeParameter('additionalOptions', i);
|
|
34
|
+
try {
|
|
35
|
+
additionalOptions = JSON.parse(additionalOptions);
|
|
36
|
+
}
|
|
37
|
+
catch (exception) {
|
|
38
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional Options must be a valid JSON');
|
|
39
|
+
}
|
|
40
|
+
tasks['n8n-process'] = (0, lodash_merge_1.default)(tasks['n8n-process'], additionalOptions);
|
|
41
|
+
}
|
|
42
|
+
let createdJob = await Utils_1.createJob.call(this, tasks);
|
|
43
|
+
const uploadTask = (0, Utils_1.getJobUploadTask)(createdJob);
|
|
44
|
+
if (uploadTask) {
|
|
45
|
+
await Utils_1.uploadInputFile.call(this, uploadTask, i);
|
|
46
|
+
}
|
|
47
|
+
let completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
48
|
+
let exportUrls = (0, Utils_1.getJobExportUrls)(completedJob);
|
|
49
|
+
for (let exportUrl of exportUrls) {
|
|
50
|
+
returnData.push({
|
|
51
|
+
json: {},
|
|
52
|
+
binary: {
|
|
53
|
+
data: await Utils_1.downloadOutputFile.call(this, exportUrl),
|
|
54
|
+
},
|
|
55
|
+
pairedItem: {
|
|
56
|
+
item: i,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return this.prepareOutputData(returnData);
|
|
62
|
+
}
|
|
63
|
+
exports.executeThumbnail = executeThumbnail;
|
|
64
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources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xF;YACD,KAAK,CAAC,aAAa,CAAC,GAAG,IAAA,sBAAK,EAAC,KAAK,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC,CAAC;SACtE;QAED,IAAI,UAAU,GAAG,MAAM,iBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEnD,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,UAAU,EAAE;YACf,MAAM,uBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;SAChD;QAED,IAAI,YAAY,GAAG,MAAM,kBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QAI9D,IAAI,UAAU,GAAG,IAAA,wBAAgB,EAAC,YAAY,CAAC,CAAC;QAEhD,KAAK,IAAI,SAAS,IAAI,UAAU,EAAE;YACjC,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,EAAE;gBACR,MAAM,EAAE;oBACP,IAAI,EAAE,MAAM,0BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;iBACpD;gBACD,UAAU,EAAE;oBACX,IAAI,EAAE,CAAC;iBACP;aACD,CAAC,CAAC;SACH;KACD;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AA/DD,4CA+DC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeArchive = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
5
|
+
async function executeArchive() {
|
|
6
|
+
const items = this.getInputData();
|
|
7
|
+
const returnData = [];
|
|
8
|
+
const tasks = {};
|
|
9
|
+
for (let i = 0; i < items.length; i++) {
|
|
10
|
+
tasks['n8n-upload-' + i.toString()] = {
|
|
11
|
+
operation: 'import/upload',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
tasks['n8n-process'] = {
|
|
15
|
+
input: Object.keys(tasks),
|
|
16
|
+
operation: 'archive',
|
|
17
|
+
output_format: this.getNodeParameter('outputFormat', 0),
|
|
18
|
+
};
|
|
19
|
+
tasks['n8n-export'] = {
|
|
20
|
+
input: 'n8n-process',
|
|
21
|
+
operation: 'export/url',
|
|
22
|
+
};
|
|
23
|
+
const createdJob = await Utils_1.createJob.call(this, tasks);
|
|
24
|
+
for (let i = 0; i < items.length; i++) {
|
|
25
|
+
const uploadTask = (0, Utils_1.getJobUploadTask)(createdJob, i);
|
|
26
|
+
if (uploadTask) {
|
|
27
|
+
await Utils_1.uploadInputFile.call(this, uploadTask, i);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
31
|
+
const exportUrl = (0, Utils_1.getJobExportUrls)(completedJob)[0];
|
|
32
|
+
returnData.push({
|
|
33
|
+
json: {},
|
|
34
|
+
binary: {
|
|
35
|
+
data: await Utils_1.downloadOutputFile.call(this, exportUrl),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return this.prepareOutputData(returnData);
|
|
39
|
+
}
|
|
40
|
+
exports.executeArchive = executeArchive;
|
|
41
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/archive/execute.ts"],"names":[],"mappings":";;;AAEA,uCAOqB;AAEd,KAAK,UAAU,cAAc;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,EAAE,CAAC;IAGtB,MAAM,KAAK,GAAuB,EAAE,CAAC;IAErC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,KAAK,CAAC,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|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeCaptureWebsite = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
9
|
+
const Utils_1 = require("../../Utils");
|
|
10
|
+
async function executeCaptureWebsite() {
|
|
11
|
+
const items = this.getInputData();
|
|
12
|
+
const returnData = [];
|
|
13
|
+
for (let i = 0; i < items.length; i++) {
|
|
14
|
+
const tasks = {
|
|
15
|
+
'n8n-process': {
|
|
16
|
+
operation: 'capture-website',
|
|
17
|
+
url: this.getNodeParameter('url', i),
|
|
18
|
+
output_format: this.getNodeParameter('outputFormat', i),
|
|
19
|
+
},
|
|
20
|
+
'n8n-export': {
|
|
21
|
+
input: 'n8n-process',
|
|
22
|
+
operation: 'export/url',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
if (this.getNodeParameter('additionalOptions', i, null)) {
|
|
26
|
+
let additionalOptions = this.getNodeParameter('additionalOptions', i);
|
|
27
|
+
try {
|
|
28
|
+
additionalOptions = JSON.parse(additionalOptions);
|
|
29
|
+
}
|
|
30
|
+
catch (exception) {
|
|
31
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional Options must be a valid JSON');
|
|
32
|
+
}
|
|
33
|
+
tasks['n8n-process'] = (0, lodash_merge_1.default)(tasks['n8n-process'], additionalOptions);
|
|
34
|
+
}
|
|
35
|
+
const createdJob = await Utils_1.createJob.call(this, tasks);
|
|
36
|
+
const completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
37
|
+
const exportUrls = (0, Utils_1.getJobExportUrls)(completedJob);
|
|
38
|
+
for (const exportUrl of exportUrls) {
|
|
39
|
+
returnData.push({
|
|
40
|
+
json: {},
|
|
41
|
+
binary: {
|
|
42
|
+
data: await Utils_1.downloadOutputFile.call(this, exportUrl),
|
|
43
|
+
},
|
|
44
|
+
pairedItem: {
|
|
45
|
+
item: i,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return this.prepareOutputData(returnData);
|
|
51
|
+
}
|
|
52
|
+
exports.executeCaptureWebsite = executeCaptureWebsite;
|
|
53
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/capture-website/execute.ts"],"names":[],"mappings":";;;;;;AACA,+CAAkD;AAElD,gEAAiC;AACjC,uCAA0F;AAEnF,KAAK,UAAU,qBAAqB;IAG1C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,EAAE,CAAC;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAuB;YACjC,aAAa,EAAE;gBACd,SAAS,EAAE,iBAAiB;gBAC5B,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC;gBACpC,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC;aACvD;YACD,YAAY,EAAE;gBACb,KAAK,EAAE,aAAa;gBACpB,SAAS,EAAE,YAAY;aACvB;SACD,CAAC;QAEF,IAAI,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE;YACxD,IAAI,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC,CAAW,CAAC;YAChF,IAAI;gBACH,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;aAClD;YAAC,OAAO,SAAS,EAAE;gBACnB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,yCAAyC,CAAC,CAAC;aACxF;YACD,KAAK,CAAC,aAAa,CAAC,GAAG,IAAA,sBAAK,EAAC,KAAK,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC,CAAC;SACtE;QAED,MAAM,UAAU,GAAG,MAAM,iBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAErD,MAAM,YAAY,GAAG,MAAM,kBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;QAIhE,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,YAAY,CAAC,CAAC;QAElD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YACnC,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,EAAE;gBACR,MAAM,EAAE;oBACP,IAAI,EAAE,MAAM,0BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;iBACpD;gBACD,UAAU,EAAE;oBACX,IAAI,EAAE,CAAC;iBACP;aACD,CAAC,CAAC;SACH;KACD;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAnDD,sDAmDC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.captureWebsiteFields = void 0;
|
|
4
|
+
exports.captureWebsiteFields = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'URL',
|
|
7
|
+
name: 'url',
|
|
8
|
+
type: 'string',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
operation: ['capture-website'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
placeholder: 'https://...',
|
|
16
|
+
description: 'The URL of the website',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/capture-website/fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACtD;QACC,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,iBAAiB,CAAC;aAC9B;SACD;QACD,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,wBAAwB;KACrC;CACD,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeConvert = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
9
|
+
const Utils_1 = require("../../Utils");
|
|
10
|
+
async function executeConvert() {
|
|
11
|
+
const items = this.getInputData();
|
|
12
|
+
const returnData = [];
|
|
13
|
+
for (let i = 0; i < items.length; i++) {
|
|
14
|
+
const tasks = {
|
|
15
|
+
'n8n-upload': {
|
|
16
|
+
operation: 'import/upload',
|
|
17
|
+
},
|
|
18
|
+
'n8n-process': {
|
|
19
|
+
input: 'n8n-upload',
|
|
20
|
+
operation: 'convert',
|
|
21
|
+
output_format: this.getNodeParameter('outputFormat', i),
|
|
22
|
+
},
|
|
23
|
+
'n8n-export': {
|
|
24
|
+
input: 'n8n-process',
|
|
25
|
+
operation: 'export/url',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
if (this.getNodeParameter('additionalOptions', i, null)) {
|
|
29
|
+
let additionalOptions = this.getNodeParameter('additionalOptions', i);
|
|
30
|
+
try {
|
|
31
|
+
additionalOptions = JSON.parse(additionalOptions);
|
|
32
|
+
}
|
|
33
|
+
catch (exception) {
|
|
34
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional Options must be a valid JSON');
|
|
35
|
+
}
|
|
36
|
+
tasks['n8n-process'] = (0, lodash_merge_1.default)(tasks['n8n-process'], additionalOptions);
|
|
37
|
+
}
|
|
38
|
+
const createdJob = await Utils_1.createJob.call(this, tasks);
|
|
39
|
+
const uploadTask = (0, Utils_1.getJobUploadTask)(createdJob);
|
|
40
|
+
if (uploadTask) {
|
|
41
|
+
await Utils_1.uploadInputFile.call(this, uploadTask, i);
|
|
42
|
+
}
|
|
43
|
+
const completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
44
|
+
const exportUrls = (0, Utils_1.getJobExportUrls)(completedJob);
|
|
45
|
+
for (const exportUrl of exportUrls) {
|
|
46
|
+
returnData.push({
|
|
47
|
+
json: {},
|
|
48
|
+
binary: {
|
|
49
|
+
data: await Utils_1.downloadOutputFile.call(this, exportUrl),
|
|
50
|
+
},
|
|
51
|
+
pairedItem: {
|
|
52
|
+
item: i,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return this.prepareOutputData(returnData);
|
|
58
|
+
}
|
|
59
|
+
exports.executeConvert = executeConvert;
|
|
60
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/convert/execute.ts"],"names":[],"mappings":";;;;;;AACA,+CAAkD;AAElD,gEAAiC;AACjC,uCAOqB;AAEd,KAAK,UAAU,cAAc;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,EAAE,CAAC;IAEtB,K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AAU,GAAG,IAAA,wBAAgB,EAAC,YAAY,CAAC,CAAC;QAElD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YACnC,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,EAAE;gBACR,MAAM,EAAE;oBACP,IAAI,EAAE,MAAM,0BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;iBACpD;gBACD,UAAU,EAAE;oBACX,IAAI,EAAE,CAAC;iBACP;aACD,CAAC,CAAC;SACH;KACD;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AA1DD,wCA0DC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../nodes/CloudConvert/operations/execute.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,gBAAgB,CAA0B,KAAa;AAG7E,CAAC;AAHD,4CAGC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeMerge = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
5
|
+
async function executeMerge() {
|
|
6
|
+
const items = this.getInputData();
|
|
7
|
+
const returnData = [];
|
|
8
|
+
const tasks = {};
|
|
9
|
+
for (let i = 0; i < items.length; i++) {
|
|
10
|
+
tasks['n8n-upload-' + i.toString()] = {
|
|
11
|
+
operation: 'import/upload',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
tasks['n8n-process'] = {
|
|
15
|
+
input: Object.keys(tasks),
|
|
16
|
+
operation: 'merge',
|
|
17
|
+
output_format: this.getNodeParameter('outputFormat', 0),
|
|
18
|
+
};
|
|
19
|
+
tasks['n8n-export'] = {
|
|
20
|
+
input: 'n8n-process',
|
|
21
|
+
operation: 'export/url',
|
|
22
|
+
};
|
|
23
|
+
const createdJob = await Utils_1.createJob.call(this, tasks);
|
|
24
|
+
for (let i = 0; i < items.length; i++) {
|
|
25
|
+
const uploadTask = (0, Utils_1.getJobUploadTask)(createdJob, i);
|
|
26
|
+
if (uploadTask) {
|
|
27
|
+
await Utils_1.uploadInputFile.call(this, uploadTask, i);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
31
|
+
const exportUrl = (0, Utils_1.getJobExportUrls)(completedJob)[0];
|
|
32
|
+
returnData.push({
|
|
33
|
+
json: {},
|
|
34
|
+
binary: {
|
|
35
|
+
data: await Utils_1.downloadOutputFile.call(this, exportUrl),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return this.prepareOutputData(returnData);
|
|
39
|
+
}
|
|
40
|
+
exports.executeMerge = executeMerge;
|
|
41
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/merge/execute.ts"],"names":[],"mappings":";;;AAEA,uCAOqB;AAEd,KAAK,UAAU,YAAY;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,EAAE,CAAC;IAGtB,MAAM,KAAK,GAAuB,EAAE,CAAC;IAErC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG;YACrC,SAAS,EAAE,eAAe;SAC1B,CAAC;KACF;IAED,KAAK,CAAC,aAAa,CAAC,GAAG;QACtB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QACzB,SAAS,EAAE,OAAO;QAClB,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC;KACvD,CAAC;IAEF,KAAK,CAAC,YAAY,CAAC,GAAG;QACrB,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,YAAY;KACvB,CAAC;IAEF,MAAM,UAAU,GAAG,MAAM,iBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAErD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACnD,IAAI,UAAU,EAAE;YACf,MAAM,uBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;SAChD;KACD;IAED,MAAM,YAAY,GAAG,MAAM,kBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;IAEhE,MAAM,SAAS,GAAG,IAAA,wBAAgB,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,UAAU,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,EAAE;QACR,MAAM,EAAE;YACP,IAAI,EAAE,MAAM,0BAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;SACpD;KACD,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AA7CD,oCA6CC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeMetadata = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
5
|
+
async function executeMetadata() {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const items = this.getInputData();
|
|
8
|
+
const returnData = [];
|
|
9
|
+
for (let i = 0; i < items.length; i++) {
|
|
10
|
+
const tasks = {
|
|
11
|
+
'n8n-upload': {
|
|
12
|
+
operation: 'import/upload',
|
|
13
|
+
},
|
|
14
|
+
'n8n-process': {
|
|
15
|
+
input: 'n8n-upload',
|
|
16
|
+
operation: 'metadata',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const createdJob = await Utils_1.createJob.call(this, tasks);
|
|
20
|
+
const uploadTask = (0, Utils_1.getJobUploadTask)(createdJob);
|
|
21
|
+
if (uploadTask) {
|
|
22
|
+
await Utils_1.uploadInputFile.call(this, uploadTask, i);
|
|
23
|
+
}
|
|
24
|
+
const completedJob = await Utils_1.waitForJob.call(this, createdJob.id);
|
|
25
|
+
const metadata = (_b = (_a = completedJob.tasks.filter((task) => task.operation === 'metadata' && task.status === 'finished')[0]) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.metadata;
|
|
26
|
+
returnData.push({
|
|
27
|
+
json: metadata,
|
|
28
|
+
pairedItem: {
|
|
29
|
+
item: i,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return this.prepareOutputData(returnData);
|
|
34
|
+
}
|
|
35
|
+
exports.executeMetadata = executeMetadata;
|
|
36
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/CloudConvert/operations/metadata/execute.ts"],"names":[],"mappings":";;;AAEA,uCAAuF;AAEhF,KAAK,UAAU,eAAe;;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,EAAE,CAAC;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAuB;YACjC,YAAY,EAAE;gBACb,SAAS,EAAE,eAAe;aAC1B;YACD,aAAa,EAAE;gBACd,KAAK,EAAE,YAAY;gBACnB,SAAS,EAAE,UAAU;aACrB;SACD,CAAC;QAEF,MAAM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