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