@ted-galago/wave-cli 0.1.4 → 0.1.6

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.
@@ -47,6 +47,16 @@ function firstId(parsed, field) {
47
47
  return undefined;
48
48
  }
49
49
 
50
+ function firstListRow(parsed, fields) {
51
+ for (const field of fields) {
52
+ const row = parsed?.data?.[field]?.data?.[0];
53
+ if (row && typeof row === "object") {
54
+ return row;
55
+ }
56
+ }
57
+ return undefined;
58
+ }
59
+
50
60
  function classify(result) {
51
61
  if (!result.parsed) {
52
62
  return { ok: false, reason: "non_json_output" };
@@ -58,6 +68,10 @@ function classify(result) {
58
68
  const code = result.parsed?.error?.code ?? "unknown";
59
69
  const message = result.parsed?.error?.message ?? "";
60
70
  const details = JSON.stringify(result.parsed?.error?.details ?? {});
71
+ const output = `${result.stdout}\n${result.stderr}`;
72
+ if (/unpermitted parameter/i.test(output) || /unpermitted parameter/i.test(details)) {
73
+ return { ok: false, reason: "unpermitted_parameter" };
74
+ }
61
75
  const hardFailures = [
62
76
  "network_error",
63
77
  "missing_auth",
@@ -87,6 +101,56 @@ function payload(root, attrs) {
87
101
  return JSON.stringify({ [root]: attrs });
88
102
  }
89
103
 
104
+ function sleepMs(ms) {
105
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
106
+ }
107
+
108
+ function extractListIds(parsed, field) {
109
+ const rows = parsed?.data?.[field]?.data;
110
+ if (!Array.isArray(rows)) return [];
111
+ return rows
112
+ .map((row) => (row?.id ? String(row.id) : ""))
113
+ .filter((id) => id.length > 0);
114
+ }
115
+
116
+ function readPath(input, segments) {
117
+ let current = input;
118
+ for (const segment of segments) {
119
+ if (!current || typeof current !== "object") {
120
+ return undefined;
121
+ }
122
+ current = current[segment];
123
+ }
124
+ return current;
125
+ }
126
+
127
+ function firstDefinedValue(input, paths) {
128
+ for (const path of paths) {
129
+ const value = readPath(input, path);
130
+ if (value !== undefined && value !== null) {
131
+ return value;
132
+ }
133
+ }
134
+ return undefined;
135
+ }
136
+
137
+ function verifySubissueDeleteWithPolling(env, issueId, subIssueId) {
138
+ const attempts = [];
139
+ for (let i = 1; i <= 5; i += 1) {
140
+ const listRes = runWave(["subissues", "list", "--issue-id", issueId], env);
141
+ const ids = extractListIds(listRes.parsed, "sub_issues");
142
+ const deleted = !ids.includes(String(subIssueId));
143
+ attempts.push({ index: i, ids, result: listRes });
144
+ if (deleted) {
145
+ return { ok: true, attempts, tries: i };
146
+ }
147
+ if (i < 5) {
148
+ sleepMs(500);
149
+ }
150
+ }
151
+ return { ok: false, attempts, tries: 5 };
152
+ }
153
+
90
154
  const root = process.cwd();
91
155
  const envFile = resolve(root, ".env");
92
156
  const dot = loadDotEnv(envFile);
@@ -138,6 +202,23 @@ for (const [key, args] of listSeeds) {
138
202
  if (res.parsed?.ok) {
139
203
  const field = args[0] === "foundation" ? args[1].replace(/-([a-z])/g, (_, c) => c.toUpperCase()) : args[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());
140
204
  idLookup[key] = firstId(res.parsed, field);
205
+ if (key === "kpis") {
206
+ const firstKpi = firstListRow(res.parsed, ["smart_kpis", "smartKpis", "kpis"]);
207
+ if (firstKpi && typeof firstKpi === "object") {
208
+ const attributes = firstKpi.attributes;
209
+ if (attributes && typeof attributes === "object") {
210
+ const attr = attributes;
211
+ idLookup.kpiSmartKpiViewId =
212
+ typeof attr.smart_kpi_view_id === "string"
213
+ ? attr.smart_kpi_view_id
214
+ : typeof attr.smartKpiViewId === "string"
215
+ ? attr.smartKpiViewId
216
+ : undefined;
217
+ idLookup.kpiCreateName =
218
+ typeof attr.name === "string" && attr.name.trim().length > 0 ? attr.name : undefined;
219
+ }
220
+ }
221
+ }
141
222
  }
142
223
  }
143
224
 
@@ -164,12 +245,57 @@ const surveyId = idLookup.surveys;
164
245
  const feedbackId = idLookup.feedbacks;
165
246
  const responsibilityId = idLookup.accountability;
166
247
  const kpiId = idLookup.kpis;
248
+ const kpiSmartKpiViewId = idLookup.kpiSmartKpiViewId;
249
+ const kpiCreateName = idLookup.kpiCreateName;
167
250
  const measurableGroupId = idLookup.scorecardGroups;
168
251
  const measurableId = idLookup.scorecards;
169
252
  const customerId = idLookup.customers;
170
253
  const contactId = idLookup.contacts;
171
254
  const annualObjectiveId = idLookup.annualObjectives;
172
255
  const quarterlyObjectiveId = idLookup.quarterlyObjectives;
256
+ const verifyStamp = String(Date.now());
257
+ const orgWorkspaceNameVerify = `Wave Verify ${verifyStamp}`;
258
+ const orgMetaOneSentenceSummaryVerify = `Verify Title ${verifyStamp}`;
259
+ const keyMetricRevenueVerify = String(1000 + Number(verifyStamp.slice(-3)));
260
+ const questionNameVerify = `CLI Verify Question Update ${verifyStamp}`;
261
+ const surveyDueDateVerify = "2026-12-31";
262
+ const feedbackQuarterVerify = "q3";
263
+ const accountabilityNameVerify = `CLI Verify Responsibility Update ${verifyStamp}`;
264
+ const organizationMetaProfileSeed = runWave(
265
+ ["organizations", "meta-profile", "show", "--id", orgId],
266
+ env
267
+ );
268
+ results.push(organizationMetaProfileSeed);
269
+ const organizationMetaProfileId =
270
+ firstId(organizationMetaProfileSeed.parsed, "organization_meta_profile") ?? orgId;
271
+ const keyMetricMetaProfileSeed = runWave(
272
+ ["organizations", "key-metric-meta-profile", "show", "--id", orgId],
273
+ env
274
+ );
275
+ results.push(keyMetricMetaProfileSeed);
276
+ const keyMetricMetaProfileId =
277
+ firstId(keyMetricMetaProfileSeed.parsed, "key_metric_meta_profile") ?? orgId;
278
+ const meetingCreatePayload = teamId
279
+ ? {
280
+ name: "CLI Verify Meeting",
281
+ type: "TeamMeeting",
282
+ member_id: memberId,
283
+ date: "2026-04-18",
284
+ start_time: 700,
285
+ end_time: 760,
286
+ repeats: "never",
287
+ status: "upcoming",
288
+ teams_ids: [teamId]
289
+ }
290
+ : {
291
+ name: "CLI Verify Meeting",
292
+ type: "OneOnOneMeeting",
293
+ member_id: memberId,
294
+ date: "2026-04-18",
295
+ start_time: 700,
296
+ repeats: "never",
297
+ status: "upcoming"
298
+ };
173
299
 
174
300
  const probes = [
175
301
  ["projects", "show", "--id", projectId],
@@ -213,16 +339,16 @@ const probes = [
213
339
  ["rocks", "create", "--data-json", payload("rock", { name: "CLI Verify Rock", rock_collection_id: rockCollectionId, status: "on_track", priority: "no_priority", rock_type: "individual" })],
214
340
  ["rocks", "update", "--id", rockId, "--data-json", payload("rock", { description: "verify-update" })],
215
341
  ["meetings", "notes", "--id", meetingId, "--content", "CLI verify notes"],
216
- ["meetings", "create", "--data-json", payload("meeting", { name: "CLI Verify Meeting", status: "upcoming" })],
342
+ ["meetings", "create", "--data-json", payload("meeting", meetingCreatePayload)],
217
343
  ["meetings", "update", "--id", meetingId, "--data-json", payload("meeting", { notes: "verify-update" })],
218
344
  ["members", "create", "--data-json", payload("member", { email: `cli.verify.${Date.now()}@example.com` })],
219
345
  ["members", "update", "--id", memberId, "--data-json", payload("member", { first_name: "CLI" })],
220
346
  ["teams", "create", "--data-json", payload("team", { name: `CLI Verify Team ${Date.now()}` })],
221
347
  ["teams", "update", "--id", teamId, "--data-json", payload("team", { name: `CLI Verify Team Update ${Date.now()}` })],
222
- ["organizations", "update", "--id", orgId, "--data-json", payload("organization", { workspace_name: "Wave Verify" })],
223
- ["organizations", "meta-profile", "update", "--id", orgId, "--data-json", payload("organization_meta_profile", { title: "Verify Title" })],
224
- ["organizations", "key-metric-meta-profile", "update", "--id", orgId, "--data-json", payload("key_metric_meta_profile", { annual_revenue: "1000" })],
225
- ["issues", "create", "--issue-group-id", issueGroupId, "--name", "CLI Verify Issue", "--issue-type", "personal"],
348
+ ["organizations", "update", "--id", orgId, "--data-json", payload("organization", { organization_detail_attributes: { workspace_name: orgWorkspaceNameVerify } })],
349
+ ["organizations", "meta-profile", "update", "--id", organizationMetaProfileId, "--data-json", payload("organization_meta_profile", { profile: { company_identity: { one_sentence_summary: orgMetaOneSentenceSummaryVerify } } })],
350
+ ["organizations", "key-metric-meta-profile", "update", "--id", keyMetricMetaProfileId, "--data-json", payload("key_metric_meta_profile", { profile: { financial: { revenue: keyMetricRevenueVerify } } })],
351
+ ["issues", "create", "--issue-group-id", issueGroupId, "--name", "CLI Verify Issue", "--issue-type", "short_term"],
226
352
  ["issues", "update", "--id", issueId, "--data-json", payload("issue", { description: "verify-update" })],
227
353
  ["lists", "create", "--data-json", payload("list", { name: "CLI Verify List", status: "in_progress", priority: "no_priority" })],
228
354
  ["lists", "update", "--id", listId, "--data-json", payload("list", { description: "verify-update" })],
@@ -232,42 +358,42 @@ const probes = [
232
358
  ["issue-groups", "update", "--id", issueGroupId, "--data-json", payload("issue_group", { description: "verify-update" })],
233
359
  ["todo-groups", "create", "--data-json", payload("todo_group", { name: "CLI Verify Todo Group", status: "in_progress", priority: "no_priority" })],
234
360
  ["todo-groups", "update", "--id", todoGroupId, "--data-json", payload("todo_group", { description: "verify-update" })],
235
- ["todos", "create", "--data-json", payload("todo", { todo_group_id: todoGroupId, name: "CLI Verify Todo", status: "to_do", priority: "no_priority" })],
361
+ ["todos", "create", "--data-json", payload("todo", { todo_group_id: todoGroupId, name: "CLI Verify Todo", status: "open", priority: "no_priority" })],
236
362
  ["todos", "update", "--id", todoId, "--data-json", payload("todo", { description: "verify-update" })],
237
363
  ["rock-collections", "create", "--data-json", payload("rock_collection", { name: "CLI Verify Rock Collection", status: "in_progress", priority: "no_priority" })],
238
364
  ["rock-collections", "update", "--id", rockCollectionId, "--data-json", payload("rock_collection", { description: "verify-update" })],
239
- ["knowledge", "create", "--data-json", payload("content", { type: "normal", content_type: "knowledge", status: "draft", name: "CLI Verify Doc" })],
365
+ ["knowledge", "create", "--data-json", payload("content", { content_type: "process", status: "draft", name: "CLI Verify Doc", member_id: memberId })],
240
366
  ["knowledge", "update", "--id", contentId, "--data-json", payload("content", { name: "CLI Verify Doc Update" })],
241
367
  ["stand-ups", "create", "--data-json", payload("stand_up", { member_id: memberId, completed_date: "2026-04-06" })],
242
368
  ["stand-ups", "update", "--id", standUpId, "--data-json", payload("stand_up", { blockers: "verify-update" })],
243
- ["news", "create", "--data-json", payload("headline", { summary: "CLI Verify Headline", status: "draft", headline_type: "organizational" })],
369
+ ["news", "create", "--data-json", payload("headline", { summary: "CLI Verify Headline", member_id: memberId, status: "active", headline_type: "org_wide" })],
244
370
  ["news", "update", "--id", headlineId, "--data-json", payload("headline", { description: "verify-update" })],
245
- ["questions", "create", "--data-json", payload("question", { summary: "CLI Verify Question" })],
246
- ["questions", "update", "--id", questionId, "--data-json", payload("question", { summary: "CLI Verify Question Update" })],
247
- ["pulse", "create", "--data-json", payload("health_update", { updatable_id: projectId, updatable_type: "Project", value: "on_track", status: "on_track" })],
371
+ ["questions", "create", "--data-json", payload("question", { name: "CLI Verify Question", member_id: memberId })],
372
+ ["questions", "update", "--id", questionId, "--data-json", payload("question", { name: questionNameVerify, description: "verify-update" })],
373
+ ["pulse", "create", "--data-json", payload("health_update", { health_updatable_id: projectId, health_updatable_type: "Project", member_id: memberId, value: "on_track", status: "on_track" })],
248
374
  ["pulse", "update", "--id", pulseId, "--data-json", payload("health_update", { value: "verify-update" })],
249
- ["surveys", "create", "--data-json", payload("survey", { title: "CLI Verify Survey" })],
250
- ["surveys", "update", "--id", surveyId, "--data-json", payload("survey", { title: "CLI Verify Survey Update" })],
251
- ["feedbacks", "create", "--data-json", payload("feedback", { title: "CLI Verify Feedback" })],
252
- ["feedbacks", "update", "--id", feedbackId, "--data-json", payload("feedback", { title: "CLI Verify Feedback Update" })],
253
- ["accountability", "create", "--data-json", payload("responsibility", { summary: "CLI Verify Responsibility" })],
254
- ["accountability", "update", "--id", responsibilityId, "--data-json", payload("responsibility", { summary: "CLI Verify Responsibility Update" })],
255
- ["kpis", "create", "--data-json", payload("smart_kpi", { measurable_group_id: measurableGroupId, name: "CLI Verify KPI" })],
375
+ ["surveys", "create", "--data-json", payload("survey", { name: "engagement", recipient_type: "org_wide" })],
376
+ ["surveys", "update", "--id", surveyId, "--data-json", payload("survey", { name: "engagement", recipient_type: "org_wide", due_date: surveyDueDateVerify })],
377
+ ["feedbacks", "create", "--data-json", payload("feedback", { name: "company_culture", quarter: "q2", year: "2026" })],
378
+ ["feedbacks", "update", "--id", feedbackId, "--data-json", payload("feedback", { name: "roadmap_and_strategy", quarter: feedbackQuarterVerify, year: "2026" })],
379
+ ["accountability", "create", "--data-json", payload("responsibility", { name: "CLI Verify Responsibility", member_id: memberId })],
380
+ ["accountability", "update", "--id", responsibilityId, "--data-json", payload("responsibility", { name: accountabilityNameVerify })],
381
+ ["kpis", "create", "--data-json", payload("smart_kpi", { smart_kpi_view_id: kpiSmartKpiViewId, name: kpiCreateName })],
256
382
  ["kpis", "update", "--id", kpiId, "--data-json", payload("smart_kpi", { name: "CLI Verify KPI Update" })],
257
383
  ["scorecard-groups", "create", "--data-json", payload("measurable_group", { name: "CLI Verify Scorecard Group" })],
258
384
  ["scorecard-groups", "update", "--id", measurableGroupId, "--data-json", payload("measurable_group", { name: "CLI Verify Scorecard Group Update" })],
259
- ["scorecards", "create", "--data-json", payload("measurable", { measurable_group_id: measurableGroupId, name: "CLI Verify Scorecard" })],
385
+ ["scorecards", "create", "--data-json", payload("measurable", { measurable_group_id: measurableGroupId, name: "CLI Verify Scorecard", interval: "weekly", trend: "average" })],
260
386
  ["scorecards", "update", "--id", measurableId, "--data-json", payload("measurable", { name: "CLI Verify Scorecard Update" })],
261
387
  ["customers", "create", "--data-json", payload("customer", { name: "CLI Verify Customer" })],
262
388
  ["customers", "update", "--id", customerId, "--data-json", payload("customer", { name: "CLI Verify Customer Update" })],
263
389
  ["contacts", "create", "--data-json", payload("contact", { customer_id: customerId, name: "CLI Verify Contact" })],
264
390
  ["contacts", "update", "--id", contactId, "--data-json", payload("contact", { name: "CLI Verify Contact Update" })],
265
- ["foundation", "strategic-plans", "update", "--id", orgId, "--data-json", payload("strategic_plan", { title: "CLI Verify Strategic Plan" })],
266
- ["foundation", "strategic-objectives", "update", "--id", orgId, "--data-json", payload("strategic_objective", { title: "CLI Verify Strategic Objective" })],
267
- ["foundation", "annual-objectives", "create", "--data-json", payload("annual_objective", { strategic_objective_id: annualObjectiveId || orgId, title: "CLI Verify Annual Objective" })],
268
- ["foundation", "annual-objectives", "update", "--id", annualObjectiveId, "--data-json", payload("annual_objective", { title: "CLI Verify Annual Objective Update" })],
269
- ["foundation", "quarterly-objectives", "create", "--data-json", payload("quarterly_objective", { strategic_objective_id: annualObjectiveId || orgId, annual_objective_id: annualObjectiveId || orgId, title: "CLI Verify Quarterly Objective" })],
270
- ["foundation", "quarterly-objectives", "update", "--id", quarterlyObjectiveId, "--data-json", payload("quarterly_objective", { title: "CLI Verify Quarterly Objective Update" })]
391
+ ["foundation", "strategic-plans", "update", "--id", orgId, "--data-json", payload("strategic_plan", { published_at: "2026-04-18T17:00:00Z" })],
392
+ ["foundation", "strategic-objectives", "update", "--id", orgId, "--data-json", payload("strategic_objective", { summary: "CLI Verify Strategic Objective" })],
393
+ ["foundation", "annual-objectives", "create", "--data-json", payload("annual_objective", { strategic_objective_id: annualObjectiveId || orgId, name: "CLI Verify Annual Objective" })],
394
+ ["foundation", "annual-objectives", "update", "--id", annualObjectiveId, "--data-json", payload("annual_objective", { name: "CLI Verify Annual Objective Update" })],
395
+ ["foundation", "quarterly-objectives", "create", "--data-json", payload("quarterly_objective", { strategic_objective_id: annualObjectiveId || orgId, annual_objective_id: annualObjectiveId || orgId, name: "CLI Verify Quarterly Objective" })],
396
+ ["foundation", "quarterly-objectives", "update", "--id", quarterlyObjectiveId, "--data-json", payload("quarterly_objective", { name: "CLI Verify Quarterly Objective Update" })]
271
397
  ];
272
398
 
273
399
  for (const args of probes) {
@@ -286,6 +412,184 @@ for (const args of probes) {
286
412
  results.push(runWave(args, env));
287
413
  }
288
414
 
415
+ let deleteVerifyLine = "";
416
+ let deleteVerifyFailure = 0;
417
+ if (issueId) {
418
+ const subissueCreate = runWave(
419
+ [
420
+ "subissues",
421
+ "create",
422
+ "--data-json",
423
+ payload("sub_issue", {
424
+ issue_id: issueId,
425
+ name: `CLI Verify Subissue ${Date.now()}`
426
+ })
427
+ ],
428
+ env
429
+ );
430
+ results.push(subissueCreate);
431
+ const subIssueId = subissueCreate?.parsed?.data?.create_sub_issue?.data?.data?.id
432
+ ? String(subissueCreate.parsed.data.create_sub_issue.data.data.id)
433
+ : "";
434
+ if (subIssueId) {
435
+ const destroyRes = runWave(["subissues", "destroy", "--id", subIssueId], env);
436
+ results.push(destroyRes);
437
+ const verifyRes = verifySubissueDeleteWithPolling(env, issueId, subIssueId);
438
+ deleteVerifyLine = `${verifyRes.ok ? "PASS" : "FAIL"} | status=${verifyRes.ok ? 200 : 500} | err=${
439
+ verifyRes.ok ? "none" : "delete_not_observed"
440
+ } | subissues destroy verify --issue-id ${issueId} --id ${subIssueId} --tries ${verifyRes.tries}`;
441
+ if (!verifyRes.ok) {
442
+ deleteVerifyFailure = 1;
443
+ }
444
+ }
445
+ }
446
+
447
+ const postUpdateVerificationLines = [];
448
+ let postUpdateVerificationFailures = 0;
449
+
450
+ function hasSuccessfulCommand(commandPrefix) {
451
+ return results.some((res) => {
452
+ if (!Array.isArray(res.args)) return false;
453
+ if (res.args.length < commandPrefix.length) return false;
454
+ for (let i = 0; i < commandPrefix.length; i += 1) {
455
+ if (res.args[i] !== commandPrefix[i]) {
456
+ return false;
457
+ }
458
+ }
459
+ return res.parsed?.ok === true;
460
+ });
461
+ }
462
+
463
+ function verifyFieldWrite({ label, showArgs, expectedValue, candidatePaths, requiredSuccessPrefix }) {
464
+ if (requiredSuccessPrefix && !hasSuccessfulCommand(requiredSuccessPrefix)) {
465
+ postUpdateVerificationLines.push(`PASS | status=n/a | err=skipped_prereq_not_ok | ${label}`);
466
+ return;
467
+ }
468
+
469
+ if (showArgs.includes(undefined)) {
470
+ postUpdateVerificationLines.push(`PASS | status=n/a | err=skipped_missing_id | ${label}`);
471
+ return;
472
+ }
473
+
474
+ const showRes = runWave(showArgs, env);
475
+ const status = showRes.parsed?.status ?? "n/a";
476
+ const errCode = showRes.parsed?.error?.code ?? "none";
477
+
478
+ if (!showRes.parsed?.ok) {
479
+ postUpdateVerificationLines.push(
480
+ `FAIL | status=${status} | err=${errCode} | ${label} (${showArgs.join(" ")})`
481
+ );
482
+ postUpdateVerificationFailures += 1;
483
+ return;
484
+ }
485
+
486
+ const actual = firstDefinedValue(showRes.parsed, candidatePaths);
487
+ const ok = String(actual ?? "") === String(expectedValue);
488
+ postUpdateVerificationLines.push(
489
+ `${ok ? "PASS" : "FAIL"} | status=${status} | err=${
490
+ ok ? "none" : "read_after_write_mismatch"
491
+ } | ${label} expected=${JSON.stringify(expectedValue)} actual=${JSON.stringify(actual ?? null)}`
492
+ );
493
+ if (!ok) {
494
+ postUpdateVerificationFailures += 1;
495
+ }
496
+ }
497
+
498
+ verifyFieldWrite({
499
+ label: "organizations.update verify workspace_name",
500
+ showArgs: ["organizations", "show", "--id", orgId],
501
+ expectedValue: orgWorkspaceNameVerify,
502
+ requiredSuccessPrefix: ["organizations", "update"],
503
+ candidatePaths: [
504
+ ["data", "organization", "organizationDetail", "workspaceName"],
505
+ ["data", "organization", "organization_detail", "workspace_name"],
506
+ ["data", "organization", "attributes", "organizationDetail", "workspaceName"],
507
+ ["data", "organization", "attributes", "organization_detail_attributes", "workspace_name"]
508
+ ]
509
+ });
510
+
511
+ verifyFieldWrite({
512
+ label: "organizations.meta-profile.update verify one_sentence_summary",
513
+ showArgs: ["organizations", "meta-profile", "show", "--id", organizationMetaProfileId],
514
+ expectedValue: orgMetaOneSentenceSummaryVerify,
515
+ requiredSuccessPrefix: ["organizations", "meta-profile", "update"],
516
+ candidatePaths: [
517
+ [
518
+ "data",
519
+ "organization_meta_profile",
520
+ "attributes",
521
+ "profile",
522
+ "companyIdentity",
523
+ "oneSentenceSummary"
524
+ ],
525
+ [
526
+ "data",
527
+ "organization_meta_profile",
528
+ "attributes",
529
+ "profile",
530
+ "company_identity",
531
+ "one_sentence_summary"
532
+ ],
533
+ [
534
+ "data",
535
+ "organizationMetaProfile",
536
+ "attributes",
537
+ "profile",
538
+ "companyIdentity",
539
+ "oneSentenceSummary"
540
+ ]
541
+ ]
542
+ });
543
+
544
+ verifyFieldWrite({
545
+ label: "organizations.key-metric-meta-profile.update verify financial.revenue",
546
+ showArgs: ["organizations", "key-metric-meta-profile", "show", "--id", keyMetricMetaProfileId],
547
+ expectedValue: keyMetricRevenueVerify,
548
+ requiredSuccessPrefix: ["organizations", "key-metric-meta-profile", "update"],
549
+ candidatePaths: [
550
+ ["data", "key_metric_meta_profile", "attributes", "profile", "financial", "revenue"],
551
+ ["data", "keyMetricMetaProfile", "attributes", "profile", "financial", "revenue"]
552
+ ]
553
+ });
554
+
555
+ verifyFieldWrite({
556
+ label: "questions.update verify name",
557
+ showArgs: ["questions", "show", "--id", questionId],
558
+ expectedValue: questionNameVerify,
559
+ requiredSuccessPrefix: ["questions", "update"],
560
+ candidatePaths: [
561
+ ["data", "question", "attributes", "name"],
562
+ ["data", "question", "attributes", "summary"]
563
+ ]
564
+ });
565
+
566
+ verifyFieldWrite({
567
+ label: "surveys.update verify due_date",
568
+ showArgs: ["surveys", "show", "--id", surveyId],
569
+ expectedValue: surveyDueDateVerify,
570
+ requiredSuccessPrefix: ["surveys", "update"],
571
+ candidatePaths: [
572
+ ["data", "survey", "attributes", "dueDate"],
573
+ ["data", "survey", "attributes", "due_date"]
574
+ ]
575
+ });
576
+
577
+ verifyFieldWrite({
578
+ label: "feedbacks.update verify quarter",
579
+ showArgs: ["feedbacks", "show", "--id", feedbackId],
580
+ expectedValue: feedbackQuarterVerify,
581
+ requiredSuccessPrefix: ["feedbacks", "update"],
582
+ candidatePaths: [["data", "feedback", "attributes", "quarter"]]
583
+ });
584
+
585
+ verifyFieldWrite({
586
+ label: "accountability.update verify name",
587
+ showArgs: ["accountability", "show", "--id", responsibilityId],
588
+ expectedValue: accountabilityNameVerify,
589
+ requiredSuccessPrefix: ["accountability", "update"],
590
+ candidatePaths: [["data", "responsibility", "attributes", "name"]]
591
+ });
592
+
289
593
  const lines = [];
290
594
  let failures = 0;
291
595
  for (const res of results) {
@@ -297,6 +601,17 @@ for (const res of results) {
297
601
  if (!verdict.ok) failures += 1;
298
602
  }
299
603
 
604
+ if (deleteVerifyLine) {
605
+ lines.push(deleteVerifyLine);
606
+ }
607
+ failures += deleteVerifyFailure;
608
+ if (postUpdateVerificationLines.length > 0) {
609
+ lines.push(...postUpdateVerificationLines);
610
+ }
611
+ failures += postUpdateVerificationFailures;
612
+
300
613
  console.log(lines.join("\n"));
301
- console.log(`\nSUMMARY total=${results.length} failures=${failures}`);
614
+ const extraChecksCount =
615
+ (deleteVerifyLine ? 1 : 0) + postUpdateVerificationLines.length;
616
+ console.log(`\nSUMMARY total=${results.length + extraChecksCount} failures=${failures}`);
302
617
  if (failures > 0) process.exit(1);