@uipath/du-utils 1.0.0-rc.1 → 1.0.0-rc.3

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
@@ -4,6 +4,64 @@ All notable consumer-facing changes to `@uipath/du-utils` are documented in this
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the package follows
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [1.0.0-rc.3] - 2026-10-01
8
+
9
+ Third release candidate for `1.0.0`. The loader functions and their options are unchanged. One
10
+ event payload changed: read **Changed** before upgrading.
11
+
12
+ > 🚀 This is a **release candidate**. Please report any issues before the stable release.
13
+
14
+ ### Changed
15
+
16
+ - **Breaking:** the `actionCenterTaskCompleteWithResult` detail is now
17
+ `{ taskId, processedDocument }` instead of `{ taskId, validatedExtractionResult }`. Complete the
18
+ task with `processedDocument` as its `data`, verbatim. Its shape belongs to the node downstream,
19
+ so pass it through without inspecting it.
20
+
21
+ ## [1.0.0-rc.2] - 2026-09-28
22
+
23
+ Second release candidate for `1.0.0`. The loader functions and their options are unchanged. The
24
+ web-component type contracts follow the components, and that includes one removed input: read
25
+ **Removed** before upgrading.
26
+
27
+ > 🚀 This is a **release candidate**. Please report any issues before the stable release.
28
+
29
+ ### Added
30
+
31
+ - **`processedDocument`** on the Validation Station element (`IValidationStationWcElement`): the
32
+ data contract a Flow Extract node emits, as an alternative to `contentValidationData`. Supply
33
+ one or the other; if both are set, `contentValidationData` wins. The contract is exported as
34
+ `ProcessedDocument` (with `ProcessedDocumentMetadata`, `ProcessedDocumentTaxonomy` and
35
+ `ProcessedDocumentType`), together with an `isProcessedDocument` type guard for telling task
36
+ data apart. Its `taxonomy` is the output JSON Schema itself.
37
+ - Two Validation Station events for documents supplied through `processedDocument`, fired
38
+ alongside the existing task events: `actionCenterTaskCompleteWithResult` (task id plus the
39
+ validated result) and `actionCenterTaskReportAsExceptionWithReason` (task id plus the reviewer's
40
+ reason).
41
+ - New `IValidationStationOptions` members, matching `@uipath/du-validation-station-wc`
42
+ `1.0.0-rc.2`: `fieldFilterOptions` (typed `FieldFilterOptions`), `defaultFieldsAreaPercentage` /
43
+ `defaultFieldsAreaWidth`, and `documentViewerOptions`.
44
+ - Two new `DocumentViewerFloatingButtonsOptions` flags: `hideExtractedTokensToggle` and
45
+ `hideLanguageSelect`.
46
+
47
+ ### Changed
48
+
49
+ - `CsContentValidationData.FolderId` and `FolderKey` are now optional. Supply at least one of
50
+ them; either alone identifies the Orchestrator folder.
51
+ - The `isValid` and `businessRulesEvaluated` descriptions now state that they carry value-level
52
+ validation errors as well as business rules.
53
+ - README: the deployment URL has to serve the component build's whole output, including the
54
+ `media/` and `du-assets/` directories, and `includeFonts` serves Material Icons only when the
55
+ base was assembled from a component's npm package.
56
+
57
+ ### Removed
58
+
59
+ - **`organizationUnitId` / `organization-unit-id`** is removed from `IValidationStationWcElement`,
60
+ `IClassificationStationWcElement` and their JSX prop types. It duplicated the Orchestrator folder
61
+ the document data already identifies, and the components now scope their calls from the
62
+ `ContentValidationData` instead. Drop the property, and make sure the content-validation data
63
+ carries `FolderId` or `FolderKey` (either one is enough).
64
+
7
65
  ## [1.0.0-rc.1] - 2026-07-24
8
66
 
9
67
  First release candidate for `1.0.0`.
package/README.md CHANGED
@@ -69,12 +69,23 @@ https://assets.example.com/du-vs-wc/latest/
69
69
  ├── main.js
70
70
  ├── polyfills.js
71
71
  ├── styles.css (theme — preloaded, adopted into the shadow root)
72
- └── fonts.css (opt-in — see `includeFonts`)
72
+ ├── fonts.css (opt-in — see `includeFonts`)
73
+ ├── media/ (the font binaries fonts.css references)
74
+ └── du-assets/ (runtime assets: pdf.js, translations, business-rules executor)
73
75
  ```
74
76
 
77
+ Deploy the component build's **entire** output at this URL, not just the
78
+ top-level files. `media/` and `du-assets/` are directories the component
79
+ fetches at runtime; if they are missing, the failures surface in the
80
+ browser with nothing reported at build time.
81
+
75
82
  Validation Station assets are produced by the
76
83
  [`@uipath/du-validation-station-wc`](https://www.npmjs.com/package/@uipath/du-validation-station-wc)
77
84
  build; Classification Station assets by the corresponding Classification Station web-component build.
85
+ A UiPath-hosted deployment serves the full `fonts.css` (Apollo text fonts + Material Icons). Those
86
+ npm packages are built differently — their `fonts.css` carries **Material Icons only** — so a base
87
+ you assemble by copying files out of one of them still serves `includeFonts` correctly, it just
88
+ supplies the icons rather than the whole Apollo set.
78
89
 
79
90
  ### Options
80
91
 
@@ -84,7 +95,13 @@ await loadValidationStationWebComponent(document, deploymentUrl, { includeFonts:
84
95
 
85
96
  | Option | Default | Description |
86
97
  |---|---|---|
87
- | `includeFonts` | `false` | Inject a light-DOM `<link rel="stylesheet">` to the component's `fonts.css` (Apollo text fonts + Material Icons). Leave `false` when the host already loads Apollo fonts globally (e.g. Action Center, DU Center) to avoid double-loading. |
98
+ | `includeFonts` | `false` | Inject a light-DOM `<link rel="stylesheet">` to the component's `fonts.css`. Requires both `fonts.css` **and** the sibling `media/` directory it references to be served at the deployment URL. What you get depends on how that base was built: a UiPath-hosted deployment serves Apollo text fonts + Material Icons, while a base assembled from the component's npm package serves Material Icons only. Leave it `false` when the host already loads Apollo globally (e.g. Action Center, DU Center) to avoid double-loading. |
99
+
100
+ > **With `includeFonts: false` the loader injects no fonts at all — including the icon font.**
101
+ > That is correct for hosts that already load Apollo globally (Action Center, DU Center),
102
+ > because Apollo's `font.css` contains Material Icons. A host that loads neither will render
103
+ > every icon as its ligature text (`menu`, `close`, …) — set `includeFonts: true`, or link
104
+ > the deployment's `fonts.css` yourself.
88
105
 
89
106
  ### Idempotency & caching
90
107
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/du-utils",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "Framework-agnostic loaders and TypeScript contracts for embedding the UiPath Document Understanding web components (Validation Station and Classification Station).",
5
5
  "keywords": [
6
6
  "uipath",
@@ -1,8 +1,13 @@
1
1
  export interface CsContentValidationData {
2
2
  BucketName: string;
3
3
  BucketId: number;
4
- FolderId: number;
5
- FolderKey: string;
4
+ /**
5
+ * The Orchestrator folder holding the storage bucket, addressable by id or by key.
6
+ * Supply at least one of `FolderId` / `FolderKey`; either one alone is enough.
7
+ */
8
+ FolderId?: number;
9
+ /** See {@link CsContentValidationData.FolderId}. */
10
+ FolderKey?: string;
6
11
  DocumentId: string;
7
12
  DocumentPath: string;
8
13
  EncodedDocumentPath: string;
@@ -69,8 +74,6 @@ export interface IClassificationStationWcElement extends HTMLElement {
69
74
  contentValidationData: CsContentValidationData | undefined;
70
75
  /** Action Center task ID associated with the document. */
71
76
  actionCenterTaskId: number | null;
72
- /** Organization unit ID for scoped API calls. */
73
- organizationUnitId: number | null;
74
77
  /** Visual theme applied to the component. @default 'light' */
75
78
  theme: 'light' | 'dark' | 'light-hc' | 'dark-hc';
76
79
  /** BCP-47 language code for the UI. @default 'en' */
@@ -112,9 +115,8 @@ export interface IClassificationStationWcElement extends HTMLElement {
112
115
  * - Boolean inputs (`isReadonly`/`is-readonly`, `enableSaveAsDraft`/`enable-save-as-draft`)
113
116
  * use `booleanAttribute` transform, so both camelCase JS property and kebab-case
114
117
  * attribute forms work correctly.
115
- * - Numeric inputs (`actionCenterTaskId`/`action-center-task-id`,
116
- * `organizationUnitId`/`organization-unit-id`) use a number coercion transform,
117
- * so both camelCase JS property and kebab-case attribute forms work correctly.
118
+ * - Numeric inputs (`actionCenterTaskId`/`action-center-task-id`) use a number coercion
119
+ * transform, so both camelCase JS property and kebab-case attribute forms work correctly.
118
120
  * - Complex object props (`platform`, `contentValidationData`, `pdfSettings`) must
119
121
  * be set via a ref as JS properties, because React 18 serialises JSX props as
120
122
  * HTML attributes and Angular Elements cannot deserialise JSON strings back into
@@ -143,10 +145,6 @@ export interface IClassificationStationWcJsxProps {
143
145
  actionCenterTaskId?: number | null;
144
146
  /** Attribute form (kebab-case). Coerced via `numberAttribute` transform. */
145
147
  'action-center-task-id'?: number | null;
146
- /** JS property form. */
147
- organizationUnitId?: number | null;
148
- /** Attribute form (kebab-case). Coerced via `numberAttribute` transform. */
149
- 'organization-unit-id'?: number | null;
150
148
  platform?: {
151
149
  organizationName: string;
152
150
  tenantId: string;
@@ -1,4 +1,5 @@
1
1
  export * from './types';
2
2
  export * from './wc-lifecycle';
3
+ export * from './processed-document';
3
4
  export * from './validation-station-wc';
4
5
  export * from './classification-station-wc';
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./types"), exports);
5
5
  tslib_1.__exportStar(require("./wc-lifecycle"), exports);
6
+ tslib_1.__exportStar(require("./processed-document"), exports);
6
7
  tslib_1.__exportStar(require("./validation-station-wc"), exports);
7
8
  tslib_1.__exportStar(require("./classification-station-wc"), exports);
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/du/shared/util/du-utils/src/lib/shared/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,yDAA+B;AAC/B,kEAAwC;AACxC,sEAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/du/shared/util/du-utils/src/lib/shared/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,yDAA+B;AAC/B,+DAAqC;AACrC,kEAAwC;AACxC,sEAA4C"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Everything describing the run and the document that produced a {@link ProcessedDocument} —
3
+ * the identifiers a consumer calls back into the platform with.
4
+ *
5
+ * Never carries extracted data (that is {@link ProcessedDocument.result}), the schema
6
+ * ({@link ProcessedDocument.taxonomy}), or anything that must be interpreted to render the
7
+ * document. It is the contract's extension point: new run/document descriptors land here
8
+ * additively, gated by {@link ProcessedDocument.version}.
9
+ */
10
+ export interface ProcessedDocumentMetadata {
11
+ /**
12
+ * GUID of the IDP pipeline run that produced this output. Correlation only — it ties the
13
+ * output back to the Processor run surface for support and debugging, and is *not* the way
14
+ * to reach the trace or the artifacts (that is {@link traceId}).
15
+ */
16
+ pipelineRunId: string;
17
+ /**
18
+ * Folder the producing run executed in — the `x-uipath-folderkey` for the Traces, Buckets
19
+ * and Feedback calls. Not necessarily the HITL task's own folder, which is why it travels
20
+ * in the contract.
21
+ */
22
+ folderKey: string;
23
+ /**
24
+ * The producing run's W3C trace id — the key to everything that is not in this contract.
25
+ * Consumers query the Traces service with it for the run's spans, whose attachments
26
+ * reference the document, DOM and OCR-text artifacts.
27
+ */
28
+ traceId: string;
29
+ /**
30
+ * The producing `idpExtraction` span — the anchor a validated result is bound to. Because it
31
+ * travels here, binding needs no trace lookup.
32
+ */
33
+ spanId: string;
34
+ }
35
+ /**
36
+ * Which processor produced the {@link ProcessedDocument}, and therefore how to interpret its
37
+ * {@link ProcessedDocument.result} and {@link ProcessedDocument.taxonomy}.
38
+ */
39
+ export type ProcessedDocumentType = 'Extraction' | 'Classification' | 'Summarization';
40
+ /**
41
+ * The processor's schema — the one the results were produced against.
42
+ */
43
+ export interface ProcessedDocumentTaxonomy {
44
+ /** The document's fields and field groups, keyed by display name. */
45
+ properties?: Record<string, unknown>;
46
+ /** The field types the {@link properties} `$ref`. */
47
+ $defs?: Record<string, unknown>;
48
+ /** The root schema type, `object` for an extraction. */
49
+ type?: string | string[];
50
+ /** The names of the {@link properties} the processor always emits. */
51
+ required?: string[];
52
+ /** Whether the output may carry fields beyond {@link properties}; `false` for an extraction. */
53
+ additionalProperties?: boolean;
54
+ }
55
+ /**
56
+ * The unified IDP node data contract: the single object the IDP processor nodes (Extract,
57
+ * Classify) emit and the HITL validation nodes accept.
58
+ *
59
+ * In Action Center it arrives as a `DocumentValidationTask`'s data, and the host sets it on
60
+ * {@link IValidationStationWcElement.processedDocument} in place of
61
+ * {@link ContentValidationData}.
62
+ *
63
+ * Artifacts — the document, its DOM and its OCR text — are deliberately *not* part of it. They
64
+ * are produced into an execution-scoped stage bucket and resolved from the producing run's trace
65
+ * via {@link ProcessedDocumentMetadata.traceId}.
66
+ */
67
+ export interface ProcessedDocument {
68
+ /** Output contract version, for forward evolution and backwards-compatibility handling. */
69
+ version: string;
70
+ /** The discriminator consumers switch on. See {@link ProcessedDocumentType}. */
71
+ type: ProcessedDocumentType;
72
+ /**
73
+ * The engine output, verbatim.
74
+ *
75
+ * For `Extraction` that is the extracted values plus an `attribution` sidecar keyed by
76
+ * RFC 6901 JSON Pointer, one entry per leaf. Typed loosely for the same reason as
77
+ * {@link ProcessedDocumentTaxonomy}'s fields.
78
+ */
79
+ result: unknown;
80
+ /** The schema the results were produced against. */
81
+ taxonomy: ProcessedDocumentTaxonomy;
82
+ /** The run and document identifiers. See {@link ProcessedDocumentMetadata}. */
83
+ metadata: ProcessedDocumentMetadata;
84
+ }
85
+ /**
86
+ * Whether a task payload is a {@link ProcessedDocument} rather than a
87
+ * {@link ContentValidationData}, so a host can pick the matching Validation Station input.
88
+ *
89
+ * Tests positively for the `ProcessedDocument` shape: a `ContentValidationData` is PascalCase
90
+ * throughout and can never match, so the classic payload stays the fallback. It identifies the
91
+ * envelope only — whether the station supports a given {@link ProcessedDocument.type} is the
92
+ * station's own answer.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const payload: unknown = task.data;
97
+ * if (isProcessedDocument(payload)) {
98
+ * element.processedDocument = payload;
99
+ * } else {
100
+ * element.contentValidationData = payload as ContentValidationData;
101
+ * }
102
+ * ```
103
+ */
104
+ export declare const isProcessedDocument: (payload: unknown) => payload is ProcessedDocument;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isProcessedDocument = void 0;
4
+ /**
5
+ * Whether a task payload is a {@link ProcessedDocument} rather than a
6
+ * {@link ContentValidationData}, so a host can pick the matching Validation Station input.
7
+ *
8
+ * Tests positively for the `ProcessedDocument` shape: a `ContentValidationData` is PascalCase
9
+ * throughout and can never match, so the classic payload stays the fallback. It identifies the
10
+ * envelope only — whether the station supports a given {@link ProcessedDocument.type} is the
11
+ * station's own answer.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const payload: unknown = task.data;
16
+ * if (isProcessedDocument(payload)) {
17
+ * element.processedDocument = payload;
18
+ * } else {
19
+ * element.contentValidationData = payload as ContentValidationData;
20
+ * }
21
+ * ```
22
+ */
23
+ const isProcessedDocument = (payload) => !!payload
24
+ && typeof payload === 'object'
25
+ && 'result' in payload
26
+ && 'taxonomy' in payload
27
+ && 'metadata' in payload;
28
+ exports.isProcessedDocument = isProcessedDocument;
29
+ //# sourceMappingURL=processed-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processed-document.js","sourceRoot":"","sources":["../../../../../../../../../libs/du/shared/util/du-utils/src/lib/shared/processed-document.ts"],"names":[],"mappings":";;;AAyFA;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAgC,EAAE,CAClF,CAAC,CAAC,OAAO;OACN,OAAO,OAAO,KAAK,QAAQ;OAC3B,QAAQ,IAAI,OAAO;OACnB,UAAU,IAAI,OAAO;OACrB,UAAU,IAAI,OAAO,CAAC;AALhB,QAAA,mBAAmB,uBAKH"}
@@ -1,4 +1,5 @@
1
1
  import type { ContentValidationData, Criticality, DocumentTaxonomy, ExtractionResult, LogicalOperator, ResultsDataPoint, ResultsValue } from '@uipath/uipath-typescript/document-understanding';
2
+ import type { ProcessedDocument } from './processed-document';
2
3
  export type { ContentValidationData };
3
4
  /**
4
5
  * The details of the selected field and value.
@@ -42,19 +43,93 @@ export interface EvaluatedBusinessRuleDetailsDto {
42
43
  RuleMessage: string;
43
44
  IsValid: boolean;
44
45
  }
46
+ /**
47
+ * Controls the field-filter toolbar of the compact fields form — the `Hide fields` menu, the
48
+ * field search and the reset button.
49
+ *
50
+ * Every flag only ever removes UI. A hidden hide-filter also stops filtering: a value persisted
51
+ * from an earlier session is ignored rather than left applied with no control left to clear it.
52
+ * `hideBar` removes the whole toolbar and makes search/selection filtering inert with it, so the
53
+ * individual hide-filter flags are only needed to trim a toolbar that stays visible. Hiding all
54
+ * three hide-filters drops the `Hide fields` menu button, leaving search and reset.
55
+ *
56
+ * @example Keep the toolbar, drop two of its hide-filters
57
+ * ```ts
58
+ * element.options = {
59
+ * fieldFilterOptions: {
60
+ * hideConfirmed: true,
61
+ * hideNotExtracted: true,
62
+ * },
63
+ * };
64
+ * ```
65
+ *
66
+ * @example Remove the toolbar entirely
67
+ * ```ts
68
+ * element.options = { fieldFilterOptions: { hideBar: true } };
69
+ * ```
70
+ */
71
+ export interface FieldFilterOptions {
72
+ /** Hides the entire field-filter toolbar and stops all field filtering. */
73
+ hideBar?: boolean;
74
+ /** Hides the `Confirmed` entry of the `Hide fields` menu. */
75
+ hideConfirmed?: boolean;
76
+ /** Hides the `Not extracted` entry of the `Hide fields` menu. */
77
+ hideNotExtracted?: boolean;
78
+ /** Hides the `With no flagged issues` entry of the `Hide fields` menu. */
79
+ hideNoFlaggedIssues?: boolean;
80
+ }
45
81
  export interface IValidationStationOptions {
46
82
  hideSubmitButton?: boolean;
47
83
  hideReportAsExceptionButton?: boolean;
84
+ /** Hides the document type field. Defaults to `true` for a Flow input, `false` otherwise. */
48
85
  hideDocumentTypeField?: boolean;
49
86
  hideFields?: boolean;
50
87
  hideBusinessRules?: boolean;
51
88
  fieldsSectionPosition?: 'left' | 'right';
89
+ /**
90
+ * Trims or removes the compact fields form's field-filter toolbar.
91
+ *
92
+ * @example
93
+ * options = { fieldFilterOptions: { hideBar: true } };
94
+ */
95
+ fieldFilterOptions?: FieldFilterOptions;
52
96
  enableUserPreferences?: boolean;
53
97
  userPreferencesKeySuffix?: string;
98
+ /**
99
+ * Width the fields panel starts at, as a percentage (0-100) of the component.
100
+ * Takes precedence over `defaultFieldsAreaWidth`.
101
+ *
102
+ * A width the user has already dragged wins over both, and the panel is always
103
+ * kept within 30-80% of the component.
104
+ *
105
+ * @example
106
+ * options = { defaultFieldsAreaPercentage: 40 }; // 40% fields, 60% document viewer
107
+ */
108
+ defaultFieldsAreaPercentage?: number;
109
+ /**
110
+ * Width the fields panel starts at, in pixels. Ignored when
111
+ * `defaultFieldsAreaPercentage` is set.
112
+ *
113
+ * @example
114
+ * options = { defaultFieldsAreaWidth: 576 };
115
+ */
116
+ defaultFieldsAreaWidth?: number;
54
117
  /**
55
118
  * If true, extractionResultChanged output will emit the internal state mapped to ExtractionResult on each internal state change
56
119
  */
57
120
  emitDtoStateChanges?: boolean;
121
+ /**
122
+ * Configuration for the embedded document viewer. Same shape the standalone
123
+ * document-viewer element accepts, so one object drives both.
124
+ *
125
+ * @example
126
+ * options = {
127
+ * documentViewerOptions: {
128
+ * floatingButtonsOptions: { hideLanguageSelect: true, hideSearch: true },
129
+ * },
130
+ * };
131
+ */
132
+ documentViewerOptions?: DocumentViewerOptions;
58
133
  }
59
134
  export interface DocumentViewerOptions {
60
135
  floatingButtonsOptions?: DocumentViewerFloatingButtonsOptions;
@@ -81,6 +156,16 @@ export interface DocumentViewerFloatingButtonsOptions {
81
156
  hideSwitchPanelSidesButton?: boolean;
82
157
  hideKeyboardShortcutsButton?: boolean;
83
158
  hideSearch?: boolean;
159
+ /**
160
+ * Hides the show/hide extracted-tokens entry from the viewer's burger menu,
161
+ * and disables the keyboard shortcut that toggles it.
162
+ */
163
+ hideExtractedTokensToggle?: boolean;
164
+ /**
165
+ * Hides the language dropdown entirely. Distinct from the
166
+ * `DisableLanguageSelection` customization, which leaves it visible but disabled.
167
+ */
168
+ hideLanguageSelect?: boolean;
84
169
  }
85
170
  export declare enum InteractionType {
86
171
  Tokens = "Tokens",
@@ -236,15 +321,28 @@ export interface IVsWcSharedEventMap {
236
321
  dirty: boolean;
237
322
  /** Fires when the user changes the document type. Detail is the new document type ID. */
238
323
  documentTypeChanged: string;
239
- /** Fires on every extraction result change when IValidationStationOptions.emitDtoStateChanges is true. */
324
+ /**
325
+ * Fires on every extraction result change when IValidationStationOptions.emitDtoStateChanges
326
+ * is true. `ResultsDocument.Tables` and `BusinessRulesResults` are never kept in sync with the
327
+ * reviewer's edits — read tables from `ResultsDocument.Fields` and rule results from the
328
+ * `businessRulesEvaluated` event instead.
329
+ */
240
330
  extractionResultChanged: ExtractionResult;
241
331
  /** Fires when the user selects a field value. */
242
332
  fieldValueSelected: IFieldValueDetailsDto;
243
333
  /** Fires when the user edits a field value. */
244
334
  fieldValueChanged: IFieldValueDetailsDto;
245
- /** Fires after business rules are evaluated. */
335
+ /**
336
+ * Fires after validation state is re-evaluated. Carries field-level validation errors as well
337
+ * as business rules, always stamped `Criticality: Must`; a rule set that merges with one is
338
+ * forced to `Must` / `AND`. Nothing in the payload distinguishes the two sources.
339
+ */
246
340
  businessRulesEvaluated: EvaluatedBusinessRulesForFieldValueDto[];
247
- /** Fires when the component's validity changes. Detail is true when there are no critical (Must) invalid business rules. */
341
+ /**
342
+ * Fires when the component's validity changes. `true` when no `Must` rule set and no
343
+ * field-level validation error is broken; a document with no business rules configured can
344
+ * still emit `false`.
345
+ */
248
346
  isValid: boolean;
249
347
  /** Fires when the fields panel width changes. Detail is the width in pixels. */
250
348
  fieldsPanelWidthChanged: number;
@@ -280,8 +378,37 @@ export interface IValidationStationWcEventMap extends IVsWcSharedEventMap {
280
378
  extractionResultLoaded: ExtractionResult;
281
379
  /** Fires when the Action Center task has been submitted successfully. Detail is the task ID. */
282
380
  actionCenterTaskComplete: number;
381
+ /**
382
+ * Fires alongside `actionCenterTaskComplete` when the document came from a `processedDocument`,
383
+ * carrying the reviewer's result as well as the task id.
384
+ *
385
+ * Complete the task with `processedDocument` as its `data`, verbatim: a downstream node reads
386
+ * the completed task's data as its output, so a completion without it produces nothing. Its
387
+ * shape belongs to the node downstream, not to this contract, so pass it through without
388
+ * inspecting it — today it is the `processedDocument` the station was given, with its `result`
389
+ * replaced by the reviewer's.
390
+ *
391
+ * A classic `contentValidationData` document fires only `actionCenterTaskComplete`, since it
392
+ * persists its own result and the task needs no data.
393
+ */
394
+ actionCenterTaskCompleteWithResult: {
395
+ taskId: number;
396
+ processedDocument: unknown;
397
+ };
283
398
  /** Fires when the Action Center task has been reported as exception. Detail is the task ID. */
284
399
  actionCenterTaskReportAsException: number;
400
+ /**
401
+ * Fires alongside `actionCenterTaskReportAsException` when the document came from a
402
+ * `processedDocument`, carrying the reviewer's reason as well as the task id.
403
+ *
404
+ * Complete the task with an action that marks it rejected rather than validated, and the
405
+ * reason as its data: the reviewer produced no result, so the node downstream raises its
406
+ * document-reported-as-exception error instead of an output.
407
+ */
408
+ actionCenterTaskReportAsExceptionWithReason: {
409
+ taskId: number;
410
+ reason: string;
411
+ };
285
412
  }
286
413
  /**
287
414
  * Internal base for the VS element interface.
@@ -366,10 +493,18 @@ export interface IValidationStationWcElement extends IVsWcBaseElement<IValidatio
366
493
  * Set as a JS property (not an HTML attribute) for complex object values.
367
494
  */
368
495
  contentValidationData: ContentValidationData | undefined;
496
+ /**
497
+ * The unified IDP node data contract, as emitted by a Flow Extract node — an alternative to
498
+ * `contentValidationData`. Supply one or the other; a document is described by one shape or
499
+ * the other and never both. If both are set, `contentValidationData` wins.
500
+ *
501
+ * Unlike `contentValidationData`, it carries the taxonomy and the extraction result inline,
502
+ * so those are not fetched; the document, DOM and OCR text are resolved from the producing
503
+ * run's trace. Set as a JS property (not an HTML attribute) for complex object values.
504
+ */
505
+ processedDocument: ProcessedDocument | undefined;
369
506
  /** Action Center task ID associated with the document. */
370
507
  actionCenterTaskId: number | null;
371
- /** Organization unit ID for scoped API calls. */
372
- organizationUnitId: number | null;
373
508
  }
374
509
  /**
375
510
  * Extends IValidationStationWcElement with an explicit teardown method.
@@ -438,13 +573,12 @@ export interface IVsWcSharedJsxProps {
438
573
  * - Boolean inputs (`isReadonly`/`is-readonly`, `enableSaveAsDraft`/`enable-save-as-draft`)
439
574
  * use `booleanAttribute` transform, so both camelCase JS property and kebab-case
440
575
  * attribute forms work correctly.
441
- * - Numeric inputs (`actionCenterTaskId`/`action-center-task-id`,
442
- * `organizationUnitId`/`organization-unit-id`) use a number coercion transform,
443
- * so both camelCase JS property and kebab-case attribute forms work correctly.
444
- * - Complex object props (`platform`, `contentValidationData`, `options`, and all
445
- * command payloads) must be set via a ref as JS properties, because React 18
446
- * serialises JSX props as HTML attributes and Angular Elements cannot deserialise
447
- * JSON strings back into objects.
576
+ * - Numeric inputs (`actionCenterTaskId`/`action-center-task-id`) use a number coercion
577
+ * transform, so both camelCase JS property and kebab-case attribute forms work correctly.
578
+ * - Complex object props (`platform`, `contentValidationData`, `processedDocument`,
579
+ * `options`, and all command payloads) must be set via a ref as JS properties,
580
+ * because React 18 serialises JSX props as HTML attributes and Angular Elements
581
+ * cannot deserialise JSON strings back into objects.
448
582
  *
449
583
  * React 19:
450
584
  * - Supports passing props as JS properties from JSX. Complex objects can be
@@ -459,15 +593,12 @@ export interface IValidationStationWcJsxProps extends IVsWcSharedJsxProps {
459
593
  actionCenterTaskId?: number | null;
460
594
  /** Attribute form (kebab-case). Coerced via `numberAttribute` transform. */
461
595
  'action-center-task-id'?: number | null;
462
- /** JS property form. */
463
- organizationUnitId?: number | null;
464
- /** Attribute form (kebab-case). Coerced via `numberAttribute` transform. */
465
- 'organization-unit-id'?: number | null;
466
596
  platform?: {
467
597
  organizationName: string;
468
598
  tenantId: string;
469
599
  };
470
600
  contentValidationData?: ContentValidationData;
601
+ processedDocument?: ProcessedDocument;
471
602
  }
472
603
  /** Props for <ui-du-validation-station-wc-persistent-element> in React JSX. */
473
604
  export type IPersistentValidationStationWcJsxProps = IValidationStationWcJsxProps;
@@ -1 +1 @@
1
- {"version":3,"file":"validation-station-wc.js","sourceRoot":"","sources":["../../../../../../../../../libs/du/shared/util/du-utils/src/lib/shared/validation-station-wc.ts"],"names":[],"mappings":";;;AA2HA,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,4CAAyB,CAAA;IACzB,gCAAa,CAAA;AACjB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
1
+ {"version":3,"file":"validation-station-wc.js","sourceRoot":"","sources":["../../../../../../../../../libs/du/shared/util/du-utils/src/lib/shared/validation-station-wc.ts"],"names":[],"mappings":";;;AAwNA,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,4CAAyB,CAAA;IACzB,gCAAa,CAAA;AACjB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}