@uipath/maestro-builder-sdk 6.94.3 → 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/case/decompile.js
CHANGED
|
@@ -1471,14 +1471,20 @@ function carriedResource(task, plan) {
|
|
|
1471
1471
|
return ref ? { resource: { kind: String(task.type), ...ref } } : {};
|
|
1472
1472
|
}
|
|
1473
1473
|
/**
|
|
1474
|
-
* The io lists a
|
|
1475
|
-
*
|
|
1474
|
+
* The io lists a task saved empty (`inputs: []`), which compile omits when the
|
|
1475
|
+
* task has no row there; recorded as `emptyIo: ['inputs']`, with the task's
|
|
1476
|
+
* saved `type` as `emptyIoType`. Any task kind: the
|
|
1477
|
+
* Designer saves `inputs: []` on an action form with no field and on a timer
|
|
1478
|
+
* as well as on a resource task.
|
|
1476
1479
|
*/
|
|
1477
1480
|
function emptyIoLists(task) {
|
|
1478
|
-
|
|
1481
|
+
// A connector placeholder compiles to `data: {}` on purpose (#1354), its empty lists included.
|
|
1482
|
+
if (connectorPlaceholderKindOf(task.type, task.data))
|
|
1479
1483
|
return {};
|
|
1480
1484
|
const empty = ['inputs', 'outputs'].filter((side) => Array.isArray(task.data?.[side]) && task.data[side].length === 0);
|
|
1481
|
-
|
|
1485
|
+
// The kind it was saved on: an edit that makes the task another kind (a
|
|
1486
|
+
// connector placeholder, say) gets compile's lists, not this one's.
|
|
1487
|
+
return empty.length ? { emptyIo: [...empty], ...(typeof task.type === 'string' ? { emptyIoType: task.type } : {}) } : {};
|
|
1482
1488
|
}
|
|
1483
1489
|
function ioArg(rows, kind, task, varKeyById) {
|
|
1484
1490
|
const valueField = kind === 'inputs' ? 'value' : 'source';
|
package/dist/case/preserve.d.ts
CHANGED
|
@@ -222,8 +222,10 @@ interface StageIdentity {
|
|
|
222
222
|
/** `var` and `custom: true`: a custom row whose label (`name`) is not the name of the variable it assigns. */
|
|
223
223
|
/** `noAlias: true`: an own-name row saved with no `originalVar` beside a root variable of its id, which compile writes as the alias `originalVar: <id>`. */
|
|
224
224
|
outputs?: PreservedOutputRow[];
|
|
225
|
-
/** The io lists a
|
|
225
|
+
/** The io lists a task saved empty (`inputs: []`), which compile writes only when it has a row there. */
|
|
226
226
|
emptyIo?: Array<'inputs' | 'outputs'>;
|
|
227
|
+
/** The task `type` `emptyIo` was saved on: compile restores the lists only while the task is still that kind. */
|
|
228
|
+
emptyIoType?: string;
|
|
227
229
|
/** `taskFingerprint`, for a task a sibling shares its row names with. */
|
|
228
230
|
fingerprint?: string;
|
|
229
231
|
/** Fields of `TASK_EMPTY_LISTS` the read task spelled `[]`. */
|
package/dist/case/serialize.js
CHANGED
|
@@ -45,7 +45,7 @@ import { taskShapeProblems } from './task-shape.js';
|
|
|
45
45
|
import { SCRIPT_INPUTS, scriptOutputMappings, scriptOutputs, storedScript } from './script.js';
|
|
46
46
|
import { DOCUMENT_EXTRACTION_NAME, DOCUMENT_EXTRACTION_RESOURCE, DOCUMENT_EXTRACTION_SERVICE_TYPE, DOCUMENT_EXTRACTION_VERSION, documentExtractionContext, documentExtractionInputs, documentExtractionOutputMappings, documentExtractionOutputs, documentExtractionRefusal, } from './document-extraction.js';
|
|
47
47
|
import { HTTP_REQUEST_CONNECTION_NAME, HTTP_REQUEST_IMPLICIT_BINDING_ID, HTTP_REQUEST_IMPLICIT_CONNECTION, HTTP_REQUEST_SERVICE_TYPE, httpRequestBody, httpRequestContext, httpRequestInputs, httpRequestOutputMappings, httpRequestOutputs, httpRequestRefusal, writeHttpRequestMetadata, } from './http-request.js';
|
|
48
|
-
import { connectorPlaceholderData, isConnectorPlaceholder } from './connector-placeholder.js';
|
|
48
|
+
import { connectorPlaceholderData, connectorPlaceholderKindOf, isConnectorPlaceholder } from './connector-placeholder.js';
|
|
49
49
|
import { lowerTaskOutputRefs, planTaskOutputs, resolveInPlan, unresolvedTaskOutputRef } from './task-output-ref.js';
|
|
50
50
|
/** The ids a serialize pass hashed from element ids, by the document it returned. */
|
|
51
51
|
const ELEMENT_SEEDED_IDS = new WeakMap();
|
|
@@ -1695,9 +1695,14 @@ function applyPreservedIdentities(result, preservation, warn) {
|
|
|
1695
1695
|
const isAction = task?.type === 'action';
|
|
1696
1696
|
takeOutputRows(task?.data?.outputs ?? [], (taskIdentity.outputs ?? [])
|
|
1697
1697
|
.map((row) => ({ ...row, ...(!isAction && !resourceKept ? { fields: undefined, omit: undefined } : {}) })), isAction);
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1698
|
+
// Only on the kind the lists were saved on (`emptyIoType`; a payload from
|
|
1699
|
+
// before it was recorded was written for resource tasks only), and never
|
|
1700
|
+
// on a connector placeholder, whose `data: {}` is its contract (#1354).
|
|
1701
|
+
const sameKind = taskIdentity.emptyIoType === undefined || taskIdentity.emptyIoType === task?.type;
|
|
1702
|
+
if (sameKind && task?.data && !connectorPlaceholderKindOf(task.type, task.data))
|
|
1703
|
+
for (const side of taskIdentity.emptyIo ?? [])
|
|
1704
|
+
if ((side === 'inputs' || side === 'outputs') && task.data[side] === undefined)
|
|
1705
|
+
task.data[side] = [];
|
|
1701
1706
|
}));
|
|
1702
1707
|
}
|
|
1703
1708
|
const metadata = result.metadata;
|
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
|
}
|