@sanity/client 5.1.0 → 5.2.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
@@ -15,7 +15,7 @@ function _interopDefaultCompat(e) {
15
15
  }
16
16
  var polyfilledEventSource__default = /*#__PURE__*/_interopDefaultCompat(polyfilledEventSource);
17
17
  var name = "@sanity/client";
18
- var version = "5.1.0";
18
+ var version = "5.2.0";
19
19
  const middleware = [middleware$1.debug({
20
20
  verbose: true,
21
21
  namespace: "sanity:client"
@@ -1563,6 +1563,24 @@ const _ObservableSanityClient = class {
1563
1563
  request(options) {
1564
1564
  return _request(this, __privateGet(this, _httpRequest), options);
1565
1565
  }
1566
+ /**
1567
+ * Get a Sanity API URL for the URI provided
1568
+ *
1569
+ * @param uri - URI/path to build URL for
1570
+ * @param canUseCdn - Whether or not to allow using the API CDN for this route
1571
+ */
1572
+ getUrl(uri, canUseCdn) {
1573
+ return _getUrl(this, uri, canUseCdn);
1574
+ }
1575
+ /**
1576
+ * Get a Sanity API URL for the data operation and path provided
1577
+ *
1578
+ * @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
1579
+ * @param path - Path to append after the operation
1580
+ */
1581
+ getDataUrl(operation, path) {
1582
+ return _getDataUrl(this, operation, path);
1583
+ }
1566
1584
  };
1567
1585
  let ObservableSanityClient = _ObservableSanityClient;
1568
1586
  _clientConfig = new WeakMap();
@@ -1696,6 +1714,24 @@ const _SanityClient = class {
1696
1714
  dataRequest(endpoint, body, options) {
1697
1715
  return rxjs.lastValueFrom(_dataRequest(this, __privateGet(this, _httpRequest2), endpoint, body, options));
1698
1716
  }
1717
+ /**
1718
+ * Get a Sanity API URL for the URI provided
1719
+ *
1720
+ * @param uri - URI/path to build URL for
1721
+ * @param canUseCdn - Whether or not to allow using the API CDN for this route
1722
+ */
1723
+ getUrl(uri, canUseCdn) {
1724
+ return _getUrl(this, uri, canUseCdn);
1725
+ }
1726
+ /**
1727
+ * Get a Sanity API URL for the data operation and path provided
1728
+ *
1729
+ * @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
1730
+ * @param path - Path to append after the operation
1731
+ */
1732
+ getDataUrl(operation, path) {
1733
+ return _getDataUrl(this, operation, path);
1734
+ }
1699
1735
  };
1700
1736
  let SanityClient = _SanityClient;
1701
1737
  _clientConfig2 = new WeakMap();