@sanity/runtime-cli 10.0.2 → 10.1.0
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 +16 -16
- package/dist/utils/get-headers.d.ts +1 -0
- package/dist/utils/get-headers.js +15 -0
- 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/10.0
|
|
23
|
+
@sanity/runtime-cli/10.1.0 linux-x64 node-v22.17.1
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -86,7 +86,7 @@ EXAMPLES
|
|
|
86
86
|
$ sanity-run blueprints add function --name my-function --fn-type document-publish --lang js
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
89
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/add.ts)_
|
|
90
90
|
|
|
91
91
|
## `sanity-run blueprints config`
|
|
92
92
|
|
|
@@ -117,7 +117,7 @@ EXAMPLES
|
|
|
117
117
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack-id <stackId>
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
120
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/config.ts)_
|
|
121
121
|
|
|
122
122
|
## `sanity-run blueprints deploy`
|
|
123
123
|
|
|
@@ -139,7 +139,7 @@ EXAMPLES
|
|
|
139
139
|
$ sanity-run blueprints deploy --no-wait
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
142
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/deploy.ts)_
|
|
143
143
|
|
|
144
144
|
## `sanity-run blueprints destroy`
|
|
145
145
|
|
|
@@ -164,7 +164,7 @@ EXAMPLES
|
|
|
164
164
|
$ sanity-run blueprints destroy --stack-id <stackId> --project-id <projectId> --force --no-wait
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
167
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/destroy.ts)_
|
|
168
168
|
|
|
169
169
|
## `sanity-run blueprints info`
|
|
170
170
|
|
|
@@ -186,7 +186,7 @@ EXAMPLES
|
|
|
186
186
|
$ sanity-run blueprints info --stack-id <stackId>
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
189
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/info.ts)_
|
|
190
190
|
|
|
191
191
|
## `sanity-run blueprints init [DIR]`
|
|
192
192
|
|
|
@@ -224,7 +224,7 @@ EXAMPLES
|
|
|
224
224
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
227
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/init.ts)_
|
|
228
228
|
|
|
229
229
|
## `sanity-run blueprints logs`
|
|
230
230
|
|
|
@@ -246,7 +246,7 @@ EXAMPLES
|
|
|
246
246
|
$ sanity-run blueprints logs --watch
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
249
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/logs.ts)_
|
|
250
250
|
|
|
251
251
|
## `sanity-run blueprints plan`
|
|
252
252
|
|
|
@@ -263,7 +263,7 @@ EXAMPLES
|
|
|
263
263
|
$ sanity-run blueprints plan
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
266
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/plan.ts)_
|
|
267
267
|
|
|
268
268
|
## `sanity-run blueprints stacks`
|
|
269
269
|
|
|
@@ -285,7 +285,7 @@ EXAMPLES
|
|
|
285
285
|
$ sanity-run blueprints stacks --project-id <projectId>
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
288
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/blueprints/stacks.ts)_
|
|
289
289
|
|
|
290
290
|
## `sanity-run functions dev`
|
|
291
291
|
|
|
@@ -305,7 +305,7 @@ EXAMPLES
|
|
|
305
305
|
$ sanity-run functions dev --port 8974
|
|
306
306
|
```
|
|
307
307
|
|
|
308
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
308
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/functions/dev.ts)_
|
|
309
309
|
|
|
310
310
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
311
311
|
|
|
@@ -327,7 +327,7 @@ EXAMPLES
|
|
|
327
327
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
330
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/functions/env/add.ts)_
|
|
331
331
|
|
|
332
332
|
## `sanity-run functions env list NAME`
|
|
333
333
|
|
|
@@ -347,7 +347,7 @@ EXAMPLES
|
|
|
347
347
|
$ sanity-run functions env list MyFunction
|
|
348
348
|
```
|
|
349
349
|
|
|
350
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
350
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/functions/env/list.ts)_
|
|
351
351
|
|
|
352
352
|
## `sanity-run functions env remove NAME KEY`
|
|
353
353
|
|
|
@@ -368,7 +368,7 @@ EXAMPLES
|
|
|
368
368
|
$ sanity-run functions env remove MyFunction API_URL
|
|
369
369
|
```
|
|
370
370
|
|
|
371
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
371
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/functions/env/remove.ts)_
|
|
372
372
|
|
|
373
373
|
## `sanity-run functions logs NAME`
|
|
374
374
|
|
|
@@ -402,7 +402,7 @@ EXAMPLES
|
|
|
402
402
|
$ sanity-run functions logs <name> --delete
|
|
403
403
|
```
|
|
404
404
|
|
|
405
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
405
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/functions/logs.ts)_
|
|
406
406
|
|
|
407
407
|
## `sanity-run functions test NAME`
|
|
408
408
|
|
|
@@ -437,7 +437,7 @@ EXAMPLES
|
|
|
437
437
|
$ sanity-run functions test <name> --data '{ "id": 1 }' --timeout 60
|
|
438
438
|
```
|
|
439
439
|
|
|
440
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.0
|
|
440
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.0/src/commands/functions/test.ts)_
|
|
441
441
|
|
|
442
442
|
## `sanity-run help [COMMAND]`
|
|
443
443
|
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
const userAgent = getUserAgent();
|
|
4
|
+
function getUserAgent() {
|
|
5
|
+
try {
|
|
6
|
+
const pkgJsonPath = path.resolve(import.meta.dirname, '../../package.json');
|
|
7
|
+
const content = readFileSync(pkgJsonPath, 'utf8');
|
|
8
|
+
const pkg = JSON.parse(content);
|
|
9
|
+
return `${pkg.name}@${pkg.version}`;
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
return 'unknown@0.0.0';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
1
15
|
export default function getHeaders({ token, projectId }) {
|
|
2
16
|
return {
|
|
3
17
|
Accept: 'application/json',
|
|
@@ -5,5 +19,6 @@ export default function getHeaders({ token, projectId }) {
|
|
|
5
19
|
Authorization: `Bearer ${token}`,
|
|
6
20
|
'X-Sanity-Scope-Type': 'project',
|
|
7
21
|
'X-Sanity-Scope-Id': projectId,
|
|
22
|
+
'User-Agent': userAgent,
|
|
8
23
|
};
|
|
9
24
|
}
|
package/oclif.manifest.json
CHANGED