@uniformdev/cli 20.49.3 → 20.49.4-alpha.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
22
|
import * as dotenv from "dotenv";
|
|
23
|
-
import
|
|
23
|
+
import yargs42 from "yargs";
|
|
24
24
|
import { hideBin } from "yargs/helpers";
|
|
25
25
|
|
|
26
26
|
// src/commands/ai/index.ts
|
|
@@ -1124,7 +1124,7 @@ import { PostHog } from "posthog-node";
|
|
|
1124
1124
|
// package.json
|
|
1125
1125
|
var package_default = {
|
|
1126
1126
|
name: "@uniformdev/cli",
|
|
1127
|
-
version: "20.
|
|
1127
|
+
version: "20.50.0",
|
|
1128
1128
|
description: "Uniform command line interface tool",
|
|
1129
1129
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
1130
1130
|
main: "./cli.js",
|
|
@@ -1403,8 +1403,8 @@ function getExistingServers(config2) {
|
|
|
1403
1403
|
var InstallMcpCommand = {
|
|
1404
1404
|
command: "install",
|
|
1405
1405
|
describe: "Install Uniform MCP server configuration (use --team, --project, and --apiKey for non-interactive mode)",
|
|
1406
|
-
builder: (
|
|
1407
|
-
|
|
1406
|
+
builder: (yargs43) => withConfiguration(
|
|
1407
|
+
yargs43.option("agent", {
|
|
1408
1408
|
alias: "a",
|
|
1409
1409
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
1410
1410
|
type: "string",
|
|
@@ -1604,7 +1604,7 @@ Selected agent: ${agentType}`));
|
|
|
1604
1604
|
var McpCommand = {
|
|
1605
1605
|
command: "mcp <command>",
|
|
1606
1606
|
describe: "Uniform MCP server management commands",
|
|
1607
|
-
builder: (
|
|
1607
|
+
builder: (yargs43) => yargs43.command(InstallMcpCommand).demandCommand(),
|
|
1608
1608
|
handler: () => {
|
|
1609
1609
|
yargs.showHelp();
|
|
1610
1610
|
}
|
|
@@ -2079,8 +2079,8 @@ ${gray2("Rules source:")} https://github.com/uniformdev/ai-rules`);
|
|
|
2079
2079
|
var InstallRulesCommand = {
|
|
2080
2080
|
command: "install",
|
|
2081
2081
|
describe: "Install Uniform AI rules for your development assistant",
|
|
2082
|
-
builder: (
|
|
2083
|
-
|
|
2082
|
+
builder: (yargs43) => withConfiguration(
|
|
2083
|
+
yargs43.option("agent", {
|
|
2084
2084
|
alias: "a",
|
|
2085
2085
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
2086
2086
|
type: "string",
|
|
@@ -2118,7 +2118,7 @@ import { blue as blue4, bold as bold2, gray as gray3, green as green5, red as re
|
|
|
2118
2118
|
var ListRulesCommand = {
|
|
2119
2119
|
command: "list",
|
|
2120
2120
|
describe: "List available Uniform AI rules",
|
|
2121
|
-
builder: (
|
|
2121
|
+
builder: (yargs43) => withConfiguration(yargs43),
|
|
2122
2122
|
handler: async function() {
|
|
2123
2123
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
2124
2124
|
try {
|
|
@@ -2147,7 +2147,7 @@ var ListRulesCommand = {
|
|
|
2147
2147
|
var RulesCommand = {
|
|
2148
2148
|
command: "rules <command>",
|
|
2149
2149
|
describe: "Uniform AI rules management commands",
|
|
2150
|
-
builder: (
|
|
2150
|
+
builder: (yargs43) => yargs43.command(InstallRulesCommand).command(ListRulesCommand).demandCommand(),
|
|
2151
2151
|
handler: () => {
|
|
2152
2152
|
yargs2.showHelp();
|
|
2153
2153
|
}
|
|
@@ -2157,14 +2157,14 @@ var RulesCommand = {
|
|
|
2157
2157
|
var AiCommand = {
|
|
2158
2158
|
command: "ai <command>",
|
|
2159
2159
|
describe: "Uniform AI development assistant commands",
|
|
2160
|
-
builder: (
|
|
2160
|
+
builder: (yargs43) => yargs43.command(RulesCommand).command(McpCommand).demandCommand(),
|
|
2161
2161
|
handler: () => {
|
|
2162
2162
|
yargs3.showHelp();
|
|
2163
2163
|
}
|
|
2164
2164
|
};
|
|
2165
2165
|
|
|
2166
2166
|
// src/commands/canvas/index.ts
|
|
2167
|
-
import
|
|
2167
|
+
import yargs21 from "yargs";
|
|
2168
2168
|
|
|
2169
2169
|
// src/commands/canvas/commands/asset.ts
|
|
2170
2170
|
import yargs4 from "yargs";
|
|
@@ -2196,12 +2196,12 @@ function getFileClient(options) {
|
|
|
2196
2196
|
var AssetGetModule = {
|
|
2197
2197
|
command: "get <id>",
|
|
2198
2198
|
describe: "Get an asset",
|
|
2199
|
-
builder: (
|
|
2199
|
+
builder: (yargs43) => withConfiguration(
|
|
2200
2200
|
withDebugOptions(
|
|
2201
2201
|
withFormatOptions(
|
|
2202
2202
|
withApiOptions(
|
|
2203
2203
|
withProjectOptions(
|
|
2204
|
-
|
|
2204
|
+
yargs43.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
2205
2205
|
)
|
|
2206
2206
|
)
|
|
2207
2207
|
)
|
|
@@ -2222,7 +2222,7 @@ var AssetGetModule = {
|
|
|
2222
2222
|
var AssetListModule = {
|
|
2223
2223
|
command: "list",
|
|
2224
2224
|
describe: "List assets",
|
|
2225
|
-
builder: (
|
|
2225
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
2226
2226
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
2227
2227
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2228
2228
|
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -2612,6 +2612,15 @@ var compareCompositionsOrEntriesWithoutAssetUrls = (source, target) => {
|
|
|
2612
2612
|
removeUrlsFromAssetParameters(structuredClone(target.object))
|
|
2613
2613
|
);
|
|
2614
2614
|
};
|
|
2615
|
+
var PUBLISH_TIMESTAMP_TOLERANCE_MS = 2e3;
|
|
2616
|
+
var compareCompositionsOrEntriesWithoutAssetUrlsForPublishing = (source, target) => {
|
|
2617
|
+
const sourceModified = new Date(source.object.modified).getTime();
|
|
2618
|
+
const targetModified = new Date(target.object.modified).getTime();
|
|
2619
|
+
if (sourceModified - targetModified > PUBLISH_TIMESTAMP_TOLERANCE_MS) {
|
|
2620
|
+
return false;
|
|
2621
|
+
}
|
|
2622
|
+
return compareCompositionsOrEntriesWithoutAssetUrls(source, target);
|
|
2623
|
+
};
|
|
2615
2624
|
var removeUrlFromAsset = (asset) => {
|
|
2616
2625
|
if (asset.asset.fields?.url?.value) {
|
|
2617
2626
|
asset.asset.fields.url.value = "";
|
|
@@ -2775,8 +2784,8 @@ function prepCompositionForDisk(composition) {
|
|
|
2775
2784
|
delete prepped.state;
|
|
2776
2785
|
return prepped;
|
|
2777
2786
|
}
|
|
2778
|
-
function withStateOptions(
|
|
2779
|
-
return
|
|
2787
|
+
function withStateOptions(yargs43, defaultState = "preview") {
|
|
2788
|
+
return yargs43.option("state", {
|
|
2780
2789
|
type: "string",
|
|
2781
2790
|
describe: `State to fetch.`,
|
|
2782
2791
|
choices: ["preview", "published"],
|
|
@@ -2858,12 +2867,12 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
2858
2867
|
var AssetPullModule = {
|
|
2859
2868
|
command: "pull <directory>",
|
|
2860
2869
|
describe: "Pulls all assets to local files in a directory",
|
|
2861
|
-
builder: (
|
|
2870
|
+
builder: (yargs43) => withConfiguration(
|
|
2862
2871
|
withApiOptions(
|
|
2863
2872
|
withDebugOptions(
|
|
2864
2873
|
withProjectOptions(
|
|
2865
2874
|
withDiffOptions(
|
|
2866
|
-
|
|
2875
|
+
yargs43.positional("directory", {
|
|
2867
2876
|
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.",
|
|
2868
2877
|
type: "string"
|
|
2869
2878
|
}).option("format", {
|
|
@@ -2975,12 +2984,12 @@ var AssetPullModule = {
|
|
|
2975
2984
|
var AssetPushModule = {
|
|
2976
2985
|
command: "push <directory>",
|
|
2977
2986
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
2978
|
-
builder: (
|
|
2987
|
+
builder: (yargs43) => withConfiguration(
|
|
2979
2988
|
withApiOptions(
|
|
2980
2989
|
withDebugOptions(
|
|
2981
2990
|
withProjectOptions(
|
|
2982
2991
|
withDiffOptions(
|
|
2983
|
-
|
|
2992
|
+
yargs43.positional("directory", {
|
|
2984
2993
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
2985
2994
|
type: "string"
|
|
2986
2995
|
}).option("mode", {
|
|
@@ -3104,10 +3113,10 @@ var AssetRemoveModule = {
|
|
|
3104
3113
|
command: "remove <id>",
|
|
3105
3114
|
aliases: ["delete", "rm"],
|
|
3106
3115
|
describe: "Delete an asset",
|
|
3107
|
-
builder: (
|
|
3116
|
+
builder: (yargs43) => withConfiguration(
|
|
3108
3117
|
withDebugOptions(
|
|
3109
3118
|
withApiOptions(
|
|
3110
|
-
withProjectOptions(
|
|
3119
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
3111
3120
|
)
|
|
3112
3121
|
)
|
|
3113
3122
|
),
|
|
@@ -3128,11 +3137,11 @@ var AssetUpdateModule = {
|
|
|
3128
3137
|
command: "update <filename>",
|
|
3129
3138
|
aliases: ["put"],
|
|
3130
3139
|
describe: "Insert or update an asset",
|
|
3131
|
-
builder: (
|
|
3140
|
+
builder: (yargs43) => withConfiguration(
|
|
3132
3141
|
withDebugOptions(
|
|
3133
3142
|
withApiOptions(
|
|
3134
3143
|
withProjectOptions(
|
|
3135
|
-
|
|
3144
|
+
yargs43.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
3136
3145
|
)
|
|
3137
3146
|
)
|
|
3138
3147
|
)
|
|
@@ -3158,7 +3167,7 @@ var AssetUpdateModule = {
|
|
|
3158
3167
|
var AssetModule = {
|
|
3159
3168
|
command: "asset <command>",
|
|
3160
3169
|
describe: "Commands for Assets",
|
|
3161
|
-
builder: (
|
|
3170
|
+
builder: (yargs43) => yargs43.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
3162
3171
|
handler: () => {
|
|
3163
3172
|
yargs4.help();
|
|
3164
3173
|
}
|
|
@@ -3179,12 +3188,12 @@ function getCategoryClient(options) {
|
|
|
3179
3188
|
var CategoryGetModule = {
|
|
3180
3189
|
command: "get <id>",
|
|
3181
3190
|
describe: "Fetch a category",
|
|
3182
|
-
builder: (
|
|
3191
|
+
builder: (yargs43) => withConfiguration(
|
|
3183
3192
|
withFormatOptions(
|
|
3184
3193
|
withDebugOptions(
|
|
3185
3194
|
withApiOptions(
|
|
3186
3195
|
withProjectOptions(
|
|
3187
|
-
|
|
3196
|
+
yargs43.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
3188
3197
|
)
|
|
3189
3198
|
)
|
|
3190
3199
|
)
|
|
@@ -3209,8 +3218,8 @@ var CategoryListModule = {
|
|
|
3209
3218
|
command: "list",
|
|
3210
3219
|
describe: "List categories",
|
|
3211
3220
|
aliases: ["ls"],
|
|
3212
|
-
builder: (
|
|
3213
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
3221
|
+
builder: (yargs43) => withConfiguration(
|
|
3222
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs43.options({})))))
|
|
3214
3223
|
),
|
|
3215
3224
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3216
3225
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -3254,12 +3263,12 @@ function createCategoriesEngineDataSource({
|
|
|
3254
3263
|
var CategoryPullModule = {
|
|
3255
3264
|
command: "pull <directory>",
|
|
3256
3265
|
describe: "Pulls all categories to local files in a directory",
|
|
3257
|
-
builder: (
|
|
3266
|
+
builder: (yargs43) => withConfiguration(
|
|
3258
3267
|
withApiOptions(
|
|
3259
3268
|
withProjectOptions(
|
|
3260
3269
|
withDiffOptions(
|
|
3261
3270
|
withDebugOptions(
|
|
3262
|
-
|
|
3271
|
+
yargs43.positional("directory", {
|
|
3263
3272
|
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.",
|
|
3264
3273
|
type: "string"
|
|
3265
3274
|
}).option("format", {
|
|
@@ -3334,12 +3343,12 @@ var CategoryPullModule = {
|
|
|
3334
3343
|
var CategoryPushModule = {
|
|
3335
3344
|
command: "push <directory>",
|
|
3336
3345
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
3337
|
-
builder: (
|
|
3346
|
+
builder: (yargs43) => withConfiguration(
|
|
3338
3347
|
withApiOptions(
|
|
3339
3348
|
withDebugOptions(
|
|
3340
3349
|
withProjectOptions(
|
|
3341
3350
|
withDiffOptions(
|
|
3342
|
-
|
|
3351
|
+
yargs43.positional("directory", {
|
|
3343
3352
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
3344
3353
|
type: "string"
|
|
3345
3354
|
}).option("mode", {
|
|
@@ -3403,11 +3412,11 @@ var CategoryRemoveModule = {
|
|
|
3403
3412
|
command: "remove <id>",
|
|
3404
3413
|
aliases: ["delete", "rm"],
|
|
3405
3414
|
describe: "Delete a category",
|
|
3406
|
-
builder: (
|
|
3415
|
+
builder: (yargs43) => withConfiguration(
|
|
3407
3416
|
withApiOptions(
|
|
3408
3417
|
withDebugOptions(
|
|
3409
3418
|
withProjectOptions(
|
|
3410
|
-
|
|
3419
|
+
yargs43.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
3411
3420
|
)
|
|
3412
3421
|
)
|
|
3413
3422
|
)
|
|
@@ -3428,11 +3437,11 @@ var CategoryUpdateModule = {
|
|
|
3428
3437
|
command: "update <filename>",
|
|
3429
3438
|
aliases: ["put"],
|
|
3430
3439
|
describe: "Insert or update a category",
|
|
3431
|
-
builder: (
|
|
3440
|
+
builder: (yargs43) => withConfiguration(
|
|
3432
3441
|
withApiOptions(
|
|
3433
3442
|
withDebugOptions(
|
|
3434
3443
|
withProjectOptions(
|
|
3435
|
-
|
|
3444
|
+
yargs43.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
3436
3445
|
)
|
|
3437
3446
|
)
|
|
3438
3447
|
)
|
|
@@ -3454,7 +3463,7 @@ var CategoryModule = {
|
|
|
3454
3463
|
command: "category <command>",
|
|
3455
3464
|
aliases: ["cat"],
|
|
3456
3465
|
describe: "Commands for Canvas categories",
|
|
3457
|
-
builder: (
|
|
3466
|
+
builder: (yargs43) => yargs43.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
3458
3467
|
handler: () => {
|
|
3459
3468
|
yargs5.help();
|
|
3460
3469
|
}
|
|
@@ -3476,12 +3485,12 @@ function getCanvasClient(options) {
|
|
|
3476
3485
|
var ComponentGetModule = {
|
|
3477
3486
|
command: "get <id>",
|
|
3478
3487
|
describe: "Fetch a component definition",
|
|
3479
|
-
builder: (
|
|
3488
|
+
builder: (yargs43) => withConfiguration(
|
|
3480
3489
|
withFormatOptions(
|
|
3481
3490
|
withDebugOptions(
|
|
3482
3491
|
withApiOptions(
|
|
3483
3492
|
withProjectOptions(
|
|
3484
|
-
|
|
3493
|
+
yargs43.positional("id", {
|
|
3485
3494
|
demandOption: true,
|
|
3486
3495
|
describe: "Component definition public ID to fetch"
|
|
3487
3496
|
})
|
|
@@ -3515,12 +3524,12 @@ var ComponentListModule = {
|
|
|
3515
3524
|
command: "list",
|
|
3516
3525
|
describe: "List component definitions",
|
|
3517
3526
|
aliases: ["ls"],
|
|
3518
|
-
builder: (
|
|
3527
|
+
builder: (yargs43) => withConfiguration(
|
|
3519
3528
|
withFormatOptions(
|
|
3520
3529
|
withDebugOptions(
|
|
3521
3530
|
withApiOptions(
|
|
3522
3531
|
withProjectOptions(
|
|
3523
|
-
|
|
3532
|
+
yargs43.options({
|
|
3524
3533
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3525
3534
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
3526
3535
|
})
|
|
@@ -3589,12 +3598,12 @@ function createComponentDefinitionEngineDataSource({
|
|
|
3589
3598
|
var ComponentPullModule = {
|
|
3590
3599
|
command: "pull <directory>",
|
|
3591
3600
|
describe: "Pulls all component definitions to local files in a directory",
|
|
3592
|
-
builder: (
|
|
3601
|
+
builder: (yargs43) => withConfiguration(
|
|
3593
3602
|
withApiOptions(
|
|
3594
3603
|
withDebugOptions(
|
|
3595
3604
|
withProjectOptions(
|
|
3596
3605
|
withDiffOptions(
|
|
3597
|
-
|
|
3606
|
+
yargs43.positional("directory", {
|
|
3598
3607
|
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.",
|
|
3599
3608
|
type: "string"
|
|
3600
3609
|
}).option("format", {
|
|
@@ -3670,12 +3679,12 @@ var ComponentPullModule = {
|
|
|
3670
3679
|
var ComponentPushModule = {
|
|
3671
3680
|
command: "push <directory>",
|
|
3672
3681
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
3673
|
-
builder: (
|
|
3682
|
+
builder: (yargs43) => withConfiguration(
|
|
3674
3683
|
withApiOptions(
|
|
3675
3684
|
withDebugOptions(
|
|
3676
3685
|
withProjectOptions(
|
|
3677
3686
|
withDiffOptions(
|
|
3678
|
-
|
|
3687
|
+
yargs43.positional("directory", {
|
|
3679
3688
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
3680
3689
|
type: "string"
|
|
3681
3690
|
}).option("mode", {
|
|
@@ -3740,11 +3749,11 @@ var ComponentRemoveModule = {
|
|
|
3740
3749
|
command: "remove <id>",
|
|
3741
3750
|
aliases: ["delete", "rm"],
|
|
3742
3751
|
describe: "Delete a component definition",
|
|
3743
|
-
builder: (
|
|
3752
|
+
builder: (yargs43) => withConfiguration(
|
|
3744
3753
|
withDebugOptions(
|
|
3745
3754
|
withApiOptions(
|
|
3746
3755
|
withProjectOptions(
|
|
3747
|
-
|
|
3756
|
+
yargs43.positional("id", {
|
|
3748
3757
|
demandOption: true,
|
|
3749
3758
|
describe: "Component definition public ID to delete"
|
|
3750
3759
|
})
|
|
@@ -3768,11 +3777,11 @@ var ComponentUpdateModule = {
|
|
|
3768
3777
|
command: "update <filename>",
|
|
3769
3778
|
aliases: ["put"],
|
|
3770
3779
|
describe: "Insert or update a component definition",
|
|
3771
|
-
builder: (
|
|
3780
|
+
builder: (yargs43) => withConfiguration(
|
|
3772
3781
|
withApiOptions(
|
|
3773
3782
|
withDebugOptions(
|
|
3774
3783
|
withProjectOptions(
|
|
3775
|
-
|
|
3784
|
+
yargs43.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
3776
3785
|
)
|
|
3777
3786
|
)
|
|
3778
3787
|
)
|
|
@@ -3794,7 +3803,7 @@ var ComponentModule = {
|
|
|
3794
3803
|
command: "component <command>",
|
|
3795
3804
|
aliases: ["def"],
|
|
3796
3805
|
describe: "Commands for Canvas component definitions",
|
|
3797
|
-
builder: (
|
|
3806
|
+
builder: (yargs43) => yargs43.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
3798
3807
|
handler: () => {
|
|
3799
3808
|
yargs6.help();
|
|
3800
3809
|
}
|
|
@@ -3807,13 +3816,13 @@ import yargs7 from "yargs";
|
|
|
3807
3816
|
var CompositionGetModule = {
|
|
3808
3817
|
command: "get <id>",
|
|
3809
3818
|
describe: "Fetch a composition",
|
|
3810
|
-
builder: (
|
|
3819
|
+
builder: (yargs43) => withFormatOptions(
|
|
3811
3820
|
withConfiguration(
|
|
3812
3821
|
withApiOptions(
|
|
3813
3822
|
withProjectOptions(
|
|
3814
3823
|
withStateOptions(
|
|
3815
3824
|
withDebugOptions(
|
|
3816
|
-
|
|
3825
|
+
yargs43.positional("id", {
|
|
3817
3826
|
demandOption: true,
|
|
3818
3827
|
describe: "Composition/pattern public ID to fetch"
|
|
3819
3828
|
}).option({
|
|
@@ -3903,13 +3912,13 @@ var CompositionListModule = {
|
|
|
3903
3912
|
command: "list",
|
|
3904
3913
|
describe: "List compositions",
|
|
3905
3914
|
aliases: ["ls"],
|
|
3906
|
-
builder: (
|
|
3915
|
+
builder: (yargs43) => withFormatOptions(
|
|
3907
3916
|
withConfiguration(
|
|
3908
3917
|
withApiOptions(
|
|
3909
3918
|
withProjectOptions(
|
|
3910
3919
|
withDebugOptions(
|
|
3911
3920
|
withStateOptions(
|
|
3912
|
-
|
|
3921
|
+
yargs43.options({
|
|
3913
3922
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3914
3923
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3915
3924
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -3990,13 +3999,13 @@ var CompositionListModule = {
|
|
|
3990
3999
|
var ComponentPatternListModule = {
|
|
3991
4000
|
...CompositionListModule,
|
|
3992
4001
|
describe: "List component patterns",
|
|
3993
|
-
builder: (
|
|
4002
|
+
builder: (yargs43) => withFormatOptions(
|
|
3994
4003
|
withConfiguration(
|
|
3995
4004
|
withApiOptions(
|
|
3996
4005
|
withDebugOptions(
|
|
3997
4006
|
withProjectOptions(
|
|
3998
4007
|
withStateOptions(
|
|
3999
|
-
|
|
4008
|
+
yargs43.options({
|
|
4000
4009
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4001
4010
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4002
4011
|
resolvePatterns: {
|
|
@@ -4119,12 +4128,12 @@ function createComponentInstanceEngineDataSource({
|
|
|
4119
4128
|
var CompositionPublishModule = {
|
|
4120
4129
|
command: "publish [ids]",
|
|
4121
4130
|
describe: "Publishes composition(s)",
|
|
4122
|
-
builder: (
|
|
4131
|
+
builder: (yargs43) => withConfiguration(
|
|
4123
4132
|
withApiOptions(
|
|
4124
4133
|
withProjectOptions(
|
|
4125
4134
|
withDebugOptions(
|
|
4126
4135
|
withDiffOptions(
|
|
4127
|
-
|
|
4136
|
+
yargs43.positional("ids", {
|
|
4128
4137
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4129
4138
|
type: "string"
|
|
4130
4139
|
}).option("all", {
|
|
@@ -4201,7 +4210,7 @@ var CompositionPublishModule = {
|
|
|
4201
4210
|
fileClient
|
|
4202
4211
|
});
|
|
4203
4212
|
},
|
|
4204
|
-
compareContents:
|
|
4213
|
+
compareContents: compareCompositionsOrEntriesWithoutAssetUrlsForPublishing,
|
|
4205
4214
|
onBeforeWriteObject: async (sourceObject) => {
|
|
4206
4215
|
return uploadFilesForCompositionOrEntry({
|
|
4207
4216
|
entity: sourceObject,
|
|
@@ -4217,12 +4226,12 @@ var CompositionPublishModule = {
|
|
|
4217
4226
|
var ComponentPatternPublishModule = {
|
|
4218
4227
|
...CompositionPublishModule,
|
|
4219
4228
|
describe: "Publishes component pattern(s)",
|
|
4220
|
-
builder: (
|
|
4229
|
+
builder: (yargs43) => withConfiguration(
|
|
4221
4230
|
withApiOptions(
|
|
4222
4231
|
withDebugOptions(
|
|
4223
4232
|
withProjectOptions(
|
|
4224
4233
|
withDiffOptions(
|
|
4225
|
-
|
|
4234
|
+
yargs43.positional("ids", {
|
|
4226
4235
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4227
4236
|
type: "string"
|
|
4228
4237
|
}).option("all", {
|
|
@@ -4262,13 +4271,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4262
4271
|
return {
|
|
4263
4272
|
command: "pull <directory>",
|
|
4264
4273
|
describe: "Pulls all compositions to local files in a directory",
|
|
4265
|
-
builder: (
|
|
4274
|
+
builder: (yargs43) => withConfiguration(
|
|
4266
4275
|
withApiOptions(
|
|
4267
4276
|
withProjectOptions(
|
|
4268
4277
|
withStateOptions(
|
|
4269
4278
|
withDebugOptions(
|
|
4270
4279
|
withDiffOptions(
|
|
4271
|
-
|
|
4280
|
+
yargs43.positional("directory", {
|
|
4272
4281
|
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.",
|
|
4273
4282
|
type: "string"
|
|
4274
4283
|
}).option("format", {
|
|
@@ -4383,13 +4392,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4383
4392
|
var ComponentPatternPullModule = {
|
|
4384
4393
|
...componentInstancePullModuleFactory("componentPatterns"),
|
|
4385
4394
|
describe: "Pulls all component patterns to local files in a directory",
|
|
4386
|
-
builder: (
|
|
4395
|
+
builder: (yargs43) => withConfiguration(
|
|
4387
4396
|
withApiOptions(
|
|
4388
4397
|
withProjectOptions(
|
|
4389
4398
|
withDebugOptions(
|
|
4390
4399
|
withStateOptions(
|
|
4391
4400
|
withDiffOptions(
|
|
4392
|
-
|
|
4401
|
+
yargs43.positional("directory", {
|
|
4393
4402
|
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.",
|
|
4394
4403
|
type: "string"
|
|
4395
4404
|
}).option("format", {
|
|
@@ -4463,13 +4472,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4463
4472
|
return {
|
|
4464
4473
|
command: "push <directory>",
|
|
4465
4474
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
4466
|
-
builder: (
|
|
4475
|
+
builder: (yargs43) => withConfiguration(
|
|
4467
4476
|
withApiOptions(
|
|
4468
4477
|
withProjectOptions(
|
|
4469
4478
|
withStateOptions(
|
|
4470
4479
|
withDebugOptions(
|
|
4471
4480
|
withDiffOptions(
|
|
4472
|
-
|
|
4481
|
+
yargs43.positional("directory", {
|
|
4473
4482
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
4474
4483
|
type: "string"
|
|
4475
4484
|
}).option("mode", {
|
|
@@ -4583,13 +4592,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4583
4592
|
var ComponentPatternPushModule = {
|
|
4584
4593
|
...componentInstancePushModuleFactory("componentPatterns"),
|
|
4585
4594
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
4586
|
-
builder: (
|
|
4595
|
+
builder: (yargs43) => withConfiguration(
|
|
4587
4596
|
withApiOptions(
|
|
4588
4597
|
withProjectOptions(
|
|
4589
4598
|
withStateOptions(
|
|
4590
4599
|
withDiffOptions(
|
|
4591
4600
|
withDebugOptions(
|
|
4592
|
-
|
|
4601
|
+
yargs43.positional("directory", {
|
|
4593
4602
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
4594
4603
|
type: "string"
|
|
4595
4604
|
}).option("mode", {
|
|
@@ -4623,11 +4632,11 @@ var CompositionRemoveModule = {
|
|
|
4623
4632
|
command: "remove <id>",
|
|
4624
4633
|
aliases: ["delete", "rm"],
|
|
4625
4634
|
describe: "Delete a composition",
|
|
4626
|
-
builder: (
|
|
4635
|
+
builder: (yargs43) => withConfiguration(
|
|
4627
4636
|
withApiOptions(
|
|
4628
4637
|
withDebugOptions(
|
|
4629
4638
|
withProjectOptions(
|
|
4630
|
-
|
|
4639
|
+
yargs43.positional("id", {
|
|
4631
4640
|
demandOption: true,
|
|
4632
4641
|
describe: "Composition/pattern public ID to delete"
|
|
4633
4642
|
})
|
|
@@ -4656,29 +4665,32 @@ var ComponentPatternRemoveModule = {
|
|
|
4656
4665
|
};
|
|
4657
4666
|
|
|
4658
4667
|
// src/commands/canvas/commands/composition/unpublish.ts
|
|
4659
|
-
import {
|
|
4668
|
+
import {
|
|
4669
|
+
ApiClientError,
|
|
4670
|
+
CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE2
|
|
4671
|
+
} from "@uniformdev/canvas";
|
|
4660
4672
|
import { diffJson as diffJson2 } from "diff";
|
|
4661
4673
|
var CompositionUnpublishModule = {
|
|
4662
4674
|
command: "unpublish [ids]",
|
|
4663
4675
|
describe: "Unpublish a composition(s)",
|
|
4664
|
-
builder: (
|
|
4676
|
+
builder: (yargs43) => withConfiguration(
|
|
4665
4677
|
withApiOptions(
|
|
4666
4678
|
withDebugOptions(
|
|
4667
4679
|
withProjectOptions(
|
|
4668
|
-
|
|
4680
|
+
yargs43.positional("ids", {
|
|
4669
4681
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4670
4682
|
type: "string"
|
|
4671
4683
|
}).option("all", {
|
|
4672
4684
|
alias: ["a"],
|
|
4673
|
-
describe: "Un-publishes all compositions. Use
|
|
4685
|
+
describe: "Un-publishes all compositions. Use composition ID(s) to unpublish specific one(s) instead.",
|
|
4674
4686
|
default: false,
|
|
4675
4687
|
type: "boolean"
|
|
4676
4688
|
}).option("onlyCompositions", {
|
|
4677
|
-
describe: "Only publishing compositions and not patterns",
|
|
4689
|
+
describe: "Only un-publishing compositions and not patterns",
|
|
4678
4690
|
default: false,
|
|
4679
4691
|
type: "boolean"
|
|
4680
4692
|
}).option("onlyPatterns", {
|
|
4681
|
-
describe: "Only
|
|
4693
|
+
describe: "Only un-publishing patterns and not compositions",
|
|
4682
4694
|
default: false,
|
|
4683
4695
|
type: "boolean",
|
|
4684
4696
|
hidden: true
|
|
@@ -4701,7 +4713,7 @@ var CompositionUnpublishModule = {
|
|
|
4701
4713
|
verbose
|
|
4702
4714
|
}) => {
|
|
4703
4715
|
if (!all && !ids || all && ids) {
|
|
4704
|
-
console.error(`Specify --all or composition ID(s) to
|
|
4716
|
+
console.error(`Specify --all or composition ID(s) to unpublish.`);
|
|
4705
4717
|
process.exit(1);
|
|
4706
4718
|
}
|
|
4707
4719
|
const compositionIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
@@ -4726,7 +4738,6 @@ var CompositionUnpublishModule = {
|
|
|
4726
4738
|
patternType,
|
|
4727
4739
|
verbose
|
|
4728
4740
|
});
|
|
4729
|
-
const actions = [];
|
|
4730
4741
|
const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
4731
4742
|
for await (const obj of target.objects) {
|
|
4732
4743
|
if (Array.isArray(obj.id)) {
|
|
@@ -4735,16 +4746,30 @@ var CompositionUnpublishModule = {
|
|
|
4735
4746
|
targetItems.set(obj.id, obj);
|
|
4736
4747
|
}
|
|
4737
4748
|
}
|
|
4749
|
+
const toUnpublish = [];
|
|
4738
4750
|
for await (const sourceObject of source.objects) {
|
|
4751
|
+
toUnpublish.push(sourceObject);
|
|
4752
|
+
}
|
|
4753
|
+
const actions = [];
|
|
4754
|
+
for (const sourceObject of toUnpublish) {
|
|
4739
4755
|
const id = Array.isArray(sourceObject.id) ? sourceObject.id[0] : sourceObject.id;
|
|
4740
4756
|
const targetObject = targetItems.get(id);
|
|
4741
4757
|
if (!targetObject) {
|
|
4742
|
-
console.log(`Composition ${id}
|
|
4743
|
-
return;
|
|
4758
|
+
console.log(`Composition ${id} did not have a draft (removing published)`);
|
|
4744
4759
|
}
|
|
4745
|
-
console.log(`\u{1F41B} unpublishing composition: (id: ${id})`);
|
|
4746
4760
|
if (!whatIf) {
|
|
4747
|
-
actions.push(
|
|
4761
|
+
actions.push(
|
|
4762
|
+
client.removeComposition({ ...parseCompositionSerializedId(id), state: CANVAS_PUBLISHED_STATE2 }).catch((err) => {
|
|
4763
|
+
const isNotFound = err instanceof ApiClientError && err.statusCode === 404;
|
|
4764
|
+
if (isNotFound) {
|
|
4765
|
+
console.warn(
|
|
4766
|
+
`Composition ${id} was not found when unpublishing (may already be unpublished or orphaned); skipping.`
|
|
4767
|
+
);
|
|
4768
|
+
return;
|
|
4769
|
+
}
|
|
4770
|
+
throw err;
|
|
4771
|
+
})
|
|
4772
|
+
);
|
|
4748
4773
|
}
|
|
4749
4774
|
log2({
|
|
4750
4775
|
action: "update",
|
|
@@ -4752,9 +4777,10 @@ var CompositionUnpublishModule = {
|
|
|
4752
4777
|
providerId: sourceObject.providerId,
|
|
4753
4778
|
displayName: sourceObject.displayName ?? sourceObject.providerId,
|
|
4754
4779
|
whatIf,
|
|
4755
|
-
diff: () => diffJson2(targetObject.object, sourceObject.object)
|
|
4780
|
+
diff: () => targetObject ? diffJson2(targetObject.object, sourceObject.object) : []
|
|
4756
4781
|
});
|
|
4757
4782
|
}
|
|
4783
|
+
await Promise.all(actions);
|
|
4758
4784
|
}
|
|
4759
4785
|
};
|
|
4760
4786
|
|
|
@@ -4762,16 +4788,16 @@ var CompositionUnpublishModule = {
|
|
|
4762
4788
|
var ComponentPatternUnpublishModule = {
|
|
4763
4789
|
command: "unpublish [ids]",
|
|
4764
4790
|
describe: "Unpublish a component pattern(s)",
|
|
4765
|
-
builder: (
|
|
4791
|
+
builder: (yargs43) => withConfiguration(
|
|
4766
4792
|
withApiOptions(
|
|
4767
4793
|
withDebugOptions(
|
|
4768
4794
|
withProjectOptions(
|
|
4769
|
-
|
|
4795
|
+
yargs43.positional("ids", {
|
|
4770
4796
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4771
4797
|
type: "string"
|
|
4772
4798
|
}).option("all", {
|
|
4773
4799
|
alias: ["a"],
|
|
4774
|
-
describe: "Un-publishes all
|
|
4800
|
+
describe: "Un-publishes all component patterns. Use composition ID(s) to unpublish specific one(s) instead.",
|
|
4775
4801
|
default: false,
|
|
4776
4802
|
type: "boolean"
|
|
4777
4803
|
}).option("onlyCompositions", {
|
|
@@ -4800,12 +4826,12 @@ var CompositionUpdateModule = {
|
|
|
4800
4826
|
command: "update <filename>",
|
|
4801
4827
|
aliases: ["put"],
|
|
4802
4828
|
describe: "Insert or update a composition",
|
|
4803
|
-
builder: (
|
|
4829
|
+
builder: (yargs43) => withConfiguration(
|
|
4804
4830
|
withApiOptions(
|
|
4805
4831
|
withProjectOptions(
|
|
4806
4832
|
withDebugOptions(
|
|
4807
4833
|
withStateOptions(
|
|
4808
|
-
|
|
4834
|
+
yargs43.positional("filename", {
|
|
4809
4835
|
demandOption: true,
|
|
4810
4836
|
describe: "Composition/pattern file to put"
|
|
4811
4837
|
})
|
|
@@ -4843,7 +4869,7 @@ var ComponentPatternUpdateModule = {
|
|
|
4843
4869
|
var ComponentPatternModule = {
|
|
4844
4870
|
command: "component-pattern <command>",
|
|
4845
4871
|
describe: "Commands for Canvas component patterns",
|
|
4846
|
-
builder: (
|
|
4872
|
+
builder: (yargs43) => yargs43.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
4847
4873
|
handler: () => {
|
|
4848
4874
|
yargs7.help();
|
|
4849
4875
|
}
|
|
@@ -4855,7 +4881,7 @@ var CompositionModule = {
|
|
|
4855
4881
|
command: "composition <command>",
|
|
4856
4882
|
describe: "Commands for Canvas compositions",
|
|
4857
4883
|
aliases: ["comp"],
|
|
4858
|
-
builder: (
|
|
4884
|
+
builder: (yargs43) => yargs43.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
4859
4885
|
handler: () => {
|
|
4860
4886
|
yargs8.help();
|
|
4861
4887
|
}
|
|
@@ -4874,13 +4900,13 @@ var CompositionPatternGetModule = {
|
|
|
4874
4900
|
var CompositionPatternListModule = {
|
|
4875
4901
|
...CompositionListModule,
|
|
4876
4902
|
describe: "List composition patterns",
|
|
4877
|
-
builder: (
|
|
4903
|
+
builder: (yargs43) => withFormatOptions(
|
|
4878
4904
|
withConfiguration(
|
|
4879
4905
|
withApiOptions(
|
|
4880
4906
|
withDebugOptions(
|
|
4881
4907
|
withProjectOptions(
|
|
4882
4908
|
withStateOptions(
|
|
4883
|
-
|
|
4909
|
+
yargs43.options({
|
|
4884
4910
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4885
4911
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4886
4912
|
resolvePatterns: {
|
|
@@ -4924,12 +4950,12 @@ var CompositionPatternListModule = {
|
|
|
4924
4950
|
var CompositionPatternPublishModule = {
|
|
4925
4951
|
...CompositionPublishModule,
|
|
4926
4952
|
describe: "Publishes composition pattern(s)",
|
|
4927
|
-
builder: (
|
|
4953
|
+
builder: (yargs43) => withConfiguration(
|
|
4928
4954
|
withApiOptions(
|
|
4929
4955
|
withDebugOptions(
|
|
4930
4956
|
withProjectOptions(
|
|
4931
4957
|
withDiffOptions(
|
|
4932
|
-
|
|
4958
|
+
yargs43.positional("ids", {
|
|
4933
4959
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4934
4960
|
type: "string"
|
|
4935
4961
|
}).option("all", {
|
|
@@ -4968,13 +4994,13 @@ var CompositionPatternPublishModule = {
|
|
|
4968
4994
|
var CompositionPatternPullModule = {
|
|
4969
4995
|
...componentInstancePullModuleFactory("compositionPatterns"),
|
|
4970
4996
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
4971
|
-
builder: (
|
|
4997
|
+
builder: (yargs43) => withConfiguration(
|
|
4972
4998
|
withApiOptions(
|
|
4973
4999
|
withDebugOptions(
|
|
4974
5000
|
withProjectOptions(
|
|
4975
5001
|
withStateOptions(
|
|
4976
5002
|
withDiffOptions(
|
|
4977
|
-
|
|
5003
|
+
yargs43.positional("directory", {
|
|
4978
5004
|
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.",
|
|
4979
5005
|
type: "string"
|
|
4980
5006
|
}).option("format", {
|
|
@@ -5012,13 +5038,13 @@ var CompositionPatternPullModule = {
|
|
|
5012
5038
|
var CompositionPatternPushModule = {
|
|
5013
5039
|
...componentInstancePushModuleFactory("compositionPatterns"),
|
|
5014
5040
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
5015
|
-
builder: (
|
|
5041
|
+
builder: (yargs43) => withConfiguration(
|
|
5016
5042
|
withApiOptions(
|
|
5017
5043
|
withDebugOptions(
|
|
5018
5044
|
withProjectOptions(
|
|
5019
5045
|
withStateOptions(
|
|
5020
5046
|
withDiffOptions(
|
|
5021
|
-
|
|
5047
|
+
yargs43.positional("directory", {
|
|
5022
5048
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
5023
5049
|
type: "string"
|
|
5024
5050
|
}).option("mode", {
|
|
@@ -5057,16 +5083,16 @@ var CompositionPatternRemoveModule = {
|
|
|
5057
5083
|
var CompositionPatternUnpublishModule = {
|
|
5058
5084
|
command: "unpublish [ids]",
|
|
5059
5085
|
describe: "Unpublish a composition pattern(s)",
|
|
5060
|
-
builder: (
|
|
5086
|
+
builder: (yargs43) => withConfiguration(
|
|
5061
5087
|
withApiOptions(
|
|
5062
5088
|
withDebugOptions(
|
|
5063
5089
|
withProjectOptions(
|
|
5064
|
-
|
|
5090
|
+
yargs43.positional("ids", {
|
|
5065
5091
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5066
5092
|
type: "string"
|
|
5067
5093
|
}).option("all", {
|
|
5068
5094
|
alias: ["a"],
|
|
5069
|
-
describe: "Un-publishes all
|
|
5095
|
+
describe: "Un-publishes all composition patterns. Use composition ID(s) to unpublish specific one(s) instead.",
|
|
5070
5096
|
default: false,
|
|
5071
5097
|
type: "boolean"
|
|
5072
5098
|
}).option("onlyCompositions", {
|
|
@@ -5097,7 +5123,7 @@ var CompositionPatternUpdateModule = {
|
|
|
5097
5123
|
var CompositionPatternModule = {
|
|
5098
5124
|
command: "composition-pattern <command>",
|
|
5099
5125
|
describe: "Commands for Canvas composition patterns",
|
|
5100
|
-
builder: (
|
|
5126
|
+
builder: (yargs43) => yargs43.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
5101
5127
|
handler: () => {
|
|
5102
5128
|
yargs9.help();
|
|
5103
5129
|
}
|
|
@@ -5118,12 +5144,12 @@ function getContentClient(options) {
|
|
|
5118
5144
|
var ContentTypeGetModule = {
|
|
5119
5145
|
command: "get <id>",
|
|
5120
5146
|
describe: "Get a content type",
|
|
5121
|
-
builder: (
|
|
5147
|
+
builder: (yargs43) => withConfiguration(
|
|
5122
5148
|
withDebugOptions(
|
|
5123
5149
|
withFormatOptions(
|
|
5124
5150
|
withApiOptions(
|
|
5125
5151
|
withProjectOptions(
|
|
5126
|
-
|
|
5152
|
+
yargs43.positional("id", {
|
|
5127
5153
|
demandOption: true,
|
|
5128
5154
|
describe: "Content type public ID to fetch"
|
|
5129
5155
|
})
|
|
@@ -5148,7 +5174,7 @@ var ContentTypeGetModule = {
|
|
|
5148
5174
|
var ContentTypeListModule = {
|
|
5149
5175
|
command: "list",
|
|
5150
5176
|
describe: "List content types",
|
|
5151
|
-
builder: (
|
|
5177
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
5152
5178
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5153
5179
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5154
5180
|
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5189,12 +5215,12 @@ function createContentTypeEngineDataSource({
|
|
|
5189
5215
|
var ContentTypePullModule = {
|
|
5190
5216
|
command: "pull <directory>",
|
|
5191
5217
|
describe: "Pulls all content types to local files in a directory",
|
|
5192
|
-
builder: (
|
|
5218
|
+
builder: (yargs43) => withConfiguration(
|
|
5193
5219
|
withApiOptions(
|
|
5194
5220
|
withDebugOptions(
|
|
5195
5221
|
withProjectOptions(
|
|
5196
5222
|
withDiffOptions(
|
|
5197
|
-
|
|
5223
|
+
yargs43.positional("directory", {
|
|
5198
5224
|
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.",
|
|
5199
5225
|
type: "string"
|
|
5200
5226
|
}).option("format", {
|
|
@@ -5274,12 +5300,12 @@ var ContentTypePullModule = {
|
|
|
5274
5300
|
var ContentTypePushModule = {
|
|
5275
5301
|
command: "push <directory>",
|
|
5276
5302
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
5277
|
-
builder: (
|
|
5303
|
+
builder: (yargs43) => withConfiguration(
|
|
5278
5304
|
withApiOptions(
|
|
5279
5305
|
withDebugOptions(
|
|
5280
5306
|
withProjectOptions(
|
|
5281
5307
|
withDiffOptions(
|
|
5282
|
-
|
|
5308
|
+
yargs43.positional("directory", {
|
|
5283
5309
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
5284
5310
|
type: "string"
|
|
5285
5311
|
}).option("what-if", {
|
|
@@ -5353,11 +5379,11 @@ var ContentTypeRemoveModule = {
|
|
|
5353
5379
|
command: "remove <id>",
|
|
5354
5380
|
aliases: ["delete", "rm"],
|
|
5355
5381
|
describe: "Delete a content type",
|
|
5356
|
-
builder: (
|
|
5382
|
+
builder: (yargs43) => withConfiguration(
|
|
5357
5383
|
withDebugOptions(
|
|
5358
5384
|
withApiOptions(
|
|
5359
5385
|
withProjectOptions(
|
|
5360
|
-
|
|
5386
|
+
yargs43.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
5361
5387
|
)
|
|
5362
5388
|
)
|
|
5363
5389
|
)
|
|
@@ -5378,11 +5404,11 @@ var ContentTypeUpdateModule = {
|
|
|
5378
5404
|
command: "update <filename>",
|
|
5379
5405
|
aliases: ["put"],
|
|
5380
5406
|
describe: "Insert or update a content type",
|
|
5381
|
-
builder: (
|
|
5407
|
+
builder: (yargs43) => withConfiguration(
|
|
5382
5408
|
withDebugOptions(
|
|
5383
5409
|
withApiOptions(
|
|
5384
5410
|
withProjectOptions(
|
|
5385
|
-
|
|
5411
|
+
yargs43.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
5386
5412
|
)
|
|
5387
5413
|
)
|
|
5388
5414
|
)
|
|
@@ -5404,7 +5430,7 @@ var ContentTypeModule = {
|
|
|
5404
5430
|
command: "contenttype <command>",
|
|
5405
5431
|
aliases: ["ct"],
|
|
5406
5432
|
describe: "Commands for Content Types",
|
|
5407
|
-
builder: (
|
|
5433
|
+
builder: (yargs43) => yargs43.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
5408
5434
|
handler: () => {
|
|
5409
5435
|
yargs10.help();
|
|
5410
5436
|
}
|
|
@@ -5423,11 +5449,11 @@ function getDataSourceClient(options) {
|
|
|
5423
5449
|
var DataSourceGetModule = {
|
|
5424
5450
|
command: "get <id>",
|
|
5425
5451
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
5426
|
-
builder: (
|
|
5452
|
+
builder: (yargs43) => withConfiguration(
|
|
5427
5453
|
withApiOptions(
|
|
5428
5454
|
withDebugOptions(
|
|
5429
5455
|
withProjectOptions(
|
|
5430
|
-
|
|
5456
|
+
yargs43.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
5431
5457
|
)
|
|
5432
5458
|
)
|
|
5433
5459
|
)
|
|
@@ -5445,11 +5471,11 @@ var DataSourceRemoveModule = {
|
|
|
5445
5471
|
command: "remove <id>",
|
|
5446
5472
|
aliases: ["delete", "rm"],
|
|
5447
5473
|
describe: "Delete a data source",
|
|
5448
|
-
builder: (
|
|
5474
|
+
builder: (yargs43) => withConfiguration(
|
|
5449
5475
|
withDebugOptions(
|
|
5450
5476
|
withApiOptions(
|
|
5451
5477
|
withProjectOptions(
|
|
5452
|
-
|
|
5478
|
+
yargs43.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
5453
5479
|
)
|
|
5454
5480
|
)
|
|
5455
5481
|
)
|
|
@@ -5470,11 +5496,11 @@ var DataSourceUpdateModule = {
|
|
|
5470
5496
|
command: "update <dataSource>",
|
|
5471
5497
|
aliases: ["put"],
|
|
5472
5498
|
describe: "Insert or update a data source",
|
|
5473
|
-
builder: (
|
|
5499
|
+
builder: (yargs43) => withConfiguration(
|
|
5474
5500
|
withApiOptions(
|
|
5475
5501
|
withDebugOptions(
|
|
5476
5502
|
withProjectOptions(
|
|
5477
|
-
|
|
5503
|
+
yargs43.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
5478
5504
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
5479
5505
|
type: "string",
|
|
5480
5506
|
demandOption: true
|
|
@@ -5509,7 +5535,7 @@ var DataSourceModule = {
|
|
|
5509
5535
|
command: "datasource <command>",
|
|
5510
5536
|
aliases: ["ds"],
|
|
5511
5537
|
describe: "Commands for Data Source definitions",
|
|
5512
|
-
builder: (
|
|
5538
|
+
builder: (yargs43) => yargs43.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
5513
5539
|
handler: () => {
|
|
5514
5540
|
yargs11.help();
|
|
5515
5541
|
}
|
|
@@ -5531,12 +5557,12 @@ var DataTypeGetModule = {
|
|
|
5531
5557
|
command: "get <id>",
|
|
5532
5558
|
describe: "Get a data type",
|
|
5533
5559
|
aliases: ["ls"],
|
|
5534
|
-
builder: (
|
|
5560
|
+
builder: (yargs43) => withConfiguration(
|
|
5535
5561
|
withFormatOptions(
|
|
5536
5562
|
withDebugOptions(
|
|
5537
5563
|
withApiOptions(
|
|
5538
5564
|
withProjectOptions(
|
|
5539
|
-
|
|
5565
|
+
yargs43.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
5540
5566
|
)
|
|
5541
5567
|
)
|
|
5542
5568
|
)
|
|
@@ -5559,7 +5585,7 @@ var DataTypeListModule = {
|
|
|
5559
5585
|
command: "list",
|
|
5560
5586
|
describe: "List data types",
|
|
5561
5587
|
aliases: ["ls"],
|
|
5562
|
-
builder: (
|
|
5588
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
5563
5589
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5564
5590
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5565
5591
|
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5602,12 +5628,12 @@ function createDataTypeEngineDataSource({
|
|
|
5602
5628
|
var DataTypePullModule = {
|
|
5603
5629
|
command: "pull <directory>",
|
|
5604
5630
|
describe: "Pulls all data types to local files in a directory",
|
|
5605
|
-
builder: (
|
|
5631
|
+
builder: (yargs43) => withConfiguration(
|
|
5606
5632
|
withApiOptions(
|
|
5607
5633
|
withDebugOptions(
|
|
5608
5634
|
withProjectOptions(
|
|
5609
5635
|
withDiffOptions(
|
|
5610
|
-
|
|
5636
|
+
yargs43.positional("directory", {
|
|
5611
5637
|
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.",
|
|
5612
5638
|
type: "string"
|
|
5613
5639
|
}).option("format", {
|
|
@@ -5687,12 +5713,12 @@ var DataTypePullModule = {
|
|
|
5687
5713
|
var DataTypePushModule = {
|
|
5688
5714
|
command: "push <directory>",
|
|
5689
5715
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
5690
|
-
builder: (
|
|
5716
|
+
builder: (yargs43) => withConfiguration(
|
|
5691
5717
|
withApiOptions(
|
|
5692
5718
|
withDebugOptions(
|
|
5693
5719
|
withProjectOptions(
|
|
5694
5720
|
withDiffOptions(
|
|
5695
|
-
|
|
5721
|
+
yargs43.positional("directory", {
|
|
5696
5722
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
5697
5723
|
type: "string"
|
|
5698
5724
|
}).option("mode", {
|
|
@@ -5761,11 +5787,11 @@ var DataTypeRemoveModule = {
|
|
|
5761
5787
|
command: "remove <id>",
|
|
5762
5788
|
aliases: ["delete", "rm"],
|
|
5763
5789
|
describe: "Delete a data type",
|
|
5764
|
-
builder: (
|
|
5790
|
+
builder: (yargs43) => withConfiguration(
|
|
5765
5791
|
withDebugOptions(
|
|
5766
5792
|
withApiOptions(
|
|
5767
5793
|
withProjectOptions(
|
|
5768
|
-
|
|
5794
|
+
yargs43.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
5769
5795
|
)
|
|
5770
5796
|
)
|
|
5771
5797
|
)
|
|
@@ -5786,11 +5812,11 @@ var DataTypeUpdateModule = {
|
|
|
5786
5812
|
command: "update <filename>",
|
|
5787
5813
|
aliases: ["put"],
|
|
5788
5814
|
describe: "Insert or update a data type",
|
|
5789
|
-
builder: (
|
|
5815
|
+
builder: (yargs43) => withConfiguration(
|
|
5790
5816
|
withDebugOptions(
|
|
5791
5817
|
withApiOptions(
|
|
5792
5818
|
withProjectOptions(
|
|
5793
|
-
|
|
5819
|
+
yargs43.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
5794
5820
|
)
|
|
5795
5821
|
)
|
|
5796
5822
|
)
|
|
@@ -5812,7 +5838,7 @@ var DataTypeModule = {
|
|
|
5812
5838
|
command: "datatype <command>",
|
|
5813
5839
|
aliases: ["dt"],
|
|
5814
5840
|
describe: "Commands for Data Type definitions",
|
|
5815
|
-
builder: (
|
|
5841
|
+
builder: (yargs43) => yargs43.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
5816
5842
|
handler: () => {
|
|
5817
5843
|
yargs12.help();
|
|
5818
5844
|
}
|
|
@@ -5825,13 +5851,13 @@ import yargs13 from "yargs";
|
|
|
5825
5851
|
var EntryGetModule = {
|
|
5826
5852
|
command: "get <id>",
|
|
5827
5853
|
describe: "Get an entry",
|
|
5828
|
-
builder: (
|
|
5854
|
+
builder: (yargs43) => withConfiguration(
|
|
5829
5855
|
withDebugOptions(
|
|
5830
5856
|
withFormatOptions(
|
|
5831
5857
|
withApiOptions(
|
|
5832
5858
|
withProjectOptions(
|
|
5833
5859
|
withStateOptions(
|
|
5834
|
-
|
|
5860
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
5835
5861
|
resolveData: {
|
|
5836
5862
|
type: "boolean",
|
|
5837
5863
|
default: false,
|
|
@@ -5903,13 +5929,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
5903
5929
|
var EntryListModule = {
|
|
5904
5930
|
command: "list",
|
|
5905
5931
|
describe: "List entries",
|
|
5906
|
-
builder: (
|
|
5932
|
+
builder: (yargs43) => withConfiguration(
|
|
5907
5933
|
withDebugOptions(
|
|
5908
5934
|
withFormatOptions(
|
|
5909
5935
|
withApiOptions(
|
|
5910
5936
|
withProjectOptions(
|
|
5911
5937
|
withStateOptions(
|
|
5912
|
-
|
|
5938
|
+
yargs43.options({
|
|
5913
5939
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
5914
5940
|
limit: {
|
|
5915
5941
|
describe: "Number of rows to fetch",
|
|
@@ -5964,7 +5990,7 @@ var EntryListModule = {
|
|
|
5964
5990
|
};
|
|
5965
5991
|
|
|
5966
5992
|
// src/commands/canvas/entryEngineDataSource.ts
|
|
5967
|
-
import { ApiClientError, convertEntryToPutEntry } from "@uniformdev/canvas";
|
|
5993
|
+
import { ApiClientError as ApiClientError2, convertEntryToPutEntry } from "@uniformdev/canvas";
|
|
5968
5994
|
|
|
5969
5995
|
// src/commands/canvas/commands/entry/_util.ts
|
|
5970
5996
|
var selectEntryIdentifier = (e) => {
|
|
@@ -6010,7 +6036,7 @@ function createEntryEngineDataSource({
|
|
|
6010
6036
|
editions: "all"
|
|
6011
6037
|
})).entries;
|
|
6012
6038
|
} catch (error) {
|
|
6013
|
-
if (error instanceof
|
|
6039
|
+
if (error instanceof ApiClientError2 && error.errorMessage === "Entry not found or not published") {
|
|
6014
6040
|
return [];
|
|
6015
6041
|
}
|
|
6016
6042
|
throw error;
|
|
@@ -6044,12 +6070,12 @@ function createEntryEngineDataSource({
|
|
|
6044
6070
|
var EntryPublishModule = {
|
|
6045
6071
|
command: "publish [ids]",
|
|
6046
6072
|
describe: "Publishes entry(ies)",
|
|
6047
|
-
builder: (
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6073
|
+
builder: (yargs43) => withConfiguration(
|
|
6074
|
+
withDebugOptions(
|
|
6075
|
+
withDiffOptions(
|
|
6076
|
+
withApiOptions(
|
|
6077
|
+
withProjectOptions(
|
|
6078
|
+
yargs43.positional("ids", {
|
|
6053
6079
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6054
6080
|
type: "string"
|
|
6055
6081
|
}).option("all", {
|
|
@@ -6108,7 +6134,7 @@ var EntryPublishModule = {
|
|
|
6108
6134
|
fileClient
|
|
6109
6135
|
});
|
|
6110
6136
|
},
|
|
6111
|
-
compareContents:
|
|
6137
|
+
compareContents: compareCompositionsOrEntriesWithoutAssetUrlsForPublishing,
|
|
6112
6138
|
onBeforeWriteObject: async (sourceObject) => {
|
|
6113
6139
|
return uploadFilesForCompositionOrEntry({
|
|
6114
6140
|
entity: sourceObject,
|
|
@@ -6124,13 +6150,13 @@ var EntryPublishModule = {
|
|
|
6124
6150
|
var EntryPullModule = {
|
|
6125
6151
|
command: "pull <directory>",
|
|
6126
6152
|
describe: "Pulls all entries to local files in a directory",
|
|
6127
|
-
builder: (
|
|
6153
|
+
builder: (yargs43) => withConfiguration(
|
|
6128
6154
|
withDebugOptions(
|
|
6129
6155
|
withApiOptions(
|
|
6130
6156
|
withProjectOptions(
|
|
6131
6157
|
withStateOptions(
|
|
6132
6158
|
withDiffOptions(
|
|
6133
|
-
|
|
6159
|
+
yargs43.positional("directory", {
|
|
6134
6160
|
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.",
|
|
6135
6161
|
type: "string"
|
|
6136
6162
|
}).option("format", {
|
|
@@ -6230,13 +6256,13 @@ var EntryPullModule = {
|
|
|
6230
6256
|
var EntryPushModule = {
|
|
6231
6257
|
command: "push <directory>",
|
|
6232
6258
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
6233
|
-
builder: (
|
|
6259
|
+
builder: (yargs43) => withConfiguration(
|
|
6234
6260
|
withDebugOptions(
|
|
6235
6261
|
withApiOptions(
|
|
6236
6262
|
withProjectOptions(
|
|
6237
6263
|
withStateOptions(
|
|
6238
6264
|
withDiffOptions(
|
|
6239
|
-
|
|
6265
|
+
yargs43.positional("directory", {
|
|
6240
6266
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
6241
6267
|
type: "string"
|
|
6242
6268
|
}).option("mode", {
|
|
@@ -6335,11 +6361,11 @@ var EntryRemoveModule = {
|
|
|
6335
6361
|
command: "remove <id>",
|
|
6336
6362
|
aliases: ["delete", "rm"],
|
|
6337
6363
|
describe: "Delete an entry",
|
|
6338
|
-
builder: (
|
|
6364
|
+
builder: (yargs43) => withConfiguration(
|
|
6339
6365
|
withDebugOptions(
|
|
6340
6366
|
withApiOptions(
|
|
6341
6367
|
withProjectOptions(
|
|
6342
|
-
|
|
6368
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
6343
6369
|
)
|
|
6344
6370
|
)
|
|
6345
6371
|
)
|
|
@@ -6356,16 +6382,16 @@ var EntryRemoveModule = {
|
|
|
6356
6382
|
};
|
|
6357
6383
|
|
|
6358
6384
|
// src/commands/canvas/commands/entry/unpublish.ts
|
|
6359
|
-
import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3 } from "@uniformdev/canvas";
|
|
6385
|
+
import { ApiClientError as ApiClientError3, CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE3 } from "@uniformdev/canvas";
|
|
6360
6386
|
import { diffJson as diffJson3 } from "diff";
|
|
6361
6387
|
var EntryUnpublishModule = {
|
|
6362
6388
|
command: "unpublish [ids]",
|
|
6363
6389
|
describe: "Unpublish an entry(ies)",
|
|
6364
|
-
builder: (
|
|
6390
|
+
builder: (yargs43) => withConfiguration(
|
|
6365
6391
|
withDebugOptions(
|
|
6366
6392
|
withApiOptions(
|
|
6367
6393
|
withProjectOptions(
|
|
6368
|
-
|
|
6394
|
+
yargs43.positional("ids", {
|
|
6369
6395
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6370
6396
|
type: "string"
|
|
6371
6397
|
}).option("all", {
|
|
@@ -6380,7 +6406,7 @@ var EntryUnpublishModule = {
|
|
|
6380
6406
|
),
|
|
6381
6407
|
handler: async ({ apiHost, apiKey, proxy, ids, all, project: projectId, whatIf, verbose }) => {
|
|
6382
6408
|
if (!all && !ids || all && ids) {
|
|
6383
|
-
console.error(`Specify --all or entry ID(s) to
|
|
6409
|
+
console.error(`Specify --all or entry ID(s) to unpublish.`);
|
|
6384
6410
|
process.exit(1);
|
|
6385
6411
|
}
|
|
6386
6412
|
const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
@@ -6399,7 +6425,6 @@ var EntryUnpublishModule = {
|
|
|
6399
6425
|
entryIDs: entryIDsArray,
|
|
6400
6426
|
onlyEntries: true
|
|
6401
6427
|
});
|
|
6402
|
-
const actions = [];
|
|
6403
6428
|
const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
6404
6429
|
for await (const obj of target.objects) {
|
|
6405
6430
|
if (Array.isArray(obj.id)) {
|
|
@@ -6408,15 +6433,30 @@ var EntryUnpublishModule = {
|
|
|
6408
6433
|
targetItems.set(obj.id, obj);
|
|
6409
6434
|
}
|
|
6410
6435
|
}
|
|
6436
|
+
const toUnpublish = [];
|
|
6411
6437
|
for await (const sourceObject of source.objects) {
|
|
6438
|
+
toUnpublish.push(sourceObject);
|
|
6439
|
+
}
|
|
6440
|
+
const actions = [];
|
|
6441
|
+
for (const sourceObject of toUnpublish) {
|
|
6412
6442
|
const id = Array.isArray(sourceObject.id) ? sourceObject.id[0] : sourceObject.id;
|
|
6413
6443
|
const targetObject = targetItems.get(id);
|
|
6414
6444
|
if (!targetObject) {
|
|
6415
|
-
console.log(`Entry ${id}
|
|
6416
|
-
return;
|
|
6445
|
+
console.log(`Entry ${id} did not have a draft (removing published)`);
|
|
6417
6446
|
}
|
|
6418
6447
|
if (!whatIf) {
|
|
6419
|
-
actions.push(
|
|
6448
|
+
actions.push(
|
|
6449
|
+
client.deleteEntry({ ...parseEntrySerializedId(id), state: CANVAS_PUBLISHED_STATE3 }).catch((err) => {
|
|
6450
|
+
const isNotFound = err instanceof ApiClientError3 && err.statusCode === 404;
|
|
6451
|
+
if (isNotFound) {
|
|
6452
|
+
console.warn(
|
|
6453
|
+
`Entry ${id} was not found when unpublishing (may already be unpublished or orphaned); skipping.`
|
|
6454
|
+
);
|
|
6455
|
+
return;
|
|
6456
|
+
}
|
|
6457
|
+
throw err;
|
|
6458
|
+
})
|
|
6459
|
+
);
|
|
6420
6460
|
}
|
|
6421
6461
|
log2({
|
|
6422
6462
|
action: "update",
|
|
@@ -6424,9 +6464,10 @@ var EntryUnpublishModule = {
|
|
|
6424
6464
|
providerId: sourceObject.providerId,
|
|
6425
6465
|
displayName: sourceObject.displayName ?? sourceObject.providerId,
|
|
6426
6466
|
whatIf,
|
|
6427
|
-
diff: () => diffJson3(targetObject.object, sourceObject.object)
|
|
6467
|
+
diff: () => targetObject ? diffJson3(targetObject.object, sourceObject.object) : []
|
|
6428
6468
|
});
|
|
6429
6469
|
}
|
|
6470
|
+
await Promise.all(actions);
|
|
6430
6471
|
}
|
|
6431
6472
|
};
|
|
6432
6473
|
|
|
@@ -6435,12 +6476,12 @@ var EntryUpdateModule = {
|
|
|
6435
6476
|
command: "update <filename>",
|
|
6436
6477
|
aliases: ["put"],
|
|
6437
6478
|
describe: "Insert or update an entry",
|
|
6438
|
-
builder: (
|
|
6479
|
+
builder: (yargs43) => withConfiguration(
|
|
6439
6480
|
withDebugOptions(
|
|
6440
6481
|
withApiOptions(
|
|
6441
6482
|
withProjectOptions(
|
|
6442
6483
|
withStateOptions(
|
|
6443
|
-
|
|
6484
|
+
yargs43.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
6444
6485
|
)
|
|
6445
6486
|
)
|
|
6446
6487
|
)
|
|
@@ -6472,7 +6513,7 @@ var EntryUpdateModule = {
|
|
|
6472
6513
|
var EntryModule = {
|
|
6473
6514
|
command: "entry <command>",
|
|
6474
6515
|
describe: "Commands for Entries",
|
|
6475
|
-
builder: (
|
|
6516
|
+
builder: (yargs43) => yargs43.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
6476
6517
|
handler: () => {
|
|
6477
6518
|
yargs13.help();
|
|
6478
6519
|
}
|
|
@@ -6485,13 +6526,13 @@ import yargs14 from "yargs";
|
|
|
6485
6526
|
var EntryPatternGetModule = {
|
|
6486
6527
|
command: "get <id>",
|
|
6487
6528
|
describe: "Get an entry pattern",
|
|
6488
|
-
builder: (
|
|
6529
|
+
builder: (yargs43) => withConfiguration(
|
|
6489
6530
|
withDebugOptions(
|
|
6490
6531
|
withFormatOptions(
|
|
6491
6532
|
withApiOptions(
|
|
6492
6533
|
withProjectOptions(
|
|
6493
6534
|
withStateOptions(
|
|
6494
|
-
|
|
6535
|
+
yargs43.positional("id", {
|
|
6495
6536
|
demandOption: true,
|
|
6496
6537
|
describe: "Entry pattern public ID to fetch"
|
|
6497
6538
|
}).option({
|
|
@@ -6544,13 +6585,13 @@ var EntryPatternGetModule = {
|
|
|
6544
6585
|
var EntryPatternListModule = {
|
|
6545
6586
|
command: "list",
|
|
6546
6587
|
describe: "List entry patterns",
|
|
6547
|
-
builder: (
|
|
6588
|
+
builder: (yargs43) => withConfiguration(
|
|
6548
6589
|
withDebugOptions(
|
|
6549
6590
|
withFormatOptions(
|
|
6550
6591
|
withApiOptions(
|
|
6551
6592
|
withProjectOptions(
|
|
6552
6593
|
withStateOptions(
|
|
6553
|
-
|
|
6594
|
+
yargs43.option({
|
|
6554
6595
|
withComponentIDs: {
|
|
6555
6596
|
type: "boolean",
|
|
6556
6597
|
default: false,
|
|
@@ -6596,12 +6637,12 @@ var EntryPatternListModule = {
|
|
|
6596
6637
|
var EntryPatternPublishModule = {
|
|
6597
6638
|
command: "publish [ids]",
|
|
6598
6639
|
describe: "Publishes entry pattern(s)",
|
|
6599
|
-
builder: (
|
|
6640
|
+
builder: (yargs43) => withConfiguration(
|
|
6600
6641
|
withDebugOptions(
|
|
6601
6642
|
withApiOptions(
|
|
6602
6643
|
withProjectOptions(
|
|
6603
6644
|
withDiffOptions(
|
|
6604
|
-
|
|
6645
|
+
yargs43.positional("ids", {
|
|
6605
6646
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6606
6647
|
type: "string"
|
|
6607
6648
|
}).option("all", {
|
|
@@ -6660,7 +6701,7 @@ var EntryPatternPublishModule = {
|
|
|
6660
6701
|
fileClient
|
|
6661
6702
|
});
|
|
6662
6703
|
},
|
|
6663
|
-
compareContents:
|
|
6704
|
+
compareContents: compareCompositionsOrEntriesWithoutAssetUrlsForPublishing,
|
|
6664
6705
|
onBeforeWriteObject: async (sourceObject) => {
|
|
6665
6706
|
return uploadFilesForCompositionOrEntry({
|
|
6666
6707
|
entity: sourceObject,
|
|
@@ -6676,13 +6717,13 @@ var EntryPatternPublishModule = {
|
|
|
6676
6717
|
var EntryPatternPullModule = {
|
|
6677
6718
|
command: "pull <directory>",
|
|
6678
6719
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
6679
|
-
builder: (
|
|
6720
|
+
builder: (yargs43) => withConfiguration(
|
|
6680
6721
|
withApiOptions(
|
|
6681
6722
|
withDebugOptions(
|
|
6682
6723
|
withProjectOptions(
|
|
6683
6724
|
withStateOptions(
|
|
6684
6725
|
withDiffOptions(
|
|
6685
|
-
|
|
6726
|
+
yargs43.positional("directory", {
|
|
6686
6727
|
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.",
|
|
6687
6728
|
type: "string"
|
|
6688
6729
|
}).option("format", {
|
|
@@ -6782,13 +6823,13 @@ var EntryPatternPullModule = {
|
|
|
6782
6823
|
var EntryPatternPushModule = {
|
|
6783
6824
|
command: "push <directory>",
|
|
6784
6825
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
6785
|
-
builder: (
|
|
6826
|
+
builder: (yargs43) => withConfiguration(
|
|
6786
6827
|
withDebugOptions(
|
|
6787
6828
|
withApiOptions(
|
|
6788
6829
|
withProjectOptions(
|
|
6789
6830
|
withStateOptions(
|
|
6790
6831
|
withDiffOptions(
|
|
6791
|
-
|
|
6832
|
+
yargs43.positional("directory", {
|
|
6792
6833
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
6793
6834
|
type: "string"
|
|
6794
6835
|
}).option("what-if", {
|
|
@@ -6892,11 +6933,11 @@ var EntryPatternRemoveModule = {
|
|
|
6892
6933
|
command: "remove <id>",
|
|
6893
6934
|
aliases: ["delete", "rm"],
|
|
6894
6935
|
describe: "Delete an entry pattern",
|
|
6895
|
-
builder: (
|
|
6936
|
+
builder: (yargs43) => withConfiguration(
|
|
6896
6937
|
withDebugOptions(
|
|
6897
6938
|
withApiOptions(
|
|
6898
6939
|
withProjectOptions(
|
|
6899
|
-
|
|
6940
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
6900
6941
|
)
|
|
6901
6942
|
)
|
|
6902
6943
|
)
|
|
@@ -6913,16 +6954,16 @@ var EntryPatternRemoveModule = {
|
|
|
6913
6954
|
};
|
|
6914
6955
|
|
|
6915
6956
|
// src/commands/canvas/commands/entryPattern/unpublish.ts
|
|
6916
|
-
import { CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE4 } from "@uniformdev/canvas";
|
|
6957
|
+
import { ApiClientError as ApiClientError4, CANVAS_PUBLISHED_STATE as CANVAS_PUBLISHED_STATE4 } from "@uniformdev/canvas";
|
|
6917
6958
|
import { diffJson as diffJson4 } from "diff";
|
|
6918
6959
|
var EntryPatternUnpublishModule = {
|
|
6919
6960
|
command: "unpublish [ids]",
|
|
6920
|
-
describe: "Unpublish
|
|
6921
|
-
builder: (
|
|
6961
|
+
describe: "Unpublish entry pattern(s)",
|
|
6962
|
+
builder: (yargs43) => withConfiguration(
|
|
6922
6963
|
withDebugOptions(
|
|
6923
6964
|
withApiOptions(
|
|
6924
6965
|
withProjectOptions(
|
|
6925
|
-
|
|
6966
|
+
yargs43.positional("ids", {
|
|
6926
6967
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6927
6968
|
type: "string"
|
|
6928
6969
|
}).option("all", {
|
|
@@ -6937,7 +6978,7 @@ var EntryPatternUnpublishModule = {
|
|
|
6937
6978
|
),
|
|
6938
6979
|
handler: async ({ apiHost, apiKey, proxy, ids, all, project: projectId, whatIf, verbose }) => {
|
|
6939
6980
|
if (!all && !ids || all && ids) {
|
|
6940
|
-
console.error(`Specify --all or entry pattern ID(s) to
|
|
6981
|
+
console.error(`Specify --all or entry pattern ID(s) to unpublish.`);
|
|
6941
6982
|
process.exit(1);
|
|
6942
6983
|
}
|
|
6943
6984
|
const entryIDsArray = ids ? ids.split(",").map((id) => id.trim()) : void 0;
|
|
@@ -6956,7 +6997,6 @@ var EntryPatternUnpublishModule = {
|
|
|
6956
6997
|
entryIDs: entryIDsArray,
|
|
6957
6998
|
onlyPatterns: true
|
|
6958
6999
|
});
|
|
6959
|
-
const actions = [];
|
|
6960
7000
|
const log2 = createPublishStatusSyncEngineConsoleLogger({ status: "unpublish" });
|
|
6961
7001
|
for await (const obj of target.objects) {
|
|
6962
7002
|
if (Array.isArray(obj.id)) {
|
|
@@ -6965,15 +7005,30 @@ var EntryPatternUnpublishModule = {
|
|
|
6965
7005
|
targetItems.set(obj.id, obj);
|
|
6966
7006
|
}
|
|
6967
7007
|
}
|
|
7008
|
+
const toUnpublish = [];
|
|
6968
7009
|
for await (const sourceObject of source.objects) {
|
|
7010
|
+
toUnpublish.push(sourceObject);
|
|
7011
|
+
}
|
|
7012
|
+
const actions = [];
|
|
7013
|
+
for (const sourceObject of toUnpublish) {
|
|
6969
7014
|
const id = Array.isArray(sourceObject.id) ? sourceObject.id[0] : sourceObject.id;
|
|
6970
7015
|
const targetObject = targetItems.get(id);
|
|
6971
7016
|
if (!targetObject) {
|
|
6972
|
-
console.log(`Entry pattern ${id}
|
|
6973
|
-
return;
|
|
7017
|
+
console.log(`Entry pattern ${id} did not have a draft (removing published)`);
|
|
6974
7018
|
}
|
|
6975
7019
|
if (!whatIf) {
|
|
6976
|
-
actions.push(
|
|
7020
|
+
actions.push(
|
|
7021
|
+
client.deleteEntry({ ...parseEntrySerializedId(id), state: CANVAS_PUBLISHED_STATE4 }).catch((err) => {
|
|
7022
|
+
const isNotFound = err instanceof ApiClientError4 && err.statusCode === 404;
|
|
7023
|
+
if (isNotFound) {
|
|
7024
|
+
console.warn(
|
|
7025
|
+
`Entry pattern ${id} was not found when unpublishing (may already be unpublished or orphaned); skipping.`
|
|
7026
|
+
);
|
|
7027
|
+
return;
|
|
7028
|
+
}
|
|
7029
|
+
throw err;
|
|
7030
|
+
})
|
|
7031
|
+
);
|
|
6977
7032
|
}
|
|
6978
7033
|
log2({
|
|
6979
7034
|
action: "update",
|
|
@@ -6981,9 +7036,10 @@ var EntryPatternUnpublishModule = {
|
|
|
6981
7036
|
providerId: sourceObject.providerId,
|
|
6982
7037
|
displayName: sourceObject.displayName ?? sourceObject.providerId,
|
|
6983
7038
|
whatIf,
|
|
6984
|
-
diff: () => diffJson4(targetObject.object, sourceObject.object)
|
|
7039
|
+
diff: () => targetObject ? diffJson4(targetObject.object, sourceObject.object) : []
|
|
6985
7040
|
});
|
|
6986
7041
|
}
|
|
7042
|
+
await Promise.all(actions);
|
|
6987
7043
|
}
|
|
6988
7044
|
};
|
|
6989
7045
|
|
|
@@ -6992,12 +7048,12 @@ var EntryPatternUpdateModule = {
|
|
|
6992
7048
|
command: "update <filename>",
|
|
6993
7049
|
aliases: ["put"],
|
|
6994
7050
|
describe: "Insert or update an entry pattern",
|
|
6995
|
-
builder: (
|
|
7051
|
+
builder: (yargs43) => withConfiguration(
|
|
6996
7052
|
withDebugOptions(
|
|
6997
7053
|
withApiOptions(
|
|
6998
7054
|
withProjectOptions(
|
|
6999
7055
|
withStateOptions(
|
|
7000
|
-
|
|
7056
|
+
yargs43.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
7001
7057
|
)
|
|
7002
7058
|
)
|
|
7003
7059
|
)
|
|
@@ -7033,15 +7089,219 @@ var EntryPatternUpdateModule = {
|
|
|
7033
7089
|
var EntryPatternModule = {
|
|
7034
7090
|
command: "entry-pattern <command>",
|
|
7035
7091
|
describe: "Commands for Entry patterns",
|
|
7036
|
-
builder: (
|
|
7092
|
+
builder: (yargs43) => yargs43.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
7037
7093
|
handler: () => {
|
|
7038
7094
|
yargs14.help();
|
|
7039
7095
|
}
|
|
7040
7096
|
};
|
|
7041
7097
|
|
|
7042
|
-
// src/commands/canvas/commands/
|
|
7098
|
+
// src/commands/canvas/commands/label.ts
|
|
7043
7099
|
import yargs15 from "yargs";
|
|
7044
7100
|
|
|
7101
|
+
// src/commands/canvas/commands/label/_util.ts
|
|
7102
|
+
import { LabelClient } from "@uniformdev/canvas";
|
|
7103
|
+
var selectLabelIdentifier = (label) => label.label.publicId;
|
|
7104
|
+
var selectLabelDisplayName = (label) => `${label.label.displayName} (pid: ${label.label.publicId})`;
|
|
7105
|
+
function getLabelClient(options) {
|
|
7106
|
+
return new LabelClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
7107
|
+
}
|
|
7108
|
+
|
|
7109
|
+
// src/commands/canvas/labelsEngineDataSource.ts
|
|
7110
|
+
function createLabelsEngineDataSource({
|
|
7111
|
+
client
|
|
7112
|
+
}) {
|
|
7113
|
+
async function* getObjects() {
|
|
7114
|
+
const labels = (await client.getLabels()).labels;
|
|
7115
|
+
for await (const label of labels) {
|
|
7116
|
+
const result = {
|
|
7117
|
+
id: label.label.publicId,
|
|
7118
|
+
displayName: `${label.label.displayName} (pid: ${label.label.publicId})`,
|
|
7119
|
+
providerId: label.label.publicId,
|
|
7120
|
+
object: label
|
|
7121
|
+
};
|
|
7122
|
+
yield result;
|
|
7123
|
+
}
|
|
7124
|
+
}
|
|
7125
|
+
return {
|
|
7126
|
+
name: "Uniform API",
|
|
7127
|
+
objects: getObjects(),
|
|
7128
|
+
deleteObject: async (providerId) => {
|
|
7129
|
+
await client.removeLabel({ labelId: providerId });
|
|
7130
|
+
},
|
|
7131
|
+
writeObject: async ({ object: object4 }) => {
|
|
7132
|
+
await client.upsertLabel({ label: object4.label });
|
|
7133
|
+
}
|
|
7134
|
+
};
|
|
7135
|
+
}
|
|
7136
|
+
|
|
7137
|
+
// src/commands/canvas/commands/label/pull.ts
|
|
7138
|
+
var LabelPullModule = {
|
|
7139
|
+
command: "pull <directory>",
|
|
7140
|
+
describe: "Pulls all labels to local files in a directory",
|
|
7141
|
+
builder: (yargs43) => withConfiguration(
|
|
7142
|
+
withDebugOptions(
|
|
7143
|
+
withApiOptions(
|
|
7144
|
+
withProjectOptions(
|
|
7145
|
+
withDiffOptions(
|
|
7146
|
+
yargs43.positional("directory", {
|
|
7147
|
+
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.",
|
|
7148
|
+
type: "string"
|
|
7149
|
+
}).option("format", {
|
|
7150
|
+
alias: ["f"],
|
|
7151
|
+
describe: "Output format",
|
|
7152
|
+
default: "yaml",
|
|
7153
|
+
choices: ["yaml", "json"],
|
|
7154
|
+
type: "string"
|
|
7155
|
+
}).option("mode", {
|
|
7156
|
+
alias: ["m"],
|
|
7157
|
+
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',
|
|
7158
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
7159
|
+
default: "mirror",
|
|
7160
|
+
type: "string"
|
|
7161
|
+
})
|
|
7162
|
+
)
|
|
7163
|
+
)
|
|
7164
|
+
)
|
|
7165
|
+
)
|
|
7166
|
+
),
|
|
7167
|
+
handler: async ({
|
|
7168
|
+
apiHost,
|
|
7169
|
+
apiKey,
|
|
7170
|
+
proxy,
|
|
7171
|
+
directory,
|
|
7172
|
+
format,
|
|
7173
|
+
mode,
|
|
7174
|
+
whatIf,
|
|
7175
|
+
project: projectId,
|
|
7176
|
+
diff: diffMode,
|
|
7177
|
+
allowEmptySource,
|
|
7178
|
+
verbose
|
|
7179
|
+
}) => {
|
|
7180
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7181
|
+
const client = getLabelClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
7182
|
+
const source = createLabelsEngineDataSource({ client });
|
|
7183
|
+
let target;
|
|
7184
|
+
const isPackage = isPathAPackageFile(directory);
|
|
7185
|
+
if (isPackage) {
|
|
7186
|
+
const packageContents = readCanvasPackage(directory, false, verbose);
|
|
7187
|
+
const packageLabels = Array.isArray(packageContents.labels) ? packageContents.labels : [];
|
|
7188
|
+
target = await createArraySyncEngineDataSource({
|
|
7189
|
+
name: `Package file ${directory}`,
|
|
7190
|
+
objects: packageLabels,
|
|
7191
|
+
selectIdentifier: selectLabelIdentifier,
|
|
7192
|
+
selectDisplayName: selectLabelDisplayName,
|
|
7193
|
+
onSyncComplete: async (_, synced) => {
|
|
7194
|
+
packageContents.labels = synced;
|
|
7195
|
+
writeCanvasPackage(directory, packageContents);
|
|
7196
|
+
}
|
|
7197
|
+
});
|
|
7198
|
+
} else {
|
|
7199
|
+
target = await createFileSyncEngineDataSource({
|
|
7200
|
+
directory,
|
|
7201
|
+
selectIdentifier: selectLabelIdentifier,
|
|
7202
|
+
selectDisplayName: selectLabelDisplayName,
|
|
7203
|
+
format,
|
|
7204
|
+
verbose
|
|
7205
|
+
});
|
|
7206
|
+
}
|
|
7207
|
+
await syncEngine({
|
|
7208
|
+
source,
|
|
7209
|
+
target,
|
|
7210
|
+
mode,
|
|
7211
|
+
whatIf,
|
|
7212
|
+
allowEmptySource: allowEmptySource ?? true,
|
|
7213
|
+
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
7214
|
+
onBeforeWriteObject: async (sourceObject) => {
|
|
7215
|
+
delete sourceObject.object.createdBy;
|
|
7216
|
+
delete sourceObject.object.modifiedBy;
|
|
7217
|
+
return sourceObject;
|
|
7218
|
+
}
|
|
7219
|
+
});
|
|
7220
|
+
}
|
|
7221
|
+
};
|
|
7222
|
+
|
|
7223
|
+
// src/commands/canvas/commands/label/push.ts
|
|
7224
|
+
var LabelPushModule = {
|
|
7225
|
+
command: "push <directory>",
|
|
7226
|
+
describe: "Pushes all labels from files in a directory to Uniform",
|
|
7227
|
+
builder: (yargs43) => withConfiguration(
|
|
7228
|
+
withDebugOptions(
|
|
7229
|
+
withApiOptions(
|
|
7230
|
+
withProjectOptions(
|
|
7231
|
+
withDiffOptions(
|
|
7232
|
+
yargs43.positional("directory", {
|
|
7233
|
+
describe: "Directory to read the labels from. If a filename is used, a package will be read instead.",
|
|
7234
|
+
type: "string"
|
|
7235
|
+
}).option("mode", {
|
|
7236
|
+
alias: ["m"],
|
|
7237
|
+
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',
|
|
7238
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
7239
|
+
default: "mirror",
|
|
7240
|
+
type: "string"
|
|
7241
|
+
})
|
|
7242
|
+
)
|
|
7243
|
+
)
|
|
7244
|
+
)
|
|
7245
|
+
)
|
|
7246
|
+
),
|
|
7247
|
+
handler: async ({
|
|
7248
|
+
apiHost,
|
|
7249
|
+
apiKey,
|
|
7250
|
+
proxy,
|
|
7251
|
+
directory,
|
|
7252
|
+
mode,
|
|
7253
|
+
whatIf,
|
|
7254
|
+
project: projectId,
|
|
7255
|
+
diff: diffMode,
|
|
7256
|
+
allowEmptySource,
|
|
7257
|
+
verbose
|
|
7258
|
+
}) => {
|
|
7259
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7260
|
+
const client = getLabelClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
7261
|
+
let source;
|
|
7262
|
+
const isPackage = isPathAPackageFile(directory);
|
|
7263
|
+
if (isPackage) {
|
|
7264
|
+
const packageContents = readCanvasPackage(directory, true, verbose);
|
|
7265
|
+
const packageLabels = Array.isArray(packageContents.labels) ? packageContents.labels : [];
|
|
7266
|
+
source = await createArraySyncEngineDataSource({
|
|
7267
|
+
name: `Package file ${directory}`,
|
|
7268
|
+
objects: packageLabels,
|
|
7269
|
+
selectIdentifier: selectLabelIdentifier,
|
|
7270
|
+
selectDisplayName: selectLabelDisplayName
|
|
7271
|
+
});
|
|
7272
|
+
} else {
|
|
7273
|
+
source = await createFileSyncEngineDataSource({
|
|
7274
|
+
directory,
|
|
7275
|
+
selectIdentifier: selectLabelIdentifier,
|
|
7276
|
+
selectDisplayName: selectLabelDisplayName,
|
|
7277
|
+
verbose
|
|
7278
|
+
});
|
|
7279
|
+
}
|
|
7280
|
+
const target = createLabelsEngineDataSource({ client });
|
|
7281
|
+
await syncEngine({
|
|
7282
|
+
source,
|
|
7283
|
+
target,
|
|
7284
|
+
mode,
|
|
7285
|
+
whatIf,
|
|
7286
|
+
allowEmptySource,
|
|
7287
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
7288
|
+
});
|
|
7289
|
+
}
|
|
7290
|
+
};
|
|
7291
|
+
|
|
7292
|
+
// src/commands/canvas/commands/label.ts
|
|
7293
|
+
var LabelModule = {
|
|
7294
|
+
command: "label <command>",
|
|
7295
|
+
describe: "Commands for label definitions",
|
|
7296
|
+
builder: (yargs43) => yargs43.command(LabelPullModule).command(LabelPushModule),
|
|
7297
|
+
handler: () => {
|
|
7298
|
+
yargs15.help();
|
|
7299
|
+
}
|
|
7300
|
+
};
|
|
7301
|
+
|
|
7302
|
+
// src/commands/canvas/commands/locale.ts
|
|
7303
|
+
import yargs16 from "yargs";
|
|
7304
|
+
|
|
7045
7305
|
// src/commands/canvas/localesEngineDataSource.ts
|
|
7046
7306
|
function createLocaleEngineDataSource({
|
|
7047
7307
|
client
|
|
@@ -7082,12 +7342,12 @@ function getLocaleClient(options) {
|
|
|
7082
7342
|
var LocalePullModule = {
|
|
7083
7343
|
command: "pull <directory>",
|
|
7084
7344
|
describe: "Pulls all locales to local files in a directory",
|
|
7085
|
-
builder: (
|
|
7345
|
+
builder: (yargs43) => withConfiguration(
|
|
7086
7346
|
withDebugOptions(
|
|
7087
7347
|
withApiOptions(
|
|
7088
7348
|
withProjectOptions(
|
|
7089
7349
|
withDiffOptions(
|
|
7090
|
-
|
|
7350
|
+
yargs43.positional("directory", {
|
|
7091
7351
|
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.",
|
|
7092
7352
|
type: "string"
|
|
7093
7353
|
}).option("format", {
|
|
@@ -7167,12 +7427,12 @@ var LocalePullModule = {
|
|
|
7167
7427
|
var LocalePushModule = {
|
|
7168
7428
|
command: "push <directory>",
|
|
7169
7429
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
7170
|
-
builder: (
|
|
7430
|
+
builder: (yargs43) => withConfiguration(
|
|
7171
7431
|
withDebugOptions(
|
|
7172
7432
|
withApiOptions(
|
|
7173
7433
|
withProjectOptions(
|
|
7174
7434
|
withDiffOptions(
|
|
7175
|
-
|
|
7435
|
+
yargs43.positional("directory", {
|
|
7176
7436
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
7177
7437
|
type: "string"
|
|
7178
7438
|
}).option("mode", {
|
|
@@ -7240,14 +7500,14 @@ var LocalePushModule = {
|
|
|
7240
7500
|
var LocaleModule = {
|
|
7241
7501
|
command: "locale <command>",
|
|
7242
7502
|
describe: "Commands for locale definitions",
|
|
7243
|
-
builder: (
|
|
7503
|
+
builder: (yargs43) => yargs43.command(LocalePullModule).command(LocalePushModule),
|
|
7244
7504
|
handler: () => {
|
|
7245
|
-
|
|
7505
|
+
yargs16.help();
|
|
7246
7506
|
}
|
|
7247
7507
|
};
|
|
7248
7508
|
|
|
7249
7509
|
// src/commands/canvas/commands/previewUrl.ts
|
|
7250
|
-
import
|
|
7510
|
+
import yargs17 from "yargs";
|
|
7251
7511
|
|
|
7252
7512
|
// src/commands/canvas/commands/previewUrl/_util.ts
|
|
7253
7513
|
import { PreviewClient } from "@uniformdev/canvas";
|
|
@@ -7261,12 +7521,12 @@ function getPreviewClient(options) {
|
|
|
7261
7521
|
var PreviewUrlGetModule = {
|
|
7262
7522
|
command: "get <id>",
|
|
7263
7523
|
describe: "Fetch a preview URL",
|
|
7264
|
-
builder: (
|
|
7524
|
+
builder: (yargs43) => withConfiguration(
|
|
7265
7525
|
withFormatOptions(
|
|
7266
7526
|
withDebugOptions(
|
|
7267
7527
|
withApiOptions(
|
|
7268
7528
|
withProjectOptions(
|
|
7269
|
-
|
|
7529
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
7270
7530
|
)
|
|
7271
7531
|
)
|
|
7272
7532
|
)
|
|
@@ -7290,8 +7550,8 @@ var PreviewUrlListModule = {
|
|
|
7290
7550
|
command: "list",
|
|
7291
7551
|
describe: "List preview URLs",
|
|
7292
7552
|
aliases: ["ls"],
|
|
7293
|
-
builder: (
|
|
7294
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
7553
|
+
builder: (yargs43) => withConfiguration(
|
|
7554
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs43.options({})))))
|
|
7295
7555
|
),
|
|
7296
7556
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7297
7557
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -7333,12 +7593,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
7333
7593
|
var PreviewUrlPullModule = {
|
|
7334
7594
|
command: "pull <directory>",
|
|
7335
7595
|
describe: "Pulls all preview urls to local files in a directory",
|
|
7336
|
-
builder: (
|
|
7596
|
+
builder: (yargs43) => withConfiguration(
|
|
7337
7597
|
withApiOptions(
|
|
7338
7598
|
withProjectOptions(
|
|
7339
7599
|
withDebugOptions(
|
|
7340
7600
|
withDiffOptions(
|
|
7341
|
-
|
|
7601
|
+
yargs43.positional("directory", {
|
|
7342
7602
|
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.",
|
|
7343
7603
|
type: "string"
|
|
7344
7604
|
}).option("format", {
|
|
@@ -7413,12 +7673,12 @@ var PreviewUrlPullModule = {
|
|
|
7413
7673
|
var PreviewUrlPushModule = {
|
|
7414
7674
|
command: "push <directory>",
|
|
7415
7675
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
7416
|
-
builder: (
|
|
7676
|
+
builder: (yargs43) => withConfiguration(
|
|
7417
7677
|
withApiOptions(
|
|
7418
7678
|
withProjectOptions(
|
|
7419
7679
|
withDiffOptions(
|
|
7420
7680
|
withDebugOptions(
|
|
7421
|
-
|
|
7681
|
+
yargs43.positional("directory", {
|
|
7422
7682
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
7423
7683
|
type: "string"
|
|
7424
7684
|
}).option("mode", {
|
|
@@ -7482,11 +7742,11 @@ var PreviewUrlRemoveModule = {
|
|
|
7482
7742
|
command: "remove <id>",
|
|
7483
7743
|
aliases: ["delete", "rm"],
|
|
7484
7744
|
describe: "Delete a preview URL",
|
|
7485
|
-
builder: (
|
|
7745
|
+
builder: (yargs43) => withConfiguration(
|
|
7486
7746
|
withApiOptions(
|
|
7487
7747
|
withDebugOptions(
|
|
7488
7748
|
withProjectOptions(
|
|
7489
|
-
|
|
7749
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
7490
7750
|
)
|
|
7491
7751
|
)
|
|
7492
7752
|
)
|
|
@@ -7507,11 +7767,11 @@ var PreviewUrlUpdateModule = {
|
|
|
7507
7767
|
command: "update <filename>",
|
|
7508
7768
|
aliases: ["put"],
|
|
7509
7769
|
describe: "Insert or update a preview URL",
|
|
7510
|
-
builder: (
|
|
7770
|
+
builder: (yargs43) => withConfiguration(
|
|
7511
7771
|
withDebugOptions(
|
|
7512
7772
|
withApiOptions(
|
|
7513
7773
|
withProjectOptions(
|
|
7514
|
-
|
|
7774
|
+
yargs43.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
7515
7775
|
)
|
|
7516
7776
|
)
|
|
7517
7777
|
)
|
|
@@ -7533,25 +7793,25 @@ var PreviewUrlModule = {
|
|
|
7533
7793
|
command: "preview-url <command>",
|
|
7534
7794
|
aliases: ["pu"],
|
|
7535
7795
|
describe: "Commands for Canvas preview urls",
|
|
7536
|
-
builder: (
|
|
7796
|
+
builder: (yargs43) => yargs43.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
7537
7797
|
handler: () => {
|
|
7538
|
-
|
|
7798
|
+
yargs17.help();
|
|
7539
7799
|
}
|
|
7540
7800
|
};
|
|
7541
7801
|
|
|
7542
7802
|
// src/commands/canvas/commands/previewViewport.ts
|
|
7543
|
-
import
|
|
7803
|
+
import yargs18 from "yargs";
|
|
7544
7804
|
|
|
7545
7805
|
// src/commands/canvas/commands/previewViewport/get.ts
|
|
7546
7806
|
var PreviewViewportGetModule = {
|
|
7547
7807
|
command: "get <id>",
|
|
7548
7808
|
describe: "Fetch a preview viewport",
|
|
7549
|
-
builder: (
|
|
7809
|
+
builder: (yargs43) => withConfiguration(
|
|
7550
7810
|
withFormatOptions(
|
|
7551
7811
|
withDebugOptions(
|
|
7552
7812
|
withApiOptions(
|
|
7553
7813
|
withProjectOptions(
|
|
7554
|
-
|
|
7814
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
7555
7815
|
)
|
|
7556
7816
|
)
|
|
7557
7817
|
)
|
|
@@ -7575,8 +7835,8 @@ var PreviewViewportListModule = {
|
|
|
7575
7835
|
command: "list",
|
|
7576
7836
|
describe: "List preview viewports",
|
|
7577
7837
|
aliases: ["ls"],
|
|
7578
|
-
builder: (
|
|
7579
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
7838
|
+
builder: (yargs43) => withConfiguration(
|
|
7839
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs43.options({})))))
|
|
7580
7840
|
),
|
|
7581
7841
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7582
7842
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -7622,12 +7882,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
7622
7882
|
var PreviewViewportPullModule = {
|
|
7623
7883
|
command: "pull <directory>",
|
|
7624
7884
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
7625
|
-
builder: (
|
|
7885
|
+
builder: (yargs43) => withConfiguration(
|
|
7626
7886
|
withApiOptions(
|
|
7627
7887
|
withProjectOptions(
|
|
7628
7888
|
withDebugOptions(
|
|
7629
7889
|
withDiffOptions(
|
|
7630
|
-
|
|
7890
|
+
yargs43.positional("directory", {
|
|
7631
7891
|
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.",
|
|
7632
7892
|
type: "string"
|
|
7633
7893
|
}).option("format", {
|
|
@@ -7702,12 +7962,12 @@ var PreviewViewportPullModule = {
|
|
|
7702
7962
|
var PreviewViewportPushModule = {
|
|
7703
7963
|
command: "push <directory>",
|
|
7704
7964
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
7705
|
-
builder: (
|
|
7965
|
+
builder: (yargs43) => withConfiguration(
|
|
7706
7966
|
withApiOptions(
|
|
7707
7967
|
withProjectOptions(
|
|
7708
7968
|
withDiffOptions(
|
|
7709
7969
|
withDebugOptions(
|
|
7710
|
-
|
|
7970
|
+
yargs43.positional("directory", {
|
|
7711
7971
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
7712
7972
|
type: "string"
|
|
7713
7973
|
}).option("mode", {
|
|
@@ -7771,11 +8031,11 @@ var PreviewViewportRemoveModule = {
|
|
|
7771
8031
|
command: "remove <id>",
|
|
7772
8032
|
aliases: ["delete", "rm"],
|
|
7773
8033
|
describe: "Delete a preview viewport",
|
|
7774
|
-
builder: (
|
|
8034
|
+
builder: (yargs43) => withConfiguration(
|
|
7775
8035
|
withApiOptions(
|
|
7776
8036
|
withDebugOptions(
|
|
7777
8037
|
withProjectOptions(
|
|
7778
|
-
|
|
8038
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
7779
8039
|
)
|
|
7780
8040
|
)
|
|
7781
8041
|
)
|
|
@@ -7796,11 +8056,11 @@ var PreviewViewportUpdateModule = {
|
|
|
7796
8056
|
command: "update <filename>",
|
|
7797
8057
|
aliases: ["put"],
|
|
7798
8058
|
describe: "Insert or update a preview viewport",
|
|
7799
|
-
builder: (
|
|
8059
|
+
builder: (yargs43) => withConfiguration(
|
|
7800
8060
|
withDebugOptions(
|
|
7801
8061
|
withApiOptions(
|
|
7802
8062
|
withProjectOptions(
|
|
7803
|
-
|
|
8063
|
+
yargs43.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
7804
8064
|
)
|
|
7805
8065
|
)
|
|
7806
8066
|
)
|
|
@@ -7822,14 +8082,14 @@ var PreviewViewportModule = {
|
|
|
7822
8082
|
command: "preview-viewport <command>",
|
|
7823
8083
|
aliases: ["pv"],
|
|
7824
8084
|
describe: "Commands for Canvas preview viewports",
|
|
7825
|
-
builder: (
|
|
8085
|
+
builder: (yargs43) => yargs43.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
7826
8086
|
handler: () => {
|
|
7827
|
-
|
|
8087
|
+
yargs18.help();
|
|
7828
8088
|
}
|
|
7829
8089
|
};
|
|
7830
8090
|
|
|
7831
8091
|
// src/commands/canvas/commands/prompts.ts
|
|
7832
|
-
import
|
|
8092
|
+
import yargs19 from "yargs";
|
|
7833
8093
|
|
|
7834
8094
|
// src/commands/canvas/commands/prompts/_util.ts
|
|
7835
8095
|
import { PromptClient } from "@uniformdev/canvas";
|
|
@@ -7841,12 +8101,12 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
7841
8101
|
var PromptGetModule = {
|
|
7842
8102
|
command: "get <id>",
|
|
7843
8103
|
describe: "Get a prompt",
|
|
7844
|
-
builder: (
|
|
8104
|
+
builder: (yargs43) => withConfiguration(
|
|
7845
8105
|
withDebugOptions(
|
|
7846
8106
|
withFormatOptions(
|
|
7847
8107
|
withApiOptions(
|
|
7848
8108
|
withProjectOptions(
|
|
7849
|
-
|
|
8109
|
+
yargs43.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
7850
8110
|
)
|
|
7851
8111
|
)
|
|
7852
8112
|
)
|
|
@@ -7867,7 +8127,7 @@ var PromptGetModule = {
|
|
|
7867
8127
|
var PromptListModule = {
|
|
7868
8128
|
command: "list",
|
|
7869
8129
|
describe: "List prompts",
|
|
7870
|
-
builder: (
|
|
8130
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
7871
8131
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7872
8132
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7873
8133
|
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -7908,13 +8168,13 @@ function createPromptEngineDataSource({
|
|
|
7908
8168
|
var PromptPullModule = {
|
|
7909
8169
|
command: "pull <directory>",
|
|
7910
8170
|
describe: "Pulls all prompts to local files in a directory",
|
|
7911
|
-
builder: (
|
|
8171
|
+
builder: (yargs43) => withConfiguration(
|
|
7912
8172
|
withDebugOptions(
|
|
7913
8173
|
withApiOptions(
|
|
7914
8174
|
withProjectOptions(
|
|
7915
8175
|
withStateOptions(
|
|
7916
8176
|
withDiffOptions(
|
|
7917
|
-
|
|
8177
|
+
yargs43.positional("directory", {
|
|
7918
8178
|
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.",
|
|
7919
8179
|
type: "string"
|
|
7920
8180
|
}).option("format", {
|
|
@@ -7995,12 +8255,12 @@ var PromptPullModule = {
|
|
|
7995
8255
|
var PromptPushModule = {
|
|
7996
8256
|
command: "push <directory>",
|
|
7997
8257
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
7998
|
-
builder: (
|
|
8258
|
+
builder: (yargs43) => withConfiguration(
|
|
7999
8259
|
withApiOptions(
|
|
8000
8260
|
withProjectOptions(
|
|
8001
8261
|
withStateOptions(
|
|
8002
8262
|
withDiffOptions(
|
|
8003
|
-
|
|
8263
|
+
yargs43.positional("directory", {
|
|
8004
8264
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
8005
8265
|
type: "string"
|
|
8006
8266
|
}).option("mode", {
|
|
@@ -8069,10 +8329,10 @@ var PromptRemoveModule = {
|
|
|
8069
8329
|
command: "remove <id>",
|
|
8070
8330
|
aliases: ["delete", "rm"],
|
|
8071
8331
|
describe: "Delete a prompt",
|
|
8072
|
-
builder: (
|
|
8332
|
+
builder: (yargs43) => withConfiguration(
|
|
8073
8333
|
withDebugOptions(
|
|
8074
8334
|
withApiOptions(
|
|
8075
|
-
withProjectOptions(
|
|
8335
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
8076
8336
|
)
|
|
8077
8337
|
)
|
|
8078
8338
|
),
|
|
@@ -8092,11 +8352,11 @@ var PromptUpdateModule = {
|
|
|
8092
8352
|
command: "update <filename>",
|
|
8093
8353
|
aliases: ["put"],
|
|
8094
8354
|
describe: "Insert or update a prompt",
|
|
8095
|
-
builder: (
|
|
8355
|
+
builder: (yargs43) => withConfiguration(
|
|
8096
8356
|
withDebugOptions(
|
|
8097
8357
|
withApiOptions(
|
|
8098
8358
|
withProjectOptions(
|
|
8099
|
-
|
|
8359
|
+
yargs43.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
8100
8360
|
)
|
|
8101
8361
|
)
|
|
8102
8362
|
)
|
|
@@ -8118,14 +8378,14 @@ var PromptModule = {
|
|
|
8118
8378
|
command: "prompt <command>",
|
|
8119
8379
|
aliases: ["dt"],
|
|
8120
8380
|
describe: "Commands for AI Prompt definitions",
|
|
8121
|
-
builder: (
|
|
8381
|
+
builder: (yargs43) => yargs43.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
8122
8382
|
handler: () => {
|
|
8123
|
-
|
|
8383
|
+
yargs19.help();
|
|
8124
8384
|
}
|
|
8125
8385
|
};
|
|
8126
8386
|
|
|
8127
8387
|
// src/commands/canvas/commands/workflow.ts
|
|
8128
|
-
import
|
|
8388
|
+
import yargs20 from "yargs";
|
|
8129
8389
|
|
|
8130
8390
|
// src/commands/canvas/commands/workflow/_util.ts
|
|
8131
8391
|
import { WorkflowClient } from "@uniformdev/canvas";
|
|
@@ -8168,12 +8428,12 @@ function createWorkflowEngineDataSource({
|
|
|
8168
8428
|
var WorkflowPullModule = {
|
|
8169
8429
|
command: "pull <directory>",
|
|
8170
8430
|
describe: "Pulls all workflows to local files in a directory",
|
|
8171
|
-
builder: (
|
|
8431
|
+
builder: (yargs43) => withConfiguration(
|
|
8172
8432
|
withApiOptions(
|
|
8173
8433
|
withDebugOptions(
|
|
8174
8434
|
withProjectOptions(
|
|
8175
8435
|
withDiffOptions(
|
|
8176
|
-
|
|
8436
|
+
yargs43.positional("directory", {
|
|
8177
8437
|
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.",
|
|
8178
8438
|
type: "string"
|
|
8179
8439
|
}).option("format", {
|
|
@@ -8248,12 +8508,12 @@ var WorkflowPullModule = {
|
|
|
8248
8508
|
var WorkflowPushModule = {
|
|
8249
8509
|
command: "push <directory>",
|
|
8250
8510
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
8251
|
-
builder: (
|
|
8511
|
+
builder: (yargs43) => withConfiguration(
|
|
8252
8512
|
withDebugOptions(
|
|
8253
8513
|
withApiOptions(
|
|
8254
8514
|
withProjectOptions(
|
|
8255
8515
|
withDiffOptions(
|
|
8256
|
-
|
|
8516
|
+
yargs43.positional("directory", {
|
|
8257
8517
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8258
8518
|
type: "string"
|
|
8259
8519
|
}).option("mode", {
|
|
@@ -8317,9 +8577,9 @@ var WorkflowModule = {
|
|
|
8317
8577
|
command: "workflow <command>",
|
|
8318
8578
|
aliases: ["wf"],
|
|
8319
8579
|
describe: "Commands for Canvas workflows",
|
|
8320
|
-
builder: (
|
|
8580
|
+
builder: (yargs43) => yargs43.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
8321
8581
|
handler: () => {
|
|
8322
|
-
|
|
8582
|
+
yargs20.help();
|
|
8323
8583
|
}
|
|
8324
8584
|
};
|
|
8325
8585
|
|
|
@@ -8328,17 +8588,17 @@ var CanvasCommand = {
|
|
|
8328
8588
|
command: "canvas <command>",
|
|
8329
8589
|
aliases: ["cv", "pm", "presentation"],
|
|
8330
8590
|
describe: "Uniform Canvas commands",
|
|
8331
|
-
builder: (
|
|
8591
|
+
builder: (yargs43) => yargs43.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(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
8332
8592
|
handler: () => {
|
|
8333
|
-
|
|
8593
|
+
yargs21.showHelp();
|
|
8334
8594
|
}
|
|
8335
8595
|
};
|
|
8336
8596
|
|
|
8337
8597
|
// src/commands/context/index.ts
|
|
8338
|
-
import
|
|
8598
|
+
import yargs28 from "yargs";
|
|
8339
8599
|
|
|
8340
8600
|
// src/commands/context/commands/aggregate.ts
|
|
8341
|
-
import
|
|
8601
|
+
import yargs22 from "yargs";
|
|
8342
8602
|
|
|
8343
8603
|
// src/commands/context/commands/aggregate/_util.ts
|
|
8344
8604
|
import { AggregateClient } from "@uniformdev/context/api";
|
|
@@ -8350,11 +8610,11 @@ var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCa
|
|
|
8350
8610
|
var AggregateGetModule = {
|
|
8351
8611
|
command: "get <id>",
|
|
8352
8612
|
describe: "Fetch an aggregate",
|
|
8353
|
-
builder: (
|
|
8613
|
+
builder: (yargs43) => withConfiguration(
|
|
8354
8614
|
withFormatOptions(
|
|
8355
8615
|
withApiOptions(
|
|
8356
8616
|
withProjectOptions(
|
|
8357
|
-
|
|
8617
|
+
yargs43.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
8358
8618
|
)
|
|
8359
8619
|
)
|
|
8360
8620
|
)
|
|
@@ -8377,7 +8637,7 @@ var AggregateListModule = {
|
|
|
8377
8637
|
command: "list",
|
|
8378
8638
|
describe: "List aggregates",
|
|
8379
8639
|
aliases: ["ls"],
|
|
8380
|
-
builder: (
|
|
8640
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
8381
8641
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8382
8642
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8383
8643
|
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8440,12 +8700,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
8440
8700
|
var AggregatePullModule = {
|
|
8441
8701
|
command: "pull <directory>",
|
|
8442
8702
|
describe: "Pulls all aggregates to local files in a directory",
|
|
8443
|
-
builder: (
|
|
8703
|
+
builder: (yargs43) => withConfiguration(
|
|
8444
8704
|
withApiOptions(
|
|
8445
8705
|
withDebugOptions(
|
|
8446
8706
|
withProjectOptions(
|
|
8447
8707
|
withDiffOptions(
|
|
8448
|
-
|
|
8708
|
+
yargs43.positional("directory", {
|
|
8449
8709
|
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.",
|
|
8450
8710
|
type: "string"
|
|
8451
8711
|
}).option("format", {
|
|
@@ -8520,12 +8780,12 @@ var AggregatePullModule = {
|
|
|
8520
8780
|
var AggregatePushModule = {
|
|
8521
8781
|
command: "push <directory>",
|
|
8522
8782
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
8523
|
-
builder: (
|
|
8783
|
+
builder: (yargs43) => withConfiguration(
|
|
8524
8784
|
withApiOptions(
|
|
8525
8785
|
withProjectOptions(
|
|
8526
8786
|
withDiffOptions(
|
|
8527
8787
|
withDebugOptions(
|
|
8528
|
-
|
|
8788
|
+
yargs43.positional("directory", {
|
|
8529
8789
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
8530
8790
|
type: "string"
|
|
8531
8791
|
}).option("mode", {
|
|
@@ -8590,10 +8850,10 @@ var AggregateRemoveModule = {
|
|
|
8590
8850
|
command: "remove <id>",
|
|
8591
8851
|
aliases: ["delete", "rm"],
|
|
8592
8852
|
describe: "Delete an aggregate",
|
|
8593
|
-
builder: (
|
|
8853
|
+
builder: (yargs43) => withConfiguration(
|
|
8594
8854
|
withApiOptions(
|
|
8595
8855
|
withProjectOptions(
|
|
8596
|
-
|
|
8856
|
+
yargs43.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
8597
8857
|
)
|
|
8598
8858
|
)
|
|
8599
8859
|
),
|
|
@@ -8609,10 +8869,10 @@ var AggregateUpdateModule = {
|
|
|
8609
8869
|
command: "update <filename>",
|
|
8610
8870
|
aliases: ["put"],
|
|
8611
8871
|
describe: "Insert or update an aggregate",
|
|
8612
|
-
builder: (
|
|
8872
|
+
builder: (yargs43) => withConfiguration(
|
|
8613
8873
|
withApiOptions(
|
|
8614
8874
|
withProjectOptions(
|
|
8615
|
-
|
|
8875
|
+
yargs43.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
8616
8876
|
)
|
|
8617
8877
|
)
|
|
8618
8878
|
),
|
|
@@ -8629,14 +8889,14 @@ var AggregateModule = {
|
|
|
8629
8889
|
command: "aggregate <command>",
|
|
8630
8890
|
aliases: ["agg", "intent", "audience"],
|
|
8631
8891
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
8632
|
-
builder: (
|
|
8892
|
+
builder: (yargs43) => yargs43.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
8633
8893
|
handler: () => {
|
|
8634
|
-
|
|
8894
|
+
yargs22.help();
|
|
8635
8895
|
}
|
|
8636
8896
|
};
|
|
8637
8897
|
|
|
8638
8898
|
// src/commands/context/commands/enrichment.ts
|
|
8639
|
-
import
|
|
8899
|
+
import yargs23 from "yargs";
|
|
8640
8900
|
|
|
8641
8901
|
// src/commands/context/commands/enrichment/_util.ts
|
|
8642
8902
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
@@ -8650,11 +8910,11 @@ function getEnrichmentClient(options) {
|
|
|
8650
8910
|
var EnrichmentGetModule = {
|
|
8651
8911
|
command: "get <id>",
|
|
8652
8912
|
describe: "Fetch an enrichment category and its values",
|
|
8653
|
-
builder: (
|
|
8913
|
+
builder: (yargs43) => withFormatOptions(
|
|
8654
8914
|
withConfiguration(
|
|
8655
8915
|
withApiOptions(
|
|
8656
8916
|
withProjectOptions(
|
|
8657
|
-
|
|
8917
|
+
yargs43.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
8658
8918
|
)
|
|
8659
8919
|
)
|
|
8660
8920
|
)
|
|
@@ -8677,7 +8937,7 @@ var EnrichmentListModule = {
|
|
|
8677
8937
|
command: "list",
|
|
8678
8938
|
describe: "List enrichments",
|
|
8679
8939
|
aliases: ["ls"],
|
|
8680
|
-
builder: (
|
|
8940
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
8681
8941
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8682
8942
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8683
8943
|
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8772,12 +9032,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
8772
9032
|
var EnrichmentPullModule = {
|
|
8773
9033
|
command: "pull <directory>",
|
|
8774
9034
|
describe: "Pulls all enrichments to local files in a directory",
|
|
8775
|
-
builder: (
|
|
9035
|
+
builder: (yargs43) => withConfiguration(
|
|
8776
9036
|
withDebugOptions(
|
|
8777
9037
|
withApiOptions(
|
|
8778
9038
|
withProjectOptions(
|
|
8779
9039
|
withDiffOptions(
|
|
8780
|
-
|
|
9040
|
+
yargs43.positional("directory", {
|
|
8781
9041
|
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.",
|
|
8782
9042
|
type: "string"
|
|
8783
9043
|
}).option("format", {
|
|
@@ -8852,11 +9112,11 @@ var EnrichmentPullModule = {
|
|
|
8852
9112
|
var EnrichmentPushModule = {
|
|
8853
9113
|
command: "push <directory>",
|
|
8854
9114
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
8855
|
-
builder: (
|
|
9115
|
+
builder: (yargs43) => withConfiguration(
|
|
8856
9116
|
withApiOptions(
|
|
8857
9117
|
withProjectOptions(
|
|
8858
9118
|
withDiffOptions(
|
|
8859
|
-
|
|
9119
|
+
yargs43.positional("directory", {
|
|
8860
9120
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
8861
9121
|
type: "string"
|
|
8862
9122
|
}).option("mode", {
|
|
@@ -8919,10 +9179,10 @@ var EnrichmentRemoveModule = {
|
|
|
8919
9179
|
command: "remove <id>",
|
|
8920
9180
|
aliases: ["delete", "rm"],
|
|
8921
9181
|
describe: "Delete an enrichment category and its values",
|
|
8922
|
-
builder: (
|
|
9182
|
+
builder: (yargs43) => withConfiguration(
|
|
8923
9183
|
withApiOptions(
|
|
8924
9184
|
withProjectOptions(
|
|
8925
|
-
|
|
9185
|
+
yargs43.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
8926
9186
|
)
|
|
8927
9187
|
)
|
|
8928
9188
|
),
|
|
@@ -8938,17 +9198,17 @@ var EnrichmentModule = {
|
|
|
8938
9198
|
command: "enrichment <command>",
|
|
8939
9199
|
aliases: ["enr"],
|
|
8940
9200
|
describe: "Commands for Context enrichments",
|
|
8941
|
-
builder: (
|
|
9201
|
+
builder: (yargs43) => yargs43.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
8942
9202
|
handler: () => {
|
|
8943
|
-
|
|
9203
|
+
yargs23.help();
|
|
8944
9204
|
}
|
|
8945
9205
|
};
|
|
8946
9206
|
|
|
8947
9207
|
// src/commands/context/commands/manifest.ts
|
|
8948
|
-
import
|
|
9208
|
+
import yargs24 from "yargs";
|
|
8949
9209
|
|
|
8950
9210
|
// src/commands/context/commands/manifest/get.ts
|
|
8951
|
-
import { ApiClientError as
|
|
9211
|
+
import { ApiClientError as ApiClientError5, UncachedManifestClient } from "@uniformdev/context/api";
|
|
8952
9212
|
import { gray as gray4, green as green6, red as red6 } from "colorette";
|
|
8953
9213
|
import { writeFile } from "fs";
|
|
8954
9214
|
import { exit } from "process";
|
|
@@ -8956,10 +9216,10 @@ var ManifestGetModule = {
|
|
|
8956
9216
|
command: "get [output]",
|
|
8957
9217
|
aliases: ["dl", "download"],
|
|
8958
9218
|
describe: "Download the Uniform Context manifest for a project",
|
|
8959
|
-
builder: (
|
|
9219
|
+
builder: (yargs43) => withConfiguration(
|
|
8960
9220
|
withApiOptions(
|
|
8961
9221
|
withProjectOptions(
|
|
8962
|
-
|
|
9222
|
+
yargs43.option("preview", {
|
|
8963
9223
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
8964
9224
|
default: false,
|
|
8965
9225
|
type: "boolean",
|
|
@@ -8999,7 +9259,7 @@ var ManifestGetModule = {
|
|
|
8999
9259
|
}
|
|
9000
9260
|
} catch (e) {
|
|
9001
9261
|
let message;
|
|
9002
|
-
if (e instanceof
|
|
9262
|
+
if (e instanceof ApiClientError5) {
|
|
9003
9263
|
if (e.statusCode === 403) {
|
|
9004
9264
|
message = `The API key ${apiKey} did not have permissions to fetch the manifest. Ensure ${preview ? "Uniform Context > Read Drafts" : "Uniform Context > Manifest > Read"} permissions are granted.`;
|
|
9005
9265
|
}
|
|
@@ -9015,13 +9275,13 @@ var ManifestGetModule = {
|
|
|
9015
9275
|
};
|
|
9016
9276
|
|
|
9017
9277
|
// src/commands/context/commands/manifest/publish.ts
|
|
9018
|
-
import { ApiClientError as
|
|
9278
|
+
import { ApiClientError as ApiClientError6, UncachedManifestClient as UncachedManifestClient2 } from "@uniformdev/context/api";
|
|
9019
9279
|
import { gray as gray5, red as red7 } from "colorette";
|
|
9020
9280
|
import { exit as exit2 } from "process";
|
|
9021
9281
|
var ManifestPublishModule = {
|
|
9022
9282
|
command: "publish",
|
|
9023
9283
|
describe: "Publish the Uniform Context manifest for a project",
|
|
9024
|
-
builder: (
|
|
9284
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withProjectOptions(yargs43))),
|
|
9025
9285
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
9026
9286
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9027
9287
|
try {
|
|
@@ -9034,7 +9294,7 @@ var ManifestPublishModule = {
|
|
|
9034
9294
|
await client.publish();
|
|
9035
9295
|
} catch (e) {
|
|
9036
9296
|
let message;
|
|
9037
|
-
if (e instanceof
|
|
9297
|
+
if (e instanceof ApiClientError6) {
|
|
9038
9298
|
if (e.statusCode === 403) {
|
|
9039
9299
|
message = `The API key ${apiKey} did not have permissions to publish the manifest. Ensure Uniform Context > Manifest > Publish permissions are granted.`;
|
|
9040
9300
|
}
|
|
@@ -9054,25 +9314,25 @@ var ManifestModule = {
|
|
|
9054
9314
|
command: "manifest <command>",
|
|
9055
9315
|
describe: "Commands for context manifests",
|
|
9056
9316
|
aliases: ["man"],
|
|
9057
|
-
builder: (
|
|
9317
|
+
builder: (yargs43) => yargs43.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
9058
9318
|
handler: () => {
|
|
9059
|
-
|
|
9319
|
+
yargs24.help();
|
|
9060
9320
|
}
|
|
9061
9321
|
};
|
|
9062
9322
|
|
|
9063
9323
|
// src/commands/context/commands/quirk.ts
|
|
9064
|
-
import
|
|
9324
|
+
import yargs25 from "yargs";
|
|
9065
9325
|
|
|
9066
9326
|
// src/commands/context/commands/quirk/get.ts
|
|
9067
9327
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
9068
9328
|
var QuirkGetModule = {
|
|
9069
9329
|
command: "get <id>",
|
|
9070
9330
|
describe: "Fetch a quirk",
|
|
9071
|
-
builder: (
|
|
9331
|
+
builder: (yargs43) => withConfiguration(
|
|
9072
9332
|
withFormatOptions(
|
|
9073
9333
|
withApiOptions(
|
|
9074
9334
|
withProjectOptions(
|
|
9075
|
-
|
|
9335
|
+
yargs43.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
9076
9336
|
)
|
|
9077
9337
|
)
|
|
9078
9338
|
)
|
|
@@ -9096,11 +9356,11 @@ var QuirkListModule = {
|
|
|
9096
9356
|
command: "list",
|
|
9097
9357
|
describe: "List quirks",
|
|
9098
9358
|
aliases: ["ls"],
|
|
9099
|
-
builder: (
|
|
9359
|
+
builder: (yargs43) => withConfiguration(
|
|
9100
9360
|
withFormatOptions(
|
|
9101
9361
|
withApiOptions(
|
|
9102
9362
|
withProjectOptions(
|
|
9103
|
-
|
|
9363
|
+
yargs43.option("withIntegrations", {
|
|
9104
9364
|
alias: ["i"],
|
|
9105
9365
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
9106
9366
|
type: "boolean"
|
|
@@ -9158,12 +9418,12 @@ function createQuirkEngineDataSource({
|
|
|
9158
9418
|
var QuirkPullModule = {
|
|
9159
9419
|
command: "pull <directory>",
|
|
9160
9420
|
describe: "Pulls all quirks to local files in a directory",
|
|
9161
|
-
builder: (
|
|
9421
|
+
builder: (yargs43) => withConfiguration(
|
|
9162
9422
|
withDebugOptions(
|
|
9163
9423
|
withApiOptions(
|
|
9164
9424
|
withProjectOptions(
|
|
9165
9425
|
withDiffOptions(
|
|
9166
|
-
|
|
9426
|
+
yargs43.positional("directory", {
|
|
9167
9427
|
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.",
|
|
9168
9428
|
type: "string"
|
|
9169
9429
|
}).option("format", {
|
|
@@ -9239,12 +9499,12 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
9239
9499
|
var QuirkPushModule = {
|
|
9240
9500
|
command: "push <directory>",
|
|
9241
9501
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
9242
|
-
builder: (
|
|
9502
|
+
builder: (yargs43) => withConfiguration(
|
|
9243
9503
|
withDebugOptions(
|
|
9244
9504
|
withApiOptions(
|
|
9245
9505
|
withProjectOptions(
|
|
9246
9506
|
withDiffOptions(
|
|
9247
|
-
|
|
9507
|
+
yargs43.positional("directory", {
|
|
9248
9508
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
9249
9509
|
type: "string"
|
|
9250
9510
|
}).option("mode", {
|
|
@@ -9309,10 +9569,10 @@ var QuirkRemoveModule = {
|
|
|
9309
9569
|
command: "remove <id>",
|
|
9310
9570
|
aliases: ["delete", "rm"],
|
|
9311
9571
|
describe: "Delete a quirk",
|
|
9312
|
-
builder: (
|
|
9572
|
+
builder: (yargs43) => withConfiguration(
|
|
9313
9573
|
withApiOptions(
|
|
9314
9574
|
withProjectOptions(
|
|
9315
|
-
|
|
9575
|
+
yargs43.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
9316
9576
|
)
|
|
9317
9577
|
)
|
|
9318
9578
|
),
|
|
@@ -9329,10 +9589,10 @@ var QuirkUpdateModule = {
|
|
|
9329
9589
|
command: "update <filename>",
|
|
9330
9590
|
aliases: ["put"],
|
|
9331
9591
|
describe: "Insert or update a quirk",
|
|
9332
|
-
builder: (
|
|
9592
|
+
builder: (yargs43) => withConfiguration(
|
|
9333
9593
|
withApiOptions(
|
|
9334
9594
|
withProjectOptions(
|
|
9335
|
-
|
|
9595
|
+
yargs43.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
9336
9596
|
)
|
|
9337
9597
|
)
|
|
9338
9598
|
),
|
|
@@ -9349,25 +9609,25 @@ var QuirkModule = {
|
|
|
9349
9609
|
command: "quirk <command>",
|
|
9350
9610
|
aliases: ["qk"],
|
|
9351
9611
|
describe: "Commands for Context quirks",
|
|
9352
|
-
builder: (
|
|
9612
|
+
builder: (yargs43) => yargs43.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
9353
9613
|
handler: () => {
|
|
9354
|
-
|
|
9614
|
+
yargs25.help();
|
|
9355
9615
|
}
|
|
9356
9616
|
};
|
|
9357
9617
|
|
|
9358
9618
|
// src/commands/context/commands/signal.ts
|
|
9359
|
-
import
|
|
9619
|
+
import yargs26 from "yargs";
|
|
9360
9620
|
|
|
9361
9621
|
// src/commands/context/commands/signal/get.ts
|
|
9362
9622
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
9363
9623
|
var SignalGetModule = {
|
|
9364
9624
|
command: "get <id>",
|
|
9365
9625
|
describe: "Fetch a signal",
|
|
9366
|
-
builder: (
|
|
9626
|
+
builder: (yargs43) => withConfiguration(
|
|
9367
9627
|
withFormatOptions(
|
|
9368
9628
|
withApiOptions(
|
|
9369
9629
|
withProjectOptions(
|
|
9370
|
-
|
|
9630
|
+
yargs43.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
9371
9631
|
)
|
|
9372
9632
|
)
|
|
9373
9633
|
)
|
|
@@ -9391,7 +9651,7 @@ var SignalListModule = {
|
|
|
9391
9651
|
command: "list",
|
|
9392
9652
|
describe: "List signals",
|
|
9393
9653
|
aliases: ["ls"],
|
|
9394
|
-
builder: (
|
|
9654
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
9395
9655
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9396
9656
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9397
9657
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9441,12 +9701,12 @@ function createSignalEngineDataSource({
|
|
|
9441
9701
|
var SignalPullModule = {
|
|
9442
9702
|
command: "pull <directory>",
|
|
9443
9703
|
describe: "Pulls all signals to local files in a directory",
|
|
9444
|
-
builder: (
|
|
9704
|
+
builder: (yargs43) => withConfiguration(
|
|
9445
9705
|
withDebugOptions(
|
|
9446
9706
|
withApiOptions(
|
|
9447
9707
|
withProjectOptions(
|
|
9448
9708
|
withDiffOptions(
|
|
9449
|
-
|
|
9709
|
+
yargs43.positional("directory", {
|
|
9450
9710
|
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.",
|
|
9451
9711
|
type: "string"
|
|
9452
9712
|
}).option("format", {
|
|
@@ -9522,12 +9782,12 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
9522
9782
|
var SignalPushModule = {
|
|
9523
9783
|
command: "push <directory>",
|
|
9524
9784
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
9525
|
-
builder: (
|
|
9785
|
+
builder: (yargs43) => withConfiguration(
|
|
9526
9786
|
withDebugOptions(
|
|
9527
9787
|
withApiOptions(
|
|
9528
9788
|
withProjectOptions(
|
|
9529
9789
|
withDiffOptions(
|
|
9530
|
-
|
|
9790
|
+
yargs43.positional("directory", {
|
|
9531
9791
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
9532
9792
|
type: "string"
|
|
9533
9793
|
}).option("mode", {
|
|
@@ -9592,10 +9852,10 @@ var SignalRemoveModule = {
|
|
|
9592
9852
|
command: "remove <id>",
|
|
9593
9853
|
aliases: ["delete", "rm"],
|
|
9594
9854
|
describe: "Delete a signal",
|
|
9595
|
-
builder: (
|
|
9855
|
+
builder: (yargs43) => withConfiguration(
|
|
9596
9856
|
withApiOptions(
|
|
9597
9857
|
withProjectOptions(
|
|
9598
|
-
|
|
9858
|
+
yargs43.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
9599
9859
|
)
|
|
9600
9860
|
)
|
|
9601
9861
|
),
|
|
@@ -9612,10 +9872,10 @@ var SignalUpdateModule = {
|
|
|
9612
9872
|
command: "update <filename>",
|
|
9613
9873
|
aliases: ["put"],
|
|
9614
9874
|
describe: "Insert or update a signal",
|
|
9615
|
-
builder: (
|
|
9875
|
+
builder: (yargs43) => withConfiguration(
|
|
9616
9876
|
withApiOptions(
|
|
9617
9877
|
withProjectOptions(
|
|
9618
|
-
|
|
9878
|
+
yargs43.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
9619
9879
|
)
|
|
9620
9880
|
)
|
|
9621
9881
|
),
|
|
@@ -9632,25 +9892,25 @@ var SignalModule = {
|
|
|
9632
9892
|
command: "signal <command>",
|
|
9633
9893
|
aliases: ["sig"],
|
|
9634
9894
|
describe: "Commands for Context signals",
|
|
9635
|
-
builder: (
|
|
9895
|
+
builder: (yargs43) => yargs43.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
9636
9896
|
handler: () => {
|
|
9637
|
-
|
|
9897
|
+
yargs26.help();
|
|
9638
9898
|
}
|
|
9639
9899
|
};
|
|
9640
9900
|
|
|
9641
9901
|
// src/commands/context/commands/test.ts
|
|
9642
|
-
import
|
|
9902
|
+
import yargs27 from "yargs";
|
|
9643
9903
|
|
|
9644
9904
|
// src/commands/context/commands/test/get.ts
|
|
9645
9905
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
9646
9906
|
var TestGetModule = {
|
|
9647
9907
|
command: "get <id>",
|
|
9648
9908
|
describe: "Fetch a test",
|
|
9649
|
-
builder: (
|
|
9909
|
+
builder: (yargs43) => withConfiguration(
|
|
9650
9910
|
withFormatOptions(
|
|
9651
9911
|
withApiOptions(
|
|
9652
9912
|
withProjectOptions(
|
|
9653
|
-
|
|
9913
|
+
yargs43.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
9654
9914
|
)
|
|
9655
9915
|
)
|
|
9656
9916
|
)
|
|
@@ -9674,7 +9934,7 @@ var TestListModule = {
|
|
|
9674
9934
|
command: "list",
|
|
9675
9935
|
describe: "List tests",
|
|
9676
9936
|
aliases: ["ls"],
|
|
9677
|
-
builder: (
|
|
9937
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
9678
9938
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9679
9939
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9680
9940
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9724,12 +9984,12 @@ function createTestEngineDataSource({
|
|
|
9724
9984
|
var TestPullModule = {
|
|
9725
9985
|
command: "pull <directory>",
|
|
9726
9986
|
describe: "Pulls all tests to local files in a directory",
|
|
9727
|
-
builder: (
|
|
9987
|
+
builder: (yargs43) => withConfiguration(
|
|
9728
9988
|
withDebugOptions(
|
|
9729
9989
|
withApiOptions(
|
|
9730
9990
|
withProjectOptions(
|
|
9731
9991
|
withDiffOptions(
|
|
9732
|
-
|
|
9992
|
+
yargs43.positional("directory", {
|
|
9733
9993
|
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.",
|
|
9734
9994
|
type: "string"
|
|
9735
9995
|
}).option("format", {
|
|
@@ -9805,12 +10065,12 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
9805
10065
|
var TestPushModule = {
|
|
9806
10066
|
command: "push <directory>",
|
|
9807
10067
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
9808
|
-
builder: (
|
|
10068
|
+
builder: (yargs43) => withConfiguration(
|
|
9809
10069
|
withDebugOptions(
|
|
9810
10070
|
withApiOptions(
|
|
9811
10071
|
withProjectOptions(
|
|
9812
10072
|
withDiffOptions(
|
|
9813
|
-
|
|
10073
|
+
yargs43.positional("directory", {
|
|
9814
10074
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
9815
10075
|
type: "string"
|
|
9816
10076
|
}).option("mode", {
|
|
@@ -9875,10 +10135,10 @@ var TestRemoveModule = {
|
|
|
9875
10135
|
command: "remove <id>",
|
|
9876
10136
|
aliases: ["delete", "rm"],
|
|
9877
10137
|
describe: "Delete a test",
|
|
9878
|
-
builder: (
|
|
10138
|
+
builder: (yargs43) => withConfiguration(
|
|
9879
10139
|
withApiOptions(
|
|
9880
10140
|
withProjectOptions(
|
|
9881
|
-
|
|
10141
|
+
yargs43.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
9882
10142
|
)
|
|
9883
10143
|
)
|
|
9884
10144
|
),
|
|
@@ -9895,9 +10155,9 @@ var TestUpdateModule = {
|
|
|
9895
10155
|
command: "update <filename>",
|
|
9896
10156
|
aliases: ["put"],
|
|
9897
10157
|
describe: "Insert or update a test",
|
|
9898
|
-
builder: (
|
|
10158
|
+
builder: (yargs43) => withConfiguration(
|
|
9899
10159
|
withApiOptions(
|
|
9900
|
-
withProjectOptions(
|
|
10160
|
+
withProjectOptions(yargs43.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
9901
10161
|
)
|
|
9902
10162
|
),
|
|
9903
10163
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -9912,9 +10172,9 @@ var TestUpdateModule = {
|
|
|
9912
10172
|
var TestModule = {
|
|
9913
10173
|
command: "test <command>",
|
|
9914
10174
|
describe: "Commands for Context A/B tests",
|
|
9915
|
-
builder: (
|
|
10175
|
+
builder: (yargs43) => yargs43.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
9916
10176
|
handler: () => {
|
|
9917
|
-
|
|
10177
|
+
yargs27.help();
|
|
9918
10178
|
}
|
|
9919
10179
|
};
|
|
9920
10180
|
|
|
@@ -9923,20 +10183,20 @@ var ContextCommand = {
|
|
|
9923
10183
|
command: "context <command>",
|
|
9924
10184
|
aliases: ["ctx"],
|
|
9925
10185
|
describe: "Uniform Context commands",
|
|
9926
|
-
builder: (
|
|
10186
|
+
builder: (yargs43) => yargs43.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
9927
10187
|
handler: () => {
|
|
9928
|
-
|
|
10188
|
+
yargs28.showHelp();
|
|
9929
10189
|
}
|
|
9930
10190
|
};
|
|
9931
10191
|
|
|
9932
10192
|
// src/commands/integration/index.ts
|
|
9933
|
-
import
|
|
10193
|
+
import yargs33 from "yargs";
|
|
9934
10194
|
|
|
9935
10195
|
// src/commands/integration/commands/definition.ts
|
|
9936
|
-
import
|
|
10196
|
+
import yargs32 from "yargs";
|
|
9937
10197
|
|
|
9938
10198
|
// src/commands/integration/commands/definition/dataResourceEditor/dataResourceEditor.ts
|
|
9939
|
-
import
|
|
10199
|
+
import yargs29 from "yargs";
|
|
9940
10200
|
|
|
9941
10201
|
// src/commands/integration/commands/definition/dataResourceEditor/deploy.ts
|
|
9942
10202
|
import { readFileSync as readFileSync2 } from "fs";
|
|
@@ -10007,8 +10267,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
10007
10267
|
};
|
|
10008
10268
|
|
|
10009
10269
|
// src/commands/integration/commands/definition/dataResourceEditor/util.ts
|
|
10010
|
-
function withDataResourceEditorIdOptions(
|
|
10011
|
-
return
|
|
10270
|
+
function withDataResourceEditorIdOptions(yargs43) {
|
|
10271
|
+
return yargs43.option("connectorType", {
|
|
10012
10272
|
describe: "Integration data connector type to attach the data resource editor to, as defined in the integration manifest file.",
|
|
10013
10273
|
demandOption: true,
|
|
10014
10274
|
type: "string"
|
|
@@ -10028,11 +10288,11 @@ function withDataResourceEditorIdOptions(yargs42) {
|
|
|
10028
10288
|
var IntegrationDataResourceEditorDeployModule = {
|
|
10029
10289
|
command: "deploy <filename>",
|
|
10030
10290
|
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.",
|
|
10031
|
-
builder: (
|
|
10291
|
+
builder: (yargs43) => withConfiguration(
|
|
10032
10292
|
withApiOptions(
|
|
10033
10293
|
withTeamOptions(
|
|
10034
10294
|
withDataResourceEditorIdOptions(
|
|
10035
|
-
|
|
10295
|
+
yargs43.positional("filename", {
|
|
10036
10296
|
demandOption: true,
|
|
10037
10297
|
describe: "ESM code file to run for the target data resource editor hook. Refer to the documentation for expected types."
|
|
10038
10298
|
}).option("compatibilityDate", {
|
|
@@ -10075,7 +10335,7 @@ var IntegrationDataResourceEditorDeployModule = {
|
|
|
10075
10335
|
var IntegrationDataResourceEditorRemoveModule = {
|
|
10076
10336
|
command: "remove",
|
|
10077
10337
|
describe: "Removes a custom AI data resource editor hook from a data resource archetype. The API key used must have team admin permissions.",
|
|
10078
|
-
builder: (
|
|
10338
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withTeamOptions(withDataResourceEditorIdOptions(yargs43)))),
|
|
10079
10339
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, connectorType, archetype, hook }) => {
|
|
10080
10340
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10081
10341
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10087,21 +10347,21 @@ var IntegrationDataResourceEditorRemoveModule = {
|
|
|
10087
10347
|
var IntegrationDataResourceEditorModule = {
|
|
10088
10348
|
command: "dataResourceEditor <command>",
|
|
10089
10349
|
describe: "Commands for managing custom AI data resource editors at the team level.",
|
|
10090
|
-
builder: (
|
|
10350
|
+
builder: (yargs43) => yargs43.command(IntegrationDataResourceEditorDeployModule).command(IntegrationDataResourceEditorRemoveModule).demandCommand(),
|
|
10091
10351
|
handler: () => {
|
|
10092
|
-
|
|
10352
|
+
yargs29.help();
|
|
10093
10353
|
}
|
|
10094
10354
|
};
|
|
10095
10355
|
|
|
10096
10356
|
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
10097
|
-
import
|
|
10357
|
+
import yargs30 from "yargs";
|
|
10098
10358
|
|
|
10099
10359
|
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
10100
10360
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10101
10361
|
|
|
10102
10362
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
10103
|
-
function withEdgehancerIdOptions(
|
|
10104
|
-
return
|
|
10363
|
+
function withEdgehancerIdOptions(yargs43) {
|
|
10364
|
+
return yargs43.option("connectorType", {
|
|
10105
10365
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
10106
10366
|
demandOption: true,
|
|
10107
10367
|
type: "string"
|
|
@@ -10121,11 +10381,11 @@ function withEdgehancerIdOptions(yargs42) {
|
|
|
10121
10381
|
var IntegrationEdgehancerDeployModule = {
|
|
10122
10382
|
command: "deploy <filename>",
|
|
10123
10383
|
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.",
|
|
10124
|
-
builder: (
|
|
10384
|
+
builder: (yargs43) => withConfiguration(
|
|
10125
10385
|
withApiOptions(
|
|
10126
10386
|
withTeamOptions(
|
|
10127
10387
|
withEdgehancerIdOptions(
|
|
10128
|
-
|
|
10388
|
+
yargs43.positional("filename", {
|
|
10129
10389
|
demandOption: true,
|
|
10130
10390
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
10131
10391
|
}).option("compatibilityDate", {
|
|
@@ -10168,7 +10428,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
10168
10428
|
var IntegrationEdgehancerRemoveModule = {
|
|
10169
10429
|
command: "remove",
|
|
10170
10430
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
10171
|
-
builder: (
|
|
10431
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs43)))),
|
|
10172
10432
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
10173
10433
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10174
10434
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10180,22 +10440,22 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
10180
10440
|
var IntegrationEdgehancerModule = {
|
|
10181
10441
|
command: "edgehancer <command>",
|
|
10182
10442
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
10183
|
-
builder: (
|
|
10443
|
+
builder: (yargs43) => yargs43.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
10184
10444
|
handler: () => {
|
|
10185
|
-
|
|
10445
|
+
yargs30.help();
|
|
10186
10446
|
}
|
|
10187
10447
|
};
|
|
10188
10448
|
|
|
10189
10449
|
// src/commands/integration/commands/definition/propertyEditor/propertyEditor.ts
|
|
10190
|
-
import
|
|
10450
|
+
import yargs31 from "yargs";
|
|
10191
10451
|
|
|
10192
10452
|
// src/commands/integration/commands/definition/propertyEditor/deploy.ts
|
|
10193
10453
|
import { IntegrationPropertyEditorsClient } from "@uniformdev/canvas";
|
|
10194
10454
|
import { readFileSync as readFileSync4 } from "fs";
|
|
10195
10455
|
|
|
10196
10456
|
// src/commands/integration/commands/definition/propertyEditor/util.ts
|
|
10197
|
-
function withPropertyEditorIdOptions(
|
|
10198
|
-
return
|
|
10457
|
+
function withPropertyEditorIdOptions(yargs43) {
|
|
10458
|
+
return yargs43.option("propertyType", {
|
|
10199
10459
|
describe: "Property type to attach the editor to.",
|
|
10200
10460
|
demandOption: true,
|
|
10201
10461
|
type: "string"
|
|
@@ -10211,11 +10471,11 @@ function withPropertyEditorIdOptions(yargs42) {
|
|
|
10211
10471
|
var IntegrationPropertyEditorDeployModule = {
|
|
10212
10472
|
command: "deploy <filename>",
|
|
10213
10473
|
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.",
|
|
10214
|
-
builder: (
|
|
10474
|
+
builder: (yargs43) => withConfiguration(
|
|
10215
10475
|
withApiOptions(
|
|
10216
10476
|
withTeamOptions(
|
|
10217
10477
|
withPropertyEditorIdOptions(
|
|
10218
|
-
|
|
10478
|
+
yargs43.positional("filename", {
|
|
10219
10479
|
demandOption: true,
|
|
10220
10480
|
describe: "ESM code file to run for the target property editor hook. Refer to the documentation for expected types."
|
|
10221
10481
|
}).option("compatibilityDate", {
|
|
@@ -10258,7 +10518,7 @@ import { IntegrationPropertyEditorsClient as IntegrationPropertyEditorsClient2 }
|
|
|
10258
10518
|
var IntegrationPropertyEditorRemoveModule = {
|
|
10259
10519
|
command: "remove",
|
|
10260
10520
|
describe: "Deletes a custom AI property editor hook from a property type. The API key used must have team admin permissions.",
|
|
10261
|
-
builder: (
|
|
10521
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withTeamOptions(withPropertyEditorIdOptions(yargs43)))),
|
|
10262
10522
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, propertyType, hook }) => {
|
|
10263
10523
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10264
10524
|
const client = new IntegrationPropertyEditorsClient2({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10270,9 +10530,9 @@ var IntegrationPropertyEditorRemoveModule = {
|
|
|
10270
10530
|
var IntegrationPropertyEditorModule = {
|
|
10271
10531
|
command: "propertyEditor <command>",
|
|
10272
10532
|
describe: "Commands for managing custom AI property editors at the team level.",
|
|
10273
|
-
builder: (
|
|
10533
|
+
builder: (yargs43) => yargs43.command(IntegrationPropertyEditorDeployModule).command(IntegrationPropertyEditorRemoveModule).demandCommand(),
|
|
10274
10534
|
handler: () => {
|
|
10275
|
-
|
|
10535
|
+
yargs31.help();
|
|
10276
10536
|
}
|
|
10277
10537
|
};
|
|
10278
10538
|
|
|
@@ -10312,10 +10572,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
10312
10572
|
var IntegrationDefinitionRegisterModule = {
|
|
10313
10573
|
command: "register <filename>",
|
|
10314
10574
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
10315
|
-
builder: (
|
|
10575
|
+
builder: (yargs43) => withConfiguration(
|
|
10316
10576
|
withApiOptions(
|
|
10317
10577
|
withTeamOptions(
|
|
10318
|
-
|
|
10578
|
+
yargs43.positional("filename", {
|
|
10319
10579
|
demandOption: true,
|
|
10320
10580
|
describe: "Integration definition manifest to register"
|
|
10321
10581
|
})
|
|
@@ -10334,10 +10594,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
10334
10594
|
var IntegrationDefinitionRemoveModule = {
|
|
10335
10595
|
command: "remove <type>",
|
|
10336
10596
|
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.",
|
|
10337
|
-
builder: (
|
|
10597
|
+
builder: (yargs43) => withConfiguration(
|
|
10338
10598
|
withApiOptions(
|
|
10339
10599
|
withTeamOptions(
|
|
10340
|
-
|
|
10600
|
+
yargs43.positional("type", {
|
|
10341
10601
|
demandOption: true,
|
|
10342
10602
|
describe: "Integration type (from its manifest) to remove."
|
|
10343
10603
|
})
|
|
@@ -10355,9 +10615,9 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
10355
10615
|
var IntegrationDefinitionModule = {
|
|
10356
10616
|
command: "definition <command>",
|
|
10357
10617
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
10358
|
-
builder: (
|
|
10618
|
+
builder: (yargs43) => yargs43.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).command(IntegrationDataResourceEditorModule).command(IntegrationPropertyEditorModule).demandCommand(),
|
|
10359
10619
|
handler: () => {
|
|
10360
|
-
|
|
10620
|
+
yargs32.help();
|
|
10361
10621
|
}
|
|
10362
10622
|
};
|
|
10363
10623
|
|
|
@@ -10397,10 +10657,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
10397
10657
|
var IntegrationInstallModule = {
|
|
10398
10658
|
command: "install <type>",
|
|
10399
10659
|
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.",
|
|
10400
|
-
builder: (
|
|
10660
|
+
builder: (yargs43) => withConfiguration(
|
|
10401
10661
|
withApiOptions(
|
|
10402
10662
|
withProjectOptions(
|
|
10403
|
-
|
|
10663
|
+
yargs43.positional("type", {
|
|
10404
10664
|
demandOption: true,
|
|
10405
10665
|
describe: "Integration type to install (as defined in its manifest)"
|
|
10406
10666
|
}).option("configuration", {
|
|
@@ -10422,10 +10682,10 @@ var IntegrationInstallModule = {
|
|
|
10422
10682
|
var IntegrationUninstallModule = {
|
|
10423
10683
|
command: "uninstall <type>",
|
|
10424
10684
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
10425
|
-
builder: (
|
|
10685
|
+
builder: (yargs43) => withConfiguration(
|
|
10426
10686
|
withApiOptions(
|
|
10427
10687
|
withProjectOptions(
|
|
10428
|
-
|
|
10688
|
+
yargs43.positional("type", {
|
|
10429
10689
|
demandOption: true,
|
|
10430
10690
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
10431
10691
|
})
|
|
@@ -10443,9 +10703,9 @@ var IntegrationUninstallModule = {
|
|
|
10443
10703
|
var IntegrationCommand = {
|
|
10444
10704
|
command: "integration <command>",
|
|
10445
10705
|
describe: "Integration management commands",
|
|
10446
|
-
builder: (
|
|
10706
|
+
builder: (yargs43) => yargs43.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
10447
10707
|
handler: () => {
|
|
10448
|
-
|
|
10708
|
+
yargs33.showHelp();
|
|
10449
10709
|
}
|
|
10450
10710
|
};
|
|
10451
10711
|
|
|
@@ -10910,14 +11170,14 @@ var NewMeshCmd = {
|
|
|
10910
11170
|
};
|
|
10911
11171
|
|
|
10912
11172
|
// src/commands/policy-documents/index.ts
|
|
10913
|
-
import
|
|
11173
|
+
import yargs34 from "yargs";
|
|
10914
11174
|
|
|
10915
11175
|
// src/commands/policy-documents/commands/list.ts
|
|
10916
11176
|
var PolicyDocumentsListModule = {
|
|
10917
11177
|
command: "list",
|
|
10918
11178
|
describe: "List policy documents for a project",
|
|
10919
11179
|
aliases: ["ls"],
|
|
10920
|
-
builder: (
|
|
11180
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
10921
11181
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
10922
11182
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
10923
11183
|
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
@@ -11002,12 +11262,12 @@ var selectDisplayName13 = (policyDoc) => `Policy document for role ${policyDoc.r
|
|
|
11002
11262
|
var PolicyDocumentsPullModule = {
|
|
11003
11263
|
command: "pull <directory>",
|
|
11004
11264
|
describe: "Pulls all policy documents to local files in a directory",
|
|
11005
|
-
builder: (
|
|
11265
|
+
builder: (yargs43) => withConfiguration(
|
|
11006
11266
|
withApiOptions(
|
|
11007
11267
|
withDebugOptions(
|
|
11008
11268
|
withProjectOptions(
|
|
11009
11269
|
withDiffOptions(
|
|
11010
|
-
|
|
11270
|
+
yargs43.positional("directory", {
|
|
11011
11271
|
describe: "Directory to save to. Each policy document will be saved as a separate file named by role ID.",
|
|
11012
11272
|
type: "string"
|
|
11013
11273
|
}).option("format", {
|
|
@@ -11140,12 +11400,12 @@ function mergePolicyDocuments(localDocs, remoteDocs, mode) {
|
|
|
11140
11400
|
var PolicyDocumentsPushModule = {
|
|
11141
11401
|
command: "push <directory>",
|
|
11142
11402
|
describe: "Pushes policy documents from local files to Uniform",
|
|
11143
|
-
builder: (
|
|
11403
|
+
builder: (yargs43) => withConfiguration(
|
|
11144
11404
|
withApiOptions(
|
|
11145
11405
|
withDebugOptions(
|
|
11146
11406
|
withProjectOptions(
|
|
11147
11407
|
withDiffOptions(
|
|
11148
|
-
|
|
11408
|
+
yargs43.positional("directory", {
|
|
11149
11409
|
describe: "Directory containing policy document files (one file per role ID).",
|
|
11150
11410
|
type: "string"
|
|
11151
11411
|
}).option("format", {
|
|
@@ -11246,17 +11506,17 @@ var PolicyDocumentsCommand = {
|
|
|
11246
11506
|
command: "policy-documents <command>",
|
|
11247
11507
|
aliases: ["policy", "policies"],
|
|
11248
11508
|
describe: "Uniform Policy Documents commands",
|
|
11249
|
-
builder: (
|
|
11509
|
+
builder: (yargs43) => yargs43.command(PolicyDocumentsListModule).command(PolicyDocumentsPullModule).command(PolicyDocumentsPushModule).demandCommand(),
|
|
11250
11510
|
handler: () => {
|
|
11251
|
-
|
|
11511
|
+
yargs34.showHelp();
|
|
11252
11512
|
}
|
|
11253
11513
|
};
|
|
11254
11514
|
|
|
11255
11515
|
// src/commands/project-map/index.ts
|
|
11256
|
-
import
|
|
11516
|
+
import yargs37 from "yargs";
|
|
11257
11517
|
|
|
11258
11518
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
11259
|
-
import
|
|
11519
|
+
import yargs35 from "yargs";
|
|
11260
11520
|
|
|
11261
11521
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
11262
11522
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
@@ -11270,11 +11530,11 @@ function getProjectMapClient(options) {
|
|
|
11270
11530
|
var ProjectMapDefinitionGetModule = {
|
|
11271
11531
|
command: "get <id>",
|
|
11272
11532
|
describe: "Fetch a project map",
|
|
11273
|
-
builder: (
|
|
11533
|
+
builder: (yargs43) => withFormatOptions(
|
|
11274
11534
|
withConfiguration(
|
|
11275
11535
|
withApiOptions(
|
|
11276
11536
|
withProjectOptions(
|
|
11277
|
-
|
|
11537
|
+
yargs43.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
11278
11538
|
)
|
|
11279
11539
|
)
|
|
11280
11540
|
)
|
|
@@ -11297,7 +11557,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
11297
11557
|
command: "list",
|
|
11298
11558
|
describe: "List of project maps",
|
|
11299
11559
|
aliases: ["ls"],
|
|
11300
|
-
builder: (
|
|
11560
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
11301
11561
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
11302
11562
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11303
11563
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -11351,12 +11611,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
11351
11611
|
var ProjectMapDefinitionPullModule = {
|
|
11352
11612
|
command: "pull <directory>",
|
|
11353
11613
|
describe: "Pulls all project maps to local files in a directory",
|
|
11354
|
-
builder: (
|
|
11614
|
+
builder: (yargs43) => withConfiguration(
|
|
11355
11615
|
withDebugOptions(
|
|
11356
11616
|
withApiOptions(
|
|
11357
11617
|
withProjectOptions(
|
|
11358
11618
|
withDiffOptions(
|
|
11359
|
-
|
|
11619
|
+
yargs43.positional("directory", {
|
|
11360
11620
|
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.",
|
|
11361
11621
|
type: "string"
|
|
11362
11622
|
}).option("format", {
|
|
@@ -11431,12 +11691,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
11431
11691
|
var ProjectMapDefinitionPushModule = {
|
|
11432
11692
|
command: "push <directory>",
|
|
11433
11693
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
11434
|
-
builder: (
|
|
11694
|
+
builder: (yargs43) => withConfiguration(
|
|
11435
11695
|
withDebugOptions(
|
|
11436
11696
|
withApiOptions(
|
|
11437
11697
|
withProjectOptions(
|
|
11438
11698
|
withDiffOptions(
|
|
11439
|
-
|
|
11699
|
+
yargs43.positional("directory", {
|
|
11440
11700
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
11441
11701
|
type: "string"
|
|
11442
11702
|
}).option("mode", {
|
|
@@ -11500,9 +11760,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
11500
11760
|
command: "remove <id>",
|
|
11501
11761
|
aliases: ["delete", "rm"],
|
|
11502
11762
|
describe: "Delete a project map",
|
|
11503
|
-
builder: (
|
|
11763
|
+
builder: (yargs43) => withConfiguration(
|
|
11504
11764
|
withApiOptions(
|
|
11505
|
-
withProjectOptions(
|
|
11765
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
11506
11766
|
)
|
|
11507
11767
|
),
|
|
11508
11768
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -11517,10 +11777,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
11517
11777
|
command: "update <filename>",
|
|
11518
11778
|
aliases: ["put"],
|
|
11519
11779
|
describe: "Insert or update a project map",
|
|
11520
|
-
builder: (
|
|
11780
|
+
builder: (yargs43) => withConfiguration(
|
|
11521
11781
|
withApiOptions(
|
|
11522
11782
|
withProjectOptions(
|
|
11523
|
-
|
|
11783
|
+
yargs43.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
11524
11784
|
)
|
|
11525
11785
|
)
|
|
11526
11786
|
),
|
|
@@ -11536,24 +11796,24 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
11536
11796
|
var ProjectMapDefinitionModule = {
|
|
11537
11797
|
command: "definition <command>",
|
|
11538
11798
|
describe: "Commands for ProjectMap Definitions",
|
|
11539
|
-
builder: (
|
|
11799
|
+
builder: (yargs43) => yargs43.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
11540
11800
|
handler: () => {
|
|
11541
|
-
|
|
11801
|
+
yargs35.help();
|
|
11542
11802
|
}
|
|
11543
11803
|
};
|
|
11544
11804
|
|
|
11545
11805
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
11546
|
-
import
|
|
11806
|
+
import yargs36 from "yargs";
|
|
11547
11807
|
|
|
11548
11808
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
11549
11809
|
var ProjectMapNodeGetModule = {
|
|
11550
11810
|
command: "get <id> <projectMapId>",
|
|
11551
11811
|
describe: "Fetch a project map node",
|
|
11552
|
-
builder: (
|
|
11812
|
+
builder: (yargs43) => withConfiguration(
|
|
11553
11813
|
withFormatOptions(
|
|
11554
11814
|
withApiOptions(
|
|
11555
11815
|
withProjectOptions(
|
|
11556
|
-
|
|
11816
|
+
yargs43.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
11557
11817
|
)
|
|
11558
11818
|
)
|
|
11559
11819
|
)
|
|
@@ -11577,12 +11837,12 @@ var ProjectMapNodeListModule = {
|
|
|
11577
11837
|
command: "list <projectMapId>",
|
|
11578
11838
|
describe: "List project map nodes",
|
|
11579
11839
|
aliases: ["ls"],
|
|
11580
|
-
builder: (
|
|
11840
|
+
builder: (yargs43) => withConfiguration(
|
|
11581
11841
|
withFormatOptions(
|
|
11582
11842
|
withApiOptions(
|
|
11583
11843
|
withProjectOptions(
|
|
11584
11844
|
withStateOptions(
|
|
11585
|
-
|
|
11845
|
+
yargs43.positional("projectMapId", {
|
|
11586
11846
|
demandOption: true,
|
|
11587
11847
|
describe: "ProjectMap UUID to fetch from"
|
|
11588
11848
|
})
|
|
@@ -11660,12 +11920,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
11660
11920
|
var ProjectMapNodePullModule = {
|
|
11661
11921
|
command: "pull <directory>",
|
|
11662
11922
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
11663
|
-
builder: (
|
|
11923
|
+
builder: (yargs43) => withConfiguration(
|
|
11664
11924
|
withDebugOptions(
|
|
11665
11925
|
withApiOptions(
|
|
11666
11926
|
withProjectOptions(
|
|
11667
11927
|
withDiffOptions(
|
|
11668
|
-
|
|
11928
|
+
yargs43.positional("directory", {
|
|
11669
11929
|
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.",
|
|
11670
11930
|
type: "string"
|
|
11671
11931
|
}).option("format", {
|
|
@@ -11747,12 +12007,12 @@ import {
|
|
|
11747
12007
|
var ProjectMapNodePushModule = {
|
|
11748
12008
|
command: "push <directory>",
|
|
11749
12009
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
11750
|
-
builder: (
|
|
12010
|
+
builder: (yargs43) => withConfiguration(
|
|
11751
12011
|
withDebugOptions(
|
|
11752
12012
|
withApiOptions(
|
|
11753
12013
|
withProjectOptions(
|
|
11754
12014
|
withDiffOptions(
|
|
11755
|
-
|
|
12015
|
+
yargs43.positional("directory", {
|
|
11756
12016
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
11757
12017
|
type: "string"
|
|
11758
12018
|
}).option("mode", {
|
|
@@ -11854,10 +12114,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
11854
12114
|
command: "remove <id> <projectMapId>",
|
|
11855
12115
|
aliases: ["delete", "rm"],
|
|
11856
12116
|
describe: "Delete a project map node",
|
|
11857
|
-
builder: (
|
|
12117
|
+
builder: (yargs43) => withConfiguration(
|
|
11858
12118
|
withApiOptions(
|
|
11859
12119
|
withProjectOptions(
|
|
11860
|
-
|
|
12120
|
+
yargs43.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
11861
12121
|
)
|
|
11862
12122
|
)
|
|
11863
12123
|
),
|
|
@@ -11873,10 +12133,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
11873
12133
|
command: "update <filename> <projectMapId>",
|
|
11874
12134
|
aliases: ["put"],
|
|
11875
12135
|
describe: "Insert or update a project map node",
|
|
11876
|
-
builder: (
|
|
12136
|
+
builder: (yargs43) => withConfiguration(
|
|
11877
12137
|
withApiOptions(
|
|
11878
12138
|
withProjectOptions(
|
|
11879
|
-
|
|
12139
|
+
yargs43.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
11880
12140
|
)
|
|
11881
12141
|
)
|
|
11882
12142
|
),
|
|
@@ -11892,9 +12152,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
11892
12152
|
var ProjectMapNodeModule = {
|
|
11893
12153
|
command: "node <command>",
|
|
11894
12154
|
describe: "Commands for ProjectMap Nodes",
|
|
11895
|
-
builder: (
|
|
12155
|
+
builder: (yargs43) => yargs43.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
11896
12156
|
handler: () => {
|
|
11897
|
-
|
|
12157
|
+
yargs36.help();
|
|
11898
12158
|
}
|
|
11899
12159
|
};
|
|
11900
12160
|
|
|
@@ -11903,17 +12163,17 @@ var ProjectMapCommand = {
|
|
|
11903
12163
|
command: "project-map <command>",
|
|
11904
12164
|
aliases: ["prm"],
|
|
11905
12165
|
describe: "Uniform ProjectMap commands",
|
|
11906
|
-
builder: (
|
|
12166
|
+
builder: (yargs43) => yargs43.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
11907
12167
|
handler: () => {
|
|
11908
|
-
|
|
12168
|
+
yargs37.showHelp();
|
|
11909
12169
|
}
|
|
11910
12170
|
};
|
|
11911
12171
|
|
|
11912
12172
|
// src/commands/redirect/index.ts
|
|
11913
|
-
import
|
|
12173
|
+
import yargs39 from "yargs";
|
|
11914
12174
|
|
|
11915
12175
|
// src/commands/redirect/commands/redirect.ts
|
|
11916
|
-
import
|
|
12176
|
+
import yargs38 from "yargs";
|
|
11917
12177
|
|
|
11918
12178
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
11919
12179
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
@@ -11938,11 +12198,11 @@ function getRedirectClient(options) {
|
|
|
11938
12198
|
var RedirectDefinitionGetModule = {
|
|
11939
12199
|
command: "get <id>",
|
|
11940
12200
|
describe: "Fetch a redirect",
|
|
11941
|
-
builder: (
|
|
12201
|
+
builder: (yargs43) => withConfiguration(
|
|
11942
12202
|
withFormatOptions(
|
|
11943
12203
|
withApiOptions(
|
|
11944
12204
|
withProjectOptions(
|
|
11945
|
-
|
|
12205
|
+
yargs43.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
11946
12206
|
)
|
|
11947
12207
|
)
|
|
11948
12208
|
)
|
|
@@ -11965,7 +12225,7 @@ var RedirectDefinitionListModule = {
|
|
|
11965
12225
|
command: "list",
|
|
11966
12226
|
describe: "List of redirects",
|
|
11967
12227
|
aliases: ["ls"],
|
|
11968
|
-
builder: (
|
|
12228
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
11969
12229
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
11970
12230
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11971
12231
|
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -12017,12 +12277,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
12017
12277
|
var RedirectDefinitionPullModule = {
|
|
12018
12278
|
command: "pull <directory>",
|
|
12019
12279
|
describe: "Pulls all redirects to local files in a directory",
|
|
12020
|
-
builder: (
|
|
12280
|
+
builder: (yargs43) => withConfiguration(
|
|
12021
12281
|
withDebugOptions(
|
|
12022
12282
|
withApiOptions(
|
|
12023
12283
|
withProjectOptions(
|
|
12024
12284
|
withDiffOptions(
|
|
12025
|
-
|
|
12285
|
+
yargs43.positional("directory", {
|
|
12026
12286
|
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.",
|
|
12027
12287
|
type: "string"
|
|
12028
12288
|
}).option("format", {
|
|
@@ -12098,12 +12358,12 @@ var RedirectDefinitionPullModule = {
|
|
|
12098
12358
|
var RedirectDefinitionPushModule = {
|
|
12099
12359
|
command: "push <directory>",
|
|
12100
12360
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
12101
|
-
builder: (
|
|
12361
|
+
builder: (yargs43) => withConfiguration(
|
|
12102
12362
|
withDebugOptions(
|
|
12103
12363
|
withApiOptions(
|
|
12104
12364
|
withProjectOptions(
|
|
12105
12365
|
withDiffOptions(
|
|
12106
|
-
|
|
12366
|
+
yargs43.positional("directory", {
|
|
12107
12367
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
12108
12368
|
type: "string"
|
|
12109
12369
|
}).option("mode", {
|
|
@@ -12167,9 +12427,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
12167
12427
|
command: "remove <id>",
|
|
12168
12428
|
aliases: ["delete", "rm"],
|
|
12169
12429
|
describe: "Delete a redirect",
|
|
12170
|
-
builder: (
|
|
12430
|
+
builder: (yargs43) => withConfiguration(
|
|
12171
12431
|
withApiOptions(
|
|
12172
|
-
withProjectOptions(
|
|
12432
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
12173
12433
|
)
|
|
12174
12434
|
),
|
|
12175
12435
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -12184,10 +12444,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
12184
12444
|
command: "update <filename>",
|
|
12185
12445
|
aliases: ["put"],
|
|
12186
12446
|
describe: "Insert or update a redirect",
|
|
12187
|
-
builder: (
|
|
12447
|
+
builder: (yargs43) => withConfiguration(
|
|
12188
12448
|
withApiOptions(
|
|
12189
12449
|
withProjectOptions(
|
|
12190
|
-
|
|
12450
|
+
yargs43.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
12191
12451
|
)
|
|
12192
12452
|
)
|
|
12193
12453
|
),
|
|
@@ -12203,9 +12463,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
12203
12463
|
var RedirectDefinitionModule = {
|
|
12204
12464
|
command: "definition <command>",
|
|
12205
12465
|
describe: "Commands for Redirect Definitions",
|
|
12206
|
-
builder: (
|
|
12466
|
+
builder: (yargs43) => yargs43.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
12207
12467
|
handler: () => {
|
|
12208
|
-
|
|
12468
|
+
yargs38.help();
|
|
12209
12469
|
}
|
|
12210
12470
|
};
|
|
12211
12471
|
|
|
@@ -12214,14 +12474,14 @@ var RedirectCommand = {
|
|
|
12214
12474
|
command: "redirect <command>",
|
|
12215
12475
|
aliases: ["red"],
|
|
12216
12476
|
describe: "Uniform Redirect commands",
|
|
12217
|
-
builder: (
|
|
12477
|
+
builder: (yargs43) => yargs43.command(RedirectDefinitionModule).demandCommand(),
|
|
12218
12478
|
handler: () => {
|
|
12219
|
-
|
|
12479
|
+
yargs39.showHelp();
|
|
12220
12480
|
}
|
|
12221
12481
|
};
|
|
12222
12482
|
|
|
12223
12483
|
// src/commands/sync/index.ts
|
|
12224
|
-
import
|
|
12484
|
+
import yargs40 from "yargs";
|
|
12225
12485
|
|
|
12226
12486
|
// src/webhooksClient.ts
|
|
12227
12487
|
import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
|
|
@@ -12415,12 +12675,12 @@ function createWebhookEngineDataSource({
|
|
|
12415
12675
|
var WebhookPullModule = {
|
|
12416
12676
|
command: "pull <directory>",
|
|
12417
12677
|
describe: "Pulls all webhooks to local files in a directory",
|
|
12418
|
-
builder: (
|
|
12678
|
+
builder: (yargs43) => withConfiguration(
|
|
12419
12679
|
withApiOptions(
|
|
12420
12680
|
withDebugOptions(
|
|
12421
12681
|
withProjectOptions(
|
|
12422
12682
|
withDiffOptions(
|
|
12423
|
-
|
|
12683
|
+
yargs43.positional("directory", {
|
|
12424
12684
|
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.",
|
|
12425
12685
|
type: "string"
|
|
12426
12686
|
}).option("format", {
|
|
@@ -12606,11 +12866,12 @@ function numPad(num, spaces = 6) {
|
|
|
12606
12866
|
var SyncPullModule = {
|
|
12607
12867
|
command: "pull",
|
|
12608
12868
|
describe: "Pulls whole project to local files in a directory",
|
|
12609
|
-
builder: (
|
|
12869
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs43))))),
|
|
12610
12870
|
handler: async ({ serialization, ...otherParams }) => {
|
|
12611
12871
|
const config2 = serialization;
|
|
12612
12872
|
const enabledEntities = Object.entries({
|
|
12613
12873
|
locale: LocalePullModule,
|
|
12874
|
+
label: LabelPullModule,
|
|
12614
12875
|
asset: AssetPullModule,
|
|
12615
12876
|
category: CategoryPullModule,
|
|
12616
12877
|
workflow: WorkflowPullModule,
|
|
@@ -12705,12 +12966,12 @@ var getFormat = (entityType, config2) => {
|
|
|
12705
12966
|
var WebhookPushModule = {
|
|
12706
12967
|
command: "push <directory>",
|
|
12707
12968
|
describe: "Pushes all webhooks from files in a directory to Uniform",
|
|
12708
|
-
builder: (
|
|
12969
|
+
builder: (yargs43) => withConfiguration(
|
|
12709
12970
|
withDebugOptions(
|
|
12710
12971
|
withApiOptions(
|
|
12711
12972
|
withProjectOptions(
|
|
12712
12973
|
withDiffOptions(
|
|
12713
|
-
|
|
12974
|
+
yargs43.positional("directory", {
|
|
12714
12975
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
12715
12976
|
type: "string"
|
|
12716
12977
|
}).option("mode", {
|
|
@@ -12774,11 +13035,12 @@ var WebhookPushModule = {
|
|
|
12774
13035
|
var SyncPushModule = {
|
|
12775
13036
|
command: "push",
|
|
12776
13037
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
12777
|
-
builder: (
|
|
13038
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs43))))),
|
|
12778
13039
|
handler: async ({ serialization, ...otherParams }) => {
|
|
12779
13040
|
const config2 = serialization;
|
|
12780
13041
|
const enabledEntities = Object.entries({
|
|
12781
13042
|
locale: LocalePushModule,
|
|
13043
|
+
label: LabelPushModule,
|
|
12782
13044
|
asset: AssetPushModule,
|
|
12783
13045
|
category: CategoryPushModule,
|
|
12784
13046
|
workflow: WorkflowPushModule,
|
|
@@ -12984,21 +13246,21 @@ var getFormat2 = (entityType, config2) => {
|
|
|
12984
13246
|
var SyncCommand = {
|
|
12985
13247
|
command: "sync <command>",
|
|
12986
13248
|
describe: "Uniform Sync commands",
|
|
12987
|
-
builder: (
|
|
13249
|
+
builder: (yargs43) => yargs43.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
12988
13250
|
handler: () => {
|
|
12989
|
-
|
|
13251
|
+
yargs40.showHelp();
|
|
12990
13252
|
}
|
|
12991
13253
|
};
|
|
12992
13254
|
|
|
12993
13255
|
// src/commands/webhook/index.ts
|
|
12994
|
-
import
|
|
13256
|
+
import yargs41 from "yargs";
|
|
12995
13257
|
var WebhookCommand = {
|
|
12996
13258
|
command: "webhook <command>",
|
|
12997
13259
|
aliases: ["wh"],
|
|
12998
13260
|
describe: "Commands for webhooks",
|
|
12999
|
-
builder: (
|
|
13261
|
+
builder: (yargs43) => yargs43.command(WebhookPullModule).command(WebhookPushModule).demandCommand(),
|
|
13000
13262
|
handler: () => {
|
|
13001
|
-
|
|
13263
|
+
yargs41.help();
|
|
13002
13264
|
}
|
|
13003
13265
|
};
|
|
13004
13266
|
|
|
@@ -13233,7 +13495,7 @@ First found was: v${firstVersion}`;
|
|
|
13233
13495
|
|
|
13234
13496
|
// src/index.ts
|
|
13235
13497
|
dotenv.config();
|
|
13236
|
-
var yarggery =
|
|
13498
|
+
var yarggery = yargs42(hideBin(process.argv));
|
|
13237
13499
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
13238
13500
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
13239
13501
|
yarggery.option("verbose", {
|