@sanity/client 8.4.0 → 8.6.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 +80 -4
- package/dist/{browserUpload-C7PwCs-C.js → browserUpload-CXcfRh-z.js} +2 -2
- package/dist/{browserUpload-C7PwCs-C.js.map → browserUpload-CXcfRh-z.js.map} +1 -1
- package/dist/{browserUpload-D-2Rmfjo.js → browserUpload-D3ST_REr.js} +2 -2
- package/dist/{browserUpload-D-2Rmfjo.js.map → browserUpload-D3ST_REr.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +204 -9
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +325 -23
- package/dist/index.node.js +154 -16
- package/dist/index.node.js.map +1 -1
- package/dist/media-library.d.ts +1 -1
- package/dist/{request-SnMg7nUX.js → request-BzWeXkUo.js} +3 -2
- package/dist/request-BzWeXkUo.js.map +1 -0
- package/dist/{request-BhMuKj0D.js → request-SY_xwBuz.js} +3 -2
- package/dist/request-SY_xwBuz.js.map +1 -0
- package/dist/stega.js +2 -2
- package/dist/{dist-Z8cIRxoB.js → stegaClean-YZRATV86.js} +19 -2
- package/dist/stegaClean-YZRATV86.js.map +1 -0
- package/dist/{stegaEncodeSourceMap-YR3NQ3iz.js → stegaEncodeSourceMap-Dj29aWKG.js} +2 -2
- package/dist/{stegaEncodeSourceMap-YR3NQ3iz.js.map → stegaEncodeSourceMap-Dj29aWKG.js.map} +1 -1
- package/dist/{types-DiPF0ENT.d.ts → types-B1XLvey7.d.ts} +326 -24
- package/package.json +17 -14
- package/src/SanityClient.ts +176 -9
- package/src/agent/actions/AgentActionsClient.ts +8 -2
- package/src/assets/AssetsClient.ts +8 -2
- package/src/context/openapi.json +663 -2
- package/src/context/types.gen.ts +48 -1
- package/src/data/dataMethods.ts +2 -5
- package/src/data/live.ts +1 -0
- package/src/datasets/DatasetsClient.ts +8 -2
- package/src/http/request.ts +2 -10
- package/src/mediaLibrary/MediaLibraryVideoClient.ts +8 -2
- package/src/projects/ProjectsClient.ts +8 -2
- package/src/releases/ReleasesClient.ts +8 -2
- package/src/types.ts +49 -6
- package/src/users/UsersClient.ts +8 -2
- package/dist/dist-Z8cIRxoB.js.map +0 -1
- package/dist/request-BhMuKj0D.js.map +0 -1
- package/dist/request-SnMg7nUX.js.map +0 -1
- package/dist/stegaClean-C18wLWau.js +0 -21
- package/dist/stegaClean-C18wLWau.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-vyAXikos.js";
|
|
2
|
-
import { a as ServerError, c as isHttpError, i as CorsOriginError, l as isQueryParseError, o as formatQueryParseError, r as ClientError, t as defineRequester, u as _defineProperty } from "./request-
|
|
2
|
+
import { a as ServerError, c as isHttpError, i as CorsOriginError, l as isQueryParseError, o as formatQueryParseError, r as ClientError, t as defineRequester, u as _defineProperty } from "./request-SY_xwBuz.js";
|
|
3
3
|
import { t as isRecord } from "./isRecord-Kfmt-nk-.js";
|
|
4
4
|
import { _ as validateDocumentId, a as printCreateVersionWithBaseIdWarning, b as validateVersionIdMatch, c as printPreviewDraftsDeprecationWarning, d as requestTag, f as requireDocumentId, g as validateAssetType, h as resourceGuard, i as printCdnPreviewDraftsWarning, l as dataset, m as resourceConfig, n as initConfig, o as printDeprecatedUriOptionWarning, p as requireDocumentType, r as validateApiPerspective, s as printNoDefaultExport, t as defaultConfig, u as hasDataset, v as validateInsert, y as validateObject } from "./config-CgJ16jET.js";
|
|
5
|
-
import { t as stegaClean } from "./stegaClean-
|
|
5
|
+
import { t as stegaClean } from "./stegaClean-YZRATV86.js";
|
|
6
|
+
import { anySignal } from "any-signal";
|
|
6
7
|
import { isTimeoutError } from "get-it";
|
|
7
8
|
import { Observable, catchError, concat, defer, finalize, isObservable, lastValueFrom, map, merge, mergeMap, of, share, tap, throwError, timer } from "rxjs";
|
|
8
9
|
import { getDraftId, getPublishedId, getVersionFromId, getVersionId, isDraftId, isVersionId } from "@sanity/client/csm";
|
|
@@ -627,7 +628,7 @@ function _fetch$2(client, httpRequest, _stega, query, _params = {}, options = {}
|
|
|
627
628
|
query,
|
|
628
629
|
params
|
|
629
630
|
}, reqOpts);
|
|
630
|
-
return stega.enabled ? Promise.all([request, import("./stegaEncodeSourceMap-
|
|
631
|
+
return stega.enabled ? Promise.all([request, import("./stegaEncodeSourceMap-Dj29aWKG.js").then((n) => n.n)]).then(([res, { stegaEncodeSourceMap }]) => {
|
|
631
632
|
let result = stegaEncodeSourceMap(res.result, res.resultSourceMap, stega);
|
|
632
633
|
return mapResponse({
|
|
633
634
|
...res,
|
|
@@ -1080,7 +1081,7 @@ function _prepareRequest(client, options) {
|
|
|
1080
1081
|
function _observe(userSignal, run) {
|
|
1081
1082
|
return new Observable((subscriber) => {
|
|
1082
1083
|
let controller = new AbortController();
|
|
1083
|
-
return run(userSignal ?
|
|
1084
|
+
return run(userSignal ? anySignal([userSignal, controller.signal]) : controller.signal).then((value) => {
|
|
1084
1085
|
subscriber.next(value), subscriber.complete();
|
|
1085
1086
|
}, (err) => subscriber.error(err)), () => controller.abort();
|
|
1086
1087
|
});
|
|
@@ -1369,7 +1370,7 @@ function _upload(client, _httpRequest, assetType, body, opts = {}) {
|
|
|
1369
1370
|
body
|
|
1370
1371
|
};
|
|
1371
1372
|
return typeof XMLHttpRequest < "u" ? defer(async () => {
|
|
1372
|
-
let { uploadWithProgress } = await import("./browserUpload-
|
|
1373
|
+
let { uploadWithProgress } = await import("./browserUpload-CXcfRh-z.js"), req = _prepareRequest(client, { ...baseRequest });
|
|
1373
1374
|
return uploadWithProgress({
|
|
1374
1375
|
url: appendQuery(req.url, req.query),
|
|
1375
1376
|
method: req.method ?? "POST",
|
|
@@ -3684,7 +3685,79 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3684
3685
|
}
|
|
3685
3686
|
}, _clientConfig = /* @__PURE__ */ new WeakMap(), _httpRequest = /* @__PURE__ */ new WeakMap(), ObservableSanityClient = class ObservableSanityClient {
|
|
3686
3687
|
constructor(httpRequest, config = defaultConfig) {
|
|
3687
|
-
_defineProperty(
|
|
3688
|
+
_defineProperty(
|
|
3689
|
+
this,
|
|
3690
|
+
/**
|
|
3691
|
+
* Upload, fetch and delete assets (images and files) in the configured dataset
|
|
3692
|
+
*
|
|
3693
|
+
* @category Assets
|
|
3694
|
+
*/
|
|
3695
|
+
"assets",
|
|
3696
|
+
void 0
|
|
3697
|
+
), _defineProperty(
|
|
3698
|
+
this,
|
|
3699
|
+
/**
|
|
3700
|
+
* Create, list, edit and delete datasets in the configured project
|
|
3701
|
+
*
|
|
3702
|
+
* @category Projects & Datasets
|
|
3703
|
+
*/
|
|
3704
|
+
"datasets",
|
|
3705
|
+
void 0
|
|
3706
|
+
), _defineProperty(
|
|
3707
|
+
this,
|
|
3708
|
+
/**
|
|
3709
|
+
* Subscribe to live content updates through the Live Content API
|
|
3710
|
+
*
|
|
3711
|
+
* @category Real-time
|
|
3712
|
+
*/
|
|
3713
|
+
"live",
|
|
3714
|
+
void 0
|
|
3715
|
+
), _defineProperty(
|
|
3716
|
+
this,
|
|
3717
|
+
/**
|
|
3718
|
+
* Interact with Media Library assets
|
|
3719
|
+
*
|
|
3720
|
+
* @category Assets
|
|
3721
|
+
*/
|
|
3722
|
+
"mediaLibrary",
|
|
3723
|
+
void 0
|
|
3724
|
+
), _defineProperty(
|
|
3725
|
+
this,
|
|
3726
|
+
/**
|
|
3727
|
+
* Fetch information about the projects the authenticated user has access to
|
|
3728
|
+
*
|
|
3729
|
+
* @category Projects & Datasets
|
|
3730
|
+
*/
|
|
3731
|
+
"projects",
|
|
3732
|
+
void 0
|
|
3733
|
+
), _defineProperty(
|
|
3734
|
+
this,
|
|
3735
|
+
/**
|
|
3736
|
+
* Fetch information about users in the configured project
|
|
3737
|
+
*
|
|
3738
|
+
* @category Projects & Datasets
|
|
3739
|
+
*/
|
|
3740
|
+
"users",
|
|
3741
|
+
void 0
|
|
3742
|
+
), _defineProperty(
|
|
3743
|
+
this,
|
|
3744
|
+
/**
|
|
3745
|
+
* Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
|
|
3746
|
+
*
|
|
3747
|
+
* @category Agent Actions
|
|
3748
|
+
*/
|
|
3749
|
+
"agent",
|
|
3750
|
+
void 0
|
|
3751
|
+
), _defineProperty(this, "collaboration", void 0), _defineProperty(this, "functions", void 0), _defineProperty(
|
|
3752
|
+
this,
|
|
3753
|
+
/**
|
|
3754
|
+
* Create and manage content releases and their scheduled publishing
|
|
3755
|
+
*
|
|
3756
|
+
* @category Releases
|
|
3757
|
+
*/
|
|
3758
|
+
"releases",
|
|
3759
|
+
void 0
|
|
3760
|
+
), _defineProperty(
|
|
3688
3761
|
this,
|
|
3689
3762
|
/** @beta */
|
|
3690
3763
|
"context",
|
|
@@ -3692,7 +3765,9 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3692
3765
|
), _classPrivateFieldInitSpec(this, _clientConfig, void 0), _classPrivateFieldInitSpec(this, _httpRequest, void 0), _defineProperty(
|
|
3693
3766
|
this,
|
|
3694
3767
|
/**
|
|
3695
|
-
*
|
|
3768
|
+
* Listen to document changes matching a GROQ query, delivered as server-sent events
|
|
3769
|
+
*
|
|
3770
|
+
* @category Real-time
|
|
3696
3771
|
*/
|
|
3697
3772
|
"listen",
|
|
3698
3773
|
_listen$2
|
|
@@ -3700,6 +3775,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3700
3775
|
}
|
|
3701
3776
|
/**
|
|
3702
3777
|
* Clone the client - returns a new instance
|
|
3778
|
+
*
|
|
3779
|
+
* @category Configuration
|
|
3703
3780
|
*/
|
|
3704
3781
|
clone() {
|
|
3705
3782
|
return new ObservableSanityClient(_classPrivateFieldGet2(_httpRequest, this), this.config());
|
|
@@ -3712,6 +3789,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3712
3789
|
/**
|
|
3713
3790
|
* Clone the client with a new (partial) configuration.
|
|
3714
3791
|
*
|
|
3792
|
+
* @category Configuration
|
|
3793
|
+
*
|
|
3715
3794
|
* @param newConfig - New client configuration properties, shallowly merged with existing configuration
|
|
3716
3795
|
*/
|
|
3717
3796
|
withConfig(newConfig) {
|
|
@@ -3747,6 +3826,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3747
3826
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
3748
3827
|
* If any of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
3749
3828
|
*
|
|
3829
|
+
* @category Querying
|
|
3830
|
+
*
|
|
3750
3831
|
* @param ids - Document IDs to fetch
|
|
3751
3832
|
* @param options - Request options
|
|
3752
3833
|
*/
|
|
@@ -3757,6 +3838,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3757
3838
|
* Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
|
|
3758
3839
|
* Returns a set of the IDs that exist.
|
|
3759
3840
|
*
|
|
3841
|
+
* @category Querying
|
|
3842
|
+
*
|
|
3760
3843
|
* @param ids - Document IDs to check
|
|
3761
3844
|
* @param options - Request options
|
|
3762
3845
|
*/
|
|
@@ -3796,6 +3879,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3796
3879
|
* * Discarding a version with no `releaseId` will discard the draft version of the published document.
|
|
3797
3880
|
* * If the draft or release version does not exist, any error will throw.
|
|
3798
3881
|
*
|
|
3882
|
+
* @category Versions
|
|
3883
|
+
*
|
|
3799
3884
|
* @param params - Version action parameters:
|
|
3800
3885
|
* - `releaseId` - The ID of the release to discard the document from.
|
|
3801
3886
|
* - `publishedId` - The published ID of the document to discard.
|
|
@@ -3839,6 +3924,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3839
3924
|
* @remarks
|
|
3840
3925
|
* * If the published document does not exist, an error will be thrown.
|
|
3841
3926
|
*
|
|
3927
|
+
* @category Versions
|
|
3928
|
+
*
|
|
3842
3929
|
* @param params - Version action parameters:
|
|
3843
3930
|
* - `releaseId` - The ID of the release to unpublish the document from.
|
|
3844
3931
|
* - `publishedId` - The published ID of the document to unpublish.
|
|
@@ -3871,6 +3958,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3871
3958
|
/**
|
|
3872
3959
|
* Create a new transaction of mutations
|
|
3873
3960
|
*
|
|
3961
|
+
* @category Mutations
|
|
3962
|
+
*
|
|
3874
3963
|
* @param operations - Optional array of mutation operations to initialize the transaction instance with
|
|
3875
3964
|
*/
|
|
3876
3965
|
transaction(operations) {
|
|
@@ -3879,6 +3968,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3879
3968
|
/**
|
|
3880
3969
|
* Perform action operations against the configured dataset
|
|
3881
3970
|
*
|
|
3971
|
+
* @category Mutations
|
|
3972
|
+
*
|
|
3882
3973
|
* @param operations - Action operation(s) to execute
|
|
3883
3974
|
* @param options - Action options
|
|
3884
3975
|
*/
|
|
@@ -3888,6 +3979,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3888
3979
|
/**
|
|
3889
3980
|
* Perform an HTTP request against the Sanity API
|
|
3890
3981
|
*
|
|
3982
|
+
* @category HTTP
|
|
3983
|
+
*
|
|
3891
3984
|
* @param options - Request options
|
|
3892
3985
|
*/
|
|
3893
3986
|
request(options) {
|
|
@@ -3896,6 +3989,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3896
3989
|
/**
|
|
3897
3990
|
* Get a Sanity API URL for the URI provided
|
|
3898
3991
|
*
|
|
3992
|
+
* @category HTTP
|
|
3993
|
+
*
|
|
3899
3994
|
* @param uri - URI/path to build URL for
|
|
3900
3995
|
* @param canUseCdn - Whether or not to allow using the API CDN for this route
|
|
3901
3996
|
*/
|
|
@@ -3905,6 +4000,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3905
4000
|
/**
|
|
3906
4001
|
* Get a Sanity API URL for the data operation and path provided
|
|
3907
4002
|
*
|
|
4003
|
+
* @category HTTP
|
|
4004
|
+
*
|
|
3908
4005
|
* @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
|
|
3909
4006
|
* @param path - Path to append after the operation
|
|
3910
4007
|
*/
|
|
@@ -3913,7 +4010,79 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3913
4010
|
}
|
|
3914
4011
|
}, _clientConfig2 = /* @__PURE__ */ new WeakMap(), _httpRequest2 = /* @__PURE__ */ new WeakMap(), SanityClient = class SanityClient {
|
|
3915
4012
|
constructor(httpRequest, config = defaultConfig) {
|
|
3916
|
-
_defineProperty(
|
|
4013
|
+
_defineProperty(
|
|
4014
|
+
this,
|
|
4015
|
+
/**
|
|
4016
|
+
* Upload, fetch and delete assets (images and files) in the configured dataset
|
|
4017
|
+
*
|
|
4018
|
+
* @category Assets
|
|
4019
|
+
*/
|
|
4020
|
+
"assets",
|
|
4021
|
+
void 0
|
|
4022
|
+
), _defineProperty(
|
|
4023
|
+
this,
|
|
4024
|
+
/**
|
|
4025
|
+
* Create, list, edit and delete datasets in the configured project
|
|
4026
|
+
*
|
|
4027
|
+
* @category Projects & Datasets
|
|
4028
|
+
*/
|
|
4029
|
+
"datasets",
|
|
4030
|
+
void 0
|
|
4031
|
+
), _defineProperty(
|
|
4032
|
+
this,
|
|
4033
|
+
/**
|
|
4034
|
+
* Subscribe to live content updates through the Live Content API
|
|
4035
|
+
*
|
|
4036
|
+
* @category Real-time
|
|
4037
|
+
*/
|
|
4038
|
+
"live",
|
|
4039
|
+
void 0
|
|
4040
|
+
), _defineProperty(
|
|
4041
|
+
this,
|
|
4042
|
+
/**
|
|
4043
|
+
* Interact with Media Library assets
|
|
4044
|
+
*
|
|
4045
|
+
* @category Assets
|
|
4046
|
+
*/
|
|
4047
|
+
"mediaLibrary",
|
|
4048
|
+
void 0
|
|
4049
|
+
), _defineProperty(
|
|
4050
|
+
this,
|
|
4051
|
+
/**
|
|
4052
|
+
* Fetch information about the projects the authenticated user has access to
|
|
4053
|
+
*
|
|
4054
|
+
* @category Projects & Datasets
|
|
4055
|
+
*/
|
|
4056
|
+
"projects",
|
|
4057
|
+
void 0
|
|
4058
|
+
), _defineProperty(
|
|
4059
|
+
this,
|
|
4060
|
+
/**
|
|
4061
|
+
* Fetch information about users in the configured project
|
|
4062
|
+
*
|
|
4063
|
+
* @category Projects & Datasets
|
|
4064
|
+
*/
|
|
4065
|
+
"users",
|
|
4066
|
+
void 0
|
|
4067
|
+
), _defineProperty(
|
|
4068
|
+
this,
|
|
4069
|
+
/**
|
|
4070
|
+
* Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
|
|
4071
|
+
*
|
|
4072
|
+
* @category Agent Actions
|
|
4073
|
+
*/
|
|
4074
|
+
"agent",
|
|
4075
|
+
void 0
|
|
4076
|
+
), _defineProperty(this, "collaboration", void 0), _defineProperty(this, "functions", void 0), _defineProperty(
|
|
4077
|
+
this,
|
|
4078
|
+
/**
|
|
4079
|
+
* Create and manage content releases and their scheduled publishing
|
|
4080
|
+
*
|
|
4081
|
+
* @category Releases
|
|
4082
|
+
*/
|
|
4083
|
+
"releases",
|
|
4084
|
+
void 0
|
|
4085
|
+
), _defineProperty(
|
|
3917
4086
|
this,
|
|
3918
4087
|
/** @beta */
|
|
3919
4088
|
"context",
|
|
@@ -3922,13 +4091,17 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3922
4091
|
this,
|
|
3923
4092
|
/**
|
|
3924
4093
|
* Observable version of the Sanity client, with the same configuration as the promise-based one
|
|
4094
|
+
*
|
|
4095
|
+
* @category Configuration
|
|
3925
4096
|
*/
|
|
3926
4097
|
"observable",
|
|
3927
4098
|
void 0
|
|
3928
4099
|
), _classPrivateFieldInitSpec(this, _clientConfig2, void 0), _classPrivateFieldInitSpec(this, _httpRequest2, void 0), _defineProperty(
|
|
3929
4100
|
this,
|
|
3930
4101
|
/**
|
|
3931
|
-
*
|
|
4102
|
+
* Listen to document changes matching a GROQ query, delivered as server-sent events
|
|
4103
|
+
*
|
|
4104
|
+
* @category Real-time
|
|
3932
4105
|
*/
|
|
3933
4106
|
"listen",
|
|
3934
4107
|
_listen$2
|
|
@@ -3936,6 +4109,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3936
4109
|
}
|
|
3937
4110
|
/**
|
|
3938
4111
|
* Clone the client - returns a new instance
|
|
4112
|
+
*
|
|
4113
|
+
* @category Configuration
|
|
3939
4114
|
*/
|
|
3940
4115
|
clone() {
|
|
3941
4116
|
return new SanityClient(_classPrivateFieldGet2(_httpRequest2, this), this.config());
|
|
@@ -3948,6 +4123,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3948
4123
|
/**
|
|
3949
4124
|
* Clone the client with a new (partial) configuration.
|
|
3950
4125
|
*
|
|
4126
|
+
* @category Configuration
|
|
4127
|
+
*
|
|
3951
4128
|
* @param newConfig - New client configuration properties, shallowly merged with existing configuration
|
|
3952
4129
|
*/
|
|
3953
4130
|
withConfig(newConfig) {
|
|
@@ -3983,6 +4160,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3983
4160
|
* The order/position of documents is preserved based on the original array of IDs.
|
|
3984
4161
|
* If any of the documents are missing, they will be replaced by a `null` entry in the returned array
|
|
3985
4162
|
*
|
|
4163
|
+
* @category Querying
|
|
4164
|
+
*
|
|
3986
4165
|
* @param ids - Document IDs to fetch
|
|
3987
4166
|
* @param options - Request options
|
|
3988
4167
|
*/
|
|
@@ -3993,6 +4172,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
3993
4172
|
* Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
|
|
3994
4173
|
* Returns a set of the IDs that exist.
|
|
3995
4174
|
*
|
|
4175
|
+
* @category Querying
|
|
4176
|
+
*
|
|
3996
4177
|
* @param ids - Document IDs to check
|
|
3997
4178
|
* @param options - Request options
|
|
3998
4179
|
*/
|
|
@@ -4032,6 +4213,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4032
4213
|
* * Discarding a version with no `releaseId` will discard the draft version of the published document.
|
|
4033
4214
|
* * If the draft or release version does not exist, any error will throw.
|
|
4034
4215
|
*
|
|
4216
|
+
* @category Versions
|
|
4217
|
+
*
|
|
4035
4218
|
* @param params - Version action parameters:
|
|
4036
4219
|
* - `releaseId` - The ID of the release to discard the document from.
|
|
4037
4220
|
* - `publishedId` - The published ID of the document to discard.
|
|
@@ -4075,6 +4258,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4075
4258
|
* @remarks
|
|
4076
4259
|
* * If the published document does not exist, an error will be thrown.
|
|
4077
4260
|
*
|
|
4261
|
+
* @category Versions
|
|
4262
|
+
*
|
|
4078
4263
|
* @param params - Version action parameters:
|
|
4079
4264
|
* - `releaseId` - The ID of the release to unpublish the document from.
|
|
4080
4265
|
* - `publishedId` - The published ID of the document to unpublish.
|
|
@@ -4107,6 +4292,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4107
4292
|
/**
|
|
4108
4293
|
* Create a new transaction of mutations
|
|
4109
4294
|
*
|
|
4295
|
+
* @category Mutations
|
|
4296
|
+
*
|
|
4110
4297
|
* @param operations - Optional array of mutation operations to initialize the transaction instance with
|
|
4111
4298
|
*/
|
|
4112
4299
|
transaction(operations) {
|
|
@@ -4116,6 +4303,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4116
4303
|
* Perform action operations against the configured dataset
|
|
4117
4304
|
* Returns a promise that resolves to the transaction result
|
|
4118
4305
|
*
|
|
4306
|
+
* @category Mutations
|
|
4307
|
+
*
|
|
4119
4308
|
* @param operations - Action operation(s) to execute
|
|
4120
4309
|
* @param options - Action options
|
|
4121
4310
|
*/
|
|
@@ -4126,6 +4315,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4126
4315
|
* Perform a request against the Sanity API
|
|
4127
4316
|
* NOTE: Only use this for Sanity API endpoints, not for your own APIs!
|
|
4128
4317
|
*
|
|
4318
|
+
* @category HTTP
|
|
4319
|
+
*
|
|
4129
4320
|
* @param options - Request options
|
|
4130
4321
|
* @returns Promise resolving to the response body
|
|
4131
4322
|
*/
|
|
@@ -4148,6 +4339,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4148
4339
|
/**
|
|
4149
4340
|
* Get a Sanity API URL for the URI provided
|
|
4150
4341
|
*
|
|
4342
|
+
* @category HTTP
|
|
4343
|
+
*
|
|
4151
4344
|
* @param uri - URI/path to build URL for
|
|
4152
4345
|
* @param canUseCdn - Whether or not to allow using the API CDN for this route
|
|
4153
4346
|
*/
|
|
@@ -4157,6 +4350,8 @@ var _client$1 = /* @__PURE__ */ new WeakMap(), _httpRequest$2 = /* @__PURE__ */
|
|
|
4157
4350
|
/**
|
|
4158
4351
|
* Get a Sanity API URL for the data operation and path provided
|
|
4159
4352
|
*
|
|
4353
|
+
* @category HTTP
|
|
4354
|
+
*
|
|
4160
4355
|
* @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
|
|
4161
4356
|
* @param path - Path to append after the operation
|
|
4162
4357
|
*/
|