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