@docmana/sdk 0.38.0 → 0.40.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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.40.0 - 2026-11-10
4
+
5
+ - 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.
6
+
7
+ ## 0.39.0 - 2026-11-06
8
+
9
+ - Read per-node rule assignments and rule impact and update an existing assignment through Consumer Edge formula authoring.
10
+
3
11
  ## 0.38.0 - 2026-11-05
4
12
 
5
13
  - Expose optional extraction grounding, with field origins, page evidence and tool-call references.
package/README.md CHANGED
@@ -480,6 +480,9 @@ new message. Do not replay an uncertain network failure automatically.
480
480
  `/v1/authoring` endpoints. It requires the DOC-2385 Consumer deployment and the
481
481
  DocMana API authoring endpoints. These methods do not manage Git or YAML.
482
482
 
483
+ Use `registrySnapshot(flowId, options)` for per-node assignments and `ruleImpact(flowId, ruleId, options)` before committing changes to shared content.
484
+ `setRuleAssignment(flowId, ruleId, nodeId, { enabled, expectedEnabled }, options)` saves a single existing attachment independently of the formula draft.
485
+
483
486
  ```ts
484
487
  const options = { organization: "my-organization" };
485
488
  const formulas = await docmana.authoring.list({ ...options, limit: 50, offset: 0 });
@@ -596,7 +599,7 @@ await docmana.reviews.decide(
596
599
  {
597
600
  decision: "continue",
598
601
  version: task.version,
599
- reviewer: authenticatedServerActor, // Never trust an identity from the browser.
602
+ reviewer: { firstName: analyst.firstName, lastName: analyst.lastName, email: analyst.email },
600
603
  corrections: [{ itemId: task.documents[0].items![0].itemId, value: false }],
601
604
  },
602
605
  scope,
@@ -99,6 +99,17 @@ export interface AuthoringSnapshot {
99
99
  published: number;
100
100
  };
101
101
  }
102
+ export interface AuthoringRuleImpact {
103
+ impact_hash: string;
104
+ usages: {
105
+ flow_id: string;
106
+ flow_name: string;
107
+ node_id: string;
108
+ node_label: string;
109
+ published: boolean;
110
+ }[];
111
+ flows_to_republish: string[];
112
+ }
102
113
  export interface AuthoringChanges {
103
114
  create?: AuthoringData[];
104
115
  update?: {
@@ -306,6 +317,15 @@ export declare class FormulaAuthoring {
306
317
  flowName?: string;
307
318
  }>;
308
319
  get(id: string, options: AuthoringOptions): Promise<AuthoringSnapshot>;
320
+ registrySnapshot(id: string, options: AuthoringOptions): Promise<AuthoringSnapshot>;
321
+ ruleImpact(id: string, ruleId: string, options: AuthoringOptions): Promise<AuthoringRuleImpact>;
322
+ setRuleAssignment(id: string, ruleId: string, nodeId: string, body: {
323
+ enabled: boolean;
324
+ expectedEnabled: boolean;
325
+ }, options: AuthoringOptions): Promise<{
326
+ node_id: string;
327
+ enabled: boolean;
328
+ }>;
309
329
  create(body: AuthoringCreate, options: AuthoringOptions): Promise<AuthoringReceipt>;
310
330
  save(id: string, body: AuthoringDraft, options: AuthoringOptions): Promise<AuthoringReceipt>;
311
331
  validate(id: string, revisions: AuthoringRevisions, options: AuthoringOptions): Promise<AuthoringData>;
package/dist/cli.mjs CHANGED
@@ -141,6 +141,20 @@ var FormulaAuthoring = class {
141
141
  get(id, options) {
142
142
  return this.request("GET", `flows/${identity(id)}`, options);
143
143
  }
144
+ registrySnapshot(id, options) {
145
+ return this.request("GET", `flows/${identity(id)}/rule-registry`, options);
146
+ }
147
+ ruleImpact(id, ruleId, options) {
148
+ return this.request("POST", `flows/${identity(id)}/rules/${identity(ruleId)}/impact`, options);
149
+ }
150
+ setRuleAssignment(id, ruleId, nodeId, body, options) {
151
+ return this.request(
152
+ "PATCH",
153
+ `flows/${identity(id)}/rules/${identity(ruleId)}/assignments/${identity(nodeId)}`,
154
+ options,
155
+ body
156
+ );
157
+ }
144
158
  create(body, options) {
145
159
  return this.request("POST", "flows", options, body);
146
160
  }
@@ -606,10 +620,23 @@ function reviewConflictDetails(raw) {
606
620
  const actor = isRecord(raw.decidedBy) ? raw.decidedBy : {};
607
621
  const id = text(actor.id, 200);
608
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);
609
626
  const source = actor.source === "integrator" || actor.source === "token" ? actor.source : null;
610
- const decidedBy = id !== null || name !== null || source !== null ? {
627
+ const decidedBy = [
628
+ id,
629
+ name,
630
+ firstName,
631
+ lastName,
632
+ email,
633
+ source
634
+ ].some((part) => part !== null) ? {
611
635
  ...id !== null ? { id } : {},
612
636
  ...name !== null ? { name } : {},
637
+ ...firstName !== null ? { firstName } : {},
638
+ ...lastName !== null ? { lastName } : {},
639
+ ...email !== null ? { email } : {},
613
640
  ...source ? { source } : {}
614
641
  } : null;
615
642
  const currentVersion = version(raw.currentVersion) ?? version(raw.version);