@uniformdev/cli 20.46.1-alpha.9 → 20.47.1-alpha.3
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/LICENSE.txt +1 -1
- package/dist/index.mjs +774 -430
- package/package.json +12 -12
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 yargs41 from "yargs";
|
|
24
24
|
import { hideBin } from "yargs/helpers";
|
|
25
25
|
|
|
26
26
|
// src/commands/ai/index.ts
|
|
@@ -72,7 +72,7 @@ async function getBearerToken(baseUrl) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/client.ts
|
|
75
|
-
import * as z from "zod";
|
|
75
|
+
import * as z from "zod/v3";
|
|
76
76
|
|
|
77
77
|
// src/auth/api-key.ts
|
|
78
78
|
var READ_PERMISSIONS = ["PROJECT", "UPM_PUB", "OPT_PUB", "OPT_READ", "UPM_READ"];
|
|
@@ -324,8 +324,8 @@ async function readJSON(path8) {
|
|
|
324
324
|
}
|
|
325
325
|
async function tryReadJSON(path8, missingValue = null) {
|
|
326
326
|
try {
|
|
327
|
-
const
|
|
328
|
-
return
|
|
327
|
+
const stat2 = await fs.stat(path8);
|
|
328
|
+
return stat2.isFile() ? await readJSON(path8) : missingValue;
|
|
329
329
|
} catch {
|
|
330
330
|
return missingValue;
|
|
331
331
|
}
|
|
@@ -503,20 +503,20 @@ var makeSpinner = () => {
|
|
|
503
503
|
async function createArraySyncEngineDataSource({
|
|
504
504
|
name,
|
|
505
505
|
objects,
|
|
506
|
-
selectIdentifier:
|
|
507
|
-
selectDisplayName:
|
|
506
|
+
selectIdentifier: selectIdentifier18,
|
|
507
|
+
selectDisplayName: selectDisplayName18 = selectIdentifier18,
|
|
508
508
|
onSyncComplete,
|
|
509
509
|
onBeforeDeleteObject
|
|
510
510
|
}) {
|
|
511
511
|
const objectIndex = objects.reduce(
|
|
512
512
|
(result, current) => {
|
|
513
|
-
const rawIdentifiers =
|
|
513
|
+
const rawIdentifiers = selectIdentifier18(current);
|
|
514
514
|
const identifiers = Array.isArray(rawIdentifiers) ? rawIdentifiers : [rawIdentifiers];
|
|
515
515
|
const existingResult = identifiers.find((id) => result[id]);
|
|
516
516
|
if (existingResult) {
|
|
517
517
|
throw new Error(`Identifier(s) ${identifiers} was not unique.`);
|
|
518
518
|
}
|
|
519
|
-
const displayName =
|
|
519
|
+
const displayName = selectDisplayName18(current);
|
|
520
520
|
result[identifiers[0]] = {
|
|
521
521
|
id: identifiers,
|
|
522
522
|
object: current,
|
|
@@ -546,7 +546,7 @@ async function createArraySyncEngineDataSource({
|
|
|
546
546
|
delete objectIndex[providerId];
|
|
547
547
|
},
|
|
548
548
|
writeObject: async (objectToWrite) => {
|
|
549
|
-
const id =
|
|
549
|
+
const id = selectIdentifier18(objectToWrite.object);
|
|
550
550
|
if (Array.isArray(id)) {
|
|
551
551
|
objectIndex[id[0]] = objectToWrite;
|
|
552
552
|
} else {
|
|
@@ -626,8 +626,8 @@ export default uniformConfig({
|
|
|
626
626
|
async function createFileSyncEngineDataSource({
|
|
627
627
|
directory,
|
|
628
628
|
format = "yaml",
|
|
629
|
-
selectIdentifier:
|
|
630
|
-
selectDisplayName:
|
|
629
|
+
selectIdentifier: selectIdentifier18,
|
|
630
|
+
selectDisplayName: selectDisplayName18 = selectIdentifier18,
|
|
631
631
|
selectFilename: selectFilename3,
|
|
632
632
|
selectSchemaUrl: selectSchemaUrl2,
|
|
633
633
|
onBeforeDeleteObject,
|
|
@@ -656,9 +656,9 @@ async function createFileSyncEngineDataSource({
|
|
|
656
656
|
const fullFilename = join(directory, filename);
|
|
657
657
|
try {
|
|
658
658
|
const contents = readFileToObject(fullFilename);
|
|
659
|
-
const displayName =
|
|
659
|
+
const displayName = selectDisplayName18(contents);
|
|
660
660
|
const object4 = {
|
|
661
|
-
id:
|
|
661
|
+
id: selectIdentifier18(contents),
|
|
662
662
|
displayName: Array.isArray(displayName) ? displayName[0] : displayName,
|
|
663
663
|
providerId: fullFilename,
|
|
664
664
|
object: omit(contents, ["$schema"])
|
|
@@ -1043,7 +1043,7 @@ async function chooseTeam(user, prompt, telemetry) {
|
|
|
1043
1043
|
|
|
1044
1044
|
// src/auth/user-info.ts
|
|
1045
1045
|
import { gql, request } from "graphql-request";
|
|
1046
|
-
import * as z2 from "zod";
|
|
1046
|
+
import * as z2 from "zod/v3";
|
|
1047
1047
|
var query = gql`
|
|
1048
1048
|
query GetUserInfo($subject: String!) {
|
|
1049
1049
|
info: identities_by_pk(subject: $subject) {
|
|
@@ -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.47.0",
|
|
1128
1128
|
description: "Uniform command line interface tool",
|
|
1129
1129
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
1130
1130
|
main: "./cli.js",
|
|
@@ -1174,20 +1174,20 @@ var package_default = {
|
|
|
1174
1174
|
"image-size": "^1.2.1",
|
|
1175
1175
|
"isomorphic-git": "1.35.0",
|
|
1176
1176
|
"js-yaml": "^4.1.0",
|
|
1177
|
-
jsonwebtoken: "9.0.
|
|
1177
|
+
jsonwebtoken: "9.0.3",
|
|
1178
1178
|
mitt: "^3.0.1",
|
|
1179
1179
|
"normalize-newline": "^4.1.0",
|
|
1180
1180
|
open: "10.2.0",
|
|
1181
1181
|
ora: "8.0.1",
|
|
1182
1182
|
"p-queue": "7.3.4",
|
|
1183
|
-
"posthog-node": "
|
|
1183
|
+
"posthog-node": "5.10.3",
|
|
1184
1184
|
"registry-auth-token": "^5.0.0",
|
|
1185
1185
|
"registry-url": "^6.0.0",
|
|
1186
1186
|
slugify: "1.6.6",
|
|
1187
1187
|
svix: "^1.71.0",
|
|
1188
1188
|
undici: "^7.16.0",
|
|
1189
1189
|
yargs: "^17.6.2",
|
|
1190
|
-
zod: "3.
|
|
1190
|
+
zod: "3.25.76"
|
|
1191
1191
|
},
|
|
1192
1192
|
devDependencies: {
|
|
1193
1193
|
"@types/diff": "5.0.9",
|
|
@@ -1407,8 +1407,8 @@ function getExistingServers(config2) {
|
|
|
1407
1407
|
var InstallMcpCommand = {
|
|
1408
1408
|
command: "install",
|
|
1409
1409
|
describe: "Install Uniform MCP server configuration (use --team, --project, and --apiKey for non-interactive mode)",
|
|
1410
|
-
builder: (
|
|
1411
|
-
|
|
1410
|
+
builder: (yargs42) => withConfiguration(
|
|
1411
|
+
yargs42.option("agent", {
|
|
1412
1412
|
alias: "a",
|
|
1413
1413
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
1414
1414
|
type: "string",
|
|
@@ -1608,7 +1608,7 @@ Selected agent: ${agentType}`));
|
|
|
1608
1608
|
var McpCommand = {
|
|
1609
1609
|
command: "mcp <command>",
|
|
1610
1610
|
describe: "Uniform MCP server management commands",
|
|
1611
|
-
builder: (
|
|
1611
|
+
builder: (yargs42) => yargs42.command(InstallMcpCommand).demandCommand(),
|
|
1612
1612
|
handler: () => {
|
|
1613
1613
|
yargs.showHelp();
|
|
1614
1614
|
}
|
|
@@ -2083,8 +2083,8 @@ ${gray2("Rules source:")} https://github.com/uniformdev/ai-rules`);
|
|
|
2083
2083
|
var InstallRulesCommand = {
|
|
2084
2084
|
command: "install",
|
|
2085
2085
|
describe: "Install Uniform AI rules for your development assistant",
|
|
2086
|
-
builder: (
|
|
2087
|
-
|
|
2086
|
+
builder: (yargs42) => withConfiguration(
|
|
2087
|
+
yargs42.option("agent", {
|
|
2088
2088
|
alias: "a",
|
|
2089
2089
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
2090
2090
|
type: "string",
|
|
@@ -2122,7 +2122,7 @@ import { blue as blue4, bold as bold2, gray as gray3, green as green5, red as re
|
|
|
2122
2122
|
var ListRulesCommand = {
|
|
2123
2123
|
command: "list",
|
|
2124
2124
|
describe: "List available Uniform AI rules",
|
|
2125
|
-
builder: (
|
|
2125
|
+
builder: (yargs42) => withConfiguration(yargs42),
|
|
2126
2126
|
handler: async function() {
|
|
2127
2127
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
2128
2128
|
try {
|
|
@@ -2151,7 +2151,7 @@ var ListRulesCommand = {
|
|
|
2151
2151
|
var RulesCommand = {
|
|
2152
2152
|
command: "rules <command>",
|
|
2153
2153
|
describe: "Uniform AI rules management commands",
|
|
2154
|
-
builder: (
|
|
2154
|
+
builder: (yargs42) => yargs42.command(InstallRulesCommand).command(ListRulesCommand).demandCommand(),
|
|
2155
2155
|
handler: () => {
|
|
2156
2156
|
yargs2.showHelp();
|
|
2157
2157
|
}
|
|
@@ -2161,7 +2161,7 @@ var RulesCommand = {
|
|
|
2161
2161
|
var AiCommand = {
|
|
2162
2162
|
command: "ai <command>",
|
|
2163
2163
|
describe: "Uniform AI development assistant commands",
|
|
2164
|
-
builder: (
|
|
2164
|
+
builder: (yargs42) => yargs42.command(RulesCommand).command(McpCommand).demandCommand(),
|
|
2165
2165
|
handler: () => {
|
|
2166
2166
|
yargs3.showHelp();
|
|
2167
2167
|
}
|
|
@@ -2200,12 +2200,12 @@ function getFileClient(options) {
|
|
|
2200
2200
|
var AssetGetModule = {
|
|
2201
2201
|
command: "get <id>",
|
|
2202
2202
|
describe: "Get an asset",
|
|
2203
|
-
builder: (
|
|
2203
|
+
builder: (yargs42) => withConfiguration(
|
|
2204
2204
|
withDebugOptions(
|
|
2205
2205
|
withFormatOptions(
|
|
2206
2206
|
withApiOptions(
|
|
2207
2207
|
withProjectOptions(
|
|
2208
|
-
|
|
2208
|
+
yargs42.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
2209
2209
|
)
|
|
2210
2210
|
)
|
|
2211
2211
|
)
|
|
@@ -2226,7 +2226,7 @@ var AssetGetModule = {
|
|
|
2226
2226
|
var AssetListModule = {
|
|
2227
2227
|
command: "list",
|
|
2228
2228
|
describe: "List assets",
|
|
2229
|
-
builder: (
|
|
2229
|
+
builder: (yargs42) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs42))))),
|
|
2230
2230
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
2231
2231
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2232
2232
|
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -2779,8 +2779,8 @@ function prepCompositionForDisk(composition) {
|
|
|
2779
2779
|
delete prepped.state;
|
|
2780
2780
|
return prepped;
|
|
2781
2781
|
}
|
|
2782
|
-
function withStateOptions(
|
|
2783
|
-
return
|
|
2782
|
+
function withStateOptions(yargs42, defaultState = "preview") {
|
|
2783
|
+
return yargs42.option("state", {
|
|
2784
2784
|
type: "string",
|
|
2785
2785
|
describe: `State to fetch.`,
|
|
2786
2786
|
choices: ["preview", "published"],
|
|
@@ -2862,12 +2862,12 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
2862
2862
|
var AssetPullModule = {
|
|
2863
2863
|
command: "pull <directory>",
|
|
2864
2864
|
describe: "Pulls all assets to local files in a directory",
|
|
2865
|
-
builder: (
|
|
2865
|
+
builder: (yargs42) => withConfiguration(
|
|
2866
2866
|
withApiOptions(
|
|
2867
2867
|
withDebugOptions(
|
|
2868
2868
|
withProjectOptions(
|
|
2869
2869
|
withDiffOptions(
|
|
2870
|
-
|
|
2870
|
+
yargs42.positional("directory", {
|
|
2871
2871
|
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.",
|
|
2872
2872
|
type: "string"
|
|
2873
2873
|
}).option("format", {
|
|
@@ -2979,12 +2979,12 @@ var AssetPullModule = {
|
|
|
2979
2979
|
var AssetPushModule = {
|
|
2980
2980
|
command: "push <directory>",
|
|
2981
2981
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
2982
|
-
builder: (
|
|
2982
|
+
builder: (yargs42) => withConfiguration(
|
|
2983
2983
|
withApiOptions(
|
|
2984
2984
|
withDebugOptions(
|
|
2985
2985
|
withProjectOptions(
|
|
2986
2986
|
withDiffOptions(
|
|
2987
|
-
|
|
2987
|
+
yargs42.positional("directory", {
|
|
2988
2988
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
2989
2989
|
type: "string"
|
|
2990
2990
|
}).option("mode", {
|
|
@@ -3108,10 +3108,10 @@ var AssetRemoveModule = {
|
|
|
3108
3108
|
command: "remove <id>",
|
|
3109
3109
|
aliases: ["delete", "rm"],
|
|
3110
3110
|
describe: "Delete an asset",
|
|
3111
|
-
builder: (
|
|
3111
|
+
builder: (yargs42) => withConfiguration(
|
|
3112
3112
|
withDebugOptions(
|
|
3113
3113
|
withApiOptions(
|
|
3114
|
-
withProjectOptions(
|
|
3114
|
+
withProjectOptions(yargs42.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
3115
3115
|
)
|
|
3116
3116
|
)
|
|
3117
3117
|
),
|
|
@@ -3132,11 +3132,11 @@ var AssetUpdateModule = {
|
|
|
3132
3132
|
command: "update <filename>",
|
|
3133
3133
|
aliases: ["put"],
|
|
3134
3134
|
describe: "Insert or update an asset",
|
|
3135
|
-
builder: (
|
|
3135
|
+
builder: (yargs42) => withConfiguration(
|
|
3136
3136
|
withDebugOptions(
|
|
3137
3137
|
withApiOptions(
|
|
3138
3138
|
withProjectOptions(
|
|
3139
|
-
|
|
3139
|
+
yargs42.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
3140
3140
|
)
|
|
3141
3141
|
)
|
|
3142
3142
|
)
|
|
@@ -3162,7 +3162,7 @@ var AssetUpdateModule = {
|
|
|
3162
3162
|
var AssetModule = {
|
|
3163
3163
|
command: "asset <command>",
|
|
3164
3164
|
describe: "Commands for Assets",
|
|
3165
|
-
builder: (
|
|
3165
|
+
builder: (yargs42) => yargs42.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
3166
3166
|
handler: () => {
|
|
3167
3167
|
yargs4.help();
|
|
3168
3168
|
}
|
|
@@ -3183,12 +3183,12 @@ function getCategoryClient(options) {
|
|
|
3183
3183
|
var CategoryGetModule = {
|
|
3184
3184
|
command: "get <id>",
|
|
3185
3185
|
describe: "Fetch a category",
|
|
3186
|
-
builder: (
|
|
3186
|
+
builder: (yargs42) => withConfiguration(
|
|
3187
3187
|
withFormatOptions(
|
|
3188
3188
|
withDebugOptions(
|
|
3189
3189
|
withApiOptions(
|
|
3190
3190
|
withProjectOptions(
|
|
3191
|
-
|
|
3191
|
+
yargs42.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
3192
3192
|
)
|
|
3193
3193
|
)
|
|
3194
3194
|
)
|
|
@@ -3213,8 +3213,8 @@ var CategoryListModule = {
|
|
|
3213
3213
|
command: "list",
|
|
3214
3214
|
describe: "List categories",
|
|
3215
3215
|
aliases: ["ls"],
|
|
3216
|
-
builder: (
|
|
3217
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
3216
|
+
builder: (yargs42) => withConfiguration(
|
|
3217
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs42.options({})))))
|
|
3218
3218
|
),
|
|
3219
3219
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3220
3220
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -3258,12 +3258,12 @@ function createCategoriesEngineDataSource({
|
|
|
3258
3258
|
var CategoryPullModule = {
|
|
3259
3259
|
command: "pull <directory>",
|
|
3260
3260
|
describe: "Pulls all categories to local files in a directory",
|
|
3261
|
-
builder: (
|
|
3261
|
+
builder: (yargs42) => withConfiguration(
|
|
3262
3262
|
withApiOptions(
|
|
3263
3263
|
withProjectOptions(
|
|
3264
3264
|
withDiffOptions(
|
|
3265
3265
|
withDebugOptions(
|
|
3266
|
-
|
|
3266
|
+
yargs42.positional("directory", {
|
|
3267
3267
|
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.",
|
|
3268
3268
|
type: "string"
|
|
3269
3269
|
}).option("format", {
|
|
@@ -3338,12 +3338,12 @@ var CategoryPullModule = {
|
|
|
3338
3338
|
var CategoryPushModule = {
|
|
3339
3339
|
command: "push <directory>",
|
|
3340
3340
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
3341
|
-
builder: (
|
|
3341
|
+
builder: (yargs42) => withConfiguration(
|
|
3342
3342
|
withApiOptions(
|
|
3343
3343
|
withDebugOptions(
|
|
3344
3344
|
withProjectOptions(
|
|
3345
3345
|
withDiffOptions(
|
|
3346
|
-
|
|
3346
|
+
yargs42.positional("directory", {
|
|
3347
3347
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
3348
3348
|
type: "string"
|
|
3349
3349
|
}).option("mode", {
|
|
@@ -3407,11 +3407,11 @@ var CategoryRemoveModule = {
|
|
|
3407
3407
|
command: "remove <id>",
|
|
3408
3408
|
aliases: ["delete", "rm"],
|
|
3409
3409
|
describe: "Delete a category",
|
|
3410
|
-
builder: (
|
|
3410
|
+
builder: (yargs42) => withConfiguration(
|
|
3411
3411
|
withApiOptions(
|
|
3412
3412
|
withDebugOptions(
|
|
3413
3413
|
withProjectOptions(
|
|
3414
|
-
|
|
3414
|
+
yargs42.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
3415
3415
|
)
|
|
3416
3416
|
)
|
|
3417
3417
|
)
|
|
@@ -3432,11 +3432,11 @@ var CategoryUpdateModule = {
|
|
|
3432
3432
|
command: "update <filename>",
|
|
3433
3433
|
aliases: ["put"],
|
|
3434
3434
|
describe: "Insert or update a category",
|
|
3435
|
-
builder: (
|
|
3435
|
+
builder: (yargs42) => withConfiguration(
|
|
3436
3436
|
withApiOptions(
|
|
3437
3437
|
withDebugOptions(
|
|
3438
3438
|
withProjectOptions(
|
|
3439
|
-
|
|
3439
|
+
yargs42.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
3440
3440
|
)
|
|
3441
3441
|
)
|
|
3442
3442
|
)
|
|
@@ -3458,7 +3458,7 @@ var CategoryModule = {
|
|
|
3458
3458
|
command: "category <command>",
|
|
3459
3459
|
aliases: ["cat"],
|
|
3460
3460
|
describe: "Commands for Canvas categories",
|
|
3461
|
-
builder: (
|
|
3461
|
+
builder: (yargs42) => yargs42.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
3462
3462
|
handler: () => {
|
|
3463
3463
|
yargs5.help();
|
|
3464
3464
|
}
|
|
@@ -3480,12 +3480,12 @@ function getCanvasClient(options) {
|
|
|
3480
3480
|
var ComponentGetModule = {
|
|
3481
3481
|
command: "get <id>",
|
|
3482
3482
|
describe: "Fetch a component definition",
|
|
3483
|
-
builder: (
|
|
3483
|
+
builder: (yargs42) => withConfiguration(
|
|
3484
3484
|
withFormatOptions(
|
|
3485
3485
|
withDebugOptions(
|
|
3486
3486
|
withApiOptions(
|
|
3487
3487
|
withProjectOptions(
|
|
3488
|
-
|
|
3488
|
+
yargs42.positional("id", {
|
|
3489
3489
|
demandOption: true,
|
|
3490
3490
|
describe: "Component definition public ID to fetch"
|
|
3491
3491
|
})
|
|
@@ -3519,12 +3519,12 @@ var ComponentListModule = {
|
|
|
3519
3519
|
command: "list",
|
|
3520
3520
|
describe: "List component definitions",
|
|
3521
3521
|
aliases: ["ls"],
|
|
3522
|
-
builder: (
|
|
3522
|
+
builder: (yargs42) => withConfiguration(
|
|
3523
3523
|
withFormatOptions(
|
|
3524
3524
|
withDebugOptions(
|
|
3525
3525
|
withApiOptions(
|
|
3526
3526
|
withProjectOptions(
|
|
3527
|
-
|
|
3527
|
+
yargs42.options({
|
|
3528
3528
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3529
3529
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
3530
3530
|
})
|
|
@@ -3593,12 +3593,12 @@ function createComponentDefinitionEngineDataSource({
|
|
|
3593
3593
|
var ComponentPullModule = {
|
|
3594
3594
|
command: "pull <directory>",
|
|
3595
3595
|
describe: "Pulls all component definitions to local files in a directory",
|
|
3596
|
-
builder: (
|
|
3596
|
+
builder: (yargs42) => withConfiguration(
|
|
3597
3597
|
withApiOptions(
|
|
3598
3598
|
withDebugOptions(
|
|
3599
3599
|
withProjectOptions(
|
|
3600
3600
|
withDiffOptions(
|
|
3601
|
-
|
|
3601
|
+
yargs42.positional("directory", {
|
|
3602
3602
|
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.",
|
|
3603
3603
|
type: "string"
|
|
3604
3604
|
}).option("format", {
|
|
@@ -3674,12 +3674,12 @@ var ComponentPullModule = {
|
|
|
3674
3674
|
var ComponentPushModule = {
|
|
3675
3675
|
command: "push <directory>",
|
|
3676
3676
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
3677
|
-
builder: (
|
|
3677
|
+
builder: (yargs42) => withConfiguration(
|
|
3678
3678
|
withApiOptions(
|
|
3679
3679
|
withDebugOptions(
|
|
3680
3680
|
withProjectOptions(
|
|
3681
3681
|
withDiffOptions(
|
|
3682
|
-
|
|
3682
|
+
yargs42.positional("directory", {
|
|
3683
3683
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
3684
3684
|
type: "string"
|
|
3685
3685
|
}).option("mode", {
|
|
@@ -3744,11 +3744,11 @@ var ComponentRemoveModule = {
|
|
|
3744
3744
|
command: "remove <id>",
|
|
3745
3745
|
aliases: ["delete", "rm"],
|
|
3746
3746
|
describe: "Delete a component definition",
|
|
3747
|
-
builder: (
|
|
3747
|
+
builder: (yargs42) => withConfiguration(
|
|
3748
3748
|
withDebugOptions(
|
|
3749
3749
|
withApiOptions(
|
|
3750
3750
|
withProjectOptions(
|
|
3751
|
-
|
|
3751
|
+
yargs42.positional("id", {
|
|
3752
3752
|
demandOption: true,
|
|
3753
3753
|
describe: "Component definition public ID to delete"
|
|
3754
3754
|
})
|
|
@@ -3772,11 +3772,11 @@ var ComponentUpdateModule = {
|
|
|
3772
3772
|
command: "update <filename>",
|
|
3773
3773
|
aliases: ["put"],
|
|
3774
3774
|
describe: "Insert or update a component definition",
|
|
3775
|
-
builder: (
|
|
3775
|
+
builder: (yargs42) => withConfiguration(
|
|
3776
3776
|
withApiOptions(
|
|
3777
3777
|
withDebugOptions(
|
|
3778
3778
|
withProjectOptions(
|
|
3779
|
-
|
|
3779
|
+
yargs42.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
3780
3780
|
)
|
|
3781
3781
|
)
|
|
3782
3782
|
)
|
|
@@ -3798,7 +3798,7 @@ var ComponentModule = {
|
|
|
3798
3798
|
command: "component <command>",
|
|
3799
3799
|
aliases: ["def"],
|
|
3800
3800
|
describe: "Commands for Canvas component definitions",
|
|
3801
|
-
builder: (
|
|
3801
|
+
builder: (yargs42) => yargs42.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
3802
3802
|
handler: () => {
|
|
3803
3803
|
yargs6.help();
|
|
3804
3804
|
}
|
|
@@ -3811,13 +3811,13 @@ import yargs7 from "yargs";
|
|
|
3811
3811
|
var CompositionGetModule = {
|
|
3812
3812
|
command: "get <id>",
|
|
3813
3813
|
describe: "Fetch a composition",
|
|
3814
|
-
builder: (
|
|
3814
|
+
builder: (yargs42) => withFormatOptions(
|
|
3815
3815
|
withConfiguration(
|
|
3816
3816
|
withApiOptions(
|
|
3817
3817
|
withProjectOptions(
|
|
3818
3818
|
withStateOptions(
|
|
3819
3819
|
withDebugOptions(
|
|
3820
|
-
|
|
3820
|
+
yargs42.positional("id", {
|
|
3821
3821
|
demandOption: true,
|
|
3822
3822
|
describe: "Composition/pattern public ID to fetch"
|
|
3823
3823
|
}).option({
|
|
@@ -3907,13 +3907,13 @@ var CompositionListModule = {
|
|
|
3907
3907
|
command: "list",
|
|
3908
3908
|
describe: "List compositions",
|
|
3909
3909
|
aliases: ["ls"],
|
|
3910
|
-
builder: (
|
|
3910
|
+
builder: (yargs42) => withFormatOptions(
|
|
3911
3911
|
withConfiguration(
|
|
3912
3912
|
withApiOptions(
|
|
3913
3913
|
withProjectOptions(
|
|
3914
3914
|
withDebugOptions(
|
|
3915
3915
|
withStateOptions(
|
|
3916
|
-
|
|
3916
|
+
yargs42.options({
|
|
3917
3917
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3918
3918
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3919
3919
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -3994,13 +3994,13 @@ var CompositionListModule = {
|
|
|
3994
3994
|
var ComponentPatternListModule = {
|
|
3995
3995
|
...CompositionListModule,
|
|
3996
3996
|
describe: "List component patterns",
|
|
3997
|
-
builder: (
|
|
3997
|
+
builder: (yargs42) => withFormatOptions(
|
|
3998
3998
|
withConfiguration(
|
|
3999
3999
|
withApiOptions(
|
|
4000
4000
|
withDebugOptions(
|
|
4001
4001
|
withProjectOptions(
|
|
4002
4002
|
withStateOptions(
|
|
4003
|
-
|
|
4003
|
+
yargs42.options({
|
|
4004
4004
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4005
4005
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4006
4006
|
resolvePatterns: {
|
|
@@ -4123,12 +4123,12 @@ function createComponentInstanceEngineDataSource({
|
|
|
4123
4123
|
var CompositionPublishModule = {
|
|
4124
4124
|
command: "publish [ids]",
|
|
4125
4125
|
describe: "Publishes composition(s)",
|
|
4126
|
-
builder: (
|
|
4126
|
+
builder: (yargs42) => withConfiguration(
|
|
4127
4127
|
withApiOptions(
|
|
4128
4128
|
withProjectOptions(
|
|
4129
4129
|
withDebugOptions(
|
|
4130
4130
|
withDiffOptions(
|
|
4131
|
-
|
|
4131
|
+
yargs42.positional("ids", {
|
|
4132
4132
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4133
4133
|
type: "string"
|
|
4134
4134
|
}).option("all", {
|
|
@@ -4221,12 +4221,12 @@ var CompositionPublishModule = {
|
|
|
4221
4221
|
var ComponentPatternPublishModule = {
|
|
4222
4222
|
...CompositionPublishModule,
|
|
4223
4223
|
describe: "Publishes component pattern(s)",
|
|
4224
|
-
builder: (
|
|
4224
|
+
builder: (yargs42) => withConfiguration(
|
|
4225
4225
|
withApiOptions(
|
|
4226
4226
|
withDebugOptions(
|
|
4227
4227
|
withProjectOptions(
|
|
4228
4228
|
withDiffOptions(
|
|
4229
|
-
|
|
4229
|
+
yargs42.positional("ids", {
|
|
4230
4230
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4231
4231
|
type: "string"
|
|
4232
4232
|
}).option("all", {
|
|
@@ -4266,13 +4266,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4266
4266
|
return {
|
|
4267
4267
|
command: "pull <directory>",
|
|
4268
4268
|
describe: "Pulls all compositions to local files in a directory",
|
|
4269
|
-
builder: (
|
|
4269
|
+
builder: (yargs42) => withConfiguration(
|
|
4270
4270
|
withApiOptions(
|
|
4271
4271
|
withProjectOptions(
|
|
4272
4272
|
withStateOptions(
|
|
4273
4273
|
withDebugOptions(
|
|
4274
4274
|
withDiffOptions(
|
|
4275
|
-
|
|
4275
|
+
yargs42.positional("directory", {
|
|
4276
4276
|
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.",
|
|
4277
4277
|
type: "string"
|
|
4278
4278
|
}).option("format", {
|
|
@@ -4387,13 +4387,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4387
4387
|
var ComponentPatternPullModule = {
|
|
4388
4388
|
...componentInstancePullModuleFactory("componentPatterns"),
|
|
4389
4389
|
describe: "Pulls all component patterns to local files in a directory",
|
|
4390
|
-
builder: (
|
|
4390
|
+
builder: (yargs42) => withConfiguration(
|
|
4391
4391
|
withApiOptions(
|
|
4392
4392
|
withProjectOptions(
|
|
4393
4393
|
withDebugOptions(
|
|
4394
4394
|
withStateOptions(
|
|
4395
4395
|
withDiffOptions(
|
|
4396
|
-
|
|
4396
|
+
yargs42.positional("directory", {
|
|
4397
4397
|
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.",
|
|
4398
4398
|
type: "string"
|
|
4399
4399
|
}).option("format", {
|
|
@@ -4467,13 +4467,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4467
4467
|
return {
|
|
4468
4468
|
command: "push <directory>",
|
|
4469
4469
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
4470
|
-
builder: (
|
|
4470
|
+
builder: (yargs42) => withConfiguration(
|
|
4471
4471
|
withApiOptions(
|
|
4472
4472
|
withProjectOptions(
|
|
4473
4473
|
withStateOptions(
|
|
4474
4474
|
withDebugOptions(
|
|
4475
4475
|
withDiffOptions(
|
|
4476
|
-
|
|
4476
|
+
yargs42.positional("directory", {
|
|
4477
4477
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
4478
4478
|
type: "string"
|
|
4479
4479
|
}).option("mode", {
|
|
@@ -4587,13 +4587,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4587
4587
|
var ComponentPatternPushModule = {
|
|
4588
4588
|
...componentInstancePushModuleFactory("componentPatterns"),
|
|
4589
4589
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
4590
|
-
builder: (
|
|
4590
|
+
builder: (yargs42) => withConfiguration(
|
|
4591
4591
|
withApiOptions(
|
|
4592
4592
|
withProjectOptions(
|
|
4593
4593
|
withStateOptions(
|
|
4594
4594
|
withDiffOptions(
|
|
4595
4595
|
withDebugOptions(
|
|
4596
|
-
|
|
4596
|
+
yargs42.positional("directory", {
|
|
4597
4597
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
4598
4598
|
type: "string"
|
|
4599
4599
|
}).option("mode", {
|
|
@@ -4627,11 +4627,11 @@ var CompositionRemoveModule = {
|
|
|
4627
4627
|
command: "remove <id>",
|
|
4628
4628
|
aliases: ["delete", "rm"],
|
|
4629
4629
|
describe: "Delete a composition",
|
|
4630
|
-
builder: (
|
|
4630
|
+
builder: (yargs42) => withConfiguration(
|
|
4631
4631
|
withApiOptions(
|
|
4632
4632
|
withDebugOptions(
|
|
4633
4633
|
withProjectOptions(
|
|
4634
|
-
|
|
4634
|
+
yargs42.positional("id", {
|
|
4635
4635
|
demandOption: true,
|
|
4636
4636
|
describe: "Composition/pattern public ID to delete"
|
|
4637
4637
|
})
|
|
@@ -4665,11 +4665,11 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
4665
4665
|
var CompositionUnpublishModule = {
|
|
4666
4666
|
command: "unpublish [ids]",
|
|
4667
4667
|
describe: "Unpublish a composition(s)",
|
|
4668
|
-
builder: (
|
|
4668
|
+
builder: (yargs42) => withConfiguration(
|
|
4669
4669
|
withApiOptions(
|
|
4670
4670
|
withDebugOptions(
|
|
4671
4671
|
withProjectOptions(
|
|
4672
|
-
|
|
4672
|
+
yargs42.positional("ids", {
|
|
4673
4673
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4674
4674
|
type: "string"
|
|
4675
4675
|
}).option("all", {
|
|
@@ -4766,11 +4766,11 @@ var CompositionUnpublishModule = {
|
|
|
4766
4766
|
var ComponentPatternUnpublishModule = {
|
|
4767
4767
|
command: "unpublish [ids]",
|
|
4768
4768
|
describe: "Unpublish a component pattern(s)",
|
|
4769
|
-
builder: (
|
|
4769
|
+
builder: (yargs42) => withConfiguration(
|
|
4770
4770
|
withApiOptions(
|
|
4771
4771
|
withDebugOptions(
|
|
4772
4772
|
withProjectOptions(
|
|
4773
|
-
|
|
4773
|
+
yargs42.positional("ids", {
|
|
4774
4774
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4775
4775
|
type: "string"
|
|
4776
4776
|
}).option("all", {
|
|
@@ -4804,12 +4804,12 @@ var CompositionUpdateModule = {
|
|
|
4804
4804
|
command: "update <filename>",
|
|
4805
4805
|
aliases: ["put"],
|
|
4806
4806
|
describe: "Insert or update a composition",
|
|
4807
|
-
builder: (
|
|
4807
|
+
builder: (yargs42) => withConfiguration(
|
|
4808
4808
|
withApiOptions(
|
|
4809
4809
|
withProjectOptions(
|
|
4810
4810
|
withDebugOptions(
|
|
4811
4811
|
withStateOptions(
|
|
4812
|
-
|
|
4812
|
+
yargs42.positional("filename", {
|
|
4813
4813
|
demandOption: true,
|
|
4814
4814
|
describe: "Composition/pattern file to put"
|
|
4815
4815
|
})
|
|
@@ -4847,7 +4847,7 @@ var ComponentPatternUpdateModule = {
|
|
|
4847
4847
|
var ComponentPatternModule = {
|
|
4848
4848
|
command: "component-pattern <command>",
|
|
4849
4849
|
describe: "Commands for Canvas component patterns",
|
|
4850
|
-
builder: (
|
|
4850
|
+
builder: (yargs42) => yargs42.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
4851
4851
|
handler: () => {
|
|
4852
4852
|
yargs7.help();
|
|
4853
4853
|
}
|
|
@@ -4859,7 +4859,7 @@ var CompositionModule = {
|
|
|
4859
4859
|
command: "composition <command>",
|
|
4860
4860
|
describe: "Commands for Canvas compositions",
|
|
4861
4861
|
aliases: ["comp"],
|
|
4862
|
-
builder: (
|
|
4862
|
+
builder: (yargs42) => yargs42.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
4863
4863
|
handler: () => {
|
|
4864
4864
|
yargs8.help();
|
|
4865
4865
|
}
|
|
@@ -4878,13 +4878,13 @@ var CompositionPatternGetModule = {
|
|
|
4878
4878
|
var CompositionPatternListModule = {
|
|
4879
4879
|
...CompositionListModule,
|
|
4880
4880
|
describe: "List composition patterns",
|
|
4881
|
-
builder: (
|
|
4881
|
+
builder: (yargs42) => withFormatOptions(
|
|
4882
4882
|
withConfiguration(
|
|
4883
4883
|
withApiOptions(
|
|
4884
4884
|
withDebugOptions(
|
|
4885
4885
|
withProjectOptions(
|
|
4886
4886
|
withStateOptions(
|
|
4887
|
-
|
|
4887
|
+
yargs42.options({
|
|
4888
4888
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4889
4889
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4890
4890
|
resolvePatterns: {
|
|
@@ -4928,12 +4928,12 @@ var CompositionPatternListModule = {
|
|
|
4928
4928
|
var CompositionPatternPublishModule = {
|
|
4929
4929
|
...CompositionPublishModule,
|
|
4930
4930
|
describe: "Publishes composition pattern(s)",
|
|
4931
|
-
builder: (
|
|
4931
|
+
builder: (yargs42) => withConfiguration(
|
|
4932
4932
|
withApiOptions(
|
|
4933
4933
|
withDebugOptions(
|
|
4934
4934
|
withProjectOptions(
|
|
4935
4935
|
withDiffOptions(
|
|
4936
|
-
|
|
4936
|
+
yargs42.positional("ids", {
|
|
4937
4937
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4938
4938
|
type: "string"
|
|
4939
4939
|
}).option("all", {
|
|
@@ -4972,13 +4972,13 @@ var CompositionPatternPublishModule = {
|
|
|
4972
4972
|
var CompositionPatternPullModule = {
|
|
4973
4973
|
...componentInstancePullModuleFactory("compositionPatterns"),
|
|
4974
4974
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
4975
|
-
builder: (
|
|
4975
|
+
builder: (yargs42) => withConfiguration(
|
|
4976
4976
|
withApiOptions(
|
|
4977
4977
|
withDebugOptions(
|
|
4978
4978
|
withProjectOptions(
|
|
4979
4979
|
withStateOptions(
|
|
4980
4980
|
withDiffOptions(
|
|
4981
|
-
|
|
4981
|
+
yargs42.positional("directory", {
|
|
4982
4982
|
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.",
|
|
4983
4983
|
type: "string"
|
|
4984
4984
|
}).option("format", {
|
|
@@ -5016,13 +5016,13 @@ var CompositionPatternPullModule = {
|
|
|
5016
5016
|
var CompositionPatternPushModule = {
|
|
5017
5017
|
...componentInstancePushModuleFactory("compositionPatterns"),
|
|
5018
5018
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
5019
|
-
builder: (
|
|
5019
|
+
builder: (yargs42) => withConfiguration(
|
|
5020
5020
|
withApiOptions(
|
|
5021
5021
|
withDebugOptions(
|
|
5022
5022
|
withProjectOptions(
|
|
5023
5023
|
withStateOptions(
|
|
5024
5024
|
withDiffOptions(
|
|
5025
|
-
|
|
5025
|
+
yargs42.positional("directory", {
|
|
5026
5026
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
5027
5027
|
type: "string"
|
|
5028
5028
|
}).option("mode", {
|
|
@@ -5061,11 +5061,11 @@ var CompositionPatternRemoveModule = {
|
|
|
5061
5061
|
var CompositionPatternUnpublishModule = {
|
|
5062
5062
|
command: "unpublish [ids]",
|
|
5063
5063
|
describe: "Unpublish a composition pattern(s)",
|
|
5064
|
-
builder: (
|
|
5064
|
+
builder: (yargs42) => withConfiguration(
|
|
5065
5065
|
withApiOptions(
|
|
5066
5066
|
withDebugOptions(
|
|
5067
5067
|
withProjectOptions(
|
|
5068
|
-
|
|
5068
|
+
yargs42.positional("ids", {
|
|
5069
5069
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5070
5070
|
type: "string"
|
|
5071
5071
|
}).option("all", {
|
|
@@ -5101,7 +5101,7 @@ var CompositionPatternUpdateModule = {
|
|
|
5101
5101
|
var CompositionPatternModule = {
|
|
5102
5102
|
command: "composition-pattern <command>",
|
|
5103
5103
|
describe: "Commands for Canvas composition patterns",
|
|
5104
|
-
builder: (
|
|
5104
|
+
builder: (yargs42) => yargs42.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
5105
5105
|
handler: () => {
|
|
5106
5106
|
yargs9.help();
|
|
5107
5107
|
}
|
|
@@ -5122,12 +5122,12 @@ function getContentClient(options) {
|
|
|
5122
5122
|
var ContentTypeGetModule = {
|
|
5123
5123
|
command: "get <id>",
|
|
5124
5124
|
describe: "Get a content type",
|
|
5125
|
-
builder: (
|
|
5125
|
+
builder: (yargs42) => withConfiguration(
|
|
5126
5126
|
withDebugOptions(
|
|
5127
5127
|
withFormatOptions(
|
|
5128
5128
|
withApiOptions(
|
|
5129
5129
|
withProjectOptions(
|
|
5130
|
-
|
|
5130
|
+
yargs42.positional("id", {
|
|
5131
5131
|
demandOption: true,
|
|
5132
5132
|
describe: "Content type public ID to fetch"
|
|
5133
5133
|
})
|
|
@@ -5152,7 +5152,7 @@ var ContentTypeGetModule = {
|
|
|
5152
5152
|
var ContentTypeListModule = {
|
|
5153
5153
|
command: "list",
|
|
5154
5154
|
describe: "List content types",
|
|
5155
|
-
builder: (
|
|
5155
|
+
builder: (yargs42) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs42))))),
|
|
5156
5156
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5157
5157
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5158
5158
|
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5193,12 +5193,12 @@ function createContentTypeEngineDataSource({
|
|
|
5193
5193
|
var ContentTypePullModule = {
|
|
5194
5194
|
command: "pull <directory>",
|
|
5195
5195
|
describe: "Pulls all content types to local files in a directory",
|
|
5196
|
-
builder: (
|
|
5196
|
+
builder: (yargs42) => withConfiguration(
|
|
5197
5197
|
withApiOptions(
|
|
5198
5198
|
withDebugOptions(
|
|
5199
5199
|
withProjectOptions(
|
|
5200
5200
|
withDiffOptions(
|
|
5201
|
-
|
|
5201
|
+
yargs42.positional("directory", {
|
|
5202
5202
|
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.",
|
|
5203
5203
|
type: "string"
|
|
5204
5204
|
}).option("format", {
|
|
@@ -5278,12 +5278,12 @@ var ContentTypePullModule = {
|
|
|
5278
5278
|
var ContentTypePushModule = {
|
|
5279
5279
|
command: "push <directory>",
|
|
5280
5280
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
5281
|
-
builder: (
|
|
5281
|
+
builder: (yargs42) => withConfiguration(
|
|
5282
5282
|
withApiOptions(
|
|
5283
5283
|
withDebugOptions(
|
|
5284
5284
|
withProjectOptions(
|
|
5285
5285
|
withDiffOptions(
|
|
5286
|
-
|
|
5286
|
+
yargs42.positional("directory", {
|
|
5287
5287
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
5288
5288
|
type: "string"
|
|
5289
5289
|
}).option("what-if", {
|
|
@@ -5357,11 +5357,11 @@ var ContentTypeRemoveModule = {
|
|
|
5357
5357
|
command: "remove <id>",
|
|
5358
5358
|
aliases: ["delete", "rm"],
|
|
5359
5359
|
describe: "Delete a content type",
|
|
5360
|
-
builder: (
|
|
5360
|
+
builder: (yargs42) => withConfiguration(
|
|
5361
5361
|
withDebugOptions(
|
|
5362
5362
|
withApiOptions(
|
|
5363
5363
|
withProjectOptions(
|
|
5364
|
-
|
|
5364
|
+
yargs42.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
5365
5365
|
)
|
|
5366
5366
|
)
|
|
5367
5367
|
)
|
|
@@ -5382,11 +5382,11 @@ var ContentTypeUpdateModule = {
|
|
|
5382
5382
|
command: "update <filename>",
|
|
5383
5383
|
aliases: ["put"],
|
|
5384
5384
|
describe: "Insert or update a content type",
|
|
5385
|
-
builder: (
|
|
5385
|
+
builder: (yargs42) => withConfiguration(
|
|
5386
5386
|
withDebugOptions(
|
|
5387
5387
|
withApiOptions(
|
|
5388
5388
|
withProjectOptions(
|
|
5389
|
-
|
|
5389
|
+
yargs42.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
5390
5390
|
)
|
|
5391
5391
|
)
|
|
5392
5392
|
)
|
|
@@ -5408,7 +5408,7 @@ var ContentTypeModule = {
|
|
|
5408
5408
|
command: "contenttype <command>",
|
|
5409
5409
|
aliases: ["ct"],
|
|
5410
5410
|
describe: "Commands for Content Types",
|
|
5411
|
-
builder: (
|
|
5411
|
+
builder: (yargs42) => yargs42.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
5412
5412
|
handler: () => {
|
|
5413
5413
|
yargs10.help();
|
|
5414
5414
|
}
|
|
@@ -5427,11 +5427,11 @@ function getDataSourceClient(options) {
|
|
|
5427
5427
|
var DataSourceGetModule = {
|
|
5428
5428
|
command: "get <id>",
|
|
5429
5429
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
5430
|
-
builder: (
|
|
5430
|
+
builder: (yargs42) => withConfiguration(
|
|
5431
5431
|
withApiOptions(
|
|
5432
5432
|
withDebugOptions(
|
|
5433
5433
|
withProjectOptions(
|
|
5434
|
-
|
|
5434
|
+
yargs42.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
5435
5435
|
)
|
|
5436
5436
|
)
|
|
5437
5437
|
)
|
|
@@ -5449,11 +5449,11 @@ var DataSourceRemoveModule = {
|
|
|
5449
5449
|
command: "remove <id>",
|
|
5450
5450
|
aliases: ["delete", "rm"],
|
|
5451
5451
|
describe: "Delete a data source",
|
|
5452
|
-
builder: (
|
|
5452
|
+
builder: (yargs42) => withConfiguration(
|
|
5453
5453
|
withDebugOptions(
|
|
5454
5454
|
withApiOptions(
|
|
5455
5455
|
withProjectOptions(
|
|
5456
|
-
|
|
5456
|
+
yargs42.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
5457
5457
|
)
|
|
5458
5458
|
)
|
|
5459
5459
|
)
|
|
@@ -5474,11 +5474,11 @@ var DataSourceUpdateModule = {
|
|
|
5474
5474
|
command: "update <dataSource>",
|
|
5475
5475
|
aliases: ["put"],
|
|
5476
5476
|
describe: "Insert or update a data source",
|
|
5477
|
-
builder: (
|
|
5477
|
+
builder: (yargs42) => withConfiguration(
|
|
5478
5478
|
withApiOptions(
|
|
5479
5479
|
withDebugOptions(
|
|
5480
5480
|
withProjectOptions(
|
|
5481
|
-
|
|
5481
|
+
yargs42.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
5482
5482
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
5483
5483
|
type: "string",
|
|
5484
5484
|
demandOption: true
|
|
@@ -5513,7 +5513,7 @@ var DataSourceModule = {
|
|
|
5513
5513
|
command: "datasource <command>",
|
|
5514
5514
|
aliases: ["ds"],
|
|
5515
5515
|
describe: "Commands for Data Source definitions",
|
|
5516
|
-
builder: (
|
|
5516
|
+
builder: (yargs42) => yargs42.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
5517
5517
|
handler: () => {
|
|
5518
5518
|
yargs11.help();
|
|
5519
5519
|
}
|
|
@@ -5535,12 +5535,12 @@ var DataTypeGetModule = {
|
|
|
5535
5535
|
command: "get <id>",
|
|
5536
5536
|
describe: "Get a data type",
|
|
5537
5537
|
aliases: ["ls"],
|
|
5538
|
-
builder: (
|
|
5538
|
+
builder: (yargs42) => withConfiguration(
|
|
5539
5539
|
withFormatOptions(
|
|
5540
5540
|
withDebugOptions(
|
|
5541
5541
|
withApiOptions(
|
|
5542
5542
|
withProjectOptions(
|
|
5543
|
-
|
|
5543
|
+
yargs42.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
5544
5544
|
)
|
|
5545
5545
|
)
|
|
5546
5546
|
)
|
|
@@ -5563,7 +5563,7 @@ var DataTypeListModule = {
|
|
|
5563
5563
|
command: "list",
|
|
5564
5564
|
describe: "List data types",
|
|
5565
5565
|
aliases: ["ls"],
|
|
5566
|
-
builder: (
|
|
5566
|
+
builder: (yargs42) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs42))))),
|
|
5567
5567
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5568
5568
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5569
5569
|
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5606,12 +5606,12 @@ function createDataTypeEngineDataSource({
|
|
|
5606
5606
|
var DataTypePullModule = {
|
|
5607
5607
|
command: "pull <directory>",
|
|
5608
5608
|
describe: "Pulls all data types to local files in a directory",
|
|
5609
|
-
builder: (
|
|
5609
|
+
builder: (yargs42) => withConfiguration(
|
|
5610
5610
|
withApiOptions(
|
|
5611
5611
|
withDebugOptions(
|
|
5612
5612
|
withProjectOptions(
|
|
5613
5613
|
withDiffOptions(
|
|
5614
|
-
|
|
5614
|
+
yargs42.positional("directory", {
|
|
5615
5615
|
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.",
|
|
5616
5616
|
type: "string"
|
|
5617
5617
|
}).option("format", {
|
|
@@ -5691,12 +5691,12 @@ var DataTypePullModule = {
|
|
|
5691
5691
|
var DataTypePushModule = {
|
|
5692
5692
|
command: "push <directory>",
|
|
5693
5693
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
5694
|
-
builder: (
|
|
5694
|
+
builder: (yargs42) => withConfiguration(
|
|
5695
5695
|
withApiOptions(
|
|
5696
5696
|
withDebugOptions(
|
|
5697
5697
|
withProjectOptions(
|
|
5698
5698
|
withDiffOptions(
|
|
5699
|
-
|
|
5699
|
+
yargs42.positional("directory", {
|
|
5700
5700
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
5701
5701
|
type: "string"
|
|
5702
5702
|
}).option("mode", {
|
|
@@ -5765,11 +5765,11 @@ var DataTypeRemoveModule = {
|
|
|
5765
5765
|
command: "remove <id>",
|
|
5766
5766
|
aliases: ["delete", "rm"],
|
|
5767
5767
|
describe: "Delete a data type",
|
|
5768
|
-
builder: (
|
|
5768
|
+
builder: (yargs42) => withConfiguration(
|
|
5769
5769
|
withDebugOptions(
|
|
5770
5770
|
withApiOptions(
|
|
5771
5771
|
withProjectOptions(
|
|
5772
|
-
|
|
5772
|
+
yargs42.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
5773
5773
|
)
|
|
5774
5774
|
)
|
|
5775
5775
|
)
|
|
@@ -5790,11 +5790,11 @@ var DataTypeUpdateModule = {
|
|
|
5790
5790
|
command: "update <filename>",
|
|
5791
5791
|
aliases: ["put"],
|
|
5792
5792
|
describe: "Insert or update a data type",
|
|
5793
|
-
builder: (
|
|
5793
|
+
builder: (yargs42) => withConfiguration(
|
|
5794
5794
|
withDebugOptions(
|
|
5795
5795
|
withApiOptions(
|
|
5796
5796
|
withProjectOptions(
|
|
5797
|
-
|
|
5797
|
+
yargs42.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
5798
5798
|
)
|
|
5799
5799
|
)
|
|
5800
5800
|
)
|
|
@@ -5816,7 +5816,7 @@ var DataTypeModule = {
|
|
|
5816
5816
|
command: "datatype <command>",
|
|
5817
5817
|
aliases: ["dt"],
|
|
5818
5818
|
describe: "Commands for Data Type definitions",
|
|
5819
|
-
builder: (
|
|
5819
|
+
builder: (yargs42) => yargs42.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
5820
5820
|
handler: () => {
|
|
5821
5821
|
yargs12.help();
|
|
5822
5822
|
}
|
|
@@ -5829,13 +5829,13 @@ import yargs13 from "yargs";
|
|
|
5829
5829
|
var EntryGetModule = {
|
|
5830
5830
|
command: "get <id>",
|
|
5831
5831
|
describe: "Get an entry",
|
|
5832
|
-
builder: (
|
|
5832
|
+
builder: (yargs42) => withConfiguration(
|
|
5833
5833
|
withDebugOptions(
|
|
5834
5834
|
withFormatOptions(
|
|
5835
5835
|
withApiOptions(
|
|
5836
5836
|
withProjectOptions(
|
|
5837
5837
|
withStateOptions(
|
|
5838
|
-
|
|
5838
|
+
yargs42.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
5839
5839
|
resolveData: {
|
|
5840
5840
|
type: "boolean",
|
|
5841
5841
|
default: false,
|
|
@@ -5907,13 +5907,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
5907
5907
|
var EntryListModule = {
|
|
5908
5908
|
command: "list",
|
|
5909
5909
|
describe: "List entries",
|
|
5910
|
-
builder: (
|
|
5910
|
+
builder: (yargs42) => withConfiguration(
|
|
5911
5911
|
withDebugOptions(
|
|
5912
5912
|
withFormatOptions(
|
|
5913
5913
|
withApiOptions(
|
|
5914
5914
|
withProjectOptions(
|
|
5915
5915
|
withStateOptions(
|
|
5916
|
-
|
|
5916
|
+
yargs42.options({
|
|
5917
5917
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
5918
5918
|
limit: {
|
|
5919
5919
|
describe: "Number of rows to fetch",
|
|
@@ -6048,12 +6048,12 @@ function createEntryEngineDataSource({
|
|
|
6048
6048
|
var EntryPublishModule = {
|
|
6049
6049
|
command: "publish [ids]",
|
|
6050
6050
|
describe: "Publishes entry(ies)",
|
|
6051
|
-
builder: (
|
|
6051
|
+
builder: (yargs42) => withConfiguration(
|
|
6052
6052
|
withDiffOptions(
|
|
6053
6053
|
withApiOptions(
|
|
6054
6054
|
withProjectOptions(
|
|
6055
6055
|
withDiffOptions(
|
|
6056
|
-
|
|
6056
|
+
yargs42.positional("ids", {
|
|
6057
6057
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6058
6058
|
type: "string"
|
|
6059
6059
|
}).option("all", {
|
|
@@ -6128,13 +6128,13 @@ var EntryPublishModule = {
|
|
|
6128
6128
|
var EntryPullModule = {
|
|
6129
6129
|
command: "pull <directory>",
|
|
6130
6130
|
describe: "Pulls all entries to local files in a directory",
|
|
6131
|
-
builder: (
|
|
6131
|
+
builder: (yargs42) => withConfiguration(
|
|
6132
6132
|
withDebugOptions(
|
|
6133
6133
|
withApiOptions(
|
|
6134
6134
|
withProjectOptions(
|
|
6135
6135
|
withStateOptions(
|
|
6136
6136
|
withDiffOptions(
|
|
6137
|
-
|
|
6137
|
+
yargs42.positional("directory", {
|
|
6138
6138
|
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.",
|
|
6139
6139
|
type: "string"
|
|
6140
6140
|
}).option("format", {
|
|
@@ -6234,13 +6234,13 @@ var EntryPullModule = {
|
|
|
6234
6234
|
var EntryPushModule = {
|
|
6235
6235
|
command: "push <directory>",
|
|
6236
6236
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
6237
|
-
builder: (
|
|
6237
|
+
builder: (yargs42) => withConfiguration(
|
|
6238
6238
|
withDebugOptions(
|
|
6239
6239
|
withApiOptions(
|
|
6240
6240
|
withProjectOptions(
|
|
6241
6241
|
withStateOptions(
|
|
6242
6242
|
withDiffOptions(
|
|
6243
|
-
|
|
6243
|
+
yargs42.positional("directory", {
|
|
6244
6244
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
6245
6245
|
type: "string"
|
|
6246
6246
|
}).option("mode", {
|
|
@@ -6339,11 +6339,11 @@ var EntryRemoveModule = {
|
|
|
6339
6339
|
command: "remove <id>",
|
|
6340
6340
|
aliases: ["delete", "rm"],
|
|
6341
6341
|
describe: "Delete an entry",
|
|
6342
|
-
builder: (
|
|
6342
|
+
builder: (yargs42) => withConfiguration(
|
|
6343
6343
|
withDebugOptions(
|
|
6344
6344
|
withApiOptions(
|
|
6345
6345
|
withProjectOptions(
|
|
6346
|
-
|
|
6346
|
+
yargs42.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
6347
6347
|
)
|
|
6348
6348
|
)
|
|
6349
6349
|
)
|
|
@@ -6365,11 +6365,11 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
6365
6365
|
var EntryUnpublishModule = {
|
|
6366
6366
|
command: "unpublish [ids]",
|
|
6367
6367
|
describe: "Unpublish an entry(ies)",
|
|
6368
|
-
builder: (
|
|
6368
|
+
builder: (yargs42) => withConfiguration(
|
|
6369
6369
|
withDebugOptions(
|
|
6370
6370
|
withApiOptions(
|
|
6371
6371
|
withProjectOptions(
|
|
6372
|
-
|
|
6372
|
+
yargs42.positional("ids", {
|
|
6373
6373
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6374
6374
|
type: "string"
|
|
6375
6375
|
}).option("all", {
|
|
@@ -6439,12 +6439,12 @@ var EntryUpdateModule = {
|
|
|
6439
6439
|
command: "update <filename>",
|
|
6440
6440
|
aliases: ["put"],
|
|
6441
6441
|
describe: "Insert or update an entry",
|
|
6442
|
-
builder: (
|
|
6442
|
+
builder: (yargs42) => withConfiguration(
|
|
6443
6443
|
withDebugOptions(
|
|
6444
6444
|
withApiOptions(
|
|
6445
6445
|
withProjectOptions(
|
|
6446
6446
|
withStateOptions(
|
|
6447
|
-
|
|
6447
|
+
yargs42.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
6448
6448
|
)
|
|
6449
6449
|
)
|
|
6450
6450
|
)
|
|
@@ -6476,7 +6476,7 @@ var EntryUpdateModule = {
|
|
|
6476
6476
|
var EntryModule = {
|
|
6477
6477
|
command: "entry <command>",
|
|
6478
6478
|
describe: "Commands for Entries",
|
|
6479
|
-
builder: (
|
|
6479
|
+
builder: (yargs42) => yargs42.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
6480
6480
|
handler: () => {
|
|
6481
6481
|
yargs13.help();
|
|
6482
6482
|
}
|
|
@@ -6489,13 +6489,13 @@ import yargs14 from "yargs";
|
|
|
6489
6489
|
var EntryPatternGetModule = {
|
|
6490
6490
|
command: "get <id>",
|
|
6491
6491
|
describe: "Get an entry pattern",
|
|
6492
|
-
builder: (
|
|
6492
|
+
builder: (yargs42) => withConfiguration(
|
|
6493
6493
|
withDebugOptions(
|
|
6494
6494
|
withFormatOptions(
|
|
6495
6495
|
withApiOptions(
|
|
6496
6496
|
withProjectOptions(
|
|
6497
6497
|
withStateOptions(
|
|
6498
|
-
|
|
6498
|
+
yargs42.positional("id", {
|
|
6499
6499
|
demandOption: true,
|
|
6500
6500
|
describe: "Entry pattern public ID to fetch"
|
|
6501
6501
|
}).option({
|
|
@@ -6548,13 +6548,13 @@ var EntryPatternGetModule = {
|
|
|
6548
6548
|
var EntryPatternListModule = {
|
|
6549
6549
|
command: "list",
|
|
6550
6550
|
describe: "List entry patterns",
|
|
6551
|
-
builder: (
|
|
6551
|
+
builder: (yargs42) => withConfiguration(
|
|
6552
6552
|
withDebugOptions(
|
|
6553
6553
|
withFormatOptions(
|
|
6554
6554
|
withApiOptions(
|
|
6555
6555
|
withProjectOptions(
|
|
6556
6556
|
withStateOptions(
|
|
6557
|
-
|
|
6557
|
+
yargs42.option({
|
|
6558
6558
|
withComponentIDs: {
|
|
6559
6559
|
type: "boolean",
|
|
6560
6560
|
default: false,
|
|
@@ -6600,12 +6600,12 @@ var EntryPatternListModule = {
|
|
|
6600
6600
|
var EntryPatternPublishModule = {
|
|
6601
6601
|
command: "publish [ids]",
|
|
6602
6602
|
describe: "Publishes entry pattern(s)",
|
|
6603
|
-
builder: (
|
|
6603
|
+
builder: (yargs42) => withConfiguration(
|
|
6604
6604
|
withDebugOptions(
|
|
6605
6605
|
withApiOptions(
|
|
6606
6606
|
withProjectOptions(
|
|
6607
6607
|
withDiffOptions(
|
|
6608
|
-
|
|
6608
|
+
yargs42.positional("ids", {
|
|
6609
6609
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6610
6610
|
type: "string"
|
|
6611
6611
|
}).option("all", {
|
|
@@ -6680,13 +6680,13 @@ var EntryPatternPublishModule = {
|
|
|
6680
6680
|
var EntryPatternPullModule = {
|
|
6681
6681
|
command: "pull <directory>",
|
|
6682
6682
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
6683
|
-
builder: (
|
|
6683
|
+
builder: (yargs42) => withConfiguration(
|
|
6684
6684
|
withApiOptions(
|
|
6685
6685
|
withDebugOptions(
|
|
6686
6686
|
withProjectOptions(
|
|
6687
6687
|
withStateOptions(
|
|
6688
6688
|
withDiffOptions(
|
|
6689
|
-
|
|
6689
|
+
yargs42.positional("directory", {
|
|
6690
6690
|
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.",
|
|
6691
6691
|
type: "string"
|
|
6692
6692
|
}).option("format", {
|
|
@@ -6786,13 +6786,13 @@ var EntryPatternPullModule = {
|
|
|
6786
6786
|
var EntryPatternPushModule = {
|
|
6787
6787
|
command: "push <directory>",
|
|
6788
6788
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
6789
|
-
builder: (
|
|
6789
|
+
builder: (yargs42) => withConfiguration(
|
|
6790
6790
|
withDebugOptions(
|
|
6791
6791
|
withApiOptions(
|
|
6792
6792
|
withProjectOptions(
|
|
6793
6793
|
withStateOptions(
|
|
6794
6794
|
withDiffOptions(
|
|
6795
|
-
|
|
6795
|
+
yargs42.positional("directory", {
|
|
6796
6796
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
6797
6797
|
type: "string"
|
|
6798
6798
|
}).option("what-if", {
|
|
@@ -6896,11 +6896,11 @@ var EntryPatternRemoveModule = {
|
|
|
6896
6896
|
command: "remove <id>",
|
|
6897
6897
|
aliases: ["delete", "rm"],
|
|
6898
6898
|
describe: "Delete an entry pattern",
|
|
6899
|
-
builder: (
|
|
6899
|
+
builder: (yargs42) => withConfiguration(
|
|
6900
6900
|
withDebugOptions(
|
|
6901
6901
|
withApiOptions(
|
|
6902
6902
|
withProjectOptions(
|
|
6903
|
-
|
|
6903
|
+
yargs42.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
6904
6904
|
)
|
|
6905
6905
|
)
|
|
6906
6906
|
)
|
|
@@ -6922,11 +6922,11 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
6922
6922
|
var EntryPatternUnpublishModule = {
|
|
6923
6923
|
command: "unpublish [ids]",
|
|
6924
6924
|
describe: "Unpublish an entry patterns",
|
|
6925
|
-
builder: (
|
|
6925
|
+
builder: (yargs42) => withConfiguration(
|
|
6926
6926
|
withDebugOptions(
|
|
6927
6927
|
withApiOptions(
|
|
6928
6928
|
withProjectOptions(
|
|
6929
|
-
|
|
6929
|
+
yargs42.positional("ids", {
|
|
6930
6930
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6931
6931
|
type: "string"
|
|
6932
6932
|
}).option("all", {
|
|
@@ -6996,12 +6996,12 @@ var EntryPatternUpdateModule = {
|
|
|
6996
6996
|
command: "update <filename>",
|
|
6997
6997
|
aliases: ["put"],
|
|
6998
6998
|
describe: "Insert or update an entry pattern",
|
|
6999
|
-
builder: (
|
|
6999
|
+
builder: (yargs42) => withConfiguration(
|
|
7000
7000
|
withDebugOptions(
|
|
7001
7001
|
withApiOptions(
|
|
7002
7002
|
withProjectOptions(
|
|
7003
7003
|
withStateOptions(
|
|
7004
|
-
|
|
7004
|
+
yargs42.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
7005
7005
|
)
|
|
7006
7006
|
)
|
|
7007
7007
|
)
|
|
@@ -7037,7 +7037,7 @@ var EntryPatternUpdateModule = {
|
|
|
7037
7037
|
var EntryPatternModule = {
|
|
7038
7038
|
command: "entry-pattern <command>",
|
|
7039
7039
|
describe: "Commands for Entry patterns",
|
|
7040
|
-
builder: (
|
|
7040
|
+
builder: (yargs42) => yargs42.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
7041
7041
|
handler: () => {
|
|
7042
7042
|
yargs14.help();
|
|
7043
7043
|
}
|
|
@@ -7086,12 +7086,12 @@ function getLocaleClient(options) {
|
|
|
7086
7086
|
var LocalePullModule = {
|
|
7087
7087
|
command: "pull <directory>",
|
|
7088
7088
|
describe: "Pulls all locales to local files in a directory",
|
|
7089
|
-
builder: (
|
|
7089
|
+
builder: (yargs42) => withConfiguration(
|
|
7090
7090
|
withDebugOptions(
|
|
7091
7091
|
withApiOptions(
|
|
7092
7092
|
withProjectOptions(
|
|
7093
7093
|
withDiffOptions(
|
|
7094
|
-
|
|
7094
|
+
yargs42.positional("directory", {
|
|
7095
7095
|
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.",
|
|
7096
7096
|
type: "string"
|
|
7097
7097
|
}).option("format", {
|
|
@@ -7171,12 +7171,12 @@ var LocalePullModule = {
|
|
|
7171
7171
|
var LocalePushModule = {
|
|
7172
7172
|
command: "push <directory>",
|
|
7173
7173
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
7174
|
-
builder: (
|
|
7174
|
+
builder: (yargs42) => withConfiguration(
|
|
7175
7175
|
withDebugOptions(
|
|
7176
7176
|
withApiOptions(
|
|
7177
7177
|
withProjectOptions(
|
|
7178
7178
|
withDiffOptions(
|
|
7179
|
-
|
|
7179
|
+
yargs42.positional("directory", {
|
|
7180
7180
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
7181
7181
|
type: "string"
|
|
7182
7182
|
}).option("mode", {
|
|
@@ -7244,7 +7244,7 @@ var LocalePushModule = {
|
|
|
7244
7244
|
var LocaleModule = {
|
|
7245
7245
|
command: "locale <command>",
|
|
7246
7246
|
describe: "Commands for locale definitions",
|
|
7247
|
-
builder: (
|
|
7247
|
+
builder: (yargs42) => yargs42.command(LocalePullModule).command(LocalePushModule),
|
|
7248
7248
|
handler: () => {
|
|
7249
7249
|
yargs15.help();
|
|
7250
7250
|
}
|
|
@@ -7265,12 +7265,12 @@ function getPreviewClient(options) {
|
|
|
7265
7265
|
var PreviewUrlGetModule = {
|
|
7266
7266
|
command: "get <id>",
|
|
7267
7267
|
describe: "Fetch a preview URL",
|
|
7268
|
-
builder: (
|
|
7268
|
+
builder: (yargs42) => withConfiguration(
|
|
7269
7269
|
withFormatOptions(
|
|
7270
7270
|
withDebugOptions(
|
|
7271
7271
|
withApiOptions(
|
|
7272
7272
|
withProjectOptions(
|
|
7273
|
-
|
|
7273
|
+
yargs42.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
7274
7274
|
)
|
|
7275
7275
|
)
|
|
7276
7276
|
)
|
|
@@ -7294,8 +7294,8 @@ var PreviewUrlListModule = {
|
|
|
7294
7294
|
command: "list",
|
|
7295
7295
|
describe: "List preview URLs",
|
|
7296
7296
|
aliases: ["ls"],
|
|
7297
|
-
builder: (
|
|
7298
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
7297
|
+
builder: (yargs42) => withConfiguration(
|
|
7298
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs42.options({})))))
|
|
7299
7299
|
),
|
|
7300
7300
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7301
7301
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -7337,12 +7337,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
7337
7337
|
var PreviewUrlPullModule = {
|
|
7338
7338
|
command: "pull <directory>",
|
|
7339
7339
|
describe: "Pulls all preview urls to local files in a directory",
|
|
7340
|
-
builder: (
|
|
7340
|
+
builder: (yargs42) => withConfiguration(
|
|
7341
7341
|
withApiOptions(
|
|
7342
7342
|
withProjectOptions(
|
|
7343
7343
|
withDebugOptions(
|
|
7344
7344
|
withDiffOptions(
|
|
7345
|
-
|
|
7345
|
+
yargs42.positional("directory", {
|
|
7346
7346
|
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.",
|
|
7347
7347
|
type: "string"
|
|
7348
7348
|
}).option("format", {
|
|
@@ -7417,12 +7417,12 @@ var PreviewUrlPullModule = {
|
|
|
7417
7417
|
var PreviewUrlPushModule = {
|
|
7418
7418
|
command: "push <directory>",
|
|
7419
7419
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
7420
|
-
builder: (
|
|
7420
|
+
builder: (yargs42) => withConfiguration(
|
|
7421
7421
|
withApiOptions(
|
|
7422
7422
|
withProjectOptions(
|
|
7423
7423
|
withDiffOptions(
|
|
7424
7424
|
withDebugOptions(
|
|
7425
|
-
|
|
7425
|
+
yargs42.positional("directory", {
|
|
7426
7426
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
7427
7427
|
type: "string"
|
|
7428
7428
|
}).option("mode", {
|
|
@@ -7486,11 +7486,11 @@ var PreviewUrlRemoveModule = {
|
|
|
7486
7486
|
command: "remove <id>",
|
|
7487
7487
|
aliases: ["delete", "rm"],
|
|
7488
7488
|
describe: "Delete a preview URL",
|
|
7489
|
-
builder: (
|
|
7489
|
+
builder: (yargs42) => withConfiguration(
|
|
7490
7490
|
withApiOptions(
|
|
7491
7491
|
withDebugOptions(
|
|
7492
7492
|
withProjectOptions(
|
|
7493
|
-
|
|
7493
|
+
yargs42.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
7494
7494
|
)
|
|
7495
7495
|
)
|
|
7496
7496
|
)
|
|
@@ -7511,11 +7511,11 @@ var PreviewUrlUpdateModule = {
|
|
|
7511
7511
|
command: "update <filename>",
|
|
7512
7512
|
aliases: ["put"],
|
|
7513
7513
|
describe: "Insert or update a preview URL",
|
|
7514
|
-
builder: (
|
|
7514
|
+
builder: (yargs42) => withConfiguration(
|
|
7515
7515
|
withDebugOptions(
|
|
7516
7516
|
withApiOptions(
|
|
7517
7517
|
withProjectOptions(
|
|
7518
|
-
|
|
7518
|
+
yargs42.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
7519
7519
|
)
|
|
7520
7520
|
)
|
|
7521
7521
|
)
|
|
@@ -7537,7 +7537,7 @@ var PreviewUrlModule = {
|
|
|
7537
7537
|
command: "preview-url <command>",
|
|
7538
7538
|
aliases: ["pu"],
|
|
7539
7539
|
describe: "Commands for Canvas preview urls",
|
|
7540
|
-
builder: (
|
|
7540
|
+
builder: (yargs42) => yargs42.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
7541
7541
|
handler: () => {
|
|
7542
7542
|
yargs16.help();
|
|
7543
7543
|
}
|
|
@@ -7550,12 +7550,12 @@ import yargs17 from "yargs";
|
|
|
7550
7550
|
var PreviewViewportGetModule = {
|
|
7551
7551
|
command: "get <id>",
|
|
7552
7552
|
describe: "Fetch a preview viewport",
|
|
7553
|
-
builder: (
|
|
7553
|
+
builder: (yargs42) => withConfiguration(
|
|
7554
7554
|
withFormatOptions(
|
|
7555
7555
|
withDebugOptions(
|
|
7556
7556
|
withApiOptions(
|
|
7557
7557
|
withProjectOptions(
|
|
7558
|
-
|
|
7558
|
+
yargs42.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
7559
7559
|
)
|
|
7560
7560
|
)
|
|
7561
7561
|
)
|
|
@@ -7579,8 +7579,8 @@ var PreviewViewportListModule = {
|
|
|
7579
7579
|
command: "list",
|
|
7580
7580
|
describe: "List preview viewports",
|
|
7581
7581
|
aliases: ["ls"],
|
|
7582
|
-
builder: (
|
|
7583
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
7582
|
+
builder: (yargs42) => withConfiguration(
|
|
7583
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs42.options({})))))
|
|
7584
7584
|
),
|
|
7585
7585
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7586
7586
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -7626,12 +7626,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
7626
7626
|
var PreviewViewportPullModule = {
|
|
7627
7627
|
command: "pull <directory>",
|
|
7628
7628
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
7629
|
-
builder: (
|
|
7629
|
+
builder: (yargs42) => withConfiguration(
|
|
7630
7630
|
withApiOptions(
|
|
7631
7631
|
withProjectOptions(
|
|
7632
7632
|
withDebugOptions(
|
|
7633
7633
|
withDiffOptions(
|
|
7634
|
-
|
|
7634
|
+
yargs42.positional("directory", {
|
|
7635
7635
|
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.",
|
|
7636
7636
|
type: "string"
|
|
7637
7637
|
}).option("format", {
|
|
@@ -7706,12 +7706,12 @@ var PreviewViewportPullModule = {
|
|
|
7706
7706
|
var PreviewViewportPushModule = {
|
|
7707
7707
|
command: "push <directory>",
|
|
7708
7708
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
7709
|
-
builder: (
|
|
7709
|
+
builder: (yargs42) => withConfiguration(
|
|
7710
7710
|
withApiOptions(
|
|
7711
7711
|
withProjectOptions(
|
|
7712
7712
|
withDiffOptions(
|
|
7713
7713
|
withDebugOptions(
|
|
7714
|
-
|
|
7714
|
+
yargs42.positional("directory", {
|
|
7715
7715
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
7716
7716
|
type: "string"
|
|
7717
7717
|
}).option("mode", {
|
|
@@ -7775,11 +7775,11 @@ var PreviewViewportRemoveModule = {
|
|
|
7775
7775
|
command: "remove <id>",
|
|
7776
7776
|
aliases: ["delete", "rm"],
|
|
7777
7777
|
describe: "Delete a preview viewport",
|
|
7778
|
-
builder: (
|
|
7778
|
+
builder: (yargs42) => withConfiguration(
|
|
7779
7779
|
withApiOptions(
|
|
7780
7780
|
withDebugOptions(
|
|
7781
7781
|
withProjectOptions(
|
|
7782
|
-
|
|
7782
|
+
yargs42.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
7783
7783
|
)
|
|
7784
7784
|
)
|
|
7785
7785
|
)
|
|
@@ -7800,11 +7800,11 @@ var PreviewViewportUpdateModule = {
|
|
|
7800
7800
|
command: "update <filename>",
|
|
7801
7801
|
aliases: ["put"],
|
|
7802
7802
|
describe: "Insert or update a preview viewport",
|
|
7803
|
-
builder: (
|
|
7803
|
+
builder: (yargs42) => withConfiguration(
|
|
7804
7804
|
withDebugOptions(
|
|
7805
7805
|
withApiOptions(
|
|
7806
7806
|
withProjectOptions(
|
|
7807
|
-
|
|
7807
|
+
yargs42.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
7808
7808
|
)
|
|
7809
7809
|
)
|
|
7810
7810
|
)
|
|
@@ -7826,7 +7826,7 @@ var PreviewViewportModule = {
|
|
|
7826
7826
|
command: "preview-viewport <command>",
|
|
7827
7827
|
aliases: ["pv"],
|
|
7828
7828
|
describe: "Commands for Canvas preview viewports",
|
|
7829
|
-
builder: (
|
|
7829
|
+
builder: (yargs42) => yargs42.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
7830
7830
|
handler: () => {
|
|
7831
7831
|
yargs17.help();
|
|
7832
7832
|
}
|
|
@@ -7845,12 +7845,12 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
7845
7845
|
var PromptGetModule = {
|
|
7846
7846
|
command: "get <id>",
|
|
7847
7847
|
describe: "Get a prompt",
|
|
7848
|
-
builder: (
|
|
7848
|
+
builder: (yargs42) => withConfiguration(
|
|
7849
7849
|
withDebugOptions(
|
|
7850
7850
|
withFormatOptions(
|
|
7851
7851
|
withApiOptions(
|
|
7852
7852
|
withProjectOptions(
|
|
7853
|
-
|
|
7853
|
+
yargs42.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
7854
7854
|
)
|
|
7855
7855
|
)
|
|
7856
7856
|
)
|
|
@@ -7871,7 +7871,7 @@ var PromptGetModule = {
|
|
|
7871
7871
|
var PromptListModule = {
|
|
7872
7872
|
command: "list",
|
|
7873
7873
|
describe: "List prompts",
|
|
7874
|
-
builder: (
|
|
7874
|
+
builder: (yargs42) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs42))))),
|
|
7875
7875
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7876
7876
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7877
7877
|
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -7912,13 +7912,13 @@ function createPromptEngineDataSource({
|
|
|
7912
7912
|
var PromptPullModule = {
|
|
7913
7913
|
command: "pull <directory>",
|
|
7914
7914
|
describe: "Pulls all prompts to local files in a directory",
|
|
7915
|
-
builder: (
|
|
7915
|
+
builder: (yargs42) => withConfiguration(
|
|
7916
7916
|
withDebugOptions(
|
|
7917
7917
|
withApiOptions(
|
|
7918
7918
|
withProjectOptions(
|
|
7919
7919
|
withStateOptions(
|
|
7920
7920
|
withDiffOptions(
|
|
7921
|
-
|
|
7921
|
+
yargs42.positional("directory", {
|
|
7922
7922
|
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.",
|
|
7923
7923
|
type: "string"
|
|
7924
7924
|
}).option("format", {
|
|
@@ -7999,12 +7999,12 @@ var PromptPullModule = {
|
|
|
7999
7999
|
var PromptPushModule = {
|
|
8000
8000
|
command: "push <directory>",
|
|
8001
8001
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
8002
|
-
builder: (
|
|
8002
|
+
builder: (yargs42) => withConfiguration(
|
|
8003
8003
|
withApiOptions(
|
|
8004
8004
|
withProjectOptions(
|
|
8005
8005
|
withStateOptions(
|
|
8006
8006
|
withDiffOptions(
|
|
8007
|
-
|
|
8007
|
+
yargs42.positional("directory", {
|
|
8008
8008
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
8009
8009
|
type: "string"
|
|
8010
8010
|
}).option("mode", {
|
|
@@ -8073,10 +8073,10 @@ var PromptRemoveModule = {
|
|
|
8073
8073
|
command: "remove <id>",
|
|
8074
8074
|
aliases: ["delete", "rm"],
|
|
8075
8075
|
describe: "Delete a prompt",
|
|
8076
|
-
builder: (
|
|
8076
|
+
builder: (yargs42) => withConfiguration(
|
|
8077
8077
|
withDebugOptions(
|
|
8078
8078
|
withApiOptions(
|
|
8079
|
-
withProjectOptions(
|
|
8079
|
+
withProjectOptions(yargs42.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
8080
8080
|
)
|
|
8081
8081
|
)
|
|
8082
8082
|
),
|
|
@@ -8096,11 +8096,11 @@ var PromptUpdateModule = {
|
|
|
8096
8096
|
command: "update <filename>",
|
|
8097
8097
|
aliases: ["put"],
|
|
8098
8098
|
describe: "Insert or update a prompt",
|
|
8099
|
-
builder: (
|
|
8099
|
+
builder: (yargs42) => withConfiguration(
|
|
8100
8100
|
withDebugOptions(
|
|
8101
8101
|
withApiOptions(
|
|
8102
8102
|
withProjectOptions(
|
|
8103
|
-
|
|
8103
|
+
yargs42.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
8104
8104
|
)
|
|
8105
8105
|
)
|
|
8106
8106
|
)
|
|
@@ -8122,7 +8122,7 @@ var PromptModule = {
|
|
|
8122
8122
|
command: "prompt <command>",
|
|
8123
8123
|
aliases: ["dt"],
|
|
8124
8124
|
describe: "Commands for AI Prompt definitions",
|
|
8125
|
-
builder: (
|
|
8125
|
+
builder: (yargs42) => yargs42.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
8126
8126
|
handler: () => {
|
|
8127
8127
|
yargs18.help();
|
|
8128
8128
|
}
|
|
@@ -8172,12 +8172,12 @@ function createWorkflowEngineDataSource({
|
|
|
8172
8172
|
var WorkflowPullModule = {
|
|
8173
8173
|
command: "pull <directory>",
|
|
8174
8174
|
describe: "Pulls all workflows to local files in a directory",
|
|
8175
|
-
builder: (
|
|
8175
|
+
builder: (yargs42) => withConfiguration(
|
|
8176
8176
|
withApiOptions(
|
|
8177
8177
|
withDebugOptions(
|
|
8178
8178
|
withProjectOptions(
|
|
8179
8179
|
withDiffOptions(
|
|
8180
|
-
|
|
8180
|
+
yargs42.positional("directory", {
|
|
8181
8181
|
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.",
|
|
8182
8182
|
type: "string"
|
|
8183
8183
|
}).option("format", {
|
|
@@ -8252,12 +8252,12 @@ var WorkflowPullModule = {
|
|
|
8252
8252
|
var WorkflowPushModule = {
|
|
8253
8253
|
command: "push <directory>",
|
|
8254
8254
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
8255
|
-
builder: (
|
|
8255
|
+
builder: (yargs42) => withConfiguration(
|
|
8256
8256
|
withDebugOptions(
|
|
8257
8257
|
withApiOptions(
|
|
8258
8258
|
withProjectOptions(
|
|
8259
8259
|
withDiffOptions(
|
|
8260
|
-
|
|
8260
|
+
yargs42.positional("directory", {
|
|
8261
8261
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8262
8262
|
type: "string"
|
|
8263
8263
|
}).option("mode", {
|
|
@@ -8321,7 +8321,7 @@ var WorkflowModule = {
|
|
|
8321
8321
|
command: "workflow <command>",
|
|
8322
8322
|
aliases: ["wf"],
|
|
8323
8323
|
describe: "Commands for Canvas workflows",
|
|
8324
|
-
builder: (
|
|
8324
|
+
builder: (yargs42) => yargs42.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
8325
8325
|
handler: () => {
|
|
8326
8326
|
yargs19.help();
|
|
8327
8327
|
}
|
|
@@ -8332,7 +8332,7 @@ var CanvasCommand = {
|
|
|
8332
8332
|
command: "canvas <command>",
|
|
8333
8333
|
aliases: ["cv", "pm", "presentation"],
|
|
8334
8334
|
describe: "Uniform Canvas commands",
|
|
8335
|
-
builder: (
|
|
8335
|
+
builder: (yargs42) => yargs42.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LocaleModule).command(WorkflowModule).command(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
8336
8336
|
handler: () => {
|
|
8337
8337
|
yargs20.showHelp();
|
|
8338
8338
|
}
|
|
@@ -8354,11 +8354,11 @@ var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCa
|
|
|
8354
8354
|
var AggregateGetModule = {
|
|
8355
8355
|
command: "get <id>",
|
|
8356
8356
|
describe: "Fetch an aggregate",
|
|
8357
|
-
builder: (
|
|
8357
|
+
builder: (yargs42) => withConfiguration(
|
|
8358
8358
|
withFormatOptions(
|
|
8359
8359
|
withApiOptions(
|
|
8360
8360
|
withProjectOptions(
|
|
8361
|
-
|
|
8361
|
+
yargs42.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
8362
8362
|
)
|
|
8363
8363
|
)
|
|
8364
8364
|
)
|
|
@@ -8381,7 +8381,7 @@ var AggregateListModule = {
|
|
|
8381
8381
|
command: "list",
|
|
8382
8382
|
describe: "List aggregates",
|
|
8383
8383
|
aliases: ["ls"],
|
|
8384
|
-
builder: (
|
|
8384
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
8385
8385
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8386
8386
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8387
8387
|
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8444,12 +8444,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
8444
8444
|
var AggregatePullModule = {
|
|
8445
8445
|
command: "pull <directory>",
|
|
8446
8446
|
describe: "Pulls all aggregates to local files in a directory",
|
|
8447
|
-
builder: (
|
|
8447
|
+
builder: (yargs42) => withConfiguration(
|
|
8448
8448
|
withApiOptions(
|
|
8449
8449
|
withDebugOptions(
|
|
8450
8450
|
withProjectOptions(
|
|
8451
8451
|
withDiffOptions(
|
|
8452
|
-
|
|
8452
|
+
yargs42.positional("directory", {
|
|
8453
8453
|
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.",
|
|
8454
8454
|
type: "string"
|
|
8455
8455
|
}).option("format", {
|
|
@@ -8524,12 +8524,12 @@ var AggregatePullModule = {
|
|
|
8524
8524
|
var AggregatePushModule = {
|
|
8525
8525
|
command: "push <directory>",
|
|
8526
8526
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
8527
|
-
builder: (
|
|
8527
|
+
builder: (yargs42) => withConfiguration(
|
|
8528
8528
|
withApiOptions(
|
|
8529
8529
|
withProjectOptions(
|
|
8530
8530
|
withDiffOptions(
|
|
8531
8531
|
withDebugOptions(
|
|
8532
|
-
|
|
8532
|
+
yargs42.positional("directory", {
|
|
8533
8533
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
8534
8534
|
type: "string"
|
|
8535
8535
|
}).option("mode", {
|
|
@@ -8594,10 +8594,10 @@ var AggregateRemoveModule = {
|
|
|
8594
8594
|
command: "remove <id>",
|
|
8595
8595
|
aliases: ["delete", "rm"],
|
|
8596
8596
|
describe: "Delete an aggregate",
|
|
8597
|
-
builder: (
|
|
8597
|
+
builder: (yargs42) => withConfiguration(
|
|
8598
8598
|
withApiOptions(
|
|
8599
8599
|
withProjectOptions(
|
|
8600
|
-
|
|
8600
|
+
yargs42.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
8601
8601
|
)
|
|
8602
8602
|
)
|
|
8603
8603
|
),
|
|
@@ -8613,10 +8613,10 @@ var AggregateUpdateModule = {
|
|
|
8613
8613
|
command: "update <filename>",
|
|
8614
8614
|
aliases: ["put"],
|
|
8615
8615
|
describe: "Insert or update an aggregate",
|
|
8616
|
-
builder: (
|
|
8616
|
+
builder: (yargs42) => withConfiguration(
|
|
8617
8617
|
withApiOptions(
|
|
8618
8618
|
withProjectOptions(
|
|
8619
|
-
|
|
8619
|
+
yargs42.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
8620
8620
|
)
|
|
8621
8621
|
)
|
|
8622
8622
|
),
|
|
@@ -8633,7 +8633,7 @@ var AggregateModule = {
|
|
|
8633
8633
|
command: "aggregate <command>",
|
|
8634
8634
|
aliases: ["agg", "intent", "audience"],
|
|
8635
8635
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
8636
|
-
builder: (
|
|
8636
|
+
builder: (yargs42) => yargs42.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
8637
8637
|
handler: () => {
|
|
8638
8638
|
yargs21.help();
|
|
8639
8639
|
}
|
|
@@ -8654,11 +8654,11 @@ function getEnrichmentClient(options) {
|
|
|
8654
8654
|
var EnrichmentGetModule = {
|
|
8655
8655
|
command: "get <id>",
|
|
8656
8656
|
describe: "Fetch an enrichment category and its values",
|
|
8657
|
-
builder: (
|
|
8657
|
+
builder: (yargs42) => withFormatOptions(
|
|
8658
8658
|
withConfiguration(
|
|
8659
8659
|
withApiOptions(
|
|
8660
8660
|
withProjectOptions(
|
|
8661
|
-
|
|
8661
|
+
yargs42.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
8662
8662
|
)
|
|
8663
8663
|
)
|
|
8664
8664
|
)
|
|
@@ -8681,7 +8681,7 @@ var EnrichmentListModule = {
|
|
|
8681
8681
|
command: "list",
|
|
8682
8682
|
describe: "List enrichments",
|
|
8683
8683
|
aliases: ["ls"],
|
|
8684
|
-
builder: (
|
|
8684
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
8685
8685
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8686
8686
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8687
8687
|
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8776,12 +8776,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
8776
8776
|
var EnrichmentPullModule = {
|
|
8777
8777
|
command: "pull <directory>",
|
|
8778
8778
|
describe: "Pulls all enrichments to local files in a directory",
|
|
8779
|
-
builder: (
|
|
8779
|
+
builder: (yargs42) => withConfiguration(
|
|
8780
8780
|
withDebugOptions(
|
|
8781
8781
|
withApiOptions(
|
|
8782
8782
|
withProjectOptions(
|
|
8783
8783
|
withDiffOptions(
|
|
8784
|
-
|
|
8784
|
+
yargs42.positional("directory", {
|
|
8785
8785
|
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.",
|
|
8786
8786
|
type: "string"
|
|
8787
8787
|
}).option("format", {
|
|
@@ -8856,11 +8856,11 @@ var EnrichmentPullModule = {
|
|
|
8856
8856
|
var EnrichmentPushModule = {
|
|
8857
8857
|
command: "push <directory>",
|
|
8858
8858
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
8859
|
-
builder: (
|
|
8859
|
+
builder: (yargs42) => withConfiguration(
|
|
8860
8860
|
withApiOptions(
|
|
8861
8861
|
withProjectOptions(
|
|
8862
8862
|
withDiffOptions(
|
|
8863
|
-
|
|
8863
|
+
yargs42.positional("directory", {
|
|
8864
8864
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
8865
8865
|
type: "string"
|
|
8866
8866
|
}).option("mode", {
|
|
@@ -8923,10 +8923,10 @@ var EnrichmentRemoveModule = {
|
|
|
8923
8923
|
command: "remove <id>",
|
|
8924
8924
|
aliases: ["delete", "rm"],
|
|
8925
8925
|
describe: "Delete an enrichment category and its values",
|
|
8926
|
-
builder: (
|
|
8926
|
+
builder: (yargs42) => withConfiguration(
|
|
8927
8927
|
withApiOptions(
|
|
8928
8928
|
withProjectOptions(
|
|
8929
|
-
|
|
8929
|
+
yargs42.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
8930
8930
|
)
|
|
8931
8931
|
)
|
|
8932
8932
|
),
|
|
@@ -8942,7 +8942,7 @@ var EnrichmentModule = {
|
|
|
8942
8942
|
command: "enrichment <command>",
|
|
8943
8943
|
aliases: ["enr"],
|
|
8944
8944
|
describe: "Commands for Context enrichments",
|
|
8945
|
-
builder: (
|
|
8945
|
+
builder: (yargs42) => yargs42.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
8946
8946
|
handler: () => {
|
|
8947
8947
|
yargs22.help();
|
|
8948
8948
|
}
|
|
@@ -8960,10 +8960,10 @@ var ManifestGetModule = {
|
|
|
8960
8960
|
command: "get [output]",
|
|
8961
8961
|
aliases: ["dl", "download"],
|
|
8962
8962
|
describe: "Download the Uniform Context manifest for a project",
|
|
8963
|
-
builder: (
|
|
8963
|
+
builder: (yargs42) => withConfiguration(
|
|
8964
8964
|
withApiOptions(
|
|
8965
8965
|
withProjectOptions(
|
|
8966
|
-
|
|
8966
|
+
yargs42.option("preview", {
|
|
8967
8967
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
8968
8968
|
default: false,
|
|
8969
8969
|
type: "boolean",
|
|
@@ -9025,7 +9025,7 @@ import { exit as exit2 } from "process";
|
|
|
9025
9025
|
var ManifestPublishModule = {
|
|
9026
9026
|
command: "publish",
|
|
9027
9027
|
describe: "Publish the Uniform Context manifest for a project",
|
|
9028
|
-
builder: (
|
|
9028
|
+
builder: (yargs42) => withConfiguration(withApiOptions(withProjectOptions(yargs42))),
|
|
9029
9029
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
9030
9030
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9031
9031
|
try {
|
|
@@ -9058,7 +9058,7 @@ var ManifestModule = {
|
|
|
9058
9058
|
command: "manifest <command>",
|
|
9059
9059
|
describe: "Commands for context manifests",
|
|
9060
9060
|
aliases: ["man"],
|
|
9061
|
-
builder: (
|
|
9061
|
+
builder: (yargs42) => yargs42.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
9062
9062
|
handler: () => {
|
|
9063
9063
|
yargs23.help();
|
|
9064
9064
|
}
|
|
@@ -9072,11 +9072,11 @@ import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
|
9072
9072
|
var QuirkGetModule = {
|
|
9073
9073
|
command: "get <id>",
|
|
9074
9074
|
describe: "Fetch a quirk",
|
|
9075
|
-
builder: (
|
|
9075
|
+
builder: (yargs42) => withConfiguration(
|
|
9076
9076
|
withFormatOptions(
|
|
9077
9077
|
withApiOptions(
|
|
9078
9078
|
withProjectOptions(
|
|
9079
|
-
|
|
9079
|
+
yargs42.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
9080
9080
|
)
|
|
9081
9081
|
)
|
|
9082
9082
|
)
|
|
@@ -9100,11 +9100,11 @@ var QuirkListModule = {
|
|
|
9100
9100
|
command: "list",
|
|
9101
9101
|
describe: "List quirks",
|
|
9102
9102
|
aliases: ["ls"],
|
|
9103
|
-
builder: (
|
|
9103
|
+
builder: (yargs42) => withConfiguration(
|
|
9104
9104
|
withFormatOptions(
|
|
9105
9105
|
withApiOptions(
|
|
9106
9106
|
withProjectOptions(
|
|
9107
|
-
|
|
9107
|
+
yargs42.option("withIntegrations", {
|
|
9108
9108
|
alias: ["i"],
|
|
9109
9109
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
9110
9110
|
type: "boolean"
|
|
@@ -9162,12 +9162,12 @@ function createQuirkEngineDataSource({
|
|
|
9162
9162
|
var QuirkPullModule = {
|
|
9163
9163
|
command: "pull <directory>",
|
|
9164
9164
|
describe: "Pulls all quirks to local files in a directory",
|
|
9165
|
-
builder: (
|
|
9165
|
+
builder: (yargs42) => withConfiguration(
|
|
9166
9166
|
withDebugOptions(
|
|
9167
9167
|
withApiOptions(
|
|
9168
9168
|
withProjectOptions(
|
|
9169
9169
|
withDiffOptions(
|
|
9170
|
-
|
|
9170
|
+
yargs42.positional("directory", {
|
|
9171
9171
|
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.",
|
|
9172
9172
|
type: "string"
|
|
9173
9173
|
}).option("format", {
|
|
@@ -9243,12 +9243,12 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
9243
9243
|
var QuirkPushModule = {
|
|
9244
9244
|
command: "push <directory>",
|
|
9245
9245
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
9246
|
-
builder: (
|
|
9246
|
+
builder: (yargs42) => withConfiguration(
|
|
9247
9247
|
withDebugOptions(
|
|
9248
9248
|
withApiOptions(
|
|
9249
9249
|
withProjectOptions(
|
|
9250
9250
|
withDiffOptions(
|
|
9251
|
-
|
|
9251
|
+
yargs42.positional("directory", {
|
|
9252
9252
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
9253
9253
|
type: "string"
|
|
9254
9254
|
}).option("mode", {
|
|
@@ -9313,10 +9313,10 @@ var QuirkRemoveModule = {
|
|
|
9313
9313
|
command: "remove <id>",
|
|
9314
9314
|
aliases: ["delete", "rm"],
|
|
9315
9315
|
describe: "Delete a quirk",
|
|
9316
|
-
builder: (
|
|
9316
|
+
builder: (yargs42) => withConfiguration(
|
|
9317
9317
|
withApiOptions(
|
|
9318
9318
|
withProjectOptions(
|
|
9319
|
-
|
|
9319
|
+
yargs42.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
9320
9320
|
)
|
|
9321
9321
|
)
|
|
9322
9322
|
),
|
|
@@ -9333,10 +9333,10 @@ var QuirkUpdateModule = {
|
|
|
9333
9333
|
command: "update <filename>",
|
|
9334
9334
|
aliases: ["put"],
|
|
9335
9335
|
describe: "Insert or update a quirk",
|
|
9336
|
-
builder: (
|
|
9336
|
+
builder: (yargs42) => withConfiguration(
|
|
9337
9337
|
withApiOptions(
|
|
9338
9338
|
withProjectOptions(
|
|
9339
|
-
|
|
9339
|
+
yargs42.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
9340
9340
|
)
|
|
9341
9341
|
)
|
|
9342
9342
|
),
|
|
@@ -9353,7 +9353,7 @@ var QuirkModule = {
|
|
|
9353
9353
|
command: "quirk <command>",
|
|
9354
9354
|
aliases: ["qk"],
|
|
9355
9355
|
describe: "Commands for Context quirks",
|
|
9356
|
-
builder: (
|
|
9356
|
+
builder: (yargs42) => yargs42.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
9357
9357
|
handler: () => {
|
|
9358
9358
|
yargs24.help();
|
|
9359
9359
|
}
|
|
@@ -9367,11 +9367,11 @@ import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
|
9367
9367
|
var SignalGetModule = {
|
|
9368
9368
|
command: "get <id>",
|
|
9369
9369
|
describe: "Fetch a signal",
|
|
9370
|
-
builder: (
|
|
9370
|
+
builder: (yargs42) => withConfiguration(
|
|
9371
9371
|
withFormatOptions(
|
|
9372
9372
|
withApiOptions(
|
|
9373
9373
|
withProjectOptions(
|
|
9374
|
-
|
|
9374
|
+
yargs42.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
9375
9375
|
)
|
|
9376
9376
|
)
|
|
9377
9377
|
)
|
|
@@ -9395,7 +9395,7 @@ var SignalListModule = {
|
|
|
9395
9395
|
command: "list",
|
|
9396
9396
|
describe: "List signals",
|
|
9397
9397
|
aliases: ["ls"],
|
|
9398
|
-
builder: (
|
|
9398
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
9399
9399
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9400
9400
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9401
9401
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9445,12 +9445,12 @@ function createSignalEngineDataSource({
|
|
|
9445
9445
|
var SignalPullModule = {
|
|
9446
9446
|
command: "pull <directory>",
|
|
9447
9447
|
describe: "Pulls all signals to local files in a directory",
|
|
9448
|
-
builder: (
|
|
9448
|
+
builder: (yargs42) => withConfiguration(
|
|
9449
9449
|
withDebugOptions(
|
|
9450
9450
|
withApiOptions(
|
|
9451
9451
|
withProjectOptions(
|
|
9452
9452
|
withDiffOptions(
|
|
9453
|
-
|
|
9453
|
+
yargs42.positional("directory", {
|
|
9454
9454
|
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.",
|
|
9455
9455
|
type: "string"
|
|
9456
9456
|
}).option("format", {
|
|
@@ -9526,12 +9526,12 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
9526
9526
|
var SignalPushModule = {
|
|
9527
9527
|
command: "push <directory>",
|
|
9528
9528
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
9529
|
-
builder: (
|
|
9529
|
+
builder: (yargs42) => withConfiguration(
|
|
9530
9530
|
withDebugOptions(
|
|
9531
9531
|
withApiOptions(
|
|
9532
9532
|
withProjectOptions(
|
|
9533
9533
|
withDiffOptions(
|
|
9534
|
-
|
|
9534
|
+
yargs42.positional("directory", {
|
|
9535
9535
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
9536
9536
|
type: "string"
|
|
9537
9537
|
}).option("mode", {
|
|
@@ -9596,10 +9596,10 @@ var SignalRemoveModule = {
|
|
|
9596
9596
|
command: "remove <id>",
|
|
9597
9597
|
aliases: ["delete", "rm"],
|
|
9598
9598
|
describe: "Delete a signal",
|
|
9599
|
-
builder: (
|
|
9599
|
+
builder: (yargs42) => withConfiguration(
|
|
9600
9600
|
withApiOptions(
|
|
9601
9601
|
withProjectOptions(
|
|
9602
|
-
|
|
9602
|
+
yargs42.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
9603
9603
|
)
|
|
9604
9604
|
)
|
|
9605
9605
|
),
|
|
@@ -9616,10 +9616,10 @@ var SignalUpdateModule = {
|
|
|
9616
9616
|
command: "update <filename>",
|
|
9617
9617
|
aliases: ["put"],
|
|
9618
9618
|
describe: "Insert or update a signal",
|
|
9619
|
-
builder: (
|
|
9619
|
+
builder: (yargs42) => withConfiguration(
|
|
9620
9620
|
withApiOptions(
|
|
9621
9621
|
withProjectOptions(
|
|
9622
|
-
|
|
9622
|
+
yargs42.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
9623
9623
|
)
|
|
9624
9624
|
)
|
|
9625
9625
|
),
|
|
@@ -9636,7 +9636,7 @@ var SignalModule = {
|
|
|
9636
9636
|
command: "signal <command>",
|
|
9637
9637
|
aliases: ["sig"],
|
|
9638
9638
|
describe: "Commands for Context signals",
|
|
9639
|
-
builder: (
|
|
9639
|
+
builder: (yargs42) => yargs42.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
9640
9640
|
handler: () => {
|
|
9641
9641
|
yargs25.help();
|
|
9642
9642
|
}
|
|
@@ -9650,11 +9650,11 @@ import { UncachedTestClient } from "@uniformdev/context/api";
|
|
|
9650
9650
|
var TestGetModule = {
|
|
9651
9651
|
command: "get <id>",
|
|
9652
9652
|
describe: "Fetch a test",
|
|
9653
|
-
builder: (
|
|
9653
|
+
builder: (yargs42) => withConfiguration(
|
|
9654
9654
|
withFormatOptions(
|
|
9655
9655
|
withApiOptions(
|
|
9656
9656
|
withProjectOptions(
|
|
9657
|
-
|
|
9657
|
+
yargs42.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
9658
9658
|
)
|
|
9659
9659
|
)
|
|
9660
9660
|
)
|
|
@@ -9678,7 +9678,7 @@ var TestListModule = {
|
|
|
9678
9678
|
command: "list",
|
|
9679
9679
|
describe: "List tests",
|
|
9680
9680
|
aliases: ["ls"],
|
|
9681
|
-
builder: (
|
|
9681
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
9682
9682
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9683
9683
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9684
9684
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9728,12 +9728,12 @@ function createTestEngineDataSource({
|
|
|
9728
9728
|
var TestPullModule = {
|
|
9729
9729
|
command: "pull <directory>",
|
|
9730
9730
|
describe: "Pulls all tests to local files in a directory",
|
|
9731
|
-
builder: (
|
|
9731
|
+
builder: (yargs42) => withConfiguration(
|
|
9732
9732
|
withDebugOptions(
|
|
9733
9733
|
withApiOptions(
|
|
9734
9734
|
withProjectOptions(
|
|
9735
9735
|
withDiffOptions(
|
|
9736
|
-
|
|
9736
|
+
yargs42.positional("directory", {
|
|
9737
9737
|
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.",
|
|
9738
9738
|
type: "string"
|
|
9739
9739
|
}).option("format", {
|
|
@@ -9809,12 +9809,12 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
9809
9809
|
var TestPushModule = {
|
|
9810
9810
|
command: "push <directory>",
|
|
9811
9811
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
9812
|
-
builder: (
|
|
9812
|
+
builder: (yargs42) => withConfiguration(
|
|
9813
9813
|
withDebugOptions(
|
|
9814
9814
|
withApiOptions(
|
|
9815
9815
|
withProjectOptions(
|
|
9816
9816
|
withDiffOptions(
|
|
9817
|
-
|
|
9817
|
+
yargs42.positional("directory", {
|
|
9818
9818
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
9819
9819
|
type: "string"
|
|
9820
9820
|
}).option("mode", {
|
|
@@ -9879,10 +9879,10 @@ var TestRemoveModule = {
|
|
|
9879
9879
|
command: "remove <id>",
|
|
9880
9880
|
aliases: ["delete", "rm"],
|
|
9881
9881
|
describe: "Delete a test",
|
|
9882
|
-
builder: (
|
|
9882
|
+
builder: (yargs42) => withConfiguration(
|
|
9883
9883
|
withApiOptions(
|
|
9884
9884
|
withProjectOptions(
|
|
9885
|
-
|
|
9885
|
+
yargs42.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
9886
9886
|
)
|
|
9887
9887
|
)
|
|
9888
9888
|
),
|
|
@@ -9899,9 +9899,9 @@ var TestUpdateModule = {
|
|
|
9899
9899
|
command: "update <filename>",
|
|
9900
9900
|
aliases: ["put"],
|
|
9901
9901
|
describe: "Insert or update a test",
|
|
9902
|
-
builder: (
|
|
9902
|
+
builder: (yargs42) => withConfiguration(
|
|
9903
9903
|
withApiOptions(
|
|
9904
|
-
withProjectOptions(
|
|
9904
|
+
withProjectOptions(yargs42.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
9905
9905
|
)
|
|
9906
9906
|
),
|
|
9907
9907
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -9916,7 +9916,7 @@ var TestUpdateModule = {
|
|
|
9916
9916
|
var TestModule = {
|
|
9917
9917
|
command: "test <command>",
|
|
9918
9918
|
describe: "Commands for Context A/B tests",
|
|
9919
|
-
builder: (
|
|
9919
|
+
builder: (yargs42) => yargs42.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
9920
9920
|
handler: () => {
|
|
9921
9921
|
yargs26.help();
|
|
9922
9922
|
}
|
|
@@ -9927,7 +9927,7 @@ var ContextCommand = {
|
|
|
9927
9927
|
command: "context <command>",
|
|
9928
9928
|
aliases: ["ctx"],
|
|
9929
9929
|
describe: "Uniform Context commands",
|
|
9930
|
-
builder: (
|
|
9930
|
+
builder: (yargs42) => yargs42.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
9931
9931
|
handler: () => {
|
|
9932
9932
|
yargs27.showHelp();
|
|
9933
9933
|
}
|
|
@@ -10011,8 +10011,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
10011
10011
|
};
|
|
10012
10012
|
|
|
10013
10013
|
// src/commands/integration/commands/definition/dataResourceEditor/util.ts
|
|
10014
|
-
function withDataResourceEditorIdOptions(
|
|
10015
|
-
return
|
|
10014
|
+
function withDataResourceEditorIdOptions(yargs42) {
|
|
10015
|
+
return yargs42.option("connectorType", {
|
|
10016
10016
|
describe: "Integration data connector type to attach the data resource editor to, as defined in the integration manifest file.",
|
|
10017
10017
|
demandOption: true,
|
|
10018
10018
|
type: "string"
|
|
@@ -10032,11 +10032,11 @@ function withDataResourceEditorIdOptions(yargs41) {
|
|
|
10032
10032
|
var IntegrationDataResourceEditorDeployModule = {
|
|
10033
10033
|
command: "deploy <filename>",
|
|
10034
10034
|
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.",
|
|
10035
|
-
builder: (
|
|
10035
|
+
builder: (yargs42) => withConfiguration(
|
|
10036
10036
|
withApiOptions(
|
|
10037
10037
|
withTeamOptions(
|
|
10038
10038
|
withDataResourceEditorIdOptions(
|
|
10039
|
-
|
|
10039
|
+
yargs42.positional("filename", {
|
|
10040
10040
|
demandOption: true,
|
|
10041
10041
|
describe: "ESM code file to run for the target data resource editor hook. Refer to the documentation for expected types."
|
|
10042
10042
|
}).option("compatibilityDate", {
|
|
@@ -10079,7 +10079,7 @@ var IntegrationDataResourceEditorDeployModule = {
|
|
|
10079
10079
|
var IntegrationDataResourceEditorRemoveModule = {
|
|
10080
10080
|
command: "remove",
|
|
10081
10081
|
describe: "Removes a custom AI data resource editor hook from a data resource archetype. The API key used must have team admin permissions.",
|
|
10082
|
-
builder: (
|
|
10082
|
+
builder: (yargs42) => withConfiguration(withApiOptions(withTeamOptions(withDataResourceEditorIdOptions(yargs42)))),
|
|
10083
10083
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, connectorType, archetype, hook }) => {
|
|
10084
10084
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10085
10085
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10091,7 +10091,7 @@ var IntegrationDataResourceEditorRemoveModule = {
|
|
|
10091
10091
|
var IntegrationDataResourceEditorModule = {
|
|
10092
10092
|
command: "dataResourceEditor <command>",
|
|
10093
10093
|
describe: "Commands for managing custom AI data resource editors at the team level.",
|
|
10094
|
-
builder: (
|
|
10094
|
+
builder: (yargs42) => yargs42.command(IntegrationDataResourceEditorDeployModule).command(IntegrationDataResourceEditorRemoveModule).demandCommand(),
|
|
10095
10095
|
handler: () => {
|
|
10096
10096
|
yargs28.help();
|
|
10097
10097
|
}
|
|
@@ -10104,8 +10104,8 @@ import yargs29 from "yargs";
|
|
|
10104
10104
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10105
10105
|
|
|
10106
10106
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
10107
|
-
function withEdgehancerIdOptions(
|
|
10108
|
-
return
|
|
10107
|
+
function withEdgehancerIdOptions(yargs42) {
|
|
10108
|
+
return yargs42.option("connectorType", {
|
|
10109
10109
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
10110
10110
|
demandOption: true,
|
|
10111
10111
|
type: "string"
|
|
@@ -10125,11 +10125,11 @@ function withEdgehancerIdOptions(yargs41) {
|
|
|
10125
10125
|
var IntegrationEdgehancerDeployModule = {
|
|
10126
10126
|
command: "deploy <filename>",
|
|
10127
10127
|
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.",
|
|
10128
|
-
builder: (
|
|
10128
|
+
builder: (yargs42) => withConfiguration(
|
|
10129
10129
|
withApiOptions(
|
|
10130
10130
|
withTeamOptions(
|
|
10131
10131
|
withEdgehancerIdOptions(
|
|
10132
|
-
|
|
10132
|
+
yargs42.positional("filename", {
|
|
10133
10133
|
demandOption: true,
|
|
10134
10134
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
10135
10135
|
}).option("compatibilityDate", {
|
|
@@ -10172,7 +10172,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
10172
10172
|
var IntegrationEdgehancerRemoveModule = {
|
|
10173
10173
|
command: "remove",
|
|
10174
10174
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
10175
|
-
builder: (
|
|
10175
|
+
builder: (yargs42) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs42)))),
|
|
10176
10176
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
10177
10177
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10178
10178
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10184,7 +10184,7 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
10184
10184
|
var IntegrationEdgehancerModule = {
|
|
10185
10185
|
command: "edgehancer <command>",
|
|
10186
10186
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
10187
|
-
builder: (
|
|
10187
|
+
builder: (yargs42) => yargs42.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
10188
10188
|
handler: () => {
|
|
10189
10189
|
yargs29.help();
|
|
10190
10190
|
}
|
|
@@ -10198,8 +10198,8 @@ import { IntegrationPropertyEditorsClient } from "@uniformdev/canvas";
|
|
|
10198
10198
|
import { readFileSync as readFileSync4 } from "fs";
|
|
10199
10199
|
|
|
10200
10200
|
// src/commands/integration/commands/definition/propertyEditor/util.ts
|
|
10201
|
-
function withPropertyEditorIdOptions(
|
|
10202
|
-
return
|
|
10201
|
+
function withPropertyEditorIdOptions(yargs42) {
|
|
10202
|
+
return yargs42.option("propertyType", {
|
|
10203
10203
|
describe: "Property type to attach the editor to.",
|
|
10204
10204
|
demandOption: true,
|
|
10205
10205
|
type: "string"
|
|
@@ -10215,11 +10215,11 @@ function withPropertyEditorIdOptions(yargs41) {
|
|
|
10215
10215
|
var IntegrationPropertyEditorDeployModule = {
|
|
10216
10216
|
command: "deploy <filename>",
|
|
10217
10217
|
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.",
|
|
10218
|
-
builder: (
|
|
10218
|
+
builder: (yargs42) => withConfiguration(
|
|
10219
10219
|
withApiOptions(
|
|
10220
10220
|
withTeamOptions(
|
|
10221
10221
|
withPropertyEditorIdOptions(
|
|
10222
|
-
|
|
10222
|
+
yargs42.positional("filename", {
|
|
10223
10223
|
demandOption: true,
|
|
10224
10224
|
describe: "ESM code file to run for the target property editor hook. Refer to the documentation for expected types."
|
|
10225
10225
|
}).option("compatibilityDate", {
|
|
@@ -10262,7 +10262,7 @@ import { IntegrationPropertyEditorsClient as IntegrationPropertyEditorsClient2 }
|
|
|
10262
10262
|
var IntegrationPropertyEditorRemoveModule = {
|
|
10263
10263
|
command: "remove",
|
|
10264
10264
|
describe: "Deletes a custom AI property editor hook from a property type. The API key used must have team admin permissions.",
|
|
10265
|
-
builder: (
|
|
10265
|
+
builder: (yargs42) => withConfiguration(withApiOptions(withTeamOptions(withPropertyEditorIdOptions(yargs42)))),
|
|
10266
10266
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, propertyType, hook }) => {
|
|
10267
10267
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10268
10268
|
const client = new IntegrationPropertyEditorsClient2({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10274,7 +10274,7 @@ var IntegrationPropertyEditorRemoveModule = {
|
|
|
10274
10274
|
var IntegrationPropertyEditorModule = {
|
|
10275
10275
|
command: "propertyEditor <command>",
|
|
10276
10276
|
describe: "Commands for managing custom AI property editors at the team level.",
|
|
10277
|
-
builder: (
|
|
10277
|
+
builder: (yargs42) => yargs42.command(IntegrationPropertyEditorDeployModule).command(IntegrationPropertyEditorRemoveModule).demandCommand(),
|
|
10278
10278
|
handler: () => {
|
|
10279
10279
|
yargs30.help();
|
|
10280
10280
|
}
|
|
@@ -10316,10 +10316,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
10316
10316
|
var IntegrationDefinitionRegisterModule = {
|
|
10317
10317
|
command: "register <filename>",
|
|
10318
10318
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
10319
|
-
builder: (
|
|
10319
|
+
builder: (yargs42) => withConfiguration(
|
|
10320
10320
|
withApiOptions(
|
|
10321
10321
|
withTeamOptions(
|
|
10322
|
-
|
|
10322
|
+
yargs42.positional("filename", {
|
|
10323
10323
|
demandOption: true,
|
|
10324
10324
|
describe: "Integration definition manifest to register"
|
|
10325
10325
|
})
|
|
@@ -10338,10 +10338,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
10338
10338
|
var IntegrationDefinitionRemoveModule = {
|
|
10339
10339
|
command: "remove <type>",
|
|
10340
10340
|
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.",
|
|
10341
|
-
builder: (
|
|
10341
|
+
builder: (yargs42) => withConfiguration(
|
|
10342
10342
|
withApiOptions(
|
|
10343
10343
|
withTeamOptions(
|
|
10344
|
-
|
|
10344
|
+
yargs42.positional("type", {
|
|
10345
10345
|
demandOption: true,
|
|
10346
10346
|
describe: "Integration type (from its manifest) to remove."
|
|
10347
10347
|
})
|
|
@@ -10359,7 +10359,7 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
10359
10359
|
var IntegrationDefinitionModule = {
|
|
10360
10360
|
command: "definition <command>",
|
|
10361
10361
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
10362
|
-
builder: (
|
|
10362
|
+
builder: (yargs42) => yargs42.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).command(IntegrationDataResourceEditorModule).command(IntegrationPropertyEditorModule).demandCommand(),
|
|
10363
10363
|
handler: () => {
|
|
10364
10364
|
yargs31.help();
|
|
10365
10365
|
}
|
|
@@ -10401,10 +10401,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
10401
10401
|
var IntegrationInstallModule = {
|
|
10402
10402
|
command: "install <type>",
|
|
10403
10403
|
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.",
|
|
10404
|
-
builder: (
|
|
10404
|
+
builder: (yargs42) => withConfiguration(
|
|
10405
10405
|
withApiOptions(
|
|
10406
10406
|
withProjectOptions(
|
|
10407
|
-
|
|
10407
|
+
yargs42.positional("type", {
|
|
10408
10408
|
demandOption: true,
|
|
10409
10409
|
describe: "Integration type to install (as defined in its manifest)"
|
|
10410
10410
|
}).option("configuration", {
|
|
@@ -10426,10 +10426,10 @@ var IntegrationInstallModule = {
|
|
|
10426
10426
|
var IntegrationUninstallModule = {
|
|
10427
10427
|
command: "uninstall <type>",
|
|
10428
10428
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
10429
|
-
builder: (
|
|
10429
|
+
builder: (yargs42) => withConfiguration(
|
|
10430
10430
|
withApiOptions(
|
|
10431
10431
|
withProjectOptions(
|
|
10432
|
-
|
|
10432
|
+
yargs42.positional("type", {
|
|
10433
10433
|
demandOption: true,
|
|
10434
10434
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
10435
10435
|
})
|
|
@@ -10447,7 +10447,7 @@ var IntegrationUninstallModule = {
|
|
|
10447
10447
|
var IntegrationCommand = {
|
|
10448
10448
|
command: "integration <command>",
|
|
10449
10449
|
describe: "Integration management commands",
|
|
10450
|
-
builder: (
|
|
10450
|
+
builder: (yargs42) => yargs42.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
10451
10451
|
handler: () => {
|
|
10452
10452
|
yargs32.showHelp();
|
|
10453
10453
|
}
|
|
@@ -10913,16 +10913,360 @@ var NewMeshCmd = {
|
|
|
10913
10913
|
}
|
|
10914
10914
|
};
|
|
10915
10915
|
|
|
10916
|
+
// src/commands/policy-documents/index.ts
|
|
10917
|
+
import yargs33 from "yargs";
|
|
10918
|
+
|
|
10919
|
+
// src/commands/policy-documents/commands/list.ts
|
|
10920
|
+
var PolicyDocumentsListModule = {
|
|
10921
|
+
command: "list",
|
|
10922
|
+
describe: "List policy documents for a project",
|
|
10923
|
+
aliases: ["ls"],
|
|
10924
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
10925
|
+
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
10926
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
10927
|
+
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
10928
|
+
url.searchParams.set("projectId", projectId);
|
|
10929
|
+
const response = await fetch2(url.toString(), {
|
|
10930
|
+
method: "GET",
|
|
10931
|
+
headers: {
|
|
10932
|
+
"x-api-key": apiKey,
|
|
10933
|
+
"Content-Type": "application/json"
|
|
10934
|
+
}
|
|
10935
|
+
});
|
|
10936
|
+
if (!response.ok) {
|
|
10937
|
+
const errorText = await response.text();
|
|
10938
|
+
throw new Error(
|
|
10939
|
+
`Failed to fetch policy documents: ${response.status} ${response.statusText}
|
|
10940
|
+
${errorText}`
|
|
10941
|
+
);
|
|
10942
|
+
}
|
|
10943
|
+
const policyDocuments = await response.json();
|
|
10944
|
+
emitWithFormat(policyDocuments, format, filename);
|
|
10945
|
+
}
|
|
10946
|
+
};
|
|
10947
|
+
|
|
10948
|
+
// src/commands/policy-documents/policyDocumentsEngineDataSource.ts
|
|
10949
|
+
function createPolicyDocumentsEngineDataSource({
|
|
10950
|
+
apiHost,
|
|
10951
|
+
apiKey,
|
|
10952
|
+
projectId,
|
|
10953
|
+
fetch: fetch2
|
|
10954
|
+
}) {
|
|
10955
|
+
async function* getObjects() {
|
|
10956
|
+
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
10957
|
+
url.searchParams.set("projectId", projectId);
|
|
10958
|
+
const response = await fetch2(url.toString(), {
|
|
10959
|
+
method: "GET",
|
|
10960
|
+
headers: {
|
|
10961
|
+
"x-api-key": apiKey,
|
|
10962
|
+
"Content-Type": "application/json"
|
|
10963
|
+
}
|
|
10964
|
+
});
|
|
10965
|
+
if (!response.ok) {
|
|
10966
|
+
const errorText = await response.text();
|
|
10967
|
+
throw new Error(
|
|
10968
|
+
`Failed to fetch policy documents: ${response.status} ${response.statusText}
|
|
10969
|
+
${errorText}`
|
|
10970
|
+
);
|
|
10971
|
+
}
|
|
10972
|
+
const policyDocuments = await response.json();
|
|
10973
|
+
for (const [roleId, document] of Object.entries(policyDocuments)) {
|
|
10974
|
+
yield {
|
|
10975
|
+
id: roleId,
|
|
10976
|
+
displayName: `Policy document for role ${roleId}`,
|
|
10977
|
+
providerId: roleId,
|
|
10978
|
+
object: {
|
|
10979
|
+
...document ?? {},
|
|
10980
|
+
roleId
|
|
10981
|
+
}
|
|
10982
|
+
};
|
|
10983
|
+
}
|
|
10984
|
+
}
|
|
10985
|
+
return {
|
|
10986
|
+
name: "Uniform API",
|
|
10987
|
+
objects: getObjects(),
|
|
10988
|
+
// No-op: The policy documents API only supports bulk replacement via PUT.
|
|
10989
|
+
// Individual delete operations are not available - deletion happens when
|
|
10990
|
+
// a document is omitted from the bulk PUT request.
|
|
10991
|
+
deleteObject: async () => {
|
|
10992
|
+
},
|
|
10993
|
+
// No-op: The policy documents API only supports bulk replacement via PUT.
|
|
10994
|
+
// Individual write operations are not available - the push command handler
|
|
10995
|
+
// collects all documents and performs a single bulk PUT.
|
|
10996
|
+
writeObject: async () => {
|
|
10997
|
+
}
|
|
10998
|
+
};
|
|
10999
|
+
}
|
|
11000
|
+
|
|
11001
|
+
// src/commands/policy-documents/commands/_util.ts
|
|
11002
|
+
var selectIdentifier13 = (policyDoc) => policyDoc.roleId;
|
|
11003
|
+
var selectDisplayName13 = (policyDoc) => `Policy document for role ${policyDoc.roleId}`;
|
|
11004
|
+
|
|
11005
|
+
// src/commands/policy-documents/commands/pull.ts
|
|
11006
|
+
var PolicyDocumentsPullModule = {
|
|
11007
|
+
command: "pull <directory>",
|
|
11008
|
+
describe: "Pulls all policy documents to local files in a directory",
|
|
11009
|
+
builder: (yargs42) => withConfiguration(
|
|
11010
|
+
withApiOptions(
|
|
11011
|
+
withDebugOptions(
|
|
11012
|
+
withProjectOptions(
|
|
11013
|
+
withDiffOptions(
|
|
11014
|
+
yargs42.positional("directory", {
|
|
11015
|
+
describe: "Directory to save to. Each policy document will be saved as a separate file named by role ID.",
|
|
11016
|
+
type: "string"
|
|
11017
|
+
}).option("format", {
|
|
11018
|
+
alias: ["f"],
|
|
11019
|
+
describe: "Output format",
|
|
11020
|
+
default: "yaml",
|
|
11021
|
+
choices: ["yaml", "json"],
|
|
11022
|
+
type: "string"
|
|
11023
|
+
}).option("mode", {
|
|
11024
|
+
alias: ["m"],
|
|
11025
|
+
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',
|
|
11026
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
11027
|
+
default: "mirror",
|
|
11028
|
+
type: "string"
|
|
11029
|
+
})
|
|
11030
|
+
)
|
|
11031
|
+
)
|
|
11032
|
+
)
|
|
11033
|
+
)
|
|
11034
|
+
),
|
|
11035
|
+
handler: async ({
|
|
11036
|
+
apiHost,
|
|
11037
|
+
apiKey,
|
|
11038
|
+
proxy,
|
|
11039
|
+
directory,
|
|
11040
|
+
format,
|
|
11041
|
+
mode,
|
|
11042
|
+
whatIf,
|
|
11043
|
+
project: projectId,
|
|
11044
|
+
diff: diffMode,
|
|
11045
|
+
allowEmptySource,
|
|
11046
|
+
verbose
|
|
11047
|
+
}) => {
|
|
11048
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
11049
|
+
const source = createPolicyDocumentsEngineDataSource({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
11050
|
+
const target = await createFileSyncEngineDataSource({
|
|
11051
|
+
directory,
|
|
11052
|
+
selectIdentifier: selectIdentifier13,
|
|
11053
|
+
selectDisplayName: selectDisplayName13,
|
|
11054
|
+
format,
|
|
11055
|
+
verbose
|
|
11056
|
+
});
|
|
11057
|
+
await syncEngine({
|
|
11058
|
+
source,
|
|
11059
|
+
target,
|
|
11060
|
+
mode,
|
|
11061
|
+
whatIf,
|
|
11062
|
+
allowEmptySource: allowEmptySource ?? true,
|
|
11063
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
11064
|
+
});
|
|
11065
|
+
}
|
|
11066
|
+
};
|
|
11067
|
+
|
|
11068
|
+
// src/commands/policy-documents/commands/push.ts
|
|
11069
|
+
import { readdir as readdir2, stat } from "fs/promises";
|
|
11070
|
+
import { extname as extname2, join as join11 } from "path";
|
|
11071
|
+
async function readLocalPolicyDocuments(directory, format, verbose) {
|
|
11072
|
+
const files = await readdir2(directory);
|
|
11073
|
+
const policyDocuments = {};
|
|
11074
|
+
const errors = [];
|
|
11075
|
+
for (const filename of files) {
|
|
11076
|
+
const ext = extname2(filename);
|
|
11077
|
+
if (ext !== `.${format}` && ext !== ".yaml" && ext !== ".yml" && ext !== ".json") {
|
|
11078
|
+
continue;
|
|
11079
|
+
}
|
|
11080
|
+
const filePath = join11(directory, filename);
|
|
11081
|
+
try {
|
|
11082
|
+
let roleId = filename.replace(ext, "");
|
|
11083
|
+
const fileContent = readFileToObject(filePath);
|
|
11084
|
+
let policyDoc;
|
|
11085
|
+
if (typeof fileContent === "object" && fileContent !== null && "roleId" in fileContent && typeof fileContent.roleId === "string") {
|
|
11086
|
+
const { roleId: _, ...doc } = fileContent;
|
|
11087
|
+
roleId = fileContent.roleId;
|
|
11088
|
+
policyDoc = doc;
|
|
11089
|
+
} else {
|
|
11090
|
+
policyDoc = fileContent;
|
|
11091
|
+
}
|
|
11092
|
+
policyDocuments[roleId] = policyDoc;
|
|
11093
|
+
} catch (e) {
|
|
11094
|
+
errors.push(`Failed to read ${filePath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
11095
|
+
}
|
|
11096
|
+
}
|
|
11097
|
+
if (errors.length > 0) {
|
|
11098
|
+
console.warn(`Warning: ${errors.length} file(s) could not be read:`);
|
|
11099
|
+
for (const error of errors) {
|
|
11100
|
+
console.warn(` ${error}`);
|
|
11101
|
+
}
|
|
11102
|
+
}
|
|
11103
|
+
if (verbose && Object.keys(policyDocuments).length > 0) {
|
|
11104
|
+
console.log(`Read ${Object.keys(policyDocuments).length} policy document(s) from ${directory}`);
|
|
11105
|
+
}
|
|
11106
|
+
return policyDocuments;
|
|
11107
|
+
}
|
|
11108
|
+
async function fetchRemotePolicyDocuments(apiHost, apiKey, projectId, fetch2) {
|
|
11109
|
+
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
11110
|
+
url.searchParams.set("projectId", projectId);
|
|
11111
|
+
const response = await fetch2(url.toString(), {
|
|
11112
|
+
method: "GET",
|
|
11113
|
+
headers: {
|
|
11114
|
+
"x-api-key": apiKey,
|
|
11115
|
+
"Content-Type": "application/json"
|
|
11116
|
+
}
|
|
11117
|
+
});
|
|
11118
|
+
if (!response.ok) {
|
|
11119
|
+
const errorText = await response.text();
|
|
11120
|
+
throw new Error(
|
|
11121
|
+
`Failed to fetch policy documents: ${response.status} ${response.statusText}
|
|
11122
|
+
${errorText}`
|
|
11123
|
+
);
|
|
11124
|
+
}
|
|
11125
|
+
return await response.json();
|
|
11126
|
+
}
|
|
11127
|
+
function mergePolicyDocuments(localDocs, remoteDocs, mode) {
|
|
11128
|
+
switch (mode) {
|
|
11129
|
+
case "create":
|
|
11130
|
+
return {
|
|
11131
|
+
...remoteDocs,
|
|
11132
|
+
...Object.fromEntries(Object.entries(localDocs).filter(([roleId]) => !(roleId in remoteDocs)))
|
|
11133
|
+
};
|
|
11134
|
+
case "createOrUpdate":
|
|
11135
|
+
return {
|
|
11136
|
+
...remoteDocs,
|
|
11137
|
+
...localDocs
|
|
11138
|
+
};
|
|
11139
|
+
case "mirror":
|
|
11140
|
+
default:
|
|
11141
|
+
return localDocs;
|
|
11142
|
+
}
|
|
11143
|
+
}
|
|
11144
|
+
var PolicyDocumentsPushModule = {
|
|
11145
|
+
command: "push <directory>",
|
|
11146
|
+
describe: "Pushes policy documents from local files to Uniform",
|
|
11147
|
+
builder: (yargs42) => withConfiguration(
|
|
11148
|
+
withApiOptions(
|
|
11149
|
+
withDebugOptions(
|
|
11150
|
+
withProjectOptions(
|
|
11151
|
+
withDiffOptions(
|
|
11152
|
+
yargs42.positional("directory", {
|
|
11153
|
+
describe: "Directory containing policy document files (one file per role ID).",
|
|
11154
|
+
type: "string"
|
|
11155
|
+
}).option("format", {
|
|
11156
|
+
alias: ["f"],
|
|
11157
|
+
describe: "Input format",
|
|
11158
|
+
default: "yaml",
|
|
11159
|
+
choices: ["yaml", "json"],
|
|
11160
|
+
type: "string"
|
|
11161
|
+
}).option("mode", {
|
|
11162
|
+
alias: ["m"],
|
|
11163
|
+
describe: 'What kind of changes can be made. "create" = create new documents, update nothing. "createOrUpdate" = create new documents, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',
|
|
11164
|
+
choices: ["create", "createOrUpdate", "mirror"],
|
|
11165
|
+
default: "mirror",
|
|
11166
|
+
type: "string"
|
|
11167
|
+
})
|
|
11168
|
+
)
|
|
11169
|
+
)
|
|
11170
|
+
)
|
|
11171
|
+
)
|
|
11172
|
+
),
|
|
11173
|
+
handler: async ({
|
|
11174
|
+
apiHost,
|
|
11175
|
+
apiKey,
|
|
11176
|
+
proxy,
|
|
11177
|
+
directory,
|
|
11178
|
+
format,
|
|
11179
|
+
mode,
|
|
11180
|
+
whatIf,
|
|
11181
|
+
project: projectId,
|
|
11182
|
+
diff: diffMode,
|
|
11183
|
+
allowEmptySource,
|
|
11184
|
+
verbose
|
|
11185
|
+
}) => {
|
|
11186
|
+
try {
|
|
11187
|
+
const dirStat = await stat(directory);
|
|
11188
|
+
if (!dirStat.isDirectory()) {
|
|
11189
|
+
throw new Error(`Path "${directory}" is not a directory`);
|
|
11190
|
+
}
|
|
11191
|
+
} catch (e) {
|
|
11192
|
+
if (e.code === "ENOENT") {
|
|
11193
|
+
throw new Error(`Directory "${directory}" does not exist`);
|
|
11194
|
+
}
|
|
11195
|
+
throw e;
|
|
11196
|
+
}
|
|
11197
|
+
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
11198
|
+
const localDocs = await readLocalPolicyDocuments(directory, format, verbose);
|
|
11199
|
+
let remoteDocs = {};
|
|
11200
|
+
if (mode !== "mirror") {
|
|
11201
|
+
remoteDocs = await fetchRemotePolicyDocuments(apiHost, apiKey, projectId, fetch2);
|
|
11202
|
+
}
|
|
11203
|
+
const finalDocs = mergePolicyDocuments(localDocs, remoteDocs, mode);
|
|
11204
|
+
const source = await createFileSyncEngineDataSource({
|
|
11205
|
+
directory,
|
|
11206
|
+
selectIdentifier: selectIdentifier13,
|
|
11207
|
+
selectDisplayName: selectDisplayName13,
|
|
11208
|
+
format,
|
|
11209
|
+
verbose
|
|
11210
|
+
});
|
|
11211
|
+
const target = createPolicyDocumentsEngineDataSource({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
11212
|
+
await syncEngine({
|
|
11213
|
+
source,
|
|
11214
|
+
target,
|
|
11215
|
+
mode,
|
|
11216
|
+
whatIf: true,
|
|
11217
|
+
// Always whatIf for display - actual push is done separately
|
|
11218
|
+
allowEmptySource: allowEmptySource ?? true,
|
|
11219
|
+
log: createSyncEngineConsoleLogger({ diffMode })
|
|
11220
|
+
});
|
|
11221
|
+
if (!whatIf) {
|
|
11222
|
+
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
11223
|
+
url.searchParams.set("projectId", projectId);
|
|
11224
|
+
const response = await fetch2(url.toString(), {
|
|
11225
|
+
method: "PUT",
|
|
11226
|
+
headers: {
|
|
11227
|
+
"x-api-key": apiKey,
|
|
11228
|
+
"Content-Type": "application/json"
|
|
11229
|
+
},
|
|
11230
|
+
body: JSON.stringify({
|
|
11231
|
+
projectId,
|
|
11232
|
+
documents: finalDocs
|
|
11233
|
+
})
|
|
11234
|
+
});
|
|
11235
|
+
if (!response.ok) {
|
|
11236
|
+
const errorText = await response.text();
|
|
11237
|
+
throw new Error(
|
|
11238
|
+
`Failed to push policy documents: ${response.status} ${response.statusText}
|
|
11239
|
+
${errorText}`
|
|
11240
|
+
);
|
|
11241
|
+
}
|
|
11242
|
+
if (verbose) {
|
|
11243
|
+
console.log(`Successfully pushed ${Object.keys(finalDocs).length} policy document(s)`);
|
|
11244
|
+
}
|
|
11245
|
+
}
|
|
11246
|
+
}
|
|
11247
|
+
};
|
|
11248
|
+
|
|
11249
|
+
// src/commands/policy-documents/index.ts
|
|
11250
|
+
var PolicyDocumentsCommand = {
|
|
11251
|
+
command: "policy-documents <command>",
|
|
11252
|
+
aliases: ["policy", "policies"],
|
|
11253
|
+
describe: "Uniform Policy Documents commands",
|
|
11254
|
+
builder: (yargs42) => yargs42.command(PolicyDocumentsListModule).command(PolicyDocumentsPullModule).command(PolicyDocumentsPushModule).demandCommand(),
|
|
11255
|
+
handler: () => {
|
|
11256
|
+
yargs33.showHelp();
|
|
11257
|
+
}
|
|
11258
|
+
};
|
|
11259
|
+
|
|
10916
11260
|
// src/commands/project-map/index.ts
|
|
10917
|
-
import
|
|
11261
|
+
import yargs36 from "yargs";
|
|
10918
11262
|
|
|
10919
11263
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
10920
|
-
import
|
|
11264
|
+
import yargs34 from "yargs";
|
|
10921
11265
|
|
|
10922
11266
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
10923
11267
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
10924
|
-
var
|
|
10925
|
-
var
|
|
11268
|
+
var selectIdentifier14 = (source) => source.id;
|
|
11269
|
+
var selectDisplayName14 = (source) => `${source.name} (pid: ${source.id})`;
|
|
10926
11270
|
function getProjectMapClient(options) {
|
|
10927
11271
|
return new UncachedProjectMapClient({ ...options, limitPolicy: cliLimitPolicy });
|
|
10928
11272
|
}
|
|
@@ -10931,11 +11275,11 @@ function getProjectMapClient(options) {
|
|
|
10931
11275
|
var ProjectMapDefinitionGetModule = {
|
|
10932
11276
|
command: "get <id>",
|
|
10933
11277
|
describe: "Fetch a project map",
|
|
10934
|
-
builder: (
|
|
11278
|
+
builder: (yargs42) => withFormatOptions(
|
|
10935
11279
|
withConfiguration(
|
|
10936
11280
|
withApiOptions(
|
|
10937
11281
|
withProjectOptions(
|
|
10938
|
-
|
|
11282
|
+
yargs42.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
10939
11283
|
)
|
|
10940
11284
|
)
|
|
10941
11285
|
)
|
|
@@ -10958,7 +11302,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
10958
11302
|
command: "list",
|
|
10959
11303
|
describe: "List of project maps",
|
|
10960
11304
|
aliases: ["ls"],
|
|
10961
|
-
builder: (
|
|
11305
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
10962
11306
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10963
11307
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10964
11308
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -10986,9 +11330,9 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
10986
11330
|
const projectMaps = (await client.getProjectMapDefinitions()).projectMaps;
|
|
10987
11331
|
for await (const def of projectMaps) {
|
|
10988
11332
|
const result = {
|
|
10989
|
-
id:
|
|
10990
|
-
displayName:
|
|
10991
|
-
providerId:
|
|
11333
|
+
id: selectIdentifier14(def),
|
|
11334
|
+
displayName: selectDisplayName14(def),
|
|
11335
|
+
providerId: selectIdentifier14(def),
|
|
10992
11336
|
object: def
|
|
10993
11337
|
};
|
|
10994
11338
|
yield result;
|
|
@@ -11012,12 +11356,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
11012
11356
|
var ProjectMapDefinitionPullModule = {
|
|
11013
11357
|
command: "pull <directory>",
|
|
11014
11358
|
describe: "Pulls all project maps to local files in a directory",
|
|
11015
|
-
builder: (
|
|
11359
|
+
builder: (yargs42) => withConfiguration(
|
|
11016
11360
|
withDebugOptions(
|
|
11017
11361
|
withApiOptions(
|
|
11018
11362
|
withProjectOptions(
|
|
11019
11363
|
withDiffOptions(
|
|
11020
|
-
|
|
11364
|
+
yargs42.positional("directory", {
|
|
11021
11365
|
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.",
|
|
11022
11366
|
type: "string"
|
|
11023
11367
|
}).option("format", {
|
|
@@ -11061,8 +11405,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
11061
11405
|
target = await createArraySyncEngineDataSource({
|
|
11062
11406
|
name: `Package file ${directory}`,
|
|
11063
11407
|
objects: packageContents.projectMaps ?? [],
|
|
11064
|
-
selectIdentifier:
|
|
11065
|
-
selectDisplayName:
|
|
11408
|
+
selectIdentifier: selectIdentifier14,
|
|
11409
|
+
selectDisplayName: selectDisplayName14,
|
|
11066
11410
|
onSyncComplete: async (_, synced) => {
|
|
11067
11411
|
packageContents.projectMaps = synced;
|
|
11068
11412
|
writeContextPackage2(directory, packageContents);
|
|
@@ -11071,8 +11415,8 @@ var ProjectMapDefinitionPullModule = {
|
|
|
11071
11415
|
} else {
|
|
11072
11416
|
target = await createFileSyncEngineDataSource({
|
|
11073
11417
|
directory,
|
|
11074
|
-
selectIdentifier:
|
|
11075
|
-
selectDisplayName:
|
|
11418
|
+
selectIdentifier: selectIdentifier14,
|
|
11419
|
+
selectDisplayName: selectDisplayName14,
|
|
11076
11420
|
format,
|
|
11077
11421
|
verbose
|
|
11078
11422
|
});
|
|
@@ -11092,12 +11436,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
11092
11436
|
var ProjectMapDefinitionPushModule = {
|
|
11093
11437
|
command: "push <directory>",
|
|
11094
11438
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
11095
|
-
builder: (
|
|
11439
|
+
builder: (yargs42) => withConfiguration(
|
|
11096
11440
|
withDebugOptions(
|
|
11097
11441
|
withApiOptions(
|
|
11098
11442
|
withProjectOptions(
|
|
11099
11443
|
withDiffOptions(
|
|
11100
|
-
|
|
11444
|
+
yargs42.positional("directory", {
|
|
11101
11445
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
11102
11446
|
type: "string"
|
|
11103
11447
|
}).option("mode", {
|
|
@@ -11133,14 +11477,14 @@ var ProjectMapDefinitionPushModule = {
|
|
|
11133
11477
|
source = await createArraySyncEngineDataSource({
|
|
11134
11478
|
name: `Package file ${directory}`,
|
|
11135
11479
|
objects: packageContents.projectMaps ?? [],
|
|
11136
|
-
selectIdentifier:
|
|
11137
|
-
selectDisplayName:
|
|
11480
|
+
selectIdentifier: selectIdentifier14,
|
|
11481
|
+
selectDisplayName: selectDisplayName14
|
|
11138
11482
|
});
|
|
11139
11483
|
} else {
|
|
11140
11484
|
source = await createFileSyncEngineDataSource({
|
|
11141
11485
|
directory,
|
|
11142
|
-
selectIdentifier:
|
|
11143
|
-
selectDisplayName:
|
|
11486
|
+
selectIdentifier: selectIdentifier14,
|
|
11487
|
+
selectDisplayName: selectDisplayName14,
|
|
11144
11488
|
verbose
|
|
11145
11489
|
});
|
|
11146
11490
|
}
|
|
@@ -11161,9 +11505,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
11161
11505
|
command: "remove <id>",
|
|
11162
11506
|
aliases: ["delete", "rm"],
|
|
11163
11507
|
describe: "Delete a project map",
|
|
11164
|
-
builder: (
|
|
11508
|
+
builder: (yargs42) => withConfiguration(
|
|
11165
11509
|
withApiOptions(
|
|
11166
|
-
withProjectOptions(
|
|
11510
|
+
withProjectOptions(yargs42.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
11167
11511
|
)
|
|
11168
11512
|
),
|
|
11169
11513
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -11178,10 +11522,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
11178
11522
|
command: "update <filename>",
|
|
11179
11523
|
aliases: ["put"],
|
|
11180
11524
|
describe: "Insert or update a project map",
|
|
11181
|
-
builder: (
|
|
11525
|
+
builder: (yargs42) => withConfiguration(
|
|
11182
11526
|
withApiOptions(
|
|
11183
11527
|
withProjectOptions(
|
|
11184
|
-
|
|
11528
|
+
yargs42.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
11185
11529
|
)
|
|
11186
11530
|
)
|
|
11187
11531
|
),
|
|
@@ -11197,24 +11541,24 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
11197
11541
|
var ProjectMapDefinitionModule = {
|
|
11198
11542
|
command: "definition <command>",
|
|
11199
11543
|
describe: "Commands for ProjectMap Definitions",
|
|
11200
|
-
builder: (
|
|
11544
|
+
builder: (yargs42) => yargs42.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
11201
11545
|
handler: () => {
|
|
11202
|
-
|
|
11546
|
+
yargs34.help();
|
|
11203
11547
|
}
|
|
11204
11548
|
};
|
|
11205
11549
|
|
|
11206
11550
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
11207
|
-
import
|
|
11551
|
+
import yargs35 from "yargs";
|
|
11208
11552
|
|
|
11209
11553
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
11210
11554
|
var ProjectMapNodeGetModule = {
|
|
11211
11555
|
command: "get <id> <projectMapId>",
|
|
11212
11556
|
describe: "Fetch a project map node",
|
|
11213
|
-
builder: (
|
|
11557
|
+
builder: (yargs42) => withConfiguration(
|
|
11214
11558
|
withFormatOptions(
|
|
11215
11559
|
withApiOptions(
|
|
11216
11560
|
withProjectOptions(
|
|
11217
|
-
|
|
11561
|
+
yargs42.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
11218
11562
|
)
|
|
11219
11563
|
)
|
|
11220
11564
|
)
|
|
@@ -11238,12 +11582,12 @@ var ProjectMapNodeListModule = {
|
|
|
11238
11582
|
command: "list <projectMapId>",
|
|
11239
11583
|
describe: "List project map nodes",
|
|
11240
11584
|
aliases: ["ls"],
|
|
11241
|
-
builder: (
|
|
11585
|
+
builder: (yargs42) => withConfiguration(
|
|
11242
11586
|
withFormatOptions(
|
|
11243
11587
|
withApiOptions(
|
|
11244
11588
|
withProjectOptions(
|
|
11245
11589
|
withStateOptions(
|
|
11246
|
-
|
|
11590
|
+
yargs42.positional("projectMapId", {
|
|
11247
11591
|
demandOption: true,
|
|
11248
11592
|
describe: "ProjectMap UUID to fetch from"
|
|
11249
11593
|
})
|
|
@@ -11261,12 +11605,12 @@ var ProjectMapNodeListModule = {
|
|
|
11261
11605
|
};
|
|
11262
11606
|
|
|
11263
11607
|
// src/commands/project-map/commands/ProjectMapNode/_util.ts
|
|
11264
|
-
var
|
|
11608
|
+
var selectIdentifier15 = (source, projectId) => [
|
|
11265
11609
|
projectId + source.projectMapId + source.id,
|
|
11266
11610
|
projectId + source.projectMapId + source.path
|
|
11267
11611
|
];
|
|
11268
11612
|
var selectFilename = (source) => cleanFileName(`${source.pathSegment}_${source.id}`);
|
|
11269
|
-
var
|
|
11613
|
+
var selectDisplayName15 = (source) => `${source.name} (pid: ${source.id})`;
|
|
11270
11614
|
|
|
11271
11615
|
// src/commands/project-map/ProjectMapNodeEngineDataSource.ts
|
|
11272
11616
|
function createProjectMapNodeEngineDataSource({
|
|
@@ -11280,9 +11624,9 @@ function createProjectMapNodeEngineDataSource({
|
|
|
11280
11624
|
for await (const node of nodes ?? []) {
|
|
11281
11625
|
if (node) {
|
|
11282
11626
|
const result = {
|
|
11283
|
-
id:
|
|
11284
|
-
displayName:
|
|
11285
|
-
providerId:
|
|
11627
|
+
id: selectIdentifier15({ ...node, projectMapId: projectMap.id }, projectId),
|
|
11628
|
+
displayName: selectDisplayName15(node),
|
|
11629
|
+
providerId: selectIdentifier15({ ...node, projectMapId: projectMap.id }, projectId)[0],
|
|
11286
11630
|
object: { ...node, projectMapId: projectMap.id }
|
|
11287
11631
|
};
|
|
11288
11632
|
yield result;
|
|
@@ -11321,12 +11665,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
11321
11665
|
var ProjectMapNodePullModule = {
|
|
11322
11666
|
command: "pull <directory>",
|
|
11323
11667
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
11324
|
-
builder: (
|
|
11668
|
+
builder: (yargs42) => withConfiguration(
|
|
11325
11669
|
withDebugOptions(
|
|
11326
11670
|
withApiOptions(
|
|
11327
11671
|
withProjectOptions(
|
|
11328
11672
|
withDiffOptions(
|
|
11329
|
-
|
|
11673
|
+
yargs42.positional("directory", {
|
|
11330
11674
|
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.",
|
|
11331
11675
|
type: "string"
|
|
11332
11676
|
}).option("format", {
|
|
@@ -11366,7 +11710,7 @@ var ProjectMapNodePullModule = {
|
|
|
11366
11710
|
let target;
|
|
11367
11711
|
const isPackage = isPathAPackageFile(directory);
|
|
11368
11712
|
const expandedSelectIdentifier = (object4) => {
|
|
11369
|
-
return
|
|
11713
|
+
return selectIdentifier15(object4, projectId);
|
|
11370
11714
|
};
|
|
11371
11715
|
if (isPackage) {
|
|
11372
11716
|
const packageContents = readContextPackage2(directory, false, verbose);
|
|
@@ -11374,7 +11718,7 @@ var ProjectMapNodePullModule = {
|
|
|
11374
11718
|
name: `Package file ${directory}`,
|
|
11375
11719
|
objects: packageContents.projectMapNodes ?? [],
|
|
11376
11720
|
selectIdentifier: expandedSelectIdentifier,
|
|
11377
|
-
selectDisplayName:
|
|
11721
|
+
selectDisplayName: selectDisplayName15,
|
|
11378
11722
|
onSyncComplete: async (_, synced) => {
|
|
11379
11723
|
packageContents.projectMapNodes = synced;
|
|
11380
11724
|
writeContextPackage2(directory, packageContents);
|
|
@@ -11384,7 +11728,7 @@ var ProjectMapNodePullModule = {
|
|
|
11384
11728
|
target = await createFileSyncEngineDataSource({
|
|
11385
11729
|
directory,
|
|
11386
11730
|
selectIdentifier: expandedSelectIdentifier,
|
|
11387
|
-
selectDisplayName:
|
|
11731
|
+
selectDisplayName: selectDisplayName15,
|
|
11388
11732
|
format,
|
|
11389
11733
|
selectFilename,
|
|
11390
11734
|
verbose
|
|
@@ -11408,12 +11752,12 @@ import {
|
|
|
11408
11752
|
var ProjectMapNodePushModule = {
|
|
11409
11753
|
command: "push <directory>",
|
|
11410
11754
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
11411
|
-
builder: (
|
|
11755
|
+
builder: (yargs42) => withConfiguration(
|
|
11412
11756
|
withDebugOptions(
|
|
11413
11757
|
withApiOptions(
|
|
11414
11758
|
withProjectOptions(
|
|
11415
11759
|
withDiffOptions(
|
|
11416
|
-
|
|
11760
|
+
yargs42.positional("directory", {
|
|
11417
11761
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
11418
11762
|
type: "string"
|
|
11419
11763
|
}).option("mode", {
|
|
@@ -11450,7 +11794,7 @@ var ProjectMapNodePushModule = {
|
|
|
11450
11794
|
let source;
|
|
11451
11795
|
const isPackage = isPathAPackageFile(directory);
|
|
11452
11796
|
const expandedSelectIdentifier = (object4) => {
|
|
11453
|
-
return
|
|
11797
|
+
return selectIdentifier15(object4, projectId);
|
|
11454
11798
|
};
|
|
11455
11799
|
if (isPackage) {
|
|
11456
11800
|
const packageContents = readContextPackage2(directory, true, verbose);
|
|
@@ -11460,13 +11804,13 @@ var ProjectMapNodePushModule = {
|
|
|
11460
11804
|
return a.path.length - b.path.length;
|
|
11461
11805
|
}) ?? [],
|
|
11462
11806
|
selectIdentifier: expandedSelectIdentifier,
|
|
11463
|
-
selectDisplayName:
|
|
11807
|
+
selectDisplayName: selectDisplayName15
|
|
11464
11808
|
});
|
|
11465
11809
|
} else {
|
|
11466
11810
|
source = await createFileSyncEngineDataSource({
|
|
11467
11811
|
directory,
|
|
11468
11812
|
selectIdentifier: expandedSelectIdentifier,
|
|
11469
|
-
selectDisplayName:
|
|
11813
|
+
selectDisplayName: selectDisplayName15,
|
|
11470
11814
|
selectFilename,
|
|
11471
11815
|
verbose
|
|
11472
11816
|
});
|
|
@@ -11498,7 +11842,7 @@ var ProjectMapNodePushModule = {
|
|
|
11498
11842
|
name: `Nodes re-push from ${directory}`,
|
|
11499
11843
|
objects: Array.from(nodesFailedDueToMissingParent),
|
|
11500
11844
|
selectIdentifier: expandedSelectIdentifier,
|
|
11501
|
-
selectDisplayName:
|
|
11845
|
+
selectDisplayName: selectDisplayName15
|
|
11502
11846
|
});
|
|
11503
11847
|
await attemptSync();
|
|
11504
11848
|
} else {
|
|
@@ -11515,10 +11859,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
11515
11859
|
command: "remove <id> <projectMapId>",
|
|
11516
11860
|
aliases: ["delete", "rm"],
|
|
11517
11861
|
describe: "Delete a project map node",
|
|
11518
|
-
builder: (
|
|
11862
|
+
builder: (yargs42) => withConfiguration(
|
|
11519
11863
|
withApiOptions(
|
|
11520
11864
|
withProjectOptions(
|
|
11521
|
-
|
|
11865
|
+
yargs42.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
11522
11866
|
)
|
|
11523
11867
|
)
|
|
11524
11868
|
),
|
|
@@ -11534,10 +11878,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
11534
11878
|
command: "update <filename> <projectMapId>",
|
|
11535
11879
|
aliases: ["put"],
|
|
11536
11880
|
describe: "Insert or update a project map node",
|
|
11537
|
-
builder: (
|
|
11881
|
+
builder: (yargs42) => withConfiguration(
|
|
11538
11882
|
withApiOptions(
|
|
11539
11883
|
withProjectOptions(
|
|
11540
|
-
|
|
11884
|
+
yargs42.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
11541
11885
|
)
|
|
11542
11886
|
)
|
|
11543
11887
|
),
|
|
@@ -11553,9 +11897,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
11553
11897
|
var ProjectMapNodeModule = {
|
|
11554
11898
|
command: "node <command>",
|
|
11555
11899
|
describe: "Commands for ProjectMap Nodes",
|
|
11556
|
-
builder: (
|
|
11900
|
+
builder: (yargs42) => yargs42.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
11557
11901
|
handler: () => {
|
|
11558
|
-
|
|
11902
|
+
yargs35.help();
|
|
11559
11903
|
}
|
|
11560
11904
|
};
|
|
11561
11905
|
|
|
@@ -11564,26 +11908,26 @@ var ProjectMapCommand = {
|
|
|
11564
11908
|
command: "project-map <command>",
|
|
11565
11909
|
aliases: ["prm"],
|
|
11566
11910
|
describe: "Uniform ProjectMap commands",
|
|
11567
|
-
builder: (
|
|
11911
|
+
builder: (yargs42) => yargs42.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
11568
11912
|
handler: () => {
|
|
11569
|
-
|
|
11913
|
+
yargs36.showHelp();
|
|
11570
11914
|
}
|
|
11571
11915
|
};
|
|
11572
11916
|
|
|
11573
11917
|
// src/commands/redirect/index.ts
|
|
11574
|
-
import
|
|
11918
|
+
import yargs38 from "yargs";
|
|
11575
11919
|
|
|
11576
11920
|
// src/commands/redirect/commands/redirect.ts
|
|
11577
|
-
import
|
|
11921
|
+
import yargs37 from "yargs";
|
|
11578
11922
|
|
|
11579
11923
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
11580
11924
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
11581
|
-
var
|
|
11925
|
+
var selectIdentifier16 = (source) => source.id;
|
|
11582
11926
|
var selectFilename2 = (source) => {
|
|
11583
11927
|
const index = source.sourceUrl.lastIndexOf("/");
|
|
11584
11928
|
return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
|
|
11585
11929
|
};
|
|
11586
|
-
var
|
|
11930
|
+
var selectDisplayName16 = (source) => {
|
|
11587
11931
|
let pathName = source.sourceUrl;
|
|
11588
11932
|
if (pathName.length > 30) {
|
|
11589
11933
|
const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
|
|
@@ -11599,11 +11943,11 @@ function getRedirectClient(options) {
|
|
|
11599
11943
|
var RedirectDefinitionGetModule = {
|
|
11600
11944
|
command: "get <id>",
|
|
11601
11945
|
describe: "Fetch a redirect",
|
|
11602
|
-
builder: (
|
|
11946
|
+
builder: (yargs42) => withConfiguration(
|
|
11603
11947
|
withFormatOptions(
|
|
11604
11948
|
withApiOptions(
|
|
11605
11949
|
withProjectOptions(
|
|
11606
|
-
|
|
11950
|
+
yargs42.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
11607
11951
|
)
|
|
11608
11952
|
)
|
|
11609
11953
|
)
|
|
@@ -11626,7 +11970,7 @@ var RedirectDefinitionListModule = {
|
|
|
11626
11970
|
command: "list",
|
|
11627
11971
|
describe: "List of redirects",
|
|
11628
11972
|
aliases: ["ls"],
|
|
11629
|
-
builder: (
|
|
11973
|
+
builder: (yargs42) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs42)))),
|
|
11630
11974
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
11631
11975
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11632
11976
|
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -11654,9 +11998,9 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
11654
11998
|
const redirects = client.getAllRedirects();
|
|
11655
11999
|
for await (const redirect of redirects) {
|
|
11656
12000
|
const result = {
|
|
11657
|
-
id:
|
|
11658
|
-
displayName:
|
|
11659
|
-
providerId:
|
|
12001
|
+
id: selectIdentifier16(redirect.redirect),
|
|
12002
|
+
displayName: selectDisplayName16(redirect.redirect),
|
|
12003
|
+
providerId: selectIdentifier16(redirect.redirect),
|
|
11660
12004
|
object: redirect.redirect
|
|
11661
12005
|
};
|
|
11662
12006
|
yield result;
|
|
@@ -11678,12 +12022,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
11678
12022
|
var RedirectDefinitionPullModule = {
|
|
11679
12023
|
command: "pull <directory>",
|
|
11680
12024
|
describe: "Pulls all redirects to local files in a directory",
|
|
11681
|
-
builder: (
|
|
12025
|
+
builder: (yargs42) => withConfiguration(
|
|
11682
12026
|
withDebugOptions(
|
|
11683
12027
|
withApiOptions(
|
|
11684
12028
|
withProjectOptions(
|
|
11685
12029
|
withDiffOptions(
|
|
11686
|
-
|
|
12030
|
+
yargs42.positional("directory", {
|
|
11687
12031
|
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.",
|
|
11688
12032
|
type: "string"
|
|
11689
12033
|
}).option("format", {
|
|
@@ -11727,8 +12071,8 @@ var RedirectDefinitionPullModule = {
|
|
|
11727
12071
|
target = await createArraySyncEngineDataSource({
|
|
11728
12072
|
name: `Package file ${directory}`,
|
|
11729
12073
|
objects: packageContents.redirects ?? [],
|
|
11730
|
-
selectIdentifier:
|
|
11731
|
-
selectDisplayName:
|
|
12074
|
+
selectIdentifier: selectIdentifier16,
|
|
12075
|
+
selectDisplayName: selectDisplayName16,
|
|
11732
12076
|
onSyncComplete: async (_, synced) => {
|
|
11733
12077
|
packageContents.redirects = synced;
|
|
11734
12078
|
writeContextPackage3(directory, packageContents);
|
|
@@ -11738,8 +12082,8 @@ var RedirectDefinitionPullModule = {
|
|
|
11738
12082
|
target = await createFileSyncEngineDataSource({
|
|
11739
12083
|
directory,
|
|
11740
12084
|
selectFilename: selectFilename2,
|
|
11741
|
-
selectIdentifier:
|
|
11742
|
-
selectDisplayName:
|
|
12085
|
+
selectIdentifier: selectIdentifier16,
|
|
12086
|
+
selectDisplayName: selectDisplayName16,
|
|
11743
12087
|
format,
|
|
11744
12088
|
verbose
|
|
11745
12089
|
});
|
|
@@ -11759,12 +12103,12 @@ var RedirectDefinitionPullModule = {
|
|
|
11759
12103
|
var RedirectDefinitionPushModule = {
|
|
11760
12104
|
command: "push <directory>",
|
|
11761
12105
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
11762
|
-
builder: (
|
|
12106
|
+
builder: (yargs42) => withConfiguration(
|
|
11763
12107
|
withDebugOptions(
|
|
11764
12108
|
withApiOptions(
|
|
11765
12109
|
withProjectOptions(
|
|
11766
12110
|
withDiffOptions(
|
|
11767
|
-
|
|
12111
|
+
yargs42.positional("directory", {
|
|
11768
12112
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
11769
12113
|
type: "string"
|
|
11770
12114
|
}).option("mode", {
|
|
@@ -11800,14 +12144,14 @@ var RedirectDefinitionPushModule = {
|
|
|
11800
12144
|
source = await createArraySyncEngineDataSource({
|
|
11801
12145
|
name: `Package file ${directory}`,
|
|
11802
12146
|
objects: packageContents.redirects ?? [],
|
|
11803
|
-
selectIdentifier:
|
|
11804
|
-
selectDisplayName:
|
|
12147
|
+
selectIdentifier: selectIdentifier16,
|
|
12148
|
+
selectDisplayName: selectDisplayName16
|
|
11805
12149
|
});
|
|
11806
12150
|
} else {
|
|
11807
12151
|
source = await createFileSyncEngineDataSource({
|
|
11808
12152
|
directory,
|
|
11809
|
-
selectIdentifier:
|
|
11810
|
-
selectDisplayName:
|
|
12153
|
+
selectIdentifier: selectIdentifier16,
|
|
12154
|
+
selectDisplayName: selectDisplayName16,
|
|
11811
12155
|
verbose
|
|
11812
12156
|
});
|
|
11813
12157
|
}
|
|
@@ -11828,9 +12172,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
11828
12172
|
command: "remove <id>",
|
|
11829
12173
|
aliases: ["delete", "rm"],
|
|
11830
12174
|
describe: "Delete a redirect",
|
|
11831
|
-
builder: (
|
|
12175
|
+
builder: (yargs42) => withConfiguration(
|
|
11832
12176
|
withApiOptions(
|
|
11833
|
-
withProjectOptions(
|
|
12177
|
+
withProjectOptions(yargs42.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
11834
12178
|
)
|
|
11835
12179
|
),
|
|
11836
12180
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -11845,10 +12189,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
11845
12189
|
command: "update <filename>",
|
|
11846
12190
|
aliases: ["put"],
|
|
11847
12191
|
describe: "Insert or update a redirect",
|
|
11848
|
-
builder: (
|
|
12192
|
+
builder: (yargs42) => withConfiguration(
|
|
11849
12193
|
withApiOptions(
|
|
11850
12194
|
withProjectOptions(
|
|
11851
|
-
|
|
12195
|
+
yargs42.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
11852
12196
|
)
|
|
11853
12197
|
)
|
|
11854
12198
|
),
|
|
@@ -11864,9 +12208,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
11864
12208
|
var RedirectDefinitionModule = {
|
|
11865
12209
|
command: "definition <command>",
|
|
11866
12210
|
describe: "Commands for Redirect Definitions",
|
|
11867
|
-
builder: (
|
|
12211
|
+
builder: (yargs42) => yargs42.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
11868
12212
|
handler: () => {
|
|
11869
|
-
|
|
12213
|
+
yargs37.help();
|
|
11870
12214
|
}
|
|
11871
12215
|
};
|
|
11872
12216
|
|
|
@@ -11875,20 +12219,20 @@ var RedirectCommand = {
|
|
|
11875
12219
|
command: "redirect <command>",
|
|
11876
12220
|
aliases: ["red"],
|
|
11877
12221
|
describe: "Uniform Redirect commands",
|
|
11878
|
-
builder: (
|
|
12222
|
+
builder: (yargs42) => yargs42.command(RedirectDefinitionModule).demandCommand(),
|
|
11879
12223
|
handler: () => {
|
|
11880
|
-
|
|
12224
|
+
yargs38.showHelp();
|
|
11881
12225
|
}
|
|
11882
12226
|
};
|
|
11883
12227
|
|
|
11884
12228
|
// src/commands/sync/index.ts
|
|
11885
|
-
import
|
|
12229
|
+
import yargs39 from "yargs";
|
|
11886
12230
|
|
|
11887
12231
|
// src/webhooksClient.ts
|
|
11888
12232
|
import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
|
|
11889
12233
|
import PQueue3 from "p-queue";
|
|
11890
12234
|
import { Svix } from "svix";
|
|
11891
|
-
import * as z3 from "zod";
|
|
12235
|
+
import * as z3 from "zod/v3";
|
|
11892
12236
|
var WEBHOOKS_DASHBOARD_BASE_PATH = "/api/v1/svix-dashboard";
|
|
11893
12237
|
var WebhooksClient = class extends ApiClient4 {
|
|
11894
12238
|
constructor(options) {
|
|
@@ -12016,8 +12360,8 @@ var WebhooksClient = class extends ApiClient4 {
|
|
|
12016
12360
|
};
|
|
12017
12361
|
|
|
12018
12362
|
// src/commands/webhook/commands/_util.ts
|
|
12019
|
-
var
|
|
12020
|
-
var
|
|
12363
|
+
var selectIdentifier17 = (webhook) => webhook.endpoint.uid ?? webhook.endpoint.id;
|
|
12364
|
+
var selectDisplayName17 = (webhook) => `${webhook.endpoint.url} (pid: ${webhook.endpoint.uid ?? webhook.endpoint.id})`;
|
|
12021
12365
|
var getWebhooksClient = (options) => new WebhooksClient({ ...options, bypassCache: true, limitPolicy: cliLimitPolicy });
|
|
12022
12366
|
var compareWebhooks = (source, target) => {
|
|
12023
12367
|
const { endpoint: sourceEndpoint, ...sourceWithoutEndpoint } = source.object;
|
|
@@ -12052,8 +12396,8 @@ function createWebhookEngineDataSource({
|
|
|
12052
12396
|
const webhooks = await client.get();
|
|
12053
12397
|
for await (const webhook of webhooks) {
|
|
12054
12398
|
const result = {
|
|
12055
|
-
id:
|
|
12056
|
-
displayName:
|
|
12399
|
+
id: selectIdentifier17(webhook),
|
|
12400
|
+
displayName: selectDisplayName17(webhook),
|
|
12057
12401
|
providerId: webhook.endpoint.id,
|
|
12058
12402
|
object: webhook
|
|
12059
12403
|
};
|
|
@@ -12076,12 +12420,12 @@ function createWebhookEngineDataSource({
|
|
|
12076
12420
|
var WebhookPullModule = {
|
|
12077
12421
|
command: "pull <directory>",
|
|
12078
12422
|
describe: "Pulls all webhooks to local files in a directory",
|
|
12079
|
-
builder: (
|
|
12423
|
+
builder: (yargs42) => withConfiguration(
|
|
12080
12424
|
withApiOptions(
|
|
12081
12425
|
withDebugOptions(
|
|
12082
12426
|
withProjectOptions(
|
|
12083
12427
|
withDiffOptions(
|
|
12084
|
-
|
|
12428
|
+
yargs42.positional("directory", {
|
|
12085
12429
|
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.",
|
|
12086
12430
|
type: "string"
|
|
12087
12431
|
}).option("format", {
|
|
@@ -12125,8 +12469,8 @@ var WebhookPullModule = {
|
|
|
12125
12469
|
target = await createArraySyncEngineDataSource({
|
|
12126
12470
|
name: `Package file ${directory}`,
|
|
12127
12471
|
objects: packageContents.webhooks ?? [],
|
|
12128
|
-
selectIdentifier:
|
|
12129
|
-
selectDisplayName:
|
|
12472
|
+
selectIdentifier: selectIdentifier17,
|
|
12473
|
+
selectDisplayName: selectDisplayName17,
|
|
12130
12474
|
onSyncComplete: async (_, synced) => {
|
|
12131
12475
|
packageContents.webhooks = synced;
|
|
12132
12476
|
writeCanvasPackage(directory, packageContents);
|
|
@@ -12135,8 +12479,8 @@ var WebhookPullModule = {
|
|
|
12135
12479
|
} else {
|
|
12136
12480
|
target = await createFileSyncEngineDataSource({
|
|
12137
12481
|
directory,
|
|
12138
|
-
selectIdentifier:
|
|
12139
|
-
selectDisplayName:
|
|
12482
|
+
selectIdentifier: selectIdentifier17,
|
|
12483
|
+
selectDisplayName: selectDisplayName17,
|
|
12140
12484
|
format,
|
|
12141
12485
|
verbose
|
|
12142
12486
|
});
|
|
@@ -12267,7 +12611,7 @@ function numPad(num, spaces = 6) {
|
|
|
12267
12611
|
var SyncPullModule = {
|
|
12268
12612
|
command: "pull",
|
|
12269
12613
|
describe: "Pulls whole project to local files in a directory",
|
|
12270
|
-
builder: (
|
|
12614
|
+
builder: (yargs42) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs42))))),
|
|
12271
12615
|
handler: async ({ serialization, ...otherParams }) => {
|
|
12272
12616
|
const config2 = serialization;
|
|
12273
12617
|
const enabledEntities = Object.entries({
|
|
@@ -12365,12 +12709,12 @@ var getFormat = (entityType, config2) => {
|
|
|
12365
12709
|
var WebhookPushModule = {
|
|
12366
12710
|
command: "push <directory>",
|
|
12367
12711
|
describe: "Pushes all webhooks from files in a directory to Uniform",
|
|
12368
|
-
builder: (
|
|
12712
|
+
builder: (yargs42) => withConfiguration(
|
|
12369
12713
|
withDebugOptions(
|
|
12370
12714
|
withApiOptions(
|
|
12371
12715
|
withProjectOptions(
|
|
12372
12716
|
withDiffOptions(
|
|
12373
|
-
|
|
12717
|
+
yargs42.positional("directory", {
|
|
12374
12718
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
12375
12719
|
type: "string"
|
|
12376
12720
|
}).option("mode", {
|
|
@@ -12406,14 +12750,14 @@ var WebhookPushModule = {
|
|
|
12406
12750
|
source = await createArraySyncEngineDataSource({
|
|
12407
12751
|
name: `Package file ${directory}`,
|
|
12408
12752
|
objects: packageContents.webhooks ?? [],
|
|
12409
|
-
selectIdentifier:
|
|
12410
|
-
selectDisplayName:
|
|
12753
|
+
selectIdentifier: selectIdentifier17,
|
|
12754
|
+
selectDisplayName: selectDisplayName17
|
|
12411
12755
|
});
|
|
12412
12756
|
} else {
|
|
12413
12757
|
source = await createFileSyncEngineDataSource({
|
|
12414
12758
|
directory,
|
|
12415
|
-
selectIdentifier:
|
|
12416
|
-
selectDisplayName:
|
|
12759
|
+
selectIdentifier: selectIdentifier17,
|
|
12760
|
+
selectDisplayName: selectDisplayName17,
|
|
12417
12761
|
verbose
|
|
12418
12762
|
});
|
|
12419
12763
|
}
|
|
@@ -12434,7 +12778,7 @@ var WebhookPushModule = {
|
|
|
12434
12778
|
var SyncPushModule = {
|
|
12435
12779
|
command: "push",
|
|
12436
12780
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
12437
|
-
builder: (
|
|
12781
|
+
builder: (yargs42) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs42))))),
|
|
12438
12782
|
handler: async ({ serialization, ...otherParams }) => {
|
|
12439
12783
|
const config2 = serialization;
|
|
12440
12784
|
const enabledEntities = Object.entries({
|
|
@@ -12643,21 +12987,21 @@ var getFormat2 = (entityType, config2) => {
|
|
|
12643
12987
|
var SyncCommand = {
|
|
12644
12988
|
command: "sync <command>",
|
|
12645
12989
|
describe: "Uniform Sync commands",
|
|
12646
|
-
builder: (
|
|
12990
|
+
builder: (yargs42) => yargs42.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
12647
12991
|
handler: () => {
|
|
12648
|
-
|
|
12992
|
+
yargs39.showHelp();
|
|
12649
12993
|
}
|
|
12650
12994
|
};
|
|
12651
12995
|
|
|
12652
12996
|
// src/commands/webhook/index.ts
|
|
12653
|
-
import
|
|
12997
|
+
import yargs40 from "yargs";
|
|
12654
12998
|
var WebhookCommand = {
|
|
12655
12999
|
command: "webhook <command>",
|
|
12656
13000
|
aliases: ["wh"],
|
|
12657
13001
|
describe: "Commands for webhooks",
|
|
12658
|
-
builder: (
|
|
13002
|
+
builder: (yargs42) => yargs42.command(WebhookPullModule).command(WebhookPushModule).demandCommand(),
|
|
12659
13003
|
handler: () => {
|
|
12660
|
-
|
|
13004
|
+
yargs40.help();
|
|
12661
13005
|
}
|
|
12662
13006
|
};
|
|
12663
13007
|
|
|
@@ -12669,14 +13013,14 @@ import { existsSync as existsSync5, promises as fs8 } from "fs";
|
|
|
12669
13013
|
import { get as getHttp } from "http";
|
|
12670
13014
|
import { get as getHttps } from "https";
|
|
12671
13015
|
import { tmpdir } from "os";
|
|
12672
|
-
import { join as
|
|
13016
|
+
import { join as join12 } from "path";
|
|
12673
13017
|
import registryUrl from "registry-url";
|
|
12674
13018
|
import { URL as URL2 } from "url";
|
|
12675
13019
|
var compareVersions = (a, b) => a.localeCompare(b, "en-US", { numeric: true });
|
|
12676
13020
|
var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
|
|
12677
13021
|
var getFile = async (details, distTag) => {
|
|
12678
13022
|
const rootDir = tmpdir();
|
|
12679
|
-
const subDir =
|
|
13023
|
+
const subDir = join12(rootDir, "update-check");
|
|
12680
13024
|
if (!existsSync5(subDir)) {
|
|
12681
13025
|
await fs8.mkdir(subDir);
|
|
12682
13026
|
}
|
|
@@ -12684,7 +13028,7 @@ var getFile = async (details, distTag) => {
|
|
|
12684
13028
|
if (details.scope) {
|
|
12685
13029
|
name = `${details.scope}-${name}`;
|
|
12686
13030
|
}
|
|
12687
|
-
return
|
|
13031
|
+
return join12(subDir, name);
|
|
12688
13032
|
};
|
|
12689
13033
|
var evaluateCache = async (file, time, interval) => {
|
|
12690
13034
|
if (existsSync5(file)) {
|
|
@@ -12839,7 +13183,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
12839
13183
|
|
|
12840
13184
|
// src/middleware/checkLocalDepsVersionsMiddleware.ts
|
|
12841
13185
|
import { magenta, red as red8 } from "colorette";
|
|
12842
|
-
import { join as
|
|
13186
|
+
import { join as join13 } from "path";
|
|
12843
13187
|
var uniformStrictVersions = [
|
|
12844
13188
|
"@uniformdev/canvas",
|
|
12845
13189
|
"@uniformdev/canvas-next",
|
|
@@ -12861,7 +13205,7 @@ var checkLocalDepsVersions = async (args) => {
|
|
|
12861
13205
|
try {
|
|
12862
13206
|
let isOutside = false;
|
|
12863
13207
|
let warning = `${magenta("Warning:")} Installed Uniform packages should be the same version`;
|
|
12864
|
-
const localPackages = await tryReadJSON(
|
|
13208
|
+
const localPackages = await tryReadJSON(join13(process.cwd(), "package.json"));
|
|
12865
13209
|
if (!localPackages) return;
|
|
12866
13210
|
let firstVersion;
|
|
12867
13211
|
const allDependencies = {
|
|
@@ -12892,11 +13236,11 @@ First found was: v${firstVersion}`;
|
|
|
12892
13236
|
|
|
12893
13237
|
// src/index.ts
|
|
12894
13238
|
dotenv.config();
|
|
12895
|
-
var yarggery =
|
|
13239
|
+
var yarggery = yargs41(hideBin(process.argv));
|
|
12896
13240
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
12897
13241
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
12898
13242
|
yarggery.option("verbose", {
|
|
12899
13243
|
describe: "Include verbose logging",
|
|
12900
13244
|
default: false,
|
|
12901
13245
|
type: "boolean"
|
|
12902
|
-
}).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(AiCommand).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(RedirectCommand).command(WebhookCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(IntegrationCommand).recommendCommands().demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).parse();
|
|
13246
|
+
}).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(AiCommand).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(PolicyDocumentsCommand).command(RedirectCommand).command(WebhookCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(IntegrationCommand).recommendCommands().demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).parse();
|