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