@wave-ai-os/wave-cli 0.1.88 → 0.2.0
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 +5 -5
- package/dist/index.cjs +894 -684
- package/dist/index.js +888 -678
- package/package.json +4 -3
- package/scripts/check-goals-domain.mjs +35 -0
- package/scripts/verify-dev-api.mjs +11 -11
- package/scripts/verify-goals-artifact.mjs +37 -0
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var import_commander4 = require("commander");
|
|
6
|
+
var import_zod23 = require("zod");
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
|
-
var
|
|
9
|
+
var import_commander3 = require("commander");
|
|
10
10
|
|
|
11
11
|
// src/authStorage.ts
|
|
12
12
|
var import_node_child_process = require("child_process");
|
|
@@ -725,18 +725,18 @@ function errorCodeFromHttpStatus(status) {
|
|
|
725
725
|
}
|
|
726
726
|
return `http_${status}`;
|
|
727
727
|
}
|
|
728
|
-
function messageFromHttpBody(
|
|
729
|
-
if (
|
|
730
|
-
const
|
|
731
|
-
if (typeof
|
|
732
|
-
return
|
|
728
|
+
function messageFromHttpBody(body2) {
|
|
729
|
+
if (body2 && typeof body2 === "object" && !Array.isArray(body2)) {
|
|
730
|
+
const record2 = body2;
|
|
731
|
+
if (typeof record2.error === "string" && record2.error.trim().length > 0) {
|
|
732
|
+
return record2.error;
|
|
733
733
|
}
|
|
734
|
-
if (typeof
|
|
735
|
-
return
|
|
734
|
+
if (typeof record2.message === "string" && record2.message.trim().length > 0) {
|
|
735
|
+
return record2.message;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
if (typeof
|
|
739
|
-
return
|
|
738
|
+
if (typeof body2 === "string" && body2.trim().length > 0) {
|
|
739
|
+
return body2;
|
|
740
740
|
}
|
|
741
741
|
return "GraphQL HTTP request failed.";
|
|
742
742
|
}
|
|
@@ -822,13 +822,13 @@ async function requestGraphqlHttp(params) {
|
|
|
822
822
|
const responseRequestId = response.headers.get("x-request-id") ?? params.requestId;
|
|
823
823
|
const text = await response.text();
|
|
824
824
|
const payload = text ? parseJsonSafely(text) : null;
|
|
825
|
-
const
|
|
825
|
+
const body2 = payload ?? (text.length > 0 ? text : null);
|
|
826
826
|
const graph = payload && typeof payload === "object" ? payload : {};
|
|
827
827
|
return {
|
|
828
828
|
status: response.status,
|
|
829
829
|
requestId: responseRequestId,
|
|
830
830
|
retryAfter: response.headers.get("retry-after"),
|
|
831
|
-
body,
|
|
831
|
+
body: body2,
|
|
832
832
|
graph
|
|
833
833
|
};
|
|
834
834
|
}
|
|
@@ -967,7 +967,7 @@ function buildGraphqlBody(input) {
|
|
|
967
967
|
const typeName = hasOverriddenType ? overriddenType.trim() : graphqlTypeForVariable(input, name, value);
|
|
968
968
|
return `$${name}: ${hasOverriddenType ? typeName : withNonNull(typeName)}`;
|
|
969
969
|
}).join(", ");
|
|
970
|
-
const fieldArgs = variableEntries.map(([name]) => `${name}: $${name}`).join(", ");
|
|
970
|
+
const fieldArgs = input.preserveArgumentNames ? Object.entries(input.variables).filter(([, value]) => value !== void 0).map(([name]) => `${name}: $${toCamelCase(name)}`).join(", ") : variableEntries.map(([name]) => `${name}: $${name}`).join(", ");
|
|
971
971
|
const signature = variableDecl.length > 0 ? `(${variableDecl})` : "";
|
|
972
972
|
const args = fieldArgs.length > 0 ? `(${fieldArgs})` : "";
|
|
973
973
|
const selection = splitSelectionAndFragments(input.selectionSet ?? "");
|
|
@@ -983,7 +983,7 @@ async function graphqlRequest(input) {
|
|
|
983
983
|
const base = new URL(input.config.baseUrl);
|
|
984
984
|
const url = new URL("/graphql", base);
|
|
985
985
|
const requestId = input.config.requestId ?? (0, import_node_crypto.randomUUID)();
|
|
986
|
-
const
|
|
986
|
+
const body2 = buildGraphqlBody(input);
|
|
987
987
|
debugLog(
|
|
988
988
|
input.config,
|
|
989
989
|
`graphql command=${input.command} op=${input.operationType} field=${input.field} url=${url.toString()} token=${redactForLogs(
|
|
@@ -997,7 +997,7 @@ async function graphqlRequest(input) {
|
|
|
997
997
|
input,
|
|
998
998
|
url,
|
|
999
999
|
requestId,
|
|
1000
|
-
body,
|
|
1000
|
+
body: body2,
|
|
1001
1001
|
controller
|
|
1002
1002
|
});
|
|
1003
1003
|
const responseRequestId = http.requestId;
|
|
@@ -1180,34 +1180,40 @@ function isEnvelopeEmittedSignal(error) {
|
|
|
1180
1180
|
return error instanceof EnvelopeEmittedSignal;
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
|
+
// src/commands/taskReadFields.ts
|
|
1184
|
+
var TASK_READ_FIELDS = [
|
|
1185
|
+
"summary",
|
|
1186
|
+
"slug",
|
|
1187
|
+
"description",
|
|
1188
|
+
"notes",
|
|
1189
|
+
"status",
|
|
1190
|
+
"priority",
|
|
1191
|
+
"rank",
|
|
1192
|
+
"dueDate",
|
|
1193
|
+
"createdAt",
|
|
1194
|
+
"updatedAt",
|
|
1195
|
+
"archivedAt",
|
|
1196
|
+
"organizationId",
|
|
1197
|
+
"memberId",
|
|
1198
|
+
"member",
|
|
1199
|
+
"assignee",
|
|
1200
|
+
"creatorId",
|
|
1201
|
+
"projectId",
|
|
1202
|
+
"projectSlug",
|
|
1203
|
+
"taskId",
|
|
1204
|
+
"labelIds",
|
|
1205
|
+
"estimateIds",
|
|
1206
|
+
"subtasksCount",
|
|
1207
|
+
"completedSubtasksCount",
|
|
1208
|
+
"taskType",
|
|
1209
|
+
"parentArchivedAt",
|
|
1210
|
+
"updateVersion"
|
|
1211
|
+
];
|
|
1212
|
+
|
|
1183
1213
|
// src/commandRunner.ts
|
|
1184
1214
|
var RESOURCE_QUERY_FIELDS = {
|
|
1185
1215
|
tool_config: ["toolKey", "expectations"],
|
|
1186
|
-
task:
|
|
1187
|
-
"summary",
|
|
1188
|
-
"slug",
|
|
1189
|
-
"description",
|
|
1190
|
-
"notes",
|
|
1191
|
-
"status",
|
|
1192
|
-
"priority",
|
|
1193
|
-
"rank",
|
|
1194
|
-
"dueDate",
|
|
1195
|
-
"createdAt",
|
|
1196
|
-
"updatedAt",
|
|
1197
|
-
"archivedAt",
|
|
1198
|
-
"organizationId",
|
|
1199
|
-
"memberId",
|
|
1200
|
-
"member",
|
|
1201
|
-
"assignee",
|
|
1202
|
-
"creatorId",
|
|
1203
|
-
"projectId",
|
|
1204
|
-
"projectSlug",
|
|
1205
|
-
"taskId",
|
|
1206
|
-
"labelIds",
|
|
1207
|
-
"estimateIds",
|
|
1208
|
-
"subtasksCount",
|
|
1209
|
-
"completedSubtasksCount"
|
|
1210
|
-
],
|
|
1216
|
+
task: TASK_READ_FIELDS,
|
|
1211
1217
|
issue: [
|
|
1212
1218
|
"name",
|
|
1213
1219
|
"slug",
|
|
@@ -1264,11 +1270,11 @@ var RESOURCE_QUERY_FIELDS = {
|
|
|
1264
1270
|
"workAnniversary",
|
|
1265
1271
|
"phone",
|
|
1266
1272
|
"pinned",
|
|
1267
|
-
"
|
|
1273
|
+
"goalsCount",
|
|
1268
1274
|
"measurablesCount",
|
|
1269
1275
|
"smartKpisCount"
|
|
1270
1276
|
],
|
|
1271
|
-
|
|
1277
|
+
goal: [
|
|
1272
1278
|
"name",
|
|
1273
1279
|
"slug",
|
|
1274
1280
|
"description",
|
|
@@ -1283,10 +1289,10 @@ var RESOURCE_QUERY_FIELDS = {
|
|
|
1283
1289
|
"organizationId",
|
|
1284
1290
|
"memberId",
|
|
1285
1291
|
"creatorId",
|
|
1286
|
-
"
|
|
1287
|
-
"
|
|
1292
|
+
"goalCollectionId",
|
|
1293
|
+
"goalCollectionSlug",
|
|
1288
1294
|
"quarterlyObjectiveId",
|
|
1289
|
-
"
|
|
1295
|
+
"goalType",
|
|
1290
1296
|
"labelIds",
|
|
1291
1297
|
"milestonesCount",
|
|
1292
1298
|
"completedMilestonesCount"
|
|
@@ -1414,13 +1420,13 @@ var RESOURCE_QUERY_FIELDS = {
|
|
|
1414
1420
|
"subTodosCount",
|
|
1415
1421
|
"completedSubTodosCount"
|
|
1416
1422
|
],
|
|
1417
|
-
|
|
1423
|
+
goal_collection: [
|
|
1418
1424
|
"name",
|
|
1419
1425
|
"slug",
|
|
1420
1426
|
"description",
|
|
1421
1427
|
"status",
|
|
1422
1428
|
"priority",
|
|
1423
|
-
"
|
|
1429
|
+
"goalType",
|
|
1424
1430
|
"createdAt",
|
|
1425
1431
|
"updatedAt",
|
|
1426
1432
|
"startDate",
|
|
@@ -1619,7 +1625,7 @@ var RESOURCE_QUERY_FIELDS = {
|
|
|
1619
1625
|
"status",
|
|
1620
1626
|
"alignmentScore",
|
|
1621
1627
|
"alignmentLabel",
|
|
1622
|
-
"
|
|
1628
|
+
"goalsCount",
|
|
1623
1629
|
"measurablesCount",
|
|
1624
1630
|
"smartKpisCount",
|
|
1625
1631
|
"createdAt",
|
|
@@ -1641,14 +1647,14 @@ var RESOURCE_FIELD_ALIASES = {
|
|
|
1641
1647
|
issues: "issue",
|
|
1642
1648
|
teams: "team",
|
|
1643
1649
|
members: "member",
|
|
1644
|
-
|
|
1650
|
+
goals: "goal",
|
|
1645
1651
|
meetings: "meeting",
|
|
1646
1652
|
lists: "list",
|
|
1647
1653
|
list_items: "list_item",
|
|
1648
1654
|
issue_groups: "issue_group",
|
|
1649
1655
|
todo_groups: "todo_group",
|
|
1650
1656
|
todos: "todo",
|
|
1651
|
-
|
|
1657
|
+
goal_collections: "goal_collection",
|
|
1652
1658
|
contents: "content",
|
|
1653
1659
|
stand_ups: "stand_up",
|
|
1654
1660
|
headlines: "headline",
|
|
@@ -1852,6 +1858,7 @@ async function runGraphqlMutationCommand(input) {
|
|
|
1852
1858
|
command: input.command,
|
|
1853
1859
|
operationName: input.operationName,
|
|
1854
1860
|
operationType: "mutation",
|
|
1861
|
+
preserveArgumentNames: input.preserveArgumentNames,
|
|
1855
1862
|
field: input.field,
|
|
1856
1863
|
variables: input.variables ?? {},
|
|
1857
1864
|
variableTypes: input.variableTypes,
|
|
@@ -2511,12 +2518,12 @@ function asRecord(value) {
|
|
|
2511
2518
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
2512
2519
|
}
|
|
2513
2520
|
function visibleSearchText(row) {
|
|
2514
|
-
const
|
|
2515
|
-
if (!
|
|
2516
|
-
const attributes = asRecord(
|
|
2521
|
+
const record2 = asRecord(row);
|
|
2522
|
+
if (!record2) return "";
|
|
2523
|
+
const attributes = asRecord(record2.attributes);
|
|
2517
2524
|
const values = [];
|
|
2518
2525
|
for (const field of SEARCHABLE_VISIBLE_FIELDS) {
|
|
2519
|
-
const topLevelValue =
|
|
2526
|
+
const topLevelValue = record2[field];
|
|
2520
2527
|
if (typeof topLevelValue === "string") values.push(topLevelValue);
|
|
2521
2528
|
const attributeValue = attributes?.[field];
|
|
2522
2529
|
if (typeof attributeValue === "string") values.push(attributeValue);
|
|
@@ -2527,11 +2534,11 @@ function matchesSearchQuery(row, query) {
|
|
|
2527
2534
|
return visibleSearchText(row).includes(query.toLowerCase());
|
|
2528
2535
|
}
|
|
2529
2536
|
function filterListEnvelopeByQuery(payload, query) {
|
|
2530
|
-
const
|
|
2531
|
-
if (!
|
|
2532
|
-
const filteredData =
|
|
2537
|
+
const record2 = asRecord(payload);
|
|
2538
|
+
if (!record2 || !Array.isArray(record2.data)) return payload;
|
|
2539
|
+
const filteredData = record2.data.filter((row) => matchesSearchQuery(row, query));
|
|
2533
2540
|
return {
|
|
2534
|
-
...
|
|
2541
|
+
...record2,
|
|
2535
2542
|
data: filteredData,
|
|
2536
2543
|
count: filteredData.length
|
|
2537
2544
|
};
|
|
@@ -2611,6 +2618,9 @@ function parseTaskPriority(value) {
|
|
|
2611
2618
|
var projectIdSchema = import_zod3.z.string().min(1);
|
|
2612
2619
|
var idSchema = import_zod3.z.string().min(1);
|
|
2613
2620
|
var summarySchema = import_zod3.z.string().min(1);
|
|
2621
|
+
var updateVersionSchema = import_zod3.z.string().refine((value) => value.trim().length > 0, {
|
|
2622
|
+
message: "Expected update version must not be blank"
|
|
2623
|
+
});
|
|
2614
2624
|
function parseTaskUpdateJson(raw) {
|
|
2615
2625
|
try {
|
|
2616
2626
|
const parsed = JSON.parse(raw);
|
|
@@ -2618,7 +2628,7 @@ function parseTaskUpdateJson(raw) {
|
|
|
2618
2628
|
throw new Error("JSON payload must be an object.");
|
|
2619
2629
|
}
|
|
2620
2630
|
const payload = parsed;
|
|
2621
|
-
const task = payload
|
|
2631
|
+
const task = payload["task"];
|
|
2622
2632
|
if (task && typeof task === "object" && !Array.isArray(task)) {
|
|
2623
2633
|
return task;
|
|
2624
2634
|
}
|
|
@@ -2721,8 +2731,9 @@ function registerTaskCommands(program) {
|
|
|
2721
2731
|
}
|
|
2722
2732
|
});
|
|
2723
2733
|
});
|
|
2724
|
-
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>").option("--label-ids <labelIds>", "Comma-separated task label ids").option("--data-json <dataJson>", 'JSON object for task updates, e.g. {"task":{"label_ids":["587"]}}').action(async (opts, cmd) => {
|
|
2725
|
-
const
|
|
2734
|
+
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>").option("--label-ids <labelIds>", "Comma-separated task label ids").option("--data-json <dataJson>", 'JSON object for task updates, e.g. {"task":{"label_ids":["587"]}}').option("--expected-update-version <version>", "Exact saved update_version; reject stale Task updates").action(async (opts, cmd) => {
|
|
2735
|
+
const id2 = idSchema.parse(opts.id);
|
|
2736
|
+
const expectedUpdateVersion = opts.expectedUpdateVersion === void 0 ? void 0 : updateVersionSchema.parse(opts.expectedUpdateVersion);
|
|
2726
2737
|
const taskPayload = {
|
|
2727
2738
|
...opts.dataJson ? parseTaskUpdateJson(String(opts.dataJson)) : {},
|
|
2728
2739
|
...opts.summary ? { summary: String(opts.summary) } : {},
|
|
@@ -2747,9 +2758,15 @@ function registerTaskCommands(program) {
|
|
|
2747
2758
|
command: "tasks.update",
|
|
2748
2759
|
runtimeOptions: context.runtimeOptions,
|
|
2749
2760
|
field: "update_task",
|
|
2761
|
+
...expectedUpdateVersion === void 0 ? {} : {
|
|
2762
|
+
variableTypes: { expected_update_version: "String!" }
|
|
2763
|
+
},
|
|
2750
2764
|
variables: {
|
|
2751
2765
|
organization_id: organizationId,
|
|
2752
|
-
task_id:
|
|
2766
|
+
task_id: id2,
|
|
2767
|
+
...expectedUpdateVersion === void 0 ? {} : {
|
|
2768
|
+
expected_update_version: expectedUpdateVersion
|
|
2769
|
+
},
|
|
2753
2770
|
params: {
|
|
2754
2771
|
task: taskPayload
|
|
2755
2772
|
}
|
|
@@ -2757,7 +2774,7 @@ function registerTaskCommands(program) {
|
|
|
2757
2774
|
});
|
|
2758
2775
|
});
|
|
2759
2776
|
tasks.command("destroy").description("Destroy a task by id").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
2760
|
-
const
|
|
2777
|
+
const id2 = idSchema.parse(opts.id);
|
|
2761
2778
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
2762
2779
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
2763
2780
|
await runGraphqlMutationCommand({
|
|
@@ -2766,7 +2783,7 @@ function registerTaskCommands(program) {
|
|
|
2766
2783
|
field: "destroy_task",
|
|
2767
2784
|
variables: {
|
|
2768
2785
|
organization_id: organizationId,
|
|
2769
|
-
task_id:
|
|
2786
|
+
task_id: id2
|
|
2770
2787
|
}
|
|
2771
2788
|
});
|
|
2772
2789
|
});
|
|
@@ -2808,19 +2825,19 @@ var dtoHelpCatalog = {
|
|
|
2808
2825
|
["archived_at", "string | null"]
|
|
2809
2826
|
]
|
|
2810
2827
|
},
|
|
2811
|
-
|
|
2812
|
-
source: "wave-ui/src/types/
|
|
2828
|
+
goal: {
|
|
2829
|
+
source: "wave-ui/src/types/goal.ts + wave-api-rb/config/initializers/constants/goal.rb + wave-api-rb/app/models/goal.rb",
|
|
2813
2830
|
create: [
|
|
2814
2831
|
["name*", "string"],
|
|
2815
2832
|
["description", "string"],
|
|
2816
2833
|
["notes", "string | null"],
|
|
2817
2834
|
["resources_attributes", "ResourceDTO[]"],
|
|
2818
2835
|
["member_id", "string"],
|
|
2819
|
-
["
|
|
2836
|
+
["goal_type*", "GoalType"],
|
|
2820
2837
|
["label_ids", "number[]"],
|
|
2821
2838
|
["status*", "enum(done|on_track|off_track)"],
|
|
2822
2839
|
["due_by", "string"],
|
|
2823
|
-
["
|
|
2840
|
+
["goal_collection_id", "string"],
|
|
2824
2841
|
["priority*", "enum(no_priority|urgent|high|medium|low)"]
|
|
2825
2842
|
],
|
|
2826
2843
|
update: [
|
|
@@ -2829,12 +2846,12 @@ var dtoHelpCatalog = {
|
|
|
2829
2846
|
["notes", "string | null"],
|
|
2830
2847
|
["resources_attributes", "ResourceDTO[]"],
|
|
2831
2848
|
["member_id", "string"],
|
|
2832
|
-
["
|
|
2849
|
+
["goal_type*", "GoalType"],
|
|
2833
2850
|
["label_ids", "number[]"],
|
|
2834
2851
|
["status*", "enum(done|on_track|off_track)"],
|
|
2835
2852
|
["due_by", "string"],
|
|
2836
2853
|
["archived_at", "string"],
|
|
2837
|
-
["
|
|
2854
|
+
["goal_collection_id", "string"],
|
|
2838
2855
|
["priority*", "enum(no_priority|urgent|high|medium|low)"],
|
|
2839
2856
|
["rank", "number"],
|
|
2840
2857
|
["quarterly_objective_id", "string"]
|
|
@@ -3046,14 +3063,14 @@ var dtoHelpCatalog = {
|
|
|
3046
3063
|
["rank", "number"]
|
|
3047
3064
|
]
|
|
3048
3065
|
},
|
|
3049
|
-
|
|
3050
|
-
source: "wave-ui/src/types/
|
|
3066
|
+
goal_collection: {
|
|
3067
|
+
source: "wave-ui/src/types/goalCollection.ts + wave-api-rb/config/initializers/constants/goal_collection.rb + wave-api-rb/app/models/goal_collection.rb",
|
|
3051
3068
|
create: [
|
|
3052
3069
|
["name*", "string"],
|
|
3053
3070
|
["description", "string"],
|
|
3054
3071
|
["member_id", "string"],
|
|
3055
3072
|
["teams_ids", "number[]"],
|
|
3056
|
-
["status*", "
|
|
3073
|
+
["status*", "GoalCollectionStatus"],
|
|
3057
3074
|
["priority*", "Priority"],
|
|
3058
3075
|
["start_date", "string"],
|
|
3059
3076
|
["target_date", "string"]
|
|
@@ -3593,8 +3610,8 @@ function validateOperationDataJson(operationId2, value) {
|
|
|
3593
3610
|
(error) => `Invalid input value for dataJson: ${error}`
|
|
3594
3611
|
);
|
|
3595
3612
|
}
|
|
3596
|
-
function assertOperationPayload(operationId2,
|
|
3597
|
-
const errors = validateOperationDataJson(operationId2,
|
|
3613
|
+
function assertOperationPayload(operationId2, body2) {
|
|
3614
|
+
const errors = validateOperationDataJson(operationId2, body2);
|
|
3598
3615
|
if (errors.length === 0) return;
|
|
3599
3616
|
throw new CliError({
|
|
3600
3617
|
message: errors.join(" "),
|
|
@@ -3723,11 +3740,11 @@ function parseQueryJson(raw) {
|
|
|
3723
3740
|
}
|
|
3724
3741
|
return parseJsonObject(raw);
|
|
3725
3742
|
}
|
|
3726
|
-
function assertRequiredCreateFields(
|
|
3743
|
+
function assertRequiredCreateFields(body2, rootKey, requiredFields) {
|
|
3727
3744
|
if (!requiredFields || requiredFields.length === 0) {
|
|
3728
3745
|
return;
|
|
3729
3746
|
}
|
|
3730
|
-
const entity =
|
|
3747
|
+
const entity = body2[rootKey];
|
|
3731
3748
|
if (!entity || typeof entity !== "object" || Array.isArray(entity)) {
|
|
3732
3749
|
throw new CliError({
|
|
3733
3750
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
@@ -3809,7 +3826,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3809
3826
|
show.option(`--${cliParam} <${cliParam}>`);
|
|
3810
3827
|
});
|
|
3811
3828
|
show.action(async (opts, cmd) => {
|
|
3812
|
-
const
|
|
3829
|
+
const id2 = idSchema2.parse(opts.id);
|
|
3813
3830
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3814
3831
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3815
3832
|
const defaultCommand = `${config.command}.show`;
|
|
@@ -3822,14 +3839,14 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3822
3839
|
);
|
|
3823
3840
|
const defaultVariables = normalizeGraphqlVariables2({
|
|
3824
3841
|
organization_id: organizationId,
|
|
3825
|
-
id,
|
|
3842
|
+
id: id2,
|
|
3826
3843
|
...mappedShowParams
|
|
3827
3844
|
});
|
|
3828
3845
|
const showQuery = config.showQueryFactory ? config.showQueryFactory({
|
|
3829
3846
|
command: defaultCommand,
|
|
3830
3847
|
field: defaultField,
|
|
3831
3848
|
variables: defaultVariables,
|
|
3832
|
-
id,
|
|
3849
|
+
id: id2,
|
|
3833
3850
|
organizationId
|
|
3834
3851
|
}) : void 0;
|
|
3835
3852
|
await runGraphqlQueryCommand({
|
|
@@ -3847,23 +3864,23 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3847
3864
|
entityCommand.command("create").requiredOption("--data-json <dataJson>", createHelp4).action(async (opts, cmd) => {
|
|
3848
3865
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3849
3866
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3850
|
-
let
|
|
3867
|
+
let body2 = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
3851
3868
|
if (config.normalizeCreateBody) {
|
|
3852
|
-
|
|
3869
|
+
body2 = config.normalizeCreateBody(body2);
|
|
3853
3870
|
}
|
|
3854
|
-
assertOperationPayload(`${config.command}.create`,
|
|
3855
|
-
assertRequiredCreateFields(
|
|
3871
|
+
assertOperationPayload(`${config.command}.create`, body2);
|
|
3872
|
+
assertRequiredCreateFields(body2, config.rootKey, config.requiredCreateFields);
|
|
3856
3873
|
const defaultCommand = `${config.command}.create`;
|
|
3857
3874
|
const defaultField = `create_${toSingularResourceName(config.resourcePath)}`;
|
|
3858
3875
|
const defaultVariables = {
|
|
3859
3876
|
organization_id: organizationId,
|
|
3860
|
-
params:
|
|
3877
|
+
params: body2
|
|
3861
3878
|
};
|
|
3862
3879
|
const createMutation = config.createMutationFactory ? config.createMutationFactory({
|
|
3863
3880
|
command: defaultCommand,
|
|
3864
3881
|
field: defaultField,
|
|
3865
3882
|
variables: defaultVariables,
|
|
3866
|
-
body,
|
|
3883
|
+
body: body2,
|
|
3867
3884
|
organizationId
|
|
3868
3885
|
}) : void 0;
|
|
3869
3886
|
await runGraphqlMutationCommand({
|
|
@@ -3877,14 +3894,14 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3877
3894
|
});
|
|
3878
3895
|
});
|
|
3879
3896
|
entityCommand.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp5).action(async (opts, cmd) => {
|
|
3880
|
-
const
|
|
3897
|
+
const id2 = idSchema2.parse(opts.id);
|
|
3881
3898
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3882
3899
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3883
|
-
let
|
|
3900
|
+
let body2 = normalizeBody(String(opts.dataJson), config.rootKey);
|
|
3884
3901
|
if (config.normalizeUpdateBody) {
|
|
3885
|
-
|
|
3902
|
+
body2 = config.normalizeUpdateBody(body2);
|
|
3886
3903
|
}
|
|
3887
|
-
assertOperationPayload(`${config.command}.update`,
|
|
3904
|
+
assertOperationPayload(`${config.command}.update`, body2);
|
|
3888
3905
|
const singular = toSingularResourceName(config.resourcePath);
|
|
3889
3906
|
await runGraphqlMutationCommand({
|
|
3890
3907
|
command: `${config.command}.update`,
|
|
@@ -3892,14 +3909,14 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3892
3909
|
field: `update_${singular}`,
|
|
3893
3910
|
variables: {
|
|
3894
3911
|
organization_id: organizationId,
|
|
3895
|
-
[`${singular}_id`]:
|
|
3896
|
-
params:
|
|
3912
|
+
[`${singular}_id`]: id2,
|
|
3913
|
+
params: body2
|
|
3897
3914
|
}
|
|
3898
3915
|
});
|
|
3899
3916
|
});
|
|
3900
3917
|
for (const mutation of config.idMutationCommands ?? []) {
|
|
3901
3918
|
entityCommand.command(mutation.command).description(mutation.description).requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
3902
|
-
const
|
|
3919
|
+
const id2 = idSchema2.parse(opts.id);
|
|
3903
3920
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
3904
3921
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
3905
3922
|
await runGraphqlMutationCommand({
|
|
@@ -3908,7 +3925,7 @@ function registerEntityCrudCommands(program, config) {
|
|
|
3908
3925
|
field: mutation.field,
|
|
3909
3926
|
variables: {
|
|
3910
3927
|
organization_id: organizationId,
|
|
3911
|
-
[mutation.idVariable]:
|
|
3928
|
+
[mutation.idVariable]: id2
|
|
3912
3929
|
}
|
|
3913
3930
|
});
|
|
3914
3931
|
});
|
|
@@ -3982,28 +3999,28 @@ function parseProjectPriority(value) {
|
|
|
3982
3999
|
return parsed.data.toUpperCase();
|
|
3983
4000
|
}
|
|
3984
4001
|
function normalizeProjectRowForDisplay(row) {
|
|
3985
|
-
const
|
|
3986
|
-
if (!
|
|
3987
|
-
const attributes = asRecord2(
|
|
3988
|
-
const topLevelName = toNonEmptyString(
|
|
3989
|
-
const topLevelTitle = toNonEmptyString(
|
|
4002
|
+
const record2 = asRecord2(row);
|
|
4003
|
+
if (!record2) return row;
|
|
4004
|
+
const attributes = asRecord2(record2.attributes);
|
|
4005
|
+
const topLevelName = toNonEmptyString(record2.name);
|
|
4006
|
+
const topLevelTitle = toNonEmptyString(record2.title);
|
|
3990
4007
|
const attributeName = toNonEmptyString(attributes?.name);
|
|
3991
4008
|
const attributeTitle = toNonEmptyString(attributes?.title);
|
|
3992
4009
|
if (!topLevelName && !topLevelTitle && !attributeName && !attributeTitle) {
|
|
3993
|
-
return
|
|
4010
|
+
return record2;
|
|
3994
4011
|
}
|
|
3995
4012
|
return {
|
|
3996
|
-
...
|
|
4013
|
+
...record2,
|
|
3997
4014
|
...topLevelName ? {} : attributeName ? { name: attributeName } : {},
|
|
3998
4015
|
...topLevelTitle ? {} : attributeTitle ? { title: attributeTitle } : {}
|
|
3999
4016
|
};
|
|
4000
4017
|
}
|
|
4001
4018
|
function normalizeProjectsListForDisplay(payload) {
|
|
4002
|
-
const
|
|
4003
|
-
if (!
|
|
4019
|
+
const record2 = asRecord2(payload);
|
|
4020
|
+
if (!record2 || !Array.isArray(record2.data)) return payload;
|
|
4004
4021
|
return {
|
|
4005
|
-
...
|
|
4006
|
-
data:
|
|
4022
|
+
...record2,
|
|
4023
|
+
data: record2.data.map((row) => normalizeProjectRowForDisplay(row))
|
|
4007
4024
|
};
|
|
4008
4025
|
}
|
|
4009
4026
|
function registerProjectCommands(program) {
|
|
@@ -4053,7 +4070,7 @@ function registerProjectCommands(program) {
|
|
|
4053
4070
|
transformData: normalizeProjectsListForDisplay
|
|
4054
4071
|
});
|
|
4055
4072
|
projects.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
4056
|
-
const
|
|
4073
|
+
const id2 = idSchema3.parse(opts.id);
|
|
4057
4074
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4058
4075
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4059
4076
|
await runGraphqlQueryCommand({
|
|
@@ -4063,7 +4080,7 @@ function registerProjectCommands(program) {
|
|
|
4063
4080
|
field: "project",
|
|
4064
4081
|
variables: {
|
|
4065
4082
|
organization_id: organizationId,
|
|
4066
|
-
id
|
|
4083
|
+
id: id2
|
|
4067
4084
|
},
|
|
4068
4085
|
isShow: true,
|
|
4069
4086
|
selectionSet: projectShowFullSelectionSet,
|
|
@@ -4073,30 +4090,30 @@ function registerProjectCommands(program) {
|
|
|
4073
4090
|
projects.command("create").requiredOption("--data-json <dataJson>", projectCreateDataJsonHelp).action(async (opts, cmd) => {
|
|
4074
4091
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4075
4092
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4076
|
-
const
|
|
4093
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "project");
|
|
4077
4094
|
await runGraphqlMutationCommand({
|
|
4078
4095
|
command: "projects.create",
|
|
4079
4096
|
runtimeOptions: context.runtimeOptions,
|
|
4080
4097
|
field: "create_project",
|
|
4081
4098
|
variables: {
|
|
4082
4099
|
organization_id: organizationId,
|
|
4083
|
-
params:
|
|
4100
|
+
params: body2
|
|
4084
4101
|
}
|
|
4085
4102
|
});
|
|
4086
4103
|
});
|
|
4087
4104
|
projects.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", projectUpdateDataJsonHelp).action(async (opts, cmd) => {
|
|
4088
|
-
const
|
|
4105
|
+
const id2 = idSchema3.parse(opts.id);
|
|
4089
4106
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4090
4107
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4091
|
-
const
|
|
4108
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "project");
|
|
4092
4109
|
await runGraphqlMutationCommand({
|
|
4093
4110
|
command: "projects.update",
|
|
4094
4111
|
runtimeOptions: context.runtimeOptions,
|
|
4095
4112
|
field: "update_project",
|
|
4096
4113
|
variables: {
|
|
4097
4114
|
organization_id: organizationId,
|
|
4098
|
-
project_id:
|
|
4099
|
-
params:
|
|
4115
|
+
project_id: id2,
|
|
4116
|
+
params: body2
|
|
4100
4117
|
},
|
|
4101
4118
|
variableTypes: {
|
|
4102
4119
|
organization_id: "ID!",
|
|
@@ -4107,30 +4124,30 @@ function registerProjectCommands(program) {
|
|
|
4107
4124
|
});
|
|
4108
4125
|
}
|
|
4109
4126
|
|
|
4110
|
-
// src/commands/
|
|
4127
|
+
// src/commands/goals.ts
|
|
4111
4128
|
var import_zod6 = require("zod");
|
|
4112
4129
|
var idSchema4 = import_zod6.z.string().min(1);
|
|
4113
|
-
var
|
|
4114
|
-
var statusSchema = import_zod6.z.enum(["on_track", "
|
|
4115
|
-
var createHelp = buildDataJsonHelp("
|
|
4116
|
-
var updateHelp = buildDataJsonHelp("
|
|
4117
|
-
function
|
|
4118
|
-
const
|
|
4119
|
-
|
|
4130
|
+
var goalCollectionIdSchema = import_zod6.z.string().min(1);
|
|
4131
|
+
var statusSchema = import_zod6.z.enum(["on_track", "off_track", "done"]);
|
|
4132
|
+
var createHelp = buildDataJsonHelp("goal", "create") ?? 'JSON object for goal or {"goal": {...}}';
|
|
4133
|
+
var updateHelp = buildDataJsonHelp("goal", "update") ?? 'JSON object for goal or {"goal": {...}}';
|
|
4134
|
+
function registerGoalCommands(program) {
|
|
4135
|
+
const goals = program.command("goals").description("Goal operations");
|
|
4136
|
+
goals.command("list").option("--page <page>").option("--per <per>").option("--goal-collection-id <goalCollectionId>").option("--start-date <startDate>").option("--goal-type <goalType>").option("--team-id <teamId>").option("--member-id <memberId>").option("--meeting-id <meetingId>").option("--annual-objective-id <annualObjectiveId>").option("--quarterly-objective-id <quarterlyObjectiveId>").action(async (opts, cmd) => {
|
|
4120
4137
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4121
4138
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4122
|
-
const
|
|
4139
|
+
const goalCollectionId = opts.goalCollectionId ? goalCollectionIdSchema.parse(opts.goalCollectionId) : void 0;
|
|
4123
4140
|
await runGraphqlQueryCommand({
|
|
4124
|
-
command: "
|
|
4141
|
+
command: "goals.list",
|
|
4125
4142
|
runtimeOptions: context.runtimeOptions,
|
|
4126
|
-
field: "
|
|
4143
|
+
field: "goals",
|
|
4127
4144
|
variables: normalizeGraphqlVariables2({
|
|
4128
4145
|
organization_id: organizationId,
|
|
4129
4146
|
page: opts.page,
|
|
4130
4147
|
per: opts.per,
|
|
4131
|
-
|
|
4148
|
+
goal_collection_id: goalCollectionId,
|
|
4132
4149
|
start_date: opts.startDate,
|
|
4133
|
-
|
|
4150
|
+
goal_type: opts.goalType,
|
|
4134
4151
|
team_id: opts.teamId,
|
|
4135
4152
|
member_id: opts.memberId,
|
|
4136
4153
|
meeting_id: opts.meetingId,
|
|
@@ -4140,69 +4157,69 @@ function registerRockCommands(program) {
|
|
|
4140
4157
|
isList: true
|
|
4141
4158
|
});
|
|
4142
4159
|
});
|
|
4143
|
-
registerGraphqlSearchCommand(
|
|
4144
|
-
command: "
|
|
4145
|
-
field: "
|
|
4160
|
+
registerGraphqlSearchCommand(goals, {
|
|
4161
|
+
command: "goals",
|
|
4162
|
+
field: "goals"
|
|
4146
4163
|
});
|
|
4147
|
-
|
|
4148
|
-
const
|
|
4164
|
+
goals.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
4165
|
+
const id2 = idSchema4.parse(opts.id);
|
|
4149
4166
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4150
4167
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4151
4168
|
await runGraphqlQueryCommand({
|
|
4152
|
-
command: "
|
|
4169
|
+
command: "goals.show",
|
|
4153
4170
|
runtimeOptions: context.runtimeOptions,
|
|
4154
|
-
field: "
|
|
4171
|
+
field: "goal",
|
|
4155
4172
|
variables: {
|
|
4156
4173
|
organization_id: organizationId,
|
|
4157
|
-
id
|
|
4174
|
+
id: id2
|
|
4158
4175
|
},
|
|
4159
4176
|
isShow: true
|
|
4160
4177
|
});
|
|
4161
4178
|
});
|
|
4162
|
-
|
|
4163
|
-
const
|
|
4179
|
+
goals.command("update-status").requiredOption("--id <id>").requiredOption("--status <status>").action(async (opts, cmd) => {
|
|
4180
|
+
const id2 = idSchema4.parse(opts.id);
|
|
4164
4181
|
const status = statusSchema.parse(opts.status);
|
|
4165
4182
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4166
4183
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4167
4184
|
await runGraphqlMutationCommand({
|
|
4168
|
-
command: "
|
|
4185
|
+
command: "goals.update-status",
|
|
4169
4186
|
runtimeOptions: context.runtimeOptions,
|
|
4170
|
-
field: "
|
|
4187
|
+
field: "update_goal",
|
|
4171
4188
|
variables: {
|
|
4172
4189
|
organization_id: organizationId,
|
|
4173
|
-
|
|
4174
|
-
params: {
|
|
4190
|
+
goal_id: id2,
|
|
4191
|
+
params: { goal: { status } }
|
|
4175
4192
|
}
|
|
4176
4193
|
});
|
|
4177
4194
|
});
|
|
4178
|
-
|
|
4195
|
+
goals.command("create").requiredOption("--data-json <dataJson>", createHelp).action(async (opts, cmd) => {
|
|
4179
4196
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4180
4197
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4181
|
-
const
|
|
4182
|
-
__testables.assertRequiredCreateFields(
|
|
4198
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "goal");
|
|
4199
|
+
__testables.assertRequiredCreateFields(body2, "goal", ["goal_collection_id"]);
|
|
4183
4200
|
await runGraphqlMutationCommand({
|
|
4184
|
-
command: "
|
|
4201
|
+
command: "goals.create",
|
|
4185
4202
|
runtimeOptions: context.runtimeOptions,
|
|
4186
|
-
field: "
|
|
4203
|
+
field: "create_goal",
|
|
4187
4204
|
variables: {
|
|
4188
4205
|
organization_id: organizationId,
|
|
4189
|
-
params:
|
|
4206
|
+
params: body2
|
|
4190
4207
|
}
|
|
4191
4208
|
});
|
|
4192
4209
|
});
|
|
4193
|
-
|
|
4194
|
-
const
|
|
4210
|
+
goals.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp).action(async (opts, cmd) => {
|
|
4211
|
+
const id2 = idSchema4.parse(opts.id);
|
|
4195
4212
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4196
4213
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4197
|
-
const
|
|
4214
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "goal");
|
|
4198
4215
|
await runGraphqlMutationCommand({
|
|
4199
|
-
command: "
|
|
4216
|
+
command: "goals.update",
|
|
4200
4217
|
runtimeOptions: context.runtimeOptions,
|
|
4201
|
-
field: "
|
|
4218
|
+
field: "update_goal",
|
|
4202
4219
|
variables: {
|
|
4203
4220
|
organization_id: organizationId,
|
|
4204
|
-
|
|
4205
|
-
params:
|
|
4221
|
+
goal_id: id2,
|
|
4222
|
+
params: body2
|
|
4206
4223
|
}
|
|
4207
4224
|
});
|
|
4208
4225
|
});
|
|
@@ -4264,8 +4281,8 @@ function toStringArray(value, field) {
|
|
|
4264
4281
|
const normalized = items.map((item) => String(item).trim()).filter((item) => item.length > 0);
|
|
4265
4282
|
return normalized.length > 0 ? normalized : void 0;
|
|
4266
4283
|
}
|
|
4267
|
-
function normalizeMeetingCreateBody(
|
|
4268
|
-
const entity =
|
|
4284
|
+
function normalizeMeetingCreateBody(body2) {
|
|
4285
|
+
const entity = body2.meeting;
|
|
4269
4286
|
if (!entity || typeof entity !== "object" || Array.isArray(entity)) {
|
|
4270
4287
|
throw new CliError({
|
|
4271
4288
|
message: 'Invalid payload. Expected object at "meeting".',
|
|
@@ -4346,7 +4363,7 @@ function normalizeMeetingCreateBody(body) {
|
|
|
4346
4363
|
if (teamsIds) {
|
|
4347
4364
|
meeting.teams_ids = teamsIds;
|
|
4348
4365
|
}
|
|
4349
|
-
return { ...
|
|
4366
|
+
return { ...body2, meeting };
|
|
4350
4367
|
}
|
|
4351
4368
|
function registerMeetingCommands(program) {
|
|
4352
4369
|
const meetings = program.command("meetings").description("Meeting operations");
|
|
@@ -4376,7 +4393,7 @@ function registerMeetingCommands(program) {
|
|
|
4376
4393
|
field: "meetings"
|
|
4377
4394
|
});
|
|
4378
4395
|
meetings.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
4379
|
-
const
|
|
4396
|
+
const id2 = idSchema5.parse(opts.id);
|
|
4380
4397
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4381
4398
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4382
4399
|
await runGraphqlQueryCommand({
|
|
@@ -4385,7 +4402,7 @@ function registerMeetingCommands(program) {
|
|
|
4385
4402
|
field: "meeting",
|
|
4386
4403
|
variables: {
|
|
4387
4404
|
organization_id: organizationId,
|
|
4388
|
-
id
|
|
4405
|
+
id: id2
|
|
4389
4406
|
},
|
|
4390
4407
|
isShow: true
|
|
4391
4408
|
});
|
|
@@ -4407,7 +4424,7 @@ function registerMeetingCommands(program) {
|
|
|
4407
4424
|
});
|
|
4408
4425
|
});
|
|
4409
4426
|
meetings.command("notes").requiredOption("--id <id>").requiredOption("--content <content>").action(async (opts, cmd) => {
|
|
4410
|
-
const
|
|
4427
|
+
const id2 = idSchema5.parse(opts.id);
|
|
4411
4428
|
const notes = notesSchema.parse(opts.content);
|
|
4412
4429
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4413
4430
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -4417,7 +4434,7 @@ function registerMeetingCommands(program) {
|
|
|
4417
4434
|
field: "update_meeting",
|
|
4418
4435
|
variables: {
|
|
4419
4436
|
organization_id: organizationId,
|
|
4420
|
-
meeting_id:
|
|
4437
|
+
meeting_id: id2,
|
|
4421
4438
|
params: {
|
|
4422
4439
|
meeting: {
|
|
4423
4440
|
notes
|
|
@@ -4430,30 +4447,30 @@ function registerMeetingCommands(program) {
|
|
|
4430
4447
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4431
4448
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4432
4449
|
const rawBody = __testables.normalizeBody(String(opts.dataJson), "meeting");
|
|
4433
|
-
const
|
|
4450
|
+
const body2 = normalizeMeetingCreateBody(rawBody);
|
|
4434
4451
|
await runGraphqlMutationCommand({
|
|
4435
4452
|
command: "meetings.create",
|
|
4436
4453
|
runtimeOptions: context.runtimeOptions,
|
|
4437
4454
|
field: "create_meeting",
|
|
4438
4455
|
variables: {
|
|
4439
4456
|
organization_id: organizationId,
|
|
4440
|
-
params:
|
|
4457
|
+
params: body2
|
|
4441
4458
|
}
|
|
4442
4459
|
});
|
|
4443
4460
|
});
|
|
4444
4461
|
meetings.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp2).action(async (opts, cmd) => {
|
|
4445
|
-
const
|
|
4462
|
+
const id2 = idSchema5.parse(opts.id);
|
|
4446
4463
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4447
4464
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4448
|
-
const
|
|
4465
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "meeting");
|
|
4449
4466
|
await runGraphqlMutationCommand({
|
|
4450
4467
|
command: "meetings.update",
|
|
4451
4468
|
runtimeOptions: context.runtimeOptions,
|
|
4452
4469
|
field: "update_meeting",
|
|
4453
4470
|
variables: {
|
|
4454
4471
|
organization_id: organizationId,
|
|
4455
|
-
meeting_id:
|
|
4456
|
-
params:
|
|
4472
|
+
meeting_id: id2,
|
|
4473
|
+
params: body2
|
|
4457
4474
|
}
|
|
4458
4475
|
});
|
|
4459
4476
|
});
|
|
@@ -4581,7 +4598,7 @@ function registerMemberCommands(program) {
|
|
|
4581
4598
|
});
|
|
4582
4599
|
});
|
|
4583
4600
|
members.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
4584
|
-
const
|
|
4601
|
+
const id2 = idSchema6.parse(opts.id);
|
|
4585
4602
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4586
4603
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4587
4604
|
await runGraphqlQueryCommand({
|
|
@@ -4590,7 +4607,7 @@ function registerMemberCommands(program) {
|
|
|
4590
4607
|
field: "member",
|
|
4591
4608
|
variables: {
|
|
4592
4609
|
organization_id: organizationId,
|
|
4593
|
-
id
|
|
4610
|
+
id: id2
|
|
4594
4611
|
},
|
|
4595
4612
|
isShow: true
|
|
4596
4613
|
});
|
|
@@ -4598,30 +4615,30 @@ function registerMemberCommands(program) {
|
|
|
4598
4615
|
members.command("create").requiredOption("--data-json <dataJson>", createHelp3).action(async (opts, cmd) => {
|
|
4599
4616
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4600
4617
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4601
|
-
const
|
|
4618
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "member");
|
|
4602
4619
|
await runGraphqlMutationCommand({
|
|
4603
4620
|
command: "members.create",
|
|
4604
4621
|
runtimeOptions: context.runtimeOptions,
|
|
4605
4622
|
field: "create_member",
|
|
4606
4623
|
variables: {
|
|
4607
4624
|
organization_id: organizationId,
|
|
4608
|
-
params:
|
|
4625
|
+
params: body2
|
|
4609
4626
|
}
|
|
4610
4627
|
});
|
|
4611
4628
|
});
|
|
4612
4629
|
members.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp3).action(async (opts, cmd) => {
|
|
4613
|
-
const
|
|
4630
|
+
const id2 = idSchema6.parse(opts.id);
|
|
4614
4631
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4615
4632
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4616
|
-
const
|
|
4633
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "member");
|
|
4617
4634
|
await runGraphqlMutationCommand({
|
|
4618
4635
|
command: "members.update",
|
|
4619
4636
|
runtimeOptions: context.runtimeOptions,
|
|
4620
4637
|
field: "update_member",
|
|
4621
4638
|
variables: {
|
|
4622
4639
|
organization_id: organizationId,
|
|
4623
|
-
member_id:
|
|
4624
|
-
params:
|
|
4640
|
+
member_id: id2,
|
|
4641
|
+
params: body2
|
|
4625
4642
|
}
|
|
4626
4643
|
});
|
|
4627
4644
|
});
|
|
@@ -4742,7 +4759,7 @@ function registerSkillCommands(program) {
|
|
|
4742
4759
|
});
|
|
4743
4760
|
});
|
|
4744
4761
|
skills.command("show").description("Read one persisted Skill record by id or slug").requiredOption("--id <idOrSlug>", "Skill id or slug").option("--json", "Emit the stable JSON envelope").action(async (opts, cmd) => {
|
|
4745
|
-
const
|
|
4762
|
+
const id2 = idSchema7.parse(opts.id);
|
|
4746
4763
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4747
4764
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4748
4765
|
await runGraphqlQueryCommand({
|
|
@@ -4752,7 +4769,7 @@ function registerSkillCommands(program) {
|
|
|
4752
4769
|
field: "skill",
|
|
4753
4770
|
variables: {
|
|
4754
4771
|
organization_id: organizationId,
|
|
4755
|
-
id
|
|
4772
|
+
id: id2
|
|
4756
4773
|
},
|
|
4757
4774
|
variableTypes: {
|
|
4758
4775
|
organization_id: "ID!",
|
|
@@ -4821,7 +4838,7 @@ function registerIssueCommands(program) {
|
|
|
4821
4838
|
field: "issues"
|
|
4822
4839
|
});
|
|
4823
4840
|
issues.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
4824
|
-
const
|
|
4841
|
+
const id2 = idSchema8.parse(opts.id);
|
|
4825
4842
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4826
4843
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4827
4844
|
await runGraphqlQueryCommand({
|
|
@@ -4830,7 +4847,7 @@ function registerIssueCommands(program) {
|
|
|
4830
4847
|
field: "issue",
|
|
4831
4848
|
variables: {
|
|
4832
4849
|
organization_id: organizationId,
|
|
4833
|
-
id
|
|
4850
|
+
id: id2
|
|
4834
4851
|
},
|
|
4835
4852
|
isShow: true
|
|
4836
4853
|
});
|
|
@@ -4863,18 +4880,18 @@ function registerIssueCommands(program) {
|
|
|
4863
4880
|
});
|
|
4864
4881
|
});
|
|
4865
4882
|
issues.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", updateHelp4).action(async (opts, cmd) => {
|
|
4866
|
-
const
|
|
4883
|
+
const id2 = idSchema8.parse(opts.id);
|
|
4867
4884
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
4868
4885
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
4869
|
-
const
|
|
4886
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "issue");
|
|
4870
4887
|
await runGraphqlMutationCommand({
|
|
4871
4888
|
command: "issues.update",
|
|
4872
4889
|
runtimeOptions: context.runtimeOptions,
|
|
4873
4890
|
field: "update_issue",
|
|
4874
4891
|
variables: {
|
|
4875
4892
|
organization_id: organizationId,
|
|
4876
|
-
issue_id:
|
|
4877
|
-
params:
|
|
4893
|
+
issue_id: id2,
|
|
4894
|
+
params: body2
|
|
4878
4895
|
}
|
|
4879
4896
|
});
|
|
4880
4897
|
});
|
|
@@ -4974,12 +4991,12 @@ var SMART_KPI_NAMES = [
|
|
|
4974
4991
|
"total_card_impressions",
|
|
4975
4992
|
"total_card_clicks",
|
|
4976
4993
|
"total_card_click_rate",
|
|
4977
|
-
"
|
|
4978
|
-
"
|
|
4979
|
-
"
|
|
4980
|
-
"
|
|
4981
|
-
"
|
|
4982
|
-
"
|
|
4994
|
+
"goal_total_new_goal_groups",
|
|
4995
|
+
"goal_total_goal_groups",
|
|
4996
|
+
"goal_total_new_goals",
|
|
4997
|
+
"goal_total_new_milestones",
|
|
4998
|
+
"goal_total_completed_milestones",
|
|
4999
|
+
"goal_total_incomplete_milestones",
|
|
4983
5000
|
"project_total_projects",
|
|
4984
5001
|
"project_total_new_projects",
|
|
4985
5002
|
"project_total_new_tasks",
|
|
@@ -5092,8 +5109,8 @@ var SCORECARD_TRENDS = /* @__PURE__ */ new Set(["average", "total"]);
|
|
|
5092
5109
|
function isRecord2(value) {
|
|
5093
5110
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
5094
5111
|
}
|
|
5095
|
-
function ensureEntityObject(
|
|
5096
|
-
const entity =
|
|
5112
|
+
function ensureEntityObject(body2, rootKey) {
|
|
5113
|
+
const entity = body2[rootKey];
|
|
5097
5114
|
if (!isRecord2(entity)) {
|
|
5098
5115
|
throw new CliError({
|
|
5099
5116
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
@@ -5113,12 +5130,12 @@ function throwMissingRequiredCreateFields(rootKey, fields) {
|
|
|
5113
5130
|
details: { requiredFields: fields, rootKey }
|
|
5114
5131
|
});
|
|
5115
5132
|
}
|
|
5116
|
-
function normalizeTodosCreateBody(
|
|
5117
|
-
const todo = ensureEntityObject(
|
|
5133
|
+
function normalizeTodosCreateBody(body2) {
|
|
5134
|
+
const todo = ensureEntityObject(body2, "todo");
|
|
5118
5135
|
const rawStatus = todo.status;
|
|
5119
5136
|
if (rawStatus === void 0 || rawStatus === null || String(rawStatus).trim().length === 0) {
|
|
5120
5137
|
todo.status = "open";
|
|
5121
|
-
return { ...
|
|
5138
|
+
return { ...body2, todo };
|
|
5122
5139
|
}
|
|
5123
5140
|
if (typeof rawStatus !== "string" || !TODO_STATUSES.has(rawStatus)) {
|
|
5124
5141
|
throw new CliError({
|
|
@@ -5129,7 +5146,7 @@ function normalizeTodosCreateBody(body) {
|
|
|
5129
5146
|
details: { allowed: Array.from(TODO_STATUSES) }
|
|
5130
5147
|
});
|
|
5131
5148
|
}
|
|
5132
|
-
return { ...
|
|
5149
|
+
return { ...body2, todo };
|
|
5133
5150
|
}
|
|
5134
5151
|
function asNonEmptyString2(value) {
|
|
5135
5152
|
if (typeof value !== "string") {
|
|
@@ -5154,8 +5171,8 @@ function validateEnumField(params) {
|
|
|
5154
5171
|
}
|
|
5155
5172
|
return value;
|
|
5156
5173
|
}
|
|
5157
|
-
function normalizeKnowledgeCreateBody(
|
|
5158
|
-
const content = ensureEntityObject(
|
|
5174
|
+
function normalizeKnowledgeCreateBody(body2) {
|
|
5175
|
+
const content = ensureEntityObject(body2, "content");
|
|
5159
5176
|
const contentType = validateEnumField({
|
|
5160
5177
|
rawValue: content.content_type,
|
|
5161
5178
|
field: "content.content_type",
|
|
@@ -5178,10 +5195,10 @@ function normalizeKnowledgeCreateBody(body) {
|
|
|
5178
5195
|
throwMissingRequiredCreateFields("content", ["member_id"]);
|
|
5179
5196
|
}
|
|
5180
5197
|
content.member_id = memberId;
|
|
5181
|
-
return { ...
|
|
5198
|
+
return { ...body2, content };
|
|
5182
5199
|
}
|
|
5183
|
-
function normalizeNewsCreateBody(
|
|
5184
|
-
const headline = ensureEntityObject(
|
|
5200
|
+
function normalizeNewsCreateBody(body2) {
|
|
5201
|
+
const headline = ensureEntityObject(body2, "headline");
|
|
5185
5202
|
const memberId = asNonEmptyString2(headline.member_id);
|
|
5186
5203
|
if (!memberId) {
|
|
5187
5204
|
throwMissingRequiredCreateFields("headline", ["member_id"]);
|
|
@@ -5207,10 +5224,10 @@ function normalizeNewsCreateBody(body) {
|
|
|
5207
5224
|
throwMissingRequiredCreateFields("headline", ["headline_type"]);
|
|
5208
5225
|
}
|
|
5209
5226
|
headline.headline_type = headlineType;
|
|
5210
|
-
return { ...
|
|
5227
|
+
return { ...body2, headline };
|
|
5211
5228
|
}
|
|
5212
|
-
function normalizeQuestionsCreateBody(
|
|
5213
|
-
const question = ensureEntityObject(
|
|
5229
|
+
function normalizeQuestionsCreateBody(body2) {
|
|
5230
|
+
const question = ensureEntityObject(body2, "question");
|
|
5214
5231
|
const summary = asNonEmptyString2(question.summary);
|
|
5215
5232
|
const currentName = asNonEmptyString2(question.name);
|
|
5216
5233
|
if (!currentName && summary) {
|
|
@@ -5236,10 +5253,10 @@ function normalizeQuestionsCreateBody(body) {
|
|
|
5236
5253
|
if (status) {
|
|
5237
5254
|
question.status = status;
|
|
5238
5255
|
}
|
|
5239
|
-
return { ...
|
|
5256
|
+
return { ...body2, question };
|
|
5240
5257
|
}
|
|
5241
|
-
function normalizeQuestionsUpdateBody(
|
|
5242
|
-
const question = ensureEntityObject(
|
|
5258
|
+
function normalizeQuestionsUpdateBody(body2) {
|
|
5259
|
+
const question = ensureEntityObject(body2, "question");
|
|
5243
5260
|
const summary = asNonEmptyString2(question.summary);
|
|
5244
5261
|
const currentName = asNonEmptyString2(question.name);
|
|
5245
5262
|
if (!currentName && summary) {
|
|
@@ -5259,10 +5276,10 @@ function normalizeQuestionsUpdateBody(body) {
|
|
|
5259
5276
|
if (status) {
|
|
5260
5277
|
question.status = status;
|
|
5261
5278
|
}
|
|
5262
|
-
return { ...
|
|
5279
|
+
return { ...body2, question };
|
|
5263
5280
|
}
|
|
5264
|
-
function normalizeSurveysCreateBody(
|
|
5265
|
-
const survey = ensureEntityObject(
|
|
5281
|
+
function normalizeSurveysCreateBody(body2) {
|
|
5282
|
+
const survey = ensureEntityObject(body2, "survey");
|
|
5266
5283
|
const title = asNonEmptyString2(survey.title);
|
|
5267
5284
|
const currentName = asNonEmptyString2(survey.name);
|
|
5268
5285
|
if (!currentName && title) {
|
|
@@ -5289,10 +5306,10 @@ function normalizeSurveysCreateBody(body) {
|
|
|
5289
5306
|
}
|
|
5290
5307
|
survey.name = name;
|
|
5291
5308
|
survey.recipient_type = recipientType;
|
|
5292
|
-
return { ...
|
|
5309
|
+
return { ...body2, survey };
|
|
5293
5310
|
}
|
|
5294
|
-
function normalizeSurveysUpdateBody(
|
|
5295
|
-
const survey = ensureEntityObject(
|
|
5311
|
+
function normalizeSurveysUpdateBody(body2) {
|
|
5312
|
+
const survey = ensureEntityObject(body2, "survey");
|
|
5296
5313
|
const title = asNonEmptyString2(survey.title);
|
|
5297
5314
|
const currentName = asNonEmptyString2(survey.name);
|
|
5298
5315
|
if (!currentName && title) {
|
|
@@ -5317,10 +5334,10 @@ function normalizeSurveysUpdateBody(body) {
|
|
|
5317
5334
|
if (recipientType) {
|
|
5318
5335
|
survey.recipient_type = recipientType;
|
|
5319
5336
|
}
|
|
5320
|
-
return { ...
|
|
5337
|
+
return { ...body2, survey };
|
|
5321
5338
|
}
|
|
5322
|
-
function normalizeAccountabilityCreateBody(
|
|
5323
|
-
const responsibility = ensureEntityObject(
|
|
5339
|
+
function normalizeAccountabilityCreateBody(body2) {
|
|
5340
|
+
const responsibility = ensureEntityObject(body2, "responsibility");
|
|
5324
5341
|
const summary = asNonEmptyString2(responsibility.summary);
|
|
5325
5342
|
const currentName = asNonEmptyString2(responsibility.name);
|
|
5326
5343
|
if (!currentName && summary) {
|
|
@@ -5339,17 +5356,17 @@ function normalizeAccountabilityCreateBody(body) {
|
|
|
5339
5356
|
delete responsibility.organizationId;
|
|
5340
5357
|
responsibility.name = name;
|
|
5341
5358
|
responsibility.member_id = memberId;
|
|
5342
|
-
return { ...
|
|
5359
|
+
return { ...body2, responsibility };
|
|
5343
5360
|
}
|
|
5344
|
-
function normalizeAccountabilityUpdateBody(
|
|
5345
|
-
const responsibility = ensureEntityObject(
|
|
5361
|
+
function normalizeAccountabilityUpdateBody(body2) {
|
|
5362
|
+
const responsibility = ensureEntityObject(body2, "responsibility");
|
|
5346
5363
|
const summary = asNonEmptyString2(responsibility.summary);
|
|
5347
5364
|
const currentName = asNonEmptyString2(responsibility.name);
|
|
5348
5365
|
if (!currentName && summary) {
|
|
5349
5366
|
responsibility.name = summary;
|
|
5350
5367
|
}
|
|
5351
5368
|
delete responsibility.summary;
|
|
5352
|
-
return { ...
|
|
5369
|
+
return { ...body2, responsibility };
|
|
5353
5370
|
}
|
|
5354
5371
|
function parseSmartKpiViewCreateBody(raw) {
|
|
5355
5372
|
let parsed;
|
|
@@ -5374,8 +5391,8 @@ function parseSmartKpiViewCreateBody(raw) {
|
|
|
5374
5391
|
const rooted = parsed.smart_kpi_view;
|
|
5375
5392
|
return isRecord2(rooted) ? parsed : { smart_kpi_view: parsed };
|
|
5376
5393
|
}
|
|
5377
|
-
function normalizeSmartKpiViewCreateBody(
|
|
5378
|
-
const smartKpiView = ensureEntityObject(
|
|
5394
|
+
function normalizeSmartKpiViewCreateBody(body2) {
|
|
5395
|
+
const smartKpiView = ensureEntityObject(body2, "smart_kpi_view");
|
|
5379
5396
|
const name = asNonEmptyString2(smartKpiView.name);
|
|
5380
5397
|
if (!name) {
|
|
5381
5398
|
throwMissingRequiredCreateFields("smart_kpi_view", ["name"]);
|
|
@@ -5385,8 +5402,8 @@ function normalizeSmartKpiViewCreateBody(body) {
|
|
|
5385
5402
|
delete smartKpiView.organizationId;
|
|
5386
5403
|
return { smart_kpi_view: smartKpiView };
|
|
5387
5404
|
}
|
|
5388
|
-
function normalizeScorecardsCreateBody(
|
|
5389
|
-
const measurable = ensureEntityObject(
|
|
5405
|
+
function normalizeScorecardsCreateBody(body2) {
|
|
5406
|
+
const measurable = ensureEntityObject(body2, "measurable");
|
|
5390
5407
|
const interval = validateEnumField({
|
|
5391
5408
|
rawValue: measurable.interval,
|
|
5392
5409
|
field: "measurable.interval",
|
|
@@ -5401,7 +5418,7 @@ function normalizeScorecardsCreateBody(body) {
|
|
|
5401
5418
|
message: "Invalid measurable.trend. Use one of: average, total."
|
|
5402
5419
|
});
|
|
5403
5420
|
measurable.trend = trend ?? "average";
|
|
5404
|
-
return { ...
|
|
5421
|
+
return { ...body2, measurable };
|
|
5405
5422
|
}
|
|
5406
5423
|
function buildKpisCreateMutation(params) {
|
|
5407
5424
|
const entity = params.body.smart_kpi;
|
|
@@ -5490,7 +5507,7 @@ function registerSmartKpiViewCommands(program) {
|
|
|
5490
5507
|
).action(async (opts, cmd) => {
|
|
5491
5508
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5492
5509
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5493
|
-
const
|
|
5510
|
+
const body2 = normalizeSmartKpiViewCreateBody(
|
|
5494
5511
|
parseSmartKpiViewCreateBody(String(opts.dataJson))
|
|
5495
5512
|
);
|
|
5496
5513
|
await runGraphqlMutationCommand({
|
|
@@ -5499,7 +5516,7 @@ function registerSmartKpiViewCommands(program) {
|
|
|
5499
5516
|
field: "create_smart_kpi_view",
|
|
5500
5517
|
variables: {
|
|
5501
5518
|
organization_id: organizationId,
|
|
5502
|
-
params:
|
|
5519
|
+
params: body2
|
|
5503
5520
|
}
|
|
5504
5521
|
});
|
|
5505
5522
|
});
|
|
@@ -5578,10 +5595,10 @@ function registerSystemToolCommands(program) {
|
|
|
5578
5595
|
allowQueryJson: false
|
|
5579
5596
|
});
|
|
5580
5597
|
registerEntityCrudCommands(program, {
|
|
5581
|
-
command: "
|
|
5582
|
-
description: "
|
|
5583
|
-
resourcePath: "
|
|
5584
|
-
rootKey: "
|
|
5598
|
+
command: "goal-collections",
|
|
5599
|
+
description: "Goal collection operations",
|
|
5600
|
+
resourcePath: "goal_collections",
|
|
5601
|
+
rootKey: "goal_collection",
|
|
5585
5602
|
listParams: ["member_id", "team_ids"],
|
|
5586
5603
|
showParams: ["current_member_id"],
|
|
5587
5604
|
allowQueryJson: false
|
|
@@ -5641,7 +5658,7 @@ function registerSystemToolCommands(program) {
|
|
|
5641
5658
|
normalizeCreateBody: normalizeNewsCreateBody,
|
|
5642
5659
|
listParams: ["meeting_id", "team_id", "unread"],
|
|
5643
5660
|
allowQueryJson: false,
|
|
5644
|
-
showQueryFactory: ({ id, organizationId }) => ({
|
|
5661
|
+
showQueryFactory: ({ id: id2, organizationId }) => ({
|
|
5645
5662
|
field: "headlines",
|
|
5646
5663
|
variables: {
|
|
5647
5664
|
organization_id: organizationId,
|
|
@@ -5659,7 +5676,7 @@ function registerSystemToolCommands(program) {
|
|
|
5659
5676
|
if (!row || typeof row !== "object") {
|
|
5660
5677
|
return false;
|
|
5661
5678
|
}
|
|
5662
|
-
return String(row.id ?? "") ===
|
|
5679
|
+
return String(row.id ?? "") === id2;
|
|
5663
5680
|
}) ?? null;
|
|
5664
5681
|
}
|
|
5665
5682
|
})
|
|
@@ -5703,8 +5720,8 @@ function registerSystemToolCommands(program) {
|
|
|
5703
5720
|
description: "KPI operations",
|
|
5704
5721
|
resourcePath: "smart_kpis",
|
|
5705
5722
|
rootKey: "smart_kpi",
|
|
5706
|
-
createMutationFactory: ({ body, organizationId }) => buildKpisCreateMutation({
|
|
5707
|
-
body,
|
|
5723
|
+
createMutationFactory: ({ body: body2, organizationId }) => buildKpisCreateMutation({
|
|
5724
|
+
body: body2,
|
|
5708
5725
|
organizationId
|
|
5709
5726
|
}),
|
|
5710
5727
|
listParams: ["team_id", "member_id", "smart_kpi_view_id", "quarterly_objective_id"],
|
|
@@ -5778,7 +5795,7 @@ function registerTeamCommands(program) {
|
|
|
5778
5795
|
});
|
|
5779
5796
|
});
|
|
5780
5797
|
teams.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
5781
|
-
const
|
|
5798
|
+
const id2 = idSchema9.parse(opts.id);
|
|
5782
5799
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5783
5800
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5784
5801
|
await runGraphqlQueryCommand({
|
|
@@ -5787,7 +5804,7 @@ function registerTeamCommands(program) {
|
|
|
5787
5804
|
field: "team",
|
|
5788
5805
|
variables: {
|
|
5789
5806
|
organization_id: organizationId,
|
|
5790
|
-
id
|
|
5807
|
+
id: id2
|
|
5791
5808
|
},
|
|
5792
5809
|
isShow: true
|
|
5793
5810
|
});
|
|
@@ -5795,30 +5812,30 @@ function registerTeamCommands(program) {
|
|
|
5795
5812
|
teams.command("create").requiredOption("--data-json <dataJson>", 'JSON object for team or {"team": {...}}').action(async (opts, cmd) => {
|
|
5796
5813
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5797
5814
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5798
|
-
const
|
|
5815
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "team");
|
|
5799
5816
|
await runGraphqlMutationCommand({
|
|
5800
5817
|
command: "teams.create",
|
|
5801
5818
|
runtimeOptions: context.runtimeOptions,
|
|
5802
5819
|
field: "create_team",
|
|
5803
5820
|
variables: {
|
|
5804
5821
|
organization_id: organizationId,
|
|
5805
|
-
params:
|
|
5822
|
+
params: body2
|
|
5806
5823
|
}
|
|
5807
5824
|
});
|
|
5808
5825
|
});
|
|
5809
5826
|
teams.command("update").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", 'JSON object for team or {"team": {...}}').action(async (opts, cmd) => {
|
|
5810
|
-
const
|
|
5827
|
+
const id2 = idSchema9.parse(opts.id);
|
|
5811
5828
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5812
5829
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5813
|
-
const
|
|
5830
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "team");
|
|
5814
5831
|
await runGraphqlMutationCommand({
|
|
5815
5832
|
command: "teams.update",
|
|
5816
5833
|
runtimeOptions: context.runtimeOptions,
|
|
5817
5834
|
field: "update_team",
|
|
5818
5835
|
variables: {
|
|
5819
5836
|
organization_id: organizationId,
|
|
5820
|
-
team_id:
|
|
5821
|
-
params:
|
|
5837
|
+
team_id: id2,
|
|
5838
|
+
params: body2
|
|
5822
5839
|
}
|
|
5823
5840
|
});
|
|
5824
5841
|
});
|
|
@@ -5830,8 +5847,8 @@ var idSchema10 = import_zod13.z.string().min(1);
|
|
|
5830
5847
|
function isRecord3(value) {
|
|
5831
5848
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
5832
5849
|
}
|
|
5833
|
-
function ensureRootObject(
|
|
5834
|
-
const root =
|
|
5850
|
+
function ensureRootObject(body2, rootKey) {
|
|
5851
|
+
const root = body2[rootKey];
|
|
5835
5852
|
if (!isRecord3(root)) {
|
|
5836
5853
|
throw new CliError({
|
|
5837
5854
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
@@ -5849,8 +5866,8 @@ function asNonEmptyString3(value) {
|
|
|
5849
5866
|
const trimmed = value.trim();
|
|
5850
5867
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
5851
5868
|
}
|
|
5852
|
-
function normalizeOrganizationUpdateBody(
|
|
5853
|
-
const organization = ensureRootObject(
|
|
5869
|
+
function normalizeOrganizationUpdateBody(body2) {
|
|
5870
|
+
const organization = ensureRootObject(body2, "organization");
|
|
5854
5871
|
const detail = isRecord3(organization.organization_detail_attributes) ? { ...organization.organization_detail_attributes } : {};
|
|
5855
5872
|
const workspaceName = asNonEmptyString3(organization.workspace_name);
|
|
5856
5873
|
if (workspaceName) {
|
|
@@ -5862,8 +5879,8 @@ function normalizeOrganizationUpdateBody(body) {
|
|
|
5862
5879
|
}
|
|
5863
5880
|
return { organization };
|
|
5864
5881
|
}
|
|
5865
|
-
function normalizeOrganizationMetaProfileUpdateBody(
|
|
5866
|
-
const root = ensureRootObject(
|
|
5882
|
+
function normalizeOrganizationMetaProfileUpdateBody(body2) {
|
|
5883
|
+
const root = ensureRootObject(body2, "organization_meta_profile");
|
|
5867
5884
|
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
5868
5885
|
const title = asNonEmptyString3(root.title);
|
|
5869
5886
|
if (title) {
|
|
@@ -5892,8 +5909,8 @@ function normalizeOrganizationMetaProfileUpdateBody(body) {
|
|
|
5892
5909
|
}
|
|
5893
5910
|
return { organization_meta_profile: { profile } };
|
|
5894
5911
|
}
|
|
5895
|
-
function normalizeKeyMetricMetaProfileUpdateBody(
|
|
5896
|
-
const root = ensureRootObject(
|
|
5912
|
+
function normalizeKeyMetricMetaProfileUpdateBody(body2) {
|
|
5913
|
+
const root = ensureRootObject(body2, "key_metric_meta_profile");
|
|
5897
5914
|
const profile = isRecord3(root.profile) ? { ...root.profile } : {};
|
|
5898
5915
|
const annualRevenue = asNonEmptyString3(root.annual_revenue);
|
|
5899
5916
|
if (annualRevenue) {
|
|
@@ -5929,12 +5946,12 @@ function registerOrganizationCommands(program) {
|
|
|
5929
5946
|
organizations.command("show").option("--id <id>", "Organization ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
5930
5947
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5931
5948
|
const fallbackId = resolveOrganizationId(context.organizationId);
|
|
5932
|
-
const
|
|
5949
|
+
const id2 = idSchema10.parse(opts.id ?? fallbackId);
|
|
5933
5950
|
await runGraphqlQueryCommand({
|
|
5934
5951
|
command: "organizations.show",
|
|
5935
5952
|
runtimeOptions: context.runtimeOptions,
|
|
5936
5953
|
field: "organization",
|
|
5937
|
-
variables: { id },
|
|
5954
|
+
variables: { id: id2 },
|
|
5938
5955
|
isShow: true
|
|
5939
5956
|
});
|
|
5940
5957
|
});
|
|
@@ -5957,16 +5974,16 @@ function registerOrganizationCommands(program) {
|
|
|
5957
5974
|
).action(async (opts, cmd) => {
|
|
5958
5975
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5959
5976
|
const fallbackId = resolveOrganizationId(context.organizationId);
|
|
5960
|
-
const
|
|
5977
|
+
const id2 = idSchema10.parse(opts.id ?? fallbackId);
|
|
5961
5978
|
const rawBody = __testables.normalizeBody(String(opts.dataJson), "organization");
|
|
5962
|
-
const
|
|
5979
|
+
const body2 = normalizeOrganizationUpdateBody(rawBody);
|
|
5963
5980
|
await runGraphqlMutationCommand({
|
|
5964
5981
|
command: "organizations.update",
|
|
5965
5982
|
runtimeOptions: context.runtimeOptions,
|
|
5966
5983
|
field: "update_organization",
|
|
5967
5984
|
variables: {
|
|
5968
|
-
id,
|
|
5969
|
-
params:
|
|
5985
|
+
id: id2,
|
|
5986
|
+
params: body2
|
|
5970
5987
|
}
|
|
5971
5988
|
});
|
|
5972
5989
|
});
|
|
@@ -5974,14 +5991,14 @@ function registerOrganizationCommands(program) {
|
|
|
5974
5991
|
metaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
5975
5992
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5976
5993
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5977
|
-
const
|
|
5994
|
+
const id2 = idSchema10.parse(opts.id ?? organizationId);
|
|
5978
5995
|
await runGraphqlQueryCommand({
|
|
5979
5996
|
command: "organizations.meta-profile.show",
|
|
5980
5997
|
runtimeOptions: context.runtimeOptions,
|
|
5981
5998
|
field: "organization_meta_profile",
|
|
5982
5999
|
variables: {
|
|
5983
6000
|
organization_id: organizationId,
|
|
5984
|
-
id
|
|
6001
|
+
id: id2
|
|
5985
6002
|
},
|
|
5986
6003
|
isShow: true
|
|
5987
6004
|
});
|
|
@@ -5992,20 +6009,20 @@ function registerOrganizationCommands(program) {
|
|
|
5992
6009
|
).action(async (opts, cmd) => {
|
|
5993
6010
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
5994
6011
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
5995
|
-
const
|
|
6012
|
+
const id2 = idSchema10.parse(opts.id ?? organizationId);
|
|
5996
6013
|
const rawBody = __testables.normalizeBody(
|
|
5997
6014
|
String(opts.dataJson),
|
|
5998
6015
|
"organization_meta_profile"
|
|
5999
6016
|
);
|
|
6000
|
-
const
|
|
6017
|
+
const body2 = normalizeOrganizationMetaProfileUpdateBody(rawBody);
|
|
6001
6018
|
await runGraphqlMutationCommand({
|
|
6002
6019
|
command: "organizations.meta-profile.update",
|
|
6003
6020
|
runtimeOptions: context.runtimeOptions,
|
|
6004
6021
|
field: "update_organization_meta_profile",
|
|
6005
6022
|
variables: {
|
|
6006
6023
|
organization_id: organizationId,
|
|
6007
|
-
organization_meta_profile_id:
|
|
6008
|
-
params:
|
|
6024
|
+
organization_meta_profile_id: id2,
|
|
6025
|
+
params: body2
|
|
6009
6026
|
}
|
|
6010
6027
|
});
|
|
6011
6028
|
});
|
|
@@ -6013,14 +6030,14 @@ function registerOrganizationCommands(program) {
|
|
|
6013
6030
|
keyMetricMetaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
|
|
6014
6031
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6015
6032
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6016
|
-
const
|
|
6033
|
+
const id2 = idSchema10.parse(opts.id ?? organizationId);
|
|
6017
6034
|
await runGraphqlQueryCommand({
|
|
6018
6035
|
command: "organizations.key-metric-meta-profile.show",
|
|
6019
6036
|
runtimeOptions: context.runtimeOptions,
|
|
6020
6037
|
field: "key_metric_meta_profile",
|
|
6021
6038
|
variables: {
|
|
6022
6039
|
organization_id: organizationId,
|
|
6023
|
-
id
|
|
6040
|
+
id: id2
|
|
6024
6041
|
},
|
|
6025
6042
|
isShow: true
|
|
6026
6043
|
});
|
|
@@ -6031,20 +6048,20 @@ function registerOrganizationCommands(program) {
|
|
|
6031
6048
|
).action(async (opts, cmd) => {
|
|
6032
6049
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6033
6050
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6034
|
-
const
|
|
6051
|
+
const id2 = idSchema10.parse(opts.id ?? organizationId);
|
|
6035
6052
|
const rawBody = __testables.normalizeBody(
|
|
6036
6053
|
String(opts.dataJson),
|
|
6037
6054
|
"key_metric_meta_profile"
|
|
6038
6055
|
);
|
|
6039
|
-
const
|
|
6056
|
+
const body2 = normalizeKeyMetricMetaProfileUpdateBody(rawBody);
|
|
6040
6057
|
await runGraphqlMutationCommand({
|
|
6041
6058
|
command: "organizations.key-metric-meta-profile.update",
|
|
6042
6059
|
runtimeOptions: context.runtimeOptions,
|
|
6043
6060
|
field: "update_key_metric_meta_profile",
|
|
6044
6061
|
variables: {
|
|
6045
6062
|
organization_id: organizationId,
|
|
6046
|
-
key_metric_meta_profile_id:
|
|
6047
|
-
params:
|
|
6063
|
+
key_metric_meta_profile_id: id2,
|
|
6064
|
+
params: body2
|
|
6048
6065
|
}
|
|
6049
6066
|
});
|
|
6050
6067
|
});
|
|
@@ -6067,8 +6084,8 @@ var STRATEGIC_OBJECTIVE_ALLOWED_UPDATE_KEYS = /* @__PURE__ */ new Set([
|
|
|
6067
6084
|
function isRecord4(value) {
|
|
6068
6085
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
6069
6086
|
}
|
|
6070
|
-
function ensureRootObject2(
|
|
6071
|
-
const root =
|
|
6087
|
+
function ensureRootObject2(body2, rootKey) {
|
|
6088
|
+
const root = body2[rootKey];
|
|
6072
6089
|
if (!isRecord4(root)) {
|
|
6073
6090
|
throw new CliError({
|
|
6074
6091
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
@@ -6086,8 +6103,8 @@ function asNonEmptyString4(value) {
|
|
|
6086
6103
|
const trimmed = value.trim();
|
|
6087
6104
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
6088
6105
|
}
|
|
6089
|
-
function normalizeStrategicPlanUpdateBody(
|
|
6090
|
-
const strategicPlan = ensureRootObject2(
|
|
6106
|
+
function normalizeStrategicPlanUpdateBody(body2) {
|
|
6107
|
+
const strategicPlan = ensureRootObject2(body2, "strategic_plan");
|
|
6091
6108
|
const unsupported = Object.keys(strategicPlan).filter(
|
|
6092
6109
|
(key) => !STRATEGIC_PLAN_ALLOWED_UPDATE_KEYS.has(key)
|
|
6093
6110
|
);
|
|
@@ -6105,8 +6122,8 @@ function normalizeStrategicPlanUpdateBody(body) {
|
|
|
6105
6122
|
}
|
|
6106
6123
|
return { strategic_plan: strategicPlan };
|
|
6107
6124
|
}
|
|
6108
|
-
function normalizeStrategicObjectiveUpdateBody(
|
|
6109
|
-
const strategicObjective = ensureRootObject2(
|
|
6125
|
+
function normalizeStrategicObjectiveUpdateBody(body2) {
|
|
6126
|
+
const strategicObjective = ensureRootObject2(body2, "strategic_objective");
|
|
6110
6127
|
const title = asNonEmptyString4(strategicObjective.title);
|
|
6111
6128
|
if (!asNonEmptyString4(strategicObjective.summary) && title) {
|
|
6112
6129
|
strategicObjective.summary = title;
|
|
@@ -6129,8 +6146,8 @@ function normalizeStrategicObjectiveUpdateBody(body) {
|
|
|
6129
6146
|
}
|
|
6130
6147
|
return { strategic_objective: strategicObjective };
|
|
6131
6148
|
}
|
|
6132
|
-
function normalizeAnnualObjectiveCreateBody(
|
|
6133
|
-
const annualObjective = ensureRootObject2(
|
|
6149
|
+
function normalizeAnnualObjectiveCreateBody(body2) {
|
|
6150
|
+
const annualObjective = ensureRootObject2(body2, "annual_objective");
|
|
6134
6151
|
const title = asNonEmptyString4(annualObjective.title);
|
|
6135
6152
|
if (!asNonEmptyString4(annualObjective.name) && title) {
|
|
6136
6153
|
annualObjective.name = title;
|
|
@@ -6138,8 +6155,8 @@ function normalizeAnnualObjectiveCreateBody(body) {
|
|
|
6138
6155
|
delete annualObjective.title;
|
|
6139
6156
|
return { annual_objective: annualObjective };
|
|
6140
6157
|
}
|
|
6141
|
-
function normalizeQuarterlyObjectiveCreateBody(
|
|
6142
|
-
const quarterlyObjective = ensureRootObject2(
|
|
6158
|
+
function normalizeQuarterlyObjectiveCreateBody(body2) {
|
|
6159
|
+
const quarterlyObjective = ensureRootObject2(body2, "quarterly_objective");
|
|
6143
6160
|
const title = asNonEmptyString4(quarterlyObjective.title);
|
|
6144
6161
|
if (!asNonEmptyString4(quarterlyObjective.name) && title) {
|
|
6145
6162
|
quarterlyObjective.name = title;
|
|
@@ -6154,14 +6171,14 @@ function registerFoundationCommands(program) {
|
|
|
6154
6171
|
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) => {
|
|
6155
6172
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6156
6173
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6157
|
-
const
|
|
6174
|
+
const id2 = idSchema11.parse(opts.id ?? organizationId);
|
|
6158
6175
|
await runGraphqlQueryCommand({
|
|
6159
6176
|
command: "foundation.strategic-plans.show",
|
|
6160
6177
|
runtimeOptions: context.runtimeOptions,
|
|
6161
6178
|
field: "strategic_plan",
|
|
6162
6179
|
variables: normalizeGraphqlVariables2({
|
|
6163
6180
|
organization_id: organizationId,
|
|
6164
|
-
id,
|
|
6181
|
+
id: id2,
|
|
6165
6182
|
progress_scope: opts.progressScope,
|
|
6166
6183
|
all_progress: opts.allProgress,
|
|
6167
6184
|
all: opts.all
|
|
@@ -6175,31 +6192,31 @@ function registerFoundationCommands(program) {
|
|
|
6175
6192
|
).action(async (opts, cmd) => {
|
|
6176
6193
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6177
6194
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6178
|
-
const
|
|
6195
|
+
const id2 = idSchema11.parse(opts.id ?? organizationId);
|
|
6179
6196
|
const rawBody = __testables.normalizeBody(String(opts.dataJson), "strategic_plan");
|
|
6180
|
-
const
|
|
6197
|
+
const body2 = normalizeStrategicPlanUpdateBody(rawBody);
|
|
6181
6198
|
await runGraphqlMutationCommand({
|
|
6182
6199
|
command: "foundation.strategic-plans.update",
|
|
6183
6200
|
runtimeOptions: context.runtimeOptions,
|
|
6184
6201
|
field: "update_strategic_plan",
|
|
6185
6202
|
variables: {
|
|
6186
6203
|
organization_id: organizationId,
|
|
6187
|
-
strategic_plan_id:
|
|
6188
|
-
params:
|
|
6204
|
+
strategic_plan_id: id2,
|
|
6205
|
+
params: body2
|
|
6189
6206
|
}
|
|
6190
6207
|
});
|
|
6191
6208
|
});
|
|
6192
6209
|
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) => {
|
|
6193
6210
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6194
6211
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6195
|
-
const
|
|
6212
|
+
const id2 = idSchema11.parse(opts.id ?? organizationId);
|
|
6196
6213
|
await runGraphqlQueryCommand({
|
|
6197
6214
|
command: "foundation.strategic-objectives.show",
|
|
6198
6215
|
runtimeOptions: context.runtimeOptions,
|
|
6199
6216
|
field: "strategic_objective",
|
|
6200
6217
|
variables: normalizeGraphqlVariables2({
|
|
6201
6218
|
organization_id: organizationId,
|
|
6202
|
-
id,
|
|
6219
|
+
id: id2,
|
|
6203
6220
|
progress_scope: opts.progressScope,
|
|
6204
6221
|
all_progress: opts.allProgress,
|
|
6205
6222
|
all: opts.all
|
|
@@ -6213,20 +6230,20 @@ function registerFoundationCommands(program) {
|
|
|
6213
6230
|
).action(async (opts, cmd) => {
|
|
6214
6231
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6215
6232
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6216
|
-
const
|
|
6233
|
+
const id2 = idSchema11.parse(opts.id ?? organizationId);
|
|
6217
6234
|
const rawBody = __testables.normalizeBody(
|
|
6218
6235
|
String(opts.dataJson),
|
|
6219
6236
|
"strategic_objective"
|
|
6220
6237
|
);
|
|
6221
|
-
const
|
|
6238
|
+
const body2 = normalizeStrategicObjectiveUpdateBody(rawBody);
|
|
6222
6239
|
await runGraphqlMutationCommand({
|
|
6223
6240
|
command: "foundation.strategic-objectives.update",
|
|
6224
6241
|
runtimeOptions: context.runtimeOptions,
|
|
6225
6242
|
field: "update_strategic_objective",
|
|
6226
6243
|
variables: {
|
|
6227
6244
|
organization_id: organizationId,
|
|
6228
|
-
strategic_objective_id:
|
|
6229
|
-
params:
|
|
6245
|
+
strategic_objective_id: id2,
|
|
6246
|
+
params: body2
|
|
6230
6247
|
}
|
|
6231
6248
|
});
|
|
6232
6249
|
});
|
|
@@ -6266,7 +6283,7 @@ var NOTE_DETAIL_FIELDS = [
|
|
|
6266
6283
|
];
|
|
6267
6284
|
var PARENT_KIND_LABELS = {
|
|
6268
6285
|
task: "task",
|
|
6269
|
-
|
|
6286
|
+
goal: "goal",
|
|
6270
6287
|
listItem: "list item",
|
|
6271
6288
|
todo: "todo",
|
|
6272
6289
|
issue: "issue",
|
|
@@ -6348,8 +6365,8 @@ function normalizeBody2(raw, rootKey) {
|
|
|
6348
6365
|
}
|
|
6349
6366
|
return { [rootKey]: payload };
|
|
6350
6367
|
}
|
|
6351
|
-
function assertRequiredParent(
|
|
6352
|
-
const entity =
|
|
6368
|
+
function assertRequiredParent(body2, rootKey, parentKey) {
|
|
6369
|
+
const entity = body2[rootKey];
|
|
6353
6370
|
if (!entity || typeof entity !== "object" || Array.isArray(entity)) {
|
|
6354
6371
|
throw new CliError({
|
|
6355
6372
|
message: `Invalid payload. Expected object at "${rootKey}".`,
|
|
@@ -6372,10 +6389,10 @@ function attrValue(attrs, keys) {
|
|
|
6372
6389
|
if (!attrs || typeof attrs !== "object" || Array.isArray(attrs)) {
|
|
6373
6390
|
return void 0;
|
|
6374
6391
|
}
|
|
6375
|
-
const
|
|
6392
|
+
const record2 = attrs;
|
|
6376
6393
|
for (const key of keys) {
|
|
6377
|
-
if (
|
|
6378
|
-
return
|
|
6394
|
+
if (record2[key] !== void 0 && record2[key] !== null && `${record2[key]}`.trim() !== "") {
|
|
6395
|
+
return record2[key];
|
|
6379
6396
|
}
|
|
6380
6397
|
}
|
|
6381
6398
|
return void 0;
|
|
@@ -6405,8 +6422,8 @@ function normalizePlacementRow(row, parentKind, parentIdFallback, parentTypedFie
|
|
|
6405
6422
|
};
|
|
6406
6423
|
}
|
|
6407
6424
|
function normalizeListPayload(payload, parentKind, parentIdFallback, parentTypedField) {
|
|
6408
|
-
const
|
|
6409
|
-
const rows = Array.isArray(
|
|
6425
|
+
const record2 = payload && typeof payload === "object" && !Array.isArray(payload) ? payload : {};
|
|
6426
|
+
const rows = Array.isArray(record2.data) ? record2.data : [];
|
|
6410
6427
|
const normalizedRows = rows.map(
|
|
6411
6428
|
(row) => normalizePlacementRow(
|
|
6412
6429
|
row,
|
|
@@ -6417,15 +6434,15 @@ function normalizeListPayload(payload, parentKind, parentIdFallback, parentTyped
|
|
|
6417
6434
|
);
|
|
6418
6435
|
return {
|
|
6419
6436
|
data: normalizedRows,
|
|
6420
|
-
count:
|
|
6421
|
-
currentPage:
|
|
6422
|
-
totalPages:
|
|
6437
|
+
count: record2.count ?? normalizedRows.length,
|
|
6438
|
+
currentPage: record2.currentPage ?? 1,
|
|
6439
|
+
totalPages: record2.totalPages ?? 1
|
|
6423
6440
|
};
|
|
6424
6441
|
}
|
|
6425
|
-
function normalizeSubtaskCreateBody(
|
|
6426
|
-
const subtask =
|
|
6442
|
+
function normalizeSubtaskCreateBody(body2) {
|
|
6443
|
+
const subtask = body2.subtask;
|
|
6427
6444
|
if (!subtask || typeof subtask !== "object" || Array.isArray(subtask)) {
|
|
6428
|
-
return
|
|
6445
|
+
return body2;
|
|
6429
6446
|
}
|
|
6430
6447
|
const subtaskRecord = subtask;
|
|
6431
6448
|
const summary = typeof subtaskRecord.summary === "string" ? subtaskRecord.summary.trim() : void 0;
|
|
@@ -6434,7 +6451,7 @@ function normalizeSubtaskCreateBody(body) {
|
|
|
6434
6451
|
subtaskRecord.name = summary;
|
|
6435
6452
|
}
|
|
6436
6453
|
delete subtaskRecord.summary;
|
|
6437
|
-
return
|
|
6454
|
+
return body2;
|
|
6438
6455
|
}
|
|
6439
6456
|
function registerChildCommands(program, config) {
|
|
6440
6457
|
const command = program.command(config.command).description(config.description);
|
|
@@ -6483,7 +6500,7 @@ function registerChildCommands(program, config) {
|
|
|
6483
6500
|
command.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
6484
6501
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6485
6502
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6486
|
-
const
|
|
6503
|
+
const id2 = idSchema12.parse(opts.id);
|
|
6487
6504
|
await runGraphqlQueryCommand({
|
|
6488
6505
|
command: `${config.command}.show`,
|
|
6489
6506
|
...config.showOperationName ? { operationName: config.showOperationName } : {},
|
|
@@ -6491,7 +6508,7 @@ function registerChildCommands(program, config) {
|
|
|
6491
6508
|
field: showField,
|
|
6492
6509
|
variables: {
|
|
6493
6510
|
organization_id: organizationId,
|
|
6494
|
-
id
|
|
6511
|
+
id: id2
|
|
6495
6512
|
},
|
|
6496
6513
|
variableTypes: {
|
|
6497
6514
|
organization_id: "ID!",
|
|
@@ -6522,12 +6539,12 @@ function registerChildCommands(program, config) {
|
|
|
6522
6539
|
).action(async (opts, cmd) => {
|
|
6523
6540
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6524
6541
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6525
|
-
let
|
|
6542
|
+
let body2 = normalizeBody2(String(opts.dataJson), config.rootKey);
|
|
6526
6543
|
if (config.normalizeCreateBody) {
|
|
6527
|
-
|
|
6544
|
+
body2 = config.normalizeCreateBody(body2);
|
|
6528
6545
|
}
|
|
6529
|
-
assertOperationPayload(`${config.command}.create`,
|
|
6530
|
-
assertRequiredParent(
|
|
6546
|
+
assertOperationPayload(`${config.command}.create`, body2);
|
|
6547
|
+
assertRequiredParent(body2, config.rootKey, config.parentFlag.replace(/-/g, "_"));
|
|
6531
6548
|
await runGraphqlMutationCommand({
|
|
6532
6549
|
command: `${config.command}.create`,
|
|
6533
6550
|
operationName: config.createOperationName,
|
|
@@ -6535,7 +6552,7 @@ function registerChildCommands(program, config) {
|
|
|
6535
6552
|
field: config.createField,
|
|
6536
6553
|
variables: {
|
|
6537
6554
|
organization_id: organizationId,
|
|
6538
|
-
params:
|
|
6555
|
+
params: body2
|
|
6539
6556
|
}
|
|
6540
6557
|
});
|
|
6541
6558
|
});
|
|
@@ -6545,9 +6562,9 @@ function registerChildCommands(program, config) {
|
|
|
6545
6562
|
).action(async (opts, cmd) => {
|
|
6546
6563
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6547
6564
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6548
|
-
const
|
|
6549
|
-
const
|
|
6550
|
-
assertOperationPayload(`${config.command}.update`,
|
|
6565
|
+
const id2 = idSchema12.parse(opts.id);
|
|
6566
|
+
const body2 = normalizeBody2(String(opts.dataJson), config.rootKey);
|
|
6567
|
+
assertOperationPayload(`${config.command}.update`, body2);
|
|
6551
6568
|
await runGraphqlMutationCommand({
|
|
6552
6569
|
command: `${config.command}.update`,
|
|
6553
6570
|
operationName: config.updateOperationName,
|
|
@@ -6555,15 +6572,15 @@ function registerChildCommands(program, config) {
|
|
|
6555
6572
|
field: config.updateField,
|
|
6556
6573
|
variables: {
|
|
6557
6574
|
organization_id: organizationId,
|
|
6558
|
-
[config.idVariable]:
|
|
6559
|
-
params:
|
|
6575
|
+
[config.idVariable]: id2,
|
|
6576
|
+
params: body2
|
|
6560
6577
|
}
|
|
6561
6578
|
});
|
|
6562
6579
|
});
|
|
6563
6580
|
command.command("destroy").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
6564
6581
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6565
6582
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6566
|
-
const
|
|
6583
|
+
const id2 = idSchema12.parse(opts.id);
|
|
6567
6584
|
await runGraphqlMutationCommand({
|
|
6568
6585
|
command: `${config.command}.destroy`,
|
|
6569
6586
|
operationName: config.destroyOperationName,
|
|
@@ -6571,7 +6588,7 @@ function registerChildCommands(program, config) {
|
|
|
6571
6588
|
field: config.destroyField,
|
|
6572
6589
|
variables: {
|
|
6573
6590
|
organization_id: organizationId,
|
|
6574
|
-
[config.idVariable]:
|
|
6591
|
+
[config.idVariable]: id2
|
|
6575
6592
|
}
|
|
6576
6593
|
});
|
|
6577
6594
|
});
|
|
@@ -6608,8 +6625,8 @@ function registerChildEntityCommands(program) {
|
|
|
6608
6625
|
registerChildCommands(program, {
|
|
6609
6626
|
command: "milestones",
|
|
6610
6627
|
description: "Milestone operations",
|
|
6611
|
-
parentFlag: "
|
|
6612
|
-
parentKind: "
|
|
6628
|
+
parentFlag: "goal-id",
|
|
6629
|
+
parentKind: "goal",
|
|
6613
6630
|
rootKey: "milestone",
|
|
6614
6631
|
listField: "milestones",
|
|
6615
6632
|
createField: "create_milestone",
|
|
@@ -6620,12 +6637,12 @@ function registerChildEntityCommands(program) {
|
|
|
6620
6637
|
createOperationName: "MilestonesCreate",
|
|
6621
6638
|
updateOperationName: "MilestonesUpdate",
|
|
6622
6639
|
destroyOperationName: "MilestonesDestroy",
|
|
6623
|
-
listSelectionSet: buildChildListSelectionSet("
|
|
6624
|
-
listParentTypedField: "
|
|
6625
|
-
searchRequiredOptions: requiredParentSearchOption("
|
|
6640
|
+
listSelectionSet: buildChildListSelectionSet("goalId"),
|
|
6641
|
+
listParentTypedField: "goalId",
|
|
6642
|
+
searchRequiredOptions: requiredParentSearchOption("goal-id", "goal"),
|
|
6626
6643
|
showField: "milestone",
|
|
6627
6644
|
showOperationName: "MilestonesShow",
|
|
6628
|
-
showSelectionSet: buildChildResourceSelectionSet("
|
|
6645
|
+
showSelectionSet: buildChildResourceSelectionSet("goalId", NOTE_DETAIL_FIELDS)
|
|
6629
6646
|
});
|
|
6630
6647
|
registerChildCommands(program, {
|
|
6631
6648
|
command: "subitems",
|
|
@@ -6774,7 +6791,7 @@ function registerContentCommands(program) {
|
|
|
6774
6791
|
content.command("show").requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
6775
6792
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
6776
6793
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
6777
|
-
const
|
|
6794
|
+
const id2 = idSchema13.parse(opts.id);
|
|
6778
6795
|
await runGraphqlQueryCommand({
|
|
6779
6796
|
command: "content.show",
|
|
6780
6797
|
operationName: "ContentShow",
|
|
@@ -6782,7 +6799,7 @@ function registerContentCommands(program) {
|
|
|
6782
6799
|
field: "content",
|
|
6783
6800
|
variables: normalizeGraphqlVariables2({
|
|
6784
6801
|
organization_id: organizationId,
|
|
6785
|
-
id
|
|
6802
|
+
id: id2
|
|
6786
6803
|
}),
|
|
6787
6804
|
isShow: true,
|
|
6788
6805
|
selectionSet: `{ id type resources { id resourceType slug url } ${contentAttributesSelection} }`
|
|
@@ -7092,10 +7109,10 @@ function setInternalCliOptions(program, options) {
|
|
|
7092
7109
|
function getInternalCliOptions(command) {
|
|
7093
7110
|
let current = command;
|
|
7094
7111
|
while (current) {
|
|
7095
|
-
const
|
|
7096
|
-
if (
|
|
7112
|
+
const record2 = asRecord3(current[INTERNAL_OPTIONS_KEY]);
|
|
7113
|
+
if (record2) {
|
|
7097
7114
|
return {
|
|
7098
|
-
enableRetryOnEmptyPhrase:
|
|
7115
|
+
enableRetryOnEmptyPhrase: record2.enableRetryOnEmptyPhrase === true
|
|
7099
7116
|
};
|
|
7100
7117
|
}
|
|
7101
7118
|
current = current.parent ?? null;
|
|
@@ -7895,7 +7912,7 @@ var import_commander = require("commander");
|
|
|
7895
7912
|
var import_node_crypto3 = require("crypto");
|
|
7896
7913
|
|
|
7897
7914
|
// src/version.ts
|
|
7898
|
-
var CLI_VERSION = "0.
|
|
7915
|
+
var CLI_VERSION = "0.2.0";
|
|
7899
7916
|
|
|
7900
7917
|
// src/operationMetadata.ts
|
|
7901
7918
|
var DISCOVERY_OPERATION_IDS = [
|
|
@@ -7971,10 +7988,10 @@ var DISCOVERY_OPERATION_IDS = [
|
|
|
7971
7988
|
"questions.schema",
|
|
7972
7989
|
"recognition.examples",
|
|
7973
7990
|
"recognition.schema",
|
|
7974
|
-
"
|
|
7975
|
-
"
|
|
7976
|
-
"
|
|
7977
|
-
"
|
|
7991
|
+
"goal-collections.examples",
|
|
7992
|
+
"goal-collections.schema",
|
|
7993
|
+
"goals.examples",
|
|
7994
|
+
"goals.schema",
|
|
7978
7995
|
"scorecard-groups.examples",
|
|
7979
7996
|
"scorecard-groups.schema",
|
|
7980
7997
|
"scorecards.examples",
|
|
@@ -8016,6 +8033,7 @@ var READ_OPERATION_IDS = [
|
|
|
8016
8033
|
"accountability.list",
|
|
8017
8034
|
"accountability.search",
|
|
8018
8035
|
"accountability.show",
|
|
8036
|
+
"agents.details-show",
|
|
8019
8037
|
"agents.plugin-catalog",
|
|
8020
8038
|
"agents.show",
|
|
8021
8039
|
"auth.status",
|
|
@@ -8155,14 +8173,14 @@ var READ_OPERATION_IDS = [
|
|
|
8155
8173
|
"recognition.point-balance",
|
|
8156
8174
|
"recognition.show",
|
|
8157
8175
|
"recognition.top-value",
|
|
8158
|
-
"
|
|
8159
|
-
"
|
|
8160
|
-
"
|
|
8176
|
+
"goal-collections.list",
|
|
8177
|
+
"goal-collections.search",
|
|
8178
|
+
"goal-collections.show",
|
|
8161
8179
|
"reminders.list",
|
|
8162
8180
|
"reminders.show",
|
|
8163
|
-
"
|
|
8164
|
-
"
|
|
8165
|
-
"
|
|
8181
|
+
"goals.list",
|
|
8182
|
+
"goals.search",
|
|
8183
|
+
"goals.show",
|
|
8166
8184
|
"scorecard-groups.list",
|
|
8167
8185
|
"scorecard-groups.search",
|
|
8168
8186
|
"scorecard-groups.show",
|
|
@@ -8197,6 +8215,10 @@ var READ_OPERATION_IDS = [
|
|
|
8197
8215
|
"support.settings",
|
|
8198
8216
|
"support.ticket-counts",
|
|
8199
8217
|
"support.tickets",
|
|
8218
|
+
"support.conversation",
|
|
8219
|
+
"support.messages",
|
|
8220
|
+
"support.ticket",
|
|
8221
|
+
"support.article",
|
|
8200
8222
|
"surveys.list",
|
|
8201
8223
|
"surveys.search",
|
|
8202
8224
|
"surveys.show",
|
|
@@ -8327,11 +8349,11 @@ var WRITE_OPERATION_IDS = [
|
|
|
8327
8349
|
"projects.update",
|
|
8328
8350
|
"questions.create",
|
|
8329
8351
|
"questions.update",
|
|
8330
|
-
"
|
|
8331
|
-
"
|
|
8332
|
-
"
|
|
8333
|
-
"
|
|
8334
|
-
"
|
|
8352
|
+
"goal-collections.create",
|
|
8353
|
+
"goal-collections.update",
|
|
8354
|
+
"goals.create",
|
|
8355
|
+
"goals.update",
|
|
8356
|
+
"goals.update-status",
|
|
8335
8357
|
"reminders.clear",
|
|
8336
8358
|
"reminders.create",
|
|
8337
8359
|
"reminders.destroy",
|
|
@@ -8372,6 +8394,9 @@ var WRITE_OPERATION_IDS = [
|
|
|
8372
8394
|
"tasks.create",
|
|
8373
8395
|
"tasks.destroy",
|
|
8374
8396
|
"tasks.update",
|
|
8397
|
+
"support.reply",
|
|
8398
|
+
"support.note",
|
|
8399
|
+
"support.triage",
|
|
8375
8400
|
"teams.create",
|
|
8376
8401
|
"teams.update",
|
|
8377
8402
|
"todo-groups.create",
|
|
@@ -8418,26 +8443,26 @@ var OPERATION_IDS_BY_CLASSIFICATION = {
|
|
|
8418
8443
|
auth: AUTH_OPERATION_IDS
|
|
8419
8444
|
};
|
|
8420
8445
|
var metadataByOperationId = /* @__PURE__ */ new Map();
|
|
8421
|
-
function assertDataPipelineReadOnlyRegistration(
|
|
8422
|
-
if (!
|
|
8446
|
+
function assertDataPipelineReadOnlyRegistration(id2, metadata) {
|
|
8447
|
+
if (!id2.startsWith("data-pipeline.")) return;
|
|
8423
8448
|
const isReadOnlyOperation = metadata.classification === "read" && metadata.atlasSafetyClass === "read_only" || metadata.classification === "discovery" && metadata.atlasSafetyClass === "discovery";
|
|
8424
8449
|
if (isReadOnlyOperation && !metadata.requiresApproval && !metadata.machine.supportsPreview) {
|
|
8425
8450
|
return;
|
|
8426
8451
|
}
|
|
8427
|
-
throw new Error(`Data Pipeline operations must remain read-only: ${
|
|
8452
|
+
throw new Error(`Data Pipeline operations must remain read-only: ${id2}`);
|
|
8428
8453
|
}
|
|
8429
8454
|
for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLASSIFICATION)) {
|
|
8430
|
-
for (const
|
|
8431
|
-
if (metadataByOperationId.has(
|
|
8432
|
-
throw new Error(`Duplicate Wave CLI operation metadata: ${
|
|
8455
|
+
for (const id2 of operationIds) {
|
|
8456
|
+
if (metadataByOperationId.has(id2)) {
|
|
8457
|
+
throw new Error(`Duplicate Wave CLI operation metadata: ${id2}`);
|
|
8433
8458
|
}
|
|
8434
|
-
const atlasSafetyClass = classification === "discovery" ? "discovery" : classification === "read" ? "read_only" : classification === "auth" ? "auth" : DESTRUCTIVE_OPERATION_IDS.has(
|
|
8435
|
-
if (DESTRUCTIVE_OPERATION_IDS.has(
|
|
8436
|
-
throw new Error(`Destructive Wave CLI operation must be a write: ${
|
|
8459
|
+
const atlasSafetyClass = classification === "discovery" ? "discovery" : classification === "read" ? "read_only" : classification === "auth" ? "auth" : DESTRUCTIVE_OPERATION_IDS.has(id2) ? "destructive" : "mutation";
|
|
8460
|
+
if (DESTRUCTIVE_OPERATION_IDS.has(id2) && classification !== "write") {
|
|
8461
|
+
throw new Error(`Destructive Wave CLI operation must be a write: ${id2}`);
|
|
8437
8462
|
}
|
|
8438
8463
|
const metadata = {
|
|
8439
8464
|
classification,
|
|
8440
|
-
requiresApproval: classification === "write" && !DIRECT_MACHINE_WRITE_OPERATION_IDS.has(
|
|
8465
|
+
requiresApproval: classification === "write" && !DIRECT_MACHINE_WRITE_OPERATION_IDS.has(id2),
|
|
8441
8466
|
atlasSafetyClass,
|
|
8442
8467
|
machine: {
|
|
8443
8468
|
supportsValidate: true,
|
|
@@ -8446,12 +8471,12 @@ for (const [classification, operationIds] of Object.entries(OPERATION_IDS_BY_CLA
|
|
|
8446
8471
|
executionMode: "sync"
|
|
8447
8472
|
}
|
|
8448
8473
|
};
|
|
8449
|
-
assertDataPipelineReadOnlyRegistration(
|
|
8450
|
-
metadataByOperationId.set(
|
|
8474
|
+
assertDataPipelineReadOnlyRegistration(id2, metadata);
|
|
8475
|
+
metadataByOperationId.set(id2, metadata);
|
|
8451
8476
|
}
|
|
8452
8477
|
}
|
|
8453
|
-
function registeredOperationMetadata(
|
|
8454
|
-
return metadataByOperationId.get(
|
|
8478
|
+
function registeredOperationMetadata(id2) {
|
|
8479
|
+
return metadataByOperationId.get(id2);
|
|
8455
8480
|
}
|
|
8456
8481
|
|
|
8457
8482
|
// src/operationManifest.ts
|
|
@@ -8488,7 +8513,7 @@ function operationId(path) {
|
|
|
8488
8513
|
function inputKeyForArgument(argument) {
|
|
8489
8514
|
return argument.name().replace(/<|>|\[|\]|\.\.\./g, "");
|
|
8490
8515
|
}
|
|
8491
|
-
function inputSchemaFor(command,
|
|
8516
|
+
function inputSchemaFor(command, id2) {
|
|
8492
8517
|
const properties = {};
|
|
8493
8518
|
const required = [];
|
|
8494
8519
|
for (const argument of command.registeredArguments) {
|
|
@@ -8503,7 +8528,7 @@ function inputSchemaFor(command, id) {
|
|
|
8503
8528
|
for (const option of command.options) {
|
|
8504
8529
|
const key = option.attributeName();
|
|
8505
8530
|
if (isMachinePresentationOption(key)) continue;
|
|
8506
|
-
const payloadSchema = key === "dataJson" ? dataJsonSchemaPropertyForOperation(
|
|
8531
|
+
const payloadSchema = key === "dataJson" ? dataJsonSchemaPropertyForOperation(id2, option.description) : null;
|
|
8507
8532
|
const enumChoices = manifestEnumChoices(option);
|
|
8508
8533
|
properties[key] = payloadSchema ?? {
|
|
8509
8534
|
type: option.required ? "string" : option.optional ? ["boolean", "string"] : "boolean",
|
|
@@ -8519,10 +8544,10 @@ function inputSchemaFor(command, id) {
|
|
|
8519
8544
|
required: required.sort()
|
|
8520
8545
|
};
|
|
8521
8546
|
}
|
|
8522
|
-
function exampleFor(inputSchema,
|
|
8547
|
+
function exampleFor(inputSchema, id2) {
|
|
8523
8548
|
const input = {};
|
|
8524
8549
|
for (const key of inputSchema.required) {
|
|
8525
|
-
const payloadExample = key === "dataJson" ? exampleDataJsonForOperation(
|
|
8550
|
+
const payloadExample = key === "dataJson" ? exampleDataJsonForOperation(id2) : null;
|
|
8526
8551
|
if (payloadExample) {
|
|
8527
8552
|
input[key] = payloadExample;
|
|
8528
8553
|
continue;
|
|
@@ -8531,6 +8556,7 @@ function exampleFor(inputSchema, id) {
|
|
|
8531
8556
|
const types = Array.isArray(propertyType) ? propertyType : [propertyType];
|
|
8532
8557
|
input[key] = types.includes("object") ? {} : types.includes("array") ? ["example"] : types.includes("boolean") ? true : "example";
|
|
8533
8558
|
}
|
|
8559
|
+
if (id2 === "support.triage") input.action = "close";
|
|
8534
8560
|
return [{ name: "minimal valid input", input }];
|
|
8535
8561
|
}
|
|
8536
8562
|
function outputSchema() {
|
|
@@ -8560,8 +8586,8 @@ function listInvocableCommands(program) {
|
|
|
8560
8586
|
}
|
|
8561
8587
|
function entryFor(command, metadata) {
|
|
8562
8588
|
const path = commandPath(command);
|
|
8563
|
-
const
|
|
8564
|
-
const inputSchema = inputSchemaFor(command,
|
|
8589
|
+
const id2 = operationId(path);
|
|
8590
|
+
const inputSchema = inputSchemaFor(command, id2);
|
|
8565
8591
|
const summary = command.description() || `Run ${path.join(" ")}.`;
|
|
8566
8592
|
return {
|
|
8567
8593
|
id: operationId(path),
|
|
@@ -8574,7 +8600,7 @@ function entryFor(command, metadata) {
|
|
|
8574
8600
|
atlasSafetyClass: metadata.atlasSafetyClass,
|
|
8575
8601
|
inputSchema,
|
|
8576
8602
|
outputSchema: outputSchema(),
|
|
8577
|
-
examples: exampleFor(inputSchema,
|
|
8603
|
+
examples: exampleFor(inputSchema, id2),
|
|
8578
8604
|
machine: metadata.machine
|
|
8579
8605
|
};
|
|
8580
8606
|
}
|
|
@@ -8585,10 +8611,10 @@ function digestFor(operations) {
|
|
|
8585
8611
|
function buildOperationManifest(program) {
|
|
8586
8612
|
const operations = listInvocableCommands(program).map((command) => {
|
|
8587
8613
|
const path = commandPath(command);
|
|
8588
|
-
const
|
|
8589
|
-
const metadata = registeredOperationMetadata(
|
|
8614
|
+
const id2 = operationId(path);
|
|
8615
|
+
const metadata = registeredOperationMetadata(id2);
|
|
8590
8616
|
if (!metadata) {
|
|
8591
|
-
throw new Error(`Missing explicit Wave CLI operation metadata: ${
|
|
8617
|
+
throw new Error(`Missing explicit Wave CLI operation metadata: ${id2}`);
|
|
8592
8618
|
}
|
|
8593
8619
|
return entryFor(command, metadata);
|
|
8594
8620
|
}).sort((left, right) => left.id.localeCompare(right.id));
|
|
@@ -9145,6 +9171,12 @@ var AGENT_JSON_KEY_ALIASES = {
|
|
|
9145
9171
|
last_seen_at: "lastSeenAt",
|
|
9146
9172
|
canonical_parent_updated_at: "canonicalParentUpdatedAt",
|
|
9147
9173
|
parent_ref: "parentRef",
|
|
9174
|
+
workspace_id: "workspaceId",
|
|
9175
|
+
file_id: "fileId",
|
|
9176
|
+
display_name: "displayName",
|
|
9177
|
+
content_sha: "contentSha",
|
|
9178
|
+
version_sha: "versionSha",
|
|
9179
|
+
media_type: "mediaType",
|
|
9148
9180
|
agent_children_allowed: "agentChildrenAllowed",
|
|
9149
9181
|
suggested_action: "suggestedAction",
|
|
9150
9182
|
error_code: "errorCode",
|
|
@@ -9247,11 +9279,11 @@ var contentStdinPromise = null;
|
|
|
9247
9279
|
function isRecord5(value) {
|
|
9248
9280
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
9249
9281
|
}
|
|
9250
|
-
function countFromRecord(
|
|
9251
|
-
if (!
|
|
9282
|
+
function countFromRecord(record2, key) {
|
|
9283
|
+
if (!record2) {
|
|
9252
9284
|
return null;
|
|
9253
9285
|
}
|
|
9254
|
-
const value =
|
|
9286
|
+
const value = record2[key];
|
|
9255
9287
|
if (typeof value === "number" && Number.isInteger(value) && value >= 0) {
|
|
9256
9288
|
return value;
|
|
9257
9289
|
}
|
|
@@ -11240,13 +11272,13 @@ function cliTokenFromPoll(payload) {
|
|
|
11240
11272
|
return asString(payload.cliToken) ?? asString(payload.cli_token) ?? asString(payload.token);
|
|
11241
11273
|
}
|
|
11242
11274
|
function unwrapMutationResult(value) {
|
|
11243
|
-
const
|
|
11244
|
-
if (!
|
|
11245
|
-
const data = asRecord4(
|
|
11246
|
-
if (data && (Object.prototype.hasOwnProperty.call(
|
|
11275
|
+
const record2 = asRecord4(value);
|
|
11276
|
+
if (!record2) return null;
|
|
11277
|
+
const data = asRecord4(record2.data);
|
|
11278
|
+
if (data && (Object.prototype.hasOwnProperty.call(record2, "ok") || Object.prototype.hasOwnProperty.call(record2, "errors") || Object.prototype.hasOwnProperty.call(record2, "errorCode") || Object.prototype.hasOwnProperty.call(record2, "error_code"))) {
|
|
11247
11279
|
return data;
|
|
11248
11280
|
}
|
|
11249
|
-
return
|
|
11281
|
+
return record2;
|
|
11250
11282
|
}
|
|
11251
11283
|
async function sleep(ms) {
|
|
11252
11284
|
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -11761,7 +11793,7 @@ var RECENT_TOOL_SUPPORT_REGISTRY = [
|
|
|
11761
11793
|
],
|
|
11762
11794
|
implementation: {
|
|
11763
11795
|
milestone: "WAVE-06",
|
|
11764
|
-
status: "
|
|
11796
|
+
status: "implemented_command_surface",
|
|
11765
11797
|
enabledCommands: [
|
|
11766
11798
|
"open",
|
|
11767
11799
|
"counts",
|
|
@@ -11771,21 +11803,27 @@ var RECENT_TOOL_SUPPORT_REGISTRY = [
|
|
|
11771
11803
|
"labels",
|
|
11772
11804
|
"settings",
|
|
11773
11805
|
"knowledge-collections",
|
|
11774
|
-
"knowledge-articles"
|
|
11806
|
+
"knowledge-articles",
|
|
11807
|
+
"conversation",
|
|
11808
|
+
"messages",
|
|
11809
|
+
"ticket",
|
|
11810
|
+
"article",
|
|
11811
|
+
"reply",
|
|
11812
|
+
"note",
|
|
11813
|
+
"triage"
|
|
11775
11814
|
],
|
|
11776
11815
|
forbiddenCommands: [
|
|
11777
11816
|
"create",
|
|
11778
11817
|
"update",
|
|
11779
11818
|
"delete",
|
|
11780
11819
|
"write",
|
|
11781
|
-
"reply",
|
|
11782
11820
|
"replies",
|
|
11783
11821
|
"send",
|
|
11784
11822
|
"publish",
|
|
11785
11823
|
"media"
|
|
11786
11824
|
],
|
|
11787
11825
|
notes: [
|
|
11788
|
-
"
|
|
11826
|
+
"Metadata defaults remain safe; explicit content reads and approval-required Support replies, internal notes and triage are available.",
|
|
11789
11827
|
"Commands use verified WAVE-02 query fields with safe counts, ticket metadata, labels, settings, and knowledge metadata projections.",
|
|
11790
11828
|
"Open returns only verified WAVE-03 safe app routes."
|
|
11791
11829
|
]
|
|
@@ -12267,6 +12305,97 @@ function registerBroadcastCommands(program) {
|
|
|
12267
12305
|
});
|
|
12268
12306
|
}
|
|
12269
12307
|
|
|
12308
|
+
// src/commands/supportOperations.ts
|
|
12309
|
+
var import_commander2 = require("commander");
|
|
12310
|
+
var import_zod20 = require("zod");
|
|
12311
|
+
var SUPPORT_OPERATION_COMMANDS = ["conversation", "messages", "ticket", "article", "reply", "note", "triage"];
|
|
12312
|
+
var SUPPORT_TRIAGE_ACTIONS = ["assign", "unassign", "close", "reopen", "snooze", "unsnooze", "star", "unstar", "add-label", "remove-label"];
|
|
12313
|
+
var id = import_zod20.z.string().trim().regex(/^[A-Za-z0-9_-]+$/);
|
|
12314
|
+
var body = import_zod20.z.string().trim().min(1).max(64e3);
|
|
12315
|
+
var page = import_zod20.z.coerce.number().int().min(1);
|
|
12316
|
+
var per = page.max(100);
|
|
12317
|
+
var record = import_zod20.z.record(import_zod20.z.string(), import_zod20.z.unknown());
|
|
12318
|
+
var triageSchema = import_zod20.z.object({ conversationId: id, action: import_zod20.z.enum(SUPPORT_TRIAGE_ACTIONS), memberId: id.optional(), labelId: id.optional(), snoozedUntil: import_zod20.z.string().datetime({ offset: true }).optional() }).superRefine((value, context) => {
|
|
12319
|
+
for (const [name, required] of Object.entries({ memberId: value.action === "assign", labelId: value.action === "add-label" || value.action === "remove-label", snoozedUntil: value.action === "snooze" })) {
|
|
12320
|
+
if (value[name] !== void 0 !== required)
|
|
12321
|
+
context.addIssue({ code: "custom", message: `${name} ${required ? "is required" : "is not allowed"} for ${value.action}` });
|
|
12322
|
+
}
|
|
12323
|
+
});
|
|
12324
|
+
function registerSupportOperationCommands(support) {
|
|
12325
|
+
support.command("conversation").description("Read one authorized Support conversation; use messages for bounded history").requiredOption("--conversation-id <conversationId>").action(async (opts, cmd) => {
|
|
12326
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
12327
|
+
await runGraphqlQueryCommand({
|
|
12328
|
+
command: "support.conversation",
|
|
12329
|
+
runtimeOptions: context.runtimeOptions,
|
|
12330
|
+
field: "support_conversation",
|
|
12331
|
+
variableTypes: { organization_id: "ID!", conversation_id: "ID!" },
|
|
12332
|
+
variables: { organization_id: resolveOrganizationId(context.organizationId), conversation_id: id.parse(opts.conversationId) },
|
|
12333
|
+
isShow: true,
|
|
12334
|
+
selectionSet: "{ id organizationId channel title preview status assignedMemberId linkedTicketId unread lastActivityAt starredAt snoozedUntil labelIds messageCount customerIdentity contactIdentity }"
|
|
12335
|
+
});
|
|
12336
|
+
});
|
|
12337
|
+
support.command("messages").description("Read bounded newest-first authorized Support message bodies").requiredOption("--conversation-id <conversationId>").option("--page <page>", "Page number", "1").option("--per <per>", "Maximum 100 messages", "25").action(async (opts, cmd) => {
|
|
12338
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
12339
|
+
await runGraphqlQueryCommand({
|
|
12340
|
+
command: "support.messages",
|
|
12341
|
+
runtimeOptions: context.runtimeOptions,
|
|
12342
|
+
field: "support_conversation_messages",
|
|
12343
|
+
variableTypes: { organization_id: "ID!", conversation_id: "ID!", page: "Int", per: "Int" },
|
|
12344
|
+
variables: { organization_id: resolveOrganizationId(context.organizationId), conversation_id: id.parse(opts.conversationId), page: page.parse(opts.page), per: per.parse(opts.per) },
|
|
12345
|
+
isList: true,
|
|
12346
|
+
selectionSet: "{ count currentPage totalPages nextPage totalCount data { id supportConversationId direction senderMemberId senderIdentity emailSubject body sentAt receivedAt createdAt } }"
|
|
12347
|
+
});
|
|
12348
|
+
});
|
|
12349
|
+
for (const name of ["ticket", "article"]) {
|
|
12350
|
+
support.command(name).description(`Read one authorized Support ${name}, rejecting unrelated records`).requiredOption("--id <id>").action(async (opts, cmd) => {
|
|
12351
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
12352
|
+
await runGraphqlQueryCommand({
|
|
12353
|
+
command: `support.${name}`,
|
|
12354
|
+
runtimeOptions: context.runtimeOptions,
|
|
12355
|
+
field: name === "ticket" ? "task" : "content",
|
|
12356
|
+
variables: { organization_id: resolveOrganizationId(context.organizationId), id: id.parse(opts.id) },
|
|
12357
|
+
variableTypes: { organization_id: "ID!", id: "ID!" },
|
|
12358
|
+
isShow: true,
|
|
12359
|
+
...name === "article" ? { selectionSet: "{ id type attributes { id name slug content contentType status organizationId memberId parentContentId contentableId contentableType focusMemberId focusTeamId } }" } : {},
|
|
12360
|
+
transformData: (value) => {
|
|
12361
|
+
const parsed = record.safeParse(value);
|
|
12362
|
+
if (!parsed.success) return null;
|
|
12363
|
+
const attributes = record.safeParse(parsed.data.attributes);
|
|
12364
|
+
const fields = attributes.success ? attributes.data : parsed.data;
|
|
12365
|
+
if (name === "ticket") return fields.taskType === "support_ticket" ? value : null;
|
|
12366
|
+
return ["support_public_article", "support_internal_article"].includes(String(fields.contentType)) && !fields.contentableId && !fields.contentableType && !fields.focusMemberId && !fields.focusTeamId ? value : null;
|
|
12367
|
+
}
|
|
12368
|
+
});
|
|
12369
|
+
});
|
|
12370
|
+
}
|
|
12371
|
+
for (const name of ["reply", "note"]) {
|
|
12372
|
+
support.command(name).description(name === "reply" ? "Send one approved customer-visible Support text reply" : "Add one approved internal Support note; never send to the customer").requiredOption("--conversation-id <conversationId>").requiredOption("--body <body>").action(async (opts, cmd) => {
|
|
12373
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
12374
|
+
await runGraphqlMutationCommand({
|
|
12375
|
+
command: `support.${name}`,
|
|
12376
|
+
runtimeOptions: context.runtimeOptions,
|
|
12377
|
+
field: "send_support_conversation_message",
|
|
12378
|
+
preserveArgumentNames: true,
|
|
12379
|
+
variableTypes: { organization_id: "ID!", conversation_id: "ID!", input: "SupportConversationMessageInput!" },
|
|
12380
|
+
variables: { organization_id: resolveOrganizationId(context.organizationId), conversation_id: id.parse(opts.conversationId), input: { body: body.parse(opts.body), direction: name === "reply" ? "outbound" : "internal" } }
|
|
12381
|
+
});
|
|
12382
|
+
});
|
|
12383
|
+
}
|
|
12384
|
+
support.command("triage").description("Apply one approved Support assignment, lifecycle or label action").requiredOption("--conversation-id <conversationId>").addOption(new import_commander2.Option("--action <action>").choices([...SUPPORT_TRIAGE_ACTIONS]).makeOptionMandatory()).option("--member-id <memberId>").option("--label-id <labelId>").option("--snoozed-until <snoozedUntil>").action(async (opts, cmd) => {
|
|
12385
|
+
const parsed = triageSchema.parse(opts);
|
|
12386
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
12387
|
+
const labelAction = parsed.action === "add-label" || parsed.action === "remove-label";
|
|
12388
|
+
await runGraphqlMutationCommand({
|
|
12389
|
+
command: "support.triage",
|
|
12390
|
+
runtimeOptions: context.runtimeOptions,
|
|
12391
|
+
preserveArgumentNames: true,
|
|
12392
|
+
field: labelAction ? `${parsed.action === "add-label" ? "add" : "remove"}_support_conversation_label` : `${parsed.action}_support_conversation`,
|
|
12393
|
+
variableTypes: { organization_id: "ID!", conversation_id: "ID!", ...parsed.memberId ? { member_id: "ID!" } : {}, ...parsed.labelId ? { label_id: "ID!" } : {}, ...parsed.snoozedUntil ? { snoozed_until: "ISO8601DateTime!" } : {} },
|
|
12394
|
+
variables: { organization_id: resolveOrganizationId(context.organizationId), conversation_id: parsed.conversationId, ...parsed.memberId ? { member_id: parsed.memberId } : {}, ...parsed.labelId ? { label_id: parsed.labelId } : {}, ...parsed.snoozedUntil ? { snoozed_until: parsed.snoozedUntil } : {} }
|
|
12395
|
+
});
|
|
12396
|
+
});
|
|
12397
|
+
}
|
|
12398
|
+
|
|
12270
12399
|
// src/commands/support.ts
|
|
12271
12400
|
var SUPPORT_PAGINATION_SELECTION = "count currentPage totalPages";
|
|
12272
12401
|
var SUPPORT_TICKET_METADATA_SELECTION = "id status priority memberId supportConversationId taskType labelIds";
|
|
@@ -12287,14 +12416,14 @@ var SUPPORT_ENABLED_COMMANDS = [
|
|
|
12287
12416
|
"labels",
|
|
12288
12417
|
"settings",
|
|
12289
12418
|
"knowledge-collections",
|
|
12290
|
-
"knowledge-articles"
|
|
12419
|
+
"knowledge-articles",
|
|
12420
|
+
...SUPPORT_OPERATION_COMMANDS
|
|
12291
12421
|
];
|
|
12292
12422
|
var SUPPORT_FORBIDDEN_COMMANDS = [
|
|
12293
12423
|
"create",
|
|
12294
12424
|
"update",
|
|
12295
12425
|
"delete",
|
|
12296
12426
|
"write",
|
|
12297
|
-
"reply",
|
|
12298
12427
|
"replies",
|
|
12299
12428
|
"send",
|
|
12300
12429
|
"publish",
|
|
@@ -12449,10 +12578,10 @@ function buildSupportOpenData() {
|
|
|
12449
12578
|
status: "verified_wave_03",
|
|
12450
12579
|
sourceMilestone: "WAVE-03"
|
|
12451
12580
|
},
|
|
12452
|
-
readOnly:
|
|
12581
|
+
readOnly: false,
|
|
12453
12582
|
implementation: {
|
|
12454
12583
|
milestone: "WAVE-06",
|
|
12455
|
-
status: "
|
|
12584
|
+
status: "implemented_command_surface",
|
|
12456
12585
|
enabledCommands: [...SUPPORT_ENABLED_COMMANDS],
|
|
12457
12586
|
forbiddenCommands: [...SUPPORT_FORBIDDEN_COMMANDS]
|
|
12458
12587
|
},
|
|
@@ -12462,7 +12591,7 @@ function buildSupportOpenData() {
|
|
|
12462
12591
|
};
|
|
12463
12592
|
}
|
|
12464
12593
|
function registerSupportCommands(program) {
|
|
12465
|
-
const support = program.command("support").description("Support
|
|
12594
|
+
const support = program.command("support").description("Support metadata, explicit content reads, approved replies and triage");
|
|
12466
12595
|
support.command("open").description("Return verified Support app routes without opening a browser").option("--readable", "Print the primary route path only").option("--json", "Emit the stable JSON envelope").action((opts) => {
|
|
12467
12596
|
const data = buildSupportOpenData();
|
|
12468
12597
|
if (opts.readable && !opts.json) {
|
|
@@ -12577,6 +12706,7 @@ function registerSupportCommands(program) {
|
|
|
12577
12706
|
selectionSet: SUPPORT_KNOWLEDGE_ARTICLES_SELECTION
|
|
12578
12707
|
});
|
|
12579
12708
|
});
|
|
12709
|
+
registerSupportOperationCommands(support);
|
|
12580
12710
|
}
|
|
12581
12711
|
|
|
12582
12712
|
// src/commands/recognition.ts
|
|
@@ -13025,15 +13155,15 @@ function registerSketchCommands(program) {
|
|
|
13025
13155
|
});
|
|
13026
13156
|
sketches.command("create").description("Create a Sketch with a required team and idempotency key").requiredOption("--data-json <dataJson>", 'Sketch JSON or {"sketch": {...}}').action(async (opts, cmd) => {
|
|
13027
13157
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
13028
|
-
const
|
|
13029
|
-
assertOperationPayload("sketches.create",
|
|
13158
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "sketch");
|
|
13159
|
+
assertOperationPayload("sketches.create", body2);
|
|
13030
13160
|
await runGraphqlMutationCommand({
|
|
13031
13161
|
command: "sketches.create",
|
|
13032
13162
|
runtimeOptions: context.runtimeOptions,
|
|
13033
13163
|
field: "create_sketch",
|
|
13034
13164
|
variables: {
|
|
13035
13165
|
organization_id: resolveOrganizationId(context.organizationId),
|
|
13036
|
-
params:
|
|
13166
|
+
params: body2
|
|
13037
13167
|
},
|
|
13038
13168
|
variableTypes: {
|
|
13039
13169
|
organization_id: "ID!",
|
|
@@ -13043,8 +13173,8 @@ function registerSketchCommands(program) {
|
|
|
13043
13173
|
});
|
|
13044
13174
|
sketches.command("update-metadata").description("Update bounded Sketch metadata; document content is never accepted").requiredOption("--id <id>").requiredOption("--data-json <dataJson>", 'Sketch metadata JSON or {"sketch": {...}}').action(async (opts, cmd) => {
|
|
13045
13175
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
13046
|
-
const
|
|
13047
|
-
assertOperationPayload("sketches.update-metadata",
|
|
13176
|
+
const body2 = __testables.normalizeBody(String(opts.dataJson), "sketch");
|
|
13177
|
+
assertOperationPayload("sketches.update-metadata", body2);
|
|
13048
13178
|
await runGraphqlMutationCommand({
|
|
13049
13179
|
command: "sketches.update-metadata",
|
|
13050
13180
|
runtimeOptions: context.runtimeOptions,
|
|
@@ -13052,7 +13182,7 @@ function registerSketchCommands(program) {
|
|
|
13052
13182
|
variables: {
|
|
13053
13183
|
organization_id: resolveOrganizationId(context.organizationId),
|
|
13054
13184
|
sketch_id: String(opts.id),
|
|
13055
|
-
params:
|
|
13185
|
+
params: body2
|
|
13056
13186
|
},
|
|
13057
13187
|
variableTypes: {
|
|
13058
13188
|
organization_id: "ID!",
|
|
@@ -13414,12 +13544,12 @@ function asRecord5(value) {
|
|
|
13414
13544
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
13415
13545
|
}
|
|
13416
13546
|
function readPlannerStateKey(value, keys) {
|
|
13417
|
-
const
|
|
13418
|
-
if (!
|
|
13547
|
+
const record2 = asRecord5(value);
|
|
13548
|
+
if (!record2) {
|
|
13419
13549
|
return null;
|
|
13420
13550
|
}
|
|
13421
13551
|
const normalizedKeySet = new Set(keys.map((key) => normalizedKey(key)));
|
|
13422
|
-
const entry2 = Object.entries(
|
|
13552
|
+
const entry2 = Object.entries(record2).find(([key]) => normalizedKeySet.has(normalizedKey(key)));
|
|
13423
13553
|
return entry2 ? entry2[1] : null;
|
|
13424
13554
|
}
|
|
13425
13555
|
function transformPlannerEvents(data) {
|
|
@@ -14131,14 +14261,14 @@ function registerMailCommands(program) {
|
|
|
14131
14261
|
}
|
|
14132
14262
|
|
|
14133
14263
|
// src/commands/phantom.ts
|
|
14134
|
-
var
|
|
14135
|
-
var nonNegativeInt4 =
|
|
14136
|
-
var nullableString =
|
|
14137
|
-
var idString =
|
|
14138
|
-
var nullableIdString =
|
|
14264
|
+
var import_zod21 = require("zod");
|
|
14265
|
+
var nonNegativeInt4 = import_zod21.z.coerce.number().int().min(0);
|
|
14266
|
+
var nullableString = import_zod21.z.string().nullable().optional().transform((value) => value ?? null);
|
|
14267
|
+
var idString = import_zod21.z.union([import_zod21.z.string(), import_zod21.z.number()]).transform((value) => String(value));
|
|
14268
|
+
var nullableIdString = import_zod21.z.union([import_zod21.z.string(), import_zod21.z.number()]).nullable().optional().transform(
|
|
14139
14269
|
(value) => value === void 0 || value === null ? null : String(value)
|
|
14140
14270
|
);
|
|
14141
|
-
var jsonObject =
|
|
14271
|
+
var jsonObject = import_zod21.z.record(import_zod21.z.string(), import_zod21.z.unknown());
|
|
14142
14272
|
var PHANTOM_LEDGER_INVENTORY_SELECTION = `{
|
|
14143
14273
|
schemaVersion
|
|
14144
14274
|
runsCount
|
|
@@ -14351,10 +14481,10 @@ var PHANTOM_LEDGER_KEY_ALIASES = {
|
|
|
14351
14481
|
content_hash: "contentHash",
|
|
14352
14482
|
observed_at: "observedAt"
|
|
14353
14483
|
};
|
|
14354
|
-
var phantomLedgerInventorySchema =
|
|
14484
|
+
var phantomLedgerInventorySchema = import_zod21.z.preprocess(
|
|
14355
14485
|
normalizePhantomLedgerKeys,
|
|
14356
|
-
|
|
14357
|
-
schemaVersion:
|
|
14486
|
+
import_zod21.z.object({
|
|
14487
|
+
schemaVersion: import_zod21.z.string(),
|
|
14358
14488
|
runsCount: nonNegativeInt4,
|
|
14359
14489
|
observationsCount: nonNegativeInt4,
|
|
14360
14490
|
candidatesCount: nonNegativeInt4,
|
|
@@ -14364,16 +14494,16 @@ var phantomLedgerInventorySchema = import_zod20.z.preprocess(
|
|
|
14364
14494
|
reportsCount: nonNegativeInt4
|
|
14365
14495
|
})
|
|
14366
14496
|
);
|
|
14367
|
-
var phantomRunSchema =
|
|
14497
|
+
var phantomRunSchema = import_zod21.z.preprocess(
|
|
14368
14498
|
normalizePhantomLedgerKeys,
|
|
14369
|
-
|
|
14499
|
+
import_zod21.z.object({
|
|
14370
14500
|
id: idString,
|
|
14371
14501
|
organizationId: idString,
|
|
14372
|
-
notificationId:
|
|
14502
|
+
notificationId: import_zod21.z.union([import_zod21.z.string(), import_zod21.z.number()]).nullable().optional().transform(
|
|
14373
14503
|
(value) => value === void 0 || value === null ? null : String(value)
|
|
14374
14504
|
),
|
|
14375
|
-
status:
|
|
14376
|
-
triggerType:
|
|
14505
|
+
status: import_zod21.z.string(),
|
|
14506
|
+
triggerType: import_zod21.z.string(),
|
|
14377
14507
|
startedAt: nullableString,
|
|
14378
14508
|
completedAt: nullableString,
|
|
14379
14509
|
scannedFileCount: nonNegativeInt4,
|
|
@@ -14383,163 +14513,163 @@ var phantomRunSchema = import_zod20.z.preprocess(
|
|
|
14383
14513
|
errorCount: nonNegativeInt4,
|
|
14384
14514
|
warningCount: nonNegativeInt4,
|
|
14385
14515
|
errorMessage: nullableString,
|
|
14386
|
-
dryRun:
|
|
14387
|
-
schemaVersion:
|
|
14516
|
+
dryRun: import_zod21.z.boolean(),
|
|
14517
|
+
schemaVersion: import_zod21.z.string(),
|
|
14388
14518
|
testRunId: nullableString,
|
|
14389
14519
|
idempotencyKey: nullableString,
|
|
14390
14520
|
ledgerMetadata: jsonObject.catch({}),
|
|
14391
|
-
createdAt:
|
|
14392
|
-
updatedAt:
|
|
14521
|
+
createdAt: import_zod21.z.string(),
|
|
14522
|
+
updatedAt: import_zod21.z.string()
|
|
14393
14523
|
})
|
|
14394
14524
|
);
|
|
14395
|
-
var phantomRunListItemSchema =
|
|
14525
|
+
var phantomRunListItemSchema = import_zod21.z.preprocess(
|
|
14396
14526
|
normalizePhantomLedgerKeys,
|
|
14397
|
-
|
|
14527
|
+
import_zod21.z.object({
|
|
14398
14528
|
id: idString,
|
|
14399
14529
|
organizationId: idString,
|
|
14400
|
-
status:
|
|
14401
|
-
triggerType:
|
|
14402
|
-
dryRun:
|
|
14403
|
-
schemaVersion:
|
|
14530
|
+
status: import_zod21.z.string(),
|
|
14531
|
+
triggerType: import_zod21.z.string(),
|
|
14532
|
+
dryRun: import_zod21.z.boolean(),
|
|
14533
|
+
schemaVersion: import_zod21.z.string(),
|
|
14404
14534
|
testRunId: nullableString,
|
|
14405
|
-
createdAt:
|
|
14406
|
-
updatedAt:
|
|
14535
|
+
createdAt: import_zod21.z.string(),
|
|
14536
|
+
updatedAt: import_zod21.z.string()
|
|
14407
14537
|
})
|
|
14408
14538
|
);
|
|
14409
|
-
var phantomReportSchema =
|
|
14539
|
+
var phantomReportSchema = import_zod21.z.preprocess(
|
|
14410
14540
|
normalizePhantomLedgerKeys,
|
|
14411
|
-
|
|
14541
|
+
import_zod21.z.object({
|
|
14412
14542
|
id: idString,
|
|
14413
14543
|
organizationId: idString,
|
|
14414
14544
|
phantomRunId: idString,
|
|
14415
|
-
status:
|
|
14416
|
-
reportType:
|
|
14417
|
-
schemaVersion:
|
|
14545
|
+
status: import_zod21.z.string(),
|
|
14546
|
+
reportType: import_zod21.z.string(),
|
|
14547
|
+
schemaVersion: import_zod21.z.string(),
|
|
14418
14548
|
markdownPath: nullableString,
|
|
14419
14549
|
payload: jsonObject.catch({}),
|
|
14420
14550
|
testRunId: nullableString,
|
|
14421
|
-
idempotencyKey:
|
|
14422
|
-
createdAt:
|
|
14423
|
-
updatedAt:
|
|
14551
|
+
idempotencyKey: import_zod21.z.string(),
|
|
14552
|
+
createdAt: import_zod21.z.string(),
|
|
14553
|
+
updatedAt: import_zod21.z.string()
|
|
14424
14554
|
})
|
|
14425
14555
|
);
|
|
14426
|
-
var phantomObservationSchema =
|
|
14556
|
+
var phantomObservationSchema = import_zod21.z.preprocess(
|
|
14427
14557
|
normalizePhantomLedgerKeys,
|
|
14428
|
-
|
|
14558
|
+
import_zod21.z.object({
|
|
14429
14559
|
id: idString,
|
|
14430
14560
|
organizationId: idString,
|
|
14431
14561
|
phantomRunId: idString,
|
|
14432
|
-
status:
|
|
14433
|
-
observationType:
|
|
14562
|
+
status: import_zod21.z.string(),
|
|
14563
|
+
observationType: import_zod21.z.string(),
|
|
14434
14564
|
targetType: nullableString,
|
|
14435
14565
|
targetId: nullableString,
|
|
14436
14566
|
sourceTable: nullableString,
|
|
14437
14567
|
sourceRecordId: nullableString,
|
|
14438
14568
|
sourceEventId: nullableString,
|
|
14439
14569
|
contentHash: nullableString,
|
|
14440
|
-
observedAt:
|
|
14441
|
-
confidence:
|
|
14570
|
+
observedAt: import_zod21.z.string(),
|
|
14571
|
+
confidence: import_zod21.z.coerce.number(),
|
|
14442
14572
|
payload: jsonObject.catch({}),
|
|
14443
|
-
schemaVersion:
|
|
14573
|
+
schemaVersion: import_zod21.z.string(),
|
|
14444
14574
|
testRunId: nullableString,
|
|
14445
|
-
idempotencyKey:
|
|
14446
|
-
createdAt:
|
|
14447
|
-
updatedAt:
|
|
14575
|
+
idempotencyKey: import_zod21.z.string(),
|
|
14576
|
+
createdAt: import_zod21.z.string(),
|
|
14577
|
+
updatedAt: import_zod21.z.string()
|
|
14448
14578
|
})
|
|
14449
14579
|
);
|
|
14450
|
-
var phantomCandidateSchema =
|
|
14580
|
+
var phantomCandidateSchema = import_zod21.z.preprocess(
|
|
14451
14581
|
normalizePhantomLedgerKeys,
|
|
14452
|
-
|
|
14582
|
+
import_zod21.z.object({
|
|
14453
14583
|
id: idString,
|
|
14454
14584
|
organizationId: idString,
|
|
14455
14585
|
phantomRunId: idString,
|
|
14456
14586
|
phantomObservationId: nullableString,
|
|
14457
|
-
status:
|
|
14458
|
-
candidateType:
|
|
14587
|
+
status: import_zod21.z.string(),
|
|
14588
|
+
candidateType: import_zod21.z.string(),
|
|
14459
14589
|
targetType: nullableString,
|
|
14460
14590
|
targetId: nullableString,
|
|
14461
14591
|
title: nullableString,
|
|
14462
|
-
dryRun:
|
|
14592
|
+
dryRun: import_zod21.z.boolean(),
|
|
14463
14593
|
payload: jsonObject.catch({}),
|
|
14464
|
-
approvalStatus:
|
|
14594
|
+
approvalStatus: import_zod21.z.string(),
|
|
14465
14595
|
approvedById: nullableIdString,
|
|
14466
14596
|
approvedAt: nullableString,
|
|
14467
14597
|
approvalSource: nullableString,
|
|
14468
14598
|
approvalReason: nullableString,
|
|
14469
14599
|
approvalMetadata: jsonObject.catch({}),
|
|
14470
|
-
schemaVersion:
|
|
14600
|
+
schemaVersion: import_zod21.z.string(),
|
|
14471
14601
|
testRunId: nullableString,
|
|
14472
|
-
idempotencyKey:
|
|
14473
|
-
createdAt:
|
|
14474
|
-
updatedAt:
|
|
14602
|
+
idempotencyKey: import_zod21.z.string(),
|
|
14603
|
+
createdAt: import_zod21.z.string(),
|
|
14604
|
+
updatedAt: import_zod21.z.string()
|
|
14475
14605
|
})
|
|
14476
14606
|
);
|
|
14477
|
-
var phantomCandidateEvidenceSchema =
|
|
14607
|
+
var phantomCandidateEvidenceSchema = import_zod21.z.preprocess(
|
|
14478
14608
|
normalizePhantomLedgerKeys,
|
|
14479
|
-
|
|
14609
|
+
import_zod21.z.object({
|
|
14480
14610
|
id: idString,
|
|
14481
14611
|
organizationId: idString,
|
|
14482
14612
|
phantomCandidateId: idString,
|
|
14483
14613
|
phantomObservationId: nullableString,
|
|
14484
|
-
evidenceType:
|
|
14614
|
+
evidenceType: import_zod21.z.string(),
|
|
14485
14615
|
sourceType: nullableString,
|
|
14486
14616
|
sourceId: nullableString,
|
|
14487
14617
|
contentHash: nullableString,
|
|
14488
14618
|
payload: jsonObject.catch({}),
|
|
14489
|
-
schemaVersion:
|
|
14619
|
+
schemaVersion: import_zod21.z.string(),
|
|
14490
14620
|
testRunId: nullableString,
|
|
14491
|
-
idempotencyKey:
|
|
14492
|
-
createdAt:
|
|
14493
|
-
updatedAt:
|
|
14621
|
+
idempotencyKey: import_zod21.z.string(),
|
|
14622
|
+
createdAt: import_zod21.z.string(),
|
|
14623
|
+
updatedAt: import_zod21.z.string()
|
|
14494
14624
|
})
|
|
14495
14625
|
);
|
|
14496
|
-
var phantomValidationSchema =
|
|
14626
|
+
var phantomValidationSchema = import_zod21.z.preprocess(
|
|
14497
14627
|
normalizePhantomLedgerKeys,
|
|
14498
|
-
|
|
14628
|
+
import_zod21.z.object({
|
|
14499
14629
|
id: idString,
|
|
14500
14630
|
organizationId: idString,
|
|
14501
14631
|
phantomRunId: idString,
|
|
14502
14632
|
phantomCandidateId: idString,
|
|
14503
|
-
status:
|
|
14504
|
-
validationType:
|
|
14505
|
-
dryRun:
|
|
14633
|
+
status: import_zod21.z.string(),
|
|
14634
|
+
validationType: import_zod21.z.string(),
|
|
14635
|
+
dryRun: import_zod21.z.boolean(),
|
|
14506
14636
|
payload: jsonObject.catch({}),
|
|
14507
14637
|
resultPayload: jsonObject.catch({}),
|
|
14508
|
-
schemaVersion:
|
|
14638
|
+
schemaVersion: import_zod21.z.string(),
|
|
14509
14639
|
testRunId: nullableString,
|
|
14510
|
-
idempotencyKey:
|
|
14511
|
-
createdAt:
|
|
14512
|
-
updatedAt:
|
|
14640
|
+
idempotencyKey: import_zod21.z.string(),
|
|
14641
|
+
createdAt: import_zod21.z.string(),
|
|
14642
|
+
updatedAt: import_zod21.z.string()
|
|
14513
14643
|
})
|
|
14514
14644
|
);
|
|
14515
|
-
var phantomApplyOperationSchema =
|
|
14645
|
+
var phantomApplyOperationSchema = import_zod21.z.preprocess(
|
|
14516
14646
|
normalizePhantomLedgerKeys,
|
|
14517
|
-
|
|
14647
|
+
import_zod21.z.object({
|
|
14518
14648
|
id: idString,
|
|
14519
14649
|
organizationId: idString,
|
|
14520
14650
|
phantomRunId: idString,
|
|
14521
14651
|
phantomCandidateId: idString,
|
|
14522
|
-
status:
|
|
14523
|
-
operationType:
|
|
14524
|
-
dryRun:
|
|
14652
|
+
status: import_zod21.z.string(),
|
|
14653
|
+
operationType: import_zod21.z.string(),
|
|
14654
|
+
dryRun: import_zod21.z.boolean(),
|
|
14525
14655
|
targetType: nullableString,
|
|
14526
14656
|
targetId: nullableString,
|
|
14527
14657
|
payload: jsonObject.catch({}),
|
|
14528
14658
|
resultPayload: jsonObject.catch({}),
|
|
14529
|
-
schemaVersion:
|
|
14659
|
+
schemaVersion: import_zod21.z.string(),
|
|
14530
14660
|
testRunId: nullableString,
|
|
14531
|
-
idempotencyKey:
|
|
14532
|
-
createdAt:
|
|
14533
|
-
updatedAt:
|
|
14661
|
+
idempotencyKey: import_zod21.z.string(),
|
|
14662
|
+
createdAt: import_zod21.z.string(),
|
|
14663
|
+
updatedAt: import_zod21.z.string()
|
|
14534
14664
|
})
|
|
14535
14665
|
);
|
|
14536
|
-
var phantomRunsSchema =
|
|
14537
|
-
var phantomReportsSchema =
|
|
14538
|
-
var phantomObservationsSchema =
|
|
14539
|
-
var phantomCandidatesSchema =
|
|
14540
|
-
var phantomCandidateEvidencesSchema =
|
|
14541
|
-
var phantomValidationsSchema =
|
|
14542
|
-
var phantomApplyOperationsSchema =
|
|
14666
|
+
var phantomRunsSchema = import_zod21.z.array(phantomRunListItemSchema);
|
|
14667
|
+
var phantomReportsSchema = import_zod21.z.array(phantomReportSchema);
|
|
14668
|
+
var phantomObservationsSchema = import_zod21.z.array(phantomObservationSchema);
|
|
14669
|
+
var phantomCandidatesSchema = import_zod21.z.array(phantomCandidateSchema);
|
|
14670
|
+
var phantomCandidateEvidencesSchema = import_zod21.z.array(phantomCandidateEvidenceSchema);
|
|
14671
|
+
var phantomValidationsSchema = import_zod21.z.array(phantomValidationSchema);
|
|
14672
|
+
var phantomApplyOperationsSchema = import_zod21.z.array(phantomApplyOperationSchema);
|
|
14543
14673
|
function isRecord6(value) {
|
|
14544
14674
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
14545
14675
|
}
|
|
@@ -15594,7 +15724,7 @@ function parseBooleanFlag(raw, label, command) {
|
|
|
15594
15724
|
}
|
|
15595
15725
|
function parseOrderedIds(raw, command) {
|
|
15596
15726
|
const value = requireNonEmpty(raw, "--ordered-ids", command);
|
|
15597
|
-
const ids = value.split(",").map((
|
|
15727
|
+
const ids = value.split(",").map((id2) => id2.trim()).filter((id2) => id2.length > 0);
|
|
15598
15728
|
if (ids.length === 0) {
|
|
15599
15729
|
throw new CliError({
|
|
15600
15730
|
message: "Invalid --ordered-ids. Expected at least one id.",
|
|
@@ -15668,8 +15798,8 @@ async function runDatasheetsQuery(cmd, config) {
|
|
|
15668
15798
|
async function runDatasheetsMutation(cmd, opts, config) {
|
|
15669
15799
|
const context = config.organizationContext === "optional" ? await resolveUnscopedCommandContext(cmd.optsWithGlobals()) : await resolveCommandContext(cmd.optsWithGlobals());
|
|
15670
15800
|
const variables = config.organizationContext === "optional" ? context.organizationId ? { organization_id: context.organizationId } : {} : { organization_id: resolveOrganizationId(context.organizationId) };
|
|
15671
|
-
for (const
|
|
15672
|
-
variables[
|
|
15801
|
+
for (const id2 of config.requiredIds ?? []) {
|
|
15802
|
+
variables[id2.variable] = requireNonEmpty(opts[id2.option], id2.label, config.command);
|
|
15673
15803
|
}
|
|
15674
15804
|
if (config.dataJson === "required") {
|
|
15675
15805
|
variables[config.dataJsonVariable ?? "params"] = parseJsonObject3(
|
|
@@ -16000,6 +16130,104 @@ var import_node_path4 = require("path");
|
|
|
16000
16130
|
var import_promises4 = require("fs/promises");
|
|
16001
16131
|
var import_node_crypto4 = require("crypto");
|
|
16002
16132
|
var import_pdf_lib = require("pdf-lib");
|
|
16133
|
+
|
|
16134
|
+
// src/commands/signature_envelope_commands.ts
|
|
16135
|
+
function registerSignatureEnvelopeReadCommand(signatures, callbacks) {
|
|
16136
|
+
const { identifier: idSchema16, queryPayload: safeSignatureQueryPayload2 } = callbacks;
|
|
16137
|
+
signatures.command("show").requiredOption("--id <signatureSlug>", "Signature slug, for example SIG-01").option("--include-events").action(async (opts, cmd) => {
|
|
16138
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
16139
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
16140
|
+
await runGraphqlQueryCommand({
|
|
16141
|
+
command: "signatures.show",
|
|
16142
|
+
operationName: "SignaturesShow",
|
|
16143
|
+
runtimeOptions: context.runtimeOptions,
|
|
16144
|
+
field: "signature_envelope",
|
|
16145
|
+
variables: {
|
|
16146
|
+
organization_id: organizationId,
|
|
16147
|
+
slug: idSchema16(opts.id, "signature slug"),
|
|
16148
|
+
include_events: Boolean(opts.includeEvents)
|
|
16149
|
+
},
|
|
16150
|
+
variableTypes: {
|
|
16151
|
+
organization_id: "ID!",
|
|
16152
|
+
slug: "String!",
|
|
16153
|
+
include_events: "Boolean!"
|
|
16154
|
+
},
|
|
16155
|
+
selectionSet: "",
|
|
16156
|
+
isShow: true,
|
|
16157
|
+
transformData: safeSignatureQueryPayload2
|
|
16158
|
+
});
|
|
16159
|
+
});
|
|
16160
|
+
}
|
|
16161
|
+
function registerSignatureEnvelopeMutationCommands(signatures, callbacks) {
|
|
16162
|
+
const {
|
|
16163
|
+
identifier: idSchema16,
|
|
16164
|
+
confirm: requireConfirmation2,
|
|
16165
|
+
updatePayload: parseUpdatePayload2,
|
|
16166
|
+
mutationPayload: safeSignatureMutationPayload2
|
|
16167
|
+
} = callbacks;
|
|
16168
|
+
signatures.command("update").requiredOption("--id <signatureSlug>", "Signature slug, for example SIG-01").option("--name <name>").option("--subject <subject>").option("--message <message>").option(
|
|
16169
|
+
"--data-json <dataJson>",
|
|
16170
|
+
"JSON object for draft fields, recipients, and fields"
|
|
16171
|
+
).action(async (opts, cmd) => {
|
|
16172
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
16173
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
16174
|
+
await runGraphqlMutationCommand({
|
|
16175
|
+
command: "signatures.update",
|
|
16176
|
+
operationName: "SignaturesUpdate",
|
|
16177
|
+
runtimeOptions: context.runtimeOptions,
|
|
16178
|
+
field: "update_signature_envelope",
|
|
16179
|
+
variables: {
|
|
16180
|
+
organization_id: organizationId,
|
|
16181
|
+
slug: idSchema16(opts.id, "signature slug"),
|
|
16182
|
+
params: parseUpdatePayload2(opts.dataJson, opts)
|
|
16183
|
+
},
|
|
16184
|
+
variableTypes: {
|
|
16185
|
+
organization_id: "ID!",
|
|
16186
|
+
slug: "String!",
|
|
16187
|
+
params: "JSON!"
|
|
16188
|
+
},
|
|
16189
|
+
transformMutationPayload: safeSignatureMutationPayload2
|
|
16190
|
+
});
|
|
16191
|
+
});
|
|
16192
|
+
const lifecycle = (name, field, confirmation) => {
|
|
16193
|
+
const command = signatures.command(name).requiredOption("--id <signatureSlug>", "Signature slug, for example SIG-01");
|
|
16194
|
+
if (name === "void") command.requiredOption("--reason <reason>");
|
|
16195
|
+
if (confirmation === "--confirm-send") command.option("--confirm-send");
|
|
16196
|
+
if (confirmation === "--confirm") command.option("--confirm");
|
|
16197
|
+
command.action(async (opts, cmd) => {
|
|
16198
|
+
if (confirmation === "--confirm-send")
|
|
16199
|
+
requireConfirmation2(opts.confirmSend, "--confirm-send");
|
|
16200
|
+
if (confirmation === "--confirm")
|
|
16201
|
+
requireConfirmation2(opts.confirm, "--confirm");
|
|
16202
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
16203
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
16204
|
+
await runGraphqlMutationCommand({
|
|
16205
|
+
command: "signatures." + name,
|
|
16206
|
+
operationName: "Signatures" + name.slice(0, 1).toUpperCase() + name.slice(1),
|
|
16207
|
+
runtimeOptions: context.runtimeOptions,
|
|
16208
|
+
field,
|
|
16209
|
+
variables: {
|
|
16210
|
+
organization_id: organizationId,
|
|
16211
|
+
slug: idSchema16(opts.id, "signature slug"),
|
|
16212
|
+
...name === "void" ? { reason: idSchema16(opts.reason, "reason") } : {}
|
|
16213
|
+
},
|
|
16214
|
+
variableTypes: {
|
|
16215
|
+
organization_id: "ID!",
|
|
16216
|
+
slug: "String!",
|
|
16217
|
+
...name === "void" ? { reason: "String" } : {}
|
|
16218
|
+
},
|
|
16219
|
+
transformMutationPayload: safeSignatureMutationPayload2
|
|
16220
|
+
});
|
|
16221
|
+
});
|
|
16222
|
+
};
|
|
16223
|
+
lifecycle("send", "send_signature_envelope", "--confirm-send");
|
|
16224
|
+
lifecycle("archive", "archive_signature_envelope", null);
|
|
16225
|
+
lifecycle("unarchive", "unarchive_signature_envelope", null);
|
|
16226
|
+
lifecycle("destroy", "delete_signature_envelope", "--confirm");
|
|
16227
|
+
lifecycle("void", "void_signature_envelope", "--confirm");
|
|
16228
|
+
}
|
|
16229
|
+
|
|
16230
|
+
// src/commands/signatures.ts
|
|
16003
16231
|
var idSchema14 = (value, label = "id") => {
|
|
16004
16232
|
const parsed = typeof value === "string" ? value.trim() : "";
|
|
16005
16233
|
if (parsed.length === 0) {
|
|
@@ -16378,28 +16606,9 @@ function registerSignatureCommands(program) {
|
|
|
16378
16606
|
transformData: safeSignatureQueryPayload
|
|
16379
16607
|
});
|
|
16380
16608
|
});
|
|
16381
|
-
signatures
|
|
16382
|
-
|
|
16383
|
-
|
|
16384
|
-
await runGraphqlQueryCommand({
|
|
16385
|
-
command: "signatures.show",
|
|
16386
|
-
operationName: "SignaturesShow",
|
|
16387
|
-
runtimeOptions: context.runtimeOptions,
|
|
16388
|
-
field: "signature_envelope",
|
|
16389
|
-
variables: {
|
|
16390
|
-
organization_id: organizationId,
|
|
16391
|
-
id: idSchema14(opts.id),
|
|
16392
|
-
include_events: Boolean(opts.includeEvents)
|
|
16393
|
-
},
|
|
16394
|
-
variableTypes: {
|
|
16395
|
-
organization_id: "ID!",
|
|
16396
|
-
id: "ID!",
|
|
16397
|
-
include_events: "Boolean!"
|
|
16398
|
-
},
|
|
16399
|
-
selectionSet: "",
|
|
16400
|
-
isShow: true,
|
|
16401
|
-
transformData: safeSignatureQueryPayload
|
|
16402
|
-
});
|
|
16609
|
+
registerSignatureEnvelopeReadCommand(signatures, {
|
|
16610
|
+
identifier: idSchema14,
|
|
16611
|
+
queryPayload: safeSignatureQueryPayload
|
|
16403
16612
|
});
|
|
16404
16613
|
signatures.command("create").requiredOption("--file <file>").requiredOption("--mode <mode>", "request or self_sign").option("--data-json <dataJson>", "JSON object for additional draft fields").action(async (opts, cmd) => {
|
|
16405
16614
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
@@ -16410,135 +16619,24 @@ function registerSignatureCommands(program) {
|
|
|
16410
16619
|
payload: parseCreatePayload(opts.dataJson, opts.mode)
|
|
16411
16620
|
});
|
|
16412
16621
|
});
|
|
16413
|
-
signatures
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
operationName: "SignaturesUpdate",
|
|
16419
|
-
runtimeOptions: context.runtimeOptions,
|
|
16420
|
-
field: "update_signature_envelope",
|
|
16421
|
-
variables: {
|
|
16422
|
-
organization_id: organizationId,
|
|
16423
|
-
id: idSchema14(opts.id),
|
|
16424
|
-
params: parseUpdatePayload(opts.dataJson, opts)
|
|
16425
|
-
},
|
|
16426
|
-
variableTypes: {
|
|
16427
|
-
organization_id: "ID!",
|
|
16428
|
-
id: "ID!",
|
|
16429
|
-
params: "JSON!"
|
|
16430
|
-
},
|
|
16431
|
-
transformMutationPayload: safeSignatureMutationPayload
|
|
16432
|
-
});
|
|
16622
|
+
registerSignatureEnvelopeMutationCommands(signatures, {
|
|
16623
|
+
identifier: idSchema14,
|
|
16624
|
+
confirm: requireConfirmation,
|
|
16625
|
+
updatePayload: parseUpdatePayload,
|
|
16626
|
+
mutationPayload: safeSignatureMutationPayload
|
|
16433
16627
|
});
|
|
16434
|
-
const lifecycle = (name, field, confirmation) => {
|
|
16435
|
-
const command = signatures.command(name).requiredOption("--id <id>");
|
|
16436
|
-
if (name === "void") command.requiredOption("--reason <reason>");
|
|
16437
|
-
if (confirmation === "--confirm-send") command.option("--confirm-send");
|
|
16438
|
-
if (confirmation === "--confirm") command.option("--confirm");
|
|
16439
|
-
command.action(async (opts, cmd) => {
|
|
16440
|
-
if (confirmation === "--confirm-send") requireConfirmation(opts.confirmSend, "--confirm-send");
|
|
16441
|
-
if (confirmation === "--confirm") requireConfirmation(opts.confirm, "--confirm");
|
|
16442
|
-
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
16443
|
-
const organizationId = resolveOrganizationId(context.organizationId);
|
|
16444
|
-
await runGraphqlMutationCommand({
|
|
16445
|
-
command: "signatures." + name,
|
|
16446
|
-
operationName: "Signatures" + name.slice(0, 1).toUpperCase() + name.slice(1),
|
|
16447
|
-
runtimeOptions: context.runtimeOptions,
|
|
16448
|
-
field,
|
|
16449
|
-
variables: {
|
|
16450
|
-
organization_id: organizationId,
|
|
16451
|
-
id: idSchema14(opts.id),
|
|
16452
|
-
...name === "void" ? { reason: idSchema14(opts.reason, "reason") } : {}
|
|
16453
|
-
},
|
|
16454
|
-
variableTypes: {
|
|
16455
|
-
organization_id: "ID!",
|
|
16456
|
-
id: "ID!",
|
|
16457
|
-
...name === "void" ? { reason: "String" } : {}
|
|
16458
|
-
},
|
|
16459
|
-
transformMutationPayload: safeSignatureMutationPayload
|
|
16460
|
-
});
|
|
16461
|
-
});
|
|
16462
|
-
};
|
|
16463
|
-
lifecycle("send", "send_signature_envelope", "--confirm-send");
|
|
16464
|
-
lifecycle("archive", "archive_signature_envelope", null);
|
|
16465
|
-
lifecycle("unarchive", "unarchive_signature_envelope", null);
|
|
16466
|
-
lifecycle("destroy", "delete_signature_envelope", "--confirm");
|
|
16467
|
-
lifecycle("void", "void_signature_envelope", "--confirm");
|
|
16468
16628
|
}
|
|
16469
16629
|
|
|
16470
16630
|
// src/commands/atlasAuthoring.ts
|
|
16471
|
-
var
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
var
|
|
16475
|
-
var isoDateSchema = import_zod21.z.iso.date();
|
|
16476
|
-
var nonEmptyStringSchema = import_zod21.z.string().trim().min(1);
|
|
16477
|
-
var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
|
|
16478
|
-
var agentToolAccessSchema = import_zod21.z.array(
|
|
16479
|
-
import_zod21.z.object({
|
|
16480
|
-
tool_key: nonEmptyStringSchema,
|
|
16481
|
-
scope_value: nonEmptyStringSchema
|
|
16482
|
-
}).strict()
|
|
16483
|
-
).min(1);
|
|
16484
|
-
var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
|
|
16485
|
-
var agentPluginConnectionsSchema = import_zod21.z.array(
|
|
16486
|
-
import_zod21.z.object({
|
|
16487
|
-
external_tool_connection_id: nonEmptyStringSchema,
|
|
16488
|
-
tool_key: nonEmptyStringSchema,
|
|
16489
|
-
scope_value: nonEmptyStringSchema.optional(),
|
|
16490
|
-
allowed_tools: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16491
|
-
allowed_scopes: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16492
|
-
requires_confirmation: import_zod21.z.boolean().optional(),
|
|
16493
|
-
enabled: import_zod21.z.boolean().optional()
|
|
16494
|
-
}).strict()
|
|
16495
|
-
).min(1);
|
|
16496
|
-
var agentPluginConnectionUpdateSchema = import_zod21.z.array(
|
|
16497
|
-
import_zod21.z.union([
|
|
16498
|
-
import_zod21.z.object({
|
|
16499
|
-
id: nonEmptyStringSchema,
|
|
16500
|
-
_destroy: import_zod21.z.literal(true)
|
|
16501
|
-
}).strict(),
|
|
16502
|
-
import_zod21.z.object({
|
|
16503
|
-
id: nonEmptyStringSchema.optional(),
|
|
16504
|
-
external_tool_connection_id: nonEmptyStringSchema.optional(),
|
|
16505
|
-
tool_key: nonEmptyStringSchema.optional(),
|
|
16506
|
-
scope_value: nonEmptyStringSchema.optional(),
|
|
16507
|
-
allowed_tools: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16508
|
-
allowed_scopes: import_zod21.z.array(nonEmptyStringSchema).optional(),
|
|
16509
|
-
requires_confirmation: import_zod21.z.boolean().optional(),
|
|
16510
|
-
enabled: import_zod21.z.boolean().optional()
|
|
16511
|
-
}).strict().superRefine((value, context) => {
|
|
16512
|
-
if (value.id || value.external_tool_connection_id && value.tool_key) return;
|
|
16513
|
-
context.addIssue({
|
|
16514
|
-
code: import_zod21.z.ZodIssueCode.custom,
|
|
16515
|
-
message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
|
|
16516
|
-
});
|
|
16517
|
-
})
|
|
16518
|
-
])
|
|
16519
|
-
);
|
|
16520
|
-
var agentTriggerSchema = import_zod21.z.object({
|
|
16521
|
-
trigger_type: import_zod21.z.literal("cron"),
|
|
16522
|
-
cron_expression: nonEmptyStringSchema,
|
|
16523
|
-
timezone: nonEmptyStringSchema,
|
|
16524
|
-
starts_at: import_zod21.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
16525
|
-
ends_at: import_zod21.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
16526
|
-
max_runs: import_zod21.z.number().int().positive().nullable().optional(),
|
|
16527
|
-
enabled: import_zod21.z.boolean().optional()
|
|
16528
|
-
}).strict();
|
|
16529
|
-
var agentTriggerUpdateSchema = import_zod21.z.union([
|
|
16530
|
-
agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
|
|
16531
|
-
import_zod21.z.object({
|
|
16532
|
-
id: nonEmptyStringSchema,
|
|
16533
|
-
_destroy: import_zod21.z.literal(true)
|
|
16534
|
-
}).strict()
|
|
16535
|
-
]);
|
|
16536
|
-
var automationConfigSchema = import_zod21.z.record(import_zod21.z.string(), import_zod21.z.unknown());
|
|
16537
|
-
var AGENT_SELECTION = `{
|
|
16631
|
+
var import_zod22 = require("zod");
|
|
16632
|
+
|
|
16633
|
+
// src/commands/atlasAuthoringAgentSelection.ts
|
|
16634
|
+
var ATLAS_AUTHORING_AGENT_SELECTION = `{
|
|
16538
16635
|
id
|
|
16539
16636
|
type
|
|
16540
16637
|
name
|
|
16541
16638
|
slug
|
|
16639
|
+
systemKey
|
|
16542
16640
|
status
|
|
16543
16641
|
visibility
|
|
16544
16642
|
runWhenMentioned
|
|
@@ -16583,6 +16681,88 @@ var AGENT_SELECTION = `{
|
|
|
16583
16681
|
updatedAt
|
|
16584
16682
|
updateVersion
|
|
16585
16683
|
}`;
|
|
16684
|
+
|
|
16685
|
+
// src/commands/atlasAuthoring.ts
|
|
16686
|
+
var idSchema15 = import_zod22.z.string().trim().min(1);
|
|
16687
|
+
var idempotencyKeySchema = import_zod22.z.string().min(1).refine((value) => value.trim() === value, "Idempotency key must not have leading or trailing whitespace.");
|
|
16688
|
+
var skillScopeSchema = import_zod22.z.enum(["ADMIN_GLOBAL", "MEMBER_PERSONAL"]);
|
|
16689
|
+
var isoDateSchema = import_zod22.z.iso.date();
|
|
16690
|
+
var nonEmptyStringSchema = import_zod22.z.string().trim().min(1);
|
|
16691
|
+
var AUTOMATION_RUN_HTTP_TIMEOUT_MS = 6e4;
|
|
16692
|
+
var agentToolAccessSchema = import_zod22.z.array(
|
|
16693
|
+
import_zod22.z.object({
|
|
16694
|
+
tool_key: nonEmptyStringSchema,
|
|
16695
|
+
scope_value: nonEmptyStringSchema
|
|
16696
|
+
}).strict()
|
|
16697
|
+
).min(1);
|
|
16698
|
+
var agentToolAccessUpdateSchema = agentToolAccessSchema.min(0);
|
|
16699
|
+
var agentPluginConnectionsSchema = import_zod22.z.array(
|
|
16700
|
+
import_zod22.z.object({
|
|
16701
|
+
external_tool_connection_id: nonEmptyStringSchema,
|
|
16702
|
+
tool_key: nonEmptyStringSchema,
|
|
16703
|
+
scope_value: nonEmptyStringSchema.optional(),
|
|
16704
|
+
allowed_tools: import_zod22.z.array(nonEmptyStringSchema).optional(),
|
|
16705
|
+
allowed_scopes: import_zod22.z.array(nonEmptyStringSchema).optional(),
|
|
16706
|
+
requires_confirmation: import_zod22.z.boolean().optional(),
|
|
16707
|
+
enabled: import_zod22.z.boolean().optional()
|
|
16708
|
+
}).strict()
|
|
16709
|
+
).min(1);
|
|
16710
|
+
var agentPluginConnectionUpdateSchema = import_zod22.z.array(
|
|
16711
|
+
import_zod22.z.union([
|
|
16712
|
+
import_zod22.z.object({
|
|
16713
|
+
id: nonEmptyStringSchema,
|
|
16714
|
+
_destroy: import_zod22.z.literal(true)
|
|
16715
|
+
}).strict(),
|
|
16716
|
+
import_zod22.z.object({
|
|
16717
|
+
id: nonEmptyStringSchema.optional(),
|
|
16718
|
+
external_tool_connection_id: nonEmptyStringSchema.optional(),
|
|
16719
|
+
tool_key: nonEmptyStringSchema.optional(),
|
|
16720
|
+
scope_value: nonEmptyStringSchema.optional(),
|
|
16721
|
+
allowed_tools: import_zod22.z.array(nonEmptyStringSchema).optional(),
|
|
16722
|
+
allowed_scopes: import_zod22.z.array(nonEmptyStringSchema).optional(),
|
|
16723
|
+
requires_confirmation: import_zod22.z.boolean().optional(),
|
|
16724
|
+
enabled: import_zod22.z.boolean().optional()
|
|
16725
|
+
}).strict().superRefine((value, context) => {
|
|
16726
|
+
if (value.id || value.external_tool_connection_id && value.tool_key) return;
|
|
16727
|
+
context.addIssue({
|
|
16728
|
+
code: import_zod22.z.ZodIssueCode.custom,
|
|
16729
|
+
message: "Plugin updates require an id, or both external_tool_connection_id and tool_key for a new grant."
|
|
16730
|
+
});
|
|
16731
|
+
})
|
|
16732
|
+
])
|
|
16733
|
+
);
|
|
16734
|
+
var agentTriggerSchema = import_zod22.z.object({
|
|
16735
|
+
trigger_type: import_zod22.z.literal("cron"),
|
|
16736
|
+
cron_expression: nonEmptyStringSchema,
|
|
16737
|
+
timezone: nonEmptyStringSchema,
|
|
16738
|
+
starts_at: import_zod22.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
16739
|
+
ends_at: import_zod22.z.iso.datetime({ offset: true }).nullable().optional(),
|
|
16740
|
+
max_runs: import_zod22.z.number().int().positive().nullable().optional(),
|
|
16741
|
+
enabled: import_zod22.z.boolean().optional()
|
|
16742
|
+
}).strict();
|
|
16743
|
+
var agentTriggerUpdateSchema = import_zod22.z.union([
|
|
16744
|
+
agentTriggerSchema.extend({ id: nonEmptyStringSchema.optional() }).strict(),
|
|
16745
|
+
import_zod22.z.object({
|
|
16746
|
+
id: nonEmptyStringSchema,
|
|
16747
|
+
_destroy: import_zod22.z.literal(true)
|
|
16748
|
+
}).strict()
|
|
16749
|
+
]);
|
|
16750
|
+
var automationConfigSchema = import_zod22.z.record(import_zod22.z.string(), import_zod22.z.unknown());
|
|
16751
|
+
var AGENT_DETAILS_SELECTION = `{
|
|
16752
|
+
count
|
|
16753
|
+
currentPage
|
|
16754
|
+
totalPages
|
|
16755
|
+
data {
|
|
16756
|
+
id
|
|
16757
|
+
type
|
|
16758
|
+
attributes {
|
|
16759
|
+
agentId
|
|
16760
|
+
memberId
|
|
16761
|
+
name
|
|
16762
|
+
description
|
|
16763
|
+
}
|
|
16764
|
+
}
|
|
16765
|
+
}`;
|
|
16586
16766
|
var AGENT_PLUGIN_CATALOG_SELECTION = `{
|
|
16587
16767
|
externalToolConnectionId
|
|
16588
16768
|
provider
|
|
@@ -16720,8 +16900,8 @@ function requirePaginationInteger(value, key, minimum) {
|
|
|
16720
16900
|
});
|
|
16721
16901
|
}
|
|
16722
16902
|
function normalizeAutomationList(payload) {
|
|
16723
|
-
const
|
|
16724
|
-
if (!
|
|
16903
|
+
const page2 = asRecord6(payload);
|
|
16904
|
+
if (!page2 || !Array.isArray(page2.data)) {
|
|
16725
16905
|
throw new CliError({
|
|
16726
16906
|
message: "Automation list response did not include a paginated data collection.",
|
|
16727
16907
|
kind: "malformed_response",
|
|
@@ -16729,7 +16909,7 @@ function normalizeAutomationList(payload) {
|
|
|
16729
16909
|
exitCode: EXIT_CODES.networkOrUpstream
|
|
16730
16910
|
});
|
|
16731
16911
|
}
|
|
16732
|
-
const rows =
|
|
16912
|
+
const rows = page2.data;
|
|
16733
16913
|
const data = rows.map((value) => {
|
|
16734
16914
|
const row = asRecord6(value);
|
|
16735
16915
|
const attributes = asRecord6(row?.attributes);
|
|
@@ -16771,9 +16951,9 @@ function normalizeAutomationList(payload) {
|
|
|
16771
16951
|
});
|
|
16772
16952
|
return {
|
|
16773
16953
|
data,
|
|
16774
|
-
count: requirePaginationInteger(
|
|
16775
|
-
currentPage: requirePaginationInteger(
|
|
16776
|
-
totalPages: requirePaginationInteger(
|
|
16954
|
+
count: requirePaginationInteger(page2.count, "count", 0),
|
|
16955
|
+
currentPage: requirePaginationInteger(page2.currentPage, "currentPage", 1),
|
|
16956
|
+
totalPages: requirePaginationInteger(page2.totalPages, "totalPages", 1)
|
|
16777
16957
|
};
|
|
16778
16958
|
}
|
|
16779
16959
|
function parseBooleanOption(value, optionName) {
|
|
@@ -16824,10 +17004,10 @@ function normalizePersistedCreatePayload(payload) {
|
|
|
16824
17004
|
const automationExecution = asRecord6(attributes?.automation_execution) ?? asRecord6(attributes?.automationExecution);
|
|
16825
17005
|
const meta = asRecord6(mutationData?.meta);
|
|
16826
17006
|
const idempotency = asRecord6(meta?.atlas_idempotency);
|
|
16827
|
-
const
|
|
17007
|
+
const id2 = asRequiredString(persisted?.id);
|
|
16828
17008
|
const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
|
|
16829
17009
|
const replay = idempotency?.replay;
|
|
16830
|
-
if (!mutation || !mutationData || !persisted || !
|
|
17010
|
+
if (!mutation || !mutationData || !persisted || !id2 || !slug || !idempotency || typeof replay !== "boolean") {
|
|
16831
17011
|
throw new CliError({
|
|
16832
17012
|
message: "Create response did not include persisted id/slug and idempotency metadata.",
|
|
16833
17013
|
kind: "malformed_response",
|
|
@@ -16840,7 +17020,7 @@ function normalizePersistedCreatePayload(payload) {
|
|
|
16840
17020
|
status: mutation.status,
|
|
16841
17021
|
errorCode: mutation.errorCode ?? null,
|
|
16842
17022
|
errors: mutation.errors ?? null,
|
|
16843
|
-
persisted: { id, slug },
|
|
17023
|
+
persisted: { id: id2, slug },
|
|
16844
17024
|
idempotency: {
|
|
16845
17025
|
object_type: asRequiredString(idempotency.object_type),
|
|
16846
17026
|
id: asRequiredString(idempotency.id),
|
|
@@ -16858,10 +17038,10 @@ function normalizePersistedUpdatePayload(payload) {
|
|
|
16858
17038
|
const mutationData = asRecord6(mutation?.data);
|
|
16859
17039
|
const persisted = asRecord6(mutationData?.data) ?? mutationData;
|
|
16860
17040
|
const attributes = asRecord6(persisted?.attributes);
|
|
16861
|
-
const
|
|
17041
|
+
const id2 = asRequiredString(persisted?.id);
|
|
16862
17042
|
const slug = asRequiredString(persisted?.slug) ?? asRequiredString(attributes?.slug);
|
|
16863
17043
|
const updateVersion = asRequiredString(persisted?.updateVersion) ?? asRequiredString(attributes?.updateVersion) ?? asRequiredString(attributes?.update_version);
|
|
16864
|
-
if (!mutation || !mutationData || !persisted || !
|
|
17044
|
+
if (!mutation || !mutationData || !persisted || !id2 || !slug || !updateVersion) {
|
|
16865
17045
|
throw new CliError({
|
|
16866
17046
|
message: "Update response did not include persisted id, slug, and updateVersion.",
|
|
16867
17047
|
kind: "malformed_response",
|
|
@@ -16874,7 +17054,7 @@ function normalizePersistedUpdatePayload(payload) {
|
|
|
16874
17054
|
status: mutation.status,
|
|
16875
17055
|
errorCode: mutation.errorCode ?? null,
|
|
16876
17056
|
errors: mutation.errors ?? null,
|
|
16877
|
-
persisted: { id, slug, update_version: updateVersion }
|
|
17057
|
+
persisted: { id: id2, slug, update_version: updateVersion }
|
|
16878
17058
|
};
|
|
16879
17059
|
}
|
|
16880
17060
|
function normalizeAutomationRunPayload(payload) {
|
|
@@ -17095,7 +17275,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17095
17275
|
});
|
|
17096
17276
|
});
|
|
17097
17277
|
agents.command("show").description("Read one persisted Agent by id or slug").requiredOption("--id <idOrSlug>", "Agent id or slug").action(async (opts, cmd) => {
|
|
17098
|
-
const
|
|
17278
|
+
const id2 = idSchema15.parse(opts.id);
|
|
17099
17279
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17100
17280
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
17101
17281
|
await runGraphqlQueryCommand({
|
|
@@ -17103,9 +17283,29 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17103
17283
|
operationName: "AgentsShow",
|
|
17104
17284
|
runtimeOptions: context.runtimeOptions,
|
|
17105
17285
|
field: "agent",
|
|
17106
|
-
variables: { organization_id: organizationId, id },
|
|
17286
|
+
variables: { organization_id: organizationId, id: id2 },
|
|
17107
17287
|
variableTypes: { organization_id: "ID!", id: "ID!" },
|
|
17108
|
-
selectionSet:
|
|
17288
|
+
selectionSet: ATLAS_AUTHORING_AGENT_SELECTION,
|
|
17289
|
+
isShow: true
|
|
17290
|
+
});
|
|
17291
|
+
});
|
|
17292
|
+
agents.command("details-show").description("Read the authenticated member's persisted detail for one Agent").requiredOption("--id <idOrSlug>", "Agent id or slug").action(async (opts, cmd) => {
|
|
17293
|
+
const id2 = idSchema15.parse(opts.id);
|
|
17294
|
+
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17295
|
+
const organizationId = resolveOrganizationId(context.organizationId);
|
|
17296
|
+
await runGraphqlQueryCommand({
|
|
17297
|
+
command: "agents.details-show",
|
|
17298
|
+
operationName: "AgentsDetailsShow",
|
|
17299
|
+
runtimeOptions: context.runtimeOptions,
|
|
17300
|
+
field: "agent_details",
|
|
17301
|
+
variables: { organization_id: organizationId, agent_id: id2, page: 1, per: 1 },
|
|
17302
|
+
variableTypes: {
|
|
17303
|
+
organization_id: "ID!",
|
|
17304
|
+
agent_id: "ID!",
|
|
17305
|
+
page: "Int",
|
|
17306
|
+
per: "Int"
|
|
17307
|
+
},
|
|
17308
|
+
selectionSet: AGENT_DETAILS_SELECTION,
|
|
17109
17309
|
isShow: true
|
|
17110
17310
|
});
|
|
17111
17311
|
});
|
|
@@ -17157,7 +17357,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17157
17357
|
const trigger = parseJsonOption(opts.trigger, "--trigger", agentTriggerUpdateSchema);
|
|
17158
17358
|
const patch = {
|
|
17159
17359
|
...opts.name !== void 0 ? { name: String(opts.name) } : {},
|
|
17160
|
-
...opts.description !== void 0 ? { description: String(opts.description) } : {},
|
|
17360
|
+
...opts.description !== void 0 ? { agent_details_attributes: [{ description: String(opts.description) }] } : {},
|
|
17161
17361
|
...opts.notes !== void 0 ? { notes: String(opts.notes) } : {},
|
|
17162
17362
|
...opts.status !== void 0 ? { status: String(opts.status) } : {},
|
|
17163
17363
|
...opts.visibility !== void 0 ? { visibility: String(opts.visibility) } : {},
|
|
@@ -17183,7 +17383,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17183
17383
|
exitCode: EXIT_CODES.invalidArgs
|
|
17184
17384
|
});
|
|
17185
17385
|
}
|
|
17186
|
-
const
|
|
17386
|
+
const id2 = idSchema15.parse(opts.id);
|
|
17187
17387
|
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
17188
17388
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17189
17389
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -17200,7 +17400,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17200
17400
|
},
|
|
17201
17401
|
variables: {
|
|
17202
17402
|
organization_id: organizationId,
|
|
17203
|
-
agent_id:
|
|
17403
|
+
agent_id: id2,
|
|
17204
17404
|
params: { agent: patch },
|
|
17205
17405
|
expected_update_version: expectedUpdateVersion
|
|
17206
17406
|
},
|
|
@@ -17209,9 +17409,16 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17209
17409
|
});
|
|
17210
17410
|
agents.command("plugin-catalog").description("Read connected Agent plugin capabilities for one supported service").requiredOption(
|
|
17211
17411
|
"--service <service>",
|
|
17212
|
-
"Supported service: gmail, calendar, slack, or stripe"
|
|
17412
|
+
"Supported service: gmail, calendar, outlook_calendar, outlook_mail, slack, or stripe"
|
|
17213
17413
|
).action(async (opts, cmd) => {
|
|
17214
|
-
const service =
|
|
17414
|
+
const service = import_zod22.z.enum([
|
|
17415
|
+
"gmail",
|
|
17416
|
+
"calendar",
|
|
17417
|
+
"outlook_calendar",
|
|
17418
|
+
"outlook_mail",
|
|
17419
|
+
"slack",
|
|
17420
|
+
"stripe"
|
|
17421
|
+
]).parse(opts.service);
|
|
17215
17422
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17216
17423
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
17217
17424
|
await runGraphqlQueryCommand({
|
|
@@ -17282,7 +17489,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17282
17489
|
});
|
|
17283
17490
|
});
|
|
17284
17491
|
automations.command("show").description("Read one persisted Automation by id or slug").requiredOption("--id <idOrSlug>", "Automation id or slug").action(async (opts, cmd) => {
|
|
17285
|
-
const
|
|
17492
|
+
const id2 = idSchema15.parse(opts.id);
|
|
17286
17493
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17287
17494
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
17288
17495
|
await runGraphqlQueryCommand({
|
|
@@ -17290,7 +17497,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17290
17497
|
operationName: "AutomationsShow",
|
|
17291
17498
|
runtimeOptions: context.runtimeOptions,
|
|
17292
17499
|
field: "automation",
|
|
17293
|
-
variables: { organization_id: organizationId, id },
|
|
17500
|
+
variables: { organization_id: organizationId, id: id2 },
|
|
17294
17501
|
variableTypes: { organization_id: "ID!", id: "ID!" },
|
|
17295
17502
|
selectionSet: AUTOMATION_SELECTION,
|
|
17296
17503
|
isShow: true
|
|
@@ -17393,7 +17600,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17393
17600
|
exitCode: EXIT_CODES.invalidArgs
|
|
17394
17601
|
});
|
|
17395
17602
|
}
|
|
17396
|
-
const
|
|
17603
|
+
const id2 = idSchema15.parse(opts.id);
|
|
17397
17604
|
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
17398
17605
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17399
17606
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -17410,7 +17617,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17410
17617
|
},
|
|
17411
17618
|
variables: {
|
|
17412
17619
|
organization_id: organizationId,
|
|
17413
|
-
task_id:
|
|
17620
|
+
task_id: id2,
|
|
17414
17621
|
params: { task: patch },
|
|
17415
17622
|
expected_update_version: expectedUpdateVersion
|
|
17416
17623
|
},
|
|
@@ -17465,7 +17672,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17465
17672
|
exitCode: EXIT_CODES.invalidArgs
|
|
17466
17673
|
});
|
|
17467
17674
|
}
|
|
17468
|
-
const
|
|
17675
|
+
const id2 = idSchema15.parse(opts.id);
|
|
17469
17676
|
const expectedUpdateVersion = parseExpectedUpdateVersion(opts.expectedUpdateVersion);
|
|
17470
17677
|
const context = await resolveCommandContext(cmd.optsWithGlobals());
|
|
17471
17678
|
const organizationId = resolveOrganizationId(context.organizationId);
|
|
@@ -17482,7 +17689,7 @@ function registerAtlasAuthoringCommands(program) {
|
|
|
17482
17689
|
},
|
|
17483
17690
|
variables: {
|
|
17484
17691
|
organization_id: organizationId,
|
|
17485
|
-
id,
|
|
17692
|
+
id: id2,
|
|
17486
17693
|
input: patch,
|
|
17487
17694
|
expected_update_version: expectedUpdateVersion
|
|
17488
17695
|
},
|
|
@@ -17525,7 +17732,7 @@ function validateActivityRange(startAt, endAt) {
|
|
|
17525
17732
|
}
|
|
17526
17733
|
}
|
|
17527
17734
|
function parseMemberIds(value) {
|
|
17528
|
-
const memberIds = [...new Set(value.split(",").map((
|
|
17735
|
+
const memberIds = [...new Set(value.split(",").map((id2) => id2.trim()).filter(Boolean))];
|
|
17529
17736
|
if (memberIds.length < 1 || memberIds.length > 100) {
|
|
17530
17737
|
throw new Error("member-ids must contain between 1 and 100 unique member IDs");
|
|
17531
17738
|
}
|
|
@@ -17980,7 +18187,7 @@ var PRIMARY_NAMESPACES = [
|
|
|
17980
18187
|
"phantom",
|
|
17981
18188
|
"tasks",
|
|
17982
18189
|
"projects",
|
|
17983
|
-
"
|
|
18190
|
+
"goals",
|
|
17984
18191
|
"meetings",
|
|
17985
18192
|
"members",
|
|
17986
18193
|
"agents",
|
|
@@ -17997,7 +18204,7 @@ var ADVANCED_NAMESPACES = [
|
|
|
17997
18204
|
"issue-groups",
|
|
17998
18205
|
"todo-groups",
|
|
17999
18206
|
"todos",
|
|
18000
|
-
"
|
|
18207
|
+
"goal-collections",
|
|
18001
18208
|
"knowledge",
|
|
18002
18209
|
"stand-ups",
|
|
18003
18210
|
"news",
|
|
@@ -18177,7 +18384,6 @@ var NAMESPACE_DOCS = {
|
|
|
18177
18384
|
"Create preserves API-owned defaults by sending only supplied typed Agent fields.",
|
|
18178
18385
|
"Update calls only updateAgent with an exact opaque updateVersion token and cannot change ownership.",
|
|
18179
18386
|
"Native tools, plugin connector grants, and the cron trigger use strict canonical JSON shapes.",
|
|
18180
|
-
"Outlook Calendar and Outlook Mail are not supported Agent plugin families in this release.",
|
|
18181
18387
|
"Show uses the API-owned agent query by id; no slug fallback is implemented."
|
|
18182
18388
|
],
|
|
18183
18389
|
commands: ["create", "show", "update"]
|
|
@@ -18238,24 +18444,28 @@ var NAMESPACE_DOCS = {
|
|
|
18238
18444
|
support: {
|
|
18239
18445
|
name: "support",
|
|
18240
18446
|
tier: "primary",
|
|
18241
|
-
description: "Support
|
|
18447
|
+
description: "Support metadata, explicit conversation/message/ticket/article reads and approved replies and triage.",
|
|
18242
18448
|
examples: [
|
|
18243
|
-
"wave support counts
|
|
18449
|
+
"wave support counts",
|
|
18244
18450
|
"wave support tickets --status open --page 1 --per 20",
|
|
18245
18451
|
"wave support knowledge-articles --collection-id 123 --visibility public",
|
|
18246
18452
|
"wave support settings",
|
|
18247
|
-
"wave support open"
|
|
18453
|
+
"wave support open",
|
|
18454
|
+
"wave support conversation --conversation-id 123",
|
|
18455
|
+
"wave support messages --conversation-id 123 --page 1 --per 25",
|
|
18456
|
+
"wave support ticket --id TASK-123",
|
|
18457
|
+
"wave support article --id KNW-123"
|
|
18248
18458
|
],
|
|
18249
18459
|
schema: {
|
|
18250
18460
|
output: "json-envelope-default",
|
|
18251
|
-
readOnly:
|
|
18461
|
+
readOnly: false,
|
|
18252
18462
|
safety: [
|
|
18253
18463
|
"Uses verified WAVE-02 backend fields for Support counts, tickets, labels, settings, and knowledge metadata.",
|
|
18254
18464
|
"Uses verified WAVE-03 safe routes under /support and /resource_center.",
|
|
18255
|
-
"Ticket
|
|
18256
|
-
"
|
|
18465
|
+
"Ticket and article listings remain metadata-only; explicit ticket/article detail reads enforce Support subtype boundaries.",
|
|
18466
|
+
"Message history is explicitly requested, bounded to 100 messages per page and newest-first.",
|
|
18257
18467
|
"Settings output excludes tokens, secrets, private embed data, website source secrets, message bodies, customer contact details, internal notes, and article content.",
|
|
18258
|
-
"
|
|
18468
|
+
"Explicit detail reads expose authorized content; reply, note and triage require machine approval. No generic update, delete, publish, media or visitor impersonation."
|
|
18259
18469
|
],
|
|
18260
18470
|
commands: [
|
|
18261
18471
|
"open",
|
|
@@ -18712,11 +18922,11 @@ async function resolveDoctorAuthOrganization(params) {
|
|
|
18712
18922
|
if (!organization || typeof organization !== "object" || Array.isArray(organization)) {
|
|
18713
18923
|
return null;
|
|
18714
18924
|
}
|
|
18715
|
-
const
|
|
18925
|
+
const id2 = organization.id;
|
|
18716
18926
|
const slug = organization.slug;
|
|
18717
18927
|
const result = {};
|
|
18718
|
-
if (typeof
|
|
18719
|
-
result.id =
|
|
18928
|
+
if (typeof id2 === "string" && id2.trim() !== "") {
|
|
18929
|
+
result.id = id2;
|
|
18720
18930
|
}
|
|
18721
18931
|
if (typeof slug === "string" && slug.trim() !== "") {
|
|
18722
18932
|
result.slug = slug;
|
|
@@ -18801,7 +19011,7 @@ async function runDoctor(cmd, opts) {
|
|
|
18801
19011
|
},
|
|
18802
19012
|
body: JSON.stringify({ query: "query WaveCliDoctor { __typename }" })
|
|
18803
19013
|
});
|
|
18804
|
-
const
|
|
19014
|
+
const body2 = await response.text();
|
|
18805
19015
|
checks.push({
|
|
18806
19016
|
name: "graphql_reachability",
|
|
18807
19017
|
ok: response.ok,
|
|
@@ -18810,8 +19020,8 @@ async function runDoctor(cmd, opts) {
|
|
|
18810
19020
|
});
|
|
18811
19021
|
checks.push({
|
|
18812
19022
|
name: "api_response_health",
|
|
18813
|
-
ok: response.ok &&
|
|
18814
|
-
status: response.ok &&
|
|
19023
|
+
ok: response.ok && body2.trim().startsWith("{"),
|
|
19024
|
+
status: response.ok && body2.trim().startsWith("{") ? "json" : "unexpected_response"
|
|
18815
19025
|
});
|
|
18816
19026
|
} catch (error) {
|
|
18817
19027
|
checks.push({
|
|
@@ -19017,7 +19227,7 @@ function attachDiscoveryHelp(program) {
|
|
|
19017
19227
|
|
|
19018
19228
|
// src/cli.ts
|
|
19019
19229
|
function buildCli(options) {
|
|
19020
|
-
const program = new
|
|
19230
|
+
const program = new import_commander3.Command();
|
|
19021
19231
|
program.name("wave").description("Wave agent CLI").version(CLI_VERSION, "-V, --version", "output the version number").showHelpAfterError(false).allowExcessArguments(false).option("--token <token>", "API token (prefer WAVE_API_TOKEN env var)").option("--token-stdin", "Read API token from stdin").option(
|
|
19022
19232
|
"--auth-json-stdin",
|
|
19023
19233
|
"Read auth/runtime context JSON from stdin (token, baseUrl, tracing fields, ...)"
|
|
@@ -19031,9 +19241,9 @@ function buildCli(options) {
|
|
|
19031
19241
|
"--config <configPath>",
|
|
19032
19242
|
"Optional JSON config file (default: ~/.wave/config.json when present)"
|
|
19033
19243
|
).addOption(
|
|
19034
|
-
new
|
|
19244
|
+
new import_commander3.Option("--auth-home <path>", "Credential storage directory (default: ~/.wave)")
|
|
19035
19245
|
).addOption(
|
|
19036
|
-
new
|
|
19246
|
+
new import_commander3.Option("--auth-storage <mode>", "Credential storage mode").choices(["auto", "keychain", "file", "disabled"]).default("auto")
|
|
19037
19247
|
).option("--timeout-ms <timeoutMs>", "HTTP timeout in milliseconds").option("--agent-name <agentName>", "Agent name for tracing").option("--agent-run-id <agentRunId>", "Agent run identifier for tracing").option("--request-id <requestId>", "Request identifier").option(
|
|
19038
19248
|
"--atlas-member-id <memberId>",
|
|
19039
19249
|
"Atlas ledger member ID (prefer WAVE_ATLAS_MEMBER_ID env var)"
|
|
@@ -19076,7 +19286,7 @@ function buildCli(options) {
|
|
|
19076
19286
|
setInternalCliOptions(program, options?.internal);
|
|
19077
19287
|
registerTaskCommands(program);
|
|
19078
19288
|
registerProjectCommands(program);
|
|
19079
|
-
|
|
19289
|
+
registerGoalCommands(program);
|
|
19080
19290
|
registerMeetingCommands(program);
|
|
19081
19291
|
registerMemberCommands(program);
|
|
19082
19292
|
registerResourceCommands(program);
|
|
@@ -19259,8 +19469,8 @@ function isTrustedAuth(value) {
|
|
|
19259
19469
|
function isTrustedApproval(value) {
|
|
19260
19470
|
return isPlainObject2(value) && typeof value.operation === "string" && typeof value.inputDigest === "string" && typeof value.cliVersion === "string" && typeof value.registryDigest === "string" && typeof value.organizationId === "string" && value.organizationId.trim() !== "" && typeof value.actorId === "string" && value.actorId.trim() !== "";
|
|
19261
19471
|
}
|
|
19262
|
-
function operationCommand(program,
|
|
19263
|
-
return listInvocableCommands(program).find((command) => commandId(command) ===
|
|
19472
|
+
function operationCommand(program, id2) {
|
|
19473
|
+
return listInvocableCommands(program).find((command) => commandId(command) === id2);
|
|
19264
19474
|
}
|
|
19265
19475
|
function typeMatches2(value, type) {
|
|
19266
19476
|
if (type === "array") return Array.isArray(value);
|
|
@@ -19375,10 +19585,10 @@ function withTrustedMachineAuth(auth, callback) {
|
|
|
19375
19585
|
function needsTrustedAuth(operation) {
|
|
19376
19586
|
return operation.classification === "read" || operation.classification === "write" || operation.classification === "auth";
|
|
19377
19587
|
}
|
|
19378
|
-
function resolveMachineOperation(program,
|
|
19588
|
+
function resolveMachineOperation(program, id2) {
|
|
19379
19589
|
const manifest = buildOperationManifest(program);
|
|
19380
|
-
const operation = manifest.operations.find((candidate) => candidate.id ===
|
|
19381
|
-
const command = operation ? operationCommand(program,
|
|
19590
|
+
const operation = manifest.operations.find((candidate) => candidate.id === id2);
|
|
19591
|
+
const command = operation ? operationCommand(program, id2) : void 0;
|
|
19382
19592
|
return operation && command && hasAction2(command) ? { operation, command } : null;
|
|
19383
19593
|
}
|
|
19384
19594
|
async function maybeRunMachineExecute(argv, program) {
|
|
@@ -19627,7 +19837,7 @@ main().catch((error) => {
|
|
|
19627
19837
|
});
|
|
19628
19838
|
return;
|
|
19629
19839
|
}
|
|
19630
|
-
if (error instanceof
|
|
19840
|
+
if (error instanceof import_commander4.CommanderError) {
|
|
19631
19841
|
if (error.code === "commander.helpDisplayed" || error.code === "commander.help" || error.code === "commander.version") {
|
|
19632
19842
|
process.exitCode = EXIT_CODES.success;
|
|
19633
19843
|
return;
|
|
@@ -19641,13 +19851,13 @@ main().catch((error) => {
|
|
|
19641
19851
|
});
|
|
19642
19852
|
return;
|
|
19643
19853
|
}
|
|
19644
|
-
if (error instanceof
|
|
19854
|
+
if (error instanceof import_zod23.ZodError || error instanceof import_commander4.InvalidArgumentError) {
|
|
19645
19855
|
printCliFailure({
|
|
19646
19856
|
status: 400,
|
|
19647
19857
|
code: "invalid_args",
|
|
19648
19858
|
message: "Invalid command arguments.",
|
|
19649
19859
|
details: {
|
|
19650
|
-
issues: error instanceof
|
|
19860
|
+
issues: error instanceof import_zod23.ZodError ? error.issues : [{ message: error.message, code: "invalid_argument" }]
|
|
19651
19861
|
},
|
|
19652
19862
|
exitCode: EXIT_CODES.invalidArgs
|
|
19653
19863
|
});
|