@ted-galago/wave-cli 0.1.3 → 0.1.4
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/README.md +16 -5
- package/dist/index.cjs +326 -151
- package/dist/index.js +326 -151
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -102,10 +102,10 @@ function parseDebug(rawDebugOption, rawDebugEnv) {
|
|
|
102
102
|
return lowered === "1" || lowered === "true" || lowered === "yes";
|
|
103
103
|
}
|
|
104
104
|
function getConfig(options) {
|
|
105
|
-
const token =
|
|
105
|
+
const token = options.token ?? options.jwt ?? process.env.WAVE_API_TOKEN ?? process.env.WAVE_JWT;
|
|
106
106
|
if (!token) {
|
|
107
107
|
throw new CliError({
|
|
108
|
-
message: "Missing API token.
|
|
108
|
+
message: "Missing API token. Pass --token/--jwt, use --token-stdin/--auth-json-stdin, or set WAVE_API_TOKEN/WAVE_JWT.",
|
|
109
109
|
kind: "missing_auth",
|
|
110
110
|
status: 401,
|
|
111
111
|
exitCode: EXIT_CODES.missingOrInvalidAuth
|
|
@@ -114,7 +114,7 @@ function getConfig(options) {
|
|
|
114
114
|
const baseUrl = options.baseUrl ?? process.env.WAVE_API_BASE_URL ?? process.env.WAVE_API_URL;
|
|
115
115
|
if (!baseUrl) {
|
|
116
116
|
throw new CliError({
|
|
117
|
-
message: "Missing API base URL.
|
|
117
|
+
message: "Missing API base URL. Pass --base-url, provide via --auth-json-stdin, or set WAVE_API_BASE_URL/WAVE_API_URL.",
|
|
118
118
|
kind: "invalid_args",
|
|
119
119
|
status: 400,
|
|
120
120
|
exitCode: EXIT_CODES.invalidArgs
|
|
@@ -561,24 +561,196 @@ async function runGraphqlMutationCommand(input) {
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
// src/commands/runtimeOptions.ts
|
|
564
|
-
|
|
564
|
+
var stdinPromise = null;
|
|
565
|
+
function normalize(raw) {
|
|
566
|
+
if (typeof raw !== "string") {
|
|
567
|
+
return void 0;
|
|
568
|
+
}
|
|
569
|
+
const trimmed = raw.trim();
|
|
570
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
571
|
+
}
|
|
572
|
+
function parseBool(raw) {
|
|
573
|
+
if (typeof raw === "boolean") {
|
|
574
|
+
return raw;
|
|
575
|
+
}
|
|
576
|
+
if (typeof raw !== "string") {
|
|
577
|
+
return void 0;
|
|
578
|
+
}
|
|
579
|
+
const lowered = raw.toLowerCase();
|
|
580
|
+
if (lowered === "1" || lowered === "true" || lowered === "yes") {
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
583
|
+
if (lowered === "0" || lowered === "false" || lowered === "no") {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
return void 0;
|
|
587
|
+
}
|
|
588
|
+
function parseAuthJson(raw) {
|
|
589
|
+
try {
|
|
590
|
+
const parsed = JSON.parse(raw);
|
|
591
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
592
|
+
throw new Error("Expected JSON object.");
|
|
593
|
+
}
|
|
594
|
+
const obj = parsed;
|
|
595
|
+
return {
|
|
596
|
+
token: normalize(obj.token),
|
|
597
|
+
jwt: normalize(obj.jwt),
|
|
598
|
+
baseUrl: normalize(obj.baseUrl ?? obj.base_url),
|
|
599
|
+
organizationId: normalize(obj.organizationId ?? obj.organization_id),
|
|
600
|
+
timeoutMs: typeof obj.timeoutMs === "number" || typeof obj.timeoutMs === "string" ? obj.timeoutMs : typeof obj.timeout_ms === "number" || typeof obj.timeout_ms === "string" ? obj.timeout_ms : void 0,
|
|
601
|
+
debug: parseBool(obj.debug),
|
|
602
|
+
agentName: normalize(obj.agentName ?? obj.agent_name),
|
|
603
|
+
agentRunId: normalize(obj.agentRunId ?? obj.agent_run_id),
|
|
604
|
+
requestId: normalize(obj.requestId ?? obj.request_id),
|
|
605
|
+
openapiPath: normalize(obj.openapiPath ?? obj.openapi_path),
|
|
606
|
+
openapiUrl: normalize(obj.openapiUrl ?? obj.openapi_url),
|
|
607
|
+
openapiVersion: normalize(obj.openapiVersion ?? obj.openapi_version)
|
|
608
|
+
};
|
|
609
|
+
} catch (error) {
|
|
610
|
+
throw new CliError({
|
|
611
|
+
message: error instanceof Error ? `Invalid --auth-json-stdin payload: ${error.message}` : "Invalid --auth-json-stdin payload.",
|
|
612
|
+
kind: "invalid_args",
|
|
613
|
+
status: 400,
|
|
614
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
async function readStdinRaw() {
|
|
619
|
+
if (!stdinPromise) {
|
|
620
|
+
stdinPromise = new Promise((resolve, reject) => {
|
|
621
|
+
if (process.stdin.isTTY) {
|
|
622
|
+
resolve("");
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
let data = "";
|
|
626
|
+
process.stdin.setEncoding("utf8");
|
|
627
|
+
process.stdin.on("data", (chunk) => {
|
|
628
|
+
data += chunk;
|
|
629
|
+
});
|
|
630
|
+
process.stdin.on("end", () => resolve(data));
|
|
631
|
+
process.stdin.on("error", reject);
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
return stdinPromise;
|
|
635
|
+
}
|
|
636
|
+
function firstDefined(...values) {
|
|
637
|
+
return values.find((value) => value !== void 0);
|
|
638
|
+
}
|
|
639
|
+
function resolveFromSources(options, stdin, env) {
|
|
640
|
+
const token = firstDefined(
|
|
641
|
+
normalize(options.token),
|
|
642
|
+
normalize(options.jwt),
|
|
643
|
+
normalize(stdin.token),
|
|
644
|
+
normalize(stdin.jwt),
|
|
645
|
+
normalize(env.WAVE_API_TOKEN),
|
|
646
|
+
normalize(env.WAVE_JWT)
|
|
647
|
+
);
|
|
648
|
+
const baseUrl = firstDefined(
|
|
649
|
+
normalize(options.baseUrl),
|
|
650
|
+
normalize(stdin.baseUrl),
|
|
651
|
+
normalize(env.WAVE_API_BASE_URL),
|
|
652
|
+
normalize(env.WAVE_API_URL)
|
|
653
|
+
);
|
|
654
|
+
const organizationId = firstDefined(
|
|
655
|
+
normalize(options.organizationId),
|
|
656
|
+
normalize(stdin.organizationId),
|
|
657
|
+
normalize(env.WAVE_ORGANIZATION_ID),
|
|
658
|
+
normalize(env.WAVE_ORG_ID)
|
|
659
|
+
);
|
|
660
|
+
const timeoutMs = firstDefined(options.timeoutMs, stdin.timeoutMs, env.WAVE_TIMEOUT_MS);
|
|
661
|
+
const debug = firstDefined(
|
|
662
|
+
options.debug === true ? true : void 0,
|
|
663
|
+
stdin.debug,
|
|
664
|
+
parseBool(env.WAVE_DEBUG)
|
|
665
|
+
);
|
|
666
|
+
const agentName = firstDefined(
|
|
667
|
+
normalize(options.agentName),
|
|
668
|
+
normalize(stdin.agentName),
|
|
669
|
+
normalize(env.WAVE_AGENT_NAME)
|
|
670
|
+
);
|
|
671
|
+
const agentRunId = firstDefined(
|
|
672
|
+
normalize(options.agentRunId),
|
|
673
|
+
normalize(stdin.agentRunId),
|
|
674
|
+
normalize(env.WAVE_AGENT_RUN_ID)
|
|
675
|
+
);
|
|
676
|
+
const requestId = firstDefined(
|
|
677
|
+
normalize(options.requestId),
|
|
678
|
+
normalize(stdin.requestId),
|
|
679
|
+
normalize(env.WAVE_REQUEST_ID)
|
|
680
|
+
);
|
|
681
|
+
const openapiPath = firstDefined(
|
|
682
|
+
normalize(options.openapiPath),
|
|
683
|
+
normalize(stdin.openapiPath),
|
|
684
|
+
normalize(env.WAVE_OPENAPI_PATH)
|
|
685
|
+
);
|
|
686
|
+
const openapiUrl = firstDefined(
|
|
687
|
+
normalize(options.openapiUrl),
|
|
688
|
+
normalize(stdin.openapiUrl),
|
|
689
|
+
normalize(env.WAVE_OPENAPI_URL)
|
|
690
|
+
);
|
|
691
|
+
const openapiVersion = firstDefined(
|
|
692
|
+
normalize(options.openapiVersion),
|
|
693
|
+
normalize(stdin.openapiVersion),
|
|
694
|
+
normalize(env.WAVE_OPENAPI_VERSION)
|
|
695
|
+
);
|
|
565
696
|
return {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
697
|
+
organizationId,
|
|
698
|
+
runtimeOptions: {
|
|
699
|
+
token,
|
|
700
|
+
baseUrl,
|
|
701
|
+
timeoutMs,
|
|
702
|
+
debug,
|
|
703
|
+
agentName,
|
|
704
|
+
agentRunId,
|
|
705
|
+
requestId,
|
|
706
|
+
openapiPath,
|
|
707
|
+
openapiUrl,
|
|
708
|
+
openapiVersion
|
|
709
|
+
}
|
|
577
710
|
};
|
|
578
711
|
}
|
|
712
|
+
async function resolveStdinContext(options) {
|
|
713
|
+
if (options.tokenStdin && options.authJsonStdin) {
|
|
714
|
+
throw new CliError({
|
|
715
|
+
message: "Use only one stdin auth mode: --token-stdin or --auth-json-stdin.",
|
|
716
|
+
kind: "invalid_args",
|
|
717
|
+
status: 400,
|
|
718
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
if (!options.tokenStdin && !options.authJsonStdin) {
|
|
722
|
+
return {};
|
|
723
|
+
}
|
|
724
|
+
const raw = (await readStdinRaw()).trim();
|
|
725
|
+
if (!raw) {
|
|
726
|
+
throw new CliError({
|
|
727
|
+
message: options.tokenStdin ? "Missing stdin token. Provide token via stdin when using --token-stdin." : "Missing stdin auth JSON. Provide JSON via stdin when using --auth-json-stdin.",
|
|
728
|
+
kind: "invalid_args",
|
|
729
|
+
status: 400,
|
|
730
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
if (options.tokenStdin) {
|
|
734
|
+
const token = normalize(raw);
|
|
735
|
+
if (!token) {
|
|
736
|
+
throw new CliError({
|
|
737
|
+
message: "Invalid stdin token. Token value is empty.",
|
|
738
|
+
kind: "invalid_args",
|
|
739
|
+
status: 400,
|
|
740
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
return { token };
|
|
744
|
+
}
|
|
745
|
+
return parseAuthJson(raw);
|
|
746
|
+
}
|
|
747
|
+
async function resolveCommandContext(options) {
|
|
748
|
+
const stdin = await resolveStdinContext(options);
|
|
749
|
+
return resolveFromSources(options, stdin, process.env);
|
|
750
|
+
}
|
|
579
751
|
|
|
580
752
|
// src/commands/organization.ts
|
|
581
|
-
function
|
|
753
|
+
function normalize2(input) {
|
|
582
754
|
if (!input) {
|
|
583
755
|
return void 0;
|
|
584
756
|
}
|
|
@@ -586,10 +758,10 @@ function normalize(input) {
|
|
|
586
758
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
587
759
|
}
|
|
588
760
|
function resolveOrganizationId(raw) {
|
|
589
|
-
const organizationId =
|
|
761
|
+
const organizationId = normalize2(raw);
|
|
590
762
|
if (!organizationId) {
|
|
591
763
|
throw new CliError({
|
|
592
|
-
message: "Missing organization ID.
|
|
764
|
+
message: "Missing organization ID. Pass --organization-id, provide via --auth-json-stdin, or set WAVE_ORGANIZATION_ID.",
|
|
593
765
|
kind: "invalid_args",
|
|
594
766
|
status: 400,
|
|
595
767
|
exitCode: EXIT_CODES.invalidArgs
|
|
@@ -1265,8 +1437,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1265
1437
|
list.option(`--${cliParam} <${cliParam}>`);
|
|
1266
1438
|
});
|
|
1267
1439
|
list.option("--query-json <queryJson>", "Additional query params as JSON object").action(async (opts, cmd) => {
|
|
1268
|
-
const
|
|
1269
|
-
const organizationId = resolveOrganizationId(
|
|
1440
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1441
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1270
1442
|
const extraQuery = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1271
1443
|
const mappedKnownParams = Object.fromEntries(
|
|
1272
1444
|
listParams.map((param) => {
|
|
@@ -1283,7 +1455,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1283
1455
|
});
|
|
1284
1456
|
await runGraphqlQueryCommand({
|
|
1285
1457
|
command: `${config.command}.list`,
|
|
1286
|
-
runtimeOptions:
|
|
1458
|
+
runtimeOptions: context.runtimeOptions,
|
|
1287
1459
|
field: config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath,
|
|
1288
1460
|
variables,
|
|
1289
1461
|
isList: true
|
|
@@ -1291,11 +1463,11 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1291
1463
|
});
|
|
1292
1464
|
entityCommand.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1293
1465
|
const id = idSchema.parse(opts.id);
|
|
1294
|
-
const
|
|
1295
|
-
const organizationId = resolveOrganizationId(
|
|
1466
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1467
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1296
1468
|
await runGraphqlQueryCommand({
|
|
1297
1469
|
command: `${config.command}.show`,
|
|
1298
|
-
runtimeOptions:
|
|
1470
|
+
runtimeOptions: context.runtimeOptions,
|
|
1299
1471
|
field: config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath),
|
|
1300
1472
|
variables: normalizeGraphqlVariables2({
|
|
1301
1473
|
organization_id: organizationId,
|
|
@@ -1305,13 +1477,13 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1305
1477
|
});
|
|
1306
1478
|
});
|
|
1307
1479
|
entityCommand.command("create").requiredOption("--data-json <dataJson>", createHelp4).action(async (opts, cmd) => {
|
|
1308
|
-
const
|
|
1309
|
-
const organizationId = resolveOrganizationId(
|
|
1480
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1481
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1310
1482
|
const body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
1311
1483
|
assertRequiredCreateFields(body, config.rootKey, config.requiredCreateFields);
|
|
1312
1484
|
await runGraphqlMutationCommand({
|
|
1313
1485
|
command: `${config.command}.create`,
|
|
1314
|
-
runtimeOptions:
|
|
1486
|
+
runtimeOptions: context.runtimeOptions,
|
|
1315
1487
|
field: `create_${toSingularResourceName(config.resourcePath)}`,
|
|
1316
1488
|
variables: {
|
|
1317
1489
|
organization_id: organizationId,
|
|
@@ -1321,13 +1493,13 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1321
1493
|
});
|
|
1322
1494
|
entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5).action(async (opts, cmd) => {
|
|
1323
1495
|
const id = idSchema.parse(opts.id);
|
|
1324
|
-
const
|
|
1325
|
-
const organizationId = resolveOrganizationId(
|
|
1496
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1497
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1326
1498
|
const body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
1327
1499
|
const singular = toSingularResourceName(config.resourcePath);
|
|
1328
1500
|
await runGraphqlMutationCommand({
|
|
1329
1501
|
command: `${config.command}.update`,
|
|
1330
|
-
runtimeOptions:
|
|
1502
|
+
runtimeOptions: context.runtimeOptions,
|
|
1331
1503
|
field: `update_${singular}`,
|
|
1332
1504
|
variables: {
|
|
1333
1505
|
organization_id: organizationId,
|
|
@@ -1352,13 +1524,13 @@ var summarySchema = import_zod3.z.string().min(1);
|
|
|
1352
1524
|
function registerTaskCommands(program) {
|
|
1353
1525
|
const tasks = program.command("tasks").description("Task operations");
|
|
1354
1526
|
tasks.command("list").option("--project-id <projectId>").option("--page <page>").option("--per <per>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--field-name <fieldName>").option("--field-value <fieldValue>").option("--field-blank <fieldBlank>").option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1355
|
-
const
|
|
1356
|
-
const organizationId = resolveOrganizationId(
|
|
1527
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1528
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1357
1529
|
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
1358
1530
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1359
1531
|
await runGraphqlQueryCommand({
|
|
1360
1532
|
command: "tasks.list",
|
|
1361
|
-
runtimeOptions:
|
|
1533
|
+
runtimeOptions: context.runtimeOptions,
|
|
1362
1534
|
field: "tasks",
|
|
1363
1535
|
variables: normalizeGraphqlVariables2({
|
|
1364
1536
|
organization_id: organizationId,
|
|
@@ -1381,11 +1553,11 @@ function registerTaskCommands(program) {
|
|
|
1381
1553
|
});
|
|
1382
1554
|
tasks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1383
1555
|
const parsed = idSchema2.parse(opts.id);
|
|
1384
|
-
const
|
|
1385
|
-
const organizationId = resolveOrganizationId(
|
|
1556
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1557
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1386
1558
|
await runGraphqlQueryCommand({
|
|
1387
1559
|
command: "tasks.show",
|
|
1388
|
-
runtimeOptions:
|
|
1560
|
+
runtimeOptions: context.runtimeOptions,
|
|
1389
1561
|
field: "task",
|
|
1390
1562
|
variables: {
|
|
1391
1563
|
organization_id: organizationId,
|
|
@@ -1397,11 +1569,11 @@ function registerTaskCommands(program) {
|
|
|
1397
1569
|
tasks.command("create").requiredOption("--project-id <projectId>").option("--title <title>", "Legacy alias for --summary").option("--summary <summary>").action(async (opts, cmd) => {
|
|
1398
1570
|
const projectId = projectIdSchema.parse(opts.projectId);
|
|
1399
1571
|
const summary = summarySchema.parse(opts.summary ?? opts.title);
|
|
1400
|
-
const
|
|
1401
|
-
const organizationId = resolveOrganizationId(
|
|
1572
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1573
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1402
1574
|
await runGraphqlMutationCommand({
|
|
1403
1575
|
command: "tasks.create",
|
|
1404
|
-
runtimeOptions:
|
|
1576
|
+
runtimeOptions: context.runtimeOptions,
|
|
1405
1577
|
field: "create_task",
|
|
1406
1578
|
variables: {
|
|
1407
1579
|
organization_id: organizationId,
|
|
@@ -1416,8 +1588,8 @@ function registerTaskCommands(program) {
|
|
|
1416
1588
|
});
|
|
1417
1589
|
tasks.command("update").requiredOption("--id <id>").option("--summary <summary>").option("--description <description>").option("--status <status>").option("--priority <priority>").option("--due-date <dueDate>").option("--member-id <memberId>").action(async (opts, cmd) => {
|
|
1418
1590
|
const id = idSchema2.parse(opts.id);
|
|
1419
|
-
const
|
|
1420
|
-
const organizationId = resolveOrganizationId(
|
|
1591
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1592
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1421
1593
|
const taskPayload = {
|
|
1422
1594
|
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
1423
1595
|
...opts.description ? { description: String(opts.description) } : {},
|
|
@@ -1436,7 +1608,7 @@ function registerTaskCommands(program) {
|
|
|
1436
1608
|
}
|
|
1437
1609
|
await runGraphqlMutationCommand({
|
|
1438
1610
|
command: "tasks.update",
|
|
1439
|
-
runtimeOptions:
|
|
1611
|
+
runtimeOptions: context.runtimeOptions,
|
|
1440
1612
|
field: "update_task",
|
|
1441
1613
|
variables: {
|
|
1442
1614
|
organization_id: organizationId,
|
|
@@ -1457,12 +1629,12 @@ var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON
|
|
|
1457
1629
|
function registerProjectCommands(program) {
|
|
1458
1630
|
const projects = program.command("projects").description("Project operations");
|
|
1459
1631
|
projects.command("list").option("--page <page>").option("--per <per>").option("--include-archived <includeArchived>").option("--status <status>").option("--term <term>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1460
|
-
const
|
|
1461
|
-
const organizationId = resolveOrganizationId(
|
|
1632
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1633
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1462
1634
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1463
1635
|
await runGraphqlQueryCommand({
|
|
1464
1636
|
command: "projects.list",
|
|
1465
|
-
runtimeOptions:
|
|
1637
|
+
runtimeOptions: context.runtimeOptions,
|
|
1466
1638
|
field: "projects",
|
|
1467
1639
|
variables: normalizeGraphqlVariables2({
|
|
1468
1640
|
organization_id: organizationId,
|
|
@@ -1480,11 +1652,11 @@ function registerProjectCommands(program) {
|
|
|
1480
1652
|
});
|
|
1481
1653
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1482
1654
|
const id = idSchema3.parse(opts.id);
|
|
1483
|
-
const
|
|
1484
|
-
const organizationId = resolveOrganizationId(
|
|
1655
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1656
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1485
1657
|
await runGraphqlQueryCommand({
|
|
1486
1658
|
command: "projects.show",
|
|
1487
|
-
runtimeOptions:
|
|
1659
|
+
runtimeOptions: context.runtimeOptions,
|
|
1488
1660
|
field: "project",
|
|
1489
1661
|
variables: {
|
|
1490
1662
|
organization_id: organizationId,
|
|
@@ -1494,12 +1666,12 @@ function registerProjectCommands(program) {
|
|
|
1494
1666
|
});
|
|
1495
1667
|
});
|
|
1496
1668
|
projects.command("create").requiredOption("--data-json <dataJson>", projectCreateDataJsonHelp).action(async (opts, cmd) => {
|
|
1497
|
-
const
|
|
1498
|
-
const organizationId = resolveOrganizationId(
|
|
1669
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1670
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1499
1671
|
const body = __testables.normalizeBody(String(opts.dataJson), "project");
|
|
1500
1672
|
await runGraphqlMutationCommand({
|
|
1501
1673
|
command: "projects.create",
|
|
1502
|
-
runtimeOptions:
|
|
1674
|
+
runtimeOptions: context.runtimeOptions,
|
|
1503
1675
|
field: "create_project",
|
|
1504
1676
|
variables: {
|
|
1505
1677
|
organization_id: organizationId,
|
|
@@ -1509,12 +1681,12 @@ function registerProjectCommands(program) {
|
|
|
1509
1681
|
});
|
|
1510
1682
|
projects.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", projectUpdateDataJsonHelp).action(async (opts, cmd) => {
|
|
1511
1683
|
const id = idSchema3.parse(opts.id);
|
|
1512
|
-
const
|
|
1513
|
-
const organizationId = resolveOrganizationId(
|
|
1684
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1685
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1514
1686
|
const body = __testables.normalizeBody(String(opts.dataJson), "project");
|
|
1515
1687
|
await runGraphqlMutationCommand({
|
|
1516
1688
|
command: "projects.update",
|
|
1517
|
-
runtimeOptions:
|
|
1689
|
+
runtimeOptions: context.runtimeOptions,
|
|
1518
1690
|
field: "update_project",
|
|
1519
1691
|
variables: {
|
|
1520
1692
|
organization_id: organizationId,
|
|
@@ -1535,13 +1707,13 @@ var updateHelp = buildDataJsonHelp("rock", "update") ?? 'JSON object for rock or
|
|
|
1535
1707
|
function registerRockCommands(program) {
|
|
1536
1708
|
const rocks = program.command("rocks").description("Rock operations");
|
|
1537
1709
|
rocks.command("list").option("--page <page>").option("--per <per>").option("--rock-collection-id <rockCollectionId>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--annual-objective-id <annualObjectiveId>").option("--quarterly-objective-id <quarterlyObjectiveId>").option("--field-name <fieldName>").option("--field-value <fieldValue>").option("--field-blank <fieldBlank>").option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1538
|
-
const
|
|
1539
|
-
const organizationId = resolveOrganizationId(
|
|
1710
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1711
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1540
1712
|
const rockCollectionId = opts.rockCollectionId ? rockCollectionIdSchema.parse(opts.rockCollectionId) : void 0;
|
|
1541
1713
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1542
1714
|
await runGraphqlQueryCommand({
|
|
1543
1715
|
command: "rocks.list",
|
|
1544
|
-
runtimeOptions:
|
|
1716
|
+
runtimeOptions: context.runtimeOptions,
|
|
1545
1717
|
field: "rocks",
|
|
1546
1718
|
variables: normalizeGraphqlVariables2({
|
|
1547
1719
|
organization_id: organizationId,
|
|
@@ -1566,11 +1738,11 @@ function registerRockCommands(program) {
|
|
|
1566
1738
|
});
|
|
1567
1739
|
rocks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1568
1740
|
const id = idSchema4.parse(opts.id);
|
|
1569
|
-
const
|
|
1570
|
-
const organizationId = resolveOrganizationId(
|
|
1741
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1742
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1571
1743
|
await runGraphqlQueryCommand({
|
|
1572
1744
|
command: "rocks.show",
|
|
1573
|
-
runtimeOptions:
|
|
1745
|
+
runtimeOptions: context.runtimeOptions,
|
|
1574
1746
|
field: "rock",
|
|
1575
1747
|
variables: {
|
|
1576
1748
|
organization_id: organizationId,
|
|
@@ -1582,11 +1754,11 @@ function registerRockCommands(program) {
|
|
|
1582
1754
|
rocks.command("update-status").requiredOption("--id <id>").requiredOption("--status <status>").action(async (opts, cmd) => {
|
|
1583
1755
|
const id = idSchema4.parse(opts.id);
|
|
1584
1756
|
const status = statusSchema.parse(opts.status);
|
|
1585
|
-
const
|
|
1586
|
-
const organizationId = resolveOrganizationId(
|
|
1757
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1758
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1587
1759
|
await runGraphqlMutationCommand({
|
|
1588
1760
|
command: "rocks.update-status",
|
|
1589
|
-
runtimeOptions:
|
|
1761
|
+
runtimeOptions: context.runtimeOptions,
|
|
1590
1762
|
field: "update_rock",
|
|
1591
1763
|
variables: {
|
|
1592
1764
|
organization_id: organizationId,
|
|
@@ -1596,13 +1768,13 @@ function registerRockCommands(program) {
|
|
|
1596
1768
|
});
|
|
1597
1769
|
});
|
|
1598
1770
|
rocks.command("create").requiredOption("--data-json <dataJson>", createHelp).action(async (opts, cmd) => {
|
|
1599
|
-
const
|
|
1600
|
-
const organizationId = resolveOrganizationId(
|
|
1771
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1772
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1601
1773
|
const body = __testables.normalizeBody(String(opts.dataJson), "rock");
|
|
1602
1774
|
__testables.assertRequiredCreateFields(body, "rock", ["rock_collection_id"]);
|
|
1603
1775
|
await runGraphqlMutationCommand({
|
|
1604
1776
|
command: "rocks.create",
|
|
1605
|
-
runtimeOptions:
|
|
1777
|
+
runtimeOptions: context.runtimeOptions,
|
|
1606
1778
|
field: "create_rock",
|
|
1607
1779
|
variables: {
|
|
1608
1780
|
organization_id: organizationId,
|
|
@@ -1612,12 +1784,12 @@ function registerRockCommands(program) {
|
|
|
1612
1784
|
});
|
|
1613
1785
|
rocks.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp).action(async (opts, cmd) => {
|
|
1614
1786
|
const id = idSchema4.parse(opts.id);
|
|
1615
|
-
const
|
|
1616
|
-
const organizationId = resolveOrganizationId(
|
|
1787
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1788
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1617
1789
|
const body = __testables.normalizeBody(String(opts.dataJson), "rock");
|
|
1618
1790
|
await runGraphqlMutationCommand({
|
|
1619
1791
|
command: "rocks.update",
|
|
1620
|
-
runtimeOptions:
|
|
1792
|
+
runtimeOptions: context.runtimeOptions,
|
|
1621
1793
|
field: "update_rock",
|
|
1622
1794
|
variables: {
|
|
1623
1795
|
organization_id: organizationId,
|
|
@@ -1637,12 +1809,12 @@ var updateHelp2 = buildDataJsonHelp("meeting", "update") ?? 'JSON object for mee
|
|
|
1637
1809
|
function registerMeetingCommands(program) {
|
|
1638
1810
|
const meetings = program.command("meetings").description("Meeting operations");
|
|
1639
1811
|
meetings.command("list").option("--per <per>").option("--date <date>").option("--occurrence-date <occurrenceDate>").option("--past <past>").option("--start-time <startTime>").option("--today-and-active <todayAndActive>").option("--upcoming <upcoming>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1640
|
-
const
|
|
1641
|
-
const organizationId = resolveOrganizationId(
|
|
1812
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1813
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1642
1814
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1643
1815
|
await runGraphqlQueryCommand({
|
|
1644
1816
|
command: "meetings.list",
|
|
1645
|
-
runtimeOptions:
|
|
1817
|
+
runtimeOptions: context.runtimeOptions,
|
|
1646
1818
|
field: "meetings",
|
|
1647
1819
|
variables: normalizeGraphqlVariables2({
|
|
1648
1820
|
organization_id: organizationId,
|
|
@@ -1660,11 +1832,11 @@ function registerMeetingCommands(program) {
|
|
|
1660
1832
|
});
|
|
1661
1833
|
meetings.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1662
1834
|
const id = idSchema5.parse(opts.id);
|
|
1663
|
-
const
|
|
1664
|
-
const organizationId = resolveOrganizationId(
|
|
1835
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1836
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1665
1837
|
await runGraphqlQueryCommand({
|
|
1666
1838
|
command: "meetings.show",
|
|
1667
|
-
runtimeOptions:
|
|
1839
|
+
runtimeOptions: context.runtimeOptions,
|
|
1668
1840
|
field: "meeting",
|
|
1669
1841
|
variables: {
|
|
1670
1842
|
organization_id: organizationId,
|
|
@@ -1676,11 +1848,11 @@ function registerMeetingCommands(program) {
|
|
|
1676
1848
|
meetings.command("notes").requiredOption("--id <id>").requiredOption("--content <content>").action(async (opts, cmd) => {
|
|
1677
1849
|
const id = idSchema5.parse(opts.id);
|
|
1678
1850
|
const notes = notesSchema.parse(opts.content);
|
|
1679
|
-
const
|
|
1680
|
-
const organizationId = resolveOrganizationId(
|
|
1851
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1852
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1681
1853
|
await runGraphqlMutationCommand({
|
|
1682
1854
|
command: "meeting-notes.create",
|
|
1683
|
-
runtimeOptions:
|
|
1855
|
+
runtimeOptions: context.runtimeOptions,
|
|
1684
1856
|
field: "update_meeting",
|
|
1685
1857
|
variables: {
|
|
1686
1858
|
organization_id: organizationId,
|
|
@@ -1694,12 +1866,12 @@ function registerMeetingCommands(program) {
|
|
|
1694
1866
|
});
|
|
1695
1867
|
});
|
|
1696
1868
|
meetings.command("create").requiredOption("--data-json <dataJson>", createHelp2).action(async (opts, cmd) => {
|
|
1697
|
-
const
|
|
1698
|
-
const organizationId = resolveOrganizationId(
|
|
1869
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1870
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1699
1871
|
const body = __testables.normalizeBody(String(opts.dataJson), "meeting");
|
|
1700
1872
|
await runGraphqlMutationCommand({
|
|
1701
1873
|
command: "meetings.create",
|
|
1702
|
-
runtimeOptions:
|
|
1874
|
+
runtimeOptions: context.runtimeOptions,
|
|
1703
1875
|
field: "create_meeting",
|
|
1704
1876
|
variables: {
|
|
1705
1877
|
organization_id: organizationId,
|
|
@@ -1709,12 +1881,12 @@ function registerMeetingCommands(program) {
|
|
|
1709
1881
|
});
|
|
1710
1882
|
meetings.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp2).action(async (opts, cmd) => {
|
|
1711
1883
|
const id = idSchema5.parse(opts.id);
|
|
1712
|
-
const
|
|
1713
|
-
const organizationId = resolveOrganizationId(
|
|
1884
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1885
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1714
1886
|
const body = __testables.normalizeBody(String(opts.dataJson), "meeting");
|
|
1715
1887
|
await runGraphqlMutationCommand({
|
|
1716
1888
|
command: "meetings.update",
|
|
1717
|
-
runtimeOptions:
|
|
1889
|
+
runtimeOptions: context.runtimeOptions,
|
|
1718
1890
|
field: "update_meeting",
|
|
1719
1891
|
variables: {
|
|
1720
1892
|
organization_id: organizationId,
|
|
@@ -1733,12 +1905,12 @@ var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for memb
|
|
|
1733
1905
|
function registerMemberCommands(program) {
|
|
1734
1906
|
const members = program.command("members").description("Member operations");
|
|
1735
1907
|
members.command("list").option("--page <page>").option("--per <per>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1736
|
-
const
|
|
1737
|
-
const organizationId = resolveOrganizationId(
|
|
1908
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1909
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1738
1910
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1739
1911
|
await runGraphqlQueryCommand({
|
|
1740
1912
|
command: "members.list",
|
|
1741
|
-
runtimeOptions:
|
|
1913
|
+
runtimeOptions: context.runtimeOptions,
|
|
1742
1914
|
field: "members",
|
|
1743
1915
|
variables: normalizeGraphqlVariables2({
|
|
1744
1916
|
organization_id: organizationId,
|
|
@@ -1751,11 +1923,11 @@ function registerMemberCommands(program) {
|
|
|
1751
1923
|
});
|
|
1752
1924
|
members.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1753
1925
|
const id = idSchema6.parse(opts.id);
|
|
1754
|
-
const
|
|
1755
|
-
const organizationId = resolveOrganizationId(
|
|
1926
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1927
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1756
1928
|
await runGraphqlQueryCommand({
|
|
1757
1929
|
command: "members.show",
|
|
1758
|
-
runtimeOptions:
|
|
1930
|
+
runtimeOptions: context.runtimeOptions,
|
|
1759
1931
|
field: "member",
|
|
1760
1932
|
variables: {
|
|
1761
1933
|
organization_id: organizationId,
|
|
@@ -1765,12 +1937,12 @@ function registerMemberCommands(program) {
|
|
|
1765
1937
|
});
|
|
1766
1938
|
});
|
|
1767
1939
|
members.command("create").requiredOption("--data-json <dataJson>", createHelp3).action(async (opts, cmd) => {
|
|
1768
|
-
const
|
|
1769
|
-
const organizationId = resolveOrganizationId(
|
|
1940
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1941
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1770
1942
|
const body = __testables.normalizeBody(String(opts.dataJson), "member");
|
|
1771
1943
|
await runGraphqlMutationCommand({
|
|
1772
1944
|
command: "members.create",
|
|
1773
|
-
runtimeOptions:
|
|
1945
|
+
runtimeOptions: context.runtimeOptions,
|
|
1774
1946
|
field: "create_member",
|
|
1775
1947
|
variables: {
|
|
1776
1948
|
organization_id: organizationId,
|
|
@@ -1780,12 +1952,12 @@ function registerMemberCommands(program) {
|
|
|
1780
1952
|
});
|
|
1781
1953
|
members.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp3).action(async (opts, cmd) => {
|
|
1782
1954
|
const id = idSchema6.parse(opts.id);
|
|
1783
|
-
const
|
|
1784
|
-
const organizationId = resolveOrganizationId(
|
|
1955
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1956
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1785
1957
|
const body = __testables.normalizeBody(String(opts.dataJson), "member");
|
|
1786
1958
|
await runGraphqlMutationCommand({
|
|
1787
1959
|
command: "members.update",
|
|
1788
|
-
runtimeOptions:
|
|
1960
|
+
runtimeOptions: context.runtimeOptions,
|
|
1789
1961
|
field: "update_member",
|
|
1790
1962
|
variables: {
|
|
1791
1963
|
organization_id: organizationId,
|
|
@@ -1806,12 +1978,12 @@ var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue
|
|
|
1806
1978
|
function registerIssueCommands(program) {
|
|
1807
1979
|
const issues = program.command("issues").description("Issue operations");
|
|
1808
1980
|
issues.command("list").option("--page <page>").option("--per <per>").option("--issue-group-id <issueGroupId>").option("--team-id <teamId>").option("--team-ids <teamIds>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--rank-direction <rankDirection>").option("--include-archived <includeArchived>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1809
|
-
const
|
|
1810
|
-
const organizationId = resolveOrganizationId(
|
|
1981
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1982
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1811
1983
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1812
1984
|
await runGraphqlQueryCommand({
|
|
1813
1985
|
command: "issues.list",
|
|
1814
|
-
runtimeOptions:
|
|
1986
|
+
runtimeOptions: context.runtimeOptions,
|
|
1815
1987
|
field: "issues",
|
|
1816
1988
|
variables: normalizeGraphqlVariables2({
|
|
1817
1989
|
organization_id: organizationId,
|
|
@@ -1831,11 +2003,11 @@ function registerIssueCommands(program) {
|
|
|
1831
2003
|
});
|
|
1832
2004
|
issues.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1833
2005
|
const id = idSchema7.parse(opts.id);
|
|
1834
|
-
const
|
|
1835
|
-
const organizationId = resolveOrganizationId(
|
|
2006
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2007
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1836
2008
|
await runGraphqlQueryCommand({
|
|
1837
2009
|
command: "issues.show",
|
|
1838
|
-
runtimeOptions:
|
|
2010
|
+
runtimeOptions: context.runtimeOptions,
|
|
1839
2011
|
field: "issue",
|
|
1840
2012
|
variables: {
|
|
1841
2013
|
organization_id: organizationId,
|
|
@@ -1848,11 +2020,11 @@ function registerIssueCommands(program) {
|
|
|
1848
2020
|
const issueGroupId = issueGroupIdSchema.parse(opts.issueGroupId);
|
|
1849
2021
|
const name = nameSchema.parse(opts.name);
|
|
1850
2022
|
const issueType = issueTypeSchema.parse(opts.issueType);
|
|
1851
|
-
const
|
|
1852
|
-
const organizationId = resolveOrganizationId(
|
|
2023
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2024
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1853
2025
|
await runGraphqlMutationCommand({
|
|
1854
2026
|
command: "issues.create",
|
|
1855
|
-
runtimeOptions:
|
|
2027
|
+
runtimeOptions: context.runtimeOptions,
|
|
1856
2028
|
field: "create_issue",
|
|
1857
2029
|
variables: {
|
|
1858
2030
|
organization_id: organizationId,
|
|
@@ -1873,12 +2045,12 @@ function registerIssueCommands(program) {
|
|
|
1873
2045
|
});
|
|
1874
2046
|
issues.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp4).action(async (opts, cmd) => {
|
|
1875
2047
|
const id = idSchema7.parse(opts.id);
|
|
1876
|
-
const
|
|
1877
|
-
const organizationId = resolveOrganizationId(
|
|
2048
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2049
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1878
2050
|
const body = __testables.normalizeBody(String(opts.dataJson), "issue");
|
|
1879
2051
|
await runGraphqlMutationCommand({
|
|
1880
2052
|
command: "issues.update",
|
|
1881
|
-
runtimeOptions:
|
|
2053
|
+
runtimeOptions: context.runtimeOptions,
|
|
1882
2054
|
field: "update_issue",
|
|
1883
2055
|
variables: {
|
|
1884
2056
|
organization_id: organizationId,
|
|
@@ -2091,12 +2263,12 @@ var idSchema8 = import_zod9.z.string().min(1);
|
|
|
2091
2263
|
function registerTeamCommands(program) {
|
|
2092
2264
|
const teams = program.command("teams").description("Team operations");
|
|
2093
2265
|
teams.command("list").option("--page <page>").option("--per <per>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
2094
|
-
const
|
|
2095
|
-
const organizationId = resolveOrganizationId(
|
|
2266
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2267
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2096
2268
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2097
2269
|
await runGraphqlQueryCommand({
|
|
2098
2270
|
command: "teams.list",
|
|
2099
|
-
runtimeOptions:
|
|
2271
|
+
runtimeOptions: context.runtimeOptions,
|
|
2100
2272
|
field: "teams",
|
|
2101
2273
|
variables: normalizeGraphqlVariables2({
|
|
2102
2274
|
organization_id: organizationId,
|
|
@@ -2109,11 +2281,11 @@ function registerTeamCommands(program) {
|
|
|
2109
2281
|
});
|
|
2110
2282
|
teams.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
2111
2283
|
const id = idSchema8.parse(opts.id);
|
|
2112
|
-
const
|
|
2113
|
-
const organizationId = resolveOrganizationId(
|
|
2284
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2285
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2114
2286
|
await runGraphqlQueryCommand({
|
|
2115
2287
|
command: "teams.show",
|
|
2116
|
-
runtimeOptions:
|
|
2288
|
+
runtimeOptions: context.runtimeOptions,
|
|
2117
2289
|
field: "team",
|
|
2118
2290
|
variables: {
|
|
2119
2291
|
organization_id: organizationId,
|
|
@@ -2123,12 +2295,12 @@ function registerTeamCommands(program) {
|
|
|
2123
2295
|
});
|
|
2124
2296
|
});
|
|
2125
2297
|
teams.command("create").requiredOption("--data-json <dataJson>", 'JSON object for team or {"team": {...}}').action(async (opts, cmd) => {
|
|
2126
|
-
const
|
|
2127
|
-
const organizationId = resolveOrganizationId(
|
|
2298
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2299
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2128
2300
|
const body = __testables.normalizeBody(String(opts.dataJson), "team");
|
|
2129
2301
|
await runGraphqlMutationCommand({
|
|
2130
2302
|
command: "teams.create",
|
|
2131
|
-
runtimeOptions:
|
|
2303
|
+
runtimeOptions: context.runtimeOptions,
|
|
2132
2304
|
field: "create_team",
|
|
2133
2305
|
variables: {
|
|
2134
2306
|
organization_id: organizationId,
|
|
@@ -2138,12 +2310,12 @@ function registerTeamCommands(program) {
|
|
|
2138
2310
|
});
|
|
2139
2311
|
teams.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", 'JSON object for team or {"team": {...}}').action(async (opts, cmd) => {
|
|
2140
2312
|
const id = idSchema8.parse(opts.id);
|
|
2141
|
-
const
|
|
2142
|
-
const organizationId = resolveOrganizationId(
|
|
2313
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2314
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2143
2315
|
const body = __testables.normalizeBody(String(opts.dataJson), "team");
|
|
2144
2316
|
await runGraphqlMutationCommand({
|
|
2145
2317
|
command: "teams.update",
|
|
2146
|
-
runtimeOptions:
|
|
2318
|
+
runtimeOptions: context.runtimeOptions,
|
|
2147
2319
|
field: "update_team",
|
|
2148
2320
|
variables: {
|
|
2149
2321
|
organization_id: organizationId,
|
|
@@ -2160,12 +2332,12 @@ var idSchema9 = import_zod10.z.string().min(1);
|
|
|
2160
2332
|
function registerOrganizationCommands(program) {
|
|
2161
2333
|
const organizations = program.command("organizations").description("Organization operations");
|
|
2162
2334
|
organizations.command("show").option("--id <id>", "Organization ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
2163
|
-
const
|
|
2164
|
-
const fallbackId = resolveOrganizationId(
|
|
2335
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2336
|
+
const fallbackId = resolveOrganizationId(context.organizationId);
|
|
2165
2337
|
const id = idSchema9.parse(opts.id ?? fallbackId);
|
|
2166
2338
|
await runGraphqlQueryCommand({
|
|
2167
2339
|
command: "organizations.show",
|
|
2168
|
-
runtimeOptions:
|
|
2340
|
+
runtimeOptions: context.runtimeOptions,
|
|
2169
2341
|
field: "organization",
|
|
2170
2342
|
variables: { id },
|
|
2171
2343
|
isShow: true
|
|
@@ -2175,13 +2347,13 @@ function registerOrganizationCommands(program) {
|
|
|
2175
2347
|
"--data-json <dataJson>",
|
|
2176
2348
|
'JSON object for organization or {"organization": {...}}'
|
|
2177
2349
|
).action(async (opts, cmd) => {
|
|
2178
|
-
const
|
|
2179
|
-
const fallbackId = resolveOrganizationId(
|
|
2350
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2351
|
+
const fallbackId = resolveOrganizationId(context.organizationId);
|
|
2180
2352
|
const id = idSchema9.parse(opts.id ?? fallbackId);
|
|
2181
2353
|
const body = __testables.normalizeBody(String(opts.dataJson), "organization");
|
|
2182
2354
|
await runGraphqlMutationCommand({
|
|
2183
2355
|
command: "organizations.update",
|
|
2184
|
-
runtimeOptions:
|
|
2356
|
+
runtimeOptions: context.runtimeOptions,
|
|
2185
2357
|
field: "update_organization",
|
|
2186
2358
|
variables: {
|
|
2187
2359
|
id,
|
|
@@ -2191,12 +2363,12 @@ function registerOrganizationCommands(program) {
|
|
|
2191
2363
|
});
|
|
2192
2364
|
const metaProfile = organizations.command("meta-profile").description("Organization meta profile operations");
|
|
2193
2365
|
metaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
2194
|
-
const
|
|
2195
|
-
const organizationId = resolveOrganizationId(
|
|
2366
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2367
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2196
2368
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2197
2369
|
await runGraphqlQueryCommand({
|
|
2198
2370
|
command: "organizations.meta-profile.show",
|
|
2199
|
-
runtimeOptions:
|
|
2371
|
+
runtimeOptions: context.runtimeOptions,
|
|
2200
2372
|
field: "organization_meta_profile",
|
|
2201
2373
|
variables: {
|
|
2202
2374
|
organization_id: organizationId,
|
|
@@ -2209,8 +2381,8 @@ function registerOrganizationCommands(program) {
|
|
|
2209
2381
|
"--data-json <dataJson>",
|
|
2210
2382
|
'JSON object for organization_meta_profile or {"organization_meta_profile": {...}}'
|
|
2211
2383
|
).action(async (opts, cmd) => {
|
|
2212
|
-
const
|
|
2213
|
-
const organizationId = resolveOrganizationId(
|
|
2384
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2385
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2214
2386
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2215
2387
|
const body = __testables.normalizeBody(
|
|
2216
2388
|
String(opts.dataJson),
|
|
@@ -2218,7 +2390,7 @@ function registerOrganizationCommands(program) {
|
|
|
2218
2390
|
);
|
|
2219
2391
|
await runGraphqlMutationCommand({
|
|
2220
2392
|
command: "organizations.meta-profile.update",
|
|
2221
|
-
runtimeOptions:
|
|
2393
|
+
runtimeOptions: context.runtimeOptions,
|
|
2222
2394
|
field: "update_organization_meta_profile",
|
|
2223
2395
|
variables: {
|
|
2224
2396
|
organization_id: organizationId,
|
|
@@ -2229,12 +2401,12 @@ function registerOrganizationCommands(program) {
|
|
|
2229
2401
|
});
|
|
2230
2402
|
const keyMetricMetaProfile = organizations.command("key-metric-meta-profile").description("Key metric meta profile operations");
|
|
2231
2403
|
keyMetricMetaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
2232
|
-
const
|
|
2233
|
-
const organizationId = resolveOrganizationId(
|
|
2404
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2405
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2234
2406
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2235
2407
|
await runGraphqlQueryCommand({
|
|
2236
2408
|
command: "organizations.key-metric-meta-profile.show",
|
|
2237
|
-
runtimeOptions:
|
|
2409
|
+
runtimeOptions: context.runtimeOptions,
|
|
2238
2410
|
field: "key_metric_meta_profile",
|
|
2239
2411
|
variables: {
|
|
2240
2412
|
organization_id: organizationId,
|
|
@@ -2247,8 +2419,8 @@ function registerOrganizationCommands(program) {
|
|
|
2247
2419
|
"--data-json <dataJson>",
|
|
2248
2420
|
'JSON object for key_metric_meta_profile or {"key_metric_meta_profile": {...}}'
|
|
2249
2421
|
).action(async (opts, cmd) => {
|
|
2250
|
-
const
|
|
2251
|
-
const organizationId = resolveOrganizationId(
|
|
2422
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2423
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2252
2424
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2253
2425
|
const body = __testables.normalizeBody(
|
|
2254
2426
|
String(opts.dataJson),
|
|
@@ -2256,7 +2428,7 @@ function registerOrganizationCommands(program) {
|
|
|
2256
2428
|
);
|
|
2257
2429
|
await runGraphqlMutationCommand({
|
|
2258
2430
|
command: "organizations.key-metric-meta-profile.update",
|
|
2259
|
-
runtimeOptions:
|
|
2431
|
+
runtimeOptions: context.runtimeOptions,
|
|
2260
2432
|
field: "update_key_metric_meta_profile",
|
|
2261
2433
|
variables: {
|
|
2262
2434
|
organization_id: organizationId,
|
|
@@ -2275,12 +2447,12 @@ function registerFoundationCommands(program) {
|
|
|
2275
2447
|
const strategicPlans = foundation.command("strategic-plans").description("Strategic plan operations");
|
|
2276
2448
|
const strategicObjectives = foundation.command("strategic-objectives").description("Strategic objective operations");
|
|
2277
2449
|
strategicPlans.command("show").option("--id <id>", "Strategic plan ID (defaults to organization context)").option("--progress-scope <progressScope>").option("--all-progress <allProgress>").option("--all <all>").action(async (opts, cmd) => {
|
|
2278
|
-
const
|
|
2279
|
-
const organizationId = resolveOrganizationId(
|
|
2450
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2451
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2280
2452
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2281
2453
|
await runGraphqlQueryCommand({
|
|
2282
2454
|
command: "foundation.strategic-plans.show",
|
|
2283
|
-
runtimeOptions:
|
|
2455
|
+
runtimeOptions: context.runtimeOptions,
|
|
2284
2456
|
field: "strategic_plan",
|
|
2285
2457
|
variables: normalizeGraphqlVariables2({
|
|
2286
2458
|
organization_id: organizationId,
|
|
@@ -2296,13 +2468,13 @@ function registerFoundationCommands(program) {
|
|
|
2296
2468
|
"--data-json <dataJson>",
|
|
2297
2469
|
'JSON object for strategic_plan or {"strategic_plan": {...}}'
|
|
2298
2470
|
).action(async (opts, cmd) => {
|
|
2299
|
-
const
|
|
2300
|
-
const organizationId = resolveOrganizationId(
|
|
2471
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2472
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2301
2473
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2302
2474
|
const body = __testables.normalizeBody(String(opts.dataJson), "strategic_plan");
|
|
2303
2475
|
await runGraphqlMutationCommand({
|
|
2304
2476
|
command: "foundation.strategic-plans.update",
|
|
2305
|
-
runtimeOptions:
|
|
2477
|
+
runtimeOptions: context.runtimeOptions,
|
|
2306
2478
|
field: "update_strategic_plan",
|
|
2307
2479
|
variables: {
|
|
2308
2480
|
organization_id: organizationId,
|
|
@@ -2312,12 +2484,12 @@ function registerFoundationCommands(program) {
|
|
|
2312
2484
|
});
|
|
2313
2485
|
});
|
|
2314
2486
|
strategicObjectives.command("show").option("--id <id>", "Strategic objective ID (defaults to organization context)").option("--progress-scope <progressScope>").option("--all-progress <allProgress>").option("--all <all>").action(async (opts, cmd) => {
|
|
2315
|
-
const
|
|
2316
|
-
const organizationId = resolveOrganizationId(
|
|
2487
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2488
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2317
2489
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2318
2490
|
await runGraphqlQueryCommand({
|
|
2319
2491
|
command: "foundation.strategic-objectives.show",
|
|
2320
|
-
runtimeOptions:
|
|
2492
|
+
runtimeOptions: context.runtimeOptions,
|
|
2321
2493
|
field: "strategic_objective",
|
|
2322
2494
|
variables: normalizeGraphqlVariables2({
|
|
2323
2495
|
organization_id: organizationId,
|
|
@@ -2333,8 +2505,8 @@ function registerFoundationCommands(program) {
|
|
|
2333
2505
|
"--data-json <dataJson>",
|
|
2334
2506
|
'JSON object for strategic_objective or {"strategic_objective": {...}}'
|
|
2335
2507
|
).action(async (opts, cmd) => {
|
|
2336
|
-
const
|
|
2337
|
-
const organizationId = resolveOrganizationId(
|
|
2508
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2509
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2338
2510
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2339
2511
|
const body = __testables.normalizeBody(
|
|
2340
2512
|
String(opts.dataJson),
|
|
@@ -2342,7 +2514,7 @@ function registerFoundationCommands(program) {
|
|
|
2342
2514
|
);
|
|
2343
2515
|
await runGraphqlMutationCommand({
|
|
2344
2516
|
command: "foundation.strategic-objectives.update",
|
|
2345
|
-
runtimeOptions:
|
|
2517
|
+
runtimeOptions: context.runtimeOptions,
|
|
2346
2518
|
field: "update_strategic_objective",
|
|
2347
2519
|
variables: {
|
|
2348
2520
|
organization_id: organizationId,
|
|
@@ -2372,7 +2544,10 @@ function registerFoundationCommands(program) {
|
|
|
2372
2544
|
// src/cli.ts
|
|
2373
2545
|
function buildCli() {
|
|
2374
2546
|
const program = new import_commander.Command();
|
|
2375
|
-
program.name("wave").description("Wave agent CLI").showHelpAfterError(false).allowExcessArguments(false).option("--token <token>", "API token (prefer WAVE_API_TOKEN env var)").option("--jwt <jwt>", "Legacy alias for --token (prefer WAVE_API_TOKEN env var)").option(
|
|
2547
|
+
program.name("wave").description("Wave agent CLI").showHelpAfterError(false).allowExcessArguments(false).option("--token <token>", "API token (prefer WAVE_API_TOKEN env var)").option("--jwt <jwt>", "Legacy alias for --token (prefer WAVE_API_TOKEN env var)").option("--token-stdin", "Read API token from stdin").option(
|
|
2548
|
+
"--auth-json-stdin",
|
|
2549
|
+
"Read auth/runtime context JSON from stdin (token, baseUrl, organizationId, ...)"
|
|
2550
|
+
).option(
|
|
2376
2551
|
"--base-url <baseUrl>",
|
|
2377
2552
|
"API base URL (prefer WAVE_API_BASE_URL env var)"
|
|
2378
2553
|
).option(
|