@sanity/client
Advanced tools
Comparing version 6.21.1 to 6.21.2
@@ -171,3 +171,3 @@ const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reKeySegment = /_key\s*==\s*['"](.*)['"]/, reIndexTuple = /^\d*:\d*$/; | ||
function resolveMapping(resultPath, csm) { | ||
if (!(csm != null && csm.mappings)) | ||
if (!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 != null && csm.mappings)) | ||
if (!csm?.mappings) | ||
return; | ||
@@ -248,10 +248,9 @@ 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 (_a = logger == null ? void 0 : logger.error) == null || _a.call(logger, `[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
throw logger?.error?.(`[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
} | ||
if (!resultSourceMap) | ||
return (_b = logger == null ? void 0 : logger.error) == null || _b.call(logger, "[@sanity/client]: Missing Content Source Map from response body", { | ||
return logger?.error?.("[@sanity/client]: Missing Content Source Map from response body", { | ||
result, | ||
@@ -263,3 +262,3 @@ resultSourceMap, | ||
const msg = "config.studioUrl must be defined"; | ||
throw (_c = logger == null ? void 0 : logger.error) == null || _c.call(logger, `[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
throw logger?.error?.(`[@sanity/client]: ${msg}`, { result, resultSourceMap, config }), new TypeError(msg); | ||
} | ||
@@ -311,12 +310,11 @@ const report = { | ||
const isSkipping = report.skipped.length, isEncoding = report.encoded.length; | ||
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, | ||
if ((isSkipping || isEncoding) && ((logger?.groupCollapsed || logger.log)?.("[@sanity/client]: Encoding source map into result"), logger.log?.( | ||
`[@sanity/client]: Paths encoded: ${report.encoded.length}, skipped: ${report.skipped.length}` | ||
)), 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) { | ||
)), report.encoded.length > 0 && (logger?.log?.("[@sanity/client]: Table of encoded paths"), (logger?.table || logger.log)?.(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, "[]")); | ||
(_h = logger == null ? void 0 : logger.log) == null || _h.call(logger, "[@sanity/client]: List of skipped paths", [...skipped.values()]); | ||
logger?.log?.("[@sanity/client]: List of skipped paths", [...skipped.values()]); | ||
} | ||
(isSkipping || isEncoding) && ((_i = logger == null ? void 0 : logger.groupEnd) == null || _i.call(logger)); | ||
(isSkipping || isEncoding) && logger?.groupEnd?.(); | ||
} | ||
@@ -323,0 +321,0 @@ return resultWithStega; |
{ | ||
"name": "@sanity/client", | ||
"version": "6.21.1", | ||
"version": "6.21.2", | ||
"description": "Client for retrieving, creating and patching data from Sanity.io", | ||
@@ -121,35 +121,35 @@ "keywords": [ | ||
"@sanity/eventsource": "^5.0.2", | ||
"get-it": "^8.6.3", | ||
"get-it": "^8.6.4", | ||
"rxjs": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@edge-runtime/types": "^3.0.0", | ||
"@edge-runtime/vm": "^4.0.0", | ||
"@edge-runtime/types": "^3.0.1", | ||
"@edge-runtime/vm": "^4.0.1", | ||
"@rollup/plugin-commonjs": "^26.0.1", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@sanity/pkg-utils": "^6.9.3", | ||
"@sanity/pkg-utils": "^6.10.9", | ||
"@types/json-diff": "^1.0.3", | ||
"@types/node": "^20.8.8", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@typescript-eslint/eslint-plugin": "^7.18.0", | ||
"@typescript-eslint/parser": "^7.18.0", | ||
"@vercel/stega": "0.1.2", | ||
"@vitest/coverage-v8": "2.0.2", | ||
"@vitest/coverage-v8": "2.0.5", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-simple-import-sort": "^12.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"eslint-plugin-simple-import-sort": "^12.1.1", | ||
"faucet": "^0.0.4", | ||
"happy-dom": "^12.10.3", | ||
"json-diff": "^1.0.6", | ||
"ls-engines": "^0.9.2", | ||
"next": "^14.2.4", | ||
"ls-engines": "^0.9.3", | ||
"next": "^14.2.5", | ||
"nock": "^13.5.4", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-packagejson": "^2.5.0", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-packagejson": "^2.5.1", | ||
"rimraf": "^5.0.7", | ||
"rollup": "^4.18.0", | ||
"rollup": "^4.20.0", | ||
"sse-channel": "^4.0.0", | ||
"terser": "^5.31.1", | ||
"typescript": "5.4.5", | ||
"vitest": "2.0.2", | ||
"terser": "^5.31.5", | ||
"typescript": "5.5.3", | ||
"vitest": "2.0.5", | ||
"vitest-github-actions-reporter": "0.11.1" | ||
@@ -156,0 +156,0 @@ }, |
@@ -104,3 +104,3 @@ # @sanity/client | ||
- [Set client configuration](#set-client-configuration) | ||
- [Server Side Actions](#server-side-actions) | ||
- [Actions](#actions) | ||
- [Action options](#action-options) | ||
@@ -1163,5 +1163,5 @@ - [Create Action](#create-action) | ||
### Server Side Actions | ||
### Actions | ||
The Server Side Actions API provides a new interface for creating, updating and publishing documents. It is a wrapper around the [Server Side Actions API](https://www.sanity.io/docs/http-actions). | ||
The Actions API provides a new interface for creating, updating and publishing documents. It is a wrapper around the [Actions API](https://www.sanity.io/docs/http-actions). | ||
@@ -1168,0 +1168,0 @@ This API is only available from API version `v2024-05-23`. |
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
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
63
10
15
2156410
24540
135
Updatedget-it@^8.6.4