@uipath/maestro-builder-sdk 6.95.1 → 6.95.3
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 +2 -2
- package/dist/api-members.md +3 -3
- package/dist/core/wire-expr.d.ts +12 -0
- package/dist/core/wire-expr.js +18 -0
- package/dist/merge-cli.js +57 -25
- package/dist/merge-compile.js +6 -1
- package/dist/merge.js +20 -0
- package/dist/migrate.js +2 -1
- package/dist/nodes/http/flow/check.js +12 -3
- package/dist/nodes/http/flow/node-type.js +2 -1
- package/dist/nodes/http/flow/spec.d.ts +20 -11
- package/package.json +2 -2
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:
|
|
188
|
-
| `HttpInputsBase` | interface | `dist/nodes/http/flow/spec.d.ts:24-
|
|
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. |
|
package/dist/api-members.md
CHANGED
|
@@ -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:
|
|
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:
|
|
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-
|
|
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` |
|
package/dist/core/wire-expr.d.ts
CHANGED
|
@@ -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;
|
package/dist/core/wire-expr.js
CHANGED
|
@@ -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/merge-cli.js
CHANGED
|
@@ -43,19 +43,20 @@
|
|
|
43
43
|
* `flow-merge: remove <dir>` line each (and `removed` in `--json`), because
|
|
44
44
|
* copying the candidate over the project cannot delete a file: delete those
|
|
45
45
|
* directories from the project. When the original sits in a Flow project
|
|
46
|
-
* (`project.uiproj`), the project's `bindings_v2.json` is re-derived
|
|
47
|
-
*
|
|
46
|
+
* (`project.uiproj`), the project's `bindings_v2.json` is re-derived from the
|
|
47
|
+
* merged flow and its agents, as compile does, and written beside the merged
|
|
48
|
+
* output when it changes.
|
|
48
49
|
*/
|
|
49
50
|
import { reportResult } from './cli-result.js';
|
|
50
51
|
import { writeJsonFile } from './core/json-file.js';
|
|
51
52
|
import { existsSync, mkdirSync, readdirSync, readFileSync } from 'node:fs';
|
|
52
|
-
import { refreshInlineAgentRows } from './bindings-v2.js';
|
|
53
|
+
import { inlineAgentResources, mergeBindingsV2, projectBindingRows, refreshInlineAgentRows } from './bindings-v2.js';
|
|
53
54
|
import { readBindingsV2, readInlineAgentFiles } from './bindings-v2-files.js';
|
|
54
|
-
import { basename, dirname, join, resolve } from 'node:path';
|
|
55
|
+
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
55
56
|
import { MergeRefusedError, mergeFlowWithSidecars } from './merge.js';
|
|
56
57
|
import { sidecarSetFromList } from './merge-sidecars.js';
|
|
57
58
|
import { isWithin } from './path-within.js';
|
|
58
|
-
import { resourceSourcesOfOtherFlows } from './project-resource-users.js';
|
|
59
|
+
import { flowSources, projectMainFlow, resourceSourcesOfOtherFlows } from './project-resource-users.js';
|
|
59
60
|
import { flagValue, flagValues, runWhenInvokedDirectly } from './cli-run.js';
|
|
60
61
|
import { ensureTypeScriptRuntime } from './node-runtime.js';
|
|
61
62
|
import { flowCheckOpts, openCliLibrary } from './cli-library.js';
|
|
@@ -99,34 +100,49 @@ export function sidecarsBeside(flowPath) {
|
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
102
|
-
* The project's `bindings_v2.json` after merge
|
|
103
|
-
* when the original is not in a Flow project
|
|
104
|
-
*
|
|
105
|
-
* declares no different row (the rows derived
|
|
106
|
-
* after the change equal those derived from the project as it is, so a changed
|
|
107
|
-
* `resultCount` does not create or rewrite the file).
|
|
103
|
+
* The project's `bindings_v2.json` after the merge, as compile would derive it
|
|
104
|
+
* from the merged flow, or `undefined` when the original is not in a Flow project
|
|
105
|
+
* (`project.uiproj`) or the file already holds those rows.
|
|
108
106
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
107
|
+
* The merged flow's connection and entity rows replace the ones on disk (compile
|
|
108
|
+
* does the same), and each inline agent's rows are re-derived from its directory
|
|
109
|
+
* as it will stand once the candidate is installed: the original's files, with
|
|
110
|
+
* merge's writes over them and its removals taken out.
|
|
112
111
|
*/
|
|
113
|
-
function projectBindings(projectDir, writes, removals) {
|
|
112
|
+
function projectBindings(projectDir, originalPath, mergedFlow, writes, removals) {
|
|
114
113
|
if (!existsSync(join(projectDir, 'project.uiproj')))
|
|
115
114
|
return undefined;
|
|
115
|
+
const self = resolve(originalPath);
|
|
116
|
+
const main = projectMainFlow(projectDir);
|
|
117
|
+
const mainElsewhere = main.file !== undefined && resolve(main.file) !== self;
|
|
116
118
|
const isResource = (path) => /\/resources\/[^/]+\/resource\.json$/.test(path);
|
|
117
119
|
const agentOf = (path) => path.split('/')[0];
|
|
118
120
|
const changedAgents = new Set([
|
|
119
121
|
...writes.filter((w) => isResource(w.path)).map((w) => agentOf(w.path)),
|
|
120
122
|
...removals.map(agentOf),
|
|
121
123
|
]);
|
|
122
|
-
|
|
124
|
+
const flowAt = (path) => ({
|
|
125
|
+
file: relative(projectDir, path),
|
|
126
|
+
flow: resolve(path) === self ? mergedFlow : readJsonOrUndefined(path),
|
|
127
|
+
});
|
|
128
|
+
const rowFlows = main.file !== undefined ? [flowAt(main.file)]
|
|
129
|
+
: main.ambiguous.length > 0 ? main.ambiguous.map(flowAt) : [{ file: basename(self), flow: mergedFlow }];
|
|
130
|
+
if (mainElsewhere && changedAgents.size === 0)
|
|
123
131
|
return undefined;
|
|
132
|
+
const sources = new Set([
|
|
133
|
+
...changedAgents,
|
|
134
|
+
...rowFlows.flatMap((f) => flowSources(f.flow)).filter((src) => isWithin(projectDir, resolve(projectDir, src)) && existsSync(join(projectDir, src, 'agent.json'))),
|
|
135
|
+
]);
|
|
124
136
|
const removedBodies = [];
|
|
125
137
|
const agents = [];
|
|
126
|
-
const agentsBefore = [];
|
|
127
138
|
const asResources = (files) => [...files.values()].filter((r) => !!r && typeof r === 'object' && '$resourceType' in r);
|
|
128
|
-
for (const source of
|
|
139
|
+
for (const source of sources) {
|
|
129
140
|
const onDisk = readInlineAgentFiles(join(projectDir, source));
|
|
141
|
+
if (!changedAgents.has(source)) {
|
|
142
|
+
if (onDisk)
|
|
143
|
+
agents.push(onDisk);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
130
146
|
const files = new Map();
|
|
131
147
|
const resourcesDir = join(projectDir, source, 'resources');
|
|
132
148
|
if (existsSync(resourcesDir)) {
|
|
@@ -139,7 +155,6 @@ function projectBindings(projectDir, writes, removals) {
|
|
|
139
155
|
}
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
|
-
agentsBefore.push({ agent: onDisk?.agent ?? {}, resources: asResources(files), features: onDisk?.features ?? [] });
|
|
143
158
|
for (const dir of removals.filter((r) => agentOf(r) === source)) {
|
|
144
159
|
const path = `${dir}/resource.json`;
|
|
145
160
|
if (files.has(path))
|
|
@@ -156,13 +171,30 @@ function projectBindings(projectDir, writes, removals) {
|
|
|
156
171
|
agents.push({ agent, resources: asResources(files), features: onDisk?.features ?? [] });
|
|
157
172
|
}
|
|
158
173
|
const existing = readBindingsV2(join(projectDir, 'bindings_v2.json'));
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
const current = existing?.resources ?? [];
|
|
175
|
+
const derived = mainElsewhere ? undefined : projectBindingRows(rowFlows);
|
|
176
|
+
const declares = (derived?.connections.length ?? 0) > 0 || (derived?.entities.length ?? 0) > 0
|
|
177
|
+
|| agents.some((a) => inlineAgentResources(a).length > 0);
|
|
178
|
+
if (existing === undefined && !declares)
|
|
179
|
+
return undefined;
|
|
180
|
+
const base = derived
|
|
181
|
+
? mergeBindingsV2(existing, derived.connections, derived.entities, { keepUnderived: derived.unreadable.length > 0 }).resources
|
|
182
|
+
: current;
|
|
183
|
+
const after = refreshInlineAgentRows(base, agents, removedBodies);
|
|
184
|
+
const settled = (rows) => JSON.stringify(rows.map((r) => JSON.stringify(r)).sort());
|
|
185
|
+
if (settled(after) === settled(current))
|
|
163
186
|
return undefined;
|
|
164
187
|
return { version: '2.0', ...existing, resources: after };
|
|
165
188
|
}
|
|
189
|
+
/** A JSON file's contents, or `undefined` when it is missing or unreadable. */
|
|
190
|
+
function readJsonOrUndefined(path) {
|
|
191
|
+
try {
|
|
192
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
166
198
|
export async function run(argv) {
|
|
167
199
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
168
200
|
console.error(USAGE);
|
|
@@ -358,10 +390,10 @@ export async function run(argv) {
|
|
|
358
390
|
for (const dir of removed) {
|
|
359
391
|
console.log(`flow-merge: remove ${dir} from the project: the edit removed this agent resource, and copying the candidate cannot delete it`);
|
|
360
392
|
}
|
|
361
|
-
const bindingsV2 = projectBindings(originalDir, merged.sidecars, removals);
|
|
393
|
+
const bindingsV2 = projectBindings(originalDir, originalPath, flow, merged.sidecars, removals);
|
|
362
394
|
if (bindingsV2 !== undefined) {
|
|
363
395
|
writeJsonFile(join(outDir, 'bindings_v2.json'), bindingsV2);
|
|
364
|
-
console.log('flow-merge: wrote bindings_v2.json (
|
|
396
|
+
console.log('flow-merge: wrote bindings_v2.json (connection and agent resource rows, re-derived as compile does)');
|
|
365
397
|
}
|
|
366
398
|
reportResult({
|
|
367
399
|
path: resolve(out),
|
package/dist/merge-compile.js
CHANGED
|
@@ -18,6 +18,7 @@ import { loadBuiltFlow } from './load.js';
|
|
|
18
18
|
import { serialize } from './serialize.js';
|
|
19
19
|
import { CompileRefusal } from './core/compile-refusal.js';
|
|
20
20
|
import { PACKAGE_NAME } from './package-name.js';
|
|
21
|
+
import { Bindings } from './bindings.js';
|
|
21
22
|
import { check } from './check.js';
|
|
22
23
|
import { placeDiagnostics } from './edit-scope.js';
|
|
23
24
|
/**
|
|
@@ -54,7 +55,11 @@ export async function compileSourceDraftTolerant(file, opts = {}) {
|
|
|
54
55
|
* The source goes to a temporary directory that is removed afterwards.
|
|
55
56
|
*/
|
|
56
57
|
export async function baselineFromOriginal(originalPath, opts = {}, warn) {
|
|
57
|
-
|
|
58
|
+
// The baseline reproduces the original, so a connection label it carries stays
|
|
59
|
+
// as written: resolving it through the project's bindings.json would make a
|
|
60
|
+
// label-to-id edit identical to the baseline and merge would drop it.
|
|
61
|
+
const asSaved = { ...opts, bindings: new Bindings() };
|
|
62
|
+
return withDecompiledOriginal(originalPath, (built) => ({ ...compileDraftTolerant(built, asSaved), built }), warn);
|
|
58
63
|
}
|
|
59
64
|
/**
|
|
60
65
|
* Decompile the `.flow` at `originalPath` (reading agent sidecars beside it, as
|
package/dist/merge.js
CHANGED
|
@@ -484,6 +484,7 @@ function mergeFlowFindings(original, edited, options) {
|
|
|
484
484
|
result.bindings = mergeBindings(original.bindings, edited.bindings);
|
|
485
485
|
result.bindings = withoutRowsMintedForKeptNodes(result.bindings, original, edited, options.baseline, keptFromOriginal, fieldwise);
|
|
486
486
|
result.bindings = withoutSupersededAppRows(result.bindings, originalNodes, allNodes);
|
|
487
|
+
result.bindings = withoutStaleConnectionRows(result.bindings, originalNodes, allNodes);
|
|
487
488
|
// metadata / solutionId / projectId / layout / runtime were carried by the
|
|
488
489
|
// initial clone of `original` and are intentionally left untouched, apart
|
|
489
490
|
// from the `layout.nodes` entries of removed nodes (dropped above) and added
|
|
@@ -727,6 +728,25 @@ function withoutSupersededAppRows(rows, originalNodes, mergedNodes) {
|
|
|
727
728
|
return rows.filter((b) => !(b.resource === 'app' && typeof b.resourceKey === 'string'
|
|
728
729
|
&& before.has(b.resourceKey) && !after.has(b.resourceKey)));
|
|
729
730
|
}
|
|
731
|
+
/**
|
|
732
|
+
* Drop the original's `connection` rows that an original node spelled and no
|
|
733
|
+
* merged node spells any more. An edit that swaps a connection (a label for its
|
|
734
|
+
* id, one id for another) brings the new rows, and the union would keep the old
|
|
735
|
+
* pair beside them, declared but unused. A row no original node spelled is not
|
|
736
|
+
* touched.
|
|
737
|
+
*/
|
|
738
|
+
function withoutStaleConnectionRows(rows, originalNodes, mergedNodes) {
|
|
739
|
+
if (!rows)
|
|
740
|
+
return rows;
|
|
741
|
+
const before = JSON.stringify(originalNodes);
|
|
742
|
+
const after = JSON.stringify(mergedNodes);
|
|
743
|
+
return rows.filter((b) => {
|
|
744
|
+
if (b.resource !== 'connection' || typeof b.resourceKey !== 'string' || b.resourceKey === '')
|
|
745
|
+
return true;
|
|
746
|
+
const spelled = JSON.stringify(b.resourceKey);
|
|
747
|
+
return !(before.includes(spelled) && !after.includes(spelled));
|
|
748
|
+
});
|
|
749
|
+
}
|
|
730
750
|
/**
|
|
731
751
|
* Drop each added row that the no-edit recompile minted only for nodes the merge
|
|
732
752
|
* kept from the original (#1133). A row qualifies when the original lacks it, the
|
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
|
|
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 (
|
|
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
|
|
81
|
-
+ `value it cannot parse
|
|
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
|
-
...(
|
|
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
|
-
*
|
|
94
|
-
* duration** — `'PT30S'` is "
|
|
95
|
-
* `'
|
|
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
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
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
|
-
*
|
|
104
|
-
*
|
|
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
|
|
116
|
+
* @enforcedBy HTTP_TIMEOUT_NOT_DURATION Must be a literal ISO-8601 duration, not an expression.
|
|
108
117
|
*/
|
|
109
118
|
timeout?: string;
|
|
110
119
|
/**
|
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.3",
|
|
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": "ca9243687f789cf274900bda7e6b7de6bc39ae79"
|
|
116
116
|
}
|