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

@sanity/client

Package Overview
Dependencies
Maintainers
55
Versions
992
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.21.2 to 6.21.3-canary.0

2

dist/_chunks-es/resolveEditInfo.js

@@ -171,3 +171,3 @@ const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reKeySegment = /_key\s*==\s*['"](.*)['"]/, reIndexTuple = /^\d*:\d*$/;

function resolveMapping(resultPath, csm) {
if (!csm?.mappings)
if (!(csm != null && csm.mappings))
return;

@@ -174,0 +174,0 @@ const resultMappingPath = jsonPath(jsonPathToMappingPath(resultPath));

@@ -88,3 +88,3 @@ import { C } from "./stegaClean.js";

function resolveMapping(resultPath, csm) {
if (!csm?.mappings)
if (!(csm != null && csm.mappings))
return;

@@ -248,9 +248,10 @@ const resultMappingPath = jsonPath(jsonPathToMappingPath(resultPath));

function stegaEncodeSourceMap(result, resultSourceMap, config) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
const { filter, logger, enabled } = config;
if (!enabled) {
const msg = "config.enabled must be true, don't call this function otherwise";
throw logger?.error?.(`[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg);
throw (_a = logger == null ? void 0 : logger.error) == null || _a.call(logger, `[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg);
}
if (!resultSourceMap)
return logger?.error?.("[@sanity/client]: Missing Content Source Map from response body", {
return (_b = logger == null ? void 0 : logger.error) == null || _b.call(logger, "[@sanity/client]: Missing Content Source Map from response body", {
result,

@@ -262,3 +263,3 @@ resultSourceMap,

const msg = "config.studioUrl must be defined";
throw logger?.error?.(`[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg);
throw (_c = logger == null ? void 0 : logger.error) == null || _c.call(logger, `[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg);
}

@@ -310,11 +311,12 @@ const report = {

const isSkipping = report.skipped.length, isEncoding = report.encoded.length;
if ((isSkipping || isEncoding) && ((logger?.groupCollapsed || logger.log)?.("[@sanity/client]: Encoding source map into result"), logger.log?.(
if ((isSkipping || isEncoding) && ((_d = (logger == null ? void 0 : logger.groupCollapsed) || logger.log) == null || _d("[@sanity/client]: Encoding source map into result"), (_e = logger.log) == null || _e.call(
logger,
`[@sanity/client]: Paths encoded: ${report.encoded.length}, skipped: ${report.skipped.length}`
)), report.encoded.length > 0 && (logger?.log?.("[@sanity/client]: Table of encoded paths"), (logger?.table || logger.log)?.(report.encoded)), report.skipped.length > 0) {
)), report.encoded.length > 0 && ((_f = logger == null ? void 0 : logger.log) == null || _f.call(logger, "[@sanity/client]: Table of encoded paths"), (_g = (logger == null ? void 0 : logger.table) || logger.log) == null || _g(report.encoded)), report.skipped.length > 0) {
const skipped = /* @__PURE__ */ new Set();
for (const { path } of report.skipped)
skipped.add(path.replace(reKeySegment, "0").replace(/\[\d+\]/g, "[]"));
logger?.log?.("[@sanity/client]: List of skipped paths", [...skipped.values()]);
(_h = logger == null ? void 0 : logger.log) == null || _h.call(logger, "[@sanity/client]: List of skipped paths", [...skipped.values()]);
}
(isSkipping || isEncoding) && logger?.groupEnd?.();
(isSkipping || isEncoding) && ((_i = logger == null ? void 0 : logger.groupEnd) == null || _i.call(logger));
}

@@ -321,0 +323,0 @@ return resultWithStega;

{
"name": "@sanity/client",
"version": "6.21.2",
"version": "6.21.3-canary.0",
"description": "Client for retrieving, creating and patching data from Sanity.io",

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

@@ -132,5 +132,10 @@ import {from, type MonoTypeOperatorFunction, Observable} from 'rxjs'

id: string,
opts: {tag?: string} = {},
opts: {signal?: AbortSignal; tag?: string} = {},
): Observable<SanityDocument<R> | undefined> {
const options = {uri: _getDataUrl(client, 'doc', id), json: true, tag: opts.tag}
const options = {
uri: _getDataUrl(client, 'doc', id),
json: true,
tag: opts.tag,
signal: opts.signal,
}
return _requestObservable<SanityDocument<R> | undefined>(client, httpRequest, options).pipe(

@@ -147,5 +152,10 @@ filter(isResponse),

ids: string[],
opts: {tag?: string} = {},
opts: {signal?: AbortSignal; tag?: string} = {},
): Observable<(SanityDocument<R> | null)[]> {
const options = {uri: _getDataUrl(client, 'doc', ids.join(',')), json: true, tag: opts.tag}
const options = {
uri: _getDataUrl(client, 'doc', ids.join(',')),
json: true,
tag: opts.tag,
signal: opts.signal,
}
return _requestObservable<(SanityDocument<R> | null)[]>(client, httpRequest, options).pipe(

@@ -152,0 +162,0 @@ filter(isResponse),

@@ -903,3 +903,3 @@ import {lastValueFrom, Observable} from 'rxjs'

id: string,
options?: {tag?: string},
options?: {signal?: AbortSignal; tag?: string},
): Promise<SanityDocument<R> | undefined> {

@@ -920,3 +920,3 @@ return lastValueFrom(dataMethods._getDocument<R>(this, this.#httpRequest, id, options))

ids: string[],
options?: {tag?: string},
options?: {signal?: AbortSignal; tag?: string},
): Promise<(SanityDocument<R> | null)[]> {

@@ -923,0 +923,0 @@ return lastValueFrom(dataMethods._getDocuments<R>(this, this.#httpRequest, ids, options))

@@ -375,2 +375,6 @@ // deno-lint-ignore-file no-empty-interface

displayName: string
/**
* @deprecated Use the `/user-applications` endpoint instead, which lists all deployed studios/applications
* @see https://www.sanity.io/help/studio-host-user-applications
*/
studioHost: string | null

@@ -388,2 +392,6 @@ organizationId: string | null

color?: string
/**
* @deprecated Use the `/user-applications` endpoint instead, which lists all deployed studios/applications
* @see https://www.sanity.io/help/studio-host-user-applications
*/
externalStudioHost?: string

@@ -390,0 +398,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 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

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