fetchfox-sdk 1.0.31 → 1.0.32
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/package.json +1 -1
- package/src/api.js +5 -9
- package/src/configure.js +1 -1
- package/src/detach.js +1 -1
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -18,16 +18,12 @@ const FetchFoxAPIError = class extends Error {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export const call = async (method, path, params) => {
|
|
21
|
+
const headers = { 'Content-Type': 'application/json' };
|
|
21
22
|
const key = apiKey(params);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Authorization: `Bearer ${key}`,
|
|
27
|
-
'Content-Type': 'application/json',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
23
|
+
if (key) {
|
|
24
|
+
headers['Authorization'] = `Bearer ${key}`;
|
|
25
|
+
}
|
|
26
|
+
const args = { method, headers };
|
|
31
27
|
let url = endpoint(path, params);
|
|
32
28
|
if (method == 'GET') {
|
|
33
29
|
const clean = {};
|
package/src/configure.js
CHANGED
|
@@ -26,6 +26,6 @@ export const host = (options) =>
|
|
|
26
26
|
'https://api.fetchfox.ai';
|
|
27
27
|
|
|
28
28
|
export const appHost = (options) =>
|
|
29
|
-
host(options).replace('api.fetchfox.ai', '
|
|
29
|
+
host(options).replace('api.fetchfox.ai', 'fetchfox.ai');
|
|
30
30
|
|
|
31
31
|
export const ws = (options) => host(options).replace('http', 'ws');
|