Skip to content

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Oct 3, 2025

Resolves #18627

Summary by CodeRabbit

  • New Features

    • Added “Send Fax” action with optional sender, header text, and retry settings.
    • Added “Send Message” action supporting contacts or channel identities across channels like WhatsApp, SMS, Messenger, Viber, and more.
    • New instant event sources: “New Fax Received” and “New Message Received.”
    • Improved UI with selectable App and Contact pickers.
  • Chores

    • Updated Sinch package to version 0.1.0 and added required dependencies.

Copy link

vercel bot commented Oct 3, 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 Oct 3, 2025 7:52pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 3, 2025 7:52pm

Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Walkthrough

Adds Sinch integrations: two actions (send message, send fax), two instant sources (new inbound message, new inbound fax) with activation/deactivation webhooks/services, shared constants, a common source base, and expanded app module with propDefinitions and HTTP helpers. Updates package.json with dependencies and version bump.

Changes

Cohort / File(s) Summary
Sinch App core (props + HTTP helpers)
components/sinch/sinch.app.mjs
Adds dynamic propDefinitions (appId, contactId). Implements request helpers and API methods: create/delete webhook, list apps/contacts, sendMessage, sendFax, create/delete fax service.
Actions: Messaging & Fax
components/sinch/actions/send-message/send-message.mjs, components/sinch/actions/send-fax/send-fax.mjs
New actions. Send Message builds payload based on contactId or channel+identity and calls Conversation API. Send Fax builds multipart FormData (file + fields) and calls Fax API.
Sources: Common base
components/sinch/sources/common/base.mjs
Introduces reusable base source: standard props, hook ID persistence, event emission via generateMeta, and a not-implemented generateMeta placeholder.
Source: New Message Received (Instant)
components/sinch/sources/new-message-received/new-message-received.mjs, components/sinch/sources/new-message-received/test-event.mjs
Webhook lifecycle: create/delete Conversation webhook; emits inbound message events; includes sample payload; dedupe unique; generateMeta implemented.
Source: New Fax Received (Instant)
components/sinch/sources/new-fax-received/new-fax-received.mjs, components/sinch/sources/new-fax-received/test-event.mjs
Service lifecycle: create/delete Fax service; emits incoming fax events; includes sample payload; dedupe unique; generateMeta implemented.
Common constants
components/sinch/common/constants.mjs
Adds CHANNELS array export for supported messaging channels.
Package metadata
components/sinch/package.json
Bumps version to 0.1.0; adds dependencies: @pipedream/platform, form-data.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Send Message Action
  participant SinchConv as Sinch Conversation API
  User->>Action: Provide appId, message, (contactId) or (channel+identity)
  Action->>Action: Validate inputs & build payload
  Action->>SinchConv: POST /messages:send
  SinchConv-->>Action: Response
  Action-->>User: Return response (summary exported)
Loading
sequenceDiagram
  autonumber
  actor User
  participant Action as Send Fax Action
  participant PD as getFileStreamAndMetadata
  participant SinchFax as Sinch Fax API
  User->>Action: Provide to, file, optional from/headerText/retryDelay
  Action->>PD: Resolve file stream + metadata
  Action->>Action: Build FormData payload
  Action->>SinchFax: POST /faxes (multipart/form-data)
  SinchFax-->>Action: Response
  Action-->>User: Return response (summary exported)
Loading
sequenceDiagram
  autonumber
  participant Source as New Message Received Source
  participant SinchConv as Sinch Conversation API
  participant HTTP as Source HTTP Endpoint
  participant Emitter as Pipedream Emitter
  rect rgba(200,230,255,0.2)
    note over Source,SinchConv: Activation
    Source->>SinchConv: POST /webhooks (target = HTTP.endpoint, trigger=MESSAGE_INBOUND)
    SinchConv-->>Source: webhook_id
  end
  SinchConv-->>HTTP: POST inbound event
  HTTP-->>Source: Event body
  Source->>Emitter: $emit(body, meta)
  rect rgba(255,230,200,0.2)
    note over Source,SinchConv: Deactivation
    Source->>SinchConv: DELETE /webhooks/{webhook_id}
    SinchConv-->>Source: 204
  end
Loading
sequenceDiagram
  autonumber
  participant Source as New Fax Received Source
  participant SinchFax as Sinch Fax API
  participant HTTP as Source HTTP Endpoint
  participant Emitter as Pipedream Emitter
  rect rgba(200,255,220,0.2)
    note over Source,SinchFax: Activation
    Source->>SinchFax: POST /services (target = HTTP.endpoint)
    SinchFax-->>Source: service_id
  end
  SinchFax-->>HTTP: POST INCOMING_FAX event
  HTTP-->>Source: Event body
  Source->>Emitter: $emit(body, meta)
  rect rgba(255,230,200,0.2)
    note over Source,SinchFax: Deactivation
    Source->>SinchFax: DELETE /services/{service_id}
    SinchFax-->>Source: 204
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I tap my paws—fax rings, messages fly,
Webhooks bloom under autumn sky.
Streams and forms, a carrot-typed plea,
“Deliver!” I whisper to Sinch and see—
Inbound pings nibble the quiet night,
Triggers hop, actions take flight. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description only contains a reference to resolving issue #18627 and does not follow the repository’s description template or include the required WHY section to explain the purpose and motivation of the changes. Please expand the description to follow the template by adding a WHY section that summarizes the motivation, scope, and impact of the new Sinch components.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Sinch - new components” concisely and accurately reflects the primary change, which is the addition of new Sinch actions and triggers, without extraneous details or ambiguity.
Linked Issues Check ✅ Passed The changes implement all requested features from issue #18627 by adding the Send Fax and Send Message actions and the New Message Received and New Fax Received triggers, fulfilling the API requirements specified in the linked issue.
Out of Scope Changes Check ✅ Passed All modifications are directly related to the Sinch integration, including new actions, triggers, helper methods, and necessary dependencies, with no unrelated or extraneous changes detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 issue-18627

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: 3

🧹 Nitpick comments (1)
components/sinch/sources/new-fax-received/new-fax-received.mjs (1)

32-41: Validated test-event payload; add defensive validation for production

  • The test fixture contains fax.id, fax.from, and eventTime, so generateMeta works as-is for tests.
  • To guard against unexpected or malformed webhook payloads in production, validate or default these fields (e.g. event.fax?.id ?? "", event.fax?.from ?? "unknown", and ensure Date.parse(event.eventTime) yields a number).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d62e552 and 4422059.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • components/sinch/actions/send-fax/send-fax.mjs (1 hunks)
  • components/sinch/actions/send-message/send-message.mjs (1 hunks)
  • components/sinch/common/constants.mjs (1 hunks)
  • components/sinch/package.json (2 hunks)
  • components/sinch/sinch.app.mjs (1 hunks)
  • components/sinch/sources/common/base.mjs (1 hunks)
  • components/sinch/sources/new-fax-received/new-fax-received.mjs (1 hunks)
  • components/sinch/sources/new-fax-received/test-event.mjs (1 hunks)
  • components/sinch/sources/new-message-received/new-message-received.mjs (1 hunks)
  • components/sinch/sources/new-message-received/test-event.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
components/sinch/sources/new-fax-received/new-fax-received.mjs (1)
components/sinch/sources/common/base.mjs (1)
  • event (22-22)
components/sinch/sources/new-message-received/new-message-received.mjs (1)
components/sinch/sources/common/base.mjs (1)
  • event (22-22)
components/sinch/actions/send-message/send-message.mjs (1)
components/sinch/actions/send-fax/send-fax.mjs (1)
  • response (77-81)
components/sinch/actions/send-fax/send-fax.mjs (1)
components/sinch/actions/send-message/send-message.mjs (1)
  • response (60-84)
components/sinch/sinch.app.mjs (3)
components/spotify/actions/get-album-tracks/get-album-tracks.mjs (1)
  • axios (53-56)
components/sinch/sources/new-message-received/new-message-received.mjs (1)
  • webhookId (36-36)
components/sinch/sources/new-fax-received/new-fax-received.mjs (1)
  • serviceId (24-24)
⏰ 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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (13)
components/sinch/package.json (1)

1-19: LGTM!

The version bump to 0.1.0 appropriately reflects the addition of new actions and sources. The dependencies are valid and secure according to current best practices.

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

1-28: LGTM!

This abstract base correctly enforces that subclasses must implement generateMeta(). The run() method will throw a clear ConfigurationError if the subclass forgets to override it, which is appropriate for this design pattern.

components/sinch/actions/send-fax/send-fax.mjs (1)

53-85: LGTM!

The FormData construction correctly handles file streams with proper metadata (contentType, knownLength, filename). Optional fields are conditionally appended, and the API call includes the necessary headers from data.getHeaders().

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

56-135: LGTM!

The _makeRequest() helper correctly constructs authenticated requests using the axios wrapper. All API methods properly specify their endpoints and HTTP verbs, aligning with the Sinch API documentation.

components/sinch/common/constants.mjs (1)

1-20: LGTM!

The CHANNELS constant provides a centralized list of supported messaging platforms, which is correctly exported for use by the send-message action.

components/sinch/sources/new-message-received/test-event.mjs (1)

1-20: LGTM!

The test fixture provides a realistic and valid message delivery report structure with properly formatted timestamps and all required fields.

components/sinch/actions/send-message/send-message.mjs (1)

51-87: LGTM!

The validation logic correctly enforces that either contactId or identity (with channel) must be provided. The payload construction properly handles both recipient types, and the message structure aligns with the Sinch API specification.

components/sinch/sources/new-fax-received/new-fax-received.mjs (3)

1-2: LGTM!

Import structure follows Pipedream component patterns correctly.


4-11: LGTM!

Component metadata follows Pipedream conventions with appropriate dedupe strategy and documentation link.


12-31: Verify defaultForProject: true behavior in multi-deployment scenarios.

The activate hook sets defaultForProject: true when creating the service. This means if multiple instances of this source are deployed, only the most recently activated instance will receive fax events. Confirm this is the intended behavior.

Consider whether users should be warned in the description or if this should be configurable via a prop.

components/sinch/sources/new-message-received/new-message-received.mjs (3)

1-2: LGTM!

Import structure follows Pipedream component patterns correctly.


4-20: LGTM!

Component metadata and props follow Pipedream conventions. The appId prop correctly uses propDefinition pattern.


21-43: LGTM!

Webhook lifecycle properly implemented with correct Sinch Conversation API usage and safe cleanup handling.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@GTFalcao GTFalcao merged commit 82f5551 into master Oct 3, 2025
10 checks passed
@GTFalcao GTFalcao deleted the issue-18627 branch October 3, 2025 20:33
verhovsky added a commit to verhovsky/pipedream that referenced this pull request Oct 6, 2025
* upstream/master:
  Adding app scaffolding for stackby
  Airtop new components (PipedreamHQ#18637)
  Sinch - new components (PipedreamHQ#18635)
  Mintlify - new components (PipedreamHQ#18519)
  Linear App - updates and new components (PipedreamHQ#18606)
  Merging pull request PipedreamHQ#18622
  Adding app scaffolding for airtop
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.

Actions and Triggers for Sinch
2 participants