@uniformdev/cli 19.212.2-alpha.9 → 19.213.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +767 -626
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
22
|
import * as dotenv from "dotenv";
|
|
23
|
-
import
|
|
23
|
+
import yargs37 from "yargs";
|
|
24
24
|
import { hideBin } from "yargs/helpers";
|
|
25
25
|
|
|
26
26
|
// src/commands/canvas/index.ts
|
|
@@ -580,20 +580,20 @@ function getFileClient(options) {
|
|
|
580
580
|
var AssetGetModule = {
|
|
581
581
|
command: "get <id>",
|
|
582
582
|
describe: "Get an asset",
|
|
583
|
-
builder: (
|
|
583
|
+
builder: (yargs38) => withConfiguration(
|
|
584
584
|
withDebugOptions(
|
|
585
585
|
withFormatOptions(
|
|
586
586
|
withApiOptions(
|
|
587
587
|
withProjectOptions(
|
|
588
|
-
|
|
588
|
+
yargs38.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
589
589
|
)
|
|
590
590
|
)
|
|
591
591
|
)
|
|
592
592
|
)
|
|
593
593
|
),
|
|
594
594
|
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
|
|
595
|
-
const
|
|
596
|
-
const client = getAssetClient({ apiKey, apiHost, fetch:
|
|
595
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
596
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
597
597
|
const res = await client.get({ offset: 0, limit: 1, assetId: id });
|
|
598
598
|
if (!res) {
|
|
599
599
|
throw new Error(`Asset with ID ${id} not found`);
|
|
@@ -606,10 +606,10 @@ var AssetGetModule = {
|
|
|
606
606
|
var AssetListModule = {
|
|
607
607
|
command: "list",
|
|
608
608
|
describe: "List assets",
|
|
609
|
-
builder: (
|
|
609
|
+
builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
|
|
610
610
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
611
|
-
const
|
|
612
|
-
const client = getAssetClient({ apiKey, apiHost, fetch:
|
|
611
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
612
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
613
613
|
const res = await client.get({ offset: 0, limit: 1e3 });
|
|
614
614
|
emitWithFormat(res.assets, format, filename);
|
|
615
615
|
}
|
|
@@ -965,8 +965,8 @@ function prepCompositionForDisk(composition) {
|
|
|
965
965
|
delete prepped.state;
|
|
966
966
|
return prepped;
|
|
967
967
|
}
|
|
968
|
-
function withStateOptions(
|
|
969
|
-
return
|
|
968
|
+
function withStateOptions(yargs38, defaultState = "preview") {
|
|
969
|
+
return yargs38.option("state", {
|
|
970
970
|
type: "string",
|
|
971
971
|
describe: `State to fetch.`,
|
|
972
972
|
choices: ["preview", "published"],
|
|
@@ -1048,12 +1048,12 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
1048
1048
|
var AssetPullModule = {
|
|
1049
1049
|
command: "pull <directory>",
|
|
1050
1050
|
describe: "Pulls all assets to local files in a directory",
|
|
1051
|
-
builder: (
|
|
1051
|
+
builder: (yargs38) => withConfiguration(
|
|
1052
1052
|
withApiOptions(
|
|
1053
1053
|
withDebugOptions(
|
|
1054
1054
|
withProjectOptions(
|
|
1055
1055
|
withDiffOptions(
|
|
1056
|
-
|
|
1056
|
+
yargs38.positional("directory", {
|
|
1057
1057
|
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.",
|
|
1058
1058
|
type: "string"
|
|
1059
1059
|
}).option("format", {
|
|
@@ -1087,14 +1087,14 @@ var AssetPullModule = {
|
|
|
1087
1087
|
diff: diffMode,
|
|
1088
1088
|
allowEmptySource
|
|
1089
1089
|
}) => {
|
|
1090
|
-
const
|
|
1090
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1091
1091
|
const client = getAssetClient({
|
|
1092
1092
|
apiKey,
|
|
1093
1093
|
apiHost,
|
|
1094
|
-
fetch:
|
|
1094
|
+
fetch: fetch3,
|
|
1095
1095
|
projectId
|
|
1096
1096
|
});
|
|
1097
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
1097
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1098
1098
|
const source = createAssetEngineDataSource({ client, verbose });
|
|
1099
1099
|
let target;
|
|
1100
1100
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -1167,12 +1167,12 @@ var AssetPullModule = {
|
|
|
1167
1167
|
var AssetPushModule = {
|
|
1168
1168
|
command: "push <directory>",
|
|
1169
1169
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
1170
|
-
builder: (
|
|
1170
|
+
builder: (yargs38) => withConfiguration(
|
|
1171
1171
|
withApiOptions(
|
|
1172
1172
|
withDebugOptions(
|
|
1173
1173
|
withProjectOptions(
|
|
1174
1174
|
withDiffOptions(
|
|
1175
|
-
|
|
1175
|
+
yargs38.positional("directory", {
|
|
1176
1176
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
1177
1177
|
type: "string"
|
|
1178
1178
|
}).option("mode", {
|
|
@@ -1199,11 +1199,11 @@ var AssetPushModule = {
|
|
|
1199
1199
|
allowEmptySource,
|
|
1200
1200
|
verbose
|
|
1201
1201
|
}) => {
|
|
1202
|
-
const
|
|
1202
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1203
1203
|
const client = getAssetClient({
|
|
1204
1204
|
apiKey,
|
|
1205
1205
|
apiHost,
|
|
1206
|
-
fetch:
|
|
1206
|
+
fetch: fetch3,
|
|
1207
1207
|
projectId
|
|
1208
1208
|
});
|
|
1209
1209
|
let source;
|
|
@@ -1225,7 +1225,7 @@ var AssetPushModule = {
|
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
1227
1227
|
const target = createAssetEngineDataSource({ client, verbose });
|
|
1228
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
1228
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1229
1229
|
await syncEngine({
|
|
1230
1230
|
source,
|
|
1231
1231
|
target,
|
|
@@ -1296,16 +1296,16 @@ var AssetRemoveModule = {
|
|
|
1296
1296
|
command: "remove <id>",
|
|
1297
1297
|
aliases: ["delete", "rm"],
|
|
1298
1298
|
describe: "Delete an asset",
|
|
1299
|
-
builder: (
|
|
1299
|
+
builder: (yargs38) => withConfiguration(
|
|
1300
1300
|
withDebugOptions(
|
|
1301
1301
|
withApiOptions(
|
|
1302
|
-
withProjectOptions(
|
|
1302
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
1303
1303
|
)
|
|
1304
1304
|
)
|
|
1305
1305
|
),
|
|
1306
1306
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
1307
|
-
const
|
|
1308
|
-
const client = getAssetClient({ apiKey, apiHost, fetch:
|
|
1307
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1308
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1309
1309
|
if (!whatIf) {
|
|
1310
1310
|
await client.delete({ assetId: id });
|
|
1311
1311
|
} else {
|
|
@@ -1320,18 +1320,18 @@ var AssetUpdateModule = {
|
|
|
1320
1320
|
command: "update <filename>",
|
|
1321
1321
|
aliases: ["put"],
|
|
1322
1322
|
describe: "Insert or update an asset",
|
|
1323
|
-
builder: (
|
|
1323
|
+
builder: (yargs38) => withConfiguration(
|
|
1324
1324
|
withDebugOptions(
|
|
1325
1325
|
withApiOptions(
|
|
1326
1326
|
withProjectOptions(
|
|
1327
|
-
|
|
1327
|
+
yargs38.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
1328
1328
|
)
|
|
1329
1329
|
)
|
|
1330
1330
|
)
|
|
1331
1331
|
),
|
|
1332
1332
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
|
|
1333
|
-
const
|
|
1334
|
-
const client = getAssetClient({ apiKey, apiHost, fetch:
|
|
1333
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1334
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1335
1335
|
const file = readFileToObject(filename);
|
|
1336
1336
|
const putAsset = convertAssetToPutAsset2(file);
|
|
1337
1337
|
if (!whatIf) {
|
|
@@ -1350,7 +1350,7 @@ var AssetUpdateModule = {
|
|
|
1350
1350
|
var AssetModule = {
|
|
1351
1351
|
command: "asset <command>",
|
|
1352
1352
|
describe: "Commands for Assets",
|
|
1353
|
-
builder: (
|
|
1353
|
+
builder: (yargs38) => yargs38.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
1354
1354
|
handler: () => {
|
|
1355
1355
|
yargs.help();
|
|
1356
1356
|
}
|
|
@@ -1371,20 +1371,20 @@ function getCategoryClient(options) {
|
|
|
1371
1371
|
var CategoryGetModule = {
|
|
1372
1372
|
command: "get <id>",
|
|
1373
1373
|
describe: "Fetch a category",
|
|
1374
|
-
builder: (
|
|
1374
|
+
builder: (yargs38) => withConfiguration(
|
|
1375
1375
|
withFormatOptions(
|
|
1376
1376
|
withDebugOptions(
|
|
1377
1377
|
withApiOptions(
|
|
1378
1378
|
withProjectOptions(
|
|
1379
|
-
|
|
1379
|
+
yargs38.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
1380
1380
|
)
|
|
1381
1381
|
)
|
|
1382
1382
|
)
|
|
1383
1383
|
)
|
|
1384
1384
|
),
|
|
1385
1385
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
|
|
1386
|
-
const
|
|
1387
|
-
const client = getCategoryClient({ apiKey, apiHost, fetch:
|
|
1386
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1387
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1388
1388
|
const res = await client.getCategories();
|
|
1389
1389
|
const category = res.categories.find((c) => c.id === id);
|
|
1390
1390
|
if (!category) {
|
|
@@ -1401,12 +1401,12 @@ var CategoryListModule = {
|
|
|
1401
1401
|
command: "list",
|
|
1402
1402
|
describe: "List categories",
|
|
1403
1403
|
aliases: ["ls"],
|
|
1404
|
-
builder: (
|
|
1405
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
1404
|
+
builder: (yargs38) => withConfiguration(
|
|
1405
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs38.options({})))))
|
|
1406
1406
|
),
|
|
1407
1407
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
1408
|
-
const
|
|
1409
|
-
const client = getCategoryClient({ apiKey, apiHost, fetch:
|
|
1408
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1409
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1410
1410
|
const res = await client.getCategories();
|
|
1411
1411
|
emitWithFormat(res.categories, format, filename);
|
|
1412
1412
|
}
|
|
@@ -1446,12 +1446,12 @@ function createCategoriesEngineDataSource({
|
|
|
1446
1446
|
var CategoryPullModule = {
|
|
1447
1447
|
command: "pull <directory>",
|
|
1448
1448
|
describe: "Pulls all categories to local files in a directory",
|
|
1449
|
-
builder: (
|
|
1449
|
+
builder: (yargs38) => withConfiguration(
|
|
1450
1450
|
withApiOptions(
|
|
1451
1451
|
withProjectOptions(
|
|
1452
1452
|
withDiffOptions(
|
|
1453
1453
|
withDebugOptions(
|
|
1454
|
-
|
|
1454
|
+
yargs38.positional("directory", {
|
|
1455
1455
|
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.",
|
|
1456
1456
|
type: "string"
|
|
1457
1457
|
}).option("format", {
|
|
@@ -1485,8 +1485,8 @@ var CategoryPullModule = {
|
|
|
1485
1485
|
allowEmptySource,
|
|
1486
1486
|
verbose
|
|
1487
1487
|
}) => {
|
|
1488
|
-
const
|
|
1489
|
-
const client = getCategoryClient({ apiKey, apiHost, fetch:
|
|
1488
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1489
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1490
1490
|
const source = createCategoriesEngineDataSource({ client });
|
|
1491
1491
|
let target;
|
|
1492
1492
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -1526,12 +1526,12 @@ var CategoryPullModule = {
|
|
|
1526
1526
|
var CategoryPushModule = {
|
|
1527
1527
|
command: "push <directory>",
|
|
1528
1528
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
1529
|
-
builder: (
|
|
1529
|
+
builder: (yargs38) => withConfiguration(
|
|
1530
1530
|
withApiOptions(
|
|
1531
1531
|
withDebugOptions(
|
|
1532
1532
|
withProjectOptions(
|
|
1533
1533
|
withDiffOptions(
|
|
1534
|
-
|
|
1534
|
+
yargs38.positional("directory", {
|
|
1535
1535
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
1536
1536
|
type: "string"
|
|
1537
1537
|
}).option("mode", {
|
|
@@ -1558,8 +1558,8 @@ var CategoryPushModule = {
|
|
|
1558
1558
|
allowEmptySource,
|
|
1559
1559
|
verbose
|
|
1560
1560
|
}) => {
|
|
1561
|
-
const
|
|
1562
|
-
const client = getCategoryClient({ apiKey, apiHost, fetch:
|
|
1561
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1562
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1563
1563
|
let source;
|
|
1564
1564
|
const isPackage = isPathAPackageFile(directory);
|
|
1565
1565
|
if (isPackage) {
|
|
@@ -1595,18 +1595,18 @@ var CategoryRemoveModule = {
|
|
|
1595
1595
|
command: "remove <id>",
|
|
1596
1596
|
aliases: ["delete", "rm"],
|
|
1597
1597
|
describe: "Delete a category",
|
|
1598
|
-
builder: (
|
|
1598
|
+
builder: (yargs38) => withConfiguration(
|
|
1599
1599
|
withApiOptions(
|
|
1600
1600
|
withDebugOptions(
|
|
1601
1601
|
withProjectOptions(
|
|
1602
|
-
|
|
1602
|
+
yargs38.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
1603
1603
|
)
|
|
1604
1604
|
)
|
|
1605
1605
|
)
|
|
1606
1606
|
),
|
|
1607
1607
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
1608
|
-
const
|
|
1609
|
-
const client = getCategoryClient({ apiKey, apiHost, fetch:
|
|
1608
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1609
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1610
1610
|
if (!whatIf) {
|
|
1611
1611
|
await client.removeCategory({ categoryId: id });
|
|
1612
1612
|
} else {
|
|
@@ -1620,18 +1620,18 @@ var CategoryUpdateModule = {
|
|
|
1620
1620
|
command: "update <filename>",
|
|
1621
1621
|
aliases: ["put"],
|
|
1622
1622
|
describe: "Insert or update a category",
|
|
1623
|
-
builder: (
|
|
1623
|
+
builder: (yargs38) => withConfiguration(
|
|
1624
1624
|
withApiOptions(
|
|
1625
1625
|
withDebugOptions(
|
|
1626
1626
|
withProjectOptions(
|
|
1627
|
-
|
|
1627
|
+
yargs38.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
1628
1628
|
)
|
|
1629
1629
|
)
|
|
1630
1630
|
)
|
|
1631
1631
|
),
|
|
1632
1632
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
|
|
1633
|
-
const
|
|
1634
|
-
const client = getCategoryClient({ apiKey, apiHost, fetch:
|
|
1633
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1634
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1635
1635
|
const file = readFileToObject(filename);
|
|
1636
1636
|
if (!whatIf) {
|
|
1637
1637
|
await client.upsertCategories([file]);
|
|
@@ -1646,7 +1646,7 @@ var CategoryModule = {
|
|
|
1646
1646
|
command: "category <command>",
|
|
1647
1647
|
aliases: ["cat"],
|
|
1648
1648
|
describe: "Commands for Canvas categories",
|
|
1649
|
-
builder: (
|
|
1649
|
+
builder: (yargs38) => yargs38.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
1650
1650
|
handler: () => {
|
|
1651
1651
|
yargs2.help();
|
|
1652
1652
|
}
|
|
@@ -1668,12 +1668,12 @@ function getCanvasClient(options) {
|
|
|
1668
1668
|
var ComponentGetModule = {
|
|
1669
1669
|
command: "get <id>",
|
|
1670
1670
|
describe: "Fetch a component definition",
|
|
1671
|
-
builder: (
|
|
1671
|
+
builder: (yargs38) => withConfiguration(
|
|
1672
1672
|
withFormatOptions(
|
|
1673
1673
|
withDebugOptions(
|
|
1674
1674
|
withApiOptions(
|
|
1675
1675
|
withProjectOptions(
|
|
1676
|
-
|
|
1676
|
+
yargs38.positional("id", {
|
|
1677
1677
|
demandOption: true,
|
|
1678
1678
|
describe: "Component definition public ID to fetch"
|
|
1679
1679
|
})
|
|
@@ -1683,8 +1683,8 @@ var ComponentGetModule = {
|
|
|
1683
1683
|
)
|
|
1684
1684
|
),
|
|
1685
1685
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
|
|
1686
|
-
const
|
|
1687
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
1686
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1687
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1688
1688
|
const res = await client.getComponentDefinitions({ componentId: id, limit: 1 });
|
|
1689
1689
|
if (res.componentDefinitions.length === 0) {
|
|
1690
1690
|
console.error("Component did not exist");
|
|
@@ -1707,12 +1707,12 @@ var ComponentListModule = {
|
|
|
1707
1707
|
command: "list",
|
|
1708
1708
|
describe: "List component definitions",
|
|
1709
1709
|
aliases: ["ls"],
|
|
1710
|
-
builder: (
|
|
1710
|
+
builder: (yargs38) => withConfiguration(
|
|
1711
1711
|
withFormatOptions(
|
|
1712
1712
|
withDebugOptions(
|
|
1713
1713
|
withApiOptions(
|
|
1714
1714
|
withProjectOptions(
|
|
1715
|
-
|
|
1715
|
+
yargs38.options({
|
|
1716
1716
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1717
1717
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
1718
1718
|
})
|
|
@@ -1732,8 +1732,8 @@ var ComponentListModule = {
|
|
|
1732
1732
|
project: projectId,
|
|
1733
1733
|
verbose
|
|
1734
1734
|
}) => {
|
|
1735
|
-
const
|
|
1736
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
1735
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1736
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1737
1737
|
const res = await client.getComponentDefinitions({ limit: limit2, offset });
|
|
1738
1738
|
emitWithFormat(res.componentDefinitions, format, filename);
|
|
1739
1739
|
}
|
|
@@ -1776,12 +1776,12 @@ function createComponentDefinitionEngineDataSource({
|
|
|
1776
1776
|
var ComponentPullModule = {
|
|
1777
1777
|
command: "pull <directory>",
|
|
1778
1778
|
describe: "Pulls all component definitions to local files in a directory",
|
|
1779
|
-
builder: (
|
|
1779
|
+
builder: (yargs38) => withConfiguration(
|
|
1780
1780
|
withApiOptions(
|
|
1781
1781
|
withDebugOptions(
|
|
1782
1782
|
withProjectOptions(
|
|
1783
1783
|
withDiffOptions(
|
|
1784
|
-
|
|
1784
|
+
yargs38.positional("directory", {
|
|
1785
1785
|
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.",
|
|
1786
1786
|
type: "string"
|
|
1787
1787
|
}).option("format", {
|
|
@@ -1815,8 +1815,8 @@ var ComponentPullModule = {
|
|
|
1815
1815
|
allowEmptySource,
|
|
1816
1816
|
verbose
|
|
1817
1817
|
}) => {
|
|
1818
|
-
const
|
|
1819
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
1818
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1819
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1820
1820
|
const source = createComponentDefinitionEngineDataSource({ client });
|
|
1821
1821
|
let target;
|
|
1822
1822
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -1857,12 +1857,12 @@ var ComponentPullModule = {
|
|
|
1857
1857
|
var ComponentPushModule = {
|
|
1858
1858
|
command: "push <directory>",
|
|
1859
1859
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
1860
|
-
builder: (
|
|
1860
|
+
builder: (yargs38) => withConfiguration(
|
|
1861
1861
|
withApiOptions(
|
|
1862
1862
|
withDebugOptions(
|
|
1863
1863
|
withProjectOptions(
|
|
1864
1864
|
withDiffOptions(
|
|
1865
|
-
|
|
1865
|
+
yargs38.positional("directory", {
|
|
1866
1866
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
1867
1867
|
type: "string"
|
|
1868
1868
|
}).option("mode", {
|
|
@@ -1889,8 +1889,8 @@ var ComponentPushModule = {
|
|
|
1889
1889
|
allowEmptySource,
|
|
1890
1890
|
verbose
|
|
1891
1891
|
}) => {
|
|
1892
|
-
const
|
|
1893
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
1892
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1893
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1894
1894
|
let source;
|
|
1895
1895
|
const isPackage = isPathAPackageFile(directory);
|
|
1896
1896
|
if (isPackage) {
|
|
@@ -1927,11 +1927,11 @@ var ComponentRemoveModule = {
|
|
|
1927
1927
|
command: "remove <id>",
|
|
1928
1928
|
aliases: ["delete", "rm"],
|
|
1929
1929
|
describe: "Delete a component definition",
|
|
1930
|
-
builder: (
|
|
1930
|
+
builder: (yargs38) => withConfiguration(
|
|
1931
1931
|
withDebugOptions(
|
|
1932
1932
|
withApiOptions(
|
|
1933
1933
|
withProjectOptions(
|
|
1934
|
-
|
|
1934
|
+
yargs38.positional("id", {
|
|
1935
1935
|
demandOption: true,
|
|
1936
1936
|
describe: "Component definition public ID to delete"
|
|
1937
1937
|
})
|
|
@@ -1940,8 +1940,8 @@ var ComponentRemoveModule = {
|
|
|
1940
1940
|
)
|
|
1941
1941
|
),
|
|
1942
1942
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
1943
|
-
const
|
|
1944
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
1943
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1944
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1945
1945
|
if (!whatIf) {
|
|
1946
1946
|
await client.removeComponentDefinition({ componentId: id });
|
|
1947
1947
|
} else {
|
|
@@ -1955,18 +1955,18 @@ var ComponentUpdateModule = {
|
|
|
1955
1955
|
command: "update <filename>",
|
|
1956
1956
|
aliases: ["put"],
|
|
1957
1957
|
describe: "Insert or update a component definition",
|
|
1958
|
-
builder: (
|
|
1958
|
+
builder: (yargs38) => withConfiguration(
|
|
1959
1959
|
withApiOptions(
|
|
1960
1960
|
withDebugOptions(
|
|
1961
1961
|
withProjectOptions(
|
|
1962
|
-
|
|
1962
|
+
yargs38.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
1963
1963
|
)
|
|
1964
1964
|
)
|
|
1965
1965
|
)
|
|
1966
1966
|
),
|
|
1967
1967
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
|
|
1968
|
-
const
|
|
1969
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
1968
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
1969
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1970
1970
|
const file = readFileToObject(filename);
|
|
1971
1971
|
if (!whatIf) {
|
|
1972
1972
|
await client.updateComponentDefinition({ componentDefinition: omit(file, ["$schema"]) });
|
|
@@ -1981,7 +1981,7 @@ var ComponentModule = {
|
|
|
1981
1981
|
command: "component <command>",
|
|
1982
1982
|
aliases: ["def"],
|
|
1983
1983
|
describe: "Commands for Canvas component definitions",
|
|
1984
|
-
builder: (
|
|
1984
|
+
builder: (yargs38) => yargs38.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
1985
1985
|
handler: () => {
|
|
1986
1986
|
yargs3.help();
|
|
1987
1987
|
}
|
|
@@ -1994,13 +1994,13 @@ import yargs4 from "yargs";
|
|
|
1994
1994
|
var CompositionGetModule = {
|
|
1995
1995
|
command: "get <id>",
|
|
1996
1996
|
describe: "Fetch a composition",
|
|
1997
|
-
builder: (
|
|
1997
|
+
builder: (yargs38) => withFormatOptions(
|
|
1998
1998
|
withConfiguration(
|
|
1999
1999
|
withApiOptions(
|
|
2000
2000
|
withProjectOptions(
|
|
2001
2001
|
withStateOptions(
|
|
2002
2002
|
withDebugOptions(
|
|
2003
|
-
|
|
2003
|
+
yargs38.positional("id", {
|
|
2004
2004
|
demandOption: true,
|
|
2005
2005
|
describe: "Composition/pattern public ID to fetch"
|
|
2006
2006
|
}).option({
|
|
@@ -2072,8 +2072,8 @@ var CompositionGetModule = {
|
|
|
2072
2072
|
if (verbose) {
|
|
2073
2073
|
console.log(`\u{1F41B} get composition:`, parameters);
|
|
2074
2074
|
}
|
|
2075
|
-
const
|
|
2076
|
-
const client = getCanvasClient({ apiKey, edgeApiHost, apiHost, fetch:
|
|
2075
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2076
|
+
const client = getCanvasClient({ apiKey, edgeApiHost, apiHost, fetch: fetch3, projectId });
|
|
2077
2077
|
const res = prepCompositionForDisk(await client.getCompositionById(parameters));
|
|
2078
2078
|
emitWithFormat(res, format, filename);
|
|
2079
2079
|
}
|
|
@@ -2090,13 +2090,13 @@ var CompositionListModule = {
|
|
|
2090
2090
|
command: "list",
|
|
2091
2091
|
describe: "List compositions",
|
|
2092
2092
|
aliases: ["ls"],
|
|
2093
|
-
builder: (
|
|
2093
|
+
builder: (yargs38) => withFormatOptions(
|
|
2094
2094
|
withConfiguration(
|
|
2095
2095
|
withApiOptions(
|
|
2096
2096
|
withProjectOptions(
|
|
2097
2097
|
withDebugOptions(
|
|
2098
2098
|
withStateOptions(
|
|
2099
|
-
|
|
2099
|
+
yargs38.options({
|
|
2100
2100
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2101
2101
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2102
2102
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -2166,8 +2166,8 @@ var CompositionListModule = {
|
|
|
2166
2166
|
if (verbose) {
|
|
2167
2167
|
console.log(`\u{1F41B} list compositions:`, parameters);
|
|
2168
2168
|
}
|
|
2169
|
-
const
|
|
2170
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2169
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2170
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2171
2171
|
const res = await client.getCompositionList(parameters);
|
|
2172
2172
|
emitWithFormat(res.compositions, format, filename);
|
|
2173
2173
|
}
|
|
@@ -2177,13 +2177,13 @@ var CompositionListModule = {
|
|
|
2177
2177
|
var ComponentPatternListModule = {
|
|
2178
2178
|
...CompositionListModule,
|
|
2179
2179
|
describe: "List component patterns",
|
|
2180
|
-
builder: (
|
|
2180
|
+
builder: (yargs38) => withFormatOptions(
|
|
2181
2181
|
withConfiguration(
|
|
2182
2182
|
withApiOptions(
|
|
2183
2183
|
withDebugOptions(
|
|
2184
2184
|
withProjectOptions(
|
|
2185
2185
|
withStateOptions(
|
|
2186
|
-
|
|
2186
|
+
yargs38.options({
|
|
2187
2187
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2188
2188
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2189
2189
|
resolvePatterns: {
|
|
@@ -2306,12 +2306,12 @@ function createComponentInstanceEngineDataSource({
|
|
|
2306
2306
|
var CompositionPublishModule = {
|
|
2307
2307
|
command: "publish [ids]",
|
|
2308
2308
|
describe: "Publishes composition(s)",
|
|
2309
|
-
builder: (
|
|
2309
|
+
builder: (yargs38) => withConfiguration(
|
|
2310
2310
|
withApiOptions(
|
|
2311
2311
|
withProjectOptions(
|
|
2312
2312
|
withDebugOptions(
|
|
2313
2313
|
withDiffOptions(
|
|
2314
|
-
|
|
2314
|
+
yargs38.positional("ids", {
|
|
2315
2315
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2316
2316
|
type: "string"
|
|
2317
2317
|
}).option("all", {
|
|
@@ -2352,8 +2352,8 @@ var CompositionPublishModule = {
|
|
|
2352
2352
|
process.exit(1);
|
|
2353
2353
|
}
|
|
2354
2354
|
const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
2355
|
-
const
|
|
2356
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2355
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2356
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2357
2357
|
const source = createComponentInstanceEngineDataSource({
|
|
2358
2358
|
client,
|
|
2359
2359
|
state: "preview",
|
|
@@ -2388,12 +2388,12 @@ var CompositionPublishModule = {
|
|
|
2388
2388
|
var ComponentPatternPublishModule = {
|
|
2389
2389
|
...CompositionPublishModule,
|
|
2390
2390
|
describe: "Publishes component pattern(s)",
|
|
2391
|
-
builder: (
|
|
2391
|
+
builder: (yargs38) => withConfiguration(
|
|
2392
2392
|
withApiOptions(
|
|
2393
2393
|
withDebugOptions(
|
|
2394
2394
|
withProjectOptions(
|
|
2395
2395
|
withDiffOptions(
|
|
2396
|
-
|
|
2396
|
+
yargs38.positional("ids", {
|
|
2397
2397
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2398
2398
|
type: "string"
|
|
2399
2399
|
}).option("all", {
|
|
@@ -2431,13 +2431,13 @@ var ComponentPatternPublishModule = {
|
|
|
2431
2431
|
var CompositionPullModule = {
|
|
2432
2432
|
command: "pull <directory>",
|
|
2433
2433
|
describe: "Pulls all compositions to local files in a directory",
|
|
2434
|
-
builder: (
|
|
2434
|
+
builder: (yargs38) => withConfiguration(
|
|
2435
2435
|
withApiOptions(
|
|
2436
2436
|
withProjectOptions(
|
|
2437
2437
|
withStateOptions(
|
|
2438
2438
|
withDebugOptions(
|
|
2439
2439
|
withDiffOptions(
|
|
2440
|
-
|
|
2440
|
+
yargs38.positional("directory", {
|
|
2441
2441
|
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.",
|
|
2442
2442
|
type: "string"
|
|
2443
2443
|
}).option("format", {
|
|
@@ -2485,9 +2485,9 @@ var CompositionPullModule = {
|
|
|
2485
2485
|
allowEmptySource,
|
|
2486
2486
|
verbose
|
|
2487
2487
|
}) => {
|
|
2488
|
-
const
|
|
2489
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2490
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
2488
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2489
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2490
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2491
2491
|
const source = createComponentInstanceEngineDataSource({
|
|
2492
2492
|
client,
|
|
2493
2493
|
state,
|
|
@@ -2546,13 +2546,13 @@ var CompositionPullModule = {
|
|
|
2546
2546
|
var ComponentPatternPullModule = {
|
|
2547
2547
|
...CompositionPullModule,
|
|
2548
2548
|
describe: "Pulls all component patterns to local files in a directory",
|
|
2549
|
-
builder: (
|
|
2549
|
+
builder: (yargs38) => withConfiguration(
|
|
2550
2550
|
withApiOptions(
|
|
2551
2551
|
withProjectOptions(
|
|
2552
2552
|
withDebugOptions(
|
|
2553
2553
|
withStateOptions(
|
|
2554
2554
|
withDiffOptions(
|
|
2555
|
-
|
|
2555
|
+
yargs38.positional("directory", {
|
|
2556
2556
|
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.",
|
|
2557
2557
|
type: "string"
|
|
2558
2558
|
}).option("format", {
|
|
@@ -2595,13 +2595,13 @@ var ComponentPatternPullModule = {
|
|
|
2595
2595
|
var CompositionPushModule = {
|
|
2596
2596
|
command: "push <directory>",
|
|
2597
2597
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
2598
|
-
builder: (
|
|
2598
|
+
builder: (yargs38) => withConfiguration(
|
|
2599
2599
|
withApiOptions(
|
|
2600
2600
|
withProjectOptions(
|
|
2601
2601
|
withStateOptions(
|
|
2602
2602
|
withDebugOptions(
|
|
2603
2603
|
withDiffOptions(
|
|
2604
|
-
|
|
2604
|
+
yargs38.positional("directory", {
|
|
2605
2605
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2606
2606
|
type: "string"
|
|
2607
2607
|
}).option("mode", {
|
|
@@ -2642,8 +2642,8 @@ var CompositionPushModule = {
|
|
|
2642
2642
|
allowEmptySource,
|
|
2643
2643
|
verbose
|
|
2644
2644
|
}) => {
|
|
2645
|
-
const
|
|
2646
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2645
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2646
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2647
2647
|
let source;
|
|
2648
2648
|
const isPackage = isPathAPackageFile(directory);
|
|
2649
2649
|
if (isPackage) {
|
|
@@ -2670,7 +2670,7 @@ var CompositionPushModule = {
|
|
|
2670
2670
|
patternType,
|
|
2671
2671
|
verbose
|
|
2672
2672
|
});
|
|
2673
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
2673
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2674
2674
|
await syncEngine({
|
|
2675
2675
|
source,
|
|
2676
2676
|
target,
|
|
@@ -2698,13 +2698,13 @@ var CompositionPushModule = {
|
|
|
2698
2698
|
var ComponentPatternPushModule = {
|
|
2699
2699
|
...CompositionPushModule,
|
|
2700
2700
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
2701
|
-
builder: (
|
|
2701
|
+
builder: (yargs38) => withConfiguration(
|
|
2702
2702
|
withApiOptions(
|
|
2703
2703
|
withProjectOptions(
|
|
2704
2704
|
withStateOptions(
|
|
2705
2705
|
withDiffOptions(
|
|
2706
2706
|
withDebugOptions(
|
|
2707
|
-
|
|
2707
|
+
yargs38.positional("directory", {
|
|
2708
2708
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
2709
2709
|
type: "string"
|
|
2710
2710
|
}).option("mode", {
|
|
@@ -2737,11 +2737,11 @@ var CompositionRemoveModule = {
|
|
|
2737
2737
|
command: "remove <id>",
|
|
2738
2738
|
aliases: ["delete", "rm"],
|
|
2739
2739
|
describe: "Delete a composition",
|
|
2740
|
-
builder: (
|
|
2740
|
+
builder: (yargs38) => withConfiguration(
|
|
2741
2741
|
withApiOptions(
|
|
2742
2742
|
withDebugOptions(
|
|
2743
2743
|
withProjectOptions(
|
|
2744
|
-
|
|
2744
|
+
yargs38.positional("id", {
|
|
2745
2745
|
demandOption: true,
|
|
2746
2746
|
describe: "Composition/pattern public ID to delete"
|
|
2747
2747
|
})
|
|
@@ -2753,8 +2753,8 @@ var CompositionRemoveModule = {
|
|
|
2753
2753
|
if (verbose) {
|
|
2754
2754
|
console.log(`\u{1F41B} remove composition: (id: ${id})`);
|
|
2755
2755
|
}
|
|
2756
|
-
const
|
|
2757
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2756
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2757
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2758
2758
|
if (!whatIf) {
|
|
2759
2759
|
await client.removeComposition({ compositionId: id });
|
|
2760
2760
|
} else {
|
|
@@ -2775,11 +2775,11 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
2775
2775
|
var CompositionUnpublishModule = {
|
|
2776
2776
|
command: "unpublish [ids]",
|
|
2777
2777
|
describe: "Unpublish a composition(s)",
|
|
2778
|
-
builder: (
|
|
2778
|
+
builder: (yargs38) => withConfiguration(
|
|
2779
2779
|
withApiOptions(
|
|
2780
2780
|
withDebugOptions(
|
|
2781
2781
|
withProjectOptions(
|
|
2782
|
-
|
|
2782
|
+
yargs38.positional("ids", {
|
|
2783
2783
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2784
2784
|
type: "string"
|
|
2785
2785
|
}).option("all", {
|
|
@@ -2820,8 +2820,8 @@ var CompositionUnpublishModule = {
|
|
|
2820
2820
|
}
|
|
2821
2821
|
const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
2822
2822
|
const targetItems = /* @__PURE__ */ new Map();
|
|
2823
|
-
const
|
|
2824
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2823
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2824
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2825
2825
|
const source = createComponentInstanceEngineDataSource({
|
|
2826
2826
|
client,
|
|
2827
2827
|
state: "published",
|
|
@@ -2876,11 +2876,11 @@ var CompositionUnpublishModule = {
|
|
|
2876
2876
|
var ComponentPatternUnpublishModule = {
|
|
2877
2877
|
command: "unpublish [ids]",
|
|
2878
2878
|
describe: "Unpublish a component pattern(s)",
|
|
2879
|
-
builder: (
|
|
2879
|
+
builder: (yargs38) => withConfiguration(
|
|
2880
2880
|
withApiOptions(
|
|
2881
2881
|
withDebugOptions(
|
|
2882
2882
|
withProjectOptions(
|
|
2883
|
-
|
|
2883
|
+
yargs38.positional("ids", {
|
|
2884
2884
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2885
2885
|
type: "string"
|
|
2886
2886
|
}).option("all", {
|
|
@@ -2914,12 +2914,12 @@ var CompositionUpdateModule = {
|
|
|
2914
2914
|
command: "update <filename>",
|
|
2915
2915
|
aliases: ["put"],
|
|
2916
2916
|
describe: "Insert or update a composition",
|
|
2917
|
-
builder: (
|
|
2917
|
+
builder: (yargs38) => withConfiguration(
|
|
2918
2918
|
withApiOptions(
|
|
2919
2919
|
withProjectOptions(
|
|
2920
2920
|
withDebugOptions(
|
|
2921
2921
|
withStateOptions(
|
|
2922
|
-
|
|
2922
|
+
yargs38.positional("filename", {
|
|
2923
2923
|
demandOption: true,
|
|
2924
2924
|
describe: "Composition/pattern file to put"
|
|
2925
2925
|
})
|
|
@@ -2932,8 +2932,8 @@ var CompositionUpdateModule = {
|
|
|
2932
2932
|
if (verbose) {
|
|
2933
2933
|
console.log(`\u{1F41B} update composition: (filename: ${filename}, state: ${convertStateOption(state)})`);
|
|
2934
2934
|
}
|
|
2935
|
-
const
|
|
2936
|
-
const client = getCanvasClient({ apiKey, apiHost, fetch:
|
|
2935
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
2936
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2937
2937
|
const file = readFileToObject(filename);
|
|
2938
2938
|
if (!whatIf) {
|
|
2939
2939
|
await client.updateComposition({ ...file, state: convertStateOption(state) });
|
|
@@ -2957,7 +2957,7 @@ var ComponentPatternUpdateModule = {
|
|
|
2957
2957
|
var ComponentPatternModule = {
|
|
2958
2958
|
command: "component-pattern <command>",
|
|
2959
2959
|
describe: "Commands for Canvas component patterns",
|
|
2960
|
-
builder: (
|
|
2960
|
+
builder: (yargs38) => yargs38.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
2961
2961
|
handler: () => {
|
|
2962
2962
|
yargs4.help();
|
|
2963
2963
|
}
|
|
@@ -2969,7 +2969,7 @@ var CompositionModule = {
|
|
|
2969
2969
|
command: "composition <command>",
|
|
2970
2970
|
describe: "Commands for Canvas compositions",
|
|
2971
2971
|
aliases: ["comp"],
|
|
2972
|
-
builder: (
|
|
2972
|
+
builder: (yargs38) => yargs38.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
2973
2973
|
handler: () => {
|
|
2974
2974
|
yargs5.help();
|
|
2975
2975
|
}
|
|
@@ -2988,13 +2988,13 @@ var CompositionPatternGetModule = {
|
|
|
2988
2988
|
var CompositionPatternListModule = {
|
|
2989
2989
|
...CompositionListModule,
|
|
2990
2990
|
describe: "List composition patterns",
|
|
2991
|
-
builder: (
|
|
2991
|
+
builder: (yargs38) => withFormatOptions(
|
|
2992
2992
|
withConfiguration(
|
|
2993
2993
|
withApiOptions(
|
|
2994
2994
|
withDebugOptions(
|
|
2995
2995
|
withProjectOptions(
|
|
2996
2996
|
withStateOptions(
|
|
2997
|
-
|
|
2997
|
+
yargs38.options({
|
|
2998
2998
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2999
2999
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3000
3000
|
resolvePatterns: {
|
|
@@ -3038,12 +3038,12 @@ var CompositionPatternListModule = {
|
|
|
3038
3038
|
var CompositionPatternPublishModule = {
|
|
3039
3039
|
...CompositionPublishModule,
|
|
3040
3040
|
describe: "Publishes composition pattern(s)",
|
|
3041
|
-
builder: (
|
|
3041
|
+
builder: (yargs38) => withConfiguration(
|
|
3042
3042
|
withApiOptions(
|
|
3043
3043
|
withDebugOptions(
|
|
3044
3044
|
withProjectOptions(
|
|
3045
3045
|
withDiffOptions(
|
|
3046
|
-
|
|
3046
|
+
yargs38.positional("ids", {
|
|
3047
3047
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3048
3048
|
type: "string"
|
|
3049
3049
|
}).option("all", {
|
|
@@ -3082,13 +3082,13 @@ var CompositionPatternPublishModule = {
|
|
|
3082
3082
|
var CompositionPatternPullModule = {
|
|
3083
3083
|
...CompositionPullModule,
|
|
3084
3084
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
3085
|
-
builder: (
|
|
3085
|
+
builder: (yargs38) => withConfiguration(
|
|
3086
3086
|
withApiOptions(
|
|
3087
3087
|
withDebugOptions(
|
|
3088
3088
|
withProjectOptions(
|
|
3089
3089
|
withStateOptions(
|
|
3090
3090
|
withDiffOptions(
|
|
3091
|
-
|
|
3091
|
+
yargs38.positional("directory", {
|
|
3092
3092
|
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.",
|
|
3093
3093
|
type: "string"
|
|
3094
3094
|
}).option("format", {
|
|
@@ -3126,13 +3126,13 @@ var CompositionPatternPullModule = {
|
|
|
3126
3126
|
var CompositionPatternPushModule = {
|
|
3127
3127
|
...CompositionPushModule,
|
|
3128
3128
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
3129
|
-
builder: (
|
|
3129
|
+
builder: (yargs38) => withConfiguration(
|
|
3130
3130
|
withApiOptions(
|
|
3131
3131
|
withDebugOptions(
|
|
3132
3132
|
withProjectOptions(
|
|
3133
3133
|
withStateOptions(
|
|
3134
3134
|
withDiffOptions(
|
|
3135
|
-
|
|
3135
|
+
yargs38.positional("directory", {
|
|
3136
3136
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
3137
3137
|
type: "string"
|
|
3138
3138
|
}).option("mode", {
|
|
@@ -3170,11 +3170,11 @@ var CompositionPatternRemoveModule = {
|
|
|
3170
3170
|
var CompositionPatternUnpublishModule = {
|
|
3171
3171
|
command: "unpublish [ids]",
|
|
3172
3172
|
describe: "Unpublish a composition pattern(s)",
|
|
3173
|
-
builder: (
|
|
3173
|
+
builder: (yargs38) => withConfiguration(
|
|
3174
3174
|
withApiOptions(
|
|
3175
3175
|
withDebugOptions(
|
|
3176
3176
|
withProjectOptions(
|
|
3177
|
-
|
|
3177
|
+
yargs38.positional("ids", {
|
|
3178
3178
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3179
3179
|
type: "string"
|
|
3180
3180
|
}).option("all", {
|
|
@@ -3210,7 +3210,7 @@ var CompositionPatternUpdateModule = {
|
|
|
3210
3210
|
var CompositionPatternModule = {
|
|
3211
3211
|
command: "composition-pattern <command>",
|
|
3212
3212
|
describe: "Commands for Canvas composition patterns",
|
|
3213
|
-
builder: (
|
|
3213
|
+
builder: (yargs38) => yargs38.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
3214
3214
|
handler: () => {
|
|
3215
3215
|
yargs6.help();
|
|
3216
3216
|
}
|
|
@@ -3231,12 +3231,12 @@ function getContentClient(options) {
|
|
|
3231
3231
|
var ContentTypeGetModule = {
|
|
3232
3232
|
command: "get <id>",
|
|
3233
3233
|
describe: "Get a content type",
|
|
3234
|
-
builder: (
|
|
3234
|
+
builder: (yargs38) => withConfiguration(
|
|
3235
3235
|
withDebugOptions(
|
|
3236
3236
|
withFormatOptions(
|
|
3237
3237
|
withApiOptions(
|
|
3238
3238
|
withProjectOptions(
|
|
3239
|
-
|
|
3239
|
+
yargs38.positional("id", {
|
|
3240
3240
|
demandOption: true,
|
|
3241
3241
|
describe: "Content type public ID to fetch"
|
|
3242
3242
|
})
|
|
@@ -3246,8 +3246,8 @@ var ContentTypeGetModule = {
|
|
|
3246
3246
|
)
|
|
3247
3247
|
),
|
|
3248
3248
|
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
|
|
3249
|
-
const
|
|
3250
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
3249
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3250
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3251
3251
|
const res = await client.getContentTypes({ offset: 0, limit: 1e3 });
|
|
3252
3252
|
const found = res.contentTypes.find((f) => f.id === id);
|
|
3253
3253
|
if (!found) {
|
|
@@ -3261,10 +3261,10 @@ var ContentTypeGetModule = {
|
|
|
3261
3261
|
var ContentTypeListModule = {
|
|
3262
3262
|
command: "list",
|
|
3263
3263
|
describe: "List content types",
|
|
3264
|
-
builder: (
|
|
3264
|
+
builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
|
|
3265
3265
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3266
|
-
const
|
|
3267
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
3266
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3267
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3268
3268
|
const res = await client.getContentTypes({ offset: 0, limit: 1e3 });
|
|
3269
3269
|
emitWithFormat(res.contentTypes, format, filename);
|
|
3270
3270
|
}
|
|
@@ -3302,12 +3302,12 @@ function createContentTypeEngineDataSource({
|
|
|
3302
3302
|
var ContentTypePullModule = {
|
|
3303
3303
|
command: "pull <directory>",
|
|
3304
3304
|
describe: "Pulls all content types to local files in a directory",
|
|
3305
|
-
builder: (
|
|
3305
|
+
builder: (yargs38) => withConfiguration(
|
|
3306
3306
|
withApiOptions(
|
|
3307
3307
|
withDebugOptions(
|
|
3308
3308
|
withProjectOptions(
|
|
3309
3309
|
withDiffOptions(
|
|
3310
|
-
|
|
3310
|
+
yargs38.positional("directory", {
|
|
3311
3311
|
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.",
|
|
3312
3312
|
type: "string"
|
|
3313
3313
|
}).option("format", {
|
|
@@ -3341,11 +3341,11 @@ var ContentTypePullModule = {
|
|
|
3341
3341
|
allowEmptySource,
|
|
3342
3342
|
verbose
|
|
3343
3343
|
}) => {
|
|
3344
|
-
const
|
|
3344
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3345
3345
|
const client = getContentClient({
|
|
3346
3346
|
apiKey,
|
|
3347
3347
|
apiHost,
|
|
3348
|
-
fetch:
|
|
3348
|
+
fetch: fetch3,
|
|
3349
3349
|
projectId
|
|
3350
3350
|
});
|
|
3351
3351
|
const source = createContentTypeEngineDataSource({ client });
|
|
@@ -3387,12 +3387,12 @@ var ContentTypePullModule = {
|
|
|
3387
3387
|
var ContentTypePushModule = {
|
|
3388
3388
|
command: "push <directory>",
|
|
3389
3389
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
3390
|
-
builder: (
|
|
3390
|
+
builder: (yargs38) => withConfiguration(
|
|
3391
3391
|
withApiOptions(
|
|
3392
3392
|
withDebugOptions(
|
|
3393
3393
|
withProjectOptions(
|
|
3394
3394
|
withDiffOptions(
|
|
3395
|
-
|
|
3395
|
+
yargs38.positional("directory", {
|
|
3396
3396
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
3397
3397
|
type: "string"
|
|
3398
3398
|
}).option("what-if", {
|
|
@@ -3424,11 +3424,11 @@ var ContentTypePushModule = {
|
|
|
3424
3424
|
allowEmptySource,
|
|
3425
3425
|
verbose
|
|
3426
3426
|
}) => {
|
|
3427
|
-
const
|
|
3427
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3428
3428
|
const client = getContentClient({
|
|
3429
3429
|
apiKey,
|
|
3430
3430
|
apiHost,
|
|
3431
|
-
fetch:
|
|
3431
|
+
fetch: fetch3,
|
|
3432
3432
|
projectId
|
|
3433
3433
|
});
|
|
3434
3434
|
let source;
|
|
@@ -3466,18 +3466,18 @@ var ContentTypeRemoveModule = {
|
|
|
3466
3466
|
command: "remove <id>",
|
|
3467
3467
|
aliases: ["delete", "rm"],
|
|
3468
3468
|
describe: "Delete a content type",
|
|
3469
|
-
builder: (
|
|
3469
|
+
builder: (yargs38) => withConfiguration(
|
|
3470
3470
|
withDebugOptions(
|
|
3471
3471
|
withApiOptions(
|
|
3472
3472
|
withProjectOptions(
|
|
3473
|
-
|
|
3473
|
+
yargs38.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
3474
3474
|
)
|
|
3475
3475
|
)
|
|
3476
3476
|
)
|
|
3477
3477
|
),
|
|
3478
3478
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
3479
|
-
const
|
|
3480
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
3479
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3480
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3481
3481
|
if (!whatIf) {
|
|
3482
3482
|
await client.deleteContentType({ contentTypeId: id });
|
|
3483
3483
|
} else {
|
|
@@ -3491,18 +3491,18 @@ var ContentTypeUpdateModule = {
|
|
|
3491
3491
|
command: "update <filename>",
|
|
3492
3492
|
aliases: ["put"],
|
|
3493
3493
|
describe: "Insert or update a content type",
|
|
3494
|
-
builder: (
|
|
3494
|
+
builder: (yargs38) => withConfiguration(
|
|
3495
3495
|
withDebugOptions(
|
|
3496
3496
|
withApiOptions(
|
|
3497
3497
|
withProjectOptions(
|
|
3498
|
-
|
|
3498
|
+
yargs38.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
3499
3499
|
)
|
|
3500
3500
|
)
|
|
3501
3501
|
)
|
|
3502
3502
|
),
|
|
3503
3503
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
|
|
3504
|
-
const
|
|
3505
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
3504
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3505
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3506
3506
|
const file = readFileToObject(filename);
|
|
3507
3507
|
if (!whatIf) {
|
|
3508
3508
|
await client.upsertContentType({ contentType: file });
|
|
@@ -3517,7 +3517,7 @@ var ContentTypeModule = {
|
|
|
3517
3517
|
command: "contenttype <command>",
|
|
3518
3518
|
aliases: ["ct"],
|
|
3519
3519
|
describe: "Commands for Content Types",
|
|
3520
|
-
builder: (
|
|
3520
|
+
builder: (yargs38) => yargs38.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
3521
3521
|
handler: () => {
|
|
3522
3522
|
yargs7.help();
|
|
3523
3523
|
}
|
|
@@ -3536,18 +3536,18 @@ function getDataSourceClient(options) {
|
|
|
3536
3536
|
var DataSourceGetModule = {
|
|
3537
3537
|
command: "get <id>",
|
|
3538
3538
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
3539
|
-
builder: (
|
|
3539
|
+
builder: (yargs38) => withConfiguration(
|
|
3540
3540
|
withApiOptions(
|
|
3541
3541
|
withDebugOptions(
|
|
3542
3542
|
withProjectOptions(
|
|
3543
|
-
|
|
3543
|
+
yargs38.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
3544
3544
|
)
|
|
3545
3545
|
)
|
|
3546
3546
|
)
|
|
3547
3547
|
),
|
|
3548
3548
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose }) => {
|
|
3549
|
-
const
|
|
3550
|
-
const client = getDataSourceClient({ apiKey, apiHost, fetch:
|
|
3549
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3550
|
+
const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3551
3551
|
const res = await client.get({ dataSourceId: id });
|
|
3552
3552
|
emitWithFormat(res.result, "json", void 0);
|
|
3553
3553
|
}
|
|
@@ -3558,18 +3558,18 @@ var DataSourceRemoveModule = {
|
|
|
3558
3558
|
command: "remove <id>",
|
|
3559
3559
|
aliases: ["delete", "rm"],
|
|
3560
3560
|
describe: "Delete a data source",
|
|
3561
|
-
builder: (
|
|
3561
|
+
builder: (yargs38) => withConfiguration(
|
|
3562
3562
|
withDebugOptions(
|
|
3563
3563
|
withApiOptions(
|
|
3564
3564
|
withProjectOptions(
|
|
3565
|
-
|
|
3565
|
+
yargs38.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
3566
3566
|
)
|
|
3567
3567
|
)
|
|
3568
3568
|
)
|
|
3569
3569
|
),
|
|
3570
3570
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
3571
|
-
const
|
|
3572
|
-
const client = getDataSourceClient({ apiKey, apiHost, fetch:
|
|
3571
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3572
|
+
const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3573
3573
|
if (!whatIf) {
|
|
3574
3574
|
await client.remove({ dataSourceId: id });
|
|
3575
3575
|
} else {
|
|
@@ -3583,11 +3583,11 @@ var DataSourceUpdateModule = {
|
|
|
3583
3583
|
command: "update <dataSource>",
|
|
3584
3584
|
aliases: ["put"],
|
|
3585
3585
|
describe: "Insert or update a data source",
|
|
3586
|
-
builder: (
|
|
3586
|
+
builder: (yargs38) => withConfiguration(
|
|
3587
3587
|
withApiOptions(
|
|
3588
3588
|
withDebugOptions(
|
|
3589
3589
|
withProjectOptions(
|
|
3590
|
-
|
|
3590
|
+
yargs38.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
3591
3591
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
3592
3592
|
type: "string",
|
|
3593
3593
|
demandOption: true
|
|
@@ -3606,8 +3606,8 @@ var DataSourceUpdateModule = {
|
|
|
3606
3606
|
verbose,
|
|
3607
3607
|
whatIf
|
|
3608
3608
|
}) => {
|
|
3609
|
-
const
|
|
3610
|
-
const client = getDataSourceClient({ apiKey, apiHost, fetch:
|
|
3609
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3610
|
+
const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3611
3611
|
const file = JSON.parse(dataSource);
|
|
3612
3612
|
if (!whatIf) {
|
|
3613
3613
|
await client.upsert({ data: file, integrationType });
|
|
@@ -3622,7 +3622,7 @@ var DataSourceModule = {
|
|
|
3622
3622
|
command: "datasource <command>",
|
|
3623
3623
|
aliases: ["ds"],
|
|
3624
3624
|
describe: "Commands for Data Source definitions",
|
|
3625
|
-
builder: (
|
|
3625
|
+
builder: (yargs38) => yargs38.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
3626
3626
|
handler: () => {
|
|
3627
3627
|
yargs8.help();
|
|
3628
3628
|
}
|
|
@@ -3644,20 +3644,20 @@ var DataTypeGetModule = {
|
|
|
3644
3644
|
command: "get <id>",
|
|
3645
3645
|
describe: "Get a data type",
|
|
3646
3646
|
aliases: ["ls"],
|
|
3647
|
-
builder: (
|
|
3647
|
+
builder: (yargs38) => withConfiguration(
|
|
3648
3648
|
withFormatOptions(
|
|
3649
3649
|
withDebugOptions(
|
|
3650
3650
|
withApiOptions(
|
|
3651
3651
|
withProjectOptions(
|
|
3652
|
-
|
|
3652
|
+
yargs38.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
3653
3653
|
)
|
|
3654
3654
|
)
|
|
3655
3655
|
)
|
|
3656
3656
|
)
|
|
3657
3657
|
),
|
|
3658
3658
|
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
|
|
3659
|
-
const
|
|
3660
|
-
const client = getDataTypeClient({ apiKey, apiHost, fetch:
|
|
3659
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3660
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3661
3661
|
const res = await client.get();
|
|
3662
3662
|
const found = res.results.find((f) => f.id === id);
|
|
3663
3663
|
if (!found) {
|
|
@@ -3672,10 +3672,10 @@ var DataTypeListModule = {
|
|
|
3672
3672
|
command: "list",
|
|
3673
3673
|
describe: "List data types",
|
|
3674
3674
|
aliases: ["ls"],
|
|
3675
|
-
builder: (
|
|
3675
|
+
builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
|
|
3676
3676
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3677
|
-
const
|
|
3678
|
-
const client = getDataTypeClient({ apiKey, apiHost, fetch:
|
|
3677
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3678
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3679
3679
|
const res = await client.get();
|
|
3680
3680
|
emitWithFormat(res.results, format, filename);
|
|
3681
3681
|
}
|
|
@@ -3715,12 +3715,12 @@ function createDataTypeEngineDataSource({
|
|
|
3715
3715
|
var DataTypePullModule = {
|
|
3716
3716
|
command: "pull <directory>",
|
|
3717
3717
|
describe: "Pulls all data types to local files in a directory",
|
|
3718
|
-
builder: (
|
|
3718
|
+
builder: (yargs38) => withConfiguration(
|
|
3719
3719
|
withApiOptions(
|
|
3720
3720
|
withDebugOptions(
|
|
3721
3721
|
withProjectOptions(
|
|
3722
3722
|
withDiffOptions(
|
|
3723
|
-
|
|
3723
|
+
yargs38.positional("directory", {
|
|
3724
3724
|
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.",
|
|
3725
3725
|
type: "string"
|
|
3726
3726
|
}).option("format", {
|
|
@@ -3754,11 +3754,11 @@ var DataTypePullModule = {
|
|
|
3754
3754
|
allowEmptySource,
|
|
3755
3755
|
verbose
|
|
3756
3756
|
}) => {
|
|
3757
|
-
const
|
|
3757
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3758
3758
|
const client = getDataTypeClient({
|
|
3759
3759
|
apiKey,
|
|
3760
3760
|
apiHost,
|
|
3761
|
-
fetch:
|
|
3761
|
+
fetch: fetch3,
|
|
3762
3762
|
projectId
|
|
3763
3763
|
});
|
|
3764
3764
|
const source = createDataTypeEngineDataSource({ client });
|
|
@@ -3800,12 +3800,12 @@ var DataTypePullModule = {
|
|
|
3800
3800
|
var DataTypePushModule = {
|
|
3801
3801
|
command: "push <directory>",
|
|
3802
3802
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
3803
|
-
builder: (
|
|
3803
|
+
builder: (yargs38) => withConfiguration(
|
|
3804
3804
|
withApiOptions(
|
|
3805
3805
|
withDebugOptions(
|
|
3806
3806
|
withProjectOptions(
|
|
3807
3807
|
withDiffOptions(
|
|
3808
|
-
|
|
3808
|
+
yargs38.positional("directory", {
|
|
3809
3809
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
3810
3810
|
type: "string"
|
|
3811
3811
|
}).option("mode", {
|
|
@@ -3832,11 +3832,11 @@ var DataTypePushModule = {
|
|
|
3832
3832
|
allowEmptySource,
|
|
3833
3833
|
verbose
|
|
3834
3834
|
}) => {
|
|
3835
|
-
const
|
|
3835
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3836
3836
|
const client = getDataTypeClient({
|
|
3837
3837
|
apiKey,
|
|
3838
3838
|
apiHost,
|
|
3839
|
-
fetch:
|
|
3839
|
+
fetch: fetch3,
|
|
3840
3840
|
projectId
|
|
3841
3841
|
});
|
|
3842
3842
|
let source;
|
|
@@ -3874,18 +3874,18 @@ var DataTypeRemoveModule = {
|
|
|
3874
3874
|
command: "remove <id>",
|
|
3875
3875
|
aliases: ["delete", "rm"],
|
|
3876
3876
|
describe: "Delete a data type",
|
|
3877
|
-
builder: (
|
|
3877
|
+
builder: (yargs38) => withConfiguration(
|
|
3878
3878
|
withDebugOptions(
|
|
3879
3879
|
withApiOptions(
|
|
3880
3880
|
withProjectOptions(
|
|
3881
|
-
|
|
3881
|
+
yargs38.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
3882
3882
|
)
|
|
3883
3883
|
)
|
|
3884
3884
|
)
|
|
3885
3885
|
),
|
|
3886
3886
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, whatIf }) => {
|
|
3887
|
-
const
|
|
3888
|
-
const client = getDataTypeClient({ apiKey, apiHost, fetch:
|
|
3887
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
3888
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3889
3889
|
if (!whatIf) {
|
|
3890
3890
|
await client.remove({ typeId: id });
|
|
3891
3891
|
} else {
|
|
@@ -3899,18 +3899,18 @@ var DataTypeUpdateModule = {
|
|
|
3899
3899
|
command: "update <filename>",
|
|
3900
3900
|
aliases: ["put"],
|
|
3901
3901
|
describe: "Insert or update a data type",
|
|
3902
|
-
builder: (
|
|
3902
|
+
builder: (yargs38) => withConfiguration(
|
|
3903
3903
|
withDebugOptions(
|
|
3904
3904
|
withApiOptions(
|
|
3905
3905
|
withProjectOptions(
|
|
3906
|
-
|
|
3906
|
+
yargs38.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
3907
3907
|
)
|
|
3908
3908
|
)
|
|
3909
3909
|
)
|
|
3910
3910
|
),
|
|
3911
3911
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
|
|
3912
|
-
const
|
|
3913
|
-
const client = getDataTypeClient({ apiKey, apiHost, fetch:
|
|
3912
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3913
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3914
3914
|
const file = readFileToObject(filename);
|
|
3915
3915
|
if (!whatIf) {
|
|
3916
3916
|
await client.upsert({ data: file });
|
|
@@ -3925,7 +3925,7 @@ var DataTypeModule = {
|
|
|
3925
3925
|
command: "datatype <command>",
|
|
3926
3926
|
aliases: ["dt"],
|
|
3927
3927
|
describe: "Commands for Data Type definitions",
|
|
3928
|
-
builder: (
|
|
3928
|
+
builder: (yargs38) => yargs38.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
3929
3929
|
handler: () => {
|
|
3930
3930
|
yargs9.help();
|
|
3931
3931
|
}
|
|
@@ -3938,13 +3938,13 @@ import yargs10 from "yargs";
|
|
|
3938
3938
|
var EntryGetModule = {
|
|
3939
3939
|
command: "get <id>",
|
|
3940
3940
|
describe: "Get an entry",
|
|
3941
|
-
builder: (
|
|
3941
|
+
builder: (yargs38) => withConfiguration(
|
|
3942
3942
|
withDebugOptions(
|
|
3943
3943
|
withFormatOptions(
|
|
3944
3944
|
withApiOptions(
|
|
3945
3945
|
withProjectOptions(
|
|
3946
3946
|
withStateOptions(
|
|
3947
|
-
|
|
3947
|
+
yargs38.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
3948
3948
|
resolveData: {
|
|
3949
3949
|
type: "boolean",
|
|
3950
3950
|
default: false,
|
|
@@ -3984,8 +3984,8 @@ var EntryGetModule = {
|
|
|
3984
3984
|
resolutionDepth,
|
|
3985
3985
|
verbose
|
|
3986
3986
|
}) => {
|
|
3987
|
-
const
|
|
3988
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
3987
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
3988
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
3989
3989
|
const res = await client.getEntries({
|
|
3990
3990
|
offset: 0,
|
|
3991
3991
|
limit: 1,
|
|
@@ -4009,13 +4009,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
4009
4009
|
var EntryListModule = {
|
|
4010
4010
|
command: "list",
|
|
4011
4011
|
describe: "List entries",
|
|
4012
|
-
builder: (
|
|
4012
|
+
builder: (yargs38) => withConfiguration(
|
|
4013
4013
|
withDebugOptions(
|
|
4014
4014
|
withFormatOptions(
|
|
4015
4015
|
withApiOptions(
|
|
4016
4016
|
withProjectOptions(
|
|
4017
4017
|
withStateOptions(
|
|
4018
|
-
|
|
4018
|
+
yargs38.options({
|
|
4019
4019
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4020
4020
|
limit: {
|
|
4021
4021
|
describe: "Number of rows to fetch",
|
|
@@ -4046,8 +4046,8 @@ var EntryListModule = {
|
|
|
4046
4046
|
search,
|
|
4047
4047
|
verbose
|
|
4048
4048
|
}) => {
|
|
4049
|
-
const
|
|
4050
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
4049
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4050
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
4051
4051
|
const res = await client.getEntries({
|
|
4052
4052
|
offset,
|
|
4053
4053
|
limit: search.length > 0 && limit2 === LEGACY_DEFAULT_LIMIT ? 100 : limit2,
|
|
@@ -4143,12 +4143,12 @@ function createEntryEngineDataSource({
|
|
|
4143
4143
|
var EntryPublishModule = {
|
|
4144
4144
|
command: "publish [ids]",
|
|
4145
4145
|
describe: "Publishes entry(ies)",
|
|
4146
|
-
builder: (
|
|
4146
|
+
builder: (yargs38) => withConfiguration(
|
|
4147
4147
|
withDiffOptions(
|
|
4148
4148
|
withApiOptions(
|
|
4149
4149
|
withProjectOptions(
|
|
4150
4150
|
withDiffOptions(
|
|
4151
|
-
|
|
4151
|
+
yargs38.positional("ids", {
|
|
4152
4152
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4153
4153
|
type: "string"
|
|
4154
4154
|
}).option("all", {
|
|
@@ -4168,8 +4168,8 @@ var EntryPublishModule = {
|
|
|
4168
4168
|
process.exit(1);
|
|
4169
4169
|
}
|
|
4170
4170
|
const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
4171
|
-
const
|
|
4172
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
4171
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4172
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
4173
4173
|
const source = createEntryEngineDataSource({
|
|
4174
4174
|
client,
|
|
4175
4175
|
state: "preview",
|
|
@@ -4197,13 +4197,13 @@ var EntryPublishModule = {
|
|
|
4197
4197
|
var EntryPullModule = {
|
|
4198
4198
|
command: "pull <directory>",
|
|
4199
4199
|
describe: "Pulls all entries to local files in a directory",
|
|
4200
|
-
builder: (
|
|
4200
|
+
builder: (yargs38) => withConfiguration(
|
|
4201
4201
|
withDebugOptions(
|
|
4202
4202
|
withApiOptions(
|
|
4203
4203
|
withProjectOptions(
|
|
4204
4204
|
withStateOptions(
|
|
4205
4205
|
withDiffOptions(
|
|
4206
|
-
|
|
4206
|
+
yargs38.positional("directory", {
|
|
4207
4207
|
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.",
|
|
4208
4208
|
type: "string"
|
|
4209
4209
|
}).option("format", {
|
|
@@ -4239,14 +4239,14 @@ var EntryPullModule = {
|
|
|
4239
4239
|
allowEmptySource,
|
|
4240
4240
|
verbose
|
|
4241
4241
|
}) => {
|
|
4242
|
-
const
|
|
4242
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4243
4243
|
const client = getContentClient({
|
|
4244
4244
|
apiKey,
|
|
4245
4245
|
apiHost,
|
|
4246
|
-
fetch:
|
|
4246
|
+
fetch: fetch3,
|
|
4247
4247
|
projectId
|
|
4248
4248
|
});
|
|
4249
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
4249
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4250
4250
|
const source = createEntryEngineDataSource({ client, state, onlyEntries: true });
|
|
4251
4251
|
let target;
|
|
4252
4252
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -4298,13 +4298,13 @@ var EntryPullModule = {
|
|
|
4298
4298
|
var EntryPushModule = {
|
|
4299
4299
|
command: "push <directory>",
|
|
4300
4300
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
4301
|
-
builder: (
|
|
4301
|
+
builder: (yargs38) => withConfiguration(
|
|
4302
4302
|
withDebugOptions(
|
|
4303
4303
|
withApiOptions(
|
|
4304
4304
|
withProjectOptions(
|
|
4305
4305
|
withStateOptions(
|
|
4306
4306
|
withDiffOptions(
|
|
4307
|
-
|
|
4307
|
+
yargs38.positional("directory", {
|
|
4308
4308
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
4309
4309
|
type: "string"
|
|
4310
4310
|
}).option("mode", {
|
|
@@ -4333,11 +4333,11 @@ var EntryPushModule = {
|
|
|
4333
4333
|
allowEmptySource,
|
|
4334
4334
|
verbose
|
|
4335
4335
|
}) => {
|
|
4336
|
-
const
|
|
4336
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4337
4337
|
const client = getContentClient({
|
|
4338
4338
|
apiKey,
|
|
4339
4339
|
apiHost,
|
|
4340
|
-
fetch:
|
|
4340
|
+
fetch: fetch3,
|
|
4341
4341
|
projectId
|
|
4342
4342
|
});
|
|
4343
4343
|
let source;
|
|
@@ -4359,7 +4359,7 @@ var EntryPushModule = {
|
|
|
4359
4359
|
});
|
|
4360
4360
|
}
|
|
4361
4361
|
const target = createEntryEngineDataSource({ client, state, onlyEntries: true });
|
|
4362
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
4362
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4363
4363
|
await syncEngine({
|
|
4364
4364
|
source,
|
|
4365
4365
|
target,
|
|
@@ -4387,18 +4387,18 @@ var EntryRemoveModule = {
|
|
|
4387
4387
|
command: "remove <id>",
|
|
4388
4388
|
aliases: ["delete", "rm"],
|
|
4389
4389
|
describe: "Delete an entry",
|
|
4390
|
-
builder: (
|
|
4390
|
+
builder: (yargs38) => withConfiguration(
|
|
4391
4391
|
withDebugOptions(
|
|
4392
4392
|
withApiOptions(
|
|
4393
4393
|
withProjectOptions(
|
|
4394
|
-
|
|
4394
|
+
yargs38.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
4395
4395
|
)
|
|
4396
4396
|
)
|
|
4397
4397
|
)
|
|
4398
4398
|
),
|
|
4399
4399
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
4400
|
-
const
|
|
4401
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
4400
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4401
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4402
4402
|
if (!whatIf) {
|
|
4403
4403
|
await client.deleteEntry({ entryId: id });
|
|
4404
4404
|
} else {
|
|
@@ -4413,11 +4413,11 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
4413
4413
|
var EntryUnpublishModule = {
|
|
4414
4414
|
command: "unpublish [ids]",
|
|
4415
4415
|
describe: "Unpublish an entry(ies)",
|
|
4416
|
-
builder: (
|
|
4416
|
+
builder: (yargs38) => withConfiguration(
|
|
4417
4417
|
withDebugOptions(
|
|
4418
4418
|
withApiOptions(
|
|
4419
4419
|
withProjectOptions(
|
|
4420
|
-
|
|
4420
|
+
yargs38.positional("ids", {
|
|
4421
4421
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4422
4422
|
type: "string"
|
|
4423
4423
|
}).option("all", {
|
|
@@ -4437,8 +4437,8 @@ var EntryUnpublishModule = {
|
|
|
4437
4437
|
}
|
|
4438
4438
|
const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
4439
4439
|
const targetItems = /* @__PURE__ */ new Map();
|
|
4440
|
-
const
|
|
4441
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
4440
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4441
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4442
4442
|
const source = createEntryEngineDataSource({
|
|
4443
4443
|
client,
|
|
4444
4444
|
state: "published",
|
|
@@ -4487,12 +4487,12 @@ var EntryUpdateModule = {
|
|
|
4487
4487
|
command: "update <filename>",
|
|
4488
4488
|
aliases: ["put"],
|
|
4489
4489
|
describe: "Insert or update an entry",
|
|
4490
|
-
builder: (
|
|
4490
|
+
builder: (yargs38) => withConfiguration(
|
|
4491
4491
|
withDebugOptions(
|
|
4492
4492
|
withApiOptions(
|
|
4493
4493
|
withProjectOptions(
|
|
4494
4494
|
withStateOptions(
|
|
4495
|
-
|
|
4495
|
+
yargs38.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
4496
4496
|
)
|
|
4497
4497
|
)
|
|
4498
4498
|
)
|
|
@@ -4509,8 +4509,8 @@ var EntryUpdateModule = {
|
|
|
4509
4509
|
verbose,
|
|
4510
4510
|
whatIf
|
|
4511
4511
|
}) => {
|
|
4512
|
-
const
|
|
4513
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
4512
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4513
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
4514
4514
|
const file = readFileToObject(filename);
|
|
4515
4515
|
if (!whatIf) {
|
|
4516
4516
|
await client.upsertEntry({ ...file, state: convertStateOption(state) });
|
|
@@ -4524,7 +4524,7 @@ var EntryUpdateModule = {
|
|
|
4524
4524
|
var EntryModule = {
|
|
4525
4525
|
command: "entry <command>",
|
|
4526
4526
|
describe: "Commands for Entries",
|
|
4527
|
-
builder: (
|
|
4527
|
+
builder: (yargs38) => yargs38.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
4528
4528
|
handler: () => {
|
|
4529
4529
|
yargs10.help();
|
|
4530
4530
|
}
|
|
@@ -4537,13 +4537,13 @@ import yargs11 from "yargs";
|
|
|
4537
4537
|
var EntryPatternGetModule = {
|
|
4538
4538
|
command: "get <id>",
|
|
4539
4539
|
describe: "Get an entry pattern",
|
|
4540
|
-
builder: (
|
|
4540
|
+
builder: (yargs38) => withConfiguration(
|
|
4541
4541
|
withDebugOptions(
|
|
4542
4542
|
withFormatOptions(
|
|
4543
4543
|
withApiOptions(
|
|
4544
4544
|
withProjectOptions(
|
|
4545
4545
|
withStateOptions(
|
|
4546
|
-
|
|
4546
|
+
yargs38.positional("id", {
|
|
4547
4547
|
demandOption: true,
|
|
4548
4548
|
describe: "Entry pattern public ID to fetch"
|
|
4549
4549
|
}),
|
|
@@ -4555,8 +4555,8 @@ var EntryPatternGetModule = {
|
|
|
4555
4555
|
)
|
|
4556
4556
|
),
|
|
4557
4557
|
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, state, verbose }) => {
|
|
4558
|
-
const
|
|
4559
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
4558
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4559
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4560
4560
|
const res = await client.getEntries({
|
|
4561
4561
|
offset: 0,
|
|
4562
4562
|
limit: 1,
|
|
@@ -4578,9 +4578,9 @@ var EntryPatternGetModule = {
|
|
|
4578
4578
|
var EntryPatternListModule = {
|
|
4579
4579
|
command: "list",
|
|
4580
4580
|
describe: "List entry patterns",
|
|
4581
|
-
builder: (
|
|
4581
|
+
builder: (yargs38) => withConfiguration(
|
|
4582
4582
|
withDebugOptions(
|
|
4583
|
-
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(
|
|
4583
|
+
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(yargs38, "published"))))
|
|
4584
4584
|
)
|
|
4585
4585
|
),
|
|
4586
4586
|
handler: async ({
|
|
@@ -4594,8 +4594,8 @@ var EntryPatternListModule = {
|
|
|
4594
4594
|
state,
|
|
4595
4595
|
verbose
|
|
4596
4596
|
}) => {
|
|
4597
|
-
const
|
|
4598
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
4597
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4598
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
4599
4599
|
const res = await client.getEntries({
|
|
4600
4600
|
offset: 0,
|
|
4601
4601
|
limit: 1e3,
|
|
@@ -4613,12 +4613,12 @@ var EntryPatternListModule = {
|
|
|
4613
4613
|
var EntryPatternPublishModule = {
|
|
4614
4614
|
command: "publish [ids]",
|
|
4615
4615
|
describe: "Publishes entry pattern(s)",
|
|
4616
|
-
builder: (
|
|
4616
|
+
builder: (yargs38) => withConfiguration(
|
|
4617
4617
|
withDebugOptions(
|
|
4618
4618
|
withApiOptions(
|
|
4619
4619
|
withProjectOptions(
|
|
4620
4620
|
withDiffOptions(
|
|
4621
|
-
|
|
4621
|
+
yargs38.positional("ids", {
|
|
4622
4622
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4623
4623
|
type: "string"
|
|
4624
4624
|
}).option("all", {
|
|
@@ -4638,8 +4638,8 @@ var EntryPatternPublishModule = {
|
|
|
4638
4638
|
process.exit(1);
|
|
4639
4639
|
}
|
|
4640
4640
|
const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
4641
|
-
const
|
|
4642
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
4641
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4642
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
4643
4643
|
const source = createEntryEngineDataSource({
|
|
4644
4644
|
client,
|
|
4645
4645
|
state: "preview",
|
|
@@ -4667,13 +4667,13 @@ var EntryPatternPublishModule = {
|
|
|
4667
4667
|
var EntryPatternPullModule = {
|
|
4668
4668
|
command: "pull <directory>",
|
|
4669
4669
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
4670
|
-
builder: (
|
|
4670
|
+
builder: (yargs38) => withConfiguration(
|
|
4671
4671
|
withApiOptions(
|
|
4672
4672
|
withDebugOptions(
|
|
4673
4673
|
withProjectOptions(
|
|
4674
4674
|
withStateOptions(
|
|
4675
4675
|
withDiffOptions(
|
|
4676
|
-
|
|
4676
|
+
yargs38.positional("directory", {
|
|
4677
4677
|
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.",
|
|
4678
4678
|
type: "string"
|
|
4679
4679
|
}).option("format", {
|
|
@@ -4709,14 +4709,14 @@ var EntryPatternPullModule = {
|
|
|
4709
4709
|
allowEmptySource,
|
|
4710
4710
|
verbose
|
|
4711
4711
|
}) => {
|
|
4712
|
-
const
|
|
4712
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4713
4713
|
const client = getContentClient({
|
|
4714
4714
|
apiKey,
|
|
4715
4715
|
apiHost,
|
|
4716
|
-
fetch:
|
|
4716
|
+
fetch: fetch3,
|
|
4717
4717
|
projectId
|
|
4718
4718
|
});
|
|
4719
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
4719
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4720
4720
|
const source = createEntryEngineDataSource({ client, state, onlyPatterns: true });
|
|
4721
4721
|
let target;
|
|
4722
4722
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -4768,13 +4768,13 @@ var EntryPatternPullModule = {
|
|
|
4768
4768
|
var EntryPatternPushModule = {
|
|
4769
4769
|
command: "push <directory>",
|
|
4770
4770
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
4771
|
-
builder: (
|
|
4771
|
+
builder: (yargs38) => withConfiguration(
|
|
4772
4772
|
withDebugOptions(
|
|
4773
4773
|
withApiOptions(
|
|
4774
4774
|
withProjectOptions(
|
|
4775
4775
|
withStateOptions(
|
|
4776
4776
|
withDiffOptions(
|
|
4777
|
-
|
|
4777
|
+
yargs38.positional("directory", {
|
|
4778
4778
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
4779
4779
|
type: "string"
|
|
4780
4780
|
}).option("what-if", {
|
|
@@ -4808,11 +4808,11 @@ var EntryPatternPushModule = {
|
|
|
4808
4808
|
allowEmptySource,
|
|
4809
4809
|
verbose
|
|
4810
4810
|
}) => {
|
|
4811
|
-
const
|
|
4811
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4812
4812
|
const client = getContentClient({
|
|
4813
4813
|
apiKey,
|
|
4814
4814
|
apiHost,
|
|
4815
|
-
fetch:
|
|
4815
|
+
fetch: fetch3,
|
|
4816
4816
|
projectId
|
|
4817
4817
|
});
|
|
4818
4818
|
let source;
|
|
@@ -4834,7 +4834,7 @@ var EntryPatternPushModule = {
|
|
|
4834
4834
|
});
|
|
4835
4835
|
}
|
|
4836
4836
|
const target = createEntryEngineDataSource({ client, state, onlyPatterns: true });
|
|
4837
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
4837
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4838
4838
|
await syncEngine({
|
|
4839
4839
|
source,
|
|
4840
4840
|
target,
|
|
@@ -4862,18 +4862,18 @@ var EntryPatternRemoveModule = {
|
|
|
4862
4862
|
command: "remove <id>",
|
|
4863
4863
|
aliases: ["delete", "rm"],
|
|
4864
4864
|
describe: "Delete an entry pattern",
|
|
4865
|
-
builder: (
|
|
4865
|
+
builder: (yargs38) => withConfiguration(
|
|
4866
4866
|
withDebugOptions(
|
|
4867
4867
|
withApiOptions(
|
|
4868
4868
|
withProjectOptions(
|
|
4869
|
-
|
|
4869
|
+
yargs38.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
4870
4870
|
)
|
|
4871
4871
|
)
|
|
4872
4872
|
)
|
|
4873
4873
|
),
|
|
4874
4874
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
4875
|
-
const
|
|
4876
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
4875
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4876
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4877
4877
|
if (!whatIf) {
|
|
4878
4878
|
await client.deleteEntry({ entryId: id });
|
|
4879
4879
|
} else {
|
|
@@ -4888,11 +4888,11 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
4888
4888
|
var EntryPatternUnpublishModule = {
|
|
4889
4889
|
command: "unpublish [ids]",
|
|
4890
4890
|
describe: "Unpublish an entry patterns",
|
|
4891
|
-
builder: (
|
|
4891
|
+
builder: (yargs38) => withConfiguration(
|
|
4892
4892
|
withDebugOptions(
|
|
4893
4893
|
withApiOptions(
|
|
4894
4894
|
withProjectOptions(
|
|
4895
|
-
|
|
4895
|
+
yargs38.positional("ids", {
|
|
4896
4896
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4897
4897
|
type: "string"
|
|
4898
4898
|
}).option("all", {
|
|
@@ -4912,8 +4912,8 @@ var EntryPatternUnpublishModule = {
|
|
|
4912
4912
|
}
|
|
4913
4913
|
const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
4914
4914
|
const targetItems = /* @__PURE__ */ new Map();
|
|
4915
|
-
const
|
|
4916
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
4915
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4916
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
4917
4917
|
const source = createEntryEngineDataSource({
|
|
4918
4918
|
client,
|
|
4919
4919
|
state: "published",
|
|
@@ -4962,12 +4962,12 @@ var EntryPatternUpdateModule = {
|
|
|
4962
4962
|
command: "update <filename>",
|
|
4963
4963
|
aliases: ["put"],
|
|
4964
4964
|
describe: "Insert or update an entry pattern",
|
|
4965
|
-
builder: (
|
|
4965
|
+
builder: (yargs38) => withConfiguration(
|
|
4966
4966
|
withDebugOptions(
|
|
4967
4967
|
withApiOptions(
|
|
4968
4968
|
withProjectOptions(
|
|
4969
4969
|
withStateOptions(
|
|
4970
|
-
|
|
4970
|
+
yargs38.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
4971
4971
|
)
|
|
4972
4972
|
)
|
|
4973
4973
|
)
|
|
@@ -4984,8 +4984,8 @@ var EntryPatternUpdateModule = {
|
|
|
4984
4984
|
verbose,
|
|
4985
4985
|
whatIf
|
|
4986
4986
|
}) => {
|
|
4987
|
-
const
|
|
4988
|
-
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch:
|
|
4987
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
4988
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch3, projectId });
|
|
4989
4989
|
const file = readFileToObject(filename);
|
|
4990
4990
|
if (!whatIf) {
|
|
4991
4991
|
await client.upsertEntry({ ...file, state: convertStateOption(state) });
|
|
@@ -5003,7 +5003,7 @@ var EntryPatternUpdateModule = {
|
|
|
5003
5003
|
var EntryPatternModule = {
|
|
5004
5004
|
command: "entry-pattern <command>",
|
|
5005
5005
|
describe: "Commands for Entry patterns",
|
|
5006
|
-
builder: (
|
|
5006
|
+
builder: (yargs38) => yargs38.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
5007
5007
|
handler: () => {
|
|
5008
5008
|
yargs11.help();
|
|
5009
5009
|
}
|
|
@@ -5052,12 +5052,12 @@ function getLocaleClient(options) {
|
|
|
5052
5052
|
var LocalePullModule = {
|
|
5053
5053
|
command: "pull <directory>",
|
|
5054
5054
|
describe: "Pulls all locales to local files in a directory",
|
|
5055
|
-
builder: (
|
|
5055
|
+
builder: (yargs38) => withConfiguration(
|
|
5056
5056
|
withDebugOptions(
|
|
5057
5057
|
withApiOptions(
|
|
5058
5058
|
withProjectOptions(
|
|
5059
5059
|
withDiffOptions(
|
|
5060
|
-
|
|
5060
|
+
yargs38.positional("directory", {
|
|
5061
5061
|
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.",
|
|
5062
5062
|
type: "string"
|
|
5063
5063
|
}).option("format", {
|
|
@@ -5091,11 +5091,11 @@ var LocalePullModule = {
|
|
|
5091
5091
|
allowEmptySource,
|
|
5092
5092
|
verbose
|
|
5093
5093
|
}) => {
|
|
5094
|
-
const
|
|
5094
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5095
5095
|
const client = getLocaleClient({
|
|
5096
5096
|
apiKey,
|
|
5097
5097
|
apiHost,
|
|
5098
|
-
fetch:
|
|
5098
|
+
fetch: fetch3,
|
|
5099
5099
|
projectId
|
|
5100
5100
|
});
|
|
5101
5101
|
const source = createLocaleEngineDataSource({ client });
|
|
@@ -5137,12 +5137,12 @@ var LocalePullModule = {
|
|
|
5137
5137
|
var LocalePushModule = {
|
|
5138
5138
|
command: "push <directory>",
|
|
5139
5139
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
5140
|
-
builder: (
|
|
5140
|
+
builder: (yargs38) => withConfiguration(
|
|
5141
5141
|
withDebugOptions(
|
|
5142
5142
|
withApiOptions(
|
|
5143
5143
|
withProjectOptions(
|
|
5144
5144
|
withDiffOptions(
|
|
5145
|
-
|
|
5145
|
+
yargs38.positional("directory", {
|
|
5146
5146
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
5147
5147
|
type: "string"
|
|
5148
5148
|
}).option("mode", {
|
|
@@ -5169,11 +5169,11 @@ var LocalePushModule = {
|
|
|
5169
5169
|
allowEmptySource,
|
|
5170
5170
|
verbose
|
|
5171
5171
|
}) => {
|
|
5172
|
-
const
|
|
5172
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5173
5173
|
const client = getLocaleClient({
|
|
5174
5174
|
apiKey,
|
|
5175
5175
|
apiHost,
|
|
5176
|
-
fetch:
|
|
5176
|
+
fetch: fetch3,
|
|
5177
5177
|
projectId
|
|
5178
5178
|
});
|
|
5179
5179
|
let source;
|
|
@@ -5210,7 +5210,7 @@ var LocalePushModule = {
|
|
|
5210
5210
|
var LocaleModule = {
|
|
5211
5211
|
command: "locale <command>",
|
|
5212
5212
|
describe: "Commands for locale definitions",
|
|
5213
|
-
builder: (
|
|
5213
|
+
builder: (yargs38) => yargs38.command(LocalePullModule).command(LocalePushModule),
|
|
5214
5214
|
handler: () => {
|
|
5215
5215
|
yargs12.help();
|
|
5216
5216
|
}
|
|
@@ -5229,13 +5229,13 @@ var PatternGetModule = {
|
|
|
5229
5229
|
var PatternListModule = {
|
|
5230
5230
|
...CompositionListModule,
|
|
5231
5231
|
describe: "List patterns",
|
|
5232
|
-
builder: (
|
|
5232
|
+
builder: (yargs38) => withFormatOptions(
|
|
5233
5233
|
withConfiguration(
|
|
5234
5234
|
withApiOptions(
|
|
5235
5235
|
withDebugOptions(
|
|
5236
5236
|
withProjectOptions(
|
|
5237
5237
|
withStateOptions(
|
|
5238
|
-
|
|
5238
|
+
yargs38.options({
|
|
5239
5239
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
5240
5240
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
5241
5241
|
resolvePatterns: {
|
|
@@ -5274,12 +5274,12 @@ var PatternListModule = {
|
|
|
5274
5274
|
var PatternPublishModule = {
|
|
5275
5275
|
...CompositionPublishModule,
|
|
5276
5276
|
describe: "Publishes pattern(s)",
|
|
5277
|
-
builder: (
|
|
5277
|
+
builder: (yargs38) => withConfiguration(
|
|
5278
5278
|
withDebugOptions(
|
|
5279
5279
|
withApiOptions(
|
|
5280
5280
|
withProjectOptions(
|
|
5281
5281
|
withDiffOptions(
|
|
5282
|
-
|
|
5282
|
+
yargs38.positional("ids", {
|
|
5283
5283
|
describe: "Publishes pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
5284
5284
|
type: "string"
|
|
5285
5285
|
}).option("all", {
|
|
@@ -5313,13 +5313,13 @@ var PatternPublishModule = {
|
|
|
5313
5313
|
var PatternPullModule = {
|
|
5314
5314
|
...CompositionPullModule,
|
|
5315
5315
|
describe: "Pulls all patterns to local files in a directory",
|
|
5316
|
-
builder: (
|
|
5316
|
+
builder: (yargs38) => withConfiguration(
|
|
5317
5317
|
withDebugOptions(
|
|
5318
5318
|
withApiOptions(
|
|
5319
5319
|
withProjectOptions(
|
|
5320
5320
|
withStateOptions(
|
|
5321
5321
|
withDiffOptions(
|
|
5322
|
-
|
|
5322
|
+
yargs38.positional("directory", {
|
|
5323
5323
|
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.",
|
|
5324
5324
|
type: "string"
|
|
5325
5325
|
}).option("format", {
|
|
@@ -5353,13 +5353,13 @@ var PatternPullModule = {
|
|
|
5353
5353
|
var PatternPushModule = {
|
|
5354
5354
|
...CompositionPushModule,
|
|
5355
5355
|
describe: "Pushes all patterns from files in a directory to Uniform Canvas",
|
|
5356
|
-
builder: (
|
|
5356
|
+
builder: (yargs38) => withConfiguration(
|
|
5357
5357
|
withDebugOptions(
|
|
5358
5358
|
withApiOptions(
|
|
5359
5359
|
withProjectOptions(
|
|
5360
5360
|
withStateOptions(
|
|
5361
5361
|
withDiffOptions(
|
|
5362
|
-
|
|
5362
|
+
yargs38.positional("directory", {
|
|
5363
5363
|
describe: "Directory to read the patterns from. If a filename is used, a package will be read instead.",
|
|
5364
5364
|
type: "string"
|
|
5365
5365
|
}).option("mode", {
|
|
@@ -5397,11 +5397,11 @@ var PatternRemoveModule = {
|
|
|
5397
5397
|
var PatternUnpublishModule = {
|
|
5398
5398
|
command: "unpublish [ids]",
|
|
5399
5399
|
describe: "Unpublish a pattern(s)",
|
|
5400
|
-
builder: (
|
|
5400
|
+
builder: (yargs38) => withConfiguration(
|
|
5401
5401
|
withDebugOptions(
|
|
5402
5402
|
withApiOptions(
|
|
5403
5403
|
withProjectOptions(
|
|
5404
|
-
|
|
5404
|
+
yargs38.positional("ids", {
|
|
5405
5405
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5406
5406
|
type: "string"
|
|
5407
5407
|
}).option("all", {
|
|
@@ -5437,7 +5437,7 @@ var PatternModule = {
|
|
|
5437
5437
|
command: "pattern <command>",
|
|
5438
5438
|
describe: "Commands for Canvas patterns",
|
|
5439
5439
|
deprecated: 'will be removed in a future major release. Use "component-pattern" and "composition-pattern" instead.',
|
|
5440
|
-
builder: (
|
|
5440
|
+
builder: (yargs38) => yargs38.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
|
|
5441
5441
|
handler: () => {
|
|
5442
5442
|
yargs13.help();
|
|
5443
5443
|
}
|
|
@@ -5458,20 +5458,20 @@ function getPreviewClient(options) {
|
|
|
5458
5458
|
var PreviewUrlGetModule = {
|
|
5459
5459
|
command: "get <id>",
|
|
5460
5460
|
describe: "Fetch a preview URL",
|
|
5461
|
-
builder: (
|
|
5461
|
+
builder: (yargs38) => withConfiguration(
|
|
5462
5462
|
withFormatOptions(
|
|
5463
5463
|
withDebugOptions(
|
|
5464
5464
|
withApiOptions(
|
|
5465
5465
|
withProjectOptions(
|
|
5466
|
-
|
|
5466
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
5467
5467
|
)
|
|
5468
5468
|
)
|
|
5469
5469
|
)
|
|
5470
5470
|
)
|
|
5471
5471
|
),
|
|
5472
5472
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
|
|
5473
|
-
const
|
|
5474
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5473
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5474
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5475
5475
|
const previewUrl = await client.getPreviewUrl({ id });
|
|
5476
5476
|
if (!previewUrl) {
|
|
5477
5477
|
console.error("Preview URL did not exist");
|
|
@@ -5487,12 +5487,12 @@ var PreviewUrlListModule = {
|
|
|
5487
5487
|
command: "list",
|
|
5488
5488
|
describe: "List preview URLs",
|
|
5489
5489
|
aliases: ["ls"],
|
|
5490
|
-
builder: (
|
|
5491
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
5490
|
+
builder: (yargs38) => withConfiguration(
|
|
5491
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs38.options({})))))
|
|
5492
5492
|
),
|
|
5493
5493
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5494
|
-
const
|
|
5495
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5494
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5495
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5496
5496
|
const res = await client.getPreviewUrls();
|
|
5497
5497
|
emitWithFormat(res.previewUrls, format, filename);
|
|
5498
5498
|
}
|
|
@@ -5530,12 +5530,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
5530
5530
|
var PreviewUrlPullModule = {
|
|
5531
5531
|
command: "pull <directory>",
|
|
5532
5532
|
describe: "Pulls all preview urls to local files in a directory",
|
|
5533
|
-
builder: (
|
|
5533
|
+
builder: (yargs38) => withConfiguration(
|
|
5534
5534
|
withApiOptions(
|
|
5535
5535
|
withProjectOptions(
|
|
5536
5536
|
withDebugOptions(
|
|
5537
5537
|
withDiffOptions(
|
|
5538
|
-
|
|
5538
|
+
yargs38.positional("directory", {
|
|
5539
5539
|
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.",
|
|
5540
5540
|
type: "string"
|
|
5541
5541
|
}).option("format", {
|
|
@@ -5569,8 +5569,8 @@ var PreviewUrlPullModule = {
|
|
|
5569
5569
|
allowEmptySource,
|
|
5570
5570
|
verbose
|
|
5571
5571
|
}) => {
|
|
5572
|
-
const
|
|
5573
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5572
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5573
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5574
5574
|
const source = createPreviewUrlEngineDataSource({ client });
|
|
5575
5575
|
let target;
|
|
5576
5576
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -5610,12 +5610,12 @@ var PreviewUrlPullModule = {
|
|
|
5610
5610
|
var PreviewUrlPushModule = {
|
|
5611
5611
|
command: "push <directory>",
|
|
5612
5612
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
5613
|
-
builder: (
|
|
5613
|
+
builder: (yargs38) => withConfiguration(
|
|
5614
5614
|
withApiOptions(
|
|
5615
5615
|
withProjectOptions(
|
|
5616
5616
|
withDiffOptions(
|
|
5617
5617
|
withDebugOptions(
|
|
5618
|
-
|
|
5618
|
+
yargs38.positional("directory", {
|
|
5619
5619
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
5620
5620
|
type: "string"
|
|
5621
5621
|
}).option("mode", {
|
|
@@ -5642,8 +5642,8 @@ var PreviewUrlPushModule = {
|
|
|
5642
5642
|
allowEmptySource,
|
|
5643
5643
|
verbose
|
|
5644
5644
|
}) => {
|
|
5645
|
-
const
|
|
5646
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5645
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5646
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5647
5647
|
let source;
|
|
5648
5648
|
const isPackage = isPathAPackageFile(directory);
|
|
5649
5649
|
if (isPackage) {
|
|
@@ -5679,18 +5679,18 @@ var PreviewUrlRemoveModule = {
|
|
|
5679
5679
|
command: "remove <id>",
|
|
5680
5680
|
aliases: ["delete", "rm"],
|
|
5681
5681
|
describe: "Delete a preview URL",
|
|
5682
|
-
builder: (
|
|
5682
|
+
builder: (yargs38) => withConfiguration(
|
|
5683
5683
|
withApiOptions(
|
|
5684
5684
|
withDebugOptions(
|
|
5685
5685
|
withProjectOptions(
|
|
5686
|
-
|
|
5686
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
5687
5687
|
)
|
|
5688
5688
|
)
|
|
5689
5689
|
)
|
|
5690
5690
|
),
|
|
5691
5691
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
5692
|
-
const
|
|
5693
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5692
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5693
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5694
5694
|
if (!whatIf) {
|
|
5695
5695
|
await client.deletePreviewUrl({ id });
|
|
5696
5696
|
} else {
|
|
@@ -5704,18 +5704,18 @@ var PreviewUrlUpdateModule = {
|
|
|
5704
5704
|
command: "update <filename>",
|
|
5705
5705
|
aliases: ["put"],
|
|
5706
5706
|
describe: "Insert or update a preview URL",
|
|
5707
|
-
builder: (
|
|
5707
|
+
builder: (yargs38) => withConfiguration(
|
|
5708
5708
|
withDebugOptions(
|
|
5709
5709
|
withApiOptions(
|
|
5710
5710
|
withProjectOptions(
|
|
5711
|
-
|
|
5711
|
+
yargs38.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
5712
5712
|
)
|
|
5713
5713
|
)
|
|
5714
5714
|
)
|
|
5715
5715
|
),
|
|
5716
5716
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, whatIf, verbose }) => {
|
|
5717
|
-
const
|
|
5718
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5717
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5718
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5719
5719
|
const file = readFileToObject(filename);
|
|
5720
5720
|
if (!whatIf) {
|
|
5721
5721
|
await client.upsertPreviewUrl(file);
|
|
@@ -5730,7 +5730,7 @@ var PreviewUrlModule = {
|
|
|
5730
5730
|
command: "preview-url <command>",
|
|
5731
5731
|
aliases: ["pu"],
|
|
5732
5732
|
describe: "Commands for Canvas preview urls",
|
|
5733
|
-
builder: (
|
|
5733
|
+
builder: (yargs38) => yargs38.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
5734
5734
|
handler: () => {
|
|
5735
5735
|
yargs14.help();
|
|
5736
5736
|
}
|
|
@@ -5743,20 +5743,20 @@ import yargs15 from "yargs";
|
|
|
5743
5743
|
var PreviewViewportGetModule = {
|
|
5744
5744
|
command: "get <id>",
|
|
5745
5745
|
describe: "Fetch a preview viewport",
|
|
5746
|
-
builder: (
|
|
5746
|
+
builder: (yargs38) => withConfiguration(
|
|
5747
5747
|
withFormatOptions(
|
|
5748
5748
|
withDebugOptions(
|
|
5749
5749
|
withApiOptions(
|
|
5750
5750
|
withProjectOptions(
|
|
5751
|
-
|
|
5751
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
5752
5752
|
)
|
|
5753
5753
|
)
|
|
5754
5754
|
)
|
|
5755
5755
|
)
|
|
5756
5756
|
),
|
|
5757
5757
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename, verbose }) => {
|
|
5758
|
-
const
|
|
5759
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5758
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5759
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5760
5760
|
const previewViewport = await client.getPreviewViewport({ id });
|
|
5761
5761
|
if (!previewViewport) {
|
|
5762
5762
|
console.error("Preview viewport did not exist");
|
|
@@ -5772,12 +5772,12 @@ var PreviewViewportListModule = {
|
|
|
5772
5772
|
command: "list",
|
|
5773
5773
|
describe: "List preview viewports",
|
|
5774
5774
|
aliases: ["ls"],
|
|
5775
|
-
builder: (
|
|
5776
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
5775
|
+
builder: (yargs38) => withConfiguration(
|
|
5776
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs38.options({})))))
|
|
5777
5777
|
),
|
|
5778
5778
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5779
|
-
const
|
|
5780
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5779
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5780
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5781
5781
|
const res = await client.getPreviewViewports();
|
|
5782
5782
|
emitWithFormat(res.previewViewports, format, filename);
|
|
5783
5783
|
}
|
|
@@ -5819,12 +5819,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
5819
5819
|
var PreviewViewportPullModule = {
|
|
5820
5820
|
command: "pull <directory>",
|
|
5821
5821
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
5822
|
-
builder: (
|
|
5822
|
+
builder: (yargs38) => withConfiguration(
|
|
5823
5823
|
withApiOptions(
|
|
5824
5824
|
withProjectOptions(
|
|
5825
5825
|
withDebugOptions(
|
|
5826
5826
|
withDiffOptions(
|
|
5827
|
-
|
|
5827
|
+
yargs38.positional("directory", {
|
|
5828
5828
|
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.",
|
|
5829
5829
|
type: "string"
|
|
5830
5830
|
}).option("format", {
|
|
@@ -5858,8 +5858,8 @@ var PreviewViewportPullModule = {
|
|
|
5858
5858
|
allowEmptySource,
|
|
5859
5859
|
verbose
|
|
5860
5860
|
}) => {
|
|
5861
|
-
const
|
|
5862
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5861
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5862
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5863
5863
|
const source = createPreviewViewportEngineDataSource({ client });
|
|
5864
5864
|
let target;
|
|
5865
5865
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -5899,12 +5899,12 @@ var PreviewViewportPullModule = {
|
|
|
5899
5899
|
var PreviewViewportPushModule = {
|
|
5900
5900
|
command: "push <directory>",
|
|
5901
5901
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
5902
|
-
builder: (
|
|
5902
|
+
builder: (yargs38) => withConfiguration(
|
|
5903
5903
|
withApiOptions(
|
|
5904
5904
|
withProjectOptions(
|
|
5905
5905
|
withDiffOptions(
|
|
5906
5906
|
withDebugOptions(
|
|
5907
|
-
|
|
5907
|
+
yargs38.positional("directory", {
|
|
5908
5908
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
5909
5909
|
type: "string"
|
|
5910
5910
|
}).option("mode", {
|
|
@@ -5931,8 +5931,8 @@ var PreviewViewportPushModule = {
|
|
|
5931
5931
|
allowEmptySource,
|
|
5932
5932
|
verbose
|
|
5933
5933
|
}) => {
|
|
5934
|
-
const
|
|
5935
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5934
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5935
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5936
5936
|
let source;
|
|
5937
5937
|
const isPackage = isPathAPackageFile(directory);
|
|
5938
5938
|
if (isPackage) {
|
|
@@ -5968,18 +5968,18 @@ var PreviewViewportRemoveModule = {
|
|
|
5968
5968
|
command: "remove <id>",
|
|
5969
5969
|
aliases: ["delete", "rm"],
|
|
5970
5970
|
describe: "Delete a preview viewport",
|
|
5971
|
-
builder: (
|
|
5971
|
+
builder: (yargs38) => withConfiguration(
|
|
5972
5972
|
withApiOptions(
|
|
5973
5973
|
withDebugOptions(
|
|
5974
5974
|
withProjectOptions(
|
|
5975
|
-
|
|
5975
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
5976
5976
|
)
|
|
5977
5977
|
)
|
|
5978
5978
|
)
|
|
5979
5979
|
),
|
|
5980
5980
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
5981
|
-
const
|
|
5982
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
5981
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
5982
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5983
5983
|
if (!whatIf) {
|
|
5984
5984
|
await client.deletePreviewViewport({ id });
|
|
5985
5985
|
} else {
|
|
@@ -5993,18 +5993,18 @@ var PreviewViewportUpdateModule = {
|
|
|
5993
5993
|
command: "update <filename>",
|
|
5994
5994
|
aliases: ["put"],
|
|
5995
5995
|
describe: "Insert or update a preview viewport",
|
|
5996
|
-
builder: (
|
|
5996
|
+
builder: (yargs38) => withConfiguration(
|
|
5997
5997
|
withDebugOptions(
|
|
5998
5998
|
withApiOptions(
|
|
5999
5999
|
withProjectOptions(
|
|
6000
|
-
|
|
6000
|
+
yargs38.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
6001
6001
|
)
|
|
6002
6002
|
)
|
|
6003
6003
|
)
|
|
6004
6004
|
),
|
|
6005
6005
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, whatIf, verbose }) => {
|
|
6006
|
-
const
|
|
6007
|
-
const client = getPreviewClient({ apiKey, apiHost, fetch:
|
|
6006
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6007
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6008
6008
|
const file = readFileToObject(filename);
|
|
6009
6009
|
if (!whatIf) {
|
|
6010
6010
|
await client.upsertPreviewViewport(file);
|
|
@@ -6019,7 +6019,7 @@ var PreviewViewportModule = {
|
|
|
6019
6019
|
command: "preview-viewport <command>",
|
|
6020
6020
|
aliases: ["pv"],
|
|
6021
6021
|
describe: "Commands for Canvas preview viewports",
|
|
6022
|
-
builder: (
|
|
6022
|
+
builder: (yargs38) => yargs38.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
6023
6023
|
handler: () => {
|
|
6024
6024
|
yargs15.help();
|
|
6025
6025
|
}
|
|
@@ -6038,20 +6038,20 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
6038
6038
|
var PromptGetModule = {
|
|
6039
6039
|
command: "get <id>",
|
|
6040
6040
|
describe: "Get a prompt",
|
|
6041
|
-
builder: (
|
|
6041
|
+
builder: (yargs38) => withConfiguration(
|
|
6042
6042
|
withDebugOptions(
|
|
6043
6043
|
withFormatOptions(
|
|
6044
6044
|
withApiOptions(
|
|
6045
6045
|
withProjectOptions(
|
|
6046
|
-
|
|
6046
|
+
yargs38.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
6047
6047
|
)
|
|
6048
6048
|
)
|
|
6049
6049
|
)
|
|
6050
6050
|
)
|
|
6051
6051
|
),
|
|
6052
6052
|
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId, verbose }) => {
|
|
6053
|
-
const
|
|
6054
|
-
const client = getPromptClient({ apiKey, apiHost, fetch:
|
|
6053
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6054
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6055
6055
|
const res = await client.get({ promptId: id });
|
|
6056
6056
|
if (!res) {
|
|
6057
6057
|
throw new Error(`Prompt with ID ${id} not found`);
|
|
@@ -6064,10 +6064,10 @@ var PromptGetModule = {
|
|
|
6064
6064
|
var PromptListModule = {
|
|
6065
6065
|
command: "list",
|
|
6066
6066
|
describe: "List prompts",
|
|
6067
|
-
builder: (
|
|
6067
|
+
builder: (yargs38) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs38))))),
|
|
6068
6068
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
6069
|
-
const
|
|
6070
|
-
const client = getPromptClient({ apiKey, apiHost, fetch:
|
|
6069
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6070
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6071
6071
|
const res = await client.get();
|
|
6072
6072
|
emitWithFormat(res, format, filename);
|
|
6073
6073
|
}
|
|
@@ -6105,13 +6105,13 @@ function createPromptEngineDataSource({
|
|
|
6105
6105
|
var PromptPullModule = {
|
|
6106
6106
|
command: "pull <directory>",
|
|
6107
6107
|
describe: "Pulls all prompts to local files in a directory",
|
|
6108
|
-
builder: (
|
|
6108
|
+
builder: (yargs38) => withConfiguration(
|
|
6109
6109
|
withDebugOptions(
|
|
6110
6110
|
withApiOptions(
|
|
6111
6111
|
withProjectOptions(
|
|
6112
6112
|
withStateOptions(
|
|
6113
6113
|
withDiffOptions(
|
|
6114
|
-
|
|
6114
|
+
yargs38.positional("directory", {
|
|
6115
6115
|
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.",
|
|
6116
6116
|
type: "string"
|
|
6117
6117
|
}).option("format", {
|
|
@@ -6146,11 +6146,11 @@ var PromptPullModule = {
|
|
|
6146
6146
|
allowEmptySource,
|
|
6147
6147
|
verbose
|
|
6148
6148
|
}) => {
|
|
6149
|
-
const
|
|
6149
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6150
6150
|
const client = getPromptClient({
|
|
6151
6151
|
apiKey,
|
|
6152
6152
|
apiHost,
|
|
6153
|
-
fetch:
|
|
6153
|
+
fetch: fetch3,
|
|
6154
6154
|
projectId
|
|
6155
6155
|
});
|
|
6156
6156
|
const source = createPromptEngineDataSource({ client });
|
|
@@ -6192,12 +6192,12 @@ var PromptPullModule = {
|
|
|
6192
6192
|
var PromptPushModule = {
|
|
6193
6193
|
command: "push <directory>",
|
|
6194
6194
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
6195
|
-
builder: (
|
|
6195
|
+
builder: (yargs38) => withConfiguration(
|
|
6196
6196
|
withApiOptions(
|
|
6197
6197
|
withProjectOptions(
|
|
6198
6198
|
withStateOptions(
|
|
6199
6199
|
withDiffOptions(
|
|
6200
|
-
|
|
6200
|
+
yargs38.positional("directory", {
|
|
6201
6201
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
6202
6202
|
type: "string"
|
|
6203
6203
|
}).option("mode", {
|
|
@@ -6224,11 +6224,11 @@ var PromptPushModule = {
|
|
|
6224
6224
|
allowEmptySource,
|
|
6225
6225
|
verbose
|
|
6226
6226
|
}) => {
|
|
6227
|
-
const
|
|
6227
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6228
6228
|
const client = getPromptClient({
|
|
6229
6229
|
apiKey,
|
|
6230
6230
|
apiHost,
|
|
6231
|
-
fetch:
|
|
6231
|
+
fetch: fetch3,
|
|
6232
6232
|
projectId
|
|
6233
6233
|
});
|
|
6234
6234
|
let source;
|
|
@@ -6266,16 +6266,16 @@ var PromptRemoveModule = {
|
|
|
6266
6266
|
command: "remove <id>",
|
|
6267
6267
|
aliases: ["delete", "rm"],
|
|
6268
6268
|
describe: "Delete a prompt",
|
|
6269
|
-
builder: (
|
|
6269
|
+
builder: (yargs38) => withConfiguration(
|
|
6270
6270
|
withDebugOptions(
|
|
6271
6271
|
withApiOptions(
|
|
6272
|
-
withProjectOptions(
|
|
6272
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
6273
6273
|
)
|
|
6274
6274
|
)
|
|
6275
6275
|
),
|
|
6276
6276
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId, verbose, whatIf }) => {
|
|
6277
|
-
const
|
|
6278
|
-
const client = getPromptClient({ apiKey, apiHost, fetch:
|
|
6277
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6278
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6279
6279
|
if (!whatIf) {
|
|
6280
6280
|
await client.remove({ promptId: id });
|
|
6281
6281
|
} else {
|
|
@@ -6289,18 +6289,18 @@ var PromptUpdateModule = {
|
|
|
6289
6289
|
command: "update <filename>",
|
|
6290
6290
|
aliases: ["put"],
|
|
6291
6291
|
describe: "Insert or update a prompt",
|
|
6292
|
-
builder: (
|
|
6292
|
+
builder: (yargs38) => withConfiguration(
|
|
6293
6293
|
withDebugOptions(
|
|
6294
6294
|
withApiOptions(
|
|
6295
6295
|
withProjectOptions(
|
|
6296
|
-
|
|
6296
|
+
yargs38.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
6297
6297
|
)
|
|
6298
6298
|
)
|
|
6299
6299
|
)
|
|
6300
6300
|
),
|
|
6301
6301
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, verbose, whatIf }) => {
|
|
6302
|
-
const
|
|
6303
|
-
const client = getPromptClient({ apiKey, apiHost, fetch:
|
|
6302
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6303
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6304
6304
|
const file = readFileToObject(filename);
|
|
6305
6305
|
if (!whatIf) {
|
|
6306
6306
|
await client.upsert({ data: file });
|
|
@@ -6315,7 +6315,7 @@ var PromptModule = {
|
|
|
6315
6315
|
command: "prompt <command>",
|
|
6316
6316
|
aliases: ["dt"],
|
|
6317
6317
|
describe: "Commands for AI Prompt definitions",
|
|
6318
|
-
builder: (
|
|
6318
|
+
builder: (yargs38) => yargs38.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
6319
6319
|
handler: () => {
|
|
6320
6320
|
yargs16.help();
|
|
6321
6321
|
}
|
|
@@ -6365,12 +6365,12 @@ function createWorkflowEngineDataSource({
|
|
|
6365
6365
|
var WorkflowPullModule = {
|
|
6366
6366
|
command: "pull <directory>",
|
|
6367
6367
|
describe: "Pulls all workflows to local files in a directory",
|
|
6368
|
-
builder: (
|
|
6368
|
+
builder: (yargs38) => withConfiguration(
|
|
6369
6369
|
withApiOptions(
|
|
6370
6370
|
withDebugOptions(
|
|
6371
6371
|
withProjectOptions(
|
|
6372
6372
|
withDiffOptions(
|
|
6373
|
-
|
|
6373
|
+
yargs38.positional("directory", {
|
|
6374
6374
|
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.",
|
|
6375
6375
|
type: "string"
|
|
6376
6376
|
}).option("format", {
|
|
@@ -6404,8 +6404,8 @@ var WorkflowPullModule = {
|
|
|
6404
6404
|
allowEmptySource,
|
|
6405
6405
|
verbose
|
|
6406
6406
|
}) => {
|
|
6407
|
-
const
|
|
6408
|
-
const client = getWorkflowClient({ apiKey, apiHost, fetch:
|
|
6407
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6408
|
+
const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6409
6409
|
const source = createWorkflowEngineDataSource({ client });
|
|
6410
6410
|
let target;
|
|
6411
6411
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -6445,12 +6445,12 @@ var WorkflowPullModule = {
|
|
|
6445
6445
|
var WorkflowPushModule = {
|
|
6446
6446
|
command: "push <directory>",
|
|
6447
6447
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
6448
|
-
builder: (
|
|
6448
|
+
builder: (yargs38) => withConfiguration(
|
|
6449
6449
|
withDebugOptions(
|
|
6450
6450
|
withApiOptions(
|
|
6451
6451
|
withProjectOptions(
|
|
6452
6452
|
withDiffOptions(
|
|
6453
|
-
|
|
6453
|
+
yargs38.positional("directory", {
|
|
6454
6454
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
6455
6455
|
type: "string"
|
|
6456
6456
|
}).option("mode", {
|
|
@@ -6477,8 +6477,8 @@ var WorkflowPushModule = {
|
|
|
6477
6477
|
allowEmptySource,
|
|
6478
6478
|
verbose
|
|
6479
6479
|
}) => {
|
|
6480
|
-
const
|
|
6481
|
-
const client = getWorkflowClient({ apiKey, apiHost, fetch:
|
|
6480
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6481
|
+
const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6482
6482
|
let source;
|
|
6483
6483
|
const isPackage = isPathAPackageFile(directory);
|
|
6484
6484
|
if (isPackage) {
|
|
@@ -6514,7 +6514,7 @@ var WorkflowModule = {
|
|
|
6514
6514
|
command: "workflow <command>",
|
|
6515
6515
|
aliases: ["wf"],
|
|
6516
6516
|
describe: "Commands for Canvas workflows",
|
|
6517
|
-
builder: (
|
|
6517
|
+
builder: (yargs38) => yargs38.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
6518
6518
|
handler: () => {
|
|
6519
6519
|
yargs17.help();
|
|
6520
6520
|
}
|
|
@@ -6525,7 +6525,7 @@ var CanvasCommand = {
|
|
|
6525
6525
|
command: "canvas <command>",
|
|
6526
6526
|
aliases: ["cv", "pm", "presentation"],
|
|
6527
6527
|
describe: "Uniform Canvas commands",
|
|
6528
|
-
builder: (
|
|
6528
|
+
builder: (yargs38) => yargs38.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).command(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
6529
6529
|
handler: () => {
|
|
6530
6530
|
yargs18.showHelp();
|
|
6531
6531
|
}
|
|
@@ -6547,18 +6547,18 @@ var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCa
|
|
|
6547
6547
|
var AggregateGetModule = {
|
|
6548
6548
|
command: "get <id>",
|
|
6549
6549
|
describe: "Fetch an aggregate",
|
|
6550
|
-
builder: (
|
|
6550
|
+
builder: (yargs38) => withConfiguration(
|
|
6551
6551
|
withFormatOptions(
|
|
6552
6552
|
withApiOptions(
|
|
6553
6553
|
withProjectOptions(
|
|
6554
|
-
|
|
6554
|
+
yargs38.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
6555
6555
|
)
|
|
6556
6556
|
)
|
|
6557
6557
|
)
|
|
6558
6558
|
),
|
|
6559
6559
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
6560
|
-
const
|
|
6561
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6560
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6561
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6562
6562
|
const res = await client.get({ aggregateId: id });
|
|
6563
6563
|
if (res.aggregates.length === 0) {
|
|
6564
6564
|
console.error("Aggregate did not exist");
|
|
@@ -6574,10 +6574,10 @@ var AggregateListModule = {
|
|
|
6574
6574
|
command: "list",
|
|
6575
6575
|
describe: "List aggregates",
|
|
6576
6576
|
aliases: ["ls"],
|
|
6577
|
-
builder: (
|
|
6577
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
6578
6578
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6579
|
-
const
|
|
6580
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6579
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6580
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6581
6581
|
const res = await client.get({});
|
|
6582
6582
|
emitWithFormat(res.aggregates, format, filename);
|
|
6583
6583
|
}
|
|
@@ -6637,12 +6637,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
6637
6637
|
var AggregatePullModule = {
|
|
6638
6638
|
command: "pull <directory>",
|
|
6639
6639
|
describe: "Pulls all aggregates to local files in a directory",
|
|
6640
|
-
builder: (
|
|
6640
|
+
builder: (yargs38) => withConfiguration(
|
|
6641
6641
|
withApiOptions(
|
|
6642
6642
|
withDebugOptions(
|
|
6643
6643
|
withProjectOptions(
|
|
6644
6644
|
withDiffOptions(
|
|
6645
|
-
|
|
6645
|
+
yargs38.positional("directory", {
|
|
6646
6646
|
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.",
|
|
6647
6647
|
type: "string"
|
|
6648
6648
|
}).option("format", {
|
|
@@ -6676,8 +6676,8 @@ var AggregatePullModule = {
|
|
|
6676
6676
|
allowEmptySource,
|
|
6677
6677
|
verbose
|
|
6678
6678
|
}) => {
|
|
6679
|
-
const
|
|
6680
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6679
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6680
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6681
6681
|
const source = createAggregateEngineDataSource({ client });
|
|
6682
6682
|
let target;
|
|
6683
6683
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -6717,12 +6717,12 @@ var AggregatePullModule = {
|
|
|
6717
6717
|
var AggregatePushModule = {
|
|
6718
6718
|
command: "push <directory>",
|
|
6719
6719
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
6720
|
-
builder: (
|
|
6720
|
+
builder: (yargs38) => withConfiguration(
|
|
6721
6721
|
withApiOptions(
|
|
6722
6722
|
withProjectOptions(
|
|
6723
6723
|
withDiffOptions(
|
|
6724
6724
|
withDebugOptions(
|
|
6725
|
-
|
|
6725
|
+
yargs38.positional("directory", {
|
|
6726
6726
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
6727
6727
|
type: "string"
|
|
6728
6728
|
}).option("mode", {
|
|
@@ -6749,8 +6749,8 @@ var AggregatePushModule = {
|
|
|
6749
6749
|
allowEmptySource,
|
|
6750
6750
|
verbose
|
|
6751
6751
|
}) => {
|
|
6752
|
-
const
|
|
6753
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6752
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
6753
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6754
6754
|
let source;
|
|
6755
6755
|
const isPackage = isPathAPackageFile(directory);
|
|
6756
6756
|
if (isPackage) {
|
|
@@ -6787,16 +6787,16 @@ var AggregateRemoveModule = {
|
|
|
6787
6787
|
command: "remove <id>",
|
|
6788
6788
|
aliases: ["delete", "rm"],
|
|
6789
6789
|
describe: "Delete an aggregate",
|
|
6790
|
-
builder: (
|
|
6790
|
+
builder: (yargs38) => withConfiguration(
|
|
6791
6791
|
withApiOptions(
|
|
6792
6792
|
withProjectOptions(
|
|
6793
|
-
|
|
6793
|
+
yargs38.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
6794
6794
|
)
|
|
6795
6795
|
)
|
|
6796
6796
|
),
|
|
6797
6797
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
6798
|
-
const
|
|
6799
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6798
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6799
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6800
6800
|
await client.remove({ aggregateId: id });
|
|
6801
6801
|
}
|
|
6802
6802
|
};
|
|
@@ -6806,16 +6806,16 @@ var AggregateUpdateModule = {
|
|
|
6806
6806
|
command: "update <filename>",
|
|
6807
6807
|
aliases: ["put"],
|
|
6808
6808
|
describe: "Insert or update an aggregate",
|
|
6809
|
-
builder: (
|
|
6809
|
+
builder: (yargs38) => withConfiguration(
|
|
6810
6810
|
withApiOptions(
|
|
6811
6811
|
withProjectOptions(
|
|
6812
|
-
|
|
6812
|
+
yargs38.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
6813
6813
|
)
|
|
6814
6814
|
)
|
|
6815
6815
|
),
|
|
6816
6816
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
6817
|
-
const
|
|
6818
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6817
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6818
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6819
6819
|
const file = readFileToObject(filename);
|
|
6820
6820
|
await client.upsert({ aggregate: file });
|
|
6821
6821
|
}
|
|
@@ -6826,7 +6826,7 @@ var AggregateModule = {
|
|
|
6826
6826
|
command: "aggregate <command>",
|
|
6827
6827
|
aliases: ["agg", "intent", "audience"],
|
|
6828
6828
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
6829
|
-
builder: (
|
|
6829
|
+
builder: (yargs38) => yargs38.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
6830
6830
|
handler: () => {
|
|
6831
6831
|
yargs19.help();
|
|
6832
6832
|
}
|
|
@@ -6847,18 +6847,18 @@ function getEnrichmentClient(options) {
|
|
|
6847
6847
|
var EnrichmentGetModule = {
|
|
6848
6848
|
command: "get <id>",
|
|
6849
6849
|
describe: "Fetch an enrichment category and its values",
|
|
6850
|
-
builder: (
|
|
6850
|
+
builder: (yargs38) => withFormatOptions(
|
|
6851
6851
|
withConfiguration(
|
|
6852
6852
|
withApiOptions(
|
|
6853
6853
|
withProjectOptions(
|
|
6854
|
-
|
|
6854
|
+
yargs38.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
6855
6855
|
)
|
|
6856
6856
|
)
|
|
6857
6857
|
)
|
|
6858
6858
|
),
|
|
6859
6859
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
6860
|
-
const
|
|
6861
|
-
const client = getEnrichmentClient({ apiKey, apiHost, fetch:
|
|
6860
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6861
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6862
6862
|
const res = (await client.get())?.enrichments?.filter((enr) => enr.id === id);
|
|
6863
6863
|
if (res.length === 0) {
|
|
6864
6864
|
console.error("Enrichment did not exist");
|
|
@@ -6874,10 +6874,10 @@ var EnrichmentListModule = {
|
|
|
6874
6874
|
command: "list",
|
|
6875
6875
|
describe: "List enrichments",
|
|
6876
6876
|
aliases: ["ls"],
|
|
6877
|
-
builder: (
|
|
6877
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
6878
6878
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6879
|
-
const
|
|
6880
|
-
const client = getEnrichmentClient({ apiKey, apiHost, fetch:
|
|
6879
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6880
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
6881
6881
|
const res = await client.get();
|
|
6882
6882
|
emitWithFormat(res.enrichments, format, filename);
|
|
6883
6883
|
}
|
|
@@ -6969,12 +6969,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
6969
6969
|
var EnrichmentPullModule = {
|
|
6970
6970
|
command: "pull <directory>",
|
|
6971
6971
|
describe: "Pulls all enrichments to local files in a directory",
|
|
6972
|
-
builder: (
|
|
6972
|
+
builder: (yargs38) => withConfiguration(
|
|
6973
6973
|
withDebugOptions(
|
|
6974
6974
|
withApiOptions(
|
|
6975
6975
|
withProjectOptions(
|
|
6976
6976
|
withDiffOptions(
|
|
6977
|
-
|
|
6977
|
+
yargs38.positional("directory", {
|
|
6978
6978
|
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.",
|
|
6979
6979
|
type: "string"
|
|
6980
6980
|
}).option("format", {
|
|
@@ -7008,8 +7008,8 @@ var EnrichmentPullModule = {
|
|
|
7008
7008
|
allowEmptySource,
|
|
7009
7009
|
verbose
|
|
7010
7010
|
}) => {
|
|
7011
|
-
const
|
|
7012
|
-
const client = getEnrichmentClient({ apiKey, apiHost, fetch:
|
|
7011
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7012
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7013
7013
|
const source = createEnrichmentEngineDataSource({ client });
|
|
7014
7014
|
let target;
|
|
7015
7015
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -7049,11 +7049,11 @@ var EnrichmentPullModule = {
|
|
|
7049
7049
|
var EnrichmentPushModule = {
|
|
7050
7050
|
command: "push <directory>",
|
|
7051
7051
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
7052
|
-
builder: (
|
|
7052
|
+
builder: (yargs38) => withConfiguration(
|
|
7053
7053
|
withApiOptions(
|
|
7054
7054
|
withProjectOptions(
|
|
7055
7055
|
withDiffOptions(
|
|
7056
|
-
|
|
7056
|
+
yargs38.positional("directory", {
|
|
7057
7057
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
7058
7058
|
type: "string"
|
|
7059
7059
|
}).option("mode", {
|
|
@@ -7079,8 +7079,8 @@ var EnrichmentPushModule = {
|
|
|
7079
7079
|
allowEmptySource,
|
|
7080
7080
|
verbose
|
|
7081
7081
|
}) => {
|
|
7082
|
-
const
|
|
7083
|
-
const client = getEnrichmentClient({ apiKey, apiHost, fetch:
|
|
7082
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7083
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7084
7084
|
let source;
|
|
7085
7085
|
const isPackage = isPathAPackageFile(directory);
|
|
7086
7086
|
if (isPackage) {
|
|
@@ -7116,16 +7116,16 @@ var EnrichmentRemoveModule = {
|
|
|
7116
7116
|
command: "remove <id>",
|
|
7117
7117
|
aliases: ["delete", "rm"],
|
|
7118
7118
|
describe: "Delete an enrichment category and its values",
|
|
7119
|
-
builder: (
|
|
7119
|
+
builder: (yargs38) => withConfiguration(
|
|
7120
7120
|
withApiOptions(
|
|
7121
7121
|
withProjectOptions(
|
|
7122
|
-
|
|
7122
|
+
yargs38.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
7123
7123
|
)
|
|
7124
7124
|
)
|
|
7125
7125
|
),
|
|
7126
7126
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
7127
|
-
const
|
|
7128
|
-
const client = getEnrichmentClient({ apiKey, apiHost, fetch:
|
|
7127
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7128
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7129
7129
|
await client.removeCategory({ enrichmentId: id });
|
|
7130
7130
|
}
|
|
7131
7131
|
};
|
|
@@ -7135,7 +7135,7 @@ var EnrichmentModule = {
|
|
|
7135
7135
|
command: "enrichment <command>",
|
|
7136
7136
|
aliases: ["enr"],
|
|
7137
7137
|
describe: "Commands for Context enrichments",
|
|
7138
|
-
builder: (
|
|
7138
|
+
builder: (yargs38) => yargs38.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
7139
7139
|
handler: () => {
|
|
7140
7140
|
yargs20.help();
|
|
7141
7141
|
}
|
|
@@ -7153,10 +7153,10 @@ var ManifestGetModule = {
|
|
|
7153
7153
|
command: "get [output]",
|
|
7154
7154
|
aliases: ["dl", "download"],
|
|
7155
7155
|
describe: "Download the Uniform Context manifest for a project",
|
|
7156
|
-
builder: (
|
|
7156
|
+
builder: (yargs38) => withConfiguration(
|
|
7157
7157
|
withApiOptions(
|
|
7158
7158
|
withProjectOptions(
|
|
7159
|
-
|
|
7159
|
+
yargs38.option("preview", {
|
|
7160
7160
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
7161
7161
|
default: false,
|
|
7162
7162
|
type: "boolean",
|
|
@@ -7172,12 +7172,12 @@ var ManifestGetModule = {
|
|
|
7172
7172
|
)
|
|
7173
7173
|
),
|
|
7174
7174
|
handler: async ({ apiKey, apiHost, proxy, output, project, preview }) => {
|
|
7175
|
-
const
|
|
7175
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7176
7176
|
const client = new UncachedManifestClient({
|
|
7177
7177
|
apiHost,
|
|
7178
7178
|
projectId: project,
|
|
7179
7179
|
apiKey,
|
|
7180
|
-
fetch:
|
|
7180
|
+
fetch: fetch3
|
|
7181
7181
|
});
|
|
7182
7182
|
try {
|
|
7183
7183
|
const manifest = await client.get({ preview });
|
|
@@ -7218,15 +7218,15 @@ import { exit as exit2 } from "process";
|
|
|
7218
7218
|
var ManifestPublishModule = {
|
|
7219
7219
|
command: "publish",
|
|
7220
7220
|
describe: "Publish the Uniform Context manifest for a project",
|
|
7221
|
-
builder: (
|
|
7221
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withProjectOptions(yargs38))),
|
|
7222
7222
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
7223
|
-
const
|
|
7223
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7224
7224
|
try {
|
|
7225
7225
|
const client = new UncachedManifestClient2({
|
|
7226
7226
|
apiHost,
|
|
7227
7227
|
projectId: project,
|
|
7228
7228
|
apiKey,
|
|
7229
|
-
fetch:
|
|
7229
|
+
fetch: fetch3
|
|
7230
7230
|
});
|
|
7231
7231
|
await client.publish();
|
|
7232
7232
|
} catch (e) {
|
|
@@ -7251,7 +7251,7 @@ var ManifestModule = {
|
|
|
7251
7251
|
command: "manifest <command>",
|
|
7252
7252
|
describe: "Commands for context manifests",
|
|
7253
7253
|
aliases: ["man"],
|
|
7254
|
-
builder: (
|
|
7254
|
+
builder: (yargs38) => yargs38.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
7255
7255
|
handler: () => {
|
|
7256
7256
|
yargs21.help();
|
|
7257
7257
|
}
|
|
@@ -7265,18 +7265,18 @@ import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
|
7265
7265
|
var QuirkGetModule = {
|
|
7266
7266
|
command: "get <id>",
|
|
7267
7267
|
describe: "Fetch a quirk",
|
|
7268
|
-
builder: (
|
|
7268
|
+
builder: (yargs38) => withConfiguration(
|
|
7269
7269
|
withFormatOptions(
|
|
7270
7270
|
withApiOptions(
|
|
7271
7271
|
withProjectOptions(
|
|
7272
|
-
|
|
7272
|
+
yargs38.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
7273
7273
|
)
|
|
7274
7274
|
)
|
|
7275
7275
|
)
|
|
7276
7276
|
),
|
|
7277
7277
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
7278
|
-
const
|
|
7279
|
-
const client = new UncachedQuirkClient({ apiKey, apiHost, fetch:
|
|
7278
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7279
|
+
const client = new UncachedQuirkClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7280
7280
|
const res = await client.get({ quirkId: id, withIntegrations: true });
|
|
7281
7281
|
if (res.quirks.length === 0) {
|
|
7282
7282
|
console.error("Quirk did not exist");
|
|
@@ -7293,11 +7293,11 @@ var QuirkListModule = {
|
|
|
7293
7293
|
command: "list",
|
|
7294
7294
|
describe: "List quirks",
|
|
7295
7295
|
aliases: ["ls"],
|
|
7296
|
-
builder: (
|
|
7296
|
+
builder: (yargs38) => withConfiguration(
|
|
7297
7297
|
withFormatOptions(
|
|
7298
7298
|
withApiOptions(
|
|
7299
7299
|
withProjectOptions(
|
|
7300
|
-
|
|
7300
|
+
yargs38.option("withIntegrations", {
|
|
7301
7301
|
alias: ["i"],
|
|
7302
7302
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
7303
7303
|
type: "boolean"
|
|
@@ -7307,8 +7307,8 @@ var QuirkListModule = {
|
|
|
7307
7307
|
)
|
|
7308
7308
|
),
|
|
7309
7309
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, withIntegrations }) => {
|
|
7310
|
-
const
|
|
7311
|
-
const client = new UncachedQuirkClient2({ apiKey, apiHost, fetch:
|
|
7310
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7311
|
+
const client = new UncachedQuirkClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7312
7312
|
const res = await client.get({ withIntegrations });
|
|
7313
7313
|
emitWithFormat(res.quirks, format, filename);
|
|
7314
7314
|
}
|
|
@@ -7355,12 +7355,12 @@ function createQuirkEngineDataSource({
|
|
|
7355
7355
|
var QuirkPullModule = {
|
|
7356
7356
|
command: "pull <directory>",
|
|
7357
7357
|
describe: "Pulls all quirks to local files in a directory",
|
|
7358
|
-
builder: (
|
|
7358
|
+
builder: (yargs38) => withConfiguration(
|
|
7359
7359
|
withDebugOptions(
|
|
7360
7360
|
withApiOptions(
|
|
7361
7361
|
withProjectOptions(
|
|
7362
7362
|
withDiffOptions(
|
|
7363
|
-
|
|
7363
|
+
yargs38.positional("directory", {
|
|
7364
7364
|
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.",
|
|
7365
7365
|
type: "string"
|
|
7366
7366
|
}).option("format", {
|
|
@@ -7394,8 +7394,8 @@ var QuirkPullModule = {
|
|
|
7394
7394
|
allowEmptySource,
|
|
7395
7395
|
verbose
|
|
7396
7396
|
}) => {
|
|
7397
|
-
const
|
|
7398
|
-
const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch:
|
|
7397
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7398
|
+
const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7399
7399
|
const source = createQuirkEngineDataSource({ client });
|
|
7400
7400
|
let target;
|
|
7401
7401
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -7436,12 +7436,12 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
7436
7436
|
var QuirkPushModule = {
|
|
7437
7437
|
command: "push <directory>",
|
|
7438
7438
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
7439
|
-
builder: (
|
|
7439
|
+
builder: (yargs38) => withConfiguration(
|
|
7440
7440
|
withDebugOptions(
|
|
7441
7441
|
withApiOptions(
|
|
7442
7442
|
withProjectOptions(
|
|
7443
7443
|
withDiffOptions(
|
|
7444
|
-
|
|
7444
|
+
yargs38.positional("directory", {
|
|
7445
7445
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
7446
7446
|
type: "string"
|
|
7447
7447
|
}).option("mode", {
|
|
@@ -7468,8 +7468,8 @@ var QuirkPushModule = {
|
|
|
7468
7468
|
allowEmptySource,
|
|
7469
7469
|
verbose
|
|
7470
7470
|
}) => {
|
|
7471
|
-
const
|
|
7472
|
-
const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch:
|
|
7471
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7472
|
+
const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7473
7473
|
let source;
|
|
7474
7474
|
const isPackage = isPathAPackageFile(directory);
|
|
7475
7475
|
if (isPackage) {
|
|
@@ -7506,16 +7506,16 @@ var QuirkRemoveModule = {
|
|
|
7506
7506
|
command: "remove <id>",
|
|
7507
7507
|
aliases: ["delete", "rm"],
|
|
7508
7508
|
describe: "Delete a quirk",
|
|
7509
|
-
builder: (
|
|
7509
|
+
builder: (yargs38) => withConfiguration(
|
|
7510
7510
|
withApiOptions(
|
|
7511
7511
|
withProjectOptions(
|
|
7512
|
-
|
|
7512
|
+
yargs38.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
7513
7513
|
)
|
|
7514
7514
|
)
|
|
7515
7515
|
),
|
|
7516
7516
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
7517
|
-
const
|
|
7518
|
-
const client = new UncachedQuirkClient5({ apiKey, apiHost, fetch:
|
|
7517
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7518
|
+
const client = new UncachedQuirkClient5({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7519
7519
|
await client.remove({ quirkId: id });
|
|
7520
7520
|
}
|
|
7521
7521
|
};
|
|
@@ -7526,16 +7526,16 @@ var QuirkUpdateModule = {
|
|
|
7526
7526
|
command: "update <filename>",
|
|
7527
7527
|
aliases: ["put"],
|
|
7528
7528
|
describe: "Insert or update a quirk",
|
|
7529
|
-
builder: (
|
|
7529
|
+
builder: (yargs38) => withConfiguration(
|
|
7530
7530
|
withApiOptions(
|
|
7531
7531
|
withProjectOptions(
|
|
7532
|
-
|
|
7532
|
+
yargs38.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
7533
7533
|
)
|
|
7534
7534
|
)
|
|
7535
7535
|
),
|
|
7536
7536
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
7537
|
-
const
|
|
7538
|
-
const client = new UncachedQuirkClient6({ apiKey, apiHost, fetch:
|
|
7537
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7538
|
+
const client = new UncachedQuirkClient6({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7539
7539
|
const file = readFileToObject(filename);
|
|
7540
7540
|
await client.upsert({ quirk: file });
|
|
7541
7541
|
}
|
|
@@ -7546,7 +7546,7 @@ var QuirkModule = {
|
|
|
7546
7546
|
command: "quirk <command>",
|
|
7547
7547
|
aliases: ["qk"],
|
|
7548
7548
|
describe: "Commands for Context quirks",
|
|
7549
|
-
builder: (
|
|
7549
|
+
builder: (yargs38) => yargs38.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
7550
7550
|
handler: () => {
|
|
7551
7551
|
yargs22.help();
|
|
7552
7552
|
}
|
|
@@ -7560,18 +7560,18 @@ import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
|
7560
7560
|
var SignalGetModule = {
|
|
7561
7561
|
command: "get <id>",
|
|
7562
7562
|
describe: "Fetch a signal",
|
|
7563
|
-
builder: (
|
|
7563
|
+
builder: (yargs38) => withConfiguration(
|
|
7564
7564
|
withFormatOptions(
|
|
7565
7565
|
withApiOptions(
|
|
7566
7566
|
withProjectOptions(
|
|
7567
|
-
|
|
7567
|
+
yargs38.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
7568
7568
|
)
|
|
7569
7569
|
)
|
|
7570
7570
|
)
|
|
7571
7571
|
),
|
|
7572
7572
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
7573
|
-
const
|
|
7574
|
-
const client = new UncachedSignalClient({ apiKey, apiHost, fetch:
|
|
7573
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7574
|
+
const client = new UncachedSignalClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7575
7575
|
const res = await client.get({ signalId: id });
|
|
7576
7576
|
if (res.signals.length === 0) {
|
|
7577
7577
|
console.error("Signal did not exist");
|
|
@@ -7588,10 +7588,10 @@ var SignalListModule = {
|
|
|
7588
7588
|
command: "list",
|
|
7589
7589
|
describe: "List signals",
|
|
7590
7590
|
aliases: ["ls"],
|
|
7591
|
-
builder: (
|
|
7591
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
7592
7592
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7593
|
-
const
|
|
7594
|
-
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch:
|
|
7593
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7594
|
+
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7595
7595
|
const res = await client.get();
|
|
7596
7596
|
emitWithFormat(res.signals, format, filename);
|
|
7597
7597
|
}
|
|
@@ -7638,12 +7638,12 @@ function createSignalEngineDataSource({
|
|
|
7638
7638
|
var SignalPullModule = {
|
|
7639
7639
|
command: "pull <directory>",
|
|
7640
7640
|
describe: "Pulls all signals to local files in a directory",
|
|
7641
|
-
builder: (
|
|
7641
|
+
builder: (yargs38) => withConfiguration(
|
|
7642
7642
|
withDebugOptions(
|
|
7643
7643
|
withApiOptions(
|
|
7644
7644
|
withProjectOptions(
|
|
7645
7645
|
withDiffOptions(
|
|
7646
|
-
|
|
7646
|
+
yargs38.positional("directory", {
|
|
7647
7647
|
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.",
|
|
7648
7648
|
type: "string"
|
|
7649
7649
|
}).option("format", {
|
|
@@ -7677,8 +7677,8 @@ var SignalPullModule = {
|
|
|
7677
7677
|
allowEmptySource,
|
|
7678
7678
|
verbose
|
|
7679
7679
|
}) => {
|
|
7680
|
-
const
|
|
7681
|
-
const client = new UncachedSignalClient3({ apiKey, apiHost, fetch:
|
|
7680
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7681
|
+
const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7682
7682
|
const source = createSignalEngineDataSource({ client });
|
|
7683
7683
|
let target;
|
|
7684
7684
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -7719,12 +7719,12 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
7719
7719
|
var SignalPushModule = {
|
|
7720
7720
|
command: "push <directory>",
|
|
7721
7721
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
7722
|
-
builder: (
|
|
7722
|
+
builder: (yargs38) => withConfiguration(
|
|
7723
7723
|
withDebugOptions(
|
|
7724
7724
|
withApiOptions(
|
|
7725
7725
|
withProjectOptions(
|
|
7726
7726
|
withDiffOptions(
|
|
7727
|
-
|
|
7727
|
+
yargs38.positional("directory", {
|
|
7728
7728
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
7729
7729
|
type: "string"
|
|
7730
7730
|
}).option("mode", {
|
|
@@ -7751,8 +7751,8 @@ var SignalPushModule = {
|
|
|
7751
7751
|
allowEmptySource,
|
|
7752
7752
|
verbose
|
|
7753
7753
|
}) => {
|
|
7754
|
-
const
|
|
7755
|
-
const client = new UncachedSignalClient4({ apiKey, apiHost, fetch:
|
|
7754
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7755
|
+
const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7756
7756
|
let source;
|
|
7757
7757
|
const isPackage = isPathAPackageFile(directory);
|
|
7758
7758
|
if (isPackage) {
|
|
@@ -7789,16 +7789,16 @@ var SignalRemoveModule = {
|
|
|
7789
7789
|
command: "remove <id>",
|
|
7790
7790
|
aliases: ["delete", "rm"],
|
|
7791
7791
|
describe: "Delete a signal",
|
|
7792
|
-
builder: (
|
|
7792
|
+
builder: (yargs38) => withConfiguration(
|
|
7793
7793
|
withApiOptions(
|
|
7794
7794
|
withProjectOptions(
|
|
7795
|
-
|
|
7795
|
+
yargs38.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
7796
7796
|
)
|
|
7797
7797
|
)
|
|
7798
7798
|
),
|
|
7799
7799
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
7800
|
-
const
|
|
7801
|
-
const client = new UncachedSignalClient5({ apiKey, apiHost, fetch:
|
|
7800
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7801
|
+
const client = new UncachedSignalClient5({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7802
7802
|
await client.remove({ signalId: id });
|
|
7803
7803
|
}
|
|
7804
7804
|
};
|
|
@@ -7809,16 +7809,16 @@ var SignalUpdateModule = {
|
|
|
7809
7809
|
command: "update <filename>",
|
|
7810
7810
|
aliases: ["put"],
|
|
7811
7811
|
describe: "Insert or update a signal",
|
|
7812
|
-
builder: (
|
|
7812
|
+
builder: (yargs38) => withConfiguration(
|
|
7813
7813
|
withApiOptions(
|
|
7814
7814
|
withProjectOptions(
|
|
7815
|
-
|
|
7815
|
+
yargs38.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
7816
7816
|
)
|
|
7817
7817
|
)
|
|
7818
7818
|
),
|
|
7819
7819
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
7820
|
-
const
|
|
7821
|
-
const client = new UncachedSignalClient6({ apiKey, apiHost, fetch:
|
|
7820
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7821
|
+
const client = new UncachedSignalClient6({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7822
7822
|
const file = readFileToObject(filename);
|
|
7823
7823
|
await client.upsert({ signal: file });
|
|
7824
7824
|
}
|
|
@@ -7829,7 +7829,7 @@ var SignalModule = {
|
|
|
7829
7829
|
command: "signal <command>",
|
|
7830
7830
|
aliases: ["sig"],
|
|
7831
7831
|
describe: "Commands for Context signals",
|
|
7832
|
-
builder: (
|
|
7832
|
+
builder: (yargs38) => yargs38.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
7833
7833
|
handler: () => {
|
|
7834
7834
|
yargs23.help();
|
|
7835
7835
|
}
|
|
@@ -7843,18 +7843,18 @@ import { UncachedTestClient } from "@uniformdev/context/api";
|
|
|
7843
7843
|
var TestGetModule = {
|
|
7844
7844
|
command: "get <id>",
|
|
7845
7845
|
describe: "Fetch a test",
|
|
7846
|
-
builder: (
|
|
7846
|
+
builder: (yargs38) => withConfiguration(
|
|
7847
7847
|
withFormatOptions(
|
|
7848
7848
|
withApiOptions(
|
|
7849
7849
|
withProjectOptions(
|
|
7850
|
-
|
|
7850
|
+
yargs38.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
7851
7851
|
)
|
|
7852
7852
|
)
|
|
7853
7853
|
)
|
|
7854
7854
|
),
|
|
7855
7855
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
7856
|
-
const
|
|
7857
|
-
const client = new UncachedTestClient({ apiKey, apiHost, fetch:
|
|
7856
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7857
|
+
const client = new UncachedTestClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7858
7858
|
const res = await client.get({ testId: id });
|
|
7859
7859
|
if (res.tests.length === 0) {
|
|
7860
7860
|
console.error("Test did not exist");
|
|
@@ -7871,10 +7871,10 @@ var TestListModule = {
|
|
|
7871
7871
|
command: "list",
|
|
7872
7872
|
describe: "List tests",
|
|
7873
7873
|
aliases: ["ls"],
|
|
7874
|
-
builder: (
|
|
7874
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
7875
7875
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7876
|
-
const
|
|
7877
|
-
const client = new UncachedTestClient2({ apiKey, apiHost, fetch:
|
|
7876
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
7877
|
+
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7878
7878
|
const res = await client.get();
|
|
7879
7879
|
emitWithFormat(res.tests, format, filename);
|
|
7880
7880
|
}
|
|
@@ -7921,12 +7921,12 @@ function createTestEngineDataSource({
|
|
|
7921
7921
|
var TestPullModule = {
|
|
7922
7922
|
command: "pull <directory>",
|
|
7923
7923
|
describe: "Pulls all tests to local files in a directory",
|
|
7924
|
-
builder: (
|
|
7924
|
+
builder: (yargs38) => withConfiguration(
|
|
7925
7925
|
withDebugOptions(
|
|
7926
7926
|
withApiOptions(
|
|
7927
7927
|
withProjectOptions(
|
|
7928
7928
|
withDiffOptions(
|
|
7929
|
-
|
|
7929
|
+
yargs38.positional("directory", {
|
|
7930
7930
|
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.",
|
|
7931
7931
|
type: "string"
|
|
7932
7932
|
}).option("format", {
|
|
@@ -7960,8 +7960,8 @@ var TestPullModule = {
|
|
|
7960
7960
|
allowEmptySource,
|
|
7961
7961
|
verbose
|
|
7962
7962
|
}) => {
|
|
7963
|
-
const
|
|
7964
|
-
const client = new UncachedTestClient3({ apiKey, apiHost, fetch:
|
|
7963
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
7964
|
+
const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
7965
7965
|
const source = createTestEngineDataSource({ client });
|
|
7966
7966
|
let target;
|
|
7967
7967
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -8002,12 +8002,12 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
8002
8002
|
var TestPushModule = {
|
|
8003
8003
|
command: "push <directory>",
|
|
8004
8004
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
8005
|
-
builder: (
|
|
8005
|
+
builder: (yargs38) => withConfiguration(
|
|
8006
8006
|
withDebugOptions(
|
|
8007
8007
|
withApiOptions(
|
|
8008
8008
|
withProjectOptions(
|
|
8009
8009
|
withDiffOptions(
|
|
8010
|
-
|
|
8010
|
+
yargs38.positional("directory", {
|
|
8011
8011
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
8012
8012
|
type: "string"
|
|
8013
8013
|
}).option("mode", {
|
|
@@ -8034,8 +8034,8 @@ var TestPushModule = {
|
|
|
8034
8034
|
allowEmptySource,
|
|
8035
8035
|
verbose
|
|
8036
8036
|
}) => {
|
|
8037
|
-
const
|
|
8038
|
-
const client = new UncachedTestClient4({ apiKey, apiHost, fetch:
|
|
8037
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
8038
|
+
const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
8039
8039
|
let source;
|
|
8040
8040
|
const isPackage = isPathAPackageFile(directory);
|
|
8041
8041
|
if (isPackage) {
|
|
@@ -8072,16 +8072,16 @@ var TestRemoveModule = {
|
|
|
8072
8072
|
command: "remove <id>",
|
|
8073
8073
|
aliases: ["delete", "rm"],
|
|
8074
8074
|
describe: "Delete a test",
|
|
8075
|
-
builder: (
|
|
8075
|
+
builder: (yargs38) => withConfiguration(
|
|
8076
8076
|
withApiOptions(
|
|
8077
8077
|
withProjectOptions(
|
|
8078
|
-
|
|
8078
|
+
yargs38.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
8079
8079
|
)
|
|
8080
8080
|
)
|
|
8081
8081
|
),
|
|
8082
8082
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
8083
|
-
const
|
|
8084
|
-
const client = new UncachedTestClient5({ apiKey, apiHost, fetch:
|
|
8083
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8084
|
+
const client = new UncachedTestClient5({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
8085
8085
|
await client.remove({ testId: id });
|
|
8086
8086
|
}
|
|
8087
8087
|
};
|
|
@@ -8092,14 +8092,14 @@ var TestUpdateModule = {
|
|
|
8092
8092
|
command: "update <filename>",
|
|
8093
8093
|
aliases: ["put"],
|
|
8094
8094
|
describe: "Insert or update a test",
|
|
8095
|
-
builder: (
|
|
8095
|
+
builder: (yargs38) => withConfiguration(
|
|
8096
8096
|
withApiOptions(
|
|
8097
|
-
withProjectOptions(
|
|
8097
|
+
withProjectOptions(yargs38.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
8098
8098
|
)
|
|
8099
8099
|
),
|
|
8100
8100
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
8101
|
-
const
|
|
8102
|
-
const client = new UncachedTestClient6({ apiKey, apiHost, fetch:
|
|
8101
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8102
|
+
const client = new UncachedTestClient6({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
8103
8103
|
const file = readFileToObject(filename);
|
|
8104
8104
|
await client.upsert({ test: file });
|
|
8105
8105
|
}
|
|
@@ -8109,7 +8109,7 @@ var TestUpdateModule = {
|
|
|
8109
8109
|
var TestModule = {
|
|
8110
8110
|
command: "test <command>",
|
|
8111
8111
|
describe: "Commands for Context A/B tests",
|
|
8112
|
-
builder: (
|
|
8112
|
+
builder: (yargs38) => yargs38.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
8113
8113
|
handler: () => {
|
|
8114
8114
|
yargs24.help();
|
|
8115
8115
|
}
|
|
@@ -8120,7 +8120,7 @@ var ContextCommand = {
|
|
|
8120
8120
|
command: "context <command>",
|
|
8121
8121
|
aliases: ["ctx"],
|
|
8122
8122
|
describe: "Uniform Context commands",
|
|
8123
|
-
builder: (
|
|
8123
|
+
builder: (yargs38) => yargs38.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
8124
8124
|
handler: () => {
|
|
8125
8125
|
yargs25.showHelp();
|
|
8126
8126
|
}
|
|
@@ -8171,8 +8171,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
8171
8171
|
};
|
|
8172
8172
|
|
|
8173
8173
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
8174
|
-
function withEdgehancerIdOptions(
|
|
8175
|
-
return
|
|
8174
|
+
function withEdgehancerIdOptions(yargs38) {
|
|
8175
|
+
return yargs38.option("connectorType", {
|
|
8176
8176
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
8177
8177
|
demandOption: true,
|
|
8178
8178
|
type: "string"
|
|
@@ -8192,11 +8192,11 @@ function withEdgehancerIdOptions(yargs36) {
|
|
|
8192
8192
|
var IntegrationEdgehancerDeployModule = {
|
|
8193
8193
|
command: "deploy <filename>",
|
|
8194
8194
|
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.",
|
|
8195
|
-
builder: (
|
|
8195
|
+
builder: (yargs38) => withConfiguration(
|
|
8196
8196
|
withApiOptions(
|
|
8197
8197
|
withTeamOptions(
|
|
8198
8198
|
withEdgehancerIdOptions(
|
|
8199
|
-
|
|
8199
|
+
yargs38.positional("filename", {
|
|
8200
8200
|
demandOption: true,
|
|
8201
8201
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
8202
8202
|
})
|
|
@@ -8205,8 +8205,8 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
8205
8205
|
)
|
|
8206
8206
|
),
|
|
8207
8207
|
handler: async ({ apiHost, apiKey, proxy, filename, team: teamId, archetype, connectorType, hook }) => {
|
|
8208
|
-
const
|
|
8209
|
-
const client = new EdgehancerClient({ apiKey, apiHost, fetch:
|
|
8208
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8209
|
+
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch3, teamId });
|
|
8210
8210
|
const code = readFileSync(filename, "utf8");
|
|
8211
8211
|
await client.deploy({ archetype, code, connectorType, hook });
|
|
8212
8212
|
}
|
|
@@ -8216,10 +8216,10 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
8216
8216
|
var IntegrationEdgehancerRemoveModule = {
|
|
8217
8217
|
command: "remove",
|
|
8218
8218
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
8219
|
-
builder: (
|
|
8219
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs38)))),
|
|
8220
8220
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
8221
|
-
const
|
|
8222
|
-
const client = new EdgehancerClient({ apiKey, apiHost, fetch:
|
|
8221
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8222
|
+
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch3, teamId });
|
|
8223
8223
|
await client.remove({ archetype, connectorType, hook });
|
|
8224
8224
|
}
|
|
8225
8225
|
};
|
|
@@ -8228,7 +8228,7 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
8228
8228
|
var IntegrationEdgehancerModule = {
|
|
8229
8229
|
command: "edgehancer <command>",
|
|
8230
8230
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
8231
|
-
builder: (
|
|
8231
|
+
builder: (yargs38) => yargs38.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
8232
8232
|
handler: () => {
|
|
8233
8233
|
yargs26.help();
|
|
8234
8234
|
}
|
|
@@ -8270,10 +8270,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
8270
8270
|
var IntegrationDefinitionRegisterModule = {
|
|
8271
8271
|
command: "register <filename>",
|
|
8272
8272
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
8273
|
-
builder: (
|
|
8273
|
+
builder: (yargs38) => withConfiguration(
|
|
8274
8274
|
withApiOptions(
|
|
8275
8275
|
withTeamOptions(
|
|
8276
|
-
|
|
8276
|
+
yargs38.positional("filename", {
|
|
8277
8277
|
demandOption: true,
|
|
8278
8278
|
describe: "Integration definition manifest to register"
|
|
8279
8279
|
})
|
|
@@ -8281,8 +8281,8 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
8281
8281
|
)
|
|
8282
8282
|
),
|
|
8283
8283
|
handler: async ({ apiHost, apiKey, proxy, filename, team: teamId }) => {
|
|
8284
|
-
const
|
|
8285
|
-
const client = new DefinitionClient({ apiKey, apiHost, fetch:
|
|
8284
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8285
|
+
const client = new DefinitionClient({ apiKey, apiHost, fetch: fetch3, teamId });
|
|
8286
8286
|
const file = readFileToObject(filename);
|
|
8287
8287
|
await client.register(file);
|
|
8288
8288
|
}
|
|
@@ -8292,10 +8292,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
8292
8292
|
var IntegrationDefinitionRemoveModule = {
|
|
8293
8293
|
command: "remove <type>",
|
|
8294
8294
|
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.",
|
|
8295
|
-
builder: (
|
|
8295
|
+
builder: (yargs38) => withConfiguration(
|
|
8296
8296
|
withApiOptions(
|
|
8297
8297
|
withTeamOptions(
|
|
8298
|
-
|
|
8298
|
+
yargs38.positional("type", {
|
|
8299
8299
|
demandOption: true,
|
|
8300
8300
|
describe: "Integration type (from its manifest) to remove."
|
|
8301
8301
|
})
|
|
@@ -8303,8 +8303,8 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
8303
8303
|
)
|
|
8304
8304
|
),
|
|
8305
8305
|
handler: async ({ apiHost, apiKey, proxy, type, team: teamId }) => {
|
|
8306
|
-
const
|
|
8307
|
-
const client = new DefinitionClient({ apiKey, apiHost, fetch:
|
|
8306
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8307
|
+
const client = new DefinitionClient({ apiKey, apiHost, fetch: fetch3, teamId });
|
|
8308
8308
|
await client.remove(type);
|
|
8309
8309
|
}
|
|
8310
8310
|
};
|
|
@@ -8313,7 +8313,7 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
8313
8313
|
var IntegrationDefinitionModule = {
|
|
8314
8314
|
command: "definition <command>",
|
|
8315
8315
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
8316
|
-
builder: (
|
|
8316
|
+
builder: (yargs38) => yargs38.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).demandCommand(),
|
|
8317
8317
|
handler: () => {
|
|
8318
8318
|
yargs27.help();
|
|
8319
8319
|
}
|
|
@@ -8355,10 +8355,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
8355
8355
|
var IntegrationInstallModule = {
|
|
8356
8356
|
command: "install <type>",
|
|
8357
8357
|
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.",
|
|
8358
|
-
builder: (
|
|
8358
|
+
builder: (yargs38) => withConfiguration(
|
|
8359
8359
|
withApiOptions(
|
|
8360
8360
|
withProjectOptions(
|
|
8361
|
-
|
|
8361
|
+
yargs38.positional("type", {
|
|
8362
8362
|
demandOption: true,
|
|
8363
8363
|
describe: "Integration type to install (as defined in its manifest)"
|
|
8364
8364
|
}).option("configuration", {
|
|
@@ -8369,8 +8369,8 @@ var IntegrationInstallModule = {
|
|
|
8369
8369
|
)
|
|
8370
8370
|
),
|
|
8371
8371
|
handler: async ({ apiHost, apiKey, proxy, type, configuration, project: projectId }) => {
|
|
8372
|
-
const
|
|
8373
|
-
const client = new InstallClient({ apiKey, apiHost, fetch:
|
|
8372
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8373
|
+
const client = new InstallClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
8374
8374
|
const data = configuration ? JSON.parse(configuration) : void 0;
|
|
8375
8375
|
await client.install({ data, type });
|
|
8376
8376
|
}
|
|
@@ -8380,10 +8380,10 @@ var IntegrationInstallModule = {
|
|
|
8380
8380
|
var IntegrationUninstallModule = {
|
|
8381
8381
|
command: "uninstall <type>",
|
|
8382
8382
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
8383
|
-
builder: (
|
|
8383
|
+
builder: (yargs38) => withConfiguration(
|
|
8384
8384
|
withApiOptions(
|
|
8385
8385
|
withProjectOptions(
|
|
8386
|
-
|
|
8386
|
+
yargs38.positional("type", {
|
|
8387
8387
|
demandOption: true,
|
|
8388
8388
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
8389
8389
|
})
|
|
@@ -8391,8 +8391,8 @@ var IntegrationUninstallModule = {
|
|
|
8391
8391
|
)
|
|
8392
8392
|
),
|
|
8393
8393
|
handler: async ({ apiHost, apiKey, proxy, type, project: projectId }) => {
|
|
8394
|
-
const
|
|
8395
|
-
const client = new InstallClient({ apiKey, apiHost, fetch:
|
|
8394
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
8395
|
+
const client = new InstallClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
8396
8396
|
await client.remove(type);
|
|
8397
8397
|
}
|
|
8398
8398
|
};
|
|
@@ -8401,7 +8401,7 @@ var IntegrationUninstallModule = {
|
|
|
8401
8401
|
var IntegrationCommand = {
|
|
8402
8402
|
command: "integration <command>",
|
|
8403
8403
|
describe: "Integration management commands",
|
|
8404
|
-
builder: (
|
|
8404
|
+
builder: (yargs38) => yargs38.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
8405
8405
|
handler: () => {
|
|
8406
8406
|
yargs28.showHelp();
|
|
8407
8407
|
}
|
|
@@ -8431,7 +8431,7 @@ import { PostHog } from "posthog-node";
|
|
|
8431
8431
|
// package.json
|
|
8432
8432
|
var package_default = {
|
|
8433
8433
|
name: "@uniformdev/cli",
|
|
8434
|
-
version: "19.
|
|
8434
|
+
version: "19.213.0",
|
|
8435
8435
|
description: "Uniform command line interface tool",
|
|
8436
8436
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
8437
8437
|
main: "./cli.js",
|
|
@@ -9445,11 +9445,152 @@ var NewMeshCmd = {
|
|
|
9445
9445
|
}
|
|
9446
9446
|
};
|
|
9447
9447
|
|
|
9448
|
+
// src/commands/optimize/index.ts
|
|
9449
|
+
import yargs30 from "yargs";
|
|
9450
|
+
|
|
9451
|
+
// src/commands/optimize/manifest.ts
|
|
9452
|
+
import yargs29 from "yargs";
|
|
9453
|
+
|
|
9454
|
+
// src/commands/optimize/manifest/download.ts
|
|
9455
|
+
import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
|
|
9456
|
+
import { writeFile as writeFile2 } from "fs";
|
|
9457
|
+
import { exit as exit3 } from "process";
|
|
9458
|
+
import { fetch as fetch2 } from "undici";
|
|
9459
|
+
|
|
9460
|
+
// src/constants.ts
|
|
9461
|
+
var UniformBaseUrl = "https://uniform.app";
|
|
9462
|
+
|
|
9463
|
+
// src/commands/optimize/manifest/download.ts
|
|
9464
|
+
var module = {
|
|
9465
|
+
command: "download [output]",
|
|
9466
|
+
describe: "Download intent manifest",
|
|
9467
|
+
builder: (yargs38) => yargs38.option("apiKey", {
|
|
9468
|
+
alias: "k",
|
|
9469
|
+
demandOption: true,
|
|
9470
|
+
string: true,
|
|
9471
|
+
default: process.env.UNIFORM_API_KEY,
|
|
9472
|
+
describe: "Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."
|
|
9473
|
+
}).option("project", {
|
|
9474
|
+
describe: "Uniform project ID. Defaults to UOPT_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
9475
|
+
default: process.env.UOPT_CLI_PROJECT_ID ?? process.env.UNIFORM_PROJECT_ID,
|
|
9476
|
+
type: "string",
|
|
9477
|
+
alias: ["p"]
|
|
9478
|
+
}).option("preview", {
|
|
9479
|
+
describe: "If set, fetches the unpublished preview manifest (assuming your API key has permission)",
|
|
9480
|
+
default: false,
|
|
9481
|
+
type: "boolean",
|
|
9482
|
+
alias: ["d"]
|
|
9483
|
+
}).option("output", {
|
|
9484
|
+
string: true,
|
|
9485
|
+
alias: "o",
|
|
9486
|
+
default: process.env.UNIFORM_MANIFEST_PATH,
|
|
9487
|
+
describe: "Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."
|
|
9488
|
+
}),
|
|
9489
|
+
handler: async ({ apiKey, output, project, preview }) => {
|
|
9490
|
+
const isLegacyApiKey = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(
|
|
9491
|
+
apiKey
|
|
9492
|
+
);
|
|
9493
|
+
if (isLegacyApiKey) {
|
|
9494
|
+
console.error(
|
|
9495
|
+
yellow2(
|
|
9496
|
+
"WARNING: you appear to be using a deprecated type of API key. Keys like this will stop working soon; please create new keys on uniform.app."
|
|
9497
|
+
)
|
|
9498
|
+
);
|
|
9499
|
+
} else if (!project) {
|
|
9500
|
+
console.error(red5("You must specify the project ID"));
|
|
9501
|
+
exit3(1);
|
|
9502
|
+
}
|
|
9503
|
+
const baseUrl = resolveBaseUrl();
|
|
9504
|
+
const qs = new URLSearchParams();
|
|
9505
|
+
if (project) {
|
|
9506
|
+
qs.set("projectId", project);
|
|
9507
|
+
}
|
|
9508
|
+
if (preview) {
|
|
9509
|
+
qs.set("preview", "true");
|
|
9510
|
+
}
|
|
9511
|
+
const manifestUrl = `${baseUrl}api/v1/manifest?${qs.toString()}`;
|
|
9512
|
+
let fetchResponse = void 0;
|
|
9513
|
+
try {
|
|
9514
|
+
fetchResponse = await fetch2(manifestUrl, {
|
|
9515
|
+
headers: {
|
|
9516
|
+
"x-api-key": apiKey
|
|
9517
|
+
}
|
|
9518
|
+
});
|
|
9519
|
+
if (!fetchResponse.ok) {
|
|
9520
|
+
if (fetchResponse.status === 403) {
|
|
9521
|
+
throw `The API key ${apiKey} had no published data. This means it is either incorrectly entered, or intents have not been published since creating the API key.`;
|
|
9522
|
+
}
|
|
9523
|
+
throw `${fetchResponse.status} ${fetchResponse.statusText}, content ${await fetchResponse.text()}`;
|
|
9524
|
+
}
|
|
9525
|
+
} catch (e) {
|
|
9526
|
+
console.error(red5(`\u26A0 Error fetching intent manifest ${manifestUrl}`));
|
|
9527
|
+
console.error(gray4(` \u2757 ${e}`));
|
|
9528
|
+
exit3(1);
|
|
9529
|
+
}
|
|
9530
|
+
let json;
|
|
9531
|
+
try {
|
|
9532
|
+
json = await fetchResponse.json();
|
|
9533
|
+
} catch (e) {
|
|
9534
|
+
console.error(red5(`\u26A0 Error parsing intent manifest ${manifestUrl}`));
|
|
9535
|
+
console.error(gray4(` \u2757 ${e}`));
|
|
9536
|
+
console.error(`Response: ${await fetchResponse.text()}`);
|
|
9537
|
+
exit3(1);
|
|
9538
|
+
}
|
|
9539
|
+
const text = JSON.stringify(json, null, 2);
|
|
9540
|
+
if (output) {
|
|
9541
|
+
writeFile2(output, text, (error) => {
|
|
9542
|
+
if (error) {
|
|
9543
|
+
console.error(`Error writing file to ${output}
|
|
9544
|
+
`, error);
|
|
9545
|
+
exit3(1);
|
|
9546
|
+
}
|
|
9547
|
+
console.log(green3(`\u2705 ${output} has been updated from ${manifestUrl}`));
|
|
9548
|
+
});
|
|
9549
|
+
} else {
|
|
9550
|
+
console.log(text);
|
|
9551
|
+
}
|
|
9552
|
+
}
|
|
9553
|
+
};
|
|
9554
|
+
var resolveBaseUrl = () => {
|
|
9555
|
+
let baseUrl = process.env.UNIFORM_CLI_BASE_URL || UniformBaseUrl;
|
|
9556
|
+
if (!baseUrl.endsWith("/")) {
|
|
9557
|
+
baseUrl += "/";
|
|
9558
|
+
}
|
|
9559
|
+
return baseUrl;
|
|
9560
|
+
};
|
|
9561
|
+
var download_default = module;
|
|
9562
|
+
|
|
9563
|
+
// src/commands/optimize/manifest.ts
|
|
9564
|
+
var module2 = {
|
|
9565
|
+
command: "manifest <command>",
|
|
9566
|
+
describe: "Intent manifest commands",
|
|
9567
|
+
builder: () => {
|
|
9568
|
+
return yargs29.command(download_default);
|
|
9569
|
+
},
|
|
9570
|
+
handler: () => {
|
|
9571
|
+
yargs29.showHelp();
|
|
9572
|
+
}
|
|
9573
|
+
};
|
|
9574
|
+
var manifest_default = module2;
|
|
9575
|
+
|
|
9576
|
+
// src/commands/optimize/index.ts
|
|
9577
|
+
var OptimizeCommand = {
|
|
9578
|
+
command: "optimize <command>",
|
|
9579
|
+
aliases: ["opt"],
|
|
9580
|
+
describe: "Uniform Optimize commands",
|
|
9581
|
+
builder: () => {
|
|
9582
|
+
return yargs30.command(manifest_default);
|
|
9583
|
+
},
|
|
9584
|
+
handler: () => {
|
|
9585
|
+
yargs30.showHelp();
|
|
9586
|
+
}
|
|
9587
|
+
};
|
|
9588
|
+
|
|
9448
9589
|
// src/commands/project-map/index.ts
|
|
9449
|
-
import
|
|
9590
|
+
import yargs33 from "yargs";
|
|
9450
9591
|
|
|
9451
9592
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
9452
|
-
import
|
|
9593
|
+
import yargs31 from "yargs";
|
|
9453
9594
|
|
|
9454
9595
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
9455
9596
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
@@ -9463,18 +9604,18 @@ function getProjectMapClient(options) {
|
|
|
9463
9604
|
var ProjectMapDefinitionGetModule = {
|
|
9464
9605
|
command: "get <id>",
|
|
9465
9606
|
describe: "Fetch a project map",
|
|
9466
|
-
builder: (
|
|
9607
|
+
builder: (yargs38) => withFormatOptions(
|
|
9467
9608
|
withConfiguration(
|
|
9468
9609
|
withApiOptions(
|
|
9469
9610
|
withProjectOptions(
|
|
9470
|
-
|
|
9611
|
+
yargs38.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
9471
9612
|
)
|
|
9472
9613
|
)
|
|
9473
9614
|
)
|
|
9474
9615
|
),
|
|
9475
9616
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
9476
|
-
const
|
|
9477
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9617
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
9618
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9478
9619
|
const res = await client.getProjectMapDefinition({ projectMapId: id });
|
|
9479
9620
|
if (res.projectMaps.length === 0) {
|
|
9480
9621
|
console.error("ProjectMap does not exist");
|
|
@@ -9490,10 +9631,10 @@ var ProjectMapDefinitionListModule = {
|
|
|
9490
9631
|
command: "list",
|
|
9491
9632
|
describe: "List of project maps",
|
|
9492
9633
|
aliases: ["ls"],
|
|
9493
|
-
builder: (
|
|
9634
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
9494
9635
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9495
|
-
const
|
|
9496
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9636
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
9637
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9497
9638
|
const res = await client.getProjectMapDefinitions();
|
|
9498
9639
|
emitWithFormat(res.projectMaps, format, filename);
|
|
9499
9640
|
}
|
|
@@ -9544,12 +9685,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
9544
9685
|
var ProjectMapDefinitionPullModule = {
|
|
9545
9686
|
command: "pull <directory>",
|
|
9546
9687
|
describe: "Pulls all project maps to local files in a directory",
|
|
9547
|
-
builder: (
|
|
9688
|
+
builder: (yargs38) => withConfiguration(
|
|
9548
9689
|
withDebugOptions(
|
|
9549
9690
|
withApiOptions(
|
|
9550
9691
|
withProjectOptions(
|
|
9551
9692
|
withDiffOptions(
|
|
9552
|
-
|
|
9693
|
+
yargs38.positional("directory", {
|
|
9553
9694
|
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.",
|
|
9554
9695
|
type: "string"
|
|
9555
9696
|
}).option("format", {
|
|
@@ -9583,8 +9724,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
9583
9724
|
allowEmptySource,
|
|
9584
9725
|
verbose
|
|
9585
9726
|
}) => {
|
|
9586
|
-
const
|
|
9587
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9727
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
9728
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9588
9729
|
const source = createProjectMapDefinitionEngineDataSource({ client });
|
|
9589
9730
|
let target;
|
|
9590
9731
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -9624,12 +9765,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
9624
9765
|
var ProjectMapDefinitionPushModule = {
|
|
9625
9766
|
command: "push <directory>",
|
|
9626
9767
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
9627
|
-
builder: (
|
|
9768
|
+
builder: (yargs38) => withConfiguration(
|
|
9628
9769
|
withDebugOptions(
|
|
9629
9770
|
withApiOptions(
|
|
9630
9771
|
withProjectOptions(
|
|
9631
9772
|
withDiffOptions(
|
|
9632
|
-
|
|
9773
|
+
yargs38.positional("directory", {
|
|
9633
9774
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
9634
9775
|
type: "string"
|
|
9635
9776
|
}).option("mode", {
|
|
@@ -9656,8 +9797,8 @@ var ProjectMapDefinitionPushModule = {
|
|
|
9656
9797
|
allowEmptySource,
|
|
9657
9798
|
verbose
|
|
9658
9799
|
}) => {
|
|
9659
|
-
const
|
|
9660
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9800
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
9801
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9661
9802
|
let source;
|
|
9662
9803
|
const isPackage = isPathAPackageFile(directory);
|
|
9663
9804
|
if (isPackage) {
|
|
@@ -9693,14 +9834,14 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
9693
9834
|
command: "remove <id>",
|
|
9694
9835
|
aliases: ["delete", "rm"],
|
|
9695
9836
|
describe: "Delete a project map",
|
|
9696
|
-
builder: (
|
|
9837
|
+
builder: (yargs38) => withConfiguration(
|
|
9697
9838
|
withApiOptions(
|
|
9698
|
-
withProjectOptions(
|
|
9839
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
9699
9840
|
)
|
|
9700
9841
|
),
|
|
9701
9842
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
9702
|
-
const
|
|
9703
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9843
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
9844
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9704
9845
|
await client.deleteProjectMap({ projectMapId: id });
|
|
9705
9846
|
}
|
|
9706
9847
|
};
|
|
@@ -9710,16 +9851,16 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
9710
9851
|
command: "update <filename>",
|
|
9711
9852
|
aliases: ["put"],
|
|
9712
9853
|
describe: "Insert or update a project map",
|
|
9713
|
-
builder: (
|
|
9854
|
+
builder: (yargs38) => withConfiguration(
|
|
9714
9855
|
withApiOptions(
|
|
9715
9856
|
withProjectOptions(
|
|
9716
|
-
|
|
9857
|
+
yargs38.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
9717
9858
|
)
|
|
9718
9859
|
)
|
|
9719
9860
|
),
|
|
9720
9861
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
9721
|
-
const
|
|
9722
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9862
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
9863
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9723
9864
|
const file = readFileToObject(filename);
|
|
9724
9865
|
await client.upsertProjectMap({ projectMap: file });
|
|
9725
9866
|
}
|
|
@@ -9729,31 +9870,31 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
9729
9870
|
var ProjectMapDefinitionModule = {
|
|
9730
9871
|
command: "definition <command>",
|
|
9731
9872
|
describe: "Commands for ProjectMap Definitions",
|
|
9732
|
-
builder: (
|
|
9873
|
+
builder: (yargs38) => yargs38.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
9733
9874
|
handler: () => {
|
|
9734
|
-
|
|
9875
|
+
yargs31.help();
|
|
9735
9876
|
}
|
|
9736
9877
|
};
|
|
9737
9878
|
|
|
9738
9879
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
9739
|
-
import
|
|
9880
|
+
import yargs32 from "yargs";
|
|
9740
9881
|
|
|
9741
9882
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
9742
9883
|
var ProjectMapNodeGetModule = {
|
|
9743
9884
|
command: "get <id> <projectMapId>",
|
|
9744
9885
|
describe: "Fetch a project map node",
|
|
9745
|
-
builder: (
|
|
9886
|
+
builder: (yargs38) => withConfiguration(
|
|
9746
9887
|
withFormatOptions(
|
|
9747
9888
|
withApiOptions(
|
|
9748
9889
|
withProjectOptions(
|
|
9749
|
-
|
|
9890
|
+
yargs38.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
9750
9891
|
)
|
|
9751
9892
|
)
|
|
9752
9893
|
)
|
|
9753
9894
|
),
|
|
9754
9895
|
handler: async ({ apiHost, apiKey, proxy, id, projectMapId, format, project: projectId, filename }) => {
|
|
9755
|
-
const
|
|
9756
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9896
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
9897
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9757
9898
|
console.log("Debugging params for node get", { projectMapId, id, projectId });
|
|
9758
9899
|
const res = await client.getNodes({ projectMapId, id });
|
|
9759
9900
|
if (res.nodes?.length === 0) {
|
|
@@ -9770,12 +9911,12 @@ var ProjectMapNodeListModule = {
|
|
|
9770
9911
|
command: "list <projectMapId>",
|
|
9771
9912
|
describe: "List project map nodes",
|
|
9772
9913
|
aliases: ["ls"],
|
|
9773
|
-
builder: (
|
|
9914
|
+
builder: (yargs38) => withConfiguration(
|
|
9774
9915
|
withFormatOptions(
|
|
9775
9916
|
withApiOptions(
|
|
9776
9917
|
withProjectOptions(
|
|
9777
9918
|
withStateOptions(
|
|
9778
|
-
|
|
9919
|
+
yargs38.positional("projectMapId", {
|
|
9779
9920
|
demandOption: true,
|
|
9780
9921
|
describe: "ProjectMap UUID to fetch from"
|
|
9781
9922
|
})
|
|
@@ -9785,8 +9926,8 @@ var ProjectMapNodeListModule = {
|
|
|
9785
9926
|
)
|
|
9786
9927
|
),
|
|
9787
9928
|
handler: async ({ apiHost, apiKey, proxy, projectMapId, format, filename, project: projectId, state }) => {
|
|
9788
|
-
const
|
|
9789
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9929
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
9930
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9790
9931
|
const res = await client.getNodes({ projectMapId, state: convertStateOption(state) });
|
|
9791
9932
|
emitWithFormat({ nodes: res.nodes ?? [], projectMapId }, format, filename);
|
|
9792
9933
|
}
|
|
@@ -9853,12 +9994,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
9853
9994
|
var ProjectMapNodePullModule = {
|
|
9854
9995
|
command: "pull <directory>",
|
|
9855
9996
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
9856
|
-
builder: (
|
|
9997
|
+
builder: (yargs38) => withConfiguration(
|
|
9857
9998
|
withDebugOptions(
|
|
9858
9999
|
withApiOptions(
|
|
9859
10000
|
withProjectOptions(
|
|
9860
10001
|
withDiffOptions(
|
|
9861
|
-
|
|
10002
|
+
yargs38.positional("directory", {
|
|
9862
10003
|
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.",
|
|
9863
10004
|
type: "string"
|
|
9864
10005
|
}).option("format", {
|
|
@@ -9892,8 +10033,8 @@ var ProjectMapNodePullModule = {
|
|
|
9892
10033
|
allowEmptySource,
|
|
9893
10034
|
verbose
|
|
9894
10035
|
}) => {
|
|
9895
|
-
const
|
|
9896
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
10036
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
10037
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
9897
10038
|
const source = createProjectMapNodeEngineDataSource({ client, projectId });
|
|
9898
10039
|
let target;
|
|
9899
10040
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -9940,12 +10081,12 @@ import {
|
|
|
9940
10081
|
var ProjectMapNodePushModule = {
|
|
9941
10082
|
command: "push <directory>",
|
|
9942
10083
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
9943
|
-
builder: (
|
|
10084
|
+
builder: (yargs38) => withConfiguration(
|
|
9944
10085
|
withDebugOptions(
|
|
9945
10086
|
withApiOptions(
|
|
9946
10087
|
withProjectOptions(
|
|
9947
10088
|
withDiffOptions(
|
|
9948
|
-
|
|
10089
|
+
yargs38.positional("directory", {
|
|
9949
10090
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
9950
10091
|
type: "string"
|
|
9951
10092
|
}).option("mode", {
|
|
@@ -9972,11 +10113,11 @@ var ProjectMapNodePushModule = {
|
|
|
9972
10113
|
allowEmptySource,
|
|
9973
10114
|
verbose
|
|
9974
10115
|
}) => {
|
|
9975
|
-
const
|
|
10116
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
9976
10117
|
const client = getProjectMapClient({
|
|
9977
10118
|
apiKey,
|
|
9978
10119
|
apiHost,
|
|
9979
|
-
fetch:
|
|
10120
|
+
fetch: fetch3,
|
|
9980
10121
|
projectId
|
|
9981
10122
|
});
|
|
9982
10123
|
let source;
|
|
@@ -10047,16 +10188,16 @@ var ProjectMapNodeRemoveModule = {
|
|
|
10047
10188
|
command: "remove <id> <projectMapId>",
|
|
10048
10189
|
aliases: ["delete", "rm"],
|
|
10049
10190
|
describe: "Delete a project map node",
|
|
10050
|
-
builder: (
|
|
10191
|
+
builder: (yargs38) => withConfiguration(
|
|
10051
10192
|
withApiOptions(
|
|
10052
10193
|
withProjectOptions(
|
|
10053
|
-
|
|
10194
|
+
yargs38.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
10054
10195
|
)
|
|
10055
10196
|
)
|
|
10056
10197
|
),
|
|
10057
10198
|
handler: async ({ apiHost, apiKey, proxy, projectMapId, id, project: projectId }) => {
|
|
10058
|
-
const
|
|
10059
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
10199
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
10200
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10060
10201
|
await client.deleteProjectMapNode({ projectMapId, nodeId: id });
|
|
10061
10202
|
}
|
|
10062
10203
|
};
|
|
@@ -10066,16 +10207,16 @@ var ProjectMapNodeUpdateModule = {
|
|
|
10066
10207
|
command: "update <filename> <projectMapId>",
|
|
10067
10208
|
aliases: ["put"],
|
|
10068
10209
|
describe: "Insert or update a project map node",
|
|
10069
|
-
builder: (
|
|
10210
|
+
builder: (yargs38) => withConfiguration(
|
|
10070
10211
|
withApiOptions(
|
|
10071
10212
|
withProjectOptions(
|
|
10072
|
-
|
|
10213
|
+
yargs38.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
10073
10214
|
)
|
|
10074
10215
|
)
|
|
10075
10216
|
),
|
|
10076
10217
|
handler: async ({ apiHost, apiKey, proxy, projectMapId, filename, project: projectId }) => {
|
|
10077
|
-
const
|
|
10078
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
10218
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
10219
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10079
10220
|
const file = readFileToObject(filename);
|
|
10080
10221
|
await client.upsertProjectMapNodes({ nodes: [{ node: file }], projectMapId });
|
|
10081
10222
|
}
|
|
@@ -10085,9 +10226,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
10085
10226
|
var ProjectMapNodeModule = {
|
|
10086
10227
|
command: "node <command>",
|
|
10087
10228
|
describe: "Commands for ProjectMap Nodes",
|
|
10088
|
-
builder: (
|
|
10229
|
+
builder: (yargs38) => yargs38.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
10089
10230
|
handler: () => {
|
|
10090
|
-
|
|
10231
|
+
yargs32.help();
|
|
10091
10232
|
}
|
|
10092
10233
|
};
|
|
10093
10234
|
|
|
@@ -10096,17 +10237,17 @@ var ProjectMapCommand = {
|
|
|
10096
10237
|
command: "project-map <command>",
|
|
10097
10238
|
aliases: ["prm"],
|
|
10098
10239
|
describe: "Uniform ProjectMap commands",
|
|
10099
|
-
builder: (
|
|
10240
|
+
builder: (yargs38) => yargs38.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
10100
10241
|
handler: () => {
|
|
10101
|
-
|
|
10242
|
+
yargs33.showHelp();
|
|
10102
10243
|
}
|
|
10103
10244
|
};
|
|
10104
10245
|
|
|
10105
10246
|
// src/commands/redirect/index.ts
|
|
10106
|
-
import
|
|
10247
|
+
import yargs35 from "yargs";
|
|
10107
10248
|
|
|
10108
10249
|
// src/commands/redirect/commands/redirect.ts
|
|
10109
|
-
import
|
|
10250
|
+
import yargs34 from "yargs";
|
|
10110
10251
|
|
|
10111
10252
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
10112
10253
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
@@ -10131,18 +10272,18 @@ function getRedirectClient(options) {
|
|
|
10131
10272
|
var RedirectDefinitionGetModule = {
|
|
10132
10273
|
command: "get <id>",
|
|
10133
10274
|
describe: "Fetch a redirect",
|
|
10134
|
-
builder: (
|
|
10275
|
+
builder: (yargs38) => withConfiguration(
|
|
10135
10276
|
withFormatOptions(
|
|
10136
10277
|
withApiOptions(
|
|
10137
10278
|
withProjectOptions(
|
|
10138
|
-
|
|
10279
|
+
yargs38.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
10139
10280
|
)
|
|
10140
10281
|
)
|
|
10141
10282
|
)
|
|
10142
10283
|
),
|
|
10143
10284
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
10144
|
-
const
|
|
10145
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10285
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
10286
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10146
10287
|
const res = await client.getRedirect({ id });
|
|
10147
10288
|
if (!res) {
|
|
10148
10289
|
console.error("Redirect does not exist");
|
|
@@ -10158,10 +10299,10 @@ var RedirectDefinitionListModule = {
|
|
|
10158
10299
|
command: "list",
|
|
10159
10300
|
describe: "List of redirects",
|
|
10160
10301
|
aliases: ["ls"],
|
|
10161
|
-
builder: (
|
|
10302
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
10162
10303
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10163
|
-
const
|
|
10164
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10304
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
10305
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10165
10306
|
const res = await client.getRedirects({});
|
|
10166
10307
|
emitWithFormat(res, format, filename);
|
|
10167
10308
|
}
|
|
@@ -10210,12 +10351,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
10210
10351
|
var RedirectDefinitionPullModule = {
|
|
10211
10352
|
command: "pull <directory>",
|
|
10212
10353
|
describe: "Pulls all redirects to local files in a directory",
|
|
10213
|
-
builder: (
|
|
10354
|
+
builder: (yargs38) => withConfiguration(
|
|
10214
10355
|
withDebugOptions(
|
|
10215
10356
|
withApiOptions(
|
|
10216
10357
|
withProjectOptions(
|
|
10217
10358
|
withDiffOptions(
|
|
10218
|
-
|
|
10359
|
+
yargs38.positional("directory", {
|
|
10219
10360
|
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.",
|
|
10220
10361
|
type: "string"
|
|
10221
10362
|
}).option("format", {
|
|
@@ -10249,8 +10390,8 @@ var RedirectDefinitionPullModule = {
|
|
|
10249
10390
|
allowEmptySource,
|
|
10250
10391
|
verbose
|
|
10251
10392
|
}) => {
|
|
10252
|
-
const
|
|
10253
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10393
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
10394
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10254
10395
|
const source = createRedirectDefinitionEngineDataSource({ client });
|
|
10255
10396
|
let target;
|
|
10256
10397
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -10291,12 +10432,12 @@ var RedirectDefinitionPullModule = {
|
|
|
10291
10432
|
var RedirectDefinitionPushModule = {
|
|
10292
10433
|
command: "push <directory>",
|
|
10293
10434
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
10294
|
-
builder: (
|
|
10435
|
+
builder: (yargs38) => withConfiguration(
|
|
10295
10436
|
withDebugOptions(
|
|
10296
10437
|
withApiOptions(
|
|
10297
10438
|
withProjectOptions(
|
|
10298
10439
|
withDiffOptions(
|
|
10299
|
-
|
|
10440
|
+
yargs38.positional("directory", {
|
|
10300
10441
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
10301
10442
|
type: "string"
|
|
10302
10443
|
}).option("mode", {
|
|
@@ -10323,8 +10464,8 @@ var RedirectDefinitionPushModule = {
|
|
|
10323
10464
|
allowEmptySource,
|
|
10324
10465
|
verbose
|
|
10325
10466
|
}) => {
|
|
10326
|
-
const
|
|
10327
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10467
|
+
const fetch3 = nodeFetchProxy(proxy, verbose);
|
|
10468
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10328
10469
|
let source;
|
|
10329
10470
|
const isPackage = isPathAPackageFile(directory);
|
|
10330
10471
|
if (isPackage) {
|
|
@@ -10360,14 +10501,14 @@ var RedirectDefinitionRemoveModule = {
|
|
|
10360
10501
|
command: "remove <id>",
|
|
10361
10502
|
aliases: ["delete", "rm"],
|
|
10362
10503
|
describe: "Delete a redirect",
|
|
10363
|
-
builder: (
|
|
10504
|
+
builder: (yargs38) => withConfiguration(
|
|
10364
10505
|
withApiOptions(
|
|
10365
|
-
withProjectOptions(
|
|
10506
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
10366
10507
|
)
|
|
10367
10508
|
),
|
|
10368
10509
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
10369
|
-
const
|
|
10370
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10510
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
10511
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10371
10512
|
await client.deleteRedirect(id);
|
|
10372
10513
|
}
|
|
10373
10514
|
};
|
|
@@ -10377,16 +10518,16 @@ var RedirectDefinitionUpdateModule = {
|
|
|
10377
10518
|
command: "update <filename>",
|
|
10378
10519
|
aliases: ["put"],
|
|
10379
10520
|
describe: "Insert or update a redirect",
|
|
10380
|
-
builder: (
|
|
10521
|
+
builder: (yargs38) => withConfiguration(
|
|
10381
10522
|
withApiOptions(
|
|
10382
10523
|
withProjectOptions(
|
|
10383
|
-
|
|
10524
|
+
yargs38.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
10384
10525
|
)
|
|
10385
10526
|
)
|
|
10386
10527
|
),
|
|
10387
10528
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
10388
|
-
const
|
|
10389
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10529
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
10530
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
10390
10531
|
const file = readFileToObject(filename);
|
|
10391
10532
|
await client.upsertRedirect(file);
|
|
10392
10533
|
}
|
|
@@ -10396,9 +10537,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
10396
10537
|
var RedirectDefinitionModule = {
|
|
10397
10538
|
command: "definition <command>",
|
|
10398
10539
|
describe: "Commands for Redirect Definitions",
|
|
10399
|
-
builder: (
|
|
10540
|
+
builder: (yargs38) => yargs38.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
10400
10541
|
handler: () => {
|
|
10401
|
-
|
|
10542
|
+
yargs34.help();
|
|
10402
10543
|
}
|
|
10403
10544
|
};
|
|
10404
10545
|
|
|
@@ -10407,14 +10548,14 @@ var RedirectCommand = {
|
|
|
10407
10548
|
command: "redirect <command>",
|
|
10408
10549
|
aliases: ["red"],
|
|
10409
10550
|
describe: "Uniform Redirect commands",
|
|
10410
|
-
builder: (
|
|
10551
|
+
builder: (yargs38) => yargs38.command(RedirectDefinitionModule).demandCommand(),
|
|
10411
10552
|
handler: () => {
|
|
10412
|
-
|
|
10553
|
+
yargs35.showHelp();
|
|
10413
10554
|
}
|
|
10414
10555
|
};
|
|
10415
10556
|
|
|
10416
10557
|
// src/commands/sync/index.ts
|
|
10417
|
-
import
|
|
10558
|
+
import yargs36 from "yargs";
|
|
10418
10559
|
|
|
10419
10560
|
// src/commands/sync/commands/util.ts
|
|
10420
10561
|
import ora2 from "ora";
|
|
@@ -10530,7 +10671,7 @@ function numPad(num, spaces = 6) {
|
|
|
10530
10671
|
var SyncPullModule = {
|
|
10531
10672
|
command: "pull",
|
|
10532
10673
|
describe: "Pulls whole project to local files in a directory",
|
|
10533
|
-
builder: (
|
|
10674
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs38))))),
|
|
10534
10675
|
handler: async ({ serialization, ...otherParams }) => {
|
|
10535
10676
|
const config2 = serialization;
|
|
10536
10677
|
const enabledEntities = Object.entries({
|
|
@@ -10566,14 +10707,14 @@ var SyncPullModule = {
|
|
|
10566
10707
|
"No entity types were configured to be pulled. Please make sure you have configuration file (e.g. uniform.config.ts) and at least one entity type is enabled."
|
|
10567
10708
|
);
|
|
10568
10709
|
}
|
|
10569
|
-
for (const [entityType,
|
|
10710
|
+
for (const [entityType, module3] of enabledEntities) {
|
|
10570
10711
|
const entityConfigSupportsPullState = (entityConfig2) => {
|
|
10571
10712
|
return entityConfig2 !== void 0 && "state" in entityConfig2;
|
|
10572
10713
|
};
|
|
10573
10714
|
const entityConfig = config2.entitiesConfig?.[entityType];
|
|
10574
10715
|
try {
|
|
10575
10716
|
await spinPromise(
|
|
10576
|
-
|
|
10717
|
+
module3.handler({
|
|
10577
10718
|
...otherParams,
|
|
10578
10719
|
state: entityConfigSupportsPullState(entityConfig) ? entityConfig.state ?? 0 : 0,
|
|
10579
10720
|
format: getFormat(entityType, config2),
|
|
@@ -10628,7 +10769,7 @@ var getFormat = (entityType, config2) => {
|
|
|
10628
10769
|
var SyncPushModule = {
|
|
10629
10770
|
command: "push",
|
|
10630
10771
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
10631
|
-
builder: (
|
|
10772
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs38))))),
|
|
10632
10773
|
handler: async ({ serialization, ...otherParams }) => {
|
|
10633
10774
|
const config2 = serialization;
|
|
10634
10775
|
const enabledEntities = Object.entries({
|
|
@@ -10664,10 +10805,10 @@ var SyncPushModule = {
|
|
|
10664
10805
|
"No entities were configured to be pushed. Please make sure you have configuration file and at least one entity type is enabled."
|
|
10665
10806
|
);
|
|
10666
10807
|
}
|
|
10667
|
-
for (const [entityType,
|
|
10808
|
+
for (const [entityType, module3] of enabledEntities) {
|
|
10668
10809
|
try {
|
|
10669
10810
|
await spinPromise(
|
|
10670
|
-
|
|
10811
|
+
module3.handler({
|
|
10671
10812
|
...otherParams,
|
|
10672
10813
|
state: 0,
|
|
10673
10814
|
format: getFormat2(entityType, config2),
|
|
@@ -10820,14 +10961,14 @@ var getFormat2 = (entityType, config2) => {
|
|
|
10820
10961
|
var SyncCommand = {
|
|
10821
10962
|
command: "sync <command>",
|
|
10822
10963
|
describe: "Uniform Sync commands",
|
|
10823
|
-
builder: (
|
|
10964
|
+
builder: (yargs38) => yargs38.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
10824
10965
|
handler: () => {
|
|
10825
|
-
|
|
10966
|
+
yargs36.showHelp();
|
|
10826
10967
|
}
|
|
10827
10968
|
};
|
|
10828
10969
|
|
|
10829
10970
|
// src/middleware/checkForUpdateMiddleware.ts
|
|
10830
|
-
import { bold, gray as
|
|
10971
|
+
import { bold, gray as gray5, green as green4 } from "colorette";
|
|
10831
10972
|
|
|
10832
10973
|
// src/updateCheck.ts
|
|
10833
10974
|
import { existsSync as existsSync4, promises as fs5 } from "fs";
|
|
@@ -10995,7 +11136,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
10995
11136
|
}
|
|
10996
11137
|
const update = await updateCheck_default(package_default, { verbose });
|
|
10997
11138
|
if (update) {
|
|
10998
|
-
logCallout(`${bold("Update Available:")} ${
|
|
11139
|
+
logCallout(`${bold("Update Available:")} ${gray5(package_default.version)} \u226B ${green4(update.latest)}`);
|
|
10999
11140
|
}
|
|
11000
11141
|
} catch (e) {
|
|
11001
11142
|
console.error(`There was an error checking for updates`, e);
|
|
@@ -11003,7 +11144,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
11003
11144
|
};
|
|
11004
11145
|
|
|
11005
11146
|
// src/middleware/checkLocalDepsVersionsMiddleware.ts
|
|
11006
|
-
import { magenta, red as
|
|
11147
|
+
import { magenta, red as red6 } from "colorette";
|
|
11007
11148
|
import { join as join4 } from "path";
|
|
11008
11149
|
|
|
11009
11150
|
// src/fs.ts
|
|
@@ -11059,7 +11200,7 @@ First found was: v${firstVersion}`;
|
|
|
11059
11200
|
}
|
|
11060
11201
|
if (version !== firstVersion) {
|
|
11061
11202
|
isOutside = true;
|
|
11062
|
-
warning +=
|
|
11203
|
+
warning += red6(`
|
|
11063
11204
|
${p}: ${version}`);
|
|
11064
11205
|
}
|
|
11065
11206
|
}
|
|
@@ -11074,10 +11215,10 @@ First found was: v${firstVersion}`;
|
|
|
11074
11215
|
|
|
11075
11216
|
// src/index.ts
|
|
11076
11217
|
dotenv.config();
|
|
11077
|
-
var yarggery =
|
|
11218
|
+
var yarggery = yargs37(hideBin(process.argv));
|
|
11078
11219
|
var defaultConfig2 = loadConfig(null);
|
|
11079
11220
|
yarggery.option("verbose", {
|
|
11080
11221
|
describe: "Include verbose logging",
|
|
11081
11222
|
default: false,
|
|
11082
11223
|
type: "boolean"
|
|
11083
|
-
}).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(IntegrationCommand).recommendCommands().demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).parse();
|
|
11224
|
+
}).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(OptimizeCommand).command(IntegrationCommand).recommendCommands().demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).parse();
|