Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Nov 24, 2025

Resolves #5700

Summary by CodeRabbit

  • New Features

    • Real-time webhook management (create/delete) for Paperform integrations.
    • Added instant event sources for new submissions and partial submissions, with sample test payloads for each.
  • Chores

    • Bumped component package version to 0.2.0 and source version to 0.0.2.

✏️ Tip: You can customize this high-level summary in your review settings.

…ment methods, and introduce new sources for form submissions and partial submissions.
@luancazarine luancazarine linked an issue Nov 24, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 25, 2025 0:22am
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 25, 2025 0:22am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Walkthrough

Adds webhook lifecycle support and two instant webhook-based triggers to the Paperform integration: "New form submission" and "New partial form submission." Introduces shared base for webhook activation/deactivation and extends the app with createHook and deleteHook methods; updates package and source versions.

Changes

Cohort / File(s) Summary
Package & Source Version Updates
components/paperform/package.json, components/paperform/sources/new-submission/new-submission.mjs
Bumps package version: @pipedream/paperform 0.1.0 → 0.2.0. Updates new-submission source version 0.0.1 → 0.0.2 (import reorder only).
App Webhook Management
components/paperform/paperform.app.mjs
Adds createHook({ formId, ...opts }) (POST /forms/{formId}/webhooks) and deleteHook(hookId) (DELETE /webhooks/{hookId}) using existing request helper.
Webhook Lifecycle Base Module
components/paperform/sources/common/base.mjs
New shared base component exposing props (paperform, db, http, formId), storage methods (_setWebhookId, _getWebhookId), lifecycle hooks (activate creates webhook; deactivate deletes webhook), and run({ body }) to emit events.
New Form Submission Instant Source
components/paperform/sources/new-form-submission-instant/new-form-submission-instant.mjs, components/paperform/sources/new-form-submission-instant/test-event.mjs
New source extending common base; defines metadata, getTriggers()["submission"], getSummary() for submissions, and includes a sample/test event payload.
New Partial Form Submission Instant Source
components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs, components/paperform/sources/new-partial-form-submission-instant/test-event.mjs
New source extending common base; defines metadata, getTriggers()["partial_submission"], getSummary() for partial submissions, and includes a sample/test event payload.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Source as "Submission Source"
    participant App as "Paperform App"
    participant DB as "DB"
    participant Paperform as "Paperform API"
    participant Webhook as "Webhook Receiver"

    User->>Source: Activate
    Source->>App: createHook(formId, target_url, triggers)
    App->>Paperform: POST /forms/{formId}/webhooks
    Paperform-->>App: { id: webhookId, ... }
    App-->>Source: webhook created
    Source->>DB: _setWebhookId(webhookId)
    DB-->>Source: stored

    rect rgb(230,245,255)
      Note over Paperform,Webhook: Event delivery
      Paperform->>Webhook: POST event
      Webhook->>Source: run({ body })
      Source->>Source: parse body -> { id, summary, ts }
      Source-->>User: Emit event
    end

    User->>Source: Deactivate
    Source->>DB: _getWebhookId()
    DB-->>Source: webhookId
    Source->>App: deleteHook(webhookId)
    App->>Paperform: DELETE /webhooks/{webhookId}
    Paperform-->>App: success
    App-->>Source: removed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to inspect closely:
    • webhook create/delete request parameters and error handling in paperform.app.mjs
    • correct storage/retrieval of webhook ID in common/base.mjs (DB key consistency)
    • event run({ body }) shape and timestamp/id derivation across both sources
    • sample/test event payloads vs. actual API shapes used in parsing and getSummary implementations

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal and only references the issue number without explaining the changes or WHY section from the template. Complete the description by adding a WHY section that explains the motivation, what new triggers were added, and how webhook integration works for this implementation.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main change: adding new Paperform triggers as specified in issue #5700.
Linked Issues check ✅ Passed The PR implements both requested triggers (new form submission and partial form submission) as specified in issue #5700, with proper webhook integration.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the two requested Paperform triggers; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 5700-trigger-new-paperform-triggers

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between adcbf53 and 28c9062.

📒 Files selected for processing (3)
  • components/paperform/sources/common/base.mjs (1 hunks)
  • components/paperform/sources/new-form-submission-instant/new-form-submission-instant.mjs (1 hunks)
  • components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.

Applied to files:

  • components/paperform/sources/new-form-submission-instant/new-form-submission-instant.mjs
  • components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs
  • components/paperform/sources/common/base.mjs
📚 Learning: 2025-07-09T18:07:12.426Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the `created_at` field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using `Date.parse()` before assigning to the `ts` field in `generateMeta()`.

Applied to files:

  • components/paperform/sources/common/base.mjs
🧬 Code graph analysis (1)
components/paperform/sources/common/base.mjs (1)
components/paperform/sources/new-submission/new-submission.mjs (1)
  • ts (60-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/paperform/sources/new-form-submission-instant/new-form-submission-instant.mjs (1)

1-24: LGTM!

Clean implementation that correctly extends the common base. The getTriggers() returns the appropriate webhook trigger type, and getSummary() properly destructures submission_id to provide a meaningful event summary. The dedupe: "unique" combined with submission_id as the event identifier ensures proper deduplication.

components/paperform/sources/common/base.mjs (1)

1-32: Well-structured base module for webhook sources.

The props definition, db accessor methods, and activate hook follow Pipedream's patterns for webhook-based sources. The base correctly expects subclasses to implement getTriggers() and getSummary() methods, consistent with the abstract base pattern used in other Pipedream components. Based on learnings, this intentional delegation to subclasses is the expected design.

components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs (1)

1-24: LGTM!

The implementation correctly extends the common base and configures the "partial_submission" trigger type. Structure follows the established pattern for Pipedream webhook sources.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b973300 and adcbf53.

📒 Files selected for processing (8)
  • components/paperform/package.json (1 hunks)
  • components/paperform/paperform.app.mjs (1 hunks)
  • components/paperform/sources/common/base.mjs (1 hunks)
  • components/paperform/sources/new-form-submission-instant/new-form-submission-instant.mjs (1 hunks)
  • components/paperform/sources/new-form-submission-instant/test-event.mjs (1 hunks)
  • components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs (1 hunks)
  • components/paperform/sources/new-partial-form-submission-instant/test-event.mjs (1 hunks)
  • components/paperform/sources/new-submission/new-submission.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.

Applied to files:

  • components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.

Applied to files:

  • components/paperform/sources/new-partial-form-submission-instant/new-partial-form-submission-instant.mjs
  • components/paperform/sources/common/base.mjs
  • components/paperform/paperform.app.mjs
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.

Applied to files:

  • components/paperform/sources/new-form-submission-instant/test-event.mjs
🧬 Code graph analysis (1)
components/paperform/sources/common/base.mjs (1)
components/paperform/sources/new-submission/new-submission.mjs (1)
  • ts (60-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (5)
components/paperform/package.json (1)

3-3: LGTM! Version bump is appropriate.

The minor version increment correctly reflects the addition of new webhook management methods and event sources.

components/paperform/sources/new-submission/new-submission.mjs (1)

8-8: LGTM! Version bump maintains consistency.

The patch version increment aligns with the package-level minor version bump.

components/paperform/paperform.app.mjs (1)

52-60: LGTM! Webhook creation method is well-structured.

The method correctly constructs the webhook endpoint path and uses the POST method for resource creation.

components/paperform/sources/new-form-submission-instant/new-form-submission-instant.mjs (1)

1-24: LGTM! Clean implementation of the new submission trigger.

The source correctly extends the common base and implements the required abstract methods (getTriggers and getSummary). The webhook trigger type "submission" aligns with Paperform's API.

components/paperform/sources/new-partial-form-submission-instant/test-event.mjs (1)

1-27: LGTM! Test data accurately represents partial submissions.

The null values for submission_id, created_at, ip_address, and charge appropriately reflect that partial submissions are incomplete and lack finalized metadata.

@vunguyenhung
Copy link
Collaborator

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@luancazarine luancazarine merged commit 06100cb into master Nov 27, 2025
10 checks passed
@luancazarine luancazarine deleted the 5700-trigger-new-paperform-triggers branch November 27, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRIGGER] New Paperform Triggers

4 participants