@uipath/maestro-builder-sdk 6.97.0 → 6.97.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.
@@ -605,6 +605,14 @@ export interface ProcessMetadata {
605
605
  * the product's `name` is the SOURCE variable's display name, not the target's,
606
606
  * and no derivation reproduces that.
607
607
  *
608
+ * A payload can also CONFIGURE its element: Studio Web puts a connector call on a
609
+ * message end event or intermediate throw event (`Intsvc.ActivityExecution`), and a
610
+ * connector wait on an intermediate catch or boundary event (`Intsvc.WaitForEvent`),
611
+ * none of which is the element the registry names for the type. Those carry their
612
+ * connector key, connection binding, operation and request rows in
613
+ * {@link ExtensionPayload.contextRows} and {@link ExtensionPayload.inputRows}, and
614
+ * the runtime reads them there (`IntSvcIntermediateThrowEventWorkflowV2`).
615
+ *
608
616
  * @example
609
617
  * **A start event mapping two process inputs onto variables**
610
618
  * ```ts
@@ -647,6 +655,34 @@ export interface ExtensionPayload {
647
655
  tag?: 'uipath:activity' | 'uipath:event' | 'uipath:mapping';
648
656
  /** The `uipath:type` `version` attribute, when it is not `v1` — see `ActivityNodeOpts.typeVersion`. */
649
657
  typeVersion?: string;
658
+ /**
659
+ * The `uipath:context` rows, emitted verbatim — see {@link TypedContextRow}.
660
+ *
661
+ * Decompile writes these for a payload that configures its element, such as a
662
+ * connector call on an end event:
663
+ *
664
+ * ```ts
665
+ * .endEvent('notify', {
666
+ * message: '',
667
+ * payload: {
668
+ * type: 'Intsvc.ActivityExecution',
669
+ * contextRows: [
670
+ * { name: 'connectorKey', value: 'uipath-microsoft-outlook365' },
671
+ * { name: 'connection', value: '=bindings.outlook' },
672
+ * ],
673
+ * outputRows: [],
674
+ * },
675
+ * })
676
+ * ```
677
+ *
678
+ * Without them the recompiled element calls a connector with no connector key
679
+ * and no connection, and `check` reports `INTSVC_CONNECTION_MISSING`.
680
+ */
681
+ contextRows?: TypedContextRow[];
682
+ /** The `uipath:inputSchema` body inside `uipath:context` — see `ActivityNodeOpts.inputSchema`. */
683
+ inputSchema?: unknown;
684
+ /** The payload's own `uipath:input` rows, emitted verbatim — see {@link TypedInputRow}. */
685
+ inputRows?: TypedInputRow[];
650
686
  }
651
687
  /**
652
688
  * Options for `.startEvent()`. At most one of `message` / `timer` picks the
@@ -1073,6 +1073,11 @@ function emitDecorationPayload(payload, type) {
1073
1073
  ['type', tsText(type)],
1074
1074
  ['tag', isSnapshotType(type) ? undefined : tsText(payloadTagOf(payload))],
1075
1075
  ['typeVersion', version && version !== 'v1' ? tsText(version) : undefined],
1076
+ // A payload that configures its element (a connector call on an end event, a
1077
+ // connector wait on a catch or boundary event) keeps its context and input rows.
1078
+ ['contextRows', emitContextRows(payload)],
1079
+ ['inputSchema', payload.context?.inputSchema?.body !== undefined ? jsonLiteral(payload.context.inputSchema.body) : undefined],
1080
+ ['inputRows', emitInputRows(payload.input ?? [])],
1076
1081
  ['outputRows', emitOutputRows(payload) ?? '[]'],
1077
1082
  ]);
1078
1083
  }
@@ -2103,9 +2108,9 @@ function typeDescribesElement(kind, type) {
2103
2108
  * <bpmn:messageEventDefinition />
2104
2109
  * </bpmn:startEvent>
2105
2110
  *
2106
- * The decoration form (`payload: { type, outputRows }`) has no room for the context
2107
- * rows, and the typed form needs the element, the tag and the definition — all of
2108
- * which the file states. The typed form writes a definition with nothing in it, so
2111
+ * The typed form needs the element, the tag and the definition — all of which the
2112
+ * file states — and makes the trigger the node, not a decoration of a plain start
2113
+ * event, which is what an unlisted trigger is. The typed form writes a definition with nothing in it, so
2109
2114
  * only a bare one (no reference, no body; an `id` is fine) is carried; anything else, and an
2110
2115
  * attribute `.activity()` cannot write (a boundary's host, a non-interrupting start),
2111
2116
  * refuses here instead of losing it.
@@ -2154,9 +2159,8 @@ function definitionIsBare(def) {
2154
2159
  * legal, and the boundary's extra two are additive.
2155
2160
  */
2156
2161
  function emitEvent(chain, el, kind, payload, type) {
2157
- // `outputRows` is the only payload shape an event carries in the corpus. A
2158
- // `context` or `input` row on one would mean the registry describes the element
2159
- // after all, which is the branch this function is not on.
2162
+ // A decorating payload carries its output rows, and — on a connector call or wait
2163
+ // hosted by an event — its context and input rows too (`emitDecorationPayload`).
2160
2164
  const eventPayload = emitDecorationPayload(payload, type);
2161
2165
  if (kind === 'boundaryEvent') {
2162
2166
  chain.add(`.boundaryEvent(${tsText(el.id)}, ${opts([
@@ -872,7 +872,13 @@ function attachExtensionPayload(ctx, el, payload) {
872
872
  if (!payload)
873
873
  return;
874
874
  const ext = (el.extensionElements ??= ctx.m.create('bpmn:ExtensionElements', { values: [] }));
875
- (ext.values ??= []).unshift(createExtensionPayload(ctx.m, payload.type, payload.outputRows, { tag: payload.tag, typeVersion: payload.typeVersion }));
875
+ (ext.values ??= []).unshift(createExtensionPayload(ctx.m, payload.type, payload.outputRows, {
876
+ tag: payload.tag,
877
+ typeVersion: payload.typeVersion,
878
+ contextRows: payload.contextRows,
879
+ inputSchema: payload.inputSchema,
880
+ inputRows: payload.inputRows,
881
+ }));
876
882
  }
877
883
  /**
878
884
  * Attach what every ACTIVITY can carry — a retry policy and a multi-instance loop
@@ -449,11 +449,18 @@ export declare function verbatimOutputRows(m: BpmnModdle, rows: TypedOutputRow[]
449
449
  * @param m - The moddle instance.
450
450
  * @param type - The extension type, e.g. `BPMN.Variables` or `uipath:Activity`.
451
451
  * @param rows - Output rows, emitted verbatim.
452
+ * @param carried - What the file carried beside the outputs: the tag and type version
453
+ * for a type the snapshot lacks, and the context, input schema and input rows of a
454
+ * payload that configures its element (a connector call on an end event), each
455
+ * emitted verbatim.
452
456
  * @returns The payload element, ready to go inside a `bpmn:ExtensionElements`.
453
457
  */
454
458
  export declare function createExtensionPayload(m: BpmnModdle, type: string, rows: TypedOutputRow[], carried?: {
455
459
  tag?: string;
456
460
  typeVersion?: string;
461
+ contextRows?: TypedContextRow[];
462
+ inputSchema?: unknown;
463
+ inputRows?: TypedInputRow[];
457
464
  }): El;
458
465
  /**
459
466
  * The context fields this type requires to be a `=bindings.<id>` reference rather
@@ -488,6 +488,40 @@ export function verbatimInputRows(m, rows) {
488
488
  return m.create('uipath:Input', props);
489
489
  });
490
490
  }
491
+ /** `uipath:input` context rows exactly as the caller spelled them, deriving nothing. */
492
+ function verbatimContextRows(m, rows) {
493
+ return rows.map((row) => {
494
+ const props = { name: row.name, type: row.type ?? 'string' };
495
+ if (row.required)
496
+ props.required = 'true';
497
+ if (row.target !== undefined)
498
+ props.target = row.target;
499
+ if (row.value !== undefined)
500
+ props.value = row.value;
501
+ if (row.body !== undefined)
502
+ props.body = jsonBody(row.body);
503
+ return m.create('uipath:Input', props);
504
+ });
505
+ }
506
+ /**
507
+ * The `uipath:context` around `rows` and `inputSchema`, or `undefined` when there is
508
+ * neither. The schema is a sibling of the rows, and can be the only thing in it — a
509
+ * script task's context carries an inputSchema and no rows at all.
510
+ */
511
+ function contextElement(m, rows, inputSchema) {
512
+ if (!rows.length && inputSchema === undefined)
513
+ return undefined;
514
+ const context = {};
515
+ if (rows.length)
516
+ context.input = rows;
517
+ if (inputSchema !== undefined) {
518
+ context.inputSchema = m.create('uipath:InputSchema', {
519
+ type: 'jsonSchema',
520
+ body: typeof inputSchema === 'string' ? inputSchema : JSON.stringify(inputSchema),
521
+ });
522
+ }
523
+ return m.create('uipath:Context', context);
524
+ }
491
525
  /** The `uipath:output` row, when the type declares one. */
492
526
  function outputRow(m, spec, varName) {
493
527
  if (!spec.output)
@@ -536,33 +570,11 @@ varType) {
536
570
  payload.skipCondition = input.skipCondition;
537
571
  }
538
572
  const ctx = input.contextRows
539
- ? input.contextRows.map((row) => {
540
- const props = { name: row.name, type: row.type ?? 'string' };
541
- if (row.required)
542
- props.required = 'true';
543
- if (row.target !== undefined)
544
- props.target = row.target;
545
- if (row.value !== undefined)
546
- props.value = row.value;
547
- if (row.body !== undefined)
548
- props.body = jsonBody(row.body);
549
- return m.create('uipath:Input', props);
550
- })
573
+ ? verbatimContextRows(m, input.contextRows)
551
574
  : contextRows(m, type, spec, input.context ?? {}, input.contextVerbatim);
552
- // The schema is a sibling of the context's rows, and can be the only thing in it —
553
- // a script task's context carries an inputSchema and no rows at all.
554
- if (ctx.length || input.inputSchema !== undefined) {
555
- const context = {};
556
- if (ctx.length)
557
- context.input = ctx;
558
- if (input.inputSchema !== undefined) {
559
- context.inputSchema = m.create('uipath:InputSchema', {
560
- type: 'jsonSchema',
561
- body: typeof input.inputSchema === 'string' ? input.inputSchema : JSON.stringify(input.inputSchema),
562
- });
563
- }
564
- payload.context = m.create('uipath:Context', context);
565
- }
575
+ const context = contextElement(m, ctx, input.inputSchema);
576
+ if (context)
577
+ payload.context = context;
566
578
  // Spelled out by the caller: emit exactly these rows, deriving nothing — see
567
579
  // TypedNodeInput.inputRows. This is what lets a connector's per-parameter rows
568
580
  // (`name="start" type="string" value="0" target="query"`) survive a round trip.
@@ -653,6 +665,10 @@ export function verbatimOutputRows(m, rows) {
653
665
  * @param m - The moddle instance.
654
666
  * @param type - The extension type, e.g. `BPMN.Variables` or `uipath:Activity`.
655
667
  * @param rows - Output rows, emitted verbatim.
668
+ * @param carried - What the file carried beside the outputs: the tag and type version
669
+ * for a type the snapshot lacks, and the context, input schema and input rows of a
670
+ * payload that configures its element (a connector call on an end event), each
671
+ * emitted verbatim.
656
672
  * @returns The payload element, ready to go inside a `bpmn:ExtensionElements`.
657
673
  */
658
674
  export function createExtensionPayload(m, type, rows, carried) {
@@ -661,6 +677,14 @@ export function createExtensionPayload(m, type, rows, carried) {
661
677
  version: 'v1',
662
678
  type: m.create('uipath:Type', { value: type, version: carried?.typeVersion ?? 'v1' }),
663
679
  };
680
+ // The rows a decorated element carries beside its outputs, in the order a typed
681
+ // node writes them: context, then inputs, then outputs.
682
+ const context = contextElement(m, verbatimContextRows(m, carried?.contextRows ?? []), carried?.inputSchema);
683
+ if (context)
684
+ payload.context = context;
685
+ const ins = verbatimInputRows(m, carried?.inputRows ?? []);
686
+ if (ins.length)
687
+ payload.input = ins;
664
688
  const out = verbatimOutputRows(m, rows);
665
689
  if (out.length)
666
690
  payload.output = out;
package/dist/bpmn-api.md CHANGED
@@ -836,6 +836,9 @@ An extension payload carried by an element the payload does not describe.
836
836
  - `ExtensionPayload.outputRows: TypedOutputRow[]` — `uipath:output` rows, emitted exactly as given — see TypedOutputRow.
837
837
  - `ExtensionPayload.tag?: 'uipath:activity' | 'uipath:event' | 'uipath:mapping'` — The payload's own tag — `'uipath:activity'`, `'uipath:event'` or `'uipath:mapping'` — for a `type` the registry snapshot…
838
838
  - `ExtensionPayload.typeVersion?: string` — The `uipath:type` `version` attribute, when it is not `v1` — see `ActivityNodeOpts.typeVersion`.
839
+ - `ExtensionPayload.contextRows?: TypedContextRow[]` — The `uipath:context` rows, emitted verbatim — see TypedContextRow.
840
+ - `ExtensionPayload.inputSchema?: unknown` — The `uipath:inputSchema` body inside `uipath:context` — see `ActivityNodeOpts.inputSchema`.
841
+ - `ExtensionPayload.inputRows?: TypedInputRow[]` — The payload's own `uipath:input` rows, emitted verbatim — see TypedInputRow.
839
842
 
840
843
  ### `GatewayKind`
841
844
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.97.0",
3
+ "version": "6.97.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",
@@ -114,5 +114,5 @@
114
114
  "@types/node": "^22.7.0",
115
115
  "esbuild": "^0.28.1"
116
116
  },
117
- "gitref": "8f71863a1ad2428e3b09bfcae0bcbe215bad1fdc"
117
+ "gitref": "9ed95e4a157d2c2e05ceb0b3e0634c6d61e6d21e"
118
118
  }