@uipath/maestro-builder-sdk 6.8.6 → 6.9.1

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/serialize.js CHANGED
@@ -14,7 +14,7 @@ import { Expr, toExpr, SCHEDULE_PRESETS, DELAY_PRESETS, parseIxpProjectType, fla
14
14
  import { FlowAction, FlowTrigger } from './core/node-classes.js';
15
15
  import { connectorRawNodeRefusal } from './core/connector-raw-node.js';
16
16
  import { dataFabricUnknownInputs } from './core/typed-raw-node.js';
17
- import { bindingSelfNameMessage } from './core/binding-messages.js';
17
+ import { BindingRefusal, GUID_RE, bindingSelfNameMessage, bindingUndeclaredMessage, undeclaredBinding } from './core/binding-messages.js';
18
18
  import { OUTCOME_HANDLE_NODE_TYPES, assertHitlExitInvariant, hitlExitModel, hitlExitViolation, outcomeSlug } from './core/hitl-routing.js';
19
19
  import { declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
20
20
  import { buildConfiguration, transportHttpMethod } from './config.js';
@@ -3064,8 +3064,6 @@ function renderValue(val, rename = NO_RENAME) {
3064
3064
  return val.literal ? val.value : '=js:' + renameRefs(val.js, rename);
3065
3065
  return val;
3066
3066
  }
3067
- /** A tenant resource key — an Integration Service connection id or an Orchestrator folder key — is a GUID. */
3068
- const GUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3069
3067
  /**
3070
3068
  * The all-zero prefix authors reach for when they need "a GUID" and have none:
3071
3069
  * `00000000-0000-0000-0000-000000000001`. No tenant issues these. The same
@@ -3087,6 +3085,12 @@ function connectionStubReason(value) {
3087
3085
  return 'not a GUID';
3088
3086
  return undefined;
3089
3087
  }
3088
+ /** What `registry prepare` takes for an event subscription: its connector key and curated event name. */
3089
+ function eventTarget(sub) {
3090
+ return typeof sub.connector === 'string' && sub.connector !== ''
3091
+ ? { key: sub.connector, ...(typeof sub.event === 'string' && sub.event !== '' ? { action: sub.event } : {}) }
3092
+ : undefined;
3093
+ }
3090
3094
  /**
3091
3095
  * Resolve a symbolic connection/folder name to the resource key that is inlined
3092
3096
  * as `connectionId` / `connectionFolderKey`.
@@ -3100,30 +3104,55 @@ function connectionStubReason(value) {
3100
3104
  * `bindings.json` that never declares the name, and one that declares it with
3101
3105
  * its own name as the `resourceKey`.
3102
3106
  *
3103
- * Only the SELF-REFERENTIAL case is an error here. Emitting the symbolic name
3104
- * when nothing resolves it is long-established and deliberate — compiling
3105
- * against partial or absent bindings is how a flow is authored offline, and the
3106
- * name is the only honest placeholder available. A binding that declares the
3107
- * name and then answers with the name is different: someone wrote the entry, so
3108
- * the intent to bind is explicit, and the one thing it cannot mean is "the
3109
- * resource key is the string `is-sandboxes`".
3107
+ * Two cases are errors here, and they are the two where the author's intent to
3108
+ * bind is on record and the emitted value still cannot be a resource key:
3109
+ *
3110
+ * - SELF-REFERENTIAL (`BINDING_SELF_NAME`): an entry declares the name and then
3111
+ * answers with the name. Someone wrote the entry, and the one thing it cannot
3112
+ * mean is "the resource key is the string `is-sandboxes`".
3113
+ * - UNDECLARED IN A POPULATED FILE (`BINDING_UNDECLARED`): bindings.json declares
3114
+ * entries, none of them answers to this label, and the label is not itself a
3115
+ * GUID. The file is the author's statement of what is bound, so a label it
3116
+ * does not carry is a mismatch between two names for one connection, not
3117
+ * offline authoring. Measured: the 2026-09-23 orchestrator-paths run bound
3118
+ * `slack` (prepare's default label) while the source said `is-sandboxes`;
3119
+ * compile warned, exited 0, and the Slack node answered `400 'Connection' has
3120
+ * an invalid GUID value: 'is-sandboxes'`. Across the eval archive this shape
3121
+ * warned 15 times; 13 were fixed before the final compile and the 2 that were
3122
+ * not are that row's failures (09-18, 09-23) — no green run shipped it.
3110
3123
  *
3111
3124
  * Everything else that cannot be a resource key is a WARNING (`CONNECTION_STUB`),
3112
- * never an error: an unbound symbol, an all-zero GUID, an `<angle>` placeholder,
3113
- * a label. The archive shows those in green runs of simulated and validate-only
3114
- * tasks, where no connection exists to bind — refusing them would push an author
3115
- * with nothing real to bind into inventing a plausible GUID instead, which is
3116
- * worse because nothing can tell. But the 2026-09-01 orchestrator-paths run
3117
- * compiled `00000000-0000-0000-0000-000000000001` with no signal at all and the
3118
- * Slack node answered `401 Invalid Organization or User secret` at dispatch;
3119
- * the author deserves to hear that BEFORE the run.
3125
+ * never an error: a symbol when NO bindings.json is loaded or it declares no
3126
+ * entries, an entry declared without a resourceKey, an all-zero GUID, an
3127
+ * `<angle>` placeholder, a label. Compiling against absent bindings is how a flow
3128
+ * is authored offline, and the name is the only honest placeholder available;
3129
+ * the archive shows those in green runs of simulated and validate-only tasks,
3130
+ * where no connection exists to bind. Refusing them would push an author with
3131
+ * nothing real to bind into inventing a plausible GUID instead, which is worse
3132
+ * because nothing can tell. That is also the route for a connector that is not
3133
+ * bound YET in a file that binds others (a two-connector flow with one prepared,
3134
+ * or a simulated connector next to real ones): declare its label with a
3135
+ * placeholder resourceKey and it stays a warning. Mid-loop compiles took that
3136
+ * state in three archived runs (ipe-drive-to-slack 09-23 `drive`, ipe-jira-
3137
+ * lifecycle 09-04 `entra`, customer-escalation-simulated 09-03 `zendesk`), and
3138
+ * each fixed it before the final compile, so what now costs one refused compile
3139
+ * there was never shipped. The 2026-09-01 orchestrator-paths run compiled
3140
+ * `00000000-0000-0000-0000-000000000001` with no signal at all and the Slack node
3141
+ * answered `401 Invalid Organization or User secret` at dispatch; the author
3142
+ * deserves to hear that BEFORE the run.
3120
3143
  */
3121
- function resolveBinding(opts, name, attribute, where) {
3144
+ function resolveBinding(opts, name, attribute, where, target) {
3122
3145
  if (name === undefined)
3123
3146
  return undefined;
3124
3147
  const resolved = opts.bindings?.resolve(name);
3125
3148
  if (resolved === name) {
3126
- throw new Error(bindingSelfNameMessage(where, name, attribute));
3149
+ throw new BindingRefusal('BINDING_SELF_NAME', bindingSelfNameMessage(where, name, attribute, target));
3150
+ }
3151
+ if (resolved === undefined) {
3152
+ const declared = undeclaredBinding(opts.bindings, name);
3153
+ if (declared) {
3154
+ throw new BindingRefusal('BINDING_UNDECLARED', bindingUndeclaredMessage(where, name, attribute, declared, target));
3155
+ }
3127
3156
  }
3128
3157
  const value = resolved ?? name;
3129
3158
  const reason = connectionStubReason(value);
@@ -3136,8 +3165,10 @@ function resolveBinding(opts, name, attribute, where) {
3136
3165
  + `and writes both entries into bindings.json (several candidates: pass \`--connection-id <id>\` from the list it `
3137
3166
  + `prints); by hand, read Id and FolderKey from \`uip is connections list --all-folders --output json\`.`;
3138
3167
  const message = resolved === undefined
3139
- ? `${where}: ${attribute} "${name}" has no bindings.json entry`
3140
- + `${describeDeclared(opts.bindings)}, so the .flow carries the symbolic name as its ${key} and the run `
3168
+ ? `${where}: ${declaredWithoutKey(opts.bindings, name)
3169
+ ? `binding "${name}" is declared in bindings.json with no resourceKey`
3170
+ : `${attribute} "${name}" has no bindings.json entry${describeDeclared(opts.bindings)}`}`
3171
+ + `, so the .flow carries the symbolic name as its ${key} and the run `
3141
3172
  + `faults at dispatch with ${fault}. ${remedy}`
3142
3173
  : `${where}: binding "${name}" resolves to "${value}", which is ${reason} and so never a tenant ${key}. `
3143
3174
  + `The .flow carries it and the run faults at dispatch with ${fault}. ${remedy}`;
@@ -3145,6 +3176,10 @@ function resolveBinding(opts, name, attribute, where) {
3145
3176
  }
3146
3177
  return value;
3147
3178
  }
3179
+ /** An entry answers to `name` but carries no resourceKey or default — the placeholder route, still a warning. */
3180
+ function declaredWithoutKey(bindings, name) {
3181
+ return (bindings?.declared?.() ?? []).includes(name) || bindings?.entry?.(name) !== undefined;
3182
+ }
3148
3183
  /** " (bindings.json declares: a, b)" / " (no bindings.json was loaded)" — what the author CAN refer to. */
3149
3184
  function describeDeclared(bindings) {
3150
3185
  const names = bindings?.declared?.() ?? [];
@@ -3282,8 +3317,8 @@ function flattenWhere(where, declared) {
3282
3317
  return out;
3283
3318
  }
3284
3319
  function eventDetail(rc, sub, nodeId, opts) {
3285
- const conn = resolveBinding(opts, sub.connection, 'connection', `event node "${nodeId}"`);
3286
- const folder = resolveBinding(opts, sub.folder, 'folder', `event node "${nodeId}"`);
3320
+ const conn = resolveBinding(opts, sub.connection, 'connection', `event node "${nodeId}"`, eventTarget(sub));
3321
+ const folder = resolveBinding(opts, sub.folder, 'folder', `event node "${nodeId}"`, eventTarget(sub));
3287
3322
  const op = (rc.entry?.operation ?? {});
3288
3323
  const filters = sub.filters ?? [];
3289
3324
  // A GENERIC event (`activityType: GenericTrigger` — Data Fabric, Salesforce,
@@ -4106,8 +4141,8 @@ export function serialize(built, opts = {}) {
4106
4141
  const { entries } = connectionResourceBindings({
4107
4142
  def: eventTriggerRc.v1def,
4108
4143
  connectorKey: eventTriggerRc.connectorKey,
4109
- connectionId: resolveBinding(opts, sub.connection, 'connection', 'event trigger'),
4110
- folderKey: resolveBinding(opts, sub.folder, 'folder', 'event trigger'),
4144
+ connectionId: resolveBinding(opts, sub.connection, 'connection', 'event trigger', eventTarget(sub)),
4145
+ folderKey: resolveBinding(opts, sub.folder, 'folder', 'event trigger', eventTarget(sub)),
4111
4146
  }, resourceBindings);
4112
4147
  for (const b of entries)
4113
4148
  resourceBindings.set(b.id, b);
@@ -4231,8 +4266,8 @@ export function serialize(built, opts = {}) {
4231
4266
  const id = stepUid(scope, step.name);
4232
4267
  const node = makeNode(rc.nodeType, id, step.name, { parentId, requestedVersion: step.options?.version, def: rc.v1def });
4233
4268
  declareListOutputType(node, rc);
4234
- const conn = resolveBinding(opts, spec.connection, 'connection', `connector "${step.name}"`);
4235
- const folder = resolveBinding(opts, spec.folder, 'folder', `connector "${step.name}"`);
4269
+ const conn = resolveBinding(opts, spec.connection, 'connection', `connector "${step.name}"`, { key: spec.key, action: spec.action });
4270
+ const folder = resolveBinding(opts, spec.folder, 'folder', `connector "${step.name}"`, { key: spec.key, action: spec.action });
4236
4271
  // The platform reaches the connection through the flow's `bindings[]`,
4237
4272
  // never through `inputs.detail` — without this pair the run faults with
4238
4273
  // `[102010]` (board G-19; see connectionResourceBindings).
@@ -4396,7 +4431,7 @@ export function serialize(built, opts = {}) {
4396
4431
  ...(s.guardrails === undefined ? {} : { guardrails: s.guardrails }),
4397
4432
  // The two DESCRIPTOR ARRAYS. `agentInputVariables` entries carry the
4398
4433
  // binding expression; `agentOutputVariables` entries are name + type only,
4399
- // and a runner coerces the model's completion to exactly these keys.
4434
+ // and the runtime's structured final call fills exactly these keys.
4400
4435
  //
4401
4436
  // `id` is the FLAT NAME, not the author's — the platform re-derives this
4402
4437
  // array from the node's prompts and keeps a pre-existing entry only when
@@ -5131,8 +5166,8 @@ export function serialize(built, opts = {}) {
5131
5166
  const { entries: waitConnBindings } = connectionResourceBindings({
5132
5167
  def: rc.v1def,
5133
5168
  connectorKey: rc.connectorKey,
5134
- connectionId: resolveBinding(opts, sub.connection, 'connection', `waitForEvent "${step.name}"`),
5135
- folderKey: resolveBinding(opts, sub.folder, 'folder', `waitForEvent "${step.name}"`),
5169
+ connectionId: resolveBinding(opts, sub.connection, 'connection', `waitForEvent "${step.name}"`, eventTarget(sub)),
5170
+ folderKey: resolveBinding(opts, sub.folder, 'folder', `waitForEvent "${step.name}"`, eventTarget(sub)),
5136
5171
  }, resourceBindings);
5137
5172
  for (const b of waitConnBindings)
5138
5173
  resourceBindings.set(b.id, b);
@@ -5986,8 +6021,8 @@ export function serialize(built, opts = {}) {
5986
6021
  const { entries } = connectionResourceBindings({
5987
6022
  def: rc.v1def,
5988
6023
  connectorKey: rc.connectorKey,
5989
- connectionId: resolveBinding(opts, sub.connection, 'connection', 'onEvent() entry point'),
5990
- folderKey: resolveBinding(opts, sub.folder, 'folder', 'onEvent() entry point'),
6024
+ connectionId: resolveBinding(opts, sub.connection, 'connection', 'onEvent() entry point', eventTarget(sub)),
6025
+ folderKey: resolveBinding(opts, sub.folder, 'folder', 'onEvent() entry point', eventTarget(sub)),
5991
6026
  }, resourceBindings);
5992
6027
  for (const b of entries)
5993
6028
  resourceBindings.set(b.id, b);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.8.6",
3
+ "version": "6.9.1",
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",
@@ -87,5 +87,5 @@
87
87
  "@types/node": "^22.7.0",
88
88
  "esbuild": "^0.28.1"
89
89
  },
90
- "gitref": "503ff8140144536c938e0b0ad0356b6ccb41b9f9"
90
+ "gitref": "f637225ed0a30014831ffab8733374625126f6fb"
91
91
  }