@openfn/language-http 7.2.8 → 7.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -126,13 +126,6 @@ function addAuth(configuration, headers) {
126
126
  Object.assign(headers, (0, import_util.makeBasicAuthHeader)(username, password));
127
127
  }
128
128
  }
129
- function encodeFormBody(data) {
130
- const form = new FormData();
131
- for (const [key, value] of Object.entries(data)) {
132
- form.append(key, value);
133
- }
134
- return form;
135
- }
136
129
  function getTLSOptions(state, requestOptions) {
137
130
  const { tls: tlsConfig } = state.configuration || {};
138
131
  const tls = requestOptions.tls ?? requestOptions.agentOptions ?? tlsConfig;
@@ -175,7 +168,7 @@ function request(method, path, params) {
175
168
  if (contentType === "form") {
176
169
  delete headers[contentTypeHeader];
177
170
  headers = { ...headers };
178
- body = encodeFormBody(body);
171
+ body = (0, import_util.encodeFormBody)(body);
179
172
  } else if (contentTypeHeader) {
180
173
  headers = { ...headers };
181
174
  } else {
package/dist/index.js CHANGED
@@ -58,6 +58,7 @@ import {
58
58
  request as commonRequest,
59
59
  makeBasicAuthHeader,
60
60
  expandReferences,
61
+ encodeFormBody,
61
62
  logResponse,
62
63
  encode,
63
64
  decode,
@@ -76,13 +77,6 @@ function addAuth(configuration, headers) {
76
77
  Object.assign(headers, makeBasicAuthHeader(username, password));
77
78
  }
78
79
  }
79
- function encodeFormBody(data) {
80
- const form = new FormData();
81
- for (const [key, value] of Object.entries(data)) {
82
- form.append(key, value);
83
- }
84
- return form;
85
- }
86
80
  function getTLSOptions(state, requestOptions) {
87
81
  const { tls: tlsConfig } = state.configuration || {};
88
82
  const tls = requestOptions.tls ?? requestOptions.agentOptions ?? tlsConfig;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfn/language-http",
3
3
  "label": "HTTP",
4
- "version": "7.2.8",
4
+ "version": "7.2.9",
5
5
  "description": "An HTTP request language package for use with Open Function",
6
6
  "homepage": "https://docs.openfn.org",
7
7
  "repository": {
@@ -29,11 +29,14 @@
29
29
  "dependencies": {
30
30
  "cheerio": "1.0.0-rc.12",
31
31
  "cheerio-tableparser": "^1.0.1",
32
- "@openfn/language-common": "3.2.3"
32
+ "@openfn/language-common": "3.3.0"
33
33
  },
34
34
  "devDependencies": {
35
+ "@koa/router": "^13.1.0",
35
36
  "chai": "^4.3.10",
37
+ "koa-body": "^6.0.1",
36
38
  "deep-eql": "4.1.1",
39
+ "koa": "^3.1.2",
37
40
  "mocha-suppress-logs": "^0.4.1",
38
41
  "rimraf": "^3.0.2"
39
42
  },