@sanity/cli 4.6.1-next.9 → 4.6.2-next.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.
@@ -3767,7 +3767,11 @@ function print() { __p += __j.call(arguments, '') }
3767
3767
  }(lodash$1, lodash$1.exports)), lodash$1.exports;
3768
3768
  }
3769
3769
  var lodashExports = requireLodash();
3770
- const helpText$r = `
3770
+ const BlueprintsAddExampleUsed = telemetry.defineEvent({
3771
+ version: 1,
3772
+ name: "Blueprints Add Example Used",
3773
+ description: "User used --example flag with blueprints add command"
3774
+ }), helpText$r = `
3771
3775
  Arguments
3772
3776
  <type> Type of Resource to add (currently only 'function' is supported)
3773
3777
 
@@ -3813,7 +3817,7 @@ Examples:
3813
3817
  signature: "<type> [--name <name>] [--fn-type <document-create|document-delete|document-update|document-publish>] [--fn-lang <ts|js>] [--javascript]",
3814
3818
  description: "Add a Resource to a Blueprint",
3815
3819
  async action(args, context) {
3816
- const { output, apiClient } = context, { extOptions } = args;
3820
+ const { output, apiClient, telemetry: telemetry2 } = context, { extOptions } = args, [resourceType] = args.argsWithoutOptions;
3817
3821
  if (extOptions.example) {
3818
3822
  const foundConflict = [
3819
3823
  "name",
@@ -3830,13 +3834,16 @@ Examples:
3830
3834
  ].find((key2) => extOptions[key2]);
3831
3835
  if (foundConflict)
3832
3836
  throw new Error(`--example can't be used with --${foundConflict}`);
3837
+ telemetry2.log(BlueprintsAddExampleUsed, {
3838
+ resourceType,
3839
+ example: extOptions.example
3840
+ });
3833
3841
  }
3834
3842
  const flags = { ...defaultFlags$c, ...extOptions }, client2 = apiClient({
3835
3843
  requireUser: !0,
3836
3844
  requireProject: !1
3837
3845
  }), { token: token2 } = client2.config();
3838
3846
  if (!token2) throw new Error("No API token found. Please run `sanity login`.");
3839
- const [resourceType] = args.argsWithoutOptions;
3840
3847
  if (!resourceType) {
3841
3848
  output.error("Resource type is required. Available types: function");
3842
3849
  return;