@uipath/api-workflow-tool 1.203.0-preview.205 → 1.204.0-preview.206
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/executor-tool.js +4 -2
- package/dist/index-zp7vrgty.js +72 -0
- package/dist/index.js +7 -5
- package/dist/node-mw4mcxv5.js +246 -0
- package/dist/packager-tool-1n0det9t.js +514 -0
- package/dist/{packager-tool-pnbbzgz1.js → packager-tool-3m7z169b.js} +231 -54
- package/dist/packager-tool-4mxzf9gt.js +4627 -0
- package/dist/packager-tool-69mfq5g8.js +1501 -0
- package/dist/{packager-tool-6se0wnbx.js → packager-tool-fm7ese0m.js} +475 -470
- package/dist/{packager-tool-myc90a0t.js → packager-tool-m4jcr834.js} +2909 -8561
- package/dist/packager-tool-z58p51e2.js +4809 -0
- package/dist/packager-tool.js +2 -2
- package/dist/tool.js +7 -5
- package/package.json +2 -2
- package/dist/index-pzjggvac.js +0 -15474
- package/dist/node-pqds858z.js +0 -16492
- package/dist/packager-tool-k9wheprx.js +0 -1378
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerPackagerFactories
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-1n0det9t.js";
|
|
4
|
+
import {
|
|
5
|
+
WorkflowRunService,
|
|
6
|
+
getAuthContext,
|
|
7
|
+
getLoginStatusAsync
|
|
8
|
+
} from "./packager-tool-m4jcr834.js";
|
|
4
9
|
import {
|
|
5
10
|
FailureOutput,
|
|
6
11
|
OutputFormatter,
|
|
7
12
|
RESULTS,
|
|
8
13
|
SuccessOutput,
|
|
9
|
-
WorkflowRunService,
|
|
10
|
-
addSdkUserAgentHeader,
|
|
11
|
-
catchError,
|
|
12
|
-
getAuthContext,
|
|
13
14
|
getFileSystem,
|
|
14
|
-
getLoginStatusAsync,
|
|
15
|
-
getSdkUserAgentToken,
|
|
16
|
-
installSdkUserAgentHeader,
|
|
17
15
|
logger,
|
|
18
16
|
mapPackageMetadataOptions,
|
|
19
17
|
processContext,
|
|
20
18
|
registerPackageMetadataOptions,
|
|
21
19
|
unsupportedSolutionProjectType
|
|
22
|
-
} from "./packager-tool-
|
|
20
|
+
} from "./packager-tool-z58p51e2.js";
|
|
21
|
+
import {
|
|
22
|
+
addSdkUserAgentHeader,
|
|
23
|
+
catchError,
|
|
24
|
+
getSdkUserAgentToken,
|
|
25
|
+
installSdkUserAgentHeader
|
|
26
|
+
} from "./packager-tool-69mfq5g8.js";
|
|
23
27
|
import {
|
|
24
28
|
yaml
|
|
25
29
|
} from "./packager-tool-d3w0wn6k.js";
|
|
@@ -7156,7 +7160,7 @@ var package_default = {
|
|
|
7156
7160
|
name: "@uipath/api-workflow-tool",
|
|
7157
7161
|
author: "UiPath",
|
|
7158
7162
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
7159
|
-
version: "1.
|
|
7163
|
+
version: "1.204.0-preview.206",
|
|
7160
7164
|
description: "Run UiPath API Workflows locally.",
|
|
7161
7165
|
private: false,
|
|
7162
7166
|
repository: {
|
|
@@ -7740,7 +7744,7 @@ var package_default2 = {
|
|
|
7740
7744
|
name: "@uipath/integrationservice-sdk",
|
|
7741
7745
|
author: "UiPath",
|
|
7742
7746
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
7743
|
-
version: "1.
|
|
7747
|
+
version: "1.204.0-preview.206",
|
|
7744
7748
|
repository: {
|
|
7745
7749
|
type: "git",
|
|
7746
7750
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -14372,7 +14376,7 @@ Subcommands:
|
|
|
14372
14376
|
// src/commands/packager-shared.ts
|
|
14373
14377
|
async function createPackager() {
|
|
14374
14378
|
registerPackagerFactories();
|
|
14375
|
-
const { createNodeProjectPackager } = await import("./node-
|
|
14379
|
+
const { createNodeProjectPackager } = await import("./node-mw4mcxv5.js");
|
|
14376
14380
|
return await createNodeProjectPackager({
|
|
14377
14381
|
logHandler: logger.handleLog
|
|
14378
14382
|
});
|
|
@@ -14395,7 +14399,7 @@ async function setupProject(packager, projectPath) {
|
|
|
14395
14399
|
return packager.setupAsync(absPath);
|
|
14396
14400
|
}
|
|
14397
14401
|
async function buildBaseOptions() {
|
|
14398
|
-
const { ProjectPackOptions } = await import("./index-
|
|
14402
|
+
const { ProjectPackOptions } = await import("./index-zp7vrgty.js");
|
|
14399
14403
|
const sdkLogLevelMap = {
|
|
14400
14404
|
[0 /* DEBUG */]: "Debug" /* Debug */,
|
|
14401
14405
|
[1 /* INFO */]: "Information" /* Info */,
|
|
@@ -14692,7 +14696,7 @@ var package_default3 = {
|
|
|
14692
14696
|
name: "@uipath/solution-sdk",
|
|
14693
14697
|
author: "UiPath",
|
|
14694
14698
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
14695
|
-
version: "1.
|
|
14699
|
+
version: "1.204.0-preview.206",
|
|
14696
14700
|
repository: {
|
|
14697
14701
|
type: "git",
|
|
14698
14702
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -14743,7 +14747,7 @@ var package_default3 = {
|
|
|
14743
14747
|
"@uipath/common": "workspace:*",
|
|
14744
14748
|
"@uipath/filesystem": "workspace:*",
|
|
14745
14749
|
"@uipath/orchestrator-sdk": "workspace:*",
|
|
14746
|
-
"@uipath/resource-builder-sdk": "2025.11.0-
|
|
14750
|
+
"@uipath/resource-builder-sdk": "2025.11.0-alpha6004-4107",
|
|
14747
14751
|
"@uipath/solutionpackager-tool-core": "workspace:*",
|
|
14748
14752
|
"@uipath/studioweb-sdk": "workspace:*",
|
|
14749
14753
|
"@types/node": "^25.5.2",
|
|
@@ -15298,7 +15302,8 @@ var DEFAULT_EXCLUDED_DIR_NAMES = new Set([
|
|
|
15298
15302
|
"node_modules",
|
|
15299
15303
|
"__pycache__",
|
|
15300
15304
|
".git",
|
|
15301
|
-
".local"
|
|
15305
|
+
".local",
|
|
15306
|
+
".flow-sdk"
|
|
15302
15307
|
]);
|
|
15303
15308
|
// ../solution-sdk/src/project-debug-status.ts
|
|
15304
15309
|
var SUCCEEDED = "creationsucceeded";
|
|
@@ -15702,7 +15707,7 @@ var apiwf_schema_default = {
|
|
|
15702
15707
|
$defs: {
|
|
15703
15708
|
runtimeExpression: {
|
|
15704
15709
|
type: "string",
|
|
15705
|
-
pattern: "^\\s*\\$\\{
|
|
15710
|
+
pattern: "^\\s*\\$\\{[\\s\\S]+\\}\\s*$"
|
|
15706
15711
|
},
|
|
15707
15712
|
document: {
|
|
15708
15713
|
type: "object",
|
|
@@ -16014,18 +16019,48 @@ var apiwf_schema_default = {
|
|
|
16014
16019
|
}
|
|
16015
16020
|
},
|
|
16016
16021
|
task: {
|
|
16017
|
-
oneOf:
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
{ $ref: "#/$defs/
|
|
16021
|
-
{ $ref: "#/$defs/
|
|
16022
|
-
{ $ref: "#/$defs/
|
|
16023
|
-
{ $ref: "#/$defs/
|
|
16024
|
-
{ $ref: "#/$defs/
|
|
16025
|
-
{ $ref: "#/$defs/
|
|
16026
|
-
{ $ref: "#/$defs/
|
|
16027
|
-
{ $ref: "#/$defs/
|
|
16028
|
-
{ $ref: "#/$defs/
|
|
16022
|
+
$comment: "A task is a tagged union: each kind is identified by one required key, so dispatch on that key instead of trying every branch. A bare oneOf made AJV validate a failing task against all eleven branches and, because each branch closes with unevaluatedProperties, re-explore its whole subtree for each one — one bad expression produced 155 errors, and nesting made the cost exponential until the run overflowed the stack. 'do' is tested last and only when 'for' is absent, because forTask permits 'do' as well. Every predicate also tests `type: object`, because `required` is vacuously true for a non-object: without it a task that is null or a string passes all eleven conditions and every branch runs, which is the fan-out this dispatch exists to prevent.",
|
|
16023
|
+
type: "object",
|
|
16024
|
+
allOf: [
|
|
16025
|
+
{ if: { type: "object", required: ["call"] }, then: { $ref: "#/$defs/callTask" } },
|
|
16026
|
+
{ if: { type: "object", required: ["fork"] }, then: { $ref: "#/$defs/forkTask" } },
|
|
16027
|
+
{ if: { type: "object", required: ["for"] }, then: { $ref: "#/$defs/forTask" } },
|
|
16028
|
+
{ if: { type: "object", required: ["run"] }, then: { $ref: "#/$defs/runTask" } },
|
|
16029
|
+
{ if: { type: "object", required: ["set"] }, then: { $ref: "#/$defs/setTask" } },
|
|
16030
|
+
{ if: { type: "object", required: ["switch"] }, then: { $ref: "#/$defs/switchTask" } },
|
|
16031
|
+
{ if: { type: "object", required: ["try"] }, then: { $ref: "#/$defs/tryTask" } },
|
|
16032
|
+
{ if: { type: "object", required: ["wait"] }, then: { $ref: "#/$defs/waitTask" } },
|
|
16033
|
+
{ if: { type: "object", required: ["response"] }, then: { $ref: "#/$defs/responseTask" } },
|
|
16034
|
+
{ if: { type: "object", required: ["break"] }, then: { $ref: "#/$defs/breakTask" } },
|
|
16035
|
+
{
|
|
16036
|
+
if: {
|
|
16037
|
+
type: "object",
|
|
16038
|
+
allOf: [
|
|
16039
|
+
{ required: ["do"] },
|
|
16040
|
+
{ not: { required: ["for"] } }
|
|
16041
|
+
]
|
|
16042
|
+
},
|
|
16043
|
+
then: { $ref: "#/$defs/doTask" }
|
|
16044
|
+
},
|
|
16045
|
+
{
|
|
16046
|
+
$comment: "None of the kind keys present. Phrased as a single 'not' so a task with no kind reports one error naming them all, rather than eleven 'missing required property' lines.",
|
|
16047
|
+
not: {
|
|
16048
|
+
type: "object",
|
|
16049
|
+
allOf: [
|
|
16050
|
+
{ not: { required: ["call"] } },
|
|
16051
|
+
{ not: { required: ["do"] } },
|
|
16052
|
+
{ not: { required: ["fork"] } },
|
|
16053
|
+
{ not: { required: ["for"] } },
|
|
16054
|
+
{ not: { required: ["run"] } },
|
|
16055
|
+
{ not: { required: ["set"] } },
|
|
16056
|
+
{ not: { required: ["switch"] } },
|
|
16057
|
+
{ not: { required: ["try"] } },
|
|
16058
|
+
{ not: { required: ["wait"] } },
|
|
16059
|
+
{ not: { required: ["response"] } },
|
|
16060
|
+
{ not: { required: ["break"] } }
|
|
16061
|
+
]
|
|
16062
|
+
}
|
|
16063
|
+
}
|
|
16029
16064
|
]
|
|
16030
16065
|
},
|
|
16031
16066
|
callTask: {
|
|
@@ -16429,6 +16464,19 @@ var ACTIVITY_REQUIRED_KEYS = {
|
|
|
16429
16464
|
description: "must contain 'run' with a script calling $helpers.file.fileToBase64"
|
|
16430
16465
|
}
|
|
16431
16466
|
};
|
|
16467
|
+
var TASK_KIND_KEYS = [
|
|
16468
|
+
"call",
|
|
16469
|
+
"do",
|
|
16470
|
+
"fork",
|
|
16471
|
+
"for",
|
|
16472
|
+
"run",
|
|
16473
|
+
"set",
|
|
16474
|
+
"switch",
|
|
16475
|
+
"try",
|
|
16476
|
+
"wait",
|
|
16477
|
+
"response",
|
|
16478
|
+
"break"
|
|
16479
|
+
];
|
|
16432
16480
|
var VALID_EXPRESSION_LANGUAGES = ["javascript"];
|
|
16433
16481
|
var VALID_EVALUATE_MODES = ["strict"];
|
|
16434
16482
|
var schemaValidators;
|
|
@@ -16474,14 +16522,19 @@ function formatAjvError(err) {
|
|
|
16474
16522
|
return `Object must have at most ${err.params.limit} property`;
|
|
16475
16523
|
case "pattern":
|
|
16476
16524
|
return `Value must be a runtime expression matching \${...} syntax`;
|
|
16525
|
+
case "not":
|
|
16526
|
+
return `Task declares no task kind. Expected one of: ${TASK_KIND_KEYS.join(", ")}`;
|
|
16477
16527
|
default:
|
|
16478
16528
|
return `${err.message}${err.params ? ` (${JSON.stringify(err.params)})` : ""}`;
|
|
16479
16529
|
}
|
|
16480
16530
|
}
|
|
16531
|
+
function isRedundantBranchError(err) {
|
|
16532
|
+
return err.keyword === "if";
|
|
16533
|
+
}
|
|
16481
16534
|
function ajvErrorsToValidationIssues(errors) {
|
|
16482
16535
|
if (!errors)
|
|
16483
16536
|
return [];
|
|
16484
|
-
return errors.map((err) => ({
|
|
16537
|
+
return errors.filter((err) => !isRedundantBranchError(err)).map((err) => ({
|
|
16485
16538
|
path: err.instancePath || "(root)",
|
|
16486
16539
|
message: formatAjvError(err),
|
|
16487
16540
|
severity: "error"
|
|
@@ -16559,7 +16612,7 @@ function validateVariables(workflow, issues) {
|
|
|
16559
16612
|
}
|
|
16560
16613
|
}
|
|
16561
16614
|
}
|
|
16562
|
-
function walkTaskList(taskList, basePath, issues, skipMetadataWarnings = false) {
|
|
16615
|
+
function walkTaskList(taskList, basePath, issues, skipMetadataWarnings = false, parentTaskName) {
|
|
16563
16616
|
if (taskList.length === 0) {
|
|
16564
16617
|
issues.push({
|
|
16565
16618
|
path: basePath,
|
|
@@ -16567,21 +16620,72 @@ function walkTaskList(taskList, basePath, issues, skipMetadataWarnings = false)
|
|
|
16567
16620
|
severity: "warning"
|
|
16568
16621
|
});
|
|
16569
16622
|
}
|
|
16623
|
+
validateIfBranchSiblings(taskList, basePath, parentTaskName, issues);
|
|
16570
16624
|
for (let i = 0;i < taskList.length; i++) {
|
|
16571
16625
|
const item = taskList[i];
|
|
16572
|
-
|
|
16573
|
-
|
|
16574
|
-
const entries = Object.entries(item);
|
|
16575
|
-
if (entries.length === 0)
|
|
16576
|
-
continue;
|
|
16577
|
-
const [taskName, taskValue] = entries[0];
|
|
16578
|
-
if (!taskValue || typeof taskValue !== "object")
|
|
16626
|
+
const entry = getNamedTask(item);
|
|
16627
|
+
if (!entry)
|
|
16579
16628
|
continue;
|
|
16580
|
-
const task =
|
|
16629
|
+
const [taskName, task] = entry;
|
|
16581
16630
|
const taskPath = `${basePath}/${i}/${taskName}`;
|
|
16582
16631
|
validateTask(task, taskName, taskPath, issues, skipMetadataWarnings);
|
|
16583
16632
|
}
|
|
16584
16633
|
}
|
|
16634
|
+
function getNamedTask(item) {
|
|
16635
|
+
if (!item || typeof item !== "object" || Array.isArray(item))
|
|
16636
|
+
return;
|
|
16637
|
+
const [taskName, task] = Object.entries(item)[0] ?? [];
|
|
16638
|
+
if (!task || typeof task !== "object")
|
|
16639
|
+
return;
|
|
16640
|
+
return [taskName, task];
|
|
16641
|
+
}
|
|
16642
|
+
function validateIfBranchSiblings(taskList, basePath, parentTaskName, issues) {
|
|
16643
|
+
if (parentTaskName !== undefined && isWrapperTask(parentTaskName))
|
|
16644
|
+
return;
|
|
16645
|
+
const names = getTaskNames(taskList);
|
|
16646
|
+
for (let i = 0;i < taskList.length; i++) {
|
|
16647
|
+
const entry = getNamedTask(taskList[i]);
|
|
16648
|
+
if (!entry)
|
|
16649
|
+
continue;
|
|
16650
|
+
const [name, task] = entry;
|
|
16651
|
+
if (!Array.isArray(task.switch))
|
|
16652
|
+
continue;
|
|
16653
|
+
const thenName = `${name}#Then`;
|
|
16654
|
+
const elseName = `${name}#Else`;
|
|
16655
|
+
const targets = getSwitchTargets(task.switch);
|
|
16656
|
+
if (!names.has(thenName) || !targets.has(thenName))
|
|
16657
|
+
continue;
|
|
16658
|
+
const hasElse = names.has(elseName) && targets.has(elseName);
|
|
16659
|
+
const branches = hasElse ? "its '#Then' and '#Else' branches are siblings" : "its '#Then' branch are siblings";
|
|
16660
|
+
issues.push({
|
|
16661
|
+
path: `${basePath}/${i}/${name}`,
|
|
16662
|
+
message: `If task '${name}' and ${branches}. Place them inside '${name}#Wrapper' with metadata.activityType 'If'`,
|
|
16663
|
+
severity: "error"
|
|
16664
|
+
});
|
|
16665
|
+
}
|
|
16666
|
+
}
|
|
16667
|
+
function getTaskNames(taskList) {
|
|
16668
|
+
return new Set(taskList.flatMap((item) => {
|
|
16669
|
+
const entry = getNamedTask(item);
|
|
16670
|
+
return entry ? [entry[0]] : [];
|
|
16671
|
+
}));
|
|
16672
|
+
}
|
|
16673
|
+
function getSwitchTargets(branches) {
|
|
16674
|
+
const targets = new Set;
|
|
16675
|
+
for (const branch of branches) {
|
|
16676
|
+
if (!branch || typeof branch !== "object" || Array.isArray(branch)) {
|
|
16677
|
+
continue;
|
|
16678
|
+
}
|
|
16679
|
+
for (const branchBody of Object.values(branch)) {
|
|
16680
|
+
if (!branchBody || typeof branchBody !== "object")
|
|
16681
|
+
continue;
|
|
16682
|
+
const { then: target } = branchBody;
|
|
16683
|
+
if (typeof target === "string")
|
|
16684
|
+
targets.add(target);
|
|
16685
|
+
}
|
|
16686
|
+
}
|
|
16687
|
+
return targets;
|
|
16688
|
+
}
|
|
16585
16689
|
function isForTask(task) {
|
|
16586
16690
|
return "for" in task;
|
|
16587
16691
|
}
|
|
@@ -16595,7 +16699,13 @@ function validateTask(task, taskName, taskPath, issues, skipMetadataWarnings = f
|
|
|
16595
16699
|
const activityType = task.metadata?.activityType;
|
|
16596
16700
|
const skipMeta = skipMetadataWarnings || isEmptyPlaceholderTask(taskName);
|
|
16597
16701
|
if (!task.metadata?.activityType) {
|
|
16598
|
-
if (
|
|
16702
|
+
if (isWrapperTask(taskName)) {
|
|
16703
|
+
issues.push({
|
|
16704
|
+
path: `${taskPath}/metadata`,
|
|
16705
|
+
message: `Wrapper task '${taskName}' is missing 'metadata.activityType'. Studio Web picks the activity from that field, so it drops the whole wrapper without reporting it`,
|
|
16706
|
+
severity: "error"
|
|
16707
|
+
});
|
|
16708
|
+
} else if (!skipMeta) {
|
|
16599
16709
|
issues.push({
|
|
16600
16710
|
path: `${taskPath}/metadata`,
|
|
16601
16711
|
message: `Task '${taskName}' is missing 'metadata.activityType'. Studio Web cannot restore this activity without it`,
|
|
@@ -16632,7 +16742,7 @@ function validateTask(task, taskName, taskPath, issues, skipMetadataWarnings = f
|
|
|
16632
16742
|
}
|
|
16633
16743
|
const skipChildMetadata = isForTask(task) || isWrapperTask(taskName);
|
|
16634
16744
|
if (Array.isArray(task.do)) {
|
|
16635
|
-
walkTaskList(task.do, `${taskPath}/do`, issues, skipChildMetadata);
|
|
16745
|
+
walkTaskList(task.do, `${taskPath}/do`, issues, skipChildMetadata, taskName);
|
|
16636
16746
|
}
|
|
16637
16747
|
if (Array.isArray(task.try)) {
|
|
16638
16748
|
walkTaskList(task.try, `${taskPath}/try`, issues);
|
|
@@ -16649,24 +16759,91 @@ function validateIfBranches(task, taskName, taskPath, issues) {
|
|
|
16649
16759
|
return;
|
|
16650
16760
|
if (!Array.isArray(task.do))
|
|
16651
16761
|
return;
|
|
16652
|
-
const
|
|
16653
|
-
|
|
16654
|
-
return false;
|
|
16655
|
-
const entries = Object.entries(item);
|
|
16656
|
-
if (entries.length === 0)
|
|
16657
|
-
return false;
|
|
16658
|
-
const [, childValue] = entries[0];
|
|
16659
|
-
if (!childValue || typeof childValue !== "object")
|
|
16660
|
-
return false;
|
|
16661
|
-
return "switch" in childValue;
|
|
16662
|
-
});
|
|
16663
|
-
if (!hasSwitchChild) {
|
|
16762
|
+
const switchIndex = task.do.findIndex(hasSwitchKey);
|
|
16763
|
+
if (switchIndex < 0) {
|
|
16664
16764
|
issues.push({
|
|
16665
16765
|
path: `${taskPath}/do`,
|
|
16666
16766
|
message: `Task '${taskName}' has activityType 'If' but its 'do' has no inner task with a 'switch' (condition/branches)`,
|
|
16667
16767
|
severity: "error"
|
|
16668
16768
|
});
|
|
16769
|
+
return;
|
|
16770
|
+
}
|
|
16771
|
+
if (switchIndex > 0) {
|
|
16772
|
+
issues.push({
|
|
16773
|
+
path: `${taskPath}/do/${switchIndex}`,
|
|
16774
|
+
message: `Task '${taskName}' has activityType 'If' but its 'switch' is at 'do/${switchIndex}'. Studio Web reads the condition from 'do/0' only — put the switch first, before the '#Then' and '#Else' branches`,
|
|
16775
|
+
severity: "error"
|
|
16776
|
+
});
|
|
16777
|
+
}
|
|
16778
|
+
validateIfSwitchBranches(task.do[switchIndex], `${taskPath}/do/${switchIndex}`, taskName, issues);
|
|
16779
|
+
validateIfBranchTargets(task.do, switchIndex, `${taskPath}/do/${switchIndex}`, taskName, issues);
|
|
16780
|
+
}
|
|
16781
|
+
var FLOW_DIRECTIVES = new Set(["continue", "exit", "end"]);
|
|
16782
|
+
function validateIfBranchTargets(wrapperDo, switchIndex, switchPath, ifTaskName, issues) {
|
|
16783
|
+
const entry = getNamedTask(wrapperDo[switchIndex]);
|
|
16784
|
+
if (!entry)
|
|
16785
|
+
return;
|
|
16786
|
+
const [switchName, switchTask] = entry;
|
|
16787
|
+
if (!Array.isArray(switchTask.switch))
|
|
16788
|
+
return;
|
|
16789
|
+
const names = getTaskNames(wrapperDo);
|
|
16790
|
+
for (const target of getSwitchTargets(switchTask.switch)) {
|
|
16791
|
+
if (FLOW_DIRECTIVES.has(target) || names.has(target))
|
|
16792
|
+
continue;
|
|
16793
|
+
issues.push({
|
|
16794
|
+
path: `${switchPath}/${switchName}/switch`,
|
|
16795
|
+
message: `If task '${ifTaskName}' has a 'switch' that jumps to '${target}', which is not inside '${ifTaskName}'. Studio Web looks for the branch in the wrapper's 'do' only, so it restores that branch empty — move '${target}' into the wrapper after the switch`,
|
|
16796
|
+
severity: "error"
|
|
16797
|
+
});
|
|
16798
|
+
}
|
|
16799
|
+
}
|
|
16800
|
+
function hasSwitchKey(item) {
|
|
16801
|
+
const entry = getNamedTask(item);
|
|
16802
|
+
return entry ? "switch" in entry[1] : false;
|
|
16803
|
+
}
|
|
16804
|
+
function validateIfSwitchBranches(switchItem, switchPath, ifTaskName, issues) {
|
|
16805
|
+
const entry = getNamedTask(switchItem);
|
|
16806
|
+
if (!entry)
|
|
16807
|
+
return;
|
|
16808
|
+
const [switchName, switchTask] = entry;
|
|
16809
|
+
if (!Array.isArray(switchTask.switch))
|
|
16810
|
+
return;
|
|
16811
|
+
const branches = switchTask.switch;
|
|
16812
|
+
if (branches.length === 0) {
|
|
16813
|
+
issues.push({
|
|
16814
|
+
path: `${switchPath}/${switchName}/switch`,
|
|
16815
|
+
message: `If task '${ifTaskName}' has an empty 'switch'. Studio Web reads the condition from 'switch/0/case', so an If with no branches cannot be restored at all`,
|
|
16816
|
+
severity: "error"
|
|
16817
|
+
});
|
|
16818
|
+
return;
|
|
16819
|
+
}
|
|
16820
|
+
if (!hasBranchKey(branches[0], "case")) {
|
|
16821
|
+
issues.push({
|
|
16822
|
+
path: `${switchPath}/${switchName}/switch/0`,
|
|
16823
|
+
message: `If task '${ifTaskName}' has a 'switch' whose first branch is not a 'case'. Studio Web reads the condition from 'switch/0/case' — put the 'case' first and the 'default' second`,
|
|
16824
|
+
severity: "error"
|
|
16825
|
+
});
|
|
16826
|
+
}
|
|
16827
|
+
if (branches.length > 1 && !hasBranchKey(branches[1], "default")) {
|
|
16828
|
+
issues.push({
|
|
16829
|
+
path: `${switchPath}/${switchName}/switch/1`,
|
|
16830
|
+
message: `If task '${ifTaskName}' has a 'switch' whose second branch is not a 'default'. Studio Web reads the else target from 'switch/1/default' only, so this branch is dropped — an If has no else-if chain, use a nested If instead`,
|
|
16831
|
+
severity: "error"
|
|
16832
|
+
});
|
|
16833
|
+
}
|
|
16834
|
+
if (branches.length > 2) {
|
|
16835
|
+
issues.push({
|
|
16836
|
+
path: `${switchPath}/${switchName}/switch/2`,
|
|
16837
|
+
message: `If task '${ifTaskName}' has ${branches.length} 'switch' branches. Studio Web reads 'switch/0/case' and 'switch/1/default' only, so the rest are dropped — an If has no else-if chain, use a nested If instead`,
|
|
16838
|
+
severity: "error"
|
|
16839
|
+
});
|
|
16840
|
+
}
|
|
16841
|
+
}
|
|
16842
|
+
function hasBranchKey(branch, key) {
|
|
16843
|
+
if (!branch || typeof branch !== "object" || Array.isArray(branch)) {
|
|
16844
|
+
return false;
|
|
16669
16845
|
}
|
|
16846
|
+
return key in branch;
|
|
16670
16847
|
}
|
|
16671
16848
|
function isBase64ActivityType(activityType) {
|
|
16672
16849
|
return typeof activityType === "string" && Object.hasOwn(BASE64_ACTIVITY_HELPERS, activityType);
|
|
@@ -16907,4 +17084,4 @@ var registerCommands = async (program) => {
|
|
|
16907
17084
|
|
|
16908
17085
|
export { metadata, registerCommands };
|
|
16909
17086
|
|
|
16910
|
-
//# debugId=
|
|
17087
|
+
//# debugId=1E1B24892CCB5BD464756E2164756E21
|