@uipath/codedapp-tool 1.203.0-preview.203 → 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/THIRD-PARTY-NOTICES.md +40 -2
- package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
- package/dist/{index-6zef5vcv.js → index-1k95y97e.js} +432 -95
- package/dist/{index-8yrjtchg.js → index-gqak49gg.js} +6 -3
- package/dist/index.js +10 -9
- package/dist/{node-strategy-bpshtz02.js → node-strategy-gc4sg6a2.js} +6 -4
- package/dist/{packager-tool-qyctya2j.js → packager-tool-0v3s8r01.js} +2 -30
- package/dist/{packager-tool-shwgy5p6.js → packager-tool-7qmpp7hj.js} +701 -12638
- package/dist/{packager-tool-p1rgpgd7.js → packager-tool-kxgaaq38.js} +425 -125
- package/dist/packager-tool-qa9gftnj.js +31 -0
- package/dist/{packager-tool-bvm4jqr1.js → packager-tool-qc7sff2j.js} +27 -10
- package/dist/packager-tool-vxegnq74.js +340 -0
- package/dist/{packager-tool-f1ptyxe1.js → packager-tool-w5fry52f.js} +2436 -484
- package/dist/packager-tool.js +4 -3
- package/dist/tool.js +8 -7
- package/package.json +2 -2
- package/dist/packager-tool-aybzcdfg.js +0 -1514
|
@@ -2,27 +2,29 @@ import {
|
|
|
2
2
|
FirstPartyServiceApi
|
|
3
3
|
} from "./packager-tool-53w8skv5.js";
|
|
4
4
|
import {
|
|
5
|
-
addSdkUserAgentHeader,
|
|
6
|
-
catchError,
|
|
7
|
-
extractErrorMessage,
|
|
8
5
|
findSolutionFileUpward,
|
|
9
|
-
getSdkUserAgentToken,
|
|
10
|
-
installSdkUserAgentHeader,
|
|
11
|
-
isGuid,
|
|
12
|
-
logger,
|
|
13
6
|
normalizeProjectType,
|
|
14
7
|
toPortableRelativePath
|
|
15
|
-
} from "./packager-tool-
|
|
8
|
+
} from "./packager-tool-vxegnq74.js";
|
|
16
9
|
import {
|
|
17
10
|
getAuthContext,
|
|
18
11
|
getLoginStatusAsync
|
|
19
|
-
} from "./packager-tool-
|
|
12
|
+
} from "./packager-tool-qc7sff2j.js";
|
|
20
13
|
import"./packager-tool-0gctz400.js";
|
|
14
|
+
import"./packager-tool-qa9gftnj.js";
|
|
15
|
+
import"./packager-tool-yc4kw997.js";
|
|
16
|
+
import {
|
|
17
|
+
addSdkUserAgentHeader,
|
|
18
|
+
catchError,
|
|
19
|
+
extractErrorMessage,
|
|
20
|
+
getSdkUserAgentToken,
|
|
21
|
+
installSdkUserAgentHeader,
|
|
22
|
+
isGuid,
|
|
23
|
+
logger
|
|
24
|
+
} from "./packager-tool-w5fry52f.js";
|
|
21
25
|
import {
|
|
22
26
|
getFileSystem
|
|
23
|
-
} from "./packager-tool-
|
|
24
|
-
import"./packager-tool-yc4kw997.js";
|
|
25
|
-
import"./packager-tool-aybzcdfg.js";
|
|
27
|
+
} from "./packager-tool-0v3s8r01.js";
|
|
26
28
|
import {
|
|
27
29
|
JsonSerializerFactory,
|
|
28
30
|
JsonSerializerNames,
|
|
@@ -2396,7 +2398,6 @@ var require_cjs = __commonJS(function(exports) {
|
|
|
2396
2398
|
return dependency_container_1.instance;
|
|
2397
2399
|
} });
|
|
2398
2400
|
});
|
|
2399
|
-
|
|
2400
2401
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/file-storage-provider.js
|
|
2401
2402
|
function isFileNotFoundError(error) {
|
|
2402
2403
|
if (!error || typeof error != "object")
|
|
@@ -2448,7 +2449,6 @@ class InMemoryCacheProvider {
|
|
|
2448
2449
|
this._defaultTtlMs = defaultTtlMs;
|
|
2449
2450
|
}
|
|
2450
2451
|
}
|
|
2451
|
-
|
|
2452
2452
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/ip-range-bypass-secret-provider.js
|
|
2453
2453
|
class NullIpRangeBypassSecretProvider {
|
|
2454
2454
|
async getIpRangeBypassSecretAsync(_cancellationToken) {
|
|
@@ -2469,6 +2469,183 @@ class NullSecretsProvider {
|
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
2471
|
|
|
2472
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/timeout-exception.js
|
|
2473
|
+
class TimeoutException extends Error {
|
|
2474
|
+
constructor(message, timeoutMs) {
|
|
2475
|
+
super(message);
|
|
2476
|
+
this.name = "TimeoutException";
|
|
2477
|
+
this.timeoutMs = timeoutMs;
|
|
2478
|
+
if (Error.captureStackTrace)
|
|
2479
|
+
Error.captureStackTrace(this, TimeoutException);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/helpers/timeout.js
|
|
2484
|
+
function createTimeoutSignal(timeoutMs, description, linkedSignal) {
|
|
2485
|
+
const controller = new AbortController;
|
|
2486
|
+
let timeoutId;
|
|
2487
|
+
const dispose = () => {
|
|
2488
|
+
if (timeoutId !== undefined) {
|
|
2489
|
+
clearTimeout(timeoutId);
|
|
2490
|
+
timeoutId = undefined;
|
|
2491
|
+
}
|
|
2492
|
+
linkedSignal?.removeEventListener("abort", onLinkedAbort);
|
|
2493
|
+
};
|
|
2494
|
+
const onLinkedAbort = () => {
|
|
2495
|
+
dispose();
|
|
2496
|
+
controller.abort(linkedSignal?.reason);
|
|
2497
|
+
};
|
|
2498
|
+
if (linkedSignal?.aborted) {
|
|
2499
|
+
controller.abort(linkedSignal.reason);
|
|
2500
|
+
return {
|
|
2501
|
+
signal: controller.signal,
|
|
2502
|
+
dispose
|
|
2503
|
+
};
|
|
2504
|
+
}
|
|
2505
|
+
timeoutId = setTimeout(() => {
|
|
2506
|
+
dispose();
|
|
2507
|
+
controller.abort(new TimeoutException(`${description} timed out after ${timeoutMs}ms`, timeoutMs));
|
|
2508
|
+
}, timeoutMs);
|
|
2509
|
+
linkedSignal?.addEventListener("abort", onLinkedAbort, {
|
|
2510
|
+
once: true
|
|
2511
|
+
});
|
|
2512
|
+
return {
|
|
2513
|
+
signal: controller.signal,
|
|
2514
|
+
dispose
|
|
2515
|
+
};
|
|
2516
|
+
}
|
|
2517
|
+
var MAX_TIMEOUT_MS = 2147483647;
|
|
2518
|
+
function isValidTimeoutMs(value) {
|
|
2519
|
+
return typeof value == "number" && Number.isFinite(value) && value > 0 && value <= MAX_TIMEOUT_MS;
|
|
2520
|
+
}
|
|
2521
|
+
function readTimeoutOverrideMs(storageKey) {
|
|
2522
|
+
try {
|
|
2523
|
+
if ("u" < typeof localStorage)
|
|
2524
|
+
return;
|
|
2525
|
+
const raw = localStorage.getItem(storageKey);
|
|
2526
|
+
if (raw === null || raw.trim() === "")
|
|
2527
|
+
return;
|
|
2528
|
+
const parsed = Number(raw);
|
|
2529
|
+
return isValidTimeoutMs(parsed) ? parsed : undefined;
|
|
2530
|
+
} catch {
|
|
2531
|
+
return;
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/operation-cancelled-exception.js
|
|
2536
|
+
class OperationCancelledException extends Error {
|
|
2537
|
+
constructor(message, operationName) {
|
|
2538
|
+
super(message ?? "The operation was cancelled");
|
|
2539
|
+
this.name = "OperationCancelledException";
|
|
2540
|
+
this.operationName = operationName;
|
|
2541
|
+
if (Error.captureStackTrace)
|
|
2542
|
+
Error.captureStackTrace(this, OperationCancelledException);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/timeout-file-storage-provider.js
|
|
2547
|
+
class TimeoutFileStorageProvider2 {
|
|
2548
|
+
fileExistsAsync(path, cancellationToken) {
|
|
2549
|
+
return this.guard(`fileExists(${path})`, cancellationToken, (signal) => this.inner.fileExistsAsync(path, signal));
|
|
2550
|
+
}
|
|
2551
|
+
async openFileAsync(path, cancellationToken) {
|
|
2552
|
+
const stream = await this.guard(`openFile(${path})`, cancellationToken, (signal) => this.inner.openFileAsync(path, signal));
|
|
2553
|
+
return this.bindReadsToTimeout(stream, `read(${path})`, cancellationToken);
|
|
2554
|
+
}
|
|
2555
|
+
bindReadsToTimeout(stream, description, cancellationToken) {
|
|
2556
|
+
const reader = stream.getReader();
|
|
2557
|
+
return new ReadableStream({
|
|
2558
|
+
pull: async (controller) => {
|
|
2559
|
+
let result;
|
|
2560
|
+
try {
|
|
2561
|
+
result = await this.guard(description, cancellationToken, () => reader.read());
|
|
2562
|
+
} catch (error) {
|
|
2563
|
+
reader.cancel(error).catch(() => {});
|
|
2564
|
+
throw error;
|
|
2565
|
+
}
|
|
2566
|
+
if (result.done)
|
|
2567
|
+
controller.close();
|
|
2568
|
+
else
|
|
2569
|
+
controller.enqueue(result.value);
|
|
2570
|
+
},
|
|
2571
|
+
cancel: (reason) => reader.cancel(reason)
|
|
2572
|
+
});
|
|
2573
|
+
}
|
|
2574
|
+
readFileToEndAsync(path, cancellationToken) {
|
|
2575
|
+
return this.guard(`readFileToEnd(${path})`, cancellationToken, (signal) => this.inner.readFileToEndAsync(path, signal));
|
|
2576
|
+
}
|
|
2577
|
+
writeFileAsync(path, content, cancellationToken) {
|
|
2578
|
+
return this.guard(`writeFile(${path})`, cancellationToken, (signal) => this.inner.writeFileAsync(path, content, signal));
|
|
2579
|
+
}
|
|
2580
|
+
deleteFileAsync(path, cancellationToken) {
|
|
2581
|
+
return this.guard(`deleteFile(${path})`, cancellationToken, (signal) => this.inner.deleteFileAsync(path, signal));
|
|
2582
|
+
}
|
|
2583
|
+
getFilesAsync(path, searchPattern, cancellationToken) {
|
|
2584
|
+
return this.guard(`getFiles(${path ?? ""}, ${searchPattern ?? ""})`, cancellationToken, (signal) => this.inner.getFilesAsync(path, searchPattern, signal));
|
|
2585
|
+
}
|
|
2586
|
+
async guard(description, cancellationToken, operation) {
|
|
2587
|
+
const timeout = createTimeoutSignal(this.timeoutMs, `File storage operation ${description}`, cancellationToken);
|
|
2588
|
+
try {
|
|
2589
|
+
return await Promise.race([
|
|
2590
|
+
operation(timeout.signal),
|
|
2591
|
+
rejectOnAbort(timeout.signal)
|
|
2592
|
+
]);
|
|
2593
|
+
} catch (error) {
|
|
2594
|
+
if (cancellationToken?.aborted)
|
|
2595
|
+
throw cancellationToken.reason instanceof OperationCancelledException ? cancellationToken.reason : new OperationCancelledException(undefined, description);
|
|
2596
|
+
if (timeout.signal.aborted && timeout.signal.reason instanceof TimeoutException)
|
|
2597
|
+
throw timeout.signal.reason;
|
|
2598
|
+
throw error;
|
|
2599
|
+
} finally {
|
|
2600
|
+
timeout.dispose();
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
constructor(inner, timeoutMs) {
|
|
2604
|
+
this.inner = inner;
|
|
2605
|
+
this.timeoutMs = timeoutMs;
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
function rejectOnAbort(signal) {
|
|
2609
|
+
return new Promise((_, reject) => {
|
|
2610
|
+
if (signal.aborted)
|
|
2611
|
+
return void reject(signal.reason);
|
|
2612
|
+
signal.addEventListener("abort", () => reject(signal.reason), {
|
|
2613
|
+
once: true
|
|
2614
|
+
});
|
|
2615
|
+
});
|
|
2616
|
+
}
|
|
2617
|
+
function withFileOperationTimeout2(provider, timeoutMs) {
|
|
2618
|
+
if (!isValidTimeoutMs(timeoutMs) || provider instanceof TimeoutFileStorageProvider2)
|
|
2619
|
+
return provider;
|
|
2620
|
+
return new TimeoutFileStorageProvider2(provider, timeoutMs);
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/solution-context-options.js
|
|
2624
|
+
var DEFAULT_SOLUTION_CONTEXT_OPTIONS = {
|
|
2625
|
+
lockTimeoutMs: 30000,
|
|
2626
|
+
fileOperationTimeoutMs: 30000
|
|
2627
|
+
};
|
|
2628
|
+
var SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY = "SOL_RB_SOLUTION_CONTEXT_TIMEOUT_MS";
|
|
2629
|
+
var FILE_OPERATION_TIMEOUT_STORAGE_KEY = "SOL_RB_FILE_OPERATION_TIMEOUT_MS";
|
|
2630
|
+
function resolveTimeoutMs(storageKey, configured, fallback) {
|
|
2631
|
+
const override = readTimeoutOverrideMs(storageKey);
|
|
2632
|
+
if (override !== undefined)
|
|
2633
|
+
return override;
|
|
2634
|
+
return isValidTimeoutMs(configured) ? configured : fallback;
|
|
2635
|
+
}
|
|
2636
|
+
function resolveLockTimeoutMs(options) {
|
|
2637
|
+
return resolveTimeoutMs(SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY, options?.lockTimeoutMs, DEFAULT_SOLUTION_CONTEXT_OPTIONS.lockTimeoutMs);
|
|
2638
|
+
}
|
|
2639
|
+
function resolveFileOperationTimeoutMs(options) {
|
|
2640
|
+
return resolveTimeoutMs(FILE_OPERATION_TIMEOUT_STORAGE_KEY, options?.fileOperationTimeoutMs, DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs);
|
|
2641
|
+
}
|
|
2642
|
+
function mergeSolutionContextOptions(options) {
|
|
2643
|
+
return {
|
|
2644
|
+
lockTimeoutMs: isValidTimeoutMs(options?.lockTimeoutMs) ? options.lockTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.lockTimeoutMs,
|
|
2645
|
+
fileOperationTimeoutMs: isValidTimeoutMs(options?.fileOperationTimeoutMs) ? options.fileOperationTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs
|
|
2646
|
+
};
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2472
2649
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/models.js
|
|
2473
2650
|
var SolutionConstants = {
|
|
2474
2651
|
RESOURCE_FILES_FOLDER_NAME: "resources",
|
|
@@ -2603,17 +2780,6 @@ class DisconnectedException extends Error {
|
|
|
2603
2780
|
}
|
|
2604
2781
|
}
|
|
2605
2782
|
|
|
2606
|
-
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/operation-cancelled-exception.js
|
|
2607
|
-
class OperationCancelledException extends Error {
|
|
2608
|
-
constructor(message, operationName) {
|
|
2609
|
-
super(message ?? "The operation was cancelled");
|
|
2610
|
-
this.name = "OperationCancelledException";
|
|
2611
|
-
this.operationName = operationName;
|
|
2612
|
-
if (Error.captureStackTrace)
|
|
2613
|
-
Error.captureStackTrace(this, OperationCancelledException);
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
|
|
2617
2783
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/invalid-operation-exception.js
|
|
2618
2784
|
class InvalidOperationException extends Error {
|
|
2619
2785
|
constructor(message) {
|
|
@@ -3278,10 +3444,14 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3278
3444
|
this._jsonSerializer = this.jsonSerializerFactory.getByName(JsonSerializerNames.CamelCaseIndented);
|
|
3279
3445
|
return this._jsonSerializer;
|
|
3280
3446
|
}
|
|
3447
|
+
async getFileStorageProviderAsync(context, cancellationToken) {
|
|
3448
|
+
const provider = await this.fileStorageProviderFactory.getProviderAsync(context, cancellationToken);
|
|
3449
|
+
return withFileOperationTimeout2(provider, resolveFileOperationTimeoutMs(this.options));
|
|
3450
|
+
}
|
|
3281
3451
|
async readAsync(context, cancellationToken) {
|
|
3282
3452
|
this.logger.info("Reading multi-file solution definition for solution %s", context.path);
|
|
3283
3453
|
const solutionKey = this.getSolutionKey(context);
|
|
3284
|
-
const fileStorageProvider = await this.
|
|
3454
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
3285
3455
|
const resources = [];
|
|
3286
3456
|
const solutionFiles = [];
|
|
3287
3457
|
let hashes;
|
|
@@ -3357,6 +3527,12 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3357
3527
|
invalidFiles.push(resourceFile);
|
|
3358
3528
|
}
|
|
3359
3529
|
} catch (ex) {
|
|
3530
|
+
if (ex instanceof OperationCancelledException || cancellationToken?.aborted) {
|
|
3531
|
+
this.logger.warn("Operation cancelled while reading file %s for solution %s", resourceFile, context.path);
|
|
3532
|
+
throw ex instanceof OperationCancelledException ? ex : new OperationCancelledException;
|
|
3533
|
+
}
|
|
3534
|
+
if (ex instanceof TimeoutException)
|
|
3535
|
+
throw new TimeoutException(`Reading resource file ${resourceFile} for solution ${context.path} timed out: ${ex.message}`, ex.timeoutMs);
|
|
3360
3536
|
if (isFileNotFoundError(ex)) {
|
|
3361
3537
|
this.logger.warn("Resource file listed but missing in storage for solution %s: %s", resourceFile, context.path);
|
|
3362
3538
|
missingFiles.push(resourceFile);
|
|
@@ -3409,7 +3585,7 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3409
3585
|
async writeAsync(context, solution, cancellationToken) {
|
|
3410
3586
|
if (context.isReadOnly)
|
|
3411
3587
|
return;
|
|
3412
|
-
const fileStorageProvider = await this.
|
|
3588
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
3413
3589
|
const existingHashes = this.getHashes(context);
|
|
3414
3590
|
const existingPaths = this.getPaths(context);
|
|
3415
3591
|
const existingTree = this.getTree(context);
|
|
@@ -3484,7 +3660,7 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3484
3660
|
async deleteFilesAsync(context, filesToDelete, cancellationToken) {
|
|
3485
3661
|
if (!filesToDelete || filesToDelete.length === 0 || context.isReadOnly)
|
|
3486
3662
|
return;
|
|
3487
|
-
const fileStorageProvider = await this.
|
|
3663
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
3488
3664
|
for (const file of filesToDelete)
|
|
3489
3665
|
try {
|
|
3490
3666
|
const outputPath = this.joinPath("resourceFiles", file.name);
|
|
@@ -3681,7 +3857,8 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3681
3857
|
const hex = Math.abs(hash).toString(16).padStart(8, "0");
|
|
3682
3858
|
return `${hex.slice(0, 8)}-${hex.slice(0, 4)}-4${hex.slice(1, 4)}-8${hex.slice(1, 4)}-${hex.slice(0, 12).padEnd(12, "0")}`;
|
|
3683
3859
|
}
|
|
3684
|
-
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory) {
|
|
3860
|
+
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory, options) {
|
|
3861
|
+
this.options = options;
|
|
3685
3862
|
this._caseInsensitiveSerializer = null;
|
|
3686
3863
|
this._jsonSerializer = null;
|
|
3687
3864
|
this.fileStorageProviderFactory = fileStorageProviderFactory;
|
|
@@ -3694,12 +3871,13 @@ MultiFileSolutionDefinitionProvider.INVALID_FILE_NAME_CHARS = /[<>:"/\\|?*\x00-\
|
|
|
3694
3871
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/multi-file-solution-definition-factory.js
|
|
3695
3872
|
class MultiFileSolutionDefinitionFactory {
|
|
3696
3873
|
async getProviderAsync(cancellationToken) {
|
|
3697
|
-
return new MultiFileSolutionDefinitionProvider(this.fileStorageProviderFactory, this.jsonSerializerFactory, this.loggerFactory);
|
|
3874
|
+
return new MultiFileSolutionDefinitionProvider(this.fileStorageProviderFactory, this.jsonSerializerFactory, this.loggerFactory, this.options);
|
|
3698
3875
|
}
|
|
3699
|
-
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory) {
|
|
3876
|
+
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory, options) {
|
|
3700
3877
|
this.fileStorageProviderFactory = fileStorageProviderFactory;
|
|
3701
3878
|
this.jsonSerializerFactory = jsonSerializerFactory;
|
|
3702
3879
|
this.loggerFactory = loggerFactory;
|
|
3880
|
+
this.options = options;
|
|
3703
3881
|
this.logger = loggerFactory.create("MultiFileSolutionDefinitionFactory");
|
|
3704
3882
|
}
|
|
3705
3883
|
}
|
|
@@ -3707,7 +3885,7 @@ class MultiFileSolutionDefinitionFactory {
|
|
|
3707
3885
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/embedded-files-default.js
|
|
3708
3886
|
async function createDefaultEmbeddedFileReaderAsync() {
|
|
3709
3887
|
const [{ EmbeddedFileReader }, { JsonSerializerFactory: JsonSerializerFactory2 }] = await Promise.all([
|
|
3710
|
-
import("./embedded-file-reader-
|
|
3888
|
+
import("./embedded-file-reader-v8c2yj2a.js"),
|
|
3711
3889
|
import("./index-kmp9fmhb.js")
|
|
3712
3890
|
]);
|
|
3713
3891
|
return new EmbeddedFileReader(new JsonSerializerFactory2);
|
|
@@ -3740,7 +3918,8 @@ var ServiceTokens = {
|
|
|
3740
3918
|
JsonSerializerFactory: "IJsonSerializerFactory",
|
|
3741
3919
|
SerializerProxy: "ISerializerProxy",
|
|
3742
3920
|
StreamSerializer: "IStreamSerializer",
|
|
3743
|
-
HttpReaderOptions: "HttpReaderOptions"
|
|
3921
|
+
HttpReaderOptions: "HttpReaderOptions",
|
|
3922
|
+
SolutionContextOptions: "SolutionContextOptions"
|
|
3744
3923
|
};
|
|
3745
3924
|
var Tokens = {
|
|
3746
3925
|
IMediator: "IMediator",
|
|
@@ -4306,7 +4485,8 @@ class BindingOverwritesHandler {
|
|
|
4306
4485
|
[BindingsKnownKeys.FolderKeyPropertyName]: resourceOverwrite.folderKey ?? ""
|
|
4307
4486
|
};
|
|
4308
4487
|
else {
|
|
4309
|
-
const
|
|
4488
|
+
const isBusinessRule = bindingResource.binding.resourceType === models_BindingsResourceType.BusinessRule;
|
|
4489
|
+
const folderPath = bindingResource.isArtefactResource && !isBusinessRule ? "" : resourceOverwrite.folderFullyQualifiedName ?? "";
|
|
4310
4490
|
overwrite = {
|
|
4311
4491
|
[BindingsKnownKeys.FolderPathPropertyName]: folderPath,
|
|
4312
4492
|
[BindingsKnownKeys.NamePropertyName]: resourceOverwrite.resourceName
|
|
@@ -4464,42 +4644,6 @@ class AsyncSemaphore {
|
|
|
4464
4644
|
this._permits = permits;
|
|
4465
4645
|
}
|
|
4466
4646
|
}
|
|
4467
|
-
function createTimeoutSignal(timeoutMs, linkedSignal) {
|
|
4468
|
-
const controller = new AbortController;
|
|
4469
|
-
const timeoutId = setTimeout(() => {
|
|
4470
|
-
controller.abort(new Error(`Operation timed out after ${timeoutMs}ms`));
|
|
4471
|
-
}, timeoutMs);
|
|
4472
|
-
if (linkedSignal)
|
|
4473
|
-
if (linkedSignal.aborted) {
|
|
4474
|
-
clearTimeout(timeoutId);
|
|
4475
|
-
controller.abort(linkedSignal.reason);
|
|
4476
|
-
} else
|
|
4477
|
-
linkedSignal.addEventListener("abort", () => {
|
|
4478
|
-
clearTimeout(timeoutId);
|
|
4479
|
-
controller.abort(linkedSignal.reason);
|
|
4480
|
-
}, {
|
|
4481
|
-
signal: controller.signal
|
|
4482
|
-
});
|
|
4483
|
-
controller.signal.addEventListener("abort", () => {
|
|
4484
|
-
clearTimeout(timeoutId);
|
|
4485
|
-
});
|
|
4486
|
-
return controller.signal;
|
|
4487
|
-
}
|
|
4488
|
-
var DEFAULT_TIMEOUT_MS = 5000;
|
|
4489
|
-
var SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY = "SOL_RB_SOLUTION_CONTEXT_TIMEOUT_MS";
|
|
4490
|
-
function getLockTimeoutMs() {
|
|
4491
|
-
try {
|
|
4492
|
-
if ("u" < typeof localStorage)
|
|
4493
|
-
return DEFAULT_TIMEOUT_MS;
|
|
4494
|
-
const raw = localStorage.getItem(SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY);
|
|
4495
|
-
if (raw === null || raw.trim() === "")
|
|
4496
|
-
return DEFAULT_TIMEOUT_MS;
|
|
4497
|
-
const parsed = Number(raw);
|
|
4498
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_TIMEOUT_MS;
|
|
4499
|
-
} catch {
|
|
4500
|
-
return DEFAULT_TIMEOUT_MS;
|
|
4501
|
-
}
|
|
4502
|
-
}
|
|
4503
4647
|
|
|
4504
4648
|
class SolutionContext {
|
|
4505
4649
|
get isLoaded() {
|
|
@@ -4627,30 +4771,42 @@ class SolutionContext {
|
|
|
4627
4771
|
throw new FileDependencyNotFoundException(missingFileDependencies);
|
|
4628
4772
|
}
|
|
4629
4773
|
async doWithLockAsync(doWork, cancellationToken) {
|
|
4630
|
-
const
|
|
4631
|
-
|
|
4774
|
+
const lockTimeoutMs = resolveLockTimeoutMs(this._options);
|
|
4775
|
+
const lockTimeout = createTimeoutSignal(lockTimeoutMs, `Waiting for the lock on solution ${this.path}`, cancellationToken);
|
|
4776
|
+
try {
|
|
4777
|
+
await this._semaphore.acquire(lockTimeout.signal);
|
|
4778
|
+
} catch (error) {
|
|
4779
|
+
if (!cancellationToken?.aborted && lockTimeout.signal.reason instanceof TimeoutException)
|
|
4780
|
+
throw lockTimeout.signal.reason;
|
|
4781
|
+
throw error;
|
|
4782
|
+
} finally {
|
|
4783
|
+
lockTimeout.dispose();
|
|
4784
|
+
}
|
|
4632
4785
|
try {
|
|
4633
|
-
return await doWork(
|
|
4786
|
+
return await doWork(cancellationToken);
|
|
4634
4787
|
} finally {
|
|
4635
4788
|
this._semaphore.release();
|
|
4636
4789
|
}
|
|
4637
4790
|
}
|
|
4638
|
-
constructor(path, isReadOnlyOrProvider,
|
|
4791
|
+
constructor(path, isReadOnlyOrProvider, definitionProviderOrOptions, options) {
|
|
4639
4792
|
this._definition = null;
|
|
4640
4793
|
this._semaphore = new AsyncSemaphore(1);
|
|
4641
4794
|
this._items = {};
|
|
4642
4795
|
this._persistChanges = true;
|
|
4643
4796
|
ArgumentException.throwIfNullOrEmpty(path, "path");
|
|
4644
4797
|
if (typeof isReadOnlyOrProvider == "boolean") {
|
|
4798
|
+
const definitionProvider = definitionProviderOrOptions;
|
|
4645
4799
|
ArgumentException.throwIfNull(definitionProvider, "definitionProvider");
|
|
4646
4800
|
this.path = path;
|
|
4647
4801
|
this.isReadOnly = isReadOnlyOrProvider;
|
|
4648
4802
|
this._definitionProvider = definitionProvider;
|
|
4803
|
+
this._options = options;
|
|
4649
4804
|
} else {
|
|
4650
4805
|
ArgumentException.throwIfNull(isReadOnlyOrProvider, "definitionProvider");
|
|
4651
4806
|
this.path = path;
|
|
4652
4807
|
this.isReadOnly = false;
|
|
4653
4808
|
this._definitionProvider = isReadOnlyOrProvider;
|
|
4809
|
+
this._options = definitionProviderOrOptions;
|
|
4654
4810
|
}
|
|
4655
4811
|
}
|
|
4656
4812
|
}
|
|
@@ -4661,7 +4817,8 @@ class SolutionContextFactory {
|
|
|
4661
4817
|
ArgumentException.throwIfNullOrEmpty(path, "path");
|
|
4662
4818
|
const solutionDefinitionFactory = this._container.resolve(Tokens.ISolutionDefinitionFactory);
|
|
4663
4819
|
const solutionDefinitionProvider = await solutionDefinitionFactory.getProviderAsync(cancellationToken);
|
|
4664
|
-
|
|
4820
|
+
const options = this._container.isRegistered(ServiceTokens.SolutionContextOptions, true) ? this._container.resolve(ServiceTokens.SolutionContextOptions) : undefined;
|
|
4821
|
+
return new SolutionContext(path, isReadOnly, solutionDefinitionProvider, options);
|
|
4665
4822
|
}
|
|
4666
4823
|
constructor(_container) {
|
|
4667
4824
|
this._container = _container;
|
|
@@ -5683,7 +5840,13 @@ var solutionsSubtypesMap = {
|
|
|
5683
5840
|
Api: "api",
|
|
5684
5841
|
Function: "function",
|
|
5685
5842
|
McpServer: "mcpserver",
|
|
5686
|
-
BusinessRule: "businessRule"
|
|
5843
|
+
BusinessRule: "businessRule",
|
|
5844
|
+
Native: "native",
|
|
5845
|
+
Federated: "federated",
|
|
5846
|
+
Case: "case",
|
|
5847
|
+
CaseMain: "caseMain",
|
|
5848
|
+
CaseComment: "caseComment",
|
|
5849
|
+
CaseDocument: "caseDocument"
|
|
5687
5850
|
};
|
|
5688
5851
|
function mapResourceToSolutionSubtype(entitySubtype) {
|
|
5689
5852
|
if (!entitySubtype)
|
|
@@ -14114,9 +14277,9 @@ class UnconfiguredEmbeddedFileReader {
|
|
|
14114
14277
|
}
|
|
14115
14278
|
|
|
14116
14279
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/container.js
|
|
14117
|
-
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader) {
|
|
14280
|
+
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader, solutionContextOptions) {
|
|
14118
14281
|
const childContainer = import_tsyringe6.container.createChildContainer();
|
|
14119
|
-
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory);
|
|
14282
|
+
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions);
|
|
14120
14283
|
registerServices(childContainer, embeddedFileReader);
|
|
14121
14284
|
registerHandlers(childContainer);
|
|
14122
14285
|
childContainer.register(ServiceTokens.Mediator, {
|
|
@@ -14140,7 +14303,7 @@ function registerProvider(diContainer, token, provider) {
|
|
|
14140
14303
|
break;
|
|
14141
14304
|
}
|
|
14142
14305
|
}
|
|
14143
|
-
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory) {
|
|
14306
|
+
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions) {
|
|
14144
14307
|
registerProvider(diContainer, ServiceTokens.AccessProvider, accessProvider);
|
|
14145
14308
|
registerProvider(diContainer, ServiceTokens.CacheProvider, cacheProvider);
|
|
14146
14309
|
registerProvider(diContainer, ServiceTokens.SecretsProvider, secretsProvider);
|
|
@@ -14155,6 +14318,7 @@ function registerProviders(diContainer, accessProvider, cacheProvider, secretsPr
|
|
|
14155
14318
|
...httpReaderOptions
|
|
14156
14319
|
};
|
|
14157
14320
|
diContainer.registerInstance(ServiceTokens.HttpReaderOptions, mergedOptions);
|
|
14321
|
+
diContainer.registerInstance(ServiceTokens.SolutionContextOptions, mergeSolutionContextOptions(solutionContextOptions));
|
|
14158
14322
|
}
|
|
14159
14323
|
function registerServices(diContainer, embeddedFileReader) {
|
|
14160
14324
|
diContainer.register(ServiceTokens.AutomationSolutionsClientProxy, {
|
|
@@ -14889,6 +15053,10 @@ class ResourceBuilderConfiguration {
|
|
|
14889
15053
|
this._httpReaderOptions = options;
|
|
14890
15054
|
return this;
|
|
14891
15055
|
}
|
|
15056
|
+
addSolutionContextOptions(options) {
|
|
15057
|
+
this._solutionContextOptions = options;
|
|
15058
|
+
return this;
|
|
15059
|
+
}
|
|
14892
15060
|
addLoggerFactory(factoryProvider, lifetime = service_tokens_ServiceLifetime.Singleton) {
|
|
14893
15061
|
this._loggerFactoryProvider = factoryProvider;
|
|
14894
15062
|
this._loggerFactoryLifetime = lifetime;
|
|
@@ -14953,7 +15121,7 @@ class ResourceBuilderConfiguration {
|
|
|
14953
15121
|
};
|
|
14954
15122
|
} else if (!solutionDefinitionProvider && fileStorageProviderFactory)
|
|
14955
15123
|
solutionDefinitionFactory = {
|
|
14956
|
-
instance: new MultiFileSolutionDefinitionFactory(fileStorageProviderFactory.instance, new JsonSerializerFactory, loggerFactoryInstance),
|
|
15124
|
+
instance: new MultiFileSolutionDefinitionFactory(fileStorageProviderFactory.instance, new JsonSerializerFactory, loggerFactoryInstance, this._solutionContextOptions),
|
|
14957
15125
|
lifetime: service_tokens_ServiceLifetime.Scoped
|
|
14958
15126
|
};
|
|
14959
15127
|
const artifactResourceSpecEnhancerInstance = this._artifactResourceSpecEnhancerProvider ? await this.resolveGenericProvider(this._artifactResourceSpecEnhancerProvider) : new DefaultArtifactResourceSpecEnhancer;
|
|
@@ -14962,7 +15130,7 @@ class ResourceBuilderConfiguration {
|
|
|
14962
15130
|
lifetime: this._artifactResourceSpecEnhancerLifetime
|
|
14963
15131
|
};
|
|
14964
15132
|
const embeddedFileReader = await createDefaultEmbeddedFileReaderAsync();
|
|
14965
|
-
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader);
|
|
15133
|
+
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions);
|
|
14966
15134
|
return new ResourceBuilderServices(container3);
|
|
14967
15135
|
}
|
|
14968
15136
|
async buildServices() {
|
|
@@ -14983,7 +15151,6 @@ class ResourceBuilderConfiguration {
|
|
|
14983
15151
|
function createResourceBuilderConfiguration() {
|
|
14984
15152
|
return new ResourceBuilderConfiguration;
|
|
14985
15153
|
}
|
|
14986
|
-
|
|
14987
15154
|
// ../solution-sdk/src/resources/services/solution-manifest.ts
|
|
14988
15155
|
async function assertSolutionManifest(dir) {
|
|
14989
15156
|
const fs = getFileSystem();
|
|
@@ -15339,7 +15506,7 @@ class CliResourceBuilderLoggerFactory {
|
|
|
15339
15506
|
}
|
|
15340
15507
|
|
|
15341
15508
|
// ../orchestrator-sdk/generated/src/runtime.ts
|
|
15342
|
-
var BASE_PATH = "https://alpha.uipath.com/
|
|
15509
|
+
var BASE_PATH = "https://alpha.uipath.com/Ada/byoa/orchestrator_".replace(/\/+$/, "");
|
|
15343
15510
|
|
|
15344
15511
|
class Configuration {
|
|
15345
15512
|
configuration;
|
|
@@ -15592,7 +15759,7 @@ var package_default = {
|
|
|
15592
15759
|
name: "@uipath/orchestrator-sdk",
|
|
15593
15760
|
author: "UiPath",
|
|
15594
15761
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
15595
|
-
version: "1.
|
|
15762
|
+
version: "1.204.0",
|
|
15596
15763
|
repository: {
|
|
15597
15764
|
type: "git",
|
|
15598
15765
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -17144,6 +17311,12 @@ async function createApiClient(ApiClass, options) {
|
|
|
17144
17311
|
const config = await createOrchestratorConfig(options);
|
|
17145
17312
|
return new ApiClass(config);
|
|
17146
17313
|
}
|
|
17314
|
+
// ../orchestrator-sdk/src/knowledge-bundles.ts
|
|
17315
|
+
var KB_INLINE_LIMITS = {
|
|
17316
|
+
maxObjectBytes: 16 * 1024 * 1024,
|
|
17317
|
+
maxBodyBytes: 100 * 1024 * 1024,
|
|
17318
|
+
maxParts: 1e4
|
|
17319
|
+
};
|
|
17147
17320
|
// ../solution-sdk/src/resources/providers/solution-access-provider.ts
|
|
17148
17321
|
var ORG_SCOPED_SERVICES = new Set(["apps", "authz"]);
|
|
17149
17322
|
|
|
@@ -17458,6 +17631,81 @@ function hasAnyTemplateRow(projectType) {
|
|
|
17458
17631
|
return key === wanted || key.startsWith(`${wanted}_`);
|
|
17459
17632
|
});
|
|
17460
17633
|
}
|
|
17634
|
+
// ../solution-sdk/src/resources/services/remote-resources.ts
|
|
17635
|
+
function getRemoteResourceClients(services) {
|
|
17636
|
+
return {
|
|
17637
|
+
catalog: services.container.resolve(Tokens.IResourceCatalogClientProxy),
|
|
17638
|
+
importer: services.container.resolve(Tokens.IImportResourceHelper)
|
|
17639
|
+
};
|
|
17640
|
+
}
|
|
17641
|
+
async function findCatalogEntityAsync(catalog, query, match) {
|
|
17642
|
+
let pageCursor;
|
|
17643
|
+
do {
|
|
17644
|
+
const page = await catalog.searchFolderEntities({
|
|
17645
|
+
...query,
|
|
17646
|
+
pageSize: 100,
|
|
17647
|
+
pageCursor
|
|
17648
|
+
});
|
|
17649
|
+
const found = (page.items ?? []).find(match);
|
|
17650
|
+
if (found) {
|
|
17651
|
+
return found;
|
|
17652
|
+
}
|
|
17653
|
+
pageCursor = page.nextPage ?? undefined;
|
|
17654
|
+
} while (pageCursor);
|
|
17655
|
+
return;
|
|
17656
|
+
}
|
|
17657
|
+
function toResourceReference(entity) {
|
|
17658
|
+
return toCatalogReference({
|
|
17659
|
+
kind: entity.entityType ?? "",
|
|
17660
|
+
type: entity.entitySubType ?? undefined,
|
|
17661
|
+
key: entity.entityKey ?? "",
|
|
17662
|
+
name: entity.entityName ?? undefined,
|
|
17663
|
+
folderPath: entity.fullyQualifiedName ?? undefined,
|
|
17664
|
+
folderKey: entity.folderKey ?? undefined
|
|
17665
|
+
});
|
|
17666
|
+
}
|
|
17667
|
+
function toCatalogReference(reference) {
|
|
17668
|
+
const { folderPath, folderKey, ...rest } = reference;
|
|
17669
|
+
return {
|
|
17670
|
+
...rest,
|
|
17671
|
+
folder: folderPath ? { fullyQualifiedName: folderPath, folderKey } : undefined
|
|
17672
|
+
};
|
|
17673
|
+
}
|
|
17674
|
+
async function exportResourceDefinitionAsync(importer, reference) {
|
|
17675
|
+
const payload = await importer.exportResourceAsync(reference);
|
|
17676
|
+
return payload.resourceDefinitions.find((d) => d.key === reference.key);
|
|
17677
|
+
}
|
|
17678
|
+
function readSpecProperty(spec, name) {
|
|
17679
|
+
if (!spec) {
|
|
17680
|
+
return;
|
|
17681
|
+
}
|
|
17682
|
+
if (spec[name] !== undefined) {
|
|
17683
|
+
return spec[name];
|
|
17684
|
+
}
|
|
17685
|
+
const lower = name.toLowerCase();
|
|
17686
|
+
const key = Object.keys(spec).find((k) => k.toLowerCase() === lower);
|
|
17687
|
+
return key === undefined ? undefined : spec[key];
|
|
17688
|
+
}
|
|
17689
|
+
function readSpecEntryPoints(spec) {
|
|
17690
|
+
const entryPoints = parseJsonString(readSpecProperty(spec, "entryPoints"));
|
|
17691
|
+
if (!Array.isArray(entryPoints) || !entryPoints.every((entry) => entry !== null && typeof entry === "object")) {
|
|
17692
|
+
return;
|
|
17693
|
+
}
|
|
17694
|
+
return entryPoints.map((entry) => ({
|
|
17695
|
+
UniqueId: String(readSpecProperty(entry, "uniqueId") ?? ""),
|
|
17696
|
+
Path: String(readSpecProperty(entry, "path") ?? ""),
|
|
17697
|
+
DisplayName: String(readSpecProperty(entry, "displayName") ?? ""),
|
|
17698
|
+
InputArguments: readSpecProperty(entry, "inputArguments"),
|
|
17699
|
+
OutputArguments: readSpecProperty(entry, "outputArguments")
|
|
17700
|
+
}));
|
|
17701
|
+
}
|
|
17702
|
+
function parseJsonString(raw) {
|
|
17703
|
+
if (typeof raw !== "string") {
|
|
17704
|
+
return raw;
|
|
17705
|
+
}
|
|
17706
|
+
const [error, parsed] = catchError(() => JSON.parse(raw));
|
|
17707
|
+
return error ? undefined : parsed;
|
|
17708
|
+
}
|
|
17461
17709
|
// ../solution-sdk/src/resources/services/resource-casing.ts
|
|
17462
17710
|
var RESOURCE_FILES_FOLDER_NAME = "resources";
|
|
17463
17711
|
function lowerFirstChar(value) {
|
|
@@ -17615,6 +17863,47 @@ function parseResourceHeader(content) {
|
|
|
17615
17863
|
return null;
|
|
17616
17864
|
}
|
|
17617
17865
|
}
|
|
17866
|
+
// ../solution-sdk/src/resources/services/resource-name.ts
|
|
17867
|
+
var MAX_RESOURCE_NAME_LENGTH = 256;
|
|
17868
|
+
var UNSAFE_NAME_CHARS = /[\\/:*?"<>|]/;
|
|
17869
|
+
function hasControlChar(value) {
|
|
17870
|
+
for (let i = 0;i < value.length; i++) {
|
|
17871
|
+
if (value.charCodeAt(i) < 32)
|
|
17872
|
+
return true;
|
|
17873
|
+
}
|
|
17874
|
+
return false;
|
|
17875
|
+
}
|
|
17876
|
+
function validateResourceName(name, options = {}) {
|
|
17877
|
+
const optionName = options.optionName ?? "--name";
|
|
17878
|
+
if (name.trim() === "") {
|
|
17879
|
+
return {
|
|
17880
|
+
ok: false,
|
|
17881
|
+
message: `${optionName} must not be blank`,
|
|
17882
|
+
instructions: "Pass a non-empty resource name."
|
|
17883
|
+
};
|
|
17884
|
+
}
|
|
17885
|
+
if (name.length > MAX_RESOURCE_NAME_LENGTH) {
|
|
17886
|
+
return {
|
|
17887
|
+
ok: false,
|
|
17888
|
+
message: `${optionName} exceeds the ${MAX_RESOURCE_NAME_LENGTH}-character limit (got ${name.length})`,
|
|
17889
|
+
instructions: "Shorten the resource name. Orchestrator name limits are kind-specific (queues cap at 50, assets at 256)."
|
|
17890
|
+
};
|
|
17891
|
+
}
|
|
17892
|
+
if (UNSAFE_NAME_CHARS.test(name) || hasControlChar(name)) {
|
|
17893
|
+
return {
|
|
17894
|
+
ok: false,
|
|
17895
|
+
message: `${optionName} contains unsafe characters`,
|
|
17896
|
+
instructions: 'Resource names cannot contain path separators (/, \\), control characters, or any of: : * ? " < > |'
|
|
17897
|
+
};
|
|
17898
|
+
}
|
|
17899
|
+
return { ok: true };
|
|
17900
|
+
}
|
|
17901
|
+
function assertValidResourceName(name, options = {}) {
|
|
17902
|
+
const result = validateResourceName(name, options);
|
|
17903
|
+
if (!result.ok) {
|
|
17904
|
+
throw new Error(`${result.message}. ${result.instructions}`);
|
|
17905
|
+
}
|
|
17906
|
+
}
|
|
17618
17907
|
// ../solution-sdk/src/solution-auth.ts
|
|
17619
17908
|
async function getSolutionAuthContext(options) {
|
|
17620
17909
|
const ctx = await getAuthContext({
|
|
@@ -17631,11 +17920,15 @@ async function getSolutionAuthContext(options) {
|
|
|
17631
17920
|
accessToken: ctx.accessToken,
|
|
17632
17921
|
basePath,
|
|
17633
17922
|
organizationId,
|
|
17634
|
-
tenantName
|
|
17923
|
+
tenantName,
|
|
17924
|
+
identity: ctx.identity
|
|
17635
17925
|
};
|
|
17636
17926
|
}
|
|
17637
|
-
|
|
17638
17927
|
// ../solution-sdk/src/resources/services/sync-resources-from-bindings.ts
|
|
17928
|
+
var TYPE_IS_IDENTITY_REPLACE_OPTIONS = new Set([
|
|
17929
|
+
"SameType",
|
|
17930
|
+
"SameNameAndType"
|
|
17931
|
+
]);
|
|
17639
17932
|
var BINDINGS_JSON_FALLBACK_TYPES = new Set(["agent", "function"]);
|
|
17640
17933
|
function placeholderForType(type) {
|
|
17641
17934
|
switch ((type ?? "string").toLowerCase()) {
|
|
@@ -17665,7 +17958,7 @@ async function buildKindResolver(metadataReader) {
|
|
|
17665
17958
|
byKind.set(key, list);
|
|
17666
17959
|
}
|
|
17667
17960
|
return async (kind, type) => {
|
|
17668
|
-
const cacheKey = `${kind}|${type
|
|
17961
|
+
const cacheKey = (type === undefined ? kind : `${kind}|${type}`).toLowerCase();
|
|
17669
17962
|
if (cache.has(cacheKey))
|
|
17670
17963
|
return cache.get(cacheKey);
|
|
17671
17964
|
const list = byKind.get(kind.toLowerCase());
|
|
@@ -17673,7 +17966,9 @@ async function buildKindResolver(metadataReader) {
|
|
|
17673
17966
|
cache.set(cacheKey, undefined);
|
|
17674
17967
|
return;
|
|
17675
17968
|
}
|
|
17676
|
-
const
|
|
17969
|
+
const subtypes = list.flatMap((r) => r.type ? [r.type] : []);
|
|
17970
|
+
const matched = type === undefined ? undefined : findSubtypeEntry(list, type);
|
|
17971
|
+
const entry = matched ?? list[0];
|
|
17677
17972
|
const version = entry.versions?.[0];
|
|
17678
17973
|
const requiredDefaults = [];
|
|
17679
17974
|
for (const prop of version?.spec ?? []) {
|
|
@@ -17692,16 +17987,35 @@ async function buildKindResolver(metadataReader) {
|
|
|
17692
17987
|
}
|
|
17693
17988
|
}
|
|
17694
17989
|
}
|
|
17990
|
+
const takesFreeFormType = type !== undefined && type.trim() !== "" && subtypes.length === 0 && TYPE_IS_IDENTITY_REPLACE_OPTIONS.has(String(version?.replaceOption));
|
|
17695
17991
|
const resolved = {
|
|
17696
17992
|
type: entry.type,
|
|
17697
17993
|
virtualizable: version?.supportsInLineCreation ?? false,
|
|
17698
17994
|
requiredDefaults,
|
|
17699
|
-
specProperties
|
|
17995
|
+
specProperties,
|
|
17996
|
+
subtypes,
|
|
17997
|
+
typeMatched: type === undefined || matched !== undefined || takesFreeFormType
|
|
17700
17998
|
};
|
|
17701
17999
|
cache.set(cacheKey, resolved);
|
|
17702
18000
|
return resolved;
|
|
17703
18001
|
};
|
|
17704
18002
|
}
|
|
18003
|
+
function formatResourceSubtypes(subtypes) {
|
|
18004
|
+
return subtypes.map((subtype) => {
|
|
18005
|
+
const alias = mapSolutionToResourceSubtype(subtype);
|
|
18006
|
+
return alias && alias.toLowerCase() !== subtype.toLowerCase() ? `${subtype} (${alias})` : subtype;
|
|
18007
|
+
}).join(", ");
|
|
18008
|
+
}
|
|
18009
|
+
function sameResourceSubtype(a, b) {
|
|
18010
|
+
if (a === undefined || b === undefined)
|
|
18011
|
+
return false;
|
|
18012
|
+
if (a.toLowerCase() === b.toLowerCase())
|
|
18013
|
+
return true;
|
|
18014
|
+
return mapSolutionToResourceSubtype(a)?.toLowerCase() === mapSolutionToResourceSubtype(b)?.toLowerCase();
|
|
18015
|
+
}
|
|
18016
|
+
function findSubtypeEntry(list, type) {
|
|
18017
|
+
return list.find((r) => !!r.type && sameResourceSubtype(r.type, type));
|
|
18018
|
+
}
|
|
17705
18019
|
function resolveBindingResourceIdentity(binding) {
|
|
17706
18020
|
switch (binding.resourceType) {
|
|
17707
18021
|
case models_BindingsResourceType.TimeTrigger:
|
|
@@ -18014,14 +18328,18 @@ async function findResourceByKeyInRcs(builder, kind, expectedKey, folderPath, pr
|
|
|
18014
18328
|
return;
|
|
18015
18329
|
}
|
|
18016
18330
|
async function searchRcsResources(builder, kind, name) {
|
|
18331
|
+
const [searchError, matches] = await catchError(searchRcsResourcesStrict(builder, kind, name));
|
|
18332
|
+
if (searchError) {
|
|
18333
|
+
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
18334
|
+
return [];
|
|
18335
|
+
}
|
|
18336
|
+
return matches;
|
|
18337
|
+
}
|
|
18338
|
+
async function searchRcsResourcesStrict(builder, kind, name) {
|
|
18017
18339
|
let pageCursor;
|
|
18018
18340
|
const allMatches = [];
|
|
18019
18341
|
do {
|
|
18020
|
-
const
|
|
18021
|
-
if (searchError) {
|
|
18022
|
-
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
18023
|
-
return [];
|
|
18024
|
-
}
|
|
18342
|
+
const result = await builder.searchResourcesAsync(kind, undefined, name, pageCursor, 50, undefined, false);
|
|
18025
18343
|
for (const folderResources of result.availableResources) {
|
|
18026
18344
|
const matches = folderResources.resources.filter((r) => r.name.toLowerCase() === name.toLowerCase());
|
|
18027
18345
|
for (const match of matches) {
|
|
@@ -18075,7 +18393,13 @@ async function resolveResourceKindMetadata(services, kind, type) {
|
|
|
18075
18393
|
}
|
|
18076
18394
|
async function createLocalResource(params) {
|
|
18077
18395
|
const { builder, services, kind, type, name } = params;
|
|
18396
|
+
if (type !== undefined && type.trim() === "") {
|
|
18397
|
+
throw new Error(`Type for kind ${kind} is empty.`);
|
|
18398
|
+
}
|
|
18078
18399
|
const metadata = await resolveResourceKindMetadata(services, kind, type);
|
|
18400
|
+
if (type !== undefined && metadata && !metadata.typeMatched) {
|
|
18401
|
+
throw new Error(metadata.subtypes.length > 0 ? `Unknown type "${type}" for kind ${kind}. Use one of: ${formatResourceSubtypes(metadata.subtypes)}` : `Kind ${kind} has no subtypes, so type "${type}" does not apply.`);
|
|
18402
|
+
}
|
|
18079
18403
|
const minted = await mintVirtualResource(builder, kind, metadata?.type ?? type, name, metadata);
|
|
18080
18404
|
if (!minted?.resource)
|
|
18081
18405
|
return;
|
|
@@ -18500,21 +18824,27 @@ function sortKeysDeep(value) {
|
|
|
18500
18824
|
}
|
|
18501
18825
|
export {
|
|
18502
18826
|
EntryPointSpecEnhancer,
|
|
18827
|
+
MAX_RESOURCE_NAME_LENGTH,
|
|
18503
18828
|
ProjectManifestError,
|
|
18504
18829
|
addProjectArtifactsToSolutionAsync,
|
|
18505
18830
|
applyEntryPointEnhancementAsync,
|
|
18506
18831
|
assertSolutionManifest,
|
|
18832
|
+
assertValidResourceName,
|
|
18507
18833
|
computeEntryPointSpec,
|
|
18508
18834
|
createLocalResource,
|
|
18509
18835
|
createProjectInSolutionBuilder,
|
|
18510
18836
|
createResourceBuilderServices,
|
|
18511
18837
|
createResourceKindMetadataResolver,
|
|
18838
|
+
exportResourceDefinitionAsync,
|
|
18839
|
+
findCatalogEntityAsync,
|
|
18512
18840
|
findMatchingLocalResource,
|
|
18513
18841
|
findMatchingMemberResource,
|
|
18514
18842
|
findMemberCloneResources,
|
|
18515
18843
|
findProjectFile,
|
|
18516
18844
|
findResourceByKeyInRcs,
|
|
18517
18845
|
findResourceInRcs,
|
|
18846
|
+
formatResourceSubtypes,
|
|
18847
|
+
getRemoteResourceClients,
|
|
18518
18848
|
hasAnyTemplateRow,
|
|
18519
18849
|
hasBareTemplateRow,
|
|
18520
18850
|
isMissingProjectTypeError,
|
|
@@ -18525,6 +18855,8 @@ export {
|
|
|
18525
18855
|
readProjectFile,
|
|
18526
18856
|
readSolutionFile,
|
|
18527
18857
|
readSolutionManifest,
|
|
18858
|
+
readSpecEntryPoints,
|
|
18859
|
+
readSpecProperty,
|
|
18528
18860
|
readUipxProjects,
|
|
18529
18861
|
resolveProjectDirFromManifest,
|
|
18530
18862
|
resolveResourceKindMetadata,
|
|
@@ -18532,12 +18864,17 @@ export {
|
|
|
18532
18864
|
resourceRefreshAsync,
|
|
18533
18865
|
resourceRemoteSyncAsync,
|
|
18534
18866
|
restoreSolutionFile,
|
|
18867
|
+
sameResourceSubtype,
|
|
18535
18868
|
saveCasingNormalized,
|
|
18536
18869
|
searchRcsResources,
|
|
18870
|
+
searchRcsResourcesStrict,
|
|
18537
18871
|
syncAndLog,
|
|
18538
18872
|
syncResourcesFromBindings,
|
|
18873
|
+
toCatalogReference,
|
|
18874
|
+
toResourceReference,
|
|
18539
18875
|
uniqueNameForResource,
|
|
18876
|
+
validateResourceName,
|
|
18540
18877
|
writeSolutionFile
|
|
18541
18878
|
};
|
|
18542
18879
|
|
|
18543
|
-
//# debugId=
|
|
18880
|
+
//# debugId=1370ABDE7C4DB7E264756E2164756E21
|