@sanity/client
Advanced tools
Comparing version 6.19.1 to 6.20.0-canary.0
{ | ||
"name": "@sanity/client", | ||
"version": "6.19.1", | ||
"version": "6.20.0-canary.0", | ||
"description": "Client for retrieving, creating and patching data from Sanity.io", | ||
@@ -127,9 +127,9 @@ "keywords": [ | ||
"@edge-runtime/vm": "^3.2.0", | ||
"@rollup/plugin-commonjs": "^25.0.8", | ||
"@rollup/plugin-commonjs": "^26.0.1", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@sanity/pkg-utils": "^6.8.18", | ||
"@sanity/pkg-utils": "^6.9.2", | ||
"@types/json-diff": "^1.0.3", | ||
"@types/node": "^20.8.8", | ||
"@typescript-eslint/eslint-plugin": "^7.11.0", | ||
"@typescript-eslint/parser": "^7.11.0", | ||
"@typescript-eslint/eslint-plugin": "^7.12.0", | ||
"@typescript-eslint/parser": "^7.12.0", | ||
"@vercel/stega": "0.1.2", | ||
@@ -147,8 +147,8 @@ "@vitest/coverage-v8": "1.6.0", | ||
"nock": "^13.5.4", | ||
"prettier": "^3.2.5", | ||
"prettier": "^3.3.1", | ||
"prettier-plugin-packagejson": "^2.5.0", | ||
"rimraf": "^5.0.1", | ||
"rimraf": "^5.0.7", | ||
"rollup": "^4.18.0", | ||
"sse-channel": "^4.0.0", | ||
"terser": "^5.31.0", | ||
"terser": "^5.31.1", | ||
"typescript": "5.4.5", | ||
@@ -155,0 +155,0 @@ "vitest": "1.6.0", |
@@ -7,4 +7,6 @@ import {Observable} from 'rxjs' | ||
const requiredApiVersion = '2021-03-26' | ||
/** | ||
* @alpha this API is experimental and may change or even be removed | ||
* @public | ||
*/ | ||
@@ -17,3 +19,14 @@ export class LiveClient { | ||
/** | ||
* Requires `apiVersion` to be `2021-03-26` or later. | ||
*/ | ||
events(): Observable<LiveEventMessage | LiveEventRestart> { | ||
const apiVersion = this.#client.config().apiVersion.replace(/^v/, '') | ||
if (apiVersion !== 'X' && apiVersion < requiredApiVersion) { | ||
throw new Error( | ||
`The live events API requires API version ${requiredApiVersion} or later. ` + | ||
`The current API version is ${apiVersion}. ` + | ||
`Please update your API version to use this feature.`, | ||
) | ||
} | ||
const path = _getDataUrl(this.#client, 'live/events') | ||
@@ -20,0 +33,0 @@ const url = new URL(this.#client.getUrl(path, false)) |
@@ -309,3 +309,2 @@ // deno-lint-ignore-file no-empty-interface | ||
perspective?: ClientPerspective | ||
/** @alpha this API is experimental and may change or even be removed */ | ||
lastLiveEventId?: string | ||
@@ -933,3 +932,2 @@ } | ||
next?: ('next' extends keyof RequestInit ? RequestInit : never)['next'] | ||
/** @alpha this API is experimental and may change or even be removed */ | ||
lastLiveEventId?: string | string[] | null | ||
@@ -978,3 +976,3 @@ } | ||
resultSourceMap?: ContentSourceMap | ||
/** @alpha this API is experimental and may change or even be removed */ | ||
/** Requires `apiVersion` to be `2021-03-26` or later. */ | ||
syncTags?: SyncTag[] | ||
@@ -1231,9 +1229,9 @@ } | ||
/** @alpha this API is experimental and may change or even be removed */ | ||
/** @public */ | ||
export type SyncTag = `s1:${string}` | ||
/** @alpha this API is experimental and may change or even be removed */ | ||
/** @public */ | ||
export interface LiveEventRestart { | ||
type: 'restart' | ||
} | ||
/** @alpha this API is experimental and may change or even be removed */ | ||
/** @public */ | ||
export interface LiveEventMessage { | ||
@@ -1240,0 +1238,0 @@ type: 'message' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2236901
25324
1