@ted-galago/wave-cli 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -180,6 +180,9 @@ function debugLog(config, message) {
180
180
  function graphqlOperationName(command) {
181
181
  return command.split(/[^a-zA-Z0-9]/).filter(Boolean).map((part) => part[0].toUpperCase() + part.slice(1)).join("");
182
182
  }
183
+ function toCamelCase(value) {
184
+ return value.replace(/_([a-z])/g, (_, char) => char.toUpperCase());
185
+ }
183
186
  function inferStatusFromGraphqlErrors(errors) {
184
187
  if (!Array.isArray(errors) || errors.length === 0) {
185
188
  return 400;
@@ -226,18 +229,39 @@ function graphqlTypeForValue(value) {
226
229
  }
227
230
  return "JSON";
228
231
  }
232
+ function graphqlTypeForVariable(name, value) {
233
+ if (name === "id" || name.endsWith("Id")) {
234
+ return "ID";
235
+ }
236
+ if (name.endsWith("Ids")) {
237
+ return "[ID!]";
238
+ }
239
+ return graphqlTypeForValue(value);
240
+ }
241
+ function withNonNull(typeName) {
242
+ return typeName.endsWith("!") ? typeName : `${typeName}!`;
243
+ }
244
+ function normalizeGraphqlVariables(variables) {
245
+ const normalized = {};
246
+ Object.entries(variables).forEach(([key, value]) => {
247
+ normalized[toCamelCase(key)] = value;
248
+ });
249
+ return normalized;
250
+ }
229
251
  function buildGraphqlBody(input) {
252
+ const graphqlField = toCamelCase(input.field);
253
+ const graphqlVariables = normalizeGraphqlVariables(input.variables);
230
254
  const operationName = graphqlOperationName(input.command);
231
- const variableEntries = Object.entries(input.variables).filter(([, value]) => value !== void 0);
232
- const variableDecl = variableEntries.map(([name, value]) => `$${name}: ${graphqlTypeForValue(value)}`).join(", ");
255
+ const variableEntries = Object.entries(graphqlVariables).filter(([, value]) => value !== void 0);
256
+ const variableDecl = variableEntries.map(([name, value]) => `$${name}: ${withNonNull(graphqlTypeForVariable(name, value))}`).join(", ");
233
257
  const fieldArgs = variableEntries.map(([name]) => `${name}: $${name}`).join(", ");
234
258
  const signature = variableDecl.length > 0 ? `(${variableDecl})` : "";
235
259
  const args = fieldArgs.length > 0 ? `(${fieldArgs})` : "";
236
- const query = `${input.operationType} ${operationName}${signature} { ${input.field}${args} ${input.selectionSet} }`;
260
+ const query = `${input.operationType} ${operationName}${signature} { ${graphqlField}${args} ${input.selectionSet} }`;
237
261
  return {
238
262
  operationName,
239
263
  query,
240
- variables: input.variables
264
+ variables: graphqlVariables
241
265
  };
242
266
  }
243
267
  async function graphqlRequest(input) {
@@ -288,7 +312,7 @@ async function graphqlRequest(input) {
288
312
  exitCode: mapStatusToExitCode(status)
289
313
  };
290
314
  }
291
- const fieldPayload = gqlData[input.field];
315
+ const fieldPayload = gqlData[toCamelCase(input.field)];
292
316
  if (input.operationType === "mutation") {
293
317
  const mutationPayload = fieldPayload && typeof fieldPayload === "object" ? fieldPayload : {};
294
318
  const ok = Boolean(mutationPayload.ok);
@@ -301,7 +325,9 @@ async function graphqlRequest(input) {
301
325
  status,
302
326
  data: null,
303
327
  error: {
304
- code: String(mutationPayload.error_code ?? `http_${status}`),
328
+ code: String(
329
+ mutationPayload.errorCode ?? mutationPayload.error_code ?? `http_${status}`
330
+ ),
305
331
  message: "Mutation failed.",
306
332
  details: {
307
333
  errors: mutationPayload.errors ?? null,
@@ -404,10 +430,10 @@ function buildCliErrorEnvelope(params) {
404
430
  }
405
431
  function defaultQuerySelectionSet(field, isList) {
406
432
  if (field === "organization") {
407
- return "{ id slug members_count organization_detail { title name description timezone workspace_name } }";
433
+ return "{ id slug membersCount organizationDetail { title name description timezone workspaceName } }";
408
434
  }
409
435
  if (isList) {
410
- return "{ data { id type attributes } count current_page total_pages }";
436
+ return "{ data { id type attributes } count currentPage totalPages }";
411
437
  }
412
438
  return "{ id type attributes }";
413
439
  }
@@ -447,7 +473,7 @@ function normalizeGraphqlVariable(key, value) {
447
473
  }
448
474
  return parseBooleanMaybe(trimmed);
449
475
  }
450
- function normalizeGraphqlVariables(raw) {
476
+ function normalizeGraphqlVariables2(raw) {
451
477
  const normalized = {};
452
478
  Object.entries(raw).forEach(([key, value]) => {
453
479
  const next = normalizeGraphqlVariable(key, value);
@@ -504,7 +530,7 @@ async function runGraphqlMutationCommand(input) {
504
530
  operationType: "mutation",
505
531
  field: input.field,
506
532
  variables: input.variables ?? {},
507
- selectionSet: input.selectionSet ?? "{ ok status error_code data errors }"
533
+ selectionSet: input.selectionSet ?? "{ ok status errorCode data errors }"
508
534
  });
509
535
  printEnvelopeAndExit(result);
510
536
  } catch (error) {
@@ -1154,6 +1180,21 @@ function buildDataJsonHelp(rootKey, mode) {
1154
1180
 
1155
1181
  // src/commands/entityCrud.ts
1156
1182
  var idSchema = z2.string().min(1);
1183
+ function toSingularResourceName(resourcePath) {
1184
+ if (resourcePath === "organization_meta_profiles") {
1185
+ return "organization_meta_profile";
1186
+ }
1187
+ if (resourcePath === "key_metric_meta_profiles") {
1188
+ return "key_metric_meta_profile";
1189
+ }
1190
+ if (resourcePath.endsWith("ies")) {
1191
+ return resourcePath.slice(0, -3) + "y";
1192
+ }
1193
+ if (resourcePath.endsWith("s")) {
1194
+ return resourcePath.slice(0, -1);
1195
+ }
1196
+ return resourcePath;
1197
+ }
1157
1198
  function parseJsonObject(raw) {
1158
1199
  try {
1159
1200
  const parsed = JSON.parse(raw);
@@ -1232,7 +1273,7 @@ function registerEntityCrudCommands(program, config) {
1232
1273
  return [param, opts[optionKey]];
1233
1274
  })
1234
1275
  );
1235
- const variables = normalizeGraphqlVariables({
1276
+ const variables = normalizeGraphqlVariables2({
1236
1277
  organization_id: organizationId,
1237
1278
  page: opts.page,
1238
1279
  per: opts.per,
@@ -1254,8 +1295,8 @@ function registerEntityCrudCommands(program, config) {
1254
1295
  await runGraphqlQueryCommand({
1255
1296
  command: `${config.command}.show`,
1256
1297
  runtimeOptions: pickRuntimeOptions(globalOpts),
1257
- field: config.resourcePath === "organization_meta_profiles" ? "organization_meta_profile" : config.resourcePath === "key_metric_meta_profiles" ? "key_metric_meta_profile" : config.resourcePath === "feedback" ? "feedback" : config.resourcePath.endsWith("s") ? config.resourcePath.slice(0, -1) : config.resourcePath,
1258
- variables: normalizeGraphqlVariables({
1298
+ field: config.resourcePath === "feedback" ? "feedback" : toSingularResourceName(config.resourcePath),
1299
+ variables: normalizeGraphqlVariables2({
1259
1300
  organization_id: organizationId,
1260
1301
  id
1261
1302
  }),
@@ -1270,10 +1311,10 @@ function registerEntityCrudCommands(program, config) {
1270
1311
  await runGraphqlMutationCommand({
1271
1312
  command: `${config.command}.create`,
1272
1313
  runtimeOptions: pickRuntimeOptions(globalOpts),
1273
- field: config.resourcePath === "organization_meta_profiles" ? "create_organization_meta_profile" : config.resourcePath === "key_metric_meta_profiles" ? "create_key_metric_meta_profile" : `create_${config.resourcePath.endsWith("s") ? config.resourcePath.slice(0, -1) : config.resourcePath}`,
1314
+ field: `create_${toSingularResourceName(config.resourcePath)}`,
1274
1315
  variables: {
1275
1316
  organization_id: organizationId,
1276
- params: body[config.rootKey] ?? body
1317
+ params: body
1277
1318
  }
1278
1319
  });
1279
1320
  });
@@ -1282,7 +1323,7 @@ function registerEntityCrudCommands(program, config) {
1282
1323
  const globalOpts = cmd.optsWithGlobals();
1283
1324
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
1284
1325
  const body = normalizeBody(String(opts.dataJson), config.rootKey);
1285
- const singular = config.resourcePath === "organization_meta_profiles" ? "organization_meta_profile" : config.resourcePath === "key_metric_meta_profiles" ? "key_metric_meta_profile" : config.resourcePath.endsWith("s") ? config.resourcePath.slice(0, -1) : config.resourcePath;
1326
+ const singular = toSingularResourceName(config.resourcePath);
1286
1327
  await runGraphqlMutationCommand({
1287
1328
  command: `${config.command}.update`,
1288
1329
  runtimeOptions: pickRuntimeOptions(globalOpts),
@@ -1290,12 +1331,13 @@ function registerEntityCrudCommands(program, config) {
1290
1331
  variables: {
1291
1332
  organization_id: organizationId,
1292
1333
  [`${singular}_id`]: id,
1293
- params: body[config.rootKey] ?? body
1334
+ params: body
1294
1335
  }
1295
1336
  });
1296
1337
  });
1297
1338
  }
1298
1339
  var __testables = {
1340
+ toSingularResourceName,
1299
1341
  parseJsonObject,
1300
1342
  normalizeBody,
1301
1343
  assertRequiredCreateFields,
@@ -1317,7 +1359,7 @@ function registerTaskCommands(program) {
1317
1359
  command: "tasks.list",
1318
1360
  runtimeOptions: pickRuntimeOptions(globalOpts),
1319
1361
  field: "tasks",
1320
- variables: normalizeGraphqlVariables({
1362
+ variables: normalizeGraphqlVariables2({
1321
1363
  organization_id: organizationId,
1322
1364
  page: opts.page,
1323
1365
  per: opts.per,
@@ -1363,8 +1405,10 @@ function registerTaskCommands(program) {
1363
1405
  variables: {
1364
1406
  organization_id: organizationId,
1365
1407
  params: {
1366
- project_id: projectId,
1367
- summary
1408
+ task: {
1409
+ project_id: projectId,
1410
+ summary
1411
+ }
1368
1412
  }
1369
1413
  }
1370
1414
  });
@@ -1396,7 +1440,9 @@ function registerTaskCommands(program) {
1396
1440
  variables: {
1397
1441
  organization_id: organizationId,
1398
1442
  task_id: id,
1399
- params: taskPayload
1443
+ params: {
1444
+ task: taskPayload
1445
+ }
1400
1446
  }
1401
1447
  });
1402
1448
  });
@@ -1417,7 +1463,7 @@ function registerProjectCommands(program) {
1417
1463
  command: "projects.list",
1418
1464
  runtimeOptions: pickRuntimeOptions(globalOpts),
1419
1465
  field: "projects",
1420
- variables: normalizeGraphqlVariables({
1466
+ variables: normalizeGraphqlVariables2({
1421
1467
  organization_id: organizationId,
1422
1468
  page: opts.page,
1423
1469
  per: opts.per,
@@ -1456,7 +1502,7 @@ function registerProjectCommands(program) {
1456
1502
  field: "create_project",
1457
1503
  variables: {
1458
1504
  organization_id: organizationId,
1459
- params: body.project ?? body
1505
+ params: body
1460
1506
  }
1461
1507
  });
1462
1508
  });
@@ -1472,7 +1518,7 @@ function registerProjectCommands(program) {
1472
1518
  variables: {
1473
1519
  organization_id: organizationId,
1474
1520
  project_id: id,
1475
- params: body.project ?? body
1521
+ params: body
1476
1522
  }
1477
1523
  });
1478
1524
  });
@@ -1496,7 +1542,7 @@ function registerRockCommands(program) {
1496
1542
  command: "rocks.list",
1497
1543
  runtimeOptions: pickRuntimeOptions(globalOpts),
1498
1544
  field: "rocks",
1499
- variables: normalizeGraphqlVariables({
1545
+ variables: normalizeGraphqlVariables2({
1500
1546
  organization_id: organizationId,
1501
1547
  page: opts.page,
1502
1548
  per: opts.per,
@@ -1544,7 +1590,7 @@ function registerRockCommands(program) {
1544
1590
  variables: {
1545
1591
  organization_id: organizationId,
1546
1592
  rock_id: id,
1547
- params: { status }
1593
+ params: { rock: { status } }
1548
1594
  }
1549
1595
  });
1550
1596
  });
@@ -1559,7 +1605,7 @@ function registerRockCommands(program) {
1559
1605
  field: "create_rock",
1560
1606
  variables: {
1561
1607
  organization_id: organizationId,
1562
- params: body.rock ?? body
1608
+ params: body
1563
1609
  }
1564
1610
  });
1565
1611
  });
@@ -1575,7 +1621,7 @@ function registerRockCommands(program) {
1575
1621
  variables: {
1576
1622
  organization_id: organizationId,
1577
1623
  rock_id: id,
1578
- params: body.rock ?? body
1624
+ params: body
1579
1625
  }
1580
1626
  });
1581
1627
  });
@@ -1597,7 +1643,7 @@ function registerMeetingCommands(program) {
1597
1643
  command: "meetings.list",
1598
1644
  runtimeOptions: pickRuntimeOptions(globalOpts),
1599
1645
  field: "meetings",
1600
- variables: normalizeGraphqlVariables({
1646
+ variables: normalizeGraphqlVariables2({
1601
1647
  organization_id: organizationId,
1602
1648
  per: opts.per,
1603
1649
  date: opts.date,
@@ -1639,7 +1685,9 @@ function registerMeetingCommands(program) {
1639
1685
  organization_id: organizationId,
1640
1686
  meeting_id: id,
1641
1687
  params: {
1642
- notes
1688
+ meeting: {
1689
+ notes
1690
+ }
1643
1691
  }
1644
1692
  }
1645
1693
  });
@@ -1654,7 +1702,7 @@ function registerMeetingCommands(program) {
1654
1702
  field: "create_meeting",
1655
1703
  variables: {
1656
1704
  organization_id: organizationId,
1657
- params: body.meeting ?? body
1705
+ params: body
1658
1706
  }
1659
1707
  });
1660
1708
  });
@@ -1670,7 +1718,7 @@ function registerMeetingCommands(program) {
1670
1718
  variables: {
1671
1719
  organization_id: organizationId,
1672
1720
  meeting_id: id,
1673
- params: body.meeting ?? body
1721
+ params: body
1674
1722
  }
1675
1723
  });
1676
1724
  });
@@ -1691,7 +1739,7 @@ function registerMemberCommands(program) {
1691
1739
  command: "members.list",
1692
1740
  runtimeOptions: pickRuntimeOptions(globalOpts),
1693
1741
  field: "members",
1694
- variables: normalizeGraphqlVariables({
1742
+ variables: normalizeGraphqlVariables2({
1695
1743
  organization_id: organizationId,
1696
1744
  page: opts.page,
1697
1745
  per: opts.per,
@@ -1725,7 +1773,7 @@ function registerMemberCommands(program) {
1725
1773
  field: "create_member",
1726
1774
  variables: {
1727
1775
  organization_id: organizationId,
1728
- params: body.member ?? body
1776
+ params: body
1729
1777
  }
1730
1778
  });
1731
1779
  });
@@ -1741,7 +1789,7 @@ function registerMemberCommands(program) {
1741
1789
  variables: {
1742
1790
  organization_id: organizationId,
1743
1791
  member_id: id,
1744
- params: body.member ?? body
1792
+ params: body
1745
1793
  }
1746
1794
  });
1747
1795
  });
@@ -1764,7 +1812,7 @@ function registerIssueCommands(program) {
1764
1812
  command: "issues.list",
1765
1813
  runtimeOptions: pickRuntimeOptions(globalOpts),
1766
1814
  field: "issues",
1767
- variables: normalizeGraphqlVariables({
1815
+ variables: normalizeGraphqlVariables2({
1768
1816
  organization_id: organizationId,
1769
1817
  page: opts.page,
1770
1818
  per: opts.per,
@@ -1808,14 +1856,16 @@ function registerIssueCommands(program) {
1808
1856
  variables: {
1809
1857
  organization_id: organizationId,
1810
1858
  params: {
1811
- issue_group_id: issueGroupId,
1812
- name,
1813
- issue_type: issueType,
1814
- ...opts.status ? { status: String(opts.status) } : {},
1815
- ...opts.priority ? { priority: String(opts.priority) } : {},
1816
- ...opts.description ? { description: String(opts.description) } : {},
1817
- ...opts.dueBy ? { due_by: String(opts.dueBy) } : {},
1818
- ...opts.memberId ? { member_id: String(opts.memberId) } : {}
1859
+ issue: {
1860
+ issue_group_id: issueGroupId,
1861
+ name,
1862
+ issue_type: issueType,
1863
+ ...opts.status ? { status: String(opts.status) } : {},
1864
+ ...opts.priority ? { priority: String(opts.priority) } : {},
1865
+ ...opts.description ? { description: String(opts.description) } : {},
1866
+ ...opts.dueBy ? { due_by: String(opts.dueBy) } : {},
1867
+ ...opts.memberId ? { member_id: String(opts.memberId) } : {}
1868
+ }
1819
1869
  }
1820
1870
  }
1821
1871
  });
@@ -1832,7 +1882,7 @@ function registerIssueCommands(program) {
1832
1882
  variables: {
1833
1883
  organization_id: organizationId,
1834
1884
  issue_id: id,
1835
- params: body.issue ?? body
1885
+ params: body
1836
1886
  }
1837
1887
  });
1838
1888
  });
@@ -2047,7 +2097,7 @@ function registerTeamCommands(program) {
2047
2097
  command: "teams.list",
2048
2098
  runtimeOptions: pickRuntimeOptions(globalOpts),
2049
2099
  field: "teams",
2050
- variables: normalizeGraphqlVariables({
2100
+ variables: normalizeGraphqlVariables2({
2051
2101
  organization_id: organizationId,
2052
2102
  page: opts.page,
2053
2103
  per: opts.per,
@@ -2081,7 +2131,7 @@ function registerTeamCommands(program) {
2081
2131
  field: "create_team",
2082
2132
  variables: {
2083
2133
  organization_id: organizationId,
2084
- params: body.team ?? body
2134
+ params: body
2085
2135
  }
2086
2136
  });
2087
2137
  });
@@ -2097,7 +2147,7 @@ function registerTeamCommands(program) {
2097
2147
  variables: {
2098
2148
  organization_id: organizationId,
2099
2149
  team_id: id,
2100
- params: body.team ?? body
2150
+ params: body
2101
2151
  }
2102
2152
  });
2103
2153
  });
@@ -2134,23 +2184,17 @@ function registerOrganizationCommands(program) {
2134
2184
  field: "update_organization",
2135
2185
  variables: {
2136
2186
  id,
2137
- params: body.organization ?? body
2187
+ params: body
2138
2188
  }
2139
2189
  });
2140
2190
  });
2141
- }
2142
-
2143
- // src/commands/metaProfiles.ts
2144
- import { z as z11 } from "zod";
2145
- var idSchema10 = z11.string().min(1);
2146
- function registerMetaProfileCommands(program) {
2147
- const organizationMetaProfiles = program.command("organization-meta-profiles").description("Organization meta profile operations");
2148
- organizationMetaProfiles.command("show").option("--id <id>", "Meta profile ID (optional; defaults to organization_id)").action(async (opts, cmd) => {
2191
+ const metaProfile = organizations.command("meta-profile").description("Organization meta profile operations");
2192
+ metaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
2149
2193
  const globalOpts = cmd.optsWithGlobals();
2150
2194
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2151
- const id = idSchema10.parse(opts.id ?? organizationId);
2195
+ const id = idSchema9.parse(opts.id ?? organizationId);
2152
2196
  await runGraphqlQueryCommand({
2153
- command: "organization-meta-profiles.show",
2197
+ command: "organizations.meta-profile.show",
2154
2198
  runtimeOptions: pickRuntimeOptions(globalOpts),
2155
2199
  field: "organization_meta_profile",
2156
2200
  variables: {
@@ -2160,35 +2204,35 @@ function registerMetaProfileCommands(program) {
2160
2204
  isShow: true
2161
2205
  });
2162
2206
  });
2163
- organizationMetaProfiles.command("update").option("--id <id>", "Meta profile ID (optional; defaults to organization_id)").requiredOption(
2207
+ metaProfile.command("update").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").requiredOption(
2164
2208
  "--data-json <dataJson>",
2165
2209
  'JSON object for organization_meta_profile or {"organization_meta_profile": {...}}'
2166
2210
  ).action(async (opts, cmd) => {
2167
2211
  const globalOpts = cmd.optsWithGlobals();
2168
2212
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2169
- const id = idSchema10.parse(opts.id ?? organizationId);
2213
+ const id = idSchema9.parse(opts.id ?? organizationId);
2170
2214
  const body = __testables.normalizeBody(
2171
2215
  String(opts.dataJson),
2172
2216
  "organization_meta_profile"
2173
2217
  );
2174
2218
  await runGraphqlMutationCommand({
2175
- command: "organization-meta-profiles.update",
2219
+ command: "organizations.meta-profile.update",
2176
2220
  runtimeOptions: pickRuntimeOptions(globalOpts),
2177
2221
  field: "update_organization_meta_profile",
2178
2222
  variables: {
2179
2223
  organization_id: organizationId,
2180
2224
  organization_meta_profile_id: id,
2181
- params: body.organization_meta_profile ?? body
2225
+ params: body
2182
2226
  }
2183
2227
  });
2184
2228
  });
2185
- const keyMetricMetaProfiles = program.command("key-metric-meta-profiles").description("Key metric meta profile operations");
2186
- keyMetricMetaProfiles.command("show").option("--id <id>", "Meta profile ID (optional; defaults to organization_id)").action(async (opts, cmd) => {
2229
+ const keyMetricMetaProfile = organizations.command("key-metric-meta-profile").description("Key metric meta profile operations");
2230
+ keyMetricMetaProfile.command("show").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").action(async (opts, cmd) => {
2187
2231
  const globalOpts = cmd.optsWithGlobals();
2188
2232
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2189
- const id = idSchema10.parse(opts.id ?? organizationId);
2233
+ const id = idSchema9.parse(opts.id ?? organizationId);
2190
2234
  await runGraphqlQueryCommand({
2191
- command: "key-metric-meta-profiles.show",
2235
+ command: "organizations.key-metric-meta-profile.show",
2192
2236
  runtimeOptions: pickRuntimeOptions(globalOpts),
2193
2237
  field: "key_metric_meta_profile",
2194
2238
  variables: {
@@ -2198,30 +2242,33 @@ function registerMetaProfileCommands(program) {
2198
2242
  isShow: true
2199
2243
  });
2200
2244
  });
2201
- keyMetricMetaProfiles.command("update").option("--id <id>", "Meta profile ID (optional; defaults to organization_id)").requiredOption(
2245
+ keyMetricMetaProfile.command("update").option("--id <id>", "Meta profile ID (defaults to resolved organization context)").requiredOption(
2202
2246
  "--data-json <dataJson>",
2203
2247
  'JSON object for key_metric_meta_profile or {"key_metric_meta_profile": {...}}'
2204
2248
  ).action(async (opts, cmd) => {
2205
2249
  const globalOpts = cmd.optsWithGlobals();
2206
2250
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2207
- const id = idSchema10.parse(opts.id ?? organizationId);
2208
- const body = __testables.normalizeBody(String(opts.dataJson), "key_metric_meta_profile");
2251
+ const id = idSchema9.parse(opts.id ?? organizationId);
2252
+ const body = __testables.normalizeBody(
2253
+ String(opts.dataJson),
2254
+ "key_metric_meta_profile"
2255
+ );
2209
2256
  await runGraphqlMutationCommand({
2210
- command: "key-metric-meta-profiles.update",
2257
+ command: "organizations.key-metric-meta-profile.update",
2211
2258
  runtimeOptions: pickRuntimeOptions(globalOpts),
2212
2259
  field: "update_key_metric_meta_profile",
2213
2260
  variables: {
2214
2261
  organization_id: organizationId,
2215
2262
  key_metric_meta_profile_id: id,
2216
- params: body.key_metric_meta_profile ?? body
2263
+ params: body
2217
2264
  }
2218
2265
  });
2219
2266
  });
2220
2267
  }
2221
2268
 
2222
2269
  // src/commands/foundation.ts
2223
- import { z as z12 } from "zod";
2224
- var idSchema11 = z12.string().min(1);
2270
+ import { z as z11 } from "zod";
2271
+ var idSchema10 = z11.string().min(1);
2225
2272
  function registerFoundationCommands(program) {
2226
2273
  const foundation = program.command("foundation").description("Foundation operations");
2227
2274
  const strategicPlans = foundation.command("strategic-plans").description("Strategic plan operations");
@@ -2229,12 +2276,12 @@ function registerFoundationCommands(program) {
2229
2276
  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) => {
2230
2277
  const globalOpts = cmd.optsWithGlobals();
2231
2278
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2232
- const id = idSchema11.parse(opts.id ?? organizationId);
2279
+ const id = idSchema10.parse(opts.id ?? organizationId);
2233
2280
  await runGraphqlQueryCommand({
2234
2281
  command: "foundation.strategic-plans.show",
2235
2282
  runtimeOptions: pickRuntimeOptions(globalOpts),
2236
2283
  field: "strategic_plan",
2237
- variables: normalizeGraphqlVariables({
2284
+ variables: normalizeGraphqlVariables2({
2238
2285
  organization_id: organizationId,
2239
2286
  id,
2240
2287
  progress_scope: opts.progressScope,
@@ -2250,7 +2297,7 @@ function registerFoundationCommands(program) {
2250
2297
  ).action(async (opts, cmd) => {
2251
2298
  const globalOpts = cmd.optsWithGlobals();
2252
2299
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2253
- const id = idSchema11.parse(opts.id ?? organizationId);
2300
+ const id = idSchema10.parse(opts.id ?? organizationId);
2254
2301
  const body = __testables.normalizeBody(String(opts.dataJson), "strategic_plan");
2255
2302
  await runGraphqlMutationCommand({
2256
2303
  command: "foundation.strategic-plans.update",
@@ -2259,19 +2306,19 @@ function registerFoundationCommands(program) {
2259
2306
  variables: {
2260
2307
  organization_id: organizationId,
2261
2308
  strategic_plan_id: id,
2262
- params: body.strategic_plan ?? body
2309
+ params: body
2263
2310
  }
2264
2311
  });
2265
2312
  });
2266
2313
  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) => {
2267
2314
  const globalOpts = cmd.optsWithGlobals();
2268
2315
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2269
- const id = idSchema11.parse(opts.id ?? organizationId);
2316
+ const id = idSchema10.parse(opts.id ?? organizationId);
2270
2317
  await runGraphqlQueryCommand({
2271
2318
  command: "foundation.strategic-objectives.show",
2272
2319
  runtimeOptions: pickRuntimeOptions(globalOpts),
2273
2320
  field: "strategic_objective",
2274
- variables: normalizeGraphqlVariables({
2321
+ variables: normalizeGraphqlVariables2({
2275
2322
  organization_id: organizationId,
2276
2323
  id,
2277
2324
  progress_scope: opts.progressScope,
@@ -2287,7 +2334,7 @@ function registerFoundationCommands(program) {
2287
2334
  ).action(async (opts, cmd) => {
2288
2335
  const globalOpts = cmd.optsWithGlobals();
2289
2336
  const organizationId = resolveOrganizationId(globalOpts.organizationId);
2290
- const id = idSchema11.parse(opts.id ?? organizationId);
2337
+ const id = idSchema10.parse(opts.id ?? organizationId);
2291
2338
  const body = __testables.normalizeBody(
2292
2339
  String(opts.dataJson),
2293
2340
  "strategic_objective"
@@ -2299,7 +2346,7 @@ function registerFoundationCommands(program) {
2299
2346
  variables: {
2300
2347
  organization_id: organizationId,
2301
2348
  strategic_objective_id: id,
2302
- params: body.strategic_objective ?? body
2349
+ params: body
2303
2350
  }
2304
2351
  });
2305
2352
  });
@@ -2347,7 +2394,6 @@ function buildCli() {
2347
2394
  registerMemberCommands(program);
2348
2395
  registerTeamCommands(program);
2349
2396
  registerOrganizationCommands(program);
2350
- registerMetaProfileCommands(program);
2351
2397
  registerIssueCommands(program);
2352
2398
  registerSystemToolCommands(program);
2353
2399
  registerFoundationCommands(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ted-galago/wave-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "wave": "dist/index.js"
@@ -13,6 +13,7 @@
13
13
  "build": "tsup src/index.ts --format esm,cjs --dts --clean",
14
14
  "dev": "tsx src/index.ts",
15
15
  "test": "vitest run",
16
+ "verify:dev": "node scripts/verify-dev-api.mjs",
16
17
  "postinstall": "node scripts/postinstall-local-bin.mjs"
17
18
  },
18
19
  "engines": {