@ted-galago/wave-cli 0.1.3 → 0.1.5
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 +81 -5
- package/dist/index.cjs +816 -155
- package/dist/index.js +813 -152
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -101,10 +101,10 @@ function parseDebug(rawDebugOption, rawDebugEnv) {
|
|
|
101
101
|
return lowered === "1" || lowered === "true" || lowered === "yes";
|
|
102
102
|
}
|
|
103
103
|
function getConfig(options) {
|
|
104
|
-
const token =
|
|
104
|
+
const token = options.token ?? options.jwt ?? process.env.WAVE_API_TOKEN ?? process.env.WAVE_JWT;
|
|
105
105
|
if (!token) {
|
|
106
106
|
throw new CliError({
|
|
107
|
-
message: "Missing API token.
|
|
107
|
+
message: "Missing API token. Pass --token/--jwt, use --token-stdin/--auth-json-stdin, or set WAVE_API_TOKEN/WAVE_JWT.",
|
|
108
108
|
kind: "missing_auth",
|
|
109
109
|
status: 401,
|
|
110
110
|
exitCode: EXIT_CODES.missingOrInvalidAuth
|
|
@@ -113,7 +113,7 @@ function getConfig(options) {
|
|
|
113
113
|
const baseUrl = options.baseUrl ?? process.env.WAVE_API_BASE_URL ?? process.env.WAVE_API_URL;
|
|
114
114
|
if (!baseUrl) {
|
|
115
115
|
throw new CliError({
|
|
116
|
-
message: "Missing API base URL.
|
|
116
|
+
message: "Missing API base URL. Pass --base-url, provide via --auth-json-stdin, or set WAVE_API_BASE_URL/WAVE_API_URL.",
|
|
117
117
|
kind: "invalid_args",
|
|
118
118
|
status: 400,
|
|
119
119
|
exitCode: EXIT_CODES.invalidArgs
|
|
@@ -251,7 +251,7 @@ function normalizeGraphqlVariables(variables) {
|
|
|
251
251
|
function buildGraphqlBody(input) {
|
|
252
252
|
const graphqlField = toCamelCase(input.field);
|
|
253
253
|
const graphqlVariables = normalizeGraphqlVariables(input.variables);
|
|
254
|
-
const operationName = graphqlOperationName(input.command);
|
|
254
|
+
const operationName = input.operationName ?? graphqlOperationName(input.command);
|
|
255
255
|
const variableEntries = Object.entries(graphqlVariables).filter(([, value]) => value !== void 0);
|
|
256
256
|
const variableDecl = variableEntries.map(([name, value]) => `$${name}: ${withNonNull(graphqlTypeForVariable(name, value))}`).join(", ");
|
|
257
257
|
const fieldArgs = variableEntries.map(([name]) => `${name}: $${name}`).join(", ");
|
|
@@ -489,12 +489,21 @@ async function runGraphqlQueryCommand(input) {
|
|
|
489
489
|
const result = await graphqlRequest({
|
|
490
490
|
config,
|
|
491
491
|
command: input.command,
|
|
492
|
+
operationName: input.operationName,
|
|
492
493
|
operationType: "query",
|
|
493
494
|
field: input.field,
|
|
494
495
|
variables: input.variables ?? {},
|
|
495
496
|
selectionSet: input.selectionSet ?? defaultQuerySelectionSet(input.field, Boolean(input.isList)),
|
|
496
497
|
isShow: input.isShow
|
|
497
498
|
});
|
|
499
|
+
if (result.envelope.ok && input.transformData && result.envelope.data) {
|
|
500
|
+
const dataRecord = result.envelope.data;
|
|
501
|
+
const transformed = input.transformData(dataRecord[input.field]);
|
|
502
|
+
result.envelope.data = {
|
|
503
|
+
...dataRecord,
|
|
504
|
+
[input.field]: transformed
|
|
505
|
+
};
|
|
506
|
+
}
|
|
498
507
|
printEnvelopeAndExit(result);
|
|
499
508
|
} catch (error) {
|
|
500
509
|
if (error instanceof CliError) {
|
|
@@ -527,6 +536,7 @@ async function runGraphqlMutationCommand(input) {
|
|
|
527
536
|
const result = await graphqlRequest({
|
|
528
537
|
config,
|
|
529
538
|
command: input.command,
|
|
539
|
+
operationName: input.operationName,
|
|
530
540
|
operationType: "mutation",
|
|
531
541
|
field: input.field,
|
|
532
542
|
variables: input.variables ?? {},
|
|
@@ -560,24 +570,196 @@ async function runGraphqlMutationCommand(input) {
|
|
|
560
570
|
}
|
|
561
571
|
|
|
562
572
|
// src/commands/runtimeOptions.ts
|
|
563
|
-
|
|
573
|
+
var stdinPromise = null;
|
|
574
|
+
function normalize(raw) {
|
|
575
|
+
if (typeof raw !== "string") {
|
|
576
|
+
return void 0;
|
|
577
|
+
}
|
|
578
|
+
const trimmed = raw.trim();
|
|
579
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
580
|
+
}
|
|
581
|
+
function parseBool(raw) {
|
|
582
|
+
if (typeof raw === "boolean") {
|
|
583
|
+
return raw;
|
|
584
|
+
}
|
|
585
|
+
if (typeof raw !== "string") {
|
|
586
|
+
return void 0;
|
|
587
|
+
}
|
|
588
|
+
const lowered = raw.toLowerCase();
|
|
589
|
+
if (lowered === "1" || lowered === "true" || lowered === "yes") {
|
|
590
|
+
return true;
|
|
591
|
+
}
|
|
592
|
+
if (lowered === "0" || lowered === "false" || lowered === "no") {
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
return void 0;
|
|
596
|
+
}
|
|
597
|
+
function parseAuthJson(raw) {
|
|
598
|
+
try {
|
|
599
|
+
const parsed = JSON.parse(raw);
|
|
600
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
601
|
+
throw new Error("Expected JSON object.");
|
|
602
|
+
}
|
|
603
|
+
const obj = parsed;
|
|
604
|
+
return {
|
|
605
|
+
token: normalize(obj.token),
|
|
606
|
+
jwt: normalize(obj.jwt),
|
|
607
|
+
baseUrl: normalize(obj.baseUrl ?? obj.base_url),
|
|
608
|
+
organizationId: normalize(obj.organizationId ?? obj.organization_id),
|
|
609
|
+
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,
|
|
610
|
+
debug: parseBool(obj.debug),
|
|
611
|
+
agentName: normalize(obj.agentName ?? obj.agent_name),
|
|
612
|
+
agentRunId: normalize(obj.agentRunId ?? obj.agent_run_id),
|
|
613
|
+
requestId: normalize(obj.requestId ?? obj.request_id),
|
|
614
|
+
openapiPath: normalize(obj.openapiPath ?? obj.openapi_path),
|
|
615
|
+
openapiUrl: normalize(obj.openapiUrl ?? obj.openapi_url),
|
|
616
|
+
openapiVersion: normalize(obj.openapiVersion ?? obj.openapi_version)
|
|
617
|
+
};
|
|
618
|
+
} catch (error) {
|
|
619
|
+
throw new CliError({
|
|
620
|
+
message: error instanceof Error ? `Invalid --auth-json-stdin payload: ${error.message}` : "Invalid --auth-json-stdin payload.",
|
|
621
|
+
kind: "invalid_args",
|
|
622
|
+
status: 400,
|
|
623
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
async function readStdinRaw() {
|
|
628
|
+
if (!stdinPromise) {
|
|
629
|
+
stdinPromise = new Promise((resolve, reject) => {
|
|
630
|
+
if (process.stdin.isTTY) {
|
|
631
|
+
resolve("");
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
let data = "";
|
|
635
|
+
process.stdin.setEncoding("utf8");
|
|
636
|
+
process.stdin.on("data", (chunk) => {
|
|
637
|
+
data += chunk;
|
|
638
|
+
});
|
|
639
|
+
process.stdin.on("end", () => resolve(data));
|
|
640
|
+
process.stdin.on("error", reject);
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
return stdinPromise;
|
|
644
|
+
}
|
|
645
|
+
function firstDefined(...values) {
|
|
646
|
+
return values.find((value) => value !== void 0);
|
|
647
|
+
}
|
|
648
|
+
function resolveFromSources(options, stdin, env) {
|
|
649
|
+
const token = firstDefined(
|
|
650
|
+
normalize(options.token),
|
|
651
|
+
normalize(options.jwt),
|
|
652
|
+
normalize(stdin.token),
|
|
653
|
+
normalize(stdin.jwt),
|
|
654
|
+
normalize(env.WAVE_API_TOKEN),
|
|
655
|
+
normalize(env.WAVE_JWT)
|
|
656
|
+
);
|
|
657
|
+
const baseUrl = firstDefined(
|
|
658
|
+
normalize(options.baseUrl),
|
|
659
|
+
normalize(stdin.baseUrl),
|
|
660
|
+
normalize(env.WAVE_API_BASE_URL),
|
|
661
|
+
normalize(env.WAVE_API_URL)
|
|
662
|
+
);
|
|
663
|
+
const organizationId = firstDefined(
|
|
664
|
+
normalize(options.organizationId),
|
|
665
|
+
normalize(stdin.organizationId),
|
|
666
|
+
normalize(env.WAVE_ORGANIZATION_ID),
|
|
667
|
+
normalize(env.WAVE_ORG_ID)
|
|
668
|
+
);
|
|
669
|
+
const timeoutMs = firstDefined(options.timeoutMs, stdin.timeoutMs, env.WAVE_TIMEOUT_MS);
|
|
670
|
+
const debug = firstDefined(
|
|
671
|
+
options.debug === true ? true : void 0,
|
|
672
|
+
stdin.debug,
|
|
673
|
+
parseBool(env.WAVE_DEBUG)
|
|
674
|
+
);
|
|
675
|
+
const agentName = firstDefined(
|
|
676
|
+
normalize(options.agentName),
|
|
677
|
+
normalize(stdin.agentName),
|
|
678
|
+
normalize(env.WAVE_AGENT_NAME)
|
|
679
|
+
);
|
|
680
|
+
const agentRunId = firstDefined(
|
|
681
|
+
normalize(options.agentRunId),
|
|
682
|
+
normalize(stdin.agentRunId),
|
|
683
|
+
normalize(env.WAVE_AGENT_RUN_ID)
|
|
684
|
+
);
|
|
685
|
+
const requestId = firstDefined(
|
|
686
|
+
normalize(options.requestId),
|
|
687
|
+
normalize(stdin.requestId),
|
|
688
|
+
normalize(env.WAVE_REQUEST_ID)
|
|
689
|
+
);
|
|
690
|
+
const openapiPath = firstDefined(
|
|
691
|
+
normalize(options.openapiPath),
|
|
692
|
+
normalize(stdin.openapiPath),
|
|
693
|
+
normalize(env.WAVE_OPENAPI_PATH)
|
|
694
|
+
);
|
|
695
|
+
const openapiUrl = firstDefined(
|
|
696
|
+
normalize(options.openapiUrl),
|
|
697
|
+
normalize(stdin.openapiUrl),
|
|
698
|
+
normalize(env.WAVE_OPENAPI_URL)
|
|
699
|
+
);
|
|
700
|
+
const openapiVersion = firstDefined(
|
|
701
|
+
normalize(options.openapiVersion),
|
|
702
|
+
normalize(stdin.openapiVersion),
|
|
703
|
+
normalize(env.WAVE_OPENAPI_VERSION)
|
|
704
|
+
);
|
|
564
705
|
return {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
706
|
+
organizationId,
|
|
707
|
+
runtimeOptions: {
|
|
708
|
+
token,
|
|
709
|
+
baseUrl,
|
|
710
|
+
timeoutMs,
|
|
711
|
+
debug,
|
|
712
|
+
agentName,
|
|
713
|
+
agentRunId,
|
|
714
|
+
requestId,
|
|
715
|
+
openapiPath,
|
|
716
|
+
openapiUrl,
|
|
717
|
+
openapiVersion
|
|
718
|
+
}
|
|
576
719
|
};
|
|
577
720
|
}
|
|
721
|
+
async function resolveStdinContext(options) {
|
|
722
|
+
if (options.tokenStdin && options.authJsonStdin) {
|
|
723
|
+
throw new CliError({
|
|
724
|
+
message: "Use only one stdin auth mode: --token-stdin or --auth-json-stdin.",
|
|
725
|
+
kind: "invalid_args",
|
|
726
|
+
status: 400,
|
|
727
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
if (!options.tokenStdin && !options.authJsonStdin) {
|
|
731
|
+
return {};
|
|
732
|
+
}
|
|
733
|
+
const raw = (await readStdinRaw()).trim();
|
|
734
|
+
if (!raw) {
|
|
735
|
+
throw new CliError({
|
|
736
|
+
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.",
|
|
737
|
+
kind: "invalid_args",
|
|
738
|
+
status: 400,
|
|
739
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
if (options.tokenStdin) {
|
|
743
|
+
const token = normalize(raw);
|
|
744
|
+
if (!token) {
|
|
745
|
+
throw new CliError({
|
|
746
|
+
message: "Invalid stdin token. Token value is empty.",
|
|
747
|
+
kind: "invalid_args",
|
|
748
|
+
status: 400,
|
|
749
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
return { token };
|
|
753
|
+
}
|
|
754
|
+
return parseAuthJson(raw);
|
|
755
|
+
}
|
|
756
|
+
async function resolveCommandContext(options) {
|
|
757
|
+
const stdin = await resolveStdinContext(options);
|
|
758
|
+
return resolveFromSources(options, stdin, process.env);
|
|
759
|
+
}
|
|
578
760
|
|
|
579
761
|
// src/commands/organization.ts
|
|
580
|
-
function
|
|
762
|
+
function normalize2(input) {
|
|
581
763
|
if (!input) {
|
|
582
764
|
return void 0;
|
|
583
765
|
}
|
|
@@ -585,10 +767,10 @@ function normalize(input) {
|
|
|
585
767
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
586
768
|
}
|
|
587
769
|
function resolveOrganizationId(raw) {
|
|
588
|
-
const organizationId =
|
|
770
|
+
const organizationId = normalize2(raw);
|
|
589
771
|
if (!organizationId) {
|
|
590
772
|
throw new CliError({
|
|
591
|
-
message: "Missing organization ID.
|
|
773
|
+
message: "Missing organization ID. Pass --organization-id, provide via --auth-json-stdin, or set WAVE_ORGANIZATION_ID.",
|
|
592
774
|
kind: "invalid_args",
|
|
593
775
|
status: 400,
|
|
594
776
|
exitCode: EXIT_CODES.invalidArgs
|
|
@@ -1264,8 +1446,8 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1264
1446
|
list.option(`--${cliParam} <${cliParam}>`);
|
|
1265
1447
|
});
|
|
1266
1448
|
list.option("--query-json <queryJson>", "Additional query params as JSON object").action(async (opts, cmd) => {
|
|
1267
|
-
const
|
|
1268
|
-
const organizationId = resolveOrganizationId(
|
|
1449
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1450
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1269
1451
|
const extraQuery = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1270
1452
|
const mappedKnownParams = Object.fromEntries(
|
|
1271
1453
|
listParams.map((param) => {
|
|
@@ -1282,7 +1464,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1282
1464
|
});
|
|
1283
1465
|
await runGraphqlQueryCommand({
|
|
1284
1466
|
command: `${config.command}.list`,
|
|
1285
|
-
runtimeOptions:
|
|
1467
|
+
runtimeOptions: context.runtimeOptions,
|
|
1286
1468
|
field: config.resourcePath === "feedback" ? "feedbacks" : config.resourcePath,
|
|
1287
1469
|
variables,
|
|
1288
1470
|
isList: true
|
|
@@ -1290,11 +1472,11 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1290
1472
|
});
|
|
1291
1473
|
entityCommand.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1292
1474
|
const id = idSchema.parse(opts.id);
|
|
1293
|
-
const
|
|
1294
|
-
const organizationId = resolveOrganizationId(
|
|
1475
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1476
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1295
1477
|
await runGraphqlQueryCommand({
|
|
1296
1478
|
command: `${config.command}.show`,
|
|
1297
|
-
runtimeOptions:
|
|
1479
|
+
runtimeOptions: context.runtimeOptions,
|
|
1298
1480
|
field: config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath),
|
|
1299
1481
|
variables: normalizeGraphqlVariables2({
|
|
1300
1482
|
organization_id: organizationId,
|
|
@@ -1304,13 +1486,13 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1304
1486
|
});
|
|
1305
1487
|
});
|
|
1306
1488
|
entityCommand.command("create").requiredOption("--data-json <dataJson>", createHelp4).action(async (opts, cmd) => {
|
|
1307
|
-
const
|
|
1308
|
-
const organizationId = resolveOrganizationId(
|
|
1489
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1490
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1309
1491
|
const body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
1310
1492
|
assertRequiredCreateFields(body, config.rootKey, config.requiredCreateFields);
|
|
1311
1493
|
await runGraphqlMutationCommand({
|
|
1312
1494
|
command: `${config.command}.create`,
|
|
1313
|
-
runtimeOptions:
|
|
1495
|
+
runtimeOptions: context.runtimeOptions,
|
|
1314
1496
|
field: `create_${toSingularResourceName(config.resourcePath)}`,
|
|
1315
1497
|
variables: {
|
|
1316
1498
|
organization_id: organizationId,
|
|
@@ -1320,13 +1502,13 @@ function registerEntityCrudCommands(program, config) {
|
|
|
1320
1502
|
});
|
|
1321
1503
|
entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5).action(async (opts, cmd) => {
|
|
1322
1504
|
const id = idSchema.parse(opts.id);
|
|
1323
|
-
const
|
|
1324
|
-
const organizationId = resolveOrganizationId(
|
|
1505
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1506
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1325
1507
|
const body = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
1326
1508
|
const singular = toSingularResourceName(config.resourcePath);
|
|
1327
1509
|
await runGraphqlMutationCommand({
|
|
1328
1510
|
command: `${config.command}.update`,
|
|
1329
|
-
runtimeOptions:
|
|
1511
|
+
runtimeOptions: context.runtimeOptions,
|
|
1330
1512
|
field: `update_${singular}`,
|
|
1331
1513
|
variables: {
|
|
1332
1514
|
organization_id: organizationId,
|
|
@@ -1351,13 +1533,13 @@ var summarySchema = z3.string().min(1);
|
|
|
1351
1533
|
function registerTaskCommands(program) {
|
|
1352
1534
|
const tasks = program.command("tasks").description("Task operations");
|
|
1353
1535
|
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) => {
|
|
1354
|
-
const
|
|
1355
|
-
const organizationId = resolveOrganizationId(
|
|
1536
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1537
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1356
1538
|
const projectId = opts.projectId ? projectIdSchema.parse(opts.projectId) : void 0;
|
|
1357
1539
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1358
1540
|
await runGraphqlQueryCommand({
|
|
1359
1541
|
command: "tasks.list",
|
|
1360
|
-
runtimeOptions:
|
|
1542
|
+
runtimeOptions: context.runtimeOptions,
|
|
1361
1543
|
field: "tasks",
|
|
1362
1544
|
variables: normalizeGraphqlVariables2({
|
|
1363
1545
|
organization_id: organizationId,
|
|
@@ -1380,11 +1562,11 @@ function registerTaskCommands(program) {
|
|
|
1380
1562
|
});
|
|
1381
1563
|
tasks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1382
1564
|
const parsed = idSchema2.parse(opts.id);
|
|
1383
|
-
const
|
|
1384
|
-
const organizationId = resolveOrganizationId(
|
|
1565
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1566
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1385
1567
|
await runGraphqlQueryCommand({
|
|
1386
1568
|
command: "tasks.show",
|
|
1387
|
-
runtimeOptions:
|
|
1569
|
+
runtimeOptions: context.runtimeOptions,
|
|
1388
1570
|
field: "task",
|
|
1389
1571
|
variables: {
|
|
1390
1572
|
organization_id: organizationId,
|
|
@@ -1396,11 +1578,11 @@ function registerTaskCommands(program) {
|
|
|
1396
1578
|
tasks.command("create").requiredOption("--project-id <projectId>").option("--title <title>", "Legacy alias for --summary").option("--summary <summary>").action(async (opts, cmd) => {
|
|
1397
1579
|
const projectId = projectIdSchema.parse(opts.projectId);
|
|
1398
1580
|
const summary = summarySchema.parse(opts.summary ?? opts.title);
|
|
1399
|
-
const
|
|
1400
|
-
const organizationId = resolveOrganizationId(
|
|
1581
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1582
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1401
1583
|
await runGraphqlMutationCommand({
|
|
1402
1584
|
command: "tasks.create",
|
|
1403
|
-
runtimeOptions:
|
|
1585
|
+
runtimeOptions: context.runtimeOptions,
|
|
1404
1586
|
field: "create_task",
|
|
1405
1587
|
variables: {
|
|
1406
1588
|
organization_id: organizationId,
|
|
@@ -1415,8 +1597,8 @@ function registerTaskCommands(program) {
|
|
|
1415
1597
|
});
|
|
1416
1598
|
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) => {
|
|
1417
1599
|
const id = idSchema2.parse(opts.id);
|
|
1418
|
-
const
|
|
1419
|
-
const organizationId = resolveOrganizationId(
|
|
1600
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1601
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1420
1602
|
const taskPayload = {
|
|
1421
1603
|
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
1422
1604
|
...opts.description ? { description: String(opts.description) } : {},
|
|
@@ -1435,7 +1617,7 @@ function registerTaskCommands(program) {
|
|
|
1435
1617
|
}
|
|
1436
1618
|
await runGraphqlMutationCommand({
|
|
1437
1619
|
command: "tasks.update",
|
|
1438
|
-
runtimeOptions:
|
|
1620
|
+
runtimeOptions: context.runtimeOptions,
|
|
1439
1621
|
field: "update_task",
|
|
1440
1622
|
variables: {
|
|
1441
1623
|
organization_id: organizationId,
|
|
@@ -1456,12 +1638,12 @@ var projectUpdateDataJsonHelp = buildDataJsonHelp("project", "update") ?? 'JSON
|
|
|
1456
1638
|
function registerProjectCommands(program) {
|
|
1457
1639
|
const projects = program.command("projects").description("Project operations");
|
|
1458
1640
|
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) => {
|
|
1459
|
-
const
|
|
1460
|
-
const organizationId = resolveOrganizationId(
|
|
1641
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1642
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1461
1643
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1462
1644
|
await runGraphqlQueryCommand({
|
|
1463
1645
|
command: "projects.list",
|
|
1464
|
-
runtimeOptions:
|
|
1646
|
+
runtimeOptions: context.runtimeOptions,
|
|
1465
1647
|
field: "projects",
|
|
1466
1648
|
variables: normalizeGraphqlVariables2({
|
|
1467
1649
|
organization_id: organizationId,
|
|
@@ -1479,11 +1661,11 @@ function registerProjectCommands(program) {
|
|
|
1479
1661
|
});
|
|
1480
1662
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1481
1663
|
const id = idSchema3.parse(opts.id);
|
|
1482
|
-
const
|
|
1483
|
-
const organizationId = resolveOrganizationId(
|
|
1664
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1665
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1484
1666
|
await runGraphqlQueryCommand({
|
|
1485
1667
|
command: "projects.show",
|
|
1486
|
-
runtimeOptions:
|
|
1668
|
+
runtimeOptions: context.runtimeOptions,
|
|
1487
1669
|
field: "project",
|
|
1488
1670
|
variables: {
|
|
1489
1671
|
organization_id: organizationId,
|
|
@@ -1493,12 +1675,12 @@ function registerProjectCommands(program) {
|
|
|
1493
1675
|
});
|
|
1494
1676
|
});
|
|
1495
1677
|
projects.command("create").requiredOption("--data-json <dataJson>", projectCreateDataJsonHelp).action(async (opts, cmd) => {
|
|
1496
|
-
const
|
|
1497
|
-
const organizationId = resolveOrganizationId(
|
|
1678
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1679
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1498
1680
|
const body = __testables.normalizeBody(String(opts.dataJson), "project");
|
|
1499
1681
|
await runGraphqlMutationCommand({
|
|
1500
1682
|
command: "projects.create",
|
|
1501
|
-
runtimeOptions:
|
|
1683
|
+
runtimeOptions: context.runtimeOptions,
|
|
1502
1684
|
field: "create_project",
|
|
1503
1685
|
variables: {
|
|
1504
1686
|
organization_id: organizationId,
|
|
@@ -1508,12 +1690,12 @@ function registerProjectCommands(program) {
|
|
|
1508
1690
|
});
|
|
1509
1691
|
projects.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", projectUpdateDataJsonHelp).action(async (opts, cmd) => {
|
|
1510
1692
|
const id = idSchema3.parse(opts.id);
|
|
1511
|
-
const
|
|
1512
|
-
const organizationId = resolveOrganizationId(
|
|
1693
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1694
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1513
1695
|
const body = __testables.normalizeBody(String(opts.dataJson), "project");
|
|
1514
1696
|
await runGraphqlMutationCommand({
|
|
1515
1697
|
command: "projects.update",
|
|
1516
|
-
runtimeOptions:
|
|
1698
|
+
runtimeOptions: context.runtimeOptions,
|
|
1517
1699
|
field: "update_project",
|
|
1518
1700
|
variables: {
|
|
1519
1701
|
organization_id: organizationId,
|
|
@@ -1534,13 +1716,13 @@ var updateHelp = buildDataJsonHelp("rock", "update") ?? 'JSON object for rock or
|
|
|
1534
1716
|
function registerRockCommands(program) {
|
|
1535
1717
|
const rocks = program.command("rocks").description("Rock operations");
|
|
1536
1718
|
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) => {
|
|
1537
|
-
const
|
|
1538
|
-
const organizationId = resolveOrganizationId(
|
|
1719
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1720
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1539
1721
|
const rockCollectionId = opts.rockCollectionId ? rockCollectionIdSchema.parse(opts.rockCollectionId) : void 0;
|
|
1540
1722
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1541
1723
|
await runGraphqlQueryCommand({
|
|
1542
1724
|
command: "rocks.list",
|
|
1543
|
-
runtimeOptions:
|
|
1725
|
+
runtimeOptions: context.runtimeOptions,
|
|
1544
1726
|
field: "rocks",
|
|
1545
1727
|
variables: normalizeGraphqlVariables2({
|
|
1546
1728
|
organization_id: organizationId,
|
|
@@ -1565,11 +1747,11 @@ function registerRockCommands(program) {
|
|
|
1565
1747
|
});
|
|
1566
1748
|
rocks.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1567
1749
|
const id = idSchema4.parse(opts.id);
|
|
1568
|
-
const
|
|
1569
|
-
const organizationId = resolveOrganizationId(
|
|
1750
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1751
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1570
1752
|
await runGraphqlQueryCommand({
|
|
1571
1753
|
command: "rocks.show",
|
|
1572
|
-
runtimeOptions:
|
|
1754
|
+
runtimeOptions: context.runtimeOptions,
|
|
1573
1755
|
field: "rock",
|
|
1574
1756
|
variables: {
|
|
1575
1757
|
organization_id: organizationId,
|
|
@@ -1581,11 +1763,11 @@ function registerRockCommands(program) {
|
|
|
1581
1763
|
rocks.command("update-status").requiredOption("--id <id>").requiredOption("--status <status>").action(async (opts, cmd) => {
|
|
1582
1764
|
const id = idSchema4.parse(opts.id);
|
|
1583
1765
|
const status = statusSchema.parse(opts.status);
|
|
1584
|
-
const
|
|
1585
|
-
const organizationId = resolveOrganizationId(
|
|
1766
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1767
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1586
1768
|
await runGraphqlMutationCommand({
|
|
1587
1769
|
command: "rocks.update-status",
|
|
1588
|
-
runtimeOptions:
|
|
1770
|
+
runtimeOptions: context.runtimeOptions,
|
|
1589
1771
|
field: "update_rock",
|
|
1590
1772
|
variables: {
|
|
1591
1773
|
organization_id: organizationId,
|
|
@@ -1595,13 +1777,13 @@ function registerRockCommands(program) {
|
|
|
1595
1777
|
});
|
|
1596
1778
|
});
|
|
1597
1779
|
rocks.command("create").requiredOption("--data-json <dataJson>", createHelp).action(async (opts, cmd) => {
|
|
1598
|
-
const
|
|
1599
|
-
const organizationId = resolveOrganizationId(
|
|
1780
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1781
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1600
1782
|
const body = __testables.normalizeBody(String(opts.dataJson), "rock");
|
|
1601
1783
|
__testables.assertRequiredCreateFields(body, "rock", ["rock_collection_id"]);
|
|
1602
1784
|
await runGraphqlMutationCommand({
|
|
1603
1785
|
command: "rocks.create",
|
|
1604
|
-
runtimeOptions:
|
|
1786
|
+
runtimeOptions: context.runtimeOptions,
|
|
1605
1787
|
field: "create_rock",
|
|
1606
1788
|
variables: {
|
|
1607
1789
|
organization_id: organizationId,
|
|
@@ -1611,12 +1793,12 @@ function registerRockCommands(program) {
|
|
|
1611
1793
|
});
|
|
1612
1794
|
rocks.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp).action(async (opts, cmd) => {
|
|
1613
1795
|
const id = idSchema4.parse(opts.id);
|
|
1614
|
-
const
|
|
1615
|
-
const organizationId = resolveOrganizationId(
|
|
1796
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1797
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1616
1798
|
const body = __testables.normalizeBody(String(opts.dataJson), "rock");
|
|
1617
1799
|
await runGraphqlMutationCommand({
|
|
1618
1800
|
command: "rocks.update",
|
|
1619
|
-
runtimeOptions:
|
|
1801
|
+
runtimeOptions: context.runtimeOptions,
|
|
1620
1802
|
field: "update_rock",
|
|
1621
1803
|
variables: {
|
|
1622
1804
|
organization_id: organizationId,
|
|
@@ -1636,12 +1818,12 @@ var updateHelp2 = buildDataJsonHelp("meeting", "update") ?? 'JSON object for mee
|
|
|
1636
1818
|
function registerMeetingCommands(program) {
|
|
1637
1819
|
const meetings = program.command("meetings").description("Meeting operations");
|
|
1638
1820
|
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) => {
|
|
1639
|
-
const
|
|
1640
|
-
const organizationId = resolveOrganizationId(
|
|
1821
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1822
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1641
1823
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1642
1824
|
await runGraphqlQueryCommand({
|
|
1643
1825
|
command: "meetings.list",
|
|
1644
|
-
runtimeOptions:
|
|
1826
|
+
runtimeOptions: context.runtimeOptions,
|
|
1645
1827
|
field: "meetings",
|
|
1646
1828
|
variables: normalizeGraphqlVariables2({
|
|
1647
1829
|
organization_id: organizationId,
|
|
@@ -1659,11 +1841,11 @@ function registerMeetingCommands(program) {
|
|
|
1659
1841
|
});
|
|
1660
1842
|
meetings.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1661
1843
|
const id = idSchema5.parse(opts.id);
|
|
1662
|
-
const
|
|
1663
|
-
const organizationId = resolveOrganizationId(
|
|
1844
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1845
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1664
1846
|
await runGraphqlQueryCommand({
|
|
1665
1847
|
command: "meetings.show",
|
|
1666
|
-
runtimeOptions:
|
|
1848
|
+
runtimeOptions: context.runtimeOptions,
|
|
1667
1849
|
field: "meeting",
|
|
1668
1850
|
variables: {
|
|
1669
1851
|
organization_id: organizationId,
|
|
@@ -1675,11 +1857,11 @@ function registerMeetingCommands(program) {
|
|
|
1675
1857
|
meetings.command("notes").requiredOption("--id <id>").requiredOption("--content <content>").action(async (opts, cmd) => {
|
|
1676
1858
|
const id = idSchema5.parse(opts.id);
|
|
1677
1859
|
const notes = notesSchema.parse(opts.content);
|
|
1678
|
-
const
|
|
1679
|
-
const organizationId = resolveOrganizationId(
|
|
1860
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1861
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1680
1862
|
await runGraphqlMutationCommand({
|
|
1681
1863
|
command: "meeting-notes.create",
|
|
1682
|
-
runtimeOptions:
|
|
1864
|
+
runtimeOptions: context.runtimeOptions,
|
|
1683
1865
|
field: "update_meeting",
|
|
1684
1866
|
variables: {
|
|
1685
1867
|
organization_id: organizationId,
|
|
@@ -1693,12 +1875,12 @@ function registerMeetingCommands(program) {
|
|
|
1693
1875
|
});
|
|
1694
1876
|
});
|
|
1695
1877
|
meetings.command("create").requiredOption("--data-json <dataJson>", createHelp2).action(async (opts, cmd) => {
|
|
1696
|
-
const
|
|
1697
|
-
const organizationId = resolveOrganizationId(
|
|
1878
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1879
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1698
1880
|
const body = __testables.normalizeBody(String(opts.dataJson), "meeting");
|
|
1699
1881
|
await runGraphqlMutationCommand({
|
|
1700
1882
|
command: "meetings.create",
|
|
1701
|
-
runtimeOptions:
|
|
1883
|
+
runtimeOptions: context.runtimeOptions,
|
|
1702
1884
|
field: "create_meeting",
|
|
1703
1885
|
variables: {
|
|
1704
1886
|
organization_id: organizationId,
|
|
@@ -1708,12 +1890,12 @@ function registerMeetingCommands(program) {
|
|
|
1708
1890
|
});
|
|
1709
1891
|
meetings.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp2).action(async (opts, cmd) => {
|
|
1710
1892
|
const id = idSchema5.parse(opts.id);
|
|
1711
|
-
const
|
|
1712
|
-
const organizationId = resolveOrganizationId(
|
|
1893
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1894
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1713
1895
|
const body = __testables.normalizeBody(String(opts.dataJson), "meeting");
|
|
1714
1896
|
await runGraphqlMutationCommand({
|
|
1715
1897
|
command: "meetings.update",
|
|
1716
|
-
runtimeOptions:
|
|
1898
|
+
runtimeOptions: context.runtimeOptions,
|
|
1717
1899
|
field: "update_meeting",
|
|
1718
1900
|
variables: {
|
|
1719
1901
|
organization_id: organizationId,
|
|
@@ -1732,12 +1914,12 @@ var updateHelp3 = buildDataJsonHelp("member", "update") ?? 'JSON object for memb
|
|
|
1732
1914
|
function registerMemberCommands(program) {
|
|
1733
1915
|
const members = program.command("members").description("Member operations");
|
|
1734
1916
|
members.command("list").option("--page <page>").option("--per <per>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
1735
|
-
const
|
|
1736
|
-
const organizationId = resolveOrganizationId(
|
|
1917
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1918
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1737
1919
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1738
1920
|
await runGraphqlQueryCommand({
|
|
1739
1921
|
command: "members.list",
|
|
1740
|
-
runtimeOptions:
|
|
1922
|
+
runtimeOptions: context.runtimeOptions,
|
|
1741
1923
|
field: "members",
|
|
1742
1924
|
variables: normalizeGraphqlVariables2({
|
|
1743
1925
|
organization_id: organizationId,
|
|
@@ -1750,11 +1932,11 @@ function registerMemberCommands(program) {
|
|
|
1750
1932
|
});
|
|
1751
1933
|
members.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1752
1934
|
const id = idSchema6.parse(opts.id);
|
|
1753
|
-
const
|
|
1754
|
-
const organizationId = resolveOrganizationId(
|
|
1935
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1936
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1755
1937
|
await runGraphqlQueryCommand({
|
|
1756
1938
|
command: "members.show",
|
|
1757
|
-
runtimeOptions:
|
|
1939
|
+
runtimeOptions: context.runtimeOptions,
|
|
1758
1940
|
field: "member",
|
|
1759
1941
|
variables: {
|
|
1760
1942
|
organization_id: organizationId,
|
|
@@ -1764,12 +1946,12 @@ function registerMemberCommands(program) {
|
|
|
1764
1946
|
});
|
|
1765
1947
|
});
|
|
1766
1948
|
members.command("create").requiredOption("--data-json <dataJson>", createHelp3).action(async (opts, cmd) => {
|
|
1767
|
-
const
|
|
1768
|
-
const organizationId = resolveOrganizationId(
|
|
1949
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1950
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1769
1951
|
const body = __testables.normalizeBody(String(opts.dataJson), "member");
|
|
1770
1952
|
await runGraphqlMutationCommand({
|
|
1771
1953
|
command: "members.create",
|
|
1772
|
-
runtimeOptions:
|
|
1954
|
+
runtimeOptions: context.runtimeOptions,
|
|
1773
1955
|
field: "create_member",
|
|
1774
1956
|
variables: {
|
|
1775
1957
|
organization_id: organizationId,
|
|
@@ -1779,12 +1961,12 @@ function registerMemberCommands(program) {
|
|
|
1779
1961
|
});
|
|
1780
1962
|
members.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp3).action(async (opts, cmd) => {
|
|
1781
1963
|
const id = idSchema6.parse(opts.id);
|
|
1782
|
-
const
|
|
1783
|
-
const organizationId = resolveOrganizationId(
|
|
1964
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1965
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1784
1966
|
const body = __testables.normalizeBody(String(opts.dataJson), "member");
|
|
1785
1967
|
await runGraphqlMutationCommand({
|
|
1786
1968
|
command: "members.update",
|
|
1787
|
-
runtimeOptions:
|
|
1969
|
+
runtimeOptions: context.runtimeOptions,
|
|
1788
1970
|
field: "update_member",
|
|
1789
1971
|
variables: {
|
|
1790
1972
|
organization_id: organizationId,
|
|
@@ -1805,12 +1987,12 @@ var updateHelp4 = buildDataJsonHelp("issue", "update") ?? 'JSON object for issue
|
|
|
1805
1987
|
function registerIssueCommands(program) {
|
|
1806
1988
|
const issues = program.command("issues").description("Issue operations");
|
|
1807
1989
|
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) => {
|
|
1808
|
-
const
|
|
1809
|
-
const organizationId = resolveOrganizationId(
|
|
1990
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
1991
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1810
1992
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
1811
1993
|
await runGraphqlQueryCommand({
|
|
1812
1994
|
command: "issues.list",
|
|
1813
|
-
runtimeOptions:
|
|
1995
|
+
runtimeOptions: context.runtimeOptions,
|
|
1814
1996
|
field: "issues",
|
|
1815
1997
|
variables: normalizeGraphqlVariables2({
|
|
1816
1998
|
organization_id: organizationId,
|
|
@@ -1830,11 +2012,11 @@ function registerIssueCommands(program) {
|
|
|
1830
2012
|
});
|
|
1831
2013
|
issues.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
1832
2014
|
const id = idSchema7.parse(opts.id);
|
|
1833
|
-
const
|
|
1834
|
-
const organizationId = resolveOrganizationId(
|
|
2015
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2016
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1835
2017
|
await runGraphqlQueryCommand({
|
|
1836
2018
|
command: "issues.show",
|
|
1837
|
-
runtimeOptions:
|
|
2019
|
+
runtimeOptions: context.runtimeOptions,
|
|
1838
2020
|
field: "issue",
|
|
1839
2021
|
variables: {
|
|
1840
2022
|
organization_id: organizationId,
|
|
@@ -1847,11 +2029,11 @@ function registerIssueCommands(program) {
|
|
|
1847
2029
|
const issueGroupId = issueGroupIdSchema.parse(opts.issueGroupId);
|
|
1848
2030
|
const name = nameSchema.parse(opts.name);
|
|
1849
2031
|
const issueType = issueTypeSchema.parse(opts.issueType);
|
|
1850
|
-
const
|
|
1851
|
-
const organizationId = resolveOrganizationId(
|
|
2032
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2033
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1852
2034
|
await runGraphqlMutationCommand({
|
|
1853
2035
|
command: "issues.create",
|
|
1854
|
-
runtimeOptions:
|
|
2036
|
+
runtimeOptions: context.runtimeOptions,
|
|
1855
2037
|
field: "create_issue",
|
|
1856
2038
|
variables: {
|
|
1857
2039
|
organization_id: organizationId,
|
|
@@ -1872,12 +2054,12 @@ function registerIssueCommands(program) {
|
|
|
1872
2054
|
});
|
|
1873
2055
|
issues.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp4).action(async (opts, cmd) => {
|
|
1874
2056
|
const id = idSchema7.parse(opts.id);
|
|
1875
|
-
const
|
|
1876
|
-
const organizationId = resolveOrganizationId(
|
|
2057
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2058
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
1877
2059
|
const body = __testables.normalizeBody(String(opts.dataJson), "issue");
|
|
1878
2060
|
await runGraphqlMutationCommand({
|
|
1879
2061
|
command: "issues.update",
|
|
1880
|
-
runtimeOptions:
|
|
2062
|
+
runtimeOptions: context.runtimeOptions,
|
|
1881
2063
|
field: "update_issue",
|
|
1882
2064
|
variables: {
|
|
1883
2065
|
organization_id: organizationId,
|
|
@@ -2090,12 +2272,12 @@ var idSchema8 = z9.string().min(1);
|
|
|
2090
2272
|
function registerTeamCommands(program) {
|
|
2091
2273
|
const teams = program.command("teams").description("Team operations");
|
|
2092
2274
|
teams.command("list").option("--page <page>").option("--per <per>").option("--query-json <queryJson>").action(async (opts, cmd) => {
|
|
2093
|
-
const
|
|
2094
|
-
const organizationId = resolveOrganizationId(
|
|
2275
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2276
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2095
2277
|
const extra = parseQueryJson(opts.queryJson ? String(opts.queryJson) : void 0);
|
|
2096
2278
|
await runGraphqlQueryCommand({
|
|
2097
2279
|
command: "teams.list",
|
|
2098
|
-
runtimeOptions:
|
|
2280
|
+
runtimeOptions: context.runtimeOptions,
|
|
2099
2281
|
field: "teams",
|
|
2100
2282
|
variables: normalizeGraphqlVariables2({
|
|
2101
2283
|
organization_id: organizationId,
|
|
@@ -2108,11 +2290,11 @@ function registerTeamCommands(program) {
|
|
|
2108
2290
|
});
|
|
2109
2291
|
teams.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
2110
2292
|
const id = idSchema8.parse(opts.id);
|
|
2111
|
-
const
|
|
2112
|
-
const organizationId = resolveOrganizationId(
|
|
2293
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2294
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2113
2295
|
await runGraphqlQueryCommand({
|
|
2114
2296
|
command: "teams.show",
|
|
2115
|
-
runtimeOptions:
|
|
2297
|
+
runtimeOptions: context.runtimeOptions,
|
|
2116
2298
|
field: "team",
|
|
2117
2299
|
variables: {
|
|
2118
2300
|
organization_id: organizationId,
|
|
@@ -2122,12 +2304,12 @@ function registerTeamCommands(program) {
|
|
|
2122
2304
|
});
|
|
2123
2305
|
});
|
|
2124
2306
|
teams.command("create").requiredOption("--data-json <dataJson>", 'JSON object for team or {"team": {...}}').action(async (opts, cmd) => {
|
|
2125
|
-
const
|
|
2126
|
-
const organizationId = resolveOrganizationId(
|
|
2307
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2308
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2127
2309
|
const body = __testables.normalizeBody(String(opts.dataJson), "team");
|
|
2128
2310
|
await runGraphqlMutationCommand({
|
|
2129
2311
|
command: "teams.create",
|
|
2130
|
-
runtimeOptions:
|
|
2312
|
+
runtimeOptions: context.runtimeOptions,
|
|
2131
2313
|
field: "create_team",
|
|
2132
2314
|
variables: {
|
|
2133
2315
|
organization_id: organizationId,
|
|
@@ -2137,12 +2319,12 @@ function registerTeamCommands(program) {
|
|
|
2137
2319
|
});
|
|
2138
2320
|
teams.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", 'JSON object for team or {"team": {...}}').action(async (opts, cmd) => {
|
|
2139
2321
|
const id = idSchema8.parse(opts.id);
|
|
2140
|
-
const
|
|
2141
|
-
const organizationId = resolveOrganizationId(
|
|
2322
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2323
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2142
2324
|
const body = __testables.normalizeBody(String(opts.dataJson), "team");
|
|
2143
2325
|
await runGraphqlMutationCommand({
|
|
2144
2326
|
command: "teams.update",
|
|
2145
|
-
runtimeOptions:
|
|
2327
|
+
runtimeOptions: context.runtimeOptions,
|
|
2146
2328
|
field: "update_team",
|
|
2147
2329
|
variables: {
|
|
2148
2330
|
organization_id: organizationId,
|
|
@@ -2159,12 +2341,12 @@ var idSchema9 = z10.string().min(1);
|
|
|
2159
2341
|
function registerOrganizationCommands(program) {
|
|
2160
2342
|
const organizations = program.command("organizations").description("Organization operations");
|
|
2161
2343
|
organizations.command("show").option("--id <id>", "Organization ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
2162
|
-
const
|
|
2163
|
-
const fallbackId = resolveOrganizationId(
|
|
2344
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2345
|
+
const fallbackId = resolveOrganizationId(context.organizationId);
|
|
2164
2346
|
const id = idSchema9.parse(opts.id ?? fallbackId);
|
|
2165
2347
|
await runGraphqlQueryCommand({
|
|
2166
2348
|
command: "organizations.show",
|
|
2167
|
-
runtimeOptions:
|
|
2349
|
+
runtimeOptions: context.runtimeOptions,
|
|
2168
2350
|
field: "organization",
|
|
2169
2351
|
variables: { id },
|
|
2170
2352
|
isShow: true
|
|
@@ -2174,13 +2356,13 @@ function registerOrganizationCommands(program) {
|
|
|
2174
2356
|
"--data-json <dataJson>",
|
|
2175
2357
|
'JSON object for organization or {"organization": {...}}'
|
|
2176
2358
|
).action(async (opts, cmd) => {
|
|
2177
|
-
const
|
|
2178
|
-
const fallbackId = resolveOrganizationId(
|
|
2359
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2360
|
+
const fallbackId = resolveOrganizationId(context.organizationId);
|
|
2179
2361
|
const id = idSchema9.parse(opts.id ?? fallbackId);
|
|
2180
2362
|
const body = __testables.normalizeBody(String(opts.dataJson), "organization");
|
|
2181
2363
|
await runGraphqlMutationCommand({
|
|
2182
2364
|
command: "organizations.update",
|
|
2183
|
-
runtimeOptions:
|
|
2365
|
+
runtimeOptions: context.runtimeOptions,
|
|
2184
2366
|
field: "update_organization",
|
|
2185
2367
|
variables: {
|
|
2186
2368
|
id,
|
|
@@ -2190,12 +2372,12 @@ function registerOrganizationCommands(program) {
|
|
|
2190
2372
|
});
|
|
2191
2373
|
const metaProfile = organizations.command("meta-profile").description("Organization meta profile operations");
|
|
2192
2374
|
metaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
2193
|
-
const
|
|
2194
|
-
const organizationId = resolveOrganizationId(
|
|
2375
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2376
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2195
2377
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2196
2378
|
await runGraphqlQueryCommand({
|
|
2197
2379
|
command: "organizations.meta-profile.show",
|
|
2198
|
-
runtimeOptions:
|
|
2380
|
+
runtimeOptions: context.runtimeOptions,
|
|
2199
2381
|
field: "organization_meta_profile",
|
|
2200
2382
|
variables: {
|
|
2201
2383
|
organization_id: organizationId,
|
|
@@ -2208,8 +2390,8 @@ function registerOrganizationCommands(program) {
|
|
|
2208
2390
|
"--data-json <dataJson>",
|
|
2209
2391
|
'JSON object for organization_meta_profile or {"organization_meta_profile": {...}}'
|
|
2210
2392
|
).action(async (opts, cmd) => {
|
|
2211
|
-
const
|
|
2212
|
-
const organizationId = resolveOrganizationId(
|
|
2393
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2394
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2213
2395
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2214
2396
|
const body = __testables.normalizeBody(
|
|
2215
2397
|
String(opts.dataJson),
|
|
@@ -2217,7 +2399,7 @@ function registerOrganizationCommands(program) {
|
|
|
2217
2399
|
);
|
|
2218
2400
|
await runGraphqlMutationCommand({
|
|
2219
2401
|
command: "organizations.meta-profile.update",
|
|
2220
|
-
runtimeOptions:
|
|
2402
|
+
runtimeOptions: context.runtimeOptions,
|
|
2221
2403
|
field: "update_organization_meta_profile",
|
|
2222
2404
|
variables: {
|
|
2223
2405
|
organization_id: organizationId,
|
|
@@ -2228,12 +2410,12 @@ function registerOrganizationCommands(program) {
|
|
|
2228
2410
|
});
|
|
2229
2411
|
const keyMetricMetaProfile = organizations.command("key-metric-meta-profile").description("Key metric meta profile operations");
|
|
2230
2412
|
keyMetricMetaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
2231
|
-
const
|
|
2232
|
-
const organizationId = resolveOrganizationId(
|
|
2413
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2414
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2233
2415
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2234
2416
|
await runGraphqlQueryCommand({
|
|
2235
2417
|
command: "organizations.key-metric-meta-profile.show",
|
|
2236
|
-
runtimeOptions:
|
|
2418
|
+
runtimeOptions: context.runtimeOptions,
|
|
2237
2419
|
field: "key_metric_meta_profile",
|
|
2238
2420
|
variables: {
|
|
2239
2421
|
organization_id: organizationId,
|
|
@@ -2246,8 +2428,8 @@ function registerOrganizationCommands(program) {
|
|
|
2246
2428
|
"--data-json <dataJson>",
|
|
2247
2429
|
'JSON object for key_metric_meta_profile or {"key_metric_meta_profile": {...}}'
|
|
2248
2430
|
).action(async (opts, cmd) => {
|
|
2249
|
-
const
|
|
2250
|
-
const organizationId = resolveOrganizationId(
|
|
2431
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2432
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2251
2433
|
const id = idSchema9.parse(opts.id ?? organizationId);
|
|
2252
2434
|
const body = __testables.normalizeBody(
|
|
2253
2435
|
String(opts.dataJson),
|
|
@@ -2255,7 +2437,7 @@ function registerOrganizationCommands(program) {
|
|
|
2255
2437
|
);
|
|
2256
2438
|
await runGraphqlMutationCommand({
|
|
2257
2439
|
command: "organizations.key-metric-meta-profile.update",
|
|
2258
|
-
runtimeOptions:
|
|
2440
|
+
runtimeOptions: context.runtimeOptions,
|
|
2259
2441
|
field: "update_key_metric_meta_profile",
|
|
2260
2442
|
variables: {
|
|
2261
2443
|
organization_id: organizationId,
|
|
@@ -2274,12 +2456,12 @@ function registerFoundationCommands(program) {
|
|
|
2274
2456
|
const strategicPlans = foundation.command("strategic-plans").description("Strategic plan operations");
|
|
2275
2457
|
const strategicObjectives = foundation.command("strategic-objectives").description("Strategic objective operations");
|
|
2276
2458
|
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) => {
|
|
2277
|
-
const
|
|
2278
|
-
const organizationId = resolveOrganizationId(
|
|
2459
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2460
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2279
2461
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2280
2462
|
await runGraphqlQueryCommand({
|
|
2281
2463
|
command: "foundation.strategic-plans.show",
|
|
2282
|
-
runtimeOptions:
|
|
2464
|
+
runtimeOptions: context.runtimeOptions,
|
|
2283
2465
|
field: "strategic_plan",
|
|
2284
2466
|
variables: normalizeGraphqlVariables2({
|
|
2285
2467
|
organization_id: organizationId,
|
|
@@ -2295,13 +2477,13 @@ function registerFoundationCommands(program) {
|
|
|
2295
2477
|
"--data-json <dataJson>",
|
|
2296
2478
|
'JSON object for strategic_plan or {"strategic_plan": {...}}'
|
|
2297
2479
|
).action(async (opts, cmd) => {
|
|
2298
|
-
const
|
|
2299
|
-
const organizationId = resolveOrganizationId(
|
|
2480
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2481
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2300
2482
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2301
2483
|
const body = __testables.normalizeBody(String(opts.dataJson), "strategic_plan");
|
|
2302
2484
|
await runGraphqlMutationCommand({
|
|
2303
2485
|
command: "foundation.strategic-plans.update",
|
|
2304
|
-
runtimeOptions:
|
|
2486
|
+
runtimeOptions: context.runtimeOptions,
|
|
2305
2487
|
field: "update_strategic_plan",
|
|
2306
2488
|
variables: {
|
|
2307
2489
|
organization_id: organizationId,
|
|
@@ -2311,12 +2493,12 @@ function registerFoundationCommands(program) {
|
|
|
2311
2493
|
});
|
|
2312
2494
|
});
|
|
2313
2495
|
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) => {
|
|
2314
|
-
const
|
|
2315
|
-
const organizationId = resolveOrganizationId(
|
|
2496
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2497
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2316
2498
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2317
2499
|
await runGraphqlQueryCommand({
|
|
2318
2500
|
command: "foundation.strategic-objectives.show",
|
|
2319
|
-
runtimeOptions:
|
|
2501
|
+
runtimeOptions: context.runtimeOptions,
|
|
2320
2502
|
field: "strategic_objective",
|
|
2321
2503
|
variables: normalizeGraphqlVariables2({
|
|
2322
2504
|
organization_id: organizationId,
|
|
@@ -2332,8 +2514,8 @@ function registerFoundationCommands(program) {
|
|
|
2332
2514
|
"--data-json <dataJson>",
|
|
2333
2515
|
'JSON object for strategic_objective or {"strategic_objective": {...}}'
|
|
2334
2516
|
).action(async (opts, cmd) => {
|
|
2335
|
-
const
|
|
2336
|
-
const organizationId = resolveOrganizationId(
|
|
2517
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2518
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2337
2519
|
const id = idSchema10.parse(opts.id ?? organizationId);
|
|
2338
2520
|
const body = __testables.normalizeBody(
|
|
2339
2521
|
String(opts.dataJson),
|
|
@@ -2341,7 +2523,7 @@ function registerFoundationCommands(program) {
|
|
|
2341
2523
|
);
|
|
2342
2524
|
await runGraphqlMutationCommand({
|
|
2343
2525
|
command: "foundation.strategic-objectives.update",
|
|
2344
|
-
runtimeOptions:
|
|
2526
|
+
runtimeOptions: context.runtimeOptions,
|
|
2345
2527
|
field: "update_strategic_objective",
|
|
2346
2528
|
variables: {
|
|
2347
2529
|
organization_id: organizationId,
|
|
@@ -2368,10 +2550,487 @@ function registerFoundationCommands(program) {
|
|
|
2368
2550
|
});
|
|
2369
2551
|
}
|
|
2370
2552
|
|
|
2553
|
+
// src/commands/childEntities.ts
|
|
2554
|
+
import { z as z12 } from "zod";
|
|
2555
|
+
var idSchema11 = z12.string().min(1);
|
|
2556
|
+
var jsonObjectSchema = z12.record(z12.string(), z12.unknown());
|
|
2557
|
+
function parseJsonObject2(raw) {
|
|
2558
|
+
try {
|
|
2559
|
+
const parsed = JSON.parse(raw);
|
|
2560
|
+
return jsonObjectSchema.parse(parsed);
|
|
2561
|
+
} catch (error) {
|
|
2562
|
+
throw new CliError({
|
|
2563
|
+
message: error instanceof Error ? `Invalid --data-json: ${error.message}` : "Invalid --data-json.",
|
|
2564
|
+
kind: "invalid_args",
|
|
2565
|
+
status: 400,
|
|
2566
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2567
|
+
});
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
function normalizeBody2(raw, rootKey) {
|
|
2571
|
+
const payload = parseJsonObject2(raw);
|
|
2572
|
+
const rooted = payload[rootKey];
|
|
2573
|
+
if (rooted && typeof rooted === "object" && !Array.isArray(rooted)) {
|
|
2574
|
+
return payload;
|
|
2575
|
+
}
|
|
2576
|
+
return { [rootKey]: payload };
|
|
2577
|
+
}
|
|
2578
|
+
function assertRequiredParent(body, rootKey, parentKey) {
|
|
2579
|
+
const entity = body[rootKey];
|
|
2580
|
+
if (!entity || typeof entity !== "object" || Array.isArray(entity)) {
|
|
2581
|
+
throw new CliError({
|
|
2582
|
+
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
2583
|
+
kind: "invalid_args",
|
|
2584
|
+
status: 400,
|
|
2585
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2586
|
+
});
|
|
2587
|
+
}
|
|
2588
|
+
const value = entity[parentKey];
|
|
2589
|
+
if (!(typeof value === "string" && value.trim().length > 0)) {
|
|
2590
|
+
throw new CliError({
|
|
2591
|
+
message: `Missing required create field for ${rootKey}: ${parentKey}.`,
|
|
2592
|
+
kind: "invalid_args",
|
|
2593
|
+
status: 400,
|
|
2594
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2595
|
+
});
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
function attrValue(attrs, keys) {
|
|
2599
|
+
if (!attrs || typeof attrs !== "object" || Array.isArray(attrs)) {
|
|
2600
|
+
return void 0;
|
|
2601
|
+
}
|
|
2602
|
+
const record = attrs;
|
|
2603
|
+
for (const key of keys) {
|
|
2604
|
+
if (record[key] !== void 0 && record[key] !== null && `${record[key]}`.trim() !== "") {
|
|
2605
|
+
return record[key];
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
return void 0;
|
|
2609
|
+
}
|
|
2610
|
+
function normalizePlacementRow(row, parentKind, parentIdFallback, parentTypedField) {
|
|
2611
|
+
const typedParent = parentTypedField ? row[parentTypedField] : void 0;
|
|
2612
|
+
const parentId = (typeof typedParent === "string" && typedParent.trim().length > 0 ? typedParent : void 0) ?? parentIdFallback ?? null;
|
|
2613
|
+
const attrs = row.attributes;
|
|
2614
|
+
const memberId = (typeof row.memberId === "string" ? row.memberId : void 0) ?? attrValue(attrs, ["memberId", "member_id"]) ?? null;
|
|
2615
|
+
const creatorId = (typeof row.creatorId === "string" ? row.creatorId : void 0) ?? attrValue(attrs, ["creatorId", "creator_id"]) ?? null;
|
|
2616
|
+
const ownerRaw = attrValue(attrs, ["memberId", "member_id", "creatorId", "creator_id"]) ?? null;
|
|
2617
|
+
const description = (typeof row.description === "string" && row.description.length > 0 ? row.description : attrValue(attrs, ["description"])) ?? null;
|
|
2618
|
+
return {
|
|
2619
|
+
id: row.id ?? null,
|
|
2620
|
+
type: row.type ?? null,
|
|
2621
|
+
parent: {
|
|
2622
|
+
kind: parentKind,
|
|
2623
|
+
id: parentId
|
|
2624
|
+
},
|
|
2625
|
+
owner: {
|
|
2626
|
+
memberId,
|
|
2627
|
+
creatorId,
|
|
2628
|
+
raw: ownerRaw
|
|
2629
|
+
},
|
|
2630
|
+
description,
|
|
2631
|
+
attributes: attrs ?? {}
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
function normalizeListPayload(payload, parentKind, parentIdFallback, parentTypedField) {
|
|
2635
|
+
const record = payload && typeof payload === "object" && !Array.isArray(payload) ? payload : {};
|
|
2636
|
+
const rows = Array.isArray(record.data) ? record.data : [];
|
|
2637
|
+
const normalizedRows = rows.map(
|
|
2638
|
+
(row) => normalizePlacementRow(
|
|
2639
|
+
row,
|
|
2640
|
+
parentKind,
|
|
2641
|
+
parentIdFallback,
|
|
2642
|
+
parentTypedField
|
|
2643
|
+
)
|
|
2644
|
+
);
|
|
2645
|
+
return {
|
|
2646
|
+
data: normalizedRows,
|
|
2647
|
+
count: record.count ?? normalizedRows.length,
|
|
2648
|
+
currentPage: record.currentPage ?? 1,
|
|
2649
|
+
totalPages: record.totalPages ?? 1
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
function registerChildCommands(program, config) {
|
|
2653
|
+
const command = program.command(config.command).description(config.description);
|
|
2654
|
+
command.command("list").requiredOption(`--${config.parentFlag} <${config.parentFlag}>`).option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
2655
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2656
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2657
|
+
const parentId = idSchema11.parse(opts[config.parentFlag.replace(/-([a-z])/g, (_, c) => c.toUpperCase())]);
|
|
2658
|
+
await runGraphqlQueryCommand({
|
|
2659
|
+
command: `${config.command}.list`,
|
|
2660
|
+
operationName: config.listOperationName,
|
|
2661
|
+
runtimeOptions: context.runtimeOptions,
|
|
2662
|
+
field: config.listField,
|
|
2663
|
+
variables: {
|
|
2664
|
+
organization_id: organizationId,
|
|
2665
|
+
[config.parentFlag.replace(/-/g, "_")]: parentId,
|
|
2666
|
+
page: opts.page,
|
|
2667
|
+
per: opts.per
|
|
2668
|
+
},
|
|
2669
|
+
isList: true,
|
|
2670
|
+
selectionSet: config.listSelectionSet,
|
|
2671
|
+
transformData: (payload) => normalizeListPayload(
|
|
2672
|
+
payload,
|
|
2673
|
+
config.parentKind,
|
|
2674
|
+
parentId,
|
|
2675
|
+
config.listParentTypedField
|
|
2676
|
+
)
|
|
2677
|
+
});
|
|
2678
|
+
});
|
|
2679
|
+
command.command("create").requiredOption("--data-json <dataJson>").action(async (opts, cmd) => {
|
|
2680
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2681
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2682
|
+
const body = normalizeBody2(String(opts.dataJson), config.rootKey);
|
|
2683
|
+
assertRequiredParent(body, config.rootKey, config.parentFlag.replace(/-/g, "_"));
|
|
2684
|
+
await runGraphqlMutationCommand({
|
|
2685
|
+
command: `${config.command}.create`,
|
|
2686
|
+
operationName: config.createOperationName,
|
|
2687
|
+
runtimeOptions: context.runtimeOptions,
|
|
2688
|
+
field: config.createField,
|
|
2689
|
+
variables: {
|
|
2690
|
+
organization_id: organizationId,
|
|
2691
|
+
params: body
|
|
2692
|
+
}
|
|
2693
|
+
});
|
|
2694
|
+
});
|
|
2695
|
+
command.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>").action(async (opts, cmd) => {
|
|
2696
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2697
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2698
|
+
const id = idSchema11.parse(opts.id);
|
|
2699
|
+
const body = normalizeBody2(String(opts.dataJson), config.rootKey);
|
|
2700
|
+
await runGraphqlMutationCommand({
|
|
2701
|
+
command: `${config.command}.update`,
|
|
2702
|
+
operationName: config.updateOperationName,
|
|
2703
|
+
runtimeOptions: context.runtimeOptions,
|
|
2704
|
+
field: config.updateField,
|
|
2705
|
+
variables: {
|
|
2706
|
+
organization_id: organizationId,
|
|
2707
|
+
[config.idVariable]: id,
|
|
2708
|
+
params: body
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
});
|
|
2712
|
+
command.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
2713
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2714
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2715
|
+
const id = idSchema11.parse(opts.id);
|
|
2716
|
+
await runGraphqlMutationCommand({
|
|
2717
|
+
command: `${config.command}.destroy`,
|
|
2718
|
+
operationName: config.destroyOperationName,
|
|
2719
|
+
runtimeOptions: context.runtimeOptions,
|
|
2720
|
+
field: config.destroyField,
|
|
2721
|
+
variables: {
|
|
2722
|
+
organization_id: organizationId,
|
|
2723
|
+
[config.idVariable]: id
|
|
2724
|
+
}
|
|
2725
|
+
});
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
function registerChildEntityCommands(program) {
|
|
2729
|
+
registerChildCommands(program, {
|
|
2730
|
+
command: "subtasks",
|
|
2731
|
+
description: "Subtask operations",
|
|
2732
|
+
parentFlag: "task-id",
|
|
2733
|
+
parentKind: "task",
|
|
2734
|
+
rootKey: "subtask",
|
|
2735
|
+
listField: "subtasks",
|
|
2736
|
+
createField: "create_subtask",
|
|
2737
|
+
updateField: "update_subtask",
|
|
2738
|
+
destroyField: "destroy_subtask",
|
|
2739
|
+
idVariable: "subtask_id",
|
|
2740
|
+
listOperationName: "SubtasksForTask",
|
|
2741
|
+
createOperationName: "CreateSubtask",
|
|
2742
|
+
updateOperationName: "UpdateSubtask",
|
|
2743
|
+
destroyOperationName: "DestroySubtask",
|
|
2744
|
+
listSelectionSet: "{ data { id type name status taskId attributes } count currentPage totalPages }",
|
|
2745
|
+
listParentTypedField: "taskId"
|
|
2746
|
+
});
|
|
2747
|
+
registerChildCommands(program, {
|
|
2748
|
+
command: "milestones",
|
|
2749
|
+
description: "Milestone operations",
|
|
2750
|
+
parentFlag: "rock-id",
|
|
2751
|
+
parentKind: "rock",
|
|
2752
|
+
rootKey: "milestone",
|
|
2753
|
+
listField: "milestones",
|
|
2754
|
+
createField: "create_milestone",
|
|
2755
|
+
updateField: "update_milestone",
|
|
2756
|
+
destroyField: "destroy_milestone",
|
|
2757
|
+
idVariable: "milestone_id",
|
|
2758
|
+
listOperationName: "MilestonesForRock",
|
|
2759
|
+
createOperationName: "CreateMilestone",
|
|
2760
|
+
updateOperationName: "UpdateMilestone",
|
|
2761
|
+
destroyOperationName: "DestroyMilestone",
|
|
2762
|
+
listSelectionSet: "{ data { id type name slug status attributes } count currentPage totalPages }"
|
|
2763
|
+
});
|
|
2764
|
+
registerChildCommands(program, {
|
|
2765
|
+
command: "subitems",
|
|
2766
|
+
description: "Subitem operations",
|
|
2767
|
+
parentFlag: "list-item-id",
|
|
2768
|
+
parentKind: "listItem",
|
|
2769
|
+
rootKey: "subitem",
|
|
2770
|
+
listField: "subitems",
|
|
2771
|
+
createField: "create_subitem",
|
|
2772
|
+
updateField: "update_subitem",
|
|
2773
|
+
destroyField: "destroy_subitem",
|
|
2774
|
+
idVariable: "subitem_id",
|
|
2775
|
+
listOperationName: "SubitemsForListItem",
|
|
2776
|
+
createOperationName: "CreateSubitem",
|
|
2777
|
+
updateOperationName: "UpdateSubitem",
|
|
2778
|
+
destroyOperationName: "DestroySubitem",
|
|
2779
|
+
listSelectionSet: "{ data { id type name status listItemId attributes } count currentPage totalPages }",
|
|
2780
|
+
listParentTypedField: "listItemId"
|
|
2781
|
+
});
|
|
2782
|
+
registerChildCommands(program, {
|
|
2783
|
+
command: "subtodos",
|
|
2784
|
+
description: "Subtodo operations",
|
|
2785
|
+
parentFlag: "todo-id",
|
|
2786
|
+
parentKind: "todo",
|
|
2787
|
+
rootKey: "sub_todo",
|
|
2788
|
+
listField: "sub_todos",
|
|
2789
|
+
createField: "create_sub_todo",
|
|
2790
|
+
updateField: "update_sub_todo",
|
|
2791
|
+
destroyField: "destroy_sub_todo",
|
|
2792
|
+
idVariable: "sub_todo_id",
|
|
2793
|
+
listOperationName: "SubtodosForTodo",
|
|
2794
|
+
createOperationName: "CreateSubTodo",
|
|
2795
|
+
updateOperationName: "UpdateSubTodo",
|
|
2796
|
+
destroyOperationName: "DestroySubTodo",
|
|
2797
|
+
listSelectionSet: "{ data { id type name status todoId attributes } count currentPage totalPages }",
|
|
2798
|
+
listParentTypedField: "todoId"
|
|
2799
|
+
});
|
|
2800
|
+
registerChildCommands(program, {
|
|
2801
|
+
command: "subissues",
|
|
2802
|
+
description: "Subissue operations",
|
|
2803
|
+
parentFlag: "issue-id",
|
|
2804
|
+
parentKind: "issue",
|
|
2805
|
+
rootKey: "sub_issue",
|
|
2806
|
+
listField: "sub_issues",
|
|
2807
|
+
createField: "create_sub_issue",
|
|
2808
|
+
updateField: "update_sub_issue",
|
|
2809
|
+
destroyField: "destroy_sub_issue",
|
|
2810
|
+
idVariable: "sub_issue_id",
|
|
2811
|
+
listOperationName: "SubissuesForIssue",
|
|
2812
|
+
createOperationName: "CreateSubIssue",
|
|
2813
|
+
updateOperationName: "UpdateSubIssue",
|
|
2814
|
+
destroyOperationName: "DestroySubIssue",
|
|
2815
|
+
listSelectionSet: "{ data { id type name status issueId attributes } count currentPage totalPages }",
|
|
2816
|
+
listParentTypedField: "issueId"
|
|
2817
|
+
});
|
|
2818
|
+
registerChildCommands(program, {
|
|
2819
|
+
command: "talking-points",
|
|
2820
|
+
description: "Talking point operations",
|
|
2821
|
+
parentFlag: "meeting-id",
|
|
2822
|
+
parentKind: "meeting",
|
|
2823
|
+
rootKey: "talking_point",
|
|
2824
|
+
listField: "talking_points",
|
|
2825
|
+
createField: "create_talking_point",
|
|
2826
|
+
updateField: "update_talking_point",
|
|
2827
|
+
destroyField: "destroy_talking_point",
|
|
2828
|
+
idVariable: "talking_point_id",
|
|
2829
|
+
listOperationName: "TalkingPointsForMeeting",
|
|
2830
|
+
createOperationName: "CreateTalkingPoint",
|
|
2831
|
+
updateOperationName: "UpdateTalkingPoint",
|
|
2832
|
+
destroyOperationName: "DestroyTalkingPoint",
|
|
2833
|
+
listSelectionSet: "{ data { id type name description status priority rank dueDate memberId creatorId meetingId attributes } count currentPage totalPages }",
|
|
2834
|
+
listParentTypedField: "meetingId"
|
|
2835
|
+
});
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
// src/commands/notes.ts
|
|
2839
|
+
import { z as z13 } from "zod";
|
|
2840
|
+
var idSchema12 = z13.string().min(1);
|
|
2841
|
+
var nonEmptyString = z13.string().min(1);
|
|
2842
|
+
function assertUpdateFields(params) {
|
|
2843
|
+
if (!params.name && !params.content && !params.status) {
|
|
2844
|
+
throw new CliError({
|
|
2845
|
+
message: "notes update requires at least one of --name, --body, or --status.",
|
|
2846
|
+
kind: "invalid_args",
|
|
2847
|
+
status: 400,
|
|
2848
|
+
exitCode: EXIT_CODES.invalidArgs
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
async function createContent(command, cmd, payload) {
|
|
2853
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2854
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2855
|
+
return runGraphqlMutationCommand({
|
|
2856
|
+
command,
|
|
2857
|
+
operationName: "CreateContent",
|
|
2858
|
+
runtimeOptions: context.runtimeOptions,
|
|
2859
|
+
field: "create_content",
|
|
2860
|
+
variables: normalizeGraphqlVariables2({
|
|
2861
|
+
organization_id: organizationId,
|
|
2862
|
+
params: {
|
|
2863
|
+
content: payload
|
|
2864
|
+
}
|
|
2865
|
+
})
|
|
2866
|
+
});
|
|
2867
|
+
}
|
|
2868
|
+
function registerNoteCommands(program) {
|
|
2869
|
+
const notes = program.command("notes").description("Content note operations");
|
|
2870
|
+
notes.command("list").option("--contentable-type <contentableType>").option("--contentable-id <contentableId>").option("--member-id <memberId>").option("--focus-member-id <focusMemberId>").option("--focus-team-id <focusTeamId>").option("--page <page>").option("--per <per>").action(async (opts, cmd) => {
|
|
2871
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2872
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2873
|
+
await runGraphqlQueryCommand({
|
|
2874
|
+
command: "notes.list",
|
|
2875
|
+
operationName: "ContentsIndex",
|
|
2876
|
+
runtimeOptions: context.runtimeOptions,
|
|
2877
|
+
field: "contents",
|
|
2878
|
+
variables: normalizeGraphqlVariables2({
|
|
2879
|
+
organization_id: organizationId,
|
|
2880
|
+
contentable_type: opts.contentableType,
|
|
2881
|
+
contentable_id: opts.contentableId,
|
|
2882
|
+
member_id: opts.memberId,
|
|
2883
|
+
focus_member_id: opts.focusMemberId,
|
|
2884
|
+
focus_team_id: opts.focusTeamId,
|
|
2885
|
+
page: opts.page,
|
|
2886
|
+
per: opts.per
|
|
2887
|
+
}),
|
|
2888
|
+
isList: true,
|
|
2889
|
+
selectionSet: "{ count currentPage totalPages data { id type name contentableType contentableId memberId focusMemberId focusTeamId attributes } }"
|
|
2890
|
+
});
|
|
2891
|
+
});
|
|
2892
|
+
notes.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
2893
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2894
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2895
|
+
const id = idSchema12.parse(opts.id);
|
|
2896
|
+
await runGraphqlQueryCommand({
|
|
2897
|
+
command: "notes.show",
|
|
2898
|
+
operationName: "ContentShow",
|
|
2899
|
+
runtimeOptions: context.runtimeOptions,
|
|
2900
|
+
field: "content",
|
|
2901
|
+
variables: normalizeGraphqlVariables2({
|
|
2902
|
+
organization_id: organizationId,
|
|
2903
|
+
id
|
|
2904
|
+
}),
|
|
2905
|
+
isShow: true,
|
|
2906
|
+
selectionSet: "{ id type name contentableType contentableId memberId focusMemberId focusTeamId attributes }"
|
|
2907
|
+
});
|
|
2908
|
+
});
|
|
2909
|
+
notes.command("update").requiredOption("--id <id>").option("--name <name>").option("--body <body>").option("--status <status>").action(async (opts, cmd) => {
|
|
2910
|
+
assertUpdateFields({
|
|
2911
|
+
name: opts.name,
|
|
2912
|
+
content: opts.body,
|
|
2913
|
+
status: opts.status
|
|
2914
|
+
});
|
|
2915
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2916
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2917
|
+
const contentId = idSchema12.parse(opts.id);
|
|
2918
|
+
await runGraphqlMutationCommand({
|
|
2919
|
+
command: "notes.update",
|
|
2920
|
+
operationName: "UpdateContent",
|
|
2921
|
+
runtimeOptions: context.runtimeOptions,
|
|
2922
|
+
field: "update_content",
|
|
2923
|
+
variables: normalizeGraphqlVariables2({
|
|
2924
|
+
organization_id: organizationId,
|
|
2925
|
+
content_id: contentId,
|
|
2926
|
+
params: {
|
|
2927
|
+
content: normalizeGraphqlVariables2({
|
|
2928
|
+
name: opts.name,
|
|
2929
|
+
content: opts.body,
|
|
2930
|
+
status: opts.status
|
|
2931
|
+
})
|
|
2932
|
+
}
|
|
2933
|
+
})
|
|
2934
|
+
});
|
|
2935
|
+
});
|
|
2936
|
+
notes.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
2937
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2938
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2939
|
+
const contentId = idSchema12.parse(opts.id);
|
|
2940
|
+
await runGraphqlMutationCommand({
|
|
2941
|
+
command: "notes.destroy",
|
|
2942
|
+
operationName: "DestroyContent",
|
|
2943
|
+
runtimeOptions: context.runtimeOptions,
|
|
2944
|
+
field: "destroy_content",
|
|
2945
|
+
variables: normalizeGraphqlVariables2({
|
|
2946
|
+
organization_id: organizationId,
|
|
2947
|
+
content_id: contentId
|
|
2948
|
+
})
|
|
2949
|
+
});
|
|
2950
|
+
});
|
|
2951
|
+
notes.command("create-member").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
|
|
2952
|
+
const targetMemberId = nonEmptyString.parse(opts.targetMemberId);
|
|
2953
|
+
await createContent("notes.create-member", cmd, {
|
|
2954
|
+
type: "WrittenContent",
|
|
2955
|
+
name: nonEmptyString.parse(opts.name),
|
|
2956
|
+
content: nonEmptyString.parse(opts.body),
|
|
2957
|
+
status: String(opts.status ?? "draft"),
|
|
2958
|
+
contentable_type: "Member",
|
|
2959
|
+
contentable_id: targetMemberId,
|
|
2960
|
+
member_id: targetMemberId,
|
|
2961
|
+
focus_member_id: null,
|
|
2962
|
+
focus_team_id: null
|
|
2963
|
+
});
|
|
2964
|
+
});
|
|
2965
|
+
notes.command("create-manager").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--target-member-id <targetMemberId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
|
|
2966
|
+
const actorMemberId = nonEmptyString.parse(opts.actorMemberId);
|
|
2967
|
+
await createContent("notes.create-manager", cmd, {
|
|
2968
|
+
type: "WrittenContent",
|
|
2969
|
+
name: nonEmptyString.parse(opts.name),
|
|
2970
|
+
content: nonEmptyString.parse(opts.body),
|
|
2971
|
+
status: String(opts.status ?? "draft"),
|
|
2972
|
+
contentable_type: "Member",
|
|
2973
|
+
contentable_id: actorMemberId,
|
|
2974
|
+
member_id: actorMemberId,
|
|
2975
|
+
focus_member_id: nonEmptyString.parse(opts.targetMemberId)
|
|
2976
|
+
});
|
|
2977
|
+
});
|
|
2978
|
+
notes.command("create-team").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--team-id <teamId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
|
|
2979
|
+
const actorMemberId = nonEmptyString.parse(opts.actorMemberId);
|
|
2980
|
+
const teamId = nonEmptyString.parse(opts.teamId);
|
|
2981
|
+
await createContent("notes.create-team", cmd, {
|
|
2982
|
+
type: "WrittenContent",
|
|
2983
|
+
name: nonEmptyString.parse(opts.name),
|
|
2984
|
+
content: nonEmptyString.parse(opts.body),
|
|
2985
|
+
status: String(opts.status ?? "draft"),
|
|
2986
|
+
contentable_type: "Team",
|
|
2987
|
+
contentable_id: teamId,
|
|
2988
|
+
member_id: actorMemberId,
|
|
2989
|
+
focus_team_id: teamId
|
|
2990
|
+
});
|
|
2991
|
+
});
|
|
2992
|
+
notes.command("create-project").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--project-id <projectId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
|
|
2993
|
+
await createContent("notes.create-project", cmd, {
|
|
2994
|
+
type: "WrittenContent",
|
|
2995
|
+
name: nonEmptyString.parse(opts.name),
|
|
2996
|
+
content: nonEmptyString.parse(opts.body),
|
|
2997
|
+
status: String(opts.status ?? "draft"),
|
|
2998
|
+
contentable_type: "Project",
|
|
2999
|
+
contentable_id: nonEmptyString.parse(opts.projectId),
|
|
3000
|
+
member_id: nonEmptyString.parse(opts.actorMemberId)
|
|
3001
|
+
});
|
|
3002
|
+
});
|
|
3003
|
+
notes.command("create-customer").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--customer-id <customerId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
|
|
3004
|
+
await createContent("notes.create-customer", cmd, {
|
|
3005
|
+
type: "WrittenContent",
|
|
3006
|
+
name: nonEmptyString.parse(opts.name),
|
|
3007
|
+
content: nonEmptyString.parse(opts.body),
|
|
3008
|
+
status: String(opts.status ?? "draft"),
|
|
3009
|
+
contentable_type: "Customer",
|
|
3010
|
+
contentable_id: nonEmptyString.parse(opts.customerId),
|
|
3011
|
+
member_id: nonEmptyString.parse(opts.actorMemberId)
|
|
3012
|
+
});
|
|
3013
|
+
});
|
|
3014
|
+
notes.command("create-contact").requiredOption("--actor-member-id <actorMemberId>").requiredOption("--contact-id <contactId>").requiredOption("--name <name>").requiredOption("--body <body>").option("--status <status>", "draft").action(async (opts, cmd) => {
|
|
3015
|
+
await createContent("notes.create-contact", cmd, {
|
|
3016
|
+
type: "WrittenContent",
|
|
3017
|
+
name: nonEmptyString.parse(opts.name),
|
|
3018
|
+
content: nonEmptyString.parse(opts.body),
|
|
3019
|
+
status: String(opts.status ?? "draft"),
|
|
3020
|
+
contentable_type: "Contact",
|
|
3021
|
+
contentable_id: nonEmptyString.parse(opts.contactId),
|
|
3022
|
+
member_id: nonEmptyString.parse(opts.actorMemberId)
|
|
3023
|
+
});
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
|
|
2371
3027
|
// src/cli.ts
|
|
2372
3028
|
function buildCli() {
|
|
2373
3029
|
const program = new Command();
|
|
2374
|
-
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(
|
|
3030
|
+
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(
|
|
3031
|
+
"--auth-json-stdin",
|
|
3032
|
+
"Read auth/runtime context JSON from stdin (token, baseUrl, organizationId, ...)"
|
|
3033
|
+
).option(
|
|
2375
3034
|
"--base-url <baseUrl>",
|
|
2376
3035
|
"API base URL (prefer WAVE_API_BASE_URL env var)"
|
|
2377
3036
|
).option(
|
|
@@ -2397,6 +3056,8 @@ function buildCli() {
|
|
|
2397
3056
|
registerIssueCommands(program);
|
|
2398
3057
|
registerSystemToolCommands(program);
|
|
2399
3058
|
registerFoundationCommands(program);
|
|
3059
|
+
registerChildEntityCommands(program);
|
|
3060
|
+
registerNoteCommands(program);
|
|
2400
3061
|
return program;
|
|
2401
3062
|
}
|
|
2402
3063
|
|