@uniformdev/cli 20.35.0 → 20.35.1-alpha.188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +957 -593
- package/package.json +15 -15
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 yargs40 from "yargs";
|
|
24
24
|
import { hideBin } from "yargs/helpers";
|
|
25
25
|
|
|
26
26
|
// src/commands/ai/index.ts
|
|
@@ -35,33 +35,26 @@ import { writeFileSync } from "fs";
|
|
|
35
35
|
import { join as join3 } from "path";
|
|
36
36
|
|
|
37
37
|
// src/auth/getBearerToken.ts
|
|
38
|
-
import
|
|
38
|
+
import { confirm, password } from "@inquirer/prompts";
|
|
39
39
|
import jwt from "jsonwebtoken";
|
|
40
40
|
import open from "open";
|
|
41
41
|
|
|
42
42
|
// src/url.ts
|
|
43
|
-
var makeUrl = (baseUrl,
|
|
43
|
+
var makeUrl = (baseUrl, path8) => [baseUrl.trim().replace(/\/+$/, ""), path8.trim().replace(/^\/+/, "")].join("/");
|
|
44
44
|
|
|
45
45
|
// src/auth/getBearerToken.ts
|
|
46
46
|
async function getBearerToken(baseUrl) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
name: "canOpen",
|
|
51
|
-
message: "Can we open a browser window to get a Uniform auth token?"
|
|
52
|
-
}
|
|
53
|
-
]);
|
|
47
|
+
const canOpen = await confirm({
|
|
48
|
+
message: "Can we open a browser window to get a Uniform auth token?"
|
|
49
|
+
});
|
|
54
50
|
if (canOpen) {
|
|
55
|
-
open(makeUrl(baseUrl, "/cli-login"));
|
|
51
|
+
await open(makeUrl(baseUrl, "/cli-login"));
|
|
56
52
|
}
|
|
57
|
-
const tokenAnswer = await
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
]);
|
|
64
|
-
const authToken = tokenAnswer.authToken.trim();
|
|
53
|
+
const tokenAnswer = await password({
|
|
54
|
+
message: "Paste your Uniform auth token",
|
|
55
|
+
mask: true
|
|
56
|
+
});
|
|
57
|
+
const authToken = tokenAnswer.trim();
|
|
65
58
|
if (!authToken) {
|
|
66
59
|
throw new Error("No auth token provided.");
|
|
67
60
|
}
|
|
@@ -79,7 +72,7 @@ async function getBearerToken(baseUrl) {
|
|
|
79
72
|
}
|
|
80
73
|
|
|
81
74
|
// src/client.ts
|
|
82
|
-
import * as z from "zod";
|
|
75
|
+
import * as z from "zod/v3";
|
|
83
76
|
|
|
84
77
|
// src/auth/api-key.ts
|
|
85
78
|
var READ_PERMISSIONS = ["PROJECT", "UPM_PUB", "OPT_PUB", "OPT_READ", "UPM_READ"];
|
|
@@ -144,8 +137,8 @@ var getLimitsSchema = z.object({
|
|
|
144
137
|
})
|
|
145
138
|
});
|
|
146
139
|
var createClient = (baseUrl, authToken) => {
|
|
147
|
-
const request2 = async (
|
|
148
|
-
const res = await fetch(makeUrl(baseUrl,
|
|
140
|
+
const request2 = async (path8, opts, allowedNon2xxStatusCodes = []) => {
|
|
141
|
+
const res = await fetch(makeUrl(baseUrl, path8), {
|
|
149
142
|
...opts,
|
|
150
143
|
headers: { Authorization: `Bearer ${authToken}` }
|
|
151
144
|
});
|
|
@@ -153,18 +146,18 @@ var createClient = (baseUrl, authToken) => {
|
|
|
153
146
|
return res;
|
|
154
147
|
} else {
|
|
155
148
|
throw new Error(
|
|
156
|
-
`Non-2xx API response: ${opts.method} ${
|
|
149
|
+
`Non-2xx API response: ${opts.method} ${path8} responded with ${res.status} ${res.statusText}`
|
|
157
150
|
);
|
|
158
151
|
}
|
|
159
152
|
};
|
|
160
|
-
const requestJson = async (
|
|
161
|
-
const res = await request2(
|
|
153
|
+
const requestJson = async (path8, opts, schema2, allowedNon2xxStatusCodes = []) => {
|
|
154
|
+
const res = await request2(path8, opts, allowedNon2xxStatusCodes);
|
|
162
155
|
const data = await res.json();
|
|
163
156
|
const parseResult = schema2.safeParse(data);
|
|
164
157
|
if (parseResult.success) {
|
|
165
158
|
return parseResult.data;
|
|
166
159
|
} else {
|
|
167
|
-
throw new Error(`Invalid ${opts.method} ${
|
|
160
|
+
throw new Error(`Invalid ${opts.method} ${path8} response: ${parseResult.error.message}`);
|
|
168
161
|
}
|
|
169
162
|
};
|
|
170
163
|
return {
|
|
@@ -213,6 +206,9 @@ var createClient = (baseUrl, authToken) => {
|
|
|
213
206
|
);
|
|
214
207
|
return result.id;
|
|
215
208
|
} catch (err) {
|
|
209
|
+
if (err.message && /responded with (400|401|403)/.test(err.message)) {
|
|
210
|
+
throw new Error("Unable to create project. You need team admin permissions to use uniform new.");
|
|
211
|
+
}
|
|
216
212
|
throw new Error(`Failed to create project:
|
|
217
213
|
${err.message}`);
|
|
218
214
|
}
|
|
@@ -271,16 +267,65 @@ var createClient = (baseUrl, authToken) => {
|
|
|
271
267
|
};
|
|
272
268
|
};
|
|
273
269
|
|
|
270
|
+
// src/environments.ts
|
|
271
|
+
import { select } from "@inquirer/prompts";
|
|
272
|
+
var ENVIRONMENT_HOSTS = {
|
|
273
|
+
usa: {
|
|
274
|
+
api: "https://uniform.app",
|
|
275
|
+
global: "https://uniform.global",
|
|
276
|
+
ai: "https://ai.uniform.global"
|
|
277
|
+
},
|
|
278
|
+
eu: {
|
|
279
|
+
api: "https://eu.uniform.app",
|
|
280
|
+
global: "https://eu.uniform.global",
|
|
281
|
+
ai: "https://ai.eu.uniform.global"
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
async function selectEnvironment(explicitParams) {
|
|
285
|
+
let needToPrompt = false;
|
|
286
|
+
if (!explicitParams.api && !explicitParams.global && !explicitParams.ai) {
|
|
287
|
+
needToPrompt = true;
|
|
288
|
+
}
|
|
289
|
+
let environment = "usa";
|
|
290
|
+
if (needToPrompt) {
|
|
291
|
+
environment = await select({
|
|
292
|
+
message: "Choose your data residency region",
|
|
293
|
+
choices: [
|
|
294
|
+
{
|
|
295
|
+
name: "USA (uniform.app)",
|
|
296
|
+
value: "usa"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "EU (eu.uniform.app)",
|
|
300
|
+
value: "eu"
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
default: "usa"
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
const result = { ...ENVIRONMENT_HOSTS[environment] };
|
|
307
|
+
if (explicitParams.api !== void 0) {
|
|
308
|
+
result.api = explicitParams.api;
|
|
309
|
+
}
|
|
310
|
+
if (explicitParams.global !== void 0) {
|
|
311
|
+
result.global = explicitParams.global;
|
|
312
|
+
}
|
|
313
|
+
if (explicitParams.ai !== void 0) {
|
|
314
|
+
result.ai = explicitParams.ai;
|
|
315
|
+
}
|
|
316
|
+
return result;
|
|
317
|
+
}
|
|
318
|
+
|
|
274
319
|
// src/fs.ts
|
|
275
320
|
import { promises as fs } from "fs";
|
|
276
|
-
async function readJSON(
|
|
277
|
-
const fileContents = await fs.readFile(
|
|
321
|
+
async function readJSON(path8) {
|
|
322
|
+
const fileContents = await fs.readFile(path8, "utf-8");
|
|
278
323
|
return JSON.parse(fileContents);
|
|
279
324
|
}
|
|
280
|
-
async function tryReadJSON(
|
|
325
|
+
async function tryReadJSON(path8, missingValue = null) {
|
|
281
326
|
try {
|
|
282
|
-
const stat = await fs.stat(
|
|
283
|
-
return stat.isFile() ? await readJSON(
|
|
327
|
+
const stat = await fs.stat(path8);
|
|
328
|
+
return stat.isFile() ? await readJSON(path8) : missingValue;
|
|
284
329
|
} catch {
|
|
285
330
|
return missingValue;
|
|
286
331
|
}
|
|
@@ -310,8 +355,8 @@ async function fileExists(filePath) {
|
|
|
310
355
|
}
|
|
311
356
|
|
|
312
357
|
// src/projects/getOrCreateProject.ts
|
|
358
|
+
import { input, select as select2 } from "@inquirer/prompts";
|
|
313
359
|
import fs2, { existsSync, mkdirSync } from "fs";
|
|
314
|
-
import inquirer2 from "inquirer";
|
|
315
360
|
import path from "path";
|
|
316
361
|
import slugify from "slugify";
|
|
317
362
|
var newProjectId = "$new";
|
|
@@ -369,22 +414,17 @@ async function getNewProjectName({
|
|
|
369
414
|
}) {
|
|
370
415
|
let projectName = explicitName;
|
|
371
416
|
if (!projectName) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return true;
|
|
381
|
-
} catch (e) {
|
|
382
|
-
return e.message;
|
|
383
|
-
}
|
|
417
|
+
projectName = await input({
|
|
418
|
+
message: "What's your project name?",
|
|
419
|
+
validate(value) {
|
|
420
|
+
try {
|
|
421
|
+
validateProjectName(value, checkTargetDir, explicitTargetDir);
|
|
422
|
+
return true;
|
|
423
|
+
} catch (e) {
|
|
424
|
+
return e.message;
|
|
384
425
|
}
|
|
385
426
|
}
|
|
386
|
-
|
|
387
|
-
projectName = answer.name;
|
|
427
|
+
});
|
|
388
428
|
}
|
|
389
429
|
projectName = projectName.trim();
|
|
390
430
|
const targetDir = validateProjectName(projectName, checkTargetDir, explicitTargetDir);
|
|
@@ -412,17 +452,13 @@ async function chooseExistingProject({
|
|
|
412
452
|
value: t.id
|
|
413
453
|
}));
|
|
414
454
|
const choices = createNew ? [{ name: "Create new project...", value: newProjectId }].concat(projects) : projects;
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
message: "Choose a project",
|
|
420
|
-
choices
|
|
421
|
-
}
|
|
422
|
-
]);
|
|
455
|
+
const projectId = await select2({
|
|
456
|
+
message: "Choose a project",
|
|
457
|
+
choices
|
|
458
|
+
});
|
|
423
459
|
return {
|
|
424
|
-
projectId
|
|
425
|
-
projectName: projects.find((p) => p.value ===
|
|
460
|
+
projectId,
|
|
461
|
+
projectName: projects.find((p) => p.value === projectId)?.name
|
|
426
462
|
};
|
|
427
463
|
}
|
|
428
464
|
function validateProjectName(projectName, checkTargetDir, explicitTargetDir) {
|
|
@@ -992,26 +1028,22 @@ function createPublishStatusSyncEngineConsoleLogger(options) {
|
|
|
992
1028
|
}
|
|
993
1029
|
|
|
994
1030
|
// src/teams/chooseTeam.ts
|
|
995
|
-
import
|
|
1031
|
+
import { select as select3 } from "@inquirer/prompts";
|
|
996
1032
|
async function chooseTeam(user, prompt, telemetry) {
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
name:
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
]);
|
|
1008
|
-
telemetry.send("team picked", { teamId: result.teamId });
|
|
1009
|
-
return result;
|
|
1033
|
+
const teamId = await select3({
|
|
1034
|
+
message: prompt,
|
|
1035
|
+
choices: user.teams.map((team) => ({
|
|
1036
|
+
name: team.team.name,
|
|
1037
|
+
value: team.team.id
|
|
1038
|
+
}))
|
|
1039
|
+
});
|
|
1040
|
+
telemetry.send("team picked", { teamId });
|
|
1041
|
+
return { teamId };
|
|
1010
1042
|
}
|
|
1011
1043
|
|
|
1012
1044
|
// src/auth/user-info.ts
|
|
1013
1045
|
import { gql, request } from "graphql-request";
|
|
1014
|
-
import * as z2 from "zod";
|
|
1046
|
+
import * as z2 from "zod/v3";
|
|
1015
1047
|
var query = gql`
|
|
1016
1048
|
query GetUserInfo($subject: String!) {
|
|
1017
1049
|
info: identities_by_pk(subject: $subject) {
|
|
@@ -1092,7 +1124,7 @@ import { PostHog } from "posthog-node";
|
|
|
1092
1124
|
// package.json
|
|
1093
1125
|
var package_default = {
|
|
1094
1126
|
name: "@uniformdev/cli",
|
|
1095
|
-
version: "20.
|
|
1127
|
+
version: "20.43.1",
|
|
1096
1128
|
description: "Uniform command line interface tool",
|
|
1097
1129
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
1098
1130
|
main: "./cli.js",
|
|
@@ -1118,6 +1150,7 @@ var package_default = {
|
|
|
1118
1150
|
format: 'prettier --write "src/**/*.{js,ts,tsx}"'
|
|
1119
1151
|
},
|
|
1120
1152
|
dependencies: {
|
|
1153
|
+
"@inquirer/prompts": "^7.10.1",
|
|
1121
1154
|
"@thi.ng/mime": "^2.2.23",
|
|
1122
1155
|
"@uniformdev/assets": "workspace:*",
|
|
1123
1156
|
"@uniformdev/canvas": "workspace:*",
|
|
@@ -1132,33 +1165,32 @@ var package_default = {
|
|
|
1132
1165
|
"cosmiconfig-typescript-loader": "5.0.0",
|
|
1133
1166
|
diff: "^5.0.0",
|
|
1134
1167
|
dotenv: "^16.4.7",
|
|
1168
|
+
esbuild: "0.25.0",
|
|
1135
1169
|
execa: "5.1.1",
|
|
1136
1170
|
"file-type": "^20.0.0",
|
|
1137
1171
|
"fs-jetpack": "5.1.0",
|
|
1138
1172
|
graphql: "16.9.0",
|
|
1139
1173
|
"graphql-request": "6.1.0",
|
|
1140
1174
|
"image-size": "^1.2.1",
|
|
1141
|
-
|
|
1142
|
-
"isomorphic-git": "1.33.1",
|
|
1175
|
+
"isomorphic-git": "1.35.0",
|
|
1143
1176
|
"js-yaml": "^4.1.0",
|
|
1144
1177
|
jsonwebtoken: "9.0.2",
|
|
1145
1178
|
mitt: "^3.0.1",
|
|
1146
1179
|
"normalize-newline": "^4.1.0",
|
|
1147
|
-
open: "10.
|
|
1180
|
+
open: "10.2.0",
|
|
1148
1181
|
ora: "8.0.1",
|
|
1149
1182
|
"p-queue": "7.3.4",
|
|
1150
|
-
"posthog-node": "
|
|
1183
|
+
"posthog-node": "5.10.3",
|
|
1151
1184
|
"registry-auth-token": "^5.0.0",
|
|
1152
1185
|
"registry-url": "^6.0.0",
|
|
1153
1186
|
slugify: "1.6.6",
|
|
1154
1187
|
svix: "^1.71.0",
|
|
1155
1188
|
undici: "^7.16.0",
|
|
1156
1189
|
yargs: "^17.6.2",
|
|
1157
|
-
zod: "3.
|
|
1190
|
+
zod: "3.25.76"
|
|
1158
1191
|
},
|
|
1159
1192
|
devDependencies: {
|
|
1160
1193
|
"@types/diff": "5.0.9",
|
|
1161
|
-
"@types/inquirer": "9.0.7",
|
|
1162
1194
|
"@types/js-yaml": "4.0.9",
|
|
1163
1195
|
"@types/jsonwebtoken": "9.0.5",
|
|
1164
1196
|
"@types/node": "24.3.1",
|
|
@@ -1223,7 +1255,7 @@ var Telemetry = class {
|
|
|
1223
1255
|
};
|
|
1224
1256
|
|
|
1225
1257
|
// src/commands/ai/lib/agentUtils.ts
|
|
1226
|
-
import
|
|
1258
|
+
import { select as select4 } from "@inquirer/prompts";
|
|
1227
1259
|
import * as path2 from "path";
|
|
1228
1260
|
async function selectAgent(agentOption, options = {}) {
|
|
1229
1261
|
const { allowInteractive = true } = options;
|
|
@@ -1233,18 +1265,15 @@ async function selectAgent(agentOption, options = {}) {
|
|
|
1233
1265
|
if (!allowInteractive) {
|
|
1234
1266
|
throw new Error("Agent type must be specified when running in non-interactive mode. Use --agent flag.");
|
|
1235
1267
|
}
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
name: "
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
]
|
|
1246
|
-
}
|
|
1247
|
-
]);
|
|
1268
|
+
const agentType = await select4({
|
|
1269
|
+
message: "Which AI development assistant are you using?",
|
|
1270
|
+
choices: [
|
|
1271
|
+
{ name: "Cursor", value: "cursor" },
|
|
1272
|
+
{ name: "Claude Desktop", value: "claude" },
|
|
1273
|
+
{ name: "GitHub Copilot (VS Code)", value: "copilot" },
|
|
1274
|
+
{ name: "Other AI assistant", value: "other" }
|
|
1275
|
+
]
|
|
1276
|
+
});
|
|
1248
1277
|
return agentType;
|
|
1249
1278
|
}
|
|
1250
1279
|
function getRulesDirectory(agentType, customDir) {
|
|
@@ -1263,6 +1292,12 @@ function getRulesDirectory(agentType, customDir) {
|
|
|
1263
1292
|
agentType,
|
|
1264
1293
|
isCustom: false
|
|
1265
1294
|
};
|
|
1295
|
+
case "copilot":
|
|
1296
|
+
return {
|
|
1297
|
+
path: path2.join(currentDir, ".github", "instructions"),
|
|
1298
|
+
agentType,
|
|
1299
|
+
isCustom: false
|
|
1300
|
+
};
|
|
1266
1301
|
case "claude":
|
|
1267
1302
|
case "other":
|
|
1268
1303
|
default:
|
|
@@ -1288,6 +1323,12 @@ function getMcpDirectory(agentType, customDir) {
|
|
|
1288
1323
|
agentType,
|
|
1289
1324
|
isCustom: false
|
|
1290
1325
|
};
|
|
1326
|
+
case "copilot":
|
|
1327
|
+
return {
|
|
1328
|
+
path: path2.join(process.cwd(), ".vscode"),
|
|
1329
|
+
agentType,
|
|
1330
|
+
isCustom: false
|
|
1331
|
+
};
|
|
1291
1332
|
case "claude":
|
|
1292
1333
|
case "other":
|
|
1293
1334
|
default:
|
|
@@ -1315,7 +1356,7 @@ function createUniformMcpServerConfig(apiKey, projectId, aiApiHost, apiHost) {
|
|
|
1315
1356
|
}
|
|
1316
1357
|
};
|
|
1317
1358
|
}
|
|
1318
|
-
function readOrCreateMcpConfig(mcpConfigPath) {
|
|
1359
|
+
function readOrCreateMcpConfig(mcpConfigPath, agentType) {
|
|
1319
1360
|
if (existsSync3(mcpConfigPath)) {
|
|
1320
1361
|
try {
|
|
1321
1362
|
const existingConfig = readFileSync(mcpConfigPath, "utf8");
|
|
@@ -1327,34 +1368,51 @@ function readOrCreateMcpConfig(mcpConfigPath) {
|
|
|
1327
1368
|
Error: ${error}`
|
|
1328
1369
|
)
|
|
1329
1370
|
);
|
|
1330
|
-
return { mcpServers: {} };
|
|
1371
|
+
return agentType === "copilot" ? { servers: {} } : { mcpServers: {} };
|
|
1331
1372
|
}
|
|
1332
1373
|
}
|
|
1333
|
-
return { mcpServers: {} };
|
|
1374
|
+
return agentType === "copilot" ? { servers: {} } : { mcpServers: {} };
|
|
1334
1375
|
}
|
|
1335
|
-
function mergeMcpConfig(existingConfig, uniformServer) {
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
...
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1376
|
+
function mergeMcpConfig(existingConfig, uniformServer, agentType) {
|
|
1377
|
+
if (agentType === "copilot") {
|
|
1378
|
+
const copilotConfig = existingConfig;
|
|
1379
|
+
return {
|
|
1380
|
+
...copilotConfig,
|
|
1381
|
+
servers: {
|
|
1382
|
+
...copilotConfig.servers,
|
|
1383
|
+
Uniform: uniformServer
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
} else {
|
|
1387
|
+
const standardConfig = existingConfig;
|
|
1388
|
+
return {
|
|
1389
|
+
...standardConfig,
|
|
1390
|
+
mcpServers: {
|
|
1391
|
+
...standardConfig.mcpServers,
|
|
1392
|
+
Uniform: uniformServer
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
function getExistingServers(config2) {
|
|
1398
|
+
if ("servers" in config2) {
|
|
1399
|
+
return config2.servers || {};
|
|
1400
|
+
} else if ("mcpServers" in config2) {
|
|
1401
|
+
return config2.mcpServers || {};
|
|
1402
|
+
}
|
|
1403
|
+
return {};
|
|
1343
1404
|
}
|
|
1344
1405
|
|
|
1345
1406
|
// src/commands/ai/commands/mcp/install.ts
|
|
1346
|
-
var stableApiHost = "https://uniform.app";
|
|
1347
|
-
var apiHostDefault = process.env.UNIFORM_CLI_BASE_URL || stableApiHost;
|
|
1348
|
-
var aiApiHostDefault = process.env.UNIFORM_AI_API_HOST || "https://ai.uniform.global";
|
|
1349
1407
|
var InstallMcpCommand = {
|
|
1350
1408
|
command: "install",
|
|
1351
1409
|
describe: "Install Uniform MCP server configuration (use --team, --project, and --apiKey for non-interactive mode)",
|
|
1352
|
-
builder: (
|
|
1353
|
-
|
|
1410
|
+
builder: (yargs41) => withConfiguration(
|
|
1411
|
+
yargs41.option("agent", {
|
|
1354
1412
|
alias: "a",
|
|
1355
|
-
describe: "Specify agent type (cursor, claude, other)",
|
|
1413
|
+
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
1356
1414
|
type: "string",
|
|
1357
|
-
choices: ["cursor", "claude", "other"]
|
|
1415
|
+
choices: ["cursor", "claude", "copilot", "other"]
|
|
1358
1416
|
}).option("directory", {
|
|
1359
1417
|
alias: "d",
|
|
1360
1418
|
describe: "Custom installation directory for MCP configuration (.mcp.json for Claude, mcp.json for others)",
|
|
@@ -1368,16 +1426,13 @@ var InstallMcpCommand = {
|
|
|
1368
1426
|
describe: "Team ID to use (skips team selection)",
|
|
1369
1427
|
type: "string"
|
|
1370
1428
|
}).option("apiHost", {
|
|
1371
|
-
describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or
|
|
1372
|
-
default: apiHostDefault,
|
|
1373
|
-
demandOption: true,
|
|
1429
|
+
describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.`,
|
|
1374
1430
|
type: "string"
|
|
1375
1431
|
}).option("apiKey", {
|
|
1376
1432
|
describe: "Uniform API key with write access rights (skips API key generation)",
|
|
1377
1433
|
type: "string"
|
|
1378
1434
|
}).option("aiApiHost", {
|
|
1379
1435
|
describe: "Uniform AI API host. Defaults to UNIFORM_AI_API_HOST env or https://ai.uniform.global",
|
|
1380
|
-
default: aiApiHostDefault,
|
|
1381
1436
|
type: "string"
|
|
1382
1437
|
})
|
|
1383
1438
|
),
|
|
@@ -1388,6 +1443,13 @@ var InstallMcpCommand = {
|
|
|
1388
1443
|
try {
|
|
1389
1444
|
console.log(blue("\n\u{1F680} Welcome to Uniform MCP Server Installer\n"));
|
|
1390
1445
|
const isNonInteractive = project && apiKey;
|
|
1446
|
+
const apiHostWithEnv = apiHost || process.env.UNIFORM_CLI_BASE_URL;
|
|
1447
|
+
const aiApiHostWithEnv = aiApiHost || process.env.UNIFORM_AI_API_HOST;
|
|
1448
|
+
const resolvedApiHosts = await selectEnvironment({
|
|
1449
|
+
api: apiHostWithEnv,
|
|
1450
|
+
ai: aiApiHostWithEnv
|
|
1451
|
+
});
|
|
1452
|
+
telemetry.send("environment selected", { apiHost: resolvedApiHosts.api });
|
|
1391
1453
|
let teamId;
|
|
1392
1454
|
let projectId;
|
|
1393
1455
|
let projectName;
|
|
@@ -1401,13 +1463,13 @@ var InstallMcpCommand = {
|
|
|
1401
1463
|
writeApiKey = apiKey;
|
|
1402
1464
|
} else {
|
|
1403
1465
|
console.log(yellow3("Running in interactive mode team and project arguments are ignored"));
|
|
1404
|
-
const auth = await getBearerToken(
|
|
1466
|
+
const auth = await getBearerToken(resolvedApiHosts.api);
|
|
1405
1467
|
const { authToken } = auth;
|
|
1406
|
-
const uniformClient = createClient(
|
|
1468
|
+
const uniformClient = createClient(resolvedApiHosts.api, authToken);
|
|
1407
1469
|
let done2 = await spin("Fetching user information...");
|
|
1408
1470
|
user = await fetchUserAndEnsureFirstTeamExists({
|
|
1409
1471
|
auth,
|
|
1410
|
-
baseUrl:
|
|
1472
|
+
baseUrl: resolvedApiHosts.api,
|
|
1411
1473
|
spin,
|
|
1412
1474
|
telemetry
|
|
1413
1475
|
});
|
|
@@ -1460,21 +1522,36 @@ Selected agent: ${agentType}`));
|
|
|
1460
1522
|
let done = await spin("Creating directory if needed...");
|
|
1461
1523
|
await ensureDirectoryExists(mcpDirectory);
|
|
1462
1524
|
await done();
|
|
1463
|
-
|
|
1525
|
+
let mcpConfigFileName;
|
|
1526
|
+
if (agentType === "claude") {
|
|
1527
|
+
mcpConfigFileName = ".mcp.json";
|
|
1528
|
+
} else if (agentType === "copilot") {
|
|
1529
|
+
mcpConfigFileName = "mcp.json";
|
|
1530
|
+
} else {
|
|
1531
|
+
mcpConfigFileName = "mcp.json";
|
|
1532
|
+
}
|
|
1533
|
+
const mcpConfigPath = join3(mcpDirectory, mcpConfigFileName);
|
|
1464
1534
|
done = await spin("Reading existing MCP configuration...");
|
|
1465
|
-
const existingConfig = readOrCreateMcpConfig(mcpConfigPath);
|
|
1535
|
+
const existingConfig = readOrCreateMcpConfig(mcpConfigPath, agentType);
|
|
1466
1536
|
await done();
|
|
1467
|
-
const uniformServer = createUniformMcpServerConfig(
|
|
1468
|
-
|
|
1537
|
+
const uniformServer = createUniformMcpServerConfig(
|
|
1538
|
+
writeApiKey,
|
|
1539
|
+
projectId,
|
|
1540
|
+
resolvedApiHosts.ai,
|
|
1541
|
+
resolvedApiHosts.api
|
|
1542
|
+
);
|
|
1543
|
+
const mergedConfig = mergeMcpConfig(existingConfig, uniformServer, agentType);
|
|
1469
1544
|
done = await spin("Updating MCP configuration...");
|
|
1470
1545
|
writeFileSync(mcpConfigPath, JSON.stringify(mergedConfig, null, 2));
|
|
1471
1546
|
await done();
|
|
1472
|
-
const
|
|
1547
|
+
const existingServers = getExistingServers(existingConfig);
|
|
1548
|
+
const hasExistingServers = Object.keys(existingServers).length > 0;
|
|
1473
1549
|
const actionText = hasExistingServers ? "updated" : "created";
|
|
1474
1550
|
console.log(green2(`\u2705 MCP configuration ${actionText} successfully!
|
|
1475
1551
|
`));
|
|
1476
1552
|
if (hasExistingServers) {
|
|
1477
|
-
const
|
|
1553
|
+
const mergedServers = getExistingServers(mergedConfig);
|
|
1554
|
+
const otherServers = Object.keys(mergedServers).filter((key) => key !== "Uniform");
|
|
1478
1555
|
if (otherServers.length > 0) {
|
|
1479
1556
|
console.log(green2(`\u{1F4CB} Preserved existing MCP servers: ${otherServers.join(", ")}`));
|
|
1480
1557
|
}
|
|
@@ -1500,6 +1577,11 @@ Selected agent: ${agentType}`));
|
|
|
1500
1577
|
console.log(`2. Configuration saved to: ${mcpConfigPath}`);
|
|
1501
1578
|
console.log("3. The Uniform MCP server will be available in Claude's interface");
|
|
1502
1579
|
console.log("4. Check via /mcp command in Claude code");
|
|
1580
|
+
} else if (agentType === "copilot") {
|
|
1581
|
+
console.log(blue("\n\u{1F4CB} Next steps for GitHub Copilot (VS Code):"));
|
|
1582
|
+
console.log("1. Restart VS Code to load the new MCP configuration");
|
|
1583
|
+
console.log(`2. Configuration saved to: ${mcpConfigPath}`);
|
|
1584
|
+
console.log("3. The Uniform MCP server will be available in GitHub Copilot's AI chat");
|
|
1503
1585
|
} else {
|
|
1504
1586
|
console.log(yellow3("\n\u{1F4CB} Next steps:"));
|
|
1505
1587
|
console.log("1. Register MCP server in your assistant per documentation");
|
|
@@ -1526,7 +1608,7 @@ Selected agent: ${agentType}`));
|
|
|
1526
1608
|
var McpCommand = {
|
|
1527
1609
|
command: "mcp <command>",
|
|
1528
1610
|
describe: "Uniform MCP server management commands",
|
|
1529
|
-
builder: (
|
|
1611
|
+
builder: (yargs41) => yargs41.command(InstallMcpCommand).demandCommand(),
|
|
1530
1612
|
handler: () => {
|
|
1531
1613
|
yargs.showHelp();
|
|
1532
1614
|
}
|
|
@@ -1539,9 +1621,9 @@ import yargs2 from "yargs";
|
|
|
1539
1621
|
import { blue as blue3, green as green4, red as red4 } from "colorette";
|
|
1540
1622
|
|
|
1541
1623
|
// src/commands/ai/lib/rulesInstaller.ts
|
|
1624
|
+
import { checkbox, confirm as confirm2, select as select5, Separator } from "@inquirer/prompts";
|
|
1542
1625
|
import { blue as blue2, bold, cyan, gray as gray2, green as green3, yellow as yellow4 } from "colorette";
|
|
1543
1626
|
import { promises as fs6 } from "fs";
|
|
1544
|
-
import inquirer5 from "inquirer";
|
|
1545
1627
|
import * as path4 from "path";
|
|
1546
1628
|
|
|
1547
1629
|
// src/commands/ai/lib/frameworkDetection.ts
|
|
@@ -1771,14 +1853,52 @@ async function installRules(options = {}, spin) {
|
|
|
1771
1853
|
console.log(green3(`\u{1F3AF} Detected: ${getFrameworkDescription(frameworkDetection)}`));
|
|
1772
1854
|
}
|
|
1773
1855
|
const agentType = await selectAgent(options.agent);
|
|
1856
|
+
let installLocation;
|
|
1857
|
+
if (agentType === "copilot") {
|
|
1858
|
+
installLocation = await select5({
|
|
1859
|
+
message: "Where would you like to install the instructions?",
|
|
1860
|
+
choices: [
|
|
1861
|
+
{
|
|
1862
|
+
name: "Workspace (.github/instructions) - Available only in this workspace",
|
|
1863
|
+
value: "workspace"
|
|
1864
|
+
},
|
|
1865
|
+
{
|
|
1866
|
+
name: "User profile - Available across all workspaces (requires VS Code profile setup)",
|
|
1867
|
+
value: "user"
|
|
1868
|
+
}
|
|
1869
|
+
],
|
|
1870
|
+
default: "workspace"
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1774
1873
|
const selectedRules = await selectRules(availableRules, frameworkDetection);
|
|
1775
1874
|
if (selectedRules.length === 0) {
|
|
1776
1875
|
console.log(yellow4("No rules selected. Exiting..."));
|
|
1777
1876
|
return;
|
|
1778
1877
|
}
|
|
1779
|
-
|
|
1878
|
+
let directoryConfig = getRulesDirectory(agentType, options.directory);
|
|
1879
|
+
if (agentType === "copilot") {
|
|
1880
|
+
if (installLocation === "workspace") {
|
|
1881
|
+
directoryConfig = {
|
|
1882
|
+
path: path4.join(process.cwd(), ".github", "instructions"),
|
|
1883
|
+
agentType,
|
|
1884
|
+
isCustom: false
|
|
1885
|
+
};
|
|
1886
|
+
console.log(yellow4(`
|
|
1887
|
+
\u{1F4C1} Installing to workspace instructions: ${directoryConfig.path}`));
|
|
1888
|
+
} else if (installLocation === "user") {
|
|
1889
|
+
console.log(yellow4("\n\u26A0\uFE0F Note: User profile installation requires manual setup."));
|
|
1890
|
+
console.log(
|
|
1891
|
+
yellow4("Files will be saved to current directory for you to copy to your VS Code profile.")
|
|
1892
|
+
);
|
|
1893
|
+
directoryConfig = {
|
|
1894
|
+
path: path4.join(process.cwd(), "copilot-instructions"),
|
|
1895
|
+
agentType,
|
|
1896
|
+
isCustom: false
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1780
1900
|
const installDir = directoryConfig.path;
|
|
1781
|
-
await installSelectedRules(selectedRules, installDir, spin);
|
|
1901
|
+
await installSelectedRules(selectedRules, installDir, agentType, spin);
|
|
1782
1902
|
showSuccessMessage(agentType, installDir, selectedRules);
|
|
1783
1903
|
} catch (error) {
|
|
1784
1904
|
if (done) {
|
|
@@ -1797,14 +1917,10 @@ async function selectRules(availableRules, frameworkDetection) {
|
|
|
1797
1917
|
});
|
|
1798
1918
|
console.log("");
|
|
1799
1919
|
}
|
|
1800
|
-
const
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
message: "Install all essential rules? (Recommended)",
|
|
1805
|
-
default: true
|
|
1806
|
-
}
|
|
1807
|
-
]);
|
|
1920
|
+
const installEssential = await confirm2({
|
|
1921
|
+
message: "Install all essential rules? (Recommended)",
|
|
1922
|
+
default: true
|
|
1923
|
+
});
|
|
1808
1924
|
const suggestedFrameworkRules = [];
|
|
1809
1925
|
if (frameworkDetection?.suggestedRules && frameworkDetection.suggestedRules.length > 0) {
|
|
1810
1926
|
console.log(cyan(`\u{1F527} Framework-Specific Rules for ${getFrameworkDescription(frameworkDetection)}:`));
|
|
@@ -1817,14 +1933,10 @@ async function selectRules(availableRules, frameworkDetection) {
|
|
|
1817
1933
|
});
|
|
1818
1934
|
if (suggestedFrameworkRules.length > 0) {
|
|
1819
1935
|
console.log("");
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
message: "Install recommended framework-specific rules? (Highly recommended)",
|
|
1825
|
-
default: true
|
|
1826
|
-
}
|
|
1827
|
-
]);
|
|
1936
|
+
const installFramework = await confirm2({
|
|
1937
|
+
message: "Install recommended framework-specific rules? (Highly recommended)",
|
|
1938
|
+
default: true
|
|
1939
|
+
});
|
|
1828
1940
|
if (installFramework) {
|
|
1829
1941
|
console.log(green3(`\u2705 Added ${suggestedFrameworkRules.length} framework-specific rule(s)
|
|
1830
1942
|
`));
|
|
@@ -1845,29 +1957,25 @@ async function selectRules(availableRules, frameworkDetection) {
|
|
|
1845
1957
|
(category) => groupedRules[category].filter((rule) => !alreadySelectedNames.includes(rule.name))
|
|
1846
1958
|
);
|
|
1847
1959
|
if (availableAdditionalRules.length > 0) {
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
];
|
|
1868
|
-
})
|
|
1869
|
-
}
|
|
1870
|
-
]);
|
|
1960
|
+
const additionalRules = await checkbox({
|
|
1961
|
+
message: "Select additional rules to install:",
|
|
1962
|
+
choices: otherCategories.flatMap((category) => {
|
|
1963
|
+
const categoryRules = groupedRules[category].filter(
|
|
1964
|
+
(rule) => !alreadySelectedNames.includes(rule.name)
|
|
1965
|
+
);
|
|
1966
|
+
if (categoryRules.length === 0) {
|
|
1967
|
+
return [];
|
|
1968
|
+
}
|
|
1969
|
+
return [
|
|
1970
|
+
new Separator(cyan(`--- ${getCategoryDisplayName(category)} ---`)),
|
|
1971
|
+
...categoryRules.map((rule) => ({
|
|
1972
|
+
name: `${rule.displayName} - ${gray2(rule.description)}`,
|
|
1973
|
+
value: rule,
|
|
1974
|
+
short: rule.displayName
|
|
1975
|
+
}))
|
|
1976
|
+
];
|
|
1977
|
+
})
|
|
1978
|
+
});
|
|
1871
1979
|
selectedRules.push(...additionalRules);
|
|
1872
1980
|
}
|
|
1873
1981
|
}
|
|
@@ -1898,7 +2006,7 @@ function getCategoryDisplayName(category) {
|
|
|
1898
2006
|
};
|
|
1899
2007
|
return displayNames[category] || category.charAt(0).toUpperCase() + category.slice(1);
|
|
1900
2008
|
}
|
|
1901
|
-
async function installSelectedRules(selectedRules, installDir, spin) {
|
|
2009
|
+
async function installSelectedRules(selectedRules, installDir, agentType, spin) {
|
|
1902
2010
|
let done;
|
|
1903
2011
|
if (spin) {
|
|
1904
2012
|
done = await spin(`Installing ${selectedRules.length} rules...`);
|
|
@@ -1907,8 +2015,13 @@ async function installSelectedRules(selectedRules, installDir, spin) {
|
|
|
1907
2015
|
await ensureDirectoryExists(installDir);
|
|
1908
2016
|
for (const rule of selectedRules) {
|
|
1909
2017
|
const content = await downloadFileContent(rule.path);
|
|
1910
|
-
|
|
1911
|
-
|
|
2018
|
+
let fileName = rule.name;
|
|
2019
|
+
const fileContent = content;
|
|
2020
|
+
if (agentType === "copilot") {
|
|
2021
|
+
fileName = rule.name.replace(/\.(md|txt)$/, ".instructions.md");
|
|
2022
|
+
}
|
|
2023
|
+
const filePath = path4.join(installDir, fileName);
|
|
2024
|
+
await fs6.writeFile(filePath, fileContent, "utf8");
|
|
1912
2025
|
}
|
|
1913
2026
|
if (done) {
|
|
1914
2027
|
await done();
|
|
@@ -1940,6 +2053,22 @@ function showSuccessMessage(agentType, installDir, selectedRules) {
|
|
|
1940
2053
|
console.log("1. Point Claude Code to the rules folder to augment its understanding");
|
|
1941
2054
|
console.log("2. Use the rules in your development context");
|
|
1942
2055
|
break;
|
|
2056
|
+
case "copilot":
|
|
2057
|
+
console.log(blue2("For GitHub Copilot (VS Code):"));
|
|
2058
|
+
if (installDir.includes("copilot-instructions")) {
|
|
2059
|
+
console.log("1. Copy the generated .instructions.md files to your VS Code profile:");
|
|
2060
|
+
console.log(" \u2022 Open VS Code Command Palette (Cmd/Ctrl+Shift+P)");
|
|
2061
|
+
console.log(' \u2022 Run "Preferences: Open User Settings (JSON)"');
|
|
2062
|
+
console.log(" \u2022 Locate your VS Code profile directory");
|
|
2063
|
+
console.log(" \u2022 Copy files from the copilot-instructions folder to your profile");
|
|
2064
|
+
} else {
|
|
2065
|
+
console.log("1. The instructions files are now in your .github/instructions folder");
|
|
2066
|
+
console.log("2. Restart VS Code to reload the instruction files");
|
|
2067
|
+
console.log("3. Instructions will be automatically applied based on file patterns");
|
|
2068
|
+
}
|
|
2069
|
+
console.log('4. Use "Add Context > Instructions" in Copilot Chat for specific rules');
|
|
2070
|
+
console.log('5. Instructions use YAML frontmatter with "applyTo" patterns');
|
|
2071
|
+
break;
|
|
1943
2072
|
default:
|
|
1944
2073
|
console.log(blue2("For your AI assistant:"));
|
|
1945
2074
|
console.log("1. Point your AI tool to the rules folder");
|
|
@@ -1954,12 +2083,12 @@ ${gray2("Rules source:")} https://github.com/uniformdev/ai-rules`);
|
|
|
1954
2083
|
var InstallRulesCommand = {
|
|
1955
2084
|
command: "install",
|
|
1956
2085
|
describe: "Install Uniform AI rules for your development assistant",
|
|
1957
|
-
builder: (
|
|
1958
|
-
|
|
2086
|
+
builder: (yargs41) => withConfiguration(
|
|
2087
|
+
yargs41.option("agent", {
|
|
1959
2088
|
alias: "a",
|
|
1960
|
-
describe: "Specify agent type (cursor, claude, other)",
|
|
2089
|
+
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
1961
2090
|
type: "string",
|
|
1962
|
-
choices: ["cursor", "claude", "other"]
|
|
2091
|
+
choices: ["cursor", "claude", "copilot", "other"]
|
|
1963
2092
|
}).option("directory", {
|
|
1964
2093
|
alias: "d",
|
|
1965
2094
|
describe: "Custom installation directory (also used for framework detection)",
|
|
@@ -1993,7 +2122,7 @@ import { blue as blue4, bold as bold2, gray as gray3, green as green5, red as re
|
|
|
1993
2122
|
var ListRulesCommand = {
|
|
1994
2123
|
command: "list",
|
|
1995
2124
|
describe: "List available Uniform AI rules",
|
|
1996
|
-
builder: (
|
|
2125
|
+
builder: (yargs41) => withConfiguration(yargs41),
|
|
1997
2126
|
handler: async function() {
|
|
1998
2127
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
1999
2128
|
try {
|
|
@@ -2022,7 +2151,7 @@ var ListRulesCommand = {
|
|
|
2022
2151
|
var RulesCommand = {
|
|
2023
2152
|
command: "rules <command>",
|
|
2024
2153
|
describe: "Uniform AI rules management commands",
|
|
2025
|
-
builder: (
|
|
2154
|
+
builder: (yargs41) => yargs41.command(InstallRulesCommand).command(ListRulesCommand).demandCommand(),
|
|
2026
2155
|
handler: () => {
|
|
2027
2156
|
yargs2.showHelp();
|
|
2028
2157
|
}
|
|
@@ -2032,7 +2161,7 @@ var RulesCommand = {
|
|
|
2032
2161
|
var AiCommand = {
|
|
2033
2162
|
command: "ai <command>",
|
|
2034
2163
|
describe: "Uniform AI development assistant commands",
|
|
2035
|
-
builder: (
|
|
2164
|
+
builder: (yargs41) => yargs41.command(RulesCommand).command(McpCommand).demandCommand(),
|
|
2036
2165
|
handler: () => {
|
|
2037
2166
|
yargs3.showHelp();
|
|
2038
2167
|
}
|
|
@@ -2071,12 +2200,12 @@ function getFileClient(options) {
|
|
|
2071
2200
|
var AssetGetModule = {
|
|
2072
2201
|
command: "get <id>",
|
|
2073
2202
|
describe: "Get an asset",
|
|
2074
|
-
builder: (
|
|
2203
|
+
builder: (yargs41) => withConfiguration(
|
|
2075
2204
|
withDebugOptions(
|
|
2076
2205
|
withFormatOptions(
|
|
2077
2206
|
withApiOptions(
|
|
2078
2207
|
withProjectOptions(
|
|
2079
|
-
|
|
2208
|
+
yargs41.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
2080
2209
|
)
|
|
2081
2210
|
)
|
|
2082
2211
|
)
|
|
@@ -2097,7 +2226,7 @@ var AssetGetModule = {
|
|
|
2097
2226
|
var AssetListModule = {
|
|
2098
2227
|
command: "list",
|
|
2099
2228
|
describe: "List assets",
|
|
2100
|
-
builder: (
|
|
2229
|
+
builder: (yargs41) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs41))))),
|
|
2101
2230
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
2102
2231
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2103
2232
|
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -2650,8 +2779,8 @@ function prepCompositionForDisk(composition) {
|
|
|
2650
2779
|
delete prepped.state;
|
|
2651
2780
|
return prepped;
|
|
2652
2781
|
}
|
|
2653
|
-
function withStateOptions(
|
|
2654
|
-
return
|
|
2782
|
+
function withStateOptions(yargs41, defaultState = "preview") {
|
|
2783
|
+
return yargs41.option("state", {
|
|
2655
2784
|
type: "string",
|
|
2656
2785
|
describe: `State to fetch.`,
|
|
2657
2786
|
choices: ["preview", "published"],
|
|
@@ -2733,12 +2862,12 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
2733
2862
|
var AssetPullModule = {
|
|
2734
2863
|
command: "pull <directory>",
|
|
2735
2864
|
describe: "Pulls all assets to local files in a directory",
|
|
2736
|
-
builder: (
|
|
2865
|
+
builder: (yargs41) => withConfiguration(
|
|
2737
2866
|
withApiOptions(
|
|
2738
2867
|
withDebugOptions(
|
|
2739
2868
|
withProjectOptions(
|
|
2740
2869
|
withDiffOptions(
|
|
2741
|
-
|
|
2870
|
+
yargs41.positional("directory", {
|
|
2742
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.",
|
|
2743
2872
|
type: "string"
|
|
2744
2873
|
}).option("format", {
|
|
@@ -2850,12 +2979,12 @@ var AssetPullModule = {
|
|
|
2850
2979
|
var AssetPushModule = {
|
|
2851
2980
|
command: "push <directory>",
|
|
2852
2981
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
2853
|
-
builder: (
|
|
2982
|
+
builder: (yargs41) => withConfiguration(
|
|
2854
2983
|
withApiOptions(
|
|
2855
2984
|
withDebugOptions(
|
|
2856
2985
|
withProjectOptions(
|
|
2857
2986
|
withDiffOptions(
|
|
2858
|
-
|
|
2987
|
+
yargs41.positional("directory", {
|
|
2859
2988
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
2860
2989
|
type: "string"
|
|
2861
2990
|
}).option("mode", {
|
|
@@ -2979,10 +3108,10 @@ var AssetRemoveModule = {
|
|
|
2979
3108
|
command: "remove <id>",
|
|
2980
3109
|
aliases: ["delete", "rm"],
|
|
2981
3110
|
describe: "Delete an asset",
|
|
2982
|
-
builder: (
|
|
3111
|
+
builder: (yargs41) => withConfiguration(
|
|
2983
3112
|
withDebugOptions(
|
|
2984
3113
|
withApiOptions(
|
|
2985
|
-
withProjectOptions(
|
|
3114
|
+
withProjectOptions(yargs41.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
2986
3115
|
)
|
|
2987
3116
|
)
|
|
2988
3117
|
),
|
|
@@ -3003,11 +3132,11 @@ var AssetUpdateModule = {
|
|
|
3003
3132
|
command: "update <filename>",
|
|
3004
3133
|
aliases: ["put"],
|
|
3005
3134
|
describe: "Insert or update an asset",
|
|
3006
|
-
builder: (
|
|
3135
|
+
builder: (yargs41) => withConfiguration(
|
|
3007
3136
|
withDebugOptions(
|
|
3008
3137
|
withApiOptions(
|
|
3009
3138
|
withProjectOptions(
|
|
3010
|
-
|
|
3139
|
+
yargs41.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
3011
3140
|
)
|
|
3012
3141
|
)
|
|
3013
3142
|
)
|
|
@@ -3033,7 +3162,7 @@ var AssetUpdateModule = {
|
|
|
3033
3162
|
var AssetModule = {
|
|
3034
3163
|
command: "asset <command>",
|
|
3035
3164
|
describe: "Commands for Assets",
|
|
3036
|
-
builder: (
|
|
3165
|
+
builder: (yargs41) => yargs41.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
3037
3166
|
handler: () => {
|
|
3038
3167
|
yargs4.help();
|
|
3039
3168
|
}
|
|
@@ -3054,12 +3183,12 @@ function getCategoryClient(options) {
|
|
|
3054
3183
|
var CategoryGetModule = {
|
|
3055
3184
|
command: "get <id>",
|
|
3056
3185
|
describe: "Fetch a category",
|
|
3057
|
-
builder: (
|
|
3186
|
+
builder: (yargs41) => withConfiguration(
|
|
3058
3187
|
withFormatOptions(
|
|
3059
3188
|
withDebugOptions(
|
|
3060
3189
|
withApiOptions(
|
|
3061
3190
|
withProjectOptions(
|
|
3062
|
-
|
|
3191
|
+
yargs41.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
3063
3192
|
)
|
|
3064
3193
|
)
|
|
3065
3194
|
)
|
|
@@ -3084,8 +3213,8 @@ var CategoryListModule = {
|
|
|
3084
3213
|
command: "list",
|
|
3085
3214
|
describe: "List categories",
|
|
3086
3215
|
aliases: ["ls"],
|
|
3087
|
-
builder: (
|
|
3088
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
3216
|
+
builder: (yargs41) => withConfiguration(
|
|
3217
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs41.options({})))))
|
|
3089
3218
|
),
|
|
3090
3219
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3091
3220
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -3129,12 +3258,12 @@ function createCategoriesEngineDataSource({
|
|
|
3129
3258
|
var CategoryPullModule = {
|
|
3130
3259
|
command: "pull <directory>",
|
|
3131
3260
|
describe: "Pulls all categories to local files in a directory",
|
|
3132
|
-
builder: (
|
|
3261
|
+
builder: (yargs41) => withConfiguration(
|
|
3133
3262
|
withApiOptions(
|
|
3134
3263
|
withProjectOptions(
|
|
3135
3264
|
withDiffOptions(
|
|
3136
3265
|
withDebugOptions(
|
|
3137
|
-
|
|
3266
|
+
yargs41.positional("directory", {
|
|
3138
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.",
|
|
3139
3268
|
type: "string"
|
|
3140
3269
|
}).option("format", {
|
|
@@ -3209,12 +3338,12 @@ var CategoryPullModule = {
|
|
|
3209
3338
|
var CategoryPushModule = {
|
|
3210
3339
|
command: "push <directory>",
|
|
3211
3340
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
3212
|
-
builder: (
|
|
3341
|
+
builder: (yargs41) => withConfiguration(
|
|
3213
3342
|
withApiOptions(
|
|
3214
3343
|
withDebugOptions(
|
|
3215
3344
|
withProjectOptions(
|
|
3216
3345
|
withDiffOptions(
|
|
3217
|
-
|
|
3346
|
+
yargs41.positional("directory", {
|
|
3218
3347
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
3219
3348
|
type: "string"
|
|
3220
3349
|
}).option("mode", {
|
|
@@ -3278,11 +3407,11 @@ var CategoryRemoveModule = {
|
|
|
3278
3407
|
command: "remove <id>",
|
|
3279
3408
|
aliases: ["delete", "rm"],
|
|
3280
3409
|
describe: "Delete a category",
|
|
3281
|
-
builder: (
|
|
3410
|
+
builder: (yargs41) => withConfiguration(
|
|
3282
3411
|
withApiOptions(
|
|
3283
3412
|
withDebugOptions(
|
|
3284
3413
|
withProjectOptions(
|
|
3285
|
-
|
|
3414
|
+
yargs41.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
3286
3415
|
)
|
|
3287
3416
|
)
|
|
3288
3417
|
)
|
|
@@ -3303,11 +3432,11 @@ var CategoryUpdateModule = {
|
|
|
3303
3432
|
command: "update <filename>",
|
|
3304
3433
|
aliases: ["put"],
|
|
3305
3434
|
describe: "Insert or update a category",
|
|
3306
|
-
builder: (
|
|
3435
|
+
builder: (yargs41) => withConfiguration(
|
|
3307
3436
|
withApiOptions(
|
|
3308
3437
|
withDebugOptions(
|
|
3309
3438
|
withProjectOptions(
|
|
3310
|
-
|
|
3439
|
+
yargs41.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
3311
3440
|
)
|
|
3312
3441
|
)
|
|
3313
3442
|
)
|
|
@@ -3329,7 +3458,7 @@ var CategoryModule = {
|
|
|
3329
3458
|
command: "category <command>",
|
|
3330
3459
|
aliases: ["cat"],
|
|
3331
3460
|
describe: "Commands for Canvas categories",
|
|
3332
|
-
builder: (
|
|
3461
|
+
builder: (yargs41) => yargs41.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
3333
3462
|
handler: () => {
|
|
3334
3463
|
yargs5.help();
|
|
3335
3464
|
}
|
|
@@ -3351,12 +3480,12 @@ function getCanvasClient(options) {
|
|
|
3351
3480
|
var ComponentGetModule = {
|
|
3352
3481
|
command: "get <id>",
|
|
3353
3482
|
describe: "Fetch a component definition",
|
|
3354
|
-
builder: (
|
|
3483
|
+
builder: (yargs41) => withConfiguration(
|
|
3355
3484
|
withFormatOptions(
|
|
3356
3485
|
withDebugOptions(
|
|
3357
3486
|
withApiOptions(
|
|
3358
3487
|
withProjectOptions(
|
|
3359
|
-
|
|
3488
|
+
yargs41.positional("id", {
|
|
3360
3489
|
demandOption: true,
|
|
3361
3490
|
describe: "Component definition public ID to fetch"
|
|
3362
3491
|
})
|
|
@@ -3390,12 +3519,12 @@ var ComponentListModule = {
|
|
|
3390
3519
|
command: "list",
|
|
3391
3520
|
describe: "List component definitions",
|
|
3392
3521
|
aliases: ["ls"],
|
|
3393
|
-
builder: (
|
|
3522
|
+
builder: (yargs41) => withConfiguration(
|
|
3394
3523
|
withFormatOptions(
|
|
3395
3524
|
withDebugOptions(
|
|
3396
3525
|
withApiOptions(
|
|
3397
3526
|
withProjectOptions(
|
|
3398
|
-
|
|
3527
|
+
yargs41.options({
|
|
3399
3528
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3400
3529
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
3401
3530
|
})
|
|
@@ -3459,12 +3588,12 @@ function createComponentDefinitionEngineDataSource({
|
|
|
3459
3588
|
var ComponentPullModule = {
|
|
3460
3589
|
command: "pull <directory>",
|
|
3461
3590
|
describe: "Pulls all component definitions to local files in a directory",
|
|
3462
|
-
builder: (
|
|
3591
|
+
builder: (yargs41) => withConfiguration(
|
|
3463
3592
|
withApiOptions(
|
|
3464
3593
|
withDebugOptions(
|
|
3465
3594
|
withProjectOptions(
|
|
3466
3595
|
withDiffOptions(
|
|
3467
|
-
|
|
3596
|
+
yargs41.positional("directory", {
|
|
3468
3597
|
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.",
|
|
3469
3598
|
type: "string"
|
|
3470
3599
|
}).option("format", {
|
|
@@ -3540,12 +3669,12 @@ var ComponentPullModule = {
|
|
|
3540
3669
|
var ComponentPushModule = {
|
|
3541
3670
|
command: "push <directory>",
|
|
3542
3671
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
3543
|
-
builder: (
|
|
3672
|
+
builder: (yargs41) => withConfiguration(
|
|
3544
3673
|
withApiOptions(
|
|
3545
3674
|
withDebugOptions(
|
|
3546
3675
|
withProjectOptions(
|
|
3547
3676
|
withDiffOptions(
|
|
3548
|
-
|
|
3677
|
+
yargs41.positional("directory", {
|
|
3549
3678
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
3550
3679
|
type: "string"
|
|
3551
3680
|
}).option("mode", {
|
|
@@ -3610,11 +3739,11 @@ var ComponentRemoveModule = {
|
|
|
3610
3739
|
command: "remove <id>",
|
|
3611
3740
|
aliases: ["delete", "rm"],
|
|
3612
3741
|
describe: "Delete a component definition",
|
|
3613
|
-
builder: (
|
|
3742
|
+
builder: (yargs41) => withConfiguration(
|
|
3614
3743
|
withDebugOptions(
|
|
3615
3744
|
withApiOptions(
|
|
3616
3745
|
withProjectOptions(
|
|
3617
|
-
|
|
3746
|
+
yargs41.positional("id", {
|
|
3618
3747
|
demandOption: true,
|
|
3619
3748
|
describe: "Component definition public ID to delete"
|
|
3620
3749
|
})
|
|
@@ -3638,11 +3767,11 @@ var ComponentUpdateModule = {
|
|
|
3638
3767
|
command: "update <filename>",
|
|
3639
3768
|
aliases: ["put"],
|
|
3640
3769
|
describe: "Insert or update a component definition",
|
|
3641
|
-
builder: (
|
|
3770
|
+
builder: (yargs41) => withConfiguration(
|
|
3642
3771
|
withApiOptions(
|
|
3643
3772
|
withDebugOptions(
|
|
3644
3773
|
withProjectOptions(
|
|
3645
|
-
|
|
3774
|
+
yargs41.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
3646
3775
|
)
|
|
3647
3776
|
)
|
|
3648
3777
|
)
|
|
@@ -3664,7 +3793,7 @@ var ComponentModule = {
|
|
|
3664
3793
|
command: "component <command>",
|
|
3665
3794
|
aliases: ["def"],
|
|
3666
3795
|
describe: "Commands for Canvas component definitions",
|
|
3667
|
-
builder: (
|
|
3796
|
+
builder: (yargs41) => yargs41.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
3668
3797
|
handler: () => {
|
|
3669
3798
|
yargs6.help();
|
|
3670
3799
|
}
|
|
@@ -3677,13 +3806,13 @@ import yargs7 from "yargs";
|
|
|
3677
3806
|
var CompositionGetModule = {
|
|
3678
3807
|
command: "get <id>",
|
|
3679
3808
|
describe: "Fetch a composition",
|
|
3680
|
-
builder: (
|
|
3809
|
+
builder: (yargs41) => withFormatOptions(
|
|
3681
3810
|
withConfiguration(
|
|
3682
3811
|
withApiOptions(
|
|
3683
3812
|
withProjectOptions(
|
|
3684
3813
|
withStateOptions(
|
|
3685
3814
|
withDebugOptions(
|
|
3686
|
-
|
|
3815
|
+
yargs41.positional("id", {
|
|
3687
3816
|
demandOption: true,
|
|
3688
3817
|
describe: "Composition/pattern public ID to fetch"
|
|
3689
3818
|
}).option({
|
|
@@ -3773,13 +3902,13 @@ var CompositionListModule = {
|
|
|
3773
3902
|
command: "list",
|
|
3774
3903
|
describe: "List compositions",
|
|
3775
3904
|
aliases: ["ls"],
|
|
3776
|
-
builder: (
|
|
3905
|
+
builder: (yargs41) => withFormatOptions(
|
|
3777
3906
|
withConfiguration(
|
|
3778
3907
|
withApiOptions(
|
|
3779
3908
|
withProjectOptions(
|
|
3780
3909
|
withDebugOptions(
|
|
3781
3910
|
withStateOptions(
|
|
3782
|
-
|
|
3911
|
+
yargs41.options({
|
|
3783
3912
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3784
3913
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3785
3914
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -3860,13 +3989,13 @@ var CompositionListModule = {
|
|
|
3860
3989
|
var ComponentPatternListModule = {
|
|
3861
3990
|
...CompositionListModule,
|
|
3862
3991
|
describe: "List component patterns",
|
|
3863
|
-
builder: (
|
|
3992
|
+
builder: (yargs41) => withFormatOptions(
|
|
3864
3993
|
withConfiguration(
|
|
3865
3994
|
withApiOptions(
|
|
3866
3995
|
withDebugOptions(
|
|
3867
3996
|
withProjectOptions(
|
|
3868
3997
|
withStateOptions(
|
|
3869
|
-
|
|
3998
|
+
yargs41.options({
|
|
3870
3999
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3871
4000
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
3872
4001
|
resolvePatterns: {
|
|
@@ -3989,12 +4118,12 @@ function createComponentInstanceEngineDataSource({
|
|
|
3989
4118
|
var CompositionPublishModule = {
|
|
3990
4119
|
command: "publish [ids]",
|
|
3991
4120
|
describe: "Publishes composition(s)",
|
|
3992
|
-
builder: (
|
|
4121
|
+
builder: (yargs41) => withConfiguration(
|
|
3993
4122
|
withApiOptions(
|
|
3994
4123
|
withProjectOptions(
|
|
3995
4124
|
withDebugOptions(
|
|
3996
4125
|
withDiffOptions(
|
|
3997
|
-
|
|
4126
|
+
yargs41.positional("ids", {
|
|
3998
4127
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
3999
4128
|
type: "string"
|
|
4000
4129
|
}).option("all", {
|
|
@@ -4087,12 +4216,12 @@ var CompositionPublishModule = {
|
|
|
4087
4216
|
var ComponentPatternPublishModule = {
|
|
4088
4217
|
...CompositionPublishModule,
|
|
4089
4218
|
describe: "Publishes component pattern(s)",
|
|
4090
|
-
builder: (
|
|
4219
|
+
builder: (yargs41) => withConfiguration(
|
|
4091
4220
|
withApiOptions(
|
|
4092
4221
|
withDebugOptions(
|
|
4093
4222
|
withProjectOptions(
|
|
4094
4223
|
withDiffOptions(
|
|
4095
|
-
|
|
4224
|
+
yargs41.positional("ids", {
|
|
4096
4225
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4097
4226
|
type: "string"
|
|
4098
4227
|
}).option("all", {
|
|
@@ -4132,13 +4261,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4132
4261
|
return {
|
|
4133
4262
|
command: "pull <directory>",
|
|
4134
4263
|
describe: "Pulls all compositions to local files in a directory",
|
|
4135
|
-
builder: (
|
|
4264
|
+
builder: (yargs41) => withConfiguration(
|
|
4136
4265
|
withApiOptions(
|
|
4137
4266
|
withProjectOptions(
|
|
4138
4267
|
withStateOptions(
|
|
4139
4268
|
withDebugOptions(
|
|
4140
4269
|
withDiffOptions(
|
|
4141
|
-
|
|
4270
|
+
yargs41.positional("directory", {
|
|
4142
4271
|
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.",
|
|
4143
4272
|
type: "string"
|
|
4144
4273
|
}).option("format", {
|
|
@@ -4253,13 +4382,13 @@ function componentInstancePullModuleFactory(type) {
|
|
|
4253
4382
|
var ComponentPatternPullModule = {
|
|
4254
4383
|
...componentInstancePullModuleFactory("componentPatterns"),
|
|
4255
4384
|
describe: "Pulls all component patterns to local files in a directory",
|
|
4256
|
-
builder: (
|
|
4385
|
+
builder: (yargs41) => withConfiguration(
|
|
4257
4386
|
withApiOptions(
|
|
4258
4387
|
withProjectOptions(
|
|
4259
4388
|
withDebugOptions(
|
|
4260
4389
|
withStateOptions(
|
|
4261
4390
|
withDiffOptions(
|
|
4262
|
-
|
|
4391
|
+
yargs41.positional("directory", {
|
|
4263
4392
|
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.",
|
|
4264
4393
|
type: "string"
|
|
4265
4394
|
}).option("format", {
|
|
@@ -4333,13 +4462,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4333
4462
|
return {
|
|
4334
4463
|
command: "push <directory>",
|
|
4335
4464
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
4336
|
-
builder: (
|
|
4465
|
+
builder: (yargs41) => withConfiguration(
|
|
4337
4466
|
withApiOptions(
|
|
4338
4467
|
withProjectOptions(
|
|
4339
4468
|
withStateOptions(
|
|
4340
4469
|
withDebugOptions(
|
|
4341
4470
|
withDiffOptions(
|
|
4342
|
-
|
|
4471
|
+
yargs41.positional("directory", {
|
|
4343
4472
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
4344
4473
|
type: "string"
|
|
4345
4474
|
}).option("mode", {
|
|
@@ -4453,13 +4582,13 @@ function componentInstancePushModuleFactory(type) {
|
|
|
4453
4582
|
var ComponentPatternPushModule = {
|
|
4454
4583
|
...componentInstancePushModuleFactory("componentPatterns"),
|
|
4455
4584
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
4456
|
-
builder: (
|
|
4585
|
+
builder: (yargs41) => withConfiguration(
|
|
4457
4586
|
withApiOptions(
|
|
4458
4587
|
withProjectOptions(
|
|
4459
4588
|
withStateOptions(
|
|
4460
4589
|
withDiffOptions(
|
|
4461
4590
|
withDebugOptions(
|
|
4462
|
-
|
|
4591
|
+
yargs41.positional("directory", {
|
|
4463
4592
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
4464
4593
|
type: "string"
|
|
4465
4594
|
}).option("mode", {
|
|
@@ -4493,11 +4622,11 @@ var CompositionRemoveModule = {
|
|
|
4493
4622
|
command: "remove <id>",
|
|
4494
4623
|
aliases: ["delete", "rm"],
|
|
4495
4624
|
describe: "Delete a composition",
|
|
4496
|
-
builder: (
|
|
4625
|
+
builder: (yargs41) => withConfiguration(
|
|
4497
4626
|
withApiOptions(
|
|
4498
4627
|
withDebugOptions(
|
|
4499
4628
|
withProjectOptions(
|
|
4500
|
-
|
|
4629
|
+
yargs41.positional("id", {
|
|
4501
4630
|
demandOption: true,
|
|
4502
4631
|
describe: "Composition/pattern public ID to delete"
|
|
4503
4632
|
})
|
|
@@ -4531,11 +4660,11 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
4531
4660
|
var CompositionUnpublishModule = {
|
|
4532
4661
|
command: "unpublish [ids]",
|
|
4533
4662
|
describe: "Unpublish a composition(s)",
|
|
4534
|
-
builder: (
|
|
4663
|
+
builder: (yargs41) => withConfiguration(
|
|
4535
4664
|
withApiOptions(
|
|
4536
4665
|
withDebugOptions(
|
|
4537
4666
|
withProjectOptions(
|
|
4538
|
-
|
|
4667
|
+
yargs41.positional("ids", {
|
|
4539
4668
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4540
4669
|
type: "string"
|
|
4541
4670
|
}).option("all", {
|
|
@@ -4632,11 +4761,11 @@ var CompositionUnpublishModule = {
|
|
|
4632
4761
|
var ComponentPatternUnpublishModule = {
|
|
4633
4762
|
command: "unpublish [ids]",
|
|
4634
4763
|
describe: "Unpublish a component pattern(s)",
|
|
4635
|
-
builder: (
|
|
4764
|
+
builder: (yargs41) => withConfiguration(
|
|
4636
4765
|
withApiOptions(
|
|
4637
4766
|
withDebugOptions(
|
|
4638
4767
|
withProjectOptions(
|
|
4639
|
-
|
|
4768
|
+
yargs41.positional("ids", {
|
|
4640
4769
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4641
4770
|
type: "string"
|
|
4642
4771
|
}).option("all", {
|
|
@@ -4670,12 +4799,12 @@ var CompositionUpdateModule = {
|
|
|
4670
4799
|
command: "update <filename>",
|
|
4671
4800
|
aliases: ["put"],
|
|
4672
4801
|
describe: "Insert or update a composition",
|
|
4673
|
-
builder: (
|
|
4802
|
+
builder: (yargs41) => withConfiguration(
|
|
4674
4803
|
withApiOptions(
|
|
4675
4804
|
withProjectOptions(
|
|
4676
4805
|
withDebugOptions(
|
|
4677
4806
|
withStateOptions(
|
|
4678
|
-
|
|
4807
|
+
yargs41.positional("filename", {
|
|
4679
4808
|
demandOption: true,
|
|
4680
4809
|
describe: "Composition/pattern file to put"
|
|
4681
4810
|
})
|
|
@@ -4713,7 +4842,7 @@ var ComponentPatternUpdateModule = {
|
|
|
4713
4842
|
var ComponentPatternModule = {
|
|
4714
4843
|
command: "component-pattern <command>",
|
|
4715
4844
|
describe: "Commands for Canvas component patterns",
|
|
4716
|
-
builder: (
|
|
4845
|
+
builder: (yargs41) => yargs41.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
4717
4846
|
handler: () => {
|
|
4718
4847
|
yargs7.help();
|
|
4719
4848
|
}
|
|
@@ -4725,7 +4854,7 @@ var CompositionModule = {
|
|
|
4725
4854
|
command: "composition <command>",
|
|
4726
4855
|
describe: "Commands for Canvas compositions",
|
|
4727
4856
|
aliases: ["comp"],
|
|
4728
|
-
builder: (
|
|
4857
|
+
builder: (yargs41) => yargs41.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
4729
4858
|
handler: () => {
|
|
4730
4859
|
yargs8.help();
|
|
4731
4860
|
}
|
|
@@ -4744,13 +4873,13 @@ var CompositionPatternGetModule = {
|
|
|
4744
4873
|
var CompositionPatternListModule = {
|
|
4745
4874
|
...CompositionListModule,
|
|
4746
4875
|
describe: "List composition patterns",
|
|
4747
|
-
builder: (
|
|
4876
|
+
builder: (yargs41) => withFormatOptions(
|
|
4748
4877
|
withConfiguration(
|
|
4749
4878
|
withApiOptions(
|
|
4750
4879
|
withDebugOptions(
|
|
4751
4880
|
withProjectOptions(
|
|
4752
4881
|
withStateOptions(
|
|
4753
|
-
|
|
4882
|
+
yargs41.options({
|
|
4754
4883
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4755
4884
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4756
4885
|
resolvePatterns: {
|
|
@@ -4794,12 +4923,12 @@ var CompositionPatternListModule = {
|
|
|
4794
4923
|
var CompositionPatternPublishModule = {
|
|
4795
4924
|
...CompositionPublishModule,
|
|
4796
4925
|
describe: "Publishes composition pattern(s)",
|
|
4797
|
-
builder: (
|
|
4926
|
+
builder: (yargs41) => withConfiguration(
|
|
4798
4927
|
withApiOptions(
|
|
4799
4928
|
withDebugOptions(
|
|
4800
4929
|
withProjectOptions(
|
|
4801
4930
|
withDiffOptions(
|
|
4802
|
-
|
|
4931
|
+
yargs41.positional("ids", {
|
|
4803
4932
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4804
4933
|
type: "string"
|
|
4805
4934
|
}).option("all", {
|
|
@@ -4838,13 +4967,13 @@ var CompositionPatternPublishModule = {
|
|
|
4838
4967
|
var CompositionPatternPullModule = {
|
|
4839
4968
|
...componentInstancePullModuleFactory("compositionPatterns"),
|
|
4840
4969
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
4841
|
-
builder: (
|
|
4970
|
+
builder: (yargs41) => withConfiguration(
|
|
4842
4971
|
withApiOptions(
|
|
4843
4972
|
withDebugOptions(
|
|
4844
4973
|
withProjectOptions(
|
|
4845
4974
|
withStateOptions(
|
|
4846
4975
|
withDiffOptions(
|
|
4847
|
-
|
|
4976
|
+
yargs41.positional("directory", {
|
|
4848
4977
|
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.",
|
|
4849
4978
|
type: "string"
|
|
4850
4979
|
}).option("format", {
|
|
@@ -4882,13 +5011,13 @@ var CompositionPatternPullModule = {
|
|
|
4882
5011
|
var CompositionPatternPushModule = {
|
|
4883
5012
|
...componentInstancePushModuleFactory("compositionPatterns"),
|
|
4884
5013
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
4885
|
-
builder: (
|
|
5014
|
+
builder: (yargs41) => withConfiguration(
|
|
4886
5015
|
withApiOptions(
|
|
4887
5016
|
withDebugOptions(
|
|
4888
5017
|
withProjectOptions(
|
|
4889
5018
|
withStateOptions(
|
|
4890
5019
|
withDiffOptions(
|
|
4891
|
-
|
|
5020
|
+
yargs41.positional("directory", {
|
|
4892
5021
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
4893
5022
|
type: "string"
|
|
4894
5023
|
}).option("mode", {
|
|
@@ -4927,11 +5056,11 @@ var CompositionPatternRemoveModule = {
|
|
|
4927
5056
|
var CompositionPatternUnpublishModule = {
|
|
4928
5057
|
command: "unpublish [ids]",
|
|
4929
5058
|
describe: "Unpublish a composition pattern(s)",
|
|
4930
|
-
builder: (
|
|
5059
|
+
builder: (yargs41) => withConfiguration(
|
|
4931
5060
|
withApiOptions(
|
|
4932
5061
|
withDebugOptions(
|
|
4933
5062
|
withProjectOptions(
|
|
4934
|
-
|
|
5063
|
+
yargs41.positional("ids", {
|
|
4935
5064
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
4936
5065
|
type: "string"
|
|
4937
5066
|
}).option("all", {
|
|
@@ -4967,7 +5096,7 @@ var CompositionPatternUpdateModule = {
|
|
|
4967
5096
|
var CompositionPatternModule = {
|
|
4968
5097
|
command: "composition-pattern <command>",
|
|
4969
5098
|
describe: "Commands for Canvas composition patterns",
|
|
4970
|
-
builder: (
|
|
5099
|
+
builder: (yargs41) => yargs41.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
4971
5100
|
handler: () => {
|
|
4972
5101
|
yargs9.help();
|
|
4973
5102
|
}
|
|
@@ -4988,12 +5117,12 @@ function getContentClient(options) {
|
|
|
4988
5117
|
var ContentTypeGetModule = {
|
|
4989
5118
|
command: "get <id>",
|
|
4990
5119
|
describe: "Get a content type",
|
|
4991
|
-
builder: (
|
|
5120
|
+
builder: (yargs41) => withConfiguration(
|
|
4992
5121
|
withDebugOptions(
|
|
4993
5122
|
withFormatOptions(
|
|
4994
5123
|
withApiOptions(
|
|
4995
5124
|
withProjectOptions(
|
|
4996
|
-
|
|
5125
|
+
yargs41.positional("id", {
|
|
4997
5126
|
demandOption: true,
|
|
4998
5127
|
describe: "Content type public ID to fetch"
|
|
4999
5128
|
})
|
|
@@ -5018,7 +5147,7 @@ var ContentTypeGetModule = {
|
|
|
5018
5147
|
var ContentTypeListModule = {
|
|
5019
5148
|
command: "list",
|
|
5020
5149
|
describe: "List content types",
|
|
5021
|
-
builder: (
|
|
5150
|
+
builder: (yargs41) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs41))))),
|
|
5022
5151
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5023
5152
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5024
5153
|
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5059,12 +5188,12 @@ function createContentTypeEngineDataSource({
|
|
|
5059
5188
|
var ContentTypePullModule = {
|
|
5060
5189
|
command: "pull <directory>",
|
|
5061
5190
|
describe: "Pulls all content types to local files in a directory",
|
|
5062
|
-
builder: (
|
|
5191
|
+
builder: (yargs41) => withConfiguration(
|
|
5063
5192
|
withApiOptions(
|
|
5064
5193
|
withDebugOptions(
|
|
5065
5194
|
withProjectOptions(
|
|
5066
5195
|
withDiffOptions(
|
|
5067
|
-
|
|
5196
|
+
yargs41.positional("directory", {
|
|
5068
5197
|
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.",
|
|
5069
5198
|
type: "string"
|
|
5070
5199
|
}).option("format", {
|
|
@@ -5144,12 +5273,12 @@ var ContentTypePullModule = {
|
|
|
5144
5273
|
var ContentTypePushModule = {
|
|
5145
5274
|
command: "push <directory>",
|
|
5146
5275
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
5147
|
-
builder: (
|
|
5276
|
+
builder: (yargs41) => withConfiguration(
|
|
5148
5277
|
withApiOptions(
|
|
5149
5278
|
withDebugOptions(
|
|
5150
5279
|
withProjectOptions(
|
|
5151
5280
|
withDiffOptions(
|
|
5152
|
-
|
|
5281
|
+
yargs41.positional("directory", {
|
|
5153
5282
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
5154
5283
|
type: "string"
|
|
5155
5284
|
}).option("what-if", {
|
|
@@ -5223,11 +5352,11 @@ var ContentTypeRemoveModule = {
|
|
|
5223
5352
|
command: "remove <id>",
|
|
5224
5353
|
aliases: ["delete", "rm"],
|
|
5225
5354
|
describe: "Delete a content type",
|
|
5226
|
-
builder: (
|
|
5355
|
+
builder: (yargs41) => withConfiguration(
|
|
5227
5356
|
withDebugOptions(
|
|
5228
5357
|
withApiOptions(
|
|
5229
5358
|
withProjectOptions(
|
|
5230
|
-
|
|
5359
|
+
yargs41.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
5231
5360
|
)
|
|
5232
5361
|
)
|
|
5233
5362
|
)
|
|
@@ -5248,11 +5377,11 @@ var ContentTypeUpdateModule = {
|
|
|
5248
5377
|
command: "update <filename>",
|
|
5249
5378
|
aliases: ["put"],
|
|
5250
5379
|
describe: "Insert or update a content type",
|
|
5251
|
-
builder: (
|
|
5380
|
+
builder: (yargs41) => withConfiguration(
|
|
5252
5381
|
withDebugOptions(
|
|
5253
5382
|
withApiOptions(
|
|
5254
5383
|
withProjectOptions(
|
|
5255
|
-
|
|
5384
|
+
yargs41.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
5256
5385
|
)
|
|
5257
5386
|
)
|
|
5258
5387
|
)
|
|
@@ -5274,7 +5403,7 @@ var ContentTypeModule = {
|
|
|
5274
5403
|
command: "contenttype <command>",
|
|
5275
5404
|
aliases: ["ct"],
|
|
5276
5405
|
describe: "Commands for Content Types",
|
|
5277
|
-
builder: (
|
|
5406
|
+
builder: (yargs41) => yargs41.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
5278
5407
|
handler: () => {
|
|
5279
5408
|
yargs10.help();
|
|
5280
5409
|
}
|
|
@@ -5293,11 +5422,11 @@ function getDataSourceClient(options) {
|
|
|
5293
5422
|
var DataSourceGetModule = {
|
|
5294
5423
|
command: "get <id>",
|
|
5295
5424
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
5296
|
-
builder: (
|
|
5425
|
+
builder: (yargs41) => withConfiguration(
|
|
5297
5426
|
withApiOptions(
|
|
5298
5427
|
withDebugOptions(
|
|
5299
5428
|
withProjectOptions(
|
|
5300
|
-
|
|
5429
|
+
yargs41.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
5301
5430
|
)
|
|
5302
5431
|
)
|
|
5303
5432
|
)
|
|
@@ -5315,11 +5444,11 @@ var DataSourceRemoveModule = {
|
|
|
5315
5444
|
command: "remove <id>",
|
|
5316
5445
|
aliases: ["delete", "rm"],
|
|
5317
5446
|
describe: "Delete a data source",
|
|
5318
|
-
builder: (
|
|
5447
|
+
builder: (yargs41) => withConfiguration(
|
|
5319
5448
|
withDebugOptions(
|
|
5320
5449
|
withApiOptions(
|
|
5321
5450
|
withProjectOptions(
|
|
5322
|
-
|
|
5451
|
+
yargs41.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
5323
5452
|
)
|
|
5324
5453
|
)
|
|
5325
5454
|
)
|
|
@@ -5340,11 +5469,11 @@ var DataSourceUpdateModule = {
|
|
|
5340
5469
|
command: "update <dataSource>",
|
|
5341
5470
|
aliases: ["put"],
|
|
5342
5471
|
describe: "Insert or update a data source",
|
|
5343
|
-
builder: (
|
|
5472
|
+
builder: (yargs41) => withConfiguration(
|
|
5344
5473
|
withApiOptions(
|
|
5345
5474
|
withDebugOptions(
|
|
5346
5475
|
withProjectOptions(
|
|
5347
|
-
|
|
5476
|
+
yargs41.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
5348
5477
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
5349
5478
|
type: "string",
|
|
5350
5479
|
demandOption: true
|
|
@@ -5379,7 +5508,7 @@ var DataSourceModule = {
|
|
|
5379
5508
|
command: "datasource <command>",
|
|
5380
5509
|
aliases: ["ds"],
|
|
5381
5510
|
describe: "Commands for Data Source definitions",
|
|
5382
|
-
builder: (
|
|
5511
|
+
builder: (yargs41) => yargs41.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
5383
5512
|
handler: () => {
|
|
5384
5513
|
yargs11.help();
|
|
5385
5514
|
}
|
|
@@ -5401,12 +5530,12 @@ var DataTypeGetModule = {
|
|
|
5401
5530
|
command: "get <id>",
|
|
5402
5531
|
describe: "Get a data type",
|
|
5403
5532
|
aliases: ["ls"],
|
|
5404
|
-
builder: (
|
|
5533
|
+
builder: (yargs41) => withConfiguration(
|
|
5405
5534
|
withFormatOptions(
|
|
5406
5535
|
withDebugOptions(
|
|
5407
5536
|
withApiOptions(
|
|
5408
5537
|
withProjectOptions(
|
|
5409
|
-
|
|
5538
|
+
yargs41.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
5410
5539
|
)
|
|
5411
5540
|
)
|
|
5412
5541
|
)
|
|
@@ -5429,7 +5558,7 @@ var DataTypeListModule = {
|
|
|
5429
5558
|
command: "list",
|
|
5430
5559
|
describe: "List data types",
|
|
5431
5560
|
aliases: ["ls"],
|
|
5432
|
-
builder: (
|
|
5561
|
+
builder: (yargs41) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs41))))),
|
|
5433
5562
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5434
5563
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5435
5564
|
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5472,12 +5601,12 @@ function createDataTypeEngineDataSource({
|
|
|
5472
5601
|
var DataTypePullModule = {
|
|
5473
5602
|
command: "pull <directory>",
|
|
5474
5603
|
describe: "Pulls all data types to local files in a directory",
|
|
5475
|
-
builder: (
|
|
5604
|
+
builder: (yargs41) => withConfiguration(
|
|
5476
5605
|
withApiOptions(
|
|
5477
5606
|
withDebugOptions(
|
|
5478
5607
|
withProjectOptions(
|
|
5479
5608
|
withDiffOptions(
|
|
5480
|
-
|
|
5609
|
+
yargs41.positional("directory", {
|
|
5481
5610
|
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.",
|
|
5482
5611
|
type: "string"
|
|
5483
5612
|
}).option("format", {
|
|
@@ -5557,12 +5686,12 @@ var DataTypePullModule = {
|
|
|
5557
5686
|
var DataTypePushModule = {
|
|
5558
5687
|
command: "push <directory>",
|
|
5559
5688
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
5560
|
-
builder: (
|
|
5689
|
+
builder: (yargs41) => withConfiguration(
|
|
5561
5690
|
withApiOptions(
|
|
5562
5691
|
withDebugOptions(
|
|
5563
5692
|
withProjectOptions(
|
|
5564
5693
|
withDiffOptions(
|
|
5565
|
-
|
|
5694
|
+
yargs41.positional("directory", {
|
|
5566
5695
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
5567
5696
|
type: "string"
|
|
5568
5697
|
}).option("mode", {
|
|
@@ -5631,11 +5760,11 @@ var DataTypeRemoveModule = {
|
|
|
5631
5760
|
command: "remove <id>",
|
|
5632
5761
|
aliases: ["delete", "rm"],
|
|
5633
5762
|
describe: "Delete a data type",
|
|
5634
|
-
builder: (
|
|
5763
|
+
builder: (yargs41) => withConfiguration(
|
|
5635
5764
|
withDebugOptions(
|
|
5636
5765
|
withApiOptions(
|
|
5637
5766
|
withProjectOptions(
|
|
5638
|
-
|
|
5767
|
+
yargs41.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
5639
5768
|
)
|
|
5640
5769
|
)
|
|
5641
5770
|
)
|
|
@@ -5656,11 +5785,11 @@ var DataTypeUpdateModule = {
|
|
|
5656
5785
|
command: "update <filename>",
|
|
5657
5786
|
aliases: ["put"],
|
|
5658
5787
|
describe: "Insert or update a data type",
|
|
5659
|
-
builder: (
|
|
5788
|
+
builder: (yargs41) => withConfiguration(
|
|
5660
5789
|
withDebugOptions(
|
|
5661
5790
|
withApiOptions(
|
|
5662
5791
|
withProjectOptions(
|
|
5663
|
-
|
|
5792
|
+
yargs41.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
5664
5793
|
)
|
|
5665
5794
|
)
|
|
5666
5795
|
)
|
|
@@ -5682,7 +5811,7 @@ var DataTypeModule = {
|
|
|
5682
5811
|
command: "datatype <command>",
|
|
5683
5812
|
aliases: ["dt"],
|
|
5684
5813
|
describe: "Commands for Data Type definitions",
|
|
5685
|
-
builder: (
|
|
5814
|
+
builder: (yargs41) => yargs41.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
5686
5815
|
handler: () => {
|
|
5687
5816
|
yargs12.help();
|
|
5688
5817
|
}
|
|
@@ -5695,13 +5824,13 @@ import yargs13 from "yargs";
|
|
|
5695
5824
|
var EntryGetModule = {
|
|
5696
5825
|
command: "get <id>",
|
|
5697
5826
|
describe: "Get an entry",
|
|
5698
|
-
builder: (
|
|
5827
|
+
builder: (yargs41) => withConfiguration(
|
|
5699
5828
|
withDebugOptions(
|
|
5700
5829
|
withFormatOptions(
|
|
5701
5830
|
withApiOptions(
|
|
5702
5831
|
withProjectOptions(
|
|
5703
5832
|
withStateOptions(
|
|
5704
|
-
|
|
5833
|
+
yargs41.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
5705
5834
|
resolveData: {
|
|
5706
5835
|
type: "boolean",
|
|
5707
5836
|
default: false,
|
|
@@ -5773,13 +5902,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
5773
5902
|
var EntryListModule = {
|
|
5774
5903
|
command: "list",
|
|
5775
5904
|
describe: "List entries",
|
|
5776
|
-
builder: (
|
|
5905
|
+
builder: (yargs41) => withConfiguration(
|
|
5777
5906
|
withDebugOptions(
|
|
5778
5907
|
withFormatOptions(
|
|
5779
5908
|
withApiOptions(
|
|
5780
5909
|
withProjectOptions(
|
|
5781
5910
|
withStateOptions(
|
|
5782
|
-
|
|
5911
|
+
yargs41.options({
|
|
5783
5912
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
5784
5913
|
limit: {
|
|
5785
5914
|
describe: "Number of rows to fetch",
|
|
@@ -5914,12 +6043,12 @@ function createEntryEngineDataSource({
|
|
|
5914
6043
|
var EntryPublishModule = {
|
|
5915
6044
|
command: "publish [ids]",
|
|
5916
6045
|
describe: "Publishes entry(ies)",
|
|
5917
|
-
builder: (
|
|
6046
|
+
builder: (yargs41) => withConfiguration(
|
|
5918
6047
|
withDiffOptions(
|
|
5919
6048
|
withApiOptions(
|
|
5920
6049
|
withProjectOptions(
|
|
5921
6050
|
withDiffOptions(
|
|
5922
|
-
|
|
6051
|
+
yargs41.positional("ids", {
|
|
5923
6052
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
5924
6053
|
type: "string"
|
|
5925
6054
|
}).option("all", {
|
|
@@ -5994,13 +6123,13 @@ var EntryPublishModule = {
|
|
|
5994
6123
|
var EntryPullModule = {
|
|
5995
6124
|
command: "pull <directory>",
|
|
5996
6125
|
describe: "Pulls all entries to local files in a directory",
|
|
5997
|
-
builder: (
|
|
6126
|
+
builder: (yargs41) => withConfiguration(
|
|
5998
6127
|
withDebugOptions(
|
|
5999
6128
|
withApiOptions(
|
|
6000
6129
|
withProjectOptions(
|
|
6001
6130
|
withStateOptions(
|
|
6002
6131
|
withDiffOptions(
|
|
6003
|
-
|
|
6132
|
+
yargs41.positional("directory", {
|
|
6004
6133
|
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.",
|
|
6005
6134
|
type: "string"
|
|
6006
6135
|
}).option("format", {
|
|
@@ -6100,13 +6229,13 @@ var EntryPullModule = {
|
|
|
6100
6229
|
var EntryPushModule = {
|
|
6101
6230
|
command: "push <directory>",
|
|
6102
6231
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
6103
|
-
builder: (
|
|
6232
|
+
builder: (yargs41) => withConfiguration(
|
|
6104
6233
|
withDebugOptions(
|
|
6105
6234
|
withApiOptions(
|
|
6106
6235
|
withProjectOptions(
|
|
6107
6236
|
withStateOptions(
|
|
6108
6237
|
withDiffOptions(
|
|
6109
|
-
|
|
6238
|
+
yargs41.positional("directory", {
|
|
6110
6239
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
6111
6240
|
type: "string"
|
|
6112
6241
|
}).option("mode", {
|
|
@@ -6205,11 +6334,11 @@ var EntryRemoveModule = {
|
|
|
6205
6334
|
command: "remove <id>",
|
|
6206
6335
|
aliases: ["delete", "rm"],
|
|
6207
6336
|
describe: "Delete an entry",
|
|
6208
|
-
builder: (
|
|
6337
|
+
builder: (yargs41) => withConfiguration(
|
|
6209
6338
|
withDebugOptions(
|
|
6210
6339
|
withApiOptions(
|
|
6211
6340
|
withProjectOptions(
|
|
6212
|
-
|
|
6341
|
+
yargs41.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
6213
6342
|
)
|
|
6214
6343
|
)
|
|
6215
6344
|
)
|
|
@@ -6231,11 +6360,11 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
6231
6360
|
var EntryUnpublishModule = {
|
|
6232
6361
|
command: "unpublish [ids]",
|
|
6233
6362
|
describe: "Unpublish an entry(ies)",
|
|
6234
|
-
builder: (
|
|
6363
|
+
builder: (yargs41) => withConfiguration(
|
|
6235
6364
|
withDebugOptions(
|
|
6236
6365
|
withApiOptions(
|
|
6237
6366
|
withProjectOptions(
|
|
6238
|
-
|
|
6367
|
+
yargs41.positional("ids", {
|
|
6239
6368
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6240
6369
|
type: "string"
|
|
6241
6370
|
}).option("all", {
|
|
@@ -6305,12 +6434,12 @@ var EntryUpdateModule = {
|
|
|
6305
6434
|
command: "update <filename>",
|
|
6306
6435
|
aliases: ["put"],
|
|
6307
6436
|
describe: "Insert or update an entry",
|
|
6308
|
-
builder: (
|
|
6437
|
+
builder: (yargs41) => withConfiguration(
|
|
6309
6438
|
withDebugOptions(
|
|
6310
6439
|
withApiOptions(
|
|
6311
6440
|
withProjectOptions(
|
|
6312
6441
|
withStateOptions(
|
|
6313
|
-
|
|
6442
|
+
yargs41.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
6314
6443
|
)
|
|
6315
6444
|
)
|
|
6316
6445
|
)
|
|
@@ -6342,7 +6471,7 @@ var EntryUpdateModule = {
|
|
|
6342
6471
|
var EntryModule = {
|
|
6343
6472
|
command: "entry <command>",
|
|
6344
6473
|
describe: "Commands for Entries",
|
|
6345
|
-
builder: (
|
|
6474
|
+
builder: (yargs41) => yargs41.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
6346
6475
|
handler: () => {
|
|
6347
6476
|
yargs13.help();
|
|
6348
6477
|
}
|
|
@@ -6355,13 +6484,13 @@ import yargs14 from "yargs";
|
|
|
6355
6484
|
var EntryPatternGetModule = {
|
|
6356
6485
|
command: "get <id>",
|
|
6357
6486
|
describe: "Get an entry pattern",
|
|
6358
|
-
builder: (
|
|
6487
|
+
builder: (yargs41) => withConfiguration(
|
|
6359
6488
|
withDebugOptions(
|
|
6360
6489
|
withFormatOptions(
|
|
6361
6490
|
withApiOptions(
|
|
6362
6491
|
withProjectOptions(
|
|
6363
6492
|
withStateOptions(
|
|
6364
|
-
|
|
6493
|
+
yargs41.positional("id", {
|
|
6365
6494
|
demandOption: true,
|
|
6366
6495
|
describe: "Entry pattern public ID to fetch"
|
|
6367
6496
|
}).option({
|
|
@@ -6414,13 +6543,13 @@ var EntryPatternGetModule = {
|
|
|
6414
6543
|
var EntryPatternListModule = {
|
|
6415
6544
|
command: "list",
|
|
6416
6545
|
describe: "List entry patterns",
|
|
6417
|
-
builder: (
|
|
6546
|
+
builder: (yargs41) => withConfiguration(
|
|
6418
6547
|
withDebugOptions(
|
|
6419
6548
|
withFormatOptions(
|
|
6420
6549
|
withApiOptions(
|
|
6421
6550
|
withProjectOptions(
|
|
6422
6551
|
withStateOptions(
|
|
6423
|
-
|
|
6552
|
+
yargs41.option({
|
|
6424
6553
|
withComponentIDs: {
|
|
6425
6554
|
type: "boolean",
|
|
6426
6555
|
default: false,
|
|
@@ -6466,12 +6595,12 @@ var EntryPatternListModule = {
|
|
|
6466
6595
|
var EntryPatternPublishModule = {
|
|
6467
6596
|
command: "publish [ids]",
|
|
6468
6597
|
describe: "Publishes entry pattern(s)",
|
|
6469
|
-
builder: (
|
|
6598
|
+
builder: (yargs41) => withConfiguration(
|
|
6470
6599
|
withDebugOptions(
|
|
6471
6600
|
withApiOptions(
|
|
6472
6601
|
withProjectOptions(
|
|
6473
6602
|
withDiffOptions(
|
|
6474
|
-
|
|
6603
|
+
yargs41.positional("ids", {
|
|
6475
6604
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6476
6605
|
type: "string"
|
|
6477
6606
|
}).option("all", {
|
|
@@ -6546,13 +6675,13 @@ var EntryPatternPublishModule = {
|
|
|
6546
6675
|
var EntryPatternPullModule = {
|
|
6547
6676
|
command: "pull <directory>",
|
|
6548
6677
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
6549
|
-
builder: (
|
|
6678
|
+
builder: (yargs41) => withConfiguration(
|
|
6550
6679
|
withApiOptions(
|
|
6551
6680
|
withDebugOptions(
|
|
6552
6681
|
withProjectOptions(
|
|
6553
6682
|
withStateOptions(
|
|
6554
6683
|
withDiffOptions(
|
|
6555
|
-
|
|
6684
|
+
yargs41.positional("directory", {
|
|
6556
6685
|
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.",
|
|
6557
6686
|
type: "string"
|
|
6558
6687
|
}).option("format", {
|
|
@@ -6652,13 +6781,13 @@ var EntryPatternPullModule = {
|
|
|
6652
6781
|
var EntryPatternPushModule = {
|
|
6653
6782
|
command: "push <directory>",
|
|
6654
6783
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
6655
|
-
builder: (
|
|
6784
|
+
builder: (yargs41) => withConfiguration(
|
|
6656
6785
|
withDebugOptions(
|
|
6657
6786
|
withApiOptions(
|
|
6658
6787
|
withProjectOptions(
|
|
6659
6788
|
withStateOptions(
|
|
6660
6789
|
withDiffOptions(
|
|
6661
|
-
|
|
6790
|
+
yargs41.positional("directory", {
|
|
6662
6791
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
6663
6792
|
type: "string"
|
|
6664
6793
|
}).option("what-if", {
|
|
@@ -6762,11 +6891,11 @@ var EntryPatternRemoveModule = {
|
|
|
6762
6891
|
command: "remove <id>",
|
|
6763
6892
|
aliases: ["delete", "rm"],
|
|
6764
6893
|
describe: "Delete an entry pattern",
|
|
6765
|
-
builder: (
|
|
6894
|
+
builder: (yargs41) => withConfiguration(
|
|
6766
6895
|
withDebugOptions(
|
|
6767
6896
|
withApiOptions(
|
|
6768
6897
|
withProjectOptions(
|
|
6769
|
-
|
|
6898
|
+
yargs41.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
6770
6899
|
)
|
|
6771
6900
|
)
|
|
6772
6901
|
)
|
|
@@ -6788,11 +6917,11 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
6788
6917
|
var EntryPatternUnpublishModule = {
|
|
6789
6918
|
command: "unpublish [ids]",
|
|
6790
6919
|
describe: "Unpublish an entry patterns",
|
|
6791
|
-
builder: (
|
|
6920
|
+
builder: (yargs41) => withConfiguration(
|
|
6792
6921
|
withDebugOptions(
|
|
6793
6922
|
withApiOptions(
|
|
6794
6923
|
withProjectOptions(
|
|
6795
|
-
|
|
6924
|
+
yargs41.positional("ids", {
|
|
6796
6925
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6797
6926
|
type: "string"
|
|
6798
6927
|
}).option("all", {
|
|
@@ -6862,12 +6991,12 @@ var EntryPatternUpdateModule = {
|
|
|
6862
6991
|
command: "update <filename>",
|
|
6863
6992
|
aliases: ["put"],
|
|
6864
6993
|
describe: "Insert or update an entry pattern",
|
|
6865
|
-
builder: (
|
|
6994
|
+
builder: (yargs41) => withConfiguration(
|
|
6866
6995
|
withDebugOptions(
|
|
6867
6996
|
withApiOptions(
|
|
6868
6997
|
withProjectOptions(
|
|
6869
6998
|
withStateOptions(
|
|
6870
|
-
|
|
6999
|
+
yargs41.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
6871
7000
|
)
|
|
6872
7001
|
)
|
|
6873
7002
|
)
|
|
@@ -6903,7 +7032,7 @@ var EntryPatternUpdateModule = {
|
|
|
6903
7032
|
var EntryPatternModule = {
|
|
6904
7033
|
command: "entry-pattern <command>",
|
|
6905
7034
|
describe: "Commands for Entry patterns",
|
|
6906
|
-
builder: (
|
|
7035
|
+
builder: (yargs41) => yargs41.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
6907
7036
|
handler: () => {
|
|
6908
7037
|
yargs14.help();
|
|
6909
7038
|
}
|
|
@@ -6952,12 +7081,12 @@ function getLocaleClient(options) {
|
|
|
6952
7081
|
var LocalePullModule = {
|
|
6953
7082
|
command: "pull <directory>",
|
|
6954
7083
|
describe: "Pulls all locales to local files in a directory",
|
|
6955
|
-
builder: (
|
|
7084
|
+
builder: (yargs41) => withConfiguration(
|
|
6956
7085
|
withDebugOptions(
|
|
6957
7086
|
withApiOptions(
|
|
6958
7087
|
withProjectOptions(
|
|
6959
7088
|
withDiffOptions(
|
|
6960
|
-
|
|
7089
|
+
yargs41.positional("directory", {
|
|
6961
7090
|
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.",
|
|
6962
7091
|
type: "string"
|
|
6963
7092
|
}).option("format", {
|
|
@@ -7037,12 +7166,12 @@ var LocalePullModule = {
|
|
|
7037
7166
|
var LocalePushModule = {
|
|
7038
7167
|
command: "push <directory>",
|
|
7039
7168
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
7040
|
-
builder: (
|
|
7169
|
+
builder: (yargs41) => withConfiguration(
|
|
7041
7170
|
withDebugOptions(
|
|
7042
7171
|
withApiOptions(
|
|
7043
7172
|
withProjectOptions(
|
|
7044
7173
|
withDiffOptions(
|
|
7045
|
-
|
|
7174
|
+
yargs41.positional("directory", {
|
|
7046
7175
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
7047
7176
|
type: "string"
|
|
7048
7177
|
}).option("mode", {
|
|
@@ -7110,7 +7239,7 @@ var LocalePushModule = {
|
|
|
7110
7239
|
var LocaleModule = {
|
|
7111
7240
|
command: "locale <command>",
|
|
7112
7241
|
describe: "Commands for locale definitions",
|
|
7113
|
-
builder: (
|
|
7242
|
+
builder: (yargs41) => yargs41.command(LocalePullModule).command(LocalePushModule),
|
|
7114
7243
|
handler: () => {
|
|
7115
7244
|
yargs15.help();
|
|
7116
7245
|
}
|
|
@@ -7131,12 +7260,12 @@ function getPreviewClient(options) {
|
|
|
7131
7260
|
var PreviewUrlGetModule = {
|
|
7132
7261
|
command: "get <id>",
|
|
7133
7262
|
describe: "Fetch a preview URL",
|
|
7134
|
-
builder: (
|
|
7263
|
+
builder: (yargs41) => withConfiguration(
|
|
7135
7264
|
withFormatOptions(
|
|
7136
7265
|
withDebugOptions(
|
|
7137
7266
|
withApiOptions(
|
|
7138
7267
|
withProjectOptions(
|
|
7139
|
-
|
|
7268
|
+
yargs41.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
7140
7269
|
)
|
|
7141
7270
|
)
|
|
7142
7271
|
)
|
|
@@ -7160,8 +7289,8 @@ var PreviewUrlListModule = {
|
|
|
7160
7289
|
command: "list",
|
|
7161
7290
|
describe: "List preview URLs",
|
|
7162
7291
|
aliases: ["ls"],
|
|
7163
|
-
builder: (
|
|
7164
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
7292
|
+
builder: (yargs41) => withConfiguration(
|
|
7293
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs41.options({})))))
|
|
7165
7294
|
),
|
|
7166
7295
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7167
7296
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -7203,12 +7332,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
7203
7332
|
var PreviewUrlPullModule = {
|
|
7204
7333
|
command: "pull <directory>",
|
|
7205
7334
|
describe: "Pulls all preview urls to local files in a directory",
|
|
7206
|
-
builder: (
|
|
7335
|
+
builder: (yargs41) => withConfiguration(
|
|
7207
7336
|
withApiOptions(
|
|
7208
7337
|
withProjectOptions(
|
|
7209
7338
|
withDebugOptions(
|
|
7210
7339
|
withDiffOptions(
|
|
7211
|
-
|
|
7340
|
+
yargs41.positional("directory", {
|
|
7212
7341
|
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.",
|
|
7213
7342
|
type: "string"
|
|
7214
7343
|
}).option("format", {
|
|
@@ -7283,12 +7412,12 @@ var PreviewUrlPullModule = {
|
|
|
7283
7412
|
var PreviewUrlPushModule = {
|
|
7284
7413
|
command: "push <directory>",
|
|
7285
7414
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
7286
|
-
builder: (
|
|
7415
|
+
builder: (yargs41) => withConfiguration(
|
|
7287
7416
|
withApiOptions(
|
|
7288
7417
|
withProjectOptions(
|
|
7289
7418
|
withDiffOptions(
|
|
7290
7419
|
withDebugOptions(
|
|
7291
|
-
|
|
7420
|
+
yargs41.positional("directory", {
|
|
7292
7421
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
7293
7422
|
type: "string"
|
|
7294
7423
|
}).option("mode", {
|
|
@@ -7352,11 +7481,11 @@ var PreviewUrlRemoveModule = {
|
|
|
7352
7481
|
command: "remove <id>",
|
|
7353
7482
|
aliases: ["delete", "rm"],
|
|
7354
7483
|
describe: "Delete a preview URL",
|
|
7355
|
-
builder: (
|
|
7484
|
+
builder: (yargs41) => withConfiguration(
|
|
7356
7485
|
withApiOptions(
|
|
7357
7486
|
withDebugOptions(
|
|
7358
7487
|
withProjectOptions(
|
|
7359
|
-
|
|
7488
|
+
yargs41.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
7360
7489
|
)
|
|
7361
7490
|
)
|
|
7362
7491
|
)
|
|
@@ -7377,11 +7506,11 @@ var PreviewUrlUpdateModule = {
|
|
|
7377
7506
|
command: "update <filename>",
|
|
7378
7507
|
aliases: ["put"],
|
|
7379
7508
|
describe: "Insert or update a preview URL",
|
|
7380
|
-
builder: (
|
|
7509
|
+
builder: (yargs41) => withConfiguration(
|
|
7381
7510
|
withDebugOptions(
|
|
7382
7511
|
withApiOptions(
|
|
7383
7512
|
withProjectOptions(
|
|
7384
|
-
|
|
7513
|
+
yargs41.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
7385
7514
|
)
|
|
7386
7515
|
)
|
|
7387
7516
|
)
|
|
@@ -7403,7 +7532,7 @@ var PreviewUrlModule = {
|
|
|
7403
7532
|
command: "preview-url <command>",
|
|
7404
7533
|
aliases: ["pu"],
|
|
7405
7534
|
describe: "Commands for Canvas preview urls",
|
|
7406
|
-
builder: (
|
|
7535
|
+
builder: (yargs41) => yargs41.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
7407
7536
|
handler: () => {
|
|
7408
7537
|
yargs16.help();
|
|
7409
7538
|
}
|
|
@@ -7416,12 +7545,12 @@ import yargs17 from "yargs";
|
|
|
7416
7545
|
var PreviewViewportGetModule = {
|
|
7417
7546
|
command: "get <id>",
|
|
7418
7547
|
describe: "Fetch a preview viewport",
|
|
7419
|
-
builder: (
|
|
7548
|
+
builder: (yargs41) => withConfiguration(
|
|
7420
7549
|
withFormatOptions(
|
|
7421
7550
|
withDebugOptions(
|
|
7422
7551
|
withApiOptions(
|
|
7423
7552
|
withProjectOptions(
|
|
7424
|
-
|
|
7553
|
+
yargs41.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
7425
7554
|
)
|
|
7426
7555
|
)
|
|
7427
7556
|
)
|
|
@@ -7445,8 +7574,8 @@ var PreviewViewportListModule = {
|
|
|
7445
7574
|
command: "list",
|
|
7446
7575
|
describe: "List preview viewports",
|
|
7447
7576
|
aliases: ["ls"],
|
|
7448
|
-
builder: (
|
|
7449
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
7577
|
+
builder: (yargs41) => withConfiguration(
|
|
7578
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs41.options({})))))
|
|
7450
7579
|
),
|
|
7451
7580
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7452
7581
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -7492,12 +7621,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
7492
7621
|
var PreviewViewportPullModule = {
|
|
7493
7622
|
command: "pull <directory>",
|
|
7494
7623
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
7495
|
-
builder: (
|
|
7624
|
+
builder: (yargs41) => withConfiguration(
|
|
7496
7625
|
withApiOptions(
|
|
7497
7626
|
withProjectOptions(
|
|
7498
7627
|
withDebugOptions(
|
|
7499
7628
|
withDiffOptions(
|
|
7500
|
-
|
|
7629
|
+
yargs41.positional("directory", {
|
|
7501
7630
|
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.",
|
|
7502
7631
|
type: "string"
|
|
7503
7632
|
}).option("format", {
|
|
@@ -7572,12 +7701,12 @@ var PreviewViewportPullModule = {
|
|
|
7572
7701
|
var PreviewViewportPushModule = {
|
|
7573
7702
|
command: "push <directory>",
|
|
7574
7703
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
7575
|
-
builder: (
|
|
7704
|
+
builder: (yargs41) => withConfiguration(
|
|
7576
7705
|
withApiOptions(
|
|
7577
7706
|
withProjectOptions(
|
|
7578
7707
|
withDiffOptions(
|
|
7579
7708
|
withDebugOptions(
|
|
7580
|
-
|
|
7709
|
+
yargs41.positional("directory", {
|
|
7581
7710
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
7582
7711
|
type: "string"
|
|
7583
7712
|
}).option("mode", {
|
|
@@ -7641,11 +7770,11 @@ var PreviewViewportRemoveModule = {
|
|
|
7641
7770
|
command: "remove <id>",
|
|
7642
7771
|
aliases: ["delete", "rm"],
|
|
7643
7772
|
describe: "Delete a preview viewport",
|
|
7644
|
-
builder: (
|
|
7773
|
+
builder: (yargs41) => withConfiguration(
|
|
7645
7774
|
withApiOptions(
|
|
7646
7775
|
withDebugOptions(
|
|
7647
7776
|
withProjectOptions(
|
|
7648
|
-
|
|
7777
|
+
yargs41.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
7649
7778
|
)
|
|
7650
7779
|
)
|
|
7651
7780
|
)
|
|
@@ -7666,11 +7795,11 @@ var PreviewViewportUpdateModule = {
|
|
|
7666
7795
|
command: "update <filename>",
|
|
7667
7796
|
aliases: ["put"],
|
|
7668
7797
|
describe: "Insert or update a preview viewport",
|
|
7669
|
-
builder: (
|
|
7798
|
+
builder: (yargs41) => withConfiguration(
|
|
7670
7799
|
withDebugOptions(
|
|
7671
7800
|
withApiOptions(
|
|
7672
7801
|
withProjectOptions(
|
|
7673
|
-
|
|
7802
|
+
yargs41.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
7674
7803
|
)
|
|
7675
7804
|
)
|
|
7676
7805
|
)
|
|
@@ -7692,7 +7821,7 @@ var PreviewViewportModule = {
|
|
|
7692
7821
|
command: "preview-viewport <command>",
|
|
7693
7822
|
aliases: ["pv"],
|
|
7694
7823
|
describe: "Commands for Canvas preview viewports",
|
|
7695
|
-
builder: (
|
|
7824
|
+
builder: (yargs41) => yargs41.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
7696
7825
|
handler: () => {
|
|
7697
7826
|
yargs17.help();
|
|
7698
7827
|
}
|
|
@@ -7711,12 +7840,12 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
7711
7840
|
var PromptGetModule = {
|
|
7712
7841
|
command: "get <id>",
|
|
7713
7842
|
describe: "Get a prompt",
|
|
7714
|
-
builder: (
|
|
7843
|
+
builder: (yargs41) => withConfiguration(
|
|
7715
7844
|
withDebugOptions(
|
|
7716
7845
|
withFormatOptions(
|
|
7717
7846
|
withApiOptions(
|
|
7718
7847
|
withProjectOptions(
|
|
7719
|
-
|
|
7848
|
+
yargs41.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
7720
7849
|
)
|
|
7721
7850
|
)
|
|
7722
7851
|
)
|
|
@@ -7737,7 +7866,7 @@ var PromptGetModule = {
|
|
|
7737
7866
|
var PromptListModule = {
|
|
7738
7867
|
command: "list",
|
|
7739
7868
|
describe: "List prompts",
|
|
7740
|
-
builder: (
|
|
7869
|
+
builder: (yargs41) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs41))))),
|
|
7741
7870
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
7742
7871
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
7743
7872
|
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -7778,13 +7907,13 @@ function createPromptEngineDataSource({
|
|
|
7778
7907
|
var PromptPullModule = {
|
|
7779
7908
|
command: "pull <directory>",
|
|
7780
7909
|
describe: "Pulls all prompts to local files in a directory",
|
|
7781
|
-
builder: (
|
|
7910
|
+
builder: (yargs41) => withConfiguration(
|
|
7782
7911
|
withDebugOptions(
|
|
7783
7912
|
withApiOptions(
|
|
7784
7913
|
withProjectOptions(
|
|
7785
7914
|
withStateOptions(
|
|
7786
7915
|
withDiffOptions(
|
|
7787
|
-
|
|
7916
|
+
yargs41.positional("directory", {
|
|
7788
7917
|
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.",
|
|
7789
7918
|
type: "string"
|
|
7790
7919
|
}).option("format", {
|
|
@@ -7865,12 +7994,12 @@ var PromptPullModule = {
|
|
|
7865
7994
|
var PromptPushModule = {
|
|
7866
7995
|
command: "push <directory>",
|
|
7867
7996
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
7868
|
-
builder: (
|
|
7997
|
+
builder: (yargs41) => withConfiguration(
|
|
7869
7998
|
withApiOptions(
|
|
7870
7999
|
withProjectOptions(
|
|
7871
8000
|
withStateOptions(
|
|
7872
8001
|
withDiffOptions(
|
|
7873
|
-
|
|
8002
|
+
yargs41.positional("directory", {
|
|
7874
8003
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
7875
8004
|
type: "string"
|
|
7876
8005
|
}).option("mode", {
|
|
@@ -7939,10 +8068,10 @@ var PromptRemoveModule = {
|
|
|
7939
8068
|
command: "remove <id>",
|
|
7940
8069
|
aliases: ["delete", "rm"],
|
|
7941
8070
|
describe: "Delete a prompt",
|
|
7942
|
-
builder: (
|
|
8071
|
+
builder: (yargs41) => withConfiguration(
|
|
7943
8072
|
withDebugOptions(
|
|
7944
8073
|
withApiOptions(
|
|
7945
|
-
withProjectOptions(
|
|
8074
|
+
withProjectOptions(yargs41.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
7946
8075
|
)
|
|
7947
8076
|
)
|
|
7948
8077
|
),
|
|
@@ -7962,11 +8091,11 @@ var PromptUpdateModule = {
|
|
|
7962
8091
|
command: "update <filename>",
|
|
7963
8092
|
aliases: ["put"],
|
|
7964
8093
|
describe: "Insert or update a prompt",
|
|
7965
|
-
builder: (
|
|
8094
|
+
builder: (yargs41) => withConfiguration(
|
|
7966
8095
|
withDebugOptions(
|
|
7967
8096
|
withApiOptions(
|
|
7968
8097
|
withProjectOptions(
|
|
7969
|
-
|
|
8098
|
+
yargs41.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
7970
8099
|
)
|
|
7971
8100
|
)
|
|
7972
8101
|
)
|
|
@@ -7988,7 +8117,7 @@ var PromptModule = {
|
|
|
7988
8117
|
command: "prompt <command>",
|
|
7989
8118
|
aliases: ["dt"],
|
|
7990
8119
|
describe: "Commands for AI Prompt definitions",
|
|
7991
|
-
builder: (
|
|
8120
|
+
builder: (yargs41) => yargs41.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
7992
8121
|
handler: () => {
|
|
7993
8122
|
yargs18.help();
|
|
7994
8123
|
}
|
|
@@ -8038,12 +8167,12 @@ function createWorkflowEngineDataSource({
|
|
|
8038
8167
|
var WorkflowPullModule = {
|
|
8039
8168
|
command: "pull <directory>",
|
|
8040
8169
|
describe: "Pulls all workflows to local files in a directory",
|
|
8041
|
-
builder: (
|
|
8170
|
+
builder: (yargs41) => withConfiguration(
|
|
8042
8171
|
withApiOptions(
|
|
8043
8172
|
withDebugOptions(
|
|
8044
8173
|
withProjectOptions(
|
|
8045
8174
|
withDiffOptions(
|
|
8046
|
-
|
|
8175
|
+
yargs41.positional("directory", {
|
|
8047
8176
|
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.",
|
|
8048
8177
|
type: "string"
|
|
8049
8178
|
}).option("format", {
|
|
@@ -8118,12 +8247,12 @@ var WorkflowPullModule = {
|
|
|
8118
8247
|
var WorkflowPushModule = {
|
|
8119
8248
|
command: "push <directory>",
|
|
8120
8249
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
8121
|
-
builder: (
|
|
8250
|
+
builder: (yargs41) => withConfiguration(
|
|
8122
8251
|
withDebugOptions(
|
|
8123
8252
|
withApiOptions(
|
|
8124
8253
|
withProjectOptions(
|
|
8125
8254
|
withDiffOptions(
|
|
8126
|
-
|
|
8255
|
+
yargs41.positional("directory", {
|
|
8127
8256
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8128
8257
|
type: "string"
|
|
8129
8258
|
}).option("mode", {
|
|
@@ -8187,7 +8316,7 @@ var WorkflowModule = {
|
|
|
8187
8316
|
command: "workflow <command>",
|
|
8188
8317
|
aliases: ["wf"],
|
|
8189
8318
|
describe: "Commands for Canvas workflows",
|
|
8190
|
-
builder: (
|
|
8319
|
+
builder: (yargs41) => yargs41.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
8191
8320
|
handler: () => {
|
|
8192
8321
|
yargs19.help();
|
|
8193
8322
|
}
|
|
@@ -8198,7 +8327,7 @@ var CanvasCommand = {
|
|
|
8198
8327
|
command: "canvas <command>",
|
|
8199
8328
|
aliases: ["cv", "pm", "presentation"],
|
|
8200
8329
|
describe: "Uniform Canvas commands",
|
|
8201
|
-
builder: (
|
|
8330
|
+
builder: (yargs41) => yargs41.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(),
|
|
8202
8331
|
handler: () => {
|
|
8203
8332
|
yargs20.showHelp();
|
|
8204
8333
|
}
|
|
@@ -8220,11 +8349,11 @@ var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCa
|
|
|
8220
8349
|
var AggregateGetModule = {
|
|
8221
8350
|
command: "get <id>",
|
|
8222
8351
|
describe: "Fetch an aggregate",
|
|
8223
|
-
builder: (
|
|
8352
|
+
builder: (yargs41) => withConfiguration(
|
|
8224
8353
|
withFormatOptions(
|
|
8225
8354
|
withApiOptions(
|
|
8226
8355
|
withProjectOptions(
|
|
8227
|
-
|
|
8356
|
+
yargs41.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
8228
8357
|
)
|
|
8229
8358
|
)
|
|
8230
8359
|
)
|
|
@@ -8247,7 +8376,7 @@ var AggregateListModule = {
|
|
|
8247
8376
|
command: "list",
|
|
8248
8377
|
describe: "List aggregates",
|
|
8249
8378
|
aliases: ["ls"],
|
|
8250
|
-
builder: (
|
|
8379
|
+
builder: (yargs41) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs41)))),
|
|
8251
8380
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8252
8381
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8253
8382
|
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8310,12 +8439,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
8310
8439
|
var AggregatePullModule = {
|
|
8311
8440
|
command: "pull <directory>",
|
|
8312
8441
|
describe: "Pulls all aggregates to local files in a directory",
|
|
8313
|
-
builder: (
|
|
8442
|
+
builder: (yargs41) => withConfiguration(
|
|
8314
8443
|
withApiOptions(
|
|
8315
8444
|
withDebugOptions(
|
|
8316
8445
|
withProjectOptions(
|
|
8317
8446
|
withDiffOptions(
|
|
8318
|
-
|
|
8447
|
+
yargs41.positional("directory", {
|
|
8319
8448
|
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.",
|
|
8320
8449
|
type: "string"
|
|
8321
8450
|
}).option("format", {
|
|
@@ -8390,12 +8519,12 @@ var AggregatePullModule = {
|
|
|
8390
8519
|
var AggregatePushModule = {
|
|
8391
8520
|
command: "push <directory>",
|
|
8392
8521
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
8393
|
-
builder: (
|
|
8522
|
+
builder: (yargs41) => withConfiguration(
|
|
8394
8523
|
withApiOptions(
|
|
8395
8524
|
withProjectOptions(
|
|
8396
8525
|
withDiffOptions(
|
|
8397
8526
|
withDebugOptions(
|
|
8398
|
-
|
|
8527
|
+
yargs41.positional("directory", {
|
|
8399
8528
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
8400
8529
|
type: "string"
|
|
8401
8530
|
}).option("mode", {
|
|
@@ -8460,10 +8589,10 @@ var AggregateRemoveModule = {
|
|
|
8460
8589
|
command: "remove <id>",
|
|
8461
8590
|
aliases: ["delete", "rm"],
|
|
8462
8591
|
describe: "Delete an aggregate",
|
|
8463
|
-
builder: (
|
|
8592
|
+
builder: (yargs41) => withConfiguration(
|
|
8464
8593
|
withApiOptions(
|
|
8465
8594
|
withProjectOptions(
|
|
8466
|
-
|
|
8595
|
+
yargs41.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
8467
8596
|
)
|
|
8468
8597
|
)
|
|
8469
8598
|
),
|
|
@@ -8479,10 +8608,10 @@ var AggregateUpdateModule = {
|
|
|
8479
8608
|
command: "update <filename>",
|
|
8480
8609
|
aliases: ["put"],
|
|
8481
8610
|
describe: "Insert or update an aggregate",
|
|
8482
|
-
builder: (
|
|
8611
|
+
builder: (yargs41) => withConfiguration(
|
|
8483
8612
|
withApiOptions(
|
|
8484
8613
|
withProjectOptions(
|
|
8485
|
-
|
|
8614
|
+
yargs41.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
8486
8615
|
)
|
|
8487
8616
|
)
|
|
8488
8617
|
),
|
|
@@ -8499,7 +8628,7 @@ var AggregateModule = {
|
|
|
8499
8628
|
command: "aggregate <command>",
|
|
8500
8629
|
aliases: ["agg", "intent", "audience"],
|
|
8501
8630
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
8502
|
-
builder: (
|
|
8631
|
+
builder: (yargs41) => yargs41.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
8503
8632
|
handler: () => {
|
|
8504
8633
|
yargs21.help();
|
|
8505
8634
|
}
|
|
@@ -8520,11 +8649,11 @@ function getEnrichmentClient(options) {
|
|
|
8520
8649
|
var EnrichmentGetModule = {
|
|
8521
8650
|
command: "get <id>",
|
|
8522
8651
|
describe: "Fetch an enrichment category and its values",
|
|
8523
|
-
builder: (
|
|
8652
|
+
builder: (yargs41) => withFormatOptions(
|
|
8524
8653
|
withConfiguration(
|
|
8525
8654
|
withApiOptions(
|
|
8526
8655
|
withProjectOptions(
|
|
8527
|
-
|
|
8656
|
+
yargs41.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
8528
8657
|
)
|
|
8529
8658
|
)
|
|
8530
8659
|
)
|
|
@@ -8547,7 +8676,7 @@ var EnrichmentListModule = {
|
|
|
8547
8676
|
command: "list",
|
|
8548
8677
|
describe: "List enrichments",
|
|
8549
8678
|
aliases: ["ls"],
|
|
8550
|
-
builder: (
|
|
8679
|
+
builder: (yargs41) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs41)))),
|
|
8551
8680
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
8552
8681
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8553
8682
|
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8642,12 +8771,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
8642
8771
|
var EnrichmentPullModule = {
|
|
8643
8772
|
command: "pull <directory>",
|
|
8644
8773
|
describe: "Pulls all enrichments to local files in a directory",
|
|
8645
|
-
builder: (
|
|
8774
|
+
builder: (yargs41) => withConfiguration(
|
|
8646
8775
|
withDebugOptions(
|
|
8647
8776
|
withApiOptions(
|
|
8648
8777
|
withProjectOptions(
|
|
8649
8778
|
withDiffOptions(
|
|
8650
|
-
|
|
8779
|
+
yargs41.positional("directory", {
|
|
8651
8780
|
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.",
|
|
8652
8781
|
type: "string"
|
|
8653
8782
|
}).option("format", {
|
|
@@ -8722,11 +8851,11 @@ var EnrichmentPullModule = {
|
|
|
8722
8851
|
var EnrichmentPushModule = {
|
|
8723
8852
|
command: "push <directory>",
|
|
8724
8853
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
8725
|
-
builder: (
|
|
8854
|
+
builder: (yargs41) => withConfiguration(
|
|
8726
8855
|
withApiOptions(
|
|
8727
8856
|
withProjectOptions(
|
|
8728
8857
|
withDiffOptions(
|
|
8729
|
-
|
|
8858
|
+
yargs41.positional("directory", {
|
|
8730
8859
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
8731
8860
|
type: "string"
|
|
8732
8861
|
}).option("mode", {
|
|
@@ -8789,10 +8918,10 @@ var EnrichmentRemoveModule = {
|
|
|
8789
8918
|
command: "remove <id>",
|
|
8790
8919
|
aliases: ["delete", "rm"],
|
|
8791
8920
|
describe: "Delete an enrichment category and its values",
|
|
8792
|
-
builder: (
|
|
8921
|
+
builder: (yargs41) => withConfiguration(
|
|
8793
8922
|
withApiOptions(
|
|
8794
8923
|
withProjectOptions(
|
|
8795
|
-
|
|
8924
|
+
yargs41.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
8796
8925
|
)
|
|
8797
8926
|
)
|
|
8798
8927
|
),
|
|
@@ -8808,7 +8937,7 @@ var EnrichmentModule = {
|
|
|
8808
8937
|
command: "enrichment <command>",
|
|
8809
8938
|
aliases: ["enr"],
|
|
8810
8939
|
describe: "Commands for Context enrichments",
|
|
8811
|
-
builder: (
|
|
8940
|
+
builder: (yargs41) => yargs41.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
8812
8941
|
handler: () => {
|
|
8813
8942
|
yargs22.help();
|
|
8814
8943
|
}
|
|
@@ -8826,10 +8955,10 @@ var ManifestGetModule = {
|
|
|
8826
8955
|
command: "get [output]",
|
|
8827
8956
|
aliases: ["dl", "download"],
|
|
8828
8957
|
describe: "Download the Uniform Context manifest for a project",
|
|
8829
|
-
builder: (
|
|
8958
|
+
builder: (yargs41) => withConfiguration(
|
|
8830
8959
|
withApiOptions(
|
|
8831
8960
|
withProjectOptions(
|
|
8832
|
-
|
|
8961
|
+
yargs41.option("preview", {
|
|
8833
8962
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
8834
8963
|
default: false,
|
|
8835
8964
|
type: "boolean",
|
|
@@ -8891,7 +9020,7 @@ import { exit as exit2 } from "process";
|
|
|
8891
9020
|
var ManifestPublishModule = {
|
|
8892
9021
|
command: "publish",
|
|
8893
9022
|
describe: "Publish the Uniform Context manifest for a project",
|
|
8894
|
-
builder: (
|
|
9023
|
+
builder: (yargs41) => withConfiguration(withApiOptions(withProjectOptions(yargs41))),
|
|
8895
9024
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
8896
9025
|
const fetch2 = nodeFetchProxy(proxy);
|
|
8897
9026
|
try {
|
|
@@ -8924,7 +9053,7 @@ var ManifestModule = {
|
|
|
8924
9053
|
command: "manifest <command>",
|
|
8925
9054
|
describe: "Commands for context manifests",
|
|
8926
9055
|
aliases: ["man"],
|
|
8927
|
-
builder: (
|
|
9056
|
+
builder: (yargs41) => yargs41.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
8928
9057
|
handler: () => {
|
|
8929
9058
|
yargs23.help();
|
|
8930
9059
|
}
|
|
@@ -8938,11 +9067,11 @@ import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
|
8938
9067
|
var QuirkGetModule = {
|
|
8939
9068
|
command: "get <id>",
|
|
8940
9069
|
describe: "Fetch a quirk",
|
|
8941
|
-
builder: (
|
|
9070
|
+
builder: (yargs41) => withConfiguration(
|
|
8942
9071
|
withFormatOptions(
|
|
8943
9072
|
withApiOptions(
|
|
8944
9073
|
withProjectOptions(
|
|
8945
|
-
|
|
9074
|
+
yargs41.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
8946
9075
|
)
|
|
8947
9076
|
)
|
|
8948
9077
|
)
|
|
@@ -8966,11 +9095,11 @@ var QuirkListModule = {
|
|
|
8966
9095
|
command: "list",
|
|
8967
9096
|
describe: "List quirks",
|
|
8968
9097
|
aliases: ["ls"],
|
|
8969
|
-
builder: (
|
|
9098
|
+
builder: (yargs41) => withConfiguration(
|
|
8970
9099
|
withFormatOptions(
|
|
8971
9100
|
withApiOptions(
|
|
8972
9101
|
withProjectOptions(
|
|
8973
|
-
|
|
9102
|
+
yargs41.option("withIntegrations", {
|
|
8974
9103
|
alias: ["i"],
|
|
8975
9104
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
8976
9105
|
type: "boolean"
|
|
@@ -9028,12 +9157,12 @@ function createQuirkEngineDataSource({
|
|
|
9028
9157
|
var QuirkPullModule = {
|
|
9029
9158
|
command: "pull <directory>",
|
|
9030
9159
|
describe: "Pulls all quirks to local files in a directory",
|
|
9031
|
-
builder: (
|
|
9160
|
+
builder: (yargs41) => withConfiguration(
|
|
9032
9161
|
withDebugOptions(
|
|
9033
9162
|
withApiOptions(
|
|
9034
9163
|
withProjectOptions(
|
|
9035
9164
|
withDiffOptions(
|
|
9036
|
-
|
|
9165
|
+
yargs41.positional("directory", {
|
|
9037
9166
|
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.",
|
|
9038
9167
|
type: "string"
|
|
9039
9168
|
}).option("format", {
|
|
@@ -9109,12 +9238,12 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
9109
9238
|
var QuirkPushModule = {
|
|
9110
9239
|
command: "push <directory>",
|
|
9111
9240
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
9112
|
-
builder: (
|
|
9241
|
+
builder: (yargs41) => withConfiguration(
|
|
9113
9242
|
withDebugOptions(
|
|
9114
9243
|
withApiOptions(
|
|
9115
9244
|
withProjectOptions(
|
|
9116
9245
|
withDiffOptions(
|
|
9117
|
-
|
|
9246
|
+
yargs41.positional("directory", {
|
|
9118
9247
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
9119
9248
|
type: "string"
|
|
9120
9249
|
}).option("mode", {
|
|
@@ -9179,10 +9308,10 @@ var QuirkRemoveModule = {
|
|
|
9179
9308
|
command: "remove <id>",
|
|
9180
9309
|
aliases: ["delete", "rm"],
|
|
9181
9310
|
describe: "Delete a quirk",
|
|
9182
|
-
builder: (
|
|
9311
|
+
builder: (yargs41) => withConfiguration(
|
|
9183
9312
|
withApiOptions(
|
|
9184
9313
|
withProjectOptions(
|
|
9185
|
-
|
|
9314
|
+
yargs41.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
9186
9315
|
)
|
|
9187
9316
|
)
|
|
9188
9317
|
),
|
|
@@ -9199,10 +9328,10 @@ var QuirkUpdateModule = {
|
|
|
9199
9328
|
command: "update <filename>",
|
|
9200
9329
|
aliases: ["put"],
|
|
9201
9330
|
describe: "Insert or update a quirk",
|
|
9202
|
-
builder: (
|
|
9331
|
+
builder: (yargs41) => withConfiguration(
|
|
9203
9332
|
withApiOptions(
|
|
9204
9333
|
withProjectOptions(
|
|
9205
|
-
|
|
9334
|
+
yargs41.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
9206
9335
|
)
|
|
9207
9336
|
)
|
|
9208
9337
|
),
|
|
@@ -9219,7 +9348,7 @@ var QuirkModule = {
|
|
|
9219
9348
|
command: "quirk <command>",
|
|
9220
9349
|
aliases: ["qk"],
|
|
9221
9350
|
describe: "Commands for Context quirks",
|
|
9222
|
-
builder: (
|
|
9351
|
+
builder: (yargs41) => yargs41.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
9223
9352
|
handler: () => {
|
|
9224
9353
|
yargs24.help();
|
|
9225
9354
|
}
|
|
@@ -9233,11 +9362,11 @@ import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
|
9233
9362
|
var SignalGetModule = {
|
|
9234
9363
|
command: "get <id>",
|
|
9235
9364
|
describe: "Fetch a signal",
|
|
9236
|
-
builder: (
|
|
9365
|
+
builder: (yargs41) => withConfiguration(
|
|
9237
9366
|
withFormatOptions(
|
|
9238
9367
|
withApiOptions(
|
|
9239
9368
|
withProjectOptions(
|
|
9240
|
-
|
|
9369
|
+
yargs41.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
9241
9370
|
)
|
|
9242
9371
|
)
|
|
9243
9372
|
)
|
|
@@ -9261,7 +9390,7 @@ var SignalListModule = {
|
|
|
9261
9390
|
command: "list",
|
|
9262
9391
|
describe: "List signals",
|
|
9263
9392
|
aliases: ["ls"],
|
|
9264
|
-
builder: (
|
|
9393
|
+
builder: (yargs41) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs41)))),
|
|
9265
9394
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9266
9395
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9267
9396
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9311,12 +9440,12 @@ function createSignalEngineDataSource({
|
|
|
9311
9440
|
var SignalPullModule = {
|
|
9312
9441
|
command: "pull <directory>",
|
|
9313
9442
|
describe: "Pulls all signals to local files in a directory",
|
|
9314
|
-
builder: (
|
|
9443
|
+
builder: (yargs41) => withConfiguration(
|
|
9315
9444
|
withDebugOptions(
|
|
9316
9445
|
withApiOptions(
|
|
9317
9446
|
withProjectOptions(
|
|
9318
9447
|
withDiffOptions(
|
|
9319
|
-
|
|
9448
|
+
yargs41.positional("directory", {
|
|
9320
9449
|
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.",
|
|
9321
9450
|
type: "string"
|
|
9322
9451
|
}).option("format", {
|
|
@@ -9392,12 +9521,12 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
9392
9521
|
var SignalPushModule = {
|
|
9393
9522
|
command: "push <directory>",
|
|
9394
9523
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
9395
|
-
builder: (
|
|
9524
|
+
builder: (yargs41) => withConfiguration(
|
|
9396
9525
|
withDebugOptions(
|
|
9397
9526
|
withApiOptions(
|
|
9398
9527
|
withProjectOptions(
|
|
9399
9528
|
withDiffOptions(
|
|
9400
|
-
|
|
9529
|
+
yargs41.positional("directory", {
|
|
9401
9530
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
9402
9531
|
type: "string"
|
|
9403
9532
|
}).option("mode", {
|
|
@@ -9462,10 +9591,10 @@ var SignalRemoveModule = {
|
|
|
9462
9591
|
command: "remove <id>",
|
|
9463
9592
|
aliases: ["delete", "rm"],
|
|
9464
9593
|
describe: "Delete a signal",
|
|
9465
|
-
builder: (
|
|
9594
|
+
builder: (yargs41) => withConfiguration(
|
|
9466
9595
|
withApiOptions(
|
|
9467
9596
|
withProjectOptions(
|
|
9468
|
-
|
|
9597
|
+
yargs41.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
9469
9598
|
)
|
|
9470
9599
|
)
|
|
9471
9600
|
),
|
|
@@ -9482,10 +9611,10 @@ var SignalUpdateModule = {
|
|
|
9482
9611
|
command: "update <filename>",
|
|
9483
9612
|
aliases: ["put"],
|
|
9484
9613
|
describe: "Insert or update a signal",
|
|
9485
|
-
builder: (
|
|
9614
|
+
builder: (yargs41) => withConfiguration(
|
|
9486
9615
|
withApiOptions(
|
|
9487
9616
|
withProjectOptions(
|
|
9488
|
-
|
|
9617
|
+
yargs41.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
9489
9618
|
)
|
|
9490
9619
|
)
|
|
9491
9620
|
),
|
|
@@ -9502,7 +9631,7 @@ var SignalModule = {
|
|
|
9502
9631
|
command: "signal <command>",
|
|
9503
9632
|
aliases: ["sig"],
|
|
9504
9633
|
describe: "Commands for Context signals",
|
|
9505
|
-
builder: (
|
|
9634
|
+
builder: (yargs41) => yargs41.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
9506
9635
|
handler: () => {
|
|
9507
9636
|
yargs25.help();
|
|
9508
9637
|
}
|
|
@@ -9516,11 +9645,11 @@ import { UncachedTestClient } from "@uniformdev/context/api";
|
|
|
9516
9645
|
var TestGetModule = {
|
|
9517
9646
|
command: "get <id>",
|
|
9518
9647
|
describe: "Fetch a test",
|
|
9519
|
-
builder: (
|
|
9648
|
+
builder: (yargs41) => withConfiguration(
|
|
9520
9649
|
withFormatOptions(
|
|
9521
9650
|
withApiOptions(
|
|
9522
9651
|
withProjectOptions(
|
|
9523
|
-
|
|
9652
|
+
yargs41.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
9524
9653
|
)
|
|
9525
9654
|
)
|
|
9526
9655
|
)
|
|
@@ -9544,7 +9673,7 @@ var TestListModule = {
|
|
|
9544
9673
|
command: "list",
|
|
9545
9674
|
describe: "List tests",
|
|
9546
9675
|
aliases: ["ls"],
|
|
9547
|
-
builder: (
|
|
9676
|
+
builder: (yargs41) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs41)))),
|
|
9548
9677
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9549
9678
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9550
9679
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9594,12 +9723,12 @@ function createTestEngineDataSource({
|
|
|
9594
9723
|
var TestPullModule = {
|
|
9595
9724
|
command: "pull <directory>",
|
|
9596
9725
|
describe: "Pulls all tests to local files in a directory",
|
|
9597
|
-
builder: (
|
|
9726
|
+
builder: (yargs41) => withConfiguration(
|
|
9598
9727
|
withDebugOptions(
|
|
9599
9728
|
withApiOptions(
|
|
9600
9729
|
withProjectOptions(
|
|
9601
9730
|
withDiffOptions(
|
|
9602
|
-
|
|
9731
|
+
yargs41.positional("directory", {
|
|
9603
9732
|
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.",
|
|
9604
9733
|
type: "string"
|
|
9605
9734
|
}).option("format", {
|
|
@@ -9675,12 +9804,12 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
9675
9804
|
var TestPushModule = {
|
|
9676
9805
|
command: "push <directory>",
|
|
9677
9806
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
9678
|
-
builder: (
|
|
9807
|
+
builder: (yargs41) => withConfiguration(
|
|
9679
9808
|
withDebugOptions(
|
|
9680
9809
|
withApiOptions(
|
|
9681
9810
|
withProjectOptions(
|
|
9682
9811
|
withDiffOptions(
|
|
9683
|
-
|
|
9812
|
+
yargs41.positional("directory", {
|
|
9684
9813
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
9685
9814
|
type: "string"
|
|
9686
9815
|
}).option("mode", {
|
|
@@ -9745,10 +9874,10 @@ var TestRemoveModule = {
|
|
|
9745
9874
|
command: "remove <id>",
|
|
9746
9875
|
aliases: ["delete", "rm"],
|
|
9747
9876
|
describe: "Delete a test",
|
|
9748
|
-
builder: (
|
|
9877
|
+
builder: (yargs41) => withConfiguration(
|
|
9749
9878
|
withApiOptions(
|
|
9750
9879
|
withProjectOptions(
|
|
9751
|
-
|
|
9880
|
+
yargs41.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
9752
9881
|
)
|
|
9753
9882
|
)
|
|
9754
9883
|
),
|
|
@@ -9765,9 +9894,9 @@ var TestUpdateModule = {
|
|
|
9765
9894
|
command: "update <filename>",
|
|
9766
9895
|
aliases: ["put"],
|
|
9767
9896
|
describe: "Insert or update a test",
|
|
9768
|
-
builder: (
|
|
9897
|
+
builder: (yargs41) => withConfiguration(
|
|
9769
9898
|
withApiOptions(
|
|
9770
|
-
withProjectOptions(
|
|
9899
|
+
withProjectOptions(yargs41.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
9771
9900
|
)
|
|
9772
9901
|
),
|
|
9773
9902
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -9782,7 +9911,7 @@ var TestUpdateModule = {
|
|
|
9782
9911
|
var TestModule = {
|
|
9783
9912
|
command: "test <command>",
|
|
9784
9913
|
describe: "Commands for Context A/B tests",
|
|
9785
|
-
builder: (
|
|
9914
|
+
builder: (yargs41) => yargs41.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
9786
9915
|
handler: () => {
|
|
9787
9916
|
yargs26.help();
|
|
9788
9917
|
}
|
|
@@ -9793,24 +9922,57 @@ var ContextCommand = {
|
|
|
9793
9922
|
command: "context <command>",
|
|
9794
9923
|
aliases: ["ctx"],
|
|
9795
9924
|
describe: "Uniform Context commands",
|
|
9796
|
-
builder: (
|
|
9925
|
+
builder: (yargs41) => yargs41.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
9797
9926
|
handler: () => {
|
|
9798
9927
|
yargs27.showHelp();
|
|
9799
9928
|
}
|
|
9800
9929
|
};
|
|
9801
9930
|
|
|
9802
9931
|
// src/commands/integration/index.ts
|
|
9803
|
-
import
|
|
9932
|
+
import yargs32 from "yargs";
|
|
9804
9933
|
|
|
9805
9934
|
// src/commands/integration/commands/definition.ts
|
|
9806
|
-
import
|
|
9935
|
+
import yargs31 from "yargs";
|
|
9807
9936
|
|
|
9808
|
-
// src/commands/integration/commands/definition/
|
|
9937
|
+
// src/commands/integration/commands/definition/dataResourceEditor/dataResourceEditor.ts
|
|
9809
9938
|
import yargs28 from "yargs";
|
|
9810
9939
|
|
|
9811
|
-
// src/commands/integration/commands/definition/
|
|
9940
|
+
// src/commands/integration/commands/definition/dataResourceEditor/deploy.ts
|
|
9812
9941
|
import { readFileSync as readFileSync2 } from "fs";
|
|
9813
9942
|
|
|
9943
|
+
// src/commands/integration/commands/definition/bundleWorkerCode.ts
|
|
9944
|
+
import esbuild from "esbuild";
|
|
9945
|
+
import path5 from "path";
|
|
9946
|
+
async function bundleWorkerCode(entryFile) {
|
|
9947
|
+
const result = await esbuild.build({
|
|
9948
|
+
entryPoints: [entryFile],
|
|
9949
|
+
bundle: true,
|
|
9950
|
+
// Don't write to disk, build to memory
|
|
9951
|
+
write: false,
|
|
9952
|
+
format: "esm",
|
|
9953
|
+
target: "es2021",
|
|
9954
|
+
platform: "browser",
|
|
9955
|
+
minify: true,
|
|
9956
|
+
// Force inlining of all dependencies
|
|
9957
|
+
external: [],
|
|
9958
|
+
// Ensure single file output
|
|
9959
|
+
splitting: false,
|
|
9960
|
+
sourcemap: false
|
|
9961
|
+
});
|
|
9962
|
+
const outputFiles = result.outputFiles;
|
|
9963
|
+
if (!outputFiles || outputFiles.length === 0) {
|
|
9964
|
+
throw new Error(`No output generated for ${entryFile}`);
|
|
9965
|
+
}
|
|
9966
|
+
const outputFile = outputFiles[0];
|
|
9967
|
+
const builtCode = outputFile.text;
|
|
9968
|
+
console.log(
|
|
9969
|
+
`\u2139\uFE0F ${path5.basename(entryFile)} was prepared with esbuild. Size: ${Math.round(
|
|
9970
|
+
builtCode.length / 1024
|
|
9971
|
+
)}kb (use --skipBundle to disable)`
|
|
9972
|
+
);
|
|
9973
|
+
return builtCode;
|
|
9974
|
+
}
|
|
9975
|
+
|
|
9814
9976
|
// src/commands/integration/commands/definition/edgehancer/EdgehancerClient.ts
|
|
9815
9977
|
import { createLimitPolicy as createLimitPolicy2 } from "@uniformdev/canvas";
|
|
9816
9978
|
import { ApiClient } from "@uniformdev/context/api";
|
|
@@ -9843,9 +10005,102 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
9843
10005
|
}
|
|
9844
10006
|
};
|
|
9845
10007
|
|
|
10008
|
+
// src/commands/integration/commands/definition/dataResourceEditor/util.ts
|
|
10009
|
+
function withDataResourceEditorIdOptions(yargs41) {
|
|
10010
|
+
return yargs41.option("connectorType", {
|
|
10011
|
+
describe: "Integration data connector type to attach the data resource editor to, as defined in the integration manifest file.",
|
|
10012
|
+
demandOption: true,
|
|
10013
|
+
type: "string"
|
|
10014
|
+
}).option("archetype", {
|
|
10015
|
+
describe: "Data connector archetype to attach the data resource editor to. Must be defined within the connectorType.",
|
|
10016
|
+
demandOption: true,
|
|
10017
|
+
type: "string"
|
|
10018
|
+
}).option("hook", {
|
|
10019
|
+
describe: "Data resource editor hook to deploy to.",
|
|
10020
|
+
demandOption: true,
|
|
10021
|
+
choices: ["createAIDataResourceEdit", "afterAIDataResourceEdit"],
|
|
10022
|
+
type: "string"
|
|
10023
|
+
});
|
|
10024
|
+
}
|
|
10025
|
+
|
|
10026
|
+
// src/commands/integration/commands/definition/dataResourceEditor/deploy.ts
|
|
10027
|
+
var IntegrationDataResourceEditorDeployModule = {
|
|
10028
|
+
command: "deploy <filename>",
|
|
10029
|
+
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.",
|
|
10030
|
+
builder: (yargs41) => withConfiguration(
|
|
10031
|
+
withApiOptions(
|
|
10032
|
+
withTeamOptions(
|
|
10033
|
+
withDataResourceEditorIdOptions(
|
|
10034
|
+
yargs41.positional("filename", {
|
|
10035
|
+
demandOption: true,
|
|
10036
|
+
describe: "ESM code file to run for the target data resource editor hook. Refer to the documentation for expected types."
|
|
10037
|
+
}).option("compatibilityDate", {
|
|
10038
|
+
type: "string",
|
|
10039
|
+
describe: "Date indicating targeted support in the custom data resource editor runtime. Backwards incompatible fixes to the runtime following this date will not affect this custom data resource editor. Format: YYYY-MM-DD. You can check here for more information: https://developers.cloudflare.com/workers/configuration/compatibility-dates/#setting-compatibility-date"
|
|
10040
|
+
}).option("skipBundle", {
|
|
10041
|
+
type: "boolean",
|
|
10042
|
+
default: false,
|
|
10043
|
+
describe: "Skip bundling and transpilation of the input file"
|
|
10044
|
+
})
|
|
10045
|
+
)
|
|
10046
|
+
)
|
|
10047
|
+
)
|
|
10048
|
+
),
|
|
10049
|
+
handler: async ({
|
|
10050
|
+
apiHost,
|
|
10051
|
+
apiKey,
|
|
10052
|
+
proxy,
|
|
10053
|
+
filename,
|
|
10054
|
+
team: teamId,
|
|
10055
|
+
archetype,
|
|
10056
|
+
connectorType,
|
|
10057
|
+
hook,
|
|
10058
|
+
compatibilityDate,
|
|
10059
|
+
skipBundle = false
|
|
10060
|
+
}) => {
|
|
10061
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10062
|
+
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
10063
|
+
let code;
|
|
10064
|
+
if (skipBundle) {
|
|
10065
|
+
code = readFileSync2(filename, "utf8");
|
|
10066
|
+
} else {
|
|
10067
|
+
code = await bundleWorkerCode(filename);
|
|
10068
|
+
}
|
|
10069
|
+
await client.deploy({ archetype, code, connectorType, hook, compatibilityDate });
|
|
10070
|
+
}
|
|
10071
|
+
};
|
|
10072
|
+
|
|
10073
|
+
// src/commands/integration/commands/definition/dataResourceEditor/remove.ts
|
|
10074
|
+
var IntegrationDataResourceEditorRemoveModule = {
|
|
10075
|
+
command: "remove",
|
|
10076
|
+
describe: "Removes a custom AI data resource editor hook from a data resource archetype. The API key used must have team admin permissions.",
|
|
10077
|
+
builder: (yargs41) => withConfiguration(withApiOptions(withTeamOptions(withDataResourceEditorIdOptions(yargs41)))),
|
|
10078
|
+
handler: async ({ apiHost, apiKey, proxy, team: teamId, connectorType, archetype, hook }) => {
|
|
10079
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10080
|
+
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
10081
|
+
await client.remove({ connectorType, archetype, hook });
|
|
10082
|
+
}
|
|
10083
|
+
};
|
|
10084
|
+
|
|
10085
|
+
// src/commands/integration/commands/definition/dataResourceEditor/dataResourceEditor.ts
|
|
10086
|
+
var IntegrationDataResourceEditorModule = {
|
|
10087
|
+
command: "dataResourceEditor <command>",
|
|
10088
|
+
describe: "Commands for managing custom AI data resource editors at the team level.",
|
|
10089
|
+
builder: (yargs41) => yargs41.command(IntegrationDataResourceEditorDeployModule).command(IntegrationDataResourceEditorRemoveModule).demandCommand(),
|
|
10090
|
+
handler: () => {
|
|
10091
|
+
yargs28.help();
|
|
10092
|
+
}
|
|
10093
|
+
};
|
|
10094
|
+
|
|
10095
|
+
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
10096
|
+
import yargs29 from "yargs";
|
|
10097
|
+
|
|
10098
|
+
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
10099
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
10100
|
+
|
|
9846
10101
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
9847
|
-
function withEdgehancerIdOptions(
|
|
9848
|
-
return
|
|
10102
|
+
function withEdgehancerIdOptions(yargs41) {
|
|
10103
|
+
return yargs41.option("connectorType", {
|
|
9849
10104
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
9850
10105
|
demandOption: true,
|
|
9851
10106
|
type: "string"
|
|
@@ -9865,16 +10120,20 @@ function withEdgehancerIdOptions(yargs39) {
|
|
|
9865
10120
|
var IntegrationEdgehancerDeployModule = {
|
|
9866
10121
|
command: "deploy <filename>",
|
|
9867
10122
|
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.",
|
|
9868
|
-
builder: (
|
|
10123
|
+
builder: (yargs41) => withConfiguration(
|
|
9869
10124
|
withApiOptions(
|
|
9870
10125
|
withTeamOptions(
|
|
9871
10126
|
withEdgehancerIdOptions(
|
|
9872
|
-
|
|
10127
|
+
yargs41.positional("filename", {
|
|
9873
10128
|
demandOption: true,
|
|
9874
10129
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
9875
10130
|
}).option("compatibilityDate", {
|
|
9876
10131
|
type: "string",
|
|
9877
10132
|
describe: "Date indicating targeted support in the custom edgehancer runtime. Backwards incompatible fixes to the runtime following this date will not affect this custom edgehancer. Format: YYYY-MM-DD. You can check here for more information: https://developers.cloudflare.com/workers/configuration/compatibility-dates/#setting-compatibility-date"
|
|
10133
|
+
}).option("skipBundle", {
|
|
10134
|
+
type: "boolean",
|
|
10135
|
+
default: false,
|
|
10136
|
+
describe: "Skip bundling and transpilation of the input file"
|
|
9878
10137
|
})
|
|
9879
10138
|
)
|
|
9880
10139
|
)
|
|
@@ -9889,11 +10148,17 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
9889
10148
|
archetype,
|
|
9890
10149
|
connectorType,
|
|
9891
10150
|
hook,
|
|
9892
|
-
compatibilityDate
|
|
10151
|
+
compatibilityDate,
|
|
10152
|
+
skipBundle = false
|
|
9893
10153
|
}) => {
|
|
9894
10154
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9895
10155
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
9896
|
-
|
|
10156
|
+
let code;
|
|
10157
|
+
if (skipBundle) {
|
|
10158
|
+
code = readFileSync3(filename, "utf8");
|
|
10159
|
+
} else {
|
|
10160
|
+
code = await bundleWorkerCode(filename);
|
|
10161
|
+
}
|
|
9897
10162
|
await client.deploy({ archetype, code, connectorType, hook, compatibilityDate });
|
|
9898
10163
|
}
|
|
9899
10164
|
};
|
|
@@ -9902,7 +10167,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
9902
10167
|
var IntegrationEdgehancerRemoveModule = {
|
|
9903
10168
|
command: "remove",
|
|
9904
10169
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
9905
|
-
builder: (
|
|
10170
|
+
builder: (yargs41) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs41)))),
|
|
9906
10171
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
9907
10172
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9908
10173
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -9914,9 +10179,99 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
9914
10179
|
var IntegrationEdgehancerModule = {
|
|
9915
10180
|
command: "edgehancer <command>",
|
|
9916
10181
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
9917
|
-
builder: (
|
|
10182
|
+
builder: (yargs41) => yargs41.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
9918
10183
|
handler: () => {
|
|
9919
|
-
|
|
10184
|
+
yargs29.help();
|
|
10185
|
+
}
|
|
10186
|
+
};
|
|
10187
|
+
|
|
10188
|
+
// src/commands/integration/commands/definition/propertyEditor/propertyEditor.ts
|
|
10189
|
+
import yargs30 from "yargs";
|
|
10190
|
+
|
|
10191
|
+
// src/commands/integration/commands/definition/propertyEditor/deploy.ts
|
|
10192
|
+
import { IntegrationPropertyEditorsClient } from "@uniformdev/canvas";
|
|
10193
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
10194
|
+
|
|
10195
|
+
// src/commands/integration/commands/definition/propertyEditor/util.ts
|
|
10196
|
+
function withPropertyEditorIdOptions(yargs41) {
|
|
10197
|
+
return yargs41.option("propertyType", {
|
|
10198
|
+
describe: "Property type to attach the editor to.",
|
|
10199
|
+
demandOption: true,
|
|
10200
|
+
type: "string"
|
|
10201
|
+
}).option("hook", {
|
|
10202
|
+
describe: "Property editor hook to deploy to.",
|
|
10203
|
+
demandOption: true,
|
|
10204
|
+
choices: ["createAIEdit", "afterAIEdit"],
|
|
10205
|
+
type: "string"
|
|
10206
|
+
});
|
|
10207
|
+
}
|
|
10208
|
+
|
|
10209
|
+
// src/commands/integration/commands/definition/propertyEditor/deploy.ts
|
|
10210
|
+
var IntegrationPropertyEditorDeployModule = {
|
|
10211
|
+
command: "deploy <filename>",
|
|
10212
|
+
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.",
|
|
10213
|
+
builder: (yargs41) => withConfiguration(
|
|
10214
|
+
withApiOptions(
|
|
10215
|
+
withTeamOptions(
|
|
10216
|
+
withPropertyEditorIdOptions(
|
|
10217
|
+
yargs41.positional("filename", {
|
|
10218
|
+
demandOption: true,
|
|
10219
|
+
describe: "ESM code file to run for the target property editor hook. Refer to the documentation for expected types."
|
|
10220
|
+
}).option("compatibilityDate", {
|
|
10221
|
+
type: "string",
|
|
10222
|
+
describe: "Date indicating targeted support in the custom property editor runtime. Backwards incompatible fixes to the runtime following this date will not affect this custom property editor. Format: YYYY-MM-DD. You can check here for more information: https://developers.cloudflare.com/workers/configuration/compatibility-dates/#setting-compatibility-date"
|
|
10223
|
+
}).option("skipBundle", {
|
|
10224
|
+
type: "boolean",
|
|
10225
|
+
default: false,
|
|
10226
|
+
describe: "Skip bundling and transpilation of the input file"
|
|
10227
|
+
})
|
|
10228
|
+
)
|
|
10229
|
+
)
|
|
10230
|
+
)
|
|
10231
|
+
),
|
|
10232
|
+
handler: async ({
|
|
10233
|
+
apiHost,
|
|
10234
|
+
apiKey,
|
|
10235
|
+
proxy,
|
|
10236
|
+
filename,
|
|
10237
|
+
team: teamId,
|
|
10238
|
+
propertyType,
|
|
10239
|
+
hook,
|
|
10240
|
+
compatibilityDate,
|
|
10241
|
+
skipBundle = false
|
|
10242
|
+
}) => {
|
|
10243
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10244
|
+
const client = new IntegrationPropertyEditorsClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
10245
|
+
let code;
|
|
10246
|
+
if (skipBundle) {
|
|
10247
|
+
code = readFileSync4(filename, "utf8");
|
|
10248
|
+
} else {
|
|
10249
|
+
code = await bundleWorkerCode(filename);
|
|
10250
|
+
}
|
|
10251
|
+
await client.deploy({ propertyType, code, hook, compatibilityDate });
|
|
10252
|
+
}
|
|
10253
|
+
};
|
|
10254
|
+
|
|
10255
|
+
// src/commands/integration/commands/definition/propertyEditor/remove.ts
|
|
10256
|
+
import { IntegrationPropertyEditorsClient as IntegrationPropertyEditorsClient2 } from "@uniformdev/canvas";
|
|
10257
|
+
var IntegrationPropertyEditorRemoveModule = {
|
|
10258
|
+
command: "remove",
|
|
10259
|
+
describe: "Deletes a custom AI property editor hook from a property type. The API key used must have team admin permissions.",
|
|
10260
|
+
builder: (yargs41) => withConfiguration(withApiOptions(withTeamOptions(withPropertyEditorIdOptions(yargs41)))),
|
|
10261
|
+
handler: async ({ apiHost, apiKey, proxy, team: teamId, propertyType, hook }) => {
|
|
10262
|
+
const fetch2 = nodeFetchProxy(proxy);
|
|
10263
|
+
const client = new IntegrationPropertyEditorsClient2({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
10264
|
+
await client.delete({ propertyType, hook });
|
|
10265
|
+
}
|
|
10266
|
+
};
|
|
10267
|
+
|
|
10268
|
+
// src/commands/integration/commands/definition/propertyEditor/propertyEditor.ts
|
|
10269
|
+
var IntegrationPropertyEditorModule = {
|
|
10270
|
+
command: "propertyEditor <command>",
|
|
10271
|
+
describe: "Commands for managing custom AI property editors at the team level.",
|
|
10272
|
+
builder: (yargs41) => yargs41.command(IntegrationPropertyEditorDeployModule).command(IntegrationPropertyEditorRemoveModule).demandCommand(),
|
|
10273
|
+
handler: () => {
|
|
10274
|
+
yargs30.help();
|
|
9920
10275
|
}
|
|
9921
10276
|
};
|
|
9922
10277
|
|
|
@@ -9956,10 +10311,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
9956
10311
|
var IntegrationDefinitionRegisterModule = {
|
|
9957
10312
|
command: "register <filename>",
|
|
9958
10313
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
9959
|
-
builder: (
|
|
10314
|
+
builder: (yargs41) => withConfiguration(
|
|
9960
10315
|
withApiOptions(
|
|
9961
10316
|
withTeamOptions(
|
|
9962
|
-
|
|
10317
|
+
yargs41.positional("filename", {
|
|
9963
10318
|
demandOption: true,
|
|
9964
10319
|
describe: "Integration definition manifest to register"
|
|
9965
10320
|
})
|
|
@@ -9978,10 +10333,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
9978
10333
|
var IntegrationDefinitionRemoveModule = {
|
|
9979
10334
|
command: "remove <type>",
|
|
9980
10335
|
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.",
|
|
9981
|
-
builder: (
|
|
10336
|
+
builder: (yargs41) => withConfiguration(
|
|
9982
10337
|
withApiOptions(
|
|
9983
10338
|
withTeamOptions(
|
|
9984
|
-
|
|
10339
|
+
yargs41.positional("type", {
|
|
9985
10340
|
demandOption: true,
|
|
9986
10341
|
describe: "Integration type (from its manifest) to remove."
|
|
9987
10342
|
})
|
|
@@ -9999,9 +10354,9 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
9999
10354
|
var IntegrationDefinitionModule = {
|
|
10000
10355
|
command: "definition <command>",
|
|
10001
10356
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
10002
|
-
builder: (
|
|
10357
|
+
builder: (yargs41) => yargs41.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).command(IntegrationDataResourceEditorModule).command(IntegrationPropertyEditorModule).demandCommand(),
|
|
10003
10358
|
handler: () => {
|
|
10004
|
-
|
|
10359
|
+
yargs31.help();
|
|
10005
10360
|
}
|
|
10006
10361
|
};
|
|
10007
10362
|
|
|
@@ -10041,10 +10396,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
10041
10396
|
var IntegrationInstallModule = {
|
|
10042
10397
|
command: "install <type>",
|
|
10043
10398
|
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.",
|
|
10044
|
-
builder: (
|
|
10399
|
+
builder: (yargs41) => withConfiguration(
|
|
10045
10400
|
withApiOptions(
|
|
10046
10401
|
withProjectOptions(
|
|
10047
|
-
|
|
10402
|
+
yargs41.positional("type", {
|
|
10048
10403
|
demandOption: true,
|
|
10049
10404
|
describe: "Integration type to install (as defined in its manifest)"
|
|
10050
10405
|
}).option("configuration", {
|
|
@@ -10066,10 +10421,10 @@ var IntegrationInstallModule = {
|
|
|
10066
10421
|
var IntegrationUninstallModule = {
|
|
10067
10422
|
command: "uninstall <type>",
|
|
10068
10423
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
10069
|
-
builder: (
|
|
10424
|
+
builder: (yargs41) => withConfiguration(
|
|
10070
10425
|
withApiOptions(
|
|
10071
10426
|
withProjectOptions(
|
|
10072
|
-
|
|
10427
|
+
yargs41.positional("type", {
|
|
10073
10428
|
demandOption: true,
|
|
10074
10429
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
10075
10430
|
})
|
|
@@ -10087,14 +10442,14 @@ var IntegrationUninstallModule = {
|
|
|
10087
10442
|
var IntegrationCommand = {
|
|
10088
10443
|
command: "integration <command>",
|
|
10089
10444
|
describe: "Integration management commands",
|
|
10090
|
-
builder: (
|
|
10445
|
+
builder: (yargs41) => yargs41.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
10091
10446
|
handler: () => {
|
|
10092
|
-
|
|
10447
|
+
yargs32.showHelp();
|
|
10093
10448
|
}
|
|
10094
10449
|
};
|
|
10095
10450
|
|
|
10096
10451
|
// src/commands/new/commands/new.ts
|
|
10097
|
-
import
|
|
10452
|
+
import { select as select6 } from "@inquirer/prompts";
|
|
10098
10453
|
|
|
10099
10454
|
// src/npm.ts
|
|
10100
10455
|
import execa from "execa";
|
|
@@ -10123,7 +10478,7 @@ import fsj5 from "fs-jetpack";
|
|
|
10123
10478
|
import * as git from "isomorphic-git";
|
|
10124
10479
|
import * as http from "isomorphic-git/http/node";
|
|
10125
10480
|
import os from "os";
|
|
10126
|
-
import
|
|
10481
|
+
import path6 from "path";
|
|
10127
10482
|
async function cloneStarter({
|
|
10128
10483
|
spin,
|
|
10129
10484
|
githubPath,
|
|
@@ -10132,7 +10487,7 @@ async function cloneStarter({
|
|
|
10132
10487
|
githubBranch
|
|
10133
10488
|
}) {
|
|
10134
10489
|
const done = await spin("Fetching starter code...");
|
|
10135
|
-
const cloneDir =
|
|
10490
|
+
const cloneDir = path6.join(os.tmpdir(), `uniform-new-${crypto2.randomBytes(20).toString("hex")}`);
|
|
10136
10491
|
const [user, repo, ...pathSegments] = githubPath.split("/");
|
|
10137
10492
|
try {
|
|
10138
10493
|
await git.clone({
|
|
@@ -10151,10 +10506,10 @@ async function cloneStarter({
|
|
|
10151
10506
|
if (fs7.existsSync(targetDir) && fs7.readdirSync(targetDir).length > 0) {
|
|
10152
10507
|
throw new Error(`"${targetDir}" is not empty`);
|
|
10153
10508
|
}
|
|
10154
|
-
const starterDir =
|
|
10509
|
+
const starterDir = path6.join(cloneDir, ...pathSegments);
|
|
10155
10510
|
fsj5.copy(starterDir, targetDir, { overwrite: true });
|
|
10156
10511
|
if (dotEnvFile) {
|
|
10157
|
-
fs7.writeFileSync(
|
|
10512
|
+
fs7.writeFileSync(path6.resolve(targetDir, ".env"), dotEnvFile, "utf-8");
|
|
10158
10513
|
}
|
|
10159
10514
|
console.log(`
|
|
10160
10515
|
Your project now lives in ${targetDir} \u2728`);
|
|
@@ -10174,12 +10529,10 @@ async function newHandler({
|
|
|
10174
10529
|
spin,
|
|
10175
10530
|
projectName,
|
|
10176
10531
|
apiHost,
|
|
10532
|
+
edgeApiHost,
|
|
10177
10533
|
outputPath,
|
|
10178
10534
|
telemetry
|
|
10179
10535
|
}) {
|
|
10180
|
-
console.info(
|
|
10181
|
-
`Welcome to Uniform New! Let's create ${projectName ? `"${projectName}"` : "a new project"}... \u2764\uFE0F`
|
|
10182
|
-
);
|
|
10183
10536
|
const auth = await getBearerToken(apiHost);
|
|
10184
10537
|
const { authToken } = auth;
|
|
10185
10538
|
const uniformClient = createClient(apiHost, authToken);
|
|
@@ -10189,23 +10542,19 @@ async function newHandler({
|
|
|
10189
10542
|
`Hey ${user.name}! Choose a Uniform team for your new project`,
|
|
10190
10543
|
telemetry
|
|
10191
10544
|
);
|
|
10192
|
-
const
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
}
|
|
10206
|
-
]
|
|
10207
|
-
}
|
|
10208
|
-
]);
|
|
10545
|
+
const frontendFramework = await select6({
|
|
10546
|
+
message: "Choose your preferred framework",
|
|
10547
|
+
choices: [
|
|
10548
|
+
{
|
|
10549
|
+
name: "Next.JS",
|
|
10550
|
+
value: "next"
|
|
10551
|
+
},
|
|
10552
|
+
{
|
|
10553
|
+
name: "Nuxt.JS",
|
|
10554
|
+
value: "nuxt"
|
|
10555
|
+
}
|
|
10556
|
+
]
|
|
10557
|
+
});
|
|
10209
10558
|
telemetry.send("framework picked", { frontendFramework });
|
|
10210
10559
|
const starters = {
|
|
10211
10560
|
next: {
|
|
@@ -10241,16 +10590,11 @@ async function newHandler({
|
|
|
10241
10590
|
}
|
|
10242
10591
|
};
|
|
10243
10592
|
let githubBranch = void 0;
|
|
10244
|
-
const {
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
name: "starter",
|
|
10250
|
-
message: `Choose one of the Uniform starters (for ${frontendFramework === "next" ? "Next.JS" : "Nuxt.JS"})`,
|
|
10251
|
-
choices: Object.values(starters[frontendFramework])
|
|
10252
|
-
}
|
|
10253
|
-
]);
|
|
10593
|
+
const starter = await select6({
|
|
10594
|
+
message: `Choose one of the Uniform starters (for ${frontendFramework === "next" ? "Next.JS" : "Nuxt.JS"})`,
|
|
10595
|
+
choices: Object.values(starters[frontendFramework])
|
|
10596
|
+
});
|
|
10597
|
+
const { githubUri, serverUrl, previewPath, installEnv } = starter;
|
|
10254
10598
|
if (process.env.UNIFORM_ALTERNATIVE_STARTER_BRANCH) {
|
|
10255
10599
|
console.log(
|
|
10256
10600
|
`Using alternative starter branch for repo ${githubUri}: "${process.env.UNIFORM_ALTERNATIVE_STARTER_BRANCH}"`
|
|
@@ -10280,10 +10624,12 @@ async function newHandler({
|
|
|
10280
10624
|
["UNIFORM_CLI_API_KEY", writeApiKey],
|
|
10281
10625
|
...installEnv
|
|
10282
10626
|
].concat(
|
|
10283
|
-
apiHost !==
|
|
10627
|
+
apiHost !== ENVIRONMENT_HOSTS.usa.api ? [
|
|
10284
10628
|
["UNIFORM_CLI_BASE_URL", apiHost],
|
|
10285
10629
|
["UNIFORM_API_HOST", apiHost]
|
|
10286
10630
|
] : []
|
|
10631
|
+
).concat(
|
|
10632
|
+
edgeApiHost !== ENVIRONMENT_HOSTS.usa.global ? [["UNIFORM_CLI_BASE_EDGE_URL", edgeApiHost]] : []
|
|
10287
10633
|
).map(([name, value]) => `${name}='${value}'`).join("\n") + "\n";
|
|
10288
10634
|
await done();
|
|
10289
10635
|
const cloneStartTimestamp = Date.now();
|
|
@@ -10328,9 +10674,9 @@ npm run dev
|
|
|
10328
10674
|
}
|
|
10329
10675
|
|
|
10330
10676
|
// src/commands/new/commands/new-mesh-integration.ts
|
|
10331
|
-
import {
|
|
10332
|
-
import
|
|
10333
|
-
import
|
|
10677
|
+
import { input as input2 } from "@inquirer/prompts";
|
|
10678
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readdirSync, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "fs";
|
|
10679
|
+
import path7 from "path";
|
|
10334
10680
|
import slugify2 from "slugify";
|
|
10335
10681
|
async function newMeshIntegrationHandler({
|
|
10336
10682
|
spin,
|
|
@@ -10348,45 +10694,46 @@ async function newMeshIntegrationHandler({
|
|
|
10348
10694
|
`Hey ${user.name}! Choose a Uniform team to register your integration`,
|
|
10349
10695
|
telemetry
|
|
10350
10696
|
);
|
|
10351
|
-
const
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
return true;
|
|
10360
|
-
} catch (e) {
|
|
10361
|
-
return e.message;
|
|
10362
|
-
}
|
|
10697
|
+
const name = await input2({
|
|
10698
|
+
message: "Please name your integration",
|
|
10699
|
+
validate(value) {
|
|
10700
|
+
try {
|
|
10701
|
+
validateIntegrationName(value, outputPath);
|
|
10702
|
+
return true;
|
|
10703
|
+
} catch (e) {
|
|
10704
|
+
return e.message;
|
|
10363
10705
|
}
|
|
10364
10706
|
}
|
|
10365
|
-
|
|
10366
|
-
const
|
|
10367
|
-
const { targetDir, typeSlug } = validateIntegrationName(answer.name, outputPath);
|
|
10707
|
+
});
|
|
10708
|
+
const { targetDir, typeSlug } = validateIntegrationName(name, outputPath);
|
|
10368
10709
|
const githubBranch = process.env.UNIFORM_ALTERNATIVE_MESH_INTEGRATION_BRANCH;
|
|
10369
10710
|
if (githubBranch) {
|
|
10370
10711
|
console.log(`Using alternative mesh integration branch: "${githubBranch}"`);
|
|
10371
10712
|
}
|
|
10713
|
+
const envVars = [["UNIFORM_CLI_TEAM_ID", teamId]];
|
|
10714
|
+
if (apiHost !== ENVIRONMENT_HOSTS.usa.api) {
|
|
10715
|
+
envVars.push(["UNIFORM_CLI_BASE_URL", apiHost]);
|
|
10716
|
+
}
|
|
10717
|
+
const dotEnvFile = envVars.length > 0 ? envVars.map(([name2, value]) => `${name2}='${value}'`).join("\n") + "\n" : void 0;
|
|
10372
10718
|
const { runNpmInstall } = await cloneStarter({
|
|
10373
10719
|
githubPath: `uniformdev/examples/mesh/mesh-integration`,
|
|
10374
10720
|
spin,
|
|
10375
10721
|
targetDir,
|
|
10376
|
-
githubBranch
|
|
10722
|
+
githubBranch,
|
|
10723
|
+
dotEnvFile
|
|
10377
10724
|
});
|
|
10378
10725
|
let done = await spin("Registering integration to team...");
|
|
10379
|
-
const pathToManifest =
|
|
10726
|
+
const pathToManifest = path7.resolve(targetDir, "mesh-manifest.json");
|
|
10380
10727
|
if (!existsSync4(pathToManifest)) {
|
|
10381
10728
|
throw new Error("Invalid integration starter cloned: missing `mesh-manifest.json`");
|
|
10382
10729
|
}
|
|
10383
|
-
const manifestContents =
|
|
10730
|
+
const manifestContents = readFileSync5(pathToManifest, "utf-8");
|
|
10384
10731
|
const manifestJson = JSON.parse(manifestContents);
|
|
10385
10732
|
manifestJson.type = typeSlug;
|
|
10386
10733
|
manifestJson.displayName = name;
|
|
10387
10734
|
writeFileSync2(pathToManifest, JSON.stringify(manifestJson, null, 2), "utf-8");
|
|
10388
|
-
const packageJsonPath =
|
|
10389
|
-
const packageJson = JSON.parse(
|
|
10735
|
+
const packageJsonPath = path7.resolve(targetDir, "package.json");
|
|
10736
|
+
const packageJson = JSON.parse(readFileSync5(packageJsonPath, "utf-8"));
|
|
10390
10737
|
packageJson.name = typeSlug;
|
|
10391
10738
|
writeFileSync2(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf-8");
|
|
10392
10739
|
const fullMeshAppKey = await uniformClient.registerMeshIntegration({ teamId, manifest: manifestJson });
|
|
@@ -10435,7 +10782,7 @@ function validateIntegrationName(integrationName, explicitOutputPath) {
|
|
|
10435
10782
|
mkdirSync3(targetDir, { recursive: true });
|
|
10436
10783
|
}
|
|
10437
10784
|
if (readdirSync(targetDir).length > 0) {
|
|
10438
|
-
targetDir =
|
|
10785
|
+
targetDir = path7.resolve(targetDir, typeSlug);
|
|
10439
10786
|
if (existsSync4(targetDir)) {
|
|
10440
10787
|
throw new Error(`${targetDir} directory already exists, choose a different name.`);
|
|
10441
10788
|
}
|
|
@@ -10444,8 +10791,6 @@ function validateIntegrationName(integrationName, explicitOutputPath) {
|
|
|
10444
10791
|
}
|
|
10445
10792
|
|
|
10446
10793
|
// src/commands/new/index.ts
|
|
10447
|
-
var stableApiHost2 = "https://uniform.app";
|
|
10448
|
-
var apiHostDefault2 = process.env.UNIFORM_CLI_BASE_URL || stableApiHost2;
|
|
10449
10794
|
var disableTelemetryDefault = !["", "0", "false", "no"].includes(
|
|
10450
10795
|
process.env.UNIFORM_CLI_DISABLE_TELEMETRY || ""
|
|
10451
10796
|
);
|
|
@@ -10456,9 +10801,10 @@ var NewCmd = {
|
|
|
10456
10801
|
describe: "Name of a project",
|
|
10457
10802
|
type: "string"
|
|
10458
10803
|
}).option("apiHost", {
|
|
10459
|
-
describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or
|
|
10460
|
-
|
|
10461
|
-
|
|
10804
|
+
describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.`,
|
|
10805
|
+
type: "string"
|
|
10806
|
+
}).option("edgeApiHost", {
|
|
10807
|
+
describe: `Uniform edge API host. Defaults to UNIFORM_CLI_BASE_EDGE_URL env or https://uniform.global. Supports dotenv.`,
|
|
10462
10808
|
type: "string"
|
|
10463
10809
|
}).option("outputPath", {
|
|
10464
10810
|
alias: "o",
|
|
@@ -10472,11 +10818,26 @@ var NewCmd = {
|
|
|
10472
10818
|
})
|
|
10473
10819
|
),
|
|
10474
10820
|
describe: "Start a new Uniform project",
|
|
10475
|
-
handler: async function({ name, apiHost, outputPath, disableTelemetry }) {
|
|
10821
|
+
handler: async function({ name, apiHost, edgeApiHost, outputPath, disableTelemetry }) {
|
|
10476
10822
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
10477
|
-
const telemetry = new Telemetry("cli new", disableTelemetry
|
|
10823
|
+
const telemetry = new Telemetry("cli new", disableTelemetry);
|
|
10478
10824
|
try {
|
|
10479
|
-
|
|
10825
|
+
const apiHostWithEnv = apiHost || process.env.UNIFORM_CLI_BASE_URL;
|
|
10826
|
+
const edgeApiHostWithEnv = edgeApiHost || process.env.UNIFORM_CLI_BASE_EDGE_URL;
|
|
10827
|
+
const resolvedApiHosts = await selectEnvironment({
|
|
10828
|
+
api: apiHostWithEnv,
|
|
10829
|
+
global: edgeApiHostWithEnv
|
|
10830
|
+
});
|
|
10831
|
+
telemetry.send("environment selected", { apiHost: resolvedApiHosts.api });
|
|
10832
|
+
console.info(`Welcome to Uniform New! Let's create ${name ? `"${name}"` : "a new project"}... \u2764\uFE0F`);
|
|
10833
|
+
await newHandler({
|
|
10834
|
+
spin,
|
|
10835
|
+
projectName: name,
|
|
10836
|
+
apiHost: resolvedApiHosts.api,
|
|
10837
|
+
edgeApiHost: resolvedApiHosts.global,
|
|
10838
|
+
outputPath,
|
|
10839
|
+
telemetry
|
|
10840
|
+
});
|
|
10480
10841
|
stopAllSpinners();
|
|
10481
10842
|
process.exit(0);
|
|
10482
10843
|
} catch (err) {
|
|
@@ -10493,9 +10854,7 @@ var NewMeshCmd = {
|
|
|
10493
10854
|
command: "new-integration",
|
|
10494
10855
|
builder: (y) => withConfiguration(
|
|
10495
10856
|
y.option("apiHost", {
|
|
10496
|
-
describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or
|
|
10497
|
-
default: apiHostDefault2,
|
|
10498
|
-
demandOption: true,
|
|
10857
|
+
describe: `Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.`,
|
|
10499
10858
|
type: "string"
|
|
10500
10859
|
}).option("outputPath", {
|
|
10501
10860
|
alias: "o",
|
|
@@ -10511,9 +10870,14 @@ var NewMeshCmd = {
|
|
|
10511
10870
|
describe: "Start a new Uniform project",
|
|
10512
10871
|
handler: async function({ apiHost, outputPath, disableTelemetry }) {
|
|
10513
10872
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
10514
|
-
const telemetry = new Telemetry("cli new mesh", disableTelemetry
|
|
10873
|
+
const telemetry = new Telemetry("cli new mesh", disableTelemetry);
|
|
10515
10874
|
try {
|
|
10516
|
-
|
|
10875
|
+
const apiHostWithEnv = apiHost || process.env.UNIFORM_CLI_BASE_URL;
|
|
10876
|
+
const resolvedApiHosts = await selectEnvironment({
|
|
10877
|
+
api: apiHostWithEnv
|
|
10878
|
+
});
|
|
10879
|
+
telemetry.send("environment selected", { apiHost: resolvedApiHosts.api });
|
|
10880
|
+
await newMeshIntegrationHandler({ spin, apiHost: resolvedApiHosts.api, outputPath, telemetry });
|
|
10517
10881
|
stopAllSpinners();
|
|
10518
10882
|
process.exit(0);
|
|
10519
10883
|
} catch (err) {
|
|
@@ -10528,10 +10892,10 @@ var NewMeshCmd = {
|
|
|
10528
10892
|
};
|
|
10529
10893
|
|
|
10530
10894
|
// src/commands/project-map/index.ts
|
|
10531
|
-
import
|
|
10895
|
+
import yargs35 from "yargs";
|
|
10532
10896
|
|
|
10533
10897
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
10534
|
-
import
|
|
10898
|
+
import yargs33 from "yargs";
|
|
10535
10899
|
|
|
10536
10900
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
10537
10901
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
@@ -10545,11 +10909,11 @@ function getProjectMapClient(options) {
|
|
|
10545
10909
|
var ProjectMapDefinitionGetModule = {
|
|
10546
10910
|
command: "get <id>",
|
|
10547
10911
|
describe: "Fetch a project map",
|
|
10548
|
-
builder: (
|
|
10912
|
+
builder: (yargs41) => withFormatOptions(
|
|
10549
10913
|
withConfiguration(
|
|
10550
10914
|
withApiOptions(
|
|
10551
10915
|
withProjectOptions(
|
|
10552
|
-
|
|
10916
|
+
yargs41.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
10553
10917
|
)
|
|
10554
10918
|
)
|
|
10555
10919
|
)
|
|
@@ -10572,7 +10936,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
10572
10936
|
command: "list",
|
|
10573
10937
|
describe: "List of project maps",
|
|
10574
10938
|
aliases: ["ls"],
|
|
10575
|
-
builder: (
|
|
10939
|
+
builder: (yargs41) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs41)))),
|
|
10576
10940
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10577
10941
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10578
10942
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -10626,12 +10990,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
10626
10990
|
var ProjectMapDefinitionPullModule = {
|
|
10627
10991
|
command: "pull <directory>",
|
|
10628
10992
|
describe: "Pulls all project maps to local files in a directory",
|
|
10629
|
-
builder: (
|
|
10993
|
+
builder: (yargs41) => withConfiguration(
|
|
10630
10994
|
withDebugOptions(
|
|
10631
10995
|
withApiOptions(
|
|
10632
10996
|
withProjectOptions(
|
|
10633
10997
|
withDiffOptions(
|
|
10634
|
-
|
|
10998
|
+
yargs41.positional("directory", {
|
|
10635
10999
|
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.",
|
|
10636
11000
|
type: "string"
|
|
10637
11001
|
}).option("format", {
|
|
@@ -10706,12 +11070,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
10706
11070
|
var ProjectMapDefinitionPushModule = {
|
|
10707
11071
|
command: "push <directory>",
|
|
10708
11072
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
10709
|
-
builder: (
|
|
11073
|
+
builder: (yargs41) => withConfiguration(
|
|
10710
11074
|
withDebugOptions(
|
|
10711
11075
|
withApiOptions(
|
|
10712
11076
|
withProjectOptions(
|
|
10713
11077
|
withDiffOptions(
|
|
10714
|
-
|
|
11078
|
+
yargs41.positional("directory", {
|
|
10715
11079
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
10716
11080
|
type: "string"
|
|
10717
11081
|
}).option("mode", {
|
|
@@ -10775,9 +11139,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
10775
11139
|
command: "remove <id>",
|
|
10776
11140
|
aliases: ["delete", "rm"],
|
|
10777
11141
|
describe: "Delete a project map",
|
|
10778
|
-
builder: (
|
|
11142
|
+
builder: (yargs41) => withConfiguration(
|
|
10779
11143
|
withApiOptions(
|
|
10780
|
-
withProjectOptions(
|
|
11144
|
+
withProjectOptions(yargs41.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
10781
11145
|
)
|
|
10782
11146
|
),
|
|
10783
11147
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -10792,10 +11156,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
10792
11156
|
command: "update <filename>",
|
|
10793
11157
|
aliases: ["put"],
|
|
10794
11158
|
describe: "Insert or update a project map",
|
|
10795
|
-
builder: (
|
|
11159
|
+
builder: (yargs41) => withConfiguration(
|
|
10796
11160
|
withApiOptions(
|
|
10797
11161
|
withProjectOptions(
|
|
10798
|
-
|
|
11162
|
+
yargs41.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
10799
11163
|
)
|
|
10800
11164
|
)
|
|
10801
11165
|
),
|
|
@@ -10811,24 +11175,24 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
10811
11175
|
var ProjectMapDefinitionModule = {
|
|
10812
11176
|
command: "definition <command>",
|
|
10813
11177
|
describe: "Commands for ProjectMap Definitions",
|
|
10814
|
-
builder: (
|
|
11178
|
+
builder: (yargs41) => yargs41.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
10815
11179
|
handler: () => {
|
|
10816
|
-
|
|
11180
|
+
yargs33.help();
|
|
10817
11181
|
}
|
|
10818
11182
|
};
|
|
10819
11183
|
|
|
10820
11184
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
10821
|
-
import
|
|
11185
|
+
import yargs34 from "yargs";
|
|
10822
11186
|
|
|
10823
11187
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
10824
11188
|
var ProjectMapNodeGetModule = {
|
|
10825
11189
|
command: "get <id> <projectMapId>",
|
|
10826
11190
|
describe: "Fetch a project map node",
|
|
10827
|
-
builder: (
|
|
11191
|
+
builder: (yargs41) => withConfiguration(
|
|
10828
11192
|
withFormatOptions(
|
|
10829
11193
|
withApiOptions(
|
|
10830
11194
|
withProjectOptions(
|
|
10831
|
-
|
|
11195
|
+
yargs41.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
10832
11196
|
)
|
|
10833
11197
|
)
|
|
10834
11198
|
)
|
|
@@ -10852,12 +11216,12 @@ var ProjectMapNodeListModule = {
|
|
|
10852
11216
|
command: "list <projectMapId>",
|
|
10853
11217
|
describe: "List project map nodes",
|
|
10854
11218
|
aliases: ["ls"],
|
|
10855
|
-
builder: (
|
|
11219
|
+
builder: (yargs41) => withConfiguration(
|
|
10856
11220
|
withFormatOptions(
|
|
10857
11221
|
withApiOptions(
|
|
10858
11222
|
withProjectOptions(
|
|
10859
11223
|
withStateOptions(
|
|
10860
|
-
|
|
11224
|
+
yargs41.positional("projectMapId", {
|
|
10861
11225
|
demandOption: true,
|
|
10862
11226
|
describe: "ProjectMap UUID to fetch from"
|
|
10863
11227
|
})
|
|
@@ -10935,12 +11299,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
10935
11299
|
var ProjectMapNodePullModule = {
|
|
10936
11300
|
command: "pull <directory>",
|
|
10937
11301
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
10938
|
-
builder: (
|
|
11302
|
+
builder: (yargs41) => withConfiguration(
|
|
10939
11303
|
withDebugOptions(
|
|
10940
11304
|
withApiOptions(
|
|
10941
11305
|
withProjectOptions(
|
|
10942
11306
|
withDiffOptions(
|
|
10943
|
-
|
|
11307
|
+
yargs41.positional("directory", {
|
|
10944
11308
|
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.",
|
|
10945
11309
|
type: "string"
|
|
10946
11310
|
}).option("format", {
|
|
@@ -11022,12 +11386,12 @@ import {
|
|
|
11022
11386
|
var ProjectMapNodePushModule = {
|
|
11023
11387
|
command: "push <directory>",
|
|
11024
11388
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
11025
|
-
builder: (
|
|
11389
|
+
builder: (yargs41) => withConfiguration(
|
|
11026
11390
|
withDebugOptions(
|
|
11027
11391
|
withApiOptions(
|
|
11028
11392
|
withProjectOptions(
|
|
11029
11393
|
withDiffOptions(
|
|
11030
|
-
|
|
11394
|
+
yargs41.positional("directory", {
|
|
11031
11395
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
11032
11396
|
type: "string"
|
|
11033
11397
|
}).option("mode", {
|
|
@@ -11129,10 +11493,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
11129
11493
|
command: "remove <id> <projectMapId>",
|
|
11130
11494
|
aliases: ["delete", "rm"],
|
|
11131
11495
|
describe: "Delete a project map node",
|
|
11132
|
-
builder: (
|
|
11496
|
+
builder: (yargs41) => withConfiguration(
|
|
11133
11497
|
withApiOptions(
|
|
11134
11498
|
withProjectOptions(
|
|
11135
|
-
|
|
11499
|
+
yargs41.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
11136
11500
|
)
|
|
11137
11501
|
)
|
|
11138
11502
|
),
|
|
@@ -11148,10 +11512,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
11148
11512
|
command: "update <filename> <projectMapId>",
|
|
11149
11513
|
aliases: ["put"],
|
|
11150
11514
|
describe: "Insert or update a project map node",
|
|
11151
|
-
builder: (
|
|
11515
|
+
builder: (yargs41) => withConfiguration(
|
|
11152
11516
|
withApiOptions(
|
|
11153
11517
|
withProjectOptions(
|
|
11154
|
-
|
|
11518
|
+
yargs41.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
11155
11519
|
)
|
|
11156
11520
|
)
|
|
11157
11521
|
),
|
|
@@ -11167,9 +11531,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
11167
11531
|
var ProjectMapNodeModule = {
|
|
11168
11532
|
command: "node <command>",
|
|
11169
11533
|
describe: "Commands for ProjectMap Nodes",
|
|
11170
|
-
builder: (
|
|
11534
|
+
builder: (yargs41) => yargs41.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
11171
11535
|
handler: () => {
|
|
11172
|
-
|
|
11536
|
+
yargs34.help();
|
|
11173
11537
|
}
|
|
11174
11538
|
};
|
|
11175
11539
|
|
|
@@ -11178,17 +11542,17 @@ var ProjectMapCommand = {
|
|
|
11178
11542
|
command: "project-map <command>",
|
|
11179
11543
|
aliases: ["prm"],
|
|
11180
11544
|
describe: "Uniform ProjectMap commands",
|
|
11181
|
-
builder: (
|
|
11545
|
+
builder: (yargs41) => yargs41.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
11182
11546
|
handler: () => {
|
|
11183
|
-
|
|
11547
|
+
yargs35.showHelp();
|
|
11184
11548
|
}
|
|
11185
11549
|
};
|
|
11186
11550
|
|
|
11187
11551
|
// src/commands/redirect/index.ts
|
|
11188
|
-
import
|
|
11552
|
+
import yargs37 from "yargs";
|
|
11189
11553
|
|
|
11190
11554
|
// src/commands/redirect/commands/redirect.ts
|
|
11191
|
-
import
|
|
11555
|
+
import yargs36 from "yargs";
|
|
11192
11556
|
|
|
11193
11557
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
11194
11558
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
@@ -11213,11 +11577,11 @@ function getRedirectClient(options) {
|
|
|
11213
11577
|
var RedirectDefinitionGetModule = {
|
|
11214
11578
|
command: "get <id>",
|
|
11215
11579
|
describe: "Fetch a redirect",
|
|
11216
|
-
builder: (
|
|
11580
|
+
builder: (yargs41) => withConfiguration(
|
|
11217
11581
|
withFormatOptions(
|
|
11218
11582
|
withApiOptions(
|
|
11219
11583
|
withProjectOptions(
|
|
11220
|
-
|
|
11584
|
+
yargs41.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
11221
11585
|
)
|
|
11222
11586
|
)
|
|
11223
11587
|
)
|
|
@@ -11240,7 +11604,7 @@ var RedirectDefinitionListModule = {
|
|
|
11240
11604
|
command: "list",
|
|
11241
11605
|
describe: "List of redirects",
|
|
11242
11606
|
aliases: ["ls"],
|
|
11243
|
-
builder: (
|
|
11607
|
+
builder: (yargs41) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs41)))),
|
|
11244
11608
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
11245
11609
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11246
11610
|
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -11292,12 +11656,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
11292
11656
|
var RedirectDefinitionPullModule = {
|
|
11293
11657
|
command: "pull <directory>",
|
|
11294
11658
|
describe: "Pulls all redirects to local files in a directory",
|
|
11295
|
-
builder: (
|
|
11659
|
+
builder: (yargs41) => withConfiguration(
|
|
11296
11660
|
withDebugOptions(
|
|
11297
11661
|
withApiOptions(
|
|
11298
11662
|
withProjectOptions(
|
|
11299
11663
|
withDiffOptions(
|
|
11300
|
-
|
|
11664
|
+
yargs41.positional("directory", {
|
|
11301
11665
|
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.",
|
|
11302
11666
|
type: "string"
|
|
11303
11667
|
}).option("format", {
|
|
@@ -11373,12 +11737,12 @@ var RedirectDefinitionPullModule = {
|
|
|
11373
11737
|
var RedirectDefinitionPushModule = {
|
|
11374
11738
|
command: "push <directory>",
|
|
11375
11739
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
11376
|
-
builder: (
|
|
11740
|
+
builder: (yargs41) => withConfiguration(
|
|
11377
11741
|
withDebugOptions(
|
|
11378
11742
|
withApiOptions(
|
|
11379
11743
|
withProjectOptions(
|
|
11380
11744
|
withDiffOptions(
|
|
11381
|
-
|
|
11745
|
+
yargs41.positional("directory", {
|
|
11382
11746
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
11383
11747
|
type: "string"
|
|
11384
11748
|
}).option("mode", {
|
|
@@ -11442,9 +11806,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
11442
11806
|
command: "remove <id>",
|
|
11443
11807
|
aliases: ["delete", "rm"],
|
|
11444
11808
|
describe: "Delete a redirect",
|
|
11445
|
-
builder: (
|
|
11809
|
+
builder: (yargs41) => withConfiguration(
|
|
11446
11810
|
withApiOptions(
|
|
11447
|
-
withProjectOptions(
|
|
11811
|
+
withProjectOptions(yargs41.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
11448
11812
|
)
|
|
11449
11813
|
),
|
|
11450
11814
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -11459,10 +11823,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
11459
11823
|
command: "update <filename>",
|
|
11460
11824
|
aliases: ["put"],
|
|
11461
11825
|
describe: "Insert or update a redirect",
|
|
11462
|
-
builder: (
|
|
11826
|
+
builder: (yargs41) => withConfiguration(
|
|
11463
11827
|
withApiOptions(
|
|
11464
11828
|
withProjectOptions(
|
|
11465
|
-
|
|
11829
|
+
yargs41.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
11466
11830
|
)
|
|
11467
11831
|
)
|
|
11468
11832
|
),
|
|
@@ -11478,9 +11842,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
11478
11842
|
var RedirectDefinitionModule = {
|
|
11479
11843
|
command: "definition <command>",
|
|
11480
11844
|
describe: "Commands for Redirect Definitions",
|
|
11481
|
-
builder: (
|
|
11845
|
+
builder: (yargs41) => yargs41.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
11482
11846
|
handler: () => {
|
|
11483
|
-
|
|
11847
|
+
yargs36.help();
|
|
11484
11848
|
}
|
|
11485
11849
|
};
|
|
11486
11850
|
|
|
@@ -11489,20 +11853,20 @@ var RedirectCommand = {
|
|
|
11489
11853
|
command: "redirect <command>",
|
|
11490
11854
|
aliases: ["red"],
|
|
11491
11855
|
describe: "Uniform Redirect commands",
|
|
11492
|
-
builder: (
|
|
11856
|
+
builder: (yargs41) => yargs41.command(RedirectDefinitionModule).demandCommand(),
|
|
11493
11857
|
handler: () => {
|
|
11494
|
-
|
|
11858
|
+
yargs37.showHelp();
|
|
11495
11859
|
}
|
|
11496
11860
|
};
|
|
11497
11861
|
|
|
11498
11862
|
// src/commands/sync/index.ts
|
|
11499
|
-
import
|
|
11863
|
+
import yargs38 from "yargs";
|
|
11500
11864
|
|
|
11501
11865
|
// src/webhooksClient.ts
|
|
11502
11866
|
import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
|
|
11503
11867
|
import PQueue3 from "p-queue";
|
|
11504
11868
|
import { Svix } from "svix";
|
|
11505
|
-
import * as z3 from "zod";
|
|
11869
|
+
import * as z3 from "zod/v3";
|
|
11506
11870
|
var WEBHOOKS_DASHBOARD_BASE_PATH = "/api/v1/svix-dashboard";
|
|
11507
11871
|
var WebhooksClient = class extends ApiClient4 {
|
|
11508
11872
|
constructor(options) {
|
|
@@ -11690,12 +12054,12 @@ function createWebhookEngineDataSource({
|
|
|
11690
12054
|
var WebhookPullModule = {
|
|
11691
12055
|
command: "pull <directory>",
|
|
11692
12056
|
describe: "Pulls all webhooks to local files in a directory",
|
|
11693
|
-
builder: (
|
|
12057
|
+
builder: (yargs41) => withConfiguration(
|
|
11694
12058
|
withApiOptions(
|
|
11695
12059
|
withDebugOptions(
|
|
11696
12060
|
withProjectOptions(
|
|
11697
12061
|
withDiffOptions(
|
|
11698
|
-
|
|
12062
|
+
yargs41.positional("directory", {
|
|
11699
12063
|
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.",
|
|
11700
12064
|
type: "string"
|
|
11701
12065
|
}).option("format", {
|
|
@@ -11881,7 +12245,7 @@ function numPad(num, spaces = 6) {
|
|
|
11881
12245
|
var SyncPullModule = {
|
|
11882
12246
|
command: "pull",
|
|
11883
12247
|
describe: "Pulls whole project to local files in a directory",
|
|
11884
|
-
builder: (
|
|
12248
|
+
builder: (yargs41) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs41))))),
|
|
11885
12249
|
handler: async ({ serialization, ...otherParams }) => {
|
|
11886
12250
|
const config2 = serialization;
|
|
11887
12251
|
const enabledEntities = Object.entries({
|
|
@@ -11979,12 +12343,12 @@ var getFormat = (entityType, config2) => {
|
|
|
11979
12343
|
var WebhookPushModule = {
|
|
11980
12344
|
command: "push <directory>",
|
|
11981
12345
|
describe: "Pushes all webhooks from files in a directory to Uniform",
|
|
11982
|
-
builder: (
|
|
12346
|
+
builder: (yargs41) => withConfiguration(
|
|
11983
12347
|
withDebugOptions(
|
|
11984
12348
|
withApiOptions(
|
|
11985
12349
|
withProjectOptions(
|
|
11986
12350
|
withDiffOptions(
|
|
11987
|
-
|
|
12351
|
+
yargs41.positional("directory", {
|
|
11988
12352
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
11989
12353
|
type: "string"
|
|
11990
12354
|
}).option("mode", {
|
|
@@ -12048,7 +12412,7 @@ var WebhookPushModule = {
|
|
|
12048
12412
|
var SyncPushModule = {
|
|
12049
12413
|
command: "push",
|
|
12050
12414
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
12051
|
-
builder: (
|
|
12415
|
+
builder: (yargs41) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs41))))),
|
|
12052
12416
|
handler: async ({ serialization, ...otherParams }) => {
|
|
12053
12417
|
const config2 = serialization;
|
|
12054
12418
|
const enabledEntities = Object.entries({
|
|
@@ -12257,21 +12621,21 @@ var getFormat2 = (entityType, config2) => {
|
|
|
12257
12621
|
var SyncCommand = {
|
|
12258
12622
|
command: "sync <command>",
|
|
12259
12623
|
describe: "Uniform Sync commands",
|
|
12260
|
-
builder: (
|
|
12624
|
+
builder: (yargs41) => yargs41.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
12261
12625
|
handler: () => {
|
|
12262
|
-
|
|
12626
|
+
yargs38.showHelp();
|
|
12263
12627
|
}
|
|
12264
12628
|
};
|
|
12265
12629
|
|
|
12266
12630
|
// src/commands/webhook/index.ts
|
|
12267
|
-
import
|
|
12631
|
+
import yargs39 from "yargs";
|
|
12268
12632
|
var WebhookCommand = {
|
|
12269
12633
|
command: "webhook <command>",
|
|
12270
12634
|
aliases: ["wh"],
|
|
12271
12635
|
describe: "Commands for webhooks",
|
|
12272
|
-
builder: (
|
|
12636
|
+
builder: (yargs41) => yargs41.command(WebhookPullModule).command(WebhookPushModule).demandCommand(),
|
|
12273
12637
|
handler: () => {
|
|
12274
|
-
|
|
12638
|
+
yargs39.help();
|
|
12275
12639
|
}
|
|
12276
12640
|
};
|
|
12277
12641
|
|
|
@@ -12506,7 +12870,7 @@ First found was: v${firstVersion}`;
|
|
|
12506
12870
|
|
|
12507
12871
|
// src/index.ts
|
|
12508
12872
|
dotenv.config();
|
|
12509
|
-
var yarggery =
|
|
12873
|
+
var yarggery = yargs40(hideBin(process.argv));
|
|
12510
12874
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
12511
12875
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
12512
12876
|
yarggery.option("verbose", {
|