@sanity/client 6.22.3 → 6.22.5-beta.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.
@@ -100,8 +100,7 @@ function defineHttpRequest(envMiddleware2) {
100
100
  ]);
101
101
  }
102
102
  function shouldRetry(err, attempt, options) {
103
- if (options.maxRetries === 0)
104
- return !1;
103
+ if (options.maxRetries === 0) return !1;
105
104
  const isSafe = options.method === "GET" || options.method === "HEAD", isQuery = (options.uri || options.url).startsWith("/data/query"), isRetriableResponse = err.response && (err.response.statusCode === 429 || err.response.statusCode === 502 || err.response.statusCode === 503);
106
105
  return (isSafe || isQuery) && isRetriableResponse ? !0 : retry.shouldRetry(err, attempt, options);
107
106
  }
@@ -894,7 +893,7 @@ function _listen(query, params, opts = {}) {
894
893
  shouldEmitReconnect && observer.next({ type: "reconnect" });
895
894
  }
896
895
  async function getEventSource() {
897
- const { default: EventSource2 } = await import("@sanity/eventsource");
896
+ const { EventSource: EventSource2 } = await import("eventsource");
898
897
  if (unsubscribed)
899
898
  return;
900
899
  const evs = new EventSource2(uri, esOptions);
@@ -992,7 +991,7 @@ class LiveClient {
992
991
  }
993
992
  }
994
993
  async function getEventSource() {
995
- const EventSourceImplementation = typeof EventSource > "u" || esOptions.headers || esOptions.withCredentials ? (await import("@sanity/eventsource")).default : EventSource;
994
+ const EventSourceImplementation = typeof EventSource > "u" || esOptions.headers || esOptions.withCredentials ? (await import("eventsource")).EventSource : EventSource;
996
995
  if (unsubscribed)
997
996
  return;
998
997
  try {