@docmana/sdk 0.28.0 → 0.32.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,212 +1,259 @@
1
- # Changelog
2
-
3
- ## Unreleased
4
-
5
- ## 0.28.0 - 2026-09-09
6
-
7
- - Expose optional Fraud Detection API build identity on results through
8
- `processor.apiVersion`, `processor.gitCommit`, and `processor.buildTime`.
9
-
10
- ## 0.27.0 - 2026-09-08
11
-
12
- - Expose optional physical-document provenance, logical-document identifiers,
13
- and page ranges on execution document mappings.
14
- - Preserve legacy execution mappings unchanged when source provenance is absent.
15
-
16
- ## 0.26.0 - 2026-09-07
17
-
18
- - Expose the exact numeric version that a new flow execution would use through
19
- `getFlowMetadata`.
20
-
21
- ## 0.25.0 - 2026-08-24
22
-
23
- - Stream file-path inputs from disk instead of loading them completely into memory.
24
- - Expose typed `413` and `503` upload errors, preserve `Retry-After`, and retry one
25
- multipart admission `503` carrying that header with a fresh request body.
26
-
27
- ## 0.24.0 - 2026-08-20
28
-
29
- - Preserve the exact numeric flow version when mapping raw execution results.
30
- - Expose each processing step's LLM model and immutable prompt identifier without
31
- reintroducing token or cost telemetry.
32
- - Update vulnerable HTTP and build-tool transitive dependencies to patched versions.
33
-
34
- ## 0.23.0 - 2026-08-07
35
-
36
- - Align the Fraud result with Consumer Edge's functional public contract.
37
- - Keep verdict, confidence, reasoning, summary, findings, document id, and duration.
38
- - Remove internal preprocessing, layer telemetry, model usage, token counts, costs,
39
- and persistence diagnostics; finding categories remain available through `finding.layer`.
40
-
41
- ## 0.22.0 - 2026-08-06
42
-
43
- - Expose the complete Consumer Edge fraud-analysis telemetry: global totals,
44
- preprocessing, verdict, and per-layer duration, token usage, LLM calls, model
45
- usage, cost, and errors.
46
- - Keep model usage Mongo-safe as `modelUsage[]` and continue excluding the
47
- sensitive Fraud `document` payload.
48
-
49
- ## 0.21.0 - 2026-08-05
50
-
51
- - Relay the native Fraud job identifier through Consumer Edge while preserving
52
- the existing high-level polling workflow.
53
- - Add local file, named byte, and readable stream inputs to `detectFraud` and
54
- `detectFraudAsync` through the existing `FileInput` contract.
55
- - Stop sending organization correlation on Fraud requests. The deprecated
56
- organization arguments remain accepted and ignored for source compatibility.
57
- - Expose Consumer Edge's BI-friendly Fraud result contract: aggregate `summary`,
58
- referenced `findings`, and detection `layers` keyed by their unique names.
59
-
60
- ## 0.20.0 - 2026-08-04
61
-
62
- - Add `detectFraud` to start a Consumer Edge fraud-detection job, poll its
63
- status, and return the normalized verdict and findings.
64
- - Add `detectFraudAsync`, `getFraudDetectionStatus`, and
65
- `getFraudDetectionResult` for callers that manage polling themselves.
66
- - Respect `X-Poll-After` and `Retry-After`, retry transient status failures,
67
- and expose typed failure, timeout, and cancellation errors.
68
-
69
- ## 0.19.0 - 2026-08-04
70
-
71
- - Add synchronous and asynchronous V2 partial flow execution through Consumer Edge.
72
- - Use `executionScope`, `flowVersion`, and `classificationNodeNames` in the
73
- multipart body, leaving only `organization` in the query string.
74
- - Return the standard `DocmanaExecutionResult` shape with optional
75
- `partialExecution` metadata.
76
-
77
- ## 0.18.0
78
- - Expose the optional aggregate `verdict` on `DocmanaExecutionResult`, preserving
79
- the `VALID`, `PARTIAL`, `WARNING`, `FAILED`, or `UNKNOWN` value computed by
80
- Docmana API and returned by consumer-edge.
81
-
82
- ## 0.17.0
83
- - Expose the optional `flowVersion` on `DocmanaExecutionResult`, preserving the
84
- exact Docmana flow version used by an execution in polling and callback results.
85
-
86
- consu## 0.16.0
87
- - Scope organization document access to a specific organization: `listOrganizationDocuments`
88
- now accepts an `organization` option and `downloadOrganizationDocument(s)` an optional
89
- `organization` argument, both forwarded as the `?organization=` query param (relayed to
90
- docmana-api as `X-Selected-Organization`). Without it, consumer-edge reads the caller's
91
- default organization depot, which leaks another org's documents to callers scoping by site.
92
-
93
- ## 0.15.0
94
- - Expose `rejectionCode`, `rejectionMessage`, `documentTypeProximity`, and
95
- `documentContentNature` as optional system fields on node results instead of
96
- including them in user-defined `data`.
97
-
98
- ## 0.14.0
99
- - Add the optional human-readable `label` to every mapped node result while
100
- preserving the stable node name as the record key.
101
- - Preserve the `REJECTED` status returned by classification nodes and expose it
102
- in the public `ExecutionStatus` contract.
103
- - Add document-level `preprocessing` results, including generated steps such as
104
- `Document Extraction`, correlated to their document by `doc_key`.
105
-
106
- ## 0.13.0
107
- - Add normalized execution metrics to `DocmanaExecutionResult`:
108
- `flowId`, `totalDocuments`, `totalPages`, `totalTokens`, `totalMana`, and
109
- `totalRunningTime`.
110
- - Add node-level execution metrics to mapped node results: `runningTime` and
111
- `mana`.
112
-
113
- ## 0.12.0
114
- - Add `--context <json>` to `docmana flow run`, parsed as a JSON object and
115
- passed through to `runFlow` as `RunFlowParams.context`.
116
- - Return CLI usage errors when `--context` is invalid JSON or is not a JSON
117
- object.
118
-
119
- ## 0.11.0
120
- - Normalize execution statuses to uppercase SDK values:
121
- `PENDING`, `RUNNING`, `INCOMPLETED`, `COMPLETED`, and `FAILED`.
122
- - Normalize raw API and polling statuses before checking terminal or failed
123
- states, so legacy mixed-case values still map consistently.
124
- - Rename flow metadata `contextSchema` to `jsonContextSchema` in the public
125
- `FlowMetadata` shape and README examples.
126
-
127
- ## 0.10.0
128
- - Add an optional `organization` to flow selection, emitted as a
129
- `?organization=<org>` query param on the request to
130
- `docmana-consumer-edge-api`. Purely additive — existing calls are unchanged.
131
- - `listFlows({ organization })`, `getFlowMetadata(flowId, { organization })`,
132
- and `getFlowDefinition(flowId, { organization })` accept the option.
133
- - `RunFlowParams` (and therefore `runFlow` / `runFlowAsync`) gains
134
- `organization`, threaded onto the `execute-async` request URL.
135
- - Expose `organization` on `FlowListItem`: when the consumer-edge tags a flow
136
- with its organization, `listFlows()` now carries it through on each item.
137
-
138
- ## 0.8.1
139
- - Rename the multipart wire fields sent to `docmana-consumer-edge-api` from
140
- `json_context` / `callback_url` to `jsonContext` / `callbackUrl`, matching the
141
- edge-api DTOs that dropped their snake_case `@Expose` mappings. Public inputs
142
- (`context`, `callbackUrl`) are unchanged.
143
-
144
- ## 0.8.0
145
- - Add organization document depot methods and CLI commands:
146
- `listOrganizationDocuments()`, `downloadOrganizationDocument()`, and
147
- `downloadOrganizationDocuments()`.
148
- - Add `docmana organization document list/download`.
149
- - Make `docmana organization document download --output` optional; default output
150
- is `./{path}`.
151
-
152
- ## 0.7.0
153
- - Add `getFlowMetadata()` / `docmana flow metadata` for projected flow runtime
154
- metadata from `docmana-consumer-edge-api`.
155
- - Add `getFlowDefinition()` / `docmana flow definition` for normalized flow
156
- graph definitions without exposing the Docmana ZIP export.
157
-
158
- ## 0.6.0
159
- - Add `listOrganizations()` and `docmana organization list` to list organizations
160
- available through `docmana-consumer-edge-api`.
161
-
162
- ## 0.5.0
163
- - Add `listFlows()` to list flows available through `docmana-consumer-edge-api`,
164
- returning `{ id, name, state }[]` with `state: "unknown"` when Docmana omits it.
165
- - Add `docmana flow list` CLI command, with the same API URL and Bearer token resolution as `docmana flow run`.
166
- - Rename `RunFlowInput` to `RunFlowParams` and move polling controls to
167
- `RunFlowOptions`.
168
- - Remove the single-file `file` shortcut from flow params; callers now pass
169
- `files`.
170
- - Remove `fileName` from flow params; byte and stream inputs now use
171
- `{ data, filename, contentType? }`.
172
- - Replace `runFlowWithCallback` with `runFlowAsync(..., { callbackUrl })`.
173
-
174
- ## 0.3.5
175
- - 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.
176
-
177
- ## 0.3.3
178
- - 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.
179
-
180
- ## 0.3.2
181
- - Add `scoreDescription` to score-node results (Validation, Classification, CrossValidation, Conclusion).
182
- - 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.
183
-
184
- ## 0.3.1
185
- - 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).
186
-
187
- ## 0.3.0
188
- - Relocated mapper logic and tests to `src/mappers/`.
189
- - Renamed SDK models to `DocmanaX` and API models to `DocmanaApiX` to distinguish raw backend types from clean public SDK types.
190
- - Pluralized `classification` results into a `classifications` key-value record on document results.
191
- - Nested dynamic extraction fields inside a dedicated `data` record on node results to prevent property name collisions.
192
- - Restructured node result interfaces to remove `score` and `feedback` from `DocmanaExtractionResult` and `DocmanaMetadataExtractionResult` (via new `DocmanaScoreNodeResult` interface).
193
- - Excluded internal fields `result` and `documentType` from mapped SDK results.
194
-
195
- ## 0.2.2
196
- - Fix `package-lock.json`.
197
-
198
- ## 0.2.1
199
- - 400 responses now throw `DocmanaRequestError` (was `DocmanaAuthError`); add `Incompleted` to `ExecutionStatus`.
200
-
201
- ## 0.2.0
202
- - `RunFlowParams.once` selects the ad-hoc `run_once_flow` endpoint (current/draft flow) instead of the published `run_flow`.
203
- - `DocmanaConfig.headers` are sent on every API request (e.g. `X-Selected-Organization`), without overriding the bearer token or per-request headers.
204
- - `FileInput` now accepts a plain `Uint8Array` (e.g. pdf-lib output) in addition to path, `Buffer`, and `Stream`.
205
- - Uploads send a `Content-Type` inferred from the filename extension instead of always `application/octet-stream`.
206
-
207
- ## 0.1.0
208
- - Single-call `runFlow` orchestration: upload → run → poll → result.
209
- - OAuth2 client-credentials auth with in-memory token cache and automatic refresh.
210
- - Typed error hierarchy (`DocmanaError`, `DocmanaExecutionError`, …).
211
- - Flexible file inputs: path, `Buffer`, `Stream`, and multi-file uploads.
212
- - Dual ESM + CJS distribution with bundled type definitions.
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.32.0 - 2026-10-19
6
+
7
+ - 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.
8
+ - 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.
9
+ - Add revision-pinned `authoring.documentTrialDefinitions` for server-side assisted document trials in DocMana Flows, using existing DocMana API main reads.
10
+ - Document assisted trial execution separately from native manual trials; document-trial reports can identify their executor. No new DocMana API endpoint is required.
11
+
12
+ ### Earlier local POC iteration notes
13
+
14
+ 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.
15
+
16
+ ### Previously unreleased authoring additions
17
+
18
+ - Add full compiled prompt upserts, Git projection provenance, the staged state,
19
+ runtime capabilities and artifact/tooling hashes for traced publication.
20
+
21
+ - Add organization-scoped document trials through Consumer Edge and native DocMana API, with native revision checks or compiled YAML draft prompts.
22
+
23
+ - Add typed Git/Mongo authoring sources, Git publication provenance and Mongo divergence state; forward an optional exact Git commit when publishing.
24
+
25
+ ### Editor catalog and conversations
26
+
27
+ - Add the organization-scoped native editor catalog and JSONata mapping proposal methods.
28
+
29
+ - Preserve public API business error codes in optional `DocmanaError.apiCode`,
30
+ without changing existing SDK error categories or retry behavior.
31
+
32
+ - Add organization-scoped assisted-rule conversations: opening with context and
33
+ optional transcript, sending messages, and acknowledging approved proposals.
34
+ - Preserve native proposal/context payloads and expired-conversation HTTP 410.
35
+ Requires Consumer Edge's additive authoring conversation endpoints (DOC-2385).
36
+
37
+ ### Native authoring and archives
38
+
39
+ - Add `Docmana.authoring` for organization-scoped native formula discovery,
40
+ creation, draft saving, validation, publication, history and feature flags.
41
+ - Export lossless native authoring types and revision/operation receipt types.
42
+ Requires Consumer Edge's additive `/v1/authoring` contract (DOC-2385).
43
+ ## 0.28.1 - 2026-10-02
44
+
45
+ - Add `QUEUED` to the public `ExecutionStatus` type and verify that polling
46
+ continues through `QUEUED` and `INCOMPLETED` before retrieving the completed result.
47
+
48
+ - Add native archive import/export and formula deletion, with explicit import
49
+ overwrite confirmation and a 10 MiB archive limit.
50
+ - Add server-side list sorting and formula dates/execution/document totals.
51
+
52
+ ## 0.28.0 - 2026-09-09
53
+
54
+ - Expose optional Fraud Detection API build identity on results through
55
+ `processor.apiVersion`, `processor.gitCommit`, and `processor.buildTime`.
56
+
57
+ ## 0.27.0 - 2026-09-08
58
+
59
+ - Expose optional physical-document provenance, logical-document identifiers,
60
+ and page ranges on execution document mappings.
61
+ - Preserve legacy execution mappings unchanged when source provenance is absent.
62
+
63
+ ## 0.26.0 - 2026-09-07
64
+
65
+ - Expose the exact numeric version that a new flow execution would use through
66
+ `getFlowMetadata`.
67
+
68
+ ## 0.25.0 - 2026-08-24
69
+
70
+ - Stream file-path inputs from disk instead of loading them completely into memory.
71
+ - Expose typed `413` and `503` upload errors, preserve `Retry-After`, and retry one
72
+ multipart admission `503` carrying that header with a fresh request body.
73
+
74
+ ## 0.24.0 - 2026-08-20
75
+
76
+ - Preserve the exact numeric flow version when mapping raw execution results.
77
+ - Expose each processing step's LLM model and immutable prompt identifier without
78
+ reintroducing token or cost telemetry.
79
+ - Update vulnerable HTTP and build-tool transitive dependencies to patched versions.
80
+
81
+ ## 0.23.0 - 2026-08-07
82
+
83
+ - Align the Fraud result with Consumer Edge's functional public contract.
84
+ - Keep verdict, confidence, reasoning, summary, findings, document id, and duration.
85
+ - Remove internal preprocessing, layer telemetry, model usage, token counts, costs,
86
+ and persistence diagnostics; finding categories remain available through `finding.layer`.
87
+
88
+ ## 0.22.0 - 2026-08-06
89
+
90
+ - Expose the complete Consumer Edge fraud-analysis telemetry: global totals,
91
+ preprocessing, verdict, and per-layer duration, token usage, LLM calls, model
92
+ usage, cost, and errors.
93
+ - Keep model usage Mongo-safe as `modelUsage[]` and continue excluding the
94
+ sensitive Fraud `document` payload.
95
+
96
+ ## 0.21.0 - 2026-08-05
97
+
98
+ - Relay the native Fraud job identifier through Consumer Edge while preserving
99
+ the existing high-level polling workflow.
100
+ - Add local file, named byte, and readable stream inputs to `detectFraud` and
101
+ `detectFraudAsync` through the existing `FileInput` contract.
102
+ - Stop sending organization correlation on Fraud requests. The deprecated
103
+ organization arguments remain accepted and ignored for source compatibility.
104
+ - Expose Consumer Edge's BI-friendly Fraud result contract: aggregate `summary`,
105
+ referenced `findings`, and detection `layers` keyed by their unique names.
106
+
107
+ ## 0.20.0 - 2026-08-04
108
+
109
+ - Add `detectFraud` to start a Consumer Edge fraud-detection job, poll its
110
+ status, and return the normalized verdict and findings.
111
+ - Add `detectFraudAsync`, `getFraudDetectionStatus`, and
112
+ `getFraudDetectionResult` for callers that manage polling themselves.
113
+ - Respect `X-Poll-After` and `Retry-After`, retry transient status failures,
114
+ and expose typed failure, timeout, and cancellation errors.
115
+
116
+ ## 0.19.0 - 2026-08-04
117
+
118
+ - Add synchronous and asynchronous V2 partial flow execution through Consumer Edge.
119
+ - Use `executionScope`, `flowVersion`, and `classificationNodeNames` in the
120
+ multipart body, leaving only `organization` in the query string.
121
+ - Return the standard `DocmanaExecutionResult` shape with optional
122
+ `partialExecution` metadata.
123
+
124
+ ## 0.18.0
125
+ - Expose the optional aggregate `verdict` on `DocmanaExecutionResult`, preserving
126
+ the `VALID`, `PARTIAL`, `WARNING`, `FAILED`, or `UNKNOWN` value computed by
127
+ Docmana API and returned by consumer-edge.
128
+
129
+ ## 0.17.0
130
+ - Expose the optional `flowVersion` on `DocmanaExecutionResult`, preserving the
131
+ exact Docmana flow version used by an execution in polling and callback results.
132
+
133
+ consu## 0.16.0
134
+ - Scope organization document access to a specific organization: `listOrganizationDocuments`
135
+ now accepts an `organization` option and `downloadOrganizationDocument(s)` an optional
136
+ `organization` argument, both forwarded as the `?organization=` query param (relayed to
137
+ docmana-api as `X-Selected-Organization`). Without it, consumer-edge reads the caller's
138
+ default organization depot, which leaks another org's documents to callers scoping by site.
139
+
140
+ ## 0.15.0
141
+ - Expose `rejectionCode`, `rejectionMessage`, `documentTypeProximity`, and
142
+ `documentContentNature` as optional system fields on node results instead of
143
+ including them in user-defined `data`.
144
+
145
+ ## 0.14.0
146
+ - Add the optional human-readable `label` to every mapped node result while
147
+ preserving the stable node name as the record key.
148
+ - Preserve the `REJECTED` status returned by classification nodes and expose it
149
+ in the public `ExecutionStatus` contract.
150
+ - Add document-level `preprocessing` results, including generated steps such as
151
+ `Document Extraction`, correlated to their document by `doc_key`.
152
+
153
+ ## 0.13.0
154
+ - Add normalized execution metrics to `DocmanaExecutionResult`:
155
+ `flowId`, `totalDocuments`, `totalPages`, `totalTokens`, `totalMana`, and
156
+ `totalRunningTime`.
157
+ - Add node-level execution metrics to mapped node results: `runningTime` and
158
+ `mana`.
159
+
160
+ ## 0.12.0
161
+ - Add `--context <json>` to `docmana flow run`, parsed as a JSON object and
162
+ passed through to `runFlow` as `RunFlowParams.context`.
163
+ - Return CLI usage errors when `--context` is invalid JSON or is not a JSON
164
+ object.
165
+
166
+ ## 0.11.0
167
+ - Normalize execution statuses to uppercase SDK values:
168
+ `PENDING`, `RUNNING`, `INCOMPLETED`, `COMPLETED`, and `FAILED`.
169
+ - Normalize raw API and polling statuses before checking terminal or failed
170
+ states, so legacy mixed-case values still map consistently.
171
+ - Rename flow metadata `contextSchema` to `jsonContextSchema` in the public
172
+ `FlowMetadata` shape and README examples.
173
+
174
+ ## 0.10.0
175
+ - Add an optional `organization` to flow selection, emitted as a
176
+ `?organization=<org>` query param on the request to
177
+ `docmana-consumer-edge-api`. Purely additive — existing calls are unchanged.
178
+ - `listFlows({ organization })`, `getFlowMetadata(flowId, { organization })`,
179
+ and `getFlowDefinition(flowId, { organization })` accept the option.
180
+ - `RunFlowParams` (and therefore `runFlow` / `runFlowAsync`) gains
181
+ `organization`, threaded onto the `execute-async` request URL.
182
+ - Expose `organization` on `FlowListItem`: when the consumer-edge tags a flow
183
+ with its organization, `listFlows()` now carries it through on each item.
184
+
185
+ ## 0.8.1
186
+ - Rename the multipart wire fields sent to `docmana-consumer-edge-api` from
187
+ `json_context` / `callback_url` to `jsonContext` / `callbackUrl`, matching the
188
+ edge-api DTOs that dropped their snake_case `@Expose` mappings. Public inputs
189
+ (`context`, `callbackUrl`) are unchanged.
190
+
191
+ ## 0.8.0
192
+ - Add organization document depot methods and CLI commands:
193
+ `listOrganizationDocuments()`, `downloadOrganizationDocument()`, and
194
+ `downloadOrganizationDocuments()`.
195
+ - Add `docmana organization document list/download`.
196
+ - Make `docmana organization document download --output` optional; default output
197
+ is `./{path}`.
198
+
199
+ ## 0.7.0
200
+ - Add `getFlowMetadata()` / `docmana flow metadata` for projected flow runtime
201
+ metadata from `docmana-consumer-edge-api`.
202
+ - Add `getFlowDefinition()` / `docmana flow definition` for normalized flow
203
+ graph definitions without exposing the Docmana ZIP export.
204
+
205
+ ## 0.6.0
206
+ - Add `listOrganizations()` and `docmana organization list` to list organizations
207
+ available through `docmana-consumer-edge-api`.
208
+
209
+ ## 0.5.0
210
+ - Add `listFlows()` to list flows available through `docmana-consumer-edge-api`,
211
+ returning `{ id, name, state }[]` with `state: "unknown"` when Docmana omits it.
212
+ - Add `docmana flow list` CLI command, with the same API URL and Bearer token resolution as `docmana flow run`.
213
+ - Rename `RunFlowInput` to `RunFlowParams` and move polling controls to
214
+ `RunFlowOptions`.
215
+ - Remove the single-file `file` shortcut from flow params; callers now pass
216
+ `files`.
217
+ - Remove `fileName` from flow params; byte and stream inputs now use
218
+ `{ data, filename, contentType? }`.
219
+ - Replace `runFlowWithCallback` with `runFlowAsync(..., { callbackUrl })`.
220
+
221
+ ## 0.3.5
222
+ - 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.
223
+
224
+ ## 0.3.3
225
+ - 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.
226
+
227
+ ## 0.3.2
228
+ - Add `scoreDescription` to score-node results (Validation, Classification, CrossValidation, Conclusion).
229
+ - 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.
230
+
231
+ ## 0.3.1
232
+ - 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).
233
+
234
+ ## 0.3.0
235
+ - Relocated mapper logic and tests to `src/mappers/`.
236
+ - Renamed SDK models to `DocmanaX` and API models to `DocmanaApiX` to distinguish raw backend types from clean public SDK types.
237
+ - Pluralized `classification` results into a `classifications` key-value record on document results.
238
+ - Nested dynamic extraction fields inside a dedicated `data` record on node results to prevent property name collisions.
239
+ - Restructured node result interfaces to remove `score` and `feedback` from `DocmanaExtractionResult` and `DocmanaMetadataExtractionResult` (via new `DocmanaScoreNodeResult` interface).
240
+ - Excluded internal fields `result` and `documentType` from mapped SDK results.
241
+
242
+ ## 0.2.2
243
+ - Fix `package-lock.json`.
244
+
245
+ ## 0.2.1
246
+ - 400 responses now throw `DocmanaRequestError` (was `DocmanaAuthError`); add `Incompleted` to `ExecutionStatus`.
247
+
248
+ ## 0.2.0
249
+ - `RunFlowParams.once` selects the ad-hoc `run_once_flow` endpoint (current/draft flow) instead of the published `run_flow`.
250
+ - `DocmanaConfig.headers` are sent on every API request (e.g. `X-Selected-Organization`), without overriding the bearer token or per-request headers.
251
+ - `FileInput` now accepts a plain `Uint8Array` (e.g. pdf-lib output) in addition to path, `Buffer`, and `Stream`.
252
+ - Uploads send a `Content-Type` inferred from the filename extension instead of always `application/octet-stream`.
253
+
254
+ ## 0.1.0
255
+ - Single-call `runFlow` orchestration: upload → run → poll → result.
256
+ - OAuth2 client-credentials auth with in-memory token cache and automatic refresh.
257
+ - Typed error hierarchy (`DocmanaError`, `DocmanaExecutionError`, …).
258
+ - Flexible file inputs: path, `Buffer`, `Stream`, and multi-file uploads.
259
+ - Dual ESM + CJS distribution with bundled type definitions.
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.