@uipath/maestro-builder-sdk 6.104.1 → 6.105.0
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/check.js +3 -2
- package/dist/core/refusals.d.ts +1 -0
- package/dist/core/refusals.js +1 -0
- package/dist/flow-node-type.d.ts +2 -0
- package/dist/nodes/data-fabric/flow/check.d.ts +14 -0
- package/dist/nodes/data-fabric/flow/check.js +65 -0
- package/dist/nodes/data-fabric/flow/family.js +5 -2
- package/package.json +2 -2
package/dist/check.js
CHANGED
|
@@ -798,7 +798,7 @@ function checkFlow(built, ancestors, opts = {}) {
|
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
reportUnreachableHitlOutcomes(hitlChoiceNoPorts, exprs, diags);
|
|
801
|
-
checkRegisteredFamilies(registeredSteps, unresolvedSteps, stepNames, diags);
|
|
801
|
+
checkRegisteredFamilies(registeredSteps, unresolvedSteps, stepNames, diags, opts);
|
|
802
802
|
checkPackageNodes(registeredSteps, diags);
|
|
803
803
|
// Entry points: valid triggers. An id that collides with a step, the trigger
|
|
804
804
|
// or another entry point (or is `start` while `.triggerId()` renames the
|
|
@@ -2547,7 +2547,7 @@ function checkPackageNodes(steps, diags) {
|
|
|
2547
2547
|
});
|
|
2548
2548
|
}
|
|
2549
2549
|
/** Run each registered family's own rules over all of its placements in this flow. */
|
|
2550
|
-
function checkRegisteredFamilies(steps, unresolved, stepNames, diags) {
|
|
2550
|
+
function checkRegisteredFamilies(steps, unresolved, stepNames, diags, opts) {
|
|
2551
2551
|
const byFamily = new Map();
|
|
2552
2552
|
for (const placed of steps.values()) {
|
|
2553
2553
|
const list = byFamily.get(placed.entry.family.id) ?? [];
|
|
@@ -2563,6 +2563,7 @@ function checkRegisteredFamilies(steps, unresolved, stepNames, diags) {
|
|
|
2563
2563
|
hasStep: (step) => stepNames.has(step),
|
|
2564
2564
|
placementOf: (step) => steps.get(step)?.placement,
|
|
2565
2565
|
versionUnresolved: (step) => unresolved.has(step),
|
|
2566
|
+
options: opts,
|
|
2566
2567
|
};
|
|
2567
2568
|
family.check(placed.map((p) => p.placement), ctx);
|
|
2568
2569
|
}
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -269,6 +269,7 @@ export declare const REFUSALS: {
|
|
|
269
269
|
readonly DATAFABRIC_FROMREAD_UNKNOWN: "lint";
|
|
270
270
|
readonly DATAFABRIC_IN_REQUIRES_MULTIPLE: "lint";
|
|
271
271
|
readonly DATAFABRIC_LIMIT_RANGE: "lint";
|
|
272
|
+
readonly DATAFABRIC_LONG_TEXT_PREVIEW: "lint";
|
|
272
273
|
readonly DATAFABRIC_NO_ENTITY: "lint";
|
|
273
274
|
readonly DATAFABRIC_NULL_REQUIRED: "lint";
|
|
274
275
|
readonly DATAFABRIC_QUERY_OPTS_WITHOUT_MULTIPLE: "lint";
|
package/dist/core/refusals.js
CHANGED
|
@@ -343,6 +343,7 @@ export const REFUSALS = {
|
|
|
343
343
|
DATAFABRIC_FROMREAD_UNKNOWN: 'lint',
|
|
344
344
|
DATAFABRIC_IN_REQUIRES_MULTIPLE: 'lint',
|
|
345
345
|
DATAFABRIC_LIMIT_RANGE: 'lint',
|
|
346
|
+
DATAFABRIC_LONG_TEXT_PREVIEW: 'lint',
|
|
346
347
|
DATAFABRIC_NO_ENTITY: 'lint',
|
|
347
348
|
DATAFABRIC_NULL_REQUIRED: 'lint',
|
|
348
349
|
DATAFABRIC_QUERY_OPTS_WITHOUT_MULTIPLE: 'lint',
|
package/dist/flow-node-type.d.ts
CHANGED
|
@@ -517,6 +517,8 @@ export interface FlowFamilyCheckContext {
|
|
|
517
517
|
* reports it, so a rule about it should stay silent rather than say it is missing.
|
|
518
518
|
*/
|
|
519
519
|
versionUnresolved(step: string): boolean;
|
|
520
|
+
/** The options `check` was called with (the resource ledger among them). */
|
|
521
|
+
readonly options: CheckOpts;
|
|
520
522
|
}
|
|
521
523
|
export interface FlowContexts extends ArtifactContexts {
|
|
522
524
|
serialize: FlowSerializeContext;
|
|
@@ -11,3 +11,17 @@ export declare function checkWrite(inputs: DataFabricDeleteInputs, ctx: FlowChec
|
|
|
11
11
|
* selector, so they share the check: the step must be a read, and not a list.
|
|
12
12
|
*/
|
|
13
13
|
export declare function checkFromRead(placements: readonly Placement[], ctx: FlowFamilyCheckContext): void;
|
|
14
|
+
/**
|
|
15
|
+
* DATAFABRIC_LONG_TEXT_PREVIEW: a write whose value is a long-text column read
|
|
16
|
+
* from a native Data Fabric step.
|
|
17
|
+
*
|
|
18
|
+
* Every native path that publishes a record — a read (one or many, `Id` filter
|
|
19
|
+
* included) and a create's own output — is a Data Service QUERY, and a query
|
|
20
|
+
* returns a long-text value as its first 10,000 characters plus
|
|
21
|
+
* `...[Truncated]`, with no flag (#954: 15,551 characters written, 10,014 read
|
|
22
|
+
* back). Writing that value into a create or an update stores the cut text over
|
|
23
|
+
* the whole one, and the run passes. Only the column's type says it can happen,
|
|
24
|
+
* so the rule needs the schema `prepare --entity` records for the SOURCE step's
|
|
25
|
+
* entity (#1980). A warning: a value that is in fact short is written whole.
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkLongTextWriteback(placements: readonly Placement[], ctx: FlowFamilyCheckContext): void;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { entityPrepareCommand, } from '../../../core/resource-resolution.js';
|
|
8
8
|
import { Expr } from '../../../core/expr.js';
|
|
9
9
|
import { nearestName } from '../../../core/edit-distance.js';
|
|
10
|
+
import { prepareCommand } from '../../../core/cli-spelling.js';
|
|
10
11
|
import { entityField, recordedEntitySchema, } from '../../../core/entity-schema.js';
|
|
11
12
|
export const DATA_FABRIC_DIAGNOSTICS = {
|
|
12
13
|
DATAFABRIC_NO_ENTITY: { severity: 'error', summary: 'a verb names no entity' },
|
|
@@ -28,6 +29,7 @@ export const DATA_FABRIC_DIAGNOSTICS = {
|
|
|
28
29
|
DATAFABRIC_CHOICE_WRITE_VALUE: { severity: 'warning', summary: "a choice-set write literal that is not one of the set's numberIds" },
|
|
29
30
|
DATAFABRIC_NULL_REQUIRED: { severity: 'error', summary: 'an update that blanks a non-nullable column' },
|
|
30
31
|
DATAFABRIC_REQUIRED_MISSING: { severity: 'error', summary: 'a create that leaves a mandatory column out' },
|
|
32
|
+
DATAFABRIC_LONG_TEXT_PREVIEW: { severity: 'warning', summary: 'a long-text value read from a Data Fabric step written back' },
|
|
31
33
|
};
|
|
32
34
|
function checkEntity(inputs, ctx) {
|
|
33
35
|
// An object is `{ name, folder }`, whose shape the serializer judges
|
|
@@ -385,3 +387,66 @@ function checkValue(field, value, where, operator, schema, ctx) {
|
|
|
385
387
|
: 'Data Fabric rejects the value and the engine only logs the rejection, so the write runs green without it.')
|
|
386
388
|
+ provenance(schema), `a literal like ${shape.example}, or an expression that produces one`);
|
|
387
389
|
}
|
|
390
|
+
// ─── Long text written back (#954) ─────────────────────────────────────────────
|
|
391
|
+
/** The length a Data Service query cuts a long-text value to, before it appends `...[Truncated]`. */
|
|
392
|
+
const PREVIEW_LENGTH = 10_000;
|
|
393
|
+
/**
|
|
394
|
+
* A long-text column whose value can be longer than the query preview:
|
|
395
|
+
* `MULTILINE_TEXT` above 10,000 characters, or `MULTILINE_MAX`.
|
|
396
|
+
*/
|
|
397
|
+
function previewedColumn(field) {
|
|
398
|
+
return field.type.startsWith('MULTILINE') && (field.lengthLimit === undefined || field.lengthLimit > PREVIEW_LENGTH);
|
|
399
|
+
}
|
|
400
|
+
/** `$vars.<step>.output.<field>`, `.output[0].<field>` and `.output.results[i].<field>`, as `[step, field]`. */
|
|
401
|
+
const OUTPUT_FIELD = /\$vars\.([A-Za-z_$][\w$]*)\.output(?:\.results)?(?:\[[^\]]*\])?\.([A-Za-z_$][\w$]*)/g;
|
|
402
|
+
/**
|
|
403
|
+
* DATAFABRIC_LONG_TEXT_PREVIEW: a write whose value is a long-text column read
|
|
404
|
+
* from a native Data Fabric step.
|
|
405
|
+
*
|
|
406
|
+
* Every native path that publishes a record — a read (one or many, `Id` filter
|
|
407
|
+
* included) and a create's own output — is a Data Service QUERY, and a query
|
|
408
|
+
* returns a long-text value as its first 10,000 characters plus
|
|
409
|
+
* `...[Truncated]`, with no flag (#954: 15,551 characters written, 10,014 read
|
|
410
|
+
* back). Writing that value into a create or an update stores the cut text over
|
|
411
|
+
* the whole one, and the run passes. Only the column's type says it can happen,
|
|
412
|
+
* so the rule needs the schema `prepare --entity` records for the SOURCE step's
|
|
413
|
+
* entity (#1980). A warning: a value that is in fact short is written whole.
|
|
414
|
+
*/
|
|
415
|
+
export function checkLongTextWriteback(placements, ctx) {
|
|
416
|
+
for (const p of placements) {
|
|
417
|
+
if (p.kind !== 'dataFabricUpdate' && p.kind !== 'dataFabricCreate')
|
|
418
|
+
continue;
|
|
419
|
+
const inputs = p.spec.inputs;
|
|
420
|
+
const option = p.kind === 'dataFabricUpdate' ? 'set' : 'values';
|
|
421
|
+
const values = (p.kind === 'dataFabricUpdate' ? inputs?.set : inputs?.values) ?? {};
|
|
422
|
+
for (const [column, value] of Object.entries(values)) {
|
|
423
|
+
if (!(value instanceof Expr))
|
|
424
|
+
continue;
|
|
425
|
+
for (const [, source, name] of value.js.matchAll(OUTPUT_FIELD)) {
|
|
426
|
+
const from = ctx.placementOf(source);
|
|
427
|
+
if (from?.kind !== 'dataFabricRead' && from?.kind !== 'dataFabricCreate')
|
|
428
|
+
continue;
|
|
429
|
+
const fromInputs = from.spec.inputs;
|
|
430
|
+
if (fromInputs?.entity === undefined)
|
|
431
|
+
continue;
|
|
432
|
+
const schema = recordedEntitySchema(ctx.options.resources, {
|
|
433
|
+
entity: fromInputs.entity, ...(fromInputs.folderKey !== undefined ? { folderKey: fromInputs.folderKey } : {}),
|
|
434
|
+
});
|
|
435
|
+
const field = schema && entityField(schema.fields, name);
|
|
436
|
+
if (field === undefined || !previewedColumn(field))
|
|
437
|
+
continue;
|
|
438
|
+
const entity = String(fromInputs.entity.name ?? fromInputs.entity);
|
|
439
|
+
ctx.report(p.step, 'DATAFABRIC_LONG_TEXT_PREVIEW', `"${p.step}" writes { ${option} } ${JSON.stringify(column)} from "${source}"'s ${JSON.stringify(name)}, a long-text `
|
|
440
|
+
+ `(${field.type}${field.lengthLimit !== undefined ? `, up to ${field.lengthLimit} characters` : ''}) column of entity ${JSON.stringify(entity)}. `
|
|
441
|
+
+ `A native Data Fabric ${from.kind === 'dataFabricRead' ? 'read' : 'create'} publishes the record as a query returns it, `
|
|
442
|
+
+ `which cuts a long-text value to its first ${PREVIEW_LENGTH.toLocaleString('en-US')} characters and appends "...[Truncated]", with no flag — `
|
|
443
|
+
+ 'so a longer value is written back cut, and the run passes.', from.kind === 'dataFabricCreate'
|
|
444
|
+
? `write the value "${source}" was given instead of its output`
|
|
445
|
+
// The operation is not in the shipped library and its fields depend
|
|
446
|
+
// on `entityName`, so the connector call needs its prepare first.
|
|
447
|
+
: `read the record whole: run ${prepareCommand('uipath-uipath-dataservice', 'get-entity-record-by-id', '-f', `entityName=${entity}`)}, `
|
|
448
|
+
+ `then connector('uipath-uipath-dataservice', 'get-entity-record-by-id', { entityName: '${entity}', recordId: … }, BIND), and write from that step`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { checkFromRead, DATA_FABRIC_DIAGNOSTICS } from './check.js';
|
|
1
|
+
import { checkFromRead, checkLongTextWriteback, DATA_FABRIC_DIAGNOSTICS } from './check.js';
|
|
2
2
|
import { dataFabricCreate, dataFabricDelete, dataFabricRead, dataFabricUpdate } from './verbs.js';
|
|
3
3
|
export const dataFabricFlowFamily = {
|
|
4
4
|
id: 'data-fabric',
|
|
5
5
|
title: 'Data Fabric',
|
|
6
6
|
types: [dataFabricRead, dataFabricCreate, dataFabricUpdate, dataFabricDelete],
|
|
7
7
|
diagnostics: DATA_FABRIC_DIAGNOSTICS,
|
|
8
|
-
check:
|
|
8
|
+
check: (placements, ctx) => {
|
|
9
|
+
checkFromRead(placements, ctx);
|
|
10
|
+
checkLongTextWriteback(placements, ctx);
|
|
11
|
+
},
|
|
9
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.105.0",
|
|
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",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"@types/node": "^22.7.0",
|
|
122
122
|
"esbuild": "^0.28.1"
|
|
123
123
|
},
|
|
124
|
-
"gitref": "
|
|
124
|
+
"gitref": "73e97cc8d46b9b8679fb8f70f7a38262590f51e0"
|
|
125
125
|
}
|