@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.browser.js
CHANGED
|
@@ -330,7 +330,7 @@ class BasePatch {
|
|
|
330
330
|
* @param selector - Attribute or JSONPath expression for array
|
|
331
331
|
* @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
|
|
332
332
|
* @param deleteCount - An integer indicating the number of old array elements to remove.
|
|
333
|
-
* @param items - The elements to add to the array, beginning at the start index. If you don't specify
|
|
333
|
+
* @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.
|
|
334
334
|
*/
|
|
335
335
|
splice(selector, start, deleteCount, items) {
|
|
336
336
|
const delAll = typeof deleteCount === "undefined" || deleteCount === -1;
|
|
@@ -796,7 +796,9 @@ function _requestObservable(client, httpRequest, options) {
|
|
|
796
796
|
const reqOptions = getRequestOptions(config, Object.assign({}, options, {
|
|
797
797
|
url: _getUrl(client, uri, useCdn)
|
|
798
798
|
}));
|
|
799
|
-
return new Observable(subscriber =>
|
|
799
|
+
return new Observable(subscriber =>
|
|
800
|
+
// 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
|
|
801
|
+
httpRequest(reqOptions, config.requester).subscribe(subscriber));
|
|
800
802
|
}
|
|
801
803
|
function _request(client, httpRequest, options) {
|
|
802
804
|
const observable = _requestObservable(client, httpRequest, options).pipe(filter(event => event.type === "response"), map(event => event.body));
|
|
@@ -1542,7 +1544,7 @@ const _ObservableSanityClient = class {
|
|
|
1542
1544
|
* Fetch multiple documents in one request.
|
|
1543
1545
|
* Should be used sparingly - performing a query is usually a better option.
|
|
1544
1546
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
1545
|
-
* If a
|
|
1547
|
+
* If a FIXME of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
1546
1548
|
*
|
|
1547
1549
|
* @param ids - Document IDs to fetch
|
|
1548
1550
|
* @param options - Request options
|
|
@@ -1665,7 +1667,7 @@ const _SanityClient = class {
|
|
|
1665
1667
|
* Fetch multiple documents in one request.
|
|
1666
1668
|
* Should be used sparingly - performing a query is usually a better option.
|
|
1667
1669
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
1668
|
-
* If a
|
|
1670
|
+
* If a FIXME of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
1669
1671
|
*
|
|
1670
1672
|
* @param ids - Document IDs to fetch
|
|
1671
1673
|
* @param options - Request options
|