@sanity/client 6.21.1 → 6.21.3-canary.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 +3 -3
- package/dist/index.browser.cjs +12 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +10 -0
- package/dist/index.browser.d.ts +10 -0
- package/dist/index.browser.js +12 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +13 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/src/SanityClient.ts +2 -2
- package/src/data/dataMethods.ts +14 -4
- package/src/types.ts +8 -0
- package/umd/sanityClient.js +31 -16
- package/umd/sanityClient.min.js +3 -3
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ export async function updateDocumentTitle(_id, title) {
|
|
|
101
101
|
- [2. Cancel a request by unsubscribing from the Observable](#2-cancel-a-request-by-unsubscribing-from-the-observable)
|
|
102
102
|
- [Get client configuration](#get-client-configuration)
|
|
103
103
|
- [Set client configuration](#set-client-configuration)
|
|
104
|
-
- [
|
|
104
|
+
- [Actions](#actions)
|
|
105
105
|
- [Action options](#action-options)
|
|
106
106
|
- [Create Action](#create-action)
|
|
107
107
|
- [Delete Action](#delete-action)
|
|
@@ -1159,9 +1159,9 @@ client.mutate(transaction)
|
|
|
1159
1159
|
|
|
1160
1160
|
An important note on this approach is that you cannot call `commit()` on transactions or patches instantiated this way, instead you have to pass them to `client.mutate()`
|
|
1161
1161
|
|
|
1162
|
-
###
|
|
1162
|
+
### Actions
|
|
1163
1163
|
|
|
1164
|
-
The
|
|
1164
|
+
The Actions API provides a new interface for creating, updating and publishing documents. It is a wrapper around the [Actions API](https://www.sanity.io/docs/http-actions).
|
|
1165
1165
|
|
|
1166
1166
|
This API is only available from API version `v2024-05-23`.
|
|
1167
1167
|
|
package/dist/index.browser.cjs
CHANGED
|
@@ -660,14 +660,24 @@ function _fetch(client, httpRequest, _stega, query, _params = {}, options = {})
|
|
|
660
660
|
) : $request.pipe(operators.map(mapResponse));
|
|
661
661
|
}
|
|
662
662
|
function _getDocument(client, httpRequest, id, opts = {}) {
|
|
663
|
-
const options = {
|
|
663
|
+
const options = {
|
|
664
|
+
uri: _getDataUrl(client, "doc", id),
|
|
665
|
+
json: !0,
|
|
666
|
+
tag: opts.tag,
|
|
667
|
+
signal: opts.signal
|
|
668
|
+
};
|
|
664
669
|
return _requestObservable(client, httpRequest, options).pipe(
|
|
665
670
|
operators.filter(isResponse),
|
|
666
671
|
operators.map((event) => event.body.documents && event.body.documents[0])
|
|
667
672
|
);
|
|
668
673
|
}
|
|
669
674
|
function _getDocuments(client, httpRequest, ids, opts = {}) {
|
|
670
|
-
const options = {
|
|
675
|
+
const options = {
|
|
676
|
+
uri: _getDataUrl(client, "doc", ids.join(",")),
|
|
677
|
+
json: !0,
|
|
678
|
+
tag: opts.tag,
|
|
679
|
+
signal: opts.signal
|
|
680
|
+
};
|
|
671
681
|
return _requestObservable(client, httpRequest, options).pipe(
|
|
672
682
|
operators.filter(isResponse),
|
|
673
683
|
operators.map((event) => {
|