@sanity/cli 5.0.2-next.1 → 5.0.2-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -3482,11 +3482,11 @@ function getCliToken() {
|
|
|
3482
3482
|
function getClientWrapper(cliApiConfig, configPath) {
|
|
3483
3483
|
const requester = client$1.requester.clone();
|
|
3484
3484
|
return requester.use(authErrors()), function(opts) {
|
|
3485
|
-
const sanityEnv2 = process.env.SANITY_INTERNAL_ENV || "production", { requireUser, requireProject, api } = { ...defaults$1, ...opts }, token2 = getCliToken(), apiHost = apiHosts[sanityEnv2], apiConfig = {
|
|
3485
|
+
const sanityEnv2 = process.env.SANITY_INTERNAL_ENV || "production", rateLimitBypass = process.env.SANITY_CLI_API_RATE_LIMIT_BYPASS, { requireUser, requireProject, api } = { ...defaults$1, ...opts }, token2 = getCliToken(), apiHost = apiHosts[sanityEnv2], apiConfig = {
|
|
3486
3486
|
...cliApiConfig,
|
|
3487
3487
|
...api
|
|
3488
3488
|
};
|
|
3489
|
-
if (apiHost && (apiConfig.apiHost = apiHost), requireUser && !token2)
|
|
3489
|
+
if (apiHost && (apiConfig.apiHost = apiHost), sanityEnv2 === "staging" && rateLimitBypass && (apiConfig.headers ??= {}, apiConfig.headers["x-sanity-ratelimit-bypass"] = rateLimitBypass), requireUser && !token2)
|
|
3490
3490
|
throw new Error('You must login first - run "sanity login"');
|
|
3491
3491
|
if (requireProject && !apiConfig.projectId) {
|
|
3492
3492
|
const relativeConfigPath = path__default.default.relative(process.cwd(), configPath);
|