@sanity/client
Advanced tools
@@ -121,3 +121,11 @@ const BASE_URL = "https://www.sanity.io/help/"; | ||
...specifiedConfig | ||
}, experimentalResource = newConfig.experimental_resource; | ||
}; | ||
if (newConfig.projectId?.startsWith("resource.")) { | ||
const [, resourceType, resourceId] = newConfig.projectId?.split("."); | ||
resourceType && resourceId && (newConfig.experimental_resource = { | ||
type: resourceType, | ||
id: resourceId | ||
}); | ||
} | ||
const experimentalResource = newConfig.experimental_resource; | ||
experimentalResource && (newConfig.useProjectHostname = !1); | ||
@@ -124,0 +132,0 @@ const projectBased = newConfig.useProjectHostname; |
@@ -1510,3 +1510,3 @@ import { getIt } from "get-it"; | ||
} | ||
var name = "@sanity/client", version = "6.27.2-resources.0"; | ||
var name = "@sanity/client", version = "6.27.2-resources.1"; | ||
const middleware = [ | ||
@@ -1513,0 +1513,0 @@ debug({ verbose: !0, namespace: "sanity:client" }), |
{ | ||
"name": "@sanity/client", | ||
"version": "6.27.2-resources.0", | ||
"version": "6.27.2-resources.1", | ||
"description": "Client for retrieving, creating and patching data from Sanity.io", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -94,2 +94,12 @@ import {generateHelpUrl} from './generateHelpUrl' | ||
if (newConfig.projectId?.startsWith('resource.')) { | ||
const [, resourceType, resourceId] = newConfig.projectId?.split('.') | ||
if (resourceType && resourceId) { | ||
newConfig.experimental_resource = { | ||
type: resourceType, | ||
id: resourceId, | ||
} | ||
} | ||
} | ||
// resource oriented clients should not use project hostname in base url | ||
@@ -96,0 +106,0 @@ const experimentalResource = newConfig.experimental_resource |
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 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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2808155
0.13%33845
0.15%11
-8.33%