OpenFn / adaptors

The new home for OpenFn adaptors; re-usable connectors for the most common DPGs and DPI building blocks.
GNU General Public License v3.0
4 stars 8 forks source link

salesforce: add generic HTTP helpers #668

Open josephjclark opened 2 weeks ago

josephjclark commented 2 weeks ago

Salesforce exposes request which enables a low-level HTTP request to be made to the salesforce API directly.

The old 4.8 salesforce also exported axios directly (maybe common http too?)

The new API does not.

We need to work out how to expose a generic set of HTTP helpers to call external services. It is critical that these helper do not append salesforce credentials

This may be related to the util pattern #522 . We could export standard functions on util.request. Or we could export a http namespace and have operations like http.get. Maybe even both.

A more seamless API would be to expose a single API (request/get/post) use jsforce.request for relative urls, and common.http for any other absolute URL. The worry there is that the return and error handling are likely to be different - how important is that, and can we consolidate?