Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/_3commas/_3commas.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/azure_storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"dependencies": {
"@pipedream/platform": "^3.2.5",
"mime-types": "^2.1.35",
"fast-xml-parser": "^5.5.7"
"fast-xml-parser": "^5.7.0"
}
}
2 changes: 1 addition & 1 deletion components/beeper/beeper.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/bokun/bokun.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/element/element.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/email_on_acid/email_on_acid.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/event_tickets/event_tickets.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
11 changes: 11 additions & 0 deletions components/filepost/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Overview

The FilePost API lets you upload files and get back permanent, fast CDN URLs in seconds. With Pipedream, you can integrate FilePost into any workflow to automate file hosting — upload images, PDFs, videos, or any binary data, retrieve file metadata, list your stored files, or delete files programmatically.

# Example Use Cases

- **Automated Screenshot Archiving**: Capture screenshots of web pages using a headless browser step, then upload them to FilePost to get a permanent CDN URL. Store the URL in a database (Supabase, Airtable, Google Sheets) for easy retrieval and sharing.

- **Email Attachment Hosting**: When a new email arrives with attachments in Gmail or Outlook, trigger a Pipedream workflow that uploads the attachments to FilePost and sends back a shareable CDN link via Slack or email.

- **AI-Generated Image Pipeline**: Generate images with OpenAI's DALL-E or Stability AI, upload the resulting binary to FilePost, and store the permanent CDN URL in Notion or post it to a Discord channel — all in one automated workflow.
31 changes: 31 additions & 0 deletions components/filepost/actions/delete-file/delete-file.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import filepost from "../../filepost.app.mjs";

export default {
key: "filepost-delete-file",
name: "Delete File",
description: "Delete an uploaded file from FilePost by its ID. [See the documentation](https://filepost.dev/docs#delete-file)",
version: "0.0.1",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
filepost,
fileId: {
propDefinition: [
filepost,
"fileId",
],
},
},
async run({ $ }) {
const response = await this.filepost.deleteFile({
$,
fileId: this.fileId,
});
$.export("$summary", `File ${this.fileId} deleted successfully.`);
return response;
},
};
31 changes: 31 additions & 0 deletions components/filepost/actions/get-file/get-file.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import filepost from "../../filepost.app.mjs";

export default {
key: "filepost-get-file",
name: "Get File",
description: "Retrieve details of a specific file by its ID. [See the documentation](https://filepost.dev/docs#get-file)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
filepost,
fileId: {
propDefinition: [
filepost,
"fileId",
],
},
},
async run({ $ }) {
const response = await this.filepost.getFile({
$,
fileId: this.fileId,
});
$.export("$summary", `Retrieved file: ${response.url}`);
return response;
},
};
42 changes: 42 additions & 0 deletions components/filepost/actions/list-files/list-files.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import filepost from "../../filepost.app.mjs";

export default {
key: "filepost-list-files",
name: "List Files",
description: "Retrieve a list of files uploaded to your FilePost account. [See the documentation](https://filepost.dev/docs#list-files)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
filepost,
page: {
type: "integer",
label: "Page",
description: "Page number to retrieve.",
default: 1,
optional: true,
},
perPage: {
type: "integer",
label: "Per Page",
description: "Number of results per page (max 100).",
default: 50,
optional: true,
},
},
async run({ $ }) {
const response = await this.filepost.listFiles({
$,
params: {
page: this.page,
per_page: this.perPage,
},
});
$.export("$summary", `Retrieved ${response.files?.length ?? 0} file(s).`);
return response;
},
};
53 changes: 53 additions & 0 deletions components/filepost/actions/upload-file/upload-file.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import filepost from "../../filepost.app.mjs";
import { getFileStreamAndMetadata } from "@pipedream/platform";
import FormData from "form-data";

export default {
key: "filepost-upload-file",
name: "Upload File",
description: "Upload a file from a path in `/tmp` or a public URL, and get back a permanent CDN URL. [See the documentation](https://filepost.dev/docs#upload)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
filepost,
filePathOrUrl: {
propDefinition: [
filepost,
"filePath",
],
},
syncDir: {
type: "dir",
accessMode: "read",
sync: true,
optional: true,
},
},
async run({ $ }) {
const input = this.filePathOrUrl.trim();
const form = new FormData();
const {
stream, metadata,
} = await getFileStreamAndMetadata(input);

form.append("file", stream, {
contentType: metadata.contentType,
knownLength: metadata.size,
filename: metadata.name,
});

const response = await this.filepost.uploadFile({
$,
data: form,
headers: form.getHeaders(),
});

$.export("$summary", `File uploaded successfully. CDN URL: ${response.url}`);
return response;
},
};
82 changes: 82 additions & 0 deletions components/filepost/filepost.app.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "filepost",
propDefinitions: {
fileId: {
type: "string",
label: "File ID",
description: "The unique ID of the uploaded file (the `file_id` field returned by the Upload File action). Obtain this from **List Files**",
async options({ page }) {
const { files } = await this.listFiles({
params: {
page: page + 1,
},
});
return files?.map(({
file_id: value, name: label,
}) => ({
label,
value,
})) || [];
},
},
filePath: {
type: "string",
label: "File Path or URL",
description: "A file path in `/tmp` (e.g. `/tmp/image.png`) or a public URL to upload to FilePost CDN.",
format: "file-ref",
},
},
methods: {
_apiKey() {
return this.$auth.api_key;
},
_baseUrl() {
return "https://filepost.dev/v1";
},
async _makeRequest({
$ = this, headers, ...opts
}) {
return axios($, {
baseURL: this._baseUrl(),
headers: {
...headers,
"X-API-Key": this._apiKey(),
},
...opts,
});
},
async uploadFile(opts = {}) {
return this._makeRequest({
method: "POST",
url: "/upload",
...opts,
});
},
async listFiles(opts = {}) {
return this._makeRequest({
url: "/files",
...opts,
});
},
async getFile({
fileId, ...opts
}) {
return this._makeRequest({
url: `/files/${fileId}`,
...opts,
});
},
async deleteFile({
fileId, ...opts
}) {
return this._makeRequest({
method: "DELETE",
url: `/files/${fileId}`,
...opts,
});
},
},
};
19 changes: 19 additions & 0 deletions components/filepost/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@pipedream/filepost",
"version": "0.1.0",
"description": "Pipedream FilePost Components",
"main": "filepost.app.mjs",
"keywords": [
"pipedream",
"filepost"
],
"homepage": "https://pipedream.com/apps/filepost",
"author": "Pipedream <support@pipedream.com> (https://www.pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.3.1",
"form-data": "^4.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import fitbit from "../../fitbit.app.mjs";

export default {
key: "fitbit-get-activity-summary",
name: "Get Activity Summary",
description: "Get a daily activity summary including calories, distance, and active minutes. [See the documentation](https://dev.fitbit.com/build/reference/web-api/activity/get-daily-activity-summary/)",
version: "0.0.2",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
fitbit,
date: {
propDefinition: [
fitbit,
"date",
],
},
},
async run({ $ }) {
const date = this.date || new Date()
.toISOString()
.slice(0, 10);
const response = await this.fitbit.getActivitySummary({
$,
date,
});

const summary = response?.summary ?? {};
const distanceByActivity = {};
for (const item of summary.distances || []) {
if (item?.activity) {
distanceByActivity[item.activity] = item.distance;
}
}

const veryActiveMinutes = summary.veryActiveMinutes ?? 0;
const fairlyActiveMinutes = summary.fairlyActiveMinutes ?? 0;
const lightlyActiveMinutes = summary.lightlyActiveMinutes ?? 0;

const activitySummary = {
date,
calories: {
out: summary.caloriesOut ?? null,
bmr: summary.caloriesBMR ?? null,
},
distance: {
total: distanceByActivity.total ?? null,
tracker: distanceByActivity.tracker ?? null,
logged: distanceByActivity.loggedActivities ?? null,
byActivity: distanceByActivity,
},
activeMinutes: {
very: veryActiveMinutes,
fairly: fairlyActiveMinutes,
lightly: lightlyActiveMinutes,
sedentary: summary.sedentaryMinutes ?? null,
total: veryActiveMinutes + fairlyActiveMinutes + lightlyActiveMinutes,
},
summary,
goals: response?.goals ?? null,
activities: response?.activities ?? [],
};

$.export("$summary", `Successfully retrieved Fitbit activity summary for ${date}.`);
return activitySummary;
},
};
Loading