@uipath/maestro-builder-sdk 6.120.11 → 6.120.13

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 CHANGED
@@ -146,7 +146,7 @@ could hand you spans for a version you do not have.
146
146
  | `ErrorEnvelopeField` | type | `dist/core/expr.d.ts:142-152` | Supporting types | The fields a failure envelope carries. |
147
147
  | `EscalationRef` | interface | `dist/core/actions.d.ts:828-894` | Supporting types | One escalation an inline agent may raise — an Action Center app task a human completes (the `coded-action-app` variant,… |
148
148
  | `EventFilter` | type | `dist/core/actions.d.ts:1056-1107` | Supporting types | One filter condition on the event payload. |
149
- | `EventSubscription` | interface | `dist/core/actions.d.ts:1181-1222` | Option shapes | What a connector event subscribes to. |
149
+ | `EventSubscription` | interface | `dist/core/actions.d.ts:1196-1237` | Option shapes | What a connector event subscribes to. |
150
150
  | `Expr` | class | `dist/core/expr.d.ts:11-21` | Supporting types | A Flow expression. |
151
151
  | `FieldMapping` | interface | `dist/nodes/transform/flow/spec.d.ts:27-34` | Supporting types | 3 field(s) |
152
152
  | `FilterCondition` | type | `dist/nodes/transform/flow/spec.d.ts:10-11` | Supporting types | Comparison a filter rule applies to a field. |
@@ -295,7 +295,7 @@ could hand you spans for a version you do not have.
295
295
  | `triggerDescriptor` | function | `dist/core/connectors.d.ts:152-164` | Generated descriptors | Brand a trigger descriptor literal with its where/output types. |
296
296
  | `TriggerDescriptor` | type | `dist/core/connectors.d.ts:143-151` | Generated descriptors | A generated, typed connector-trigger descriptor: TriggerMeta branded with phantom `where`/output types. |
297
297
  | `TriggerMeta` | interface | `dist/core/connectors.d.ts:133-142` | Generated descriptors | Runtime metadata a generated trigger descriptor carries. |
298
- | `TriggerOptions` | interface | `dist/core/actions.d.ts:1133-1180` | Option shapes | The typed `onEvent`/`waitForEvent` options — everything an EventSubscription carries except `connector`/`event`, which… |
298
+ | `TriggerOptions` | interface | `dist/core/actions.d.ts:1148-1195` | Option shapes | The typed `onEvent`/`waitForEvent` options — everything an EventSubscription carries except `connector`/`event`, which… |
299
299
  | `TriggerSpec` | type | `dist/nodes/trigger/flow/spec.d.ts:81-100` | Supporting types | What starts the flow. |
300
300
  | `TypeDesc` | type | `dist/core/expr.d.ts:404` | Supporting types | |
301
301
  | `types` | const | `dist/core/expr.d.ts:388-403` | Expressions and types | Variable type descriptors (map to Flow variable `type` values). |
@@ -308,14 +308,14 @@ could hand you spans for a version you do not have.
308
308
  | `VoiceAgentInputs` | interface | `dist/nodes/agent/flow/spec.d.ts:145-183` | Option shapes | What `voiceAgent()` takes: the agent's instructions, the call it joins, how it sounds, and the resources it attaches… |
309
309
  | `VoiceSettings` | interface | `dist/nodes/agent/flow/spec.d.ts:122-144` | Supporting types | The audio settings a voice agent speaks with. |
310
310
  | `voiceTrigger` | function | `dist/nodes/trigger/flow/factories.d.ts:104-134` | Actions | Start the flow when a phone call comes IN (`core.trigger.voice`). |
311
- | `waitForEvent` | function | `dist/core/actions.d.ts:1232-1267` | Actions | Wait mid-flow until a connector event fires, then continue with its payload — the typed form, where a generated trigger… |
312
- | `waitForEvent` | function | `dist/core/actions.d.ts:1268-1275` | Actions | Stringly form, for an event with no prepared module. |
311
+ | `waitForEvent` | function | `dist/core/actions.d.ts:1247-1282` | Actions | Wait mid-flow until a connector event fires, then continue with its payload — the typed form, where a generated trigger… |
312
+ | `waitForEvent` | function | `dist/core/actions.d.ts:1283-1290` | Actions | Stringly form, for an event with no prepared module. |
313
313
  | `waitForMessage` | function | `dist/nodes/conversation/flow/factories.d.ts:27-43` | Actions | PAUSE until the person sends their next message (`uipath.conversational.wait-for-message`) — a catch event, like… |
314
314
  | `WaitForMessageInputs` | interface | `dist/nodes/conversation/flow/spec.d.ts:28-36` | Option shapes | 2 field(s) |
315
315
 
316
316
  ## `@uipath/maestro-builder-sdk/case`
317
317
 
318
- 105 symbol(s). Import from `@uipath/maestro-builder-sdk/case`.
318
+ 106 symbol(s). Import from `@uipath/maestro-builder-sdk/case`.
319
319
 
320
320
  | Symbol | Kind | Declaration | Area | Summary |
321
321
  | --- | --- | --- | --- | --- |
@@ -347,7 +347,7 @@ could hand you spans for a version you do not have.
347
347
  | `CaseBuilder` | class | `dist/case/case-sdk.d.ts:1868-2157` | Builders | 18 member(s) |
348
348
  | `CaseConnectorOpts` | interface | `dist/case/case-sdk.d.ts:524-547` | Option shapes | TaskBuilder.connector's options: the Flow `connector()` options, plus the fields a decompiled task carries. |
349
349
  | `CaseDocumentExtractionSpec` | interface | `dist/case/case-sdk.d.ts:620-665` | Supporting types | A document-extraction task's IXP deployment and inputs (`.documentExtraction()`). |
350
- | `CaseEventFilter` | type | `dist/core/actions.d.ts:1108-1132` | Supporting types | A Case event filter: an EventFilter, or a text test or equality whose value is computed at runtime from a Case… |
350
+ | `CaseEventFilter` | type | `dist/core/actions.d.ts:1108-1147` | Supporting types | A Case event filter: an EventFilter, a text test or equality whose value is computed at runtime from a Case expression… |
351
351
  | `CaseEventSubscription` | type | `dist/case/case-sdk.d.ts:492-499` | Option shapes | A Case wait's connector subscription: an EventSubscription whose `filters` may compare against a case expression… |
352
352
  | `CaseHttpRequestSpec` | interface | `dist/case/case-sdk.d.ts:568-610` | Supporting types | An HTTP request task's request (`.httpRequest()`). |
353
353
  | `CaseLayout` | interface | `dist/case/case-sdk.d.ts:1149-1160` | Supporting types | Optional Case designer layout, keyed by author-level stage and trigger names. |
@@ -373,8 +373,9 @@ could hand you spans for a version you do not have.
373
373
  | `EscalationRecipient` | interface | `dist/case/case-sdk.d.ts:186-193` | Supporting types | Who an escalation notifies. |
374
374
  | `EscalationTrigger` | type | `dist/case/case-sdk.d.ts:184-185` | Supporting types | When an escalation fires: as the deadline approaches (`at-risk`) or once it passes (`sla-breached`). |
375
375
  | `EventFilter` | type | `dist/core/actions.d.ts:1056-1107` | Supporting types | One filter condition on the event payload. |
376
- | `EventFilterExpression` | interface | `dist/core/event-filters.d.ts:131-146` | Supporting types | A filter value computed at runtime: the field is compared against a Case expression, `=vars.<path>` or… |
377
- | `EventSubscription` | interface | `dist/core/actions.d.ts:1181-1222` | Option shapes | What a connector event subscribes to. |
376
+ | `EventFilterExpression` | interface | `dist/core/event-filters.d.ts:186-201` | Supporting types | A filter value computed at runtime: the field is compared against a Case expression, `=vars.<path>` or… |
377
+ | `EventFilterList` | type | `dist/core/event-filters.d.ts:175-183` | Supporting types | The values an `isOneOf` filter (Case only) matches: all numbers, or all strings. |
378
+ | `EventSubscription` | interface | `dist/core/actions.d.ts:1196-1237` | Option shapes | What a connector event subscribes to. |
378
379
  | `eventTrigger` | function | `dist/case/case-sdk.d.ts:379-389` | Case authoring | An Integration Service **event** trigger — an external event (a new row, an email, a webhook) starts the case. |
379
380
  | `eventTrigger` | function | `dist/case/case-sdk.d.ts:390-396` | Case authoring | An Integration Service event trigger in placeholder or stringly-resolved form. |
380
381
  | `EventTriggerOpts` | interface | `dist/case/case-sdk.d.ts:326-366` | Option shapes | 5 field(s) |
@@ -417,7 +418,7 @@ could hand you spans for a version you do not have.
417
418
  | `toUser` | function | `dist/case/case-sdk.d.ts:217-232` | Case authoring | An escalation recipient that is a single user. |
418
419
  | `TriggerDescriptor` | type | `dist/core/connectors.d.ts:143-151` | Supporting types | A generated, typed connector-trigger descriptor: TriggerMeta branded with phantom `where`/output types. |
419
420
  | `TriggerMeta` | interface | `dist/core/connectors.d.ts:133-142` | Supporting types | Runtime metadata a generated trigger descriptor carries. |
420
- | `TriggerOptions` | interface | `dist/core/actions.d.ts:1133-1180` | Option shapes | The typed `onEvent`/`waitForEvent` options — everything an EventSubscription carries except `connector`/`event`, which… |
421
+ | `TriggerOptions` | interface | `dist/core/actions.d.ts:1148-1195` | Option shapes | The typed `onEvent`/`waitForEvent` options — everything an EventSubscription carries except `connector`/`event`, which… |
421
422
  | `TypeDesc` | type | `dist/core/expr.d.ts:404` | Supporting types | |
422
423
  | `UnresolvedReferenceTaskKind` | type | `dist/case/case-sdk.d.ts:461-470` | Supporting types | Task kinds that the Case schema permits as unresolved skeletons: the published-resource kinds, `action` (a human task… |
423
424
  | `WaitConnectorPlaceholderSpec` | interface | `dist/case/case-sdk.d.ts:471-486` | Supporting types | A `wait-for-connector` subscription: suspend on an Integration Service event. |
@@ -172,18 +172,18 @@ not find it either.
172
172
  | `connection` | property | `ConnectorOpts` | `dist/core/actions.d.ts:19-23` |
173
173
  | `connection` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:697-704` |
174
174
  | `connection` | property | `DataServiceOpts` | `dist/bpmn/bpmn-sdk.d.ts:1269-1275` |
175
- | `connection` | property | `EventSubscription` | `dist/core/actions.d.ts:1214-1218` |
175
+ | `connection` | property | `EventSubscription` | `dist/core/actions.d.ts:1229-1233` |
176
176
  | `connection` | property | `ExternalTaskOptions` | `dist/case/case-sdk.d.ts:715-716` |
177
177
  | `connection` | property | `ExternalTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1746-1747` |
178
178
  | `connection` | property | `HttpOpts` | `dist/bpmn/bpmn-sdk.d.ts:1332-1360` |
179
179
  | `connection` | property | `HttpRequestConnector` | `dist/case/case-sdk.d.ts:615-616` |
180
- | `connection` | property | `TriggerOptions` | `dist/core/actions.d.ts:1171-1175` |
180
+ | `connection` | property | `TriggerOptions` | `dist/core/actions.d.ts:1186-1190` |
181
181
  | `connectionId` | property | `LookupResolution` | `dist/core/lookups.d.ts:174-181` |
182
182
  | `connections` | property | `HitlRecipient` | `dist/nodes/hitl/flow/spec.d.ts:70-74` |
183
183
  | `connector` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:1001` |
184
184
  | `connector` | property | `CaseHttpRequestSpec` | `dist/case/case-sdk.d.ts:605-609` |
185
185
  | `connector` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:682-683` |
186
- | `connector` | property | `EventSubscription` | `dist/core/actions.d.ts:1183-1184` |
186
+ | `connector` | property | `EventSubscription` | `dist/core/actions.d.ts:1198-1199` |
187
187
  | `connector` | property | `ExternalTaskSpecData` | `dist/case/case-sdk.d.ts:743-744` |
188
188
  | `connector` | property | `FlowActionSpecs` | `dist/core/actions.d.ts:948-972` |
189
189
  | `connector` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:65-71` |
@@ -378,7 +378,7 @@ not find it either.
378
378
  | `escalation` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:78-84` |
379
379
  | `escalations` | property | `BuiltSla` | `dist/case/case-sdk.d.ts:278` |
380
380
  | `escalations` | property | `SlaOpts` | `dist/case/case-sdk.d.ts:268-269` |
381
- | `event` | property | `EventSubscription` | `dist/core/actions.d.ts:1185-1186` |
381
+ | `event` | property | `EventSubscription` | `dist/core/actions.d.ts:1200-1201` |
382
382
  | `event` | property | `ExternalTaskOptions` | `dist/case/case-sdk.d.ts:728-733` |
383
383
  | `event` | property | `ExternalTaskSpecData` | `dist/case/case-sdk.d.ts:741-742` |
384
384
  | `event` | property | `TriggerMeta` | `dist/core/connectors.d.ts:137-138` |
@@ -407,7 +407,7 @@ not find it either.
407
407
  | `exponentialBase` | property | `TaskRetryPolicy` | `dist/case/case-sdk.d.ts:944-945` |
408
408
  | `exposeError` | property | `HitlInputs` | `dist/nodes/hitl/flow/spec.d.ts:379-385` |
409
409
  | `expression` | property | `BuiltSla` | `dist/case/case-sdk.d.ts:276-277` |
410
- | `expression` | property | `EventFilterExpression` | `dist/core/event-filters.d.ts:144-145` |
410
+ | `expression` | property | `EventFilterExpression` | `dist/core/event-filters.d.ts:199-200` |
411
411
  | `expression` | property | `RuleOpts` | `dist/case/case-sdk.d.ts:93-94` |
412
412
  | `expression` | property | `WhenExpression` | `dist/case/case-sdk.d.ts:168-169` |
413
413
  | `external` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:1002-1003` |
@@ -438,8 +438,8 @@ not find it either.
438
438
  | `filter` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1682-1697` |
439
439
  | `filters` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1698-1713` |
440
440
  | `filters` | property | `DataFabricReadInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:85-86` |
441
- | `filters` | property | `EventSubscription` | `dist/core/actions.d.ts:1212-1213` |
442
- | `filters` | property | `TriggerOptions` | `dist/core/actions.d.ts:1169-1170` |
441
+ | `filters` | property | `EventSubscription` | `dist/core/actions.d.ts:1227-1228` |
442
+ | `filters` | property | `TriggerOptions` | `dist/core/actions.d.ts:1184-1185` |
443
443
  | `flavour` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:536-550` |
444
444
  | `flowIds` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3407-3450` |
445
445
  | `flowMode` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2347-2386` |
@@ -454,7 +454,7 @@ not find it either.
454
454
  | `folder` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:705-710` |
455
455
  | `folder` | property | `DataServiceOpts` | `dist/bpmn/bpmn-sdk.d.ts:1276-1288` |
456
456
  | `folder` | property | `EntityRef` | `dist/core/resource-resolution.d.ts:27-28` |
457
- | `folder` | property | `EventSubscription` | `dist/core/actions.d.ts:1219-1220` |
457
+ | `folder` | property | `EventSubscription` | `dist/core/actions.d.ts:1234-1235` |
458
458
  | `folder` | property | `ExternalTaskOptions` | `dist/case/case-sdk.d.ts:717-718` |
459
459
  | `folder` | property | `ExternalTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1748-1749` |
460
460
  | `folder` | property | `HttpOpts` | `dist/bpmn/bpmn-sdk.d.ts:1361-1362` |
@@ -462,7 +462,7 @@ not find it either.
462
462
  | `folder` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1424-1425` |
463
463
  | `folder` | property | `QueueItemOpts` | `dist/bpmn/bpmn-sdk.d.ts:1490-1491` |
464
464
  | `folder` | property | `ResourceRef` | `dist/core/resource-resolution.d.ts:16-17` |
465
- | `folder` | property | `TriggerOptions` | `dist/core/actions.d.ts:1176-1177` |
465
+ | `folder` | property | `TriggerOptions` | `dist/core/actions.d.ts:1191-1192` |
466
466
  | `folderKey` | property | `AgentMemoryRef` | `dist/core/actions.d.ts:603-604` |
467
467
  | `folderKey` | property | `CaseDocumentExtractionSpec` | `dist/case/case-sdk.d.ts:639-644` |
468
468
  | `folderKey` | property | `ContextIndexRef` | `dist/core/actions.d.ts:914-915` |
@@ -853,9 +853,9 @@ not find it either.
853
853
  | `object` | property | `ConnectorEventOpts` | `dist/bpmn/bpmn-sdk.d.ts:1672-1681` |
854
854
  | `object` | property | `ConnectorOpts` | `dist/core/actions.d.ts:26-58` |
855
855
  | `object` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:688-689` |
856
- | `object` | property | `EventSubscription` | `dist/core/actions.d.ts:1206-1211` |
856
+ | `object` | property | `EventSubscription` | `dist/core/actions.d.ts:1221-1226` |
857
857
  | `object` | property | `EventTriggerOpts` | `dist/case/case-sdk.d.ts:336-349` |
858
- | `object` | property | `TriggerOptions` | `dist/core/actions.d.ts:1158-1168` |
858
+ | `object` | property | `TriggerOptions` | `dist/core/actions.d.ts:1173-1183` |
859
859
  | `objectName` | property | `ConnectorMeta` | `dist/core/connectors.d.ts:79-88` |
860
860
  | `objectName` | property | `LookupSpec` | `dist/core/lookups.d.ts:23-24` |
861
861
  | `objectName` | property | `SelectNextStageSpec` | `dist/case/case-sdk.d.ts:405-406` |
@@ -1366,12 +1366,12 @@ not find it either.
1366
1366
  | `version` | property | `ConnectorMeta` | `dist/core/connectors.d.ts:76` |
1367
1367
  | `version` | property | `ConnectorOpts` | `dist/core/actions.d.ts:17-18` |
1368
1368
  | `version` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:686-687` |
1369
- | `version` | property | `EventSubscription` | `dist/core/actions.d.ts:1221` |
1369
+ | `version` | property | `EventSubscription` | `dist/core/actions.d.ts:1236` |
1370
1370
  | `version` | property | `ExternalTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1750-1751` |
1371
1371
  | `version` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1480-1493` |
1372
1372
  | `version` | property | `NodeOptions` | `dist/flow-sdk.d.ts:256-263` |
1373
1373
  | `version` | property | `TriggerMeta` | `dist/core/connectors.d.ts:139` |
1374
- | `version` | property | `TriggerOptions` | `dist/core/actions.d.ts:1178-1179` |
1374
+ | `version` | property | `TriggerOptions` | `dist/core/actions.d.ts:1193-1194` |
1375
1375
  | `versions` | method | `NodeCatalog` | `dist/core/node-catalog.d.ts:15-16` |
1376
1376
  | `versionTag` | property | `IxpExtractInputs` | `dist/nodes/document/flow/spec.d.ts:207-208` |
1377
1377
  | `versionTag` | property | `IxpToolRef` | `dist/core/actions.d.ts:816-817` |
@@ -1393,8 +1393,8 @@ not find it either.
1393
1393
  | `when` | property | `FormFieldCondition` | `dist/core/actions.d.ts:136-137` |
1394
1394
  | `when` | property | `SlaOpts` | `dist/case/case-sdk.d.ts:261-267` |
1395
1395
  | `when` | property | `SwitchArm` | `dist/flow-sdk.d.ts:221-226` |
1396
- | `where` | property | `EventSubscription` | `dist/core/actions.d.ts:1187-1205` |
1397
- | `where` | property | `TriggerOptions` | `dist/core/actions.d.ts:1140-1157` |
1396
+ | `where` | property | `EventSubscription` | `dist/core/actions.d.ts:1202-1220` |
1397
+ | `where` | property | `TriggerOptions` | `dist/core/actions.d.ts:1155-1172` |
1398
1398
  | `width` | property | `CaseNodeLayout` | `dist/case/case-sdk.d.ts:1142-1143` |
1399
1399
  | `width` | property | `StickyNote` | `dist/flow-sdk.d.ts:708-709` |
1400
1400
  | `x` | property | `StickyNote` | `dist/flow-sdk.d.ts:704-705` |
@@ -331,18 +331,35 @@ function counterpartOf(builtOwn, row) {
331
331
  * 'responseRow', var: 'responseRow', originalVar: 'response', source:
332
332
  * '=response' }`). The extract that writes the saved row's variable is its
333
333
  * counterpart, and having no id it says nothing about renumbering, so the
334
- * ids are compared only when the counterpart has one.
334
+ * ids are compared only when the counterpart has one ({@link writesSameVariable}).
335
335
  */
336
336
  function outputsDiverge(builtOwn, set, caseVariables) {
337
337
  return set.rows.some((row) => {
338
338
  const counterpart = counterpartOf(builtOwn, row);
339
- if (!counterpart)
339
+ if (!counterpart || writesSameVariable(counterpart, row))
340
340
  return false;
341
341
  if (counterpart.id !== undefined && counterpart.id !== row.id)
342
342
  return true;
343
- return row.var !== undefined && counterpart.var !== row.var && !reassignedToCaseVariable(row, counterpart, caseVariables);
343
+ return !reassignedToCaseVariable(row, counterpart, caseVariables);
344
344
  });
345
345
  }
346
+ /**
347
+ * Whether the built `counterpart` of saved own row `saved` writes the variable
348
+ * the saved row wrote.
349
+ *
350
+ * Compile writes an element's own row with `id == var`, so the id names the
351
+ * variable. An event trigger's declared output (`eventTrigger({ outputs: {
352
+ * caseRecord: { source: "=response" } } })`) is written with no id: its `var`
353
+ * names the variable. Decompile declares a trigger's own row that way when
354
+ * Studio Web saved it without `elementId`, and the saved row may still have
355
+ * its slot id (`{ id: "caseRecord", var: "caseRecord" }`), which an id-less
356
+ * row cannot match.
357
+ */
358
+ function writesSameVariable(counterpart, saved) {
359
+ if (counterpart.id === undefined)
360
+ return saved.var === undefined ? saved.id === undefined : counterpart.var === saved.var;
361
+ return counterpart.id === saved.id && (saved.var === undefined || counterpart.var === saved.var);
362
+ }
346
363
  /**
347
364
  * The saved outputs over the built ones: the saved own rows in saved order,
348
365
  * where compile put its first own row, around the rows compile writes for the
@@ -254,6 +254,12 @@ type Preservation = {
254
254
  name: string;
255
255
  trigger: string;
256
256
  }>;
257
+ triggerlessInArgs?: Array<{
258
+ name: string;
259
+ elementId: string;
260
+ trigger: string;
261
+ companion?: string;
262
+ }>;
257
263
  omitMetadata?: Array<'caseAppEnabled' | 'caseIdentifierType' | 'publishVersion' | 'intsvcActivityConfig'>;
258
264
  publishVersion?: number;
259
265
  nodeFields?: Record<string, Record<string, unknown>>;
@@ -19,7 +19,7 @@ import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
19
19
  import { EXTERNAL_TASK_CONTEXT, EXTERNAL_TASK_EVENT_CONTEXT, externalDescriptorRefusal, externalEventRefusal, externalServiceType, isExternalExecutionMode, libraryExecution } from './external.js';
20
20
  import { compareSchemaVersions, preserveSchemaVersion } from '../schema-version.js';
21
21
  import { ownEntry } from '../core/own-entry.js';
22
- import { EVENT_FILTER_OPERATORS, eventFilterExpressionOf, eventFilterFromTreeLeaf, eventFilterProblem, EXPRESSION_FILTER_OPERATORS, filterExprFromLeaf } from '../core/event-filters.js';
22
+ import { eventFilterExpressionOf, eventFilterFromTreeLeaf, eventFilterJmes, eventFilterOperator, eventFilterProblem, EXPRESSION_FILTER_OPERATORS, filterExprFromLeaf } from '../core/event-filters.js';
23
23
  import { CASE_FILTER_SPELLING, caseSubscriptionBody, caseSubscriptionOwners } from './subscription.js';
24
24
  import { CASE_NODE_CANVAS_FIELDS, CASE_NODE_LAYOUT_FIELDS, isTypedInputField, isUnrestorableSlotId, planElementIds, PRESERVED_STAGE_DATA_KEYS, PRESERVED_TRIGGER_DATA_KEYS, RESOURCE_INPUT_WRITTEN, RESOURCE_OUTPUT_WRITTEN, CASE_EMPTY_LISTS, STAGE_EMPTY_LISTS, TASK_EMPTY_LISTS, taskFingerprint, PRESERVED_ACTION_DATA_KEYS, TYPED_TRIGGER_DISPLAY_KEYS, } from './preserve.js';
25
25
  import { stableId } from '../core/stable-id.js';
@@ -346,10 +346,13 @@ function checkSubscriptionSlots(body, rc, owner) {
346
346
  /**
347
347
  * The designer's filter tree as authored `filters` leaves, with each leaf's
348
348
  * structural read (for the match expression). Every operator the serializer
349
- * writes (`EVENT_FILTER_OPERATORS`) reads back; any other operator (`In`,
350
- * `IsEmpty`, a date alias such as `DateTimeEquals`) is refused.
349
+ * writes (`EVENT_FILTER_OPERATORS`, and Case's `CASE_EVENT_FILTER_OPERATORS`:
350
+ * `IsOneOf`, `IsEmpty`, `IsNotEmpty`) reads back; any other operator (`In`,
351
+ * `IsNotOneOf`, a date alias such as `DateTimeEquals`) is refused. `expression`
352
+ * is the plan's match expression, which says whether an `IsOneOf` compared
353
+ * numbers.
351
354
  */
352
- function subscriptionFilters(config, owner) {
355
+ function subscriptionFilters(config, owner, expression) {
353
356
  const tree = config?.filter;
354
357
  if (tree === null || tree === undefined)
355
358
  return { reads: [] };
@@ -359,9 +362,9 @@ function subscriptionFilters(config, owner) {
359
362
  const reads = tree.filters.map((entry) => {
360
363
  // A value computed at runtime: the field compared against a case expression.
361
364
  if (entry?.value?.isLiteral === false) {
362
- const read = eventFilterFromTreeLeaf(entry ?? {});
365
+ const read = eventFilterFromTreeLeaf(entry ?? {}, 'case');
363
366
  const computed = filterExprFromLeaf(entry.value);
364
- if (!read || ownEntry(EVENT_FILTER_OPERATORS, read.operator)?.designer !== entry.operator
367
+ if (!read || eventFilterOperator(read.operator)?.designer !== entry.operator
365
368
  || !EXPRESSION_FILTER_OPERATORS.has(read.operator))
366
369
  throw new Error(`${owner} has an expression-valued subscription filter under an operator the SDK does not author.`);
367
370
  if (!computed)
@@ -369,15 +372,30 @@ function subscriptionFilters(config, owner) {
369
372
  forms.add(computed.form);
370
373
  return { field: read.field, operator: read.operator, value: '', expression: computed.expression };
371
374
  }
372
- const read = eventFilterFromTreeLeaf(entry ?? {});
375
+ const read = eventFilterFromTreeLeaf(entry ?? {}, 'case');
373
376
  const raw = entry?.value?.value;
377
+ const kind = read !== undefined ? eventFilterOperator(read.operator)?.kind : undefined;
374
378
  // Only an operator compile writes back under the same designer name: a
375
379
  // date alias (`DateTimeEquals`) would come back as `Equals`.
376
- // A boolean test (`Is` / `IsNot`) carries no value; every other leaf carries a literal.
377
- const boolean = read !== undefined && ownEntry(EVENT_FILTER_OPERATORS, read.operator)?.kind === 'boolean';
378
- if (!read || ownEntry(EVENT_FILTER_OPERATORS, read.operator)?.designer !== entry.operator
379
- || (boolean ? entry.value !== null : !['string', 'number', 'boolean'].includes(typeof raw)))
380
+ // A boolean or presence test (`Is`, `IsNot`, `IsEmpty`, `IsNotEmpty`)
381
+ // carries no value; an `IsOneOf` list carries text values with their JSON
382
+ // as `rawString`, as compile writes it; every other leaf carries a literal.
383
+ const valueless = kind === 'boolean' || kind === 'presence';
384
+ const written = valueless ? entry.value === null
385
+ : kind === 'list' ? entry.value?.isLiteral === true && entry.value?.rawString === JSON.stringify(raw)
386
+ && Object.keys(entry.value).length === 3
387
+ : ['string', 'number', 'boolean'].includes(typeof raw);
388
+ if (!read || eventFilterOperator(read.operator)?.designer !== entry.operator || !written)
380
389
  throw new Error(`${owner} has an unsupported subscription filter operator.`);
390
+ // The tree stores an `IsOneOf` list as text either way; the match expression
391
+ // says whether the designer compared the values as numbers (`[5]`, a choice
392
+ // set) or as text (`["5"]`). The whole expression is checked after this.
393
+ if (kind === 'list' && expression !== undefined) {
394
+ const numbers = read.value.map(Number);
395
+ const numeric = numbers.every((n, i) => Number.isFinite(n) && String(n) === read.value[i]);
396
+ if (numeric && expression.includes(eventFilterJmes({ ...read, value: numbers })))
397
+ read.value = numbers;
398
+ }
381
399
  // A leaf compile would refuse (a plain string under an ordering operator, an
382
400
  // ambiguous backslash) is refused here, not one step later on generated source.
383
401
  const problem = eventFilterProblem(read);
@@ -451,7 +469,7 @@ function preservedSubscriptionFilters(plan) {
451
469
  try {
452
470
  body = subscriptionBody(bag, key);
453
471
  const config = encodedSubscriptionConfig(contextMap(bag), key);
454
- const read = subscriptionFilters(config, key);
472
+ const read = subscriptionFilters(config, key, body.expression);
455
473
  spelling = subscriptionFilterSpelling(body, read.leafForm);
456
474
  tree = config?.filter;
457
475
  reads = read.reads;
@@ -535,7 +553,7 @@ function resolvedSubscriptionSource(bag, owner, kind, refs) {
535
553
  });
536
554
  const body = subscriptionBody(bag, owner);
537
555
  const where = body.where;
538
- const { leaves: filters, reads, leafForm } = subscriptionFilters(config, owner);
556
+ const { leaves: filters, reads, leafForm } = subscriptionFilters(config, owner, body.expression);
539
557
  const rc = refs.library.resolveEvent(kind, identity.key, identity.event, identity.version, identity.object);
540
558
  checkSubscriptionSlots(body, rc, owner);
541
559
  if (body.expression !== undefined || leafForm !== undefined)
@@ -1459,6 +1477,12 @@ function outputTargetOf(row) {
1459
1477
  * For example `{ displayName: 'echoIn', title: 'echoIn' }`.
1460
1478
  * - `omit: ['target']`: an extract the Designer saved with no `target`
1461
1479
  * (compile writes `target: "=<id>"` on every extract).
1480
+ * - `omit` on an input: the fields compile writes on every input (`id`,
1481
+ * `var`, `elementId`) that it was saved without. Studio Web saves some
1482
+ * inputs with no id (`{ name, value, elementId, type, displayName }`), and
1483
+ * compile used to mint one, a variable the plan never had. An output's
1484
+ * `elementId` is not carried this way: compile always writes it, since the
1485
+ * converter reads none of a task's outputs without it (#1419).
1462
1486
  * - `target: 'var' | 'originalVar'`: an extract whose `target` names its
1463
1487
  * variable or its original variable rather than its id (`outputTargetOf`).
1464
1488
  *
@@ -1495,7 +1519,10 @@ function resourceRowShape(task, row, side) {
1495
1519
  // variable, `=<var>`); any other target is behavior no builder call writes.
1496
1520
  if (side === 'outputs' && row.target !== undefined && row.target !== `=${row.id}` && outputTargetOf(row) === undefined)
1497
1521
  throw new Error(`${task.type} task "${task.displayName ?? task.id ?? '?'}" output "${row.name ?? '?'}" has unsupported target ${JSON.stringify(row.target)} (compile writes "=${row.id}").`);
1498
- const omit = side === 'outputs' && row.target === undefined ? { omit: ['target'] } : {};
1522
+ const absent = side === 'outputs'
1523
+ ? (row.target === undefined ? ['target'] : [])
1524
+ : ['id', 'var', 'elementId'].filter((key) => row[key] === undefined);
1525
+ const omit = absent.length ? { omit: absent } : {};
1499
1526
  const targetOf = side === 'outputs' ? outputTargetOf(row) : undefined;
1500
1527
  return { ...(Object.keys(fields).length ? { fields } : {}), ...omit, ...(targetOf ? { target: targetOf } : {}) };
1501
1528
  }
@@ -1918,8 +1945,8 @@ function reassignedOwnNameTargets(plan) {
1918
1945
  * root lanes back afterwards. The Case Designer keeps the two orders apart:
1919
1946
  * an In-arg added to the trigger later can sit before older ones on the
1920
1947
  * trigger and after them in `variables.inputs`. Declaring In-args in bridge
1921
- * order keeps both. A trigger with an In-arg no bridge row reads keeps the
1922
- * root order.
1948
+ * order keeps both. An In-arg no bridge row reads keeps its root position;
1949
+ * the bridged ones are ordered around it.
1923
1950
  *
1924
1951
  * Example: `variables.inputs` is `[a, b, c]` and the trigger's bridge rows read
1925
1952
  * `[c, a, b]`; the source declares `.input({ c })`, `.input({ a })`, `.input({ b })`.
@@ -1939,11 +1966,17 @@ function inArgsInBridgeOrder(plan) {
1939
1966
  if (slot !== undefined && !position.has(slot))
1940
1967
  position.set(slot, index);
1941
1968
  });
1942
- const own = slots.map((index) => inputs[index]);
1943
- if (own.some((input) => typeof input.id !== 'string' || !position.has(input.id)))
1969
+ // An In-arg no bridge row reads (`unbridgedInArgs`) keeps its slot: compile
1970
+ // drops its row again, so its place among the `.input()` calls orders no
1971
+ // row. The bridged ones are put in bridge order in the other slots. Before,
1972
+ // one unbridged In-arg kept the whole trigger in root order, and compile
1973
+ // wrote every bridge row of that trigger in root order.
1974
+ const bridged = slots.filter((index) => typeof inputs[index].id === 'string' && position.has(inputs[index].id));
1975
+ if (bridged.length < 2)
1944
1976
  continue;
1945
- const ordered = [...own].sort((a, b) => position.get(a.id) - position.get(b.id));
1946
- slots.forEach((slot, index) => { inputs[slot] = ordered[index]; });
1977
+ const ordered = bridged.map((index) => inputs[index])
1978
+ .sort((a, b) => position.get(a.id) - position.get(b.id));
1979
+ bridged.forEach((slot, index) => { inputs[slot] = ordered[index]; });
1947
1980
  }
1948
1981
  return inputs;
1949
1982
  }
@@ -1964,6 +1997,45 @@ function unbridgedInArgs(plan) {
1964
1997
  return rows.some((row) => row?.source === `=vars.${input.id}`) ? [] : [{ name: input.name, trigger: node.id }];
1965
1998
  });
1966
1999
  }
2000
+ /**
2001
+ * In-args saved with an `elementId` that names no trigger of the plan (a task's
2002
+ * element id, or one no element has), each with that `elementId`, the trigger
2003
+ * the source's bare `.input()` binds it to, and the saved `elementId` of the
2004
+ * root row of its name, when the plan has one.
2005
+ *
2006
+ * No trigger fills such an In-arg: the plan has no bridge row for it and
2007
+ * usually no companion. Compile binds every In-arg to a trigger, adding both,
2008
+ * and a same-name root variable becomes its companion, which the trigger then
2009
+ * overwrites at start. Example: `{ id: "appVendor", name: "vendorNumber",
2010
+ * elementId: "Stage_x-t1" }` beside a root `{ name: "vendorNumber", default:
2011
+ * "16", elementId: "root" }`. An In-arg an own-name output already writes
2012
+ * through a controlled alias (`originalVar == id`) is left to compile.
2013
+ */
2014
+ function triggerlessInArgs(plan) {
2015
+ const triggers = (plan.nodes ?? []).filter(isTrigger);
2016
+ if (!triggers.length)
2017
+ return [];
2018
+ const triggerIds = new Set(triggers.map((node) => node.id));
2019
+ const primary = implicitInArgTrigger(triggers.map(isTimerTrigger));
2020
+ const trigger = triggers[primary ?? 0]?.id;
2021
+ if (typeof trigger !== 'string')
2022
+ return [];
2023
+ const aliased = reassignedOwnNameTargets(plan);
2024
+ const inputs = plan.variables?.inputs ?? [];
2025
+ return inputs.flatMap((input) => {
2026
+ if (typeof input.elementId !== 'string' || triggerIds.has(input.elementId) || !input.name || typeof input.id !== 'string')
2027
+ return [];
2028
+ if (aliased.has(input.name) || inputs.filter((other) => other.name === input.name).length > 1)
2029
+ return [];
2030
+ const roots = (plan.variables?.inputOutputs ?? []).filter((row) => row.name === input.name);
2031
+ if (roots.length > 1)
2032
+ return [];
2033
+ const companion = roots[0]?.elementId;
2034
+ if (roots.length === 1 && typeof companion !== 'string')
2035
+ return [];
2036
+ return [{ name: input.name, elementId: input.elementId, trigger, ...(companion !== undefined ? { companion } : {}) }];
2037
+ });
2038
+ }
1967
2039
  function emitVariables(out, depth, plan, triggerNameById, triggerIsTimer) {
1968
2040
  const variables = plan.variables ?? {};
1969
2041
  const produced = producedVariableNames(plan);
@@ -1974,7 +2046,8 @@ function emitVariables(out, depth, plan, triggerNameById, triggerIsTimer) {
1974
2046
  // the primary trigger, which is what this source recompiles to. When the
1975
2047
  // case has no primary trigger a bare `.input()` is refused
1976
2048
  // (CASE_IN_ARG_UNBOUND), so the source names the first trigger and says so.
1977
- if (!input.elementId && implicitInArgTrigger(triggerIsTimer) === undefined) {
2049
+ // So is one whose `elementId` names no trigger (`triggerlessInArgs`).
2050
+ if (!from && implicitInArgTrigger(triggerIsTimer) === undefined) {
1978
2051
  from = triggerNameById.values().next().value;
1979
2052
  out.line(depth, `// The source document left In-arg "${commentText(input.name)}" unbound and the case has no primary trigger; it is bound to the first trigger here (builder-sdk#1368).`);
1980
2053
  }
@@ -3217,6 +3290,9 @@ export function collectPreservation(plan) {
3217
3290
  const unbridged = unbridgedInArgs(plan);
3218
3291
  if (unbridged.length)
3219
3292
  preservation.unbridgedInArgs = unbridged;
3293
+ const triggerless = triggerlessInArgs(plan);
3294
+ if (triggerless.length)
3295
+ preservation.triggerlessInArgs = triggerless;
3220
3296
  if (Object.keys(variableFields).length)
3221
3297
  preservation.variableFields = variableFields;
3222
3298
  if (Object.keys(legacyVariableDefaults).length)
@@ -1,7 +1,7 @@
1
1
  import { type PreservedConnectorContext } from './connector-saved-context.js';
2
2
  import { type PreservedConnectorRows } from './connector-saved-rows.js';
3
3
  import type { BuiltCase } from './case-sdk.js';
4
- import type { ReadEventFilter } from '../core/event-filters.js';
4
+ import type { EventFilterList, ReadEventFilter } from '../core/event-filters.js';
5
5
  import { type CustomRowShape } from './custom-output-shape.js';
6
6
  import { Bindings } from '../core/bindings.js';
7
7
  import type { BindingsView } from '../core/binding-messages.js';
@@ -249,7 +249,7 @@ interface StageIdentity {
249
249
  /** The resource the rows' `fields` / `omit` describe; they are applied only while the task still names it. */
250
250
  resource?: ResourceTaskIdentity;
251
251
  /** `elementId` only for an action form input whose row names another element than its task. `canonicalId: true`: an action form input saved with the schema migration's `canonicalId`, a copy of its id. `target`: the slot an action form input was saved with (`"bodyField"`), which compile does not write. `fields`: a resource task row's Designer fields compile does not write (`displayName`, `title`, `body`, ...). */
252
- /** `omit` on an action form input: the fields compile writes that it was saved without (`type`; `var`, `elementId` on a row with an id). `taskElementId: true`: the row was saved with its task's `elementId`; compile writes back the task's final `elementId` (see `elementId` above). An action form input with no id, which compile writes with no `elementId`, carries it whenever its `elementId` is the task's. */
252
+ /** `omit` on an action form input: the fields compile writes that it was saved without (`type`; `var`, `elementId` on a row with an id). `taskElementId: true`: the row was saved with its task's `elementId`; compile writes back the task's final `elementId` (see `elementId` above). An action form input with no id, which compile writes with no `elementId`, carries it whenever its `elementId` is the task's. On a resource task input: the fields compile writes (`id`, `var`, `elementId`) it was saved without. */
253
253
  inputs?: Array<{
254
254
  name: string;
255
255
  id?: string;
@@ -418,6 +418,20 @@ export interface CaseJsonPreservation {
418
418
  name: string;
419
419
  trigger: string;
420
420
  }>;
421
+ /**
422
+ * In-args saved with an `elementId` that names no trigger (a task's element
423
+ * id, or one no element has), so no trigger fills them. Compile binds every
424
+ * In-arg to a trigger; while one is still bound to `trigger` (the one its
425
+ * bare `.input()` binds to), it gets its saved `elementId` back, loses the
426
+ * bridge row, and the root row of its name is keyed back to `companion`
427
+ * (its saved `elementId`), or removed when the plan had none.
428
+ */
429
+ triggerlessInArgs?: Array<{
430
+ name: string;
431
+ elementId: string;
432
+ trigger: string;
433
+ companion?: string;
434
+ }>;
421
435
  /**
422
436
  * Opaque V30 layout side-car. Decompile folds a node's inline
423
437
  * {@link CASE_NODE_LAYOUT_FIELDS} into it, the platform's disk form.
@@ -673,7 +687,7 @@ export interface CaseJsonPreservation {
673
687
  export interface PreservedFilterLeafId {
674
688
  field: string;
675
689
  operator: string;
676
- value: string | number | boolean | {
690
+ value: string | number | boolean | EventFilterList | {
677
691
  expression: string;
678
692
  };
679
693
  uiId: string | null;
@@ -355,6 +355,13 @@ export function caseJsonPreservationErrors(payload) {
355
355
  && (!Array.isArray(payload.unbridgedInArgs) || !payload.unbridgedInArgs.every((entry) => entry !== null && typeof entry === 'object'
356
356
  && typeof entry.name === 'string' && entry.name !== '' && typeof entry.trigger === 'string' && entry.trigger !== '')))
357
357
  errors.push('preserved "unbridgedInArgs" must be an array of { name, trigger } with non-empty strings');
358
+ if (payload.triggerlessInArgs !== undefined
359
+ && (!Array.isArray(payload.triggerlessInArgs) || !payload.triggerlessInArgs.every((entry) => entry !== null && typeof entry === 'object'
360
+ && typeof entry.name === 'string' && entry.name !== '' && typeof entry.elementId === 'string' && entry.elementId !== ''
361
+ && typeof entry.trigger === 'string' && entry.trigger !== '' && entry.elementId !== entry.trigger
362
+ && (entry.companion === undefined || (typeof entry.companion === 'string' && entry.companion !== ''))
363
+ && Object.keys(entry).every((key) => ['name', 'elementId', 'trigger', 'companion'].includes(key)))))
364
+ errors.push('preserved "triggerlessInArgs" must be an array of { name, elementId, trigger, companion? } with non-empty strings, elementId not the trigger');
358
365
  if (payload.legacyTriggerIds !== undefined
359
366
  && (!Array.isArray(payload.legacyTriggerIds) || !payload.legacyTriggerIds.every((id) => typeof id === 'string')))
360
367
  errors.push('preserved "legacyTriggerIds" must be an array of trigger id strings');
@@ -379,9 +386,10 @@ export function caseJsonPreservationErrors(payload) {
379
386
  errors.push(`task "${task.name}" ${side} "${row.name}" field "${field}" is owned by the typed Case serializer`);
380
387
  for (const field of row.omit ?? [])
381
388
  // `target` (a resource extract or an action form output),
382
- // `_jsonSchema` / `elementId` (an action form output, #1636), and
383
- // `type` / `var` / `elementId` (an action form input).
384
- if (side === 'output' ? !(field === 'target' || field === '_jsonSchema' || field === 'elementId') : !(field === 'type' || field === 'var' || field === 'elementId'))
389
+ // `_jsonSchema` / `elementId` (an action form output, #1636),
390
+ // `type` / `var` / `elementId` (an action form input), and
391
+ // `id` / `var` / `elementId` (a resource input).
392
+ if (side === 'output' ? !(field === 'target' || field === '_jsonSchema' || field === 'elementId') : !(field === 'type' || field === 'id' || field === 'var' || field === 'elementId'))
385
393
  errors.push(`task "${task.name}" ${side} "${row.name}" omits "${String(field)}", which is not an omittable field`);
386
394
  }
387
395
  }
@@ -24,13 +24,21 @@
24
24
  * exit conditions, then its tasks' entry conditions set by set), then
25
25
  * `metadata.caseExitRules`, then a preserved Case Manager configuration's tasks.
26
26
  *
27
- * One gap, on purpose: the platform's generated-name list is localized (about
28
- * 270 templates in nine languages). Only the English numbered templates are
29
- * mirrored here. A localized generated name that repeats is therefore
30
- * suffixed (`Regla de entrada 1 2`) where the platform would renumber it
31
- * (`Regla de entrada 2`). Only a decompiled pre-V32 document saved by a
32
- * localized Designer can reach that, and the result is still unique.
27
+ * The platform's numbered templates are localized (68 of them, in nine
28
+ * languages), and all are mirrored here: a decompiled pre-V32 document saved
29
+ * by a localized Designer repeats them (`開始ルール 1` on every task of a
30
+ * Japanese plan), and the platform renumbers each repeat (`開始ルール 2`). With
31
+ * the English list only, compile suffixed them instead (`開始ルール 1 2`), so an
32
+ * unedited round trip renamed every such condition.
33
+ * `tests/case-v32-native.test.ts` checks the list against the pin's.
33
34
  */
35
+ /**
36
+ * The Designer's numbered condition names, every language
37
+ * (`NUMBERED_RULE_NAME_TEMPLATES` in `CaseManagementRuleNameTemplates.ts`,
38
+ * `@uipath/case-schema` 0.1173.0), verbatim: `{{number}}` is the counter, and
39
+ * the French ones put a no-break space (U+00A0) before it.
40
+ */
41
+ export declare const NUMBERED_RULE_NAME_TEMPLATES: readonly string[];
34
42
  /**
35
43
  * Rename repeated condition names in place, first occurrence wins, so the
36
44
  * document carries the names the platform's V31 -> V32 and V32 -> V32.0.1