@uniformdev/cli 19.165.2-alpha.0 → 19.167.2-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
withFormatOptions,
|
|
16
16
|
withProjectOptions,
|
|
17
17
|
withTeamOptions
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DDTNSIMF.mjs";
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
import * as dotenv from "dotenv";
|
|
22
|
-
import
|
|
22
|
+
import yargs35 from "yargs";
|
|
23
23
|
import { hideBin } from "yargs/helpers";
|
|
24
24
|
|
|
25
25
|
// src/commands/canvas/index.ts
|
|
26
|
-
import
|
|
26
|
+
import yargs16 from "yargs";
|
|
27
27
|
|
|
28
28
|
// src/commands/canvas/commands/asset.ts
|
|
29
29
|
import yargs from "yargs";
|
|
@@ -62,8 +62,7 @@ async function createArraySyncEngineDataSource({
|
|
|
62
62
|
);
|
|
63
63
|
async function* getObjects() {
|
|
64
64
|
for (const item of Object.values(objectIndex)) {
|
|
65
|
-
if (typeof item === "object")
|
|
66
|
-
yield item;
|
|
65
|
+
if (typeof item === "object") yield item;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
function extractCurrent() {
|
|
@@ -242,8 +241,7 @@ async function syncEngine({
|
|
|
242
241
|
const targetItems = /* @__PURE__ */ new Map();
|
|
243
242
|
const deleteTracker = /* @__PURE__ */ new Set();
|
|
244
243
|
const processDelete = async (object) => {
|
|
245
|
-
if (deleteTracker.has(object))
|
|
246
|
-
return;
|
|
244
|
+
if (deleteTracker.has(object)) return;
|
|
247
245
|
deleteTracker.add(object);
|
|
248
246
|
if (!whatIf) {
|
|
249
247
|
try {
|
|
@@ -408,12 +406,12 @@ function createPublishStatusSyncEngineConsoleLogger(options) {
|
|
|
408
406
|
var AssetGetModule = {
|
|
409
407
|
command: "get <id>",
|
|
410
408
|
describe: "Get an asset",
|
|
411
|
-
builder: (
|
|
409
|
+
builder: (yargs36) => withConfiguration(
|
|
412
410
|
withFormatOptions(
|
|
413
411
|
withApiOptions(
|
|
414
412
|
withProjectOptions(
|
|
415
413
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
416
|
-
|
|
414
|
+
yargs36.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
417
415
|
)
|
|
418
416
|
)
|
|
419
417
|
)
|
|
@@ -434,7 +432,7 @@ import { UncachedAssetClient as UncachedAssetClient2 } from "@uniformdev/assets"
|
|
|
434
432
|
var AssetListModule = {
|
|
435
433
|
command: "list",
|
|
436
434
|
describe: "List assets",
|
|
437
|
-
builder: (
|
|
435
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
438
436
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
439
437
|
const fetch3 = nodeFetchProxy(proxy);
|
|
440
438
|
const client = new UncachedAssetClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -786,8 +784,8 @@ function prepCompositionForDisk(composition) {
|
|
|
786
784
|
delete prepped.state;
|
|
787
785
|
return prepped;
|
|
788
786
|
}
|
|
789
|
-
function withStateOptions(
|
|
790
|
-
return
|
|
787
|
+
function withStateOptions(yargs36, defaultState = "preview") {
|
|
788
|
+
return yargs36.option("state", {
|
|
791
789
|
type: "string",
|
|
792
790
|
describe: `State to fetch.`,
|
|
793
791
|
choices: ["preview", "published"],
|
|
@@ -854,11 +852,11 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
854
852
|
var AssetPullModule = {
|
|
855
853
|
command: "pull <directory>",
|
|
856
854
|
describe: "Pulls all assets to local files in a directory",
|
|
857
|
-
builder: (
|
|
855
|
+
builder: (yargs36) => withConfiguration(
|
|
858
856
|
withApiOptions(
|
|
859
857
|
withProjectOptions(
|
|
860
858
|
withDiffOptions(
|
|
861
|
-
|
|
859
|
+
yargs36.positional("directory", {
|
|
862
860
|
describe: "Directory to save the assets to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
863
861
|
type: "string"
|
|
864
862
|
}).option("format", {
|
|
@@ -976,11 +974,11 @@ import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
|
|
|
976
974
|
var AssetPushModule = {
|
|
977
975
|
command: "push <directory>",
|
|
978
976
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
979
|
-
builder: (
|
|
977
|
+
builder: (yargs36) => withConfiguration(
|
|
980
978
|
withApiOptions(
|
|
981
979
|
withProjectOptions(
|
|
982
980
|
withDiffOptions(
|
|
983
|
-
|
|
981
|
+
yargs36.positional("directory", {
|
|
984
982
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
985
983
|
type: "string"
|
|
986
984
|
}).option("what-if", {
|
|
@@ -1081,9 +1079,9 @@ var AssetRemoveModule = {
|
|
|
1081
1079
|
command: "remove <id>",
|
|
1082
1080
|
aliases: ["delete", "rm"],
|
|
1083
1081
|
describe: "Delete an asset",
|
|
1084
|
-
builder: (
|
|
1082
|
+
builder: (yargs36) => withConfiguration(
|
|
1085
1083
|
withApiOptions(
|
|
1086
|
-
withProjectOptions(
|
|
1084
|
+
withProjectOptions(yargs36.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
1087
1085
|
)
|
|
1088
1086
|
),
|
|
1089
1087
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -1099,10 +1097,10 @@ var AssetUpdateModule = {
|
|
|
1099
1097
|
command: "update <filename>",
|
|
1100
1098
|
aliases: ["put"],
|
|
1101
1099
|
describe: "Insert or update an asset",
|
|
1102
|
-
builder: (
|
|
1100
|
+
builder: (yargs36) => withConfiguration(
|
|
1103
1101
|
withApiOptions(
|
|
1104
1102
|
withProjectOptions(
|
|
1105
|
-
|
|
1103
|
+
yargs36.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
1106
1104
|
)
|
|
1107
1105
|
)
|
|
1108
1106
|
),
|
|
@@ -1118,7 +1116,7 @@ var AssetUpdateModule = {
|
|
|
1118
1116
|
var AssetModule = {
|
|
1119
1117
|
command: "asset <command>",
|
|
1120
1118
|
describe: "Commands for Assets",
|
|
1121
|
-
builder: (
|
|
1119
|
+
builder: (yargs36) => yargs36.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
1122
1120
|
handler: () => {
|
|
1123
1121
|
yargs.help();
|
|
1124
1122
|
}
|
|
@@ -1132,11 +1130,11 @@ import { UncachedCategoryClient } from "@uniformdev/canvas";
|
|
|
1132
1130
|
var CategoryGetModule = {
|
|
1133
1131
|
command: "get <id>",
|
|
1134
1132
|
describe: "Fetch a category",
|
|
1135
|
-
builder: (
|
|
1133
|
+
builder: (yargs36) => withConfiguration(
|
|
1136
1134
|
withFormatOptions(
|
|
1137
1135
|
withApiOptions(
|
|
1138
1136
|
withProjectOptions(
|
|
1139
|
-
|
|
1137
|
+
yargs36.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
1140
1138
|
)
|
|
1141
1139
|
)
|
|
1142
1140
|
)
|
|
@@ -1161,7 +1159,7 @@ var CategoryListModule = {
|
|
|
1161
1159
|
command: "list",
|
|
1162
1160
|
describe: "List categories",
|
|
1163
1161
|
aliases: ["ls"],
|
|
1164
|
-
builder: (
|
|
1162
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36.options({}))))),
|
|
1165
1163
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
1166
1164
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1167
1165
|
const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -1211,11 +1209,11 @@ function createCategoriesEngineDataSource({
|
|
|
1211
1209
|
var CategoryPullModule = {
|
|
1212
1210
|
command: "pull <directory>",
|
|
1213
1211
|
describe: "Pulls all categories to local files in a directory",
|
|
1214
|
-
builder: (
|
|
1212
|
+
builder: (yargs36) => withConfiguration(
|
|
1215
1213
|
withApiOptions(
|
|
1216
1214
|
withProjectOptions(
|
|
1217
1215
|
withDiffOptions(
|
|
1218
|
-
|
|
1216
|
+
yargs36.positional("directory", {
|
|
1219
1217
|
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.",
|
|
1220
1218
|
type: "string"
|
|
1221
1219
|
}).option("format", {
|
|
@@ -1293,11 +1291,11 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
|
|
|
1293
1291
|
var CategoryPushModule = {
|
|
1294
1292
|
command: "push <directory>",
|
|
1295
1293
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
1296
|
-
builder: (
|
|
1294
|
+
builder: (yargs36) => withConfiguration(
|
|
1297
1295
|
withApiOptions(
|
|
1298
1296
|
withProjectOptions(
|
|
1299
1297
|
withDiffOptions(
|
|
1300
|
-
|
|
1298
|
+
yargs36.positional("directory", {
|
|
1301
1299
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
1302
1300
|
type: "string"
|
|
1303
1301
|
}).option("what-if", {
|
|
@@ -1364,10 +1362,10 @@ var CategoryRemoveModule = {
|
|
|
1364
1362
|
command: "remove <id>",
|
|
1365
1363
|
aliases: ["delete", "rm"],
|
|
1366
1364
|
describe: "Delete a category",
|
|
1367
|
-
builder: (
|
|
1365
|
+
builder: (yargs36) => withConfiguration(
|
|
1368
1366
|
withApiOptions(
|
|
1369
1367
|
withProjectOptions(
|
|
1370
|
-
|
|
1368
|
+
yargs36.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
1371
1369
|
)
|
|
1372
1370
|
)
|
|
1373
1371
|
),
|
|
@@ -1384,10 +1382,10 @@ var CategoryUpdateModule = {
|
|
|
1384
1382
|
command: "update <filename>",
|
|
1385
1383
|
aliases: ["put"],
|
|
1386
1384
|
describe: "Insert or update a category",
|
|
1387
|
-
builder: (
|
|
1385
|
+
builder: (yargs36) => withConfiguration(
|
|
1388
1386
|
withApiOptions(
|
|
1389
1387
|
withProjectOptions(
|
|
1390
|
-
|
|
1388
|
+
yargs36.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
1391
1389
|
)
|
|
1392
1390
|
)
|
|
1393
1391
|
),
|
|
@@ -1404,7 +1402,7 @@ var CategoryModule = {
|
|
|
1404
1402
|
command: "category <command>",
|
|
1405
1403
|
aliases: ["cat"],
|
|
1406
1404
|
describe: "Commands for Canvas categories",
|
|
1407
|
-
builder: (
|
|
1405
|
+
builder: (yargs36) => yargs36.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
1408
1406
|
handler: () => {
|
|
1409
1407
|
yargs2.help();
|
|
1410
1408
|
}
|
|
@@ -1425,11 +1423,11 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
|
|
|
1425
1423
|
var ComponentGetModule = {
|
|
1426
1424
|
command: "get <id>",
|
|
1427
1425
|
describe: "Fetch a component definition",
|
|
1428
|
-
builder: (
|
|
1426
|
+
builder: (yargs36) => withConfiguration(
|
|
1429
1427
|
withFormatOptions(
|
|
1430
1428
|
withApiOptions(
|
|
1431
1429
|
withProjectOptions(
|
|
1432
|
-
|
|
1430
|
+
yargs36.positional("id", {
|
|
1433
1431
|
demandOption: true,
|
|
1434
1432
|
describe: "Component definition public ID to fetch"
|
|
1435
1433
|
})
|
|
@@ -1463,11 +1461,11 @@ var ComponentListModule = {
|
|
|
1463
1461
|
command: "list",
|
|
1464
1462
|
describe: "List component definitions",
|
|
1465
1463
|
aliases: ["ls"],
|
|
1466
|
-
builder: (
|
|
1464
|
+
builder: (yargs36) => withConfiguration(
|
|
1467
1465
|
withFormatOptions(
|
|
1468
1466
|
withApiOptions(
|
|
1469
1467
|
withProjectOptions(
|
|
1470
|
-
|
|
1468
|
+
yargs36.options({
|
|
1471
1469
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1472
1470
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
1473
1471
|
})
|
|
@@ -1523,11 +1521,11 @@ function createComponentDefinitionEngineDataSource({
|
|
|
1523
1521
|
var ComponentPullModule = {
|
|
1524
1522
|
command: "pull <directory>",
|
|
1525
1523
|
describe: "Pulls all component definitions to local files in a directory",
|
|
1526
|
-
builder: (
|
|
1524
|
+
builder: (yargs36) => withConfiguration(
|
|
1527
1525
|
withApiOptions(
|
|
1528
1526
|
withProjectOptions(
|
|
1529
1527
|
withDiffOptions(
|
|
1530
|
-
|
|
1528
|
+
yargs36.positional("directory", {
|
|
1531
1529
|
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.",
|
|
1532
1530
|
type: "string"
|
|
1533
1531
|
}).option("format", {
|
|
@@ -1606,11 +1604,11 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
|
|
|
1606
1604
|
var ComponentPushModule = {
|
|
1607
1605
|
command: "push <directory>",
|
|
1608
1606
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
1609
|
-
builder: (
|
|
1607
|
+
builder: (yargs36) => withConfiguration(
|
|
1610
1608
|
withApiOptions(
|
|
1611
1609
|
withProjectOptions(
|
|
1612
1610
|
withDiffOptions(
|
|
1613
|
-
|
|
1611
|
+
yargs36.positional("directory", {
|
|
1614
1612
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
1615
1613
|
type: "string"
|
|
1616
1614
|
}).option("what-if", {
|
|
@@ -1678,10 +1676,10 @@ var ComponentRemoveModule = {
|
|
|
1678
1676
|
command: "remove <id>",
|
|
1679
1677
|
aliases: ["delete", "rm"],
|
|
1680
1678
|
describe: "Delete a component definition",
|
|
1681
|
-
builder: (
|
|
1679
|
+
builder: (yargs36) => withConfiguration(
|
|
1682
1680
|
withApiOptions(
|
|
1683
1681
|
withProjectOptions(
|
|
1684
|
-
|
|
1682
|
+
yargs36.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
|
|
1685
1683
|
)
|
|
1686
1684
|
)
|
|
1687
1685
|
),
|
|
@@ -1698,10 +1696,10 @@ var ComponentUpdateModule = {
|
|
|
1698
1696
|
command: "update <filename>",
|
|
1699
1697
|
aliases: ["put"],
|
|
1700
1698
|
describe: "Insert or update a component definition",
|
|
1701
|
-
builder: (
|
|
1699
|
+
builder: (yargs36) => withConfiguration(
|
|
1702
1700
|
withApiOptions(
|
|
1703
1701
|
withProjectOptions(
|
|
1704
|
-
|
|
1702
|
+
yargs36.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
1705
1703
|
)
|
|
1706
1704
|
)
|
|
1707
1705
|
),
|
|
@@ -1718,7 +1716,7 @@ var ComponentModule = {
|
|
|
1718
1716
|
command: "component <command>",
|
|
1719
1717
|
aliases: ["def"],
|
|
1720
1718
|
describe: "Commands for Canvas component definitions",
|
|
1721
|
-
builder: (
|
|
1719
|
+
builder: (yargs36) => yargs36.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
1722
1720
|
handler: () => {
|
|
1723
1721
|
yargs3.help();
|
|
1724
1722
|
}
|
|
@@ -1732,12 +1730,12 @@ import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canva
|
|
|
1732
1730
|
var CompositionGetModule = {
|
|
1733
1731
|
command: "get <id>",
|
|
1734
1732
|
describe: "Fetch a composition",
|
|
1735
|
-
builder: (
|
|
1733
|
+
builder: (yargs36) => withFormatOptions(
|
|
1736
1734
|
withConfiguration(
|
|
1737
1735
|
withApiOptions(
|
|
1738
1736
|
withProjectOptions(
|
|
1739
1737
|
withStateOptions(
|
|
1740
|
-
|
|
1738
|
+
yargs36.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
|
|
1741
1739
|
resolvePatterns: {
|
|
1742
1740
|
type: "boolean",
|
|
1743
1741
|
default: false,
|
|
@@ -1762,6 +1760,11 @@ var CompositionGetModule = {
|
|
|
1762
1760
|
type: "boolean",
|
|
1763
1761
|
default: false,
|
|
1764
1762
|
describe: "Include diagnostics information when resolving data"
|
|
1763
|
+
},
|
|
1764
|
+
resolutionDepth: {
|
|
1765
|
+
type: "number",
|
|
1766
|
+
default: 1,
|
|
1767
|
+
describe: "Controls how many levels deep content references should be resolved"
|
|
1765
1768
|
}
|
|
1766
1769
|
})
|
|
1767
1770
|
)
|
|
@@ -1783,7 +1786,8 @@ var CompositionGetModule = {
|
|
|
1783
1786
|
resolveOverrides,
|
|
1784
1787
|
componentIDs,
|
|
1785
1788
|
resolveData,
|
|
1786
|
-
diagnostics
|
|
1789
|
+
diagnostics,
|
|
1790
|
+
resolutionDepth
|
|
1787
1791
|
}) => {
|
|
1788
1792
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1789
1793
|
const client = new UncachedCanvasClient7({ apiKey, edgeApiHost, apiHost, fetch: fetch3, projectId });
|
|
@@ -1795,7 +1799,8 @@ var CompositionGetModule = {
|
|
|
1795
1799
|
skipOverridesResolution: !resolveOverrides,
|
|
1796
1800
|
withComponentIDs: componentIDs,
|
|
1797
1801
|
skipDataResolution: !resolveData,
|
|
1798
|
-
diagnostics
|
|
1802
|
+
diagnostics: resolveData ? diagnostics : void 0,
|
|
1803
|
+
resolutionDepth: resolveData ? resolutionDepth : void 0
|
|
1799
1804
|
})
|
|
1800
1805
|
);
|
|
1801
1806
|
emitWithFormat(res, format, filename);
|
|
@@ -1814,12 +1819,12 @@ var CompositionListModule = {
|
|
|
1814
1819
|
command: "list",
|
|
1815
1820
|
describe: "List compositions",
|
|
1816
1821
|
aliases: ["ls"],
|
|
1817
|
-
builder: (
|
|
1822
|
+
builder: (yargs36) => withFormatOptions(
|
|
1818
1823
|
withConfiguration(
|
|
1819
1824
|
withApiOptions(
|
|
1820
1825
|
withProjectOptions(
|
|
1821
1826
|
withStateOptions(
|
|
1822
|
-
|
|
1827
|
+
yargs36.options({
|
|
1823
1828
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1824
1829
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
1825
1830
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -1866,6 +1871,7 @@ var CompositionListModule = {
|
|
|
1866
1871
|
filename,
|
|
1867
1872
|
onlyCompositions,
|
|
1868
1873
|
onlyPatterns,
|
|
1874
|
+
patternType,
|
|
1869
1875
|
project: projectId,
|
|
1870
1876
|
state,
|
|
1871
1877
|
resolvePatterns,
|
|
@@ -1879,6 +1885,7 @@ var CompositionListModule = {
|
|
|
1879
1885
|
offset,
|
|
1880
1886
|
search: search.length > 0 ? search : void 0,
|
|
1881
1887
|
pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
|
|
1888
|
+
patternType,
|
|
1882
1889
|
state: convertStateOption(state),
|
|
1883
1890
|
skipPatternResolution: !resolvePatterns,
|
|
1884
1891
|
withComponentIDs: componentIDs,
|
|
@@ -1892,12 +1899,12 @@ var CompositionListModule = {
|
|
|
1892
1899
|
var ComponentPatternListModule = {
|
|
1893
1900
|
...CompositionListModule,
|
|
1894
1901
|
describe: "List component patterns",
|
|
1895
|
-
builder: (
|
|
1902
|
+
builder: (yargs36) => withFormatOptions(
|
|
1896
1903
|
withConfiguration(
|
|
1897
1904
|
withApiOptions(
|
|
1898
1905
|
withProjectOptions(
|
|
1899
1906
|
withStateOptions(
|
|
1900
|
-
|
|
1907
|
+
yargs36.options({
|
|
1901
1908
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1902
1909
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
1903
1910
|
resolvePatterns: {
|
|
@@ -1917,6 +1924,11 @@ var ComponentPatternListModule = {
|
|
|
1917
1924
|
type: "boolean",
|
|
1918
1925
|
hidden: true
|
|
1919
1926
|
},
|
|
1927
|
+
patternType: {
|
|
1928
|
+
default: "component",
|
|
1929
|
+
choices: ["all", "component", "composition"],
|
|
1930
|
+
hidden: true
|
|
1931
|
+
},
|
|
1920
1932
|
componentIDs: {
|
|
1921
1933
|
alias: ["componentIDs"],
|
|
1922
1934
|
type: "boolean",
|
|
@@ -1944,6 +1956,7 @@ function createComponentInstanceEngineDataSource({
|
|
|
1944
1956
|
state,
|
|
1945
1957
|
onlyCompositions,
|
|
1946
1958
|
onlyPatterns,
|
|
1959
|
+
patternType,
|
|
1947
1960
|
...clientOptions
|
|
1948
1961
|
}) {
|
|
1949
1962
|
const stateId = convertStateOption(state);
|
|
@@ -1957,7 +1970,8 @@ function createComponentInstanceEngineDataSource({
|
|
|
1957
1970
|
state: stateId,
|
|
1958
1971
|
skipPatternResolution: true,
|
|
1959
1972
|
skipOverridesResolution: true,
|
|
1960
|
-
withComponentIDs: true
|
|
1973
|
+
withComponentIDs: true,
|
|
1974
|
+
patternType
|
|
1961
1975
|
})).compositions,
|
|
1962
1976
|
{ pageSize: 100 }
|
|
1963
1977
|
);
|
|
@@ -1987,11 +2001,11 @@ function createComponentInstanceEngineDataSource({
|
|
|
1987
2001
|
var CompositionPublishModule = {
|
|
1988
2002
|
command: "publish [ids]",
|
|
1989
2003
|
describe: "Publishes composition(s)",
|
|
1990
|
-
builder: (
|
|
2004
|
+
builder: (yargs36) => withConfiguration(
|
|
1991
2005
|
withApiOptions(
|
|
1992
2006
|
withProjectOptions(
|
|
1993
2007
|
withDiffOptions(
|
|
1994
|
-
|
|
2008
|
+
yargs36.positional("ids", {
|
|
1995
2009
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
1996
2010
|
type: "string"
|
|
1997
2011
|
}).option("all", {
|
|
@@ -2027,7 +2041,8 @@ var CompositionPublishModule = {
|
|
|
2027
2041
|
whatIf,
|
|
2028
2042
|
project: projectId,
|
|
2029
2043
|
onlyCompositions,
|
|
2030
|
-
onlyPatterns
|
|
2044
|
+
onlyPatterns,
|
|
2045
|
+
patternType
|
|
2031
2046
|
}) => {
|
|
2032
2047
|
if (!all && !ids || all && ids) {
|
|
2033
2048
|
console.error(`Specify --all or composition ID(s) to publish.`);
|
|
@@ -2041,14 +2056,16 @@ var CompositionPublishModule = {
|
|
|
2041
2056
|
state: "preview",
|
|
2042
2057
|
compositionIDs: compositionIDsArray,
|
|
2043
2058
|
onlyCompositions,
|
|
2044
|
-
onlyPatterns
|
|
2059
|
+
onlyPatterns,
|
|
2060
|
+
patternType
|
|
2045
2061
|
});
|
|
2046
2062
|
const target = createComponentInstanceEngineDataSource({
|
|
2047
2063
|
client,
|
|
2048
2064
|
state: "published",
|
|
2049
2065
|
compositionIDs: compositionIDsArray,
|
|
2050
2066
|
onlyCompositions,
|
|
2051
|
-
onlyPatterns
|
|
2067
|
+
onlyPatterns,
|
|
2068
|
+
patternType
|
|
2052
2069
|
});
|
|
2053
2070
|
await syncEngine({
|
|
2054
2071
|
source,
|
|
@@ -2065,11 +2082,11 @@ var CompositionPublishModule = {
|
|
|
2065
2082
|
var ComponentPatternPublishModule = {
|
|
2066
2083
|
...CompositionPublishModule,
|
|
2067
2084
|
describe: "Publishes component pattern(s)",
|
|
2068
|
-
builder: (
|
|
2085
|
+
builder: (yargs36) => withConfiguration(
|
|
2069
2086
|
withApiOptions(
|
|
2070
2087
|
withProjectOptions(
|
|
2071
2088
|
withDiffOptions(
|
|
2072
|
-
|
|
2089
|
+
yargs36.positional("ids", {
|
|
2073
2090
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2074
2091
|
type: "string"
|
|
2075
2092
|
}).option("all", {
|
|
@@ -2096,6 +2113,10 @@ var ComponentPatternPublishModule = {
|
|
|
2096
2113
|
default: true,
|
|
2097
2114
|
type: "boolean",
|
|
2098
2115
|
hidden: true
|
|
2116
|
+
}).option("patternType", {
|
|
2117
|
+
default: "component",
|
|
2118
|
+
choices: ["all", "component", "composition"],
|
|
2119
|
+
hidden: true
|
|
2099
2120
|
})
|
|
2100
2121
|
)
|
|
2101
2122
|
)
|
|
@@ -2109,12 +2130,12 @@ import { UncachedFileClient as UncachedFileClient3 } from "@uniformdev/files";
|
|
|
2109
2130
|
var CompositionPullModule = {
|
|
2110
2131
|
command: "pull <directory>",
|
|
2111
2132
|
describe: "Pulls all compositions to local files in a directory",
|
|
2112
|
-
builder: (
|
|
2133
|
+
builder: (yargs36) => withConfiguration(
|
|
2113
2134
|
withApiOptions(
|
|
2114
2135
|
withProjectOptions(
|
|
2115
2136
|
withStateOptions(
|
|
2116
2137
|
withDiffOptions(
|
|
2117
|
-
|
|
2138
|
+
yargs36.positional("directory", {
|
|
2118
2139
|
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.",
|
|
2119
2140
|
type: "string"
|
|
2120
2141
|
}).option("format", {
|
|
@@ -2157,6 +2178,7 @@ var CompositionPullModule = {
|
|
|
2157
2178
|
format,
|
|
2158
2179
|
onlyCompositions,
|
|
2159
2180
|
onlyPatterns,
|
|
2181
|
+
patternType = "all",
|
|
2160
2182
|
mode,
|
|
2161
2183
|
whatIf,
|
|
2162
2184
|
state,
|
|
@@ -2167,7 +2189,13 @@ var CompositionPullModule = {
|
|
|
2167
2189
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2168
2190
|
const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2169
2191
|
const fileClient = new UncachedFileClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2170
|
-
const source = createComponentInstanceEngineDataSource({
|
|
2192
|
+
const source = createComponentInstanceEngineDataSource({
|
|
2193
|
+
client,
|
|
2194
|
+
state,
|
|
2195
|
+
onlyCompositions,
|
|
2196
|
+
onlyPatterns,
|
|
2197
|
+
patternType
|
|
2198
|
+
});
|
|
2171
2199
|
const isPackage = isPathAPackageFile(directory);
|
|
2172
2200
|
let target;
|
|
2173
2201
|
if (isPackage) {
|
|
@@ -2217,12 +2245,12 @@ var CompositionPullModule = {
|
|
|
2217
2245
|
var ComponentPatternPullModule = {
|
|
2218
2246
|
...CompositionPullModule,
|
|
2219
2247
|
describe: "Pulls all component patterns to local files in a directory",
|
|
2220
|
-
builder: (
|
|
2248
|
+
builder: (yargs36) => withConfiguration(
|
|
2221
2249
|
withApiOptions(
|
|
2222
2250
|
withProjectOptions(
|
|
2223
2251
|
withStateOptions(
|
|
2224
2252
|
withDiffOptions(
|
|
2225
|
-
|
|
2253
|
+
yargs36.positional("directory", {
|
|
2226
2254
|
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.",
|
|
2227
2255
|
type: "string"
|
|
2228
2256
|
}).option("format", {
|
|
@@ -2237,6 +2265,10 @@ var ComponentPatternPullModule = {
|
|
|
2237
2265
|
default: true,
|
|
2238
2266
|
type: "boolean",
|
|
2239
2267
|
hidden: true
|
|
2268
|
+
}).option("patternType", {
|
|
2269
|
+
default: "component",
|
|
2270
|
+
choices: ["all", "component", "composition"],
|
|
2271
|
+
hidden: true
|
|
2240
2272
|
}).option("what-if", {
|
|
2241
2273
|
alias: ["w"],
|
|
2242
2274
|
describe: "What-if mode reports what would be done but changes no files",
|
|
@@ -2262,12 +2294,12 @@ import { UncachedFileClient as UncachedFileClient4 } from "@uniformdev/files";
|
|
|
2262
2294
|
var CompositionPushModule = {
|
|
2263
2295
|
command: "push <directory>",
|
|
2264
2296
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
2265
|
-
builder: (
|
|
2297
|
+
builder: (yargs36) => withConfiguration(
|
|
2266
2298
|
withApiOptions(
|
|
2267
2299
|
withProjectOptions(
|
|
2268
2300
|
withStateOptions(
|
|
2269
2301
|
withDiffOptions(
|
|
2270
|
-
|
|
2302
|
+
yargs36.positional("directory", {
|
|
2271
2303
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2272
2304
|
type: "string"
|
|
2273
2305
|
}).option("what-if", {
|
|
@@ -2307,6 +2339,7 @@ var CompositionPushModule = {
|
|
|
2307
2339
|
project: projectId,
|
|
2308
2340
|
onlyCompositions,
|
|
2309
2341
|
onlyPatterns,
|
|
2342
|
+
patternType,
|
|
2310
2343
|
diff: diffMode,
|
|
2311
2344
|
allowEmptySource
|
|
2312
2345
|
}) => {
|
|
@@ -2329,7 +2362,13 @@ var CompositionPushModule = {
|
|
|
2329
2362
|
selectDisplayName: selectDisplayName3
|
|
2330
2363
|
});
|
|
2331
2364
|
}
|
|
2332
|
-
const target = createComponentInstanceEngineDataSource({
|
|
2365
|
+
const target = createComponentInstanceEngineDataSource({
|
|
2366
|
+
client,
|
|
2367
|
+
state,
|
|
2368
|
+
onlyCompositions,
|
|
2369
|
+
onlyPatterns,
|
|
2370
|
+
patternType
|
|
2371
|
+
});
|
|
2333
2372
|
const fileClient = new UncachedFileClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2334
2373
|
await syncEngine({
|
|
2335
2374
|
source,
|
|
@@ -2357,12 +2396,12 @@ var CompositionPushModule = {
|
|
|
2357
2396
|
var ComponentPatternPushModule = {
|
|
2358
2397
|
...CompositionPushModule,
|
|
2359
2398
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
2360
|
-
builder: (
|
|
2399
|
+
builder: (yargs36) => withConfiguration(
|
|
2361
2400
|
withApiOptions(
|
|
2362
2401
|
withProjectOptions(
|
|
2363
2402
|
withStateOptions(
|
|
2364
2403
|
withDiffOptions(
|
|
2365
|
-
|
|
2404
|
+
yargs36.positional("directory", {
|
|
2366
2405
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
2367
2406
|
type: "string"
|
|
2368
2407
|
}).option("what-if", {
|
|
@@ -2382,6 +2421,10 @@ var ComponentPatternPushModule = {
|
|
|
2382
2421
|
default: true,
|
|
2383
2422
|
type: "boolean",
|
|
2384
2423
|
hidden: true
|
|
2424
|
+
}).option("patternType", {
|
|
2425
|
+
default: "component",
|
|
2426
|
+
choices: ["all", "component", "composition"],
|
|
2427
|
+
hidden: true
|
|
2385
2428
|
})
|
|
2386
2429
|
)
|
|
2387
2430
|
)
|
|
@@ -2396,10 +2439,10 @@ var CompositionRemoveModule = {
|
|
|
2396
2439
|
command: "remove <id>",
|
|
2397
2440
|
aliases: ["delete", "rm"],
|
|
2398
2441
|
describe: "Delete a composition",
|
|
2399
|
-
builder: (
|
|
2442
|
+
builder: (yargs36) => withConfiguration(
|
|
2400
2443
|
withApiOptions(
|
|
2401
2444
|
withProjectOptions(
|
|
2402
|
-
|
|
2445
|
+
yargs36.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
|
|
2403
2446
|
)
|
|
2404
2447
|
)
|
|
2405
2448
|
),
|
|
@@ -2417,15 +2460,18 @@ var ComponentPatternRemoveModule = {
|
|
|
2417
2460
|
};
|
|
2418
2461
|
|
|
2419
2462
|
// src/commands/canvas/commands/composition/unpublish.ts
|
|
2420
|
-
import {
|
|
2463
|
+
import {
|
|
2464
|
+
CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2,
|
|
2465
|
+
UncachedCanvasClient as UncachedCanvasClient13
|
|
2466
|
+
} from "@uniformdev/canvas";
|
|
2421
2467
|
import { diffJson as diffJson2 } from "diff";
|
|
2422
2468
|
var CompositionUnpublishModule = {
|
|
2423
2469
|
command: "unpublish [ids]",
|
|
2424
2470
|
describe: "Unpublish a composition(s)",
|
|
2425
|
-
builder: (
|
|
2471
|
+
builder: (yargs36) => withConfiguration(
|
|
2426
2472
|
withApiOptions(
|
|
2427
2473
|
withProjectOptions(
|
|
2428
|
-
|
|
2474
|
+
yargs36.positional("ids", {
|
|
2429
2475
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2430
2476
|
type: "string"
|
|
2431
2477
|
}).option("all", {
|
|
@@ -2459,6 +2505,7 @@ var CompositionUnpublishModule = {
|
|
|
2459
2505
|
all,
|
|
2460
2506
|
onlyCompositions,
|
|
2461
2507
|
onlyPatterns,
|
|
2508
|
+
patternType,
|
|
2462
2509
|
project: projectId,
|
|
2463
2510
|
whatIf
|
|
2464
2511
|
}) => {
|
|
@@ -2475,14 +2522,16 @@ var CompositionUnpublishModule = {
|
|
|
2475
2522
|
state: "published",
|
|
2476
2523
|
compositionIDs: compositionIDsArray,
|
|
2477
2524
|
onlyCompositions,
|
|
2478
|
-
onlyPatterns
|
|
2525
|
+
onlyPatterns,
|
|
2526
|
+
patternType
|
|
2479
2527
|
});
|
|
2480
2528
|
const target = createComponentInstanceEngineDataSource({
|
|
2481
2529
|
client,
|
|
2482
2530
|
state: "preview",
|
|
2483
2531
|
compositionIDs: compositionIDsArray,
|
|
2484
2532
|
onlyCompositions,
|
|
2485
|
-
onlyPatterns
|
|
2533
|
+
onlyPatterns,
|
|
2534
|
+
patternType
|
|
2486
2535
|
});
|
|
2487
2536
|
const actions = [];
|
|
2488
2537
|
const log = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
@@ -2517,15 +2566,15 @@ var CompositionUnpublishModule = {
|
|
|
2517
2566
|
var ComponentPatternUnpublishModule = {
|
|
2518
2567
|
command: "unpublish [ids]",
|
|
2519
2568
|
describe: "Unpublish a component pattern(s)",
|
|
2520
|
-
builder: (
|
|
2569
|
+
builder: (yargs36) => withConfiguration(
|
|
2521
2570
|
withApiOptions(
|
|
2522
2571
|
withProjectOptions(
|
|
2523
|
-
|
|
2572
|
+
yargs36.positional("ids", {
|
|
2524
2573
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2525
2574
|
type: "string"
|
|
2526
2575
|
}).option("all", {
|
|
2527
2576
|
alias: ["a"],
|
|
2528
|
-
describe: "Un-
|
|
2577
|
+
describe: "Un-publishes all compositions. Use compositionId to publish one instead.",
|
|
2529
2578
|
default: false,
|
|
2530
2579
|
type: "boolean"
|
|
2531
2580
|
}).option("what-if", {
|
|
@@ -2534,14 +2583,18 @@ var ComponentPatternUnpublishModule = {
|
|
|
2534
2583
|
default: false,
|
|
2535
2584
|
type: "boolean"
|
|
2536
2585
|
}).option("onlyCompositions", {
|
|
2537
|
-
describe: "Only publishing compositions and not component patterns",
|
|
2586
|
+
describe: "Only un-publishing compositions and not component patterns",
|
|
2538
2587
|
default: false,
|
|
2539
2588
|
type: "boolean"
|
|
2540
2589
|
}).option("onlyPatterns", {
|
|
2541
|
-
describe: "Only
|
|
2590
|
+
describe: "Only un-publishing component patterns and not compositions",
|
|
2542
2591
|
default: true,
|
|
2543
2592
|
type: "boolean",
|
|
2544
2593
|
hidden: true
|
|
2594
|
+
}).option("patternType", {
|
|
2595
|
+
default: "component",
|
|
2596
|
+
choices: ["all", "component", "composition"],
|
|
2597
|
+
hidden: true
|
|
2545
2598
|
})
|
|
2546
2599
|
)
|
|
2547
2600
|
)
|
|
@@ -2555,11 +2608,11 @@ var CompositionUpdateModule = {
|
|
|
2555
2608
|
command: "update <filename>",
|
|
2556
2609
|
aliases: ["put"],
|
|
2557
2610
|
describe: "Insert or update a composition",
|
|
2558
|
-
builder: (
|
|
2611
|
+
builder: (yargs36) => withConfiguration(
|
|
2559
2612
|
withApiOptions(
|
|
2560
2613
|
withProjectOptions(
|
|
2561
2614
|
withStateOptions(
|
|
2562
|
-
|
|
2615
|
+
yargs36.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
|
|
2563
2616
|
)
|
|
2564
2617
|
)
|
|
2565
2618
|
)
|
|
@@ -2581,9 +2634,8 @@ var ComponentPatternUpdateModule = {
|
|
|
2581
2634
|
// src/commands/canvas/commands/componentPattern.ts
|
|
2582
2635
|
var ComponentPatternModule = {
|
|
2583
2636
|
command: "component-pattern <command>",
|
|
2584
|
-
aliases: ["pattern"],
|
|
2585
2637
|
describe: "Commands for Canvas component patterns",
|
|
2586
|
-
builder: (
|
|
2638
|
+
builder: (yargs36) => yargs36.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
2587
2639
|
handler: () => {
|
|
2588
2640
|
yargs4.help();
|
|
2589
2641
|
}
|
|
@@ -2595,26 +2647,277 @@ var CompositionModule = {
|
|
|
2595
2647
|
command: "composition <command>",
|
|
2596
2648
|
describe: "Commands for Canvas compositions",
|
|
2597
2649
|
aliases: ["comp"],
|
|
2598
|
-
builder: (
|
|
2650
|
+
builder: (yargs36) => yargs36.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
2599
2651
|
handler: () => {
|
|
2600
2652
|
yargs5.help();
|
|
2601
2653
|
}
|
|
2602
2654
|
};
|
|
2603
2655
|
|
|
2604
|
-
// src/commands/canvas/commands/
|
|
2656
|
+
// src/commands/canvas/commands/compositionPattern.ts
|
|
2605
2657
|
import yargs6 from "yargs";
|
|
2606
2658
|
|
|
2659
|
+
// src/commands/canvas/commands/compositionPattern/get.ts
|
|
2660
|
+
var CompositionPatternGetModule = {
|
|
2661
|
+
...CompositionGetModule,
|
|
2662
|
+
describe: "Fetch a composition pattern"
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
// src/commands/canvas/commands/compositionPattern/list.ts
|
|
2666
|
+
var CompositionPatternListModule = {
|
|
2667
|
+
...CompositionListModule,
|
|
2668
|
+
describe: "List composition patterns",
|
|
2669
|
+
builder: (yargs36) => withFormatOptions(
|
|
2670
|
+
withConfiguration(
|
|
2671
|
+
withApiOptions(
|
|
2672
|
+
withProjectOptions(
|
|
2673
|
+
withStateOptions(
|
|
2674
|
+
yargs36.options({
|
|
2675
|
+
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2676
|
+
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2677
|
+
resolvePatterns: {
|
|
2678
|
+
type: "boolean",
|
|
2679
|
+
default: false,
|
|
2680
|
+
describe: "Resolve composition pattern references in the composition"
|
|
2681
|
+
},
|
|
2682
|
+
resolveOverrides: {
|
|
2683
|
+
type: "boolean",
|
|
2684
|
+
default: false,
|
|
2685
|
+
describe: "Resolves composition pattern overrides in the composition and removes override definition data"
|
|
2686
|
+
},
|
|
2687
|
+
onlyPatterns: {
|
|
2688
|
+
describe: "Only pulling composition patterns and not compositions",
|
|
2689
|
+
// This default differentiate this list command from composition list command
|
|
2690
|
+
default: true,
|
|
2691
|
+
type: "boolean",
|
|
2692
|
+
hidden: true
|
|
2693
|
+
},
|
|
2694
|
+
patternType: {
|
|
2695
|
+
default: "composition",
|
|
2696
|
+
choices: ["all", "component", "composition"],
|
|
2697
|
+
hidden: true
|
|
2698
|
+
},
|
|
2699
|
+
componentIDs: {
|
|
2700
|
+
alias: ["componentIDs"],
|
|
2701
|
+
type: "boolean",
|
|
2702
|
+
default: false,
|
|
2703
|
+
describe: "Include individual composition pattern UIDs"
|
|
2704
|
+
}
|
|
2705
|
+
})
|
|
2706
|
+
)
|
|
2707
|
+
)
|
|
2708
|
+
)
|
|
2709
|
+
)
|
|
2710
|
+
)
|
|
2711
|
+
};
|
|
2712
|
+
|
|
2713
|
+
// src/commands/canvas/commands/compositionPattern/publish.ts
|
|
2714
|
+
var CompositionPatternPublishModule = {
|
|
2715
|
+
...CompositionPublishModule,
|
|
2716
|
+
describe: "Publishes composition pattern(s)",
|
|
2717
|
+
builder: (yargs36) => withConfiguration(
|
|
2718
|
+
withApiOptions(
|
|
2719
|
+
withProjectOptions(
|
|
2720
|
+
withDiffOptions(
|
|
2721
|
+
yargs36.positional("ids", {
|
|
2722
|
+
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2723
|
+
type: "string"
|
|
2724
|
+
}).option("all", {
|
|
2725
|
+
alias: ["a"],
|
|
2726
|
+
describe: "Publishes all composition patterns. Use compositionId to publish one instead.",
|
|
2727
|
+
default: false,
|
|
2728
|
+
type: "boolean"
|
|
2729
|
+
}).option("what-if", {
|
|
2730
|
+
alias: ["w"],
|
|
2731
|
+
describe: "What-if mode reports what would be done but does not perform any un-publishing",
|
|
2732
|
+
default: false,
|
|
2733
|
+
type: "boolean"
|
|
2734
|
+
}).option("publishingState", {
|
|
2735
|
+
describe: 'Publishing state to update to. Can be "published" or "preview".',
|
|
2736
|
+
default: "published",
|
|
2737
|
+
type: "string",
|
|
2738
|
+
hidden: true
|
|
2739
|
+
}).option("onlyCompositions", {
|
|
2740
|
+
describe: "Only publishing compositions and not composition patterns",
|
|
2741
|
+
default: false,
|
|
2742
|
+
type: "boolean",
|
|
2743
|
+
hidden: true
|
|
2744
|
+
}).option("patternType", {
|
|
2745
|
+
default: "composition",
|
|
2746
|
+
choices: ["all", "component", "composition"],
|
|
2747
|
+
hidden: true
|
|
2748
|
+
}).option("onlyPatterns", {
|
|
2749
|
+
describe: "Only pulling composition patterns and not compositions",
|
|
2750
|
+
default: true,
|
|
2751
|
+
type: "boolean",
|
|
2752
|
+
hidden: true
|
|
2753
|
+
})
|
|
2754
|
+
)
|
|
2755
|
+
)
|
|
2756
|
+
)
|
|
2757
|
+
)
|
|
2758
|
+
};
|
|
2759
|
+
|
|
2760
|
+
// src/commands/canvas/commands/compositionPattern/pull.ts
|
|
2761
|
+
var CompositionPatternPullModule = {
|
|
2762
|
+
...CompositionPullModule,
|
|
2763
|
+
describe: "Pulls all composition patterns to local files in a directory",
|
|
2764
|
+
builder: (yargs36) => withConfiguration(
|
|
2765
|
+
withApiOptions(
|
|
2766
|
+
withProjectOptions(
|
|
2767
|
+
withStateOptions(
|
|
2768
|
+
withDiffOptions(
|
|
2769
|
+
yargs36.positional("directory", {
|
|
2770
|
+
describe: "Directory to save the composition patterns to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
2771
|
+
type: "string"
|
|
2772
|
+
}).option("format", {
|
|
2773
|
+
alias: ["f"],
|
|
2774
|
+
describe: "Output format",
|
|
2775
|
+
default: "yaml",
|
|
2776
|
+
choices: ["yaml", "json"],
|
|
2777
|
+
type: "string"
|
|
2778
|
+
}).option("onlyPatterns", {
|
|
2779
|
+
describe: "Only pulling composition patterns and not compositions",
|
|
2780
|
+
// This default differentiates this list command from composition list command
|
|
2781
|
+
default: true,
|
|
2782
|
+
type: "boolean",
|
|
2783
|
+
hidden: true
|
|
2784
|
+
}).option("patternType", {
|
|
2785
|
+
default: "composition",
|
|
2786
|
+
choices: ["all", "component", "composition"],
|
|
2787
|
+
hidden: true
|
|
2788
|
+
}).option("what-if", {
|
|
2789
|
+
alias: ["w"],
|
|
2790
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
2791
|
+
default: false,
|
|
2792
|
+
type: "boolean"
|
|
2793
|
+
}).option("mode", {
|
|
2794
|
+
alias: ["m"],
|
|
2795
|
+
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',
|
|
2796
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
2797
|
+
default: "mirror",
|
|
2798
|
+
type: "string"
|
|
2799
|
+
})
|
|
2800
|
+
)
|
|
2801
|
+
)
|
|
2802
|
+
)
|
|
2803
|
+
)
|
|
2804
|
+
)
|
|
2805
|
+
};
|
|
2806
|
+
|
|
2807
|
+
// src/commands/canvas/commands/compositionPattern/push.ts
|
|
2808
|
+
var CompositionPatternPushModule = {
|
|
2809
|
+
...CompositionPushModule,
|
|
2810
|
+
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
2811
|
+
builder: (yargs36) => withConfiguration(
|
|
2812
|
+
withApiOptions(
|
|
2813
|
+
withProjectOptions(
|
|
2814
|
+
withStateOptions(
|
|
2815
|
+
withDiffOptions(
|
|
2816
|
+
yargs36.positional("directory", {
|
|
2817
|
+
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
2818
|
+
type: "string"
|
|
2819
|
+
}).option("what-if", {
|
|
2820
|
+
alias: ["w"],
|
|
2821
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
2822
|
+
default: false,
|
|
2823
|
+
type: "boolean"
|
|
2824
|
+
}).option("mode", {
|
|
2825
|
+
alias: ["m"],
|
|
2826
|
+
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',
|
|
2827
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
2828
|
+
default: "mirror",
|
|
2829
|
+
type: "string"
|
|
2830
|
+
}).option("onlyPatterns", {
|
|
2831
|
+
describe: "Only pulling composition patterns and not compositions",
|
|
2832
|
+
// This default differentiate this list command from composition list command
|
|
2833
|
+
default: true,
|
|
2834
|
+
type: "boolean",
|
|
2835
|
+
hidden: true
|
|
2836
|
+
}).option("patternType", {
|
|
2837
|
+
default: "composition",
|
|
2838
|
+
choices: ["all", "component", "composition"],
|
|
2839
|
+
hidden: true
|
|
2840
|
+
})
|
|
2841
|
+
)
|
|
2842
|
+
)
|
|
2843
|
+
)
|
|
2844
|
+
)
|
|
2845
|
+
)
|
|
2846
|
+
};
|
|
2847
|
+
|
|
2848
|
+
// src/commands/canvas/commands/compositionPattern/remove.ts
|
|
2849
|
+
var CompositionPatternRemoveModule = {
|
|
2850
|
+
...CompositionRemoveModule,
|
|
2851
|
+
describe: "Delete a composition pattern"
|
|
2852
|
+
};
|
|
2853
|
+
|
|
2854
|
+
// src/commands/canvas/commands/compositionPattern/unpublish.ts
|
|
2855
|
+
var CompositionPatternUnpublishModule = {
|
|
2856
|
+
command: "unpublish [ids]",
|
|
2857
|
+
describe: "Unpublish a composition pattern(s)",
|
|
2858
|
+
builder: (yargs36) => withConfiguration(
|
|
2859
|
+
withApiOptions(
|
|
2860
|
+
withProjectOptions(
|
|
2861
|
+
yargs36.positional("ids", {
|
|
2862
|
+
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2863
|
+
type: "string"
|
|
2864
|
+
}).option("all", {
|
|
2865
|
+
alias: ["a"],
|
|
2866
|
+
describe: "Un-publishes all compositions. Use compositionId to publish one instead.",
|
|
2867
|
+
default: false,
|
|
2868
|
+
type: "boolean"
|
|
2869
|
+
}).option("what-if", {
|
|
2870
|
+
alias: ["w"],
|
|
2871
|
+
describe: "What-if mode reports what would be done but does not perform any publishing",
|
|
2872
|
+
default: false,
|
|
2873
|
+
type: "boolean"
|
|
2874
|
+
}).option("onlyCompositions", {
|
|
2875
|
+
describe: "Only un-publishing compositions and not composition patterns",
|
|
2876
|
+
default: false,
|
|
2877
|
+
type: "boolean",
|
|
2878
|
+
hidden: true
|
|
2879
|
+
}).option("onlyPatterns", {
|
|
2880
|
+
describe: "Only un-publishing composition patterns and not compositions",
|
|
2881
|
+
default: true,
|
|
2882
|
+
type: "boolean",
|
|
2883
|
+
hidden: true
|
|
2884
|
+
})
|
|
2885
|
+
)
|
|
2886
|
+
)
|
|
2887
|
+
),
|
|
2888
|
+
handler: CompositionUnpublishModule.handler
|
|
2889
|
+
};
|
|
2890
|
+
|
|
2891
|
+
// src/commands/canvas/commands/compositionPattern/update.ts
|
|
2892
|
+
var CompositionPatternUpdateModule = {
|
|
2893
|
+
...CompositionUpdateModule,
|
|
2894
|
+
describe: "Insert or update a composition pattern"
|
|
2895
|
+
};
|
|
2896
|
+
|
|
2897
|
+
// src/commands/canvas/commands/compositionPattern.ts
|
|
2898
|
+
var CompositionPatternModule = {
|
|
2899
|
+
command: "composition-pattern <command>",
|
|
2900
|
+
describe: "Commands for Canvas composition patterns",
|
|
2901
|
+
builder: (yargs36) => yargs36.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
2902
|
+
handler: () => {
|
|
2903
|
+
yargs6.help();
|
|
2904
|
+
}
|
|
2905
|
+
};
|
|
2906
|
+
|
|
2907
|
+
// src/commands/canvas/commands/contentType.ts
|
|
2908
|
+
import yargs7 from "yargs";
|
|
2909
|
+
|
|
2607
2910
|
// src/commands/canvas/commands/contentType/get.ts
|
|
2608
2911
|
import { ContentClient } from "@uniformdev/canvas";
|
|
2609
2912
|
var ContentTypeGetModule = {
|
|
2610
2913
|
command: "get <id>",
|
|
2611
2914
|
describe: "Get a content type",
|
|
2612
|
-
builder: (
|
|
2915
|
+
builder: (yargs36) => withConfiguration(
|
|
2613
2916
|
withFormatOptions(
|
|
2614
2917
|
withApiOptions(
|
|
2615
2918
|
withProjectOptions(
|
|
2616
2919
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2617
|
-
|
|
2920
|
+
yargs36.positional("id", { demandOption: true, describe: "Content type public ID to fetch" })
|
|
2618
2921
|
)
|
|
2619
2922
|
)
|
|
2620
2923
|
)
|
|
@@ -2636,7 +2939,7 @@ import { ContentClient as ContentClient2 } from "@uniformdev/canvas";
|
|
|
2636
2939
|
var ContentTypeListModule = {
|
|
2637
2940
|
command: "list",
|
|
2638
2941
|
describe: "List content types",
|
|
2639
|
-
builder: (
|
|
2942
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
2640
2943
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2641
2944
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2642
2945
|
const client = new ContentClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -2684,11 +2987,11 @@ function createContentTypeEngineDataSource({
|
|
|
2684
2987
|
var ContentTypePullModule = {
|
|
2685
2988
|
command: "pull <directory>",
|
|
2686
2989
|
describe: "Pulls all content types to local files in a directory",
|
|
2687
|
-
builder: (
|
|
2990
|
+
builder: (yargs36) => withConfiguration(
|
|
2688
2991
|
withApiOptions(
|
|
2689
2992
|
withProjectOptions(
|
|
2690
2993
|
withDiffOptions(
|
|
2691
|
-
|
|
2994
|
+
yargs36.positional("directory", {
|
|
2692
2995
|
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.",
|
|
2693
2996
|
type: "string"
|
|
2694
2997
|
}).option("format", {
|
|
@@ -2772,11 +3075,11 @@ import { ContentClient as ContentClient4 } from "@uniformdev/canvas";
|
|
|
2772
3075
|
var ContentTypePushModule = {
|
|
2773
3076
|
command: "push <directory>",
|
|
2774
3077
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
2775
|
-
builder: (
|
|
3078
|
+
builder: (yargs36) => withConfiguration(
|
|
2776
3079
|
withApiOptions(
|
|
2777
3080
|
withProjectOptions(
|
|
2778
3081
|
withDiffOptions(
|
|
2779
|
-
|
|
3082
|
+
yargs36.positional("directory", {
|
|
2780
3083
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
2781
3084
|
type: "string"
|
|
2782
3085
|
}).option("what-if", {
|
|
@@ -2849,10 +3152,10 @@ var ContentTypeRemoveModule = {
|
|
|
2849
3152
|
command: "remove <id>",
|
|
2850
3153
|
aliases: ["delete", "rm"],
|
|
2851
3154
|
describe: "Delete a content type",
|
|
2852
|
-
builder: (
|
|
3155
|
+
builder: (yargs36) => withConfiguration(
|
|
2853
3156
|
withApiOptions(
|
|
2854
3157
|
withProjectOptions(
|
|
2855
|
-
|
|
3158
|
+
yargs36.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
2856
3159
|
)
|
|
2857
3160
|
)
|
|
2858
3161
|
),
|
|
@@ -2869,10 +3172,10 @@ var ContentTypeUpdateModule = {
|
|
|
2869
3172
|
command: "update <filename>",
|
|
2870
3173
|
aliases: ["put"],
|
|
2871
3174
|
describe: "Insert or update a content type",
|
|
2872
|
-
builder: (
|
|
3175
|
+
builder: (yargs36) => withConfiguration(
|
|
2873
3176
|
withApiOptions(
|
|
2874
3177
|
withProjectOptions(
|
|
2875
|
-
|
|
3178
|
+
yargs36.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
2876
3179
|
)
|
|
2877
3180
|
)
|
|
2878
3181
|
),
|
|
@@ -2889,25 +3192,25 @@ var ContentTypeModule = {
|
|
|
2889
3192
|
command: "contenttype <command>",
|
|
2890
3193
|
aliases: ["ct"],
|
|
2891
3194
|
describe: "Commands for Content Types",
|
|
2892
|
-
builder: (
|
|
3195
|
+
builder: (yargs36) => yargs36.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
2893
3196
|
handler: () => {
|
|
2894
|
-
|
|
3197
|
+
yargs7.help();
|
|
2895
3198
|
}
|
|
2896
3199
|
};
|
|
2897
3200
|
|
|
2898
3201
|
// src/commands/canvas/commands/dataSource.ts
|
|
2899
|
-
import
|
|
3202
|
+
import yargs8 from "yargs";
|
|
2900
3203
|
|
|
2901
3204
|
// src/commands/canvas/commands/dataSource/get.ts
|
|
2902
3205
|
import { DataSourceClient } from "@uniformdev/canvas";
|
|
2903
3206
|
var DataSourceGetModule = {
|
|
2904
3207
|
command: "get <id>",
|
|
2905
3208
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
2906
|
-
builder: (
|
|
3209
|
+
builder: (yargs36) => withConfiguration(
|
|
2907
3210
|
withApiOptions(
|
|
2908
3211
|
withProjectOptions(
|
|
2909
3212
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2910
|
-
|
|
3213
|
+
yargs36.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
2911
3214
|
)
|
|
2912
3215
|
)
|
|
2913
3216
|
),
|
|
@@ -2925,10 +3228,10 @@ var DataSourceRemoveModule = {
|
|
|
2925
3228
|
command: "remove <id>",
|
|
2926
3229
|
aliases: ["delete", "rm"],
|
|
2927
3230
|
describe: "Delete a data source",
|
|
2928
|
-
builder: (
|
|
3231
|
+
builder: (yargs36) => withConfiguration(
|
|
2929
3232
|
withApiOptions(
|
|
2930
3233
|
withProjectOptions(
|
|
2931
|
-
|
|
3234
|
+
yargs36.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
2932
3235
|
)
|
|
2933
3236
|
)
|
|
2934
3237
|
),
|
|
@@ -2945,10 +3248,10 @@ var DataSourceUpdateModule = {
|
|
|
2945
3248
|
command: "update <dataSource>",
|
|
2946
3249
|
aliases: ["put"],
|
|
2947
3250
|
describe: "Insert or update a data source",
|
|
2948
|
-
builder: (
|
|
3251
|
+
builder: (yargs36) => withConfiguration(
|
|
2949
3252
|
withApiOptions(
|
|
2950
3253
|
withProjectOptions(
|
|
2951
|
-
|
|
3254
|
+
yargs36.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
2952
3255
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
2953
3256
|
type: "string",
|
|
2954
3257
|
demandOption: true
|
|
@@ -2968,14 +3271,14 @@ var DataSourceModule = {
|
|
|
2968
3271
|
command: "datasource <command>",
|
|
2969
3272
|
aliases: ["ds"],
|
|
2970
3273
|
describe: "Commands for Data Source definitions",
|
|
2971
|
-
builder: (
|
|
3274
|
+
builder: (yargs36) => yargs36.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
2972
3275
|
handler: () => {
|
|
2973
|
-
|
|
3276
|
+
yargs8.help();
|
|
2974
3277
|
}
|
|
2975
3278
|
};
|
|
2976
3279
|
|
|
2977
3280
|
// src/commands/canvas/commands/dataType.ts
|
|
2978
|
-
import
|
|
3281
|
+
import yargs9 from "yargs";
|
|
2979
3282
|
|
|
2980
3283
|
// src/commands/canvas/commands/dataType/get.ts
|
|
2981
3284
|
import { DataTypeClient } from "@uniformdev/canvas";
|
|
@@ -2983,12 +3286,12 @@ var DataTypeGetModule = {
|
|
|
2983
3286
|
command: "get <id>",
|
|
2984
3287
|
describe: "Get a data type",
|
|
2985
3288
|
aliases: ["ls"],
|
|
2986
|
-
builder: (
|
|
3289
|
+
builder: (yargs36) => withConfiguration(
|
|
2987
3290
|
withFormatOptions(
|
|
2988
3291
|
withApiOptions(
|
|
2989
3292
|
withProjectOptions(
|
|
2990
3293
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2991
|
-
|
|
3294
|
+
yargs36.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
2992
3295
|
)
|
|
2993
3296
|
)
|
|
2994
3297
|
)
|
|
@@ -3011,7 +3314,7 @@ var DataTypeListModule = {
|
|
|
3011
3314
|
command: "list",
|
|
3012
3315
|
describe: "List data types",
|
|
3013
3316
|
aliases: ["ls"],
|
|
3014
|
-
builder: (
|
|
3317
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
3015
3318
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3016
3319
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3017
3320
|
const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -3061,11 +3364,11 @@ function createDataTypeEngineDataSource({
|
|
|
3061
3364
|
var DataTypePullModule = {
|
|
3062
3365
|
command: "pull <directory>",
|
|
3063
3366
|
describe: "Pulls all data types to local files in a directory",
|
|
3064
|
-
builder: (
|
|
3367
|
+
builder: (yargs36) => withConfiguration(
|
|
3065
3368
|
withApiOptions(
|
|
3066
3369
|
withProjectOptions(
|
|
3067
3370
|
withDiffOptions(
|
|
3068
|
-
|
|
3371
|
+
yargs36.positional("directory", {
|
|
3069
3372
|
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.",
|
|
3070
3373
|
type: "string"
|
|
3071
3374
|
}).option("format", {
|
|
@@ -3149,11 +3452,11 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
|
|
|
3149
3452
|
var DataTypePushModule = {
|
|
3150
3453
|
command: "push <directory>",
|
|
3151
3454
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
3152
|
-
builder: (
|
|
3455
|
+
builder: (yargs36) => withConfiguration(
|
|
3153
3456
|
withApiOptions(
|
|
3154
3457
|
withProjectOptions(
|
|
3155
3458
|
withDiffOptions(
|
|
3156
|
-
|
|
3459
|
+
yargs36.positional("directory", {
|
|
3157
3460
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
3158
3461
|
type: "string"
|
|
3159
3462
|
}).option("what-if", {
|
|
@@ -3226,10 +3529,10 @@ var DataTypeRemoveModule = {
|
|
|
3226
3529
|
command: "remove <id>",
|
|
3227
3530
|
aliases: ["delete", "rm"],
|
|
3228
3531
|
describe: "Delete a data type",
|
|
3229
|
-
builder: (
|
|
3532
|
+
builder: (yargs36) => withConfiguration(
|
|
3230
3533
|
withApiOptions(
|
|
3231
3534
|
withProjectOptions(
|
|
3232
|
-
|
|
3535
|
+
yargs36.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
3233
3536
|
)
|
|
3234
3537
|
)
|
|
3235
3538
|
),
|
|
@@ -3246,10 +3549,10 @@ var DataTypeUpdateModule = {
|
|
|
3246
3549
|
command: "update <filename>",
|
|
3247
3550
|
aliases: ["put"],
|
|
3248
3551
|
describe: "Insert or update a data type",
|
|
3249
|
-
builder: (
|
|
3552
|
+
builder: (yargs36) => withConfiguration(
|
|
3250
3553
|
withApiOptions(
|
|
3251
3554
|
withProjectOptions(
|
|
3252
|
-
|
|
3555
|
+
yargs36.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
3253
3556
|
)
|
|
3254
3557
|
)
|
|
3255
3558
|
),
|
|
@@ -3266,27 +3569,43 @@ var DataTypeModule = {
|
|
|
3266
3569
|
command: "datatype <command>",
|
|
3267
3570
|
aliases: ["dt"],
|
|
3268
3571
|
describe: "Commands for Data Type definitions",
|
|
3269
|
-
builder: (
|
|
3572
|
+
builder: (yargs36) => yargs36.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
3270
3573
|
handler: () => {
|
|
3271
|
-
|
|
3574
|
+
yargs9.help();
|
|
3272
3575
|
}
|
|
3273
3576
|
};
|
|
3274
3577
|
|
|
3275
3578
|
// src/commands/canvas/commands/entry.ts
|
|
3276
|
-
import
|
|
3579
|
+
import yargs10 from "yargs";
|
|
3277
3580
|
|
|
3278
3581
|
// src/commands/canvas/commands/entry/get.ts
|
|
3279
3582
|
import { ContentClient as ContentClient7 } from "@uniformdev/canvas";
|
|
3280
3583
|
var EntryGetModule = {
|
|
3281
3584
|
command: "get <id>",
|
|
3282
3585
|
describe: "Get an entry",
|
|
3283
|
-
builder: (
|
|
3586
|
+
builder: (yargs36) => withConfiguration(
|
|
3284
3587
|
withFormatOptions(
|
|
3285
3588
|
withApiOptions(
|
|
3286
3589
|
withProjectOptions(
|
|
3287
3590
|
withStateOptions(
|
|
3288
3591
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3289
|
-
|
|
3592
|
+
yargs36.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
3593
|
+
resolveData: {
|
|
3594
|
+
type: "boolean",
|
|
3595
|
+
default: false,
|
|
3596
|
+
describe: "Resolve all data resources used by the entry"
|
|
3597
|
+
},
|
|
3598
|
+
diagnostics: {
|
|
3599
|
+
type: "boolean",
|
|
3600
|
+
default: false,
|
|
3601
|
+
describe: "Include diagnostics information when resolving data"
|
|
3602
|
+
},
|
|
3603
|
+
resolutionDepth: {
|
|
3604
|
+
type: "number",
|
|
3605
|
+
default: 1,
|
|
3606
|
+
describe: "Controls how many levels deep content references should be resolved"
|
|
3607
|
+
}
|
|
3608
|
+
}),
|
|
3290
3609
|
// for backwards compatibility, we default to the "published" state, unlike compositions
|
|
3291
3610
|
"published"
|
|
3292
3611
|
)
|
|
@@ -3303,7 +3622,10 @@ var EntryGetModule = {
|
|
|
3303
3622
|
format,
|
|
3304
3623
|
filename,
|
|
3305
3624
|
project: projectId,
|
|
3306
|
-
state
|
|
3625
|
+
state,
|
|
3626
|
+
resolveData,
|
|
3627
|
+
diagnostics,
|
|
3628
|
+
resolutionDepth
|
|
3307
3629
|
}) => {
|
|
3308
3630
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3309
3631
|
const client = new ContentClient7({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -3314,7 +3636,9 @@ var EntryGetModule = {
|
|
|
3314
3636
|
state: convertStateOption(state),
|
|
3315
3637
|
skipOverridesResolution: true,
|
|
3316
3638
|
skipPatternResolution: true,
|
|
3317
|
-
skipDataResolution:
|
|
3639
|
+
skipDataResolution: !resolveData,
|
|
3640
|
+
diagnostics: resolveData ? diagnostics : void 0,
|
|
3641
|
+
resolutionDepth: resolveData ? resolutionDepth : void 0
|
|
3318
3642
|
});
|
|
3319
3643
|
if (res.entries.length !== 1) {
|
|
3320
3644
|
throw new Error(`Entry with ID ${id} not found`);
|
|
@@ -3329,12 +3653,12 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
3329
3653
|
var EntryListModule = {
|
|
3330
3654
|
command: "list",
|
|
3331
3655
|
describe: "List entries",
|
|
3332
|
-
builder: (
|
|
3656
|
+
builder: (yargs36) => withConfiguration(
|
|
3333
3657
|
withFormatOptions(
|
|
3334
3658
|
withApiOptions(
|
|
3335
3659
|
withProjectOptions(
|
|
3336
3660
|
withStateOptions(
|
|
3337
|
-
|
|
3661
|
+
yargs36.options({
|
|
3338
3662
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3339
3663
|
limit: { describe: "Number of rows to fetch", type: "number", default: LEGACY_DEFAULT_LIMIT },
|
|
3340
3664
|
search: { describe: "Search query", type: "string", default: "" }
|
|
@@ -3435,11 +3759,11 @@ function createEntryEngineDataSource({
|
|
|
3435
3759
|
var EntryPublishModule = {
|
|
3436
3760
|
command: "publish [ids]",
|
|
3437
3761
|
describe: "Publishes entry(ies)",
|
|
3438
|
-
builder: (
|
|
3762
|
+
builder: (yargs36) => withConfiguration(
|
|
3439
3763
|
withApiOptions(
|
|
3440
3764
|
withProjectOptions(
|
|
3441
3765
|
withDiffOptions(
|
|
3442
|
-
|
|
3766
|
+
yargs36.positional("ids", {
|
|
3443
3767
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3444
3768
|
type: "string"
|
|
3445
3769
|
}).option("all", {
|
|
@@ -3494,12 +3818,12 @@ import { UncachedFileClient as UncachedFileClient5 } from "@uniformdev/files";
|
|
|
3494
3818
|
var EntryPullModule = {
|
|
3495
3819
|
command: "pull <directory>",
|
|
3496
3820
|
describe: "Pulls all entries to local files in a directory",
|
|
3497
|
-
builder: (
|
|
3821
|
+
builder: (yargs36) => withConfiguration(
|
|
3498
3822
|
withApiOptions(
|
|
3499
3823
|
withProjectOptions(
|
|
3500
3824
|
withStateOptions(
|
|
3501
3825
|
withDiffOptions(
|
|
3502
|
-
|
|
3826
|
+
yargs36.positional("directory", {
|
|
3503
3827
|
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.",
|
|
3504
3828
|
type: "string"
|
|
3505
3829
|
}).option("format", {
|
|
@@ -3599,12 +3923,12 @@ import { UncachedFileClient as UncachedFileClient6 } from "@uniformdev/files";
|
|
|
3599
3923
|
var EntryPushModule = {
|
|
3600
3924
|
command: "push <directory>",
|
|
3601
3925
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
3602
|
-
builder: (
|
|
3926
|
+
builder: (yargs36) => withConfiguration(
|
|
3603
3927
|
withApiOptions(
|
|
3604
3928
|
withProjectOptions(
|
|
3605
3929
|
withStateOptions(
|
|
3606
3930
|
withDiffOptions(
|
|
3607
|
-
|
|
3931
|
+
yargs36.positional("directory", {
|
|
3608
3932
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
3609
3933
|
type: "string"
|
|
3610
3934
|
}).option("what-if", {
|
|
@@ -3691,10 +4015,10 @@ var EntryRemoveModule = {
|
|
|
3691
4015
|
command: "remove <id>",
|
|
3692
4016
|
aliases: ["delete", "rm"],
|
|
3693
4017
|
describe: "Delete an entry",
|
|
3694
|
-
builder: (
|
|
4018
|
+
builder: (yargs36) => withConfiguration(
|
|
3695
4019
|
withApiOptions(
|
|
3696
4020
|
withProjectOptions(
|
|
3697
|
-
|
|
4021
|
+
yargs36.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
3698
4022
|
)
|
|
3699
4023
|
)
|
|
3700
4024
|
),
|
|
@@ -3711,10 +4035,10 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
3711
4035
|
var EntryUnpublishModule = {
|
|
3712
4036
|
command: "unpublish [ids]",
|
|
3713
4037
|
describe: "Unpublish an entry(ies)",
|
|
3714
|
-
builder: (
|
|
4038
|
+
builder: (yargs36) => withConfiguration(
|
|
3715
4039
|
withApiOptions(
|
|
3716
4040
|
withProjectOptions(
|
|
3717
|
-
|
|
4041
|
+
yargs36.positional("ids", {
|
|
3718
4042
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3719
4043
|
type: "string"
|
|
3720
4044
|
}).option("all", {
|
|
@@ -3787,11 +4111,11 @@ var EntryUpdateModule = {
|
|
|
3787
4111
|
command: "update <filename>",
|
|
3788
4112
|
aliases: ["put"],
|
|
3789
4113
|
describe: "Insert or update an entry",
|
|
3790
|
-
builder: (
|
|
4114
|
+
builder: (yargs36) => withConfiguration(
|
|
3791
4115
|
withApiOptions(
|
|
3792
4116
|
withProjectOptions(
|
|
3793
4117
|
withStateOptions(
|
|
3794
|
-
|
|
4118
|
+
yargs36.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
3795
4119
|
)
|
|
3796
4120
|
)
|
|
3797
4121
|
)
|
|
@@ -3808,27 +4132,27 @@ var EntryUpdateModule = {
|
|
|
3808
4132
|
var EntryModule = {
|
|
3809
4133
|
command: "entry <command>",
|
|
3810
4134
|
describe: "Commands for Entries",
|
|
3811
|
-
builder: (
|
|
4135
|
+
builder: (yargs36) => yargs36.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
3812
4136
|
handler: () => {
|
|
3813
|
-
|
|
4137
|
+
yargs10.help();
|
|
3814
4138
|
}
|
|
3815
4139
|
};
|
|
3816
4140
|
|
|
3817
4141
|
// src/commands/canvas/commands/entryPattern.ts
|
|
3818
|
-
import
|
|
4142
|
+
import yargs11 from "yargs";
|
|
3819
4143
|
|
|
3820
4144
|
// src/commands/canvas/commands/entryPattern/get.ts
|
|
3821
4145
|
import { ContentClient as ContentClient16 } from "@uniformdev/canvas";
|
|
3822
4146
|
var EntryPatternGetModule = {
|
|
3823
4147
|
command: "get <id>",
|
|
3824
4148
|
describe: "Get an entry pattern",
|
|
3825
|
-
builder: (
|
|
4149
|
+
builder: (yargs36) => withConfiguration(
|
|
3826
4150
|
withFormatOptions(
|
|
3827
4151
|
withApiOptions(
|
|
3828
4152
|
withProjectOptions(
|
|
3829
4153
|
withStateOptions(
|
|
3830
4154
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3831
|
-
|
|
4155
|
+
yargs36.positional("id", {
|
|
3832
4156
|
demandOption: true,
|
|
3833
4157
|
describe: "Entry pattern public ID to fetch"
|
|
3834
4158
|
}),
|
|
@@ -3863,8 +4187,8 @@ import { ContentClient as ContentClient17 } from "@uniformdev/canvas";
|
|
|
3863
4187
|
var EntryPatternListModule = {
|
|
3864
4188
|
command: "list",
|
|
3865
4189
|
describe: "List entry patterns",
|
|
3866
|
-
builder: (
|
|
3867
|
-
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(
|
|
4190
|
+
builder: (yargs36) => withConfiguration(
|
|
4191
|
+
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(yargs36, "published"))))
|
|
3868
4192
|
),
|
|
3869
4193
|
handler: async ({ apiHost, edgeApiHost, apiKey, proxy, format, filename, project: projectId, state }) => {
|
|
3870
4194
|
const fetch3 = nodeFetchProxy(proxy);
|
|
@@ -3887,11 +4211,11 @@ import { ContentClient as ContentClient18 } from "@uniformdev/canvas";
|
|
|
3887
4211
|
var EntryPatternPublishModule = {
|
|
3888
4212
|
command: "publish [ids]",
|
|
3889
4213
|
describe: "Publishes entry pattern(s)",
|
|
3890
|
-
builder: (
|
|
4214
|
+
builder: (yargs36) => withConfiguration(
|
|
3891
4215
|
withApiOptions(
|
|
3892
4216
|
withProjectOptions(
|
|
3893
4217
|
withDiffOptions(
|
|
3894
|
-
|
|
4218
|
+
yargs36.positional("ids", {
|
|
3895
4219
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3896
4220
|
type: "string"
|
|
3897
4221
|
}).option("all", {
|
|
@@ -3946,12 +4270,12 @@ import { UncachedFileClient as UncachedFileClient7 } from "@uniformdev/files";
|
|
|
3946
4270
|
var EntryPatternPullModule = {
|
|
3947
4271
|
command: "pull <directory>",
|
|
3948
4272
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
3949
|
-
builder: (
|
|
4273
|
+
builder: (yargs36) => withConfiguration(
|
|
3950
4274
|
withApiOptions(
|
|
3951
4275
|
withProjectOptions(
|
|
3952
4276
|
withStateOptions(
|
|
3953
4277
|
withDiffOptions(
|
|
3954
|
-
|
|
4278
|
+
yargs36.positional("directory", {
|
|
3955
4279
|
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.",
|
|
3956
4280
|
type: "string"
|
|
3957
4281
|
}).option("format", {
|
|
@@ -4051,12 +4375,12 @@ import { UncachedFileClient as UncachedFileClient8 } from "@uniformdev/files";
|
|
|
4051
4375
|
var EntryPatternPushModule = {
|
|
4052
4376
|
command: "push <directory>",
|
|
4053
4377
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
4054
|
-
builder: (
|
|
4378
|
+
builder: (yargs36) => withConfiguration(
|
|
4055
4379
|
withApiOptions(
|
|
4056
4380
|
withProjectOptions(
|
|
4057
4381
|
withStateOptions(
|
|
4058
4382
|
withDiffOptions(
|
|
4059
|
-
|
|
4383
|
+
yargs36.positional("directory", {
|
|
4060
4384
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
4061
4385
|
type: "string"
|
|
4062
4386
|
}).option("what-if", {
|
|
@@ -4143,10 +4467,10 @@ var EntryPatternRemoveModule = {
|
|
|
4143
4467
|
command: "remove <id>",
|
|
4144
4468
|
aliases: ["delete", "rm"],
|
|
4145
4469
|
describe: "Delete an entry pattern",
|
|
4146
|
-
builder: (
|
|
4470
|
+
builder: (yargs36) => withConfiguration(
|
|
4147
4471
|
withApiOptions(
|
|
4148
4472
|
withProjectOptions(
|
|
4149
|
-
|
|
4473
|
+
yargs36.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
4150
4474
|
)
|
|
4151
4475
|
)
|
|
4152
4476
|
),
|
|
@@ -4163,10 +4487,10 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
4163
4487
|
var EntryPatternUnpublishModule = {
|
|
4164
4488
|
command: "unpublish [ids]",
|
|
4165
4489
|
describe: "Unpublish an entry patterns",
|
|
4166
|
-
builder: (
|
|
4490
|
+
builder: (yargs36) => withConfiguration(
|
|
4167
4491
|
withApiOptions(
|
|
4168
4492
|
withProjectOptions(
|
|
4169
|
-
|
|
4493
|
+
yargs36.positional("ids", {
|
|
4170
4494
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4171
4495
|
type: "string"
|
|
4172
4496
|
}).option("all", {
|
|
@@ -4239,11 +4563,11 @@ var EntryPatternUpdateModule = {
|
|
|
4239
4563
|
command: "update <filename>",
|
|
4240
4564
|
aliases: ["put"],
|
|
4241
4565
|
describe: "Insert or update an entry pattern",
|
|
4242
|
-
builder: (
|
|
4566
|
+
builder: (yargs36) => withConfiguration(
|
|
4243
4567
|
withApiOptions(
|
|
4244
4568
|
withProjectOptions(
|
|
4245
4569
|
withStateOptions(
|
|
4246
|
-
|
|
4570
|
+
yargs36.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
4247
4571
|
)
|
|
4248
4572
|
)
|
|
4249
4573
|
)
|
|
@@ -4260,14 +4584,14 @@ var EntryPatternUpdateModule = {
|
|
|
4260
4584
|
var EntryPatternModule = {
|
|
4261
4585
|
command: "entry-pattern <command>",
|
|
4262
4586
|
describe: "Commands for Entry patterns",
|
|
4263
|
-
builder: (
|
|
4587
|
+
builder: (yargs36) => yargs36.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
4264
4588
|
handler: () => {
|
|
4265
|
-
|
|
4589
|
+
yargs11.help();
|
|
4266
4590
|
}
|
|
4267
4591
|
};
|
|
4268
4592
|
|
|
4269
4593
|
// src/commands/canvas/commands/locale.ts
|
|
4270
|
-
import
|
|
4594
|
+
import yargs12 from "yargs";
|
|
4271
4595
|
|
|
4272
4596
|
// src/commands/canvas/commands/locale/pull.ts
|
|
4273
4597
|
import { LocaleClient } from "@uniformdev/canvas";
|
|
@@ -4306,11 +4630,11 @@ function createLocaleEngineDataSource({
|
|
|
4306
4630
|
var LocalePullModule = {
|
|
4307
4631
|
command: "pull <directory>",
|
|
4308
4632
|
describe: "Pulls all locales to local files in a directory",
|
|
4309
|
-
builder: (
|
|
4633
|
+
builder: (yargs36) => withConfiguration(
|
|
4310
4634
|
withApiOptions(
|
|
4311
4635
|
withProjectOptions(
|
|
4312
4636
|
withDiffOptions(
|
|
4313
|
-
|
|
4637
|
+
yargs36.positional("directory", {
|
|
4314
4638
|
describe: "Directory to save the locales to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4315
4639
|
type: "string"
|
|
4316
4640
|
}).option("format", {
|
|
@@ -4394,11 +4718,11 @@ import { LocaleClient as LocaleClient2 } from "@uniformdev/canvas";
|
|
|
4394
4718
|
var LocalePushModule = {
|
|
4395
4719
|
command: "push <directory>",
|
|
4396
4720
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
4397
|
-
builder: (
|
|
4721
|
+
builder: (yargs36) => withConfiguration(
|
|
4398
4722
|
withApiOptions(
|
|
4399
4723
|
withProjectOptions(
|
|
4400
4724
|
withDiffOptions(
|
|
4401
|
-
|
|
4725
|
+
yargs36.positional("directory", {
|
|
4402
4726
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
4403
4727
|
type: "string"
|
|
4404
4728
|
}).option("what-if", {
|
|
@@ -4469,26 +4793,263 @@ var LocalePushModule = {
|
|
|
4469
4793
|
var LocaleModule = {
|
|
4470
4794
|
command: "locale <command>",
|
|
4471
4795
|
describe: "Commands for locale definitions",
|
|
4472
|
-
builder: (
|
|
4796
|
+
builder: (yargs36) => yargs36.command(LocalePullModule).command(LocalePushModule),
|
|
4473
4797
|
handler: () => {
|
|
4474
|
-
|
|
4798
|
+
yargs12.help();
|
|
4799
|
+
}
|
|
4800
|
+
};
|
|
4801
|
+
|
|
4802
|
+
// src/commands/canvas/commands/pattern.ts
|
|
4803
|
+
import yargs13 from "yargs";
|
|
4804
|
+
|
|
4805
|
+
// src/commands/canvas/commands/pattern/get.ts
|
|
4806
|
+
var PatternGetModule = {
|
|
4807
|
+
...CompositionGetModule,
|
|
4808
|
+
describe: "Fetch a pattern"
|
|
4809
|
+
};
|
|
4810
|
+
|
|
4811
|
+
// src/commands/canvas/commands/pattern/list.ts
|
|
4812
|
+
var PatternListModule = {
|
|
4813
|
+
...CompositionListModule,
|
|
4814
|
+
describe: "List patterns",
|
|
4815
|
+
builder: (yargs36) => withFormatOptions(
|
|
4816
|
+
withConfiguration(
|
|
4817
|
+
withApiOptions(
|
|
4818
|
+
withProjectOptions(
|
|
4819
|
+
withStateOptions(
|
|
4820
|
+
yargs36.options({
|
|
4821
|
+
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4822
|
+
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4823
|
+
resolvePatterns: {
|
|
4824
|
+
type: "boolean",
|
|
4825
|
+
default: false,
|
|
4826
|
+
describe: "Resolve pattern references in the composition"
|
|
4827
|
+
},
|
|
4828
|
+
resolveOverrides: {
|
|
4829
|
+
type: "boolean",
|
|
4830
|
+
default: false,
|
|
4831
|
+
describe: "Resolves pattern overrides in the pattern and removes override definition data"
|
|
4832
|
+
},
|
|
4833
|
+
onlyPatterns: {
|
|
4834
|
+
describe: "Only pulling patterns and not compositions",
|
|
4835
|
+
// This default differentiate this list command from composition list command
|
|
4836
|
+
default: true,
|
|
4837
|
+
type: "boolean",
|
|
4838
|
+
hidden: true
|
|
4839
|
+
},
|
|
4840
|
+
componentIDs: {
|
|
4841
|
+
alias: ["componentIDs"],
|
|
4842
|
+
type: "boolean",
|
|
4843
|
+
default: false,
|
|
4844
|
+
describe: "Include individual component UIDs"
|
|
4845
|
+
}
|
|
4846
|
+
})
|
|
4847
|
+
)
|
|
4848
|
+
)
|
|
4849
|
+
)
|
|
4850
|
+
)
|
|
4851
|
+
)
|
|
4852
|
+
};
|
|
4853
|
+
|
|
4854
|
+
// src/commands/canvas/commands/pattern/publish.ts
|
|
4855
|
+
var PatternPublishModule = {
|
|
4856
|
+
...CompositionPublishModule,
|
|
4857
|
+
describe: "Publishes pattern(s)",
|
|
4858
|
+
builder: (yargs36) => withConfiguration(
|
|
4859
|
+
withApiOptions(
|
|
4860
|
+
withProjectOptions(
|
|
4861
|
+
withDiffOptions(
|
|
4862
|
+
yargs36.positional("ids", {
|
|
4863
|
+
describe: "Publishes pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4864
|
+
type: "string"
|
|
4865
|
+
}).option("all", {
|
|
4866
|
+
alias: ["a"],
|
|
4867
|
+
describe: "Publishes all patterns. Use compositionId to publish one instead.",
|
|
4868
|
+
default: false,
|
|
4869
|
+
type: "boolean"
|
|
4870
|
+
}).option("what-if", {
|
|
4871
|
+
alias: ["w"],
|
|
4872
|
+
describe: "What-if mode reports what would be done but does not perform any un-publishing",
|
|
4873
|
+
default: false,
|
|
4874
|
+
type: "boolean"
|
|
4875
|
+
}).option("publishingState", {
|
|
4876
|
+
describe: 'Publishing state to update to. Can be "published" or "preview".',
|
|
4877
|
+
default: "published",
|
|
4878
|
+
type: "string",
|
|
4879
|
+
hidden: true
|
|
4880
|
+
}).option("onlyCompositions", {
|
|
4881
|
+
describe: "Only publishing compositions and not patterns",
|
|
4882
|
+
default: false,
|
|
4883
|
+
type: "boolean"
|
|
4884
|
+
}).option("onlyPatterns", {
|
|
4885
|
+
describe: "Only pulling patterns and not compositions",
|
|
4886
|
+
default: true,
|
|
4887
|
+
type: "boolean",
|
|
4888
|
+
hidden: true
|
|
4889
|
+
})
|
|
4890
|
+
)
|
|
4891
|
+
)
|
|
4892
|
+
)
|
|
4893
|
+
)
|
|
4894
|
+
};
|
|
4895
|
+
|
|
4896
|
+
// src/commands/canvas/commands/pattern/pull.ts
|
|
4897
|
+
var PatternPullModule = {
|
|
4898
|
+
...CompositionPullModule,
|
|
4899
|
+
describe: "Pulls all patterns to local files in a directory",
|
|
4900
|
+
builder: (yargs36) => withConfiguration(
|
|
4901
|
+
withApiOptions(
|
|
4902
|
+
withProjectOptions(
|
|
4903
|
+
withStateOptions(
|
|
4904
|
+
withDiffOptions(
|
|
4905
|
+
yargs36.positional("directory", {
|
|
4906
|
+
describe: "Directory to save the definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4907
|
+
type: "string"
|
|
4908
|
+
}).option("format", {
|
|
4909
|
+
alias: ["f"],
|
|
4910
|
+
describe: "Output format",
|
|
4911
|
+
default: "yaml",
|
|
4912
|
+
choices: ["yaml", "json"],
|
|
4913
|
+
type: "string"
|
|
4914
|
+
}).option("onlyPatterns", {
|
|
4915
|
+
describe: "Only pulling patterns and not compositions",
|
|
4916
|
+
// This default differentiate this list command from composition list command
|
|
4917
|
+
default: true,
|
|
4918
|
+
type: "boolean",
|
|
4919
|
+
hidden: true
|
|
4920
|
+
}).option("what-if", {
|
|
4921
|
+
alias: ["w"],
|
|
4922
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
4923
|
+
default: false,
|
|
4924
|
+
type: "boolean"
|
|
4925
|
+
}).option("mode", {
|
|
4926
|
+
alias: ["m"],
|
|
4927
|
+
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',
|
|
4928
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
4929
|
+
default: "mirror",
|
|
4930
|
+
type: "string"
|
|
4931
|
+
})
|
|
4932
|
+
)
|
|
4933
|
+
)
|
|
4934
|
+
)
|
|
4935
|
+
)
|
|
4936
|
+
)
|
|
4937
|
+
};
|
|
4938
|
+
|
|
4939
|
+
// src/commands/canvas/commands/pattern/push.ts
|
|
4940
|
+
var PatternPushModule = {
|
|
4941
|
+
...CompositionPushModule,
|
|
4942
|
+
describe: "Pushes all patterns from files in a directory to Uniform Canvas",
|
|
4943
|
+
builder: (yargs36) => withConfiguration(
|
|
4944
|
+
withApiOptions(
|
|
4945
|
+
withProjectOptions(
|
|
4946
|
+
withStateOptions(
|
|
4947
|
+
withDiffOptions(
|
|
4948
|
+
yargs36.positional("directory", {
|
|
4949
|
+
describe: "Directory to read the patterns from. If a filename is used, a package will be read instead.",
|
|
4950
|
+
type: "string"
|
|
4951
|
+
}).option("what-if", {
|
|
4952
|
+
alias: ["w"],
|
|
4953
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
4954
|
+
default: false,
|
|
4955
|
+
type: "boolean"
|
|
4956
|
+
}).option("mode", {
|
|
4957
|
+
alias: ["m"],
|
|
4958
|
+
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',
|
|
4959
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
4960
|
+
default: "mirror",
|
|
4961
|
+
type: "string"
|
|
4962
|
+
}).option("onlyPatterns", {
|
|
4963
|
+
describe: "Only pulling patterns and not compositions",
|
|
4964
|
+
// This default differentiate this list command from composition list command
|
|
4965
|
+
default: true,
|
|
4966
|
+
type: "boolean",
|
|
4967
|
+
hidden: true
|
|
4968
|
+
}).option("patternType", {
|
|
4969
|
+
default: "all",
|
|
4970
|
+
choices: ["all", "component", "composition"],
|
|
4971
|
+
hidden: true
|
|
4972
|
+
})
|
|
4973
|
+
)
|
|
4974
|
+
)
|
|
4975
|
+
)
|
|
4976
|
+
)
|
|
4977
|
+
)
|
|
4978
|
+
};
|
|
4979
|
+
|
|
4980
|
+
// src/commands/canvas/commands/pattern/remove.ts
|
|
4981
|
+
var PatternRemoveModule = {
|
|
4982
|
+
...CompositionRemoveModule,
|
|
4983
|
+
describe: "Delete a pattern"
|
|
4984
|
+
};
|
|
4985
|
+
|
|
4986
|
+
// src/commands/canvas/commands/pattern/unpublish.ts
|
|
4987
|
+
var PatternUnpublishModule = {
|
|
4988
|
+
command: "unpublish [ids]",
|
|
4989
|
+
describe: "Unpublish a pattern(s)",
|
|
4990
|
+
builder: (yargs36) => withConfiguration(
|
|
4991
|
+
withApiOptions(
|
|
4992
|
+
withProjectOptions(
|
|
4993
|
+
yargs36.positional("ids", {
|
|
4994
|
+
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4995
|
+
type: "string"
|
|
4996
|
+
}).option("all", {
|
|
4997
|
+
alias: ["a"],
|
|
4998
|
+
describe: "Un-publishes all compositions. Use compositionId to publish one instead.",
|
|
4999
|
+
default: false,
|
|
5000
|
+
type: "boolean"
|
|
5001
|
+
}).option("what-if", {
|
|
5002
|
+
alias: ["w"],
|
|
5003
|
+
describe: "What-if mode reports what would be done but does not perform any publishing",
|
|
5004
|
+
default: false,
|
|
5005
|
+
type: "boolean"
|
|
5006
|
+
}).option("onlyCompositions", {
|
|
5007
|
+
describe: "Only un-publishing compositions and not patterns",
|
|
5008
|
+
default: false,
|
|
5009
|
+
type: "boolean"
|
|
5010
|
+
}).option("onlyPatterns", {
|
|
5011
|
+
describe: "Only un-publishing patterns and not compositions",
|
|
5012
|
+
default: true,
|
|
5013
|
+
type: "boolean",
|
|
5014
|
+
hidden: true
|
|
5015
|
+
})
|
|
5016
|
+
)
|
|
5017
|
+
)
|
|
5018
|
+
),
|
|
5019
|
+
handler: CompositionUnpublishModule.handler
|
|
5020
|
+
};
|
|
5021
|
+
|
|
5022
|
+
// src/commands/canvas/commands/pattern/update.ts
|
|
5023
|
+
var PatternUpdateModule = {
|
|
5024
|
+
...CompositionUpdateModule,
|
|
5025
|
+
describe: "Insert or update a pattern"
|
|
5026
|
+
};
|
|
5027
|
+
|
|
5028
|
+
// src/commands/canvas/commands/pattern.ts
|
|
5029
|
+
var PatternModule = {
|
|
5030
|
+
command: "pattern <command>",
|
|
5031
|
+
describe: "Commands for Canvas patterns",
|
|
5032
|
+
deprecated: 'will be removed in a future major release. Use "component-pattern" and "composition-pattern" instead.',
|
|
5033
|
+
builder: (yargs36) => yargs36.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
|
|
5034
|
+
handler: () => {
|
|
5035
|
+
yargs13.help();
|
|
4475
5036
|
}
|
|
4476
5037
|
};
|
|
4477
5038
|
|
|
4478
5039
|
// src/commands/canvas/commands/prompts.ts
|
|
4479
|
-
import
|
|
5040
|
+
import yargs14 from "yargs";
|
|
4480
5041
|
|
|
4481
5042
|
// src/commands/canvas/commands/prompts/get.ts
|
|
4482
5043
|
import { PromptClient } from "@uniformdev/canvas";
|
|
4483
5044
|
var PromptGetModule = {
|
|
4484
5045
|
command: "get <id>",
|
|
4485
5046
|
describe: "Get a prompt",
|
|
4486
|
-
builder: (
|
|
5047
|
+
builder: (yargs36) => withConfiguration(
|
|
4487
5048
|
withFormatOptions(
|
|
4488
5049
|
withApiOptions(
|
|
4489
5050
|
withProjectOptions(
|
|
4490
5051
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4491
|
-
|
|
5052
|
+
yargs36.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
4492
5053
|
)
|
|
4493
5054
|
)
|
|
4494
5055
|
)
|
|
@@ -4509,7 +5070,7 @@ import { PromptClient as PromptClient2 } from "@uniformdev/canvas";
|
|
|
4509
5070
|
var PromptListModule = {
|
|
4510
5071
|
command: "list",
|
|
4511
5072
|
describe: "List prompts",
|
|
4512
|
-
builder: (
|
|
5073
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
4513
5074
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
4514
5075
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4515
5076
|
const client = new PromptClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -4557,12 +5118,12 @@ function createPromptEngineDataSource({
|
|
|
4557
5118
|
var PromptPullModule = {
|
|
4558
5119
|
command: "pull <directory>",
|
|
4559
5120
|
describe: "Pulls all prompts to local files in a directory",
|
|
4560
|
-
builder: (
|
|
5121
|
+
builder: (yargs36) => withConfiguration(
|
|
4561
5122
|
withApiOptions(
|
|
4562
5123
|
withProjectOptions(
|
|
4563
5124
|
withStateOptions(
|
|
4564
5125
|
withDiffOptions(
|
|
4565
|
-
|
|
5126
|
+
yargs36.positional("directory", {
|
|
4566
5127
|
describe: "Directory to save the prompts to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4567
5128
|
type: "string"
|
|
4568
5129
|
}).option("format", {
|
|
@@ -4647,12 +5208,12 @@ import { PromptClient as PromptClient4 } from "@uniformdev/canvas";
|
|
|
4647
5208
|
var PromptPushModule = {
|
|
4648
5209
|
command: "push <directory>",
|
|
4649
5210
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
4650
|
-
builder: (
|
|
5211
|
+
builder: (yargs36) => withConfiguration(
|
|
4651
5212
|
withApiOptions(
|
|
4652
5213
|
withProjectOptions(
|
|
4653
5214
|
withStateOptions(
|
|
4654
5215
|
withDiffOptions(
|
|
4655
|
-
|
|
5216
|
+
yargs36.positional("directory", {
|
|
4656
5217
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
4657
5218
|
type: "string"
|
|
4658
5219
|
}).option("what-if", {
|
|
@@ -4726,9 +5287,9 @@ var PromptRemoveModule = {
|
|
|
4726
5287
|
command: "remove <id>",
|
|
4727
5288
|
aliases: ["delete", "rm"],
|
|
4728
5289
|
describe: "Delete a prompt",
|
|
4729
|
-
builder: (
|
|
5290
|
+
builder: (yargs36) => withConfiguration(
|
|
4730
5291
|
withApiOptions(
|
|
4731
|
-
withProjectOptions(
|
|
5292
|
+
withProjectOptions(yargs36.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
4732
5293
|
)
|
|
4733
5294
|
),
|
|
4734
5295
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -4744,10 +5305,10 @@ var PromptUpdateModule = {
|
|
|
4744
5305
|
command: "update <filename>",
|
|
4745
5306
|
aliases: ["put"],
|
|
4746
5307
|
describe: "Insert or update a prompt",
|
|
4747
|
-
builder: (
|
|
5308
|
+
builder: (yargs36) => withConfiguration(
|
|
4748
5309
|
withApiOptions(
|
|
4749
5310
|
withProjectOptions(
|
|
4750
|
-
|
|
5311
|
+
yargs36.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
4751
5312
|
)
|
|
4752
5313
|
)
|
|
4753
5314
|
),
|
|
@@ -4764,14 +5325,14 @@ var PromptModule = {
|
|
|
4764
5325
|
command: "prompt <command>",
|
|
4765
5326
|
aliases: ["dt"],
|
|
4766
5327
|
describe: "Commands for AI Prompt definitions",
|
|
4767
|
-
builder: (
|
|
5328
|
+
builder: (yargs36) => yargs36.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
4768
5329
|
handler: () => {
|
|
4769
|
-
|
|
5330
|
+
yargs14.help();
|
|
4770
5331
|
}
|
|
4771
5332
|
};
|
|
4772
5333
|
|
|
4773
5334
|
// src/commands/canvas/commands/workflow.ts
|
|
4774
|
-
import
|
|
5335
|
+
import yargs15 from "yargs";
|
|
4775
5336
|
|
|
4776
5337
|
// src/commands/canvas/commands/workflow/pull.ts
|
|
4777
5338
|
import { WorkflowClient } from "@uniformdev/canvas";
|
|
@@ -4815,11 +5376,11 @@ function createWorkflowEngineDataSource({
|
|
|
4815
5376
|
var WorkflowPullModule = {
|
|
4816
5377
|
command: "pull <directory>",
|
|
4817
5378
|
describe: "Pulls all workflows to local files in a directory",
|
|
4818
|
-
builder: (
|
|
5379
|
+
builder: (yargs36) => withConfiguration(
|
|
4819
5380
|
withApiOptions(
|
|
4820
5381
|
withProjectOptions(
|
|
4821
5382
|
withDiffOptions(
|
|
4822
|
-
|
|
5383
|
+
yargs36.positional("directory", {
|
|
4823
5384
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4824
5385
|
type: "string"
|
|
4825
5386
|
}).option("format", {
|
|
@@ -4897,11 +5458,11 @@ import { WorkflowClient as WorkflowClient2 } from "@uniformdev/canvas";
|
|
|
4897
5458
|
var WorkflowPushModule = {
|
|
4898
5459
|
command: "push <directory>",
|
|
4899
5460
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
4900
|
-
builder: (
|
|
5461
|
+
builder: (yargs36) => withConfiguration(
|
|
4901
5462
|
withApiOptions(
|
|
4902
5463
|
withProjectOptions(
|
|
4903
5464
|
withDiffOptions(
|
|
4904
|
-
|
|
5465
|
+
yargs36.positional("directory", {
|
|
4905
5466
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
4906
5467
|
type: "string"
|
|
4907
5468
|
}).option("what-if", {
|
|
@@ -4967,9 +5528,9 @@ var WorkflowModule = {
|
|
|
4967
5528
|
command: "workflow <command>",
|
|
4968
5529
|
aliases: ["wf"],
|
|
4969
5530
|
describe: "Commands for Canvas workflows",
|
|
4970
|
-
builder: (
|
|
5531
|
+
builder: (yargs36) => yargs36.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
4971
5532
|
handler: () => {
|
|
4972
|
-
|
|
5533
|
+
yargs15.help();
|
|
4973
5534
|
}
|
|
4974
5535
|
};
|
|
4975
5536
|
|
|
@@ -4978,28 +5539,28 @@ var CanvasCommand = {
|
|
|
4978
5539
|
command: "canvas <command>",
|
|
4979
5540
|
aliases: ["cv", "pm", "presentation"],
|
|
4980
5541
|
describe: "Uniform Canvas commands",
|
|
4981
|
-
builder: (
|
|
5542
|
+
builder: (yargs36) => yargs36.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(PatternModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LocaleModule).command(WorkflowModule).demandCommand(),
|
|
4982
5543
|
handler: () => {
|
|
4983
|
-
|
|
5544
|
+
yargs16.showHelp();
|
|
4984
5545
|
}
|
|
4985
5546
|
};
|
|
4986
5547
|
|
|
4987
5548
|
// src/commands/context/index.ts
|
|
4988
|
-
import
|
|
5549
|
+
import yargs23 from "yargs";
|
|
4989
5550
|
|
|
4990
5551
|
// src/commands/context/commands/aggregate.ts
|
|
4991
|
-
import
|
|
5552
|
+
import yargs17 from "yargs";
|
|
4992
5553
|
|
|
4993
5554
|
// src/commands/context/commands/aggregate/get.ts
|
|
4994
5555
|
import { UncachedAggregateClient } from "@uniformdev/context/api";
|
|
4995
5556
|
var AggregateGetModule = {
|
|
4996
5557
|
command: "get <id>",
|
|
4997
5558
|
describe: "Fetch an aggregate",
|
|
4998
|
-
builder: (
|
|
5559
|
+
builder: (yargs36) => withConfiguration(
|
|
4999
5560
|
withFormatOptions(
|
|
5000
5561
|
withApiOptions(
|
|
5001
5562
|
withProjectOptions(
|
|
5002
|
-
|
|
5563
|
+
yargs36.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
5003
5564
|
)
|
|
5004
5565
|
)
|
|
5005
5566
|
)
|
|
@@ -5023,7 +5584,7 @@ var AggregateListModule = {
|
|
|
5023
5584
|
command: "list",
|
|
5024
5585
|
describe: "List aggregates",
|
|
5025
5586
|
aliases: ["ls"],
|
|
5026
|
-
builder: (
|
|
5587
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
5027
5588
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5028
5589
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5029
5590
|
const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5090,11 +5651,11 @@ function writeContextPackage(filename, packageContents) {
|
|
|
5090
5651
|
var AggregatePullModule = {
|
|
5091
5652
|
command: "pull <directory>",
|
|
5092
5653
|
describe: "Pulls all aggregates to local files in a directory",
|
|
5093
|
-
builder: (
|
|
5654
|
+
builder: (yargs36) => withConfiguration(
|
|
5094
5655
|
withApiOptions(
|
|
5095
5656
|
withProjectOptions(
|
|
5096
5657
|
withDiffOptions(
|
|
5097
|
-
|
|
5658
|
+
yargs36.positional("directory", {
|
|
5098
5659
|
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.",
|
|
5099
5660
|
type: "string"
|
|
5100
5661
|
}).option("format", {
|
|
@@ -5172,11 +5733,11 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
|
|
|
5172
5733
|
var AggregatePushModule = {
|
|
5173
5734
|
command: "push <directory>",
|
|
5174
5735
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
5175
|
-
builder: (
|
|
5736
|
+
builder: (yargs36) => withConfiguration(
|
|
5176
5737
|
withApiOptions(
|
|
5177
5738
|
withProjectOptions(
|
|
5178
5739
|
withDiffOptions(
|
|
5179
|
-
|
|
5740
|
+
yargs36.positional("directory", {
|
|
5180
5741
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
5181
5742
|
type: "string"
|
|
5182
5743
|
}).option("what-if", {
|
|
@@ -5244,10 +5805,10 @@ var AggregateRemoveModule = {
|
|
|
5244
5805
|
command: "remove <id>",
|
|
5245
5806
|
aliases: ["delete", "rm"],
|
|
5246
5807
|
describe: "Delete an aggregate",
|
|
5247
|
-
builder: (
|
|
5808
|
+
builder: (yargs36) => withConfiguration(
|
|
5248
5809
|
withApiOptions(
|
|
5249
5810
|
withProjectOptions(
|
|
5250
|
-
|
|
5811
|
+
yargs36.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
5251
5812
|
)
|
|
5252
5813
|
)
|
|
5253
5814
|
),
|
|
@@ -5264,10 +5825,10 @@ var AggregateUpdateModule = {
|
|
|
5264
5825
|
command: "update <filename>",
|
|
5265
5826
|
aliases: ["put"],
|
|
5266
5827
|
describe: "Insert or update an aggregate",
|
|
5267
|
-
builder: (
|
|
5828
|
+
builder: (yargs36) => withConfiguration(
|
|
5268
5829
|
withApiOptions(
|
|
5269
5830
|
withProjectOptions(
|
|
5270
|
-
|
|
5831
|
+
yargs36.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
5271
5832
|
)
|
|
5272
5833
|
)
|
|
5273
5834
|
),
|
|
@@ -5284,25 +5845,25 @@ var AggregateModule = {
|
|
|
5284
5845
|
command: "aggregate <command>",
|
|
5285
5846
|
aliases: ["agg", "intent", "audience"],
|
|
5286
5847
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
5287
|
-
builder: (
|
|
5848
|
+
builder: (yargs36) => yargs36.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
5288
5849
|
handler: () => {
|
|
5289
|
-
|
|
5850
|
+
yargs17.help();
|
|
5290
5851
|
}
|
|
5291
5852
|
};
|
|
5292
5853
|
|
|
5293
5854
|
// src/commands/context/commands/enrichment.ts
|
|
5294
|
-
import
|
|
5855
|
+
import yargs18 from "yargs";
|
|
5295
5856
|
|
|
5296
5857
|
// src/commands/context/commands/enrichment/get.ts
|
|
5297
5858
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
5298
5859
|
var EnrichmentGetModule = {
|
|
5299
5860
|
command: "get <id>",
|
|
5300
5861
|
describe: "Fetch an enrichment category and its values",
|
|
5301
|
-
builder: (
|
|
5862
|
+
builder: (yargs36) => withFormatOptions(
|
|
5302
5863
|
withConfiguration(
|
|
5303
5864
|
withApiOptions(
|
|
5304
5865
|
withProjectOptions(
|
|
5305
|
-
|
|
5866
|
+
yargs36.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
5306
5867
|
)
|
|
5307
5868
|
)
|
|
5308
5869
|
)
|
|
@@ -5326,7 +5887,7 @@ var EnrichmentListModule = {
|
|
|
5326
5887
|
command: "list",
|
|
5327
5888
|
describe: "List enrichments",
|
|
5328
5889
|
aliases: ["ls"],
|
|
5329
|
-
builder: (
|
|
5890
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
5330
5891
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5331
5892
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5332
5893
|
const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5428,11 +5989,11 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
5428
5989
|
var EnrichmentPullModule = {
|
|
5429
5990
|
command: "pull <directory>",
|
|
5430
5991
|
describe: "Pulls all enrichments to local files in a directory",
|
|
5431
|
-
builder: (
|
|
5992
|
+
builder: (yargs36) => withConfiguration(
|
|
5432
5993
|
withApiOptions(
|
|
5433
5994
|
withProjectOptions(
|
|
5434
5995
|
withDiffOptions(
|
|
5435
|
-
|
|
5996
|
+
yargs36.positional("directory", {
|
|
5436
5997
|
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.",
|
|
5437
5998
|
type: "string"
|
|
5438
5999
|
}).option("format", {
|
|
@@ -5510,11 +6071,11 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
|
|
|
5510
6071
|
var EnrichmentPushModule = {
|
|
5511
6072
|
command: "push <directory>",
|
|
5512
6073
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
5513
|
-
builder: (
|
|
6074
|
+
builder: (yargs36) => withConfiguration(
|
|
5514
6075
|
withApiOptions(
|
|
5515
6076
|
withProjectOptions(
|
|
5516
6077
|
withDiffOptions(
|
|
5517
|
-
|
|
6078
|
+
yargs36.positional("directory", {
|
|
5518
6079
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
5519
6080
|
type: "string"
|
|
5520
6081
|
}).option("what-if", {
|
|
@@ -5581,10 +6142,10 @@ var EnrichmentRemoveModule = {
|
|
|
5581
6142
|
command: "remove <id>",
|
|
5582
6143
|
aliases: ["delete", "rm"],
|
|
5583
6144
|
describe: "Delete an enrichment category and its values",
|
|
5584
|
-
builder: (
|
|
6145
|
+
builder: (yargs36) => withConfiguration(
|
|
5585
6146
|
withApiOptions(
|
|
5586
6147
|
withProjectOptions(
|
|
5587
|
-
|
|
6148
|
+
yargs36.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
5588
6149
|
)
|
|
5589
6150
|
)
|
|
5590
6151
|
),
|
|
@@ -5600,14 +6161,14 @@ var EnrichmentModule = {
|
|
|
5600
6161
|
command: "enrichment <command>",
|
|
5601
6162
|
aliases: ["enr"],
|
|
5602
6163
|
describe: "Commands for Context enrichments",
|
|
5603
|
-
builder: (
|
|
6164
|
+
builder: (yargs36) => yargs36.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
5604
6165
|
handler: () => {
|
|
5605
|
-
|
|
6166
|
+
yargs18.help();
|
|
5606
6167
|
}
|
|
5607
6168
|
};
|
|
5608
6169
|
|
|
5609
6170
|
// src/commands/context/commands/manifest.ts
|
|
5610
|
-
import
|
|
6171
|
+
import yargs19 from "yargs";
|
|
5611
6172
|
|
|
5612
6173
|
// src/commands/context/commands/manifest/get.ts
|
|
5613
6174
|
import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -5618,10 +6179,10 @@ var ManifestGetModule = {
|
|
|
5618
6179
|
command: "get [output]",
|
|
5619
6180
|
aliases: ["dl", "download"],
|
|
5620
6181
|
describe: "Download the Uniform Context manifest for a project",
|
|
5621
|
-
builder: (
|
|
6182
|
+
builder: (yargs36) => withConfiguration(
|
|
5622
6183
|
withApiOptions(
|
|
5623
6184
|
withProjectOptions(
|
|
5624
|
-
|
|
6185
|
+
yargs36.option("preview", {
|
|
5625
6186
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
5626
6187
|
default: false,
|
|
5627
6188
|
type: "boolean",
|
|
@@ -5683,7 +6244,7 @@ import { exit as exit2 } from "process";
|
|
|
5683
6244
|
var ManifestPublishModule = {
|
|
5684
6245
|
command: "publish",
|
|
5685
6246
|
describe: "Publish the Uniform Context manifest for a project",
|
|
5686
|
-
builder: (
|
|
6247
|
+
builder: (yargs36) => withConfiguration(withApiOptions(withProjectOptions(yargs36))),
|
|
5687
6248
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
5688
6249
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5689
6250
|
try {
|
|
@@ -5716,25 +6277,25 @@ var ManifestModule = {
|
|
|
5716
6277
|
command: "manifest <command>",
|
|
5717
6278
|
describe: "Commands for context manifests",
|
|
5718
6279
|
aliases: ["man"],
|
|
5719
|
-
builder: (
|
|
6280
|
+
builder: (yargs36) => yargs36.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
5720
6281
|
handler: () => {
|
|
5721
|
-
|
|
6282
|
+
yargs19.help();
|
|
5722
6283
|
}
|
|
5723
6284
|
};
|
|
5724
6285
|
|
|
5725
6286
|
// src/commands/context/commands/quirk.ts
|
|
5726
|
-
import
|
|
6287
|
+
import yargs20 from "yargs";
|
|
5727
6288
|
|
|
5728
6289
|
// src/commands/context/commands/quirk/get.ts
|
|
5729
6290
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
5730
6291
|
var QuirkGetModule = {
|
|
5731
6292
|
command: "get <id>",
|
|
5732
6293
|
describe: "Fetch a quirk",
|
|
5733
|
-
builder: (
|
|
6294
|
+
builder: (yargs36) => withConfiguration(
|
|
5734
6295
|
withFormatOptions(
|
|
5735
6296
|
withApiOptions(
|
|
5736
6297
|
withProjectOptions(
|
|
5737
|
-
|
|
6298
|
+
yargs36.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
5738
6299
|
)
|
|
5739
6300
|
)
|
|
5740
6301
|
)
|
|
@@ -5758,11 +6319,11 @@ var QuirkListModule = {
|
|
|
5758
6319
|
command: "list",
|
|
5759
6320
|
describe: "List quirks",
|
|
5760
6321
|
aliases: ["ls"],
|
|
5761
|
-
builder: (
|
|
6322
|
+
builder: (yargs36) => withConfiguration(
|
|
5762
6323
|
withFormatOptions(
|
|
5763
6324
|
withApiOptions(
|
|
5764
6325
|
withProjectOptions(
|
|
5765
|
-
|
|
6326
|
+
yargs36.option("withIntegrations", {
|
|
5766
6327
|
alias: ["i"],
|
|
5767
6328
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
5768
6329
|
type: "boolean"
|
|
@@ -5820,11 +6381,11 @@ function createQuirkEngineDataSource({
|
|
|
5820
6381
|
var QuirkPullModule = {
|
|
5821
6382
|
command: "pull <directory>",
|
|
5822
6383
|
describe: "Pulls all quirks to local files in a directory",
|
|
5823
|
-
builder: (
|
|
6384
|
+
builder: (yargs36) => withConfiguration(
|
|
5824
6385
|
withApiOptions(
|
|
5825
6386
|
withProjectOptions(
|
|
5826
6387
|
withDiffOptions(
|
|
5827
|
-
|
|
6388
|
+
yargs36.positional("directory", {
|
|
5828
6389
|
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.",
|
|
5829
6390
|
type: "string"
|
|
5830
6391
|
}).option("format", {
|
|
@@ -5902,11 +6463,11 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
5902
6463
|
var QuirkPushModule = {
|
|
5903
6464
|
command: "push <directory>",
|
|
5904
6465
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
5905
|
-
builder: (
|
|
6466
|
+
builder: (yargs36) => withConfiguration(
|
|
5906
6467
|
withApiOptions(
|
|
5907
6468
|
withProjectOptions(
|
|
5908
6469
|
withDiffOptions(
|
|
5909
|
-
|
|
6470
|
+
yargs36.positional("directory", {
|
|
5910
6471
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
5911
6472
|
type: "string"
|
|
5912
6473
|
}).option("what-if", {
|
|
@@ -5973,10 +6534,10 @@ var QuirkRemoveModule = {
|
|
|
5973
6534
|
command: "remove <id>",
|
|
5974
6535
|
aliases: ["delete", "rm"],
|
|
5975
6536
|
describe: "Delete a quirk",
|
|
5976
|
-
builder: (
|
|
6537
|
+
builder: (yargs36) => withConfiguration(
|
|
5977
6538
|
withApiOptions(
|
|
5978
6539
|
withProjectOptions(
|
|
5979
|
-
|
|
6540
|
+
yargs36.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
5980
6541
|
)
|
|
5981
6542
|
)
|
|
5982
6543
|
),
|
|
@@ -5993,10 +6554,10 @@ var QuirkUpdateModule = {
|
|
|
5993
6554
|
command: "update <filename>",
|
|
5994
6555
|
aliases: ["put"],
|
|
5995
6556
|
describe: "Insert or update a quirk",
|
|
5996
|
-
builder: (
|
|
6557
|
+
builder: (yargs36) => withConfiguration(
|
|
5997
6558
|
withApiOptions(
|
|
5998
6559
|
withProjectOptions(
|
|
5999
|
-
|
|
6560
|
+
yargs36.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
6000
6561
|
)
|
|
6001
6562
|
)
|
|
6002
6563
|
),
|
|
@@ -6013,25 +6574,25 @@ var QuirkModule = {
|
|
|
6013
6574
|
command: "quirk <command>",
|
|
6014
6575
|
aliases: ["qk"],
|
|
6015
6576
|
describe: "Commands for Context quirks",
|
|
6016
|
-
builder: (
|
|
6577
|
+
builder: (yargs36) => yargs36.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
6017
6578
|
handler: () => {
|
|
6018
|
-
|
|
6579
|
+
yargs20.help();
|
|
6019
6580
|
}
|
|
6020
6581
|
};
|
|
6021
6582
|
|
|
6022
6583
|
// src/commands/context/commands/signal.ts
|
|
6023
|
-
import
|
|
6584
|
+
import yargs21 from "yargs";
|
|
6024
6585
|
|
|
6025
6586
|
// src/commands/context/commands/signal/get.ts
|
|
6026
6587
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
6027
6588
|
var SignalGetModule = {
|
|
6028
6589
|
command: "get <id>",
|
|
6029
6590
|
describe: "Fetch a signal",
|
|
6030
|
-
builder: (
|
|
6591
|
+
builder: (yargs36) => withConfiguration(
|
|
6031
6592
|
withFormatOptions(
|
|
6032
6593
|
withApiOptions(
|
|
6033
6594
|
withProjectOptions(
|
|
6034
|
-
|
|
6595
|
+
yargs36.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
6035
6596
|
)
|
|
6036
6597
|
)
|
|
6037
6598
|
)
|
|
@@ -6055,7 +6616,7 @@ var SignalListModule = {
|
|
|
6055
6616
|
command: "list",
|
|
6056
6617
|
describe: "List signals",
|
|
6057
6618
|
aliases: ["ls"],
|
|
6058
|
-
builder: (
|
|
6619
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
6059
6620
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6060
6621
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6061
6622
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6105,11 +6666,11 @@ function createSignalEngineDataSource({
|
|
|
6105
6666
|
var SignalPullModule = {
|
|
6106
6667
|
command: "pull <directory>",
|
|
6107
6668
|
describe: "Pulls all signals to local files in a directory",
|
|
6108
|
-
builder: (
|
|
6669
|
+
builder: (yargs36) => withConfiguration(
|
|
6109
6670
|
withApiOptions(
|
|
6110
6671
|
withProjectOptions(
|
|
6111
6672
|
withDiffOptions(
|
|
6112
|
-
|
|
6673
|
+
yargs36.positional("directory", {
|
|
6113
6674
|
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.",
|
|
6114
6675
|
type: "string"
|
|
6115
6676
|
}).option("format", {
|
|
@@ -6187,11 +6748,11 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
6187
6748
|
var SignalPushModule = {
|
|
6188
6749
|
command: "push <directory>",
|
|
6189
6750
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
6190
|
-
builder: (
|
|
6751
|
+
builder: (yargs36) => withConfiguration(
|
|
6191
6752
|
withApiOptions(
|
|
6192
6753
|
withProjectOptions(
|
|
6193
6754
|
withDiffOptions(
|
|
6194
|
-
|
|
6755
|
+
yargs36.positional("directory", {
|
|
6195
6756
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
6196
6757
|
type: "string"
|
|
6197
6758
|
}).option("what-if", {
|
|
@@ -6258,10 +6819,10 @@ var SignalRemoveModule = {
|
|
|
6258
6819
|
command: "remove <id>",
|
|
6259
6820
|
aliases: ["delete", "rm"],
|
|
6260
6821
|
describe: "Delete a signal",
|
|
6261
|
-
builder: (
|
|
6822
|
+
builder: (yargs36) => withConfiguration(
|
|
6262
6823
|
withApiOptions(
|
|
6263
6824
|
withProjectOptions(
|
|
6264
|
-
|
|
6825
|
+
yargs36.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
6265
6826
|
)
|
|
6266
6827
|
)
|
|
6267
6828
|
),
|
|
@@ -6278,10 +6839,10 @@ var SignalUpdateModule = {
|
|
|
6278
6839
|
command: "update <filename>",
|
|
6279
6840
|
aliases: ["put"],
|
|
6280
6841
|
describe: "Insert or update a signal",
|
|
6281
|
-
builder: (
|
|
6842
|
+
builder: (yargs36) => withConfiguration(
|
|
6282
6843
|
withApiOptions(
|
|
6283
6844
|
withProjectOptions(
|
|
6284
|
-
|
|
6845
|
+
yargs36.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
6285
6846
|
)
|
|
6286
6847
|
)
|
|
6287
6848
|
),
|
|
@@ -6298,25 +6859,25 @@ var SignalModule = {
|
|
|
6298
6859
|
command: "signal <command>",
|
|
6299
6860
|
aliases: ["sig"],
|
|
6300
6861
|
describe: "Commands for Context signals",
|
|
6301
|
-
builder: (
|
|
6862
|
+
builder: (yargs36) => yargs36.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
6302
6863
|
handler: () => {
|
|
6303
|
-
|
|
6864
|
+
yargs21.help();
|
|
6304
6865
|
}
|
|
6305
6866
|
};
|
|
6306
6867
|
|
|
6307
6868
|
// src/commands/context/commands/test.ts
|
|
6308
|
-
import
|
|
6869
|
+
import yargs22 from "yargs";
|
|
6309
6870
|
|
|
6310
6871
|
// src/commands/context/commands/test/get.ts
|
|
6311
6872
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
6312
6873
|
var TestGetModule = {
|
|
6313
6874
|
command: "get <id>",
|
|
6314
6875
|
describe: "Fetch a test",
|
|
6315
|
-
builder: (
|
|
6876
|
+
builder: (yargs36) => withConfiguration(
|
|
6316
6877
|
withFormatOptions(
|
|
6317
6878
|
withApiOptions(
|
|
6318
6879
|
withProjectOptions(
|
|
6319
|
-
|
|
6880
|
+
yargs36.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
6320
6881
|
)
|
|
6321
6882
|
)
|
|
6322
6883
|
)
|
|
@@ -6340,7 +6901,7 @@ var TestListModule = {
|
|
|
6340
6901
|
command: "list",
|
|
6341
6902
|
describe: "List tests",
|
|
6342
6903
|
aliases: ["ls"],
|
|
6343
|
-
builder: (
|
|
6904
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
6344
6905
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6345
6906
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6346
6907
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6390,11 +6951,11 @@ function createTestEngineDataSource({
|
|
|
6390
6951
|
var TestPullModule = {
|
|
6391
6952
|
command: "pull <directory>",
|
|
6392
6953
|
describe: "Pulls all tests to local files in a directory",
|
|
6393
|
-
builder: (
|
|
6954
|
+
builder: (yargs36) => withConfiguration(
|
|
6394
6955
|
withApiOptions(
|
|
6395
6956
|
withProjectOptions(
|
|
6396
6957
|
withDiffOptions(
|
|
6397
|
-
|
|
6958
|
+
yargs36.positional("directory", {
|
|
6398
6959
|
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.",
|
|
6399
6960
|
type: "string"
|
|
6400
6961
|
}).option("format", {
|
|
@@ -6472,11 +7033,11 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
6472
7033
|
var TestPushModule = {
|
|
6473
7034
|
command: "push <directory>",
|
|
6474
7035
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
6475
|
-
builder: (
|
|
7036
|
+
builder: (yargs36) => withConfiguration(
|
|
6476
7037
|
withApiOptions(
|
|
6477
7038
|
withProjectOptions(
|
|
6478
7039
|
withDiffOptions(
|
|
6479
|
-
|
|
7040
|
+
yargs36.positional("directory", {
|
|
6480
7041
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
6481
7042
|
type: "string"
|
|
6482
7043
|
}).option("what-if", {
|
|
@@ -6543,10 +7104,10 @@ var TestRemoveModule = {
|
|
|
6543
7104
|
command: "remove <id>",
|
|
6544
7105
|
aliases: ["delete", "rm"],
|
|
6545
7106
|
describe: "Delete a test",
|
|
6546
|
-
builder: (
|
|
7107
|
+
builder: (yargs36) => withConfiguration(
|
|
6547
7108
|
withApiOptions(
|
|
6548
7109
|
withProjectOptions(
|
|
6549
|
-
|
|
7110
|
+
yargs36.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
6550
7111
|
)
|
|
6551
7112
|
)
|
|
6552
7113
|
),
|
|
@@ -6563,9 +7124,9 @@ var TestUpdateModule = {
|
|
|
6563
7124
|
command: "update <filename>",
|
|
6564
7125
|
aliases: ["put"],
|
|
6565
7126
|
describe: "Insert or update a test",
|
|
6566
|
-
builder: (
|
|
7127
|
+
builder: (yargs36) => withConfiguration(
|
|
6567
7128
|
withApiOptions(
|
|
6568
|
-
withProjectOptions(
|
|
7129
|
+
withProjectOptions(yargs36.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
6569
7130
|
)
|
|
6570
7131
|
),
|
|
6571
7132
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -6580,9 +7141,9 @@ var TestUpdateModule = {
|
|
|
6580
7141
|
var TestModule = {
|
|
6581
7142
|
command: "test <command>",
|
|
6582
7143
|
describe: "Commands for Context A/B tests",
|
|
6583
|
-
builder: (
|
|
7144
|
+
builder: (yargs36) => yargs36.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
6584
7145
|
handler: () => {
|
|
6585
|
-
|
|
7146
|
+
yargs22.help();
|
|
6586
7147
|
}
|
|
6587
7148
|
};
|
|
6588
7149
|
|
|
@@ -6591,20 +7152,20 @@ var ContextCommand = {
|
|
|
6591
7152
|
command: "context <command>",
|
|
6592
7153
|
aliases: ["ctx"],
|
|
6593
7154
|
describe: "Uniform Context commands",
|
|
6594
|
-
builder: (
|
|
7155
|
+
builder: (yargs36) => yargs36.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
6595
7156
|
handler: () => {
|
|
6596
|
-
|
|
7157
|
+
yargs23.showHelp();
|
|
6597
7158
|
}
|
|
6598
7159
|
};
|
|
6599
7160
|
|
|
6600
7161
|
// src/commands/integration/index.ts
|
|
6601
|
-
import
|
|
7162
|
+
import yargs26 from "yargs";
|
|
6602
7163
|
|
|
6603
7164
|
// src/commands/integration/commands/definition.ts
|
|
6604
|
-
import
|
|
7165
|
+
import yargs25 from "yargs";
|
|
6605
7166
|
|
|
6606
7167
|
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
6607
|
-
import
|
|
7168
|
+
import yargs24 from "yargs";
|
|
6608
7169
|
|
|
6609
7170
|
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
6610
7171
|
import { readFileSync } from "fs";
|
|
@@ -6642,8 +7203,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
6642
7203
|
};
|
|
6643
7204
|
|
|
6644
7205
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
6645
|
-
function withEdgehancerIdOptions(
|
|
6646
|
-
return
|
|
7206
|
+
function withEdgehancerIdOptions(yargs36) {
|
|
7207
|
+
return yargs36.option("connectorType", {
|
|
6647
7208
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
6648
7209
|
demandOption: true,
|
|
6649
7210
|
type: "string"
|
|
@@ -6663,11 +7224,11 @@ function withEdgehancerIdOptions(yargs34) {
|
|
|
6663
7224
|
var IntegrationEdgehancerDeployModule = {
|
|
6664
7225
|
command: "deploy <filename>",
|
|
6665
7226
|
describe: "Deploys a custom edgehancer hook to run when a data resource of a specific archetype is fetched. The API key used must have team admin permissions.",
|
|
6666
|
-
builder: (
|
|
7227
|
+
builder: (yargs36) => withConfiguration(
|
|
6667
7228
|
withApiOptions(
|
|
6668
7229
|
withTeamOptions(
|
|
6669
7230
|
withEdgehancerIdOptions(
|
|
6670
|
-
|
|
7231
|
+
yargs36.positional("filename", {
|
|
6671
7232
|
demandOption: true,
|
|
6672
7233
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
6673
7234
|
})
|
|
@@ -6687,7 +7248,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
6687
7248
|
var IntegrationEdgehancerRemoveModule = {
|
|
6688
7249
|
command: "remove",
|
|
6689
7250
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
6690
|
-
builder: (
|
|
7251
|
+
builder: (yargs36) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs36)))),
|
|
6691
7252
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
6692
7253
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6693
7254
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch3, teamId });
|
|
@@ -6699,9 +7260,9 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
6699
7260
|
var IntegrationEdgehancerModule = {
|
|
6700
7261
|
command: "edgehancer <command>",
|
|
6701
7262
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
6702
|
-
builder: (
|
|
7263
|
+
builder: (yargs36) => yargs36.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
6703
7264
|
handler: () => {
|
|
6704
|
-
|
|
7265
|
+
yargs24.help();
|
|
6705
7266
|
}
|
|
6706
7267
|
};
|
|
6707
7268
|
|
|
@@ -6741,10 +7302,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
6741
7302
|
var IntegrationDefinitionRegisterModule = {
|
|
6742
7303
|
command: "register <filename>",
|
|
6743
7304
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
6744
|
-
builder: (
|
|
7305
|
+
builder: (yargs36) => withConfiguration(
|
|
6745
7306
|
withApiOptions(
|
|
6746
7307
|
withTeamOptions(
|
|
6747
|
-
|
|
7308
|
+
yargs36.positional("filename", {
|
|
6748
7309
|
demandOption: true,
|
|
6749
7310
|
describe: "Integration definition manifest to register"
|
|
6750
7311
|
})
|
|
@@ -6763,10 +7324,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
6763
7324
|
var IntegrationDefinitionRemoveModule = {
|
|
6764
7325
|
command: "remove <type>",
|
|
6765
7326
|
describe: "Deletes a custom integration definition from a team. This will uninstall it on any active projects. Existing usages of the integration may break. The API key used must have team admin permissions.",
|
|
6766
|
-
builder: (
|
|
7327
|
+
builder: (yargs36) => withConfiguration(
|
|
6767
7328
|
withApiOptions(
|
|
6768
7329
|
withTeamOptions(
|
|
6769
|
-
|
|
7330
|
+
yargs36.positional("type", {
|
|
6770
7331
|
demandOption: true,
|
|
6771
7332
|
describe: "Integration type (from its manifest) to remove."
|
|
6772
7333
|
})
|
|
@@ -6784,9 +7345,9 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
6784
7345
|
var IntegrationDefinitionModule = {
|
|
6785
7346
|
command: "definition <command>",
|
|
6786
7347
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
6787
|
-
builder: (
|
|
7348
|
+
builder: (yargs36) => yargs36.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).demandCommand(),
|
|
6788
7349
|
handler: () => {
|
|
6789
|
-
|
|
7350
|
+
yargs25.help();
|
|
6790
7351
|
}
|
|
6791
7352
|
};
|
|
6792
7353
|
|
|
@@ -6826,10 +7387,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
6826
7387
|
var IntegrationInstallModule = {
|
|
6827
7388
|
command: "install <type>",
|
|
6828
7389
|
describe: "Installs an integration to a project. The integration may be built-in or custom. Custom integrations must be registered to the parent team first.",
|
|
6829
|
-
builder: (
|
|
7390
|
+
builder: (yargs36) => withConfiguration(
|
|
6830
7391
|
withApiOptions(
|
|
6831
7392
|
withProjectOptions(
|
|
6832
|
-
|
|
7393
|
+
yargs36.positional("type", {
|
|
6833
7394
|
demandOption: true,
|
|
6834
7395
|
describe: "Integration type to install (as defined in its manifest)"
|
|
6835
7396
|
}).option("configuration", {
|
|
@@ -6851,10 +7412,10 @@ var IntegrationInstallModule = {
|
|
|
6851
7412
|
var IntegrationUninstallModule = {
|
|
6852
7413
|
command: "uninstall <type>",
|
|
6853
7414
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
6854
|
-
builder: (
|
|
7415
|
+
builder: (yargs36) => withConfiguration(
|
|
6855
7416
|
withApiOptions(
|
|
6856
7417
|
withProjectOptions(
|
|
6857
|
-
|
|
7418
|
+
yargs36.positional("type", {
|
|
6858
7419
|
demandOption: true,
|
|
6859
7420
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
6860
7421
|
})
|
|
@@ -6872,9 +7433,9 @@ var IntegrationUninstallModule = {
|
|
|
6872
7433
|
var IntegrationCommand = {
|
|
6873
7434
|
command: "integration <command>",
|
|
6874
7435
|
describe: "Integration management commands",
|
|
6875
|
-
builder: (
|
|
7436
|
+
builder: (yargs36) => yargs36.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
6876
7437
|
handler: () => {
|
|
6877
|
-
|
|
7438
|
+
yargs26.showHelp();
|
|
6878
7439
|
}
|
|
6879
7440
|
};
|
|
6880
7441
|
|
|
@@ -6902,7 +7463,7 @@ import { PostHog } from "posthog-node";
|
|
|
6902
7463
|
// package.json
|
|
6903
7464
|
var package_default = {
|
|
6904
7465
|
name: "@uniformdev/cli",
|
|
6905
|
-
version: "19.
|
|
7466
|
+
version: "19.167.1",
|
|
6906
7467
|
description: "Uniform command line interface tool",
|
|
6907
7468
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
6908
7469
|
main: "./cli.js",
|
|
@@ -6943,7 +7504,7 @@ var package_default = {
|
|
|
6943
7504
|
dotenv: "^16.0.3",
|
|
6944
7505
|
execa: "5.1.1",
|
|
6945
7506
|
"fs-jetpack": "5.1.0",
|
|
6946
|
-
graphql: "16.
|
|
7507
|
+
graphql: "16.9.0",
|
|
6947
7508
|
"graphql-request": "6.1.0",
|
|
6948
7509
|
"image-size": "^1.0.2",
|
|
6949
7510
|
inquirer: "9.2.17",
|
|
@@ -6960,7 +7521,7 @@ var package_default = {
|
|
|
6960
7521
|
slugify: "1.6.6",
|
|
6961
7522
|
undici: "^6.10.1",
|
|
6962
7523
|
yargs: "^17.6.2",
|
|
6963
|
-
zod: "3.
|
|
7524
|
+
zod: "3.23.8"
|
|
6964
7525
|
},
|
|
6965
7526
|
devDependencies: {
|
|
6966
7527
|
"@types/diff": "5.0.9",
|
|
@@ -7918,10 +8479,10 @@ var NewMeshCmd = {
|
|
|
7918
8479
|
};
|
|
7919
8480
|
|
|
7920
8481
|
// src/commands/optimize/index.ts
|
|
7921
|
-
import
|
|
8482
|
+
import yargs28 from "yargs";
|
|
7922
8483
|
|
|
7923
8484
|
// src/commands/optimize/manifest.ts
|
|
7924
|
-
import
|
|
8485
|
+
import yargs27 from "yargs";
|
|
7925
8486
|
|
|
7926
8487
|
// src/commands/optimize/manifest/download.ts
|
|
7927
8488
|
import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
|
|
@@ -7936,7 +8497,7 @@ var UniformBaseUrl = "https://uniform.app";
|
|
|
7936
8497
|
var module = {
|
|
7937
8498
|
command: "download [output]",
|
|
7938
8499
|
describe: "Download intent manifest",
|
|
7939
|
-
builder: (
|
|
8500
|
+
builder: (yargs36) => yargs36.option("apiKey", {
|
|
7940
8501
|
alias: "k",
|
|
7941
8502
|
demandOption: true,
|
|
7942
8503
|
string: true,
|
|
@@ -8037,10 +8598,10 @@ var module2 = {
|
|
|
8037
8598
|
command: "manifest <command>",
|
|
8038
8599
|
describe: "Intent manifest commands",
|
|
8039
8600
|
builder: () => {
|
|
8040
|
-
return
|
|
8601
|
+
return yargs27.command(download_default);
|
|
8041
8602
|
},
|
|
8042
8603
|
handler: () => {
|
|
8043
|
-
|
|
8604
|
+
yargs27.showHelp();
|
|
8044
8605
|
}
|
|
8045
8606
|
};
|
|
8046
8607
|
var manifest_default = module2;
|
|
@@ -8051,29 +8612,29 @@ var OptimizeCommand = {
|
|
|
8051
8612
|
aliases: ["opt"],
|
|
8052
8613
|
describe: "Uniform Optimize commands",
|
|
8053
8614
|
builder: () => {
|
|
8054
|
-
return
|
|
8615
|
+
return yargs28.command(manifest_default);
|
|
8055
8616
|
},
|
|
8056
8617
|
handler: () => {
|
|
8057
|
-
|
|
8618
|
+
yargs28.showHelp();
|
|
8058
8619
|
}
|
|
8059
8620
|
};
|
|
8060
8621
|
|
|
8061
8622
|
// src/commands/project-map/index.ts
|
|
8062
|
-
import
|
|
8623
|
+
import yargs31 from "yargs";
|
|
8063
8624
|
|
|
8064
8625
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
8065
|
-
import
|
|
8626
|
+
import yargs29 from "yargs";
|
|
8066
8627
|
|
|
8067
8628
|
// src/commands/project-map/commands/ProjectMapDefinition/get.ts
|
|
8068
8629
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
8069
8630
|
var ProjectMapDefinitionGetModule = {
|
|
8070
8631
|
command: "get <id>",
|
|
8071
8632
|
describe: "Fetch a project map",
|
|
8072
|
-
builder: (
|
|
8633
|
+
builder: (yargs36) => withFormatOptions(
|
|
8073
8634
|
withConfiguration(
|
|
8074
8635
|
withApiOptions(
|
|
8075
8636
|
withProjectOptions(
|
|
8076
|
-
|
|
8637
|
+
yargs36.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
8077
8638
|
)
|
|
8078
8639
|
)
|
|
8079
8640
|
)
|
|
@@ -8097,7 +8658,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
8097
8658
|
command: "list",
|
|
8098
8659
|
describe: "List of project maps",
|
|
8099
8660
|
aliases: ["ls"],
|
|
8100
|
-
builder: (
|
|
8661
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
8101
8662
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8102
8663
|
const fetch3 = nodeFetchProxy(proxy);
|
|
8103
8664
|
const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -8155,11 +8716,11 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
8155
8716
|
var ProjectMapDefinitionPullModule = {
|
|
8156
8717
|
command: "pull <directory>",
|
|
8157
8718
|
describe: "Pulls all project maps to local files in a directory",
|
|
8158
|
-
builder: (
|
|
8719
|
+
builder: (yargs36) => withConfiguration(
|
|
8159
8720
|
withApiOptions(
|
|
8160
8721
|
withProjectOptions(
|
|
8161
8722
|
withDiffOptions(
|
|
8162
|
-
|
|
8723
|
+
yargs36.positional("directory", {
|
|
8163
8724
|
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.",
|
|
8164
8725
|
type: "string"
|
|
8165
8726
|
}).option("format", {
|
|
@@ -8237,11 +8798,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
|
|
|
8237
8798
|
var ProjectMapDefinitionPushModule = {
|
|
8238
8799
|
command: "push <directory>",
|
|
8239
8800
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
8240
|
-
builder: (
|
|
8801
|
+
builder: (yargs36) => withConfiguration(
|
|
8241
8802
|
withApiOptions(
|
|
8242
8803
|
withProjectOptions(
|
|
8243
8804
|
withDiffOptions(
|
|
8244
|
-
|
|
8805
|
+
yargs36.positional("directory", {
|
|
8245
8806
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
8246
8807
|
type: "string"
|
|
8247
8808
|
}).option("what-if", {
|
|
@@ -8308,9 +8869,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
8308
8869
|
command: "remove <id>",
|
|
8309
8870
|
aliases: ["delete", "rm"],
|
|
8310
8871
|
describe: "Delete a project map",
|
|
8311
|
-
builder: (
|
|
8872
|
+
builder: (yargs36) => withConfiguration(
|
|
8312
8873
|
withApiOptions(
|
|
8313
|
-
withProjectOptions(
|
|
8874
|
+
withProjectOptions(yargs36.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
8314
8875
|
)
|
|
8315
8876
|
),
|
|
8316
8877
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -8326,10 +8887,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
8326
8887
|
command: "update <filename>",
|
|
8327
8888
|
aliases: ["put"],
|
|
8328
8889
|
describe: "Insert or update a project map",
|
|
8329
|
-
builder: (
|
|
8890
|
+
builder: (yargs36) => withConfiguration(
|
|
8330
8891
|
withApiOptions(
|
|
8331
8892
|
withProjectOptions(
|
|
8332
|
-
|
|
8893
|
+
yargs36.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
8333
8894
|
)
|
|
8334
8895
|
)
|
|
8335
8896
|
),
|
|
@@ -8345,25 +8906,25 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
8345
8906
|
var ProjectMapDefinitionModule = {
|
|
8346
8907
|
command: "definition <command>",
|
|
8347
8908
|
describe: "Commands for ProjectMap Definitions",
|
|
8348
|
-
builder: (
|
|
8909
|
+
builder: (yargs36) => yargs36.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
8349
8910
|
handler: () => {
|
|
8350
|
-
|
|
8911
|
+
yargs29.help();
|
|
8351
8912
|
}
|
|
8352
8913
|
};
|
|
8353
8914
|
|
|
8354
8915
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
8355
|
-
import
|
|
8916
|
+
import yargs30 from "yargs";
|
|
8356
8917
|
|
|
8357
8918
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
8358
8919
|
import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
|
|
8359
8920
|
var ProjectMapNodeGetModule = {
|
|
8360
8921
|
command: "get <id> <projectMapId>",
|
|
8361
8922
|
describe: "Fetch a project map node",
|
|
8362
|
-
builder: (
|
|
8923
|
+
builder: (yargs36) => withConfiguration(
|
|
8363
8924
|
withFormatOptions(
|
|
8364
8925
|
withApiOptions(
|
|
8365
8926
|
withProjectOptions(
|
|
8366
|
-
|
|
8927
|
+
yargs36.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
8367
8928
|
)
|
|
8368
8929
|
)
|
|
8369
8930
|
)
|
|
@@ -8388,12 +8949,12 @@ var ProjectMapNodeListModule = {
|
|
|
8388
8949
|
command: "list <projectMapId>",
|
|
8389
8950
|
describe: "List project map nodes",
|
|
8390
8951
|
aliases: ["ls"],
|
|
8391
|
-
builder: (
|
|
8952
|
+
builder: (yargs36) => withConfiguration(
|
|
8392
8953
|
withFormatOptions(
|
|
8393
8954
|
withApiOptions(
|
|
8394
8955
|
withProjectOptions(
|
|
8395
8956
|
withStateOptions(
|
|
8396
|
-
|
|
8957
|
+
yargs36.positional("projectMapId", {
|
|
8397
8958
|
demandOption: true,
|
|
8398
8959
|
describe: "ProjectMap UUID to fetch from"
|
|
8399
8960
|
})
|
|
@@ -8466,11 +9027,11 @@ function createProjectMapNodeEngineDataSource({
|
|
|
8466
9027
|
var ProjectMapNodePullModule = {
|
|
8467
9028
|
command: "pull <directory>",
|
|
8468
9029
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
8469
|
-
builder: (
|
|
9030
|
+
builder: (yargs36) => withConfiguration(
|
|
8470
9031
|
withApiOptions(
|
|
8471
9032
|
withProjectOptions(
|
|
8472
9033
|
withDiffOptions(
|
|
8473
|
-
|
|
9034
|
+
yargs36.positional("directory", {
|
|
8474
9035
|
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.",
|
|
8475
9036
|
type: "string"
|
|
8476
9037
|
}).option("format", {
|
|
@@ -8552,11 +9113,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
|
|
|
8552
9113
|
var ProjectMapNodePushModule = {
|
|
8553
9114
|
command: "push <directory>",
|
|
8554
9115
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
8555
|
-
builder: (
|
|
9116
|
+
builder: (yargs36) => withConfiguration(
|
|
8556
9117
|
withApiOptions(
|
|
8557
9118
|
withProjectOptions(
|
|
8558
9119
|
withDiffOptions(
|
|
8559
|
-
|
|
9120
|
+
yargs36.positional("directory", {
|
|
8560
9121
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
8561
9122
|
type: "string"
|
|
8562
9123
|
}).option("what-if", {
|
|
@@ -8632,10 +9193,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
8632
9193
|
command: "remove <id> <projectMapId>",
|
|
8633
9194
|
aliases: ["delete", "rm"],
|
|
8634
9195
|
describe: "Delete a project map node",
|
|
8635
|
-
builder: (
|
|
9196
|
+
builder: (yargs36) => withConfiguration(
|
|
8636
9197
|
withApiOptions(
|
|
8637
9198
|
withProjectOptions(
|
|
8638
|
-
|
|
9199
|
+
yargs36.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
8639
9200
|
)
|
|
8640
9201
|
)
|
|
8641
9202
|
),
|
|
@@ -8652,10 +9213,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
8652
9213
|
command: "update <filename> <projectMapId>",
|
|
8653
9214
|
aliases: ["put"],
|
|
8654
9215
|
describe: "Insert or update a project map node",
|
|
8655
|
-
builder: (
|
|
9216
|
+
builder: (yargs36) => withConfiguration(
|
|
8656
9217
|
withApiOptions(
|
|
8657
9218
|
withProjectOptions(
|
|
8658
|
-
|
|
9219
|
+
yargs36.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
8659
9220
|
)
|
|
8660
9221
|
)
|
|
8661
9222
|
),
|
|
@@ -8671,9 +9232,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
8671
9232
|
var ProjectMapNodeModule = {
|
|
8672
9233
|
command: "node <command>",
|
|
8673
9234
|
describe: "Commands for ProjectMap Nodes",
|
|
8674
|
-
builder: (
|
|
9235
|
+
builder: (yargs36) => yargs36.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
8675
9236
|
handler: () => {
|
|
8676
|
-
|
|
9237
|
+
yargs30.help();
|
|
8677
9238
|
}
|
|
8678
9239
|
};
|
|
8679
9240
|
|
|
@@ -8682,28 +9243,28 @@ var ProjectMapCommand = {
|
|
|
8682
9243
|
command: "project-map <command>",
|
|
8683
9244
|
aliases: ["prm"],
|
|
8684
9245
|
describe: "Uniform ProjectMap commands",
|
|
8685
|
-
builder: (
|
|
9246
|
+
builder: (yargs36) => yargs36.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
8686
9247
|
handler: () => {
|
|
8687
|
-
|
|
9248
|
+
yargs31.showHelp();
|
|
8688
9249
|
}
|
|
8689
9250
|
};
|
|
8690
9251
|
|
|
8691
9252
|
// src/commands/redirect/index.ts
|
|
8692
|
-
import
|
|
9253
|
+
import yargs33 from "yargs";
|
|
8693
9254
|
|
|
8694
9255
|
// src/commands/redirect/commands/redirect.ts
|
|
8695
|
-
import
|
|
9256
|
+
import yargs32 from "yargs";
|
|
8696
9257
|
|
|
8697
9258
|
// src/commands/redirect/commands/RedirectDefinition/get.ts
|
|
8698
9259
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
8699
9260
|
var RedirectDefinitionGetModule = {
|
|
8700
9261
|
command: "get <id>",
|
|
8701
9262
|
describe: "Fetch a redirect",
|
|
8702
|
-
builder: (
|
|
9263
|
+
builder: (yargs36) => withConfiguration(
|
|
8703
9264
|
withFormatOptions(
|
|
8704
9265
|
withApiOptions(
|
|
8705
9266
|
withProjectOptions(
|
|
8706
|
-
|
|
9267
|
+
yargs36.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
8707
9268
|
)
|
|
8708
9269
|
)
|
|
8709
9270
|
)
|
|
@@ -8727,7 +9288,7 @@ var RedirectDefinitionListModule = {
|
|
|
8727
9288
|
command: "list",
|
|
8728
9289
|
describe: "List of redirects",
|
|
8729
9290
|
aliases: ["ls"],
|
|
8730
|
-
builder: (
|
|
9291
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
8731
9292
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8732
9293
|
const fetch3 = nodeFetchProxy(proxy);
|
|
8733
9294
|
const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -8794,11 +9355,11 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
8794
9355
|
var RedirectDefinitionPullModule = {
|
|
8795
9356
|
command: "pull <directory>",
|
|
8796
9357
|
describe: "Pulls all redirects to local files in a directory",
|
|
8797
|
-
builder: (
|
|
9358
|
+
builder: (yargs36) => withConfiguration(
|
|
8798
9359
|
withApiOptions(
|
|
8799
9360
|
withProjectOptions(
|
|
8800
9361
|
withDiffOptions(
|
|
8801
|
-
|
|
9362
|
+
yargs36.positional("directory", {
|
|
8802
9363
|
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.",
|
|
8803
9364
|
type: "string"
|
|
8804
9365
|
}).option("format", {
|
|
@@ -8877,11 +9438,11 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
|
|
|
8877
9438
|
var RedirectDefinitionPushModule = {
|
|
8878
9439
|
command: "push <directory>",
|
|
8879
9440
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
8880
|
-
builder: (
|
|
9441
|
+
builder: (yargs36) => withConfiguration(
|
|
8881
9442
|
withApiOptions(
|
|
8882
9443
|
withProjectOptions(
|
|
8883
9444
|
withDiffOptions(
|
|
8884
|
-
|
|
9445
|
+
yargs36.positional("directory", {
|
|
8885
9446
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
8886
9447
|
type: "string"
|
|
8887
9448
|
}).option("what-if", {
|
|
@@ -8948,9 +9509,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
8948
9509
|
command: "remove <id>",
|
|
8949
9510
|
aliases: ["delete", "rm"],
|
|
8950
9511
|
describe: "Delete a redirect",
|
|
8951
|
-
builder: (
|
|
9512
|
+
builder: (yargs36) => withConfiguration(
|
|
8952
9513
|
withApiOptions(
|
|
8953
|
-
withProjectOptions(
|
|
9514
|
+
withProjectOptions(yargs36.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
8954
9515
|
)
|
|
8955
9516
|
),
|
|
8956
9517
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -8966,10 +9527,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
8966
9527
|
command: "update <filename>",
|
|
8967
9528
|
aliases: ["put"],
|
|
8968
9529
|
describe: "Insert or update a redirect",
|
|
8969
|
-
builder: (
|
|
9530
|
+
builder: (yargs36) => withConfiguration(
|
|
8970
9531
|
withApiOptions(
|
|
8971
9532
|
withProjectOptions(
|
|
8972
|
-
|
|
9533
|
+
yargs36.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
8973
9534
|
)
|
|
8974
9535
|
)
|
|
8975
9536
|
),
|
|
@@ -8985,9 +9546,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
8985
9546
|
var RedirectDefinitionModule = {
|
|
8986
9547
|
command: "definition <command>",
|
|
8987
9548
|
describe: "Commands for Redirect Definitions",
|
|
8988
|
-
builder: (
|
|
9549
|
+
builder: (yargs36) => yargs36.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
8989
9550
|
handler: () => {
|
|
8990
|
-
|
|
9551
|
+
yargs32.help();
|
|
8991
9552
|
}
|
|
8992
9553
|
};
|
|
8993
9554
|
|
|
@@ -8996,14 +9557,14 @@ var RedirectCommand = {
|
|
|
8996
9557
|
command: "redirect <command>",
|
|
8997
9558
|
aliases: ["red"],
|
|
8998
9559
|
describe: "Uniform Redirect commands",
|
|
8999
|
-
builder: (
|
|
9560
|
+
builder: (yargs36) => yargs36.command(RedirectDefinitionModule).demandCommand(),
|
|
9000
9561
|
handler: () => {
|
|
9001
|
-
|
|
9562
|
+
yargs33.showHelp();
|
|
9002
9563
|
}
|
|
9003
9564
|
};
|
|
9004
9565
|
|
|
9005
9566
|
// src/commands/sync/index.ts
|
|
9006
|
-
import
|
|
9567
|
+
import yargs34 from "yargs";
|
|
9007
9568
|
|
|
9008
9569
|
// src/commands/sync/commands/util.ts
|
|
9009
9570
|
import ora2 from "ora";
|
|
@@ -9063,11 +9624,11 @@ function patchConsole(fn, ora3, replay = []) {
|
|
|
9063
9624
|
var SyncPullModule = {
|
|
9064
9625
|
command: "pull",
|
|
9065
9626
|
describe: "Pulls whole project to local files in a directory",
|
|
9066
|
-
builder: (
|
|
9627
|
+
builder: (yargs36) => withConfiguration(
|
|
9067
9628
|
withApiOptions(
|
|
9068
9629
|
withProjectOptions(
|
|
9069
9630
|
withDiffOptions(
|
|
9070
|
-
|
|
9631
|
+
yargs36.option("what-if", {
|
|
9071
9632
|
alias: ["w"],
|
|
9072
9633
|
describe: "What-if mode reports what would be done but changes no files",
|
|
9073
9634
|
default: false,
|
|
@@ -9079,11 +9640,6 @@ var SyncPullModule = {
|
|
|
9079
9640
|
),
|
|
9080
9641
|
handler: async ({ serialization, ...otherParams }) => {
|
|
9081
9642
|
const config2 = serialization;
|
|
9082
|
-
let isUsingDeprecatedPatternConfig = false;
|
|
9083
|
-
if (config2.entitiesConfig.pattern) {
|
|
9084
|
-
isUsingDeprecatedPatternConfig = true;
|
|
9085
|
-
config2.entitiesConfig.componentPattern ??= config2.entitiesConfig.pattern;
|
|
9086
|
-
}
|
|
9087
9643
|
const enabledEntities = Object.entries({
|
|
9088
9644
|
locale: LocalePullModule,
|
|
9089
9645
|
asset: AssetPullModule,
|
|
@@ -9097,7 +9653,9 @@ var SyncPullModule = {
|
|
|
9097
9653
|
enrichment: EnrichmentPullModule,
|
|
9098
9654
|
aggregate: AggregatePullModule,
|
|
9099
9655
|
component: ComponentPullModule,
|
|
9656
|
+
pattern: PatternPullModule,
|
|
9100
9657
|
componentPattern: ComponentPatternPullModule,
|
|
9658
|
+
compositionPattern: CompositionPatternPullModule,
|
|
9101
9659
|
composition: CompositionPullModule,
|
|
9102
9660
|
projectMapDefinition: ProjectMapDefinitionPullModule,
|
|
9103
9661
|
projectMapNode: ProjectMapNodePullModule,
|
|
@@ -9126,9 +9684,10 @@ var SyncPullModule = {
|
|
|
9126
9684
|
state: entityConfigSupportsPullState(entityConfig) ? entityConfig.state ?? 0 : 0,
|
|
9127
9685
|
format: getFormat(entityType, config2),
|
|
9128
9686
|
onlyCompositions: entityType === "composition" ? true : void 0,
|
|
9129
|
-
onlyPatterns:
|
|
9687
|
+
onlyPatterns: ["componentPattern", "compositionPattern"].includes(entityType) ? true : void 0,
|
|
9688
|
+
patternType: entityType === "compositionPattern" ? "composition" : entityType === "componentPattern" ? "component" : void 0,
|
|
9130
9689
|
mode: getPullMode(entityType, config2),
|
|
9131
|
-
directory: getPullFilename(entityType, config2
|
|
9690
|
+
directory: getPullFilename(entityType, config2),
|
|
9132
9691
|
allowEmptySource: config2.allowEmptySource
|
|
9133
9692
|
}),
|
|
9134
9693
|
{
|
|
@@ -9155,13 +9714,11 @@ var getPullMode = (entityType, config2) => {
|
|
|
9155
9714
|
entityType
|
|
9156
9715
|
});
|
|
9157
9716
|
};
|
|
9158
|
-
var getPullFilename = (entityType, config2
|
|
9717
|
+
var getPullFilename = (entityType, config2) => {
|
|
9159
9718
|
return getDirectoryOrFilename({
|
|
9160
9719
|
operation: "pull",
|
|
9161
9720
|
config: config2,
|
|
9162
|
-
entityType
|
|
9163
|
-
// This fallback can be removed when publishing a major release
|
|
9164
|
-
defaultEntityFolderName: isUsingDeprecatedPatternConfig && entityType === "componentPattern" ? "pattern" : void 0
|
|
9721
|
+
entityType
|
|
9165
9722
|
});
|
|
9166
9723
|
};
|
|
9167
9724
|
var getFormat = (entityType, config2) => {
|
|
@@ -9177,11 +9734,11 @@ var getFormat = (entityType, config2) => {
|
|
|
9177
9734
|
var SyncPushModule = {
|
|
9178
9735
|
command: "push",
|
|
9179
9736
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
9180
|
-
builder: (
|
|
9737
|
+
builder: (yargs36) => withConfiguration(
|
|
9181
9738
|
withApiOptions(
|
|
9182
9739
|
withProjectOptions(
|
|
9183
9740
|
withDiffOptions(
|
|
9184
|
-
|
|
9741
|
+
yargs36.option("what-if", {
|
|
9185
9742
|
alias: ["w"],
|
|
9186
9743
|
describe: "What-if mode reports what would be done but changes nothing",
|
|
9187
9744
|
default: false,
|
|
@@ -9193,11 +9750,6 @@ var SyncPushModule = {
|
|
|
9193
9750
|
),
|
|
9194
9751
|
handler: async ({ serialization, ...otherParams }) => {
|
|
9195
9752
|
const config2 = serialization;
|
|
9196
|
-
let isUsingDeprecatedPatternConfig = false;
|
|
9197
|
-
if (config2.entitiesConfig.pattern) {
|
|
9198
|
-
isUsingDeprecatedPatternConfig = true;
|
|
9199
|
-
config2.entitiesConfig.componentPattern ??= config2.entitiesConfig.pattern;
|
|
9200
|
-
}
|
|
9201
9753
|
const enabledEntities = Object.entries({
|
|
9202
9754
|
locale: LocalePushModule,
|
|
9203
9755
|
asset: AssetPushModule,
|
|
@@ -9211,7 +9763,9 @@ var SyncPushModule = {
|
|
|
9211
9763
|
enrichment: EnrichmentPushModule,
|
|
9212
9764
|
aggregate: AggregatePushModule,
|
|
9213
9765
|
component: ComponentPushModule,
|
|
9766
|
+
pattern: PatternPushModule,
|
|
9214
9767
|
componentPattern: ComponentPatternPushModule,
|
|
9768
|
+
compositionPattern: CompositionPatternPushModule,
|
|
9215
9769
|
composition: CompositionPushModule,
|
|
9216
9770
|
projectMapDefinition: ProjectMapDefinitionPushModule,
|
|
9217
9771
|
projectMapNode: ProjectMapNodePushModule,
|
|
@@ -9236,9 +9790,10 @@ var SyncPushModule = {
|
|
|
9236
9790
|
state: 0,
|
|
9237
9791
|
format: getFormat2(entityType, config2),
|
|
9238
9792
|
onlyCompositions: entityType === "composition" ? true : void 0,
|
|
9239
|
-
onlyPatterns:
|
|
9793
|
+
onlyPatterns: ["componentPattern", "compositionPattern"].includes(entityType) ? true : void 0,
|
|
9794
|
+
patternType: entityType === "compositionPattern" ? "composition" : entityType === "componentPattern" ? "component" : void 0,
|
|
9240
9795
|
mode: getPushMode(entityType, config2),
|
|
9241
|
-
directory: getPushFilename(entityType, config2
|
|
9796
|
+
directory: getPushFilename(entityType, config2),
|
|
9242
9797
|
allowEmptySource: config2.allowEmptySource
|
|
9243
9798
|
}),
|
|
9244
9799
|
{
|
|
@@ -9258,6 +9813,9 @@ var SyncPushModule = {
|
|
|
9258
9813
|
if (config2.entitiesConfig?.componentPattern && config2.entitiesConfig?.componentPattern?.push?.disabled !== true && config2.entitiesConfig?.componentPattern?.publish) {
|
|
9259
9814
|
await ComponentPatternPublishModule.handler({ ...otherParams, all: true });
|
|
9260
9815
|
}
|
|
9816
|
+
if (config2.entitiesConfig?.compositionPattern && config2.entitiesConfig?.compositionPattern?.push?.disabled !== true && config2.entitiesConfig?.compositionPattern?.publish) {
|
|
9817
|
+
await CompositionPatternPublishModule.handler({ ...otherParams, all: true });
|
|
9818
|
+
}
|
|
9261
9819
|
if (config2.entitiesConfig?.composition && config2.entitiesConfig?.composition?.push?.disabled !== true && config2.entitiesConfig?.composition?.publish) {
|
|
9262
9820
|
await CompositionPublishModule.handler({ ...otherParams, all: true });
|
|
9263
9821
|
}
|
|
@@ -9277,13 +9835,11 @@ var getPushMode = (entityType, config2) => {
|
|
|
9277
9835
|
entityType
|
|
9278
9836
|
});
|
|
9279
9837
|
};
|
|
9280
|
-
var getPushFilename = (entityType, config2
|
|
9838
|
+
var getPushFilename = (entityType, config2) => {
|
|
9281
9839
|
return getDirectoryOrFilename({
|
|
9282
9840
|
operation: "push",
|
|
9283
9841
|
config: config2,
|
|
9284
|
-
entityType
|
|
9285
|
-
// This fallback can be removed when publishing a major release
|
|
9286
|
-
defaultEntityFolderName: isUsingDeprecatedPatternConfig && entityType === "componentPattern" ? "pattern" : void 0
|
|
9842
|
+
entityType
|
|
9287
9843
|
});
|
|
9288
9844
|
};
|
|
9289
9845
|
var getFormat2 = (entityType, config2) => {
|
|
@@ -9299,9 +9855,9 @@ var getFormat2 = (entityType, config2) => {
|
|
|
9299
9855
|
var SyncCommand = {
|
|
9300
9856
|
command: "sync <command>",
|
|
9301
9857
|
describe: "Uniform Sync commands",
|
|
9302
|
-
builder: (
|
|
9858
|
+
builder: (yargs36) => yargs36.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
9303
9859
|
handler: () => {
|
|
9304
|
-
|
|
9860
|
+
yargs34.showHelp();
|
|
9305
9861
|
}
|
|
9306
9862
|
};
|
|
9307
9863
|
|
|
@@ -9536,8 +10092,7 @@ var checkLocalDepsVersions = async (args) => {
|
|
|
9536
10092
|
let isOutside = false;
|
|
9537
10093
|
let warning = `${magenta("Warning:")} Installed Uniform packages should be the same version`;
|
|
9538
10094
|
const localPackages = await tryReadJSON(join4(process.cwd(), "package.json"));
|
|
9539
|
-
if (!localPackages)
|
|
9540
|
-
return;
|
|
10095
|
+
if (!localPackages) return;
|
|
9541
10096
|
let firstVersion;
|
|
9542
10097
|
const allDependencies = {
|
|
9543
10098
|
...localPackages?.dependencies ?? {},
|
|
@@ -9557,8 +10112,7 @@ First found was: v${firstVersion}`;
|
|
|
9557
10112
|
}
|
|
9558
10113
|
}
|
|
9559
10114
|
}
|
|
9560
|
-
if (isOutside)
|
|
9561
|
-
logCallout(warning);
|
|
10115
|
+
if (isOutside) logCallout(warning);
|
|
9562
10116
|
} catch (e) {
|
|
9563
10117
|
if (args.verbose) {
|
|
9564
10118
|
console.warn(`There was an error validating the local project dependencies`, e);
|
|
@@ -9568,7 +10122,7 @@ First found was: v${firstVersion}`;
|
|
|
9568
10122
|
|
|
9569
10123
|
// src/index.ts
|
|
9570
10124
|
dotenv.config();
|
|
9571
|
-
var yarggery =
|
|
10125
|
+
var yarggery = yargs35(hideBin(process.argv));
|
|
9572
10126
|
var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
|
|
9573
10127
|
var configuration = loadConfig(inlineConfigurationFilePath || null);
|
|
9574
10128
|
yarggery.option("verbose", {
|