@uniformdev/cli 19.196.1 → 19.197.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
|
|
22
22
|
// src/index.ts
|
|
23
23
|
import * as dotenv from "dotenv";
|
|
24
|
-
import
|
|
24
|
+
import yargs37 from "yargs";
|
|
25
25
|
import { hideBin } from "yargs/helpers";
|
|
26
26
|
|
|
27
27
|
// src/commands/canvas/index.ts
|
|
28
|
-
import
|
|
28
|
+
import yargs18 from "yargs";
|
|
29
29
|
|
|
30
30
|
// src/commands/canvas/commands/asset.ts
|
|
31
31
|
import yargs from "yargs";
|
|
@@ -37,20 +37,20 @@ import { UncachedAssetClient } from "@uniformdev/assets";
|
|
|
37
37
|
async function createArraySyncEngineDataSource({
|
|
38
38
|
name,
|
|
39
39
|
objects,
|
|
40
|
-
selectIdentifier:
|
|
41
|
-
selectDisplayName:
|
|
40
|
+
selectIdentifier: selectIdentifier16,
|
|
41
|
+
selectDisplayName: selectDisplayName16 = selectIdentifier16,
|
|
42
42
|
onSyncComplete,
|
|
43
43
|
onBeforeDeleteObject
|
|
44
44
|
}) {
|
|
45
45
|
const objectIndex = objects.reduce(
|
|
46
46
|
(result, current) => {
|
|
47
|
-
const rawIdentifiers =
|
|
47
|
+
const rawIdentifiers = selectIdentifier16(current);
|
|
48
48
|
const identifiers = Array.isArray(rawIdentifiers) ? rawIdentifiers : [rawIdentifiers];
|
|
49
49
|
const existingResult = identifiers.find((id) => result[id]);
|
|
50
50
|
if (existingResult) {
|
|
51
51
|
throw new Error(`Identifier(s) ${identifiers} was not unique.`);
|
|
52
52
|
}
|
|
53
|
-
const displayName =
|
|
53
|
+
const displayName = selectDisplayName16(current);
|
|
54
54
|
result[identifiers[0]] = {
|
|
55
55
|
id: identifiers,
|
|
56
56
|
object: current,
|
|
@@ -80,7 +80,7 @@ async function createArraySyncEngineDataSource({
|
|
|
80
80
|
delete objectIndex[providerId];
|
|
81
81
|
},
|
|
82
82
|
writeObject: async (objectToWrite) => {
|
|
83
|
-
const id =
|
|
83
|
+
const id = selectIdentifier16(objectToWrite.object);
|
|
84
84
|
if (Array.isArray(id)) {
|
|
85
85
|
objectIndex[id[0]] = objectToWrite;
|
|
86
86
|
} else {
|
|
@@ -141,8 +141,8 @@ var loadConfig = (configPath) => {
|
|
|
141
141
|
async function createFileSyncEngineDataSource({
|
|
142
142
|
directory,
|
|
143
143
|
format = "yaml",
|
|
144
|
-
selectIdentifier:
|
|
145
|
-
selectDisplayName:
|
|
144
|
+
selectIdentifier: selectIdentifier16,
|
|
145
|
+
selectDisplayName: selectDisplayName16 = selectIdentifier16,
|
|
146
146
|
selectFilename: selectFilename3,
|
|
147
147
|
selectSchemaUrl: selectSchemaUrl2,
|
|
148
148
|
onBeforeDeleteObject
|
|
@@ -164,9 +164,9 @@ async function createFileSyncEngineDataSource({
|
|
|
164
164
|
const fullFilename = join(directory, filename);
|
|
165
165
|
try {
|
|
166
166
|
const contents = await readFileToObject(fullFilename);
|
|
167
|
-
const displayName =
|
|
167
|
+
const displayName = selectDisplayName16(contents);
|
|
168
168
|
const object = {
|
|
169
|
-
id:
|
|
169
|
+
id: selectIdentifier16(contents),
|
|
170
170
|
displayName: Array.isArray(displayName) ? displayName[0] : displayName,
|
|
171
171
|
providerId: fullFilename,
|
|
172
172
|
object: omit(contents, ["$schema"])
|
|
@@ -424,12 +424,12 @@ function createPublishStatusSyncEngineConsoleLogger(options) {
|
|
|
424
424
|
var AssetGetModule = {
|
|
425
425
|
command: "get <id>",
|
|
426
426
|
describe: "Get an asset",
|
|
427
|
-
builder: (
|
|
427
|
+
builder: (yargs38) => withConfiguration(
|
|
428
428
|
withFormatOptions(
|
|
429
429
|
withApiOptions(
|
|
430
430
|
withProjectOptions(
|
|
431
431
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
432
|
-
|
|
432
|
+
yargs38.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
433
433
|
)
|
|
434
434
|
)
|
|
435
435
|
)
|
|
@@ -450,7 +450,7 @@ import { UncachedAssetClient as UncachedAssetClient2 } from "@uniformdev/assets"
|
|
|
450
450
|
var AssetListModule = {
|
|
451
451
|
command: "list",
|
|
452
452
|
describe: "List assets",
|
|
453
|
-
builder: (
|
|
453
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
454
454
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
455
455
|
const fetch3 = nodeFetchProxy(proxy);
|
|
456
456
|
const client = new UncachedAssetClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -802,8 +802,8 @@ function prepCompositionForDisk(composition) {
|
|
|
802
802
|
delete prepped.state;
|
|
803
803
|
return prepped;
|
|
804
804
|
}
|
|
805
|
-
function withStateOptions(
|
|
806
|
-
return
|
|
805
|
+
function withStateOptions(yargs38, defaultState = "preview") {
|
|
806
|
+
return yargs38.option("state", {
|
|
807
807
|
type: "string",
|
|
808
808
|
describe: `State to fetch.`,
|
|
809
809
|
choices: ["preview", "published"],
|
|
@@ -870,11 +870,11 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
870
870
|
var AssetPullModule = {
|
|
871
871
|
command: "pull <directory>",
|
|
872
872
|
describe: "Pulls all assets to local files in a directory",
|
|
873
|
-
builder: (
|
|
873
|
+
builder: (yargs38) => withConfiguration(
|
|
874
874
|
withApiOptions(
|
|
875
875
|
withProjectOptions(
|
|
876
876
|
withDiffOptions(
|
|
877
|
-
|
|
877
|
+
yargs38.positional("directory", {
|
|
878
878
|
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.",
|
|
879
879
|
type: "string"
|
|
880
880
|
}).option("format", {
|
|
@@ -992,11 +992,11 @@ import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
|
|
|
992
992
|
var AssetPushModule = {
|
|
993
993
|
command: "push <directory>",
|
|
994
994
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
995
|
-
builder: (
|
|
995
|
+
builder: (yargs38) => withConfiguration(
|
|
996
996
|
withApiOptions(
|
|
997
997
|
withProjectOptions(
|
|
998
998
|
withDiffOptions(
|
|
999
|
-
|
|
999
|
+
yargs38.positional("directory", {
|
|
1000
1000
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
1001
1001
|
type: "string"
|
|
1002
1002
|
}).option("what-if", {
|
|
@@ -1097,9 +1097,9 @@ var AssetRemoveModule = {
|
|
|
1097
1097
|
command: "remove <id>",
|
|
1098
1098
|
aliases: ["delete", "rm"],
|
|
1099
1099
|
describe: "Delete an asset",
|
|
1100
|
-
builder: (
|
|
1100
|
+
builder: (yargs38) => withConfiguration(
|
|
1101
1101
|
withApiOptions(
|
|
1102
|
-
withProjectOptions(
|
|
1102
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
1103
1103
|
)
|
|
1104
1104
|
),
|
|
1105
1105
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -1115,10 +1115,10 @@ var AssetUpdateModule = {
|
|
|
1115
1115
|
command: "update <filename>",
|
|
1116
1116
|
aliases: ["put"],
|
|
1117
1117
|
describe: "Insert or update an asset",
|
|
1118
|
-
builder: (
|
|
1118
|
+
builder: (yargs38) => withConfiguration(
|
|
1119
1119
|
withApiOptions(
|
|
1120
1120
|
withProjectOptions(
|
|
1121
|
-
|
|
1121
|
+
yargs38.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
1122
1122
|
)
|
|
1123
1123
|
)
|
|
1124
1124
|
),
|
|
@@ -1134,7 +1134,7 @@ var AssetUpdateModule = {
|
|
|
1134
1134
|
var AssetModule = {
|
|
1135
1135
|
command: "asset <command>",
|
|
1136
1136
|
describe: "Commands for Assets",
|
|
1137
|
-
builder: (
|
|
1137
|
+
builder: (yargs38) => yargs38.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
1138
1138
|
handler: () => {
|
|
1139
1139
|
yargs.help();
|
|
1140
1140
|
}
|
|
@@ -1148,11 +1148,11 @@ import { UncachedCategoryClient } from "@uniformdev/canvas";
|
|
|
1148
1148
|
var CategoryGetModule = {
|
|
1149
1149
|
command: "get <id>",
|
|
1150
1150
|
describe: "Fetch a category",
|
|
1151
|
-
builder: (
|
|
1151
|
+
builder: (yargs38) => withConfiguration(
|
|
1152
1152
|
withFormatOptions(
|
|
1153
1153
|
withApiOptions(
|
|
1154
1154
|
withProjectOptions(
|
|
1155
|
-
|
|
1155
|
+
yargs38.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
1156
1156
|
)
|
|
1157
1157
|
)
|
|
1158
1158
|
)
|
|
@@ -1177,7 +1177,7 @@ var CategoryListModule = {
|
|
|
1177
1177
|
command: "list",
|
|
1178
1178
|
describe: "List categories",
|
|
1179
1179
|
aliases: ["ls"],
|
|
1180
|
-
builder: (
|
|
1180
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38.options({}))))),
|
|
1181
1181
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
1182
1182
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1183
1183
|
const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -1227,11 +1227,11 @@ function createCategoriesEngineDataSource({
|
|
|
1227
1227
|
var CategoryPullModule = {
|
|
1228
1228
|
command: "pull <directory>",
|
|
1229
1229
|
describe: "Pulls all categories to local files in a directory",
|
|
1230
|
-
builder: (
|
|
1230
|
+
builder: (yargs38) => withConfiguration(
|
|
1231
1231
|
withApiOptions(
|
|
1232
1232
|
withProjectOptions(
|
|
1233
1233
|
withDiffOptions(
|
|
1234
|
-
|
|
1234
|
+
yargs38.positional("directory", {
|
|
1235
1235
|
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.",
|
|
1236
1236
|
type: "string"
|
|
1237
1237
|
}).option("format", {
|
|
@@ -1309,11 +1309,11 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
|
|
|
1309
1309
|
var CategoryPushModule = {
|
|
1310
1310
|
command: "push <directory>",
|
|
1311
1311
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
1312
|
-
builder: (
|
|
1312
|
+
builder: (yargs38) => withConfiguration(
|
|
1313
1313
|
withApiOptions(
|
|
1314
1314
|
withProjectOptions(
|
|
1315
1315
|
withDiffOptions(
|
|
1316
|
-
|
|
1316
|
+
yargs38.positional("directory", {
|
|
1317
1317
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
1318
1318
|
type: "string"
|
|
1319
1319
|
}).option("what-if", {
|
|
@@ -1380,10 +1380,10 @@ var CategoryRemoveModule = {
|
|
|
1380
1380
|
command: "remove <id>",
|
|
1381
1381
|
aliases: ["delete", "rm"],
|
|
1382
1382
|
describe: "Delete a category",
|
|
1383
|
-
builder: (
|
|
1383
|
+
builder: (yargs38) => withConfiguration(
|
|
1384
1384
|
withApiOptions(
|
|
1385
1385
|
withProjectOptions(
|
|
1386
|
-
|
|
1386
|
+
yargs38.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
1387
1387
|
)
|
|
1388
1388
|
)
|
|
1389
1389
|
),
|
|
@@ -1400,10 +1400,10 @@ var CategoryUpdateModule = {
|
|
|
1400
1400
|
command: "update <filename>",
|
|
1401
1401
|
aliases: ["put"],
|
|
1402
1402
|
describe: "Insert or update a category",
|
|
1403
|
-
builder: (
|
|
1403
|
+
builder: (yargs38) => withConfiguration(
|
|
1404
1404
|
withApiOptions(
|
|
1405
1405
|
withProjectOptions(
|
|
1406
|
-
|
|
1406
|
+
yargs38.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
1407
1407
|
)
|
|
1408
1408
|
)
|
|
1409
1409
|
),
|
|
@@ -1420,7 +1420,7 @@ var CategoryModule = {
|
|
|
1420
1420
|
command: "category <command>",
|
|
1421
1421
|
aliases: ["cat"],
|
|
1422
1422
|
describe: "Commands for Canvas categories",
|
|
1423
|
-
builder: (
|
|
1423
|
+
builder: (yargs38) => yargs38.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
1424
1424
|
handler: () => {
|
|
1425
1425
|
yargs2.help();
|
|
1426
1426
|
}
|
|
@@ -1441,11 +1441,11 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
|
|
|
1441
1441
|
var ComponentGetModule = {
|
|
1442
1442
|
command: "get <id>",
|
|
1443
1443
|
describe: "Fetch a component definition",
|
|
1444
|
-
builder: (
|
|
1444
|
+
builder: (yargs38) => withConfiguration(
|
|
1445
1445
|
withFormatOptions(
|
|
1446
1446
|
withApiOptions(
|
|
1447
1447
|
withProjectOptions(
|
|
1448
|
-
|
|
1448
|
+
yargs38.positional("id", {
|
|
1449
1449
|
demandOption: true,
|
|
1450
1450
|
describe: "Component definition public ID to fetch"
|
|
1451
1451
|
})
|
|
@@ -1479,11 +1479,11 @@ var ComponentListModule = {
|
|
|
1479
1479
|
command: "list",
|
|
1480
1480
|
describe: "List component definitions",
|
|
1481
1481
|
aliases: ["ls"],
|
|
1482
|
-
builder: (
|
|
1482
|
+
builder: (yargs38) => withConfiguration(
|
|
1483
1483
|
withFormatOptions(
|
|
1484
1484
|
withApiOptions(
|
|
1485
1485
|
withProjectOptions(
|
|
1486
|
-
|
|
1486
|
+
yargs38.options({
|
|
1487
1487
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1488
1488
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
1489
1489
|
})
|
|
@@ -1539,11 +1539,11 @@ function createComponentDefinitionEngineDataSource({
|
|
|
1539
1539
|
var ComponentPullModule = {
|
|
1540
1540
|
command: "pull <directory>",
|
|
1541
1541
|
describe: "Pulls all component definitions to local files in a directory",
|
|
1542
|
-
builder: (
|
|
1542
|
+
builder: (yargs38) => withConfiguration(
|
|
1543
1543
|
withApiOptions(
|
|
1544
1544
|
withProjectOptions(
|
|
1545
1545
|
withDiffOptions(
|
|
1546
|
-
|
|
1546
|
+
yargs38.positional("directory", {
|
|
1547
1547
|
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.",
|
|
1548
1548
|
type: "string"
|
|
1549
1549
|
}).option("format", {
|
|
@@ -1622,11 +1622,11 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
|
|
|
1622
1622
|
var ComponentPushModule = {
|
|
1623
1623
|
command: "push <directory>",
|
|
1624
1624
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
1625
|
-
builder: (
|
|
1625
|
+
builder: (yargs38) => withConfiguration(
|
|
1626
1626
|
withApiOptions(
|
|
1627
1627
|
withProjectOptions(
|
|
1628
1628
|
withDiffOptions(
|
|
1629
|
-
|
|
1629
|
+
yargs38.positional("directory", {
|
|
1630
1630
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
1631
1631
|
type: "string"
|
|
1632
1632
|
}).option("what-if", {
|
|
@@ -1694,10 +1694,10 @@ var ComponentRemoveModule = {
|
|
|
1694
1694
|
command: "remove <id>",
|
|
1695
1695
|
aliases: ["delete", "rm"],
|
|
1696
1696
|
describe: "Delete a component definition",
|
|
1697
|
-
builder: (
|
|
1697
|
+
builder: (yargs38) => withConfiguration(
|
|
1698
1698
|
withApiOptions(
|
|
1699
1699
|
withProjectOptions(
|
|
1700
|
-
|
|
1700
|
+
yargs38.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
|
|
1701
1701
|
)
|
|
1702
1702
|
)
|
|
1703
1703
|
),
|
|
@@ -1714,10 +1714,10 @@ var ComponentUpdateModule = {
|
|
|
1714
1714
|
command: "update <filename>",
|
|
1715
1715
|
aliases: ["put"],
|
|
1716
1716
|
describe: "Insert or update a component definition",
|
|
1717
|
-
builder: (
|
|
1717
|
+
builder: (yargs38) => withConfiguration(
|
|
1718
1718
|
withApiOptions(
|
|
1719
1719
|
withProjectOptions(
|
|
1720
|
-
|
|
1720
|
+
yargs38.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
1721
1721
|
)
|
|
1722
1722
|
)
|
|
1723
1723
|
),
|
|
@@ -1734,7 +1734,7 @@ var ComponentModule = {
|
|
|
1734
1734
|
command: "component <command>",
|
|
1735
1735
|
aliases: ["def"],
|
|
1736
1736
|
describe: "Commands for Canvas component definitions",
|
|
1737
|
-
builder: (
|
|
1737
|
+
builder: (yargs38) => yargs38.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
1738
1738
|
handler: () => {
|
|
1739
1739
|
yargs3.help();
|
|
1740
1740
|
}
|
|
@@ -1748,13 +1748,13 @@ import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canva
|
|
|
1748
1748
|
var CompositionGetModule = {
|
|
1749
1749
|
command: "get <id>",
|
|
1750
1750
|
describe: "Fetch a composition",
|
|
1751
|
-
builder: (
|
|
1751
|
+
builder: (yargs38) => withFormatOptions(
|
|
1752
1752
|
withConfiguration(
|
|
1753
1753
|
withApiOptions(
|
|
1754
1754
|
withProjectOptions(
|
|
1755
1755
|
withStateOptions(
|
|
1756
1756
|
withVerboseOption(
|
|
1757
|
-
|
|
1757
|
+
yargs38.positional("id", {
|
|
1758
1758
|
demandOption: true,
|
|
1759
1759
|
describe: "Composition/pattern public ID to fetch"
|
|
1760
1760
|
}).option({
|
|
@@ -1845,13 +1845,13 @@ var CompositionListModule = {
|
|
|
1845
1845
|
command: "list",
|
|
1846
1846
|
describe: "List compositions",
|
|
1847
1847
|
aliases: ["ls"],
|
|
1848
|
-
builder: (
|
|
1848
|
+
builder: (yargs38) => withFormatOptions(
|
|
1849
1849
|
withConfiguration(
|
|
1850
1850
|
withApiOptions(
|
|
1851
1851
|
withProjectOptions(
|
|
1852
1852
|
withDebugOptions(
|
|
1853
1853
|
withStateOptions(
|
|
1854
|
-
|
|
1854
|
+
yargs38.options({
|
|
1855
1855
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1856
1856
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
1857
1857
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -1932,12 +1932,12 @@ var CompositionListModule = {
|
|
|
1932
1932
|
var ComponentPatternListModule = {
|
|
1933
1933
|
...CompositionListModule,
|
|
1934
1934
|
describe: "List component patterns",
|
|
1935
|
-
builder: (
|
|
1935
|
+
builder: (yargs38) => withFormatOptions(
|
|
1936
1936
|
withConfiguration(
|
|
1937
1937
|
withApiOptions(
|
|
1938
1938
|
withProjectOptions(
|
|
1939
1939
|
withStateOptions(
|
|
1940
|
-
|
|
1940
|
+
yargs38.options({
|
|
1941
1941
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1942
1942
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
1943
1943
|
resolvePatterns: {
|
|
@@ -2062,12 +2062,12 @@ function createComponentInstanceEngineDataSource({
|
|
|
2062
2062
|
var CompositionPublishModule = {
|
|
2063
2063
|
command: "publish [ids]",
|
|
2064
2064
|
describe: "Publishes composition(s)",
|
|
2065
|
-
builder: (
|
|
2065
|
+
builder: (yargs38) => withConfiguration(
|
|
2066
2066
|
withApiOptions(
|
|
2067
2067
|
withProjectOptions(
|
|
2068
2068
|
withDebugOptions(
|
|
2069
2069
|
withDiffOptions(
|
|
2070
|
-
|
|
2070
|
+
yargs38.positional("ids", {
|
|
2071
2071
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2072
2072
|
type: "string"
|
|
2073
2073
|
}).option("all", {
|
|
@@ -2144,11 +2144,11 @@ var CompositionPublishModule = {
|
|
|
2144
2144
|
var ComponentPatternPublishModule = {
|
|
2145
2145
|
...CompositionPublishModule,
|
|
2146
2146
|
describe: "Publishes component pattern(s)",
|
|
2147
|
-
builder: (
|
|
2147
|
+
builder: (yargs38) => withConfiguration(
|
|
2148
2148
|
withApiOptions(
|
|
2149
2149
|
withProjectOptions(
|
|
2150
2150
|
withDiffOptions(
|
|
2151
|
-
|
|
2151
|
+
yargs38.positional("ids", {
|
|
2152
2152
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2153
2153
|
type: "string"
|
|
2154
2154
|
}).option("all", {
|
|
@@ -2192,13 +2192,13 @@ import { UncachedFileClient as UncachedFileClient3 } from "@uniformdev/files";
|
|
|
2192
2192
|
var CompositionPullModule = {
|
|
2193
2193
|
command: "pull <directory>",
|
|
2194
2194
|
describe: "Pulls all compositions to local files in a directory",
|
|
2195
|
-
builder: (
|
|
2195
|
+
builder: (yargs38) => withConfiguration(
|
|
2196
2196
|
withApiOptions(
|
|
2197
2197
|
withProjectOptions(
|
|
2198
2198
|
withStateOptions(
|
|
2199
2199
|
withDebugOptions(
|
|
2200
2200
|
withDiffOptions(
|
|
2201
|
-
|
|
2201
|
+
yargs38.positional("directory", {
|
|
2202
2202
|
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.",
|
|
2203
2203
|
type: "string"
|
|
2204
2204
|
}).option("format", {
|
|
@@ -2306,12 +2306,12 @@ var CompositionPullModule = {
|
|
|
2306
2306
|
var ComponentPatternPullModule = {
|
|
2307
2307
|
...CompositionPullModule,
|
|
2308
2308
|
describe: "Pulls all component patterns to local files in a directory",
|
|
2309
|
-
builder: (
|
|
2309
|
+
builder: (yargs38) => withConfiguration(
|
|
2310
2310
|
withApiOptions(
|
|
2311
2311
|
withProjectOptions(
|
|
2312
2312
|
withStateOptions(
|
|
2313
2313
|
withDiffOptions(
|
|
2314
|
-
|
|
2314
|
+
yargs38.positional("directory", {
|
|
2315
2315
|
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.",
|
|
2316
2316
|
type: "string"
|
|
2317
2317
|
}).option("format", {
|
|
@@ -2355,13 +2355,13 @@ import { UncachedFileClient as UncachedFileClient4 } from "@uniformdev/files";
|
|
|
2355
2355
|
var CompositionPushModule = {
|
|
2356
2356
|
command: "push <directory>",
|
|
2357
2357
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
2358
|
-
builder: (
|
|
2358
|
+
builder: (yargs38) => withConfiguration(
|
|
2359
2359
|
withApiOptions(
|
|
2360
2360
|
withProjectOptions(
|
|
2361
2361
|
withStateOptions(
|
|
2362
2362
|
withDebugOptions(
|
|
2363
2363
|
withDiffOptions(
|
|
2364
|
-
|
|
2364
|
+
yargs38.positional("directory", {
|
|
2365
2365
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2366
2366
|
type: "string"
|
|
2367
2367
|
}).option("mode", {
|
|
@@ -2457,12 +2457,12 @@ var CompositionPushModule = {
|
|
|
2457
2457
|
var ComponentPatternPushModule = {
|
|
2458
2458
|
...CompositionPushModule,
|
|
2459
2459
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
2460
|
-
builder: (
|
|
2460
|
+
builder: (yargs38) => withConfiguration(
|
|
2461
2461
|
withApiOptions(
|
|
2462
2462
|
withProjectOptions(
|
|
2463
2463
|
withStateOptions(
|
|
2464
2464
|
withDiffOptions(
|
|
2465
|
-
|
|
2465
|
+
yargs38.positional("directory", {
|
|
2466
2466
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
2467
2467
|
type: "string"
|
|
2468
2468
|
}).option("what-if", {
|
|
@@ -2500,11 +2500,11 @@ var CompositionRemoveModule = {
|
|
|
2500
2500
|
command: "remove <id>",
|
|
2501
2501
|
aliases: ["delete", "rm"],
|
|
2502
2502
|
describe: "Delete a composition",
|
|
2503
|
-
builder: (
|
|
2503
|
+
builder: (yargs38) => withConfiguration(
|
|
2504
2504
|
withApiOptions(
|
|
2505
2505
|
withDebugOptions(
|
|
2506
2506
|
withProjectOptions(
|
|
2507
|
-
|
|
2507
|
+
yargs38.positional("id", {
|
|
2508
2508
|
demandOption: true,
|
|
2509
2509
|
describe: "Composition/pattern public ID to delete"
|
|
2510
2510
|
})
|
|
@@ -2537,11 +2537,11 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
2537
2537
|
var CompositionUnpublishModule = {
|
|
2538
2538
|
command: "unpublish [ids]",
|
|
2539
2539
|
describe: "Unpublish a composition(s)",
|
|
2540
|
-
builder: (
|
|
2540
|
+
builder: (yargs38) => withConfiguration(
|
|
2541
2541
|
withApiOptions(
|
|
2542
2542
|
withDebugOptions(
|
|
2543
2543
|
withProjectOptions(
|
|
2544
|
-
|
|
2544
|
+
yargs38.positional("ids", {
|
|
2545
2545
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2546
2546
|
type: "string"
|
|
2547
2547
|
}).option("all", {
|
|
@@ -2636,10 +2636,10 @@ var CompositionUnpublishModule = {
|
|
|
2636
2636
|
var ComponentPatternUnpublishModule = {
|
|
2637
2637
|
command: "unpublish [ids]",
|
|
2638
2638
|
describe: "Unpublish a component pattern(s)",
|
|
2639
|
-
builder: (
|
|
2639
|
+
builder: (yargs38) => withConfiguration(
|
|
2640
2640
|
withApiOptions(
|
|
2641
2641
|
withProjectOptions(
|
|
2642
|
-
|
|
2642
|
+
yargs38.positional("ids", {
|
|
2643
2643
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2644
2644
|
type: "string"
|
|
2645
2645
|
}).option("all", {
|
|
@@ -2678,12 +2678,12 @@ var CompositionUpdateModule = {
|
|
|
2678
2678
|
command: "update <filename>",
|
|
2679
2679
|
aliases: ["put"],
|
|
2680
2680
|
describe: "Insert or update a composition",
|
|
2681
|
-
builder: (
|
|
2681
|
+
builder: (yargs38) => withConfiguration(
|
|
2682
2682
|
withApiOptions(
|
|
2683
2683
|
withProjectOptions(
|
|
2684
2684
|
withVerboseOption(
|
|
2685
2685
|
withStateOptions(
|
|
2686
|
-
|
|
2686
|
+
yargs38.positional("filename", {
|
|
2687
2687
|
demandOption: true,
|
|
2688
2688
|
describe: "Composition/pattern file to put"
|
|
2689
2689
|
})
|
|
@@ -2713,7 +2713,7 @@ var ComponentPatternUpdateModule = {
|
|
|
2713
2713
|
var ComponentPatternModule = {
|
|
2714
2714
|
command: "component-pattern <command>",
|
|
2715
2715
|
describe: "Commands for Canvas component patterns",
|
|
2716
|
-
builder: (
|
|
2716
|
+
builder: (yargs38) => yargs38.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
2717
2717
|
handler: () => {
|
|
2718
2718
|
yargs4.help();
|
|
2719
2719
|
}
|
|
@@ -2725,7 +2725,7 @@ var CompositionModule = {
|
|
|
2725
2725
|
command: "composition <command>",
|
|
2726
2726
|
describe: "Commands for Canvas compositions",
|
|
2727
2727
|
aliases: ["comp"],
|
|
2728
|
-
builder: (
|
|
2728
|
+
builder: (yargs38) => yargs38.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
2729
2729
|
handler: () => {
|
|
2730
2730
|
yargs5.help();
|
|
2731
2731
|
}
|
|
@@ -2744,12 +2744,12 @@ var CompositionPatternGetModule = {
|
|
|
2744
2744
|
var CompositionPatternListModule = {
|
|
2745
2745
|
...CompositionListModule,
|
|
2746
2746
|
describe: "List composition patterns",
|
|
2747
|
-
builder: (
|
|
2747
|
+
builder: (yargs38) => withFormatOptions(
|
|
2748
2748
|
withConfiguration(
|
|
2749
2749
|
withApiOptions(
|
|
2750
2750
|
withProjectOptions(
|
|
2751
2751
|
withStateOptions(
|
|
2752
|
-
|
|
2752
|
+
yargs38.options({
|
|
2753
2753
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2754
2754
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2755
2755
|
resolvePatterns: {
|
|
@@ -2792,11 +2792,11 @@ var CompositionPatternListModule = {
|
|
|
2792
2792
|
var CompositionPatternPublishModule = {
|
|
2793
2793
|
...CompositionPublishModule,
|
|
2794
2794
|
describe: "Publishes composition pattern(s)",
|
|
2795
|
-
builder: (
|
|
2795
|
+
builder: (yargs38) => withConfiguration(
|
|
2796
2796
|
withApiOptions(
|
|
2797
2797
|
withProjectOptions(
|
|
2798
2798
|
withDiffOptions(
|
|
2799
|
-
|
|
2799
|
+
yargs38.positional("ids", {
|
|
2800
2800
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2801
2801
|
type: "string"
|
|
2802
2802
|
}).option("all", {
|
|
@@ -2839,12 +2839,12 @@ var CompositionPatternPublishModule = {
|
|
|
2839
2839
|
var CompositionPatternPullModule = {
|
|
2840
2840
|
...CompositionPullModule,
|
|
2841
2841
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
2842
|
-
builder: (
|
|
2842
|
+
builder: (yargs38) => withConfiguration(
|
|
2843
2843
|
withApiOptions(
|
|
2844
2844
|
withProjectOptions(
|
|
2845
2845
|
withStateOptions(
|
|
2846
2846
|
withDiffOptions(
|
|
2847
|
-
|
|
2847
|
+
yargs38.positional("directory", {
|
|
2848
2848
|
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.",
|
|
2849
2849
|
type: "string"
|
|
2850
2850
|
}).option("format", {
|
|
@@ -2886,12 +2886,12 @@ var CompositionPatternPullModule = {
|
|
|
2886
2886
|
var CompositionPatternPushModule = {
|
|
2887
2887
|
...CompositionPushModule,
|
|
2888
2888
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
2889
|
-
builder: (
|
|
2889
|
+
builder: (yargs38) => withConfiguration(
|
|
2890
2890
|
withApiOptions(
|
|
2891
2891
|
withProjectOptions(
|
|
2892
2892
|
withStateOptions(
|
|
2893
2893
|
withDiffOptions(
|
|
2894
|
-
|
|
2894
|
+
yargs38.positional("directory", {
|
|
2895
2895
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
2896
2896
|
type: "string"
|
|
2897
2897
|
}).option("what-if", {
|
|
@@ -2933,10 +2933,10 @@ var CompositionPatternRemoveModule = {
|
|
|
2933
2933
|
var CompositionPatternUnpublishModule = {
|
|
2934
2934
|
command: "unpublish [ids]",
|
|
2935
2935
|
describe: "Unpublish a composition pattern(s)",
|
|
2936
|
-
builder: (
|
|
2936
|
+
builder: (yargs38) => withConfiguration(
|
|
2937
2937
|
withApiOptions(
|
|
2938
2938
|
withProjectOptions(
|
|
2939
|
-
|
|
2939
|
+
yargs38.positional("ids", {
|
|
2940
2940
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2941
2941
|
type: "string"
|
|
2942
2942
|
}).option("all", {
|
|
@@ -2976,7 +2976,7 @@ var CompositionPatternUpdateModule = {
|
|
|
2976
2976
|
var CompositionPatternModule = {
|
|
2977
2977
|
command: "composition-pattern <command>",
|
|
2978
2978
|
describe: "Commands for Canvas composition patterns",
|
|
2979
|
-
builder: (
|
|
2979
|
+
builder: (yargs38) => yargs38.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
2980
2980
|
handler: () => {
|
|
2981
2981
|
yargs6.help();
|
|
2982
2982
|
}
|
|
@@ -2990,12 +2990,12 @@ import { ContentClient } from "@uniformdev/canvas";
|
|
|
2990
2990
|
var ContentTypeGetModule = {
|
|
2991
2991
|
command: "get <id>",
|
|
2992
2992
|
describe: "Get a content type",
|
|
2993
|
-
builder: (
|
|
2993
|
+
builder: (yargs38) => withConfiguration(
|
|
2994
2994
|
withFormatOptions(
|
|
2995
2995
|
withApiOptions(
|
|
2996
2996
|
withProjectOptions(
|
|
2997
2997
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2998
|
-
|
|
2998
|
+
yargs38.positional("id", { demandOption: true, describe: "Content type public ID to fetch" })
|
|
2999
2999
|
)
|
|
3000
3000
|
)
|
|
3001
3001
|
)
|
|
@@ -3017,7 +3017,7 @@ import { ContentClient as ContentClient2 } from "@uniformdev/canvas";
|
|
|
3017
3017
|
var ContentTypeListModule = {
|
|
3018
3018
|
command: "list",
|
|
3019
3019
|
describe: "List content types",
|
|
3020
|
-
builder: (
|
|
3020
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
3021
3021
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3022
3022
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3023
3023
|
const client = new ContentClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -3065,11 +3065,11 @@ function createContentTypeEngineDataSource({
|
|
|
3065
3065
|
var ContentTypePullModule = {
|
|
3066
3066
|
command: "pull <directory>",
|
|
3067
3067
|
describe: "Pulls all content types to local files in a directory",
|
|
3068
|
-
builder: (
|
|
3068
|
+
builder: (yargs38) => withConfiguration(
|
|
3069
3069
|
withApiOptions(
|
|
3070
3070
|
withProjectOptions(
|
|
3071
3071
|
withDiffOptions(
|
|
3072
|
-
|
|
3072
|
+
yargs38.positional("directory", {
|
|
3073
3073
|
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.",
|
|
3074
3074
|
type: "string"
|
|
3075
3075
|
}).option("format", {
|
|
@@ -3153,11 +3153,11 @@ import { ContentClient as ContentClient4 } from "@uniformdev/canvas";
|
|
|
3153
3153
|
var ContentTypePushModule = {
|
|
3154
3154
|
command: "push <directory>",
|
|
3155
3155
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
3156
|
-
builder: (
|
|
3156
|
+
builder: (yargs38) => withConfiguration(
|
|
3157
3157
|
withApiOptions(
|
|
3158
3158
|
withProjectOptions(
|
|
3159
3159
|
withDiffOptions(
|
|
3160
|
-
|
|
3160
|
+
yargs38.positional("directory", {
|
|
3161
3161
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
3162
3162
|
type: "string"
|
|
3163
3163
|
}).option("what-if", {
|
|
@@ -3230,10 +3230,10 @@ var ContentTypeRemoveModule = {
|
|
|
3230
3230
|
command: "remove <id>",
|
|
3231
3231
|
aliases: ["delete", "rm"],
|
|
3232
3232
|
describe: "Delete a content type",
|
|
3233
|
-
builder: (
|
|
3233
|
+
builder: (yargs38) => withConfiguration(
|
|
3234
3234
|
withApiOptions(
|
|
3235
3235
|
withProjectOptions(
|
|
3236
|
-
|
|
3236
|
+
yargs38.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
3237
3237
|
)
|
|
3238
3238
|
)
|
|
3239
3239
|
),
|
|
@@ -3250,10 +3250,10 @@ var ContentTypeUpdateModule = {
|
|
|
3250
3250
|
command: "update <filename>",
|
|
3251
3251
|
aliases: ["put"],
|
|
3252
3252
|
describe: "Insert or update a content type",
|
|
3253
|
-
builder: (
|
|
3253
|
+
builder: (yargs38) => withConfiguration(
|
|
3254
3254
|
withApiOptions(
|
|
3255
3255
|
withProjectOptions(
|
|
3256
|
-
|
|
3256
|
+
yargs38.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
3257
3257
|
)
|
|
3258
3258
|
)
|
|
3259
3259
|
),
|
|
@@ -3270,7 +3270,7 @@ var ContentTypeModule = {
|
|
|
3270
3270
|
command: "contenttype <command>",
|
|
3271
3271
|
aliases: ["ct"],
|
|
3272
3272
|
describe: "Commands for Content Types",
|
|
3273
|
-
builder: (
|
|
3273
|
+
builder: (yargs38) => yargs38.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
3274
3274
|
handler: () => {
|
|
3275
3275
|
yargs7.help();
|
|
3276
3276
|
}
|
|
@@ -3284,11 +3284,11 @@ import { DataSourceClient } from "@uniformdev/canvas";
|
|
|
3284
3284
|
var DataSourceGetModule = {
|
|
3285
3285
|
command: "get <id>",
|
|
3286
3286
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
3287
|
-
builder: (
|
|
3287
|
+
builder: (yargs38) => withConfiguration(
|
|
3288
3288
|
withApiOptions(
|
|
3289
3289
|
withProjectOptions(
|
|
3290
3290
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3291
|
-
|
|
3291
|
+
yargs38.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
3292
3292
|
)
|
|
3293
3293
|
)
|
|
3294
3294
|
),
|
|
@@ -3306,10 +3306,10 @@ var DataSourceRemoveModule = {
|
|
|
3306
3306
|
command: "remove <id>",
|
|
3307
3307
|
aliases: ["delete", "rm"],
|
|
3308
3308
|
describe: "Delete a data source",
|
|
3309
|
-
builder: (
|
|
3309
|
+
builder: (yargs38) => withConfiguration(
|
|
3310
3310
|
withApiOptions(
|
|
3311
3311
|
withProjectOptions(
|
|
3312
|
-
|
|
3312
|
+
yargs38.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
3313
3313
|
)
|
|
3314
3314
|
)
|
|
3315
3315
|
),
|
|
@@ -3326,10 +3326,10 @@ var DataSourceUpdateModule = {
|
|
|
3326
3326
|
command: "update <dataSource>",
|
|
3327
3327
|
aliases: ["put"],
|
|
3328
3328
|
describe: "Insert or update a data source",
|
|
3329
|
-
builder: (
|
|
3329
|
+
builder: (yargs38) => withConfiguration(
|
|
3330
3330
|
withApiOptions(
|
|
3331
3331
|
withProjectOptions(
|
|
3332
|
-
|
|
3332
|
+
yargs38.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
3333
3333
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
3334
3334
|
type: "string",
|
|
3335
3335
|
demandOption: true
|
|
@@ -3349,7 +3349,7 @@ var DataSourceModule = {
|
|
|
3349
3349
|
command: "datasource <command>",
|
|
3350
3350
|
aliases: ["ds"],
|
|
3351
3351
|
describe: "Commands for Data Source definitions",
|
|
3352
|
-
builder: (
|
|
3352
|
+
builder: (yargs38) => yargs38.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
3353
3353
|
handler: () => {
|
|
3354
3354
|
yargs8.help();
|
|
3355
3355
|
}
|
|
@@ -3364,12 +3364,12 @@ var DataTypeGetModule = {
|
|
|
3364
3364
|
command: "get <id>",
|
|
3365
3365
|
describe: "Get a data type",
|
|
3366
3366
|
aliases: ["ls"],
|
|
3367
|
-
builder: (
|
|
3367
|
+
builder: (yargs38) => withConfiguration(
|
|
3368
3368
|
withFormatOptions(
|
|
3369
3369
|
withApiOptions(
|
|
3370
3370
|
withProjectOptions(
|
|
3371
3371
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3372
|
-
|
|
3372
|
+
yargs38.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
3373
3373
|
)
|
|
3374
3374
|
)
|
|
3375
3375
|
)
|
|
@@ -3392,7 +3392,7 @@ var DataTypeListModule = {
|
|
|
3392
3392
|
command: "list",
|
|
3393
3393
|
describe: "List data types",
|
|
3394
3394
|
aliases: ["ls"],
|
|
3395
|
-
builder: (
|
|
3395
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
3396
3396
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3397
3397
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3398
3398
|
const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -3442,11 +3442,11 @@ function createDataTypeEngineDataSource({
|
|
|
3442
3442
|
var DataTypePullModule = {
|
|
3443
3443
|
command: "pull <directory>",
|
|
3444
3444
|
describe: "Pulls all data types to local files in a directory",
|
|
3445
|
-
builder: (
|
|
3445
|
+
builder: (yargs38) => withConfiguration(
|
|
3446
3446
|
withApiOptions(
|
|
3447
3447
|
withProjectOptions(
|
|
3448
3448
|
withDiffOptions(
|
|
3449
|
-
|
|
3449
|
+
yargs38.positional("directory", {
|
|
3450
3450
|
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.",
|
|
3451
3451
|
type: "string"
|
|
3452
3452
|
}).option("format", {
|
|
@@ -3530,11 +3530,11 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
|
|
|
3530
3530
|
var DataTypePushModule = {
|
|
3531
3531
|
command: "push <directory>",
|
|
3532
3532
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
3533
|
-
builder: (
|
|
3533
|
+
builder: (yargs38) => withConfiguration(
|
|
3534
3534
|
withApiOptions(
|
|
3535
3535
|
withProjectOptions(
|
|
3536
3536
|
withDiffOptions(
|
|
3537
|
-
|
|
3537
|
+
yargs38.positional("directory", {
|
|
3538
3538
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
3539
3539
|
type: "string"
|
|
3540
3540
|
}).option("what-if", {
|
|
@@ -3607,10 +3607,10 @@ var DataTypeRemoveModule = {
|
|
|
3607
3607
|
command: "remove <id>",
|
|
3608
3608
|
aliases: ["delete", "rm"],
|
|
3609
3609
|
describe: "Delete a data type",
|
|
3610
|
-
builder: (
|
|
3610
|
+
builder: (yargs38) => withConfiguration(
|
|
3611
3611
|
withApiOptions(
|
|
3612
3612
|
withProjectOptions(
|
|
3613
|
-
|
|
3613
|
+
yargs38.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
3614
3614
|
)
|
|
3615
3615
|
)
|
|
3616
3616
|
),
|
|
@@ -3627,10 +3627,10 @@ var DataTypeUpdateModule = {
|
|
|
3627
3627
|
command: "update <filename>",
|
|
3628
3628
|
aliases: ["put"],
|
|
3629
3629
|
describe: "Insert or update a data type",
|
|
3630
|
-
builder: (
|
|
3630
|
+
builder: (yargs38) => withConfiguration(
|
|
3631
3631
|
withApiOptions(
|
|
3632
3632
|
withProjectOptions(
|
|
3633
|
-
|
|
3633
|
+
yargs38.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
3634
3634
|
)
|
|
3635
3635
|
)
|
|
3636
3636
|
),
|
|
@@ -3647,7 +3647,7 @@ var DataTypeModule = {
|
|
|
3647
3647
|
command: "datatype <command>",
|
|
3648
3648
|
aliases: ["dt"],
|
|
3649
3649
|
describe: "Commands for Data Type definitions",
|
|
3650
|
-
builder: (
|
|
3650
|
+
builder: (yargs38) => yargs38.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
3651
3651
|
handler: () => {
|
|
3652
3652
|
yargs9.help();
|
|
3653
3653
|
}
|
|
@@ -3661,12 +3661,12 @@ import { ContentClient as ContentClient7 } from "@uniformdev/canvas";
|
|
|
3661
3661
|
var EntryGetModule = {
|
|
3662
3662
|
command: "get <id>",
|
|
3663
3663
|
describe: "Get an entry",
|
|
3664
|
-
builder: (
|
|
3664
|
+
builder: (yargs38) => withConfiguration(
|
|
3665
3665
|
withFormatOptions(
|
|
3666
3666
|
withApiOptions(
|
|
3667
3667
|
withProjectOptions(
|
|
3668
3668
|
withStateOptions(
|
|
3669
|
-
|
|
3669
|
+
yargs38.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
3670
3670
|
resolveData: {
|
|
3671
3671
|
type: "boolean",
|
|
3672
3672
|
default: false,
|
|
@@ -3730,12 +3730,12 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
3730
3730
|
var EntryListModule = {
|
|
3731
3731
|
command: "list",
|
|
3732
3732
|
describe: "List entries",
|
|
3733
|
-
builder: (
|
|
3733
|
+
builder: (yargs38) => withConfiguration(
|
|
3734
3734
|
withFormatOptions(
|
|
3735
3735
|
withApiOptions(
|
|
3736
3736
|
withProjectOptions(
|
|
3737
3737
|
withStateOptions(
|
|
3738
|
-
|
|
3738
|
+
yargs38.options({
|
|
3739
3739
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3740
3740
|
limit: { describe: "Number of rows to fetch", type: "number", default: LEGACY_DEFAULT_LIMIT },
|
|
3741
3741
|
search: { describe: "Search query", type: "string", default: "" }
|
|
@@ -3860,11 +3860,11 @@ function createEntryEngineDataSource({
|
|
|
3860
3860
|
var EntryPublishModule = {
|
|
3861
3861
|
command: "publish [ids]",
|
|
3862
3862
|
describe: "Publishes entry(ies)",
|
|
3863
|
-
builder: (
|
|
3863
|
+
builder: (yargs38) => withConfiguration(
|
|
3864
3864
|
withApiOptions(
|
|
3865
3865
|
withProjectOptions(
|
|
3866
3866
|
withDiffOptions(
|
|
3867
|
-
|
|
3867
|
+
yargs38.positional("ids", {
|
|
3868
3868
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3869
3869
|
type: "string"
|
|
3870
3870
|
}).option("all", {
|
|
@@ -3919,12 +3919,12 @@ import { UncachedFileClient as UncachedFileClient5 } from "@uniformdev/files";
|
|
|
3919
3919
|
var EntryPullModule = {
|
|
3920
3920
|
command: "pull <directory>",
|
|
3921
3921
|
describe: "Pulls all entries to local files in a directory",
|
|
3922
|
-
builder: (
|
|
3922
|
+
builder: (yargs38) => withConfiguration(
|
|
3923
3923
|
withApiOptions(
|
|
3924
3924
|
withProjectOptions(
|
|
3925
3925
|
withStateOptions(
|
|
3926
3926
|
withDiffOptions(
|
|
3927
|
-
|
|
3927
|
+
yargs38.positional("directory", {
|
|
3928
3928
|
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.",
|
|
3929
3929
|
type: "string"
|
|
3930
3930
|
}).option("format", {
|
|
@@ -4024,12 +4024,12 @@ import { UncachedFileClient as UncachedFileClient6 } from "@uniformdev/files";
|
|
|
4024
4024
|
var EntryPushModule = {
|
|
4025
4025
|
command: "push <directory>",
|
|
4026
4026
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
4027
|
-
builder: (
|
|
4027
|
+
builder: (yargs38) => withConfiguration(
|
|
4028
4028
|
withApiOptions(
|
|
4029
4029
|
withProjectOptions(
|
|
4030
4030
|
withStateOptions(
|
|
4031
4031
|
withDiffOptions(
|
|
4032
|
-
|
|
4032
|
+
yargs38.positional("directory", {
|
|
4033
4033
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
4034
4034
|
type: "string"
|
|
4035
4035
|
}).option("what-if", {
|
|
@@ -4116,10 +4116,10 @@ var EntryRemoveModule = {
|
|
|
4116
4116
|
command: "remove <id>",
|
|
4117
4117
|
aliases: ["delete", "rm"],
|
|
4118
4118
|
describe: "Delete an entry",
|
|
4119
|
-
builder: (
|
|
4119
|
+
builder: (yargs38) => withConfiguration(
|
|
4120
4120
|
withApiOptions(
|
|
4121
4121
|
withProjectOptions(
|
|
4122
|
-
|
|
4122
|
+
yargs38.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
4123
4123
|
)
|
|
4124
4124
|
)
|
|
4125
4125
|
),
|
|
@@ -4136,10 +4136,10 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
4136
4136
|
var EntryUnpublishModule = {
|
|
4137
4137
|
command: "unpublish [ids]",
|
|
4138
4138
|
describe: "Unpublish an entry(ies)",
|
|
4139
|
-
builder: (
|
|
4139
|
+
builder: (yargs38) => withConfiguration(
|
|
4140
4140
|
withApiOptions(
|
|
4141
4141
|
withProjectOptions(
|
|
4142
|
-
|
|
4142
|
+
yargs38.positional("ids", {
|
|
4143
4143
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4144
4144
|
type: "string"
|
|
4145
4145
|
}).option("all", {
|
|
@@ -4212,11 +4212,11 @@ var EntryUpdateModule = {
|
|
|
4212
4212
|
command: "update <filename>",
|
|
4213
4213
|
aliases: ["put"],
|
|
4214
4214
|
describe: "Insert or update an entry",
|
|
4215
|
-
builder: (
|
|
4215
|
+
builder: (yargs38) => withConfiguration(
|
|
4216
4216
|
withApiOptions(
|
|
4217
4217
|
withProjectOptions(
|
|
4218
4218
|
withStateOptions(
|
|
4219
|
-
|
|
4219
|
+
yargs38.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
4220
4220
|
)
|
|
4221
4221
|
)
|
|
4222
4222
|
)
|
|
@@ -4233,7 +4233,7 @@ var EntryUpdateModule = {
|
|
|
4233
4233
|
var EntryModule = {
|
|
4234
4234
|
command: "entry <command>",
|
|
4235
4235
|
describe: "Commands for Entries",
|
|
4236
|
-
builder: (
|
|
4236
|
+
builder: (yargs38) => yargs38.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
4237
4237
|
handler: () => {
|
|
4238
4238
|
yargs10.help();
|
|
4239
4239
|
}
|
|
@@ -4247,12 +4247,12 @@ import { ContentClient as ContentClient16 } from "@uniformdev/canvas";
|
|
|
4247
4247
|
var EntryPatternGetModule = {
|
|
4248
4248
|
command: "get <id>",
|
|
4249
4249
|
describe: "Get an entry pattern",
|
|
4250
|
-
builder: (
|
|
4250
|
+
builder: (yargs38) => withConfiguration(
|
|
4251
4251
|
withFormatOptions(
|
|
4252
4252
|
withApiOptions(
|
|
4253
4253
|
withProjectOptions(
|
|
4254
4254
|
withStateOptions(
|
|
4255
|
-
|
|
4255
|
+
yargs38.positional("id", {
|
|
4256
4256
|
demandOption: true,
|
|
4257
4257
|
describe: "Entry pattern public ID to fetch"
|
|
4258
4258
|
}),
|
|
@@ -4287,8 +4287,8 @@ import { ContentClient as ContentClient17 } from "@uniformdev/canvas";
|
|
|
4287
4287
|
var EntryPatternListModule = {
|
|
4288
4288
|
command: "list",
|
|
4289
4289
|
describe: "List entry patterns",
|
|
4290
|
-
builder: (
|
|
4291
|
-
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(
|
|
4290
|
+
builder: (yargs38) => withConfiguration(
|
|
4291
|
+
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(yargs38, "published"))))
|
|
4292
4292
|
),
|
|
4293
4293
|
handler: async ({ apiHost, edgeApiHost, apiKey, proxy, format, filename, project: projectId, state }) => {
|
|
4294
4294
|
const fetch3 = nodeFetchProxy(proxy);
|
|
@@ -4311,11 +4311,11 @@ import { ContentClient as ContentClient18 } from "@uniformdev/canvas";
|
|
|
4311
4311
|
var EntryPatternPublishModule = {
|
|
4312
4312
|
command: "publish [ids]",
|
|
4313
4313
|
describe: "Publishes entry pattern(s)",
|
|
4314
|
-
builder: (
|
|
4314
|
+
builder: (yargs38) => withConfiguration(
|
|
4315
4315
|
withApiOptions(
|
|
4316
4316
|
withProjectOptions(
|
|
4317
4317
|
withDiffOptions(
|
|
4318
|
-
|
|
4318
|
+
yargs38.positional("ids", {
|
|
4319
4319
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4320
4320
|
type: "string"
|
|
4321
4321
|
}).option("all", {
|
|
@@ -4370,12 +4370,12 @@ import { UncachedFileClient as UncachedFileClient7 } from "@uniformdev/files";
|
|
|
4370
4370
|
var EntryPatternPullModule = {
|
|
4371
4371
|
command: "pull <directory>",
|
|
4372
4372
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
4373
|
-
builder: (
|
|
4373
|
+
builder: (yargs38) => withConfiguration(
|
|
4374
4374
|
withApiOptions(
|
|
4375
4375
|
withProjectOptions(
|
|
4376
4376
|
withStateOptions(
|
|
4377
4377
|
withDiffOptions(
|
|
4378
|
-
|
|
4378
|
+
yargs38.positional("directory", {
|
|
4379
4379
|
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.",
|
|
4380
4380
|
type: "string"
|
|
4381
4381
|
}).option("format", {
|
|
@@ -4475,12 +4475,12 @@ import { UncachedFileClient as UncachedFileClient8 } from "@uniformdev/files";
|
|
|
4475
4475
|
var EntryPatternPushModule = {
|
|
4476
4476
|
command: "push <directory>",
|
|
4477
4477
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
4478
|
-
builder: (
|
|
4478
|
+
builder: (yargs38) => withConfiguration(
|
|
4479
4479
|
withApiOptions(
|
|
4480
4480
|
withProjectOptions(
|
|
4481
4481
|
withStateOptions(
|
|
4482
4482
|
withDiffOptions(
|
|
4483
|
-
|
|
4483
|
+
yargs38.positional("directory", {
|
|
4484
4484
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
4485
4485
|
type: "string"
|
|
4486
4486
|
}).option("what-if", {
|
|
@@ -4567,10 +4567,10 @@ var EntryPatternRemoveModule = {
|
|
|
4567
4567
|
command: "remove <id>",
|
|
4568
4568
|
aliases: ["delete", "rm"],
|
|
4569
4569
|
describe: "Delete an entry pattern",
|
|
4570
|
-
builder: (
|
|
4570
|
+
builder: (yargs38) => withConfiguration(
|
|
4571
4571
|
withApiOptions(
|
|
4572
4572
|
withProjectOptions(
|
|
4573
|
-
|
|
4573
|
+
yargs38.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
4574
4574
|
)
|
|
4575
4575
|
)
|
|
4576
4576
|
),
|
|
@@ -4587,10 +4587,10 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
4587
4587
|
var EntryPatternUnpublishModule = {
|
|
4588
4588
|
command: "unpublish [ids]",
|
|
4589
4589
|
describe: "Unpublish an entry patterns",
|
|
4590
|
-
builder: (
|
|
4590
|
+
builder: (yargs38) => withConfiguration(
|
|
4591
4591
|
withApiOptions(
|
|
4592
4592
|
withProjectOptions(
|
|
4593
|
-
|
|
4593
|
+
yargs38.positional("ids", {
|
|
4594
4594
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4595
4595
|
type: "string"
|
|
4596
4596
|
}).option("all", {
|
|
@@ -4663,11 +4663,11 @@ var EntryPatternUpdateModule = {
|
|
|
4663
4663
|
command: "update <filename>",
|
|
4664
4664
|
aliases: ["put"],
|
|
4665
4665
|
describe: "Insert or update an entry pattern",
|
|
4666
|
-
builder: (
|
|
4666
|
+
builder: (yargs38) => withConfiguration(
|
|
4667
4667
|
withApiOptions(
|
|
4668
4668
|
withProjectOptions(
|
|
4669
4669
|
withStateOptions(
|
|
4670
|
-
|
|
4670
|
+
yargs38.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
4671
4671
|
)
|
|
4672
4672
|
)
|
|
4673
4673
|
)
|
|
@@ -4684,7 +4684,7 @@ var EntryPatternUpdateModule = {
|
|
|
4684
4684
|
var EntryPatternModule = {
|
|
4685
4685
|
command: "entry-pattern <command>",
|
|
4686
4686
|
describe: "Commands for Entry patterns",
|
|
4687
|
-
builder: (
|
|
4687
|
+
builder: (yargs38) => yargs38.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
4688
4688
|
handler: () => {
|
|
4689
4689
|
yargs11.help();
|
|
4690
4690
|
}
|
|
@@ -4730,11 +4730,11 @@ function createLocaleEngineDataSource({
|
|
|
4730
4730
|
var LocalePullModule = {
|
|
4731
4731
|
command: "pull <directory>",
|
|
4732
4732
|
describe: "Pulls all locales to local files in a directory",
|
|
4733
|
-
builder: (
|
|
4733
|
+
builder: (yargs38) => withConfiguration(
|
|
4734
4734
|
withApiOptions(
|
|
4735
4735
|
withProjectOptions(
|
|
4736
4736
|
withDiffOptions(
|
|
4737
|
-
|
|
4737
|
+
yargs38.positional("directory", {
|
|
4738
4738
|
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.",
|
|
4739
4739
|
type: "string"
|
|
4740
4740
|
}).option("format", {
|
|
@@ -4818,11 +4818,11 @@ import { LocaleClient as LocaleClient2 } from "@uniformdev/canvas";
|
|
|
4818
4818
|
var LocalePushModule = {
|
|
4819
4819
|
command: "push <directory>",
|
|
4820
4820
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
4821
|
-
builder: (
|
|
4821
|
+
builder: (yargs38) => withConfiguration(
|
|
4822
4822
|
withApiOptions(
|
|
4823
4823
|
withProjectOptions(
|
|
4824
4824
|
withDiffOptions(
|
|
4825
|
-
|
|
4825
|
+
yargs38.positional("directory", {
|
|
4826
4826
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
4827
4827
|
type: "string"
|
|
4828
4828
|
}).option("what-if", {
|
|
@@ -4893,7 +4893,7 @@ var LocalePushModule = {
|
|
|
4893
4893
|
var LocaleModule = {
|
|
4894
4894
|
command: "locale <command>",
|
|
4895
4895
|
describe: "Commands for locale definitions",
|
|
4896
|
-
builder: (
|
|
4896
|
+
builder: (yargs38) => yargs38.command(LocalePullModule).command(LocalePushModule),
|
|
4897
4897
|
handler: () => {
|
|
4898
4898
|
yargs12.help();
|
|
4899
4899
|
}
|
|
@@ -4912,12 +4912,12 @@ var PatternGetModule = {
|
|
|
4912
4912
|
var PatternListModule = {
|
|
4913
4913
|
...CompositionListModule,
|
|
4914
4914
|
describe: "List patterns",
|
|
4915
|
-
builder: (
|
|
4915
|
+
builder: (yargs38) => withFormatOptions(
|
|
4916
4916
|
withConfiguration(
|
|
4917
4917
|
withApiOptions(
|
|
4918
4918
|
withProjectOptions(
|
|
4919
4919
|
withStateOptions(
|
|
4920
|
-
|
|
4920
|
+
yargs38.options({
|
|
4921
4921
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4922
4922
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4923
4923
|
resolvePatterns: {
|
|
@@ -4955,11 +4955,11 @@ var PatternListModule = {
|
|
|
4955
4955
|
var PatternPublishModule = {
|
|
4956
4956
|
...CompositionPublishModule,
|
|
4957
4957
|
describe: "Publishes pattern(s)",
|
|
4958
|
-
builder: (
|
|
4958
|
+
builder: (yargs38) => withConfiguration(
|
|
4959
4959
|
withApiOptions(
|
|
4960
4960
|
withProjectOptions(
|
|
4961
4961
|
withDiffOptions(
|
|
4962
|
-
|
|
4962
|
+
yargs38.positional("ids", {
|
|
4963
4963
|
describe: "Publishes pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4964
4964
|
type: "string"
|
|
4965
4965
|
}).option("all", {
|
|
@@ -4997,12 +4997,12 @@ var PatternPublishModule = {
|
|
|
4997
4997
|
var PatternPullModule = {
|
|
4998
4998
|
...CompositionPullModule,
|
|
4999
4999
|
describe: "Pulls all patterns to local files in a directory",
|
|
5000
|
-
builder: (
|
|
5000
|
+
builder: (yargs38) => withConfiguration(
|
|
5001
5001
|
withApiOptions(
|
|
5002
5002
|
withProjectOptions(
|
|
5003
5003
|
withStateOptions(
|
|
5004
5004
|
withDiffOptions(
|
|
5005
|
-
|
|
5005
|
+
yargs38.positional("directory", {
|
|
5006
5006
|
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.",
|
|
5007
5007
|
type: "string"
|
|
5008
5008
|
}).option("format", {
|
|
@@ -5040,12 +5040,12 @@ var PatternPullModule = {
|
|
|
5040
5040
|
var PatternPushModule = {
|
|
5041
5041
|
...CompositionPushModule,
|
|
5042
5042
|
describe: "Pushes all patterns from files in a directory to Uniform Canvas",
|
|
5043
|
-
builder: (
|
|
5043
|
+
builder: (yargs38) => withConfiguration(
|
|
5044
5044
|
withApiOptions(
|
|
5045
5045
|
withProjectOptions(
|
|
5046
5046
|
withStateOptions(
|
|
5047
5047
|
withDiffOptions(
|
|
5048
|
-
|
|
5048
|
+
yargs38.positional("directory", {
|
|
5049
5049
|
describe: "Directory to read the patterns from. If a filename is used, a package will be read instead.",
|
|
5050
5050
|
type: "string"
|
|
5051
5051
|
}).option("what-if", {
|
|
@@ -5087,10 +5087,10 @@ var PatternRemoveModule = {
|
|
|
5087
5087
|
var PatternUnpublishModule = {
|
|
5088
5088
|
command: "unpublish [ids]",
|
|
5089
5089
|
describe: "Unpublish a pattern(s)",
|
|
5090
|
-
builder: (
|
|
5090
|
+
builder: (yargs38) => withConfiguration(
|
|
5091
5091
|
withApiOptions(
|
|
5092
5092
|
withProjectOptions(
|
|
5093
|
-
|
|
5093
|
+
yargs38.positional("ids", {
|
|
5094
5094
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5095
5095
|
type: "string"
|
|
5096
5096
|
}).option("all", {
|
|
@@ -5130,74 +5130,76 @@ var PatternModule = {
|
|
|
5130
5130
|
command: "pattern <command>",
|
|
5131
5131
|
describe: "Commands for Canvas patterns",
|
|
5132
5132
|
deprecated: 'will be removed in a future major release. Use "component-pattern" and "composition-pattern" instead.',
|
|
5133
|
-
builder: (
|
|
5133
|
+
builder: (yargs38) => yargs38.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
|
|
5134
5134
|
handler: () => {
|
|
5135
5135
|
yargs13.help();
|
|
5136
5136
|
}
|
|
5137
5137
|
};
|
|
5138
5138
|
|
|
5139
|
-
// src/commands/canvas/commands/
|
|
5139
|
+
// src/commands/canvas/commands/previewUrl.ts
|
|
5140
5140
|
import yargs14 from "yargs";
|
|
5141
5141
|
|
|
5142
|
-
// src/commands/canvas/commands/
|
|
5143
|
-
import {
|
|
5144
|
-
var
|
|
5142
|
+
// src/commands/canvas/commands/previewUrl/get.ts
|
|
5143
|
+
import { PreviewClient } from "@uniformdev/canvas";
|
|
5144
|
+
var PreviewUrlGetModule = {
|
|
5145
5145
|
command: "get <id>",
|
|
5146
|
-
describe: "
|
|
5147
|
-
builder: (
|
|
5146
|
+
describe: "Fetch a preview URL",
|
|
5147
|
+
builder: (yargs38) => withConfiguration(
|
|
5148
5148
|
withFormatOptions(
|
|
5149
5149
|
withApiOptions(
|
|
5150
5150
|
withProjectOptions(
|
|
5151
|
-
|
|
5152
|
-
yargs36.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
5151
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
5153
5152
|
)
|
|
5154
5153
|
)
|
|
5155
5154
|
)
|
|
5156
5155
|
),
|
|
5157
|
-
handler: async ({ apiHost, apiKey, proxy, id, format,
|
|
5156
|
+
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
5158
5157
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5159
|
-
const client = new
|
|
5160
|
-
const
|
|
5161
|
-
if (!
|
|
5162
|
-
|
|
5158
|
+
const client = new PreviewClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5159
|
+
const previewUrl = await client.getPreviewUrl({ id });
|
|
5160
|
+
if (!previewUrl) {
|
|
5161
|
+
console.error("Preview URL did not exist");
|
|
5162
|
+
process.exit(1);
|
|
5163
|
+
} else {
|
|
5164
|
+
emitWithFormat(previewUrl, format, filename);
|
|
5163
5165
|
}
|
|
5164
|
-
emitWithFormat(res, format, filename);
|
|
5165
5166
|
}
|
|
5166
5167
|
};
|
|
5167
5168
|
|
|
5168
|
-
// src/commands/canvas/commands/
|
|
5169
|
-
import {
|
|
5170
|
-
var
|
|
5169
|
+
// src/commands/canvas/commands/previewUrl/list.ts
|
|
5170
|
+
import { PreviewClient as PreviewClient2 } from "@uniformdev/canvas";
|
|
5171
|
+
var PreviewUrlListModule = {
|
|
5171
5172
|
command: "list",
|
|
5172
|
-
describe: "List
|
|
5173
|
-
|
|
5173
|
+
describe: "List preview URLs",
|
|
5174
|
+
aliases: ["ls"],
|
|
5175
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38.options({}))))),
|
|
5174
5176
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5175
5177
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5176
|
-
const client = new
|
|
5177
|
-
const res = await client.
|
|
5178
|
-
emitWithFormat(res, format, filename);
|
|
5178
|
+
const client = new PreviewClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5179
|
+
const res = await client.getPreviewUrls();
|
|
5180
|
+
emitWithFormat(res.previewUrls, format, filename);
|
|
5179
5181
|
}
|
|
5180
5182
|
};
|
|
5181
5183
|
|
|
5182
|
-
// src/commands/canvas/commands/
|
|
5183
|
-
import {
|
|
5184
|
+
// src/commands/canvas/commands/previewUrl/pull.ts
|
|
5185
|
+
import { PreviewClient as PreviewClient3 } from "@uniformdev/canvas";
|
|
5184
5186
|
|
|
5185
|
-
// src/commands/canvas/commands/
|
|
5186
|
-
var
|
|
5187
|
-
var
|
|
5187
|
+
// src/commands/canvas/commands/previewUrl/_util.ts
|
|
5188
|
+
var selectIdentifier5 = (previewUrl) => previewUrl.id;
|
|
5189
|
+
var selectDisplayName5 = (previewUrl) => `${previewUrl.name} (pid: ${previewUrl.id})`;
|
|
5188
5190
|
|
|
5189
|
-
// src/commands/canvas/
|
|
5190
|
-
function
|
|
5191
|
+
// src/commands/canvas/previewUrlEngineDataSource.ts
|
|
5192
|
+
function createPreviewUrlEngineDataSource({
|
|
5191
5193
|
client
|
|
5192
5194
|
}) {
|
|
5193
5195
|
async function* getObjects() {
|
|
5194
|
-
const
|
|
5195
|
-
for await (const
|
|
5196
|
+
const previewUrls = (await client.getPreviewUrls()).previewUrls;
|
|
5197
|
+
for await (const previewUrl of previewUrls) {
|
|
5196
5198
|
const result = {
|
|
5197
|
-
id:
|
|
5198
|
-
displayName:
|
|
5199
|
-
providerId:
|
|
5200
|
-
object:
|
|
5199
|
+
id: selectIdentifier5(previewUrl),
|
|
5200
|
+
displayName: selectDisplayName5(previewUrl),
|
|
5201
|
+
providerId: previewUrl.id,
|
|
5202
|
+
object: previewUrl
|
|
5201
5203
|
};
|
|
5202
5204
|
yield result;
|
|
5203
5205
|
}
|
|
@@ -5206,45 +5208,43 @@ function createPromptEngineDataSource({
|
|
|
5206
5208
|
name: "Uniform API",
|
|
5207
5209
|
objects: getObjects(),
|
|
5208
5210
|
deleteObject: async (providerId) => {
|
|
5209
|
-
await client.
|
|
5211
|
+
await client.deletePreviewUrl({ id: providerId });
|
|
5210
5212
|
},
|
|
5211
|
-
writeObject: async (
|
|
5212
|
-
await client.
|
|
5213
|
+
writeObject: async (object) => {
|
|
5214
|
+
await client.upsertPreviewUrl(object.object);
|
|
5213
5215
|
}
|
|
5214
5216
|
};
|
|
5215
5217
|
}
|
|
5216
5218
|
|
|
5217
|
-
// src/commands/canvas/commands/
|
|
5218
|
-
var
|
|
5219
|
+
// src/commands/canvas/commands/previewUrl/pull.ts
|
|
5220
|
+
var PreviewUrlPullModule = {
|
|
5219
5221
|
command: "pull <directory>",
|
|
5220
|
-
describe: "Pulls all
|
|
5221
|
-
builder: (
|
|
5222
|
+
describe: "Pulls all preview urls to local files in a directory",
|
|
5223
|
+
builder: (yargs38) => withConfiguration(
|
|
5222
5224
|
withApiOptions(
|
|
5223
5225
|
withProjectOptions(
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
})
|
|
5247
|
-
)
|
|
5226
|
+
withDiffOptions(
|
|
5227
|
+
yargs38.positional("directory", {
|
|
5228
|
+
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.",
|
|
5229
|
+
type: "string"
|
|
5230
|
+
}).option("format", {
|
|
5231
|
+
alias: ["f"],
|
|
5232
|
+
describe: "Output format",
|
|
5233
|
+
default: "yaml",
|
|
5234
|
+
choices: ["yaml", "json"],
|
|
5235
|
+
type: "string"
|
|
5236
|
+
}).option("what-if", {
|
|
5237
|
+
alias: ["w"],
|
|
5238
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
5239
|
+
default: false,
|
|
5240
|
+
type: "boolean"
|
|
5241
|
+
}).option("mode", {
|
|
5242
|
+
alias: ["m"],
|
|
5243
|
+
describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
|
|
5244
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
5245
|
+
default: "mirror",
|
|
5246
|
+
type: "string"
|
|
5247
|
+
})
|
|
5248
5248
|
)
|
|
5249
5249
|
)
|
|
5250
5250
|
)
|
|
@@ -5262,33 +5262,27 @@ var PromptPullModule = {
|
|
|
5262
5262
|
allowEmptySource
|
|
5263
5263
|
}) => {
|
|
5264
5264
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5265
|
-
const client = new
|
|
5266
|
-
|
|
5267
|
-
apiHost,
|
|
5268
|
-
fetch: fetch3,
|
|
5269
|
-
projectId,
|
|
5270
|
-
bypassCache: true
|
|
5271
|
-
});
|
|
5272
|
-
const source = createPromptEngineDataSource({ client });
|
|
5265
|
+
const client = new PreviewClient3({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5266
|
+
const source = createPreviewUrlEngineDataSource({ client });
|
|
5273
5267
|
let target;
|
|
5274
5268
|
const isPackage = isPathAPackageFile(directory);
|
|
5275
5269
|
if (isPackage) {
|
|
5276
5270
|
const packageContents = readCanvasPackage(directory, false);
|
|
5277
5271
|
target = await createArraySyncEngineDataSource({
|
|
5278
5272
|
name: `Package file ${directory}`,
|
|
5279
|
-
objects: packageContents.
|
|
5280
|
-
selectIdentifier:
|
|
5281
|
-
selectDisplayName:
|
|
5273
|
+
objects: packageContents.previewUrls ?? [],
|
|
5274
|
+
selectIdentifier: selectIdentifier5,
|
|
5275
|
+
selectDisplayName: selectDisplayName5,
|
|
5282
5276
|
onSyncComplete: async (_, synced) => {
|
|
5283
|
-
packageContents.
|
|
5277
|
+
packageContents.previewUrls = synced;
|
|
5284
5278
|
writeCanvasPackage(directory, packageContents);
|
|
5285
5279
|
}
|
|
5286
5280
|
});
|
|
5287
5281
|
} else {
|
|
5288
5282
|
target = await createFileSyncEngineDataSource({
|
|
5289
5283
|
directory,
|
|
5290
|
-
selectIdentifier:
|
|
5291
|
-
selectDisplayName:
|
|
5284
|
+
selectIdentifier: selectIdentifier5,
|
|
5285
|
+
selectDisplayName: selectDisplayName5,
|
|
5292
5286
|
format
|
|
5293
5287
|
});
|
|
5294
5288
|
}
|
|
@@ -5303,32 +5297,30 @@ var PromptPullModule = {
|
|
|
5303
5297
|
}
|
|
5304
5298
|
};
|
|
5305
5299
|
|
|
5306
|
-
// src/commands/canvas/commands/
|
|
5307
|
-
import {
|
|
5308
|
-
var
|
|
5300
|
+
// src/commands/canvas/commands/previewUrl/push.ts
|
|
5301
|
+
import { PreviewClient as PreviewClient4 } from "@uniformdev/canvas";
|
|
5302
|
+
var PreviewUrlPushModule = {
|
|
5309
5303
|
command: "push <directory>",
|
|
5310
|
-
describe: "Pushes all
|
|
5311
|
-
builder: (
|
|
5304
|
+
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
5305
|
+
builder: (yargs38) => withConfiguration(
|
|
5312
5306
|
withApiOptions(
|
|
5313
5307
|
withProjectOptions(
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
})
|
|
5331
|
-
)
|
|
5308
|
+
withDiffOptions(
|
|
5309
|
+
yargs38.positional("directory", {
|
|
5310
|
+
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
5311
|
+
type: "string"
|
|
5312
|
+
}).option("what-if", {
|
|
5313
|
+
alias: ["w"],
|
|
5314
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
5315
|
+
default: false,
|
|
5316
|
+
type: "boolean"
|
|
5317
|
+
}).option("mode", {
|
|
5318
|
+
alias: ["m"],
|
|
5319
|
+
describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
|
|
5320
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
5321
|
+
default: "mirror",
|
|
5322
|
+
type: "string"
|
|
5323
|
+
})
|
|
5332
5324
|
)
|
|
5333
5325
|
)
|
|
5334
5326
|
)
|
|
@@ -5345,31 +5337,25 @@ var PromptPushModule = {
|
|
|
5345
5337
|
allowEmptySource
|
|
5346
5338
|
}) => {
|
|
5347
5339
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5348
|
-
const client = new
|
|
5349
|
-
apiKey,
|
|
5350
|
-
apiHost,
|
|
5351
|
-
fetch: fetch3,
|
|
5352
|
-
projectId,
|
|
5353
|
-
bypassCache: true
|
|
5354
|
-
});
|
|
5340
|
+
const client = new PreviewClient4({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5355
5341
|
let source;
|
|
5356
5342
|
const isPackage = isPathAPackageFile(directory);
|
|
5357
5343
|
if (isPackage) {
|
|
5358
5344
|
const packageContents = readCanvasPackage(directory, true);
|
|
5359
5345
|
source = await createArraySyncEngineDataSource({
|
|
5360
5346
|
name: `Package file ${directory}`,
|
|
5361
|
-
objects: packageContents.
|
|
5362
|
-
selectIdentifier:
|
|
5363
|
-
selectDisplayName:
|
|
5347
|
+
objects: packageContents.previewUrls ?? [],
|
|
5348
|
+
selectIdentifier: selectIdentifier5,
|
|
5349
|
+
selectDisplayName: selectDisplayName5
|
|
5364
5350
|
});
|
|
5365
5351
|
} else {
|
|
5366
5352
|
source = await createFileSyncEngineDataSource({
|
|
5367
5353
|
directory,
|
|
5368
|
-
selectIdentifier:
|
|
5369
|
-
selectDisplayName:
|
|
5354
|
+
selectIdentifier: selectIdentifier5,
|
|
5355
|
+
selectDisplayName: selectDisplayName5
|
|
5370
5356
|
});
|
|
5371
5357
|
}
|
|
5372
|
-
const target =
|
|
5358
|
+
const target = createPreviewUrlEngineDataSource({ client });
|
|
5373
5359
|
await syncEngine({
|
|
5374
5360
|
source,
|
|
5375
5361
|
target,
|
|
@@ -5381,81 +5367,122 @@ var PromptPushModule = {
|
|
|
5381
5367
|
}
|
|
5382
5368
|
};
|
|
5383
5369
|
|
|
5384
|
-
// src/commands/canvas/commands/
|
|
5385
|
-
import {
|
|
5386
|
-
var
|
|
5370
|
+
// src/commands/canvas/commands/previewUrl/remove.ts
|
|
5371
|
+
import { PreviewClient as PreviewClient5 } from "@uniformdev/canvas";
|
|
5372
|
+
var PreviewUrlRemoveModule = {
|
|
5387
5373
|
command: "remove <id>",
|
|
5388
5374
|
aliases: ["delete", "rm"],
|
|
5389
|
-
describe: "Delete a
|
|
5390
|
-
builder: (
|
|
5375
|
+
describe: "Delete a preview URL",
|
|
5376
|
+
builder: (yargs38) => withConfiguration(
|
|
5391
5377
|
withApiOptions(
|
|
5392
|
-
withProjectOptions(
|
|
5378
|
+
withProjectOptions(
|
|
5379
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
5380
|
+
)
|
|
5393
5381
|
)
|
|
5394
5382
|
),
|
|
5395
5383
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
5396
5384
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5397
|
-
const client = new
|
|
5398
|
-
await client.
|
|
5385
|
+
const client = new PreviewClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5386
|
+
await client.deletePreviewUrl({ id });
|
|
5399
5387
|
}
|
|
5400
5388
|
};
|
|
5401
5389
|
|
|
5402
|
-
// src/commands/canvas/commands/
|
|
5403
|
-
import {
|
|
5404
|
-
var
|
|
5390
|
+
// src/commands/canvas/commands/previewUrl/update.ts
|
|
5391
|
+
import { PreviewClient as PreviewClient6 } from "@uniformdev/canvas";
|
|
5392
|
+
var PreviewUrlUpdateModule = {
|
|
5405
5393
|
command: "update <filename>",
|
|
5406
5394
|
aliases: ["put"],
|
|
5407
|
-
describe: "Insert or update a
|
|
5408
|
-
builder: (
|
|
5395
|
+
describe: "Insert or update a preview URL",
|
|
5396
|
+
builder: (yargs38) => withConfiguration(
|
|
5409
5397
|
withApiOptions(
|
|
5410
5398
|
withProjectOptions(
|
|
5411
|
-
|
|
5399
|
+
yargs38.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
5412
5400
|
)
|
|
5413
5401
|
)
|
|
5414
5402
|
),
|
|
5415
5403
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
5416
5404
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5417
|
-
const client = new
|
|
5405
|
+
const client = new PreviewClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5418
5406
|
const file = readFileToObject(filename);
|
|
5419
|
-
await client.
|
|
5407
|
+
await client.upsertPreviewUrl(file);
|
|
5420
5408
|
}
|
|
5421
5409
|
};
|
|
5422
5410
|
|
|
5423
|
-
// src/commands/canvas/commands/
|
|
5424
|
-
var
|
|
5425
|
-
command: "
|
|
5426
|
-
aliases: ["
|
|
5427
|
-
describe: "Commands for
|
|
5428
|
-
builder: (
|
|
5411
|
+
// src/commands/canvas/commands/previewUrl.ts
|
|
5412
|
+
var PreviewUrlModule = {
|
|
5413
|
+
command: "preview-url <command>",
|
|
5414
|
+
aliases: ["pu"],
|
|
5415
|
+
describe: "Commands for Canvas preview urls",
|
|
5416
|
+
builder: (yargs38) => yargs38.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
5429
5417
|
handler: () => {
|
|
5430
5418
|
yargs14.help();
|
|
5431
5419
|
}
|
|
5432
5420
|
};
|
|
5433
5421
|
|
|
5434
|
-
// src/commands/canvas/commands/
|
|
5422
|
+
// src/commands/canvas/commands/previewViewport.ts
|
|
5435
5423
|
import yargs15 from "yargs";
|
|
5436
5424
|
|
|
5437
|
-
// src/commands/canvas/commands/
|
|
5438
|
-
import {
|
|
5425
|
+
// src/commands/canvas/commands/previewViewport/get.ts
|
|
5426
|
+
import { PreviewClient as PreviewClient7 } from "@uniformdev/canvas";
|
|
5427
|
+
var PreviewViewportGetModule = {
|
|
5428
|
+
command: "get <id>",
|
|
5429
|
+
describe: "Fetch a preview viewport",
|
|
5430
|
+
builder: (yargs38) => withConfiguration(
|
|
5431
|
+
withFormatOptions(
|
|
5432
|
+
withApiOptions(
|
|
5433
|
+
withProjectOptions(
|
|
5434
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
5435
|
+
)
|
|
5436
|
+
)
|
|
5437
|
+
)
|
|
5438
|
+
),
|
|
5439
|
+
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
5440
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5441
|
+
const client = new PreviewClient7({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5442
|
+
const previewViewport = await client.getPreviewViewport({ id });
|
|
5443
|
+
if (!previewViewport) {
|
|
5444
|
+
console.error("Preview viewport did not exist");
|
|
5445
|
+
process.exit(1);
|
|
5446
|
+
} else {
|
|
5447
|
+
emitWithFormat(previewViewport, format, filename);
|
|
5448
|
+
}
|
|
5449
|
+
}
|
|
5450
|
+
};
|
|
5439
5451
|
|
|
5440
|
-
// src/commands/canvas/commands/
|
|
5441
|
-
|
|
5442
|
-
var
|
|
5452
|
+
// src/commands/canvas/commands/previewViewport/list.ts
|
|
5453
|
+
import { PreviewClient as PreviewClient8 } from "@uniformdev/canvas";
|
|
5454
|
+
var PreviewViewportListModule = {
|
|
5455
|
+
command: "list",
|
|
5456
|
+
describe: "List preview viewports",
|
|
5457
|
+
aliases: ["ls"],
|
|
5458
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38.options({}))))),
|
|
5459
|
+
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5460
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5461
|
+
const client = new PreviewClient8({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5462
|
+
const res = await client.getPreviewViewports();
|
|
5463
|
+
emitWithFormat(res.previewViewports, format, filename);
|
|
5464
|
+
}
|
|
5465
|
+
};
|
|
5443
5466
|
|
|
5444
|
-
// src/commands/canvas/
|
|
5445
|
-
|
|
5467
|
+
// src/commands/canvas/commands/previewViewport/pull.ts
|
|
5468
|
+
import { PreviewClient as PreviewClient9 } from "@uniformdev/canvas";
|
|
5469
|
+
|
|
5470
|
+
// src/commands/canvas/commands/previewViewport/_util.ts
|
|
5471
|
+
var selectIdentifier6 = (previewViewport) => previewViewport.id;
|
|
5472
|
+
var selectDisplayName6 = (previewViewport) => `${previewViewport.name} (pid: ${previewViewport.id})`;
|
|
5473
|
+
|
|
5474
|
+
// src/commands/canvas/previewViewportEngineDataSource.ts
|
|
5475
|
+
function createPreviewViewportEngineDataSource({
|
|
5446
5476
|
client
|
|
5447
5477
|
}) {
|
|
5448
5478
|
async function* getObjects() {
|
|
5449
|
-
const
|
|
5450
|
-
|
|
5451
|
-
});
|
|
5452
|
-
for await (const workflow of workflows) {
|
|
5453
|
-
const { modified, modifiedBy, created, createdBy, ...workflowWithoutStatistics } = workflow;
|
|
5479
|
+
const previewViewports = (await client.getPreviewViewports()).previewViewports;
|
|
5480
|
+
for await (const previewViewport of previewViewports) {
|
|
5454
5481
|
const result = {
|
|
5455
|
-
id:
|
|
5456
|
-
displayName:
|
|
5457
|
-
providerId:
|
|
5458
|
-
object:
|
|
5482
|
+
id: selectIdentifier6(previewViewport),
|
|
5483
|
+
displayName: selectDisplayName6(previewViewport),
|
|
5484
|
+
providerId: previewViewport.id,
|
|
5485
|
+
object: previewViewport
|
|
5459
5486
|
};
|
|
5460
5487
|
yield result;
|
|
5461
5488
|
}
|
|
@@ -5464,23 +5491,23 @@ function createWorkflowEngineDataSource({
|
|
|
5464
5491
|
name: "Uniform API",
|
|
5465
5492
|
objects: getObjects(),
|
|
5466
5493
|
deleteObject: async (providerId) => {
|
|
5467
|
-
await client.
|
|
5494
|
+
await client.deletePreviewViewport({ id: providerId });
|
|
5468
5495
|
},
|
|
5469
5496
|
writeObject: async (object) => {
|
|
5470
|
-
await client.
|
|
5497
|
+
await client.upsertPreviewViewport(object.object);
|
|
5471
5498
|
}
|
|
5472
5499
|
};
|
|
5473
5500
|
}
|
|
5474
5501
|
|
|
5475
|
-
// src/commands/canvas/commands/
|
|
5476
|
-
var
|
|
5502
|
+
// src/commands/canvas/commands/previewViewport/pull.ts
|
|
5503
|
+
var PreviewViewportPullModule = {
|
|
5477
5504
|
command: "pull <directory>",
|
|
5478
|
-
describe: "Pulls all
|
|
5479
|
-
builder: (
|
|
5505
|
+
describe: "Pulls all preview viewports to local files in a directory",
|
|
5506
|
+
builder: (yargs38) => withConfiguration(
|
|
5480
5507
|
withApiOptions(
|
|
5481
5508
|
withProjectOptions(
|
|
5482
5509
|
withDiffOptions(
|
|
5483
|
-
|
|
5510
|
+
yargs38.positional("directory", {
|
|
5484
5511
|
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.",
|
|
5485
5512
|
type: "string"
|
|
5486
5513
|
}).option("format", {
|
|
@@ -5518,27 +5545,27 @@ var WorkflowPullModule = {
|
|
|
5518
5545
|
allowEmptySource
|
|
5519
5546
|
}) => {
|
|
5520
5547
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5521
|
-
const client = new
|
|
5522
|
-
const source =
|
|
5548
|
+
const client = new PreviewClient9({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5549
|
+
const source = createPreviewViewportEngineDataSource({ client });
|
|
5523
5550
|
let target;
|
|
5524
5551
|
const isPackage = isPathAPackageFile(directory);
|
|
5525
5552
|
if (isPackage) {
|
|
5526
5553
|
const packageContents = readCanvasPackage(directory, false);
|
|
5527
5554
|
target = await createArraySyncEngineDataSource({
|
|
5528
5555
|
name: `Package file ${directory}`,
|
|
5529
|
-
objects: packageContents.
|
|
5530
|
-
selectIdentifier:
|
|
5531
|
-
selectDisplayName:
|
|
5556
|
+
objects: packageContents.previewViewports ?? [],
|
|
5557
|
+
selectIdentifier: selectIdentifier6,
|
|
5558
|
+
selectDisplayName: selectDisplayName6,
|
|
5532
5559
|
onSyncComplete: async (_, synced) => {
|
|
5533
|
-
packageContents.
|
|
5560
|
+
packageContents.previewViewports = synced;
|
|
5534
5561
|
writeCanvasPackage(directory, packageContents);
|
|
5535
5562
|
}
|
|
5536
5563
|
});
|
|
5537
5564
|
} else {
|
|
5538
5565
|
target = await createFileSyncEngineDataSource({
|
|
5539
5566
|
directory,
|
|
5540
|
-
selectIdentifier:
|
|
5541
|
-
selectDisplayName:
|
|
5567
|
+
selectIdentifier: selectIdentifier6,
|
|
5568
|
+
selectDisplayName: selectDisplayName6,
|
|
5542
5569
|
format
|
|
5543
5570
|
});
|
|
5544
5571
|
}
|
|
@@ -5553,16 +5580,16 @@ var WorkflowPullModule = {
|
|
|
5553
5580
|
}
|
|
5554
5581
|
};
|
|
5555
5582
|
|
|
5556
|
-
// src/commands/canvas/commands/
|
|
5557
|
-
import {
|
|
5558
|
-
var
|
|
5583
|
+
// src/commands/canvas/commands/previewViewport/push.ts
|
|
5584
|
+
import { PreviewClient as PreviewClient10 } from "@uniformdev/canvas";
|
|
5585
|
+
var PreviewViewportPushModule = {
|
|
5559
5586
|
command: "push <directory>",
|
|
5560
|
-
describe: "Pushes all
|
|
5561
|
-
builder: (
|
|
5587
|
+
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
5588
|
+
builder: (yargs38) => withConfiguration(
|
|
5562
5589
|
withApiOptions(
|
|
5563
5590
|
withProjectOptions(
|
|
5564
5591
|
withDiffOptions(
|
|
5565
|
-
|
|
5592
|
+
yargs38.positional("directory", {
|
|
5566
5593
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
5567
5594
|
type: "string"
|
|
5568
5595
|
}).option("what-if", {
|
|
@@ -5593,25 +5620,25 @@ var WorkflowPushModule = {
|
|
|
5593
5620
|
allowEmptySource
|
|
5594
5621
|
}) => {
|
|
5595
5622
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5596
|
-
const client = new
|
|
5623
|
+
const client = new PreviewClient10({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5597
5624
|
let source;
|
|
5598
5625
|
const isPackage = isPathAPackageFile(directory);
|
|
5599
5626
|
if (isPackage) {
|
|
5600
5627
|
const packageContents = readCanvasPackage(directory, true);
|
|
5601
5628
|
source = await createArraySyncEngineDataSource({
|
|
5602
5629
|
name: `Package file ${directory}`,
|
|
5603
|
-
objects: packageContents.
|
|
5604
|
-
selectIdentifier:
|
|
5605
|
-
selectDisplayName:
|
|
5630
|
+
objects: packageContents.previewViewports ?? [],
|
|
5631
|
+
selectIdentifier: selectIdentifier6,
|
|
5632
|
+
selectDisplayName: selectDisplayName6
|
|
5606
5633
|
});
|
|
5607
5634
|
} else {
|
|
5608
5635
|
source = await createFileSyncEngineDataSource({
|
|
5609
5636
|
directory,
|
|
5610
|
-
selectIdentifier:
|
|
5611
|
-
selectDisplayName:
|
|
5637
|
+
selectIdentifier: selectIdentifier6,
|
|
5638
|
+
selectDisplayName: selectDisplayName6
|
|
5612
5639
|
});
|
|
5613
5640
|
}
|
|
5614
|
-
const target =
|
|
5641
|
+
const target = createPreviewViewportEngineDataSource({ client });
|
|
5615
5642
|
await syncEngine({
|
|
5616
5643
|
source,
|
|
5617
5644
|
target,
|
|
@@ -5623,15 +5650,554 @@ var WorkflowPushModule = {
|
|
|
5623
5650
|
}
|
|
5624
5651
|
};
|
|
5625
5652
|
|
|
5626
|
-
// src/commands/canvas/commands/
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5653
|
+
// src/commands/canvas/commands/previewViewport/remove.ts
|
|
5654
|
+
import { PreviewClient as PreviewClient11 } from "@uniformdev/canvas";
|
|
5655
|
+
var PreviewViewportRemoveModule = {
|
|
5656
|
+
command: "remove <id>",
|
|
5657
|
+
aliases: ["delete", "rm"],
|
|
5658
|
+
describe: "Delete a preview viewport",
|
|
5659
|
+
builder: (yargs38) => withConfiguration(
|
|
5660
|
+
withApiOptions(
|
|
5661
|
+
withProjectOptions(
|
|
5662
|
+
yargs38.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
5663
|
+
)
|
|
5664
|
+
)
|
|
5665
|
+
),
|
|
5666
|
+
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
5667
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5668
|
+
const client = new PreviewClient11({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5669
|
+
await client.deletePreviewViewport({ id });
|
|
5670
|
+
}
|
|
5671
|
+
};
|
|
5672
|
+
|
|
5673
|
+
// src/commands/canvas/commands/previewViewport/update.ts
|
|
5674
|
+
import { PreviewClient as PreviewClient12 } from "@uniformdev/canvas";
|
|
5675
|
+
var PreviewViewportUpdateModule = {
|
|
5676
|
+
command: "update <filename>",
|
|
5677
|
+
aliases: ["put"],
|
|
5678
|
+
describe: "Insert or update a preview viewport",
|
|
5679
|
+
builder: (yargs38) => withConfiguration(
|
|
5680
|
+
withApiOptions(
|
|
5681
|
+
withProjectOptions(
|
|
5682
|
+
yargs38.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
5683
|
+
)
|
|
5684
|
+
)
|
|
5685
|
+
),
|
|
5686
|
+
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
5687
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5688
|
+
const client = new PreviewClient12({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5689
|
+
const file = readFileToObject(filename);
|
|
5690
|
+
await client.upsertPreviewViewport(file);
|
|
5691
|
+
}
|
|
5692
|
+
};
|
|
5693
|
+
|
|
5694
|
+
// src/commands/canvas/commands/previewViewport.ts
|
|
5695
|
+
var PreviewViewportModule = {
|
|
5696
|
+
command: "preview-viewport <command>",
|
|
5697
|
+
aliases: ["pv"],
|
|
5698
|
+
describe: "Commands for Canvas preview viewports",
|
|
5699
|
+
builder: (yargs38) => yargs38.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
5700
|
+
handler: () => {
|
|
5701
|
+
yargs15.help();
|
|
5702
|
+
}
|
|
5703
|
+
};
|
|
5704
|
+
|
|
5705
|
+
// src/commands/canvas/commands/prompts.ts
|
|
5706
|
+
import yargs16 from "yargs";
|
|
5707
|
+
|
|
5708
|
+
// src/commands/canvas/commands/prompts/get.ts
|
|
5709
|
+
import { PromptClient } from "@uniformdev/canvas";
|
|
5710
|
+
var PromptGetModule = {
|
|
5711
|
+
command: "get <id>",
|
|
5712
|
+
describe: "Get a prompt",
|
|
5713
|
+
builder: (yargs38) => withConfiguration(
|
|
5714
|
+
withFormatOptions(
|
|
5715
|
+
withApiOptions(
|
|
5716
|
+
withProjectOptions(
|
|
5717
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5718
|
+
yargs38.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
5719
|
+
)
|
|
5720
|
+
)
|
|
5721
|
+
)
|
|
5722
|
+
),
|
|
5723
|
+
handler: async ({ apiHost, apiKey, proxy, id, format, filename, project: projectId }) => {
|
|
5724
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5725
|
+
const client = new PromptClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5726
|
+
const res = await client.get({ promptId: id });
|
|
5727
|
+
if (!res) {
|
|
5728
|
+
throw new Error(`Prompt with ID ${id} not found`);
|
|
5729
|
+
}
|
|
5730
|
+
emitWithFormat(res, format, filename);
|
|
5731
|
+
}
|
|
5732
|
+
};
|
|
5733
|
+
|
|
5734
|
+
// src/commands/canvas/commands/prompts/list.ts
|
|
5735
|
+
import { PromptClient as PromptClient2 } from "@uniformdev/canvas";
|
|
5736
|
+
var PromptListModule = {
|
|
5737
|
+
command: "list",
|
|
5738
|
+
describe: "List prompts",
|
|
5739
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
5740
|
+
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5741
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5742
|
+
const client = new PromptClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5743
|
+
const res = await client.get();
|
|
5744
|
+
emitWithFormat(res, format, filename);
|
|
5745
|
+
}
|
|
5746
|
+
};
|
|
5747
|
+
|
|
5748
|
+
// src/commands/canvas/commands/prompts/pull.ts
|
|
5749
|
+
import { PromptClient as PromptClient3 } from "@uniformdev/canvas";
|
|
5750
|
+
|
|
5751
|
+
// src/commands/canvas/commands/prompts/_util.ts
|
|
5752
|
+
var selectPromptIdentifier = (e) => e.id;
|
|
5753
|
+
var selectPromptDisplayName = (e) => `${e.name ?? "Untitled"} (pid: ${e.id})`;
|
|
5754
|
+
|
|
5755
|
+
// src/commands/canvas/promptEngineDataSource.ts
|
|
5756
|
+
function createPromptEngineDataSource({
|
|
5757
|
+
client
|
|
5758
|
+
}) {
|
|
5759
|
+
async function* getObjects() {
|
|
5760
|
+
const prompts = await client.get();
|
|
5761
|
+
for await (const prompt of prompts) {
|
|
5762
|
+
const result = {
|
|
5763
|
+
id: selectPromptIdentifier(prompt),
|
|
5764
|
+
displayName: selectPromptDisplayName(prompt),
|
|
5765
|
+
providerId: prompt.id,
|
|
5766
|
+
object: prompt
|
|
5767
|
+
};
|
|
5768
|
+
yield result;
|
|
5769
|
+
}
|
|
5770
|
+
}
|
|
5771
|
+
return {
|
|
5772
|
+
name: "Uniform API",
|
|
5773
|
+
objects: getObjects(),
|
|
5774
|
+
deleteObject: async (providerId) => {
|
|
5775
|
+
await client.remove({ promptId: providerId });
|
|
5776
|
+
},
|
|
5777
|
+
writeObject: async ({ object }) => {
|
|
5778
|
+
await client.upsert({ data: object });
|
|
5779
|
+
}
|
|
5780
|
+
};
|
|
5781
|
+
}
|
|
5782
|
+
|
|
5783
|
+
// src/commands/canvas/commands/prompts/pull.ts
|
|
5784
|
+
var PromptPullModule = {
|
|
5785
|
+
command: "pull <directory>",
|
|
5786
|
+
describe: "Pulls all prompts to local files in a directory",
|
|
5787
|
+
builder: (yargs38) => withConfiguration(
|
|
5788
|
+
withApiOptions(
|
|
5789
|
+
withProjectOptions(
|
|
5790
|
+
withStateOptions(
|
|
5791
|
+
withDiffOptions(
|
|
5792
|
+
yargs38.positional("directory", {
|
|
5793
|
+
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.",
|
|
5794
|
+
type: "string"
|
|
5795
|
+
}).option("format", {
|
|
5796
|
+
alias: ["f"],
|
|
5797
|
+
describe: "Output format",
|
|
5798
|
+
default: "yaml",
|
|
5799
|
+
choices: ["yaml", "json"],
|
|
5800
|
+
type: "string"
|
|
5801
|
+
}).option("what-if", {
|
|
5802
|
+
alias: ["w"],
|
|
5803
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
5804
|
+
default: false,
|
|
5805
|
+
type: "boolean"
|
|
5806
|
+
}).option("mode", {
|
|
5807
|
+
alias: ["m"],
|
|
5808
|
+
describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
|
|
5809
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
5810
|
+
default: "mirror",
|
|
5811
|
+
type: "string"
|
|
5812
|
+
})
|
|
5813
|
+
)
|
|
5814
|
+
)
|
|
5815
|
+
)
|
|
5816
|
+
)
|
|
5817
|
+
),
|
|
5818
|
+
handler: async ({
|
|
5819
|
+
apiHost,
|
|
5820
|
+
apiKey,
|
|
5821
|
+
proxy,
|
|
5822
|
+
directory,
|
|
5823
|
+
format,
|
|
5824
|
+
mode,
|
|
5825
|
+
whatIf,
|
|
5826
|
+
project: projectId,
|
|
5827
|
+
diff: diffMode,
|
|
5828
|
+
allowEmptySource
|
|
5829
|
+
}) => {
|
|
5830
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5831
|
+
const client = new PromptClient3({
|
|
5832
|
+
apiKey,
|
|
5833
|
+
apiHost,
|
|
5834
|
+
fetch: fetch3,
|
|
5835
|
+
projectId,
|
|
5836
|
+
bypassCache: true
|
|
5837
|
+
});
|
|
5838
|
+
const source = createPromptEngineDataSource({ client });
|
|
5839
|
+
let target;
|
|
5840
|
+
const isPackage = isPathAPackageFile(directory);
|
|
5841
|
+
if (isPackage) {
|
|
5842
|
+
const packageContents = readCanvasPackage(directory, false);
|
|
5843
|
+
target = await createArraySyncEngineDataSource({
|
|
5844
|
+
name: `Package file ${directory}`,
|
|
5845
|
+
objects: packageContents.prompts ?? [],
|
|
5846
|
+
selectIdentifier: selectPromptIdentifier,
|
|
5847
|
+
selectDisplayName: selectPromptDisplayName,
|
|
5848
|
+
onSyncComplete: async (_, synced) => {
|
|
5849
|
+
packageContents.prompts = synced;
|
|
5850
|
+
writeCanvasPackage(directory, packageContents);
|
|
5851
|
+
}
|
|
5852
|
+
});
|
|
5853
|
+
} else {
|
|
5854
|
+
target = await createFileSyncEngineDataSource({
|
|
5855
|
+
directory,
|
|
5856
|
+
selectIdentifier: selectPromptIdentifier,
|
|
5857
|
+
selectDisplayName: selectPromptDisplayName,
|
|
5858
|
+
format
|
|
5859
|
+
});
|
|
5860
|
+
}
|
|
5861
|
+
await syncEngine({
|
|
5862
|
+
source,
|
|
5863
|
+
target,
|
|
5864
|
+
mode,
|
|
5865
|
+
whatIf,
|
|
5866
|
+
allowEmptySource: allowEmptySource ?? true,
|
|
5867
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
5868
|
+
});
|
|
5869
|
+
}
|
|
5870
|
+
};
|
|
5871
|
+
|
|
5872
|
+
// src/commands/canvas/commands/prompts/push.ts
|
|
5873
|
+
import { PromptClient as PromptClient4 } from "@uniformdev/canvas";
|
|
5874
|
+
var PromptPushModule = {
|
|
5875
|
+
command: "push <directory>",
|
|
5876
|
+
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
5877
|
+
builder: (yargs38) => withConfiguration(
|
|
5878
|
+
withApiOptions(
|
|
5879
|
+
withProjectOptions(
|
|
5880
|
+
withStateOptions(
|
|
5881
|
+
withDiffOptions(
|
|
5882
|
+
yargs38.positional("directory", {
|
|
5883
|
+
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
5884
|
+
type: "string"
|
|
5885
|
+
}).option("what-if", {
|
|
5886
|
+
alias: ["w"],
|
|
5887
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
5888
|
+
default: false,
|
|
5889
|
+
type: "boolean"
|
|
5890
|
+
}).option("mode", {
|
|
5891
|
+
alias: ["m"],
|
|
5892
|
+
describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
|
|
5893
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
5894
|
+
default: "mirror",
|
|
5895
|
+
type: "string"
|
|
5896
|
+
})
|
|
5897
|
+
)
|
|
5898
|
+
)
|
|
5899
|
+
)
|
|
5900
|
+
)
|
|
5901
|
+
),
|
|
5902
|
+
handler: async ({
|
|
5903
|
+
apiHost,
|
|
5904
|
+
apiKey,
|
|
5905
|
+
proxy,
|
|
5906
|
+
directory,
|
|
5907
|
+
mode,
|
|
5908
|
+
whatIf,
|
|
5909
|
+
project: projectId,
|
|
5910
|
+
diff: diffMode,
|
|
5911
|
+
allowEmptySource
|
|
5912
|
+
}) => {
|
|
5913
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5914
|
+
const client = new PromptClient4({
|
|
5915
|
+
apiKey,
|
|
5916
|
+
apiHost,
|
|
5917
|
+
fetch: fetch3,
|
|
5918
|
+
projectId,
|
|
5919
|
+
bypassCache: true
|
|
5920
|
+
});
|
|
5921
|
+
let source;
|
|
5922
|
+
const isPackage = isPathAPackageFile(directory);
|
|
5923
|
+
if (isPackage) {
|
|
5924
|
+
const packageContents = readCanvasPackage(directory, true);
|
|
5925
|
+
source = await createArraySyncEngineDataSource({
|
|
5926
|
+
name: `Package file ${directory}`,
|
|
5927
|
+
objects: packageContents.prompts ?? [],
|
|
5928
|
+
selectIdentifier: selectPromptIdentifier,
|
|
5929
|
+
selectDisplayName: selectPromptDisplayName
|
|
5930
|
+
});
|
|
5931
|
+
} else {
|
|
5932
|
+
source = await createFileSyncEngineDataSource({
|
|
5933
|
+
directory,
|
|
5934
|
+
selectIdentifier: selectPromptIdentifier,
|
|
5935
|
+
selectDisplayName: selectPromptDisplayName
|
|
5936
|
+
});
|
|
5937
|
+
}
|
|
5938
|
+
const target = createPromptEngineDataSource({ client });
|
|
5939
|
+
await syncEngine({
|
|
5940
|
+
source,
|
|
5941
|
+
target,
|
|
5942
|
+
mode,
|
|
5943
|
+
whatIf,
|
|
5944
|
+
allowEmptySource,
|
|
5945
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
5946
|
+
});
|
|
5947
|
+
}
|
|
5948
|
+
};
|
|
5949
|
+
|
|
5950
|
+
// src/commands/canvas/commands/prompts/remove.ts
|
|
5951
|
+
import { PromptClient as PromptClient5 } from "@uniformdev/canvas";
|
|
5952
|
+
var PromptRemoveModule = {
|
|
5953
|
+
command: "remove <id>",
|
|
5954
|
+
aliases: ["delete", "rm"],
|
|
5955
|
+
describe: "Delete a prompt",
|
|
5956
|
+
builder: (yargs38) => withConfiguration(
|
|
5957
|
+
withApiOptions(
|
|
5958
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
5959
|
+
)
|
|
5960
|
+
),
|
|
5961
|
+
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
5962
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5963
|
+
const client = new PromptClient5({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5964
|
+
await client.remove({ promptId: id });
|
|
5965
|
+
}
|
|
5966
|
+
};
|
|
5967
|
+
|
|
5968
|
+
// src/commands/canvas/commands/prompts/update.ts
|
|
5969
|
+
import { PromptClient as PromptClient6 } from "@uniformdev/canvas";
|
|
5970
|
+
var PromptUpdateModule = {
|
|
5971
|
+
command: "update <filename>",
|
|
5972
|
+
aliases: ["put"],
|
|
5973
|
+
describe: "Insert or update a prompt",
|
|
5974
|
+
builder: (yargs38) => withConfiguration(
|
|
5975
|
+
withApiOptions(
|
|
5976
|
+
withProjectOptions(
|
|
5977
|
+
yargs38.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
5978
|
+
)
|
|
5979
|
+
)
|
|
5980
|
+
),
|
|
5981
|
+
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
5982
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
5983
|
+
const client = new PromptClient6({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
5984
|
+
const file = readFileToObject(filename);
|
|
5985
|
+
await client.upsert({ data: file });
|
|
5986
|
+
}
|
|
5987
|
+
};
|
|
5988
|
+
|
|
5989
|
+
// src/commands/canvas/commands/prompts.ts
|
|
5990
|
+
var PromptModule = {
|
|
5991
|
+
command: "prompt <command>",
|
|
5992
|
+
aliases: ["dt"],
|
|
5993
|
+
describe: "Commands for AI Prompt definitions",
|
|
5994
|
+
builder: (yargs38) => yargs38.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
5995
|
+
handler: () => {
|
|
5996
|
+
yargs16.help();
|
|
5997
|
+
}
|
|
5998
|
+
};
|
|
5999
|
+
|
|
6000
|
+
// src/commands/canvas/commands/workflow.ts
|
|
6001
|
+
import yargs17 from "yargs";
|
|
6002
|
+
|
|
6003
|
+
// src/commands/canvas/commands/workflow/pull.ts
|
|
6004
|
+
import { WorkflowClient } from "@uniformdev/canvas";
|
|
6005
|
+
|
|
6006
|
+
// src/commands/canvas/commands/workflow/_util.ts
|
|
6007
|
+
var selectIdentifier7 = (workflow) => workflow.id;
|
|
6008
|
+
var selectDisplayName7 = (workflow) => `${workflow.name} (pid: ${workflow.id})`;
|
|
6009
|
+
|
|
6010
|
+
// src/commands/canvas/workflowEngineDataSource.ts
|
|
6011
|
+
function createWorkflowEngineDataSource({
|
|
6012
|
+
client
|
|
6013
|
+
}) {
|
|
6014
|
+
async function* getObjects() {
|
|
6015
|
+
const workflows = paginateAsync(async () => (await client.get()).results, {
|
|
6016
|
+
pageSize: 100
|
|
6017
|
+
});
|
|
6018
|
+
for await (const workflow of workflows) {
|
|
6019
|
+
const { modified, modifiedBy, created, createdBy, ...workflowWithoutStatistics } = workflow;
|
|
6020
|
+
const result = {
|
|
6021
|
+
id: selectIdentifier7(workflow),
|
|
6022
|
+
displayName: selectDisplayName7(workflow),
|
|
6023
|
+
providerId: workflow.id,
|
|
6024
|
+
object: workflowWithoutStatistics
|
|
6025
|
+
};
|
|
6026
|
+
yield result;
|
|
6027
|
+
}
|
|
6028
|
+
}
|
|
6029
|
+
return {
|
|
6030
|
+
name: "Uniform API",
|
|
6031
|
+
objects: getObjects(),
|
|
6032
|
+
deleteObject: async (providerId) => {
|
|
6033
|
+
await client.remove({ workflowId: providerId });
|
|
6034
|
+
},
|
|
6035
|
+
writeObject: async (object) => {
|
|
6036
|
+
await client.upsert({ workflow: object.object });
|
|
6037
|
+
}
|
|
6038
|
+
};
|
|
6039
|
+
}
|
|
6040
|
+
|
|
6041
|
+
// src/commands/canvas/commands/workflow/pull.ts
|
|
6042
|
+
var WorkflowPullModule = {
|
|
6043
|
+
command: "pull <directory>",
|
|
6044
|
+
describe: "Pulls all workflows to local files in a directory",
|
|
6045
|
+
builder: (yargs38) => withConfiguration(
|
|
6046
|
+
withApiOptions(
|
|
6047
|
+
withProjectOptions(
|
|
6048
|
+
withDiffOptions(
|
|
6049
|
+
yargs38.positional("directory", {
|
|
6050
|
+
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.",
|
|
6051
|
+
type: "string"
|
|
6052
|
+
}).option("format", {
|
|
6053
|
+
alias: ["f"],
|
|
6054
|
+
describe: "Output format",
|
|
6055
|
+
default: "yaml",
|
|
6056
|
+
choices: ["yaml", "json"],
|
|
6057
|
+
type: "string"
|
|
6058
|
+
}).option("what-if", {
|
|
6059
|
+
alias: ["w"],
|
|
6060
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
6061
|
+
default: false,
|
|
6062
|
+
type: "boolean"
|
|
6063
|
+
}).option("mode", {
|
|
6064
|
+
alias: ["m"],
|
|
6065
|
+
describe: 'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
|
|
6066
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
6067
|
+
default: "mirror",
|
|
6068
|
+
type: "string"
|
|
6069
|
+
})
|
|
6070
|
+
)
|
|
6071
|
+
)
|
|
6072
|
+
)
|
|
6073
|
+
),
|
|
6074
|
+
handler: async ({
|
|
6075
|
+
apiHost,
|
|
6076
|
+
apiKey,
|
|
6077
|
+
proxy,
|
|
6078
|
+
directory,
|
|
6079
|
+
format,
|
|
6080
|
+
mode,
|
|
6081
|
+
whatIf,
|
|
6082
|
+
project: projectId,
|
|
6083
|
+
diff: diffMode,
|
|
6084
|
+
allowEmptySource
|
|
6085
|
+
}) => {
|
|
6086
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6087
|
+
const client = new WorkflowClient({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
6088
|
+
const source = createWorkflowEngineDataSource({ client });
|
|
6089
|
+
let target;
|
|
6090
|
+
const isPackage = isPathAPackageFile(directory);
|
|
6091
|
+
if (isPackage) {
|
|
6092
|
+
const packageContents = readCanvasPackage(directory, false);
|
|
6093
|
+
target = await createArraySyncEngineDataSource({
|
|
6094
|
+
name: `Package file ${directory}`,
|
|
6095
|
+
objects: packageContents.workflows ?? [],
|
|
6096
|
+
selectIdentifier: selectIdentifier7,
|
|
6097
|
+
selectDisplayName: selectDisplayName7,
|
|
6098
|
+
onSyncComplete: async (_, synced) => {
|
|
6099
|
+
packageContents.workflows = synced;
|
|
6100
|
+
writeCanvasPackage(directory, packageContents);
|
|
6101
|
+
}
|
|
6102
|
+
});
|
|
6103
|
+
} else {
|
|
6104
|
+
target = await createFileSyncEngineDataSource({
|
|
6105
|
+
directory,
|
|
6106
|
+
selectIdentifier: selectIdentifier7,
|
|
6107
|
+
selectDisplayName: selectDisplayName7,
|
|
6108
|
+
format
|
|
6109
|
+
});
|
|
6110
|
+
}
|
|
6111
|
+
await syncEngine({
|
|
6112
|
+
source,
|
|
6113
|
+
target,
|
|
6114
|
+
mode,
|
|
6115
|
+
whatIf,
|
|
6116
|
+
allowEmptySource: allowEmptySource ?? true,
|
|
6117
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
6118
|
+
});
|
|
6119
|
+
}
|
|
6120
|
+
};
|
|
6121
|
+
|
|
6122
|
+
// src/commands/canvas/commands/workflow/push.ts
|
|
6123
|
+
import { WorkflowClient as WorkflowClient2 } from "@uniformdev/canvas";
|
|
6124
|
+
var WorkflowPushModule = {
|
|
6125
|
+
command: "push <directory>",
|
|
6126
|
+
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
6127
|
+
builder: (yargs38) => withConfiguration(
|
|
6128
|
+
withApiOptions(
|
|
6129
|
+
withProjectOptions(
|
|
6130
|
+
withDiffOptions(
|
|
6131
|
+
yargs38.positional("directory", {
|
|
6132
|
+
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
6133
|
+
type: "string"
|
|
6134
|
+
}).option("what-if", {
|
|
6135
|
+
alias: ["w"],
|
|
6136
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
6137
|
+
default: false,
|
|
6138
|
+
type: "boolean"
|
|
6139
|
+
}).option("mode", {
|
|
6140
|
+
alias: ["m"],
|
|
6141
|
+
describe: 'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',
|
|
6142
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
6143
|
+
default: "mirror",
|
|
6144
|
+
type: "string"
|
|
6145
|
+
})
|
|
6146
|
+
)
|
|
6147
|
+
)
|
|
6148
|
+
)
|
|
6149
|
+
),
|
|
6150
|
+
handler: async ({
|
|
6151
|
+
apiHost,
|
|
6152
|
+
apiKey,
|
|
6153
|
+
proxy,
|
|
6154
|
+
directory,
|
|
6155
|
+
mode,
|
|
6156
|
+
whatIf,
|
|
6157
|
+
project: projectId,
|
|
6158
|
+
diff: diffMode,
|
|
6159
|
+
allowEmptySource
|
|
6160
|
+
}) => {
|
|
6161
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
6162
|
+
const client = new WorkflowClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
6163
|
+
let source;
|
|
6164
|
+
const isPackage = isPathAPackageFile(directory);
|
|
6165
|
+
if (isPackage) {
|
|
6166
|
+
const packageContents = readCanvasPackage(directory, true);
|
|
6167
|
+
source = await createArraySyncEngineDataSource({
|
|
6168
|
+
name: `Package file ${directory}`,
|
|
6169
|
+
objects: packageContents.workflows ?? [],
|
|
6170
|
+
selectIdentifier: selectIdentifier7,
|
|
6171
|
+
selectDisplayName: selectDisplayName7
|
|
6172
|
+
});
|
|
6173
|
+
} else {
|
|
6174
|
+
source = await createFileSyncEngineDataSource({
|
|
6175
|
+
directory,
|
|
6176
|
+
selectIdentifier: selectIdentifier7,
|
|
6177
|
+
selectDisplayName: selectDisplayName7
|
|
6178
|
+
});
|
|
6179
|
+
}
|
|
6180
|
+
const target = createWorkflowEngineDataSource({ client });
|
|
6181
|
+
await syncEngine({
|
|
6182
|
+
source,
|
|
6183
|
+
target,
|
|
6184
|
+
mode,
|
|
6185
|
+
whatIf,
|
|
6186
|
+
allowEmptySource,
|
|
6187
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
6188
|
+
});
|
|
6189
|
+
}
|
|
6190
|
+
};
|
|
6191
|
+
|
|
6192
|
+
// src/commands/canvas/commands/workflow.ts
|
|
6193
|
+
var WorkflowModule = {
|
|
6194
|
+
command: "workflow <command>",
|
|
6195
|
+
aliases: ["wf"],
|
|
6196
|
+
describe: "Commands for Canvas workflows",
|
|
6197
|
+
builder: (yargs38) => yargs38.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
6198
|
+
handler: () => {
|
|
6199
|
+
yargs17.help();
|
|
6200
|
+
}
|
|
5635
6201
|
};
|
|
5636
6202
|
|
|
5637
6203
|
// src/commands/canvas/index.ts
|
|
@@ -5639,28 +6205,28 @@ var CanvasCommand = {
|
|
|
5639
6205
|
command: "canvas <command>",
|
|
5640
6206
|
aliases: ["cv", "pm", "presentation"],
|
|
5641
6207
|
describe: "Uniform Canvas commands",
|
|
5642
|
-
builder: (
|
|
6208
|
+
builder: (yargs38) => yargs38.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(PatternModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LocaleModule).command(WorkflowModule).command(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
5643
6209
|
handler: () => {
|
|
5644
|
-
|
|
6210
|
+
yargs18.showHelp();
|
|
5645
6211
|
}
|
|
5646
6212
|
};
|
|
5647
6213
|
|
|
5648
6214
|
// src/commands/context/index.ts
|
|
5649
|
-
import
|
|
6215
|
+
import yargs25 from "yargs";
|
|
5650
6216
|
|
|
5651
6217
|
// src/commands/context/commands/aggregate.ts
|
|
5652
|
-
import
|
|
6218
|
+
import yargs19 from "yargs";
|
|
5653
6219
|
|
|
5654
6220
|
// src/commands/context/commands/aggregate/get.ts
|
|
5655
6221
|
import { UncachedAggregateClient } from "@uniformdev/context/api";
|
|
5656
6222
|
var AggregateGetModule = {
|
|
5657
6223
|
command: "get <id>",
|
|
5658
6224
|
describe: "Fetch an aggregate",
|
|
5659
|
-
builder: (
|
|
6225
|
+
builder: (yargs38) => withConfiguration(
|
|
5660
6226
|
withFormatOptions(
|
|
5661
6227
|
withApiOptions(
|
|
5662
6228
|
withProjectOptions(
|
|
5663
|
-
|
|
6229
|
+
yargs38.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
5664
6230
|
)
|
|
5665
6231
|
)
|
|
5666
6232
|
)
|
|
@@ -5684,7 +6250,7 @@ var AggregateListModule = {
|
|
|
5684
6250
|
command: "list",
|
|
5685
6251
|
describe: "List aggregates",
|
|
5686
6252
|
aliases: ["ls"],
|
|
5687
|
-
builder: (
|
|
6253
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
5688
6254
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5689
6255
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5690
6256
|
const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5697,8 +6263,8 @@ var AggregateListModule = {
|
|
|
5697
6263
|
import { UncachedAggregateClient as UncachedAggregateClient3 } from "@uniformdev/context/api";
|
|
5698
6264
|
|
|
5699
6265
|
// src/commands/context/commands/aggregate/_util.ts
|
|
5700
|
-
var
|
|
5701
|
-
var
|
|
6266
|
+
var selectIdentifier8 = (source) => source.id;
|
|
6267
|
+
var selectDisplayName8 = (source) => `${source.name} (pid: ${source.id})`;
|
|
5702
6268
|
|
|
5703
6269
|
// src/commands/context/aggregateEngineDataSource.ts
|
|
5704
6270
|
function createAggregateEngineDataSource({
|
|
@@ -5709,8 +6275,8 @@ function createAggregateEngineDataSource({
|
|
|
5709
6275
|
const aggregates = (await client.get({ type })).aggregates;
|
|
5710
6276
|
for await (const def of aggregates) {
|
|
5711
6277
|
const result = {
|
|
5712
|
-
id:
|
|
5713
|
-
displayName:
|
|
6278
|
+
id: selectIdentifier8(def),
|
|
6279
|
+
displayName: selectDisplayName8(def),
|
|
5714
6280
|
providerId: def.id,
|
|
5715
6281
|
object: def
|
|
5716
6282
|
};
|
|
@@ -5751,11 +6317,11 @@ function writeContextPackage(filename, packageContents) {
|
|
|
5751
6317
|
var AggregatePullModule = {
|
|
5752
6318
|
command: "pull <directory>",
|
|
5753
6319
|
describe: "Pulls all aggregates to local files in a directory",
|
|
5754
|
-
builder: (
|
|
6320
|
+
builder: (yargs38) => withConfiguration(
|
|
5755
6321
|
withApiOptions(
|
|
5756
6322
|
withProjectOptions(
|
|
5757
6323
|
withDiffOptions(
|
|
5758
|
-
|
|
6324
|
+
yargs38.positional("directory", {
|
|
5759
6325
|
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.",
|
|
5760
6326
|
type: "string"
|
|
5761
6327
|
}).option("format", {
|
|
@@ -5802,8 +6368,8 @@ var AggregatePullModule = {
|
|
|
5802
6368
|
target = await createArraySyncEngineDataSource({
|
|
5803
6369
|
name: `Package file ${directory}`,
|
|
5804
6370
|
objects: packageContents.aggregates ?? [],
|
|
5805
|
-
selectIdentifier:
|
|
5806
|
-
selectDisplayName:
|
|
6371
|
+
selectIdentifier: selectIdentifier8,
|
|
6372
|
+
selectDisplayName: selectDisplayName8,
|
|
5807
6373
|
onSyncComplete: async (_, synced) => {
|
|
5808
6374
|
packageContents.aggregates = synced;
|
|
5809
6375
|
writeContextPackage(directory, packageContents);
|
|
@@ -5812,8 +6378,8 @@ var AggregatePullModule = {
|
|
|
5812
6378
|
} else {
|
|
5813
6379
|
target = await createFileSyncEngineDataSource({
|
|
5814
6380
|
directory,
|
|
5815
|
-
selectIdentifier:
|
|
5816
|
-
selectDisplayName:
|
|
6381
|
+
selectIdentifier: selectIdentifier8,
|
|
6382
|
+
selectDisplayName: selectDisplayName8,
|
|
5817
6383
|
format
|
|
5818
6384
|
});
|
|
5819
6385
|
}
|
|
@@ -5833,11 +6399,11 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
|
|
|
5833
6399
|
var AggregatePushModule = {
|
|
5834
6400
|
command: "push <directory>",
|
|
5835
6401
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
5836
|
-
builder: (
|
|
6402
|
+
builder: (yargs38) => withConfiguration(
|
|
5837
6403
|
withApiOptions(
|
|
5838
6404
|
withProjectOptions(
|
|
5839
6405
|
withDiffOptions(
|
|
5840
|
-
|
|
6406
|
+
yargs38.positional("directory", {
|
|
5841
6407
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
5842
6408
|
type: "string"
|
|
5843
6409
|
}).option("what-if", {
|
|
@@ -5876,14 +6442,14 @@ var AggregatePushModule = {
|
|
|
5876
6442
|
source = await createArraySyncEngineDataSource({
|
|
5877
6443
|
name: `Package file ${directory}`,
|
|
5878
6444
|
objects: packageContents.aggregates ?? [],
|
|
5879
|
-
selectIdentifier:
|
|
5880
|
-
selectDisplayName:
|
|
6445
|
+
selectIdentifier: selectIdentifier8,
|
|
6446
|
+
selectDisplayName: selectDisplayName8
|
|
5881
6447
|
});
|
|
5882
6448
|
} else {
|
|
5883
6449
|
source = await createFileSyncEngineDataSource({
|
|
5884
6450
|
directory,
|
|
5885
|
-
selectIdentifier:
|
|
5886
|
-
selectDisplayName:
|
|
6451
|
+
selectIdentifier: selectIdentifier8,
|
|
6452
|
+
selectDisplayName: selectDisplayName8
|
|
5887
6453
|
});
|
|
5888
6454
|
}
|
|
5889
6455
|
const target = createAggregateEngineDataSource({ client });
|
|
@@ -5905,10 +6471,10 @@ var AggregateRemoveModule = {
|
|
|
5905
6471
|
command: "remove <id>",
|
|
5906
6472
|
aliases: ["delete", "rm"],
|
|
5907
6473
|
describe: "Delete an aggregate",
|
|
5908
|
-
builder: (
|
|
6474
|
+
builder: (yargs38) => withConfiguration(
|
|
5909
6475
|
withApiOptions(
|
|
5910
6476
|
withProjectOptions(
|
|
5911
|
-
|
|
6477
|
+
yargs38.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
5912
6478
|
)
|
|
5913
6479
|
)
|
|
5914
6480
|
),
|
|
@@ -5925,10 +6491,10 @@ var AggregateUpdateModule = {
|
|
|
5925
6491
|
command: "update <filename>",
|
|
5926
6492
|
aliases: ["put"],
|
|
5927
6493
|
describe: "Insert or update an aggregate",
|
|
5928
|
-
builder: (
|
|
6494
|
+
builder: (yargs38) => withConfiguration(
|
|
5929
6495
|
withApiOptions(
|
|
5930
6496
|
withProjectOptions(
|
|
5931
|
-
|
|
6497
|
+
yargs38.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
5932
6498
|
)
|
|
5933
6499
|
)
|
|
5934
6500
|
),
|
|
@@ -5945,25 +6511,25 @@ var AggregateModule = {
|
|
|
5945
6511
|
command: "aggregate <command>",
|
|
5946
6512
|
aliases: ["agg", "intent", "audience"],
|
|
5947
6513
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
5948
|
-
builder: (
|
|
6514
|
+
builder: (yargs38) => yargs38.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
5949
6515
|
handler: () => {
|
|
5950
|
-
|
|
6516
|
+
yargs19.help();
|
|
5951
6517
|
}
|
|
5952
6518
|
};
|
|
5953
6519
|
|
|
5954
6520
|
// src/commands/context/commands/enrichment.ts
|
|
5955
|
-
import
|
|
6521
|
+
import yargs20 from "yargs";
|
|
5956
6522
|
|
|
5957
6523
|
// src/commands/context/commands/enrichment/get.ts
|
|
5958
6524
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
5959
6525
|
var EnrichmentGetModule = {
|
|
5960
6526
|
command: "get <id>",
|
|
5961
6527
|
describe: "Fetch an enrichment category and its values",
|
|
5962
|
-
builder: (
|
|
6528
|
+
builder: (yargs38) => withFormatOptions(
|
|
5963
6529
|
withConfiguration(
|
|
5964
6530
|
withApiOptions(
|
|
5965
6531
|
withProjectOptions(
|
|
5966
|
-
|
|
6532
|
+
yargs38.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
5967
6533
|
)
|
|
5968
6534
|
)
|
|
5969
6535
|
)
|
|
@@ -5987,7 +6553,7 @@ var EnrichmentListModule = {
|
|
|
5987
6553
|
command: "list",
|
|
5988
6554
|
describe: "List enrichments",
|
|
5989
6555
|
aliases: ["ls"],
|
|
5990
|
-
builder: (
|
|
6556
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
5991
6557
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5992
6558
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5993
6559
|
const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6000,8 +6566,8 @@ var EnrichmentListModule = {
|
|
|
6000
6566
|
import { UncachedEnrichmentClient as UncachedEnrichmentClient3 } from "@uniformdev/context/api";
|
|
6001
6567
|
|
|
6002
6568
|
// src/commands/context/commands/enrichment/_util.ts
|
|
6003
|
-
var
|
|
6004
|
-
var
|
|
6569
|
+
var selectIdentifier9 = (source) => source.id;
|
|
6570
|
+
var selectDisplayName9 = (source) => `${source.name} (pid: ${source.id})`;
|
|
6005
6571
|
|
|
6006
6572
|
// src/commands/context/enrichmentEngineDataSource.ts
|
|
6007
6573
|
function createEnrichmentEngineDataSource({
|
|
@@ -6011,8 +6577,8 @@ function createEnrichmentEngineDataSource({
|
|
|
6011
6577
|
const enrichments = (await client.get()).enrichments;
|
|
6012
6578
|
for await (const def of enrichments) {
|
|
6013
6579
|
const result = {
|
|
6014
|
-
id:
|
|
6015
|
-
displayName:
|
|
6580
|
+
id: selectIdentifier9(def),
|
|
6581
|
+
displayName: selectDisplayName9(def),
|
|
6016
6582
|
providerId: def.id,
|
|
6017
6583
|
object: def
|
|
6018
6584
|
};
|
|
@@ -6089,11 +6655,11 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
6089
6655
|
var EnrichmentPullModule = {
|
|
6090
6656
|
command: "pull <directory>",
|
|
6091
6657
|
describe: "Pulls all enrichments to local files in a directory",
|
|
6092
|
-
builder: (
|
|
6658
|
+
builder: (yargs38) => withConfiguration(
|
|
6093
6659
|
withApiOptions(
|
|
6094
6660
|
withProjectOptions(
|
|
6095
6661
|
withDiffOptions(
|
|
6096
|
-
|
|
6662
|
+
yargs38.positional("directory", {
|
|
6097
6663
|
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.",
|
|
6098
6664
|
type: "string"
|
|
6099
6665
|
}).option("format", {
|
|
@@ -6140,8 +6706,8 @@ var EnrichmentPullModule = {
|
|
|
6140
6706
|
target = await createArraySyncEngineDataSource({
|
|
6141
6707
|
name: `Package file ${directory}`,
|
|
6142
6708
|
objects: packageContents.enrichments ?? [],
|
|
6143
|
-
selectIdentifier:
|
|
6144
|
-
selectDisplayName:
|
|
6709
|
+
selectIdentifier: selectIdentifier9,
|
|
6710
|
+
selectDisplayName: selectDisplayName9,
|
|
6145
6711
|
onSyncComplete: async (_, synced) => {
|
|
6146
6712
|
packageContents.enrichments = synced;
|
|
6147
6713
|
writeContextPackage(directory, packageContents);
|
|
@@ -6150,8 +6716,8 @@ var EnrichmentPullModule = {
|
|
|
6150
6716
|
} else {
|
|
6151
6717
|
target = await createFileSyncEngineDataSource({
|
|
6152
6718
|
directory,
|
|
6153
|
-
selectIdentifier:
|
|
6154
|
-
selectDisplayName:
|
|
6719
|
+
selectIdentifier: selectIdentifier9,
|
|
6720
|
+
selectDisplayName: selectDisplayName9,
|
|
6155
6721
|
format
|
|
6156
6722
|
});
|
|
6157
6723
|
}
|
|
@@ -6171,11 +6737,11 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
|
|
|
6171
6737
|
var EnrichmentPushModule = {
|
|
6172
6738
|
command: "push <directory>",
|
|
6173
6739
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
6174
|
-
builder: (
|
|
6740
|
+
builder: (yargs38) => withConfiguration(
|
|
6175
6741
|
withApiOptions(
|
|
6176
6742
|
withProjectOptions(
|
|
6177
6743
|
withDiffOptions(
|
|
6178
|
-
|
|
6744
|
+
yargs38.positional("directory", {
|
|
6179
6745
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
6180
6746
|
type: "string"
|
|
6181
6747
|
}).option("what-if", {
|
|
@@ -6214,14 +6780,14 @@ var EnrichmentPushModule = {
|
|
|
6214
6780
|
source = await createArraySyncEngineDataSource({
|
|
6215
6781
|
name: `Package file ${directory}`,
|
|
6216
6782
|
objects: packageContents.enrichments ?? [],
|
|
6217
|
-
selectIdentifier:
|
|
6218
|
-
selectDisplayName:
|
|
6783
|
+
selectIdentifier: selectIdentifier9,
|
|
6784
|
+
selectDisplayName: selectDisplayName9
|
|
6219
6785
|
});
|
|
6220
6786
|
} else {
|
|
6221
6787
|
source = await createFileSyncEngineDataSource({
|
|
6222
6788
|
directory,
|
|
6223
|
-
selectIdentifier:
|
|
6224
|
-
selectDisplayName:
|
|
6789
|
+
selectIdentifier: selectIdentifier9,
|
|
6790
|
+
selectDisplayName: selectDisplayName9
|
|
6225
6791
|
});
|
|
6226
6792
|
}
|
|
6227
6793
|
const target = createEnrichmentEngineDataSource({ client });
|
|
@@ -6242,10 +6808,10 @@ var EnrichmentRemoveModule = {
|
|
|
6242
6808
|
command: "remove <id>",
|
|
6243
6809
|
aliases: ["delete", "rm"],
|
|
6244
6810
|
describe: "Delete an enrichment category and its values",
|
|
6245
|
-
builder: (
|
|
6811
|
+
builder: (yargs38) => withConfiguration(
|
|
6246
6812
|
withApiOptions(
|
|
6247
6813
|
withProjectOptions(
|
|
6248
|
-
|
|
6814
|
+
yargs38.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
6249
6815
|
)
|
|
6250
6816
|
)
|
|
6251
6817
|
),
|
|
@@ -6261,14 +6827,14 @@ var EnrichmentModule = {
|
|
|
6261
6827
|
command: "enrichment <command>",
|
|
6262
6828
|
aliases: ["enr"],
|
|
6263
6829
|
describe: "Commands for Context enrichments",
|
|
6264
|
-
builder: (
|
|
6830
|
+
builder: (yargs38) => yargs38.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
6265
6831
|
handler: () => {
|
|
6266
|
-
|
|
6832
|
+
yargs20.help();
|
|
6267
6833
|
}
|
|
6268
6834
|
};
|
|
6269
6835
|
|
|
6270
6836
|
// src/commands/context/commands/manifest.ts
|
|
6271
|
-
import
|
|
6837
|
+
import yargs21 from "yargs";
|
|
6272
6838
|
|
|
6273
6839
|
// src/commands/context/commands/manifest/get.ts
|
|
6274
6840
|
import { ApiClientError as ApiClientError2, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -6279,10 +6845,10 @@ var ManifestGetModule = {
|
|
|
6279
6845
|
command: "get [output]",
|
|
6280
6846
|
aliases: ["dl", "download"],
|
|
6281
6847
|
describe: "Download the Uniform Context manifest for a project",
|
|
6282
|
-
builder: (
|
|
6848
|
+
builder: (yargs38) => withConfiguration(
|
|
6283
6849
|
withApiOptions(
|
|
6284
6850
|
withProjectOptions(
|
|
6285
|
-
|
|
6851
|
+
yargs38.option("preview", {
|
|
6286
6852
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
6287
6853
|
default: false,
|
|
6288
6854
|
type: "boolean",
|
|
@@ -6344,7 +6910,7 @@ import { exit as exit2 } from "process";
|
|
|
6344
6910
|
var ManifestPublishModule = {
|
|
6345
6911
|
command: "publish",
|
|
6346
6912
|
describe: "Publish the Uniform Context manifest for a project",
|
|
6347
|
-
builder: (
|
|
6913
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withProjectOptions(yargs38))),
|
|
6348
6914
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
6349
6915
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6350
6916
|
try {
|
|
@@ -6377,25 +6943,25 @@ var ManifestModule = {
|
|
|
6377
6943
|
command: "manifest <command>",
|
|
6378
6944
|
describe: "Commands for context manifests",
|
|
6379
6945
|
aliases: ["man"],
|
|
6380
|
-
builder: (
|
|
6946
|
+
builder: (yargs38) => yargs38.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
6381
6947
|
handler: () => {
|
|
6382
|
-
|
|
6948
|
+
yargs21.help();
|
|
6383
6949
|
}
|
|
6384
6950
|
};
|
|
6385
6951
|
|
|
6386
6952
|
// src/commands/context/commands/quirk.ts
|
|
6387
|
-
import
|
|
6953
|
+
import yargs22 from "yargs";
|
|
6388
6954
|
|
|
6389
6955
|
// src/commands/context/commands/quirk/get.ts
|
|
6390
6956
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
6391
6957
|
var QuirkGetModule = {
|
|
6392
6958
|
command: "get <id>",
|
|
6393
6959
|
describe: "Fetch a quirk",
|
|
6394
|
-
builder: (
|
|
6960
|
+
builder: (yargs38) => withConfiguration(
|
|
6395
6961
|
withFormatOptions(
|
|
6396
6962
|
withApiOptions(
|
|
6397
6963
|
withProjectOptions(
|
|
6398
|
-
|
|
6964
|
+
yargs38.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
6399
6965
|
)
|
|
6400
6966
|
)
|
|
6401
6967
|
)
|
|
@@ -6419,11 +6985,11 @@ var QuirkListModule = {
|
|
|
6419
6985
|
command: "list",
|
|
6420
6986
|
describe: "List quirks",
|
|
6421
6987
|
aliases: ["ls"],
|
|
6422
|
-
builder: (
|
|
6988
|
+
builder: (yargs38) => withConfiguration(
|
|
6423
6989
|
withFormatOptions(
|
|
6424
6990
|
withApiOptions(
|
|
6425
6991
|
withProjectOptions(
|
|
6426
|
-
|
|
6992
|
+
yargs38.option("withIntegrations", {
|
|
6427
6993
|
alias: ["i"],
|
|
6428
6994
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
6429
6995
|
type: "boolean"
|
|
@@ -6444,8 +7010,8 @@ var QuirkListModule = {
|
|
|
6444
7010
|
import { UncachedQuirkClient as UncachedQuirkClient3 } from "@uniformdev/context/api";
|
|
6445
7011
|
|
|
6446
7012
|
// src/commands/context/commands/quirk/_util.ts
|
|
6447
|
-
var
|
|
6448
|
-
var
|
|
7013
|
+
var selectIdentifier10 = (source) => source.id;
|
|
7014
|
+
var selectDisplayName10 = (source) => `${source.name} (pid: ${source.id})`;
|
|
6449
7015
|
|
|
6450
7016
|
// src/commands/context/quirkEngineDataSource.ts
|
|
6451
7017
|
function createQuirkEngineDataSource({
|
|
@@ -6455,8 +7021,8 @@ function createQuirkEngineDataSource({
|
|
|
6455
7021
|
const quirks = (await client.get({ withIntegrations: false })).quirks;
|
|
6456
7022
|
for await (const def of quirks) {
|
|
6457
7023
|
const result = {
|
|
6458
|
-
id:
|
|
6459
|
-
displayName:
|
|
7024
|
+
id: selectIdentifier10(def),
|
|
7025
|
+
displayName: selectDisplayName10(def),
|
|
6460
7026
|
providerId: def.id,
|
|
6461
7027
|
object: def
|
|
6462
7028
|
};
|
|
@@ -6481,11 +7047,11 @@ function createQuirkEngineDataSource({
|
|
|
6481
7047
|
var QuirkPullModule = {
|
|
6482
7048
|
command: "pull <directory>",
|
|
6483
7049
|
describe: "Pulls all quirks to local files in a directory",
|
|
6484
|
-
builder: (
|
|
7050
|
+
builder: (yargs38) => withConfiguration(
|
|
6485
7051
|
withApiOptions(
|
|
6486
7052
|
withProjectOptions(
|
|
6487
7053
|
withDiffOptions(
|
|
6488
|
-
|
|
7054
|
+
yargs38.positional("directory", {
|
|
6489
7055
|
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.",
|
|
6490
7056
|
type: "string"
|
|
6491
7057
|
}).option("format", {
|
|
@@ -6532,8 +7098,8 @@ var QuirkPullModule = {
|
|
|
6532
7098
|
target = await createArraySyncEngineDataSource({
|
|
6533
7099
|
name: `Package file ${directory}`,
|
|
6534
7100
|
objects: packageContents.quirks ?? [],
|
|
6535
|
-
selectIdentifier:
|
|
6536
|
-
selectDisplayName:
|
|
7101
|
+
selectIdentifier: selectIdentifier10,
|
|
7102
|
+
selectDisplayName: selectDisplayName10,
|
|
6537
7103
|
onSyncComplete: async (_, synced) => {
|
|
6538
7104
|
packageContents.quirks = synced;
|
|
6539
7105
|
writeContextPackage(directory, packageContents);
|
|
@@ -6542,8 +7108,8 @@ var QuirkPullModule = {
|
|
|
6542
7108
|
} else {
|
|
6543
7109
|
target = await createFileSyncEngineDataSource({
|
|
6544
7110
|
directory,
|
|
6545
|
-
selectIdentifier:
|
|
6546
|
-
selectDisplayName:
|
|
7111
|
+
selectIdentifier: selectIdentifier10,
|
|
7112
|
+
selectDisplayName: selectDisplayName10,
|
|
6547
7113
|
format
|
|
6548
7114
|
});
|
|
6549
7115
|
}
|
|
@@ -6563,11 +7129,11 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
6563
7129
|
var QuirkPushModule = {
|
|
6564
7130
|
command: "push <directory>",
|
|
6565
7131
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
6566
|
-
builder: (
|
|
7132
|
+
builder: (yargs38) => withConfiguration(
|
|
6567
7133
|
withApiOptions(
|
|
6568
7134
|
withProjectOptions(
|
|
6569
7135
|
withDiffOptions(
|
|
6570
|
-
|
|
7136
|
+
yargs38.positional("directory", {
|
|
6571
7137
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
6572
7138
|
type: "string"
|
|
6573
7139
|
}).option("what-if", {
|
|
@@ -6606,14 +7172,14 @@ var QuirkPushModule = {
|
|
|
6606
7172
|
source = await createArraySyncEngineDataSource({
|
|
6607
7173
|
name: `Package file ${directory}`,
|
|
6608
7174
|
objects: packageContents.quirks ?? [],
|
|
6609
|
-
selectIdentifier:
|
|
6610
|
-
selectDisplayName:
|
|
7175
|
+
selectIdentifier: selectIdentifier10,
|
|
7176
|
+
selectDisplayName: selectDisplayName10
|
|
6611
7177
|
});
|
|
6612
7178
|
} else {
|
|
6613
7179
|
source = await createFileSyncEngineDataSource({
|
|
6614
7180
|
directory,
|
|
6615
|
-
selectIdentifier:
|
|
6616
|
-
selectDisplayName:
|
|
7181
|
+
selectIdentifier: selectIdentifier10,
|
|
7182
|
+
selectDisplayName: selectDisplayName10
|
|
6617
7183
|
});
|
|
6618
7184
|
}
|
|
6619
7185
|
const target = createQuirkEngineDataSource({ client });
|
|
@@ -6634,10 +7200,10 @@ var QuirkRemoveModule = {
|
|
|
6634
7200
|
command: "remove <id>",
|
|
6635
7201
|
aliases: ["delete", "rm"],
|
|
6636
7202
|
describe: "Delete a quirk",
|
|
6637
|
-
builder: (
|
|
7203
|
+
builder: (yargs38) => withConfiguration(
|
|
6638
7204
|
withApiOptions(
|
|
6639
7205
|
withProjectOptions(
|
|
6640
|
-
|
|
7206
|
+
yargs38.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
6641
7207
|
)
|
|
6642
7208
|
)
|
|
6643
7209
|
),
|
|
@@ -6654,10 +7220,10 @@ var QuirkUpdateModule = {
|
|
|
6654
7220
|
command: "update <filename>",
|
|
6655
7221
|
aliases: ["put"],
|
|
6656
7222
|
describe: "Insert or update a quirk",
|
|
6657
|
-
builder: (
|
|
7223
|
+
builder: (yargs38) => withConfiguration(
|
|
6658
7224
|
withApiOptions(
|
|
6659
7225
|
withProjectOptions(
|
|
6660
|
-
|
|
7226
|
+
yargs38.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
6661
7227
|
)
|
|
6662
7228
|
)
|
|
6663
7229
|
),
|
|
@@ -6674,25 +7240,25 @@ var QuirkModule = {
|
|
|
6674
7240
|
command: "quirk <command>",
|
|
6675
7241
|
aliases: ["qk"],
|
|
6676
7242
|
describe: "Commands for Context quirks",
|
|
6677
|
-
builder: (
|
|
7243
|
+
builder: (yargs38) => yargs38.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
6678
7244
|
handler: () => {
|
|
6679
|
-
|
|
7245
|
+
yargs22.help();
|
|
6680
7246
|
}
|
|
6681
7247
|
};
|
|
6682
7248
|
|
|
6683
7249
|
// src/commands/context/commands/signal.ts
|
|
6684
|
-
import
|
|
7250
|
+
import yargs23 from "yargs";
|
|
6685
7251
|
|
|
6686
7252
|
// src/commands/context/commands/signal/get.ts
|
|
6687
7253
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
6688
7254
|
var SignalGetModule = {
|
|
6689
7255
|
command: "get <id>",
|
|
6690
7256
|
describe: "Fetch a signal",
|
|
6691
|
-
builder: (
|
|
7257
|
+
builder: (yargs38) => withConfiguration(
|
|
6692
7258
|
withFormatOptions(
|
|
6693
7259
|
withApiOptions(
|
|
6694
7260
|
withProjectOptions(
|
|
6695
|
-
|
|
7261
|
+
yargs38.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
6696
7262
|
)
|
|
6697
7263
|
)
|
|
6698
7264
|
)
|
|
@@ -6716,7 +7282,7 @@ var SignalListModule = {
|
|
|
6716
7282
|
command: "list",
|
|
6717
7283
|
describe: "List signals",
|
|
6718
7284
|
aliases: ["ls"],
|
|
6719
|
-
builder: (
|
|
7285
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
6720
7286
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6721
7287
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6722
7288
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6729,8 +7295,8 @@ var SignalListModule = {
|
|
|
6729
7295
|
import { UncachedSignalClient as UncachedSignalClient3 } from "@uniformdev/context/api";
|
|
6730
7296
|
|
|
6731
7297
|
// src/commands/context/commands/signal/_util.ts
|
|
6732
|
-
var
|
|
6733
|
-
var
|
|
7298
|
+
var selectIdentifier11 = (source) => source.id;
|
|
7299
|
+
var selectDisplayName11 = (source) => `${source.name} (pid: ${source.id})`;
|
|
6734
7300
|
|
|
6735
7301
|
// src/commands/context/signalEngineDataSource.ts
|
|
6736
7302
|
function createSignalEngineDataSource({
|
|
@@ -6740,8 +7306,8 @@ function createSignalEngineDataSource({
|
|
|
6740
7306
|
const signals = (await client.get()).signals;
|
|
6741
7307
|
for await (const def of signals) {
|
|
6742
7308
|
const result = {
|
|
6743
|
-
id:
|
|
6744
|
-
displayName:
|
|
7309
|
+
id: selectIdentifier11(def),
|
|
7310
|
+
displayName: selectDisplayName11(def),
|
|
6745
7311
|
providerId: def.id,
|
|
6746
7312
|
object: def
|
|
6747
7313
|
};
|
|
@@ -6766,11 +7332,11 @@ function createSignalEngineDataSource({
|
|
|
6766
7332
|
var SignalPullModule = {
|
|
6767
7333
|
command: "pull <directory>",
|
|
6768
7334
|
describe: "Pulls all signals to local files in a directory",
|
|
6769
|
-
builder: (
|
|
7335
|
+
builder: (yargs38) => withConfiguration(
|
|
6770
7336
|
withApiOptions(
|
|
6771
7337
|
withProjectOptions(
|
|
6772
7338
|
withDiffOptions(
|
|
6773
|
-
|
|
7339
|
+
yargs38.positional("directory", {
|
|
6774
7340
|
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.",
|
|
6775
7341
|
type: "string"
|
|
6776
7342
|
}).option("format", {
|
|
@@ -6817,8 +7383,8 @@ var SignalPullModule = {
|
|
|
6817
7383
|
target = await createArraySyncEngineDataSource({
|
|
6818
7384
|
name: `Package file ${directory}`,
|
|
6819
7385
|
objects: packageContents.signals ?? [],
|
|
6820
|
-
selectIdentifier:
|
|
6821
|
-
selectDisplayName:
|
|
7386
|
+
selectIdentifier: selectIdentifier11,
|
|
7387
|
+
selectDisplayName: selectDisplayName11,
|
|
6822
7388
|
onSyncComplete: async (_, synced) => {
|
|
6823
7389
|
packageContents.signals = synced;
|
|
6824
7390
|
writeContextPackage(directory, packageContents);
|
|
@@ -6827,8 +7393,8 @@ var SignalPullModule = {
|
|
|
6827
7393
|
} else {
|
|
6828
7394
|
target = await createFileSyncEngineDataSource({
|
|
6829
7395
|
directory,
|
|
6830
|
-
selectIdentifier:
|
|
6831
|
-
selectDisplayName:
|
|
7396
|
+
selectIdentifier: selectIdentifier11,
|
|
7397
|
+
selectDisplayName: selectDisplayName11,
|
|
6832
7398
|
format
|
|
6833
7399
|
});
|
|
6834
7400
|
}
|
|
@@ -6848,11 +7414,11 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
6848
7414
|
var SignalPushModule = {
|
|
6849
7415
|
command: "push <directory>",
|
|
6850
7416
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
6851
|
-
builder: (
|
|
7417
|
+
builder: (yargs38) => withConfiguration(
|
|
6852
7418
|
withApiOptions(
|
|
6853
7419
|
withProjectOptions(
|
|
6854
7420
|
withDiffOptions(
|
|
6855
|
-
|
|
7421
|
+
yargs38.positional("directory", {
|
|
6856
7422
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
6857
7423
|
type: "string"
|
|
6858
7424
|
}).option("what-if", {
|
|
@@ -6891,14 +7457,14 @@ var SignalPushModule = {
|
|
|
6891
7457
|
source = await createArraySyncEngineDataSource({
|
|
6892
7458
|
name: `Package file ${directory}`,
|
|
6893
7459
|
objects: packageContents.signals ?? [],
|
|
6894
|
-
selectIdentifier:
|
|
6895
|
-
selectDisplayName:
|
|
7460
|
+
selectIdentifier: selectIdentifier11,
|
|
7461
|
+
selectDisplayName: selectDisplayName11
|
|
6896
7462
|
});
|
|
6897
7463
|
} else {
|
|
6898
7464
|
source = await createFileSyncEngineDataSource({
|
|
6899
7465
|
directory,
|
|
6900
|
-
selectIdentifier:
|
|
6901
|
-
selectDisplayName:
|
|
7466
|
+
selectIdentifier: selectIdentifier11,
|
|
7467
|
+
selectDisplayName: selectDisplayName11
|
|
6902
7468
|
});
|
|
6903
7469
|
}
|
|
6904
7470
|
const target = createSignalEngineDataSource({ client });
|
|
@@ -6919,10 +7485,10 @@ var SignalRemoveModule = {
|
|
|
6919
7485
|
command: "remove <id>",
|
|
6920
7486
|
aliases: ["delete", "rm"],
|
|
6921
7487
|
describe: "Delete a signal",
|
|
6922
|
-
builder: (
|
|
7488
|
+
builder: (yargs38) => withConfiguration(
|
|
6923
7489
|
withApiOptions(
|
|
6924
7490
|
withProjectOptions(
|
|
6925
|
-
|
|
7491
|
+
yargs38.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
6926
7492
|
)
|
|
6927
7493
|
)
|
|
6928
7494
|
),
|
|
@@ -6939,10 +7505,10 @@ var SignalUpdateModule = {
|
|
|
6939
7505
|
command: "update <filename>",
|
|
6940
7506
|
aliases: ["put"],
|
|
6941
7507
|
describe: "Insert or update a signal",
|
|
6942
|
-
builder: (
|
|
7508
|
+
builder: (yargs38) => withConfiguration(
|
|
6943
7509
|
withApiOptions(
|
|
6944
7510
|
withProjectOptions(
|
|
6945
|
-
|
|
7511
|
+
yargs38.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
6946
7512
|
)
|
|
6947
7513
|
)
|
|
6948
7514
|
),
|
|
@@ -6959,25 +7525,25 @@ var SignalModule = {
|
|
|
6959
7525
|
command: "signal <command>",
|
|
6960
7526
|
aliases: ["sig"],
|
|
6961
7527
|
describe: "Commands for Context signals",
|
|
6962
|
-
builder: (
|
|
7528
|
+
builder: (yargs38) => yargs38.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
6963
7529
|
handler: () => {
|
|
6964
|
-
|
|
7530
|
+
yargs23.help();
|
|
6965
7531
|
}
|
|
6966
7532
|
};
|
|
6967
7533
|
|
|
6968
7534
|
// src/commands/context/commands/test.ts
|
|
6969
|
-
import
|
|
7535
|
+
import yargs24 from "yargs";
|
|
6970
7536
|
|
|
6971
7537
|
// src/commands/context/commands/test/get.ts
|
|
6972
7538
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
6973
7539
|
var TestGetModule = {
|
|
6974
7540
|
command: "get <id>",
|
|
6975
7541
|
describe: "Fetch a test",
|
|
6976
|
-
builder: (
|
|
7542
|
+
builder: (yargs38) => withConfiguration(
|
|
6977
7543
|
withFormatOptions(
|
|
6978
7544
|
withApiOptions(
|
|
6979
7545
|
withProjectOptions(
|
|
6980
|
-
|
|
7546
|
+
yargs38.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
6981
7547
|
)
|
|
6982
7548
|
)
|
|
6983
7549
|
)
|
|
@@ -7001,7 +7567,7 @@ var TestListModule = {
|
|
|
7001
7567
|
command: "list",
|
|
7002
7568
|
describe: "List tests",
|
|
7003
7569
|
aliases: ["ls"],
|
|
7004
|
-
builder: (
|
|
7570
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
7005
7571
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7006
7572
|
const fetch3 = nodeFetchProxy(proxy);
|
|
7007
7573
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -7014,8 +7580,8 @@ var TestListModule = {
|
|
|
7014
7580
|
import { UncachedTestClient as UncachedTestClient3 } from "@uniformdev/context/api";
|
|
7015
7581
|
|
|
7016
7582
|
// src/commands/context/commands/test/_util.ts
|
|
7017
|
-
var
|
|
7018
|
-
var
|
|
7583
|
+
var selectIdentifier12 = (source) => source.id;
|
|
7584
|
+
var selectDisplayName12 = (source) => `${source.name} (pid: ${source.id})`;
|
|
7019
7585
|
|
|
7020
7586
|
// src/commands/context/testEngineDataSource.ts
|
|
7021
7587
|
function createTestEngineDataSource({
|
|
@@ -7025,8 +7591,8 @@ function createTestEngineDataSource({
|
|
|
7025
7591
|
const tests = (await client.get()).tests;
|
|
7026
7592
|
for await (const def of tests) {
|
|
7027
7593
|
const result = {
|
|
7028
|
-
id:
|
|
7029
|
-
displayName:
|
|
7594
|
+
id: selectIdentifier12(def),
|
|
7595
|
+
displayName: selectDisplayName12(def),
|
|
7030
7596
|
providerId: def.id,
|
|
7031
7597
|
object: def
|
|
7032
7598
|
};
|
|
@@ -7051,11 +7617,11 @@ function createTestEngineDataSource({
|
|
|
7051
7617
|
var TestPullModule = {
|
|
7052
7618
|
command: "pull <directory>",
|
|
7053
7619
|
describe: "Pulls all tests to local files in a directory",
|
|
7054
|
-
builder: (
|
|
7620
|
+
builder: (yargs38) => withConfiguration(
|
|
7055
7621
|
withApiOptions(
|
|
7056
7622
|
withProjectOptions(
|
|
7057
7623
|
withDiffOptions(
|
|
7058
|
-
|
|
7624
|
+
yargs38.positional("directory", {
|
|
7059
7625
|
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.",
|
|
7060
7626
|
type: "string"
|
|
7061
7627
|
}).option("format", {
|
|
@@ -7102,8 +7668,8 @@ var TestPullModule = {
|
|
|
7102
7668
|
target = await createArraySyncEngineDataSource({
|
|
7103
7669
|
name: `Package file ${directory}`,
|
|
7104
7670
|
objects: packageContents.tests ?? [],
|
|
7105
|
-
selectIdentifier:
|
|
7106
|
-
selectDisplayName:
|
|
7671
|
+
selectIdentifier: selectIdentifier12,
|
|
7672
|
+
selectDisplayName: selectDisplayName12,
|
|
7107
7673
|
onSyncComplete: async (_, synced) => {
|
|
7108
7674
|
packageContents.tests = synced;
|
|
7109
7675
|
writeContextPackage(directory, packageContents);
|
|
@@ -7112,8 +7678,8 @@ var TestPullModule = {
|
|
|
7112
7678
|
} else {
|
|
7113
7679
|
target = await createFileSyncEngineDataSource({
|
|
7114
7680
|
directory,
|
|
7115
|
-
selectIdentifier:
|
|
7116
|
-
selectDisplayName:
|
|
7681
|
+
selectIdentifier: selectIdentifier12,
|
|
7682
|
+
selectDisplayName: selectDisplayName12,
|
|
7117
7683
|
format
|
|
7118
7684
|
});
|
|
7119
7685
|
}
|
|
@@ -7133,11 +7699,11 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
7133
7699
|
var TestPushModule = {
|
|
7134
7700
|
command: "push <directory>",
|
|
7135
7701
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
7136
|
-
builder: (
|
|
7702
|
+
builder: (yargs38) => withConfiguration(
|
|
7137
7703
|
withApiOptions(
|
|
7138
7704
|
withProjectOptions(
|
|
7139
7705
|
withDiffOptions(
|
|
7140
|
-
|
|
7706
|
+
yargs38.positional("directory", {
|
|
7141
7707
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
7142
7708
|
type: "string"
|
|
7143
7709
|
}).option("what-if", {
|
|
@@ -7176,14 +7742,14 @@ var TestPushModule = {
|
|
|
7176
7742
|
source = await createArraySyncEngineDataSource({
|
|
7177
7743
|
name: `Package file ${directory}`,
|
|
7178
7744
|
objects: packageContents.tests ?? [],
|
|
7179
|
-
selectIdentifier:
|
|
7180
|
-
selectDisplayName:
|
|
7745
|
+
selectIdentifier: selectIdentifier12,
|
|
7746
|
+
selectDisplayName: selectDisplayName12
|
|
7181
7747
|
});
|
|
7182
7748
|
} else {
|
|
7183
7749
|
source = await createFileSyncEngineDataSource({
|
|
7184
7750
|
directory,
|
|
7185
|
-
selectIdentifier:
|
|
7186
|
-
selectDisplayName:
|
|
7751
|
+
selectIdentifier: selectIdentifier12,
|
|
7752
|
+
selectDisplayName: selectDisplayName12
|
|
7187
7753
|
});
|
|
7188
7754
|
}
|
|
7189
7755
|
const target = createTestEngineDataSource({ client });
|
|
@@ -7204,10 +7770,10 @@ var TestRemoveModule = {
|
|
|
7204
7770
|
command: "remove <id>",
|
|
7205
7771
|
aliases: ["delete", "rm"],
|
|
7206
7772
|
describe: "Delete a test",
|
|
7207
|
-
builder: (
|
|
7773
|
+
builder: (yargs38) => withConfiguration(
|
|
7208
7774
|
withApiOptions(
|
|
7209
7775
|
withProjectOptions(
|
|
7210
|
-
|
|
7776
|
+
yargs38.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
7211
7777
|
)
|
|
7212
7778
|
)
|
|
7213
7779
|
),
|
|
@@ -7224,9 +7790,9 @@ var TestUpdateModule = {
|
|
|
7224
7790
|
command: "update <filename>",
|
|
7225
7791
|
aliases: ["put"],
|
|
7226
7792
|
describe: "Insert or update a test",
|
|
7227
|
-
builder: (
|
|
7793
|
+
builder: (yargs38) => withConfiguration(
|
|
7228
7794
|
withApiOptions(
|
|
7229
|
-
withProjectOptions(
|
|
7795
|
+
withProjectOptions(yargs38.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
7230
7796
|
)
|
|
7231
7797
|
),
|
|
7232
7798
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -7241,9 +7807,9 @@ var TestUpdateModule = {
|
|
|
7241
7807
|
var TestModule = {
|
|
7242
7808
|
command: "test <command>",
|
|
7243
7809
|
describe: "Commands for Context A/B tests",
|
|
7244
|
-
builder: (
|
|
7810
|
+
builder: (yargs38) => yargs38.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
7245
7811
|
handler: () => {
|
|
7246
|
-
|
|
7812
|
+
yargs24.help();
|
|
7247
7813
|
}
|
|
7248
7814
|
};
|
|
7249
7815
|
|
|
@@ -7252,20 +7818,20 @@ var ContextCommand = {
|
|
|
7252
7818
|
command: "context <command>",
|
|
7253
7819
|
aliases: ["ctx"],
|
|
7254
7820
|
describe: "Uniform Context commands",
|
|
7255
|
-
builder: (
|
|
7821
|
+
builder: (yargs38) => yargs38.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
7256
7822
|
handler: () => {
|
|
7257
|
-
|
|
7823
|
+
yargs25.showHelp();
|
|
7258
7824
|
}
|
|
7259
7825
|
};
|
|
7260
7826
|
|
|
7261
7827
|
// src/commands/integration/index.ts
|
|
7262
|
-
import
|
|
7828
|
+
import yargs28 from "yargs";
|
|
7263
7829
|
|
|
7264
7830
|
// src/commands/integration/commands/definition.ts
|
|
7265
|
-
import
|
|
7831
|
+
import yargs27 from "yargs";
|
|
7266
7832
|
|
|
7267
7833
|
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
7268
|
-
import
|
|
7834
|
+
import yargs26 from "yargs";
|
|
7269
7835
|
|
|
7270
7836
|
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
7271
7837
|
import { readFileSync } from "fs";
|
|
@@ -7303,8 +7869,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
7303
7869
|
};
|
|
7304
7870
|
|
|
7305
7871
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
7306
|
-
function withEdgehancerIdOptions(
|
|
7307
|
-
return
|
|
7872
|
+
function withEdgehancerIdOptions(yargs38) {
|
|
7873
|
+
return yargs38.option("connectorType", {
|
|
7308
7874
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
7309
7875
|
demandOption: true,
|
|
7310
7876
|
type: "string"
|
|
@@ -7324,11 +7890,11 @@ function withEdgehancerIdOptions(yargs36) {
|
|
|
7324
7890
|
var IntegrationEdgehancerDeployModule = {
|
|
7325
7891
|
command: "deploy <filename>",
|
|
7326
7892
|
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.",
|
|
7327
|
-
builder: (
|
|
7893
|
+
builder: (yargs38) => withConfiguration(
|
|
7328
7894
|
withApiOptions(
|
|
7329
7895
|
withTeamOptions(
|
|
7330
7896
|
withEdgehancerIdOptions(
|
|
7331
|
-
|
|
7897
|
+
yargs38.positional("filename", {
|
|
7332
7898
|
demandOption: true,
|
|
7333
7899
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
7334
7900
|
})
|
|
@@ -7348,7 +7914,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
7348
7914
|
var IntegrationEdgehancerRemoveModule = {
|
|
7349
7915
|
command: "remove",
|
|
7350
7916
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
7351
|
-
builder: (
|
|
7917
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs38)))),
|
|
7352
7918
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
7353
7919
|
const fetch3 = nodeFetchProxy(proxy);
|
|
7354
7920
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch3, teamId });
|
|
@@ -7360,9 +7926,9 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
7360
7926
|
var IntegrationEdgehancerModule = {
|
|
7361
7927
|
command: "edgehancer <command>",
|
|
7362
7928
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
7363
|
-
builder: (
|
|
7929
|
+
builder: (yargs38) => yargs38.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
7364
7930
|
handler: () => {
|
|
7365
|
-
|
|
7931
|
+
yargs26.help();
|
|
7366
7932
|
}
|
|
7367
7933
|
};
|
|
7368
7934
|
|
|
@@ -7402,10 +7968,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
7402
7968
|
var IntegrationDefinitionRegisterModule = {
|
|
7403
7969
|
command: "register <filename>",
|
|
7404
7970
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
7405
|
-
builder: (
|
|
7971
|
+
builder: (yargs38) => withConfiguration(
|
|
7406
7972
|
withApiOptions(
|
|
7407
7973
|
withTeamOptions(
|
|
7408
|
-
|
|
7974
|
+
yargs38.positional("filename", {
|
|
7409
7975
|
demandOption: true,
|
|
7410
7976
|
describe: "Integration definition manifest to register"
|
|
7411
7977
|
})
|
|
@@ -7424,10 +7990,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
7424
7990
|
var IntegrationDefinitionRemoveModule = {
|
|
7425
7991
|
command: "remove <type>",
|
|
7426
7992
|
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.",
|
|
7427
|
-
builder: (
|
|
7993
|
+
builder: (yargs38) => withConfiguration(
|
|
7428
7994
|
withApiOptions(
|
|
7429
7995
|
withTeamOptions(
|
|
7430
|
-
|
|
7996
|
+
yargs38.positional("type", {
|
|
7431
7997
|
demandOption: true,
|
|
7432
7998
|
describe: "Integration type (from its manifest) to remove."
|
|
7433
7999
|
})
|
|
@@ -7445,9 +8011,9 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
7445
8011
|
var IntegrationDefinitionModule = {
|
|
7446
8012
|
command: "definition <command>",
|
|
7447
8013
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
7448
|
-
builder: (
|
|
8014
|
+
builder: (yargs38) => yargs38.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).demandCommand(),
|
|
7449
8015
|
handler: () => {
|
|
7450
|
-
|
|
8016
|
+
yargs27.help();
|
|
7451
8017
|
}
|
|
7452
8018
|
};
|
|
7453
8019
|
|
|
@@ -7487,10 +8053,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
7487
8053
|
var IntegrationInstallModule = {
|
|
7488
8054
|
command: "install <type>",
|
|
7489
8055
|
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.",
|
|
7490
|
-
builder: (
|
|
8056
|
+
builder: (yargs38) => withConfiguration(
|
|
7491
8057
|
withApiOptions(
|
|
7492
8058
|
withProjectOptions(
|
|
7493
|
-
|
|
8059
|
+
yargs38.positional("type", {
|
|
7494
8060
|
demandOption: true,
|
|
7495
8061
|
describe: "Integration type to install (as defined in its manifest)"
|
|
7496
8062
|
}).option("configuration", {
|
|
@@ -7512,10 +8078,10 @@ var IntegrationInstallModule = {
|
|
|
7512
8078
|
var IntegrationUninstallModule = {
|
|
7513
8079
|
command: "uninstall <type>",
|
|
7514
8080
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
7515
|
-
builder: (
|
|
8081
|
+
builder: (yargs38) => withConfiguration(
|
|
7516
8082
|
withApiOptions(
|
|
7517
8083
|
withProjectOptions(
|
|
7518
|
-
|
|
8084
|
+
yargs38.positional("type", {
|
|
7519
8085
|
demandOption: true,
|
|
7520
8086
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
7521
8087
|
})
|
|
@@ -7533,9 +8099,9 @@ var IntegrationUninstallModule = {
|
|
|
7533
8099
|
var IntegrationCommand = {
|
|
7534
8100
|
command: "integration <command>",
|
|
7535
8101
|
describe: "Integration management commands",
|
|
7536
|
-
builder: (
|
|
8102
|
+
builder: (yargs38) => yargs38.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
7537
8103
|
handler: () => {
|
|
7538
|
-
|
|
8104
|
+
yargs28.showHelp();
|
|
7539
8105
|
}
|
|
7540
8106
|
};
|
|
7541
8107
|
|
|
@@ -7563,7 +8129,7 @@ import { PostHog } from "posthog-node";
|
|
|
7563
8129
|
// package.json
|
|
7564
8130
|
var package_default = {
|
|
7565
8131
|
name: "@uniformdev/cli",
|
|
7566
|
-
version: "19.
|
|
8132
|
+
version: "19.197.0",
|
|
7567
8133
|
description: "Uniform command line interface tool",
|
|
7568
8134
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
7569
8135
|
main: "./cli.js",
|
|
@@ -8579,10 +9145,10 @@ var NewMeshCmd = {
|
|
|
8579
9145
|
};
|
|
8580
9146
|
|
|
8581
9147
|
// src/commands/optimize/index.ts
|
|
8582
|
-
import
|
|
9148
|
+
import yargs30 from "yargs";
|
|
8583
9149
|
|
|
8584
9150
|
// src/commands/optimize/manifest.ts
|
|
8585
|
-
import
|
|
9151
|
+
import yargs29 from "yargs";
|
|
8586
9152
|
|
|
8587
9153
|
// src/commands/optimize/manifest/download.ts
|
|
8588
9154
|
import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
|
|
@@ -8597,7 +9163,7 @@ var UniformBaseUrl = "https://uniform.app";
|
|
|
8597
9163
|
var module = {
|
|
8598
9164
|
command: "download [output]",
|
|
8599
9165
|
describe: "Download intent manifest",
|
|
8600
|
-
builder: (
|
|
9166
|
+
builder: (yargs38) => yargs38.option("apiKey", {
|
|
8601
9167
|
alias: "k",
|
|
8602
9168
|
demandOption: true,
|
|
8603
9169
|
string: true,
|
|
@@ -8698,10 +9264,10 @@ var module2 = {
|
|
|
8698
9264
|
command: "manifest <command>",
|
|
8699
9265
|
describe: "Intent manifest commands",
|
|
8700
9266
|
builder: () => {
|
|
8701
|
-
return
|
|
9267
|
+
return yargs29.command(download_default);
|
|
8702
9268
|
},
|
|
8703
9269
|
handler: () => {
|
|
8704
|
-
|
|
9270
|
+
yargs29.showHelp();
|
|
8705
9271
|
}
|
|
8706
9272
|
};
|
|
8707
9273
|
var manifest_default = module2;
|
|
@@ -8712,29 +9278,29 @@ var OptimizeCommand = {
|
|
|
8712
9278
|
aliases: ["opt"],
|
|
8713
9279
|
describe: "Uniform Optimize commands",
|
|
8714
9280
|
builder: () => {
|
|
8715
|
-
return
|
|
9281
|
+
return yargs30.command(manifest_default);
|
|
8716
9282
|
},
|
|
8717
9283
|
handler: () => {
|
|
8718
|
-
|
|
9284
|
+
yargs30.showHelp();
|
|
8719
9285
|
}
|
|
8720
9286
|
};
|
|
8721
9287
|
|
|
8722
9288
|
// src/commands/project-map/index.ts
|
|
8723
|
-
import
|
|
9289
|
+
import yargs33 from "yargs";
|
|
8724
9290
|
|
|
8725
9291
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
8726
|
-
import
|
|
9292
|
+
import yargs31 from "yargs";
|
|
8727
9293
|
|
|
8728
9294
|
// src/commands/project-map/commands/ProjectMapDefinition/get.ts
|
|
8729
9295
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
8730
9296
|
var ProjectMapDefinitionGetModule = {
|
|
8731
9297
|
command: "get <id>",
|
|
8732
9298
|
describe: "Fetch a project map",
|
|
8733
|
-
builder: (
|
|
9299
|
+
builder: (yargs38) => withFormatOptions(
|
|
8734
9300
|
withConfiguration(
|
|
8735
9301
|
withApiOptions(
|
|
8736
9302
|
withProjectOptions(
|
|
8737
|
-
|
|
9303
|
+
yargs38.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
8738
9304
|
)
|
|
8739
9305
|
)
|
|
8740
9306
|
)
|
|
@@ -8758,7 +9324,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
8758
9324
|
command: "list",
|
|
8759
9325
|
describe: "List of project maps",
|
|
8760
9326
|
aliases: ["ls"],
|
|
8761
|
-
builder: (
|
|
9327
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
8762
9328
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8763
9329
|
const fetch3 = nodeFetchProxy(proxy);
|
|
8764
9330
|
const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -8779,8 +9345,8 @@ function writeContextPackage2(filename, packageContents) {
|
|
|
8779
9345
|
}
|
|
8780
9346
|
|
|
8781
9347
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
8782
|
-
var
|
|
8783
|
-
var
|
|
9348
|
+
var selectIdentifier13 = (source) => source.id;
|
|
9349
|
+
var selectDisplayName13 = (source) => `${source.name} (pid: ${source.id})`;
|
|
8784
9350
|
|
|
8785
9351
|
// src/commands/project-map/ProjectMapDefinitionEngineDataSource.ts
|
|
8786
9352
|
function createProjectMapDefinitionEngineDataSource({
|
|
@@ -8790,9 +9356,9 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
8790
9356
|
const projectMaps = (await client.getProjectMapDefinitions()).projectMaps;
|
|
8791
9357
|
for await (const def of projectMaps) {
|
|
8792
9358
|
const result = {
|
|
8793
|
-
id:
|
|
8794
|
-
displayName:
|
|
8795
|
-
providerId:
|
|
9359
|
+
id: selectIdentifier13(def),
|
|
9360
|
+
displayName: selectDisplayName13(def),
|
|
9361
|
+
providerId: selectIdentifier13(def),
|
|
8796
9362
|
object: def
|
|
8797
9363
|
};
|
|
8798
9364
|
yield result;
|
|
@@ -8816,11 +9382,11 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
8816
9382
|
var ProjectMapDefinitionPullModule = {
|
|
8817
9383
|
command: "pull <directory>",
|
|
8818
9384
|
describe: "Pulls all project maps to local files in a directory",
|
|
8819
|
-
builder: (
|
|
9385
|
+
builder: (yargs38) => withConfiguration(
|
|
8820
9386
|
withApiOptions(
|
|
8821
9387
|
withProjectOptions(
|
|
8822
9388
|
withDiffOptions(
|
|
8823
|
-
|
|
9389
|
+
yargs38.positional("directory", {
|
|
8824
9390
|
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.",
|
|
8825
9391
|
type: "string"
|
|
8826
9392
|
}).option("format", {
|
|
@@ -8867,8 +9433,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
8867
9433
|
target = await createArraySyncEngineDataSource({
|
|
8868
9434
|
name: `Package file ${directory}`,
|
|
8869
9435
|
objects: packageContents.projectMaps ?? [],
|
|
8870
|
-
selectIdentifier:
|
|
8871
|
-
selectDisplayName:
|
|
9436
|
+
selectIdentifier: selectIdentifier13,
|
|
9437
|
+
selectDisplayName: selectDisplayName13,
|
|
8872
9438
|
onSyncComplete: async (_, synced) => {
|
|
8873
9439
|
packageContents.projectMaps = synced;
|
|
8874
9440
|
writeContextPackage2(directory, packageContents);
|
|
@@ -8877,8 +9443,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
8877
9443
|
} else {
|
|
8878
9444
|
target = await createFileSyncEngineDataSource({
|
|
8879
9445
|
directory,
|
|
8880
|
-
selectIdentifier:
|
|
8881
|
-
selectDisplayName:
|
|
9446
|
+
selectIdentifier: selectIdentifier13,
|
|
9447
|
+
selectDisplayName: selectDisplayName13,
|
|
8882
9448
|
format
|
|
8883
9449
|
});
|
|
8884
9450
|
}
|
|
@@ -8898,11 +9464,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
|
|
|
8898
9464
|
var ProjectMapDefinitionPushModule = {
|
|
8899
9465
|
command: "push <directory>",
|
|
8900
9466
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
8901
|
-
builder: (
|
|
9467
|
+
builder: (yargs38) => withConfiguration(
|
|
8902
9468
|
withApiOptions(
|
|
8903
9469
|
withProjectOptions(
|
|
8904
9470
|
withDiffOptions(
|
|
8905
|
-
|
|
9471
|
+
yargs38.positional("directory", {
|
|
8906
9472
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
8907
9473
|
type: "string"
|
|
8908
9474
|
}).option("what-if", {
|
|
@@ -8941,14 +9507,14 @@ var ProjectMapDefinitionPushModule = {
|
|
|
8941
9507
|
source = await createArraySyncEngineDataSource({
|
|
8942
9508
|
name: `Package file ${directory}`,
|
|
8943
9509
|
objects: packageContents.projectMaps ?? [],
|
|
8944
|
-
selectIdentifier:
|
|
8945
|
-
selectDisplayName:
|
|
9510
|
+
selectIdentifier: selectIdentifier13,
|
|
9511
|
+
selectDisplayName: selectDisplayName13
|
|
8946
9512
|
});
|
|
8947
9513
|
} else {
|
|
8948
9514
|
source = await createFileSyncEngineDataSource({
|
|
8949
9515
|
directory,
|
|
8950
|
-
selectIdentifier:
|
|
8951
|
-
selectDisplayName:
|
|
9516
|
+
selectIdentifier: selectIdentifier13,
|
|
9517
|
+
selectDisplayName: selectDisplayName13
|
|
8952
9518
|
});
|
|
8953
9519
|
}
|
|
8954
9520
|
const target = createProjectMapDefinitionEngineDataSource({ client });
|
|
@@ -8969,9 +9535,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
8969
9535
|
command: "remove <id>",
|
|
8970
9536
|
aliases: ["delete", "rm"],
|
|
8971
9537
|
describe: "Delete a project map",
|
|
8972
|
-
builder: (
|
|
9538
|
+
builder: (yargs38) => withConfiguration(
|
|
8973
9539
|
withApiOptions(
|
|
8974
|
-
withProjectOptions(
|
|
9540
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
8975
9541
|
)
|
|
8976
9542
|
),
|
|
8977
9543
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -8987,10 +9553,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
8987
9553
|
command: "update <filename>",
|
|
8988
9554
|
aliases: ["put"],
|
|
8989
9555
|
describe: "Insert or update a project map",
|
|
8990
|
-
builder: (
|
|
9556
|
+
builder: (yargs38) => withConfiguration(
|
|
8991
9557
|
withApiOptions(
|
|
8992
9558
|
withProjectOptions(
|
|
8993
|
-
|
|
9559
|
+
yargs38.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
8994
9560
|
)
|
|
8995
9561
|
)
|
|
8996
9562
|
),
|
|
@@ -9006,25 +9572,25 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
9006
9572
|
var ProjectMapDefinitionModule = {
|
|
9007
9573
|
command: "definition <command>",
|
|
9008
9574
|
describe: "Commands for ProjectMap Definitions",
|
|
9009
|
-
builder: (
|
|
9575
|
+
builder: (yargs38) => yargs38.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
9010
9576
|
handler: () => {
|
|
9011
|
-
|
|
9577
|
+
yargs31.help();
|
|
9012
9578
|
}
|
|
9013
9579
|
};
|
|
9014
9580
|
|
|
9015
9581
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
9016
|
-
import
|
|
9582
|
+
import yargs32 from "yargs";
|
|
9017
9583
|
|
|
9018
9584
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
9019
9585
|
import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
|
|
9020
9586
|
var ProjectMapNodeGetModule = {
|
|
9021
9587
|
command: "get <id> <projectMapId>",
|
|
9022
9588
|
describe: "Fetch a project map node",
|
|
9023
|
-
builder: (
|
|
9589
|
+
builder: (yargs38) => withConfiguration(
|
|
9024
9590
|
withFormatOptions(
|
|
9025
9591
|
withApiOptions(
|
|
9026
9592
|
withProjectOptions(
|
|
9027
|
-
|
|
9593
|
+
yargs38.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
9028
9594
|
)
|
|
9029
9595
|
)
|
|
9030
9596
|
)
|
|
@@ -9049,12 +9615,12 @@ var ProjectMapNodeListModule = {
|
|
|
9049
9615
|
command: "list <projectMapId>",
|
|
9050
9616
|
describe: "List project map nodes",
|
|
9051
9617
|
aliases: ["ls"],
|
|
9052
|
-
builder: (
|
|
9618
|
+
builder: (yargs38) => withConfiguration(
|
|
9053
9619
|
withFormatOptions(
|
|
9054
9620
|
withApiOptions(
|
|
9055
9621
|
withProjectOptions(
|
|
9056
9622
|
withStateOptions(
|
|
9057
|
-
|
|
9623
|
+
yargs38.positional("projectMapId", {
|
|
9058
9624
|
demandOption: true,
|
|
9059
9625
|
describe: "ProjectMap UUID to fetch from"
|
|
9060
9626
|
})
|
|
@@ -9075,12 +9641,12 @@ var ProjectMapNodeListModule = {
|
|
|
9075
9641
|
import { UncachedProjectMapClient as UncachedProjectMapClient9 } from "@uniformdev/project-map";
|
|
9076
9642
|
|
|
9077
9643
|
// src/commands/project-map/commands/ProjectMapNode/_util.ts
|
|
9078
|
-
var
|
|
9644
|
+
var selectIdentifier14 = (source, projectId) => [
|
|
9079
9645
|
projectId + source.projectMapId + source.id,
|
|
9080
9646
|
projectId + source.projectMapId + source.path
|
|
9081
9647
|
];
|
|
9082
9648
|
var selectFilename = (source) => cleanFileName(`${source.pathSegment}_${source.id}`);
|
|
9083
|
-
var
|
|
9649
|
+
var selectDisplayName14 = (source) => `${source.name} (pid: ${source.id})`;
|
|
9084
9650
|
|
|
9085
9651
|
// src/commands/project-map/ProjectMapNodeEngineDataSource.ts
|
|
9086
9652
|
function createProjectMapNodeEngineDataSource({
|
|
@@ -9094,9 +9660,9 @@ function createProjectMapNodeEngineDataSource({
|
|
|
9094
9660
|
for await (const node of nodes ?? []) {
|
|
9095
9661
|
if (node) {
|
|
9096
9662
|
const result = {
|
|
9097
|
-
id:
|
|
9098
|
-
displayName:
|
|
9099
|
-
providerId:
|
|
9663
|
+
id: selectIdentifier14({ ...node, projectMapId: projectMap.id }, projectId),
|
|
9664
|
+
displayName: selectDisplayName14(node),
|
|
9665
|
+
providerId: selectIdentifier14({ ...node, projectMapId: projectMap.id }, projectId)[0],
|
|
9100
9666
|
object: { ...node, projectMapId: projectMap.id }
|
|
9101
9667
|
};
|
|
9102
9668
|
yield result;
|
|
@@ -9127,11 +9693,11 @@ function createProjectMapNodeEngineDataSource({
|
|
|
9127
9693
|
var ProjectMapNodePullModule = {
|
|
9128
9694
|
command: "pull <directory>",
|
|
9129
9695
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
9130
|
-
builder: (
|
|
9696
|
+
builder: (yargs38) => withConfiguration(
|
|
9131
9697
|
withApiOptions(
|
|
9132
9698
|
withProjectOptions(
|
|
9133
9699
|
withDiffOptions(
|
|
9134
|
-
|
|
9700
|
+
yargs38.positional("directory", {
|
|
9135
9701
|
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.",
|
|
9136
9702
|
type: "string"
|
|
9137
9703
|
}).option("format", {
|
|
@@ -9174,7 +9740,7 @@ var ProjectMapNodePullModule = {
|
|
|
9174
9740
|
let target;
|
|
9175
9741
|
const isPackage = isPathAPackageFile(directory);
|
|
9176
9742
|
const expandedSelectIdentifier = (object) => {
|
|
9177
|
-
return
|
|
9743
|
+
return selectIdentifier14(object, projectId);
|
|
9178
9744
|
};
|
|
9179
9745
|
if (isPackage) {
|
|
9180
9746
|
const packageContents = readContextPackage2(directory, false);
|
|
@@ -9182,7 +9748,7 @@ var ProjectMapNodePullModule = {
|
|
|
9182
9748
|
name: `Package file ${directory}`,
|
|
9183
9749
|
objects: packageContents.projectMapNodes ?? [],
|
|
9184
9750
|
selectIdentifier: expandedSelectIdentifier,
|
|
9185
|
-
selectDisplayName:
|
|
9751
|
+
selectDisplayName: selectDisplayName14,
|
|
9186
9752
|
onSyncComplete: async (_, synced) => {
|
|
9187
9753
|
packageContents.projectMapNodes = synced;
|
|
9188
9754
|
writeContextPackage2(directory, packageContents);
|
|
@@ -9192,7 +9758,7 @@ var ProjectMapNodePullModule = {
|
|
|
9192
9758
|
target = await createFileSyncEngineDataSource({
|
|
9193
9759
|
directory,
|
|
9194
9760
|
selectIdentifier: expandedSelectIdentifier,
|
|
9195
|
-
selectDisplayName:
|
|
9761
|
+
selectDisplayName: selectDisplayName14,
|
|
9196
9762
|
format,
|
|
9197
9763
|
selectFilename
|
|
9198
9764
|
});
|
|
@@ -9216,11 +9782,11 @@ import {
|
|
|
9216
9782
|
var ProjectMapNodePushModule = {
|
|
9217
9783
|
command: "push <directory>",
|
|
9218
9784
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
9219
|
-
builder: (
|
|
9785
|
+
builder: (yargs38) => withConfiguration(
|
|
9220
9786
|
withApiOptions(
|
|
9221
9787
|
withProjectOptions(
|
|
9222
9788
|
withDiffOptions(
|
|
9223
|
-
|
|
9789
|
+
yargs38.positional("directory", {
|
|
9224
9790
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
9225
9791
|
type: "string"
|
|
9226
9792
|
}).option("what-if", {
|
|
@@ -9260,7 +9826,7 @@ var ProjectMapNodePushModule = {
|
|
|
9260
9826
|
let source;
|
|
9261
9827
|
const isPackage = isPathAPackageFile(directory);
|
|
9262
9828
|
const expandedSelectIdentifier = (object) => {
|
|
9263
|
-
return
|
|
9829
|
+
return selectIdentifier14(object, projectId);
|
|
9264
9830
|
};
|
|
9265
9831
|
if (isPackage) {
|
|
9266
9832
|
const packageContents = readContextPackage2(directory, true);
|
|
@@ -9270,13 +9836,13 @@ var ProjectMapNodePushModule = {
|
|
|
9270
9836
|
return a.path.length - b.path.length;
|
|
9271
9837
|
}) ?? [],
|
|
9272
9838
|
selectIdentifier: expandedSelectIdentifier,
|
|
9273
|
-
selectDisplayName:
|
|
9839
|
+
selectDisplayName: selectDisplayName14
|
|
9274
9840
|
});
|
|
9275
9841
|
} else {
|
|
9276
9842
|
source = await createFileSyncEngineDataSource({
|
|
9277
9843
|
directory,
|
|
9278
9844
|
selectIdentifier: expandedSelectIdentifier,
|
|
9279
|
-
selectDisplayName:
|
|
9845
|
+
selectDisplayName: selectDisplayName14,
|
|
9280
9846
|
selectFilename
|
|
9281
9847
|
});
|
|
9282
9848
|
}
|
|
@@ -9307,7 +9873,7 @@ var ProjectMapNodePushModule = {
|
|
|
9307
9873
|
name: `Nodes re-push from ${directory}`,
|
|
9308
9874
|
objects: Array.from(nodesFailedDueToMissingParent),
|
|
9309
9875
|
selectIdentifier: expandedSelectIdentifier,
|
|
9310
|
-
selectDisplayName:
|
|
9876
|
+
selectDisplayName: selectDisplayName14
|
|
9311
9877
|
});
|
|
9312
9878
|
await attemptSync();
|
|
9313
9879
|
} else {
|
|
@@ -9325,10 +9891,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
9325
9891
|
command: "remove <id> <projectMapId>",
|
|
9326
9892
|
aliases: ["delete", "rm"],
|
|
9327
9893
|
describe: "Delete a project map node",
|
|
9328
|
-
builder: (
|
|
9894
|
+
builder: (yargs38) => withConfiguration(
|
|
9329
9895
|
withApiOptions(
|
|
9330
9896
|
withProjectOptions(
|
|
9331
|
-
|
|
9897
|
+
yargs38.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
9332
9898
|
)
|
|
9333
9899
|
)
|
|
9334
9900
|
),
|
|
@@ -9345,10 +9911,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
9345
9911
|
command: "update <filename> <projectMapId>",
|
|
9346
9912
|
aliases: ["put"],
|
|
9347
9913
|
describe: "Insert or update a project map node",
|
|
9348
|
-
builder: (
|
|
9914
|
+
builder: (yargs38) => withConfiguration(
|
|
9349
9915
|
withApiOptions(
|
|
9350
9916
|
withProjectOptions(
|
|
9351
|
-
|
|
9917
|
+
yargs38.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
9352
9918
|
)
|
|
9353
9919
|
)
|
|
9354
9920
|
),
|
|
@@ -9364,9 +9930,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
9364
9930
|
var ProjectMapNodeModule = {
|
|
9365
9931
|
command: "node <command>",
|
|
9366
9932
|
describe: "Commands for ProjectMap Nodes",
|
|
9367
|
-
builder: (
|
|
9933
|
+
builder: (yargs38) => yargs38.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
9368
9934
|
handler: () => {
|
|
9369
|
-
|
|
9935
|
+
yargs32.help();
|
|
9370
9936
|
}
|
|
9371
9937
|
};
|
|
9372
9938
|
|
|
@@ -9375,28 +9941,28 @@ var ProjectMapCommand = {
|
|
|
9375
9941
|
command: "project-map <command>",
|
|
9376
9942
|
aliases: ["prm"],
|
|
9377
9943
|
describe: "Uniform ProjectMap commands",
|
|
9378
|
-
builder: (
|
|
9944
|
+
builder: (yargs38) => yargs38.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
9379
9945
|
handler: () => {
|
|
9380
|
-
|
|
9946
|
+
yargs33.showHelp();
|
|
9381
9947
|
}
|
|
9382
9948
|
};
|
|
9383
9949
|
|
|
9384
9950
|
// src/commands/redirect/index.ts
|
|
9385
|
-
import
|
|
9951
|
+
import yargs35 from "yargs";
|
|
9386
9952
|
|
|
9387
9953
|
// src/commands/redirect/commands/redirect.ts
|
|
9388
|
-
import
|
|
9954
|
+
import yargs34 from "yargs";
|
|
9389
9955
|
|
|
9390
9956
|
// src/commands/redirect/commands/RedirectDefinition/get.ts
|
|
9391
9957
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
9392
9958
|
var RedirectDefinitionGetModule = {
|
|
9393
9959
|
command: "get <id>",
|
|
9394
9960
|
describe: "Fetch a redirect",
|
|
9395
|
-
builder: (
|
|
9961
|
+
builder: (yargs38) => withConfiguration(
|
|
9396
9962
|
withFormatOptions(
|
|
9397
9963
|
withApiOptions(
|
|
9398
9964
|
withProjectOptions(
|
|
9399
|
-
|
|
9965
|
+
yargs38.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
9400
9966
|
)
|
|
9401
9967
|
)
|
|
9402
9968
|
)
|
|
@@ -9420,7 +9986,7 @@ var RedirectDefinitionListModule = {
|
|
|
9420
9986
|
command: "list",
|
|
9421
9987
|
describe: "List of redirects",
|
|
9422
9988
|
aliases: ["ls"],
|
|
9423
|
-
builder: (
|
|
9989
|
+
builder: (yargs38) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs38)))),
|
|
9424
9990
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9425
9991
|
const fetch3 = nodeFetchProxy(proxy);
|
|
9426
9992
|
const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -9441,12 +10007,12 @@ function writeContextPackage3(filename, packageContents) {
|
|
|
9441
10007
|
}
|
|
9442
10008
|
|
|
9443
10009
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
9444
|
-
var
|
|
10010
|
+
var selectIdentifier15 = (source) => source.id;
|
|
9445
10011
|
var selectFilename2 = (source) => {
|
|
9446
10012
|
const index = source.sourceUrl.lastIndexOf("/");
|
|
9447
10013
|
return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
|
|
9448
10014
|
};
|
|
9449
|
-
var
|
|
10015
|
+
var selectDisplayName15 = (source) => {
|
|
9450
10016
|
let pathName = source.sourceUrl;
|
|
9451
10017
|
if (pathName.length > 30) {
|
|
9452
10018
|
const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
|
|
@@ -9463,9 +10029,9 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
9463
10029
|
const redirects = client.getAllRedirects();
|
|
9464
10030
|
for await (const redirect of redirects) {
|
|
9465
10031
|
const result = {
|
|
9466
|
-
id:
|
|
9467
|
-
displayName:
|
|
9468
|
-
providerId:
|
|
10032
|
+
id: selectIdentifier15(redirect.redirect),
|
|
10033
|
+
displayName: selectDisplayName15(redirect.redirect),
|
|
10034
|
+
providerId: selectIdentifier15(redirect.redirect),
|
|
9469
10035
|
object: redirect.redirect
|
|
9470
10036
|
};
|
|
9471
10037
|
yield result;
|
|
@@ -9487,11 +10053,11 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
9487
10053
|
var RedirectDefinitionPullModule = {
|
|
9488
10054
|
command: "pull <directory>",
|
|
9489
10055
|
describe: "Pulls all redirects to local files in a directory",
|
|
9490
|
-
builder: (
|
|
10056
|
+
builder: (yargs38) => withConfiguration(
|
|
9491
10057
|
withApiOptions(
|
|
9492
10058
|
withProjectOptions(
|
|
9493
10059
|
withDiffOptions(
|
|
9494
|
-
|
|
10060
|
+
yargs38.positional("directory", {
|
|
9495
10061
|
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.",
|
|
9496
10062
|
type: "string"
|
|
9497
10063
|
}).option("format", {
|
|
@@ -9538,8 +10104,8 @@ var RedirectDefinitionPullModule = {
|
|
|
9538
10104
|
target = await createArraySyncEngineDataSource({
|
|
9539
10105
|
name: `Package file ${directory}`,
|
|
9540
10106
|
objects: packageContents.redirects ?? [],
|
|
9541
|
-
selectIdentifier:
|
|
9542
|
-
selectDisplayName:
|
|
10107
|
+
selectIdentifier: selectIdentifier15,
|
|
10108
|
+
selectDisplayName: selectDisplayName15,
|
|
9543
10109
|
onSyncComplete: async (_, synced) => {
|
|
9544
10110
|
packageContents.redirects = synced;
|
|
9545
10111
|
writeContextPackage3(directory, packageContents);
|
|
@@ -9549,8 +10115,8 @@ var RedirectDefinitionPullModule = {
|
|
|
9549
10115
|
target = await createFileSyncEngineDataSource({
|
|
9550
10116
|
directory,
|
|
9551
10117
|
selectFilename: selectFilename2,
|
|
9552
|
-
selectIdentifier:
|
|
9553
|
-
selectDisplayName:
|
|
10118
|
+
selectIdentifier: selectIdentifier15,
|
|
10119
|
+
selectDisplayName: selectDisplayName15,
|
|
9554
10120
|
format
|
|
9555
10121
|
});
|
|
9556
10122
|
}
|
|
@@ -9570,11 +10136,11 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
|
|
|
9570
10136
|
var RedirectDefinitionPushModule = {
|
|
9571
10137
|
command: "push <directory>",
|
|
9572
10138
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
9573
|
-
builder: (
|
|
10139
|
+
builder: (yargs38) => withConfiguration(
|
|
9574
10140
|
withApiOptions(
|
|
9575
10141
|
withProjectOptions(
|
|
9576
10142
|
withDiffOptions(
|
|
9577
|
-
|
|
10143
|
+
yargs38.positional("directory", {
|
|
9578
10144
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
9579
10145
|
type: "string"
|
|
9580
10146
|
}).option("what-if", {
|
|
@@ -9613,14 +10179,14 @@ var RedirectDefinitionPushModule = {
|
|
|
9613
10179
|
source = await createArraySyncEngineDataSource({
|
|
9614
10180
|
name: `Package file ${directory}`,
|
|
9615
10181
|
objects: packageContents.redirects ?? [],
|
|
9616
|
-
selectIdentifier:
|
|
9617
|
-
selectDisplayName:
|
|
10182
|
+
selectIdentifier: selectIdentifier15,
|
|
10183
|
+
selectDisplayName: selectDisplayName15
|
|
9618
10184
|
});
|
|
9619
10185
|
} else {
|
|
9620
10186
|
source = await createFileSyncEngineDataSource({
|
|
9621
10187
|
directory,
|
|
9622
|
-
selectIdentifier:
|
|
9623
|
-
selectDisplayName:
|
|
10188
|
+
selectIdentifier: selectIdentifier15,
|
|
10189
|
+
selectDisplayName: selectDisplayName15
|
|
9624
10190
|
});
|
|
9625
10191
|
}
|
|
9626
10192
|
const target = createRedirectDefinitionEngineDataSource({ client });
|
|
@@ -9641,9 +10207,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
9641
10207
|
command: "remove <id>",
|
|
9642
10208
|
aliases: ["delete", "rm"],
|
|
9643
10209
|
describe: "Delete a redirect",
|
|
9644
|
-
builder: (
|
|
10210
|
+
builder: (yargs38) => withConfiguration(
|
|
9645
10211
|
withApiOptions(
|
|
9646
|
-
withProjectOptions(
|
|
10212
|
+
withProjectOptions(yargs38.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
9647
10213
|
)
|
|
9648
10214
|
),
|
|
9649
10215
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -9659,10 +10225,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
9659
10225
|
command: "update <filename>",
|
|
9660
10226
|
aliases: ["put"],
|
|
9661
10227
|
describe: "Insert or update a redirect",
|
|
9662
|
-
builder: (
|
|
10228
|
+
builder: (yargs38) => withConfiguration(
|
|
9663
10229
|
withApiOptions(
|
|
9664
10230
|
withProjectOptions(
|
|
9665
|
-
|
|
10231
|
+
yargs38.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
9666
10232
|
)
|
|
9667
10233
|
)
|
|
9668
10234
|
),
|
|
@@ -9678,9 +10244,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
9678
10244
|
var RedirectDefinitionModule = {
|
|
9679
10245
|
command: "definition <command>",
|
|
9680
10246
|
describe: "Commands for Redirect Definitions",
|
|
9681
|
-
builder: (
|
|
10247
|
+
builder: (yargs38) => yargs38.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
9682
10248
|
handler: () => {
|
|
9683
|
-
|
|
10249
|
+
yargs34.help();
|
|
9684
10250
|
}
|
|
9685
10251
|
};
|
|
9686
10252
|
|
|
@@ -9689,14 +10255,14 @@ var RedirectCommand = {
|
|
|
9689
10255
|
command: "redirect <command>",
|
|
9690
10256
|
aliases: ["red"],
|
|
9691
10257
|
describe: "Uniform Redirect commands",
|
|
9692
|
-
builder: (
|
|
10258
|
+
builder: (yargs38) => yargs38.command(RedirectDefinitionModule).demandCommand(),
|
|
9693
10259
|
handler: () => {
|
|
9694
|
-
|
|
10260
|
+
yargs35.showHelp();
|
|
9695
10261
|
}
|
|
9696
10262
|
};
|
|
9697
10263
|
|
|
9698
10264
|
// src/commands/sync/index.ts
|
|
9699
|
-
import
|
|
10265
|
+
import yargs36 from "yargs";
|
|
9700
10266
|
|
|
9701
10267
|
// src/commands/sync/commands/util.ts
|
|
9702
10268
|
import ora2 from "ora";
|
|
@@ -9756,12 +10322,12 @@ function patchConsole(fn, ora3, replay = []) {
|
|
|
9756
10322
|
var SyncPullModule = {
|
|
9757
10323
|
command: "pull",
|
|
9758
10324
|
describe: "Pulls whole project to local files in a directory",
|
|
9759
|
-
builder: (
|
|
10325
|
+
builder: (yargs38) => withConfiguration(
|
|
9760
10326
|
withApiOptions(
|
|
9761
10327
|
withProjectOptions(
|
|
9762
10328
|
withDebugOptions(
|
|
9763
10329
|
withDiffOptions(
|
|
9764
|
-
|
|
10330
|
+
yargs38.option("what-if", {
|
|
9765
10331
|
alias: ["w"],
|
|
9766
10332
|
describe: "What-if mode reports what would be done but changes no files",
|
|
9767
10333
|
default: false,
|
|
@@ -9796,7 +10362,9 @@ var SyncPullModule = {
|
|
|
9796
10362
|
redirect: RedirectDefinitionPullModule,
|
|
9797
10363
|
entry: EntryPullModule,
|
|
9798
10364
|
entryPattern: EntryPatternPullModule,
|
|
9799
|
-
contentType: ContentTypePullModule
|
|
10365
|
+
contentType: ContentTypePullModule,
|
|
10366
|
+
previewUrl: PreviewUrlPullModule,
|
|
10367
|
+
previewViewport: PreviewViewportPullModule
|
|
9800
10368
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9801
10369
|
}).filter(([entityType]) => {
|
|
9802
10370
|
return Boolean(config2.entitiesConfig?.[entityType]) && config2.entitiesConfig?.[entityType]?.disabled !== true && config2.entitiesConfig?.[entityType]?.pull?.disabled !== true;
|
|
@@ -9868,7 +10436,7 @@ var getFormat = (entityType, config2) => {
|
|
|
9868
10436
|
var SyncPushModule = {
|
|
9869
10437
|
command: "push",
|
|
9870
10438
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
9871
|
-
builder: (
|
|
10439
|
+
builder: (yargs38) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs38))))),
|
|
9872
10440
|
handler: async ({ serialization, ...otherParams }) => {
|
|
9873
10441
|
const config2 = serialization;
|
|
9874
10442
|
const enabledEntities = Object.entries({
|
|
@@ -9893,7 +10461,9 @@ var SyncPushModule = {
|
|
|
9893
10461
|
redirect: RedirectDefinitionPushModule,
|
|
9894
10462
|
contentType: ContentTypePushModule,
|
|
9895
10463
|
entry: EntryPushModule,
|
|
9896
|
-
entryPattern: EntryPatternPushModule
|
|
10464
|
+
entryPattern: EntryPatternPushModule,
|
|
10465
|
+
previewUrl: PreviewUrlPushModule,
|
|
10466
|
+
previewViewport: PreviewViewportPushModule
|
|
9897
10467
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9898
10468
|
}).filter(([entityType]) => {
|
|
9899
10469
|
return Boolean(config2.entitiesConfig?.[entityType]) && config2.entitiesConfig?.[entityType]?.disabled !== true && config2.entitiesConfig?.[entityType]?.push?.disabled !== true;
|
|
@@ -9976,9 +10546,9 @@ var getFormat2 = (entityType, config2) => {
|
|
|
9976
10546
|
var SyncCommand = {
|
|
9977
10547
|
command: "sync <command>",
|
|
9978
10548
|
describe: "Uniform Sync commands",
|
|
9979
|
-
builder: (
|
|
10549
|
+
builder: (yargs38) => yargs38.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
9980
10550
|
handler: () => {
|
|
9981
|
-
|
|
10551
|
+
yargs36.showHelp();
|
|
9982
10552
|
}
|
|
9983
10553
|
};
|
|
9984
10554
|
|
|
@@ -10250,7 +10820,7 @@ First found was: v${firstVersion}`;
|
|
|
10250
10820
|
|
|
10251
10821
|
// src/index.ts
|
|
10252
10822
|
dotenv.config();
|
|
10253
|
-
var yarggery =
|
|
10823
|
+
var yarggery = yargs37(hideBin(process.argv));
|
|
10254
10824
|
var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
|
|
10255
10825
|
var configuration = loadConfig(inlineConfigurationFilePath || null);
|
|
10256
10826
|
yarggery.option("verbose", {
|