@uniformdev/cli 20.29.2-alpha.6 → 20.30.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
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
22
|
import * as dotenv from "dotenv";
|
|
23
|
-
import
|
|
23
|
+
import yargs34 from "yargs";
|
|
24
24
|
import { hideBin } from "yargs/helpers";
|
|
25
25
|
|
|
26
26
|
// src/commands/canvas/index.ts
|
|
27
|
-
import
|
|
27
|
+
import yargs17 from "yargs";
|
|
28
28
|
|
|
29
29
|
// src/commands/canvas/commands/asset.ts
|
|
30
30
|
import yargs from "yargs";
|
|
@@ -33,20 +33,20 @@ import yargs from "yargs";
|
|
|
33
33
|
async function createArraySyncEngineDataSource({
|
|
34
34
|
name,
|
|
35
35
|
objects,
|
|
36
|
-
selectIdentifier:
|
|
37
|
-
selectDisplayName:
|
|
36
|
+
selectIdentifier: selectIdentifier16,
|
|
37
|
+
selectDisplayName: selectDisplayName16 = selectIdentifier16,
|
|
38
38
|
onSyncComplete,
|
|
39
39
|
onBeforeDeleteObject
|
|
40
40
|
}) {
|
|
41
41
|
const objectIndex = objects.reduce(
|
|
42
42
|
(result, current) => {
|
|
43
|
-
const rawIdentifiers =
|
|
43
|
+
const rawIdentifiers = selectIdentifier16(current);
|
|
44
44
|
const identifiers = Array.isArray(rawIdentifiers) ? rawIdentifiers : [rawIdentifiers];
|
|
45
45
|
const existingResult = identifiers.find((id) => result[id]);
|
|
46
46
|
if (existingResult) {
|
|
47
47
|
throw new Error(`Identifier(s) ${identifiers} was not unique.`);
|
|
48
48
|
}
|
|
49
|
-
const displayName =
|
|
49
|
+
const displayName = selectDisplayName16(current);
|
|
50
50
|
result[identifiers[0]] = {
|
|
51
51
|
id: identifiers,
|
|
52
52
|
object: current,
|
|
@@ -76,7 +76,7 @@ async function createArraySyncEngineDataSource({
|
|
|
76
76
|
delete objectIndex[providerId];
|
|
77
77
|
},
|
|
78
78
|
writeObject: async (objectToWrite) => {
|
|
79
|
-
const id =
|
|
79
|
+
const id = selectIdentifier16(objectToWrite.object);
|
|
80
80
|
if (Array.isArray(id)) {
|
|
81
81
|
objectIndex[id[0]] = objectToWrite;
|
|
82
82
|
} else {
|
|
@@ -156,8 +156,8 @@ export default uniformConfig({
|
|
|
156
156
|
async function createFileSyncEngineDataSource({
|
|
157
157
|
directory,
|
|
158
158
|
format = "yaml",
|
|
159
|
-
selectIdentifier:
|
|
160
|
-
selectDisplayName:
|
|
159
|
+
selectIdentifier: selectIdentifier16,
|
|
160
|
+
selectDisplayName: selectDisplayName16 = selectIdentifier16,
|
|
161
161
|
selectFilename: selectFilename3,
|
|
162
162
|
selectSchemaUrl: selectSchemaUrl2,
|
|
163
163
|
onBeforeDeleteObject,
|
|
@@ -186,9 +186,9 @@ async function createFileSyncEngineDataSource({
|
|
|
186
186
|
const fullFilename = join(directory, filename);
|
|
187
187
|
try {
|
|
188
188
|
const contents = readFileToObject(fullFilename);
|
|
189
|
-
const displayName =
|
|
189
|
+
const displayName = selectDisplayName16(contents);
|
|
190
190
|
const object = {
|
|
191
|
-
id:
|
|
191
|
+
id: selectIdentifier16(contents),
|
|
192
192
|
displayName: Array.isArray(displayName) ? displayName[0] : displayName,
|
|
193
193
|
providerId: fullFilename,
|
|
194
194
|
object: omit(contents, ["$schema"])
|
|
@@ -584,12 +584,12 @@ function getFileClient(options) {
|
|
|
584
584
|
var AssetGetModule = {
|
|
585
585
|
command: "get <id>",
|
|
586
586
|
describe: "Get an asset",
|
|
587
|
-
builder: (
|
|
587
|
+
builder: (yargs35) => withConfiguration(
|
|
588
588
|
withDebugOptions(
|
|
589
589
|
withFormatOptions(
|
|
590
590
|
withApiOptions(
|
|
591
591
|
withProjectOptions(
|
|
592
|
-
|
|
592
|
+
yargs35.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
593
593
|
)
|
|
594
594
|
)
|
|
595
595
|
)
|
|
@@ -610,7 +610,7 @@ var AssetGetModule = {
|
|
|
610
610
|
var AssetListModule = {
|
|
611
611
|
command: "list",
|
|
612
612
|
describe: "List assets",
|
|
613
|
-
builder: (
|
|
613
|
+
builder: (yargs35) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs35))))),
|
|
614
614
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
615
615
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
616
616
|
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -1163,8 +1163,8 @@ function prepCompositionForDisk(composition) {
|
|
|
1163
1163
|
delete prepped.state;
|
|
1164
1164
|
return prepped;
|
|
1165
1165
|
}
|
|
1166
|
-
function withStateOptions(
|
|
1167
|
-
return
|
|
1166
|
+
function withStateOptions(yargs35, defaultState = "preview") {
|
|
1167
|
+
return yargs35.option("state", {
|
|
1168
1168
|
type: "string",
|
|
1169
1169
|
describe: `State to fetch.`,
|
|
1170
1170
|
choices: ["preview", "published"],
|
|
@@ -1246,12 +1246,12 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
1246
1246
|
var AssetPullModule = {
|
|
1247
1247
|
command: "pull <directory>",
|
|
1248
1248
|
describe: "Pulls all assets to local files in a directory",
|
|
1249
|
-
builder: (
|
|
1249
|
+
builder: (yargs35) => withConfiguration(
|
|
1250
1250
|
withApiOptions(
|
|
1251
1251
|
withDebugOptions(
|
|
1252
1252
|
withProjectOptions(
|
|
1253
1253
|
withDiffOptions(
|
|
1254
|
-
|
|
1254
|
+
yargs35.positional("directory", {
|
|
1255
1255
|
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.",
|
|
1256
1256
|
type: "string"
|
|
1257
1257
|
}).option("format", {
|
|
@@ -1363,12 +1363,12 @@ var AssetPullModule = {
|
|
|
1363
1363
|
var AssetPushModule = {
|
|
1364
1364
|
command: "push <directory>",
|
|
1365
1365
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
1366
|
-
builder: (
|
|
1366
|
+
builder: (yargs35) => withConfiguration(
|
|
1367
1367
|
withApiOptions(
|
|
1368
1368
|
withDebugOptions(
|
|
1369
1369
|
withProjectOptions(
|
|
1370
1370
|
withDiffOptions(
|
|
1371
|
-
|
|
1371
|
+
yargs35.positional("directory", {
|
|
1372
1372
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
1373
1373
|
type: "string"
|
|
1374
1374
|
}).option("mode", {
|
|
@@ -1492,10 +1492,10 @@ var AssetRemoveModule = {
|
|
|
1492
1492
|
command: "remove <id>",
|
|
1493
1493
|
aliases: ["delete", "rm"],
|
|
1494
1494
|
describe: "Delete an asset",
|
|
1495
|
-
builder: (
|
|
1495
|
+
builder: (yargs35) => withConfiguration(
|
|
1496
1496
|
withDebugOptions(
|
|
1497
1497
|
withApiOptions(
|
|
1498
|
-
withProjectOptions(
|
|
1498
|
+
withProjectOptions(yargs35.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
1499
1499
|
)
|
|
1500
1500
|
)
|
|
1501
1501
|
),
|
|
@@ -1516,11 +1516,11 @@ var AssetUpdateModule = {
|
|
|
1516
1516
|
command: "update <filename>",
|
|
1517
1517
|
aliases: ["put"],
|
|
1518
1518
|
describe: "Insert or update an asset",
|
|
1519
|
-
builder: (
|
|
1519
|
+
builder: (yargs35) => withConfiguration(
|
|
1520
1520
|
withDebugOptions(
|
|
1521
1521
|
withApiOptions(
|
|
1522
1522
|
withProjectOptions(
|
|
1523
|
-
|
|
1523
|
+
yargs35.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
1524
1524
|
)
|
|
1525
1525
|
)
|
|
1526
1526
|
)
|
|
@@ -1546,7 +1546,7 @@ var AssetUpdateModule = {
|
|
|
1546
1546
|
var AssetModule = {
|
|
1547
1547
|
command: "asset <command>",
|
|
1548
1548
|
describe: "Commands for Assets",
|
|
1549
|
-
builder: (
|
|
1549
|
+
builder: (yargs35) => yargs35.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
1550
1550
|
handler: () => {
|
|
1551
1551
|
yargs.help();
|
|
1552
1552
|
}
|
|
@@ -1567,12 +1567,12 @@ function getCategoryClient(options) {
|
|
|
1567
1567
|
var CategoryGetModule = {
|
|
1568
1568
|
command: "get <id>",
|
|
1569
1569
|
describe: "Fetch a category",
|
|
1570
|
-
builder: (
|
|
1570
|
+
builder: (yargs35) => withConfiguration(
|
|
1571
1571
|
withFormatOptions(
|
|
1572
1572
|
withDebugOptions(
|
|
1573
1573
|
withApiOptions(
|
|
1574
1574
|
withProjectOptions(
|
|
1575
|
-
|
|
1575
|
+
yargs35.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
1576
1576
|
)
|
|
1577
1577
|
)
|
|
1578
1578
|
)
|
|
@@ -1597,8 +1597,8 @@ var CategoryListModule = {
|
|
|
1597
1597
|
command: "list",
|
|
1598
1598
|
describe: "List categories",
|
|
1599
1599
|
aliases: ["ls"],
|
|
1600
|
-
builder: (
|
|
1601
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
1600
|
+
builder: (yargs35) => withConfiguration(
|
|
1601
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs35.options({})))))
|
|
1602
1602
|
),
|
|
1603
1603
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
1604
1604
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -1642,12 +1642,12 @@ function createCategoriesEngineDataSource({
|
|
|
1642
1642
|
var CategoryPullModule = {
|
|
1643
1643
|
command: "pull <directory>",
|
|
1644
1644
|
describe: "Pulls all categories to local files in a directory",
|
|
1645
|
-
builder: (
|
|
1645
|
+
builder: (yargs35) => withConfiguration(
|
|
1646
1646
|
withApiOptions(
|
|
1647
1647
|
withProjectOptions(
|
|
1648
1648
|
withDiffOptions(
|
|
1649
1649
|
withDebugOptions(
|
|
1650
|
-
|
|
1650
|
+
yargs35.positional("directory", {
|
|
1651
1651
|
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.",
|
|
1652
1652
|
type: "string"
|
|
1653
1653
|
}).option("format", {
|
|
@@ -1722,12 +1722,12 @@ var CategoryPullModule = {
|
|
|
1722
1722
|
var CategoryPushModule = {
|
|
1723
1723
|
command: "push <directory>",
|
|
1724
1724
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
1725
|
-
builder: (
|
|
1725
|
+
builder: (yargs35) => withConfiguration(
|
|
1726
1726
|
withApiOptions(
|
|
1727
1727
|
withDebugOptions(
|
|
1728
1728
|
withProjectOptions(
|
|
1729
1729
|
withDiffOptions(
|
|
1730
|
-
|
|
1730
|
+
yargs35.positional("directory", {
|
|
1731
1731
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
1732
1732
|
type: "string"
|
|
1733
1733
|
}).option("mode", {
|
|
@@ -1791,11 +1791,11 @@ var CategoryRemoveModule = {
|
|
|
1791
1791
|
command: "remove <id>",
|
|
1792
1792
|
aliases: ["delete", "rm"],
|
|
1793
1793
|
describe: "Delete a category",
|
|
1794
|
-
builder: (
|
|
1794
|
+
builder: (yargs35) => withConfiguration(
|
|
1795
1795
|
withApiOptions(
|
|
1796
1796
|
withDebugOptions(
|
|
1797
1797
|
withProjectOptions(
|
|
1798
|
-
|
|
1798
|
+
yargs35.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
1799
1799
|
)
|
|
1800
1800
|
)
|
|
1801
1801
|
)
|
|
@@ -1816,11 +1816,11 @@ var CategoryUpdateModule = {
|
|
|
1816
1816
|
command: "update <filename>",
|
|
1817
1817
|
aliases: ["put"],
|
|
1818
1818
|
describe: "Insert or update a category",
|
|
1819
|
-
builder: (
|
|
1819
|
+
builder: (yargs35) => withConfiguration(
|
|
1820
1820
|
withApiOptions(
|
|
1821
1821
|
withDebugOptions(
|
|
1822
1822
|
withProjectOptions(
|
|
1823
|
-
|
|
1823
|
+
yargs35.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
1824
1824
|
)
|
|
1825
1825
|
)
|
|
1826
1826
|
)
|
|
@@ -1842,7 +1842,7 @@ var CategoryModule = {
|
|
|
1842
1842
|
command: "category <command>",
|
|
1843
1843
|
aliases: ["cat"],
|
|
1844
1844
|
describe: "Commands for Canvas categories",
|
|
1845
|
-
builder: (
|
|
1845
|
+
builder: (yargs35) => yargs35.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
1846
1846
|
handler: () => {
|
|
1847
1847
|
yargs2.help();
|
|
1848
1848
|
}
|
|
@@ -1864,12 +1864,12 @@ function getCanvasClient(options) {
|
|
|
1864
1864
|
var ComponentGetModule = {
|
|
1865
1865
|
command: "get <id>",
|
|
1866
1866
|
describe: "Fetch a component definition",
|
|
1867
|
-
builder: (
|
|
1867
|
+
builder: (yargs35) => withConfiguration(
|
|
1868
1868
|
withFormatOptions(
|
|
1869
1869
|
withDebugOptions(
|
|
1870
1870
|
withApiOptions(
|
|
1871
1871
|
withProjectOptions(
|
|
1872
|
-
|
|
1872
|
+
yargs35.positional("id", {
|
|
1873
1873
|
demandOption: true,
|
|
1874
1874
|
describe: "Component definition public ID to fetch"
|
|
1875
1875
|
})
|
|
@@ -1903,12 +1903,12 @@ var ComponentListModule = {
|
|
|
1903
1903
|
command: "list",
|
|
1904
1904
|
describe: "List component definitions",
|
|
1905
1905
|
aliases: ["ls"],
|
|
1906
|
-
builder: (
|
|
1906
|
+
builder: (yargs35) => withConfiguration(
|
|
1907
1907
|
withFormatOptions(
|
|
1908
1908
|
withDebugOptions(
|
|
1909
1909
|
withApiOptions(
|
|
1910
1910
|
withProjectOptions(
|
|
1911
|
-
|
|
1911
|
+
yargs35.options({
|
|
1912
1912
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1913
1913
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
1914
1914
|
})
|
|
@@ -1972,12 +1972,12 @@ function createComponentDefinitionEngineDataSource({
|
|
|
1972
1972
|
var ComponentPullModule = {
|
|
1973
1973
|
command: "pull <directory>",
|
|
1974
1974
|
describe: "Pulls all component definitions to local files in a directory",
|
|
1975
|
-
builder: (
|
|
1975
|
+
builder: (yargs35) => withConfiguration(
|
|
1976
1976
|
withApiOptions(
|
|
1977
1977
|
withDebugOptions(
|
|
1978
1978
|
withProjectOptions(
|
|
1979
1979
|
withDiffOptions(
|
|
1980
|
-
|
|
1980
|
+
yargs35.positional("directory", {
|
|
1981
1981
|
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.",
|
|
1982
1982
|
type: "string"
|
|
1983
1983
|
}).option("format", {
|
|
@@ -2053,12 +2053,12 @@ var ComponentPullModule = {
|
|
|
2053
2053
|
var ComponentPushModule = {
|
|
2054
2054
|
command: "push <directory>",
|
|
2055
2055
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
2056
|
-
builder: (
|
|
2056
|
+
builder: (yargs35) => withConfiguration(
|
|
2057
2057
|
withApiOptions(
|
|
2058
2058
|
withDebugOptions(
|
|
2059
2059
|
withProjectOptions(
|
|
2060
2060
|
withDiffOptions(
|
|
2061
|
-
|
|
2061
|
+
yargs35.positional("directory", {
|
|
2062
2062
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
2063
2063
|
type: "string"
|
|
2064
2064
|
}).option("mode", {
|
|
@@ -2123,11 +2123,11 @@ var ComponentRemoveModule = {
|
|
|
2123
2123
|
command: "remove <id>",
|
|
2124
2124
|
aliases: ["delete", "rm"],
|
|
2125
2125
|
describe: "Delete a component definition",
|
|
2126
|
-
builder: (
|
|
2126
|
+
builder: (yargs35) => withConfiguration(
|
|
2127
2127
|
withDebugOptions(
|
|
2128
2128
|
withApiOptions(
|
|
2129
2129
|
withProjectOptions(
|
|
2130
|
-
|
|
2130
|
+
yargs35.positional("id", {
|
|
2131
2131
|
demandOption: true,
|
|
2132
2132
|
describe: "Component definition public ID to delete"
|
|
2133
2133
|
})
|
|
@@ -2151,11 +2151,11 @@ var ComponentUpdateModule = {
|
|
|
2151
2151
|
command: "update <filename>",
|
|
2152
2152
|
aliases: ["put"],
|
|
2153
2153
|
describe: "Insert or update a component definition",
|
|
2154
|
-
builder: (
|
|
2154
|
+
builder: (yargs35) => withConfiguration(
|
|
2155
2155
|
withApiOptions(
|
|
2156
2156
|
withDebugOptions(
|
|
2157
2157
|
withProjectOptions(
|
|
2158
|
-
|
|
2158
|
+
yargs35.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
2159
2159
|
)
|
|
2160
2160
|
)
|
|
2161
2161
|
)
|
|
@@ -2177,7 +2177,7 @@ var ComponentModule = {
|
|
|
2177
2177
|
command: "component <command>",
|
|
2178
2178
|
aliases: ["def"],
|
|
2179
2179
|
describe: "Commands for Canvas component definitions",
|
|
2180
|
-
builder: (
|
|
2180
|
+
builder: (yargs35) => yargs35.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
2181
2181
|
handler: () => {
|
|
2182
2182
|
yargs3.help();
|
|
2183
2183
|
}
|
|
@@ -2190,13 +2190,13 @@ import yargs4 from "yargs";
|
|
|
2190
2190
|
var CompositionGetModule = {
|
|
2191
2191
|
command: "get <id>",
|
|
2192
2192
|
describe: "Fetch a composition",
|
|
2193
|
-
builder: (
|
|
2193
|
+
builder: (yargs35) => withFormatOptions(
|
|
2194
2194
|
withConfiguration(
|
|
2195
2195
|
withApiOptions(
|
|
2196
2196
|
withProjectOptions(
|
|
2197
2197
|
withStateOptions(
|
|
2198
2198
|
withDebugOptions(
|
|
2199
|
-
|
|
2199
|
+
yargs35.positional("id", {
|
|
2200
2200
|
demandOption: true,
|
|
2201
2201
|
describe: "Composition/pattern public ID to fetch"
|
|
2202
2202
|
}).option({
|
|
@@ -2286,13 +2286,13 @@ var CompositionListModule = {
|
|
|
2286
2286
|
command: "list",
|
|
2287
2287
|
describe: "List compositions",
|
|
2288
2288
|
aliases: ["ls"],
|
|
2289
|
-
builder: (
|
|
2289
|
+
builder: (yargs35) => withFormatOptions(
|
|
2290
2290
|
withConfiguration(
|
|
2291
2291
|
withApiOptions(
|
|
2292
2292
|
withProjectOptions(
|
|
2293
2293
|
withDebugOptions(
|
|
2294
2294
|
withStateOptions(
|
|
2295
|
-
|
|
2295
|
+
yargs35.options({
|
|
2296
2296
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2297
2297
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2298
2298
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -2373,13 +2373,13 @@ var CompositionListModule = {
|
|
|
2373
2373
|
var ComponentPatternListModule = {
|
|
2374
2374
|
...CompositionListModule,
|
|
2375
2375
|
describe: "List component patterns",
|
|
2376
|
-
builder: (
|
|
2376
|
+
builder: (yargs35) => withFormatOptions(
|
|
2377
2377
|
withConfiguration(
|
|
2378
2378
|
withApiOptions(
|
|
2379
2379
|
withDebugOptions(
|
|
2380
2380
|
withProjectOptions(
|
|
2381
2381
|
withStateOptions(
|
|
2382
|
-
|
|
2382
|
+
yargs35.options({
|
|
2383
2383
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2384
2384
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2385
2385
|
resolvePatterns: {
|
|
@@ -2502,12 +2502,12 @@ function createComponentInstanceEngineDataSource({
|
|
|
2502
2502
|
var CompositionPublishModule = {
|
|
2503
2503
|
command: "publish [ids]",
|
|
2504
2504
|
describe: "Publishes composition(s)",
|
|
2505
|
-
builder: (
|
|
2505
|
+
builder: (yargs35) => withConfiguration(
|
|
2506
2506
|
withApiOptions(
|
|
2507
2507
|
withProjectOptions(
|
|
2508
2508
|
withDebugOptions(
|
|
2509
2509
|
withDiffOptions(
|
|
2510
|
-
|
|
2510
|
+
yargs35.positional("ids", {
|
|
2511
2511
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2512
2512
|
type: "string"
|
|
2513
2513
|
}).option("all", {
|
|
@@ -2600,12 +2600,12 @@ var CompositionPublishModule = {
|
|
|
2600
2600
|
var ComponentPatternPublishModule = {
|
|
2601
2601
|
...CompositionPublishModule,
|
|
2602
2602
|
describe: "Publishes component pattern(s)",
|
|
2603
|
-
builder: (
|
|
2603
|
+
builder: (yargs35) => withConfiguration(
|
|
2604
2604
|
withApiOptions(
|
|
2605
2605
|
withDebugOptions(
|
|
2606
2606
|
withProjectOptions(
|
|
2607
2607
|
withDiffOptions(
|
|
2608
|
-
|
|
2608
|
+
yargs35.positional("ids", {
|
|
2609
2609
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2610
2610
|
type: "string"
|
|
2611
2611
|
}).option("all", {
|
|
@@ -2645,13 +2645,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
2645
2645
|
return {
|
|
2646
2646
|
command: "pull <directory>",
|
|
2647
2647
|
describe: "Pulls all compositions to local files in a directory",
|
|
2648
|
-
builder: (
|
|
2648
|
+
builder: (yargs35) => withConfiguration(
|
|
2649
2649
|
withApiOptions(
|
|
2650
2650
|
withProjectOptions(
|
|
2651
2651
|
withStateOptions(
|
|
2652
2652
|
withDebugOptions(
|
|
2653
2653
|
withDiffOptions(
|
|
2654
|
-
|
|
2654
|
+
yargs35.positional("directory", {
|
|
2655
2655
|
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.",
|
|
2656
2656
|
type: "string"
|
|
2657
2657
|
}).option("format", {
|
|
@@ -2766,13 +2766,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
2766
2766
|
var ComponentPatternPullModule = {
|
|
2767
2767
|
...componentInstancePullModuleFactory("componentPatterns"),
|
|
2768
2768
|
describe: "Pulls all component patterns to local files in a directory",
|
|
2769
|
-
builder: (
|
|
2769
|
+
builder: (yargs35) => withConfiguration(
|
|
2770
2770
|
withApiOptions(
|
|
2771
2771
|
withProjectOptions(
|
|
2772
2772
|
withDebugOptions(
|
|
2773
2773
|
withStateOptions(
|
|
2774
2774
|
withDiffOptions(
|
|
2775
|
-
|
|
2775
|
+
yargs35.positional("directory", {
|
|
2776
2776
|
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.",
|
|
2777
2777
|
type: "string"
|
|
2778
2778
|
}).option("format", {
|
|
@@ -2846,13 +2846,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
2846
2846
|
return {
|
|
2847
2847
|
command: "push <directory>",
|
|
2848
2848
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
2849
|
-
builder: (
|
|
2849
|
+
builder: (yargs35) => withConfiguration(
|
|
2850
2850
|
withApiOptions(
|
|
2851
2851
|
withProjectOptions(
|
|
2852
2852
|
withStateOptions(
|
|
2853
2853
|
withDebugOptions(
|
|
2854
2854
|
withDiffOptions(
|
|
2855
|
-
|
|
2855
|
+
yargs35.positional("directory", {
|
|
2856
2856
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2857
2857
|
type: "string"
|
|
2858
2858
|
}).option("mode", {
|
|
@@ -2966,13 +2966,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
2966
2966
|
var ComponentPatternPushModule = {
|
|
2967
2967
|
...componentInstancePushModuleFactory("componentPatterns"),
|
|
2968
2968
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
2969
|
-
builder: (
|
|
2969
|
+
builder: (yargs35) => withConfiguration(
|
|
2970
2970
|
withApiOptions(
|
|
2971
2971
|
withProjectOptions(
|
|
2972
2972
|
withStateOptions(
|
|
2973
2973
|
withDiffOptions(
|
|
2974
2974
|
withDebugOptions(
|
|
2975
|
-
|
|
2975
|
+
yargs35.positional("directory", {
|
|
2976
2976
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
2977
2977
|
type: "string"
|
|
2978
2978
|
}).option("mode", {
|
|
@@ -3006,11 +3006,11 @@ var CompositionRemoveModule = {
|
|
|
3006
3006
|
command: "remove <id>",
|
|
3007
3007
|
aliases: ["delete", "rm"],
|
|
3008
3008
|
describe: "Delete a composition",
|
|
3009
|
-
builder: (
|
|
3009
|
+
builder: (yargs35) => withConfiguration(
|
|
3010
3010
|
withApiOptions(
|
|
3011
3011
|
withDebugOptions(
|
|
3012
3012
|
withProjectOptions(
|
|
3013
|
-
|
|
3013
|
+
yargs35.positional("id", {
|
|
3014
3014
|
demandOption: true,
|
|
3015
3015
|
describe: "Composition/pattern public ID to delete"
|
|
3016
3016
|
})
|
|
@@ -3044,11 +3044,11 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
3044
3044
|
var CompositionUnpublishModule = {
|
|
3045
3045
|
command: "unpublish [ids]",
|
|
3046
3046
|
describe: "Unpublish a composition(s)",
|
|
3047
|
-
builder: (
|
|
3047
|
+
builder: (yargs35) => withConfiguration(
|
|
3048
3048
|
withApiOptions(
|
|
3049
3049
|
withDebugOptions(
|
|
3050
3050
|
withProjectOptions(
|
|
3051
|
-
|
|
3051
|
+
yargs35.positional("ids", {
|
|
3052
3052
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3053
3053
|
type: "string"
|
|
3054
3054
|
}).option("all", {
|
|
@@ -3145,11 +3145,11 @@ var CompositionUnpublishModule = {
|
|
|
3145
3145
|
var ComponentPatternUnpublishModule = {
|
|
3146
3146
|
command: "unpublish [ids]",
|
|
3147
3147
|
describe: "Unpublish a component pattern(s)",
|
|
3148
|
-
builder: (
|
|
3148
|
+
builder: (yargs35) => withConfiguration(
|
|
3149
3149
|
withApiOptions(
|
|
3150
3150
|
withDebugOptions(
|
|
3151
3151
|
withProjectOptions(
|
|
3152
|
-
|
|
3152
|
+
yargs35.positional("ids", {
|
|
3153
3153
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3154
3154
|
type: "string"
|
|
3155
3155
|
}).option("all", {
|
|
@@ -3183,12 +3183,12 @@ var CompositionUpdateModule = {
|
|
|
3183
3183
|
command: "update <filename>",
|
|
3184
3184
|
aliases: ["put"],
|
|
3185
3185
|
describe: "Insert or update a composition",
|
|
3186
|
-
builder: (
|
|
3186
|
+
builder: (yargs35) => withConfiguration(
|
|
3187
3187
|
withApiOptions(
|
|
3188
3188
|
withProjectOptions(
|
|
3189
3189
|
withDebugOptions(
|
|
3190
3190
|
withStateOptions(
|
|
3191
|
-
|
|
3191
|
+
yargs35.positional("filename", {
|
|
3192
3192
|
demandOption: true,
|
|
3193
3193
|
describe: "Composition/pattern file to put"
|
|
3194
3194
|
})
|
|
@@ -3226,7 +3226,7 @@ var ComponentPatternUpdateModule = {
|
|
|
3226
3226
|
var ComponentPatternModule = {
|
|
3227
3227
|
command: "component-pattern <command>",
|
|
3228
3228
|
describe: "Commands for Canvas component patterns",
|
|
3229
|
-
builder: (
|
|
3229
|
+
builder: (yargs35) => yargs35.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
3230
3230
|
handler: () => {
|
|
3231
3231
|
yargs4.help();
|
|
3232
3232
|
}
|
|
@@ -3238,7 +3238,7 @@ var CompositionModule = {
|
|
|
3238
3238
|
command: "composition <command>",
|
|
3239
3239
|
describe: "Commands for Canvas compositions",
|
|
3240
3240
|
aliases: ["comp"],
|
|
3241
|
-
builder: (
|
|
3241
|
+
builder: (yargs35) => yargs35.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
3242
3242
|
handler: () => {
|
|
3243
3243
|
yargs5.help();
|
|
3244
3244
|
}
|
|
@@ -3257,13 +3257,13 @@ var CompositionPatternGetModule = {
|
|
|
3257
3257
|
var CompositionPatternListModule = {
|
|
3258
3258
|
...CompositionListModule,
|
|
3259
3259
|
describe: "List composition patterns",
|
|
3260
|
-
builder: (
|
|
3260
|
+
builder: (yargs35) => withFormatOptions(
|
|
3261
3261
|
withConfiguration(
|
|
3262
3262
|
withApiOptions(
|
|
3263
3263
|
withDebugOptions(
|
|
3264
3264
|
withProjectOptions(
|
|
3265
3265
|
withStateOptions(
|
|
3266
|
-
|
|
3266
|
+
yargs35.options({
|
|
3267
3267
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3268
3268
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3269
3269
|
resolvePatterns: {
|
|
@@ -3307,12 +3307,12 @@ var CompositionPatternListModule = {
|
|
|
3307
3307
|
var CompositionPatternPublishModule = {
|
|
3308
3308
|
...CompositionPublishModule,
|
|
3309
3309
|
describe: "Publishes composition pattern(s)",
|
|
3310
|
-
builder: (
|
|
3310
|
+
builder: (yargs35) => withConfiguration(
|
|
3311
3311
|
withApiOptions(
|
|
3312
3312
|
withDebugOptions(
|
|
3313
3313
|
withProjectOptions(
|
|
3314
3314
|
withDiffOptions(
|
|
3315
|
-
|
|
3315
|
+
yargs35.positional("ids", {
|
|
3316
3316
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3317
3317
|
type: "string"
|
|
3318
3318
|
}).option("all", {
|
|
@@ -3351,13 +3351,13 @@ var CompositionPatternPublishModule = {
|
|
|
3351
3351
|
var CompositionPatternPullModule = {
|
|
3352
3352
|
...componentInstancePullModuleFactory("compositionPatterns"),
|
|
3353
3353
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
3354
|
-
builder: (
|
|
3354
|
+
builder: (yargs35) => withConfiguration(
|
|
3355
3355
|
withApiOptions(
|
|
3356
3356
|
withDebugOptions(
|
|
3357
3357
|
withProjectOptions(
|
|
3358
3358
|
withStateOptions(
|
|
3359
3359
|
withDiffOptions(
|
|
3360
|
-
|
|
3360
|
+
yargs35.positional("directory", {
|
|
3361
3361
|
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.",
|
|
3362
3362
|
type: "string"
|
|
3363
3363
|
}).option("format", {
|
|
@@ -3395,13 +3395,13 @@ var CompositionPatternPullModule = {
|
|
|
3395
3395
|
var CompositionPatternPushModule = {
|
|
3396
3396
|
...componentInstancePushModuleFactory("compositionPatterns"),
|
|
3397
3397
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
3398
|
-
builder: (
|
|
3398
|
+
builder: (yargs35) => withConfiguration(
|
|
3399
3399
|
withApiOptions(
|
|
3400
3400
|
withDebugOptions(
|
|
3401
3401
|
withProjectOptions(
|
|
3402
3402
|
withStateOptions(
|
|
3403
3403
|
withDiffOptions(
|
|
3404
|
-
|
|
3404
|
+
yargs35.positional("directory", {
|
|
3405
3405
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
3406
3406
|
type: "string"
|
|
3407
3407
|
}).option("mode", {
|
|
@@ -3440,11 +3440,11 @@ var CompositionPatternRemoveModule = {
|
|
|
3440
3440
|
var CompositionPatternUnpublishModule = {
|
|
3441
3441
|
command: "unpublish [ids]",
|
|
3442
3442
|
describe: "Unpublish a composition pattern(s)",
|
|
3443
|
-
builder: (
|
|
3443
|
+
builder: (yargs35) => withConfiguration(
|
|
3444
3444
|
withApiOptions(
|
|
3445
3445
|
withDebugOptions(
|
|
3446
3446
|
withProjectOptions(
|
|
3447
|
-
|
|
3447
|
+
yargs35.positional("ids", {
|
|
3448
3448
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3449
3449
|
type: "string"
|
|
3450
3450
|
}).option("all", {
|
|
@@ -3480,7 +3480,7 @@ var CompositionPatternUpdateModule = {
|
|
|
3480
3480
|
var CompositionPatternModule = {
|
|
3481
3481
|
command: "composition-pattern <command>",
|
|
3482
3482
|
describe: "Commands for Canvas composition patterns",
|
|
3483
|
-
builder: (
|
|
3483
|
+
builder: (yargs35) => yargs35.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
3484
3484
|
handler: () => {
|
|
3485
3485
|
yargs6.help();
|
|
3486
3486
|
}
|
|
@@ -3501,12 +3501,12 @@ function getContentClient(options) {
|
|
|
3501
3501
|
var ContentTypeGetModule = {
|
|
3502
3502
|
command: "get <id>",
|
|
3503
3503
|
describe: "Get a content type",
|
|
3504
|
-
builder: (
|
|
3504
|
+
builder: (yargs35) => withConfiguration(
|
|
3505
3505
|
withDebugOptions(
|
|
3506
3506
|
withFormatOptions(
|
|
3507
3507
|
withApiOptions(
|
|
3508
3508
|
withProjectOptions(
|
|
3509
|
-
|
|
3509
|
+
yargs35.positional("id", {
|
|
3510
3510
|
demandOption: true,
|
|
3511
3511
|
describe: "Content type public ID to fetch"
|
|
3512
3512
|
})
|
|
@@ -3531,7 +3531,7 @@ var ContentTypeGetModule = {
|
|
|
3531
3531
|
var ContentTypeListModule = {
|
|
3532
3532
|
command: "list",
|
|
3533
3533
|
describe: "List content types",
|
|
3534
|
-
builder: (
|
|
3534
|
+
builder: (yargs35) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs35))))),
|
|
3535
3535
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3536
3536
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3537
3537
|
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -3572,12 +3572,12 @@ function createContentTypeEngineDataSource({
|
|
|
3572
3572
|
var ContentTypePullModule = {
|
|
3573
3573
|
command: "pull <directory>",
|
|
3574
3574
|
describe: "Pulls all content types to local files in a directory",
|
|
3575
|
-
builder: (
|
|
3575
|
+
builder: (yargs35) => withConfiguration(
|
|
3576
3576
|
withApiOptions(
|
|
3577
3577
|
withDebugOptions(
|
|
3578
3578
|
withProjectOptions(
|
|
3579
3579
|
withDiffOptions(
|
|
3580
|
-
|
|
3580
|
+
yargs35.positional("directory", {
|
|
3581
3581
|
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.",
|
|
3582
3582
|
type: "string"
|
|
3583
3583
|
}).option("format", {
|
|
@@ -3657,12 +3657,12 @@ var ContentTypePullModule = {
|
|
|
3657
3657
|
var ContentTypePushModule = {
|
|
3658
3658
|
command: "push <directory>",
|
|
3659
3659
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
3660
|
-
builder: (
|
|
3660
|
+
builder: (yargs35) => withConfiguration(
|
|
3661
3661
|
withApiOptions(
|
|
3662
3662
|
withDebugOptions(
|
|
3663
3663
|
withProjectOptions(
|
|
3664
3664
|
withDiffOptions(
|
|
3665
|
-
|
|
3665
|
+
yargs35.positional("directory", {
|
|
3666
3666
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
3667
3667
|
type: "string"
|
|
3668
3668
|
}).option("what-if", {
|
|
@@ -3736,11 +3736,11 @@ var ContentTypeRemoveModule = {
|
|
|
3736
3736
|
command: "remove <id>",
|
|
3737
3737
|
aliases: ["delete", "rm"],
|
|
3738
3738
|
describe: "Delete a content type",
|
|
3739
|
-
builder: (
|
|
3739
|
+
builder: (yargs35) => withConfiguration(
|
|
3740
3740
|
withDebugOptions(
|
|
3741
3741
|
withApiOptions(
|
|
3742
3742
|
withProjectOptions(
|
|
3743
|
-
|
|
3743
|
+
yargs35.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
3744
3744
|
)
|
|
3745
3745
|
)
|
|
3746
3746
|
)
|
|
@@ -3761,11 +3761,11 @@ var ContentTypeUpdateModule = {
|
|
|
3761
3761
|
command: "update <filename>",
|
|
3762
3762
|
aliases: ["put"],
|
|
3763
3763
|
describe: "Insert or update a content type",
|
|
3764
|
-
builder: (
|
|
3764
|
+
builder: (yargs35) => withConfiguration(
|
|
3765
3765
|
withDebugOptions(
|
|
3766
3766
|
withApiOptions(
|
|
3767
3767
|
withProjectOptions(
|
|
3768
|
-
|
|
3768
|
+
yargs35.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
3769
3769
|
)
|
|
3770
3770
|
)
|
|
3771
3771
|
)
|
|
@@ -3787,7 +3787,7 @@ var ContentTypeModule = {
|
|
|
3787
3787
|
command: "contenttype <command>",
|
|
3788
3788
|
aliases: ["ct"],
|
|
3789
3789
|
describe: "Commands for Content Types",
|
|
3790
|
-
builder: (
|
|
3790
|
+
builder: (yargs35) => yargs35.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
3791
3791
|
handler: () => {
|
|
3792
3792
|
yargs7.help();
|
|
3793
3793
|
}
|
|
@@ -3806,11 +3806,11 @@ function getDataSourceClient(options) {
|
|
|
3806
3806
|
var DataSourceGetModule = {
|
|
3807
3807
|
command: "get <id>",
|
|
3808
3808
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
3809
|
-
builder: (
|
|
3809
|
+
builder: (yargs35) => withConfiguration(
|
|
3810
3810
|
withApiOptions(
|
|
3811
3811
|
withDebugOptions(
|
|
3812
3812
|
withProjectOptions(
|
|
3813
|
-
|
|
3813
|
+
yargs35.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
3814
3814
|
)
|
|
3815
3815
|
)
|
|
3816
3816
|
)
|
|
@@ -3828,11 +3828,11 @@ var DataSourceRemoveModule = {
|
|
|
3828
3828
|
command: "remove <id>",
|
|
3829
3829
|
aliases: ["delete", "rm"],
|
|
3830
3830
|
describe: "Delete a data source",
|
|
3831
|
-
builder: (
|
|
3831
|
+
builder: (yargs35) => withConfiguration(
|
|
3832
3832
|
withDebugOptions(
|
|
3833
3833
|
withApiOptions(
|
|
3834
3834
|
withProjectOptions(
|
|
3835
|
-
|
|
3835
|
+
yargs35.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
3836
3836
|
)
|
|
3837
3837
|
)
|
|
3838
3838
|
)
|
|
@@ -3853,11 +3853,11 @@ var DataSourceUpdateModule = {
|
|
|
3853
3853
|
command: "update <dataSource>",
|
|
3854
3854
|
aliases: ["put"],
|
|
3855
3855
|
describe: "Insert or update a data source",
|
|
3856
|
-
builder: (
|
|
3856
|
+
builder: (yargs35) => withConfiguration(
|
|
3857
3857
|
withApiOptions(
|
|
3858
3858
|
withDebugOptions(
|
|
3859
3859
|
withProjectOptions(
|
|
3860
|
-
|
|
3860
|
+
yargs35.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
3861
3861
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
3862
3862
|
type: "string",
|
|
3863
3863
|
demandOption: true
|
|
@@ -3892,7 +3892,7 @@ var DataSourceModule = {
|
|
|
3892
3892
|
command: "datasource <command>",
|
|
3893
3893
|
aliases: ["ds"],
|
|
3894
3894
|
describe: "Commands for Data Source definitions",
|
|
3895
|
-
builder: (
|
|
3895
|
+
builder: (yargs35) => yargs35.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
3896
3896
|
handler: () => {
|
|
3897
3897
|
yargs8.help();
|
|
3898
3898
|
}
|
|
@@ -3914,12 +3914,12 @@ var DataTypeGetModule = {
|
|
|
3914
3914
|
command: "get <id>",
|
|
3915
3915
|
describe: "Get a data type",
|
|
3916
3916
|
aliases: ["ls"],
|
|
3917
|
-
builder: (
|
|
3917
|
+
builder: (yargs35) => withConfiguration(
|
|
3918
3918
|
withFormatOptions(
|
|
3919
3919
|
withDebugOptions(
|
|
3920
3920
|
withApiOptions(
|
|
3921
3921
|
withProjectOptions(
|
|
3922
|
-
|
|
3922
|
+
yargs35.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
3923
3923
|
)
|
|
3924
3924
|
)
|
|
3925
3925
|
)
|
|
@@ -3942,7 +3942,7 @@ var DataTypeListModule = {
|
|
|
3942
3942
|
command: "list",
|
|
3943
3943
|
describe: "List data types",
|
|
3944
3944
|
aliases: ["ls"],
|
|
3945
|
-
builder: (
|
|
3945
|
+
builder: (yargs35) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs35))))),
|
|
3946
3946
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3947
3947
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
3948
3948
|
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -3985,12 +3985,12 @@ function createDataTypeEngineDataSource({
|
|
|
3985
3985
|
var DataTypePullModule = {
|
|
3986
3986
|
command: "pull <directory>",
|
|
3987
3987
|
describe: "Pulls all data types to local files in a directory",
|
|
3988
|
-
builder: (
|
|
3988
|
+
builder: (yargs35) => withConfiguration(
|
|
3989
3989
|
withApiOptions(
|
|
3990
3990
|
withDebugOptions(
|
|
3991
3991
|
withProjectOptions(
|
|
3992
3992
|
withDiffOptions(
|
|
3993
|
-
|
|
3993
|
+
yargs35.positional("directory", {
|
|
3994
3994
|
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.",
|
|
3995
3995
|
type: "string"
|
|
3996
3996
|
}).option("format", {
|
|
@@ -4070,12 +4070,12 @@ var DataTypePullModule = {
|
|
|
4070
4070
|
var DataTypePushModule = {
|
|
4071
4071
|
command: "push <directory>",
|
|
4072
4072
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
4073
|
-
builder: (
|
|
4073
|
+
builder: (yargs35) => withConfiguration(
|
|
4074
4074
|
withApiOptions(
|
|
4075
4075
|
withDebugOptions(
|
|
4076
4076
|
withProjectOptions(
|
|
4077
4077
|
withDiffOptions(
|
|
4078
|
-
|
|
4078
|
+
yargs35.positional("directory", {
|
|
4079
4079
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
4080
4080
|
type: "string"
|
|
4081
4081
|
}).option("mode", {
|
|
@@ -4144,11 +4144,11 @@ var DataTypeRemoveModule = {
|
|
|
4144
4144
|
command: "remove <id>",
|
|
4145
4145
|
aliases: ["delete", "rm"],
|
|
4146
4146
|
describe: "Delete a data type",
|
|
4147
|
-
builder: (
|
|
4147
|
+
builder: (yargs35) => withConfiguration(
|
|
4148
4148
|
withDebugOptions(
|
|
4149
4149
|
withApiOptions(
|
|
4150
4150
|
withProjectOptions(
|
|
4151
|
-
|
|
4151
|
+
yargs35.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
4152
4152
|
)
|
|
4153
4153
|
)
|
|
4154
4154
|
)
|
|
@@ -4169,11 +4169,11 @@ var DataTypeUpdateModule = {
|
|
|
4169
4169
|
command: "update <filename>",
|
|
4170
4170
|
aliases: ["put"],
|
|
4171
4171
|
describe: "Insert or update a data type",
|
|
4172
|
-
builder: (
|
|
4172
|
+
builder: (yargs35) => withConfiguration(
|
|
4173
4173
|
withDebugOptions(
|
|
4174
4174
|
withApiOptions(
|
|
4175
4175
|
withProjectOptions(
|
|
4176
|
-
|
|
4176
|
+
yargs35.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
4177
4177
|
)
|
|
4178
4178
|
)
|
|
4179
4179
|
)
|
|
@@ -4195,7 +4195,7 @@ var DataTypeModule = {
|
|
|
4195
4195
|
command: "datatype <command>",
|
|
4196
4196
|
aliases: ["dt"],
|
|
4197
4197
|
describe: "Commands for Data Type definitions",
|
|
4198
|
-
builder: (
|
|
4198
|
+
builder: (yargs35) => yargs35.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
4199
4199
|
handler: () => {
|
|
4200
4200
|
yargs9.help();
|
|
4201
4201
|
}
|
|
@@ -4208,13 +4208,13 @@ import yargs10 from "yargs";
|
|
|
4208
4208
|
var EntryGetModule = {
|
|
4209
4209
|
command: "get <id>",
|
|
4210
4210
|
describe: "Get an entry",
|
|
4211
|
-
builder: (
|
|
4211
|
+
builder: (yargs35) => withConfiguration(
|
|
4212
4212
|
withDebugOptions(
|
|
4213
4213
|
withFormatOptions(
|
|
4214
4214
|
withApiOptions(
|
|
4215
4215
|
withProjectOptions(
|
|
4216
4216
|
withStateOptions(
|
|
4217
|
-
|
|
4217
|
+
yargs35.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
4218
4218
|
resolveData: {
|
|
4219
4219
|
type: "boolean",
|
|
4220
4220
|
default: false,
|
|
@@ -4286,13 +4286,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
4286
4286
|
var EntryListModule = {
|
|
4287
4287
|
command: "list",
|
|
4288
4288
|
describe: "List entries",
|
|
4289
|
-
builder: (
|
|
4289
|
+
builder: (yargs35) => withConfiguration(
|
|
4290
4290
|
withDebugOptions(
|
|
4291
4291
|
withFormatOptions(
|
|
4292
4292
|
withApiOptions(
|
|
4293
4293
|
withProjectOptions(
|
|
4294
4294
|
withStateOptions(
|
|
4295
|
-
|
|
4295
|
+
yargs35.options({
|
|
4296
4296
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4297
4297
|
limit: {
|
|
4298
4298
|
describe: "Number of rows to fetch",
|
|
@@ -4427,12 +4427,12 @@ function createEntryEngineDataSource({
|
|
|
4427
4427
|
var EntryPublishModule = {
|
|
4428
4428
|
command: "publish [ids]",
|
|
4429
4429
|
describe: "Publishes entry(ies)",
|
|
4430
|
-
builder: (
|
|
4430
|
+
builder: (yargs35) => withConfiguration(
|
|
4431
4431
|
withDiffOptions(
|
|
4432
4432
|
withApiOptions(
|
|
4433
4433
|
withProjectOptions(
|
|
4434
4434
|
withDiffOptions(
|
|
4435
|
-
|
|
4435
|
+
yargs35.positional("ids", {
|
|
4436
4436
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4437
4437
|
type: "string"
|
|
4438
4438
|
}).option("all", {
|
|
@@ -4507,13 +4507,13 @@ var EntryPublishModule = {
|
|
|
4507
4507
|
var EntryPullModule = {
|
|
4508
4508
|
command: "pull <directory>",
|
|
4509
4509
|
describe: "Pulls all entries to local files in a directory",
|
|
4510
|
-
builder: (
|
|
4510
|
+
builder: (yargs35) => withConfiguration(
|
|
4511
4511
|
withDebugOptions(
|
|
4512
4512
|
withApiOptions(
|
|
4513
4513
|
withProjectOptions(
|
|
4514
4514
|
withStateOptions(
|
|
4515
4515
|
withDiffOptions(
|
|
4516
|
-
|
|
4516
|
+
yargs35.positional("directory", {
|
|
4517
4517
|
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.",
|
|
4518
4518
|
type: "string"
|
|
4519
4519
|
}).option("format", {
|
|
@@ -4613,13 +4613,13 @@ var EntryPullModule = {
|
|
|
4613
4613
|
var EntryPushModule = {
|
|
4614
4614
|
command: "push <directory>",
|
|
4615
4615
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
4616
|
-
builder: (
|
|
4616
|
+
builder: (yargs35) => withConfiguration(
|
|
4617
4617
|
withDebugOptions(
|
|
4618
4618
|
withApiOptions(
|
|
4619
4619
|
withProjectOptions(
|
|
4620
4620
|
withStateOptions(
|
|
4621
4621
|
withDiffOptions(
|
|
4622
|
-
|
|
4622
|
+
yargs35.positional("directory", {
|
|
4623
4623
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
4624
4624
|
type: "string"
|
|
4625
4625
|
}).option("mode", {
|
|
@@ -4718,11 +4718,11 @@ var EntryRemoveModule = {
|
|
|
4718
4718
|
command: "remove <id>",
|
|
4719
4719
|
aliases: ["delete", "rm"],
|
|
4720
4720
|
describe: "Delete an entry",
|
|
4721
|
-
builder: (
|
|
4721
|
+
builder: (yargs35) => withConfiguration(
|
|
4722
4722
|
withDebugOptions(
|
|
4723
4723
|
withApiOptions(
|
|
4724
4724
|
withProjectOptions(
|
|
4725
|
-
|
|
4725
|
+
yargs35.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
4726
4726
|
)
|
|
4727
4727
|
)
|
|
4728
4728
|
)
|
|
@@ -4744,11 +4744,11 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
4744
4744
|
var EntryUnpublishModule = {
|
|
4745
4745
|
command: "unpublish [ids]",
|
|
4746
4746
|
describe: "Unpublish an entry(ies)",
|
|
4747
|
-
builder: (
|
|
4747
|
+
builder: (yargs35) => withConfiguration(
|
|
4748
4748
|
withDebugOptions(
|
|
4749
4749
|
withApiOptions(
|
|
4750
4750
|
withProjectOptions(
|
|
4751
|
-
|
|
4751
|
+
yargs35.positional("ids", {
|
|
4752
4752
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4753
4753
|
type: "string"
|
|
4754
4754
|
}).option("all", {
|
|
@@ -4818,12 +4818,12 @@ var EntryUpdateModule = {
|
|
|
4818
4818
|
command: "update <filename>",
|
|
4819
4819
|
aliases: ["put"],
|
|
4820
4820
|
describe: "Insert or update an entry",
|
|
4821
|
-
builder: (
|
|
4821
|
+
builder: (yargs35) => withConfiguration(
|
|
4822
4822
|
withDebugOptions(
|
|
4823
4823
|
withApiOptions(
|
|
4824
4824
|
withProjectOptions(
|
|
4825
4825
|
withStateOptions(
|
|
4826
|
-
|
|
4826
|
+
yargs35.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
4827
4827
|
)
|
|
4828
4828
|
)
|
|
4829
4829
|
)
|
|
@@ -4855,7 +4855,7 @@ var EntryUpdateModule = {
|
|
|
4855
4855
|
var EntryModule = {
|
|
4856
4856
|
command: "entry <command>",
|
|
4857
4857
|
describe: "Commands for Entries",
|
|
4858
|
-
builder: (
|
|
4858
|
+
builder: (yargs35) => yargs35.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
4859
4859
|
handler: () => {
|
|
4860
4860
|
yargs10.help();
|
|
4861
4861
|
}
|
|
@@ -4868,13 +4868,13 @@ import yargs11 from "yargs";
|
|
|
4868
4868
|
var EntryPatternGetModule = {
|
|
4869
4869
|
command: "get <id>",
|
|
4870
4870
|
describe: "Get an entry pattern",
|
|
4871
|
-
builder: (
|
|
4871
|
+
builder: (yargs35) => withConfiguration(
|
|
4872
4872
|
withDebugOptions(
|
|
4873
4873
|
withFormatOptions(
|
|
4874
4874
|
withApiOptions(
|
|
4875
4875
|
withProjectOptions(
|
|
4876
4876
|
withStateOptions(
|
|
4877
|
-
|
|
4877
|
+
yargs35.positional("id", {
|
|
4878
4878
|
demandOption: true,
|
|
4879
4879
|
describe: "Entry pattern public ID to fetch"
|
|
4880
4880
|
}).option({
|
|
@@ -4927,13 +4927,13 @@ var EntryPatternGetModule = {
|
|
|
4927
4927
|
var EntryPatternListModule = {
|
|
4928
4928
|
command: "list",
|
|
4929
4929
|
describe: "List entry patterns",
|
|
4930
|
-
builder: (
|
|
4930
|
+
builder: (yargs35) => withConfiguration(
|
|
4931
4931
|
withDebugOptions(
|
|
4932
4932
|
withFormatOptions(
|
|
4933
4933
|
withApiOptions(
|
|
4934
4934
|
withProjectOptions(
|
|
4935
4935
|
withStateOptions(
|
|
4936
|
-
|
|
4936
|
+
yargs35.option({
|
|
4937
4937
|
withComponentIDs: {
|
|
4938
4938
|
type: "boolean",
|
|
4939
4939
|
default: false,
|
|
@@ -4979,12 +4979,12 @@ var EntryPatternListModule = {
|
|
|
4979
4979
|
var EntryPatternPublishModule = {
|
|
4980
4980
|
command: "publish [ids]",
|
|
4981
4981
|
describe: "Publishes entry pattern(s)",
|
|
4982
|
-
builder: (
|
|
4982
|
+
builder: (yargs35) => withConfiguration(
|
|
4983
4983
|
withDebugOptions(
|
|
4984
4984
|
withApiOptions(
|
|
4985
4985
|
withProjectOptions(
|
|
4986
4986
|
withDiffOptions(
|
|
4987
|
-
|
|
4987
|
+
yargs35.positional("ids", {
|
|
4988
4988
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4989
4989
|
type: "string"
|
|
4990
4990
|
}).option("all", {
|
|
@@ -5059,13 +5059,13 @@ var EntryPatternPublishModule = {
|
|
|
5059
5059
|
var EntryPatternPullModule = {
|
|
5060
5060
|
command: "pull <directory>",
|
|
5061
5061
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
5062
|
-
builder: (
|
|
5062
|
+
builder: (yargs35) => withConfiguration(
|
|
5063
5063
|
withApiOptions(
|
|
5064
5064
|
withDebugOptions(
|
|
5065
5065
|
withProjectOptions(
|
|
5066
5066
|
withStateOptions(
|
|
5067
5067
|
withDiffOptions(
|
|
5068
|
-
|
|
5068
|
+
yargs35.positional("directory", {
|
|
5069
5069
|
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.",
|
|
5070
5070
|
type: "string"
|
|
5071
5071
|
}).option("format", {
|
|
@@ -5165,13 +5165,13 @@ var EntryPatternPullModule = {
|
|
|
5165
5165
|
var EntryPatternPushModule = {
|
|
5166
5166
|
command: "push <directory>",
|
|
5167
5167
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
5168
|
-
builder: (
|
|
5168
|
+
builder: (yargs35) => withConfiguration(
|
|
5169
5169
|
withDebugOptions(
|
|
5170
5170
|
withApiOptions(
|
|
5171
5171
|
withProjectOptions(
|
|
5172
5172
|
withStateOptions(
|
|
5173
5173
|
withDiffOptions(
|
|
5174
|
-
|
|
5174
|
+
yargs35.positional("directory", {
|
|
5175
5175
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
5176
5176
|
type: "string"
|
|
5177
5177
|
}).option("what-if", {
|
|
@@ -5275,11 +5275,11 @@ var EntryPatternRemoveModule = {
|
|
|
5275
5275
|
command: "remove <id>",
|
|
5276
5276
|
aliases: ["delete", "rm"],
|
|
5277
5277
|
describe: "Delete an entry pattern",
|
|
5278
|
-
builder: (
|
|
5278
|
+
builder: (yargs35) => withConfiguration(
|
|
5279
5279
|
withDebugOptions(
|
|
5280
5280
|
withApiOptions(
|
|
5281
5281
|
withProjectOptions(
|
|
5282
|
-
|
|
5282
|
+
yargs35.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
5283
5283
|
)
|
|
5284
5284
|
)
|
|
5285
5285
|
)
|
|
@@ -5301,11 +5301,11 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
5301
5301
|
var EntryPatternUnpublishModule = {
|
|
5302
5302
|
command: "unpublish [ids]",
|
|
5303
5303
|
describe: "Unpublish an entry patterns",
|
|
5304
|
-
builder: (
|
|
5304
|
+
builder: (yargs35) => withConfiguration(
|
|
5305
5305
|
withDebugOptions(
|
|
5306
5306
|
withApiOptions(
|
|
5307
5307
|
withProjectOptions(
|
|
5308
|
-
|
|
5308
|
+
yargs35.positional("ids", {
|
|
5309
5309
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5310
5310
|
type: "string"
|
|
5311
5311
|
}).option("all", {
|
|
@@ -5375,12 +5375,12 @@ var EntryPatternUpdateModule = {
|
|
|
5375
5375
|
command: "update <filename>",
|
|
5376
5376
|
aliases: ["put"],
|
|
5377
5377
|
describe: "Insert or update an entry pattern",
|
|
5378
|
-
builder: (
|
|
5378
|
+
builder: (yargs35) => withConfiguration(
|
|
5379
5379
|
withDebugOptions(
|
|
5380
5380
|
withApiOptions(
|
|
5381
5381
|
withProjectOptions(
|
|
5382
5382
|
withStateOptions(
|
|
5383
|
-
|
|
5383
|
+
yargs35.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
5384
5384
|
)
|
|
5385
5385
|
)
|
|
5386
5386
|
)
|
|
@@ -5416,7 +5416,7 @@ var EntryPatternUpdateModule = {
|
|
|
5416
5416
|
var EntryPatternModule = {
|
|
5417
5417
|
command: "entry-pattern <command>",
|
|
5418
5418
|
describe: "Commands for Entry patterns",
|
|
5419
|
-
builder: (
|
|
5419
|
+
builder: (yargs35) => yargs35.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
5420
5420
|
handler: () => {
|
|
5421
5421
|
yargs11.help();
|
|
5422
5422
|
}
|
|
@@ -5465,12 +5465,12 @@ function getLocaleClient(options) {
|
|
|
5465
5465
|
var LocalePullModule = {
|
|
5466
5466
|
command: "pull <directory>",
|
|
5467
5467
|
describe: "Pulls all locales to local files in a directory",
|
|
5468
|
-
builder: (
|
|
5468
|
+
builder: (yargs35) => withConfiguration(
|
|
5469
5469
|
withDebugOptions(
|
|
5470
5470
|
withApiOptions(
|
|
5471
5471
|
withProjectOptions(
|
|
5472
5472
|
withDiffOptions(
|
|
5473
|
-
|
|
5473
|
+
yargs35.positional("directory", {
|
|
5474
5474
|
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.",
|
|
5475
5475
|
type: "string"
|
|
5476
5476
|
}).option("format", {
|
|
@@ -5550,12 +5550,12 @@ var LocalePullModule = {
|
|
|
5550
5550
|
var LocalePushModule = {
|
|
5551
5551
|
command: "push <directory>",
|
|
5552
5552
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
5553
|
-
builder: (
|
|
5553
|
+
builder: (yargs35) => withConfiguration(
|
|
5554
5554
|
withDebugOptions(
|
|
5555
5555
|
withApiOptions(
|
|
5556
5556
|
withProjectOptions(
|
|
5557
5557
|
withDiffOptions(
|
|
5558
|
-
|
|
5558
|
+
yargs35.positional("directory", {
|
|
5559
5559
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
5560
5560
|
type: "string"
|
|
5561
5561
|
}).option("mode", {
|
|
@@ -5623,7 +5623,7 @@ var LocalePushModule = {
|
|
|
5623
5623
|
var LocaleModule = {
|
|
5624
5624
|
command: "locale <command>",
|
|
5625
5625
|
describe: "Commands for locale definitions",
|
|
5626
|
-
builder: (
|
|
5626
|
+
builder: (yargs35) => yargs35.command(LocalePullModule).command(LocalePushModule),
|
|
5627
5627
|
handler: () => {
|
|
5628
5628
|
yargs12.help();
|
|
5629
5629
|
}
|
|
@@ -5644,12 +5644,12 @@ function getPreviewClient(options) {
|
|
|
5644
5644
|
var PreviewUrlGetModule = {
|
|
5645
5645
|
command: "get <id>",
|
|
5646
5646
|
describe: "Fetch a preview URL",
|
|
5647
|
-
builder: (
|
|
5647
|
+
builder: (yargs35) => withConfiguration(
|
|
5648
5648
|
withFormatOptions(
|
|
5649
5649
|
withDebugOptions(
|
|
5650
5650
|
withApiOptions(
|
|
5651
5651
|
withProjectOptions(
|
|
5652
|
-
|
|
5652
|
+
yargs35.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
5653
5653
|
)
|
|
5654
5654
|
)
|
|
5655
5655
|
)
|
|
@@ -5673,8 +5673,8 @@ var PreviewUrlListModule = {
|
|
|
5673
5673
|
command: "list",
|
|
5674
5674
|
describe: "List preview URLs",
|
|
5675
5675
|
aliases: ["ls"],
|
|
5676
|
-
builder: (
|
|
5677
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
5676
|
+
builder: (yargs35) => withConfiguration(
|
|
5677
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs35.options({})))))
|
|
5678
5678
|
),
|
|
5679
5679
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5680
5680
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -5716,12 +5716,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
5716
5716
|
var PreviewUrlPullModule = {
|
|
5717
5717
|
command: "pull <directory>",
|
|
5718
5718
|
describe: "Pulls all preview urls to local files in a directory",
|
|
5719
|
-
builder: (
|
|
5719
|
+
builder: (yargs35) => withConfiguration(
|
|
5720
5720
|
withApiOptions(
|
|
5721
5721
|
withProjectOptions(
|
|
5722
5722
|
withDebugOptions(
|
|
5723
5723
|
withDiffOptions(
|
|
5724
|
-
|
|
5724
|
+
yargs35.positional("directory", {
|
|
5725
5725
|
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.",
|
|
5726
5726
|
type: "string"
|
|
5727
5727
|
}).option("format", {
|
|
@@ -5796,12 +5796,12 @@ var PreviewUrlPullModule = {
|
|
|
5796
5796
|
var PreviewUrlPushModule = {
|
|
5797
5797
|
command: "push <directory>",
|
|
5798
5798
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
5799
|
-
builder: (
|
|
5799
|
+
builder: (yargs35) => withConfiguration(
|
|
5800
5800
|
withApiOptions(
|
|
5801
5801
|
withProjectOptions(
|
|
5802
5802
|
withDiffOptions(
|
|
5803
5803
|
withDebugOptions(
|
|
5804
|
-
|
|
5804
|
+
yargs35.positional("directory", {
|
|
5805
5805
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
5806
5806
|
type: "string"
|
|
5807
5807
|
}).option("mode", {
|
|
@@ -5865,11 +5865,11 @@ var PreviewUrlRemoveModule = {
|
|
|
5865
5865
|
command: "remove <id>",
|
|
5866
5866
|
aliases: ["delete", "rm"],
|
|
5867
5867
|
describe: "Delete a preview URL",
|
|
5868
|
-
builder: (
|
|
5868
|
+
builder: (yargs35) => withConfiguration(
|
|
5869
5869
|
withApiOptions(
|
|
5870
5870
|
withDebugOptions(
|
|
5871
5871
|
withProjectOptions(
|
|
5872
|
-
|
|
5872
|
+
yargs35.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
5873
5873
|
)
|
|
5874
5874
|
)
|
|
5875
5875
|
)
|
|
@@ -5890,11 +5890,11 @@ var PreviewUrlUpdateModule = {
|
|
|
5890
5890
|
command: "update <filename>",
|
|
5891
5891
|
aliases: ["put"],
|
|
5892
5892
|
describe: "Insert or update a preview URL",
|
|
5893
|
-
builder: (
|
|
5893
|
+
builder: (yargs35) => withConfiguration(
|
|
5894
5894
|
withDebugOptions(
|
|
5895
5895
|
withApiOptions(
|
|
5896
5896
|
withProjectOptions(
|
|
5897
|
-
|
|
5897
|
+
yargs35.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
5898
5898
|
)
|
|
5899
5899
|
)
|
|
5900
5900
|
)
|
|
@@ -5916,7 +5916,7 @@ var PreviewUrlModule = {
|
|
|
5916
5916
|
command: "preview-url <command>",
|
|
5917
5917
|
aliases: ["pu"],
|
|
5918
5918
|
describe: "Commands for Canvas preview urls",
|
|
5919
|
-
builder: (
|
|
5919
|
+
builder: (yargs35) => yargs35.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
5920
5920
|
handler: () => {
|
|
5921
5921
|
yargs13.help();
|
|
5922
5922
|
}
|
|
@@ -5929,12 +5929,12 @@ import yargs14 from "yargs";
|
|
|
5929
5929
|
var PreviewViewportGetModule = {
|
|
5930
5930
|
command: "get <id>",
|
|
5931
5931
|
describe: "Fetch a preview viewport",
|
|
5932
|
-
builder: (
|
|
5932
|
+
builder: (yargs35) => withConfiguration(
|
|
5933
5933
|
withFormatOptions(
|
|
5934
5934
|
withDebugOptions(
|
|
5935
5935
|
withApiOptions(
|
|
5936
5936
|
withProjectOptions(
|
|
5937
|
-
|
|
5937
|
+
yargs35.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
5938
5938
|
)
|
|
5939
5939
|
)
|
|
5940
5940
|
)
|
|
@@ -5958,8 +5958,8 @@ var PreviewViewportListModule = {
|
|
|
5958
5958
|
command: "list",
|
|
5959
5959
|
describe: "List preview viewports",
|
|
5960
5960
|
aliases: ["ls"],
|
|
5961
|
-
builder: (
|
|
5962
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
5961
|
+
builder: (yargs35) => withConfiguration(
|
|
5962
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs35.options({})))))
|
|
5963
5963
|
),
|
|
5964
5964
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5965
5965
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -6005,12 +6005,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
6005
6005
|
var PreviewViewportPullModule = {
|
|
6006
6006
|
command: "pull <directory>",
|
|
6007
6007
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
6008
|
-
builder: (
|
|
6008
|
+
builder: (yargs35) => withConfiguration(
|
|
6009
6009
|
withApiOptions(
|
|
6010
6010
|
withProjectOptions(
|
|
6011
6011
|
withDebugOptions(
|
|
6012
6012
|
withDiffOptions(
|
|
6013
|
-
|
|
6013
|
+
yargs35.positional("directory", {
|
|
6014
6014
|
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.",
|
|
6015
6015
|
type: "string"
|
|
6016
6016
|
}).option("format", {
|
|
@@ -6085,12 +6085,12 @@ var PreviewViewportPullModule = {
|
|
|
6085
6085
|
var PreviewViewportPushModule = {
|
|
6086
6086
|
command: "push <directory>",
|
|
6087
6087
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
6088
|
-
builder: (
|
|
6088
|
+
builder: (yargs35) => withConfiguration(
|
|
6089
6089
|
withApiOptions(
|
|
6090
6090
|
withProjectOptions(
|
|
6091
6091
|
withDiffOptions(
|
|
6092
6092
|
withDebugOptions(
|
|
6093
|
-
|
|
6093
|
+
yargs35.positional("directory", {
|
|
6094
6094
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
6095
6095
|
type: "string"
|
|
6096
6096
|
}).option("mode", {
|
|
@@ -6154,11 +6154,11 @@ var PreviewViewportRemoveModule = {
|
|
|
6154
6154
|
command: "remove <id>",
|
|
6155
6155
|
aliases: ["delete", "rm"],
|
|
6156
6156
|
describe: "Delete a preview viewport",
|
|
6157
|
-
builder: (
|
|
6157
|
+
builder: (yargs35) => withConfiguration(
|
|
6158
6158
|
withApiOptions(
|
|
6159
6159
|
withDebugOptions(
|
|
6160
6160
|
withProjectOptions(
|
|
6161
|
-
|
|
6161
|
+
yargs35.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
6162
6162
|
)
|
|
6163
6163
|
)
|
|
6164
6164
|
)
|
|
@@ -6179,11 +6179,11 @@ var PreviewViewportUpdateModule = {
|
|
|
6179
6179
|
command: "update <filename>",
|
|
6180
6180
|
aliases: ["put"],
|
|
6181
6181
|
describe: "Insert or update a preview viewport",
|
|
6182
|
-
builder: (
|
|
6182
|
+
builder: (yargs35) => withConfiguration(
|
|
6183
6183
|
withDebugOptions(
|
|
6184
6184
|
withApiOptions(
|
|
6185
6185
|
withProjectOptions(
|
|
6186
|
-
|
|
6186
|
+
yargs35.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
6187
6187
|
)
|
|
6188
6188
|
)
|
|
6189
6189
|
)
|
|
@@ -6205,7 +6205,7 @@ var PreviewViewportModule = {
|
|
|
6205
6205
|
command: "preview-viewport <command>",
|
|
6206
6206
|
aliases: ["pv"],
|
|
6207
6207
|
describe: "Commands for Canvas preview viewports",
|
|
6208
|
-
builder: (
|
|
6208
|
+
builder: (yargs35) => yargs35.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
6209
6209
|
handler: () => {
|
|
6210
6210
|
yargs14.help();
|
|
6211
6211
|
}
|
|
@@ -6224,12 +6224,12 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
6224
6224
|
var PromptGetModule = {
|
|
6225
6225
|
command: "get <id>",
|
|
6226
6226
|
describe: "Get a prompt",
|
|
6227
|
-
builder: (
|
|
6227
|
+
builder: (yargs35) => withConfiguration(
|
|
6228
6228
|
withDebugOptions(
|
|
6229
6229
|
withFormatOptions(
|
|
6230
6230
|
withApiOptions(
|
|
6231
6231
|
withProjectOptions(
|
|
6232
|
-
|
|
6232
|
+
yargs35.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
6233
6233
|
)
|
|
6234
6234
|
)
|
|
6235
6235
|
)
|
|
@@ -6250,7 +6250,7 @@ var PromptGetModule = {
|
|
|
6250
6250
|
var PromptListModule = {
|
|
6251
6251
|
command: "list",
|
|
6252
6252
|
describe: "List prompts",
|
|
6253
|
-
builder: (
|
|
6253
|
+
builder: (yargs35) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs35))))),
|
|
6254
6254
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
6255
6255
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6256
6256
|
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -6291,13 +6291,13 @@ function createPromptEngineDataSource({
|
|
|
6291
6291
|
var PromptPullModule = {
|
|
6292
6292
|
command: "pull <directory>",
|
|
6293
6293
|
describe: "Pulls all prompts to local files in a directory",
|
|
6294
|
-
builder: (
|
|
6294
|
+
builder: (yargs35) => withConfiguration(
|
|
6295
6295
|
withDebugOptions(
|
|
6296
6296
|
withApiOptions(
|
|
6297
6297
|
withProjectOptions(
|
|
6298
6298
|
withStateOptions(
|
|
6299
6299
|
withDiffOptions(
|
|
6300
|
-
|
|
6300
|
+
yargs35.positional("directory", {
|
|
6301
6301
|
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.",
|
|
6302
6302
|
type: "string"
|
|
6303
6303
|
}).option("format", {
|
|
@@ -6378,12 +6378,12 @@ var PromptPullModule = {
|
|
|
6378
6378
|
var PromptPushModule = {
|
|
6379
6379
|
command: "push <directory>",
|
|
6380
6380
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
6381
|
-
builder: (
|
|
6381
|
+
builder: (yargs35) => withConfiguration(
|
|
6382
6382
|
withApiOptions(
|
|
6383
6383
|
withProjectOptions(
|
|
6384
6384
|
withStateOptions(
|
|
6385
6385
|
withDiffOptions(
|
|
6386
|
-
|
|
6386
|
+
yargs35.positional("directory", {
|
|
6387
6387
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
6388
6388
|
type: "string"
|
|
6389
6389
|
}).option("mode", {
|
|
@@ -6452,10 +6452,10 @@ var PromptRemoveModule = {
|
|
|
6452
6452
|
command: "remove <id>",
|
|
6453
6453
|
aliases: ["delete", "rm"],
|
|
6454
6454
|
describe: "Delete a prompt",
|
|
6455
|
-
builder: (
|
|
6455
|
+
builder: (yargs35) => withConfiguration(
|
|
6456
6456
|
withDebugOptions(
|
|
6457
6457
|
withApiOptions(
|
|
6458
|
-
withProjectOptions(
|
|
6458
|
+
withProjectOptions(yargs35.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
6459
6459
|
)
|
|
6460
6460
|
)
|
|
6461
6461
|
),
|
|
@@ -6475,11 +6475,11 @@ var PromptUpdateModule = {
|
|
|
6475
6475
|
command: "update <filename>",
|
|
6476
6476
|
aliases: ["put"],
|
|
6477
6477
|
describe: "Insert or update a prompt",
|
|
6478
|
-
builder: (
|
|
6478
|
+
builder: (yargs35) => withConfiguration(
|
|
6479
6479
|
withDebugOptions(
|
|
6480
6480
|
withApiOptions(
|
|
6481
6481
|
withProjectOptions(
|
|
6482
|
-
|
|
6482
|
+
yargs35.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
6483
6483
|
)
|
|
6484
6484
|
)
|
|
6485
6485
|
)
|
|
@@ -6501,371 +6501,19 @@ var PromptModule = {
|
|
|
6501
6501
|
command: "prompt <command>",
|
|
6502
6502
|
aliases: ["dt"],
|
|
6503
6503
|
describe: "Commands for AI Prompt definitions",
|
|
6504
|
-
builder: (
|
|
6504
|
+
builder: (yargs35) => yargs35.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
6505
6505
|
handler: () => {
|
|
6506
6506
|
yargs15.help();
|
|
6507
6507
|
}
|
|
6508
6508
|
};
|
|
6509
6509
|
|
|
6510
|
-
// src/commands/canvas/commands/webhooks.ts
|
|
6511
|
-
import yargs16 from "yargs";
|
|
6512
|
-
|
|
6513
|
-
// src/webhooksClient.ts
|
|
6514
|
-
import { ApiClient } from "@uniformdev/context/api";
|
|
6515
|
-
import PQueue3 from "p-queue";
|
|
6516
|
-
import { Svix } from "svix";
|
|
6517
|
-
import { z } from "zod";
|
|
6518
|
-
var WEBHOOKS_DASHBOARD_BASE_PATH = "/api/v1/svix-dashboard";
|
|
6519
|
-
var WebhooksClient = class extends ApiClient {
|
|
6520
|
-
constructor(options) {
|
|
6521
|
-
super(options);
|
|
6522
|
-
}
|
|
6523
|
-
async getToken() {
|
|
6524
|
-
const { projectId } = this.options;
|
|
6525
|
-
const { dashboard_url: dashboardUrl } = await this.apiClient(
|
|
6526
|
-
this.createUrl(WEBHOOKS_DASHBOARD_BASE_PATH, {
|
|
6527
|
-
projectId
|
|
6528
|
-
})
|
|
6529
|
-
);
|
|
6530
|
-
if (!dashboardUrl) {
|
|
6531
|
-
throw new Error("Webhooks are not activated for this project");
|
|
6532
|
-
}
|
|
6533
|
-
const key = dashboardUrl.split("key=")[1];
|
|
6534
|
-
if (!key) {
|
|
6535
|
-
throw new Error("Failed to get webhooks token");
|
|
6536
|
-
}
|
|
6537
|
-
const keySchema = z.object({
|
|
6538
|
-
appId: z.string(),
|
|
6539
|
-
oneTimeToken: z.string(),
|
|
6540
|
-
region: z.enum(["us", "eu"])
|
|
6541
|
-
});
|
|
6542
|
-
const { appId, oneTimeToken, region } = keySchema.parse(JSON.parse(atob(key)));
|
|
6543
|
-
const tokenSchema = z.object({
|
|
6544
|
-
token: z.string()
|
|
6545
|
-
});
|
|
6546
|
-
const tokenResponse = await fetch(`https://api.${region}.svix.com/api/v1/auth/one-time-token`, {
|
|
6547
|
-
method: "POST",
|
|
6548
|
-
body: JSON.stringify({
|
|
6549
|
-
oneTimeToken
|
|
6550
|
-
}),
|
|
6551
|
-
headers: {
|
|
6552
|
-
"content-type": "application/json"
|
|
6553
|
-
}
|
|
6554
|
-
});
|
|
6555
|
-
const tokenData = await tokenResponse.json();
|
|
6556
|
-
const { token: svixToken } = tokenSchema.parse(tokenData);
|
|
6557
|
-
return {
|
|
6558
|
-
appId,
|
|
6559
|
-
token: svixToken
|
|
6560
|
-
};
|
|
6561
|
-
}
|
|
6562
|
-
async get() {
|
|
6563
|
-
const webhooksAPIQueue = new PQueue3({ concurrency: 10 });
|
|
6564
|
-
const { appId, token } = await this.getToken();
|
|
6565
|
-
const svix = new Svix(token);
|
|
6566
|
-
const getEndpoints = async ({
|
|
6567
|
-
iterator,
|
|
6568
|
-
endpoints: endpoints2 = []
|
|
6569
|
-
} = {
|
|
6570
|
-
endpoints: []
|
|
6571
|
-
}) => {
|
|
6572
|
-
const {
|
|
6573
|
-
data,
|
|
6574
|
-
done,
|
|
6575
|
-
iterator: nextIterator
|
|
6576
|
-
} = await webhooksAPIQueue.add(
|
|
6577
|
-
async () => svix.endpoint.list(appId, {
|
|
6578
|
-
limit: 100,
|
|
6579
|
-
iterator
|
|
6580
|
-
}),
|
|
6581
|
-
{
|
|
6582
|
-
throwOnTimeout: true
|
|
6583
|
-
}
|
|
6584
|
-
);
|
|
6585
|
-
if (!done && nextIterator) {
|
|
6586
|
-
return getEndpoints({
|
|
6587
|
-
iterator: nextIterator,
|
|
6588
|
-
endpoints: [...endpoints2, ...data]
|
|
6589
|
-
});
|
|
6590
|
-
}
|
|
6591
|
-
return [...endpoints2, ...data];
|
|
6592
|
-
};
|
|
6593
|
-
const endpoints = await getEndpoints();
|
|
6594
|
-
return Promise.all(
|
|
6595
|
-
endpoints.map(async (endpoint) => {
|
|
6596
|
-
const headers = await webhooksAPIQueue.add(async () => svix.endpoint.getHeaders(appId, endpoint.id), {
|
|
6597
|
-
throwOnTimeout: true
|
|
6598
|
-
}).catch(() => null);
|
|
6599
|
-
const transformation = await webhooksAPIQueue.add(async () => svix.endpoint.transformationGet(appId, endpoint.id), {
|
|
6600
|
-
throwOnTimeout: true
|
|
6601
|
-
}).catch(() => null);
|
|
6602
|
-
return {
|
|
6603
|
-
endpoint,
|
|
6604
|
-
headers,
|
|
6605
|
-
transformation
|
|
6606
|
-
};
|
|
6607
|
-
})
|
|
6608
|
-
);
|
|
6609
|
-
}
|
|
6610
|
-
async put(webhook) {
|
|
6611
|
-
const { appId, token } = await this.getToken();
|
|
6612
|
-
const svix = new Svix(token);
|
|
6613
|
-
let existingEndpoint = null;
|
|
6614
|
-
try {
|
|
6615
|
-
existingEndpoint = await svix.endpoint.get(appId, webhook.endpoint.id);
|
|
6616
|
-
} catch {
|
|
6617
|
-
}
|
|
6618
|
-
if (existingEndpoint) {
|
|
6619
|
-
existingEndpoint = await svix.endpoint.patch(appId, webhook.endpoint.id, {
|
|
6620
|
-
...webhook.endpoint,
|
|
6621
|
-
uid: existingEndpoint.uid
|
|
6622
|
-
});
|
|
6623
|
-
} else {
|
|
6624
|
-
existingEndpoint = await svix.endpoint.create(appId, {
|
|
6625
|
-
...webhook.endpoint,
|
|
6626
|
-
uid: webhook.endpoint.id
|
|
6627
|
-
});
|
|
6628
|
-
}
|
|
6629
|
-
if (webhook.headers) {
|
|
6630
|
-
await svix.endpoint.updateHeaders(appId, existingEndpoint.id, webhook.headers);
|
|
6631
|
-
}
|
|
6632
|
-
if (webhook.transformation) {
|
|
6633
|
-
await svix.endpoint.transformationPartialUpdate(appId, existingEndpoint.id, webhook.transformation);
|
|
6634
|
-
}
|
|
6635
|
-
return existingEndpoint;
|
|
6636
|
-
}
|
|
6637
|
-
async delete(endpointId) {
|
|
6638
|
-
const { appId, token } = await this.getToken();
|
|
6639
|
-
const svix = new Svix(token);
|
|
6640
|
-
await svix.endpoint.delete(appId, endpointId);
|
|
6641
|
-
}
|
|
6642
|
-
};
|
|
6643
|
-
|
|
6644
|
-
// src/commands/canvas/commands/webhook/_util.ts
|
|
6645
|
-
var selectIdentifier7 = (webhook) => webhook.endpoint.uid ?? webhook.endpoint.id;
|
|
6646
|
-
var selectDisplayName7 = (webhook) => `${webhook.endpoint.url} (pid: ${webhook.endpoint.uid ?? webhook.endpoint.id})`;
|
|
6647
|
-
var getWebhooksClient = (options) => new WebhooksClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
6648
|
-
var compareWebhooks = (source, target) => {
|
|
6649
|
-
const { endpoint: sourceEndpoint, ...sourceWithoutEndpoint } = source.object;
|
|
6650
|
-
const { endpoint: targetEndpoint, ...targetWithoutEndpoint } = target.object;
|
|
6651
|
-
const {
|
|
6652
|
-
id: sourceId,
|
|
6653
|
-
uid: sourceUid,
|
|
6654
|
-
version: sourceVersion,
|
|
6655
|
-
createdAt: sourceCreatedAt,
|
|
6656
|
-
updatedAt: sourceUpdatedAt,
|
|
6657
|
-
...sourceToCompare
|
|
6658
|
-
} = sourceEndpoint;
|
|
6659
|
-
const {
|
|
6660
|
-
id: targetId,
|
|
6661
|
-
uid: targetUid,
|
|
6662
|
-
version: targetVersion,
|
|
6663
|
-
createdAt: targetCreatedAt,
|
|
6664
|
-
updatedAt: targetUpdatedAt,
|
|
6665
|
-
...targetToCompare
|
|
6666
|
-
} = targetEndpoint;
|
|
6667
|
-
return serializedDequal(
|
|
6668
|
-
{ ...sourceWithoutEndpoint, endpoint: sourceToCompare },
|
|
6669
|
-
{ ...targetWithoutEndpoint, endpoint: targetToCompare }
|
|
6670
|
-
);
|
|
6671
|
-
};
|
|
6672
|
-
|
|
6673
|
-
// src/commands/canvas/webhookEngineDataSource.ts
|
|
6674
|
-
function createWebhookEngineDataSource({
|
|
6675
|
-
client
|
|
6676
|
-
}) {
|
|
6677
|
-
async function* getObjects() {
|
|
6678
|
-
const webhooks = await client.get();
|
|
6679
|
-
for await (const webhook of webhooks) {
|
|
6680
|
-
const result = {
|
|
6681
|
-
id: selectIdentifier7(webhook),
|
|
6682
|
-
displayName: selectDisplayName7(webhook),
|
|
6683
|
-
providerId: webhook.endpoint.id,
|
|
6684
|
-
object: webhook
|
|
6685
|
-
};
|
|
6686
|
-
yield result;
|
|
6687
|
-
}
|
|
6688
|
-
}
|
|
6689
|
-
return {
|
|
6690
|
-
name: "Uniform API",
|
|
6691
|
-
objects: getObjects(),
|
|
6692
|
-
deleteObject: async (providerId) => {
|
|
6693
|
-
await client.delete(providerId);
|
|
6694
|
-
},
|
|
6695
|
-
writeObject: async (object) => {
|
|
6696
|
-
await client.put(object.object);
|
|
6697
|
-
}
|
|
6698
|
-
};
|
|
6699
|
-
}
|
|
6700
|
-
|
|
6701
|
-
// src/commands/canvas/commands/webhook/pull.ts
|
|
6702
|
-
var WebhookPullModule = {
|
|
6703
|
-
command: "pull <directory>",
|
|
6704
|
-
describe: "Pulls all webhooks to local files in a directory",
|
|
6705
|
-
builder: (yargs36) => withConfiguration(
|
|
6706
|
-
withApiOptions(
|
|
6707
|
-
withDebugOptions(
|
|
6708
|
-
withProjectOptions(
|
|
6709
|
-
withDiffOptions(
|
|
6710
|
-
yargs36.positional("directory", {
|
|
6711
|
-
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.",
|
|
6712
|
-
type: "string"
|
|
6713
|
-
}).option("format", {
|
|
6714
|
-
alias: ["f"],
|
|
6715
|
-
describe: "Output format",
|
|
6716
|
-
default: "yaml",
|
|
6717
|
-
choices: ["yaml", "json"],
|
|
6718
|
-
type: "string"
|
|
6719
|
-
}).option("mode", {
|
|
6720
|
-
alias: ["m"],
|
|
6721
|
-
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',
|
|
6722
|
-
choices: ["create", "createOrUpdate", "mirror"],
|
|
6723
|
-
default: "mirror",
|
|
6724
|
-
type: "string"
|
|
6725
|
-
})
|
|
6726
|
-
)
|
|
6727
|
-
)
|
|
6728
|
-
)
|
|
6729
|
-
)
|
|
6730
|
-
),
|
|
6731
|
-
handler: async ({
|
|
6732
|
-
apiHost,
|
|
6733
|
-
apiKey,
|
|
6734
|
-
proxy,
|
|
6735
|
-
directory,
|
|
6736
|
-
format,
|
|
6737
|
-
mode,
|
|
6738
|
-
whatIf,
|
|
6739
|
-
project: projectId,
|
|
6740
|
-
diff: diffMode,
|
|
6741
|
-
allowEmptySource,
|
|
6742
|
-
verbose
|
|
6743
|
-
}) => {
|
|
6744
|
-
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6745
|
-
const client = getWebhooksClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6746
|
-
const source = createWebhookEngineDataSource({ client });
|
|
6747
|
-
let target;
|
|
6748
|
-
const isPackage = isPathAPackageFile(directory);
|
|
6749
|
-
if (isPackage) {
|
|
6750
|
-
const packageContents = readCanvasPackage(directory, false, verbose);
|
|
6751
|
-
target = await createArraySyncEngineDataSource({
|
|
6752
|
-
name: `Package file ${directory}`,
|
|
6753
|
-
objects: packageContents.webhooks ?? [],
|
|
6754
|
-
selectIdentifier: selectIdentifier7,
|
|
6755
|
-
selectDisplayName: selectDisplayName7,
|
|
6756
|
-
onSyncComplete: async (_, synced) => {
|
|
6757
|
-
packageContents.webhooks = synced;
|
|
6758
|
-
writeCanvasPackage(directory, packageContents);
|
|
6759
|
-
}
|
|
6760
|
-
});
|
|
6761
|
-
} else {
|
|
6762
|
-
target = await createFileSyncEngineDataSource({
|
|
6763
|
-
directory,
|
|
6764
|
-
selectIdentifier: selectIdentifier7,
|
|
6765
|
-
selectDisplayName: selectDisplayName7,
|
|
6766
|
-
format,
|
|
6767
|
-
verbose
|
|
6768
|
-
});
|
|
6769
|
-
}
|
|
6770
|
-
await syncEngine({
|
|
6771
|
-
source,
|
|
6772
|
-
target,
|
|
6773
|
-
mode,
|
|
6774
|
-
whatIf,
|
|
6775
|
-
allowEmptySource: allowEmptySource ?? true,
|
|
6776
|
-
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
6777
|
-
compareContents: compareWebhooks
|
|
6778
|
-
});
|
|
6779
|
-
}
|
|
6780
|
-
};
|
|
6781
|
-
|
|
6782
|
-
// src/commands/canvas/commands/webhook/push.ts
|
|
6783
|
-
var WebhookPushModule = {
|
|
6784
|
-
command: "push <directory>",
|
|
6785
|
-
describe: "Pushes all webhooks from files in a directory to Uniform Canvas",
|
|
6786
|
-
builder: (yargs36) => withConfiguration(
|
|
6787
|
-
withDebugOptions(
|
|
6788
|
-
withApiOptions(
|
|
6789
|
-
withProjectOptions(
|
|
6790
|
-
withDiffOptions(
|
|
6791
|
-
yargs36.positional("directory", {
|
|
6792
|
-
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
6793
|
-
type: "string"
|
|
6794
|
-
}).option("mode", {
|
|
6795
|
-
alias: ["m"],
|
|
6796
|
-
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',
|
|
6797
|
-
choices: ["create", "createOrUpdate", "mirror"],
|
|
6798
|
-
default: "mirror",
|
|
6799
|
-
type: "string"
|
|
6800
|
-
})
|
|
6801
|
-
)
|
|
6802
|
-
)
|
|
6803
|
-
)
|
|
6804
|
-
)
|
|
6805
|
-
),
|
|
6806
|
-
handler: async ({
|
|
6807
|
-
apiHost,
|
|
6808
|
-
apiKey,
|
|
6809
|
-
proxy,
|
|
6810
|
-
directory,
|
|
6811
|
-
mode,
|
|
6812
|
-
whatIf,
|
|
6813
|
-
project: projectId,
|
|
6814
|
-
diff: diffMode,
|
|
6815
|
-
allowEmptySource,
|
|
6816
|
-
verbose
|
|
6817
|
-
}) => {
|
|
6818
|
-
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6819
|
-
const client = getWebhooksClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6820
|
-
let source;
|
|
6821
|
-
const isPackage = isPathAPackageFile(directory);
|
|
6822
|
-
if (isPackage) {
|
|
6823
|
-
const packageContents = readCanvasPackage(directory, true, verbose);
|
|
6824
|
-
source = await createArraySyncEngineDataSource({
|
|
6825
|
-
name: `Package file ${directory}`,
|
|
6826
|
-
objects: packageContents.webhooks ?? [],
|
|
6827
|
-
selectIdentifier: selectIdentifier7,
|
|
6828
|
-
selectDisplayName: selectDisplayName7
|
|
6829
|
-
});
|
|
6830
|
-
} else {
|
|
6831
|
-
source = await createFileSyncEngineDataSource({
|
|
6832
|
-
directory,
|
|
6833
|
-
selectIdentifier: selectIdentifier7,
|
|
6834
|
-
selectDisplayName: selectDisplayName7,
|
|
6835
|
-
verbose
|
|
6836
|
-
});
|
|
6837
|
-
}
|
|
6838
|
-
const target = createWebhookEngineDataSource({ client });
|
|
6839
|
-
await syncEngine({
|
|
6840
|
-
source,
|
|
6841
|
-
target,
|
|
6842
|
-
mode,
|
|
6843
|
-
whatIf,
|
|
6844
|
-
allowEmptySource,
|
|
6845
|
-
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
6846
|
-
compareContents: compareWebhooks
|
|
6847
|
-
});
|
|
6848
|
-
}
|
|
6849
|
-
};
|
|
6850
|
-
|
|
6851
|
-
// src/commands/canvas/commands/webhooks.ts
|
|
6852
|
-
var WebhookModule = {
|
|
6853
|
-
command: "webhook <command>",
|
|
6854
|
-
aliases: ["wh"],
|
|
6855
|
-
describe: "Commands for Canvas webhooks",
|
|
6856
|
-
builder: (yargs36) => yargs36.command(WebhookPullModule).command(WebhookPushModule).demandCommand(),
|
|
6857
|
-
handler: () => {
|
|
6858
|
-
yargs16.help();
|
|
6859
|
-
}
|
|
6860
|
-
};
|
|
6861
|
-
|
|
6862
6510
|
// src/commands/canvas/commands/workflow.ts
|
|
6863
|
-
import
|
|
6511
|
+
import yargs16 from "yargs";
|
|
6864
6512
|
|
|
6865
6513
|
// src/commands/canvas/commands/workflow/_util.ts
|
|
6866
6514
|
import { WorkflowClient } from "@uniformdev/canvas";
|
|
6867
|
-
var
|
|
6868
|
-
var
|
|
6515
|
+
var selectIdentifier7 = (workflow) => workflow.id;
|
|
6516
|
+
var selectDisplayName7 = (workflow) => `${workflow.name} (pid: ${workflow.id})`;
|
|
6869
6517
|
var getWorkflowClient = (options) => new WorkflowClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
6870
6518
|
|
|
6871
6519
|
// src/commands/canvas/workflowEngineDataSource.ts
|
|
@@ -6879,8 +6527,8 @@ function createWorkflowEngineDataSource({
|
|
|
6879
6527
|
for await (const workflow of workflows) {
|
|
6880
6528
|
const { modified, modifiedBy, created, createdBy, ...workflowWithoutStatistics } = workflow;
|
|
6881
6529
|
const result = {
|
|
6882
|
-
id:
|
|
6883
|
-
displayName:
|
|
6530
|
+
id: selectIdentifier7(workflow),
|
|
6531
|
+
displayName: selectDisplayName7(workflow),
|
|
6884
6532
|
providerId: workflow.id,
|
|
6885
6533
|
object: workflowWithoutStatistics
|
|
6886
6534
|
};
|
|
@@ -6903,12 +6551,12 @@ function createWorkflowEngineDataSource({
|
|
|
6903
6551
|
var WorkflowPullModule = {
|
|
6904
6552
|
command: "pull <directory>",
|
|
6905
6553
|
describe: "Pulls all workflows to local files in a directory",
|
|
6906
|
-
builder: (
|
|
6554
|
+
builder: (yargs35) => withConfiguration(
|
|
6907
6555
|
withApiOptions(
|
|
6908
6556
|
withDebugOptions(
|
|
6909
6557
|
withProjectOptions(
|
|
6910
6558
|
withDiffOptions(
|
|
6911
|
-
|
|
6559
|
+
yargs35.positional("directory", {
|
|
6912
6560
|
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.",
|
|
6913
6561
|
type: "string"
|
|
6914
6562
|
}).option("format", {
|
|
@@ -6952,8 +6600,8 @@ var WorkflowPullModule = {
|
|
|
6952
6600
|
target = await createArraySyncEngineDataSource({
|
|
6953
6601
|
name: `Package file ${directory}`,
|
|
6954
6602
|
objects: packageContents.workflows ?? [],
|
|
6955
|
-
selectIdentifier:
|
|
6956
|
-
selectDisplayName:
|
|
6603
|
+
selectIdentifier: selectIdentifier7,
|
|
6604
|
+
selectDisplayName: selectDisplayName7,
|
|
6957
6605
|
onSyncComplete: async (_, synced) => {
|
|
6958
6606
|
packageContents.workflows = synced;
|
|
6959
6607
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -6962,8 +6610,8 @@ var WorkflowPullModule = {
|
|
|
6962
6610
|
} else {
|
|
6963
6611
|
target = await createFileSyncEngineDataSource({
|
|
6964
6612
|
directory,
|
|
6965
|
-
selectIdentifier:
|
|
6966
|
-
selectDisplayName:
|
|
6613
|
+
selectIdentifier: selectIdentifier7,
|
|
6614
|
+
selectDisplayName: selectDisplayName7,
|
|
6967
6615
|
format,
|
|
6968
6616
|
verbose
|
|
6969
6617
|
});
|
|
@@ -6983,12 +6631,12 @@ var WorkflowPullModule = {
|
|
|
6983
6631
|
var WorkflowPushModule = {
|
|
6984
6632
|
command: "push <directory>",
|
|
6985
6633
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
6986
|
-
builder: (
|
|
6634
|
+
builder: (yargs35) => withConfiguration(
|
|
6987
6635
|
withDebugOptions(
|
|
6988
6636
|
withApiOptions(
|
|
6989
6637
|
withProjectOptions(
|
|
6990
6638
|
withDiffOptions(
|
|
6991
|
-
|
|
6639
|
+
yargs35.positional("directory", {
|
|
6992
6640
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
6993
6641
|
type: "string"
|
|
6994
6642
|
}).option("mode", {
|
|
@@ -7024,14 +6672,14 @@ var WorkflowPushModule = {
|
|
|
7024
6672
|
source = await createArraySyncEngineDataSource({
|
|
7025
6673
|
name: `Package file ${directory}`,
|
|
7026
6674
|
objects: packageContents.workflows ?? [],
|
|
7027
|
-
selectIdentifier:
|
|
7028
|
-
selectDisplayName:
|
|
6675
|
+
selectIdentifier: selectIdentifier7,
|
|
6676
|
+
selectDisplayName: selectDisplayName7
|
|
7029
6677
|
});
|
|
7030
6678
|
} else {
|
|
7031
6679
|
source = await createFileSyncEngineDataSource({
|
|
7032
6680
|
directory,
|
|
7033
|
-
selectIdentifier:
|
|
7034
|
-
selectDisplayName:
|
|
6681
|
+
selectIdentifier: selectIdentifier7,
|
|
6682
|
+
selectDisplayName: selectDisplayName7,
|
|
7035
6683
|
verbose
|
|
7036
6684
|
});
|
|
7037
6685
|
}
|
|
@@ -7052,9 +6700,9 @@ var WorkflowModule = {
|
|
|
7052
6700
|
command: "workflow <command>",
|
|
7053
6701
|
aliases: ["wf"],
|
|
7054
6702
|
describe: "Commands for Canvas workflows",
|
|
7055
|
-
builder: (
|
|
6703
|
+
builder: (yargs35) => yargs35.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
7056
6704
|
handler: () => {
|
|
7057
|
-
|
|
6705
|
+
yargs16.help();
|
|
7058
6706
|
}
|
|
7059
6707
|
};
|
|
7060
6708
|
|
|
@@ -7063,33 +6711,33 @@ var CanvasCommand = {
|
|
|
7063
6711
|
command: "canvas <command>",
|
|
7064
6712
|
aliases: ["cv", "pm", "presentation"],
|
|
7065
6713
|
describe: "Uniform Canvas commands",
|
|
7066
|
-
builder: (
|
|
6714
|
+
builder: (yargs35) => yargs35.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LocaleModule).command(WorkflowModule).command(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
7067
6715
|
handler: () => {
|
|
7068
|
-
|
|
6716
|
+
yargs17.showHelp();
|
|
7069
6717
|
}
|
|
7070
6718
|
};
|
|
7071
6719
|
|
|
7072
6720
|
// src/commands/context/index.ts
|
|
7073
|
-
import
|
|
6721
|
+
import yargs24 from "yargs";
|
|
7074
6722
|
|
|
7075
6723
|
// src/commands/context/commands/aggregate.ts
|
|
7076
|
-
import
|
|
6724
|
+
import yargs18 from "yargs";
|
|
7077
6725
|
|
|
7078
6726
|
// src/commands/context/commands/aggregate/_util.ts
|
|
7079
6727
|
import { AggregateClient } from "@uniformdev/context/api";
|
|
7080
|
-
var
|
|
7081
|
-
var
|
|
6728
|
+
var selectIdentifier8 = (source) => source.id;
|
|
6729
|
+
var selectDisplayName8 = (source) => `${source.name} (pid: ${source.id})`;
|
|
7082
6730
|
var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
7083
6731
|
|
|
7084
6732
|
// src/commands/context/commands/aggregate/get.ts
|
|
7085
6733
|
var AggregateGetModule = {
|
|
7086
6734
|
command: "get <id>",
|
|
7087
6735
|
describe: "Fetch an aggregate",
|
|
7088
|
-
builder: (
|
|
6736
|
+
builder: (yargs35) => withConfiguration(
|
|
7089
6737
|
withFormatOptions(
|
|
7090
6738
|
withApiOptions(
|
|
7091
6739
|
withProjectOptions(
|
|
7092
|
-
|
|
6740
|
+
yargs35.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
7093
6741
|
)
|
|
7094
6742
|
)
|
|
7095
6743
|
)
|
|
@@ -7112,7 +6760,7 @@ var AggregateListModule = {
|
|
|
7112
6760
|
command: "list",
|
|
7113
6761
|
describe: "List aggregates",
|
|
7114
6762
|
aliases: ["ls"],
|
|
7115
|
-
builder: (
|
|
6763
|
+
builder: (yargs35) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs35)))),
|
|
7116
6764
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7117
6765
|
const fetch2 = nodeFetchProxy(proxy);
|
|
7118
6766
|
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -7130,8 +6778,8 @@ function createAggregateEngineDataSource({
|
|
|
7130
6778
|
const aggregates = (await client.get({ type })).aggregates;
|
|
7131
6779
|
for await (const def of aggregates) {
|
|
7132
6780
|
const result = {
|
|
7133
|
-
id:
|
|
7134
|
-
displayName:
|
|
6781
|
+
id: selectIdentifier8(def),
|
|
6782
|
+
displayName: selectDisplayName8(def),
|
|
7135
6783
|
providerId: def.id,
|
|
7136
6784
|
object: def
|
|
7137
6785
|
};
|
|
@@ -7175,12 +6823,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
7175
6823
|
var AggregatePullModule = {
|
|
7176
6824
|
command: "pull <directory>",
|
|
7177
6825
|
describe: "Pulls all aggregates to local files in a directory",
|
|
7178
|
-
builder: (
|
|
6826
|
+
builder: (yargs35) => withConfiguration(
|
|
7179
6827
|
withApiOptions(
|
|
7180
6828
|
withDebugOptions(
|
|
7181
6829
|
withProjectOptions(
|
|
7182
6830
|
withDiffOptions(
|
|
7183
|
-
|
|
6831
|
+
yargs35.positional("directory", {
|
|
7184
6832
|
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.",
|
|
7185
6833
|
type: "string"
|
|
7186
6834
|
}).option("format", {
|
|
@@ -7224,8 +6872,8 @@ var AggregatePullModule = {
|
|
|
7224
6872
|
target = await createArraySyncEngineDataSource({
|
|
7225
6873
|
name: `Package file ${directory}`,
|
|
7226
6874
|
objects: packageContents.aggregates ?? [],
|
|
7227
|
-
selectIdentifier:
|
|
7228
|
-
selectDisplayName:
|
|
6875
|
+
selectIdentifier: selectIdentifier8,
|
|
6876
|
+
selectDisplayName: selectDisplayName8,
|
|
7229
6877
|
onSyncComplete: async (_, synced) => {
|
|
7230
6878
|
packageContents.aggregates = synced;
|
|
7231
6879
|
writeContextPackage(directory, packageContents);
|
|
@@ -7234,8 +6882,8 @@ var AggregatePullModule = {
|
|
|
7234
6882
|
} else {
|
|
7235
6883
|
target = await createFileSyncEngineDataSource({
|
|
7236
6884
|
directory,
|
|
7237
|
-
selectIdentifier:
|
|
7238
|
-
selectDisplayName:
|
|
6885
|
+
selectIdentifier: selectIdentifier8,
|
|
6886
|
+
selectDisplayName: selectDisplayName8,
|
|
7239
6887
|
format,
|
|
7240
6888
|
verbose
|
|
7241
6889
|
});
|
|
@@ -7255,12 +6903,12 @@ var AggregatePullModule = {
|
|
|
7255
6903
|
var AggregatePushModule = {
|
|
7256
6904
|
command: "push <directory>",
|
|
7257
6905
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
7258
|
-
builder: (
|
|
6906
|
+
builder: (yargs35) => withConfiguration(
|
|
7259
6907
|
withApiOptions(
|
|
7260
6908
|
withProjectOptions(
|
|
7261
6909
|
withDiffOptions(
|
|
7262
6910
|
withDebugOptions(
|
|
7263
|
-
|
|
6911
|
+
yargs35.positional("directory", {
|
|
7264
6912
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
7265
6913
|
type: "string"
|
|
7266
6914
|
}).option("mode", {
|
|
@@ -7296,14 +6944,14 @@ var AggregatePushModule = {
|
|
|
7296
6944
|
source = await createArraySyncEngineDataSource({
|
|
7297
6945
|
name: `Package file ${directory}`,
|
|
7298
6946
|
objects: packageContents.aggregates ?? [],
|
|
7299
|
-
selectIdentifier:
|
|
7300
|
-
selectDisplayName:
|
|
6947
|
+
selectIdentifier: selectIdentifier8,
|
|
6948
|
+
selectDisplayName: selectDisplayName8
|
|
7301
6949
|
});
|
|
7302
6950
|
} else {
|
|
7303
6951
|
source = await createFileSyncEngineDataSource({
|
|
7304
6952
|
directory,
|
|
7305
|
-
selectIdentifier:
|
|
7306
|
-
selectDisplayName:
|
|
6953
|
+
selectIdentifier: selectIdentifier8,
|
|
6954
|
+
selectDisplayName: selectDisplayName8,
|
|
7307
6955
|
verbose
|
|
7308
6956
|
});
|
|
7309
6957
|
}
|
|
@@ -7325,10 +6973,10 @@ var AggregateRemoveModule = {
|
|
|
7325
6973
|
command: "remove <id>",
|
|
7326
6974
|
aliases: ["delete", "rm"],
|
|
7327
6975
|
describe: "Delete an aggregate",
|
|
7328
|
-
builder: (
|
|
6976
|
+
builder: (yargs35) => withConfiguration(
|
|
7329
6977
|
withApiOptions(
|
|
7330
6978
|
withProjectOptions(
|
|
7331
|
-
|
|
6979
|
+
yargs35.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
7332
6980
|
)
|
|
7333
6981
|
)
|
|
7334
6982
|
),
|
|
@@ -7344,10 +6992,10 @@ var AggregateUpdateModule = {
|
|
|
7344
6992
|
command: "update <filename>",
|
|
7345
6993
|
aliases: ["put"],
|
|
7346
6994
|
describe: "Insert or update an aggregate",
|
|
7347
|
-
builder: (
|
|
6995
|
+
builder: (yargs35) => withConfiguration(
|
|
7348
6996
|
withApiOptions(
|
|
7349
6997
|
withProjectOptions(
|
|
7350
|
-
|
|
6998
|
+
yargs35.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
7351
6999
|
)
|
|
7352
7000
|
)
|
|
7353
7001
|
),
|
|
@@ -7364,19 +7012,19 @@ var AggregateModule = {
|
|
|
7364
7012
|
command: "aggregate <command>",
|
|
7365
7013
|
aliases: ["agg", "intent", "audience"],
|
|
7366
7014
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
7367
|
-
builder: (
|
|
7015
|
+
builder: (yargs35) => yargs35.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
7368
7016
|
handler: () => {
|
|
7369
|
-
|
|
7017
|
+
yargs18.help();
|
|
7370
7018
|
}
|
|
7371
7019
|
};
|
|
7372
7020
|
|
|
7373
7021
|
// src/commands/context/commands/enrichment.ts
|
|
7374
|
-
import
|
|
7022
|
+
import yargs19 from "yargs";
|
|
7375
7023
|
|
|
7376
7024
|
// src/commands/context/commands/enrichment/_util.ts
|
|
7377
7025
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
7378
|
-
var
|
|
7379
|
-
var
|
|
7026
|
+
var selectIdentifier9 = (source) => source.id;
|
|
7027
|
+
var selectDisplayName9 = (source) => `${source.name} (pid: ${source.id})`;
|
|
7380
7028
|
function getEnrichmentClient(options) {
|
|
7381
7029
|
return new UncachedEnrichmentClient({ ...options, limitPolicy: cliLimitPolicy });
|
|
7382
7030
|
}
|
|
@@ -7385,11 +7033,11 @@ function getEnrichmentClient(options) {
|
|
|
7385
7033
|
var EnrichmentGetModule = {
|
|
7386
7034
|
command: "get <id>",
|
|
7387
7035
|
describe: "Fetch an enrichment category and its values",
|
|
7388
|
-
builder: (
|
|
7036
|
+
builder: (yargs35) => withFormatOptions(
|
|
7389
7037
|
withConfiguration(
|
|
7390
7038
|
withApiOptions(
|
|
7391
7039
|
withProjectOptions(
|
|
7392
|
-
|
|
7040
|
+
yargs35.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
7393
7041
|
)
|
|
7394
7042
|
)
|
|
7395
7043
|
)
|
|
@@ -7412,7 +7060,7 @@ var EnrichmentListModule = {
|
|
|
7412
7060
|
command: "list",
|
|
7413
7061
|
describe: "List enrichments",
|
|
7414
7062
|
aliases: ["ls"],
|
|
7415
|
-
builder: (
|
|
7063
|
+
builder: (yargs35) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs35)))),
|
|
7416
7064
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7417
7065
|
const fetch2 = nodeFetchProxy(proxy);
|
|
7418
7066
|
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -7429,8 +7077,8 @@ function createEnrichmentEngineDataSource({
|
|
|
7429
7077
|
const enrichments = (await client.get()).enrichments;
|
|
7430
7078
|
for await (const def of enrichments) {
|
|
7431
7079
|
const result = {
|
|
7432
|
-
id:
|
|
7433
|
-
displayName:
|
|
7080
|
+
id: selectIdentifier9(def),
|
|
7081
|
+
displayName: selectDisplayName9(def),
|
|
7434
7082
|
providerId: def.id,
|
|
7435
7083
|
object: def
|
|
7436
7084
|
};
|
|
@@ -7507,12 +7155,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
7507
7155
|
var EnrichmentPullModule = {
|
|
7508
7156
|
command: "pull <directory>",
|
|
7509
7157
|
describe: "Pulls all enrichments to local files in a directory",
|
|
7510
|
-
builder: (
|
|
7158
|
+
builder: (yargs35) => withConfiguration(
|
|
7511
7159
|
withDebugOptions(
|
|
7512
7160
|
withApiOptions(
|
|
7513
7161
|
withProjectOptions(
|
|
7514
7162
|
withDiffOptions(
|
|
7515
|
-
|
|
7163
|
+
yargs35.positional("directory", {
|
|
7516
7164
|
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.",
|
|
7517
7165
|
type: "string"
|
|
7518
7166
|
}).option("format", {
|
|
@@ -7556,8 +7204,8 @@ var EnrichmentPullModule = {
|
|
|
7556
7204
|
target = await createArraySyncEngineDataSource({
|
|
7557
7205
|
name: `Package file ${directory}`,
|
|
7558
7206
|
objects: packageContents.enrichments ?? [],
|
|
7559
|
-
selectIdentifier:
|
|
7560
|
-
selectDisplayName:
|
|
7207
|
+
selectIdentifier: selectIdentifier9,
|
|
7208
|
+
selectDisplayName: selectDisplayName9,
|
|
7561
7209
|
onSyncComplete: async (_, synced) => {
|
|
7562
7210
|
packageContents.enrichments = synced;
|
|
7563
7211
|
writeContextPackage(directory, packageContents);
|
|
@@ -7566,8 +7214,8 @@ var EnrichmentPullModule = {
|
|
|
7566
7214
|
} else {
|
|
7567
7215
|
target = await createFileSyncEngineDataSource({
|
|
7568
7216
|
directory,
|
|
7569
|
-
selectIdentifier:
|
|
7570
|
-
selectDisplayName:
|
|
7217
|
+
selectIdentifier: selectIdentifier9,
|
|
7218
|
+
selectDisplayName: selectDisplayName9,
|
|
7571
7219
|
format,
|
|
7572
7220
|
verbose
|
|
7573
7221
|
});
|
|
@@ -7587,11 +7235,11 @@ var EnrichmentPullModule = {
|
|
|
7587
7235
|
var EnrichmentPushModule = {
|
|
7588
7236
|
command: "push <directory>",
|
|
7589
7237
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
7590
|
-
builder: (
|
|
7238
|
+
builder: (yargs35) => withConfiguration(
|
|
7591
7239
|
withApiOptions(
|
|
7592
7240
|
withProjectOptions(
|
|
7593
7241
|
withDiffOptions(
|
|
7594
|
-
|
|
7242
|
+
yargs35.positional("directory", {
|
|
7595
7243
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
7596
7244
|
type: "string"
|
|
7597
7245
|
}).option("mode", {
|
|
@@ -7626,14 +7274,14 @@ var EnrichmentPushModule = {
|
|
|
7626
7274
|
source = await createArraySyncEngineDataSource({
|
|
7627
7275
|
name: `Package file ${directory}`,
|
|
7628
7276
|
objects: packageContents.enrichments ?? [],
|
|
7629
|
-
selectIdentifier:
|
|
7630
|
-
selectDisplayName:
|
|
7277
|
+
selectIdentifier: selectIdentifier9,
|
|
7278
|
+
selectDisplayName: selectDisplayName9
|
|
7631
7279
|
});
|
|
7632
7280
|
} else {
|
|
7633
7281
|
source = await createFileSyncEngineDataSource({
|
|
7634
7282
|
directory,
|
|
7635
|
-
selectIdentifier:
|
|
7636
|
-
selectDisplayName:
|
|
7283
|
+
selectIdentifier: selectIdentifier9,
|
|
7284
|
+
selectDisplayName: selectDisplayName9,
|
|
7637
7285
|
verbose
|
|
7638
7286
|
});
|
|
7639
7287
|
}
|
|
@@ -7654,10 +7302,10 @@ var EnrichmentRemoveModule = {
|
|
|
7654
7302
|
command: "remove <id>",
|
|
7655
7303
|
aliases: ["delete", "rm"],
|
|
7656
7304
|
describe: "Delete an enrichment category and its values",
|
|
7657
|
-
builder: (
|
|
7305
|
+
builder: (yargs35) => withConfiguration(
|
|
7658
7306
|
withApiOptions(
|
|
7659
7307
|
withProjectOptions(
|
|
7660
|
-
|
|
7308
|
+
yargs35.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
7661
7309
|
)
|
|
7662
7310
|
)
|
|
7663
7311
|
),
|
|
@@ -7673,14 +7321,14 @@ var EnrichmentModule = {
|
|
|
7673
7321
|
command: "enrichment <command>",
|
|
7674
7322
|
aliases: ["enr"],
|
|
7675
7323
|
describe: "Commands for Context enrichments",
|
|
7676
|
-
builder: (
|
|
7324
|
+
builder: (yargs35) => yargs35.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
7677
7325
|
handler: () => {
|
|
7678
|
-
|
|
7326
|
+
yargs19.help();
|
|
7679
7327
|
}
|
|
7680
7328
|
};
|
|
7681
7329
|
|
|
7682
7330
|
// src/commands/context/commands/manifest.ts
|
|
7683
|
-
import
|
|
7331
|
+
import yargs20 from "yargs";
|
|
7684
7332
|
|
|
7685
7333
|
// src/commands/context/commands/manifest/get.ts
|
|
7686
7334
|
import { ApiClientError as ApiClientError2, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -7691,10 +7339,10 @@ var ManifestGetModule = {
|
|
|
7691
7339
|
command: "get [output]",
|
|
7692
7340
|
aliases: ["dl", "download"],
|
|
7693
7341
|
describe: "Download the Uniform Context manifest for a project",
|
|
7694
|
-
builder: (
|
|
7342
|
+
builder: (yargs35) => withConfiguration(
|
|
7695
7343
|
withApiOptions(
|
|
7696
7344
|
withProjectOptions(
|
|
7697
|
-
|
|
7345
|
+
yargs35.option("preview", {
|
|
7698
7346
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
7699
7347
|
default: false,
|
|
7700
7348
|
type: "boolean",
|
|
@@ -7756,7 +7404,7 @@ import { exit as exit2 } from "process";
|
|
|
7756
7404
|
var ManifestPublishModule = {
|
|
7757
7405
|
command: "publish",
|
|
7758
7406
|
describe: "Publish the Uniform Context manifest for a project",
|
|
7759
|
-
builder: (
|
|
7407
|
+
builder: (yargs35) => withConfiguration(withApiOptions(withProjectOptions(yargs35))),
|
|
7760
7408
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
7761
7409
|
const fetch2 = nodeFetchProxy(proxy);
|
|
7762
7410
|
try {
|
|
@@ -7789,25 +7437,25 @@ var ManifestModule = {
|
|
|
7789
7437
|
command: "manifest <command>",
|
|
7790
7438
|
describe: "Commands for context manifests",
|
|
7791
7439
|
aliases: ["man"],
|
|
7792
|
-
builder: (
|
|
7440
|
+
builder: (yargs35) => yargs35.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
7793
7441
|
handler: () => {
|
|
7794
|
-
|
|
7442
|
+
yargs20.help();
|
|
7795
7443
|
}
|
|
7796
7444
|
};
|
|
7797
7445
|
|
|
7798
7446
|
// src/commands/context/commands/quirk.ts
|
|
7799
|
-
import
|
|
7447
|
+
import yargs21 from "yargs";
|
|
7800
7448
|
|
|
7801
7449
|
// src/commands/context/commands/quirk/get.ts
|
|
7802
7450
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
7803
7451
|
var QuirkGetModule = {
|
|
7804
7452
|
command: "get <id>",
|
|
7805
7453
|
describe: "Fetch a quirk",
|
|
7806
|
-
builder: (
|
|
7454
|
+
builder: (yargs35) => withConfiguration(
|
|
7807
7455
|
withFormatOptions(
|
|
7808
7456
|
withApiOptions(
|
|
7809
7457
|
withProjectOptions(
|
|
7810
|
-
|
|
7458
|
+
yargs35.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
7811
7459
|
)
|
|
7812
7460
|
)
|
|
7813
7461
|
)
|
|
@@ -7831,11 +7479,11 @@ var QuirkListModule = {
|
|
|
7831
7479
|
command: "list",
|
|
7832
7480
|
describe: "List quirks",
|
|
7833
7481
|
aliases: ["ls"],
|
|
7834
|
-
builder: (
|
|
7482
|
+
builder: (yargs35) => withConfiguration(
|
|
7835
7483
|
withFormatOptions(
|
|
7836
7484
|
withApiOptions(
|
|
7837
7485
|
withProjectOptions(
|
|
7838
|
-
|
|
7486
|
+
yargs35.option("withIntegrations", {
|
|
7839
7487
|
alias: ["i"],
|
|
7840
7488
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
7841
7489
|
type: "boolean"
|
|
@@ -7856,8 +7504,8 @@ var QuirkListModule = {
|
|
|
7856
7504
|
import { UncachedQuirkClient as UncachedQuirkClient3 } from "@uniformdev/context/api";
|
|
7857
7505
|
|
|
7858
7506
|
// src/commands/context/commands/quirk/_util.ts
|
|
7859
|
-
var
|
|
7860
|
-
var
|
|
7507
|
+
var selectIdentifier10 = (source) => source.id;
|
|
7508
|
+
var selectDisplayName10 = (source) => `${source.name} (pid: ${source.id})`;
|
|
7861
7509
|
|
|
7862
7510
|
// src/commands/context/quirkEngineDataSource.ts
|
|
7863
7511
|
function createQuirkEngineDataSource({
|
|
@@ -7867,8 +7515,8 @@ function createQuirkEngineDataSource({
|
|
|
7867
7515
|
const quirks = (await client.get({ withIntegrations: false })).quirks;
|
|
7868
7516
|
for await (const def of quirks) {
|
|
7869
7517
|
const result = {
|
|
7870
|
-
id:
|
|
7871
|
-
displayName:
|
|
7518
|
+
id: selectIdentifier10(def),
|
|
7519
|
+
displayName: selectDisplayName10(def),
|
|
7872
7520
|
providerId: def.id,
|
|
7873
7521
|
object: def
|
|
7874
7522
|
};
|
|
@@ -7893,12 +7541,12 @@ function createQuirkEngineDataSource({
|
|
|
7893
7541
|
var QuirkPullModule = {
|
|
7894
7542
|
command: "pull <directory>",
|
|
7895
7543
|
describe: "Pulls all quirks to local files in a directory",
|
|
7896
|
-
builder: (
|
|
7544
|
+
builder: (yargs35) => withConfiguration(
|
|
7897
7545
|
withDebugOptions(
|
|
7898
7546
|
withApiOptions(
|
|
7899
7547
|
withProjectOptions(
|
|
7900
7548
|
withDiffOptions(
|
|
7901
|
-
|
|
7549
|
+
yargs35.positional("directory", {
|
|
7902
7550
|
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.",
|
|
7903
7551
|
type: "string"
|
|
7904
7552
|
}).option("format", {
|
|
@@ -7942,8 +7590,8 @@ var QuirkPullModule = {
|
|
|
7942
7590
|
target = await createArraySyncEngineDataSource({
|
|
7943
7591
|
name: `Package file ${directory}`,
|
|
7944
7592
|
objects: packageContents.quirks ?? [],
|
|
7945
|
-
selectIdentifier:
|
|
7946
|
-
selectDisplayName:
|
|
7593
|
+
selectIdentifier: selectIdentifier10,
|
|
7594
|
+
selectDisplayName: selectDisplayName10,
|
|
7947
7595
|
onSyncComplete: async (_, synced) => {
|
|
7948
7596
|
packageContents.quirks = synced;
|
|
7949
7597
|
writeContextPackage(directory, packageContents);
|
|
@@ -7952,8 +7600,8 @@ var QuirkPullModule = {
|
|
|
7952
7600
|
} else {
|
|
7953
7601
|
target = await createFileSyncEngineDataSource({
|
|
7954
7602
|
directory,
|
|
7955
|
-
selectIdentifier:
|
|
7956
|
-
selectDisplayName:
|
|
7603
|
+
selectIdentifier: selectIdentifier10,
|
|
7604
|
+
selectDisplayName: selectDisplayName10,
|
|
7957
7605
|
format,
|
|
7958
7606
|
verbose
|
|
7959
7607
|
});
|
|
@@ -7974,12 +7622,12 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
7974
7622
|
var QuirkPushModule = {
|
|
7975
7623
|
command: "push <directory>",
|
|
7976
7624
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
7977
|
-
builder: (
|
|
7625
|
+
builder: (yargs35) => withConfiguration(
|
|
7978
7626
|
withDebugOptions(
|
|
7979
7627
|
withApiOptions(
|
|
7980
7628
|
withProjectOptions(
|
|
7981
7629
|
withDiffOptions(
|
|
7982
|
-
|
|
7630
|
+
yargs35.positional("directory", {
|
|
7983
7631
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
7984
7632
|
type: "string"
|
|
7985
7633
|
}).option("mode", {
|
|
@@ -8015,14 +7663,14 @@ var QuirkPushModule = {
|
|
|
8015
7663
|
source = await createArraySyncEngineDataSource({
|
|
8016
7664
|
name: `Package file ${directory}`,
|
|
8017
7665
|
objects: packageContents.quirks ?? [],
|
|
8018
|
-
selectIdentifier:
|
|
8019
|
-
selectDisplayName:
|
|
7666
|
+
selectIdentifier: selectIdentifier10,
|
|
7667
|
+
selectDisplayName: selectDisplayName10
|
|
8020
7668
|
});
|
|
8021
7669
|
} else {
|
|
8022
7670
|
source = await createFileSyncEngineDataSource({
|
|
8023
7671
|
directory,
|
|
8024
|
-
selectIdentifier:
|
|
8025
|
-
selectDisplayName:
|
|
7672
|
+
selectIdentifier: selectIdentifier10,
|
|
7673
|
+
selectDisplayName: selectDisplayName10,
|
|
8026
7674
|
verbose
|
|
8027
7675
|
});
|
|
8028
7676
|
}
|
|
@@ -8044,10 +7692,10 @@ var QuirkRemoveModule = {
|
|
|
8044
7692
|
command: "remove <id>",
|
|
8045
7693
|
aliases: ["delete", "rm"],
|
|
8046
7694
|
describe: "Delete a quirk",
|
|
8047
|
-
builder: (
|
|
7695
|
+
builder: (yargs35) => withConfiguration(
|
|
8048
7696
|
withApiOptions(
|
|
8049
7697
|
withProjectOptions(
|
|
8050
|
-
|
|
7698
|
+
yargs35.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
8051
7699
|
)
|
|
8052
7700
|
)
|
|
8053
7701
|
),
|
|
@@ -8064,10 +7712,10 @@ var QuirkUpdateModule = {
|
|
|
8064
7712
|
command: "update <filename>",
|
|
8065
7713
|
aliases: ["put"],
|
|
8066
7714
|
describe: "Insert or update a quirk",
|
|
8067
|
-
builder: (
|
|
7715
|
+
builder: (yargs35) => withConfiguration(
|
|
8068
7716
|
withApiOptions(
|
|
8069
7717
|
withProjectOptions(
|
|
8070
|
-
|
|
7718
|
+
yargs35.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
8071
7719
|
)
|
|
8072
7720
|
)
|
|
8073
7721
|
),
|
|
@@ -8084,25 +7732,25 @@ var QuirkModule = {
|
|
|
8084
7732
|
command: "quirk <command>",
|
|
8085
7733
|
aliases: ["qk"],
|
|
8086
7734
|
describe: "Commands for Context quirks",
|
|
8087
|
-
builder: (
|
|
7735
|
+
builder: (yargs35) => yargs35.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
8088
7736
|
handler: () => {
|
|
8089
|
-
|
|
7737
|
+
yargs21.help();
|
|
8090
7738
|
}
|
|
8091
7739
|
};
|
|
8092
7740
|
|
|
8093
7741
|
// src/commands/context/commands/signal.ts
|
|
8094
|
-
import
|
|
7742
|
+
import yargs22 from "yargs";
|
|
8095
7743
|
|
|
8096
7744
|
// src/commands/context/commands/signal/get.ts
|
|
8097
7745
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
8098
7746
|
var SignalGetModule = {
|
|
8099
7747
|
command: "get <id>",
|
|
8100
7748
|
describe: "Fetch a signal",
|
|
8101
|
-
builder: (
|
|
7749
|
+
builder: (yargs35) => withConfiguration(
|
|
8102
7750
|
withFormatOptions(
|
|
8103
7751
|
withApiOptions(
|
|
8104
7752
|
withProjectOptions(
|
|
8105
|
-
|
|
7753
|
+
yargs35.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
8106
7754
|
)
|
|
8107
7755
|
)
|
|
8108
7756
|
)
|
|
@@ -8126,7 +7774,7 @@ var SignalListModule = {
|
|
|
8126
7774
|
command: "list",
|
|
8127
7775
|
describe: "List signals",
|
|
8128
7776
|
aliases: ["ls"],
|
|
8129
|
-
builder: (
|
|
7777
|
+
builder: (yargs35) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs35)))),
|
|
8130
7778
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8131
7779
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8132
7780
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8139,8 +7787,8 @@ var SignalListModule = {
|
|
|
8139
7787
|
import { UncachedSignalClient as UncachedSignalClient3 } from "@uniformdev/context/api";
|
|
8140
7788
|
|
|
8141
7789
|
// src/commands/context/commands/signal/_util.ts
|
|
8142
|
-
var
|
|
8143
|
-
var
|
|
7790
|
+
var selectIdentifier11 = (source) => source.id;
|
|
7791
|
+
var selectDisplayName11 = (source) => `${source.name} (pid: ${source.id})`;
|
|
8144
7792
|
|
|
8145
7793
|
// src/commands/context/signalEngineDataSource.ts
|
|
8146
7794
|
function createSignalEngineDataSource({
|
|
@@ -8150,8 +7798,8 @@ function createSignalEngineDataSource({
|
|
|
8150
7798
|
const signals = (await client.get()).signals;
|
|
8151
7799
|
for await (const def of signals) {
|
|
8152
7800
|
const result = {
|
|
8153
|
-
id:
|
|
8154
|
-
displayName:
|
|
7801
|
+
id: selectIdentifier11(def),
|
|
7802
|
+
displayName: selectDisplayName11(def),
|
|
8155
7803
|
providerId: def.id,
|
|
8156
7804
|
object: def
|
|
8157
7805
|
};
|
|
@@ -8176,12 +7824,12 @@ function createSignalEngineDataSource({
|
|
|
8176
7824
|
var SignalPullModule = {
|
|
8177
7825
|
command: "pull <directory>",
|
|
8178
7826
|
describe: "Pulls all signals to local files in a directory",
|
|
8179
|
-
builder: (
|
|
7827
|
+
builder: (yargs35) => withConfiguration(
|
|
8180
7828
|
withDebugOptions(
|
|
8181
7829
|
withApiOptions(
|
|
8182
7830
|
withProjectOptions(
|
|
8183
7831
|
withDiffOptions(
|
|
8184
|
-
|
|
7832
|
+
yargs35.positional("directory", {
|
|
8185
7833
|
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.",
|
|
8186
7834
|
type: "string"
|
|
8187
7835
|
}).option("format", {
|
|
@@ -8225,8 +7873,8 @@ var SignalPullModule = {
|
|
|
8225
7873
|
target = await createArraySyncEngineDataSource({
|
|
8226
7874
|
name: `Package file ${directory}`,
|
|
8227
7875
|
objects: packageContents.signals ?? [],
|
|
8228
|
-
selectIdentifier:
|
|
8229
|
-
selectDisplayName:
|
|
7876
|
+
selectIdentifier: selectIdentifier11,
|
|
7877
|
+
selectDisplayName: selectDisplayName11,
|
|
8230
7878
|
onSyncComplete: async (_, synced) => {
|
|
8231
7879
|
packageContents.signals = synced;
|
|
8232
7880
|
writeContextPackage(directory, packageContents);
|
|
@@ -8235,8 +7883,8 @@ var SignalPullModule = {
|
|
|
8235
7883
|
} else {
|
|
8236
7884
|
target = await createFileSyncEngineDataSource({
|
|
8237
7885
|
directory,
|
|
8238
|
-
selectIdentifier:
|
|
8239
|
-
selectDisplayName:
|
|
7886
|
+
selectIdentifier: selectIdentifier11,
|
|
7887
|
+
selectDisplayName: selectDisplayName11,
|
|
8240
7888
|
format,
|
|
8241
7889
|
verbose
|
|
8242
7890
|
});
|
|
@@ -8257,12 +7905,12 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
8257
7905
|
var SignalPushModule = {
|
|
8258
7906
|
command: "push <directory>",
|
|
8259
7907
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
8260
|
-
builder: (
|
|
7908
|
+
builder: (yargs35) => withConfiguration(
|
|
8261
7909
|
withDebugOptions(
|
|
8262
7910
|
withApiOptions(
|
|
8263
7911
|
withProjectOptions(
|
|
8264
7912
|
withDiffOptions(
|
|
8265
|
-
|
|
7913
|
+
yargs35.positional("directory", {
|
|
8266
7914
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
8267
7915
|
type: "string"
|
|
8268
7916
|
}).option("mode", {
|
|
@@ -8298,14 +7946,14 @@ var SignalPushModule = {
|
|
|
8298
7946
|
source = await createArraySyncEngineDataSource({
|
|
8299
7947
|
name: `Package file ${directory}`,
|
|
8300
7948
|
objects: packageContents.signals ?? [],
|
|
8301
|
-
selectIdentifier:
|
|
8302
|
-
selectDisplayName:
|
|
7949
|
+
selectIdentifier: selectIdentifier11,
|
|
7950
|
+
selectDisplayName: selectDisplayName11
|
|
8303
7951
|
});
|
|
8304
7952
|
} else {
|
|
8305
7953
|
source = await createFileSyncEngineDataSource({
|
|
8306
7954
|
directory,
|
|
8307
|
-
selectIdentifier:
|
|
8308
|
-
selectDisplayName:
|
|
7955
|
+
selectIdentifier: selectIdentifier11,
|
|
7956
|
+
selectDisplayName: selectDisplayName11,
|
|
8309
7957
|
verbose
|
|
8310
7958
|
});
|
|
8311
7959
|
}
|
|
@@ -8327,10 +7975,10 @@ var SignalRemoveModule = {
|
|
|
8327
7975
|
command: "remove <id>",
|
|
8328
7976
|
aliases: ["delete", "rm"],
|
|
8329
7977
|
describe: "Delete a signal",
|
|
8330
|
-
builder: (
|
|
7978
|
+
builder: (yargs35) => withConfiguration(
|
|
8331
7979
|
withApiOptions(
|
|
8332
7980
|
withProjectOptions(
|
|
8333
|
-
|
|
7981
|
+
yargs35.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
8334
7982
|
)
|
|
8335
7983
|
)
|
|
8336
7984
|
),
|
|
@@ -8347,10 +7995,10 @@ var SignalUpdateModule = {
|
|
|
8347
7995
|
command: "update <filename>",
|
|
8348
7996
|
aliases: ["put"],
|
|
8349
7997
|
describe: "Insert or update a signal",
|
|
8350
|
-
builder: (
|
|
7998
|
+
builder: (yargs35) => withConfiguration(
|
|
8351
7999
|
withApiOptions(
|
|
8352
8000
|
withProjectOptions(
|
|
8353
|
-
|
|
8001
|
+
yargs35.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
8354
8002
|
)
|
|
8355
8003
|
)
|
|
8356
8004
|
),
|
|
@@ -8367,25 +8015,25 @@ var SignalModule = {
|
|
|
8367
8015
|
command: "signal <command>",
|
|
8368
8016
|
aliases: ["sig"],
|
|
8369
8017
|
describe: "Commands for Context signals",
|
|
8370
|
-
builder: (
|
|
8018
|
+
builder: (yargs35) => yargs35.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
8371
8019
|
handler: () => {
|
|
8372
|
-
|
|
8020
|
+
yargs22.help();
|
|
8373
8021
|
}
|
|
8374
8022
|
};
|
|
8375
8023
|
|
|
8376
8024
|
// src/commands/context/commands/test.ts
|
|
8377
|
-
import
|
|
8025
|
+
import yargs23 from "yargs";
|
|
8378
8026
|
|
|
8379
8027
|
// src/commands/context/commands/test/get.ts
|
|
8380
8028
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
8381
8029
|
var TestGetModule = {
|
|
8382
8030
|
command: "get <id>",
|
|
8383
8031
|
describe: "Fetch a test",
|
|
8384
|
-
builder: (
|
|
8032
|
+
builder: (yargs35) => withConfiguration(
|
|
8385
8033
|
withFormatOptions(
|
|
8386
8034
|
withApiOptions(
|
|
8387
8035
|
withProjectOptions(
|
|
8388
|
-
|
|
8036
|
+
yargs35.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
8389
8037
|
)
|
|
8390
8038
|
)
|
|
8391
8039
|
)
|
|
@@ -8409,7 +8057,7 @@ var TestListModule = {
|
|
|
8409
8057
|
command: "list",
|
|
8410
8058
|
describe: "List tests",
|
|
8411
8059
|
aliases: ["ls"],
|
|
8412
|
-
builder: (
|
|
8060
|
+
builder: (yargs35) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs35)))),
|
|
8413
8061
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8414
8062
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8415
8063
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8422,8 +8070,8 @@ var TestListModule = {
|
|
|
8422
8070
|
import { UncachedTestClient as UncachedTestClient3 } from "@uniformdev/context/api";
|
|
8423
8071
|
|
|
8424
8072
|
// src/commands/context/commands/test/_util.ts
|
|
8425
|
-
var
|
|
8426
|
-
var
|
|
8073
|
+
var selectIdentifier12 = (source) => source.id;
|
|
8074
|
+
var selectDisplayName12 = (source) => `${source.name} (pid: ${source.id})`;
|
|
8427
8075
|
|
|
8428
8076
|
// src/commands/context/testEngineDataSource.ts
|
|
8429
8077
|
function createTestEngineDataSource({
|
|
@@ -8433,8 +8081,8 @@ function createTestEngineDataSource({
|
|
|
8433
8081
|
const tests = (await client.get()).tests;
|
|
8434
8082
|
for await (const def of tests) {
|
|
8435
8083
|
const result = {
|
|
8436
|
-
id:
|
|
8437
|
-
displayName:
|
|
8084
|
+
id: selectIdentifier12(def),
|
|
8085
|
+
displayName: selectDisplayName12(def),
|
|
8438
8086
|
providerId: def.id,
|
|
8439
8087
|
object: def
|
|
8440
8088
|
};
|
|
@@ -8459,12 +8107,12 @@ function createTestEngineDataSource({
|
|
|
8459
8107
|
var TestPullModule = {
|
|
8460
8108
|
command: "pull <directory>",
|
|
8461
8109
|
describe: "Pulls all tests to local files in a directory",
|
|
8462
|
-
builder: (
|
|
8110
|
+
builder: (yargs35) => withConfiguration(
|
|
8463
8111
|
withDebugOptions(
|
|
8464
8112
|
withApiOptions(
|
|
8465
8113
|
withProjectOptions(
|
|
8466
8114
|
withDiffOptions(
|
|
8467
|
-
|
|
8115
|
+
yargs35.positional("directory", {
|
|
8468
8116
|
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.",
|
|
8469
8117
|
type: "string"
|
|
8470
8118
|
}).option("format", {
|
|
@@ -8508,8 +8156,8 @@ var TestPullModule = {
|
|
|
8508
8156
|
target = await createArraySyncEngineDataSource({
|
|
8509
8157
|
name: `Package file ${directory}`,
|
|
8510
8158
|
objects: packageContents.tests ?? [],
|
|
8511
|
-
selectIdentifier:
|
|
8512
|
-
selectDisplayName:
|
|
8159
|
+
selectIdentifier: selectIdentifier12,
|
|
8160
|
+
selectDisplayName: selectDisplayName12,
|
|
8513
8161
|
onSyncComplete: async (_, synced) => {
|
|
8514
8162
|
packageContents.tests = synced;
|
|
8515
8163
|
writeContextPackage(directory, packageContents);
|
|
@@ -8518,8 +8166,8 @@ var TestPullModule = {
|
|
|
8518
8166
|
} else {
|
|
8519
8167
|
target = await createFileSyncEngineDataSource({
|
|
8520
8168
|
directory,
|
|
8521
|
-
selectIdentifier:
|
|
8522
|
-
selectDisplayName:
|
|
8169
|
+
selectIdentifier: selectIdentifier12,
|
|
8170
|
+
selectDisplayName: selectDisplayName12,
|
|
8523
8171
|
format,
|
|
8524
8172
|
verbose
|
|
8525
8173
|
});
|
|
@@ -8540,12 +8188,12 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
8540
8188
|
var TestPushModule = {
|
|
8541
8189
|
command: "push <directory>",
|
|
8542
8190
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
8543
|
-
builder: (
|
|
8191
|
+
builder: (yargs35) => withConfiguration(
|
|
8544
8192
|
withDebugOptions(
|
|
8545
8193
|
withApiOptions(
|
|
8546
8194
|
withProjectOptions(
|
|
8547
8195
|
withDiffOptions(
|
|
8548
|
-
|
|
8196
|
+
yargs35.positional("directory", {
|
|
8549
8197
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
8550
8198
|
type: "string"
|
|
8551
8199
|
}).option("mode", {
|
|
@@ -8581,14 +8229,14 @@ var TestPushModule = {
|
|
|
8581
8229
|
source = await createArraySyncEngineDataSource({
|
|
8582
8230
|
name: `Package file ${directory}`,
|
|
8583
8231
|
objects: packageContents.tests ?? [],
|
|
8584
|
-
selectIdentifier:
|
|
8585
|
-
selectDisplayName:
|
|
8232
|
+
selectIdentifier: selectIdentifier12,
|
|
8233
|
+
selectDisplayName: selectDisplayName12
|
|
8586
8234
|
});
|
|
8587
8235
|
} else {
|
|
8588
8236
|
source = await createFileSyncEngineDataSource({
|
|
8589
8237
|
directory,
|
|
8590
|
-
selectIdentifier:
|
|
8591
|
-
selectDisplayName:
|
|
8238
|
+
selectIdentifier: selectIdentifier12,
|
|
8239
|
+
selectDisplayName: selectDisplayName12,
|
|
8592
8240
|
verbose
|
|
8593
8241
|
});
|
|
8594
8242
|
}
|
|
@@ -8610,10 +8258,10 @@ var TestRemoveModule = {
|
|
|
8610
8258
|
command: "remove <id>",
|
|
8611
8259
|
aliases: ["delete", "rm"],
|
|
8612
8260
|
describe: "Delete a test",
|
|
8613
|
-
builder: (
|
|
8261
|
+
builder: (yargs35) => withConfiguration(
|
|
8614
8262
|
withApiOptions(
|
|
8615
8263
|
withProjectOptions(
|
|
8616
|
-
|
|
8264
|
+
yargs35.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
8617
8265
|
)
|
|
8618
8266
|
)
|
|
8619
8267
|
),
|
|
@@ -8630,9 +8278,9 @@ var TestUpdateModule = {
|
|
|
8630
8278
|
command: "update <filename>",
|
|
8631
8279
|
aliases: ["put"],
|
|
8632
8280
|
describe: "Insert or update a test",
|
|
8633
|
-
builder: (
|
|
8281
|
+
builder: (yargs35) => withConfiguration(
|
|
8634
8282
|
withApiOptions(
|
|
8635
|
-
withProjectOptions(
|
|
8283
|
+
withProjectOptions(yargs35.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
8636
8284
|
)
|
|
8637
8285
|
),
|
|
8638
8286
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -8647,9 +8295,9 @@ var TestUpdateModule = {
|
|
|
8647
8295
|
var TestModule = {
|
|
8648
8296
|
command: "test <command>",
|
|
8649
8297
|
describe: "Commands for Context A/B tests",
|
|
8650
|
-
builder: (
|
|
8298
|
+
builder: (yargs35) => yargs35.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
8651
8299
|
handler: () => {
|
|
8652
|
-
|
|
8300
|
+
yargs23.help();
|
|
8653
8301
|
}
|
|
8654
8302
|
};
|
|
8655
8303
|
|
|
@@ -8658,29 +8306,29 @@ var ContextCommand = {
|
|
|
8658
8306
|
command: "context <command>",
|
|
8659
8307
|
aliases: ["ctx"],
|
|
8660
8308
|
describe: "Uniform Context commands",
|
|
8661
|
-
builder: (
|
|
8309
|
+
builder: (yargs35) => yargs35.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
8662
8310
|
handler: () => {
|
|
8663
|
-
|
|
8311
|
+
yargs24.showHelp();
|
|
8664
8312
|
}
|
|
8665
8313
|
};
|
|
8666
8314
|
|
|
8667
8315
|
// src/commands/integration/index.ts
|
|
8668
|
-
import
|
|
8316
|
+
import yargs27 from "yargs";
|
|
8669
8317
|
|
|
8670
8318
|
// src/commands/integration/commands/definition.ts
|
|
8671
|
-
import
|
|
8319
|
+
import yargs26 from "yargs";
|
|
8672
8320
|
|
|
8673
8321
|
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
8674
|
-
import
|
|
8322
|
+
import yargs25 from "yargs";
|
|
8675
8323
|
|
|
8676
8324
|
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
8677
8325
|
import { readFileSync } from "fs";
|
|
8678
8326
|
|
|
8679
8327
|
// src/commands/integration/commands/definition/edgehancer/EdgehancerClient.ts
|
|
8680
8328
|
import { createLimitPolicy as createLimitPolicy2 } from "@uniformdev/canvas";
|
|
8681
|
-
import { ApiClient
|
|
8329
|
+
import { ApiClient } from "@uniformdev/context/api";
|
|
8682
8330
|
var ENDPOINT = "/api/v1/integration-edgehancers";
|
|
8683
|
-
var EdgehancerClient = class extends
|
|
8331
|
+
var EdgehancerClient = class extends ApiClient {
|
|
8684
8332
|
constructor(options) {
|
|
8685
8333
|
if (!options.limitPolicy) {
|
|
8686
8334
|
options.limitPolicy = createLimitPolicy2({});
|
|
@@ -8709,8 +8357,8 @@ var EdgehancerClient = class extends ApiClient2 {
|
|
|
8709
8357
|
};
|
|
8710
8358
|
|
|
8711
8359
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
8712
|
-
function withEdgehancerIdOptions(
|
|
8713
|
-
return
|
|
8360
|
+
function withEdgehancerIdOptions(yargs35) {
|
|
8361
|
+
return yargs35.option("connectorType", {
|
|
8714
8362
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
8715
8363
|
demandOption: true,
|
|
8716
8364
|
type: "string"
|
|
@@ -8730,11 +8378,11 @@ function withEdgehancerIdOptions(yargs36) {
|
|
|
8730
8378
|
var IntegrationEdgehancerDeployModule = {
|
|
8731
8379
|
command: "deploy <filename>",
|
|
8732
8380
|
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.",
|
|
8733
|
-
builder: (
|
|
8381
|
+
builder: (yargs35) => withConfiguration(
|
|
8734
8382
|
withApiOptions(
|
|
8735
8383
|
withTeamOptions(
|
|
8736
8384
|
withEdgehancerIdOptions(
|
|
8737
|
-
|
|
8385
|
+
yargs35.positional("filename", {
|
|
8738
8386
|
demandOption: true,
|
|
8739
8387
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
8740
8388
|
}).option("compatibilityDate", {
|
|
@@ -8767,7 +8415,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
8767
8415
|
var IntegrationEdgehancerRemoveModule = {
|
|
8768
8416
|
command: "remove",
|
|
8769
8417
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
8770
|
-
builder: (
|
|
8418
|
+
builder: (yargs35) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs35)))),
|
|
8771
8419
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
8772
8420
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8773
8421
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -8779,17 +8427,17 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
8779
8427
|
var IntegrationEdgehancerModule = {
|
|
8780
8428
|
command: "edgehancer <command>",
|
|
8781
8429
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
8782
|
-
builder: (
|
|
8430
|
+
builder: (yargs35) => yargs35.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
8783
8431
|
handler: () => {
|
|
8784
|
-
|
|
8432
|
+
yargs25.help();
|
|
8785
8433
|
}
|
|
8786
8434
|
};
|
|
8787
8435
|
|
|
8788
8436
|
// src/commands/integration/commands/definition/DefinitionClient.ts
|
|
8789
8437
|
import { createLimitPolicy as createLimitPolicy3 } from "@uniformdev/canvas";
|
|
8790
|
-
import { ApiClient as
|
|
8438
|
+
import { ApiClient as ApiClient2 } from "@uniformdev/context/api";
|
|
8791
8439
|
var ENDPOINT2 = "/api/v1/integration-definitions";
|
|
8792
|
-
var DefinitionClient = class extends
|
|
8440
|
+
var DefinitionClient = class extends ApiClient2 {
|
|
8793
8441
|
constructor(options) {
|
|
8794
8442
|
if (!options.limitPolicy) {
|
|
8795
8443
|
options.limitPolicy = createLimitPolicy3({});
|
|
@@ -8821,10 +8469,10 @@ var DefinitionClient = class extends ApiClient3 {
|
|
|
8821
8469
|
var IntegrationDefinitionRegisterModule = {
|
|
8822
8470
|
command: "register <filename>",
|
|
8823
8471
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
8824
|
-
builder: (
|
|
8472
|
+
builder: (yargs35) => withConfiguration(
|
|
8825
8473
|
withApiOptions(
|
|
8826
8474
|
withTeamOptions(
|
|
8827
|
-
|
|
8475
|
+
yargs35.positional("filename", {
|
|
8828
8476
|
demandOption: true,
|
|
8829
8477
|
describe: "Integration definition manifest to register"
|
|
8830
8478
|
})
|
|
@@ -8843,10 +8491,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
8843
8491
|
var IntegrationDefinitionRemoveModule = {
|
|
8844
8492
|
command: "remove <type>",
|
|
8845
8493
|
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.",
|
|
8846
|
-
builder: (
|
|
8494
|
+
builder: (yargs35) => withConfiguration(
|
|
8847
8495
|
withApiOptions(
|
|
8848
8496
|
withTeamOptions(
|
|
8849
|
-
|
|
8497
|
+
yargs35.positional("type", {
|
|
8850
8498
|
demandOption: true,
|
|
8851
8499
|
describe: "Integration type (from its manifest) to remove."
|
|
8852
8500
|
})
|
|
@@ -8864,17 +8512,17 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
8864
8512
|
var IntegrationDefinitionModule = {
|
|
8865
8513
|
command: "definition <command>",
|
|
8866
8514
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
8867
|
-
builder: (
|
|
8515
|
+
builder: (yargs35) => yargs35.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).demandCommand(),
|
|
8868
8516
|
handler: () => {
|
|
8869
|
-
|
|
8517
|
+
yargs26.help();
|
|
8870
8518
|
}
|
|
8871
8519
|
};
|
|
8872
8520
|
|
|
8873
8521
|
// src/commands/integration/commands/InstallClient.ts
|
|
8874
8522
|
import { createLimitPolicy as createLimitPolicy4 } from "@uniformdev/canvas";
|
|
8875
|
-
import { ApiClient as
|
|
8523
|
+
import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
|
|
8876
8524
|
var ENDPOINT3 = "/api/v1/integration-installations";
|
|
8877
|
-
var InstallClient = class extends
|
|
8525
|
+
var InstallClient = class extends ApiClient3 {
|
|
8878
8526
|
constructor(options) {
|
|
8879
8527
|
if (!options.limitPolicy) {
|
|
8880
8528
|
options.limitPolicy = createLimitPolicy4({});
|
|
@@ -8906,10 +8554,10 @@ var InstallClient = class extends ApiClient4 {
|
|
|
8906
8554
|
var IntegrationInstallModule = {
|
|
8907
8555
|
command: "install <type>",
|
|
8908
8556
|
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.",
|
|
8909
|
-
builder: (
|
|
8557
|
+
builder: (yargs35) => withConfiguration(
|
|
8910
8558
|
withApiOptions(
|
|
8911
8559
|
withProjectOptions(
|
|
8912
|
-
|
|
8560
|
+
yargs35.positional("type", {
|
|
8913
8561
|
demandOption: true,
|
|
8914
8562
|
describe: "Integration type to install (as defined in its manifest)"
|
|
8915
8563
|
}).option("configuration", {
|
|
@@ -8931,10 +8579,10 @@ var IntegrationInstallModule = {
|
|
|
8931
8579
|
var IntegrationUninstallModule = {
|
|
8932
8580
|
command: "uninstall <type>",
|
|
8933
8581
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
8934
|
-
builder: (
|
|
8582
|
+
builder: (yargs35) => withConfiguration(
|
|
8935
8583
|
withApiOptions(
|
|
8936
8584
|
withProjectOptions(
|
|
8937
|
-
|
|
8585
|
+
yargs35.positional("type", {
|
|
8938
8586
|
demandOption: true,
|
|
8939
8587
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
8940
8588
|
})
|
|
@@ -8952,9 +8600,9 @@ var IntegrationUninstallModule = {
|
|
|
8952
8600
|
var IntegrationCommand = {
|
|
8953
8601
|
command: "integration <command>",
|
|
8954
8602
|
describe: "Integration management commands",
|
|
8955
|
-
builder: (
|
|
8603
|
+
builder: (yargs35) => yargs35.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
8956
8604
|
handler: () => {
|
|
8957
|
-
|
|
8605
|
+
yargs27.showHelp();
|
|
8958
8606
|
}
|
|
8959
8607
|
};
|
|
8960
8608
|
|
|
@@ -8982,7 +8630,7 @@ import { PostHog } from "posthog-node";
|
|
|
8982
8630
|
// package.json
|
|
8983
8631
|
var package_default = {
|
|
8984
8632
|
name: "@uniformdev/cli",
|
|
8985
|
-
version: "20.
|
|
8633
|
+
version: "20.30.1",
|
|
8986
8634
|
description: "Uniform command line interface tool",
|
|
8987
8635
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
8988
8636
|
main: "./cli.js",
|
|
@@ -9041,7 +8689,6 @@ var package_default = {
|
|
|
9041
8689
|
"registry-auth-token": "^5.0.0",
|
|
9042
8690
|
"registry-url": "^6.0.0",
|
|
9043
8691
|
slugify: "1.6.6",
|
|
9044
|
-
svix: "^1.71.0",
|
|
9045
8692
|
undici: "^6.20.1",
|
|
9046
8693
|
yargs: "^17.6.2",
|
|
9047
8694
|
zod: "3.23.8"
|
|
@@ -9160,7 +8807,7 @@ async function getBearerToken(baseUrl) {
|
|
|
9160
8807
|
}
|
|
9161
8808
|
|
|
9162
8809
|
// src/client.ts
|
|
9163
|
-
import { z
|
|
8810
|
+
import { z } from "zod";
|
|
9164
8811
|
|
|
9165
8812
|
// src/auth/api-key.ts
|
|
9166
8813
|
var READ_PERMISSIONS = ["PROJECT", "UPM_PUB", "OPT_PUB", "OPT_READ", "UPM_READ"];
|
|
@@ -9215,12 +8862,12 @@ var makeReadApiKey = (teamId, projectId) => makeApiKey(teamId, projectId, "Creat
|
|
|
9215
8862
|
var makeWriteApiKey = (teamId, projectId) => makeApiKey(teamId, projectId, "Created by Uniform New (write)", WRITE_PERMISSIONS);
|
|
9216
8863
|
|
|
9217
8864
|
// src/client.ts
|
|
9218
|
-
var createTeamOrProjectSchema =
|
|
9219
|
-
var createApiKeySchema =
|
|
9220
|
-
var getLimitsSchema =
|
|
9221
|
-
limits:
|
|
9222
|
-
projects:
|
|
9223
|
-
|
|
8865
|
+
var createTeamOrProjectSchema = z.object({ id: z.string().min(1) });
|
|
8866
|
+
var createApiKeySchema = z.object({ apiKey: z.string().min(1) });
|
|
8867
|
+
var getLimitsSchema = z.object({
|
|
8868
|
+
limits: z.object({
|
|
8869
|
+
projects: z.array(
|
|
8870
|
+
z.object({ id: z.string().min(1), name: z.string().min(1), used: z.number(), limit: z.number() })
|
|
9224
8871
|
)
|
|
9225
8872
|
})
|
|
9226
8873
|
});
|
|
@@ -9330,7 +8977,7 @@ var createClient = (baseUrl, authToken) => {
|
|
|
9330
8977
|
method: "PUT",
|
|
9331
8978
|
body: JSON.stringify({ teamId, data: manifest })
|
|
9332
8979
|
},
|
|
9333
|
-
|
|
8980
|
+
z.object({ type: z.string() })
|
|
9334
8981
|
);
|
|
9335
8982
|
return type;
|
|
9336
8983
|
} catch (err) {
|
|
@@ -9582,7 +9229,7 @@ async function chooseTeam(user, prompt, telemetry) {
|
|
|
9582
9229
|
|
|
9583
9230
|
// src/auth/user-info.ts
|
|
9584
9231
|
import { gql, request } from "graphql-request";
|
|
9585
|
-
import { z as
|
|
9232
|
+
import { z as z2 } from "zod";
|
|
9586
9233
|
var query = gql`
|
|
9587
9234
|
query GetUserInfo($subject: String!) {
|
|
9588
9235
|
info: identities_by_pk(subject: $subject) {
|
|
@@ -9601,19 +9248,19 @@ var query = gql`
|
|
|
9601
9248
|
}
|
|
9602
9249
|
}
|
|
9603
9250
|
`;
|
|
9604
|
-
var schema =
|
|
9605
|
-
info:
|
|
9606
|
-
name:
|
|
9607
|
-
email_address:
|
|
9608
|
-
teams:
|
|
9609
|
-
|
|
9610
|
-
team:
|
|
9611
|
-
name:
|
|
9612
|
-
id:
|
|
9613
|
-
sites:
|
|
9614
|
-
|
|
9615
|
-
name:
|
|
9616
|
-
id:
|
|
9251
|
+
var schema = z2.object({
|
|
9252
|
+
info: z2.object({
|
|
9253
|
+
name: z2.string().min(1),
|
|
9254
|
+
email_address: z2.string().min(1).nullable(),
|
|
9255
|
+
teams: z2.array(
|
|
9256
|
+
z2.object({
|
|
9257
|
+
team: z2.object({
|
|
9258
|
+
name: z2.string().min(1),
|
|
9259
|
+
id: z2.string().min(1),
|
|
9260
|
+
sites: z2.array(
|
|
9261
|
+
z2.object({
|
|
9262
|
+
name: z2.string().min(1),
|
|
9263
|
+
id: z2.string().min(1)
|
|
9617
9264
|
})
|
|
9618
9265
|
)
|
|
9619
9266
|
})
|
|
@@ -10015,15 +9662,15 @@ var NewMeshCmd = {
|
|
|
10015
9662
|
};
|
|
10016
9663
|
|
|
10017
9664
|
// src/commands/project-map/index.ts
|
|
10018
|
-
import
|
|
9665
|
+
import yargs30 from "yargs";
|
|
10019
9666
|
|
|
10020
9667
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
10021
|
-
import
|
|
9668
|
+
import yargs28 from "yargs";
|
|
10022
9669
|
|
|
10023
9670
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
10024
9671
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
10025
|
-
var
|
|
10026
|
-
var
|
|
9672
|
+
var selectIdentifier13 = (source) => source.id;
|
|
9673
|
+
var selectDisplayName13 = (source) => `${source.name} (pid: ${source.id})`;
|
|
10027
9674
|
function getProjectMapClient(options) {
|
|
10028
9675
|
return new UncachedProjectMapClient({ ...options, limitPolicy: cliLimitPolicy });
|
|
10029
9676
|
}
|
|
@@ -10032,11 +9679,11 @@ function getProjectMapClient(options) {
|
|
|
10032
9679
|
var ProjectMapDefinitionGetModule = {
|
|
10033
9680
|
command: "get <id>",
|
|
10034
9681
|
describe: "Fetch a project map",
|
|
10035
|
-
builder: (
|
|
9682
|
+
builder: (yargs35) => withFormatOptions(
|
|
10036
9683
|
withConfiguration(
|
|
10037
9684
|
withApiOptions(
|
|
10038
9685
|
withProjectOptions(
|
|
10039
|
-
|
|
9686
|
+
yargs35.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
10040
9687
|
)
|
|
10041
9688
|
)
|
|
10042
9689
|
)
|
|
@@ -10059,7 +9706,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
10059
9706
|
command: "list",
|
|
10060
9707
|
describe: "List of project maps",
|
|
10061
9708
|
aliases: ["ls"],
|
|
10062
|
-
builder: (
|
|
9709
|
+
builder: (yargs35) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs35)))),
|
|
10063
9710
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10064
9711
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10065
9712
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -10087,9 +9734,9 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
10087
9734
|
const projectMaps = (await client.getProjectMapDefinitions()).projectMaps;
|
|
10088
9735
|
for await (const def of projectMaps) {
|
|
10089
9736
|
const result = {
|
|
10090
|
-
id:
|
|
10091
|
-
displayName:
|
|
10092
|
-
providerId:
|
|
9737
|
+
id: selectIdentifier13(def),
|
|
9738
|
+
displayName: selectDisplayName13(def),
|
|
9739
|
+
providerId: selectIdentifier13(def),
|
|
10093
9740
|
object: def
|
|
10094
9741
|
};
|
|
10095
9742
|
yield result;
|
|
@@ -10113,12 +9760,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
10113
9760
|
var ProjectMapDefinitionPullModule = {
|
|
10114
9761
|
command: "pull <directory>",
|
|
10115
9762
|
describe: "Pulls all project maps to local files in a directory",
|
|
10116
|
-
builder: (
|
|
9763
|
+
builder: (yargs35) => withConfiguration(
|
|
10117
9764
|
withDebugOptions(
|
|
10118
9765
|
withApiOptions(
|
|
10119
9766
|
withProjectOptions(
|
|
10120
9767
|
withDiffOptions(
|
|
10121
|
-
|
|
9768
|
+
yargs35.positional("directory", {
|
|
10122
9769
|
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.",
|
|
10123
9770
|
type: "string"
|
|
10124
9771
|
}).option("format", {
|
|
@@ -10162,8 +9809,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
10162
9809
|
target = await createArraySyncEngineDataSource({
|
|
10163
9810
|
name: `Package file ${directory}`,
|
|
10164
9811
|
objects: packageContents.projectMaps ?? [],
|
|
10165
|
-
selectIdentifier:
|
|
10166
|
-
selectDisplayName:
|
|
9812
|
+
selectIdentifier: selectIdentifier13,
|
|
9813
|
+
selectDisplayName: selectDisplayName13,
|
|
10167
9814
|
onSyncComplete: async (_, synced) => {
|
|
10168
9815
|
packageContents.projectMaps = synced;
|
|
10169
9816
|
writeContextPackage2(directory, packageContents);
|
|
@@ -10172,8 +9819,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
10172
9819
|
} else {
|
|
10173
9820
|
target = await createFileSyncEngineDataSource({
|
|
10174
9821
|
directory,
|
|
10175
|
-
selectIdentifier:
|
|
10176
|
-
selectDisplayName:
|
|
9822
|
+
selectIdentifier: selectIdentifier13,
|
|
9823
|
+
selectDisplayName: selectDisplayName13,
|
|
10177
9824
|
format,
|
|
10178
9825
|
verbose
|
|
10179
9826
|
});
|
|
@@ -10193,12 +9840,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
10193
9840
|
var ProjectMapDefinitionPushModule = {
|
|
10194
9841
|
command: "push <directory>",
|
|
10195
9842
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
10196
|
-
builder: (
|
|
9843
|
+
builder: (yargs35) => withConfiguration(
|
|
10197
9844
|
withDebugOptions(
|
|
10198
9845
|
withApiOptions(
|
|
10199
9846
|
withProjectOptions(
|
|
10200
9847
|
withDiffOptions(
|
|
10201
|
-
|
|
9848
|
+
yargs35.positional("directory", {
|
|
10202
9849
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
10203
9850
|
type: "string"
|
|
10204
9851
|
}).option("mode", {
|
|
@@ -10234,14 +9881,14 @@ var ProjectMapDefinitionPushModule = {
|
|
|
10234
9881
|
source = await createArraySyncEngineDataSource({
|
|
10235
9882
|
name: `Package file ${directory}`,
|
|
10236
9883
|
objects: packageContents.projectMaps ?? [],
|
|
10237
|
-
selectIdentifier:
|
|
10238
|
-
selectDisplayName:
|
|
9884
|
+
selectIdentifier: selectIdentifier13,
|
|
9885
|
+
selectDisplayName: selectDisplayName13
|
|
10239
9886
|
});
|
|
10240
9887
|
} else {
|
|
10241
9888
|
source = await createFileSyncEngineDataSource({
|
|
10242
9889
|
directory,
|
|
10243
|
-
selectIdentifier:
|
|
10244
|
-
selectDisplayName:
|
|
9890
|
+
selectIdentifier: selectIdentifier13,
|
|
9891
|
+
selectDisplayName: selectDisplayName13,
|
|
10245
9892
|
verbose
|
|
10246
9893
|
});
|
|
10247
9894
|
}
|
|
@@ -10262,9 +9909,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
10262
9909
|
command: "remove <id>",
|
|
10263
9910
|
aliases: ["delete", "rm"],
|
|
10264
9911
|
describe: "Delete a project map",
|
|
10265
|
-
builder: (
|
|
9912
|
+
builder: (yargs35) => withConfiguration(
|
|
10266
9913
|
withApiOptions(
|
|
10267
|
-
withProjectOptions(
|
|
9914
|
+
withProjectOptions(yargs35.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
10268
9915
|
)
|
|
10269
9916
|
),
|
|
10270
9917
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -10279,10 +9926,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
10279
9926
|
command: "update <filename>",
|
|
10280
9927
|
aliases: ["put"],
|
|
10281
9928
|
describe: "Insert or update a project map",
|
|
10282
|
-
builder: (
|
|
9929
|
+
builder: (yargs35) => withConfiguration(
|
|
10283
9930
|
withApiOptions(
|
|
10284
9931
|
withProjectOptions(
|
|
10285
|
-
|
|
9932
|
+
yargs35.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
10286
9933
|
)
|
|
10287
9934
|
)
|
|
10288
9935
|
),
|
|
@@ -10298,24 +9945,24 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
10298
9945
|
var ProjectMapDefinitionModule = {
|
|
10299
9946
|
command: "definition <command>",
|
|
10300
9947
|
describe: "Commands for ProjectMap Definitions",
|
|
10301
|
-
builder: (
|
|
9948
|
+
builder: (yargs35) => yargs35.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
10302
9949
|
handler: () => {
|
|
10303
|
-
|
|
9950
|
+
yargs28.help();
|
|
10304
9951
|
}
|
|
10305
9952
|
};
|
|
10306
9953
|
|
|
10307
9954
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
10308
|
-
import
|
|
9955
|
+
import yargs29 from "yargs";
|
|
10309
9956
|
|
|
10310
9957
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
10311
9958
|
var ProjectMapNodeGetModule = {
|
|
10312
9959
|
command: "get <id> <projectMapId>",
|
|
10313
9960
|
describe: "Fetch a project map node",
|
|
10314
|
-
builder: (
|
|
9961
|
+
builder: (yargs35) => withConfiguration(
|
|
10315
9962
|
withFormatOptions(
|
|
10316
9963
|
withApiOptions(
|
|
10317
9964
|
withProjectOptions(
|
|
10318
|
-
|
|
9965
|
+
yargs35.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
10319
9966
|
)
|
|
10320
9967
|
)
|
|
10321
9968
|
)
|
|
@@ -10339,12 +9986,12 @@ var ProjectMapNodeListModule = {
|
|
|
10339
9986
|
command: "list <projectMapId>",
|
|
10340
9987
|
describe: "List project map nodes",
|
|
10341
9988
|
aliases: ["ls"],
|
|
10342
|
-
builder: (
|
|
9989
|
+
builder: (yargs35) => withConfiguration(
|
|
10343
9990
|
withFormatOptions(
|
|
10344
9991
|
withApiOptions(
|
|
10345
9992
|
withProjectOptions(
|
|
10346
9993
|
withStateOptions(
|
|
10347
|
-
|
|
9994
|
+
yargs35.positional("projectMapId", {
|
|
10348
9995
|
demandOption: true,
|
|
10349
9996
|
describe: "ProjectMap UUID to fetch from"
|
|
10350
9997
|
})
|
|
@@ -10362,12 +10009,12 @@ var ProjectMapNodeListModule = {
|
|
|
10362
10009
|
};
|
|
10363
10010
|
|
|
10364
10011
|
// src/commands/project-map/commands/ProjectMapNode/_util.ts
|
|
10365
|
-
var
|
|
10012
|
+
var selectIdentifier14 = (source, projectId) => [
|
|
10366
10013
|
projectId + source.projectMapId + source.id,
|
|
10367
10014
|
projectId + source.projectMapId + source.path
|
|
10368
10015
|
];
|
|
10369
10016
|
var selectFilename = (source) => cleanFileName(`${source.pathSegment}_${source.id}`);
|
|
10370
|
-
var
|
|
10017
|
+
var selectDisplayName14 = (source) => `${source.name} (pid: ${source.id})`;
|
|
10371
10018
|
|
|
10372
10019
|
// src/commands/project-map/ProjectMapNodeEngineDataSource.ts
|
|
10373
10020
|
function createProjectMapNodeEngineDataSource({
|
|
@@ -10381,9 +10028,9 @@ function createProjectMapNodeEngineDataSource({
|
|
|
10381
10028
|
for await (const node of nodes ?? []) {
|
|
10382
10029
|
if (node) {
|
|
10383
10030
|
const result = {
|
|
10384
|
-
id:
|
|
10385
|
-
displayName:
|
|
10386
|
-
providerId:
|
|
10031
|
+
id: selectIdentifier14({ ...node, projectMapId: projectMap.id }, projectId),
|
|
10032
|
+
displayName: selectDisplayName14(node),
|
|
10033
|
+
providerId: selectIdentifier14({ ...node, projectMapId: projectMap.id }, projectId)[0],
|
|
10387
10034
|
object: { ...node, projectMapId: projectMap.id }
|
|
10388
10035
|
};
|
|
10389
10036
|
yield result;
|
|
@@ -10422,12 +10069,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
10422
10069
|
var ProjectMapNodePullModule = {
|
|
10423
10070
|
command: "pull <directory>",
|
|
10424
10071
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
10425
|
-
builder: (
|
|
10072
|
+
builder: (yargs35) => withConfiguration(
|
|
10426
10073
|
withDebugOptions(
|
|
10427
10074
|
withApiOptions(
|
|
10428
10075
|
withProjectOptions(
|
|
10429
10076
|
withDiffOptions(
|
|
10430
|
-
|
|
10077
|
+
yargs35.positional("directory", {
|
|
10431
10078
|
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.",
|
|
10432
10079
|
type: "string"
|
|
10433
10080
|
}).option("format", {
|
|
@@ -10467,7 +10114,7 @@ var ProjectMapNodePullModule = {
|
|
|
10467
10114
|
let target;
|
|
10468
10115
|
const isPackage = isPathAPackageFile(directory);
|
|
10469
10116
|
const expandedSelectIdentifier = (object) => {
|
|
10470
|
-
return
|
|
10117
|
+
return selectIdentifier14(object, projectId);
|
|
10471
10118
|
};
|
|
10472
10119
|
if (isPackage) {
|
|
10473
10120
|
const packageContents = readContextPackage2(directory, false, verbose);
|
|
@@ -10475,7 +10122,7 @@ var ProjectMapNodePullModule = {
|
|
|
10475
10122
|
name: `Package file ${directory}`,
|
|
10476
10123
|
objects: packageContents.projectMapNodes ?? [],
|
|
10477
10124
|
selectIdentifier: expandedSelectIdentifier,
|
|
10478
|
-
selectDisplayName:
|
|
10125
|
+
selectDisplayName: selectDisplayName14,
|
|
10479
10126
|
onSyncComplete: async (_, synced) => {
|
|
10480
10127
|
packageContents.projectMapNodes = synced;
|
|
10481
10128
|
writeContextPackage2(directory, packageContents);
|
|
@@ -10485,7 +10132,7 @@ var ProjectMapNodePullModule = {
|
|
|
10485
10132
|
target = await createFileSyncEngineDataSource({
|
|
10486
10133
|
directory,
|
|
10487
10134
|
selectIdentifier: expandedSelectIdentifier,
|
|
10488
|
-
selectDisplayName:
|
|
10135
|
+
selectDisplayName: selectDisplayName14,
|
|
10489
10136
|
format,
|
|
10490
10137
|
selectFilename,
|
|
10491
10138
|
verbose
|
|
@@ -10509,12 +10156,12 @@ import {
|
|
|
10509
10156
|
var ProjectMapNodePushModule = {
|
|
10510
10157
|
command: "push <directory>",
|
|
10511
10158
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
10512
|
-
builder: (
|
|
10159
|
+
builder: (yargs35) => withConfiguration(
|
|
10513
10160
|
withDebugOptions(
|
|
10514
10161
|
withApiOptions(
|
|
10515
10162
|
withProjectOptions(
|
|
10516
10163
|
withDiffOptions(
|
|
10517
|
-
|
|
10164
|
+
yargs35.positional("directory", {
|
|
10518
10165
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
10519
10166
|
type: "string"
|
|
10520
10167
|
}).option("mode", {
|
|
@@ -10551,7 +10198,7 @@ var ProjectMapNodePushModule = {
|
|
|
10551
10198
|
let source;
|
|
10552
10199
|
const isPackage = isPathAPackageFile(directory);
|
|
10553
10200
|
const expandedSelectIdentifier = (object) => {
|
|
10554
|
-
return
|
|
10201
|
+
return selectIdentifier14(object, projectId);
|
|
10555
10202
|
};
|
|
10556
10203
|
if (isPackage) {
|
|
10557
10204
|
const packageContents = readContextPackage2(directory, true, verbose);
|
|
@@ -10561,13 +10208,13 @@ var ProjectMapNodePushModule = {
|
|
|
10561
10208
|
return a.path.length - b.path.length;
|
|
10562
10209
|
}) ?? [],
|
|
10563
10210
|
selectIdentifier: expandedSelectIdentifier,
|
|
10564
|
-
selectDisplayName:
|
|
10211
|
+
selectDisplayName: selectDisplayName14
|
|
10565
10212
|
});
|
|
10566
10213
|
} else {
|
|
10567
10214
|
source = await createFileSyncEngineDataSource({
|
|
10568
10215
|
directory,
|
|
10569
10216
|
selectIdentifier: expandedSelectIdentifier,
|
|
10570
|
-
selectDisplayName:
|
|
10217
|
+
selectDisplayName: selectDisplayName14,
|
|
10571
10218
|
selectFilename,
|
|
10572
10219
|
verbose
|
|
10573
10220
|
});
|
|
@@ -10599,7 +10246,7 @@ var ProjectMapNodePushModule = {
|
|
|
10599
10246
|
name: `Nodes re-push from ${directory}`,
|
|
10600
10247
|
objects: Array.from(nodesFailedDueToMissingParent),
|
|
10601
10248
|
selectIdentifier: expandedSelectIdentifier,
|
|
10602
|
-
selectDisplayName:
|
|
10249
|
+
selectDisplayName: selectDisplayName14
|
|
10603
10250
|
});
|
|
10604
10251
|
await attemptSync();
|
|
10605
10252
|
} else {
|
|
@@ -10616,10 +10263,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
10616
10263
|
command: "remove <id> <projectMapId>",
|
|
10617
10264
|
aliases: ["delete", "rm"],
|
|
10618
10265
|
describe: "Delete a project map node",
|
|
10619
|
-
builder: (
|
|
10266
|
+
builder: (yargs35) => withConfiguration(
|
|
10620
10267
|
withApiOptions(
|
|
10621
10268
|
withProjectOptions(
|
|
10622
|
-
|
|
10269
|
+
yargs35.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
10623
10270
|
)
|
|
10624
10271
|
)
|
|
10625
10272
|
),
|
|
@@ -10635,10 +10282,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
10635
10282
|
command: "update <filename> <projectMapId>",
|
|
10636
10283
|
aliases: ["put"],
|
|
10637
10284
|
describe: "Insert or update a project map node",
|
|
10638
|
-
builder: (
|
|
10285
|
+
builder: (yargs35) => withConfiguration(
|
|
10639
10286
|
withApiOptions(
|
|
10640
10287
|
withProjectOptions(
|
|
10641
|
-
|
|
10288
|
+
yargs35.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
10642
10289
|
)
|
|
10643
10290
|
)
|
|
10644
10291
|
),
|
|
@@ -10654,9 +10301,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
10654
10301
|
var ProjectMapNodeModule = {
|
|
10655
10302
|
command: "node <command>",
|
|
10656
10303
|
describe: "Commands for ProjectMap Nodes",
|
|
10657
|
-
builder: (
|
|
10304
|
+
builder: (yargs35) => yargs35.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
10658
10305
|
handler: () => {
|
|
10659
|
-
|
|
10306
|
+
yargs29.help();
|
|
10660
10307
|
}
|
|
10661
10308
|
};
|
|
10662
10309
|
|
|
@@ -10665,26 +10312,26 @@ var ProjectMapCommand = {
|
|
|
10665
10312
|
command: "project-map <command>",
|
|
10666
10313
|
aliases: ["prm"],
|
|
10667
10314
|
describe: "Uniform ProjectMap commands",
|
|
10668
|
-
builder: (
|
|
10315
|
+
builder: (yargs35) => yargs35.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
10669
10316
|
handler: () => {
|
|
10670
|
-
|
|
10317
|
+
yargs30.showHelp();
|
|
10671
10318
|
}
|
|
10672
10319
|
};
|
|
10673
10320
|
|
|
10674
10321
|
// src/commands/redirect/index.ts
|
|
10675
|
-
import
|
|
10322
|
+
import yargs32 from "yargs";
|
|
10676
10323
|
|
|
10677
10324
|
// src/commands/redirect/commands/redirect.ts
|
|
10678
|
-
import
|
|
10325
|
+
import yargs31 from "yargs";
|
|
10679
10326
|
|
|
10680
10327
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
10681
10328
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
10682
|
-
var
|
|
10329
|
+
var selectIdentifier15 = (source) => source.id;
|
|
10683
10330
|
var selectFilename2 = (source) => {
|
|
10684
10331
|
const index = source.sourceUrl.lastIndexOf("/");
|
|
10685
10332
|
return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
|
|
10686
10333
|
};
|
|
10687
|
-
var
|
|
10334
|
+
var selectDisplayName15 = (source) => {
|
|
10688
10335
|
let pathName = source.sourceUrl;
|
|
10689
10336
|
if (pathName.length > 30) {
|
|
10690
10337
|
const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
|
|
@@ -10700,11 +10347,11 @@ function getRedirectClient(options) {
|
|
|
10700
10347
|
var RedirectDefinitionGetModule = {
|
|
10701
10348
|
command: "get <id>",
|
|
10702
10349
|
describe: "Fetch a redirect",
|
|
10703
|
-
builder: (
|
|
10350
|
+
builder: (yargs35) => withConfiguration(
|
|
10704
10351
|
withFormatOptions(
|
|
10705
10352
|
withApiOptions(
|
|
10706
10353
|
withProjectOptions(
|
|
10707
|
-
|
|
10354
|
+
yargs35.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
10708
10355
|
)
|
|
10709
10356
|
)
|
|
10710
10357
|
)
|
|
@@ -10727,7 +10374,7 @@ var RedirectDefinitionListModule = {
|
|
|
10727
10374
|
command: "list",
|
|
10728
10375
|
describe: "List of redirects",
|
|
10729
10376
|
aliases: ["ls"],
|
|
10730
|
-
builder: (
|
|
10377
|
+
builder: (yargs35) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs35)))),
|
|
10731
10378
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10732
10379
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10733
10380
|
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -10755,9 +10402,9 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
10755
10402
|
const redirects = client.getAllRedirects();
|
|
10756
10403
|
for await (const redirect of redirects) {
|
|
10757
10404
|
const result = {
|
|
10758
|
-
id:
|
|
10759
|
-
displayName:
|
|
10760
|
-
providerId:
|
|
10405
|
+
id: selectIdentifier15(redirect.redirect),
|
|
10406
|
+
displayName: selectDisplayName15(redirect.redirect),
|
|
10407
|
+
providerId: selectIdentifier15(redirect.redirect),
|
|
10761
10408
|
object: redirect.redirect
|
|
10762
10409
|
};
|
|
10763
10410
|
yield result;
|
|
@@ -10779,12 +10426,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
10779
10426
|
var RedirectDefinitionPullModule = {
|
|
10780
10427
|
command: "pull <directory>",
|
|
10781
10428
|
describe: "Pulls all redirects to local files in a directory",
|
|
10782
|
-
builder: (
|
|
10429
|
+
builder: (yargs35) => withConfiguration(
|
|
10783
10430
|
withDebugOptions(
|
|
10784
10431
|
withApiOptions(
|
|
10785
10432
|
withProjectOptions(
|
|
10786
10433
|
withDiffOptions(
|
|
10787
|
-
|
|
10434
|
+
yargs35.positional("directory", {
|
|
10788
10435
|
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.",
|
|
10789
10436
|
type: "string"
|
|
10790
10437
|
}).option("format", {
|
|
@@ -10828,8 +10475,8 @@ var RedirectDefinitionPullModule = {
|
|
|
10828
10475
|
target = await createArraySyncEngineDataSource({
|
|
10829
10476
|
name: `Package file ${directory}`,
|
|
10830
10477
|
objects: packageContents.redirects ?? [],
|
|
10831
|
-
selectIdentifier:
|
|
10832
|
-
selectDisplayName:
|
|
10478
|
+
selectIdentifier: selectIdentifier15,
|
|
10479
|
+
selectDisplayName: selectDisplayName15,
|
|
10833
10480
|
onSyncComplete: async (_, synced) => {
|
|
10834
10481
|
packageContents.redirects = synced;
|
|
10835
10482
|
writeContextPackage3(directory, packageContents);
|
|
@@ -10839,8 +10486,8 @@ var RedirectDefinitionPullModule = {
|
|
|
10839
10486
|
target = await createFileSyncEngineDataSource({
|
|
10840
10487
|
directory,
|
|
10841
10488
|
selectFilename: selectFilename2,
|
|
10842
|
-
selectIdentifier:
|
|
10843
|
-
selectDisplayName:
|
|
10489
|
+
selectIdentifier: selectIdentifier15,
|
|
10490
|
+
selectDisplayName: selectDisplayName15,
|
|
10844
10491
|
format,
|
|
10845
10492
|
verbose
|
|
10846
10493
|
});
|
|
@@ -10860,12 +10507,12 @@ var RedirectDefinitionPullModule = {
|
|
|
10860
10507
|
var RedirectDefinitionPushModule = {
|
|
10861
10508
|
command: "push <directory>",
|
|
10862
10509
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
10863
|
-
builder: (
|
|
10510
|
+
builder: (yargs35) => withConfiguration(
|
|
10864
10511
|
withDebugOptions(
|
|
10865
10512
|
withApiOptions(
|
|
10866
10513
|
withProjectOptions(
|
|
10867
10514
|
withDiffOptions(
|
|
10868
|
-
|
|
10515
|
+
yargs35.positional("directory", {
|
|
10869
10516
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
10870
10517
|
type: "string"
|
|
10871
10518
|
}).option("mode", {
|
|
@@ -10901,14 +10548,14 @@ var RedirectDefinitionPushModule = {
|
|
|
10901
10548
|
source = await createArraySyncEngineDataSource({
|
|
10902
10549
|
name: `Package file ${directory}`,
|
|
10903
10550
|
objects: packageContents.redirects ?? [],
|
|
10904
|
-
selectIdentifier:
|
|
10905
|
-
selectDisplayName:
|
|
10551
|
+
selectIdentifier: selectIdentifier15,
|
|
10552
|
+
selectDisplayName: selectDisplayName15
|
|
10906
10553
|
});
|
|
10907
10554
|
} else {
|
|
10908
10555
|
source = await createFileSyncEngineDataSource({
|
|
10909
10556
|
directory,
|
|
10910
|
-
selectIdentifier:
|
|
10911
|
-
selectDisplayName:
|
|
10557
|
+
selectIdentifier: selectIdentifier15,
|
|
10558
|
+
selectDisplayName: selectDisplayName15,
|
|
10912
10559
|
verbose
|
|
10913
10560
|
});
|
|
10914
10561
|
}
|
|
@@ -10929,9 +10576,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
10929
10576
|
command: "remove <id>",
|
|
10930
10577
|
aliases: ["delete", "rm"],
|
|
10931
10578
|
describe: "Delete a redirect",
|
|
10932
|
-
builder: (
|
|
10579
|
+
builder: (yargs35) => withConfiguration(
|
|
10933
10580
|
withApiOptions(
|
|
10934
|
-
withProjectOptions(
|
|
10581
|
+
withProjectOptions(yargs35.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
10935
10582
|
)
|
|
10936
10583
|
),
|
|
10937
10584
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -10946,10 +10593,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
10946
10593
|
command: "update <filename>",
|
|
10947
10594
|
aliases: ["put"],
|
|
10948
10595
|
describe: "Insert or update a redirect",
|
|
10949
|
-
builder: (
|
|
10596
|
+
builder: (yargs35) => withConfiguration(
|
|
10950
10597
|
withApiOptions(
|
|
10951
10598
|
withProjectOptions(
|
|
10952
|
-
|
|
10599
|
+
yargs35.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
10953
10600
|
)
|
|
10954
10601
|
)
|
|
10955
10602
|
),
|
|
@@ -10965,9 +10612,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
10965
10612
|
var RedirectDefinitionModule = {
|
|
10966
10613
|
command: "definition <command>",
|
|
10967
10614
|
describe: "Commands for Redirect Definitions",
|
|
10968
|
-
builder: (
|
|
10615
|
+
builder: (yargs35) => yargs35.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
10969
10616
|
handler: () => {
|
|
10970
|
-
|
|
10617
|
+
yargs31.help();
|
|
10971
10618
|
}
|
|
10972
10619
|
};
|
|
10973
10620
|
|
|
@@ -10976,14 +10623,14 @@ var RedirectCommand = {
|
|
|
10976
10623
|
command: "redirect <command>",
|
|
10977
10624
|
aliases: ["red"],
|
|
10978
10625
|
describe: "Uniform Redirect commands",
|
|
10979
|
-
builder: (
|
|
10626
|
+
builder: (yargs35) => yargs35.command(RedirectDefinitionModule).demandCommand(),
|
|
10980
10627
|
handler: () => {
|
|
10981
|
-
|
|
10628
|
+
yargs32.showHelp();
|
|
10982
10629
|
}
|
|
10983
10630
|
};
|
|
10984
10631
|
|
|
10985
10632
|
// src/commands/sync/index.ts
|
|
10986
|
-
import
|
|
10633
|
+
import yargs33 from "yargs";
|
|
10987
10634
|
|
|
10988
10635
|
// src/commands/sync/commands/util.ts
|
|
10989
10636
|
import ora2 from "ora";
|
|
@@ -11099,7 +10746,7 @@ function numPad(num, spaces = 6) {
|
|
|
11099
10746
|
var SyncPullModule = {
|
|
11100
10747
|
command: "pull",
|
|
11101
10748
|
describe: "Pulls whole project to local files in a directory",
|
|
11102
|
-
builder: (
|
|
10749
|
+
builder: (yargs35) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs35))))),
|
|
11103
10750
|
handler: async ({ serialization, ...otherParams }) => {
|
|
11104
10751
|
const config2 = serialization;
|
|
11105
10752
|
const enabledEntities = Object.entries({
|
|
@@ -11125,8 +10772,7 @@ var SyncPullModule = {
|
|
|
11125
10772
|
entryPattern: EntryPatternPullModule,
|
|
11126
10773
|
contentType: ContentTypePullModule,
|
|
11127
10774
|
previewUrl: PreviewUrlPullModule,
|
|
11128
|
-
previewViewport: PreviewViewportPullModule
|
|
11129
|
-
webhook: WebhookPullModule
|
|
10775
|
+
previewViewport: PreviewViewportPullModule
|
|
11130
10776
|
}).filter(([entityType]) => {
|
|
11131
10777
|
return Boolean(config2.entitiesConfig?.[entityType]) && config2.entitiesConfig?.[entityType]?.disabled !== true && config2.entitiesConfig?.[entityType]?.pull?.disabled !== true;
|
|
11132
10778
|
});
|
|
@@ -11197,7 +10843,7 @@ var getFormat = (entityType, config2) => {
|
|
|
11197
10843
|
var SyncPushModule = {
|
|
11198
10844
|
command: "push",
|
|
11199
10845
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
11200
|
-
builder: (
|
|
10846
|
+
builder: (yargs35) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs35))))),
|
|
11201
10847
|
handler: async ({ serialization, ...otherParams }) => {
|
|
11202
10848
|
const config2 = serialization;
|
|
11203
10849
|
const enabledEntities = Object.entries({
|
|
@@ -11223,8 +10869,7 @@ var SyncPushModule = {
|
|
|
11223
10869
|
entry: EntryPushModule,
|
|
11224
10870
|
entryPattern: EntryPatternPushModule,
|
|
11225
10871
|
previewUrl: PreviewUrlPushModule,
|
|
11226
|
-
previewViewport: PreviewViewportPushModule
|
|
11227
|
-
webhook: WebhookPushModule
|
|
10872
|
+
previewViewport: PreviewViewportPushModule
|
|
11228
10873
|
}).filter(([entityType]) => {
|
|
11229
10874
|
return Boolean(config2.entitiesConfig?.[entityType]) && config2.entitiesConfig?.[entityType]?.disabled !== true && config2.entitiesConfig?.[entityType]?.push?.disabled !== true;
|
|
11230
10875
|
});
|
|
@@ -11406,9 +11051,9 @@ var getFormat2 = (entityType, config2) => {
|
|
|
11406
11051
|
var SyncCommand = {
|
|
11407
11052
|
command: "sync <command>",
|
|
11408
11053
|
describe: "Uniform Sync commands",
|
|
11409
|
-
builder: (
|
|
11054
|
+
builder: (yargs35) => yargs35.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
11410
11055
|
handler: () => {
|
|
11411
|
-
|
|
11056
|
+
yargs33.showHelp();
|
|
11412
11057
|
}
|
|
11413
11058
|
};
|
|
11414
11059
|
|
|
@@ -11660,7 +11305,7 @@ First found was: v${firstVersion}`;
|
|
|
11660
11305
|
|
|
11661
11306
|
// src/index.ts
|
|
11662
11307
|
dotenv.config();
|
|
11663
|
-
var yarggery =
|
|
11308
|
+
var yarggery = yargs34(hideBin(process.argv));
|
|
11664
11309
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
11665
11310
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
11666
11311
|
yarggery.option("verbose", {
|