@uipath/maestro-builder-sdk 6.121.0 → 6.121.1
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,4 @@
|
|
|
1
|
-
import { asArray, asRecord, text } from '../walk.js';
|
|
1
|
+
import { asArray, asRecord, planTasks, text } from '../walk.js';
|
|
2
2
|
import { WRITTEN_BY_COMPILE } from './common.js';
|
|
3
3
|
/** The CLI's exemption: an in-solution resource's key and folderPath are decoupled by design (`../../resource-identity.ts`). */
|
|
4
4
|
const SOLUTION_FOLDER_KEY_PREFIX = 'solution_folder.';
|
|
@@ -113,4 +113,66 @@ const bindingKeyShared = {
|
|
|
113
113
|
return found;
|
|
114
114
|
},
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
/** The CLI's `NAME_BOUND_TASK_TYPES` (`resource-task-binding.ts`): the task types that bind a `name`/`folderPath` pair. */
|
|
117
|
+
const NAME_BOUND_TASK_TYPES = new Set([
|
|
118
|
+
'action', 'agent', 'api-workflow', 'business-rule', 'case-management', 'flow-process', 'function', 'process', 'rpa',
|
|
119
|
+
]);
|
|
120
|
+
/** The CLI's `RESOLVED_IDENTITY_KEYS`: a raw id, which is `STRICT_BINDINGS_TASK_UNBOUND`'s (not ported), not this rule's. */
|
|
121
|
+
const RESOLVED_IDENTITY_KEYS = ['resourceId', 'typeId', 'actionAppId', 'actionDefinitionId'];
|
|
122
|
+
/** A Studio Web quick form: an action task whose `data.context` marks it `hitlType: 'quick'` (`../../action-settings.ts`). */
|
|
123
|
+
function isQuickForm(data) {
|
|
124
|
+
return asArray(data.context).some((row) => {
|
|
125
|
+
const r = asRecord(row);
|
|
126
|
+
return r?.name === 'hitlType' && r.value === 'quick';
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const taskBindingAbsent = {
|
|
130
|
+
code: 'STRICT_BINDINGS_TASK_ABSENT',
|
|
131
|
+
class: 'lint',
|
|
132
|
+
why: "The task's resource is the source's (`.action({ app })`, `.process(name)` and the rest); a task that names none is written as authored.",
|
|
133
|
+
level: 'warning',
|
|
134
|
+
cli: 'strict-case-rules.ts:620',
|
|
135
|
+
find(plan) {
|
|
136
|
+
// The CLI runs this only once the root bindings array holds an entry: a
|
|
137
|
+
// plan that binds nothing yet gets one plan-wide warning instead
|
|
138
|
+
// (STRICT_BINDINGS_ABSENT, not ported).
|
|
139
|
+
if (!asArray(plan.bindings).some((b) => asRecord(b) !== undefined))
|
|
140
|
+
return [];
|
|
141
|
+
const found = [];
|
|
142
|
+
for (const t of planTasks(plan)) {
|
|
143
|
+
const type = t.task.type;
|
|
144
|
+
const data = t.data;
|
|
145
|
+
if (typeof type !== 'string' || !NAME_BOUND_TASK_TYPES.has(type) || data === undefined)
|
|
146
|
+
continue;
|
|
147
|
+
if (RESOLVED_IDENTITY_KEYS.some((key) => data[key] !== undefined))
|
|
148
|
+
continue;
|
|
149
|
+
if (['name', 'folderPath'].some((field) => typeof data[field] === 'string' && data[field] !== ''))
|
|
150
|
+
continue;
|
|
151
|
+
// `data: {}` is an unresolved skeleton (`t.unresolved(kind)`), not a task that forgot its resource.
|
|
152
|
+
if (Object.keys(data).length === 0)
|
|
153
|
+
continue;
|
|
154
|
+
// Not in the CLI, on purpose: a quick form is the human task with an
|
|
155
|
+
// inline form and no Action App, and Studio Web saves it with no
|
|
156
|
+
// name/folderPath. The CLI reports it here anyway (a false positive);
|
|
157
|
+
// the SDK does not repeat it.
|
|
158
|
+
if (type === 'action' && isQuickForm(data))
|
|
159
|
+
continue;
|
|
160
|
+
const stageLabel = typeof asRecord(t.stage.data)?.label === 'string' ? String(asRecord(t.stage.data)?.label) : '';
|
|
161
|
+
const taskName = typeof t.task.displayName === 'string' ? t.task.displayName : type;
|
|
162
|
+
found.push({
|
|
163
|
+
path: `nodes[${stageLabel}].data.tasks[${taskName}].data`,
|
|
164
|
+
message: `Task "${taskName}" (${type}) names no resource at all: no \`name\`, no \`folderPath\` and no resolved id, `
|
|
165
|
+
+ 'in a plan that binds its other resources. The task cannot run: nothing tells the platform which '
|
|
166
|
+
+ (type === 'action' ? 'Action App it opens.' : 'resource it starts.'),
|
|
167
|
+
fix: type === 'action'
|
|
168
|
+
? "Name the Action App the task opens: `.action({ ..., app: { name: '<App>', folder: '<Folder>' } })`. "
|
|
169
|
+
+ "If the app is not published yet, write `t.unresolved('action')` instead and fill the task in once it is."
|
|
170
|
+
: `Name the ${type} the task runs and its folder: the first argument of its builder call and \`{ folder }\`.`,
|
|
171
|
+
where: t.taskLabel,
|
|
172
|
+
nodeId: t.taskId,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return found;
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
export const BINDING_RULES = [bindingKeyMismatch, bindingKeyShared, taskBindingAbsent];
|
package/dist/core/refusals.d.ts
CHANGED
|
@@ -216,6 +216,7 @@ export declare const REFUSALS: {
|
|
|
216
216
|
readonly STRICT_JS_EXPRESSION_INVALID: "lint";
|
|
217
217
|
readonly STRICT_RECIPIENT_EXPRESSION_TYPE: "lint";
|
|
218
218
|
readonly STRICT_ACTION_CATALOG_NAMED: "lint";
|
|
219
|
+
readonly STRICT_BINDINGS_TASK_ABSENT: "lint";
|
|
219
220
|
readonly TIMER_TASK_OUTPUTS_IGNORED: "lint";
|
|
220
221
|
readonly TASK_MISSING_ELEMENT_ID: "lint";
|
|
221
222
|
readonly CASE_NO_DEFAULT_EXPORT: "lowering";
|
package/dist/core/refusals.js
CHANGED
|
@@ -287,6 +287,7 @@ export const REFUSALS = {
|
|
|
287
287
|
STRICT_JS_EXPRESSION_INVALID: 'lint',
|
|
288
288
|
STRICT_RECIPIENT_EXPRESSION_TYPE: 'lint',
|
|
289
289
|
STRICT_ACTION_CATALOG_NAMED: 'lint',
|
|
290
|
+
STRICT_BINDINGS_TASK_ABSENT: 'lint',
|
|
290
291
|
TIMER_TASK_OUTPUTS_IGNORED: 'lint',
|
|
291
292
|
TASK_MISSING_ELEMENT_ID: 'lint',
|
|
292
293
|
CASE_NO_DEFAULT_EXPORT: 'lowering',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.121.
|
|
3
|
+
"version": "6.121.1",
|
|
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",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"@types/node": "^22.7.0",
|
|
126
126
|
"esbuild": "^0.28.1"
|
|
127
127
|
},
|
|
128
|
-
"gitref": "
|
|
128
|
+
"gitref": "21e2eeafbe84a29c52703bb50aa5a06a642209cf"
|
|
129
129
|
}
|