@sanity/client 5.3.1 → 5.4.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 +1 -1
- package/dist/index.browser.cjs +13 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +2 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +14 -2
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/src/assets/AssetsClient.ts +11 -10
- package/src/index.browser.ts +3 -0
- package/src/index.ts +3 -0
- package/src/types.ts +9 -0
- package/umd/sanityClient.js +11 -4
- package/umd/sanityClient.min.js +3 -3
package/README.md
CHANGED
|
@@ -738,7 +738,7 @@ An important note on this approach is that you cannot call `commit()` on transac
|
|
|
738
738
|
Assets can be uploaded using the `client.assets.upload(...)` method.
|
|
739
739
|
|
|
740
740
|
```
|
|
741
|
-
client.assets.upload(type: 'file' | image', body: File | Blob | Buffer |
|
|
741
|
+
client.assets.upload(type: 'file' | image', body: File | Blob | Buffer | NodeJS.ReadableStream, options = {}): Promise<AssetDocument>
|
|
742
742
|
```
|
|
743
743
|
|
|
744
744
|
👉 Read more about [assets in Sanity](https://sanity.io/docs/assets)
|
package/dist/index.browser.cjs
CHANGED
|
@@ -959,7 +959,7 @@ function _upload(client, httpRequest, assetType, body) {
|
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
961
|
function optionsFromFile(opts, file) {
|
|
962
|
-
if (typeof
|
|
962
|
+
if (typeof File === "undefined" || !(file instanceof File)) {
|
|
963
963
|
return opts;
|
|
964
964
|
}
|
|
965
965
|
return Object.assign({
|
|
@@ -1756,6 +1756,18 @@ function deprecatedCreateClient(config) {
|
|
|
1756
1756
|
printNoDefaultExport();
|
|
1757
1757
|
return new SanityClient(httpRequest, config);
|
|
1758
1758
|
}
|
|
1759
|
+
Object.defineProperty(exports, 'unstable__adapter', {
|
|
1760
|
+
enumerable: true,
|
|
1761
|
+
get: function () {
|
|
1762
|
+
return getIt.adapter;
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1765
|
+
Object.defineProperty(exports, 'unstable__environment', {
|
|
1766
|
+
enumerable: true,
|
|
1767
|
+
get: function () {
|
|
1768
|
+
return getIt.environment;
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1759
1771
|
exports.BasePatch = BasePatch;
|
|
1760
1772
|
exports.BaseTransaction = BaseTransaction;
|
|
1761
1773
|
exports.ClientError = ClientError;
|