@sanity/client 5.4.1 → 5.4.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.browser.cjs +11 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +11 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data/dataMethods.ts +9 -8
- package/src/types.ts +1 -0
- package/umd/sanityClient.js +11 -2
- package/umd/sanityClient.min.js +3 -3
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var getIt = require('get-it');
|
|
|
8
8
|
var rxjs = require('rxjs');
|
|
9
9
|
var operators = require('rxjs/operators');
|
|
10
10
|
var name = "@sanity/client";
|
|
11
|
-
var version = "5.4.
|
|
11
|
+
var version = "5.4.2";
|
|
12
12
|
const middleware = [middleware$1.debug({
|
|
13
13
|
verbose: true,
|
|
14
14
|
namespace: "sanity:client"
|
|
@@ -739,9 +739,18 @@ function _delete(client, httpRequest, selection, options) {
|
|
|
739
739
|
}, options);
|
|
740
740
|
}
|
|
741
741
|
function _mutate(client, httpRequest, mutations, options) {
|
|
742
|
-
|
|
742
|
+
let mut;
|
|
743
|
+
if (mutations instanceof Patch || mutations instanceof ObservablePatch) {
|
|
744
|
+
mut = {
|
|
745
|
+
patch: mutations.serialize()
|
|
746
|
+
};
|
|
747
|
+
} else if (mutations instanceof Transaction || mutations instanceof ObservableTransaction) {
|
|
748
|
+
mut = mutations.serialize();
|
|
749
|
+
} else {
|
|
750
|
+
mut = mutations;
|
|
751
|
+
}
|
|
743
752
|
const muts = Array.isArray(mut) ? mut : [mut];
|
|
744
|
-
const transactionId = options && options.transactionId;
|
|
753
|
+
const transactionId = options && options.transactionId || void 0;
|
|
745
754
|
return _dataRequest(client, httpRequest, "mutate", {
|
|
746
755
|
mutations: muts,
|
|
747
756
|
transactionId
|