-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Sinch - new components #18635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sinch - new components #18635
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds 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
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)
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)
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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
, andeventTime
, sogenerateMeta
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 ensureDate.parse(event.eventTime)
yields a number).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ 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()
. Therun()
method will throw a clearConfigurationError
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 fromdata.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
oridentity
(withchannel
) 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
: VerifydefaultForProject: true
behavior in multi-deployment scenarios.The
activate
hook setsdefaultForProject: 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* 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
Resolves #18627
Summary by CodeRabbit
New Features
Chores