@docmana/sdk 0.40.0 → 0.41.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.41.0 - 2026-11-12
4
+
5
+ - Expose optional per-document `receivabilities` in execution results.
6
+
7
+ ## 0.40.1 - 2026-11-10
8
+
9
+ - Keep reviewer profile fields accessible in review conflicts while excluding them from standard error serialization.
10
+ - Document the server versions needed for the reviewer object and how to obtain the authenticated identity.
11
+
3
12
  ## 0.40.0 - 2026-11-10
4
13
 
5
14
  - 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
@@ -223,6 +223,9 @@ use `RunFlowParams` for request data:
223
223
  `GET /v1/executions/:executionResultId/result`; its result includes the optional
224
224
  `flowVersion` identifying the exact flow version used by the execution. Processing
225
225
  steps can also include `model` and `promptId` provenance when Docmana reports them.
226
+ When a flow produces receivability results, each document can include
227
+ `receivabilities`, keyed by step name, with status, score, feedback, and any
228
+ configured threshold or rejection details returned by Docmana.
226
229
  - `runFlow(flowId, params, options?)` starts async execution, polls status, fetches the
227
230
  result, respects `X-Poll-After` and `429 Retry-After` while polling, and throws
228
231
  `DocmanaExecutionError` if the result status is `FAILED`.
@@ -582,11 +585,16 @@ This read is available before the first review and after final callback delivery
582
585
  it never consumes the single-use final result or triggers pipelines/callbacks.
583
586
 
584
587
  Requires Consumer's review routes and the compatible HITL Document API branch.
588
+ Use the reviewer object or omit `reviewer` only when Consumer Edge includes DOC-2577
589
+ and Document API includes DOC-2623. On earlier deployments, send a reviewer string
590
+ from the authenticated server session.
585
591
  No pipelines are required. Start published manual formulas with `runFlowAsync`;
586
592
  `AWAITING_REVIEW` is non-terminal. `runFlow` still waits for final completion and
587
593
  retains its configured timeout, so do not hold an HTTP request open for human work.
588
594
 
589
595
  ```ts
596
+ // Read this profile from the server's authenticated session.
597
+ const { firstName, lastName, email } = authenticatedServerActor;
590
598
  const scope = { organization: "your-organization", signal: controller.signal };
591
599
  const { reviews, nextCursor } = await docmana.reviews.list({
592
600
  ...scope,
@@ -599,7 +607,7 @@ await docmana.reviews.decide(
599
607
  {
600
608
  decision: "continue",
601
609
  version: task.version,
602
- reviewer: { firstName: analyst.firstName, lastName: analyst.lastName, email: analyst.email },
610
+ reviewer: { firstName, lastName, email },
603
611
  corrections: [{ itemId: task.documents[0].items![0].itemId, value: false }],
604
612
  },
605
613
  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 {