Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Releases: OpenFn/language-http

Hide response body

09 Jul 22:17
Compare
Choose a tag to compare

To work alongside OpenFn.org's new :no_conosle feature, we hide server responses in language-http by default. The response body is added to state (usually in state.data) and can be accessed by console.log(state.data) or in a subsequent job state (from a flow or a timer job) if the project admin allows the use of console.log. This prevents the leakage of sensitive data to those who shouldn't see it but are granted OpenFn.org project access.

Fix content-type suggestion in inline documentation

08 Jul 20:23
Compare
Choose a tag to compare

The inline docs were displaying "content-type": "json", which isn't valid. Updated across functions to use "application/json":

/**
 * Make a POST request
 * @public
 * @example
 *  post("/myendpoint", {
 *      body: {"foo": "bar"},
 *      headers: {"content-type": "application/json"},
 *      authentication: {username: "user", password: "pass"},
 *    },
 *    function(state) {
 *      return state;
 *    }
 *  )
 * @function
 * @param {string} path - Path to resource
 * @param {object} params - Body, Query, Headers and Authentication parameters
 * @param {function} callback - (Optional) Callback function
 * @returns {Operation}
 */

Hide params in log

23 Apr 15:29
Compare
Choose a tag to compare

v.2.4.4 exposed params, which is bad for shared accounts!

Re-releasing for Node6 compatibility

22 Apr 00:48
Compare
Choose a tag to compare

Removes parseCSV until a Node6 compatible function is written.

keep headers with keepCookies option

15 Apr 03:29
Compare
Choose a tag to compare

The keepCookies option allows for different auth schemes. By defaulting to also keep headers for later use, we can enable token auth with a post('/api/auth/sign_in', {params}, get({headers: state.data.__headers}) pattern

allow options with successCodes

11 Dec 15:26
Compare
Choose a tag to compare
  post('/manage/person', {
    formData: state => {
      state.person.submit_type = 'save';
      return state.person;
    },
    options: {
      successCodes: [302],
    },
  })

allow use of formData

06 Dec 15:47
Compare
Choose a tag to compare

and upgrade to language-common#v0.3.0

raw request function exported

23 May 16:14
Compare
Choose a tag to compare

stringify server response

28 Mar 12:07
Compare
Choose a tag to compare
v2.1.2

fuller logs

increase verbosity of server responses

28 Mar 10:03
Compare
Choose a tag to compare

@santiagogak , I only made changes to the logs... return response instead of just response.status.

I was setting up a new project and found that in order to determine the error I had to go in and modify the language package. Not everyone has that option, so let's err on the side of verbosity.