@sanity/client 8.3.0 → 8.5.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-2tz6Sdqp.js → browserUpload-C7PwCs-C.js} +6 -9
- package/dist/browserUpload-C7PwCs-C.js.map +1 -0
- package/dist/{browserUpload-CwpNx7Vl.js → browserUpload-D-2Rmfjo.js} +6 -9
- package/dist/browserUpload-D-2Rmfjo.js.map +1 -0
- package/dist/{config-3wiPP-sZ.js → config-CgJ16jET.js} +4 -2
- package/dist/config-CgJ16jET.js.map +1 -0
- package/dist/csm.js +1 -1
- package/dist/{dist-C9ExSk2R.js → dist-C5K_YcEU.js} +3 -2
- package/dist/{dist-C9ExSk2R.js.map → dist-C5K_YcEU.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1111 -80
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +3561 -53
- package/dist/index.node.js +983 -30
- package/dist/index.node.js.map +1 -1
- package/dist/media-library.d.ts +1 -1
- package/dist/rolldown-runtime-4YWMqDIC.js +9 -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-DbM2fTN4.js → stegaEncodeSourceMap-CO1HKnm2.js} +2 -2
- package/dist/{stegaEncodeSourceMap-DbM2fTN4.js.map → stegaEncodeSourceMap-CO1HKnm2.js.map} +1 -1
- 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-0x2hPfhJ.d.ts → types-CtHEe8SF.d.ts} +3562 -54
- package/package.json +18 -15
- package/src/SanityClient.ts +183 -9
- package/src/agent/actions/AgentActionsClient.ts +8 -2
- package/src/assets/AssetsClient.ts +13 -2
- package/src/config.ts +1 -0
- package/src/context/ContextClient.ts +1006 -0
- package/src/context/openapi.json +5345 -0
- package/src/context/reads.ts +206 -0
- package/src/context/store.ts +100 -0
- package/src/context/types.gen.ts +2428 -0
- package/src/context/types.ts +228 -0
- package/src/data/dataMethods.ts +4 -1
- package/src/data/live.ts +1 -0
- package/src/datasets/DatasetsClient.ts +8 -2
- package/src/defineCreateClient.ts +1 -0
- package/src/http/browserUpload.ts +0 -12
- 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 +68 -4
- package/src/users/UsersClient.ts +8 -2
- package/src/validators.ts +1 -0
- package/dist/browserUpload-2tz6Sdqp.js.map +0 -1
- package/dist/browserUpload-CwpNx7Vl.js.map +0 -1
- package/dist/config-3wiPP-sZ.js.map +0 -1
- package/dist/dist-Z8cIRxoB.js.map +0 -1
- package/dist/stegaClean-C18wLWau.js +0 -21
- package/dist/stegaClean-C18wLWau.js.map +0 -1
package/README.md
CHANGED
|
@@ -61,6 +61,7 @@ export async function updateDocumentTitle(_id, title) {
|
|
|
61
61
|
- [Creating a client instance](#creating-a-client-instance)
|
|
62
62
|
- [ESM](#esm)
|
|
63
63
|
- [TypeScript](#typescript)
|
|
64
|
+
- [Typed query results with Sanity TypeGen](#typed-query-results-with-sanity-typegen)
|
|
64
65
|
- [Next.js App Router](#nextjs-app-router)
|
|
65
66
|
- [Bun](#bun)
|
|
66
67
|
- [Deno](#deno)
|
|
@@ -241,6 +242,52 @@ console.log(`Number of documents: ${data}`)
|
|
|
241
242
|
|
|
242
243
|
Another alternative is [groqd].
|
|
243
244
|
|
|
245
|
+
#### Typed query results with [Sanity TypeGen](https://www.sanity.io/docs/sanity-typegen)
|
|
246
|
+
|
|
247
|
+
`client.fetch` looks the query string up in the global `SanityQueries` interface and returns the registered result type when it finds one. `sanity typegen generate` writes these registrations for you, one per query it finds in your code, but the mechanism is plain interface merging:
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
import {createClient} from '@sanity/client'
|
|
251
|
+
|
|
252
|
+
// Generated by `sanity typegen`, or written by hand
|
|
253
|
+
declare global {
|
|
254
|
+
interface SanityQueries {
|
|
255
|
+
'*[_type == "post"]': {_id: string; title: string}[]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const client = createClient({
|
|
260
|
+
projectId: 'your-project-id',
|
|
261
|
+
dataset: 'your-dataset-name',
|
|
262
|
+
apiVersion: '2025-02-06',
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
const posts = await client.fetch('*[_type == "post"]')
|
|
266
|
+
// posts is typed as `{_id: string; title: string}[]`, no generic needed
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
The registry is a global interface rather than a module augmentation of `@sanity/client`, so it does not depend on module resolution: a registration is seen whether or not `@sanity/client` is a direct dependency of the file that makes it, however many copies of the client are installed (a copy nested inside another package reads the same registry), and from every entry point, `@sanity/client/stega` included.
|
|
270
|
+
|
|
271
|
+
Two more forms are accepted:
|
|
272
|
+
|
|
273
|
+
- The module augmentation that earlier TypeGen releases generated keeps working. It registers on the `SanityQueries` interface exported from `@sanity/client`, which inherits the global one:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
declare module '@sanity/client' {
|
|
277
|
+
interface SanityQueries {
|
|
278
|
+
'*[_type == "post"]': {_id: string; title: string}[]
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
- Releases of `@sanity/client` that predate the global registry only read that exported interface. A generated file that registers queries globally can still reach them with an augmentation that adds nothing but a base type, which is what `sanity typegen` emits alongside the global registry. It is a harmless duplicate on releases that already inherit the global, so the same generated file works with either:
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
declare module '@sanity/client' {
|
|
287
|
+
interface SanityQueries extends globalThis.SanityQueries {}
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
244
291
|
#### [Next.js App Router](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#fetching-data-on-the-server-with-fetch)
|
|
245
292
|
|
|
246
293
|
```tsx
|
|
@@ -827,7 +874,7 @@ const videoAsset = stegaClean(result.videoAsset)
|
|
|
827
874
|
|
|
828
875
|
Strings with stega payloads contain invisible characters, so comparing them against string literals fails in surprising ways: `imageLocation === 'left'` is `false` even though `imageLocation` looks exactly like `'left'` when logged. The branded types available on `@sanity/client/stega` turn these bugs into compile errors.
|
|
829
876
|
|
|
830
|
-
If you use [Sanity TypeGen](https://www.sanity.io/docs/sanity-typegen), pass `ClientReturnStega` as the first generic to `client.fetch` and every string in the result that may contain stega payloads is branded as `StegaString
|
|
877
|
+
If you use [Sanity TypeGen](https://www.sanity.io/docs/sanity-typegen), pass `ClientReturnStega` as the first generic to `client.fetch` and every string in the result that may contain stega payloads is branded as `StegaString`. It looks the query up in the same `SanityQueries` registry as `client.fetch` does (see [Typed query results with Sanity TypeGen](#typed-query-results-with-sanity-typegen)):
|
|
831
878
|
|
|
832
879
|
```ts
|
|
833
880
|
import {createClient} from '@sanity/client'
|
|
@@ -2260,11 +2307,23 @@ When you configure the client with a Media Library resource, you can use familia
|
|
|
2260
2307
|
|
|
2261
2308
|
#### Configuration
|
|
2262
2309
|
|
|
2310
|
+
> [!NOTE]
|
|
2311
|
+
>
|
|
2312
|
+
> Requires API version `2025-03-25` or later.
|
|
2313
|
+
|
|
2314
|
+
Getting playback information requires authentication. Use a token when calling this API from
|
|
2315
|
+
server-side code. In a browser, use `withCredentials: true` instead of exposing a token in client-side
|
|
2316
|
+
code.
|
|
2317
|
+
|
|
2318
|
+
Media Library resource clients send requests to the global API host (`api.sanity.io`), which does not
|
|
2319
|
+
support CORS. This configuration therefore only works outside the browser:
|
|
2320
|
+
|
|
2263
2321
|
```js
|
|
2264
2322
|
import {createClient} from '@sanity/client'
|
|
2265
2323
|
|
|
2266
2324
|
const client = createClient({
|
|
2267
|
-
token:
|
|
2325
|
+
token: process.env.SANITY_API_READ_TOKEN,
|
|
2326
|
+
apiVersion: '2025-03-25',
|
|
2268
2327
|
useCdn: false,
|
|
2269
2328
|
resource: {
|
|
2270
2329
|
type: 'media-library',
|
|
@@ -2273,6 +2332,19 @@ const client = createClient({
|
|
|
2273
2332
|
})
|
|
2274
2333
|
```
|
|
2275
2334
|
|
|
2335
|
+
For browser usage, configure the client with a project ID so requests use the CORS-enabled project
|
|
2336
|
+
API host. Enable credentials and include the browser's origin in
|
|
2337
|
+
[your project's CORS settings](https://www.sanity.io/docs/content-lake/browser-security-and-cors):
|
|
2338
|
+
|
|
2339
|
+
```js
|
|
2340
|
+
const browserClient = createClient({
|
|
2341
|
+
projectId: 'yourProjectId',
|
|
2342
|
+
apiVersion: '2025-03-25',
|
|
2343
|
+
useCdn: false,
|
|
2344
|
+
withCredentials: true,
|
|
2345
|
+
})
|
|
2346
|
+
```
|
|
2347
|
+
|
|
2276
2348
|
#### Querying assets
|
|
2277
2349
|
|
|
2278
2350
|
Use `client.fetch()` to query assets in your Media Library using GROQ:
|
|
@@ -2329,6 +2401,10 @@ await client
|
|
|
2329
2401
|
|
|
2330
2402
|
For video assets, use the specialized `getPlaybackInfo()` method to retrieve streaming URLs:
|
|
2331
2403
|
|
|
2404
|
+
> [!NOTE]
|
|
2405
|
+
>
|
|
2406
|
+
> See [Configuration](#configuration) for authentication and browser CORS requirements.
|
|
2407
|
+
|
|
2332
2408
|
```js
|
|
2333
2409
|
// Basic usage with video asset ID
|
|
2334
2410
|
const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo(
|
|
@@ -2347,9 +2423,9 @@ const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo(
|
|
|
2347
2423
|
},
|
|
2348
2424
|
)
|
|
2349
2425
|
|
|
2350
|
-
// Using
|
|
2426
|
+
// Using a Media Library asset reference
|
|
2351
2427
|
const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo({
|
|
2352
|
-
_ref: 'media-library:mlZxz9rvqf76:30rh9U3GDEK3ToiId1Zje4uvalC',
|
|
2428
|
+
_ref: 'media-library:mlZxz9rvqf76:video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4',
|
|
2353
2429
|
})
|
|
2354
2430
|
```
|
|
2355
2431
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { a as ServerError, n as parseJsonText, r as ClientError, s as httpResponseFromFetch } from "./request-SnMg7nUX.js";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
|
-
import { createDebug } from "obug";
|
|
4
|
-
const log = createDebug("sanity:client");
|
|
5
|
-
let nextRequestId = 1;
|
|
6
3
|
/**
|
|
7
4
|
* Run an asset upload through `XMLHttpRequest` so we can surface per-chunk
|
|
8
5
|
* upload progress events. get-it v9 / fetch has no equivalent hook in the
|
|
@@ -13,8 +10,8 @@ let nextRequestId = 1;
|
|
|
13
10
|
*/
|
|
14
11
|
function uploadWithProgress(options) {
|
|
15
12
|
return new Observable((subscriber) => {
|
|
16
|
-
let xhr = new XMLHttpRequest(),
|
|
17
|
-
|
|
13
|
+
let xhr = new XMLHttpRequest(), { url, method, headers, body, withCredentials, timeout, signal } = options;
|
|
14
|
+
xhr.open(method, url), xhr.withCredentials = withCredentials, typeof timeout == "number" && timeout > 0 && (xhr.timeout = timeout);
|
|
18
15
|
for (let [key, value] of Object.entries(headers)) xhr.setRequestHeader(key, value);
|
|
19
16
|
xhr.upload.onprogress = (e) => {
|
|
20
17
|
subscriber.next({
|
|
@@ -26,7 +23,7 @@ function uploadWithProgress(options) {
|
|
|
26
23
|
lengthComputable: e.lengthComputable
|
|
27
24
|
});
|
|
28
25
|
}, xhr.onload = () => {
|
|
29
|
-
if (
|
|
26
|
+
if (xhr.status >= 400) {
|
|
30
27
|
let errorHeaders = parseXhrResponseHeaders(xhr.getAllResponseHeaders()), canonical = httpResponseFromFetch({
|
|
31
28
|
status: xhr.status,
|
|
32
29
|
statusText: xhr.statusText,
|
|
@@ -49,9 +46,9 @@ function uploadWithProgress(options) {
|
|
|
49
46
|
body: responseBody
|
|
50
47
|
}), subscriber.complete();
|
|
51
48
|
}, xhr.onerror = () => {
|
|
52
|
-
|
|
49
|
+
subscriber.error(/* @__PURE__ */ Error("XHR upload network error"));
|
|
53
50
|
}, xhr.ontimeout = () => {
|
|
54
|
-
|
|
51
|
+
subscriber.error(new DOMException(`The operation timed out after ${timeout}ms while attempting to reach ${url}`, "TimeoutError"));
|
|
55
52
|
}, xhr.onabort = () => {
|
|
56
53
|
subscriber.error(new DOMException("Upload aborted", "AbortError"));
|
|
57
54
|
};
|
|
@@ -84,4 +81,4 @@ function parseXhrResponseHeaders(raw) {
|
|
|
84
81
|
}
|
|
85
82
|
export { uploadWithProgress };
|
|
86
83
|
|
|
87
|
-
//# sourceMappingURL=browserUpload-
|
|
84
|
+
//# sourceMappingURL=browserUpload-C7PwCs-C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserUpload-C7PwCs-C.js","names":[],"sources":["../src/http/browserUpload.ts"],"sourcesContent":["import {Observable} from 'rxjs'\n\nimport type {UploadEvent} from '../types'\nimport {ClientError, httpResponseFromFetch, ServerError} from './errors'\nimport {parseJsonText} from './request'\n\n/**\n * Options for a browser-side asset upload that needs progress events.\n *\n * @internal\n */\nexport interface BrowserUploadOptions {\n url: string\n method: string\n headers: Record<string, string>\n body: unknown\n withCredentials: boolean\n /** Milliseconds before the upload is aborted; `false` and `0` both disable the timeout. */\n timeout?: number | false\n signal?: AbortSignal\n}\n\n/**\n * Run an asset upload through `XMLHttpRequest` so we can surface per-chunk\n * upload progress events. get-it v9 / fetch has no equivalent hook in the\n * browser, so the observable asset-upload API falls back to this path when\n * `XMLHttpRequest` is available.\n *\n * @internal\n */\nexport function uploadWithProgress<T>(options: BrowserUploadOptions): Observable<UploadEvent<T>> {\n return new Observable<UploadEvent<T>>((subscriber) => {\n const xhr = new XMLHttpRequest()\n const {url, method, headers, body, withCredentials, timeout, signal} = options\n\n xhr.open(method, url)\n xhr.withCredentials = withCredentials\n if (typeof timeout === 'number' && timeout > 0) {\n xhr.timeout = timeout\n }\n\n for (const [key, value] of Object.entries(headers)) {\n xhr.setRequestHeader(key, value)\n }\n\n xhr.upload.onprogress = (e) => {\n subscriber.next({\n type: 'progress',\n stage: 'upload',\n percent: e.lengthComputable ? Math.round((e.loaded / e.total) * 100) : 0,\n total: e.total || undefined,\n loaded: e.loaded,\n lengthComputable: e.lengthComputable,\n })\n }\n\n xhr.onload = () => {\n if (xhr.status >= 400) {\n // Same typed errors as the fetch transport, so consumers can keep\n // detecting `ClientError`/`ServerError` and reading `statusCode`,\n // `responseBody` and the structured API `details` on failed uploads.\n const errorHeaders = parseXhrResponseHeaders(xhr.getAllResponseHeaders())\n const canonical = httpResponseFromFetch(\n {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: errorHeaders,\n body: parseJsonText(xhr.responseText, errorHeaders),\n url: xhr.responseURL,\n },\n url,\n method,\n )\n subscriber.error(\n xhr.status >= 500 ? new ServerError(canonical) : new ClientError(canonical),\n )\n return\n }\n\n let responseBody: T\n try {\n responseBody = JSON.parse(xhr.responseText) as T\n } catch {\n subscriber.error(new Error('Failed to parse upload response as JSON'))\n return\n }\n\n subscriber.next({type: 'response', body: responseBody})\n subscriber.complete()\n }\n\n xhr.onerror = () => {\n subscriber.error(new Error('XHR upload network error'))\n }\n\n xhr.ontimeout = () => {\n // Same error shape as the fetch transport's timeout rejection.\n subscriber.error(\n new DOMException(\n `The operation timed out after ${timeout}ms while attempting to reach ${url}`,\n 'TimeoutError',\n ),\n )\n }\n\n xhr.onabort = () => {\n subscriber.error(new DOMException('Upload aborted', 'AbortError'))\n }\n\n const onSignalAbort = () => xhr.abort()\n if (signal) {\n if (signal.aborted) {\n // `xhr.abort()` before `send()` fires no `abort` event per spec, so\n // error out directly instead of relying on `onabort`.\n subscriber.error(new DOMException('Upload aborted', 'AbortError'))\n return undefined\n }\n signal.addEventListener('abort', onSignalAbort, {once: true})\n }\n\n xhr.send(body as XMLHttpRequestBodyInit)\n\n // Unsubscribing cancels the in-flight upload, mirroring how the fetch\n // path aborts its request (`_observe`). After settle this is a no-op —\n // except for detaching from the caller's signal, which may be long-lived\n // and must not accumulate a listener per upload.\n return () => {\n signal?.removeEventListener('abort', onSignalAbort)\n xhr.abort()\n }\n })\n}\n\n/**\n * Parse `XMLHttpRequest.getAllResponseHeaders()` output (CRLF-separated\n * `name: value` lines) into a `Headers` instance.\n */\nfunction parseXhrResponseHeaders(raw: string): Headers {\n const headers = new Headers()\n for (const line of raw.split('\\r\\n')) {\n const separator = line.indexOf(':')\n if (separator <= 0) continue\n try {\n headers.append(line.slice(0, separator).trim(), line.slice(separator + 1).trim())\n } catch {\n // Skip header lines the Headers constructor rejects — better a partial\n // header record on the error than no error details at all.\n }\n }\n return headers\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,mBAAsB,SAA2D;CAC/F,OAAO,IAAI,YAA4B,eAAe;EACpD,IAAM,MAAM,IAAI,eAAe,GACzB,EAAC,KAAK,QAAQ,SAAS,MAAM,iBAAiB,SAAS,WAAU;EAIvE,AAFA,IAAI,KAAK,QAAQ,GAAG,GACpB,IAAI,kBAAkB,iBAClB,OAAO,WAAY,YAAY,UAAU,MAC3C,IAAI,UAAU;EAGhB,KAAK,IAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,GAC/C,IAAI,iBAAiB,KAAK,KAAK;EA+DjC,AA5DA,IAAI,OAAO,cAAc,MAAM;GAC7B,WAAW,KAAK;IACd,MAAM;IACN,OAAO;IACP,SAAS,EAAE,mBAAmB,KAAK,MAAO,EAAE,SAAS,EAAE,QAAS,GAAG,IAAI;IACvE,OAAO,EAAE,SAAS,KAAA;IAClB,QAAQ,EAAE;IACV,kBAAkB,EAAE;GACtB,CAAC;EACH,GAEA,IAAI,eAAe;GACjB,IAAI,IAAI,UAAU,KAAK;IAIrB,IAAM,e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KAAK,MAAM,GAAG,SAAS,CAAC,CAAC,KAAK,GAAG,KAAK,MAAM,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;EAClF,QAAQ,CAGR;CACF;CACA,OAAO;AACT"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { a as ServerError, n as parseJsonText, r as ClientError, s as httpResponseFromFetch } from "./request-BhMuKj0D.js";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
|
-
import { createDebug } from "obug";
|
|
4
|
-
const log = createDebug("sanity:client");
|
|
5
|
-
let nextRequestId = 1;
|
|
6
3
|
/**
|
|
7
4
|
* Run an asset upload through `XMLHttpRequest` so we can surface per-chunk
|
|
8
5
|
* upload progress events. get-it v9 / fetch has no equivalent hook in the
|
|
@@ -13,8 +10,8 @@ let nextRequestId = 1;
|
|
|
13
10
|
*/
|
|
14
11
|
function uploadWithProgress(options) {
|
|
15
12
|
return new Observable((subscriber) => {
|
|
16
|
-
let xhr = new XMLHttpRequest(),
|
|
17
|
-
|
|
13
|
+
let xhr = new XMLHttpRequest(), { url, method, headers, body, withCredentials, timeout, signal } = options;
|
|
14
|
+
xhr.open(method, url), xhr.withCredentials = withCredentials, typeof timeout == "number" && timeout > 0 && (xhr.timeout = timeout);
|
|
18
15
|
for (let [key, value] of Object.entries(headers)) xhr.setRequestHeader(key, value);
|
|
19
16
|
xhr.upload.onprogress = (e) => {
|
|
20
17
|
subscriber.next({
|
|
@@ -26,7 +23,7 @@ function uploadWithProgress(options) {
|
|
|
26
23
|
lengthComputable: e.lengthComputable
|
|
27
24
|
});
|
|
28
25
|
}, xhr.onload = () => {
|
|
29
|
-
if (
|
|
26
|
+
if (xhr.status >= 400) {
|
|
30
27
|
let errorHeaders = parseXhrResponseHeaders(xhr.getAllResponseHeaders()), canonical = httpResponseFromFetch({
|
|
31
28
|
status: xhr.status,
|
|
32
29
|
statusText: xhr.statusText,
|
|
@@ -49,9 +46,9 @@ function uploadWithProgress(options) {
|
|
|
49
46
|
body: responseBody
|
|
50
47
|
}), subscriber.complete();
|
|
51
48
|
}, xhr.onerror = () => {
|
|
52
|
-
|
|
49
|
+
subscriber.error(/* @__PURE__ */ Error("XHR upload network error"));
|
|
53
50
|
}, xhr.ontimeout = () => {
|
|
54
|
-
|
|
51
|
+
subscriber.error(new DOMException(`The operation timed out after ${timeout}ms while attempting to reach ${url}`, "TimeoutError"));
|
|
55
52
|
}, xhr.onabort = () => {
|
|
56
53
|
subscriber.error(new DOMException("Upload aborted", "AbortError"));
|
|
57
54
|
};
|
|
@@ -84,4 +81,4 @@ function parseXhrResponseHeaders(raw) {
|
|
|
84
81
|
}
|
|
85
82
|
export { uploadWithProgress };
|
|
86
83
|
|
|
87
|
-
//# sourceMappingURL=browserUpload-
|
|
84
|
+
//# sourceMappingURL=browserUpload-D-2Rmfjo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserUpload-D-2Rmfjo.js","names":[],"sources":["../src/http/browserUpload.ts"],"sourcesContent":["import {Observable} from 'rxjs'\n\nimport type {UploadEvent} from '../types'\nimport {ClientError, httpResponseFromFetch, ServerError} from './errors'\nimport {parseJsonText} from './request'\n\n/**\n * Options for a browser-side asset upload that needs progress events.\n *\n * @internal\n */\nexport interface BrowserUploadOptions {\n url: string\n method: string\n headers: Record<string, string>\n body: unknown\n withCredentials: boolean\n /** Milliseconds before the upload is aborted; `false` and `0` both disable the timeout. */\n timeout?: number | false\n signal?: AbortSignal\n}\n\n/**\n * Run an asset upload through `XMLHttpRequest` so we can surface per-chunk\n * upload progress events. get-it v9 / fetch has no equivalent hook in the\n * browser, so the observable asset-upload API falls back to this path when\n * `XMLHttpRequest` is available.\n *\n * @internal\n */\nexport function uploadWithProgress<T>(options: BrowserUploadOptions): Observable<UploadEvent<T>> {\n return new Observable<UploadEvent<T>>((subscriber) => {\n const xhr = new XMLHttpRequest()\n const {url, method, headers, body, withCredentials, timeout, signal} = options\n\n xhr.open(method, url)\n xhr.withCredentials = withCredentials\n if (typeof timeout === 'number' && timeout > 0) {\n xhr.timeout = timeout\n }\n\n for (const [key, value] of Object.entries(headers)) {\n xhr.setRequestHeader(key, value)\n }\n\n xhr.upload.onprogress = (e) => {\n subscriber.next({\n type: 'progress',\n stage: 'upload',\n percent: e.lengthComputable ? Math.round((e.loaded / e.total) * 100) : 0,\n total: e.total || undefined,\n loaded: e.loaded,\n lengthComputable: e.lengthComputable,\n })\n }\n\n xhr.onload = () => {\n if (xhr.status >= 400) {\n // Same typed errors as the fetch transport, so consumers can keep\n // detecting `ClientError`/`ServerError` and reading `statusCode`,\n // `responseBody` and the structured API `details` on failed uploads.\n const errorHeaders = parseXhrResponseHeaders(xhr.getAllResponseHeaders())\n const canonical = httpResponseFromFetch(\n {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: errorHeaders,\n body: parseJsonText(xhr.responseText, errorHeaders),\n url: xhr.responseURL,\n },\n url,\n method,\n )\n subscriber.error(\n xhr.status >= 500 ? new ServerError(canonical) : new ClientError(canonical),\n )\n return\n }\n\n let responseBody: T\n try {\n responseBody = JSON.parse(xhr.responseText) as T\n } catch {\n subscriber.error(new Error('Failed to parse upload response as JSON'))\n return\n }\n\n subscriber.next({type: 'response', body: responseBody})\n subscriber.complete()\n }\n\n xhr.onerror = () => {\n subscriber.error(new Error('XHR upload network error'))\n }\n\n xhr.ontimeout = () => {\n // Same error shape as the fetch transport's timeout rejection.\n subscriber.error(\n new DOMException(\n `The operation timed out after ${timeout}ms while attempting to reach ${url}`,\n 'TimeoutError',\n ),\n )\n }\n\n xhr.onabort = () => {\n subscriber.error(new DOMException('Upload aborted', 'AbortError'))\n }\n\n const onSignalAbort = () => xhr.abort()\n if (signal) {\n if (signal.aborted) {\n // `xhr.abort()` before `send()` fires no `abort` event per spec, so\n // error out directly instead of relying on `onabort`.\n subscriber.error(new DOMException('Upload aborted', 'AbortError'))\n return undefined\n }\n signal.addEventListener('abort', onSignalAbort, {once: true})\n }\n\n xhr.send(body as XMLHttpRequestBodyInit)\n\n // Unsubscribing cancels the in-flight upload, mirroring how the fetch\n // path aborts its request (`_observe`). After settle this is a no-op —\n // except for detaching from the caller's signal, which may be long-lived\n // and must not accumulate a listener per upload.\n return () => {\n signal?.removeEventListener('abort', onSignalAbort)\n xhr.abort()\n }\n })\n}\n\n/**\n * Parse `XMLHttpRequest.getAllResponseHeaders()` output (CRLF-separated\n * `name: value` lines) into a `Headers` instance.\n */\nfunction parseXhrResponseHeaders(raw: string): Headers {\n const headers = new Headers()\n for (const line of raw.split('\\r\\n')) {\n const separator = line.indexOf(':')\n if (separator <= 0) continue\n try {\n headers.append(line.slice(0, separator).trim(), line.slice(separator + 1).trim())\n } catch {\n // Skip header lines the Headers constructor rejects — better a partial\n // header record on the error than no error details at all.\n }\n }\n return headers\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,mBAAsB,SAA2D;CAC/F,OAAO,IAAI,YAA4B,eAAe;EACpD,IAAM,MAAM,IAAI,eAAe,GACzB,EAAC,KAAK,QAAQ,SAAS,MAAM,iBAAiB,SAAS,WAAU;EAIvE,AAFA,IAAI,KAAK,QAAQ,GAAG,GACpB,IAAI,kBAAkB,iBAClB,OAAO,WAAY,YAAY,UAAU,MAC3C,IAAI,UAAU;EAGhB,KAAK,IAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,GAC/C,IAAI,iBAAiB,KAAK,KAAK;EA+DjC,AA5DA,IAAI,OAAO,cAAc,MAAM;GAC7B,WAAW,KAAK;IACd,MAAM;IACN,OAAO;IACP,SAAS,EAAE,mBAAmB,KAAK,MAAO,EAAE,SAAS,EAAE,QAAS,GAAG,IAAI;IACvE,OAAO,EAAE,SAAS,KAAA;IAClB,QAAQ,EAAE;IACV,kBAAkB,EAAE;GACtB,CAAC;EACH,GAEA,IAAI,eAAe;GACjB,IAAI,IAAI,UAAU,KAAK;IAIrB,IAAM,eAAe,wBAAwB,IAAI,sBAAsB,CAAC,GAClE,YAAY,sBAChB;KACE,QAAQ,IAAI;KACZ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C,CAAC,KAAK,CAAC;EAClF,QAAQ,CAGR;CACF;CACA,OAAO;AACT"}
|
|
@@ -54,6 +54,7 @@ const VALID_ASSET_TYPES = ["image", "file"], VALID_INSERT_LOCATIONS = [
|
|
|
54
54
|
if (id.split(".").length !== 2) throw Error("Dataset resource ID must be in the format \"project.dataset\"");
|
|
55
55
|
return;
|
|
56
56
|
case "dashboard":
|
|
57
|
+
case "knowledge-base":
|
|
57
58
|
case "media-library":
|
|
58
59
|
case "canvas": return;
|
|
59
60
|
default: throw Error(`Unsupported resource type: ${type.toString()}`);
|
|
@@ -102,7 +103,8 @@ const initConfig = (config, prevConfig) => {
|
|
|
102
103
|
specifiedConfig.apiVersion || printNoApiVersionSpecifiedWarning();
|
|
103
104
|
let newConfig = {
|
|
104
105
|
...defaultConfig,
|
|
105
|
-
...specifiedConfig
|
|
106
|
+
...specifiedConfig,
|
|
107
|
+
apiHost: specifiedConfig.apiHost ?? defaultConfig.apiHost
|
|
106
108
|
};
|
|
107
109
|
newConfig["~experimental_resource"] && !newConfig.resource && (printDeprecatedResourceConfigWarning(), newConfig.resource = newConfig["~experimental_resource"]);
|
|
108
110
|
let resourceConfig$1 = newConfig.resource, projectBased = newConfig.useProjectHostname && !resourceConfig$1;
|
|
@@ -123,4 +125,4 @@ const initConfig = (config, prevConfig) => {
|
|
|
123
125
|
};
|
|
124
126
|
export { validateDocumentId as _, printCreateVersionWithBaseIdWarning as a, validateVersionIdMatch as b, printPreviewDraftsDeprecationWarning as c, requestTag as d, requireDocumentId as f, validateAssetType as g, resourceGuard as h, printCdnPreviewDraftsWarning as i, dataset as l, resourceConfig as m, initConfig as n, printDeprecatedUriOptionWarning as o, requireDocumentType as p, validateApiPerspective as r, printNoDefaultExport as s, defaultConfig as t, hasDataset as u, validateInsert as v, validateObject as y };
|
|
125
127
|
|
|
126
|
-
//# sourceMappingURL=config-
|
|
128
|
+
//# sourceMappingURL=config-CgJ16jET.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CgJ16jET.js","names":["resourceConfig","validate.requestTag"],"sources":["../src/generateHelpUrl.ts","../src/validators.ts","../src/util/once.ts","../src/warnings.ts","../src/config.ts"],"sourcesContent":["const BASE_URL = 'https://www.sanity.io/help/'\n\nexport function generateHelpUrl(slug: string) {\n return BASE_URL + slug\n}\n","import type {Any, InitializedClientConfig, SanityDocumentStub} from './types'\n\nconst VALID_ASSET_TYPES = ['image', 'file']\nconst VALID_INSERT_LOCATIONS = ['before', 'after', 'replace']\n\nexport const dataset = (name: string) => {\n if (!/^(~[a-z0-9]{1}[-\\w]{0,63}|[a-z0-9]{1}[-\\w]{0,63})$/.test(name)) {\n throw new Error(\n 'Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters',\n )\n }\n}\n\nexport const projectId = (id: string) => {\n if (!/^[-a-z0-9]+$/i.test(id)) {\n throw new Error('`projectId` can only contain only a-z, 0-9 and dashes')\n }\n}\n\nexport const validateAssetType = (type: string) => {\n if (VALID_ASSET_TYPES.indexOf(type) === -1) {\n throw new Error(`Invalid asset type: ${type}. Must be one of ${VALID_ASSET_TYPES.join(', ')}`)\n }\n}\n\nexport const validateObject = (op: string, val: Any) => {\n if (val === null || typeof val !== 'object' || Array.isArray(val)) {\n throw new Error(`${op}() takes an object of properties`)\n }\n}\n\nexport const validateDocumentId = (op: string, id: string) => {\n if (typeof id !== 'string' || !/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(id) || id.includes('..')) {\n throw new Error(`${op}(): \"${id}\" is not a valid document ID`)\n }\n}\n\nexport const requireDocumentId = (op: string, doc: Record<string, Any>) => {\n if (!doc._id) {\n throw new Error(`${op}() requires that the document contains an ID (\"_id\" property)`)\n }\n\n validateDocumentId(op, doc._id)\n}\n\nconst validateDocumentType = (op: string, type: string) => {\n if (typeof type !== 'string') {\n throw new Error(`\\`${op}()\\`: \\`${type}\\` is not a valid document type`)\n }\n}\n\nexport const requireDocumentType = (op: string, doc: Record<string, Any>) => {\n if (!doc._type) {\n throw new Error(`\\`${op}()\\` requires that the document contains a type (\\`_type\\` property)`)\n }\n\n validateDocumentType(op, doc._type)\n}\n\nexport const validateVersionIdMatch = (builtVersionId: string, document: SanityDocumentStub) => {\n if (document._id && document._id !== builtVersionId) {\n throw new Error(\n `The provided document ID (\\`${document._id}\\`) does not match the generated version ID (\\`${builtVersionId}\\`)`,\n )\n }\n}\n\nexport const validateInsert = (at: string, selector: string, items: Any[]) => {\n const signature = 'insert(at, selector, items)'\n if (VALID_INSERT_LOCATIONS.indexOf(at) === -1) {\n const valid = VALID_INSERT_LOCATIONS.map((loc) => `\"${loc}\"`).join(', ')\n throw new Error(`${signature} takes an \"at\"-argument which is one of: ${valid}`)\n }\n\n if (typeof selector !== 'string') {\n throw new Error(`${signature} takes a \"selector\"-argument which must be a string`)\n }\n\n if (!Array.isArray(items)) {\n throw new Error(`${signature} takes an \"items\"-argument which must be an array`)\n }\n}\n\nexport const hasDataset = (config: InitializedClientConfig): string => {\n // Check if dataset is directly on the config\n if (config.dataset) {\n return config.dataset\n }\n\n // Check if dataset is in resource configuration\n // Note: ~experimental_resource is normalized to resource during client initialization\n const resource = config.resource\n if (resource && resource.type === 'dataset') {\n const segments = resource.id.split('.')\n if (segments.length !== 2) {\n throw new Error('Dataset resource ID must be in the format \"project.dataset\"')\n }\n return segments[1]\n }\n\n throw new Error('`dataset` must be provided to perform queries')\n}\n\nexport const requestTag = (tag: string) => {\n if (typeof tag !== 'string' || !/^[a-z0-9._-]{1,75}$/i.test(tag)) {\n throw new Error(\n `Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.`,\n )\n }\n\n return tag\n}\n\nexport const resourceConfig = (config: InitializedClientConfig): void => {\n // Note: ~experimental_resource is normalized to resource during client initialization\n const resource = config.resource\n if (!resource) {\n throw new Error('`resource` must be provided to perform resource queries')\n }\n const {type, id} = resource\n\n switch (type) {\n case 'dataset': {\n const segments = id.split('.')\n if (segments.length !== 2) {\n throw new Error('Dataset resource ID must be in the format \"project.dataset\"')\n }\n return\n }\n case 'dashboard':\n case 'knowledge-base':\n case 'media-library':\n case 'canvas': {\n return\n }\n default:\n // @ts-expect-error - handle all supported resource types\n throw new Error(`Unsupported resource type: ${type.toString()}`)\n }\n}\n\nexport const resourceGuard = (service: string, config: InitializedClientConfig): void => {\n // Note: ~experimental_resource is normalized to resource during client initialization\n const resource = config.resource\n if (resource) {\n throw new Error(`\\`${service}\\` does not support resource-based operations`)\n }\n}\n","import type {Any} from '../types'\n\nexport function once(fn: Any) {\n let didCall = false\n let returnValue: Any\n return (...args: Any[]) => {\n if (didCall) {\n return returnValue\n }\n returnValue = fn(...args)\n didCall = true\n return returnValue\n }\n}\n","import {generateHelpUrl} from './generateHelpUrl'\nimport {type Any} from './types'\nimport {once} from './util/once'\n\nconst createWarningPrinter = (message: string[]) =>\n // oxlint-disable-next-line no-console\n once((...args: Any[]) => console.warn(message.join(' '), ...args))\n\nexport const printCdnAndWithCredentialsWarning = createWarningPrinter([\n `Because you set \\`withCredentials\\` to true, we will override your \\`useCdn\\``,\n `setting to be false since (cookie-based) credentials are never set on the CDN`,\n])\n\nexport const printCdnWarning = createWarningPrinter([\n `Since you haven't set a value for \\`useCdn\\`, we will deliver content using our`,\n `global, edge-cached API-CDN. If you wish to have content delivered faster, set`,\n `\\`useCdn: false\\` to use the Live API. Note: You may incur higher costs using the live API.`,\n])\n\nexport const printCdnPreviewDraftsWarning = createWarningPrinter([\n `The Sanity client is configured with the \\`perspective\\` set to \\`drafts\\` or \\`previewDrafts\\`, which doesn't support the API-CDN.`,\n `The Live API will be used instead. Set \\`useCdn: false\\` in your configuration to hide this warning.`,\n])\n\nexport const printPreviewDraftsDeprecationWarning = createWarningPrinter([\n `The \\`previewDrafts\\` perspective has been renamed to \\`drafts\\` and will be removed in a future API version`,\n])\n\nexport const printBrowserTokenWarning = createWarningPrinter([\n 'You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.',\n `See ${generateHelpUrl(\n 'js-client-browser-token',\n )} for more information and how to hide this warning.`,\n])\n\nexport const printCredentialedTokenWarning = createWarningPrinter([\n 'You have configured Sanity client to use a token, but also provided `withCredentials: true`.',\n 'This is no longer supported - only token will be used - remove `withCredentials: true`.',\n])\n\nexport const printNoApiVersionSpecifiedWarning = createWarningPrinter([\n 'Using the Sanity client without specifying an API version is deprecated.',\n `See ${generateHelpUrl('js-client-api-version')}`,\n])\n\nexport const printNoDefaultExport = createWarningPrinter([\n 'The default export of @sanity/client has been deprecated. Use the named export `createClient` instead.',\n])\n\n// Phrased as a condition rather than as a correction, because the client cannot\n// tell the two cases apart. `baseId` creates a version of a document that\n// already exists, so a caller creating a genuinely new document inside a release\n// has no alternative to `document` - and the previous wording told them they had\n// picked the wrong approach when they had not.\nexport const printCreateVersionWithBaseIdWarning = createWarningPrinter([\n 'You have called `createVersion()` with a defined `document`.',\n 'If you are creating a version of a document that already exists, prefer providing `baseId` and `releaseId` instead.',\n])\n\nexport const printDeprecatedUriOptionWarning = createWarningPrinter([\n 'The `uri` request option has been renamed to `url`.',\n 'Please update your code to use `url` instead. Support for `uri` will be removed in a future version.',\n])\n\nexport const printDeprecatedResourceConfigWarning = createWarningPrinter([\n 'The `~experimental_resource` configuration property has been renamed to `resource`.',\n 'Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version.',\n])\n","import {generateHelpUrl} from './generateHelpUrl'\nimport type {ClientConfig, ClientPerspective, InitializedClientConfig} from './types'\nimport * as validate from './validators'\nimport * as warnings from './warnings'\n\nconst defaultCdnHost = 'apicdn.sanity.io'\nexport const defaultConfig = {\n apiHost: 'https://api.sanity.io',\n apiVersion: '1',\n useProjectHostname: true,\n stega: {enabled: false},\n} satisfies ClientConfig\n\nconst LOCALHOSTS = ['localhost', '127.0.0.1', '0.0.0.0']\nconst isLocal = (host: string) => LOCALHOSTS.indexOf(host) !== -1\n\nfunction validateApiVersion(apiVersion: string) {\n if (apiVersion === '1' || apiVersion === 'X') {\n return\n }\n\n const apiDate = new Date(apiVersion)\n const apiVersionValid =\n /^\\d{4}-\\d{2}-\\d{2}$/.test(apiVersion) && apiDate instanceof Date && apiDate.getTime() > 0\n\n if (!apiVersionValid) {\n throw new Error('Invalid API version string, expected `1` or date in format `YYYY-MM-DD`')\n }\n}\n\n/**\n * @internal - it may have breaking changes in any release\n */\nexport function validateApiPerspective(\n perspective: unknown,\n): asserts perspective is ClientPerspective {\n if (Array.isArray(perspective) && perspective.length > 1 && perspective.includes('raw')) {\n throw new TypeError(\n `Invalid API perspective value: \"raw\". The raw-perspective can not be combined with other perspectives`,\n )\n }\n}\n\nexport const initConfig = (\n config: Partial<ClientConfig>,\n prevConfig: Partial<ClientConfig>,\n): InitializedClientConfig => {\n const specifiedConfig = {\n ...prevConfig,\n ...config,\n stega: {\n ...(typeof prevConfig.stega === 'boolean'\n ? {enabled: prevConfig.stega}\n : prevConfig.stega || defaultConfig.stega),\n ...(typeof config.stega === 'boolean' ? {enabled: config.stega} : config.stega || {}),\n },\n }\n if (!specifiedConfig.apiVersion) {\n warnings.printNoApiVersionSpecifiedWarning()\n }\n\n const newConfig = {\n ...defaultConfig,\n ...specifiedConfig,\n apiHost: specifiedConfig.apiHost ?? defaultConfig.apiHost,\n } as InitializedClientConfig\n\n // Normalize resource configuration - prefer `resource` over deprecated `~experimental_resource`\n if (newConfig['~experimental_resource'] && !newConfig.resource) {\n warnings.printDeprecatedResourceConfigWarning()\n newConfig.resource = newConfig['~experimental_resource']\n }\n\n const resourceConfig = newConfig.resource\n const projectBased = newConfig.useProjectHostname && !resourceConfig\n\n if (typeof Promise === 'undefined') {\n const helpUrl = generateHelpUrl('js-client-promise-polyfill')\n throw new Error(`No native Promise-implementation found, polyfill needed - see ${helpUrl}`)\n }\n\n if (projectBased && !newConfig.projectId) {\n throw new Error('Configuration must contain `projectId`')\n }\n\n if (resourceConfig) {\n validate.resourceConfig(newConfig)\n }\n\n if (typeof newConfig.perspective !== 'undefined') {\n validateApiPerspective(newConfig.perspective)\n }\n\n if ('encodeSourceMap' in newConfig) {\n throw new Error(\n `It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?`,\n )\n }\n if ('encodeSourceMapAtPath' in newConfig) {\n throw new Error(\n `It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?`,\n )\n }\n if (typeof newConfig.stega.enabled !== 'boolean') {\n throw new Error(`stega.enabled must be a boolean, received ${newConfig.stega.enabled}`)\n }\n if (newConfig.stega.enabled && newConfig.stega.studioUrl === undefined) {\n throw new Error(`stega.studioUrl must be defined when stega.enabled is true`)\n }\n if (\n newConfig.stega.enabled &&\n typeof newConfig.stega.studioUrl !== 'string' &&\n typeof newConfig.stega.studioUrl !== 'function'\n ) {\n throw new Error(\n `stega.studioUrl must be a string or a function, received ${newConfig.stega.studioUrl}`,\n )\n }\n\n const isBrowser = typeof window !== 'undefined' && window.location && window.location.hostname\n const isLocalhost = isBrowser && isLocal(window.location.hostname)\n\n const hasToken = Boolean(newConfig.token)\n if (newConfig.withCredentials && hasToken) {\n warnings.printCredentialedTokenWarning()\n newConfig.withCredentials = false\n }\n\n if (isBrowser && isLocalhost && hasToken && newConfig.ignoreBrowserTokenWarning !== true) {\n warnings.printBrowserTokenWarning()\n } else if (typeof newConfig.useCdn === 'undefined') {\n warnings.printCdnWarning()\n }\n\n if (projectBased) {\n validate.projectId(newConfig.projectId!)\n }\n\n if (newConfig.dataset) {\n validate.dataset(newConfig.dataset)\n }\n\n if ('requestTagPrefix' in newConfig) {\n // Allow setting and unsetting request tag prefix\n newConfig.requestTagPrefix = newConfig.requestTagPrefix\n ? validate.requestTag(newConfig.requestTagPrefix).replace(/\\.+$/, '')\n : undefined\n }\n\n newConfig.apiVersion = `${newConfig.apiVersion}`.replace(/^v/, '')\n newConfig.isDefaultApi = newConfig.apiHost === defaultConfig.apiHost\n\n if (newConfig.useCdn === true && newConfig.withCredentials) {\n warnings.printCdnAndWithCredentialsWarning()\n }\n\n // If `useCdn` is undefined, we treat it as `true`\n newConfig.useCdn = newConfig.useCdn !== false && !newConfig.withCredentials\n\n validateApiVersion(newConfig.apiVersion)\n\n const hostParts = newConfig.apiHost.split('://', 2)\n const protocol = hostParts[0]\n const host = hostParts[1]\n const cdnHost = newConfig.isDefaultApi ? defaultCdnHost : host\n\n if (projectBased) {\n newConfig.url = `${protocol}://${newConfig.projectId}.${host}/v${newConfig.apiVersion}`\n newConfig.cdnUrl = `${protocol}://${newConfig.projectId}.${cdnHost}/v${newConfig.apiVersion}`\n } else {\n newConfig.url = `${newConfig.apiHost}/v${newConfig.apiVersion}`\n newConfig.cdnUrl = newConfig.url\n }\n\n return newConfig\n}\n"],"mappings":"AAEA,SAAgB,gBAAgB,MAAc;CAC5C,OAAO,gCAAW;AACpB;ACFA,MAAM,oBAAoB,CAAC,SAAS,MAAM,GACpC,yBAAyB;CAAC;CAAU;CAAS;AAAS,GAE/C,WAAW,SAAiB;CACvC,IAAI,CAAC,qDAAqD,KAAK,IAAI,GACjE,MAAU,MACR,qIACF;AAEJ,GAEa,aAAa,OAAe;CACvC,IAAI,CAAC,gBAAgB,KAAK,EAAE,GAC1B,MAAU,MAAM,uDAAuD;AAE3E,GAEa,qBAAqB,SAAiB;CACjD,IAAI,kBAAkB,QAAQ,IAAI,MAAM,IACtC,MAAU,MAAM,uBAAuB,KAAK,mBAAmB,kBAAkB,KAAK,IAAI,GAAG;AAEjG,GAEa,kBAAkB,IAAY,QAAa;CACtD,IAAoB,OAAO,OAAQ,aAA/B,OAA2C,MAAM,QAAQ,GAAG,GAC9D,MAAU,MAAM,GAAG,GAAG,iCAAiC;AAE3D,GAEa,sBAAsB,IAAY,OAAe;CAC5D,IAAI,OAAO,MAAO,YAAY,CAAC,iCAAiC,KAAK,EAAE,KAAK,GAAG,SAAS,IAAI,GAC1F,MAAU,MAAM,GAAG,GAAG,OAAO,GAAG,6BAA6B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UAAU,IACrB,OAAO,UAAU,IACjB,UAAU,UAAU,eAAe,qBAAiB;CAU1D,OARI,gBACF,UAAU,MAAM,GAAG,SAAS,KAAK,UAAU,UAAU,GAAG,KAAK,IAAI,UAAU,cAC3E,UAAU,SAAS,GAAG,SAAS,KAAK,UAAU,UAAU,GAAG,QAAQ,IAAI,UAAU,iBAEjF,UAAU,MAAM,GAAG,UAAU,QAAQ,IAAI,UAAU,cACnD,UAAU,SAAS,UAAU,MAGxB;AACT"}
|
package/dist/csm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as validateApiPerspective } from "./config-
|
|
1
|
+
import { r as validateApiPerspective } from "./config-CgJ16jET.js";
|
|
2
2
|
import { S as toString, _ as isPublishedId, a as resolveMapping, c as parseJsonPath, d as VERSION_FOLDER, f as getDraftId, g as isDraftId, h as getVersionId, i as walkMap, l as studioPathToJsonPath, m as getVersionFromId, o as jsonPath, p as getPublishedId, r as createEditUrl, s as jsonPathToStudioPath, t as resolveEditInfo, u as DRAFTS_FOLDER, v as isVersionId, x as studioPath_exports, y as get } from "./resolveEditInfo-Cz-smq3a.js";
|
|
3
3
|
/**
|
|
4
4
|
* This resolves the perspectives to how documents should be resolved when applying optimistic updates,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as __commonJSMin } from "./rolldown-runtime-4YWMqDIC.js";
|
|
2
|
+
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
4
|
var p = {
|
|
4
5
|
0: 8203,
|
|
@@ -70,4 +71,4 @@ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).expor
|
|
|
70
71
|
}));
|
|
71
72
|
export { require_dist as t };
|
|
72
73
|
|
|
73
|
-
//# sourceMappingURL=dist-
|
|
74
|
+
//# sourceMappingURL=dist-C5K_YcEU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-
|
|
1
|
+
{"version":3,"file":"dist-C5K_YcEU.js","names":[],"sources":["../node_modules/.pnpm/@vercel+stega@1.1.0/node_modules/@vercel/stega/dist/index.js"],"sourcesContent":["\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true});var p={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},l={0:8203,1:8204,2:8205,3:65279},d={0:String.fromCodePoint(l[0]),1:String.fromCodePoint(l[1]),2:String.fromCodePoint(l[2]),3:String.fromCodePoint(l[3])},u=new Array(4).fill(String.fromCodePoint(l[0])).join(\"\"),g=String.fromCharCode(0);function A(e){let r=JSON.stringify(e),t=new TextEncoder().encode(r),i=\"\";for(let c=0;c<t.length;c++){let n=t[c];i+=d[n>>6&3]+d[n>>4&3]+d[n>>2&3]+d[n&3]}return u+i}function C(e){let r=JSON.stringify(e);return Array.from(r).map(t=>{let i=t.charCodeAt(0);if(i>255)throw new Error(`Only ASCII edit info can be encoded. Error attempting to encode ${r} on character ${t} (${i})`);return Array.from(i.toString(16).padStart(2,\"0\")).map(c=>String.fromCodePoint(p[c])).join(\"\")}).join(\"\")}function I(e){return!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\\d+(?:[-:\\/]\\d+){2}(?:T\\d+(?:[-:\\/]\\d+){1,2}(\\.\\d+)?Z?)?/.test(e)?!1:!!Date.parse(e)}function S(e){try{new URL(e,e.startsWith(\"/\")?\"https://acme.com\":void 0)}catch (e2){return!1}return!0}function y(e,r,t=\"auto\"){return t===!0||t===\"auto\"&&(I(e)||S(e))?e:`${e}${A(r)}`}var m=Object.fromEntries(Object.entries(d).map(e=>[e[1],+e[0]])),T=Object.fromEntries(Object.entries(p).map(e=>e.reverse())),h=`${Object.values(p).map(e=>`\\\\u{${e.toString(16)}}`).join(\"\")}`,x= exports.VERCEL_STEGA_REGEX =new RegExp(`[${h}]{4,}`,\"gu\");function X(e){let r=e.match(x);if(r)return E(r[0],!0)[0]}function M(e){let r=e.match(x);if(r)return r.map(t=>E(t)).flat()}function E(e,r=!1){let t=Array.from(e),i=1/0,c=-1;for(let n=0;n<t.length;++n)t[n]===u[0]&&t[n+1]===u[1]&&t[n+2]===u[2]&&t[n+3]===u[3]&&(i=Math.min(i,n),c=Math.max(c,n));if(c===-1)return _(t,r);for(let n=i;n<=c;++n)if(!((t.length-n)%4))try{let f=t.slice(n+4),s=new Uint8Array(f.length/4);for(let o=0;o<s.length;o++)s[o]=m[f[o*4]]<<6|m[f[o*4+1]]<<4|m[f[o*4+2]]<<2|m[f[o*4+3]];let a=new TextDecoder().decode(s);if(r){let o=a.indexOf(g);return o===-1&&(o=a.length),[JSON.parse(a.slice(0,o))]}return a.split(g).filter(Boolean).map(o=>JSON.parse(o))}catch (e3){}return[]}function _(e,r){var f;let t=[];for(let s=e.length*.5;s--;){let a=`${T[e[s*2].codePointAt(0)]}${T[e[s*2+1].codePointAt(0)]}`;t.unshift(String.fromCharCode(parseInt(a,16)))}let i=[],c=[t.join(\"\")],n=10;for(;c.length;){let s=c.shift();try{if(i.push(JSON.parse(s)),r)return i}catch(a){if(!n--)throw a;let o=+((f=a.message.match(/\\sposition\\s(\\d+)$/))==null?void 0:f[1]);if(!o)throw a;c.unshift(s.substring(0,o),s.substring(o))}}return i}function P(e){var r;return{cleaned:e.replace(x,\"\"),encoded:((r=e.match(x))==null?void 0:r[0])||\"\"}}function w(e){return e&&JSON.parse(P(JSON.stringify(e)).cleaned)}exports.VERCEL_STEGA_REGEX = x; exports.legacyStegaEncode = C; exports.vercelStegaClean = w; exports.vercelStegaCombine = y; exports.vercelStegaDecode = X; exports.vercelStegaDecodeAll = M; exports.vercelStegaEncode = A; exports.vercelStegaSplit = P;\n"],"x_google_ignoreList":[0],"mappings":";;CAAa,OAAO,eAAe,SAAS,cAAc,EAAC,OAAO,GAAI,CAAC;CAAE,IAAI,IAAE;EAAC,GAAE;EAAK,GAAE;EAAK,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,KAAG,MAAI,WAAS,EAAE,CAAC,KAAG,EAAE,CAAC,KAAG,IAAE,GAAG,IAAI,EAAE,CAAC;CAAG;CAAoE,AAA7D,OAAO,YAAY,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAI,MAAG,CAAC,EAAE,IAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAI,OAAO,YAAY,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAI,MAAG,EAAE,QAAQ,CAAC,CAAC;CAAE,IAAA,IAAE,GAAG,OAAO,OAAO,CAAC,CAAC,CAAC,KAAI,MAAG,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAI,IAAG,QAAQ,qBAAwB,OAAO,IAAI,EAAE,QAAO,IAAI;CAAkmC,SAAS,EAAE,GAAE;EAAO,OAAM;GAAC,SAAQ,EAAE,QAAQ,GAAE,EAAE;GAAE,SAAY,EAAE,MAAM,CAAC,CAAA,GAAkB,MAAK;EAAE;CAAC;CAAC,SAAS,EAAE,GAAE;EAAC,OAAO,KAAG,KAAK,MAAM,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO;CAAC;CAA8F,AAA7F,QAAQ,qBAAqB,GAAkC,QAAQ,mBAAmB,GAAG,QAAQ,qBAAqB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as ResolveStudioUrl, f as StegaConfig, g as StudioUrl, h as StudioBaseUrl, i as ContentSourceMapParsedPathKeyedSegment, l as InitializedStegaConfig, m as StudioBaseRoute, p as StegaConfigRequiredKeys, r as ContentSourceMapParsedPath, s as FilterDefault, u as Logger } from "./types-CfGzbXrl.js";
|
|
2
|
-
import { $ as DisconnectEvent, $n as UploadClientConfig, $r as
|
|
2
|
+
import { $ as DisconnectEvent, $n as UploadClientConfig, $r as CollaborationCommentFieldValue, $t as QueryWithoutParams, A as ContentSourceMapMappings, Ai as AgentActionPathSegment, An as SanityReference, Ar as ObservableProjectsClient, At as MediaLibraryAssetVersion, B as CreateVersionAction, Bn as TransactionAllDocumentIdsMutationOptions, Br as ObservablePatchBuilder, Bt as MutationSelection, C as ContentSourceMap, Ci as PromptRequest, Cn as SanityDocument, Cr as GenerateTarget, Ct as LiveEventGoAway, D as ContentSourceMapDocuments, Di as AgentActionParam, Dn as SanityProject, Dr as SanityClient, Dt as LiveEventWelcome, E as ContentSourceMapDocumentValueSource, Ei as PatchTarget, En as SanityImagePalette, Er as ObservableSanityClient, Et as LiveEventRestart, F as ContentSourceMapValueMapping, Fi as GroqAgentActionParam, Fn as StackablePerspective, Fr as InvokeFunctionOptions, Ft as Mutation, G as DatasetResponse, Gn as UnarchiveReleaseAction, Gr as ObservablePatch, Gt as PatchOperations, H as DatasetAclMode, Hn as TransactionFirstDocumentIdMutationOptions, Hr as PatchBuilder, Ht as OpenEvent, I as CreateAction, In as StillImageFormat, Ir as InvokeFunctionRequest, It as MutationError, J as DeleteReleaseAction, Jn as UnpublishAction, Jr as types_d_exports, Jt as PublishReleaseAction, K as DatasetsResponse, Kn as UnfilteredResponseQueryOptions, Kr as Patch, Kt as PatchSelection, L as CreateReleaseAction, Ln as StoryboardTransformOptions, Lr as DatasetsClient, Lt as MutationErrorItem, M as ContentSourceMapRemoteDocument, Mi as ConstantAgentActionParam, Mn as ScheduleReleaseAction, Mr as MediaLibraryVideoClient, Mt as MediaLibraryVideoPlaybackTransformations, N as ContentSourceMapSource, Ni as DocumentAgentActionParam, Nn as SingleActionResult, Nr as ObservableMediaLibraryVideoClient, Nt as MultipleActionResult, O as ContentSourceMapLiteralSource, Oi as AgentActionParams, On as SanityProjectMember, Or as ObservableUsersClient, Ot as MediaLibraryAssetDocument, P as ContentSourceMapUnknownSource, Pi as FieldAgentActionParam, Pn as SingleMutationResult, Pr as InvokeFunctionEvent, Pt as MultipleMutationResult, Q as DiscardVersionAction, Qn as UploadBody, Qr as CollaborationCommentDocument, Qt as QueryParseError, R as CreateVariantAction, Rn as SyncTag, Rr as ObservableDatasetsClient, Rt as MutationEvent, S as ClientVariantConditions, Si as TransformTargetInclude, Sn as SanityAssetDocument, Sr as GenerateOperation, St as LiveEvent, T as ContentSourceMapDocumentBase, Ti as PatchOperation, Tn as SanityImageAssetDocument, Tr as GenerateTargetInclude, Tt as LiveEventReconnect, U as DatasetCreateOptions, Un as TransactionFirstDocumentMutationOptions, Ur as Transaction, Ut as PartialExcept, V as CurrentSanityUser, Vn as TransactionAllDocumentsMutationOptions, Vr as ObservableTransaction, Vt as MutationSelectionQueryParams, W as DatasetEditOptions, Wn as TransactionMutationOptions, Wr as BasePatch, Wt as PatchMutationOperation, X as DeleteVariantDefinitionAction, Xn as UnpublishVersionAction, Xr as ObservableCollaborationCommentsClient, Xt as QueryOptions, Y as DeleteVariantAction, Yn as UnpublishVariantAction, Yr as CollaborationCommentsClient, Yt as PublishVariantAction, Z as DiscardAction, Zn as UnscheduleReleaseAction, Zr as CollaborationCommentCreate, Zt as QueryParams, _ as ChannelErrorEvent, _i as ImageDescriptionOperation, _n as Requester, _r as VideoSubtitleInfoPublic, _t as InsertPatch, a as AllDocumentsMutationOptions, ai as CollaborationCommentStatus, an as ReleaseCardinality, ar as VersionAction, at as EditableReleaseDocument, b as ClientReturn, bi as TransformTarget, bn as ResumableListenEventNames, br as WelcomeEvent, bt as ListenOptions, c as Any, ci as CollaborationCommentsListenOptions, cn as ReleaseState, cr as VideoPlaybackInfoItemPublic, ct as ErrorProps, d as AssetMetadataType, di as _listen, dn as ReplaceVersionAction, dr as VideoPlaybackInfoSigned, dt as FirstDocumentMutationOptions, ei as CollaborationCommentMessage, en as RawQueryResponse, er as UploadEvent, et as EXPERIMENTAL_API_WARNING, f as AttributeSet, fi as AssetsClient, fn as RequestHandler, fr as VideoPlaybackTokens, ft as FitMode, g as BaseMutationOptions, gi as TranslateTargetInclude, gn as RequestUrlOptions, gr as VideoSubtitleInfo, gt as InitializedClientConfig, h as BaseActionOptions, hi as TranslateTarget, hn as RequestOptions, hr as VideoRenditionInfoSigned, ht as ImportReleaseAction, i as AllDocumentIdsMutationOptions, ii as CollaborationCommentSelection, in as ReleaseAction, ir as VariantDefinitionAction, it as EditVariantDefinitionAction, j as ContentSourceMapPaths, ji as AgentActionTarget, jn as SanityUser, jr as ProjectsClient, jt as MediaLibraryPlaybackInfoOptions, k as ContentSourceMapMapping, ki as AgentActionPath, kn as SanityQueries, kr as UsersClient, kt as MediaLibraryAssetInstanceIdentifier, l as ApiError, li as CollaborationCommentsRequestOptions, ln as ReleaseType, lr as VideoPlaybackInfoItemSigned, lt as FilteredResponseQueryOptions, m as AuthProviderResponse, mi as TranslateDocument, mn as RequestObservableOptions, mr as VideoRenditionInfoPublic, mt as IdentifiedSanityDocumentStub, n as ActionError, ni as CollaborationCommentRange, nn as RawRequestOptions, nr as UploadResponseEvent, nt as EditReleaseAction, o as AnimatedImageFormat, oi as CollaborationCommentTarget, on as ReleaseDocument, or as VideoPlaybackInfo, ot as EmbeddingsSettings, p as AuthProvider, pi as ObservableAssetsClient, pn as RequestHandlerOptions, pr as VideoRenditionInfo, pt as HttpRequest, q as DeleteAction, qn as UnfilteredResponseWithoutQuery, qr as LiveClient, qt as PublishAction, r as ActionErrorItem, ri as CollaborationCommentReactionShortName, rn as ReconnectEvent, rr as VariantAction, rt as EditVariantAction, s as AnimatedTransformOptions, si as CollaborationCommentUpdate, sn as ReleaseId, sr as VideoPlaybackInfoItem, st as EmbeddingsSettingsBody, t as Action, ti as CollaborationCommentPortableTextBlock, tn as RawQuerylessQueryResponse, tr as UploadProgressEvent, tt as EditAction, u as ArchiveReleaseAction, ui as CollaborationCommentsWriteOptions, un as ReplaceDraftAction, ur as VideoPlaybackInfoPublic, ut as FirstDocumentIdMutationOptions, v as ClientConfig, vi as TransformDocument, vn as ResetEvent, vr as VideoSubtitleInfoSigned, vt as ListenEvent, w as ContentSourceMapDocument, wi as PatchDocument, wn as SanityDocumentStub, wr as GenerateTargetDocument, wt as LiveEventMessage, x as ClientVariant, xi as TransformTargetDocument, xn as ResumableListenOptions, xr as GenerateInstruction, xt as ListenParams, y as ClientPerspective, yi as TransformOperation, yn as ResponseQueryOptions, yr as WelcomeBackEvent, yt as ListenEventName, z as CreateVariantDefinitionAction, zn as ThumbnailTransformOptions, zr as BaseTransaction, zt as MutationOperation } from "./types-CtHEe8SF.js";
|
|
3
3
|
import { FetchFunction, RequestOptions as RequestOptions$1, TimeoutErrorLike, isTimeoutError } from "get-it";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
5
5
|
import { EventSourceConstructor } from "eventsource";
|
|
@@ -181,5 +181,5 @@ declare const createClient: (config: ClientConfig) => SanityClient;
|
|
|
181
181
|
* @deprecated Use the named export `createClient` instead of the `default` export
|
|
182
182
|
*/
|
|
183
183
|
declare const deprecatedCreateClient: (config: ClientConfig) => SanityClient;
|
|
184
|
-
export { Action, ActionError, ActionErrorItem, type AgentActionParam, type AgentActionParams, type AgentActionPath, type AgentActionPathSegment, type AgentActionTarget, AllDocumentIdsMutationOptions, AllDocumentsMutationOptions, AnimatedImageFormat, AnimatedTransformOptions, Any, ApiError, ArchiveReleaseAction, AssetMetadataType, type AssetsClient, AttributeSet, AuthProvider, AuthProviderResponse, BaseActionOptions, BaseMutationOptions, BasePatch, BaseTransaction, ChannelError, ChannelErrorEvent, ClientConfig, ClientError, ClientPerspective, ClientReturn, ClientVariant, ClientVariantConditions, type CollaborationCommentCreate, type CollaborationCommentDocument, type CollaborationCommentFieldValue, type CollaborationCommentMessage, type CollaborationCommentPortableTextBlock, type CollaborationCommentRange, type CollaborationCommentReactionShortName, type CollaborationCommentSelection, type CollaborationCommentStatus, type CollaborationCommentTarget, type CollaborationCommentUpdate, type CollaborationCommentsClient, type CollaborationCommentsListenOptions, type CollaborationCommentsRequestOptions, type CollaborationCommentsWriteOptions, ConnectionFailedError, type ConstantAgentActionParam, ContentSourceMap, ContentSourceMapDocument, ContentSourceMapDocumentBase, ContentSourceMapDocumentValueSource, ContentSourceMapDocuments, ContentSourceMapLiteralSource, ContentSourceMapMapping, ContentSourceMapMappings, type ContentSourceMapParsedPath, type ContentSourceMapParsedPathKeyedSegment, ContentSourceMapPaths, ContentSourceMapRemoteDocument, ContentSourceMapSource, ContentSourceMapUnknownSource, ContentSourceMapValueMapping, CorsOriginError, CreateAction, CreateReleaseAction, CreateVariantAction, CreateVariantDefinitionAction, CreateVersionAction, CurrentSanityUser, DatasetAclMode, DatasetCreateOptions, DatasetEditOptions, DatasetResponse, type DatasetsClient, DatasetsResponse, DeleteAction, DeleteReleaseAction, DeleteVariantAction, DeleteVariantDefinitionAction, DiscardAction, DiscardVersionAction, DisconnectError, DisconnectEvent, type DocumentAgentActionParam, EXPERIMENTAL_API_WARNING, EditAction, EditReleaseAction, EditVariantAction, EditVariantDefinitionAction, EditableReleaseDocument, EmbeddingsSettings, EmbeddingsSettingsBody, ErrorProps, type EventSourceEvent, type EventSourceInstance, type FieldAgentActionParam, type FilterDefault, FilteredResponseQueryOptions, FirstDocumentIdMutationOptions, FirstDocumentMutationOptions, FitMode, type GenerateInstruction, type GenerateOperation, type GenerateTarget, type GenerateTargetDocument, type GenerateTargetInclude, type GroqAgentActionParam, type HttpError, HttpRequest, IdentifiedSanityDocumentStub, type ImageDescriptionOperation, ImportReleaseAction, InitializedClientConfig, type InitializedStegaConfig, InsertPatch, type InvokeFunctionEvent, type InvokeFunctionOptions, type InvokeFunctionRequest, ListenEvent, ListenEventName, ListenOptions, ListenParams, type LiveClient, LiveEvent, LiveEventGoAway, LiveEventMessage, LiveEventReconnect, LiveEventRestart, LiveEventWelcome, type Logger, MediaLibraryAssetDocument, MediaLibraryAssetInstanceIdentifier, MediaLibraryAssetVersion, MediaLibraryPlaybackInfoOptions, type MediaLibraryVideoClient, MediaLibraryVideoPlaybackTransformations, MessageError, MessageParseError, MultipleActionResult, MultipleMutationResult, Mutation, MutationError, MutationErrorItem, MutationEvent, MutationOperation, MutationSelection, MutationSelectionQueryParams, type ObservableAssetsClient, type ObservableCollaborationCommentsClient, type ObservableDatasetsClient, type ObservableMediaLibraryVideoClient, ObservablePatch, ObservablePatchBuilder, type ObservableProjectsClient, ObservableSanityClient, ObservableTransaction, type ObservableUsersClient, OpenEvent, PartialExcept, Patch, PatchBuilder, type PatchDocument, PatchMutationOperation, type PatchOperation, PatchOperations, PatchSelection, type PatchTarget, type ProjectsClient, type PromptRequest, PublishAction, PublishReleaseAction, PublishVariantAction, QueryOptions, QueryParams, QueryParseError, QueryWithoutParams, RawQueryResponse, RawQuerylessQueryResponse, RawRequestOptions, ReconnectEvent, ReleaseAction, ReleaseCardinality, ReleaseDocument, ReleaseId, ReleaseState, ReleaseType, ReplaceDraftAction, ReplaceVersionAction, RequestHandler, RequestHandlerOptions, RequestObservableOptions, RequestOptions, RequestUrlOptions, Requester, ResetEvent, type ResolveStudioUrl, ResponseQueryOptions, ResumableListenEventNames, ResumableListenOptions, SanityAssetDocument, SanityClient, SanityDocument, SanityDocumentStub, SanityImageAssetDocument, SanityImagePalette, SanityProject, SanityProjectMember, SanityQueries, SanityReference, SanityUser, ScheduleReleaseAction, ServerError, type ServerSentEvent, SingleActionResult, SingleMutationResult, StackablePerspective, type StegaConfig, type StegaConfigRequiredKeys, StillImageFormat, StoryboardTransformOptions, type StudioBaseRoute, type StudioBaseUrl, type StudioUrl, SyncTag, ThumbnailTransformOptions, type TimeoutErrorLike, Transaction, TransactionAllDocumentIdsMutationOptions, TransactionAllDocumentsMutationOptions, TransactionFirstDocumentIdMutationOptions, TransactionFirstDocumentMutationOptions, TransactionMutationOptions, type TransformDocument, type TransformOperation, type TransformTarget, type TransformTargetDocument, type TransformTargetInclude, type TranslateDocument, type TranslateTarget, type TranslateTargetInclude, UnarchiveReleaseAction, UnfilteredResponseQueryOptions, UnfilteredResponseWithoutQuery, UnpublishAction, UnpublishVariantAction, UnpublishVersionAction, UnscheduleReleaseAction, UploadBody, UploadClientConfig, UploadEvent, UploadProgressEvent, UploadResponseEvent, type UsersClient, VariantAction, VariantDefinitionAction, VersionAction, VideoPlaybackInfo, VideoPlaybackInfoItem, VideoPlaybackInfoItemPublic, VideoPlaybackInfoItemSigned, VideoPlaybackInfoPublic, VideoPlaybackInfoSigned, VideoPlaybackTokens, VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned, VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned, WelcomeBackEvent, WelcomeEvent, type _listen, connectEventSource, createClient, deprecatedCreateClient as default, formatQueryParseError, isHttpError, isQueryParseError, isTimeoutError, requester, validateApiPerspective };
|
|
184
|
+
export { Action, ActionError, ActionErrorItem, type AgentActionParam, type AgentActionParams, type AgentActionPath, type AgentActionPathSegment, type AgentActionTarget, AllDocumentIdsMutationOptions, AllDocumentsMutationOptions, AnimatedImageFormat, AnimatedTransformOptions, Any, ApiError, ArchiveReleaseAction, AssetMetadataType, type AssetsClient, AttributeSet, AuthProvider, AuthProviderResponse, BaseActionOptions, BaseMutationOptions, BasePatch, BaseTransaction, ChannelError, ChannelErrorEvent, ClientConfig, ClientError, ClientPerspective, ClientReturn, ClientVariant, ClientVariantConditions, type CollaborationCommentCreate, type CollaborationCommentDocument, type CollaborationCommentFieldValue, type CollaborationCommentMessage, type CollaborationCommentPortableTextBlock, type CollaborationCommentRange, type CollaborationCommentReactionShortName, type CollaborationCommentSelection, type CollaborationCommentStatus, type CollaborationCommentTarget, type CollaborationCommentUpdate, type CollaborationCommentsClient, type CollaborationCommentsListenOptions, type CollaborationCommentsRequestOptions, type CollaborationCommentsWriteOptions, ConnectionFailedError, type ConstantAgentActionParam, ContentSourceMap, ContentSourceMapDocument, ContentSourceMapDocumentBase, ContentSourceMapDocumentValueSource, ContentSourceMapDocuments, ContentSourceMapLiteralSource, ContentSourceMapMapping, ContentSourceMapMappings, type ContentSourceMapParsedPath, type ContentSourceMapParsedPathKeyedSegment, ContentSourceMapPaths, ContentSourceMapRemoteDocument, ContentSourceMapSource, ContentSourceMapUnknownSource, ContentSourceMapValueMapping, types_d_exports as Context, CorsOriginError, CreateAction, CreateReleaseAction, CreateVariantAction, CreateVariantDefinitionAction, CreateVersionAction, CurrentSanityUser, DatasetAclMode, DatasetCreateOptions, DatasetEditOptions, DatasetResponse, type DatasetsClient, DatasetsResponse, DeleteAction, DeleteReleaseAction, DeleteVariantAction, DeleteVariantDefinitionAction, DiscardAction, DiscardVersionAction, DisconnectError, DisconnectEvent, type DocumentAgentActionParam, EXPERIMENTAL_API_WARNING, EditAction, EditReleaseAction, EditVariantAction, EditVariantDefinitionAction, EditableReleaseDocument, EmbeddingsSettings, EmbeddingsSettingsBody, ErrorProps, type EventSourceEvent, type EventSourceInstance, type FieldAgentActionParam, type FilterDefault, FilteredResponseQueryOptions, FirstDocumentIdMutationOptions, FirstDocumentMutationOptions, FitMode, type GenerateInstruction, type GenerateOperation, type GenerateTarget, type GenerateTargetDocument, type GenerateTargetInclude, type GroqAgentActionParam, type HttpError, HttpRequest, IdentifiedSanityDocumentStub, type ImageDescriptionOperation, ImportReleaseAction, InitializedClientConfig, type InitializedStegaConfig, InsertPatch, type InvokeFunctionEvent, type InvokeFunctionOptions, type InvokeFunctionRequest, ListenEvent, ListenEventName, ListenOptions, ListenParams, type LiveClient, LiveEvent, LiveEventGoAway, LiveEventMessage, LiveEventReconnect, LiveEventRestart, LiveEventWelcome, type Logger, MediaLibraryAssetDocument, MediaLibraryAssetInstanceIdentifier, MediaLibraryAssetVersion, MediaLibraryPlaybackInfoOptions, type MediaLibraryVideoClient, MediaLibraryVideoPlaybackTransformations, MessageError, MessageParseError, MultipleActionResult, MultipleMutationResult, Mutation, MutationError, MutationErrorItem, MutationEvent, MutationOperation, MutationSelection, MutationSelectionQueryParams, type ObservableAssetsClient, type ObservableCollaborationCommentsClient, type ObservableDatasetsClient, type ObservableMediaLibraryVideoClient, ObservablePatch, ObservablePatchBuilder, type ObservableProjectsClient, ObservableSanityClient, ObservableTransaction, type ObservableUsersClient, OpenEvent, PartialExcept, Patch, PatchBuilder, type PatchDocument, PatchMutationOperation, type PatchOperation, PatchOperations, PatchSelection, type PatchTarget, type ProjectsClient, type PromptRequest, PublishAction, PublishReleaseAction, PublishVariantAction, QueryOptions, QueryParams, QueryParseError, QueryWithoutParams, RawQueryResponse, RawQuerylessQueryResponse, RawRequestOptions, ReconnectEvent, ReleaseAction, ReleaseCardinality, ReleaseDocument, ReleaseId, ReleaseState, ReleaseType, ReplaceDraftAction, ReplaceVersionAction, RequestHandler, RequestHandlerOptions, RequestObservableOptions, RequestOptions, RequestUrlOptions, Requester, ResetEvent, type ResolveStudioUrl, ResponseQueryOptions, ResumableListenEventNames, ResumableListenOptions, SanityAssetDocument, SanityClient, SanityDocument, SanityDocumentStub, SanityImageAssetDocument, SanityImagePalette, SanityProject, SanityProjectMember, SanityQueries, SanityReference, SanityUser, ScheduleReleaseAction, ServerError, type ServerSentEvent, SingleActionResult, SingleMutationResult, StackablePerspective, type StegaConfig, type StegaConfigRequiredKeys, StillImageFormat, StoryboardTransformOptions, type StudioBaseRoute, type StudioBaseUrl, type StudioUrl, SyncTag, ThumbnailTransformOptions, type TimeoutErrorLike, Transaction, TransactionAllDocumentIdsMutationOptions, TransactionAllDocumentsMutationOptions, TransactionFirstDocumentIdMutationOptions, TransactionFirstDocumentMutationOptions, TransactionMutationOptions, type TransformDocument, type TransformOperation, type TransformTarget, type TransformTargetDocument, type TransformTargetInclude, type TranslateDocument, type TranslateTarget, type TranslateTargetInclude, UnarchiveReleaseAction, UnfilteredResponseQueryOptions, UnfilteredResponseWithoutQuery, UnpublishAction, UnpublishVariantAction, UnpublishVersionAction, UnscheduleReleaseAction, UploadBody, UploadClientConfig, UploadEvent, UploadProgressEvent, UploadResponseEvent, type UsersClient, VariantAction, VariantDefinitionAction, VersionAction, VideoPlaybackInfo, VideoPlaybackInfoItem, VideoPlaybackInfoItemPublic, VideoPlaybackInfoItemSigned, VideoPlaybackInfoPublic, VideoPlaybackInfoSigned, VideoPlaybackTokens, VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned, VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned, WelcomeBackEvent, WelcomeEvent, type _listen, connectEventSource, createClient, deprecatedCreateClient as default, formatQueryParseError, isHttpError, isQueryParseError, isTimeoutError, requester, validateApiPerspective };
|
|
185
185
|
//# sourceMappingURL=index.d.ts.map
|