@uniformdev/cli 19.80.1-alpha.170 → 19.80.1-alpha.200
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.d.mts +1 -1
- package/dist/index.mjs +506 -295
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -16,11 +16,11 @@ var __dirname = /* @__PURE__ */ getDirname();
|
|
|
16
16
|
|
|
17
17
|
// src/index.ts
|
|
18
18
|
import * as dotenv from "dotenv";
|
|
19
|
-
import
|
|
19
|
+
import yargs27 from "yargs";
|
|
20
20
|
import { hideBin } from "yargs/helpers";
|
|
21
21
|
|
|
22
22
|
// src/commands/canvas/index.ts
|
|
23
|
-
import
|
|
23
|
+
import yargs11 from "yargs";
|
|
24
24
|
|
|
25
25
|
// src/commands/canvas/commands/asset.ts
|
|
26
26
|
import yargs from "yargs";
|
|
@@ -137,14 +137,14 @@ import httpsProxyAgent from "https-proxy-agent";
|
|
|
137
137
|
import unfetch from "isomorphic-unfetch";
|
|
138
138
|
import { dump, load } from "js-yaml";
|
|
139
139
|
import { dirname, extname, isAbsolute, resolve, sep } from "path";
|
|
140
|
-
function withConfiguration(
|
|
141
|
-
return
|
|
140
|
+
function withConfiguration(yargs28) {
|
|
141
|
+
return yargs28.option("serialization", {
|
|
142
142
|
skipValidation: true,
|
|
143
143
|
hidden: true
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
function withApiOptions(
|
|
147
|
-
return
|
|
146
|
+
function withApiOptions(yargs28) {
|
|
147
|
+
return yargs28.option("apiKey", {
|
|
148
148
|
describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
|
|
149
149
|
default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
150
150
|
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
@@ -183,8 +183,8 @@ function nodeFetchProxy(proxy) {
|
|
|
183
183
|
};
|
|
184
184
|
return wrappedFetch;
|
|
185
185
|
}
|
|
186
|
-
function withProjectOptions(
|
|
187
|
-
return
|
|
186
|
+
function withProjectOptions(yargs28) {
|
|
187
|
+
return yargs28.option("project", {
|
|
188
188
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
189
189
|
default: process.env.UNIFORM_CLI_PROJECT_ID ?? // deprecated
|
|
190
190
|
process.env.CANVAS_CLI_PROJECT_ID ?? // deprecated
|
|
@@ -194,8 +194,8 @@ function withProjectOptions(yargs27) {
|
|
|
194
194
|
alias: ["p"]
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function withFormatOptions(
|
|
198
|
-
return
|
|
197
|
+
function withFormatOptions(yargs28) {
|
|
198
|
+
return yargs28.option("format", {
|
|
199
199
|
alias: ["f"],
|
|
200
200
|
describe: "Output format",
|
|
201
201
|
default: "yaml",
|
|
@@ -207,8 +207,8 @@ function withFormatOptions(yargs27) {
|
|
|
207
207
|
type: "string"
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
|
-
function withDiffOptions(
|
|
211
|
-
return
|
|
210
|
+
function withDiffOptions(yargs28) {
|
|
211
|
+
return yargs28.option("diff", {
|
|
212
212
|
describe: "Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",
|
|
213
213
|
default: process.env.UNIFORM_CLI_DIFF_MODE ?? "off",
|
|
214
214
|
type: "string",
|
|
@@ -632,12 +632,12 @@ function createPublishStatusSyncEngineConsoleLogger(options) {
|
|
|
632
632
|
var AssetGetModule = {
|
|
633
633
|
command: "get <id>",
|
|
634
634
|
describe: "Get an asset",
|
|
635
|
-
builder: (
|
|
635
|
+
builder: (yargs28) => withConfiguration(
|
|
636
636
|
withFormatOptions(
|
|
637
637
|
withApiOptions(
|
|
638
638
|
withProjectOptions(
|
|
639
639
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
640
|
-
|
|
640
|
+
yargs28.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
641
641
|
)
|
|
642
642
|
)
|
|
643
643
|
)
|
|
@@ -658,7 +658,7 @@ import { UncachedAssetClient as UncachedAssetClient2 } from "@uniformdev/assets"
|
|
|
658
658
|
var AssetListModule = {
|
|
659
659
|
command: "list",
|
|
660
660
|
describe: "List assets",
|
|
661
|
-
builder: (
|
|
661
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
662
662
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
663
663
|
const fetch3 = nodeFetchProxy(proxy);
|
|
664
664
|
const client = new UncachedAssetClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -810,7 +810,9 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
810
810
|
options.fileClient.get({ sourceId: hash }).catch(() => null),
|
|
811
811
|
options.fileClient.get({ sourceId: legacyHash }).catch(() => null)
|
|
812
812
|
]);
|
|
813
|
-
|
|
813
|
+
const file = fileAlreadyExistsChecks.find((check) => check !== null);
|
|
814
|
+
if (file) {
|
|
815
|
+
objectAsString = objectAsString.replaceAll(`"${url}"`, `"${file.url}"`);
|
|
814
816
|
return;
|
|
815
817
|
}
|
|
816
818
|
const localFileName = urlToFileName(url);
|
|
@@ -829,7 +831,7 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
829
831
|
}
|
|
830
832
|
const fileBuffer = await fsj.readAsync(expectedFilePath, "buffer");
|
|
831
833
|
if (!fileBuffer) {
|
|
832
|
-
console.warn(`Skipping file ${url} as we couldn't read it`);
|
|
834
|
+
console.warn(`Skipping file ${url} (${expectedFilePath}) as we couldn't read it`);
|
|
833
835
|
return;
|
|
834
836
|
}
|
|
835
837
|
const fileName = getFileNameFromUrl(url);
|
|
@@ -861,19 +863,19 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
861
863
|
}
|
|
862
864
|
});
|
|
863
865
|
if (!uploadResponse.ok) {
|
|
864
|
-
console.warn(`Failed to upload file ${url}`);
|
|
866
|
+
console.warn(`Failed to upload file ${url} (${expectedFilePath})`);
|
|
865
867
|
return;
|
|
866
868
|
}
|
|
867
869
|
const checkForFile = async () => {
|
|
868
|
-
const
|
|
869
|
-
if (!
|
|
870
|
+
const file2 = await options.fileClient.get({ id });
|
|
871
|
+
if (!file2 || file2.state !== FILE_READY_STATE || !file2.url) {
|
|
870
872
|
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
871
873
|
return checkForFile();
|
|
872
874
|
}
|
|
873
|
-
return
|
|
875
|
+
return file2.url;
|
|
874
876
|
};
|
|
875
877
|
const abortTimeout = setTimeout(() => {
|
|
876
|
-
throw new Error(`Failed to upload file ${url} (upload timed out
|
|
878
|
+
throw new Error(`Failed to upload file ${url} (${expectedFilePath}) - upload timed out`);
|
|
877
879
|
}, 3e4);
|
|
878
880
|
const uploadedFileUrl = await checkForFile();
|
|
879
881
|
clearTimeout(abortTimeout);
|
|
@@ -1008,8 +1010,8 @@ function prepCompositionForDisk(composition) {
|
|
|
1008
1010
|
delete prepped.state;
|
|
1009
1011
|
return prepped;
|
|
1010
1012
|
}
|
|
1011
|
-
function withStateOptions(
|
|
1012
|
-
return
|
|
1013
|
+
function withStateOptions(yargs28) {
|
|
1014
|
+
return yargs28.option("state", {
|
|
1013
1015
|
type: "string",
|
|
1014
1016
|
describe: `Composition state to fetch.`,
|
|
1015
1017
|
choices: ["preview", "published"],
|
|
@@ -1075,11 +1077,11 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
1075
1077
|
var AssetPullModule = {
|
|
1076
1078
|
command: "pull <directory>",
|
|
1077
1079
|
describe: "Pulls all assets to local files in a directory",
|
|
1078
|
-
builder: (
|
|
1080
|
+
builder: (yargs28) => withConfiguration(
|
|
1079
1081
|
withApiOptions(
|
|
1080
1082
|
withProjectOptions(
|
|
1081
1083
|
withDiffOptions(
|
|
1082
|
-
|
|
1084
|
+
yargs28.positional("directory", {
|
|
1083
1085
|
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.",
|
|
1084
1086
|
type: "string"
|
|
1085
1087
|
}).option("format", {
|
|
@@ -1197,11 +1199,11 @@ import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
|
|
|
1197
1199
|
var AssetPushModule = {
|
|
1198
1200
|
command: "push <directory>",
|
|
1199
1201
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
1200
|
-
builder: (
|
|
1202
|
+
builder: (yargs28) => withConfiguration(
|
|
1201
1203
|
withApiOptions(
|
|
1202
1204
|
withProjectOptions(
|
|
1203
1205
|
withDiffOptions(
|
|
1204
|
-
|
|
1206
|
+
yargs28.positional("directory", {
|
|
1205
1207
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
1206
1208
|
type: "string"
|
|
1207
1209
|
}).option("what-if", {
|
|
@@ -1277,15 +1279,10 @@ var AssetPushModule = {
|
|
|
1277
1279
|
return sourceObjectWithNewFileUrls;
|
|
1278
1280
|
},
|
|
1279
1281
|
onBeforeWriteObject: async (sourceObject) => {
|
|
1280
|
-
const sourceObjectWithNewFileUrls = await
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}),
|
|
1285
|
-
{
|
|
1286
|
-
fileClient
|
|
1287
|
-
}
|
|
1288
|
-
);
|
|
1282
|
+
const sourceObjectWithNewFileUrls = await extractAndUploadUniformFilesForObject(sourceObject, {
|
|
1283
|
+
directory,
|
|
1284
|
+
fileClient
|
|
1285
|
+
});
|
|
1289
1286
|
sourceObjectWithNewFileUrls.object = await updateAssetFileIdBasedOnUrl(
|
|
1290
1287
|
sourceObjectWithNewFileUrls.object,
|
|
1291
1288
|
{
|
|
@@ -1304,9 +1301,9 @@ var AssetRemoveModule = {
|
|
|
1304
1301
|
command: "remove <id>",
|
|
1305
1302
|
aliases: ["delete", "rm"],
|
|
1306
1303
|
describe: "Delete an asset",
|
|
1307
|
-
builder: (
|
|
1304
|
+
builder: (yargs28) => withConfiguration(
|
|
1308
1305
|
withApiOptions(
|
|
1309
|
-
withProjectOptions(
|
|
1306
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
1310
1307
|
)
|
|
1311
1308
|
),
|
|
1312
1309
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -1322,10 +1319,10 @@ var AssetUpdateModule = {
|
|
|
1322
1319
|
command: "update <filename>",
|
|
1323
1320
|
aliases: ["put"],
|
|
1324
1321
|
describe: "Insert or update an asset",
|
|
1325
|
-
builder: (
|
|
1322
|
+
builder: (yargs28) => withConfiguration(
|
|
1326
1323
|
withApiOptions(
|
|
1327
1324
|
withProjectOptions(
|
|
1328
|
-
|
|
1325
|
+
yargs28.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
1329
1326
|
)
|
|
1330
1327
|
)
|
|
1331
1328
|
),
|
|
@@ -1341,7 +1338,7 @@ var AssetUpdateModule = {
|
|
|
1341
1338
|
var AssetModule = {
|
|
1342
1339
|
command: "asset <command>",
|
|
1343
1340
|
describe: "Commands for Assets",
|
|
1344
|
-
builder: (
|
|
1341
|
+
builder: (yargs28) => yargs28.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
1345
1342
|
handler: () => {
|
|
1346
1343
|
yargs.help();
|
|
1347
1344
|
}
|
|
@@ -1355,11 +1352,11 @@ import { UncachedCategoryClient } from "@uniformdev/canvas";
|
|
|
1355
1352
|
var CategoryGetModule = {
|
|
1356
1353
|
command: "get <id>",
|
|
1357
1354
|
describe: "Fetch a category",
|
|
1358
|
-
builder: (
|
|
1355
|
+
builder: (yargs28) => withConfiguration(
|
|
1359
1356
|
withFormatOptions(
|
|
1360
1357
|
withApiOptions(
|
|
1361
1358
|
withProjectOptions(
|
|
1362
|
-
|
|
1359
|
+
yargs28.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
1363
1360
|
)
|
|
1364
1361
|
)
|
|
1365
1362
|
)
|
|
@@ -1384,7 +1381,7 @@ var CategoryListModule = {
|
|
|
1384
1381
|
command: "list",
|
|
1385
1382
|
describe: "List categories",
|
|
1386
1383
|
aliases: ["ls"],
|
|
1387
|
-
builder: (
|
|
1384
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28.options({}))))),
|
|
1388
1385
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
1389
1386
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1390
1387
|
const client = new UncachedCategoryClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -1433,11 +1430,11 @@ function createCategoriesEngineDataSource({
|
|
|
1433
1430
|
var CategoryPullModule = {
|
|
1434
1431
|
command: "pull <directory>",
|
|
1435
1432
|
describe: "Pulls all categories to local files in a directory",
|
|
1436
|
-
builder: (
|
|
1433
|
+
builder: (yargs28) => withConfiguration(
|
|
1437
1434
|
withApiOptions(
|
|
1438
1435
|
withProjectOptions(
|
|
1439
1436
|
withDiffOptions(
|
|
1440
|
-
|
|
1437
|
+
yargs28.positional("directory", {
|
|
1441
1438
|
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.",
|
|
1442
1439
|
type: "string"
|
|
1443
1440
|
}).option("format", {
|
|
@@ -1513,11 +1510,11 @@ import { UncachedCategoryClient as UncachedCategoryClient4 } from "@uniformdev/c
|
|
|
1513
1510
|
var CategoryPushModule = {
|
|
1514
1511
|
command: "push <directory>",
|
|
1515
1512
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
1516
|
-
builder: (
|
|
1513
|
+
builder: (yargs28) => withConfiguration(
|
|
1517
1514
|
withApiOptions(
|
|
1518
1515
|
withProjectOptions(
|
|
1519
1516
|
withDiffOptions(
|
|
1520
|
-
|
|
1517
|
+
yargs28.positional("directory", {
|
|
1521
1518
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
1522
1519
|
type: "string"
|
|
1523
1520
|
}).option("what-if", {
|
|
@@ -1581,10 +1578,10 @@ var CategoryRemoveModule = {
|
|
|
1581
1578
|
command: "remove <id>",
|
|
1582
1579
|
aliases: ["delete", "rm"],
|
|
1583
1580
|
describe: "Delete a category",
|
|
1584
|
-
builder: (
|
|
1581
|
+
builder: (yargs28) => withConfiguration(
|
|
1585
1582
|
withApiOptions(
|
|
1586
1583
|
withProjectOptions(
|
|
1587
|
-
|
|
1584
|
+
yargs28.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
1588
1585
|
)
|
|
1589
1586
|
)
|
|
1590
1587
|
),
|
|
@@ -1601,10 +1598,10 @@ var CategoryUpdateModule = {
|
|
|
1601
1598
|
command: "update <filename>",
|
|
1602
1599
|
aliases: ["put"],
|
|
1603
1600
|
describe: "Insert or update a category",
|
|
1604
|
-
builder: (
|
|
1601
|
+
builder: (yargs28) => withConfiguration(
|
|
1605
1602
|
withApiOptions(
|
|
1606
1603
|
withProjectOptions(
|
|
1607
|
-
|
|
1604
|
+
yargs28.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
1608
1605
|
)
|
|
1609
1606
|
)
|
|
1610
1607
|
),
|
|
@@ -1621,7 +1618,7 @@ var CategoryModule = {
|
|
|
1621
1618
|
command: "category <command>",
|
|
1622
1619
|
aliases: ["cat"],
|
|
1623
1620
|
describe: "Commands for Canvas categories",
|
|
1624
|
-
builder: (
|
|
1621
|
+
builder: (yargs28) => yargs28.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
1625
1622
|
handler: () => {
|
|
1626
1623
|
yargs2.help();
|
|
1627
1624
|
}
|
|
@@ -1642,11 +1639,11 @@ var selectSchemaUrl = () => "/schemas/json-schema/component-definition/v1.json";
|
|
|
1642
1639
|
var ComponentGetModule = {
|
|
1643
1640
|
command: "get <id>",
|
|
1644
1641
|
describe: "Fetch a component definition",
|
|
1645
|
-
builder: (
|
|
1642
|
+
builder: (yargs28) => withConfiguration(
|
|
1646
1643
|
withFormatOptions(
|
|
1647
1644
|
withApiOptions(
|
|
1648
1645
|
withProjectOptions(
|
|
1649
|
-
|
|
1646
|
+
yargs28.positional("id", {
|
|
1650
1647
|
demandOption: true,
|
|
1651
1648
|
describe: "Component definition public ID to fetch"
|
|
1652
1649
|
})
|
|
@@ -1680,11 +1677,11 @@ var ComponentListModule = {
|
|
|
1680
1677
|
command: "list",
|
|
1681
1678
|
describe: "List component definitions",
|
|
1682
1679
|
aliases: ["ls"],
|
|
1683
|
-
builder: (
|
|
1680
|
+
builder: (yargs28) => withConfiguration(
|
|
1684
1681
|
withFormatOptions(
|
|
1685
1682
|
withApiOptions(
|
|
1686
1683
|
withProjectOptions(
|
|
1687
|
-
|
|
1684
|
+
yargs28.options({
|
|
1688
1685
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
1689
1686
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
1690
1687
|
})
|
|
@@ -1739,11 +1736,11 @@ function createComponentDefinitionEngineDataSource({
|
|
|
1739
1736
|
var ComponentPullModule = {
|
|
1740
1737
|
command: "pull <directory>",
|
|
1741
1738
|
describe: "Pulls all component definitions to local files in a directory",
|
|
1742
|
-
builder: (
|
|
1739
|
+
builder: (yargs28) => withConfiguration(
|
|
1743
1740
|
withApiOptions(
|
|
1744
1741
|
withProjectOptions(
|
|
1745
1742
|
withDiffOptions(
|
|
1746
|
-
|
|
1743
|
+
yargs28.positional("directory", {
|
|
1747
1744
|
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.",
|
|
1748
1745
|
type: "string"
|
|
1749
1746
|
}).option("format", {
|
|
@@ -1820,11 +1817,11 @@ import { UncachedCanvasClient as UncachedCanvasClient4 } from "@uniformdev/canva
|
|
|
1820
1817
|
var ComponentPushModule = {
|
|
1821
1818
|
command: "push <directory>",
|
|
1822
1819
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
1823
|
-
builder: (
|
|
1820
|
+
builder: (yargs28) => withConfiguration(
|
|
1824
1821
|
withApiOptions(
|
|
1825
1822
|
withProjectOptions(
|
|
1826
1823
|
withDiffOptions(
|
|
1827
|
-
|
|
1824
|
+
yargs28.positional("directory", {
|
|
1828
1825
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
1829
1826
|
type: "string"
|
|
1830
1827
|
}).option("what-if", {
|
|
@@ -1889,10 +1886,10 @@ var ComponentRemoveModule = {
|
|
|
1889
1886
|
command: "remove <id>",
|
|
1890
1887
|
aliases: ["delete", "rm"],
|
|
1891
1888
|
describe: "Delete a component definition",
|
|
1892
|
-
builder: (
|
|
1889
|
+
builder: (yargs28) => withConfiguration(
|
|
1893
1890
|
withApiOptions(
|
|
1894
1891
|
withProjectOptions(
|
|
1895
|
-
|
|
1892
|
+
yargs28.positional("id", { demandOption: true, describe: "Component definition public ID to delete" })
|
|
1896
1893
|
)
|
|
1897
1894
|
)
|
|
1898
1895
|
),
|
|
@@ -1909,10 +1906,10 @@ var ComponentUpdateModule = {
|
|
|
1909
1906
|
command: "update <filename>",
|
|
1910
1907
|
aliases: ["put"],
|
|
1911
1908
|
describe: "Insert or update a component definition",
|
|
1912
|
-
builder: (
|
|
1909
|
+
builder: (yargs28) => withConfiguration(
|
|
1913
1910
|
withApiOptions(
|
|
1914
1911
|
withProjectOptions(
|
|
1915
|
-
|
|
1912
|
+
yargs28.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
1916
1913
|
)
|
|
1917
1914
|
)
|
|
1918
1915
|
),
|
|
@@ -1929,7 +1926,7 @@ var ComponentModule = {
|
|
|
1929
1926
|
command: "component <command>",
|
|
1930
1927
|
aliases: ["def"],
|
|
1931
1928
|
describe: "Commands for Canvas component definitions",
|
|
1932
|
-
builder: (
|
|
1929
|
+
builder: (yargs28) => yargs28.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
1933
1930
|
handler: () => {
|
|
1934
1931
|
yargs3.help();
|
|
1935
1932
|
}
|
|
@@ -1943,12 +1940,12 @@ import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canva
|
|
|
1943
1940
|
var CompositionGetModule = {
|
|
1944
1941
|
command: "get <id>",
|
|
1945
1942
|
describe: "Fetch a composition",
|
|
1946
|
-
builder: (
|
|
1943
|
+
builder: (yargs28) => withFormatOptions(
|
|
1947
1944
|
withConfiguration(
|
|
1948
1945
|
withApiOptions(
|
|
1949
1946
|
withProjectOptions(
|
|
1950
1947
|
withStateOptions(
|
|
1951
|
-
|
|
1948
|
+
yargs28.positional("id", { demandOption: true, describe: "Composition/pattern public ID to fetch" }).option({
|
|
1952
1949
|
resolvePatterns: {
|
|
1953
1950
|
type: "boolean",
|
|
1954
1951
|
default: false,
|
|
@@ -2019,12 +2016,12 @@ var CompositionListModule = {
|
|
|
2019
2016
|
command: "list",
|
|
2020
2017
|
describe: "List compositions",
|
|
2021
2018
|
aliases: ["ls"],
|
|
2022
|
-
builder: (
|
|
2019
|
+
builder: (yargs28) => withFormatOptions(
|
|
2023
2020
|
withConfiguration(
|
|
2024
2021
|
withApiOptions(
|
|
2025
2022
|
withProjectOptions(
|
|
2026
2023
|
withStateOptions(
|
|
2027
|
-
|
|
2024
|
+
yargs28.options({
|
|
2028
2025
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
2029
2026
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
2030
2027
|
resolvePatterns: {
|
|
@@ -2145,11 +2142,11 @@ function createComponentInstanceEngineDataSource({
|
|
|
2145
2142
|
var CompositionPublishModule = {
|
|
2146
2143
|
command: "publish [ids]",
|
|
2147
2144
|
describe: "Publishes composition(s)",
|
|
2148
|
-
builder: (
|
|
2145
|
+
builder: (yargs28) => withConfiguration(
|
|
2149
2146
|
withApiOptions(
|
|
2150
2147
|
withProjectOptions(
|
|
2151
2148
|
withDiffOptions(
|
|
2152
|
-
|
|
2149
|
+
yargs28.positional("ids", {
|
|
2153
2150
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
2154
2151
|
type: "string"
|
|
2155
2152
|
}).option("all", {
|
|
@@ -2225,12 +2222,12 @@ import { UncachedFileClient as UncachedFileClient3 } from "@uniformdev/files";
|
|
|
2225
2222
|
var CompositionPullModule = {
|
|
2226
2223
|
command: "pull <directory>",
|
|
2227
2224
|
describe: "Pulls all compositions to local files in a directory",
|
|
2228
|
-
builder: (
|
|
2225
|
+
builder: (yargs28) => withConfiguration(
|
|
2229
2226
|
withApiOptions(
|
|
2230
2227
|
withProjectOptions(
|
|
2231
2228
|
withStateOptions(
|
|
2232
2229
|
withDiffOptions(
|
|
2233
|
-
|
|
2230
|
+
yargs28.positional("directory", {
|
|
2234
2231
|
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.",
|
|
2235
2232
|
type: "string"
|
|
2236
2233
|
}).option("format", {
|
|
@@ -2333,12 +2330,12 @@ import { UncachedFileClient as UncachedFileClient4 } from "@uniformdev/files";
|
|
|
2333
2330
|
var CompositionPushModule = {
|
|
2334
2331
|
command: "push <directory>",
|
|
2335
2332
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
2336
|
-
builder: (
|
|
2333
|
+
builder: (yargs28) => withConfiguration(
|
|
2337
2334
|
withApiOptions(
|
|
2338
2335
|
withProjectOptions(
|
|
2339
2336
|
withStateOptions(
|
|
2340
2337
|
withDiffOptions(
|
|
2341
|
-
|
|
2338
|
+
yargs28.positional("directory", {
|
|
2342
2339
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
2343
2340
|
type: "string"
|
|
2344
2341
|
}).option("what-if", {
|
|
@@ -2427,10 +2424,10 @@ var CompositionRemoveModule = {
|
|
|
2427
2424
|
command: "remove <id>",
|
|
2428
2425
|
aliases: ["delete", "rm"],
|
|
2429
2426
|
describe: "Delete a composition",
|
|
2430
|
-
builder: (
|
|
2427
|
+
builder: (yargs28) => withConfiguration(
|
|
2431
2428
|
withApiOptions(
|
|
2432
2429
|
withProjectOptions(
|
|
2433
|
-
|
|
2430
|
+
yargs28.positional("id", { demandOption: true, describe: "Composition/pattern public ID to delete" })
|
|
2434
2431
|
)
|
|
2435
2432
|
)
|
|
2436
2433
|
),
|
|
@@ -2447,10 +2444,10 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
2447
2444
|
var CompositionUnpublishModule = {
|
|
2448
2445
|
command: "unpublish [ids]",
|
|
2449
2446
|
describe: "Unpublish a composition(s)",
|
|
2450
|
-
builder: (
|
|
2447
|
+
builder: (yargs28) => withConfiguration(
|
|
2451
2448
|
withApiOptions(
|
|
2452
2449
|
withProjectOptions(
|
|
2453
|
-
|
|
2450
|
+
yargs28.positional("ids", {
|
|
2454
2451
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
2455
2452
|
type: "string"
|
|
2456
2453
|
}).option("all", {
|
|
@@ -2544,11 +2541,11 @@ var CompositionUpdateModule = {
|
|
|
2544
2541
|
command: "update <filename>",
|
|
2545
2542
|
aliases: ["put"],
|
|
2546
2543
|
describe: "Insert or update a composition",
|
|
2547
|
-
builder: (
|
|
2544
|
+
builder: (yargs28) => withConfiguration(
|
|
2548
2545
|
withApiOptions(
|
|
2549
2546
|
withProjectOptions(
|
|
2550
2547
|
withStateOptions(
|
|
2551
|
-
|
|
2548
|
+
yargs28.positional("filename", { demandOption: true, describe: "Composition/pattern file to put" })
|
|
2552
2549
|
)
|
|
2553
2550
|
)
|
|
2554
2551
|
)
|
|
@@ -2566,7 +2563,7 @@ var CompositionModule = {
|
|
|
2566
2563
|
command: "composition <command>",
|
|
2567
2564
|
describe: "Commands for Canvas compositions",
|
|
2568
2565
|
aliases: ["comp"],
|
|
2569
|
-
builder: (
|
|
2566
|
+
builder: (yargs28) => yargs28.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
2570
2567
|
handler: () => {
|
|
2571
2568
|
yargs4.help();
|
|
2572
2569
|
}
|
|
@@ -2580,12 +2577,12 @@ import { ContentClient } from "@uniformdev/canvas";
|
|
|
2580
2577
|
var ContentTypeGetModule = {
|
|
2581
2578
|
command: "get <id>",
|
|
2582
2579
|
describe: "Get a content type",
|
|
2583
|
-
builder: (
|
|
2580
|
+
builder: (yargs28) => withConfiguration(
|
|
2584
2581
|
withFormatOptions(
|
|
2585
2582
|
withApiOptions(
|
|
2586
2583
|
withProjectOptions(
|
|
2587
2584
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2588
|
-
|
|
2585
|
+
yargs28.positional("id", { demandOption: true, describe: "Content type public ID to fetch" })
|
|
2589
2586
|
)
|
|
2590
2587
|
)
|
|
2591
2588
|
)
|
|
@@ -2607,7 +2604,7 @@ import { ContentClient as ContentClient2 } from "@uniformdev/canvas";
|
|
|
2607
2604
|
var ContentTypeListModule = {
|
|
2608
2605
|
command: "list",
|
|
2609
2606
|
describe: "List content types",
|
|
2610
|
-
builder: (
|
|
2607
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
2611
2608
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2612
2609
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2613
2610
|
const client = new ContentClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -2654,11 +2651,11 @@ function createContentTypeEngineDataSource({
|
|
|
2654
2651
|
var ContentTypePullModule = {
|
|
2655
2652
|
command: "pull <directory>",
|
|
2656
2653
|
describe: "Pulls all content types to local files in a directory",
|
|
2657
|
-
builder: (
|
|
2654
|
+
builder: (yargs28) => withConfiguration(
|
|
2658
2655
|
withApiOptions(
|
|
2659
2656
|
withProjectOptions(
|
|
2660
2657
|
withDiffOptions(
|
|
2661
|
-
|
|
2658
|
+
yargs28.positional("directory", {
|
|
2662
2659
|
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.",
|
|
2663
2660
|
type: "string"
|
|
2664
2661
|
}).option("format", {
|
|
@@ -2740,11 +2737,11 @@ import { ContentClient as ContentClient4 } from "@uniformdev/canvas";
|
|
|
2740
2737
|
var ContentTypePushModule = {
|
|
2741
2738
|
command: "push <directory>",
|
|
2742
2739
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
2743
|
-
builder: (
|
|
2740
|
+
builder: (yargs28) => withConfiguration(
|
|
2744
2741
|
withApiOptions(
|
|
2745
2742
|
withProjectOptions(
|
|
2746
2743
|
withDiffOptions(
|
|
2747
|
-
|
|
2744
|
+
yargs28.positional("directory", {
|
|
2748
2745
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
2749
2746
|
type: "string"
|
|
2750
2747
|
}).option("what-if", {
|
|
@@ -2814,10 +2811,10 @@ var ContentTypeRemoveModule = {
|
|
|
2814
2811
|
command: "remove <id>",
|
|
2815
2812
|
aliases: ["delete", "rm"],
|
|
2816
2813
|
describe: "Delete a content type",
|
|
2817
|
-
builder: (
|
|
2814
|
+
builder: (yargs28) => withConfiguration(
|
|
2818
2815
|
withApiOptions(
|
|
2819
2816
|
withProjectOptions(
|
|
2820
|
-
|
|
2817
|
+
yargs28.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
2821
2818
|
)
|
|
2822
2819
|
)
|
|
2823
2820
|
),
|
|
@@ -2834,10 +2831,10 @@ var ContentTypeUpdateModule = {
|
|
|
2834
2831
|
command: "update <filename>",
|
|
2835
2832
|
aliases: ["put"],
|
|
2836
2833
|
describe: "Insert or update a content type",
|
|
2837
|
-
builder: (
|
|
2834
|
+
builder: (yargs28) => withConfiguration(
|
|
2838
2835
|
withApiOptions(
|
|
2839
2836
|
withProjectOptions(
|
|
2840
|
-
|
|
2837
|
+
yargs28.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
2841
2838
|
)
|
|
2842
2839
|
)
|
|
2843
2840
|
),
|
|
@@ -2854,7 +2851,7 @@ var ContentTypeModule = {
|
|
|
2854
2851
|
command: "contenttype <command>",
|
|
2855
2852
|
aliases: ["ct"],
|
|
2856
2853
|
describe: "Commands for Content Types",
|
|
2857
|
-
builder: (
|
|
2854
|
+
builder: (yargs28) => yargs28.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
2858
2855
|
handler: () => {
|
|
2859
2856
|
yargs5.help();
|
|
2860
2857
|
}
|
|
@@ -2869,12 +2866,12 @@ var DataTypeGetModule = {
|
|
|
2869
2866
|
command: "get <id>",
|
|
2870
2867
|
describe: "Get a data type",
|
|
2871
2868
|
aliases: ["ls"],
|
|
2872
|
-
builder: (
|
|
2869
|
+
builder: (yargs28) => withConfiguration(
|
|
2873
2870
|
withFormatOptions(
|
|
2874
2871
|
withApiOptions(
|
|
2875
2872
|
withProjectOptions(
|
|
2876
2873
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2877
|
-
|
|
2874
|
+
yargs28.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
2878
2875
|
)
|
|
2879
2876
|
)
|
|
2880
2877
|
)
|
|
@@ -2897,7 +2894,7 @@ var DataTypeListModule = {
|
|
|
2897
2894
|
command: "list",
|
|
2898
2895
|
describe: "List data types",
|
|
2899
2896
|
aliases: ["ls"],
|
|
2900
|
-
builder: (
|
|
2897
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
2901
2898
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
2902
2899
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2903
2900
|
const client = new DataTypeClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -2946,11 +2943,11 @@ function createDataTypeEngineDataSource({
|
|
|
2946
2943
|
var DataTypePullModule = {
|
|
2947
2944
|
command: "pull <directory>",
|
|
2948
2945
|
describe: "Pulls all data types to local files in a directory",
|
|
2949
|
-
builder: (
|
|
2946
|
+
builder: (yargs28) => withConfiguration(
|
|
2950
2947
|
withApiOptions(
|
|
2951
2948
|
withProjectOptions(
|
|
2952
2949
|
withDiffOptions(
|
|
2953
|
-
|
|
2950
|
+
yargs28.positional("directory", {
|
|
2954
2951
|
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.",
|
|
2955
2952
|
type: "string"
|
|
2956
2953
|
}).option("format", {
|
|
@@ -3032,11 +3029,11 @@ import { DataTypeClient as DataTypeClient4 } from "@uniformdev/canvas";
|
|
|
3032
3029
|
var DataTypePushModule = {
|
|
3033
3030
|
command: "push <directory>",
|
|
3034
3031
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
3035
|
-
builder: (
|
|
3032
|
+
builder: (yargs28) => withConfiguration(
|
|
3036
3033
|
withApiOptions(
|
|
3037
3034
|
withProjectOptions(
|
|
3038
3035
|
withDiffOptions(
|
|
3039
|
-
|
|
3036
|
+
yargs28.positional("directory", {
|
|
3040
3037
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
3041
3038
|
type: "string"
|
|
3042
3039
|
}).option("what-if", {
|
|
@@ -3106,10 +3103,10 @@ var DataTypeRemoveModule = {
|
|
|
3106
3103
|
command: "remove <id>",
|
|
3107
3104
|
aliases: ["delete", "rm"],
|
|
3108
3105
|
describe: "Delete a data type",
|
|
3109
|
-
builder: (
|
|
3106
|
+
builder: (yargs28) => withConfiguration(
|
|
3110
3107
|
withApiOptions(
|
|
3111
3108
|
withProjectOptions(
|
|
3112
|
-
|
|
3109
|
+
yargs28.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
3113
3110
|
)
|
|
3114
3111
|
)
|
|
3115
3112
|
),
|
|
@@ -3126,10 +3123,10 @@ var DataTypeUpdateModule = {
|
|
|
3126
3123
|
command: "update <filename>",
|
|
3127
3124
|
aliases: ["put"],
|
|
3128
3125
|
describe: "Insert or update a data type",
|
|
3129
|
-
builder: (
|
|
3126
|
+
builder: (yargs28) => withConfiguration(
|
|
3130
3127
|
withApiOptions(
|
|
3131
3128
|
withProjectOptions(
|
|
3132
|
-
|
|
3129
|
+
yargs28.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
3133
3130
|
)
|
|
3134
3131
|
)
|
|
3135
3132
|
),
|
|
@@ -3146,7 +3143,7 @@ var DataTypeModule = {
|
|
|
3146
3143
|
command: "datatype <command>",
|
|
3147
3144
|
aliases: ["dt"],
|
|
3148
3145
|
describe: "Commands for Data Type definitions",
|
|
3149
|
-
builder: (
|
|
3146
|
+
builder: (yargs28) => yargs28.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
3150
3147
|
handler: () => {
|
|
3151
3148
|
yargs6.help();
|
|
3152
3149
|
}
|
|
@@ -3160,12 +3157,12 @@ import { ContentClient as ContentClient7 } from "@uniformdev/canvas";
|
|
|
3160
3157
|
var EntryGetModule = {
|
|
3161
3158
|
command: "get <id>",
|
|
3162
3159
|
describe: "Get an entry",
|
|
3163
|
-
builder: (
|
|
3160
|
+
builder: (yargs28) => withConfiguration(
|
|
3164
3161
|
withFormatOptions(
|
|
3165
3162
|
withApiOptions(
|
|
3166
3163
|
withProjectOptions(
|
|
3167
3164
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3168
|
-
|
|
3165
|
+
yargs28.positional("id", { demandOption: true, describe: "Entry public ID to fetch" })
|
|
3169
3166
|
)
|
|
3170
3167
|
)
|
|
3171
3168
|
)
|
|
@@ -3177,7 +3174,9 @@ var EntryGetModule = {
|
|
|
3177
3174
|
offset: 0,
|
|
3178
3175
|
limit: 1,
|
|
3179
3176
|
entryIDs: [id],
|
|
3180
|
-
skipOverridesResolution: true
|
|
3177
|
+
skipOverridesResolution: true,
|
|
3178
|
+
skipPatternResolution: true,
|
|
3179
|
+
skipDataResolution: true
|
|
3181
3180
|
});
|
|
3182
3181
|
if (res.entries.length !== 1) {
|
|
3183
3182
|
throw new Error(`Entry with ID ${id} not found`);
|
|
@@ -3191,11 +3190,17 @@ import { ContentClient as ContentClient8 } from "@uniformdev/canvas";
|
|
|
3191
3190
|
var EntryListModule = {
|
|
3192
3191
|
command: "list",
|
|
3193
3192
|
describe: "List entries",
|
|
3194
|
-
builder: (
|
|
3193
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
3195
3194
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3196
3195
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3197
3196
|
const client = new ContentClient8({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
3198
|
-
const res = await client.getEntries({
|
|
3197
|
+
const res = await client.getEntries({
|
|
3198
|
+
offset: 0,
|
|
3199
|
+
limit: 1e3,
|
|
3200
|
+
skipOverridesResolution: true,
|
|
3201
|
+
skipPatternResolution: true,
|
|
3202
|
+
skipDataResolution: true
|
|
3203
|
+
});
|
|
3199
3204
|
emitWithFormat(res.entries, format, filename);
|
|
3200
3205
|
}
|
|
3201
3206
|
};
|
|
@@ -3223,6 +3228,7 @@ function createEntryEngineDataSource({
|
|
|
3223
3228
|
limit: 1e3,
|
|
3224
3229
|
skipDataResolution: true,
|
|
3225
3230
|
skipOverridesResolution: true,
|
|
3231
|
+
skipPatternResolution: true,
|
|
3226
3232
|
state: stateId,
|
|
3227
3233
|
withComponentIDs: true
|
|
3228
3234
|
});
|
|
@@ -3251,12 +3257,12 @@ function createEntryEngineDataSource({
|
|
|
3251
3257
|
var EntryPullModule = {
|
|
3252
3258
|
command: "pull <directory>",
|
|
3253
3259
|
describe: "Pulls all entries to local files in a directory",
|
|
3254
|
-
builder: (
|
|
3260
|
+
builder: (yargs28) => withConfiguration(
|
|
3255
3261
|
withApiOptions(
|
|
3256
3262
|
withProjectOptions(
|
|
3257
3263
|
withStateOptions(
|
|
3258
3264
|
withDiffOptions(
|
|
3259
|
-
|
|
3265
|
+
yargs28.positional("directory", {
|
|
3260
3266
|
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.",
|
|
3261
3267
|
type: "string"
|
|
3262
3268
|
}).option("format", {
|
|
@@ -3354,12 +3360,12 @@ import { UncachedFileClient as UncachedFileClient6 } from "@uniformdev/files";
|
|
|
3354
3360
|
var EntryPushModule = {
|
|
3355
3361
|
command: "push <directory>",
|
|
3356
3362
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
3357
|
-
builder: (
|
|
3363
|
+
builder: (yargs28) => withConfiguration(
|
|
3358
3364
|
withApiOptions(
|
|
3359
3365
|
withProjectOptions(
|
|
3360
3366
|
withStateOptions(
|
|
3361
3367
|
withDiffOptions(
|
|
3362
|
-
|
|
3368
|
+
yargs28.positional("directory", {
|
|
3363
3369
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
3364
3370
|
type: "string"
|
|
3365
3371
|
}).option("what-if", {
|
|
@@ -3443,10 +3449,10 @@ var EntryRemoveModule = {
|
|
|
3443
3449
|
command: "remove <id>",
|
|
3444
3450
|
aliases: ["delete", "rm"],
|
|
3445
3451
|
describe: "Delete an entry",
|
|
3446
|
-
builder: (
|
|
3452
|
+
builder: (yargs28) => withConfiguration(
|
|
3447
3453
|
withApiOptions(
|
|
3448
3454
|
withProjectOptions(
|
|
3449
|
-
|
|
3455
|
+
yargs28.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
3450
3456
|
)
|
|
3451
3457
|
)
|
|
3452
3458
|
),
|
|
@@ -3463,10 +3469,10 @@ var EntryUpdateModule = {
|
|
|
3463
3469
|
command: "update <filename>",
|
|
3464
3470
|
aliases: ["put"],
|
|
3465
3471
|
describe: "Insert or update an entry",
|
|
3466
|
-
builder: (
|
|
3472
|
+
builder: (yargs28) => withConfiguration(
|
|
3467
3473
|
withApiOptions(
|
|
3468
3474
|
withProjectOptions(
|
|
3469
|
-
|
|
3475
|
+
yargs28.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
3470
3476
|
)
|
|
3471
3477
|
)
|
|
3472
3478
|
),
|
|
@@ -3482,15 +3488,218 @@ var EntryUpdateModule = {
|
|
|
3482
3488
|
var EntryModule = {
|
|
3483
3489
|
command: "entry <command>",
|
|
3484
3490
|
describe: "Commands for Entries",
|
|
3485
|
-
builder: (
|
|
3491
|
+
builder: (yargs28) => yargs28.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).demandCommand(),
|
|
3486
3492
|
handler: () => {
|
|
3487
3493
|
yargs7.help();
|
|
3488
3494
|
}
|
|
3489
3495
|
};
|
|
3490
3496
|
|
|
3491
|
-
// src/commands/canvas/commands/
|
|
3497
|
+
// src/commands/canvas/commands/locale.ts
|
|
3492
3498
|
import yargs8 from "yargs";
|
|
3493
3499
|
|
|
3500
|
+
// src/commands/canvas/commands/locale/pull.ts
|
|
3501
|
+
import { LocaleClient } from "@uniformdev/canvas";
|
|
3502
|
+
|
|
3503
|
+
// src/commands/canvas/localesEngineDataSource.ts
|
|
3504
|
+
function createLocaleEngineDataSource({
|
|
3505
|
+
client
|
|
3506
|
+
}) {
|
|
3507
|
+
async function* getObjects() {
|
|
3508
|
+
const locales = (await client.get()).results;
|
|
3509
|
+
for await (const locale of locales) {
|
|
3510
|
+
const result = {
|
|
3511
|
+
id: locale.locale,
|
|
3512
|
+
displayName: locale.displayName,
|
|
3513
|
+
providerId: locale.locale,
|
|
3514
|
+
object: locale
|
|
3515
|
+
};
|
|
3516
|
+
yield result;
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
return {
|
|
3520
|
+
objects: getObjects(),
|
|
3521
|
+
deleteObject: async (providerId) => {
|
|
3522
|
+
await client.remove({ locale: providerId });
|
|
3523
|
+
},
|
|
3524
|
+
writeObject: async (object) => {
|
|
3525
|
+
await client.upsert({
|
|
3526
|
+
locale: object.object
|
|
3527
|
+
});
|
|
3528
|
+
}
|
|
3529
|
+
};
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
// src/commands/canvas/commands/locale/pull.ts
|
|
3533
|
+
var LocalePullModule = {
|
|
3534
|
+
command: "pull <directory>",
|
|
3535
|
+
describe: "Pulls all locales to local files in a directory",
|
|
3536
|
+
builder: (yargs28) => withConfiguration(
|
|
3537
|
+
withApiOptions(
|
|
3538
|
+
withProjectOptions(
|
|
3539
|
+
withDiffOptions(
|
|
3540
|
+
yargs28.positional("directory", {
|
|
3541
|
+
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.",
|
|
3542
|
+
type: "string"
|
|
3543
|
+
}).option("format", {
|
|
3544
|
+
alias: ["f"],
|
|
3545
|
+
describe: "Output format",
|
|
3546
|
+
default: "yaml",
|
|
3547
|
+
choices: ["yaml", "json"],
|
|
3548
|
+
type: "string"
|
|
3549
|
+
}).option("what-if", {
|
|
3550
|
+
alias: ["w"],
|
|
3551
|
+
describe: "What-if mode reports what would be done but changes no files",
|
|
3552
|
+
default: false,
|
|
3553
|
+
type: "boolean"
|
|
3554
|
+
}).option("mode", {
|
|
3555
|
+
alias: ["m"],
|
|
3556
|
+
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',
|
|
3557
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
3558
|
+
default: "mirror",
|
|
3559
|
+
type: "string"
|
|
3560
|
+
})
|
|
3561
|
+
)
|
|
3562
|
+
)
|
|
3563
|
+
)
|
|
3564
|
+
),
|
|
3565
|
+
handler: async ({
|
|
3566
|
+
apiHost,
|
|
3567
|
+
apiKey,
|
|
3568
|
+
proxy,
|
|
3569
|
+
directory,
|
|
3570
|
+
format,
|
|
3571
|
+
mode,
|
|
3572
|
+
whatIf,
|
|
3573
|
+
project: projectId,
|
|
3574
|
+
diff: diffMode
|
|
3575
|
+
}) => {
|
|
3576
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
3577
|
+
const client = new LocaleClient({
|
|
3578
|
+
apiKey,
|
|
3579
|
+
apiHost,
|
|
3580
|
+
fetch: fetch3,
|
|
3581
|
+
projectId,
|
|
3582
|
+
bypassCache: true
|
|
3583
|
+
});
|
|
3584
|
+
const source = createLocaleEngineDataSource({ client });
|
|
3585
|
+
let target;
|
|
3586
|
+
const isPackage = isPathAPackageFile(directory);
|
|
3587
|
+
if (isPackage) {
|
|
3588
|
+
const packageContents = readCanvasPackage(directory, false);
|
|
3589
|
+
target = await createArraySyncEngineDataSource({
|
|
3590
|
+
objects: packageContents.locales ?? [],
|
|
3591
|
+
selectIdentifier: (i) => i.locale,
|
|
3592
|
+
selectDisplayName: (i) => i.displayName,
|
|
3593
|
+
onSyncComplete: async (_, synced) => {
|
|
3594
|
+
packageContents.locales = synced;
|
|
3595
|
+
writeCanvasPackage(directory, packageContents);
|
|
3596
|
+
}
|
|
3597
|
+
});
|
|
3598
|
+
} else {
|
|
3599
|
+
target = await createFileSyncEngineDataSource({
|
|
3600
|
+
directory,
|
|
3601
|
+
selectIdentifier: (i) => i.locale,
|
|
3602
|
+
selectDisplayName: (i) => i.displayName,
|
|
3603
|
+
format
|
|
3604
|
+
});
|
|
3605
|
+
}
|
|
3606
|
+
await syncEngine({
|
|
3607
|
+
source,
|
|
3608
|
+
target,
|
|
3609
|
+
mode,
|
|
3610
|
+
whatIf,
|
|
3611
|
+
allowEmptySource: true,
|
|
3612
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
3613
|
+
});
|
|
3614
|
+
}
|
|
3615
|
+
};
|
|
3616
|
+
|
|
3617
|
+
// src/commands/canvas/commands/locale/push.ts
|
|
3618
|
+
import { LocaleClient as LocaleClient2 } from "@uniformdev/canvas";
|
|
3619
|
+
var LocalePushModule = {
|
|
3620
|
+
command: "push <directory>",
|
|
3621
|
+
describe: "Pushes all locales from files in a directory to Uniform",
|
|
3622
|
+
builder: (yargs28) => withConfiguration(
|
|
3623
|
+
withApiOptions(
|
|
3624
|
+
withProjectOptions(
|
|
3625
|
+
withDiffOptions(
|
|
3626
|
+
yargs28.positional("directory", {
|
|
3627
|
+
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
3628
|
+
type: "string"
|
|
3629
|
+
}).option("what-if", {
|
|
3630
|
+
alias: ["w"],
|
|
3631
|
+
describe: "What-if mode reports what would be done but changes nothing",
|
|
3632
|
+
default: false,
|
|
3633
|
+
type: "boolean"
|
|
3634
|
+
}).option("mode", {
|
|
3635
|
+
alias: ["m"],
|
|
3636
|
+
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',
|
|
3637
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
3638
|
+
default: "mirror",
|
|
3639
|
+
type: "string"
|
|
3640
|
+
})
|
|
3641
|
+
)
|
|
3642
|
+
)
|
|
3643
|
+
)
|
|
3644
|
+
),
|
|
3645
|
+
handler: async ({
|
|
3646
|
+
apiHost,
|
|
3647
|
+
apiKey,
|
|
3648
|
+
proxy,
|
|
3649
|
+
directory,
|
|
3650
|
+
mode,
|
|
3651
|
+
whatIf,
|
|
3652
|
+
project: projectId,
|
|
3653
|
+
diff: diffMode
|
|
3654
|
+
}) => {
|
|
3655
|
+
const fetch3 = nodeFetchProxy(proxy);
|
|
3656
|
+
const client = new LocaleClient2({
|
|
3657
|
+
apiKey,
|
|
3658
|
+
apiHost,
|
|
3659
|
+
fetch: fetch3,
|
|
3660
|
+
projectId,
|
|
3661
|
+
bypassCache: true
|
|
3662
|
+
});
|
|
3663
|
+
let source;
|
|
3664
|
+
const isPackage = isPathAPackageFile(directory);
|
|
3665
|
+
if (isPackage) {
|
|
3666
|
+
const packageContents = readCanvasPackage(directory, true);
|
|
3667
|
+
source = await createArraySyncEngineDataSource({
|
|
3668
|
+
objects: packageContents.locales ?? [],
|
|
3669
|
+
selectIdentifier: (locale) => locale.locale,
|
|
3670
|
+
selectDisplayName: (locale) => locale.displayName
|
|
3671
|
+
});
|
|
3672
|
+
} else {
|
|
3673
|
+
source = await createFileSyncEngineDataSource({
|
|
3674
|
+
directory,
|
|
3675
|
+
selectIdentifier: (locale) => locale.locale,
|
|
3676
|
+
selectDisplayName: (locale) => locale.displayName
|
|
3677
|
+
});
|
|
3678
|
+
}
|
|
3679
|
+
const target = createLocaleEngineDataSource({ client });
|
|
3680
|
+
await syncEngine({
|
|
3681
|
+
source,
|
|
3682
|
+
target,
|
|
3683
|
+
mode,
|
|
3684
|
+
whatIf,
|
|
3685
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
3686
|
+
});
|
|
3687
|
+
}
|
|
3688
|
+
};
|
|
3689
|
+
|
|
3690
|
+
// src/commands/canvas/commands/locale.ts
|
|
3691
|
+
var LocaleModule = {
|
|
3692
|
+
command: "locale <command>",
|
|
3693
|
+
describe: "Commands for locale definitions",
|
|
3694
|
+
builder: (yargs28) => yargs28.command(LocalePullModule).command(LocalePushModule),
|
|
3695
|
+
handler: () => {
|
|
3696
|
+
yargs8.help();
|
|
3697
|
+
}
|
|
3698
|
+
};
|
|
3699
|
+
|
|
3700
|
+
// src/commands/canvas/commands/pattern.ts
|
|
3701
|
+
import yargs9 from "yargs";
|
|
3702
|
+
|
|
3494
3703
|
// src/commands/canvas/commands/pattern/get.ts
|
|
3495
3704
|
var PatternGetModule = {
|
|
3496
3705
|
...CompositionGetModule,
|
|
@@ -3501,12 +3710,12 @@ var PatternGetModule = {
|
|
|
3501
3710
|
var PatternListModule = {
|
|
3502
3711
|
...CompositionListModule,
|
|
3503
3712
|
describe: "List patterns",
|
|
3504
|
-
builder: (
|
|
3713
|
+
builder: (yargs28) => withFormatOptions(
|
|
3505
3714
|
withConfiguration(
|
|
3506
3715
|
withApiOptions(
|
|
3507
3716
|
withProjectOptions(
|
|
3508
3717
|
withStateOptions(
|
|
3509
|
-
|
|
3718
|
+
yargs28.options({
|
|
3510
3719
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3511
3720
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3512
3721
|
resolvePatterns: {
|
|
@@ -3544,11 +3753,11 @@ var PatternListModule = {
|
|
|
3544
3753
|
var PatternPublishModule = {
|
|
3545
3754
|
...CompositionPublishModule,
|
|
3546
3755
|
describe: "Publishes pattern(s)",
|
|
3547
|
-
builder: (
|
|
3756
|
+
builder: (yargs28) => withConfiguration(
|
|
3548
3757
|
withApiOptions(
|
|
3549
3758
|
withProjectOptions(
|
|
3550
3759
|
withDiffOptions(
|
|
3551
|
-
|
|
3760
|
+
yargs28.positional("ids", {
|
|
3552
3761
|
describe: "Publishes pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3553
3762
|
type: "string"
|
|
3554
3763
|
}).option("all", {
|
|
@@ -3586,12 +3795,12 @@ var PatternPublishModule = {
|
|
|
3586
3795
|
var PatternPullModule = {
|
|
3587
3796
|
...CompositionPullModule,
|
|
3588
3797
|
describe: "Pulls all patterns to local files in a directory",
|
|
3589
|
-
builder: (
|
|
3798
|
+
builder: (yargs28) => withConfiguration(
|
|
3590
3799
|
withApiOptions(
|
|
3591
3800
|
withProjectOptions(
|
|
3592
3801
|
withStateOptions(
|
|
3593
3802
|
withDiffOptions(
|
|
3594
|
-
|
|
3803
|
+
yargs28.positional("directory", {
|
|
3595
3804
|
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.",
|
|
3596
3805
|
type: "string"
|
|
3597
3806
|
}).option("format", {
|
|
@@ -3629,12 +3838,12 @@ var PatternPullModule = {
|
|
|
3629
3838
|
var PatternPushModule = {
|
|
3630
3839
|
...CompositionPushModule,
|
|
3631
3840
|
describe: "Pushes all patterns from files in a directory to Uniform Canvas",
|
|
3632
|
-
builder: (
|
|
3841
|
+
builder: (yargs28) => withConfiguration(
|
|
3633
3842
|
withApiOptions(
|
|
3634
3843
|
withProjectOptions(
|
|
3635
3844
|
withStateOptions(
|
|
3636
3845
|
withDiffOptions(
|
|
3637
|
-
|
|
3846
|
+
yargs28.positional("directory", {
|
|
3638
3847
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
3639
3848
|
type: "string"
|
|
3640
3849
|
}).option("what-if", {
|
|
@@ -3672,10 +3881,10 @@ var PatternRemoveModule = {
|
|
|
3672
3881
|
var PatternUnpublishModule = {
|
|
3673
3882
|
command: "unpublish [ids]",
|
|
3674
3883
|
describe: "Unpublish a pattern(s)",
|
|
3675
|
-
builder: (
|
|
3884
|
+
builder: (yargs28) => withConfiguration(
|
|
3676
3885
|
withApiOptions(
|
|
3677
3886
|
withProjectOptions(
|
|
3678
|
-
|
|
3887
|
+
yargs28.positional("ids", {
|
|
3679
3888
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
3680
3889
|
type: "string"
|
|
3681
3890
|
}).option("all", {
|
|
@@ -3714,26 +3923,26 @@ var PatternUpdateModule = {
|
|
|
3714
3923
|
var PatternModule = {
|
|
3715
3924
|
command: "pattern <command>",
|
|
3716
3925
|
describe: "Commands for Canvas patterns",
|
|
3717
|
-
builder: (
|
|
3926
|
+
builder: (yargs28) => yargs28.command(PatternPullModule).command(PatternPushModule).command(PatternGetModule).command(PatternRemoveModule).command(PatternListModule).command(PatternUpdateModule).command(PatternPublishModule).command(PatternUnpublishModule).demandCommand(),
|
|
3718
3927
|
handler: () => {
|
|
3719
|
-
|
|
3928
|
+
yargs9.help();
|
|
3720
3929
|
}
|
|
3721
3930
|
};
|
|
3722
3931
|
|
|
3723
3932
|
// src/commands/canvas/commands/prompts.ts
|
|
3724
|
-
import
|
|
3933
|
+
import yargs10 from "yargs";
|
|
3725
3934
|
|
|
3726
3935
|
// src/commands/canvas/commands/prompts/get.ts
|
|
3727
3936
|
import { PromptClient } from "@uniformdev/canvas";
|
|
3728
3937
|
var PromptGetModule = {
|
|
3729
3938
|
command: "get <id>",
|
|
3730
3939
|
describe: "Get a prompt",
|
|
3731
|
-
builder: (
|
|
3940
|
+
builder: (yargs28) => withConfiguration(
|
|
3732
3941
|
withFormatOptions(
|
|
3733
3942
|
withApiOptions(
|
|
3734
3943
|
withProjectOptions(
|
|
3735
3944
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3736
|
-
|
|
3945
|
+
yargs28.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
3737
3946
|
)
|
|
3738
3947
|
)
|
|
3739
3948
|
)
|
|
@@ -3754,7 +3963,7 @@ import { PromptClient as PromptClient2 } from "@uniformdev/canvas";
|
|
|
3754
3963
|
var PromptListModule = {
|
|
3755
3964
|
command: "list",
|
|
3756
3965
|
describe: "List prompts",
|
|
3757
|
-
builder: (
|
|
3966
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
3758
3967
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
3759
3968
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3760
3969
|
const client = new PromptClient2({ apiKey, apiHost, fetch: fetch3, projectId, bypassCache: true });
|
|
@@ -3801,12 +4010,12 @@ function createPromptEngineDataSource({
|
|
|
3801
4010
|
var PromptPullModule = {
|
|
3802
4011
|
command: "pull <directory>",
|
|
3803
4012
|
describe: "Pulls all entries to local files in a directory",
|
|
3804
|
-
builder: (
|
|
4013
|
+
builder: (yargs28) => withConfiguration(
|
|
3805
4014
|
withApiOptions(
|
|
3806
4015
|
withProjectOptions(
|
|
3807
4016
|
withStateOptions(
|
|
3808
4017
|
withDiffOptions(
|
|
3809
|
-
|
|
4018
|
+
yargs28.positional("directory", {
|
|
3810
4019
|
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.",
|
|
3811
4020
|
type: "string"
|
|
3812
4021
|
}).option("format", {
|
|
@@ -3889,12 +4098,12 @@ import { PromptClient as PromptClient4 } from "@uniformdev/canvas";
|
|
|
3889
4098
|
var PromptPushModule = {
|
|
3890
4099
|
command: "push <directory>",
|
|
3891
4100
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
3892
|
-
builder: (
|
|
4101
|
+
builder: (yargs28) => withConfiguration(
|
|
3893
4102
|
withApiOptions(
|
|
3894
4103
|
withProjectOptions(
|
|
3895
4104
|
withStateOptions(
|
|
3896
4105
|
withDiffOptions(
|
|
3897
|
-
|
|
4106
|
+
yargs28.positional("directory", {
|
|
3898
4107
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
3899
4108
|
type: "string"
|
|
3900
4109
|
}).option("what-if", {
|
|
@@ -3965,9 +4174,9 @@ var PromptRemoveModule = {
|
|
|
3965
4174
|
command: "remove <id>",
|
|
3966
4175
|
aliases: ["delete", "rm"],
|
|
3967
4176
|
describe: "Delete a prompt",
|
|
3968
|
-
builder: (
|
|
4177
|
+
builder: (yargs28) => withConfiguration(
|
|
3969
4178
|
withApiOptions(
|
|
3970
|
-
withProjectOptions(
|
|
4179
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
3971
4180
|
)
|
|
3972
4181
|
),
|
|
3973
4182
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -3983,10 +4192,10 @@ var PromptUpdateModule = {
|
|
|
3983
4192
|
command: "update <filename>",
|
|
3984
4193
|
aliases: ["put"],
|
|
3985
4194
|
describe: "Insert or update a prompt",
|
|
3986
|
-
builder: (
|
|
4195
|
+
builder: (yargs28) => withConfiguration(
|
|
3987
4196
|
withApiOptions(
|
|
3988
4197
|
withProjectOptions(
|
|
3989
|
-
|
|
4198
|
+
yargs28.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
3990
4199
|
)
|
|
3991
4200
|
)
|
|
3992
4201
|
),
|
|
@@ -4003,9 +4212,9 @@ var PromptModule = {
|
|
|
4003
4212
|
command: "prompt <command>",
|
|
4004
4213
|
aliases: ["dt"],
|
|
4005
4214
|
describe: "Commands for AI Prompt definitions",
|
|
4006
|
-
builder: (
|
|
4215
|
+
builder: (yargs28) => yargs28.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
4007
4216
|
handler: () => {
|
|
4008
|
-
|
|
4217
|
+
yargs10.help();
|
|
4009
4218
|
}
|
|
4010
4219
|
};
|
|
4011
4220
|
|
|
@@ -4014,28 +4223,28 @@ var CanvasCommand = {
|
|
|
4014
4223
|
command: "canvas <command>",
|
|
4015
4224
|
aliases: ["cv", "pm", "presentation"],
|
|
4016
4225
|
describe: "Uniform Canvas commands",
|
|
4017
|
-
builder: (
|
|
4226
|
+
builder: (yargs28) => yargs28.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(CategoryModule).command(PatternModule).command(ContentTypeModule).command(EntryModule).command(PromptModule).command(AssetModule).command(LocaleModule).demandCommand(),
|
|
4018
4227
|
handler: () => {
|
|
4019
|
-
|
|
4228
|
+
yargs11.showHelp();
|
|
4020
4229
|
}
|
|
4021
4230
|
};
|
|
4022
4231
|
|
|
4023
4232
|
// src/commands/context/index.ts
|
|
4024
|
-
import
|
|
4233
|
+
import yargs18 from "yargs";
|
|
4025
4234
|
|
|
4026
4235
|
// src/commands/context/commands/aggregate.ts
|
|
4027
|
-
import
|
|
4236
|
+
import yargs12 from "yargs";
|
|
4028
4237
|
|
|
4029
4238
|
// src/commands/context/commands/aggregate/get.ts
|
|
4030
4239
|
import { UncachedAggregateClient } from "@uniformdev/context/api";
|
|
4031
4240
|
var AggregateGetModule = {
|
|
4032
4241
|
command: "get <id>",
|
|
4033
4242
|
describe: "Fetch an aggregate",
|
|
4034
|
-
builder: (
|
|
4243
|
+
builder: (yargs28) => withConfiguration(
|
|
4035
4244
|
withFormatOptions(
|
|
4036
4245
|
withApiOptions(
|
|
4037
4246
|
withProjectOptions(
|
|
4038
|
-
|
|
4247
|
+
yargs28.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
4039
4248
|
)
|
|
4040
4249
|
)
|
|
4041
4250
|
)
|
|
@@ -4059,7 +4268,7 @@ var AggregateListModule = {
|
|
|
4059
4268
|
command: "list",
|
|
4060
4269
|
describe: "List aggregates",
|
|
4061
4270
|
aliases: ["ls"],
|
|
4062
|
-
builder: (
|
|
4271
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
4063
4272
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
4064
4273
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4065
4274
|
const client = new UncachedAggregateClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -4125,11 +4334,11 @@ function writeContextPackage(filename, packageContents) {
|
|
|
4125
4334
|
var AggregatePullModule = {
|
|
4126
4335
|
command: "pull <directory>",
|
|
4127
4336
|
describe: "Pulls all aggregates to local files in a directory",
|
|
4128
|
-
builder: (
|
|
4337
|
+
builder: (yargs28) => withConfiguration(
|
|
4129
4338
|
withApiOptions(
|
|
4130
4339
|
withProjectOptions(
|
|
4131
4340
|
withDiffOptions(
|
|
4132
|
-
|
|
4341
|
+
yargs28.positional("directory", {
|
|
4133
4342
|
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.",
|
|
4134
4343
|
type: "string"
|
|
4135
4344
|
}).option("format", {
|
|
@@ -4204,11 +4413,11 @@ import { UncachedAggregateClient as UncachedAggregateClient4 } from "@uniformdev
|
|
|
4204
4413
|
var AggregatePushModule = {
|
|
4205
4414
|
command: "push <directory>",
|
|
4206
4415
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
4207
|
-
builder: (
|
|
4416
|
+
builder: (yargs28) => withConfiguration(
|
|
4208
4417
|
withApiOptions(
|
|
4209
4418
|
withProjectOptions(
|
|
4210
4419
|
withDiffOptions(
|
|
4211
|
-
|
|
4420
|
+
yargs28.positional("directory", {
|
|
4212
4421
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
4213
4422
|
type: "string"
|
|
4214
4423
|
}).option("what-if", {
|
|
@@ -4273,10 +4482,10 @@ var AggregateRemoveModule = {
|
|
|
4273
4482
|
command: "remove <id>",
|
|
4274
4483
|
aliases: ["delete", "rm"],
|
|
4275
4484
|
describe: "Delete an aggregate",
|
|
4276
|
-
builder: (
|
|
4485
|
+
builder: (yargs28) => withConfiguration(
|
|
4277
4486
|
withApiOptions(
|
|
4278
4487
|
withProjectOptions(
|
|
4279
|
-
|
|
4488
|
+
yargs28.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
4280
4489
|
)
|
|
4281
4490
|
)
|
|
4282
4491
|
),
|
|
@@ -4293,10 +4502,10 @@ var AggregateUpdateModule = {
|
|
|
4293
4502
|
command: "update <filename>",
|
|
4294
4503
|
aliases: ["put"],
|
|
4295
4504
|
describe: "Insert or update an aggregate",
|
|
4296
|
-
builder: (
|
|
4505
|
+
builder: (yargs28) => withConfiguration(
|
|
4297
4506
|
withApiOptions(
|
|
4298
4507
|
withProjectOptions(
|
|
4299
|
-
|
|
4508
|
+
yargs28.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
4300
4509
|
)
|
|
4301
4510
|
)
|
|
4302
4511
|
),
|
|
@@ -4313,25 +4522,25 @@ var AggregateModule = {
|
|
|
4313
4522
|
command: "aggregate <command>",
|
|
4314
4523
|
aliases: ["agg", "intent", "audience"],
|
|
4315
4524
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
4316
|
-
builder: (
|
|
4525
|
+
builder: (yargs28) => yargs28.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
4317
4526
|
handler: () => {
|
|
4318
|
-
|
|
4527
|
+
yargs12.help();
|
|
4319
4528
|
}
|
|
4320
4529
|
};
|
|
4321
4530
|
|
|
4322
4531
|
// src/commands/context/commands/enrichment.ts
|
|
4323
|
-
import
|
|
4532
|
+
import yargs13 from "yargs";
|
|
4324
4533
|
|
|
4325
4534
|
// src/commands/context/commands/enrichment/get.ts
|
|
4326
4535
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
4327
4536
|
var EnrichmentGetModule = {
|
|
4328
4537
|
command: "get <id>",
|
|
4329
4538
|
describe: "Fetch an enrichment category and its values",
|
|
4330
|
-
builder: (
|
|
4539
|
+
builder: (yargs28) => withFormatOptions(
|
|
4331
4540
|
withConfiguration(
|
|
4332
4541
|
withApiOptions(
|
|
4333
4542
|
withProjectOptions(
|
|
4334
|
-
|
|
4543
|
+
yargs28.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
4335
4544
|
)
|
|
4336
4545
|
)
|
|
4337
4546
|
)
|
|
@@ -4356,7 +4565,7 @@ var EnrichmentListModule = {
|
|
|
4356
4565
|
command: "list",
|
|
4357
4566
|
describe: "List enrichments",
|
|
4358
4567
|
aliases: ["ls"],
|
|
4359
|
-
builder: (
|
|
4568
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
4360
4569
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
4361
4570
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4362
4571
|
const client = new UncachedEnrichmentClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -4457,11 +4666,11 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
4457
4666
|
var EnrichmentPullModule = {
|
|
4458
4667
|
command: "pull <directory>",
|
|
4459
4668
|
describe: "Pulls all enrichments to local files in a directory",
|
|
4460
|
-
builder: (
|
|
4669
|
+
builder: (yargs28) => withConfiguration(
|
|
4461
4670
|
withApiOptions(
|
|
4462
4671
|
withProjectOptions(
|
|
4463
4672
|
withDiffOptions(
|
|
4464
|
-
|
|
4673
|
+
yargs28.positional("directory", {
|
|
4465
4674
|
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.",
|
|
4466
4675
|
type: "string"
|
|
4467
4676
|
}).option("format", {
|
|
@@ -4536,11 +4745,11 @@ import { UncachedEnrichmentClient as UncachedEnrichmentClient4 } from "@uniformd
|
|
|
4536
4745
|
var EnrichmentPushModule = {
|
|
4537
4746
|
command: "push <directory>",
|
|
4538
4747
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
4539
|
-
builder: (
|
|
4748
|
+
builder: (yargs28) => withConfiguration(
|
|
4540
4749
|
withApiOptions(
|
|
4541
4750
|
withProjectOptions(
|
|
4542
4751
|
withDiffOptions(
|
|
4543
|
-
|
|
4752
|
+
yargs28.positional("directory", {
|
|
4544
4753
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
4545
4754
|
type: "string"
|
|
4546
4755
|
}).option("what-if", {
|
|
@@ -4604,10 +4813,10 @@ var EnrichmentRemoveModule = {
|
|
|
4604
4813
|
command: "remove <id>",
|
|
4605
4814
|
aliases: ["delete", "rm"],
|
|
4606
4815
|
describe: "Delete an enrichment category and its values",
|
|
4607
|
-
builder: (
|
|
4816
|
+
builder: (yargs28) => withConfiguration(
|
|
4608
4817
|
withApiOptions(
|
|
4609
4818
|
withProjectOptions(
|
|
4610
|
-
|
|
4819
|
+
yargs28.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
4611
4820
|
)
|
|
4612
4821
|
)
|
|
4613
4822
|
),
|
|
@@ -4623,14 +4832,14 @@ var EnrichmentModule = {
|
|
|
4623
4832
|
command: "enrichment <command>",
|
|
4624
4833
|
aliases: ["enr"],
|
|
4625
4834
|
describe: "Commands for Context enrichments",
|
|
4626
|
-
builder: (
|
|
4835
|
+
builder: (yargs28) => yargs28.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
4627
4836
|
handler: () => {
|
|
4628
|
-
|
|
4837
|
+
yargs13.help();
|
|
4629
4838
|
}
|
|
4630
4839
|
};
|
|
4631
4840
|
|
|
4632
4841
|
// src/commands/context/commands/manifest.ts
|
|
4633
|
-
import
|
|
4842
|
+
import yargs14 from "yargs";
|
|
4634
4843
|
|
|
4635
4844
|
// src/commands/context/commands/manifest/get.ts
|
|
4636
4845
|
import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -4641,10 +4850,10 @@ var ManifestGetModule = {
|
|
|
4641
4850
|
command: "get [output]",
|
|
4642
4851
|
aliases: ["dl", "download"],
|
|
4643
4852
|
describe: "Download the Uniform Context manifest for a project",
|
|
4644
|
-
builder: (
|
|
4853
|
+
builder: (yargs28) => withConfiguration(
|
|
4645
4854
|
withApiOptions(
|
|
4646
4855
|
withProjectOptions(
|
|
4647
|
-
|
|
4856
|
+
yargs28.option("preview", {
|
|
4648
4857
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
4649
4858
|
default: false,
|
|
4650
4859
|
type: "boolean",
|
|
@@ -4706,7 +4915,7 @@ import { exit as exit2 } from "process";
|
|
|
4706
4915
|
var ManifestPublishModule = {
|
|
4707
4916
|
command: "publish",
|
|
4708
4917
|
describe: "Publish the Uniform Context manifest for a project",
|
|
4709
|
-
builder: (
|
|
4918
|
+
builder: (yargs28) => withConfiguration(withApiOptions(withProjectOptions(yargs28))),
|
|
4710
4919
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
4711
4920
|
const fetch3 = nodeFetchProxy(proxy);
|
|
4712
4921
|
try {
|
|
@@ -4739,25 +4948,25 @@ var ManifestModule = {
|
|
|
4739
4948
|
command: "manifest <command>",
|
|
4740
4949
|
describe: "Commands for context manifests",
|
|
4741
4950
|
aliases: ["man"],
|
|
4742
|
-
builder: (
|
|
4951
|
+
builder: (yargs28) => yargs28.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
4743
4952
|
handler: () => {
|
|
4744
|
-
|
|
4953
|
+
yargs14.help();
|
|
4745
4954
|
}
|
|
4746
4955
|
};
|
|
4747
4956
|
|
|
4748
4957
|
// src/commands/context/commands/quirk.ts
|
|
4749
|
-
import
|
|
4958
|
+
import yargs15 from "yargs";
|
|
4750
4959
|
|
|
4751
4960
|
// src/commands/context/commands/quirk/get.ts
|
|
4752
4961
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
4753
4962
|
var QuirkGetModule = {
|
|
4754
4963
|
command: "get <id>",
|
|
4755
4964
|
describe: "Fetch a quirk",
|
|
4756
|
-
builder: (
|
|
4965
|
+
builder: (yargs28) => withConfiguration(
|
|
4757
4966
|
withFormatOptions(
|
|
4758
4967
|
withApiOptions(
|
|
4759
4968
|
withProjectOptions(
|
|
4760
|
-
|
|
4969
|
+
yargs28.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
4761
4970
|
)
|
|
4762
4971
|
)
|
|
4763
4972
|
)
|
|
@@ -4781,11 +4990,11 @@ var QuirkListModule = {
|
|
|
4781
4990
|
command: "list",
|
|
4782
4991
|
describe: "List quirks",
|
|
4783
4992
|
aliases: ["ls"],
|
|
4784
|
-
builder: (
|
|
4993
|
+
builder: (yargs28) => withConfiguration(
|
|
4785
4994
|
withFormatOptions(
|
|
4786
4995
|
withApiOptions(
|
|
4787
4996
|
withProjectOptions(
|
|
4788
|
-
|
|
4997
|
+
yargs28.option("withIntegrations", {
|
|
4789
4998
|
alias: ["i"],
|
|
4790
4999
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
4791
5000
|
type: "boolean"
|
|
@@ -4842,11 +5051,11 @@ function createQuirkEngineDataSource({
|
|
|
4842
5051
|
var QuirkPullModule = {
|
|
4843
5052
|
command: "pull <directory>",
|
|
4844
5053
|
describe: "Pulls all quirks to local files in a directory",
|
|
4845
|
-
builder: (
|
|
5054
|
+
builder: (yargs28) => withConfiguration(
|
|
4846
5055
|
withApiOptions(
|
|
4847
5056
|
withProjectOptions(
|
|
4848
5057
|
withDiffOptions(
|
|
4849
|
-
|
|
5058
|
+
yargs28.positional("directory", {
|
|
4850
5059
|
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.",
|
|
4851
5060
|
type: "string"
|
|
4852
5061
|
}).option("format", {
|
|
@@ -4921,11 +5130,11 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
4921
5130
|
var QuirkPushModule = {
|
|
4922
5131
|
command: "push <directory>",
|
|
4923
5132
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
4924
|
-
builder: (
|
|
5133
|
+
builder: (yargs28) => withConfiguration(
|
|
4925
5134
|
withApiOptions(
|
|
4926
5135
|
withProjectOptions(
|
|
4927
5136
|
withDiffOptions(
|
|
4928
|
-
|
|
5137
|
+
yargs28.positional("directory", {
|
|
4929
5138
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
4930
5139
|
type: "string"
|
|
4931
5140
|
}).option("what-if", {
|
|
@@ -4989,10 +5198,10 @@ var QuirkRemoveModule = {
|
|
|
4989
5198
|
command: "remove <id>",
|
|
4990
5199
|
aliases: ["delete", "rm"],
|
|
4991
5200
|
describe: "Delete a quirk",
|
|
4992
|
-
builder: (
|
|
5201
|
+
builder: (yargs28) => withConfiguration(
|
|
4993
5202
|
withApiOptions(
|
|
4994
5203
|
withProjectOptions(
|
|
4995
|
-
|
|
5204
|
+
yargs28.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
4996
5205
|
)
|
|
4997
5206
|
)
|
|
4998
5207
|
),
|
|
@@ -5009,10 +5218,10 @@ var QuirkUpdateModule = {
|
|
|
5009
5218
|
command: "update <filename>",
|
|
5010
5219
|
aliases: ["put"],
|
|
5011
5220
|
describe: "Insert or update a quirk",
|
|
5012
|
-
builder: (
|
|
5221
|
+
builder: (yargs28) => withConfiguration(
|
|
5013
5222
|
withApiOptions(
|
|
5014
5223
|
withProjectOptions(
|
|
5015
|
-
|
|
5224
|
+
yargs28.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
5016
5225
|
)
|
|
5017
5226
|
)
|
|
5018
5227
|
),
|
|
@@ -5029,25 +5238,25 @@ var QuirkModule = {
|
|
|
5029
5238
|
command: "quirk <command>",
|
|
5030
5239
|
aliases: ["qk"],
|
|
5031
5240
|
describe: "Commands for Context quirks",
|
|
5032
|
-
builder: (
|
|
5241
|
+
builder: (yargs28) => yargs28.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
5033
5242
|
handler: () => {
|
|
5034
|
-
|
|
5243
|
+
yargs15.help();
|
|
5035
5244
|
}
|
|
5036
5245
|
};
|
|
5037
5246
|
|
|
5038
5247
|
// src/commands/context/commands/signal.ts
|
|
5039
|
-
import
|
|
5248
|
+
import yargs16 from "yargs";
|
|
5040
5249
|
|
|
5041
5250
|
// src/commands/context/commands/signal/get.ts
|
|
5042
5251
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
5043
5252
|
var SignalGetModule = {
|
|
5044
5253
|
command: "get <id>",
|
|
5045
5254
|
describe: "Fetch a signal",
|
|
5046
|
-
builder: (
|
|
5255
|
+
builder: (yargs28) => withConfiguration(
|
|
5047
5256
|
withFormatOptions(
|
|
5048
5257
|
withApiOptions(
|
|
5049
5258
|
withProjectOptions(
|
|
5050
|
-
|
|
5259
|
+
yargs28.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
5051
5260
|
)
|
|
5052
5261
|
)
|
|
5053
5262
|
)
|
|
@@ -5071,7 +5280,7 @@ var SignalListModule = {
|
|
|
5071
5280
|
command: "list",
|
|
5072
5281
|
describe: "List signals",
|
|
5073
5282
|
aliases: ["ls"],
|
|
5074
|
-
builder: (
|
|
5283
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
5075
5284
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5076
5285
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5077
5286
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5120,11 +5329,11 @@ function createSignalEngineDataSource({
|
|
|
5120
5329
|
var SignalPullModule = {
|
|
5121
5330
|
command: "pull <directory>",
|
|
5122
5331
|
describe: "Pulls all signals to local files in a directory",
|
|
5123
|
-
builder: (
|
|
5332
|
+
builder: (yargs28) => withConfiguration(
|
|
5124
5333
|
withApiOptions(
|
|
5125
5334
|
withProjectOptions(
|
|
5126
5335
|
withDiffOptions(
|
|
5127
|
-
|
|
5336
|
+
yargs28.positional("directory", {
|
|
5128
5337
|
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.",
|
|
5129
5338
|
type: "string"
|
|
5130
5339
|
}).option("format", {
|
|
@@ -5199,11 +5408,11 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
5199
5408
|
var SignalPushModule = {
|
|
5200
5409
|
command: "push <directory>",
|
|
5201
5410
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
5202
|
-
builder: (
|
|
5411
|
+
builder: (yargs28) => withConfiguration(
|
|
5203
5412
|
withApiOptions(
|
|
5204
5413
|
withProjectOptions(
|
|
5205
5414
|
withDiffOptions(
|
|
5206
|
-
|
|
5415
|
+
yargs28.positional("directory", {
|
|
5207
5416
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
5208
5417
|
type: "string"
|
|
5209
5418
|
}).option("what-if", {
|
|
@@ -5267,10 +5476,10 @@ var SignalRemoveModule = {
|
|
|
5267
5476
|
command: "remove <id>",
|
|
5268
5477
|
aliases: ["delete", "rm"],
|
|
5269
5478
|
describe: "Delete a signal",
|
|
5270
|
-
builder: (
|
|
5479
|
+
builder: (yargs28) => withConfiguration(
|
|
5271
5480
|
withApiOptions(
|
|
5272
5481
|
withProjectOptions(
|
|
5273
|
-
|
|
5482
|
+
yargs28.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
5274
5483
|
)
|
|
5275
5484
|
)
|
|
5276
5485
|
),
|
|
@@ -5287,10 +5496,10 @@ var SignalUpdateModule = {
|
|
|
5287
5496
|
command: "update <filename>",
|
|
5288
5497
|
aliases: ["put"],
|
|
5289
5498
|
describe: "Insert or update a signal",
|
|
5290
|
-
builder: (
|
|
5499
|
+
builder: (yargs28) => withConfiguration(
|
|
5291
5500
|
withApiOptions(
|
|
5292
5501
|
withProjectOptions(
|
|
5293
|
-
|
|
5502
|
+
yargs28.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
5294
5503
|
)
|
|
5295
5504
|
)
|
|
5296
5505
|
),
|
|
@@ -5307,25 +5516,25 @@ var SignalModule = {
|
|
|
5307
5516
|
command: "signal <command>",
|
|
5308
5517
|
aliases: ["sig"],
|
|
5309
5518
|
describe: "Commands for Context signals",
|
|
5310
|
-
builder: (
|
|
5519
|
+
builder: (yargs28) => yargs28.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
5311
5520
|
handler: () => {
|
|
5312
|
-
|
|
5521
|
+
yargs16.help();
|
|
5313
5522
|
}
|
|
5314
5523
|
};
|
|
5315
5524
|
|
|
5316
5525
|
// src/commands/context/commands/test.ts
|
|
5317
|
-
import
|
|
5526
|
+
import yargs17 from "yargs";
|
|
5318
5527
|
|
|
5319
5528
|
// src/commands/context/commands/test/get.ts
|
|
5320
5529
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
5321
5530
|
var TestGetModule = {
|
|
5322
5531
|
command: "get <id>",
|
|
5323
5532
|
describe: "Fetch a test",
|
|
5324
|
-
builder: (
|
|
5533
|
+
builder: (yargs28) => withConfiguration(
|
|
5325
5534
|
withFormatOptions(
|
|
5326
5535
|
withApiOptions(
|
|
5327
5536
|
withProjectOptions(
|
|
5328
|
-
|
|
5537
|
+
yargs28.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
5329
5538
|
)
|
|
5330
5539
|
)
|
|
5331
5540
|
)
|
|
@@ -5349,7 +5558,7 @@ var TestListModule = {
|
|
|
5349
5558
|
command: "list",
|
|
5350
5559
|
describe: "List tests",
|
|
5351
5560
|
aliases: ["ls"],
|
|
5352
|
-
builder: (
|
|
5561
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
5353
5562
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
5354
5563
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5355
5564
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -5398,11 +5607,11 @@ function createTestEngineDataSource({
|
|
|
5398
5607
|
var TestPullModule = {
|
|
5399
5608
|
command: "pull <directory>",
|
|
5400
5609
|
describe: "Pulls all tests to local files in a directory",
|
|
5401
|
-
builder: (
|
|
5610
|
+
builder: (yargs28) => withConfiguration(
|
|
5402
5611
|
withApiOptions(
|
|
5403
5612
|
withProjectOptions(
|
|
5404
5613
|
withDiffOptions(
|
|
5405
|
-
|
|
5614
|
+
yargs28.positional("directory", {
|
|
5406
5615
|
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.",
|
|
5407
5616
|
type: "string"
|
|
5408
5617
|
}).option("format", {
|
|
@@ -5477,11 +5686,11 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
5477
5686
|
var TestPushModule = {
|
|
5478
5687
|
command: "push <directory>",
|
|
5479
5688
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
5480
|
-
builder: (
|
|
5689
|
+
builder: (yargs28) => withConfiguration(
|
|
5481
5690
|
withApiOptions(
|
|
5482
5691
|
withProjectOptions(
|
|
5483
5692
|
withDiffOptions(
|
|
5484
|
-
|
|
5693
|
+
yargs28.positional("directory", {
|
|
5485
5694
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
5486
5695
|
type: "string"
|
|
5487
5696
|
}).option("what-if", {
|
|
@@ -5545,10 +5754,10 @@ var TestRemoveModule = {
|
|
|
5545
5754
|
command: "remove <id>",
|
|
5546
5755
|
aliases: ["delete", "rm"],
|
|
5547
5756
|
describe: "Delete a test",
|
|
5548
|
-
builder: (
|
|
5757
|
+
builder: (yargs28) => withConfiguration(
|
|
5549
5758
|
withApiOptions(
|
|
5550
5759
|
withProjectOptions(
|
|
5551
|
-
|
|
5760
|
+
yargs28.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
5552
5761
|
)
|
|
5553
5762
|
)
|
|
5554
5763
|
),
|
|
@@ -5565,9 +5774,9 @@ var TestUpdateModule = {
|
|
|
5565
5774
|
command: "update <filename>",
|
|
5566
5775
|
aliases: ["put"],
|
|
5567
5776
|
describe: "Insert or update a test",
|
|
5568
|
-
builder: (
|
|
5777
|
+
builder: (yargs28) => withConfiguration(
|
|
5569
5778
|
withApiOptions(
|
|
5570
|
-
withProjectOptions(
|
|
5779
|
+
withProjectOptions(yargs28.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
5571
5780
|
)
|
|
5572
5781
|
),
|
|
5573
5782
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -5582,9 +5791,9 @@ var TestUpdateModule = {
|
|
|
5582
5791
|
var TestModule = {
|
|
5583
5792
|
command: "test <command>",
|
|
5584
5793
|
describe: "Commands for Context A/B tests",
|
|
5585
|
-
builder: (
|
|
5794
|
+
builder: (yargs28) => yargs28.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
5586
5795
|
handler: () => {
|
|
5587
|
-
|
|
5796
|
+
yargs17.help();
|
|
5588
5797
|
}
|
|
5589
5798
|
};
|
|
5590
5799
|
|
|
@@ -5593,9 +5802,9 @@ var ContextCommand = {
|
|
|
5593
5802
|
command: "context <command>",
|
|
5594
5803
|
aliases: ["ctx"],
|
|
5595
5804
|
describe: "Uniform Context commands",
|
|
5596
|
-
builder: (
|
|
5805
|
+
builder: (yargs28) => yargs28.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
5597
5806
|
handler: () => {
|
|
5598
|
-
|
|
5807
|
+
yargs18.showHelp();
|
|
5599
5808
|
}
|
|
5600
5809
|
};
|
|
5601
5810
|
|
|
@@ -5623,7 +5832,7 @@ import { PostHog } from "posthog-node";
|
|
|
5623
5832
|
// package.json
|
|
5624
5833
|
var package_default = {
|
|
5625
5834
|
name: "@uniformdev/cli",
|
|
5626
|
-
version: "19.
|
|
5835
|
+
version: "19.90.0",
|
|
5627
5836
|
description: "Uniform command line interface tool",
|
|
5628
5837
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
5629
5838
|
main: "./cli.js",
|
|
@@ -5680,7 +5889,7 @@ var package_default = {
|
|
|
5680
5889
|
"@types/js-yaml": "4.0.9",
|
|
5681
5890
|
"@types/jsonwebtoken": "9.0.5",
|
|
5682
5891
|
"@types/lodash.isequalwith": "4.4.9",
|
|
5683
|
-
"@types/node": "18.19.
|
|
5892
|
+
"@types/node": "18.19.3",
|
|
5684
5893
|
"@types/yargs": "17.0.32"
|
|
5685
5894
|
},
|
|
5686
5895
|
bin: {
|
|
@@ -6633,10 +6842,10 @@ var NewMeshCmd = {
|
|
|
6633
6842
|
};
|
|
6634
6843
|
|
|
6635
6844
|
// src/commands/optimize/index.ts
|
|
6636
|
-
import
|
|
6845
|
+
import yargs20 from "yargs";
|
|
6637
6846
|
|
|
6638
6847
|
// src/commands/optimize/manifest.ts
|
|
6639
|
-
import
|
|
6848
|
+
import yargs19 from "yargs";
|
|
6640
6849
|
|
|
6641
6850
|
// src/commands/optimize/manifest/download.ts
|
|
6642
6851
|
import { gray as gray4, green as green3, red as red5, yellow as yellow2 } from "colorette";
|
|
@@ -6651,7 +6860,7 @@ var UniformBaseUrl = "https://uniform.app";
|
|
|
6651
6860
|
var module = {
|
|
6652
6861
|
command: "download [output]",
|
|
6653
6862
|
describe: "Download intent manifest",
|
|
6654
|
-
builder: (
|
|
6863
|
+
builder: (yargs28) => yargs28.option("apiKey", {
|
|
6655
6864
|
alias: "k",
|
|
6656
6865
|
demandOption: true,
|
|
6657
6866
|
string: true,
|
|
@@ -6752,10 +6961,10 @@ var module2 = {
|
|
|
6752
6961
|
command: "manifest <command>",
|
|
6753
6962
|
describe: "Intent manifest commands",
|
|
6754
6963
|
builder: () => {
|
|
6755
|
-
return
|
|
6964
|
+
return yargs19.command(download_default);
|
|
6756
6965
|
},
|
|
6757
6966
|
handler: () => {
|
|
6758
|
-
|
|
6967
|
+
yargs19.showHelp();
|
|
6759
6968
|
}
|
|
6760
6969
|
};
|
|
6761
6970
|
var manifest_default = module2;
|
|
@@ -6766,29 +6975,29 @@ var OptimizeCommand = {
|
|
|
6766
6975
|
aliases: ["opt"],
|
|
6767
6976
|
describe: "Uniform Optimize commands",
|
|
6768
6977
|
builder: () => {
|
|
6769
|
-
return
|
|
6978
|
+
return yargs20.command(manifest_default);
|
|
6770
6979
|
},
|
|
6771
6980
|
handler: () => {
|
|
6772
|
-
|
|
6981
|
+
yargs20.showHelp();
|
|
6773
6982
|
}
|
|
6774
6983
|
};
|
|
6775
6984
|
|
|
6776
6985
|
// src/commands/project-map/index.ts
|
|
6777
|
-
import
|
|
6986
|
+
import yargs23 from "yargs";
|
|
6778
6987
|
|
|
6779
6988
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
6780
|
-
import
|
|
6989
|
+
import yargs21 from "yargs";
|
|
6781
6990
|
|
|
6782
6991
|
// src/commands/project-map/commands/ProjectMapDefinition/get.ts
|
|
6783
6992
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
6784
6993
|
var ProjectMapDefinitionGetModule = {
|
|
6785
6994
|
command: "get <id>",
|
|
6786
6995
|
describe: "Fetch a project map",
|
|
6787
|
-
builder: (
|
|
6996
|
+
builder: (yargs28) => withFormatOptions(
|
|
6788
6997
|
withConfiguration(
|
|
6789
6998
|
withApiOptions(
|
|
6790
6999
|
withProjectOptions(
|
|
6791
|
-
|
|
7000
|
+
yargs28.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
6792
7001
|
)
|
|
6793
7002
|
)
|
|
6794
7003
|
)
|
|
@@ -6812,7 +7021,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
6812
7021
|
command: "list",
|
|
6813
7022
|
describe: "List of project maps",
|
|
6814
7023
|
aliases: ["ls"],
|
|
6815
|
-
builder: (
|
|
7024
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
6816
7025
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
6817
7026
|
const fetch3 = nodeFetchProxy(proxy);
|
|
6818
7027
|
const client = new UncachedProjectMapClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -6869,11 +7078,11 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
6869
7078
|
var ProjectMapDefinitionPullModule = {
|
|
6870
7079
|
command: "pull <directory>",
|
|
6871
7080
|
describe: "Pulls all project maps to local files in a directory",
|
|
6872
|
-
builder: (
|
|
7081
|
+
builder: (yargs28) => withConfiguration(
|
|
6873
7082
|
withApiOptions(
|
|
6874
7083
|
withProjectOptions(
|
|
6875
7084
|
withDiffOptions(
|
|
6876
|
-
|
|
7085
|
+
yargs28.positional("directory", {
|
|
6877
7086
|
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.",
|
|
6878
7087
|
type: "string"
|
|
6879
7088
|
}).option("format", {
|
|
@@ -6949,11 +7158,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient4 } from "@uniformd
|
|
|
6949
7158
|
var ProjectMapDefinitionPushModule = {
|
|
6950
7159
|
command: "push <directory>",
|
|
6951
7160
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
6952
|
-
builder: (
|
|
7161
|
+
builder: (yargs28) => withConfiguration(
|
|
6953
7162
|
withApiOptions(
|
|
6954
7163
|
withProjectOptions(
|
|
6955
7164
|
withDiffOptions(
|
|
6956
|
-
|
|
7165
|
+
yargs28.positional("directory", {
|
|
6957
7166
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
6958
7167
|
type: "string"
|
|
6959
7168
|
}).option("what-if", {
|
|
@@ -7017,9 +7226,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
7017
7226
|
command: "remove <id>",
|
|
7018
7227
|
aliases: ["delete", "rm"],
|
|
7019
7228
|
describe: "Delete a project map",
|
|
7020
|
-
builder: (
|
|
7229
|
+
builder: (yargs28) => withConfiguration(
|
|
7021
7230
|
withApiOptions(
|
|
7022
|
-
withProjectOptions(
|
|
7231
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
7023
7232
|
)
|
|
7024
7233
|
),
|
|
7025
7234
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -7035,10 +7244,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
7035
7244
|
command: "update <filename>",
|
|
7036
7245
|
aliases: ["put"],
|
|
7037
7246
|
describe: "Insert or update a project map",
|
|
7038
|
-
builder: (
|
|
7247
|
+
builder: (yargs28) => withConfiguration(
|
|
7039
7248
|
withApiOptions(
|
|
7040
7249
|
withProjectOptions(
|
|
7041
|
-
|
|
7250
|
+
yargs28.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
7042
7251
|
)
|
|
7043
7252
|
)
|
|
7044
7253
|
),
|
|
@@ -7054,25 +7263,25 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
7054
7263
|
var ProjectMapDefinitionModule = {
|
|
7055
7264
|
command: "definition <command>",
|
|
7056
7265
|
describe: "Commands for ProjectMap Definitions",
|
|
7057
|
-
builder: (
|
|
7266
|
+
builder: (yargs28) => yargs28.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
7058
7267
|
handler: () => {
|
|
7059
|
-
|
|
7268
|
+
yargs21.help();
|
|
7060
7269
|
}
|
|
7061
7270
|
};
|
|
7062
7271
|
|
|
7063
7272
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
7064
|
-
import
|
|
7273
|
+
import yargs22 from "yargs";
|
|
7065
7274
|
|
|
7066
7275
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
7067
7276
|
import { UncachedProjectMapClient as UncachedProjectMapClient7 } from "@uniformdev/project-map";
|
|
7068
7277
|
var ProjectMapNodeGetModule = {
|
|
7069
7278
|
command: "get <id> <projectMapId>",
|
|
7070
7279
|
describe: "Fetch a project map node",
|
|
7071
|
-
builder: (
|
|
7280
|
+
builder: (yargs28) => withConfiguration(
|
|
7072
7281
|
withFormatOptions(
|
|
7073
7282
|
withApiOptions(
|
|
7074
7283
|
withProjectOptions(
|
|
7075
|
-
|
|
7284
|
+
yargs28.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
7076
7285
|
)
|
|
7077
7286
|
)
|
|
7078
7287
|
)
|
|
@@ -7098,11 +7307,11 @@ var ProjectMapNodeListModule = {
|
|
|
7098
7307
|
command: "list <projectMapId>",
|
|
7099
7308
|
describe: "List project map nodes",
|
|
7100
7309
|
aliases: ["ls"],
|
|
7101
|
-
builder: (
|
|
7310
|
+
builder: (yargs28) => withConfiguration(
|
|
7102
7311
|
withFormatOptions(
|
|
7103
7312
|
withApiOptions(
|
|
7104
7313
|
withProjectOptions(
|
|
7105
|
-
|
|
7314
|
+
yargs28.positional("projectMapId", {
|
|
7106
7315
|
demandOption: true,
|
|
7107
7316
|
describe: "ProjectMap UUID to fetch from"
|
|
7108
7317
|
})
|
|
@@ -7173,11 +7382,11 @@ function createProjectMapNodeEngineDataSource({
|
|
|
7173
7382
|
var ProjectMapNodePullModule = {
|
|
7174
7383
|
command: "pull <directory>",
|
|
7175
7384
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
7176
|
-
builder: (
|
|
7385
|
+
builder: (yargs28) => withConfiguration(
|
|
7177
7386
|
withApiOptions(
|
|
7178
7387
|
withProjectOptions(
|
|
7179
7388
|
withDiffOptions(
|
|
7180
|
-
|
|
7389
|
+
yargs28.positional("directory", {
|
|
7181
7390
|
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.",
|
|
7182
7391
|
type: "string"
|
|
7183
7392
|
}).option("format", {
|
|
@@ -7257,11 +7466,11 @@ import { UncachedProjectMapClient as UncachedProjectMapClient10 } from "@uniform
|
|
|
7257
7466
|
var ProjectMapNodePushModule = {
|
|
7258
7467
|
command: "push <directory>",
|
|
7259
7468
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
7260
|
-
builder: (
|
|
7469
|
+
builder: (yargs28) => withConfiguration(
|
|
7261
7470
|
withApiOptions(
|
|
7262
7471
|
withProjectOptions(
|
|
7263
7472
|
withDiffOptions(
|
|
7264
|
-
|
|
7473
|
+
yargs28.positional("directory", {
|
|
7265
7474
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
7266
7475
|
type: "string"
|
|
7267
7476
|
}).option("what-if", {
|
|
@@ -7334,10 +7543,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
7334
7543
|
command: "remove <id> <projectMapId>",
|
|
7335
7544
|
aliases: ["delete", "rm"],
|
|
7336
7545
|
describe: "Delete a project map node",
|
|
7337
|
-
builder: (
|
|
7546
|
+
builder: (yargs28) => withConfiguration(
|
|
7338
7547
|
withApiOptions(
|
|
7339
7548
|
withProjectOptions(
|
|
7340
|
-
|
|
7549
|
+
yargs28.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
7341
7550
|
)
|
|
7342
7551
|
)
|
|
7343
7552
|
),
|
|
@@ -7354,10 +7563,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
7354
7563
|
command: "update <filename> <projectMapId>",
|
|
7355
7564
|
aliases: ["put"],
|
|
7356
7565
|
describe: "Insert or update a project map node",
|
|
7357
|
-
builder: (
|
|
7566
|
+
builder: (yargs28) => withConfiguration(
|
|
7358
7567
|
withApiOptions(
|
|
7359
7568
|
withProjectOptions(
|
|
7360
|
-
|
|
7569
|
+
yargs28.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
7361
7570
|
)
|
|
7362
7571
|
)
|
|
7363
7572
|
),
|
|
@@ -7373,9 +7582,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
7373
7582
|
var ProjectMapNodeModule = {
|
|
7374
7583
|
command: "node <command>",
|
|
7375
7584
|
describe: "Commands for ProjectMap Nodes",
|
|
7376
|
-
builder: (
|
|
7585
|
+
builder: (yargs28) => yargs28.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
7377
7586
|
handler: () => {
|
|
7378
|
-
|
|
7587
|
+
yargs22.help();
|
|
7379
7588
|
}
|
|
7380
7589
|
};
|
|
7381
7590
|
|
|
@@ -7384,28 +7593,28 @@ var ProjectMapCommand = {
|
|
|
7384
7593
|
command: "project-map <command>",
|
|
7385
7594
|
aliases: ["prm"],
|
|
7386
7595
|
describe: "Uniform ProjectMap commands",
|
|
7387
|
-
builder: (
|
|
7596
|
+
builder: (yargs28) => yargs28.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
7388
7597
|
handler: () => {
|
|
7389
|
-
|
|
7598
|
+
yargs23.showHelp();
|
|
7390
7599
|
}
|
|
7391
7600
|
};
|
|
7392
7601
|
|
|
7393
7602
|
// src/commands/redirect/index.ts
|
|
7394
|
-
import
|
|
7603
|
+
import yargs25 from "yargs";
|
|
7395
7604
|
|
|
7396
7605
|
// src/commands/redirect/commands/redirect.ts
|
|
7397
|
-
import
|
|
7606
|
+
import yargs24 from "yargs";
|
|
7398
7607
|
|
|
7399
7608
|
// src/commands/redirect/commands/RedirectDefinition/get.ts
|
|
7400
7609
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
7401
7610
|
var RedirectDefinitionGetModule = {
|
|
7402
7611
|
command: "get <id>",
|
|
7403
7612
|
describe: "Fetch a redirect",
|
|
7404
|
-
builder: (
|
|
7613
|
+
builder: (yargs28) => withConfiguration(
|
|
7405
7614
|
withFormatOptions(
|
|
7406
7615
|
withApiOptions(
|
|
7407
7616
|
withProjectOptions(
|
|
7408
|
-
|
|
7617
|
+
yargs28.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
7409
7618
|
)
|
|
7410
7619
|
)
|
|
7411
7620
|
)
|
|
@@ -7429,7 +7638,7 @@ var RedirectDefinitionListModule = {
|
|
|
7429
7638
|
command: "list",
|
|
7430
7639
|
describe: "List of redirects",
|
|
7431
7640
|
aliases: ["ls"],
|
|
7432
|
-
builder: (
|
|
7641
|
+
builder: (yargs28) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs28)))),
|
|
7433
7642
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
7434
7643
|
const fetch3 = nodeFetchProxy(proxy);
|
|
7435
7644
|
const client = new UncachedRedirectClient2({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
@@ -7495,11 +7704,11 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
7495
7704
|
var RedirectDefinitionPullModule = {
|
|
7496
7705
|
command: "pull <directory>",
|
|
7497
7706
|
describe: "Pulls all redirects to local files in a directory",
|
|
7498
|
-
builder: (
|
|
7707
|
+
builder: (yargs28) => withConfiguration(
|
|
7499
7708
|
withApiOptions(
|
|
7500
7709
|
withProjectOptions(
|
|
7501
7710
|
withDiffOptions(
|
|
7502
|
-
|
|
7711
|
+
yargs28.positional("directory", {
|
|
7503
7712
|
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.",
|
|
7504
7713
|
type: "string"
|
|
7505
7714
|
}).option("format", {
|
|
@@ -7576,11 +7785,11 @@ import { UncachedRedirectClient as UncachedRedirectClient4 } from "@uniformdev/r
|
|
|
7576
7785
|
var RedirectDefinitionPushModule = {
|
|
7577
7786
|
command: "push <directory>",
|
|
7578
7787
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
7579
|
-
builder: (
|
|
7788
|
+
builder: (yargs28) => withConfiguration(
|
|
7580
7789
|
withApiOptions(
|
|
7581
7790
|
withProjectOptions(
|
|
7582
7791
|
withDiffOptions(
|
|
7583
|
-
|
|
7792
|
+
yargs28.positional("directory", {
|
|
7584
7793
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
7585
7794
|
type: "string"
|
|
7586
7795
|
}).option("what-if", {
|
|
@@ -7644,9 +7853,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
7644
7853
|
command: "remove <id>",
|
|
7645
7854
|
aliases: ["delete", "rm"],
|
|
7646
7855
|
describe: "Delete a redirect",
|
|
7647
|
-
builder: (
|
|
7856
|
+
builder: (yargs28) => withConfiguration(
|
|
7648
7857
|
withApiOptions(
|
|
7649
|
-
withProjectOptions(
|
|
7858
|
+
withProjectOptions(yargs28.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
7650
7859
|
)
|
|
7651
7860
|
),
|
|
7652
7861
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -7662,10 +7871,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
7662
7871
|
command: "update <filename>",
|
|
7663
7872
|
aliases: ["put"],
|
|
7664
7873
|
describe: "Insert or update a redirect",
|
|
7665
|
-
builder: (
|
|
7874
|
+
builder: (yargs28) => withConfiguration(
|
|
7666
7875
|
withApiOptions(
|
|
7667
7876
|
withProjectOptions(
|
|
7668
|
-
|
|
7877
|
+
yargs28.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
7669
7878
|
)
|
|
7670
7879
|
)
|
|
7671
7880
|
),
|
|
@@ -7681,9 +7890,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
7681
7890
|
var RedirectDefinitionModule = {
|
|
7682
7891
|
command: "definition <command>",
|
|
7683
7892
|
describe: "Commands for Redirect Definitions",
|
|
7684
|
-
builder: (
|
|
7893
|
+
builder: (yargs28) => yargs28.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
7685
7894
|
handler: () => {
|
|
7686
|
-
|
|
7895
|
+
yargs24.help();
|
|
7687
7896
|
}
|
|
7688
7897
|
};
|
|
7689
7898
|
|
|
@@ -7692,14 +7901,14 @@ var RedirectCommand = {
|
|
|
7692
7901
|
command: "redirect <command>",
|
|
7693
7902
|
aliases: ["red"],
|
|
7694
7903
|
describe: "Uniform Redirect commands",
|
|
7695
|
-
builder: (
|
|
7904
|
+
builder: (yargs28) => yargs28.command(RedirectDefinitionModule).demandCommand(),
|
|
7696
7905
|
handler: () => {
|
|
7697
|
-
|
|
7906
|
+
yargs25.showHelp();
|
|
7698
7907
|
}
|
|
7699
7908
|
};
|
|
7700
7909
|
|
|
7701
7910
|
// src/commands/sync/index.ts
|
|
7702
|
-
import
|
|
7911
|
+
import yargs26 from "yargs";
|
|
7703
7912
|
|
|
7704
7913
|
// src/commands/sync/commands/util.ts
|
|
7705
7914
|
import ora2 from "ora";
|
|
@@ -7732,11 +7941,11 @@ function spin(entityType) {
|
|
|
7732
7941
|
var SyncPullModule = {
|
|
7733
7942
|
command: "pull",
|
|
7734
7943
|
describe: "Pulls whole project to local files in a directory",
|
|
7735
|
-
builder: (
|
|
7944
|
+
builder: (yargs28) => withConfiguration(
|
|
7736
7945
|
withApiOptions(
|
|
7737
7946
|
withProjectOptions(
|
|
7738
7947
|
withDiffOptions(
|
|
7739
|
-
|
|
7948
|
+
yargs28.option("what-if", {
|
|
7740
7949
|
alias: ["w"],
|
|
7741
7950
|
describe: "What-if mode reports what would be done but changes no files",
|
|
7742
7951
|
default: false,
|
|
@@ -7750,6 +7959,7 @@ var SyncPullModule = {
|
|
|
7750
7959
|
var _a;
|
|
7751
7960
|
const config2 = serialization;
|
|
7752
7961
|
const enabledEntities = Object.entries({
|
|
7962
|
+
locale: LocalePullModule,
|
|
7753
7963
|
asset: AssetPullModule,
|
|
7754
7964
|
category: CategoryPullModule,
|
|
7755
7965
|
dataType: DataTypePullModule,
|
|
@@ -7828,11 +8038,11 @@ var getFormat = (entityType, config2) => {
|
|
|
7828
8038
|
var SyncPushModule = {
|
|
7829
8039
|
command: "push",
|
|
7830
8040
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
7831
|
-
builder: (
|
|
8041
|
+
builder: (yargs28) => withConfiguration(
|
|
7832
8042
|
withApiOptions(
|
|
7833
8043
|
withProjectOptions(
|
|
7834
8044
|
withDiffOptions(
|
|
7835
|
-
|
|
8045
|
+
yargs28.option("what-if", {
|
|
7836
8046
|
alias: ["w"],
|
|
7837
8047
|
describe: "What-if mode reports what would be done but changes nothing",
|
|
7838
8048
|
default: false,
|
|
@@ -7846,6 +8056,7 @@ var SyncPushModule = {
|
|
|
7846
8056
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
7847
8057
|
const config2 = serialization;
|
|
7848
8058
|
const enabledEntities = Object.entries({
|
|
8059
|
+
locale: LocalePushModule,
|
|
7849
8060
|
asset: AssetPushModule,
|
|
7850
8061
|
category: CategoryPushModule,
|
|
7851
8062
|
dataType: DataTypePushModule,
|
|
@@ -7926,9 +8137,9 @@ var getFormat2 = (entityType, config2) => {
|
|
|
7926
8137
|
var SyncCommand = {
|
|
7927
8138
|
command: "sync <command>",
|
|
7928
8139
|
describe: "Uniform Sync commands",
|
|
7929
|
-
builder: (
|
|
8140
|
+
builder: (yargs28) => yargs28.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
7930
8141
|
handler: () => {
|
|
7931
|
-
|
|
8142
|
+
yargs26.showHelp();
|
|
7932
8143
|
}
|
|
7933
8144
|
};
|
|
7934
8145
|
|
|
@@ -8194,7 +8405,7 @@ First found was: v${firstVersion}`;
|
|
|
8194
8405
|
|
|
8195
8406
|
// src/index.ts
|
|
8196
8407
|
dotenv.config();
|
|
8197
|
-
var yarggery =
|
|
8408
|
+
var yarggery = yargs27(hideBin(process.argv));
|
|
8198
8409
|
var inlineConfigurationFilePath = "config" in yarggery.argv && yarggery.argv.config;
|
|
8199
8410
|
var configuration = loadConfig(inlineConfigurationFilePath || null);
|
|
8200
8411
|
yarggery.option("verbose", {
|