@openfn/language-kobotoolbox 4.3.2 → 4.3.4

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Language KoboToolbox
1
+ # language-kobotoolbox <img src='./assets/square.png' width="30" height="30"/>
2
2
 
3
3
  Language Pack for building expressions and operations to interact with the
4
4
  [TEMPLATE] API.
package/dist/index.cjs CHANGED
@@ -94,6 +94,12 @@ async function request(state, method, path, opts = {}) {
94
94
  parseAs = "json",
95
95
  maxRedirections
96
96
  } = opts;
97
+ const isAbsoluteUrl = /^(https?:|\/\/)/i.test(path);
98
+ if (isAbsoluteUrl) {
99
+ throw new Error(
100
+ `Invalid path argument: "${path}" appears to be an absolute URL. Please provide a relative path`
101
+ );
102
+ }
97
103
  const requestPath = `/api/${apiVersion}/${path}/`;
98
104
  const authHeaders = (0, import_util.makeBasicAuthHeader)(username, password);
99
105
  const options = {
package/dist/index.js CHANGED
@@ -60,6 +60,12 @@ async function request(state, method, path, opts = {}) {
60
60
  parseAs = "json",
61
61
  maxRedirections
62
62
  } = opts;
63
+ const isAbsoluteUrl = /^(https?:|\/\/)/i.test(path);
64
+ if (isAbsoluteUrl) {
65
+ throw new Error(
66
+ `Invalid path argument: "${path}" appears to be an absolute URL. Please provide a relative path`
67
+ );
68
+ }
63
69
  const requestPath = `/api/${apiVersion}/${path}/`;
64
70
  const authHeaders = makeBasicAuthHeader(username, password);
65
71
  const options = {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openfn/language-kobotoolbox",
3
3
  "label": "KoboToolbox",
4
- "version": "4.3.2",
4
+ "version": "4.3.4",
5
5
  "description": "OpenFn adaptor for KoboToolbox",
6
6
  "homepage": "https://docs.openfn.org",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/openfn/adaptors.git"
9
+ "url": "https://github.com/OpenFn/adaptors.git"
10
10
  },
11
11
  "main": "dist/index.cjs",
12
12
  "author": "Open Function Group",
@@ -18,7 +18,7 @@
18
18
  "configuration-schema.json"
19
19
  ],
20
20
  "dependencies": {
21
- "@openfn/language-common": "3.3.4"
21
+ "@openfn/language-common": "3.3.5"
22
22
  },
23
23
  "devDependencies": {
24
24
  "assertion-error": "^1.0.1",