@deliverart/sdk-js-core 2.3.8 → 2.4.0
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 +15 -11
- package/dist/index.js +15 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -148,20 +148,24 @@ function createApiClient(config) {
|
|
|
148
148
|
let response = await fetch(ctx.url.toString(), ctx.init);
|
|
149
149
|
let contentType = response.headers.get("Content-Type") ?? "";
|
|
150
150
|
let parsedBody;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
if (response.status === 204) {
|
|
152
|
+
parsedBody = null;
|
|
153
|
+
} else {
|
|
154
|
+
try {
|
|
155
|
+
if (contentType.includes("application/")) {
|
|
156
|
+
if (contentType.includes("json")) {
|
|
157
|
+
parsedBody = await response.json();
|
|
158
|
+
} else {
|
|
159
|
+
parsedBody = await response.text();
|
|
160
|
+
}
|
|
161
|
+
} else if (contentType.includes("text/")) {
|
|
156
162
|
parsedBody = await response.text();
|
|
163
|
+
} else {
|
|
164
|
+
parsedBody = await response.arrayBuffer();
|
|
157
165
|
}
|
|
158
|
-
}
|
|
159
|
-
parsedBody =
|
|
160
|
-
} else {
|
|
161
|
-
parsedBody = await response.arrayBuffer();
|
|
166
|
+
} catch (err) {
|
|
167
|
+
parsedBody = void 0;
|
|
162
168
|
}
|
|
163
|
-
} catch (err) {
|
|
164
|
-
parsedBody = void 0;
|
|
165
169
|
}
|
|
166
170
|
let parsedResponse = {
|
|
167
171
|
response,
|
package/dist/index.js
CHANGED
|
@@ -109,20 +109,24 @@ function createApiClient(config) {
|
|
|
109
109
|
let response = await fetch(ctx.url.toString(), ctx.init);
|
|
110
110
|
let contentType = response.headers.get("Content-Type") ?? "";
|
|
111
111
|
let parsedBody;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
if (response.status === 204) {
|
|
113
|
+
parsedBody = null;
|
|
114
|
+
} else {
|
|
115
|
+
try {
|
|
116
|
+
if (contentType.includes("application/")) {
|
|
117
|
+
if (contentType.includes("json")) {
|
|
118
|
+
parsedBody = await response.json();
|
|
119
|
+
} else {
|
|
120
|
+
parsedBody = await response.text();
|
|
121
|
+
}
|
|
122
|
+
} else if (contentType.includes("text/")) {
|
|
117
123
|
parsedBody = await response.text();
|
|
124
|
+
} else {
|
|
125
|
+
parsedBody = await response.arrayBuffer();
|
|
118
126
|
}
|
|
119
|
-
}
|
|
120
|
-
parsedBody =
|
|
121
|
-
} else {
|
|
122
|
-
parsedBody = await response.arrayBuffer();
|
|
127
|
+
} catch (err) {
|
|
128
|
+
parsedBody = void 0;
|
|
123
129
|
}
|
|
124
|
-
} catch (err) {
|
|
125
|
-
parsedBody = void 0;
|
|
126
130
|
}
|
|
127
131
|
let parsedResponse = {
|
|
128
132
|
response,
|
package/package.json
CHANGED