@sanity/runtime-cli 14.7.2 → 14.8.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 +150 -99
- package/dist/actions/blueprints/assets.d.ts +4 -3
- package/dist/actions/blueprints/assets.js +69 -101
- package/dist/actions/blueprints/blueprint.d.ts +2 -2
- package/dist/actions/blueprints/blueprint.js +1 -8
- package/dist/actions/blueprints/config.d.ts +2 -2
- package/dist/actions/blueprints/logs-streaming.d.ts +2 -2
- package/dist/actions/blueprints/logs.d.ts +2 -4
- package/dist/actions/blueprints/resources.d.ts +3 -3
- package/dist/actions/blueprints/resources.js +30 -10
- package/dist/actions/blueprints/stacks.d.ts +15 -25
- package/dist/actions/functions/dev.d.ts +1 -1
- package/dist/actions/functions/env/list.d.ts +1 -1
- package/dist/actions/functions/env/remove.d.ts +1 -1
- package/dist/actions/functions/env/update.d.ts +1 -1
- package/dist/actions/functions/logs.d.ts +3 -3
- package/dist/actions/node.d.ts +1 -1
- package/dist/actions/sanity/examples.d.ts +2 -2
- package/dist/actions/sanity/projects.d.ts +7 -13
- package/dist/baseCommands.d.ts +8 -0
- package/dist/baseCommands.js +10 -4
- package/dist/commands/blueprints/config.d.ts +1 -1
- package/dist/commands/blueprints/config.js +5 -13
- package/dist/commands/blueprints/deploy.d.ts +1 -1
- package/dist/commands/blueprints/deploy.js +2 -1
- package/dist/commands/blueprints/destroy.d.ts +1 -1
- package/dist/commands/blueprints/destroy.js +5 -7
- package/dist/commands/blueprints/doctor.js +2 -2
- package/dist/commands/blueprints/info.d.ts +1 -1
- package/dist/commands/blueprints/info.js +2 -1
- package/dist/commands/blueprints/init.js +3 -11
- package/dist/commands/blueprints/plan.d.ts +1 -1
- package/dist/commands/blueprints/plan.js +2 -1
- package/dist/commands/blueprints/promote.d.ts +0 -1
- package/dist/commands/blueprints/promote.js +2 -6
- package/dist/commands/blueprints/stacks.d.ts +1 -1
- package/dist/commands/blueprints/stacks.js +5 -13
- package/dist/commands/functions/build.d.ts +1 -1
- package/dist/commands/functions/build.js +2 -1
- package/dist/commands/functions/env/add.d.ts +1 -1
- package/dist/commands/functions/env/add.js +2 -1
- package/dist/commands/functions/env/list.d.ts +1 -1
- package/dist/commands/functions/env/list.js +2 -1
- package/dist/commands/functions/env/remove.d.ts +1 -1
- package/dist/commands/functions/env/remove.js +2 -1
- package/dist/commands/functions/logs.d.ts +0 -1
- package/dist/commands/functions/logs.js +0 -5
- package/dist/commands/functions/test.d.ts +1 -1
- package/dist/commands/functions/test.js +5 -13
- package/dist/constants.d.ts +2 -1
- package/dist/cores/blueprints/config.js +11 -7
- package/dist/cores/blueprints/deploy.js +62 -74
- package/dist/cores/blueprints/destroy.js +3 -3
- package/dist/cores/blueprints/doctor.js +5 -1
- package/dist/cores/blueprints/info.js +1 -1
- package/dist/cores/blueprints/init.d.ts +4 -3
- package/dist/cores/blueprints/plan.js +7 -1
- package/dist/cores/blueprints/promote.d.ts +0 -1
- package/dist/cores/blueprints/promote.js +4 -4
- package/dist/cores/blueprints/stacks.js +6 -2
- package/dist/cores/functions/add.d.ts +1 -0
- package/dist/cores/functions/add.js +2 -2
- package/dist/cores/functions/build.js +2 -2
- package/dist/cores/functions/env/add.js +1 -1
- package/dist/cores/functions/env/list.js +1 -1
- package/dist/cores/functions/env/remove.js +1 -1
- package/dist/cores/functions/test.js +4 -4
- package/dist/cores/index.d.ts +9 -2
- package/dist/cores/index.js +3 -2
- package/dist/server/app.d.ts +1 -1
- package/dist/server/handlers/invoke.d.ts +1 -1
- package/dist/utils/display/prompt.d.ts +2 -2
- package/dist/utils/display/prompt.js +1 -1
- package/dist/utils/display/resources-formatting.d.ts +2 -2
- package/dist/utils/display/resources-formatting.js +1 -1
- package/dist/utils/functions/fetch-document.d.ts +2 -2
- package/dist/utils/functions/prepare-asset.d.ts +3 -8
- package/dist/utils/functions/prepare-asset.js +2 -2
- package/dist/utils/functions/should-auto-resolve-deps.js +1 -1
- package/dist/utils/functions/should-transpile.js +1 -1
- package/dist/utils/invoke-local.d.ts +1 -7
- package/dist/utils/invoke-local.js +5 -24
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/logger.js +2 -0
- package/dist/utils/other/github.d.ts +1 -1
- package/dist/utils/other/npmjs.d.ts +1 -1
- package/dist/utils/traced-fetch.d.ts +1 -1
- package/dist/utils/types.d.ts +21 -80
- package/dist/utils/types.js +6 -14
- package/dist/utils/validate/resource.d.ts +0 -3
- package/dist/utils/validate/resource.js +0 -270
- package/dist/utils/validated-token.d.ts +2 -2
- package/oclif.manifest.json +36 -90
- package/package.json +2 -2
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.
|
|
23
|
+
@sanity/runtime-cli/14.8.1 linux-x64 node-v24.14.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -54,7 +54,7 @@ Add a function resource to a Blueprint
|
|
|
54
54
|
|
|
55
55
|
```
|
|
56
56
|
USAGE
|
|
57
|
-
$ sanity-run blueprints add TYPE [--example <value> | -n <value> | --fn-type
|
|
57
|
+
$ sanity-run blueprints add TYPE [--json] [--validate-resources] [--example <value> | -n <value> | --fn-type
|
|
58
58
|
document-publish|document-create|document-update|document-delete|media-library-asset-create|media-library-asset-upda
|
|
59
59
|
te|media-library-asset-delete|scheduled-function... | --language ts|js | --javascript | --fn-helpers |
|
|
60
60
|
--fn-installer skip|npm|pnpm|yarn] [-i | ]
|
|
@@ -63,20 +63,23 @@ ARGUMENTS
|
|
|
63
63
|
TYPE (function) Type of resource to add (only "function" is supported)
|
|
64
64
|
|
|
65
65
|
FLAGS
|
|
66
|
-
-i, --install
|
|
67
|
-
-n, --name=<value>
|
|
68
|
-
--example=<value>
|
|
69
|
-
|
|
70
|
-
--[no-]fn-helpers
|
|
71
|
-
--fn-installer=<option>
|
|
72
|
-
|
|
73
|
-
--fn-type=<option>...
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
--
|
|
79
|
-
|
|
66
|
+
-i, --install Shortcut for --fn-installer npm
|
|
67
|
+
-n, --name=<value> Name of the resource to add
|
|
68
|
+
--example=<value> Example to use for the function resource. Discover examples at
|
|
69
|
+
https://www.sanity.io/exchange/type=recipes/by=sanity
|
|
70
|
+
--[no-]fn-helpers Add helpers to the new function
|
|
71
|
+
--fn-installer=<option> Which package manager to use when installing the @sanity/functions helpers
|
|
72
|
+
<options: skip|npm|pnpm|yarn>
|
|
73
|
+
--fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
|
|
74
|
+
events by specifying this flag multiple times
|
|
75
|
+
<options:
|
|
76
|
+
document-publish|document-create|document-update|document-delete|media-library-asset-cr
|
|
77
|
+
eate|media-library-asset-update|media-library-asset-delete|scheduled-function>
|
|
78
|
+
--javascript Use JavaScript instead of TypeScript
|
|
79
|
+
--json Format output as json
|
|
80
|
+
--language=<option> [default: ts] Language of the new function
|
|
81
|
+
<options: ts|js>
|
|
82
|
+
--[no-]validate-resources Validate resources
|
|
80
83
|
|
|
81
84
|
DESCRIPTION
|
|
82
85
|
Add a function resource to a Blueprint
|
|
@@ -98,7 +101,7 @@ EXAMPLES
|
|
|
98
101
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
99
102
|
```
|
|
100
103
|
|
|
101
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
104
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/add.ts)_
|
|
102
105
|
|
|
103
106
|
## `sanity-run blueprints config`
|
|
104
107
|
|
|
@@ -106,12 +109,16 @@ View or edit the local Blueprint configuration
|
|
|
106
109
|
|
|
107
110
|
```
|
|
108
111
|
USAGE
|
|
109
|
-
$ sanity-run blueprints config [--project-id <value> -e] [--
|
|
112
|
+
$ sanity-run blueprints config [--json] [--validate-resources] [--project-id <value> -e] [--organization-id <value> ]
|
|
113
|
+
[--stack <value> ]
|
|
110
114
|
|
|
111
115
|
FLAGS
|
|
112
|
-
-e, --edit
|
|
113
|
-
--
|
|
114
|
-
--
|
|
116
|
+
-e, --edit Modify the configuration interactively, or directly when combined with ID flags.
|
|
117
|
+
--json Format output as json
|
|
118
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
119
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
120
|
+
--stack=<value> Stack name or ID to set in the configuration. Requires --edit flag
|
|
121
|
+
--[no-]validate-resources Validate resources
|
|
115
122
|
|
|
116
123
|
DESCRIPTION
|
|
117
124
|
View or edit the local Blueprint configuration
|
|
@@ -133,7 +140,7 @@ EXAMPLES
|
|
|
133
140
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
134
141
|
```
|
|
135
142
|
|
|
136
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
143
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/config.ts)_
|
|
137
144
|
|
|
138
145
|
## `sanity-run blueprints deploy`
|
|
139
146
|
|
|
@@ -141,11 +148,13 @@ Deploy the local Blueprint to the remote Stack
|
|
|
141
148
|
|
|
142
149
|
```
|
|
143
150
|
USAGE
|
|
144
|
-
$ sanity-run blueprints deploy [--stack <value>] [--no-wait]
|
|
151
|
+
$ sanity-run blueprints deploy [--json] [--validate-resources] [--stack <value>] [--no-wait]
|
|
145
152
|
|
|
146
153
|
FLAGS
|
|
147
|
-
--
|
|
148
|
-
--
|
|
154
|
+
--json Format output as json
|
|
155
|
+
--no-wait Do not wait for Stack deployment to complete
|
|
156
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
157
|
+
--[no-]validate-resources Validate resources
|
|
149
158
|
|
|
150
159
|
DESCRIPTION
|
|
151
160
|
Deploy the local Blueprint to the remote Stack
|
|
@@ -170,7 +179,7 @@ EXAMPLES
|
|
|
170
179
|
$ sanity-run blueprints deploy --fn-installer npm
|
|
171
180
|
```
|
|
172
181
|
|
|
173
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
182
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/deploy.ts)_
|
|
174
183
|
|
|
175
184
|
## `sanity-run blueprints destroy`
|
|
176
185
|
|
|
@@ -178,13 +187,17 @@ Destroy the remote Stack deployment and its resources (will not delete local fil
|
|
|
178
187
|
|
|
179
188
|
```
|
|
180
189
|
USAGE
|
|
181
|
-
$ sanity-run blueprints destroy [--project-id <value> --stack <value> --force]
|
|
190
|
+
$ sanity-run blueprints destroy [--json] [--validate-resources] [--project-id <value> --stack <value> --force]
|
|
191
|
+
[--organization-id <value> ] [--no-wait]
|
|
182
192
|
|
|
183
193
|
FLAGS
|
|
184
|
-
--force
|
|
185
|
-
--
|
|
186
|
-
--
|
|
187
|
-
--
|
|
194
|
+
--force Force Stack destruction (skip confirmation)
|
|
195
|
+
--json Format output as json
|
|
196
|
+
--no-wait Do not wait for Stack destruction to complete
|
|
197
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
198
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
199
|
+
--stack=<value> Stack name or ID to destroy (defaults to the locally configured Stack)
|
|
200
|
+
--[no-]validate-resources Validate resources
|
|
188
201
|
|
|
189
202
|
DESCRIPTION
|
|
190
203
|
Destroy the remote Stack deployment and its resources (will not delete local files)
|
|
@@ -202,7 +215,7 @@ EXAMPLES
|
|
|
202
215
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
203
216
|
```
|
|
204
217
|
|
|
205
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
218
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/destroy.ts)_
|
|
206
219
|
|
|
207
220
|
## `sanity-run blueprints doctor`
|
|
208
221
|
|
|
@@ -210,13 +223,14 @@ Diagnose potential issues with local Blueprint and remote Stack configuration
|
|
|
210
223
|
|
|
211
224
|
```
|
|
212
225
|
USAGE
|
|
213
|
-
$ sanity-run blueprints doctor [--json] [-p <value>] [--verbose] [--fix]
|
|
226
|
+
$ sanity-run blueprints doctor [--json] [-p <value>] [--validate-resources] [--verbose] [--fix]
|
|
214
227
|
|
|
215
228
|
FLAGS
|
|
216
|
-
-p, --path=<value>
|
|
217
|
-
--fix
|
|
218
|
-
--json
|
|
219
|
-
--[no-]
|
|
229
|
+
-p, --path=<value> [env: SANITY_BLUEPRINT_PATH] Path to a Blueprint file or directory containing one
|
|
230
|
+
--fix Interactively fix configuration issues
|
|
231
|
+
--json Format output as json
|
|
232
|
+
--[no-]validate-resources Validate resources
|
|
233
|
+
--[no-]verbose Verbose output; defaults to true
|
|
220
234
|
|
|
221
235
|
DESCRIPTION
|
|
222
236
|
Diagnose potential issues with local Blueprint and remote Stack configuration
|
|
@@ -228,7 +242,7 @@ DESCRIPTION
|
|
|
228
242
|
issues.
|
|
229
243
|
```
|
|
230
244
|
|
|
231
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
245
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/doctor.ts)_
|
|
232
246
|
|
|
233
247
|
## `sanity-run blueprints info`
|
|
234
248
|
|
|
@@ -236,10 +250,12 @@ Show information about the local Blueprint's remote Stack deployment
|
|
|
236
250
|
|
|
237
251
|
```
|
|
238
252
|
USAGE
|
|
239
|
-
$ sanity-run blueprints info [--stack <value>]
|
|
253
|
+
$ sanity-run blueprints info [--json] [--validate-resources] [--stack <value>]
|
|
240
254
|
|
|
241
255
|
FLAGS
|
|
242
|
-
--
|
|
256
|
+
--json Format output as json
|
|
257
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
258
|
+
--[no-]validate-resources Validate resources
|
|
243
259
|
|
|
244
260
|
DESCRIPTION
|
|
245
261
|
Show information about the local Blueprint's remote Stack deployment
|
|
@@ -258,7 +274,7 @@ EXAMPLES
|
|
|
258
274
|
$ sanity-run blueprints info --stack <name-or-id>
|
|
259
275
|
```
|
|
260
276
|
|
|
261
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
277
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/info.ts)_
|
|
262
278
|
|
|
263
279
|
## `sanity-run blueprints init [DIR]`
|
|
264
280
|
|
|
@@ -266,8 +282,9 @@ Initialize a local Blueprint and optionally provision a remote Stack deployment
|
|
|
266
282
|
|
|
267
283
|
```
|
|
268
284
|
USAGE
|
|
269
|
-
$ sanity-run blueprints init [DIR] [--verbose] [--dir <value>] [--example <value> |
|
|
270
|
-
--stack-id <value> | --stack-name <value>] [--project-id <value>]
|
|
285
|
+
$ sanity-run blueprints init [DIR] [--json] [--validate-resources] [--verbose] [--dir <value>] [--example <value> |
|
|
286
|
+
--blueprint-type json|js|ts | --stack-id <value> | --stack-name <value>] [--project-id <value>] [--organization-id
|
|
287
|
+
<value>]
|
|
271
288
|
|
|
272
289
|
ARGUMENTS
|
|
273
290
|
[DIR] Directory to create the local Blueprint in
|
|
@@ -277,9 +294,12 @@ FLAGS
|
|
|
277
294
|
<options: json|js|ts>
|
|
278
295
|
--dir=<value> Directory to create the local Blueprint in
|
|
279
296
|
--example=<value> Example to use for the local Blueprint
|
|
280
|
-
--
|
|
297
|
+
--json Format output as json
|
|
298
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
299
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
281
300
|
--stack-id=<value> Existing Stack ID used to scope local Blueprint
|
|
282
301
|
--stack-name=<value> Name to use for a new Stack provisioned during initialization
|
|
302
|
+
--[no-]validate-resources Validate resources
|
|
283
303
|
--verbose Verbose output
|
|
284
304
|
|
|
285
305
|
DESCRIPTION
|
|
@@ -308,7 +328,7 @@ EXAMPLES
|
|
|
308
328
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
309
329
|
```
|
|
310
330
|
|
|
311
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
331
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/init.ts)_
|
|
312
332
|
|
|
313
333
|
## `sanity-run blueprints logs`
|
|
314
334
|
|
|
@@ -316,11 +336,13 @@ Display logs for the current Blueprint's Stack deployment
|
|
|
316
336
|
|
|
317
337
|
```
|
|
318
338
|
USAGE
|
|
319
|
-
$ sanity-run blueprints logs [--stack <value>] [-w]
|
|
339
|
+
$ sanity-run blueprints logs [--json] [--validate-resources] [--stack <value>] [-w]
|
|
320
340
|
|
|
321
341
|
FLAGS
|
|
322
|
-
-w, --watch
|
|
323
|
-
--
|
|
342
|
+
-w, --watch Watch for new Stack logs (streaming mode)
|
|
343
|
+
--json Format output as json
|
|
344
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
345
|
+
--[no-]validate-resources Validate resources
|
|
324
346
|
|
|
325
347
|
DESCRIPTION
|
|
326
348
|
Display logs for the current Blueprint's Stack deployment
|
|
@@ -337,7 +359,7 @@ EXAMPLES
|
|
|
337
359
|
$ sanity-run blueprints logs --watch
|
|
338
360
|
```
|
|
339
361
|
|
|
340
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
362
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/logs.ts)_
|
|
341
363
|
|
|
342
364
|
## `sanity-run blueprints plan`
|
|
343
365
|
|
|
@@ -345,10 +367,12 @@ Enumerate resources to be deployed to the remote Stack - will not modify any res
|
|
|
345
367
|
|
|
346
368
|
```
|
|
347
369
|
USAGE
|
|
348
|
-
$ sanity-run blueprints plan [--stack <value>]
|
|
370
|
+
$ sanity-run blueprints plan [--json] [--validate-resources] [--stack <value>]
|
|
349
371
|
|
|
350
372
|
FLAGS
|
|
351
|
-
--
|
|
373
|
+
--json Format output as json
|
|
374
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
375
|
+
--[no-]validate-resources Validate resources
|
|
352
376
|
|
|
353
377
|
DESCRIPTION
|
|
354
378
|
Enumerate resources to be deployed to the remote Stack - will not modify any resources
|
|
@@ -363,7 +387,7 @@ EXAMPLES
|
|
|
363
387
|
$ sanity-run blueprints plan
|
|
364
388
|
```
|
|
365
389
|
|
|
366
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
390
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/plan.ts)_
|
|
367
391
|
|
|
368
392
|
## `sanity-run blueprints stacks`
|
|
369
393
|
|
|
@@ -371,10 +395,13 @@ List all remote Stack deployments (defaults to the current Blueprint's project s
|
|
|
371
395
|
|
|
372
396
|
```
|
|
373
397
|
USAGE
|
|
374
|
-
$ sanity-run blueprints stacks [--project-id <value> | ]
|
|
398
|
+
$ sanity-run blueprints stacks [--json] [--validate-resources] [--project-id <value> | --organization-id <value>]
|
|
375
399
|
|
|
376
400
|
FLAGS
|
|
377
|
-
--
|
|
401
|
+
--json Format output as json
|
|
402
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
403
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
404
|
+
--[no-]validate-resources Validate resources
|
|
378
405
|
|
|
379
406
|
DESCRIPTION
|
|
380
407
|
List all remote Stack deployments (defaults to the current Blueprint's project scope)
|
|
@@ -392,7 +419,7 @@ EXAMPLES
|
|
|
392
419
|
$ sanity-run blueprints stacks --organization-id <organizationId>
|
|
393
420
|
```
|
|
394
421
|
|
|
395
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
422
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/blueprints/stacks.ts)_
|
|
396
423
|
|
|
397
424
|
## `sanity-run functions add`
|
|
398
425
|
|
|
@@ -400,24 +427,28 @@ Add a Function to your Blueprint
|
|
|
400
427
|
|
|
401
428
|
```
|
|
402
429
|
USAGE
|
|
403
|
-
$ sanity-run functions add [--example <value> | -n <value> | | --language ts|js
|
|
404
|
-
document-publish|document-create|document-update|document-delete|media-library-asset-
|
|
405
|
-
|
|
430
|
+
$ sanity-run functions add [--json] [--validate-resources] [--example <value> | -n <value> | | --language ts|js
|
|
431
|
+
| --javascript | | ] [--type document-publish|document-create|document-update|document-delete|media-library-asset-c
|
|
432
|
+
reate|media-library-asset-update|media-library-asset-delete|scheduled-function... ] [--helpers] [--installer
|
|
433
|
+
skip|npm|pnpm|yarn] [-i | ]
|
|
406
434
|
|
|
407
435
|
FLAGS
|
|
408
|
-
-i, --install
|
|
409
|
-
-n, --name=<value>
|
|
410
|
-
--example=<value>
|
|
411
|
-
--[no-]helpers
|
|
412
|
-
--installer=<option>
|
|
413
|
-
|
|
414
|
-
--javascript
|
|
415
|
-
--
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
436
|
+
-i, --install Shortcut for --fn-installer npm
|
|
437
|
+
-n, --name=<value> Name of the Function to add
|
|
438
|
+
--example=<value> Example to use for the Function
|
|
439
|
+
--[no-]helpers Add helpers to the new Function
|
|
440
|
+
--installer=<option> How to install the @sanity/functions helpers
|
|
441
|
+
<options: skip|npm|pnpm|yarn>
|
|
442
|
+
--javascript Use JavaScript instead of TypeScript
|
|
443
|
+
--json Format output as json
|
|
444
|
+
--language=<option> [default: ts] Language of the new Function
|
|
445
|
+
<options: ts|js>
|
|
446
|
+
--type=<option>... Document change event(s) that should trigger the function; you can specify multiple
|
|
447
|
+
events by specifying this flag multiple times
|
|
448
|
+
<options:
|
|
449
|
+
document-publish|document-create|document-update|document-delete|media-library-asset-cr
|
|
450
|
+
eate|media-library-asset-update|media-library-asset-delete|scheduled-function>
|
|
451
|
+
--[no-]validate-resources Validate resources
|
|
421
452
|
|
|
422
453
|
DESCRIPTION
|
|
423
454
|
Add a Function to your Blueprint
|
|
@@ -441,7 +472,7 @@ EXAMPLES
|
|
|
441
472
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
442
473
|
```
|
|
443
474
|
|
|
444
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
475
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/add.ts)_
|
|
445
476
|
|
|
446
477
|
## `sanity-run functions dev`
|
|
447
478
|
|
|
@@ -449,13 +480,15 @@ Start the Sanity Function emulator
|
|
|
449
480
|
|
|
450
481
|
```
|
|
451
482
|
USAGE
|
|
452
|
-
$ sanity-run functions dev [-h <value>] [-p <value>] [-t <value>]
|
|
483
|
+
$ sanity-run functions dev [--json] [--validate-resources] [-h <value>] [-p <value>] [-t <value>]
|
|
453
484
|
|
|
454
485
|
FLAGS
|
|
455
|
-
-h, --host=<value>
|
|
456
|
-
-p, --port=<value>
|
|
457
|
-
-t, --timeout=<value>
|
|
458
|
-
|
|
486
|
+
-h, --host=<value> The local network interface at which to listen. [default: "localhost"]
|
|
487
|
+
-p, --port=<value> TCP port to start emulator on. [default: 8080]
|
|
488
|
+
-t, --timeout=<value> Maximum execution time for all functions, in seconds. Takes precedence over
|
|
489
|
+
function-specific `timeout`
|
|
490
|
+
--json Format output as json
|
|
491
|
+
--[no-]validate-resources Validate resources
|
|
459
492
|
|
|
460
493
|
DESCRIPTION
|
|
461
494
|
Start the Sanity Function emulator
|
|
@@ -475,7 +508,7 @@ EXAMPLES
|
|
|
475
508
|
$ sanity-run functions dev --timeout 60
|
|
476
509
|
```
|
|
477
510
|
|
|
478
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
511
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/dev.ts)_
|
|
479
512
|
|
|
480
513
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
481
514
|
|
|
@@ -483,13 +516,17 @@ Add or set an environment variable for a deployed function
|
|
|
483
516
|
|
|
484
517
|
```
|
|
485
518
|
USAGE
|
|
486
|
-
$ sanity-run functions env add NAME KEY VALUE
|
|
519
|
+
$ sanity-run functions env add NAME KEY VALUE [--json] [--validate-resources]
|
|
487
520
|
|
|
488
521
|
ARGUMENTS
|
|
489
522
|
NAME The name of the Sanity Function
|
|
490
523
|
KEY The name of the environment variable
|
|
491
524
|
VALUE The value of the environment variable
|
|
492
525
|
|
|
526
|
+
FLAGS
|
|
527
|
+
--json Format output as json
|
|
528
|
+
--[no-]validate-resources Validate resources
|
|
529
|
+
|
|
493
530
|
DESCRIPTION
|
|
494
531
|
Add or set an environment variable for a deployed function
|
|
495
532
|
|
|
@@ -502,7 +539,7 @@ EXAMPLES
|
|
|
502
539
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
503
540
|
```
|
|
504
541
|
|
|
505
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
542
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/env/add.ts)_
|
|
506
543
|
|
|
507
544
|
## `sanity-run functions env list NAME`
|
|
508
545
|
|
|
@@ -510,11 +547,15 @@ List environment variables for a deployed function
|
|
|
510
547
|
|
|
511
548
|
```
|
|
512
549
|
USAGE
|
|
513
|
-
$ sanity-run functions env list NAME
|
|
550
|
+
$ sanity-run functions env list NAME [--json] [--validate-resources]
|
|
514
551
|
|
|
515
552
|
ARGUMENTS
|
|
516
553
|
NAME The name of the Sanity Function
|
|
517
554
|
|
|
555
|
+
FLAGS
|
|
556
|
+
--json Format output as json
|
|
557
|
+
--[no-]validate-resources Validate resources
|
|
558
|
+
|
|
518
559
|
DESCRIPTION
|
|
519
560
|
List environment variables for a deployed function
|
|
520
561
|
|
|
@@ -526,7 +567,7 @@ EXAMPLES
|
|
|
526
567
|
$ sanity-run functions env list MyFunction
|
|
527
568
|
```
|
|
528
569
|
|
|
529
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
570
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/env/list.ts)_
|
|
530
571
|
|
|
531
572
|
## `sanity-run functions env remove NAME KEY`
|
|
532
573
|
|
|
@@ -534,12 +575,16 @@ Remove an environment variable from a deployed function
|
|
|
534
575
|
|
|
535
576
|
```
|
|
536
577
|
USAGE
|
|
537
|
-
$ sanity-run functions env remove NAME KEY
|
|
578
|
+
$ sanity-run functions env remove NAME KEY [--json] [--validate-resources]
|
|
538
579
|
|
|
539
580
|
ARGUMENTS
|
|
540
581
|
NAME The name of the Sanity Function
|
|
541
582
|
KEY The name of the environment variable
|
|
542
583
|
|
|
584
|
+
FLAGS
|
|
585
|
+
--json Format output as json
|
|
586
|
+
--[no-]validate-resources Validate resources
|
|
587
|
+
|
|
543
588
|
DESCRIPTION
|
|
544
589
|
Remove an environment variable from a deployed function
|
|
545
590
|
|
|
@@ -552,7 +597,7 @@ EXAMPLES
|
|
|
552
597
|
$ sanity-run functions env remove MyFunction API_URL
|
|
553
598
|
```
|
|
554
599
|
|
|
555
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
600
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/env/remove.ts)_
|
|
556
601
|
|
|
557
602
|
## `sanity-run functions logs [NAME]`
|
|
558
603
|
|
|
@@ -560,19 +605,21 @@ Retrieve or delete logs for a Sanity Function
|
|
|
560
605
|
|
|
561
606
|
```
|
|
562
607
|
USAGE
|
|
563
|
-
$ sanity-run functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> |
|
|
608
|
+
$ sanity-run functions logs [NAME] [--validate-resources] [--stack <value>] [-u] [-f [-d | -l <value> | --json]]
|
|
609
|
+
[-w]
|
|
564
610
|
|
|
565
611
|
ARGUMENTS
|
|
566
612
|
[NAME] The name of the Sanity Function
|
|
567
613
|
|
|
568
614
|
FLAGS
|
|
569
|
-
-d, --delete
|
|
570
|
-
-f, --force
|
|
571
|
-
-
|
|
572
|
-
-
|
|
573
|
-
-
|
|
574
|
-
|
|
575
|
-
--stack=<value>
|
|
615
|
+
-d, --delete Delete all logs for the function
|
|
616
|
+
-f, --force Skip confirmation for deleting logs
|
|
617
|
+
-l, --limit=<value> [default: 50] Total number of log entries to retrieve
|
|
618
|
+
-u, --utc Show dates in UTC time zone
|
|
619
|
+
-w, --watch Watch for new logs (streaming mode)
|
|
620
|
+
--json Format output as json
|
|
621
|
+
--stack=<value> Stack name or ID to use instead of the locally configured Stack
|
|
622
|
+
--[no-]validate-resources Validate resources
|
|
576
623
|
|
|
577
624
|
DESCRIPTION
|
|
578
625
|
Retrieve or delete logs for a Sanity Function
|
|
@@ -592,7 +639,7 @@ EXAMPLES
|
|
|
592
639
|
$ sanity-run functions logs <name> --delete
|
|
593
640
|
```
|
|
594
641
|
|
|
595
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
642
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/logs.ts)_
|
|
596
643
|
|
|
597
644
|
## `sanity-run functions test [NAME]`
|
|
598
645
|
|
|
@@ -600,10 +647,11 @@ Invoke a local Sanity Function
|
|
|
600
647
|
|
|
601
648
|
```
|
|
602
649
|
USAGE
|
|
603
|
-
$ sanity-run functions test [NAME] [--data-before <value> | [-d <value> | -f
|
|
604
|
-
| --
|
|
605
|
-
[--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>]
|
|
606
|
-
[--
|
|
650
|
+
$ sanity-run functions test [NAME] [--json] [--validate-resources] [--data-before <value> | [-d <value> | -f
|
|
651
|
+
<value> | --document-id <value>] | | | --file-before <value> | --file-after <value> | --document-id-before <value>
|
|
652
|
+
| --document-id-after <value>] [--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>]
|
|
653
|
+
[-a <value>] [--organization-id <value>] [--with-user-token] [--media-library-id <value> | --project-id <value> |
|
|
654
|
+
--dataset <value>]
|
|
607
655
|
|
|
608
656
|
ARGUMENTS
|
|
609
657
|
[NAME] The name of the Sanity Function
|
|
@@ -623,8 +671,11 @@ FLAGS
|
|
|
623
671
|
--document-id-before=<value> Original document
|
|
624
672
|
--file-after=<value> Current document
|
|
625
673
|
--file-before=<value> Original document
|
|
674
|
+
--json Format output as json
|
|
626
675
|
--media-library-id=<value> Sanity Media Library ID to use
|
|
627
|
-
--
|
|
676
|
+
--organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
|
|
677
|
+
--project-id=<value> Sanity project ID used to scope Blueprint and Stack
|
|
678
|
+
--[no-]validate-resources Validate resources
|
|
628
679
|
--with-user-token Prime access token from CLI config
|
|
629
680
|
|
|
630
681
|
DESCRIPTION
|
|
@@ -646,7 +697,7 @@ EXAMPLES
|
|
|
646
697
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
647
698
|
```
|
|
648
699
|
|
|
649
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.
|
|
700
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.1/src/commands/functions/test.ts)_
|
|
650
701
|
|
|
651
702
|
## `sanity-run help [COMMAND]`
|
|
652
703
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { Resource } from '@sanity/blueprints-parser';
|
|
1
2
|
import AdmZip from 'adm-zip';
|
|
2
3
|
import type { Logger } from '../../utils/logger.js';
|
|
3
|
-
import type { AuthParams,
|
|
4
|
+
import type { AuthParams, InstallerType } from '../../utils/types.js';
|
|
4
5
|
export declare const ASSET_CHECK_URL: string;
|
|
5
6
|
export declare const ASSET_STASH_URL: string;
|
|
6
7
|
export declare function stashAsset({ resource, auth, logger, installer, }: {
|
|
7
|
-
resource:
|
|
8
|
+
resource: Resource;
|
|
8
9
|
auth: AuthParams;
|
|
9
|
-
logger:
|
|
10
|
+
logger: Logger;
|
|
10
11
|
installer?: InstallerType;
|
|
11
12
|
}): Promise<{
|
|
12
13
|
success: boolean;
|