@sanity/client 5.0.0-esm.7 → 5.0.0-esm.9
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 +110 -57
- package/dist/index.browser.cjs +6 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +6 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +127 -121
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/SanityClient.ts +84 -83
- package/src/assets/AssetsClient.ts +4 -3
- package/src/config.ts +1 -0
- package/src/data/dataMethods.ts +28 -26
- package/src/data/encodeQueryString.ts +4 -4
- package/src/data/listen.ts +9 -9
- package/src/data/patch.ts +18 -17
- package/src/data/transaction.ts +15 -12
- package/src/http/errors.ts +7 -7
- package/src/http/request.ts +4 -4
- package/src/http/requestOptions.ts +4 -2
- package/src/types.ts +36 -30
- package/src/util/defaults.ts +4 -2
- package/src/util/once.ts +5 -3
- package/src/util/pick.ts +4 -2
- package/src/validators.ts +4 -4
- package/src/warnings.ts +2 -1
- package/umd/sanityClient.js +4990 -5753
- package/umd/sanityClient.min.js +12 -12
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ function _interopDefaultCompat(e) {
|
|
|
16
16
|
}
|
|
17
17
|
var polyfilledEventSource__default = /*#__PURE__*/_interopDefaultCompat(polyfilledEventSource);
|
|
18
18
|
var name = "@sanity/client";
|
|
19
|
-
var version = "5.0.0-esm.
|
|
19
|
+
var version = "5.0.0-esm.9";
|
|
20
20
|
const middleware = [middleware$1.debug({
|
|
21
21
|
verbose: true,
|
|
22
22
|
namespace: "sanity:client"
|
|
@@ -350,7 +350,7 @@ class BasePatch {
|
|
|
350
350
|
* @param selector - Attribute or JSONPath expression for array
|
|
351
351
|
* @param start - Index at which to start changing the array (with origin 0). If greater than the length of the array, actual starting index will be set to the length of the array. If negative, will begin that many elements from the end of the array (with origin -1) and will be set to 0 if absolute value is greater than the length of the array.x
|
|
352
352
|
* @param deleteCount - An integer indicating the number of old array elements to remove.
|
|
353
|
-
* @param items - The elements to add to the array, beginning at the start index. If you don't specify
|
|
353
|
+
* @param items - The elements to add to the array, beginning at the start index. If you don't specify FIXME elements, splice() will only remove elements from the array.
|
|
354
354
|
*/
|
|
355
355
|
splice(selector, start, deleteCount, items) {
|
|
356
356
|
const delAll = typeof deleteCount === "undefined" || deleteCount === -1;
|
|
@@ -816,7 +816,9 @@ function _requestObservable(client, httpRequest, options) {
|
|
|
816
816
|
const reqOptions = getRequestOptions(config, Object.assign({}, options, {
|
|
817
817
|
url: _getUrl(client, uri, useCdn)
|
|
818
818
|
}));
|
|
819
|
-
return new rxjs.Observable(subscriber =>
|
|
819
|
+
return new rxjs.Observable(subscriber =>
|
|
820
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- the typings thinks it's optional because it's not required to specify it when calling createClient, but it's always defined in practice since SanityClient provides a default
|
|
821
|
+
httpRequest(reqOptions, config.requester).subscribe(subscriber));
|
|
820
822
|
}
|
|
821
823
|
function _request(client, httpRequest, options) {
|
|
822
824
|
const observable = _requestObservable(client, httpRequest, options).pipe(operators.filter(event => event.type === "response"), operators.map(event => event.body));
|
|
@@ -1562,7 +1564,7 @@ const _ObservableSanityClient = class {
|
|
|
1562
1564
|
* Fetch multiple documents in one request.
|
|
1563
1565
|
* Should be used sparingly - performing a query is usually a better option.
|
|
1564
1566
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
1565
|
-
* If a
|
|
1567
|
+
* If a FIXME of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
1566
1568
|
*
|
|
1567
1569
|
* @param ids - Document IDs to fetch
|
|
1568
1570
|
* @param options - Request options
|
|
@@ -1685,7 +1687,7 @@ const _SanityClient = class {
|
|
|
1685
1687
|
* Fetch multiple documents in one request.
|
|
1686
1688
|
* Should be used sparingly - performing a query is usually a better option.
|
|
1687
1689
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
1688
|
-
* If a
|
|
1690
|
+
* If a FIXME of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
1689
1691
|
*
|
|
1690
1692
|
* @param ids - Document IDs to fetch
|
|
1691
1693
|
* @param options - Request options
|