@aloma.io/integration-sdk 3.3.85 → 3.3.87
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/build/internal/index.mjs
CHANGED
@@ -23,11 +23,11 @@ const reply = (arg, packet, transport) => {
|
|
23
23
|
transport.send(transport.newPacket({ c: packet.cb(), a: { ...arg } }));
|
24
24
|
};
|
25
25
|
const unwrap0 = (ret, body, options) => {
|
26
|
-
if (options?.bodyOnly) {
|
27
|
-
return body;
|
26
|
+
if (options?.bodyOnly === false) {
|
27
|
+
return { status: ret.status, headers: ret.headers, body };
|
28
28
|
}
|
29
29
|
else {
|
30
|
-
return
|
30
|
+
return body;
|
31
31
|
}
|
32
32
|
};
|
33
33
|
const unwrap = async (ret, options) => {
|
@@ -115,6 +115,10 @@ class Fetcher {
|
|
115
115
|
if (e.status === 429) {
|
116
116
|
return local.onError(e, url, options, retries, args, true);
|
117
117
|
}
|
118
|
+
// bad request
|
119
|
+
if (e.status === 400 || e.status === 422) {
|
120
|
+
throw (e);
|
121
|
+
}
|
118
122
|
--retries;
|
119
123
|
console.log(theURL, e);
|
120
124
|
if (retries <= 0)
|
package/package.json
CHANGED
package/src/internal/index.mjs
CHANGED
@@ -32,10 +32,10 @@ const reply = (arg, packet, transport) => {
|
|
32
32
|
};
|
33
33
|
|
34
34
|
const unwrap0 = (ret, body, options) => {
|
35
|
-
if (options?.bodyOnly) {
|
36
|
-
return body;
|
37
|
-
} else {
|
35
|
+
if (options?.bodyOnly === false) {
|
38
36
|
return {status: ret.status, headers: ret.headers, body};
|
37
|
+
} else {
|
38
|
+
return body;
|
39
39
|
}
|
40
40
|
}
|
41
41
|
|
@@ -147,6 +147,11 @@ class Fetcher {
|
|
147
147
|
if (e.status === 429) {
|
148
148
|
return local.onError(e, url, options, retries, args, true);
|
149
149
|
}
|
150
|
+
|
151
|
+
// bad request
|
152
|
+
if (e.status === 400 || e.status === 422) {
|
153
|
+
throw(e);
|
154
|
+
}
|
150
155
|
|
151
156
|
--retries;
|
152
157
|
|