@uniformdev/cli 19.41.0 → 19.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  // src/index.ts
4
4
  import * as dotenv from "dotenv";
5
- import yargs20 from "yargs";
5
+ import yargs22 from "yargs";
6
6
  import { hideBin } from "yargs/helpers";
7
7
 
8
8
  // src/commands/canvas/index.ts
9
- import yargs5 from "yargs";
9
+ import yargs6 from "yargs";
10
10
 
11
11
  // src/commands/canvas/commands/category.ts
12
12
  import yargs from "yargs";
@@ -75,6 +75,9 @@ import { readdir, unlink } from "fs/promises";
75
75
  import { extname as extname2, join } from "path";
76
76
 
77
77
  // src/util.ts
78
+ import { cosmiconfigSync } from "cosmiconfig";
79
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
80
+ import fs from "fs";
78
81
  var omit = (object, keys) => {
79
82
  const result = keys.reduce((current, key) => {
80
83
  const { [key]: _, ...rest } = current;
@@ -85,6 +88,30 @@ var omit = (object, keys) => {
85
88
  var cleanFileName = (proposedFileName) => {
86
89
  return proposedFileName.replace(/[/<>$+%>!`&*'|{}?"=:\\@]/g, "-");
87
90
  };
91
+ var loadConfig = (configPath) => {
92
+ const moduleName = "uniform";
93
+ const syncCosmicExplorer = cosmiconfigSync("uniform", {
94
+ searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.ts`, `${moduleName}.config.json`],
95
+ loaders: {
96
+ ".ts": TypeScriptLoader()
97
+ }
98
+ });
99
+ if (configPath) {
100
+ if (!fs.existsSync(configPath)) {
101
+ throw new Error(`Invalid configuration file path: ${configPath}. File does not exist.`);
102
+ }
103
+ const configFile = syncCosmicExplorer.load(configPath);
104
+ if (!(configFile == null ? void 0 : configFile.config.serialization)) {
105
+ throw new Error(
106
+ `Invalid configuration file: ${configPath}. Missing config.serialization configuration.`
107
+ );
108
+ }
109
+ return applyDefaultSyncConfiguration((configFile == null ? void 0 : configFile.config) ?? {});
110
+ } else {
111
+ const searchedForm = syncCosmicExplorer.search();
112
+ return applyDefaultSyncConfiguration((searchedForm == null ? void 0 : searchedForm.config) ?? {});
113
+ }
114
+ };
88
115
 
89
116
  // src/sync/util.ts
90
117
  import { readFileSync, writeFileSync } from "fs";
@@ -92,8 +119,14 @@ import httpsProxyAgent from "https-proxy-agent";
92
119
  import unfetch from "isomorphic-unfetch";
93
120
  import { dump, load } from "js-yaml";
94
121
  import { extname } from "path";
95
- function withApiOptions(yargs21) {
96
- return yargs21.option("apiKey", {
122
+ function withConfiguration(yargs23) {
123
+ return yargs23.option("serialization", {
124
+ skipValidation: true,
125
+ hidden: true
126
+ });
127
+ }
128
+ function withApiOptions(yargs23) {
129
+ return yargs23.option("apiKey", {
97
130
  describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
98
131
  default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
99
132
  process.env.CANVAS_CLI_API_KEY ?? // deprecated
@@ -132,8 +165,8 @@ function nodeFetchProxy(proxy) {
132
165
  };
133
166
  return wrappedFetch;
134
167
  }
135
- function withProjectOptions(yargs21) {
136
- return yargs21.option("project", {
168
+ function withProjectOptions(yargs23) {
169
+ return yargs23.option("project", {
137
170
  describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
138
171
  default: process.env.UNIFORM_CLI_PROJECT_ID ?? // deprecated
139
172
  process.env.CANVAS_CLI_PROJECT_ID ?? // deprecated
@@ -143,8 +176,8 @@ function withProjectOptions(yargs21) {
143
176
  alias: ["p"]
144
177
  });
145
178
  }
146
- function withFormatOptions(yargs21) {
147
- return yargs21.option("format", {
179
+ function withFormatOptions(yargs23) {
180
+ return yargs23.option("format", {
148
181
  alias: ["f"],
149
182
  describe: "Output format",
150
183
  default: "yaml",
@@ -156,8 +189,8 @@ function withFormatOptions(yargs21) {
156
189
  type: "string"
157
190
  });
158
191
  }
159
- function withDiffOptions(yargs21) {
160
- return yargs21.option("diff", {
192
+ function withDiffOptions(yargs23) {
193
+ return yargs23.option("diff", {
161
194
  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
195
  default: process.env.UNIFORM_CLI_DIFF_MODE ?? "off",
163
196
  type: "string",
@@ -217,6 +250,72 @@ async function* paginateAsync(fetchPage, options) {
217
250
  offset += perPage;
218
251
  } while (pageData.length === perPage);
219
252
  }
253
+ var defaultSyncConfiguration = {
254
+ entitiesConfig: {},
255
+ directory: "uniform-data",
256
+ format: "yaml",
257
+ mode: "mirror"
258
+ };
259
+ var applyDefaultSyncConfiguration = (config2) => {
260
+ var _a;
261
+ const mergedConfig = {
262
+ serialization: {
263
+ ...defaultSyncConfiguration,
264
+ ...(config2 == null ? void 0 : config2.serialization) ?? {},
265
+ entitiesConfig: {
266
+ ...defaultSyncConfiguration.entitiesConfig,
267
+ ...((_a = config2 == null ? void 0 : config2.serialization) == null ? void 0 : _a.entitiesConfig) ?? {}
268
+ }
269
+ }
270
+ };
271
+ for (const entityType in mergedConfig.serialization.entitiesConfig) {
272
+ const entityTypeCasted = entityType;
273
+ const entityConfig = mergedConfig.serialization.entitiesConfig[entityTypeCasted];
274
+ if (Object.keys(entityConfig).length === 0) {
275
+ const separator = mergedConfig.serialization.directory[mergedConfig.serialization.directory.length - 1] === "/" ? "" : "/";
276
+ mergedConfig.serialization.entitiesConfig[entityTypeCasted].directory = isPathAPackageFile(
277
+ mergedConfig.serialization.directory
278
+ ) ? mergedConfig.serialization.directory : `${mergedConfig.serialization.directory}${separator}${entityTypeCasted}`;
279
+ }
280
+ }
281
+ return mergedConfig;
282
+ };
283
+ var getEntityOption = ({
284
+ optionName,
285
+ config: config2,
286
+ entityType,
287
+ operation
288
+ }) => {
289
+ var _a, _b, _c, _d, _e, _f;
290
+ if ((_b = (_a = config2.entitiesConfig[entityType]) == null ? void 0 : _a[operation]) == null ? void 0 : _b[optionName]) {
291
+ return (_d = (_c = config2.entitiesConfig[entityType]) == null ? void 0 : _c[operation]) == null ? void 0 : _d[optionName];
292
+ }
293
+ if ((_e = config2.entitiesConfig[entityType]) == null ? void 0 : _e[optionName]) {
294
+ return (_f = config2.entitiesConfig[entityType]) == null ? void 0 : _f[optionName];
295
+ }
296
+ if (config2[optionName]) {
297
+ return config2[optionName];
298
+ }
299
+ throw `No ${optionName} option specified for ${entityType} ${operation}`;
300
+ };
301
+ var getDirectoryOrFilename = ({
302
+ config: config2,
303
+ entityType,
304
+ operation
305
+ }) => {
306
+ var _a, _b, _c, _d, _e, _f;
307
+ if ((_b = (_a = config2.entitiesConfig[entityType]) == null ? void 0 : _a[operation]) == null ? void 0 : _b.directory) {
308
+ return (_d = (_c = config2.entitiesConfig[entityType]) == null ? void 0 : _c[operation]) == null ? void 0 : _d.directory;
309
+ }
310
+ if ((_e = config2.entitiesConfig[entityType]) == null ? void 0 : _e.directory) {
311
+ return (_f = config2.entitiesConfig[entityType]) == null ? void 0 : _f.directory;
312
+ }
313
+ const isPackage = isPathAPackageFile(config2.directory);
314
+ if (isPackage) {
315
+ return config2.directory;
316
+ }
317
+ return `${config2.directory}/${entityType}`;
318
+ };
220
319
 
221
320
  // src/sync/fileSyncEngineDataSource.ts
222
321
  async function createFileSyncEngineDataSource({
@@ -279,9 +378,9 @@ ${e == null ? void 0 : e.message}`));
279
378
  }
280
379
 
281
380
  // src/sync/package.ts
282
- import fs from "fs";
381
+ import fs2 from "fs";
283
382
  function readUniformPackage(filename, assertExists) {
284
- if (!assertExists && !fs.existsSync(filename)) {
383
+ if (!assertExists && !fs2.existsSync(filename)) {
285
384
  return {};
286
385
  }
287
386
  const packageContents = readFileToObject(filename);
@@ -475,9 +574,13 @@ function createSyncEngineConsoleLogger(options) {
475
574
  var CategoryGetModule = {
476
575
  command: "get <id>",
477
576
  describe: "Fetch a category",
478
- builder: (yargs21) => withFormatOptions(
479
- withApiOptions(
480
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Category UUID to fetch" }))
577
+ builder: (yargs23) => withConfiguration(
578
+ withFormatOptions(
579
+ withApiOptions(
580
+ withProjectOptions(
581
+ yargs23.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
582
+ )
583
+ )
481
584
  )
482
585
  ),
483
586
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
@@ -500,7 +603,7 @@ var CategoryListModule = {
500
603
  command: "list",
501
604
  describe: "List categories",
502
605
  aliases: ["ls"],
503
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21.options({})))),
606
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23.options({}))))),
504
607
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
505
608
  const fetch3 = nodeFetchProxy(proxy);
506
609
  const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -557,30 +660,32 @@ function writeCanvasPackage(filename, packageContents) {
557
660
  var CategoryPullModule = {
558
661
  command: "pull <directory>",
559
662
  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
- })
663
+ builder: (yargs23) => withConfiguration(
664
+ withApiOptions(
665
+ withProjectOptions(
666
+ withDiffOptions(
667
+ yargs23.positional("directory", {
668
+ 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.",
669
+ type: "string"
670
+ }).option("format", {
671
+ alias: ["f"],
672
+ describe: "Output format",
673
+ default: "yaml",
674
+ choices: ["yaml", "json"],
675
+ type: "string"
676
+ }).option("what-if", {
677
+ alias: ["w"],
678
+ describe: "What-if mode reports what would be done but changes no files",
679
+ default: false,
680
+ type: "boolean"
681
+ }).option("mode", {
682
+ alias: ["m"],
683
+ 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',
684
+ choices: ["create", "createOrUpdate", "mirror"],
685
+ default: "mirror",
686
+ type: "string"
687
+ })
688
+ )
584
689
  )
585
690
  )
586
691
  ),
@@ -634,24 +739,26 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
634
739
  var CategoryPushModule = {
635
740
  command: "push <directory>",
636
741
  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
- })
742
+ builder: (yargs23) => withConfiguration(
743
+ withApiOptions(
744
+ withProjectOptions(
745
+ withDiffOptions(
746
+ yargs23.positional("directory", {
747
+ describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
748
+ type: "string"
749
+ }).option("what-if", {
750
+ alias: ["w"],
751
+ describe: "What-if mode reports what would be done but changes nothing",
752
+ default: false,
753
+ type: "boolean"
754
+ }).option("mode", {
755
+ alias: ["m"],
756
+ 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',
757
+ choices: ["create", "createOrUpdate", "mirror"],
758
+ default: "mirror",
759
+ type: "string"
760
+ })
761
+ )
655
762
  )
656
763
  )
657
764
  ),
@@ -700,8 +807,12 @@ var CategoryRemoveModule = {
700
807
  command: "remove <id>",
701
808
  aliases: ["delete", "rm"],
702
809
  describe: "Delete a category",
703
- builder: (yargs21) => withApiOptions(
704
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Category UUID to delete" }))
810
+ builder: (yargs23) => withConfiguration(
811
+ withApiOptions(
812
+ withProjectOptions(
813
+ yargs23.positional("id", { demandOption: true, describe: "Category UUID to delete" })
814
+ )
815
+ )
705
816
  ),
706
817
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
707
818
  const fetch3 = nodeFetchProxy(proxy);
@@ -716,9 +827,11 @@ var CategoryUpdateModule = {
716
827
  command: "update <filename>",
717
828
  aliases: ["put"],
718
829
  describe: "Insert or update a category",
719
- builder: (yargs21) => withApiOptions(
720
- withProjectOptions(
721
- yargs21.positional("filename", { demandOption: true, describe: "Category file to put" })
830
+ builder: (yargs23) => withConfiguration(
831
+ withApiOptions(
832
+ withProjectOptions(
833
+ yargs23.positional("filename", { demandOption: true, describe: "Category file to put" })
834
+ )
722
835
  )
723
836
  ),
724
837
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -734,7 +847,7 @@ var CategoryModule = {
734
847
  command: "category <command>",
735
848
  aliases: ["cat"],
736
849
  describe: "Commands for Canvas categories",
737
- builder: (yargs21) => yargs21.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
850
+ builder: (yargs23) => yargs23.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
738
851
  handler: () => {
739
852
  yargs.help();
740
853
  }
@@ -755,10 +868,15 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
755
868
  var ComponentGetModule = {
756
869
  command: "get <id>",
757
870
  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" })
871
+ builder: (yargs23) => withConfiguration(
872
+ withFormatOptions(
873
+ withApiOptions(
874
+ withProjectOptions(
875
+ yargs23.positional("id", {
876
+ demandOption: true,
877
+ describe: "Component definition public ID to fetch"
878
+ })
879
+ )
762
880
  )
763
881
  )
764
882
  ),
@@ -788,13 +906,15 @@ var ComponentListModule = {
788
906
  command: "list",
789
907
  describe: "List component definitions",
790
908
  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
- })
909
+ builder: (yargs23) => withConfiguration(
910
+ withFormatOptions(
911
+ withApiOptions(
912
+ withProjectOptions(
913
+ yargs23.options({
914
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
915
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
916
+ })
917
+ )
798
918
  )
799
919
  )
800
920
  ),
@@ -845,30 +965,32 @@ function createComponentDefinitionEngineDataSource({
845
965
  var ComponentPullModule = {
846
966
  command: "pull <directory>",
847
967
  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
- })
968
+ builder: (yargs23) => withConfiguration(
969
+ withApiOptions(
970
+ withProjectOptions(
971
+ withDiffOptions(
972
+ yargs23.positional("directory", {
973
+ 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.",
974
+ type: "string"
975
+ }).option("format", {
976
+ alias: ["f"],
977
+ describe: "Output format",
978
+ default: "yaml",
979
+ choices: ["yaml", "json"],
980
+ type: "string"
981
+ }).option("what-if", {
982
+ alias: ["w"],
983
+ describe: "What-if mode reports what would be done but changes no files",
984
+ default: false,
985
+ type: "boolean"
986
+ }).option("mode", {
987
+ alias: ["m"],
988
+ 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',
989
+ choices: ["create", "createOrUpdate", "mirror"],
990
+ default: "mirror",
991
+ type: "string"
992
+ })
993
+ )
872
994
  )
873
995
  )
874
996
  ),
@@ -923,24 +1045,26 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
923
1045
  var ComponentPushModule = {
924
1046
  command: "push <directory>",
925
1047
  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
- })
1048
+ builder: (yargs23) => withConfiguration(
1049
+ withApiOptions(
1050
+ withProjectOptions(
1051
+ withDiffOptions(
1052
+ yargs23.positional("directory", {
1053
+ describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
1054
+ type: "string"
1055
+ }).option("what-if", {
1056
+ alias: ["w"],
1057
+ describe: "What-if mode reports what would be done but changes nothing",
1058
+ default: false,
1059
+ type: "boolean"
1060
+ }).option("mode", {
1061
+ alias: ["m"],
1062
+ 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',
1063
+ choices: ["create", "createOrUpdate", "mirror"],
1064
+ default: "mirror",
1065
+ type: "string"
1066
+ })
1067
+ )
944
1068
  )
945
1069
  )
946
1070
  ),
@@ -990,9 +1114,11 @@ var ComponentRemoveModule = {
990
1114
  command: "remove <id>",
991
1115
  aliases: ["delete", "rm"],
992
1116
  describe: "Delete a component definition",
993
- builder: (yargs21) => withApiOptions(
994
- withProjectOptions(
995
- yargs21.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
1117
+ builder: (yargs23) => withConfiguration(
1118
+ withApiOptions(
1119
+ withProjectOptions(
1120
+ yargs23.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
1121
+ )
996
1122
  )
997
1123
  ),
998
1124
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1008,9 +1134,11 @@ var ComponentUpdateModule = {
1008
1134
  command: "update <filename>",
1009
1135
  aliases: ["put"],
1010
1136
  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" })
1137
+ builder: (yargs23) => withConfiguration(
1138
+ withApiOptions(
1139
+ withProjectOptions(
1140
+ yargs23.positional("filename", { demandOption: true, describe: "Component definition file to put" })
1141
+ )
1014
1142
  )
1015
1143
  ),
1016
1144
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -1026,7 +1154,7 @@ var ComponentModule = {
1026
1154
  command: "component <command>",
1027
1155
  aliases: ["def"],
1028
1156
  describe: "Commands for Canvas component definitions",
1029
- builder: (yargs21) => yargs21.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
1157
+ builder: (yargs23) => yargs23.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
1030
1158
  handler: () => {
1031
1159
  yargs2.help();
1032
1160
  }
@@ -1048,8 +1176,8 @@ function prepCompositionForDisk(composition) {
1048
1176
  delete prepped.state;
1049
1177
  return prepped;
1050
1178
  }
1051
- function withStateOptions(yargs21) {
1052
- return yargs21.option("state", {
1179
+ function withStateOptions(yargs23) {
1180
+ return yargs23.option("state", {
1053
1181
  type: "string",
1054
1182
  describe: `Composition state to fetch.`,
1055
1183
  choices: ["preview", "published"],
@@ -1074,37 +1202,39 @@ function convertCompositionState(state) {
1074
1202
  var CompositionGetModule = {
1075
1203
  command: "get <id>",
1076
1204
  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
- })
1205
+ builder: (yargs23) => withFormatOptions(
1206
+ withConfiguration(
1207
+ withApiOptions(
1208
+ withProjectOptions(
1209
+ withStateOptions(
1210
+ yargs23.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
1211
+ resolvePatterns: {
1212
+ type: "boolean",
1213
+ default: false,
1214
+ describe: "Resolve pattern references in the composition"
1215
+ },
1216
+ resolveOverrides: {
1217
+ type: "boolean",
1218
+ default: false,
1219
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
1220
+ },
1221
+ componentIDs: {
1222
+ type: "boolean",
1223
+ default: false,
1224
+ describe: "Include individual component UIDs"
1225
+ },
1226
+ resolveData: {
1227
+ type: "boolean",
1228
+ default: false,
1229
+ describe: "Resolve all data resources used by the composition/pattern"
1230
+ },
1231
+ diagnostics: {
1232
+ type: "boolean",
1233
+ default: false,
1234
+ describe: "Include diagnostics information when resolving data"
1235
+ }
1236
+ })
1237
+ )
1108
1238
  )
1109
1239
  )
1110
1240
  )
@@ -1148,29 +1278,42 @@ var CompositionListModule = {
1148
1278
  command: "list",
1149
1279
  describe: "List compositions",
1150
1280
  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
- })
1281
+ builder: (yargs23) => withFormatOptions(
1282
+ withConfiguration(
1283
+ withApiOptions(
1284
+ withProjectOptions(
1285
+ withStateOptions(
1286
+ yargs23.options({
1287
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
1288
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
1289
+ resolvePatterns: {
1290
+ type: "boolean",
1291
+ default: false,
1292
+ describe: "Resolve pattern references in the composition"
1293
+ },
1294
+ resolveOverrides: {
1295
+ type: "boolean",
1296
+ default: false,
1297
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
1298
+ },
1299
+ onlyCompositions: {
1300
+ describe: "Only pulling compositions and not patterns",
1301
+ default: false,
1302
+ type: "boolean"
1303
+ },
1304
+ onlyPatterns: {
1305
+ describe: "Only pulling patterns and not compositions",
1306
+ default: false,
1307
+ type: "boolean",
1308
+ hidden: true
1309
+ },
1310
+ componentIDs: {
1311
+ type: "boolean",
1312
+ default: false,
1313
+ describe: "Include individual component UIDs"
1314
+ }
1315
+ })
1316
+ )
1174
1317
  )
1175
1318
  )
1176
1319
  )
@@ -1183,6 +1326,8 @@ var CompositionListModule = {
1183
1326
  offset,
1184
1327
  format,
1185
1328
  filename,
1329
+ onlyCompositions,
1330
+ onlyPatterns,
1186
1331
  project: projectId,
1187
1332
  state,
1188
1333
  resolvePatterns,
@@ -1194,6 +1339,7 @@ var CompositionListModule = {
1194
1339
  const res = await client.getCompositionList({
1195
1340
  limit,
1196
1341
  offset,
1342
+ pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
1197
1343
  state: convertCompositionState(state),
1198
1344
  skipPatternResolution: !resolvePatterns,
1199
1345
  withComponentIDs: componentIDs,
@@ -1214,6 +1360,8 @@ var selectDisplayName3 = (component) => `${component.composition._name ?? compon
1214
1360
  function createComponentInstanceEngineDataSource({
1215
1361
  client,
1216
1362
  state,
1363
+ onlyCompositions,
1364
+ onlyPatterns,
1217
1365
  ...clientOptions
1218
1366
  }) {
1219
1367
  const stateId = convertCompositionState(state);
@@ -1223,6 +1371,7 @@ function createComponentInstanceEngineDataSource({
1223
1371
  ...clientOptions,
1224
1372
  limit,
1225
1373
  offset,
1374
+ pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
1226
1375
  state: stateId,
1227
1376
  skipPatternResolution: true,
1228
1377
  skipOverridesResolution: true,
@@ -1253,43 +1402,36 @@ function createComponentInstanceEngineDataSource({
1253
1402
 
1254
1403
  // src/commands/canvas/commands/composition/publish.ts
1255
1404
  var CompositionPublishModule = {
1256
- command: "publish [compositionIDs]",
1405
+ command: "publish [ids]",
1257
1406
  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
- })
1407
+ builder: (yargs23) => withConfiguration(
1408
+ withApiOptions(
1409
+ withProjectOptions(
1410
+ withDiffOptions(
1411
+ yargs23.positional("ids", {
1412
+ describe: "Publishes composition/pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
1413
+ type: "string"
1414
+ }).option("all", {
1415
+ alias: ["a"],
1416
+ describe: "Publishes all compositions. Use compositionId to publish one instead.",
1417
+ default: false,
1418
+ type: "boolean"
1419
+ }).option("what-if", {
1420
+ alias: ["w"],
1421
+ describe: "What-if mode reports what would be done but does not perform any publishing",
1422
+ default: false,
1423
+ type: "boolean"
1424
+ })
1425
+ )
1275
1426
  )
1276
1427
  )
1277
1428
  ),
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) {
1429
+ handler: async ({ apiHost, apiKey, proxy, ids, all, whatIf, project: projectId, diff: diffMode }) => {
1430
+ if (!all && !ids || all && ids) {
1289
1431
  console.error(`Specify --all or composition ID(s) to publish.`);
1290
1432
  process.exit(1);
1291
1433
  }
1292
- const compositionIDsArray = compositionIDs ? compositionIDs.split(",").map((id) => id.trim()) : void 0;
1434
+ const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
1293
1435
  const fetch3 = nodeFetchProxy(proxy);
1294
1436
  const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
1295
1437
  const source = createComponentInstanceEngineDataSource({
@@ -1317,31 +1459,42 @@ import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canv
1317
1459
  var CompositionPullModule = {
1318
1460
  command: "pull <directory>",
1319
1461
  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
- })
1462
+ builder: (yargs23) => withConfiguration(
1463
+ withApiOptions(
1464
+ withProjectOptions(
1465
+ withStateOptions(
1466
+ withDiffOptions(
1467
+ yargs23.positional("directory", {
1468
+ 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.",
1469
+ type: "string"
1470
+ }).option("format", {
1471
+ alias: ["f"],
1472
+ describe: "Output format",
1473
+ default: "yaml",
1474
+ choices: ["yaml", "json"],
1475
+ type: "string"
1476
+ }).option("onlyCompositions", {
1477
+ describe: "Only pulling compositions and not patterns",
1478
+ default: false,
1479
+ type: "boolean"
1480
+ }).option("onlyPatterns", {
1481
+ describe: "Only pulling patterns and not compositions",
1482
+ default: false,
1483
+ type: "boolean",
1484
+ hidden: true
1485
+ }).option("what-if", {
1486
+ alias: ["w"],
1487
+ describe: "What-if mode reports what would be done but changes no files",
1488
+ default: false,
1489
+ type: "boolean"
1490
+ }).option("mode", {
1491
+ alias: ["m"],
1492
+ 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',
1493
+ choices: ["create", "createOrUpdate", "mirror"],
1494
+ default: "mirror",
1495
+ type: "string"
1496
+ })
1497
+ )
1345
1498
  )
1346
1499
  )
1347
1500
  )
@@ -1352,6 +1505,8 @@ var CompositionPullModule = {
1352
1505
  proxy,
1353
1506
  directory,
1354
1507
  format,
1508
+ onlyCompositions,
1509
+ onlyPatterns,
1355
1510
  mode,
1356
1511
  whatIf,
1357
1512
  state,
@@ -1360,7 +1515,7 @@ var CompositionPullModule = {
1360
1515
  }) => {
1361
1516
  const fetch3 = nodeFetchProxy(proxy);
1362
1517
  const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
1363
- const source = createComponentInstanceEngineDataSource({ client, state });
1518
+ const source = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
1364
1519
  const isPackage = isPathAPackageFile(directory);
1365
1520
  let target;
1366
1521
  if (isPackage) {
@@ -1397,30 +1552,41 @@ import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canv
1397
1552
  var CompositionPushModule = {
1398
1553
  command: "push <directory>",
1399
1554
  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
- })
1419
- )
1420
- )
1421
- )
1422
- ),
1423
- handler: async ({
1555
+ builder: (yargs23) => withConfiguration(
1556
+ withApiOptions(
1557
+ withProjectOptions(
1558
+ withStateOptions(
1559
+ withDiffOptions(
1560
+ yargs23.positional("directory", {
1561
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
1562
+ type: "string"
1563
+ }).option("what-if", {
1564
+ alias: ["w"],
1565
+ describe: "What-if mode reports what would be done but changes nothing",
1566
+ default: false,
1567
+ type: "boolean"
1568
+ }).option("mode", {
1569
+ alias: ["m"],
1570
+ 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',
1571
+ choices: ["create", "createOrUpdate", "mirror"],
1572
+ default: "mirror",
1573
+ type: "string"
1574
+ }).option("onlyCompositions", {
1575
+ describe: "Only pulling compositions and not patterns",
1576
+ default: false,
1577
+ type: "boolean"
1578
+ }).option("onlyPatterns", {
1579
+ describe: "Only pulling patterns and not compositions",
1580
+ default: false,
1581
+ type: "boolean",
1582
+ hidden: true
1583
+ })
1584
+ )
1585
+ )
1586
+ )
1587
+ )
1588
+ ),
1589
+ handler: async ({
1424
1590
  apiHost,
1425
1591
  apiKey,
1426
1592
  proxy,
@@ -1429,6 +1595,8 @@ var CompositionPushModule = {
1429
1595
  whatIf,
1430
1596
  state,
1431
1597
  project: projectId,
1598
+ onlyCompositions,
1599
+ onlyPatterns,
1432
1600
  diff: diffMode
1433
1601
  }) => {
1434
1602
  const fetch3 = nodeFetchProxy(proxy);
@@ -1449,7 +1617,7 @@ var CompositionPushModule = {
1449
1617
  selectDisplayName: selectDisplayName3
1450
1618
  });
1451
1619
  }
1452
- const target = createComponentInstanceEngineDataSource({ client, state });
1620
+ const target = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
1453
1621
  await syncEngine({
1454
1622
  source,
1455
1623
  target,
@@ -1466,9 +1634,11 @@ var CompositionRemoveModule = {
1466
1634
  command: "remove <id>",
1467
1635
  aliases: ["delete", "rm"],
1468
1636
  describe: "Delete a composition",
1469
- builder: (yargs21) => withApiOptions(
1470
- withProjectOptions(
1471
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to delete" })
1637
+ builder: (yargs23) => withConfiguration(
1638
+ withApiOptions(
1639
+ withProjectOptions(
1640
+ yargs23.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
1641
+ )
1472
1642
  )
1473
1643
  ),
1474
1644
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1483,9 +1653,14 @@ import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2, UncachedCanvasClient
1483
1653
  var CompositionUnpublishModule = {
1484
1654
  command: "unpublish <id>",
1485
1655
  describe: "Unpublish a composition",
1486
- builder: (yargs21) => withApiOptions(
1487
- withProjectOptions(
1488
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to unpublish" })
1656
+ builder: (yargs23) => withConfiguration(
1657
+ withApiOptions(
1658
+ withProjectOptions(
1659
+ yargs23.positional("id", {
1660
+ demandOption: true,
1661
+ describe: "Composition/pattern public ID to unpublish"
1662
+ })
1663
+ )
1489
1664
  )
1490
1665
  ),
1491
1666
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1501,10 +1676,12 @@ var CompositionUpdateModule = {
1501
1676
  command: "update <filename>",
1502
1677
  aliases: ["put"],
1503
1678
  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" })
1679
+ builder: (yargs23) => withConfiguration(
1680
+ withApiOptions(
1681
+ withProjectOptions(
1682
+ withStateOptions(
1683
+ yargs23.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
1684
+ )
1508
1685
  )
1509
1686
  )
1510
1687
  ),
@@ -1521,7 +1698,7 @@ var CompositionModule = {
1521
1698
  command: "composition <command>",
1522
1699
  describe: "Commands for Canvas compositions",
1523
1700
  aliases: ["comp"],
1524
- builder: (yargs21) => yargs21.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
1701
+ builder: (yargs23) => yargs23.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
1525
1702
  handler: () => {
1526
1703
  yargs3.help();
1527
1704
  }
@@ -1536,11 +1713,13 @@ var DataTypeGetModule = {
1536
1713
  command: "get <id>",
1537
1714
  describe: "Get a data type",
1538
1715
  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" })
1716
+ builder: (yargs23) => withConfiguration(
1717
+ withFormatOptions(
1718
+ withApiOptions(
1719
+ withProjectOptions(
1720
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1721
+ yargs23.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
1722
+ )
1544
1723
  )
1545
1724
  )
1546
1725
  ),
@@ -1562,7 +1741,7 @@ var DataTypeListModule = {
1562
1741
  command: "list",
1563
1742
  describe: "List data types",
1564
1743
  aliases: ["ls"],
1565
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
1744
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
1566
1745
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
1567
1746
  const fetch3 = nodeFetchProxy(proxy);
1568
1747
  const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
@@ -1611,30 +1790,32 @@ function createDataTypeEngineDataSource({
1611
1790
  var DataTypePullModule = {
1612
1791
  command: "pull <directory>",
1613
1792
  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
- })
1793
+ builder: (yargs23) => withConfiguration(
1794
+ withApiOptions(
1795
+ withProjectOptions(
1796
+ withDiffOptions(
1797
+ yargs23.positional("directory", {
1798
+ 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.",
1799
+ type: "string"
1800
+ }).option("format", {
1801
+ alias: ["f"],
1802
+ describe: "Output format",
1803
+ default: "yaml",
1804
+ choices: ["yaml", "json"],
1805
+ type: "string"
1806
+ }).option("what-if", {
1807
+ alias: ["w"],
1808
+ describe: "What-if mode reports what would be done but changes no files",
1809
+ default: false,
1810
+ type: "boolean"
1811
+ }).option("mode", {
1812
+ alias: ["m"],
1813
+ 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',
1814
+ choices: ["create", "createOrUpdate", "mirror"],
1815
+ default: "mirror",
1816
+ type: "string"
1817
+ })
1818
+ )
1638
1819
  )
1639
1820
  )
1640
1821
  ),
@@ -1694,24 +1875,26 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
1694
1875
  var DataTypePushModule = {
1695
1876
  command: "push <directory>",
1696
1877
  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
- })
1878
+ builder: (yargs23) => withConfiguration(
1879
+ withApiOptions(
1880
+ withProjectOptions(
1881
+ withDiffOptions(
1882
+ yargs23.positional("directory", {
1883
+ describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
1884
+ type: "string"
1885
+ }).option("what-if", {
1886
+ alias: ["w"],
1887
+ describe: "What-if mode reports what would be done but changes nothing",
1888
+ default: false,
1889
+ type: "boolean"
1890
+ }).option("mode", {
1891
+ alias: ["m"],
1892
+ 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',
1893
+ choices: ["create", "createOrUpdate", "mirror"],
1894
+ default: "mirror",
1895
+ type: "string"
1896
+ })
1897
+ )
1715
1898
  )
1716
1899
  )
1717
1900
  ),
@@ -1766,9 +1949,11 @@ var DataTypeRemoveModule = {
1766
1949
  command: "remove <id>",
1767
1950
  aliases: ["delete", "rm"],
1768
1951
  describe: "Delete a data type",
1769
- builder: (yargs21) => withApiOptions(
1770
- withProjectOptions(
1771
- yargs21.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
1952
+ builder: (yargs23) => withConfiguration(
1953
+ withApiOptions(
1954
+ withProjectOptions(
1955
+ yargs23.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
1956
+ )
1772
1957
  )
1773
1958
  ),
1774
1959
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1784,9 +1969,11 @@ var DataTypeUpdateModule = {
1784
1969
  command: "update <filename>",
1785
1970
  aliases: ["put"],
1786
1971
  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" })
1972
+ builder: (yargs23) => withConfiguration(
1973
+ withApiOptions(
1974
+ withProjectOptions(
1975
+ yargs23.positional("filename", { demandOption: true, describe: "Data type file to put" })
1976
+ )
1790
1977
  )
1791
1978
  ),
1792
1979
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -1802,38 +1989,206 @@ var DataTypeModule = {
1802
1989
  command: "datatype <command>",
1803
1990
  aliases: ["dt"],
1804
1991
  describe: "Commands for Data Type definitions",
1805
- builder: (yargs21) => yargs21.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
1992
+ builder: (yargs23) => yargs23.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
1806
1993
  handler: () => {
1807
1994
  yargs4.help();
1808
1995
  }
1809
1996
  };
1810
1997
 
1998
+ // src/commands/canvas/commands/pattern.ts
1999
+ import yargs5 from "yargs";
2000
+
2001
+ // src/commands/canvas/commands/pattern/get.ts
2002
+ var PatternGetModule = {
2003
+ ...CompositionGetModule,
2004
+ describe: "Fetch a pattern"
2005
+ };
2006
+
2007
+ // src/commands/canvas/commands/pattern/list.ts
2008
+ var PatternListModule = {
2009
+ ...CompositionListModule,
2010
+ describe: "List patterns",
2011
+ builder: (yargs23) => withFormatOptions(
2012
+ withConfiguration(
2013
+ withApiOptions(
2014
+ withProjectOptions(
2015
+ withStateOptions(
2016
+ yargs23.options({
2017
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
2018
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
2019
+ resolvePatterns: {
2020
+ type: "boolean",
2021
+ default: false,
2022
+ describe: "Resolve pattern references in the composition"
2023
+ },
2024
+ resolveOverrides: {
2025
+ type: "boolean",
2026
+ default: false,
2027
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
2028
+ },
2029
+ onlyPatterns: {
2030
+ describe: "Only pulling patterns and not compositions",
2031
+ // This default differentiate this list command from composition list command
2032
+ default: true,
2033
+ type: "boolean",
2034
+ hidden: true
2035
+ },
2036
+ componentIDs: {
2037
+ alias: ["componentIDs"],
2038
+ type: "boolean",
2039
+ default: false,
2040
+ describe: "Include individual component UIDs"
2041
+ }
2042
+ })
2043
+ )
2044
+ )
2045
+ )
2046
+ )
2047
+ )
2048
+ };
2049
+
2050
+ // src/commands/canvas/commands/pattern/publish.ts
2051
+ var PatternPublishModule = {
2052
+ ...CompositionPublishModule,
2053
+ describe: "Publishes patterns"
2054
+ };
2055
+
2056
+ // src/commands/canvas/commands/pattern/pull.ts
2057
+ var PatternPullModule = {
2058
+ ...CompositionPullModule,
2059
+ describe: "Pulls all patterns to local files in a directory",
2060
+ builder: (yargs23) => withConfiguration(
2061
+ withApiOptions(
2062
+ withProjectOptions(
2063
+ withStateOptions(
2064
+ withDiffOptions(
2065
+ yargs23.positional("directory", {
2066
+ 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.",
2067
+ type: "string"
2068
+ }).option("format", {
2069
+ alias: ["f"],
2070
+ describe: "Output format",
2071
+ default: "yaml",
2072
+ choices: ["yaml", "json"],
2073
+ type: "string"
2074
+ }).option("onlyPatterns", {
2075
+ describe: "Only pulling patterns and not compositions",
2076
+ // This default differentiate this list command from composition list command
2077
+ default: true,
2078
+ type: "boolean",
2079
+ hidden: true
2080
+ }).option("what-if", {
2081
+ alias: ["w"],
2082
+ describe: "What-if mode reports what would be done but changes no files",
2083
+ default: false,
2084
+ type: "boolean"
2085
+ }).option("mode", {
2086
+ alias: ["m"],
2087
+ 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',
2088
+ choices: ["create", "createOrUpdate", "mirror"],
2089
+ default: "mirror",
2090
+ type: "string"
2091
+ })
2092
+ )
2093
+ )
2094
+ )
2095
+ )
2096
+ )
2097
+ };
2098
+
2099
+ // src/commands/canvas/commands/pattern/push.ts
2100
+ var PatternPushModule = {
2101
+ ...CompositionPushModule,
2102
+ describe: "Pushes all patterns from files in a directory to Uniform Canvas",
2103
+ builder: (yargs23) => withConfiguration(
2104
+ withApiOptions(
2105
+ withProjectOptions(
2106
+ withStateOptions(
2107
+ withDiffOptions(
2108
+ yargs23.positional("directory", {
2109
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
2110
+ type: "string"
2111
+ }).option("what-if", {
2112
+ alias: ["w"],
2113
+ describe: "What-if mode reports what would be done but changes nothing",
2114
+ default: false,
2115
+ type: "boolean"
2116
+ }).option("mode", {
2117
+ alias: ["m"],
2118
+ 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',
2119
+ choices: ["create", "createOrUpdate", "mirror"],
2120
+ default: "mirror",
2121
+ type: "string"
2122
+ }).option("onlyPatterns", {
2123
+ describe: "Only pulling patterns and not compositions",
2124
+ // This default differentiate this list command from composition list command
2125
+ default: true,
2126
+ type: "boolean",
2127
+ hidden: true
2128
+ })
2129
+ )
2130
+ )
2131
+ )
2132
+ )
2133
+ )
2134
+ };
2135
+
2136
+ // src/commands/canvas/commands/pattern/remove.ts
2137
+ var PatternRemoveModule = {
2138
+ ...CompositionRemoveModule,
2139
+ describe: "Delete a pattern"
2140
+ };
2141
+
2142
+ // src/commands/canvas/commands/pattern/unpublish.ts
2143
+ var PatternUnpublishModule = {
2144
+ ...CompositionUnpublishModule,
2145
+ describe: "Unpublish a pattern"
2146
+ };
2147
+
2148
+ // src/commands/canvas/commands/pattern/update.ts
2149
+ var PatternUpdateModule = {
2150
+ ...CompositionUpdateModule,
2151
+ describe: "Insert or update a pattern"
2152
+ };
2153
+
2154
+ // src/commands/canvas/commands/pattern.ts
2155
+ var PatternModule = {
2156
+ command: "pattern <command>",
2157
+ describe: "Commands for Canvas patterns",
2158
+ builder: (yargs23) => yargs23.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
2159
+ handler: () => {
2160
+ yargs5.help();
2161
+ }
2162
+ };
2163
+
1811
2164
  // src/commands/canvas/index.ts
1812
2165
  var CanvasCommand = {
1813
2166
  command: "canvas <command>",
1814
2167
  aliases: ["cv", "pm", "presentation"],
1815
2168
  describe: "Uniform Canvas commands",
1816
- builder: (yargs21) => yargs21.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).demandCommand(),
2169
+ builder: (yargs23) => yargs23.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).command(PatternModule).demandCommand(),
1817
2170
  handler: () => {
1818
- yargs5.showHelp();
2171
+ yargs6.showHelp();
1819
2172
  }
1820
2173
  };
1821
2174
 
1822
2175
  // src/commands/context/index.ts
1823
- import yargs12 from "yargs";
2176
+ import yargs13 from "yargs";
1824
2177
 
1825
2178
  // src/commands/context/commands/aggregate.ts
1826
- import yargs6 from "yargs";
2179
+ import yargs7 from "yargs";
1827
2180
 
1828
2181
  // src/commands/context/commands/aggregate/get.ts
1829
2182
  import { UncachedAggregateClient } from "@uniformdev/context/api";
1830
2183
  var AggregateGetModule = {
1831
2184
  command: "get <id>",
1832
2185
  describe: "Fetch an aggregate",
1833
- builder: (yargs21) => withFormatOptions(
1834
- withApiOptions(
1835
- withProjectOptions(
1836
- yargs21.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
2186
+ builder: (yargs23) => withConfiguration(
2187
+ withFormatOptions(
2188
+ withApiOptions(
2189
+ withProjectOptions(
2190
+ yargs23.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
2191
+ )
1837
2192
  )
1838
2193
  )
1839
2194
  ),
@@ -1856,7 +2211,7 @@ var AggregateListModule = {
1856
2211
  command: "list",
1857
2212
  describe: "List aggregates",
1858
2213
  aliases: ["ls"],
1859
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
2214
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
1860
2215
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
1861
2216
  const fetch3 = nodeFetchProxy(proxy);
1862
2217
  const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -1922,30 +2277,32 @@ function writeContextPackage(filename, packageContents) {
1922
2277
  var AggregatePullModule = {
1923
2278
  command: "pull <directory>",
1924
2279
  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
- })
2280
+ builder: (yargs23) => withConfiguration(
2281
+ withApiOptions(
2282
+ withProjectOptions(
2283
+ withDiffOptions(
2284
+ yargs23.positional("directory", {
2285
+ 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.",
2286
+ type: "string"
2287
+ }).option("format", {
2288
+ alias: ["f"],
2289
+ describe: "Output format",
2290
+ default: "yaml",
2291
+ choices: ["yaml", "json"],
2292
+ type: "string"
2293
+ }).option("what-if", {
2294
+ alias: ["w"],
2295
+ describe: "What-if mode reports what would be done but changes no files",
2296
+ default: false,
2297
+ type: "boolean"
2298
+ }).option("mode", {
2299
+ alias: ["m"],
2300
+ 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',
2301
+ choices: ["create", "createOrUpdate", "mirror"],
2302
+ default: "mirror",
2303
+ type: "string"
2304
+ })
2305
+ )
1949
2306
  )
1950
2307
  )
1951
2308
  ),
@@ -1999,24 +2356,26 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
1999
2356
  var AggregatePushModule = {
2000
2357
  command: "push <directory>",
2001
2358
  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
- })
2359
+ builder: (yargs23) => withConfiguration(
2360
+ withApiOptions(
2361
+ withProjectOptions(
2362
+ withDiffOptions(
2363
+ yargs23.positional("directory", {
2364
+ describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
2365
+ type: "string"
2366
+ }).option("what-if", {
2367
+ alias: ["w"],
2368
+ describe: "What-if mode reports what would be done but changes nothing",
2369
+ default: false,
2370
+ type: "boolean"
2371
+ }).option("mode", {
2372
+ alias: ["m"],
2373
+ 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',
2374
+ choices: ["create", "createOrUpdate", "mirror"],
2375
+ default: "mirror",
2376
+ type: "string"
2377
+ })
2378
+ )
2020
2379
  )
2021
2380
  )
2022
2381
  ),
@@ -2066,9 +2425,11 @@ var AggregateRemoveModule = {
2066
2425
  command: "remove <id>",
2067
2426
  aliases: ["delete", "rm"],
2068
2427
  describe: "Delete an aggregate",
2069
- builder: (yargs21) => withApiOptions(
2070
- withProjectOptions(
2071
- yargs21.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
2428
+ builder: (yargs23) => withConfiguration(
2429
+ withApiOptions(
2430
+ withProjectOptions(
2431
+ yargs23.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
2432
+ )
2072
2433
  )
2073
2434
  ),
2074
2435
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2084,9 +2445,11 @@ var AggregateUpdateModule = {
2084
2445
  command: "update <filename>",
2085
2446
  aliases: ["put"],
2086
2447
  describe: "Insert or update an aggregate",
2087
- builder: (yargs21) => withApiOptions(
2088
- withProjectOptions(
2089
- yargs21.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
2448
+ builder: (yargs23) => withConfiguration(
2449
+ withApiOptions(
2450
+ withProjectOptions(
2451
+ yargs23.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
2452
+ )
2090
2453
  )
2091
2454
  ),
2092
2455
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -2102,24 +2465,26 @@ var AggregateModule = {
2102
2465
  command: "aggregate <command>",
2103
2466
  aliases: ["agg", "intent", "audience"],
2104
2467
  describe: "Commands for Context aggregates (intents, audiences)",
2105
- builder: (yargs21) => yargs21.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
2468
+ builder: (yargs23) => yargs23.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
2106
2469
  handler: () => {
2107
- yargs6.help();
2470
+ yargs7.help();
2108
2471
  }
2109
2472
  };
2110
2473
 
2111
2474
  // src/commands/context/commands/enrichment.ts
2112
- import yargs7 from "yargs";
2475
+ import yargs8 from "yargs";
2113
2476
 
2114
2477
  // src/commands/context/commands/enrichment/get.ts
2115
2478
  import { UncachedEnrichmentClient } from "@uniformdev/context/api";
2116
2479
  var EnrichmentGetModule = {
2117
2480
  command: "get <id>",
2118
2481
  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" })
2482
+ builder: (yargs23) => withFormatOptions(
2483
+ withConfiguration(
2484
+ withApiOptions(
2485
+ withProjectOptions(
2486
+ yargs23.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
2487
+ )
2123
2488
  )
2124
2489
  )
2125
2490
  ),
@@ -2143,7 +2508,7 @@ var EnrichmentListModule = {
2143
2508
  command: "list",
2144
2509
  describe: "List enrichments",
2145
2510
  aliases: ["ls"],
2146
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
2511
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
2147
2512
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
2148
2513
  const fetch3 = nodeFetchProxy(proxy);
2149
2514
  const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -2244,30 +2609,32 @@ var createEnrichmentValueEngineDataSource = ({
2244
2609
  var EnrichmentPullModule = {
2245
2610
  command: "pull <directory>",
2246
2611
  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
- })
2612
+ builder: (yargs23) => withConfiguration(
2613
+ withApiOptions(
2614
+ withProjectOptions(
2615
+ withDiffOptions(
2616
+ yargs23.positional("directory", {
2617
+ 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.",
2618
+ type: "string"
2619
+ }).option("format", {
2620
+ alias: ["f"],
2621
+ describe: "Output format",
2622
+ default: "yaml",
2623
+ choices: ["yaml", "json"],
2624
+ type: "string"
2625
+ }).option("what-if", {
2626
+ alias: ["w"],
2627
+ describe: "What-if mode reports what would be done but changes no files",
2628
+ default: false,
2629
+ type: "boolean"
2630
+ }).option("mode", {
2631
+ alias: ["m"],
2632
+ 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',
2633
+ choices: ["create", "createOrUpdate", "mirror"],
2634
+ default: "mirror",
2635
+ type: "string"
2636
+ })
2637
+ )
2271
2638
  )
2272
2639
  )
2273
2640
  ),
@@ -2321,24 +2688,26 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
2321
2688
  var EnrichmentPushModule = {
2322
2689
  command: "push <directory>",
2323
2690
  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
- })
2691
+ builder: (yargs23) => withConfiguration(
2692
+ withApiOptions(
2693
+ withProjectOptions(
2694
+ withDiffOptions(
2695
+ yargs23.positional("directory", {
2696
+ describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
2697
+ type: "string"
2698
+ }).option("what-if", {
2699
+ alias: ["w"],
2700
+ describe: "What-if mode reports what would be done but changes nothing",
2701
+ default: false,
2702
+ type: "boolean"
2703
+ }).option("mode", {
2704
+ alias: ["m"],
2705
+ 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',
2706
+ choices: ["create", "createOrUpdate", "mirror"],
2707
+ default: "mirror",
2708
+ type: "string"
2709
+ })
2710
+ )
2342
2711
  )
2343
2712
  )
2344
2713
  ),
@@ -2387,9 +2756,11 @@ var EnrichmentRemoveModule = {
2387
2756
  command: "remove <id>",
2388
2757
  aliases: ["delete", "rm"],
2389
2758
  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" })
2759
+ builder: (yargs23) => withConfiguration(
2760
+ withApiOptions(
2761
+ withProjectOptions(
2762
+ yargs23.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
2763
+ )
2393
2764
  )
2394
2765
  ),
2395
2766
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2404,14 +2775,14 @@ var EnrichmentModule = {
2404
2775
  command: "enrichment <command>",
2405
2776
  aliases: ["enr"],
2406
2777
  describe: "Commands for Context enrichments",
2407
- builder: (yargs21) => yargs21.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
2778
+ builder: (yargs23) => yargs23.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
2408
2779
  handler: () => {
2409
- yargs7.help();
2780
+ yargs8.help();
2410
2781
  }
2411
2782
  };
2412
2783
 
2413
2784
  // src/commands/context/commands/manifest.ts
2414
- import yargs8 from "yargs";
2785
+ import yargs9 from "yargs";
2415
2786
 
2416
2787
  // src/commands/context/commands/manifest/get.ts
2417
2788
  import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
@@ -2422,20 +2793,22 @@ var ManifestGetModule = {
2422
2793
  command: "get [output]",
2423
2794
  aliases: ["dl", "download"],
2424
2795
  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
- })
2796
+ builder: (yargs23) => withConfiguration(
2797
+ withApiOptions(
2798
+ withProjectOptions(
2799
+ yargs23.option("preview", {
2800
+ describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
2801
+ default: false,
2802
+ type: "boolean",
2803
+ alias: ["d"]
2804
+ }).option("output", {
2805
+ string: true,
2806
+ alias: "o",
2807
+ default: process.env.UNIFORM_MANIFEST_PATH,
2808
+ describe: "Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set.",
2809
+ demandOption: true
2810
+ })
2811
+ )
2439
2812
  )
2440
2813
  ),
2441
2814
  handler: async ({ apiKey, apiHost, proxy, output, project, preview }) => {
@@ -2485,7 +2858,7 @@ import { exit as exit2 } from "process";
2485
2858
  var ManifestPublishModule = {
2486
2859
  command: "publish",
2487
2860
  describe: "Publish the Uniform Context manifest for a project",
2488
- builder: (yargs21) => withApiOptions(withProjectOptions(yargs21)),
2861
+ builder: (yargs23) => withConfiguration(withApiOptions(withProjectOptions(yargs23))),
2489
2862
  handler: async ({ apiKey, apiHost, proxy, project }) => {
2490
2863
  const fetch3 = nodeFetchProxy(proxy);
2491
2864
  try {
@@ -2518,24 +2891,26 @@ var ManifestModule = {
2518
2891
  command: "manifest <command>",
2519
2892
  describe: "Commands for context manifests",
2520
2893
  aliases: ["man"],
2521
- builder: (yargs21) => yargs21.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
2894
+ builder: (yargs23) => yargs23.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
2522
2895
  handler: () => {
2523
- yargs8.help();
2896
+ yargs9.help();
2524
2897
  }
2525
2898
  };
2526
2899
 
2527
2900
  // src/commands/context/commands/quirk.ts
2528
- import yargs9 from "yargs";
2901
+ import yargs10 from "yargs";
2529
2902
 
2530
2903
  // src/commands/context/commands/quirk/get.ts
2531
2904
  import { UncachedQuirkClient } from "@uniformdev/context/api";
2532
2905
  var QuirkGetModule = {
2533
2906
  command: "get <id>",
2534
2907
  describe: "Fetch a quirk",
2535
- builder: (yargs21) => withFormatOptions(
2536
- withApiOptions(
2537
- withProjectOptions(
2538
- yargs21.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
2908
+ builder: (yargs23) => withConfiguration(
2909
+ withFormatOptions(
2910
+ withApiOptions(
2911
+ withProjectOptions(
2912
+ yargs23.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
2913
+ )
2539
2914
  )
2540
2915
  )
2541
2916
  ),
@@ -2558,14 +2933,16 @@ var QuirkListModule = {
2558
2933
  command: "list",
2559
2934
  describe: "List quirks",
2560
2935
  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
- })
2936
+ builder: (yargs23) => withConfiguration(
2937
+ withFormatOptions(
2938
+ withApiOptions(
2939
+ withProjectOptions(
2940
+ yargs23.option("withIntegrations", {
2941
+ alias: ["i"],
2942
+ describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
2943
+ type: "boolean"
2944
+ })
2945
+ )
2569
2946
  )
2570
2947
  )
2571
2948
  ),
@@ -2617,30 +2994,32 @@ function createQuirkEngineDataSource({
2617
2994
  var QuirkPullModule = {
2618
2995
  command: "pull <directory>",
2619
2996
  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
- })
2997
+ builder: (yargs23) => withConfiguration(
2998
+ withApiOptions(
2999
+ withProjectOptions(
3000
+ withDiffOptions(
3001
+ yargs23.positional("directory", {
3002
+ 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.",
3003
+ type: "string"
3004
+ }).option("format", {
3005
+ alias: ["f"],
3006
+ describe: "Output format",
3007
+ default: "yaml",
3008
+ choices: ["yaml", "json"],
3009
+ type: "string"
3010
+ }).option("what-if", {
3011
+ alias: ["w"],
3012
+ describe: "What-if mode reports what would be done but changes no files",
3013
+ default: false,
3014
+ type: "boolean"
3015
+ }).option("mode", {
3016
+ alias: ["m"],
3017
+ 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',
3018
+ choices: ["create", "createOrUpdate", "mirror"],
3019
+ default: "mirror",
3020
+ type: "string"
3021
+ })
3022
+ )
2644
3023
  )
2645
3024
  )
2646
3025
  ),
@@ -2694,24 +3073,26 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
2694
3073
  var QuirkPushModule = {
2695
3074
  command: "push <directory>",
2696
3075
  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
- })
3076
+ builder: (yargs23) => withConfiguration(
3077
+ withApiOptions(
3078
+ withProjectOptions(
3079
+ withDiffOptions(
3080
+ yargs23.positional("directory", {
3081
+ describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
3082
+ type: "string"
3083
+ }).option("what-if", {
3084
+ alias: ["w"],
3085
+ describe: "What-if mode reports what would be done but changes nothing",
3086
+ default: false,
3087
+ type: "boolean"
3088
+ }).option("mode", {
3089
+ alias: ["m"],
3090
+ 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',
3091
+ choices: ["create", "createOrUpdate", "mirror"],
3092
+ default: "mirror",
3093
+ type: "string"
3094
+ })
3095
+ )
2715
3096
  )
2716
3097
  )
2717
3098
  ),
@@ -2760,9 +3141,11 @@ var QuirkRemoveModule = {
2760
3141
  command: "remove <id>",
2761
3142
  aliases: ["delete", "rm"],
2762
3143
  describe: "Delete a quirk",
2763
- builder: (yargs21) => withApiOptions(
2764
- withProjectOptions(
2765
- yargs21.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
3144
+ builder: (yargs23) => withConfiguration(
3145
+ withApiOptions(
3146
+ withProjectOptions(
3147
+ yargs23.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
3148
+ )
2766
3149
  )
2767
3150
  ),
2768
3151
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2778,8 +3161,12 @@ var QuirkUpdateModule = {
2778
3161
  command: "update <filename>",
2779
3162
  aliases: ["put"],
2780
3163
  describe: "Insert or update a quirk",
2781
- builder: (yargs21) => withApiOptions(
2782
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Quirk file to put" }))
3164
+ builder: (yargs23) => withConfiguration(
3165
+ withApiOptions(
3166
+ withProjectOptions(
3167
+ yargs23.positional("filename", { demandOption: true, describe: "Quirk file to put" })
3168
+ )
3169
+ )
2783
3170
  ),
2784
3171
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
2785
3172
  const fetch3 = nodeFetchProxy(proxy);
@@ -2794,24 +3181,26 @@ var QuirkModule = {
2794
3181
  command: "quirk <command>",
2795
3182
  aliases: ["qk"],
2796
3183
  describe: "Commands for Context quirks",
2797
- builder: (yargs21) => yargs21.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
3184
+ builder: (yargs23) => yargs23.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
2798
3185
  handler: () => {
2799
- yargs9.help();
3186
+ yargs10.help();
2800
3187
  }
2801
3188
  };
2802
3189
 
2803
3190
  // src/commands/context/commands/signal.ts
2804
- import yargs10 from "yargs";
3191
+ import yargs11 from "yargs";
2805
3192
 
2806
3193
  // src/commands/context/commands/signal/get.ts
2807
3194
  import { UncachedSignalClient } from "@uniformdev/context/api";
2808
3195
  var SignalGetModule = {
2809
3196
  command: "get <id>",
2810
3197
  describe: "Fetch a signal",
2811
- builder: (yargs21) => withFormatOptions(
2812
- withApiOptions(
2813
- withProjectOptions(
2814
- yargs21.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
3198
+ builder: (yargs23) => withConfiguration(
3199
+ withFormatOptions(
3200
+ withApiOptions(
3201
+ withProjectOptions(
3202
+ yargs23.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
3203
+ )
2815
3204
  )
2816
3205
  )
2817
3206
  ),
@@ -2834,7 +3223,7 @@ var SignalListModule = {
2834
3223
  command: "list",
2835
3224
  describe: "List signals",
2836
3225
  aliases: ["ls"],
2837
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
3226
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
2838
3227
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
2839
3228
  const fetch3 = nodeFetchProxy(proxy);
2840
3229
  const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -2883,30 +3272,32 @@ function createSignalEngineDataSource({
2883
3272
  var SignalPullModule = {
2884
3273
  command: "pull <directory>",
2885
3274
  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
- })
3275
+ builder: (yargs23) => withConfiguration(
3276
+ withApiOptions(
3277
+ withProjectOptions(
3278
+ withDiffOptions(
3279
+ yargs23.positional("directory", {
3280
+ 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.",
3281
+ type: "string"
3282
+ }).option("format", {
3283
+ alias: ["f"],
3284
+ describe: "Output format",
3285
+ default: "yaml",
3286
+ choices: ["yaml", "json"],
3287
+ type: "string"
3288
+ }).option("what-if", {
3289
+ alias: ["w"],
3290
+ describe: "What-if mode reports what would be done but changes no files",
3291
+ default: false,
3292
+ type: "boolean"
3293
+ }).option("mode", {
3294
+ alias: ["m"],
3295
+ 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',
3296
+ choices: ["create", "createOrUpdate", "mirror"],
3297
+ default: "mirror",
3298
+ type: "string"
3299
+ })
3300
+ )
2910
3301
  )
2911
3302
  )
2912
3303
  ),
@@ -2960,24 +3351,26 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
2960
3351
  var SignalPushModule = {
2961
3352
  command: "push <directory>",
2962
3353
  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
- })
3354
+ builder: (yargs23) => withConfiguration(
3355
+ withApiOptions(
3356
+ withProjectOptions(
3357
+ withDiffOptions(
3358
+ yargs23.positional("directory", {
3359
+ describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
3360
+ type: "string"
3361
+ }).option("what-if", {
3362
+ alias: ["w"],
3363
+ describe: "What-if mode reports what would be done but changes nothing",
3364
+ default: false,
3365
+ type: "boolean"
3366
+ }).option("mode", {
3367
+ alias: ["m"],
3368
+ 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',
3369
+ choices: ["create", "createOrUpdate", "mirror"],
3370
+ default: "mirror",
3371
+ type: "string"
3372
+ })
3373
+ )
2981
3374
  )
2982
3375
  )
2983
3376
  ),
@@ -3026,9 +3419,11 @@ var SignalRemoveModule = {
3026
3419
  command: "remove <id>",
3027
3420
  aliases: ["delete", "rm"],
3028
3421
  describe: "Delete a signal",
3029
- builder: (yargs21) => withApiOptions(
3030
- withProjectOptions(
3031
- yargs21.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
3422
+ builder: (yargs23) => withConfiguration(
3423
+ withApiOptions(
3424
+ withProjectOptions(
3425
+ yargs23.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
3426
+ )
3032
3427
  )
3033
3428
  ),
3034
3429
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -3044,8 +3439,12 @@ var SignalUpdateModule = {
3044
3439
  command: "update <filename>",
3045
3440
  aliases: ["put"],
3046
3441
  describe: "Insert or update a signal",
3047
- builder: (yargs21) => withApiOptions(
3048
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Signal file to put" }))
3442
+ builder: (yargs23) => withConfiguration(
3443
+ withApiOptions(
3444
+ withProjectOptions(
3445
+ yargs23.positional("filename", { demandOption: true, describe: "Signal file to put" })
3446
+ )
3447
+ )
3049
3448
  ),
3050
3449
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
3051
3450
  const fetch3 = nodeFetchProxy(proxy);
@@ -3060,24 +3459,26 @@ var SignalModule = {
3060
3459
  command: "signal <command>",
3061
3460
  aliases: ["sig"],
3062
3461
  describe: "Commands for Context signals",
3063
- builder: (yargs21) => yargs21.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
3462
+ builder: (yargs23) => yargs23.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
3064
3463
  handler: () => {
3065
- yargs10.help();
3464
+ yargs11.help();
3066
3465
  }
3067
3466
  };
3068
3467
 
3069
3468
  // src/commands/context/commands/test.ts
3070
- import yargs11 from "yargs";
3469
+ import yargs12 from "yargs";
3071
3470
 
3072
3471
  // src/commands/context/commands/test/get.ts
3073
3472
  import { UncachedTestClient } from "@uniformdev/context/api";
3074
3473
  var TestGetModule = {
3075
3474
  command: "get <id>",
3076
3475
  describe: "Fetch a test",
3077
- builder: (yargs21) => withFormatOptions(
3078
- withApiOptions(
3079
- withProjectOptions(
3080
- yargs21.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
3476
+ builder: (yargs23) => withConfiguration(
3477
+ withFormatOptions(
3478
+ withApiOptions(
3479
+ withProjectOptions(
3480
+ yargs23.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
3481
+ )
3081
3482
  )
3082
3483
  )
3083
3484
  ),
@@ -3100,7 +3501,7 @@ var TestListModule = {
3100
3501
  command: "list",
3101
3502
  describe: "List tests",
3102
3503
  aliases: ["ls"],
3103
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
3504
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
3104
3505
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
3105
3506
  const fetch3 = nodeFetchProxy(proxy);
3106
3507
  const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -3149,30 +3550,32 @@ function createTestEngineDataSource({
3149
3550
  var TestPullModule = {
3150
3551
  command: "pull <directory>",
3151
3552
  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
- })
3553
+ builder: (yargs23) => withConfiguration(
3554
+ withApiOptions(
3555
+ withProjectOptions(
3556
+ withDiffOptions(
3557
+ yargs23.positional("directory", {
3558
+ 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.",
3559
+ type: "string"
3560
+ }).option("format", {
3561
+ alias: ["f"],
3562
+ describe: "Output format",
3563
+ default: "yaml",
3564
+ choices: ["yaml", "json"],
3565
+ type: "string"
3566
+ }).option("what-if", {
3567
+ alias: ["w"],
3568
+ describe: "What-if mode reports what would be done but changes no files",
3569
+ default: false,
3570
+ type: "boolean"
3571
+ }).option("mode", {
3572
+ alias: ["m"],
3573
+ 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',
3574
+ choices: ["create", "createOrUpdate", "mirror"],
3575
+ default: "mirror",
3576
+ type: "string"
3577
+ })
3578
+ )
3176
3579
  )
3177
3580
  )
3178
3581
  ),
@@ -3226,24 +3629,26 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
3226
3629
  var TestPushModule = {
3227
3630
  command: "push <directory>",
3228
3631
  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
- })
3632
+ builder: (yargs23) => withConfiguration(
3633
+ withApiOptions(
3634
+ withProjectOptions(
3635
+ withDiffOptions(
3636
+ yargs23.positional("directory", {
3637
+ describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
3638
+ type: "string"
3639
+ }).option("what-if", {
3640
+ alias: ["w"],
3641
+ describe: "What-if mode reports what would be done but changes nothing",
3642
+ default: false,
3643
+ type: "boolean"
3644
+ }).option("mode", {
3645
+ alias: ["m"],
3646
+ 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',
3647
+ choices: ["create", "createOrUpdate", "mirror"],
3648
+ default: "mirror",
3649
+ type: "string"
3650
+ })
3651
+ )
3247
3652
  )
3248
3653
  )
3249
3654
  ),
@@ -3292,8 +3697,12 @@ var TestRemoveModule = {
3292
3697
  command: "remove <id>",
3293
3698
  aliases: ["delete", "rm"],
3294
3699
  describe: "Delete a test",
3295
- builder: (yargs21) => withApiOptions(
3296
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Test public ID to delete" }))
3700
+ builder: (yargs23) => withConfiguration(
3701
+ withApiOptions(
3702
+ withProjectOptions(
3703
+ yargs23.positional("id", { demandOption: true, describe: "Test public ID to delete" })
3704
+ )
3705
+ )
3297
3706
  ),
3298
3707
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
3299
3708
  const fetch3 = nodeFetchProxy(proxy);
@@ -3308,8 +3717,10 @@ var TestUpdateModule = {
3308
3717
  command: "update <filename>",
3309
3718
  aliases: ["put"],
3310
3719
  describe: "Insert or update a test",
3311
- builder: (yargs21) => withApiOptions(
3312
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Test file to put" }))
3720
+ builder: (yargs23) => withConfiguration(
3721
+ withApiOptions(
3722
+ withProjectOptions(yargs23.positional("filename", { demandOption: true, describe: "Test file to put" }))
3723
+ )
3313
3724
  ),
3314
3725
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
3315
3726
  const fetch3 = nodeFetchProxy(proxy);
@@ -3323,9 +3734,9 @@ var TestUpdateModule = {
3323
3734
  var TestModule = {
3324
3735
  command: "test <command>",
3325
3736
  describe: "Commands for Context A/B tests",
3326
- builder: (yargs21) => yargs21.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
3737
+ builder: (yargs23) => yargs23.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
3327
3738
  handler: () => {
3328
- yargs11.help();
3739
+ yargs12.help();
3329
3740
  }
3330
3741
  };
3331
3742
 
@@ -3334,9 +3745,9 @@ var ContextCommand = {
3334
3745
  command: "context <command>",
3335
3746
  aliases: ["ctx"],
3336
3747
  describe: "Uniform Context commands",
3337
- builder: (yargs21) => yargs21.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
3748
+ builder: (yargs23) => yargs23.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
3338
3749
  handler: () => {
3339
- yargs12.showHelp();
3750
+ yargs13.showHelp();
3340
3751
  }
3341
3752
  };
3342
3753
 
@@ -3364,11 +3775,11 @@ import { PostHog } from "posthog-node";
3364
3775
  // package.json
3365
3776
  var package_default = {
3366
3777
  name: "@uniformdev/cli",
3367
- version: "19.41.0",
3778
+ version: "19.42.0",
3368
3779
  description: "Uniform command line interface tool",
3369
3780
  license: "SEE LICENSE IN LICENSE.txt",
3370
3781
  main: "./cli.js",
3371
- types: "./dist/index.d.ts",
3782
+ types: "./dist/index.d.mts",
3372
3783
  sideEffects: false,
3373
3784
  scripts: {
3374
3785
  uniform: "node ./cli.js",
@@ -3385,7 +3796,8 @@ var package_default = {
3385
3796
  "@uniformdev/project-map": "workspace:*",
3386
3797
  "@uniformdev/redirect": "workspace:*",
3387
3798
  colorette: "2.0.20",
3388
- cosmiconfig: "^8.2.0",
3799
+ cosmiconfig: "8.2.0",
3800
+ "cosmiconfig-typescript-loader": "5.0.0",
3389
3801
  diff: "^5.0.0",
3390
3802
  dotenv: "^16.0.3",
3391
3803
  execa: "5.1.1",
@@ -3737,7 +4149,7 @@ ${err.message}`);
3737
4149
 
3738
4150
  // src/projects/cloneStarter.ts
3739
4151
  import crypto2 from "crypto";
3740
- import fs2 from "fs";
4152
+ import fs3 from "fs";
3741
4153
  import fsj from "fs-jetpack";
3742
4154
  import * as git from "isomorphic-git";
3743
4155
  import * as http from "isomorphic-git/http/node/index.js";
@@ -3754,7 +4166,7 @@ async function cloneStarter({
3754
4166
  const [user, repo, ...pathSegments] = githubPath.split("/");
3755
4167
  try {
3756
4168
  await git.clone({
3757
- fs: fs2,
4169
+ fs: fs3,
3758
4170
  http,
3759
4171
  url: `https://github.com/${user}/${repo}`,
3760
4172
  dir: cloneDir,
@@ -3765,13 +4177,13 @@ async function cloneStarter({
3765
4177
  throw new Error(`Failed to fetch starter code: ${err.message}`);
3766
4178
  }
3767
4179
  await done();
3768
- if (fs2.existsSync(targetDir) && fs2.readdirSync(targetDir).length > 0) {
4180
+ if (fs3.existsSync(targetDir) && fs3.readdirSync(targetDir).length > 0) {
3769
4181
  throw new Error(`"${targetDir}" is not empty`);
3770
4182
  }
3771
4183
  const starterDir = path.join(cloneDir, ...pathSegments);
3772
4184
  fsj.copy(starterDir, targetDir, { overwrite: true });
3773
4185
  if (dotEnvFile) {
3774
- fs2.writeFileSync(path.resolve(targetDir, ".env"), dotEnvFile, "utf-8");
4186
+ fs3.writeFileSync(path.resolve(targetDir, ".env"), dotEnvFile, "utf-8");
3775
4187
  }
3776
4188
  console.log(`
3777
4189
  Your project now lives in ${targetDir} \u2728`);
@@ -3787,7 +4199,7 @@ Installing project dependencies...
3787
4199
  }
3788
4200
 
3789
4201
  // src/projects/getOrCreateProject.ts
3790
- import fs3, { existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
4202
+ import fs4, { existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
3791
4203
  import inquirer2 from "inquirer";
3792
4204
  import path2 from "path";
3793
4205
  import slugify from "slugify";
@@ -3914,9 +4326,9 @@ function validateProjectName(projectName, checkTargetDir, explicitTargetDir) {
3914
4326
  if (!existsSync2(targetDir)) {
3915
4327
  mkdirSync2(targetDir, { recursive: true });
3916
4328
  }
3917
- if (fs3.readdirSync(targetDir).length > 0) {
4329
+ if (fs4.readdirSync(targetDir).length > 0) {
3918
4330
  targetDir = path2.resolve(targetDir, projectNameSlug);
3919
- if (fs3.existsSync(targetDir)) {
4331
+ if (fs4.existsSync(targetDir)) {
3920
4332
  throw new Error(`${targetDir} already exists, choose a different name.`);
3921
4333
  }
3922
4334
  }
@@ -4324,24 +4736,26 @@ var disableTelemetryDefault = !["", "0", "false", "no"].includes(
4324
4736
  );
4325
4737
  var NewCmd = {
4326
4738
  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
- }),
4739
+ builder: (y) => withConfiguration(
4740
+ y.positional("name", {
4741
+ describe: "Name of a project",
4742
+ type: "string"
4743
+ }).option("apiHost", {
4744
+ describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4745
+ default: apiHostDefault,
4746
+ demandOption: true,
4747
+ type: "string"
4748
+ }).option("outputPath", {
4749
+ alias: "o",
4750
+ description: "Specify where to store integration files. Defaults to cwd.",
4751
+ type: "string"
4752
+ }).option("disableTelemetry", {
4753
+ describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4754
+ default: disableTelemetryDefault,
4755
+ demandOption: true,
4756
+ type: "boolean"
4757
+ })
4758
+ ),
4345
4759
  describe: "Start a new Uniform project",
4346
4760
  handler: async function({ name, apiHost, outputPath, disableTelemetry }) {
4347
4761
  const { stopAllSpinners, spin } = makeSpinner();
@@ -4362,21 +4776,23 @@ var NewCmd = {
4362
4776
  };
4363
4777
  var NewMeshCmd = {
4364
4778
  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
- }),
4779
+ builder: (y) => withConfiguration(
4780
+ y.option("apiHost", {
4781
+ describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4782
+ default: apiHostDefault,
4783
+ demandOption: true,
4784
+ type: "string"
4785
+ }).option("outputPath", {
4786
+ alias: "o",
4787
+ description: "Specify where to store integration files. Defaults to cwd.",
4788
+ type: "string"
4789
+ }).option("disableTelemetry", {
4790
+ describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4791
+ default: disableTelemetryDefault,
4792
+ demandOption: true,
4793
+ type: "boolean"
4794
+ })
4795
+ ),
4380
4796
  describe: "Start a new Uniform project",
4381
4797
  handler: async function({ apiHost, outputPath, disableTelemetry }) {
4382
4798
  const { stopAllSpinners, spin } = makeSpinner();
@@ -4397,10 +4813,10 @@ var NewMeshCmd = {
4397
4813
  };
4398
4814
 
4399
4815
  // src/commands/optimize/index.ts
4400
- import yargs14 from "yargs";
4816
+ import yargs15 from "yargs";
4401
4817
 
4402
4818
  // src/commands/optimize/manifest.ts
4403
- import yargs13 from "yargs";
4819
+ import yargs14 from "yargs";
4404
4820
 
4405
4821
  // src/commands/optimize/manifest/download.ts
4406
4822
  import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
@@ -4415,7 +4831,7 @@ var UniformBaseUrl = "https://uniform.app";
4415
4831
  var module = {
4416
4832
  command: "download [output]",
4417
4833
  describe: "Download intent manifest",
4418
- builder: (yargs21) => yargs21.option("apiKey", {
4834
+ builder: (yargs23) => yargs23.option("apiKey", {
4419
4835
  alias: "k",
4420
4836
  demandOption: true,
4421
4837
  string: true,
@@ -4516,10 +4932,10 @@ var module2 = {
4516
4932
  command: "manifest <command>",
4517
4933
  describe: "Intent manifest commands",
4518
4934
  builder: () => {
4519
- return yargs13.command(download_default);
4935
+ return yargs14.command(download_default);
4520
4936
  },
4521
4937
  handler: () => {
4522
- yargs13.showHelp();
4938
+ yargs14.showHelp();
4523
4939
  }
4524
4940
  };
4525
4941
  var manifest_default = module2;
@@ -4530,28 +4946,30 @@ var OptimizeCommand = {
4530
4946
  aliases: ["opt"],
4531
4947
  describe: "Uniform Optimize commands",
4532
4948
  builder: () => {
4533
- return yargs14.command(manifest_default);
4949
+ return yargs15.command(manifest_default);
4534
4950
  },
4535
4951
  handler: () => {
4536
- yargs14.showHelp();
4952
+ yargs15.showHelp();
4537
4953
  }
4538
4954
  };
4539
4955
 
4540
4956
  // src/commands/project-map/index.ts
4541
- import yargs17 from "yargs";
4957
+ import yargs18 from "yargs";
4542
4958
 
4543
4959
  // src/commands/project-map/commands/projectMapDefinition.ts
4544
- import yargs15 from "yargs";
4960
+ import yargs16 from "yargs";
4545
4961
 
4546
4962
  // src/commands/project-map/commands/ProjectMapDefinition/get.ts
4547
4963
  import { UncachedProjectMapClient } from "@uniformdev/project-map";
4548
4964
  var ProjectMapDefinitionGetModule = {
4549
4965
  command: "get <id>",
4550
4966
  describe: "Fetch a project map",
4551
- builder: (yargs21) => withFormatOptions(
4552
- withApiOptions(
4553
- withProjectOptions(
4554
- yargs21.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
4967
+ builder: (yargs23) => withFormatOptions(
4968
+ withConfiguration(
4969
+ withApiOptions(
4970
+ withProjectOptions(
4971
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
4972
+ )
4555
4973
  )
4556
4974
  )
4557
4975
  ),
@@ -4574,7 +4992,7 @@ var ProjectMapDefinitionListModule = {
4574
4992
  command: "list",
4575
4993
  describe: "List of project maps",
4576
4994
  aliases: ["ls"],
4577
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
4995
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
4578
4996
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
4579
4997
  const fetch3 = nodeFetchProxy(proxy);
4580
4998
  const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -4631,30 +5049,32 @@ function createProjectMapDefinitionEngineDataSource({
4631
5049
  var ProjectMapDefinitionPullModule = {
4632
5050
  command: "pull <directory>",
4633
5051
  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
- })
5052
+ builder: (yargs23) => withConfiguration(
5053
+ withApiOptions(
5054
+ withProjectOptions(
5055
+ withDiffOptions(
5056
+ yargs23.positional("directory", {
5057
+ 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.",
5058
+ type: "string"
5059
+ }).option("format", {
5060
+ alias: ["f"],
5061
+ describe: "Output format",
5062
+ default: "yaml",
5063
+ choices: ["yaml", "json"],
5064
+ type: "string"
5065
+ }).option("what-if", {
5066
+ alias: ["w"],
5067
+ describe: "What-if mode reports what would be done but changes no files",
5068
+ default: false,
5069
+ type: "boolean"
5070
+ }).option("mode", {
5071
+ alias: ["m"],
5072
+ 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',
5073
+ choices: ["create", "createOrUpdate", "mirror"],
5074
+ default: "mirror",
5075
+ type: "string"
5076
+ })
5077
+ )
4658
5078
  )
4659
5079
  )
4660
5080
  ),
@@ -4708,24 +5128,26 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
4708
5128
  var ProjectMapDefinitionPushModule = {
4709
5129
  command: "push <directory>",
4710
5130
  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
- })
5131
+ builder: (yargs23) => withConfiguration(
5132
+ withApiOptions(
5133
+ withProjectOptions(
5134
+ withDiffOptions(
5135
+ yargs23.positional("directory", {
5136
+ describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5137
+ type: "string"
5138
+ }).option("what-if", {
5139
+ alias: ["w"],
5140
+ describe: "What-if mode reports what would be done but changes nothing",
5141
+ default: false,
5142
+ type: "boolean"
5143
+ }).option("mode", {
5144
+ alias: ["m"],
5145
+ 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',
5146
+ choices: ["create", "createOrUpdate", "mirror"],
5147
+ default: "mirror",
5148
+ type: "string"
5149
+ })
5150
+ )
4729
5151
  )
4730
5152
  )
4731
5153
  ),
@@ -4774,8 +5196,10 @@ var ProjectMapDefinitionRemoveModule = {
4774
5196
  command: "remove <id>",
4775
5197
  aliases: ["delete", "rm"],
4776
5198
  describe: "Delete a project map",
4777
- builder: (yargs21) => withApiOptions(
4778
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: " UUID to delete" }))
5199
+ builder: (yargs23) => withConfiguration(
5200
+ withApiOptions(
5201
+ withProjectOptions(yargs23.positional("id", { demandOption: true, describe: " UUID to delete" }))
5202
+ )
4779
5203
  ),
4780
5204
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
4781
5205
  const fetch3 = nodeFetchProxy(proxy);
@@ -4790,9 +5214,11 @@ var ProjectMapDefinitionUpdateModule = {
4790
5214
  command: "update <filename>",
4791
5215
  aliases: ["put"],
4792
5216
  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" })
5217
+ builder: (yargs23) => withConfiguration(
5218
+ withApiOptions(
5219
+ withProjectOptions(
5220
+ yargs23.positional("filename", { demandOption: true, describe: "Project map file to put" })
5221
+ )
4796
5222
  )
4797
5223
  ),
4798
5224
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -4807,24 +5233,26 @@ var ProjectMapDefinitionUpdateModule = {
4807
5233
  var ProjectMapDefinitionModule = {
4808
5234
  command: "definition <command>",
4809
5235
  describe: "Commands for ProjectMap Definitions",
4810
- builder: (yargs21) => yargs21.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
5236
+ builder: (yargs23) => yargs23.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
4811
5237
  handler: () => {
4812
- yargs15.help();
5238
+ yargs16.help();
4813
5239
  }
4814
5240
  };
4815
5241
 
4816
5242
  // src/commands/project-map/commands/projectMapNode.ts
4817
- import yargs16 from "yargs";
5243
+ import yargs17 from "yargs";
4818
5244
 
4819
5245
  // src/commands/project-map/commands/ProjectMapNode/get.ts
4820
5246
  import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
4821
5247
  var ProjectMapNodeGetModule = {
4822
5248
  command: "get <id> <projectMapId>",
4823
5249
  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" })
5250
+ builder: (yargs23) => withConfiguration(
5251
+ withFormatOptions(
5252
+ withApiOptions(
5253
+ withProjectOptions(
5254
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5255
+ )
4828
5256
  )
4829
5257
  )
4830
5258
  ),
@@ -4849,10 +5277,15 @@ var ProjectMapNodeListModule = {
4849
5277
  command: "list <projectMapId>",
4850
5278
  describe: "List project map nodes",
4851
5279
  aliases: ["ls"],
4852
- builder: (yargs21) => withFormatOptions(
4853
- withApiOptions(
4854
- withProjectOptions(
4855
- yargs21.positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5280
+ builder: (yargs23) => withConfiguration(
5281
+ withFormatOptions(
5282
+ withApiOptions(
5283
+ withProjectOptions(
5284
+ yargs23.positional("projectMapId", {
5285
+ demandOption: true,
5286
+ describe: "ProjectMap UUID to fetch from"
5287
+ })
5288
+ )
4856
5289
  )
4857
5290
  )
4858
5291
  ),
@@ -4919,30 +5352,32 @@ function createProjectMapNodeEngineDataSource({
4919
5352
  var ProjectMapNodePullModule = {
4920
5353
  command: "pull <directory>",
4921
5354
  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
- })
5355
+ builder: (yargs23) => withConfiguration(
5356
+ withApiOptions(
5357
+ withProjectOptions(
5358
+ withDiffOptions(
5359
+ yargs23.positional("directory", {
5360
+ 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.",
5361
+ type: "string"
5362
+ }).option("format", {
5363
+ alias: ["f"],
5364
+ describe: "Output format",
5365
+ default: "yaml",
5366
+ choices: ["yaml", "json"],
5367
+ type: "string"
5368
+ }).option("what-if", {
5369
+ alias: ["w"],
5370
+ describe: "What-if mode reports what would be done but changes no files",
5371
+ default: false,
5372
+ type: "boolean"
5373
+ }).option("mode", {
5374
+ alias: ["m"],
5375
+ 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',
5376
+ choices: ["create", "createOrUpdate", "mirror"],
5377
+ default: "mirror",
5378
+ type: "string"
5379
+ })
5380
+ )
4946
5381
  )
4947
5382
  )
4948
5383
  ),
@@ -5000,24 +5435,26 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
5000
5435
  var ProjectMapNodePushModule = {
5001
5436
  command: "push <directory>",
5002
5437
  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
- })
5438
+ builder: (yargs23) => withConfiguration(
5439
+ withApiOptions(
5440
+ withProjectOptions(
5441
+ withDiffOptions(
5442
+ yargs23.positional("directory", {
5443
+ describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5444
+ type: "string"
5445
+ }).option("what-if", {
5446
+ alias: ["w"],
5447
+ describe: "What-if mode reports what would be done but changes nothing",
5448
+ default: false,
5449
+ type: "boolean"
5450
+ }).option("mode", {
5451
+ alias: ["m"],
5452
+ 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',
5453
+ choices: ["create", "createOrUpdate", "mirror"],
5454
+ default: "mirror",
5455
+ type: "string"
5456
+ })
5457
+ )
5021
5458
  )
5022
5459
  )
5023
5460
  ),
@@ -5075,9 +5512,11 @@ var ProjectMapNodeRemoveModule = {
5075
5512
  command: "remove <id> <projectMapId>",
5076
5513
  aliases: ["delete", "rm"],
5077
5514
  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" })
5515
+ builder: (yargs23) => withConfiguration(
5516
+ withApiOptions(
5517
+ withProjectOptions(
5518
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
5519
+ )
5081
5520
  )
5082
5521
  ),
5083
5522
  handler: async ({ apiHost, apiKey, proxy, projectMapId, id, project: projectId }) => {
@@ -5093,9 +5532,11 @@ var ProjectMapNodeUpdateModule = {
5093
5532
  command: "update <filename> <projectMapId>",
5094
5533
  aliases: ["put"],
5095
5534
  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" })
5535
+ builder: (yargs23) => withConfiguration(
5536
+ withApiOptions(
5537
+ withProjectOptions(
5538
+ yargs23.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
5539
+ )
5099
5540
  )
5100
5541
  ),
5101
5542
  handler: async ({ apiHost, apiKey, proxy, projectMapId, filename, project: projectId }) => {
@@ -5110,9 +5551,9 @@ var ProjectMapNodeUpdateModule = {
5110
5551
  var ProjectMapNodeModule = {
5111
5552
  command: "node <command>",
5112
5553
  describe: "Commands for ProjectMap Nodes",
5113
- builder: (yargs21) => yargs21.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
5554
+ builder: (yargs23) => yargs23.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
5114
5555
  handler: () => {
5115
- yargs16.help();
5556
+ yargs17.help();
5116
5557
  }
5117
5558
  };
5118
5559
 
@@ -5121,26 +5562,30 @@ var ProjectMapCommand = {
5121
5562
  command: "project-map <command>",
5122
5563
  aliases: ["prm"],
5123
5564
  describe: "Uniform ProjectMap commands",
5124
- builder: (yargs21) => yargs21.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
5565
+ builder: (yargs23) => yargs23.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
5125
5566
  handler: () => {
5126
- yargs17.showHelp();
5567
+ yargs18.showHelp();
5127
5568
  }
5128
5569
  };
5129
5570
 
5130
5571
  // src/commands/redirect/index.ts
5131
- import yargs19 from "yargs";
5572
+ import yargs20 from "yargs";
5132
5573
 
5133
5574
  // src/commands/redirect/commands/redirect.ts
5134
- import yargs18 from "yargs";
5575
+ import yargs19 from "yargs";
5135
5576
 
5136
5577
  // src/commands/redirect/commands/RedirectDefinition/get.ts
5137
5578
  import { UncachedRedirectClient } from "@uniformdev/redirect";
5138
5579
  var RedirectDefinitionGetModule = {
5139
5580
  command: "get <id>",
5140
5581
  describe: "Fetch a redirect",
5141
- builder: (yargs21) => withFormatOptions(
5142
- withApiOptions(
5143
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" }))
5582
+ builder: (yargs23) => withConfiguration(
5583
+ withFormatOptions(
5584
+ withApiOptions(
5585
+ withProjectOptions(
5586
+ yargs23.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
5587
+ )
5588
+ )
5144
5589
  )
5145
5590
  ),
5146
5591
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
@@ -5162,7 +5607,7 @@ var RedirectDefinitionListModule = {
5162
5607
  command: "list",
5163
5608
  describe: "List of redirects",
5164
5609
  aliases: ["ls"],
5165
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
5610
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
5166
5611
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
5167
5612
  const fetch3 = nodeFetchProxy(proxy);
5168
5613
  const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -5228,30 +5673,32 @@ function createRedirectDefinitionEngineDataSource({
5228
5673
  var RedirectDefinitionPullModule = {
5229
5674
  command: "pull <directory>",
5230
5675
  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
- })
5676
+ builder: (yargs23) => withConfiguration(
5677
+ withApiOptions(
5678
+ withProjectOptions(
5679
+ withDiffOptions(
5680
+ yargs23.positional("directory", {
5681
+ 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.",
5682
+ type: "string"
5683
+ }).option("format", {
5684
+ alias: ["f"],
5685
+ describe: "Output format",
5686
+ default: "yaml",
5687
+ choices: ["yaml", "json"],
5688
+ type: "string"
5689
+ }).option("what-if", {
5690
+ alias: ["w"],
5691
+ describe: "What-if mode reports what would be done but changes no files",
5692
+ default: false,
5693
+ type: "boolean"
5694
+ }).option("mode", {
5695
+ alias: ["m"],
5696
+ 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',
5697
+ choices: ["create", "createOrUpdate", "mirror"],
5698
+ default: "mirror",
5699
+ type: "string"
5700
+ })
5701
+ )
5255
5702
  )
5256
5703
  )
5257
5704
  ),
@@ -5306,24 +5753,26 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
5306
5753
  var RedirectDefinitionPushModule = {
5307
5754
  command: "push <directory>",
5308
5755
  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
- })
5756
+ builder: (yargs23) => withConfiguration(
5757
+ withApiOptions(
5758
+ withProjectOptions(
5759
+ withDiffOptions(
5760
+ yargs23.positional("directory", {
5761
+ describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
5762
+ type: "string"
5763
+ }).option("what-if", {
5764
+ alias: ["w"],
5765
+ describe: "What-if mode reports what would be done but changes nothing",
5766
+ default: false,
5767
+ type: "boolean"
5768
+ }).option("mode", {
5769
+ alias: ["m"],
5770
+ 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',
5771
+ choices: ["create", "createOrUpdate", "mirror"],
5772
+ default: "mirror",
5773
+ type: "string"
5774
+ })
5775
+ )
5327
5776
  )
5328
5777
  )
5329
5778
  ),
@@ -5372,8 +5821,10 @@ var RedirectDefinitionRemoveModule = {
5372
5821
  command: "remove <id>",
5373
5822
  aliases: ["delete", "rm"],
5374
5823
  describe: "Delete a redirect",
5375
- builder: (yargs21) => withApiOptions(
5376
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: " UUID to delete" }))
5824
+ builder: (yargs23) => withConfiguration(
5825
+ withApiOptions(
5826
+ withProjectOptions(yargs23.positional("id", { demandOption: true, describe: " UUID to delete" }))
5827
+ )
5377
5828
  ),
5378
5829
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
5379
5830
  const fetch3 = nodeFetchProxy(proxy);
@@ -5388,9 +5839,11 @@ var RedirectDefinitionUpdateModule = {
5388
5839
  command: "update <filename>",
5389
5840
  aliases: ["put"],
5390
5841
  describe: "Insert or update a redirect",
5391
- builder: (yargs21) => withApiOptions(
5392
- withProjectOptions(
5393
- yargs21.positional("filename", { demandOption: true, describe: "Redirect file to put" })
5842
+ builder: (yargs23) => withConfiguration(
5843
+ withApiOptions(
5844
+ withProjectOptions(
5845
+ yargs23.positional("filename", { demandOption: true, describe: "Redirect file to put" })
5846
+ )
5394
5847
  )
5395
5848
  ),
5396
5849
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -5405,9 +5858,9 @@ var RedirectDefinitionUpdateModule = {
5405
5858
  var RedirectDefinitionModule = {
5406
5859
  command: "definition <command>",
5407
5860
  describe: "Commands for Redirect Definitions",
5408
- builder: (yargs21) => yargs21.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
5861
+ builder: (yargs23) => yargs23.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
5409
5862
  handler: () => {
5410
- yargs18.help();
5863
+ yargs19.help();
5411
5864
  }
5412
5865
  };
5413
5866
 
@@ -5416,9 +5869,179 @@ var RedirectCommand = {
5416
5869
  command: "redirect <command>",
5417
5870
  aliases: ["red"],
5418
5871
  describe: "Uniform Redirect commands",
5419
- builder: (yargs21) => yargs21.command(RedirectDefinitionModule).demandCommand(),
5872
+ builder: (yargs23) => yargs23.command(RedirectDefinitionModule).demandCommand(),
5873
+ handler: () => {
5874
+ yargs20.showHelp();
5875
+ }
5876
+ };
5877
+
5878
+ // src/commands/sync/index.ts
5879
+ import yargs21 from "yargs";
5880
+
5881
+ // src/commands/sync/commands/pull.ts
5882
+ var SyncPullModule = {
5883
+ command: "pull",
5884
+ describe: "Pulls whole project to local files in a directory",
5885
+ builder: (yargs23) => withConfiguration(
5886
+ withApiOptions(
5887
+ withProjectOptions(
5888
+ withDiffOptions(
5889
+ yargs23.option("what-if", {
5890
+ alias: ["w"],
5891
+ describe: "What-if mode reports what would be done but changes no files",
5892
+ default: false,
5893
+ type: "boolean"
5894
+ })
5895
+ )
5896
+ )
5897
+ )
5898
+ ),
5899
+ handler: async ({ serialization, ...otherParams }) => {
5900
+ const config2 = serialization;
5901
+ const enabledEntities = Object.entries({
5902
+ category: CategoryPullModule,
5903
+ dataType: DataTypePullModule,
5904
+ quirk: QuirkPullModule,
5905
+ test: TestPullModule,
5906
+ signal: SignalPullModule,
5907
+ enrichment: EnrichmentPullModule,
5908
+ aggregate: AggregatePullModule,
5909
+ component: ComponentPullModule,
5910
+ pattern: PatternPullModule,
5911
+ composition: CompositionPullModule,
5912
+ projectMapDefinition: ProjectMapDefinitionPullModule,
5913
+ projectMapNode: ProjectMapNodePullModule,
5914
+ redirect: RedirectDefinitionPullModule
5915
+ }).filter(([entityType]) => {
5916
+ var _a, _b, _c, _d, _e, _f;
5917
+ 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;
5918
+ });
5919
+ for (const [entityType, module3] of enabledEntities) {
5920
+ await module3.handler({
5921
+ ...otherParams,
5922
+ state: 0,
5923
+ format: getFormat(entityType, config2),
5924
+ onlyCompositions: entityType === "composition" ? true : void 0,
5925
+ onlyPatterns: entityType === "pattern" ? true : void 0,
5926
+ mode: getPullMode(entityType, config2),
5927
+ directory: getPullFilename(entityType, config2)
5928
+ });
5929
+ }
5930
+ }
5931
+ };
5932
+ var getPullMode = (entityType, config2) => {
5933
+ return getEntityOption({
5934
+ optionName: "mode",
5935
+ operation: "pull",
5936
+ config: config2,
5937
+ entityType
5938
+ });
5939
+ };
5940
+ var getPullFilename = (entityType, config2) => {
5941
+ return getDirectoryOrFilename({
5942
+ operation: "pull",
5943
+ config: config2,
5944
+ entityType
5945
+ });
5946
+ };
5947
+ var getFormat = (entityType, config2) => {
5948
+ return getEntityOption({
5949
+ optionName: "format",
5950
+ operation: "pull",
5951
+ config: config2,
5952
+ entityType
5953
+ });
5954
+ };
5955
+
5956
+ // src/commands/sync/commands/push.ts
5957
+ var SyncPushModule = {
5958
+ command: "push",
5959
+ describe: "Pushes whole project data from files in a directory or package to Uniform",
5960
+ builder: (yargs23) => withConfiguration(
5961
+ withApiOptions(
5962
+ withProjectOptions(
5963
+ withDiffOptions(
5964
+ yargs23.option("what-if", {
5965
+ alias: ["w"],
5966
+ describe: "What-if mode reports what would be done but changes nothing",
5967
+ default: false,
5968
+ type: "boolean"
5969
+ })
5970
+ )
5971
+ )
5972
+ )
5973
+ ),
5974
+ handler: async ({ serialization, ...otherParams }) => {
5975
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
5976
+ const config2 = serialization;
5977
+ const enabledEntities = Object.entries({
5978
+ category: CategoryPushModule,
5979
+ dataType: DataTypePushModule,
5980
+ quirk: QuirkPushModule,
5981
+ test: TestPushModule,
5982
+ signal: SignalPushModule,
5983
+ enrichment: EnrichmentPushModule,
5984
+ aggregate: AggregatePushModule,
5985
+ component: ComponentPushModule,
5986
+ pattern: PatternPushModule,
5987
+ composition: CompositionPushModule,
5988
+ projectMapDefinition: ProjectMapDefinitionPushModule,
5989
+ projectMapNode: ProjectMapNodePushModule,
5990
+ redirect: RedirectDefinitionPushModule
5991
+ }).filter(([entityType]) => {
5992
+ var _a2, _b2, _c2, _d2, _e2, _f2;
5993
+ 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;
5994
+ });
5995
+ for (const [entityType, module3] of enabledEntities) {
5996
+ await module3.handler({
5997
+ ...otherParams,
5998
+ state: 0,
5999
+ format: getFormat2(entityType, config2),
6000
+ onlyCompositions: entityType === "composition" ? true : void 0,
6001
+ onlyPatterns: entityType === "pattern" ? true : void 0,
6002
+ mode: getPushMode(entityType, config2),
6003
+ directory: getPushFilename(entityType, config2)
6004
+ });
6005
+ }
6006
+ 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)) {
6007
+ await PatternPublishModule.handler({ ...otherParams, all: true });
6008
+ }
6009
+ 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)) {
6010
+ await CompositionPublishModule.handler({ ...otherParams, all: true });
6011
+ }
6012
+ }
6013
+ };
6014
+ var getPushMode = (entityType, config2) => {
6015
+ return getEntityOption({
6016
+ optionName: "mode",
6017
+ operation: "push",
6018
+ config: config2,
6019
+ entityType
6020
+ });
6021
+ };
6022
+ var getPushFilename = (entityType, config2) => {
6023
+ return getDirectoryOrFilename({
6024
+ operation: "push",
6025
+ config: config2,
6026
+ entityType
6027
+ });
6028
+ };
6029
+ var getFormat2 = (entityType, config2) => {
6030
+ return getEntityOption({
6031
+ optionName: "format",
6032
+ operation: "push",
6033
+ config: config2,
6034
+ entityType
6035
+ });
6036
+ };
6037
+
6038
+ // src/commands/sync/index.ts
6039
+ var SyncCommand = {
6040
+ command: "sync <command>",
6041
+ describe: "Uniform Sync commands",
6042
+ builder: (yargs23) => yargs23.command(SyncPullModule).command(SyncPushModule).demandCommand(),
5420
6043
  handler: () => {
5421
- yargs19.showHelp();
6044
+ yargs21.showHelp();
5422
6045
  }
5423
6046
  };
5424
6047
 
@@ -5465,14 +6088,14 @@ import { magenta, red as red6 } from "colorette";
5465
6088
  import { join as join2 } from "path";
5466
6089
 
5467
6090
  // src/fs.ts
5468
- import { promises as fs4 } from "fs";
6091
+ import { promises as fs5 } from "fs";
5469
6092
  async function readJSON(path4) {
5470
- const fileContents = await fs4.readFile(path4, "utf-8");
6093
+ const fileContents = await fs5.readFile(path4, "utf-8");
5471
6094
  return JSON.parse(fileContents);
5472
6095
  }
5473
6096
  async function tryReadJSON(path4, missingValue = null) {
5474
6097
  try {
5475
- const stat = await fs4.stat(path4);
6098
+ const stat = await fs5.stat(path4);
5476
6099
  return stat.isFile() ? await readJSON(path4) : missingValue;
5477
6100
  } catch (e) {
5478
6101
  return missingValue;
@@ -5534,9 +6157,13 @@ First found was: v${firstVersion}`;
5534
6157
 
5535
6158
  // src/index.ts
5536
6159
  dotenv.config();
5537
- var yarggery = yargs20(hideBin(process.argv));
6160
+ var yarggery = yargs22(hideBin(process.argv));
6161
+ var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
6162
+ var configuration = loadConfig(inlineConfigurationFilePath || null);
5538
6163
  yarggery.option("verbose", {
5539
6164
  describe: "Include verbose logging",
5540
6165
  default: false,
5541
6166
  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;
6167
+ }).scriptName("uniform").config(configuration).config("config", function() {
6168
+ return {};
6169
+ }).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).argv;