@uipath/maestro-builder-sdk 6.101.0 → 6.102.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 +14 -14
- package/dist/api-members.md +16 -16
- package/dist/core/actions.d.ts +6 -0
- package/dist/core/actions.js +7 -0
- package/dist/core/binding-messages.d.ts +33 -1
- package/dist/core/binding-messages.js +51 -0
- package/dist/core/connector-option-keys.d.ts +4 -0
- package/dist/core/connector-option-keys.js +9 -0
- package/dist/core/event-subscription.d.ts +8 -0
- package/dist/core/event-subscription.js +2 -4
- package/dist/core/nodes/node-type.d.ts +25 -0
- package/dist/core/nodes/versioned.d.ts +3 -1
- package/dist/core/nodes/versioned.js +1 -0
- package/dist/core/option-keys.d.ts +62 -0
- package/dist/core/option-keys.js +66 -0
- package/dist/core/refusals.d.ts +3 -0
- package/dist/core/refusals.js +5 -0
- package/dist/flow-node-type.d.ts +31 -1
- package/dist/flow-option-keys.d.ts +22 -0
- package/dist/flow-option-keys.js +33 -0
- package/dist/flow-sdk.js +5 -9
- package/dist/nodes/agent/flow/inline-agent.js +2 -4
- package/dist/nodes/agent/flow/node-type.js +12 -0
- package/dist/nodes/ai-patterns/flow/node-type.js +6 -0
- package/dist/nodes/connector/flow/event-trigger.js +4 -2
- package/dist/nodes/connector/flow/event-wait.js +4 -2
- package/dist/nodes/connector/flow/node-type.js +5 -4
- package/dist/nodes/connector/flow/raw-node.js +1 -1
- package/dist/nodes/conversation/flow/node-type.js +9 -0
- package/dist/nodes/data-fabric/flow/verbs.js +10 -0
- package/dist/nodes/delay/flow/node-type.js +4 -0
- package/dist/nodes/document/flow/ixp.js +4 -0
- package/dist/nodes/document/flow/node-type.js +6 -0
- package/dist/nodes/hitl/flow/node-type.js +4 -0
- package/dist/nodes/http/flow/check.js +55 -0
- package/dist/nodes/http/flow/node-type.js +7 -4
- package/dist/nodes/process/flow/node-type.js +10 -0
- package/dist/nodes/queue/flow/node-type.js +4 -0
- package/dist/nodes/script/flow/node-type.js +4 -0
- package/dist/nodes/transform/flow/node-type.js +4 -0
- package/dist/nodes/trigger/flow/node-type.js +6 -0
- package/dist/serialize.js +73 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { nearestName } from '../../../core/edit-distance.js';
|
|
2
2
|
import { escapeRegExp } from '../../../core/escape-regexp.js';
|
|
3
3
|
import { isJsExpressionValue } from '../../../core/wire-expr.js';
|
|
4
|
+
import { Expr } from '../../../core/expr.js';
|
|
4
5
|
export const HTTP_DIAGNOSTICS = {
|
|
5
6
|
HTTP_V1_RETIRED: { severity: 'warning', summary: 'the plain node is retired on the tenant registry' },
|
|
6
7
|
HTTP_BINDING_REQUIRES_MANAGED: { severity: 'error', summary: 'connection settings on the standalone node' },
|
|
@@ -18,6 +19,7 @@ export const HTTP_DIAGNOSTICS = {
|
|
|
18
19
|
HTTP_READ_UNKNOWN_FIELD: { severity: 'error', summary: 'a read outside the response envelope or the declared body' },
|
|
19
20
|
HTTP_READ_WITHOUT_RETURNS: { severity: 'error', summary: 'a body field read with no `returns`' },
|
|
20
21
|
HTTP_ONERROR_V1: { severity: 'error', summary: '.onError() on the plain node' },
|
|
22
|
+
HTTP_LITERAL_SECRET_HEADER: { severity: 'warning', summary: 'a literal credential in an Authorization or API-key header, stored in the .flow as plain text' },
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* An ISO-8601 DURATION, which is what both http definitions declare `timeout` to
|
|
@@ -37,6 +39,58 @@ const ISO8601_DURATION = /^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)
|
|
|
37
39
|
* (it refuses something that works); a too-wide one costs nothing.
|
|
38
40
|
*/
|
|
39
41
|
const RETRY_COUNT_SOFT_MAX = 5;
|
|
42
|
+
/**
|
|
43
|
+
* Header names that carry a credential: `Authorization` and
|
|
44
|
+
* `Proxy-Authorization`, and any name with an `api-key`, `apikey`, `token`,
|
|
45
|
+
* `secret`, `password` or `subscription-key` part (`X-Api-Key`, `api-key`,
|
|
46
|
+
* `X-Auth-Token`, `PRIVATE-TOKEN`, `Ocp-Apim-Subscription-Key`). Matched on
|
|
47
|
+
* `-`/`_`-separated parts, so `X-Token-Count` or `Accept` do not match.
|
|
48
|
+
*/
|
|
49
|
+
const SECRET_HEADER = /^(?:proxy-)?authorization$|(?:^|[-_])(?:api[-_]?key|apikey|token|secret|password|passwd|subscription[-_]key|functions[-_]key)$/i;
|
|
50
|
+
/** An HTTP auth scheme word on its own (`Bearer`, `Basic`), which carries no credential yet. */
|
|
51
|
+
const AUTH_SCHEME_ONLY = /^(?:bearer|basic|token|apikey|digest)?$/i;
|
|
52
|
+
/**
|
|
53
|
+
* The text a header value carries when it is a constant: a plain string, a
|
|
54
|
+
* `lit()`, or a `js` expression that is nothing but a string literal
|
|
55
|
+
* (`` js`"Bearer abc"` ``). `undefined` for anything evaluated at run time.
|
|
56
|
+
*/
|
|
57
|
+
function literalHeaderText(value) {
|
|
58
|
+
if (typeof value === 'string')
|
|
59
|
+
return isJsExpressionValue(value) ? undefined : value;
|
|
60
|
+
if (!(value instanceof Expr))
|
|
61
|
+
return undefined;
|
|
62
|
+
if (value.literal)
|
|
63
|
+
return typeof value.value === 'string' ? value.value : undefined;
|
|
64
|
+
try {
|
|
65
|
+
const parsed = JSON.parse(value.js.trim());
|
|
66
|
+
return typeof parsed === 'string' ? parsed : undefined;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A literal credential in a request header (#1977). The value is written into
|
|
74
|
+
* the `.flow` as plain text, so it is in the source, in every exported
|
|
75
|
+
* solution and in the designer, readable by anyone who can open the flow. A
|
|
76
|
+
* warning, not an error: the request still works, and a designer flow that
|
|
77
|
+
* already carries one should not stop an unrelated edit. An empty value and a
|
|
78
|
+
* scheme word alone (`'Bearer '`) carry nothing, so they are not reported.
|
|
79
|
+
*/
|
|
80
|
+
function checkSecretHeaders(inputs, ctx) {
|
|
81
|
+
for (const [name, value] of Object.entries(inputs?.headers ?? {})) {
|
|
82
|
+
if (!SECRET_HEADER.test(name.trim()))
|
|
83
|
+
continue;
|
|
84
|
+
const text = literalHeaderText(value);
|
|
85
|
+
if (text === undefined || AUTH_SCHEME_ONLY.test(text.trim()))
|
|
86
|
+
continue;
|
|
87
|
+
ctx.report('HTTP_LITERAL_SECRET_HEADER', `Step "${ctx.step}" sets the "${name}" header to a literal value. A literal is written into the .flow as `
|
|
88
|
+
+ `plain text, so the credential is readable by anyone who can open the flow or its exported solution. `
|
|
89
|
+
+ `Keep it in an Integration Service HTTP connection (managed: true with connection and folder, which `
|
|
90
|
+
+ `authenticates the request, and drop the header), or read it from a flow input with no \`default\`, which `
|
|
91
|
+
+ `the caller supplies at run time. A \`default\` on an input or a .var() is written into the .flow too.`, `http({ url: …, managed: true, connection, folder })`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
40
94
|
/**
|
|
41
95
|
* The two http settings every deployed request node carries.
|
|
42
96
|
*
|
|
@@ -117,6 +171,7 @@ function comparesFailingCode(js, step) {
|
|
|
117
171
|
export function checkHttpStep(inputs, ctx) {
|
|
118
172
|
const step = ctx.step;
|
|
119
173
|
checkHttp(inputs, ctx);
|
|
174
|
+
checkSecretHeaders(inputs, ctx);
|
|
120
175
|
// A managed step's binding labels are the serializer's (BINDING_*), as a
|
|
121
176
|
// connector step's are.
|
|
122
177
|
const seen = new Set();
|
|
@@ -13,6 +13,7 @@ import { isRecord } from '../../../core/node-envelope.js';
|
|
|
13
13
|
import { wireExprBody } from '../../../core/wire-expr.js';
|
|
14
14
|
import { checkHttpRead, checkHttpStep, plainHttpOnErrorMessage } from './check.js';
|
|
15
15
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
16
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
16
17
|
const PLAIN = 'core.action.http';
|
|
17
18
|
const MANAGED = 'core.action.http.v2';
|
|
18
19
|
/** The definition's `inputDefaults` at the version being emitted. */
|
|
@@ -104,10 +105,9 @@ function managedHttpBinding(i, ctx) {
|
|
|
104
105
|
// The same resolution a connector step gets: a self-referential binding is an
|
|
105
106
|
// error, a stub is a warning.
|
|
106
107
|
const where = `managed http "${ctx.step}"`;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
108
|
+
const { connectionId, folderKey } = ctx.resolveBindingPair(i, where);
|
|
109
|
+
// Both labels are non-empty strings (refused above otherwise), so both resolve.
|
|
110
|
+
return { connectionId: connectionId, folderKey: folderKey };
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* The MANAGED HTTP node's inputs (`core.action.http.v2`).
|
|
@@ -410,9 +410,12 @@ function httpAt(typeName, version, managed) {
|
|
|
410
410
|
exits: httpExits,
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
+
/** Every key of `http()`'s options (builder-sdk#1990); `tsc` holds the list to `HttpInputs`. */
|
|
414
|
+
const HTTP_OPTIONS = { inputs: declareKeys({ branches: true, method: true, url: true, headers: true, query: true, body: true, contentType: true, managed: true, returns: true, timeout: true, retryCount: true, connection: true, folder: true, targetConnector: true }) };
|
|
413
415
|
function httpType(typeName, version, managed) {
|
|
414
416
|
return {
|
|
415
417
|
kind: 'http', typeName, factory: 'http', defaultVersion: version,
|
|
418
|
+
optionKeys: HTTP_OPTIONS,
|
|
416
419
|
versions: { [version]: httpAt(typeName, version, managed) },
|
|
417
420
|
matches: ({ inputs }) => Boolean(inputs?.managed) === managed,
|
|
418
421
|
};
|
|
@@ -19,6 +19,7 @@ import { resourceNodeSortOrder } from '../../../core/process-resource-sort-order
|
|
|
19
19
|
import { processResourceBindings, processResourceLocation } from '../../../core/process-resource.js';
|
|
20
20
|
import { checkAgent, checkAgentRead, checkAgenticProcess, checkAgenticProcessRead, checkApiWorkflow, checkApiWorkflowRead, checkPublishedFunction, checkPublishedFunctionRead, checkRpaWorkflow, rpaWorkflowRead, } from './check.js';
|
|
21
21
|
import { refuseLossyProcess } from './refusals.js';
|
|
22
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
22
23
|
/** The RPA-workflow node type family. The process's release key is the suffix. */
|
|
23
24
|
const RPA_WORKFLOW_PREFIX = 'uipath.core.rpa-workflow.';
|
|
24
25
|
/**
|
|
@@ -831,6 +832,14 @@ function processCheck(spec, ctx) {
|
|
|
831
832
|
case 'agent': return checkAgent(spec.inputs, ctx);
|
|
832
833
|
}
|
|
833
834
|
}
|
|
835
|
+
/** Every key of each factory's options (builder-sdk#1990), by kind; `tsc` holds each list to its type. */
|
|
836
|
+
const PROCESS_OPTIONS = {
|
|
837
|
+
rpaWorkflow: { inputs: declareKeys({ key: true, name: true, location: true, folderPath: true, projectId: true, inputs: true, returns: true }) },
|
|
838
|
+
apiWorkflow: { inputs: declareKeys({ key: true, name: true, location: true, folderPath: true, projectId: true, inputs: true, returns: true }) },
|
|
839
|
+
publishedFunction: { inputs: declareKeys({ key: true, name: true, location: true, folderPath: true, projectId: true, inputs: true, returns: true }) },
|
|
840
|
+
agenticProcess: { inputs: declareKeys({ key: true, name: true, location: true, folderPath: true, projectId: true, inputs: true, form: true, completion: true, returns: true }) },
|
|
841
|
+
agent: { inputs: declareKeys({ key: true, name: true, location: true, folderPath: true, projectId: true, inputs: true, returns: true, flavour: true }) },
|
|
842
|
+
};
|
|
834
843
|
function processType(kind, prefix, factory, form) {
|
|
835
844
|
const impl = {
|
|
836
845
|
kind, typeName: `${prefix}*`, version: '1.0.0', factory, definition: 'per-tenant',
|
|
@@ -852,6 +861,7 @@ function processType(kind, prefix, factory, form) {
|
|
|
852
861
|
};
|
|
853
862
|
return {
|
|
854
863
|
kind, typeName: `${prefix}*`, typeNamePrefix: prefix, factory, defaultVersion: '1.0.0',
|
|
864
|
+
optionKeys: ownEntry(PROCESS_OPTIONS, kind),
|
|
855
865
|
versions: { '1.0.0': impl },
|
|
856
866
|
// The agentic process's three forms share its kind; an absent or unknown form
|
|
857
867
|
// is the default `bpmn` one, as the definition builder reads it.
|
|
@@ -4,6 +4,7 @@ import { isRecord } from '../../../core/node-envelope.js';
|
|
|
4
4
|
import { checkQueueItem, itemDataIsString, itemIsNotObject, queueItemExprMessage, queueItemNotObjectMessage, queueReturnsWithoutWaitMessage, } from './check.js';
|
|
5
5
|
import { QUEUE_ITEM_RECORD_SCHEMA } from './record.js';
|
|
6
6
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
7
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
7
8
|
const CREATE = 'core.action.queue.create';
|
|
8
9
|
const CREATE_AND_WAIT = 'core.action.queue.create-and-wait';
|
|
9
10
|
/**
|
|
@@ -356,9 +357,12 @@ function queueAt(typeName, wait) {
|
|
|
356
357
|
output: ({ inputs }) => queueOutput(inputs, wait),
|
|
357
358
|
};
|
|
358
359
|
}
|
|
360
|
+
/** Every key of `queueItem()`'s options (builder-sdk#1990); `tsc` holds the list to `QueueItemInputs`. */
|
|
361
|
+
const QUEUE_ITEM_OPTIONS = { inputs: declareKeys({ queue: true, folderPath: true, key: true, item: true, priority: true, reference: true, deferDate: true, dueDate: true, wait: true, returns: true }) };
|
|
359
362
|
function queueType(typeName, wait) {
|
|
360
363
|
return {
|
|
361
364
|
kind: 'queueItem', typeName, factory: 'queueItem', defaultVersion: '1.2',
|
|
365
|
+
optionKeys: QUEUE_ITEM_OPTIONS,
|
|
362
366
|
versions: { '1.2': queueAt(typeName, wait) },
|
|
363
367
|
matches: ({ inputs }) => Boolean(inputs?.wait) === wait,
|
|
364
368
|
};
|
|
@@ -10,6 +10,7 @@ import { unknownMetadataKeys } from '../../../core/flow-metadata.js';
|
|
|
10
10
|
import { scriptBodyEarlyError, scriptBodySyntaxError, scriptBodyTypeScriptSyntax, tryLowerScriptFunction } from '../../../core/script-function.js';
|
|
11
11
|
import { FLOW_SCRIPT_RUNTIME } from './runtime.js';
|
|
12
12
|
import { checkScript } from './check.js';
|
|
13
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
13
14
|
/**
|
|
14
15
|
* Declare what a `core.action.script` node actually publishes.
|
|
15
16
|
*
|
|
@@ -213,7 +214,10 @@ function scriptAt(version) {
|
|
|
213
214
|
output: () => ({ kind: 'opaque' }),
|
|
214
215
|
};
|
|
215
216
|
}
|
|
217
|
+
/** Every key of `script()`'s options (builder-sdk#1990); `tsc` holds the list to `ScriptInputs`. */
|
|
218
|
+
const SCRIPT_OPTIONS = { inputs: declareKeys({ code: true, returns: true }) };
|
|
216
219
|
export const scriptNodeType = {
|
|
217
220
|
kind: 'script', typeName: 'core.action.script', factory: 'script', defaultVersion: '1.0.0',
|
|
221
|
+
optionKeys: SCRIPT_OPTIONS,
|
|
218
222
|
versions: { '1.0.0': scriptAt('1.0.0'), '1.1': scriptAt('1.1') },
|
|
219
223
|
};
|
|
@@ -12,6 +12,7 @@ import { jsonClone } from '../../../core/json-clone.js';
|
|
|
12
12
|
import { VARIANT_OPERATION } from './spec.js';
|
|
13
13
|
import { checkTransform, nearestIn } from './check.js';
|
|
14
14
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
15
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
15
16
|
/**
|
|
16
17
|
* Emit a transform's `inputs` in the canonical shape the node's runtime reads:
|
|
17
18
|
* `collection` as a BARE variable path (not `=js:`-prefixed — it is a path
|
|
@@ -277,9 +278,12 @@ function transformAt(typeName, variant, version, factory) {
|
|
|
277
278
|
output: () => ({ kind: 'opaque' }),
|
|
278
279
|
};
|
|
279
280
|
}
|
|
281
|
+
/** Every key of `transform()`'s options (builder-sdk#1990); `tsc` holds the list to `TransformInputs`. */
|
|
282
|
+
const TRANSFORM_OPTIONS = { inputs: declareKeys({ collection: true, variant: true, operations: true }) };
|
|
280
283
|
function transformType(typeName, variant, factory) {
|
|
281
284
|
return {
|
|
282
285
|
kind: 'transform', typeName, factory: 'transform', defaultVersion: '1.0.0',
|
|
286
|
+
optionKeys: TRANSFORM_OPTIONS,
|
|
283
287
|
versions: { '1.0.0': transformAt(typeName, variant, '1.0.0', factory), '1.1': transformAt(typeName, variant, '1.1', factory) },
|
|
284
288
|
// The generic type is the one for any spec without a KNOWN variant — an unknown
|
|
285
289
|
// one included, so check still reports it (see serialize above).
|
|
@@ -19,6 +19,7 @@ import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
|
19
19
|
import { checkSchedule, checkStartingPrompts, fitsScheduleV12, isIsoInterval } from './check.js';
|
|
20
20
|
import { isJsExpressionValue } from '../../../core/wire-expr.js';
|
|
21
21
|
import { SCHEDULE_PRESETS } from './spec.js';
|
|
22
|
+
import { declareKeys } from '../../../core/option-keys.js';
|
|
22
23
|
/** A Quartz cron expression: 6–7 whitespace-separated fields, none of them an ISO `R/` interval. */
|
|
23
24
|
function isQuartz(every) {
|
|
24
25
|
// An `=js:` expression can have six tokens too; it is not cron.
|
|
@@ -175,8 +176,12 @@ export const manualTriggerType = {
|
|
|
175
176
|
// survives recompilation (design §5.3).
|
|
176
177
|
print: () => ({ factory: 'manual' }),
|
|
177
178
|
};
|
|
179
|
+
/** Every key of each trigger factory's options (builder-sdk#1990); `tsc` holds each list to its type. */
|
|
180
|
+
const SCHEDULED_OPTIONS = { inputs: declareKeys({ every: true }) };
|
|
181
|
+
const CONVERSATION_TRIGGER_OPTIONS = { appearance: declareKeys({ welcomeTitle: true, welcomeDescription: true, startingPrompts: true, personalWorkspaceConnectionsOnly: true }) };
|
|
178
182
|
export const scheduledTriggerType = {
|
|
179
183
|
kind: 'scheduled', typeName: 'core.trigger.scheduled', factory: 'scheduled',
|
|
184
|
+
optionKeys: SCHEDULED_OPTIONS,
|
|
180
185
|
noun: 'schedule',
|
|
181
186
|
serialize: (spec, ctx) => {
|
|
182
187
|
const version = scheduledVersion(spec.inputs, ctx.version);
|
|
@@ -289,6 +294,7 @@ function liftAppearance(node) {
|
|
|
289
294
|
}
|
|
290
295
|
export const conversationTriggerType = {
|
|
291
296
|
kind: 'conversation', typeName: 'core.trigger.conversation', factory: 'conversationTrigger',
|
|
297
|
+
optionKeys: CONVERSATION_TRIGGER_OPTIONS,
|
|
292
298
|
onePerFlow: 'SINGLE_CONVERSATION_TRIGGER',
|
|
293
299
|
serialize: (spec, ctx) => {
|
|
294
300
|
const version = ctx.version ?? CONVERSATION_DEFAULT_VERSION;
|
package/dist/serialize.js
CHANGED
|
@@ -15,6 +15,9 @@ import { connectorRawNodeRefusal } from './nodes/connector/flow/family.js';
|
|
|
15
15
|
import { isAgentResourceType } from './nodes/agent/flow/family.js';
|
|
16
16
|
import { CompileRefusal, LibraryRequiredRefusal } from './core/compile-refusal.js';
|
|
17
17
|
import { nearestName } from './core/edit-distance.js';
|
|
18
|
+
import { unknownOptionRefusal } from './core/option-keys.js';
|
|
19
|
+
import { ownEntry } from './core/own-entry.js';
|
|
20
|
+
import { ENTRY_POINT_OPTION_KEYS, STEP_OPTION_KEYS, TRIGGER_OPTION_KEYS } from './flow-option-keys.js';
|
|
18
21
|
import { rawNodeInputProblem, registeredRawType } from './raw-node-advice.js';
|
|
19
22
|
import { planContributionBindings } from './core/contribution-bindings.js';
|
|
20
23
|
import { declaredErrorPortRefusal, definitionHasErrorPort, errorPortRefusal } from './core/error-port.js';
|
|
@@ -26,7 +29,7 @@ import { indexCarriedDefinitions } from './core/carried-definitions.js';
|
|
|
26
29
|
import { sharedDefinition } from './core/shared-definition.js';
|
|
27
30
|
import { FlowBuildError, loweringExpressionErrors } from './flow-expr-check.js';
|
|
28
31
|
import { connectionConnectors } from './bindings-v2.js';
|
|
29
|
-
import { BindingRefusal, bindingLabelRefusal, connectionStubMessage } from './core/binding-messages.js';
|
|
32
|
+
import { BindingRefusal, bindingLabelRefusal, bindingPairRefusal, connectionStubMessage } from './core/binding-messages.js';
|
|
30
33
|
import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitViolation } from './core/hitl-routing.js';
|
|
31
34
|
import { STICKY_NOTE_TYPE, STICKY_NOTE_TYPE_VERSION } from './core/definitionless-node-types.js';
|
|
32
35
|
import { placeholderPosition } from './node-placement.js';
|
|
@@ -463,12 +466,27 @@ function resolveBinding(opts, name, attribute, where, target) {
|
|
|
463
466
|
opts.warn({ code: 'CONNECTION_STUB', message: stub });
|
|
464
467
|
return value;
|
|
465
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* A node's `{ connection, folder }` labels, each resolved by {@link resolveBinding}
|
|
471
|
+
* (its own refusals first), then the pair judged by `bindingPairRefusal`: one
|
|
472
|
+
* label for both, or two labels that resolve to one real key, is
|
|
473
|
+
* `BINDING_CONNECTION_IS_FOLDER` (#1968).
|
|
474
|
+
*/
|
|
475
|
+
function resolveBindingPair(opts, labels, where, target) {
|
|
476
|
+
const connectionId = resolveBinding(opts, labels.connection, 'connection', where, target);
|
|
477
|
+
const folderKey = resolveBinding(opts, labels.folder, 'folder', where, target);
|
|
478
|
+
const refused = bindingPairRefusal(opts.bindings, labels, where, target);
|
|
479
|
+
if (refused)
|
|
480
|
+
throw refused;
|
|
481
|
+
return { connectionId, folderKey };
|
|
482
|
+
}
|
|
466
483
|
/** What the shared event-subscription emission (`core/event-subscription.ts`) needs from these options. */
|
|
467
484
|
function eventEnv(opts) {
|
|
468
485
|
return {
|
|
469
486
|
...(opts.library !== undefined ? { library: opts.library } : {}),
|
|
470
487
|
...(opts.bindings !== undefined ? { bindings: opts.bindings } : {}),
|
|
471
488
|
resolveBinding: (name, attribute, where, target) => resolveBinding(opts, name, attribute, where, target),
|
|
489
|
+
resolveBindingPair: (labels, where, target) => resolveBindingPair(opts, labels, where, target),
|
|
472
490
|
};
|
|
473
491
|
}
|
|
474
492
|
/**
|
|
@@ -2004,6 +2022,7 @@ function serializeFlow(built, opts) {
|
|
|
2004
2022
|
// lowered eagerly to `$vars.start.output.x`, so a rename is applied by the
|
|
2005
2023
|
// same `renameRefs` pass that rewrites step names (see `rename.nodeIds`).
|
|
2006
2024
|
const triggerId = built.triggerId ?? 'start';
|
|
2025
|
+
refuseUnknownRootOptions('trigger', triggerId, built.trigger, built.triggerOptions, '.trigger()');
|
|
2007
2026
|
const trigger = emitRootNode('trigger', triggerId, built.trigger, built.triggerOptions?.version, () => {
|
|
2008
2027
|
// A custom FlowTrigger subclass (no `kind`) compiles through its own
|
|
2009
2028
|
// contribution: exact definition, author inputs, definition-owned identity.
|
|
@@ -2292,6 +2311,7 @@ function serializeFlow(built, opts) {
|
|
|
2292
2311
|
: bundledDefinition(typeName, v) ?? carriedFor(typeName, v)),
|
|
2293
2312
|
bindings: resourceBindings,
|
|
2294
2313
|
resolveBinding: ((name, attribute, at, target) => resolveBinding(bindingOpts, name, attribute, at, target)),
|
|
2314
|
+
resolveBindingPair: (labels, at, target) => resolveBindingPair(bindingOpts, labels, at, target),
|
|
2295
2315
|
bindConnection: (c) => {
|
|
2296
2316
|
const { entries } = connectionResourceBindings({
|
|
2297
2317
|
def: { model: c.model },
|
|
@@ -2522,6 +2542,46 @@ function serializeFlow(built, opts) {
|
|
|
2522
2542
|
}
|
|
2523
2543
|
refuseOn(scope, step.name, refusal);
|
|
2524
2544
|
}
|
|
2545
|
+
/**
|
|
2546
|
+
* FLOW_UNKNOWN_OPTION for every option object of `spec` its type declares
|
|
2547
|
+
* (`optionKeys`, flow-node-type.ts) and for `options` against `optionKeys`:
|
|
2548
|
+
* each key the serializer does not know would be dropped from the file, so
|
|
2549
|
+
* it is refused (builder-sdk#1990). `report` is how the caller refuses: on
|
|
2550
|
+
* a step, or on a root. A spec of no registered type, a custom node's, has
|
|
2551
|
+
* no declared keys and stays open.
|
|
2552
|
+
*/
|
|
2553
|
+
function unknownOptions(spec, lists, factory, options, optionKeys, where, report) {
|
|
2554
|
+
for (const [field, keys] of Object.entries(lists ?? {})) {
|
|
2555
|
+
if (keys === undefined || spec === null || typeof spec !== 'object')
|
|
2556
|
+
continue;
|
|
2557
|
+
const call = factory !== undefined ? `${factory}()${field === 'inputs' ? '' : `'s ${field}`}` : field;
|
|
2558
|
+
const refusal = unknownOptionRefusal(spec[field], keys, call, where);
|
|
2559
|
+
if (refusal)
|
|
2560
|
+
report(refusal);
|
|
2561
|
+
}
|
|
2562
|
+
if (optionKeys) {
|
|
2563
|
+
const refusal = unknownOptionRefusal(options, optionKeys.keys, `${optionKeys.call}'s options`, where);
|
|
2564
|
+
if (refusal)
|
|
2565
|
+
report(refusal);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
/** {@link unknownOptions} for one step: its spec's objects (an action's, a `.stepSwitch()`'s) and its builder options. */
|
|
2569
|
+
function refuseUnknownStepOptions(scope, step) {
|
|
2570
|
+
if (!('name' in step))
|
|
2571
|
+
return;
|
|
2572
|
+
const spec = 'spec' in step ? step.spec : undefined;
|
|
2573
|
+
const entry = spec !== undefined && typeof spec.kind === 'string' ? FLOW_NODE_TYPES.byKind(spec.kind, spec) : undefined;
|
|
2574
|
+
const lists = entry?.type.optionKeys;
|
|
2575
|
+
unknownOptions(spec, lists, entry?.type.factory, 'options' in step ? step.options : undefined, ownEntry(STEP_OPTION_KEYS, step.kind), `step "${step.name}"`, (refusal) => refuseOn(scope, step.name, refusal));
|
|
2576
|
+
}
|
|
2577
|
+
/** {@link unknownOptions} for one root: its trigger spec's objects and its `.trigger()` / `.entryPoint()` options. */
|
|
2578
|
+
function refuseUnknownRootOptions(name, nodeId, spec, options, call) {
|
|
2579
|
+
const kind = spec?.kind;
|
|
2580
|
+
const type = typeof kind === 'string' && !(spec instanceof FlowTrigger && !('kind' in spec)) ? FLOW_TRIGGER_TYPES.byKind(kind)?.type : undefined;
|
|
2581
|
+
const keys = call === '.trigger()' ? TRIGGER_OPTION_KEYS : ENTRY_POINT_OPTION_KEYS;
|
|
2582
|
+
unknownOptions(spec, type?.optionKeys, type?.factory, options, { call, keys }, call === '.trigger()' ? '.trigger()' : `.entryPoint("${name}")`, (refusal) => { if (!opts.collect)
|
|
2583
|
+
throw refusal; record(refusal, name, nodeId); });
|
|
2584
|
+
}
|
|
2525
2585
|
function refuseOn(scope, stepName, refusal) {
|
|
2526
2586
|
if (!opts.collect || stepName === undefined)
|
|
2527
2587
|
throw refusal;
|
|
@@ -2616,6 +2676,7 @@ function serializeFlow(built, opts) {
|
|
|
2616
2676
|
library: opts.library,
|
|
2617
2677
|
events: eventEnv(opts),
|
|
2618
2678
|
resolveBinding: (name, attribute, where, target) => resolveBinding(opts, name, attribute, where, target),
|
|
2679
|
+
resolveBindingPair: (labels, where, target) => resolveBindingPair(opts, labels, where, target),
|
|
2619
2680
|
bindConnection: (b) => {
|
|
2620
2681
|
const { entries } = connectionResourceBindings({ def: { model: b.model }, ...b }, resourceBindings);
|
|
2621
2682
|
for (const e of entries)
|
|
@@ -2741,6 +2802,10 @@ function serializeFlow(built, opts) {
|
|
|
2741
2802
|
return emitRegistered(registered, step, tails, scope, parentId);
|
|
2742
2803
|
if (spec.kind === 'subflow') {
|
|
2743
2804
|
refuseChildRoots(spec.child, step.name);
|
|
2805
|
+
// The child's `.trigger(manual(), { label, version, updates })` names its Start node: refuse a key it would drop.
|
|
2806
|
+
const childOptions = unknownOptionRefusal(spec.child?.triggerOptions, TRIGGER_OPTION_KEYS, ".trigger()'s options", `subflow "${step.name}"`);
|
|
2807
|
+
if (childOptions)
|
|
2808
|
+
refuseOn(scope, step.name, childOptions);
|
|
2744
2809
|
const id = stepUid(scope, step.name);
|
|
2745
2810
|
// `subflows` is ONE flat map for the whole file, keyed by the calling
|
|
2746
2811
|
// node's id. `stepUid` draws from the file-wide allocator, including in
|
|
@@ -2938,8 +3003,14 @@ function serializeFlow(built, opts) {
|
|
|
2938
3003
|
+ `path continues from it and ${'name' in step ? `"${step.name}"` : `.${step.kind}()`} after it would `
|
|
2939
3004
|
+ `have no incoming edge. Route each exit with .stepToList('<port>', …), e.g. .stepToList('case-<id>', …).`));
|
|
2940
3005
|
}
|
|
3006
|
+
// A family's own refusal of a key it knows is wrong (IXP_FORBIDDEN_INPUT,
|
|
3007
|
+
// AGENT_NO_KEY for `agent:`) says more than FLOW_UNKNOWN_OPTION, so an
|
|
3008
|
+
// action's emission goes first; any other step is judged before it.
|
|
3009
|
+
if (step.kind !== 'action')
|
|
3010
|
+
refuseUnknownStepOptions(scope, step);
|
|
2941
3011
|
if (step.kind === 'action') {
|
|
2942
3012
|
tails = emitStep(step, tails, scope, parentId, () => { applyUpdates(step); applyLabel(step); });
|
|
3013
|
+
refuseUnknownStepOptions(scope, step);
|
|
2943
3014
|
lastAction = step.name;
|
|
2944
3015
|
// A fan-out human task's `action: 'End'` outcomes end the run here: the
|
|
2945
3016
|
// flow runtime never reads `action`, so only an End node can. When the
|
|
@@ -3493,6 +3564,7 @@ function serializeFlow(built, opts) {
|
|
|
3493
3564
|
throw new CompileRefusal('ENTRY_POINT_DUP_ID', `.entryPoint("${ep.id}"): the id collides with a step, the trigger, or another entry point.`);
|
|
3494
3565
|
}
|
|
3495
3566
|
takenIds.add(ep.id);
|
|
3567
|
+
refuseUnknownRootOptions(ep.id, ep.id, ep.trigger, ep.options, '.entryPoint()');
|
|
3496
3568
|
// Stood in when refused in collect mode, so its prefix and the body are still judged.
|
|
3497
3569
|
emitRootNode(ep.id, ep.id, ep.trigger, ep.options?.version, () => {
|
|
3498
3570
|
const spec = ep.trigger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.102.0",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"@types/node": "^22.7.0",
|
|
122
122
|
"esbuild": "^0.28.1"
|
|
123
123
|
},
|
|
124
|
-
"gitref": "
|
|
124
|
+
"gitref": "ff60f24d741fc03b591278aa1d56ae76e7e3c7d7"
|
|
125
125
|
}
|