@uipath/maestro-builder-sdk 6.32.4 → 6.32.5

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.
@@ -80,8 +80,9 @@ export declare function canonicalFormFieldType(type: unknown): CanonicalFormFiel
80
80
  /**
81
81
  * The spelling decompile writes into source for a wire field type: a canonical
82
82
  * type or an SDK alias stays as written, so a canvas form (`"integer"`,
83
- * `"date"`) and a classic-CLI form (`"text"`) both compile back to the bytes
84
- * they came from; a product alias the SDK does not accept in source
83
+ * `"date"`) compiles back to the bytes it came from and a classic-CLI form's
84
+ * `"text"` stays a type `check` accepts (compile writes it as `"string"`);
85
+ * a product alias the SDK does not accept in source
85
86
  * (`"System.Int32"`, `"string[]"`) becomes its canonical type; anything else
86
87
  * stays verbatim for `check` to report.
87
88
  *
@@ -158,3 +159,17 @@ export declare function formFieldOptionsProblem(type: unknown, options: unknown)
158
159
  * that starts "… the field "<id>" …".
159
160
  */
160
161
  export declare function formFieldOptionsWhy(problem: 'malformed' | 'missing' | 'ignored', type: unknown): string;
162
+ /**
163
+ * The spelling a form field's type is written in on the wire: the product's
164
+ * canonical one for the SDK's legacy spellings (`text` is written `string`,
165
+ * `date-time` is written `datetime`). `@uipath/hitl-schema-types` resolves
166
+ * those two only as legacy aliases, and the designer saves the canonical value,
167
+ * so an SDK-authored form says what a canvas-built one says (#1185). Every
168
+ * other type passes through unchanged.
169
+ *
170
+ * @example
171
+ * wireFormFieldType('text') // 'string'
172
+ * wireFormFieldType('date-time') // 'datetime'
173
+ * wireFormFieldType('number') // 'number'
174
+ */
175
+ export declare function wireFormFieldType(type: unknown): unknown;
@@ -22,9 +22,10 @@ const CANONICAL_JSON_SCHEMA = {
22
22
  /** The product's 11 canonical quick-form field types, in its own order. */
23
23
  export const CANONICAL_FORM_FIELD_TYPES = Object.keys(CANONICAL_JSON_SCHEMA);
24
24
  /**
25
- * The SDK's own legacy spellings, accepted in source: `text` (what the SDK,
26
- * flow-v1's serializer and `uip maestro flow hitl add` have always written) and
27
- * `date-time`. The product resolves both.
25
+ * The SDK's own legacy spellings, accepted in source: `text` (what flow-v1's
26
+ * serializer and `uip maestro flow hitl add` write) and `date-time`. The
27
+ * product resolves both. The SDK writes their canonical value on the wire
28
+ * (`wireFormFieldType`).
28
29
  */
29
30
  const SDK_ALIASES = {
30
31
  text: 'string',
@@ -172,8 +173,9 @@ export function canonicalFormFieldType(type) {
172
173
  /**
173
174
  * The spelling decompile writes into source for a wire field type: a canonical
174
175
  * type or an SDK alias stays as written, so a canvas form (`"integer"`,
175
- * `"date"`) and a classic-CLI form (`"text"`) both compile back to the bytes
176
- * they came from; a product alias the SDK does not accept in source
176
+ * `"date"`) compiles back to the bytes it came from and a classic-CLI form's
177
+ * `"text"` stays a type `check` accepts (compile writes it as `"string"`);
178
+ * a product alias the SDK does not accept in source
177
179
  * (`"System.Int32"`, `"string[]"`) becomes its canonical type; anything else
178
180
  * stays verbatim for `check` to report.
179
181
  *
@@ -299,3 +301,21 @@ export function formFieldOptionsWhy(problem, type) {
299
301
  + `plain input and never shows them. Use 'singleSelect' or 'enum' (a dropdown) or 'multiSelect'`;
300
302
  }
301
303
  }
304
+ /**
305
+ * The spelling a form field's type is written in on the wire: the product's
306
+ * canonical one for the SDK's legacy spellings (`text` is written `string`,
307
+ * `date-time` is written `datetime`). `@uipath/hitl-schema-types` resolves
308
+ * those two only as legacy aliases, and the designer saves the canonical value,
309
+ * so an SDK-authored form says what a canvas-built one says (#1185). Every
310
+ * other type passes through unchanged.
311
+ *
312
+ * @example
313
+ * wireFormFieldType('text') // 'string'
314
+ * wireFormFieldType('date-time') // 'datetime'
315
+ * wireFormFieldType('number') // 'number'
316
+ */
317
+ export function wireFormFieldType(type) {
318
+ return typeof type === 'string' && Object.hasOwn(SDK_ALIASES, type)
319
+ ? SDK_ALIASES[type]
320
+ : type;
321
+ }
@@ -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 } from '../../../core/form-field-type.js';
16
+ import { formFieldJsonSchema, formFieldOptionsWire, liftFormFieldOptions, 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';
@@ -61,7 +61,7 @@ function hitlInputs(inputs, nodeType, ctx) {
61
61
  const base = {
62
62
  id: f.id,
63
63
  label: f.label ?? f.id,
64
- type: f.type,
64
+ type: wireFormFieldType(f.type),
65
65
  direction: f.direction,
66
66
  };
67
67
  if (f.direction === 'input') {
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 } from './core/form-field-type.js';
23
+ import { formFieldJsonSchema, formFieldOptionsWire, 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';
@@ -5720,7 +5720,7 @@ export function serialize(built, opts = {}) {
5720
5720
  return {
5721
5721
  id: f.id,
5722
5722
  label: f.label ?? f.id,
5723
- type: f.type,
5723
+ type: wireFormFieldType(f.type),
5724
5724
  direction: f.direction,
5725
5725
  // A picker's choices, as the human task's rows carry them (#1235).
5726
5726
  ...(options !== undefined ? { options } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.32.4",
3
+ "version": "6.32.5",
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": "9a7e5f98ca054b05f74ac655b8725bf4e3b50e89"
96
+ "gitref": "14ac2b3fba98100313a97094685f1e9b5bc3601a"
97
97
  }