Skip to content

[Twilio] Refactor SendSMS, add success/error child nodes, update deps…#897

Open
alexteusz wants to merge 1 commit into
masterfrom
feature/twilio-extension-update
Open

[Twilio] Refactor SendSMS, add success/error child nodes, update deps…#897
alexteusz wants to merge 1 commit into
masterfrom
feature/twilio-extension-update

Conversation

@alexteusz
Copy link
Copy Markdown
Member

Summary

Refreshes the long-untouched Twilio extension: refactors the SendSMS node, updates
dependencies, and adds On Success / On Error child nodes (following the createCase.ts
pattern from the Salesforce extension).

Changes

Dependencies (version 4.0.1 → 4.1.0)

  • @cognigy/extension-tools ^0.13.0 → ^0.17.0
  • axios ^0.21.2 → ^1.13.5
  • typescript ^3.8.3 → ^4.9.5, @types/node → ^18.19.0
  • Removed qs and @types/axios (native URLSearchParams now), tslint moved to devDeps, lockfile regenerated

Connection — migrated to API-Key auth (apiKeySid / apiKeySecret / accountSid)

SendSMS node

  • Fixed broken auth (node still read accountSid/authToken after the connection changed)
  • Removed dead Authorization: 'Basic ' header
  • Moved validation into try/catch so failures route to the error branch
  • Added onSuccessSendSMS / onErrorSendSMS child nodes; error branch stores the upstream Twilio payload

Other — module.ts registers child nodes; tsconfig adds esModuleInterop; README updated.

⚠️ Breaking change

Existing users must recreate their Twilio connection with an API Key (SID + Secret) + Account SID.

Verification

npm run build (transpile + tslint + zip) passes cleanly.

… (4.1.0)

- Update dependencies: extension-tools 0.13->0.17, axios 0.21->1.x,
  typescript 3.8->4.9, @types/node 13->18; drop qs and @types/axios
- Migrate connection to API Key auth (apiKeySid/apiKeySecret/accountSid)
- Refactor sendSMS: fix broken auth, move validation into try/catch,
  replace qs with built-in URLSearchParams, remove dead Authorization header
- Add onSuccessSendSMS / onErrorSendSMS child nodes (createCase pattern)
- Register child nodes in module.ts
- Add esModuleInterop and proper include/exclude to tsconfig
- Update README for new connection fields and child node branches

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 09:00
@graymalkin77
Copy link
Copy Markdown

graymalkin77 commented May 29, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refreshes the Twilio extension by migrating to API-Key authentication, refactoring the sendSMS node to add onSuccess/onError child nodes (following the Salesforce createCase pattern), modernizing dependencies (axios v1, native URLSearchParams, TS 4.9), and updating the README accordingly. This is a breaking change requiring users to recreate their Twilio connection.

Changes:

  • Connection schema migrated from accountSid/authToken to apiKeySid/apiKeySecret/accountSid; sendSMS updated to use Axios basic auth with the API key and removes the dead Authorization: 'Basic ' header.
  • Validation moved inside try/catch so failures route to the new onErrorSendSMS child; success routes to onSuccessSendSMS; results stored via a unified storeResult helper.
  • Dependencies bumped (@cognigy/extension-tools 0.17, axios 1.x, TS 4.9, @types/node 18), qs and @types/axios removed, tslint moved to devDeps, lockfile regenerated; tsconfig adds esModuleInterop and include/exclude; README/version updated.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extensions/twilio/src/connections/twilioConnection.ts Replaces authToken with apiKeySid/apiKeySecret, retains accountSid.
extensions/twilio/src/nodes/sendSMS.ts Refactor: new auth fields, native URLSearchParams, unified storeResult, success/error child nodes, validation inside try/catch.
extensions/twilio/src/module.ts Registers the new onSuccessSendSMS and onErrorSendSMS child nodes.
extensions/twilio/README.md Documents API-Key auth fields, child nodes, corrects tobody description.
extensions/twilio/tsconfig.json Adds esModuleInterop, include/exclude, drops obsolete watch.
extensions/twilio/package.json Bumps version to 4.1.0; updates deps (axios 1.x, TS 4.9); removes qs/@types/axios; moves tslint to devDeps.
extensions/twilio/package-lock.json Regenerated lockfile (v3) reflecting new deps.
Files not reviewed (1)
  • extensions/twilio/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants