@uniformdev/cli 20.80.1-alpha.3.sha-c8bbceae2b → 20.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
withFormatOptions,
|
|
26
26
|
withProjectOptions,
|
|
27
27
|
withTeamOptions
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-U4K2JTQL.mjs";
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
import * as dotenv from "dotenv";
|
|
32
|
-
import
|
|
32
|
+
import yargs44 from "yargs";
|
|
33
33
|
import { hideBin } from "yargs/helpers";
|
|
34
34
|
|
|
35
35
|
// src/commands/ai/index.ts
|
|
@@ -521,20 +521,20 @@ var makeSpinner = () => {
|
|
|
521
521
|
async function createArraySyncEngineDataSource({
|
|
522
522
|
name,
|
|
523
523
|
objects,
|
|
524
|
-
selectIdentifier:
|
|
525
|
-
selectDisplayName:
|
|
524
|
+
selectIdentifier: selectIdentifier19,
|
|
525
|
+
selectDisplayName: selectDisplayName19 = selectIdentifier19,
|
|
526
526
|
onSyncComplete,
|
|
527
527
|
onBeforeDeleteObject
|
|
528
528
|
}) {
|
|
529
529
|
const objectIndex = objects.reduce(
|
|
530
530
|
(result, current) => {
|
|
531
|
-
const rawIdentifiers =
|
|
531
|
+
const rawIdentifiers = selectIdentifier19(current);
|
|
532
532
|
const identifiers = Array.isArray(rawIdentifiers) ? rawIdentifiers : [rawIdentifiers];
|
|
533
533
|
const existingResult = identifiers.find((id) => result[id]);
|
|
534
534
|
if (existingResult) {
|
|
535
535
|
throw new Error(`Identifier(s) ${identifiers} was not unique.`);
|
|
536
536
|
}
|
|
537
|
-
const displayName =
|
|
537
|
+
const displayName = selectDisplayName19(current);
|
|
538
538
|
result[identifiers[0]] = {
|
|
539
539
|
id: identifiers,
|
|
540
540
|
object: current,
|
|
@@ -564,7 +564,7 @@ async function createArraySyncEngineDataSource({
|
|
|
564
564
|
delete objectIndex[providerId];
|
|
565
565
|
},
|
|
566
566
|
writeObject: async (objectToWrite) => {
|
|
567
|
-
const id =
|
|
567
|
+
const id = selectIdentifier19(objectToWrite.object);
|
|
568
568
|
if (Array.isArray(id)) {
|
|
569
569
|
objectIndex[id[0]] = objectToWrite;
|
|
570
570
|
} else {
|
|
@@ -647,8 +647,8 @@ function isErrorWithCode(error, code) {
|
|
|
647
647
|
async function createFileSyncEngineDataSource({
|
|
648
648
|
directory,
|
|
649
649
|
format = "yaml",
|
|
650
|
-
selectIdentifier:
|
|
651
|
-
selectDisplayName:
|
|
650
|
+
selectIdentifier: selectIdentifier19,
|
|
651
|
+
selectDisplayName: selectDisplayName19 = selectIdentifier19,
|
|
652
652
|
selectFilename: selectFilename3,
|
|
653
653
|
selectSchemaUrl: selectSchemaUrl2,
|
|
654
654
|
onBeforeDeleteObject,
|
|
@@ -677,9 +677,9 @@ async function createFileSyncEngineDataSource({
|
|
|
677
677
|
const fullFilename = join(directory, filename);
|
|
678
678
|
try {
|
|
679
679
|
const contents = readFileToObject(fullFilename);
|
|
680
|
-
const displayName =
|
|
680
|
+
const displayName = selectDisplayName19(contents);
|
|
681
681
|
const object4 = {
|
|
682
|
-
id:
|
|
682
|
+
id: selectIdentifier19(contents),
|
|
683
683
|
displayName: Array.isArray(displayName) ? displayName[0] : displayName,
|
|
684
684
|
providerId: fullFilename,
|
|
685
685
|
object: omit(contents, ["$schema"])
|
|
@@ -1205,7 +1205,8 @@ async function fetchMemberProfile({
|
|
|
1205
1205
|
}
|
|
1206
1206
|
var getUserInfo = async (baseUrl, authToken) => {
|
|
1207
1207
|
try {
|
|
1208
|
-
const
|
|
1208
|
+
const cliFetch = (input3, init) => fetch(input3, { ...init, headers: { ...init?.headers, "User-Agent": CLI_USER_AGENT } });
|
|
1209
|
+
const projectClient = new ProjectClient({ apiHost: baseUrl, bearerToken: authToken, fetch: cliFetch });
|
|
1209
1210
|
const [profile, projectsRes] = await Promise.all([
|
|
1210
1211
|
fetchMemberProfile({ baseUrl, bearerToken: authToken }),
|
|
1211
1212
|
projectClient.list()
|
|
@@ -1241,13 +1242,13 @@ async function fetchUserAndEnsureFirstTeamExists({
|
|
|
1241
1242
|
}
|
|
1242
1243
|
|
|
1243
1244
|
// src/telemetry/telemetry.ts
|
|
1244
|
-
import
|
|
1245
|
+
import crypto2 from "crypto";
|
|
1245
1246
|
import { PostHog } from "posthog-node";
|
|
1246
1247
|
var POSTHOG_WRITE_ONLY_KEY = "phc_c8YoKI9984KOHBfNrCRfIKvL56aYd5OpYxOdYexRzH7";
|
|
1247
1248
|
var Telemetry = class {
|
|
1248
1249
|
constructor(prefix, disable = false) {
|
|
1249
1250
|
this.prefix = prefix;
|
|
1250
|
-
this.distinctId =
|
|
1251
|
+
this.distinctId = crypto2.randomBytes(20).toString("hex");
|
|
1251
1252
|
if (!disable) {
|
|
1252
1253
|
this.posthog = new PostHog(POSTHOG_WRITE_ONLY_KEY, {
|
|
1253
1254
|
flushAt: 1,
|
|
@@ -1438,8 +1439,8 @@ function getExistingServers(config2) {
|
|
|
1438
1439
|
var InstallMcpCommand = {
|
|
1439
1440
|
command: "install",
|
|
1440
1441
|
describe: "Install Uniform MCP server configuration (use --team, --project, and --apiKey for non-interactive mode)",
|
|
1441
|
-
builder: (
|
|
1442
|
-
|
|
1442
|
+
builder: (yargs45) => withConfiguration(
|
|
1443
|
+
yargs45.option("agent", {
|
|
1443
1444
|
alias: "a",
|
|
1444
1445
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
1445
1446
|
type: "string",
|
|
@@ -1639,7 +1640,7 @@ Selected agent: ${agentType}`));
|
|
|
1639
1640
|
var McpCommand = {
|
|
1640
1641
|
command: "mcp <command>",
|
|
1641
1642
|
describe: "Uniform MCP server management commands",
|
|
1642
|
-
builder: (
|
|
1643
|
+
builder: (yargs45) => yargs45.command(InstallMcpCommand).demandCommand(),
|
|
1643
1644
|
handler: () => {
|
|
1644
1645
|
yargs.showHelp();
|
|
1645
1646
|
}
|
|
@@ -2114,8 +2115,8 @@ ${gray2("Rules source:")} https://github.com/uniformdev/ai-rules`);
|
|
|
2114
2115
|
var InstallRulesCommand = {
|
|
2115
2116
|
command: "install",
|
|
2116
2117
|
describe: "Install Uniform AI rules for your development assistant",
|
|
2117
|
-
builder: (
|
|
2118
|
-
|
|
2118
|
+
builder: (yargs45) => withConfiguration(
|
|
2119
|
+
yargs45.option("agent", {
|
|
2119
2120
|
alias: "a",
|
|
2120
2121
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
2121
2122
|
type: "string",
|
|
@@ -2153,7 +2154,7 @@ import { blue as blue4, bold as bold2, gray as gray3, green as green5, red as re
|
|
|
2153
2154
|
var ListRulesCommand = {
|
|
2154
2155
|
command: "list",
|
|
2155
2156
|
describe: "List available Uniform AI rules",
|
|
2156
|
-
builder: (
|
|
2157
|
+
builder: (yargs45) => withConfiguration(yargs45),
|
|
2157
2158
|
handler: async function() {
|
|
2158
2159
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
2159
2160
|
try {
|
|
@@ -2182,7 +2183,7 @@ var ListRulesCommand = {
|
|
|
2182
2183
|
var RulesCommand = {
|
|
2183
2184
|
command: "rules <command>",
|
|
2184
2185
|
describe: "Uniform AI rules management commands",
|
|
2185
|
-
builder: (
|
|
2186
|
+
builder: (yargs45) => yargs45.command(InstallRulesCommand).command(ListRulesCommand).demandCommand(),
|
|
2186
2187
|
handler: () => {
|
|
2187
2188
|
yargs2.showHelp();
|
|
2188
2189
|
}
|
|
@@ -2192,7 +2193,7 @@ var RulesCommand = {
|
|
|
2192
2193
|
var AiCommand = {
|
|
2193
2194
|
command: "ai <command>",
|
|
2194
2195
|
describe: "Uniform AI development assistant commands",
|
|
2195
|
-
builder: (
|
|
2196
|
+
builder: (yargs45) => yargs45.command(RulesCommand).command(McpCommand).demandCommand(),
|
|
2196
2197
|
handler: () => {
|
|
2197
2198
|
yargs3.showHelp();
|
|
2198
2199
|
}
|
|
@@ -2277,10 +2278,10 @@ function resolveDeleteTargets(identifiers) {
|
|
|
2277
2278
|
var AutomationDeleteModule = {
|
|
2278
2279
|
command: "delete <identifiers..>",
|
|
2279
2280
|
describe: "Deletes one or more automations from a project.",
|
|
2280
|
-
builder: (
|
|
2281
|
+
builder: (yargs45) => withConfiguration(
|
|
2281
2282
|
withApiOptions(
|
|
2282
2283
|
withProjectOptions(
|
|
2283
|
-
|
|
2284
|
+
yargs45.positional("identifiers", {
|
|
2284
2285
|
array: true,
|
|
2285
2286
|
type: "string",
|
|
2286
2287
|
demandOption: true,
|
|
@@ -2504,10 +2505,10 @@ function assertUniquePublicIds(files) {
|
|
|
2504
2505
|
var AutomationDeployModule = {
|
|
2505
2506
|
command: "deploy <paths..>",
|
|
2506
2507
|
describe: "Deploys one or more automations to a project.",
|
|
2507
|
-
builder: (
|
|
2508
|
+
builder: (yargs45) => withConfiguration(
|
|
2508
2509
|
withApiOptions(
|
|
2509
2510
|
withProjectOptions(
|
|
2510
|
-
|
|
2511
|
+
yargs45.positional("paths", {
|
|
2511
2512
|
array: true,
|
|
2512
2513
|
type: "string",
|
|
2513
2514
|
demandOption: true,
|
|
@@ -2575,7 +2576,7 @@ var AutomationListModule = {
|
|
|
2575
2576
|
command: "list",
|
|
2576
2577
|
aliases: ["ls"],
|
|
2577
2578
|
describe: "Lists the automations in a project.",
|
|
2578
|
-
builder: (
|
|
2579
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withProjectOptions(yargs45))),
|
|
2579
2580
|
handler: async ({ apiHost, apiKey, proxy, project: projectId }) => {
|
|
2580
2581
|
const fetch2 = nodeFetchProxy(proxy);
|
|
2581
2582
|
const client = new AutomationsClient3({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -2606,14 +2607,14 @@ var AutomationCommand = {
|
|
|
2606
2607
|
command: "automation <command>",
|
|
2607
2608
|
aliases: ["automations"],
|
|
2608
2609
|
describe: "Commands for managing Uniform Automations",
|
|
2609
|
-
builder: (
|
|
2610
|
+
builder: (yargs45) => yargs45.command(AutomationDeployModule).command(AutomationDeleteModule).command(AutomationListModule).demandCommand(),
|
|
2610
2611
|
handler: () => {
|
|
2611
2612
|
yargs4.showHelp();
|
|
2612
2613
|
}
|
|
2613
2614
|
};
|
|
2614
2615
|
|
|
2615
2616
|
// src/commands/canvas/index.ts
|
|
2616
|
-
import
|
|
2617
|
+
import yargs23 from "yargs";
|
|
2617
2618
|
|
|
2618
2619
|
// src/commands/canvas/commands/asset.ts
|
|
2619
2620
|
import yargs5 from "yargs";
|
|
@@ -2634,12 +2635,12 @@ function getFileClient(options) {
|
|
|
2634
2635
|
var AssetGetModule = {
|
|
2635
2636
|
command: "get <id>",
|
|
2636
2637
|
describe: "Get an asset",
|
|
2637
|
-
builder: (
|
|
2638
|
+
builder: (yargs45) => withConfiguration(
|
|
2638
2639
|
withDebugOptions(
|
|
2639
2640
|
withFormatOptions(
|
|
2640
2641
|
withApiOptions(
|
|
2641
2642
|
withProjectOptions(
|
|
2642
|
-
|
|
2643
|
+
yargs45.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
2643
2644
|
)
|
|
2644
2645
|
)
|
|
2645
2646
|
)
|
|
@@ -2660,7 +2661,7 @@ var AssetGetModule = {
|
|
|
2660
2661
|
var AssetListModule = {
|
|
2661
2662
|
command: "list",
|
|
2662
2663
|
describe: "List assets",
|
|
2663
|
-
builder: (
|
|
2664
|
+
builder: (yargs45) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs45))))),
|
|
2664
2665
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
2665
2666
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2666
2667
|
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -3325,8 +3326,8 @@ function prepCompositionForDisk(composition) {
|
|
|
3325
3326
|
delete prepped.state;
|
|
3326
3327
|
return prepped;
|
|
3327
3328
|
}
|
|
3328
|
-
function withStateOptions(
|
|
3329
|
-
return
|
|
3329
|
+
function withStateOptions(yargs45, defaultState = "preview") {
|
|
3330
|
+
return yargs45.option("state", {
|
|
3330
3331
|
type: "string",
|
|
3331
3332
|
describe: `State to fetch.`,
|
|
3332
3333
|
choices: ["preview", "published"],
|
|
@@ -3424,13 +3425,13 @@ var prepareAssetForPull = async ({
|
|
|
3424
3425
|
var AssetPullModule = {
|
|
3425
3426
|
command: "pull <directory>",
|
|
3426
3427
|
describe: "Pulls all assets to local files in a directory",
|
|
3427
|
-
builder: (
|
|
3428
|
+
builder: (yargs45) => withConfiguration(
|
|
3428
3429
|
withApiOptions(
|
|
3429
3430
|
withDebugOptions(
|
|
3430
3431
|
withProjectOptions(
|
|
3431
3432
|
withDiffOptions(
|
|
3432
3433
|
withBatchSizeOptions(
|
|
3433
|
-
|
|
3434
|
+
yargs45.positional("directory", {
|
|
3434
3435
|
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.",
|
|
3435
3436
|
type: "string"
|
|
3436
3437
|
}).option("format", {
|
|
@@ -3594,13 +3595,13 @@ var prepareAssetForPush = async ({
|
|
|
3594
3595
|
var AssetPushModule = {
|
|
3595
3596
|
command: "push <directory>",
|
|
3596
3597
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
3597
|
-
builder: (
|
|
3598
|
+
builder: (yargs45) => withConfiguration(
|
|
3598
3599
|
withApiOptions(
|
|
3599
3600
|
withDebugOptions(
|
|
3600
3601
|
withProjectOptions(
|
|
3601
3602
|
withDiffOptions(
|
|
3602
3603
|
withBatchSizeOptions(
|
|
3603
|
-
|
|
3604
|
+
yargs45.positional("directory", {
|
|
3604
3605
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
3605
3606
|
type: "string"
|
|
3606
3607
|
}).option("mode", {
|
|
@@ -3717,10 +3718,10 @@ var AssetRemoveModule = {
|
|
|
3717
3718
|
command: "remove <id>",
|
|
3718
3719
|
aliases: ["delete", "rm"],
|
|
3719
3720
|
describe: "Delete an asset",
|
|
3720
|
-
builder: (
|
|
3721
|
+
builder: (yargs45) => withConfiguration(
|
|
3721
3722
|
withDebugOptions(
|
|
3722
3723
|
withApiOptions(
|
|
3723
|
-
withProjectOptions(
|
|
3724
|
+
withProjectOptions(yargs45.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
3724
3725
|
)
|
|
3725
3726
|
)
|
|
3726
3727
|
),
|
|
@@ -3741,11 +3742,11 @@ var AssetUpdateModule = {
|
|
|
3741
3742
|
command: "update <filename>",
|
|
3742
3743
|
aliases: ["put"],
|
|
3743
3744
|
describe: "Insert or update an asset",
|
|
3744
|
-
builder: (
|
|
3745
|
+
builder: (yargs45) => withConfiguration(
|
|
3745
3746
|
withDebugOptions(
|
|
3746
3747
|
withApiOptions(
|
|
3747
3748
|
withProjectOptions(
|
|
3748
|
-
|
|
3749
|
+
yargs45.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
3749
3750
|
)
|
|
3750
3751
|
)
|
|
3751
3752
|
)
|
|
@@ -3771,7 +3772,7 @@ var AssetUpdateModule = {
|
|
|
3771
3772
|
var AssetModule = {
|
|
3772
3773
|
command: "asset <command>",
|
|
3773
3774
|
describe: "Commands for Assets",
|
|
3774
|
-
builder: (
|
|
3775
|
+
builder: (yargs45) => yargs45.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
3775
3776
|
handler: () => {
|
|
3776
3777
|
yargs5.help();
|
|
3777
3778
|
}
|
|
@@ -3792,12 +3793,12 @@ function getCategoryClient(options) {
|
|
|
3792
3793
|
var CategoryGetModule = {
|
|
3793
3794
|
command: "get <id>",
|
|
3794
3795
|
describe: "Fetch a category",
|
|
3795
|
-
builder: (
|
|
3796
|
+
builder: (yargs45) => withConfiguration(
|
|
3796
3797
|
withFormatOptions(
|
|
3797
3798
|
withDebugOptions(
|
|
3798
3799
|
withApiOptions(
|
|
3799
3800
|
withProjectOptions(
|
|
3800
|
-
|
|
3801
|
+
yargs45.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
3801
3802
|
)
|
|
3802
3803
|
)
|
|
3803
3804
|
)
|
|
@@ -3822,8 +3823,8 @@ var CategoryListModule = {
|
|
|
3822
3823
|
command: "list",
|
|
3823
3824
|
describe: "List categories",
|
|
3824
3825
|
aliases: ["ls"],
|
|
3825
|
-
builder: (
|
|
3826
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
3826
|
+
builder: (yargs45) => withConfiguration(
|
|
3827
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs45.options({})))))
|
|
3827
3828
|
),
|
|
3828
3829
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3829
3830
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -3865,12 +3866,12 @@ function createCategoriesEngineDataSource({
|
|
|
3865
3866
|
var CategoryPullModule = {
|
|
3866
3867
|
command: "pull <directory>",
|
|
3867
3868
|
describe: "Pulls all categories to local files in a directory",
|
|
3868
|
-
builder: (
|
|
3869
|
+
builder: (yargs45) => withConfiguration(
|
|
3869
3870
|
withApiOptions(
|
|
3870
3871
|
withProjectOptions(
|
|
3871
3872
|
withDiffOptions(
|
|
3872
3873
|
withDebugOptions(
|
|
3873
|
-
|
|
3874
|
+
yargs45.positional("directory", {
|
|
3874
3875
|
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.",
|
|
3875
3876
|
type: "string"
|
|
3876
3877
|
}).option("format", {
|
|
@@ -3945,12 +3946,12 @@ var CategoryPullModule = {
|
|
|
3945
3946
|
var CategoryPushModule = {
|
|
3946
3947
|
command: "push <directory>",
|
|
3947
3948
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
3948
|
-
builder: (
|
|
3949
|
+
builder: (yargs45) => withConfiguration(
|
|
3949
3950
|
withApiOptions(
|
|
3950
3951
|
withDebugOptions(
|
|
3951
3952
|
withProjectOptions(
|
|
3952
3953
|
withDiffOptions(
|
|
3953
|
-
|
|
3954
|
+
yargs45.positional("directory", {
|
|
3954
3955
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
3955
3956
|
type: "string"
|
|
3956
3957
|
}).option("mode", {
|
|
@@ -4014,11 +4015,11 @@ var CategoryRemoveModule = {
|
|
|
4014
4015
|
command: "remove <id>",
|
|
4015
4016
|
aliases: ["delete", "rm"],
|
|
4016
4017
|
describe: "Delete a category",
|
|
4017
|
-
builder: (
|
|
4018
|
+
builder: (yargs45) => withConfiguration(
|
|
4018
4019
|
withApiOptions(
|
|
4019
4020
|
withDebugOptions(
|
|
4020
4021
|
withProjectOptions(
|
|
4021
|
-
|
|
4022
|
+
yargs45.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
4022
4023
|
)
|
|
4023
4024
|
)
|
|
4024
4025
|
)
|
|
@@ -4039,11 +4040,11 @@ var CategoryUpdateModule = {
|
|
|
4039
4040
|
command: "update <filename>",
|
|
4040
4041
|
aliases: ["put"],
|
|
4041
4042
|
describe: "Insert or update a category",
|
|
4042
|
-
builder: (
|
|
4043
|
+
builder: (yargs45) => withConfiguration(
|
|
4043
4044
|
withApiOptions(
|
|
4044
4045
|
withDebugOptions(
|
|
4045
4046
|
withProjectOptions(
|
|
4046
|
-
|
|
4047
|
+
yargs45.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
4047
4048
|
)
|
|
4048
4049
|
)
|
|
4049
4050
|
)
|
|
@@ -4065,7 +4066,7 @@ var CategoryModule = {
|
|
|
4065
4066
|
command: "category <command>",
|
|
4066
4067
|
aliases: ["cat"],
|
|
4067
4068
|
describe: "Commands for Canvas categories",
|
|
4068
|
-
builder: (
|
|
4069
|
+
builder: (yargs45) => yargs45.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
4069
4070
|
handler: () => {
|
|
4070
4071
|
yargs6.help();
|
|
4071
4072
|
}
|
|
@@ -4097,12 +4098,12 @@ function getCompositionDeliveryClient(options) {
|
|
|
4097
4098
|
var ComponentGetModule = {
|
|
4098
4099
|
command: "get <id>",
|
|
4099
4100
|
describe: "Fetch a component definition",
|
|
4100
|
-
builder: (
|
|
4101
|
+
builder: (yargs45) => withConfiguration(
|
|
4101
4102
|
withFormatOptions(
|
|
4102
4103
|
withDebugOptions(
|
|
4103
4104
|
withApiOptions(
|
|
4104
4105
|
withProjectOptions(
|
|
4105
|
-
|
|
4106
|
+
yargs45.positional("id", {
|
|
4106
4107
|
demandOption: true,
|
|
4107
4108
|
describe: "Component definition public ID to fetch"
|
|
4108
4109
|
})
|
|
@@ -4136,12 +4137,12 @@ var ComponentListModule = {
|
|
|
4136
4137
|
command: "list",
|
|
4137
4138
|
describe: "List component definitions",
|
|
4138
4139
|
aliases: ["ls"],
|
|
4139
|
-
builder: (
|
|
4140
|
+
builder: (yargs45) => withConfiguration(
|
|
4140
4141
|
withFormatOptions(
|
|
4141
4142
|
withDebugOptions(
|
|
4142
4143
|
withApiOptions(
|
|
4143
4144
|
withProjectOptions(
|
|
4144
|
-
|
|
4145
|
+
yargs45.options({
|
|
4145
4146
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4146
4147
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
4147
4148
|
})
|
|
@@ -4212,13 +4213,13 @@ function createComponentDefinitionEngineDataSource({
|
|
|
4212
4213
|
var ComponentPullModule = {
|
|
4213
4214
|
command: "pull <directory>",
|
|
4214
4215
|
describe: "Pulls all component definitions to local files in a directory",
|
|
4215
|
-
builder: (
|
|
4216
|
+
builder: (yargs45) => withConfiguration(
|
|
4216
4217
|
withApiOptions(
|
|
4217
4218
|
withDebugOptions(
|
|
4218
4219
|
withProjectOptions(
|
|
4219
4220
|
withDiffOptions(
|
|
4220
4221
|
withBatchSizeOptions(
|
|
4221
|
-
|
|
4222
|
+
yargs45.positional("directory", {
|
|
4222
4223
|
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.",
|
|
4223
4224
|
type: "string"
|
|
4224
4225
|
}).option("format", {
|
|
@@ -4301,13 +4302,13 @@ var ComponentPullModule = {
|
|
|
4301
4302
|
var ComponentPushModule = {
|
|
4302
4303
|
command: "push <directory>",
|
|
4303
4304
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
4304
|
-
builder: (
|
|
4305
|
+
builder: (yargs45) => withConfiguration(
|
|
4305
4306
|
withApiOptions(
|
|
4306
4307
|
withDebugOptions(
|
|
4307
4308
|
withProjectOptions(
|
|
4308
4309
|
withDiffOptions(
|
|
4309
4310
|
withBatchSizeOptions(
|
|
4310
|
-
|
|
4311
|
+
yargs45.positional("directory", {
|
|
4311
4312
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
4312
4313
|
type: "string"
|
|
4313
4314
|
}).option("mode", {
|
|
@@ -4379,11 +4380,11 @@ var ComponentRemoveModule = {
|
|
|
4379
4380
|
command: "remove <id>",
|
|
4380
4381
|
aliases: ["delete", "rm"],
|
|
4381
4382
|
describe: "Delete a component definition",
|
|
4382
|
-
builder: (
|
|
4383
|
+
builder: (yargs45) => withConfiguration(
|
|
4383
4384
|
withDebugOptions(
|
|
4384
4385
|
withApiOptions(
|
|
4385
4386
|
withProjectOptions(
|
|
4386
|
-
|
|
4387
|
+
yargs45.positional("id", {
|
|
4387
4388
|
demandOption: true,
|
|
4388
4389
|
describe: "Component definition public ID to delete"
|
|
4389
4390
|
})
|
|
@@ -4407,11 +4408,11 @@ var ComponentUpdateModule = {
|
|
|
4407
4408
|
command: "update <filename>",
|
|
4408
4409
|
aliases: ["put"],
|
|
4409
4410
|
describe: "Insert or update a component definition",
|
|
4410
|
-
builder: (
|
|
4411
|
+
builder: (yargs45) => withConfiguration(
|
|
4411
4412
|
withApiOptions(
|
|
4412
4413
|
withDebugOptions(
|
|
4413
4414
|
withProjectOptions(
|
|
4414
|
-
|
|
4415
|
+
yargs45.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
4415
4416
|
)
|
|
4416
4417
|
)
|
|
4417
4418
|
)
|
|
@@ -4433,7 +4434,7 @@ var ComponentModule = {
|
|
|
4433
4434
|
command: "component <command>",
|
|
4434
4435
|
aliases: ["def"],
|
|
4435
4436
|
describe: "Commands for Canvas component definitions",
|
|
4436
|
-
builder: (
|
|
4437
|
+
builder: (yargs45) => yargs45.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
4437
4438
|
handler: () => {
|
|
4438
4439
|
yargs7.help();
|
|
4439
4440
|
}
|
|
@@ -4596,13 +4597,13 @@ function createCompositionGetHandler(expectedType) {
|
|
|
4596
4597
|
var CompositionGetModule = {
|
|
4597
4598
|
command: "get <id>",
|
|
4598
4599
|
describe: "Fetch a composition",
|
|
4599
|
-
builder: (
|
|
4600
|
+
builder: (yargs45) => withFormatOptions(
|
|
4600
4601
|
withConfiguration(
|
|
4601
4602
|
withApiOptions(
|
|
4602
4603
|
withProjectOptions(
|
|
4603
4604
|
withStateOptions(
|
|
4604
4605
|
withDebugOptions(
|
|
4605
|
-
|
|
4606
|
+
yargs45.positional("id", {
|
|
4606
4607
|
demandOption: true,
|
|
4607
4608
|
describe: "Composition public ID to fetch"
|
|
4608
4609
|
}).option({
|
|
@@ -4654,13 +4655,13 @@ var CompositionListModule = {
|
|
|
4654
4655
|
command: "list",
|
|
4655
4656
|
describe: "List compositions",
|
|
4656
4657
|
aliases: ["ls"],
|
|
4657
|
-
builder: (
|
|
4658
|
+
builder: (yargs45) => withFormatOptions(
|
|
4658
4659
|
withConfiguration(
|
|
4659
4660
|
withApiOptions(
|
|
4660
4661
|
withProjectOptions(
|
|
4661
4662
|
withDebugOptions(
|
|
4662
4663
|
withStateOptions(
|
|
4663
|
-
|
|
4664
|
+
yargs45.options({
|
|
4664
4665
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4665
4666
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4666
4667
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -4734,13 +4735,13 @@ var CompositionListModule = {
|
|
|
4734
4735
|
var ComponentPatternListModule = {
|
|
4735
4736
|
...CompositionListModule,
|
|
4736
4737
|
describe: "List component patterns",
|
|
4737
|
-
builder: (
|
|
4738
|
+
builder: (yargs45) => withFormatOptions(
|
|
4738
4739
|
withConfiguration(
|
|
4739
4740
|
withApiOptions(
|
|
4740
4741
|
withDebugOptions(
|
|
4741
4742
|
withProjectOptions(
|
|
4742
4743
|
withStateOptions(
|
|
4743
|
-
|
|
4744
|
+
yargs45.options({
|
|
4744
4745
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4745
4746
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4746
4747
|
resolvePatterns: {
|
|
@@ -4879,13 +4880,13 @@ function createComponentInstanceEngineDataSource({
|
|
|
4879
4880
|
var CompositionPublishModule = {
|
|
4880
4881
|
command: "publish [ids]",
|
|
4881
4882
|
describe: "Publishes composition(s)",
|
|
4882
|
-
builder: (
|
|
4883
|
+
builder: (yargs45) => withConfiguration(
|
|
4883
4884
|
withApiOptions(
|
|
4884
4885
|
withProjectOptions(
|
|
4885
4886
|
withDebugOptions(
|
|
4886
4887
|
withDiffOptions(
|
|
4887
4888
|
withBatchSizeOptions(
|
|
4888
|
-
|
|
4889
|
+
yargs45.positional("ids", {
|
|
4889
4890
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4890
4891
|
type: "string"
|
|
4891
4892
|
}).option("all", {
|
|
@@ -4977,13 +4978,13 @@ var CompositionPublishModule = {
|
|
|
4977
4978
|
var ComponentPatternPublishModule = {
|
|
4978
4979
|
...CompositionPublishModule,
|
|
4979
4980
|
describe: "Publishes component pattern(s)",
|
|
4980
|
-
builder: (
|
|
4981
|
+
builder: (yargs45) => withConfiguration(
|
|
4981
4982
|
withApiOptions(
|
|
4982
4983
|
withDebugOptions(
|
|
4983
4984
|
withProjectOptions(
|
|
4984
4985
|
withDiffOptions(
|
|
4985
4986
|
withBatchSizeOptions(
|
|
4986
|
-
|
|
4987
|
+
yargs45.positional("ids", {
|
|
4987
4988
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4988
4989
|
type: "string"
|
|
4989
4990
|
}).option("all", {
|
|
@@ -5025,14 +5026,14 @@ function componentInstancePullModuleFactory(type, entityType) {
|
|
|
5025
5026
|
return {
|
|
5026
5027
|
command: "pull <directory>",
|
|
5027
5028
|
describe: "Pulls all compositions to local files in a directory",
|
|
5028
|
-
builder: (
|
|
5029
|
+
builder: (yargs45) => withConfiguration(
|
|
5029
5030
|
withApiOptions(
|
|
5030
5031
|
withProjectOptions(
|
|
5031
5032
|
withStateOptions(
|
|
5032
5033
|
withDebugOptions(
|
|
5033
5034
|
withDiffOptions(
|
|
5034
5035
|
withBatchSizeOptions(
|
|
5035
|
-
|
|
5036
|
+
yargs45.positional("directory", {
|
|
5036
5037
|
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.",
|
|
5037
5038
|
type: "string"
|
|
5038
5039
|
}).option("format", {
|
|
@@ -5151,13 +5152,13 @@ function componentInstancePullModuleFactory(type, entityType) {
|
|
|
5151
5152
|
var ComponentPatternPullModule = {
|
|
5152
5153
|
...componentInstancePullModuleFactory("componentPatterns", "componentPattern"),
|
|
5153
5154
|
describe: "Pulls all component patterns to local files in a directory",
|
|
5154
|
-
builder: (
|
|
5155
|
+
builder: (yargs45) => withConfiguration(
|
|
5155
5156
|
withApiOptions(
|
|
5156
5157
|
withProjectOptions(
|
|
5157
5158
|
withDebugOptions(
|
|
5158
5159
|
withStateOptions(
|
|
5159
5160
|
withDiffOptions(
|
|
5160
|
-
|
|
5161
|
+
yargs45.positional("directory", {
|
|
5161
5162
|
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.",
|
|
5162
5163
|
type: "string"
|
|
5163
5164
|
}).option("format", {
|
|
@@ -5231,14 +5232,14 @@ function componentInstancePushModuleFactory(type, entityType) {
|
|
|
5231
5232
|
return {
|
|
5232
5233
|
command: "push <directory>",
|
|
5233
5234
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
5234
|
-
builder: (
|
|
5235
|
+
builder: (yargs45) => withConfiguration(
|
|
5235
5236
|
withApiOptions(
|
|
5236
5237
|
withProjectOptions(
|
|
5237
5238
|
withStateOptions(
|
|
5238
5239
|
withDebugOptions(
|
|
5239
5240
|
withDiffOptions(
|
|
5240
5241
|
withBatchSizeOptions(
|
|
5241
|
-
|
|
5242
|
+
yargs45.positional("directory", {
|
|
5242
5243
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
5243
5244
|
type: "string"
|
|
5244
5245
|
}).option("mode", {
|
|
@@ -5356,13 +5357,13 @@ function componentInstancePushModuleFactory(type, entityType) {
|
|
|
5356
5357
|
var ComponentPatternPushModule = {
|
|
5357
5358
|
...componentInstancePushModuleFactory("componentPatterns", "componentPattern"),
|
|
5358
5359
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
5359
|
-
builder: (
|
|
5360
|
+
builder: (yargs45) => withConfiguration(
|
|
5360
5361
|
withApiOptions(
|
|
5361
5362
|
withProjectOptions(
|
|
5362
5363
|
withStateOptions(
|
|
5363
5364
|
withDiffOptions(
|
|
5364
5365
|
withDebugOptions(
|
|
5365
|
-
|
|
5366
|
+
yargs45.positional("directory", {
|
|
5366
5367
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
5367
5368
|
type: "string"
|
|
5368
5369
|
}).option("mode", {
|
|
@@ -5427,11 +5428,11 @@ var CompositionRemoveModule = {
|
|
|
5427
5428
|
command: "remove <id>",
|
|
5428
5429
|
aliases: ["delete", "rm"],
|
|
5429
5430
|
describe: "Delete a composition",
|
|
5430
|
-
builder: (
|
|
5431
|
+
builder: (yargs45) => withConfiguration(
|
|
5431
5432
|
withApiOptions(
|
|
5432
5433
|
withDebugOptions(
|
|
5433
5434
|
withProjectOptions(
|
|
5434
|
-
|
|
5435
|
+
yargs45.positional("id", {
|
|
5435
5436
|
demandOption: true,
|
|
5436
5437
|
describe: "Composition public ID to delete"
|
|
5437
5438
|
})
|
|
@@ -5455,12 +5456,12 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
5455
5456
|
var CompositionUnpublishModule = {
|
|
5456
5457
|
command: "unpublish [ids]",
|
|
5457
5458
|
describe: "Unpublish a composition(s)",
|
|
5458
|
-
builder: (
|
|
5459
|
+
builder: (yargs45) => withConfiguration(
|
|
5459
5460
|
withApiOptions(
|
|
5460
5461
|
withDebugOptions(
|
|
5461
5462
|
withProjectOptions(
|
|
5462
5463
|
withBatchSizeOptions(
|
|
5463
|
-
|
|
5464
|
+
yargs45.positional("ids", {
|
|
5464
5465
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5465
5466
|
type: "string"
|
|
5466
5467
|
}).option("all", {
|
|
@@ -5581,11 +5582,11 @@ var CompositionUnpublishModule = {
|
|
|
5581
5582
|
var ComponentPatternUnpublishModule = {
|
|
5582
5583
|
command: "unpublish [ids]",
|
|
5583
5584
|
describe: "Unpublish a component pattern(s)",
|
|
5584
|
-
builder: (
|
|
5585
|
+
builder: (yargs45) => withConfiguration(
|
|
5585
5586
|
withApiOptions(
|
|
5586
5587
|
withDebugOptions(
|
|
5587
5588
|
withProjectOptions(
|
|
5588
|
-
|
|
5589
|
+
yargs45.positional("ids", {
|
|
5589
5590
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5590
5591
|
type: "string"
|
|
5591
5592
|
}).option("all", {
|
|
@@ -5653,12 +5654,12 @@ var CompositionUpdateModule = {
|
|
|
5653
5654
|
command: "update <filename>",
|
|
5654
5655
|
aliases: ["put"],
|
|
5655
5656
|
describe: "Insert or update a composition",
|
|
5656
|
-
builder: (
|
|
5657
|
+
builder: (yargs45) => withConfiguration(
|
|
5657
5658
|
withApiOptions(
|
|
5658
5659
|
withProjectOptions(
|
|
5659
5660
|
withDebugOptions(
|
|
5660
5661
|
withStateOptions(
|
|
5661
|
-
|
|
5662
|
+
yargs45.positional("filename", {
|
|
5662
5663
|
demandOption: true,
|
|
5663
5664
|
describe: "Composition/pattern file to put"
|
|
5664
5665
|
})
|
|
@@ -5681,7 +5682,7 @@ var ComponentPatternUpdateModule = {
|
|
|
5681
5682
|
var ComponentPatternModule = {
|
|
5682
5683
|
command: "component-pattern <command>",
|
|
5683
5684
|
describe: "Commands for Canvas component patterns",
|
|
5684
|
-
builder: (
|
|
5685
|
+
builder: (yargs45) => yargs45.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
5685
5686
|
handler: () => {
|
|
5686
5687
|
yargs8.help();
|
|
5687
5688
|
}
|
|
@@ -5693,7 +5694,7 @@ var CompositionModule = {
|
|
|
5693
5694
|
command: "composition <command>",
|
|
5694
5695
|
describe: "Commands for Canvas compositions",
|
|
5695
5696
|
aliases: ["comp"],
|
|
5696
|
-
builder: (
|
|
5697
|
+
builder: (yargs45) => yargs45.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
5697
5698
|
handler: () => {
|
|
5698
5699
|
yargs9.help();
|
|
5699
5700
|
}
|
|
@@ -5713,13 +5714,13 @@ var CompositionPatternGetModule = {
|
|
|
5713
5714
|
var CompositionPatternListModule = {
|
|
5714
5715
|
...CompositionListModule,
|
|
5715
5716
|
describe: "List composition patterns",
|
|
5716
|
-
builder: (
|
|
5717
|
+
builder: (yargs45) => withFormatOptions(
|
|
5717
5718
|
withConfiguration(
|
|
5718
5719
|
withApiOptions(
|
|
5719
5720
|
withDebugOptions(
|
|
5720
5721
|
withProjectOptions(
|
|
5721
5722
|
withStateOptions(
|
|
5722
|
-
|
|
5723
|
+
yargs45.options({
|
|
5723
5724
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
5724
5725
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
5725
5726
|
resolvePatterns: {
|
|
@@ -5757,13 +5758,13 @@ var CompositionPatternListModule = {
|
|
|
5757
5758
|
var CompositionPatternPublishModule = {
|
|
5758
5759
|
...CompositionPublishModule,
|
|
5759
5760
|
describe: "Publishes composition pattern(s)",
|
|
5760
|
-
builder: (
|
|
5761
|
+
builder: (yargs45) => withConfiguration(
|
|
5761
5762
|
withApiOptions(
|
|
5762
5763
|
withDebugOptions(
|
|
5763
5764
|
withProjectOptions(
|
|
5764
5765
|
withDiffOptions(
|
|
5765
5766
|
withBatchSizeOptions(
|
|
5766
|
-
|
|
5767
|
+
yargs45.positional("ids", {
|
|
5767
5768
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
5768
5769
|
type: "string"
|
|
5769
5770
|
}).option("all", {
|
|
@@ -5804,13 +5805,13 @@ var CompositionPatternPublishModule = {
|
|
|
5804
5805
|
var CompositionPatternPullModule = {
|
|
5805
5806
|
...componentInstancePullModuleFactory("compositionPatterns", "compositionPattern"),
|
|
5806
5807
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
5807
|
-
builder: (
|
|
5808
|
+
builder: (yargs45) => withConfiguration(
|
|
5808
5809
|
withApiOptions(
|
|
5809
5810
|
withDebugOptions(
|
|
5810
5811
|
withProjectOptions(
|
|
5811
5812
|
withStateOptions(
|
|
5812
5813
|
withDiffOptions(
|
|
5813
|
-
|
|
5814
|
+
yargs45.positional("directory", {
|
|
5814
5815
|
describe: "Directory to save the composition patterns to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
5815
5816
|
type: "string"
|
|
5816
5817
|
}).option("format", {
|
|
@@ -5848,13 +5849,13 @@ var CompositionPatternPullModule = {
|
|
|
5848
5849
|
var CompositionPatternPushModule = {
|
|
5849
5850
|
...componentInstancePushModuleFactory("compositionPatterns", "compositionPattern"),
|
|
5850
5851
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
5851
|
-
builder: (
|
|
5852
|
+
builder: (yargs45) => withConfiguration(
|
|
5852
5853
|
withApiOptions(
|
|
5853
5854
|
withDebugOptions(
|
|
5854
5855
|
withProjectOptions(
|
|
5855
5856
|
withStateOptions(
|
|
5856
5857
|
withDiffOptions(
|
|
5857
|
-
|
|
5858
|
+
yargs45.positional("directory", {
|
|
5858
5859
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
5859
5860
|
type: "string"
|
|
5860
5861
|
}).option("mode", {
|
|
@@ -5894,11 +5895,11 @@ var CompositionPatternRemoveModule = {
|
|
|
5894
5895
|
var CompositionPatternUnpublishModule = {
|
|
5895
5896
|
command: "unpublish [ids]",
|
|
5896
5897
|
describe: "Unpublish a composition pattern(s)",
|
|
5897
|
-
builder: (
|
|
5898
|
+
builder: (yargs45) => withConfiguration(
|
|
5898
5899
|
withApiOptions(
|
|
5899
5900
|
withDebugOptions(
|
|
5900
5901
|
withProjectOptions(
|
|
5901
|
-
|
|
5902
|
+
yargs45.positional("ids", {
|
|
5902
5903
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5903
5904
|
type: "string"
|
|
5904
5905
|
}).option("all", {
|
|
@@ -5935,7 +5936,7 @@ var CompositionPatternUpdateModule = {
|
|
|
5935
5936
|
var CompositionPatternModule = {
|
|
5936
5937
|
command: "composition-pattern <command>",
|
|
5937
5938
|
describe: "Commands for Canvas composition patterns",
|
|
5938
|
-
builder: (
|
|
5939
|
+
builder: (yargs45) => yargs45.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
5939
5940
|
handler: () => {
|
|
5940
5941
|
yargs10.help();
|
|
5941
5942
|
}
|
|
@@ -5966,12 +5967,12 @@ function getEntryDeliveryClient(options) {
|
|
|
5966
5967
|
var ContentTypeGetModule = {
|
|
5967
5968
|
command: "get <id>",
|
|
5968
5969
|
describe: "Get a content type",
|
|
5969
|
-
builder: (
|
|
5970
|
+
builder: (yargs45) => withConfiguration(
|
|
5970
5971
|
withDebugOptions(
|
|
5971
5972
|
withFormatOptions(
|
|
5972
5973
|
withApiOptions(
|
|
5973
5974
|
withProjectOptions(
|
|
5974
|
-
|
|
5975
|
+
yargs45.positional("id", {
|
|
5975
5976
|
demandOption: true,
|
|
5976
5977
|
describe: "Content type public ID to fetch"
|
|
5977
5978
|
})
|
|
@@ -5992,7 +5993,7 @@ var ContentTypeGetModule = {
|
|
|
5992
5993
|
var ContentTypeListModule = {
|
|
5993
5994
|
command: "list",
|
|
5994
5995
|
describe: "List content types",
|
|
5995
|
-
builder: (
|
|
5996
|
+
builder: (yargs45) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs45))))),
|
|
5996
5997
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5997
5998
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5998
5999
|
const client = getContentTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -6038,13 +6039,13 @@ function createContentTypeEngineDataSource({
|
|
|
6038
6039
|
var ContentTypePullModule = {
|
|
6039
6040
|
command: "pull <directory>",
|
|
6040
6041
|
describe: "Pulls all content types to local files in a directory",
|
|
6041
|
-
builder: (
|
|
6042
|
+
builder: (yargs45) => withConfiguration(
|
|
6042
6043
|
withApiOptions(
|
|
6043
6044
|
withDebugOptions(
|
|
6044
6045
|
withProjectOptions(
|
|
6045
6046
|
withDiffOptions(
|
|
6046
6047
|
withBatchSizeOptions(
|
|
6047
|
-
|
|
6048
|
+
yargs45.positional("directory", {
|
|
6048
6049
|
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.",
|
|
6049
6050
|
type: "string"
|
|
6050
6051
|
}).option("format", {
|
|
@@ -6131,13 +6132,13 @@ var ContentTypePullModule = {
|
|
|
6131
6132
|
var ContentTypePushModule = {
|
|
6132
6133
|
command: "push <directory>",
|
|
6133
6134
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
6134
|
-
builder: (
|
|
6135
|
+
builder: (yargs45) => withConfiguration(
|
|
6135
6136
|
withApiOptions(
|
|
6136
6137
|
withDebugOptions(
|
|
6137
6138
|
withProjectOptions(
|
|
6138
6139
|
withDiffOptions(
|
|
6139
6140
|
withBatchSizeOptions(
|
|
6140
|
-
|
|
6141
|
+
yargs45.positional("directory", {
|
|
6141
6142
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
6142
6143
|
type: "string"
|
|
6143
6144
|
}).option("what-if", {
|
|
@@ -6218,11 +6219,11 @@ var ContentTypeRemoveModule = {
|
|
|
6218
6219
|
command: "remove <id>",
|
|
6219
6220
|
aliases: ["delete", "rm"],
|
|
6220
6221
|
describe: "Delete a content type",
|
|
6221
|
-
builder: (
|
|
6222
|
+
builder: (yargs45) => withConfiguration(
|
|
6222
6223
|
withDebugOptions(
|
|
6223
6224
|
withApiOptions(
|
|
6224
6225
|
withProjectOptions(
|
|
6225
|
-
|
|
6226
|
+
yargs45.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
6226
6227
|
)
|
|
6227
6228
|
)
|
|
6228
6229
|
)
|
|
@@ -6243,11 +6244,11 @@ var ContentTypeUpdateModule = {
|
|
|
6243
6244
|
command: "update <filename>",
|
|
6244
6245
|
aliases: ["put"],
|
|
6245
6246
|
describe: "Insert or update a content type",
|
|
6246
|
-
builder: (
|
|
6247
|
+
builder: (yargs45) => withConfiguration(
|
|
6247
6248
|
withDebugOptions(
|
|
6248
6249
|
withApiOptions(
|
|
6249
6250
|
withProjectOptions(
|
|
6250
|
-
|
|
6251
|
+
yargs45.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
6251
6252
|
)
|
|
6252
6253
|
)
|
|
6253
6254
|
)
|
|
@@ -6269,15 +6270,307 @@ var ContentTypeModule = {
|
|
|
6269
6270
|
command: "contenttype <command>",
|
|
6270
6271
|
aliases: ["ct"],
|
|
6271
6272
|
describe: "Commands for Content Types",
|
|
6272
|
-
builder: (
|
|
6273
|
+
builder: (yargs45) => yargs45.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
6273
6274
|
handler: () => {
|
|
6274
6275
|
yargs11.help();
|
|
6275
6276
|
}
|
|
6276
6277
|
};
|
|
6277
6278
|
|
|
6278
|
-
// src/commands/canvas/commands/
|
|
6279
|
+
// src/commands/canvas/commands/customView.ts
|
|
6279
6280
|
import yargs12 from "yargs";
|
|
6280
6281
|
|
|
6282
|
+
// src/commands/canvas/commands/customView/customViewClient.ts
|
|
6283
|
+
import { ApiClient } from "@uniformdev/context/api";
|
|
6284
|
+
var VIEWS_URL = "/api/v1/views";
|
|
6285
|
+
var CANVAS_RESOURCE_TYPES = [
|
|
6286
|
+
"composition",
|
|
6287
|
+
"compositionPattern",
|
|
6288
|
+
"component",
|
|
6289
|
+
"componentPattern",
|
|
6290
|
+
"entry",
|
|
6291
|
+
"entryPattern",
|
|
6292
|
+
"contentType",
|
|
6293
|
+
"blockType",
|
|
6294
|
+
"release",
|
|
6295
|
+
"signal",
|
|
6296
|
+
"intent",
|
|
6297
|
+
"audience",
|
|
6298
|
+
"asset"
|
|
6299
|
+
];
|
|
6300
|
+
var CustomViewClient = class extends ApiClient {
|
|
6301
|
+
/** Lists saved views visible to the current caller (shared + own private). */
|
|
6302
|
+
async list(options) {
|
|
6303
|
+
const { projectId } = this.options;
|
|
6304
|
+
const fetchUri = this.createUrl(VIEWS_URL, { ...options, projectId });
|
|
6305
|
+
return await this.apiClient(fetchUri);
|
|
6306
|
+
}
|
|
6307
|
+
/**
|
|
6308
|
+
* Create-or-replace a saved view (`PUT`). When `id` is omitted a UUID is minted.
|
|
6309
|
+
*/
|
|
6310
|
+
async put(body) {
|
|
6311
|
+
const { projectId } = this.options;
|
|
6312
|
+
const fetchUri = this.createUrl(VIEWS_URL);
|
|
6313
|
+
const id = body.id ?? crypto.randomUUID();
|
|
6314
|
+
return await this.apiClient(fetchUri, {
|
|
6315
|
+
method: "PUT",
|
|
6316
|
+
body: JSON.stringify({ ...body, id, projectId })
|
|
6317
|
+
});
|
|
6318
|
+
}
|
|
6319
|
+
/** Deletes a saved view by id (`DELETE`). */
|
|
6320
|
+
async remove(id) {
|
|
6321
|
+
const { projectId } = this.options;
|
|
6322
|
+
const fetchUri = this.createUrl(VIEWS_URL);
|
|
6323
|
+
await this.apiClient(fetchUri, {
|
|
6324
|
+
method: "DELETE",
|
|
6325
|
+
body: JSON.stringify({ id, projectId }),
|
|
6326
|
+
expectNoContent: true
|
|
6327
|
+
});
|
|
6328
|
+
}
|
|
6329
|
+
};
|
|
6330
|
+
|
|
6331
|
+
// src/commands/canvas/commands/customView/_util.ts
|
|
6332
|
+
var selectIdentifier4 = (view) => view.id;
|
|
6333
|
+
var selectDisplayName4 = (view) => `${view.name} (${view.resourceType})`;
|
|
6334
|
+
function getCustomViewClient(options) {
|
|
6335
|
+
return new CustomViewClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
6336
|
+
}
|
|
6337
|
+
|
|
6338
|
+
// src/commands/canvas/customViewEngineDataSource.ts
|
|
6339
|
+
function normalizeCustomViewForSync(view) {
|
|
6340
|
+
const {
|
|
6341
|
+
projectId: _projectId,
|
|
6342
|
+
createdBy: _createdBy,
|
|
6343
|
+
created: _created,
|
|
6344
|
+
modified: _modified,
|
|
6345
|
+
...rest
|
|
6346
|
+
} = view;
|
|
6347
|
+
return rest;
|
|
6348
|
+
}
|
|
6349
|
+
function createCustomViewEngineDataSource({
|
|
6350
|
+
client,
|
|
6351
|
+
batchSize,
|
|
6352
|
+
verbose
|
|
6353
|
+
}) {
|
|
6354
|
+
async function* getObjects() {
|
|
6355
|
+
const pageSize = batchSize ?? 100;
|
|
6356
|
+
for (const resourceType of CANVAS_RESOURCE_TYPES) {
|
|
6357
|
+
const views = paginateAsync(
|
|
6358
|
+
async (offset, limit2) => (await client.list({ resourceType, offset, limit: limit2 })).views,
|
|
6359
|
+
{
|
|
6360
|
+
pageSize,
|
|
6361
|
+
verbose,
|
|
6362
|
+
entityName: `custom views (${resourceType})`
|
|
6363
|
+
}
|
|
6364
|
+
);
|
|
6365
|
+
for await (const view of views) {
|
|
6366
|
+
if (!view.shared) {
|
|
6367
|
+
continue;
|
|
6368
|
+
}
|
|
6369
|
+
const object4 = normalizeCustomViewForSync(view);
|
|
6370
|
+
const result = {
|
|
6371
|
+
id: selectIdentifier4(object4),
|
|
6372
|
+
displayName: selectDisplayName4(object4),
|
|
6373
|
+
providerId: object4.id,
|
|
6374
|
+
object: object4
|
|
6375
|
+
};
|
|
6376
|
+
yield result;
|
|
6377
|
+
}
|
|
6378
|
+
}
|
|
6379
|
+
}
|
|
6380
|
+
return {
|
|
6381
|
+
name: "Uniform API",
|
|
6382
|
+
objects: getObjects(),
|
|
6383
|
+
deleteObject: async (providerId) => {
|
|
6384
|
+
await client.remove(providerId);
|
|
6385
|
+
},
|
|
6386
|
+
writeObject: async ({ object: object4 }) => {
|
|
6387
|
+
if (!object4.shared) {
|
|
6388
|
+
throw new Error(
|
|
6389
|
+
`Custom view "${object4.name}" (${object4.id}) is personal and cannot be pushed. Only shared views are supported.`
|
|
6390
|
+
);
|
|
6391
|
+
}
|
|
6392
|
+
await client.put(object4);
|
|
6393
|
+
}
|
|
6394
|
+
};
|
|
6395
|
+
}
|
|
6396
|
+
|
|
6397
|
+
// src/commands/canvas/commands/customView/pull.ts
|
|
6398
|
+
var CustomViewPullModule = {
|
|
6399
|
+
command: "pull <directory>",
|
|
6400
|
+
describe: "Pulls all shared custom views to local files in a directory",
|
|
6401
|
+
builder: (yargs45) => withConfiguration(
|
|
6402
|
+
withApiOptions(
|
|
6403
|
+
withDebugOptions(
|
|
6404
|
+
withProjectOptions(
|
|
6405
|
+
withDiffOptions(
|
|
6406
|
+
withBatchSizeOptions(
|
|
6407
|
+
yargs45.positional("directory", {
|
|
6408
|
+
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
6409
|
+
type: "string"
|
|
6410
|
+
}).option("format", {
|
|
6411
|
+
alias: ["f"],
|
|
6412
|
+
describe: "Output format",
|
|
6413
|
+
default: "yaml",
|
|
6414
|
+
choices: ["yaml", "json"],
|
|
6415
|
+
type: "string"
|
|
6416
|
+
}).option("mode", {
|
|
6417
|
+
alias: ["m"],
|
|
6418
|
+
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',
|
|
6419
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
6420
|
+
default: "mirror",
|
|
6421
|
+
type: "string"
|
|
6422
|
+
}),
|
|
6423
|
+
"customView"
|
|
6424
|
+
)
|
|
6425
|
+
)
|
|
6426
|
+
)
|
|
6427
|
+
)
|
|
6428
|
+
)
|
|
6429
|
+
),
|
|
6430
|
+
handler: async ({
|
|
6431
|
+
apiHost,
|
|
6432
|
+
apiKey,
|
|
6433
|
+
proxy,
|
|
6434
|
+
directory,
|
|
6435
|
+
format,
|
|
6436
|
+
mode,
|
|
6437
|
+
whatIf,
|
|
6438
|
+
project: projectId,
|
|
6439
|
+
diff: diffMode,
|
|
6440
|
+
allowEmptySource,
|
|
6441
|
+
verbose,
|
|
6442
|
+
resolvedBatchSize
|
|
6443
|
+
}) => {
|
|
6444
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6445
|
+
const client = getCustomViewClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6446
|
+
const source = createCustomViewEngineDataSource({
|
|
6447
|
+
client,
|
|
6448
|
+
verbose,
|
|
6449
|
+
batchSize: resolvedBatchSize
|
|
6450
|
+
});
|
|
6451
|
+
let target;
|
|
6452
|
+
const isPackage = isPathAPackageFile(directory);
|
|
6453
|
+
if (isPackage) {
|
|
6454
|
+
const packageContents = readCanvasPackage(directory, false, verbose);
|
|
6455
|
+
target = await createArraySyncEngineDataSource({
|
|
6456
|
+
name: `Package file ${directory}`,
|
|
6457
|
+
objects: packageContents.customViews ?? [],
|
|
6458
|
+
selectIdentifier: selectIdentifier4,
|
|
6459
|
+
selectDisplayName: selectDisplayName4,
|
|
6460
|
+
onSyncComplete: async (_, synced) => {
|
|
6461
|
+
packageContents.customViews = synced;
|
|
6462
|
+
writeCanvasPackage(directory, packageContents);
|
|
6463
|
+
}
|
|
6464
|
+
});
|
|
6465
|
+
} else {
|
|
6466
|
+
target = await createFileSyncEngineDataSource({
|
|
6467
|
+
directory,
|
|
6468
|
+
selectIdentifier: selectIdentifier4,
|
|
6469
|
+
selectDisplayName: selectDisplayName4,
|
|
6470
|
+
format,
|
|
6471
|
+
verbose
|
|
6472
|
+
});
|
|
6473
|
+
}
|
|
6474
|
+
await syncEngine({
|
|
6475
|
+
source,
|
|
6476
|
+
target,
|
|
6477
|
+
mode,
|
|
6478
|
+
whatIf,
|
|
6479
|
+
allowEmptySource: allowEmptySource ?? true,
|
|
6480
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
6481
|
+
});
|
|
6482
|
+
}
|
|
6483
|
+
};
|
|
6484
|
+
|
|
6485
|
+
// src/commands/canvas/commands/customView/push.ts
|
|
6486
|
+
var CustomViewPushModule = {
|
|
6487
|
+
command: "push <directory>",
|
|
6488
|
+
describe: "Pushes all shared custom views from files in a directory to Uniform",
|
|
6489
|
+
builder: (yargs45) => withConfiguration(
|
|
6490
|
+
withDebugOptions(
|
|
6491
|
+
withApiOptions(
|
|
6492
|
+
withProjectOptions(
|
|
6493
|
+
withDiffOptions(
|
|
6494
|
+
withBatchSizeOptions(
|
|
6495
|
+
yargs45.positional("directory", {
|
|
6496
|
+
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
6497
|
+
type: "string"
|
|
6498
|
+
}).option("mode", {
|
|
6499
|
+
alias: ["m"],
|
|
6500
|
+
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',
|
|
6501
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
6502
|
+
default: "mirror",
|
|
6503
|
+
type: "string"
|
|
6504
|
+
}),
|
|
6505
|
+
"customView"
|
|
6506
|
+
)
|
|
6507
|
+
)
|
|
6508
|
+
)
|
|
6509
|
+
)
|
|
6510
|
+
)
|
|
6511
|
+
),
|
|
6512
|
+
handler: async ({
|
|
6513
|
+
apiHost,
|
|
6514
|
+
apiKey,
|
|
6515
|
+
proxy,
|
|
6516
|
+
directory,
|
|
6517
|
+
mode,
|
|
6518
|
+
whatIf,
|
|
6519
|
+
project: projectId,
|
|
6520
|
+
diff: diffMode,
|
|
6521
|
+
allowEmptySource,
|
|
6522
|
+
verbose,
|
|
6523
|
+
resolvedBatchSize
|
|
6524
|
+
}) => {
|
|
6525
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6526
|
+
const client = getCustomViewClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
6527
|
+
let source;
|
|
6528
|
+
const isPackage = isPathAPackageFile(directory);
|
|
6529
|
+
if (isPackage) {
|
|
6530
|
+
const packageContents = readCanvasPackage(directory, true, verbose);
|
|
6531
|
+
source = await createArraySyncEngineDataSource({
|
|
6532
|
+
name: `Package file ${directory}`,
|
|
6533
|
+
objects: packageContents.customViews ?? [],
|
|
6534
|
+
selectIdentifier: selectIdentifier4,
|
|
6535
|
+
selectDisplayName: selectDisplayName4
|
|
6536
|
+
});
|
|
6537
|
+
} else {
|
|
6538
|
+
source = await createFileSyncEngineDataSource({
|
|
6539
|
+
directory,
|
|
6540
|
+
selectIdentifier: selectIdentifier4,
|
|
6541
|
+
selectDisplayName: selectDisplayName4,
|
|
6542
|
+
verbose
|
|
6543
|
+
});
|
|
6544
|
+
}
|
|
6545
|
+
const target = createCustomViewEngineDataSource({
|
|
6546
|
+
client,
|
|
6547
|
+
verbose,
|
|
6548
|
+
batchSize: resolvedBatchSize
|
|
6549
|
+
});
|
|
6550
|
+
await syncEngine({
|
|
6551
|
+
source,
|
|
6552
|
+
target,
|
|
6553
|
+
mode,
|
|
6554
|
+
whatIf,
|
|
6555
|
+
allowEmptySource,
|
|
6556
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
6557
|
+
});
|
|
6558
|
+
}
|
|
6559
|
+
};
|
|
6560
|
+
|
|
6561
|
+
// src/commands/canvas/commands/customView.ts
|
|
6562
|
+
var CustomViewModule = {
|
|
6563
|
+
command: "custom-view <command>",
|
|
6564
|
+
describe: "Commands for shared custom views",
|
|
6565
|
+
builder: (yargs45) => yargs45.command(CustomViewPullModule).command(CustomViewPushModule).demandCommand(),
|
|
6566
|
+
handler: () => {
|
|
6567
|
+
yargs12.help();
|
|
6568
|
+
}
|
|
6569
|
+
};
|
|
6570
|
+
|
|
6571
|
+
// src/commands/canvas/commands/dataSource.ts
|
|
6572
|
+
import yargs13 from "yargs";
|
|
6573
|
+
|
|
6281
6574
|
// src/commands/canvas/commands/dataSource/_util.ts
|
|
6282
6575
|
import { DataSourceClient } from "@uniformdev/canvas";
|
|
6283
6576
|
function getDataSourceClient(options) {
|
|
@@ -6288,11 +6581,11 @@ function getDataSourceClient(options) {
|
|
|
6288
6581
|
var DataSourceGetModule = {
|
|
6289
6582
|
command: "get <id>",
|
|
6290
6583
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
6291
|
-
builder: (
|
|
6584
|
+
builder: (yargs45) => withConfiguration(
|
|
6292
6585
|
withApiOptions(
|
|
6293
6586
|
withDebugOptions(
|
|
6294
6587
|
withProjectOptions(
|
|
6295
|
-
|
|
6588
|
+
yargs45.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
6296
6589
|
)
|
|
6297
6590
|
)
|
|
6298
6591
|
)
|
|
@@ -6310,11 +6603,11 @@ var DataSourceRemoveModule = {
|
|
|
6310
6603
|
command: "remove <id>",
|
|
6311
6604
|
aliases: ["delete", "rm"],
|
|
6312
6605
|
describe: "Delete a data source",
|
|
6313
|
-
builder: (
|
|
6606
|
+
builder: (yargs45) => withConfiguration(
|
|
6314
6607
|
withDebugOptions(
|
|
6315
6608
|
withApiOptions(
|
|
6316
6609
|
withProjectOptions(
|
|
6317
|
-
|
|
6610
|
+
yargs45.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
6318
6611
|
)
|
|
6319
6612
|
)
|
|
6320
6613
|
)
|
|
@@ -6335,11 +6628,11 @@ var DataSourceUpdateModule = {
|
|
|
6335
6628
|
command: "update <dataSource>",
|
|
6336
6629
|
aliases: ["put"],
|
|
6337
6630
|
describe: "Insert or update a data source",
|
|
6338
|
-
builder: (
|
|
6631
|
+
builder: (yargs45) => withConfiguration(
|
|
6339
6632
|
withApiOptions(
|
|
6340
6633
|
withDebugOptions(
|
|
6341
6634
|
withProjectOptions(
|
|
6342
|
-
|
|
6635
|
+
yargs45.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
6343
6636
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
6344
6637
|
type: "string",
|
|
6345
6638
|
demandOption: true
|
|
@@ -6374,19 +6667,19 @@ var DataSourceModule = {
|
|
|
6374
6667
|
command: "datasource <command>",
|
|
6375
6668
|
aliases: ["ds"],
|
|
6376
6669
|
describe: "Commands for Data Source definitions",
|
|
6377
|
-
builder: (
|
|
6670
|
+
builder: (yargs45) => yargs45.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
6378
6671
|
handler: () => {
|
|
6379
|
-
|
|
6672
|
+
yargs13.help();
|
|
6380
6673
|
}
|
|
6381
6674
|
};
|
|
6382
6675
|
|
|
6383
6676
|
// src/commands/canvas/commands/dataType.ts
|
|
6384
|
-
import
|
|
6677
|
+
import yargs14 from "yargs";
|
|
6385
6678
|
|
|
6386
6679
|
// src/commands/canvas/commands/dataType/_util.ts
|
|
6387
6680
|
import { DataTypeClient } from "@uniformdev/canvas";
|
|
6388
|
-
var
|
|
6389
|
-
var
|
|
6681
|
+
var selectIdentifier5 = (dataType) => dataType.id;
|
|
6682
|
+
var selectDisplayName5 = (dataType) => `${dataType.displayName} (pid: ${dataType.id})`;
|
|
6390
6683
|
function getDataTypeClient(options) {
|
|
6391
6684
|
return new DataTypeClient({ ...options, limitPolicy: cliLimitPolicy, bypassCache: true });
|
|
6392
6685
|
}
|
|
@@ -6396,12 +6689,12 @@ var DataTypeGetModule = {
|
|
|
6396
6689
|
command: "get <id>",
|
|
6397
6690
|
describe: "Get a data type",
|
|
6398
6691
|
aliases: ["ls"],
|
|
6399
|
-
builder: (
|
|
6692
|
+
builder: (yargs45) => withConfiguration(
|
|
6400
6693
|
withFormatOptions(
|
|
6401
6694
|
withDebugOptions(
|
|
6402
6695
|
withApiOptions(
|
|
6403
6696
|
withProjectOptions(
|
|
6404
|
-
|
|
6697
|
+
yargs45.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
6405
6698
|
)
|
|
6406
6699
|
)
|
|
6407
6700
|
)
|
|
@@ -6424,7 +6717,7 @@ var DataTypeListModule = {
|
|
|
6424
6717
|
command: "list",
|
|
6425
6718
|
describe: "List data types",
|
|
6426
6719
|
aliases: ["ls"],
|
|
6427
|
-
builder: (
|
|
6720
|
+
builder: (yargs45) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs45))))),
|
|
6428
6721
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
6429
6722
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6430
6723
|
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -6441,8 +6734,8 @@ function createDataTypeEngineDataSource({
|
|
|
6441
6734
|
const dataTypes = (await client.list()).results;
|
|
6442
6735
|
for await (const dataType of dataTypes) {
|
|
6443
6736
|
const result = {
|
|
6444
|
-
id:
|
|
6445
|
-
displayName:
|
|
6737
|
+
id: selectIdentifier5(dataType),
|
|
6738
|
+
displayName: selectDisplayName5(dataType),
|
|
6446
6739
|
providerId: dataType.id,
|
|
6447
6740
|
object: dataType
|
|
6448
6741
|
};
|
|
@@ -6467,12 +6760,12 @@ function createDataTypeEngineDataSource({
|
|
|
6467
6760
|
var DataTypePullModule = {
|
|
6468
6761
|
command: "pull <directory>",
|
|
6469
6762
|
describe: "Pulls all data types to local files in a directory",
|
|
6470
|
-
builder: (
|
|
6763
|
+
builder: (yargs45) => withConfiguration(
|
|
6471
6764
|
withApiOptions(
|
|
6472
6765
|
withDebugOptions(
|
|
6473
6766
|
withProjectOptions(
|
|
6474
6767
|
withDiffOptions(
|
|
6475
|
-
|
|
6768
|
+
yargs45.positional("directory", {
|
|
6476
6769
|
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.",
|
|
6477
6770
|
type: "string"
|
|
6478
6771
|
}).option("format", {
|
|
@@ -6521,8 +6814,8 @@ var DataTypePullModule = {
|
|
|
6521
6814
|
target = await createArraySyncEngineDataSource({
|
|
6522
6815
|
name: `Package file ${directory}`,
|
|
6523
6816
|
objects: packageContents.dataTypes ?? [],
|
|
6524
|
-
selectIdentifier:
|
|
6525
|
-
selectDisplayName:
|
|
6817
|
+
selectIdentifier: selectIdentifier5,
|
|
6818
|
+
selectDisplayName: selectDisplayName5,
|
|
6526
6819
|
onSyncComplete: async (_, synced) => {
|
|
6527
6820
|
packageContents.dataTypes = synced;
|
|
6528
6821
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -6531,8 +6824,8 @@ var DataTypePullModule = {
|
|
|
6531
6824
|
} else {
|
|
6532
6825
|
target = await createFileSyncEngineDataSource({
|
|
6533
6826
|
directory,
|
|
6534
|
-
selectIdentifier:
|
|
6535
|
-
selectDisplayName:
|
|
6827
|
+
selectIdentifier: selectIdentifier5,
|
|
6828
|
+
selectDisplayName: selectDisplayName5,
|
|
6536
6829
|
format,
|
|
6537
6830
|
verbose
|
|
6538
6831
|
});
|
|
@@ -6552,12 +6845,12 @@ var DataTypePullModule = {
|
|
|
6552
6845
|
var DataTypePushModule = {
|
|
6553
6846
|
command: "push <directory>",
|
|
6554
6847
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
6555
|
-
builder: (
|
|
6848
|
+
builder: (yargs45) => withConfiguration(
|
|
6556
6849
|
withApiOptions(
|
|
6557
6850
|
withDebugOptions(
|
|
6558
6851
|
withProjectOptions(
|
|
6559
6852
|
withDiffOptions(
|
|
6560
|
-
|
|
6853
|
+
yargs45.positional("directory", {
|
|
6561
6854
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
6562
6855
|
type: "string"
|
|
6563
6856
|
}).option("mode", {
|
|
@@ -6598,14 +6891,14 @@ var DataTypePushModule = {
|
|
|
6598
6891
|
source = await createArraySyncEngineDataSource({
|
|
6599
6892
|
name: `Package file ${directory}`,
|
|
6600
6893
|
objects: packageContents.dataTypes ?? [],
|
|
6601
|
-
selectIdentifier:
|
|
6602
|
-
selectDisplayName:
|
|
6894
|
+
selectIdentifier: selectIdentifier5,
|
|
6895
|
+
selectDisplayName: selectDisplayName5
|
|
6603
6896
|
});
|
|
6604
6897
|
} else {
|
|
6605
6898
|
source = await createFileSyncEngineDataSource({
|
|
6606
6899
|
directory,
|
|
6607
|
-
selectIdentifier:
|
|
6608
|
-
selectDisplayName:
|
|
6900
|
+
selectIdentifier: selectIdentifier5,
|
|
6901
|
+
selectDisplayName: selectDisplayName5,
|
|
6609
6902
|
verbose
|
|
6610
6903
|
});
|
|
6611
6904
|
}
|
|
@@ -6626,11 +6919,11 @@ var DataTypeRemoveModule = {
|
|
|
6626
6919
|
command: "remove <id>",
|
|
6627
6920
|
aliases: ["delete", "rm"],
|
|
6628
6921
|
describe: "Delete a data type",
|
|
6629
|
-
builder: (
|
|
6922
|
+
builder: (yargs45) => withConfiguration(
|
|
6630
6923
|
withDebugOptions(
|
|
6631
6924
|
withApiOptions(
|
|
6632
6925
|
withProjectOptions(
|
|
6633
|
-
|
|
6926
|
+
yargs45.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
6634
6927
|
)
|
|
6635
6928
|
)
|
|
6636
6929
|
)
|
|
@@ -6651,11 +6944,11 @@ var DataTypeUpdateModule = {
|
|
|
6651
6944
|
command: "update <filename>",
|
|
6652
6945
|
aliases: ["put"],
|
|
6653
6946
|
describe: "Insert or update a data type",
|
|
6654
|
-
builder: (
|
|
6947
|
+
builder: (yargs45) => withConfiguration(
|
|
6655
6948
|
withDebugOptions(
|
|
6656
6949
|
withApiOptions(
|
|
6657
6950
|
withProjectOptions(
|
|
6658
|
-
|
|
6951
|
+
yargs45.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
6659
6952
|
)
|
|
6660
6953
|
)
|
|
6661
6954
|
)
|
|
@@ -6677,14 +6970,14 @@ var DataTypeModule = {
|
|
|
6677
6970
|
command: "datatype <command>",
|
|
6678
6971
|
aliases: ["dt"],
|
|
6679
6972
|
describe: "Commands for Data Type definitions",
|
|
6680
|
-
builder: (
|
|
6973
|
+
builder: (yargs45) => yargs45.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
6681
6974
|
handler: () => {
|
|
6682
|
-
|
|
6975
|
+
yargs14.help();
|
|
6683
6976
|
}
|
|
6684
6977
|
};
|
|
6685
6978
|
|
|
6686
6979
|
// src/commands/canvas/commands/entry.ts
|
|
6687
|
-
import
|
|
6980
|
+
import yargs15 from "yargs";
|
|
6688
6981
|
|
|
6689
6982
|
// src/commands/canvas/commands/entry/get.ts
|
|
6690
6983
|
function createEntryGetHandler(expectedType) {
|
|
@@ -6733,13 +7026,13 @@ function createEntryGetHandler(expectedType) {
|
|
|
6733
7026
|
var EntryGetModule = {
|
|
6734
7027
|
command: "get <id>",
|
|
6735
7028
|
describe: "Get an entry",
|
|
6736
|
-
builder: (
|
|
7029
|
+
builder: (yargs45) => withConfiguration(
|
|
6737
7030
|
withDebugOptions(
|
|
6738
7031
|
withFormatOptions(
|
|
6739
7032
|
withApiOptions(
|
|
6740
7033
|
withProjectOptions(
|
|
6741
7034
|
withStateOptions(
|
|
6742
|
-
|
|
7035
|
+
yargs45.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
6743
7036
|
resolveData: {
|
|
6744
7037
|
type: "boolean",
|
|
6745
7038
|
default: false,
|
|
@@ -6773,13 +7066,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
6773
7066
|
var EntryListModule = {
|
|
6774
7067
|
command: "list",
|
|
6775
7068
|
describe: "List entries",
|
|
6776
|
-
builder: (
|
|
7069
|
+
builder: (yargs45) => withConfiguration(
|
|
6777
7070
|
withDebugOptions(
|
|
6778
7071
|
withFormatOptions(
|
|
6779
7072
|
withApiOptions(
|
|
6780
7073
|
withProjectOptions(
|
|
6781
7074
|
withStateOptions(
|
|
6782
|
-
|
|
7075
|
+
yargs45.options({
|
|
6783
7076
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
6784
7077
|
limit: {
|
|
6785
7078
|
describe: "Number of rows to fetch",
|
|
@@ -6908,13 +7201,13 @@ function createEntryEngineDataSource({
|
|
|
6908
7201
|
var EntryPublishModule = {
|
|
6909
7202
|
command: "publish [ids]",
|
|
6910
7203
|
describe: "Publishes entry(ies)",
|
|
6911
|
-
builder: (
|
|
7204
|
+
builder: (yargs45) => withConfiguration(
|
|
6912
7205
|
withDebugOptions(
|
|
6913
7206
|
withDiffOptions(
|
|
6914
7207
|
withApiOptions(
|
|
6915
7208
|
withProjectOptions(
|
|
6916
7209
|
withBatchSizeOptions(
|
|
6917
|
-
|
|
7210
|
+
yargs45.positional("ids", {
|
|
6918
7211
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6919
7212
|
type: "string"
|
|
6920
7213
|
}).option("all", {
|
|
@@ -6991,14 +7284,14 @@ var EntryPublishModule = {
|
|
|
6991
7284
|
var EntryPullModule = {
|
|
6992
7285
|
command: "pull <directory>",
|
|
6993
7286
|
describe: "Pulls all entries to local files in a directory",
|
|
6994
|
-
builder: (
|
|
7287
|
+
builder: (yargs45) => withConfiguration(
|
|
6995
7288
|
withDebugOptions(
|
|
6996
7289
|
withApiOptions(
|
|
6997
7290
|
withProjectOptions(
|
|
6998
7291
|
withStateOptions(
|
|
6999
7292
|
withDiffOptions(
|
|
7000
7293
|
withBatchSizeOptions(
|
|
7001
|
-
|
|
7294
|
+
yargs45.positional("directory", {
|
|
7002
7295
|
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.",
|
|
7003
7296
|
type: "string"
|
|
7004
7297
|
}).option("format", {
|
|
@@ -7107,14 +7400,14 @@ var EntryPullModule = {
|
|
|
7107
7400
|
var EntryPushModule = {
|
|
7108
7401
|
command: "push <directory>",
|
|
7109
7402
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
7110
|
-
builder: (
|
|
7403
|
+
builder: (yargs45) => withConfiguration(
|
|
7111
7404
|
withDebugOptions(
|
|
7112
7405
|
withApiOptions(
|
|
7113
7406
|
withProjectOptions(
|
|
7114
7407
|
withStateOptions(
|
|
7115
7408
|
withDiffOptions(
|
|
7116
7409
|
withBatchSizeOptions(
|
|
7117
|
-
|
|
7410
|
+
yargs45.positional("directory", {
|
|
7118
7411
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
7119
7412
|
type: "string"
|
|
7120
7413
|
}).option("mode", {
|
|
@@ -7253,11 +7546,11 @@ var EntryRemoveModule = {
|
|
|
7253
7546
|
command: "remove <id>",
|
|
7254
7547
|
aliases: ["delete", "rm"],
|
|
7255
7548
|
describe: "Delete an entry",
|
|
7256
|
-
builder: (
|
|
7549
|
+
builder: (yargs45) => withConfiguration(
|
|
7257
7550
|
withDebugOptions(
|
|
7258
7551
|
withApiOptions(
|
|
7259
7552
|
withProjectOptions(
|
|
7260
|
-
|
|
7553
|
+
yargs45.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
7261
7554
|
)
|
|
7262
7555
|
)
|
|
7263
7556
|
)
|
|
@@ -7271,12 +7564,12 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
7271
7564
|
var EntryUnpublishModule = {
|
|
7272
7565
|
command: "unpublish [ids]",
|
|
7273
7566
|
describe: "Unpublish an entry(ies)",
|
|
7274
|
-
builder: (
|
|
7567
|
+
builder: (yargs45) => withConfiguration(
|
|
7275
7568
|
withDebugOptions(
|
|
7276
7569
|
withApiOptions(
|
|
7277
7570
|
withProjectOptions(
|
|
7278
7571
|
withBatchSizeOptions(
|
|
7279
|
-
|
|
7572
|
+
yargs45.positional("ids", {
|
|
7280
7573
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
7281
7574
|
type: "string"
|
|
7282
7575
|
}).option("all", {
|
|
@@ -7414,12 +7707,12 @@ var EntryUpdateModule = {
|
|
|
7414
7707
|
command: "update <filename>",
|
|
7415
7708
|
aliases: ["put"],
|
|
7416
7709
|
describe: "Insert or update an entry",
|
|
7417
|
-
builder: (
|
|
7710
|
+
builder: (yargs45) => withConfiguration(
|
|
7418
7711
|
withDebugOptions(
|
|
7419
7712
|
withApiOptions(
|
|
7420
7713
|
withProjectOptions(
|
|
7421
7714
|
withStateOptions(
|
|
7422
|
-
|
|
7715
|
+
yargs45.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
7423
7716
|
)
|
|
7424
7717
|
)
|
|
7425
7718
|
)
|
|
@@ -7432,26 +7725,26 @@ var EntryUpdateModule = {
|
|
|
7432
7725
|
var EntryModule = {
|
|
7433
7726
|
command: "entry <command>",
|
|
7434
7727
|
describe: "Commands for Entries",
|
|
7435
|
-
builder: (
|
|
7728
|
+
builder: (yargs45) => yargs45.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
7436
7729
|
handler: () => {
|
|
7437
|
-
|
|
7730
|
+
yargs15.help();
|
|
7438
7731
|
}
|
|
7439
7732
|
};
|
|
7440
7733
|
|
|
7441
7734
|
// src/commands/canvas/commands/entryPattern.ts
|
|
7442
|
-
import
|
|
7735
|
+
import yargs16 from "yargs";
|
|
7443
7736
|
|
|
7444
7737
|
// src/commands/canvas/commands/entryPattern/get.ts
|
|
7445
7738
|
var EntryPatternGetModule = {
|
|
7446
7739
|
command: "get <id>",
|
|
7447
7740
|
describe: "Get an entry pattern",
|
|
7448
|
-
builder: (
|
|
7741
|
+
builder: (yargs45) => withConfiguration(
|
|
7449
7742
|
withDebugOptions(
|
|
7450
7743
|
withFormatOptions(
|
|
7451
7744
|
withApiOptions(
|
|
7452
7745
|
withProjectOptions(
|
|
7453
7746
|
withStateOptions(
|
|
7454
|
-
|
|
7747
|
+
yargs45.positional("id", { demandOption: true, describe: "Entry pattern public ID to fetch" }).option({
|
|
7455
7748
|
resolveData: {
|
|
7456
7749
|
type: "boolean",
|
|
7457
7750
|
default: false,
|
|
@@ -7483,9 +7776,9 @@ var EntryPatternGetModule = {
|
|
|
7483
7776
|
var EntryPatternListModule = {
|
|
7484
7777
|
command: "list",
|
|
7485
7778
|
describe: "List entry patterns",
|
|
7486
|
-
builder: (
|
|
7779
|
+
builder: (yargs45) => withConfiguration(
|
|
7487
7780
|
withDebugOptions(
|
|
7488
|
-
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(
|
|
7781
|
+
withFormatOptions(withApiOptions(withProjectOptions(withStateOptions(yargs45, "published"))))
|
|
7489
7782
|
)
|
|
7490
7783
|
),
|
|
7491
7784
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, state, verbose }) => {
|
|
@@ -7505,13 +7798,13 @@ var EntryPatternListModule = {
|
|
|
7505
7798
|
var EntryPatternPublishModule = {
|
|
7506
7799
|
command: "publish [ids]",
|
|
7507
7800
|
describe: "Publishes entry pattern(s)",
|
|
7508
|
-
builder: (
|
|
7801
|
+
builder: (yargs45) => withConfiguration(
|
|
7509
7802
|
withDebugOptions(
|
|
7510
7803
|
withApiOptions(
|
|
7511
7804
|
withProjectOptions(
|
|
7512
7805
|
withDiffOptions(
|
|
7513
7806
|
withBatchSizeOptions(
|
|
7514
|
-
|
|
7807
|
+
yargs45.positional("ids", {
|
|
7515
7808
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
7516
7809
|
type: "string"
|
|
7517
7810
|
}).option("all", {
|
|
@@ -7588,14 +7881,14 @@ var EntryPatternPublishModule = {
|
|
|
7588
7881
|
var EntryPatternPullModule = {
|
|
7589
7882
|
command: "pull <directory>",
|
|
7590
7883
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
7591
|
-
builder: (
|
|
7884
|
+
builder: (yargs45) => withConfiguration(
|
|
7592
7885
|
withApiOptions(
|
|
7593
7886
|
withDebugOptions(
|
|
7594
7887
|
withProjectOptions(
|
|
7595
7888
|
withStateOptions(
|
|
7596
7889
|
withDiffOptions(
|
|
7597
7890
|
withBatchSizeOptions(
|
|
7598
|
-
|
|
7891
|
+
yargs45.positional("directory", {
|
|
7599
7892
|
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.",
|
|
7600
7893
|
type: "string"
|
|
7601
7894
|
}).option("format", {
|
|
@@ -7704,14 +7997,14 @@ var EntryPatternPullModule = {
|
|
|
7704
7997
|
var EntryPatternPushModule = {
|
|
7705
7998
|
command: "push <directory>",
|
|
7706
7999
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
7707
|
-
builder: (
|
|
8000
|
+
builder: (yargs45) => withConfiguration(
|
|
7708
8001
|
withDebugOptions(
|
|
7709
8002
|
withApiOptions(
|
|
7710
8003
|
withProjectOptions(
|
|
7711
8004
|
withStateOptions(
|
|
7712
8005
|
withDiffOptions(
|
|
7713
8006
|
withBatchSizeOptions(
|
|
7714
|
-
|
|
8007
|
+
yargs45.positional("directory", {
|
|
7715
8008
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
7716
8009
|
type: "string"
|
|
7717
8010
|
}).option("what-if", {
|
|
@@ -7824,11 +8117,11 @@ var EntryPatternRemoveModule = {
|
|
|
7824
8117
|
command: "remove <id>",
|
|
7825
8118
|
aliases: ["delete", "rm"],
|
|
7826
8119
|
describe: "Delete an entry pattern",
|
|
7827
|
-
builder: (
|
|
8120
|
+
builder: (yargs45) => withConfiguration(
|
|
7828
8121
|
withDebugOptions(
|
|
7829
8122
|
withApiOptions(
|
|
7830
8123
|
withProjectOptions(
|
|
7831
|
-
|
|
8124
|
+
yargs45.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
7832
8125
|
)
|
|
7833
8126
|
)
|
|
7834
8127
|
)
|
|
@@ -7842,12 +8135,12 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
7842
8135
|
var EntryPatternUnpublishModule = {
|
|
7843
8136
|
command: "unpublish [ids]",
|
|
7844
8137
|
describe: "Unpublish entry pattern(s)",
|
|
7845
|
-
builder: (
|
|
8138
|
+
builder: (yargs45) => withConfiguration(
|
|
7846
8139
|
withDebugOptions(
|
|
7847
8140
|
withApiOptions(
|
|
7848
8141
|
withProjectOptions(
|
|
7849
8142
|
withBatchSizeOptions(
|
|
7850
|
-
|
|
8143
|
+
yargs45.positional("ids", {
|
|
7851
8144
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
7852
8145
|
type: "string"
|
|
7853
8146
|
}).option("all", {
|
|
@@ -7951,12 +8244,12 @@ var EntryPatternUpdateModule = {
|
|
|
7951
8244
|
command: "update <filename>",
|
|
7952
8245
|
aliases: ["put"],
|
|
7953
8246
|
describe: "Insert or update an entry pattern",
|
|
7954
|
-
builder: (
|
|
8247
|
+
builder: (yargs45) => withConfiguration(
|
|
7955
8248
|
withDebugOptions(
|
|
7956
8249
|
withApiOptions(
|
|
7957
8250
|
withProjectOptions(
|
|
7958
8251
|
withStateOptions(
|
|
7959
|
-
|
|
8252
|
+
yargs45.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
7960
8253
|
)
|
|
7961
8254
|
)
|
|
7962
8255
|
)
|
|
@@ -7969,14 +8262,14 @@ var EntryPatternUpdateModule = {
|
|
|
7969
8262
|
var EntryPatternModule = {
|
|
7970
8263
|
command: "entry-pattern <command>",
|
|
7971
8264
|
describe: "Commands for Entry patterns",
|
|
7972
|
-
builder: (
|
|
8265
|
+
builder: (yargs45) => yargs45.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
7973
8266
|
handler: () => {
|
|
7974
|
-
|
|
8267
|
+
yargs16.help();
|
|
7975
8268
|
}
|
|
7976
8269
|
};
|
|
7977
8270
|
|
|
7978
8271
|
// src/commands/canvas/commands/label.ts
|
|
7979
|
-
import
|
|
8272
|
+
import yargs17 from "yargs";
|
|
7980
8273
|
|
|
7981
8274
|
// src/commands/canvas/labelsEngineDataSource.ts
|
|
7982
8275
|
function normalizeLabelForSync(label) {
|
|
@@ -8028,13 +8321,13 @@ function getLabelClient(options) {
|
|
|
8028
8321
|
var LabelPullModule = {
|
|
8029
8322
|
command: "pull <directory>",
|
|
8030
8323
|
describe: "Pulls all labels to local files in a directory",
|
|
8031
|
-
builder: (
|
|
8324
|
+
builder: (yargs45) => withConfiguration(
|
|
8032
8325
|
withDebugOptions(
|
|
8033
8326
|
withApiOptions(
|
|
8034
8327
|
withProjectOptions(
|
|
8035
8328
|
withDiffOptions(
|
|
8036
8329
|
withBatchSizeOptions(
|
|
8037
|
-
|
|
8330
|
+
yargs45.positional("directory", {
|
|
8038
8331
|
describe: "Directory to save the labels to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
8039
8332
|
type: "string"
|
|
8040
8333
|
}).option("format", {
|
|
@@ -8123,13 +8416,13 @@ var __INTERNAL_MISSING_PARENT_LABEL_ERROR = "Parent label with public ID";
|
|
|
8123
8416
|
var LabelPushModule = {
|
|
8124
8417
|
command: "push <directory>",
|
|
8125
8418
|
describe: "Pushes all labels from files in a directory to Uniform",
|
|
8126
|
-
builder: (
|
|
8419
|
+
builder: (yargs45) => withConfiguration(
|
|
8127
8420
|
withDebugOptions(
|
|
8128
8421
|
withApiOptions(
|
|
8129
8422
|
withProjectOptions(
|
|
8130
8423
|
withDiffOptions(
|
|
8131
8424
|
withBatchSizeOptions(
|
|
8132
|
-
|
|
8425
|
+
yargs45.positional("directory", {
|
|
8133
8426
|
describe: "Directory to read the labels from. If a filename is used, a package will be read instead.",
|
|
8134
8427
|
type: "string"
|
|
8135
8428
|
}).option("mode", {
|
|
@@ -8227,14 +8520,14 @@ var LabelPushModule = {
|
|
|
8227
8520
|
var LabelModule = {
|
|
8228
8521
|
command: "label <command>",
|
|
8229
8522
|
describe: "Commands for label definitions",
|
|
8230
|
-
builder: (
|
|
8523
|
+
builder: (yargs45) => yargs45.command(LabelPullModule).command(LabelPushModule),
|
|
8231
8524
|
handler: () => {
|
|
8232
|
-
|
|
8525
|
+
yargs17.help();
|
|
8233
8526
|
}
|
|
8234
8527
|
};
|
|
8235
8528
|
|
|
8236
8529
|
// src/commands/canvas/commands/locale.ts
|
|
8237
|
-
import
|
|
8530
|
+
import yargs18 from "yargs";
|
|
8238
8531
|
|
|
8239
8532
|
// src/commands/canvas/localesEngineDataSource.ts
|
|
8240
8533
|
function createLocaleEngineDataSource({
|
|
@@ -8276,12 +8569,12 @@ function getLocaleClient(options) {
|
|
|
8276
8569
|
var LocalePullModule = {
|
|
8277
8570
|
command: "pull <directory>",
|
|
8278
8571
|
describe: "Pulls all locales to local files in a directory",
|
|
8279
|
-
builder: (
|
|
8572
|
+
builder: (yargs45) => withConfiguration(
|
|
8280
8573
|
withDebugOptions(
|
|
8281
8574
|
withApiOptions(
|
|
8282
8575
|
withProjectOptions(
|
|
8283
8576
|
withDiffOptions(
|
|
8284
|
-
|
|
8577
|
+
yargs45.positional("directory", {
|
|
8285
8578
|
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.",
|
|
8286
8579
|
type: "string"
|
|
8287
8580
|
}).option("format", {
|
|
@@ -8361,12 +8654,12 @@ var LocalePullModule = {
|
|
|
8361
8654
|
var LocalePushModule = {
|
|
8362
8655
|
command: "push <directory>",
|
|
8363
8656
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
8364
|
-
builder: (
|
|
8657
|
+
builder: (yargs45) => withConfiguration(
|
|
8365
8658
|
withDebugOptions(
|
|
8366
8659
|
withApiOptions(
|
|
8367
8660
|
withProjectOptions(
|
|
8368
8661
|
withDiffOptions(
|
|
8369
|
-
|
|
8662
|
+
yargs45.positional("directory", {
|
|
8370
8663
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
8371
8664
|
type: "string"
|
|
8372
8665
|
}).option("mode", {
|
|
@@ -8434,19 +8727,19 @@ var LocalePushModule = {
|
|
|
8434
8727
|
var LocaleModule = {
|
|
8435
8728
|
command: "locale <command>",
|
|
8436
8729
|
describe: "Commands for locale definitions",
|
|
8437
|
-
builder: (
|
|
8730
|
+
builder: (yargs45) => yargs45.command(LocalePullModule).command(LocalePushModule),
|
|
8438
8731
|
handler: () => {
|
|
8439
|
-
|
|
8732
|
+
yargs18.help();
|
|
8440
8733
|
}
|
|
8441
8734
|
};
|
|
8442
8735
|
|
|
8443
8736
|
// src/commands/canvas/commands/previewUrl.ts
|
|
8444
|
-
import
|
|
8737
|
+
import yargs19 from "yargs";
|
|
8445
8738
|
|
|
8446
8739
|
// src/commands/canvas/commands/previewUrl/_util.ts
|
|
8447
8740
|
import { PreviewClient } from "@uniformdev/canvas";
|
|
8448
|
-
var
|
|
8449
|
-
var
|
|
8741
|
+
var selectIdentifier6 = (previewUrl) => previewUrl.id;
|
|
8742
|
+
var selectDisplayName6 = (previewUrl) => `${previewUrl.name} (pid: ${previewUrl.id})`;
|
|
8450
8743
|
function getPreviewClient(options) {
|
|
8451
8744
|
return new PreviewClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
8452
8745
|
}
|
|
@@ -8455,12 +8748,12 @@ function getPreviewClient(options) {
|
|
|
8455
8748
|
var PreviewUrlGetModule = {
|
|
8456
8749
|
command: "get <id>",
|
|
8457
8750
|
describe: "Fetch a preview URL",
|
|
8458
|
-
builder: (
|
|
8751
|
+
builder: (yargs45) => withConfiguration(
|
|
8459
8752
|
withFormatOptions(
|
|
8460
8753
|
withDebugOptions(
|
|
8461
8754
|
withApiOptions(
|
|
8462
8755
|
withProjectOptions(
|
|
8463
|
-
|
|
8756
|
+
yargs45.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
8464
8757
|
)
|
|
8465
8758
|
)
|
|
8466
8759
|
)
|
|
@@ -8484,8 +8777,8 @@ var PreviewUrlListModule = {
|
|
|
8484
8777
|
command: "list",
|
|
8485
8778
|
describe: "List preview URLs",
|
|
8486
8779
|
aliases: ["ls"],
|
|
8487
|
-
builder: (
|
|
8488
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
8780
|
+
builder: (yargs45) => withConfiguration(
|
|
8781
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs45.options({})))))
|
|
8489
8782
|
),
|
|
8490
8783
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
8491
8784
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -8503,8 +8796,8 @@ function createPreviewUrlEngineDataSource({
|
|
|
8503
8796
|
const previewUrls = (await client.getPreviewUrls()).previewUrls;
|
|
8504
8797
|
for await (const previewUrl of previewUrls) {
|
|
8505
8798
|
const result = {
|
|
8506
|
-
id:
|
|
8507
|
-
displayName:
|
|
8799
|
+
id: selectIdentifier6(previewUrl),
|
|
8800
|
+
displayName: selectDisplayName6(previewUrl),
|
|
8508
8801
|
providerId: previewUrl.id,
|
|
8509
8802
|
object: previewUrl
|
|
8510
8803
|
};
|
|
@@ -8527,12 +8820,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
8527
8820
|
var PreviewUrlPullModule = {
|
|
8528
8821
|
command: "pull <directory>",
|
|
8529
8822
|
describe: "Pulls all preview urls to local files in a directory",
|
|
8530
|
-
builder: (
|
|
8823
|
+
builder: (yargs45) => withConfiguration(
|
|
8531
8824
|
withApiOptions(
|
|
8532
8825
|
withProjectOptions(
|
|
8533
8826
|
withDebugOptions(
|
|
8534
8827
|
withDiffOptions(
|
|
8535
|
-
|
|
8828
|
+
yargs45.positional("directory", {
|
|
8536
8829
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
8537
8830
|
type: "string"
|
|
8538
8831
|
}).option("format", {
|
|
@@ -8576,8 +8869,8 @@ var PreviewUrlPullModule = {
|
|
|
8576
8869
|
target = await createArraySyncEngineDataSource({
|
|
8577
8870
|
name: `Package file ${directory}`,
|
|
8578
8871
|
objects: packageContents.previewUrls ?? [],
|
|
8579
|
-
selectIdentifier:
|
|
8580
|
-
selectDisplayName:
|
|
8872
|
+
selectIdentifier: selectIdentifier6,
|
|
8873
|
+
selectDisplayName: selectDisplayName6,
|
|
8581
8874
|
onSyncComplete: async (_, synced) => {
|
|
8582
8875
|
packageContents.previewUrls = synced;
|
|
8583
8876
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -8586,9 +8879,9 @@ var PreviewUrlPullModule = {
|
|
|
8586
8879
|
} else {
|
|
8587
8880
|
target = await createFileSyncEngineDataSource({
|
|
8588
8881
|
directory,
|
|
8589
|
-
selectIdentifier:
|
|
8590
|
-
selectDisplayName:
|
|
8591
|
-
format,
|
|
8882
|
+
selectIdentifier: selectIdentifier6,
|
|
8883
|
+
selectDisplayName: selectDisplayName6,
|
|
8884
|
+
format,
|
|
8592
8885
|
verbose
|
|
8593
8886
|
});
|
|
8594
8887
|
}
|
|
@@ -8607,12 +8900,12 @@ var PreviewUrlPullModule = {
|
|
|
8607
8900
|
var PreviewUrlPushModule = {
|
|
8608
8901
|
command: "push <directory>",
|
|
8609
8902
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
8610
|
-
builder: (
|
|
8903
|
+
builder: (yargs45) => withConfiguration(
|
|
8611
8904
|
withApiOptions(
|
|
8612
8905
|
withProjectOptions(
|
|
8613
8906
|
withDiffOptions(
|
|
8614
8907
|
withDebugOptions(
|
|
8615
|
-
|
|
8908
|
+
yargs45.positional("directory", {
|
|
8616
8909
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8617
8910
|
type: "string"
|
|
8618
8911
|
}).option("mode", {
|
|
@@ -8648,14 +8941,14 @@ var PreviewUrlPushModule = {
|
|
|
8648
8941
|
source = await createArraySyncEngineDataSource({
|
|
8649
8942
|
name: `Package file ${directory}`,
|
|
8650
8943
|
objects: packageContents.previewUrls ?? [],
|
|
8651
|
-
selectIdentifier:
|
|
8652
|
-
selectDisplayName:
|
|
8944
|
+
selectIdentifier: selectIdentifier6,
|
|
8945
|
+
selectDisplayName: selectDisplayName6
|
|
8653
8946
|
});
|
|
8654
8947
|
} else {
|
|
8655
8948
|
source = await createFileSyncEngineDataSource({
|
|
8656
8949
|
directory,
|
|
8657
|
-
selectIdentifier:
|
|
8658
|
-
selectDisplayName:
|
|
8950
|
+
selectIdentifier: selectIdentifier6,
|
|
8951
|
+
selectDisplayName: selectDisplayName6,
|
|
8659
8952
|
verbose
|
|
8660
8953
|
});
|
|
8661
8954
|
}
|
|
@@ -8676,11 +8969,11 @@ var PreviewUrlRemoveModule = {
|
|
|
8676
8969
|
command: "remove <id>",
|
|
8677
8970
|
aliases: ["delete", "rm"],
|
|
8678
8971
|
describe: "Delete a preview URL",
|
|
8679
|
-
builder: (
|
|
8972
|
+
builder: (yargs45) => withConfiguration(
|
|
8680
8973
|
withApiOptions(
|
|
8681
8974
|
withDebugOptions(
|
|
8682
8975
|
withProjectOptions(
|
|
8683
|
-
|
|
8976
|
+
yargs45.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
8684
8977
|
)
|
|
8685
8978
|
)
|
|
8686
8979
|
)
|
|
@@ -8701,11 +8994,11 @@ var PreviewUrlUpdateModule = {
|
|
|
8701
8994
|
command: "update <filename>",
|
|
8702
8995
|
aliases: ["put"],
|
|
8703
8996
|
describe: "Insert or update a preview URL",
|
|
8704
|
-
builder: (
|
|
8997
|
+
builder: (yargs45) => withConfiguration(
|
|
8705
8998
|
withDebugOptions(
|
|
8706
8999
|
withApiOptions(
|
|
8707
9000
|
withProjectOptions(
|
|
8708
|
-
|
|
9001
|
+
yargs45.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
8709
9002
|
)
|
|
8710
9003
|
)
|
|
8711
9004
|
)
|
|
@@ -8727,25 +9020,25 @@ var PreviewUrlModule = {
|
|
|
8727
9020
|
command: "preview-url <command>",
|
|
8728
9021
|
aliases: ["pu"],
|
|
8729
9022
|
describe: "Commands for Canvas preview urls",
|
|
8730
|
-
builder: (
|
|
9023
|
+
builder: (yargs45) => yargs45.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
8731
9024
|
handler: () => {
|
|
8732
|
-
|
|
9025
|
+
yargs19.help();
|
|
8733
9026
|
}
|
|
8734
9027
|
};
|
|
8735
9028
|
|
|
8736
9029
|
// src/commands/canvas/commands/previewViewport.ts
|
|
8737
|
-
import
|
|
9030
|
+
import yargs20 from "yargs";
|
|
8738
9031
|
|
|
8739
9032
|
// src/commands/canvas/commands/previewViewport/get.ts
|
|
8740
9033
|
var PreviewViewportGetModule = {
|
|
8741
9034
|
command: "get <id>",
|
|
8742
9035
|
describe: "Fetch a preview viewport",
|
|
8743
|
-
builder: (
|
|
9036
|
+
builder: (yargs45) => withConfiguration(
|
|
8744
9037
|
withFormatOptions(
|
|
8745
9038
|
withDebugOptions(
|
|
8746
9039
|
withApiOptions(
|
|
8747
9040
|
withProjectOptions(
|
|
8748
|
-
|
|
9041
|
+
yargs45.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
8749
9042
|
)
|
|
8750
9043
|
)
|
|
8751
9044
|
)
|
|
@@ -8769,8 +9062,8 @@ var PreviewViewportListModule = {
|
|
|
8769
9062
|
command: "list",
|
|
8770
9063
|
describe: "List preview viewports",
|
|
8771
9064
|
aliases: ["ls"],
|
|
8772
|
-
builder: (
|
|
8773
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
9065
|
+
builder: (yargs45) => withConfiguration(
|
|
9066
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs45.options({})))))
|
|
8774
9067
|
),
|
|
8775
9068
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
8776
9069
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -8781,8 +9074,8 @@ var PreviewViewportListModule = {
|
|
|
8781
9074
|
};
|
|
8782
9075
|
|
|
8783
9076
|
// src/commands/canvas/commands/previewViewport/_util.ts
|
|
8784
|
-
var
|
|
8785
|
-
var
|
|
9077
|
+
var selectIdentifier7 = (previewViewport) => previewViewport.id;
|
|
9078
|
+
var selectDisplayName7 = (previewViewport) => `${previewViewport.name} (pid: ${previewViewport.id})`;
|
|
8786
9079
|
|
|
8787
9080
|
// src/commands/canvas/previewViewportEngineDataSource.ts
|
|
8788
9081
|
function createPreviewViewportEngineDataSource({
|
|
@@ -8792,8 +9085,8 @@ function createPreviewViewportEngineDataSource({
|
|
|
8792
9085
|
const previewViewports = (await client.getPreviewViewports()).previewViewports;
|
|
8793
9086
|
for await (const previewViewport of previewViewports) {
|
|
8794
9087
|
const result = {
|
|
8795
|
-
id:
|
|
8796
|
-
displayName:
|
|
9088
|
+
id: selectIdentifier7(previewViewport),
|
|
9089
|
+
displayName: selectDisplayName7(previewViewport),
|
|
8797
9090
|
providerId: previewViewport.id,
|
|
8798
9091
|
object: previewViewport
|
|
8799
9092
|
};
|
|
@@ -8816,12 +9109,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
8816
9109
|
var PreviewViewportPullModule = {
|
|
8817
9110
|
command: "pull <directory>",
|
|
8818
9111
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
8819
|
-
builder: (
|
|
9112
|
+
builder: (yargs45) => withConfiguration(
|
|
8820
9113
|
withApiOptions(
|
|
8821
9114
|
withProjectOptions(
|
|
8822
9115
|
withDebugOptions(
|
|
8823
9116
|
withDiffOptions(
|
|
8824
|
-
|
|
9117
|
+
yargs45.positional("directory", {
|
|
8825
9118
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
8826
9119
|
type: "string"
|
|
8827
9120
|
}).option("format", {
|
|
@@ -8865,8 +9158,8 @@ var PreviewViewportPullModule = {
|
|
|
8865
9158
|
target = await createArraySyncEngineDataSource({
|
|
8866
9159
|
name: `Package file ${directory}`,
|
|
8867
9160
|
objects: packageContents.previewViewports ?? [],
|
|
8868
|
-
selectIdentifier:
|
|
8869
|
-
selectDisplayName:
|
|
9161
|
+
selectIdentifier: selectIdentifier7,
|
|
9162
|
+
selectDisplayName: selectDisplayName7,
|
|
8870
9163
|
onSyncComplete: async (_, synced) => {
|
|
8871
9164
|
packageContents.previewViewports = synced;
|
|
8872
9165
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -8875,8 +9168,8 @@ var PreviewViewportPullModule = {
|
|
|
8875
9168
|
} else {
|
|
8876
9169
|
target = await createFileSyncEngineDataSource({
|
|
8877
9170
|
directory,
|
|
8878
|
-
selectIdentifier:
|
|
8879
|
-
selectDisplayName:
|
|
9171
|
+
selectIdentifier: selectIdentifier7,
|
|
9172
|
+
selectDisplayName: selectDisplayName7,
|
|
8880
9173
|
format,
|
|
8881
9174
|
verbose
|
|
8882
9175
|
});
|
|
@@ -8896,12 +9189,12 @@ var PreviewViewportPullModule = {
|
|
|
8896
9189
|
var PreviewViewportPushModule = {
|
|
8897
9190
|
command: "push <directory>",
|
|
8898
9191
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
8899
|
-
builder: (
|
|
9192
|
+
builder: (yargs45) => withConfiguration(
|
|
8900
9193
|
withApiOptions(
|
|
8901
9194
|
withProjectOptions(
|
|
8902
9195
|
withDiffOptions(
|
|
8903
9196
|
withDebugOptions(
|
|
8904
|
-
|
|
9197
|
+
yargs45.positional("directory", {
|
|
8905
9198
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8906
9199
|
type: "string"
|
|
8907
9200
|
}).option("mode", {
|
|
@@ -8937,14 +9230,14 @@ var PreviewViewportPushModule = {
|
|
|
8937
9230
|
source = await createArraySyncEngineDataSource({
|
|
8938
9231
|
name: `Package file ${directory}`,
|
|
8939
9232
|
objects: packageContents.previewViewports ?? [],
|
|
8940
|
-
selectIdentifier:
|
|
8941
|
-
selectDisplayName:
|
|
9233
|
+
selectIdentifier: selectIdentifier7,
|
|
9234
|
+
selectDisplayName: selectDisplayName7
|
|
8942
9235
|
});
|
|
8943
9236
|
} else {
|
|
8944
9237
|
source = await createFileSyncEngineDataSource({
|
|
8945
9238
|
directory,
|
|
8946
|
-
selectIdentifier:
|
|
8947
|
-
selectDisplayName:
|
|
9239
|
+
selectIdentifier: selectIdentifier7,
|
|
9240
|
+
selectDisplayName: selectDisplayName7,
|
|
8948
9241
|
verbose
|
|
8949
9242
|
});
|
|
8950
9243
|
}
|
|
@@ -8965,11 +9258,11 @@ var PreviewViewportRemoveModule = {
|
|
|
8965
9258
|
command: "remove <id>",
|
|
8966
9259
|
aliases: ["delete", "rm"],
|
|
8967
9260
|
describe: "Delete a preview viewport",
|
|
8968
|
-
builder: (
|
|
9261
|
+
builder: (yargs45) => withConfiguration(
|
|
8969
9262
|
withApiOptions(
|
|
8970
9263
|
withDebugOptions(
|
|
8971
9264
|
withProjectOptions(
|
|
8972
|
-
|
|
9265
|
+
yargs45.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
8973
9266
|
)
|
|
8974
9267
|
)
|
|
8975
9268
|
)
|
|
@@ -8990,11 +9283,11 @@ var PreviewViewportUpdateModule = {
|
|
|
8990
9283
|
command: "update <filename>",
|
|
8991
9284
|
aliases: ["put"],
|
|
8992
9285
|
describe: "Insert or update a preview viewport",
|
|
8993
|
-
builder: (
|
|
9286
|
+
builder: (yargs45) => withConfiguration(
|
|
8994
9287
|
withDebugOptions(
|
|
8995
9288
|
withApiOptions(
|
|
8996
9289
|
withProjectOptions(
|
|
8997
|
-
|
|
9290
|
+
yargs45.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
8998
9291
|
)
|
|
8999
9292
|
)
|
|
9000
9293
|
)
|
|
@@ -9016,14 +9309,14 @@ var PreviewViewportModule = {
|
|
|
9016
9309
|
command: "preview-viewport <command>",
|
|
9017
9310
|
aliases: ["pv"],
|
|
9018
9311
|
describe: "Commands for Canvas preview viewports",
|
|
9019
|
-
builder: (
|
|
9312
|
+
builder: (yargs45) => yargs45.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
9020
9313
|
handler: () => {
|
|
9021
|
-
|
|
9314
|
+
yargs20.help();
|
|
9022
9315
|
}
|
|
9023
9316
|
};
|
|
9024
9317
|
|
|
9025
9318
|
// src/commands/canvas/commands/prompts.ts
|
|
9026
|
-
import
|
|
9319
|
+
import yargs21 from "yargs";
|
|
9027
9320
|
|
|
9028
9321
|
// src/commands/canvas/commands/prompts/_util.ts
|
|
9029
9322
|
import { PromptClient } from "@uniformdev/canvas";
|
|
@@ -9035,12 +9328,12 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
9035
9328
|
var PromptGetModule = {
|
|
9036
9329
|
command: "get <id>",
|
|
9037
9330
|
describe: "Get a prompt",
|
|
9038
|
-
builder: (
|
|
9331
|
+
builder: (yargs45) => withConfiguration(
|
|
9039
9332
|
withDebugOptions(
|
|
9040
9333
|
withFormatOptions(
|
|
9041
9334
|
withApiOptions(
|
|
9042
9335
|
withProjectOptions(
|
|
9043
|
-
|
|
9336
|
+
yargs45.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
9044
9337
|
)
|
|
9045
9338
|
)
|
|
9046
9339
|
)
|
|
@@ -9061,7 +9354,7 @@ var PromptGetModule = {
|
|
|
9061
9354
|
var PromptListModule = {
|
|
9062
9355
|
command: "list",
|
|
9063
9356
|
describe: "List prompts",
|
|
9064
|
-
builder: (
|
|
9357
|
+
builder: (yargs45) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs45))))),
|
|
9065
9358
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
9066
9359
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
9067
9360
|
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9102,13 +9395,13 @@ function createPromptEngineDataSource({
|
|
|
9102
9395
|
var PromptPullModule = {
|
|
9103
9396
|
command: "pull <directory>",
|
|
9104
9397
|
describe: "Pulls all prompts to local files in a directory",
|
|
9105
|
-
builder: (
|
|
9398
|
+
builder: (yargs45) => withConfiguration(
|
|
9106
9399
|
withDebugOptions(
|
|
9107
9400
|
withApiOptions(
|
|
9108
9401
|
withProjectOptions(
|
|
9109
9402
|
withStateOptions(
|
|
9110
9403
|
withDiffOptions(
|
|
9111
|
-
|
|
9404
|
+
yargs45.positional("directory", {
|
|
9112
9405
|
describe: "Directory to save the prompts to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
9113
9406
|
type: "string"
|
|
9114
9407
|
}).option("format", {
|
|
@@ -9189,12 +9482,12 @@ var PromptPullModule = {
|
|
|
9189
9482
|
var PromptPushModule = {
|
|
9190
9483
|
command: "push <directory>",
|
|
9191
9484
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
9192
|
-
builder: (
|
|
9485
|
+
builder: (yargs45) => withConfiguration(
|
|
9193
9486
|
withApiOptions(
|
|
9194
9487
|
withProjectOptions(
|
|
9195
9488
|
withStateOptions(
|
|
9196
9489
|
withDiffOptions(
|
|
9197
|
-
|
|
9490
|
+
yargs45.positional("directory", {
|
|
9198
9491
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
9199
9492
|
type: "string"
|
|
9200
9493
|
}).option("mode", {
|
|
@@ -9263,10 +9556,10 @@ var PromptRemoveModule = {
|
|
|
9263
9556
|
command: "remove <id>",
|
|
9264
9557
|
aliases: ["delete", "rm"],
|
|
9265
9558
|
describe: "Delete a prompt",
|
|
9266
|
-
builder: (
|
|
9559
|
+
builder: (yargs45) => withConfiguration(
|
|
9267
9560
|
withDebugOptions(
|
|
9268
9561
|
withApiOptions(
|
|
9269
|
-
withProjectOptions(
|
|
9562
|
+
withProjectOptions(yargs45.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
9270
9563
|
)
|
|
9271
9564
|
)
|
|
9272
9565
|
),
|
|
@@ -9286,11 +9579,11 @@ var PromptUpdateModule = {
|
|
|
9286
9579
|
command: "update <filename>",
|
|
9287
9580
|
aliases: ["put"],
|
|
9288
9581
|
describe: "Insert or update a prompt",
|
|
9289
|
-
builder: (
|
|
9582
|
+
builder: (yargs45) => withConfiguration(
|
|
9290
9583
|
withDebugOptions(
|
|
9291
9584
|
withApiOptions(
|
|
9292
9585
|
withProjectOptions(
|
|
9293
|
-
|
|
9586
|
+
yargs45.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
9294
9587
|
)
|
|
9295
9588
|
)
|
|
9296
9589
|
)
|
|
@@ -9311,19 +9604,19 @@ var PromptUpdateModule = {
|
|
|
9311
9604
|
var PromptModule = {
|
|
9312
9605
|
command: "prompt <command>",
|
|
9313
9606
|
describe: "Commands for AI Prompt definitions",
|
|
9314
|
-
builder: (
|
|
9607
|
+
builder: (yargs45) => yargs45.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
9315
9608
|
handler: () => {
|
|
9316
|
-
|
|
9609
|
+
yargs21.help();
|
|
9317
9610
|
}
|
|
9318
9611
|
};
|
|
9319
9612
|
|
|
9320
9613
|
// src/commands/canvas/commands/workflow.ts
|
|
9321
|
-
import
|
|
9614
|
+
import yargs22 from "yargs";
|
|
9322
9615
|
|
|
9323
9616
|
// src/commands/canvas/commands/workflow/_util.ts
|
|
9324
9617
|
import { WorkflowClient } from "@uniformdev/canvas";
|
|
9325
|
-
var
|
|
9326
|
-
var
|
|
9618
|
+
var selectIdentifier8 = (workflow) => workflow.id;
|
|
9619
|
+
var selectDisplayName8 = (workflow) => `${workflow.name} (pid: ${workflow.id})`;
|
|
9327
9620
|
var getWorkflowClient = (options) => new WorkflowClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
9328
9621
|
|
|
9329
9622
|
// src/commands/canvas/workflowEngineDataSource.ts
|
|
@@ -9341,8 +9634,8 @@ function createWorkflowEngineDataSource({
|
|
|
9341
9634
|
for await (const workflow of workflows) {
|
|
9342
9635
|
const { modified, modifiedBy, created, createdBy, ...workflowWithoutStatistics } = workflow;
|
|
9343
9636
|
const result = {
|
|
9344
|
-
id:
|
|
9345
|
-
displayName:
|
|
9637
|
+
id: selectIdentifier8(workflow),
|
|
9638
|
+
displayName: selectDisplayName8(workflow),
|
|
9346
9639
|
providerId: workflow.id,
|
|
9347
9640
|
object: workflowWithoutStatistics
|
|
9348
9641
|
};
|
|
@@ -9365,13 +9658,13 @@ function createWorkflowEngineDataSource({
|
|
|
9365
9658
|
var WorkflowPullModule = {
|
|
9366
9659
|
command: "pull <directory>",
|
|
9367
9660
|
describe: "Pulls all workflows to local files in a directory",
|
|
9368
|
-
builder: (
|
|
9661
|
+
builder: (yargs45) => withConfiguration(
|
|
9369
9662
|
withApiOptions(
|
|
9370
9663
|
withDebugOptions(
|
|
9371
9664
|
withProjectOptions(
|
|
9372
9665
|
withDiffOptions(
|
|
9373
9666
|
withBatchSizeOptions(
|
|
9374
|
-
|
|
9667
|
+
yargs45.positional("directory", {
|
|
9375
9668
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
9376
9669
|
type: "string"
|
|
9377
9670
|
}).option("format", {
|
|
@@ -9422,8 +9715,8 @@ var WorkflowPullModule = {
|
|
|
9422
9715
|
target = await createArraySyncEngineDataSource({
|
|
9423
9716
|
name: `Package file ${directory}`,
|
|
9424
9717
|
objects: packageContents.workflows ?? [],
|
|
9425
|
-
selectIdentifier:
|
|
9426
|
-
selectDisplayName:
|
|
9718
|
+
selectIdentifier: selectIdentifier8,
|
|
9719
|
+
selectDisplayName: selectDisplayName8,
|
|
9427
9720
|
onSyncComplete: async (_, synced) => {
|
|
9428
9721
|
packageContents.workflows = synced;
|
|
9429
9722
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -9432,8 +9725,8 @@ var WorkflowPullModule = {
|
|
|
9432
9725
|
} else {
|
|
9433
9726
|
target = await createFileSyncEngineDataSource({
|
|
9434
9727
|
directory,
|
|
9435
|
-
selectIdentifier:
|
|
9436
|
-
selectDisplayName:
|
|
9728
|
+
selectIdentifier: selectIdentifier8,
|
|
9729
|
+
selectDisplayName: selectDisplayName8,
|
|
9437
9730
|
format,
|
|
9438
9731
|
verbose
|
|
9439
9732
|
});
|
|
@@ -9453,13 +9746,13 @@ var WorkflowPullModule = {
|
|
|
9453
9746
|
var WorkflowPushModule = {
|
|
9454
9747
|
command: "push <directory>",
|
|
9455
9748
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
9456
|
-
builder: (
|
|
9749
|
+
builder: (yargs45) => withConfiguration(
|
|
9457
9750
|
withDebugOptions(
|
|
9458
9751
|
withApiOptions(
|
|
9459
9752
|
withProjectOptions(
|
|
9460
9753
|
withDiffOptions(
|
|
9461
9754
|
withBatchSizeOptions(
|
|
9462
|
-
|
|
9755
|
+
yargs45.positional("directory", {
|
|
9463
9756
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
9464
9757
|
type: "string"
|
|
9465
9758
|
}).option("mode", {
|
|
@@ -9498,14 +9791,14 @@ var WorkflowPushModule = {
|
|
|
9498
9791
|
source = await createArraySyncEngineDataSource({
|
|
9499
9792
|
name: `Package file ${directory}`,
|
|
9500
9793
|
objects: packageContents.workflows ?? [],
|
|
9501
|
-
selectIdentifier:
|
|
9502
|
-
selectDisplayName:
|
|
9794
|
+
selectIdentifier: selectIdentifier8,
|
|
9795
|
+
selectDisplayName: selectDisplayName8
|
|
9503
9796
|
});
|
|
9504
9797
|
} else {
|
|
9505
9798
|
source = await createFileSyncEngineDataSource({
|
|
9506
9799
|
directory,
|
|
9507
|
-
selectIdentifier:
|
|
9508
|
-
selectDisplayName:
|
|
9800
|
+
selectIdentifier: selectIdentifier8,
|
|
9801
|
+
selectDisplayName: selectDisplayName8,
|
|
9509
9802
|
verbose
|
|
9510
9803
|
});
|
|
9511
9804
|
}
|
|
@@ -9530,9 +9823,9 @@ var WorkflowModule = {
|
|
|
9530
9823
|
command: "workflow <command>",
|
|
9531
9824
|
aliases: ["wf"],
|
|
9532
9825
|
describe: "Commands for Canvas workflows",
|
|
9533
|
-
builder: (
|
|
9826
|
+
builder: (yargs45) => yargs45.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
9534
9827
|
handler: () => {
|
|
9535
|
-
|
|
9828
|
+
yargs22.help();
|
|
9536
9829
|
}
|
|
9537
9830
|
};
|
|
9538
9831
|
|
|
@@ -9541,33 +9834,33 @@ var CanvasCommand = {
|
|
|
9541
9834
|
command: "canvas <command>",
|
|
9542
9835
|
aliases: ["cv", "pm", "presentation"],
|
|
9543
9836
|
describe: "Uniform Canvas commands",
|
|
9544
|
-
builder: (
|
|
9837
|
+
builder: (yargs45) => yargs45.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LabelModule).command(LocaleModule).command(WorkflowModule).command(CustomViewModule).command(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
9545
9838
|
handler: () => {
|
|
9546
|
-
|
|
9839
|
+
yargs23.showHelp();
|
|
9547
9840
|
}
|
|
9548
9841
|
};
|
|
9549
9842
|
|
|
9550
9843
|
// src/commands/context/index.ts
|
|
9551
|
-
import
|
|
9844
|
+
import yargs30 from "yargs";
|
|
9552
9845
|
|
|
9553
9846
|
// src/commands/context/commands/aggregate.ts
|
|
9554
|
-
import
|
|
9847
|
+
import yargs24 from "yargs";
|
|
9555
9848
|
|
|
9556
9849
|
// src/commands/context/commands/aggregate/_util.ts
|
|
9557
9850
|
import { AggregateClient } from "@uniformdev/context/api";
|
|
9558
|
-
var
|
|
9559
|
-
var
|
|
9851
|
+
var selectIdentifier9 = (source) => source.id;
|
|
9852
|
+
var selectDisplayName9 = (source) => `${source.name} (pid: ${source.id})`;
|
|
9560
9853
|
var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
9561
9854
|
|
|
9562
9855
|
// src/commands/context/commands/aggregate/get.ts
|
|
9563
9856
|
var AggregateGetModule = {
|
|
9564
9857
|
command: "get <id>",
|
|
9565
9858
|
describe: "Fetch an aggregate",
|
|
9566
|
-
builder: (
|
|
9859
|
+
builder: (yargs45) => withConfiguration(
|
|
9567
9860
|
withFormatOptions(
|
|
9568
9861
|
withApiOptions(
|
|
9569
9862
|
withProjectOptions(
|
|
9570
|
-
|
|
9863
|
+
yargs45.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
9571
9864
|
)
|
|
9572
9865
|
)
|
|
9573
9866
|
)
|
|
@@ -9590,7 +9883,7 @@ var AggregateListModule = {
|
|
|
9590
9883
|
command: "list",
|
|
9591
9884
|
describe: "List aggregates",
|
|
9592
9885
|
aliases: ["ls"],
|
|
9593
|
-
builder: (
|
|
9886
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
9594
9887
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9595
9888
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9596
9889
|
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9608,8 +9901,8 @@ function createAggregateEngineDataSource({
|
|
|
9608
9901
|
const aggregates = (await client.get({ type })).aggregates;
|
|
9609
9902
|
for await (const def of aggregates) {
|
|
9610
9903
|
const result = {
|
|
9611
|
-
id:
|
|
9612
|
-
displayName:
|
|
9904
|
+
id: selectIdentifier9(def),
|
|
9905
|
+
displayName: selectDisplayName9(def),
|
|
9613
9906
|
providerId: def.id,
|
|
9614
9907
|
object: def
|
|
9615
9908
|
};
|
|
@@ -9653,12 +9946,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
9653
9946
|
var AggregatePullModule = {
|
|
9654
9947
|
command: "pull <directory>",
|
|
9655
9948
|
describe: "Pulls all aggregates to local files in a directory",
|
|
9656
|
-
builder: (
|
|
9949
|
+
builder: (yargs45) => withConfiguration(
|
|
9657
9950
|
withApiOptions(
|
|
9658
9951
|
withDebugOptions(
|
|
9659
9952
|
withProjectOptions(
|
|
9660
9953
|
withDiffOptions(
|
|
9661
|
-
|
|
9954
|
+
yargs45.positional("directory", {
|
|
9662
9955
|
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.",
|
|
9663
9956
|
type: "string"
|
|
9664
9957
|
}).option("format", {
|
|
@@ -9702,8 +9995,8 @@ var AggregatePullModule = {
|
|
|
9702
9995
|
target = await createArraySyncEngineDataSource({
|
|
9703
9996
|
name: `Package file ${directory}`,
|
|
9704
9997
|
objects: packageContents.aggregates ?? [],
|
|
9705
|
-
selectIdentifier:
|
|
9706
|
-
selectDisplayName:
|
|
9998
|
+
selectIdentifier: selectIdentifier9,
|
|
9999
|
+
selectDisplayName: selectDisplayName9,
|
|
9707
10000
|
onSyncComplete: async (_, synced) => {
|
|
9708
10001
|
packageContents.aggregates = synced;
|
|
9709
10002
|
writeContextPackage(directory, packageContents);
|
|
@@ -9712,8 +10005,8 @@ var AggregatePullModule = {
|
|
|
9712
10005
|
} else {
|
|
9713
10006
|
target = await createFileSyncEngineDataSource({
|
|
9714
10007
|
directory,
|
|
9715
|
-
selectIdentifier:
|
|
9716
|
-
selectDisplayName:
|
|
10008
|
+
selectIdentifier: selectIdentifier9,
|
|
10009
|
+
selectDisplayName: selectDisplayName9,
|
|
9717
10010
|
format,
|
|
9718
10011
|
verbose
|
|
9719
10012
|
});
|
|
@@ -9733,12 +10026,12 @@ var AggregatePullModule = {
|
|
|
9733
10026
|
var AggregatePushModule = {
|
|
9734
10027
|
command: "push <directory>",
|
|
9735
10028
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
9736
|
-
builder: (
|
|
10029
|
+
builder: (yargs45) => withConfiguration(
|
|
9737
10030
|
withApiOptions(
|
|
9738
10031
|
withProjectOptions(
|
|
9739
10032
|
withDiffOptions(
|
|
9740
10033
|
withDebugOptions(
|
|
9741
|
-
|
|
10034
|
+
yargs45.positional("directory", {
|
|
9742
10035
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
9743
10036
|
type: "string"
|
|
9744
10037
|
}).option("mode", {
|
|
@@ -9774,14 +10067,14 @@ var AggregatePushModule = {
|
|
|
9774
10067
|
source = await createArraySyncEngineDataSource({
|
|
9775
10068
|
name: `Package file ${directory}`,
|
|
9776
10069
|
objects: packageContents.aggregates ?? [],
|
|
9777
|
-
selectIdentifier:
|
|
9778
|
-
selectDisplayName:
|
|
10070
|
+
selectIdentifier: selectIdentifier9,
|
|
10071
|
+
selectDisplayName: selectDisplayName9
|
|
9779
10072
|
});
|
|
9780
10073
|
} else {
|
|
9781
10074
|
source = await createFileSyncEngineDataSource({
|
|
9782
10075
|
directory,
|
|
9783
|
-
selectIdentifier:
|
|
9784
|
-
selectDisplayName:
|
|
10076
|
+
selectIdentifier: selectIdentifier9,
|
|
10077
|
+
selectDisplayName: selectDisplayName9,
|
|
9785
10078
|
verbose
|
|
9786
10079
|
});
|
|
9787
10080
|
}
|
|
@@ -9803,10 +10096,10 @@ var AggregateRemoveModule = {
|
|
|
9803
10096
|
command: "remove <id>",
|
|
9804
10097
|
aliases: ["delete", "rm"],
|
|
9805
10098
|
describe: "Delete an aggregate",
|
|
9806
|
-
builder: (
|
|
10099
|
+
builder: (yargs45) => withConfiguration(
|
|
9807
10100
|
withApiOptions(
|
|
9808
10101
|
withProjectOptions(
|
|
9809
|
-
|
|
10102
|
+
yargs45.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
9810
10103
|
)
|
|
9811
10104
|
)
|
|
9812
10105
|
),
|
|
@@ -9822,10 +10115,10 @@ var AggregateUpdateModule = {
|
|
|
9822
10115
|
command: "update <filename>",
|
|
9823
10116
|
aliases: ["put"],
|
|
9824
10117
|
describe: "Insert or update an aggregate",
|
|
9825
|
-
builder: (
|
|
10118
|
+
builder: (yargs45) => withConfiguration(
|
|
9826
10119
|
withApiOptions(
|
|
9827
10120
|
withProjectOptions(
|
|
9828
|
-
|
|
10121
|
+
yargs45.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
9829
10122
|
)
|
|
9830
10123
|
)
|
|
9831
10124
|
),
|
|
@@ -9842,19 +10135,19 @@ var AggregateModule = {
|
|
|
9842
10135
|
command: "aggregate <command>",
|
|
9843
10136
|
aliases: ["agg", "intent", "audience"],
|
|
9844
10137
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
9845
|
-
builder: (
|
|
10138
|
+
builder: (yargs45) => yargs45.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
9846
10139
|
handler: () => {
|
|
9847
|
-
|
|
10140
|
+
yargs24.help();
|
|
9848
10141
|
}
|
|
9849
10142
|
};
|
|
9850
10143
|
|
|
9851
10144
|
// src/commands/context/commands/enrichment.ts
|
|
9852
|
-
import
|
|
10145
|
+
import yargs25 from "yargs";
|
|
9853
10146
|
|
|
9854
10147
|
// src/commands/context/commands/enrichment/_util.ts
|
|
9855
10148
|
import { EnrichmentClient } from "@uniformdev/context/api";
|
|
9856
|
-
var
|
|
9857
|
-
var
|
|
10149
|
+
var selectIdentifier10 = (source) => source.id;
|
|
10150
|
+
var selectDisplayName10 = (source) => `${source.name} (pid: ${source.id})`;
|
|
9858
10151
|
function getEnrichmentClient(options) {
|
|
9859
10152
|
return new EnrichmentClient({ ...options, limitPolicy: cliLimitPolicy, bypassCache: true });
|
|
9860
10153
|
}
|
|
@@ -9863,11 +10156,11 @@ function getEnrichmentClient(options) {
|
|
|
9863
10156
|
var EnrichmentGetModule = {
|
|
9864
10157
|
command: "get <id>",
|
|
9865
10158
|
describe: "Fetch an enrichment category and its values",
|
|
9866
|
-
builder: (
|
|
10159
|
+
builder: (yargs45) => withFormatOptions(
|
|
9867
10160
|
withConfiguration(
|
|
9868
10161
|
withApiOptions(
|
|
9869
10162
|
withProjectOptions(
|
|
9870
|
-
|
|
10163
|
+
yargs45.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
9871
10164
|
)
|
|
9872
10165
|
)
|
|
9873
10166
|
)
|
|
@@ -9890,7 +10183,7 @@ var EnrichmentListModule = {
|
|
|
9890
10183
|
command: "list",
|
|
9891
10184
|
describe: "List enrichments",
|
|
9892
10185
|
aliases: ["ls"],
|
|
9893
|
-
builder: (
|
|
10186
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
9894
10187
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9895
10188
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9896
10189
|
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9907,8 +10200,8 @@ function createEnrichmentEngineDataSource({
|
|
|
9907
10200
|
const enrichments = (await client.get()).enrichments;
|
|
9908
10201
|
for await (const def of enrichments) {
|
|
9909
10202
|
const result = {
|
|
9910
|
-
id:
|
|
9911
|
-
displayName:
|
|
10203
|
+
id: selectIdentifier10(def),
|
|
10204
|
+
displayName: selectDisplayName10(def),
|
|
9912
10205
|
providerId: def.id,
|
|
9913
10206
|
object: def
|
|
9914
10207
|
};
|
|
@@ -9985,12 +10278,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
9985
10278
|
var EnrichmentPullModule = {
|
|
9986
10279
|
command: "pull <directory>",
|
|
9987
10280
|
describe: "Pulls all enrichments to local files in a directory",
|
|
9988
|
-
builder: (
|
|
10281
|
+
builder: (yargs45) => withConfiguration(
|
|
9989
10282
|
withDebugOptions(
|
|
9990
10283
|
withApiOptions(
|
|
9991
10284
|
withProjectOptions(
|
|
9992
10285
|
withDiffOptions(
|
|
9993
|
-
|
|
10286
|
+
yargs45.positional("directory", {
|
|
9994
10287
|
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.",
|
|
9995
10288
|
type: "string"
|
|
9996
10289
|
}).option("format", {
|
|
@@ -10034,8 +10327,8 @@ var EnrichmentPullModule = {
|
|
|
10034
10327
|
target = await createArraySyncEngineDataSource({
|
|
10035
10328
|
name: `Package file ${directory}`,
|
|
10036
10329
|
objects: packageContents.enrichments ?? [],
|
|
10037
|
-
selectIdentifier:
|
|
10038
|
-
selectDisplayName:
|
|
10330
|
+
selectIdentifier: selectIdentifier10,
|
|
10331
|
+
selectDisplayName: selectDisplayName10,
|
|
10039
10332
|
onSyncComplete: async (_, synced) => {
|
|
10040
10333
|
packageContents.enrichments = synced;
|
|
10041
10334
|
writeContextPackage(directory, packageContents);
|
|
@@ -10044,8 +10337,8 @@ var EnrichmentPullModule = {
|
|
|
10044
10337
|
} else {
|
|
10045
10338
|
target = await createFileSyncEngineDataSource({
|
|
10046
10339
|
directory,
|
|
10047
|
-
selectIdentifier:
|
|
10048
|
-
selectDisplayName:
|
|
10340
|
+
selectIdentifier: selectIdentifier10,
|
|
10341
|
+
selectDisplayName: selectDisplayName10,
|
|
10049
10342
|
format,
|
|
10050
10343
|
verbose
|
|
10051
10344
|
});
|
|
@@ -10065,11 +10358,11 @@ var EnrichmentPullModule = {
|
|
|
10065
10358
|
var EnrichmentPushModule = {
|
|
10066
10359
|
command: "push <directory>",
|
|
10067
10360
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
10068
|
-
builder: (
|
|
10361
|
+
builder: (yargs45) => withConfiguration(
|
|
10069
10362
|
withApiOptions(
|
|
10070
10363
|
withProjectOptions(
|
|
10071
10364
|
withDiffOptions(
|
|
10072
|
-
|
|
10365
|
+
yargs45.positional("directory", {
|
|
10073
10366
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
10074
10367
|
type: "string"
|
|
10075
10368
|
}).option("mode", {
|
|
@@ -10104,14 +10397,14 @@ var EnrichmentPushModule = {
|
|
|
10104
10397
|
source = await createArraySyncEngineDataSource({
|
|
10105
10398
|
name: `Package file ${directory}`,
|
|
10106
10399
|
objects: packageContents.enrichments ?? [],
|
|
10107
|
-
selectIdentifier:
|
|
10108
|
-
selectDisplayName:
|
|
10400
|
+
selectIdentifier: selectIdentifier10,
|
|
10401
|
+
selectDisplayName: selectDisplayName10
|
|
10109
10402
|
});
|
|
10110
10403
|
} else {
|
|
10111
10404
|
source = await createFileSyncEngineDataSource({
|
|
10112
10405
|
directory,
|
|
10113
|
-
selectIdentifier:
|
|
10114
|
-
selectDisplayName:
|
|
10406
|
+
selectIdentifier: selectIdentifier10,
|
|
10407
|
+
selectDisplayName: selectDisplayName10,
|
|
10115
10408
|
verbose
|
|
10116
10409
|
});
|
|
10117
10410
|
}
|
|
@@ -10132,10 +10425,10 @@ var EnrichmentRemoveModule = {
|
|
|
10132
10425
|
command: "remove <id>",
|
|
10133
10426
|
aliases: ["delete", "rm"],
|
|
10134
10427
|
describe: "Delete an enrichment category and its values",
|
|
10135
|
-
builder: (
|
|
10428
|
+
builder: (yargs45) => withConfiguration(
|
|
10136
10429
|
withApiOptions(
|
|
10137
10430
|
withProjectOptions(
|
|
10138
|
-
|
|
10431
|
+
yargs45.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
10139
10432
|
)
|
|
10140
10433
|
)
|
|
10141
10434
|
),
|
|
@@ -10151,14 +10444,14 @@ var EnrichmentModule = {
|
|
|
10151
10444
|
command: "enrichment <command>",
|
|
10152
10445
|
aliases: ["enr"],
|
|
10153
10446
|
describe: "Commands for Context enrichments",
|
|
10154
|
-
builder: (
|
|
10447
|
+
builder: (yargs45) => yargs45.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
10155
10448
|
handler: () => {
|
|
10156
|
-
|
|
10449
|
+
yargs25.help();
|
|
10157
10450
|
}
|
|
10158
10451
|
};
|
|
10159
10452
|
|
|
10160
10453
|
// src/commands/context/commands/manifest.ts
|
|
10161
|
-
import
|
|
10454
|
+
import yargs26 from "yargs";
|
|
10162
10455
|
|
|
10163
10456
|
// src/commands/context/commands/manifest/get.ts
|
|
10164
10457
|
import { ApiClientError as ApiClientError5, ManifestClient } from "@uniformdev/context/api";
|
|
@@ -10169,10 +10462,10 @@ var ManifestGetModule = {
|
|
|
10169
10462
|
command: "get [output]",
|
|
10170
10463
|
aliases: ["dl", "download"],
|
|
10171
10464
|
describe: "Download the Uniform Context manifest for a project",
|
|
10172
|
-
builder: (
|
|
10465
|
+
builder: (yargs45) => withConfiguration(
|
|
10173
10466
|
withApiOptions(
|
|
10174
10467
|
withProjectOptions(
|
|
10175
|
-
|
|
10468
|
+
yargs45.option("preview", {
|
|
10176
10469
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
10177
10470
|
default: false,
|
|
10178
10471
|
type: "boolean",
|
|
@@ -10235,7 +10528,7 @@ import { exit as exit2 } from "process";
|
|
|
10235
10528
|
var ManifestPublishModule = {
|
|
10236
10529
|
command: "publish",
|
|
10237
10530
|
describe: "Publish the Uniform Context manifest for a project",
|
|
10238
|
-
builder: (
|
|
10531
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withProjectOptions(yargs45))),
|
|
10239
10532
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
10240
10533
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10241
10534
|
try {
|
|
@@ -10269,25 +10562,25 @@ var ManifestModule = {
|
|
|
10269
10562
|
command: "manifest <command>",
|
|
10270
10563
|
describe: "Commands for context manifests",
|
|
10271
10564
|
aliases: ["man"],
|
|
10272
|
-
builder: (
|
|
10565
|
+
builder: (yargs45) => yargs45.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
10273
10566
|
handler: () => {
|
|
10274
|
-
|
|
10567
|
+
yargs26.help();
|
|
10275
10568
|
}
|
|
10276
10569
|
};
|
|
10277
10570
|
|
|
10278
10571
|
// src/commands/context/commands/quirk.ts
|
|
10279
|
-
import
|
|
10572
|
+
import yargs27 from "yargs";
|
|
10280
10573
|
|
|
10281
10574
|
// src/commands/context/commands/quirk/get.ts
|
|
10282
10575
|
import { QuirkClient } from "@uniformdev/context/api";
|
|
10283
10576
|
var QuirkGetModule = {
|
|
10284
10577
|
command: "get <id>",
|
|
10285
10578
|
describe: "Fetch a quirk",
|
|
10286
|
-
builder: (
|
|
10579
|
+
builder: (yargs45) => withConfiguration(
|
|
10287
10580
|
withFormatOptions(
|
|
10288
10581
|
withApiOptions(
|
|
10289
10582
|
withProjectOptions(
|
|
10290
|
-
|
|
10583
|
+
yargs45.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
10291
10584
|
)
|
|
10292
10585
|
)
|
|
10293
10586
|
)
|
|
@@ -10311,11 +10604,11 @@ var QuirkListModule = {
|
|
|
10311
10604
|
command: "list",
|
|
10312
10605
|
describe: "List quirks",
|
|
10313
10606
|
aliases: ["ls"],
|
|
10314
|
-
builder: (
|
|
10607
|
+
builder: (yargs45) => withConfiguration(
|
|
10315
10608
|
withFormatOptions(
|
|
10316
10609
|
withApiOptions(
|
|
10317
10610
|
withProjectOptions(
|
|
10318
|
-
|
|
10611
|
+
yargs45.option("withIntegrations", {
|
|
10319
10612
|
alias: ["i"],
|
|
10320
10613
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
10321
10614
|
type: "boolean"
|
|
@@ -10336,8 +10629,8 @@ var QuirkListModule = {
|
|
|
10336
10629
|
import { QuirkClient as QuirkClient3 } from "@uniformdev/context/api";
|
|
10337
10630
|
|
|
10338
10631
|
// src/commands/context/commands/quirk/_util.ts
|
|
10339
|
-
var
|
|
10340
|
-
var
|
|
10632
|
+
var selectIdentifier11 = (source) => source.id;
|
|
10633
|
+
var selectDisplayName11 = (source) => `${source.name} (pid: ${source.id})`;
|
|
10341
10634
|
|
|
10342
10635
|
// src/commands/context/quirkEngineDataSource.ts
|
|
10343
10636
|
function createQuirkEngineDataSource({
|
|
@@ -10347,8 +10640,8 @@ function createQuirkEngineDataSource({
|
|
|
10347
10640
|
const quirks = (await client.get({ withIntegrations: false })).quirks;
|
|
10348
10641
|
for await (const def of quirks) {
|
|
10349
10642
|
const result = {
|
|
10350
|
-
id:
|
|
10351
|
-
displayName:
|
|
10643
|
+
id: selectIdentifier11(def),
|
|
10644
|
+
displayName: selectDisplayName11(def),
|
|
10352
10645
|
providerId: def.id,
|
|
10353
10646
|
object: def
|
|
10354
10647
|
};
|
|
@@ -10373,12 +10666,12 @@ function createQuirkEngineDataSource({
|
|
|
10373
10666
|
var QuirkPullModule = {
|
|
10374
10667
|
command: "pull <directory>",
|
|
10375
10668
|
describe: "Pulls all quirks to local files in a directory",
|
|
10376
|
-
builder: (
|
|
10669
|
+
builder: (yargs45) => withConfiguration(
|
|
10377
10670
|
withDebugOptions(
|
|
10378
10671
|
withApiOptions(
|
|
10379
10672
|
withProjectOptions(
|
|
10380
10673
|
withDiffOptions(
|
|
10381
|
-
|
|
10674
|
+
yargs45.positional("directory", {
|
|
10382
10675
|
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.",
|
|
10383
10676
|
type: "string"
|
|
10384
10677
|
}).option("format", {
|
|
@@ -10422,8 +10715,8 @@ var QuirkPullModule = {
|
|
|
10422
10715
|
target = await createArraySyncEngineDataSource({
|
|
10423
10716
|
name: `Package file ${directory}`,
|
|
10424
10717
|
objects: packageContents.quirks ?? [],
|
|
10425
|
-
selectIdentifier:
|
|
10426
|
-
selectDisplayName:
|
|
10718
|
+
selectIdentifier: selectIdentifier11,
|
|
10719
|
+
selectDisplayName: selectDisplayName11,
|
|
10427
10720
|
onSyncComplete: async (_, synced) => {
|
|
10428
10721
|
packageContents.quirks = synced;
|
|
10429
10722
|
writeContextPackage(directory, packageContents);
|
|
@@ -10432,8 +10725,8 @@ var QuirkPullModule = {
|
|
|
10432
10725
|
} else {
|
|
10433
10726
|
target = await createFileSyncEngineDataSource({
|
|
10434
10727
|
directory,
|
|
10435
|
-
selectIdentifier:
|
|
10436
|
-
selectDisplayName:
|
|
10728
|
+
selectIdentifier: selectIdentifier11,
|
|
10729
|
+
selectDisplayName: selectDisplayName11,
|
|
10437
10730
|
format,
|
|
10438
10731
|
verbose
|
|
10439
10732
|
});
|
|
@@ -10454,12 +10747,12 @@ import { QuirkClient as QuirkClient4 } from "@uniformdev/context/api";
|
|
|
10454
10747
|
var QuirkPushModule = {
|
|
10455
10748
|
command: "push <directory>",
|
|
10456
10749
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
10457
|
-
builder: (
|
|
10750
|
+
builder: (yargs45) => withConfiguration(
|
|
10458
10751
|
withDebugOptions(
|
|
10459
10752
|
withApiOptions(
|
|
10460
10753
|
withProjectOptions(
|
|
10461
10754
|
withDiffOptions(
|
|
10462
|
-
|
|
10755
|
+
yargs45.positional("directory", {
|
|
10463
10756
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
10464
10757
|
type: "string"
|
|
10465
10758
|
}).option("mode", {
|
|
@@ -10495,14 +10788,14 @@ var QuirkPushModule = {
|
|
|
10495
10788
|
source = await createArraySyncEngineDataSource({
|
|
10496
10789
|
name: `Package file ${directory}`,
|
|
10497
10790
|
objects: packageContents.quirks ?? [],
|
|
10498
|
-
selectIdentifier:
|
|
10499
|
-
selectDisplayName:
|
|
10791
|
+
selectIdentifier: selectIdentifier11,
|
|
10792
|
+
selectDisplayName: selectDisplayName11
|
|
10500
10793
|
});
|
|
10501
10794
|
} else {
|
|
10502
10795
|
source = await createFileSyncEngineDataSource({
|
|
10503
10796
|
directory,
|
|
10504
|
-
selectIdentifier:
|
|
10505
|
-
selectDisplayName:
|
|
10797
|
+
selectIdentifier: selectIdentifier11,
|
|
10798
|
+
selectDisplayName: selectDisplayName11,
|
|
10506
10799
|
verbose
|
|
10507
10800
|
});
|
|
10508
10801
|
}
|
|
@@ -10524,10 +10817,10 @@ var QuirkRemoveModule = {
|
|
|
10524
10817
|
command: "remove <id>",
|
|
10525
10818
|
aliases: ["delete", "rm"],
|
|
10526
10819
|
describe: "Delete a quirk",
|
|
10527
|
-
builder: (
|
|
10820
|
+
builder: (yargs45) => withConfiguration(
|
|
10528
10821
|
withApiOptions(
|
|
10529
10822
|
withProjectOptions(
|
|
10530
|
-
|
|
10823
|
+
yargs45.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
10531
10824
|
)
|
|
10532
10825
|
)
|
|
10533
10826
|
),
|
|
@@ -10544,10 +10837,10 @@ var QuirkUpdateModule = {
|
|
|
10544
10837
|
command: "update <filename>",
|
|
10545
10838
|
aliases: ["put"],
|
|
10546
10839
|
describe: "Insert or update a quirk",
|
|
10547
|
-
builder: (
|
|
10840
|
+
builder: (yargs45) => withConfiguration(
|
|
10548
10841
|
withApiOptions(
|
|
10549
10842
|
withProjectOptions(
|
|
10550
|
-
|
|
10843
|
+
yargs45.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
10551
10844
|
)
|
|
10552
10845
|
)
|
|
10553
10846
|
),
|
|
@@ -10564,25 +10857,25 @@ var QuirkModule = {
|
|
|
10564
10857
|
command: "quirk <command>",
|
|
10565
10858
|
aliases: ["qk"],
|
|
10566
10859
|
describe: "Commands for Context quirks",
|
|
10567
|
-
builder: (
|
|
10860
|
+
builder: (yargs45) => yargs45.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
10568
10861
|
handler: () => {
|
|
10569
|
-
|
|
10862
|
+
yargs27.help();
|
|
10570
10863
|
}
|
|
10571
10864
|
};
|
|
10572
10865
|
|
|
10573
10866
|
// src/commands/context/commands/signal.ts
|
|
10574
|
-
import
|
|
10867
|
+
import yargs28 from "yargs";
|
|
10575
10868
|
|
|
10576
10869
|
// src/commands/context/commands/signal/get.ts
|
|
10577
10870
|
import { SignalClient } from "@uniformdev/context/api";
|
|
10578
10871
|
var SignalGetModule = {
|
|
10579
10872
|
command: "get <id>",
|
|
10580
10873
|
describe: "Fetch a signal",
|
|
10581
|
-
builder: (
|
|
10874
|
+
builder: (yargs45) => withConfiguration(
|
|
10582
10875
|
withFormatOptions(
|
|
10583
10876
|
withApiOptions(
|
|
10584
10877
|
withProjectOptions(
|
|
10585
|
-
|
|
10878
|
+
yargs45.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
10586
10879
|
)
|
|
10587
10880
|
)
|
|
10588
10881
|
)
|
|
@@ -10606,7 +10899,7 @@ var SignalListModule = {
|
|
|
10606
10899
|
command: "list",
|
|
10607
10900
|
describe: "List signals",
|
|
10608
10901
|
aliases: ["ls"],
|
|
10609
|
-
builder: (
|
|
10902
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
10610
10903
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10611
10904
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10612
10905
|
const client = new SignalClient2({ apiKey, apiHost, fetch: fetch2, projectId, bypassCache: true });
|
|
@@ -10619,8 +10912,8 @@ var SignalListModule = {
|
|
|
10619
10912
|
import { SignalClient as SignalClient3 } from "@uniformdev/context/api";
|
|
10620
10913
|
|
|
10621
10914
|
// src/commands/context/commands/signal/_util.ts
|
|
10622
|
-
var
|
|
10623
|
-
var
|
|
10915
|
+
var selectIdentifier12 = (source) => source.id;
|
|
10916
|
+
var selectDisplayName12 = (source) => `${source.name} (pid: ${source.id})`;
|
|
10624
10917
|
|
|
10625
10918
|
// src/commands/context/signalEngineDataSource.ts
|
|
10626
10919
|
function createSignalEngineDataSource({
|
|
@@ -10630,8 +10923,8 @@ function createSignalEngineDataSource({
|
|
|
10630
10923
|
const signals = (await client.get()).signals;
|
|
10631
10924
|
for await (const def of signals) {
|
|
10632
10925
|
const result = {
|
|
10633
|
-
id:
|
|
10634
|
-
displayName:
|
|
10926
|
+
id: selectIdentifier12(def),
|
|
10927
|
+
displayName: selectDisplayName12(def),
|
|
10635
10928
|
providerId: def.id,
|
|
10636
10929
|
object: def
|
|
10637
10930
|
};
|
|
@@ -10656,12 +10949,12 @@ function createSignalEngineDataSource({
|
|
|
10656
10949
|
var SignalPullModule = {
|
|
10657
10950
|
command: "pull <directory>",
|
|
10658
10951
|
describe: "Pulls all signals to local files in a directory",
|
|
10659
|
-
builder: (
|
|
10952
|
+
builder: (yargs45) => withConfiguration(
|
|
10660
10953
|
withDebugOptions(
|
|
10661
10954
|
withApiOptions(
|
|
10662
10955
|
withProjectOptions(
|
|
10663
10956
|
withDiffOptions(
|
|
10664
|
-
|
|
10957
|
+
yargs45.positional("directory", {
|
|
10665
10958
|
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.",
|
|
10666
10959
|
type: "string"
|
|
10667
10960
|
}).option("format", {
|
|
@@ -10705,8 +10998,8 @@ var SignalPullModule = {
|
|
|
10705
10998
|
target = await createArraySyncEngineDataSource({
|
|
10706
10999
|
name: `Package file ${directory}`,
|
|
10707
11000
|
objects: packageContents.signals ?? [],
|
|
10708
|
-
selectIdentifier:
|
|
10709
|
-
selectDisplayName:
|
|
11001
|
+
selectIdentifier: selectIdentifier12,
|
|
11002
|
+
selectDisplayName: selectDisplayName12,
|
|
10710
11003
|
onSyncComplete: async (_, synced) => {
|
|
10711
11004
|
packageContents.signals = synced;
|
|
10712
11005
|
writeContextPackage(directory, packageContents);
|
|
@@ -10715,8 +11008,8 @@ var SignalPullModule = {
|
|
|
10715
11008
|
} else {
|
|
10716
11009
|
target = await createFileSyncEngineDataSource({
|
|
10717
11010
|
directory,
|
|
10718
|
-
selectIdentifier:
|
|
10719
|
-
selectDisplayName:
|
|
11011
|
+
selectIdentifier: selectIdentifier12,
|
|
11012
|
+
selectDisplayName: selectDisplayName12,
|
|
10720
11013
|
format,
|
|
10721
11014
|
verbose
|
|
10722
11015
|
});
|
|
@@ -10737,12 +11030,12 @@ import { SignalClient as SignalClient4 } from "@uniformdev/context/api";
|
|
|
10737
11030
|
var SignalPushModule = {
|
|
10738
11031
|
command: "push <directory>",
|
|
10739
11032
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
10740
|
-
builder: (
|
|
11033
|
+
builder: (yargs45) => withConfiguration(
|
|
10741
11034
|
withDebugOptions(
|
|
10742
11035
|
withApiOptions(
|
|
10743
11036
|
withProjectOptions(
|
|
10744
11037
|
withDiffOptions(
|
|
10745
|
-
|
|
11038
|
+
yargs45.positional("directory", {
|
|
10746
11039
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
10747
11040
|
type: "string"
|
|
10748
11041
|
}).option("mode", {
|
|
@@ -10778,14 +11071,14 @@ var SignalPushModule = {
|
|
|
10778
11071
|
source = await createArraySyncEngineDataSource({
|
|
10779
11072
|
name: `Package file ${directory}`,
|
|
10780
11073
|
objects: packageContents.signals ?? [],
|
|
10781
|
-
selectIdentifier:
|
|
10782
|
-
selectDisplayName:
|
|
11074
|
+
selectIdentifier: selectIdentifier12,
|
|
11075
|
+
selectDisplayName: selectDisplayName12
|
|
10783
11076
|
});
|
|
10784
11077
|
} else {
|
|
10785
11078
|
source = await createFileSyncEngineDataSource({
|
|
10786
11079
|
directory,
|
|
10787
|
-
selectIdentifier:
|
|
10788
|
-
selectDisplayName:
|
|
11080
|
+
selectIdentifier: selectIdentifier12,
|
|
11081
|
+
selectDisplayName: selectDisplayName12,
|
|
10789
11082
|
verbose
|
|
10790
11083
|
});
|
|
10791
11084
|
}
|
|
@@ -10807,10 +11100,10 @@ var SignalRemoveModule = {
|
|
|
10807
11100
|
command: "remove <id>",
|
|
10808
11101
|
aliases: ["delete", "rm"],
|
|
10809
11102
|
describe: "Delete a signal",
|
|
10810
|
-
builder: (
|
|
11103
|
+
builder: (yargs45) => withConfiguration(
|
|
10811
11104
|
withApiOptions(
|
|
10812
11105
|
withProjectOptions(
|
|
10813
|
-
|
|
11106
|
+
yargs45.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
10814
11107
|
)
|
|
10815
11108
|
)
|
|
10816
11109
|
),
|
|
@@ -10827,10 +11120,10 @@ var SignalUpdateModule = {
|
|
|
10827
11120
|
command: "update <filename>",
|
|
10828
11121
|
aliases: ["put"],
|
|
10829
11122
|
describe: "Insert or update a signal",
|
|
10830
|
-
builder: (
|
|
11123
|
+
builder: (yargs45) => withConfiguration(
|
|
10831
11124
|
withApiOptions(
|
|
10832
11125
|
withProjectOptions(
|
|
10833
|
-
|
|
11126
|
+
yargs45.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
10834
11127
|
)
|
|
10835
11128
|
)
|
|
10836
11129
|
),
|
|
@@ -10847,25 +11140,25 @@ var SignalModule = {
|
|
|
10847
11140
|
command: "signal <command>",
|
|
10848
11141
|
aliases: ["sig"],
|
|
10849
11142
|
describe: "Commands for Context signals",
|
|
10850
|
-
builder: (
|
|
11143
|
+
builder: (yargs45) => yargs45.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
10851
11144
|
handler: () => {
|
|
10852
|
-
|
|
11145
|
+
yargs28.help();
|
|
10853
11146
|
}
|
|
10854
11147
|
};
|
|
10855
11148
|
|
|
10856
11149
|
// src/commands/context/commands/test.ts
|
|
10857
|
-
import
|
|
11150
|
+
import yargs29 from "yargs";
|
|
10858
11151
|
|
|
10859
11152
|
// src/commands/context/commands/test/get.ts
|
|
10860
11153
|
import { TestClient } from "@uniformdev/context/api";
|
|
10861
11154
|
var TestGetModule = {
|
|
10862
11155
|
command: "get <id>",
|
|
10863
11156
|
describe: "Fetch a test",
|
|
10864
|
-
builder: (
|
|
11157
|
+
builder: (yargs45) => withConfiguration(
|
|
10865
11158
|
withFormatOptions(
|
|
10866
11159
|
withApiOptions(
|
|
10867
11160
|
withProjectOptions(
|
|
10868
|
-
|
|
11161
|
+
yargs45.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
10869
11162
|
)
|
|
10870
11163
|
)
|
|
10871
11164
|
)
|
|
@@ -10889,7 +11182,7 @@ var TestListModule = {
|
|
|
10889
11182
|
command: "list",
|
|
10890
11183
|
describe: "List tests",
|
|
10891
11184
|
aliases: ["ls"],
|
|
10892
|
-
builder: (
|
|
11185
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
10893
11186
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10894
11187
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10895
11188
|
const client = new TestClient2({ apiKey, apiHost, fetch: fetch2, projectId, bypassCache: true });
|
|
@@ -10902,8 +11195,8 @@ var TestListModule = {
|
|
|
10902
11195
|
import { TestClient as TestClient3 } from "@uniformdev/context/api";
|
|
10903
11196
|
|
|
10904
11197
|
// src/commands/context/commands/test/_util.ts
|
|
10905
|
-
var
|
|
10906
|
-
var
|
|
11198
|
+
var selectIdentifier13 = (source) => source.id;
|
|
11199
|
+
var selectDisplayName13 = (source) => `${source.name} (pid: ${source.id})`;
|
|
10907
11200
|
|
|
10908
11201
|
// src/commands/context/testEngineDataSource.ts
|
|
10909
11202
|
function createTestEngineDataSource({
|
|
@@ -10913,8 +11206,8 @@ function createTestEngineDataSource({
|
|
|
10913
11206
|
const tests = (await client.get()).tests;
|
|
10914
11207
|
for await (const def of tests) {
|
|
10915
11208
|
const result = {
|
|
10916
|
-
id:
|
|
10917
|
-
displayName:
|
|
11209
|
+
id: selectIdentifier13(def),
|
|
11210
|
+
displayName: selectDisplayName13(def),
|
|
10918
11211
|
providerId: def.id,
|
|
10919
11212
|
object: def
|
|
10920
11213
|
};
|
|
@@ -10939,12 +11232,12 @@ function createTestEngineDataSource({
|
|
|
10939
11232
|
var TestPullModule = {
|
|
10940
11233
|
command: "pull <directory>",
|
|
10941
11234
|
describe: "Pulls all tests to local files in a directory",
|
|
10942
|
-
builder: (
|
|
11235
|
+
builder: (yargs45) => withConfiguration(
|
|
10943
11236
|
withDebugOptions(
|
|
10944
11237
|
withApiOptions(
|
|
10945
11238
|
withProjectOptions(
|
|
10946
11239
|
withDiffOptions(
|
|
10947
|
-
|
|
11240
|
+
yargs45.positional("directory", {
|
|
10948
11241
|
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.",
|
|
10949
11242
|
type: "string"
|
|
10950
11243
|
}).option("format", {
|
|
@@ -10988,8 +11281,8 @@ var TestPullModule = {
|
|
|
10988
11281
|
target = await createArraySyncEngineDataSource({
|
|
10989
11282
|
name: `Package file ${directory}`,
|
|
10990
11283
|
objects: packageContents.tests ?? [],
|
|
10991
|
-
selectIdentifier:
|
|
10992
|
-
selectDisplayName:
|
|
11284
|
+
selectIdentifier: selectIdentifier13,
|
|
11285
|
+
selectDisplayName: selectDisplayName13,
|
|
10993
11286
|
onSyncComplete: async (_, synced) => {
|
|
10994
11287
|
packageContents.tests = synced;
|
|
10995
11288
|
writeContextPackage(directory, packageContents);
|
|
@@ -10998,8 +11291,8 @@ var TestPullModule = {
|
|
|
10998
11291
|
} else {
|
|
10999
11292
|
target = await createFileSyncEngineDataSource({
|
|
11000
11293
|
directory,
|
|
11001
|
-
selectIdentifier:
|
|
11002
|
-
selectDisplayName:
|
|
11294
|
+
selectIdentifier: selectIdentifier13,
|
|
11295
|
+
selectDisplayName: selectDisplayName13,
|
|
11003
11296
|
format,
|
|
11004
11297
|
verbose
|
|
11005
11298
|
});
|
|
@@ -11020,12 +11313,12 @@ import { TestClient as TestClient4 } from "@uniformdev/context/api";
|
|
|
11020
11313
|
var TestPushModule = {
|
|
11021
11314
|
command: "push <directory>",
|
|
11022
11315
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
11023
|
-
builder: (
|
|
11316
|
+
builder: (yargs45) => withConfiguration(
|
|
11024
11317
|
withDebugOptions(
|
|
11025
11318
|
withApiOptions(
|
|
11026
11319
|
withProjectOptions(
|
|
11027
11320
|
withDiffOptions(
|
|
11028
|
-
|
|
11321
|
+
yargs45.positional("directory", {
|
|
11029
11322
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
11030
11323
|
type: "string"
|
|
11031
11324
|
}).option("mode", {
|
|
@@ -11061,14 +11354,14 @@ var TestPushModule = {
|
|
|
11061
11354
|
source = await createArraySyncEngineDataSource({
|
|
11062
11355
|
name: `Package file ${directory}`,
|
|
11063
11356
|
objects: packageContents.tests ?? [],
|
|
11064
|
-
selectIdentifier:
|
|
11065
|
-
selectDisplayName:
|
|
11357
|
+
selectIdentifier: selectIdentifier13,
|
|
11358
|
+
selectDisplayName: selectDisplayName13
|
|
11066
11359
|
});
|
|
11067
11360
|
} else {
|
|
11068
11361
|
source = await createFileSyncEngineDataSource({
|
|
11069
11362
|
directory,
|
|
11070
|
-
selectIdentifier:
|
|
11071
|
-
selectDisplayName:
|
|
11363
|
+
selectIdentifier: selectIdentifier13,
|
|
11364
|
+
selectDisplayName: selectDisplayName13,
|
|
11072
11365
|
verbose
|
|
11073
11366
|
});
|
|
11074
11367
|
}
|
|
@@ -11090,10 +11383,10 @@ var TestRemoveModule = {
|
|
|
11090
11383
|
command: "remove <id>",
|
|
11091
11384
|
aliases: ["delete", "rm"],
|
|
11092
11385
|
describe: "Delete a test",
|
|
11093
|
-
builder: (
|
|
11386
|
+
builder: (yargs45) => withConfiguration(
|
|
11094
11387
|
withApiOptions(
|
|
11095
11388
|
withProjectOptions(
|
|
11096
|
-
|
|
11389
|
+
yargs45.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
11097
11390
|
)
|
|
11098
11391
|
)
|
|
11099
11392
|
),
|
|
@@ -11110,9 +11403,9 @@ var TestUpdateModule = {
|
|
|
11110
11403
|
command: "update <filename>",
|
|
11111
11404
|
aliases: ["put"],
|
|
11112
11405
|
describe: "Insert or update a test",
|
|
11113
|
-
builder: (
|
|
11406
|
+
builder: (yargs45) => withConfiguration(
|
|
11114
11407
|
withApiOptions(
|
|
11115
|
-
withProjectOptions(
|
|
11408
|
+
withProjectOptions(yargs45.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
11116
11409
|
)
|
|
11117
11410
|
),
|
|
11118
11411
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -11127,9 +11420,9 @@ var TestUpdateModule = {
|
|
|
11127
11420
|
var TestModule = {
|
|
11128
11421
|
command: "test <command>",
|
|
11129
11422
|
describe: "Commands for Context A/B tests",
|
|
11130
|
-
builder: (
|
|
11423
|
+
builder: (yargs45) => yargs45.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
11131
11424
|
handler: () => {
|
|
11132
|
-
|
|
11425
|
+
yargs29.help();
|
|
11133
11426
|
}
|
|
11134
11427
|
};
|
|
11135
11428
|
|
|
@@ -11138,29 +11431,29 @@ var ContextCommand = {
|
|
|
11138
11431
|
command: "context <command>",
|
|
11139
11432
|
aliases: ["ctx"],
|
|
11140
11433
|
describe: "Uniform Context commands",
|
|
11141
|
-
builder: (
|
|
11434
|
+
builder: (yargs45) => yargs45.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
11142
11435
|
handler: () => {
|
|
11143
|
-
|
|
11436
|
+
yargs30.showHelp();
|
|
11144
11437
|
}
|
|
11145
11438
|
};
|
|
11146
11439
|
|
|
11147
11440
|
// src/commands/integration/index.ts
|
|
11148
|
-
import
|
|
11441
|
+
import yargs35 from "yargs";
|
|
11149
11442
|
|
|
11150
11443
|
// src/commands/integration/commands/definition.ts
|
|
11151
|
-
import
|
|
11444
|
+
import yargs34 from "yargs";
|
|
11152
11445
|
|
|
11153
11446
|
// src/commands/integration/commands/definition/dataResourceEditor/dataResourceEditor.ts
|
|
11154
|
-
import
|
|
11447
|
+
import yargs31 from "yargs";
|
|
11155
11448
|
|
|
11156
11449
|
// src/commands/integration/commands/definition/dataResourceEditor/deploy.ts
|
|
11157
11450
|
import { readFileSync as readFileSync3 } from "fs";
|
|
11158
11451
|
|
|
11159
11452
|
// src/commands/integration/commands/definition/edgehancer/EdgehancerClient.ts
|
|
11160
11453
|
import { createLimitPolicy as createLimitPolicy2 } from "@uniformdev/canvas";
|
|
11161
|
-
import { ApiClient } from "@uniformdev/context/api";
|
|
11454
|
+
import { ApiClient as ApiClient2 } from "@uniformdev/context/api";
|
|
11162
11455
|
var ENDPOINT = "/api/v1/integration-edgehancers";
|
|
11163
|
-
var EdgehancerClient = class extends
|
|
11456
|
+
var EdgehancerClient = class extends ApiClient2 {
|
|
11164
11457
|
constructor(options) {
|
|
11165
11458
|
if (!options.limitPolicy) {
|
|
11166
11459
|
options.limitPolicy = createLimitPolicy2({});
|
|
@@ -11189,8 +11482,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
11189
11482
|
};
|
|
11190
11483
|
|
|
11191
11484
|
// src/commands/integration/commands/definition/dataResourceEditor/util.ts
|
|
11192
|
-
function withDataResourceEditorIdOptions(
|
|
11193
|
-
return
|
|
11485
|
+
function withDataResourceEditorIdOptions(yargs45) {
|
|
11486
|
+
return yargs45.option("connectorType", {
|
|
11194
11487
|
describe: "Integration data connector type to attach the data resource editor to, as defined in the integration manifest file.",
|
|
11195
11488
|
demandOption: true,
|
|
11196
11489
|
type: "string"
|
|
@@ -11210,11 +11503,11 @@ function withDataResourceEditorIdOptions(yargs44) {
|
|
|
11210
11503
|
var IntegrationDataResourceEditorDeployModule = {
|
|
11211
11504
|
command: "deploy <filename>",
|
|
11212
11505
|
describe: "Deploys a custom AI data resource editor hook to run when AI edits data resources of a specific archetype. The API key used must have team admin permissions.",
|
|
11213
|
-
builder: (
|
|
11506
|
+
builder: (yargs45) => withConfiguration(
|
|
11214
11507
|
withApiOptions(
|
|
11215
11508
|
withTeamOptions(
|
|
11216
11509
|
withDataResourceEditorIdOptions(
|
|
11217
|
-
|
|
11510
|
+
yargs45.positional("filename", {
|
|
11218
11511
|
demandOption: true,
|
|
11219
11512
|
describe: "ESM code file to run for the target data resource editor hook. Refer to the documentation for expected types."
|
|
11220
11513
|
}).option("compatibilityDate", {
|
|
@@ -11257,7 +11550,7 @@ var IntegrationDataResourceEditorDeployModule = {
|
|
|
11257
11550
|
var IntegrationDataResourceEditorRemoveModule = {
|
|
11258
11551
|
command: "remove",
|
|
11259
11552
|
describe: "Removes a custom AI data resource editor hook from a data resource archetype. The API key used must have team admin permissions.",
|
|
11260
|
-
builder: (
|
|
11553
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withTeamOptions(withDataResourceEditorIdOptions(yargs45)))),
|
|
11261
11554
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, connectorType, archetype, hook }) => {
|
|
11262
11555
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11263
11556
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -11269,21 +11562,21 @@ var IntegrationDataResourceEditorRemoveModule = {
|
|
|
11269
11562
|
var IntegrationDataResourceEditorModule = {
|
|
11270
11563
|
command: "dataResourceEditor <command>",
|
|
11271
11564
|
describe: "Commands for managing custom AI data resource editors at the team level.",
|
|
11272
|
-
builder: (
|
|
11565
|
+
builder: (yargs45) => yargs45.command(IntegrationDataResourceEditorDeployModule).command(IntegrationDataResourceEditorRemoveModule).demandCommand(),
|
|
11273
11566
|
handler: () => {
|
|
11274
|
-
|
|
11567
|
+
yargs31.help();
|
|
11275
11568
|
}
|
|
11276
11569
|
};
|
|
11277
11570
|
|
|
11278
11571
|
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
11279
|
-
import
|
|
11572
|
+
import yargs32 from "yargs";
|
|
11280
11573
|
|
|
11281
11574
|
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
11282
11575
|
import { readFileSync as readFileSync4 } from "fs";
|
|
11283
11576
|
|
|
11284
11577
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
11285
|
-
function withEdgehancerIdOptions(
|
|
11286
|
-
return
|
|
11578
|
+
function withEdgehancerIdOptions(yargs45) {
|
|
11579
|
+
return yargs45.option("connectorType", {
|
|
11287
11580
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
11288
11581
|
demandOption: true,
|
|
11289
11582
|
type: "string"
|
|
@@ -11303,11 +11596,11 @@ function withEdgehancerIdOptions(yargs44) {
|
|
|
11303
11596
|
var IntegrationEdgehancerDeployModule = {
|
|
11304
11597
|
command: "deploy <filename>",
|
|
11305
11598
|
describe: "Deploys a custom edgehancer hook to run when a data resource of a specific archetype is fetched. The API key used must have team admin permissions.",
|
|
11306
|
-
builder: (
|
|
11599
|
+
builder: (yargs45) => withConfiguration(
|
|
11307
11600
|
withApiOptions(
|
|
11308
11601
|
withTeamOptions(
|
|
11309
11602
|
withEdgehancerIdOptions(
|
|
11310
|
-
|
|
11603
|
+
yargs45.positional("filename", {
|
|
11311
11604
|
demandOption: true,
|
|
11312
11605
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
11313
11606
|
}).option("compatibilityDate", {
|
|
@@ -11350,7 +11643,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
11350
11643
|
var IntegrationEdgehancerRemoveModule = {
|
|
11351
11644
|
command: "remove",
|
|
11352
11645
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
11353
|
-
builder: (
|
|
11646
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs45)))),
|
|
11354
11647
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
11355
11648
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11356
11649
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -11362,22 +11655,22 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
11362
11655
|
var IntegrationEdgehancerModule = {
|
|
11363
11656
|
command: "edgehancer <command>",
|
|
11364
11657
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
11365
|
-
builder: (
|
|
11658
|
+
builder: (yargs45) => yargs45.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
11366
11659
|
handler: () => {
|
|
11367
|
-
|
|
11660
|
+
yargs32.help();
|
|
11368
11661
|
}
|
|
11369
11662
|
};
|
|
11370
11663
|
|
|
11371
11664
|
// src/commands/integration/commands/definition/propertyEditor/propertyEditor.ts
|
|
11372
|
-
import
|
|
11665
|
+
import yargs33 from "yargs";
|
|
11373
11666
|
|
|
11374
11667
|
// src/commands/integration/commands/definition/propertyEditor/deploy.ts
|
|
11375
11668
|
import { IntegrationPropertyEditorsClient } from "@uniformdev/canvas";
|
|
11376
11669
|
import { readFileSync as readFileSync5 } from "fs";
|
|
11377
11670
|
|
|
11378
11671
|
// src/commands/integration/commands/definition/propertyEditor/util.ts
|
|
11379
|
-
function withPropertyEditorIdOptions(
|
|
11380
|
-
return
|
|
11672
|
+
function withPropertyEditorIdOptions(yargs45) {
|
|
11673
|
+
return yargs45.option("propertyType", {
|
|
11381
11674
|
describe: "Property type to attach the editor to.",
|
|
11382
11675
|
demandOption: true,
|
|
11383
11676
|
type: "string"
|
|
@@ -11393,11 +11686,11 @@ function withPropertyEditorIdOptions(yargs44) {
|
|
|
11393
11686
|
var IntegrationPropertyEditorDeployModule = {
|
|
11394
11687
|
command: "deploy <filename>",
|
|
11395
11688
|
describe: "Deploys a custom AI property editor hook to run when a property of a specific type is edited. The API key used must have team admin permissions.",
|
|
11396
|
-
builder: (
|
|
11689
|
+
builder: (yargs45) => withConfiguration(
|
|
11397
11690
|
withApiOptions(
|
|
11398
11691
|
withTeamOptions(
|
|
11399
11692
|
withPropertyEditorIdOptions(
|
|
11400
|
-
|
|
11693
|
+
yargs45.positional("filename", {
|
|
11401
11694
|
demandOption: true,
|
|
11402
11695
|
describe: "ESM code file to run for the target property editor hook. Refer to the documentation for expected types."
|
|
11403
11696
|
}).option("compatibilityDate", {
|
|
@@ -11440,7 +11733,7 @@ import { IntegrationPropertyEditorsClient as IntegrationPropertyEditorsClient2 }
|
|
|
11440
11733
|
var IntegrationPropertyEditorRemoveModule = {
|
|
11441
11734
|
command: "remove",
|
|
11442
11735
|
describe: "Deletes a custom AI property editor hook from a property type. The API key used must have team admin permissions.",
|
|
11443
|
-
builder: (
|
|
11736
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withTeamOptions(withPropertyEditorIdOptions(yargs45)))),
|
|
11444
11737
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, propertyType, hook }) => {
|
|
11445
11738
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11446
11739
|
const client = new IntegrationPropertyEditorsClient2({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -11452,17 +11745,17 @@ var IntegrationPropertyEditorRemoveModule = {
|
|
|
11452
11745
|
var IntegrationPropertyEditorModule = {
|
|
11453
11746
|
command: "propertyEditor <command>",
|
|
11454
11747
|
describe: "Commands for managing custom AI property editors at the team level.",
|
|
11455
|
-
builder: (
|
|
11748
|
+
builder: (yargs45) => yargs45.command(IntegrationPropertyEditorDeployModule).command(IntegrationPropertyEditorRemoveModule).demandCommand(),
|
|
11456
11749
|
handler: () => {
|
|
11457
|
-
|
|
11750
|
+
yargs33.help();
|
|
11458
11751
|
}
|
|
11459
11752
|
};
|
|
11460
11753
|
|
|
11461
11754
|
// src/commands/integration/commands/definition/DefinitionClient.ts
|
|
11462
11755
|
import { createLimitPolicy as createLimitPolicy3 } from "@uniformdev/canvas";
|
|
11463
|
-
import { ApiClient as
|
|
11756
|
+
import { ApiClient as ApiClient3 } from "@uniformdev/context/api";
|
|
11464
11757
|
var ENDPOINT2 = "/api/v1/integration-definitions";
|
|
11465
|
-
var DefinitionClient = class extends
|
|
11758
|
+
var DefinitionClient = class extends ApiClient3 {
|
|
11466
11759
|
constructor(options) {
|
|
11467
11760
|
if (!options.limitPolicy) {
|
|
11468
11761
|
options.limitPolicy = createLimitPolicy3({});
|
|
@@ -11494,10 +11787,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
11494
11787
|
var IntegrationDefinitionRegisterModule = {
|
|
11495
11788
|
command: "register <filename>",
|
|
11496
11789
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
11497
|
-
builder: (
|
|
11790
|
+
builder: (yargs45) => withConfiguration(
|
|
11498
11791
|
withApiOptions(
|
|
11499
11792
|
withTeamOptions(
|
|
11500
|
-
|
|
11793
|
+
yargs45.positional("filename", {
|
|
11501
11794
|
demandOption: true,
|
|
11502
11795
|
describe: "Integration definition manifest to register"
|
|
11503
11796
|
})
|
|
@@ -11516,10 +11809,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
11516
11809
|
var IntegrationDefinitionRemoveModule = {
|
|
11517
11810
|
command: "remove <type>",
|
|
11518
11811
|
describe: "Deletes a custom integration definition from a team. This will uninstall it on any active projects. Existing usages of the integration may break. The API key used must have team admin permissions.",
|
|
11519
|
-
builder: (
|
|
11812
|
+
builder: (yargs45) => withConfiguration(
|
|
11520
11813
|
withApiOptions(
|
|
11521
11814
|
withTeamOptions(
|
|
11522
|
-
|
|
11815
|
+
yargs45.positional("type", {
|
|
11523
11816
|
demandOption: true,
|
|
11524
11817
|
describe: "Integration type (from its manifest) to remove."
|
|
11525
11818
|
})
|
|
@@ -11537,17 +11830,17 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
11537
11830
|
var IntegrationDefinitionModule = {
|
|
11538
11831
|
command: "definition <command>",
|
|
11539
11832
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
11540
|
-
builder: (
|
|
11833
|
+
builder: (yargs45) => yargs45.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).command(IntegrationDataResourceEditorModule).command(IntegrationPropertyEditorModule).demandCommand(),
|
|
11541
11834
|
handler: () => {
|
|
11542
|
-
|
|
11835
|
+
yargs34.help();
|
|
11543
11836
|
}
|
|
11544
11837
|
};
|
|
11545
11838
|
|
|
11546
11839
|
// src/commands/integration/commands/InstallClient.ts
|
|
11547
11840
|
import { createLimitPolicy as createLimitPolicy4 } from "@uniformdev/canvas";
|
|
11548
|
-
import { ApiClient as
|
|
11841
|
+
import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
|
|
11549
11842
|
var ENDPOINT3 = "/api/v1/integration-installations";
|
|
11550
|
-
var InstallClient = class extends
|
|
11843
|
+
var InstallClient = class extends ApiClient4 {
|
|
11551
11844
|
constructor(options) {
|
|
11552
11845
|
if (!options.limitPolicy) {
|
|
11553
11846
|
options.limitPolicy = createLimitPolicy4({});
|
|
@@ -11579,10 +11872,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
11579
11872
|
var IntegrationInstallModule = {
|
|
11580
11873
|
command: "install <type>",
|
|
11581
11874
|
describe: "Installs an integration to a project. The integration may be built-in or custom. Custom integrations must be registered to the parent team first.",
|
|
11582
|
-
builder: (
|
|
11875
|
+
builder: (yargs45) => withConfiguration(
|
|
11583
11876
|
withApiOptions(
|
|
11584
11877
|
withProjectOptions(
|
|
11585
|
-
|
|
11878
|
+
yargs45.positional("type", {
|
|
11586
11879
|
demandOption: true,
|
|
11587
11880
|
describe: "Integration type to install (as defined in its manifest)"
|
|
11588
11881
|
}).option("configuration", {
|
|
@@ -11604,10 +11897,10 @@ var IntegrationInstallModule = {
|
|
|
11604
11897
|
var IntegrationUninstallModule = {
|
|
11605
11898
|
command: "uninstall <type>",
|
|
11606
11899
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
11607
|
-
builder: (
|
|
11900
|
+
builder: (yargs45) => withConfiguration(
|
|
11608
11901
|
withApiOptions(
|
|
11609
11902
|
withProjectOptions(
|
|
11610
|
-
|
|
11903
|
+
yargs45.positional("type", {
|
|
11611
11904
|
demandOption: true,
|
|
11612
11905
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
11613
11906
|
})
|
|
@@ -11625,9 +11918,9 @@ var IntegrationUninstallModule = {
|
|
|
11625
11918
|
var IntegrationCommand = {
|
|
11626
11919
|
command: "integration <command>",
|
|
11627
11920
|
describe: "Integration management commands",
|
|
11628
|
-
builder: (
|
|
11921
|
+
builder: (yargs45) => yargs45.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
11629
11922
|
handler: () => {
|
|
11630
|
-
|
|
11923
|
+
yargs35.showHelp();
|
|
11631
11924
|
}
|
|
11632
11925
|
};
|
|
11633
11926
|
|
|
@@ -11655,7 +11948,7 @@ ${err.message}`);
|
|
|
11655
11948
|
};
|
|
11656
11949
|
|
|
11657
11950
|
// src/projects/cloneStarter.ts
|
|
11658
|
-
import
|
|
11951
|
+
import crypto3 from "crypto";
|
|
11659
11952
|
import fs7 from "fs";
|
|
11660
11953
|
import fsj5 from "fs-jetpack";
|
|
11661
11954
|
import * as git from "isomorphic-git";
|
|
@@ -11670,7 +11963,7 @@ async function cloneStarter({
|
|
|
11670
11963
|
githubBranch
|
|
11671
11964
|
}) {
|
|
11672
11965
|
const done = await spin("Fetching starter code...");
|
|
11673
|
-
const cloneDir = path6.join(os.tmpdir(), `uniform-new-${
|
|
11966
|
+
const cloneDir = path6.join(os.tmpdir(), `uniform-new-${crypto3.randomBytes(20).toString("hex")}`);
|
|
11674
11967
|
const [user, repo, ...pathSegments] = githubPath.split("/");
|
|
11675
11968
|
try {
|
|
11676
11969
|
await git.clone({
|
|
@@ -12092,14 +12385,14 @@ var NewMeshCmd = {
|
|
|
12092
12385
|
};
|
|
12093
12386
|
|
|
12094
12387
|
// src/commands/policy-documents/index.ts
|
|
12095
|
-
import
|
|
12388
|
+
import yargs36 from "yargs";
|
|
12096
12389
|
|
|
12097
12390
|
// src/commands/policy-documents/commands/list.ts
|
|
12098
12391
|
var PolicyDocumentsListModule = {
|
|
12099
12392
|
command: "list",
|
|
12100
12393
|
describe: "List policy documents for a project",
|
|
12101
12394
|
aliases: ["ls"],
|
|
12102
|
-
builder: (
|
|
12395
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
12103
12396
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
12104
12397
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
12105
12398
|
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
@@ -12177,19 +12470,19 @@ ${errorText}`
|
|
|
12177
12470
|
}
|
|
12178
12471
|
|
|
12179
12472
|
// src/commands/policy-documents/commands/_util.ts
|
|
12180
|
-
var
|
|
12181
|
-
var
|
|
12473
|
+
var selectIdentifier14 = (policyDoc) => policyDoc.roleId;
|
|
12474
|
+
var selectDisplayName14 = (policyDoc) => `Policy document for role ${policyDoc.roleId}`;
|
|
12182
12475
|
|
|
12183
12476
|
// src/commands/policy-documents/commands/pull.ts
|
|
12184
12477
|
var PolicyDocumentsPullModule = {
|
|
12185
12478
|
command: "pull <directory>",
|
|
12186
12479
|
describe: "Pulls all policy documents to local files in a directory",
|
|
12187
|
-
builder: (
|
|
12480
|
+
builder: (yargs45) => withConfiguration(
|
|
12188
12481
|
withApiOptions(
|
|
12189
12482
|
withDebugOptions(
|
|
12190
12483
|
withProjectOptions(
|
|
12191
12484
|
withDiffOptions(
|
|
12192
|
-
|
|
12485
|
+
yargs45.positional("directory", {
|
|
12193
12486
|
describe: "Directory to save to. Each policy document will be saved as a separate file named by role ID.",
|
|
12194
12487
|
type: "string"
|
|
12195
12488
|
}).option("format", {
|
|
@@ -12227,8 +12520,8 @@ var PolicyDocumentsPullModule = {
|
|
|
12227
12520
|
const source = createPolicyDocumentsEngineDataSource({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
12228
12521
|
const target = await createFileSyncEngineDataSource({
|
|
12229
12522
|
directory,
|
|
12230
|
-
selectIdentifier:
|
|
12231
|
-
selectDisplayName:
|
|
12523
|
+
selectIdentifier: selectIdentifier14,
|
|
12524
|
+
selectDisplayName: selectDisplayName14,
|
|
12232
12525
|
format,
|
|
12233
12526
|
verbose
|
|
12234
12527
|
});
|
|
@@ -12323,12 +12616,12 @@ function mergePolicyDocuments(localDocs, remoteDocs, mode) {
|
|
|
12323
12616
|
var PolicyDocumentsPushModule = {
|
|
12324
12617
|
command: "push <directory>",
|
|
12325
12618
|
describe: "Pushes policy documents from local files to Uniform",
|
|
12326
|
-
builder: (
|
|
12619
|
+
builder: (yargs45) => withConfiguration(
|
|
12327
12620
|
withApiOptions(
|
|
12328
12621
|
withDebugOptions(
|
|
12329
12622
|
withProjectOptions(
|
|
12330
12623
|
withDiffOptions(
|
|
12331
|
-
|
|
12624
|
+
yargs45.positional("directory", {
|
|
12332
12625
|
describe: "Directory containing policy document files (one file per role ID).",
|
|
12333
12626
|
type: "string"
|
|
12334
12627
|
}).option("format", {
|
|
@@ -12377,8 +12670,8 @@ var PolicyDocumentsPushModule = {
|
|
|
12377
12670
|
const finalDocs = mergePolicyDocuments(localDocs, remoteDocs, mode);
|
|
12378
12671
|
const source = await createFileSyncEngineDataSource({
|
|
12379
12672
|
directory,
|
|
12380
|
-
selectIdentifier:
|
|
12381
|
-
selectDisplayName:
|
|
12673
|
+
selectIdentifier: selectIdentifier14,
|
|
12674
|
+
selectDisplayName: selectDisplayName14,
|
|
12382
12675
|
format,
|
|
12383
12676
|
verbose
|
|
12384
12677
|
});
|
|
@@ -12424,22 +12717,22 @@ var PolicyDocumentsCommand = {
|
|
|
12424
12717
|
command: "policy-documents <command>",
|
|
12425
12718
|
aliases: ["policy", "policies"],
|
|
12426
12719
|
describe: "Uniform Policy Documents commands",
|
|
12427
|
-
builder: (
|
|
12720
|
+
builder: (yargs45) => yargs45.command(PolicyDocumentsListModule).command(PolicyDocumentsPullModule).command(PolicyDocumentsPushModule).demandCommand(),
|
|
12428
12721
|
handler: () => {
|
|
12429
|
-
|
|
12722
|
+
yargs36.showHelp();
|
|
12430
12723
|
}
|
|
12431
12724
|
};
|
|
12432
12725
|
|
|
12433
12726
|
// src/commands/project-map/index.ts
|
|
12434
|
-
import
|
|
12727
|
+
import yargs39 from "yargs";
|
|
12435
12728
|
|
|
12436
12729
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
12437
|
-
import
|
|
12730
|
+
import yargs37 from "yargs";
|
|
12438
12731
|
|
|
12439
12732
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
12440
12733
|
import { ProjectMapClient } from "@uniformdev/project-map";
|
|
12441
|
-
var
|
|
12442
|
-
var
|
|
12734
|
+
var selectIdentifier15 = (source) => source.id;
|
|
12735
|
+
var selectDisplayName15 = (source) => `${source.name} (pid: ${source.id})`;
|
|
12443
12736
|
function getProjectMapClient(options) {
|
|
12444
12737
|
return new ProjectMapClient({ ...options, limitPolicy: cliLimitPolicy, bypassCache: true });
|
|
12445
12738
|
}
|
|
@@ -12448,11 +12741,11 @@ function getProjectMapClient(options) {
|
|
|
12448
12741
|
var ProjectMapDefinitionGetModule = {
|
|
12449
12742
|
command: "get <id>",
|
|
12450
12743
|
describe: "Fetch a project map",
|
|
12451
|
-
builder: (
|
|
12744
|
+
builder: (yargs45) => withFormatOptions(
|
|
12452
12745
|
withConfiguration(
|
|
12453
12746
|
withApiOptions(
|
|
12454
12747
|
withProjectOptions(
|
|
12455
|
-
|
|
12748
|
+
yargs45.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
12456
12749
|
)
|
|
12457
12750
|
)
|
|
12458
12751
|
)
|
|
@@ -12475,7 +12768,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
12475
12768
|
command: "list",
|
|
12476
12769
|
describe: "List of project maps",
|
|
12477
12770
|
aliases: ["ls"],
|
|
12478
|
-
builder: (
|
|
12771
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
12479
12772
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
12480
12773
|
const fetch2 = nodeFetchProxy(proxy);
|
|
12481
12774
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -12503,9 +12796,9 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
12503
12796
|
const projectMaps = (await client.getProjectMapDefinitions()).projectMaps;
|
|
12504
12797
|
for await (const def of projectMaps) {
|
|
12505
12798
|
const result = {
|
|
12506
|
-
id:
|
|
12507
|
-
displayName:
|
|
12508
|
-
providerId:
|
|
12799
|
+
id: selectIdentifier15(def),
|
|
12800
|
+
displayName: selectDisplayName15(def),
|
|
12801
|
+
providerId: selectIdentifier15(def),
|
|
12509
12802
|
object: def
|
|
12510
12803
|
};
|
|
12511
12804
|
yield result;
|
|
@@ -12529,12 +12822,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
12529
12822
|
var ProjectMapDefinitionPullModule = {
|
|
12530
12823
|
command: "pull <directory>",
|
|
12531
12824
|
describe: "Pulls all project maps to local files in a directory",
|
|
12532
|
-
builder: (
|
|
12825
|
+
builder: (yargs45) => withConfiguration(
|
|
12533
12826
|
withDebugOptions(
|
|
12534
12827
|
withApiOptions(
|
|
12535
12828
|
withProjectOptions(
|
|
12536
12829
|
withDiffOptions(
|
|
12537
|
-
|
|
12830
|
+
yargs45.positional("directory", {
|
|
12538
12831
|
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.",
|
|
12539
12832
|
type: "string"
|
|
12540
12833
|
}).option("format", {
|
|
@@ -12578,8 +12871,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
12578
12871
|
target = await createArraySyncEngineDataSource({
|
|
12579
12872
|
name: `Package file ${directory}`,
|
|
12580
12873
|
objects: packageContents.projectMaps ?? [],
|
|
12581
|
-
selectIdentifier:
|
|
12582
|
-
selectDisplayName:
|
|
12874
|
+
selectIdentifier: selectIdentifier15,
|
|
12875
|
+
selectDisplayName: selectDisplayName15,
|
|
12583
12876
|
onSyncComplete: async (_, synced) => {
|
|
12584
12877
|
packageContents.projectMaps = synced;
|
|
12585
12878
|
writeContextPackage2(directory, packageContents);
|
|
@@ -12588,8 +12881,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
12588
12881
|
} else {
|
|
12589
12882
|
target = await createFileSyncEngineDataSource({
|
|
12590
12883
|
directory,
|
|
12591
|
-
selectIdentifier:
|
|
12592
|
-
selectDisplayName:
|
|
12884
|
+
selectIdentifier: selectIdentifier15,
|
|
12885
|
+
selectDisplayName: selectDisplayName15,
|
|
12593
12886
|
format,
|
|
12594
12887
|
verbose
|
|
12595
12888
|
});
|
|
@@ -12609,12 +12902,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
12609
12902
|
var ProjectMapDefinitionPushModule = {
|
|
12610
12903
|
command: "push <directory>",
|
|
12611
12904
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
12612
|
-
builder: (
|
|
12905
|
+
builder: (yargs45) => withConfiguration(
|
|
12613
12906
|
withDebugOptions(
|
|
12614
12907
|
withApiOptions(
|
|
12615
12908
|
withProjectOptions(
|
|
12616
12909
|
withDiffOptions(
|
|
12617
|
-
|
|
12910
|
+
yargs45.positional("directory", {
|
|
12618
12911
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
12619
12912
|
type: "string"
|
|
12620
12913
|
}).option("mode", {
|
|
@@ -12650,14 +12943,14 @@ var ProjectMapDefinitionPushModule = {
|
|
|
12650
12943
|
source = await createArraySyncEngineDataSource({
|
|
12651
12944
|
name: `Package file ${directory}`,
|
|
12652
12945
|
objects: packageContents.projectMaps ?? [],
|
|
12653
|
-
selectIdentifier:
|
|
12654
|
-
selectDisplayName:
|
|
12946
|
+
selectIdentifier: selectIdentifier15,
|
|
12947
|
+
selectDisplayName: selectDisplayName15
|
|
12655
12948
|
});
|
|
12656
12949
|
} else {
|
|
12657
12950
|
source = await createFileSyncEngineDataSource({
|
|
12658
12951
|
directory,
|
|
12659
|
-
selectIdentifier:
|
|
12660
|
-
selectDisplayName:
|
|
12952
|
+
selectIdentifier: selectIdentifier15,
|
|
12953
|
+
selectDisplayName: selectDisplayName15,
|
|
12661
12954
|
verbose
|
|
12662
12955
|
});
|
|
12663
12956
|
}
|
|
@@ -12678,9 +12971,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
12678
12971
|
command: "remove <id>",
|
|
12679
12972
|
aliases: ["delete", "rm"],
|
|
12680
12973
|
describe: "Delete a project map",
|
|
12681
|
-
builder: (
|
|
12974
|
+
builder: (yargs45) => withConfiguration(
|
|
12682
12975
|
withApiOptions(
|
|
12683
|
-
withProjectOptions(
|
|
12976
|
+
withProjectOptions(yargs45.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
12684
12977
|
)
|
|
12685
12978
|
),
|
|
12686
12979
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -12695,10 +12988,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
12695
12988
|
command: "update <filename>",
|
|
12696
12989
|
aliases: ["put"],
|
|
12697
12990
|
describe: "Insert or update a project map",
|
|
12698
|
-
builder: (
|
|
12991
|
+
builder: (yargs45) => withConfiguration(
|
|
12699
12992
|
withApiOptions(
|
|
12700
12993
|
withProjectOptions(
|
|
12701
|
-
|
|
12994
|
+
yargs45.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
12702
12995
|
)
|
|
12703
12996
|
)
|
|
12704
12997
|
),
|
|
@@ -12714,24 +13007,24 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
12714
13007
|
var ProjectMapDefinitionModule = {
|
|
12715
13008
|
command: "definition <command>",
|
|
12716
13009
|
describe: "Commands for ProjectMap Definitions",
|
|
12717
|
-
builder: (
|
|
13010
|
+
builder: (yargs45) => yargs45.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
12718
13011
|
handler: () => {
|
|
12719
|
-
|
|
13012
|
+
yargs37.help();
|
|
12720
13013
|
}
|
|
12721
13014
|
};
|
|
12722
13015
|
|
|
12723
13016
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
12724
|
-
import
|
|
13017
|
+
import yargs38 from "yargs";
|
|
12725
13018
|
|
|
12726
13019
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
12727
13020
|
var ProjectMapNodeGetModule = {
|
|
12728
13021
|
command: "get <id> <projectMapId>",
|
|
12729
13022
|
describe: "Fetch a project map node",
|
|
12730
|
-
builder: (
|
|
13023
|
+
builder: (yargs45) => withConfiguration(
|
|
12731
13024
|
withFormatOptions(
|
|
12732
13025
|
withApiOptions(
|
|
12733
13026
|
withProjectOptions(
|
|
12734
|
-
|
|
13027
|
+
yargs45.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
12735
13028
|
)
|
|
12736
13029
|
)
|
|
12737
13030
|
)
|
|
@@ -12754,12 +13047,12 @@ var ProjectMapNodeListModule = {
|
|
|
12754
13047
|
command: "list <projectMapId>",
|
|
12755
13048
|
describe: "List project map nodes",
|
|
12756
13049
|
aliases: ["ls"],
|
|
12757
|
-
builder: (
|
|
13050
|
+
builder: (yargs45) => withConfiguration(
|
|
12758
13051
|
withFormatOptions(
|
|
12759
13052
|
withApiOptions(
|
|
12760
13053
|
withProjectOptions(
|
|
12761
13054
|
withStateOptions(
|
|
12762
|
-
|
|
13055
|
+
yargs45.positional("projectMapId", {
|
|
12763
13056
|
demandOption: true,
|
|
12764
13057
|
describe: "ProjectMap UUID to fetch from"
|
|
12765
13058
|
})
|
|
@@ -12777,13 +13070,13 @@ var ProjectMapNodeListModule = {
|
|
|
12777
13070
|
};
|
|
12778
13071
|
|
|
12779
13072
|
// src/commands/project-map/commands/ProjectMapNode/_util.ts
|
|
12780
|
-
var
|
|
13073
|
+
var selectIdentifier16 = (source, projectId) => [
|
|
12781
13074
|
projectId + source.projectMapId + source.id,
|
|
12782
13075
|
projectId + source.projectMapId + source.path
|
|
12783
13076
|
];
|
|
12784
13077
|
var selectNodeDepth = (source) => source.path.split("/").filter((segment) => segment.length > 0).length;
|
|
12785
13078
|
var selectFilename = (source) => cleanFileName(`${source.pathSegment}_${source.id}`);
|
|
12786
|
-
var
|
|
13079
|
+
var selectDisplayName16 = (source) => `${source.name} (pid: ${source.id})`;
|
|
12787
13080
|
function alignProjectMapNodeWithTargetIdentifier(sourceObject, targetObject) {
|
|
12788
13081
|
if (!targetObject) {
|
|
12789
13082
|
return sourceObject;
|
|
@@ -12811,9 +13104,9 @@ function createProjectMapNodeEngineDataSource({
|
|
|
12811
13104
|
for await (const node of nodes ?? []) {
|
|
12812
13105
|
if (node) {
|
|
12813
13106
|
const result = {
|
|
12814
|
-
id:
|
|
12815
|
-
displayName:
|
|
12816
|
-
providerId:
|
|
13107
|
+
id: selectIdentifier16({ ...node, projectMapId: projectMap.id }, projectId),
|
|
13108
|
+
displayName: selectDisplayName16(node),
|
|
13109
|
+
providerId: selectIdentifier16({ ...node, projectMapId: projectMap.id }, projectId)[0],
|
|
12817
13110
|
object: { ...node, projectMapId: projectMap.id }
|
|
12818
13111
|
};
|
|
12819
13112
|
yield result;
|
|
@@ -12852,12 +13145,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
12852
13145
|
var ProjectMapNodePullModule = {
|
|
12853
13146
|
command: "pull <directory>",
|
|
12854
13147
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
12855
|
-
builder: (
|
|
13148
|
+
builder: (yargs45) => withConfiguration(
|
|
12856
13149
|
withDebugOptions(
|
|
12857
13150
|
withApiOptions(
|
|
12858
13151
|
withProjectOptions(
|
|
12859
13152
|
withDiffOptions(
|
|
12860
|
-
|
|
13153
|
+
yargs45.positional("directory", {
|
|
12861
13154
|
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.",
|
|
12862
13155
|
type: "string"
|
|
12863
13156
|
}).option("format", {
|
|
@@ -12897,7 +13190,7 @@ var ProjectMapNodePullModule = {
|
|
|
12897
13190
|
let target;
|
|
12898
13191
|
const isPackage = isPathAPackageFile(directory);
|
|
12899
13192
|
const expandedSelectIdentifier = (object4) => {
|
|
12900
|
-
return
|
|
13193
|
+
return selectIdentifier16(object4, projectId);
|
|
12901
13194
|
};
|
|
12902
13195
|
if (isPackage) {
|
|
12903
13196
|
const packageContents = readContextPackage2(directory, false, verbose);
|
|
@@ -12905,7 +13198,7 @@ var ProjectMapNodePullModule = {
|
|
|
12905
13198
|
name: `Package file ${directory}`,
|
|
12906
13199
|
objects: packageContents.projectMapNodes ?? [],
|
|
12907
13200
|
selectIdentifier: expandedSelectIdentifier,
|
|
12908
|
-
selectDisplayName:
|
|
13201
|
+
selectDisplayName: selectDisplayName16,
|
|
12909
13202
|
onSyncComplete: async (_, synced) => {
|
|
12910
13203
|
packageContents.projectMapNodes = synced;
|
|
12911
13204
|
writeContextPackage2(directory, packageContents);
|
|
@@ -12915,7 +13208,7 @@ var ProjectMapNodePullModule = {
|
|
|
12915
13208
|
target = await createFileSyncEngineDataSource({
|
|
12916
13209
|
directory,
|
|
12917
13210
|
selectIdentifier: expandedSelectIdentifier,
|
|
12918
|
-
selectDisplayName:
|
|
13211
|
+
selectDisplayName: selectDisplayName16,
|
|
12919
13212
|
format,
|
|
12920
13213
|
selectFilename,
|
|
12921
13214
|
verbose
|
|
@@ -12939,12 +13232,12 @@ import {
|
|
|
12939
13232
|
var ProjectMapNodePushModule = {
|
|
12940
13233
|
command: "push <directory>",
|
|
12941
13234
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
12942
|
-
builder: (
|
|
13235
|
+
builder: (yargs45) => withConfiguration(
|
|
12943
13236
|
withDebugOptions(
|
|
12944
13237
|
withApiOptions(
|
|
12945
13238
|
withProjectOptions(
|
|
12946
13239
|
withDiffOptions(
|
|
12947
|
-
|
|
13240
|
+
yargs45.positional("directory", {
|
|
12948
13241
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
12949
13242
|
type: "string"
|
|
12950
13243
|
}).option("mode", {
|
|
@@ -12981,7 +13274,7 @@ var ProjectMapNodePushModule = {
|
|
|
12981
13274
|
let source;
|
|
12982
13275
|
const isPackage = isPathAPackageFile(directory);
|
|
12983
13276
|
const expandedSelectIdentifier = (object4) => {
|
|
12984
|
-
return
|
|
13277
|
+
return selectIdentifier16(object4, projectId);
|
|
12985
13278
|
};
|
|
12986
13279
|
if (isPackage) {
|
|
12987
13280
|
const packageContents = readContextPackage2(directory, true, verbose);
|
|
@@ -12991,13 +13284,13 @@ var ProjectMapNodePushModule = {
|
|
|
12991
13284
|
return selectNodeDepth(a) - selectNodeDepth(b);
|
|
12992
13285
|
}) ?? [],
|
|
12993
13286
|
selectIdentifier: expandedSelectIdentifier,
|
|
12994
|
-
selectDisplayName:
|
|
13287
|
+
selectDisplayName: selectDisplayName16
|
|
12995
13288
|
});
|
|
12996
13289
|
} else {
|
|
12997
13290
|
source = await createFileSyncEngineDataSource({
|
|
12998
13291
|
directory,
|
|
12999
13292
|
selectIdentifier: expandedSelectIdentifier,
|
|
13000
|
-
selectDisplayName:
|
|
13293
|
+
selectDisplayName: selectDisplayName16,
|
|
13001
13294
|
selectFilename,
|
|
13002
13295
|
verbose
|
|
13003
13296
|
});
|
|
@@ -13038,7 +13331,7 @@ var ProjectMapNodePushModule = {
|
|
|
13038
13331
|
name: `Nodes re-push from ${directory}`,
|
|
13039
13332
|
objects: Array.from(nodesFailedDueToMissingParent),
|
|
13040
13333
|
selectIdentifier: expandedSelectIdentifier,
|
|
13041
|
-
selectDisplayName:
|
|
13334
|
+
selectDisplayName: selectDisplayName16
|
|
13042
13335
|
});
|
|
13043
13336
|
await attemptSync();
|
|
13044
13337
|
} else {
|
|
@@ -13055,10 +13348,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
13055
13348
|
command: "remove <id> <projectMapId>",
|
|
13056
13349
|
aliases: ["delete", "rm"],
|
|
13057
13350
|
describe: "Delete a project map node",
|
|
13058
|
-
builder: (
|
|
13351
|
+
builder: (yargs45) => withConfiguration(
|
|
13059
13352
|
withApiOptions(
|
|
13060
13353
|
withProjectOptions(
|
|
13061
|
-
|
|
13354
|
+
yargs45.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
13062
13355
|
)
|
|
13063
13356
|
)
|
|
13064
13357
|
),
|
|
@@ -13074,10 +13367,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
13074
13367
|
command: "update <filename> <projectMapId>",
|
|
13075
13368
|
aliases: ["put"],
|
|
13076
13369
|
describe: "Insert or update a project map node",
|
|
13077
|
-
builder: (
|
|
13370
|
+
builder: (yargs45) => withConfiguration(
|
|
13078
13371
|
withApiOptions(
|
|
13079
13372
|
withProjectOptions(
|
|
13080
|
-
|
|
13373
|
+
yargs45.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
13081
13374
|
)
|
|
13082
13375
|
)
|
|
13083
13376
|
),
|
|
@@ -13093,9 +13386,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
13093
13386
|
var ProjectMapNodeModule = {
|
|
13094
13387
|
command: "node <command>",
|
|
13095
13388
|
describe: "Commands for ProjectMap Nodes",
|
|
13096
|
-
builder: (
|
|
13389
|
+
builder: (yargs45) => yargs45.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
13097
13390
|
handler: () => {
|
|
13098
|
-
|
|
13391
|
+
yargs38.help();
|
|
13099
13392
|
}
|
|
13100
13393
|
};
|
|
13101
13394
|
|
|
@@ -13104,26 +13397,26 @@ var ProjectMapCommand = {
|
|
|
13104
13397
|
command: "project-map <command>",
|
|
13105
13398
|
aliases: ["prm"],
|
|
13106
13399
|
describe: "Uniform ProjectMap commands",
|
|
13107
|
-
builder: (
|
|
13400
|
+
builder: (yargs45) => yargs45.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
13108
13401
|
handler: () => {
|
|
13109
|
-
|
|
13402
|
+
yargs39.showHelp();
|
|
13110
13403
|
}
|
|
13111
13404
|
};
|
|
13112
13405
|
|
|
13113
13406
|
// src/commands/redirect/index.ts
|
|
13114
|
-
import
|
|
13407
|
+
import yargs41 from "yargs";
|
|
13115
13408
|
|
|
13116
13409
|
// src/commands/redirect/commands/redirect.ts
|
|
13117
|
-
import
|
|
13410
|
+
import yargs40 from "yargs";
|
|
13118
13411
|
|
|
13119
13412
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
13120
13413
|
import { RedirectClient } from "@uniformdev/redirect";
|
|
13121
|
-
var
|
|
13414
|
+
var selectIdentifier17 = (source) => source.id;
|
|
13122
13415
|
var selectFilename2 = (source) => {
|
|
13123
13416
|
const index = source.sourceUrl.lastIndexOf("/");
|
|
13124
13417
|
return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
|
|
13125
13418
|
};
|
|
13126
|
-
var
|
|
13419
|
+
var selectDisplayName17 = (source) => {
|
|
13127
13420
|
let pathName = source.sourceUrl;
|
|
13128
13421
|
if (pathName.length > 30) {
|
|
13129
13422
|
const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
|
|
@@ -13139,11 +13432,11 @@ function getRedirectClient(options) {
|
|
|
13139
13432
|
var RedirectDefinitionGetModule = {
|
|
13140
13433
|
command: "get <id>",
|
|
13141
13434
|
describe: "Fetch a redirect",
|
|
13142
|
-
builder: (
|
|
13435
|
+
builder: (yargs45) => withConfiguration(
|
|
13143
13436
|
withFormatOptions(
|
|
13144
13437
|
withApiOptions(
|
|
13145
13438
|
withProjectOptions(
|
|
13146
|
-
|
|
13439
|
+
yargs45.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
13147
13440
|
)
|
|
13148
13441
|
)
|
|
13149
13442
|
)
|
|
@@ -13166,7 +13459,7 @@ var RedirectDefinitionListModule = {
|
|
|
13166
13459
|
command: "list",
|
|
13167
13460
|
describe: "List of redirects",
|
|
13168
13461
|
aliases: ["ls"],
|
|
13169
|
-
builder: (
|
|
13462
|
+
builder: (yargs45) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs45)))),
|
|
13170
13463
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
13171
13464
|
const fetch2 = nodeFetchProxy(proxy);
|
|
13172
13465
|
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -13194,9 +13487,9 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
13194
13487
|
const redirects = client.getAllRedirects();
|
|
13195
13488
|
for await (const redirect of redirects) {
|
|
13196
13489
|
const result = {
|
|
13197
|
-
id:
|
|
13198
|
-
displayName:
|
|
13199
|
-
providerId:
|
|
13490
|
+
id: selectIdentifier17(redirect.redirect),
|
|
13491
|
+
displayName: selectDisplayName17(redirect.redirect),
|
|
13492
|
+
providerId: selectIdentifier17(redirect.redirect),
|
|
13200
13493
|
object: redirect.redirect
|
|
13201
13494
|
};
|
|
13202
13495
|
yield result;
|
|
@@ -13218,12 +13511,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
13218
13511
|
var RedirectDefinitionPullModule = {
|
|
13219
13512
|
command: "pull <directory>",
|
|
13220
13513
|
describe: "Pulls all redirects to local files in a directory",
|
|
13221
|
-
builder: (
|
|
13514
|
+
builder: (yargs45) => withConfiguration(
|
|
13222
13515
|
withDebugOptions(
|
|
13223
13516
|
withApiOptions(
|
|
13224
13517
|
withProjectOptions(
|
|
13225
13518
|
withDiffOptions(
|
|
13226
|
-
|
|
13519
|
+
yargs45.positional("directory", {
|
|
13227
13520
|
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.",
|
|
13228
13521
|
type: "string"
|
|
13229
13522
|
}).option("format", {
|
|
@@ -13267,8 +13560,8 @@ var RedirectDefinitionPullModule = {
|
|
|
13267
13560
|
target = await createArraySyncEngineDataSource({
|
|
13268
13561
|
name: `Package file ${directory}`,
|
|
13269
13562
|
objects: packageContents.redirects ?? [],
|
|
13270
|
-
selectIdentifier:
|
|
13271
|
-
selectDisplayName:
|
|
13563
|
+
selectIdentifier: selectIdentifier17,
|
|
13564
|
+
selectDisplayName: selectDisplayName17,
|
|
13272
13565
|
onSyncComplete: async (_, synced) => {
|
|
13273
13566
|
packageContents.redirects = synced;
|
|
13274
13567
|
writeContextPackage3(directory, packageContents);
|
|
@@ -13278,8 +13571,8 @@ var RedirectDefinitionPullModule = {
|
|
|
13278
13571
|
target = await createFileSyncEngineDataSource({
|
|
13279
13572
|
directory,
|
|
13280
13573
|
selectFilename: selectFilename2,
|
|
13281
|
-
selectIdentifier:
|
|
13282
|
-
selectDisplayName:
|
|
13574
|
+
selectIdentifier: selectIdentifier17,
|
|
13575
|
+
selectDisplayName: selectDisplayName17,
|
|
13283
13576
|
format,
|
|
13284
13577
|
verbose
|
|
13285
13578
|
});
|
|
@@ -13299,12 +13592,12 @@ var RedirectDefinitionPullModule = {
|
|
|
13299
13592
|
var RedirectDefinitionPushModule = {
|
|
13300
13593
|
command: "push <directory>",
|
|
13301
13594
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
13302
|
-
builder: (
|
|
13595
|
+
builder: (yargs45) => withConfiguration(
|
|
13303
13596
|
withDebugOptions(
|
|
13304
13597
|
withApiOptions(
|
|
13305
13598
|
withProjectOptions(
|
|
13306
13599
|
withDiffOptions(
|
|
13307
|
-
|
|
13600
|
+
yargs45.positional("directory", {
|
|
13308
13601
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
13309
13602
|
type: "string"
|
|
13310
13603
|
}).option("mode", {
|
|
@@ -13340,14 +13633,14 @@ var RedirectDefinitionPushModule = {
|
|
|
13340
13633
|
source = await createArraySyncEngineDataSource({
|
|
13341
13634
|
name: `Package file ${directory}`,
|
|
13342
13635
|
objects: packageContents.redirects ?? [],
|
|
13343
|
-
selectIdentifier:
|
|
13344
|
-
selectDisplayName:
|
|
13636
|
+
selectIdentifier: selectIdentifier17,
|
|
13637
|
+
selectDisplayName: selectDisplayName17
|
|
13345
13638
|
});
|
|
13346
13639
|
} else {
|
|
13347
13640
|
source = await createFileSyncEngineDataSource({
|
|
13348
13641
|
directory,
|
|
13349
|
-
selectIdentifier:
|
|
13350
|
-
selectDisplayName:
|
|
13642
|
+
selectIdentifier: selectIdentifier17,
|
|
13643
|
+
selectDisplayName: selectDisplayName17,
|
|
13351
13644
|
verbose
|
|
13352
13645
|
});
|
|
13353
13646
|
}
|
|
@@ -13368,9 +13661,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
13368
13661
|
command: "remove <id>",
|
|
13369
13662
|
aliases: ["delete", "rm"],
|
|
13370
13663
|
describe: "Delete a redirect",
|
|
13371
|
-
builder: (
|
|
13664
|
+
builder: (yargs45) => withConfiguration(
|
|
13372
13665
|
withApiOptions(
|
|
13373
|
-
withProjectOptions(
|
|
13666
|
+
withProjectOptions(yargs45.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
13374
13667
|
)
|
|
13375
13668
|
),
|
|
13376
13669
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -13385,10 +13678,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
13385
13678
|
command: "update <filename>",
|
|
13386
13679
|
aliases: ["put"],
|
|
13387
13680
|
describe: "Insert or update a redirect",
|
|
13388
|
-
builder: (
|
|
13681
|
+
builder: (yargs45) => withConfiguration(
|
|
13389
13682
|
withApiOptions(
|
|
13390
13683
|
withProjectOptions(
|
|
13391
|
-
|
|
13684
|
+
yargs45.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
13392
13685
|
)
|
|
13393
13686
|
)
|
|
13394
13687
|
),
|
|
@@ -13404,9 +13697,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
13404
13697
|
var RedirectDefinitionModule = {
|
|
13405
13698
|
command: "definition <command>",
|
|
13406
13699
|
describe: "Commands for Redirect Definitions",
|
|
13407
|
-
builder: (
|
|
13700
|
+
builder: (yargs45) => yargs45.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
13408
13701
|
handler: () => {
|
|
13409
|
-
|
|
13702
|
+
yargs40.help();
|
|
13410
13703
|
}
|
|
13411
13704
|
};
|
|
13412
13705
|
|
|
@@ -13415,22 +13708,22 @@ var RedirectCommand = {
|
|
|
13415
13708
|
command: "redirect <command>",
|
|
13416
13709
|
aliases: ["red"],
|
|
13417
13710
|
describe: "Uniform Redirect commands",
|
|
13418
|
-
builder: (
|
|
13711
|
+
builder: (yargs45) => yargs45.command(RedirectDefinitionModule).demandCommand(),
|
|
13419
13712
|
handler: () => {
|
|
13420
|
-
|
|
13713
|
+
yargs41.showHelp();
|
|
13421
13714
|
}
|
|
13422
13715
|
};
|
|
13423
13716
|
|
|
13424
13717
|
// src/commands/sync/index.ts
|
|
13425
|
-
import
|
|
13718
|
+
import yargs42 from "yargs";
|
|
13426
13719
|
|
|
13427
13720
|
// src/webhooksClient.ts
|
|
13428
|
-
import { ApiClient as
|
|
13721
|
+
import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
|
|
13429
13722
|
import PQueue4 from "p-queue";
|
|
13430
13723
|
import { Svix } from "svix";
|
|
13431
13724
|
import * as z4 from "zod";
|
|
13432
13725
|
var WEBHOOKS_DASHBOARD_BASE_PATH = "/api/v1/svix-dashboard";
|
|
13433
|
-
var WebhooksClient = class extends
|
|
13726
|
+
var WebhooksClient = class extends ApiClient5 {
|
|
13434
13727
|
constructor(options) {
|
|
13435
13728
|
super(options);
|
|
13436
13729
|
}
|
|
@@ -13556,8 +13849,8 @@ var WebhooksClient = class extends ApiClient4 {
|
|
|
13556
13849
|
};
|
|
13557
13850
|
|
|
13558
13851
|
// src/commands/webhook/commands/_util.ts
|
|
13559
|
-
var
|
|
13560
|
-
var
|
|
13852
|
+
var selectIdentifier18 = (webhook) => webhook.endpoint.uid ?? webhook.endpoint.id;
|
|
13853
|
+
var selectDisplayName18 = (webhook) => `${webhook.endpoint.url} (pid: ${webhook.endpoint.uid ?? webhook.endpoint.id})`;
|
|
13561
13854
|
var getWebhooksClient = (options) => new WebhooksClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
13562
13855
|
var compareWebhooks = (source, target) => {
|
|
13563
13856
|
const { endpoint: sourceEndpoint, ...sourceWithoutEndpoint } = source.object;
|
|
@@ -13592,8 +13885,8 @@ function createWebhookEngineDataSource({
|
|
|
13592
13885
|
const webhooks = await client.get();
|
|
13593
13886
|
for await (const webhook of webhooks) {
|
|
13594
13887
|
const result = {
|
|
13595
|
-
id:
|
|
13596
|
-
displayName:
|
|
13888
|
+
id: selectIdentifier18(webhook),
|
|
13889
|
+
displayName: selectDisplayName18(webhook),
|
|
13597
13890
|
providerId: webhook.endpoint.id,
|
|
13598
13891
|
object: webhook
|
|
13599
13892
|
};
|
|
@@ -13616,12 +13909,12 @@ function createWebhookEngineDataSource({
|
|
|
13616
13909
|
var WebhookPullModule = {
|
|
13617
13910
|
command: "pull <directory>",
|
|
13618
13911
|
describe: "Pulls all webhooks to local files in a directory",
|
|
13619
|
-
builder: (
|
|
13912
|
+
builder: (yargs45) => withConfiguration(
|
|
13620
13913
|
withApiOptions(
|
|
13621
13914
|
withDebugOptions(
|
|
13622
13915
|
withProjectOptions(
|
|
13623
13916
|
withDiffOptions(
|
|
13624
|
-
|
|
13917
|
+
yargs45.positional("directory", {
|
|
13625
13918
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
13626
13919
|
type: "string"
|
|
13627
13920
|
}).option("format", {
|
|
@@ -13665,8 +13958,8 @@ var WebhookPullModule = {
|
|
|
13665
13958
|
target = await createArraySyncEngineDataSource({
|
|
13666
13959
|
name: `Package file ${directory}`,
|
|
13667
13960
|
objects: packageContents.webhooks ?? [],
|
|
13668
|
-
selectIdentifier:
|
|
13669
|
-
selectDisplayName:
|
|
13961
|
+
selectIdentifier: selectIdentifier18,
|
|
13962
|
+
selectDisplayName: selectDisplayName18,
|
|
13670
13963
|
onSyncComplete: async (_, synced) => {
|
|
13671
13964
|
packageContents.webhooks = synced;
|
|
13672
13965
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -13675,8 +13968,8 @@ var WebhookPullModule = {
|
|
|
13675
13968
|
} else {
|
|
13676
13969
|
target = await createFileSyncEngineDataSource({
|
|
13677
13970
|
directory,
|
|
13678
|
-
selectIdentifier:
|
|
13679
|
-
selectDisplayName:
|
|
13971
|
+
selectIdentifier: selectIdentifier18,
|
|
13972
|
+
selectDisplayName: selectDisplayName18,
|
|
13680
13973
|
format,
|
|
13681
13974
|
verbose
|
|
13682
13975
|
});
|
|
@@ -13808,7 +14101,7 @@ function numPad(num, spaces = 6) {
|
|
|
13808
14101
|
var SyncPullModule = {
|
|
13809
14102
|
command: "pull",
|
|
13810
14103
|
describe: "Pulls whole project to local files in a directory",
|
|
13811
|
-
builder: (
|
|
14104
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs45))))),
|
|
13812
14105
|
handler: async ({ serialization, ...otherParams }) => {
|
|
13813
14106
|
const config2 = serialization;
|
|
13814
14107
|
const enabledEntities = Object.entries({
|
|
@@ -13834,6 +14127,7 @@ var SyncPullModule = {
|
|
|
13834
14127
|
entry: EntryPullModule,
|
|
13835
14128
|
entryPattern: EntryPatternPullModule,
|
|
13836
14129
|
contentType: ContentTypePullModule,
|
|
14130
|
+
customView: CustomViewPullModule,
|
|
13837
14131
|
previewUrl: PreviewUrlPullModule,
|
|
13838
14132
|
previewViewport: PreviewViewportPullModule,
|
|
13839
14133
|
policyDocument: PolicyDocumentsPullModule,
|
|
@@ -13909,12 +14203,12 @@ var getFormat = (entityType, config2) => {
|
|
|
13909
14203
|
var WebhookPushModule = {
|
|
13910
14204
|
command: "push <directory>",
|
|
13911
14205
|
describe: "Pushes all webhooks from files in a directory to Uniform",
|
|
13912
|
-
builder: (
|
|
14206
|
+
builder: (yargs45) => withConfiguration(
|
|
13913
14207
|
withDebugOptions(
|
|
13914
14208
|
withApiOptions(
|
|
13915
14209
|
withProjectOptions(
|
|
13916
14210
|
withDiffOptions(
|
|
13917
|
-
|
|
14211
|
+
yargs45.positional("directory", {
|
|
13918
14212
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
13919
14213
|
type: "string"
|
|
13920
14214
|
}).option("mode", {
|
|
@@ -13950,14 +14244,14 @@ var WebhookPushModule = {
|
|
|
13950
14244
|
source = await createArraySyncEngineDataSource({
|
|
13951
14245
|
name: `Package file ${directory}`,
|
|
13952
14246
|
objects: packageContents.webhooks ?? [],
|
|
13953
|
-
selectIdentifier:
|
|
13954
|
-
selectDisplayName:
|
|
14247
|
+
selectIdentifier: selectIdentifier18,
|
|
14248
|
+
selectDisplayName: selectDisplayName18
|
|
13955
14249
|
});
|
|
13956
14250
|
} else {
|
|
13957
14251
|
source = await createFileSyncEngineDataSource({
|
|
13958
14252
|
directory,
|
|
13959
|
-
selectIdentifier:
|
|
13960
|
-
selectDisplayName:
|
|
14253
|
+
selectIdentifier: selectIdentifier18,
|
|
14254
|
+
selectDisplayName: selectDisplayName18,
|
|
13961
14255
|
verbose
|
|
13962
14256
|
});
|
|
13963
14257
|
}
|
|
@@ -13978,7 +14272,7 @@ var WebhookPushModule = {
|
|
|
13978
14272
|
var SyncPushModule = {
|
|
13979
14273
|
command: "push",
|
|
13980
14274
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
13981
|
-
builder: (
|
|
14275
|
+
builder: (yargs45) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs45))))),
|
|
13982
14276
|
handler: async ({ serialization, ...otherParams }) => {
|
|
13983
14277
|
const config2 = serialization;
|
|
13984
14278
|
const enabledEntities = Object.entries({
|
|
@@ -14002,6 +14296,7 @@ var SyncPushModule = {
|
|
|
14002
14296
|
projectMapNode: ProjectMapNodePushModule,
|
|
14003
14297
|
redirect: RedirectDefinitionPushModule,
|
|
14004
14298
|
contentType: ContentTypePushModule,
|
|
14299
|
+
customView: CustomViewPushModule,
|
|
14005
14300
|
entry: EntryPushModule,
|
|
14006
14301
|
entryPattern: EntryPatternPushModule,
|
|
14007
14302
|
previewUrl: PreviewUrlPushModule,
|
|
@@ -14155,21 +14450,21 @@ var getFormat2 = (entityType, config2) => {
|
|
|
14155
14450
|
var SyncCommand = {
|
|
14156
14451
|
command: "sync <command>",
|
|
14157
14452
|
describe: "Uniform Sync commands",
|
|
14158
|
-
builder: (
|
|
14453
|
+
builder: (yargs45) => yargs45.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
14159
14454
|
handler: () => {
|
|
14160
|
-
|
|
14455
|
+
yargs42.showHelp();
|
|
14161
14456
|
}
|
|
14162
14457
|
};
|
|
14163
14458
|
|
|
14164
14459
|
// src/commands/webhook/index.ts
|
|
14165
|
-
import
|
|
14460
|
+
import yargs43 from "yargs";
|
|
14166
14461
|
var WebhookCommand = {
|
|
14167
14462
|
command: "webhook <command>",
|
|
14168
14463
|
aliases: ["wh"],
|
|
14169
14464
|
describe: "Commands for webhooks",
|
|
14170
|
-
builder: (
|
|
14465
|
+
builder: (yargs45) => yargs45.command(WebhookPullModule).command(WebhookPushModule).demandCommand(),
|
|
14171
14466
|
handler: () => {
|
|
14172
|
-
|
|
14467
|
+
yargs43.help();
|
|
14173
14468
|
}
|
|
14174
14469
|
};
|
|
14175
14470
|
|
|
@@ -14178,8 +14473,8 @@ import { ProjectClient as ProjectClient2 } from "@uniformdev/canvas";
|
|
|
14178
14473
|
var WhoamiCommand = {
|
|
14179
14474
|
command: "whoami",
|
|
14180
14475
|
describe: "Prints configured identity and connection context.",
|
|
14181
|
-
builder: (
|
|
14182
|
-
withFormatOptions(withApiOptions(
|
|
14476
|
+
builder: (yargs45) => withConfiguration(
|
|
14477
|
+
withFormatOptions(withApiOptions(yargs45, { includeEdgeApiHost: true })).option("project", {
|
|
14183
14478
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
14184
14479
|
default: process.env.UNIFORM_CLI_PROJECT_ID ?? process.env.UNIFORM_PROJECT_ID,
|
|
14185
14480
|
type: "string",
|
|
@@ -14446,7 +14741,7 @@ First found was: v${firstVersion}`;
|
|
|
14446
14741
|
|
|
14447
14742
|
// src/index.ts
|
|
14448
14743
|
dotenv.config({ quiet: true });
|
|
14449
|
-
var yarggery =
|
|
14744
|
+
var yarggery = yargs44(hideBin(process.argv));
|
|
14450
14745
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
14451
14746
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
14452
14747
|
yarggery.option("verbose", {
|