@uipath/maestro-builder-sdk 6.85.5 → 6.85.6

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.
@@ -2,7 +2,7 @@ import { allNodes, collectSerializerRefusals, folderCompanionKeys, implicitNodeV
2
2
  import { KNOWN_METHOD_SET } from './known-methods.js';
3
3
  import { EQUALS_EXPR_DIALECT, checkConnectorLookups, checkConnectorResources, checkConnectorSchema, } from '../core/connector-checks.js';
4
4
  import { checkEventResolution, checkEventSubscription, eventParamsFor, } from '../core/event-checks.js';
5
- import { bindingRequiredFields, CASE_RUNTIME_INTERNAL_TYPES, CONNECTOR_ACTIVITY_TYPES, missingRequiredContext, missingRequiredInputs, REGISTRY_GAPS, registryType, } from './typed-node.js';
5
+ import { bindingRequiredFields, CASE_RUNTIME_INTERNAL_TYPES, CONNECTOR_ACTIVITY_TYPES, missingRequiredContext, missingRequiredInputs, platformEnforcesRequired, REGISTRY_GAPS, registryType, } from './typed-node.js';
6
6
  import { ownEntry } from '../core/own-entry.js';
7
7
  import { isManagedHttpV2, managedHttpAbsoluteUrl, managedHttpMissing } from './managed-http.js';
8
8
  import { connectorV2Missing, isConnectorV2 } from './connector.js';
@@ -1499,11 +1499,21 @@ inEventSubProcess = false) {
1499
1499
  : connectorV2
1500
1500
  ? connectorV2Missing(n.type, contextNames)
1501
1501
  : missingRequiredContext(n.type, contextNames, n.spec);
1502
+ // ERROR only where `uip maestro bpmn validate` holds the node to the field; a WARNING
1503
+ // where only the registry calls it required. For a type whose payload the canvas
1504
+ // owns (dynamic, or a discovered `Intsvc.*` type) the CLI skips the required check,
1505
+ // so an error here refused files the platform accepts: Studio Web's own triggers
1506
+ // (no `connectionId` input, they write a `connection` context row) and its
1507
+ // `Intsvc.*Execution` nodes (#1679). See `platformEnforcesRequired`. A V2 connector
1508
+ // node is judged by its own contract (`connectorV2Missing`), which stays an error.
1509
+ const enforced = platformEnforcesRequired(n.type, contextNames, n.spec);
1510
+ const notEnforcedNote = ' `uip maestro bpmn validate` does not require it for this type, so check only warns.';
1502
1511
  for (const field of requiredContext) {
1512
+ const gate = managedHttp || connectorV2 || enforced.context;
1503
1513
  diags.push({
1504
- level: 'error',
1514
+ level: gate ? 'error' : 'warning',
1505
1515
  code: 'EMPTY_REQUIRED_FIELD',
1506
- message: `"${n.id}" (${n.type}) is missing required field "${field}".`,
1516
+ message: `"${n.id}" (${n.type}) is missing required field "${field}".${gate ? '' : notEnforcedNote}`,
1507
1517
  where: n.id,
1508
1518
  });
1509
1519
  }
@@ -1527,9 +1537,9 @@ inEventSubProcess = false) {
1527
1537
  inputView[row.name] = row.value ?? row.body ?? '';
1528
1538
  for (const field of connectorV2 ? [] : missingRequiredInputs(n.type, inputView, contextNames, n.spec)) {
1529
1539
  diags.push({
1530
- level: 'error',
1540
+ level: enforced.inputs ? 'error' : 'warning',
1531
1541
  code: 'EMPTY_REQUIRED_FIELD',
1532
- message: `"${n.id}" (${n.type}) is missing required input "${field}".`,
1542
+ message: `"${n.id}" (${n.type}) is missing required input "${field}".${enforced.inputs ? '' : notEnforcedNote}`,
1533
1543
  where: n.id,
1534
1544
  });
1535
1545
  }
@@ -472,6 +472,34 @@ export declare function createExtensionPayload(m: BpmnModdle, type: string, rows
472
472
  * @returns Its fields that must be bound, with the target each binding needs.
473
473
  */
474
474
  export declare function bindingRequiredFields(type: string, inline?: RegistryTypeSpec): RegistryContextField[];
475
+ /**
476
+ * Whether `uip maestro bpmn validate` holds a node to the registry's required fields.
477
+ *
478
+ * The CLI's contract half (`validateContext` / `validateInputs`) skips the required
479
+ * check for a type whose payload the canvas owns: one the registry marks `isDynamic`,
480
+ * or an `Intsvc.*` type that `requiresDiscovery` (its fields are discovered from the
481
+ * connector at design time). The one exception is a V1 `Intsvc.ActivityExecution`
482
+ * (`activityConfigurationVersion` absent or `v1`), whose context IS held to the
483
+ * contract. `check` reads the same two flags from the snapshot, so it errors exactly
484
+ * where the CLI refuses, and warns where only the registry says "required".
485
+ *
486
+ * Known limit: the CLI also reads a process-level `uipath:intsvcActivityConfig`
487
+ * version for an unversioned node. The built model does not carry that marker, so an
488
+ * unversioned node here counts as V1, which is the stricter reading (#1691).
489
+ *
490
+ * @param type - The extension type.
491
+ * @param context - The node's context values (for `activityConfigurationVersion`).
492
+ * @returns `context` and `inputs`: whether each half's required fields are enforced.
493
+ */
494
+ export declare function platformEnforcesRequired(type: string, context?: Record<string, unknown>, inline?: RegistryTypeSpec): {
495
+ context: boolean;
496
+ inputs: boolean;
497
+ };
498
+ /**
499
+ * True for an `Intsvc.ActivityExecution` whose own version is V1 — absent or `v1`, as
500
+ * the CLI's `isIntsvcActivityExecutionV1` reads it.
501
+ */
502
+ export declare function isActivityExecutionV1(type: string, context?: Record<string, unknown>): boolean;
475
503
  /**
476
504
  * Required context fields the author left unset and the registry cannot default.
477
505
  *
@@ -123,21 +123,18 @@ export const REGISTRY_GAPS = {
123
123
  // that they are undeclared and wrong that they are invalid — recorded here rather
124
124
  // than by loosening the guard, which is what catches an author's typo.
125
125
  // `requiredContext` — context fields the PLATFORM requires and the registry
126
- // snapshot does not mark required (or, here, does not declare at all).
126
+ // snapshot does not mark required (or does not declare at all). Empty today.
127
127
  //
128
- // `Intsvc.ActivityExecution` must carry `activity`; without it `uip maestro bpmn
129
- // validate` reports
130
- //
131
- // [canvas] [ERROR] EMPTY_REQUIRED_FIELD: The field 'activity' in node 'op' is
132
- // required but has no value.
133
- //
134
- // and `check` could not know, because it derives required fields from the snapshot.
135
- // The connector emitter has always written `activity`, so this only bites a
136
- // hand-rolled `.activity()` — but it bit it at the LAST rung. The divergence is
137
- // measured rather than assumed: `bpmn-registry-required-drift.test.ts` diffs the
138
- // required-field set the canvas validator carries against the snapshot's, over every
139
- // type both know, and asserts the only difference is what this table records.
140
- 'Intsvc.ActivityExecution': { extraContext: ['activity', 'resourceKey'], requiredContext: ['activity'] },
128
+ // `Intsvc.ActivityExecution`'s `activity` used to be recorded here, on a 2026-09-28
129
+ // measurement (`EMPTY_REQUIRED_FIELD: The field 'activity' … is required`). It no
130
+ // longer holds: on uip 1.205.0, and on the `@uipath/maestro-validation` the tests
131
+ // pin, a node with `activity` blank or absent validates. The canvas rule now reads
132
+ // `required` off the XML row, not the design schema, and the CLI's contract half
133
+ // does not list `activity` at all. 380 Studio Web-written nodes in the production
134
+ // corpus carry no `activity` and validate; `check` refused every one (#1679). The
135
+ // SDK still WRITES it (`.activity()` fills it from `operation`); it just does not
136
+ // demand it of a file that lacks it.
137
+ 'Intsvc.ActivityExecution': { extraContext: ['activity', 'resourceKey'] },
141
138
  // `outputRowsFixed` — the type permits EXACTLY the output row its spec declares.
142
139
  // A mapped second row is refused:
143
140
  //
@@ -715,6 +712,40 @@ function moddleElementOf(element) {
715
712
  export function bindingRequiredFields(type, inline) {
716
713
  return registryType(type, inline).context.filter((f) => f.bindingInfo !== null && f.required);
717
714
  }
715
+ /**
716
+ * Whether `uip maestro bpmn validate` holds a node to the registry's required fields.
717
+ *
718
+ * The CLI's contract half (`validateContext` / `validateInputs`) skips the required
719
+ * check for a type whose payload the canvas owns: one the registry marks `isDynamic`,
720
+ * or an `Intsvc.*` type that `requiresDiscovery` (its fields are discovered from the
721
+ * connector at design time). The one exception is a V1 `Intsvc.ActivityExecution`
722
+ * (`activityConfigurationVersion` absent or `v1`), whose context IS held to the
723
+ * contract. `check` reads the same two flags from the snapshot, so it errors exactly
724
+ * where the CLI refuses, and warns where only the registry says "required".
725
+ *
726
+ * Known limit: the CLI also reads a process-level `uipath:intsvcActivityConfig`
727
+ * version for an unversioned node. The built model does not carry that marker, so an
728
+ * unversioned node here counts as V1, which is the stricter reading (#1691).
729
+ *
730
+ * @param type - The extension type.
731
+ * @param context - The node's context values (for `activityConfigurationVersion`).
732
+ * @returns `context` and `inputs`: whether each half's required fields are enforced.
733
+ */
734
+ export function platformEnforcesRequired(type, context = {}, inline) {
735
+ const spec = registryType(type, inline);
736
+ const canvasOwned = spec.isDynamic === true || (type.startsWith('Intsvc.') && spec.requiresDiscovery);
737
+ return { context: !canvasOwned || isActivityExecutionV1(type, context), inputs: !canvasOwned };
738
+ }
739
+ /**
740
+ * True for an `Intsvc.ActivityExecution` whose own version is V1 — absent or `v1`, as
741
+ * the CLI's `isIntsvcActivityExecutionV1` reads it.
742
+ */
743
+ export function isActivityExecutionV1(type, context = {}) {
744
+ if (type !== 'Intsvc.ActivityExecution')
745
+ return false;
746
+ const version = context.activityConfigurationVersion;
747
+ return version === undefined || version === null || version === '' || version === 'v1';
748
+ }
718
749
  /**
719
750
  * Required context fields the author left unset and the registry cannot default.
720
751
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.85.5",
3
+ "version": "6.85.6",
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",
@@ -103,5 +103,5 @@
103
103
  "@types/node": "^22.7.0",
104
104
  "esbuild": "^0.28.1"
105
105
  },
106
- "gitref": "a60a4c0ce7835f89af7abf7fdd2e6c05c0925789"
106
+ "gitref": "0b12c6420738a7e9b8170c19e47771a100040214"
107
107
  }