@docmana/sdk 0.40.0 → 0.40.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.40.1 - 2026-11-10
4
+
5
+ - Keep reviewer profile fields accessible in review conflicts while excluding them from standard error serialization.
6
+ - Document the server versions needed for the reviewer object and how to obtain the authenticated identity.
7
+
3
8
  ## 0.40.0 - 2026-11-10
4
9
 
5
10
  - Accept an optional server-authenticated reviewer profile (first name, last name and email) on review decisions and preserve it in conflict metadata. Legacy reviewer strings remain supported.
package/README.md CHANGED
@@ -582,11 +582,16 @@ This read is available before the first review and after final callback delivery
582
582
  it never consumes the single-use final result or triggers pipelines/callbacks.
583
583
 
584
584
  Requires Consumer's review routes and the compatible HITL Document API branch.
585
+ Use the reviewer object or omit `reviewer` only when Consumer Edge includes DOC-2577
586
+ and Document API includes DOC-2623. On earlier deployments, send a reviewer string
587
+ from the authenticated server session.
585
588
  No pipelines are required. Start published manual formulas with `runFlowAsync`;
586
589
  `AWAITING_REVIEW` is non-terminal. `runFlow` still waits for final completion and
587
590
  retains its configured timeout, so do not hold an HTTP request open for human work.
588
591
 
589
592
  ```ts
593
+ // Read this profile from the server's authenticated session.
594
+ const { firstName, lastName, email } = authenticatedServerActor;
590
595
  const scope = { organization: "your-organization", signal: controller.signal };
591
596
  const { reviews, nextCursor } = await docmana.reviews.list({
592
597
  ...scope,
@@ -599,7 +604,7 @@ await docmana.reviews.decide(
599
604
  {
600
605
  decision: "continue",
601
606
  version: task.version,
602
- reviewer: { firstName: analyst.firstName, lastName: analyst.lastName, email: analyst.email },
607
+ reviewer: { firstName, lastName, email },
603
608
  corrections: [{ itemId: task.documents[0].items![0].itemId, value: false }],
604
609
  },
605
610
  scope,
package/dist/cli.mjs CHANGED
@@ -620,25 +620,28 @@ function reviewConflictDetails(raw) {
620
620
  const actor = isRecord(raw.decidedBy) ? raw.decidedBy : {};
621
621
  const id = text(actor.id, 200);
622
622
  const name = text(actor.name, 200);
623
- const firstName = text(actor.firstName, 200);
624
- const lastName = text(actor.lastName, 200);
625
- const email = text(actor.email, 200);
623
+ const profile = {
624
+ firstName: text(actor.firstName, 200),
625
+ lastName: text(actor.lastName, 200),
626
+ email: text(actor.email, 200)
627
+ };
626
628
  const source = actor.source === "integrator" || actor.source === "token" ? actor.source : null;
627
629
  const decidedBy = [
628
630
  id,
629
631
  name,
630
- firstName,
631
- lastName,
632
- email,
632
+ ...Object.values(profile),
633
633
  source
634
634
  ].some((part) => part !== null) ? {
635
635
  ...id !== null ? { id } : {},
636
636
  ...name !== null ? { name } : {},
637
- ...firstName !== null ? { firstName } : {},
638
- ...lastName !== null ? { lastName } : {},
639
- ...email !== null ? { email } : {},
640
637
  ...source ? { source } : {}
641
638
  } : null;
639
+ if (decidedBy) {
640
+ for (const [key, value] of Object.entries(profile)) {
641
+ if (value !== null)
642
+ Object.defineProperty(decidedBy, key, { value, writable: true, configurable: true });
643
+ }
644
+ }
642
645
  const currentVersion = version(raw.currentVersion) ?? version(raw.version);
643
646
  const decidedAt = text(raw.decidedAt, 40) ?? text(raw.submittedAt, 40);
644
647
  return {