@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.
Files changed (3) hide show
  1. package/README.md +27 -26
  2. package/oclif.manifest.json +2027 -2027
  3. 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> | --type
3787
- document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
3788
- te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate|durable-function... | --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
- --example=<value> Example to use for the Function
3795
- --[no-]helpers Add helpers to the new Function
3796
- --installer=<option> How to install the @sanity/functions helpers
3797
- <options: skip|npm|pnpm|yarn>
3798
- --javascript Use JavaScript instead of TypeScript
3799
- --json Format output as json
3800
- --language=<option> [default: ts] Language of the new Function
3801
- <options: ts|js>
3802
- --type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
3803
- by specifying this flag multiple times
3804
- <options: document-publish|document-create|document-delete|document-update|media-library-ass
3805
- et-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-function|s
3806
- ync-tag-invalidate|durable-function>
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, update, delete,
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 --type document-create
3826
+ $ sanity functions add --name my-function --trigger document-create
3826
3827
 
3827
- $ sanity functions add --name my-function --type document-create --type document-update --lang js
3828
+ $ sanity functions add --name my-function --trigger document-create --durable --lang js
3828
3829
  ```
3829
3830
 
3830
3831
  ## `sanity functions dev`