@sanity/runtime-cli 14.1.0 → 14.1.1
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/README.md +18 -18
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -0
- package/dist/utils/validated-token.js +3 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @sanity/runtime-cli
|
|
|
20
20
|
$ sanity-run COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ sanity-run (--version)
|
|
23
|
-
@sanity/runtime-cli/14.1.
|
|
23
|
+
@sanity/runtime-cli/14.1.1 linux-x64 node-v24.13.1
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -98,7 +98,7 @@ EXAMPLES
|
|
|
98
98
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
101
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/add.ts)_
|
|
102
102
|
|
|
103
103
|
## `sanity-run blueprints config`
|
|
104
104
|
|
|
@@ -133,7 +133,7 @@ EXAMPLES
|
|
|
133
133
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
136
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/config.ts)_
|
|
137
137
|
|
|
138
138
|
## `sanity-run blueprints deploy`
|
|
139
139
|
|
|
@@ -166,7 +166,7 @@ EXAMPLES
|
|
|
166
166
|
$ sanity-run blueprints deploy --no-wait
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
169
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/deploy.ts)_
|
|
170
170
|
|
|
171
171
|
## `sanity-run blueprints destroy`
|
|
172
172
|
|
|
@@ -198,7 +198,7 @@ EXAMPLES
|
|
|
198
198
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
201
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/destroy.ts)_
|
|
202
202
|
|
|
203
203
|
## `sanity-run blueprints doctor`
|
|
204
204
|
|
|
@@ -224,7 +224,7 @@ DESCRIPTION
|
|
|
224
224
|
issues.
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
227
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/doctor.ts)_
|
|
228
228
|
|
|
229
229
|
## `sanity-run blueprints info`
|
|
230
230
|
|
|
@@ -254,7 +254,7 @@ EXAMPLES
|
|
|
254
254
|
$ sanity-run blueprints info --stack <name-or-id>
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
257
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/info.ts)_
|
|
258
258
|
|
|
259
259
|
## `sanity-run blueprints init [DIR]`
|
|
260
260
|
|
|
@@ -304,7 +304,7 @@ EXAMPLES
|
|
|
304
304
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
307
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/init.ts)_
|
|
308
308
|
|
|
309
309
|
## `sanity-run blueprints logs`
|
|
310
310
|
|
|
@@ -333,7 +333,7 @@ EXAMPLES
|
|
|
333
333
|
$ sanity-run blueprints logs --watch
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
336
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/logs.ts)_
|
|
337
337
|
|
|
338
338
|
## `sanity-run blueprints plan`
|
|
339
339
|
|
|
@@ -359,7 +359,7 @@ EXAMPLES
|
|
|
359
359
|
$ sanity-run blueprints plan
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
362
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/plan.ts)_
|
|
363
363
|
|
|
364
364
|
## `sanity-run blueprints stacks`
|
|
365
365
|
|
|
@@ -388,7 +388,7 @@ EXAMPLES
|
|
|
388
388
|
$ sanity-run blueprints stacks --organization-id <organizationId>
|
|
389
389
|
```
|
|
390
390
|
|
|
391
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
391
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/blueprints/stacks.ts)_
|
|
392
392
|
|
|
393
393
|
## `sanity-run functions add`
|
|
394
394
|
|
|
@@ -437,7 +437,7 @@ EXAMPLES
|
|
|
437
437
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
438
438
|
```
|
|
439
439
|
|
|
440
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
440
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/add.ts)_
|
|
441
441
|
|
|
442
442
|
## `sanity-run functions dev`
|
|
443
443
|
|
|
@@ -471,7 +471,7 @@ EXAMPLES
|
|
|
471
471
|
$ sanity-run functions dev --timeout 60
|
|
472
472
|
```
|
|
473
473
|
|
|
474
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
474
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/dev.ts)_
|
|
475
475
|
|
|
476
476
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
477
477
|
|
|
@@ -498,7 +498,7 @@ EXAMPLES
|
|
|
498
498
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
499
499
|
```
|
|
500
500
|
|
|
501
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
501
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/env/add.ts)_
|
|
502
502
|
|
|
503
503
|
## `sanity-run functions env list NAME`
|
|
504
504
|
|
|
@@ -522,7 +522,7 @@ EXAMPLES
|
|
|
522
522
|
$ sanity-run functions env list MyFunction
|
|
523
523
|
```
|
|
524
524
|
|
|
525
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
525
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/env/list.ts)_
|
|
526
526
|
|
|
527
527
|
## `sanity-run functions env remove NAME KEY`
|
|
528
528
|
|
|
@@ -548,7 +548,7 @@ EXAMPLES
|
|
|
548
548
|
$ sanity-run functions env remove MyFunction API_URL
|
|
549
549
|
```
|
|
550
550
|
|
|
551
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
551
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/env/remove.ts)_
|
|
552
552
|
|
|
553
553
|
## `sanity-run functions logs [NAME]`
|
|
554
554
|
|
|
@@ -588,7 +588,7 @@ EXAMPLES
|
|
|
588
588
|
$ sanity-run functions logs <name> --delete
|
|
589
589
|
```
|
|
590
590
|
|
|
591
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
591
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/logs.ts)_
|
|
592
592
|
|
|
593
593
|
## `sanity-run functions test [NAME]`
|
|
594
594
|
|
|
@@ -642,7 +642,7 @@ EXAMPLES
|
|
|
642
642
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
643
643
|
```
|
|
644
644
|
|
|
645
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.
|
|
645
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.1.1/src/commands/functions/test.ts)_
|
|
646
646
|
|
|
647
647
|
## `sanity-run help [COMMAND]`
|
|
648
648
|
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -21,6 +21,7 @@ const nodeEnv = env.NODE_ENV?.toLowerCase() ?? 'production';
|
|
|
21
21
|
const isTest = nodeEnv === 'test';
|
|
22
22
|
const sanityEnv = env.SANITY_INTERNAL_ENV?.toLowerCase() ?? 'production';
|
|
23
23
|
const sanityProd = sanityEnv === 'production';
|
|
24
|
+
const isLive = sanityProd || sanityEnv === 'staging';
|
|
24
25
|
const isPublishing = env?.PUBLISHING?.toLowerCase() === 'true';
|
|
25
26
|
const apiUrls = {
|
|
26
27
|
production: 'https://api.sanity.io/',
|
|
@@ -52,6 +53,7 @@ function loadToken() {
|
|
|
52
53
|
}
|
|
53
54
|
export default {
|
|
54
55
|
isTest,
|
|
56
|
+
isLive,
|
|
55
57
|
apiUrl,
|
|
56
58
|
get token() {
|
|
57
59
|
return _token === undefined ? loadToken() : _token;
|
|
@@ -3,10 +3,12 @@ import { createTracedFetch } from './traced-fetch.js';
|
|
|
3
3
|
export async function validToken(logger, maybeToken) {
|
|
4
4
|
if (config.isTest)
|
|
5
5
|
return maybeToken ?? 'token';
|
|
6
|
-
const fetchFn = createTracedFetch(logger);
|
|
7
6
|
const token = maybeToken ?? config.token;
|
|
8
7
|
if (!token)
|
|
9
8
|
throw new Error('NO_TOKEN');
|
|
9
|
+
if (!config.isLive)
|
|
10
|
+
return token;
|
|
11
|
+
const fetchFn = createTracedFetch(logger);
|
|
10
12
|
const url = `${config.apiUrl}v2025-04-23/users/me`;
|
|
11
13
|
const response = await fetchFn(url, {
|
|
12
14
|
method: 'GET',
|
package/oclif.manifest.json
CHANGED