Skip to content
Merged
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/paperform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/paperform",
"version": "0.1.0",
"version": "0.2.0",
"description": "Pipedream PaperForm Components",
"main": "paperform.app.mjs",
"keywords": [
Expand Down
15 changes: 15 additions & 0 deletions components/paperform/paperform.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ export default {
...opts,
});
},
createHook({
formId, ...opts
}) {
return this._makeRequest({
path: `/forms/${formId}/webhooks`,
method: "POST",
...opts,
});
},
deleteHook(hookId) {
return this._makeRequest({
path: `/webhooks/${hookId}`,
method: "DELETE",
});
},
listSubmissions({
formId, ...opts
}) {
Expand Down
50 changes: 50 additions & 0 deletions components/paperform/sources/common/base.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import paperform from "../../paperform.app.mjs";

export default {
props: {
paperform,
db: "$.service.db",
http: "$.interface.http",
formId: {
propDefinition: [
paperform,
"formId",
],
},
},
methods: {
_setWebhookId(id) {
this.db.set("webhookId", id);
},
_getWebhookId() {
return this.db.get("webhookId");
},
},
hooks: {
async activate() {
const { results: { webhook } } = await this.paperform.createHook({
formId: this.formId,
data: {
target_url: this.http.endpoint,
triggers: this.getTriggers(),
},
});
this._setWebhookId(webhook.id);
},
async deactivate() {
const webhookId = this._getWebhookId();
await this.paperform.deleteHook(webhookId);
},
},
async run({ body }) {
if (!body.form_id) {
return;
}
const ts = Date.parse(body.created_at || new Date());
this.$emit(body, {
id: body.submission_id || ts,
summary: this.getSummary(body),
ts,
});
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "paperform-new-form-submission-instant",
name: "New Form Submission (Instant)",
description: "Emit new event when a form is submitted. [See the documentation](https://paperform.readme.io/reference/createformwebhook)",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getTriggers() {
return [
"submission",
];
},
getSummary({ submission_id: id }) {
return `Form submission with ID ${id} received`;
},
},
sampleEmit,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
export default {
"data": [
{
"title": "How many paragraphs?",
"description": null,
"type": "dropdown",
"key": "f8quc",
"custom_key": null,
"value": "4"
},
{
"title": "Style of paragraph",
"description": null,
"type": "dropdown",
"key": "aluau",
"custom_key": null,
"value": "Medium"
}
],
"form_id": "6924bccaef650f4f4c0aabc7",
"slug": "q59luyjh",
"submission_id": "6924ca9a37b747c7b8025ffc",
"created_at": "2025-11-24 21:14:02",
"ip_address": "71.58.9.130",
"charge": {
"products": [],
"summary": "",
"discount": 0,
"discounted_subscriptions": [],
"coupon": false,
"total": 0,
"total_cents": 0,
"tax": 0,
"tax_percentage": 0,
"processing_fee": 0,
"authorize": null,
"receipt_email": false
},
"team_id": 505160,
"trigger": "submission",
"device": {
"type": "desktop",
"device": "WebKit",
"platform": "Windows",
"browser": "Edge",
"embedded": false,
"url": "https://q59luyjh.paperform.co/",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0",
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"utm_term": null,
"utm_content": null,
"ip_address": "12.34.56.789"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "paperform-new-partial-form-submission-instant",
name: "New Partial Form Submission (Instant)",
description: "Emit new event when a form is partially submitted. [See the documentation](https://paperform.readme.io/reference/createformwebhook)",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getTriggers() {
return [
"partial_submission",
];
},
getSummary() {
return "A new partial form submission was received";
},
},
sampleEmit,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default {
"data": [
{
"title": "How many paragraphs?",
"description": null,
"type": "dropdown",
"key": "f8quc",
"custom_key": null,
"value": "3"
},
{
"title": "Style of paragraph",
"description": null,
"type": "dropdown",
"key": "aluau",
"custom_key": null,
"value": "Long"
}
],
"form_id": "6924bccaef650f4f4c0aabc7",
"slug": "q59luyjh",
"submission_id": null,
"created_at": null,
"ip_address": null,
"charge": null,
"team_id": 505160
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paperform from "../../paperform.app.mjs";
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
import paperform from "../../paperform.app.mjs";

export default {
key: "paperform-new-submission",
name: "New Submission",
description: "Emit new event when a new submission is made on the specified form in Paperform. [See the documentation](https://paperform.readme.io/reference/listformsubmissions)",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
props: {
Expand Down
Loading