Skip to content

Commit

Permalink
Added actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lcaresia committed May 22, 2024
1 parent a831338 commit ce4983e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,14 @@ export default {
$,
data,
headers,
responseType: "arraybuffer",
});

$.export("$summary", `Successfully compressed the files into '${this.archiveName}.zip'`);

const tmpPath = `/tmp/${this.archiveName}`;
fs.writeFileSync(tmpPath, response);

return {
tmpPath,
data: response,
};
$.export("$summary", `Successfully compressed the files into '${tmpPath}'`);

return tmpPath;
},
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import app from "../../zip_archive_api.app.mjs";
import fs from "fs";

export default {
key: "zip_archive_api-extract-files",
name: "Extract Files",
description: "Extract the files from an archive. [See the documentation](https://archiveapi.com/rest-api/archive-extraction/)",
version: "0.0.1",
version: "0.0.{{ts}}",
type: "action",
props: {
app,
Expand All @@ -21,6 +20,11 @@ export default {
"password",
],
},
folder: {
type: "string",
label: "Folder",
description: "Folder to extract the files to",
},
},
async run({ $ }) {
const response = await this.app.extractFiles({
Expand All @@ -33,12 +37,6 @@ export default {

$.export("$summary", "Successfully extracted the files from the specified archive");

const tmpPath = "/tmp/extracted_files";
fs.writeFileSync(tmpPath, response);

return {
tmpPath,
data: response,
};
return response;
},
};

0 comments on commit ce4983e

Please sign in to comment.