@uipath/solution-tool 1.204.0-preview.261 → 1.204.0-preview.264
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/THIRD-PARTY-NOTICES.md +4 -4
- package/dist/{deploy-delete-service-0sz67k9b.js → deploy-delete-service-y19xn2rq.js} +5 -5
- package/dist/{deploy-status-service-7bsawnf9.js → deploy-status-service-9xb4zf45.js} +5 -5
- package/dist/deploy.js +7 -7
- package/dist/{deployment-search-fpq4w7e3.js → deployment-search-ny4zvb8d.js} +2 -2
- package/dist/{embedded-file-reader-rf2g1kfj.js → embedded-file-reader-z4becc02.js} +2 -2
- package/dist/{feed-resolver-wz3vxcrx.js → feed-resolver-57ng8yhq.js} +2 -2
- package/dist/{feed-scope-failure-yr4nhnj0.js → feed-scope-failure-jkcwchjd.js} +3 -3
- package/dist/index.js +15 -15
- package/dist/init.js +1 -1
- package/dist/{list-p6qdszkc.js → list-yz8hgwwm.js} +1 -1
- package/dist/pack.js +6 -6
- package/dist/{packager-tool-1h867c7a.js → packager-tool-17qxbphp.js} +2 -2
- package/dist/{packager-tool-tjypg724.js → packager-tool-33fhz6hb.js} +22 -22
- package/dist/{packager-tool-pa2nzjc2.js → packager-tool-42224f9m.js} +1 -1
- package/dist/{packager-tool-ys79yx9v.js → packager-tool-65qcvy8g.js} +1 -1
- package/dist/{packager-tool-gab9y5ct.js → packager-tool-7c1xev49.js} +3 -3
- package/dist/{packager-tool-yypwwatt.js → packager-tool-84nfedsr.js} +2 -2
- package/dist/{packager-tool-zns6n8zp.js → packager-tool-a608j1gt.js} +55 -7
- package/dist/{packager-tool-pjcg4b08.js → packager-tool-h99rz9mw.js} +3 -3
- package/dist/{packager-tool-1rzssy0x.js → packager-tool-px0mdrqy.js} +2 -2
- package/dist/{packager-tool-e2rtr49j.js → packager-tool-qk5012vn.js} +1 -1
- package/dist/{packager-tool-ga7zrca4.js → packager-tool-qzh97anz.js} +1 -1
- package/dist/{packager-tool-resolver-6zwhec62.js → packager-tool-resolver-8efb8670.js} +2 -2
- package/dist/{packager-tool-q2v44x2d.js → packager-tool-rrrq19mn.js} +4 -4
- package/dist/{packager-tool-yrz4mwfn.js → packager-tool-t21haejj.js} +616 -160
- package/dist/{packager-tool-9kmgn0hv.js → packager-tool-v3b45e7a.js} +1 -1
- package/dist/{packager-tool-gmhrd4kr.js → packager-tool-vqkfgftm.js} +5 -5
- package/dist/{packager-tool-s6dchxgb.js → packager-tool-zmgcj5dq.js} +1 -1
- package/dist/packager-tool.js +1 -1
- package/dist/{prepare-solution-resources-jpb5as2s.js → prepare-solution-resources-8y6fm2qa.js} +5 -5
- package/dist/{project-contributions-6wpff2hm.js → project-contributions-kdgd5ajp.js} +4 -4
- package/dist/publish.js +3 -3
- package/dist/resource.js +1 -1
- package/dist/tool.js +15 -15
- package/package.json +2 -2
|
@@ -2566,6 +2566,19 @@ class NullSecretsProvider {
|
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
2568
|
|
|
2569
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/feature-flag-provider.js
|
|
2570
|
+
class NullFeatureFlagProvider {
|
|
2571
|
+
getBool(_featureFlagName, defaultValue) {
|
|
2572
|
+
return defaultValue ?? false;
|
|
2573
|
+
}
|
|
2574
|
+
getInt(_featureFlagName, defaultValue) {
|
|
2575
|
+
return defaultValue ?? 0;
|
|
2576
|
+
}
|
|
2577
|
+
getString(_featureFlagName, defaultValue) {
|
|
2578
|
+
return defaultValue ?? "";
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2569
2582
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/timeout-exception.js
|
|
2570
2583
|
class TimeoutException extends Error {
|
|
2571
2584
|
constructor(message, timeoutMs) {
|
|
@@ -2720,10 +2733,12 @@ function withFileOperationTimeout2(provider, timeoutMs) {
|
|
|
2720
2733
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/solution-context-options.js
|
|
2721
2734
|
var DEFAULT_SOLUTION_CONTEXT_OPTIONS = {
|
|
2722
2735
|
lockTimeoutMs: 30000,
|
|
2723
|
-
fileOperationTimeoutMs: 30000
|
|
2736
|
+
fileOperationTimeoutMs: 30000,
|
|
2737
|
+
maxDegreeOfParallelism: 1
|
|
2724
2738
|
};
|
|
2725
2739
|
var SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY = "SOL_RB_SOLUTION_CONTEXT_TIMEOUT_MS";
|
|
2726
2740
|
var FILE_OPERATION_TIMEOUT_STORAGE_KEY = "SOL_RB_FILE_OPERATION_TIMEOUT_MS";
|
|
2741
|
+
var MAX_DEGREE_OF_PARALLELISM_STORAGE_KEY = "SOL_RB_MAX_DEGREE_OF_PARALLELISM";
|
|
2727
2742
|
function resolveTimeoutMs(storageKey, configured, fallback) {
|
|
2728
2743
|
const override = readTimeoutOverrideMs(storageKey);
|
|
2729
2744
|
if (override !== undefined)
|
|
@@ -2736,10 +2751,33 @@ function resolveLockTimeoutMs(options) {
|
|
|
2736
2751
|
function resolveFileOperationTimeoutMs(options) {
|
|
2737
2752
|
return resolveTimeoutMs(FILE_OPERATION_TIMEOUT_STORAGE_KEY, options?.fileOperationTimeoutMs, DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs);
|
|
2738
2753
|
}
|
|
2754
|
+
function isValidDegreeOfParallelism(value) {
|
|
2755
|
+
return typeof value == "number" && Number.isInteger(value) && value > 0;
|
|
2756
|
+
}
|
|
2757
|
+
function resolveMaxDegreeOfParallelism(options) {
|
|
2758
|
+
const override = readDegreeOfParallelismOverride(MAX_DEGREE_OF_PARALLELISM_STORAGE_KEY);
|
|
2759
|
+
if (override !== undefined)
|
|
2760
|
+
return override;
|
|
2761
|
+
return isValidDegreeOfParallelism(options?.maxDegreeOfParallelism) ? options.maxDegreeOfParallelism : DEFAULT_SOLUTION_CONTEXT_OPTIONS.maxDegreeOfParallelism;
|
|
2762
|
+
}
|
|
2763
|
+
function readDegreeOfParallelismOverride(storageKey) {
|
|
2764
|
+
try {
|
|
2765
|
+
if ("u" < typeof localStorage)
|
|
2766
|
+
return;
|
|
2767
|
+
const raw = localStorage.getItem(storageKey);
|
|
2768
|
+
if (raw === null || raw.trim() === "")
|
|
2769
|
+
return;
|
|
2770
|
+
const parsed = Number(raw);
|
|
2771
|
+
return isValidDegreeOfParallelism(parsed) ? parsed : undefined;
|
|
2772
|
+
} catch {
|
|
2773
|
+
return;
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2739
2776
|
function mergeSolutionContextOptions(options) {
|
|
2740
2777
|
return {
|
|
2741
2778
|
lockTimeoutMs: isValidTimeoutMs(options?.lockTimeoutMs) ? options.lockTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.lockTimeoutMs,
|
|
2742
|
-
fileOperationTimeoutMs: isValidTimeoutMs(options?.fileOperationTimeoutMs) ? options.fileOperationTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs
|
|
2779
|
+
fileOperationTimeoutMs: isValidTimeoutMs(options?.fileOperationTimeoutMs) ? options.fileOperationTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs,
|
|
2780
|
+
maxDegreeOfParallelism: isValidDegreeOfParallelism(options?.maxDegreeOfParallelism) ? options.maxDegreeOfParallelism : DEFAULT_SOLUTION_CONTEXT_OPTIONS.maxDegreeOfParallelism
|
|
2743
2781
|
};
|
|
2744
2782
|
}
|
|
2745
2783
|
|
|
@@ -3530,6 +3568,16 @@ function getRootFolder(solution) {
|
|
|
3530
3568
|
}
|
|
3531
3569
|
|
|
3532
3570
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/multi-file-solution-definition-provider.js
|
|
3571
|
+
function nowMs() {
|
|
3572
|
+
return globalThis.performance?.now?.() ?? Date.now();
|
|
3573
|
+
}
|
|
3574
|
+
function round1(ms) {
|
|
3575
|
+
return Math.round(10 * ms) / 10;
|
|
3576
|
+
}
|
|
3577
|
+
function cancellationError(signal) {
|
|
3578
|
+
return signal?.reason instanceof OperationCancelledException ? signal.reason : new OperationCancelledException;
|
|
3579
|
+
}
|
|
3580
|
+
|
|
3533
3581
|
class MultiFileSolutionDefinitionProvider {
|
|
3534
3582
|
get caseInsensitiveSerializer() {
|
|
3535
3583
|
if (!this._caseInsensitiveSerializer)
|
|
@@ -3547,137 +3595,344 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3547
3595
|
}
|
|
3548
3596
|
async readAsync(context, cancellationToken) {
|
|
3549
3597
|
this.logger.info("Reading multi-file solution definition for solution %s", context.path);
|
|
3550
|
-
const
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
let
|
|
3555
|
-
let
|
|
3556
|
-
|
|
3557
|
-
let
|
|
3558
|
-
|
|
3598
|
+
const loadStarted = nowMs();
|
|
3599
|
+
let fileCount = 0;
|
|
3600
|
+
let listMs = 0;
|
|
3601
|
+
let readStarted = loadStarted;
|
|
3602
|
+
let readWallMs = 0;
|
|
3603
|
+
let readCompleted = false;
|
|
3604
|
+
let ioMs = 0;
|
|
3605
|
+
let maxFileIoMs = 0;
|
|
3606
|
+
let parseMs = 0;
|
|
3607
|
+
let hashMs = 0;
|
|
3608
|
+
let chars = 0;
|
|
3609
|
+
let loadedCount = 0;
|
|
3559
3610
|
const parseErrors = [];
|
|
3560
3611
|
const missingFiles = [];
|
|
3561
3612
|
const invalidFiles = [];
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3613
|
+
let metricsLogged = false;
|
|
3614
|
+
const logReadMetrics = (outcome) => {
|
|
3615
|
+
metricsLogged = true;
|
|
3616
|
+
const totalMs = nowMs() - loadStarted;
|
|
3617
|
+
const mergeMs = readCompleted ? nowMs() - readStarted - readWallMs : 0;
|
|
3618
|
+
const metrics = {
|
|
3619
|
+
outcome,
|
|
3620
|
+
path: context.path,
|
|
3621
|
+
fileCount,
|
|
3622
|
+
totalMs: round1(totalMs),
|
|
3623
|
+
listMs: round1(listMs),
|
|
3624
|
+
readWallMs: round1(readWallMs),
|
|
3625
|
+
ioMs: round1(ioMs),
|
|
3626
|
+
maxFileIoMs: round1(maxFileIoMs),
|
|
3627
|
+
parseMs: round1(parseMs),
|
|
3628
|
+
hashMs: round1(hashMs),
|
|
3629
|
+
mergeMs: round1(mergeMs),
|
|
3630
|
+
chars,
|
|
3631
|
+
degreeOfParallelism: resolveMaxDegreeOfParallelism(this.options),
|
|
3632
|
+
isReadOnly: context.isReadOnly,
|
|
3633
|
+
loaded: loadedCount,
|
|
3634
|
+
missing: missingFiles.length,
|
|
3635
|
+
invalid: invalidFiles.length,
|
|
3636
|
+
parseErrors: parseErrors.length
|
|
3637
|
+
};
|
|
3638
|
+
const message = `Solution read ${outcome} for solution ${context.path}: ${metrics.fileCount} files in ${metrics.totalMs} ms (list ${metrics.listMs} ms, read ${metrics.readWallMs} ms wall, io ${metrics.ioMs} ms summed, max file io ${metrics.maxFileIoMs} ms, parse ${metrics.parseMs} ms, hash ${metrics.hashMs} ms, merge ${metrics.mergeMs} ms); ${metrics.chars} chars; parallelism ${metrics.degreeOfParallelism}; readOnly ${metrics.isReadOnly}; loaded ${metrics.loaded}, missing ${metrics.missing}, invalid ${metrics.invalid}, parseErrors ${metrics.parseErrors}`;
|
|
3639
|
+
if (outcome === "Success")
|
|
3640
|
+
this.logger.info(message, metrics);
|
|
3641
|
+
else
|
|
3642
|
+
this.logger.warn(message, metrics);
|
|
3643
|
+
};
|
|
3644
|
+
const readCore = async () => {
|
|
3645
|
+
const solutionKey = this.getSolutionKey(context);
|
|
3646
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
3647
|
+
const resources = [];
|
|
3648
|
+
const solutionFiles = [];
|
|
3649
|
+
let hashes;
|
|
3650
|
+
let paths;
|
|
3651
|
+
const pathsByKind = this.getPathsByKind(context);
|
|
3652
|
+
let tree;
|
|
3653
|
+
pathsByKind.clear();
|
|
3654
|
+
context.items[SolutionContextKeys.PARSE_ERRORS_ITEM_KEY] = parseErrors;
|
|
3655
|
+
if (!context.isReadOnly) {
|
|
3656
|
+
hashes = this.getHashes(context);
|
|
3657
|
+
paths = this.getPaths(context);
|
|
3658
|
+
tree = this.getTree(context);
|
|
3659
|
+
hashes.clear();
|
|
3660
|
+
paths.clear();
|
|
3661
|
+
tree.length = 0;
|
|
3662
|
+
}
|
|
3663
|
+
const listStarted = nowMs();
|
|
3664
|
+
const resourceFiles = await fileStorageProvider.getFilesAsync(SolutionConstants.RESOURCE_FILES_FOLDER_NAME, "*.json", cancellationToken);
|
|
3665
|
+
listMs = nowMs() - listStarted;
|
|
3666
|
+
fileCount = resourceFiles.length;
|
|
3667
|
+
readStarted = nowMs();
|
|
3668
|
+
const readResults = await this.readResourceFilesAsync(context, fileStorageProvider, resourceFiles, cancellationToken);
|
|
3669
|
+
readWallMs = nowMs() - readStarted;
|
|
3670
|
+
readCompleted = true;
|
|
3671
|
+
let fatal;
|
|
3672
|
+
let hasFatal = false;
|
|
3673
|
+
for (const result of readResults)
|
|
3674
|
+
if (result !== undefined) {
|
|
3675
|
+
if (result.timings) {
|
|
3676
|
+
ioMs += result.timings.ioMs;
|
|
3677
|
+
maxFileIoMs = Math.max(maxFileIoMs, result.timings.ioMs);
|
|
3678
|
+
parseMs += result.timings.parseMs;
|
|
3679
|
+
hashMs += result.timings.hashMs;
|
|
3680
|
+
chars += result.timings.chars;
|
|
3681
|
+
}
|
|
3682
|
+
if (result.fatal !== undefined) {
|
|
3683
|
+
if (!hasFatal) {
|
|
3684
|
+
fatal = result.fatal;
|
|
3685
|
+
hasFatal = true;
|
|
3599
3686
|
}
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3687
|
+
continue;
|
|
3688
|
+
}
|
|
3689
|
+
if (!hasFatal)
|
|
3690
|
+
switch (result.outcome) {
|
|
3691
|
+
case "loaded": {
|
|
3692
|
+
loadedCount++;
|
|
3693
|
+
const rd = result.resource;
|
|
3694
|
+
for (const file of result.files)
|
|
3695
|
+
if (!solutionFiles.some((sf) => sf.name === file.name && sf.kind === file.kind))
|
|
3696
|
+
solutionFiles.push(file);
|
|
3697
|
+
resources.push(rd);
|
|
3698
|
+
const resourceKey = rd.key;
|
|
3699
|
+
const normalizedFullPath = result.normalizedPath;
|
|
3700
|
+
if (!pathsByKind.has(rd.kind))
|
|
3701
|
+
pathsByKind.set(rd.kind, []);
|
|
3702
|
+
const kindPaths = pathsByKind.get(rd.kind);
|
|
3703
|
+
if (kindPaths)
|
|
3704
|
+
kindPaths.push({
|
|
3705
|
+
name: rd.name,
|
|
3706
|
+
key: rd.key,
|
|
3707
|
+
path: normalizedFullPath
|
|
3708
|
+
});
|
|
3709
|
+
if (!context.isReadOnly && hashes && paths) {
|
|
3710
|
+
paths.set(resourceKey, normalizedFullPath);
|
|
3711
|
+
hashes.set(resourceKey, result.hash);
|
|
3712
|
+
}
|
|
3713
|
+
break;
|
|
3604
3714
|
}
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3715
|
+
case "missing":
|
|
3716
|
+
missingFiles.push(result.file);
|
|
3717
|
+
break;
|
|
3718
|
+
case "invalid":
|
|
3719
|
+
invalidFiles.push(result.file);
|
|
3720
|
+
break;
|
|
3721
|
+
case "parseError":
|
|
3722
|
+
parseErrors.push(result.file);
|
|
3723
|
+
break;
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3726
|
+
if (hasFatal) {
|
|
3727
|
+
logReadMetrics("Fatal");
|
|
3728
|
+
throw fatal;
|
|
3729
|
+
}
|
|
3730
|
+
if (missingFiles.length > 0) {
|
|
3731
|
+
logReadMetrics("MissingFiles");
|
|
3732
|
+
throw new BadRequestException(ErrorCodes.Resources.MissingFileDependencies, `Solution has missing files: ${missingFiles.join(", ")}`);
|
|
3733
|
+
}
|
|
3734
|
+
if (invalidFiles.length > 0) {
|
|
3735
|
+
logReadMetrics("InvalidFiles");
|
|
3736
|
+
throw new BadRequestException(ErrorCodes.Resources.InvalidResourceFile, `Solution has resource files with invalid content: ${invalidFiles.join(", ")}`);
|
|
3737
|
+
}
|
|
3738
|
+
if (parseErrors.length > 0) {
|
|
3739
|
+
logReadMetrics("ParseErrors");
|
|
3740
|
+
throw new Error(`Failed to read resource files for solution ${context.path}: ${parseErrors.join(", ")}`);
|
|
3741
|
+
}
|
|
3742
|
+
const folderMap = new Map;
|
|
3743
|
+
const rootFolder = this.buildRootFolder(solutionKey, SolutionConstants.ROOT_FOLDER_NAME);
|
|
3744
|
+
folderMap.set(rootFolder.fullyQualifiedName.toLowerCase(), rootFolder);
|
|
3745
|
+
for (const res of resources)
|
|
3746
|
+
for (const fdep of res.folders ?? []) {
|
|
3747
|
+
const fqnLower = fdep.fullyQualifiedName.toLowerCase();
|
|
3748
|
+
if (!folderMap.has(fqnLower)) {
|
|
3749
|
+
const folderKey = this.generateGuidFromString(fdep.fullyQualifiedName);
|
|
3750
|
+
const pathSegments = fdep.fullyQualifiedName.split("/").filter((s) => s.length > 0).map((p) => {
|
|
3751
|
+
if (p.toLowerCase() !== SolutionConstants.ROOT_FOLDER_NAME.toLowerCase())
|
|
3752
|
+
return this.generateGuidFromString(SolutionConstants.ROOT_FOLDER_NAME);
|
|
3753
|
+
return rootFolder.key;
|
|
3754
|
+
});
|
|
3755
|
+
const folderPath = pathSegments.join(".");
|
|
3756
|
+
folderMap.set(fqnLower, {
|
|
3757
|
+
key: folderKey,
|
|
3758
|
+
fullyQualifiedName: fdep.fullyQualifiedName,
|
|
3759
|
+
path: folderPath
|
|
3617
3760
|
});
|
|
3618
|
-
if (!context.isReadOnly && hashes && paths) {
|
|
3619
|
-
paths.set(resourceKey, normalizedFullPath);
|
|
3620
|
-
hashes.set(resourceKey, await this.computeHash(content));
|
|
3621
3761
|
}
|
|
3622
|
-
} else {
|
|
3623
|
-
this.logger.error("Failed to read resource file %s for solution %s: invalid content", undefined, resourceFile, context.path);
|
|
3624
|
-
invalidFiles.push(resourceFile);
|
|
3625
|
-
}
|
|
3626
|
-
} catch (ex) {
|
|
3627
|
-
if (ex instanceof OperationCancelledException || cancellationToken?.aborted) {
|
|
3628
|
-
this.logger.warn("Operation cancelled while reading file %s for solution %s", resourceFile, context.path);
|
|
3629
|
-
throw ex instanceof OperationCancelledException ? ex : new OperationCancelledException;
|
|
3630
|
-
}
|
|
3631
|
-
if (ex instanceof TimeoutException)
|
|
3632
|
-
throw new TimeoutException(`Reading resource file ${resourceFile} for solution ${context.path} timed out: ${ex.message}`, ex.timeoutMs);
|
|
3633
|
-
if (isFileNotFoundError(ex)) {
|
|
3634
|
-
this.logger.warn("Resource file listed but missing in storage for solution %s: %s", resourceFile, context.path);
|
|
3635
|
-
missingFiles.push(resourceFile);
|
|
3636
|
-
} else {
|
|
3637
|
-
this.logger.error("Failed to read resource file %s for solution %s", ex, resourceFile, context.path);
|
|
3638
|
-
parseErrors.push(resourceFile);
|
|
3639
3762
|
}
|
|
3763
|
+
const solution = {
|
|
3764
|
+
key: solutionKey,
|
|
3765
|
+
docVersion: SolutionConstants.CURRENT_DOC_VERSION,
|
|
3766
|
+
folders: Array.from(folderMap.values()),
|
|
3767
|
+
resources,
|
|
3768
|
+
files: solutionFiles
|
|
3769
|
+
};
|
|
3770
|
+
await this.replaceDuplicateKeysAsync(solution, cancellationToken);
|
|
3771
|
+
if (!context.isReadOnly && tree) {
|
|
3772
|
+
const orderedResourceKeys = getTopologicalIdsOrdering(buildDependencyGraph(solution.resources));
|
|
3773
|
+
tree.push(...orderedResourceKeys);
|
|
3640
3774
|
}
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3775
|
+
logReadMetrics("Success");
|
|
3776
|
+
return solution;
|
|
3777
|
+
};
|
|
3778
|
+
try {
|
|
3779
|
+
return await readCore();
|
|
3780
|
+
} catch (ex) {
|
|
3781
|
+
if (!metricsLogged)
|
|
3782
|
+
logReadMetrics("Fatal");
|
|
3783
|
+
throw ex;
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
async readResourceFilesAsync(context, fileStorageProvider, resourceFiles, cancellationToken) {
|
|
3787
|
+
const results = Array.from({
|
|
3788
|
+
length: resourceFiles.length
|
|
3789
|
+
}, () => {
|
|
3790
|
+
return;
|
|
3791
|
+
});
|
|
3792
|
+
if (resourceFiles.length === 0)
|
|
3793
|
+
return results;
|
|
3794
|
+
const computeHash = !context.isReadOnly;
|
|
3795
|
+
const degreeOfParallelism = Math.min(resolveMaxDegreeOfParallelism(this.options), resourceFiles.length);
|
|
3796
|
+
let nextIndex = 0;
|
|
3797
|
+
let stopRequested = false;
|
|
3798
|
+
const runWorkerAsync = async () => {
|
|
3799
|
+
while (!stopRequested && nextIndex < resourceFiles.length) {
|
|
3800
|
+
const index = nextIndex++;
|
|
3801
|
+
const resourceFile = resourceFiles[index];
|
|
3802
|
+
const result = await this.readResourceFileAsync(context, fileStorageProvider, resourceFile, computeHash, cancellationToken);
|
|
3803
|
+
results[index] = result;
|
|
3804
|
+
if (result.fatal !== undefined)
|
|
3805
|
+
stopRequested = true;
|
|
3667
3806
|
}
|
|
3668
|
-
const solution = {
|
|
3669
|
-
key: solutionKey,
|
|
3670
|
-
docVersion: SolutionConstants.CURRENT_DOC_VERSION,
|
|
3671
|
-
folders: Array.from(folderMap.values()),
|
|
3672
|
-
resources,
|
|
3673
|
-
files: solutionFiles
|
|
3674
3807
|
};
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3808
|
+
const workers = [];
|
|
3809
|
+
for (let i = 0;i < degreeOfParallelism; i++)
|
|
3810
|
+
workers.push(runWorkerAsync());
|
|
3811
|
+
await Promise.all(workers);
|
|
3812
|
+
if (cancellationToken?.aborted && !results.some((result) => result?.fatal !== undefined))
|
|
3813
|
+
throw cancellationError(cancellationToken);
|
|
3814
|
+
return results;
|
|
3815
|
+
}
|
|
3816
|
+
async readResourceFileAsync(context, fileStorageProvider, resourceFile, computeHash, cancellationToken) {
|
|
3817
|
+
const started = nowMs();
|
|
3818
|
+
let ioMs;
|
|
3819
|
+
let content;
|
|
3820
|
+
const failureTimings = () => {
|
|
3821
|
+
const elapsed = nowMs() - started;
|
|
3822
|
+
return ioMs === undefined ? {
|
|
3823
|
+
ioMs: elapsed,
|
|
3824
|
+
parseMs: 0,
|
|
3825
|
+
hashMs: 0,
|
|
3826
|
+
chars: 0
|
|
3827
|
+
} : {
|
|
3828
|
+
ioMs,
|
|
3829
|
+
parseMs: elapsed - ioMs,
|
|
3830
|
+
hashMs: 0,
|
|
3831
|
+
chars: content?.length ?? 0
|
|
3832
|
+
};
|
|
3833
|
+
};
|
|
3834
|
+
try {
|
|
3835
|
+
if (cancellationToken?.aborted)
|
|
3836
|
+
throw cancellationError(cancellationToken);
|
|
3837
|
+
const stream = await fileStorageProvider.openFileAsync(resourceFile, cancellationToken);
|
|
3838
|
+
content = await this.streamToString(stream);
|
|
3839
|
+
ioMs = nowMs() - started;
|
|
3840
|
+
const parseStarted = nowMs();
|
|
3841
|
+
const wrapper = this.caseInsensitiveSerializer.deserialize(content);
|
|
3842
|
+
if (!wrapper?.resource) {
|
|
3843
|
+
this.logger.error("Failed to read resource file %s for solution %s: invalid content", undefined, resourceFile, context.path);
|
|
3844
|
+
return {
|
|
3845
|
+
file: resourceFile,
|
|
3846
|
+
outcome: "invalid",
|
|
3847
|
+
timings: failureTimings()
|
|
3848
|
+
};
|
|
3849
|
+
}
|
|
3850
|
+
const files = [];
|
|
3851
|
+
const rd = this.fromSerializable(wrapper.resource, files);
|
|
3852
|
+
this.applyFolders(rd, resourceFile);
|
|
3853
|
+
const parseMs = nowMs() - parseStarted;
|
|
3854
|
+
let hash;
|
|
3855
|
+
let hashMs = 0;
|
|
3856
|
+
if (computeHash) {
|
|
3857
|
+
const hashStarted = nowMs();
|
|
3858
|
+
hash = await this.computeHash(content);
|
|
3859
|
+
hashMs = nowMs() - hashStarted;
|
|
3860
|
+
}
|
|
3861
|
+
return {
|
|
3862
|
+
file: resourceFile,
|
|
3863
|
+
outcome: "loaded",
|
|
3864
|
+
resource: rd,
|
|
3865
|
+
files,
|
|
3866
|
+
normalizedPath: this.getNormalizedPath(resourceFile),
|
|
3867
|
+
hash,
|
|
3868
|
+
timings: {
|
|
3869
|
+
ioMs,
|
|
3870
|
+
parseMs,
|
|
3871
|
+
hashMs,
|
|
3872
|
+
chars: content.length
|
|
3873
|
+
}
|
|
3874
|
+
};
|
|
3875
|
+
} catch (ex) {
|
|
3876
|
+
if (ex instanceof OperationCancelledException || cancellationToken?.aborted) {
|
|
3877
|
+
this.logger.warn("Operation cancelled while reading file %s for solution %s", resourceFile, context.path);
|
|
3878
|
+
return {
|
|
3879
|
+
file: resourceFile,
|
|
3880
|
+
outcome: "fatal",
|
|
3881
|
+
fatal: ex instanceof OperationCancelledException ? ex : cancellationError(cancellationToken),
|
|
3882
|
+
timings: failureTimings()
|
|
3883
|
+
};
|
|
3884
|
+
}
|
|
3885
|
+
if (ex instanceof TimeoutException)
|
|
3886
|
+
return {
|
|
3887
|
+
file: resourceFile,
|
|
3888
|
+
outcome: "fatal",
|
|
3889
|
+
fatal: new TimeoutException(`Reading resource file ${resourceFile} for solution ${context.path} timed out: ${ex.message}`, ex.timeoutMs),
|
|
3890
|
+
timings: failureTimings()
|
|
3891
|
+
};
|
|
3892
|
+
if (isFileNotFoundError(ex)) {
|
|
3893
|
+
this.logger.warn("Resource file listed but missing in storage for solution %s: %s", resourceFile, context.path);
|
|
3894
|
+
return {
|
|
3895
|
+
file: resourceFile,
|
|
3896
|
+
outcome: "missing",
|
|
3897
|
+
timings: failureTimings()
|
|
3898
|
+
};
|
|
3899
|
+
}
|
|
3900
|
+
this.logger.error("Failed to read resource file %s for solution %s", ex, resourceFile, context.path);
|
|
3901
|
+
return {
|
|
3902
|
+
file: resourceFile,
|
|
3903
|
+
outcome: "parseError",
|
|
3904
|
+
timings: failureTimings()
|
|
3905
|
+
};
|
|
3679
3906
|
}
|
|
3680
|
-
|
|
3907
|
+
}
|
|
3908
|
+
applyFolders(resource, resourceFile) {
|
|
3909
|
+
const relPath = resourceFile.replace(/\\/g, "/");
|
|
3910
|
+
const segments = relPath.split("/").filter((s) => s.length > 0);
|
|
3911
|
+
const firstSegment = segments[0];
|
|
3912
|
+
if (segments.length >= 3 && firstSegment && firstSegment.toLowerCase() === SolutionConstants.RESOURCE_FILES_FOLDER_NAME.toLowerCase()) {
|
|
3913
|
+
const hasType = !!resource.type;
|
|
3914
|
+
const folderSegmentCount = hasType ? segments.length - 3 : segments.length - 2;
|
|
3915
|
+
if (folderSegmentCount < 1)
|
|
3916
|
+
resource.folders = [
|
|
3917
|
+
{
|
|
3918
|
+
fullyQualifiedName: SolutionConstants.ROOT_FOLDER_NAME
|
|
3919
|
+
}
|
|
3920
|
+
];
|
|
3921
|
+
else {
|
|
3922
|
+
const segmentsToUse = segments.slice(1, folderSegmentCount);
|
|
3923
|
+
const folderFqn = segmentsToUse.join("/");
|
|
3924
|
+
resource.folders = [
|
|
3925
|
+
{
|
|
3926
|
+
fullyQualifiedName: folderFqn
|
|
3927
|
+
}
|
|
3928
|
+
];
|
|
3929
|
+
}
|
|
3930
|
+
} else
|
|
3931
|
+
resource.folders = [
|
|
3932
|
+
{
|
|
3933
|
+
fullyQualifiedName: SolutionConstants.ROOT_FOLDER_NAME
|
|
3934
|
+
}
|
|
3935
|
+
];
|
|
3681
3936
|
}
|
|
3682
3937
|
async writeAsync(context, solution, cancellationToken) {
|
|
3683
3938
|
if (context.isReadOnly)
|
|
@@ -3982,7 +4237,7 @@ class MultiFileSolutionDefinitionFactory {
|
|
|
3982
4237
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/embedded-files-default.js
|
|
3983
4238
|
async function createDefaultEmbeddedFileReaderAsync() {
|
|
3984
4239
|
const [{ EmbeddedFileReader }, { JsonSerializerFactory: JsonSerializerFactory2 }] = await Promise.all([
|
|
3985
|
-
import("./embedded-file-reader-
|
|
4240
|
+
import("./embedded-file-reader-z4becc02.js"),
|
|
3986
4241
|
import("./index-dqa169gp.js")
|
|
3987
4242
|
]);
|
|
3988
4243
|
return new EmbeddedFileReader(new JsonSerializerFactory2);
|
|
@@ -4000,6 +4255,7 @@ var ServiceTokens = {
|
|
|
4000
4255
|
SecretsProvider: "ISecretsProvider",
|
|
4001
4256
|
FileStorageProviderFactory: "IFileStorageProviderFactory",
|
|
4002
4257
|
IpRangeBypassSecretProvider: "IIpRangeBypassSecretProvider",
|
|
4258
|
+
FeatureFlagProvider: "IFeatureFlagProvider",
|
|
4003
4259
|
SolutionDefinitionProvider: "ISolutionDefinitionProvider",
|
|
4004
4260
|
SolutionDefinitionFactory: "ISolutionDefinitionFactory",
|
|
4005
4261
|
ArtifactResourceSpecEnhancer: "IArtifactResourceSpecEnhancer",
|
|
@@ -4350,6 +4606,9 @@ function getBindingType(resourceKind, resourceType) {
|
|
|
4350
4606
|
}
|
|
4351
4607
|
|
|
4352
4608
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/bindings/bindings-metadata-serializer.js
|
|
4609
|
+
var SUPPORTED_SCHEMA_MAJOR_VERSION = 2;
|
|
4610
|
+
var INT32_MAX_VALUE = 2147483647;
|
|
4611
|
+
|
|
4353
4612
|
class BindingsMetadataSerializer {
|
|
4354
4613
|
tryDeserialize(input) {
|
|
4355
4614
|
if (!input)
|
|
@@ -4360,30 +4619,52 @@ class BindingsMetadataSerializer {
|
|
|
4360
4619
|
let cleanInput = input.charCodeAt(0) === 65279 ? input.slice(1) : input;
|
|
4361
4620
|
if (cleanInput.charCodeAt(cleanInput.length - 1) === 26)
|
|
4362
4621
|
cleanInput = cleanInput.slice(0, -1);
|
|
4363
|
-
const
|
|
4622
|
+
const root = JSON.parse(cleanInput);
|
|
4623
|
+
if (root === null || typeof root != "object" || Array.isArray(root)) {
|
|
4624
|
+
this.logger.warn("Invalid bindings: content is not a JSON object");
|
|
4625
|
+
return {
|
|
4626
|
+
success: false
|
|
4627
|
+
};
|
|
4628
|
+
}
|
|
4629
|
+
const jsonObject = root;
|
|
4364
4630
|
const versionValue = jsonObject[BindingsKnownKeys.Version];
|
|
4365
|
-
if (
|
|
4631
|
+
if (typeof versionValue != "string") {
|
|
4632
|
+
this.logger.warn(`Invalid bindings: '${BindingsKnownKeys.Version}' is missing or not a string`);
|
|
4366
4633
|
return {
|
|
4367
4634
|
success: false
|
|
4368
4635
|
};
|
|
4369
|
-
|
|
4370
|
-
const majorVersion =
|
|
4371
|
-
if (majorVersion
|
|
4372
|
-
|
|
4636
|
+
}
|
|
4637
|
+
const majorVersion = BindingsMetadataSerializer.tryParseMajorVersion(versionValue);
|
|
4638
|
+
if (majorVersion === undefined) {
|
|
4639
|
+
this.logger.warn(`Invalid bindings: '${BindingsKnownKeys.Version}' is not a valid version`);
|
|
4640
|
+
return {
|
|
4641
|
+
success: false
|
|
4642
|
+
};
|
|
4643
|
+
}
|
|
4644
|
+
if (majorVersion !== SUPPORTED_SCHEMA_MAJOR_VERSION) {
|
|
4645
|
+
this.logger.warn(`Invalid bindings: unsupported schema major version ${majorVersion}`);
|
|
4646
|
+
return {
|
|
4647
|
+
success: false
|
|
4648
|
+
};
|
|
4649
|
+
}
|
|
4650
|
+
const resources = jsonObject[BindingsKnownKeys.Resources];
|
|
4651
|
+
if (!Array.isArray(resources)) {
|
|
4652
|
+
this.logger.warn(`Invalid bindings: '${BindingsKnownKeys.Resources}' is missing or not an array`);
|
|
4653
|
+
return {
|
|
4654
|
+
success: false
|
|
4655
|
+
};
|
|
4656
|
+
}
|
|
4373
4657
|
const metadata = {
|
|
4374
4658
|
version: versionValue,
|
|
4375
4659
|
resources: []
|
|
4376
4660
|
};
|
|
4377
|
-
const resources
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
this.logger.warn("Skipping null bindings resource element");
|
|
4382
|
-
continue;
|
|
4383
|
-
}
|
|
4384
|
-
const resource = this.getBindingsResourceV2(resourceElement);
|
|
4385
|
-
metadata.resources.push(resource);
|
|
4661
|
+
for (const resourceElement of resources) {
|
|
4662
|
+
if (resourceElement == null) {
|
|
4663
|
+
this.logger.warn("Skipping null bindings resource element");
|
|
4664
|
+
continue;
|
|
4386
4665
|
}
|
|
4666
|
+
metadata.resources.push(this.getBindingsResourceV2(resourceElement));
|
|
4667
|
+
}
|
|
4387
4668
|
this.linkDependencies(metadata.resources);
|
|
4388
4669
|
return {
|
|
4389
4670
|
success: true,
|
|
@@ -4396,6 +4677,22 @@ class BindingsMetadataSerializer {
|
|
|
4396
4677
|
};
|
|
4397
4678
|
}
|
|
4398
4679
|
}
|
|
4680
|
+
static tryParseMajorVersion(value) {
|
|
4681
|
+
const parts = value.split(".");
|
|
4682
|
+
if (parts.length < 2 || parts.length > 4)
|
|
4683
|
+
return;
|
|
4684
|
+
let major;
|
|
4685
|
+
for (const [index, part] of parts.entries()) {
|
|
4686
|
+
if (!/^\s*[+-]?\d+\s*$/.test(part))
|
|
4687
|
+
return;
|
|
4688
|
+
const component = Number(part);
|
|
4689
|
+
if (component < 0 || component > INT32_MAX_VALUE)
|
|
4690
|
+
return;
|
|
4691
|
+
if (index === 0)
|
|
4692
|
+
major = component === 0 ? 0 : component;
|
|
4693
|
+
}
|
|
4694
|
+
return major;
|
|
4695
|
+
}
|
|
4399
4696
|
linkDependencies(resources) {
|
|
4400
4697
|
for (const resource of resources) {
|
|
4401
4698
|
const propertyMeta = resource.metadata;
|
|
@@ -4555,6 +4852,62 @@ class BindingOverwritesMappingRequest {
|
|
|
4555
4852
|
}
|
|
4556
4853
|
}
|
|
4557
4854
|
|
|
4855
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/bindings/jit-debug-project-types.js
|
|
4856
|
+
var JIT_DEBUG_PROJECT_TYPES_FEATURE_FLAG = "FE.JitDebugProjectTypes";
|
|
4857
|
+
var PROCESS_KIND = "process";
|
|
4858
|
+
var BUSINESS_RULE_KIND = "businessrule";
|
|
4859
|
+
var APP_KIND = "app";
|
|
4860
|
+
var LOW_CODE_APP_PROJECT_TYPE = "webapp";
|
|
4861
|
+
var LOW_CODE_APP_TYPES = new Set([
|
|
4862
|
+
"workflow action"
|
|
4863
|
+
]);
|
|
4864
|
+
var CODED_APP_PROJECT_TYPE = "appv2";
|
|
4865
|
+
var CODED_APP_TYPES = new Set([
|
|
4866
|
+
"coded",
|
|
4867
|
+
"codedaction"
|
|
4868
|
+
]);
|
|
4869
|
+
var DEFAULT_PROCESS_PROJECT_TYPE = "process";
|
|
4870
|
+
var KNOWN_PROCESS_PROJECT_TYPES = new Set([
|
|
4871
|
+
DEFAULT_PROCESS_PROJECT_TYPE,
|
|
4872
|
+
"processorchestration",
|
|
4873
|
+
"agent",
|
|
4874
|
+
"api",
|
|
4875
|
+
"flow",
|
|
4876
|
+
"function",
|
|
4877
|
+
"casemanagement",
|
|
4878
|
+
"webapp",
|
|
4879
|
+
"businessrules"
|
|
4880
|
+
]);
|
|
4881
|
+
var BUSINESS_RULE_PROJECT_TYPE = "businessrules";
|
|
4882
|
+
function parseJitDebugProjectTypes(flagValue) {
|
|
4883
|
+
if (!flagValue || !flagValue.trim())
|
|
4884
|
+
return [];
|
|
4885
|
+
return flagValue.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
|
|
4886
|
+
}
|
|
4887
|
+
function solutionSupportsJitDebug(solution, flagValue) {
|
|
4888
|
+
const enabledProjectTypes = parseJitDebugProjectTypes(flagValue).map((t) => t.toLowerCase());
|
|
4889
|
+
if (enabledProjectTypes.length === 0)
|
|
4890
|
+
return false;
|
|
4891
|
+
return (solution.resources ?? []).filter((r) => (r.projectKey != null || r.isArtefactResource === true) && isDecisionKind(r.kind)).every((r) => enabledProjectTypes.some((projectType) => matches(projectType, r)));
|
|
4892
|
+
}
|
|
4893
|
+
function isDecisionKind(kind) {
|
|
4894
|
+
const normalized = (kind ?? "").toLowerCase();
|
|
4895
|
+
return normalized === PROCESS_KIND || normalized === BUSINESS_RULE_KIND || normalized === APP_KIND;
|
|
4896
|
+
}
|
|
4897
|
+
function matches(projectType, resource) {
|
|
4898
|
+
if ((resource.kind ?? "").toLowerCase() === BUSINESS_RULE_KIND)
|
|
4899
|
+
return projectType === BUSINESS_RULE_PROJECT_TYPE;
|
|
4900
|
+
if ((resource.kind ?? "").toLowerCase() === APP_KIND) {
|
|
4901
|
+
const appType = (resource.type ?? "").toLowerCase();
|
|
4902
|
+
if (appType === "" || LOW_CODE_APP_TYPES.has(appType))
|
|
4903
|
+
return projectType === LOW_CODE_APP_PROJECT_TYPE;
|
|
4904
|
+
return CODED_APP_TYPES.has(appType) && projectType === CODED_APP_PROJECT_TYPE;
|
|
4905
|
+
}
|
|
4906
|
+
const resourceType = (resource.type ?? "").toLowerCase();
|
|
4907
|
+
const processType = resourceType === "" ? DEFAULT_PROCESS_PROJECT_TYPE : resourceType;
|
|
4908
|
+
return !KNOWN_PROCESS_PROJECT_TYPES.has(processType) || projectType === processType;
|
|
4909
|
+
}
|
|
4910
|
+
|
|
4558
4911
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/bindings/binding-overwrites-handler.js
|
|
4559
4912
|
class BindingOverwritesHandler {
|
|
4560
4913
|
async handleAsync(request, cancellationToken) {
|
|
@@ -4570,6 +4923,10 @@ class BindingOverwritesHandler {
|
|
|
4570
4923
|
if (bindingResources.length === 0)
|
|
4571
4924
|
return {};
|
|
4572
4925
|
const result = {};
|
|
4926
|
+
const solution = await request.context.loadAsync(cancellationToken);
|
|
4927
|
+
const jitDebugProjectTypes = this.featureFlagProvider.getString(JIT_DEBUG_PROJECT_TYPES_FEATURE_FLAG, "");
|
|
4928
|
+
const emptyFolderPathForArtefacts = solutionSupportsJitDebug(solution, jitDebugProjectTypes);
|
|
4929
|
+
this.logger.info(`Binding overwrites for solution ${request.context.path}: JIT debug ${emptyFolderPathForArtefacts ? "on" : "off"} (FE.JitDebugProjectTypes = '${jitDebugProjectTypes}')`);
|
|
4573
4930
|
const resourceOverwrites = await this.resourceOverwritesService.getResourceOverwritesAsync(request.context, cancellationToken);
|
|
4574
4931
|
for (const bindingResource of bindingResources) {
|
|
4575
4932
|
const resourceOverwrite = resourceOverwrites.get(bindingResource.resourceKey.toLowerCase());
|
|
@@ -4582,8 +4939,7 @@ class BindingOverwritesHandler {
|
|
|
4582
4939
|
[BindingsKnownKeys.FolderKeyPropertyName]: resourceOverwrite.folderKey ?? ""
|
|
4583
4940
|
};
|
|
4584
4941
|
else {
|
|
4585
|
-
const
|
|
4586
|
-
const folderPath = bindingResource.isArtefactResource && !isBusinessRule ? "" : resourceOverwrite.folderFullyQualifiedName ?? "";
|
|
4942
|
+
const folderPath = emptyFolderPathForArtefacts && bindingResource.isArtefactResource ? "" : resourceOverwrite.folderFullyQualifiedName ?? "";
|
|
4587
4943
|
overwrite = {
|
|
4588
4944
|
[BindingsKnownKeys.FolderPathPropertyName]: folderPath,
|
|
4589
4945
|
[BindingsKnownKeys.NamePropertyName]: resourceOverwrite.resourceName
|
|
@@ -4605,9 +4961,10 @@ class BindingOverwritesHandler {
|
|
|
4605
4961
|
throw new BadRequestException("Bindings.ValidationFailed", `Binding validation failed: ${failureMessages}`);
|
|
4606
4962
|
}
|
|
4607
4963
|
}
|
|
4608
|
-
constructor(mediator, resourceOverwritesService, loggerFactory) {
|
|
4964
|
+
constructor(mediator, resourceOverwritesService, loggerFactory, featureFlagProvider) {
|
|
4609
4965
|
this.mediator = mediator;
|
|
4610
4966
|
this.resourceOverwritesService = resourceOverwritesService;
|
|
4967
|
+
this.featureFlagProvider = featureFlagProvider;
|
|
4611
4968
|
this.logger = loggerFactory.create("BindingOverwritesHandler");
|
|
4612
4969
|
}
|
|
4613
4970
|
}
|
|
@@ -4616,6 +4973,11 @@ function removeTimeTriggerBindings(bindings) {
|
|
|
4616
4973
|
}
|
|
4617
4974
|
|
|
4618
4975
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/bindings/binding-overwrites-mapping-handler.js
|
|
4976
|
+
function isCodedAppType(type) {
|
|
4977
|
+
const normalized = type?.toLowerCase();
|
|
4978
|
+
return normalized === "coded" || normalized === "codedaction";
|
|
4979
|
+
}
|
|
4980
|
+
|
|
4619
4981
|
class BindingOverwritesMappingRequestHandler {
|
|
4620
4982
|
async handleAsync(request, cancellationToken) {
|
|
4621
4983
|
const solutionBindings = request.bindings.resources.filter((x) => isSolutionResource(x.metadata));
|
|
@@ -4641,7 +5003,8 @@ class BindingOverwritesMappingRequestHandler {
|
|
|
4641
5003
|
result.push({
|
|
4642
5004
|
binding: bindingsResource,
|
|
4643
5005
|
resourceKey: resource.key,
|
|
4644
|
-
isArtefactResource: resource.projectKey != null
|
|
5006
|
+
isArtefactResource: resource.projectKey != null,
|
|
5007
|
+
isCodedApp: bindingsResource.resourceType === models_BindingsResourceType.App && isCodedAppType(resource.type)
|
|
4645
5008
|
});
|
|
4646
5009
|
} else {
|
|
4647
5010
|
this.logger.error(`Solution does not contain binding resource of type ${models_BindingsResourceType[bindingsResource.resourceType]}.`);
|
|
@@ -5646,6 +6009,9 @@ class SolutionPublishLocationRequest {
|
|
|
5646
6009
|
}
|
|
5647
6010
|
|
|
5648
6011
|
class SolutionPublishLocationRequestV2 {
|
|
6012
|
+
constructor(permissionType) {
|
|
6013
|
+
this.permissionType = permissionType;
|
|
6014
|
+
}
|
|
5649
6015
|
}
|
|
5650
6016
|
|
|
5651
6017
|
class SettingsRequest {
|
|
@@ -5810,12 +6176,13 @@ function _ts_param3(paramIndex, decorator) {
|
|
|
5810
6176
|
}
|
|
5811
6177
|
|
|
5812
6178
|
class SolutionPublishLocationRequestV2Handler {
|
|
5813
|
-
async handleAsync(
|
|
6179
|
+
async handleAsync(request, cancellationToken) {
|
|
5814
6180
|
try {
|
|
5815
6181
|
const orchestratorClient = await this.orchestratorClientFactory.getClientAsync(cancellationToken);
|
|
5816
6182
|
if (!orchestratorClient)
|
|
5817
6183
|
throw new InvalidOperationException("Failed to create Orchestrator client");
|
|
5818
|
-
|
|
6184
|
+
const { permissionType } = request;
|
|
6185
|
+
return permissionType == null ? await orchestratorClient.getPublishLocationsAsync(cancellationToken) : await orchestratorClient.getAccessiblePublishLocationsAsync(permissionType, cancellationToken);
|
|
5819
6186
|
} catch (error) {
|
|
5820
6187
|
this.logger.error("An unexpected error occurred while retrieving publish locations from Automation Solutions service.", error);
|
|
5821
6188
|
throw error;
|
|
@@ -7255,8 +7622,8 @@ class SolutionDefinitionHelper {
|
|
|
7255
7622
|
if (references.length === 0)
|
|
7256
7623
|
continue;
|
|
7257
7624
|
const referenceKind = refProp["referenceKind"];
|
|
7258
|
-
const
|
|
7259
|
-
const filtered = references.filter((r) => !
|
|
7625
|
+
const matches2 = (ref) => ref.name != null && invariantEquals(resource.name, ref.name) && referenceKind != null && invariantEquals(referenceKind, resource.kind);
|
|
7626
|
+
const filtered = references.filter((r) => !matches2(r));
|
|
7260
7627
|
if (filtered.length !== references.length)
|
|
7261
7628
|
spec[refProp.property] = isSingleReferenceProperty(refProp) ? filtered[0] ?? null : filtered;
|
|
7262
7629
|
}
|
|
@@ -7845,7 +8212,7 @@ class GetResourceKeyForProjectRequestHandler {
|
|
|
7845
8212
|
projectKey: request.projectKey,
|
|
7846
8213
|
solution: request.context.path
|
|
7847
8214
|
});
|
|
7848
|
-
const cacheKey = `prk:${request.projectKey}`;
|
|
8215
|
+
const cacheKey = `prk:${request.context.path}:${request.projectKey}`;
|
|
7849
8216
|
const cached = await this.cacheProvider.getAsync(cacheKey, cancellationToken);
|
|
7850
8217
|
if (cached && typeof cached == "object" && "resourceKey" in cached) {
|
|
7851
8218
|
this.logger.info("Cache hit for project {projectKey} resource key.", {
|
|
@@ -8673,7 +9040,11 @@ class UpdateResourceConfigurationCommandHandler {
|
|
|
8673
9040
|
for (const prop of command.properties) {
|
|
8674
9041
|
const propKey = prop.property.toLowerCase();
|
|
8675
9042
|
const metadata = propertiesMetadata.get(propKey);
|
|
8676
|
-
if (
|
|
9043
|
+
if (metadata && metadata.readOnly !== true) {
|
|
9044
|
+
if (isAnyReferenceProperty(metadata)) {
|
|
9045
|
+
updated = this.setSolutionReference(solution, resource, currentConfiguration, propertiesMetadata, metadata, prop.configuredValue) || updated;
|
|
9046
|
+
continue;
|
|
9047
|
+
}
|
|
8677
9048
|
if (isSecretProperty(metadata)) {
|
|
8678
9049
|
const secretValue = prop.configuredValue?.toString() || "";
|
|
8679
9050
|
const existingKey = currentConfiguration[metadata.property]?.toString();
|
|
@@ -8717,6 +9088,38 @@ class UpdateResourceConfigurationCommandHandler {
|
|
|
8717
9088
|
await command.context.saveChangesAsync(cancellationToken);
|
|
8718
9089
|
return resourceConfiguration;
|
|
8719
9090
|
}
|
|
9091
|
+
setSolutionReference(solution, resource, currentConfiguration, propertiesMetadata, metadata, configuredValue) {
|
|
9092
|
+
const referenceKind = metadata["referenceKind"];
|
|
9093
|
+
if (!isSingleReferenceProperty(metadata) || isFileReferenceProperty(metadata) || typeof referenceKind != "string" || !referenceKind)
|
|
9094
|
+
return false;
|
|
9095
|
+
const requested = asReference(configuredValue);
|
|
9096
|
+
const target = requested?.key ? solution.resources.find((r) => invariantEquals(r.key, requested.key) && invariantEquals(r.kind, referenceKind)) : undefined;
|
|
9097
|
+
if (!requested || !target || invariantEquals(target.key, resource.key))
|
|
9098
|
+
return false;
|
|
9099
|
+
const dependencies = resource.dependencies ??= [];
|
|
9100
|
+
const previous = asReference(currentConfiguration[metadata.property]);
|
|
9101
|
+
const previousKey = previous?.key;
|
|
9102
|
+
const isReferencedElsewhere = (key) => [
|
|
9103
|
+
...propertiesMetadata.values()
|
|
9104
|
+
].some((p) => isAnyReferenceProperty(p) && !isFileReferenceProperty(p) && typeof p["referenceKind"] == "string" && invariantEquals(p["referenceKind"], target.kind) && !invariantEquals(p.property, metadata.property) && asReferences(currentConfiguration[p.property]).some((r) => r.key !== undefined && invariantEquals(r.key, key)));
|
|
9105
|
+
if (previousKey && !invariantEquals(previousKey, target.key) && !isReferencedElsewhere(previousKey)) {
|
|
9106
|
+
const previousName = solution.resources.find((r) => invariantEquals(r.key, previousKey) && invariantEquals(r.kind, target.kind))?.name ?? previous?.name ?? "";
|
|
9107
|
+
resource.dependencies = dependencies.filter((d) => !(invariantEquals(d.kind, target.kind) && invariantEquals(d.name, previousName)));
|
|
9108
|
+
}
|
|
9109
|
+
if (!resource.dependencies.some((d) => invariantEquals(d.kind, target.kind) && invariantEquals(d.name, target.name)))
|
|
9110
|
+
resource.dependencies.push({
|
|
9111
|
+
kind: target.kind,
|
|
9112
|
+
name: target.name
|
|
9113
|
+
});
|
|
9114
|
+
currentConfiguration[metadata.property] = {
|
|
9115
|
+
name: target.name,
|
|
9116
|
+
key: target.key,
|
|
9117
|
+
folderKey: requested.folderKey ?? null,
|
|
9118
|
+
lookupStrategy: null,
|
|
9119
|
+
info: null
|
|
9120
|
+
};
|
|
9121
|
+
return true;
|
|
9122
|
+
}
|
|
8720
9123
|
async updateReferencesName(solutionDefinition, resource, oldName, cancellationToken) {
|
|
8721
9124
|
const resourcesToBeChanged = solutionDefinition.resources.filter((r) => r.key !== resource.key && (r.dependencies ?? []).some((d) => invariantEquals(d.kind, resource.kind) && invariantEquals(d.name, oldName)));
|
|
8722
9125
|
if (resourcesToBeChanged.length === 0)
|
|
@@ -9003,6 +9406,28 @@ class UpsertResourceSecretCommandHandler {
|
|
|
9003
9406
|
this.secretsProvider = secretsProvider;
|
|
9004
9407
|
}
|
|
9005
9408
|
}
|
|
9409
|
+
function asReference(value) {
|
|
9410
|
+
if (!value || typeof value != "object" || Array.isArray(value))
|
|
9411
|
+
return;
|
|
9412
|
+
const record = value;
|
|
9413
|
+
const pick = (name) => {
|
|
9414
|
+
const entry = Object.entries(record).find(([k]) => k.toLowerCase() === name.toLowerCase());
|
|
9415
|
+
return typeof entry?.[1] == "string" ? entry[1] : undefined;
|
|
9416
|
+
};
|
|
9417
|
+
return {
|
|
9418
|
+
key: pick("key"),
|
|
9419
|
+
name: pick("name"),
|
|
9420
|
+
folderKey: pick("folderKey")
|
|
9421
|
+
};
|
|
9422
|
+
}
|
|
9423
|
+
function asReferences(value) {
|
|
9424
|
+
if (Array.isArray(value))
|
|
9425
|
+
return value.map(asReference).filter((r) => r !== undefined);
|
|
9426
|
+
const single = asReference(value);
|
|
9427
|
+
return single ? [
|
|
9428
|
+
single
|
|
9429
|
+
] : [];
|
|
9430
|
+
}
|
|
9006
9431
|
|
|
9007
9432
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/handlers/solution-handlers.js
|
|
9008
9433
|
var DUPLICATE_NAMES_SUPPORTED_KINDS = new Set([
|
|
@@ -12251,7 +12676,16 @@ class AutomationSolutionsClientProxy2 {
|
|
|
12251
12676
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/clients/orchestrator/orchestrator-client.js
|
|
12252
12677
|
class OrchestratorClient {
|
|
12253
12678
|
async getPublishLocationsAsync(cancellationToken) {
|
|
12254
|
-
|
|
12679
|
+
return this.getPublishLocationsFromAsync(this.publishLocationsUrl(), cancellationToken);
|
|
12680
|
+
}
|
|
12681
|
+
async getAccessiblePublishLocationsAsync(permissionType, cancellationToken) {
|
|
12682
|
+
const url = `${this.publishLocationsUrl()}?permissionType=${encodeURIComponent(permissionType)}`;
|
|
12683
|
+
return this.getPublishLocationsFromAsync(url, cancellationToken);
|
|
12684
|
+
}
|
|
12685
|
+
publishLocationsUrl() {
|
|
12686
|
+
return `${this.options.baseUrl}api/v2/AutomationSolutions/publish_locations`;
|
|
12687
|
+
}
|
|
12688
|
+
async getPublishLocationsFromAsync(url, cancellationToken) {
|
|
12255
12689
|
const headers = OrchestratorClientFactory.buildHeaders(this.options.securityData);
|
|
12256
12690
|
const response = await fetch(url, {
|
|
12257
12691
|
method: "GET",
|
|
@@ -12941,7 +13375,7 @@ class ReconcileProjectsCommandHandler {
|
|
|
12941
13375
|
} : {
|
|
12942
13376
|
resourceKey: undefined
|
|
12943
13377
|
};
|
|
12944
|
-
await this.cacheProvider.setAsync(`prk:${projectKey}`, result, cancellationToken);
|
|
13378
|
+
await this.cacheProvider.setAsync(`prk:${context.path}:${projectKey}`, result, cancellationToken);
|
|
12945
13379
|
}
|
|
12946
13380
|
groupByProjectKey(artefactResources) {
|
|
12947
13381
|
const map = new Map;
|
|
@@ -13815,6 +14249,11 @@ class ResourceBuilder {
|
|
|
13815
14249
|
const request = new SolutionPublishLocationRequestV2;
|
|
13816
14250
|
return this._mediator.sendAsync(request, cancellationToken);
|
|
13817
14251
|
}
|
|
14252
|
+
async getAccessiblePublishLocationsAsync(permissionType, cancellationToken) {
|
|
14253
|
+
this.throwIfCancelled(cancellationToken);
|
|
14254
|
+
const request = new SolutionPublishLocationRequestV2(permissionType);
|
|
14255
|
+
return this._mediator.sendAsync(request, cancellationToken);
|
|
14256
|
+
}
|
|
13818
14257
|
async getSettingsAsync(cancellationToken) {
|
|
13819
14258
|
this.throwIfCancelled(cancellationToken);
|
|
13820
14259
|
const request = new SettingsRequest;
|
|
@@ -14374,9 +14813,9 @@ class UnconfiguredEmbeddedFileReader {
|
|
|
14374
14813
|
}
|
|
14375
14814
|
|
|
14376
14815
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/container.js
|
|
14377
|
-
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader, solutionContextOptions) {
|
|
14816
|
+
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader, solutionContextOptions, featureFlagProvider) {
|
|
14378
14817
|
const childContainer = import_tsyringe6.container.createChildContainer();
|
|
14379
|
-
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions);
|
|
14818
|
+
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions, featureFlagProvider);
|
|
14380
14819
|
registerServices(childContainer, embeddedFileReader);
|
|
14381
14820
|
registerHandlers(childContainer);
|
|
14382
14821
|
childContainer.register(ServiceTokens.Mediator, {
|
|
@@ -14400,11 +14839,15 @@ function registerProvider(diContainer, token, provider) {
|
|
|
14400
14839
|
break;
|
|
14401
14840
|
}
|
|
14402
14841
|
}
|
|
14403
|
-
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions) {
|
|
14842
|
+
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions, featureFlagProvider) {
|
|
14404
14843
|
registerProvider(diContainer, ServiceTokens.AccessProvider, accessProvider);
|
|
14405
14844
|
registerProvider(diContainer, ServiceTokens.CacheProvider, cacheProvider);
|
|
14406
14845
|
registerProvider(diContainer, ServiceTokens.SecretsProvider, secretsProvider);
|
|
14407
14846
|
registerProvider(diContainer, ServiceTokens.IpRangeBypassSecretProvider, ipRangeBypassSecretProvider);
|
|
14847
|
+
registerProvider(diContainer, ServiceTokens.FeatureFlagProvider, featureFlagProvider ?? {
|
|
14848
|
+
instance: new NullFeatureFlagProvider,
|
|
14849
|
+
lifetime: service_tokens_ServiceLifetime.Singleton
|
|
14850
|
+
});
|
|
14408
14851
|
registerProvider(diContainer, ServiceTokens.FileStorageProviderFactory, fileStorageProviderFactory);
|
|
14409
14852
|
registerProvider(diContainer, ServiceTokens.SolutionDefinitionProvider, solutionDefinitionProvider);
|
|
14410
14853
|
registerProvider(diContainer, ServiceTokens.SolutionDefinitionFactory, solutionDefinitionFactory);
|
|
@@ -14841,7 +15284,8 @@ function registerHandlers(diContainer) {
|
|
|
14841
15284
|
const mediator = c.resolve(ServiceTokens.Mediator);
|
|
14842
15285
|
const resourceOverwritesService = c.resolve(Tokens.IResourceOverwritesService);
|
|
14843
15286
|
const loggerFactory = c.resolve(ServiceTokens.LoggerFactory);
|
|
14844
|
-
|
|
15287
|
+
const featureFlagProvider = c.resolve(ServiceTokens.FeatureFlagProvider);
|
|
15288
|
+
return new BindingOverwritesHandler(mediator, resourceOverwritesService, loggerFactory, featureFlagProvider);
|
|
14845
15289
|
}
|
|
14846
15290
|
});
|
|
14847
15291
|
diContainer.register(createCommandHandlerToken(BindingOverwritesValidationCommand.name), {
|
|
@@ -14849,7 +15293,8 @@ function registerHandlers(diContainer) {
|
|
|
14849
15293
|
const mediator = c.resolve(ServiceTokens.Mediator);
|
|
14850
15294
|
const resourceOverwritesService = c.resolve(Tokens.IResourceOverwritesService);
|
|
14851
15295
|
const loggerFactory = c.resolve(ServiceTokens.LoggerFactory);
|
|
14852
|
-
|
|
15296
|
+
const featureFlagProvider = c.resolve(ServiceTokens.FeatureFlagProvider);
|
|
15297
|
+
return new BindingOverwritesHandler(mediator, resourceOverwritesService, loggerFactory, featureFlagProvider);
|
|
14853
15298
|
}
|
|
14854
15299
|
});
|
|
14855
15300
|
diContainer.register(createRequestHandlerToken(BindingOverwritesMappingRequest.name), {
|
|
@@ -15131,6 +15576,11 @@ class ResourceBuilderConfiguration {
|
|
|
15131
15576
|
this._ipRangeBypassSecretProviderLifetime = lifetime;
|
|
15132
15577
|
return this;
|
|
15133
15578
|
}
|
|
15579
|
+
addFeatureFlagProvider(provider, lifetime = service_tokens_ServiceLifetime.Scoped) {
|
|
15580
|
+
this._featureFlagProviderProvider = provider;
|
|
15581
|
+
this._featureFlagProviderLifetime = lifetime;
|
|
15582
|
+
return this;
|
|
15583
|
+
}
|
|
15134
15584
|
addSolutionDefinitionProvider(provider, lifetime = service_tokens_ServiceLifetime.Scoped) {
|
|
15135
15585
|
this._solutionDefinitionProviderProvider = provider;
|
|
15136
15586
|
this._solutionDefinitionProviderLifetime = lifetime;
|
|
@@ -15184,6 +15634,11 @@ class ResourceBuilderConfiguration {
|
|
|
15184
15634
|
instance: ipRangeBypassSecretProviderInstance,
|
|
15185
15635
|
lifetime: this._ipRangeBypassSecretProviderLifetime
|
|
15186
15636
|
};
|
|
15637
|
+
const featureFlagProviderInstance = this._featureFlagProviderProvider ? await resolveProvider(this._featureFlagProviderProvider) : new NullFeatureFlagProvider;
|
|
15638
|
+
const featureFlagProvider = {
|
|
15639
|
+
instance: featureFlagProviderInstance,
|
|
15640
|
+
lifetime: this._featureFlagProviderLifetime
|
|
15641
|
+
};
|
|
15187
15642
|
const secretsProviderInstance = this._secretsProviderProvider ? await resolveProvider(this._secretsProviderProvider) : new NullSecretsProvider;
|
|
15188
15643
|
const secretsProvider = {
|
|
15189
15644
|
instance: secretsProviderInstance,
|
|
@@ -15227,7 +15682,7 @@ class ResourceBuilderConfiguration {
|
|
|
15227
15682
|
lifetime: this._artifactResourceSpecEnhancerLifetime
|
|
15228
15683
|
};
|
|
15229
15684
|
const embeddedFileReader = await createDefaultEmbeddedFileReaderAsync();
|
|
15230
|
-
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions);
|
|
15685
|
+
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions, featureFlagProvider);
|
|
15231
15686
|
return new ResourceBuilderServices(container3);
|
|
15232
15687
|
}
|
|
15233
15688
|
async buildServices() {
|
|
@@ -15239,6 +15694,7 @@ class ResourceBuilderConfiguration {
|
|
|
15239
15694
|
this._secretsProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15240
15695
|
this._fileStorageProviderFactoryLifetime = service_tokens_ServiceLifetime.Singleton;
|
|
15241
15696
|
this._ipRangeBypassSecretProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15697
|
+
this._featureFlagProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15242
15698
|
this._solutionDefinitionProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15243
15699
|
this._solutionDefinitionFactoryLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15244
15700
|
this._artifactResourceSpecEnhancerLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
@@ -16384,12 +16840,12 @@ async function findResourceByKeyInRcs(builder, kind, expectedKey, folderPath, pr
|
|
|
16384
16840
|
return;
|
|
16385
16841
|
}
|
|
16386
16842
|
async function searchRcsResources(builder, kind, name) {
|
|
16387
|
-
const [searchError,
|
|
16843
|
+
const [searchError, matches2] = await catchError(searchRcsResourcesStrict(builder, kind, name));
|
|
16388
16844
|
if (searchError) {
|
|
16389
16845
|
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
16390
16846
|
return [];
|
|
16391
16847
|
}
|
|
16392
|
-
return
|
|
16848
|
+
return matches2;
|
|
16393
16849
|
}
|
|
16394
16850
|
async function searchRcsResourcesStrict(builder, kind, name) {
|
|
16395
16851
|
let pageCursor;
|
|
@@ -16397,8 +16853,8 @@ async function searchRcsResourcesStrict(builder, kind, name) {
|
|
|
16397
16853
|
do {
|
|
16398
16854
|
const result = await builder.searchResourcesAsync(kind, undefined, name, pageCursor, 50, undefined, false);
|
|
16399
16855
|
for (const folderResources of result.availableResources) {
|
|
16400
|
-
const
|
|
16401
|
-
for (const match of
|
|
16856
|
+
const matches2 = folderResources.resources.filter((r) => r.name.toLowerCase() === name.toLowerCase());
|
|
16857
|
+
for (const match of matches2) {
|
|
16402
16858
|
allMatches.push({
|
|
16403
16859
|
key: match.key,
|
|
16404
16860
|
name: match.name,
|
|
@@ -16970,4 +17426,4 @@ function sortKeysDeep(value) {
|
|
|
16970
17426
|
}
|
|
16971
17427
|
export { Tokens, models_BindingsResourceType, getResourceName, getFolderPathProperty, getResourceKindForBinding, assertSolutionManifest, computeEntryPointSpec, applyEntryPointEnhancementAsync, createResourceBuilderServices, findProjectFile, isProjectManifestError, isMissingProjectTypeError, readProjectFile, readSolutionFile, resolveSolutionFilePath, writeSolutionFile, restoreSolutionFile, createProjectInSolutionBuilder, normalizeFolderPath, findMatchingLocalResource, addProjectArtifactsToSolutionAsync, hasBareTemplateRow, hasAnyTemplateRow, getRemoteResourceClients, findCatalogEntityAsync, toResourceReference, exportResourceDefinitionAsync, readSpecProperty, saveCasingNormalized, normalizeResourceFileCasing, validateResourceName, formatResourceSubtypes, sameResourceSubtype, syncResourcesFromBindings, findResourceByKeyInRcs, searchRcsResources, findResourceInRcs, createResourceKindMetadataResolver, resolveResourceKindMetadata, createLocalResource, readUipxProjects, syncAndLog, resourceRefreshAsync, resourceRemoteSyncAsync };
|
|
16972
17428
|
|
|
16973
|
-
//# debugId=
|
|
17429
|
+
//# debugId=D75E94C9297A402C64756E2164756E21
|