@uipath/maestro-builder-sdk 6.95.3 → 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.
|
@@ -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
|
-
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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.
|
|
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": "
|
|
115
|
+
"gitref": "4c58402d9acb62bdecb393a60d959c89f5594df2"
|
|
116
116
|
}
|