@uniformdev/cli 19.45.1 → 19.45.2-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +784 -233
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import * as dotenv from "dotenv";
|
|
5
|
-
import
|
|
5
|
+
import yargs24 from "yargs";
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
7
7
|
|
|
8
8
|
// src/commands/canvas/index.ts
|
|
9
|
-
import
|
|
9
|
+
import yargs8 from "yargs";
|
|
10
10
|
|
|
11
11
|
// src/commands/canvas/commands/category.ts
|
|
12
12
|
import yargs from "yargs";
|
|
@@ -119,14 +119,14 @@ import httpsProxyAgent from "https-proxy-agent";
|
|
|
119
119
|
import unfetch from "isomorphic-unfetch";
|
|
120
120
|
import { dump, load } from "js-yaml";
|
|
121
121
|
import { extname } from "path";
|
|
122
|
-
function withConfiguration(
|
|
123
|
-
return
|
|
122
|
+
function withConfiguration(yargs25) {
|
|
123
|
+
return yargs25.option("serialization", {
|
|
124
124
|
skipValidation: true,
|
|
125
125
|
hidden: true
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
function withApiOptions(
|
|
129
|
-
return
|
|
128
|
+
function withApiOptions(yargs25) {
|
|
129
|
+
return yargs25.option("apiKey", {
|
|
130
130
|
describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
|
|
131
131
|
default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
132
132
|
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
@@ -165,8 +165,8 @@ function nodeFetchProxy(proxy) {
|
|
|
165
165
|
};
|
|
166
166
|
return wrappedFetch;
|
|
167
167
|
}
|
|
168
|
-
function withProjectOptions(
|
|
169
|
-
return
|
|
168
|
+
function withProjectOptions(yargs25) {
|
|
169
|
+
return yargs25.option("project", {
|
|
170
170
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
171
171
|
default: process.env.UNIFORM_CLI_PROJECT_ID ?? // deprecated
|
|
172
172
|
process.env.CANVAS_CLI_PROJECT_ID ?? // deprecated
|
|
@@ -176,8 +176,8 @@ function withProjectOptions(yargs23) {
|
|
|
176
176
|
alias: ["p"]
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
function withFormatOptions(
|
|
180
|
-
return
|
|
179
|
+
function withFormatOptions(yargs25) {
|
|
180
|
+
return yargs25.option("format", {
|
|
181
181
|
alias: ["f"],
|
|
182
182
|
describe: "Output format",
|
|
183
183
|
default: "yaml",
|
|
@@ -189,8 +189,8 @@ function withFormatOptions(yargs23) {
|
|
|
189
189
|
type: "string"
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
function withDiffOptions(
|
|
193
|
-
return
|
|
192
|
+
function withDiffOptions(yargs25) {
|
|
193
|
+
return yargs25.option("diff", {
|
|
194
194
|
describe: "Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",
|
|
195
195
|
default: process.env.UNIFORM_CLI_DIFF_MODE ?? "off",
|
|
196
196
|
type: "string",
|
|
@@ -579,11 +579,11 @@ function createSyncEngineConsoleLogger(options) {
|
|
|
579
579
|
var CategoryGetModule = {
|
|
580
580
|
command: "get <id>",
|
|
581
581
|
describe: "Fetch a category",
|
|
582
|
-
builder: (
|
|
582
|
+
builder: (yargs25) => withConfiguration(
|
|
583
583
|
withFormatOptions(
|
|
584
584
|
withApiOptions(
|
|
585
585
|
withProjectOptions(
|
|
586
|
-
|
|
586
|
+
yargs25.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
587
587
|
)
|
|
588
588
|
)
|
|
589
589
|
)
|
|
@@ -608,7 +608,7 @@ var CategoryListModule = {
|
|
|
608
608
|
command: "list",
|
|
609
609
|
describe: "List categories",
|
|
610
610
|
aliases: ["ls"],
|
|
611
|
-
builder: (
|
|
611
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25.options({}))))),
|
|
612
612
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
613
613
|
const fetch3 = nodeFetchProxy(proxy);
|
|
614
614
|
const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -665,11 +665,11 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
665
665
|
var CategoryPullModule = {
|
|
666
666
|
command: "pull <directory>",
|
|
667
667
|
describe: "Pulls all categories to local files in a directory",
|
|
668
|
-
builder: (
|
|
668
|
+
builder: (yargs25) => withConfiguration(
|
|
669
669
|
withApiOptions(
|
|
670
670
|
withProjectOptions(
|
|
671
671
|
withDiffOptions(
|
|
672
|
-
|
|
672
|
+
yargs25.positional("directory", {
|
|
673
673
|
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.",
|
|
674
674
|
type: "string"
|
|
675
675
|
}).option("format", {
|
|
@@ -744,11 +744,11 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
|
|
|
744
744
|
var CategoryPushModule = {
|
|
745
745
|
command: "push <directory>",
|
|
746
746
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
747
|
-
builder: (
|
|
747
|
+
builder: (yargs25) => withConfiguration(
|
|
748
748
|
withApiOptions(
|
|
749
749
|
withProjectOptions(
|
|
750
750
|
withDiffOptions(
|
|
751
|
-
|
|
751
|
+
yargs25.positional("directory", {
|
|
752
752
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
753
753
|
type: "string"
|
|
754
754
|
}).option("what-if", {
|
|
@@ -812,10 +812,10 @@ var CategoryRemoveModule = {
|
|
|
812
812
|
command: "remove <id>",
|
|
813
813
|
aliases: ["delete", "rm"],
|
|
814
814
|
describe: "Delete a category",
|
|
815
|
-
builder: (
|
|
815
|
+
builder: (yargs25) => withConfiguration(
|
|
816
816
|
withApiOptions(
|
|
817
817
|
withProjectOptions(
|
|
818
|
-
|
|
818
|
+
yargs25.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
819
819
|
)
|
|
820
820
|
)
|
|
821
821
|
),
|
|
@@ -832,10 +832,10 @@ var CategoryUpdateModule = {
|
|
|
832
832
|
command: "update <filename>",
|
|
833
833
|
aliases: ["put"],
|
|
834
834
|
describe: "Insert or update a category",
|
|
835
|
-
builder: (
|
|
835
|
+
builder: (yargs25) => withConfiguration(
|
|
836
836
|
withApiOptions(
|
|
837
837
|
withProjectOptions(
|
|
838
|
-
|
|
838
|
+
yargs25.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
839
839
|
)
|
|
840
840
|
)
|
|
841
841
|
),
|
|
@@ -852,7 +852,7 @@ var CategoryModule = {
|
|
|
852
852
|
command: "category <command>",
|
|
853
853
|
aliases: ["cat"],
|
|
854
854
|
describe: "Commands for Canvas categories",
|
|
855
|
-
builder: (
|
|
855
|
+
builder: (yargs25) => yargs25.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
856
856
|
handler: () => {
|
|
857
857
|
yargs.help();
|
|
858
858
|
}
|
|
@@ -873,11 +873,11 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
|
|
|
873
873
|
var ComponentGetModule = {
|
|
874
874
|
command: "get <id>",
|
|
875
875
|
describe: "Fetch a component definition",
|
|
876
|
-
builder: (
|
|
876
|
+
builder: (yargs25) => withConfiguration(
|
|
877
877
|
withFormatOptions(
|
|
878
878
|
withApiOptions(
|
|
879
879
|
withProjectOptions(
|
|
880
|
-
|
|
880
|
+
yargs25.positional("id", {
|
|
881
881
|
demandOption: true,
|
|
882
882
|
describe: "Component definition public ID to fetch"
|
|
883
883
|
})
|
|
@@ -911,11 +911,11 @@ var ComponentListModule = {
|
|
|
911
911
|
command: "list",
|
|
912
912
|
describe: "List component definitions",
|
|
913
913
|
aliases: ["ls"],
|
|
914
|
-
builder: (
|
|
914
|
+
builder: (yargs25) => withConfiguration(
|
|
915
915
|
withFormatOptions(
|
|
916
916
|
withApiOptions(
|
|
917
917
|
withProjectOptions(
|
|
918
|
-
|
|
918
|
+
yargs25.options({
|
|
919
919
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
920
920
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
921
921
|
})
|
|
@@ -970,11 +970,11 @@ function createComponentDefinitionEngineDataSource({
|
|
|
970
970
|
var ComponentPullModule = {
|
|
971
971
|
command: "pull <directory>",
|
|
972
972
|
describe: "Pulls all component definitions to local files in a directory",
|
|
973
|
-
builder: (
|
|
973
|
+
builder: (yargs25) => withConfiguration(
|
|
974
974
|
withApiOptions(
|
|
975
975
|
withProjectOptions(
|
|
976
976
|
withDiffOptions(
|
|
977
|
-
|
|
977
|
+
yargs25.positional("directory", {
|
|
978
978
|
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.",
|
|
979
979
|
type: "string"
|
|
980
980
|
}).option("format", {
|
|
@@ -1050,11 +1050,11 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
|
|
|
1050
1050
|
var ComponentPushModule = {
|
|
1051
1051
|
command: "push <directory>",
|
|
1052
1052
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
1053
|
-
builder: (
|
|
1053
|
+
builder: (yargs25) => withConfiguration(
|
|
1054
1054
|
withApiOptions(
|
|
1055
1055
|
withProjectOptions(
|
|
1056
1056
|
withDiffOptions(
|
|
1057
|
-
|
|
1057
|
+
yargs25.positional("directory", {
|
|
1058
1058
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
1059
1059
|
type: "string"
|
|
1060
1060
|
}).option("what-if", {
|
|
@@ -1119,10 +1119,10 @@ var ComponentRemoveModule = {
|
|
|
1119
1119
|
command: "remove <id>",
|
|
1120
1120
|
aliases: ["delete", "rm"],
|
|
1121
1121
|
describe: "Delete a component definition",
|
|
1122
|
-
builder: (
|
|
1122
|
+
builder: (yargs25) => withConfiguration(
|
|
1123
1123
|
withApiOptions(
|
|
1124
1124
|
withProjectOptions(
|
|
1125
|
-
|
|
1125
|
+
yargs25.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
|
|
1126
1126
|
)
|
|
1127
1127
|
)
|
|
1128
1128
|
),
|
|
@@ -1139,10 +1139,10 @@ var ComponentUpdateModule = {
|
|
|
1139
1139
|
command: "update <filename>",
|
|
1140
1140
|
aliases: ["put"],
|
|
1141
1141
|
describe: "Insert or update a component definition",
|
|
1142
|
-
builder: (
|
|
1142
|
+
builder: (yargs25) => withConfiguration(
|
|
1143
1143
|
withApiOptions(
|
|
1144
1144
|
withProjectOptions(
|
|
1145
|
-
|
|
1145
|
+
yargs25.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
1146
1146
|
)
|
|
1147
1147
|
)
|
|
1148
1148
|
),
|
|
@@ -1159,7 +1159,7 @@ var ComponentModule = {
|
|
|
1159
1159
|
command: "component <command>",
|
|
1160
1160
|
aliases: ["def"],
|
|
1161
1161
|
describe: "Commands for Canvas component definitions",
|
|
1162
|
-
builder: (
|
|
1162
|
+
builder: (yargs25) => yargs25.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
1163
1163
|
handler: () => {
|
|
1164
1164
|
yargs2.help();
|
|
1165
1165
|
}
|
|
@@ -1181,8 +1181,8 @@ function prepCompositionForDisk(composition) {
|
|
|
1181
1181
|
delete prepped.state;
|
|
1182
1182
|
return prepped;
|
|
1183
1183
|
}
|
|
1184
|
-
function withStateOptions(
|
|
1185
|
-
return
|
|
1184
|
+
function withStateOptions(yargs25) {
|
|
1185
|
+
return yargs25.option("state", {
|
|
1186
1186
|
type: "string",
|
|
1187
1187
|
describe: `Composition state to fetch.`,
|
|
1188
1188
|
choices: ["preview", "published"],
|
|
@@ -1207,12 +1207,12 @@ function convertCompositionState(state) {
|
|
|
1207
1207
|
var CompositionGetModule = {
|
|
1208
1208
|
command: "get <id>",
|
|
1209
1209
|
describe: "Fetch a composition",
|
|
1210
|
-
builder: (
|
|
1210
|
+
builder: (yargs25) => withFormatOptions(
|
|
1211
1211
|
withConfiguration(
|
|
1212
1212
|
withApiOptions(
|
|
1213
1213
|
withProjectOptions(
|
|
1214
1214
|
withStateOptions(
|
|
1215
|
-
|
|
1215
|
+
yargs25.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
|
|
1216
1216
|
resolvePatterns: {
|
|
1217
1217
|
type: "boolean",
|
|
1218
1218
|
default: false,
|
|
@@ -1283,12 +1283,12 @@ var CompositionListModule = {
|
|
|
1283
1283
|
command: "list",
|
|
1284
1284
|
describe: "List compositions",
|
|
1285
1285
|
aliases: ["ls"],
|
|
1286
|
-
builder: (
|
|
1286
|
+
builder: (yargs25) => withFormatOptions(
|
|
1287
1287
|
withConfiguration(
|
|
1288
1288
|
withApiOptions(
|
|
1289
1289
|
withProjectOptions(
|
|
1290
1290
|
withStateOptions(
|
|
1291
|
-
|
|
1291
|
+
yargs25.options({
|
|
1292
1292
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1293
1293
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
1294
1294
|
resolvePatterns: {
|
|
@@ -1409,11 +1409,11 @@ function createComponentInstanceEngineDataSource({
|
|
|
1409
1409
|
var CompositionPublishModule = {
|
|
1410
1410
|
command: "publish [ids]",
|
|
1411
1411
|
describe: "Publishes composition(s)",
|
|
1412
|
-
builder: (
|
|
1412
|
+
builder: (yargs25) => withConfiguration(
|
|
1413
1413
|
withApiOptions(
|
|
1414
1414
|
withProjectOptions(
|
|
1415
1415
|
withDiffOptions(
|
|
1416
|
-
|
|
1416
|
+
yargs25.positional("ids", {
|
|
1417
1417
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
1418
1418
|
type: "string"
|
|
1419
1419
|
}).option("all", {
|
|
@@ -1489,7 +1489,7 @@ import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canv
|
|
|
1489
1489
|
|
|
1490
1490
|
// src/files/index.ts
|
|
1491
1491
|
import { preferredType } from "@thi.ng/mime";
|
|
1492
|
-
import { FILE_READY_STATE, getFileNameFromUrl } from "@uniformdev/files
|
|
1492
|
+
import { FILE_READY_STATE, getFileNameFromUrl } from "@uniformdev/files";
|
|
1493
1493
|
import { createHash } from "crypto";
|
|
1494
1494
|
import fsj from "fs-jetpack";
|
|
1495
1495
|
import sizeOf from "image-size";
|
|
@@ -1515,17 +1515,18 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
1515
1515
|
if (uniformFileUrlMatches) {
|
|
1516
1516
|
const fileDownloadQueue = new PQueue({ concurrency: 10 });
|
|
1517
1517
|
for (const match of uniformFileUrlMatches) {
|
|
1518
|
-
const url = match[1];
|
|
1518
|
+
const url = new URL(match[1]);
|
|
1519
1519
|
fileDownloadQueue.add(async () => {
|
|
1520
1520
|
try {
|
|
1521
|
-
const
|
|
1521
|
+
const fetchUrl = `${url.origin}${url.pathname}?format=original`;
|
|
1522
|
+
const fileName = urlToFileName(fetchUrl);
|
|
1522
1523
|
const fileAlreadyExists = await fsj.existsAsync(
|
|
1523
1524
|
join2(options.directory, FILES_DIRECTORY_NAME, fileName)
|
|
1524
1525
|
);
|
|
1525
1526
|
if (fileAlreadyExists) {
|
|
1526
1527
|
return;
|
|
1527
1528
|
}
|
|
1528
|
-
const response = await fetch(
|
|
1529
|
+
const response = await fetch(fetchUrl);
|
|
1529
1530
|
if (!response.ok) {
|
|
1530
1531
|
return;
|
|
1531
1532
|
}
|
|
@@ -1663,12 +1664,12 @@ var swapOutUniformFileUrlsForTargetProject = async (object, options) => {
|
|
|
1663
1664
|
var CompositionPullModule = {
|
|
1664
1665
|
command: "pull <directory>",
|
|
1665
1666
|
describe: "Pulls all compositions to local files in a directory",
|
|
1666
|
-
builder: (
|
|
1667
|
+
builder: (yargs25) => withConfiguration(
|
|
1667
1668
|
withApiOptions(
|
|
1668
1669
|
withProjectOptions(
|
|
1669
1670
|
withStateOptions(
|
|
1670
1671
|
withDiffOptions(
|
|
1671
|
-
|
|
1672
|
+
yargs25.positional("directory", {
|
|
1672
1673
|
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.",
|
|
1673
1674
|
type: "string"
|
|
1674
1675
|
}).option("format", {
|
|
@@ -1758,16 +1759,16 @@ var CompositionPullModule = {
|
|
|
1758
1759
|
|
|
1759
1760
|
// src/commands/canvas/commands/composition/push.ts
|
|
1760
1761
|
import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canvas";
|
|
1761
|
-
import { FileClient as FileClient2 } from "@uniformdev/files
|
|
1762
|
+
import { FileClient as FileClient2 } from "@uniformdev/files";
|
|
1762
1763
|
var CompositionPushModule = {
|
|
1763
1764
|
command: "push <directory>",
|
|
1764
1765
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
1765
|
-
builder: (
|
|
1766
|
+
builder: (yargs25) => withConfiguration(
|
|
1766
1767
|
withApiOptions(
|
|
1767
1768
|
withProjectOptions(
|
|
1768
1769
|
withStateOptions(
|
|
1769
1770
|
withDiffOptions(
|
|
1770
|
-
|
|
1771
|
+
yargs25.positional("directory", {
|
|
1771
1772
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
1772
1773
|
type: "string"
|
|
1773
1774
|
}).option("what-if", {
|
|
@@ -1858,10 +1859,10 @@ var CompositionRemoveModule = {
|
|
|
1858
1859
|
command: "remove <id>",
|
|
1859
1860
|
aliases: ["delete", "rm"],
|
|
1860
1861
|
describe: "Delete a composition",
|
|
1861
|
-
builder: (
|
|
1862
|
+
builder: (yargs25) => withConfiguration(
|
|
1862
1863
|
withApiOptions(
|
|
1863
1864
|
withProjectOptions(
|
|
1864
|
-
|
|
1865
|
+
yargs25.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
|
|
1865
1866
|
)
|
|
1866
1867
|
)
|
|
1867
1868
|
),
|
|
@@ -1878,10 +1879,10 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
1878
1879
|
var CompositionUnpublishModule = {
|
|
1879
1880
|
command: "unpublish [ids]",
|
|
1880
1881
|
describe: "Unpublish a composition(s)",
|
|
1881
|
-
builder: (
|
|
1882
|
+
builder: (yargs25) => withConfiguration(
|
|
1882
1883
|
withApiOptions(
|
|
1883
1884
|
withProjectOptions(
|
|
1884
|
-
|
|
1885
|
+
yargs25.positional("ids", {
|
|
1885
1886
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
1886
1887
|
type: "string"
|
|
1887
1888
|
}).option("all", {
|
|
@@ -1976,11 +1977,11 @@ var CompositionUpdateModule = {
|
|
|
1976
1977
|
command: "update <filename>",
|
|
1977
1978
|
aliases: ["put"],
|
|
1978
1979
|
describe: "Insert or update a composition",
|
|
1979
|
-
builder: (
|
|
1980
|
+
builder: (yargs25) => withConfiguration(
|
|
1980
1981
|
withApiOptions(
|
|
1981
1982
|
withProjectOptions(
|
|
1982
1983
|
withStateOptions(
|
|
1983
|
-
|
|
1984
|
+
yargs25.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
|
|
1984
1985
|
)
|
|
1985
1986
|
)
|
|
1986
1987
|
)
|
|
@@ -1998,27 +1999,304 @@ var CompositionModule = {
|
|
|
1998
1999
|
command: "composition <command>",
|
|
1999
2000
|
describe: "Commands for Canvas compositions",
|
|
2000
2001
|
aliases: ["comp"],
|
|
2001
|
-
builder: (
|
|
2002
|
+
builder: (yargs25) => yargs25.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
2002
2003
|
handler: () => {
|
|
2003
2004
|
yargs3.help();
|
|
2004
2005
|
}
|
|
2005
2006
|
};
|
|
2006
2007
|
|
|
2007
|
-
// src/commands/canvas/commands/
|
|
2008
|
+
// src/commands/canvas/commands/contentType.ts
|
|
2008
2009
|
import yargs4 from "yargs";
|
|
2009
2010
|
|
|
2011
|
+
// src/commands/canvas/commands/contentType/get.ts
|
|
2012
|
+
import { ContentClient } from "@uniformdev/canvas";
|
|
2013
|
+
var ContentTypeGetModule = {
|
|
2014
|
+
command: "get <id>",
|
|
2015
|
+
describe: "Get a content type",
|
|
2016
|
+
builder: (yargs25) => withFormatOptions(
|
|
2017
|
+
withApiOptions(
|
|
2018
|
+
withProjectOptions(
|
|
2019
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2020
|
+
yargs25.positional("id", { demandOption: true, describe: "Content type public ID to fetch" })
|
|
2021
|
+
)
|
|
2022
|
+
)
|
|
2023
|
+
),
|
|
2024
|
+
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId }) => {
|
|
2025
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2026
|
+
const client = new ContentClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2027
|
+
const res = await client.getContentTypes({ offset: 0, limit: 1e3 });
|
|
2028
|
+
const found = res.contentTypes.find((f) => f.id === id);
|
|
2029
|
+
if (!found) {
|
|
2030
|
+
throw new Error(`Content type with ID ${id} not found`);
|
|
2031
|
+
}
|
|
2032
|
+
emitWithFormat(found, format, filename);
|
|
2033
|
+
}
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
// src/commands/canvas/commands/contentType/list.ts
|
|
2037
|
+
import { ContentClient as ContentClient2 } from "@uniformdev/canvas";
|
|
2038
|
+
var ContentTypeListModule = {
|
|
2039
|
+
command: "list",
|
|
2040
|
+
describe: "List content types",
|
|
2041
|
+
builder: (yargs25) => withFormatOptions(withApiOptions(withProjectOptions(yargs25))),
|
|
2042
|
+
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2043
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2044
|
+
const client = new ContentClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2045
|
+
const res = await client.getContentTypes({ offset: 0, limit: 1e3 });
|
|
2046
|
+
emitWithFormat(res.contentTypes, format, filename);
|
|
2047
|
+
}
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
// src/commands/canvas/commands/contentType/pull.ts
|
|
2051
|
+
import { ContentClient as ContentClient3 } from "@uniformdev/canvas";
|
|
2052
|
+
|
|
2053
|
+
// src/commands/canvas/commands/contentType/_util.ts
|
|
2054
|
+
var selectContentTypeIdentifier = (ct) => ct.id;
|
|
2055
|
+
var selectContentTypeDisplayName = (ct) => `${ct.name} (pid: ${ct.id})`;
|
|
2056
|
+
|
|
2057
|
+
// src/commands/canvas/contentTypeEngineDataSource.ts
|
|
2058
|
+
function createContentTypeEngineDataSource({
|
|
2059
|
+
client
|
|
2060
|
+
}) {
|
|
2061
|
+
async function* getObjects() {
|
|
2062
|
+
const { contentTypes } = await client.getContentTypes({ offset: 0, limit: 1e3 });
|
|
2063
|
+
for await (const ct of contentTypes) {
|
|
2064
|
+
const result = {
|
|
2065
|
+
id: selectContentTypeIdentifier(ct),
|
|
2066
|
+
displayName: selectContentTypeDisplayName(ct),
|
|
2067
|
+
providerId: ct.id,
|
|
2068
|
+
object: ct
|
|
2069
|
+
};
|
|
2070
|
+
yield result;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
return {
|
|
2074
|
+
objects: getObjects(),
|
|
2075
|
+
deleteObject: async (providerId) => {
|
|
2076
|
+
await client.deleteContentType({ contentTypeId: providerId });
|
|
2077
|
+
},
|
|
2078
|
+
writeObject: async ({ object }) => {
|
|
2079
|
+
await client.upsertContentType({ contentType: object });
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
// src/commands/canvas/commands/contentType/pull.ts
|
|
2085
|
+
var ContentTypePullModule = {
|
|
2086
|
+
command: "pull <directory>",
|
|
2087
|
+
describe: "Pulls all content types to local files in a directory",
|
|
2088
|
+
builder: (yargs25) => withApiOptions(
|
|
2089
|
+
withProjectOptions(
|
|
2090
|
+
withDiffOptions(
|
|
2091
|
+
yargs25.positional("directory", {
|
|
2092
|
+
describe: "Directory to save the content types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
2093
|
+
type: "string"
|
|
2094
|
+
}).option("format", {
|
|
2095
|
+
alias: ["f"],
|
|
2096
|
+
describe: "Output format",
|
|
2097
|
+
default: "yaml",
|
|
2098
|
+
choices: ["yaml", "json"],
|
|
2099
|
+
type: "string"
|
|
2100
|
+
}).option("what-if", {
|
|
2101
|
+
alias: ["w"],
|
|
2102
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
2103
|
+
default: false,
|
|
2104
|
+
type: "boolean"
|
|
2105
|
+
}).option("mode", {
|
|
2106
|
+
alias: ["m"],
|
|
2107
|
+
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',
|
|
2108
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
2109
|
+
default: "mirror",
|
|
2110
|
+
type: "string"
|
|
2111
|
+
})
|
|
2112
|
+
)
|
|
2113
|
+
)
|
|
2114
|
+
),
|
|
2115
|
+
handler: async ({
|
|
2116
|
+
apiHost,
|
|
2117
|
+
apiKey,
|
|
2118
|
+
proxy,
|
|
2119
|
+
directory,
|
|
2120
|
+
format,
|
|
2121
|
+
mode,
|
|
2122
|
+
whatIf,
|
|
2123
|
+
project: projectId,
|
|
2124
|
+
diff: diffMode
|
|
2125
|
+
}) => {
|
|
2126
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2127
|
+
const client = new ContentClient3({
|
|
2128
|
+
apiKey,
|
|
2129
|
+
apiHost,
|
|
2130
|
+
fetch: fetch3,
|
|
2131
|
+
projectId,
|
|
2132
|
+
bypassCache: true
|
|
2133
|
+
});
|
|
2134
|
+
const source = createContentTypeEngineDataSource({ client });
|
|
2135
|
+
let target;
|
|
2136
|
+
const isPackage = isPathAPackageFile(directory);
|
|
2137
|
+
if (isPackage) {
|
|
2138
|
+
const packageContents = readCanvasPackage(directory, false);
|
|
2139
|
+
target = await createArraySyncEngineDataSource({
|
|
2140
|
+
objects: packageContents.contentTypes ?? [],
|
|
2141
|
+
selectIdentifier: selectContentTypeIdentifier,
|
|
2142
|
+
selectDisplayName: selectContentTypeDisplayName,
|
|
2143
|
+
onSyncComplete: async (_, synced) => {
|
|
2144
|
+
packageContents.contentTypes = synced;
|
|
2145
|
+
writeCanvasPackage(directory, packageContents);
|
|
2146
|
+
}
|
|
2147
|
+
});
|
|
2148
|
+
} else {
|
|
2149
|
+
target = await createFileSyncEngineDataSource({
|
|
2150
|
+
directory,
|
|
2151
|
+
selectIdentifier: selectContentTypeIdentifier,
|
|
2152
|
+
selectDisplayName: selectContentTypeDisplayName,
|
|
2153
|
+
format
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
await syncEngine({
|
|
2157
|
+
source,
|
|
2158
|
+
target,
|
|
2159
|
+
mode,
|
|
2160
|
+
whatIf,
|
|
2161
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
};
|
|
2165
|
+
|
|
2166
|
+
// src/commands/canvas/commands/contentType/push.ts
|
|
2167
|
+
import { ContentClient as ContentClient4 } from "@uniformdev/canvas";
|
|
2168
|
+
var ContentTypePushModule = {
|
|
2169
|
+
command: "push <directory>",
|
|
2170
|
+
describe: "Pushes all content types from files in a directory to Uniform",
|
|
2171
|
+
builder: (yargs25) => withApiOptions(
|
|
2172
|
+
withProjectOptions(
|
|
2173
|
+
withDiffOptions(
|
|
2174
|
+
yargs25.positional("directory", {
|
|
2175
|
+
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
2176
|
+
type: "string"
|
|
2177
|
+
}).option("what-if", {
|
|
2178
|
+
alias: ["w"],
|
|
2179
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
2180
|
+
default: false,
|
|
2181
|
+
type: "boolean"
|
|
2182
|
+
}).option("mode", {
|
|
2183
|
+
alias: ["m"],
|
|
2184
|
+
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',
|
|
2185
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
2186
|
+
default: "mirror",
|
|
2187
|
+
type: "string"
|
|
2188
|
+
})
|
|
2189
|
+
)
|
|
2190
|
+
)
|
|
2191
|
+
),
|
|
2192
|
+
handler: async ({
|
|
2193
|
+
apiHost,
|
|
2194
|
+
apiKey,
|
|
2195
|
+
proxy,
|
|
2196
|
+
directory,
|
|
2197
|
+
mode,
|
|
2198
|
+
whatIf,
|
|
2199
|
+
project: projectId,
|
|
2200
|
+
diff: diffMode
|
|
2201
|
+
}) => {
|
|
2202
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2203
|
+
const client = new ContentClient4({
|
|
2204
|
+
apiKey,
|
|
2205
|
+
apiHost,
|
|
2206
|
+
fetch: fetch3,
|
|
2207
|
+
projectId,
|
|
2208
|
+
bypassCache: true
|
|
2209
|
+
});
|
|
2210
|
+
let source;
|
|
2211
|
+
const isPackage = isPathAPackageFile(directory);
|
|
2212
|
+
if (isPackage) {
|
|
2213
|
+
const packageContents = readCanvasPackage(directory, true);
|
|
2214
|
+
source = await createArraySyncEngineDataSource({
|
|
2215
|
+
objects: packageContents.contentTypes ?? [],
|
|
2216
|
+
selectIdentifier: selectContentTypeIdentifier,
|
|
2217
|
+
selectDisplayName: selectContentTypeDisplayName
|
|
2218
|
+
});
|
|
2219
|
+
} else {
|
|
2220
|
+
source = await createFileSyncEngineDataSource({
|
|
2221
|
+
directory,
|
|
2222
|
+
selectIdentifier: selectContentTypeIdentifier,
|
|
2223
|
+
selectDisplayName: selectContentTypeDisplayName
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
const target = createContentTypeEngineDataSource({ client });
|
|
2227
|
+
await syncEngine({
|
|
2228
|
+
source,
|
|
2229
|
+
target,
|
|
2230
|
+
mode,
|
|
2231
|
+
whatIf,
|
|
2232
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
// src/commands/canvas/commands/contentType/remove.ts
|
|
2238
|
+
import { ContentClient as ContentClient5 } from "@uniformdev/canvas";
|
|
2239
|
+
var ContentTypeRemoveModule = {
|
|
2240
|
+
command: "remove <id>",
|
|
2241
|
+
aliases: ["delete", "rm"],
|
|
2242
|
+
describe: "Delete a content type",
|
|
2243
|
+
builder: (yargs25) => withApiOptions(
|
|
2244
|
+
withProjectOptions(
|
|
2245
|
+
yargs25.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
2246
|
+
)
|
|
2247
|
+
),
|
|
2248
|
+
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
2249
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2250
|
+
const client = new ContentClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2251
|
+
await client.deleteContentType({ contentTypeId: id });
|
|
2252
|
+
}
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2255
|
+
// src/commands/canvas/commands/contentType/update.ts
|
|
2256
|
+
import { ContentClient as ContentClient6 } from "@uniformdev/canvas";
|
|
2257
|
+
var ContentTypeUpdateModule = {
|
|
2258
|
+
command: "update <filename>",
|
|
2259
|
+
aliases: ["put"],
|
|
2260
|
+
describe: "Insert or update a content type",
|
|
2261
|
+
builder: (yargs25) => withApiOptions(
|
|
2262
|
+
withProjectOptions(
|
|
2263
|
+
yargs25.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
2264
|
+
)
|
|
2265
|
+
),
|
|
2266
|
+
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
2267
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2268
|
+
const client = new ContentClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2269
|
+
const file = readFileToObject(filename);
|
|
2270
|
+
await client.upsertContentType({ contentType: file });
|
|
2271
|
+
}
|
|
2272
|
+
};
|
|
2273
|
+
|
|
2274
|
+
// src/commands/canvas/commands/contentType.ts
|
|
2275
|
+
var ContentTypeModule = {
|
|
2276
|
+
command: "contenttype <command>",
|
|
2277
|
+
aliases: ["ct"],
|
|
2278
|
+
describe: "Commands for Content Types",
|
|
2279
|
+
builder: (yargs25) => yargs25.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
2280
|
+
handler: () => {
|
|
2281
|
+
yargs4.help();
|
|
2282
|
+
}
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2285
|
+
// src/commands/canvas/commands/dataType.ts
|
|
2286
|
+
import yargs5 from "yargs";
|
|
2287
|
+
|
|
2010
2288
|
// src/commands/canvas/commands/dataType/get.ts
|
|
2011
2289
|
import { DataTypeClient } from "@uniformdev/canvas";
|
|
2012
2290
|
var DataTypeGetModule = {
|
|
2013
2291
|
command: "get <id>",
|
|
2014
2292
|
describe: "Get a data type",
|
|
2015
2293
|
aliases: ["ls"],
|
|
2016
|
-
builder: (
|
|
2294
|
+
builder: (yargs25) => withConfiguration(
|
|
2017
2295
|
withFormatOptions(
|
|
2018
2296
|
withApiOptions(
|
|
2019
2297
|
withProjectOptions(
|
|
2020
2298
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2021
|
-
|
|
2299
|
+
yargs25.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
2022
2300
|
)
|
|
2023
2301
|
)
|
|
2024
2302
|
)
|
|
@@ -2041,7 +2319,7 @@ var DataTypeListModule = {
|
|
|
2041
2319
|
command: "list",
|
|
2042
2320
|
describe: "List data types",
|
|
2043
2321
|
aliases: ["ls"],
|
|
2044
|
-
builder: (
|
|
2322
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
2045
2323
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2046
2324
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2047
2325
|
const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -2090,11 +2368,11 @@ function createDataTypeEngineDataSource({
|
|
|
2090
2368
|
var DataTypePullModule = {
|
|
2091
2369
|
command: "pull <directory>",
|
|
2092
2370
|
describe: "Pulls all data types to local files in a directory",
|
|
2093
|
-
builder: (
|
|
2371
|
+
builder: (yargs25) => withConfiguration(
|
|
2094
2372
|
withApiOptions(
|
|
2095
2373
|
withProjectOptions(
|
|
2096
2374
|
withDiffOptions(
|
|
2097
|
-
|
|
2375
|
+
yargs25.positional("directory", {
|
|
2098
2376
|
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.",
|
|
2099
2377
|
type: "string"
|
|
2100
2378
|
}).option("format", {
|
|
@@ -2175,11 +2453,11 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
|
|
|
2175
2453
|
var DataTypePushModule = {
|
|
2176
2454
|
command: "push <directory>",
|
|
2177
2455
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
2178
|
-
builder: (
|
|
2456
|
+
builder: (yargs25) => withConfiguration(
|
|
2179
2457
|
withApiOptions(
|
|
2180
2458
|
withProjectOptions(
|
|
2181
2459
|
withDiffOptions(
|
|
2182
|
-
|
|
2460
|
+
yargs25.positional("directory", {
|
|
2183
2461
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
2184
2462
|
type: "string"
|
|
2185
2463
|
}).option("what-if", {
|
|
@@ -2249,10 +2527,10 @@ var DataTypeRemoveModule = {
|
|
|
2249
2527
|
command: "remove <id>",
|
|
2250
2528
|
aliases: ["delete", "rm"],
|
|
2251
2529
|
describe: "Delete a data type",
|
|
2252
|
-
builder: (
|
|
2530
|
+
builder: (yargs25) => withConfiguration(
|
|
2253
2531
|
withApiOptions(
|
|
2254
2532
|
withProjectOptions(
|
|
2255
|
-
|
|
2533
|
+
yargs25.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
2256
2534
|
)
|
|
2257
2535
|
)
|
|
2258
2536
|
),
|
|
@@ -2269,10 +2547,10 @@ var DataTypeUpdateModule = {
|
|
|
2269
2547
|
command: "update <filename>",
|
|
2270
2548
|
aliases: ["put"],
|
|
2271
2549
|
describe: "Insert or update a data type",
|
|
2272
|
-
builder: (
|
|
2550
|
+
builder: (yargs25) => withConfiguration(
|
|
2273
2551
|
withApiOptions(
|
|
2274
2552
|
withProjectOptions(
|
|
2275
|
-
|
|
2553
|
+
yargs25.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
2276
2554
|
)
|
|
2277
2555
|
)
|
|
2278
2556
|
),
|
|
@@ -2289,14 +2567,287 @@ var DataTypeModule = {
|
|
|
2289
2567
|
command: "datatype <command>",
|
|
2290
2568
|
aliases: ["dt"],
|
|
2291
2569
|
describe: "Commands for Data Type definitions",
|
|
2292
|
-
builder: (
|
|
2570
|
+
builder: (yargs25) => yargs25.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
2293
2571
|
handler: () => {
|
|
2294
|
-
|
|
2572
|
+
yargs5.help();
|
|
2573
|
+
}
|
|
2574
|
+
};
|
|
2575
|
+
|
|
2576
|
+
// src/commands/canvas/commands/entry.ts
|
|
2577
|
+
import yargs6 from "yargs";
|
|
2578
|
+
|
|
2579
|
+
// src/commands/canvas/commands/entry/get.ts
|
|
2580
|
+
import { ContentClient as ContentClient7 } from "@uniformdev/canvas";
|
|
2581
|
+
var EntryGetModule = {
|
|
2582
|
+
command: "get <id>",
|
|
2583
|
+
describe: "Get an entry",
|
|
2584
|
+
builder: (yargs25) => withFormatOptions(
|
|
2585
|
+
withApiOptions(
|
|
2586
|
+
withProjectOptions(
|
|
2587
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2588
|
+
yargs25.positional("id", { demandOption: true, describe: "Entry public ID to fetch" })
|
|
2589
|
+
)
|
|
2590
|
+
)
|
|
2591
|
+
),
|
|
2592
|
+
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId }) => {
|
|
2593
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2594
|
+
const client = new ContentClient7({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2595
|
+
const res = await client.getEntries({ offset: 0, limit: 1, entryIDs: [id] });
|
|
2596
|
+
if (res.entries.length !== 1) {
|
|
2597
|
+
throw new Error(`Entry with ID ${id} not found`);
|
|
2598
|
+
}
|
|
2599
|
+
emitWithFormat(res.entries[0], format, filename);
|
|
2600
|
+
}
|
|
2601
|
+
};
|
|
2602
|
+
|
|
2603
|
+
// src/commands/canvas/commands/entry/list.ts
|
|
2604
|
+
import { ContentClient as ContentClient8 } from "@uniformdev/canvas";
|
|
2605
|
+
var EntryListModule = {
|
|
2606
|
+
command: "list",
|
|
2607
|
+
describe: "List entries",
|
|
2608
|
+
builder: (yargs25) => withFormatOptions(withApiOptions(withProjectOptions(yargs25))),
|
|
2609
|
+
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2610
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2611
|
+
const client = new ContentClient8({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2612
|
+
const res = await client.getEntries({ offset: 0, limit: 1e3 });
|
|
2613
|
+
emitWithFormat(res.entries, format, filename);
|
|
2614
|
+
}
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
// src/commands/canvas/commands/entry/pull.ts
|
|
2618
|
+
import { ContentClient as ContentClient9 } from "@uniformdev/canvas";
|
|
2619
|
+
|
|
2620
|
+
// src/commands/canvas/commands/entry/_util.ts
|
|
2621
|
+
var selectEntryIdentifier = (e) => e.entry._id;
|
|
2622
|
+
var selectEntryDisplayName = (e) => `${e.entry._name ?? "Untitled"} (pid: ${e.entry._id})`;
|
|
2623
|
+
|
|
2624
|
+
// src/commands/canvas/entryEngineDataSource.ts
|
|
2625
|
+
function createEntryEngineDataSource({
|
|
2626
|
+
client
|
|
2627
|
+
}) {
|
|
2628
|
+
async function* getObjects() {
|
|
2629
|
+
const { entries } = await client.getEntries({ offset: 0, limit: 1e3 });
|
|
2630
|
+
for await (const e of entries) {
|
|
2631
|
+
const result = {
|
|
2632
|
+
id: selectEntryIdentifier(e),
|
|
2633
|
+
displayName: selectEntryDisplayName(e),
|
|
2634
|
+
providerId: e.entry._id,
|
|
2635
|
+
object: e
|
|
2636
|
+
};
|
|
2637
|
+
yield result;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
return {
|
|
2641
|
+
objects: getObjects(),
|
|
2642
|
+
deleteObject: async (providerId) => {
|
|
2643
|
+
await client.deleteEntry({ entryId: providerId });
|
|
2644
|
+
},
|
|
2645
|
+
writeObject: async ({ object }) => {
|
|
2646
|
+
await client.upsertEntry(object);
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
// src/commands/canvas/commands/entry/pull.ts
|
|
2652
|
+
var EntryPullModule = {
|
|
2653
|
+
command: "pull <directory>",
|
|
2654
|
+
describe: "Pulls all entries to local files in a directory",
|
|
2655
|
+
builder: (yargs25) => withApiOptions(
|
|
2656
|
+
withProjectOptions(
|
|
2657
|
+
withDiffOptions(
|
|
2658
|
+
yargs25.positional("directory", {
|
|
2659
|
+
describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
2660
|
+
type: "string"
|
|
2661
|
+
}).option("format", {
|
|
2662
|
+
alias: ["f"],
|
|
2663
|
+
describe: "Output format",
|
|
2664
|
+
default: "yaml",
|
|
2665
|
+
choices: ["yaml", "json"],
|
|
2666
|
+
type: "string"
|
|
2667
|
+
}).option("what-if", {
|
|
2668
|
+
alias: ["w"],
|
|
2669
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
2670
|
+
default: false,
|
|
2671
|
+
type: "boolean"
|
|
2672
|
+
}).option("mode", {
|
|
2673
|
+
alias: ["m"],
|
|
2674
|
+
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',
|
|
2675
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
2676
|
+
default: "mirror",
|
|
2677
|
+
type: "string"
|
|
2678
|
+
})
|
|
2679
|
+
)
|
|
2680
|
+
)
|
|
2681
|
+
),
|
|
2682
|
+
handler: async ({
|
|
2683
|
+
apiHost,
|
|
2684
|
+
apiKey,
|
|
2685
|
+
proxy,
|
|
2686
|
+
directory,
|
|
2687
|
+
format,
|
|
2688
|
+
mode,
|
|
2689
|
+
whatIf,
|
|
2690
|
+
project: projectId,
|
|
2691
|
+
diff: diffMode
|
|
2692
|
+
}) => {
|
|
2693
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2694
|
+
const client = new ContentClient9({
|
|
2695
|
+
apiKey,
|
|
2696
|
+
apiHost,
|
|
2697
|
+
fetch: fetch3,
|
|
2698
|
+
projectId,
|
|
2699
|
+
bypassCache: true
|
|
2700
|
+
});
|
|
2701
|
+
const source = createEntryEngineDataSource({ client });
|
|
2702
|
+
let target;
|
|
2703
|
+
const isPackage = isPathAPackageFile(directory);
|
|
2704
|
+
if (isPackage) {
|
|
2705
|
+
const packageContents = readCanvasPackage(directory, false);
|
|
2706
|
+
target = await createArraySyncEngineDataSource({
|
|
2707
|
+
objects: packageContents.entries ?? [],
|
|
2708
|
+
selectIdentifier: selectEntryIdentifier,
|
|
2709
|
+
selectDisplayName: selectEntryDisplayName,
|
|
2710
|
+
onSyncComplete: async (_, synced) => {
|
|
2711
|
+
packageContents.entries = synced;
|
|
2712
|
+
writeCanvasPackage(directory, packageContents);
|
|
2713
|
+
}
|
|
2714
|
+
});
|
|
2715
|
+
} else {
|
|
2716
|
+
target = await createFileSyncEngineDataSource({
|
|
2717
|
+
directory,
|
|
2718
|
+
selectIdentifier: selectEntryIdentifier,
|
|
2719
|
+
selectDisplayName: selectEntryDisplayName,
|
|
2720
|
+
format
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
await syncEngine({
|
|
2724
|
+
source,
|
|
2725
|
+
target,
|
|
2726
|
+
mode,
|
|
2727
|
+
whatIf,
|
|
2728
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
2729
|
+
});
|
|
2730
|
+
}
|
|
2731
|
+
};
|
|
2732
|
+
|
|
2733
|
+
// src/commands/canvas/commands/entry/push.ts
|
|
2734
|
+
import { ContentClient as ContentClient10 } from "@uniformdev/canvas";
|
|
2735
|
+
var EntryPushModule = {
|
|
2736
|
+
command: "push <directory>",
|
|
2737
|
+
describe: "Pushes all entries from files in a directory to Uniform",
|
|
2738
|
+
builder: (yargs25) => withApiOptions(
|
|
2739
|
+
withProjectOptions(
|
|
2740
|
+
withDiffOptions(
|
|
2741
|
+
yargs25.positional("directory", {
|
|
2742
|
+
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
2743
|
+
type: "string"
|
|
2744
|
+
}).option("what-if", {
|
|
2745
|
+
alias: ["w"],
|
|
2746
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
2747
|
+
default: false,
|
|
2748
|
+
type: "boolean"
|
|
2749
|
+
}).option("mode", {
|
|
2750
|
+
alias: ["m"],
|
|
2751
|
+
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',
|
|
2752
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
2753
|
+
default: "mirror",
|
|
2754
|
+
type: "string"
|
|
2755
|
+
})
|
|
2756
|
+
)
|
|
2757
|
+
)
|
|
2758
|
+
),
|
|
2759
|
+
handler: async ({
|
|
2760
|
+
apiHost,
|
|
2761
|
+
apiKey,
|
|
2762
|
+
proxy,
|
|
2763
|
+
directory,
|
|
2764
|
+
mode,
|
|
2765
|
+
whatIf,
|
|
2766
|
+
project: projectId,
|
|
2767
|
+
diff: diffMode
|
|
2768
|
+
}) => {
|
|
2769
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2770
|
+
const client = new ContentClient10({
|
|
2771
|
+
apiKey,
|
|
2772
|
+
apiHost,
|
|
2773
|
+
fetch: fetch3,
|
|
2774
|
+
projectId,
|
|
2775
|
+
bypassCache: true
|
|
2776
|
+
});
|
|
2777
|
+
let source;
|
|
2778
|
+
const isPackage = isPathAPackageFile(directory);
|
|
2779
|
+
if (isPackage) {
|
|
2780
|
+
const packageContents = readCanvasPackage(directory, true);
|
|
2781
|
+
source = await createArraySyncEngineDataSource({
|
|
2782
|
+
objects: packageContents.entries ?? [],
|
|
2783
|
+
selectIdentifier: selectEntryIdentifier,
|
|
2784
|
+
selectDisplayName: selectEntryDisplayName
|
|
2785
|
+
});
|
|
2786
|
+
} else {
|
|
2787
|
+
source = await createFileSyncEngineDataSource({
|
|
2788
|
+
directory,
|
|
2789
|
+
selectIdentifier: selectEntryIdentifier,
|
|
2790
|
+
selectDisplayName: selectEntryDisplayName
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
2793
|
+
const target = createEntryEngineDataSource({ client });
|
|
2794
|
+
await syncEngine({
|
|
2795
|
+
source,
|
|
2796
|
+
target,
|
|
2797
|
+
mode,
|
|
2798
|
+
whatIf,
|
|
2799
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
};
|
|
2803
|
+
|
|
2804
|
+
// src/commands/canvas/commands/entry/remove.ts
|
|
2805
|
+
import { ContentClient as ContentClient11 } from "@uniformdev/canvas";
|
|
2806
|
+
var EntryRemoveModule = {
|
|
2807
|
+
command: "remove <id>",
|
|
2808
|
+
aliases: ["delete", "rm"],
|
|
2809
|
+
describe: "Delete an entry",
|
|
2810
|
+
builder: (yargs25) => withApiOptions(
|
|
2811
|
+
withProjectOptions(
|
|
2812
|
+
yargs25.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
2813
|
+
)
|
|
2814
|
+
),
|
|
2815
|
+
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
2816
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2817
|
+
const client = new ContentClient11({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2818
|
+
await client.deleteEntry({ entryId: id });
|
|
2819
|
+
}
|
|
2820
|
+
};
|
|
2821
|
+
|
|
2822
|
+
// src/commands/canvas/commands/entry/update.ts
|
|
2823
|
+
import { ContentClient as ContentClient12 } from "@uniformdev/canvas";
|
|
2824
|
+
var EntryUpdateModule = {
|
|
2825
|
+
command: "update <filename>",
|
|
2826
|
+
aliases: ["put"],
|
|
2827
|
+
describe: "Insert or update an entry",
|
|
2828
|
+
builder: (yargs25) => withApiOptions(
|
|
2829
|
+
withProjectOptions(yargs25.positional("filename", { demandOption: true, describe: "Entry file to put" }))
|
|
2830
|
+
),
|
|
2831
|
+
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
2832
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
2833
|
+
const client = new ContentClient12({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
2834
|
+
const file = readFileToObject(filename);
|
|
2835
|
+
await client.upsertEntry(file);
|
|
2836
|
+
}
|
|
2837
|
+
};
|
|
2838
|
+
|
|
2839
|
+
// src/commands/canvas/commands/entry.ts
|
|
2840
|
+
var EntryModule = {
|
|
2841
|
+
command: "entry <command>",
|
|
2842
|
+
describe: "Commands for Entries",
|
|
2843
|
+
builder: (yargs25) => yargs25.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).demandCommand(),
|
|
2844
|
+
handler: () => {
|
|
2845
|
+
yargs6.help();
|
|
2295
2846
|
}
|
|
2296
2847
|
};
|
|
2297
2848
|
|
|
2298
2849
|
// src/commands/canvas/commands/pattern.ts
|
|
2299
|
-
import
|
|
2850
|
+
import yargs7 from "yargs";
|
|
2300
2851
|
|
|
2301
2852
|
// src/commands/canvas/commands/pattern/get.ts
|
|
2302
2853
|
var PatternGetModule = {
|
|
@@ -2308,12 +2859,12 @@ var PatternGetModule = {
|
|
|
2308
2859
|
var PatternListModule = {
|
|
2309
2860
|
...CompositionListModule,
|
|
2310
2861
|
describe: "List patterns",
|
|
2311
|
-
builder: (
|
|
2862
|
+
builder: (yargs25) => withFormatOptions(
|
|
2312
2863
|
withConfiguration(
|
|
2313
2864
|
withApiOptions(
|
|
2314
2865
|
withProjectOptions(
|
|
2315
2866
|
withStateOptions(
|
|
2316
|
-
|
|
2867
|
+
yargs25.options({
|
|
2317
2868
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2318
2869
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2319
2870
|
resolvePatterns: {
|
|
@@ -2351,11 +2902,11 @@ var PatternListModule = {
|
|
|
2351
2902
|
var PatternPublishModule = {
|
|
2352
2903
|
...CompositionPublishModule,
|
|
2353
2904
|
describe: "Publishes pattern(s)",
|
|
2354
|
-
builder: (
|
|
2905
|
+
builder: (yargs25) => withConfiguration(
|
|
2355
2906
|
withApiOptions(
|
|
2356
2907
|
withProjectOptions(
|
|
2357
2908
|
withDiffOptions(
|
|
2358
|
-
|
|
2909
|
+
yargs25.positional("ids", {
|
|
2359
2910
|
describe: "Publishes pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2360
2911
|
type: "string"
|
|
2361
2912
|
}).option("all", {
|
|
@@ -2393,12 +2944,12 @@ var PatternPublishModule = {
|
|
|
2393
2944
|
var PatternPullModule = {
|
|
2394
2945
|
...CompositionPullModule,
|
|
2395
2946
|
describe: "Pulls all patterns to local files in a directory",
|
|
2396
|
-
builder: (
|
|
2947
|
+
builder: (yargs25) => withConfiguration(
|
|
2397
2948
|
withApiOptions(
|
|
2398
2949
|
withProjectOptions(
|
|
2399
2950
|
withStateOptions(
|
|
2400
2951
|
withDiffOptions(
|
|
2401
|
-
|
|
2952
|
+
yargs25.positional("directory", {
|
|
2402
2953
|
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.",
|
|
2403
2954
|
type: "string"
|
|
2404
2955
|
}).option("format", {
|
|
@@ -2436,12 +2987,12 @@ var PatternPullModule = {
|
|
|
2436
2987
|
var PatternPushModule = {
|
|
2437
2988
|
...CompositionPushModule,
|
|
2438
2989
|
describe: "Pushes all patterns from files in a directory to Uniform Canvas",
|
|
2439
|
-
builder: (
|
|
2990
|
+
builder: (yargs25) => withConfiguration(
|
|
2440
2991
|
withApiOptions(
|
|
2441
2992
|
withProjectOptions(
|
|
2442
2993
|
withStateOptions(
|
|
2443
2994
|
withDiffOptions(
|
|
2444
|
-
|
|
2995
|
+
yargs25.positional("directory", {
|
|
2445
2996
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2446
2997
|
type: "string"
|
|
2447
2998
|
}).option("what-if", {
|
|
@@ -2479,10 +3030,10 @@ var PatternRemoveModule = {
|
|
|
2479
3030
|
var PatternUnpublishModule = {
|
|
2480
3031
|
command: "unpublish [ids]",
|
|
2481
3032
|
describe: "Unpublish a pattern(s)",
|
|
2482
|
-
builder: (
|
|
3033
|
+
builder: (yargs25) => withConfiguration(
|
|
2483
3034
|
withApiOptions(
|
|
2484
3035
|
withProjectOptions(
|
|
2485
|
-
|
|
3036
|
+
yargs25.positional("ids", {
|
|
2486
3037
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2487
3038
|
type: "string"
|
|
2488
3039
|
}).option("all", {
|
|
@@ -2521,9 +3072,9 @@ var PatternUpdateModule = {
|
|
|
2521
3072
|
var PatternModule = {
|
|
2522
3073
|
command: "pattern <command>",
|
|
2523
3074
|
describe: "Commands for Canvas patterns",
|
|
2524
|
-
builder: (
|
|
3075
|
+
builder: (yargs25) => yargs25.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
|
|
2525
3076
|
handler: () => {
|
|
2526
|
-
|
|
3077
|
+
yargs7.help();
|
|
2527
3078
|
}
|
|
2528
3079
|
};
|
|
2529
3080
|
|
|
@@ -2532,28 +3083,28 @@ var CanvasCommand = {
|
|
|
2532
3083
|
command: "canvas <command>",
|
|
2533
3084
|
aliases: ["cv", "pm", "presentation"],
|
|
2534
3085
|
describe: "Uniform Canvas commands",
|
|
2535
|
-
builder: (
|
|
3086
|
+
builder: (yargs25) => yargs25.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).command(PatternModule).command(ContentTypeModule).command(EntryModule).demandCommand(),
|
|
2536
3087
|
handler: () => {
|
|
2537
|
-
|
|
3088
|
+
yargs8.showHelp();
|
|
2538
3089
|
}
|
|
2539
3090
|
};
|
|
2540
3091
|
|
|
2541
3092
|
// src/commands/context/index.ts
|
|
2542
|
-
import
|
|
3093
|
+
import yargs15 from "yargs";
|
|
2543
3094
|
|
|
2544
3095
|
// src/commands/context/commands/aggregate.ts
|
|
2545
|
-
import
|
|
3096
|
+
import yargs9 from "yargs";
|
|
2546
3097
|
|
|
2547
3098
|
// src/commands/context/commands/aggregate/get.ts
|
|
2548
3099
|
import { UncachedAggregateClient } from "@uniformdev/context/api";
|
|
2549
3100
|
var AggregateGetModule = {
|
|
2550
3101
|
command: "get <id>",
|
|
2551
3102
|
describe: "Fetch an aggregate",
|
|
2552
|
-
builder: (
|
|
3103
|
+
builder: (yargs25) => withConfiguration(
|
|
2553
3104
|
withFormatOptions(
|
|
2554
3105
|
withApiOptions(
|
|
2555
3106
|
withProjectOptions(
|
|
2556
|
-
|
|
3107
|
+
yargs25.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
2557
3108
|
)
|
|
2558
3109
|
)
|
|
2559
3110
|
)
|
|
@@ -2577,7 +3128,7 @@ var AggregateListModule = {
|
|
|
2577
3128
|
command: "list",
|
|
2578
3129
|
describe: "List aggregates",
|
|
2579
3130
|
aliases: ["ls"],
|
|
2580
|
-
builder: (
|
|
3131
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
2581
3132
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2582
3133
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2583
3134
|
const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -2643,11 +3194,11 @@ function writeContextPackage(filename, packageContents) {
|
|
|
2643
3194
|
var AggregatePullModule = {
|
|
2644
3195
|
command: "pull <directory>",
|
|
2645
3196
|
describe: "Pulls all aggregates to local files in a directory",
|
|
2646
|
-
builder: (
|
|
3197
|
+
builder: (yargs25) => withConfiguration(
|
|
2647
3198
|
withApiOptions(
|
|
2648
3199
|
withProjectOptions(
|
|
2649
3200
|
withDiffOptions(
|
|
2650
|
-
|
|
3201
|
+
yargs25.positional("directory", {
|
|
2651
3202
|
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.",
|
|
2652
3203
|
type: "string"
|
|
2653
3204
|
}).option("format", {
|
|
@@ -2722,11 +3273,11 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
|
|
|
2722
3273
|
var AggregatePushModule = {
|
|
2723
3274
|
command: "push <directory>",
|
|
2724
3275
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
2725
|
-
builder: (
|
|
3276
|
+
builder: (yargs25) => withConfiguration(
|
|
2726
3277
|
withApiOptions(
|
|
2727
3278
|
withProjectOptions(
|
|
2728
3279
|
withDiffOptions(
|
|
2729
|
-
|
|
3280
|
+
yargs25.positional("directory", {
|
|
2730
3281
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
2731
3282
|
type: "string"
|
|
2732
3283
|
}).option("what-if", {
|
|
@@ -2791,10 +3342,10 @@ var AggregateRemoveModule = {
|
|
|
2791
3342
|
command: "remove <id>",
|
|
2792
3343
|
aliases: ["delete", "rm"],
|
|
2793
3344
|
describe: "Delete an aggregate",
|
|
2794
|
-
builder: (
|
|
3345
|
+
builder: (yargs25) => withConfiguration(
|
|
2795
3346
|
withApiOptions(
|
|
2796
3347
|
withProjectOptions(
|
|
2797
|
-
|
|
3348
|
+
yargs25.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
2798
3349
|
)
|
|
2799
3350
|
)
|
|
2800
3351
|
),
|
|
@@ -2811,10 +3362,10 @@ var AggregateUpdateModule = {
|
|
|
2811
3362
|
command: "update <filename>",
|
|
2812
3363
|
aliases: ["put"],
|
|
2813
3364
|
describe: "Insert or update an aggregate",
|
|
2814
|
-
builder: (
|
|
3365
|
+
builder: (yargs25) => withConfiguration(
|
|
2815
3366
|
withApiOptions(
|
|
2816
3367
|
withProjectOptions(
|
|
2817
|
-
|
|
3368
|
+
yargs25.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
2818
3369
|
)
|
|
2819
3370
|
)
|
|
2820
3371
|
),
|
|
@@ -2831,25 +3382,25 @@ var AggregateModule = {
|
|
|
2831
3382
|
command: "aggregate <command>",
|
|
2832
3383
|
aliases: ["agg", "intent", "audience"],
|
|
2833
3384
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
2834
|
-
builder: (
|
|
3385
|
+
builder: (yargs25) => yargs25.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
2835
3386
|
handler: () => {
|
|
2836
|
-
|
|
3387
|
+
yargs9.help();
|
|
2837
3388
|
}
|
|
2838
3389
|
};
|
|
2839
3390
|
|
|
2840
3391
|
// src/commands/context/commands/enrichment.ts
|
|
2841
|
-
import
|
|
3392
|
+
import yargs10 from "yargs";
|
|
2842
3393
|
|
|
2843
3394
|
// src/commands/context/commands/enrichment/get.ts
|
|
2844
3395
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
2845
3396
|
var EnrichmentGetModule = {
|
|
2846
3397
|
command: "get <id>",
|
|
2847
3398
|
describe: "Fetch an enrichment category and its values",
|
|
2848
|
-
builder: (
|
|
3399
|
+
builder: (yargs25) => withFormatOptions(
|
|
2849
3400
|
withConfiguration(
|
|
2850
3401
|
withApiOptions(
|
|
2851
3402
|
withProjectOptions(
|
|
2852
|
-
|
|
3403
|
+
yargs25.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
2853
3404
|
)
|
|
2854
3405
|
)
|
|
2855
3406
|
)
|
|
@@ -2874,7 +3425,7 @@ var EnrichmentListModule = {
|
|
|
2874
3425
|
command: "list",
|
|
2875
3426
|
describe: "List enrichments",
|
|
2876
3427
|
aliases: ["ls"],
|
|
2877
|
-
builder: (
|
|
3428
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
2878
3429
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2879
3430
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2880
3431
|
const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -2975,11 +3526,11 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
2975
3526
|
var EnrichmentPullModule = {
|
|
2976
3527
|
command: "pull <directory>",
|
|
2977
3528
|
describe: "Pulls all enrichments to local files in a directory",
|
|
2978
|
-
builder: (
|
|
3529
|
+
builder: (yargs25) => withConfiguration(
|
|
2979
3530
|
withApiOptions(
|
|
2980
3531
|
withProjectOptions(
|
|
2981
3532
|
withDiffOptions(
|
|
2982
|
-
|
|
3533
|
+
yargs25.positional("directory", {
|
|
2983
3534
|
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.",
|
|
2984
3535
|
type: "string"
|
|
2985
3536
|
}).option("format", {
|
|
@@ -3054,11 +3605,11 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
|
|
|
3054
3605
|
var EnrichmentPushModule = {
|
|
3055
3606
|
command: "push <directory>",
|
|
3056
3607
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
3057
|
-
builder: (
|
|
3608
|
+
builder: (yargs25) => withConfiguration(
|
|
3058
3609
|
withApiOptions(
|
|
3059
3610
|
withProjectOptions(
|
|
3060
3611
|
withDiffOptions(
|
|
3061
|
-
|
|
3612
|
+
yargs25.positional("directory", {
|
|
3062
3613
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
3063
3614
|
type: "string"
|
|
3064
3615
|
}).option("what-if", {
|
|
@@ -3122,10 +3673,10 @@ var EnrichmentRemoveModule = {
|
|
|
3122
3673
|
command: "remove <id>",
|
|
3123
3674
|
aliases: ["delete", "rm"],
|
|
3124
3675
|
describe: "Delete an enrichment category and its values",
|
|
3125
|
-
builder: (
|
|
3676
|
+
builder: (yargs25) => withConfiguration(
|
|
3126
3677
|
withApiOptions(
|
|
3127
3678
|
withProjectOptions(
|
|
3128
|
-
|
|
3679
|
+
yargs25.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
3129
3680
|
)
|
|
3130
3681
|
)
|
|
3131
3682
|
),
|
|
@@ -3141,14 +3692,14 @@ var EnrichmentModule = {
|
|
|
3141
3692
|
command: "enrichment <command>",
|
|
3142
3693
|
aliases: ["enr"],
|
|
3143
3694
|
describe: "Commands for Context enrichments",
|
|
3144
|
-
builder: (
|
|
3695
|
+
builder: (yargs25) => yargs25.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
3145
3696
|
handler: () => {
|
|
3146
|
-
|
|
3697
|
+
yargs10.help();
|
|
3147
3698
|
}
|
|
3148
3699
|
};
|
|
3149
3700
|
|
|
3150
3701
|
// src/commands/context/commands/manifest.ts
|
|
3151
|
-
import
|
|
3702
|
+
import yargs11 from "yargs";
|
|
3152
3703
|
|
|
3153
3704
|
// src/commands/context/commands/manifest/get.ts
|
|
3154
3705
|
import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -3159,10 +3710,10 @@ var ManifestGetModule = {
|
|
|
3159
3710
|
command: "get [output]",
|
|
3160
3711
|
aliases: ["dl", "download"],
|
|
3161
3712
|
describe: "Download the Uniform Context manifest for a project",
|
|
3162
|
-
builder: (
|
|
3713
|
+
builder: (yargs25) => withConfiguration(
|
|
3163
3714
|
withApiOptions(
|
|
3164
3715
|
withProjectOptions(
|
|
3165
|
-
|
|
3716
|
+
yargs25.option("preview", {
|
|
3166
3717
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
3167
3718
|
default: false,
|
|
3168
3719
|
type: "boolean",
|
|
@@ -3224,7 +3775,7 @@ import { exit as exit2 } from "process";
|
|
|
3224
3775
|
var ManifestPublishModule = {
|
|
3225
3776
|
command: "publish",
|
|
3226
3777
|
describe: "Publish the Uniform Context manifest for a project",
|
|
3227
|
-
builder: (
|
|
3778
|
+
builder: (yargs25) => withConfiguration(withApiOptions(withProjectOptions(yargs25))),
|
|
3228
3779
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
3229
3780
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3230
3781
|
try {
|
|
@@ -3257,25 +3808,25 @@ var ManifestModule = {
|
|
|
3257
3808
|
command: "manifest <command>",
|
|
3258
3809
|
describe: "Commands for context manifests",
|
|
3259
3810
|
aliases: ["man"],
|
|
3260
|
-
builder: (
|
|
3811
|
+
builder: (yargs25) => yargs25.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
3261
3812
|
handler: () => {
|
|
3262
|
-
|
|
3813
|
+
yargs11.help();
|
|
3263
3814
|
}
|
|
3264
3815
|
};
|
|
3265
3816
|
|
|
3266
3817
|
// src/commands/context/commands/quirk.ts
|
|
3267
|
-
import
|
|
3818
|
+
import yargs12 from "yargs";
|
|
3268
3819
|
|
|
3269
3820
|
// src/commands/context/commands/quirk/get.ts
|
|
3270
3821
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
3271
3822
|
var QuirkGetModule = {
|
|
3272
3823
|
command: "get <id>",
|
|
3273
3824
|
describe: "Fetch a quirk",
|
|
3274
|
-
builder: (
|
|
3825
|
+
builder: (yargs25) => withConfiguration(
|
|
3275
3826
|
withFormatOptions(
|
|
3276
3827
|
withApiOptions(
|
|
3277
3828
|
withProjectOptions(
|
|
3278
|
-
|
|
3829
|
+
yargs25.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
3279
3830
|
)
|
|
3280
3831
|
)
|
|
3281
3832
|
)
|
|
@@ -3299,11 +3850,11 @@ var QuirkListModule = {
|
|
|
3299
3850
|
command: "list",
|
|
3300
3851
|
describe: "List quirks",
|
|
3301
3852
|
aliases: ["ls"],
|
|
3302
|
-
builder: (
|
|
3853
|
+
builder: (yargs25) => withConfiguration(
|
|
3303
3854
|
withFormatOptions(
|
|
3304
3855
|
withApiOptions(
|
|
3305
3856
|
withProjectOptions(
|
|
3306
|
-
|
|
3857
|
+
yargs25.option("withIntegrations", {
|
|
3307
3858
|
alias: ["i"],
|
|
3308
3859
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
3309
3860
|
type: "boolean"
|
|
@@ -3360,11 +3911,11 @@ function createQuirkEngineDataSource({
|
|
|
3360
3911
|
var QuirkPullModule = {
|
|
3361
3912
|
command: "pull <directory>",
|
|
3362
3913
|
describe: "Pulls all quirks to local files in a directory",
|
|
3363
|
-
builder: (
|
|
3914
|
+
builder: (yargs25) => withConfiguration(
|
|
3364
3915
|
withApiOptions(
|
|
3365
3916
|
withProjectOptions(
|
|
3366
3917
|
withDiffOptions(
|
|
3367
|
-
|
|
3918
|
+
yargs25.positional("directory", {
|
|
3368
3919
|
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.",
|
|
3369
3920
|
type: "string"
|
|
3370
3921
|
}).option("format", {
|
|
@@ -3439,11 +3990,11 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
3439
3990
|
var QuirkPushModule = {
|
|
3440
3991
|
command: "push <directory>",
|
|
3441
3992
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
3442
|
-
builder: (
|
|
3993
|
+
builder: (yargs25) => withConfiguration(
|
|
3443
3994
|
withApiOptions(
|
|
3444
3995
|
withProjectOptions(
|
|
3445
3996
|
withDiffOptions(
|
|
3446
|
-
|
|
3997
|
+
yargs25.positional("directory", {
|
|
3447
3998
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
3448
3999
|
type: "string"
|
|
3449
4000
|
}).option("what-if", {
|
|
@@ -3507,10 +4058,10 @@ var QuirkRemoveModule = {
|
|
|
3507
4058
|
command: "remove <id>",
|
|
3508
4059
|
aliases: ["delete", "rm"],
|
|
3509
4060
|
describe: "Delete a quirk",
|
|
3510
|
-
builder: (
|
|
4061
|
+
builder: (yargs25) => withConfiguration(
|
|
3511
4062
|
withApiOptions(
|
|
3512
4063
|
withProjectOptions(
|
|
3513
|
-
|
|
4064
|
+
yargs25.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
3514
4065
|
)
|
|
3515
4066
|
)
|
|
3516
4067
|
),
|
|
@@ -3527,10 +4078,10 @@ var QuirkUpdateModule = {
|
|
|
3527
4078
|
command: "update <filename>",
|
|
3528
4079
|
aliases: ["put"],
|
|
3529
4080
|
describe: "Insert or update a quirk",
|
|
3530
|
-
builder: (
|
|
4081
|
+
builder: (yargs25) => withConfiguration(
|
|
3531
4082
|
withApiOptions(
|
|
3532
4083
|
withProjectOptions(
|
|
3533
|
-
|
|
4084
|
+
yargs25.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
3534
4085
|
)
|
|
3535
4086
|
)
|
|
3536
4087
|
),
|
|
@@ -3547,25 +4098,25 @@ var QuirkModule = {
|
|
|
3547
4098
|
command: "quirk <command>",
|
|
3548
4099
|
aliases: ["qk"],
|
|
3549
4100
|
describe: "Commands for Context quirks",
|
|
3550
|
-
builder: (
|
|
4101
|
+
builder: (yargs25) => yargs25.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
3551
4102
|
handler: () => {
|
|
3552
|
-
|
|
4103
|
+
yargs12.help();
|
|
3553
4104
|
}
|
|
3554
4105
|
};
|
|
3555
4106
|
|
|
3556
4107
|
// src/commands/context/commands/signal.ts
|
|
3557
|
-
import
|
|
4108
|
+
import yargs13 from "yargs";
|
|
3558
4109
|
|
|
3559
4110
|
// src/commands/context/commands/signal/get.ts
|
|
3560
4111
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
3561
4112
|
var SignalGetModule = {
|
|
3562
4113
|
command: "get <id>",
|
|
3563
4114
|
describe: "Fetch a signal",
|
|
3564
|
-
builder: (
|
|
4115
|
+
builder: (yargs25) => withConfiguration(
|
|
3565
4116
|
withFormatOptions(
|
|
3566
4117
|
withApiOptions(
|
|
3567
4118
|
withProjectOptions(
|
|
3568
|
-
|
|
4119
|
+
yargs25.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
3569
4120
|
)
|
|
3570
4121
|
)
|
|
3571
4122
|
)
|
|
@@ -3589,7 +4140,7 @@ var SignalListModule = {
|
|
|
3589
4140
|
command: "list",
|
|
3590
4141
|
describe: "List signals",
|
|
3591
4142
|
aliases: ["ls"],
|
|
3592
|
-
builder: (
|
|
4143
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
3593
4144
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3594
4145
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3595
4146
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -3638,11 +4189,11 @@ function createSignalEngineDataSource({
|
|
|
3638
4189
|
var SignalPullModule = {
|
|
3639
4190
|
command: "pull <directory>",
|
|
3640
4191
|
describe: "Pulls all signals to local files in a directory",
|
|
3641
|
-
builder: (
|
|
4192
|
+
builder: (yargs25) => withConfiguration(
|
|
3642
4193
|
withApiOptions(
|
|
3643
4194
|
withProjectOptions(
|
|
3644
4195
|
withDiffOptions(
|
|
3645
|
-
|
|
4196
|
+
yargs25.positional("directory", {
|
|
3646
4197
|
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.",
|
|
3647
4198
|
type: "string"
|
|
3648
4199
|
}).option("format", {
|
|
@@ -3717,11 +4268,11 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
3717
4268
|
var SignalPushModule = {
|
|
3718
4269
|
command: "push <directory>",
|
|
3719
4270
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
3720
|
-
builder: (
|
|
4271
|
+
builder: (yargs25) => withConfiguration(
|
|
3721
4272
|
withApiOptions(
|
|
3722
4273
|
withProjectOptions(
|
|
3723
4274
|
withDiffOptions(
|
|
3724
|
-
|
|
4275
|
+
yargs25.positional("directory", {
|
|
3725
4276
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
3726
4277
|
type: "string"
|
|
3727
4278
|
}).option("what-if", {
|
|
@@ -3785,10 +4336,10 @@ var SignalRemoveModule = {
|
|
|
3785
4336
|
command: "remove <id>",
|
|
3786
4337
|
aliases: ["delete", "rm"],
|
|
3787
4338
|
describe: "Delete a signal",
|
|
3788
|
-
builder: (
|
|
4339
|
+
builder: (yargs25) => withConfiguration(
|
|
3789
4340
|
withApiOptions(
|
|
3790
4341
|
withProjectOptions(
|
|
3791
|
-
|
|
4342
|
+
yargs25.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
3792
4343
|
)
|
|
3793
4344
|
)
|
|
3794
4345
|
),
|
|
@@ -3805,10 +4356,10 @@ var SignalUpdateModule = {
|
|
|
3805
4356
|
command: "update <filename>",
|
|
3806
4357
|
aliases: ["put"],
|
|
3807
4358
|
describe: "Insert or update a signal",
|
|
3808
|
-
builder: (
|
|
4359
|
+
builder: (yargs25) => withConfiguration(
|
|
3809
4360
|
withApiOptions(
|
|
3810
4361
|
withProjectOptions(
|
|
3811
|
-
|
|
4362
|
+
yargs25.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
3812
4363
|
)
|
|
3813
4364
|
)
|
|
3814
4365
|
),
|
|
@@ -3825,25 +4376,25 @@ var SignalModule = {
|
|
|
3825
4376
|
command: "signal <command>",
|
|
3826
4377
|
aliases: ["sig"],
|
|
3827
4378
|
describe: "Commands for Context signals",
|
|
3828
|
-
builder: (
|
|
4379
|
+
builder: (yargs25) => yargs25.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
3829
4380
|
handler: () => {
|
|
3830
|
-
|
|
4381
|
+
yargs13.help();
|
|
3831
4382
|
}
|
|
3832
4383
|
};
|
|
3833
4384
|
|
|
3834
4385
|
// src/commands/context/commands/test.ts
|
|
3835
|
-
import
|
|
4386
|
+
import yargs14 from "yargs";
|
|
3836
4387
|
|
|
3837
4388
|
// src/commands/context/commands/test/get.ts
|
|
3838
4389
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
3839
4390
|
var TestGetModule = {
|
|
3840
4391
|
command: "get <id>",
|
|
3841
4392
|
describe: "Fetch a test",
|
|
3842
|
-
builder: (
|
|
4393
|
+
builder: (yargs25) => withConfiguration(
|
|
3843
4394
|
withFormatOptions(
|
|
3844
4395
|
withApiOptions(
|
|
3845
4396
|
withProjectOptions(
|
|
3846
|
-
|
|
4397
|
+
yargs25.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
3847
4398
|
)
|
|
3848
4399
|
)
|
|
3849
4400
|
)
|
|
@@ -3867,7 +4418,7 @@ var TestListModule = {
|
|
|
3867
4418
|
command: "list",
|
|
3868
4419
|
describe: "List tests",
|
|
3869
4420
|
aliases: ["ls"],
|
|
3870
|
-
builder: (
|
|
4421
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
3871
4422
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3872
4423
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3873
4424
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -3916,11 +4467,11 @@ function createTestEngineDataSource({
|
|
|
3916
4467
|
var TestPullModule = {
|
|
3917
4468
|
command: "pull <directory>",
|
|
3918
4469
|
describe: "Pulls all tests to local files in a directory",
|
|
3919
|
-
builder: (
|
|
4470
|
+
builder: (yargs25) => withConfiguration(
|
|
3920
4471
|
withApiOptions(
|
|
3921
4472
|
withProjectOptions(
|
|
3922
4473
|
withDiffOptions(
|
|
3923
|
-
|
|
4474
|
+
yargs25.positional("directory", {
|
|
3924
4475
|
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.",
|
|
3925
4476
|
type: "string"
|
|
3926
4477
|
}).option("format", {
|
|
@@ -3995,11 +4546,11 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
3995
4546
|
var TestPushModule = {
|
|
3996
4547
|
command: "push <directory>",
|
|
3997
4548
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
3998
|
-
builder: (
|
|
4549
|
+
builder: (yargs25) => withConfiguration(
|
|
3999
4550
|
withApiOptions(
|
|
4000
4551
|
withProjectOptions(
|
|
4001
4552
|
withDiffOptions(
|
|
4002
|
-
|
|
4553
|
+
yargs25.positional("directory", {
|
|
4003
4554
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
4004
4555
|
type: "string"
|
|
4005
4556
|
}).option("what-if", {
|
|
@@ -4063,10 +4614,10 @@ var TestRemoveModule = {
|
|
|
4063
4614
|
command: "remove <id>",
|
|
4064
4615
|
aliases: ["delete", "rm"],
|
|
4065
4616
|
describe: "Delete a test",
|
|
4066
|
-
builder: (
|
|
4617
|
+
builder: (yargs25) => withConfiguration(
|
|
4067
4618
|
withApiOptions(
|
|
4068
4619
|
withProjectOptions(
|
|
4069
|
-
|
|
4620
|
+
yargs25.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
4070
4621
|
)
|
|
4071
4622
|
)
|
|
4072
4623
|
),
|
|
@@ -4083,9 +4634,9 @@ var TestUpdateModule = {
|
|
|
4083
4634
|
command: "update <filename>",
|
|
4084
4635
|
aliases: ["put"],
|
|
4085
4636
|
describe: "Insert or update a test",
|
|
4086
|
-
builder: (
|
|
4637
|
+
builder: (yargs25) => withConfiguration(
|
|
4087
4638
|
withApiOptions(
|
|
4088
|
-
withProjectOptions(
|
|
4639
|
+
withProjectOptions(yargs25.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
4089
4640
|
)
|
|
4090
4641
|
),
|
|
4091
4642
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -4100,9 +4651,9 @@ var TestUpdateModule = {
|
|
|
4100
4651
|
var TestModule = {
|
|
4101
4652
|
command: "test <command>",
|
|
4102
4653
|
describe: "Commands for Context A/B tests",
|
|
4103
|
-
builder: (
|
|
4654
|
+
builder: (yargs25) => yargs25.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
4104
4655
|
handler: () => {
|
|
4105
|
-
|
|
4656
|
+
yargs14.help();
|
|
4106
4657
|
}
|
|
4107
4658
|
};
|
|
4108
4659
|
|
|
@@ -4111,9 +4662,9 @@ var ContextCommand = {
|
|
|
4111
4662
|
command: "context <command>",
|
|
4112
4663
|
aliases: ["ctx"],
|
|
4113
4664
|
describe: "Uniform Context commands",
|
|
4114
|
-
builder: (
|
|
4665
|
+
builder: (yargs25) => yargs25.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
4115
4666
|
handler: () => {
|
|
4116
|
-
|
|
4667
|
+
yargs15.showHelp();
|
|
4117
4668
|
}
|
|
4118
4669
|
};
|
|
4119
4670
|
|
|
@@ -4160,7 +4711,7 @@ var package_default = {
|
|
|
4160
4711
|
"@thi.ng/mime": "^2.2.23",
|
|
4161
4712
|
"@uniformdev/canvas": "workspace:*",
|
|
4162
4713
|
"@uniformdev/context": "workspace:*",
|
|
4163
|
-
"@uniformdev/files
|
|
4714
|
+
"@uniformdev/files": "workspace:*",
|
|
4164
4715
|
"@uniformdev/project-map": "workspace:*",
|
|
4165
4716
|
"@uniformdev/redirect": "workspace:*",
|
|
4166
4717
|
colorette: "2.0.20",
|
|
@@ -5183,10 +5734,10 @@ var NewMeshCmd = {
|
|
|
5183
5734
|
};
|
|
5184
5735
|
|
|
5185
5736
|
// src/commands/optimize/index.ts
|
|
5186
|
-
import
|
|
5737
|
+
import yargs17 from "yargs";
|
|
5187
5738
|
|
|
5188
5739
|
// src/commands/optimize/manifest.ts
|
|
5189
|
-
import
|
|
5740
|
+
import yargs16 from "yargs";
|
|
5190
5741
|
|
|
5191
5742
|
// src/commands/optimize/manifest/download.ts
|
|
5192
5743
|
import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
|
|
@@ -5201,7 +5752,7 @@ var UniformBaseUrl = "https://uniform.app";
|
|
|
5201
5752
|
var module = {
|
|
5202
5753
|
command: "download [output]",
|
|
5203
5754
|
describe: "Download intent manifest",
|
|
5204
|
-
builder: (
|
|
5755
|
+
builder: (yargs25) => yargs25.option("apiKey", {
|
|
5205
5756
|
alias: "k",
|
|
5206
5757
|
demandOption: true,
|
|
5207
5758
|
string: true,
|
|
@@ -5302,10 +5853,10 @@ var module2 = {
|
|
|
5302
5853
|
command: "manifest <command>",
|
|
5303
5854
|
describe: "Intent manifest commands",
|
|
5304
5855
|
builder: () => {
|
|
5305
|
-
return
|
|
5856
|
+
return yargs16.command(download_default);
|
|
5306
5857
|
},
|
|
5307
5858
|
handler: () => {
|
|
5308
|
-
|
|
5859
|
+
yargs16.showHelp();
|
|
5309
5860
|
}
|
|
5310
5861
|
};
|
|
5311
5862
|
var manifest_default = module2;
|
|
@@ -5316,29 +5867,29 @@ var OptimizeCommand = {
|
|
|
5316
5867
|
aliases: ["opt"],
|
|
5317
5868
|
describe: "Uniform Optimize commands",
|
|
5318
5869
|
builder: () => {
|
|
5319
|
-
return
|
|
5870
|
+
return yargs17.command(manifest_default);
|
|
5320
5871
|
},
|
|
5321
5872
|
handler: () => {
|
|
5322
|
-
|
|
5873
|
+
yargs17.showHelp();
|
|
5323
5874
|
}
|
|
5324
5875
|
};
|
|
5325
5876
|
|
|
5326
5877
|
// src/commands/project-map/index.ts
|
|
5327
|
-
import
|
|
5878
|
+
import yargs20 from "yargs";
|
|
5328
5879
|
|
|
5329
5880
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
5330
|
-
import
|
|
5881
|
+
import yargs18 from "yargs";
|
|
5331
5882
|
|
|
5332
5883
|
// src/commands/project-map/commands/ProjectMapDefinition/get.ts
|
|
5333
5884
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
5334
5885
|
var ProjectMapDefinitionGetModule = {
|
|
5335
5886
|
command: "get <id>",
|
|
5336
5887
|
describe: "Fetch a project map",
|
|
5337
|
-
builder: (
|
|
5888
|
+
builder: (yargs25) => withFormatOptions(
|
|
5338
5889
|
withConfiguration(
|
|
5339
5890
|
withApiOptions(
|
|
5340
5891
|
withProjectOptions(
|
|
5341
|
-
|
|
5892
|
+
yargs25.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
5342
5893
|
)
|
|
5343
5894
|
)
|
|
5344
5895
|
)
|
|
@@ -5362,7 +5913,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
5362
5913
|
command: "list",
|
|
5363
5914
|
describe: "List of project maps",
|
|
5364
5915
|
aliases: ["ls"],
|
|
5365
|
-
builder: (
|
|
5916
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
5366
5917
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5367
5918
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5368
5919
|
const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5419,11 +5970,11 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
5419
5970
|
var ProjectMapDefinitionPullModule = {
|
|
5420
5971
|
command: "pull <directory>",
|
|
5421
5972
|
describe: "Pulls all project maps to local files in a directory",
|
|
5422
|
-
builder: (
|
|
5973
|
+
builder: (yargs25) => withConfiguration(
|
|
5423
5974
|
withApiOptions(
|
|
5424
5975
|
withProjectOptions(
|
|
5425
5976
|
withDiffOptions(
|
|
5426
|
-
|
|
5977
|
+
yargs25.positional("directory", {
|
|
5427
5978
|
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.",
|
|
5428
5979
|
type: "string"
|
|
5429
5980
|
}).option("format", {
|
|
@@ -5498,11 +6049,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
|
|
|
5498
6049
|
var ProjectMapDefinitionPushModule = {
|
|
5499
6050
|
command: "push <directory>",
|
|
5500
6051
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
5501
|
-
builder: (
|
|
6052
|
+
builder: (yargs25) => withConfiguration(
|
|
5502
6053
|
withApiOptions(
|
|
5503
6054
|
withProjectOptions(
|
|
5504
6055
|
withDiffOptions(
|
|
5505
|
-
|
|
6056
|
+
yargs25.positional("directory", {
|
|
5506
6057
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
5507
6058
|
type: "string"
|
|
5508
6059
|
}).option("what-if", {
|
|
@@ -5566,9 +6117,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
5566
6117
|
command: "remove <id>",
|
|
5567
6118
|
aliases: ["delete", "rm"],
|
|
5568
6119
|
describe: "Delete a project map",
|
|
5569
|
-
builder: (
|
|
6120
|
+
builder: (yargs25) => withConfiguration(
|
|
5570
6121
|
withApiOptions(
|
|
5571
|
-
withProjectOptions(
|
|
6122
|
+
withProjectOptions(yargs25.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
5572
6123
|
)
|
|
5573
6124
|
),
|
|
5574
6125
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -5584,10 +6135,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
5584
6135
|
command: "update <filename>",
|
|
5585
6136
|
aliases: ["put"],
|
|
5586
6137
|
describe: "Insert or update a project map",
|
|
5587
|
-
builder: (
|
|
6138
|
+
builder: (yargs25) => withConfiguration(
|
|
5588
6139
|
withApiOptions(
|
|
5589
6140
|
withProjectOptions(
|
|
5590
|
-
|
|
6141
|
+
yargs25.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
5591
6142
|
)
|
|
5592
6143
|
)
|
|
5593
6144
|
),
|
|
@@ -5603,25 +6154,25 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
5603
6154
|
var ProjectMapDefinitionModule = {
|
|
5604
6155
|
command: "definition <command>",
|
|
5605
6156
|
describe: "Commands for ProjectMap Definitions",
|
|
5606
|
-
builder: (
|
|
6157
|
+
builder: (yargs25) => yargs25.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
5607
6158
|
handler: () => {
|
|
5608
|
-
|
|
6159
|
+
yargs18.help();
|
|
5609
6160
|
}
|
|
5610
6161
|
};
|
|
5611
6162
|
|
|
5612
6163
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
5613
|
-
import
|
|
6164
|
+
import yargs19 from "yargs";
|
|
5614
6165
|
|
|
5615
6166
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
5616
6167
|
import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
|
|
5617
6168
|
var ProjectMapNodeGetModule = {
|
|
5618
6169
|
command: "get <id> <projectMapId>",
|
|
5619
6170
|
describe: "Fetch a project map node",
|
|
5620
|
-
builder: (
|
|
6171
|
+
builder: (yargs25) => withConfiguration(
|
|
5621
6172
|
withFormatOptions(
|
|
5622
6173
|
withApiOptions(
|
|
5623
6174
|
withProjectOptions(
|
|
5624
|
-
|
|
6175
|
+
yargs25.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
5625
6176
|
)
|
|
5626
6177
|
)
|
|
5627
6178
|
)
|
|
@@ -5647,11 +6198,11 @@ var ProjectMapNodeListModule = {
|
|
|
5647
6198
|
command: "list <projectMapId>",
|
|
5648
6199
|
describe: "List project map nodes",
|
|
5649
6200
|
aliases: ["ls"],
|
|
5650
|
-
builder: (
|
|
6201
|
+
builder: (yargs25) => withConfiguration(
|
|
5651
6202
|
withFormatOptions(
|
|
5652
6203
|
withApiOptions(
|
|
5653
6204
|
withProjectOptions(
|
|
5654
|
-
|
|
6205
|
+
yargs25.positional("projectMapId", {
|
|
5655
6206
|
demandOption: true,
|
|
5656
6207
|
describe: "ProjectMap UUID to fetch from"
|
|
5657
6208
|
})
|
|
@@ -5722,11 +6273,11 @@ function createProjectMapNodeEngineDataSource({
|
|
|
5722
6273
|
var ProjectMapNodePullModule = {
|
|
5723
6274
|
command: "pull <directory>",
|
|
5724
6275
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
5725
|
-
builder: (
|
|
6276
|
+
builder: (yargs25) => withConfiguration(
|
|
5726
6277
|
withApiOptions(
|
|
5727
6278
|
withProjectOptions(
|
|
5728
6279
|
withDiffOptions(
|
|
5729
|
-
|
|
6280
|
+
yargs25.positional("directory", {
|
|
5730
6281
|
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.",
|
|
5731
6282
|
type: "string"
|
|
5732
6283
|
}).option("format", {
|
|
@@ -5805,11 +6356,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
|
|
|
5805
6356
|
var ProjectMapNodePushModule = {
|
|
5806
6357
|
command: "push <directory>",
|
|
5807
6358
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
5808
|
-
builder: (
|
|
6359
|
+
builder: (yargs25) => withConfiguration(
|
|
5809
6360
|
withApiOptions(
|
|
5810
6361
|
withProjectOptions(
|
|
5811
6362
|
withDiffOptions(
|
|
5812
|
-
|
|
6363
|
+
yargs25.positional("directory", {
|
|
5813
6364
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
5814
6365
|
type: "string"
|
|
5815
6366
|
}).option("what-if", {
|
|
@@ -5882,10 +6433,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
5882
6433
|
command: "remove <id> <projectMapId>",
|
|
5883
6434
|
aliases: ["delete", "rm"],
|
|
5884
6435
|
describe: "Delete a project map node",
|
|
5885
|
-
builder: (
|
|
6436
|
+
builder: (yargs25) => withConfiguration(
|
|
5886
6437
|
withApiOptions(
|
|
5887
6438
|
withProjectOptions(
|
|
5888
|
-
|
|
6439
|
+
yargs25.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
5889
6440
|
)
|
|
5890
6441
|
)
|
|
5891
6442
|
),
|
|
@@ -5902,10 +6453,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
5902
6453
|
command: "update <filename> <projectMapId>",
|
|
5903
6454
|
aliases: ["put"],
|
|
5904
6455
|
describe: "Insert or update a project map node",
|
|
5905
|
-
builder: (
|
|
6456
|
+
builder: (yargs25) => withConfiguration(
|
|
5906
6457
|
withApiOptions(
|
|
5907
6458
|
withProjectOptions(
|
|
5908
|
-
|
|
6459
|
+
yargs25.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
5909
6460
|
)
|
|
5910
6461
|
)
|
|
5911
6462
|
),
|
|
@@ -5921,9 +6472,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
5921
6472
|
var ProjectMapNodeModule = {
|
|
5922
6473
|
command: "node <command>",
|
|
5923
6474
|
describe: "Commands for ProjectMap Nodes",
|
|
5924
|
-
builder: (
|
|
6475
|
+
builder: (yargs25) => yargs25.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
5925
6476
|
handler: () => {
|
|
5926
|
-
|
|
6477
|
+
yargs19.help();
|
|
5927
6478
|
}
|
|
5928
6479
|
};
|
|
5929
6480
|
|
|
@@ -5932,28 +6483,28 @@ var ProjectMapCommand = {
|
|
|
5932
6483
|
command: "project-map <command>",
|
|
5933
6484
|
aliases: ["prm"],
|
|
5934
6485
|
describe: "Uniform ProjectMap commands",
|
|
5935
|
-
builder: (
|
|
6486
|
+
builder: (yargs25) => yargs25.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
5936
6487
|
handler: () => {
|
|
5937
|
-
|
|
6488
|
+
yargs20.showHelp();
|
|
5938
6489
|
}
|
|
5939
6490
|
};
|
|
5940
6491
|
|
|
5941
6492
|
// src/commands/redirect/index.ts
|
|
5942
|
-
import
|
|
6493
|
+
import yargs22 from "yargs";
|
|
5943
6494
|
|
|
5944
6495
|
// src/commands/redirect/commands/redirect.ts
|
|
5945
|
-
import
|
|
6496
|
+
import yargs21 from "yargs";
|
|
5946
6497
|
|
|
5947
6498
|
// src/commands/redirect/commands/RedirectDefinition/get.ts
|
|
5948
6499
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
5949
6500
|
var RedirectDefinitionGetModule = {
|
|
5950
6501
|
command: "get <id>",
|
|
5951
6502
|
describe: "Fetch a redirect",
|
|
5952
|
-
builder: (
|
|
6503
|
+
builder: (yargs25) => withConfiguration(
|
|
5953
6504
|
withFormatOptions(
|
|
5954
6505
|
withApiOptions(
|
|
5955
6506
|
withProjectOptions(
|
|
5956
|
-
|
|
6507
|
+
yargs25.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
5957
6508
|
)
|
|
5958
6509
|
)
|
|
5959
6510
|
)
|
|
@@ -5977,7 +6528,7 @@ var RedirectDefinitionListModule = {
|
|
|
5977
6528
|
command: "list",
|
|
5978
6529
|
describe: "List of redirects",
|
|
5979
6530
|
aliases: ["ls"],
|
|
5980
|
-
builder: (
|
|
6531
|
+
builder: (yargs25) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs25)))),
|
|
5981
6532
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5982
6533
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5983
6534
|
const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6043,11 +6594,11 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
6043
6594
|
var RedirectDefinitionPullModule = {
|
|
6044
6595
|
command: "pull <directory>",
|
|
6045
6596
|
describe: "Pulls all redirects to local files in a directory",
|
|
6046
|
-
builder: (
|
|
6597
|
+
builder: (yargs25) => withConfiguration(
|
|
6047
6598
|
withApiOptions(
|
|
6048
6599
|
withProjectOptions(
|
|
6049
6600
|
withDiffOptions(
|
|
6050
|
-
|
|
6601
|
+
yargs25.positional("directory", {
|
|
6051
6602
|
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.",
|
|
6052
6603
|
type: "string"
|
|
6053
6604
|
}).option("format", {
|
|
@@ -6123,11 +6674,11 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
|
|
|
6123
6674
|
var RedirectDefinitionPushModule = {
|
|
6124
6675
|
command: "push <directory>",
|
|
6125
6676
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
6126
|
-
builder: (
|
|
6677
|
+
builder: (yargs25) => withConfiguration(
|
|
6127
6678
|
withApiOptions(
|
|
6128
6679
|
withProjectOptions(
|
|
6129
6680
|
withDiffOptions(
|
|
6130
|
-
|
|
6681
|
+
yargs25.positional("directory", {
|
|
6131
6682
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
6132
6683
|
type: "string"
|
|
6133
6684
|
}).option("what-if", {
|
|
@@ -6191,9 +6742,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
6191
6742
|
command: "remove <id>",
|
|
6192
6743
|
aliases: ["delete", "rm"],
|
|
6193
6744
|
describe: "Delete a redirect",
|
|
6194
|
-
builder: (
|
|
6745
|
+
builder: (yargs25) => withConfiguration(
|
|
6195
6746
|
withApiOptions(
|
|
6196
|
-
withProjectOptions(
|
|
6747
|
+
withProjectOptions(yargs25.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
6197
6748
|
)
|
|
6198
6749
|
),
|
|
6199
6750
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -6209,10 +6760,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
6209
6760
|
command: "update <filename>",
|
|
6210
6761
|
aliases: ["put"],
|
|
6211
6762
|
describe: "Insert or update a redirect",
|
|
6212
|
-
builder: (
|
|
6763
|
+
builder: (yargs25) => withConfiguration(
|
|
6213
6764
|
withApiOptions(
|
|
6214
6765
|
withProjectOptions(
|
|
6215
|
-
|
|
6766
|
+
yargs25.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
6216
6767
|
)
|
|
6217
6768
|
)
|
|
6218
6769
|
),
|
|
@@ -6228,9 +6779,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
6228
6779
|
var RedirectDefinitionModule = {
|
|
6229
6780
|
command: "definition <command>",
|
|
6230
6781
|
describe: "Commands for Redirect Definitions",
|
|
6231
|
-
builder: (
|
|
6782
|
+
builder: (yargs25) => yargs25.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
6232
6783
|
handler: () => {
|
|
6233
|
-
|
|
6784
|
+
yargs21.help();
|
|
6234
6785
|
}
|
|
6235
6786
|
};
|
|
6236
6787
|
|
|
@@ -6239,24 +6790,24 @@ var RedirectCommand = {
|
|
|
6239
6790
|
command: "redirect <command>",
|
|
6240
6791
|
aliases: ["red"],
|
|
6241
6792
|
describe: "Uniform Redirect commands",
|
|
6242
|
-
builder: (
|
|
6793
|
+
builder: (yargs25) => yargs25.command(RedirectDefinitionModule).demandCommand(),
|
|
6243
6794
|
handler: () => {
|
|
6244
|
-
|
|
6795
|
+
yargs22.showHelp();
|
|
6245
6796
|
}
|
|
6246
6797
|
};
|
|
6247
6798
|
|
|
6248
6799
|
// src/commands/sync/index.ts
|
|
6249
|
-
import
|
|
6800
|
+
import yargs23 from "yargs";
|
|
6250
6801
|
|
|
6251
6802
|
// src/commands/sync/commands/pull.ts
|
|
6252
6803
|
var SyncPullModule = {
|
|
6253
6804
|
command: "pull",
|
|
6254
6805
|
describe: "Pulls whole project to local files in a directory",
|
|
6255
|
-
builder: (
|
|
6806
|
+
builder: (yargs25) => withConfiguration(
|
|
6256
6807
|
withApiOptions(
|
|
6257
6808
|
withProjectOptions(
|
|
6258
6809
|
withDiffOptions(
|
|
6259
|
-
|
|
6810
|
+
yargs25.option("what-if", {
|
|
6260
6811
|
alias: ["w"],
|
|
6261
6812
|
describe: "What-if mode reports what would be done but changes no files",
|
|
6262
6813
|
default: false,
|
|
@@ -6327,11 +6878,11 @@ var getFormat = (entityType, config2) => {
|
|
|
6327
6878
|
var SyncPushModule = {
|
|
6328
6879
|
command: "push",
|
|
6329
6880
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
6330
|
-
builder: (
|
|
6881
|
+
builder: (yargs25) => withConfiguration(
|
|
6331
6882
|
withApiOptions(
|
|
6332
6883
|
withProjectOptions(
|
|
6333
6884
|
withDiffOptions(
|
|
6334
|
-
|
|
6885
|
+
yargs25.option("what-if", {
|
|
6335
6886
|
alias: ["w"],
|
|
6336
6887
|
describe: "What-if mode reports what would be done but changes nothing",
|
|
6337
6888
|
default: false,
|
|
@@ -6409,9 +6960,9 @@ var getFormat2 = (entityType, config2) => {
|
|
|
6409
6960
|
var SyncCommand = {
|
|
6410
6961
|
command: "sync <command>",
|
|
6411
6962
|
describe: "Uniform Sync commands",
|
|
6412
|
-
builder: (
|
|
6963
|
+
builder: (yargs25) => yargs25.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
6413
6964
|
handler: () => {
|
|
6414
|
-
|
|
6965
|
+
yargs23.showHelp();
|
|
6415
6966
|
}
|
|
6416
6967
|
};
|
|
6417
6968
|
|
|
@@ -6527,7 +7078,7 @@ First found was: v${firstVersion}`;
|
|
|
6527
7078
|
|
|
6528
7079
|
// src/index.ts
|
|
6529
7080
|
dotenv.config();
|
|
6530
|
-
var yarggery =
|
|
7081
|
+
var yarggery = yargs24(hideBin(process.argv));
|
|
6531
7082
|
var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
|
|
6532
7083
|
var configuration = loadConfig(inlineConfigurationFilePath || null);
|
|
6533
7084
|
yarggery.option("verbose", {
|