@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/README.md +16 -72
- package/dist/index.browser.cjs +36 -0
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +36 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +37 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +28 -0
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/SanityClient.ts +40 -0
- package/umd/sanityClient.js +36 -0
- package/umd/sanityClient.min.js +3 -3
package/dist/index.browser.js
CHANGED
|
@@ -1543,6 +1543,24 @@ const _ObservableSanityClient = class {
|
|
|
1543
1543
|
request(options) {
|
|
1544
1544
|
return _request(this, __privateGet(this, _httpRequest), options);
|
|
1545
1545
|
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Get a Sanity API URL for the URI provided
|
|
1548
|
+
*
|
|
1549
|
+
* @param uri - URI/path to build URL for
|
|
1550
|
+
* @param canUseCdn - Whether or not to allow using the API CDN for this route
|
|
1551
|
+
*/
|
|
1552
|
+
getUrl(uri, canUseCdn) {
|
|
1553
|
+
return _getUrl(this, uri, canUseCdn);
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* Get a Sanity API URL for the data operation and path provided
|
|
1557
|
+
*
|
|
1558
|
+
* @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
|
|
1559
|
+
* @param path - Path to append after the operation
|
|
1560
|
+
*/
|
|
1561
|
+
getDataUrl(operation, path) {
|
|
1562
|
+
return _getDataUrl(this, operation, path);
|
|
1563
|
+
}
|
|
1546
1564
|
};
|
|
1547
1565
|
let ObservableSanityClient = _ObservableSanityClient;
|
|
1548
1566
|
_clientConfig = new WeakMap();
|
|
@@ -1676,6 +1694,24 @@ const _SanityClient = class {
|
|
|
1676
1694
|
dataRequest(endpoint, body, options) {
|
|
1677
1695
|
return lastValueFrom(_dataRequest(this, __privateGet(this, _httpRequest2), endpoint, body, options));
|
|
1678
1696
|
}
|
|
1697
|
+
/**
|
|
1698
|
+
* Get a Sanity API URL for the URI provided
|
|
1699
|
+
*
|
|
1700
|
+
* @param uri - URI/path to build URL for
|
|
1701
|
+
* @param canUseCdn - Whether or not to allow using the API CDN for this route
|
|
1702
|
+
*/
|
|
1703
|
+
getUrl(uri, canUseCdn) {
|
|
1704
|
+
return _getUrl(this, uri, canUseCdn);
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Get a Sanity API URL for the data operation and path provided
|
|
1708
|
+
*
|
|
1709
|
+
* @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
|
|
1710
|
+
* @param path - Path to append after the operation
|
|
1711
|
+
*/
|
|
1712
|
+
getDataUrl(operation, path) {
|
|
1713
|
+
return _getDataUrl(this, operation, path);
|
|
1714
|
+
}
|
|
1679
1715
|
};
|
|
1680
1716
|
let SanityClient = _SanityClient;
|
|
1681
1717
|
_clientConfig2 = new WeakMap();
|