@uipath/maestro-builder-sdk 6.87.2 → 6.87.4

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.
@@ -25,8 +25,6 @@ import { bindingIdCandidates, offlineBindingLabel } from './ids.js';
25
25
  import { bindingRefId, isLiftFailure, isMintedWire, liftResourceFolder, liftResourceName, readBindingIds, resourceBindingOf, typedFolder, wireRows, } from './resource-wire.js';
26
26
  import { connectorPlaceholderKindOf } from './connector-placeholder.js';
27
27
  import { raiseTaskOutputReads, referableOutputIds } from './task-output-ref.js';
28
- import { defaultActionOutputVar } from './action-output-var.js';
29
- import { platformVariables, undeclaredVarReads } from './case-expr-check.js';
30
28
  const TASK_KIND_METHOD = {
31
29
  process: 'process',
32
30
  agent: 'agent',
@@ -2828,7 +2826,6 @@ export function decompileWithDiagnostics(plan, options = {}) {
2828
2826
  const diagnostics = [];
2829
2827
  refuseUnsupportedAuthoring(plan);
2830
2828
  plan = raiseTaskOutputRefs(plan);
2831
- refuseUndeclaredGateReads(plan, options.bestEffort ? diagnostics : undefined);
2832
2829
  const preservation = collectPreservation(plan);
2833
2830
  const refs = buildRefs(plan, options.library, options.bestEffort ? diagnostics : undefined);
2834
2831
  const selectNextStage = selectNextStageByExit(plan, refs);
@@ -2917,90 +2914,6 @@ export function decompileWithDiagnostics(plan, options = {}) {
2917
2914
  const source = `import { ${imports.join(', ')} } from ${tsLiteral(options.importSpecifier ?? './case-sdk.js')};\n\n${diagnosticHeader}${out.toString()}\n`;
2918
2915
  return { source, diagnostics };
2919
2916
  }
2920
- /**
2921
- * Every name a `vars.<name>` gate of `plan` may read without `build()` calling
2922
- * it undeclared: what the plan's rows declare (each `id` / `var` / `name`, a
2923
- * literal `value` / `target`), an action form field's default variable, and the
2924
- * variables the platform declares for every case. It is a superset of the roots
2925
- * `build()` checks the decompiled source against, so decompile never refuses a
2926
- * gate compile accepts.
2927
- */
2928
- function gateRoots(plan) {
2929
- const roots = new Set(platformVariables((plan.nodes ?? []).filter(isStage).map((s) => String(s.data?.label ?? ''))));
2930
- const walk = (value, inAction) => {
2931
- if (Array.isArray(value)) {
2932
- for (const item of value)
2933
- walk(item, inAction);
2934
- return;
2935
- }
2936
- if (!value || typeof value !== 'object')
2937
- return;
2938
- const row = value;
2939
- const action = inAction || row.type === 'action';
2940
- for (const [key, field] of Object.entries(row)) {
2941
- if (typeof field === 'string') {
2942
- if (key === 'id' || key === 'var' || key === 'name')
2943
- roots.add(field);
2944
- if ((key === 'value' || key === 'target') && !field.startsWith('='))
2945
- roots.add(field);
2946
- if ((key === 'value' || key === 'target') && /^=[\w$]+$/.test(field))
2947
- roots.add(field.slice(1));
2948
- if (key === 'name' && action)
2949
- roots.add(defaultActionOutputVar(field));
2950
- }
2951
- else
2952
- walk(field, action);
2953
- }
2954
- };
2955
- walk({ ...plan, metadata: undefined }, false);
2956
- walk(plan.metadata, false);
2957
- return roots;
2958
- }
2959
- /**
2960
- * Refuse a gate that reads a variable the plan does not declare. `build()`
2961
- * rejects such a reference (`EXPR_UNDECLARED_REF`: `vars.` is a closed
2962
- * namespace, and the runtime reads the name as `undefined`), so writing the
2963
- * gate into the source would only hand the author source compile refuses.
2964
- * Names the platform declares for every case (`stageHasRun_<stage>`, ...) are
2965
- * not refused; see `platformVariables`.
2966
- */
2967
- function refuseUndeclaredGateReads(plan, diagnostics) {
2968
- const roots = gateRoots(plan);
2969
- const check = (expr, where) => {
2970
- if (typeof expr !== 'string' || !expr)
2971
- return;
2972
- const missing = undeclaredVarReads(expr, roots);
2973
- if (!missing.length)
2974
- return;
2975
- const reads = `reads ${missing.map((name) => `\`vars.${name}\``).join(', ')}, which no variable of the plan declares `
2976
- + '(compile refuses it: EXPR_UNDECLARED_REF; at runtime it reads as undefined)';
2977
- // Best effort keeps the gate and marks the source as needing this repair.
2978
- if (diagnostics) {
2979
- diagnostics.push({ code: 'UNDECLARED_VARIABLE_REFERENCE', location: where, message: `${reads}. Declare the variable, or fix the expression.` });
2980
- return;
2981
- }
2982
- throw new Error(`${where} ${reads}. Declare the variable, or fix the expression to read one the case declares, then decompile again.`);
2983
- };
2984
- const rules = (conditions, where) => {
2985
- for (const condition of conditions ?? [])
2986
- for (const group of condition.rules ?? [])
2987
- for (const r of group ?? [])
2988
- check(r?.conditionExpression, where);
2989
- };
2990
- (plan.metadata?.slaRules ?? []).forEach((sla, i) => check(sla?.expression, `case SLA #${i + 1}`));
2991
- rules(plan.metadata?.caseExitRules, 'case completion rule');
2992
- for (const stage of (plan.nodes ?? []).filter(isStage)) {
2993
- const at = `stage "${stage.data?.label ?? stage.id ?? '?'}"`;
2994
- rules(stage.data?.entryConditions, `${at} entry rule`);
2995
- rules(stage.data?.exitConditions, `${at} exit rule`);
2996
- (stage.data?.slaRules ?? []).forEach((sla, i) => check(sla?.expression, `${at} SLA #${i + 1}`));
2997
- for (const task of (stage.data?.tasks ?? []).flat()) {
2998
- const tat = `task "${task?.displayName ?? task?.id ?? '?'}" in ${at}`;
2999
- check(task?.skipCondition, `${tat} skip condition`);
3000
- rules(task?.entryConditions, `${tat} entry rule`);
3001
- }
3002
- }
3003
- }
3004
2917
  /**
3005
2918
  * The plan with each read of a task output that recompiling could not keep,
3006
2919
  * `vars.<output id>`, written as the task-output reference that names the same
@@ -83,7 +83,7 @@ export declare const REFUSALS: {
83
83
  readonly BPMN_DUP_BOUNDARY_ID: "lowering";
84
84
  readonly BPMN_DUP_ERROR_CATCH: "lowering";
85
85
  readonly BPMN_ERROR_NAME_EMPTY: "lowering";
86
- readonly BPMN_ERROR_START_NOT_INTERRUPTING: "lowering";
86
+ readonly BPMN_ERROR_START_NOT_INTERRUPTING: "lint";
87
87
  readonly BPMN_ERROR_VAR_AND_PAYLOAD: "lowering";
88
88
  readonly BPMN_ERROR_VAR_WITHOUT_ERROR: "lowering";
89
89
  readonly BPMN_EVENT_BINDINGS_MISSING: "lowering";
@@ -132,7 +132,7 @@ export const REFUSALS = {
132
132
  BPMN_DUP_BOUNDARY_ID: 'lowering',
133
133
  BPMN_DUP_ERROR_CATCH: 'lowering',
134
134
  BPMN_ERROR_NAME_EMPTY: 'lowering',
135
- BPMN_ERROR_START_NOT_INTERRUPTING: 'lowering',
135
+ BPMN_ERROR_START_NOT_INTERRUPTING: 'lint',
136
136
  BPMN_ERROR_VAR_AND_PAYLOAD: 'lowering',
137
137
  BPMN_ERROR_VAR_WITHOUT_ERROR: 'lowering',
138
138
  BPMN_EVENT_BINDINGS_MISSING: 'lowering',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.87.2",
3
+ "version": "6.87.4",
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",
@@ -110,5 +110,5 @@
110
110
  "@types/node": "^22.7.0",
111
111
  "esbuild": "^0.28.1"
112
112
  },
113
- "gitref": "bac06e6a74bed3582399978cf4180a49d9946def"
113
+ "gitref": "d3a99371e59e7789379c5a846f1084d7545f17d8"
114
114
  }