Commit 32b380f
authored
improvement(salesforce): align tools + block with Salesforce API and harden CRUD/analytics (#5040)
* improvement(salesforce): align tools + block with Salesforce API and harden CRUD/analytics
- Migrate all 4 Account tools to shared getInstanceUrl + extractErrorMessage helpers (drop ~40 lines of inlined idToken decode per file)
- Use extractErrorMessage consistently across every CRUD tool; add loggers to the opportunity tools
- Trim ID path params on all update/delete/single-get tools; URL-encode single-record field lists
- Fix dashboard tools: read name/metadata from dashboardMetadata.attributes (was always null); refresh now returns status/statusUrl defensively; drop no-op list_dashboards folderName filter
- Expose update_case origin/contact/account and update_task who/what fields end-to-end
- Block: mark create-required (Name, LastName, Company, StageName, Subject) and update/delete IDs conditionally required; add account billing*/revenue/employees and contact mailing*/department subBlocks; convert includeDetails to a Yes/No dropdown; move optional fields to advanced mode
- Trim over-declared dashboard output types; make Task.Status optional
- Regenerate integration docs
* fix(salesforce): correct list/refresh response shapes per live API docs
- list_dashboards: GET /analytics/dashboards returns a bare top-level array, not a {dashboards} wrapper (fixes always-empty result)
- refresh_dashboard: statusUrl is returned at the top level of the PUT response, read it there first
- list_reports: the list resource only returns report name/id/url/describeUrl/instancesUrl, so drop the no-op folderName filter and match searchTerm on name only
Validated tool-by-tool against the live Salesforce REST/Analytics/Object-Reference docs (API v67.0).
* fix(salesforce): address Greptile/Cursor review
- Add shared requireId() guard so whitespace-only IDs fail fast instead of producing malformed /sobjects/Object/ empty-path requests (all update/delete/single-get tools)
- URL-encode the fields query value in get_opportunities and get_tasks single-record GETs (matching the other get_* tools)
- Reflect the Salesforce API success flag consistently across all create tools (success/created use data.success === true)
* fix(salesforce): trim echoed output IDs and relation reference IDs
- update/delete tools now return output.id from the trimmed ID so chained workflows never receive whitespace-padded IDs
- trim relation reference IDs (AccountId, ContactId, WhoId, WhatId) in create/update bodies to avoid Salesforce reference errors from copy-pasted whitespace
* fix(salesforce): trim accountId in update_contact body
Last remaining untrimmed relation reference ID — update_contact now trims AccountId like the other create/update tools.1 parent 1fdb43f commit 32b380f
38 files changed
Lines changed: 454 additions & 370 deletions
File tree
- apps
- docs/content/docs/en/integrations
- sim
- blocks/blocks
- lib/integrations
- tools/salesforce
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
574 | 577 | | |
575 | 578 | | |
576 | 579 | | |
| |||
678 | 681 | | |
679 | 682 | | |
680 | 683 | | |
| 684 | + | |
| 685 | + | |
681 | 686 | | |
682 | 687 | | |
683 | 688 | | |
| |||
720 | 725 | | |
721 | 726 | | |
722 | 727 | | |
723 | | - | |
724 | | - | |
| 728 | + | |
725 | 729 | | |
726 | 730 | | |
727 | 731 | | |
| |||
735 | 739 | | |
736 | 740 | | |
737 | 741 | | |
738 | | - | |
| 742 | + | |
739 | 743 | | |
740 | 744 | | |
741 | 745 | | |
| |||
818 | 822 | | |
819 | 823 | | |
820 | 824 | | |
821 | | - | |
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
| |||
852 | 855 | | |
853 | 856 | | |
854 | 857 | | |
855 | | - | |
| 858 | + | |
856 | 859 | | |
857 | 860 | | |
858 | 861 | | |
| |||
877 | 880 | | |
878 | 881 | | |
879 | 882 | | |
880 | | - | |
| 883 | + | |
| 884 | + | |
881 | 885 | | |
882 | | - | |
| 886 | + | |
883 | 887 | | |
884 | 888 | | |
885 | 889 | | |
| |||
0 commit comments