@sanity/cli 8.37.1 → 8.37.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 +27 -26
- package/oclif.manifest.json +2027 -2027
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -477,7 +477,7 @@ FLAGS
|
|
|
477
477
|
--fn-installer=<option> Which package manager to use when installing the @sanity/functions helpers
|
|
478
478
|
<options: skip|npm|pnpm|yarn>
|
|
479
479
|
--fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
|
|
480
|
-
events by specifying this flag multiple times
|
|
480
|
+
events by specifying this flag multiple times.
|
|
481
481
|
<options: document-publish|document-create|document-delete|document-update|media-library-
|
|
482
482
|
asset-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-func
|
|
483
483
|
tion|sync-tag-invalidate|durable-function>
|
|
@@ -3783,35 +3783,36 @@ Add a Function to your Blueprint
|
|
|
3783
3783
|
|
|
3784
3784
|
```
|
|
3785
3785
|
USAGE
|
|
3786
|
-
$ sanity functions add [--json] [--example <value> | -n <value> | --
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
FLAGS
|
|
3792
|
-
-i, --install
|
|
3793
|
-
-n, --name=<value>
|
|
3794
|
-
--
|
|
3795
|
-
|
|
3796
|
-
--
|
|
3797
|
-
|
|
3798
|
-
--
|
|
3799
|
-
|
|
3800
|
-
--
|
|
3801
|
-
|
|
3802
|
-
--
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3786
|
+
$ sanity functions add [--json] [--example <value> | -n <value> | --trigger
|
|
3787
|
+
pub-sub|document-create|document-publish|document-update|document-delete|media-library-asset-create|media-library-as
|
|
3788
|
+
set-update|media-library-asset-delete|sync-tag-invalidate|scheduled-function... | --durable | --language ts|js |
|
|
3789
|
+
--javascript | --helpers | --installer skip|npm|pnpm|yarn | -i]
|
|
3790
|
+
|
|
3791
|
+
FLAGS
|
|
3792
|
+
-i, --install Shortcut for --installer npm
|
|
3793
|
+
-n, --name=<value> Name of the Function to add
|
|
3794
|
+
--durable Creates a durable function. See why you might want to use a durable function at
|
|
3795
|
+
https://www.sanity.io/docs/functions/durable-functions
|
|
3796
|
+
--example=<value> Example to use for the Function
|
|
3797
|
+
--[no-]helpers Add helpers to the new Function
|
|
3798
|
+
--installer=<option> How to install the @sanity/functions helpers
|
|
3799
|
+
<options: skip|npm|pnpm|yarn>
|
|
3800
|
+
--javascript Use JavaScript instead of TypeScript
|
|
3801
|
+
--json Format output as json
|
|
3802
|
+
--language=<option> [default: ts] Language of the new Function
|
|
3803
|
+
<options: ts|js>
|
|
3804
|
+
--trigger=<option>... Event that can trigger a Function
|
|
3805
|
+
<options: pub-sub|document-create|document-publish|document-update|document-delete|media-li
|
|
3806
|
+
brary-asset-create|media-library-asset-update|media-library-asset-delete|sync-tag-invalidat
|
|
3807
|
+
e|scheduled-function>
|
|
3807
3808
|
|
|
3808
3809
|
DESCRIPTION
|
|
3809
3810
|
Add a Function to your Blueprint
|
|
3810
3811
|
|
|
3811
3812
|
Scaffolds a new Function in the functions/ folder and templates a resource for your Blueprint manifest.
|
|
3812
3813
|
|
|
3813
|
-
Functions are serverless handlers triggered by document, live content or media-library events (create,
|
|
3814
|
-
publish).
|
|
3814
|
+
Functions are serverless handlers triggered by document, live content, schedules or media-library events (create,
|
|
3815
|
+
update, delete, publish) or by invoking them directly.
|
|
3815
3816
|
|
|
3816
3817
|
After adding, use 'functions dev' to test locally, then 'blueprints deploy' to publish.
|
|
3817
3818
|
|
|
@@ -3822,9 +3823,9 @@ EXAMPLES
|
|
|
3822
3823
|
|
|
3823
3824
|
$ sanity functions add --name my-function
|
|
3824
3825
|
|
|
3825
|
-
$ sanity functions add --name my-function --
|
|
3826
|
+
$ sanity functions add --name my-function --trigger document-create
|
|
3826
3827
|
|
|
3827
|
-
$ sanity functions add --name my-function --
|
|
3828
|
+
$ sanity functions add --name my-function --trigger document-create --durable --lang js
|
|
3828
3829
|
```
|
|
3829
3830
|
|
|
3830
3831
|
## `sanity functions dev`
|