@sanity/runtime-cli 10.3.0 → 10.3.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/README.md +20 -20
- package/dist/commands/blueprints/add.d.ts +1 -1
- package/dist/commands/blueprints/add.js +4 -3
- package/dist/server/static/components/clear-button.js +1 -0
- package/dist/server/static/components/filters.js +18 -2
- package/dist/server/static/components/help-button.js +3 -4
- package/oclif.manifest.json +8 -5
- package/package.json +2 -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.3.
|
|
23
|
+
@sanity/runtime-cli/10.3.2 linux-x64 node-v22.18.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -53,8 +53,8 @@ Add a Resource to a Blueprint
|
|
|
53
53
|
```
|
|
54
54
|
USAGE
|
|
55
55
|
$ sanity-run blueprints add TYPE [--example <value> | -n <value> | --fn-type
|
|
56
|
-
document-publish|document-create|document-delete|document-update | --
|
|
57
|
-
|
|
56
|
+
document-publish|document-create|document-delete|document-update | --language ts|js | --javascript | --fn-helpers |
|
|
57
|
+
--fn-installer skip|npm|pnpm|yarn] [-i | ]
|
|
58
58
|
|
|
59
59
|
ARGUMENTS
|
|
60
60
|
TYPE (function) Type of Resource to add (e.g. function)
|
|
@@ -66,11 +66,11 @@ FLAGS
|
|
|
66
66
|
--[no-]fn-helpers Add helpers to the new Function
|
|
67
67
|
--fn-installer=<option> How to install the @sanity/functions helpers
|
|
68
68
|
<options: skip|npm|pnpm|yarn>
|
|
69
|
-
--fn-language=<option> [default: ts] Language of the new Function
|
|
70
|
-
<options: ts|js>
|
|
71
69
|
--fn-type=<option> Type of new Function
|
|
72
70
|
<options: document-publish|document-create|document-delete|document-update>
|
|
73
71
|
--javascript Use JavaScript instead of TypeScript
|
|
72
|
+
--language=<option> [default: ts] Language of the new Function
|
|
73
|
+
<options: ts|js>
|
|
74
74
|
|
|
75
75
|
DESCRIPTION
|
|
76
76
|
Add a Resource to a Blueprint
|
|
@@ -87,7 +87,7 @@ EXAMPLES
|
|
|
87
87
|
$ sanity-run blueprints add function --name my-function --fn-type document-update --lang js
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
90
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/add.ts)_
|
|
91
91
|
|
|
92
92
|
## `sanity-run blueprints config`
|
|
93
93
|
|
|
@@ -118,7 +118,7 @@ EXAMPLES
|
|
|
118
118
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack-id <stackId>
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
121
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/config.ts)_
|
|
122
122
|
|
|
123
123
|
## `sanity-run blueprints deploy`
|
|
124
124
|
|
|
@@ -140,7 +140,7 @@ EXAMPLES
|
|
|
140
140
|
$ sanity-run blueprints deploy --no-wait
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
143
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/deploy.ts)_
|
|
144
144
|
|
|
145
145
|
## `sanity-run blueprints destroy`
|
|
146
146
|
|
|
@@ -165,7 +165,7 @@ EXAMPLES
|
|
|
165
165
|
$ sanity-run blueprints destroy --stack-id <stackId> --project-id <projectId> --force --no-wait
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
168
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/destroy.ts)_
|
|
169
169
|
|
|
170
170
|
## `sanity-run blueprints info`
|
|
171
171
|
|
|
@@ -187,7 +187,7 @@ EXAMPLES
|
|
|
187
187
|
$ sanity-run blueprints info --stack-id <stackId>
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
190
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/info.ts)_
|
|
191
191
|
|
|
192
192
|
## `sanity-run blueprints init [DIR]`
|
|
193
193
|
|
|
@@ -225,7 +225,7 @@ EXAMPLES
|
|
|
225
225
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
228
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/init.ts)_
|
|
229
229
|
|
|
230
230
|
## `sanity-run blueprints logs`
|
|
231
231
|
|
|
@@ -247,7 +247,7 @@ EXAMPLES
|
|
|
247
247
|
$ sanity-run blueprints logs --watch
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
250
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/logs.ts)_
|
|
251
251
|
|
|
252
252
|
## `sanity-run blueprints plan`
|
|
253
253
|
|
|
@@ -264,7 +264,7 @@ EXAMPLES
|
|
|
264
264
|
$ sanity-run blueprints plan
|
|
265
265
|
```
|
|
266
266
|
|
|
267
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
267
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/plan.ts)_
|
|
268
268
|
|
|
269
269
|
## `sanity-run blueprints stacks`
|
|
270
270
|
|
|
@@ -286,7 +286,7 @@ EXAMPLES
|
|
|
286
286
|
$ sanity-run blueprints stacks --project-id <projectId>
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
289
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/blueprints/stacks.ts)_
|
|
290
290
|
|
|
291
291
|
## `sanity-run functions dev`
|
|
292
292
|
|
|
@@ -306,7 +306,7 @@ EXAMPLES
|
|
|
306
306
|
$ sanity-run functions dev --port 8974
|
|
307
307
|
```
|
|
308
308
|
|
|
309
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
309
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/functions/dev.ts)_
|
|
310
310
|
|
|
311
311
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
312
312
|
|
|
@@ -328,7 +328,7 @@ EXAMPLES
|
|
|
328
328
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
329
329
|
```
|
|
330
330
|
|
|
331
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
331
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/functions/env/add.ts)_
|
|
332
332
|
|
|
333
333
|
## `sanity-run functions env list NAME`
|
|
334
334
|
|
|
@@ -348,7 +348,7 @@ EXAMPLES
|
|
|
348
348
|
$ sanity-run functions env list MyFunction
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
351
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/functions/env/list.ts)_
|
|
352
352
|
|
|
353
353
|
## `sanity-run functions env remove NAME KEY`
|
|
354
354
|
|
|
@@ -369,7 +369,7 @@ EXAMPLES
|
|
|
369
369
|
$ sanity-run functions env remove MyFunction API_URL
|
|
370
370
|
```
|
|
371
371
|
|
|
372
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
372
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/functions/env/remove.ts)_
|
|
373
373
|
|
|
374
374
|
## `sanity-run functions logs NAME`
|
|
375
375
|
|
|
@@ -403,7 +403,7 @@ EXAMPLES
|
|
|
403
403
|
$ sanity-run functions logs <name> --delete
|
|
404
404
|
```
|
|
405
405
|
|
|
406
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
406
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/functions/logs.ts)_
|
|
407
407
|
|
|
408
408
|
## `sanity-run functions test NAME`
|
|
409
409
|
|
|
@@ -438,7 +438,7 @@ EXAMPLES
|
|
|
438
438
|
$ sanity-run functions test <name> --data '{ "id": 1 }' --timeout 60
|
|
439
439
|
```
|
|
440
440
|
|
|
441
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.
|
|
441
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.3.2/src/commands/functions/test.ts)_
|
|
442
442
|
|
|
443
443
|
## `sanity-run help [COMMAND]`
|
|
444
444
|
|
|
@@ -9,7 +9,7 @@ export default class AddCommand extends BlueprintCommand<typeof AddCommand> {
|
|
|
9
9
|
example: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
'fn-type': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
|
|
12
|
+
language: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
javascript: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
'fn-helpers': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
15
|
'fn-installer': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -21,7 +21,7 @@ export default class AddCommand extends BlueprintCommand {
|
|
|
21
21
|
example: Flags.string({
|
|
22
22
|
description: 'Example to use for the Resource',
|
|
23
23
|
aliases: ['recipe'],
|
|
24
|
-
exclusive: ['name', 'fn-type', '
|
|
24
|
+
exclusive: ['name', 'fn-type', 'language', 'javascript', 'fn-helpers', 'fn-installer'], // set automatically
|
|
25
25
|
}),
|
|
26
26
|
name: Flags.string({
|
|
27
27
|
description: 'Name of the Resource to add',
|
|
@@ -33,15 +33,16 @@ export default class AddCommand extends BlueprintCommand {
|
|
|
33
33
|
aliases: ['function-type'],
|
|
34
34
|
dependsOn: ['name'],
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
language: Flags.string({
|
|
37
37
|
description: 'Language of the new Function',
|
|
38
|
-
aliases: ['function-language', 'language', 'lang'],
|
|
38
|
+
aliases: ['function-language', 'fn-language', 'lang'],
|
|
39
39
|
options: ['ts', 'js'],
|
|
40
40
|
default: 'ts',
|
|
41
41
|
}),
|
|
42
42
|
javascript: Flags.boolean({
|
|
43
43
|
description: 'Use JavaScript instead of TypeScript',
|
|
44
44
|
aliases: ['js'],
|
|
45
|
+
exclusive: ['language'],
|
|
45
46
|
}),
|
|
46
47
|
'fn-helpers': Flags.boolean({
|
|
47
48
|
description: 'Add helpers to the new Function',
|
|
@@ -28,14 +28,30 @@ class FiltersComponent extends HTMLElement {
|
|
|
28
28
|
</fieldset>
|
|
29
29
|
|
|
30
30
|
<fieldset class="mar-t-sm" style="display: flex; flex-direction: column; margin-top: 12px !important;">
|
|
31
|
-
<span class="slab-text" style="display: block; margin-bottom: var(--space-1);">
|
|
31
|
+
<span class="slab-text" style="display: block; margin-bottom: var(--space-1);">
|
|
32
|
+
<span style="display: flex; align-items: center;">
|
|
33
|
+
With Token
|
|
34
|
+
<help-button>
|
|
35
|
+
<p><strong>With Token</strong> controls whether your function runs with or without authentication.</p>
|
|
36
|
+
<p><strong>Enabled:</strong> Function executes with your API token, providing full, authenticated access to your Sanity project.</p>
|
|
37
|
+
<p><strong>Disabled:</strong> Function executes without authentication, useful for testing public endpoints or functions that don't require user permissions.</p>
|
|
38
|
+
</help-button>
|
|
39
|
+
</span>
|
|
40
|
+
</span>
|
|
32
41
|
<toggle-switch toggle-key="withToken" style="display: flex; height: 2.5rem;"></toggle-switch>
|
|
33
42
|
</fieldset>
|
|
34
43
|
|
|
35
44
|
<fieldset class="mar-t-sm" style="margin-top: 12px !important;">
|
|
36
45
|
<label class="slab-text">
|
|
37
46
|
<span style="display: block; margin-bottom: var(--space-1);">
|
|
38
|
-
<span style="display: flex; align-items: center;">
|
|
47
|
+
<span style="display: flex; align-items: center;">
|
|
48
|
+
Document ID
|
|
49
|
+
<help-button>
|
|
50
|
+
<p>Fill out "Document ID" text field and then click the "Fetch Document" button to pre-populate the Document panel.</p>
|
|
51
|
+
<p>The Document panel is an editable text field so you can edit the fetched document or replace it with any JSON data you want.</p>
|
|
52
|
+
<p>When you click the "Run" button the contents of the Document panel will be evaluated against your filter/projection and sent to your function as the event part of the payload.</p>
|
|
53
|
+
</help-button>
|
|
54
|
+
</span>
|
|
39
55
|
</span>
|
|
40
56
|
<div style="display: flex; flex-direction: row; gap: var(--space-2);">
|
|
41
57
|
<input name="docid" id="docid" style="background: transparent; border-color: light-dark(var(--gray-200), var(--gray-700)); height: 2.5rem; color: light-dark(var(--gray-950), var(--gray-300));">
|
|
@@ -42,10 +42,9 @@ div[popover] {
|
|
|
42
42
|
</button>
|
|
43
43
|
<div popover="" id="popover-el">
|
|
44
44
|
<div style="padding: 0.75rem;">
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<div>
|
|
45
|
+
<slot>
|
|
46
|
+
</slot>
|
|
47
|
+
</div>
|
|
49
48
|
</div>
|
|
50
49
|
`
|
|
51
50
|
|
package/oclif.manifest.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"exclusive": [
|
|
30
30
|
"name",
|
|
31
31
|
"fn-type",
|
|
32
|
-
"
|
|
32
|
+
"language",
|
|
33
33
|
"javascript",
|
|
34
34
|
"fn-helpers",
|
|
35
35
|
"fn-installer"
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
],
|
|
67
67
|
"type": "option"
|
|
68
68
|
},
|
|
69
|
-
"
|
|
69
|
+
"language": {
|
|
70
70
|
"aliases": [
|
|
71
71
|
"function-language",
|
|
72
|
-
"language",
|
|
72
|
+
"fn-language",
|
|
73
73
|
"lang"
|
|
74
74
|
],
|
|
75
75
|
"description": "Language of the new Function",
|
|
76
|
-
"name": "
|
|
76
|
+
"name": "language",
|
|
77
77
|
"default": "ts",
|
|
78
78
|
"hasDynamicHelp": false,
|
|
79
79
|
"multiple": false,
|
|
@@ -88,6 +88,9 @@
|
|
|
88
88
|
"js"
|
|
89
89
|
],
|
|
90
90
|
"description": "Use JavaScript instead of TypeScript",
|
|
91
|
+
"exclusive": [
|
|
92
|
+
"language"
|
|
93
|
+
],
|
|
91
94
|
"name": "javascript",
|
|
92
95
|
"allowNo": false,
|
|
93
96
|
"type": "boolean"
|
|
@@ -904,5 +907,5 @@
|
|
|
904
907
|
]
|
|
905
908
|
}
|
|
906
909
|
},
|
|
907
|
-
"version": "10.3.
|
|
910
|
+
"version": "10.3.2"
|
|
908
911
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/runtime-cli",
|
|
3
3
|
"description": "Sanity's Runtime CLI for Blueprints and Functions",
|
|
4
|
-
"version": "10.3.
|
|
4
|
+
"version": "10.3.2",
|
|
5
5
|
"author": "Sanity Runtime Team",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"pretest": "cd test/integration && npm install",
|
|
71
71
|
"test": "vitest run",
|
|
72
72
|
"test:depmgmt": "vitest run --config ./test-depmgmt/vitest.config.ts",
|
|
73
|
+
"test:integration": "cd test/integration && npm run typecheck",
|
|
73
74
|
"posttest": "npm run lint",
|
|
74
75
|
"test:watch": "vitest",
|
|
75
76
|
"watch": "tsc --watch"
|