@uniformdev/cli 19.39.0 → 19.39.1-alpha.10

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
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
+ import { cosmiconfigSync } from "cosmiconfig";
5
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
4
6
  import * as dotenv from "dotenv";
5
- import yargs20 from "yargs";
7
+ import fs5 from "fs";
8
+ import yargs22 from "yargs";
6
9
  import { hideBin } from "yargs/helpers";
7
10
 
8
11
  // src/commands/canvas/index.ts
9
- import yargs5 from "yargs";
12
+ import yargs6 from "yargs";
10
13
 
11
14
  // src/commands/canvas/commands/category.ts
12
15
  import yargs from "yargs";
@@ -92,8 +95,14 @@ import httpsProxyAgent from "https-proxy-agent";
92
95
  import unfetch from "isomorphic-unfetch";
93
96
  import { dump, load } from "js-yaml";
94
97
  import { extname } from "path";
95
- function withApiOptions(yargs21) {
96
- return yargs21.option("apiKey", {
98
+ function withConfiguration(yargs23) {
99
+ return yargs23.option("serialization", {
100
+ skipValidation: true,
101
+ hidden: true
102
+ });
103
+ }
104
+ function withApiOptions(yargs23) {
105
+ return yargs23.option("apiKey", {
97
106
  describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
98
107
  default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
99
108
  process.env.CANVAS_CLI_API_KEY ?? // deprecated
@@ -132,8 +141,8 @@ function nodeFetchProxy(proxy) {
132
141
  };
133
142
  return wrappedFetch;
134
143
  }
135
- function withProjectOptions(yargs21) {
136
- return yargs21.option("project", {
144
+ function withProjectOptions(yargs23) {
145
+ return yargs23.option("project", {
137
146
  describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
138
147
  default: process.env.UNIFORM_CLI_PROJECT_ID ?? // deprecated
139
148
  process.env.CANVAS_CLI_PROJECT_ID ?? // deprecated
@@ -143,8 +152,8 @@ function withProjectOptions(yargs21) {
143
152
  alias: ["p"]
144
153
  });
145
154
  }
146
- function withFormatOptions(yargs21) {
147
- return yargs21.option("format", {
155
+ function withFormatOptions(yargs23) {
156
+ return yargs23.option("format", {
148
157
  alias: ["f"],
149
158
  describe: "Output format",
150
159
  default: "yaml",
@@ -156,8 +165,8 @@ function withFormatOptions(yargs21) {
156
165
  type: "string"
157
166
  });
158
167
  }
159
- function withDiffOptions(yargs21) {
160
- return yargs21.option("diff", {
168
+ function withDiffOptions(yargs23) {
169
+ return yargs23.option("diff", {
161
170
  describe: "Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",
162
171
  default: process.env.UNIFORM_CLI_DIFF_MODE ?? "off",
163
172
  type: "string",
@@ -217,6 +226,72 @@ async function* paginateAsync(fetchPage, options) {
217
226
  offset += perPage;
218
227
  } while (pageData.length === perPage);
219
228
  }
229
+ var defaultSyncConfiguration = {
230
+ entitiesConfig: {},
231
+ directory: "uniform-data",
232
+ format: "yaml",
233
+ mode: "mirror"
234
+ };
235
+ var applyDefaultSyncConfiguration = (config2) => {
236
+ var _a;
237
+ const mergedConfig = {
238
+ serialization: {
239
+ ...defaultSyncConfiguration,
240
+ ...(config2 == null ? void 0 : config2.serialization) ?? {},
241
+ entitiesConfig: {
242
+ ...defaultSyncConfiguration.entitiesConfig,
243
+ ...((_a = config2 == null ? void 0 : config2.serialization) == null ? void 0 : _a.entitiesConfig) ?? {}
244
+ }
245
+ }
246
+ };
247
+ for (const entityType in mergedConfig.serialization.entitiesConfig) {
248
+ const entityTypeCasted = entityType;
249
+ const entityConfig = mergedConfig.serialization.entitiesConfig[entityTypeCasted];
250
+ if (Object.keys(entityConfig).length === 0) {
251
+ const separator = mergedConfig.serialization.directory[mergedConfig.serialization.directory.length - 1] === "/" ? "" : "/";
252
+ mergedConfig.serialization.entitiesConfig[entityTypeCasted].directory = isPathAPackageFile(
253
+ mergedConfig.serialization.directory
254
+ ) ? mergedConfig.serialization.directory : `${mergedConfig.serialization.directory}${separator}${entityTypeCasted}`;
255
+ }
256
+ }
257
+ return mergedConfig;
258
+ };
259
+ var getEntityOption = ({
260
+ optionName,
261
+ config: config2,
262
+ entityType,
263
+ operation
264
+ }) => {
265
+ var _a, _b, _c, _d, _e, _f;
266
+ if ((_b = (_a = config2.entitiesConfig[entityType]) == null ? void 0 : _a[operation]) == null ? void 0 : _b[optionName]) {
267
+ return (_d = (_c = config2.entitiesConfig[entityType]) == null ? void 0 : _c[operation]) == null ? void 0 : _d[optionName];
268
+ }
269
+ if ((_e = config2.entitiesConfig[entityType]) == null ? void 0 : _e[optionName]) {
270
+ return (_f = config2.entitiesConfig[entityType]) == null ? void 0 : _f[optionName];
271
+ }
272
+ if (config2[optionName]) {
273
+ return config2[optionName];
274
+ }
275
+ throw `No ${optionName} option specified for ${entityType} ${operation}`;
276
+ };
277
+ var getDirectoryOrFilename = ({
278
+ config: config2,
279
+ entityType,
280
+ operation
281
+ }) => {
282
+ var _a, _b, _c, _d, _e, _f;
283
+ if ((_b = (_a = config2.entitiesConfig[entityType]) == null ? void 0 : _a[operation]) == null ? void 0 : _b.directory) {
284
+ return (_d = (_c = config2.entitiesConfig[entityType]) == null ? void 0 : _c[operation]) == null ? void 0 : _d.directory;
285
+ }
286
+ if ((_e = config2.entitiesConfig[entityType]) == null ? void 0 : _e.directory) {
287
+ return (_f = config2.entitiesConfig[entityType]) == null ? void 0 : _f.directory;
288
+ }
289
+ const isPackage = isPathAPackageFile(config2.directory);
290
+ if (isPackage) {
291
+ return config2.directory;
292
+ }
293
+ return `${config2.directory}/${entityType}`;
294
+ };
220
295
 
221
296
  // src/sync/fileSyncEngineDataSource.ts
222
297
  async function createFileSyncEngineDataSource({
@@ -475,9 +550,13 @@ function createSyncEngineConsoleLogger(options) {
475
550
  var CategoryGetModule = {
476
551
  command: "get <id>",
477
552
  describe: "Fetch a category",
478
- builder: (yargs21) => withFormatOptions(
479
- withApiOptions(
480
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Category UUID to fetch" }))
553
+ builder: (yargs23) => withConfiguration(
554
+ withFormatOptions(
555
+ withApiOptions(
556
+ withProjectOptions(
557
+ yargs23.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
558
+ )
559
+ )
481
560
  )
482
561
  ),
483
562
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
@@ -500,7 +579,7 @@ var CategoryListModule = {
500
579
  command: "list",
501
580
  describe: "List categories",
502
581
  aliases: ["ls"],
503
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21.options({})))),
582
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23.options({}))))),
504
583
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
505
584
  const fetch3 = nodeFetchProxy(proxy);
506
585
  const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -557,30 +636,32 @@ function writeCanvasPackage(filename, packageContents) {
557
636
  var CategoryPullModule = {
558
637
  command: "pull <directory>",
559
638
  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
- })
639
+ builder: (yargs23) => withConfiguration(
640
+ withApiOptions(
641
+ withProjectOptions(
642
+ withDiffOptions(
643
+ yargs23.positional("directory", {
644
+ 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.",
645
+ type: "string"
646
+ }).option("format", {
647
+ alias: ["f"],
648
+ describe: "Output format",
649
+ default: "yaml",
650
+ choices: ["yaml", "json"],
651
+ type: "string"
652
+ }).option("what-if", {
653
+ alias: ["w"],
654
+ describe: "What-if mode reports what would be done but changes no files",
655
+ default: false,
656
+ type: "boolean"
657
+ }).option("mode", {
658
+ alias: ["m"],
659
+ 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',
660
+ choices: ["create", "createOrUpdate", "mirror"],
661
+ default: "mirror",
662
+ type: "string"
663
+ })
664
+ )
584
665
  )
585
666
  )
586
667
  ),
@@ -634,24 +715,26 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
634
715
  var CategoryPushModule = {
635
716
  command: "push <directory>",
636
717
  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
- })
718
+ builder: (yargs23) => withConfiguration(
719
+ withApiOptions(
720
+ withProjectOptions(
721
+ withDiffOptions(
722
+ yargs23.positional("directory", {
723
+ describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
724
+ type: "string"
725
+ }).option("what-if", {
726
+ alias: ["w"],
727
+ describe: "What-if mode reports what would be done but changes nothing",
728
+ default: false,
729
+ type: "boolean"
730
+ }).option("mode", {
731
+ alias: ["m"],
732
+ 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',
733
+ choices: ["create", "createOrUpdate", "mirror"],
734
+ default: "mirror",
735
+ type: "string"
736
+ })
737
+ )
655
738
  )
656
739
  )
657
740
  ),
@@ -700,8 +783,12 @@ var CategoryRemoveModule = {
700
783
  command: "remove <id>",
701
784
  aliases: ["delete", "rm"],
702
785
  describe: "Delete a category",
703
- builder: (yargs21) => withApiOptions(
704
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Category UUID to delete" }))
786
+ builder: (yargs23) => withConfiguration(
787
+ withApiOptions(
788
+ withProjectOptions(
789
+ yargs23.positional("id", { demandOption: true, describe: "Category UUID to delete" })
790
+ )
791
+ )
705
792
  ),
706
793
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
707
794
  const fetch3 = nodeFetchProxy(proxy);
@@ -716,9 +803,11 @@ var CategoryUpdateModule = {
716
803
  command: "update <filename>",
717
804
  aliases: ["put"],
718
805
  describe: "Insert or update a category",
719
- builder: (yargs21) => withApiOptions(
720
- withProjectOptions(
721
- yargs21.positional("filename", { demandOption: true, describe: "Category file to put" })
806
+ builder: (yargs23) => withConfiguration(
807
+ withApiOptions(
808
+ withProjectOptions(
809
+ yargs23.positional("filename", { demandOption: true, describe: "Category file to put" })
810
+ )
722
811
  )
723
812
  ),
724
813
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -734,7 +823,7 @@ var CategoryModule = {
734
823
  command: "category <command>",
735
824
  aliases: ["cat"],
736
825
  describe: "Commands for Canvas categories",
737
- builder: (yargs21) => yargs21.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
826
+ builder: (yargs23) => yargs23.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
738
827
  handler: () => {
739
828
  yargs.help();
740
829
  }
@@ -755,10 +844,15 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
755
844
  var ComponentGetModule = {
756
845
  command: "get <id>",
757
846
  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" })
847
+ builder: (yargs23) => withConfiguration(
848
+ withFormatOptions(
849
+ withApiOptions(
850
+ withProjectOptions(
851
+ yargs23.positional("id", {
852
+ demandOption: true,
853
+ describe: "Component definition public ID to fetch"
854
+ })
855
+ )
762
856
  )
763
857
  )
764
858
  ),
@@ -788,13 +882,15 @@ var ComponentListModule = {
788
882
  command: "list",
789
883
  describe: "List component definitions",
790
884
  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
- })
885
+ builder: (yargs23) => withConfiguration(
886
+ withFormatOptions(
887
+ withApiOptions(
888
+ withProjectOptions(
889
+ yargs23.options({
890
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
891
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
892
+ })
893
+ )
798
894
  )
799
895
  )
800
896
  ),
@@ -845,30 +941,32 @@ function createComponentDefinitionEngineDataSource({
845
941
  var ComponentPullModule = {
846
942
  command: "pull <directory>",
847
943
  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
- })
944
+ builder: (yargs23) => withConfiguration(
945
+ withApiOptions(
946
+ withProjectOptions(
947
+ withDiffOptions(
948
+ yargs23.positional("directory", {
949
+ 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.",
950
+ type: "string"
951
+ }).option("format", {
952
+ alias: ["f"],
953
+ describe: "Output format",
954
+ default: "yaml",
955
+ choices: ["yaml", "json"],
956
+ type: "string"
957
+ }).option("what-if", {
958
+ alias: ["w"],
959
+ describe: "What-if mode reports what would be done but changes no files",
960
+ default: false,
961
+ type: "boolean"
962
+ }).option("mode", {
963
+ alias: ["m"],
964
+ 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',
965
+ choices: ["create", "createOrUpdate", "mirror"],
966
+ default: "mirror",
967
+ type: "string"
968
+ })
969
+ )
872
970
  )
873
971
  )
874
972
  ),
@@ -923,24 +1021,26 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
923
1021
  var ComponentPushModule = {
924
1022
  command: "push <directory>",
925
1023
  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
- })
1024
+ builder: (yargs23) => withConfiguration(
1025
+ withApiOptions(
1026
+ withProjectOptions(
1027
+ withDiffOptions(
1028
+ yargs23.positional("directory", {
1029
+ describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
1030
+ type: "string"
1031
+ }).option("what-if", {
1032
+ alias: ["w"],
1033
+ describe: "What-if mode reports what would be done but changes nothing",
1034
+ default: false,
1035
+ type: "boolean"
1036
+ }).option("mode", {
1037
+ alias: ["m"],
1038
+ 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',
1039
+ choices: ["create", "createOrUpdate", "mirror"],
1040
+ default: "mirror",
1041
+ type: "string"
1042
+ })
1043
+ )
944
1044
  )
945
1045
  )
946
1046
  ),
@@ -990,9 +1090,11 @@ var ComponentRemoveModule = {
990
1090
  command: "remove <id>",
991
1091
  aliases: ["delete", "rm"],
992
1092
  describe: "Delete a component definition",
993
- builder: (yargs21) => withApiOptions(
994
- withProjectOptions(
995
- yargs21.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
1093
+ builder: (yargs23) => withConfiguration(
1094
+ withApiOptions(
1095
+ withProjectOptions(
1096
+ yargs23.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
1097
+ )
996
1098
  )
997
1099
  ),
998
1100
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1008,9 +1110,11 @@ var ComponentUpdateModule = {
1008
1110
  command: "update <filename>",
1009
1111
  aliases: ["put"],
1010
1112
  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" })
1113
+ builder: (yargs23) => withConfiguration(
1114
+ withApiOptions(
1115
+ withProjectOptions(
1116
+ yargs23.positional("filename", { demandOption: true, describe: "Component definition file to put" })
1117
+ )
1014
1118
  )
1015
1119
  ),
1016
1120
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -1026,7 +1130,7 @@ var ComponentModule = {
1026
1130
  command: "component <command>",
1027
1131
  aliases: ["def"],
1028
1132
  describe: "Commands for Canvas component definitions",
1029
- builder: (yargs21) => yargs21.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
1133
+ builder: (yargs23) => yargs23.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
1030
1134
  handler: () => {
1031
1135
  yargs2.help();
1032
1136
  }
@@ -1048,8 +1152,8 @@ function prepCompositionForDisk(composition) {
1048
1152
  delete prepped.state;
1049
1153
  return prepped;
1050
1154
  }
1051
- function withStateOptions(yargs21) {
1052
- return yargs21.option("state", {
1155
+ function withStateOptions(yargs23) {
1156
+ return yargs23.option("state", {
1053
1157
  type: "string",
1054
1158
  describe: `Composition state to fetch.`,
1055
1159
  choices: ["preview", "published"],
@@ -1074,37 +1178,39 @@ function convertCompositionState(state) {
1074
1178
  var CompositionGetModule = {
1075
1179
  command: "get <id>",
1076
1180
  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
- })
1181
+ builder: (yargs23) => withFormatOptions(
1182
+ withConfiguration(
1183
+ withApiOptions(
1184
+ withProjectOptions(
1185
+ withStateOptions(
1186
+ yargs23.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
1187
+ resolvePatterns: {
1188
+ type: "boolean",
1189
+ default: false,
1190
+ describe: "Resolve pattern references in the composition"
1191
+ },
1192
+ resolveOverrides: {
1193
+ type: "boolean",
1194
+ default: false,
1195
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
1196
+ },
1197
+ componentIDs: {
1198
+ type: "boolean",
1199
+ default: false,
1200
+ describe: "Include individual component UIDs"
1201
+ },
1202
+ resolveData: {
1203
+ type: "boolean",
1204
+ default: false,
1205
+ describe: "Resolve all data resources used by the composition/pattern"
1206
+ },
1207
+ diagnostics: {
1208
+ type: "boolean",
1209
+ default: false,
1210
+ describe: "Include diagnostics information when resolving data"
1211
+ }
1212
+ })
1213
+ )
1108
1214
  )
1109
1215
  )
1110
1216
  )
@@ -1148,29 +1254,42 @@ var CompositionListModule = {
1148
1254
  command: "list",
1149
1255
  describe: "List compositions",
1150
1256
  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
- })
1257
+ builder: (yargs23) => withFormatOptions(
1258
+ withConfiguration(
1259
+ withApiOptions(
1260
+ withProjectOptions(
1261
+ withStateOptions(
1262
+ yargs23.options({
1263
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
1264
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
1265
+ resolvePatterns: {
1266
+ type: "boolean",
1267
+ default: false,
1268
+ describe: "Resolve pattern references in the composition"
1269
+ },
1270
+ resolveOverrides: {
1271
+ type: "boolean",
1272
+ default: false,
1273
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
1274
+ },
1275
+ onlyCompositions: {
1276
+ describe: "Only pulling compositions and not patterns",
1277
+ default: false,
1278
+ type: "boolean"
1279
+ },
1280
+ onlyPatterns: {
1281
+ describe: "Only pulling patterns and not compositions",
1282
+ default: false,
1283
+ type: "boolean",
1284
+ hidden: true
1285
+ },
1286
+ componentIDs: {
1287
+ type: "boolean",
1288
+ default: false,
1289
+ describe: "Include individual component UIDs"
1290
+ }
1291
+ })
1292
+ )
1174
1293
  )
1175
1294
  )
1176
1295
  )
@@ -1183,6 +1302,8 @@ var CompositionListModule = {
1183
1302
  offset,
1184
1303
  format,
1185
1304
  filename,
1305
+ onlyCompositions,
1306
+ onlyPatterns,
1186
1307
  project: projectId,
1187
1308
  state,
1188
1309
  resolvePatterns,
@@ -1194,6 +1315,7 @@ var CompositionListModule = {
1194
1315
  const res = await client.getCompositionList({
1195
1316
  limit,
1196
1317
  offset,
1318
+ pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
1197
1319
  state: convertCompositionState(state),
1198
1320
  skipPatternResolution: !resolvePatterns,
1199
1321
  withComponentIDs: componentIDs,
@@ -1214,6 +1336,8 @@ var selectDisplayName3 = (component) => `${component.composition._name ?? compon
1214
1336
  function createComponentInstanceEngineDataSource({
1215
1337
  client,
1216
1338
  state,
1339
+ onlyCompositions,
1340
+ onlyPatterns,
1217
1341
  ...clientOptions
1218
1342
  }) {
1219
1343
  const stateId = convertCompositionState(state);
@@ -1223,6 +1347,7 @@ function createComponentInstanceEngineDataSource({
1223
1347
  ...clientOptions,
1224
1348
  limit,
1225
1349
  offset,
1350
+ pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
1226
1351
  state: stateId,
1227
1352
  skipPatternResolution: true,
1228
1353
  skipOverridesResolution: true,
@@ -1253,43 +1378,36 @@ function createComponentInstanceEngineDataSource({
1253
1378
 
1254
1379
  // src/commands/canvas/commands/composition/publish.ts
1255
1380
  var CompositionPublishModule = {
1256
- command: "publish [compositionIDs]",
1381
+ command: "publish [ids]",
1257
1382
  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
- })
1383
+ builder: (yargs23) => withConfiguration(
1384
+ withApiOptions(
1385
+ withProjectOptions(
1386
+ withDiffOptions(
1387
+ yargs23.positional("ids", {
1388
+ describe: "Publishes composition/pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
1389
+ type: "string"
1390
+ }).option("all", {
1391
+ alias: ["a"],
1392
+ describe: "Publishes all compositions. Use compositionId to publish one instead.",
1393
+ default: false,
1394
+ type: "boolean"
1395
+ }).option("what-if", {
1396
+ alias: ["w"],
1397
+ describe: "What-if mode reports what would be done but does not perform any publishing",
1398
+ default: false,
1399
+ type: "boolean"
1400
+ })
1401
+ )
1275
1402
  )
1276
1403
  )
1277
1404
  ),
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) {
1405
+ handler: async ({ apiHost, apiKey, proxy, ids, all, whatIf, project: projectId, diff: diffMode }) => {
1406
+ if (!all && !ids || all && ids) {
1289
1407
  console.error(`Specify --all or composition ID(s) to publish.`);
1290
1408
  process.exit(1);
1291
1409
  }
1292
- const compositionIDsArray = compositionIDs ? compositionIDs.split(",").map((id) => id.trim()) : void 0;
1410
+ const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
1293
1411
  const fetch3 = nodeFetchProxy(proxy);
1294
1412
  const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
1295
1413
  const source = createComponentInstanceEngineDataSource({
@@ -1317,31 +1435,42 @@ import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canv
1317
1435
  var CompositionPullModule = {
1318
1436
  command: "pull <directory>",
1319
1437
  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
- })
1438
+ builder: (yargs23) => withConfiguration(
1439
+ withApiOptions(
1440
+ withProjectOptions(
1441
+ withStateOptions(
1442
+ withDiffOptions(
1443
+ yargs23.positional("directory", {
1444
+ 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.",
1445
+ type: "string"
1446
+ }).option("format", {
1447
+ alias: ["f"],
1448
+ describe: "Output format",
1449
+ default: "yaml",
1450
+ choices: ["yaml", "json"],
1451
+ type: "string"
1452
+ }).option("onlyCompositions", {
1453
+ describe: "Only pulling compositions and not patterns",
1454
+ default: false,
1455
+ type: "boolean"
1456
+ }).option("onlyPatterns", {
1457
+ describe: "Only pulling patterns and not compositions",
1458
+ default: false,
1459
+ type: "boolean",
1460
+ hidden: true
1461
+ }).option("what-if", {
1462
+ alias: ["w"],
1463
+ describe: "What-if mode reports what would be done but changes no files",
1464
+ default: false,
1465
+ type: "boolean"
1466
+ }).option("mode", {
1467
+ alias: ["m"],
1468
+ 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',
1469
+ choices: ["create", "createOrUpdate", "mirror"],
1470
+ default: "mirror",
1471
+ type: "string"
1472
+ })
1473
+ )
1345
1474
  )
1346
1475
  )
1347
1476
  )
@@ -1352,6 +1481,8 @@ var CompositionPullModule = {
1352
1481
  proxy,
1353
1482
  directory,
1354
1483
  format,
1484
+ onlyCompositions,
1485
+ onlyPatterns,
1355
1486
  mode,
1356
1487
  whatIf,
1357
1488
  state,
@@ -1360,7 +1491,7 @@ var CompositionPullModule = {
1360
1491
  }) => {
1361
1492
  const fetch3 = nodeFetchProxy(proxy);
1362
1493
  const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
1363
- const source = createComponentInstanceEngineDataSource({ client, state });
1494
+ const source = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
1364
1495
  const isPackage = isPathAPackageFile(directory);
1365
1496
  let target;
1366
1497
  if (isPackage) {
@@ -1397,25 +1528,36 @@ import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canv
1397
1528
  var CompositionPushModule = {
1398
1529
  command: "push <directory>",
1399
1530
  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
- })
1531
+ builder: (yargs23) => withConfiguration(
1532
+ withApiOptions(
1533
+ withProjectOptions(
1534
+ withStateOptions(
1535
+ withDiffOptions(
1536
+ yargs23.positional("directory", {
1537
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
1538
+ type: "string"
1539
+ }).option("what-if", {
1540
+ alias: ["w"],
1541
+ describe: "What-if mode reports what would be done but changes nothing",
1542
+ default: false,
1543
+ type: "boolean"
1544
+ }).option("mode", {
1545
+ alias: ["m"],
1546
+ 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',
1547
+ choices: ["create", "createOrUpdate", "mirror"],
1548
+ default: "mirror",
1549
+ type: "string"
1550
+ }).option("onlyCompositions", {
1551
+ describe: "Only pulling compositions and not patterns",
1552
+ default: false,
1553
+ type: "boolean"
1554
+ }).option("onlyPatterns", {
1555
+ describe: "Only pulling patterns and not compositions",
1556
+ default: false,
1557
+ type: "boolean",
1558
+ hidden: true
1559
+ })
1560
+ )
1419
1561
  )
1420
1562
  )
1421
1563
  )
@@ -1429,6 +1571,8 @@ var CompositionPushModule = {
1429
1571
  whatIf,
1430
1572
  state,
1431
1573
  project: projectId,
1574
+ onlyCompositions,
1575
+ onlyPatterns,
1432
1576
  diff: diffMode
1433
1577
  }) => {
1434
1578
  const fetch3 = nodeFetchProxy(proxy);
@@ -1449,7 +1593,7 @@ var CompositionPushModule = {
1449
1593
  selectDisplayName: selectDisplayName3
1450
1594
  });
1451
1595
  }
1452
- const target = createComponentInstanceEngineDataSource({ client, state });
1596
+ const target = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
1453
1597
  await syncEngine({
1454
1598
  source,
1455
1599
  target,
@@ -1466,9 +1610,11 @@ var CompositionRemoveModule = {
1466
1610
  command: "remove <id>",
1467
1611
  aliases: ["delete", "rm"],
1468
1612
  describe: "Delete a composition",
1469
- builder: (yargs21) => withApiOptions(
1470
- withProjectOptions(
1471
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to delete" })
1613
+ builder: (yargs23) => withConfiguration(
1614
+ withApiOptions(
1615
+ withProjectOptions(
1616
+ yargs23.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
1617
+ )
1472
1618
  )
1473
1619
  ),
1474
1620
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1483,9 +1629,14 @@ import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2, UncachedCanvasClient
1483
1629
  var CompositionUnpublishModule = {
1484
1630
  command: "unpublish <id>",
1485
1631
  describe: "Unpublish a composition",
1486
- builder: (yargs21) => withApiOptions(
1487
- withProjectOptions(
1488
- yargs21.positional("id", { demandOption: true, describe: "Composition public ID to unpublish" })
1632
+ builder: (yargs23) => withConfiguration(
1633
+ withApiOptions(
1634
+ withProjectOptions(
1635
+ yargs23.positional("id", {
1636
+ demandOption: true,
1637
+ describe: "Composition/pattern public ID to unpublish"
1638
+ })
1639
+ )
1489
1640
  )
1490
1641
  ),
1491
1642
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1501,11 +1652,13 @@ var CompositionUpdateModule = {
1501
1652
  command: "update <filename>",
1502
1653
  aliases: ["put"],
1503
1654
  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" })
1508
- )
1655
+ builder: (yargs23) => withConfiguration(
1656
+ withApiOptions(
1657
+ withProjectOptions(
1658
+ withStateOptions(
1659
+ yargs23.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
1660
+ )
1661
+ )
1509
1662
  )
1510
1663
  ),
1511
1664
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, state }) => {
@@ -1521,7 +1674,7 @@ var CompositionModule = {
1521
1674
  command: "composition <command>",
1522
1675
  describe: "Commands for Canvas compositions",
1523
1676
  aliases: ["comp"],
1524
- builder: (yargs21) => yargs21.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
1677
+ builder: (yargs23) => yargs23.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
1525
1678
  handler: () => {
1526
1679
  yargs3.help();
1527
1680
  }
@@ -1536,11 +1689,13 @@ var DataTypeGetModule = {
1536
1689
  command: "get <id>",
1537
1690
  describe: "Get a data type",
1538
1691
  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" })
1692
+ builder: (yargs23) => withConfiguration(
1693
+ withFormatOptions(
1694
+ withApiOptions(
1695
+ withProjectOptions(
1696
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1697
+ yargs23.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
1698
+ )
1544
1699
  )
1545
1700
  )
1546
1701
  ),
@@ -1562,7 +1717,7 @@ var DataTypeListModule = {
1562
1717
  command: "list",
1563
1718
  describe: "List data types",
1564
1719
  aliases: ["ls"],
1565
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
1720
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
1566
1721
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
1567
1722
  const fetch3 = nodeFetchProxy(proxy);
1568
1723
  const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
@@ -1611,30 +1766,32 @@ function createDataTypeEngineDataSource({
1611
1766
  var DataTypePullModule = {
1612
1767
  command: "pull <directory>",
1613
1768
  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
- })
1769
+ builder: (yargs23) => withConfiguration(
1770
+ withApiOptions(
1771
+ withProjectOptions(
1772
+ withDiffOptions(
1773
+ yargs23.positional("directory", {
1774
+ 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.",
1775
+ type: "string"
1776
+ }).option("format", {
1777
+ alias: ["f"],
1778
+ describe: "Output format",
1779
+ default: "yaml",
1780
+ choices: ["yaml", "json"],
1781
+ type: "string"
1782
+ }).option("what-if", {
1783
+ alias: ["w"],
1784
+ describe: "What-if mode reports what would be done but changes no files",
1785
+ default: false,
1786
+ type: "boolean"
1787
+ }).option("mode", {
1788
+ alias: ["m"],
1789
+ 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',
1790
+ choices: ["create", "createOrUpdate", "mirror"],
1791
+ default: "mirror",
1792
+ type: "string"
1793
+ })
1794
+ )
1638
1795
  )
1639
1796
  )
1640
1797
  ),
@@ -1694,24 +1851,26 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
1694
1851
  var DataTypePushModule = {
1695
1852
  command: "push <directory>",
1696
1853
  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
- })
1854
+ builder: (yargs23) => withConfiguration(
1855
+ withApiOptions(
1856
+ withProjectOptions(
1857
+ withDiffOptions(
1858
+ yargs23.positional("directory", {
1859
+ describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
1860
+ type: "string"
1861
+ }).option("what-if", {
1862
+ alias: ["w"],
1863
+ describe: "What-if mode reports what would be done but changes nothing",
1864
+ default: false,
1865
+ type: "boolean"
1866
+ }).option("mode", {
1867
+ alias: ["m"],
1868
+ 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',
1869
+ choices: ["create", "createOrUpdate", "mirror"],
1870
+ default: "mirror",
1871
+ type: "string"
1872
+ })
1873
+ )
1715
1874
  )
1716
1875
  )
1717
1876
  ),
@@ -1766,9 +1925,11 @@ var DataTypeRemoveModule = {
1766
1925
  command: "remove <id>",
1767
1926
  aliases: ["delete", "rm"],
1768
1927
  describe: "Delete a data type",
1769
- builder: (yargs21) => withApiOptions(
1770
- withProjectOptions(
1771
- yargs21.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
1928
+ builder: (yargs23) => withConfiguration(
1929
+ withApiOptions(
1930
+ withProjectOptions(
1931
+ yargs23.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
1932
+ )
1772
1933
  )
1773
1934
  ),
1774
1935
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -1784,9 +1945,11 @@ var DataTypeUpdateModule = {
1784
1945
  command: "update <filename>",
1785
1946
  aliases: ["put"],
1786
1947
  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" })
1948
+ builder: (yargs23) => withConfiguration(
1949
+ withApiOptions(
1950
+ withProjectOptions(
1951
+ yargs23.positional("filename", { demandOption: true, describe: "Data type file to put" })
1952
+ )
1790
1953
  )
1791
1954
  ),
1792
1955
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -1802,38 +1965,206 @@ var DataTypeModule = {
1802
1965
  command: "datatype <command>",
1803
1966
  aliases: ["dt"],
1804
1967
  describe: "Commands for Data Type definitions",
1805
- builder: (yargs21) => yargs21.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
1968
+ builder: (yargs23) => yargs23.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
1806
1969
  handler: () => {
1807
1970
  yargs4.help();
1808
1971
  }
1809
1972
  };
1810
1973
 
1974
+ // src/commands/canvas/commands/pattern.ts
1975
+ import yargs5 from "yargs";
1976
+
1977
+ // src/commands/canvas/commands/pattern/get.ts
1978
+ var PatternGetModule = {
1979
+ ...CompositionGetModule,
1980
+ describe: "Fetch a pattern"
1981
+ };
1982
+
1983
+ // src/commands/canvas/commands/pattern/list.ts
1984
+ var PatternListModule = {
1985
+ ...CompositionListModule,
1986
+ describe: "List patterns",
1987
+ builder: (yargs23) => withFormatOptions(
1988
+ withConfiguration(
1989
+ withApiOptions(
1990
+ withProjectOptions(
1991
+ withStateOptions(
1992
+ yargs23.options({
1993
+ offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
1994
+ limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
1995
+ resolvePatterns: {
1996
+ type: "boolean",
1997
+ default: false,
1998
+ describe: "Resolve pattern references in the composition"
1999
+ },
2000
+ resolveOverrides: {
2001
+ type: "boolean",
2002
+ default: false,
2003
+ describe: "Resolves pattern overrides in the composition and removes override definition data"
2004
+ },
2005
+ onlyPatterns: {
2006
+ describe: "Only pulling patterns and not compositions",
2007
+ // This default differentiate this list command from composition list command
2008
+ default: true,
2009
+ type: "boolean",
2010
+ hidden: true
2011
+ },
2012
+ componentIDs: {
2013
+ alias: ["componentIDs"],
2014
+ type: "boolean",
2015
+ default: false,
2016
+ describe: "Include individual component UIDs"
2017
+ }
2018
+ })
2019
+ )
2020
+ )
2021
+ )
2022
+ )
2023
+ )
2024
+ };
2025
+
2026
+ // src/commands/canvas/commands/pattern/publish.ts
2027
+ var PatternPublishModule = {
2028
+ ...CompositionPublishModule,
2029
+ describe: "Publishes patterns"
2030
+ };
2031
+
2032
+ // src/commands/canvas/commands/pattern/pull.ts
2033
+ var PatternPullModule = {
2034
+ ...CompositionPullModule,
2035
+ describe: "Pulls all patterns to local files in a directory",
2036
+ builder: (yargs23) => withConfiguration(
2037
+ withApiOptions(
2038
+ withProjectOptions(
2039
+ withStateOptions(
2040
+ withDiffOptions(
2041
+ yargs23.positional("directory", {
2042
+ 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.",
2043
+ type: "string"
2044
+ }).option("format", {
2045
+ alias: ["f"],
2046
+ describe: "Output format",
2047
+ default: "yaml",
2048
+ choices: ["yaml", "json"],
2049
+ type: "string"
2050
+ }).option("onlyPatterns", {
2051
+ describe: "Only pulling patterns and not compositions",
2052
+ // This default differentiate this list command from composition list command
2053
+ default: true,
2054
+ type: "boolean",
2055
+ hidden: true
2056
+ }).option("what-if", {
2057
+ alias: ["w"],
2058
+ describe: "What-if mode reports what would be done but changes no files",
2059
+ default: false,
2060
+ type: "boolean"
2061
+ }).option("mode", {
2062
+ alias: ["m"],
2063
+ 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',
2064
+ choices: ["create", "createOrUpdate", "mirror"],
2065
+ default: "mirror",
2066
+ type: "string"
2067
+ })
2068
+ )
2069
+ )
2070
+ )
2071
+ )
2072
+ )
2073
+ };
2074
+
2075
+ // src/commands/canvas/commands/pattern/push.ts
2076
+ var PatternPushModule = {
2077
+ ...CompositionPushModule,
2078
+ describe: "Pushes all patterns from files in a directory to Uniform Canvas",
2079
+ builder: (yargs23) => withConfiguration(
2080
+ withApiOptions(
2081
+ withProjectOptions(
2082
+ withStateOptions(
2083
+ withDiffOptions(
2084
+ yargs23.positional("directory", {
2085
+ describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
2086
+ type: "string"
2087
+ }).option("what-if", {
2088
+ alias: ["w"],
2089
+ describe: "What-if mode reports what would be done but changes nothing",
2090
+ default: false,
2091
+ type: "boolean"
2092
+ }).option("mode", {
2093
+ alias: ["m"],
2094
+ 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',
2095
+ choices: ["create", "createOrUpdate", "mirror"],
2096
+ default: "mirror",
2097
+ type: "string"
2098
+ }).option("onlyPatterns", {
2099
+ describe: "Only pulling patterns and not compositions",
2100
+ // This default differentiate this list command from composition list command
2101
+ default: true,
2102
+ type: "boolean",
2103
+ hidden: true
2104
+ })
2105
+ )
2106
+ )
2107
+ )
2108
+ )
2109
+ )
2110
+ };
2111
+
2112
+ // src/commands/canvas/commands/pattern/remove.ts
2113
+ var PatternRemoveModule = {
2114
+ ...CompositionRemoveModule,
2115
+ describe: "Delete a pattern"
2116
+ };
2117
+
2118
+ // src/commands/canvas/commands/pattern/unpublish.ts
2119
+ var PatternUnpublishModule = {
2120
+ ...CompositionUnpublishModule,
2121
+ describe: "Unpublish a pattern"
2122
+ };
2123
+
2124
+ // src/commands/canvas/commands/pattern/update.ts
2125
+ var PatternUpdateModule = {
2126
+ ...CompositionUpdateModule,
2127
+ describe: "Insert or update a pattern"
2128
+ };
2129
+
2130
+ // src/commands/canvas/commands/pattern.ts
2131
+ var PatternModule = {
2132
+ command: "pattern <command>",
2133
+ describe: "Commands for Canvas patterns",
2134
+ builder: (yargs23) => yargs23.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
2135
+ handler: () => {
2136
+ yargs5.help();
2137
+ }
2138
+ };
2139
+
1811
2140
  // src/commands/canvas/index.ts
1812
2141
  var CanvasCommand = {
1813
2142
  command: "canvas <command>",
1814
2143
  aliases: ["cv", "pm", "presentation"],
1815
2144
  describe: "Uniform Canvas commands",
1816
- builder: (yargs21) => yargs21.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).demandCommand(),
2145
+ builder: (yargs23) => yargs23.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).command(PatternModule).demandCommand(),
1817
2146
  handler: () => {
1818
- yargs5.showHelp();
2147
+ yargs6.showHelp();
1819
2148
  }
1820
2149
  };
1821
2150
 
1822
2151
  // src/commands/context/index.ts
1823
- import yargs12 from "yargs";
2152
+ import yargs13 from "yargs";
1824
2153
 
1825
2154
  // src/commands/context/commands/aggregate.ts
1826
- import yargs6 from "yargs";
2155
+ import yargs7 from "yargs";
1827
2156
 
1828
2157
  // src/commands/context/commands/aggregate/get.ts
1829
2158
  import { UncachedAggregateClient } from "@uniformdev/context/api";
1830
2159
  var AggregateGetModule = {
1831
2160
  command: "get <id>",
1832
2161
  describe: "Fetch an aggregate",
1833
- builder: (yargs21) => withFormatOptions(
1834
- withApiOptions(
1835
- withProjectOptions(
1836
- yargs21.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
2162
+ builder: (yargs23) => withConfiguration(
2163
+ withFormatOptions(
2164
+ withApiOptions(
2165
+ withProjectOptions(
2166
+ yargs23.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
2167
+ )
1837
2168
  )
1838
2169
  )
1839
2170
  ),
@@ -1856,7 +2187,7 @@ var AggregateListModule = {
1856
2187
  command: "list",
1857
2188
  describe: "List aggregates",
1858
2189
  aliases: ["ls"],
1859
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
2190
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
1860
2191
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
1861
2192
  const fetch3 = nodeFetchProxy(proxy);
1862
2193
  const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -1922,30 +2253,32 @@ function writeContextPackage(filename, packageContents) {
1922
2253
  var AggregatePullModule = {
1923
2254
  command: "pull <directory>",
1924
2255
  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
- })
2256
+ builder: (yargs23) => withConfiguration(
2257
+ withApiOptions(
2258
+ withProjectOptions(
2259
+ withDiffOptions(
2260
+ yargs23.positional("directory", {
2261
+ 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.",
2262
+ type: "string"
2263
+ }).option("format", {
2264
+ alias: ["f"],
2265
+ describe: "Output format",
2266
+ default: "yaml",
2267
+ choices: ["yaml", "json"],
2268
+ type: "string"
2269
+ }).option("what-if", {
2270
+ alias: ["w"],
2271
+ describe: "What-if mode reports what would be done but changes no files",
2272
+ default: false,
2273
+ type: "boolean"
2274
+ }).option("mode", {
2275
+ alias: ["m"],
2276
+ 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',
2277
+ choices: ["create", "createOrUpdate", "mirror"],
2278
+ default: "mirror",
2279
+ type: "string"
2280
+ })
2281
+ )
1949
2282
  )
1950
2283
  )
1951
2284
  ),
@@ -1999,24 +2332,26 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
1999
2332
  var AggregatePushModule = {
2000
2333
  command: "push <directory>",
2001
2334
  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
- })
2335
+ builder: (yargs23) => withConfiguration(
2336
+ withApiOptions(
2337
+ withProjectOptions(
2338
+ withDiffOptions(
2339
+ yargs23.positional("directory", {
2340
+ describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
2341
+ type: "string"
2342
+ }).option("what-if", {
2343
+ alias: ["w"],
2344
+ describe: "What-if mode reports what would be done but changes nothing",
2345
+ default: false,
2346
+ type: "boolean"
2347
+ }).option("mode", {
2348
+ alias: ["m"],
2349
+ 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',
2350
+ choices: ["create", "createOrUpdate", "mirror"],
2351
+ default: "mirror",
2352
+ type: "string"
2353
+ })
2354
+ )
2020
2355
  )
2021
2356
  )
2022
2357
  ),
@@ -2066,9 +2401,11 @@ var AggregateRemoveModule = {
2066
2401
  command: "remove <id>",
2067
2402
  aliases: ["delete", "rm"],
2068
2403
  describe: "Delete an aggregate",
2069
- builder: (yargs21) => withApiOptions(
2070
- withProjectOptions(
2071
- yargs21.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
2404
+ builder: (yargs23) => withConfiguration(
2405
+ withApiOptions(
2406
+ withProjectOptions(
2407
+ yargs23.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
2408
+ )
2072
2409
  )
2073
2410
  ),
2074
2411
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2084,9 +2421,11 @@ var AggregateUpdateModule = {
2084
2421
  command: "update <filename>",
2085
2422
  aliases: ["put"],
2086
2423
  describe: "Insert or update an aggregate",
2087
- builder: (yargs21) => withApiOptions(
2088
- withProjectOptions(
2089
- yargs21.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
2424
+ builder: (yargs23) => withConfiguration(
2425
+ withApiOptions(
2426
+ withProjectOptions(
2427
+ yargs23.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
2428
+ )
2090
2429
  )
2091
2430
  ),
2092
2431
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -2102,24 +2441,26 @@ var AggregateModule = {
2102
2441
  command: "aggregate <command>",
2103
2442
  aliases: ["agg", "intent", "audience"],
2104
2443
  describe: "Commands for Context aggregates (intents, audiences)",
2105
- builder: (yargs21) => yargs21.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
2444
+ builder: (yargs23) => yargs23.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
2106
2445
  handler: () => {
2107
- yargs6.help();
2446
+ yargs7.help();
2108
2447
  }
2109
2448
  };
2110
2449
 
2111
2450
  // src/commands/context/commands/enrichment.ts
2112
- import yargs7 from "yargs";
2451
+ import yargs8 from "yargs";
2113
2452
 
2114
2453
  // src/commands/context/commands/enrichment/get.ts
2115
2454
  import { UncachedEnrichmentClient } from "@uniformdev/context/api";
2116
2455
  var EnrichmentGetModule = {
2117
2456
  command: "get <id>",
2118
2457
  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" })
2458
+ builder: (yargs23) => withFormatOptions(
2459
+ withConfiguration(
2460
+ withApiOptions(
2461
+ withProjectOptions(
2462
+ yargs23.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
2463
+ )
2123
2464
  )
2124
2465
  )
2125
2466
  ),
@@ -2143,7 +2484,7 @@ var EnrichmentListModule = {
2143
2484
  command: "list",
2144
2485
  describe: "List enrichments",
2145
2486
  aliases: ["ls"],
2146
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
2487
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
2147
2488
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
2148
2489
  const fetch3 = nodeFetchProxy(proxy);
2149
2490
  const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -2244,30 +2585,32 @@ var createEnrichmentValueEngineDataSource = ({
2244
2585
  var EnrichmentPullModule = {
2245
2586
  command: "pull <directory>",
2246
2587
  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
- })
2588
+ builder: (yargs23) => withConfiguration(
2589
+ withApiOptions(
2590
+ withProjectOptions(
2591
+ withDiffOptions(
2592
+ yargs23.positional("directory", {
2593
+ 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.",
2594
+ type: "string"
2595
+ }).option("format", {
2596
+ alias: ["f"],
2597
+ describe: "Output format",
2598
+ default: "yaml",
2599
+ choices: ["yaml", "json"],
2600
+ type: "string"
2601
+ }).option("what-if", {
2602
+ alias: ["w"],
2603
+ describe: "What-if mode reports what would be done but changes no files",
2604
+ default: false,
2605
+ type: "boolean"
2606
+ }).option("mode", {
2607
+ alias: ["m"],
2608
+ 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',
2609
+ choices: ["create", "createOrUpdate", "mirror"],
2610
+ default: "mirror",
2611
+ type: "string"
2612
+ })
2613
+ )
2271
2614
  )
2272
2615
  )
2273
2616
  ),
@@ -2321,24 +2664,26 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
2321
2664
  var EnrichmentPushModule = {
2322
2665
  command: "push <directory>",
2323
2666
  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
- })
2667
+ builder: (yargs23) => withConfiguration(
2668
+ withApiOptions(
2669
+ withProjectOptions(
2670
+ withDiffOptions(
2671
+ yargs23.positional("directory", {
2672
+ describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
2673
+ type: "string"
2674
+ }).option("what-if", {
2675
+ alias: ["w"],
2676
+ describe: "What-if mode reports what would be done but changes nothing",
2677
+ default: false,
2678
+ type: "boolean"
2679
+ }).option("mode", {
2680
+ alias: ["m"],
2681
+ 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',
2682
+ choices: ["create", "createOrUpdate", "mirror"],
2683
+ default: "mirror",
2684
+ type: "string"
2685
+ })
2686
+ )
2342
2687
  )
2343
2688
  )
2344
2689
  ),
@@ -2387,9 +2732,11 @@ var EnrichmentRemoveModule = {
2387
2732
  command: "remove <id>",
2388
2733
  aliases: ["delete", "rm"],
2389
2734
  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" })
2735
+ builder: (yargs23) => withConfiguration(
2736
+ withApiOptions(
2737
+ withProjectOptions(
2738
+ yargs23.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
2739
+ )
2393
2740
  )
2394
2741
  ),
2395
2742
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2404,14 +2751,14 @@ var EnrichmentModule = {
2404
2751
  command: "enrichment <command>",
2405
2752
  aliases: ["enr"],
2406
2753
  describe: "Commands for Context enrichments",
2407
- builder: (yargs21) => yargs21.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
2754
+ builder: (yargs23) => yargs23.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
2408
2755
  handler: () => {
2409
- yargs7.help();
2756
+ yargs8.help();
2410
2757
  }
2411
2758
  };
2412
2759
 
2413
2760
  // src/commands/context/commands/manifest.ts
2414
- import yargs8 from "yargs";
2761
+ import yargs9 from "yargs";
2415
2762
 
2416
2763
  // src/commands/context/commands/manifest/get.ts
2417
2764
  import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
@@ -2422,20 +2769,22 @@ var ManifestGetModule = {
2422
2769
  command: "get [output]",
2423
2770
  aliases: ["dl", "download"],
2424
2771
  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
- })
2772
+ builder: (yargs23) => withConfiguration(
2773
+ withApiOptions(
2774
+ withProjectOptions(
2775
+ yargs23.option("preview", {
2776
+ describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
2777
+ default: false,
2778
+ type: "boolean",
2779
+ alias: ["d"]
2780
+ }).option("output", {
2781
+ string: true,
2782
+ alias: "o",
2783
+ default: process.env.UNIFORM_MANIFEST_PATH,
2784
+ describe: "Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set.",
2785
+ demandOption: true
2786
+ })
2787
+ )
2439
2788
  )
2440
2789
  ),
2441
2790
  handler: async ({ apiKey, apiHost, proxy, output, project, preview }) => {
@@ -2485,7 +2834,7 @@ import { exit as exit2 } from "process";
2485
2834
  var ManifestPublishModule = {
2486
2835
  command: "publish",
2487
2836
  describe: "Publish the Uniform Context manifest for a project",
2488
- builder: (yargs21) => withApiOptions(withProjectOptions(yargs21)),
2837
+ builder: (yargs23) => withConfiguration(withApiOptions(withProjectOptions(yargs23))),
2489
2838
  handler: async ({ apiKey, apiHost, proxy, project }) => {
2490
2839
  const fetch3 = nodeFetchProxy(proxy);
2491
2840
  try {
@@ -2518,24 +2867,26 @@ var ManifestModule = {
2518
2867
  command: "manifest <command>",
2519
2868
  describe: "Commands for context manifests",
2520
2869
  aliases: ["man"],
2521
- builder: (yargs21) => yargs21.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
2870
+ builder: (yargs23) => yargs23.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
2522
2871
  handler: () => {
2523
- yargs8.help();
2872
+ yargs9.help();
2524
2873
  }
2525
2874
  };
2526
2875
 
2527
2876
  // src/commands/context/commands/quirk.ts
2528
- import yargs9 from "yargs";
2877
+ import yargs10 from "yargs";
2529
2878
 
2530
2879
  // src/commands/context/commands/quirk/get.ts
2531
2880
  import { UncachedQuirkClient } from "@uniformdev/context/api";
2532
2881
  var QuirkGetModule = {
2533
2882
  command: "get <id>",
2534
2883
  describe: "Fetch a quirk",
2535
- builder: (yargs21) => withFormatOptions(
2536
- withApiOptions(
2537
- withProjectOptions(
2538
- yargs21.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
2884
+ builder: (yargs23) => withConfiguration(
2885
+ withFormatOptions(
2886
+ withApiOptions(
2887
+ withProjectOptions(
2888
+ yargs23.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
2889
+ )
2539
2890
  )
2540
2891
  )
2541
2892
  ),
@@ -2558,14 +2909,16 @@ var QuirkListModule = {
2558
2909
  command: "list",
2559
2910
  describe: "List quirks",
2560
2911
  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
- })
2912
+ builder: (yargs23) => withConfiguration(
2913
+ withFormatOptions(
2914
+ withApiOptions(
2915
+ withProjectOptions(
2916
+ yargs23.option("withIntegrations", {
2917
+ alias: ["i"],
2918
+ describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
2919
+ type: "boolean"
2920
+ })
2921
+ )
2569
2922
  )
2570
2923
  )
2571
2924
  ),
@@ -2617,30 +2970,32 @@ function createQuirkEngineDataSource({
2617
2970
  var QuirkPullModule = {
2618
2971
  command: "pull <directory>",
2619
2972
  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
- })
2973
+ builder: (yargs23) => withConfiguration(
2974
+ withApiOptions(
2975
+ withProjectOptions(
2976
+ withDiffOptions(
2977
+ yargs23.positional("directory", {
2978
+ 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.",
2979
+ type: "string"
2980
+ }).option("format", {
2981
+ alias: ["f"],
2982
+ describe: "Output format",
2983
+ default: "yaml",
2984
+ choices: ["yaml", "json"],
2985
+ type: "string"
2986
+ }).option("what-if", {
2987
+ alias: ["w"],
2988
+ describe: "What-if mode reports what would be done but changes no files",
2989
+ default: false,
2990
+ type: "boolean"
2991
+ }).option("mode", {
2992
+ alias: ["m"],
2993
+ 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',
2994
+ choices: ["create", "createOrUpdate", "mirror"],
2995
+ default: "mirror",
2996
+ type: "string"
2997
+ })
2998
+ )
2644
2999
  )
2645
3000
  )
2646
3001
  ),
@@ -2694,24 +3049,26 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
2694
3049
  var QuirkPushModule = {
2695
3050
  command: "push <directory>",
2696
3051
  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
- })
3052
+ builder: (yargs23) => withConfiguration(
3053
+ withApiOptions(
3054
+ withProjectOptions(
3055
+ withDiffOptions(
3056
+ yargs23.positional("directory", {
3057
+ describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
3058
+ type: "string"
3059
+ }).option("what-if", {
3060
+ alias: ["w"],
3061
+ describe: "What-if mode reports what would be done but changes nothing",
3062
+ default: false,
3063
+ type: "boolean"
3064
+ }).option("mode", {
3065
+ alias: ["m"],
3066
+ 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',
3067
+ choices: ["create", "createOrUpdate", "mirror"],
3068
+ default: "mirror",
3069
+ type: "string"
3070
+ })
3071
+ )
2715
3072
  )
2716
3073
  )
2717
3074
  ),
@@ -2760,9 +3117,11 @@ var QuirkRemoveModule = {
2760
3117
  command: "remove <id>",
2761
3118
  aliases: ["delete", "rm"],
2762
3119
  describe: "Delete a quirk",
2763
- builder: (yargs21) => withApiOptions(
2764
- withProjectOptions(
2765
- yargs21.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
3120
+ builder: (yargs23) => withConfiguration(
3121
+ withApiOptions(
3122
+ withProjectOptions(
3123
+ yargs23.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
3124
+ )
2766
3125
  )
2767
3126
  ),
2768
3127
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -2778,8 +3137,12 @@ var QuirkUpdateModule = {
2778
3137
  command: "update <filename>",
2779
3138
  aliases: ["put"],
2780
3139
  describe: "Insert or update a quirk",
2781
- builder: (yargs21) => withApiOptions(
2782
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Quirk file to put" }))
3140
+ builder: (yargs23) => withConfiguration(
3141
+ withApiOptions(
3142
+ withProjectOptions(
3143
+ yargs23.positional("filename", { demandOption: true, describe: "Quirk file to put" })
3144
+ )
3145
+ )
2783
3146
  ),
2784
3147
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
2785
3148
  const fetch3 = nodeFetchProxy(proxy);
@@ -2794,24 +3157,26 @@ var QuirkModule = {
2794
3157
  command: "quirk <command>",
2795
3158
  aliases: ["qk"],
2796
3159
  describe: "Commands for Context quirks",
2797
- builder: (yargs21) => yargs21.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
3160
+ builder: (yargs23) => yargs23.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
2798
3161
  handler: () => {
2799
- yargs9.help();
3162
+ yargs10.help();
2800
3163
  }
2801
3164
  };
2802
3165
 
2803
3166
  // src/commands/context/commands/signal.ts
2804
- import yargs10 from "yargs";
3167
+ import yargs11 from "yargs";
2805
3168
 
2806
3169
  // src/commands/context/commands/signal/get.ts
2807
3170
  import { UncachedSignalClient } from "@uniformdev/context/api";
2808
3171
  var SignalGetModule = {
2809
3172
  command: "get <id>",
2810
3173
  describe: "Fetch a signal",
2811
- builder: (yargs21) => withFormatOptions(
2812
- withApiOptions(
2813
- withProjectOptions(
2814
- yargs21.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
3174
+ builder: (yargs23) => withConfiguration(
3175
+ withFormatOptions(
3176
+ withApiOptions(
3177
+ withProjectOptions(
3178
+ yargs23.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
3179
+ )
2815
3180
  )
2816
3181
  )
2817
3182
  ),
@@ -2834,7 +3199,7 @@ var SignalListModule = {
2834
3199
  command: "list",
2835
3200
  describe: "List signals",
2836
3201
  aliases: ["ls"],
2837
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
3202
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
2838
3203
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
2839
3204
  const fetch3 = nodeFetchProxy(proxy);
2840
3205
  const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -2883,30 +3248,32 @@ function createSignalEngineDataSource({
2883
3248
  var SignalPullModule = {
2884
3249
  command: "pull <directory>",
2885
3250
  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
- })
3251
+ builder: (yargs23) => withConfiguration(
3252
+ withApiOptions(
3253
+ withProjectOptions(
3254
+ withDiffOptions(
3255
+ yargs23.positional("directory", {
3256
+ 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.",
3257
+ type: "string"
3258
+ }).option("format", {
3259
+ alias: ["f"],
3260
+ describe: "Output format",
3261
+ default: "yaml",
3262
+ choices: ["yaml", "json"],
3263
+ type: "string"
3264
+ }).option("what-if", {
3265
+ alias: ["w"],
3266
+ describe: "What-if mode reports what would be done but changes no files",
3267
+ default: false,
3268
+ type: "boolean"
3269
+ }).option("mode", {
3270
+ alias: ["m"],
3271
+ 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',
3272
+ choices: ["create", "createOrUpdate", "mirror"],
3273
+ default: "mirror",
3274
+ type: "string"
3275
+ })
3276
+ )
2910
3277
  )
2911
3278
  )
2912
3279
  ),
@@ -2960,24 +3327,26 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
2960
3327
  var SignalPushModule = {
2961
3328
  command: "push <directory>",
2962
3329
  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
- })
3330
+ builder: (yargs23) => withConfiguration(
3331
+ withApiOptions(
3332
+ withProjectOptions(
3333
+ withDiffOptions(
3334
+ yargs23.positional("directory", {
3335
+ describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
3336
+ type: "string"
3337
+ }).option("what-if", {
3338
+ alias: ["w"],
3339
+ describe: "What-if mode reports what would be done but changes nothing",
3340
+ default: false,
3341
+ type: "boolean"
3342
+ }).option("mode", {
3343
+ alias: ["m"],
3344
+ 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',
3345
+ choices: ["create", "createOrUpdate", "mirror"],
3346
+ default: "mirror",
3347
+ type: "string"
3348
+ })
3349
+ )
2981
3350
  )
2982
3351
  )
2983
3352
  ),
@@ -3026,9 +3395,11 @@ var SignalRemoveModule = {
3026
3395
  command: "remove <id>",
3027
3396
  aliases: ["delete", "rm"],
3028
3397
  describe: "Delete a signal",
3029
- builder: (yargs21) => withApiOptions(
3030
- withProjectOptions(
3031
- yargs21.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
3398
+ builder: (yargs23) => withConfiguration(
3399
+ withApiOptions(
3400
+ withProjectOptions(
3401
+ yargs23.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
3402
+ )
3032
3403
  )
3033
3404
  ),
3034
3405
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
@@ -3044,8 +3415,12 @@ var SignalUpdateModule = {
3044
3415
  command: "update <filename>",
3045
3416
  aliases: ["put"],
3046
3417
  describe: "Insert or update a signal",
3047
- builder: (yargs21) => withApiOptions(
3048
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Signal file to put" }))
3418
+ builder: (yargs23) => withConfiguration(
3419
+ withApiOptions(
3420
+ withProjectOptions(
3421
+ yargs23.positional("filename", { demandOption: true, describe: "Signal file to put" })
3422
+ )
3423
+ )
3049
3424
  ),
3050
3425
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
3051
3426
  const fetch3 = nodeFetchProxy(proxy);
@@ -3060,24 +3435,26 @@ var SignalModule = {
3060
3435
  command: "signal <command>",
3061
3436
  aliases: ["sig"],
3062
3437
  describe: "Commands for Context signals",
3063
- builder: (yargs21) => yargs21.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
3438
+ builder: (yargs23) => yargs23.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
3064
3439
  handler: () => {
3065
- yargs10.help();
3440
+ yargs11.help();
3066
3441
  }
3067
3442
  };
3068
3443
 
3069
3444
  // src/commands/context/commands/test.ts
3070
- import yargs11 from "yargs";
3445
+ import yargs12 from "yargs";
3071
3446
 
3072
3447
  // src/commands/context/commands/test/get.ts
3073
3448
  import { UncachedTestClient } from "@uniformdev/context/api";
3074
3449
  var TestGetModule = {
3075
3450
  command: "get <id>",
3076
3451
  describe: "Fetch a test",
3077
- builder: (yargs21) => withFormatOptions(
3078
- withApiOptions(
3079
- withProjectOptions(
3080
- yargs21.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
3452
+ builder: (yargs23) => withConfiguration(
3453
+ withFormatOptions(
3454
+ withApiOptions(
3455
+ withProjectOptions(
3456
+ yargs23.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
3457
+ )
3081
3458
  )
3082
3459
  )
3083
3460
  ),
@@ -3100,7 +3477,7 @@ var TestListModule = {
3100
3477
  command: "list",
3101
3478
  describe: "List tests",
3102
3479
  aliases: ["ls"],
3103
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
3480
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
3104
3481
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
3105
3482
  const fetch3 = nodeFetchProxy(proxy);
3106
3483
  const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -3149,30 +3526,32 @@ function createTestEngineDataSource({
3149
3526
  var TestPullModule = {
3150
3527
  command: "pull <directory>",
3151
3528
  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
- })
3529
+ builder: (yargs23) => withConfiguration(
3530
+ withApiOptions(
3531
+ withProjectOptions(
3532
+ withDiffOptions(
3533
+ yargs23.positional("directory", {
3534
+ 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.",
3535
+ type: "string"
3536
+ }).option("format", {
3537
+ alias: ["f"],
3538
+ describe: "Output format",
3539
+ default: "yaml",
3540
+ choices: ["yaml", "json"],
3541
+ type: "string"
3542
+ }).option("what-if", {
3543
+ alias: ["w"],
3544
+ describe: "What-if mode reports what would be done but changes no files",
3545
+ default: false,
3546
+ type: "boolean"
3547
+ }).option("mode", {
3548
+ alias: ["m"],
3549
+ 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',
3550
+ choices: ["create", "createOrUpdate", "mirror"],
3551
+ default: "mirror",
3552
+ type: "string"
3553
+ })
3554
+ )
3176
3555
  )
3177
3556
  )
3178
3557
  ),
@@ -3226,24 +3605,26 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
3226
3605
  var TestPushModule = {
3227
3606
  command: "push <directory>",
3228
3607
  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
- })
3608
+ builder: (yargs23) => withConfiguration(
3609
+ withApiOptions(
3610
+ withProjectOptions(
3611
+ withDiffOptions(
3612
+ yargs23.positional("directory", {
3613
+ describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
3614
+ type: "string"
3615
+ }).option("what-if", {
3616
+ alias: ["w"],
3617
+ describe: "What-if mode reports what would be done but changes nothing",
3618
+ default: false,
3619
+ type: "boolean"
3620
+ }).option("mode", {
3621
+ alias: ["m"],
3622
+ 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',
3623
+ choices: ["create", "createOrUpdate", "mirror"],
3624
+ default: "mirror",
3625
+ type: "string"
3626
+ })
3627
+ )
3247
3628
  )
3248
3629
  )
3249
3630
  ),
@@ -3292,8 +3673,12 @@ var TestRemoveModule = {
3292
3673
  command: "remove <id>",
3293
3674
  aliases: ["delete", "rm"],
3294
3675
  describe: "Delete a test",
3295
- builder: (yargs21) => withApiOptions(
3296
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Test public ID to delete" }))
3676
+ builder: (yargs23) => withConfiguration(
3677
+ withApiOptions(
3678
+ withProjectOptions(
3679
+ yargs23.positional("id", { demandOption: true, describe: "Test public ID to delete" })
3680
+ )
3681
+ )
3297
3682
  ),
3298
3683
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
3299
3684
  const fetch3 = nodeFetchProxy(proxy);
@@ -3308,8 +3693,10 @@ var TestUpdateModule = {
3308
3693
  command: "update <filename>",
3309
3694
  aliases: ["put"],
3310
3695
  describe: "Insert or update a test",
3311
- builder: (yargs21) => withApiOptions(
3312
- withProjectOptions(yargs21.positional("filename", { demandOption: true, describe: "Test file to put" }))
3696
+ builder: (yargs23) => withConfiguration(
3697
+ withApiOptions(
3698
+ withProjectOptions(yargs23.positional("filename", { demandOption: true, describe: "Test file to put" }))
3699
+ )
3313
3700
  ),
3314
3701
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
3315
3702
  const fetch3 = nodeFetchProxy(proxy);
@@ -3323,9 +3710,9 @@ var TestUpdateModule = {
3323
3710
  var TestModule = {
3324
3711
  command: "test <command>",
3325
3712
  describe: "Commands for Context A/B tests",
3326
- builder: (yargs21) => yargs21.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
3713
+ builder: (yargs23) => yargs23.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
3327
3714
  handler: () => {
3328
- yargs11.help();
3715
+ yargs12.help();
3329
3716
  }
3330
3717
  };
3331
3718
 
@@ -3334,9 +3721,9 @@ var ContextCommand = {
3334
3721
  command: "context <command>",
3335
3722
  aliases: ["ctx"],
3336
3723
  describe: "Uniform Context commands",
3337
- builder: (yargs21) => yargs21.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
3724
+ builder: (yargs23) => yargs23.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
3338
3725
  handler: () => {
3339
- yargs12.showHelp();
3726
+ yargs13.showHelp();
3340
3727
  }
3341
3728
  };
3342
3729
 
@@ -3368,7 +3755,7 @@ var package_default = {
3368
3755
  description: "Uniform command line interface tool",
3369
3756
  license: "SEE LICENSE IN LICENSE.txt",
3370
3757
  main: "./cli.js",
3371
- types: "./dist/index.d.ts",
3758
+ types: "./dist/index.d.mts",
3372
3759
  sideEffects: false,
3373
3760
  scripts: {
3374
3761
  uniform: "node ./cli.js",
@@ -3385,7 +3772,8 @@ var package_default = {
3385
3772
  "@uniformdev/project-map": "workspace:*",
3386
3773
  "@uniformdev/redirect": "workspace:*",
3387
3774
  colorette: "2.0.20",
3388
- cosmiconfig: "^8.2.0",
3775
+ cosmiconfig: "8.2.0",
3776
+ "cosmiconfig-typescript-loader": "5.0.0",
3389
3777
  diff: "^5.0.0",
3390
3778
  dotenv: "^16.0.3",
3391
3779
  execa: "5.1.1",
@@ -4317,31 +4705,33 @@ function validateIntegrationName(integrationName, explicitOutputPath) {
4317
4705
  }
4318
4706
 
4319
4707
  // src/commands/new/index.ts
4320
- var stableApiHost = "https://uniform.app";
4321
- var apiHostDefault = process.env.UNIFORM_CLI_BASE_URL || stableApiHost;
4322
- var disableTelemetryDefault = !["", "0", "false", "no"].includes(
4323
- process.env.UNIFORM_CLI_DISABLE_TELEMETRY || ""
4324
- );
4325
- var NewCmd = {
4326
- 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
- }),
4708
+ var stableApiHost = "https://uniform.app";
4709
+ var apiHostDefault = process.env.UNIFORM_CLI_BASE_URL || stableApiHost;
4710
+ var disableTelemetryDefault = !["", "0", "false", "no"].includes(
4711
+ process.env.UNIFORM_CLI_DISABLE_TELEMETRY || ""
4712
+ );
4713
+ var NewCmd = {
4714
+ command: "new [name]",
4715
+ builder: (y) => withConfiguration(
4716
+ y.positional("name", {
4717
+ describe: "Name of a project",
4718
+ type: "string"
4719
+ }).option("apiHost", {
4720
+ describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4721
+ default: apiHostDefault,
4722
+ demandOption: true,
4723
+ type: "string"
4724
+ }).option("outputPath", {
4725
+ alias: "o",
4726
+ description: "Specify where to store integration files. Defaults to cwd.",
4727
+ type: "string"
4728
+ }).option("disableTelemetry", {
4729
+ describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4730
+ default: disableTelemetryDefault,
4731
+ demandOption: true,
4732
+ type: "boolean"
4733
+ })
4734
+ ),
4345
4735
  describe: "Start a new Uniform project",
4346
4736
  handler: async function({ name, apiHost, outputPath, disableTelemetry }) {
4347
4737
  const { stopAllSpinners, spin } = makeSpinner();
@@ -4362,21 +4752,23 @@ var NewCmd = {
4362
4752
  };
4363
4753
  var NewMeshCmd = {
4364
4754
  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
- }),
4755
+ builder: (y) => withConfiguration(
4756
+ y.option("apiHost", {
4757
+ describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or ${stableApiHost}. Supports dotenv.`,
4758
+ default: apiHostDefault,
4759
+ demandOption: true,
4760
+ type: "string"
4761
+ }).option("outputPath", {
4762
+ alias: "o",
4763
+ description: "Specify where to store integration files. Defaults to cwd.",
4764
+ type: "string"
4765
+ }).option("disableTelemetry", {
4766
+ describe: "By default, usage information is sent to Uniform. Use this option or set UNIFORM_CLI_DISABLE_TELEMETRY to disable telemetry.",
4767
+ default: disableTelemetryDefault,
4768
+ demandOption: true,
4769
+ type: "boolean"
4770
+ })
4771
+ ),
4380
4772
  describe: "Start a new Uniform project",
4381
4773
  handler: async function({ apiHost, outputPath, disableTelemetry }) {
4382
4774
  const { stopAllSpinners, spin } = makeSpinner();
@@ -4397,10 +4789,10 @@ var NewMeshCmd = {
4397
4789
  };
4398
4790
 
4399
4791
  // src/commands/optimize/index.ts
4400
- import yargs14 from "yargs";
4792
+ import yargs15 from "yargs";
4401
4793
 
4402
4794
  // src/commands/optimize/manifest.ts
4403
- import yargs13 from "yargs";
4795
+ import yargs14 from "yargs";
4404
4796
 
4405
4797
  // src/commands/optimize/manifest/download.ts
4406
4798
  import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
@@ -4415,7 +4807,7 @@ var UniformBaseUrl = "https://uniform.app";
4415
4807
  var module = {
4416
4808
  command: "download [output]",
4417
4809
  describe: "Download intent manifest",
4418
- builder: (yargs21) => yargs21.option("apiKey", {
4810
+ builder: (yargs23) => yargs23.option("apiKey", {
4419
4811
  alias: "k",
4420
4812
  demandOption: true,
4421
4813
  string: true,
@@ -4516,10 +4908,10 @@ var module2 = {
4516
4908
  command: "manifest <command>",
4517
4909
  describe: "Intent manifest commands",
4518
4910
  builder: () => {
4519
- return yargs13.command(download_default);
4911
+ return yargs14.command(download_default);
4520
4912
  },
4521
4913
  handler: () => {
4522
- yargs13.showHelp();
4914
+ yargs14.showHelp();
4523
4915
  }
4524
4916
  };
4525
4917
  var manifest_default = module2;
@@ -4530,28 +4922,30 @@ var OptimizeCommand = {
4530
4922
  aliases: ["opt"],
4531
4923
  describe: "Uniform Optimize commands",
4532
4924
  builder: () => {
4533
- return yargs14.command(manifest_default);
4925
+ return yargs15.command(manifest_default);
4534
4926
  },
4535
4927
  handler: () => {
4536
- yargs14.showHelp();
4928
+ yargs15.showHelp();
4537
4929
  }
4538
4930
  };
4539
4931
 
4540
4932
  // src/commands/project-map/index.ts
4541
- import yargs17 from "yargs";
4933
+ import yargs18 from "yargs";
4542
4934
 
4543
4935
  // src/commands/project-map/commands/projectMapDefinition.ts
4544
- import yargs15 from "yargs";
4936
+ import yargs16 from "yargs";
4545
4937
 
4546
4938
  // src/commands/project-map/commands/ProjectMapDefinition/get.ts
4547
4939
  import { UncachedProjectMapClient } from "@uniformdev/project-map";
4548
4940
  var ProjectMapDefinitionGetModule = {
4549
4941
  command: "get <id>",
4550
4942
  describe: "Fetch a project map",
4551
- builder: (yargs21) => withFormatOptions(
4552
- withApiOptions(
4553
- withProjectOptions(
4554
- yargs21.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
4943
+ builder: (yargs23) => withFormatOptions(
4944
+ withConfiguration(
4945
+ withApiOptions(
4946
+ withProjectOptions(
4947
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
4948
+ )
4555
4949
  )
4556
4950
  )
4557
4951
  ),
@@ -4574,7 +4968,7 @@ var ProjectMapDefinitionListModule = {
4574
4968
  command: "list",
4575
4969
  describe: "List of project maps",
4576
4970
  aliases: ["ls"],
4577
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
4971
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
4578
4972
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
4579
4973
  const fetch3 = nodeFetchProxy(proxy);
4580
4974
  const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -4631,30 +5025,32 @@ function createProjectMapDefinitionEngineDataSource({
4631
5025
  var ProjectMapDefinitionPullModule = {
4632
5026
  command: "pull <directory>",
4633
5027
  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
- })
5028
+ builder: (yargs23) => withConfiguration(
5029
+ withApiOptions(
5030
+ withProjectOptions(
5031
+ withDiffOptions(
5032
+ yargs23.positional("directory", {
5033
+ 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.",
5034
+ type: "string"
5035
+ }).option("format", {
5036
+ alias: ["f"],
5037
+ describe: "Output format",
5038
+ default: "yaml",
5039
+ choices: ["yaml", "json"],
5040
+ type: "string"
5041
+ }).option("what-if", {
5042
+ alias: ["w"],
5043
+ describe: "What-if mode reports what would be done but changes no files",
5044
+ default: false,
5045
+ type: "boolean"
5046
+ }).option("mode", {
5047
+ alias: ["m"],
5048
+ 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',
5049
+ choices: ["create", "createOrUpdate", "mirror"],
5050
+ default: "mirror",
5051
+ type: "string"
5052
+ })
5053
+ )
4658
5054
  )
4659
5055
  )
4660
5056
  ),
@@ -4708,24 +5104,26 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
4708
5104
  var ProjectMapDefinitionPushModule = {
4709
5105
  command: "push <directory>",
4710
5106
  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
- })
5107
+ builder: (yargs23) => withConfiguration(
5108
+ withApiOptions(
5109
+ withProjectOptions(
5110
+ withDiffOptions(
5111
+ yargs23.positional("directory", {
5112
+ describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5113
+ type: "string"
5114
+ }).option("what-if", {
5115
+ alias: ["w"],
5116
+ describe: "What-if mode reports what would be done but changes nothing",
5117
+ default: false,
5118
+ type: "boolean"
5119
+ }).option("mode", {
5120
+ alias: ["m"],
5121
+ 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',
5122
+ choices: ["create", "createOrUpdate", "mirror"],
5123
+ default: "mirror",
5124
+ type: "string"
5125
+ })
5126
+ )
4729
5127
  )
4730
5128
  )
4731
5129
  ),
@@ -4774,8 +5172,10 @@ var ProjectMapDefinitionRemoveModule = {
4774
5172
  command: "remove <id>",
4775
5173
  aliases: ["delete", "rm"],
4776
5174
  describe: "Delete a project map",
4777
- builder: (yargs21) => withApiOptions(
4778
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: " UUID to delete" }))
5175
+ builder: (yargs23) => withConfiguration(
5176
+ withApiOptions(
5177
+ withProjectOptions(yargs23.positional("id", { demandOption: true, describe: " UUID to delete" }))
5178
+ )
4779
5179
  ),
4780
5180
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
4781
5181
  const fetch3 = nodeFetchProxy(proxy);
@@ -4790,9 +5190,11 @@ var ProjectMapDefinitionUpdateModule = {
4790
5190
  command: "update <filename>",
4791
5191
  aliases: ["put"],
4792
5192
  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" })
5193
+ builder: (yargs23) => withConfiguration(
5194
+ withApiOptions(
5195
+ withProjectOptions(
5196
+ yargs23.positional("filename", { demandOption: true, describe: "Project map file to put" })
5197
+ )
4796
5198
  )
4797
5199
  ),
4798
5200
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -4807,24 +5209,26 @@ var ProjectMapDefinitionUpdateModule = {
4807
5209
  var ProjectMapDefinitionModule = {
4808
5210
  command: "definition <command>",
4809
5211
  describe: "Commands for ProjectMap Definitions",
4810
- builder: (yargs21) => yargs21.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
5212
+ builder: (yargs23) => yargs23.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
4811
5213
  handler: () => {
4812
- yargs15.help();
5214
+ yargs16.help();
4813
5215
  }
4814
5216
  };
4815
5217
 
4816
5218
  // src/commands/project-map/commands/projectMapNode.ts
4817
- import yargs16 from "yargs";
5219
+ import yargs17 from "yargs";
4818
5220
 
4819
5221
  // src/commands/project-map/commands/ProjectMapNode/get.ts
4820
5222
  import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
4821
5223
  var ProjectMapNodeGetModule = {
4822
5224
  command: "get <id> <projectMapId>",
4823
5225
  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" })
5226
+ builder: (yargs23) => withConfiguration(
5227
+ withFormatOptions(
5228
+ withApiOptions(
5229
+ withProjectOptions(
5230
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5231
+ )
4828
5232
  )
4829
5233
  )
4830
5234
  ),
@@ -4849,10 +5253,15 @@ var ProjectMapNodeListModule = {
4849
5253
  command: "list <projectMapId>",
4850
5254
  describe: "List project map nodes",
4851
5255
  aliases: ["ls"],
4852
- builder: (yargs21) => withFormatOptions(
4853
- withApiOptions(
4854
- withProjectOptions(
4855
- yargs21.positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
5256
+ builder: (yargs23) => withConfiguration(
5257
+ withFormatOptions(
5258
+ withApiOptions(
5259
+ withProjectOptions(
5260
+ yargs23.positional("projectMapId", {
5261
+ demandOption: true,
5262
+ describe: "ProjectMap UUID to fetch from"
5263
+ })
5264
+ )
4856
5265
  )
4857
5266
  )
4858
5267
  ),
@@ -4919,30 +5328,32 @@ function createProjectMapNodeEngineDataSource({
4919
5328
  var ProjectMapNodePullModule = {
4920
5329
  command: "pull <directory>",
4921
5330
  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
- })
5331
+ builder: (yargs23) => withConfiguration(
5332
+ withApiOptions(
5333
+ withProjectOptions(
5334
+ withDiffOptions(
5335
+ yargs23.positional("directory", {
5336
+ 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.",
5337
+ type: "string"
5338
+ }).option("format", {
5339
+ alias: ["f"],
5340
+ describe: "Output format",
5341
+ default: "yaml",
5342
+ choices: ["yaml", "json"],
5343
+ type: "string"
5344
+ }).option("what-if", {
5345
+ alias: ["w"],
5346
+ describe: "What-if mode reports what would be done but changes no files",
5347
+ default: false,
5348
+ type: "boolean"
5349
+ }).option("mode", {
5350
+ alias: ["m"],
5351
+ 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',
5352
+ choices: ["create", "createOrUpdate", "mirror"],
5353
+ default: "mirror",
5354
+ type: "string"
5355
+ })
5356
+ )
4946
5357
  )
4947
5358
  )
4948
5359
  ),
@@ -5000,24 +5411,26 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
5000
5411
  var ProjectMapNodePushModule = {
5001
5412
  command: "push <directory>",
5002
5413
  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
- })
5414
+ builder: (yargs23) => withConfiguration(
5415
+ withApiOptions(
5416
+ withProjectOptions(
5417
+ withDiffOptions(
5418
+ yargs23.positional("directory", {
5419
+ describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
5420
+ type: "string"
5421
+ }).option("what-if", {
5422
+ alias: ["w"],
5423
+ describe: "What-if mode reports what would be done but changes nothing",
5424
+ default: false,
5425
+ type: "boolean"
5426
+ }).option("mode", {
5427
+ alias: ["m"],
5428
+ 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',
5429
+ choices: ["create", "createOrUpdate", "mirror"],
5430
+ default: "mirror",
5431
+ type: "string"
5432
+ })
5433
+ )
5021
5434
  )
5022
5435
  )
5023
5436
  ),
@@ -5075,9 +5488,11 @@ var ProjectMapNodeRemoveModule = {
5075
5488
  command: "remove <id> <projectMapId>",
5076
5489
  aliases: ["delete", "rm"],
5077
5490
  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" })
5491
+ builder: (yargs23) => withConfiguration(
5492
+ withApiOptions(
5493
+ withProjectOptions(
5494
+ yargs23.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
5495
+ )
5081
5496
  )
5082
5497
  ),
5083
5498
  handler: async ({ apiHost, apiKey, proxy, projectMapId, id, project: projectId }) => {
@@ -5093,9 +5508,11 @@ var ProjectMapNodeUpdateModule = {
5093
5508
  command: "update <filename> <projectMapId>",
5094
5509
  aliases: ["put"],
5095
5510
  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" })
5511
+ builder: (yargs23) => withConfiguration(
5512
+ withApiOptions(
5513
+ withProjectOptions(
5514
+ yargs23.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
5515
+ )
5099
5516
  )
5100
5517
  ),
5101
5518
  handler: async ({ apiHost, apiKey, proxy, projectMapId, filename, project: projectId }) => {
@@ -5110,9 +5527,9 @@ var ProjectMapNodeUpdateModule = {
5110
5527
  var ProjectMapNodeModule = {
5111
5528
  command: "node <command>",
5112
5529
  describe: "Commands for ProjectMap Nodes",
5113
- builder: (yargs21) => yargs21.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
5530
+ builder: (yargs23) => yargs23.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
5114
5531
  handler: () => {
5115
- yargs16.help();
5532
+ yargs17.help();
5116
5533
  }
5117
5534
  };
5118
5535
 
@@ -5121,26 +5538,30 @@ var ProjectMapCommand = {
5121
5538
  command: "project-map <command>",
5122
5539
  aliases: ["prm"],
5123
5540
  describe: "Uniform ProjectMap commands",
5124
- builder: (yargs21) => yargs21.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
5541
+ builder: (yargs23) => yargs23.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
5125
5542
  handler: () => {
5126
- yargs17.showHelp();
5543
+ yargs18.showHelp();
5127
5544
  }
5128
5545
  };
5129
5546
 
5130
5547
  // src/commands/redirect/index.ts
5131
- import yargs19 from "yargs";
5548
+ import yargs20 from "yargs";
5132
5549
 
5133
5550
  // src/commands/redirect/commands/redirect.ts
5134
- import yargs18 from "yargs";
5551
+ import yargs19 from "yargs";
5135
5552
 
5136
5553
  // src/commands/redirect/commands/RedirectDefinition/get.ts
5137
5554
  import { UncachedRedirectClient } from "@uniformdev/redirect";
5138
5555
  var RedirectDefinitionGetModule = {
5139
5556
  command: "get <id>",
5140
5557
  describe: "Fetch a redirect",
5141
- builder: (yargs21) => withFormatOptions(
5142
- withApiOptions(
5143
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" }))
5558
+ builder: (yargs23) => withConfiguration(
5559
+ withFormatOptions(
5560
+ withApiOptions(
5561
+ withProjectOptions(
5562
+ yargs23.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
5563
+ )
5564
+ )
5144
5565
  )
5145
5566
  ),
5146
5567
  handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
@@ -5162,7 +5583,7 @@ var RedirectDefinitionListModule = {
5162
5583
  command: "list",
5163
5584
  describe: "List of redirects",
5164
5585
  aliases: ["ls"],
5165
- builder: (yargs21) => withFormatOptions(withApiOptions(withProjectOptions(yargs21))),
5586
+ builder: (yargs23) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs23)))),
5166
5587
  handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
5167
5588
  const fetch3 = nodeFetchProxy(proxy);
5168
5589
  const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
@@ -5228,30 +5649,32 @@ function createRedirectDefinitionEngineDataSource({
5228
5649
  var RedirectDefinitionPullModule = {
5229
5650
  command: "pull <directory>",
5230
5651
  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
- })
5652
+ builder: (yargs23) => withConfiguration(
5653
+ withApiOptions(
5654
+ withProjectOptions(
5655
+ withDiffOptions(
5656
+ yargs23.positional("directory", {
5657
+ 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.",
5658
+ type: "string"
5659
+ }).option("format", {
5660
+ alias: ["f"],
5661
+ describe: "Output format",
5662
+ default: "yaml",
5663
+ choices: ["yaml", "json"],
5664
+ type: "string"
5665
+ }).option("what-if", {
5666
+ alias: ["w"],
5667
+ describe: "What-if mode reports what would be done but changes no files",
5668
+ default: false,
5669
+ type: "boolean"
5670
+ }).option("mode", {
5671
+ alias: ["m"],
5672
+ 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',
5673
+ choices: ["create", "createOrUpdate", "mirror"],
5674
+ default: "mirror",
5675
+ type: "string"
5676
+ })
5677
+ )
5255
5678
  )
5256
5679
  )
5257
5680
  ),
@@ -5306,24 +5729,26 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
5306
5729
  var RedirectDefinitionPushModule = {
5307
5730
  command: "push <directory>",
5308
5731
  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
- })
5732
+ builder: (yargs23) => withConfiguration(
5733
+ withApiOptions(
5734
+ withProjectOptions(
5735
+ withDiffOptions(
5736
+ yargs23.positional("directory", {
5737
+ describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
5738
+ type: "string"
5739
+ }).option("what-if", {
5740
+ alias: ["w"],
5741
+ describe: "What-if mode reports what would be done but changes nothing",
5742
+ default: false,
5743
+ type: "boolean"
5744
+ }).option("mode", {
5745
+ alias: ["m"],
5746
+ 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',
5747
+ choices: ["create", "createOrUpdate", "mirror"],
5748
+ default: "mirror",
5749
+ type: "string"
5750
+ })
5751
+ )
5327
5752
  )
5328
5753
  )
5329
5754
  ),
@@ -5372,8 +5797,10 @@ var RedirectDefinitionRemoveModule = {
5372
5797
  command: "remove <id>",
5373
5798
  aliases: ["delete", "rm"],
5374
5799
  describe: "Delete a redirect",
5375
- builder: (yargs21) => withApiOptions(
5376
- withProjectOptions(yargs21.positional("id", { demandOption: true, describe: " UUID to delete" }))
5800
+ builder: (yargs23) => withConfiguration(
5801
+ withApiOptions(
5802
+ withProjectOptions(yargs23.positional("id", { demandOption: true, describe: " UUID to delete" }))
5803
+ )
5377
5804
  ),
5378
5805
  handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
5379
5806
  const fetch3 = nodeFetchProxy(proxy);
@@ -5388,9 +5815,11 @@ var RedirectDefinitionUpdateModule = {
5388
5815
  command: "update <filename>",
5389
5816
  aliases: ["put"],
5390
5817
  describe: "Insert or update a redirect",
5391
- builder: (yargs21) => withApiOptions(
5392
- withProjectOptions(
5393
- yargs21.positional("filename", { demandOption: true, describe: "Redirect file to put" })
5818
+ builder: (yargs23) => withConfiguration(
5819
+ withApiOptions(
5820
+ withProjectOptions(
5821
+ yargs23.positional("filename", { demandOption: true, describe: "Redirect file to put" })
5822
+ )
5394
5823
  )
5395
5824
  ),
5396
5825
  handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
@@ -5405,9 +5834,9 @@ var RedirectDefinitionUpdateModule = {
5405
5834
  var RedirectDefinitionModule = {
5406
5835
  command: "definition <command>",
5407
5836
  describe: "Commands for Redirect Definitions",
5408
- builder: (yargs21) => yargs21.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
5837
+ builder: (yargs23) => yargs23.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
5409
5838
  handler: () => {
5410
- yargs18.help();
5839
+ yargs19.help();
5411
5840
  }
5412
5841
  };
5413
5842
 
@@ -5416,9 +5845,179 @@ var RedirectCommand = {
5416
5845
  command: "redirect <command>",
5417
5846
  aliases: ["red"],
5418
5847
  describe: "Uniform Redirect commands",
5419
- builder: (yargs21) => yargs21.command(RedirectDefinitionModule).demandCommand(),
5848
+ builder: (yargs23) => yargs23.command(RedirectDefinitionModule).demandCommand(),
5849
+ handler: () => {
5850
+ yargs20.showHelp();
5851
+ }
5852
+ };
5853
+
5854
+ // src/commands/sync/index.ts
5855
+ import yargs21 from "yargs";
5856
+
5857
+ // src/commands/sync/commands/pull.ts
5858
+ var SyncPullModule = {
5859
+ command: "pull",
5860
+ describe: "Pulls whole project to local files in a directory",
5861
+ builder: (yargs23) => withConfiguration(
5862
+ withApiOptions(
5863
+ withProjectOptions(
5864
+ withDiffOptions(
5865
+ yargs23.option("what-if", {
5866
+ alias: ["w"],
5867
+ describe: "What-if mode reports what would be done but changes no files",
5868
+ default: false,
5869
+ type: "boolean"
5870
+ })
5871
+ )
5872
+ )
5873
+ )
5874
+ ),
5875
+ handler: async ({ serialization, ...otherParams }) => {
5876
+ const config2 = serialization;
5877
+ const enabledEntities = Object.entries({
5878
+ category: CategoryPullModule,
5879
+ dataType: DataTypePullModule,
5880
+ quirk: QuirkPullModule,
5881
+ test: TestPullModule,
5882
+ signal: SignalPullModule,
5883
+ enrichment: EnrichmentPullModule,
5884
+ aggregate: AggregatePullModule,
5885
+ component: ComponentPullModule,
5886
+ pattern: PatternPullModule,
5887
+ composition: CompositionPullModule,
5888
+ projectMapDefinition: ProjectMapDefinitionPullModule,
5889
+ projectMapNode: ProjectMapNodePullModule,
5890
+ redirect: RedirectDefinitionPullModule
5891
+ }).filter(([entityType]) => {
5892
+ var _a, _b, _c, _d, _e, _f;
5893
+ 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;
5894
+ });
5895
+ for (const [entityType, module3] of enabledEntities) {
5896
+ await module3.handler({
5897
+ ...otherParams,
5898
+ state: 0,
5899
+ format: getFormat(entityType, config2),
5900
+ onlyCompositions: entityType === "composition" ? true : void 0,
5901
+ onlyPatterns: entityType === "pattern" ? true : void 0,
5902
+ mode: getPullMode(entityType, config2),
5903
+ directory: getPullFilename(entityType, config2)
5904
+ });
5905
+ }
5906
+ }
5907
+ };
5908
+ var getPullMode = (entityType, config2) => {
5909
+ return getEntityOption({
5910
+ optionName: "mode",
5911
+ operation: "pull",
5912
+ config: config2,
5913
+ entityType
5914
+ });
5915
+ };
5916
+ var getPullFilename = (entityType, config2) => {
5917
+ return getDirectoryOrFilename({
5918
+ operation: "pull",
5919
+ config: config2,
5920
+ entityType
5921
+ });
5922
+ };
5923
+ var getFormat = (entityType, config2) => {
5924
+ return getEntityOption({
5925
+ optionName: "format",
5926
+ operation: "pull",
5927
+ config: config2,
5928
+ entityType
5929
+ });
5930
+ };
5931
+
5932
+ // src/commands/sync/commands/push.ts
5933
+ var SyncPushModule = {
5934
+ command: "push",
5935
+ describe: "Pushes whole project data from files in a directory or package to Uniform",
5936
+ builder: (yargs23) => withConfiguration(
5937
+ withApiOptions(
5938
+ withProjectOptions(
5939
+ withDiffOptions(
5940
+ yargs23.option("what-if", {
5941
+ alias: ["w"],
5942
+ describe: "What-if mode reports what would be done but changes nothing",
5943
+ default: false,
5944
+ type: "boolean"
5945
+ })
5946
+ )
5947
+ )
5948
+ )
5949
+ ),
5950
+ handler: async ({ serialization, ...otherParams }) => {
5951
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
5952
+ const config2 = serialization;
5953
+ const enabledEntities = Object.entries({
5954
+ category: CategoryPushModule,
5955
+ dataType: DataTypePushModule,
5956
+ quirk: QuirkPushModule,
5957
+ test: TestPushModule,
5958
+ signal: SignalPushModule,
5959
+ enrichment: EnrichmentPushModule,
5960
+ aggregate: AggregatePushModule,
5961
+ component: ComponentPushModule,
5962
+ pattern: PatternPushModule,
5963
+ composition: CompositionPushModule,
5964
+ projectMapDefinition: ProjectMapDefinitionPushModule,
5965
+ projectMapNode: ProjectMapNodePushModule,
5966
+ redirect: RedirectDefinitionPushModule
5967
+ }).filter(([entityType]) => {
5968
+ var _a2, _b2, _c2, _d2, _e2, _f2;
5969
+ 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;
5970
+ });
5971
+ for (const [entityType, module3] of enabledEntities) {
5972
+ await module3.handler({
5973
+ ...otherParams,
5974
+ state: 0,
5975
+ format: getFormat2(entityType, config2),
5976
+ onlyCompositions: entityType === "composition" ? true : void 0,
5977
+ onlyPatterns: entityType === "pattern" ? true : void 0,
5978
+ mode: getPushMode(entityType, config2),
5979
+ directory: getPushFilename(entityType, config2)
5980
+ });
5981
+ }
5982
+ 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)) {
5983
+ await PatternPublishModule.handler({ ...otherParams, all: true });
5984
+ }
5985
+ 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)) {
5986
+ await CompositionPublishModule.handler({ ...otherParams, all: true });
5987
+ }
5988
+ }
5989
+ };
5990
+ var getPushMode = (entityType, config2) => {
5991
+ return getEntityOption({
5992
+ optionName: "mode",
5993
+ operation: "push",
5994
+ config: config2,
5995
+ entityType
5996
+ });
5997
+ };
5998
+ var getPushFilename = (entityType, config2) => {
5999
+ return getDirectoryOrFilename({
6000
+ operation: "push",
6001
+ config: config2,
6002
+ entityType
6003
+ });
6004
+ };
6005
+ var getFormat2 = (entityType, config2) => {
6006
+ return getEntityOption({
6007
+ optionName: "format",
6008
+ operation: "push",
6009
+ config: config2,
6010
+ entityType
6011
+ });
6012
+ };
6013
+
6014
+ // src/commands/sync/index.ts
6015
+ var SyncCommand = {
6016
+ command: "sync <command>",
6017
+ describe: "Uniform Sync commands",
6018
+ builder: (yargs23) => yargs23.command(SyncPullModule).command(SyncPushModule).demandCommand(),
5420
6019
  handler: () => {
5421
- yargs19.showHelp();
6020
+ yargs21.showHelp();
5422
6021
  }
5423
6022
  };
5424
6023
 
@@ -5534,9 +6133,30 @@ First found was: v${firstVersion}`;
5534
6133
 
5535
6134
  // src/index.ts
5536
6135
  dotenv.config();
5537
- var yarggery = yargs20(hideBin(process.argv));
6136
+ var yarggery = yargs22(hideBin(process.argv));
6137
+ var moduleName = "uniform";
6138
+ var syncCosmicExplorer = cosmiconfigSync("uniform", {
6139
+ searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.ts`, `${moduleName}.config.json`],
6140
+ loaders: {
6141
+ ".ts": TypeScriptLoader()
6142
+ }
6143
+ });
6144
+ var searchedForm = syncCosmicExplorer.search();
6145
+ var cosmicConfig = applyDefaultSyncConfiguration((searchedForm == null ? void 0 : searchedForm.config) ?? {});
5538
6146
  yarggery.option("verbose", {
5539
6147
  describe: "Include verbose logging",
5540
6148
  default: false,
5541
6149
  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;
6150
+ }).scriptName("uniform").config(cosmicConfig).config("config", function(configPath) {
6151
+ if (!fs5.existsSync(configPath)) {
6152
+ throw new Error(`Invalid configuration file path: ${configPath}. File does not exist.`);
6153
+ }
6154
+ const config2 = syncCosmicExplorer.load(configPath);
6155
+ if (!(config2 == null ? void 0 : config2.config.serialization)) {
6156
+ throw new Error(
6157
+ `Invalid configuration file: ${configPath}. Missing config.serialization configuration.`
6158
+ );
6159
+ }
6160
+ const configuration = applyDefaultSyncConfiguration((config2 == null ? void 0 : config2.config) ?? {});
6161
+ return { serialization: configuration.serialization };
6162
+ }).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).argv;