@uipath/maestro-builder-sdk 6.95.2 → 6.95.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.
package/dist/api-index.md CHANGED
@@ -184,8 +184,8 @@ could hand you spans for a version you do not have.
184
184
  | `HitlVariant` | type | `dist/nodes/hitl/flow/spec.d.ts:120-145` | Supporting types | WHICH human-task node type to emit. |
185
185
  | `http` | function | `dist/nodes/http/flow/factories.d.ts:7-14` | Actions | Declare an HTTP request action, explicitly choosing standalone or managed. |
186
186
  | `HttpBranch` | interface | `dist/nodes/http/flow/spec.d.ts:8-23` | Supporting types | One conditional response branch on an HTTP node — a designer-visible side exit. |
187
- | `HttpInputs` | type | `dist/nodes/http/flow/spec.d.ts:126-143` | Option shapes | |
188
- | `HttpInputsBase` | interface | `dist/nodes/http/flow/spec.d.ts:24-125` | Option shapes | 11 field(s) |
187
+ | `HttpInputs` | type | `dist/nodes/http/flow/spec.d.ts:135-152` | Option shapes | |
188
+ | `HttpInputsBase` | interface | `dist/nodes/http/flow/spec.d.ts:24-134` | Option shapes | 11 field(s) |
189
189
  | `HttpRequestToolRef` | interface | `dist/core/actions.d.ts:524-553` | Supporting types | The built-in HTTP-request tool (`uipath.agent.resource.tool.builtin.httprequest`): the agent performs an HTTP call. |
190
190
  | `inlineAgent` | function | `dist/nodes/agent/flow/factories.d.ts:90-140` | Actions | Declare an INLINE AUTONOMOUS AGENT — an agent defined inside this flow's own project rather than published to… |
191
191
  | `InlineAgentFieldType` | type | `dist/core/actions.d.ts:268-269` | Supporting types | A JSON-schema-ish type for one field of an inline agent's input/output schema. |
@@ -508,7 +508,7 @@ not find it either.
508
508
  | `hidden` | property | `RegistryInputField` | `dist/bpmn/typed-node.d.ts:68` |
509
509
  | `hitl` | property | `FlowActionSpecs` | `dist/nodes/hitl/flow/spec.d.ts:427-430` |
510
510
  | `http` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:1010-1011` |
511
- | `http` | property | `FlowActionSpecs` | `dist/nodes/http/flow/spec.d.ts:146-149` |
511
+ | `http` | property | `FlowActionSpecs` | `dist/nodes/http/flow/spec.d.ts:155-158` |
512
512
  | `http` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2565-2601` |
513
513
  | `httpRequest` | method | `TaskBuilder` | `dist/case/case-sdk.d.ts:1588-1607` |
514
514
  | `humanTask` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2869-2952` |
@@ -1044,7 +1044,7 @@ not find it either.
1044
1044
  | `retryAllErrors` | property | `TaskRetryPolicy` | `dist/case/case-sdk.d.ts:934-939` |
1045
1045
  | `retryBackoff` | property | `TaskRetryPolicy` | `dist/case/case-sdk.d.ts:932-933` |
1046
1046
  | `retryBackoffType` | property | `TaskRetryPolicy` | `dist/case/case-sdk.d.ts:940-941` |
1047
- | `retryCount` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:110-124` |
1047
+ | `retryCount` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:119-133` |
1048
1048
  | `return` | method | `StepList` | `dist/flow-sdk.d.ts:1244-1253` |
1049
1049
  | `returnCitations` | property | `SummarizeInputs` | `dist/nodes/ai-patterns/flow/spec.d.ts:35-40` |
1050
1050
  | `returns` | property | `AgentInputs` | `dist/nodes/process/flow/spec.d.ts:353-372` |
@@ -1220,7 +1220,7 @@ not find it either.
1220
1220
  | `terminate` | method | `StepList` | `dist/flow-sdk.d.ts:1139-1177` |
1221
1221
  | `threshold` | property | `ContextIndexRef` | `dist/core/actions.d.ts:891-892` |
1222
1222
  | `timeCycle` | property | `BuiltTrigger` | `dist/case/case-sdk.d.ts:286-287` |
1223
- | `timeout` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:92-109` |
1223
+ | `timeout` | property | `HttpInputsBase` | `dist/nodes/http/flow/spec.d.ts:92-118` |
1224
1224
  | `timeout` | property | `HttpRequestToolRef` | `dist/core/actions.d.ts:551-552` |
1225
1225
  | `timer` | property | `ActionTimedSettings` | `dist/case/case-sdk.d.ts:854-855` |
1226
1226
  | `timer` | property | `BoundaryOpts` | `dist/bpmn/bpmn-sdk.d.ts:806-807` |
@@ -25,3 +25,15 @@
25
25
  * (flow-schema `coerceToExpressionValue`). Do not use this for one.
26
26
  */
27
27
  export declare function wireExprBody(raw: string): string;
28
+ /**
29
+ * Whether a VALUE-slot value is a JS expression the platform evaluates: a
30
+ * string that starts with `=js:` exactly, or the `{ type: 'jsExpression',
31
+ * expression }` envelope compile writes for one.
32
+ *
33
+ * Exactly, with no trimming: compile's migrate step wraps a value into the
34
+ * envelope only when it starts with `=js:`, and writes anything else as literal
35
+ * text. So `' =js:"PT1S"'` is a literal that happens to contain the marker, not
36
+ * an expression. Migrate and the checks share this one rule, so a check and
37
+ * compile never disagree on which values are expressions.
38
+ */
39
+ export declare function isJsExpressionValue(value: unknown): boolean;
@@ -32,3 +32,21 @@ export function wireExprBody(raw) {
32
32
  const body = raw.slice(1);
33
33
  return /^(?:vars|metadata)(?:\.[A-Za-z_$][\w$]*|\[\d+\])*$/.test(body.trim()) ? `$${body.trim()}` : body;
34
34
  }
35
+ /**
36
+ * Whether a VALUE-slot value is a JS expression the platform evaluates: a
37
+ * string that starts with `=js:` exactly, or the `{ type: 'jsExpression',
38
+ * expression }` envelope compile writes for one.
39
+ *
40
+ * Exactly, with no trimming: compile's migrate step wraps a value into the
41
+ * envelope only when it starts with `=js:`, and writes anything else as literal
42
+ * text. So `' =js:"PT1S"'` is a literal that happens to contain the marker, not
43
+ * an expression. Migrate and the checks share this one rule, so a check and
44
+ * compile never disagree on which values are expressions.
45
+ */
46
+ export function isJsExpressionValue(value) {
47
+ if (typeof value === 'string')
48
+ return value.startsWith('=js:');
49
+ return value !== null && typeof value === 'object'
50
+ && value.type === 'jsExpression'
51
+ && typeof value.expression === 'string';
52
+ }
package/dist/migrate.js CHANGED
@@ -39,6 +39,7 @@
39
39
  import { FLOW_FORMAT_PROFILE } from './format-profile.js';
40
40
  import { schemaVersionAtLeast } from './schema-version.js';
41
41
  import { readFlowGlobals } from './flow-variables.js';
42
+ import { isJsExpressionValue } from './core/wire-expr.js';
42
43
  const UNWRAPPED_INPUTS = [
43
44
  { typePrefix: 'uipath.ixp.', keys: new Set(['fileRef']) },
44
45
  ];
@@ -353,7 +354,7 @@ function mapScalarType(t) {
353
354
  return undefined;
354
355
  }
355
356
  function wrap(value, fieldType) {
356
- if (value.startsWith('=js:'))
357
+ if (isJsExpressionValue(value))
357
358
  return { type: 'jsExpression', expression: value.slice(4), fieldType };
358
359
  return { type: 'literal', expression: value, fieldType };
359
360
  }
@@ -1,5 +1,6 @@
1
1
  import { nearestName } from '../../../core/edit-distance.js';
2
2
  import { escapeRegExp } from '../../../core/escape-regexp.js';
3
+ import { isJsExpressionValue } from '../../../core/wire-expr.js';
3
4
  export const HTTP_DIAGNOSTICS = {
4
5
  HTTP_V1_RETIRED: { severity: 'warning', summary: 'the plain node is retired on the tenant registry' },
5
6
  HTTP_BINDING_REQUIRES_MANAGED: { severity: 'error', summary: 'connection settings on the standalone node' },
@@ -74,11 +75,19 @@ export function checkHttp(inputs, ctx) {
74
75
  // empty or unbound `targetConnector` are the serializer's HTTP_BINDING_* /
75
76
  // HTTP_MANAGED_BINDING_INCOMPLETE / HTTP_TARGET_CONNECTOR_*.
76
77
  const timeout = inputs?.timeout;
78
+ // The platform's only use of `timeout` is the retry backoff, which the engine
79
+ // parses as a literal duration and never evaluates, so an expression is refused too.
77
80
  if (timeout !== undefined) {
78
- if (typeof timeout !== 'string' || !ISO8601_DURATION.test(timeout.trim())) {
81
+ if (isJsExpressionValue(timeout)) {
82
+ ctx.report('HTTP_TIMEOUT_NOT_DURATION', `Step "${step}" sets timeout to an expression (${JSON.stringify(timeout)}). The platform `
83
+ + `uses this field only as the retry backoff (the wait between retries when retryCount > 0) and reads it as a `
84
+ + `literal ISO-8601 duration; it does not evaluate expressions. With retryCount > 0 the first retry faults, and `
85
+ + `with retryCount 0 the value is ignored. It is not a request timeout.`, `timeout: 'PT30S' // a literal duration: wait 30 seconds between retries`);
86
+ }
87
+ else if (typeof timeout !== 'string' || !ISO8601_DURATION.test(timeout.trim())) {
79
88
  ctx.report('HTTP_TIMEOUT_NOT_DURATION', `Step "${step}" sets timeout to ${JSON.stringify(timeout)}, which is not an ISO-8601 duration. The `
80
- + `platform reads this field as a duration string (both http definitions default it to "PT15M"), so a `
81
- + `value it cannot parse configures no timeout at all.`, `timeout: 'PT30S' // 30 seconds — also 'PT1M', 'PT15M', 'PT1H'`);
89
+ + `platform uses this field only as the retry backoff (the wait between retries when retryCount > 0) and reads `
90
+ + `it as a literal duration, so a value it cannot parse faults the first retry (and is ignored when retryCount is 0).`, `timeout: 'PT30S' // 30 seconds — also 'PT1M', 'PT15M', 'PT1H'`);
82
91
  }
83
92
  }
84
93
  const retryCount = inputs?.retryCount;
@@ -274,6 +274,7 @@ function liftHttp(node, ctx, managed) {
274
274
  : undefined;
275
275
  const text = (v) => (typeof v === 'string' ? v : undefined);
276
276
  const connectionValue = detail.connectionId ?? detail.connectionResourceId ?? req.connection;
277
+ const timeout = ctx.sourceText(inputs.timeout);
277
278
  const retry = inputs.retryCount !== undefined && Number(inputs.retryCount) !== 0 ? Number(inputs.retryCount) : undefined;
278
279
  if (retry !== undefined && !Number.isFinite(retry)) {
279
280
  throw new CompileRefusal('DECOMPILE_NOT_A_NUMBER', `decompile: expected a number, got ${JSON.stringify(inputs.retryCount)}.`);
@@ -295,7 +296,7 @@ function liftHttp(node, ctx, managed) {
295
296
  ? { folder: detail.connectionFolderKey } : {}),
296
297
  ...(managed && typeof req.targetConnector === 'string' && req.targetConnector !== 'uipath-uipath-http'
297
298
  ? { targetConnector: req.targetConnector } : {}),
298
- ...(typeof inputs.timeout === 'string' && inputs.timeout !== 'PT15M' ? { timeout: inputs.timeout } : {}),
299
+ ...(timeout !== undefined && timeout !== 'PT15M' ? { timeout } : {}),
299
300
  ...(retry !== undefined ? { retryCount: retry } : {}),
300
301
  ...(branchRows.length ? {
301
302
  branches: branchRows.map((b) => ({
@@ -90,21 +90,30 @@ interface HttpInputsBase {
90
90
  */
91
91
  returns?: Record<string, ReturnFieldType>;
92
92
  /**
93
- * How long to wait for the response before giving up, as an **ISO-8601
94
- * duration** — `'PT30S'` is "give up after 30 seconds", `'PT1M'` one minute,
95
- * `'PT15M'` fifteen.
93
+ * The **retry backoff**: how long to wait before each retry, as a literal
94
+ * **ISO-8601 duration** — `'PT30S'` is "wait 30 seconds between attempts",
95
+ * `'PT1M'` one minute. Despite the name, it is NOT a request timeout: the
96
+ * platform writes it only into the node's retry policy, so it has an effect
97
+ * only when `retryCount` is above 0, and it never limits how long one request
98
+ * may take.
96
99
  *
97
- * Both http node types carry this, and both definitions declare the same
98
- * default (`PT15M`), so leaving it unset is not "no timeout" — it is fifteen
99
- * minutes. Omitted from the emitted node unless you set it, which keeps a flow
100
- * that doesn't care byte-identical to the platform's own default shape (~99%
101
- * of the 808 deployed http nodes are on the defaults).
100
+ * Both http definitions declare the default `PT15M`. Omitted from the emitted
101
+ * node unless you set it, which keeps a flow that doesn't care byte-identical
102
+ * to the platform's own default shape (~99% of the 808 deployed http nodes are
103
+ * on the defaults).
102
104
  *
103
- * `check` rejects a string the platform cannot parse as a duration —
104
- * `'30s'`, `'PT'` and `'30'` are all errors that name the expected form.
105
+ * The engine parses the value as a literal duration and does not evaluate
106
+ * expressions, so `check` rejects an `=js:` expression as well as a string
107
+ * that is not a duration (`'30s'`, `'PT'`, `'30'`).
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * http({ url: 'https://api.example.com/x', managed: true, retryCount: 2, timeout: 'PT30S' })
112
+ * // up to 3 attempts, 30 seconds apart
113
+ * ```
105
114
  *
106
115
  * @defaultValue `'PT15M'`
107
- * @enforcedBy HTTP_TIMEOUT_NOT_DURATION Must be an ISO-8601 duration.
116
+ * @enforcedBy HTTP_TIMEOUT_NOT_DURATION Must be a literal ISO-8601 duration, not an expression.
108
117
  */
109
118
  timeout?: string;
110
119
  /**
@@ -1,4 +1,5 @@
1
1
  import { SCHEDULE_PRESETS } from './spec.js';
2
+ import { isJsExpressionValue } from '../../../core/wire-expr.js';
2
3
  export const TRIGGER_DIAGNOSTICS = {
3
4
  SCHEDULE_NO_INTERVAL: { severity: 'error', summary: 'a schedule with no `every`, so it never starts the flow' },
4
5
  SCHEDULE_NOT_ISO: { severity: 'error', summary: '`every` is not an ISO-8601 repeating interval or a Quartz cron expression' },
@@ -88,6 +89,21 @@ export function checkSchedule(spec, ctx) {
88
89
  + `Give it an ISO-8601 repeating interval — ${SCHEDULE_PRESETS.join(', ')} are the designer's presets.`, `every: 'R/PT1H'`);
89
90
  return;
90
91
  }
92
+ // An expression is refused, though `uip maestro flow validate` accepts it at
93
+ // 1.1 and 1.2 (#1687). Nothing evaluates a schedule at run time: `uip maestro
94
+ // flow pack` turns `timerValue` into an Orchestrator TimeTrigger with a fixed
95
+ // CronExpression, computed at pack time, before any `$vars` exist
96
+ // (flow-workbench packaging.ts). An envelope registers no trigger; a bare
97
+ // `=js:` string becomes the monthly-midnight fallback cron (#1904 review).
98
+ // "Expression" is migrate's own rule (`isJsExpressionValue`), so `' =js:…'`,
99
+ // which compile writes as text, is checked as the literal it is below.
100
+ if (isJsExpressionValue(raw)) {
101
+ at('SCHEDULE_NOT_ISO', `The scheduled trigger's interval is an expression (${JSON.stringify(raw)}). A schedule is registered as a `
102
+ + `fixed cron when the flow is published, before any variable has a value, so it cannot be computed from `
103
+ + `variables: an expression schedule never fires as written. Write a literal ISO-8601 repeating interval `
104
+ + `(R/PT1H, R/P1D) or a Quartz cron expression.`, `every: 'R/PT1H'`);
105
+ return;
106
+ }
91
107
  const every = String(raw).trim();
92
108
  if (SCHEDULE_CRON_RE.test(every.trim())) {
93
109
  // A Quartz cron expression — admitted by the scheduled trigger's 1.2
@@ -17,9 +17,13 @@
17
17
  */
18
18
  import { CompileRefusal } from '../../../core/compile-refusal.js';
19
19
  import { checkSchedule, checkStartingPrompts, fitsScheduleV12, isIsoInterval } from './check.js';
20
+ import { isJsExpressionValue } from '../../../core/wire-expr.js';
20
21
  import { SCHEDULE_PRESETS } from './spec.js';
21
22
  /** A Quartz cron expression: 6–7 whitespace-separated fields, none of them an ISO `R/` interval. */
22
23
  function isQuartz(every) {
24
+ // An `=js:` expression can have six tokens too; it is not cron.
25
+ if (isJsExpressionValue(every))
26
+ return false;
23
27
  const fields = every.trim().split(/\s+/);
24
28
  return fields.length >= 6 && fields.length <= 7 && !every.trim().startsWith('R');
25
29
  }
@@ -57,7 +61,8 @@ function scheduledVersion(inputs, explicit) {
57
61
  }
58
62
  return explicit;
59
63
  }
60
- if (cron || fitsScheduleV12(every))
64
+ // An expression has no interval to fit: it is written at the current version.
65
+ if (cron || isJsExpressionValue(every) || fitsScheduleV12(every))
61
66
  return SCHEDULED_DEFAULT_VERSION;
62
67
  return '1.1';
63
68
  }
@@ -136,13 +141,15 @@ function scheduleInputs(inputs, entryPointId, version) {
136
141
  * shapes: 1.1 splits preset/custom over `timerPreset`/`timerValue`; 1.2 (the
137
142
  * cron-capable contract) dropped `timerPreset` and rides `timerValue` alone.
138
143
  */
139
- function scheduleEvery(node) {
144
+ function scheduleEvery(node, ctx) {
140
145
  const i = (node.inputs ?? {});
141
- if (typeof i.timerPreset !== 'string')
142
- return typeof i.timerValue === 'string' ? i.timerValue : '';
143
- return i.timerPreset === 'custom'
144
- ? (typeof i.timerValue === 'string' ? i.timerValue : '')
145
- : i.timerPreset;
146
+ // Through `sourceText`, so an `=js:` schedule the file holds as a jsExpression
147
+ // envelope comes back as its `=js:` text instead of '' (#1687).
148
+ const text = (raw) => ctx.sourceText(raw);
149
+ const preset = text(i.timerPreset);
150
+ if (preset === undefined)
151
+ return text(i.timerValue) ?? '';
152
+ return preset === 'custom' ? (text(i.timerValue) ?? '') : preset;
146
153
  }
147
154
  /**
148
155
  * A conversation or a call starts with only what the platform supplies, so an
@@ -176,7 +183,7 @@ export const scheduledTriggerType = {
176
183
  const entryPointId = ctx.root.isDefault ? ctx.entryPointId('start') : ctx.entryPointId();
177
184
  return { version, inputs: scheduleInputs(spec.inputs, entryPointId, version) };
178
185
  },
179
- deserialize: (node) => ({ kind: 'scheduled', inputs: { every: scheduleEvery(node) } }),
186
+ deserialize: (node, ctx) => ({ kind: 'scheduled', inputs: { every: scheduleEvery(node, ctx) } }),
180
187
  print: (spec, ctx) => ({ factory: 'scheduled', options: [['every', ctx.string(spec.inputs.every)]] }),
181
188
  check: (spec, ctx) => checkSchedule(spec, ctx),
182
189
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.95.2",
3
+ "version": "6.95.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",
@@ -112,5 +112,5 @@
112
112
  "@types/node": "^22.7.0",
113
113
  "esbuild": "^0.28.1"
114
114
  },
115
- "gitref": "ba0d70b57dd4f12a32eb7172d5eef52afad21364"
115
+ "gitref": "4c58402d9acb62bdecb393a60d959c89f5594df2"
116
116
  }