@uniformdev/cli 19.213.1-alpha.0 → 19.213.1-alpha.14
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 +626 -767
- package/package.json +9 -9
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 yargs35 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: (yargs36) => withConfiguration(
|
|
584
584
|
withDebugOptions(
|
|
585
585
|
withFormatOptions(
|
|
586
586
|
withApiOptions(
|
|
587
587
|
withProjectOptions(
|
|
588
|
-
|
|
588
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
596
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs36))))),
|
|
610
610
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
611
|
-
const
|
|
612
|
-
const client = getAssetClient({ apiKey, apiHost, fetch:
|
|
611
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
612
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, 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(yargs36, defaultState = "preview") {
|
|
969
|
+
return yargs36.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: (yargs36) => withConfiguration(
|
|
1052
1052
|
withApiOptions(
|
|
1053
1053
|
withDebugOptions(
|
|
1054
1054
|
withProjectOptions(
|
|
1055
1055
|
withDiffOptions(
|
|
1056
|
-
|
|
1056
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1091
1091
|
const client = getAssetClient({
|
|
1092
1092
|
apiKey,
|
|
1093
1093
|
apiHost,
|
|
1094
|
-
fetch:
|
|
1094
|
+
fetch: fetch2,
|
|
1095
1095
|
projectId
|
|
1096
1096
|
});
|
|
1097
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
1097
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1171
1171
|
withApiOptions(
|
|
1172
1172
|
withDebugOptions(
|
|
1173
1173
|
withProjectOptions(
|
|
1174
1174
|
withDiffOptions(
|
|
1175
|
-
|
|
1175
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1203
1203
|
const client = getAssetClient({
|
|
1204
1204
|
apiKey,
|
|
1205
1205
|
apiHost,
|
|
1206
|
-
fetch:
|
|
1206
|
+
fetch: fetch2,
|
|
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: fetch2, 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: (yargs36) => withConfiguration(
|
|
1300
1300
|
withDebugOptions(
|
|
1301
1301
|
withApiOptions(
|
|
1302
|
-
withProjectOptions(
|
|
1302
|
+
withProjectOptions(yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1308
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1324
1324
|
withDebugOptions(
|
|
1325
1325
|
withApiOptions(
|
|
1326
1326
|
withProjectOptions(
|
|
1327
|
-
|
|
1327
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1334
|
+
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
1375
1375
|
withFormatOptions(
|
|
1376
1376
|
withDebugOptions(
|
|
1377
1377
|
withApiOptions(
|
|
1378
1378
|
withProjectOptions(
|
|
1379
|
-
|
|
1379
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1387
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1405
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1409
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1450
1450
|
withApiOptions(
|
|
1451
1451
|
withProjectOptions(
|
|
1452
1452
|
withDiffOptions(
|
|
1453
1453
|
withDebugOptions(
|
|
1454
|
-
|
|
1454
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1489
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1530
1530
|
withApiOptions(
|
|
1531
1531
|
withDebugOptions(
|
|
1532
1532
|
withProjectOptions(
|
|
1533
1533
|
withDiffOptions(
|
|
1534
|
-
|
|
1534
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1562
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1599
1599
|
withApiOptions(
|
|
1600
1600
|
withDebugOptions(
|
|
1601
1601
|
withProjectOptions(
|
|
1602
|
-
|
|
1602
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1609
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1624
1624
|
withApiOptions(
|
|
1625
1625
|
withDebugOptions(
|
|
1626
1626
|
withProjectOptions(
|
|
1627
|
-
|
|
1627
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1634
|
+
const client = getCategoryClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
1672
1672
|
withFormatOptions(
|
|
1673
1673
|
withDebugOptions(
|
|
1674
1674
|
withApiOptions(
|
|
1675
1675
|
withProjectOptions(
|
|
1676
|
-
|
|
1676
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1687
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1711
1711
|
withFormatOptions(
|
|
1712
1712
|
withDebugOptions(
|
|
1713
1713
|
withApiOptions(
|
|
1714
1714
|
withProjectOptions(
|
|
1715
|
-
|
|
1715
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1736
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1780
1780
|
withApiOptions(
|
|
1781
1781
|
withDebugOptions(
|
|
1782
1782
|
withProjectOptions(
|
|
1783
1783
|
withDiffOptions(
|
|
1784
|
-
|
|
1784
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1819
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1861
1861
|
withApiOptions(
|
|
1862
1862
|
withDebugOptions(
|
|
1863
1863
|
withProjectOptions(
|
|
1864
1864
|
withDiffOptions(
|
|
1865
|
-
|
|
1865
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1893
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1931
1931
|
withDebugOptions(
|
|
1932
1932
|
withApiOptions(
|
|
1933
1933
|
withProjectOptions(
|
|
1934
|
-
|
|
1934
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1944
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
1959
1959
|
withApiOptions(
|
|
1960
1960
|
withDebugOptions(
|
|
1961
1961
|
withProjectOptions(
|
|
1962
|
-
|
|
1962
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
1969
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withFormatOptions(
|
|
1998
1998
|
withConfiguration(
|
|
1999
1999
|
withApiOptions(
|
|
2000
2000
|
withProjectOptions(
|
|
2001
2001
|
withStateOptions(
|
|
2002
2002
|
withDebugOptions(
|
|
2003
|
-
|
|
2003
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2076
|
+
const client = getCanvasClient({ apiKey, edgeApiHost, apiHost, fetch: fetch2, 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: (yargs36) => withFormatOptions(
|
|
2094
2094
|
withConfiguration(
|
|
2095
2095
|
withApiOptions(
|
|
2096
2096
|
withProjectOptions(
|
|
2097
2097
|
withDebugOptions(
|
|
2098
2098
|
withStateOptions(
|
|
2099
|
-
|
|
2099
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2170
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withFormatOptions(
|
|
2181
2181
|
withConfiguration(
|
|
2182
2182
|
withApiOptions(
|
|
2183
2183
|
withDebugOptions(
|
|
2184
2184
|
withProjectOptions(
|
|
2185
2185
|
withStateOptions(
|
|
2186
|
-
|
|
2186
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
2310
2310
|
withApiOptions(
|
|
2311
2311
|
withProjectOptions(
|
|
2312
2312
|
withDebugOptions(
|
|
2313
2313
|
withDiffOptions(
|
|
2314
|
-
|
|
2314
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2356
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
2392
2392
|
withApiOptions(
|
|
2393
2393
|
withDebugOptions(
|
|
2394
2394
|
withProjectOptions(
|
|
2395
2395
|
withDiffOptions(
|
|
2396
|
-
|
|
2396
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
2435
2435
|
withApiOptions(
|
|
2436
2436
|
withProjectOptions(
|
|
2437
2437
|
withStateOptions(
|
|
2438
2438
|
withDebugOptions(
|
|
2439
2439
|
withDiffOptions(
|
|
2440
|
-
|
|
2440
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2489
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
2490
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
2550
2550
|
withApiOptions(
|
|
2551
2551
|
withProjectOptions(
|
|
2552
2552
|
withDebugOptions(
|
|
2553
2553
|
withStateOptions(
|
|
2554
2554
|
withDiffOptions(
|
|
2555
|
-
|
|
2555
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
2599
2599
|
withApiOptions(
|
|
2600
2600
|
withProjectOptions(
|
|
2601
2601
|
withStateOptions(
|
|
2602
2602
|
withDebugOptions(
|
|
2603
2603
|
withDiffOptions(
|
|
2604
|
-
|
|
2604
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2646
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: fetch2, 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: (yargs36) => withConfiguration(
|
|
2702
2702
|
withApiOptions(
|
|
2703
2703
|
withProjectOptions(
|
|
2704
2704
|
withStateOptions(
|
|
2705
2705
|
withDiffOptions(
|
|
2706
2706
|
withDebugOptions(
|
|
2707
|
-
|
|
2707
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
2741
2741
|
withApiOptions(
|
|
2742
2742
|
withDebugOptions(
|
|
2743
2743
|
withProjectOptions(
|
|
2744
|
-
|
|
2744
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2757
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
2779
2779
|
withApiOptions(
|
|
2780
2780
|
withDebugOptions(
|
|
2781
2781
|
withProjectOptions(
|
|
2782
|
-
|
|
2782
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2824
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
2880
2880
|
withApiOptions(
|
|
2881
2881
|
withDebugOptions(
|
|
2882
2882
|
withProjectOptions(
|
|
2883
|
-
|
|
2883
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
2918
2918
|
withApiOptions(
|
|
2919
2919
|
withProjectOptions(
|
|
2920
2920
|
withDebugOptions(
|
|
2921
2921
|
withStateOptions(
|
|
2922
|
-
|
|
2922
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2936
|
+
const client = getCanvasClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => yargs36.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: (yargs36) => withFormatOptions(
|
|
2992
2992
|
withConfiguration(
|
|
2993
2993
|
withApiOptions(
|
|
2994
2994
|
withDebugOptions(
|
|
2995
2995
|
withProjectOptions(
|
|
2996
2996
|
withStateOptions(
|
|
2997
|
-
|
|
2997
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
3042
3042
|
withApiOptions(
|
|
3043
3043
|
withDebugOptions(
|
|
3044
3044
|
withProjectOptions(
|
|
3045
3045
|
withDiffOptions(
|
|
3046
|
-
|
|
3046
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
3086
3086
|
withApiOptions(
|
|
3087
3087
|
withDebugOptions(
|
|
3088
3088
|
withProjectOptions(
|
|
3089
3089
|
withStateOptions(
|
|
3090
3090
|
withDiffOptions(
|
|
3091
|
-
|
|
3091
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
3130
3130
|
withApiOptions(
|
|
3131
3131
|
withDebugOptions(
|
|
3132
3132
|
withProjectOptions(
|
|
3133
3133
|
withStateOptions(
|
|
3134
3134
|
withDiffOptions(
|
|
3135
|
-
|
|
3135
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
3174
3174
|
withApiOptions(
|
|
3175
3175
|
withDebugOptions(
|
|
3176
3176
|
withProjectOptions(
|
|
3177
|
-
|
|
3177
|
+
yargs36.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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
3235
3235
|
withDebugOptions(
|
|
3236
3236
|
withFormatOptions(
|
|
3237
3237
|
withApiOptions(
|
|
3238
3238
|
withProjectOptions(
|
|
3239
|
-
|
|
3239
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3250
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs36))))),
|
|
3265
3265
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3266
|
-
const
|
|
3267
|
-
const client = getContentClient({ apiKey, apiHost, fetch:
|
|
3266
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3267
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
3306
3306
|
withApiOptions(
|
|
3307
3307
|
withDebugOptions(
|
|
3308
3308
|
withProjectOptions(
|
|
3309
3309
|
withDiffOptions(
|
|
3310
|
-
|
|
3310
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3345
3345
|
const client = getContentClient({
|
|
3346
3346
|
apiKey,
|
|
3347
3347
|
apiHost,
|
|
3348
|
-
fetch:
|
|
3348
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
3391
3391
|
withApiOptions(
|
|
3392
3392
|
withDebugOptions(
|
|
3393
3393
|
withProjectOptions(
|
|
3394
3394
|
withDiffOptions(
|
|
3395
|
-
|
|
3395
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3428
3428
|
const client = getContentClient({
|
|
3429
3429
|
apiKey,
|
|
3430
3430
|
apiHost,
|
|
3431
|
-
fetch:
|
|
3431
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
3470
3470
|
withDebugOptions(
|
|
3471
3471
|
withApiOptions(
|
|
3472
3472
|
withProjectOptions(
|
|
3473
|
-
|
|
3473
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3480
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
3495
3495
|
withDebugOptions(
|
|
3496
3496
|
withApiOptions(
|
|
3497
3497
|
withProjectOptions(
|
|
3498
|
-
|
|
3498
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3505
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
3540
3540
|
withApiOptions(
|
|
3541
3541
|
withDebugOptions(
|
|
3542
3542
|
withProjectOptions(
|
|
3543
|
-
|
|
3543
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3550
|
+
const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
3562
3562
|
withDebugOptions(
|
|
3563
3563
|
withApiOptions(
|
|
3564
3564
|
withProjectOptions(
|
|
3565
|
-
|
|
3565
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3572
|
+
const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
3587
3587
|
withApiOptions(
|
|
3588
3588
|
withDebugOptions(
|
|
3589
3589
|
withProjectOptions(
|
|
3590
|
-
|
|
3590
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3610
|
+
const client = getDataSourceClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
3648
3648
|
withFormatOptions(
|
|
3649
3649
|
withDebugOptions(
|
|
3650
3650
|
withApiOptions(
|
|
3651
3651
|
withProjectOptions(
|
|
3652
|
-
|
|
3652
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3660
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs36))))),
|
|
3676
3676
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3677
|
-
const
|
|
3678
|
-
const client = getDataTypeClient({ apiKey, apiHost, fetch:
|
|
3677
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3678
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
3719
3719
|
withApiOptions(
|
|
3720
3720
|
withDebugOptions(
|
|
3721
3721
|
withProjectOptions(
|
|
3722
3722
|
withDiffOptions(
|
|
3723
|
-
|
|
3723
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3758
3758
|
const client = getDataTypeClient({
|
|
3759
3759
|
apiKey,
|
|
3760
3760
|
apiHost,
|
|
3761
|
-
fetch:
|
|
3761
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
3804
3804
|
withApiOptions(
|
|
3805
3805
|
withDebugOptions(
|
|
3806
3806
|
withProjectOptions(
|
|
3807
3807
|
withDiffOptions(
|
|
3808
|
-
|
|
3808
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3836
3836
|
const client = getDataTypeClient({
|
|
3837
3837
|
apiKey,
|
|
3838
3838
|
apiHost,
|
|
3839
|
-
fetch:
|
|
3839
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
3878
3878
|
withDebugOptions(
|
|
3879
3879
|
withApiOptions(
|
|
3880
3880
|
withProjectOptions(
|
|
3881
|
-
|
|
3881
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
3888
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
3903
3903
|
withDebugOptions(
|
|
3904
3904
|
withApiOptions(
|
|
3905
3905
|
withProjectOptions(
|
|
3906
|
-
|
|
3906
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3913
|
+
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
3942
3942
|
withDebugOptions(
|
|
3943
3943
|
withFormatOptions(
|
|
3944
3944
|
withApiOptions(
|
|
3945
3945
|
withProjectOptions(
|
|
3946
3946
|
withStateOptions(
|
|
3947
|
-
|
|
3947
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3988
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4013
4013
|
withDebugOptions(
|
|
4014
4014
|
withFormatOptions(
|
|
4015
4015
|
withApiOptions(
|
|
4016
4016
|
withProjectOptions(
|
|
4017
4017
|
withStateOptions(
|
|
4018
|
-
|
|
4018
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4050
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4147
4147
|
withDiffOptions(
|
|
4148
4148
|
withApiOptions(
|
|
4149
4149
|
withProjectOptions(
|
|
4150
4150
|
withDiffOptions(
|
|
4151
|
-
|
|
4151
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4172
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4201
4201
|
withDebugOptions(
|
|
4202
4202
|
withApiOptions(
|
|
4203
4203
|
withProjectOptions(
|
|
4204
4204
|
withStateOptions(
|
|
4205
4205
|
withDiffOptions(
|
|
4206
|
-
|
|
4206
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4243
4243
|
const client = getContentClient({
|
|
4244
4244
|
apiKey,
|
|
4245
4245
|
apiHost,
|
|
4246
|
-
fetch:
|
|
4246
|
+
fetch: fetch2,
|
|
4247
4247
|
projectId
|
|
4248
4248
|
});
|
|
4249
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
4249
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4302
4302
|
withDebugOptions(
|
|
4303
4303
|
withApiOptions(
|
|
4304
4304
|
withProjectOptions(
|
|
4305
4305
|
withStateOptions(
|
|
4306
4306
|
withDiffOptions(
|
|
4307
|
-
|
|
4307
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4337
4337
|
const client = getContentClient({
|
|
4338
4338
|
apiKey,
|
|
4339
4339
|
apiHost,
|
|
4340
|
-
fetch:
|
|
4340
|
+
fetch: fetch2,
|
|
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: fetch2, 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: (yargs36) => withConfiguration(
|
|
4391
4391
|
withDebugOptions(
|
|
4392
4392
|
withApiOptions(
|
|
4393
4393
|
withProjectOptions(
|
|
4394
|
-
|
|
4394
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4401
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4417
4417
|
withDebugOptions(
|
|
4418
4418
|
withApiOptions(
|
|
4419
4419
|
withProjectOptions(
|
|
4420
|
-
|
|
4420
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4441
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4491
4491
|
withDebugOptions(
|
|
4492
4492
|
withApiOptions(
|
|
4493
4493
|
withProjectOptions(
|
|
4494
4494
|
withStateOptions(
|
|
4495
|
-
|
|
4495
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4513
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
4541
4541
|
withDebugOptions(
|
|
4542
4542
|
withFormatOptions(
|
|
4543
4543
|
withApiOptions(
|
|
4544
4544
|
withProjectOptions(
|
|
4545
4545
|
withStateOptions(
|
|
4546
|
-
|
|
4546
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4559
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4582
4582
|
withDebugOptions(
|
|
4583
|
-
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(
|
|
4583
|
+
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(yargs36, "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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4598
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4617
4617
|
withDebugOptions(
|
|
4618
4618
|
withApiOptions(
|
|
4619
4619
|
withProjectOptions(
|
|
4620
4620
|
withDiffOptions(
|
|
4621
|
-
|
|
4621
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4642
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4671
4671
|
withApiOptions(
|
|
4672
4672
|
withDebugOptions(
|
|
4673
4673
|
withProjectOptions(
|
|
4674
4674
|
withStateOptions(
|
|
4675
4675
|
withDiffOptions(
|
|
4676
|
-
|
|
4676
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4713
4713
|
const client = getContentClient({
|
|
4714
4714
|
apiKey,
|
|
4715
4715
|
apiHost,
|
|
4716
|
-
fetch:
|
|
4716
|
+
fetch: fetch2,
|
|
4717
4717
|
projectId
|
|
4718
4718
|
});
|
|
4719
|
-
const fileClient = getFileClient({ apiKey, apiHost, fetch:
|
|
4719
|
+
const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4772
4772
|
withDebugOptions(
|
|
4773
4773
|
withApiOptions(
|
|
4774
4774
|
withProjectOptions(
|
|
4775
4775
|
withStateOptions(
|
|
4776
4776
|
withDiffOptions(
|
|
4777
|
-
|
|
4777
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4812
4812
|
const client = getContentClient({
|
|
4813
4813
|
apiKey,
|
|
4814
4814
|
apiHost,
|
|
4815
|
-
fetch:
|
|
4815
|
+
fetch: fetch2,
|
|
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: fetch2, 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: (yargs36) => withConfiguration(
|
|
4866
4866
|
withDebugOptions(
|
|
4867
4867
|
withApiOptions(
|
|
4868
4868
|
withProjectOptions(
|
|
4869
|
-
|
|
4869
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4876
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4892
4892
|
withDebugOptions(
|
|
4893
4893
|
withApiOptions(
|
|
4894
4894
|
withProjectOptions(
|
|
4895
|
-
|
|
4895
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4916
|
+
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
4966
4966
|
withDebugOptions(
|
|
4967
4967
|
withApiOptions(
|
|
4968
4968
|
withProjectOptions(
|
|
4969
4969
|
withStateOptions(
|
|
4970
|
-
|
|
4970
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
4988
|
+
const client = getContentClient({ apiKey, apiHost, edgeApiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
5056
5056
|
withDebugOptions(
|
|
5057
5057
|
withApiOptions(
|
|
5058
5058
|
withProjectOptions(
|
|
5059
5059
|
withDiffOptions(
|
|
5060
|
-
|
|
5060
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5095
5095
|
const client = getLocaleClient({
|
|
5096
5096
|
apiKey,
|
|
5097
5097
|
apiHost,
|
|
5098
|
-
fetch:
|
|
5098
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
5141
5141
|
withDebugOptions(
|
|
5142
5142
|
withApiOptions(
|
|
5143
5143
|
withProjectOptions(
|
|
5144
5144
|
withDiffOptions(
|
|
5145
|
-
|
|
5145
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5173
5173
|
const client = getLocaleClient({
|
|
5174
5174
|
apiKey,
|
|
5175
5175
|
apiHost,
|
|
5176
|
-
fetch:
|
|
5176
|
+
fetch: fetch2,
|
|
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: (yargs36) => yargs36.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: (yargs36) => withFormatOptions(
|
|
5233
5233
|
withConfiguration(
|
|
5234
5234
|
withApiOptions(
|
|
5235
5235
|
withDebugOptions(
|
|
5236
5236
|
withProjectOptions(
|
|
5237
5237
|
withStateOptions(
|
|
5238
|
-
|
|
5238
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
5278
5278
|
withDebugOptions(
|
|
5279
5279
|
withApiOptions(
|
|
5280
5280
|
withProjectOptions(
|
|
5281
5281
|
withDiffOptions(
|
|
5282
|
-
|
|
5282
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
5317
5317
|
withDebugOptions(
|
|
5318
5318
|
withApiOptions(
|
|
5319
5319
|
withProjectOptions(
|
|
5320
5320
|
withStateOptions(
|
|
5321
5321
|
withDiffOptions(
|
|
5322
|
-
|
|
5322
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
5357
5357
|
withDebugOptions(
|
|
5358
5358
|
withApiOptions(
|
|
5359
5359
|
withProjectOptions(
|
|
5360
5360
|
withStateOptions(
|
|
5361
5361
|
withDiffOptions(
|
|
5362
|
-
|
|
5362
|
+
yargs36.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: (yargs36) => withConfiguration(
|
|
5401
5401
|
withDebugOptions(
|
|
5402
5402
|
withApiOptions(
|
|
5403
5403
|
withProjectOptions(
|
|
5404
|
-
|
|
5404
|
+
yargs36.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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
5462
5462
|
withFormatOptions(
|
|
5463
5463
|
withDebugOptions(
|
|
5464
5464
|
withApiOptions(
|
|
5465
5465
|
withProjectOptions(
|
|
5466
|
-
|
|
5466
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5474
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5491
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5495
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5534
5534
|
withApiOptions(
|
|
5535
5535
|
withProjectOptions(
|
|
5536
5536
|
withDebugOptions(
|
|
5537
5537
|
withDiffOptions(
|
|
5538
|
-
|
|
5538
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5573
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5614
5614
|
withApiOptions(
|
|
5615
5615
|
withProjectOptions(
|
|
5616
5616
|
withDiffOptions(
|
|
5617
5617
|
withDebugOptions(
|
|
5618
|
-
|
|
5618
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5646
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5683
5683
|
withApiOptions(
|
|
5684
5684
|
withDebugOptions(
|
|
5685
5685
|
withProjectOptions(
|
|
5686
|
-
|
|
5686
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5693
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5708
5708
|
withDebugOptions(
|
|
5709
5709
|
withApiOptions(
|
|
5710
5710
|
withProjectOptions(
|
|
5711
|
-
|
|
5711
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5718
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
5747
5747
|
withFormatOptions(
|
|
5748
5748
|
withDebugOptions(
|
|
5749
5749
|
withApiOptions(
|
|
5750
5750
|
withProjectOptions(
|
|
5751
|
-
|
|
5751
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5759
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5776
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5780
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5823
5823
|
withApiOptions(
|
|
5824
5824
|
withProjectOptions(
|
|
5825
5825
|
withDebugOptions(
|
|
5826
5826
|
withDiffOptions(
|
|
5827
|
-
|
|
5827
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5862
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5903
5903
|
withApiOptions(
|
|
5904
5904
|
withProjectOptions(
|
|
5905
5905
|
withDiffOptions(
|
|
5906
5906
|
withDebugOptions(
|
|
5907
|
-
|
|
5907
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5935
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5972
5972
|
withApiOptions(
|
|
5973
5973
|
withDebugOptions(
|
|
5974
5974
|
withProjectOptions(
|
|
5975
|
-
|
|
5975
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5982
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
5997
5997
|
withDebugOptions(
|
|
5998
5998
|
withApiOptions(
|
|
5999
5999
|
withProjectOptions(
|
|
6000
|
-
|
|
6000
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6007
|
+
const client = getPreviewClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
6042
6042
|
withDebugOptions(
|
|
6043
6043
|
withFormatOptions(
|
|
6044
6044
|
withApiOptions(
|
|
6045
6045
|
withProjectOptions(
|
|
6046
|
-
|
|
6046
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6054
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs36))))),
|
|
6068
6068
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
6069
|
-
const
|
|
6070
|
-
const client = getPromptClient({ apiKey, apiHost, fetch:
|
|
6069
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6070
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6109
6109
|
withDebugOptions(
|
|
6110
6110
|
withApiOptions(
|
|
6111
6111
|
withProjectOptions(
|
|
6112
6112
|
withStateOptions(
|
|
6113
6113
|
withDiffOptions(
|
|
6114
|
-
|
|
6114
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6150
6150
|
const client = getPromptClient({
|
|
6151
6151
|
apiKey,
|
|
6152
6152
|
apiHost,
|
|
6153
|
-
fetch:
|
|
6153
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
6196
6196
|
withApiOptions(
|
|
6197
6197
|
withProjectOptions(
|
|
6198
6198
|
withStateOptions(
|
|
6199
6199
|
withDiffOptions(
|
|
6200
|
-
|
|
6200
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6228
6228
|
const client = getPromptClient({
|
|
6229
6229
|
apiKey,
|
|
6230
6230
|
apiHost,
|
|
6231
|
-
fetch:
|
|
6231
|
+
fetch: fetch2,
|
|
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: (yargs36) => withConfiguration(
|
|
6270
6270
|
withDebugOptions(
|
|
6271
6271
|
withApiOptions(
|
|
6272
|
-
withProjectOptions(
|
|
6272
|
+
withProjectOptions(yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6278
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6293
6293
|
withDebugOptions(
|
|
6294
6294
|
withApiOptions(
|
|
6295
6295
|
withProjectOptions(
|
|
6296
|
-
|
|
6296
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6303
|
+
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
6369
6369
|
withApiOptions(
|
|
6370
6370
|
withDebugOptions(
|
|
6371
6371
|
withProjectOptions(
|
|
6372
6372
|
withDiffOptions(
|
|
6373
|
-
|
|
6373
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6408
|
+
const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6449
6449
|
withDebugOptions(
|
|
6450
6450
|
withApiOptions(
|
|
6451
6451
|
withProjectOptions(
|
|
6452
6452
|
withDiffOptions(
|
|
6453
|
-
|
|
6453
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6481
|
+
const client = getWorkflowClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => yargs36.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(PatternModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LocaleModule).command(WorkflowModule).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: (yargs36) => withConfiguration(
|
|
6551
6551
|
withFormatOptions(
|
|
6552
6552
|
withApiOptions(
|
|
6553
6553
|
withProjectOptions(
|
|
6554
|
-
|
|
6554
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
6561
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
6578
6578
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6579
|
-
const
|
|
6580
|
-
const client = getAggregateClient({ apiKey, apiHost, fetch:
|
|
6579
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
6580
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6641
6641
|
withApiOptions(
|
|
6642
6642
|
withDebugOptions(
|
|
6643
6643
|
withProjectOptions(
|
|
6644
6644
|
withDiffOptions(
|
|
6645
|
-
|
|
6645
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6680
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6721
6721
|
withApiOptions(
|
|
6722
6722
|
withProjectOptions(
|
|
6723
6723
|
withDiffOptions(
|
|
6724
6724
|
withDebugOptions(
|
|
6725
|
-
|
|
6725
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6753
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6791
6791
|
withApiOptions(
|
|
6792
6792
|
withProjectOptions(
|
|
6793
|
-
|
|
6793
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
6799
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6810
6810
|
withApiOptions(
|
|
6811
6811
|
withProjectOptions(
|
|
6812
|
-
|
|
6812
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
6818
|
+
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withFormatOptions(
|
|
6851
6851
|
withConfiguration(
|
|
6852
6852
|
withApiOptions(
|
|
6853
6853
|
withProjectOptions(
|
|
6854
|
-
|
|
6854
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
6861
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
6878
6878
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6879
|
-
const
|
|
6880
|
-
const client = getEnrichmentClient({ apiKey, apiHost, fetch:
|
|
6879
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
6880
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
6973
6973
|
withDebugOptions(
|
|
6974
6974
|
withApiOptions(
|
|
6975
6975
|
withProjectOptions(
|
|
6976
6976
|
withDiffOptions(
|
|
6977
|
-
|
|
6977
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7012
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7053
7053
|
withApiOptions(
|
|
7054
7054
|
withProjectOptions(
|
|
7055
7055
|
withDiffOptions(
|
|
7056
|
-
|
|
7056
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7083
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7120
7120
|
withApiOptions(
|
|
7121
7121
|
withProjectOptions(
|
|
7122
|
-
|
|
7122
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7128
|
+
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
7157
7157
|
withApiOptions(
|
|
7158
7158
|
withProjectOptions(
|
|
7159
|
-
|
|
7159
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7176
7176
|
const client = new UncachedManifestClient({
|
|
7177
7177
|
apiHost,
|
|
7178
7178
|
projectId: project,
|
|
7179
7179
|
apiKey,
|
|
7180
|
-
fetch:
|
|
7180
|
+
fetch: fetch2
|
|
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: (yargs36) => withConfiguration(withApiOptions(withProjectOptions(yargs36))),
|
|
7222
7222
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
7223
|
-
const
|
|
7223
|
+
const fetch2 = 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: fetch2
|
|
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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
7269
7269
|
withFormatOptions(
|
|
7270
7270
|
withApiOptions(
|
|
7271
7271
|
withProjectOptions(
|
|
7272
|
-
|
|
7272
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7279
|
+
const client = new UncachedQuirkClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7297
7297
|
withFormatOptions(
|
|
7298
7298
|
withApiOptions(
|
|
7299
7299
|
withProjectOptions(
|
|
7300
|
-
|
|
7300
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7311
|
+
const client = new UncachedQuirkClient2({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7359
7359
|
withDebugOptions(
|
|
7360
7360
|
withApiOptions(
|
|
7361
7361
|
withProjectOptions(
|
|
7362
7362
|
withDiffOptions(
|
|
7363
|
-
|
|
7363
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7398
|
+
const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7440
7440
|
withDebugOptions(
|
|
7441
7441
|
withApiOptions(
|
|
7442
7442
|
withProjectOptions(
|
|
7443
7443
|
withDiffOptions(
|
|
7444
|
-
|
|
7444
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7472
|
+
const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7510
7510
|
withApiOptions(
|
|
7511
7511
|
withProjectOptions(
|
|
7512
|
-
|
|
7512
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7518
|
+
const client = new UncachedQuirkClient5({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7530
7530
|
withApiOptions(
|
|
7531
7531
|
withProjectOptions(
|
|
7532
|
-
|
|
7532
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7538
|
+
const client = new UncachedQuirkClient6({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
7564
7564
|
withFormatOptions(
|
|
7565
7565
|
withApiOptions(
|
|
7566
7566
|
withProjectOptions(
|
|
7567
|
-
|
|
7567
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7574
|
+
const client = new UncachedSignalClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
7592
7592
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7593
|
-
const
|
|
7594
|
-
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch:
|
|
7593
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
7594
|
+
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7642
7642
|
withDebugOptions(
|
|
7643
7643
|
withApiOptions(
|
|
7644
7644
|
withProjectOptions(
|
|
7645
7645
|
withDiffOptions(
|
|
7646
|
-
|
|
7646
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7681
|
+
const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7723
7723
|
withDebugOptions(
|
|
7724
7724
|
withApiOptions(
|
|
7725
7725
|
withProjectOptions(
|
|
7726
7726
|
withDiffOptions(
|
|
7727
|
-
|
|
7727
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7755
|
+
const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7793
7793
|
withApiOptions(
|
|
7794
7794
|
withProjectOptions(
|
|
7795
|
-
|
|
7795
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7801
|
+
const client = new UncachedSignalClient5({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7813
7813
|
withApiOptions(
|
|
7814
7814
|
withProjectOptions(
|
|
7815
|
-
|
|
7815
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7821
|
+
const client = new UncachedSignalClient6({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
7847
7847
|
withFormatOptions(
|
|
7848
7848
|
withApiOptions(
|
|
7849
7849
|
withProjectOptions(
|
|
7850
|
-
|
|
7850
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
7857
|
+
const client = new UncachedTestClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
7875
7875
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7876
|
-
const
|
|
7877
|
-
const client = new UncachedTestClient2({ apiKey, apiHost, fetch:
|
|
7876
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
7877
|
+
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
7925
7925
|
withDebugOptions(
|
|
7926
7926
|
withApiOptions(
|
|
7927
7927
|
withProjectOptions(
|
|
7928
7928
|
withDiffOptions(
|
|
7929
|
-
|
|
7929
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7964
|
+
const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
8006
8006
|
withDebugOptions(
|
|
8007
8007
|
withApiOptions(
|
|
8008
8008
|
withProjectOptions(
|
|
8009
8009
|
withDiffOptions(
|
|
8010
|
-
|
|
8010
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy, verbose);
|
|
8038
|
+
const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
8076
8076
|
withApiOptions(
|
|
8077
8077
|
withProjectOptions(
|
|
8078
|
-
|
|
8078
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8084
|
+
const client = new UncachedTestClient5({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
8096
8096
|
withApiOptions(
|
|
8097
|
-
withProjectOptions(
|
|
8097
|
+
withProjectOptions(yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8102
|
+
const client = new UncachedTestClient6({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => yargs36.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(yargs36) {
|
|
8175
|
+
return yargs36.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(yargs38) {
|
|
|
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: (yargs36) => withConfiguration(
|
|
8196
8196
|
withApiOptions(
|
|
8197
8197
|
withTeamOptions(
|
|
8198
8198
|
withEdgehancerIdOptions(
|
|
8199
|
-
|
|
8199
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8209
|
+
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs36)))),
|
|
8220
8220
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
8221
|
-
const
|
|
8222
|
-
const client = new EdgehancerClient({ apiKey, apiHost, fetch:
|
|
8221
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
8222
|
+
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
8274
8274
|
withApiOptions(
|
|
8275
8275
|
withTeamOptions(
|
|
8276
|
-
|
|
8276
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8285
|
+
const client = new DefinitionClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
8296
8296
|
withApiOptions(
|
|
8297
8297
|
withTeamOptions(
|
|
8298
|
-
|
|
8298
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8307
|
+
const client = new DefinitionClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.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: (yargs36) => withConfiguration(
|
|
8359
8359
|
withApiOptions(
|
|
8360
8360
|
withProjectOptions(
|
|
8361
|
-
|
|
8361
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8373
|
+
const client = new InstallClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => withConfiguration(
|
|
8384
8384
|
withApiOptions(
|
|
8385
8385
|
withProjectOptions(
|
|
8386
|
-
|
|
8386
|
+
yargs36.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 fetch2 = nodeFetchProxy(proxy);
|
|
8395
|
+
const client = new InstallClient({ apiKey, apiHost, fetch: fetch2, 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: (yargs36) => yargs36.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
8405
8405
|
handler: () => {
|
|
8406
8406
|
yargs28.showHelp();
|
|
8407
8407
|
}
|
|
@@ -8484,7 +8484,7 @@ var package_default = {
|
|
|
8484
8484
|
open: "10.1.0",
|
|
8485
8485
|
ora: "8.0.1",
|
|
8486
8486
|
"p-queue": "7.3.4",
|
|
8487
|
-
"posthog-node": "4.0
|
|
8487
|
+
"posthog-node": "4.4.0",
|
|
8488
8488
|
"registry-auth-token": "^5.0.0",
|
|
8489
8489
|
"registry-url": "^6.0.0",
|
|
8490
8490
|
slugify: "1.6.6",
|
|
@@ -9445,152 +9445,11 @@ 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
|
-
|
|
9589
9448
|
// src/commands/project-map/index.ts
|
|
9590
|
-
import
|
|
9449
|
+
import yargs31 from "yargs";
|
|
9591
9450
|
|
|
9592
9451
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
9593
|
-
import
|
|
9452
|
+
import yargs29 from "yargs";
|
|
9594
9453
|
|
|
9595
9454
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
9596
9455
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
@@ -9604,18 +9463,18 @@ function getProjectMapClient(options) {
|
|
|
9604
9463
|
var ProjectMapDefinitionGetModule = {
|
|
9605
9464
|
command: "get <id>",
|
|
9606
9465
|
describe: "Fetch a project map",
|
|
9607
|
-
builder: (
|
|
9466
|
+
builder: (yargs36) => withFormatOptions(
|
|
9608
9467
|
withConfiguration(
|
|
9609
9468
|
withApiOptions(
|
|
9610
9469
|
withProjectOptions(
|
|
9611
|
-
|
|
9470
|
+
yargs36.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
9612
9471
|
)
|
|
9613
9472
|
)
|
|
9614
9473
|
)
|
|
9615
9474
|
),
|
|
9616
9475
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
9617
|
-
const
|
|
9618
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9476
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
9477
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9619
9478
|
const res = await client.getProjectMapDefinition({ projectMapId: id });
|
|
9620
9479
|
if (res.projectMaps.length === 0) {
|
|
9621
9480
|
console.error("ProjectMap does not exist");
|
|
@@ -9631,10 +9490,10 @@ var ProjectMapDefinitionListModule = {
|
|
|
9631
9490
|
command: "list",
|
|
9632
9491
|
describe: "List of project maps",
|
|
9633
9492
|
aliases: ["ls"],
|
|
9634
|
-
builder: (
|
|
9493
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
9635
9494
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9636
|
-
const
|
|
9637
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9495
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
9496
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9638
9497
|
const res = await client.getProjectMapDefinitions();
|
|
9639
9498
|
emitWithFormat(res.projectMaps, format, filename);
|
|
9640
9499
|
}
|
|
@@ -9685,12 +9544,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
9685
9544
|
var ProjectMapDefinitionPullModule = {
|
|
9686
9545
|
command: "pull <directory>",
|
|
9687
9546
|
describe: "Pulls all project maps to local files in a directory",
|
|
9688
|
-
builder: (
|
|
9547
|
+
builder: (yargs36) => withConfiguration(
|
|
9689
9548
|
withDebugOptions(
|
|
9690
9549
|
withApiOptions(
|
|
9691
9550
|
withProjectOptions(
|
|
9692
9551
|
withDiffOptions(
|
|
9693
|
-
|
|
9552
|
+
yargs36.positional("directory", {
|
|
9694
9553
|
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.",
|
|
9695
9554
|
type: "string"
|
|
9696
9555
|
}).option("format", {
|
|
@@ -9724,8 +9583,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
9724
9583
|
allowEmptySource,
|
|
9725
9584
|
verbose
|
|
9726
9585
|
}) => {
|
|
9727
|
-
const
|
|
9728
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9586
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
9587
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9729
9588
|
const source = createProjectMapDefinitionEngineDataSource({ client });
|
|
9730
9589
|
let target;
|
|
9731
9590
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -9765,12 +9624,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
9765
9624
|
var ProjectMapDefinitionPushModule = {
|
|
9766
9625
|
command: "push <directory>",
|
|
9767
9626
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
9768
|
-
builder: (
|
|
9627
|
+
builder: (yargs36) => withConfiguration(
|
|
9769
9628
|
withDebugOptions(
|
|
9770
9629
|
withApiOptions(
|
|
9771
9630
|
withProjectOptions(
|
|
9772
9631
|
withDiffOptions(
|
|
9773
|
-
|
|
9632
|
+
yargs36.positional("directory", {
|
|
9774
9633
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
9775
9634
|
type: "string"
|
|
9776
9635
|
}).option("mode", {
|
|
@@ -9797,8 +9656,8 @@ var ProjectMapDefinitionPushModule = {
|
|
|
9797
9656
|
allowEmptySource,
|
|
9798
9657
|
verbose
|
|
9799
9658
|
}) => {
|
|
9800
|
-
const
|
|
9801
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9659
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
9660
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9802
9661
|
let source;
|
|
9803
9662
|
const isPackage = isPathAPackageFile(directory);
|
|
9804
9663
|
if (isPackage) {
|
|
@@ -9834,14 +9693,14 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
9834
9693
|
command: "remove <id>",
|
|
9835
9694
|
aliases: ["delete", "rm"],
|
|
9836
9695
|
describe: "Delete a project map",
|
|
9837
|
-
builder: (
|
|
9696
|
+
builder: (yargs36) => withConfiguration(
|
|
9838
9697
|
withApiOptions(
|
|
9839
|
-
withProjectOptions(
|
|
9698
|
+
withProjectOptions(yargs36.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
9840
9699
|
)
|
|
9841
9700
|
),
|
|
9842
9701
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
9843
|
-
const
|
|
9844
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9702
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
9703
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9845
9704
|
await client.deleteProjectMap({ projectMapId: id });
|
|
9846
9705
|
}
|
|
9847
9706
|
};
|
|
@@ -9851,16 +9710,16 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
9851
9710
|
command: "update <filename>",
|
|
9852
9711
|
aliases: ["put"],
|
|
9853
9712
|
describe: "Insert or update a project map",
|
|
9854
|
-
builder: (
|
|
9713
|
+
builder: (yargs36) => withConfiguration(
|
|
9855
9714
|
withApiOptions(
|
|
9856
9715
|
withProjectOptions(
|
|
9857
|
-
|
|
9716
|
+
yargs36.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
9858
9717
|
)
|
|
9859
9718
|
)
|
|
9860
9719
|
),
|
|
9861
9720
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
9862
|
-
const
|
|
9863
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9721
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
9722
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9864
9723
|
const file = readFileToObject(filename);
|
|
9865
9724
|
await client.upsertProjectMap({ projectMap: file });
|
|
9866
9725
|
}
|
|
@@ -9870,31 +9729,31 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
9870
9729
|
var ProjectMapDefinitionModule = {
|
|
9871
9730
|
command: "definition <command>",
|
|
9872
9731
|
describe: "Commands for ProjectMap Definitions",
|
|
9873
|
-
builder: (
|
|
9732
|
+
builder: (yargs36) => yargs36.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
9874
9733
|
handler: () => {
|
|
9875
|
-
|
|
9734
|
+
yargs29.help();
|
|
9876
9735
|
}
|
|
9877
9736
|
};
|
|
9878
9737
|
|
|
9879
9738
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
9880
|
-
import
|
|
9739
|
+
import yargs30 from "yargs";
|
|
9881
9740
|
|
|
9882
9741
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
9883
9742
|
var ProjectMapNodeGetModule = {
|
|
9884
9743
|
command: "get <id> <projectMapId>",
|
|
9885
9744
|
describe: "Fetch a project map node",
|
|
9886
|
-
builder: (
|
|
9745
|
+
builder: (yargs36) => withConfiguration(
|
|
9887
9746
|
withFormatOptions(
|
|
9888
9747
|
withApiOptions(
|
|
9889
9748
|
withProjectOptions(
|
|
9890
|
-
|
|
9749
|
+
yargs36.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
9891
9750
|
)
|
|
9892
9751
|
)
|
|
9893
9752
|
)
|
|
9894
9753
|
),
|
|
9895
9754
|
handler: async ({ apiHost, apiKey, proxy, id, projectMapId, format, project: projectId, filename }) => {
|
|
9896
|
-
const
|
|
9897
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9755
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
9756
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9898
9757
|
console.log("Debugging params for node get", { projectMapId, id, projectId });
|
|
9899
9758
|
const res = await client.getNodes({ projectMapId, id });
|
|
9900
9759
|
if (res.nodes?.length === 0) {
|
|
@@ -9911,12 +9770,12 @@ var ProjectMapNodeListModule = {
|
|
|
9911
9770
|
command: "list <projectMapId>",
|
|
9912
9771
|
describe: "List project map nodes",
|
|
9913
9772
|
aliases: ["ls"],
|
|
9914
|
-
builder: (
|
|
9773
|
+
builder: (yargs36) => withConfiguration(
|
|
9915
9774
|
withFormatOptions(
|
|
9916
9775
|
withApiOptions(
|
|
9917
9776
|
withProjectOptions(
|
|
9918
9777
|
withStateOptions(
|
|
9919
|
-
|
|
9778
|
+
yargs36.positional("projectMapId", {
|
|
9920
9779
|
demandOption: true,
|
|
9921
9780
|
describe: "ProjectMap UUID to fetch from"
|
|
9922
9781
|
})
|
|
@@ -9926,8 +9785,8 @@ var ProjectMapNodeListModule = {
|
|
|
9926
9785
|
)
|
|
9927
9786
|
),
|
|
9928
9787
|
handler: async ({ apiHost, apiKey, proxy, projectMapId, format, filename, project: projectId, state }) => {
|
|
9929
|
-
const
|
|
9930
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9788
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
9789
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
9931
9790
|
const res = await client.getNodes({ projectMapId, state: convertStateOption(state) });
|
|
9932
9791
|
emitWithFormat({ nodes: res.nodes ?? [], projectMapId }, format, filename);
|
|
9933
9792
|
}
|
|
@@ -9994,12 +9853,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
9994
9853
|
var ProjectMapNodePullModule = {
|
|
9995
9854
|
command: "pull <directory>",
|
|
9996
9855
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
9997
|
-
builder: (
|
|
9856
|
+
builder: (yargs36) => withConfiguration(
|
|
9998
9857
|
withDebugOptions(
|
|
9999
9858
|
withApiOptions(
|
|
10000
9859
|
withProjectOptions(
|
|
10001
9860
|
withDiffOptions(
|
|
10002
|
-
|
|
9861
|
+
yargs36.positional("directory", {
|
|
10003
9862
|
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.",
|
|
10004
9863
|
type: "string"
|
|
10005
9864
|
}).option("format", {
|
|
@@ -10033,8 +9892,8 @@ var ProjectMapNodePullModule = {
|
|
|
10033
9892
|
allowEmptySource,
|
|
10034
9893
|
verbose
|
|
10035
9894
|
}) => {
|
|
10036
|
-
const
|
|
10037
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
9895
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
9896
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10038
9897
|
const source = createProjectMapNodeEngineDataSource({ client, projectId });
|
|
10039
9898
|
let target;
|
|
10040
9899
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -10081,12 +9940,12 @@ import {
|
|
|
10081
9940
|
var ProjectMapNodePushModule = {
|
|
10082
9941
|
command: "push <directory>",
|
|
10083
9942
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
10084
|
-
builder: (
|
|
9943
|
+
builder: (yargs36) => withConfiguration(
|
|
10085
9944
|
withDebugOptions(
|
|
10086
9945
|
withApiOptions(
|
|
10087
9946
|
withProjectOptions(
|
|
10088
9947
|
withDiffOptions(
|
|
10089
|
-
|
|
9948
|
+
yargs36.positional("directory", {
|
|
10090
9949
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
10091
9950
|
type: "string"
|
|
10092
9951
|
}).option("mode", {
|
|
@@ -10113,11 +9972,11 @@ var ProjectMapNodePushModule = {
|
|
|
10113
9972
|
allowEmptySource,
|
|
10114
9973
|
verbose
|
|
10115
9974
|
}) => {
|
|
10116
|
-
const
|
|
9975
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
10117
9976
|
const client = getProjectMapClient({
|
|
10118
9977
|
apiKey,
|
|
10119
9978
|
apiHost,
|
|
10120
|
-
fetch:
|
|
9979
|
+
fetch: fetch2,
|
|
10121
9980
|
projectId
|
|
10122
9981
|
});
|
|
10123
9982
|
let source;
|
|
@@ -10188,16 +10047,16 @@ var ProjectMapNodeRemoveModule = {
|
|
|
10188
10047
|
command: "remove <id> <projectMapId>",
|
|
10189
10048
|
aliases: ["delete", "rm"],
|
|
10190
10049
|
describe: "Delete a project map node",
|
|
10191
|
-
builder: (
|
|
10050
|
+
builder: (yargs36) => withConfiguration(
|
|
10192
10051
|
withApiOptions(
|
|
10193
10052
|
withProjectOptions(
|
|
10194
|
-
|
|
10053
|
+
yargs36.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
10195
10054
|
)
|
|
10196
10055
|
)
|
|
10197
10056
|
),
|
|
10198
10057
|
handler: async ({ apiHost, apiKey, proxy, projectMapId, id, project: projectId }) => {
|
|
10199
|
-
const
|
|
10200
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
10058
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10059
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10201
10060
|
await client.deleteProjectMapNode({ projectMapId, nodeId: id });
|
|
10202
10061
|
}
|
|
10203
10062
|
};
|
|
@@ -10207,16 +10066,16 @@ var ProjectMapNodeUpdateModule = {
|
|
|
10207
10066
|
command: "update <filename> <projectMapId>",
|
|
10208
10067
|
aliases: ["put"],
|
|
10209
10068
|
describe: "Insert or update a project map node",
|
|
10210
|
-
builder: (
|
|
10069
|
+
builder: (yargs36) => withConfiguration(
|
|
10211
10070
|
withApiOptions(
|
|
10212
10071
|
withProjectOptions(
|
|
10213
|
-
|
|
10072
|
+
yargs36.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
10214
10073
|
)
|
|
10215
10074
|
)
|
|
10216
10075
|
),
|
|
10217
10076
|
handler: async ({ apiHost, apiKey, proxy, projectMapId, filename, project: projectId }) => {
|
|
10218
|
-
const
|
|
10219
|
-
const client = getProjectMapClient({ apiKey, apiHost, fetch:
|
|
10077
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10078
|
+
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10220
10079
|
const file = readFileToObject(filename);
|
|
10221
10080
|
await client.upsertProjectMapNodes({ nodes: [{ node: file }], projectMapId });
|
|
10222
10081
|
}
|
|
@@ -10226,9 +10085,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
10226
10085
|
var ProjectMapNodeModule = {
|
|
10227
10086
|
command: "node <command>",
|
|
10228
10087
|
describe: "Commands for ProjectMap Nodes",
|
|
10229
|
-
builder: (
|
|
10088
|
+
builder: (yargs36) => yargs36.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
10230
10089
|
handler: () => {
|
|
10231
|
-
|
|
10090
|
+
yargs30.help();
|
|
10232
10091
|
}
|
|
10233
10092
|
};
|
|
10234
10093
|
|
|
@@ -10237,17 +10096,17 @@ var ProjectMapCommand = {
|
|
|
10237
10096
|
command: "project-map <command>",
|
|
10238
10097
|
aliases: ["prm"],
|
|
10239
10098
|
describe: "Uniform ProjectMap commands",
|
|
10240
|
-
builder: (
|
|
10099
|
+
builder: (yargs36) => yargs36.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
10241
10100
|
handler: () => {
|
|
10242
|
-
|
|
10101
|
+
yargs31.showHelp();
|
|
10243
10102
|
}
|
|
10244
10103
|
};
|
|
10245
10104
|
|
|
10246
10105
|
// src/commands/redirect/index.ts
|
|
10247
|
-
import
|
|
10106
|
+
import yargs33 from "yargs";
|
|
10248
10107
|
|
|
10249
10108
|
// src/commands/redirect/commands/redirect.ts
|
|
10250
|
-
import
|
|
10109
|
+
import yargs32 from "yargs";
|
|
10251
10110
|
|
|
10252
10111
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
10253
10112
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
@@ -10272,18 +10131,18 @@ function getRedirectClient(options) {
|
|
|
10272
10131
|
var RedirectDefinitionGetModule = {
|
|
10273
10132
|
command: "get <id>",
|
|
10274
10133
|
describe: "Fetch a redirect",
|
|
10275
|
-
builder: (
|
|
10134
|
+
builder: (yargs36) => withConfiguration(
|
|
10276
10135
|
withFormatOptions(
|
|
10277
10136
|
withApiOptions(
|
|
10278
10137
|
withProjectOptions(
|
|
10279
|
-
|
|
10138
|
+
yargs36.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
10280
10139
|
)
|
|
10281
10140
|
)
|
|
10282
10141
|
)
|
|
10283
10142
|
),
|
|
10284
10143
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
10285
|
-
const
|
|
10286
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10144
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10145
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10287
10146
|
const res = await client.getRedirect({ id });
|
|
10288
10147
|
if (!res) {
|
|
10289
10148
|
console.error("Redirect does not exist");
|
|
@@ -10299,10 +10158,10 @@ var RedirectDefinitionListModule = {
|
|
|
10299
10158
|
command: "list",
|
|
10300
10159
|
describe: "List of redirects",
|
|
10301
10160
|
aliases: ["ls"],
|
|
10302
|
-
builder: (
|
|
10161
|
+
builder: (yargs36) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs36)))),
|
|
10303
10162
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10304
|
-
const
|
|
10305
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10163
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10164
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10306
10165
|
const res = await client.getRedirects({});
|
|
10307
10166
|
emitWithFormat(res, format, filename);
|
|
10308
10167
|
}
|
|
@@ -10351,12 +10210,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
10351
10210
|
var RedirectDefinitionPullModule = {
|
|
10352
10211
|
command: "pull <directory>",
|
|
10353
10212
|
describe: "Pulls all redirects to local files in a directory",
|
|
10354
|
-
builder: (
|
|
10213
|
+
builder: (yargs36) => withConfiguration(
|
|
10355
10214
|
withDebugOptions(
|
|
10356
10215
|
withApiOptions(
|
|
10357
10216
|
withProjectOptions(
|
|
10358
10217
|
withDiffOptions(
|
|
10359
|
-
|
|
10218
|
+
yargs36.positional("directory", {
|
|
10360
10219
|
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.",
|
|
10361
10220
|
type: "string"
|
|
10362
10221
|
}).option("format", {
|
|
@@ -10390,8 +10249,8 @@ var RedirectDefinitionPullModule = {
|
|
|
10390
10249
|
allowEmptySource,
|
|
10391
10250
|
verbose
|
|
10392
10251
|
}) => {
|
|
10393
|
-
const
|
|
10394
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10252
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
10253
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10395
10254
|
const source = createRedirectDefinitionEngineDataSource({ client });
|
|
10396
10255
|
let target;
|
|
10397
10256
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -10432,12 +10291,12 @@ var RedirectDefinitionPullModule = {
|
|
|
10432
10291
|
var RedirectDefinitionPushModule = {
|
|
10433
10292
|
command: "push <directory>",
|
|
10434
10293
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
10435
|
-
builder: (
|
|
10294
|
+
builder: (yargs36) => withConfiguration(
|
|
10436
10295
|
withDebugOptions(
|
|
10437
10296
|
withApiOptions(
|
|
10438
10297
|
withProjectOptions(
|
|
10439
10298
|
withDiffOptions(
|
|
10440
|
-
|
|
10299
|
+
yargs36.positional("directory", {
|
|
10441
10300
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
10442
10301
|
type: "string"
|
|
10443
10302
|
}).option("mode", {
|
|
@@ -10464,8 +10323,8 @@ var RedirectDefinitionPushModule = {
|
|
|
10464
10323
|
allowEmptySource,
|
|
10465
10324
|
verbose
|
|
10466
10325
|
}) => {
|
|
10467
|
-
const
|
|
10468
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10326
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
10327
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10469
10328
|
let source;
|
|
10470
10329
|
const isPackage = isPathAPackageFile(directory);
|
|
10471
10330
|
if (isPackage) {
|
|
@@ -10501,14 +10360,14 @@ var RedirectDefinitionRemoveModule = {
|
|
|
10501
10360
|
command: "remove <id>",
|
|
10502
10361
|
aliases: ["delete", "rm"],
|
|
10503
10362
|
describe: "Delete a redirect",
|
|
10504
|
-
builder: (
|
|
10363
|
+
builder: (yargs36) => withConfiguration(
|
|
10505
10364
|
withApiOptions(
|
|
10506
|
-
withProjectOptions(
|
|
10365
|
+
withProjectOptions(yargs36.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
10507
10366
|
)
|
|
10508
10367
|
),
|
|
10509
10368
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
10510
|
-
const
|
|
10511
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10369
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10370
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10512
10371
|
await client.deleteRedirect(id);
|
|
10513
10372
|
}
|
|
10514
10373
|
};
|
|
@@ -10518,16 +10377,16 @@ var RedirectDefinitionUpdateModule = {
|
|
|
10518
10377
|
command: "update <filename>",
|
|
10519
10378
|
aliases: ["put"],
|
|
10520
10379
|
describe: "Insert or update a redirect",
|
|
10521
|
-
builder: (
|
|
10380
|
+
builder: (yargs36) => withConfiguration(
|
|
10522
10381
|
withApiOptions(
|
|
10523
10382
|
withProjectOptions(
|
|
10524
|
-
|
|
10383
|
+
yargs36.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
10525
10384
|
)
|
|
10526
10385
|
)
|
|
10527
10386
|
),
|
|
10528
10387
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
10529
|
-
const
|
|
10530
|
-
const client = getRedirectClient({ apiKey, apiHost, fetch:
|
|
10388
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10389
|
+
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
10531
10390
|
const file = readFileToObject(filename);
|
|
10532
10391
|
await client.upsertRedirect(file);
|
|
10533
10392
|
}
|
|
@@ -10537,9 +10396,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
10537
10396
|
var RedirectDefinitionModule = {
|
|
10538
10397
|
command: "definition <command>",
|
|
10539
10398
|
describe: "Commands for Redirect Definitions",
|
|
10540
|
-
builder: (
|
|
10399
|
+
builder: (yargs36) => yargs36.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
10541
10400
|
handler: () => {
|
|
10542
|
-
|
|
10401
|
+
yargs32.help();
|
|
10543
10402
|
}
|
|
10544
10403
|
};
|
|
10545
10404
|
|
|
@@ -10548,14 +10407,14 @@ var RedirectCommand = {
|
|
|
10548
10407
|
command: "redirect <command>",
|
|
10549
10408
|
aliases: ["red"],
|
|
10550
10409
|
describe: "Uniform Redirect commands",
|
|
10551
|
-
builder: (
|
|
10410
|
+
builder: (yargs36) => yargs36.command(RedirectDefinitionModule).demandCommand(),
|
|
10552
10411
|
handler: () => {
|
|
10553
|
-
|
|
10412
|
+
yargs33.showHelp();
|
|
10554
10413
|
}
|
|
10555
10414
|
};
|
|
10556
10415
|
|
|
10557
10416
|
// src/commands/sync/index.ts
|
|
10558
|
-
import
|
|
10417
|
+
import yargs34 from "yargs";
|
|
10559
10418
|
|
|
10560
10419
|
// src/commands/sync/commands/util.ts
|
|
10561
10420
|
import ora2 from "ora";
|
|
@@ -10671,7 +10530,7 @@ function numPad(num, spaces = 6) {
|
|
|
10671
10530
|
var SyncPullModule = {
|
|
10672
10531
|
command: "pull",
|
|
10673
10532
|
describe: "Pulls whole project to local files in a directory",
|
|
10674
|
-
builder: (
|
|
10533
|
+
builder: (yargs36) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs36))))),
|
|
10675
10534
|
handler: async ({ serialization, ...otherParams }) => {
|
|
10676
10535
|
const config2 = serialization;
|
|
10677
10536
|
const enabledEntities = Object.entries({
|
|
@@ -10707,14 +10566,14 @@ var SyncPullModule = {
|
|
|
10707
10566
|
"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."
|
|
10708
10567
|
);
|
|
10709
10568
|
}
|
|
10710
|
-
for (const [entityType,
|
|
10569
|
+
for (const [entityType, module] of enabledEntities) {
|
|
10711
10570
|
const entityConfigSupportsPullState = (entityConfig2) => {
|
|
10712
10571
|
return entityConfig2 !== void 0 && "state" in entityConfig2;
|
|
10713
10572
|
};
|
|
10714
10573
|
const entityConfig = config2.entitiesConfig?.[entityType];
|
|
10715
10574
|
try {
|
|
10716
10575
|
await spinPromise(
|
|
10717
|
-
|
|
10576
|
+
module.handler({
|
|
10718
10577
|
...otherParams,
|
|
10719
10578
|
state: entityConfigSupportsPullState(entityConfig) ? entityConfig.state ?? 0 : 0,
|
|
10720
10579
|
format: getFormat(entityType, config2),
|
|
@@ -10769,7 +10628,7 @@ var getFormat = (entityType, config2) => {
|
|
|
10769
10628
|
var SyncPushModule = {
|
|
10770
10629
|
command: "push",
|
|
10771
10630
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
10772
|
-
builder: (
|
|
10631
|
+
builder: (yargs36) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs36))))),
|
|
10773
10632
|
handler: async ({ serialization, ...otherParams }) => {
|
|
10774
10633
|
const config2 = serialization;
|
|
10775
10634
|
const enabledEntities = Object.entries({
|
|
@@ -10805,10 +10664,10 @@ var SyncPushModule = {
|
|
|
10805
10664
|
"No entities were configured to be pushed. Please make sure you have configuration file and at least one entity type is enabled."
|
|
10806
10665
|
);
|
|
10807
10666
|
}
|
|
10808
|
-
for (const [entityType,
|
|
10667
|
+
for (const [entityType, module] of enabledEntities) {
|
|
10809
10668
|
try {
|
|
10810
10669
|
await spinPromise(
|
|
10811
|
-
|
|
10670
|
+
module.handler({
|
|
10812
10671
|
...otherParams,
|
|
10813
10672
|
state: 0,
|
|
10814
10673
|
format: getFormat2(entityType, config2),
|
|
@@ -10961,14 +10820,14 @@ var getFormat2 = (entityType, config2) => {
|
|
|
10961
10820
|
var SyncCommand = {
|
|
10962
10821
|
command: "sync <command>",
|
|
10963
10822
|
describe: "Uniform Sync commands",
|
|
10964
|
-
builder: (
|
|
10823
|
+
builder: (yargs36) => yargs36.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
10965
10824
|
handler: () => {
|
|
10966
|
-
|
|
10825
|
+
yargs34.showHelp();
|
|
10967
10826
|
}
|
|
10968
10827
|
};
|
|
10969
10828
|
|
|
10970
10829
|
// src/middleware/checkForUpdateMiddleware.ts
|
|
10971
|
-
import { bold, gray as
|
|
10830
|
+
import { bold, gray as gray4, green as green3 } from "colorette";
|
|
10972
10831
|
|
|
10973
10832
|
// src/updateCheck.ts
|
|
10974
10833
|
import { existsSync as existsSync4, promises as fs5 } from "fs";
|
|
@@ -11136,7 +10995,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
11136
10995
|
}
|
|
11137
10996
|
const update = await updateCheck_default(package_default, { verbose });
|
|
11138
10997
|
if (update) {
|
|
11139
|
-
logCallout(`${bold("Update Available:")} ${
|
|
10998
|
+
logCallout(`${bold("Update Available:")} ${gray4(package_default.version)} \u226B ${green3(update.latest)}`);
|
|
11140
10999
|
}
|
|
11141
11000
|
} catch (e) {
|
|
11142
11001
|
console.error(`There was an error checking for updates`, e);
|
|
@@ -11144,7 +11003,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
11144
11003
|
};
|
|
11145
11004
|
|
|
11146
11005
|
// src/middleware/checkLocalDepsVersionsMiddleware.ts
|
|
11147
|
-
import { magenta, red as
|
|
11006
|
+
import { magenta, red as red5 } from "colorette";
|
|
11148
11007
|
import { join as join4 } from "path";
|
|
11149
11008
|
|
|
11150
11009
|
// src/fs.ts
|
|
@@ -11200,7 +11059,7 @@ First found was: v${firstVersion}`;
|
|
|
11200
11059
|
}
|
|
11201
11060
|
if (version !== firstVersion) {
|
|
11202
11061
|
isOutside = true;
|
|
11203
|
-
warning +=
|
|
11062
|
+
warning += red5(`
|
|
11204
11063
|
${p}: ${version}`);
|
|
11205
11064
|
}
|
|
11206
11065
|
}
|
|
@@ -11215,11 +11074,11 @@ First found was: v${firstVersion}`;
|
|
|
11215
11074
|
|
|
11216
11075
|
// src/index.ts
|
|
11217
11076
|
dotenv.config();
|
|
11218
|
-
var yarggery =
|
|
11077
|
+
var yarggery = yargs35(hideBin(process.argv));
|
|
11219
11078
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
11220
11079
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
11221
11080
|
yarggery.option("verbose", {
|
|
11222
11081
|
describe: "Include verbose logging",
|
|
11223
11082
|
default: false,
|
|
11224
11083
|
type: "boolean"
|
|
11225
|
-
}).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(
|
|
11084
|
+
}).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();
|