@sanity/client 6.27.3-canary.2 → 6.28.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 CHANGED
@@ -745,10 +745,11 @@ function _requestObservable(client, httpRequest, options) {
745
745
  const resultSourceMap = options.resultSourceMap ?? config$1.resultSourceMap;
746
746
  resultSourceMap !== void 0 && resultSourceMap !== !1 && (options.query = { resultSourceMap, ...options.query });
747
747
  const perspectiveOption = options.perspective || config$1.perspective;
748
- typeof perspectiveOption < "u" && (config.validateApiPerspective(perspectiveOption), options.query = {
748
+ typeof perspectiveOption < "u" && (perspectiveOption === "previewDrafts" && config.printPreviewDraftsDeprecationWarning(), config.validateApiPerspective(perspectiveOption), options.query = {
749
749
  perspective: Array.isArray(perspectiveOption) ? perspectiveOption.join(",") : perspectiveOption,
750
750
  ...options.query
751
- }, perspectiveOption === "previewDrafts" && useCdn && (useCdn = !1, config.printCdnPreviewDraftsWarning())), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query }), useCdn && options.cacheMode == "noStale" && (options.query = { cacheMode: "noStale", ...options.query });
751
+ }, (Array.isArray(perspectiveOption) && perspectiveOption.length > 0 || // previewDrafts was renamed to drafts, but keep for backwards compat
752
+ perspectiveOption === "previewDrafts" || perspectiveOption === "drafts") && useCdn && (useCdn = !1, config.printCdnPreviewDraftsWarning())), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query }), useCdn && options.cacheMode == "noStale" && (options.query = { cacheMode: "noStale", ...options.query });
752
753
  }
753
754
  const reqOptions = requestOptions(
754
755
  config$1,
@@ -1524,7 +1525,7 @@ function defineDeprecatedCreateClient(createClient2) {
1524
1525
  return config.printNoDefaultExport(), createClient2(config$1);
1525
1526
  };
1526
1527
  }
1527
- var name = "@sanity/client", version = "6.27.3-canary.2";
1528
+ var name = "@sanity/client", version = "6.28.0";
1528
1529
  const middleware = [
1529
1530
  middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
1530
1531
  middleware$1.headers({ "User-Agent": `${name} ${version}` }),