Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/client

Package Overview
Dependencies
Maintainers
41
Versions
993
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/client - npm Package Compare versions

Comparing version 6.9.0 to 6.9.1

dist/_chunks/browserMiddleware-MafB5TmI.js

4

dist/index.browser.js

@@ -1,3 +0,3 @@

import { printNoDefaultExport, defineCreateClientExports, SanityClient, envMiddleware } from './_chunks/browserMiddleware-qjpIf6pt.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableSanityClient, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/browserMiddleware-qjpIf6pt.js';
import { printNoDefaultExport, defineCreateClientExports, SanityClient, envMiddleware } from './_chunks/browserMiddleware-MafB5TmI.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableSanityClient, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/browserMiddleware-MafB5TmI.js';
export { adapter as unstable__adapter, environment as unstable__environment } from 'get-it';

@@ -4,0 +4,0 @@ function defineDeprecatedCreateClient(createClient) {

@@ -1,3 +0,3 @@

import { printNoDefaultExport, defineCreateClientExports, SanityClient, middleware } from './_chunks/nodeMiddleware-FR4SCkjH.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableSanityClient, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/nodeMiddleware-FR4SCkjH.js';
import { printNoDefaultExport, defineCreateClientExports, SanityClient, middleware } from './_chunks/nodeMiddleware-_IDbqRDk.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableSanityClient, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/nodeMiddleware-_IDbqRDk.js';
export { adapter as unstable__adapter, environment as unstable__environment } from 'get-it';

@@ -4,0 +4,0 @@ function defineDeprecatedCreateClient(createClient) {

@@ -1,3 +0,3 @@

import { ObservableSanityClient, defaultConfig, SanityClient, defineCreateClientExports, envMiddleware } from './_chunks/browserMiddleware-qjpIf6pt.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/browserMiddleware-qjpIf6pt.js';
import { ObservableSanityClient, defaultConfig, SanityClient, defineCreateClientExports, envMiddleware } from './_chunks/browserMiddleware-MafB5TmI.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/browserMiddleware-MafB5TmI.js';
import { map } from 'rxjs/operators';

@@ -42,15 +42,2 @@ import { vercelStegaCombine, vercelStegaSplit } from '@vercel/stega';

};
function splitStegaConfigFromFetchOptions(options, initializedStegaConfig) {
const {
stega = {},
...fetchOptions
} = options;
const stegaConfig = initStegaConfig(typeof stega === "boolean" ? {
enabled: stega
} : stega, initializedStegaConfig);
return {
fetchOptions,
stegaConfig
};
}
const DRAFTS_PREFIX = "drafts.";

@@ -593,8 +580,4 @@ function getPublishedId(id) {

fetch(query, params) {
let _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
const {
stegaConfig,
fetchOptions: options
} = splitStegaConfigFromFetchOptions(_options, this.stegaConfig);
if (!stegaConfig.enabled) {
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (!this.stegaConfig.enabled) {
return super.fetch(query, params, options);

@@ -613,3 +596,3 @@ }

} = res;
const result = stegaEncodeSourceMap(_result, resultSourceMap, stegaConfig);
const result = stegaEncodeSourceMap(_result, resultSourceMap, this.stegaConfig);
return originalFilterResponse ? result : {

@@ -685,8 +668,4 @@ ...res,

fetch(query, params) {
let _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
const {
stegaConfig,
fetchOptions: options
} = splitStegaConfigFromFetchOptions(_options, this.stegaConfig);
if (!stegaConfig.enabled) {
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (!this.stegaConfig.enabled) {
return super.fetch(query, params, options);

@@ -705,3 +684,3 @@ }

} = res;
const result = stegaEncodeSourceMap(_result, resultSourceMap, stegaConfig);
const result = stegaEncodeSourceMap(_result, resultSourceMap, this.stegaConfig);
return originalFilterResponse ? result : {

@@ -708,0 +687,0 @@ ...res,

@@ -1,3 +0,3 @@

import { ObservableSanityClient, defaultConfig, SanityClient, defineCreateClientExports, middleware } from './_chunks/nodeMiddleware-FR4SCkjH.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/nodeMiddleware-FR4SCkjH.js';
import { ObservableSanityClient, defaultConfig, SanityClient, defineCreateClientExports, middleware } from './_chunks/nodeMiddleware-_IDbqRDk.js';
export { BasePatch, BaseTransaction, ClientError, ObservablePatch, ObservableTransaction, Patch, ServerError, Transaction } from './_chunks/nodeMiddleware-_IDbqRDk.js';
import { map } from 'rxjs/operators';

@@ -43,15 +43,2 @@ import { vercelStegaCombine, vercelStegaSplit } from '@vercel/stega';

};
function splitStegaConfigFromFetchOptions(options, initializedStegaConfig) {
const {
stega = {},
...fetchOptions
} = options;
const stegaConfig = initStegaConfig(typeof stega === "boolean" ? {
enabled: stega
} : stega, initializedStegaConfig);
return {
fetchOptions,
stegaConfig
};
}
function encodeIntoResult(result, csm, encoder) {

@@ -335,8 +322,4 @@ return walkMap(result, (value, path) => {

fetch(query, params) {
let _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
const {
stegaConfig,
fetchOptions: options
} = splitStegaConfigFromFetchOptions(_options, this.stegaConfig);
if (!stegaConfig.enabled) {
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (!this.stegaConfig.enabled) {
return super.fetch(query, params, options);

@@ -355,3 +338,3 @@ }

} = res;
const result = stegaEncodeSourceMap(_result, resultSourceMap, stegaConfig);
const result = stegaEncodeSourceMap(_result, resultSourceMap, this.stegaConfig);
return originalFilterResponse ? result : {

@@ -427,8 +410,4 @@ ...res,

fetch(query, params) {
let _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
const {
stegaConfig,
fetchOptions: options
} = splitStegaConfigFromFetchOptions(_options, this.stegaConfig);
if (!stegaConfig.enabled) {
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (!this.stegaConfig.enabled) {
return super.fetch(query, params, options);

@@ -447,3 +426,3 @@ }

} = res;
const result = stegaEncodeSourceMap(_result, resultSourceMap, stegaConfig);
const result = stegaEncodeSourceMap(_result, resultSourceMap, this.stegaConfig);
return originalFilterResponse ? result : {

@@ -450,0 +429,0 @@ ...res,

{
"name": "@sanity/client",
"version": "6.9.0",
"version": "6.9.1",
"description": "Client for retrieving, creating and patching data from Sanity.io",

@@ -5,0 +5,0 @@ "keywords": [

@@ -72,7 +72,2 @@ import {type MonoTypeOperatorFunction, Observable} from 'rxjs'

): Observable<RawQueryResponse<R> | R> {
if ('stega' in options && options['stega'] !== undefined && options['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 'fetch' to 'false'.`,
)
}
const mapResponse =

@@ -79,0 +74,0 @@ options.filterResponse === false ? (res: Any) => res : (res: Any) => res.result

@@ -1,6 +0,2 @@

import type {
ClientConfig,
FilteredResponseQueryOptions,
UnfilteredResponseQueryOptions,
} from '../types'
import type {ClientConfig} from '../types'
import type {ClientStegaConfig, InitializedStegaConfig, StegaConfig} from './types'

@@ -60,18 +56,1 @@

}
export function splitStegaConfigFromFetchOptions(
options: (FilteredResponseQueryOptions | UnfilteredResponseQueryOptions) & {
stega?: boolean | StegaConfig
},
initializedStegaConfig: InitializedStegaConfig,
): {
fetchOptions: FilteredResponseQueryOptions | UnfilteredResponseQueryOptions
stegaConfig: InitializedStegaConfig
} {
const {stega = {}, ...fetchOptions} = options
const stegaConfig = initStegaConfig(
typeof stega === 'boolean' ? {enabled: stega} : stega,
initializedStegaConfig,
)
return {fetchOptions, stegaConfig}
}

@@ -15,15 +15,5 @@ import {Observable} from 'rxjs'

} from '../types'
import {
defaultStegaConfig,
initStegaConfig,
splitConfig,
splitStegaConfigFromFetchOptions,
} from './config'
import {defaultStegaConfig, initStegaConfig, splitConfig} from './config'
import {stegaEncodeSourceMap} from './stegaEncodeSourceMap'
import {
ClientStegaConfig,
InitializedClientStegaConfig,
InitializedStegaConfig,
StegaConfig,
} from './types'
import {ClientStegaConfig, InitializedClientStegaConfig, InitializedStegaConfig} from './types'

@@ -114,3 +104,3 @@ /** @public */

params: Q | undefined,
options: FilteredResponseQueryOptions & {stega?: boolean | StegaConfig},
options: FilteredResponseQueryOptions,
): Observable<R>

@@ -127,3 +117,3 @@ /**

params: Q | undefined,
options: UnfilteredResponseQueryOptions & {stega?: boolean | StegaConfig},
options: UnfilteredResponseQueryOptions,
): Observable<RawQueryResponse<R>>

@@ -133,11 +123,5 @@ fetch<R, Q extends QueryParams>(

params?: Q,
_options: (FilteredResponseQueryOptions | UnfilteredResponseQueryOptions) & {
stega?: boolean | StegaConfig
} = {},
options: FilteredResponseQueryOptions | UnfilteredResponseQueryOptions = {},
): Observable<RawQueryResponse<R> | R> {
const {stegaConfig, fetchOptions: options} = splitStegaConfigFromFetchOptions(
_options,
this.stegaConfig,
)
if (!stegaConfig.enabled) {
if (!this.stegaConfig.enabled) {
return super.fetch<R, Q>(query, params, options as Any)

@@ -158,3 +142,3 @@ }

const {result: _result, resultSourceMap} = res as RawQueryResponse<R>
const result = stegaEncodeSourceMap(_result, resultSourceMap, stegaConfig)
const result = stegaEncodeSourceMap(_result, resultSourceMap, this.stegaConfig)
return originalFilterResponse ? result : {...res, result}

@@ -257,3 +241,3 @@ }),

params: Q | undefined,
options: FilteredResponseQueryOptions & {stega?: boolean | StegaConfig},
options: FilteredResponseQueryOptions,
): Promise<R>

@@ -270,3 +254,3 @@ /**

params: Q | undefined,
options: UnfilteredResponseQueryOptions & {stega?: boolean | StegaConfig},
options: UnfilteredResponseQueryOptions,
): Promise<RawQueryResponse<R>>

@@ -276,11 +260,5 @@ fetch<R, Q extends QueryParams>(

params?: Q,
_options: (FilteredResponseQueryOptions | UnfilteredResponseQueryOptions) & {
stega?: boolean | StegaConfig
} = {},
options: FilteredResponseQueryOptions | UnfilteredResponseQueryOptions = {},
): Promise<RawQueryResponse<R> | R> {
const {stegaConfig, fetchOptions: options} = splitStegaConfigFromFetchOptions(
_options,
this.stegaConfig,
)
if (!stegaConfig.enabled) {
if (!this.stegaConfig.enabled) {
return super.fetch<R, Q>(query, params, options as Any)

@@ -300,3 +278,3 @@ }

const {result: _result, resultSourceMap} = res as RawQueryResponse<R>
const result = stegaEncodeSourceMap(_result, resultSourceMap, stegaConfig)
const result = stegaEncodeSourceMap(_result, resultSourceMap, this.stegaConfig)
return originalFilterResponse ? result : {...res, result}

@@ -303,0 +281,0 @@ })

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 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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc