@sanity/client
Advanced tools
Comparing version 6.7.0 to 6.9.1
import cjs from './index.cjs'; | ||
export const unstable__adapter = cjs.unstable__adapter; | ||
export const unstable__environment = cjs.unstable__environment; | ||
export const BasePatch = cjs.BasePatch; | ||
@@ -15,2 +13,4 @@ export const BaseTransaction = cjs.BaseTransaction; | ||
export const Transaction = cjs.Transaction; | ||
export const unstable__adapter = cjs.unstable__adapter; | ||
export const unstable__environment = cjs.unstable__environment; | ||
export const createClient = cjs.createClient; | ||
@@ -17,0 +17,0 @@ export const requester = cjs.requester; |
{ | ||
"name": "@sanity/client", | ||
"version": "6.7.0", | ||
"version": "6.9.1", | ||
"description": "Client for retrieving, creating and patching data from Sanity.io", | ||
@@ -47,2 +47,29 @@ "keywords": [ | ||
}, | ||
"./csm": { | ||
"types": "./dist/csm.d.ts", | ||
"source": "./src/csm/index.ts", | ||
"import": "./dist/csm.js", | ||
"require": "./dist/csm.cjs", | ||
"default": "./dist/csm.js" | ||
}, | ||
"./stega": { | ||
"types": "./dist/stega.d.ts", | ||
"browser": { | ||
"source": "./src/stega/index.browser.ts", | ||
"import": "./dist/stega.browser.js", | ||
"require": "./dist/stega.browser.cjs" | ||
}, | ||
"react-server": "./dist/stega.browser.js", | ||
"deno": "./dist/stega.browser.js", | ||
"edge": "./dist/stega.browser.js", | ||
"edge-light": "./dist/stega.browser.js", | ||
"worker": "./dist/stega.browser.js", | ||
"source": "./src/stega/index.ts", | ||
"require": "./dist/stega.cjs", | ||
"node": { | ||
"import": "./dist/stega.cjs.js" | ||
}, | ||
"import": "./dist/stega.js", | ||
"default": "./dist/stega.js" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -56,5 +83,17 @@ }, | ||
"./dist/index.cjs": "./dist/index.browser.cjs", | ||
"./dist/index.js": "./dist/index.browser.js" | ||
"./dist/index.js": "./dist/index.browser.js", | ||
"./dist/stega.cjs": "./dist/stega.browser.cjs", | ||
"./dist/stega.js": "./dist/stega.browser.js" | ||
}, | ||
"types": "./dist/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"csm": [ | ||
"./dist/csm.d.ts" | ||
], | ||
"stega": [ | ||
"./dist/stega.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
@@ -96,16 +135,17 @@ "dist", | ||
"@sanity/eventsource": "^5.0.0", | ||
"get-it": "^8.4.3", | ||
"@vercel/stega": "0.1.0", | ||
"get-it": "^8.4.4", | ||
"rxjs": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@edge-runtime/types": "^2.2.4", | ||
"@edge-runtime/vm": "^3.1.4", | ||
"@rollup/plugin-commonjs": "^25.0.5", | ||
"@edge-runtime/types": "^2.2.7", | ||
"@edge-runtime/vm": "^3.1.7", | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@sanity/pkg-utils": "^3.0.0", | ||
"@types/node": "^20.8.4", | ||
"@typescript-eslint/eslint-plugin": "^6.7.5", | ||
"@typescript-eslint/parser": "^6.7.5", | ||
"@sanity/pkg-utils": "^3.2.5", | ||
"@types/node": "^20.8.8", | ||
"@typescript-eslint/eslint-plugin": "^6.13.1", | ||
"@typescript-eslint/parser": "^6.13.1", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"eslint": "^8.51.0", | ||
"eslint": "^8.54.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
@@ -115,14 +155,14 @@ "eslint-plugin-prettier": "^5.0.1", | ||
"faucet": "^0.0.4", | ||
"happy-dom": "^12.9.1", | ||
"ls-engines": "^0.9.0", | ||
"nock": "^13.3.4", | ||
"prettier": "^3.0.3", | ||
"happy-dom": "^12.10.3", | ||
"ls-engines": "^0.9.1", | ||
"nock": "^13.4.0", | ||
"prettier": "^3.1.0", | ||
"prettier-plugin-packagejson": "^2.4.6", | ||
"rimraf": "^5.0.1", | ||
"rollup": "^4.0.2", | ||
"rollup": "^4.6.0", | ||
"sse-channel": "^4.0.0", | ||
"terser": "^5.21.0", | ||
"typescript": "^5.2.2", | ||
"terser": "^5.24.0", | ||
"typescript": "^5.3.2", | ||
"vitest": "^0.34.6", | ||
"vitest-github-actions-reporter": "^0.10.0" | ||
"vitest-github-actions-reporter": "^0.11.0" | ||
}, | ||
@@ -129,0 +169,0 @@ "engines": { |
@@ -79,2 +79,8 @@ import {generateHelpUrl} from './generateHelpUrl' | ||
if ('stega' in newConfig && newConfig['stega'] !== undefined && newConfig['stega'] !== false) { | ||
throw new Error( | ||
`It looks like you're using options meant for '@sanity/client/stega'. Make sure you're using the right import. Or set 'stega' in 'createClient' to 'false'.`, | ||
) | ||
} | ||
const isBrowser = typeof window !== 'undefined' && window.location && window.location.hostname | ||
@@ -81,0 +87,0 @@ const isLocalhost = isBrowser && isLocal(window.location.hostname) |
@@ -0,27 +1,14 @@ | ||
import defineCreateClientExports, {ClientConfig, SanityClient} from './defineCreateClient' | ||
import {defineDeprecatedCreateClient} from './defineDeprecatedCreateClient' | ||
import envMiddleware from './http/browserMiddleware' | ||
import {defineHttpRequest} from './http/request' | ||
import {SanityClient} from './SanityClient' | ||
import type {ClientConfig} from './types' | ||
import {printNoDefaultExport} from './warnings' | ||
export * from './data/patch' | ||
export * from './data/transaction' | ||
export {ClientError, ServerError} from './http/errors' | ||
export * from './SanityClient' | ||
export * from './types' | ||
export * from './defineCreateClient' | ||
// Set the http client to use for requests, and its environment specific middleware | ||
const httpRequest = defineHttpRequest(envMiddleware, {}) | ||
const exp = defineCreateClientExports<SanityClient, ClientConfig>(envMiddleware, SanityClient) | ||
/** @public */ | ||
export const requester = httpRequest.defaultRequester | ||
export const requester = exp.requester | ||
/** @public */ | ||
export const createClient = (config: ClientConfig) => | ||
new SanityClient( | ||
defineHttpRequest(envMiddleware, { | ||
maxRetries: config.maxRetries, | ||
retryDelay: config.retryDelay, | ||
}), | ||
config, | ||
) | ||
export const createClient = exp.createClient | ||
@@ -32,8 +19,3 @@ /** | ||
*/ | ||
export default function deprecatedCreateClient(config: ClientConfig) { | ||
printNoDefaultExport() | ||
return new SanityClient(httpRequest, config) | ||
} | ||
/** @alpha */ | ||
export {adapter as unstable__adapter, environment as unstable__environment} from 'get-it' | ||
const deprecatedCreateClient = defineDeprecatedCreateClient(createClient) | ||
export default deprecatedCreateClient |
@@ -0,27 +1,14 @@ | ||
import defineCreateClientExports, {ClientConfig, SanityClient} from './defineCreateClient' | ||
import {defineDeprecatedCreateClient} from './defineDeprecatedCreateClient' | ||
import envMiddleware from './http/nodeMiddleware' | ||
import {defineHttpRequest} from './http/request' | ||
import {SanityClient} from './SanityClient' | ||
import type {ClientConfig} from './types' | ||
import {printNoDefaultExport} from './warnings' | ||
export * from './data/patch' | ||
export * from './data/transaction' | ||
export {ClientError, ServerError} from './http/errors' | ||
export * from './SanityClient' | ||
export * from './types' | ||
export * from './defineCreateClient' | ||
// Set the http client to use for requests, and its environment specific middleware | ||
const httpRequest = defineHttpRequest(envMiddleware, {}) | ||
const exp = defineCreateClientExports<SanityClient, ClientConfig>(envMiddleware, SanityClient) | ||
/** @public */ | ||
export const requester = httpRequest.defaultRequester | ||
export const requester = exp.requester | ||
/** @public */ | ||
export const createClient = (config: ClientConfig) => | ||
new SanityClient( | ||
defineHttpRequest(envMiddleware, { | ||
maxRetries: config.maxRetries, | ||
retryDelay: config.retryDelay, | ||
}), | ||
config, | ||
) | ||
export const createClient = exp.createClient | ||
@@ -32,8 +19,3 @@ /** | ||
*/ | ||
export default function deprecatedCreateClient(config: ClientConfig) { | ||
printNoDefaultExport() | ||
return new SanityClient(httpRequest, config) | ||
} | ||
/** @alpha */ | ||
export {adapter as unstable__adapter, environment as unstable__environment} from 'get-it' | ||
const deprecatedCreateClient = defineDeprecatedCreateClient(createClient) | ||
export default deprecatedCreateClient |
@@ -296,3 +296,3 @@ // deno-lint-ignore-file no-empty-interface | ||
tag?: string | ||
resultSourceMap?: boolean | ||
resultSourceMap?: boolean | 'withKeyArraySelector' | ||
perspective?: ClientPerspective | ||
@@ -669,3 +669,3 @@ } | ||
perspective?: ClientPerspective | ||
resultSourceMap?: boolean | ||
resultSourceMap?: boolean | 'withKeyArraySelector' | ||
cache?: RequestInit['cache'] | ||
@@ -672,0 +672,0 @@ next?: T extends keyof RequestInit ? RequestInit[T] : never |
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 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
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
2114721
95
27278
4
+ Added@vercel/stega@0.1.0
+ Added@vercel/stega@0.1.0(transitive)
Updatedget-it@^8.4.4