@sanity/client 6.1.0 → 6.1.2

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.d.ts CHANGED
@@ -1498,10 +1498,10 @@ export declare type QueryParams = {
1498
1498
 
1499
1499
  /** @public */
1500
1500
  export declare interface RawQueryResponse<R> {
1501
- q: string
1501
+ query: string
1502
1502
  ms: number
1503
1503
  result: R
1504
- resultSourceMap: ContentSourceMap
1504
+ resultSourceMap?: ContentSourceMap
1505
1505
  }
1506
1506
 
1507
1507
  /** @internal */
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ export { adapter as unstable__adapter, environment as unstable__environment } fr
4
4
  import { Observable, lastValueFrom } from 'rxjs';
5
5
  import { map, filter } from 'rxjs/operators';
6
6
  var name = "@sanity/client";
7
- var version = "6.1.0";
7
+ var version = "6.1.2";
8
8
  const middleware = [debug({
9
9
  verbose: true,
10
10
  namespace: "sanity:client"
@@ -122,7 +122,8 @@ function defineHttpRequest(envMiddleware, _ref) {
122
122
  }
123
123
  function shouldRetry(err, attempt, options) {
124
124
  const isSafe = options.method === "GET" || options.method === "HEAD";
125
- const isQuery = options.uri.startsWith("/data/query");
125
+ const uri = options.uri || options.url;
126
+ const isQuery = uri.startsWith("/data/query");
126
127
  const isRetriableResponse = err.response && (err.response.statusCode === 429 || err.response.statusCode === 502 || err.response.statusCode === 503);
127
128
  if ((isSafe || isQuery) && isRetriableResponse) return true;
128
129
  return retry.shouldRetry(err, attempt, options);