@docmana/sdk 0.28.1 → 0.36.0-hitl.2

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,217 +1,308 @@
1
- # Changelog
2
-
1
+ # Changelog
2
+
3
+ ## 0.36.0-hitl.2 - 2026-10-23 (HITL prerelease)
4
+
5
+ - Add `executionEvents.list()` and typed, non-consuming sequence-paged node
6
+ history for formulas with or without human review. Add the expanded
7
+ `verifyExecutionEventCallback` / `parseExecutionEventCallback` while retaining
8
+ the existing strict review-only helpers and final callback behavior.
9
+ - Publish pilot versions under the explicit `hitl` npm distribution tag;
10
+ other prereleases use `next` and stable releases use `latest`.
11
+
12
+ ## 0.36.0-hitl.1 - 2026-10-23 (local POC)
13
+
14
+ - Add `reviews.calculation()` and exported `ReviewCalculation` for non-consuming
15
+ provisional calculation state, coherent/target revisions, review counts and
16
+ per-revision node reuse. Preserve legacy null metadata, organization scope,
17
+ versioned decisions, assignment and final callback behavior.
18
+
19
+ ## 0.35.0-hitl.3 - 2026-10-22 (local POC)
20
+
21
+ - Add optional `ReviewTask.findings` and exported `ReviewFinding` for explicit,
22
+ review-scoped field signals. Preserve missing/empty findings and existing
23
+ corrections, assignment, global confirmation and final callbacks.
24
+
25
+ ## 0.35.0-hitl.2 - 2026-10-22 (local POC)
26
+
27
+ - Add optional read-only frozen review assessments (node score, description, feedback, explanation and reasoning). No per-field findings or decision/callback change.
28
+
29
+ ## 0.35.0-hitl.1 - 2026-10-22 (local POC)
30
+
31
+ - Preserve optional native review lifecycle timestamps for Live's human-wait and activity display. No final result fetch, pipeline or callback contract change.
32
+
33
+ ## 0.34.0 - 2026-10-22
34
+
35
+ - Add `reviews.document(id, docKey, "preview", options)` and exported
36
+ `DocumentPreviewManifest` for progressive import-time WebP preparation.
37
+ Existing document streams, review decisions and final callbacks are unchanged.
38
+
39
+ ## 0.33.0 - 2026-10-21
40
+
41
+ - Add typed review event callbacks and raw-body HMAC signature verification for
42
+ Consumer's separate review event relay. Existing execution callbacks are unchanged.
43
+ - Add `Docmana.reviews` for organization-scoped queues, task details, versioned
44
+ decisions and streaming page/content/location reads. Preserve range/cache
45
+ statuses and safe conflict metadata; never automatically retry decisions.
46
+ - Expose `AWAITING_REVIEW` as a non-terminal execution status.
47
+
3
48
  ## Unreleased
4
49
 
50
+ ## 0.32.0 - 2026-10-19
51
+
52
+ - Release the additive `Docmana.authoring` API for scoped formula reads, create/save/validate/publish/history, native archives, sorting, assisted conversations, editor catalog and mapping proposals.
53
+ - Preserve normalized API business error codes and optional POC provenance types. Optional Git/projection write fields are not accepted by DocMana API main; omit them on the ordinary Mongo authoring path.
54
+ - Add revision-pinned `authoring.documentTrialDefinitions` for server-side assisted document trials in DocMana Flows, using existing DocMana API main reads.
55
+ - Document assisted trial execution separately from native manual trials; document-trial reports can identify their executor. No new DocMana API endpoint is required.
56
+
57
+ ### Earlier local POC iteration notes
58
+
59
+ The earlier 0.29–0.31 authoring iterations are incorporated in 0.32.0. Assisted classification/extraction now uses `documentTrialDefinitions` and the Flows executor; the experimental DocMana API `/extract/test-assisted` route is not required. The multipart `documentTrial` execution route remains manual-only with API main.
60
+
61
+ ### Previously unreleased authoring additions
62
+
63
+ - Add full compiled prompt upserts, Git projection provenance, the staged state,
64
+ runtime capabilities and artifact/tooling hashes for traced publication.
65
+
66
+ - Add organization-scoped document trials through Consumer Edge and native DocMana API, with native revision checks or compiled YAML draft prompts.
67
+
68
+ - Add typed Git/Mongo authoring sources, Git publication provenance and Mongo divergence state; forward an optional exact Git commit when publishing.
69
+
70
+ ### Editor catalog and conversations
71
+
72
+ - Add the organization-scoped native editor catalog and JSONata mapping proposal methods.
73
+
74
+ - Preserve public API business error codes in optional `DocmanaError.apiCode`,
75
+ without changing existing SDK error categories or retry behavior.
76
+
77
+ - Add organization-scoped assisted-rule conversations: opening with context and
78
+ optional transcript, sending messages, and acknowledging approved proposals.
79
+ - Preserve native proposal/context payloads and expired-conversation HTTP 410.
80
+ Requires Consumer Edge's additive authoring conversation endpoints (DOC-2385).
81
+
82
+ ### Native authoring and archives
83
+
84
+ - Add `Docmana.authoring` for organization-scoped native formula discovery,
85
+ creation, draft saving, validation, publication, history and feature flags.
86
+ - Export lossless native authoring types and revision/operation receipt types.
87
+ Requires Consumer Edge's additive `/v1/authoring` contract (DOC-2385).
5
88
  ## 0.28.1 - 2026-10-02
6
89
 
7
90
  - Add `QUEUED` to the public `ExecutionStatus` type and verify that polling
8
91
  continues through `QUEUED` and `INCOMPLETED` before retrieving the completed result.
9
92
 
93
+ - Add native archive import/export and formula deletion, with explicit import
94
+ overwrite confirmation and a 10 MiB archive limit.
95
+ - Add server-side list sorting and formula dates/execution/document totals.
96
+
10
97
  ## 0.28.0 - 2026-09-09
11
-
12
- - Expose optional Fraud Detection API build identity on results through
13
- `processor.apiVersion`, `processor.gitCommit`, and `processor.buildTime`.
14
-
15
- ## 0.27.0 - 2026-09-08
16
-
17
- - Expose optional physical-document provenance, logical-document identifiers,
18
- and page ranges on execution document mappings.
19
- - Preserve legacy execution mappings unchanged when source provenance is absent.
20
-
21
- ## 0.26.0 - 2026-09-07
22
-
23
- - Expose the exact numeric version that a new flow execution would use through
24
- `getFlowMetadata`.
25
-
26
- ## 0.25.0 - 2026-08-24
27
-
28
- - Stream file-path inputs from disk instead of loading them completely into memory.
29
- - Expose typed `413` and `503` upload errors, preserve `Retry-After`, and retry one
30
- multipart admission `503` carrying that header with a fresh request body.
31
-
32
- ## 0.24.0 - 2026-08-20
33
-
34
- - Preserve the exact numeric flow version when mapping raw execution results.
35
- - Expose each processing step's LLM model and immutable prompt identifier without
36
- reintroducing token or cost telemetry.
37
- - Update vulnerable HTTP and build-tool transitive dependencies to patched versions.
38
-
39
- ## 0.23.0 - 2026-08-07
40
-
41
- - Align the Fraud result with Consumer Edge's functional public contract.
42
- - Keep verdict, confidence, reasoning, summary, findings, document id, and duration.
43
- - Remove internal preprocessing, layer telemetry, model usage, token counts, costs,
44
- and persistence diagnostics; finding categories remain available through `finding.layer`.
45
-
46
- ## 0.22.0 - 2026-08-06
47
-
48
- - Expose the complete Consumer Edge fraud-analysis telemetry: global totals,
49
- preprocessing, verdict, and per-layer duration, token usage, LLM calls, model
50
- usage, cost, and errors.
51
- - Keep model usage Mongo-safe as `modelUsage[]` and continue excluding the
52
- sensitive Fraud `document` payload.
53
-
54
- ## 0.21.0 - 2026-08-05
55
-
56
- - Relay the native Fraud job identifier through Consumer Edge while preserving
57
- the existing high-level polling workflow.
58
- - Add local file, named byte, and readable stream inputs to `detectFraud` and
59
- `detectFraudAsync` through the existing `FileInput` contract.
60
- - Stop sending organization correlation on Fraud requests. The deprecated
61
- organization arguments remain accepted and ignored for source compatibility.
62
- - Expose Consumer Edge's BI-friendly Fraud result contract: aggregate `summary`,
63
- referenced `findings`, and detection `layers` keyed by their unique names.
64
-
65
- ## 0.20.0 - 2026-08-04
66
-
67
- - Add `detectFraud` to start a Consumer Edge fraud-detection job, poll its
68
- status, and return the normalized verdict and findings.
69
- - Add `detectFraudAsync`, `getFraudDetectionStatus`, and
70
- `getFraudDetectionResult` for callers that manage polling themselves.
71
- - Respect `X-Poll-After` and `Retry-After`, retry transient status failures,
72
- and expose typed failure, timeout, and cancellation errors.
73
-
74
- ## 0.19.0 - 2026-08-04
75
-
76
- - Add synchronous and asynchronous V2 partial flow execution through Consumer Edge.
77
- - Use `executionScope`, `flowVersion`, and `classificationNodeNames` in the
78
- multipart body, leaving only `organization` in the query string.
79
- - Return the standard `DocmanaExecutionResult` shape with optional
80
- `partialExecution` metadata.
81
-
82
- ## 0.18.0
83
- - Expose the optional aggregate `verdict` on `DocmanaExecutionResult`, preserving
84
- the `VALID`, `PARTIAL`, `WARNING`, `FAILED`, or `UNKNOWN` value computed by
85
- Docmana API and returned by consumer-edge.
86
-
87
- ## 0.17.0
88
- - Expose the optional `flowVersion` on `DocmanaExecutionResult`, preserving the
89
- exact Docmana flow version used by an execution in polling and callback results.
90
-
91
- consu## 0.16.0
92
- - Scope organization document access to a specific organization: `listOrganizationDocuments`
93
- now accepts an `organization` option and `downloadOrganizationDocument(s)` an optional
94
- `organization` argument, both forwarded as the `?organization=` query param (relayed to
95
- docmana-api as `X-Selected-Organization`). Without it, consumer-edge reads the caller's
96
- default organization depot, which leaks another org's documents to callers scoping by site.
97
-
98
- ## 0.15.0
99
- - Expose `rejectionCode`, `rejectionMessage`, `documentTypeProximity`, and
100
- `documentContentNature` as optional system fields on node results instead of
101
- including them in user-defined `data`.
102
-
103
- ## 0.14.0
104
- - Add the optional human-readable `label` to every mapped node result while
105
- preserving the stable node name as the record key.
106
- - Preserve the `REJECTED` status returned by classification nodes and expose it
107
- in the public `ExecutionStatus` contract.
108
- - Add document-level `preprocessing` results, including generated steps such as
109
- `Document Extraction`, correlated to their document by `doc_key`.
110
-
111
- ## 0.13.0
112
- - Add normalized execution metrics to `DocmanaExecutionResult`:
113
- `flowId`, `totalDocuments`, `totalPages`, `totalTokens`, `totalMana`, and
114
- `totalRunningTime`.
115
- - Add node-level execution metrics to mapped node results: `runningTime` and
116
- `mana`.
117
-
118
- ## 0.12.0
119
- - Add `--context <json>` to `docmana flow run`, parsed as a JSON object and
120
- passed through to `runFlow` as `RunFlowParams.context`.
121
- - Return CLI usage errors when `--context` is invalid JSON or is not a JSON
122
- object.
123
-
124
- ## 0.11.0
125
- - Normalize execution statuses to uppercase SDK values:
126
- `PENDING`, `RUNNING`, `INCOMPLETED`, `COMPLETED`, and `FAILED`.
127
- - Normalize raw API and polling statuses before checking terminal or failed
128
- states, so legacy mixed-case values still map consistently.
129
- - Rename flow metadata `contextSchema` to `jsonContextSchema` in the public
130
- `FlowMetadata` shape and README examples.
131
-
132
- ## 0.10.0
133
- - Add an optional `organization` to flow selection, emitted as a
134
- `?organization=<org>` query param on the request to
135
- `docmana-consumer-edge-api`. Purely additive — existing calls are unchanged.
136
- - `listFlows({ organization })`, `getFlowMetadata(flowId, { organization })`,
137
- and `getFlowDefinition(flowId, { organization })` accept the option.
138
- - `RunFlowParams` (and therefore `runFlow` / `runFlowAsync`) gains
139
- `organization`, threaded onto the `execute-async` request URL.
140
- - Expose `organization` on `FlowListItem`: when the consumer-edge tags a flow
141
- with its organization, `listFlows()` now carries it through on each item.
142
-
143
- ## 0.8.1
144
- - Rename the multipart wire fields sent to `docmana-consumer-edge-api` from
145
- `json_context` / `callback_url` to `jsonContext` / `callbackUrl`, matching the
146
- edge-api DTOs that dropped their snake_case `@Expose` mappings. Public inputs
147
- (`context`, `callbackUrl`) are unchanged.
148
-
149
- ## 0.8.0
150
- - Add organization document depot methods and CLI commands:
151
- `listOrganizationDocuments()`, `downloadOrganizationDocument()`, and
152
- `downloadOrganizationDocuments()`.
153
- - Add `docmana organization document list/download`.
154
- - Make `docmana organization document download --output` optional; default output
155
- is `./{path}`.
156
-
157
- ## 0.7.0
158
- - Add `getFlowMetadata()` / `docmana flow metadata` for projected flow runtime
159
- metadata from `docmana-consumer-edge-api`.
160
- - Add `getFlowDefinition()` / `docmana flow definition` for normalized flow
161
- graph definitions without exposing the Docmana ZIP export.
162
-
163
- ## 0.6.0
164
- - Add `listOrganizations()` and `docmana organization list` to list organizations
165
- available through `docmana-consumer-edge-api`.
166
-
167
- ## 0.5.0
168
- - Add `listFlows()` to list flows available through `docmana-consumer-edge-api`,
169
- returning `{ id, name, state }[]` with `state: "unknown"` when Docmana omits it.
170
- - Add `docmana flow list` CLI command, with the same API URL and Bearer token resolution as `docmana flow run`.
171
- - Rename `RunFlowInput` to `RunFlowParams` and move polling controls to
172
- `RunFlowOptions`.
173
- - Remove the single-file `file` shortcut from flow params; callers now pass
174
- `files`.
175
- - Remove `fileName` from flow params; byte and stream inputs now use
176
- `{ data, filename, contentType? }`.
177
- - Replace `runFlowWithCallback` with `runFlowAsync(..., { callbackUrl })`.
178
-
179
- ## 0.3.5
180
- - Add callback execution support: starts a flow and returns `{ executionResultId, fileIds }` **without polling**, registering a `callback_url` so docmana-api POSTs a completion notification when the run finishes. Call `getResult(executionResultId)` on receipt to fetch the mapped result.
181
-
182
- ## 0.3.3
183
- - Add `RunFlowParams.context` (business `json_context`): when provided, `runFlow`/`runFlowAsync` include `json_context` in the request body for both `run_flow` and `run_once_flow`. The context is passed through as-is — filtering against the flow's *Start* node properties is performed server-side by docmana-api.
184
-
185
- ## 0.3.2
186
- - Add `scoreDescription` to score-node results (Validation, Classification, CrossValidation, Conclusion).
187
- - Fix: when a target `language` is requested, the **textual** score-node fields `feedback` and `scoreDescription` are now returned from `translations[language]` (falling back to the default values when the translation omits them). The numeric `score` is language-independent and is always taken from the default node. Previously only the dynamic `data` fields were translated while the textual fields stayed in the flow's default language.
188
-
189
- ## 0.3.1
190
- - Fix: upload all files in a single `/upload` call (one folder UUID) instead of one call per file. Sending each file separately made Docmana treat them as distinct documents, which breaks multi-document flows ("Node already present" when the same flow node is built per document).
191
-
192
- ## 0.3.0
193
- - Relocated mapper logic and tests to `src/mappers/`.
194
- - Renamed SDK models to `DocmanaX` and API models to `DocmanaApiX` to distinguish raw backend types from clean public SDK types.
195
- - Pluralized `classification` results into a `classifications` key-value record on document results.
196
- - Nested dynamic extraction fields inside a dedicated `data` record on node results to prevent property name collisions.
197
- - Restructured node result interfaces to remove `score` and `feedback` from `DocmanaExtractionResult` and `DocmanaMetadataExtractionResult` (via new `DocmanaScoreNodeResult` interface).
198
- - Excluded internal fields `result` and `documentType` from mapped SDK results.
199
-
200
- ## 0.2.2
201
- - Fix `package-lock.json`.
202
-
203
- ## 0.2.1
204
- - 400 responses now throw `DocmanaRequestError` (was `DocmanaAuthError`); add `Incompleted` to `ExecutionStatus`.
205
-
206
- ## 0.2.0
207
- - `RunFlowParams.once` selects the ad-hoc `run_once_flow` endpoint (current/draft flow) instead of the published `run_flow`.
208
- - `DocmanaConfig.headers` are sent on every API request (e.g. `X-Selected-Organization`), without overriding the bearer token or per-request headers.
209
- - `FileInput` now accepts a plain `Uint8Array` (e.g. pdf-lib output) in addition to path, `Buffer`, and `Stream`.
210
- - Uploads send a `Content-Type` inferred from the filename extension instead of always `application/octet-stream`.
211
-
212
- ## 0.1.0
213
- - Single-call `runFlow` orchestration: upload → run → poll → result.
214
- - OAuth2 client-credentials auth with in-memory token cache and automatic refresh.
215
- - Typed error hierarchy (`DocmanaError`, `DocmanaExecutionError`, …).
216
- - Flexible file inputs: path, `Buffer`, `Stream`, and multi-file uploads.
217
- - Dual ESM + CJS distribution with bundled type definitions.
98
+
99
+ - Expose optional Fraud Detection API build identity on results through
100
+ `processor.apiVersion`, `processor.gitCommit`, and `processor.buildTime`.
101
+
102
+ ## 0.27.0 - 2026-09-08
103
+
104
+ - Expose optional physical-document provenance, logical-document identifiers,
105
+ and page ranges on execution document mappings.
106
+ - Preserve legacy execution mappings unchanged when source provenance is absent.
107
+
108
+ ## 0.26.0 - 2026-09-07
109
+
110
+ - Expose the exact numeric version that a new flow execution would use through
111
+ `getFlowMetadata`.
112
+
113
+ ## 0.25.0 - 2026-08-24
114
+
115
+ - Stream file-path inputs from disk instead of loading them completely into memory.
116
+ - Expose typed `413` and `503` upload errors, preserve `Retry-After`, and retry one
117
+ multipart admission `503` carrying that header with a fresh request body.
118
+
119
+ ## 0.24.0 - 2026-08-20
120
+
121
+ - Preserve the exact numeric flow version when mapping raw execution results.
122
+ - Expose each processing step's LLM model and immutable prompt identifier without
123
+ reintroducing token or cost telemetry.
124
+ - Update vulnerable HTTP and build-tool transitive dependencies to patched versions.
125
+
126
+ ## 0.23.0 - 2026-08-07
127
+
128
+ - Align the Fraud result with Consumer Edge's functional public contract.
129
+ - Keep verdict, confidence, reasoning, summary, findings, document id, and duration.
130
+ - Remove internal preprocessing, layer telemetry, model usage, token counts, costs,
131
+ and persistence diagnostics; finding categories remain available through `finding.layer`.
132
+
133
+ ## 0.22.0 - 2026-08-06
134
+
135
+ - Expose the complete Consumer Edge fraud-analysis telemetry: global totals,
136
+ preprocessing, verdict, and per-layer duration, token usage, LLM calls, model
137
+ usage, cost, and errors.
138
+ - Keep model usage Mongo-safe as `modelUsage[]` and continue excluding the
139
+ sensitive Fraud `document` payload.
140
+
141
+ ## 0.21.0 - 2026-08-05
142
+
143
+ - Relay the native Fraud job identifier through Consumer Edge while preserving
144
+ the existing high-level polling workflow.
145
+ - Add local file, named byte, and readable stream inputs to `detectFraud` and
146
+ `detectFraudAsync` through the existing `FileInput` contract.
147
+ - Stop sending organization correlation on Fraud requests. The deprecated
148
+ organization arguments remain accepted and ignored for source compatibility.
149
+ - Expose Consumer Edge's BI-friendly Fraud result contract: aggregate `summary`,
150
+ referenced `findings`, and detection `layers` keyed by their unique names.
151
+
152
+ ## 0.20.0 - 2026-08-04
153
+
154
+ - Add `detectFraud` to start a Consumer Edge fraud-detection job, poll its
155
+ status, and return the normalized verdict and findings.
156
+ - Add `detectFraudAsync`, `getFraudDetectionStatus`, and
157
+ `getFraudDetectionResult` for callers that manage polling themselves.
158
+ - Respect `X-Poll-After` and `Retry-After`, retry transient status failures,
159
+ and expose typed failure, timeout, and cancellation errors.
160
+
161
+ ## 0.19.0 - 2026-08-04
162
+
163
+ - Add synchronous and asynchronous V2 partial flow execution through Consumer Edge.
164
+ - Use `executionScope`, `flowVersion`, and `classificationNodeNames` in the
165
+ multipart body, leaving only `organization` in the query string.
166
+ - Return the standard `DocmanaExecutionResult` shape with optional
167
+ `partialExecution` metadata.
168
+
169
+ ## 0.18.0
170
+ - Expose the optional aggregate `verdict` on `DocmanaExecutionResult`, preserving
171
+ the `VALID`, `PARTIAL`, `WARNING`, `FAILED`, or `UNKNOWN` value computed by
172
+ Docmana API and returned by consumer-edge.
173
+
174
+ ## 0.17.0
175
+ - Expose the optional `flowVersion` on `DocmanaExecutionResult`, preserving the
176
+ exact Docmana flow version used by an execution in polling and callback results.
177
+
178
+ consu## 0.16.0
179
+ - Scope organization document access to a specific organization: `listOrganizationDocuments`
180
+ now accepts an `organization` option and `downloadOrganizationDocument(s)` an optional
181
+ `organization` argument, both forwarded as the `?organization=` query param (relayed to
182
+ docmana-api as `X-Selected-Organization`). Without it, consumer-edge reads the caller's
183
+ default organization depot, which leaks another org's documents to callers scoping by site.
184
+
185
+ ## 0.15.0
186
+ - Expose `rejectionCode`, `rejectionMessage`, `documentTypeProximity`, and
187
+ `documentContentNature` as optional system fields on node results instead of
188
+ including them in user-defined `data`.
189
+
190
+ ## 0.14.0
191
+ - Add the optional human-readable `label` to every mapped node result while
192
+ preserving the stable node name as the record key.
193
+ - Preserve the `REJECTED` status returned by classification nodes and expose it
194
+ in the public `ExecutionStatus` contract.
195
+ - Add document-level `preprocessing` results, including generated steps such as
196
+ `Document Extraction`, correlated to their document by `doc_key`.
197
+
198
+ ## 0.13.0
199
+ - Add normalized execution metrics to `DocmanaExecutionResult`:
200
+ `flowId`, `totalDocuments`, `totalPages`, `totalTokens`, `totalMana`, and
201
+ `totalRunningTime`.
202
+ - Add node-level execution metrics to mapped node results: `runningTime` and
203
+ `mana`.
204
+
205
+ ## 0.12.0
206
+ - Add `--context <json>` to `docmana flow run`, parsed as a JSON object and
207
+ passed through to `runFlow` as `RunFlowParams.context`.
208
+ - Return CLI usage errors when `--context` is invalid JSON or is not a JSON
209
+ object.
210
+
211
+ ## 0.11.0
212
+ - Normalize execution statuses to uppercase SDK values:
213
+ `PENDING`, `RUNNING`, `INCOMPLETED`, `COMPLETED`, and `FAILED`.
214
+ - Normalize raw API and polling statuses before checking terminal or failed
215
+ states, so legacy mixed-case values still map consistently.
216
+ - Rename flow metadata `contextSchema` to `jsonContextSchema` in the public
217
+ `FlowMetadata` shape and README examples.
218
+
219
+ ## 0.10.0
220
+ - Add an optional `organization` to flow selection, emitted as a
221
+ `?organization=<org>` query param on the request to
222
+ `docmana-consumer-edge-api`. Purely additive — existing calls are unchanged.
223
+ - `listFlows({ organization })`, `getFlowMetadata(flowId, { organization })`,
224
+ and `getFlowDefinition(flowId, { organization })` accept the option.
225
+ - `RunFlowParams` (and therefore `runFlow` / `runFlowAsync`) gains
226
+ `organization`, threaded onto the `execute-async` request URL.
227
+ - Expose `organization` on `FlowListItem`: when the consumer-edge tags a flow
228
+ with its organization, `listFlows()` now carries it through on each item.
229
+
230
+ ## 0.8.1
231
+ - Rename the multipart wire fields sent to `docmana-consumer-edge-api` from
232
+ `json_context` / `callback_url` to `jsonContext` / `callbackUrl`, matching the
233
+ edge-api DTOs that dropped their snake_case `@Expose` mappings. Public inputs
234
+ (`context`, `callbackUrl`) are unchanged.
235
+
236
+ ## 0.8.0
237
+ - Add organization document depot methods and CLI commands:
238
+ `listOrganizationDocuments()`, `downloadOrganizationDocument()`, and
239
+ `downloadOrganizationDocuments()`.
240
+ - Add `docmana organization document list/download`.
241
+ - Make `docmana organization document download --output` optional; default output
242
+ is `./{path}`.
243
+
244
+ ## 0.7.0
245
+ - Add `getFlowMetadata()` / `docmana flow metadata` for projected flow runtime
246
+ metadata from `docmana-consumer-edge-api`.
247
+ - Add `getFlowDefinition()` / `docmana flow definition` for normalized flow
248
+ graph definitions without exposing the Docmana ZIP export.
249
+
250
+ ## 0.6.0
251
+ - Add `listOrganizations()` and `docmana organization list` to list organizations
252
+ available through `docmana-consumer-edge-api`.
253
+
254
+ ## 0.5.0
255
+ - Add `listFlows()` to list flows available through `docmana-consumer-edge-api`,
256
+ returning `{ id, name, state }[]` with `state: "unknown"` when Docmana omits it.
257
+ - Add `docmana flow list` CLI command, with the same API URL and Bearer token resolution as `docmana flow run`.
258
+ - Rename `RunFlowInput` to `RunFlowParams` and move polling controls to
259
+ `RunFlowOptions`.
260
+ - Remove the single-file `file` shortcut from flow params; callers now pass
261
+ `files`.
262
+ - Remove `fileName` from flow params; byte and stream inputs now use
263
+ `{ data, filename, contentType? }`.
264
+ - Replace `runFlowWithCallback` with `runFlowAsync(..., { callbackUrl })`.
265
+
266
+ ## 0.3.5
267
+ - Add callback execution support: starts a flow and returns `{ executionResultId, fileIds }` **without polling**, registering a `callback_url` so docmana-api POSTs a completion notification when the run finishes. Call `getResult(executionResultId)` on receipt to fetch the mapped result.
268
+
269
+ ## 0.3.3
270
+ - Add `RunFlowParams.context` (business `json_context`): when provided, `runFlow`/`runFlowAsync` include `json_context` in the request body for both `run_flow` and `run_once_flow`. The context is passed through as-is — filtering against the flow's *Start* node properties is performed server-side by docmana-api.
271
+
272
+ ## 0.3.2
273
+ - Add `scoreDescription` to score-node results (Validation, Classification, CrossValidation, Conclusion).
274
+ - Fix: when a target `language` is requested, the **textual** score-node fields `feedback` and `scoreDescription` are now returned from `translations[language]` (falling back to the default values when the translation omits them). The numeric `score` is language-independent and is always taken from the default node. Previously only the dynamic `data` fields were translated while the textual fields stayed in the flow's default language.
275
+
276
+ ## 0.3.1
277
+ - Fix: upload all files in a single `/upload` call (one folder UUID) instead of one call per file. Sending each file separately made Docmana treat them as distinct documents, which breaks multi-document flows ("Node already present" when the same flow node is built per document).
278
+
279
+ ## 0.3.0
280
+ - Relocated mapper logic and tests to `src/mappers/`.
281
+ - Renamed SDK models to `DocmanaX` and API models to `DocmanaApiX` to distinguish raw backend types from clean public SDK types.
282
+ - Pluralized `classification` results into a `classifications` key-value record on document results.
283
+ - Nested dynamic extraction fields inside a dedicated `data` record on node results to prevent property name collisions.
284
+ - Restructured node result interfaces to remove `score` and `feedback` from `DocmanaExtractionResult` and `DocmanaMetadataExtractionResult` (via new `DocmanaScoreNodeResult` interface).
285
+ - Excluded internal fields `result` and `documentType` from mapped SDK results.
286
+
287
+ ## 0.2.2
288
+ - Fix `package-lock.json`.
289
+
290
+ ## 0.2.1
291
+ - 400 responses now throw `DocmanaRequestError` (was `DocmanaAuthError`); add `Incompleted` to `ExecutionStatus`.
292
+
293
+ ## 0.2.0
294
+ - `RunFlowParams.once` selects the ad-hoc `run_once_flow` endpoint (current/draft flow) instead of the published `run_flow`.
295
+ - `DocmanaConfig.headers` are sent on every API request (e.g. `X-Selected-Organization`), without overriding the bearer token or per-request headers.
296
+ - `FileInput` now accepts a plain `Uint8Array` (e.g. pdf-lib output) in addition to path, `Buffer`, and `Stream`.
297
+ - Uploads send a `Content-Type` inferred from the filename extension instead of always `application/octet-stream`.
298
+
299
+ ## 0.1.0
300
+ - Single-call `runFlow` orchestration: upload → run → poll → result.
301
+ - OAuth2 client-credentials auth with in-memory token cache and automatic refresh.
302
+ - Typed error hierarchy (`DocmanaError`, `DocmanaExecutionError`, …).
303
+ - Flexible file inputs: path, `Buffer`, `Stream`, and multi-file uploads.
304
+ - Dual ESM + CJS distribution with bundled type definitions.
305
+
306
+ ### Local HITL outline addition
307
+
308
+ - Add reviews.outline with typed published formula steps, edges and review marks. Existing execution, decision and final callback contracts are unchanged.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Docmana
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Docmana
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.