kaafil-js 0.6.0 → 0.6.1
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/client-entry.cjs +12 -0
- package/dist/client-entry.cjs.map +1 -1
- package/dist/client-entry.js +12 -0
- package/dist/client-entry.js.map +1 -1
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/client-entry.cjs
CHANGED
|
@@ -1825,6 +1825,18 @@ function sendOnce(ctx, request, idempotencyKey) {
|
|
|
1825
1825
|
return sendOnceWith(ctx, request, idempotencyKey, async (response, status, requestId) => {
|
|
1826
1826
|
const text = await response.text();
|
|
1827
1827
|
const body = text.length > 0 ? tryParseJson(text) : void 0;
|
|
1828
|
+
if (body === void 0 && status >= 200 && status < 300) {
|
|
1829
|
+
const serverDate = response.headers.get("date");
|
|
1830
|
+
return {
|
|
1831
|
+
data: void 0,
|
|
1832
|
+
meta: {
|
|
1833
|
+
status,
|
|
1834
|
+
requestId,
|
|
1835
|
+
...serverDate === null ? {} : { serverTime: new Date(serverDate).toISOString() }
|
|
1836
|
+
},
|
|
1837
|
+
facets: void 0
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1828
1840
|
if (!isSuccessEnvelope(body)) {
|
|
1829
1841
|
throw new KaafilNetworkError(`Received an unrecognizable success body for HTTP ${status}`, {
|
|
1830
1842
|
status,
|