@uniformdev/cli 19.38.2 → 19.38.3-alpha.70

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/dist/index.d.mts +34 -0
  2. package/dist/index.mjs +1479 -879
  3. package/package.json +11 -10
package/dist/index.mjs CHANGED
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
+ import { cosmiconfigSync } from "cosmiconfig";
5
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
4
6
  import * as dotenv from "dotenv";
5
- import yargs20 from "yargs";
7
+ import fs5 from "fs";
8
+ import yargs22 from "yargs";
6
9
  import { hideBin } from "yargs/helpers";
7
10
 
8
11
  // src/commands/canvas/index.ts
9
- import yargs5 from "yargs";
12
+ import yargs6 from "yargs";
10
13
 
11
14
  // src/commands/canvas/commands/category.ts
12
15
  import yargs from "yargs";
@@ -92,8 +95,14 @@ import httpsProxyAgent from "https-proxy-agent";
92
95
  import unfetch from "isomorphic-unfetch";
93
96
  import { dump, load } from "js-yaml";
94
97
  import { extname } from "path";
95
- function withApiOptions(yargs21) {
96
- return yargs21.option("apiKey", {
98
+ function withConfiguration(yargs23) {
99
+ return yargs23.option("serialization", {
100
+ skipValidation: true,
101
+ hidden: true
102
+ });
103
+ }
104
+ function withApiOptions(yargs23) {
105
+ return yargs23.option("apiKey", {
97
106
  describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
98
107
  default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
99
108
  process.env.CANVAS_CLI_API_KEY ?? // deprecated
@@ -132,8 +141,8 @@ function nodeFetchProxy(proxy) {
132
141
  };
133
142
  return wrappedFetch;
134
143
  }
135
- function withProjectOptions(yargs21) {
136
- return yargs21.option("project", {
144
+ function withProjectOptions(yargs23) {
145
+ return yargs23.option("project", {
137
146
  describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
138
147
  default: process.env.UNIFORM_CLI_PROJECT_ID ?? // deprecated
139
148
  process.env.CANVAS_CLI_PROJECT_ID ?? // deprecated
@@ -143,8 +152,8 @@ function withProjectOptions(yargs21) {
143
152
  alias: ["p"]
144
153
  });
145
154
  }
146
- function withFormatOptions(yargs21) {
147
- return yargs21.option("format", {
155
+ function withFormatOptions(yargs23) {
156
+ return yargs23.option("format", {
148
157
  alias: ["f"],
149
158
  describe: "Output format",
150
159
  default: "yaml",
@@ -156,8 +165,8 @@ function withFormatOptions(yargs21) {
156
165
  type: "string"
157
166
  });
158
167
  }
159
- function withDiffOptions(yargs21) {
160
- return yargs21.option("diff", {
168
+ function withDiffOptions(yargs23) {
169
+ return yargs23.option("diff", {
161
170
  describe: "Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",
162
171
  default: process.env.UNIFORM_CLI_DIFF_MODE ?? "off",
163
172
  type: "string",
@@ -217,6 +226,70 @@ async function* paginateAsync(fetchPage, options) {
217
226
  offset += perPage;
218
227
  } while (pageData.length === perPage);
219
228
  }
229
+ var defaultSyncConfiguration = {
230
+ entitiesConfig: {},
231
+ filename: "uniform-data",
232
+ format: "yaml",
233
+ mode: "mirror"
234
+ };
235
+ var applyDefaultSyncConfiguration = (config2) => {
236
+ var _a;
237
+ const mergedConfig = {
238
+ serialization: {
239
+ ...defaultSyncConfiguration,
240
+ ...(config2 == null ? void 0 : config2.serialization) ?? {},
241
+ entitiesConfig: {
242
+ ...defaultSyncConfiguration.entitiesConfig,
243
+ ...((_a = config2 == null ? void 0 : config2.serialization) == null ? void 0 : _a.entitiesConfig) ?? {}
244
+ }
245
+ }
246
+ };
247
+ for (const entityType in mergedConfig.serialization.entitiesConfig) {
248
+ const entityTypeCasted = entityType;
249
+ const entityConfig = mergedConfig.serialization.entitiesConfig[entityTypeCasted];
250
+ if (Object.keys(entityConfig).length === 0) {
251
+ const separator = mergedConfig.serialization.filename[mergedConfig.serialization.filename.length - 1] === "/" ? "" : "/";
252
+ mergedConfig.serialization.entitiesConfig[entityTypeCasted].filename = `${mergedConfig.serialization.filename}${separator}${entityTypeCasted}`;
253
+ }
254
+ }
255
+ return mergedConfig;
256
+ };
257
+ var getEntityOption = ({
258
+ optionName,
259
+ config: config2,
260
+ entityType,
261
+ operation
262
+ }) => {
263
+ var _a, _b, _c, _d, _e, _f;
264
+ if ((_b = (_a = config2.entitiesConfig[entityType]) == null ? void 0 : _a[operation]) == null ? void 0 : _b[optionName]) {
265
+ return (_d = (_c = config2.entitiesConfig[entityType]) == null ? void 0 : _c[operation]) == null ? void 0 : _d[optionName];
266
+ }
267
+ if ((_e = config2.entitiesConfig[entityType]) == null ? void 0 : _e[optionName]) {
268
+ return (_f = config2.entitiesConfig[entityType]) == null ? void 0 : _f[optionName];
269
+ }
270
+ if (config2[optionName]) {
271
+ return config2[optionName];
272
+ }
273
+ throw `No ${optionName} option specified for ${entityType} ${operation}`;
274
+ };
275
+ var getDirectoryOrFilename = ({
276
+ config: config2,
277
+ entityType,
278
+ operation
279
+ }) => {
280
+ var _a, _b, _c, _d, _e, _f;
281
+ if ((_b = (_a = config2.entitiesConfig[entityType]) == null ? void 0 : _a[operation]) == null ? void 0 : _b.filename) {
282
+ return (_d = (_c = config2.entitiesConfig[entityType]) == null ? void 0 : _c[operation]) == null ? void 0 : _d.filename;
283
+ }
284
+ if ((_e = config2.entitiesConfig[entityType]) == null ? void 0 : _e.filename) {
285
+ return (_f = config2.entitiesConfig[entityType]) == null ? void 0 : _f.filename;
286
+ }
287
+ const isPackage = isPathAPackageFile(config2.filename);
288
+ if (isPackage) {
289
+ return config2.filename;
290
+ }
291
+ return `${config2.filename}/${entityType}`;
292
+ };
220
293
 
221
294
  // src/sync/fileSyncEngineDataSource.ts
222
295
  async function createFileSyncEngineDataSource({
@@ -475,9 +548,13 @@ function createSyncEngineConsoleLogger(options) {
475
548
  var CategoryGetModule = {
476
549
  command: "get <id>",
477
550
  describe: "Fetch a category",
478
- builder: (yargs21) => withFormatOptions(
479
- withApiOptions(
480
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Category UUID to fetch" }))
551
+ builder: (yargs23) => withConfiguration(
552
+ withFormatOptions(
553
+ withApiOptions(
554
+ withProjectOptions(
555
+ yargs23.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
556
+ )
557
+ )
481
558
  )
482
559
  ),
483
560
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
@@ -500,7 +577,7 @@ var CategoryListModule = {
500
577
  command: "list",
501
578
  describe: "List categories",
502
579
  aliases: ["ls"],
503
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21.options({})))),
580
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23.options({}))))),
504
581
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
505
582
  const fetch3 = nodeFetchProxy(proxy);
506
583
  const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -510,7 +587,7 @@ var CategoryListModule = {
510
587
  };
511
588
 
512
589
  // src/commands/canvas/commands/category/pull.ts
513
- import { UncachedCanvasClient } from "@uniformdev/canvas";
590
+ import { UncachedCategoryClient as UncachedCategoryClient3 } from "@uniformdev/canvas";
514
591
 
515
592
  // src/commands/canvas/commands/category/_util.ts
516
593
  var selectIdentifier = (category) => category.id;
@@ -557,30 +634,32 @@ function writeCanvasPackage(filename, packageContents) {
557
634
  var CategoryPullModule = {
558
635
  command: "pull <directory>",
559
636
  describe: "Pulls all categories to local files in a directory",
560
- builder: (yargs21) => withApiOptions(
561
- withProjectOptions(
562
- withDiffOptions(
563
- yargs21.positional("directory", {
564
- describe: "Directory to save the categories to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
565
- type: "string"
566
- }).option("format", {
567
- alias: ["f"],
568
- describe: "Output format",
569
- default: "yaml",
570
- choices: ["yaml", "json"],
571
- type: "string"
572
- }).option("what-if", {
573
- alias: ["w"],
574
- describe: "What-if mode reports what would be done but changes no files",
575
- default: false,
576
- type: "boolean"
577
- }).option("mode", {
578
- alias: ["m"],
579
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
580
- choices: ["create", "createOrUpdate", "mirror"],
581
- default: "mirror",
582
- type: "string"
583
- })
637
+ builder: (yargs23) => withConfiguration(
638
+ withApiOptions(
639
+ withProjectOptions(
640
+ withDiffOptions(
641
+ yargs23.positional("directory", {
642
+ describe: "Directory to save the categories to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
643
+ type: "string"
644
+ }).option("format", {
645
+ alias: ["f"],
646
+ describe: "Output format",
647
+ default: "yaml",
648
+ choices: ["yaml", "json"],
649
+ type: "string"
650
+ }).option("what-if", {
651
+ alias: ["w"],
652
+ describe: "What-if mode reports what would be done but changes no files",
653
+ default: false,
654
+ type: "boolean"
655
+ }).option("mode", {
656
+ alias: ["m"],
657
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
658
+ choices: ["create", "createOrUpdate", "mirror"],
659
+ default: "mirror",
660
+ type: "string"
661
+ })
662
+ )
584
663
  )
585
664
  )
586
665
  ),
@@ -596,7 +675,7 @@ var CategoryPullModule = {
596
675
  diff: diffMode
597
676
  }) => {
598
677
  const fetch3 = nodeFetchProxy(proxy);
599
- const client = new UncachedCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
678
+ const client = new UncachedCategoryClient3({ apiKey, apiHost, fetch: fetch3, projectId });
600
679
  const source = createCategoriesEngineDataSource({ client });
601
680
  let target;
602
681
  const isPackage = isPathAPackageFile(directory);
@@ -630,28 +709,30 @@ var CategoryPullModule = {
630
709
  };
631
710
 
632
711
  // src/commands/canvas/commands/category/push.ts
633
- import { UncachedCanvasClient as UncachedCanvasClient2 } from "@uniformdev/canvas";
712
+ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/canvas";
634
713
  var CategoryPushModule = {
635
714
  command: "push <directory>",
636
715
  describe: "Pushes all categories from files in a directory to Uniform Canvas",
637
- builder: (yargs21) => withApiOptions(
638
- withProjectOptions(
639
- withDiffOptions(
640
- yargs21.positional("directory", {
641
- describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
642
- type: "string"
643
- }).option("what-if", {
644
- alias: ["w"],
645
- describe: "What-if mode reports what would be done but changes nothing",
646
- default: false,
647
- type: "boolean"
648
- }).option("mode", {
649
- alias: ["m"],
650
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
651
- choices: ["create", "createOrUpdate", "mirror"],
652
- default: "mirror",
653
- type: "string"
654
- })
716
+ builder: (yargs23) => withConfiguration(
717
+ withApiOptions(
718
+ withProjectOptions(
719
+ withDiffOptions(
720
+ yargs23.positional("directory", {
721
+ describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
722
+ type: "string"
723
+ }).option("what-if", {
724
+ alias: ["w"],
725
+ describe: "What-if mode reports what would be done but changes nothing",
726
+ default: false,
727
+ type: "boolean"
728
+ }).option("mode", {
729
+ alias: ["m"],
730
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
731
+ choices: ["create", "createOrUpdate", "mirror"],
732
+ default: "mirror",
733
+ type: "string"
734
+ })
735
+ )
655
736
  )
656
737
  )
657
738
  ),
@@ -666,7 +747,7 @@ var CategoryPushModule = {
666
747
  diff: diffMode
667
748
  }) => {
668
749
  const fetch3 = nodeFetchProxy(proxy);
669
- const client = new UncachedCanvasClient2({ apiKey, apiHost, fetch: fetch3, projectId });
750
+ const client = new UncachedCategoryClient4({ apiKey, apiHost, fetch: fetch3, projectId });
670
751
  let source;
671
752
  const isPackage = isPathAPackageFile(directory);
672
753
  if (isPackage) {
@@ -695,35 +776,41 @@ var CategoryPushModule = {
695
776
  };
696
777
 
697
778
  // src/commands/canvas/commands/category/remove.ts
698
- import { UncachedCanvasClient as UncachedCanvasClient3 } from "@uniformdev/canvas";
779
+ import { UncachedCategoryClient as UncachedCategoryClient5 } from "@uniformdev/canvas";
699
780
  var CategoryRemoveModule = {
700
781
  command: "remove <id>",
701
782
  aliases: ["delete", "rm"],
702
783
  describe: "Delete a category",
703
- builder: (yargs21) => withApiOptions(
704
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Category UUID to delete" }))
784
+ builder: (yargs23) => withConfiguration(
785
+ withApiOptions(
786
+ withProjectOptions(
787
+ yargs23.positional("id", { demandOption: true, describe: "Category UUID to delete" })
788
+ )
789
+ )
705
790
  ),
706
791
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
707
792
  const fetch3 = nodeFetchProxy(proxy);
708
- const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId });
793
+ const client = new UncachedCategoryClient5({ apiKey, apiHost, fetch: fetch3, projectId });
709
794
  await client.removeCategory({ categoryId: id });
710
795
  }
711
796
  };
712
797
 
713
798
  // src/commands/canvas/commands/category/update.ts
714
- import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canvas";
799
+ import { UncachedCategoryClient as UncachedCategoryClient6 } from "@uniformdev/canvas";
715
800
  var CategoryUpdateModule = {
716
801
  command: "update <filename>",
717
802
  aliases: ["put"],
718
803
  describe: "Insert or update a category",
719
- builder: (yargs21) => withApiOptions(
720
- withProjectOptions(
721
- yargs21.positional("filename", { demandOption: true, describe: "Category file to put" })
804
+ builder: (yargs23) => withConfiguration(
805
+ withApiOptions(
806
+ withProjectOptions(
807
+ yargs23.positional("filename", { demandOption: true, describe: "Category file to put" })
808
+ )
722
809
  )
723
810
  ),
724
811
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
725
812
  const fetch3 = nodeFetchProxy(proxy);
726
- const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId });
813
+ const client = new UncachedCategoryClient6({ apiKey, apiHost, fetch: fetch3, projectId });
727
814
  const file = readFileToObject(filename);
728
815
  await client.upsertCategories([file]);
729
816
  }
@@ -734,7 +821,7 @@ var CategoryModule = {
734
821
  command: "category <command>",
735
822
  aliases: ["cat"],
736
823
  describe: "Commands for Canvas categories",
737
- builder: (yargs21) => yargs21.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
824
+ builder: (yargs23) => yargs23.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
738
825
  handler: () => {
739
826
  yargs.help();
740
827
  }
@@ -744,7 +831,7 @@ var CategoryModule = {
744
831
  import yargs2 from "yargs";
745
832
 
746
833
  // src/commands/canvas/commands/component/get.ts
747
- import { UncachedCanvasClient as UncachedCanvasClient5 } from "@uniformdev/canvas";
834
+ import { UncachedCanvasClient } from "@uniformdev/canvas";
748
835
 
749
836
  // src/commands/canvas/commands/component/_util.ts
750
837
  var selectIdentifier2 = (component) => component.id;
@@ -755,16 +842,21 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
755
842
  var ComponentGetModule = {
756
843
  command: "get <id>",
757
844
  describe: "Fetch a component definition",
758
- builder: (yargs21) => withFormatOptions(
759
- withApiOptions(
760
- withProjectOptions(
761
- yargs21.positional("id", { demandOption: true, describe: "Component definition public ID to fetch" })
845
+ builder: (yargs23) => withConfiguration(
846
+ withFormatOptions(
847
+ withApiOptions(
848
+ withProjectOptions(
849
+ yargs23.positional("id", {
850
+ demandOption: true,
851
+ describe: "Component definition public ID to fetch"
852
+ })
853
+ )
762
854
  )
763
855
  )
764
856
  ),
765
857
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
766
858
  const fetch3 = nodeFetchProxy(proxy);
767
- const client = new UncachedCanvasClient5({ apiKey, apiHost, fetch: fetch3, projectId });
859
+ const client = new UncachedCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
768
860
  const res = await client.getComponentDefinitions({ componentId: id, limit: 1 });
769
861
  if (res.componentDefinitions.length === 0) {
770
862
  console.error("Component did not exist");
@@ -783,31 +875,33 @@ var ComponentGetModule = {
783
875
  };
784
876
 
785
877
  // src/commands/canvas/commands/component/list.ts
786
- import { UncachedCanvasClient as UncachedCanvasClient6 } from "@uniformdev/canvas";
878
+ import { UncachedCanvasClient as UncachedCanvasClient2 } from "@uniformdev/canvas";
787
879
  var ComponentListModule = {
788
880
  command: "list",
789
881
  describe: "List component definitions",
790
882
  aliases: ["ls"],
791
- builder: (yargs21) => withFormatOptions(
792
- withApiOptions(
793
- withProjectOptions(
794
- yargs21.options({
795
- offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
796
- limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
797
- })
883
+ builder: (yargs23) => withConfiguration(
884
+ withFormatOptions(
885
+ withApiOptions(
886
+ withProjectOptions(
887
+ yargs23.options({
888
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
889
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
890
+ })
891
+ )
798
892
  )
799
893
  )
800
894
  ),
801
895
  handler: async ({ apiHost, apiKey, proxy, limit, offset, format, filename, project: projectId }) => {
802
896
  const fetch3 = nodeFetchProxy(proxy);
803
- const client = new UncachedCanvasClient6({ apiKey, apiHost, fetch: fetch3, projectId });
897
+ const client = new UncachedCanvasClient2({ apiKey, apiHost, fetch: fetch3, projectId });
804
898
  const res = await client.getComponentDefinitions({ limit, offset });
805
899
  emitWithFormat(res.componentDefinitions, format, filename);
806
900
  }
807
901
  };
808
902
 
809
903
  // src/commands/canvas/commands/component/pull.ts
810
- import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canvas";
904
+ import { UncachedCanvasClient as UncachedCanvasClient3 } from "@uniformdev/canvas";
811
905
 
812
906
  // src/commands/canvas/componentDefinitionEngineDataSource.ts
813
907
  function createComponentDefinitionEngineDataSource({
@@ -845,30 +939,32 @@ function createComponentDefinitionEngineDataSource({
845
939
  var ComponentPullModule = {
846
940
  command: "pull <directory>",
847
941
  describe: "Pulls all component definitions to local files in a directory",
848
- builder: (yargs21) => withApiOptions(
849
- withProjectOptions(
850
- withDiffOptions(
851
- yargs21.positional("directory", {
852
- describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
853
- type: "string"
854
- }).option("format", {
855
- alias: ["f"],
856
- describe: "Output format",
857
- default: "yaml",
858
- choices: ["yaml", "json"],
859
- type: "string"
860
- }).option("what-if", {
861
- alias: ["w"],
862
- describe: "What-if mode reports what would be done but changes no files",
863
- default: false,
864
- type: "boolean"
865
- }).option("mode", {
866
- alias: ["m"],
867
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
868
- choices: ["create", "createOrUpdate", "mirror"],
869
- default: "mirror",
870
- type: "string"
871
- })
942
+ builder: (yargs23) => withConfiguration(
943
+ withApiOptions(
944
+ withProjectOptions(
945
+ withDiffOptions(
946
+ yargs23.positional("directory", {
947
+ describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
948
+ type: "string"
949
+ }).option("format", {
950
+ alias: ["f"],
951
+ describe: "Output format",
952
+ default: "yaml",
953
+ choices: ["yaml", "json"],
954
+ type: "string"
955
+ }).option("what-if", {
956
+ alias: ["w"],
957
+ describe: "What-if mode reports what would be done but changes no files",
958
+ default: false,
959
+ type: "boolean"
960
+ }).option("mode", {
961
+ alias: ["m"],
962
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
963
+ choices: ["create", "createOrUpdate", "mirror"],
964
+ default: "mirror",
965
+ type: "string"
966
+ })
967
+ )
872
968
  )
873
969
  )
874
970
  ),
@@ -884,7 +980,7 @@ var ComponentPullModule = {
884
980
  diff: diffMode
885
981
  }) => {
886
982
  const fetch3 = nodeFetchProxy(proxy);
887
- const client = new UncachedCanvasClient7({ apiKey, apiHost, fetch: fetch3, projectId });
983
+ const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId });
888
984
  const source = createComponentDefinitionEngineDataSource({ client });
889
985
  let target;
890
986
  const isPackage = isPathAPackageFile(directory);
@@ -919,28 +1015,30 @@ var ComponentPullModule = {
919
1015
  };
920
1016
 
921
1017
  // src/commands/canvas/commands/component/push.ts
922
- import { UncachedCanvasClient as UncachedCanvasClient8 } from "@uniformdev/canvas";
1018
+ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canvas";
923
1019
  var ComponentPushModule = {
924
1020
  command: "push <directory>",
925
1021
  describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
926
- builder: (yargs21) => withApiOptions(
927
- withProjectOptions(
928
- withDiffOptions(
929
- yargs21.positional("directory", {
930
- describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
931
- type: "string"
932
- }).option("what-if", {
933
- alias: ["w"],
934
- describe: "What-if mode reports what would be done but changes nothing",
935
- default: false,
936
- type: "boolean"
937
- }).option("mode", {
938
- alias: ["m"],
939
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
940
- choices: ["create", "createOrUpdate", "mirror"],
941
- default: "mirror",
942
- type: "string"
943
- })
1022
+ builder: (yargs23) => withConfiguration(
1023
+ withApiOptions(
1024
+ withProjectOptions(
1025
+ withDiffOptions(
1026
+ yargs23.positional("directory", {
1027
+ describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
1028
+ type: "string"
1029
+ }).option("what-if", {
1030
+ alias: ["w"],
1031
+ describe: "What-if mode reports what would be done but changes nothing",
1032
+ default: false,
1033
+ type: "boolean"
1034
+ }).option("mode", {
1035
+ alias: ["m"],
1036
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
1037
+ choices: ["create", "createOrUpdate", "mirror"],
1038
+ default: "mirror",
1039
+ type: "string"
1040
+ })
1041
+ )
944
1042
  )
945
1043
  )
946
1044
  ),
@@ -955,7 +1053,7 @@ var ComponentPushModule = {
955
1053
  diff: diffMode
956
1054
  }) => {
957
1055
  const fetch3 = nodeFetchProxy(proxy);
958
- const client = new UncachedCanvasClient8({ apiKey, apiHost, fetch: fetch3, projectId });
1056
+ const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId });
959
1057
  let source;
960
1058
  const isPackage = isPathAPackageFile(directory);
961
1059
  if (isPackage) {
@@ -985,37 +1083,41 @@ var ComponentPushModule = {
985
1083
  };
986
1084
 
987
1085
  // src/commands/canvas/commands/component/remove.ts
988
- import { UncachedCanvasClient as UncachedCanvasClient9 } from "@uniformdev/canvas";
1086
+ import { UncachedCanvasClient as UncachedCanvasClient5 } from "@uniformdev/canvas";
989
1087
  var ComponentRemoveModule = {
990
1088
  command: "remove <id>",
991
1089
  aliases: ["delete", "rm"],
992
1090
  describe: "Delete a component definition",
993
- builder: (yargs21) => withApiOptions(
994
- withProjectOptions(
995
- yargs21.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
1091
+ builder: (yargs23) => withConfiguration(
1092
+ withApiOptions(
1093
+ withProjectOptions(
1094
+ yargs23.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
1095
+ )
996
1096
  )
997
1097
  ),
998
1098
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
999
1099
  const fetch3 = nodeFetchProxy(proxy);
1000
- const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
1100
+ const client = new UncachedCanvasClient5({ apiKey, apiHost, fetch: fetch3, projectId });
1001
1101
  await client.removeComponentDefinition({ componentId: id });
1002
1102
  }
1003
1103
  };
1004
1104
 
1005
1105
  // src/commands/canvas/commands/component/update.ts
1006
- import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canvas";
1106
+ import { UncachedCanvasClient as UncachedCanvasClient6 } from "@uniformdev/canvas";
1007
1107
  var ComponentUpdateModule = {
1008
1108
  command: "update <filename>",
1009
1109
  aliases: ["put"],
1010
1110
  describe: "Insert or update a component definition",
1011
- builder: (yargs21) => withApiOptions(
1012
- withProjectOptions(
1013
- yargs21.positional("filename", { demandOption: true, describe: "Component definition file to put" })
1111
+ builder: (yargs23) => withConfiguration(
1112
+ withApiOptions(
1113
+ withProjectOptions(
1114
+ yargs23.positional("filename", { demandOption: true, describe: "Component definition file to put" })
1115
+ )
1014
1116
  )
1015
1117
  ),
1016
1118
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
1017
1119
  const fetch3 = nodeFetchProxy(proxy);
1018
- const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
1120
+ const client = new UncachedCanvasClient6({ apiKey, apiHost, fetch: fetch3, projectId });
1019
1121
  const file = readFileToObject(filename);
1020
1122
  await client.updateComponentDefinition({ componentDefinition: file });
1021
1123
  }
@@ -1026,7 +1128,7 @@ var ComponentModule = {
1026
1128
  command: "component <command>",
1027
1129
  aliases: ["def"],
1028
1130
  describe: "Commands for Canvas component definitions",
1029
- builder: (yargs21) => yargs21.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
1131
+ builder: (yargs23) => yargs23.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
1030
1132
  handler: () => {
1031
1133
  yargs2.help();
1032
1134
  }
@@ -1036,7 +1138,7 @@ var ComponentModule = {
1036
1138
  import yargs3 from "yargs";
1037
1139
 
1038
1140
  // src/commands/canvas/commands/composition/get.ts
1039
- import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canvas";
1141
+ import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canvas";
1040
1142
 
1041
1143
  // src/commands/canvas/util.ts
1042
1144
  import { CANVAS_DRAFT_STATE, CANVAS_PUBLISHED_STATE } from "@uniformdev/canvas";
@@ -1048,8 +1150,8 @@ function prepCompositionForDisk(composition) {
1048
1150
  delete prepped.state;
1049
1151
  return prepped;
1050
1152
  }
1051
- function withStateOptions(yargs21) {
1052
- return yargs21.option("state", {
1153
+ function withStateOptions(yargs23) {
1154
+ return yargs23.option("state", {
1053
1155
  type: "string",
1054
1156
  describe: `Composition state to fetch.`,
1055
1157
  choices: ["preview", "published"],
@@ -1074,37 +1176,39 @@ function convertCompositionState(state) {
1074
1176
  var CompositionGetModule = {
1075
1177
  command: "get <id>",
1076
1178
  describe: "Fetch a composition",
1077
- builder: (yargs21) => withFormatOptions(
1078
- withApiOptions(
1079
- withProjectOptions(
1080
- withStateOptions(
1081
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to fetch" }).option({
1082
- resolvePatterns: {
1083
- type: "boolean",
1084
- default: false,
1085
- describe: "Resolve pattern references in the composition"
1086
- },
1087
- resolveOverrides: {
1088
- type: "boolean",
1089
- default: false,
1090
- describe: "Resolves pattern overrides in the composition and removes override definition data"
1091
- },
1092
- componentIDs: {
1093
- type: "boolean",
1094
- default: false,
1095
- describe: "Include individual component UIDs"
1096
- },
1097
- resolveData: {
1098
- type: "boolean",
1099
- default: false,
1100
- describe: "Resolve all data resources used by the composition"
1101
- },
1102
- diagnostics: {
1103
- type: "boolean",
1104
- default: false,
1105
- describe: "Include diagnostics information when resolving data"
1106
- }
1107
- })
1179
+ builder: (yargs23) => withFormatOptions(
1180
+ withConfiguration(
1181
+ withApiOptions(
1182
+ withProjectOptions(
1183
+ withStateOptions(
1184
+ yargs23.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
1185
+ resolvePatterns: {
1186
+ type: "boolean",
1187
+ default: false,
1188
+ describe: "Resolve pattern references in the composition"
1189
+ },
1190
+ resolveOverrides: {
1191
+ type: "boolean",
1192
+ default: false,
1193
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
1194
+ },
1195
+ componentIDs: {
1196
+ type: "boolean",
1197
+ default: false,
1198
+ describe: "Include individual component UIDs"
1199
+ },
1200
+ resolveData: {
1201
+ type: "boolean",
1202
+ default: false,
1203
+ describe: "Resolve all data resources used by the composition/pattern"
1204
+ },
1205
+ diagnostics: {
1206
+ type: "boolean",
1207
+ default: false,
1208
+ describe: "Include diagnostics information when resolving data"
1209
+ }
1210
+ })
1211
+ )
1108
1212
  )
1109
1213
  )
1110
1214
  )
@@ -1126,7 +1230,7 @@ var CompositionGetModule = {
1126
1230
  diagnostics
1127
1231
  }) => {
1128
1232
  const fetch3 = nodeFetchProxy(proxy);
1129
- const client = new UncachedCanvasClient11({ apiKey, edgeApiHost, apiHost, fetch: fetch3, projectId });
1233
+ const client = new UncachedCanvasClient7({ apiKey, edgeApiHost, apiHost, fetch: fetch3, projectId });
1130
1234
  const res = prepCompositionForDisk(
1131
1235
  await client.getCompositionById({
1132
1236
  compositionId: id,
@@ -1143,34 +1247,47 @@ var CompositionGetModule = {
1143
1247
  };
1144
1248
 
1145
1249
  // src/commands/canvas/commands/composition/list.ts
1146
- import { UncachedCanvasClient as UncachedCanvasClient12 } from "@uniformdev/canvas";
1250
+ import { UncachedCanvasClient as UncachedCanvasClient8 } from "@uniformdev/canvas";
1147
1251
  var CompositionListModule = {
1148
1252
  command: "list",
1149
1253
  describe: "List compositions",
1150
1254
  aliases: ["ls"],
1151
- builder: (yargs21) => withFormatOptions(
1152
- withApiOptions(
1153
- withProjectOptions(
1154
- withStateOptions(
1155
- yargs21.options({
1156
- offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
1157
- limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
1158
- resolvePatterns: {
1159
- type: "boolean",
1160
- default: false,
1161
- describe: "Resolve pattern references in the composition"
1162
- },
1163
- resolveOverrides: {
1164
- type: "boolean",
1165
- default: false,
1166
- describe: "Resolves pattern overrides in the composition and removes override definition data"
1167
- },
1168
- componentIDs: {
1169
- type: "boolean",
1170
- default: false,
1171
- describe: "Include individual component UIDs"
1172
- }
1173
- })
1255
+ builder: (yargs23) => withFormatOptions(
1256
+ withConfiguration(
1257
+ withApiOptions(
1258
+ withProjectOptions(
1259
+ withStateOptions(
1260
+ yargs23.options({
1261
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
1262
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
1263
+ resolvePatterns: {
1264
+ type: "boolean",
1265
+ default: false,
1266
+ describe: "Resolve pattern references in the composition"
1267
+ },
1268
+ resolveOverrides: {
1269
+ type: "boolean",
1270
+ default: false,
1271
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
1272
+ },
1273
+ onlyCompositions: {
1274
+ describe: "Only pulling compositions and not patterns",
1275
+ default: false,
1276
+ type: "boolean"
1277
+ },
1278
+ onlyPatterns: {
1279
+ describe: "Only pulling patterns and not compositions",
1280
+ default: false,
1281
+ type: "boolean",
1282
+ hidden: true
1283
+ },
1284
+ componentIDs: {
1285
+ type: "boolean",
1286
+ default: false,
1287
+ describe: "Include individual component UIDs"
1288
+ }
1289
+ })
1290
+ )
1174
1291
  )
1175
1292
  )
1176
1293
  )
@@ -1183,6 +1300,8 @@ var CompositionListModule = {
1183
1300
  offset,
1184
1301
  format,
1185
1302
  filename,
1303
+ onlyCompositions,
1304
+ onlyPatterns,
1186
1305
  project: projectId,
1187
1306
  state,
1188
1307
  resolvePatterns,
@@ -1190,10 +1309,11 @@ var CompositionListModule = {
1190
1309
  componentIDs
1191
1310
  }) => {
1192
1311
  const fetch3 = nodeFetchProxy(proxy);
1193
- const client = new UncachedCanvasClient12({ apiKey, apiHost, fetch: fetch3, projectId });
1312
+ const client = new UncachedCanvasClient8({ apiKey, apiHost, fetch: fetch3, projectId });
1194
1313
  const res = await client.getCompositionList({
1195
1314
  limit,
1196
1315
  offset,
1316
+ pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
1197
1317
  state: convertCompositionState(state),
1198
1318
  skipPatternResolution: !resolvePatterns,
1199
1319
  withComponentIDs: componentIDs,
@@ -1204,7 +1324,7 @@ var CompositionListModule = {
1204
1324
  };
1205
1325
 
1206
1326
  // src/commands/canvas/commands/composition/publish.ts
1207
- import { UncachedCanvasClient as UncachedCanvasClient13 } from "@uniformdev/canvas";
1327
+ import { UncachedCanvasClient as UncachedCanvasClient9 } from "@uniformdev/canvas";
1208
1328
 
1209
1329
  // src/commands/canvas/commands/composition/_util.ts
1210
1330
  var selectIdentifier3 = (component) => component.composition._id;
@@ -1214,6 +1334,8 @@ var selectDisplayName3 = (component) => `${component.composition._name ?? compon
1214
1334
  function createComponentInstanceEngineDataSource({
1215
1335
  client,
1216
1336
  state,
1337
+ onlyCompositions,
1338
+ onlyPatterns,
1217
1339
  ...clientOptions
1218
1340
  }) {
1219
1341
  const stateId = convertCompositionState(state);
@@ -1223,6 +1345,7 @@ function createComponentInstanceEngineDataSource({
1223
1345
  ...clientOptions,
1224
1346
  limit,
1225
1347
  offset,
1348
+ pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
1226
1349
  state: stateId,
1227
1350
  skipPatternResolution: true,
1228
1351
  skipOverridesResolution: true,
@@ -1253,45 +1376,38 @@ function createComponentInstanceEngineDataSource({
1253
1376
 
1254
1377
  // src/commands/canvas/commands/composition/publish.ts
1255
1378
  var CompositionPublishModule = {
1256
- command: "publish [compositionIDs]",
1379
+ command: "publish [ids]",
1257
1380
  describe: "Publishes compositions",
1258
- builder: (yargs21) => withApiOptions(
1259
- withProjectOptions(
1260
- withDiffOptions(
1261
- yargs21.positional("compositionIDs", {
1262
- describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
1263
- type: "string"
1264
- }).option("all", {
1265
- alias: ["a"],
1266
- describe: "Publishes all compositions. Use compositionId to publish one instead.",
1267
- default: false,
1268
- type: "boolean"
1269
- }).option("what-if", {
1270
- alias: ["w"],
1271
- describe: "What-if mode reports what would be done but does not perform any publishing",
1272
- default: false,
1273
- type: "boolean"
1274
- })
1381
+ builder: (yargs23) => withConfiguration(
1382
+ withApiOptions(
1383
+ withProjectOptions(
1384
+ withDiffOptions(
1385
+ yargs23.positional("ids", {
1386
+ describe: "Publishes composition/pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
1387
+ type: "string"
1388
+ }).option("all", {
1389
+ alias: ["a"],
1390
+ describe: "Publishes all compositions. Use compositionId to publish one instead.",
1391
+ default: false,
1392
+ type: "boolean"
1393
+ }).option("what-if", {
1394
+ alias: ["w"],
1395
+ describe: "What-if mode reports what would be done but does not perform any publishing",
1396
+ default: false,
1397
+ type: "boolean"
1398
+ })
1399
+ )
1275
1400
  )
1276
1401
  )
1277
1402
  ),
1278
- handler: async ({
1279
- apiHost,
1280
- apiKey,
1281
- proxy,
1282
- compositionIDs,
1283
- all,
1284
- whatIf,
1285
- project: projectId,
1286
- diff: diffMode
1287
- }) => {
1288
- if (!all && !compositionIDs || all && compositionIDs) {
1403
+ handler: async ({ apiHost, apiKey, proxy, ids, all, whatIf, project: projectId, diff: diffMode }) => {
1404
+ if (!all && !ids || all && ids) {
1289
1405
  console.error(`Specify --all or composition ID(s) to publish.`);
1290
1406
  process.exit(1);
1291
1407
  }
1292
- const compositionIDsArray = compositionIDs ? compositionIDs.split(",").map((id) => id.trim()) : void 0;
1408
+ const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
1293
1409
  const fetch3 = nodeFetchProxy(proxy);
1294
- const client = new UncachedCanvasClient13({ apiKey, apiHost, fetch: fetch3, projectId });
1410
+ const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
1295
1411
  const source = createComponentInstanceEngineDataSource({
1296
1412
  client,
1297
1413
  state: "preview",
@@ -1313,35 +1429,46 @@ var CompositionPublishModule = {
1313
1429
  };
1314
1430
 
1315
1431
  // src/commands/canvas/commands/composition/pull.ts
1316
- import { UncachedCanvasClient as UncachedCanvasClient14 } from "@uniformdev/canvas";
1432
+ import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canvas";
1317
1433
  var CompositionPullModule = {
1318
1434
  command: "pull <directory>",
1319
1435
  describe: "Pulls all compositions to local files in a directory",
1320
- builder: (yargs21) => withApiOptions(
1321
- withProjectOptions(
1322
- withStateOptions(
1323
- withDiffOptions(
1324
- yargs21.positional("directory", {
1325
- describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
1326
- type: "string"
1327
- }).option("format", {
1328
- alias: ["f"],
1329
- describe: "Output format",
1330
- default: "yaml",
1331
- choices: ["yaml", "json"],
1332
- type: "string"
1333
- }).option("what-if", {
1334
- alias: ["w"],
1335
- describe: "What-if mode reports what would be done but changes no files",
1336
- default: false,
1337
- type: "boolean"
1338
- }).option("mode", {
1339
- alias: ["m"],
1340
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
1341
- choices: ["create", "createOrUpdate", "mirror"],
1342
- default: "mirror",
1343
- type: "string"
1344
- })
1436
+ builder: (yargs23) => withConfiguration(
1437
+ withApiOptions(
1438
+ withProjectOptions(
1439
+ withStateOptions(
1440
+ withDiffOptions(
1441
+ yargs23.positional("directory", {
1442
+ describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
1443
+ type: "string"
1444
+ }).option("format", {
1445
+ alias: ["f"],
1446
+ describe: "Output format",
1447
+ default: "yaml",
1448
+ choices: ["yaml", "json"],
1449
+ type: "string"
1450
+ }).option("onlyCompositions", {
1451
+ describe: "Only pulling compositions and not patterns",
1452
+ default: false,
1453
+ type: "boolean"
1454
+ }).option("onlyPatterns", {
1455
+ describe: "Only pulling patterns and not compositions",
1456
+ default: false,
1457
+ type: "boolean",
1458
+ hidden: true
1459
+ }).option("what-if", {
1460
+ alias: ["w"],
1461
+ describe: "What-if mode reports what would be done but changes no files",
1462
+ default: false,
1463
+ type: "boolean"
1464
+ }).option("mode", {
1465
+ alias: ["m"],
1466
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
1467
+ choices: ["create", "createOrUpdate", "mirror"],
1468
+ default: "mirror",
1469
+ type: "string"
1470
+ })
1471
+ )
1345
1472
  )
1346
1473
  )
1347
1474
  )
@@ -1352,6 +1479,8 @@ var CompositionPullModule = {
1352
1479
  proxy,
1353
1480
  directory,
1354
1481
  format,
1482
+ onlyCompositions,
1483
+ onlyPatterns,
1355
1484
  mode,
1356
1485
  whatIf,
1357
1486
  state,
@@ -1359,8 +1488,8 @@ var CompositionPullModule = {
1359
1488
  diff: diffMode
1360
1489
  }) => {
1361
1490
  const fetch3 = nodeFetchProxy(proxy);
1362
- const client = new UncachedCanvasClient14({ apiKey, apiHost, fetch: fetch3, projectId });
1363
- const source = createComponentInstanceEngineDataSource({ client, state });
1491
+ const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
1492
+ const source = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
1364
1493
  const isPackage = isPathAPackageFile(directory);
1365
1494
  let target;
1366
1495
  if (isPackage) {
@@ -1393,29 +1522,40 @@ var CompositionPullModule = {
1393
1522
  };
1394
1523
 
1395
1524
  // src/commands/canvas/commands/composition/push.ts
1396
- import { UncachedCanvasClient as UncachedCanvasClient15 } from "@uniformdev/canvas";
1525
+ import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canvas";
1397
1526
  var CompositionPushModule = {
1398
1527
  command: "push <directory>",
1399
1528
  describe: "Pushes all compositions from files in a directory to Uniform Canvas",
1400
- builder: (yargs21) => withApiOptions(
1401
- withProjectOptions(
1402
- withStateOptions(
1403
- withDiffOptions(
1404
- yargs21.positional("directory", {
1405
- describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
1406
- type: "string"
1407
- }).option("what-if", {
1408
- alias: ["w"],
1409
- describe: "What-if mode reports what would be done but changes nothing",
1410
- default: false,
1411
- type: "boolean"
1412
- }).option("mode", {
1413
- alias: ["m"],
1414
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
1415
- choices: ["create", "createOrUpdate", "mirror"],
1416
- default: "mirror",
1417
- type: "string"
1418
- })
1529
+ builder: (yargs23) => withConfiguration(
1530
+ withApiOptions(
1531
+ withProjectOptions(
1532
+ withStateOptions(
1533
+ withDiffOptions(
1534
+ yargs23.positional("directory", {
1535
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
1536
+ type: "string"
1537
+ }).option("what-if", {
1538
+ alias: ["w"],
1539
+ describe: "What-if mode reports what would be done but changes nothing",
1540
+ default: false,
1541
+ type: "boolean"
1542
+ }).option("mode", {
1543
+ alias: ["m"],
1544
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
1545
+ choices: ["create", "createOrUpdate", "mirror"],
1546
+ default: "mirror",
1547
+ type: "string"
1548
+ }).option("onlyCompositions", {
1549
+ describe: "Only pulling compositions and not patterns",
1550
+ default: false,
1551
+ type: "boolean"
1552
+ }).option("onlyPatterns", {
1553
+ describe: "Only pulling patterns and not compositions",
1554
+ default: false,
1555
+ type: "boolean",
1556
+ hidden: true
1557
+ })
1558
+ )
1419
1559
  )
1420
1560
  )
1421
1561
  )
@@ -1429,10 +1569,12 @@ var CompositionPushModule = {
1429
1569
  whatIf,
1430
1570
  state,
1431
1571
  project: projectId,
1572
+ onlyCompositions,
1573
+ onlyPatterns,
1432
1574
  diff: diffMode
1433
1575
  }) => {
1434
1576
  const fetch3 = nodeFetchProxy(proxy);
1435
- const client = new UncachedCanvasClient15({ apiKey, apiHost, fetch: fetch3, projectId });
1577
+ const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId });
1436
1578
  let source;
1437
1579
  const isPackage = isPathAPackageFile(directory);
1438
1580
  if (isPackage) {
@@ -1449,7 +1591,7 @@ var CompositionPushModule = {
1449
1591
  selectDisplayName: selectDisplayName3
1450
1592
  });
1451
1593
  }
1452
- const target = createComponentInstanceEngineDataSource({ client, state });
1594
+ const target = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
1453
1595
  await syncEngine({
1454
1596
  source,
1455
1597
  target,
@@ -1461,56 +1603,65 @@ var CompositionPushModule = {
1461
1603
  };
1462
1604
 
1463
1605
  // src/commands/canvas/commands/composition/remove.ts
1464
- import { UncachedCanvasClient as UncachedCanvasClient16 } from "@uniformdev/canvas";
1606
+ import { UncachedCanvasClient as UncachedCanvasClient12 } from "@uniformdev/canvas";
1465
1607
  var CompositionRemoveModule = {
1466
1608
  command: "remove <id>",
1467
1609
  aliases: ["delete", "rm"],
1468
1610
  describe: "Delete a composition",
1469
- builder: (yargs21) => withApiOptions(
1470
- withProjectOptions(
1471
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to delete" })
1611
+ builder: (yargs23) => withConfiguration(
1612
+ withApiOptions(
1613
+ withProjectOptions(
1614
+ yargs23.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
1615
+ )
1472
1616
  )
1473
1617
  ),
1474
1618
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
1475
1619
  const fetch3 = nodeFetchProxy(proxy);
1476
- const client = new UncachedCanvasClient16({ apiKey, apiHost, fetch: fetch3, projectId });
1620
+ const client = new UncachedCanvasClient12({ apiKey, apiHost, fetch: fetch3, projectId });
1477
1621
  await client.removeComposition({ compositionId: id });
1478
1622
  }
1479
1623
  };
1480
1624
 
1481
1625
  // src/commands/canvas/commands/composition/unpublish.ts
1482
- import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2, UncachedCanvasClient as UncachedCanvasClient17 } from "@uniformdev/canvas";
1626
+ import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2, UncachedCanvasClient as UncachedCanvasClient13 } from "@uniformdev/canvas";
1483
1627
  var CompositionUnpublishModule = {
1484
1628
  command: "unpublish <id>",
1485
1629
  describe: "Unpublish a composition",
1486
- builder: (yargs21) => withApiOptions(
1487
- withProjectOptions(
1488
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to unpublish" })
1630
+ builder: (yargs23) => withConfiguration(
1631
+ withApiOptions(
1632
+ withProjectOptions(
1633
+ yargs23.positional("id", {
1634
+ demandOption: true,
1635
+ describe: "Composition/pattern public ID to unpublish"
1636
+ })
1637
+ )
1489
1638
  )
1490
1639
  ),
1491
1640
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
1492
1641
  const fetch3 = nodeFetchProxy(proxy);
1493
- const client = new UncachedCanvasClient17({ apiKey, apiHost, fetch: fetch3, projectId });
1642
+ const client = new UncachedCanvasClient13({ apiKey, apiHost, fetch: fetch3, projectId });
1494
1643
  await client.removeComposition({ compositionId: id, state: CANVAS_PUBLISHED_STATE2 });
1495
1644
  }
1496
1645
  };
1497
1646
 
1498
1647
  // src/commands/canvas/commands/composition/update.ts
1499
- import { UncachedCanvasClient as UncachedCanvasClient18 } from "@uniformdev/canvas";
1648
+ import { UncachedCanvasClient as UncachedCanvasClient14 } from "@uniformdev/canvas";
1500
1649
  var CompositionUpdateModule = {
1501
1650
  command: "update <filename>",
1502
1651
  aliases: ["put"],
1503
1652
  describe: "Insert or update a composition",
1504
- builder: (yargs21) => withApiOptions(
1505
- withProjectOptions(
1506
- withStateOptions(
1507
- yargs21.positional("filename", { demandOption: true, describe: "Composition file to put" })
1653
+ builder: (yargs23) => withConfiguration(
1654
+ withApiOptions(
1655
+ withProjectOptions(
1656
+ withStateOptions(
1657
+ yargs23.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
1658
+ )
1508
1659
  )
1509
1660
  )
1510
1661
  ),
1511
1662
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, state }) => {
1512
1663
  const fetch3 = nodeFetchProxy(proxy);
1513
- const client = new UncachedCanvasClient18({ apiKey, apiHost, fetch: fetch3, projectId });
1664
+ const client = new UncachedCanvasClient14({ apiKey, apiHost, fetch: fetch3, projectId });
1514
1665
  const file = readFileToObject(filename);
1515
1666
  await client.updateComposition({ ...file, state: convertCompositionState(state) });
1516
1667
  }
@@ -1521,7 +1672,7 @@ var CompositionModule = {
1521
1672
  command: "composition <command>",
1522
1673
  describe: "Commands for Canvas compositions",
1523
1674
  aliases: ["comp"],
1524
- builder: (yargs21) => yargs21.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
1675
+ builder: (yargs23) => yargs23.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
1525
1676
  handler: () => {
1526
1677
  yargs3.help();
1527
1678
  }
@@ -1536,11 +1687,13 @@ var DataTypeGetModule = {
1536
1687
  command: "get <id>",
1537
1688
  describe: "Get a data type",
1538
1689
  aliases: ["ls"],
1539
- builder: (yargs21) => withFormatOptions(
1540
- withApiOptions(
1541
- withProjectOptions(
1542
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1543
- yargs21.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
1690
+ builder: (yargs23) => withConfiguration(
1691
+ withFormatOptions(
1692
+ withApiOptions(
1693
+ withProjectOptions(
1694
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1695
+ yargs23.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
1696
+ )
1544
1697
  )
1545
1698
  )
1546
1699
  ),
@@ -1562,7 +1715,7 @@ var DataTypeListModule = {
1562
1715
  command: "list",
1563
1716
  describe: "List data types",
1564
1717
  aliases: ["ls"],
1565
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
1718
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
1566
1719
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
1567
1720
  const fetch3 = nodeFetchProxy(proxy);
1568
1721
  const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
@@ -1611,30 +1764,32 @@ function createDataTypeEngineDataSource({
1611
1764
  var DataTypePullModule = {
1612
1765
  command: "pull <directory>",
1613
1766
  describe: "Pulls all data types to local files in a directory",
1614
- builder: (yargs21) => withApiOptions(
1615
- withProjectOptions(
1616
- withDiffOptions(
1617
- yargs21.positional("directory", {
1618
- describe: "Directory to save the data types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
1619
- type: "string"
1620
- }).option("format", {
1621
- alias: ["f"],
1622
- describe: "Output format",
1623
- default: "yaml",
1624
- choices: ["yaml", "json"],
1625
- type: "string"
1626
- }).option("what-if", {
1627
- alias: ["w"],
1628
- describe: "What-if mode reports what would be done but changes no files",
1629
- default: false,
1630
- type: "boolean"
1631
- }).option("mode", {
1632
- alias: ["m"],
1633
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
1634
- choices: ["create", "createOrUpdate", "mirror"],
1635
- default: "mirror",
1636
- type: "string"
1637
- })
1767
+ builder: (yargs23) => withConfiguration(
1768
+ withApiOptions(
1769
+ withProjectOptions(
1770
+ withDiffOptions(
1771
+ yargs23.positional("directory", {
1772
+ describe: "Directory to save the data types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
1773
+ type: "string"
1774
+ }).option("format", {
1775
+ alias: ["f"],
1776
+ describe: "Output format",
1777
+ default: "yaml",
1778
+ choices: ["yaml", "json"],
1779
+ type: "string"
1780
+ }).option("what-if", {
1781
+ alias: ["w"],
1782
+ describe: "What-if mode reports what would be done but changes no files",
1783
+ default: false,
1784
+ type: "boolean"
1785
+ }).option("mode", {
1786
+ alias: ["m"],
1787
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
1788
+ choices: ["create", "createOrUpdate", "mirror"],
1789
+ default: "mirror",
1790
+ type: "string"
1791
+ })
1792
+ )
1638
1793
  )
1639
1794
  )
1640
1795
  ),
@@ -1694,24 +1849,26 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
1694
1849
  var DataTypePushModule = {
1695
1850
  command: "push <directory>",
1696
1851
  describe: "Pushes all data types from files in a directory to Uniform",
1697
- builder: (yargs21) => withApiOptions(
1698
- withProjectOptions(
1699
- withDiffOptions(
1700
- yargs21.positional("directory", {
1701
- describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
1702
- type: "string"
1703
- }).option("what-if", {
1704
- alias: ["w"],
1705
- describe: "What-if mode reports what would be done but changes nothing",
1706
- default: false,
1707
- type: "boolean"
1708
- }).option("mode", {
1709
- alias: ["m"],
1710
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
1711
- choices: ["create", "createOrUpdate", "mirror"],
1712
- default: "mirror",
1713
- type: "string"
1714
- })
1852
+ builder: (yargs23) => withConfiguration(
1853
+ withApiOptions(
1854
+ withProjectOptions(
1855
+ withDiffOptions(
1856
+ yargs23.positional("directory", {
1857
+ describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
1858
+ type: "string"
1859
+ }).option("what-if", {
1860
+ alias: ["w"],
1861
+ describe: "What-if mode reports what would be done but changes nothing",
1862
+ default: false,
1863
+ type: "boolean"
1864
+ }).option("mode", {
1865
+ alias: ["m"],
1866
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
1867
+ choices: ["create", "createOrUpdate", "mirror"],
1868
+ default: "mirror",
1869
+ type: "string"
1870
+ })
1871
+ )
1715
1872
  )
1716
1873
  )
1717
1874
  ),
@@ -1766,9 +1923,11 @@ var DataTypeRemoveModule = {
1766
1923
  command: "remove <id>",
1767
1924
  aliases: ["delete", "rm"],
1768
1925
  describe: "Delete a data type",
1769
- builder: (yargs21) => withApiOptions(
1770
- withProjectOptions(
1771
- yargs21.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
1926
+ builder: (yargs23) => withConfiguration(
1927
+ withApiOptions(
1928
+ withProjectOptions(
1929
+ yargs23.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
1930
+ )
1772
1931
  )
1773
1932
  ),
1774
1933
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1784,9 +1943,11 @@ var DataTypeUpdateModule = {
1784
1943
  command: "update <filename>",
1785
1944
  aliases: ["put"],
1786
1945
  describe: "Insert or update a data type",
1787
- builder: (yargs21) => withApiOptions(
1788
- withProjectOptions(
1789
- yargs21.positional("filename", { demandOption: true, describe: "Data type file to put" })
1946
+ builder: (yargs23) => withConfiguration(
1947
+ withApiOptions(
1948
+ withProjectOptions(
1949
+ yargs23.positional("filename", { demandOption: true, describe: "Data type file to put" })
1950
+ )
1790
1951
  )
1791
1952
  ),
1792
1953
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -1802,38 +1963,206 @@ var DataTypeModule = {
1802
1963
  command: "datatype <command>",
1803
1964
  aliases: ["dt"],
1804
1965
  describe: "Commands for Data Type definitions",
1805
- builder: (yargs21) => yargs21.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
1966
+ builder: (yargs23) => yargs23.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
1806
1967
  handler: () => {
1807
1968
  yargs4.help();
1808
1969
  }
1809
1970
  };
1810
1971
 
1972
+ // src/commands/canvas/commands/pattern.ts
1973
+ import yargs5 from "yargs";
1974
+
1975
+ // src/commands/canvas/commands/pattern/get.ts
1976
+ var PatternGetModule = {
1977
+ ...CompositionGetModule,
1978
+ describe: "Fetch a pattern"
1979
+ };
1980
+
1981
+ // src/commands/canvas/commands/pattern/list.ts
1982
+ var PatternListModule = {
1983
+ ...CompositionListModule,
1984
+ describe: "List patterns",
1985
+ builder: (yargs23) => withFormatOptions(
1986
+ withConfiguration(
1987
+ withApiOptions(
1988
+ withProjectOptions(
1989
+ withStateOptions(
1990
+ yargs23.options({
1991
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
1992
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
1993
+ resolvePatterns: {
1994
+ type: "boolean",
1995
+ default: false,
1996
+ describe: "Resolve pattern references in the composition"
1997
+ },
1998
+ resolveOverrides: {
1999
+ type: "boolean",
2000
+ default: false,
2001
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
2002
+ },
2003
+ onlyPatterns: {
2004
+ describe: "Only pulling patterns and not compositions",
2005
+ // This default differentiate this list command from composition list command
2006
+ default: true,
2007
+ type: "boolean",
2008
+ hidden: true
2009
+ },
2010
+ componentIDs: {
2011
+ alias: ["componentIDs"],
2012
+ type: "boolean",
2013
+ default: false,
2014
+ describe: "Include individual component UIDs"
2015
+ }
2016
+ })
2017
+ )
2018
+ )
2019
+ )
2020
+ )
2021
+ )
2022
+ };
2023
+
2024
+ // src/commands/canvas/commands/pattern/publish.ts
2025
+ var PatternPublishModule = {
2026
+ ...CompositionPublishModule,
2027
+ describe: "Publishes patterns"
2028
+ };
2029
+
2030
+ // src/commands/canvas/commands/pattern/pull.ts
2031
+ var PatternPullModule = {
2032
+ ...CompositionPullModule,
2033
+ describe: "Pulls all patterns to local files in a directory",
2034
+ builder: (yargs23) => withConfiguration(
2035
+ withApiOptions(
2036
+ withProjectOptions(
2037
+ withStateOptions(
2038
+ withDiffOptions(
2039
+ yargs23.positional("directory", {
2040
+ describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2041
+ type: "string"
2042
+ }).option("format", {
2043
+ alias: ["f"],
2044
+ describe: "Output format",
2045
+ default: "yaml",
2046
+ choices: ["yaml", "json"],
2047
+ type: "string"
2048
+ }).option("onlyPatterns", {
2049
+ describe: "Only pulling patterns and not compositions",
2050
+ // This default differentiate this list command from composition list command
2051
+ default: true,
2052
+ type: "boolean",
2053
+ hidden: true
2054
+ }).option("what-if", {
2055
+ alias: ["w"],
2056
+ describe: "What-if mode reports what would be done but changes no files",
2057
+ default: false,
2058
+ type: "boolean"
2059
+ }).option("mode", {
2060
+ alias: ["m"],
2061
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2062
+ choices: ["create", "createOrUpdate", "mirror"],
2063
+ default: "mirror",
2064
+ type: "string"
2065
+ })
2066
+ )
2067
+ )
2068
+ )
2069
+ )
2070
+ )
2071
+ };
2072
+
2073
+ // src/commands/canvas/commands/pattern/push.ts
2074
+ var PatternPushModule = {
2075
+ ...CompositionPushModule,
2076
+ describe: "Pushes all patterns from files in a directory to Uniform Canvas",
2077
+ builder: (yargs23) => withConfiguration(
2078
+ withApiOptions(
2079
+ withProjectOptions(
2080
+ withStateOptions(
2081
+ withDiffOptions(
2082
+ yargs23.positional("directory", {
2083
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
2084
+ type: "string"
2085
+ }).option("what-if", {
2086
+ alias: ["w"],
2087
+ describe: "What-if mode reports what would be done but changes nothing",
2088
+ default: false,
2089
+ type: "boolean"
2090
+ }).option("mode", {
2091
+ alias: ["m"],
2092
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2093
+ choices: ["create", "createOrUpdate", "mirror"],
2094
+ default: "mirror",
2095
+ type: "string"
2096
+ }).option("onlyPatterns", {
2097
+ describe: "Only pulling patterns and not compositions",
2098
+ // This default differentiate this list command from composition list command
2099
+ default: true,
2100
+ type: "boolean",
2101
+ hidden: true
2102
+ })
2103
+ )
2104
+ )
2105
+ )
2106
+ )
2107
+ )
2108
+ };
2109
+
2110
+ // src/commands/canvas/commands/pattern/remove.ts
2111
+ var PatternRemoveModule = {
2112
+ ...CompositionRemoveModule,
2113
+ describe: "Delete a pattern"
2114
+ };
2115
+
2116
+ // src/commands/canvas/commands/pattern/unpublish.ts
2117
+ var PatternUnpublishModule = {
2118
+ ...CompositionUnpublishModule,
2119
+ describe: "Unpublish a pattern"
2120
+ };
2121
+
2122
+ // src/commands/canvas/commands/pattern/update.ts
2123
+ var PatternUpdateModule = {
2124
+ ...CompositionUpdateModule,
2125
+ describe: "Insert or update a pattern"
2126
+ };
2127
+
2128
+ // src/commands/canvas/commands/pattern.ts
2129
+ var PatternModule = {
2130
+ command: "pattern <command>",
2131
+ describe: "Commands for Canvas patterns",
2132
+ builder: (yargs23) => yargs23.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
2133
+ handler: () => {
2134
+ yargs5.help();
2135
+ }
2136
+ };
2137
+
1811
2138
  // src/commands/canvas/index.ts
1812
2139
  var CanvasCommand = {
1813
2140
  command: "canvas <command>",
1814
2141
  aliases: ["cv", "pm", "presentation"],
1815
2142
  describe: "Uniform Canvas commands",
1816
- builder: (yargs21) => yargs21.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).demandCommand(),
2143
+ builder: (yargs23) => yargs23.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).command(PatternModule).demandCommand(),
1817
2144
  handler: () => {
1818
- yargs5.showHelp();
2145
+ yargs6.showHelp();
1819
2146
  }
1820
2147
  };
1821
2148
 
1822
2149
  // src/commands/context/index.ts
1823
- import yargs12 from "yargs";
2150
+ import yargs13 from "yargs";
1824
2151
 
1825
2152
  // src/commands/context/commands/aggregate.ts
1826
- import yargs6 from "yargs";
2153
+ import yargs7 from "yargs";
1827
2154
 
1828
2155
  // src/commands/context/commands/aggregate/get.ts
1829
2156
  import { UncachedAggregateClient } from "@uniformdev/context/api";
1830
2157
  var AggregateGetModule = {
1831
2158
  command: "get <id>",
1832
2159
  describe: "Fetch an aggregate",
1833
- builder: (yargs21) => withFormatOptions(
1834
- withApiOptions(
1835
- withProjectOptions(
1836
- yargs21.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
2160
+ builder: (yargs23) => withConfiguration(
2161
+ withFormatOptions(
2162
+ withApiOptions(
2163
+ withProjectOptions(
2164
+ yargs23.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
2165
+ )
1837
2166
  )
1838
2167
  )
1839
2168
  ),
@@ -1856,7 +2185,7 @@ var AggregateListModule = {
1856
2185
  command: "list",
1857
2186
  describe: "List aggregates",
1858
2187
  aliases: ["ls"],
1859
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
2188
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
1860
2189
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
1861
2190
  const fetch3 = nodeFetchProxy(proxy);
1862
2191
  const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -1922,30 +2251,32 @@ function writeContextPackage(filename, packageContents) {
1922
2251
  var AggregatePullModule = {
1923
2252
  command: "pull <directory>",
1924
2253
  describe: "Pulls all aggregates to local files in a directory",
1925
- builder: (yargs21) => withApiOptions(
1926
- withProjectOptions(
1927
- withDiffOptions(
1928
- yargs21.positional("directory", {
1929
- describe: "Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
1930
- type: "string"
1931
- }).option("format", {
1932
- alias: ["f"],
1933
- describe: "Output format",
1934
- default: "yaml",
1935
- choices: ["yaml", "json"],
1936
- type: "string"
1937
- }).option("what-if", {
1938
- alias: ["w"],
1939
- describe: "What-if mode reports what would be done but changes no files",
1940
- default: false,
1941
- type: "boolean"
1942
- }).option("mode", {
1943
- alias: ["m"],
1944
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
1945
- choices: ["create", "createOrUpdate", "mirror"],
1946
- default: "mirror",
1947
- type: "string"
1948
- })
2254
+ builder: (yargs23) => withConfiguration(
2255
+ withApiOptions(
2256
+ withProjectOptions(
2257
+ withDiffOptions(
2258
+ yargs23.positional("directory", {
2259
+ describe: "Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2260
+ type: "string"
2261
+ }).option("format", {
2262
+ alias: ["f"],
2263
+ describe: "Output format",
2264
+ default: "yaml",
2265
+ choices: ["yaml", "json"],
2266
+ type: "string"
2267
+ }).option("what-if", {
2268
+ alias: ["w"],
2269
+ describe: "What-if mode reports what would be done but changes no files",
2270
+ default: false,
2271
+ type: "boolean"
2272
+ }).option("mode", {
2273
+ alias: ["m"],
2274
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2275
+ choices: ["create", "createOrUpdate", "mirror"],
2276
+ default: "mirror",
2277
+ type: "string"
2278
+ })
2279
+ )
1949
2280
  )
1950
2281
  )
1951
2282
  ),
@@ -1999,24 +2330,26 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
1999
2330
  var AggregatePushModule = {
2000
2331
  command: "push <directory>",
2001
2332
  describe: "Pushes all aggregates from files in a directory or package to Uniform",
2002
- builder: (yargs21) => withApiOptions(
2003
- withProjectOptions(
2004
- withDiffOptions(
2005
- yargs21.positional("directory", {
2006
- describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
2007
- type: "string"
2008
- }).option("what-if", {
2009
- alias: ["w"],
2010
- describe: "What-if mode reports what would be done but changes nothing",
2011
- default: false,
2012
- type: "boolean"
2013
- }).option("mode", {
2014
- alias: ["m"],
2015
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2016
- choices: ["create", "createOrUpdate", "mirror"],
2017
- default: "mirror",
2018
- type: "string"
2019
- })
2333
+ builder: (yargs23) => withConfiguration(
2334
+ withApiOptions(
2335
+ withProjectOptions(
2336
+ withDiffOptions(
2337
+ yargs23.positional("directory", {
2338
+ describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
2339
+ type: "string"
2340
+ }).option("what-if", {
2341
+ alias: ["w"],
2342
+ describe: "What-if mode reports what would be done but changes nothing",
2343
+ default: false,
2344
+ type: "boolean"
2345
+ }).option("mode", {
2346
+ alias: ["m"],
2347
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2348
+ choices: ["create", "createOrUpdate", "mirror"],
2349
+ default: "mirror",
2350
+ type: "string"
2351
+ })
2352
+ )
2020
2353
  )
2021
2354
  )
2022
2355
  ),
@@ -2066,9 +2399,11 @@ var AggregateRemoveModule = {
2066
2399
  command: "remove <id>",
2067
2400
  aliases: ["delete", "rm"],
2068
2401
  describe: "Delete an aggregate",
2069
- builder: (yargs21) => withApiOptions(
2070
- withProjectOptions(
2071
- yargs21.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
2402
+ builder: (yargs23) => withConfiguration(
2403
+ withApiOptions(
2404
+ withProjectOptions(
2405
+ yargs23.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
2406
+ )
2072
2407
  )
2073
2408
  ),
2074
2409
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2084,9 +2419,11 @@ var AggregateUpdateModule = {
2084
2419
  command: "update <filename>",
2085
2420
  aliases: ["put"],
2086
2421
  describe: "Insert or update an aggregate",
2087
- builder: (yargs21) => withApiOptions(
2088
- withProjectOptions(
2089
- yargs21.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
2422
+ builder: (yargs23) => withConfiguration(
2423
+ withApiOptions(
2424
+ withProjectOptions(
2425
+ yargs23.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
2426
+ )
2090
2427
  )
2091
2428
  ),
2092
2429
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -2102,24 +2439,26 @@ var AggregateModule = {
2102
2439
  command: "aggregate <command>",
2103
2440
  aliases: ["agg", "intent", "audience"],
2104
2441
  describe: "Commands for Context aggregates (intents, audiences)",
2105
- builder: (yargs21) => yargs21.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
2442
+ builder: (yargs23) => yargs23.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
2106
2443
  handler: () => {
2107
- yargs6.help();
2444
+ yargs7.help();
2108
2445
  }
2109
2446
  };
2110
2447
 
2111
2448
  // src/commands/context/commands/enrichment.ts
2112
- import yargs7 from "yargs";
2449
+ import yargs8 from "yargs";
2113
2450
 
2114
2451
  // src/commands/context/commands/enrichment/get.ts
2115
2452
  import { UncachedEnrichmentClient } from "@uniformdev/context/api";
2116
2453
  var EnrichmentGetModule = {
2117
2454
  command: "get <id>",
2118
2455
  describe: "Fetch an enrichment category and its values",
2119
- builder: (yargs21) => withFormatOptions(
2120
- withApiOptions(
2121
- withProjectOptions(
2122
- yargs21.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
2456
+ builder: (yargs23) => withFormatOptions(
2457
+ withConfiguration(
2458
+ withApiOptions(
2459
+ withProjectOptions(
2460
+ yargs23.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
2461
+ )
2123
2462
  )
2124
2463
  )
2125
2464
  ),
@@ -2143,7 +2482,7 @@ var EnrichmentListModule = {
2143
2482
  command: "list",
2144
2483
  describe: "List enrichments",
2145
2484
  aliases: ["ls"],
2146
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
2485
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
2147
2486
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
2148
2487
  const fetch3 = nodeFetchProxy(proxy);
2149
2488
  const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -2244,30 +2583,32 @@ var createEnrichmentValueEngineDataSource = ({
2244
2583
  var EnrichmentPullModule = {
2245
2584
  command: "pull <directory>",
2246
2585
  describe: "Pulls all enrichments to local files in a directory",
2247
- builder: (yargs21) => withApiOptions(
2248
- withProjectOptions(
2249
- withDiffOptions(
2250
- yargs21.positional("directory", {
2251
- describe: "Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2252
- type: "string"
2253
- }).option("format", {
2254
- alias: ["f"],
2255
- describe: "Output format",
2256
- default: "yaml",
2257
- choices: ["yaml", "json"],
2258
- type: "string"
2259
- }).option("what-if", {
2260
- alias: ["w"],
2261
- describe: "What-if mode reports what would be done but changes no files",
2262
- default: false,
2263
- type: "boolean"
2264
- }).option("mode", {
2265
- alias: ["m"],
2266
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2267
- choices: ["create", "createOrUpdate", "mirror"],
2268
- default: "mirror",
2269
- type: "string"
2270
- })
2586
+ builder: (yargs23) => withConfiguration(
2587
+ withApiOptions(
2588
+ withProjectOptions(
2589
+ withDiffOptions(
2590
+ yargs23.positional("directory", {
2591
+ describe: "Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2592
+ type: "string"
2593
+ }).option("format", {
2594
+ alias: ["f"],
2595
+ describe: "Output format",
2596
+ default: "yaml",
2597
+ choices: ["yaml", "json"],
2598
+ type: "string"
2599
+ }).option("what-if", {
2600
+ alias: ["w"],
2601
+ describe: "What-if mode reports what would be done but changes no files",
2602
+ default: false,
2603
+ type: "boolean"
2604
+ }).option("mode", {
2605
+ alias: ["m"],
2606
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2607
+ choices: ["create", "createOrUpdate", "mirror"],
2608
+ default: "mirror",
2609
+ type: "string"
2610
+ })
2611
+ )
2271
2612
  )
2272
2613
  )
2273
2614
  ),
@@ -2321,24 +2662,26 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
2321
2662
  var EnrichmentPushModule = {
2322
2663
  command: "push <directory>",
2323
2664
  describe: "Pushes all enrichments from files in a directory or package to Uniform",
2324
- builder: (yargs21) => withApiOptions(
2325
- withProjectOptions(
2326
- withDiffOptions(
2327
- yargs21.positional("directory", {
2328
- describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
2329
- type: "string"
2330
- }).option("what-if", {
2331
- alias: ["w"],
2332
- describe: "What-if mode reports what would be done but changes nothing",
2333
- default: false,
2334
- type: "boolean"
2335
- }).option("mode", {
2336
- alias: ["m"],
2337
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2338
- choices: ["create", "createOrUpdate", "mirror"],
2339
- default: "mirror",
2340
- type: "string"
2341
- })
2665
+ builder: (yargs23) => withConfiguration(
2666
+ withApiOptions(
2667
+ withProjectOptions(
2668
+ withDiffOptions(
2669
+ yargs23.positional("directory", {
2670
+ describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
2671
+ type: "string"
2672
+ }).option("what-if", {
2673
+ alias: ["w"],
2674
+ describe: "What-if mode reports what would be done but changes nothing",
2675
+ default: false,
2676
+ type: "boolean"
2677
+ }).option("mode", {
2678
+ alias: ["m"],
2679
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2680
+ choices: ["create", "createOrUpdate", "mirror"],
2681
+ default: "mirror",
2682
+ type: "string"
2683
+ })
2684
+ )
2342
2685
  )
2343
2686
  )
2344
2687
  ),
@@ -2387,9 +2730,11 @@ var EnrichmentRemoveModule = {
2387
2730
  command: "remove <id>",
2388
2731
  aliases: ["delete", "rm"],
2389
2732
  describe: "Delete an enrichment category and its values",
2390
- builder: (yargs21) => withApiOptions(
2391
- withProjectOptions(
2392
- yargs21.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
2733
+ builder: (yargs23) => withConfiguration(
2734
+ withApiOptions(
2735
+ withProjectOptions(
2736
+ yargs23.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
2737
+ )
2393
2738
  )
2394
2739
  ),
2395
2740
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2404,14 +2749,14 @@ var EnrichmentModule = {
2404
2749
  command: "enrichment <command>",
2405
2750
  aliases: ["enr"],
2406
2751
  describe: "Commands for Context enrichments",
2407
- builder: (yargs21) => yargs21.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
2752
+ builder: (yargs23) => yargs23.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
2408
2753
  handler: () => {
2409
- yargs7.help();
2754
+ yargs8.help();
2410
2755
  }
2411
2756
  };
2412
2757
 
2413
2758
  // src/commands/context/commands/manifest.ts
2414
- import yargs8 from "yargs";
2759
+ import yargs9 from "yargs";
2415
2760
 
2416
2761
  // src/commands/context/commands/manifest/get.ts
2417
2762
  import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
@@ -2422,20 +2767,22 @@ var ManifestGetModule = {
2422
2767
  command: "get [output]",
2423
2768
  aliases: ["dl", "download"],
2424
2769
  describe: "Download the Uniform Context manifest for a project",
2425
- builder: (yargs21) => withApiOptions(
2426
- withProjectOptions(
2427
- yargs21.option("preview", {
2428
- describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
2429
- default: false,
2430
- type: "boolean",
2431
- alias: ["d"]
2432
- }).option("output", {
2433
- string: true,
2434
- alias: "o",
2435
- default: process.env.UNIFORM_MANIFEST_PATH,
2436
- describe: "Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set.",
2437
- demandOption: true
2438
- })
2770
+ builder: (yargs23) => withConfiguration(
2771
+ withApiOptions(
2772
+ withProjectOptions(
2773
+ yargs23.option("preview", {
2774
+ describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
2775
+ default: false,
2776
+ type: "boolean",
2777
+ alias: ["d"]
2778
+ }).option("output", {
2779
+ string: true,
2780
+ alias: "o",
2781
+ default: process.env.UNIFORM_MANIFEST_PATH,
2782
+ describe: "Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set.",
2783
+ demandOption: true
2784
+ })
2785
+ )
2439
2786
  )
2440
2787
  ),
2441
2788
  handler: async ({ apiKey, apiHost, proxy, output, project, preview }) => {
@@ -2485,7 +2832,7 @@ import { exit as exit2 } from "process";
2485
2832
  var ManifestPublishModule = {
2486
2833
  command: "publish",
2487
2834
  describe: "Publish the Uniform Context manifest for a project",
2488
- builder: (yargs21) => withApiOptions(withProjectOptions(yargs21)),
2835
+ builder: (yargs23) => withConfiguration(withApiOptions(withProjectOptions(yargs23))),
2489
2836
  handler: async ({ apiKey, apiHost, proxy, project }) => {
2490
2837
  const fetch3 = nodeFetchProxy(proxy);
2491
2838
  try {
@@ -2518,24 +2865,26 @@ var ManifestModule = {
2518
2865
  command: "manifest <command>",
2519
2866
  describe: "Commands for context manifests",
2520
2867
  aliases: ["man"],
2521
- builder: (yargs21) => yargs21.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
2868
+ builder: (yargs23) => yargs23.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
2522
2869
  handler: () => {
2523
- yargs8.help();
2870
+ yargs9.help();
2524
2871
  }
2525
2872
  };
2526
2873
 
2527
2874
  // src/commands/context/commands/quirk.ts
2528
- import yargs9 from "yargs";
2875
+ import yargs10 from "yargs";
2529
2876
 
2530
2877
  // src/commands/context/commands/quirk/get.ts
2531
2878
  import { UncachedQuirkClient } from "@uniformdev/context/api";
2532
2879
  var QuirkGetModule = {
2533
2880
  command: "get <id>",
2534
2881
  describe: "Fetch a quirk",
2535
- builder: (yargs21) => withFormatOptions(
2536
- withApiOptions(
2537
- withProjectOptions(
2538
- yargs21.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
2882
+ builder: (yargs23) => withConfiguration(
2883
+ withFormatOptions(
2884
+ withApiOptions(
2885
+ withProjectOptions(
2886
+ yargs23.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
2887
+ )
2539
2888
  )
2540
2889
  )
2541
2890
  ),
@@ -2558,14 +2907,16 @@ var QuirkListModule = {
2558
2907
  command: "list",
2559
2908
  describe: "List quirks",
2560
2909
  aliases: ["ls"],
2561
- builder: (yargs21) => withFormatOptions(
2562
- withApiOptions(
2563
- withProjectOptions(
2564
- yargs21.option("withIntegrations", {
2565
- alias: ["i"],
2566
- describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
2567
- type: "boolean"
2568
- })
2910
+ builder: (yargs23) => withConfiguration(
2911
+ withFormatOptions(
2912
+ withApiOptions(
2913
+ withProjectOptions(
2914
+ yargs23.option("withIntegrations", {
2915
+ alias: ["i"],
2916
+ describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
2917
+ type: "boolean"
2918
+ })
2919
+ )
2569
2920
  )
2570
2921
  )
2571
2922
  ),
@@ -2617,30 +2968,32 @@ function createQuirkEngineDataSource({
2617
2968
  var QuirkPullModule = {
2618
2969
  command: "pull <directory>",
2619
2970
  describe: "Pulls all quirks to local files in a directory",
2620
- builder: (yargs21) => withApiOptions(
2621
- withProjectOptions(
2622
- withDiffOptions(
2623
- yargs21.positional("directory", {
2624
- describe: "Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2625
- type: "string"
2626
- }).option("format", {
2627
- alias: ["f"],
2628
- describe: "Output format",
2629
- default: "yaml",
2630
- choices: ["yaml", "json"],
2631
- type: "string"
2632
- }).option("what-if", {
2633
- alias: ["w"],
2634
- describe: "What-if mode reports what would be done but changes no files",
2635
- default: false,
2636
- type: "boolean"
2637
- }).option("mode", {
2638
- alias: ["m"],
2639
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2640
- choices: ["create", "createOrUpdate", "mirror"],
2641
- default: "mirror",
2642
- type: "string"
2643
- })
2971
+ builder: (yargs23) => withConfiguration(
2972
+ withApiOptions(
2973
+ withProjectOptions(
2974
+ withDiffOptions(
2975
+ yargs23.positional("directory", {
2976
+ describe: "Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2977
+ type: "string"
2978
+ }).option("format", {
2979
+ alias: ["f"],
2980
+ describe: "Output format",
2981
+ default: "yaml",
2982
+ choices: ["yaml", "json"],
2983
+ type: "string"
2984
+ }).option("what-if", {
2985
+ alias: ["w"],
2986
+ describe: "What-if mode reports what would be done but changes no files",
2987
+ default: false,
2988
+ type: "boolean"
2989
+ }).option("mode", {
2990
+ alias: ["m"],
2991
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2992
+ choices: ["create", "createOrUpdate", "mirror"],
2993
+ default: "mirror",
2994
+ type: "string"
2995
+ })
2996
+ )
2644
2997
  )
2645
2998
  )
2646
2999
  ),
@@ -2694,24 +3047,26 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
2694
3047
  var QuirkPushModule = {
2695
3048
  command: "push <directory>",
2696
3049
  describe: "Pushes all quirks from files in a directory or package to Uniform",
2697
- builder: (yargs21) => withApiOptions(
2698
- withProjectOptions(
2699
- withDiffOptions(
2700
- yargs21.positional("directory", {
2701
- describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
2702
- type: "string"
2703
- }).option("what-if", {
2704
- alias: ["w"],
2705
- describe: "What-if mode reports what would be done but changes nothing",
2706
- default: false,
2707
- type: "boolean"
2708
- }).option("mode", {
2709
- alias: ["m"],
2710
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2711
- choices: ["create", "createOrUpdate", "mirror"],
2712
- default: "mirror",
2713
- type: "string"
2714
- })
3050
+ builder: (yargs23) => withConfiguration(
3051
+ withApiOptions(
3052
+ withProjectOptions(
3053
+ withDiffOptions(
3054
+ yargs23.positional("directory", {
3055
+ describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
3056
+ type: "string"
3057
+ }).option("what-if", {
3058
+ alias: ["w"],
3059
+ describe: "What-if mode reports what would be done but changes nothing",
3060
+ default: false,
3061
+ type: "boolean"
3062
+ }).option("mode", {
3063
+ alias: ["m"],
3064
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
3065
+ choices: ["create", "createOrUpdate", "mirror"],
3066
+ default: "mirror",
3067
+ type: "string"
3068
+ })
3069
+ )
2715
3070
  )
2716
3071
  )
2717
3072
  ),
@@ -2760,9 +3115,11 @@ var QuirkRemoveModule = {
2760
3115
  command: "remove <id>",
2761
3116
  aliases: ["delete", "rm"],
2762
3117
  describe: "Delete a quirk",
2763
- builder: (yargs21) => withApiOptions(
2764
- withProjectOptions(
2765
- yargs21.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
3118
+ builder: (yargs23) => withConfiguration(
3119
+ withApiOptions(
3120
+ withProjectOptions(
3121
+ yargs23.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
3122
+ )
2766
3123
  )
2767
3124
  ),
2768
3125
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2778,8 +3135,12 @@ var QuirkUpdateModule = {
2778
3135
  command: "update <filename>",
2779
3136
  aliases: ["put"],
2780
3137
  describe: "Insert or update a quirk",
2781
- builder: (yargs21) => withApiOptions(
2782
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Quirk file to put" }))
3138
+ builder: (yargs23) => withConfiguration(
3139
+ withApiOptions(
3140
+ withProjectOptions(
3141
+ yargs23.positional("filename", { demandOption: true, describe: "Quirk file to put" })
3142
+ )
3143
+ )
2783
3144
  ),
2784
3145
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
2785
3146
  const fetch3 = nodeFetchProxy(proxy);
@@ -2794,24 +3155,26 @@ var QuirkModule = {
2794
3155
  command: "quirk <command>",
2795
3156
  aliases: ["qk"],
2796
3157
  describe: "Commands for Context quirks",
2797
- builder: (yargs21) => yargs21.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
3158
+ builder: (yargs23) => yargs23.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
2798
3159
  handler: () => {
2799
- yargs9.help();
3160
+ yargs10.help();
2800
3161
  }
2801
3162
  };
2802
3163
 
2803
3164
  // src/commands/context/commands/signal.ts
2804
- import yargs10 from "yargs";
3165
+ import yargs11 from "yargs";
2805
3166
 
2806
3167
  // src/commands/context/commands/signal/get.ts
2807
3168
  import { UncachedSignalClient } from "@uniformdev/context/api";
2808
3169
  var SignalGetModule = {
2809
3170
  command: "get <id>",
2810
3171
  describe: "Fetch a signal",
2811
- builder: (yargs21) => withFormatOptions(
2812
- withApiOptions(
2813
- withProjectOptions(
2814
- yargs21.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
3172
+ builder: (yargs23) => withConfiguration(
3173
+ withFormatOptions(
3174
+ withApiOptions(
3175
+ withProjectOptions(
3176
+ yargs23.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
3177
+ )
2815
3178
  )
2816
3179
  )
2817
3180
  ),
@@ -2834,7 +3197,7 @@ var SignalListModule = {
2834
3197
  command: "list",
2835
3198
  describe: "List signals",
2836
3199
  aliases: ["ls"],
2837
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
3200
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
2838
3201
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
2839
3202
  const fetch3 = nodeFetchProxy(proxy);
2840
3203
  const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -2883,30 +3246,32 @@ function createSignalEngineDataSource({
2883
3246
  var SignalPullModule = {
2884
3247
  command: "pull <directory>",
2885
3248
  describe: "Pulls all signals to local files in a directory",
2886
- builder: (yargs21) => withApiOptions(
2887
- withProjectOptions(
2888
- withDiffOptions(
2889
- yargs21.positional("directory", {
2890
- describe: "Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
2891
- type: "string"
2892
- }).option("format", {
2893
- alias: ["f"],
2894
- describe: "Output format",
2895
- default: "yaml",
2896
- choices: ["yaml", "json"],
2897
- type: "string"
2898
- }).option("what-if", {
2899
- alias: ["w"],
2900
- describe: "What-if mode reports what would be done but changes no files",
2901
- default: false,
2902
- type: "boolean"
2903
- }).option("mode", {
2904
- alias: ["m"],
2905
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
2906
- choices: ["create", "createOrUpdate", "mirror"],
2907
- default: "mirror",
2908
- type: "string"
2909
- })
3249
+ builder: (yargs23) => withConfiguration(
3250
+ withApiOptions(
3251
+ withProjectOptions(
3252
+ withDiffOptions(
3253
+ yargs23.positional("directory", {
3254
+ describe: "Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
3255
+ type: "string"
3256
+ }).option("format", {
3257
+ alias: ["f"],
3258
+ describe: "Output format",
3259
+ default: "yaml",
3260
+ choices: ["yaml", "json"],
3261
+ type: "string"
3262
+ }).option("what-if", {
3263
+ alias: ["w"],
3264
+ describe: "What-if mode reports what would be done but changes no files",
3265
+ default: false,
3266
+ type: "boolean"
3267
+ }).option("mode", {
3268
+ alias: ["m"],
3269
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
3270
+ choices: ["create", "createOrUpdate", "mirror"],
3271
+ default: "mirror",
3272
+ type: "string"
3273
+ })
3274
+ )
2910
3275
  )
2911
3276
  )
2912
3277
  ),
@@ -2960,24 +3325,26 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
2960
3325
  var SignalPushModule = {
2961
3326
  command: "push <directory>",
2962
3327
  describe: "Pushes all signals from files in a directory or package to Uniform",
2963
- builder: (yargs21) => withApiOptions(
2964
- withProjectOptions(
2965
- withDiffOptions(
2966
- yargs21.positional("directory", {
2967
- describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
2968
- type: "string"
2969
- }).option("what-if", {
2970
- alias: ["w"],
2971
- describe: "What-if mode reports what would be done but changes nothing",
2972
- default: false,
2973
- type: "boolean"
2974
- }).option("mode", {
2975
- alias: ["m"],
2976
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
2977
- choices: ["create", "createOrUpdate", "mirror"],
2978
- default: "mirror",
2979
- type: "string"
2980
- })
3328
+ builder: (yargs23) => withConfiguration(
3329
+ withApiOptions(
3330
+ withProjectOptions(
3331
+ withDiffOptions(
3332
+ yargs23.positional("directory", {
3333
+ describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
3334
+ type: "string"
3335
+ }).option("what-if", {
3336
+ alias: ["w"],
3337
+ describe: "What-if mode reports what would be done but changes nothing",
3338
+ default: false,
3339
+ type: "boolean"
3340
+ }).option("mode", {
3341
+ alias: ["m"],
3342
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
3343
+ choices: ["create", "createOrUpdate", "mirror"],
3344
+ default: "mirror",
3345
+ type: "string"
3346
+ })
3347
+ )
2981
3348
  )
2982
3349
  )
2983
3350
  ),
@@ -3026,9 +3393,11 @@ var SignalRemoveModule = {
3026
3393
  command: "remove <id>",
3027
3394
  aliases: ["delete", "rm"],
3028
3395
  describe: "Delete a signal",
3029
- builder: (yargs21) => withApiOptions(
3030
- withProjectOptions(
3031
- yargs21.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
3396
+ builder: (yargs23) => withConfiguration(
3397
+ withApiOptions(
3398
+ withProjectOptions(
3399
+ yargs23.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
3400
+ )
3032
3401
  )
3033
3402
  ),
3034
3403
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -3044,8 +3413,12 @@ var SignalUpdateModule = {
3044
3413
  command: "update <filename>",
3045
3414
  aliases: ["put"],
3046
3415
  describe: "Insert or update a signal",
3047
- builder: (yargs21) => withApiOptions(
3048
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Signal file to put" }))
3416
+ builder: (yargs23) => withConfiguration(
3417
+ withApiOptions(
3418
+ withProjectOptions(
3419
+ yargs23.positional("filename", { demandOption: true, describe: "Signal file to put" })
3420
+ )
3421
+ )
3049
3422
  ),
3050
3423
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
3051
3424
  const fetch3 = nodeFetchProxy(proxy);
@@ -3060,24 +3433,26 @@ var SignalModule = {
3060
3433
  command: "signal <command>",
3061
3434
  aliases: ["sig"],
3062
3435
  describe: "Commands for Context signals",
3063
- builder: (yargs21) => yargs21.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
3436
+ builder: (yargs23) => yargs23.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
3064
3437
  handler: () => {
3065
- yargs10.help();
3438
+ yargs11.help();
3066
3439
  }
3067
3440
  };
3068
3441
 
3069
3442
  // src/commands/context/commands/test.ts
3070
- import yargs11 from "yargs";
3443
+ import yargs12 from "yargs";
3071
3444
 
3072
3445
  // src/commands/context/commands/test/get.ts
3073
3446
  import { UncachedTestClient } from "@uniformdev/context/api";
3074
3447
  var TestGetModule = {
3075
3448
  command: "get <id>",
3076
3449
  describe: "Fetch a test",
3077
- builder: (yargs21) => withFormatOptions(
3078
- withApiOptions(
3079
- withProjectOptions(
3080
- yargs21.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
3450
+ builder: (yargs23) => withConfiguration(
3451
+ withFormatOptions(
3452
+ withApiOptions(
3453
+ withProjectOptions(
3454
+ yargs23.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
3455
+ )
3081
3456
  )
3082
3457
  )
3083
3458
  ),
@@ -3100,7 +3475,7 @@ var TestListModule = {
3100
3475
  command: "list",
3101
3476
  describe: "List tests",
3102
3477
  aliases: ["ls"],
3103
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
3478
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
3104
3479
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
3105
3480
  const fetch3 = nodeFetchProxy(proxy);
3106
3481
  const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -3149,30 +3524,32 @@ function createTestEngineDataSource({
3149
3524
  var TestPullModule = {
3150
3525
  command: "pull <directory>",
3151
3526
  describe: "Pulls all tests to local files in a directory",
3152
- builder: (yargs21) => withApiOptions(
3153
- withProjectOptions(
3154
- withDiffOptions(
3155
- yargs21.positional("directory", {
3156
- describe: "Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
3157
- type: "string"
3158
- }).option("format", {
3159
- alias: ["f"],
3160
- describe: "Output format",
3161
- default: "yaml",
3162
- choices: ["yaml", "json"],
3163
- type: "string"
3164
- }).option("what-if", {
3165
- alias: ["w"],
3166
- describe: "What-if mode reports what would be done but changes no files",
3167
- default: false,
3168
- type: "boolean"
3169
- }).option("mode", {
3170
- alias: ["m"],
3171
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
3172
- choices: ["create", "createOrUpdate", "mirror"],
3173
- default: "mirror",
3174
- type: "string"
3175
- })
3527
+ builder: (yargs23) => withConfiguration(
3528
+ withApiOptions(
3529
+ withProjectOptions(
3530
+ withDiffOptions(
3531
+ yargs23.positional("directory", {
3532
+ describe: "Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
3533
+ type: "string"
3534
+ }).option("format", {
3535
+ alias: ["f"],
3536
+ describe: "Output format",
3537
+ default: "yaml",
3538
+ choices: ["yaml", "json"],
3539
+ type: "string"
3540
+ }).option("what-if", {
3541
+ alias: ["w"],
3542
+ describe: "What-if mode reports what would be done but changes no files",
3543
+ default: false,
3544
+ type: "boolean"
3545
+ }).option("mode", {
3546
+ alias: ["m"],
3547
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
3548
+ choices: ["create", "createOrUpdate", "mirror"],
3549
+ default: "mirror",
3550
+ type: "string"
3551
+ })
3552
+ )
3176
3553
  )
3177
3554
  )
3178
3555
  ),
@@ -3226,24 +3603,26 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
3226
3603
  var TestPushModule = {
3227
3604
  command: "push <directory>",
3228
3605
  describe: "Pushes all tests from files in a directory or package to Uniform",
3229
- builder: (yargs21) => withApiOptions(
3230
- withProjectOptions(
3231
- withDiffOptions(
3232
- yargs21.positional("directory", {
3233
- describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
3234
- type: "string"
3235
- }).option("what-if", {
3236
- alias: ["w"],
3237
- describe: "What-if mode reports what would be done but changes nothing",
3238
- default: false,
3239
- type: "boolean"
3240
- }).option("mode", {
3241
- alias: ["m"],
3242
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
3243
- choices: ["create", "createOrUpdate", "mirror"],
3244
- default: "mirror",
3245
- type: "string"
3246
- })
3606
+ builder: (yargs23) => withConfiguration(
3607
+ withApiOptions(
3608
+ withProjectOptions(
3609
+ withDiffOptions(
3610
+ yargs23.positional("directory", {
3611
+ describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
3612
+ type: "string"
3613
+ }).option("what-if", {
3614
+ alias: ["w"],
3615
+ describe: "What-if mode reports what would be done but changes nothing",
3616
+ default: false,
3617
+ type: "boolean"
3618
+ }).option("mode", {
3619
+ alias: ["m"],
3620
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
3621
+ choices: ["create", "createOrUpdate", "mirror"],
3622
+ default: "mirror",
3623
+ type: "string"
3624
+ })
3625
+ )
3247
3626
  )
3248
3627
  )
3249
3628
  ),
@@ -3292,8 +3671,12 @@ var TestRemoveModule = {
3292
3671
  command: "remove <id>",
3293
3672
  aliases: ["delete", "rm"],
3294
3673
  describe: "Delete a test",
3295
- builder: (yargs21) => withApiOptions(
3296
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Test public ID to delete" }))
3674
+ builder: (yargs23) => withConfiguration(
3675
+ withApiOptions(
3676
+ withProjectOptions(
3677
+ yargs23.positional("id", { demandOption: true, describe: "Test public ID to delete" })
3678
+ )
3679
+ )
3297
3680
  ),
3298
3681
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
3299
3682
  const fetch3 = nodeFetchProxy(proxy);
@@ -3308,8 +3691,10 @@ var TestUpdateModule = {
3308
3691
  command: "update <filename>",
3309
3692
  aliases: ["put"],
3310
3693
  describe: "Insert or update a test",
3311
- builder: (yargs21) => withApiOptions(
3312
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Test file to put" }))
3694
+ builder: (yargs23) => withConfiguration(
3695
+ withApiOptions(
3696
+ withProjectOptions(yargs23.positional("filename", { demandOption: true, describe: "Test file to put" }))
3697
+ )
3313
3698
  ),
3314
3699
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
3315
3700
  const fetch3 = nodeFetchProxy(proxy);
@@ -3323,9 +3708,9 @@ var TestUpdateModule = {
3323
3708
  var TestModule = {
3324
3709
  command: "test <command>",
3325
3710
  describe: "Commands for Context A/B tests",
3326
- builder: (yargs21) => yargs21.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
3711
+ builder: (yargs23) => yargs23.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
3327
3712
  handler: () => {
3328
- yargs11.help();
3713
+ yargs12.help();
3329
3714
  }
3330
3715
  };
3331
3716
 
@@ -3334,9 +3719,9 @@ var ContextCommand = {
3334
3719
  command: "context <command>",
3335
3720
  aliases: ["ctx"],
3336
3721
  describe: "Uniform Context commands",
3337
- builder: (yargs21) => yargs21.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
3722
+ builder: (yargs23) => yargs23.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
3338
3723
  handler: () => {
3339
- yargs12.showHelp();
3724
+ yargs13.showHelp();
3340
3725
  }
3341
3726
  };
3342
3727
 
@@ -3368,7 +3753,7 @@ var package_default = {
3368
3753
  description: "Uniform command line interface tool",
3369
3754
  license: "SEE LICENSE IN LICENSE.txt",
3370
3755
  main: "./cli.js",
3371
- types: "./dist/index.d.ts",
3756
+ types: "./dist/index.d.mts",
3372
3757
  sideEffects: false,
3373
3758
  scripts: {
3374
3759
  uniform: "node ./cli.js",
@@ -3385,15 +3770,16 @@ var package_default = {
3385
3770
  "@uniformdev/project-map": "workspace:*",
3386
3771
  "@uniformdev/redirect": "workspace:*",
3387
3772
  colorette: "2.0.20",
3388
- cosmiconfig: "^8.2.0",
3773
+ cosmiconfig: "8.2.0",
3774
+ "cosmiconfig-typescript-loader": "5.0.0",
3389
3775
  diff: "^5.0.0",
3390
3776
  dotenv: "^16.0.3",
3391
3777
  execa: "5.1.1",
3392
3778
  "fs-jetpack": "5.1.0",
3393
- graphql: "16.6.0",
3779
+ graphql: "16.7.1",
3394
3780
  "graphql-request": "6.1.0",
3395
3781
  "https-proxy-agent": "^7.0.0",
3396
- inquirer: "9.2.8",
3782
+ inquirer: "9.2.9",
3397
3783
  "isomorphic-git": "1.24.5",
3398
3784
  "isomorphic-unfetch": "^3.1.0",
3399
3785
  "js-yaml": "^4.1.0",
@@ -4324,24 +4710,26 @@ var disableTelemetryDefault = !["", "0", "false", "no"].includes(
4324
4710
  );
4325
4711
  var NewCmd = {
4326
4712
  command: "new [name]",
4327
- builder: (y) => y.positional("name", {
4328
- describe: "Name of a project",
4329
- type: "string"
4330
- }).option("apiHost", {
4331
- describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4332
- default: apiHostDefault,
4333
- demandOption: true,
4334
- type: "string"
4335
- }).option("outputPath", {
4336
- alias: "o",
4337
- description: "Specify where to store integration files. Defaults to cwd.",
4338
- type: "string"
4339
- }).option("disableTelemetry", {
4340
- describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4341
- default: disableTelemetryDefault,
4342
- demandOption: true,
4343
- type: "boolean"
4344
- }),
4713
+ builder: (y) => withConfiguration(
4714
+ y.positional("name", {
4715
+ describe: "Name of a project",
4716
+ type: "string"
4717
+ }).option("apiHost", {
4718
+ describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4719
+ default: apiHostDefault,
4720
+ demandOption: true,
4721
+ type: "string"
4722
+ }).option("outputPath", {
4723
+ alias: "o",
4724
+ description: "Specify where to store integration files. Defaults to cwd.",
4725
+ type: "string"
4726
+ }).option("disableTelemetry", {
4727
+ describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4728
+ default: disableTelemetryDefault,
4729
+ demandOption: true,
4730
+ type: "boolean"
4731
+ })
4732
+ ),
4345
4733
  describe: "Start a new Uniform project",
4346
4734
  handler: async function({ name, apiHost, outputPath, disableTelemetry }) {
4347
4735
  const { stopAllSpinners, spin } = makeSpinner();
@@ -4362,21 +4750,23 @@ var NewCmd = {
4362
4750
  };
4363
4751
  var NewMeshCmd = {
4364
4752
  command: "new-integration",
4365
- builder: (y) => y.option("apiHost", {
4366
- describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4367
- default: apiHostDefault,
4368
- demandOption: true,
4369
- type: "string"
4370
- }).option("outputPath", {
4371
- alias: "o",
4372
- description: "Specify where to store integration files. Defaults to cwd.",
4373
- type: "string"
4374
- }).option("disableTelemetry", {
4375
- describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4376
- default: disableTelemetryDefault,
4377
- demandOption: true,
4378
- type: "boolean"
4379
- }),
4753
+ builder: (y) => withConfiguration(
4754
+ y.option("apiHost", {
4755
+ describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4756
+ default: apiHostDefault,
4757
+ demandOption: true,
4758
+ type: "string"
4759
+ }).option("outputPath", {
4760
+ alias: "o",
4761
+ description: "Specify where to store integration files. Defaults to cwd.",
4762
+ type: "string"
4763
+ }).option("disableTelemetry", {
4764
+ describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4765
+ default: disableTelemetryDefault,
4766
+ demandOption: true,
4767
+ type: "boolean"
4768
+ })
4769
+ ),
4380
4770
  describe: "Start a new Uniform project",
4381
4771
  handler: async function({ apiHost, outputPath, disableTelemetry }) {
4382
4772
  const { stopAllSpinners, spin } = makeSpinner();
@@ -4397,10 +4787,10 @@ var NewMeshCmd = {
4397
4787
  };
4398
4788
 
4399
4789
  // src/commands/optimize/index.ts
4400
- import yargs14 from "yargs";
4790
+ import yargs15 from "yargs";
4401
4791
 
4402
4792
  // src/commands/optimize/manifest.ts
4403
- import yargs13 from "yargs";
4793
+ import yargs14 from "yargs";
4404
4794
 
4405
4795
  // src/commands/optimize/manifest/download.ts
4406
4796
  import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
@@ -4415,7 +4805,7 @@ var UniformBaseUrl = "https://uniform.app";
4415
4805
  var module = {
4416
4806
  command: "download [output]",
4417
4807
  describe: "Download intent manifest",
4418
- builder: (yargs21) => yargs21.option("apiKey", {
4808
+ builder: (yargs23) => yargs23.option("apiKey", {
4419
4809
  alias: "k",
4420
4810
  demandOption: true,
4421
4811
  string: true,
@@ -4516,10 +4906,10 @@ var module2 = {
4516
4906
  command: "manifest <command>",
4517
4907
  describe: "Intent manifest commands",
4518
4908
  builder: () => {
4519
- return yargs13.command(download_default);
4909
+ return yargs14.command(download_default);
4520
4910
  },
4521
4911
  handler: () => {
4522
- yargs13.showHelp();
4912
+ yargs14.showHelp();
4523
4913
  }
4524
4914
  };
4525
4915
  var manifest_default = module2;
@@ -4530,28 +4920,30 @@ var OptimizeCommand = {
4530
4920
  aliases: ["opt"],
4531
4921
  describe: "Uniform Optimize commands",
4532
4922
  builder: () => {
4533
- return yargs14.command(manifest_default);
4923
+ return yargs15.command(manifest_default);
4534
4924
  },
4535
4925
  handler: () => {
4536
- yargs14.showHelp();
4926
+ yargs15.showHelp();
4537
4927
  }
4538
4928
  };
4539
4929
 
4540
4930
  // src/commands/project-map/index.ts
4541
- import yargs17 from "yargs";
4931
+ import yargs18 from "yargs";
4542
4932
 
4543
4933
  // src/commands/project-map/commands/projectMapDefinition.ts
4544
- import yargs15 from "yargs";
4934
+ import yargs16 from "yargs";
4545
4935
 
4546
4936
  // src/commands/project-map/commands/ProjectMapDefinition/get.ts
4547
4937
  import { UncachedProjectMapClient } from "@uniformdev/project-map";
4548
4938
  var ProjectMapDefinitionGetModule = {
4549
4939
  command: "get <id>",
4550
4940
  describe: "Fetch a project map",
4551
- builder: (yargs21) => withFormatOptions(
4552
- withApiOptions(
4553
- withProjectOptions(
4554
- yargs21.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
4941
+ builder: (yargs23) => withFormatOptions(
4942
+ withConfiguration(
4943
+ withApiOptions(
4944
+ withProjectOptions(
4945
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
4946
+ )
4555
4947
  )
4556
4948
  )
4557
4949
  ),
@@ -4574,7 +4966,7 @@ var ProjectMapDefinitionListModule = {
4574
4966
  command: "list",
4575
4967
  describe: "List of project maps",
4576
4968
  aliases: ["ls"],
4577
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
4969
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
4578
4970
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
4579
4971
  const fetch3 = nodeFetchProxy(proxy);
4580
4972
  const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -4631,30 +5023,32 @@ function createProjectMapDefinitionEngineDataSource({
4631
5023
  var ProjectMapDefinitionPullModule = {
4632
5024
  command: "pull <directory>",
4633
5025
  describe: "Pulls all project maps to local files in a directory",
4634
- builder: (yargs21) => withApiOptions(
4635
- withProjectOptions(
4636
- withDiffOptions(
4637
- yargs21.positional("directory", {
4638
- describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
4639
- type: "string"
4640
- }).option("format", {
4641
- alias: ["f"],
4642
- describe: "Output format",
4643
- default: "yaml",
4644
- choices: ["yaml", "json"],
4645
- type: "string"
4646
- }).option("what-if", {
4647
- alias: ["w"],
4648
- describe: "What-if mode reports what would be done but changes no files",
4649
- default: false,
4650
- type: "boolean"
4651
- }).option("mode", {
4652
- alias: ["m"],
4653
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
4654
- choices: ["create", "createOrUpdate", "mirror"],
4655
- default: "mirror",
4656
- type: "string"
4657
- })
5026
+ builder: (yargs23) => withConfiguration(
5027
+ withApiOptions(
5028
+ withProjectOptions(
5029
+ withDiffOptions(
5030
+ yargs23.positional("directory", {
5031
+ describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
5032
+ type: "string"
5033
+ }).option("format", {
5034
+ alias: ["f"],
5035
+ describe: "Output format",
5036
+ default: "yaml",
5037
+ choices: ["yaml", "json"],
5038
+ type: "string"
5039
+ }).option("what-if", {
5040
+ alias: ["w"],
5041
+ describe: "What-if mode reports what would be done but changes no files",
5042
+ default: false,
5043
+ type: "boolean"
5044
+ }).option("mode", {
5045
+ alias: ["m"],
5046
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
5047
+ choices: ["create", "createOrUpdate", "mirror"],
5048
+ default: "mirror",
5049
+ type: "string"
5050
+ })
5051
+ )
4658
5052
  )
4659
5053
  )
4660
5054
  ),
@@ -4708,24 +5102,26 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
4708
5102
  var ProjectMapDefinitionPushModule = {
4709
5103
  command: "push <directory>",
4710
5104
  describe: "Pushes all project maps from files in a directory or package to Uniform",
4711
- builder: (yargs21) => withApiOptions(
4712
- withProjectOptions(
4713
- withDiffOptions(
4714
- yargs21.positional("directory", {
4715
- describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
4716
- type: "string"
4717
- }).option("what-if", {
4718
- alias: ["w"],
4719
- describe: "What-if mode reports what would be done but changes nothing",
4720
- default: false,
4721
- type: "boolean"
4722
- }).option("mode", {
4723
- alias: ["m"],
4724
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
4725
- choices: ["create", "createOrUpdate", "mirror"],
4726
- default: "mirror",
4727
- type: "string"
4728
- })
5105
+ builder: (yargs23) => withConfiguration(
5106
+ withApiOptions(
5107
+ withProjectOptions(
5108
+ withDiffOptions(
5109
+ yargs23.positional("directory", {
5110
+ describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5111
+ type: "string"
5112
+ }).option("what-if", {
5113
+ alias: ["w"],
5114
+ describe: "What-if mode reports what would be done but changes nothing",
5115
+ default: false,
5116
+ type: "boolean"
5117
+ }).option("mode", {
5118
+ alias: ["m"],
5119
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5120
+ choices: ["create", "createOrUpdate", "mirror"],
5121
+ default: "mirror",
5122
+ type: "string"
5123
+ })
5124
+ )
4729
5125
  )
4730
5126
  )
4731
5127
  ),
@@ -4774,8 +5170,10 @@ var ProjectMapDefinitionRemoveModule = {
4774
5170
  command: "remove <id>",
4775
5171
  aliases: ["delete", "rm"],
4776
5172
  describe: "Delete a project map",
4777
- builder: (yargs21) => withApiOptions(
4778
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: " UUID to delete" }))
5173
+ builder: (yargs23) => withConfiguration(
5174
+ withApiOptions(
5175
+ withProjectOptions(yargs23.positional("id", { demandOption: true, describe: " UUID to delete" }))
5176
+ )
4779
5177
  ),
4780
5178
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
4781
5179
  const fetch3 = nodeFetchProxy(proxy);
@@ -4790,9 +5188,11 @@ var ProjectMapDefinitionUpdateModule = {
4790
5188
  command: "update <filename>",
4791
5189
  aliases: ["put"],
4792
5190
  describe: "Insert or update a project map",
4793
- builder: (yargs21) => withApiOptions(
4794
- withProjectOptions(
4795
- yargs21.positional("filename", { demandOption: true, describe: "Project map file to put" })
5191
+ builder: (yargs23) => withConfiguration(
5192
+ withApiOptions(
5193
+ withProjectOptions(
5194
+ yargs23.positional("filename", { demandOption: true, describe: "Project map file to put" })
5195
+ )
4796
5196
  )
4797
5197
  ),
4798
5198
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -4807,24 +5207,26 @@ var ProjectMapDefinitionUpdateModule = {
4807
5207
  var ProjectMapDefinitionModule = {
4808
5208
  command: "definition <command>",
4809
5209
  describe: "Commands for ProjectMap Definitions",
4810
- builder: (yargs21) => yargs21.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
5210
+ builder: (yargs23) => yargs23.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
4811
5211
  handler: () => {
4812
- yargs15.help();
5212
+ yargs16.help();
4813
5213
  }
4814
5214
  };
4815
5215
 
4816
5216
  // src/commands/project-map/commands/projectMapNode.ts
4817
- import yargs16 from "yargs";
5217
+ import yargs17 from "yargs";
4818
5218
 
4819
5219
  // src/commands/project-map/commands/ProjectMapNode/get.ts
4820
5220
  import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
4821
5221
  var ProjectMapNodeGetModule = {
4822
5222
  command: "get <id> <projectMapId>",
4823
5223
  describe: "Fetch a project map node",
4824
- builder: (yargs21) => withFormatOptions(
4825
- withApiOptions(
4826
- withProjectOptions(
4827
- yargs21.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5224
+ builder: (yargs23) => withConfiguration(
5225
+ withFormatOptions(
5226
+ withApiOptions(
5227
+ withProjectOptions(
5228
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5229
+ )
4828
5230
  )
4829
5231
  )
4830
5232
  ),
@@ -4849,10 +5251,15 @@ var ProjectMapNodeListModule = {
4849
5251
  command: "list <projectMapId>",
4850
5252
  describe: "List project map nodes",
4851
5253
  aliases: ["ls"],
4852
- builder: (yargs21) => withFormatOptions(
4853
- withApiOptions(
4854
- withProjectOptions(
4855
- yargs21.positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5254
+ builder: (yargs23) => withConfiguration(
5255
+ withFormatOptions(
5256
+ withApiOptions(
5257
+ withProjectOptions(
5258
+ yargs23.positional("projectMapId", {
5259
+ demandOption: true,
5260
+ describe: "ProjectMap UUID to fetch from"
5261
+ })
5262
+ )
4856
5263
  )
4857
5264
  )
4858
5265
  ),
@@ -4919,30 +5326,32 @@ function createProjectMapNodeEngineDataSource({
4919
5326
  var ProjectMapNodePullModule = {
4920
5327
  command: "pull <directory>",
4921
5328
  describe: "Pulls all project maps nodes to local files in a directory",
4922
- builder: (yargs21) => withApiOptions(
4923
- withProjectOptions(
4924
- withDiffOptions(
4925
- yargs21.positional("directory", {
4926
- describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
4927
- type: "string"
4928
- }).option("format", {
4929
- alias: ["f"],
4930
- describe: "Output format",
4931
- default: "yaml",
4932
- choices: ["yaml", "json"],
4933
- type: "string"
4934
- }).option("what-if", {
4935
- alias: ["w"],
4936
- describe: "What-if mode reports what would be done but changes no files",
4937
- default: false,
4938
- type: "boolean"
4939
- }).option("mode", {
4940
- alias: ["m"],
4941
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
4942
- choices: ["create", "createOrUpdate", "mirror"],
4943
- default: "mirror",
4944
- type: "string"
4945
- })
5329
+ builder: (yargs23) => withConfiguration(
5330
+ withApiOptions(
5331
+ withProjectOptions(
5332
+ withDiffOptions(
5333
+ yargs23.positional("directory", {
5334
+ describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
5335
+ type: "string"
5336
+ }).option("format", {
5337
+ alias: ["f"],
5338
+ describe: "Output format",
5339
+ default: "yaml",
5340
+ choices: ["yaml", "json"],
5341
+ type: "string"
5342
+ }).option("what-if", {
5343
+ alias: ["w"],
5344
+ describe: "What-if mode reports what would be done but changes no files",
5345
+ default: false,
5346
+ type: "boolean"
5347
+ }).option("mode", {
5348
+ alias: ["m"],
5349
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
5350
+ choices: ["create", "createOrUpdate", "mirror"],
5351
+ default: "mirror",
5352
+ type: "string"
5353
+ })
5354
+ )
4946
5355
  )
4947
5356
  )
4948
5357
  ),
@@ -5000,24 +5409,26 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
5000
5409
  var ProjectMapNodePushModule = {
5001
5410
  command: "push <directory>",
5002
5411
  describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
5003
- builder: (yargs21) => withApiOptions(
5004
- withProjectOptions(
5005
- withDiffOptions(
5006
- yargs21.positional("directory", {
5007
- describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5008
- type: "string"
5009
- }).option("what-if", {
5010
- alias: ["w"],
5011
- describe: "What-if mode reports what would be done but changes nothing",
5012
- default: false,
5013
- type: "boolean"
5014
- }).option("mode", {
5015
- alias: ["m"],
5016
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5017
- choices: ["create", "createOrUpdate", "mirror"],
5018
- default: "mirror",
5019
- type: "string"
5020
- })
5412
+ builder: (yargs23) => withConfiguration(
5413
+ withApiOptions(
5414
+ withProjectOptions(
5415
+ withDiffOptions(
5416
+ yargs23.positional("directory", {
5417
+ describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5418
+ type: "string"
5419
+ }).option("what-if", {
5420
+ alias: ["w"],
5421
+ describe: "What-if mode reports what would be done but changes nothing",
5422
+ default: false,
5423
+ type: "boolean"
5424
+ }).option("mode", {
5425
+ alias: ["m"],
5426
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5427
+ choices: ["create", "createOrUpdate", "mirror"],
5428
+ default: "mirror",
5429
+ type: "string"
5430
+ })
5431
+ )
5021
5432
  )
5022
5433
  )
5023
5434
  ),
@@ -5075,9 +5486,11 @@ var ProjectMapNodeRemoveModule = {
5075
5486
  command: "remove <id> <projectMapId>",
5076
5487
  aliases: ["delete", "rm"],
5077
5488
  describe: "Delete a project map node",
5078
- builder: (yargs21) => withApiOptions(
5079
- withProjectOptions(
5080
- yargs21.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
5489
+ builder: (yargs23) => withConfiguration(
5490
+ withApiOptions(
5491
+ withProjectOptions(
5492
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
5493
+ )
5081
5494
  )
5082
5495
  ),
5083
5496
  handler: async ({ apiHost, apiKey, proxy, projectMapId, id, project: projectId }) => {
@@ -5093,9 +5506,11 @@ var ProjectMapNodeUpdateModule = {
5093
5506
  command: "update <filename> <projectMapId>",
5094
5507
  aliases: ["put"],
5095
5508
  describe: "Insert or update a project map node",
5096
- builder: (yargs21) => withApiOptions(
5097
- withProjectOptions(
5098
- yargs21.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
5509
+ builder: (yargs23) => withConfiguration(
5510
+ withApiOptions(
5511
+ withProjectOptions(
5512
+ yargs23.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
5513
+ )
5099
5514
  )
5100
5515
  ),
5101
5516
  handler: async ({ apiHost, apiKey, proxy, projectMapId, filename, project: projectId }) => {
@@ -5110,9 +5525,9 @@ var ProjectMapNodeUpdateModule = {
5110
5525
  var ProjectMapNodeModule = {
5111
5526
  command: "node <command>",
5112
5527
  describe: "Commands for ProjectMap Nodes",
5113
- builder: (yargs21) => yargs21.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
5528
+ builder: (yargs23) => yargs23.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
5114
5529
  handler: () => {
5115
- yargs16.help();
5530
+ yargs17.help();
5116
5531
  }
5117
5532
  };
5118
5533
 
@@ -5121,26 +5536,30 @@ var ProjectMapCommand = {
5121
5536
  command: "project-map <command>",
5122
5537
  aliases: ["prm"],
5123
5538
  describe: "Uniform ProjectMap commands",
5124
- builder: (yargs21) => yargs21.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
5539
+ builder: (yargs23) => yargs23.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
5125
5540
  handler: () => {
5126
- yargs17.showHelp();
5541
+ yargs18.showHelp();
5127
5542
  }
5128
5543
  };
5129
5544
 
5130
5545
  // src/commands/redirect/index.ts
5131
- import yargs19 from "yargs";
5546
+ import yargs20 from "yargs";
5132
5547
 
5133
5548
  // src/commands/redirect/commands/redirect.ts
5134
- import yargs18 from "yargs";
5549
+ import yargs19 from "yargs";
5135
5550
 
5136
5551
  // src/commands/redirect/commands/RedirectDefinition/get.ts
5137
5552
  import { UncachedRedirectClient } from "@uniformdev/redirect";
5138
5553
  var RedirectDefinitionGetModule = {
5139
5554
  command: "get <id>",
5140
5555
  describe: "Fetch a redirect",
5141
- builder: (yargs21) => withFormatOptions(
5142
- withApiOptions(
5143
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" }))
5556
+ builder: (yargs23) => withConfiguration(
5557
+ withFormatOptions(
5558
+ withApiOptions(
5559
+ withProjectOptions(
5560
+ yargs23.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
5561
+ )
5562
+ )
5144
5563
  )
5145
5564
  ),
5146
5565
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
@@ -5162,7 +5581,7 @@ var RedirectDefinitionListModule = {
5162
5581
  command: "list",
5163
5582
  describe: "List of redirects",
5164
5583
  aliases: ["ls"],
5165
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
5584
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
5166
5585
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
5167
5586
  const fetch3 = nodeFetchProxy(proxy);
5168
5587
  const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -5228,30 +5647,32 @@ function createRedirectDefinitionEngineDataSource({
5228
5647
  var RedirectDefinitionPullModule = {
5229
5648
  command: "pull <directory>",
5230
5649
  describe: "Pulls all redirects to local files in a directory",
5231
- builder: (yargs21) => withApiOptions(
5232
- withProjectOptions(
5233
- withDiffOptions(
5234
- yargs21.positional("directory", {
5235
- describe: "Directory to save redirects to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
5236
- type: "string"
5237
- }).option("format", {
5238
- alias: ["f"],
5239
- describe: "Output format",
5240
- default: "yaml",
5241
- choices: ["yaml", "json"],
5242
- type: "string"
5243
- }).option("what-if", {
5244
- alias: ["w"],
5245
- describe: "What-if mode reports what would be done but changes no files",
5246
- default: false,
5247
- type: "boolean"
5248
- }).option("mode", {
5249
- alias: ["m"],
5250
- describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
5251
- choices: ["create", "createOrUpdate", "mirror"],
5252
- default: "mirror",
5253
- type: "string"
5254
- })
5650
+ builder: (yargs23) => withConfiguration(
5651
+ withApiOptions(
5652
+ withProjectOptions(
5653
+ withDiffOptions(
5654
+ yargs23.positional("directory", {
5655
+ describe: "Directory to save redirects to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
5656
+ type: "string"
5657
+ }).option("format", {
5658
+ alias: ["f"],
5659
+ describe: "Output format",
5660
+ default: "yaml",
5661
+ choices: ["yaml", "json"],
5662
+ type: "string"
5663
+ }).option("what-if", {
5664
+ alias: ["w"],
5665
+ describe: "What-if mode reports what would be done but changes no files",
5666
+ default: false,
5667
+ type: "boolean"
5668
+ }).option("mode", {
5669
+ alias: ["m"],
5670
+ describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
5671
+ choices: ["create", "createOrUpdate", "mirror"],
5672
+ default: "mirror",
5673
+ type: "string"
5674
+ })
5675
+ )
5255
5676
  )
5256
5677
  )
5257
5678
  ),
@@ -5306,24 +5727,26 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
5306
5727
  var RedirectDefinitionPushModule = {
5307
5728
  command: "push <directory>",
5308
5729
  describe: "Pushes all redirects from files in a directory or package to Uniform",
5309
- builder: (yargs21) => withApiOptions(
5310
- withProjectOptions(
5311
- withDiffOptions(
5312
- yargs21.positional("directory", {
5313
- describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
5314
- type: "string"
5315
- }).option("what-if", {
5316
- alias: ["w"],
5317
- describe: "What-if mode reports what would be done but changes nothing",
5318
- default: false,
5319
- type: "boolean"
5320
- }).option("mode", {
5321
- alias: ["m"],
5322
- describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5323
- choices: ["create", "createOrUpdate", "mirror"],
5324
- default: "mirror",
5325
- type: "string"
5326
- })
5730
+ builder: (yargs23) => withConfiguration(
5731
+ withApiOptions(
5732
+ withProjectOptions(
5733
+ withDiffOptions(
5734
+ yargs23.positional("directory", {
5735
+ describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
5736
+ type: "string"
5737
+ }).option("what-if", {
5738
+ alias: ["w"],
5739
+ describe: "What-if mode reports what would be done but changes nothing",
5740
+ default: false,
5741
+ type: "boolean"
5742
+ }).option("mode", {
5743
+ alias: ["m"],
5744
+ describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
5745
+ choices: ["create", "createOrUpdate", "mirror"],
5746
+ default: "mirror",
5747
+ type: "string"
5748
+ })
5749
+ )
5327
5750
  )
5328
5751
  )
5329
5752
  ),
@@ -5372,8 +5795,10 @@ var RedirectDefinitionRemoveModule = {
5372
5795
  command: "remove <id>",
5373
5796
  aliases: ["delete", "rm"],
5374
5797
  describe: "Delete a redirect",
5375
- builder: (yargs21) => withApiOptions(
5376
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: " UUID to delete" }))
5798
+ builder: (yargs23) => withConfiguration(
5799
+ withApiOptions(
5800
+ withProjectOptions(yargs23.positional("id", { demandOption: true, describe: " UUID to delete" }))
5801
+ )
5377
5802
  ),
5378
5803
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
5379
5804
  const fetch3 = nodeFetchProxy(proxy);
@@ -5388,9 +5813,11 @@ var RedirectDefinitionUpdateModule = {
5388
5813
  command: "update <filename>",
5389
5814
  aliases: ["put"],
5390
5815
  describe: "Insert or update a redirect",
5391
- builder: (yargs21) => withApiOptions(
5392
- withProjectOptions(
5393
- yargs21.positional("filename", { demandOption: true, describe: "Redirect file to put" })
5816
+ builder: (yargs23) => withConfiguration(
5817
+ withApiOptions(
5818
+ withProjectOptions(
5819
+ yargs23.positional("filename", { demandOption: true, describe: "Redirect file to put" })
5820
+ )
5394
5821
  )
5395
5822
  ),
5396
5823
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -5405,9 +5832,9 @@ var RedirectDefinitionUpdateModule = {
5405
5832
  var RedirectDefinitionModule = {
5406
5833
  command: "definition <command>",
5407
5834
  describe: "Commands for Redirect Definitions",
5408
- builder: (yargs21) => yargs21.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
5835
+ builder: (yargs23) => yargs23.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
5409
5836
  handler: () => {
5410
- yargs18.help();
5837
+ yargs19.help();
5411
5838
  }
5412
5839
  };
5413
5840
 
@@ -5416,9 +5843,161 @@ var RedirectCommand = {
5416
5843
  command: "redirect <command>",
5417
5844
  aliases: ["red"],
5418
5845
  describe: "Uniform Redirect commands",
5419
- builder: (yargs21) => yargs21.command(RedirectDefinitionModule).demandCommand(),
5846
+ builder: (yargs23) => yargs23.command(RedirectDefinitionModule).demandCommand(),
5847
+ handler: () => {
5848
+ yargs20.showHelp();
5849
+ }
5850
+ };
5851
+
5852
+ // src/commands/sync/index.ts
5853
+ import yargs21 from "yargs";
5854
+
5855
+ // src/commands/sync/commands/pull.ts
5856
+ var SyncPullModule = {
5857
+ command: "pull",
5858
+ describe: "Pulls whole project to local files in a directory",
5859
+ builder: (yargs23) => withConfiguration(
5860
+ withApiOptions(
5861
+ withProjectOptions(
5862
+ withDiffOptions(
5863
+ yargs23.option("what-if", {
5864
+ alias: ["w"],
5865
+ describe: "What-if mode reports what would be done but changes no files",
5866
+ default: false,
5867
+ type: "boolean"
5868
+ })
5869
+ )
5870
+ )
5871
+ )
5872
+ ),
5873
+ handler: async ({ serialization, ...otherParams }) => {
5874
+ const config2 = serialization;
5875
+ const enabledEntities = Object.entries({
5876
+ category: CategoryPullModule,
5877
+ dataType: DataTypePullModule,
5878
+ quirk: QuirkPullModule,
5879
+ test: TestPullModule,
5880
+ signal: SignalPullModule,
5881
+ enrichment: EnrichmentPullModule,
5882
+ aggregate: AggregatePullModule,
5883
+ component: ComponentPullModule,
5884
+ pattern: PatternPullModule,
5885
+ composition: CompositionPullModule,
5886
+ projectMapDefinition: ProjectMapDefinitionPullModule,
5887
+ projectMapNode: ProjectMapNodePullModule,
5888
+ redirect: RedirectDefinitionPullModule
5889
+ }).filter(([entityType]) => {
5890
+ var _a, _b, _c, _d, _e, _f;
5891
+ return Boolean((_a = config2.entitiesConfig) == null ? void 0 : _a[entityType]) && ((_c = (_b = config2.entitiesConfig) == null ? void 0 : _b[entityType]) == null ? void 0 : _c.disabled) !== true && ((_f = (_e = (_d = config2.entitiesConfig) == null ? void 0 : _d[entityType]) == null ? void 0 : _e.pull) == null ? void 0 : _f.disabled) !== true;
5892
+ });
5893
+ for (const [entityType, module3] of enabledEntities) {
5894
+ await module3.handler({
5895
+ ...otherParams,
5896
+ state: 0,
5897
+ onlyCompositions: entityType === "composition" ? true : void 0,
5898
+ onlyPatterns: entityType === "pattern" ? true : void 0,
5899
+ mode: getPullMode(entityType, config2),
5900
+ directory: getPullFilename(entityType, config2)
5901
+ });
5902
+ }
5903
+ }
5904
+ };
5905
+ var getPullMode = (entityType, config2) => {
5906
+ return getEntityOption({
5907
+ optionName: "mode",
5908
+ operation: "pull",
5909
+ config: config2,
5910
+ entityType
5911
+ });
5912
+ };
5913
+ var getPullFilename = (entityType, config2) => {
5914
+ return getDirectoryOrFilename({
5915
+ operation: "pull",
5916
+ config: config2,
5917
+ entityType
5918
+ });
5919
+ };
5920
+
5921
+ // src/commands/sync/commands/push.ts
5922
+ var SyncPushModule = {
5923
+ command: "push",
5924
+ describe: "Pushes whole project data from files in a directory or package to Uniform",
5925
+ builder: (yargs23) => withConfiguration(
5926
+ withApiOptions(
5927
+ withProjectOptions(
5928
+ withDiffOptions(
5929
+ yargs23.option("what-if", {
5930
+ alias: ["w"],
5931
+ describe: "What-if mode reports what would be done but changes nothing",
5932
+ default: false,
5933
+ type: "boolean"
5934
+ })
5935
+ )
5936
+ )
5937
+ )
5938
+ ),
5939
+ handler: async ({ serialization, ...otherParams }) => {
5940
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
5941
+ const config2 = serialization;
5942
+ const enabledEntities = Object.entries({
5943
+ category: CategoryPushModule,
5944
+ dataType: DataTypePushModule,
5945
+ quirk: QuirkPushModule,
5946
+ test: TestPushModule,
5947
+ signal: SignalPushModule,
5948
+ enrichment: EnrichmentPushModule,
5949
+ aggregate: AggregatePushModule,
5950
+ component: ComponentPushModule,
5951
+ pattern: PatternPushModule,
5952
+ composition: CompositionPushModule,
5953
+ projectMapDefinition: ProjectMapDefinitionPushModule,
5954
+ projectMapNode: ProjectMapNodePushModule,
5955
+ redirect: RedirectDefinitionPushModule
5956
+ }).filter(([entityType]) => {
5957
+ var _a2, _b2, _c2, _d2, _e2, _f2;
5958
+ return Boolean((_a2 = config2.entitiesConfig) == null ? void 0 : _a2[entityType]) && ((_c2 = (_b2 = config2.entitiesConfig) == null ? void 0 : _b2[entityType]) == null ? void 0 : _c2.disabled) !== true && ((_f2 = (_e2 = (_d2 = config2.entitiesConfig) == null ? void 0 : _d2[entityType]) == null ? void 0 : _e2.push) == null ? void 0 : _f2.disabled) !== true;
5959
+ });
5960
+ for (const [entityType, module3] of enabledEntities) {
5961
+ await module3.handler({
5962
+ ...otherParams,
5963
+ state: 0,
5964
+ onlyCompositions: entityType === "composition" ? true : void 0,
5965
+ onlyPatterns: entityType === "pattern" ? true : void 0,
5966
+ mode: getPushMode(entityType, config2),
5967
+ directory: getPushFilename(entityType, config2)
5968
+ });
5969
+ }
5970
+ if (((_a = config2.entitiesConfig) == null ? void 0 : _a.pattern) && ((_d = (_c = (_b = config2.entitiesConfig) == null ? void 0 : _b.pattern) == null ? void 0 : _c.push) == null ? void 0 : _d.disabled) !== true && ((_f = (_e = config2.entitiesConfig) == null ? void 0 : _e.pattern) == null ? void 0 : _f.publish)) {
5971
+ await PatternPublishModule.handler({ ...otherParams, all: true });
5972
+ }
5973
+ if (((_g = config2.entitiesConfig) == null ? void 0 : _g.composition) && ((_j = (_i = (_h = config2.entitiesConfig) == null ? void 0 : _h.composition) == null ? void 0 : _i.push) == null ? void 0 : _j.disabled) !== true && ((_l = (_k = config2.entitiesConfig) == null ? void 0 : _k.composition) == null ? void 0 : _l.publish)) {
5974
+ await CompositionPublishModule.handler({ ...otherParams, all: true });
5975
+ }
5976
+ }
5977
+ };
5978
+ var getPushMode = (entityType, config2) => {
5979
+ return getEntityOption({
5980
+ optionName: "mode",
5981
+ operation: "push",
5982
+ config: config2,
5983
+ entityType
5984
+ });
5985
+ };
5986
+ var getPushFilename = (entityType, config2) => {
5987
+ return getDirectoryOrFilename({
5988
+ operation: "push",
5989
+ config: config2,
5990
+ entityType
5991
+ });
5992
+ };
5993
+
5994
+ // src/commands/sync/index.ts
5995
+ var SyncCommand = {
5996
+ command: "sync <command>",
5997
+ describe: "Uniform Sync commands",
5998
+ builder: (yargs23) => yargs23.command(SyncPullModule).command(SyncPushModule).demandCommand(),
5420
5999
  handler: () => {
5421
- yargs19.showHelp();
6000
+ yargs21.showHelp();
5422
6001
  }
5423
6002
  };
5424
6003
 
@@ -5534,9 +6113,30 @@ First found was: v${firstVersion}`;
5534
6113
 
5535
6114
  // src/index.ts
5536
6115
  dotenv.config();
5537
- var yarggery = yargs20(hideBin(process.argv));
6116
+ var yarggery = yargs22(hideBin(process.argv));
6117
+ var moduleName = "uniform";
6118
+ var syncCosmicExplorer = cosmiconfigSync("uniform", {
6119
+ searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.ts`, `${moduleName}.config.json`],
6120
+ loaders: {
6121
+ ".ts": TypeScriptLoader()
6122
+ }
6123
+ });
6124
+ var searchedForm = syncCosmicExplorer.search();
6125
+ var cosmicConfig = applyDefaultSyncConfiguration((searchedForm == null ? void 0 : searchedForm.config) ?? {});
5538
6126
  yarggery.option("verbose", {
5539
6127
  describe: "Include verbose logging",
5540
6128
  default: false,
5541
6129
  type: "boolean"
5542
- }).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).argv;
6130
+ }).scriptName("uniform").config(cosmicConfig).config("config", function(configPath) {
6131
+ if (!fs5.existsSync(configPath)) {
6132
+ throw new Error(`Invalid configuration file path: ${configPath}. File does not exist.`);
6133
+ }
6134
+ const config2 = syncCosmicExplorer.load(configPath);
6135
+ if (!(config2 == null ? void 0 : config2.config.serialization)) {
6136
+ throw new Error(
6137
+ `Invalid configuration file: ${configPath}. Missing config.serialization configuration.`
6138
+ );
6139
+ }
6140
+ const configuration = applyDefaultSyncConfiguration((config2 == null ? void 0 : config2.config) ?? {});
6141
+ return { serialization: configuration.serialization };
6142
+ }).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).argv;