@sanity/cli 6.2.1 → 6.3.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.
Files changed (83) hide show
  1. package/README.md +107 -116
  2. package/dist/SanityHelp.js +38 -0
  3. package/dist/SanityHelp.js.map +1 -1
  4. package/dist/actions/auth/login/getProvider.js +9 -4
  5. package/dist/actions/auth/login/getProvider.js.map +1 -1
  6. package/dist/actions/auth/login/getSSOProvider.js +21 -2
  7. package/dist/actions/auth/login/getSSOProvider.js.map +1 -1
  8. package/dist/actions/auth/login/login.js +5 -4
  9. package/dist/actions/auth/login/login.js.map +1 -1
  10. package/dist/actions/build/buildApp.js +1 -0
  11. package/dist/actions/build/buildApp.js.map +1 -1
  12. package/dist/actions/build/buildStaticFiles.js +2 -1
  13. package/dist/actions/build/buildStaticFiles.js.map +1 -1
  14. package/dist/actions/build/renderDocument.js.map +1 -1
  15. package/dist/actions/build/renderDocumentWorker/components/BasicDocument.js +2 -2
  16. package/dist/actions/build/renderDocumentWorker/components/BasicDocument.js.map +1 -1
  17. package/dist/actions/build/renderDocumentWorker/types.js.map +1 -1
  18. package/dist/actions/build/writeSanityRuntime.js +3 -2
  19. package/dist/actions/build/writeSanityRuntime.js.map +1 -1
  20. package/dist/actions/deploy/deployStudio.js +53 -3
  21. package/dist/actions/deploy/deployStudio.js.map +1 -1
  22. package/dist/actions/deploy/findUserApplicationForStudio.js +10 -4
  23. package/dist/actions/deploy/findUserApplicationForStudio.js.map +1 -1
  24. package/dist/actions/dev/startAppDevServer.js +2 -0
  25. package/dist/actions/dev/startAppDevServer.js.map +1 -1
  26. package/dist/actions/init/git.js +5 -2
  27. package/dist/actions/init/git.js.map +1 -1
  28. package/dist/actions/init/remoteTemplate.js +3 -1
  29. package/dist/actions/init/remoteTemplate.js.map +1 -1
  30. package/dist/actions/init/templates/nextjs/index.js +1 -1
  31. package/dist/actions/init/templates/nextjs/index.js.map +1 -1
  32. package/dist/actions/manifest/extractAppManifest.js +3 -1
  33. package/dist/actions/manifest/extractAppManifest.js.map +1 -1
  34. package/dist/actions/telemetry/setConsent.js +6 -2
  35. package/dist/actions/telemetry/setConsent.js.map +1 -1
  36. package/dist/commands/datasets/alias/create.js +0 -4
  37. package/dist/commands/datasets/alias/create.js.map +1 -1
  38. package/dist/commands/datasets/alias/delete.js +1 -5
  39. package/dist/commands/datasets/alias/delete.js.map +1 -1
  40. package/dist/commands/datasets/alias/link.js +0 -4
  41. package/dist/commands/datasets/alias/link.js.map +1 -1
  42. package/dist/commands/datasets/alias/unlink.js +0 -4
  43. package/dist/commands/datasets/alias/unlink.js.map +1 -1
  44. package/dist/commands/datasets/copy.js +1 -1
  45. package/dist/commands/datasets/copy.js.map +1 -1
  46. package/dist/commands/datasets/import.js +34 -5
  47. package/dist/commands/datasets/import.js.map +1 -1
  48. package/dist/commands/deploy.js +3 -0
  49. package/dist/commands/deploy.js.map +1 -1
  50. package/dist/commands/init.js +10 -9
  51. package/dist/commands/init.js.map +1 -1
  52. package/dist/commands/login.js +14 -2
  53. package/dist/commands/login.js.map +1 -1
  54. package/dist/commands/logout.js +6 -8
  55. package/dist/commands/logout.js.map +1 -1
  56. package/dist/hooks/prerun/setupTelemetry.js +1 -1
  57. package/dist/hooks/prerun/setupTelemetry.js.map +1 -1
  58. package/dist/server/devServer.js +2 -1
  59. package/dist/server/devServer.js.map +1 -1
  60. package/dist/util/compareDependencyVersions.js +3 -1
  61. package/dist/util/compareDependencyVersions.js.map +1 -1
  62. package/dist/util/createExpiringConfig.js +0 -3
  63. package/dist/util/createExpiringConfig.js.map +1 -1
  64. package/dist/util/getCliVersion.js +3 -1
  65. package/dist/util/getCliVersion.js.map +1 -1
  66. package/dist/util/telemetry/logger.js +13 -0
  67. package/dist/util/telemetry/logger.js.map +1 -1
  68. package/oclif.manifest.json +275 -269
  69. package/package.json +21 -21
  70. package/dist/actions/graphql/__tests__/fixtures/many-self-refs.js +0 -540
  71. package/dist/actions/graphql/__tests__/fixtures/many-self-refs.js.map +0 -1
  72. package/dist/actions/graphql/__tests__/fixtures/test-studio.js +0 -1143
  73. package/dist/actions/graphql/__tests__/fixtures/test-studio.js.map +0 -1
  74. package/dist/actions/graphql/__tests__/fixtures/union-refs.js +0 -591
  75. package/dist/actions/graphql/__tests__/fixtures/union-refs.js.map +0 -1
  76. package/dist/actions/graphql/__tests__/helpers.js +0 -23
  77. package/dist/actions/graphql/__tests__/helpers.js.map +0 -1
  78. package/dist/actions/manifest/__tests__/resolveSchemaIcon.test.js +0 -157
  79. package/dist/actions/manifest/__tests__/resolveSchemaIcon.test.js.map +0 -1
  80. package/dist/actions/manifest/__tests__/testHelpers.js +0 -21
  81. package/dist/actions/manifest/__tests__/testHelpers.js.map +0 -1
  82. package/dist/actions/media/__tests__/createMockClient.js +0 -32
  83. package/dist/actions/media/__tests__/createMockClient.js.map +0 -1
@@ -222,6 +222,13 @@
222
222
  "allowNo": false,
223
223
  "type": "boolean"
224
224
  },
225
+ "url": {
226
+ "description": "Studio URL for deployment. For external studios, the full URL. For hosted studios, the hostname (e.g. \"my-studio\" or \"my-studio.sanity.studio\")",
227
+ "name": "url",
228
+ "hasDynamicHelp": false,
229
+ "multiple": false,
230
+ "type": "option"
231
+ },
225
232
  "verbose": {
226
233
  "description": "Enable verbose logging",
227
234
  "name": "verbose",
@@ -790,13 +797,17 @@
790
797
  "command": "<%= config.bin %> <%= command.id %>",
791
798
  "description": "Log in using default settings"
792
799
  },
800
+ {
801
+ "command": "<%= config.bin %> <%= command.id %> --provider github --no-open",
802
+ "description": "Login with GitHub provider, but do not open a browser window automatically"
803
+ },
793
804
  {
794
805
  "command": "<%= config.bin %> <%= command.id %> --sso my-organization",
795
806
  "description": "Log in using Single Sign-On with the \"my-organization\" slug"
796
807
  },
797
808
  {
798
- "command": "<%= config.bin %> <%= command.id %> --provider github --no-open",
799
- "description": "Login with GitHub provider, but do not open a browser window automatically"
809
+ "command": "<%= config.bin %> <%= command.id %> --sso my-organization --sso-provider \"Okta SSO\"",
810
+ "description": "Log in using a specific SSO provider within an organization"
800
811
  }
801
812
  ],
802
813
  "flags": {
@@ -833,6 +844,17 @@
833
844
  "helpValue": "<slug>",
834
845
  "multiple": false,
835
846
  "type": "option"
847
+ },
848
+ "sso-provider": {
849
+ "dependsOn": [
850
+ "sso"
851
+ ],
852
+ "description": "Select a specific SSO provider by name (use with --sso)",
853
+ "name": "sso-provider",
854
+ "hasDynamicHelp": false,
855
+ "helpValue": "<name>",
856
+ "multiple": false,
857
+ "type": "option"
836
858
  }
837
859
  },
838
860
  "hasDynamicHelp": false,
@@ -2591,98 +2613,43 @@
2591
2613
  "validate.js"
2592
2614
  ]
2593
2615
  },
2594
- "graphql:deploy": {
2616
+ "hooks:attempt": {
2595
2617
  "aliases": [],
2596
- "args": {},
2597
- "description": "Deploy a GraphQL API from the current Sanity schema",
2618
+ "args": {
2619
+ "attemptId": {
2620
+ "description": "The delivery attempt ID to get details for",
2621
+ "name": "attemptId",
2622
+ "required": true
2623
+ }
2624
+ },
2625
+ "description": "Print details of a given webhook delivery attempt",
2598
2626
  "examples": [
2599
2627
  {
2600
- "command": "<%= config.bin %> <%= command.id %>",
2601
- "description": "Deploy all defined GraphQL APIs"
2602
- },
2603
- {
2604
- "command": "<%= config.bin %> <%= command.id %> --dry-run",
2605
- "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy"
2606
- },
2607
- {
2608
- "command": "<%= config.bin %> <%= command.id %> --api staging --api ios",
2609
- "description": "Deploy only the GraphQL APIs with the IDs \"staging\" and \"ios\""
2628
+ "command": "<%= config.bin %> <%= command.id %> abc123",
2629
+ "description": "Print details of webhook delivery attempt with ID abc123"
2610
2630
  },
2611
2631
  {
2612
- "command": "<%= config.bin %> <%= command.id %> --playground",
2613
- "description": "Deploy all defined GraphQL APIs, overriding any playground setting"
2632
+ "command": "<%= config.bin %> <%= command.id %> abc123 --project-id projectId",
2633
+ "description": "Get attempt details for a specific project"
2614
2634
  }
2615
2635
  ],
2616
2636
  "flags": {
2617
- "api": {
2618
- "description": "Only deploy API with this ID. Can be specified multiple times.",
2619
- "name": "api",
2620
- "hasDynamicHelp": false,
2621
- "multiple": true,
2622
- "type": "option"
2623
- },
2624
- "dataset": {
2625
- "char": "d",
2626
- "description": "Deploy API for the given dataset",
2627
- "name": "dataset",
2628
- "hasDynamicHelp": false,
2629
- "helpValue": "<name>",
2630
- "multiple": false,
2631
- "type": "option"
2632
- },
2633
- "dry-run": {
2634
- "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy",
2635
- "name": "dry-run",
2636
- "allowNo": false,
2637
- "type": "boolean"
2638
- },
2639
- "force": {
2640
- "description": "Deploy API without confirming breaking changes",
2641
- "name": "force",
2642
- "allowNo": false,
2643
- "type": "boolean"
2644
- },
2645
- "generation": {
2646
- "description": "API generation to deploy (defaults to \"gen3\")",
2647
- "name": "generation",
2648
- "hasDynamicHelp": false,
2649
- "multiple": false,
2650
- "options": [
2651
- "gen1",
2652
- "gen2",
2653
- "gen3"
2654
- ],
2655
- "type": "option"
2656
- },
2657
- "non-null-document-fields": {
2658
- "description": "Use non-null document fields (_id, _type etc)",
2659
- "name": "non-null-document-fields",
2660
- "allowNo": false,
2661
- "type": "boolean"
2662
- },
2663
- "playground": {
2664
- "description": "Enable GraphQL playground for easier debugging",
2665
- "name": "playground",
2666
- "allowNo": true,
2667
- "type": "boolean"
2668
- },
2669
- "tag": {
2670
- "description": "Deploy API(s) to given tag (defaults to \"default\")",
2671
- "name": "tag",
2637
+ "project-id": {
2638
+ "char": "p",
2639
+ "description": "Project ID to view webhook attempt for (overrides CLI configuration)",
2640
+ "helpGroup": "OVERRIDE",
2641
+ "name": "project-id",
2672
2642
  "hasDynamicHelp": false,
2643
+ "helpValue": "<id>",
2673
2644
  "multiple": false,
2674
2645
  "type": "option"
2675
- },
2676
- "with-union-cache": {
2677
- "description": "Enable union cache that optimizes schema generation for schemas with many self referencing types",
2678
- "name": "with-union-cache",
2679
- "allowNo": false,
2680
- "type": "boolean"
2681
2646
  }
2682
2647
  },
2683
2648
  "hasDynamicHelp": false,
2684
- "hiddenAliases": [],
2685
- "id": "graphql:deploy",
2649
+ "hiddenAliases": [
2650
+ "hook:attempt"
2651
+ ],
2652
+ "id": "hooks:attempt",
2686
2653
  "pluginAlias": "@sanity/cli",
2687
2654
  "pluginName": "@sanity/cli",
2688
2655
  "pluginType": "core",
@@ -2691,28 +2658,28 @@
2691
2658
  "relativePath": [
2692
2659
  "dist",
2693
2660
  "commands",
2694
- "graphql",
2695
- "deploy.js"
2661
+ "hooks",
2662
+ "attempt.js"
2696
2663
  ]
2697
2664
  },
2698
- "graphql:list": {
2665
+ "hooks:create": {
2699
2666
  "aliases": [],
2700
2667
  "args": {},
2701
- "description": "List all GraphQL endpoints deployed for this project",
2668
+ "description": "Create a new webhook for the current project",
2702
2669
  "examples": [
2703
2670
  {
2704
2671
  "command": "<%= config.bin %> <%= command.id %>",
2705
- "description": "List GraphQL endpoints for the current project"
2672
+ "description": "Create a new webhook for the current project"
2706
2673
  },
2707
2674
  {
2708
2675
  "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
2709
- "description": "List GraphQL endpoints for a specific project"
2676
+ "description": "Create a webhook for a specific project"
2710
2677
  }
2711
2678
  ],
2712
2679
  "flags": {
2713
2680
  "project-id": {
2714
2681
  "char": "p",
2715
- "description": "Project ID to list GraphQL endpoints for (overrides CLI configuration)",
2682
+ "description": "Project ID to create webhook for (overrides CLI configuration)",
2716
2683
  "helpGroup": "OVERRIDE",
2717
2684
  "name": "project-id",
2718
2685
  "hasDynamicHelp": false,
@@ -2722,8 +2689,10 @@
2722
2689
  }
2723
2690
  },
2724
2691
  "hasDynamicHelp": false,
2725
- "hiddenAliases": [],
2726
- "id": "graphql:list",
2692
+ "hiddenAliases": [
2693
+ "hook:create"
2694
+ ],
2695
+ "id": "hooks:create",
2727
2696
  "pluginAlias": "@sanity/cli",
2728
2697
  "pluginName": "@sanity/cli",
2729
2698
  "pluginType": "core",
@@ -2732,105 +2701,51 @@
2732
2701
  "relativePath": [
2733
2702
  "dist",
2734
2703
  "commands",
2735
- "graphql",
2736
- "list.js"
2704
+ "hooks",
2705
+ "create.js"
2737
2706
  ]
2738
2707
  },
2739
- "graphql:undeploy": {
2708
+ "hooks:delete": {
2740
2709
  "aliases": [],
2741
- "args": {},
2742
- "description": "Remove a deployed GraphQL API",
2710
+ "args": {
2711
+ "name": {
2712
+ "description": "Name of hook to delete (will prompt if not provided)",
2713
+ "name": "name",
2714
+ "required": false
2715
+ }
2716
+ },
2717
+ "description": "Delete a hook within your project",
2743
2718
  "examples": [
2744
2719
  {
2745
2720
  "command": "<%= config.bin %> <%= command.id %>",
2746
- "description": "Undeploy GraphQL API for current project and dataset"
2747
- },
2748
- {
2749
- "command": "<%= config.bin %> <%= command.id %> --api ios",
2750
- "description": "Undeploy API with ID \"ios\""
2751
- },
2752
- {
2753
- "command": "<%= config.bin %> <%= command.id %> --dataset staging",
2754
- "description": "Undeploy GraphQL API for staging dataset"
2755
- },
2756
- {
2757
- "command": "<%= config.bin %> <%= command.id %> --dataset staging --tag next",
2758
- "description": "Undeploy GraphQL API for staging dataset with \"next\" tag"
2721
+ "description": "Interactively select and delete a hook"
2759
2722
  },
2760
2723
  {
2761
- "command": "<%= config.bin %> <%= command.id %> --force",
2762
- "description": "Undeploy GraphQL API without confirmation prompt"
2724
+ "command": "<%= config.bin %> <%= command.id %> my-hook",
2725
+ "description": "Delete a specific hook by name"
2763
2726
  },
2764
2727
  {
2765
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
2766
- "description": "Undeploy GraphQL API for a specific project and dataset"
2728
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
2729
+ "description": "Delete a hook from a specific project"
2767
2730
  }
2768
2731
  ],
2769
2732
  "flags": {
2770
2733
  "project-id": {
2771
2734
  "char": "p",
2772
- "description": "Project ID to undeploy GraphQL API from (overrides CLI configuration)",
2735
+ "description": "Project ID to delete webhook from (overrides CLI configuration)",
2773
2736
  "helpGroup": "OVERRIDE",
2774
2737
  "name": "project-id",
2775
2738
  "hasDynamicHelp": false,
2776
2739
  "helpValue": "<id>",
2777
2740
  "multiple": false,
2778
2741
  "type": "option"
2779
- },
2780
- "api": {
2781
- "description": "Undeploy API with this ID",
2782
- "exclusive": [
2783
- "project-id",
2784
- "project"
2785
- ],
2786
- "name": "api",
2787
- "required": false,
2788
- "hasDynamicHelp": false,
2789
- "multiple": false,
2790
- "type": "option"
2791
- },
2792
- "dataset": {
2793
- "char": "d",
2794
- "description": "Dataset to undeploy GraphQL API from (overrides CLI configuration)",
2795
- "helpGroup": "OVERRIDE",
2796
- "name": "dataset",
2797
- "hasDynamicHelp": false,
2798
- "helpValue": "<name>",
2799
- "multiple": false,
2800
- "type": "option"
2801
- },
2802
- "force": {
2803
- "description": "Skip confirmation prompt",
2804
- "name": "force",
2805
- "required": false,
2806
- "allowNo": false,
2807
- "type": "boolean"
2808
- },
2809
- "project": {
2810
- "deprecated": {
2811
- "to": "project-id"
2812
- },
2813
- "description": "Project ID to delete GraphQL API for",
2814
- "hidden": true,
2815
- "name": "project",
2816
- "required": false,
2817
- "hasDynamicHelp": false,
2818
- "multiple": false,
2819
- "type": "option"
2820
- },
2821
- "tag": {
2822
- "description": "Tag to undeploy GraphQL API from",
2823
- "name": "tag",
2824
- "required": false,
2825
- "default": "default",
2826
- "hasDynamicHelp": false,
2827
- "multiple": false,
2828
- "type": "option"
2829
2742
  }
2830
2743
  },
2831
2744
  "hasDynamicHelp": false,
2832
- "hiddenAliases": [],
2833
- "id": "graphql:undeploy",
2745
+ "hiddenAliases": [
2746
+ "hook:delete"
2747
+ ],
2748
+ "id": "hooks:delete",
2834
2749
  "pluginAlias": "@sanity/cli",
2835
2750
  "pluginName": "@sanity/cli",
2836
2751
  "pluginType": "core",
@@ -2839,34 +2754,28 @@
2839
2754
  "relativePath": [
2840
2755
  "dist",
2841
2756
  "commands",
2842
- "graphql",
2843
- "undeploy.js"
2757
+ "hooks",
2758
+ "delete.js"
2844
2759
  ]
2845
2760
  },
2846
- "hooks:attempt": {
2761
+ "hooks:list": {
2847
2762
  "aliases": [],
2848
- "args": {
2849
- "attemptId": {
2850
- "description": "The delivery attempt ID to get details for",
2851
- "name": "attemptId",
2852
- "required": true
2853
- }
2854
- },
2855
- "description": "Print details of a given webhook delivery attempt",
2763
+ "args": {},
2764
+ "description": "List hooks for a given project",
2856
2765
  "examples": [
2857
2766
  {
2858
- "command": "<%= config.bin %> <%= command.id %> abc123",
2859
- "description": "Print details of webhook delivery attempt with ID abc123"
2767
+ "command": "<%= config.bin %> <%= command.id %>",
2768
+ "description": "List hooks for a given project"
2860
2769
  },
2861
2770
  {
2862
- "command": "<%= config.bin %> <%= command.id %> abc123 --project-id projectId",
2863
- "description": "Get attempt details for a specific project"
2771
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
2772
+ "description": "List hooks for a specific project"
2864
2773
  }
2865
2774
  ],
2866
2775
  "flags": {
2867
2776
  "project-id": {
2868
2777
  "char": "p",
2869
- "description": "Project ID to view webhook attempt for (overrides CLI configuration)",
2778
+ "description": "Project ID to list webhooks for (overrides CLI configuration)",
2870
2779
  "helpGroup": "OVERRIDE",
2871
2780
  "name": "project-id",
2872
2781
  "hasDynamicHelp": false,
@@ -2877,9 +2786,9 @@
2877
2786
  },
2878
2787
  "hasDynamicHelp": false,
2879
2788
  "hiddenAliases": [
2880
- "hook:attempt"
2789
+ "hook:list"
2881
2790
  ],
2882
- "id": "hooks:attempt",
2791
+ "id": "hooks:list",
2883
2792
  "pluginAlias": "@sanity/cli",
2884
2793
  "pluginName": "@sanity/cli",
2885
2794
  "pluginType": "core",
@@ -2889,40 +2798,57 @@
2889
2798
  "dist",
2890
2799
  "commands",
2891
2800
  "hooks",
2892
- "attempt.js"
2801
+ "list.js"
2893
2802
  ]
2894
2803
  },
2895
- "hooks:create": {
2804
+ "hooks:logs": {
2896
2805
  "aliases": [],
2897
- "args": {},
2898
- "description": "Create a new webhook for the current project",
2806
+ "args": {
2807
+ "name": {
2808
+ "description": "Name of the hook to show logs for",
2809
+ "name": "name",
2810
+ "required": false
2811
+ }
2812
+ },
2813
+ "description": "List latest log entries for a given hook",
2899
2814
  "examples": [
2900
2815
  {
2901
2816
  "command": "<%= config.bin %> <%= command.id %>",
2902
- "description": "Create a new webhook for the current project"
2817
+ "description": "List latest log entries for a given hook"
2818
+ },
2819
+ {
2820
+ "command": "<%= config.bin %> <%= command.id %> [NAME]",
2821
+ "description": "List latest log entries for a specific hook by name"
2903
2822
  },
2904
2823
  {
2905
2824
  "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
2906
- "description": "Create a webhook for a specific project"
2825
+ "description": "List hook logs for a specific project"
2907
2826
  }
2908
2827
  ],
2909
2828
  "flags": {
2910
2829
  "project-id": {
2911
2830
  "char": "p",
2912
- "description": "Project ID to create webhook for (overrides CLI configuration)",
2831
+ "description": "Project ID to view webhook logs for (overrides CLI configuration)",
2913
2832
  "helpGroup": "OVERRIDE",
2914
2833
  "name": "project-id",
2915
2834
  "hasDynamicHelp": false,
2916
2835
  "helpValue": "<id>",
2917
2836
  "multiple": false,
2918
2837
  "type": "option"
2838
+ },
2839
+ "detailed": {
2840
+ "description": "Include detailed payload and attempts",
2841
+ "name": "detailed",
2842
+ "required": false,
2843
+ "allowNo": false,
2844
+ "type": "boolean"
2919
2845
  }
2920
2846
  },
2921
2847
  "hasDynamicHelp": false,
2922
2848
  "hiddenAliases": [
2923
- "hook:create"
2849
+ "hook:logs"
2924
2850
  ],
2925
- "id": "hooks:create",
2851
+ "id": "hooks:logs",
2926
2852
  "pluginAlias": "@sanity/cli",
2927
2853
  "pluginName": "@sanity/cli",
2928
2854
  "pluginType": "core",
@@ -2932,50 +2858,101 @@
2932
2858
  "dist",
2933
2859
  "commands",
2934
2860
  "hooks",
2935
- "create.js"
2861
+ "logs.js"
2936
2862
  ]
2937
2863
  },
2938
- "hooks:delete": {
2864
+ "graphql:deploy": {
2939
2865
  "aliases": [],
2940
- "args": {
2941
- "name": {
2942
- "description": "Name of hook to delete (will prompt if not provided)",
2943
- "name": "name",
2944
- "required": false
2945
- }
2946
- },
2947
- "description": "Delete a hook within your project",
2866
+ "args": {},
2867
+ "description": "Deploy a GraphQL API from the current Sanity schema",
2948
2868
  "examples": [
2949
2869
  {
2950
2870
  "command": "<%= config.bin %> <%= command.id %>",
2951
- "description": "Interactively select and delete a hook"
2871
+ "description": "Deploy all defined GraphQL APIs"
2952
2872
  },
2953
2873
  {
2954
- "command": "<%= config.bin %> <%= command.id %> my-hook",
2955
- "description": "Delete a specific hook by name"
2874
+ "command": "<%= config.bin %> <%= command.id %> --dry-run",
2875
+ "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy"
2956
2876
  },
2957
2877
  {
2958
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
2959
- "description": "Delete a hook from a specific project"
2878
+ "command": "<%= config.bin %> <%= command.id %> --api staging --api ios",
2879
+ "description": "Deploy only the GraphQL APIs with the IDs \"staging\" and \"ios\""
2880
+ },
2881
+ {
2882
+ "command": "<%= config.bin %> <%= command.id %> --playground",
2883
+ "description": "Deploy all defined GraphQL APIs, overriding any playground setting"
2960
2884
  }
2961
2885
  ],
2962
2886
  "flags": {
2963
- "project-id": {
2964
- "char": "p",
2965
- "description": "Project ID to delete webhook from (overrides CLI configuration)",
2966
- "helpGroup": "OVERRIDE",
2967
- "name": "project-id",
2887
+ "api": {
2888
+ "description": "Only deploy API with this ID. Can be specified multiple times.",
2889
+ "name": "api",
2968
2890
  "hasDynamicHelp": false,
2969
- "helpValue": "<id>",
2891
+ "multiple": true,
2892
+ "type": "option"
2893
+ },
2894
+ "dataset": {
2895
+ "char": "d",
2896
+ "description": "Deploy API for the given dataset",
2897
+ "name": "dataset",
2898
+ "hasDynamicHelp": false,
2899
+ "helpValue": "<name>",
2970
2900
  "multiple": false,
2971
2901
  "type": "option"
2902
+ },
2903
+ "dry-run": {
2904
+ "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy",
2905
+ "name": "dry-run",
2906
+ "allowNo": false,
2907
+ "type": "boolean"
2908
+ },
2909
+ "force": {
2910
+ "description": "Deploy API without confirming breaking changes",
2911
+ "name": "force",
2912
+ "allowNo": false,
2913
+ "type": "boolean"
2914
+ },
2915
+ "generation": {
2916
+ "description": "API generation to deploy (defaults to \"gen3\")",
2917
+ "name": "generation",
2918
+ "hasDynamicHelp": false,
2919
+ "multiple": false,
2920
+ "options": [
2921
+ "gen1",
2922
+ "gen2",
2923
+ "gen3"
2924
+ ],
2925
+ "type": "option"
2926
+ },
2927
+ "non-null-document-fields": {
2928
+ "description": "Use non-null document fields (_id, _type etc)",
2929
+ "name": "non-null-document-fields",
2930
+ "allowNo": false,
2931
+ "type": "boolean"
2932
+ },
2933
+ "playground": {
2934
+ "description": "Enable GraphQL playground for easier debugging",
2935
+ "name": "playground",
2936
+ "allowNo": true,
2937
+ "type": "boolean"
2938
+ },
2939
+ "tag": {
2940
+ "description": "Deploy API(s) to given tag (defaults to \"default\")",
2941
+ "name": "tag",
2942
+ "hasDynamicHelp": false,
2943
+ "multiple": false,
2944
+ "type": "option"
2945
+ },
2946
+ "with-union-cache": {
2947
+ "description": "Enable union cache that optimizes schema generation for schemas with many self referencing types",
2948
+ "name": "with-union-cache",
2949
+ "allowNo": false,
2950
+ "type": "boolean"
2972
2951
  }
2973
2952
  },
2974
2953
  "hasDynamicHelp": false,
2975
- "hiddenAliases": [
2976
- "hook:delete"
2977
- ],
2978
- "id": "hooks:delete",
2954
+ "hiddenAliases": [],
2955
+ "id": "graphql:deploy",
2979
2956
  "pluginAlias": "@sanity/cli",
2980
2957
  "pluginName": "@sanity/cli",
2981
2958
  "pluginType": "core",
@@ -2984,28 +2961,28 @@
2984
2961
  "relativePath": [
2985
2962
  "dist",
2986
2963
  "commands",
2987
- "hooks",
2988
- "delete.js"
2964
+ "graphql",
2965
+ "deploy.js"
2989
2966
  ]
2990
2967
  },
2991
- "hooks:list": {
2968
+ "graphql:list": {
2992
2969
  "aliases": [],
2993
2970
  "args": {},
2994
- "description": "List hooks for a given project",
2971
+ "description": "List all GraphQL endpoints deployed for this project",
2995
2972
  "examples": [
2996
2973
  {
2997
2974
  "command": "<%= config.bin %> <%= command.id %>",
2998
- "description": "List hooks for a given project"
2975
+ "description": "List GraphQL endpoints for the current project"
2999
2976
  },
3000
2977
  {
3001
2978
  "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
3002
- "description": "List hooks for a specific project"
2979
+ "description": "List GraphQL endpoints for a specific project"
3003
2980
  }
3004
2981
  ],
3005
2982
  "flags": {
3006
2983
  "project-id": {
3007
2984
  "char": "p",
3008
- "description": "Project ID to list webhooks for (overrides CLI configuration)",
2985
+ "description": "Project ID to list GraphQL endpoints for (overrides CLI configuration)",
3009
2986
  "helpGroup": "OVERRIDE",
3010
2987
  "name": "project-id",
3011
2988
  "hasDynamicHelp": false,
@@ -3015,10 +2992,8 @@
3015
2992
  }
3016
2993
  },
3017
2994
  "hasDynamicHelp": false,
3018
- "hiddenAliases": [
3019
- "hook:list"
3020
- ],
3021
- "id": "hooks:list",
2995
+ "hiddenAliases": [],
2996
+ "id": "graphql:list",
3022
2997
  "pluginAlias": "@sanity/cli",
3023
2998
  "pluginName": "@sanity/cli",
3024
2999
  "pluginType": "core",
@@ -3027,38 +3002,44 @@
3027
3002
  "relativePath": [
3028
3003
  "dist",
3029
3004
  "commands",
3030
- "hooks",
3005
+ "graphql",
3031
3006
  "list.js"
3032
3007
  ]
3033
3008
  },
3034
- "hooks:logs": {
3009
+ "graphql:undeploy": {
3035
3010
  "aliases": [],
3036
- "args": {
3037
- "name": {
3038
- "description": "Name of the hook to show logs for",
3039
- "name": "name",
3040
- "required": false
3041
- }
3042
- },
3043
- "description": "List latest log entries for a given hook",
3011
+ "args": {},
3012
+ "description": "Remove a deployed GraphQL API",
3044
3013
  "examples": [
3045
3014
  {
3046
3015
  "command": "<%= config.bin %> <%= command.id %>",
3047
- "description": "List latest log entries for a given hook"
3016
+ "description": "Undeploy GraphQL API for current project and dataset"
3048
3017
  },
3049
3018
  {
3050
- "command": "<%= config.bin %> <%= command.id %> [NAME]",
3051
- "description": "List latest log entries for a specific hook by name"
3019
+ "command": "<%= config.bin %> <%= command.id %> --api ios",
3020
+ "description": "Undeploy API with ID \"ios\""
3052
3021
  },
3053
3022
  {
3054
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
3055
- "description": "List hook logs for a specific project"
3023
+ "command": "<%= config.bin %> <%= command.id %> --dataset staging",
3024
+ "description": "Undeploy GraphQL API for staging dataset"
3025
+ },
3026
+ {
3027
+ "command": "<%= config.bin %> <%= command.id %> --dataset staging --tag next",
3028
+ "description": "Undeploy GraphQL API for staging dataset with \"next\" tag"
3029
+ },
3030
+ {
3031
+ "command": "<%= config.bin %> <%= command.id %> --force",
3032
+ "description": "Undeploy GraphQL API without confirmation prompt"
3033
+ },
3034
+ {
3035
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3036
+ "description": "Undeploy GraphQL API for a specific project and dataset"
3056
3037
  }
3057
3038
  ],
3058
3039
  "flags": {
3059
3040
  "project-id": {
3060
3041
  "char": "p",
3061
- "description": "Project ID to view webhook logs for (overrides CLI configuration)",
3042
+ "description": "Project ID to undeploy GraphQL API from (overrides CLI configuration)",
3062
3043
  "helpGroup": "OVERRIDE",
3063
3044
  "name": "project-id",
3064
3045
  "hasDynamicHelp": false,
@@ -3066,19 +3047,60 @@
3066
3047
  "multiple": false,
3067
3048
  "type": "option"
3068
3049
  },
3069
- "detailed": {
3070
- "description": "Include detailed payload and attempts",
3071
- "name": "detailed",
3050
+ "api": {
3051
+ "description": "Undeploy API with this ID",
3052
+ "exclusive": [
3053
+ "project-id",
3054
+ "project"
3055
+ ],
3056
+ "name": "api",
3057
+ "required": false,
3058
+ "hasDynamicHelp": false,
3059
+ "multiple": false,
3060
+ "type": "option"
3061
+ },
3062
+ "dataset": {
3063
+ "char": "d",
3064
+ "description": "Dataset to undeploy GraphQL API from (overrides CLI configuration)",
3065
+ "helpGroup": "OVERRIDE",
3066
+ "name": "dataset",
3067
+ "hasDynamicHelp": false,
3068
+ "helpValue": "<name>",
3069
+ "multiple": false,
3070
+ "type": "option"
3071
+ },
3072
+ "force": {
3073
+ "description": "Skip confirmation prompt",
3074
+ "name": "force",
3072
3075
  "required": false,
3073
3076
  "allowNo": false,
3074
3077
  "type": "boolean"
3078
+ },
3079
+ "project": {
3080
+ "deprecated": {
3081
+ "to": "project-id"
3082
+ },
3083
+ "description": "Project ID to delete GraphQL API for",
3084
+ "hidden": true,
3085
+ "name": "project",
3086
+ "required": false,
3087
+ "hasDynamicHelp": false,
3088
+ "multiple": false,
3089
+ "type": "option"
3090
+ },
3091
+ "tag": {
3092
+ "description": "Tag to undeploy GraphQL API from",
3093
+ "name": "tag",
3094
+ "required": false,
3095
+ "default": "default",
3096
+ "hasDynamicHelp": false,
3097
+ "multiple": false,
3098
+ "type": "option"
3075
3099
  }
3076
3100
  },
3077
3101
  "hasDynamicHelp": false,
3078
- "hiddenAliases": [
3079
- "hook:logs"
3080
- ],
3081
- "id": "hooks:logs",
3102
+ "hiddenAliases": [],
3103
+ "id": "graphql:undeploy",
3082
3104
  "pluginAlias": "@sanity/cli",
3083
3105
  "pluginName": "@sanity/cli",
3084
3106
  "pluginType": "core",
@@ -3087,8 +3109,8 @@
3087
3109
  "relativePath": [
3088
3110
  "dist",
3089
3111
  "commands",
3090
- "hooks",
3091
- "logs.js"
3112
+ "graphql",
3113
+ "undeploy.js"
3092
3114
  ]
3093
3115
  },
3094
3116
  "manifest:extract": {
@@ -4557,10 +4579,6 @@
4557
4579
  {
4558
4580
  "command": "<%= config.bin %> <%= command.id %> conference conf-2025",
4559
4581
  "description": "Create alias \"conference\" linked to \"conf-2025\" dataset"
4560
- },
4561
- {
4562
- "command": "<%= config.bin %> <%= command.id %> ~conference conf-2025",
4563
- "description": "Create alias with explicit ~ prefix"
4564
4582
  }
4565
4583
  ],
4566
4584
  "flags": {
@@ -4608,10 +4626,6 @@
4608
4626
  "command": "<%= config.bin %> <%= command.id %> conference",
4609
4627
  "description": "Delete alias named \"conference\" with confirmation prompt"
4610
4628
  },
4611
- {
4612
- "command": "<%= config.bin %> <%= command.id %> ~conference",
4613
- "description": "Delete alias with explicit ~ prefix"
4614
- },
4615
4629
  {
4616
4630
  "command": "<%= config.bin %> <%= command.id %> conference --force",
4617
4631
  "description": "Delete alias named \"conference\" without confirmation prompt"
@@ -4682,10 +4696,6 @@
4682
4696
  "command": "<%= config.bin %> <%= command.id %> conference conf-2025",
4683
4697
  "description": "Link alias \"conference\" to \"conf-2025\" dataset"
4684
4698
  },
4685
- {
4686
- "command": "<%= config.bin %> <%= command.id %> ~conference conf-2025",
4687
- "description": "Link alias with explicit ~ prefix"
4688
- },
4689
4699
  {
4690
4700
  "command": "<%= config.bin %> <%= command.id %> conference conf-2025 --force",
4691
4701
  "description": "Force link without confirmation (skip relink prompt)"
@@ -4747,10 +4757,6 @@
4747
4757
  "command": "<%= config.bin %> <%= command.id %> conference",
4748
4758
  "description": "Unlink alias \"conference\" with confirmation prompt"
4749
4759
  },
4750
- {
4751
- "command": "<%= config.bin %> <%= command.id %> ~conference",
4752
- "description": "Unlink alias with explicit ~ prefix"
4753
- },
4754
4760
  {
4755
4761
  "command": "<%= config.bin %> <%= command.id %> conference --force",
4756
4762
  "description": "Unlink alias \"conference\" without confirmation prompt"
@@ -5059,5 +5065,5 @@
5059
5065
  ]
5060
5066
  }
5061
5067
  },
5062
- "version": "6.2.1"
5068
+ "version": "6.3.0"
5063
5069
  }