@uipath/maestro-builder-sdk 6.18.9 → 6.19.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/dist/api-index.md +185 -184
- package/dist/api-members.md +504 -473
- package/dist/bpmn/uipath-moddle.v1.json +5 -0
- package/dist/case/decompile-cli.js +2 -8
- package/dist/check.js +177 -650
- package/dist/core/actions.d.ts +119 -760
- package/dist/core/actions.js +0 -306
- package/dist/core/error-port.d.ts +6 -0
- package/dist/core/error-port.js +9 -0
- package/dist/core/node-classes.d.ts +4 -63
- package/dist/core/node-classes.js +0 -112
- package/dist/core/nodes/family.d.ts +36 -0
- package/dist/core/nodes/family.js +1 -0
- package/dist/core/nodes/node-type.d.ts +136 -0
- package/dist/core/nodes/node-type.js +1 -0
- package/dist/core/nodes/registry.d.ts +57 -0
- package/dist/core/nodes/registry.js +122 -0
- package/dist/core/nodes/versioned.d.ts +50 -0
- package/dist/core/nodes/versioned.js +46 -0
- package/dist/core/typed-raw-node.d.ts +13 -62
- package/dist/core/typed-raw-node.js +40 -154
- package/dist/decompile-cli.js +2 -9
- package/dist/decompile.js +92 -271
- package/dist/flow-definitions.d.ts +10 -0
- package/dist/flow-definitions.js +35 -0
- package/dist/flow-node-registry.d.ts +13 -0
- package/dist/flow-node-registry.js +19 -0
- package/dist/flow-node-type.d.ts +192 -0
- package/dist/flow-node-type.js +1 -0
- package/dist/flow-sdk.d.ts +7 -0
- package/dist/flow-sdk.js +8 -0
- package/dist/nodes/data-fabric/flow/check.d.ts +13 -0
- package/dist/nodes/data-fabric/flow/check.js +164 -0
- package/dist/nodes/data-fabric/flow/factories.d.ts +113 -0
- package/dist/nodes/data-fabric/flow/factories.js +134 -0
- package/dist/nodes/data-fabric/flow/family.d.ts +7 -0
- package/dist/nodes/data-fabric/flow/family.js +9 -0
- package/dist/nodes/data-fabric/flow/index.d.ts +8 -0
- package/dist/nodes/data-fabric/flow/index.js +8 -0
- package/dist/nodes/data-fabric/flow/raw.d.ts +32 -0
- package/dist/nodes/data-fabric/flow/raw.js +100 -0
- package/dist/nodes/data-fabric/flow/shared.d.ts +77 -0
- package/dist/nodes/data-fabric/flow/shared.js +174 -0
- package/dist/nodes/data-fabric/flow/spec.d.ts +238 -0
- package/dist/nodes/data-fabric/flow/spec.js +1 -0
- package/dist/nodes/data-fabric/flow/verbs.d.ts +29 -0
- package/dist/nodes/data-fabric/flow/verbs.js +239 -0
- package/dist/nodes/delay/flow/check.d.ts +16 -0
- package/dist/nodes/delay/flow/check.js +86 -0
- package/dist/nodes/delay/flow/factories.d.ts +28 -0
- package/dist/nodes/delay/flow/factories.js +38 -0
- package/dist/nodes/delay/flow/family.d.ts +3 -0
- package/dist/nodes/delay/flow/family.js +8 -0
- package/dist/nodes/delay/flow/index.d.ts +3 -0
- package/dist/nodes/delay/flow/index.js +3 -0
- package/dist/nodes/delay/flow/node-type.d.ts +13 -0
- package/dist/nodes/delay/flow/node-type.js +71 -0
- package/dist/nodes/delay/flow/spec.d.ts +43 -0
- package/dist/nodes/delay/flow/spec.js +16 -0
- package/dist/nodes/document/flow/factories.d.ts +27 -0
- package/dist/nodes/document/flow/factories.js +30 -0
- package/dist/nodes/document/flow/family.d.ts +3 -0
- package/dist/nodes/document/flow/family.js +7 -0
- package/dist/nodes/document/flow/index.d.ts +3 -0
- package/dist/nodes/document/flow/index.js +3 -0
- package/dist/nodes/document/flow/node-type.d.ts +14 -0
- package/dist/nodes/document/flow/node-type.js +150 -0
- package/dist/nodes/document/flow/spec.d.ts +65 -0
- package/dist/nodes/document/flow/spec.js +1 -0
- package/dist/nodes/mock/flow/factories.d.ts +51 -0
- package/dist/nodes/mock/flow/factories.js +47 -0
- package/dist/nodes/mock/flow/family.d.ts +3 -0
- package/dist/nodes/mock/flow/family.js +7 -0
- package/dist/nodes/mock/flow/index.d.ts +2 -0
- package/dist/nodes/mock/flow/index.js +2 -0
- package/dist/nodes/mock/flow/node-type.d.ts +11 -0
- package/dist/nodes/mock/flow/node-type.js +51 -0
- package/dist/nodes/script/flow/check.d.ts +19 -0
- package/dist/nodes/script/flow/check.js +49 -0
- package/dist/nodes/script/flow/factories.d.ts +14 -0
- package/dist/nodes/script/flow/factories.js +15 -0
- package/dist/nodes/script/flow/family.d.ts +3 -0
- package/dist/nodes/script/flow/family.js +8 -0
- package/dist/nodes/script/flow/index.d.ts +3 -0
- package/dist/nodes/script/flow/index.js +3 -0
- package/dist/nodes/script/flow/node-type.d.ts +7 -0
- package/dist/nodes/script/flow/node-type.js +125 -0
- package/dist/nodes/script/flow/spec.d.ts +52 -0
- package/dist/nodes/script/flow/spec.js +1 -0
- package/dist/nodes/transform/flow/check.d.ts +6 -0
- package/dist/nodes/transform/flow/check.js +229 -0
- package/dist/nodes/transform/flow/factories.d.ts +52 -0
- package/dist/nodes/transform/flow/factories.js +53 -0
- package/dist/nodes/transform/flow/family.d.ts +3 -0
- package/dist/nodes/transform/flow/family.js +8 -0
- package/dist/nodes/transform/flow/index.d.ts +3 -0
- package/dist/nodes/transform/flow/index.js +3 -0
- package/dist/nodes/transform/flow/node-type.d.ts +7 -0
- package/dist/nodes/transform/flow/node-type.js +244 -0
- package/dist/nodes/transform/flow/spec.d.ts +116 -0
- package/dist/nodes/transform/flow/spec.js +10 -0
- package/dist/raw-node-advice.d.ts +16 -0
- package/dist/raw-node-advice.js +36 -0
- package/dist/raw-node.d.ts +71 -0
- package/dist/raw-node.js +116 -0
- package/dist/registry/uip/launch.d.ts +11 -1
- package/dist/registry/uip/launch.js +50 -43
- package/dist/registry/uip/pipeline-front-door.d.ts +2 -0
- package/dist/registry/uip/pipeline-front-door.js +88 -0
- package/dist/serialize.js +138 -492
- package/package.json +2 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Delay factory, `delay()`. Moved from core/actions.ts in Phase 4 of
|
|
3
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the package entry re-exports it.
|
|
4
|
+
*/
|
|
5
|
+
import { builtinActionSpec } from '../../../core/actions.js';
|
|
6
|
+
/**
|
|
7
|
+
* Declare a delay — a step that pauses the flow for a fixed length of time and
|
|
8
|
+
* then carries on.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* A delay produces nothing: there is no `out('settle')` to read. It is a wait,
|
|
12
|
+
* not a value.
|
|
13
|
+
*
|
|
14
|
+
* The node itself splits that one duration across two fields (`timerPreset`
|
|
15
|
+
* holds it directly, or the literal `"custom"` with the real value in
|
|
16
|
+
* `timerValue`); the serializer picks the encoding, so you state the wait once.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* **Wait thirty seconds before carrying on**
|
|
20
|
+
* ```ts
|
|
21
|
+
* .step('settle', delay({ duration: 'PT30S' }))
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param inputs - How long to wait (`duration`), as an ISO-8601 duration.
|
|
25
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
26
|
+
*/
|
|
27
|
+
export function delay(inputs) {
|
|
28
|
+
// Key presence, not value shape: `{ duration: undefined }` picks the
|
|
29
|
+
// duration arm and flows to check()'s DELAY_NO_DURATION diagnostic — the
|
|
30
|
+
// factory only rejects picking BOTH arms or NEITHER.
|
|
31
|
+
const hasDuration = 'duration' in inputs;
|
|
32
|
+
const hasUntil = 'until' in inputs;
|
|
33
|
+
if (hasDuration === hasUntil) {
|
|
34
|
+
throw new Error("delay() takes exactly ONE of { duration } (an ISO-8601 duration, e.g. 'PT15M') or "
|
|
35
|
+
+ "{ until } (an ISO-8601 date-time, e.g. '2026-09-01T09:00:00Z').");
|
|
36
|
+
}
|
|
37
|
+
return builtinActionSpec({ kind: 'delay', inputs });
|
|
38
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Delay node type, `core.logic.delay` (bundled 1.0.0 and 1.0). Moved from
|
|
3
|
+
* serialize.ts / check.ts / decompile.ts in Phase 4 of
|
|
4
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; serialized output, codes and messages
|
|
5
|
+
* unchanged.
|
|
6
|
+
*/
|
|
7
|
+
import type { FlowVersionedNodeType } from '../../../flow-node-type.js';
|
|
8
|
+
import { type DelayInputs } from './spec.js';
|
|
9
|
+
export type DelaySpec = {
|
|
10
|
+
kind: 'delay';
|
|
11
|
+
inputs: DelayInputs;
|
|
12
|
+
};
|
|
13
|
+
export declare const delayNodeType: FlowVersionedNodeType<DelaySpec>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { DELAY_PRESETS } from './spec.js';
|
|
2
|
+
import { checkDelay } from './check.js';
|
|
3
|
+
/**
|
|
4
|
+
* Encode a delay's single `duration` into the two inputs the platform's node
|
|
5
|
+
* carries — the SAME split as the scheduled trigger above, on the same field
|
|
6
|
+
* names, because it is the same designer control: `timerPreset` holds the
|
|
7
|
+
* duration when it is one of the dropdown's twelve, and otherwise holds the
|
|
8
|
+
* literal `"custom"` with the real duration in `timerValue`. flow-v1's timer
|
|
9
|
+
* serializer collapses them straight back (`event-definition.ts:31`), so the
|
|
10
|
+
* two encodings are the same wait.
|
|
11
|
+
*
|
|
12
|
+
* Both are shapes the platform actually deploys — 26 of 26 archived
|
|
13
|
+
* `skill-flow-delay` flows carry the preset form, 35 of 38 archived
|
|
14
|
+
* `skill-flow-terminate` flows the custom form — so this is a choice of
|
|
15
|
+
* encoding, not of correctness. Emitting the preset when one fits keeps the
|
|
16
|
+
* node's Duration dropdown showing a value instead of "Custom".
|
|
17
|
+
*
|
|
18
|
+
* `timerType` is `timeDuration` for a `duration` and `timeDate` for `until`,
|
|
19
|
+
* because the platform's timer serializer resolves a body as
|
|
20
|
+
* "preset, else timerValue" for EVERY kind and so never reads `timerDate` while
|
|
21
|
+
* a duration is present (flow-builder-sdk#70).
|
|
22
|
+
*/
|
|
23
|
+
function delayInputs(inputs) {
|
|
24
|
+
// An absolute-date wait (`until`) is the definition's timeDate arm: it
|
|
25
|
+
// requires timerDate, while the top-level required timerPreset is satisfied
|
|
26
|
+
// with the literal 'custom' (the timeDuration-only allOf never fires).
|
|
27
|
+
const until = String(inputs?.until ?? '').trim();
|
|
28
|
+
if (until) {
|
|
29
|
+
return { timerType: 'timeDate', timerPreset: 'custom', timerDate: until };
|
|
30
|
+
}
|
|
31
|
+
const duration = String(inputs?.duration ?? '').trim();
|
|
32
|
+
const isPreset = DELAY_PRESETS.includes(duration);
|
|
33
|
+
return {
|
|
34
|
+
timerType: 'timeDuration',
|
|
35
|
+
timerPreset: isPreset ? duration : 'custom',
|
|
36
|
+
...(isPreset ? {} : { timerValue: duration }),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function delayAt(version) {
|
|
40
|
+
return {
|
|
41
|
+
kind: 'delay', typeName: 'core.logic.delay', version, factory: 'delay', definition: 'bundled',
|
|
42
|
+
rawNode: { factory: 'delay({ duration })' },
|
|
43
|
+
serialize: ({ inputs }) => ({ inputs: delayInputs(inputs) }),
|
|
44
|
+
// The three spellings delayInputs writes — `{ timerType, timerPreset,
|
|
45
|
+
// timerValue? }` for a duration and `{ timerType: 'timeDate', timerDate }`
|
|
46
|
+
// for an absolute wait — back to the factory's one.
|
|
47
|
+
deserialize: (node) => {
|
|
48
|
+
const inputs = node.inputs ?? {};
|
|
49
|
+
if (inputs.timerType === 'timeDate') {
|
|
50
|
+
return { kind: 'delay', inputs: { until: typeof inputs.timerDate === 'string' ? inputs.timerDate : '' } };
|
|
51
|
+
}
|
|
52
|
+
const duration = inputs.timerPreset === 'custom'
|
|
53
|
+
? (typeof inputs.timerValue === 'string' ? inputs.timerValue : '')
|
|
54
|
+
: (typeof inputs.timerPreset === 'string' ? inputs.timerPreset : '');
|
|
55
|
+
return { kind: 'delay', inputs: { duration } };
|
|
56
|
+
},
|
|
57
|
+
check: ({ inputs }, ctx) => checkDelay(inputs, ctx),
|
|
58
|
+
// check collected no expressions for a delay before the port; unchanged by it.
|
|
59
|
+
expressions: () => [],
|
|
60
|
+
output: () => ({
|
|
61
|
+
kind: 'none',
|
|
62
|
+
code: 'DELAY_HAS_NO_OUTPUT',
|
|
63
|
+
message: ({ node, ref, reader }) => `Delay "${node}" produces no output, but "${ref}" reads one in "${reader}". `
|
|
64
|
+
+ 'A delay only waits — read the step that computed the value instead.',
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export const delayNodeType = {
|
|
69
|
+
kind: 'delay', typeName: 'core.logic.delay', factory: 'delay', defaultVersion: '1.0.0',
|
|
70
|
+
versions: { '1.0.0': delayAt('1.0.0'), '1.0': delayAt('1.0') },
|
|
71
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Delay family's authoring types (`core.logic.delay`), and its kind's entry in
|
|
3
|
+
* `FlowActionSpecs`. Moved from core/actions.ts in Phase 4 of
|
|
4
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The twelve durations the designer's dropdown offers. Purely an ENCODING
|
|
8
|
+
* detail: a duration in this list ships as `timerPreset: '<duration>'` and any
|
|
9
|
+
* other ships as `timerPreset: 'custom'` + `timerValue: '<duration>'`. Both
|
|
10
|
+
* deploy and both wait the same length of time — the author never picks.
|
|
11
|
+
* `core-definitions.test.ts` pins this list against the definition's own form.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DELAY_PRESETS: readonly ["PT5S", "PT15S", "PT30S", "PT1M", "PT5M", "PT15M", "PT30M", "PT1H", "PT6H", "PT12H", "P1D", "P1W"];
|
|
14
|
+
export type DelayInputs = {
|
|
15
|
+
/**
|
|
16
|
+
* How long to wait, as an ISO-8601 duration: `PT30S`, `PT15M`, `PT2H`,
|
|
17
|
+
* `P1D`, `P1W`. `PT` separates the time part, so `P1M` is a MONTH and
|
|
18
|
+
* `PT1M` is a minute.
|
|
19
|
+
* ISO-8601 duration format documentation is here:
|
|
20
|
+
* {@link https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm}
|
|
21
|
+
*/
|
|
22
|
+
duration: string;
|
|
23
|
+
/** Impossible together with `duration` — a delay waits one way or the other. */
|
|
24
|
+
until?: never;
|
|
25
|
+
} | {
|
|
26
|
+
/**
|
|
27
|
+
* Wait until an ABSOLUTE date-time, ISO-8601: `2026-09-01T09:00:00Z` or
|
|
28
|
+
* `2026-09-01T09:00:00+02:00`. The platform's timeDate timer: the run
|
|
29
|
+
* parks until the wall clock reaches this moment (already-past dates
|
|
30
|
+
* fire immediately).
|
|
31
|
+
*/
|
|
32
|
+
until: string;
|
|
33
|
+
/** Impossible together with `until` — a delay waits one way or the other. */
|
|
34
|
+
duration?: never;
|
|
35
|
+
};
|
|
36
|
+
declare module '../../../core/actions.js' {
|
|
37
|
+
interface FlowActionSpecs {
|
|
38
|
+
/** The spec {@link delay} builds. */
|
|
39
|
+
delay: {
|
|
40
|
+
inputs: DelayInputs;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Delay family's authoring types (`core.logic.delay`), and its kind's entry in
|
|
3
|
+
* `FlowActionSpecs`. Moved from core/actions.ts in Phase 4 of
|
|
4
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The twelve durations the designer's dropdown offers. Purely an ENCODING
|
|
8
|
+
* detail: a duration in this list ships as `timerPreset: '<duration>'` and any
|
|
9
|
+
* other ships as `timerPreset: 'custom'` + `timerValue: '<duration>'`. Both
|
|
10
|
+
* deploy and both wait the same length of time — the author never picks.
|
|
11
|
+
* `core-definitions.test.ts` pins this list against the definition's own form.
|
|
12
|
+
*/
|
|
13
|
+
export const DELAY_PRESETS = [
|
|
14
|
+
'PT5S', 'PT15S', 'PT30S', 'PT1M', 'PT5M', 'PT15M', 'PT30M',
|
|
15
|
+
'PT1H', 'PT6H', 'PT12H', 'P1D', 'P1W',
|
|
16
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document factories, `documentClassify()` and `dynamicExtract()`. Moved
|
|
3
|
+
* from core/actions.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the
|
|
4
|
+
* package entry re-exports them.
|
|
5
|
+
*/
|
|
6
|
+
import { type ActionSpec } from '../../../core/actions.js';
|
|
7
|
+
import type { DocumentClassifyInputs, DynamicExtractInputs } from './spec.js';
|
|
8
|
+
/**
|
|
9
|
+
* Classify a document into a document type (`uipath.document.classify`). The
|
|
10
|
+
* result publishes `ClassificationResult` — an array of typed classifications
|
|
11
|
+
* with page ranges and confidences.
|
|
12
|
+
*
|
|
13
|
+
* @param inputs - The file reference and optional page range / split / model settings.
|
|
14
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function documentClassify(inputs: DocumentClassifyInputs): ActionSpec;
|
|
17
|
+
/**
|
|
18
|
+
* Extract fields from a document with an INLINE schema — Dynamic Extract
|
|
19
|
+
* (`uipath.ixp.extract-document-builder`), the newer of the two extraction
|
|
20
|
+
* shapes. No deployed IXP project is referenced: the extraction schema rides
|
|
21
|
+
* the node. The result publishes `ExtractionResult` (and `Taxonomy`).
|
|
22
|
+
*
|
|
23
|
+
* @param inputs - The file reference, the inline extraction schema, and
|
|
24
|
+
* optional page range / model settings.
|
|
25
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function dynamicExtract(inputs: DynamicExtractInputs): ActionSpec;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document factories, `documentClassify()` and `dynamicExtract()`. Moved
|
|
3
|
+
* from core/actions.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the
|
|
4
|
+
* package entry re-exports them.
|
|
5
|
+
*/
|
|
6
|
+
import { builtinActionSpec } from '../../../core/actions.js';
|
|
7
|
+
/**
|
|
8
|
+
* Classify a document into a document type (`uipath.document.classify`). The
|
|
9
|
+
* result publishes `ClassificationResult` — an array of typed classifications
|
|
10
|
+
* with page ranges and confidences.
|
|
11
|
+
*
|
|
12
|
+
* @param inputs - The file reference and optional page range / split / model settings.
|
|
13
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
14
|
+
*/
|
|
15
|
+
export function documentClassify(inputs) {
|
|
16
|
+
return builtinActionSpec({ kind: 'documentClassify', inputs });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Extract fields from a document with an INLINE schema — Dynamic Extract
|
|
20
|
+
* (`uipath.ixp.extract-document-builder`), the newer of the two extraction
|
|
21
|
+
* shapes. No deployed IXP project is referenced: the extraction schema rides
|
|
22
|
+
* the node. The result publishes `ExtractionResult` (and `Taxonomy`).
|
|
23
|
+
*
|
|
24
|
+
* @param inputs - The file reference, the inline extraction schema, and
|
|
25
|
+
* optional page range / model settings.
|
|
26
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
27
|
+
*/
|
|
28
|
+
export function dynamicExtract(inputs) {
|
|
29
|
+
return builtinActionSpec({ kind: 'dynamicExtract', inputs });
|
|
30
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { documentClassifyNodeType, DOCUMENT_DIAGNOSTICS, dynamicExtractNodeType } from './node-type.js';
|
|
2
|
+
export const documentFlowFamily = {
|
|
3
|
+
id: 'document',
|
|
4
|
+
title: 'Document understanding',
|
|
5
|
+
types: [documentClassifyNodeType, dynamicExtractNodeType],
|
|
6
|
+
diagnostics: DOCUMENT_DIAGNOSTICS,
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DiagnosticCatalog } from '../../../core/nodes/family.js';
|
|
2
|
+
import type { FlowNodeType } from '../../../flow-node-type.js';
|
|
3
|
+
import type { DocumentClassifyInputs, DynamicExtractInputs } from './spec.js';
|
|
4
|
+
export type DocumentClassifySpec = {
|
|
5
|
+
kind: 'documentClassify';
|
|
6
|
+
inputs: DocumentClassifyInputs;
|
|
7
|
+
};
|
|
8
|
+
export type DynamicExtractSpec = {
|
|
9
|
+
kind: 'dynamicExtract';
|
|
10
|
+
inputs: DynamicExtractInputs;
|
|
11
|
+
};
|
|
12
|
+
export declare const DOCUMENT_DIAGNOSTICS: DiagnosticCatalog;
|
|
13
|
+
export declare const documentClassifyNodeType: FlowNodeType<DocumentClassifySpec>;
|
|
14
|
+
export declare const dynamicExtractNodeType: FlowNodeType<DynamicExtractSpec>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two document node types: Document Classify (`uipath.document.classify@1.0`)
|
|
3
|
+
* and Dynamic Extract (`uipath.ixp.extract-document-builder@1.0.0`). Moved from
|
|
4
|
+
* serialize.ts / check.ts / decompile.ts in Phase 4 of
|
|
5
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; serialized output, printed source,
|
|
6
|
+
* codes and messages unchanged.
|
|
7
|
+
*
|
|
8
|
+
* Not here: `ixpExtract()` (`uipath.ixp.<project type>`), whose type name comes
|
|
9
|
+
* from the model rather than being one fixed name, which the contract does not
|
|
10
|
+
* express yet.
|
|
11
|
+
*/
|
|
12
|
+
import { toExpr } from '../../../core/expr.js';
|
|
13
|
+
import { jsonClone } from '../../../core/json-file.js';
|
|
14
|
+
export const DOCUMENT_DIAGNOSTICS = {
|
|
15
|
+
DOC_NO_FILEREF: { severity: 'error', summary: 'no fileRef, so nothing to classify or extract from' },
|
|
16
|
+
EXTRACT_SCHEMA_SHAPE: { severity: 'error', summary: 'a Dynamic Extract schema that is not an object' },
|
|
17
|
+
};
|
|
18
|
+
function checkFileRef(inputs, verb, ctx) {
|
|
19
|
+
const fr = inputs.fileRef;
|
|
20
|
+
const empty = fr === undefined || fr === null || (typeof fr === 'string' && fr.trim() === '');
|
|
21
|
+
if (empty) {
|
|
22
|
+
ctx.report('DOC_NO_FILEREF', `"${ctx.step}" has no fileRef — nothing to ${verb}. Reference a file input or an upstream attachment.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** The definition's `inputDefaults`, which both nodes spread first. */
|
|
26
|
+
function defaults(typeName, version, ctx) {
|
|
27
|
+
return jsonClone((ctx.definition(typeName, version)?.inputDefaults) ?? {});
|
|
28
|
+
}
|
|
29
|
+
/** `fileRef`, as the lift reads it: `=js:` text as an Expr, anything else as text. */
|
|
30
|
+
function liftFileRef(node, ctx) {
|
|
31
|
+
const fr = ctx.sourceText(node.inputs?.fileRef) ?? '';
|
|
32
|
+
return fr.startsWith('=js:') ? ctx.expr(fr) : fr;
|
|
33
|
+
}
|
|
34
|
+
/** `pageRange` when it is a non-empty string, as the lift reads it. */
|
|
35
|
+
function liftPageRange(node) {
|
|
36
|
+
const p = node.inputs?.pageRange;
|
|
37
|
+
return typeof p === 'string' && p !== '' ? p : undefined;
|
|
38
|
+
}
|
|
39
|
+
export const documentClassifyNodeType = {
|
|
40
|
+
kind: 'documentClassify', typeName: 'uipath.document.classify', version: '1.0', factory: 'documentClassify',
|
|
41
|
+
definition: 'bundled', rawNode: { factory: 'documentClassify()' },
|
|
42
|
+
serialize: ({ inputs }, ctx) => {
|
|
43
|
+
const d = defaults('uipath.document.classify', '1.0', ctx);
|
|
44
|
+
// Classify follows the default envelope rules for fileRef (unlike the
|
|
45
|
+
// `uipath.ixp.*` extractors — see migrate's UNWRAPPED_INPUTS).
|
|
46
|
+
return {
|
|
47
|
+
inputs: {
|
|
48
|
+
...d,
|
|
49
|
+
fileRef: ctx.render(toExpr(inputs.fileRef)),
|
|
50
|
+
...(inputs.pageRange !== undefined ? { pageRange: inputs.pageRange } : {}),
|
|
51
|
+
...(inputs.splitPages !== undefined ? { splitPages: inputs.splitPages } : {}),
|
|
52
|
+
...(inputs.modelConfig !== undefined
|
|
53
|
+
? { modelConfig: { ...(d.modelConfig ?? {}), ...inputs.modelConfig } }
|
|
54
|
+
: {}),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
deserialize: (node, ctx) => {
|
|
59
|
+
const pageRange = liftPageRange(node);
|
|
60
|
+
const split = ctx.plainValue(node.inputs?.splitPages);
|
|
61
|
+
return {
|
|
62
|
+
kind: 'documentClassify',
|
|
63
|
+
inputs: {
|
|
64
|
+
fileRef: liftFileRef(node, ctx),
|
|
65
|
+
...(pageRange !== undefined ? { pageRange } : {}),
|
|
66
|
+
...(split === true ? { splitPages: true } : {}),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
print: ({ inputs }, ctx) => ({
|
|
71
|
+
factory: 'documentClassify',
|
|
72
|
+
options: [
|
|
73
|
+
['fileRef', ctx.value(inputs.fileRef)],
|
|
74
|
+
['pageRange', inputs.pageRange !== undefined ? ctx.string(inputs.pageRange) : undefined],
|
|
75
|
+
['splitPages', inputs.splitPages === true ? 'true' : undefined],
|
|
76
|
+
],
|
|
77
|
+
}),
|
|
78
|
+
check: ({ inputs }, ctx) => checkFileRef(inputs, 'classify', ctx),
|
|
79
|
+
// check collected no expressions for this kind before the port; unchanged by it.
|
|
80
|
+
expressions: () => [],
|
|
81
|
+
output: () => ({ kind: 'opaque' }),
|
|
82
|
+
};
|
|
83
|
+
export const dynamicExtractNodeType = {
|
|
84
|
+
kind: 'dynamicExtract', typeName: 'uipath.ixp.extract-document-builder', version: '1.0.0', factory: 'dynamicExtract',
|
|
85
|
+
definition: 'bundled', rawNode: { factory: 'dynamicExtract()' },
|
|
86
|
+
serialize: ({ inputs }, ctx) => {
|
|
87
|
+
const d = defaults('uipath.ixp.extract-document-builder', '1.0.0', ctx);
|
|
88
|
+
const m = inputs.model;
|
|
89
|
+
return {
|
|
90
|
+
inputs: {
|
|
91
|
+
...d,
|
|
92
|
+
// The deployment identity Studio Web's panel destructures — both the
|
|
93
|
+
// nested `model` object and the flat mirrors the definition declares.
|
|
94
|
+
model: { modelName: m.modelName, folderKey: m.folderKey },
|
|
95
|
+
modelName: m.modelName,
|
|
96
|
+
folderKey: m.folderKey,
|
|
97
|
+
...(m.projectId !== undefined ? { projectId: m.projectId } : {}),
|
|
98
|
+
...(m.projectName !== undefined ? { projectName: m.projectName } : {}),
|
|
99
|
+
...(m.folderName !== undefined ? { folderName: m.folderName } : {}),
|
|
100
|
+
...(m.versionTag !== undefined ? { versionTag: m.versionTag } : {}),
|
|
101
|
+
// A `uipath.ixp.*` fileRef must stay a PLAIN `=js:` string — the
|
|
102
|
+
// platform reads it unwrapped (see migrate's UNWRAPPED_INPUTS).
|
|
103
|
+
fileRef: ctx.render(toExpr(inputs.fileRef)),
|
|
104
|
+
...(inputs.pageRange !== undefined ? { pageRange: inputs.pageRange } : {}),
|
|
105
|
+
...(inputs.modelConfig !== undefined
|
|
106
|
+
? { modelConfig: { ...(d.modelConfig ?? {}), ...inputs.modelConfig } }
|
|
107
|
+
: {}),
|
|
108
|
+
...(inputs.schema !== undefined ? { schemaDocument: inputs.schema } : {}),
|
|
109
|
+
// The definition's model declares `source: true`: the platform mints a
|
|
110
|
+
// stable storage slot per instance; omit it and the node validates then
|
|
111
|
+
// faults. Deterministic, like every other minted identity here.
|
|
112
|
+
source: ctx.mint('source'),
|
|
113
|
+
},
|
|
114
|
+
// IxP instances must NOT carry the manifest's model block — the slim
|
|
115
|
+
// { type, serviceType } lives only in definitions[] (product validate
|
|
116
|
+
// rejects a node-level copy). Per call, not `nodeModel`: a rawNode of this
|
|
117
|
+
// type keeps the model it always had.
|
|
118
|
+
model: 'omit',
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
deserialize: (node, ctx) => {
|
|
122
|
+
const pageRange = liftPageRange(node);
|
|
123
|
+
const schema = node.inputs?.schemaDocument;
|
|
124
|
+
return {
|
|
125
|
+
kind: 'dynamicExtract',
|
|
126
|
+
inputs: {
|
|
127
|
+
fileRef: liftFileRef(node, ctx),
|
|
128
|
+
...(schema !== undefined ? { schema: schema } : {}),
|
|
129
|
+
...(pageRange !== undefined ? { pageRange } : {}),
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
print: ({ inputs }, ctx) => ({
|
|
134
|
+
factory: 'dynamicExtract',
|
|
135
|
+
options: [
|
|
136
|
+
['fileRef', ctx.value(inputs.fileRef)],
|
|
137
|
+
['schema', inputs.schema !== undefined ? ctx.json(inputs.schema) : undefined],
|
|
138
|
+
['pageRange', inputs.pageRange !== undefined ? ctx.string(inputs.pageRange) : undefined],
|
|
139
|
+
],
|
|
140
|
+
}),
|
|
141
|
+
check: ({ inputs }, ctx) => {
|
|
142
|
+
checkFileRef(inputs, 'extract from', ctx);
|
|
143
|
+
if (inputs.schema !== undefined && (typeof inputs.schema !== 'object' || Array.isArray(inputs.schema))) {
|
|
144
|
+
ctx.report('EXTRACT_SCHEMA_SHAPE', `"${ctx.step}"'s schema must be an object (the inline extraction schema document).`);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
// check collected no expressions for this kind before the port; unchanged by it.
|
|
148
|
+
expressions: () => [],
|
|
149
|
+
output: () => ({ kind: 'opaque' }),
|
|
150
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document family's authoring types — Document Classify
|
|
3
|
+
* (`uipath.document.classify`) and Dynamic Extract
|
|
4
|
+
* (`uipath.ixp.extract-document-builder`) — and their kinds' entries in
|
|
5
|
+
* `FlowActionSpecs`. Moved from core/actions.ts in Phase 4 of
|
|
6
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
7
|
+
*/
|
|
8
|
+
import type { Expr } from '../../../core/expr.js';
|
|
9
|
+
export interface DocumentClassifyInputs {
|
|
10
|
+
/** The document to classify — a file reference (`input('file')`, `out('fetch', 'fileRef')`, …). */
|
|
11
|
+
fileRef: string | Expr;
|
|
12
|
+
/** Page range to classify, e.g. `'1-3'`. Omit for the whole document. */
|
|
13
|
+
pageRange?: string;
|
|
14
|
+
/** Split multi-document files into per-type page ranges. */
|
|
15
|
+
splitPages?: boolean;
|
|
16
|
+
/** Model configuration overrides; omit for the platform defaults (gemini_2_5_flash). */
|
|
17
|
+
modelConfig?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface DynamicExtractInputs {
|
|
20
|
+
/** The document to extract from — a file reference. */
|
|
21
|
+
fileRef: string | Expr;
|
|
22
|
+
/**
|
|
23
|
+
* The IXP model deployment the extraction runs against. Dynamic Extract
|
|
24
|
+
* authors its SCHEMA inline, but execution still needs a model: Studio Web's
|
|
25
|
+
* panel destructures `modelName` and `folderKey`, and the platform rejects an
|
|
26
|
+
* instance without them.
|
|
27
|
+
*/
|
|
28
|
+
model: {
|
|
29
|
+
/** The deployment's model name, e.g. `'invoiceixp-cef0d447-ixp'`. */
|
|
30
|
+
modelName: string;
|
|
31
|
+
/** Folder key (GUID) the deployment lives in. */
|
|
32
|
+
folderKey: string;
|
|
33
|
+
/** The IXP project's id (GUID). */
|
|
34
|
+
projectId?: string;
|
|
35
|
+
/** The IXP project's display name. */
|
|
36
|
+
projectName?: string;
|
|
37
|
+
/** Folder display name. */
|
|
38
|
+
folderName?: string;
|
|
39
|
+
/** Deployment version tag; omit for the live version. */
|
|
40
|
+
versionTag?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The extraction schema (the node's inline taxonomy): a JSON-schema-shaped
|
|
44
|
+
* document describing the fields to extract. This is the Dynamic Extract
|
|
45
|
+
* node's defining input — authored inline rather than referencing a deployed
|
|
46
|
+
* IXP project (use {@link ixpExtract} for those).
|
|
47
|
+
*/
|
|
48
|
+
schema?: Record<string, unknown>;
|
|
49
|
+
/** Page range to extract, e.g. `'1-3'`. Omit for the whole document. */
|
|
50
|
+
pageRange?: string;
|
|
51
|
+
/** Model configuration overrides; omit for the platform defaults. */
|
|
52
|
+
modelConfig?: Record<string, unknown>;
|
|
53
|
+
}
|
|
54
|
+
declare module '../../../core/actions.js' {
|
|
55
|
+
interface FlowActionSpecs {
|
|
56
|
+
/** The spec {@link documentClassify} builds. */
|
|
57
|
+
documentClassify: {
|
|
58
|
+
inputs: DocumentClassifyInputs;
|
|
59
|
+
};
|
|
60
|
+
/** The spec {@link dynamicExtract} builds. */
|
|
61
|
+
dynamicExtract: {
|
|
62
|
+
inputs: DynamicExtractInputs;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The placeholder factory, `mock()`. Moved from core/actions.ts in Phase 4 of
|
|
3
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the package entry re-exports it.
|
|
4
|
+
*/
|
|
5
|
+
import { type ActionSpec } from '../../../core/actions.js';
|
|
6
|
+
/**
|
|
7
|
+
* Declare a PLACEHOLDER step — "a real node goes here later".
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* A mock takes **no inputs and publishes nothing**. It is a marker on the canvas
|
|
11
|
+
* that keeps the graph wired and the flow deployable while one step is still
|
|
12
|
+
* missing — not a stub that returns test data. `out('extractInvoice')` is
|
|
13
|
+
* refused at compile time (`MOCK_HAS_NO_OUTPUT`) because it would read `null` at
|
|
14
|
+
* run time, always.
|
|
15
|
+
*
|
|
16
|
+
* Say what belongs there in the step's own name and in the label the canvas
|
|
17
|
+
* shows; the corpus's placeholders read like
|
|
18
|
+
* `"Extract Invoice Fields (mock — IxP model not yet published)"`.
|
|
19
|
+
*
|
|
20
|
+
* ### Why there are no arguments (convention #191 — the family contract)
|
|
21
|
+
*
|
|
22
|
+
* The platform's `core.logic.mock@1.0.0` declares **no `inputDefinition`** and one
|
|
23
|
+
* output whose `source` is the literal `"null"`. Measured over the 4,033 distinct
|
|
24
|
+
* archived `.flow` artifacts: **74 mock instances in 62 flows, and 0 carrying a
|
|
25
|
+
* fixture anywhere in the node** — 71 of them with `inputs: {}` or no `inputs`
|
|
26
|
+
* key. The 3 exceptions carry free-text `placeholder` / `_placeholder` keys the
|
|
27
|
+
* definition never declares, invented by agents on runs that scored 0.9 and 0.4.
|
|
28
|
+
*
|
|
29
|
+
* **This is NOT a local runner's `kind: 'mock'` test construct**, which returns a
|
|
30
|
+
* baked fixture. They are different things that share
|
|
31
|
+
* a name, and a `mock({ fixture })` surface would emit a node whose local
|
|
32
|
+
* behaviour and deployed behaviour disagree silently — see
|
|
33
|
+
* [#125](https://github.com/UiPath/flow-builder-sdk/issues/125). Nothing this SDK
|
|
34
|
+
* emits opens that channel: an SDK-authored mock publishes `null` locally,
|
|
35
|
+
* exactly as the platform does.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* **Hold a step's place until the real node exists**
|
|
39
|
+
* ```ts
|
|
40
|
+
* .step('extractInvoice', mock()) // ← swap for the IxP node once the project exists
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function mock(): ActionSpec;
|
|
46
|
+
declare module '../../../core/actions.js' {
|
|
47
|
+
interface FlowActionSpecs {
|
|
48
|
+
/** A placeholder — no inputs, publishes nothing. See {@link mock}. */
|
|
49
|
+
mock: {};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The placeholder factory, `mock()`. Moved from core/actions.ts in Phase 4 of
|
|
3
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the package entry re-exports it.
|
|
4
|
+
*/
|
|
5
|
+
import { builtinActionSpec } from '../../../core/actions.js';
|
|
6
|
+
/**
|
|
7
|
+
* Declare a PLACEHOLDER step — "a real node goes here later".
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* A mock takes **no inputs and publishes nothing**. It is a marker on the canvas
|
|
11
|
+
* that keeps the graph wired and the flow deployable while one step is still
|
|
12
|
+
* missing — not a stub that returns test data. `out('extractInvoice')` is
|
|
13
|
+
* refused at compile time (`MOCK_HAS_NO_OUTPUT`) because it would read `null` at
|
|
14
|
+
* run time, always.
|
|
15
|
+
*
|
|
16
|
+
* Say what belongs there in the step's own name and in the label the canvas
|
|
17
|
+
* shows; the corpus's placeholders read like
|
|
18
|
+
* `"Extract Invoice Fields (mock — IxP model not yet published)"`.
|
|
19
|
+
*
|
|
20
|
+
* ### Why there are no arguments (convention #191 — the family contract)
|
|
21
|
+
*
|
|
22
|
+
* The platform's `core.logic.mock@1.0.0` declares **no `inputDefinition`** and one
|
|
23
|
+
* output whose `source` is the literal `"null"`. Measured over the 4,033 distinct
|
|
24
|
+
* archived `.flow` artifacts: **74 mock instances in 62 flows, and 0 carrying a
|
|
25
|
+
* fixture anywhere in the node** — 71 of them with `inputs: {}` or no `inputs`
|
|
26
|
+
* key. The 3 exceptions carry free-text `placeholder` / `_placeholder` keys the
|
|
27
|
+
* definition never declares, invented by agents on runs that scored 0.9 and 0.4.
|
|
28
|
+
*
|
|
29
|
+
* **This is NOT a local runner's `kind: 'mock'` test construct**, which returns a
|
|
30
|
+
* baked fixture. They are different things that share
|
|
31
|
+
* a name, and a `mock({ fixture })` surface would emit a node whose local
|
|
32
|
+
* behaviour and deployed behaviour disagree silently — see
|
|
33
|
+
* [#125](https://github.com/UiPath/flow-builder-sdk/issues/125). Nothing this SDK
|
|
34
|
+
* emits opens that channel: an SDK-authored mock publishes `null` locally,
|
|
35
|
+
* exactly as the platform does.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* **Hold a step's place until the real node exists**
|
|
39
|
+
* ```ts
|
|
40
|
+
* .step('extractInvoice', mock()) // ← swap for the IxP node once the project exists
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @returns An action spec to pass to `.step(name, …)`.
|
|
44
|
+
*/
|
|
45
|
+
export function mock() {
|
|
46
|
+
return builtinActionSpec({ kind: 'mock' });
|
|
47
|
+
}
|