@sanity/runtime-cli 10.7.1 → 10.8.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/types.d.ts +4 -0
- package/dist/utils/validate/resource.js +16 -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.
|
|
23
|
+
@sanity/runtime-cli/10.8.0 linux-x64 node-v22.19.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -88,7 +88,7 @@ EXAMPLES
|
|
|
88
88
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
91
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/add.ts)_
|
|
92
92
|
|
|
93
93
|
## `sanity-run blueprints config`
|
|
94
94
|
|
|
@@ -119,7 +119,7 @@ EXAMPLES
|
|
|
119
119
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack-id <stackId>
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
122
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/config.ts)_
|
|
123
123
|
|
|
124
124
|
## `sanity-run blueprints deploy`
|
|
125
125
|
|
|
@@ -141,7 +141,7 @@ EXAMPLES
|
|
|
141
141
|
$ sanity-run blueprints deploy --no-wait
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
144
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/deploy.ts)_
|
|
145
145
|
|
|
146
146
|
## `sanity-run blueprints destroy`
|
|
147
147
|
|
|
@@ -166,7 +166,7 @@ EXAMPLES
|
|
|
166
166
|
$ sanity-run blueprints destroy --stack-id <stackId> --project-id <projectId> --force --no-wait
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
169
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/destroy.ts)_
|
|
170
170
|
|
|
171
171
|
## `sanity-run blueprints info`
|
|
172
172
|
|
|
@@ -188,7 +188,7 @@ EXAMPLES
|
|
|
188
188
|
$ sanity-run blueprints info --stack-id <stackId>
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
191
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/info.ts)_
|
|
192
192
|
|
|
193
193
|
## `sanity-run blueprints init [DIR]`
|
|
194
194
|
|
|
@@ -226,7 +226,7 @@ EXAMPLES
|
|
|
226
226
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
229
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/init.ts)_
|
|
230
230
|
|
|
231
231
|
## `sanity-run blueprints logs`
|
|
232
232
|
|
|
@@ -248,7 +248,7 @@ EXAMPLES
|
|
|
248
248
|
$ sanity-run blueprints logs --watch
|
|
249
249
|
```
|
|
250
250
|
|
|
251
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
251
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/logs.ts)_
|
|
252
252
|
|
|
253
253
|
## `sanity-run blueprints plan`
|
|
254
254
|
|
|
@@ -265,7 +265,7 @@ EXAMPLES
|
|
|
265
265
|
$ sanity-run blueprints plan
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
268
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/plan.ts)_
|
|
269
269
|
|
|
270
270
|
## `sanity-run blueprints stacks`
|
|
271
271
|
|
|
@@ -287,7 +287,7 @@ EXAMPLES
|
|
|
287
287
|
$ sanity-run blueprints stacks --project-id <projectId>
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
290
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/blueprints/stacks.ts)_
|
|
291
291
|
|
|
292
292
|
## `sanity-run functions dev`
|
|
293
293
|
|
|
@@ -307,7 +307,7 @@ EXAMPLES
|
|
|
307
307
|
$ sanity-run functions dev --port 8974
|
|
308
308
|
```
|
|
309
309
|
|
|
310
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
310
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/functions/dev.ts)_
|
|
311
311
|
|
|
312
312
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
313
313
|
|
|
@@ -329,7 +329,7 @@ EXAMPLES
|
|
|
329
329
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
332
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/functions/env/add.ts)_
|
|
333
333
|
|
|
334
334
|
## `sanity-run functions env list NAME`
|
|
335
335
|
|
|
@@ -349,7 +349,7 @@ EXAMPLES
|
|
|
349
349
|
$ sanity-run functions env list MyFunction
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
352
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/functions/env/list.ts)_
|
|
353
353
|
|
|
354
354
|
## `sanity-run functions env remove NAME KEY`
|
|
355
355
|
|
|
@@ -370,7 +370,7 @@ EXAMPLES
|
|
|
370
370
|
$ sanity-run functions env remove MyFunction API_URL
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
373
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/functions/env/remove.ts)_
|
|
374
374
|
|
|
375
375
|
## `sanity-run functions logs NAME`
|
|
376
376
|
|
|
@@ -404,7 +404,7 @@ EXAMPLES
|
|
|
404
404
|
$ sanity-run functions logs <name> --delete
|
|
405
405
|
```
|
|
406
406
|
|
|
407
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
407
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/functions/logs.ts)_
|
|
408
408
|
|
|
409
409
|
## `sanity-run functions test NAME`
|
|
410
410
|
|
|
@@ -451,7 +451,7 @@ EXAMPLES
|
|
|
451
451
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
452
452
|
```
|
|
453
453
|
|
|
454
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.
|
|
454
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.8.0/src/commands/functions/test.ts)_
|
|
455
455
|
|
|
456
456
|
## `sanity-run help [COMMAND]`
|
|
457
457
|
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -57,6 +57,22 @@ export function validateFunctionResource(resource) {
|
|
|
57
57
|
type: BlueprintParserErrorType.InvalidType,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
+
if (resource.event?.resource) {
|
|
61
|
+
if (!resource.event.resource.type || resource.event.resource.type !== 'dataset') {
|
|
62
|
+
errors.push({
|
|
63
|
+
message: `${msgPrefix} event.resource.type must be "dataset"`,
|
|
64
|
+
type: BlueprintParserErrorType.InvalidType,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Ensure exactly one period is passed into the ID to conform to the format <projectId>.<datasetName>
|
|
68
|
+
if (!resource.event.resource.id || resource.event.resource.id.split('.').length !== 2) {
|
|
69
|
+
errors.push({
|
|
70
|
+
message: `${msgPrefix} event.resource.id must be of the form <projectId>.<datasetName>. <datasetName> can be "*" to signify "all datasets in project with ID <projectId>."`,
|
|
71
|
+
type: BlueprintParserErrorType.InvalidFormat,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// TODO: validate the project ID and dataset names exist by making an API call?
|
|
75
|
+
}
|
|
60
76
|
if (resource.memory !== undefined) {
|
|
61
77
|
if (!Number.isInteger(resource.memory)) {
|
|
62
78
|
errors.push({
|
package/oclif.manifest.json
CHANGED