@uipath/maestro-builder-sdk 6.94.4 → 6.94.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.
package/dist/core/refusals.d.ts
CHANGED
|
@@ -442,6 +442,7 @@ export declare const REFUSALS: {
|
|
|
442
442
|
readonly HTTP_BRANCH_CONST: "lint";
|
|
443
443
|
readonly HTTP_BRANCH_DUP: "lint";
|
|
444
444
|
readonly HTTP_BRANCH_NAME: "lint";
|
|
445
|
+
readonly HTTP_BRANCH_NONOK_CODE: "lint";
|
|
445
446
|
readonly HTTP_BRANCH_UNKNOWN: "lint";
|
|
446
447
|
readonly HTTP_MANAGED_BINDING_INCOMPLETE: "lowering";
|
|
447
448
|
readonly HTTP_MANAGED_REQUIRED: "lowering";
|
package/dist/core/refusals.js
CHANGED
|
@@ -516,6 +516,7 @@ export const REFUSALS = {
|
|
|
516
516
|
HTTP_BRANCH_CONST: 'lint',
|
|
517
517
|
HTTP_BRANCH_DUP: 'lint',
|
|
518
518
|
HTTP_BRANCH_NAME: 'lint',
|
|
519
|
+
HTTP_BRANCH_NONOK_CODE: 'lint',
|
|
519
520
|
HTTP_BRANCH_UNKNOWN: 'lint',
|
|
520
521
|
HTTP_MANAGED_BINDING_INCOMPLETE: 'lowering',
|
|
521
522
|
HTTP_MANAGED_REQUIRED: 'lowering',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { nearestName } from '../../../core/edit-distance.js';
|
|
2
|
+
import { escapeRegExp } from '../../../core/escape-regexp.js';
|
|
2
3
|
export const HTTP_DIAGNOSTICS = {
|
|
3
4
|
HTTP_V1_RETIRED: { severity: 'warning', summary: 'the plain node is retired on the tenant registry' },
|
|
4
5
|
HTTP_BINDING_REQUIRES_MANAGED: { severity: 'error', summary: 'connection settings on the standalone node' },
|
|
@@ -11,6 +12,7 @@ export const HTTP_DIAGNOSTICS = {
|
|
|
11
12
|
HTTP_BRANCH_NAME: { severity: 'error', summary: 'a branch name that is not port-safe' },
|
|
12
13
|
HTTP_BRANCH_DUP: { severity: 'error', summary: 'a branch declared twice' },
|
|
13
14
|
HTTP_BRANCH_CONST: { severity: 'error', summary: 'a branch condition that is a constant' },
|
|
15
|
+
HTTP_BRANCH_NONOK_CODE: { severity: 'warning', summary: 'a managed branch that compares output.code with a non-2xx literal' },
|
|
14
16
|
HTTP_READ_NOT_OUTPUT: { severity: 'error', summary: 'a read of the step outside `output`' },
|
|
15
17
|
HTTP_READ_UNKNOWN_FIELD: { severity: 'error', summary: 'a read outside the response envelope or the declared body' },
|
|
16
18
|
HTTP_READ_WITHOUT_RETURNS: { severity: 'error', summary: 'a body field read with no `returns`' },
|
|
@@ -93,6 +95,12 @@ export function checkHttp(inputs, ctx) {
|
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
}
|
|
98
|
+
const FIRST_FAILING_CODE = 400;
|
|
99
|
+
/** `<step>.output.code` against a numeric literal with `==`, `===`, `>=` or `>`. */
|
|
100
|
+
function comparesFailingCode(js, step) {
|
|
101
|
+
const read = new RegExp(`\\$vars\\.${escapeRegExp(step)}\\.output\\.code\\s*(?:===?|>=|>)\\s*(\\d+)(?![\\d.])`, 'g');
|
|
102
|
+
return [...js.matchAll(read)].some((m) => Number(m[1]) >= FIRST_FAILING_CODE);
|
|
103
|
+
}
|
|
96
104
|
/**
|
|
97
105
|
* Every node-local rule of an `http()` step, in the order check.ts ran them: the
|
|
98
106
|
* request settings, a managed step's binding labels, then the response branches.
|
|
@@ -113,6 +121,11 @@ export function checkHttpStep(inputs, ctx) {
|
|
|
113
121
|
seen.add(b.name);
|
|
114
122
|
if (b.condition.literal) {
|
|
115
123
|
ctx.report('HTTP_BRANCH_CONST', `HTTP branch ${JSON.stringify(b.name)} on "${step}" tests a constant — it would fire always or never. Reference the response, e.g. $vars.${step}.output.${inputs?.managed ? 'code' : 'statusCode'}.`);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (inputs?.managed && comparesFailingCode(b.condition.js, step)) {
|
|
127
|
+
ctx.report('HTTP_BRANCH_NONOK_CODE', `HTTP branch ${JSON.stringify(b.name)} on "${step}" compares output.code with a non-2xx literal, but a managed non-2xx fails the step `
|
|
128
|
+
+ `before branches are evaluated, so the branch never fires. Route it with .onError() + err('${step}', 'status').`);
|
|
116
129
|
}
|
|
117
130
|
}
|
|
118
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.94.
|
|
3
|
+
"version": "6.94.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",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"@types/node": "^22.7.0",
|
|
112
112
|
"esbuild": "^0.28.1"
|
|
113
113
|
},
|
|
114
|
-
"gitref": "
|
|
114
|
+
"gitref": "cd181b53225fc8818b6867e28ea609b46e8cfdfc"
|
|
115
115
|
}
|