@aloma.io/integration-sdk 3.8.46 → 3.8.48
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.
@@ -61,7 +61,7 @@ export default class Fetcher {
|
|
61
61
|
Accept: 'application/json',
|
62
62
|
};
|
63
63
|
}
|
64
|
-
if (!options0?.headers || !options0?.headers?.['Content-type']) {
|
64
|
+
if ((!options0?.headers || !options0?.headers?.['Content-type']) && !(options0?.body instanceof FormData)) {
|
65
65
|
options0.headers = {
|
66
66
|
...options0.headers,
|
67
67
|
'Content-type': 'application/json',
|
@@ -73,6 +73,7 @@ export default class Fetcher {
|
|
73
73
|
options0?.headers?.['Content-type'] === 'application/json') {
|
74
74
|
options0.body = JSON.stringify(options0.body);
|
75
75
|
}
|
76
|
+
console.dir(options0, { depth: null });
|
76
77
|
const timeout = Math.min(options0?.timeout || 30 * 60 * 1000, 30 * 60 * 1000);
|
77
78
|
const ret = await fetch(theURL, {
|
78
79
|
...options0,
|
package/package.json
CHANGED
@@ -17,7 +17,7 @@ export default class Fetcher {
|
|
17
17
|
retry?: number;
|
18
18
|
baseUrl?: string;
|
19
19
|
onResponse?: (response: Response) => void;
|
20
|
-
customize?: (request: {[key: string]: any}) => void;
|
20
|
+
customize?: (request: { [key: string]: any }) => void;
|
21
21
|
} = {}) {
|
22
22
|
this.retry = retry;
|
23
23
|
this.baseUrl = baseUrl;
|
@@ -68,7 +68,7 @@ export default class Fetcher {
|
|
68
68
|
/**
|
69
69
|
* request headers like Accept, Content-type
|
70
70
|
*/
|
71
|
-
headers?: {[key: string]: any};
|
71
|
+
headers?: { [key: string]: any };
|
72
72
|
/**
|
73
73
|
* request body like "hello world" or {hello: "world"}
|
74
74
|
*/
|
@@ -81,7 +81,7 @@ export default class Fetcher {
|
|
81
81
|
baseUrl = local.baseUrl;
|
82
82
|
options ||= {};
|
83
83
|
|
84
|
-
const options0: any = {...options};
|
84
|
+
const options0: any = { ...options };
|
85
85
|
|
86
86
|
if (retries == null) retries = local.retry;
|
87
87
|
|
@@ -103,7 +103,7 @@ export default class Fetcher {
|
|
103
103
|
};
|
104
104
|
}
|
105
105
|
|
106
|
-
if (!options0?.headers || !options0?.headers?.['Content-type']) {
|
106
|
+
if ((!options0?.headers || !options0?.headers?.['Content-type']) && !(options0?.body instanceof FormData)) {
|
107
107
|
options0.headers = {
|
108
108
|
...options0.headers,
|
109
109
|
'Content-type': 'application/json',
|
@@ -119,6 +119,8 @@ export default class Fetcher {
|
|
119
119
|
options0.body = JSON.stringify(options0.body);
|
120
120
|
}
|
121
121
|
|
122
|
+
console.dir(options0, {depth: null})
|
123
|
+
|
122
124
|
const timeout = Math.min(options0?.timeout || 30 * 60 * 1000, 30 * 60 * 1000);
|
123
125
|
const ret = await fetch(theURL, {
|
124
126
|
...options0,
|
@@ -139,7 +141,7 @@ export default class Fetcher {
|
|
139
141
|
}
|
140
142
|
|
141
143
|
if (status === 204) {
|
142
|
-
return {ok: true};
|
144
|
+
return { ok: true };
|
143
145
|
}
|
144
146
|
|
145
147
|
return unwrap(ret, options0);
|