@activepieces/piece-cloudconvert 0.0.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.
- package/README.md +7 -0
- package/package.json +32 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +45 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/archive-file.d.ts +11 -0
- package/src/lib/actions/archive-file.js +251 -0
- package/src/lib/actions/archive-file.js.map +1 -0
- package/src/lib/actions/capture-website.d.ts +28 -0
- package/src/lib/actions/capture-website.js +347 -0
- package/src/lib/actions/capture-website.js.map +1 -0
- package/src/lib/actions/convert-file.d.ts +14 -0
- package/src/lib/actions/convert-file.js +228 -0
- package/src/lib/actions/convert-file.js.map +1 -0
- package/src/lib/actions/download-file.d.ts +5 -0
- package/src/lib/actions/download-file.js +167 -0
- package/src/lib/actions/download-file.js.map +1 -0
- package/src/lib/actions/merge-pdf.d.ts +10 -0
- package/src/lib/actions/merge-pdf.js +237 -0
- package/src/lib/actions/merge-pdf.js.map +1 -0
- package/src/lib/actions/optimize-file.d.ts +16 -0
- package/src/lib/actions/optimize-file.js +285 -0
- package/src/lib/actions/optimize-file.js.map +1 -0
- package/src/lib/common/auth.d.ts +1 -0
- package/src/lib/common/auth.js +29 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +99 -0
- package/src/lib/common/client.js +283 -0
- package/src/lib/common/client.js.map +1 -0
- package/src/lib/common/index.d.ts +9 -0
- package/src/lib/common/index.js +33 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/common/properties.d.ts +14 -0
- package/src/lib/common/properties.js +242 -0
- package/src/lib/common/properties.js.map +1 -0
- package/src/lib/common/schemas.d.ts +533 -0
- package/src/lib/common/schemas.js +178 -0
- package/src/lib/common/schemas.js.map +1 -0
- package/src/lib/triggers/job-failed.d.ts +2 -0
- package/src/lib/triggers/job-failed.js +111 -0
- package/src/lib/triggers/job-failed.js.map +1 -0
- package/src/lib/triggers/job-finished.d.ts +2 -0
- package/src/lib/triggers/job-finished.js +150 -0
- package/src/lib/triggers/job-finished.js.map +1 -0
- package/src/lib/triggers/new-job.d.ts +2 -0
- package/src/lib/triggers/new-job.js +124 -0
- package/src/lib/triggers/new-job.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-cloudconvert",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@sinclair/typebox": "0.34.11",
|
|
9
|
+
"axios": "1.8.3",
|
|
10
|
+
"axios-retry": "4.4.1",
|
|
11
|
+
"deepmerge-ts": "7.1.0",
|
|
12
|
+
"mime-types": "2.1.35",
|
|
13
|
+
"nanoid": "3.3.8",
|
|
14
|
+
"semver": "7.6.0",
|
|
15
|
+
"tslib": "^2.3.0",
|
|
16
|
+
"zod": "3.25.76",
|
|
17
|
+
"@activepieces/pieces-common": "0.7.0",
|
|
18
|
+
"@activepieces/pieces-framework": "0.20.1",
|
|
19
|
+
"@activepieces/shared": "0.20.1"
|
|
20
|
+
},
|
|
21
|
+
"overrides": {
|
|
22
|
+
"@tryfabric/martian": {
|
|
23
|
+
"@notionhq/client": "$@notionhq/client"
|
|
24
|
+
},
|
|
25
|
+
"vite": {
|
|
26
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"resolutions": {
|
|
30
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cloudconvert: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloudconvert = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const auth_1 = require("./lib/common/auth");
|
|
9
|
+
const new_job_1 = require("./lib/triggers/new-job");
|
|
10
|
+
const job_finished_1 = require("./lib/triggers/job-finished");
|
|
11
|
+
const job_failed_1 = require("./lib/triggers/job-failed");
|
|
12
|
+
const convert_file_1 = require("./lib/actions/convert-file");
|
|
13
|
+
const capture_website_1 = require("./lib/actions/capture-website");
|
|
14
|
+
const merge_pdf_1 = require("./lib/actions/merge-pdf");
|
|
15
|
+
const download_file_1 = require("./lib/actions/download-file");
|
|
16
|
+
const archive_file_1 = require("./lib/actions/archive-file");
|
|
17
|
+
const optimize_file_1 = require("./lib/actions/optimize-file");
|
|
18
|
+
exports.cloudconvert = (0, pieces_framework_1.createPiece)({
|
|
19
|
+
displayName: 'CloudConvert',
|
|
20
|
+
description: 'File conversion and processing platform supporting 200+ formats',
|
|
21
|
+
minimumSupportedRelease: '0.36.1',
|
|
22
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/cloudconvert.png',
|
|
23
|
+
categories: [shared_1.PieceCategory.DEVELOPER_TOOLS, shared_1.PieceCategory.CONTENT_AND_FILES],
|
|
24
|
+
authors: ['owuzo'],
|
|
25
|
+
auth: auth_1.cloudconvertAuth,
|
|
26
|
+
actions: [
|
|
27
|
+
convert_file_1.convertFile,
|
|
28
|
+
capture_website_1.captureWebsite,
|
|
29
|
+
merge_pdf_1.mergePdf,
|
|
30
|
+
download_file_1.downloadFile,
|
|
31
|
+
archive_file_1.archiveFile,
|
|
32
|
+
optimize_file_1.optimizeFile,
|
|
33
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
34
|
+
baseUrl: () => 'https://api.cloudconvert.com/v2',
|
|
35
|
+
auth: auth_1.cloudconvertAuth,
|
|
36
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
return ({
|
|
38
|
+
Authorization: `Bearer ${auth}`,
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
triggers: [new_job_1.newJob, job_finished_1.jobFinished, job_failed_1.jobFailed],
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/cloudconvert/src/index.ts"],"names":[],"mappings":";;;;AACA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,4CAAqD;AACrD,oDAAgD;AAChD,8DAA0D;AAC1D,0DAAsD;AACtD,6DAAyD;AACzD,mEAA+D;AAC/D,uDAAmD;AACnD,+DAA2D;AAC3D,6DAAyD;AACzD,+DAA2D;AAE9C,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,iEAAiE;IAC9E,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,sDAAsD;IAC/D,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,EAAE,sBAAa,CAAC,iBAAiB,CAAC;IAC5E,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,IAAI,EAAE,uBAAgB;IACtB,OAAO,EAAE;QACL,0BAAW;QACX,gCAAc;QACd,oBAAQ;QACR,4BAAY;QACZ,0BAAW;QACX,4BAAY;QACZ,IAAA,yCAAyB,EAAC;YACtB,OAAO,EAAE,GAAG,EAAE,CAAC,iCAAiC;YAChD,IAAI,EAAE,uBAAgB;YACtB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC1B,aAAa,EAAE,UAAU,IAAI,EAAE;iBAClC,CAAC,CAAA;cAAA;SACL,CAAC;KACL;IACD,QAAQ,EAAE,CAAC,gBAAM,EAAE,0BAAW,EAAE,sBAAS,CAAC;CAC7C,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const archiveFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
import_method: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
+
files: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
4
|
+
output_format: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
|
+
filename: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
engine: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
7
|
+
engine_version: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
timeout: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
+
wait_for_completion: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
10
|
+
store_file: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.archiveFile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
9
|
+
const archiveFileProps = () => ({
|
|
10
|
+
import_method: pieces_framework_2.Property.StaticDropdown({
|
|
11
|
+
displayName: 'Import Method',
|
|
12
|
+
description: 'How to import the files for archiving',
|
|
13
|
+
required: true,
|
|
14
|
+
options: {
|
|
15
|
+
options: [
|
|
16
|
+
{ label: 'File Upload', value: 'upload' },
|
|
17
|
+
{ label: 'File URL', value: 'url' },
|
|
18
|
+
{ label: 'Stored File ID', value: 'stored_file' },
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
defaultValue: 'upload'
|
|
22
|
+
}),
|
|
23
|
+
files: pieces_framework_2.Property.Array({
|
|
24
|
+
displayName: 'Files to Archive',
|
|
25
|
+
description: 'List of files to include in the archive',
|
|
26
|
+
required: true,
|
|
27
|
+
properties: {
|
|
28
|
+
url: pieces_framework_2.Property.ShortText({
|
|
29
|
+
displayName: 'File URL',
|
|
30
|
+
description: 'URL of the file to archive',
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
file: pieces_framework_2.Property.File({
|
|
34
|
+
displayName: 'File',
|
|
35
|
+
description: 'File to upload and archive',
|
|
36
|
+
required: false,
|
|
37
|
+
}),
|
|
38
|
+
stored_file_id: pieces_framework_2.Property.ShortText({
|
|
39
|
+
displayName: 'Stored File ID',
|
|
40
|
+
description: 'ID of a previously stored file in Activepieces to archive',
|
|
41
|
+
required: false,
|
|
42
|
+
}),
|
|
43
|
+
filename: pieces_framework_2.Property.ShortText({
|
|
44
|
+
displayName: 'Filename in Archive',
|
|
45
|
+
description: 'Optional filename for this file within the archive',
|
|
46
|
+
required: false,
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
output_format: pieces_framework_2.Property.StaticDropdown({
|
|
51
|
+
displayName: 'Archive Format',
|
|
52
|
+
description: 'The archive format to create',
|
|
53
|
+
required: true,
|
|
54
|
+
options: {
|
|
55
|
+
options: [
|
|
56
|
+
{ label: 'ZIP', value: 'zip' },
|
|
57
|
+
{ label: 'RAR', value: 'rar' },
|
|
58
|
+
{ label: '7Z', value: '7z' },
|
|
59
|
+
{ label: 'TAR', value: 'tar' },
|
|
60
|
+
{ label: 'TAR.GZ', value: 'targz' },
|
|
61
|
+
{ label: 'TAR.BZ2', value: 'tarbz2' },
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
defaultValue: 'zip'
|
|
65
|
+
}),
|
|
66
|
+
filename: pieces_framework_2.Property.ShortText({
|
|
67
|
+
displayName: 'Archive Filename',
|
|
68
|
+
description: 'Choose a filename (including extension) for the archive file',
|
|
69
|
+
required: false,
|
|
70
|
+
defaultValue: 'archive.zip'
|
|
71
|
+
}),
|
|
72
|
+
engine: pieces_framework_2.Property.StaticDropdown({
|
|
73
|
+
displayName: 'Engine',
|
|
74
|
+
description: 'Use a specific engine for the archiving',
|
|
75
|
+
required: false,
|
|
76
|
+
options: {
|
|
77
|
+
options: [
|
|
78
|
+
{ label: '7-Zip', value: '7z' },
|
|
79
|
+
{ label: 'Archive Tool (Default)', value: 'archivetool' },
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
engine_version: pieces_framework_2.Property.ShortText({
|
|
84
|
+
displayName: 'Engine Version',
|
|
85
|
+
description: 'Use a specific engine version for the archiving',
|
|
86
|
+
required: false,
|
|
87
|
+
}),
|
|
88
|
+
timeout: pieces_framework_2.Property.Number({
|
|
89
|
+
displayName: 'Timeout (seconds)',
|
|
90
|
+
description: 'Timeout in seconds after which the task will be cancelled',
|
|
91
|
+
required: false,
|
|
92
|
+
}),
|
|
93
|
+
wait_for_completion: pieces_framework_2.Property.Checkbox({
|
|
94
|
+
displayName: 'Wait for Completion',
|
|
95
|
+
description: 'Wait for the archive creation to complete before returning',
|
|
96
|
+
required: true,
|
|
97
|
+
defaultValue: true,
|
|
98
|
+
}),
|
|
99
|
+
store_file: pieces_framework_2.Property.Checkbox({
|
|
100
|
+
displayName: 'Store File',
|
|
101
|
+
description: 'Download and store the created archive in Activepieces',
|
|
102
|
+
required: false,
|
|
103
|
+
defaultValue: true,
|
|
104
|
+
}),
|
|
105
|
+
});
|
|
106
|
+
exports.archiveFile = (0, pieces_framework_1.createAction)({
|
|
107
|
+
name: 'archive_file',
|
|
108
|
+
displayName: 'Archive File',
|
|
109
|
+
description: 'Creates a ZIP, RAR, 7Z, TAR, TAR.GZ or TAR.BZ2 archive',
|
|
110
|
+
auth: common_1.cloudconvertAuth,
|
|
111
|
+
requireAuth: true,
|
|
112
|
+
props: archiveFileProps(),
|
|
113
|
+
run(context) {
|
|
114
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
116
|
+
yield common_1.archiveFileSchema.parseAsync(context.propsValue);
|
|
117
|
+
const { import_method, files, output_format, filename, engine, engine_version, timeout, wait_for_completion, store_file } = context.propsValue;
|
|
118
|
+
if (!files || files.length === 0) {
|
|
119
|
+
throw new Error('At least one file is required to create an archive');
|
|
120
|
+
}
|
|
121
|
+
const client = new common_1.CloudConvertClient(context.auth);
|
|
122
|
+
try {
|
|
123
|
+
const jobTasks = {};
|
|
124
|
+
files.forEach((file, index) => {
|
|
125
|
+
var _a;
|
|
126
|
+
const taskName = `import-file-${index + 1}`;
|
|
127
|
+
if (import_method === 'url') {
|
|
128
|
+
if (!file.url) {
|
|
129
|
+
throw new Error(`File URL is required for file ${index + 1} when using URL import method`);
|
|
130
|
+
}
|
|
131
|
+
jobTasks[taskName] = Object.assign({ operation: 'import/url', url: file.url }, (file.filename && { filename: file.filename }));
|
|
132
|
+
}
|
|
133
|
+
else if (import_method === 'stored_file') {
|
|
134
|
+
if (!file.stored_file_id) {
|
|
135
|
+
throw new Error(`Stored File ID is required for file ${index + 1} when using stored file import method`);
|
|
136
|
+
}
|
|
137
|
+
if (!((_a = context.server) === null || _a === void 0 ? void 0 : _a.apiUrl)) {
|
|
138
|
+
throw new Error('Server API URL is not available. Please check your Activepieces server configuration.');
|
|
139
|
+
}
|
|
140
|
+
const baseUrl = context.server.apiUrl.replace(/\/$/, '');
|
|
141
|
+
const fileUrl = `${baseUrl}/v1/step-files/${file.stored_file_id}`;
|
|
142
|
+
try {
|
|
143
|
+
new URL(fileUrl);
|
|
144
|
+
}
|
|
145
|
+
catch (urlError) {
|
|
146
|
+
throw new Error(`Invalid file URL constructed: ${fileUrl}. URL Error: ${urlError instanceof Error ? urlError.message : String(urlError)}`);
|
|
147
|
+
}
|
|
148
|
+
jobTasks[taskName] = Object.assign({ operation: 'import/url', url: fileUrl }, (file.filename && { filename: file.filename }));
|
|
149
|
+
}
|
|
150
|
+
else if (import_method === 'upload') {
|
|
151
|
+
if (!file.file || !file.file.base64) {
|
|
152
|
+
throw new Error(`Please select a file to upload for file ${index + 1}`);
|
|
153
|
+
}
|
|
154
|
+
throw new Error('Upload method for multiple files is not yet supported with the new job format. Please use URL or stored file methods.');
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
throw new Error('Invalid import method selected');
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
// Collect all import task names
|
|
161
|
+
const importTaskNames = files.map((_, index) => `import-file-${index + 1}`);
|
|
162
|
+
// Archive task
|
|
163
|
+
const archiveOptions = {
|
|
164
|
+
input: importTaskNames.length === 1 ? importTaskNames[0] : importTaskNames,
|
|
165
|
+
output_format,
|
|
166
|
+
};
|
|
167
|
+
if (filename)
|
|
168
|
+
archiveOptions.filename = filename;
|
|
169
|
+
if (engine)
|
|
170
|
+
archiveOptions.engine = engine;
|
|
171
|
+
if (engine_version)
|
|
172
|
+
archiveOptions.engine_version = engine_version;
|
|
173
|
+
if (timeout)
|
|
174
|
+
archiveOptions.timeout = timeout;
|
|
175
|
+
jobTasks['archive-files'] = Object.assign({ operation: 'archive' }, archiveOptions);
|
|
176
|
+
// Export task
|
|
177
|
+
jobTasks['export-file'] = {
|
|
178
|
+
operation: 'export/url',
|
|
179
|
+
input: 'archive-files'
|
|
180
|
+
};
|
|
181
|
+
const job = yield client.createJob(jobTasks, `archive-${Date.now()}`);
|
|
182
|
+
if (wait_for_completion) {
|
|
183
|
+
let attempts = 0;
|
|
184
|
+
const maxAttempts = 60;
|
|
185
|
+
while (attempts < maxAttempts) {
|
|
186
|
+
const currentJob = yield client.getJob(job.id);
|
|
187
|
+
if (currentJob.status === 'finished') {
|
|
188
|
+
// Find the export task by name in the job
|
|
189
|
+
const exportTaskData = (_a = currentJob.tasks) === null || _a === void 0 ? void 0 : _a.find((task) => task.name === 'export-file');
|
|
190
|
+
const downloadUrl = (_d = (_c = (_b = exportTaskData === null || exportTaskData === void 0 ? void 0 : exportTaskData.result) === null || _b === void 0 ? void 0 : _b.files) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.url;
|
|
191
|
+
const outputFilename = ((_g = (_f = (_e = exportTaskData === null || exportTaskData === void 0 ? void 0 : exportTaskData.result) === null || _e === void 0 ? void 0 : _e.files) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.filename) || `archive.${output_format}`;
|
|
192
|
+
let storedFileId;
|
|
193
|
+
if (store_file && downloadUrl) {
|
|
194
|
+
try {
|
|
195
|
+
const fileResponse = yield pieces_common_1.httpClient.sendRequest({
|
|
196
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
197
|
+
url: downloadUrl,
|
|
198
|
+
});
|
|
199
|
+
if (fileResponse.status === 200 && fileResponse.body) {
|
|
200
|
+
let fileData;
|
|
201
|
+
if (typeof fileResponse.body === 'string') {
|
|
202
|
+
fileData = Buffer.from(fileResponse.body, 'binary');
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
fileData = Buffer.from(fileResponse.body);
|
|
206
|
+
}
|
|
207
|
+
storedFileId = yield context.files.write({
|
|
208
|
+
data: fileData,
|
|
209
|
+
fileName: outputFilename,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
// Continue without throwing
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
job: currentJob,
|
|
219
|
+
download_url: downloadUrl,
|
|
220
|
+
filename: outputFilename,
|
|
221
|
+
stored_file_id: storedFileId,
|
|
222
|
+
file_count: files.length,
|
|
223
|
+
output_format,
|
|
224
|
+
size: ((_k = (_j = (_h = exportTaskData === null || exportTaskData === void 0 ? void 0 : exportTaskData.result) === null || _h === void 0 ? void 0 : _h.files) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.size) || 0
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
else if (currentJob.status === 'error') {
|
|
228
|
+
throw new Error(`Archive job failed: ${currentJob.message || 'Unknown error'}`);
|
|
229
|
+
}
|
|
230
|
+
yield new Promise(resolve => setTimeout(resolve, 5000));
|
|
231
|
+
attempts++;
|
|
232
|
+
}
|
|
233
|
+
throw new Error('Archive creation did not complete within the timeout period');
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
job,
|
|
237
|
+
file_count: files.length,
|
|
238
|
+
output_format,
|
|
239
|
+
status: 'processing'
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
if (error instanceof Error) {
|
|
244
|
+
throw error;
|
|
245
|
+
}
|
|
246
|
+
throw new Error(`Archive creation failed: ${String(error)}`);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
//# sourceMappingURL=archive-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cloudconvert/src/lib/actions/archive-file.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAsF;AACtF,sCAAoF;AACpF,qEAA0D;AAE1D,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,aAAa,EAAE,2BAAQ,CAAC,cAAc,CAAC;QACrC,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,uCAAuC;QACpD,QAAQ,EAAE,IAAI;QACd,OAA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,CAAC;oBACzB,MAAM,KAAK,CAAC;gBAChB,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACjE,CAAC;QACL,CAAC;KAAA;CAGJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const captureWebsite: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
output_format: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
pages: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
zoom: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
|
+
page_width: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
7
|
+
page_height: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
8
|
+
page_format: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
9
|
+
page_orientation: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
10
|
+
margin_top: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
11
|
+
margin_bottom: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
12
|
+
margin_left: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
+
margin_right: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
14
|
+
print_background: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
15
|
+
display_header_footer: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
+
header_template: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
17
|
+
footer_template: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
18
|
+
wait_until: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
19
|
+
wait_for_element: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
20
|
+
wait_time: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
21
|
+
css_media_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
22
|
+
filename: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
23
|
+
engine: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
24
|
+
engine_version: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
25
|
+
timeout: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
26
|
+
wait_for_completion: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
27
|
+
store_file: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
28
|
+
}>;
|