@uipath/maestro-builder-sdk 6.33.2 → 6.35.0

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.
@@ -13,7 +13,7 @@
13
13
  * every edge out of an outcome-handle node to.
14
14
  */
15
15
  import { Expr, toExpr } from '../../../core/expr.js';
16
- import { formFieldJsonSchema, formFieldOptionsWire, liftFormFieldOptions, sourceFormFieldType, wireFormFieldType } from '../../../core/form-field-type.js';
16
+ import { formFieldJsonSchema, formFieldRowLoss, formFieldRowLossMessage, formFieldSettingsSource, formFieldSettingsWire, liftFormFieldSettings, sourceFormFieldType, wireFormFieldType, } from '../../../core/form-field-type.js';
17
17
  import { isAnswerField } from '../../../core/hitl-answers.js';
18
18
  import { OUTCOME_HANDLE_NODE_TYPES, hitlExitModel, outcomeIdOf, outcomeSlug } from '../../../core/hitl-routing.js';
19
19
  import { jsonClone } from '../../../core/json-clone.js';
@@ -75,23 +75,23 @@ function hitlInputs(inputs, nodeType, ctx) {
75
75
  // contract flow-v1's serializer reads), and the WRITE target is the field
76
76
  // id itself — deliberately decoupled from the binding, so no `variable`.
77
77
  base.binding = bindingPath(f.value, ctx);
78
- if (f.required)
79
- base.required = true;
78
+ const required = f.required;
79
+ if (typeof required === 'boolean')
80
+ base.required = required;
80
81
  }
81
82
  else {
82
83
  // The answer's landing variable. The platform falls back to the field id
83
84
  // when this is absent; naming it keeps the emitted flow explicit and
84
85
  // matches what the designer writes.
85
86
  base.variable = `vars.${f.id}`;
86
- if (f.required)
87
- base.required = true;
87
+ const required = f.required;
88
+ if (typeof required === 'boolean')
89
+ base.required = required;
88
90
  }
89
- // A picker's choices (a `singleSelect` dropdown, a `multiSelect`), as the
90
- // canvas stores them on the row (#1235).
91
- const options = formFieldOptionsWire(f.options);
92
- if (options !== undefined)
93
- base.options = options;
94
- return base;
91
+ // The field's settings — `controlType`, a picker's `options`,
92
+ // `defaultValue`, `colSpan`, `rules`, … — as the canvas stores them on the
93
+ // row, in the platform's key order (#1235, #1250).
94
+ return { ...base, ...formFieldSettingsWire(f) };
95
95
  });
96
96
  const outcomes = (inputs?.outcomes ?? []).map((o, i) => {
97
97
  const name = typeof o === 'string' ? o : o?.name;
@@ -331,7 +331,11 @@ function liftHitl(node, typeName, ctx) {
331
331
  const id = String(f.id ?? '');
332
332
  const direction = String(f.direction ?? 'output');
333
333
  const value = direction === 'input' || direction === 'inOut' ? bindingExpr(f.binding) : undefined;
334
- const options = liftFormFieldOptions(f.options);
334
+ // Every row key the source cannot carry is reported, never dropped
335
+ // silently: a warning, an error under --strict (#1250).
336
+ const loss = formFieldRowLoss(f, 'human task');
337
+ if (loss.length > 0)
338
+ ctx.lossy(formFieldRowLossMessage(`human task ${JSON.stringify(n.id)}`, id, loss));
335
339
  return {
336
340
  id,
337
341
  // serialize defaults a row's label to its id.
@@ -341,8 +345,8 @@ function liftHitl(node, typeName, ctx) {
341
345
  type: sourceFormFieldType(f.type ?? 'string'),
342
346
  direction,
343
347
  ...(value !== undefined ? { value } : {}),
344
- ...(f.required === true ? { required: true } : {}),
345
- ...(options !== undefined ? { options } : {}),
348
+ ...(typeof f.required === 'boolean' && direction !== 'input' ? { required: f.required } : {}),
349
+ ...liftFormFieldSettings(f),
346
350
  };
347
351
  });
348
352
  const outcomeRows = (Array.isArray(schema.outcomes) ? schema.outcomes : []);
@@ -504,12 +508,8 @@ function printHitl({ inputs }, ctx) {
504
508
  ['type', ctx.string(f.type)],
505
509
  ['direction', ctx.string(f.direction)],
506
510
  ['value', f.value !== undefined ? ctx.value(f.value) : undefined],
507
- ['required', f.required ? 'true' : undefined],
508
- ['options', f.options !== undefined ? `[${f.options.map((o) => obj([
509
- ['id', ctx.string(o.id)],
510
- ['value', ctx.string(o.value)],
511
- ['label', ctx.string(o.label)],
512
- ], ctx)).join(', ')}]` : undefined],
511
+ ['required', f.required !== undefined ? String(f.required) : undefined],
512
+ ...formFieldSettingsSource(f, ctx.value),
513
513
  ], ctx));
514
514
  const outcomes = h.outcomes.map((o) => (typeof o === 'string' ? ctx.string(o) : obj([
515
515
  ['name', ctx.string(o.name)],
@@ -106,11 +106,16 @@ export function schemaVersionRefusal(policy, requested) {
106
106
  if (isWritableSchemaVersion(policy, requested))
107
107
  return undefined;
108
108
  const writable = writableSchemaVersions(policy);
109
+ const newestWritable = writable.at(-1);
109
110
  const direction = policy.latestKnown !== undefined && schemaVersionAtLeast(requested, policy.latestKnown)
110
111
  ? compareSchemaVersions(requested, policy.latestKnown) > 0
111
112
  ? `The platform's newest known ${family} schema version is ${policy.latestKnown}, so ${requested} is newer than anything this SDK has read.`
112
113
  : `${requested} is the platform's current ${family} schema version, but this SDK build has not been taught to write it.`
113
- : `${requested} is older than the ${writable.length === 1 ? 'one version' : 'versions'} this build writes.`;
114
+ : newestWritable !== undefined && compareSchemaVersions(requested, newestWritable) > 0
115
+ ? `${requested} is a platform ${family} schema version newer than this build writes`
116
+ + (policy.latestKnown !== undefined ? ` (the platform's current is ${policy.latestKnown})` : '')
117
+ + '; this SDK build has not been taught to write it.'
118
+ : `${requested} is older than the ${writable.length === 1 ? 'one version' : 'versions'} this build writes.`;
114
119
  return (`${method}("${requested}"): this SDK build writes ${family} schema ${writable.join(' / ')}. ${direction} `
115
120
  + `A document's version claims that the WHOLE document matches that schema, so declaring one this build cannot emit `
116
121
  + `would write a false claim rather than a different document. ${policy.migration}`);
package/dist/serialize.js CHANGED
@@ -20,7 +20,7 @@ import { FLOW_NODE_TYPES } from './flow-node-registry.js';
20
20
  import { stepExits } from './flow-step-exits.js';
21
21
  import { resolveVersionCarried } from './core/nodes/versioned.js';
22
22
  import { indexCarriedDefinitions } from './core/carried-definitions.js';
23
- import { formFieldJsonSchema, formFieldOptionsWire, wireFormFieldType } from './core/form-field-type.js';
23
+ import { formFieldJsonSchema, formFieldSettingsWire, wireFormFieldType } from './core/form-field-type.js';
24
24
  import { ConnectorResolveError } from './core/connector-resolve-error.js';
25
25
  import { connectionConnectors } from './bindings-v2.js';
26
26
  import { BindingRefusal, GUID_RE, bindingLabelRefusal, bindingMissingMessage, missingBindingLabels } from './core/binding-messages.js';
@@ -5751,14 +5751,17 @@ export function serialize(built, opts = {}) {
5751
5751
  qnode.display = { ...qnode.display, shape: 'circle' };
5752
5752
  delete qnode.model;
5753
5753
  const rows = (esc.fields ?? []).map((f) => {
5754
- const options = formFieldOptionsWire(f.options);
5754
+ const required = f.direction === 'input' ? undefined : f.required;
5755
5755
  return {
5756
5756
  id: f.id,
5757
5757
  label: f.label ?? f.id,
5758
5758
  type: wireFormFieldType(f.type),
5759
5759
  direction: f.direction,
5760
- // A picker's choices, as the human task's rows carry them (#1235).
5761
- ...(options !== undefined ? { options } : {}),
5760
+ ...(typeof required === 'boolean' ? { required } : {}),
5761
+ // The field's settings (`controlType`, a picker's `options`,
5762
+ // `defaultValue`, `colSpan`, …), as the human task's rows carry
5763
+ // them (#1235, #1250).
5764
+ ...formFieldSettingsWire(f),
5762
5765
  };
5763
5766
  });
5764
5767
  const qsource = esc.source ?? derivedEscalationSource(built.id, step.name, esc.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.33.2",
3
+ "version": "6.35.0",
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",
@@ -93,5 +93,5 @@
93
93
  "@types/node": "^22.7.0",
94
94
  "esbuild": "^0.28.1"
95
95
  },
96
- "gitref": "04124f15f4e70827cb18bbd0f52c0bf676ceedd1"
96
+ "gitref": "467e33fe1378eddf63acb88201f18ecac8a73967"
97
97
  }