@uipath/codedapp-tool 1.204.1 → 1.205.0-preview.258
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 +2 -2
- package/dist/{embedded-file-reader-v8c2yj2a.js → embedded-file-reader-r66242ey.js} +2 -2
- package/dist/{index-wj8fy4z0.js → index-0k30knwv.js} +1138 -2077
- package/dist/index-78bnpdqb.js +3177 -0
- package/dist/{index-y32y7rjh.js → index-wbp18pm0.js} +2 -2
- package/dist/index.js +8 -7
- package/dist/{node-strategy-0267x5e5.js → node-strategy-myagr1zp.js} +1 -1
- package/dist/packager-tool-5ebgtev7.js +22083 -0
- package/dist/{packager-tool-cfc7qtm7.js → packager-tool-cmfktvbt.js} +183 -1970
- package/dist/packager-tool-d94wjncg.js +1814 -0
- package/dist/{packager-tool-0v3s8r01.js → packager-tool-je2re4j6.js} +11 -1
- package/dist/{packager-tool-cakm5nqb.js → packager-tool-pxqgvv15.js} +159 -45
- package/dist/{packager-tool-nd0vpsgx.js → packager-tool-s8h46737.js} +124 -58
- package/dist/{packager-tool-zzg1ddjd.js → packager-tool-vc19fcdp.js} +4 -3
- package/dist/{packager-tool-j71fq5d5.js → packager-tool-wnkd40wj.js} +1650 -252
- package/dist/packager-tool.js +5 -4
- package/dist/tool.js +8 -7
- package/package.json +5 -2
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UsersApi,
|
|
3
|
+
createApiClient
|
|
4
|
+
} from "./packager-tool-5ebgtev7.js";
|
|
1
5
|
import {
|
|
2
6
|
JsonSerializerFactory,
|
|
3
7
|
JsonSerializerNames,
|
|
@@ -11,25 +15,23 @@ import {
|
|
|
11
15
|
findSolutionFileUpward,
|
|
12
16
|
normalizeProjectType,
|
|
13
17
|
toPortableRelativePath
|
|
14
|
-
} from "./packager-tool-
|
|
18
|
+
} from "./packager-tool-vc19fcdp.js";
|
|
15
19
|
import {
|
|
16
20
|
getAuthContext,
|
|
17
21
|
getLoginStatusAsync
|
|
18
|
-
} from "./packager-tool-
|
|
22
|
+
} from "./packager-tool-s8h46737.js";
|
|
23
|
+
import"./packager-tool-d94wjncg.js";
|
|
19
24
|
import {
|
|
20
|
-
addSdkUserAgentHeader,
|
|
21
25
|
catchError,
|
|
22
26
|
extractErrorMessage,
|
|
23
|
-
getSdkUserAgentToken,
|
|
24
|
-
installSdkUserAgentHeader,
|
|
25
27
|
isGuid,
|
|
26
28
|
logger
|
|
27
|
-
} from "./packager-tool-
|
|
29
|
+
} from "./packager-tool-cmfktvbt.js";
|
|
28
30
|
import"./packager-tool-0gctz400.js";
|
|
29
31
|
import"./packager-tool-qa9gftnj.js";
|
|
30
32
|
import {
|
|
31
33
|
getFileSystem
|
|
32
|
-
} from "./packager-tool-
|
|
34
|
+
} from "./packager-tool-je2re4j6.js";
|
|
33
35
|
import"./packager-tool-yc4kw997.js";
|
|
34
36
|
import {
|
|
35
37
|
__commonJS,
|
|
@@ -2469,6 +2471,19 @@ class NullSecretsProvider {
|
|
|
2469
2471
|
}
|
|
2470
2472
|
}
|
|
2471
2473
|
|
|
2474
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/feature-flag-provider.js
|
|
2475
|
+
class NullFeatureFlagProvider {
|
|
2476
|
+
getBool(_featureFlagName, defaultValue) {
|
|
2477
|
+
return defaultValue ?? false;
|
|
2478
|
+
}
|
|
2479
|
+
getInt(_featureFlagName, defaultValue) {
|
|
2480
|
+
return defaultValue ?? 0;
|
|
2481
|
+
}
|
|
2482
|
+
getString(_featureFlagName, defaultValue) {
|
|
2483
|
+
return defaultValue ?? "";
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2472
2487
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/timeout-exception.js
|
|
2473
2488
|
class TimeoutException extends Error {
|
|
2474
2489
|
constructor(message, timeoutMs) {
|
|
@@ -2623,10 +2638,12 @@ function withFileOperationTimeout2(provider, timeoutMs) {
|
|
|
2623
2638
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/solution-context-options.js
|
|
2624
2639
|
var DEFAULT_SOLUTION_CONTEXT_OPTIONS = {
|
|
2625
2640
|
lockTimeoutMs: 30000,
|
|
2626
|
-
fileOperationTimeoutMs: 30000
|
|
2641
|
+
fileOperationTimeoutMs: 30000,
|
|
2642
|
+
maxDegreeOfParallelism: 1
|
|
2627
2643
|
};
|
|
2628
2644
|
var SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY = "SOL_RB_SOLUTION_CONTEXT_TIMEOUT_MS";
|
|
2629
2645
|
var FILE_OPERATION_TIMEOUT_STORAGE_KEY = "SOL_RB_FILE_OPERATION_TIMEOUT_MS";
|
|
2646
|
+
var MAX_DEGREE_OF_PARALLELISM_STORAGE_KEY = "SOL_RB_MAX_DEGREE_OF_PARALLELISM";
|
|
2630
2647
|
function resolveTimeoutMs(storageKey, configured, fallback) {
|
|
2631
2648
|
const override = readTimeoutOverrideMs(storageKey);
|
|
2632
2649
|
if (override !== undefined)
|
|
@@ -2639,10 +2656,33 @@ function resolveLockTimeoutMs(options) {
|
|
|
2639
2656
|
function resolveFileOperationTimeoutMs(options) {
|
|
2640
2657
|
return resolveTimeoutMs(FILE_OPERATION_TIMEOUT_STORAGE_KEY, options?.fileOperationTimeoutMs, DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs);
|
|
2641
2658
|
}
|
|
2659
|
+
function isValidDegreeOfParallelism(value) {
|
|
2660
|
+
return typeof value == "number" && Number.isInteger(value) && value > 0;
|
|
2661
|
+
}
|
|
2662
|
+
function resolveMaxDegreeOfParallelism(options) {
|
|
2663
|
+
const override = readDegreeOfParallelismOverride(MAX_DEGREE_OF_PARALLELISM_STORAGE_KEY);
|
|
2664
|
+
if (override !== undefined)
|
|
2665
|
+
return override;
|
|
2666
|
+
return isValidDegreeOfParallelism(options?.maxDegreeOfParallelism) ? options.maxDegreeOfParallelism : DEFAULT_SOLUTION_CONTEXT_OPTIONS.maxDegreeOfParallelism;
|
|
2667
|
+
}
|
|
2668
|
+
function readDegreeOfParallelismOverride(storageKey) {
|
|
2669
|
+
try {
|
|
2670
|
+
if ("u" < typeof localStorage)
|
|
2671
|
+
return;
|
|
2672
|
+
const raw = localStorage.getItem(storageKey);
|
|
2673
|
+
if (raw === null || raw.trim() === "")
|
|
2674
|
+
return;
|
|
2675
|
+
const parsed = Number(raw);
|
|
2676
|
+
return isValidDegreeOfParallelism(parsed) ? parsed : undefined;
|
|
2677
|
+
} catch {
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2642
2681
|
function mergeSolutionContextOptions(options) {
|
|
2643
2682
|
return {
|
|
2644
2683
|
lockTimeoutMs: isValidTimeoutMs(options?.lockTimeoutMs) ? options.lockTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.lockTimeoutMs,
|
|
2645
|
-
fileOperationTimeoutMs: isValidTimeoutMs(options?.fileOperationTimeoutMs) ? options.fileOperationTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs
|
|
2684
|
+
fileOperationTimeoutMs: isValidTimeoutMs(options?.fileOperationTimeoutMs) ? options.fileOperationTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs,
|
|
2685
|
+
maxDegreeOfParallelism: isValidDegreeOfParallelism(options?.maxDegreeOfParallelism) ? options.maxDegreeOfParallelism : DEFAULT_SOLUTION_CONTEXT_OPTIONS.maxDegreeOfParallelism
|
|
2646
2686
|
};
|
|
2647
2687
|
}
|
|
2648
2688
|
|
|
@@ -3433,6 +3473,16 @@ function getRootFolder(solution) {
|
|
|
3433
3473
|
}
|
|
3434
3474
|
|
|
3435
3475
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/multi-file-solution-definition-provider.js
|
|
3476
|
+
function nowMs() {
|
|
3477
|
+
return globalThis.performance?.now?.() ?? Date.now();
|
|
3478
|
+
}
|
|
3479
|
+
function round1(ms) {
|
|
3480
|
+
return Math.round(10 * ms) / 10;
|
|
3481
|
+
}
|
|
3482
|
+
function cancellationError(signal) {
|
|
3483
|
+
return signal?.reason instanceof OperationCancelledException ? signal.reason : new OperationCancelledException;
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3436
3486
|
class MultiFileSolutionDefinitionProvider {
|
|
3437
3487
|
get caseInsensitiveSerializer() {
|
|
3438
3488
|
if (!this._caseInsensitiveSerializer)
|
|
@@ -3450,137 +3500,344 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
3450
3500
|
}
|
|
3451
3501
|
async readAsync(context, cancellationToken) {
|
|
3452
3502
|
this.logger.info("Reading multi-file solution definition for solution %s", context.path);
|
|
3453
|
-
const
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
let
|
|
3458
|
-
let
|
|
3459
|
-
|
|
3460
|
-
let
|
|
3461
|
-
|
|
3503
|
+
const loadStarted = nowMs();
|
|
3504
|
+
let fileCount = 0;
|
|
3505
|
+
let listMs = 0;
|
|
3506
|
+
let readStarted = loadStarted;
|
|
3507
|
+
let readWallMs = 0;
|
|
3508
|
+
let readCompleted = false;
|
|
3509
|
+
let ioMs = 0;
|
|
3510
|
+
let maxFileIoMs = 0;
|
|
3511
|
+
let parseMs = 0;
|
|
3512
|
+
let hashMs = 0;
|
|
3513
|
+
let chars = 0;
|
|
3514
|
+
let loadedCount = 0;
|
|
3462
3515
|
const parseErrors = [];
|
|
3463
3516
|
const missingFiles = [];
|
|
3464
3517
|
const invalidFiles = [];
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3518
|
+
let metricsLogged = false;
|
|
3519
|
+
const logReadMetrics = (outcome) => {
|
|
3520
|
+
metricsLogged = true;
|
|
3521
|
+
const totalMs = nowMs() - loadStarted;
|
|
3522
|
+
const mergeMs = readCompleted ? nowMs() - readStarted - readWallMs : 0;
|
|
3523
|
+
const metrics = {
|
|
3524
|
+
outcome,
|
|
3525
|
+
path: context.path,
|
|
3526
|
+
fileCount,
|
|
3527
|
+
totalMs: round1(totalMs),
|
|
3528
|
+
listMs: round1(listMs),
|
|
3529
|
+
readWallMs: round1(readWallMs),
|
|
3530
|
+
ioMs: round1(ioMs),
|
|
3531
|
+
maxFileIoMs: round1(maxFileIoMs),
|
|
3532
|
+
parseMs: round1(parseMs),
|
|
3533
|
+
hashMs: round1(hashMs),
|
|
3534
|
+
mergeMs: round1(mergeMs),
|
|
3535
|
+
chars,
|
|
3536
|
+
degreeOfParallelism: resolveMaxDegreeOfParallelism(this.options),
|
|
3537
|
+
isReadOnly: context.isReadOnly,
|
|
3538
|
+
loaded: loadedCount,
|
|
3539
|
+
missing: missingFiles.length,
|
|
3540
|
+
invalid: invalidFiles.length,
|
|
3541
|
+
parseErrors: parseErrors.length
|
|
3542
|
+
};
|
|
3543
|
+
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}`;
|
|
3544
|
+
if (outcome === "Success")
|
|
3545
|
+
this.logger.info(message, metrics);
|
|
3546
|
+
else
|
|
3547
|
+
this.logger.warn(message, metrics);
|
|
3548
|
+
};
|
|
3549
|
+
const readCore = async () => {
|
|
3550
|
+
const solutionKey = this.getSolutionKey(context);
|
|
3551
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
3552
|
+
const resources = [];
|
|
3553
|
+
const solutionFiles = [];
|
|
3554
|
+
let hashes;
|
|
3555
|
+
let paths;
|
|
3556
|
+
const pathsByKind = this.getPathsByKind(context);
|
|
3557
|
+
let tree;
|
|
3558
|
+
pathsByKind.clear();
|
|
3559
|
+
context.items[SolutionContextKeys.PARSE_ERRORS_ITEM_KEY] = parseErrors;
|
|
3560
|
+
if (!context.isReadOnly) {
|
|
3561
|
+
hashes = this.getHashes(context);
|
|
3562
|
+
paths = this.getPaths(context);
|
|
3563
|
+
tree = this.getTree(context);
|
|
3564
|
+
hashes.clear();
|
|
3565
|
+
paths.clear();
|
|
3566
|
+
tree.length = 0;
|
|
3567
|
+
}
|
|
3568
|
+
const listStarted = nowMs();
|
|
3569
|
+
const resourceFiles = await fileStorageProvider.getFilesAsync(SolutionConstants.RESOURCE_FILES_FOLDER_NAME, "*.json", cancellationToken);
|
|
3570
|
+
listMs = nowMs() - listStarted;
|
|
3571
|
+
fileCount = resourceFiles.length;
|
|
3572
|
+
readStarted = nowMs();
|
|
3573
|
+
const readResults = await this.readResourceFilesAsync(context, fileStorageProvider, resourceFiles, cancellationToken);
|
|
3574
|
+
readWallMs = nowMs() - readStarted;
|
|
3575
|
+
readCompleted = true;
|
|
3576
|
+
let fatal;
|
|
3577
|
+
let hasFatal = false;
|
|
3578
|
+
for (const result of readResults)
|
|
3579
|
+
if (result !== undefined) {
|
|
3580
|
+
if (result.timings) {
|
|
3581
|
+
ioMs += result.timings.ioMs;
|
|
3582
|
+
maxFileIoMs = Math.max(maxFileIoMs, result.timings.ioMs);
|
|
3583
|
+
parseMs += result.timings.parseMs;
|
|
3584
|
+
hashMs += result.timings.hashMs;
|
|
3585
|
+
chars += result.timings.chars;
|
|
3586
|
+
}
|
|
3587
|
+
if (result.fatal !== undefined) {
|
|
3588
|
+
if (!hasFatal) {
|
|
3589
|
+
fatal = result.fatal;
|
|
3590
|
+
hasFatal = true;
|
|
3502
3591
|
}
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3592
|
+
continue;
|
|
3593
|
+
}
|
|
3594
|
+
if (!hasFatal)
|
|
3595
|
+
switch (result.outcome) {
|
|
3596
|
+
case "loaded": {
|
|
3597
|
+
loadedCount++;
|
|
3598
|
+
const rd = result.resource;
|
|
3599
|
+
for (const file of result.files)
|
|
3600
|
+
if (!solutionFiles.some((sf) => sf.name === file.name && sf.kind === file.kind))
|
|
3601
|
+
solutionFiles.push(file);
|
|
3602
|
+
resources.push(rd);
|
|
3603
|
+
const resourceKey = rd.key;
|
|
3604
|
+
const normalizedFullPath = result.normalizedPath;
|
|
3605
|
+
if (!pathsByKind.has(rd.kind))
|
|
3606
|
+
pathsByKind.set(rd.kind, []);
|
|
3607
|
+
const kindPaths = pathsByKind.get(rd.kind);
|
|
3608
|
+
if (kindPaths)
|
|
3609
|
+
kindPaths.push({
|
|
3610
|
+
name: rd.name,
|
|
3611
|
+
key: rd.key,
|
|
3612
|
+
path: normalizedFullPath
|
|
3613
|
+
});
|
|
3614
|
+
if (!context.isReadOnly && hashes && paths) {
|
|
3615
|
+
paths.set(resourceKey, normalizedFullPath);
|
|
3616
|
+
hashes.set(resourceKey, result.hash);
|
|
3617
|
+
}
|
|
3618
|
+
break;
|
|
3507
3619
|
}
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3620
|
+
case "missing":
|
|
3621
|
+
missingFiles.push(result.file);
|
|
3622
|
+
break;
|
|
3623
|
+
case "invalid":
|
|
3624
|
+
invalidFiles.push(result.file);
|
|
3625
|
+
break;
|
|
3626
|
+
case "parseError":
|
|
3627
|
+
parseErrors.push(result.file);
|
|
3628
|
+
break;
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
if (hasFatal) {
|
|
3632
|
+
logReadMetrics("Fatal");
|
|
3633
|
+
throw fatal;
|
|
3634
|
+
}
|
|
3635
|
+
if (missingFiles.length > 0) {
|
|
3636
|
+
logReadMetrics("MissingFiles");
|
|
3637
|
+
throw new BadRequestException(ErrorCodes.Resources.MissingFileDependencies, `Solution has missing files: ${missingFiles.join(", ")}`);
|
|
3638
|
+
}
|
|
3639
|
+
if (invalidFiles.length > 0) {
|
|
3640
|
+
logReadMetrics("InvalidFiles");
|
|
3641
|
+
throw new BadRequestException(ErrorCodes.Resources.InvalidResourceFile, `Solution has resource files with invalid content: ${invalidFiles.join(", ")}`);
|
|
3642
|
+
}
|
|
3643
|
+
if (parseErrors.length > 0) {
|
|
3644
|
+
logReadMetrics("ParseErrors");
|
|
3645
|
+
throw new Error(`Failed to read resource files for solution ${context.path}: ${parseErrors.join(", ")}`);
|
|
3646
|
+
}
|
|
3647
|
+
const folderMap = new Map;
|
|
3648
|
+
const rootFolder = this.buildRootFolder(solutionKey, SolutionConstants.ROOT_FOLDER_NAME);
|
|
3649
|
+
folderMap.set(rootFolder.fullyQualifiedName.toLowerCase(), rootFolder);
|
|
3650
|
+
for (const res of resources)
|
|
3651
|
+
for (const fdep of res.folders ?? []) {
|
|
3652
|
+
const fqnLower = fdep.fullyQualifiedName.toLowerCase();
|
|
3653
|
+
if (!folderMap.has(fqnLower)) {
|
|
3654
|
+
const folderKey = this.generateGuidFromString(fdep.fullyQualifiedName);
|
|
3655
|
+
const pathSegments = fdep.fullyQualifiedName.split("/").filter((s) => s.length > 0).map((p) => {
|
|
3656
|
+
if (p.toLowerCase() !== SolutionConstants.ROOT_FOLDER_NAME.toLowerCase())
|
|
3657
|
+
return this.generateGuidFromString(SolutionConstants.ROOT_FOLDER_NAME);
|
|
3658
|
+
return rootFolder.key;
|
|
3659
|
+
});
|
|
3660
|
+
const folderPath = pathSegments.join(".");
|
|
3661
|
+
folderMap.set(fqnLower, {
|
|
3662
|
+
key: folderKey,
|
|
3663
|
+
fullyQualifiedName: fdep.fullyQualifiedName,
|
|
3664
|
+
path: folderPath
|
|
3520
3665
|
});
|
|
3521
|
-
if (!context.isReadOnly && hashes && paths) {
|
|
3522
|
-
paths.set(resourceKey, normalizedFullPath);
|
|
3523
|
-
hashes.set(resourceKey, await this.computeHash(content));
|
|
3524
3666
|
}
|
|
3525
|
-
} else {
|
|
3526
|
-
this.logger.error("Failed to read resource file %s for solution %s: invalid content", undefined, resourceFile, context.path);
|
|
3527
|
-
invalidFiles.push(resourceFile);
|
|
3528
|
-
}
|
|
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);
|
|
3536
|
-
if (isFileNotFoundError(ex)) {
|
|
3537
|
-
this.logger.warn("Resource file listed but missing in storage for solution %s: %s", resourceFile, context.path);
|
|
3538
|
-
missingFiles.push(resourceFile);
|
|
3539
|
-
} else {
|
|
3540
|
-
this.logger.error("Failed to read resource file %s for solution %s", ex, resourceFile, context.path);
|
|
3541
|
-
parseErrors.push(resourceFile);
|
|
3542
3667
|
}
|
|
3668
|
+
const solution = {
|
|
3669
|
+
key: solutionKey,
|
|
3670
|
+
docVersion: SolutionConstants.CURRENT_DOC_VERSION,
|
|
3671
|
+
folders: Array.from(folderMap.values()),
|
|
3672
|
+
resources,
|
|
3673
|
+
files: solutionFiles
|
|
3674
|
+
};
|
|
3675
|
+
await this.replaceDuplicateKeysAsync(solution, cancellationToken);
|
|
3676
|
+
if (!context.isReadOnly && tree) {
|
|
3677
|
+
const orderedResourceKeys = getTopologicalIdsOrdering(buildDependencyGraph(solution.resources));
|
|
3678
|
+
tree.push(...orderedResourceKeys);
|
|
3543
3679
|
}
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3680
|
+
logReadMetrics("Success");
|
|
3681
|
+
return solution;
|
|
3682
|
+
};
|
|
3683
|
+
try {
|
|
3684
|
+
return await readCore();
|
|
3685
|
+
} catch (ex) {
|
|
3686
|
+
if (!metricsLogged)
|
|
3687
|
+
logReadMetrics("Fatal");
|
|
3688
|
+
throw ex;
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
async readResourceFilesAsync(context, fileStorageProvider, resourceFiles, cancellationToken) {
|
|
3692
|
+
const results = Array.from({
|
|
3693
|
+
length: resourceFiles.length
|
|
3694
|
+
}, () => {
|
|
3695
|
+
return;
|
|
3696
|
+
});
|
|
3697
|
+
if (resourceFiles.length === 0)
|
|
3698
|
+
return results;
|
|
3699
|
+
const computeHash = !context.isReadOnly;
|
|
3700
|
+
const degreeOfParallelism = Math.min(resolveMaxDegreeOfParallelism(this.options), resourceFiles.length);
|
|
3701
|
+
let nextIndex = 0;
|
|
3702
|
+
let stopRequested = false;
|
|
3703
|
+
const runWorkerAsync = async () => {
|
|
3704
|
+
while (!stopRequested && nextIndex < resourceFiles.length) {
|
|
3705
|
+
const index = nextIndex++;
|
|
3706
|
+
const resourceFile = resourceFiles[index];
|
|
3707
|
+
const result = await this.readResourceFileAsync(context, fileStorageProvider, resourceFile, computeHash, cancellationToken);
|
|
3708
|
+
results[index] = result;
|
|
3709
|
+
if (result.fatal !== undefined)
|
|
3710
|
+
stopRequested = true;
|
|
3570
3711
|
}
|
|
3571
|
-
const solution = {
|
|
3572
|
-
key: solutionKey,
|
|
3573
|
-
docVersion: SolutionConstants.CURRENT_DOC_VERSION,
|
|
3574
|
-
folders: Array.from(folderMap.values()),
|
|
3575
|
-
resources,
|
|
3576
|
-
files: solutionFiles
|
|
3577
3712
|
};
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3713
|
+
const workers = [];
|
|
3714
|
+
for (let i = 0;i < degreeOfParallelism; i++)
|
|
3715
|
+
workers.push(runWorkerAsync());
|
|
3716
|
+
await Promise.all(workers);
|
|
3717
|
+
if (cancellationToken?.aborted && !results.some((result) => result?.fatal !== undefined))
|
|
3718
|
+
throw cancellationError(cancellationToken);
|
|
3719
|
+
return results;
|
|
3720
|
+
}
|
|
3721
|
+
async readResourceFileAsync(context, fileStorageProvider, resourceFile, computeHash, cancellationToken) {
|
|
3722
|
+
const started = nowMs();
|
|
3723
|
+
let ioMs;
|
|
3724
|
+
let content;
|
|
3725
|
+
const failureTimings = () => {
|
|
3726
|
+
const elapsed = nowMs() - started;
|
|
3727
|
+
return ioMs === undefined ? {
|
|
3728
|
+
ioMs: elapsed,
|
|
3729
|
+
parseMs: 0,
|
|
3730
|
+
hashMs: 0,
|
|
3731
|
+
chars: 0
|
|
3732
|
+
} : {
|
|
3733
|
+
ioMs,
|
|
3734
|
+
parseMs: elapsed - ioMs,
|
|
3735
|
+
hashMs: 0,
|
|
3736
|
+
chars: content?.length ?? 0
|
|
3737
|
+
};
|
|
3738
|
+
};
|
|
3739
|
+
try {
|
|
3740
|
+
if (cancellationToken?.aborted)
|
|
3741
|
+
throw cancellationError(cancellationToken);
|
|
3742
|
+
const stream = await fileStorageProvider.openFileAsync(resourceFile, cancellationToken);
|
|
3743
|
+
content = await this.streamToString(stream);
|
|
3744
|
+
ioMs = nowMs() - started;
|
|
3745
|
+
const parseStarted = nowMs();
|
|
3746
|
+
const wrapper = this.caseInsensitiveSerializer.deserialize(content);
|
|
3747
|
+
if (!wrapper?.resource) {
|
|
3748
|
+
this.logger.error("Failed to read resource file %s for solution %s: invalid content", undefined, resourceFile, context.path);
|
|
3749
|
+
return {
|
|
3750
|
+
file: resourceFile,
|
|
3751
|
+
outcome: "invalid",
|
|
3752
|
+
timings: failureTimings()
|
|
3753
|
+
};
|
|
3754
|
+
}
|
|
3755
|
+
const files = [];
|
|
3756
|
+
const rd = this.fromSerializable(wrapper.resource, files);
|
|
3757
|
+
this.applyFolders(rd, resourceFile);
|
|
3758
|
+
const parseMs = nowMs() - parseStarted;
|
|
3759
|
+
let hash;
|
|
3760
|
+
let hashMs = 0;
|
|
3761
|
+
if (computeHash) {
|
|
3762
|
+
const hashStarted = nowMs();
|
|
3763
|
+
hash = await this.computeHash(content);
|
|
3764
|
+
hashMs = nowMs() - hashStarted;
|
|
3765
|
+
}
|
|
3766
|
+
return {
|
|
3767
|
+
file: resourceFile,
|
|
3768
|
+
outcome: "loaded",
|
|
3769
|
+
resource: rd,
|
|
3770
|
+
files,
|
|
3771
|
+
normalizedPath: this.getNormalizedPath(resourceFile),
|
|
3772
|
+
hash,
|
|
3773
|
+
timings: {
|
|
3774
|
+
ioMs,
|
|
3775
|
+
parseMs,
|
|
3776
|
+
hashMs,
|
|
3777
|
+
chars: content.length
|
|
3778
|
+
}
|
|
3779
|
+
};
|
|
3780
|
+
} catch (ex) {
|
|
3781
|
+
if (ex instanceof OperationCancelledException || cancellationToken?.aborted) {
|
|
3782
|
+
this.logger.warn("Operation cancelled while reading file %s for solution %s", resourceFile, context.path);
|
|
3783
|
+
return {
|
|
3784
|
+
file: resourceFile,
|
|
3785
|
+
outcome: "fatal",
|
|
3786
|
+
fatal: ex instanceof OperationCancelledException ? ex : cancellationError(cancellationToken),
|
|
3787
|
+
timings: failureTimings()
|
|
3788
|
+
};
|
|
3789
|
+
}
|
|
3790
|
+
if (ex instanceof TimeoutException)
|
|
3791
|
+
return {
|
|
3792
|
+
file: resourceFile,
|
|
3793
|
+
outcome: "fatal",
|
|
3794
|
+
fatal: new TimeoutException(`Reading resource file ${resourceFile} for solution ${context.path} timed out: ${ex.message}`, ex.timeoutMs),
|
|
3795
|
+
timings: failureTimings()
|
|
3796
|
+
};
|
|
3797
|
+
if (isFileNotFoundError(ex)) {
|
|
3798
|
+
this.logger.warn("Resource file listed but missing in storage for solution %s: %s", resourceFile, context.path);
|
|
3799
|
+
return {
|
|
3800
|
+
file: resourceFile,
|
|
3801
|
+
outcome: "missing",
|
|
3802
|
+
timings: failureTimings()
|
|
3803
|
+
};
|
|
3804
|
+
}
|
|
3805
|
+
this.logger.error("Failed to read resource file %s for solution %s", ex, resourceFile, context.path);
|
|
3806
|
+
return {
|
|
3807
|
+
file: resourceFile,
|
|
3808
|
+
outcome: "parseError",
|
|
3809
|
+
timings: failureTimings()
|
|
3810
|
+
};
|
|
3582
3811
|
}
|
|
3583
|
-
|
|
3812
|
+
}
|
|
3813
|
+
applyFolders(resource, resourceFile) {
|
|
3814
|
+
const relPath = resourceFile.replace(/\\/g, "/");
|
|
3815
|
+
const segments = relPath.split("/").filter((s) => s.length > 0);
|
|
3816
|
+
const firstSegment = segments[0];
|
|
3817
|
+
if (segments.length >= 3 && firstSegment && firstSegment.toLowerCase() === SolutionConstants.RESOURCE_FILES_FOLDER_NAME.toLowerCase()) {
|
|
3818
|
+
const hasType = !!resource.type;
|
|
3819
|
+
const folderSegmentCount = hasType ? segments.length - 3 : segments.length - 2;
|
|
3820
|
+
if (folderSegmentCount < 1)
|
|
3821
|
+
resource.folders = [
|
|
3822
|
+
{
|
|
3823
|
+
fullyQualifiedName: SolutionConstants.ROOT_FOLDER_NAME
|
|
3824
|
+
}
|
|
3825
|
+
];
|
|
3826
|
+
else {
|
|
3827
|
+
const segmentsToUse = segments.slice(1, folderSegmentCount);
|
|
3828
|
+
const folderFqn = segmentsToUse.join("/");
|
|
3829
|
+
resource.folders = [
|
|
3830
|
+
{
|
|
3831
|
+
fullyQualifiedName: folderFqn
|
|
3832
|
+
}
|
|
3833
|
+
];
|
|
3834
|
+
}
|
|
3835
|
+
} else
|
|
3836
|
+
resource.folders = [
|
|
3837
|
+
{
|
|
3838
|
+
fullyQualifiedName: SolutionConstants.ROOT_FOLDER_NAME
|
|
3839
|
+
}
|
|
3840
|
+
];
|
|
3584
3841
|
}
|
|
3585
3842
|
async writeAsync(context, solution, cancellationToken) {
|
|
3586
3843
|
if (context.isReadOnly)
|
|
@@ -3885,7 +4142,7 @@ class MultiFileSolutionDefinitionFactory {
|
|
|
3885
4142
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/embedded-files-default.js
|
|
3886
4143
|
async function createDefaultEmbeddedFileReaderAsync() {
|
|
3887
4144
|
const [{ EmbeddedFileReader }, { JsonSerializerFactory: JsonSerializerFactory2 }] = await Promise.all([
|
|
3888
|
-
import("./embedded-file-reader-
|
|
4145
|
+
import("./embedded-file-reader-r66242ey.js"),
|
|
3889
4146
|
import("./index-kmp9fmhb.js")
|
|
3890
4147
|
]);
|
|
3891
4148
|
return new EmbeddedFileReader(new JsonSerializerFactory2);
|
|
@@ -3903,6 +4160,7 @@ var ServiceTokens = {
|
|
|
3903
4160
|
SecretsProvider: "ISecretsProvider",
|
|
3904
4161
|
FileStorageProviderFactory: "IFileStorageProviderFactory",
|
|
3905
4162
|
IpRangeBypassSecretProvider: "IIpRangeBypassSecretProvider",
|
|
4163
|
+
FeatureFlagProvider: "IFeatureFlagProvider",
|
|
3906
4164
|
SolutionDefinitionProvider: "ISolutionDefinitionProvider",
|
|
3907
4165
|
SolutionDefinitionFactory: "ISolutionDefinitionFactory",
|
|
3908
4166
|
ArtifactResourceSpecEnhancer: "IArtifactResourceSpecEnhancer",
|
|
@@ -4253,6 +4511,9 @@ function getBindingType(resourceKind, resourceType) {
|
|
|
4253
4511
|
}
|
|
4254
4512
|
|
|
4255
4513
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/bindings/bindings-metadata-serializer.js
|
|
4514
|
+
var SUPPORTED_SCHEMA_MAJOR_VERSION = 2;
|
|
4515
|
+
var INT32_MAX_VALUE = 2147483647;
|
|
4516
|
+
|
|
4256
4517
|
class BindingsMetadataSerializer {
|
|
4257
4518
|
tryDeserialize(input) {
|
|
4258
4519
|
if (!input)
|
|
@@ -4263,30 +4524,52 @@ class BindingsMetadataSerializer {
|
|
|
4263
4524
|
let cleanInput = input.charCodeAt(0) === 65279 ? input.slice(1) : input;
|
|
4264
4525
|
if (cleanInput.charCodeAt(cleanInput.length - 1) === 26)
|
|
4265
4526
|
cleanInput = cleanInput.slice(0, -1);
|
|
4266
|
-
const
|
|
4527
|
+
const root = JSON.parse(cleanInput);
|
|
4528
|
+
if (root === null || typeof root != "object" || Array.isArray(root)) {
|
|
4529
|
+
this.logger.warn("Invalid bindings: content is not a JSON object");
|
|
4530
|
+
return {
|
|
4531
|
+
success: false
|
|
4532
|
+
};
|
|
4533
|
+
}
|
|
4534
|
+
const jsonObject = root;
|
|
4267
4535
|
const versionValue = jsonObject[BindingsKnownKeys.Version];
|
|
4268
|
-
if (
|
|
4536
|
+
if (typeof versionValue != "string") {
|
|
4537
|
+
this.logger.warn(`Invalid bindings: '${BindingsKnownKeys.Version}' is missing or not a string`);
|
|
4538
|
+
return {
|
|
4539
|
+
success: false
|
|
4540
|
+
};
|
|
4541
|
+
}
|
|
4542
|
+
const majorVersion = BindingsMetadataSerializer.tryParseMajorVersion(versionValue);
|
|
4543
|
+
if (majorVersion === undefined) {
|
|
4544
|
+
this.logger.warn(`Invalid bindings: '${BindingsKnownKeys.Version}' is not a valid version`);
|
|
4545
|
+
return {
|
|
4546
|
+
success: false
|
|
4547
|
+
};
|
|
4548
|
+
}
|
|
4549
|
+
if (majorVersion !== SUPPORTED_SCHEMA_MAJOR_VERSION) {
|
|
4550
|
+
this.logger.warn(`Invalid bindings: unsupported schema major version ${majorVersion}`);
|
|
4551
|
+
return {
|
|
4552
|
+
success: false
|
|
4553
|
+
};
|
|
4554
|
+
}
|
|
4555
|
+
const resources = jsonObject[BindingsKnownKeys.Resources];
|
|
4556
|
+
if (!Array.isArray(resources)) {
|
|
4557
|
+
this.logger.warn(`Invalid bindings: '${BindingsKnownKeys.Resources}' is missing or not an array`);
|
|
4269
4558
|
return {
|
|
4270
4559
|
success: false
|
|
4271
4560
|
};
|
|
4272
|
-
|
|
4273
|
-
const majorVersion = versionParts[0];
|
|
4274
|
-
if (majorVersion !== 2)
|
|
4275
|
-
throw new Error("Unsupported bindings schema");
|
|
4561
|
+
}
|
|
4276
4562
|
const metadata = {
|
|
4277
4563
|
version: versionValue,
|
|
4278
4564
|
resources: []
|
|
4279
4565
|
};
|
|
4280
|
-
const resources
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
this.logger.warn("Skipping null bindings resource element");
|
|
4285
|
-
continue;
|
|
4286
|
-
}
|
|
4287
|
-
const resource = this.getBindingsResourceV2(resourceElement);
|
|
4288
|
-
metadata.resources.push(resource);
|
|
4566
|
+
for (const resourceElement of resources) {
|
|
4567
|
+
if (resourceElement == null) {
|
|
4568
|
+
this.logger.warn("Skipping null bindings resource element");
|
|
4569
|
+
continue;
|
|
4289
4570
|
}
|
|
4571
|
+
metadata.resources.push(this.getBindingsResourceV2(resourceElement));
|
|
4572
|
+
}
|
|
4290
4573
|
this.linkDependencies(metadata.resources);
|
|
4291
4574
|
return {
|
|
4292
4575
|
success: true,
|
|
@@ -4299,6 +4582,22 @@ class BindingsMetadataSerializer {
|
|
|
4299
4582
|
};
|
|
4300
4583
|
}
|
|
4301
4584
|
}
|
|
4585
|
+
static tryParseMajorVersion(value) {
|
|
4586
|
+
const parts = value.split(".");
|
|
4587
|
+
if (parts.length < 2 || parts.length > 4)
|
|
4588
|
+
return;
|
|
4589
|
+
let major;
|
|
4590
|
+
for (const [index, part] of parts.entries()) {
|
|
4591
|
+
if (!/^\s*[+-]?\d+\s*$/.test(part))
|
|
4592
|
+
return;
|
|
4593
|
+
const component = Number(part);
|
|
4594
|
+
if (component < 0 || component > INT32_MAX_VALUE)
|
|
4595
|
+
return;
|
|
4596
|
+
if (index === 0)
|
|
4597
|
+
major = component === 0 ? 0 : component;
|
|
4598
|
+
}
|
|
4599
|
+
return major;
|
|
4600
|
+
}
|
|
4302
4601
|
linkDependencies(resources) {
|
|
4303
4602
|
for (const resource of resources) {
|
|
4304
4603
|
const propertyMeta = resource.metadata;
|
|
@@ -4485,8 +4784,7 @@ class BindingOverwritesHandler {
|
|
|
4485
4784
|
[BindingsKnownKeys.FolderKeyPropertyName]: resourceOverwrite.folderKey ?? ""
|
|
4486
4785
|
};
|
|
4487
4786
|
else {
|
|
4488
|
-
const
|
|
4489
|
-
const folderPath = bindingResource.isArtefactResource && !isBusinessRule ? "" : resourceOverwrite.folderFullyQualifiedName ?? "";
|
|
4787
|
+
const folderPath = bindingResource.isArtefactResource && !bindingResource.isCodedApp ? "" : resourceOverwrite.folderFullyQualifiedName ?? "";
|
|
4490
4788
|
overwrite = {
|
|
4491
4789
|
[BindingsKnownKeys.FolderPathPropertyName]: folderPath,
|
|
4492
4790
|
[BindingsKnownKeys.NamePropertyName]: resourceOverwrite.resourceName
|
|
@@ -4519,6 +4817,11 @@ function removeTimeTriggerBindings(bindings) {
|
|
|
4519
4817
|
}
|
|
4520
4818
|
|
|
4521
4819
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/bindings/binding-overwrites-mapping-handler.js
|
|
4820
|
+
function isCodedAppType(type) {
|
|
4821
|
+
const normalized = type?.toLowerCase();
|
|
4822
|
+
return normalized === "coded" || normalized === "codedaction";
|
|
4823
|
+
}
|
|
4824
|
+
|
|
4522
4825
|
class BindingOverwritesMappingRequestHandler {
|
|
4523
4826
|
async handleAsync(request, cancellationToken) {
|
|
4524
4827
|
const solutionBindings = request.bindings.resources.filter((x) => isSolutionResource(x.metadata));
|
|
@@ -4544,7 +4847,8 @@ class BindingOverwritesMappingRequestHandler {
|
|
|
4544
4847
|
result.push({
|
|
4545
4848
|
binding: bindingsResource,
|
|
4546
4849
|
resourceKey: resource.key,
|
|
4547
|
-
isArtefactResource: resource.projectKey != null
|
|
4850
|
+
isArtefactResource: resource.projectKey != null,
|
|
4851
|
+
isCodedApp: bindingsResource.resourceType === models_BindingsResourceType.App && isCodedAppType(resource.type)
|
|
4548
4852
|
});
|
|
4549
4853
|
} else {
|
|
4550
4854
|
this.logger.error(`Solution does not contain binding resource of type ${models_BindingsResourceType[bindingsResource.resourceType]}.`);
|
|
@@ -5549,6 +5853,9 @@ class SolutionPublishLocationRequest {
|
|
|
5549
5853
|
}
|
|
5550
5854
|
|
|
5551
5855
|
class SolutionPublishLocationRequestV2 {
|
|
5856
|
+
constructor(permissionType) {
|
|
5857
|
+
this.permissionType = permissionType;
|
|
5858
|
+
}
|
|
5552
5859
|
}
|
|
5553
5860
|
|
|
5554
5861
|
class SettingsRequest {
|
|
@@ -5713,12 +6020,13 @@ function _ts_param3(paramIndex, decorator) {
|
|
|
5713
6020
|
}
|
|
5714
6021
|
|
|
5715
6022
|
class SolutionPublishLocationRequestV2Handler {
|
|
5716
|
-
async handleAsync(
|
|
6023
|
+
async handleAsync(request, cancellationToken) {
|
|
5717
6024
|
try {
|
|
5718
6025
|
const orchestratorClient = await this.orchestratorClientFactory.getClientAsync(cancellationToken);
|
|
5719
6026
|
if (!orchestratorClient)
|
|
5720
6027
|
throw new InvalidOperationException("Failed to create Orchestrator client");
|
|
5721
|
-
|
|
6028
|
+
const { permissionType } = request;
|
|
6029
|
+
return permissionType == null ? await orchestratorClient.getPublishLocationsAsync(cancellationToken) : await orchestratorClient.getAccessiblePublishLocationsAsync(permissionType, cancellationToken);
|
|
5722
6030
|
} catch (error) {
|
|
5723
6031
|
this.logger.error("An unexpected error occurred while retrieving publish locations from Automation Solutions service.", error);
|
|
5724
6032
|
throw error;
|
|
@@ -7748,7 +8056,7 @@ class GetResourceKeyForProjectRequestHandler {
|
|
|
7748
8056
|
projectKey: request.projectKey,
|
|
7749
8057
|
solution: request.context.path
|
|
7750
8058
|
});
|
|
7751
|
-
const cacheKey = `prk:${request.projectKey}`;
|
|
8059
|
+
const cacheKey = `prk:${request.context.path}:${request.projectKey}`;
|
|
7752
8060
|
const cached = await this.cacheProvider.getAsync(cacheKey, cancellationToken);
|
|
7753
8061
|
if (cached && typeof cached == "object" && "resourceKey" in cached) {
|
|
7754
8062
|
this.logger.info("Cache hit for project {projectKey} resource key.", {
|
|
@@ -8576,7 +8884,11 @@ class UpdateResourceConfigurationCommandHandler {
|
|
|
8576
8884
|
for (const prop of command.properties) {
|
|
8577
8885
|
const propKey = prop.property.toLowerCase();
|
|
8578
8886
|
const metadata = propertiesMetadata.get(propKey);
|
|
8579
|
-
if (
|
|
8887
|
+
if (metadata && metadata.readOnly !== true) {
|
|
8888
|
+
if (isAnyReferenceProperty(metadata)) {
|
|
8889
|
+
updated = this.setSolutionReference(solution, resource, currentConfiguration, propertiesMetadata, metadata, prop.configuredValue) || updated;
|
|
8890
|
+
continue;
|
|
8891
|
+
}
|
|
8580
8892
|
if (isSecretProperty(metadata)) {
|
|
8581
8893
|
const secretValue = prop.configuredValue?.toString() || "";
|
|
8582
8894
|
const existingKey = currentConfiguration[metadata.property]?.toString();
|
|
@@ -8620,6 +8932,38 @@ class UpdateResourceConfigurationCommandHandler {
|
|
|
8620
8932
|
await command.context.saveChangesAsync(cancellationToken);
|
|
8621
8933
|
return resourceConfiguration;
|
|
8622
8934
|
}
|
|
8935
|
+
setSolutionReference(solution, resource, currentConfiguration, propertiesMetadata, metadata, configuredValue) {
|
|
8936
|
+
const referenceKind = metadata["referenceKind"];
|
|
8937
|
+
if (!isSingleReferenceProperty(metadata) || isFileReferenceProperty(metadata) || typeof referenceKind != "string" || !referenceKind)
|
|
8938
|
+
return false;
|
|
8939
|
+
const requested = asReference(configuredValue);
|
|
8940
|
+
const target = requested?.key ? solution.resources.find((r) => invariantEquals(r.key, requested.key) && invariantEquals(r.kind, referenceKind)) : undefined;
|
|
8941
|
+
if (!requested || !target || invariantEquals(target.key, resource.key))
|
|
8942
|
+
return false;
|
|
8943
|
+
const dependencies = resource.dependencies ??= [];
|
|
8944
|
+
const previous = asReference(currentConfiguration[metadata.property]);
|
|
8945
|
+
const previousKey = previous?.key;
|
|
8946
|
+
const isReferencedElsewhere = (key) => [
|
|
8947
|
+
...propertiesMetadata.values()
|
|
8948
|
+
].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)));
|
|
8949
|
+
if (previousKey && !invariantEquals(previousKey, target.key) && !isReferencedElsewhere(previousKey)) {
|
|
8950
|
+
const previousName = solution.resources.find((r) => invariantEquals(r.key, previousKey) && invariantEquals(r.kind, target.kind))?.name ?? previous?.name ?? "";
|
|
8951
|
+
resource.dependencies = dependencies.filter((d) => !(invariantEquals(d.kind, target.kind) && invariantEquals(d.name, previousName)));
|
|
8952
|
+
}
|
|
8953
|
+
if (!resource.dependencies.some((d) => invariantEquals(d.kind, target.kind) && invariantEquals(d.name, target.name)))
|
|
8954
|
+
resource.dependencies.push({
|
|
8955
|
+
kind: target.kind,
|
|
8956
|
+
name: target.name
|
|
8957
|
+
});
|
|
8958
|
+
currentConfiguration[metadata.property] = {
|
|
8959
|
+
name: target.name,
|
|
8960
|
+
key: target.key,
|
|
8961
|
+
folderKey: requested.folderKey ?? null,
|
|
8962
|
+
lookupStrategy: null,
|
|
8963
|
+
info: null
|
|
8964
|
+
};
|
|
8965
|
+
return true;
|
|
8966
|
+
}
|
|
8623
8967
|
async updateReferencesName(solutionDefinition, resource, oldName, cancellationToken) {
|
|
8624
8968
|
const resourcesToBeChanged = solutionDefinition.resources.filter((r) => r.key !== resource.key && (r.dependencies ?? []).some((d) => invariantEquals(d.kind, resource.kind) && invariantEquals(d.name, oldName)));
|
|
8625
8969
|
if (resourcesToBeChanged.length === 0)
|
|
@@ -8906,6 +9250,28 @@ class UpsertResourceSecretCommandHandler {
|
|
|
8906
9250
|
this.secretsProvider = secretsProvider;
|
|
8907
9251
|
}
|
|
8908
9252
|
}
|
|
9253
|
+
function asReference(value) {
|
|
9254
|
+
if (!value || typeof value != "object" || Array.isArray(value))
|
|
9255
|
+
return;
|
|
9256
|
+
const record = value;
|
|
9257
|
+
const pick = (name) => {
|
|
9258
|
+
const entry = Object.entries(record).find(([k]) => k.toLowerCase() === name.toLowerCase());
|
|
9259
|
+
return typeof entry?.[1] == "string" ? entry[1] : undefined;
|
|
9260
|
+
};
|
|
9261
|
+
return {
|
|
9262
|
+
key: pick("key"),
|
|
9263
|
+
name: pick("name"),
|
|
9264
|
+
folderKey: pick("folderKey")
|
|
9265
|
+
};
|
|
9266
|
+
}
|
|
9267
|
+
function asReferences(value) {
|
|
9268
|
+
if (Array.isArray(value))
|
|
9269
|
+
return value.map(asReference).filter((r) => r !== undefined);
|
|
9270
|
+
const single = asReference(value);
|
|
9271
|
+
return single ? [
|
|
9272
|
+
single
|
|
9273
|
+
] : [];
|
|
9274
|
+
}
|
|
8909
9275
|
|
|
8910
9276
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/handlers/solution-handlers.js
|
|
8911
9277
|
var DUPLICATE_NAMES_SUPPORTED_KINDS = new Set([
|
|
@@ -9877,6 +10243,9 @@ class ResourceCatalogApi extends HttpClient {
|
|
|
9877
10243
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/clients/resource-catalog/resource-catalog-client.factory.js
|
|
9878
10244
|
var RESOURCE_CATALOG_SCOPE = "RCS.FolderAuthorization";
|
|
9879
10245
|
var RESOURCE_CATALOG_SERVICE_NAME = "resourcecatalog";
|
|
10246
|
+
function trimTrailingSlashes(url) {
|
|
10247
|
+
return url.replace(/\/+$/, "");
|
|
10248
|
+
}
|
|
9880
10249
|
|
|
9881
10250
|
class ResourceCatalogClientFactory {
|
|
9882
10251
|
async getClientAsync(cancellationToken) {
|
|
@@ -9890,9 +10259,8 @@ class ResourceCatalogClientFactory {
|
|
|
9890
10259
|
], true, cancellationToken);
|
|
9891
10260
|
const ipRangeBypassSecret = await this.ipRangeBypassSecretProvider?.getIpRangeBypassSecretAsync(cancellationToken);
|
|
9892
10261
|
const gatewayIntegrationEnabled = this.resourceBuilderAccessProvider.isGatewayIntegrationEnabled();
|
|
9893
|
-
const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
|
|
9894
10262
|
const client = new ResourceCatalogApi({
|
|
9895
|
-
baseUrl:
|
|
10263
|
+
baseUrl: trimTrailingSlashes(baseUrl),
|
|
9896
10264
|
securityWorker: (securityData) => {
|
|
9897
10265
|
if (!securityData)
|
|
9898
10266
|
return {};
|
|
@@ -9935,7 +10303,7 @@ class ResourceCatalogClientFactory {
|
|
|
9935
10303
|
if (!accountKey)
|
|
9936
10304
|
throw new Error("Unable to obtain account key");
|
|
9937
10305
|
const client = new ResourceCatalogApi({
|
|
9938
|
-
baseUrl,
|
|
10306
|
+
baseUrl: trimTrailingSlashes(baseUrl),
|
|
9939
10307
|
securityWorker: (securityData) => {
|
|
9940
10308
|
if (!securityData)
|
|
9941
10309
|
return {};
|
|
@@ -12154,7 +12522,16 @@ class AutomationSolutionsClientProxy2 {
|
|
|
12154
12522
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/clients/orchestrator/orchestrator-client.js
|
|
12155
12523
|
class OrchestratorClient {
|
|
12156
12524
|
async getPublishLocationsAsync(cancellationToken) {
|
|
12157
|
-
|
|
12525
|
+
return this.getPublishLocationsFromAsync(this.publishLocationsUrl(), cancellationToken);
|
|
12526
|
+
}
|
|
12527
|
+
async getAccessiblePublishLocationsAsync(permissionType, cancellationToken) {
|
|
12528
|
+
const url = `${this.publishLocationsUrl()}?permissionType=${encodeURIComponent(permissionType)}`;
|
|
12529
|
+
return this.getPublishLocationsFromAsync(url, cancellationToken);
|
|
12530
|
+
}
|
|
12531
|
+
publishLocationsUrl() {
|
|
12532
|
+
return `${this.options.baseUrl}api/v2/AutomationSolutions/publish_locations`;
|
|
12533
|
+
}
|
|
12534
|
+
async getPublishLocationsFromAsync(url, cancellationToken) {
|
|
12158
12535
|
const headers = OrchestratorClientFactory.buildHeaders(this.options.securityData);
|
|
12159
12536
|
const response = await fetch(url, {
|
|
12160
12537
|
method: "GET",
|
|
@@ -12844,7 +13221,7 @@ class ReconcileProjectsCommandHandler {
|
|
|
12844
13221
|
} : {
|
|
12845
13222
|
resourceKey: undefined
|
|
12846
13223
|
};
|
|
12847
|
-
await this.cacheProvider.setAsync(`prk:${projectKey}`, result, cancellationToken);
|
|
13224
|
+
await this.cacheProvider.setAsync(`prk:${context.path}:${projectKey}`, result, cancellationToken);
|
|
12848
13225
|
}
|
|
12849
13226
|
groupByProjectKey(artefactResources) {
|
|
12850
13227
|
const map = new Map;
|
|
@@ -13718,6 +14095,11 @@ class ResourceBuilder {
|
|
|
13718
14095
|
const request = new SolutionPublishLocationRequestV2;
|
|
13719
14096
|
return this._mediator.sendAsync(request, cancellationToken);
|
|
13720
14097
|
}
|
|
14098
|
+
async getAccessiblePublishLocationsAsync(permissionType, cancellationToken) {
|
|
14099
|
+
this.throwIfCancelled(cancellationToken);
|
|
14100
|
+
const request = new SolutionPublishLocationRequestV2(permissionType);
|
|
14101
|
+
return this._mediator.sendAsync(request, cancellationToken);
|
|
14102
|
+
}
|
|
13721
14103
|
async getSettingsAsync(cancellationToken) {
|
|
13722
14104
|
this.throwIfCancelled(cancellationToken);
|
|
13723
14105
|
const request = new SettingsRequest;
|
|
@@ -14277,9 +14659,9 @@ class UnconfiguredEmbeddedFileReader {
|
|
|
14277
14659
|
}
|
|
14278
14660
|
|
|
14279
14661
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/container.js
|
|
14280
|
-
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader, solutionContextOptions) {
|
|
14662
|
+
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader, solutionContextOptions, featureFlagProvider) {
|
|
14281
14663
|
const childContainer = import_tsyringe6.container.createChildContainer();
|
|
14282
|
-
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions);
|
|
14664
|
+
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions, featureFlagProvider);
|
|
14283
14665
|
registerServices(childContainer, embeddedFileReader);
|
|
14284
14666
|
registerHandlers(childContainer);
|
|
14285
14667
|
childContainer.register(ServiceTokens.Mediator, {
|
|
@@ -14303,11 +14685,15 @@ function registerProvider(diContainer, token, provider) {
|
|
|
14303
14685
|
break;
|
|
14304
14686
|
}
|
|
14305
14687
|
}
|
|
14306
|
-
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions) {
|
|
14688
|
+
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions, featureFlagProvider) {
|
|
14307
14689
|
registerProvider(diContainer, ServiceTokens.AccessProvider, accessProvider);
|
|
14308
14690
|
registerProvider(diContainer, ServiceTokens.CacheProvider, cacheProvider);
|
|
14309
14691
|
registerProvider(diContainer, ServiceTokens.SecretsProvider, secretsProvider);
|
|
14310
14692
|
registerProvider(diContainer, ServiceTokens.IpRangeBypassSecretProvider, ipRangeBypassSecretProvider);
|
|
14693
|
+
registerProvider(diContainer, ServiceTokens.FeatureFlagProvider, featureFlagProvider ?? {
|
|
14694
|
+
instance: new NullFeatureFlagProvider,
|
|
14695
|
+
lifetime: service_tokens_ServiceLifetime.Singleton
|
|
14696
|
+
});
|
|
14311
14697
|
registerProvider(diContainer, ServiceTokens.FileStorageProviderFactory, fileStorageProviderFactory);
|
|
14312
14698
|
registerProvider(diContainer, ServiceTokens.SolutionDefinitionProvider, solutionDefinitionProvider);
|
|
14313
14699
|
registerProvider(diContainer, ServiceTokens.SolutionDefinitionFactory, solutionDefinitionFactory);
|
|
@@ -15034,6 +15420,11 @@ class ResourceBuilderConfiguration {
|
|
|
15034
15420
|
this._ipRangeBypassSecretProviderLifetime = lifetime;
|
|
15035
15421
|
return this;
|
|
15036
15422
|
}
|
|
15423
|
+
addFeatureFlagProvider(provider, lifetime = service_tokens_ServiceLifetime.Scoped) {
|
|
15424
|
+
this._featureFlagProviderProvider = provider;
|
|
15425
|
+
this._featureFlagProviderLifetime = lifetime;
|
|
15426
|
+
return this;
|
|
15427
|
+
}
|
|
15037
15428
|
addSolutionDefinitionProvider(provider, lifetime = service_tokens_ServiceLifetime.Scoped) {
|
|
15038
15429
|
this._solutionDefinitionProviderProvider = provider;
|
|
15039
15430
|
this._solutionDefinitionProviderLifetime = lifetime;
|
|
@@ -15087,6 +15478,11 @@ class ResourceBuilderConfiguration {
|
|
|
15087
15478
|
instance: ipRangeBypassSecretProviderInstance,
|
|
15088
15479
|
lifetime: this._ipRangeBypassSecretProviderLifetime
|
|
15089
15480
|
};
|
|
15481
|
+
const featureFlagProviderInstance = this._featureFlagProviderProvider ? await resolveProvider(this._featureFlagProviderProvider) : new NullFeatureFlagProvider;
|
|
15482
|
+
const featureFlagProvider = {
|
|
15483
|
+
instance: featureFlagProviderInstance,
|
|
15484
|
+
lifetime: this._featureFlagProviderLifetime
|
|
15485
|
+
};
|
|
15090
15486
|
const secretsProviderInstance = this._secretsProviderProvider ? await resolveProvider(this._secretsProviderProvider) : new NullSecretsProvider;
|
|
15091
15487
|
const secretsProvider = {
|
|
15092
15488
|
instance: secretsProviderInstance,
|
|
@@ -15130,7 +15526,7 @@ class ResourceBuilderConfiguration {
|
|
|
15130
15526
|
lifetime: this._artifactResourceSpecEnhancerLifetime
|
|
15131
15527
|
};
|
|
15132
15528
|
const embeddedFileReader = await createDefaultEmbeddedFileReaderAsync();
|
|
15133
|
-
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions);
|
|
15529
|
+
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions, featureFlagProvider);
|
|
15134
15530
|
return new ResourceBuilderServices(container3);
|
|
15135
15531
|
}
|
|
15136
15532
|
async buildServices() {
|
|
@@ -15142,6 +15538,7 @@ class ResourceBuilderConfiguration {
|
|
|
15142
15538
|
this._secretsProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15143
15539
|
this._fileStorageProviderFactoryLifetime = service_tokens_ServiceLifetime.Singleton;
|
|
15144
15540
|
this._ipRangeBypassSecretProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15541
|
+
this._featureFlagProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15145
15542
|
this._solutionDefinitionProviderLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15146
15543
|
this._solutionDefinitionFactoryLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
15147
15544
|
this._artifactResourceSpecEnhancerLifetime = service_tokens_ServiceLifetime.Scoped;
|
|
@@ -15253,8 +15650,59 @@ var ARTEFACT_KIND_APP = "app";
|
|
|
15253
15650
|
var ARTEFACT_KIND_APP_VERSION = "appversion";
|
|
15254
15651
|
var ARTEFACT_KIND_PACKAGE = "package";
|
|
15255
15652
|
var SPEC_KEY_PACKAGE = "package";
|
|
15653
|
+
var RESOURCE_FILES_FOLDER_NAME = "resources";
|
|
15654
|
+
var RESOURCE_FILE_PATTERN = "*.json";
|
|
15655
|
+
var FIX_SHARED_KEY = "Delete all but one file for each key, then retry.";
|
|
15656
|
+
var FIX_KEYLESS = 'Give each file without a key its own unique "key", then retry.';
|
|
15657
|
+
|
|
15658
|
+
class DuplicateKeysError extends Error {
|
|
15659
|
+
keys;
|
|
15660
|
+
constructor(keys) {
|
|
15661
|
+
super(`Duplicate resource keys: ${keys.map(describeKey).join(", ")}`);
|
|
15662
|
+
this.keys = keys;
|
|
15663
|
+
}
|
|
15664
|
+
}
|
|
15256
15665
|
|
|
15257
15666
|
class ArtefactPairBindingProvider extends MultiFileSolutionDefinitionProvider {
|
|
15667
|
+
async readAsync(context, cancellationToken) {
|
|
15668
|
+
const [readError, solution] = await catchError(super.readAsync(context, cancellationToken));
|
|
15669
|
+
if (!readError)
|
|
15670
|
+
return solution;
|
|
15671
|
+
if (!(readError instanceof DuplicateKeysError))
|
|
15672
|
+
throw readError;
|
|
15673
|
+
const [describeError, message] = await catchError(this.describeDuplicateKeys(context, readError.keys, cancellationToken));
|
|
15674
|
+
throw describeError ? readError : new Error(message);
|
|
15675
|
+
}
|
|
15676
|
+
async replaceDuplicateKeysAsync(solution) {
|
|
15677
|
+
const keys = findDuplicateKeys(solution);
|
|
15678
|
+
if (keys.length > 0)
|
|
15679
|
+
throw new DuplicateKeysError(keys);
|
|
15680
|
+
}
|
|
15681
|
+
async describeDuplicateKeys(context, keys, cancellationToken) {
|
|
15682
|
+
const storage = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
15683
|
+
const files = await storage.getFilesAsync(RESOURCE_FILES_FOLDER_NAME, RESOURCE_FILE_PATTERN, cancellationToken);
|
|
15684
|
+
const pathsByKey = new Map(keys.map((key) => [key, []]));
|
|
15685
|
+
for (const file of [...files].sort()) {
|
|
15686
|
+
const [readError, key] = await catchError(this.readResourceKey(storage, file, cancellationToken));
|
|
15687
|
+
if (readError)
|
|
15688
|
+
continue;
|
|
15689
|
+
pathsByKey.get(key)?.push(toPortableRelativePath(file));
|
|
15690
|
+
}
|
|
15691
|
+
const lines = [...pathsByKey].map(([key, paths]) => `Resource key ${describeKey(key)} is used by: ${paths.join(", ")}`);
|
|
15692
|
+
const fixes = [
|
|
15693
|
+
keys.some((key) => !isKeyless(key)) && FIX_SHARED_KEY,
|
|
15694
|
+
keys.some(isKeyless) && FIX_KEYLESS
|
|
15695
|
+
].filter(Boolean);
|
|
15696
|
+
return [...lines, ...fixes].join(`
|
|
15697
|
+
`);
|
|
15698
|
+
}
|
|
15699
|
+
async readResourceKey(storage, file, cancellationToken) {
|
|
15700
|
+
const content = await storage.readFileToEndAsync(file, cancellationToken);
|
|
15701
|
+
const wrapper = this.caseInsensitiveSerializer.deserialize(content);
|
|
15702
|
+
if (!wrapper?.resource)
|
|
15703
|
+
throw new Error(`No resource in ${file}`);
|
|
15704
|
+
return wrapper.resource.key;
|
|
15705
|
+
}
|
|
15258
15706
|
async writeAsync(context, solution, cancellationToken) {
|
|
15259
15707
|
patchAppPackageLinkage(solution);
|
|
15260
15708
|
return super.writeAsync(context, solution, cancellationToken);
|
|
@@ -15266,6 +15714,22 @@ class ArtefactPairBindingSolutionDefinitionFactory extends MultiFileSolutionDefi
|
|
|
15266
15714
|
return new ArtefactPairBindingProvider(this.fileStorageProviderFactory, this.jsonSerializerFactory, this.loggerFactory);
|
|
15267
15715
|
}
|
|
15268
15716
|
}
|
|
15717
|
+
function findDuplicateKeys(solution) {
|
|
15718
|
+
const counts = new Map;
|
|
15719
|
+
for (const resource of solution.resources ?? []) {
|
|
15720
|
+
const key = resource.key;
|
|
15721
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
15722
|
+
}
|
|
15723
|
+
return [...counts].filter(([, count]) => count > 1).map(([key]) => key);
|
|
15724
|
+
}
|
|
15725
|
+
function isKeyless(key) {
|
|
15726
|
+
return typeof key !== "string" || !key;
|
|
15727
|
+
}
|
|
15728
|
+
function describeKey(key) {
|
|
15729
|
+
if (typeof key === "string" && key)
|
|
15730
|
+
return key;
|
|
15731
|
+
return key === undefined ? "(missing)" : JSON.stringify(key);
|
|
15732
|
+
}
|
|
15269
15733
|
function patchAppPackageLinkage(solution) {
|
|
15270
15734
|
const resources = solution.resources ?? [];
|
|
15271
15735
|
const projectKeys = new Set;
|
|
@@ -15505,1881 +15969,69 @@ class CliResourceBuilderLoggerFactory {
|
|
|
15505
15969
|
}
|
|
15506
15970
|
}
|
|
15507
15971
|
|
|
15508
|
-
// ../
|
|
15509
|
-
var
|
|
15972
|
+
// ../solution-sdk/src/resources/providers/solution-access-provider.ts
|
|
15973
|
+
var ORG_SCOPED_SERVICES = new Set(["apps", "authz"]);
|
|
15510
15974
|
|
|
15511
|
-
class
|
|
15512
|
-
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
get basePath() {
|
|
15520
|
-
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
15521
|
-
}
|
|
15522
|
-
get fetchApi() {
|
|
15523
|
-
return this.configuration.fetchApi;
|
|
15524
|
-
}
|
|
15525
|
-
get middleware() {
|
|
15526
|
-
return this.configuration.middleware || [];
|
|
15975
|
+
class SolutionAccessProvider {
|
|
15976
|
+
loginStatus = null;
|
|
15977
|
+
userKey = undefined;
|
|
15978
|
+
async getStatus() {
|
|
15979
|
+
if (!this.loginStatus) {
|
|
15980
|
+
this.loginStatus = await getLoginStatusAsync();
|
|
15981
|
+
}
|
|
15982
|
+
return this.loginStatus;
|
|
15527
15983
|
}
|
|
15528
|
-
|
|
15529
|
-
|
|
15984
|
+
async getResourceUrlAsync(scope, _cancellationToken) {
|
|
15985
|
+
const status = await this.getStatus();
|
|
15986
|
+
if (!status.baseUrl || !status.organizationName || !status.tenantName) {
|
|
15987
|
+
return null;
|
|
15988
|
+
}
|
|
15989
|
+
if (!scope) {
|
|
15990
|
+
return status.baseUrl;
|
|
15991
|
+
}
|
|
15992
|
+
const safeScope = scope.toLowerCase().replace(/[^a-z0-9_-]/g, "");
|
|
15993
|
+
if (!safeScope) {
|
|
15994
|
+
return status.baseUrl;
|
|
15995
|
+
}
|
|
15996
|
+
if (ORG_SCOPED_SERVICES.has(safeScope)) {
|
|
15997
|
+
return `${status.baseUrl}/${status.organizationName}/${safeScope}_`;
|
|
15998
|
+
}
|
|
15999
|
+
return `${status.baseUrl}/${status.organizationName}/${status.tenantName}/${safeScope}_`;
|
|
15530
16000
|
}
|
|
15531
|
-
|
|
15532
|
-
return this.
|
|
16001
|
+
async getResourceUrlWithAuthAsync(scope, _authInfo, _cancellationToken) {
|
|
16002
|
+
return this.getResourceUrlAsync(scope);
|
|
15533
16003
|
}
|
|
15534
|
-
|
|
15535
|
-
|
|
16004
|
+
async getAccessTokenAsync(_scopes, _force, _cancellationToken) {
|
|
16005
|
+
const status = await this.getStatus();
|
|
16006
|
+
return status.accessToken ?? null;
|
|
15536
16007
|
}
|
|
15537
|
-
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
return typeof apiKey === "function" ? apiKey : () => apiKey;
|
|
16008
|
+
async getUserKeyAsync(_cancellationToken) {
|
|
16009
|
+
if (this.userKey !== undefined) {
|
|
16010
|
+
return this.userKey;
|
|
15541
16011
|
}
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
if (accessToken) {
|
|
15547
|
-
return typeof accessToken === "function" ? accessToken : async () => accessToken;
|
|
16012
|
+
const [apiError, api] = await catchError(createApiClient(UsersApi));
|
|
16013
|
+
if (apiError) {
|
|
16014
|
+
logger.warn(`Failed to create UsersApi client: ${apiError.message}`);
|
|
16015
|
+
return null;
|
|
15548
16016
|
}
|
|
15549
|
-
|
|
16017
|
+
const [userError, user] = await catchError(api.usersGetCurrentUser());
|
|
16018
|
+
if (userError || !user?.key) {
|
|
16019
|
+
logger.warn(`Failed to get current user key: ${userError?.message ?? "no key in response"}`);
|
|
16020
|
+
return null;
|
|
16021
|
+
}
|
|
16022
|
+
this.userKey = user.key;
|
|
16023
|
+
return this.userKey;
|
|
16024
|
+
}
|
|
16025
|
+
async getTenantKeyAsync(_cancellationToken) {
|
|
16026
|
+
const status = await this.getStatus();
|
|
16027
|
+
return status.tenantId ?? null;
|
|
15550
16028
|
}
|
|
15551
|
-
|
|
15552
|
-
|
|
16029
|
+
async getAccountKeyAsync(_cancellationToken) {
|
|
16030
|
+
const status = await this.getStatus();
|
|
16031
|
+
return status.organizationId ?? null;
|
|
15553
16032
|
}
|
|
15554
|
-
|
|
15555
|
-
return
|
|
15556
|
-
}
|
|
15557
|
-
}
|
|
15558
|
-
var DefaultConfig = new Configuration;
|
|
15559
|
-
|
|
15560
|
-
class BaseAPI {
|
|
15561
|
-
configuration;
|
|
15562
|
-
static jsonRegex = new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", "i");
|
|
15563
|
-
middleware;
|
|
15564
|
-
constructor(configuration = DefaultConfig) {
|
|
15565
|
-
this.configuration = configuration;
|
|
15566
|
-
this.middleware = configuration.middleware;
|
|
15567
|
-
}
|
|
15568
|
-
withMiddleware(...middlewares) {
|
|
15569
|
-
const next = this.clone();
|
|
15570
|
-
next.middleware = next.middleware.concat(...middlewares);
|
|
15571
|
-
return next;
|
|
15572
|
-
}
|
|
15573
|
-
withPreMiddleware(...preMiddlewares) {
|
|
15574
|
-
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
15575
|
-
return this.withMiddleware(...middlewares);
|
|
15576
|
-
}
|
|
15577
|
-
withPostMiddleware(...postMiddlewares) {
|
|
15578
|
-
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
15579
|
-
return this.withMiddleware(...middlewares);
|
|
15580
|
-
}
|
|
15581
|
-
isJsonMime(mime) {
|
|
15582
|
-
if (!mime) {
|
|
15583
|
-
return false;
|
|
15584
|
-
}
|
|
15585
|
-
return BaseAPI.jsonRegex.test(mime);
|
|
15586
|
-
}
|
|
15587
|
-
async request(context, initOverrides) {
|
|
15588
|
-
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
15589
|
-
const response = await this.fetchApi(url, init);
|
|
15590
|
-
if (response && (response.status >= 200 && response.status < 300)) {
|
|
15591
|
-
return response;
|
|
15592
|
-
}
|
|
15593
|
-
throw new ResponseError(response, "Response returned an error code");
|
|
15594
|
-
}
|
|
15595
|
-
async createFetchParams(context, initOverrides) {
|
|
15596
|
-
let url = this.configuration.basePath + context.path;
|
|
15597
|
-
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
15598
|
-
url += "?" + this.configuration.queryParamsStringify(context.query);
|
|
15599
|
-
}
|
|
15600
|
-
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
15601
|
-
Object.keys(headers).forEach((key) => headers[key] === undefined ? delete headers[key] : {});
|
|
15602
|
-
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
|
|
15603
|
-
const initParams = {
|
|
15604
|
-
method: context.method,
|
|
15605
|
-
headers,
|
|
15606
|
-
body: context.body,
|
|
15607
|
-
credentials: this.configuration.credentials
|
|
15608
|
-
};
|
|
15609
|
-
const overriddenInit = {
|
|
15610
|
-
...initParams,
|
|
15611
|
-
...await initOverrideFn({
|
|
15612
|
-
init: initParams,
|
|
15613
|
-
context
|
|
15614
|
-
})
|
|
15615
|
-
};
|
|
15616
|
-
let body;
|
|
15617
|
-
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
|
|
15618
|
-
body = overriddenInit.body;
|
|
15619
|
-
} else if (this.isJsonMime(headers["Content-Type"])) {
|
|
15620
|
-
body = JSON.stringify(overriddenInit.body);
|
|
15621
|
-
} else {
|
|
15622
|
-
body = overriddenInit.body;
|
|
15623
|
-
}
|
|
15624
|
-
const init = {
|
|
15625
|
-
...overriddenInit,
|
|
15626
|
-
body
|
|
15627
|
-
};
|
|
15628
|
-
return { url, init };
|
|
15629
|
-
}
|
|
15630
|
-
fetchApi = async (url, init) => {
|
|
15631
|
-
let fetchParams = { url, init };
|
|
15632
|
-
for (const middleware of this.middleware) {
|
|
15633
|
-
if (middleware.pre) {
|
|
15634
|
-
fetchParams = await middleware.pre({
|
|
15635
|
-
fetch: this.fetchApi,
|
|
15636
|
-
...fetchParams
|
|
15637
|
-
}) || fetchParams;
|
|
15638
|
-
}
|
|
15639
|
-
}
|
|
15640
|
-
let response = undefined;
|
|
15641
|
-
try {
|
|
15642
|
-
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
15643
|
-
} catch (e) {
|
|
15644
|
-
for (const middleware of this.middleware) {
|
|
15645
|
-
if (middleware.onError) {
|
|
15646
|
-
response = await middleware.onError({
|
|
15647
|
-
fetch: this.fetchApi,
|
|
15648
|
-
url: fetchParams.url,
|
|
15649
|
-
init: fetchParams.init,
|
|
15650
|
-
error: e,
|
|
15651
|
-
response: response ? response.clone() : undefined
|
|
15652
|
-
}) || response;
|
|
15653
|
-
}
|
|
15654
|
-
}
|
|
15655
|
-
if (response === undefined) {
|
|
15656
|
-
if (e instanceof Error) {
|
|
15657
|
-
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
15658
|
-
} else {
|
|
15659
|
-
throw e;
|
|
15660
|
-
}
|
|
15661
|
-
}
|
|
15662
|
-
}
|
|
15663
|
-
for (const middleware of this.middleware) {
|
|
15664
|
-
if (middleware.post) {
|
|
15665
|
-
response = await middleware.post({
|
|
15666
|
-
fetch: this.fetchApi,
|
|
15667
|
-
url: fetchParams.url,
|
|
15668
|
-
init: fetchParams.init,
|
|
15669
|
-
response: response.clone()
|
|
15670
|
-
}) || response;
|
|
15671
|
-
}
|
|
15672
|
-
}
|
|
15673
|
-
return response;
|
|
15674
|
-
};
|
|
15675
|
-
clone() {
|
|
15676
|
-
const constructor = this.constructor;
|
|
15677
|
-
const next = new constructor(this.configuration);
|
|
15678
|
-
next.middleware = this.middleware.slice();
|
|
15679
|
-
return next;
|
|
15680
|
-
}
|
|
15681
|
-
}
|
|
15682
|
-
function isBlob(value) {
|
|
15683
|
-
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
15684
|
-
}
|
|
15685
|
-
function isFormData(value) {
|
|
15686
|
-
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
15687
|
-
}
|
|
15688
|
-
|
|
15689
|
-
class ResponseError extends Error {
|
|
15690
|
-
response;
|
|
15691
|
-
name = "ResponseError";
|
|
15692
|
-
constructor(response, msg) {
|
|
15693
|
-
super(msg);
|
|
15694
|
-
this.response = response;
|
|
15695
|
-
}
|
|
15696
|
-
}
|
|
15697
|
-
|
|
15698
|
-
class FetchError extends Error {
|
|
15699
|
-
cause;
|
|
15700
|
-
name = "FetchError";
|
|
15701
|
-
constructor(cause, msg) {
|
|
15702
|
-
super(msg);
|
|
15703
|
-
this.cause = cause;
|
|
15704
|
-
}
|
|
15705
|
-
}
|
|
15706
|
-
|
|
15707
|
-
class RequiredError extends Error {
|
|
15708
|
-
field;
|
|
15709
|
-
name = "RequiredError";
|
|
15710
|
-
constructor(field, msg) {
|
|
15711
|
-
super(msg);
|
|
15712
|
-
this.field = field;
|
|
15713
|
-
}
|
|
15714
|
-
}
|
|
15715
|
-
function querystring(params, prefix = "") {
|
|
15716
|
-
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
|
|
15717
|
-
}
|
|
15718
|
-
function querystringSingleKey(key, value, keyPrefix = "") {
|
|
15719
|
-
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
15720
|
-
if (value instanceof Array) {
|
|
15721
|
-
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
|
|
15722
|
-
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
15723
|
-
}
|
|
15724
|
-
if (value instanceof Set) {
|
|
15725
|
-
const valueAsArray = Array.from(value);
|
|
15726
|
-
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
15727
|
-
}
|
|
15728
|
-
if (value instanceof Date) {
|
|
15729
|
-
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
15730
|
-
}
|
|
15731
|
-
if (value instanceof Object) {
|
|
15732
|
-
return querystring(value, fullKey);
|
|
15733
|
-
}
|
|
15734
|
-
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
15735
|
-
}
|
|
15736
|
-
class JSONApiResponse {
|
|
15737
|
-
raw;
|
|
15738
|
-
transformer;
|
|
15739
|
-
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
15740
|
-
this.raw = raw;
|
|
15741
|
-
this.transformer = transformer;
|
|
15742
|
-
}
|
|
15743
|
-
async value() {
|
|
15744
|
-
return this.transformer(await this.raw.json());
|
|
15745
|
-
}
|
|
15746
|
-
}
|
|
15747
|
-
|
|
15748
|
-
class VoidApiResponse {
|
|
15749
|
-
raw;
|
|
15750
|
-
constructor(raw) {
|
|
15751
|
-
this.raw = raw;
|
|
15752
|
-
}
|
|
15753
|
-
async value() {
|
|
15754
|
-
return;
|
|
15755
|
-
}
|
|
15756
|
-
}
|
|
15757
|
-
// ../orchestrator-sdk/package.json
|
|
15758
|
-
var package_default = {
|
|
15759
|
-
name: "@uipath/orchestrator-sdk",
|
|
15760
|
-
author: "UiPath",
|
|
15761
|
-
license: "SEE LICENSE IN LICENSE.txt",
|
|
15762
|
-
version: "1.204.0",
|
|
15763
|
-
repository: {
|
|
15764
|
-
type: "git",
|
|
15765
|
-
url: "https://github.com/UiPath/cli.git",
|
|
15766
|
-
directory: "packages/orchestrator-sdk"
|
|
15767
|
-
},
|
|
15768
|
-
publishConfig: {
|
|
15769
|
-
registry: "https://npm.pkg.github.com/@uipath"
|
|
15770
|
-
},
|
|
15771
|
-
keywords: [
|
|
15772
|
-
"uipath",
|
|
15773
|
-
"orchestrator",
|
|
15774
|
-
"sdk"
|
|
15775
|
-
],
|
|
15776
|
-
type: "module",
|
|
15777
|
-
main: "./dist/index.js",
|
|
15778
|
-
types: "./dist/src/index.d.ts",
|
|
15779
|
-
exports: {
|
|
15780
|
-
".": {
|
|
15781
|
-
browser: {
|
|
15782
|
-
types: "./dist/src/index.browser.d.ts",
|
|
15783
|
-
default: "./dist/index.browser.js"
|
|
15784
|
-
},
|
|
15785
|
-
default: {
|
|
15786
|
-
types: "./dist/src/index.d.ts",
|
|
15787
|
-
default: "./dist/index.js"
|
|
15788
|
-
}
|
|
15789
|
-
}
|
|
15790
|
-
},
|
|
15791
|
-
files: [
|
|
15792
|
-
"dist"
|
|
15793
|
-
],
|
|
15794
|
-
private: true,
|
|
15795
|
-
scripts: {
|
|
15796
|
-
build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && bun build ./src/index.browser.ts --outdir dist --format esm --target browser --external @uipath/auth --external @uipath/common --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
15797
|
-
generate: "bun run src/scripts/generate-sdk.ts",
|
|
15798
|
-
lint: "biome check .",
|
|
15799
|
-
test: "vitest run",
|
|
15800
|
-
"test:coverage": "vitest run --coverage"
|
|
15801
|
-
},
|
|
15802
|
-
devDependencies: {
|
|
15803
|
-
"@uipath/auth": "workspace:*",
|
|
15804
|
-
"@uipath/common": "workspace:*",
|
|
15805
|
-
"@openapitools/openapi-generator-cli": "^2.31.1",
|
|
15806
|
-
"@types/node": "^25.5.2",
|
|
15807
|
-
typescript: "^7.0.2"
|
|
15808
|
-
}
|
|
15809
|
-
};
|
|
15810
|
-
|
|
15811
|
-
// ../orchestrator-sdk/src/user-agent.ts
|
|
15812
|
-
var SDK_USER_AGENT = getSdkUserAgentToken(package_default);
|
|
15813
|
-
installSdkUserAgentHeader(BaseAPI, SDK_USER_AGENT);
|
|
15814
|
-
// ../orchestrator-sdk/generated/src/models/PrivilegeOfAccessType.ts
|
|
15815
|
-
function PrivilegeOfAccessTypeFromJSON(json) {
|
|
15816
|
-
return PrivilegeOfAccessTypeFromJSONTyped(json, false);
|
|
15817
|
-
}
|
|
15818
|
-
function PrivilegeOfAccessTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
15819
|
-
if (json == null) {
|
|
15820
|
-
return json;
|
|
15821
|
-
}
|
|
15822
|
-
return {
|
|
15823
|
-
value: json["value"] == null ? undefined : json["value"],
|
|
15824
|
-
type: json["type"] == null ? undefined : json["type"]
|
|
15825
|
-
};
|
|
15826
|
-
}
|
|
15827
|
-
|
|
15828
|
-
// ../orchestrator-sdk/generated/src/models/PrivilegeGroupDto.ts
|
|
15829
|
-
function PrivilegeGroupDtoFromJSON(json) {
|
|
15830
|
-
return PrivilegeGroupDtoFromJSONTyped(json, false);
|
|
15831
|
-
}
|
|
15832
|
-
function PrivilegeGroupDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
15833
|
-
if (json == null) {
|
|
15834
|
-
return json;
|
|
15835
|
-
}
|
|
15836
|
-
return {
|
|
15837
|
-
name: json["name"] == null ? undefined : json["name"],
|
|
15838
|
-
id: json["id"] == null ? undefined : json["id"]
|
|
15839
|
-
};
|
|
15840
|
-
}
|
|
15841
|
-
|
|
15842
|
-
// ../orchestrator-sdk/generated/src/models/InheritedPrivilegeOfAccessType.ts
|
|
15843
|
-
function InheritedPrivilegeOfAccessTypeFromJSON(json) {
|
|
15844
|
-
return InheritedPrivilegeOfAccessTypeFromJSONTyped(json, false);
|
|
15845
|
-
}
|
|
15846
|
-
function InheritedPrivilegeOfAccessTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
15847
|
-
if (json == null) {
|
|
15848
|
-
return json;
|
|
15849
|
-
}
|
|
15850
|
-
return {
|
|
15851
|
-
groups: json["groups"] == null ? undefined : json["groups"].map(PrivilegeGroupDtoFromJSON),
|
|
15852
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
15853
|
-
value: json["value"] == null ? undefined : json["value"]
|
|
15854
|
-
};
|
|
15855
|
-
}
|
|
15856
|
-
|
|
15857
|
-
// ../orchestrator-sdk/generated/src/models/ExplicitPrivilegeOfAccessType.ts
|
|
15858
|
-
function ExplicitPrivilegeOfAccessTypeFromJSON(json) {
|
|
15859
|
-
return ExplicitPrivilegeOfAccessTypeFromJSONTyped(json, false);
|
|
15860
|
-
}
|
|
15861
|
-
function ExplicitPrivilegeOfAccessTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
15862
|
-
if (json == null) {
|
|
15863
|
-
return json;
|
|
15864
|
-
}
|
|
15865
|
-
return {
|
|
15866
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
15867
|
-
value: json["value"] == null ? undefined : json["value"]
|
|
15868
|
-
};
|
|
15869
|
-
}
|
|
15870
|
-
|
|
15871
|
-
// ../orchestrator-sdk/generated/src/models/AccessPrivilege.ts
|
|
15872
|
-
function AccessPrivilegeFromJSON(json) {
|
|
15873
|
-
return AccessPrivilegeFromJSONTyped(json, false);
|
|
15874
|
-
}
|
|
15875
|
-
function AccessPrivilegeFromJSONTyped(json, ignoreDiscriminator) {
|
|
15876
|
-
if (json == null) {
|
|
15877
|
-
return json;
|
|
15878
|
-
}
|
|
15879
|
-
return {
|
|
15880
|
-
explicit: json["explicit"] == null ? undefined : ExplicitPrivilegeOfAccessTypeFromJSON(json["explicit"]),
|
|
15881
|
-
inherited: json["inherited"] == null ? undefined : json["inherited"].map(InheritedPrivilegeOfAccessTypeFromJSON),
|
|
15882
|
-
effective: json["effective"] == null ? undefined : PrivilegeOfAccessTypeFromJSON(json["effective"])
|
|
15883
|
-
};
|
|
15884
|
-
}
|
|
15885
|
-
// ../orchestrator-sdk/generated/src/models/AttendedRobotDto.ts
|
|
15886
|
-
function AttendedRobotDtoFromJSON(json) {
|
|
15887
|
-
return AttendedRobotDtoFromJSONTyped(json, false);
|
|
15888
|
-
}
|
|
15889
|
-
function AttendedRobotDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
15890
|
-
if (json == null) {
|
|
15891
|
-
return json;
|
|
15892
|
-
}
|
|
15893
|
-
return {
|
|
15894
|
-
userName: json["UserName"] == null ? undefined : json["UserName"],
|
|
15895
|
-
executionSettings: json["ExecutionSettings"] == null ? undefined : json["ExecutionSettings"],
|
|
15896
|
-
robotId: json["RobotId"] == null ? undefined : json["RobotId"],
|
|
15897
|
-
robotType: json["RobotType"] == null ? undefined : json["RobotType"]
|
|
15898
|
-
};
|
|
15899
|
-
}
|
|
15900
|
-
function AttendedRobotDtoToJSON(json) {
|
|
15901
|
-
return AttendedRobotDtoToJSONTyped(json, false);
|
|
15902
|
-
}
|
|
15903
|
-
function AttendedRobotDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
15904
|
-
if (value == null) {
|
|
15905
|
-
return value;
|
|
15906
|
-
}
|
|
15907
|
-
return {
|
|
15908
|
-
UserName: value["userName"],
|
|
15909
|
-
ExecutionSettings: value["executionSettings"],
|
|
15910
|
-
RobotId: value["robotId"],
|
|
15911
|
-
RobotType: value["robotType"]
|
|
15912
|
-
};
|
|
15913
|
-
}
|
|
15914
|
-
// ../orchestrator-sdk/generated/src/models/ExplicitPrivilegeOfBoolean.ts
|
|
15915
|
-
function ExplicitPrivilegeOfBooleanFromJSON(json) {
|
|
15916
|
-
return ExplicitPrivilegeOfBooleanFromJSONTyped(json, false);
|
|
15917
|
-
}
|
|
15918
|
-
function ExplicitPrivilegeOfBooleanFromJSONTyped(json, ignoreDiscriminator) {
|
|
15919
|
-
if (json == null) {
|
|
15920
|
-
return json;
|
|
15921
|
-
}
|
|
15922
|
-
return {
|
|
15923
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
15924
|
-
value: json["value"] == null ? undefined : json["value"]
|
|
15925
|
-
};
|
|
15926
|
-
}
|
|
15927
|
-
|
|
15928
|
-
// ../orchestrator-sdk/generated/src/models/InheritedPrivilegeOfBoolean.ts
|
|
15929
|
-
function InheritedPrivilegeOfBooleanFromJSON(json) {
|
|
15930
|
-
return InheritedPrivilegeOfBooleanFromJSONTyped(json, false);
|
|
15931
|
-
}
|
|
15932
|
-
function InheritedPrivilegeOfBooleanFromJSONTyped(json, ignoreDiscriminator) {
|
|
15933
|
-
if (json == null) {
|
|
15934
|
-
return json;
|
|
15935
|
-
}
|
|
15936
|
-
return {
|
|
15937
|
-
groups: json["groups"] == null ? undefined : json["groups"].map(PrivilegeGroupDtoFromJSON),
|
|
15938
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
15939
|
-
value: json["value"] == null ? undefined : json["value"]
|
|
15940
|
-
};
|
|
15941
|
-
}
|
|
15942
|
-
|
|
15943
|
-
// ../orchestrator-sdk/generated/src/models/PrivilegeOfBoolean.ts
|
|
15944
|
-
function PrivilegeOfBooleanFromJSON(json) {
|
|
15945
|
-
return PrivilegeOfBooleanFromJSONTyped(json, false);
|
|
15946
|
-
}
|
|
15947
|
-
function PrivilegeOfBooleanFromJSONTyped(json, ignoreDiscriminator) {
|
|
15948
|
-
if (json == null) {
|
|
15949
|
-
return json;
|
|
15950
|
-
}
|
|
15951
|
-
return {
|
|
15952
|
-
value: json["value"] == null ? undefined : json["value"],
|
|
15953
|
-
type: json["type"] == null ? undefined : json["type"]
|
|
15954
|
-
};
|
|
15955
|
-
}
|
|
15956
|
-
|
|
15957
|
-
// ../orchestrator-sdk/generated/src/models/BooleanPrivilege.ts
|
|
15958
|
-
function BooleanPrivilegeFromJSON(json) {
|
|
15959
|
-
return BooleanPrivilegeFromJSONTyped(json, false);
|
|
15960
|
-
}
|
|
15961
|
-
function BooleanPrivilegeFromJSONTyped(json, ignoreDiscriminator) {
|
|
15962
|
-
if (json == null) {
|
|
15963
|
-
return json;
|
|
15964
|
-
}
|
|
15965
|
-
return {
|
|
15966
|
-
explicit: json["explicit"] == null ? undefined : ExplicitPrivilegeOfBooleanFromJSON(json["explicit"]),
|
|
15967
|
-
inherited: json["inherited"] == null ? undefined : InheritedPrivilegeOfBooleanFromJSON(json["inherited"]),
|
|
15968
|
-
effective: json["effective"] == null ? undefined : PrivilegeOfBooleanFromJSON(json["effective"])
|
|
15969
|
-
};
|
|
15970
|
-
}
|
|
15971
|
-
// ../orchestrator-sdk/generated/src/models/RolePrivilegeDto.ts
|
|
15972
|
-
function RolePrivilegeDtoFromJSON(json) {
|
|
15973
|
-
return RolePrivilegeDtoFromJSONTyped(json, false);
|
|
15974
|
-
}
|
|
15975
|
-
function RolePrivilegeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
15976
|
-
if (json == null) {
|
|
15977
|
-
return json;
|
|
15978
|
-
}
|
|
15979
|
-
return {
|
|
15980
|
-
name: json["name"] == null ? undefined : json["name"],
|
|
15981
|
-
id: json["id"] == null ? undefined : json["id"]
|
|
15982
|
-
};
|
|
15983
|
-
}
|
|
15984
|
-
|
|
15985
|
-
// ../orchestrator-sdk/generated/src/models/ExplicitPrivilegeOfRolePrivilegeDto.ts
|
|
15986
|
-
function ExplicitPrivilegeOfRolePrivilegeDtoFromJSON(json) {
|
|
15987
|
-
return ExplicitPrivilegeOfRolePrivilegeDtoFromJSONTyped(json, false);
|
|
15988
|
-
}
|
|
15989
|
-
function ExplicitPrivilegeOfRolePrivilegeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
15990
|
-
if (json == null) {
|
|
15991
|
-
return json;
|
|
15992
|
-
}
|
|
15993
|
-
return {
|
|
15994
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
15995
|
-
value: json["value"] == null ? undefined : RolePrivilegeDtoFromJSON(json["value"])
|
|
15996
|
-
};
|
|
15997
|
-
}
|
|
15998
|
-
// ../orchestrator-sdk/generated/src/models/UpdatePolicyDto.ts
|
|
15999
|
-
function UpdatePolicyDtoFromJSON(json) {
|
|
16000
|
-
return UpdatePolicyDtoFromJSONTyped(json, false);
|
|
16001
|
-
}
|
|
16002
|
-
function UpdatePolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16003
|
-
if (json == null) {
|
|
16004
|
-
return json;
|
|
16005
|
-
}
|
|
16006
|
-
return {
|
|
16007
|
-
type: json["Type"] == null ? undefined : json["Type"],
|
|
16008
|
-
specificVersion: json["SpecificVersion"] == null ? undefined : json["SpecificVersion"]
|
|
16009
|
-
};
|
|
16010
|
-
}
|
|
16011
|
-
function UpdatePolicyDtoToJSON(json) {
|
|
16012
|
-
return UpdatePolicyDtoToJSONTyped(json, false);
|
|
16013
|
-
}
|
|
16014
|
-
function UpdatePolicyDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16015
|
-
if (value == null) {
|
|
16016
|
-
return value;
|
|
16017
|
-
}
|
|
16018
|
-
return {
|
|
16019
|
-
Type: value["type"],
|
|
16020
|
-
SpecificVersion: value["specificVersion"]
|
|
16021
|
-
};
|
|
16022
|
-
}
|
|
16023
|
-
|
|
16024
|
-
// ../orchestrator-sdk/generated/src/models/ExplicitPrivilegeOfUpdatePolicyDto.ts
|
|
16025
|
-
function ExplicitPrivilegeOfUpdatePolicyDtoFromJSON(json) {
|
|
16026
|
-
return ExplicitPrivilegeOfUpdatePolicyDtoFromJSONTyped(json, false);
|
|
16027
|
-
}
|
|
16028
|
-
function ExplicitPrivilegeOfUpdatePolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16029
|
-
if (json == null) {
|
|
16030
|
-
return json;
|
|
16031
|
-
}
|
|
16032
|
-
return {
|
|
16033
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
16034
|
-
value: json["value"] == null ? undefined : UpdatePolicyDtoFromJSON(json["value"])
|
|
16035
|
-
};
|
|
16036
|
-
}
|
|
16037
|
-
// ../orchestrator-sdk/generated/src/models/OrganizationUnitDto.ts
|
|
16038
|
-
function OrganizationUnitDtoFromJSON(json) {
|
|
16039
|
-
return OrganizationUnitDtoFromJSONTyped(json, false);
|
|
16040
|
-
}
|
|
16041
|
-
function OrganizationUnitDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16042
|
-
if (json == null) {
|
|
16043
|
-
return json;
|
|
16044
|
-
}
|
|
16045
|
-
return {
|
|
16046
|
-
displayName: json["displayName"],
|
|
16047
|
-
id: json["id"] == null ? undefined : json["id"]
|
|
16048
|
-
};
|
|
16049
|
-
}
|
|
16050
|
-
function OrganizationUnitDtoToJSON(json) {
|
|
16051
|
-
return OrganizationUnitDtoToJSONTyped(json, false);
|
|
16052
|
-
}
|
|
16053
|
-
function OrganizationUnitDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16054
|
-
if (value == null) {
|
|
16055
|
-
return value;
|
|
16056
|
-
}
|
|
16057
|
-
return {
|
|
16058
|
-
displayName: value["displayName"],
|
|
16059
|
-
id: value["id"]
|
|
16060
|
-
};
|
|
16061
|
-
}
|
|
16062
|
-
|
|
16063
|
-
// ../orchestrator-sdk/generated/src/models/UserRoleDto.ts
|
|
16064
|
-
function UserRoleDtoFromJSON(json) {
|
|
16065
|
-
return UserRoleDtoFromJSONTyped(json, false);
|
|
16066
|
-
}
|
|
16067
|
-
function UserRoleDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16068
|
-
if (json == null) {
|
|
16069
|
-
return json;
|
|
16070
|
-
}
|
|
16071
|
-
return {
|
|
16072
|
-
userId: json["UserId"] == null ? undefined : json["UserId"],
|
|
16073
|
-
roleId: json["RoleId"] == null ? undefined : json["RoleId"],
|
|
16074
|
-
userName: json["UserName"] == null ? undefined : json["UserName"],
|
|
16075
|
-
roleName: json["RoleName"] == null ? undefined : json["RoleName"],
|
|
16076
|
-
roleType: json["RoleType"] == null ? undefined : json["RoleType"],
|
|
16077
|
-
id: json["Id"] == null ? undefined : json["Id"]
|
|
16078
|
-
};
|
|
16079
|
-
}
|
|
16080
|
-
function UserRoleDtoToJSON(json) {
|
|
16081
|
-
return UserRoleDtoToJSONTyped(json, false);
|
|
16082
|
-
}
|
|
16083
|
-
function UserRoleDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16084
|
-
if (value == null) {
|
|
16085
|
-
return value;
|
|
16086
|
-
}
|
|
16087
|
-
return {
|
|
16088
|
-
UserId: value["userId"],
|
|
16089
|
-
RoleId: value["roleId"],
|
|
16090
|
-
UserName: value["userName"],
|
|
16091
|
-
RoleName: value["roleName"],
|
|
16092
|
-
RoleType: value["roleType"],
|
|
16093
|
-
Id: value["id"]
|
|
16094
|
-
};
|
|
16095
|
-
}
|
|
16096
|
-
|
|
16097
|
-
// ../orchestrator-sdk/generated/src/models/UserNotificationSubscription.ts
|
|
16098
|
-
function UserNotificationSubscriptionFromJSON(json) {
|
|
16099
|
-
return UserNotificationSubscriptionFromJSONTyped(json, false);
|
|
16100
|
-
}
|
|
16101
|
-
function UserNotificationSubscriptionFromJSONTyped(json, ignoreDiscriminator) {
|
|
16102
|
-
if (json == null) {
|
|
16103
|
-
return json;
|
|
16104
|
-
}
|
|
16105
|
-
return {
|
|
16106
|
-
queues: json["Queues"] == null ? undefined : json["Queues"],
|
|
16107
|
-
robots: json["Robots"] == null ? undefined : json["Robots"],
|
|
16108
|
-
jobs: json["Jobs"] == null ? undefined : json["Jobs"],
|
|
16109
|
-
schedules: json["Schedules"] == null ? undefined : json["Schedules"],
|
|
16110
|
-
tasks: json["Tasks"] == null ? undefined : json["Tasks"],
|
|
16111
|
-
queueItems: json["QueueItems"] == null ? undefined : json["QueueItems"],
|
|
16112
|
-
insights: json["Insights"] == null ? undefined : json["Insights"],
|
|
16113
|
-
cloudRobots: json["CloudRobots"] == null ? undefined : json["CloudRobots"],
|
|
16114
|
-
serverless: json["Serverless"] == null ? undefined : json["Serverless"],
|
|
16115
|
-
_export: json["Export"] == null ? undefined : json["Export"],
|
|
16116
|
-
rateLimitsDaily: json["RateLimitsDaily"] == null ? undefined : json["RateLimitsDaily"],
|
|
16117
|
-
rateLimitsRealTime: json["RateLimitsRealTime"] == null ? undefined : json["RateLimitsRealTime"],
|
|
16118
|
-
autopilotForRobotsDetectedIssues: json["AutopilotForRobotsDetectedIssues"] == null ? undefined : json["AutopilotForRobotsDetectedIssues"],
|
|
16119
|
-
webhooks: json["Webhooks"] == null ? undefined : json["Webhooks"]
|
|
16120
|
-
};
|
|
16121
|
-
}
|
|
16122
|
-
function UserNotificationSubscriptionToJSON(json) {
|
|
16123
|
-
return UserNotificationSubscriptionToJSONTyped(json, false);
|
|
16124
|
-
}
|
|
16125
|
-
function UserNotificationSubscriptionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16126
|
-
if (value == null) {
|
|
16127
|
-
return value;
|
|
16128
|
-
}
|
|
16129
|
-
return {
|
|
16130
|
-
Queues: value["queues"],
|
|
16131
|
-
Robots: value["robots"],
|
|
16132
|
-
Jobs: value["jobs"],
|
|
16133
|
-
Schedules: value["schedules"],
|
|
16134
|
-
Tasks: value["tasks"],
|
|
16135
|
-
QueueItems: value["queueItems"],
|
|
16136
|
-
Insights: value["insights"],
|
|
16137
|
-
CloudRobots: value["cloudRobots"],
|
|
16138
|
-
Serverless: value["serverless"],
|
|
16139
|
-
Export: value["_export"],
|
|
16140
|
-
RateLimitsDaily: value["rateLimitsDaily"],
|
|
16141
|
-
RateLimitsRealTime: value["rateLimitsRealTime"],
|
|
16142
|
-
AutopilotForRobotsDetectedIssues: value["autopilotForRobotsDetectedIssues"],
|
|
16143
|
-
Webhooks: value["webhooks"]
|
|
16144
|
-
};
|
|
16145
|
-
}
|
|
16146
|
-
|
|
16147
|
-
// ../orchestrator-sdk/generated/src/models/UnattendedRobotDto.ts
|
|
16148
|
-
function UnattendedRobotDtoFromJSON(json) {
|
|
16149
|
-
return UnattendedRobotDtoFromJSONTyped(json, false);
|
|
16150
|
-
}
|
|
16151
|
-
function UnattendedRobotDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16152
|
-
if (json == null) {
|
|
16153
|
-
return json;
|
|
16154
|
-
}
|
|
16155
|
-
return {
|
|
16156
|
-
userName: json["UserName"] == null ? undefined : json["UserName"],
|
|
16157
|
-
password: json["Password"] == null ? undefined : json["Password"],
|
|
16158
|
-
credentialStoreId: json["CredentialStoreId"] == null ? undefined : json["CredentialStoreId"],
|
|
16159
|
-
credentialType: json["CredentialType"] == null ? undefined : json["CredentialType"],
|
|
16160
|
-
credentialExternalName: json["CredentialExternalName"] == null ? undefined : json["CredentialExternalName"],
|
|
16161
|
-
executionSettings: json["ExecutionSettings"] == null ? undefined : json["ExecutionSettings"],
|
|
16162
|
-
limitConcurrentExecution: json["LimitConcurrentExecution"] == null ? undefined : json["LimitConcurrentExecution"],
|
|
16163
|
-
robotId: json["RobotId"] == null ? undefined : json["RobotId"],
|
|
16164
|
-
machineMappingsCount: json["MachineMappingsCount"] == null ? undefined : json["MachineMappingsCount"]
|
|
16165
|
-
};
|
|
16166
|
-
}
|
|
16167
|
-
function UnattendedRobotDtoToJSON(json) {
|
|
16168
|
-
return UnattendedRobotDtoToJSONTyped(json, false);
|
|
16169
|
-
}
|
|
16170
|
-
function UnattendedRobotDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16171
|
-
if (value == null) {
|
|
16172
|
-
return value;
|
|
16173
|
-
}
|
|
16174
|
-
return {
|
|
16175
|
-
UserName: value["userName"],
|
|
16176
|
-
Password: value["password"],
|
|
16177
|
-
CredentialStoreId: value["credentialStoreId"],
|
|
16178
|
-
CredentialType: value["credentialType"],
|
|
16179
|
-
CredentialExternalName: value["credentialExternalName"],
|
|
16180
|
-
ExecutionSettings: value["executionSettings"],
|
|
16181
|
-
LimitConcurrentExecution: value["limitConcurrentExecution"],
|
|
16182
|
-
RobotId: value["robotId"],
|
|
16183
|
-
MachineMappingsCount: value["machineMappingsCount"]
|
|
16184
|
-
};
|
|
16185
|
-
}
|
|
16186
|
-
|
|
16187
|
-
// ../orchestrator-sdk/generated/src/models/UserDto.ts
|
|
16188
|
-
function UserDtoFromJSON(json) {
|
|
16189
|
-
return UserDtoFromJSONTyped(json, false);
|
|
16190
|
-
}
|
|
16191
|
-
function UserDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16192
|
-
if (json == null) {
|
|
16193
|
-
return json;
|
|
16194
|
-
}
|
|
16195
|
-
return {
|
|
16196
|
-
name: json["Name"] == null ? undefined : json["Name"],
|
|
16197
|
-
surname: json["Surname"] == null ? undefined : json["Surname"],
|
|
16198
|
-
userName: json["UserName"] == null ? undefined : json["UserName"],
|
|
16199
|
-
domain: json["Domain"] == null ? undefined : json["Domain"],
|
|
16200
|
-
directoryIdentifier: json["DirectoryIdentifier"] == null ? undefined : json["DirectoryIdentifier"],
|
|
16201
|
-
fullName: json["FullName"] == null ? undefined : json["FullName"],
|
|
16202
|
-
emailAddress: json["EmailAddress"] == null ? undefined : json["EmailAddress"],
|
|
16203
|
-
lastLoginTime: json["LastLoginTime"] == null ? undefined : new Date(json["LastLoginTime"]),
|
|
16204
|
-
isActive: json["IsActive"] == null ? undefined : json["IsActive"],
|
|
16205
|
-
creationTime: json["CreationTime"] == null ? undefined : new Date(json["CreationTime"]),
|
|
16206
|
-
authenticationSource: json["AuthenticationSource"] == null ? undefined : json["AuthenticationSource"],
|
|
16207
|
-
organizationUnits: json["OrganizationUnits"] == null ? undefined : json["OrganizationUnits"].map(OrganizationUnitDtoFromJSON),
|
|
16208
|
-
password: json["Password"] == null ? undefined : json["Password"],
|
|
16209
|
-
isExternalLicensed: json["IsExternalLicensed"] == null ? undefined : json["IsExternalLicensed"],
|
|
16210
|
-
userRoles: json["UserRoles"] == null ? undefined : json["UserRoles"].map(UserRoleDtoFromJSON),
|
|
16211
|
-
rolesList: json["RolesList"] == null ? undefined : json["RolesList"],
|
|
16212
|
-
loginProviders: json["LoginProviders"] == null ? undefined : json["LoginProviders"],
|
|
16213
|
-
tenantId: json["TenantId"] == null ? undefined : json["TenantId"],
|
|
16214
|
-
tenancyName: json["TenancyName"] == null ? undefined : json["TenancyName"],
|
|
16215
|
-
tenantDisplayName: json["TenantDisplayName"] == null ? undefined : json["TenantDisplayName"],
|
|
16216
|
-
tenantKey: json["TenantKey"] == null ? undefined : json["TenantKey"],
|
|
16217
|
-
type: json["Type"] == null ? undefined : json["Type"],
|
|
16218
|
-
provisionType: json["ProvisionType"] == null ? undefined : json["ProvisionType"],
|
|
16219
|
-
licenseType: json["LicenseType"] == null ? undefined : json["LicenseType"],
|
|
16220
|
-
robotProvision: json["RobotProvision"] == null ? undefined : AttendedRobotDtoFromJSON(json["RobotProvision"]),
|
|
16221
|
-
unattendedRobot: json["UnattendedRobot"] == null ? undefined : UnattendedRobotDtoFromJSON(json["UnattendedRobot"]),
|
|
16222
|
-
notificationSubscription: json["NotificationSubscription"] == null ? undefined : UserNotificationSubscriptionFromJSON(json["NotificationSubscription"]),
|
|
16223
|
-
key: json["Key"] == null ? undefined : json["Key"],
|
|
16224
|
-
mayHaveUserSession: json["MayHaveUserSession"] == null ? undefined : json["MayHaveUserSession"],
|
|
16225
|
-
mayHaveRobotSession: json["MayHaveRobotSession"] == null ? undefined : json["MayHaveRobotSession"],
|
|
16226
|
-
mayHaveUnattendedSession: json["MayHaveUnattendedSession"] == null ? undefined : json["MayHaveUnattendedSession"],
|
|
16227
|
-
mayHavePersonalWorkspace: json["MayHavePersonalWorkspace"] == null ? undefined : json["MayHavePersonalWorkspace"],
|
|
16228
|
-
restrictToPersonalWorkspace: json["RestrictToPersonalWorkspace"] == null ? undefined : json["RestrictToPersonalWorkspace"],
|
|
16229
|
-
updatePolicy: json["UpdatePolicy"] == null ? undefined : UpdatePolicyDtoFromJSON(json["UpdatePolicy"]),
|
|
16230
|
-
accountId: json["AccountId"] == null ? undefined : json["AccountId"],
|
|
16231
|
-
hasOnlyInheritedPrivileges: json["HasOnlyInheritedPrivileges"] == null ? undefined : json["HasOnlyInheritedPrivileges"],
|
|
16232
|
-
explicitMayHaveUserSession: json["ExplicitMayHaveUserSession"] == null ? undefined : json["ExplicitMayHaveUserSession"],
|
|
16233
|
-
explicitMayHaveRobotSession: json["ExplicitMayHaveRobotSession"] == null ? undefined : json["ExplicitMayHaveRobotSession"],
|
|
16234
|
-
explicitMayHavePersonalWorkspace: json["ExplicitMayHavePersonalWorkspace"] == null ? undefined : json["ExplicitMayHavePersonalWorkspace"],
|
|
16235
|
-
explicitRestrictToPersonalWorkspace: json["ExplicitRestrictToPersonalWorkspace"] == null ? undefined : json["ExplicitRestrictToPersonalWorkspace"],
|
|
16236
|
-
lastModificationTime: json["LastModificationTime"] == null ? undefined : new Date(json["LastModificationTime"]),
|
|
16237
|
-
lastModifierUserId: json["LastModifierUserId"] == null ? undefined : json["LastModifierUserId"],
|
|
16238
|
-
creatorUserId: json["CreatorUserId"] == null ? undefined : json["CreatorUserId"],
|
|
16239
|
-
id: json["Id"] == null ? undefined : json["Id"]
|
|
16240
|
-
};
|
|
16241
|
-
}
|
|
16242
|
-
function UserDtoToJSON(json) {
|
|
16243
|
-
return UserDtoToJSONTyped(json, false);
|
|
16244
|
-
}
|
|
16245
|
-
function UserDtoToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16246
|
-
if (value == null) {
|
|
16247
|
-
return value;
|
|
16248
|
-
}
|
|
16249
|
-
return {
|
|
16250
|
-
Name: value["name"],
|
|
16251
|
-
Surname: value["surname"],
|
|
16252
|
-
UserName: value["userName"],
|
|
16253
|
-
Domain: value["domain"],
|
|
16254
|
-
DirectoryIdentifier: value["directoryIdentifier"],
|
|
16255
|
-
FullName: value["fullName"],
|
|
16256
|
-
EmailAddress: value["emailAddress"],
|
|
16257
|
-
LastLoginTime: value["lastLoginTime"] == null ? value["lastLoginTime"] : value["lastLoginTime"].toISOString(),
|
|
16258
|
-
IsActive: value["isActive"],
|
|
16259
|
-
CreationTime: value["creationTime"] == null ? value["creationTime"] : value["creationTime"].toISOString(),
|
|
16260
|
-
AuthenticationSource: value["authenticationSource"],
|
|
16261
|
-
OrganizationUnits: value["organizationUnits"] == null ? undefined : value["organizationUnits"].map(OrganizationUnitDtoToJSON),
|
|
16262
|
-
Password: value["password"],
|
|
16263
|
-
IsExternalLicensed: value["isExternalLicensed"],
|
|
16264
|
-
UserRoles: value["userRoles"] == null ? undefined : value["userRoles"].map(UserRoleDtoToJSON),
|
|
16265
|
-
RolesList: value["rolesList"],
|
|
16266
|
-
LoginProviders: value["loginProviders"],
|
|
16267
|
-
TenantId: value["tenantId"],
|
|
16268
|
-
TenancyName: value["tenancyName"],
|
|
16269
|
-
TenantDisplayName: value["tenantDisplayName"],
|
|
16270
|
-
TenantKey: value["tenantKey"],
|
|
16271
|
-
Type: value["type"],
|
|
16272
|
-
ProvisionType: value["provisionType"],
|
|
16273
|
-
LicenseType: value["licenseType"],
|
|
16274
|
-
RobotProvision: AttendedRobotDtoToJSON(value["robotProvision"]),
|
|
16275
|
-
UnattendedRobot: UnattendedRobotDtoToJSON(value["unattendedRobot"]),
|
|
16276
|
-
NotificationSubscription: UserNotificationSubscriptionToJSON(value["notificationSubscription"]),
|
|
16277
|
-
Key: value["key"],
|
|
16278
|
-
MayHaveUserSession: value["mayHaveUserSession"],
|
|
16279
|
-
MayHaveRobotSession: value["mayHaveRobotSession"],
|
|
16280
|
-
MayHaveUnattendedSession: value["mayHaveUnattendedSession"],
|
|
16281
|
-
MayHavePersonalWorkspace: value["mayHavePersonalWorkspace"],
|
|
16282
|
-
RestrictToPersonalWorkspace: value["restrictToPersonalWorkspace"],
|
|
16283
|
-
UpdatePolicy: UpdatePolicyDtoToJSON(value["updatePolicy"]),
|
|
16284
|
-
AccountId: value["accountId"],
|
|
16285
|
-
HasOnlyInheritedPrivileges: value["hasOnlyInheritedPrivileges"],
|
|
16286
|
-
ExplicitMayHaveUserSession: value["explicitMayHaveUserSession"],
|
|
16287
|
-
ExplicitMayHaveRobotSession: value["explicitMayHaveRobotSession"],
|
|
16288
|
-
ExplicitMayHavePersonalWorkspace: value["explicitMayHavePersonalWorkspace"],
|
|
16289
|
-
ExplicitRestrictToPersonalWorkspace: value["explicitRestrictToPersonalWorkspace"],
|
|
16290
|
-
LastModificationTime: value["lastModificationTime"] == null ? value["lastModificationTime"] : value["lastModificationTime"].toISOString(),
|
|
16291
|
-
LastModifierUserId: value["lastModifierUserId"],
|
|
16292
|
-
CreatorUserId: value["creatorUserId"],
|
|
16293
|
-
Id: value["id"]
|
|
16294
|
-
};
|
|
16295
|
-
}
|
|
16296
|
-
// ../orchestrator-sdk/generated/src/models/FolderDto.ts
|
|
16297
|
-
function FolderDtoFromJSON(json) {
|
|
16298
|
-
return FolderDtoFromJSONTyped(json, false);
|
|
16299
|
-
}
|
|
16300
|
-
function FolderDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16301
|
-
if (json == null) {
|
|
16302
|
-
return json;
|
|
16303
|
-
}
|
|
16304
|
-
return {
|
|
16305
|
-
key: json["Key"] == null ? undefined : json["Key"],
|
|
16306
|
-
displayName: json["DisplayName"],
|
|
16307
|
-
fullyQualifiedName: json["FullyQualifiedName"] == null ? undefined : json["FullyQualifiedName"],
|
|
16308
|
-
description: json["Description"] == null ? undefined : json["Description"],
|
|
16309
|
-
folderType: json["FolderType"] == null ? undefined : json["FolderType"],
|
|
16310
|
-
isPersonal: json["IsPersonal"] == null ? undefined : json["IsPersonal"],
|
|
16311
|
-
provisionType: json["ProvisionType"] == null ? undefined : json["ProvisionType"],
|
|
16312
|
-
permissionModel: json["PermissionModel"] == null ? undefined : json["PermissionModel"],
|
|
16313
|
-
parentId: json["ParentId"] == null ? undefined : json["ParentId"],
|
|
16314
|
-
parentKey: json["ParentKey"] == null ? undefined : json["ParentKey"],
|
|
16315
|
-
feedType: json["FeedType"] == null ? undefined : json["FeedType"],
|
|
16316
|
-
id: json["Id"] == null ? undefined : json["Id"]
|
|
16317
|
-
};
|
|
16318
|
-
}
|
|
16319
|
-
|
|
16320
|
-
// ../orchestrator-sdk/generated/src/models/UserPreferencesDto.ts
|
|
16321
|
-
function UserPreferencesDtoFromJSON(json) {
|
|
16322
|
-
return UserPreferencesDtoFromJSONTyped(json, false);
|
|
16323
|
-
}
|
|
16324
|
-
function UserPreferencesDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16325
|
-
if (json == null) {
|
|
16326
|
-
return json;
|
|
16327
|
-
}
|
|
16328
|
-
return {
|
|
16329
|
-
redesignPreference: json["redesignPreference"] == null ? undefined : json["redesignPreference"],
|
|
16330
|
-
remoteControlPreference: json["remoteControlPreference"] == null ? undefined : json["remoteControlPreference"]
|
|
16331
|
-
};
|
|
16332
|
-
}
|
|
16333
|
-
|
|
16334
|
-
// ../orchestrator-sdk/generated/src/models/ExtendedUserDto.ts
|
|
16335
|
-
function ExtendedUserDtoFromJSON(json) {
|
|
16336
|
-
return ExtendedUserDtoFromJSONTyped(json, false);
|
|
16337
|
-
}
|
|
16338
|
-
function ExtendedUserDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16339
|
-
if (json == null) {
|
|
16340
|
-
return json;
|
|
16341
|
-
}
|
|
16342
|
-
return {
|
|
16343
|
-
personalWorkspace: json["PersonalWorkspace"] == null ? undefined : FolderDtoFromJSON(json["PersonalWorkspace"]),
|
|
16344
|
-
personalWorskpaceFeedId: json["PersonalWorskpaceFeedId"] == null ? undefined : json["PersonalWorskpaceFeedId"],
|
|
16345
|
-
virtualFolderId: json["VirtualFolderId"] == null ? undefined : json["VirtualFolderId"],
|
|
16346
|
-
virtualFolderPath: json["VirtualFolderPath"] == null ? undefined : json["VirtualFolderPath"],
|
|
16347
|
-
preferences: json["Preferences"] == null ? undefined : UserPreferencesDtoFromJSON(json["Preferences"]),
|
|
16348
|
-
name: json["Name"] == null ? undefined : json["Name"],
|
|
16349
|
-
surname: json["Surname"] == null ? undefined : json["Surname"],
|
|
16350
|
-
userName: json["UserName"] == null ? undefined : json["UserName"],
|
|
16351
|
-
domain: json["Domain"] == null ? undefined : json["Domain"],
|
|
16352
|
-
directoryIdentifier: json["DirectoryIdentifier"] == null ? undefined : json["DirectoryIdentifier"],
|
|
16353
|
-
fullName: json["FullName"] == null ? undefined : json["FullName"],
|
|
16354
|
-
emailAddress: json["EmailAddress"] == null ? undefined : json["EmailAddress"],
|
|
16355
|
-
lastLoginTime: json["LastLoginTime"] == null ? undefined : new Date(json["LastLoginTime"]),
|
|
16356
|
-
isActive: json["IsActive"] == null ? undefined : json["IsActive"],
|
|
16357
|
-
creationTime: json["CreationTime"] == null ? undefined : new Date(json["CreationTime"]),
|
|
16358
|
-
authenticationSource: json["AuthenticationSource"] == null ? undefined : json["AuthenticationSource"],
|
|
16359
|
-
organizationUnits: json["OrganizationUnits"] == null ? undefined : json["OrganizationUnits"].map(OrganizationUnitDtoFromJSON),
|
|
16360
|
-
password: json["Password"] == null ? undefined : json["Password"],
|
|
16361
|
-
isExternalLicensed: json["IsExternalLicensed"] == null ? undefined : json["IsExternalLicensed"],
|
|
16362
|
-
userRoles: json["UserRoles"] == null ? undefined : json["UserRoles"].map(UserRoleDtoFromJSON),
|
|
16363
|
-
rolesList: json["RolesList"] == null ? undefined : json["RolesList"],
|
|
16364
|
-
loginProviders: json["LoginProviders"] == null ? undefined : json["LoginProviders"],
|
|
16365
|
-
tenantId: json["TenantId"] == null ? undefined : json["TenantId"],
|
|
16366
|
-
tenancyName: json["TenancyName"] == null ? undefined : json["TenancyName"],
|
|
16367
|
-
tenantDisplayName: json["TenantDisplayName"] == null ? undefined : json["TenantDisplayName"],
|
|
16368
|
-
tenantKey: json["TenantKey"] == null ? undefined : json["TenantKey"],
|
|
16369
|
-
type: json["Type"] == null ? undefined : json["Type"],
|
|
16370
|
-
provisionType: json["ProvisionType"] == null ? undefined : json["ProvisionType"],
|
|
16371
|
-
licenseType: json["LicenseType"] == null ? undefined : json["LicenseType"],
|
|
16372
|
-
robotProvision: json["RobotProvision"] == null ? undefined : AttendedRobotDtoFromJSON(json["RobotProvision"]),
|
|
16373
|
-
unattendedRobot: json["UnattendedRobot"] == null ? undefined : UnattendedRobotDtoFromJSON(json["UnattendedRobot"]),
|
|
16374
|
-
notificationSubscription: json["NotificationSubscription"] == null ? undefined : UserNotificationSubscriptionFromJSON(json["NotificationSubscription"]),
|
|
16375
|
-
key: json["Key"] == null ? undefined : json["Key"],
|
|
16376
|
-
mayHaveUserSession: json["MayHaveUserSession"] == null ? undefined : json["MayHaveUserSession"],
|
|
16377
|
-
mayHaveRobotSession: json["MayHaveRobotSession"] == null ? undefined : json["MayHaveRobotSession"],
|
|
16378
|
-
mayHaveUnattendedSession: json["MayHaveUnattendedSession"] == null ? undefined : json["MayHaveUnattendedSession"],
|
|
16379
|
-
mayHavePersonalWorkspace: json["MayHavePersonalWorkspace"] == null ? undefined : json["MayHavePersonalWorkspace"],
|
|
16380
|
-
restrictToPersonalWorkspace: json["RestrictToPersonalWorkspace"] == null ? undefined : json["RestrictToPersonalWorkspace"],
|
|
16381
|
-
updatePolicy: json["UpdatePolicy"] == null ? undefined : UpdatePolicyDtoFromJSON(json["UpdatePolicy"]),
|
|
16382
|
-
accountId: json["AccountId"] == null ? undefined : json["AccountId"],
|
|
16383
|
-
hasOnlyInheritedPrivileges: json["HasOnlyInheritedPrivileges"] == null ? undefined : json["HasOnlyInheritedPrivileges"],
|
|
16384
|
-
explicitMayHaveUserSession: json["ExplicitMayHaveUserSession"] == null ? undefined : json["ExplicitMayHaveUserSession"],
|
|
16385
|
-
explicitMayHaveRobotSession: json["ExplicitMayHaveRobotSession"] == null ? undefined : json["ExplicitMayHaveRobotSession"],
|
|
16386
|
-
explicitMayHavePersonalWorkspace: json["ExplicitMayHavePersonalWorkspace"] == null ? undefined : json["ExplicitMayHavePersonalWorkspace"],
|
|
16387
|
-
explicitRestrictToPersonalWorkspace: json["ExplicitRestrictToPersonalWorkspace"] == null ? undefined : json["ExplicitRestrictToPersonalWorkspace"],
|
|
16388
|
-
lastModificationTime: json["LastModificationTime"] == null ? undefined : new Date(json["LastModificationTime"]),
|
|
16389
|
-
lastModifierUserId: json["LastModifierUserId"] == null ? undefined : json["LastModifierUserId"],
|
|
16390
|
-
creatorUserId: json["CreatorUserId"] == null ? undefined : json["CreatorUserId"],
|
|
16391
|
-
id: json["Id"] == null ? undefined : json["Id"]
|
|
16392
|
-
};
|
|
16393
|
-
}
|
|
16394
|
-
// ../orchestrator-sdk/generated/src/models/GetUsersModel.ts
|
|
16395
|
-
function GetUsersModelToJSON(json) {
|
|
16396
|
-
return GetUsersModelToJSONTyped(json, false);
|
|
16397
|
-
}
|
|
16398
|
-
function GetUsersModelToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16399
|
-
if (value == null) {
|
|
16400
|
-
return value;
|
|
16401
|
-
}
|
|
16402
|
-
return {
|
|
16403
|
-
permissions: value["permissions"],
|
|
16404
|
-
folderKeys: value["folderKeys"],
|
|
16405
|
-
token: value["token"]
|
|
16406
|
-
};
|
|
16407
|
-
}
|
|
16408
|
-
// ../orchestrator-sdk/generated/src/models/InheritedPrivilegeOfRolePrivilegeDto.ts
|
|
16409
|
-
function InheritedPrivilegeOfRolePrivilegeDtoFromJSON(json) {
|
|
16410
|
-
return InheritedPrivilegeOfRolePrivilegeDtoFromJSONTyped(json, false);
|
|
16411
|
-
}
|
|
16412
|
-
function InheritedPrivilegeOfRolePrivilegeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16413
|
-
if (json == null) {
|
|
16414
|
-
return json;
|
|
16415
|
-
}
|
|
16416
|
-
return {
|
|
16417
|
-
groups: json["groups"] == null ? undefined : json["groups"].map(PrivilegeGroupDtoFromJSON),
|
|
16418
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
16419
|
-
value: json["value"] == null ? undefined : RolePrivilegeDtoFromJSON(json["value"])
|
|
16420
|
-
};
|
|
16421
|
-
}
|
|
16422
|
-
// ../orchestrator-sdk/generated/src/models/InheritedPrivilegeOfUpdatePolicyDto.ts
|
|
16423
|
-
function InheritedPrivilegeOfUpdatePolicyDtoFromJSON(json) {
|
|
16424
|
-
return InheritedPrivilegeOfUpdatePolicyDtoFromJSONTyped(json, false);
|
|
16425
|
-
}
|
|
16426
|
-
function InheritedPrivilegeOfUpdatePolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16427
|
-
if (json == null) {
|
|
16428
|
-
return json;
|
|
16429
|
-
}
|
|
16430
|
-
return {
|
|
16431
|
-
groups: json["groups"] == null ? undefined : json["groups"].map(PrivilegeGroupDtoFromJSON),
|
|
16432
|
-
type: json["type"] == null ? undefined : json["type"],
|
|
16433
|
-
value: json["value"] == null ? undefined : UpdatePolicyDtoFromJSON(json["value"])
|
|
16434
|
-
};
|
|
16435
|
-
}
|
|
16436
|
-
// ../orchestrator-sdk/generated/src/models/ODataValueOfIDictionaryOfInt64Boolean.ts
|
|
16437
|
-
function ODataValueOfIDictionaryOfInt64BooleanFromJSON(json) {
|
|
16438
|
-
return ODataValueOfIDictionaryOfInt64BooleanFromJSONTyped(json, false);
|
|
16439
|
-
}
|
|
16440
|
-
function ODataValueOfIDictionaryOfInt64BooleanFromJSONTyped(json, ignoreDiscriminator) {
|
|
16441
|
-
if (json == null) {
|
|
16442
|
-
return json;
|
|
16443
|
-
}
|
|
16444
|
-
return {
|
|
16445
|
-
value: json["value"] == null ? undefined : json["value"]
|
|
16446
|
-
};
|
|
16447
|
-
}
|
|
16448
|
-
// ../orchestrator-sdk/generated/src/models/ODataValueOfIEnumerableOfUserDto.ts
|
|
16449
|
-
function ODataValueOfIEnumerableOfUserDtoFromJSON(json) {
|
|
16450
|
-
return ODataValueOfIEnumerableOfUserDtoFromJSONTyped(json, false);
|
|
16451
|
-
}
|
|
16452
|
-
function ODataValueOfIEnumerableOfUserDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16453
|
-
if (json == null) {
|
|
16454
|
-
return json;
|
|
16455
|
-
}
|
|
16456
|
-
return {
|
|
16457
|
-
value: json["value"] == null ? undefined : json["value"].map(UserDtoFromJSON)
|
|
16458
|
-
};
|
|
16459
|
-
}
|
|
16460
|
-
// ../orchestrator-sdk/generated/src/models/UserPermissionsExtended.ts
|
|
16461
|
-
function UserPermissionsExtendedFromJSON(json) {
|
|
16462
|
-
return UserPermissionsExtendedFromJSONTyped(json, false);
|
|
16463
|
-
}
|
|
16464
|
-
function UserPermissionsExtendedFromJSONTyped(json, ignoreDiscriminator) {
|
|
16465
|
-
if (json == null) {
|
|
16466
|
-
return json;
|
|
16467
|
-
}
|
|
16468
|
-
return {
|
|
16469
|
-
userId: json["UserId"] == null ? undefined : json["UserId"],
|
|
16470
|
-
folderKey: json["FolderKey"] == null ? undefined : json["FolderKey"],
|
|
16471
|
-
folderName: json["FolderName"] == null ? undefined : json["FolderName"],
|
|
16472
|
-
folderType: json["FolderType"] == null ? undefined : json["FolderType"],
|
|
16473
|
-
folderPath: json["FolderPath"] == null ? undefined : json["FolderPath"],
|
|
16474
|
-
folderCode: json["FolderCode"] == null ? undefined : json["FolderCode"],
|
|
16475
|
-
isPersonalWorkspace: json["IsPersonalWorkspace"] == null ? undefined : json["IsPersonalWorkspace"],
|
|
16476
|
-
path: json["Path"] == null ? undefined : json["Path"],
|
|
16477
|
-
permissions: json["Permissions"] == null ? undefined : json["Permissions"]
|
|
16478
|
-
};
|
|
16479
|
-
}
|
|
16480
|
-
|
|
16481
|
-
// ../orchestrator-sdk/generated/src/models/ODataValueOfIEnumerableOfUserPermissionsExtended.ts
|
|
16482
|
-
function ODataValueOfIEnumerableOfUserPermissionsExtendedFromJSON(json) {
|
|
16483
|
-
return ODataValueOfIEnumerableOfUserPermissionsExtendedFromJSONTyped(json, false);
|
|
16484
|
-
}
|
|
16485
|
-
function ODataValueOfIEnumerableOfUserPermissionsExtendedFromJSONTyped(json, ignoreDiscriminator) {
|
|
16486
|
-
if (json == null) {
|
|
16487
|
-
return json;
|
|
16488
|
-
}
|
|
16489
|
-
return {
|
|
16490
|
-
value: json["value"] == null ? undefined : json["value"].map(UserPermissionsExtendedFromJSON)
|
|
16491
|
-
};
|
|
16492
|
-
}
|
|
16493
|
-
// ../orchestrator-sdk/generated/src/models/ODataValueOfInt64.ts
|
|
16494
|
-
function ODataValueOfInt64FromJSON(json) {
|
|
16495
|
-
return ODataValueOfInt64FromJSONTyped(json, false);
|
|
16496
|
-
}
|
|
16497
|
-
function ODataValueOfInt64FromJSONTyped(json, ignoreDiscriminator) {
|
|
16498
|
-
if (json == null) {
|
|
16499
|
-
return json;
|
|
16500
|
-
}
|
|
16501
|
-
return {
|
|
16502
|
-
value: json["value"] == null ? undefined : json["value"]
|
|
16503
|
-
};
|
|
16504
|
-
}
|
|
16505
|
-
// ../orchestrator-sdk/generated/src/models/PrivilegeOfRolePrivilegeDto.ts
|
|
16506
|
-
function PrivilegeOfRolePrivilegeDtoFromJSON(json) {
|
|
16507
|
-
return PrivilegeOfRolePrivilegeDtoFromJSONTyped(json, false);
|
|
16508
|
-
}
|
|
16509
|
-
function PrivilegeOfRolePrivilegeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16510
|
-
if (json == null) {
|
|
16511
|
-
return json;
|
|
16512
|
-
}
|
|
16513
|
-
return {
|
|
16514
|
-
value: json["value"] == null ? undefined : RolePrivilegeDtoFromJSON(json["value"]),
|
|
16515
|
-
type: json["type"] == null ? undefined : json["type"]
|
|
16516
|
-
};
|
|
16517
|
-
}
|
|
16518
|
-
// ../orchestrator-sdk/generated/src/models/PrivilegeOfUpdatePolicyDto.ts
|
|
16519
|
-
function PrivilegeOfUpdatePolicyDtoFromJSON(json) {
|
|
16520
|
-
return PrivilegeOfUpdatePolicyDtoFromJSONTyped(json, false);
|
|
16521
|
-
}
|
|
16522
|
-
function PrivilegeOfUpdatePolicyDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16523
|
-
if (json == null) {
|
|
16524
|
-
return json;
|
|
16525
|
-
}
|
|
16526
|
-
return {
|
|
16527
|
-
value: json["value"] == null ? undefined : UpdatePolicyDtoFromJSON(json["value"]),
|
|
16528
|
-
type: json["type"] == null ? undefined : json["type"]
|
|
16529
|
-
};
|
|
16530
|
-
}
|
|
16531
|
-
// ../orchestrator-sdk/generated/src/models/RevokeExplicitPrivilegesRequest.ts
|
|
16532
|
-
function RevokeExplicitPrivilegesRequestToJSON(json) {
|
|
16533
|
-
return RevokeExplicitPrivilegesRequestToJSONTyped(json, false);
|
|
16534
|
-
}
|
|
16535
|
-
function RevokeExplicitPrivilegesRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16536
|
-
if (value == null) {
|
|
16537
|
-
return value;
|
|
16538
|
-
}
|
|
16539
|
-
return {
|
|
16540
|
-
userIds: value["userIds"]
|
|
16541
|
-
};
|
|
16542
|
-
}
|
|
16543
|
-
// ../orchestrator-sdk/generated/src/models/RolePrivileges.ts
|
|
16544
|
-
function RolePrivilegesFromJSON(json) {
|
|
16545
|
-
return RolePrivilegesFromJSONTyped(json, false);
|
|
16546
|
-
}
|
|
16547
|
-
function RolePrivilegesFromJSONTyped(json, ignoreDiscriminator) {
|
|
16548
|
-
if (json == null) {
|
|
16549
|
-
return json;
|
|
16550
|
-
}
|
|
16551
|
-
return {
|
|
16552
|
-
explicit: json["explicit"] == null ? undefined : json["explicit"].map(ExplicitPrivilegeOfRolePrivilegeDtoFromJSON),
|
|
16553
|
-
inherited: json["inherited"] == null ? undefined : json["inherited"].map(InheritedPrivilegeOfRolePrivilegeDtoFromJSON),
|
|
16554
|
-
effective: json["effective"] == null ? undefined : json["effective"].map(PrivilegeOfRolePrivilegeDtoFromJSON)
|
|
16555
|
-
};
|
|
16556
|
-
}
|
|
16557
|
-
// ../orchestrator-sdk/generated/src/models/UpdatePolicyPrivilege.ts
|
|
16558
|
-
function UpdatePolicyPrivilegeFromJSON(json) {
|
|
16559
|
-
return UpdatePolicyPrivilegeFromJSONTyped(json, false);
|
|
16560
|
-
}
|
|
16561
|
-
function UpdatePolicyPrivilegeFromJSONTyped(json, ignoreDiscriminator) {
|
|
16562
|
-
if (json == null) {
|
|
16563
|
-
return json;
|
|
16564
|
-
}
|
|
16565
|
-
return {
|
|
16566
|
-
explicit: json["explicit"] == null ? undefined : ExplicitPrivilegeOfUpdatePolicyDtoFromJSON(json["explicit"]),
|
|
16567
|
-
inherited: json["inherited"] == null ? undefined : json["inherited"].map(InheritedPrivilegeOfUpdatePolicyDtoFromJSON),
|
|
16568
|
-
effective: json["effective"] == null ? undefined : PrivilegeOfUpdatePolicyDtoFromJSON(json["effective"])
|
|
16569
|
-
};
|
|
16570
|
-
}
|
|
16571
|
-
// ../orchestrator-sdk/generated/src/models/UserAssignRolesRequest.ts
|
|
16572
|
-
function UserAssignRolesRequestToJSON(json) {
|
|
16573
|
-
return UserAssignRolesRequestToJSONTyped(json, false);
|
|
16574
|
-
}
|
|
16575
|
-
function UserAssignRolesRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16576
|
-
if (value == null) {
|
|
16577
|
-
return value;
|
|
16578
|
-
}
|
|
16579
|
-
return {
|
|
16580
|
-
roleIds: value["roleIds"]
|
|
16581
|
-
};
|
|
16582
|
-
}
|
|
16583
|
-
// ../orchestrator-sdk/generated/src/models/UserChangeCultureRequest.ts
|
|
16584
|
-
function UserChangeCultureRequestToJSON(json) {
|
|
16585
|
-
return UserChangeCultureRequestToJSONTyped(json, false);
|
|
16586
|
-
}
|
|
16587
|
-
function UserChangeCultureRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16588
|
-
if (value == null) {
|
|
16589
|
-
return value;
|
|
16590
|
-
}
|
|
16591
|
-
return {
|
|
16592
|
-
culture: value["culture"]
|
|
16593
|
-
};
|
|
16594
|
-
}
|
|
16595
|
-
// ../orchestrator-sdk/generated/src/models/UserIdTypeDto.ts
|
|
16596
|
-
function UserIdTypeDtoFromJSON(json) {
|
|
16597
|
-
return UserIdTypeDtoFromJSONTyped(json, false);
|
|
16598
|
-
}
|
|
16599
|
-
function UserIdTypeDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16600
|
-
if (json == null) {
|
|
16601
|
-
return json;
|
|
16602
|
-
}
|
|
16603
|
-
return {
|
|
16604
|
-
id: json["id"] == null ? undefined : json["id"],
|
|
16605
|
-
type: json["type"] == null ? undefined : json["type"]
|
|
16606
|
-
};
|
|
16607
|
-
}
|
|
16608
|
-
|
|
16609
|
-
// ../orchestrator-sdk/generated/src/models/UserIdTypeCollectionDto.ts
|
|
16610
|
-
function UserIdTypeCollectionDtoFromJSON(json) {
|
|
16611
|
-
return UserIdTypeCollectionDtoFromJSONTyped(json, false);
|
|
16612
|
-
}
|
|
16613
|
-
function UserIdTypeCollectionDtoFromJSONTyped(json, ignoreDiscriminator) {
|
|
16614
|
-
if (json == null) {
|
|
16615
|
-
return json;
|
|
16616
|
-
}
|
|
16617
|
-
return {
|
|
16618
|
-
users: json["users"] == null ? undefined : json["users"].map(UserIdTypeDtoFromJSON),
|
|
16619
|
-
token: json["token"] == null ? undefined : json["token"]
|
|
16620
|
-
};
|
|
16621
|
-
}
|
|
16622
|
-
// ../orchestrator-sdk/generated/src/models/UserPermissionsCollection.ts
|
|
16623
|
-
function UserPermissionsCollectionFromJSON(json) {
|
|
16624
|
-
return UserPermissionsCollectionFromJSONTyped(json, false);
|
|
16625
|
-
}
|
|
16626
|
-
function UserPermissionsCollectionFromJSONTyped(json, ignoreDiscriminator) {
|
|
16627
|
-
if (json == null) {
|
|
16628
|
-
return json;
|
|
16629
|
-
}
|
|
16630
|
-
return {
|
|
16631
|
-
userId: json["UserId"] == null ? undefined : json["UserId"],
|
|
16632
|
-
permissions: json["Permissions"] == null ? undefined : json["Permissions"]
|
|
16633
|
-
};
|
|
16634
|
-
}
|
|
16635
|
-
// ../orchestrator-sdk/generated/src/models/UserPrivileges.ts
|
|
16636
|
-
function UserPrivilegesFromJSON(json) {
|
|
16637
|
-
return UserPrivilegesFromJSONTyped(json, false);
|
|
16638
|
-
}
|
|
16639
|
-
function UserPrivilegesFromJSONTyped(json, ignoreDiscriminator) {
|
|
16640
|
-
if (json == null) {
|
|
16641
|
-
return json;
|
|
16642
|
-
}
|
|
16643
|
-
return {
|
|
16644
|
-
userId: json["userId"] == null ? undefined : json["userId"],
|
|
16645
|
-
roles: json["roles"] == null ? undefined : RolePrivilegesFromJSON(json["roles"]),
|
|
16646
|
-
access: json["access"] == null ? undefined : AccessPrivilegeFromJSON(json["access"]),
|
|
16647
|
-
attendedSession: json["attendedSession"] == null ? undefined : BooleanPrivilegeFromJSON(json["attendedSession"]),
|
|
16648
|
-
personalWorkspace: json["personalWorkspace"] == null ? undefined : BooleanPrivilegeFromJSON(json["personalWorkspace"]),
|
|
16649
|
-
updatePolicy: json["updatePolicy"] == null ? undefined : UpdatePolicyPrivilegeFromJSON(json["updatePolicy"])
|
|
16650
|
-
};
|
|
16651
|
-
}
|
|
16652
|
-
// ../orchestrator-sdk/generated/src/models/UsersToggleRoleRequest.ts
|
|
16653
|
-
function UsersToggleRoleRequestToJSON(json) {
|
|
16654
|
-
return UsersToggleRoleRequestToJSONTyped(json, false);
|
|
16655
|
-
}
|
|
16656
|
-
function UsersToggleRoleRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
16657
|
-
if (value == null) {
|
|
16658
|
-
return value;
|
|
16659
|
-
}
|
|
16660
|
-
return {
|
|
16661
|
-
role: value["role"],
|
|
16662
|
-
toggle: value["toggle"]
|
|
16663
|
-
};
|
|
16664
|
-
}
|
|
16665
|
-
// ../orchestrator-sdk/generated/src/apis/UsersApi.ts
|
|
16666
|
-
class UsersApi extends BaseAPI {
|
|
16667
|
-
async usersAcquireLicenseRaw(initOverrides) {
|
|
16668
|
-
const queryParameters = {};
|
|
16669
|
-
const headerParameters = {};
|
|
16670
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16671
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16672
|
-
}
|
|
16673
|
-
let urlPath = `/api/Users/AcquireLicense`;
|
|
16674
|
-
const response = await this.request({
|
|
16675
|
-
path: urlPath,
|
|
16676
|
-
method: "POST",
|
|
16677
|
-
headers: headerParameters,
|
|
16678
|
-
query: queryParameters
|
|
16679
|
-
}, initOverrides);
|
|
16680
|
-
return new VoidApiResponse(response);
|
|
16681
|
-
}
|
|
16682
|
-
async usersAcquireLicense(initOverrides) {
|
|
16683
|
-
await this.usersAcquireLicenseRaw(initOverrides);
|
|
16684
|
-
}
|
|
16685
|
-
async usersAssignRolesByIdRaw(requestParameters, initOverrides) {
|
|
16686
|
-
if (requestParameters["key"] == null) {
|
|
16687
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersAssignRolesById().');
|
|
16688
|
-
}
|
|
16689
|
-
const queryParameters = {};
|
|
16690
|
-
const headerParameters = {};
|
|
16691
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
16692
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16693
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16694
|
-
}
|
|
16695
|
-
let urlPath = `/odata/Users({key})/UiPath.Server.Configuration.OData.AssignRoles`;
|
|
16696
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
16697
|
-
const response = await this.request({
|
|
16698
|
-
path: urlPath,
|
|
16699
|
-
method: "POST",
|
|
16700
|
-
headers: headerParameters,
|
|
16701
|
-
query: queryParameters,
|
|
16702
|
-
body: UserAssignRolesRequestToJSON(requestParameters["body"])
|
|
16703
|
-
}, initOverrides);
|
|
16704
|
-
return new VoidApiResponse(response);
|
|
16705
|
-
}
|
|
16706
|
-
async usersAssignRolesById(requestParameters, initOverrides) {
|
|
16707
|
-
await this.usersAssignRolesByIdRaw(requestParameters, initOverrides);
|
|
16708
|
-
}
|
|
16709
|
-
async usersChangeCultureRaw(requestParameters, initOverrides) {
|
|
16710
|
-
const queryParameters = {};
|
|
16711
|
-
const headerParameters = {};
|
|
16712
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
16713
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16714
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16715
|
-
}
|
|
16716
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.ChangeCulture`;
|
|
16717
|
-
const response = await this.request({
|
|
16718
|
-
path: urlPath,
|
|
16719
|
-
method: "POST",
|
|
16720
|
-
headers: headerParameters,
|
|
16721
|
-
query: queryParameters,
|
|
16722
|
-
body: UserChangeCultureRequestToJSON(requestParameters["body"])
|
|
16723
|
-
}, initOverrides);
|
|
16724
|
-
return new VoidApiResponse(response);
|
|
16725
|
-
}
|
|
16726
|
-
async usersChangeCulture(requestParameters = {}, initOverrides) {
|
|
16727
|
-
await this.usersChangeCultureRaw(requestParameters, initOverrides);
|
|
16728
|
-
}
|
|
16729
|
-
async usersChangeUserCultureByIdRaw(requestParameters, initOverrides) {
|
|
16730
|
-
if (requestParameters["key"] == null) {
|
|
16731
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersChangeUserCultureById().');
|
|
16732
|
-
}
|
|
16733
|
-
const queryParameters = {};
|
|
16734
|
-
const headerParameters = {};
|
|
16735
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
16736
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16737
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16738
|
-
}
|
|
16739
|
-
let urlPath = `/odata/Users({key})/UiPath.Server.Configuration.OData.ChangeUserCulture`;
|
|
16740
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
16741
|
-
const response = await this.request({
|
|
16742
|
-
path: urlPath,
|
|
16743
|
-
method: "POST",
|
|
16744
|
-
headers: headerParameters,
|
|
16745
|
-
query: queryParameters,
|
|
16746
|
-
body: UserChangeCultureRequestToJSON(requestParameters["body"])
|
|
16747
|
-
}, initOverrides);
|
|
16748
|
-
return new VoidApiResponse(response);
|
|
16749
|
-
}
|
|
16750
|
-
async usersChangeUserCultureById(requestParameters, initOverrides) {
|
|
16751
|
-
await this.usersChangeUserCultureByIdRaw(requestParameters, initOverrides);
|
|
16752
|
-
}
|
|
16753
|
-
async usersDeleteByIdRaw(requestParameters, initOverrides) {
|
|
16754
|
-
if (requestParameters["key"] == null) {
|
|
16755
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersDeleteById().');
|
|
16756
|
-
}
|
|
16757
|
-
const queryParameters = {};
|
|
16758
|
-
const headerParameters = {};
|
|
16759
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16760
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16761
|
-
}
|
|
16762
|
-
let urlPath = `/odata/Users({key})`;
|
|
16763
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
16764
|
-
const response = await this.request({
|
|
16765
|
-
path: urlPath,
|
|
16766
|
-
method: "DELETE",
|
|
16767
|
-
headers: headerParameters,
|
|
16768
|
-
query: queryParameters
|
|
16769
|
-
}, initOverrides);
|
|
16770
|
-
return new VoidApiResponse(response);
|
|
16771
|
-
}
|
|
16772
|
-
async usersDeleteById(requestParameters, initOverrides) {
|
|
16773
|
-
await this.usersDeleteByIdRaw(requestParameters, initOverrides);
|
|
16774
|
-
}
|
|
16775
|
-
async usersGetRaw(requestParameters, initOverrides) {
|
|
16776
|
-
const queryParameters = {};
|
|
16777
|
-
if (requestParameters["$select"] != null) {
|
|
16778
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16779
|
-
}
|
|
16780
|
-
if (requestParameters["$expand"] != null) {
|
|
16781
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16782
|
-
}
|
|
16783
|
-
if (requestParameters["$filter"] != null) {
|
|
16784
|
-
queryParameters["$filter"] = requestParameters["$filter"];
|
|
16785
|
-
}
|
|
16786
|
-
if (requestParameters["$orderby"] != null) {
|
|
16787
|
-
queryParameters["$orderby"] = requestParameters["$orderby"];
|
|
16788
|
-
}
|
|
16789
|
-
if (requestParameters["$top"] != null) {
|
|
16790
|
-
queryParameters["$top"] = requestParameters["$top"];
|
|
16791
|
-
}
|
|
16792
|
-
if (requestParameters["$skip"] != null) {
|
|
16793
|
-
queryParameters["$skip"] = requestParameters["$skip"];
|
|
16794
|
-
}
|
|
16795
|
-
if (requestParameters["$count"] != null) {
|
|
16796
|
-
queryParameters["$count"] = requestParameters["$count"];
|
|
16797
|
-
}
|
|
16798
|
-
const headerParameters = {};
|
|
16799
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16800
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16801
|
-
}
|
|
16802
|
-
let urlPath = `/odata/Users`;
|
|
16803
|
-
const response = await this.request({
|
|
16804
|
-
path: urlPath,
|
|
16805
|
-
method: "GET",
|
|
16806
|
-
headers: headerParameters,
|
|
16807
|
-
query: queryParameters
|
|
16808
|
-
}, initOverrides);
|
|
16809
|
-
return new JSONApiResponse(response, (jsonValue) => ODataValueOfIEnumerableOfUserDtoFromJSON(jsonValue));
|
|
16810
|
-
}
|
|
16811
|
-
async usersGet(requestParameters = {}, initOverrides) {
|
|
16812
|
-
const response = await this.usersGetRaw(requestParameters, initOverrides);
|
|
16813
|
-
return await response.value();
|
|
16814
|
-
}
|
|
16815
|
-
async usersGetAllPermissionsExtendedRaw(requestParameters, initOverrides) {
|
|
16816
|
-
const queryParameters = {};
|
|
16817
|
-
if (requestParameters["$select"] != null) {
|
|
16818
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16819
|
-
}
|
|
16820
|
-
if (requestParameters["$expand"] != null) {
|
|
16821
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16822
|
-
}
|
|
16823
|
-
if (requestParameters["$filter"] != null) {
|
|
16824
|
-
queryParameters["$filter"] = requestParameters["$filter"];
|
|
16825
|
-
}
|
|
16826
|
-
if (requestParameters["$orderby"] != null) {
|
|
16827
|
-
queryParameters["$orderby"] = requestParameters["$orderby"];
|
|
16828
|
-
}
|
|
16829
|
-
if (requestParameters["$count"] != null) {
|
|
16830
|
-
queryParameters["$count"] = requestParameters["$count"];
|
|
16831
|
-
}
|
|
16832
|
-
const headerParameters = {};
|
|
16833
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16834
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16835
|
-
}
|
|
16836
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetAllPermissionsExtended`;
|
|
16837
|
-
const response = await this.request({
|
|
16838
|
-
path: urlPath,
|
|
16839
|
-
method: "GET",
|
|
16840
|
-
headers: headerParameters,
|
|
16841
|
-
query: queryParameters
|
|
16842
|
-
}, initOverrides);
|
|
16843
|
-
return new JSONApiResponse(response, (jsonValue) => ODataValueOfIEnumerableOfUserPermissionsExtendedFromJSON(jsonValue));
|
|
16844
|
-
}
|
|
16845
|
-
async usersGetAllPermissionsExtended(requestParameters = {}, initOverrides) {
|
|
16846
|
-
const response = await this.usersGetAllPermissionsExtendedRaw(requestParameters, initOverrides);
|
|
16847
|
-
return await response.value();
|
|
16848
|
-
}
|
|
16849
|
-
async usersGetByIdRaw(requestParameters, initOverrides) {
|
|
16850
|
-
if (requestParameters["key"] == null) {
|
|
16851
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersGetById().');
|
|
16852
|
-
}
|
|
16853
|
-
const queryParameters = {};
|
|
16854
|
-
if (requestParameters["$select"] != null) {
|
|
16855
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16856
|
-
}
|
|
16857
|
-
if (requestParameters["$expand"] != null) {
|
|
16858
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16859
|
-
}
|
|
16860
|
-
const headerParameters = {};
|
|
16861
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16862
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16863
|
-
}
|
|
16864
|
-
let urlPath = `/odata/Users({key})`;
|
|
16865
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
16866
|
-
const response = await this.request({
|
|
16867
|
-
path: urlPath,
|
|
16868
|
-
method: "GET",
|
|
16869
|
-
headers: headerParameters,
|
|
16870
|
-
query: queryParameters
|
|
16871
|
-
}, initOverrides);
|
|
16872
|
-
return new JSONApiResponse(response, (jsonValue) => UserDtoFromJSON(jsonValue));
|
|
16873
|
-
}
|
|
16874
|
-
async usersGetById(requestParameters, initOverrides) {
|
|
16875
|
-
const response = await this.usersGetByIdRaw(requestParameters, initOverrides);
|
|
16876
|
-
return await response.value();
|
|
16877
|
-
}
|
|
16878
|
-
async usersGetByKeyByIdentifierRaw(requestParameters, initOverrides) {
|
|
16879
|
-
if (requestParameters["identifier"] == null) {
|
|
16880
|
-
throw new RequiredError("identifier", 'Required parameter "identifier" was null or undefined when calling usersGetByKeyByIdentifier().');
|
|
16881
|
-
}
|
|
16882
|
-
const queryParameters = {};
|
|
16883
|
-
if (requestParameters["$select"] != null) {
|
|
16884
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16885
|
-
}
|
|
16886
|
-
if (requestParameters["$expand"] != null) {
|
|
16887
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16888
|
-
}
|
|
16889
|
-
if (requestParameters["$filter"] != null) {
|
|
16890
|
-
queryParameters["$filter"] = requestParameters["$filter"];
|
|
16891
|
-
}
|
|
16892
|
-
if (requestParameters["$orderby"] != null) {
|
|
16893
|
-
queryParameters["$orderby"] = requestParameters["$orderby"];
|
|
16894
|
-
}
|
|
16895
|
-
if (requestParameters["$top"] != null) {
|
|
16896
|
-
queryParameters["$top"] = requestParameters["$top"];
|
|
16897
|
-
}
|
|
16898
|
-
if (requestParameters["$skip"] != null) {
|
|
16899
|
-
queryParameters["$skip"] = requestParameters["$skip"];
|
|
16900
|
-
}
|
|
16901
|
-
if (requestParameters["$count"] != null) {
|
|
16902
|
-
queryParameters["$count"] = requestParameters["$count"];
|
|
16903
|
-
}
|
|
16904
|
-
const headerParameters = {};
|
|
16905
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16906
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16907
|
-
}
|
|
16908
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetByKey(identifier={identifier})`;
|
|
16909
|
-
urlPath = urlPath.replace(`{${"identifier"}}`, encodeURIComponent(String(requestParameters["identifier"])));
|
|
16910
|
-
const response = await this.request({
|
|
16911
|
-
path: urlPath,
|
|
16912
|
-
method: "GET",
|
|
16913
|
-
headers: headerParameters,
|
|
16914
|
-
query: queryParameters
|
|
16915
|
-
}, initOverrides);
|
|
16916
|
-
return new JSONApiResponse(response, (jsonValue) => UserDtoFromJSON(jsonValue));
|
|
16917
|
-
}
|
|
16918
|
-
async usersGetByKeyByIdentifier(requestParameters, initOverrides) {
|
|
16919
|
-
const response = await this.usersGetByKeyByIdentifierRaw(requestParameters, initOverrides);
|
|
16920
|
-
return await response.value();
|
|
16921
|
-
}
|
|
16922
|
-
async usersGetCurrentPermissionsRaw(requestParameters, initOverrides) {
|
|
16923
|
-
const queryParameters = {};
|
|
16924
|
-
if (requestParameters["$select"] != null) {
|
|
16925
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16926
|
-
}
|
|
16927
|
-
if (requestParameters["$expand"] != null) {
|
|
16928
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16929
|
-
}
|
|
16930
|
-
const headerParameters = {};
|
|
16931
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16932
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16933
|
-
}
|
|
16934
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetCurrentPermissions`;
|
|
16935
|
-
const response = await this.request({
|
|
16936
|
-
path: urlPath,
|
|
16937
|
-
method: "GET",
|
|
16938
|
-
headers: headerParameters,
|
|
16939
|
-
query: queryParameters
|
|
16940
|
-
}, initOverrides);
|
|
16941
|
-
return new JSONApiResponse(response, (jsonValue) => UserPermissionsCollectionFromJSON(jsonValue));
|
|
16942
|
-
}
|
|
16943
|
-
async usersGetCurrentPermissions(requestParameters = {}, initOverrides) {
|
|
16944
|
-
const response = await this.usersGetCurrentPermissionsRaw(requestParameters, initOverrides);
|
|
16945
|
-
return await response.value();
|
|
16946
|
-
}
|
|
16947
|
-
async usersGetCurrentPermissionsExtendedRaw(requestParameters, initOverrides) {
|
|
16948
|
-
const queryParameters = {};
|
|
16949
|
-
if (requestParameters["$select"] != null) {
|
|
16950
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16951
|
-
}
|
|
16952
|
-
if (requestParameters["$expand"] != null) {
|
|
16953
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16954
|
-
}
|
|
16955
|
-
const headerParameters = {};
|
|
16956
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16957
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16958
|
-
}
|
|
16959
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetCurrentPermissionsExtended`;
|
|
16960
|
-
const response = await this.request({
|
|
16961
|
-
path: urlPath,
|
|
16962
|
-
method: "GET",
|
|
16963
|
-
headers: headerParameters,
|
|
16964
|
-
query: queryParameters
|
|
16965
|
-
}, initOverrides);
|
|
16966
|
-
return new JSONApiResponse(response, (jsonValue) => UserPermissionsExtendedFromJSON(jsonValue));
|
|
16967
|
-
}
|
|
16968
|
-
async usersGetCurrentPermissionsExtended(requestParameters = {}, initOverrides) {
|
|
16969
|
-
const response = await this.usersGetCurrentPermissionsExtendedRaw(requestParameters, initOverrides);
|
|
16970
|
-
return await response.value();
|
|
16971
|
-
}
|
|
16972
|
-
async usersGetCurrentUserRaw(requestParameters, initOverrides) {
|
|
16973
|
-
const queryParameters = {};
|
|
16974
|
-
if (requestParameters["$select"] != null) {
|
|
16975
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
16976
|
-
}
|
|
16977
|
-
if (requestParameters["$expand"] != null) {
|
|
16978
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
16979
|
-
}
|
|
16980
|
-
const headerParameters = {};
|
|
16981
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
16982
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
16983
|
-
}
|
|
16984
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetCurrentUser`;
|
|
16985
|
-
const response = await this.request({
|
|
16986
|
-
path: urlPath,
|
|
16987
|
-
method: "GET",
|
|
16988
|
-
headers: headerParameters,
|
|
16989
|
-
query: queryParameters
|
|
16990
|
-
}, initOverrides);
|
|
16991
|
-
return new JSONApiResponse(response, (jsonValue) => UserDtoFromJSON(jsonValue));
|
|
16992
|
-
}
|
|
16993
|
-
async usersGetCurrentUser(requestParameters = {}, initOverrides) {
|
|
16994
|
-
const response = await this.usersGetCurrentUserRaw(requestParameters, initOverrides);
|
|
16995
|
-
switch (response.raw.status) {
|
|
16996
|
-
case 200:
|
|
16997
|
-
return await response.value();
|
|
16998
|
-
case 204:
|
|
16999
|
-
return null;
|
|
17000
|
-
default:
|
|
17001
|
-
return await response.value();
|
|
17002
|
-
}
|
|
17003
|
-
}
|
|
17004
|
-
async usersGetCurrentUserExtendedRaw(requestParameters, initOverrides) {
|
|
17005
|
-
const queryParameters = {};
|
|
17006
|
-
if (requestParameters["$select"] != null) {
|
|
17007
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
17008
|
-
}
|
|
17009
|
-
if (requestParameters["$expand"] != null) {
|
|
17010
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
17011
|
-
}
|
|
17012
|
-
const headerParameters = {};
|
|
17013
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17014
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17015
|
-
}
|
|
17016
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetCurrentUserExtended`;
|
|
17017
|
-
const response = await this.request({
|
|
17018
|
-
path: urlPath,
|
|
17019
|
-
method: "GET",
|
|
17020
|
-
headers: headerParameters,
|
|
17021
|
-
query: queryParameters
|
|
17022
|
-
}, initOverrides);
|
|
17023
|
-
return new JSONApiResponse(response, (jsonValue) => ExtendedUserDtoFromJSON(jsonValue));
|
|
17024
|
-
}
|
|
17025
|
-
async usersGetCurrentUserExtended(requestParameters = {}, initOverrides) {
|
|
17026
|
-
const response = await this.usersGetCurrentUserExtendedRaw(requestParameters, initOverrides);
|
|
17027
|
-
switch (response.raw.status) {
|
|
17028
|
-
case 200:
|
|
17029
|
-
return await response.value();
|
|
17030
|
-
case 204:
|
|
17031
|
-
return null;
|
|
17032
|
-
default:
|
|
17033
|
-
return await response.value();
|
|
17034
|
-
}
|
|
17035
|
-
}
|
|
17036
|
-
async usersGetDirectoryPrivilegesRaw(requestParameters, initOverrides) {
|
|
17037
|
-
const queryParameters = {};
|
|
17038
|
-
if (requestParameters["identifier"] != null) {
|
|
17039
|
-
queryParameters["identifier"] = requestParameters["identifier"];
|
|
17040
|
-
}
|
|
17041
|
-
if (requestParameters["type"] != null) {
|
|
17042
|
-
queryParameters["type"] = requestParameters["type"];
|
|
17043
|
-
}
|
|
17044
|
-
const headerParameters = {};
|
|
17045
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17046
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17047
|
-
}
|
|
17048
|
-
let urlPath = `/api/Users/GetDirectoryPrivileges`;
|
|
17049
|
-
const response = await this.request({
|
|
17050
|
-
path: urlPath,
|
|
17051
|
-
method: "GET",
|
|
17052
|
-
headers: headerParameters,
|
|
17053
|
-
query: queryParameters
|
|
17054
|
-
}, initOverrides);
|
|
17055
|
-
return new JSONApiResponse(response, (jsonValue) => UserPrivilegesFromJSON(jsonValue));
|
|
17056
|
-
}
|
|
17057
|
-
async usersGetDirectoryPrivileges(requestParameters = {}, initOverrides) {
|
|
17058
|
-
const response = await this.usersGetDirectoryPrivilegesRaw(requestParameters, initOverrides);
|
|
17059
|
-
return await response.value();
|
|
17060
|
-
}
|
|
17061
|
-
async usersGetPrivilegesRaw(requestParameters, initOverrides) {
|
|
17062
|
-
const queryParameters = {};
|
|
17063
|
-
if (requestParameters["userId"] != null) {
|
|
17064
|
-
queryParameters["userId"] = requestParameters["userId"];
|
|
17065
|
-
}
|
|
17066
|
-
const headerParameters = {};
|
|
17067
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17068
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17069
|
-
}
|
|
17070
|
-
let urlPath = `/api/Users/GetPrivileges`;
|
|
17071
|
-
const response = await this.request({
|
|
17072
|
-
path: urlPath,
|
|
17073
|
-
method: "GET",
|
|
17074
|
-
headers: headerParameters,
|
|
17075
|
-
query: queryParameters
|
|
17076
|
-
}, initOverrides);
|
|
17077
|
-
return new JSONApiResponse(response, (jsonValue) => UserPrivilegesFromJSON(jsonValue));
|
|
17078
|
-
}
|
|
17079
|
-
async usersGetPrivileges(requestParameters = {}, initOverrides) {
|
|
17080
|
-
const response = await this.usersGetPrivilegesRaw(requestParameters, initOverrides);
|
|
17081
|
-
return await response.value();
|
|
17082
|
-
}
|
|
17083
|
-
async usersGetUserIdByUserkeyRaw(requestParameters, initOverrides) {
|
|
17084
|
-
if (requestParameters["userKey"] == null) {
|
|
17085
|
-
throw new RequiredError("userKey", 'Required parameter "userKey" was null or undefined when calling usersGetUserIdByUserkey().');
|
|
17086
|
-
}
|
|
17087
|
-
const queryParameters = {};
|
|
17088
|
-
if (requestParameters["$select"] != null) {
|
|
17089
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
17090
|
-
}
|
|
17091
|
-
if (requestParameters["$expand"] != null) {
|
|
17092
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
17093
|
-
}
|
|
17094
|
-
const headerParameters = {};
|
|
17095
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17096
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17097
|
-
}
|
|
17098
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.GetUserId(userKey='{userKey}')`;
|
|
17099
|
-
urlPath = urlPath.replace(`{${"userKey"}}`, encodeURIComponent(String(requestParameters["userKey"])));
|
|
17100
|
-
const response = await this.request({
|
|
17101
|
-
path: urlPath,
|
|
17102
|
-
method: "GET",
|
|
17103
|
-
headers: headerParameters,
|
|
17104
|
-
query: queryParameters
|
|
17105
|
-
}, initOverrides);
|
|
17106
|
-
return new JSONApiResponse(response, (jsonValue) => ODataValueOfInt64FromJSON(jsonValue));
|
|
17107
|
-
}
|
|
17108
|
-
async usersGetUserIdByUserkey(requestParameters, initOverrides) {
|
|
17109
|
-
const response = await this.usersGetUserIdByUserkeyRaw(requestParameters, initOverrides);
|
|
17110
|
-
return await response.value();
|
|
17111
|
-
}
|
|
17112
|
-
async usersGetUsersWithPermissionsRaw(requestParameters, initOverrides) {
|
|
17113
|
-
const queryParameters = {};
|
|
17114
|
-
const headerParameters = {};
|
|
17115
|
-
headerParameters["Content-Type"] = "application/json";
|
|
17116
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17117
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17118
|
-
}
|
|
17119
|
-
let urlPath = `/api/Users/GetUsersWithPermissions`;
|
|
17120
|
-
const response = await this.request({
|
|
17121
|
-
path: urlPath,
|
|
17122
|
-
method: "POST",
|
|
17123
|
-
headers: headerParameters,
|
|
17124
|
-
query: queryParameters,
|
|
17125
|
-
body: GetUsersModelToJSON(requestParameters["body"])
|
|
17126
|
-
}, initOverrides);
|
|
17127
|
-
return new JSONApiResponse(response, (jsonValue) => UserIdTypeCollectionDtoFromJSON(jsonValue));
|
|
17128
|
-
}
|
|
17129
|
-
async usersGetUsersWithPermissions(requestParameters = {}, initOverrides) {
|
|
17130
|
-
const response = await this.usersGetUsersWithPermissionsRaw(requestParameters, initOverrides);
|
|
17131
|
-
return await response.value();
|
|
17132
|
-
}
|
|
17133
|
-
async usersPatchByIdRaw(requestParameters, initOverrides) {
|
|
17134
|
-
if (requestParameters["key"] == null) {
|
|
17135
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersPatchById().');
|
|
17136
|
-
}
|
|
17137
|
-
const queryParameters = {};
|
|
17138
|
-
const headerParameters = {};
|
|
17139
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
17140
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17141
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17142
|
-
}
|
|
17143
|
-
let urlPath = `/odata/Users({key})`;
|
|
17144
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
17145
|
-
const response = await this.request({
|
|
17146
|
-
path: urlPath,
|
|
17147
|
-
method: "PATCH",
|
|
17148
|
-
headers: headerParameters,
|
|
17149
|
-
query: queryParameters,
|
|
17150
|
-
body: UserDtoToJSON(requestParameters["body"])
|
|
17151
|
-
}, initOverrides);
|
|
17152
|
-
return new VoidApiResponse(response);
|
|
17153
|
-
}
|
|
17154
|
-
async usersPatchById(requestParameters, initOverrides) {
|
|
17155
|
-
await this.usersPatchByIdRaw(requestParameters, initOverrides);
|
|
17156
|
-
}
|
|
17157
|
-
async usersPostRaw(requestParameters, initOverrides) {
|
|
17158
|
-
const queryParameters = {};
|
|
17159
|
-
const headerParameters = {};
|
|
17160
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
17161
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17162
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17163
|
-
}
|
|
17164
|
-
let urlPath = `/odata/Users`;
|
|
17165
|
-
const response = await this.request({
|
|
17166
|
-
path: urlPath,
|
|
17167
|
-
method: "POST",
|
|
17168
|
-
headers: headerParameters,
|
|
17169
|
-
query: queryParameters,
|
|
17170
|
-
body: UserDtoToJSON(requestParameters["body"])
|
|
17171
|
-
}, initOverrides);
|
|
17172
|
-
return new JSONApiResponse(response, (jsonValue) => UserDtoFromJSON(jsonValue));
|
|
17173
|
-
}
|
|
17174
|
-
async usersPost(requestParameters = {}, initOverrides) {
|
|
17175
|
-
const response = await this.usersPostRaw(requestParameters, initOverrides);
|
|
17176
|
-
return await response.value();
|
|
17177
|
-
}
|
|
17178
|
-
async usersPutByIdRaw(requestParameters, initOverrides) {
|
|
17179
|
-
if (requestParameters["key"] == null) {
|
|
17180
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersPutById().');
|
|
17181
|
-
}
|
|
17182
|
-
const queryParameters = {};
|
|
17183
|
-
const headerParameters = {};
|
|
17184
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
17185
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17186
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17187
|
-
}
|
|
17188
|
-
let urlPath = `/odata/Users({key})`;
|
|
17189
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
17190
|
-
const response = await this.request({
|
|
17191
|
-
path: urlPath,
|
|
17192
|
-
method: "PUT",
|
|
17193
|
-
headers: headerParameters,
|
|
17194
|
-
query: queryParameters,
|
|
17195
|
-
body: UserDtoToJSON(requestParameters["body"])
|
|
17196
|
-
}, initOverrides);
|
|
17197
|
-
return new VoidApiResponse(response);
|
|
17198
|
-
}
|
|
17199
|
-
async usersPutById(requestParameters, initOverrides) {
|
|
17200
|
-
await this.usersPutByIdRaw(requestParameters, initOverrides);
|
|
17201
|
-
}
|
|
17202
|
-
async usersRevokeExplicitPrivilegesRaw(requestParameters, initOverrides) {
|
|
17203
|
-
const queryParameters = {};
|
|
17204
|
-
const headerParameters = {};
|
|
17205
|
-
headerParameters["Content-Type"] = "application/json";
|
|
17206
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17207
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17208
|
-
}
|
|
17209
|
-
let urlPath = `/api/Users/RevokeExplicitPrivileges`;
|
|
17210
|
-
const response = await this.request({
|
|
17211
|
-
path: urlPath,
|
|
17212
|
-
method: "POST",
|
|
17213
|
-
headers: headerParameters,
|
|
17214
|
-
query: queryParameters,
|
|
17215
|
-
body: RevokeExplicitPrivilegesRequestToJSON(requestParameters["body"])
|
|
17216
|
-
}, initOverrides);
|
|
17217
|
-
return new VoidApiResponse(response);
|
|
17218
|
-
}
|
|
17219
|
-
async usersRevokeExplicitPrivileges(requestParameters = {}, initOverrides) {
|
|
17220
|
-
await this.usersRevokeExplicitPrivilegesRaw(requestParameters, initOverrides);
|
|
17221
|
-
}
|
|
17222
|
-
async usersToggleRoleByIdRaw(requestParameters, initOverrides) {
|
|
17223
|
-
if (requestParameters["key"] == null) {
|
|
17224
|
-
throw new RequiredError("key", 'Required parameter "key" was null or undefined when calling usersToggleRoleById().');
|
|
17225
|
-
}
|
|
17226
|
-
const queryParameters = {};
|
|
17227
|
-
const headerParameters = {};
|
|
17228
|
-
headerParameters["Content-Type"] = "application/json;odata.metadata=minimal;odata.streaming=true";
|
|
17229
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17230
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17231
|
-
}
|
|
17232
|
-
let urlPath = `/odata/Users({key})/UiPath.Server.Configuration.OData.ToggleRole`;
|
|
17233
|
-
urlPath = urlPath.replace(`{${"key"}}`, encodeURIComponent(String(requestParameters["key"])));
|
|
17234
|
-
const response = await this.request({
|
|
17235
|
-
path: urlPath,
|
|
17236
|
-
method: "POST",
|
|
17237
|
-
headers: headerParameters,
|
|
17238
|
-
query: queryParameters,
|
|
17239
|
-
body: UsersToggleRoleRequestToJSON(requestParameters["body"])
|
|
17240
|
-
}, initOverrides);
|
|
17241
|
-
return new VoidApiResponse(response);
|
|
17242
|
-
}
|
|
17243
|
-
async usersToggleRoleById(requestParameters, initOverrides) {
|
|
17244
|
-
await this.usersToggleRoleByIdRaw(requestParameters, initOverrides);
|
|
17245
|
-
}
|
|
17246
|
-
async usersValidateByUseridsRaw(requestParameters, initOverrides) {
|
|
17247
|
-
if (requestParameters["userIds"] == null) {
|
|
17248
|
-
throw new RequiredError("userIds", 'Required parameter "userIds" was null or undefined when calling usersValidateByUserids().');
|
|
17249
|
-
}
|
|
17250
|
-
const queryParameters = {};
|
|
17251
|
-
if (requestParameters["$select"] != null) {
|
|
17252
|
-
queryParameters["$select"] = requestParameters["$select"];
|
|
17253
|
-
}
|
|
17254
|
-
if (requestParameters["$expand"] != null) {
|
|
17255
|
-
queryParameters["$expand"] = requestParameters["$expand"];
|
|
17256
|
-
}
|
|
17257
|
-
if (requestParameters["$filter"] != null) {
|
|
17258
|
-
queryParameters["$filter"] = requestParameters["$filter"];
|
|
17259
|
-
}
|
|
17260
|
-
if (requestParameters["$orderby"] != null) {
|
|
17261
|
-
queryParameters["$orderby"] = requestParameters["$orderby"];
|
|
17262
|
-
}
|
|
17263
|
-
if (requestParameters["$count"] != null) {
|
|
17264
|
-
queryParameters["$count"] = requestParameters["$count"];
|
|
17265
|
-
}
|
|
17266
|
-
const headerParameters = {};
|
|
17267
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
17268
|
-
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", []);
|
|
17269
|
-
}
|
|
17270
|
-
let urlPath = `/odata/Users/UiPath.Server.Configuration.OData.Validate(userIds=[{userIds}])`;
|
|
17271
|
-
urlPath = urlPath.replace(`{${"userIds"}}`, encodeURIComponent(String(requestParameters["userIds"])));
|
|
17272
|
-
const response = await this.request({
|
|
17273
|
-
path: urlPath,
|
|
17274
|
-
method: "GET",
|
|
17275
|
-
headers: headerParameters,
|
|
17276
|
-
query: queryParameters
|
|
17277
|
-
}, initOverrides);
|
|
17278
|
-
return new JSONApiResponse(response, (jsonValue) => ODataValueOfIDictionaryOfInt64BooleanFromJSON(jsonValue));
|
|
17279
|
-
}
|
|
17280
|
-
async usersValidateByUserids(requestParameters, initOverrides) {
|
|
17281
|
-
const response = await this.usersValidateByUseridsRaw(requestParameters, initOverrides);
|
|
17282
|
-
return await response.value();
|
|
17283
|
-
}
|
|
17284
|
-
}
|
|
17285
|
-
// ../orchestrator-sdk/src/client-factory.ts
|
|
17286
|
-
async function createOrchestratorConfig(options) {
|
|
17287
|
-
const ctx = await getAuthContext({
|
|
17288
|
-
tenant: options?.tenant,
|
|
17289
|
-
ensureTokenValidityMinutes: options?.loginValidity,
|
|
17290
|
-
envFilePath: options?.envFilePath
|
|
17291
|
-
});
|
|
17292
|
-
const orchestratorBasePath = ctx.organizationId && ctx.tenantName ? `${ctx.baseUrl}/${ctx.organizationId}/${ctx.tenantName}/orchestrator_` : ctx.baseUrl;
|
|
17293
|
-
const headers = addSdkUserAgentHeader({
|
|
17294
|
-
Authorization: `Bearer ${ctx.accessToken}`
|
|
17295
|
-
}, SDK_USER_AGENT);
|
|
17296
|
-
if (options?.folderId) {
|
|
17297
|
-
headers["X-UIPATH-OrganizationUnitId"] = options.folderId;
|
|
17298
|
-
} else if (options?.folderKey && options?.folderPath) {
|
|
17299
|
-
throw new Error("Provide either folderKey or folderPath, not both.");
|
|
17300
|
-
} else if (options?.folderKey) {
|
|
17301
|
-
headers["X-UIPATH-FolderKey"] = options.folderKey;
|
|
17302
|
-
} else if (options?.folderPath) {
|
|
17303
|
-
headers["X-UIPATH-FolderPath"] = options.folderPath;
|
|
17304
|
-
}
|
|
17305
|
-
return new Configuration({
|
|
17306
|
-
basePath: orchestratorBasePath,
|
|
17307
|
-
headers
|
|
17308
|
-
});
|
|
17309
|
-
}
|
|
17310
|
-
async function createApiClient(ApiClass, options) {
|
|
17311
|
-
const config = await createOrchestratorConfig(options);
|
|
17312
|
-
return new ApiClass(config);
|
|
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
|
-
};
|
|
17320
|
-
// ../solution-sdk/src/resources/providers/solution-access-provider.ts
|
|
17321
|
-
var ORG_SCOPED_SERVICES = new Set(["apps", "authz"]);
|
|
17322
|
-
|
|
17323
|
-
class SolutionAccessProvider {
|
|
17324
|
-
loginStatus = null;
|
|
17325
|
-
userKey = undefined;
|
|
17326
|
-
async getStatus() {
|
|
17327
|
-
if (!this.loginStatus) {
|
|
17328
|
-
this.loginStatus = await getLoginStatusAsync();
|
|
17329
|
-
}
|
|
17330
|
-
return this.loginStatus;
|
|
17331
|
-
}
|
|
17332
|
-
async getResourceUrlAsync(scope, _cancellationToken) {
|
|
17333
|
-
const status = await this.getStatus();
|
|
17334
|
-
if (!status.baseUrl || !status.organizationName || !status.tenantName) {
|
|
17335
|
-
return null;
|
|
17336
|
-
}
|
|
17337
|
-
if (!scope) {
|
|
17338
|
-
return status.baseUrl;
|
|
17339
|
-
}
|
|
17340
|
-
const safeScope = scope.toLowerCase().replace(/[^a-z0-9_-]/g, "");
|
|
17341
|
-
if (!safeScope) {
|
|
17342
|
-
return status.baseUrl;
|
|
17343
|
-
}
|
|
17344
|
-
if (ORG_SCOPED_SERVICES.has(safeScope)) {
|
|
17345
|
-
return `${status.baseUrl}/${status.organizationName}/${safeScope}_`;
|
|
17346
|
-
}
|
|
17347
|
-
return `${status.baseUrl}/${status.organizationName}/${status.tenantName}/${safeScope}_`;
|
|
17348
|
-
}
|
|
17349
|
-
async getResourceUrlWithAuthAsync(scope, _authInfo, _cancellationToken) {
|
|
17350
|
-
return this.getResourceUrlAsync(scope);
|
|
17351
|
-
}
|
|
17352
|
-
async getAccessTokenAsync(_scopes, _force, _cancellationToken) {
|
|
17353
|
-
const status = await this.getStatus();
|
|
17354
|
-
return status.accessToken ?? null;
|
|
17355
|
-
}
|
|
17356
|
-
async getUserKeyAsync(_cancellationToken) {
|
|
17357
|
-
if (this.userKey !== undefined) {
|
|
17358
|
-
return this.userKey;
|
|
17359
|
-
}
|
|
17360
|
-
const [apiError, api] = await catchError(createApiClient(UsersApi));
|
|
17361
|
-
if (apiError) {
|
|
17362
|
-
logger.warn(`Failed to create UsersApi client: ${apiError.message}`);
|
|
17363
|
-
return null;
|
|
17364
|
-
}
|
|
17365
|
-
const [userError, user] = await catchError(api.usersGetCurrentUser());
|
|
17366
|
-
if (userError || !user?.key) {
|
|
17367
|
-
logger.warn(`Failed to get current user key: ${userError?.message ?? "no key in response"}`);
|
|
17368
|
-
return null;
|
|
17369
|
-
}
|
|
17370
|
-
this.userKey = user.key;
|
|
17371
|
-
return this.userKey;
|
|
17372
|
-
}
|
|
17373
|
-
async getTenantKeyAsync(_cancellationToken) {
|
|
17374
|
-
const status = await this.getStatus();
|
|
17375
|
-
return status.tenantId ?? null;
|
|
17376
|
-
}
|
|
17377
|
-
async getAccountKeyAsync(_cancellationToken) {
|
|
17378
|
-
const status = await this.getStatus();
|
|
17379
|
-
return status.organizationId ?? null;
|
|
17380
|
-
}
|
|
17381
|
-
isGatewayIntegrationEnabled() {
|
|
17382
|
-
return false;
|
|
16033
|
+
isGatewayIntegrationEnabled() {
|
|
16034
|
+
return false;
|
|
17383
16035
|
}
|
|
17384
16036
|
}
|
|
17385
16037
|
|
|
@@ -17549,6 +16201,108 @@ async function createProjectInSolutionBuilder(solutionDir, projectId, projectNam
|
|
|
17549
16201
|
await catchError(solutionBuilder.disposeAsync());
|
|
17550
16202
|
return createError;
|
|
17551
16203
|
}
|
|
16204
|
+
// ../solution-sdk/src/resources/services/catalog-lookup-failure.ts
|
|
16205
|
+
var NO_CLIENT_MESSAGE = "Unable to create Resource Catalog client";
|
|
16206
|
+
function classifyCatalogFailure(error) {
|
|
16207
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
16208
|
+
if (message.includes(NO_CLIENT_MESSAGE)) {
|
|
16209
|
+
return { message, kind: "no_session" };
|
|
16210
|
+
}
|
|
16211
|
+
const match = /\bHTTP (\d{3})\b/.exec(message);
|
|
16212
|
+
const status = match ? Number(match[1]) : undefined;
|
|
16213
|
+
if (status === 401 || status === 403) {
|
|
16214
|
+
return { message, kind: "refused", status };
|
|
16215
|
+
}
|
|
16216
|
+
return { message, kind: "failed", ...status ? { status } : {} };
|
|
16217
|
+
}
|
|
16218
|
+
function stopsCatalogLookups(failure) {
|
|
16219
|
+
return failure.kind !== "failed";
|
|
16220
|
+
}
|
|
16221
|
+
function describeBindings(bindings) {
|
|
16222
|
+
return bindings.map((b) => `${b.kind} "${b.name}"`).join(", ");
|
|
16223
|
+
}
|
|
16224
|
+
function describeCause(failure) {
|
|
16225
|
+
switch (failure.kind) {
|
|
16226
|
+
case "no_session":
|
|
16227
|
+
return "There is no login, so the Resource Catalog could not be searched";
|
|
16228
|
+
case "refused":
|
|
16229
|
+
return `The Resource Catalog refused this login (${failure.message})`;
|
|
16230
|
+
default:
|
|
16231
|
+
return `A Resource Catalog call failed (${failure.message})`;
|
|
16232
|
+
}
|
|
16233
|
+
}
|
|
16234
|
+
function classify(failure) {
|
|
16235
|
+
const refreshAndCommit = "or run 'uip solution resources refresh' under a login the Resource Catalog accepts and commit the solution's resources. The resources already in the solution are used as they are.";
|
|
16236
|
+
if (failure.kind === "no_session") {
|
|
16237
|
+
return {
|
|
16238
|
+
errorCode: "authentication_required",
|
|
16239
|
+
retry: "RetryWillNotFix",
|
|
16240
|
+
instructions: `Run 'uip login', then re-run; ${refreshAndCommit}`
|
|
16241
|
+
};
|
|
16242
|
+
}
|
|
16243
|
+
if (failure.kind === "refused") {
|
|
16244
|
+
return {
|
|
16245
|
+
errorCode: "permission_denied",
|
|
16246
|
+
retry: "RetryWillNotFix",
|
|
16247
|
+
instructions: `Use a login the Resource Catalog accepts (a user login: 'uip login'), ${refreshAndCommit}`
|
|
16248
|
+
};
|
|
16249
|
+
}
|
|
16250
|
+
const status = failure.status;
|
|
16251
|
+
if (status === 429) {
|
|
16252
|
+
return {
|
|
16253
|
+
errorCode: "rate_limited",
|
|
16254
|
+
retry: "RetryLater",
|
|
16255
|
+
instructions: `Wait, then re-run; ${refreshAndCommit}`
|
|
16256
|
+
};
|
|
16257
|
+
}
|
|
16258
|
+
if (status !== undefined && status >= 500) {
|
|
16259
|
+
return {
|
|
16260
|
+
errorCode: "server_error",
|
|
16261
|
+
retry: "RetryLater",
|
|
16262
|
+
instructions: `Retry once the Resource Catalog is back; ${refreshAndCommit}`
|
|
16263
|
+
};
|
|
16264
|
+
}
|
|
16265
|
+
if (status !== undefined && status >= 400) {
|
|
16266
|
+
return {
|
|
16267
|
+
errorCode: "unknown_error",
|
|
16268
|
+
retry: "RetryWillNotFix",
|
|
16269
|
+
instructions: `The Resource Catalog rejected the lookup for these bindings, so a retry gets the same answer. Check them in the project's bindings, ${refreshAndCommit}`
|
|
16270
|
+
};
|
|
16271
|
+
}
|
|
16272
|
+
return {
|
|
16273
|
+
errorCode: "unknown_error",
|
|
16274
|
+
retry: "RetryLater",
|
|
16275
|
+
instructions: `Retry; if it keeps failing, ${refreshAndCommit}`
|
|
16276
|
+
};
|
|
16277
|
+
}
|
|
16278
|
+
function catalogLookupWarning(failure, kept, unresolved) {
|
|
16279
|
+
const parts = [
|
|
16280
|
+
`${describeCause(failure)}, so ${kept + unresolved.length} binding(s) were not checked against the cloud.`
|
|
16281
|
+
];
|
|
16282
|
+
if (kept > 0) {
|
|
16283
|
+
parts.push(`${kept} already in the solution were kept as they are.`);
|
|
16284
|
+
}
|
|
16285
|
+
if (unresolved.length > 0) {
|
|
16286
|
+
parts.push(`Not added to the solution: ${describeBindings(unresolved)}.`);
|
|
16287
|
+
}
|
|
16288
|
+
return parts.join(" ");
|
|
16289
|
+
}
|
|
16290
|
+
|
|
16291
|
+
class CatalogLookupError extends Error {
|
|
16292
|
+
errorCode;
|
|
16293
|
+
retry;
|
|
16294
|
+
instructions;
|
|
16295
|
+
unresolved;
|
|
16296
|
+
constructor(failure, unresolved) {
|
|
16297
|
+
super(`${describeCause(failure)}, so these bindings could not be resolved and are not in the solution: ${describeBindings(unresolved)}.`);
|
|
16298
|
+
this.name = "CatalogLookupError";
|
|
16299
|
+
const { errorCode, retry, instructions } = classify(failure);
|
|
16300
|
+
this.errorCode = errorCode;
|
|
16301
|
+
this.retry = retry;
|
|
16302
|
+
this.instructions = instructions;
|
|
16303
|
+
this.unresolved = unresolved;
|
|
16304
|
+
}
|
|
16305
|
+
}
|
|
17552
16306
|
// ../solution-sdk/src/resources/services/local-resource-matcher.ts
|
|
17553
16307
|
function normalizeFolderPath(path) {
|
|
17554
16308
|
if (!path)
|
|
@@ -17654,6 +16408,20 @@ async function findCatalogEntityAsync(catalog, query, match) {
|
|
|
17654
16408
|
} while (pageCursor);
|
|
17655
16409
|
return;
|
|
17656
16410
|
}
|
|
16411
|
+
async function findCatalogEntitiesAsync(catalog, query, match) {
|
|
16412
|
+
const found = [];
|
|
16413
|
+
let pageCursor;
|
|
16414
|
+
do {
|
|
16415
|
+
const page = await catalog.searchFolderEntities({
|
|
16416
|
+
...query,
|
|
16417
|
+
pageSize: 100,
|
|
16418
|
+
pageCursor
|
|
16419
|
+
});
|
|
16420
|
+
found.push(...(page.items ?? []).filter(match));
|
|
16421
|
+
pageCursor = page.nextPage ?? undefined;
|
|
16422
|
+
} while (pageCursor);
|
|
16423
|
+
return found;
|
|
16424
|
+
}
|
|
17657
16425
|
function toResourceReference(entity) {
|
|
17658
16426
|
return toCatalogReference({
|
|
17659
16427
|
kind: entity.entityType ?? "",
|
|
@@ -17707,7 +16475,7 @@ function parseJsonString(raw) {
|
|
|
17707
16475
|
return error ? undefined : parsed;
|
|
17708
16476
|
}
|
|
17709
16477
|
// ../solution-sdk/src/resources/services/resource-casing.ts
|
|
17710
|
-
var
|
|
16478
|
+
var RESOURCE_FILES_FOLDER_NAME2 = "resources";
|
|
17711
16479
|
function lowerFirstChar(value) {
|
|
17712
16480
|
return value ? value.charAt(0).toLowerCase() + value.slice(1) : value;
|
|
17713
16481
|
}
|
|
@@ -17736,7 +16504,7 @@ async function saveCasingNormalized(builder) {
|
|
|
17736
16504
|
}
|
|
17737
16505
|
async function normalizeResourceFileCasing(solutionDir) {
|
|
17738
16506
|
const fs = getFileSystem();
|
|
17739
|
-
const root = fs.path.join(solutionDir,
|
|
16507
|
+
const root = fs.path.join(solutionDir, RESOURCE_FILES_FOLDER_NAME2);
|
|
17740
16508
|
if (!await fs.exists(root))
|
|
17741
16509
|
return [];
|
|
17742
16510
|
const byTarget = new Map;
|
|
@@ -17784,13 +16552,17 @@ function targetSegments(segments, kind, type) {
|
|
|
17784
16552
|
const kindIndex = type ? target.length - 3 : target.length - 2;
|
|
17785
16553
|
if (kindIndex < 0)
|
|
17786
16554
|
return target;
|
|
17787
|
-
if (target[kindIndex]
|
|
16555
|
+
if (sameIgnoringCase(target[kindIndex], kind)) {
|
|
17788
16556
|
target[kindIndex] = lowerFirstChar(kind);
|
|
17789
|
-
|
|
16557
|
+
}
|
|
16558
|
+
if (type && sameIgnoringCase(target[kindIndex + 1], type)) {
|
|
17790
16559
|
target[kindIndex + 1] = lowerFirstChar(type);
|
|
17791
16560
|
}
|
|
17792
16561
|
return target;
|
|
17793
16562
|
}
|
|
16563
|
+
function sameIgnoringCase(a, b) {
|
|
16564
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
16565
|
+
}
|
|
17794
16566
|
async function collectResourceFiles(root, segments) {
|
|
17795
16567
|
const fs = getFileSystem();
|
|
17796
16568
|
const [readError, names] = await catchError(fs.readdir(fs.path.join(root, ...segments)));
|
|
@@ -17863,6 +16635,118 @@ function parseResourceHeader(content) {
|
|
|
17863
16635
|
return null;
|
|
17864
16636
|
}
|
|
17865
16637
|
}
|
|
16638
|
+
// ../solution-sdk/src/resources/services/resource-configurations.ts
|
|
16639
|
+
var ROOT_RESOURCE_TYPES = new Set(["resource", "solutionresource"]);
|
|
16640
|
+
var KEY_NOT_FOUND = /^(?:Solution)?Resource with key '([^']+)' was not found$/i;
|
|
16641
|
+
function isResourceKeyNotFound(error, resourceKey) {
|
|
16642
|
+
if (!(error instanceof Error))
|
|
16643
|
+
return false;
|
|
16644
|
+
const typed = error;
|
|
16645
|
+
const sameKey = (key) => key !== undefined && key.toLowerCase() === resourceKey.toLowerCase();
|
|
16646
|
+
if (typeof typed.resourceType === "string" && typeof typed.resourceKey === "string") {
|
|
16647
|
+
return ROOT_RESOURCE_TYPES.has(typed.resourceType.toLowerCase()) && sameKey(typed.resourceKey);
|
|
16648
|
+
}
|
|
16649
|
+
return sameKey(KEY_NOT_FOUND.exec(error.message.trim())?.[1]);
|
|
16650
|
+
}
|
|
16651
|
+
async function refreshArtefactSpecsAsync(builder, configurations) {
|
|
16652
|
+
const resources = new Map;
|
|
16653
|
+
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
16654
|
+
if (loadError || !solution)
|
|
16655
|
+
return resources;
|
|
16656
|
+
for (const configuration of configurations) {
|
|
16657
|
+
const resource = solution.resources.find((r) => r.key === configuration?.key);
|
|
16658
|
+
if (!resource)
|
|
16659
|
+
continue;
|
|
16660
|
+
resources.set(resource.key, resource);
|
|
16661
|
+
if (!resource.projectKey)
|
|
16662
|
+
continue;
|
|
16663
|
+
configuration.spec = await applyEntryPointEnhancementAsync(builder.context, resource, configuration.spec ?? {});
|
|
16664
|
+
}
|
|
16665
|
+
return resources;
|
|
16666
|
+
}
|
|
16667
|
+
async function exportResourceConfigurationsAsync(services, resourceKey, hint = {}) {
|
|
16668
|
+
const { catalog, importer } = getRemoteResourceClients(services);
|
|
16669
|
+
const byKey = (item) => item.entityKey === resourceKey;
|
|
16670
|
+
const entity = (hint.name ? await findCatalogEntityAsync(catalog, { name: hint.name }, byKey) : undefined) ?? await findCatalogEntityAsync(catalog, {}, byKey);
|
|
16671
|
+
if (!entity) {
|
|
16672
|
+
throw new Error(`Resource '${resourceKey}' was not found in the solution or in the resource catalog`);
|
|
16673
|
+
}
|
|
16674
|
+
const payload = await importer.exportResourceAsync(toResourceReference(entity));
|
|
16675
|
+
const definitions = payload.resourceDefinitions ?? [];
|
|
16676
|
+
if (definitions.length === 0) {
|
|
16677
|
+
throw new Error(`FPS export for '${resourceKey}' returned no resource definitions`);
|
|
16678
|
+
}
|
|
16679
|
+
return {
|
|
16680
|
+
resources: definitions.map((d) => ({
|
|
16681
|
+
key: d.key ?? "",
|
|
16682
|
+
spec: d.spec ?? {},
|
|
16683
|
+
locks: d.locks ?? [],
|
|
16684
|
+
apiVersion: d.apiVersion,
|
|
16685
|
+
isOverridable: d.isOverridable,
|
|
16686
|
+
name: d.name ?? "",
|
|
16687
|
+
kind: d.kind ?? "",
|
|
16688
|
+
dependencies: (d.dependencies ?? []).map((dep) => ({
|
|
16689
|
+
kind: dep.kind ?? "",
|
|
16690
|
+
name: dep.name ?? ""
|
|
16691
|
+
}))
|
|
16692
|
+
}))
|
|
16693
|
+
};
|
|
16694
|
+
}
|
|
16695
|
+
async function readLocalAsync(builder, resourceKey, read) {
|
|
16696
|
+
if (!builder)
|
|
16697
|
+
return;
|
|
16698
|
+
const [error, value] = await catchError(read(builder));
|
|
16699
|
+
if (!error)
|
|
16700
|
+
return { builder, value };
|
|
16701
|
+
if (isResourceKeyNotFound(error, resourceKey))
|
|
16702
|
+
return;
|
|
16703
|
+
throw error;
|
|
16704
|
+
}
|
|
16705
|
+
async function readResourceConfigurationsAsync(services, builder, resourceKey, hint = {}) {
|
|
16706
|
+
const local = await readLocalAsync(builder, resourceKey, (b) => b.getAllConfigurationsAsync(resourceKey));
|
|
16707
|
+
if (!local) {
|
|
16708
|
+
return exportResourceConfigurationsAsync(services, resourceKey, hint);
|
|
16709
|
+
}
|
|
16710
|
+
await refreshArtefactSpecsAsync(local.builder, local.value?.resources ?? []);
|
|
16711
|
+
return local.value;
|
|
16712
|
+
}
|
|
16713
|
+
async function readResourceConfigurationAsync(services, builder, resourceKey) {
|
|
16714
|
+
const local = await readLocalAsync(builder, resourceKey, (b) => b.getConfigurationAsync(resourceKey));
|
|
16715
|
+
if (local) {
|
|
16716
|
+
const configuration = local.value;
|
|
16717
|
+
const resources2 = await refreshArtefactSpecsAsync(local.builder, [
|
|
16718
|
+
configuration
|
|
16719
|
+
]);
|
|
16720
|
+
return { configuration, resource: resources2.get(configuration.key) };
|
|
16721
|
+
}
|
|
16722
|
+
const { resources } = await exportResourceConfigurationsAsync(services, resourceKey);
|
|
16723
|
+
const primary = resources.find((r) => r.key === resourceKey) ?? resources[0];
|
|
16724
|
+
const { key, spec, locks, apiVersion, isOverridable } = primary;
|
|
16725
|
+
return { configuration: { key, spec, locks, apiVersion, isOverridable } };
|
|
16726
|
+
}
|
|
16727
|
+
// ../solution-sdk/src/resources/services/resource-lookup.ts
|
|
16728
|
+
async function findResourcesByNameAsync(services, builder, { kind, name, subTypes, folderKey }) {
|
|
16729
|
+
const same = (a, b) => (a ?? "").toLowerCase() === b.toLowerCase();
|
|
16730
|
+
const ofSubType = (type) => subTypes === undefined || subTypes.some((t) => same(type, t));
|
|
16731
|
+
if (builder) {
|
|
16732
|
+
const solution = await builder.context.loadAsync();
|
|
16733
|
+
const local = solution.resources.filter((r) => same(r.kind, kind) && same(r.name, name) && ofSubType(r.type)).map((r) => ({
|
|
16734
|
+
key: r.key,
|
|
16735
|
+
local: true,
|
|
16736
|
+
folderPath: r.folders?.[0]?.fullyQualifiedName
|
|
16737
|
+
}));
|
|
16738
|
+
if (local.length > 0)
|
|
16739
|
+
return local;
|
|
16740
|
+
}
|
|
16741
|
+
const { catalog } = getRemoteResourceClients(services);
|
|
16742
|
+
const rows = await findCatalogEntitiesAsync(catalog, { name, entityTypes: [kind] }, (row) => same(row.entityType, kind) && same(row.entityName, name) && ofSubType(row.entitySubType) && (folderKey === undefined || same(row.folderKey, folderKey)));
|
|
16743
|
+
return rows.map((row) => ({
|
|
16744
|
+
key: row.entityKey ?? "",
|
|
16745
|
+
local: false,
|
|
16746
|
+
folderPath: row.fullyQualifiedName ?? undefined,
|
|
16747
|
+
folderKey: row.folderKey ?? undefined
|
|
16748
|
+
}));
|
|
16749
|
+
}
|
|
17866
16750
|
// ../solution-sdk/src/resources/services/resource-name.ts
|
|
17867
16751
|
var MAX_RESOURCE_NAME_LENGTH = 256;
|
|
17868
16752
|
var UNSAFE_NAME_CHARS = /[\\/:*?"<>|]/;
|
|
@@ -17930,6 +16814,9 @@ var TYPE_IS_IDENTITY_REPLACE_OPTIONS = new Set([
|
|
|
17930
16814
|
"SameNameAndType"
|
|
17931
16815
|
]);
|
|
17932
16816
|
var BINDINGS_JSON_FALLBACK_TYPES = new Set(["agent", "function"]);
|
|
16817
|
+
|
|
16818
|
+
class OverwriteRefreshError extends Error {
|
|
16819
|
+
}
|
|
17933
16820
|
function placeholderForType(type) {
|
|
17934
16821
|
switch ((type ?? "string").toLowerCase()) {
|
|
17935
16822
|
case "boolean":
|
|
@@ -18030,13 +16917,15 @@ function resolveBindingResourceIdentity(binding) {
|
|
|
18030
16917
|
};
|
|
18031
16918
|
}
|
|
18032
16919
|
}
|
|
18033
|
-
async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTypes) {
|
|
16920
|
+
async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTypes, projectBindings) {
|
|
18034
16921
|
const result = {
|
|
18035
16922
|
created: 0,
|
|
18036
16923
|
imported: 0,
|
|
18037
16924
|
skipped: 0,
|
|
18038
16925
|
pruned: 0,
|
|
18039
|
-
|
|
16926
|
+
projectResourcesCreated: 0,
|
|
16927
|
+
warnings: [],
|
|
16928
|
+
unresolved: []
|
|
18040
16929
|
};
|
|
18041
16930
|
const uipxProjects = await readUipxProjects(solutionDir);
|
|
18042
16931
|
const paths = projectPaths ?? uipxProjects.map((p) => p.path);
|
|
@@ -18050,7 +16939,7 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
18050
16939
|
return result;
|
|
18051
16940
|
}
|
|
18052
16941
|
const serializer = services.container.resolve(Tokens.IBindingsMetadataSerializer);
|
|
18053
|
-
const { bindings: allBindings, parseErrors } = await collectBindings(solutionDir, paths,
|
|
16942
|
+
const { bindings: allBindings, parseErrors } = await collectBindings(bindingsJsonFallbackDirs, serializer, bindingSources(solutionDir, paths, uipxProjects, projectBindings));
|
|
18054
16943
|
if (parseErrors.length > 0) {
|
|
18055
16944
|
const detail = parseErrors.map((e) => `${e.path}: ${e.reason}`).join("; ");
|
|
18056
16945
|
throw new Error(`Invalid bindings file — ${detail}`);
|
|
@@ -18064,7 +16953,8 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
18064
16953
|
logger.warn(`Failed to get solution builder: ${builderError.message}`);
|
|
18065
16954
|
return result;
|
|
18066
16955
|
}
|
|
18067
|
-
await reconcileSolutionProjects(builder, solutionDir, projectSubTypes);
|
|
16956
|
+
const reconcileOutcome = await reconcileSolutionProjects(builder, solutionDir, projectSubTypes);
|
|
16957
|
+
result.projectResourcesCreated = reconcileOutcome.resourcesAdded;
|
|
18068
16958
|
const memberProjectKeys = new Set(uipxProjects.map((project) => project.id.toLowerCase()));
|
|
18069
16959
|
await pruneMemberClones(builder, memberProjectKeys, result);
|
|
18070
16960
|
if (allBindings.length === 0) {
|
|
@@ -18079,6 +16969,28 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
18079
16969
|
const resolveKindMetadata = await buildKindResolver(metadataReader);
|
|
18080
16970
|
const solution = await builder.context.loadAsync();
|
|
18081
16971
|
const knownResourceKeys = new Set((solution.resources ?? []).map((r) => r.key?.toLowerCase()).filter((k) => !!k));
|
|
16972
|
+
let keptUnchecked = 0;
|
|
16973
|
+
const resolvedKeys = new Set;
|
|
16974
|
+
const overwrittenKeys = new Set;
|
|
16975
|
+
const bindingKey = (kind, name) => `${kind}:${name ?? ""}`.toLowerCase();
|
|
16976
|
+
const recordUnchecked = async (error, kind, name, directCloudKey) => {
|
|
16977
|
+
if (error) {
|
|
16978
|
+
const failure = classifyCatalogFailure(error);
|
|
16979
|
+
if (!result.catalogLookupFailure || stopsCatalogLookups(failure) && !stopsCatalogLookups(result.catalogLookupFailure)) {
|
|
16980
|
+
result.catalogLookupFailure = failure;
|
|
16981
|
+
}
|
|
16982
|
+
}
|
|
16983
|
+
const covered = await isUncheckedBindingCovered(builder, knownResourceKeys, kind, name, directCloudKey);
|
|
16984
|
+
if (covered) {
|
|
16985
|
+
keptUnchecked++;
|
|
16986
|
+
result.skipped++;
|
|
16987
|
+
return;
|
|
16988
|
+
}
|
|
16989
|
+
result.unresolved.push({
|
|
16990
|
+
kind,
|
|
16991
|
+
name: directCloudKey ?? name
|
|
16992
|
+
});
|
|
16993
|
+
};
|
|
18082
16994
|
const virtualCandidates = [];
|
|
18083
16995
|
for (const binding of allBindings) {
|
|
18084
16996
|
const identity = resolveBindingResourceIdentity(binding);
|
|
@@ -18108,7 +17020,12 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
18108
17020
|
logger.info(`Skipping ${kind} "${name}" — the solution provisions this project itself; its member declaration covers the binding`);
|
|
18109
17021
|
continue;
|
|
18110
17022
|
}
|
|
18111
|
-
const
|
|
17023
|
+
const lookupsStopped = !!result.catalogLookupFailure && stopsCatalogLookups(result.catalogLookupFailure);
|
|
17024
|
+
const [lookupError, rcsMatch] = lookupsStopped ? [undefined, undefined] : await catchError(directCloudKey ? findResourceByKeyInRcs(builder, kind, directCloudKey, folderPath, true) : findResourceInRcs(builder, kind, name, folderPath, true));
|
|
17025
|
+
if (lookupsStopped || lookupError) {
|
|
17026
|
+
await recordUnchecked(lookupError, kind, name, directCloudKey);
|
|
17027
|
+
continue;
|
|
17028
|
+
}
|
|
18112
17029
|
const resolvedType = identity.type ?? rcsMatch?.type ?? metadata?.type;
|
|
18113
17030
|
if (!rcsMatch) {
|
|
18114
17031
|
if (isConnection) {
|
|
@@ -18127,30 +17044,48 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
18127
17044
|
}
|
|
18128
17045
|
if (!isConnection && rcsMatch.key && knownResourceKeys.has(rcsMatch.key.toLowerCase())) {
|
|
18129
17046
|
result.skipped++;
|
|
17047
|
+
resolvedKeys.add(bindingKey(kind, name));
|
|
18130
17048
|
continue;
|
|
18131
17049
|
}
|
|
18132
17050
|
const callType = isConnection ? binding.metadata?.connector : resolvedType;
|
|
18133
|
-
const
|
|
17051
|
+
const wasKnown = !!rcsMatch.key && knownResourceKeys.has(rcsMatch.key.toLowerCase());
|
|
17052
|
+
const reference = {
|
|
18134
17053
|
kind,
|
|
18135
17054
|
type: callType,
|
|
18136
17055
|
key: rcsMatch.key,
|
|
18137
17056
|
name: rcsMatch.name,
|
|
18138
17057
|
folder: rcsMatch.folder
|
|
18139
|
-
}
|
|
17058
|
+
};
|
|
17059
|
+
const [importError] = await catchError(wasKnown ? refreshKnownResource(services, builder, reference, overwrittenKeys) : builder.addOrUpdateResourceToSolutionAsync(reference, true));
|
|
18140
17060
|
if (!importError) {
|
|
17061
|
+
resolvedKeys.add(bindingKey(kind, directCloudKey ?? name));
|
|
17062
|
+
if (wasKnown) {
|
|
17063
|
+
result.skipped++;
|
|
17064
|
+
logger.info(`Refreshed ${kind} "${rcsMatch.name}" (key: ${rcsMatch.key}), already in solution`);
|
|
17065
|
+
continue;
|
|
17066
|
+
}
|
|
18141
17067
|
if (rcsMatch.key) {
|
|
18142
17068
|
knownResourceKeys.add(rcsMatch.key.toLowerCase());
|
|
17069
|
+
overwrittenKeys.add(rcsMatch.key.toLowerCase());
|
|
18143
17070
|
}
|
|
18144
17071
|
result.imported++;
|
|
18145
17072
|
logger.info(`Imported ${kind} "${rcsMatch.name}" (key: ${rcsMatch.key}) into solution`);
|
|
18146
17073
|
continue;
|
|
18147
17074
|
}
|
|
17075
|
+
if (stopsCatalogLookups(classifyCatalogFailure(importError))) {
|
|
17076
|
+
await recordUnchecked(importError, kind, name, directCloudKey);
|
|
17077
|
+
continue;
|
|
17078
|
+
}
|
|
18148
17079
|
if (isConnection) {
|
|
18149
|
-
|
|
18150
|
-
|
|
17080
|
+
const failedStep = importError instanceof OverwriteRefreshError ? "refresh the debug overwrite for" : "import";
|
|
17081
|
+
const warning = `Failed to ${failedStep} connection ${directCloudKey}: ${importError.message}`;
|
|
17082
|
+
result.warnings.push(warning);
|
|
17083
|
+
logger.warn(warning);
|
|
18151
17084
|
continue;
|
|
18152
17085
|
}
|
|
18153
|
-
|
|
17086
|
+
const importWarning = `Failed to import ${kind} "${name}" from Orchestrator: ${importError.message}. Created it locally instead; link it before deploy if it must point at the cloud resource.`;
|
|
17087
|
+
result.warnings.push(importWarning);
|
|
17088
|
+
logger.warn(importWarning);
|
|
18154
17089
|
virtualCandidates.push({
|
|
18155
17090
|
binding,
|
|
18156
17091
|
kind,
|
|
@@ -18169,11 +17104,29 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
18169
17104
|
return true;
|
|
18170
17105
|
});
|
|
18171
17106
|
for (const candidate of dedupedVirtuals) {
|
|
18172
|
-
const [syncError] = await catchError(createVirtualForBinding(builder, candidate.binding, candidate.kind, candidate.type, candidate.metadata, candidate.name, candidate.folderPath, result));
|
|
17107
|
+
const [syncError, created] = await catchError(createVirtualForBinding(builder, candidate.binding, candidate.kind, candidate.type, candidate.metadata, candidate.name, candidate.folderPath, result));
|
|
18173
17108
|
if (syncError) {
|
|
18174
17109
|
logger.warn(`Failed to create virtual ${candidate.kind}/${candidate.name}: ${syncError.message}`);
|
|
17110
|
+
} else if (created) {
|
|
17111
|
+
resolvedKeys.add(bindingKey(candidate.kind, candidate.name));
|
|
18175
17112
|
}
|
|
18176
17113
|
}
|
|
17114
|
+
if (result.catalogLookupFailure) {
|
|
17115
|
+
const seen = new Set;
|
|
17116
|
+
result.unresolved = result.unresolved.filter((b) => {
|
|
17117
|
+
const key = bindingKey(b.kind, b.name);
|
|
17118
|
+
if (resolvedKeys.has(key)) {
|
|
17119
|
+
keptUnchecked++;
|
|
17120
|
+
result.skipped++;
|
|
17121
|
+
return false;
|
|
17122
|
+
}
|
|
17123
|
+
if (seen.has(key))
|
|
17124
|
+
return false;
|
|
17125
|
+
seen.add(key);
|
|
17126
|
+
return true;
|
|
17127
|
+
});
|
|
17128
|
+
result.warnings.push(catalogLookupWarning(result.catalogLookupFailure, keptUnchecked, result.unresolved));
|
|
17129
|
+
}
|
|
18177
17130
|
const saveError = await saveAndDisposeBuilder(builder, solutionDir);
|
|
18178
17131
|
if (saveError) {
|
|
18179
17132
|
throw new Error(`Failed to save solution changes: ${saveError.message}`);
|
|
@@ -18201,6 +17154,43 @@ async function pruneMemberClones(builder, memberProjectKeys, result) {
|
|
|
18201
17154
|
logger.info(`Removed duplicate ${clone.kind} "${clone.name}" (key: ${clone.key}) — the solution provisions this project itself`);
|
|
18202
17155
|
}
|
|
18203
17156
|
}
|
|
17157
|
+
async function isUncheckedBindingCovered(builder, knownResourceKeys, kind, name, directCloudKey) {
|
|
17158
|
+
if (directCloudKey) {
|
|
17159
|
+
return knownResourceKeys.has(directCloudKey.toLowerCase());
|
|
17160
|
+
}
|
|
17161
|
+
const solution = await builder.context.loadAsync();
|
|
17162
|
+
return !!findMatchingLocalResource(solution.resources ?? [], kind, name, undefined);
|
|
17163
|
+
}
|
|
17164
|
+
async function refreshKnownResource(services, builder, reference, overwrittenKeys) {
|
|
17165
|
+
const solution = await builder.context.loadAsync();
|
|
17166
|
+
const referenceKey = reference.key.toLowerCase();
|
|
17167
|
+
const existing = (solution.resources ?? []).find((resource) => resource.key?.toLowerCase() === referenceKey);
|
|
17168
|
+
const mediator = services.container.resolve(Tokens.IMediator);
|
|
17169
|
+
const response = await mediator.sendCommandAsync(new AddOrUpdateResourceToSolutionCommand(builder.context, reference, true, existing?.key));
|
|
17170
|
+
const sdkWroteOverwrite = response.saved && existing?.key === reference.key;
|
|
17171
|
+
if (!existing || sdkWroteOverwrite || overwrittenKeys.has(referenceKey)) {
|
|
17172
|
+
overwrittenKeys.add(referenceKey);
|
|
17173
|
+
return response;
|
|
17174
|
+
}
|
|
17175
|
+
const [overwriteError] = await catchError(refreshOverwrite(services, builder, reference, existing.key));
|
|
17176
|
+
if (overwriteError)
|
|
17177
|
+
throw new OverwriteRefreshError(overwriteError.message);
|
|
17178
|
+
overwrittenKeys.add(referenceKey);
|
|
17179
|
+
return response;
|
|
17180
|
+
}
|
|
17181
|
+
async function refreshOverwrite(services, builder, reference, solutionResourceKey) {
|
|
17182
|
+
const importer = services.container.resolve(Tokens.IImportResourceHelper);
|
|
17183
|
+
const payload = await importer.exportResourceAsync(reference);
|
|
17184
|
+
const referenceKey = reference.key.toLowerCase();
|
|
17185
|
+
const overwrite = [...payload.overwrites].find(([key]) => key.toLowerCase() === referenceKey)?.[1];
|
|
17186
|
+
if (!overwrite) {
|
|
17187
|
+
throw new Error(`Overwrite not found for resource key '${reference.key}' in exported payload`);
|
|
17188
|
+
}
|
|
17189
|
+
const overwrites = services.container.resolve(Tokens.IResourceOverwritesService);
|
|
17190
|
+
await overwrites.manageSolutionOverwritesAsync(builder.context, [
|
|
17191
|
+
{ solutionResourceKey, overwrite }
|
|
17192
|
+
]);
|
|
17193
|
+
}
|
|
18204
17194
|
async function saveAndDisposeBuilder(builder, solutionDir) {
|
|
18205
17195
|
const context = builder.context;
|
|
18206
17196
|
if (!context?.forceSaveChangesAsync) {
|
|
@@ -18270,11 +17260,11 @@ async function createVirtualForBinding(builder, _binding, kind, type, metadata,
|
|
|
18270
17260
|
if (alreadyVirtualized) {
|
|
18271
17261
|
result.skipped++;
|
|
18272
17262
|
logger.info(`Skipping virtual ${kind} "${name}" — existing resource "${alreadyVirtualized.name}" in solution_folder already covers this binding (requested folder "${folderPath}")`);
|
|
18273
|
-
return;
|
|
17263
|
+
return true;
|
|
18274
17264
|
}
|
|
18275
17265
|
const minted = await mintVirtualResource(builder, kind, type, name, metadata);
|
|
18276
17266
|
if (!minted)
|
|
18277
|
-
return;
|
|
17267
|
+
return false;
|
|
18278
17268
|
result.created++;
|
|
18279
17269
|
logger.info(`Created ${kind} "${name}" in solution`);
|
|
18280
17270
|
if (!virtualizable) {
|
|
@@ -18282,6 +17272,7 @@ async function createVirtualForBinding(builder, _binding, kind, type, metadata,
|
|
|
18282
17272
|
result.warnings.push(warning);
|
|
18283
17273
|
logger.warn(warning);
|
|
18284
17274
|
}
|
|
17275
|
+
return true;
|
|
18285
17276
|
}
|
|
18286
17277
|
async function findResourceByKeyInRcs(builder, kind, expectedKey, folderPath, propagateErrors = false) {
|
|
18287
17278
|
const expectedLower = expectedKey.toLowerCase();
|
|
@@ -18359,8 +17350,8 @@ async function searchRcsResourcesStrict(builder, kind, name) {
|
|
|
18359
17350
|
} while (pageCursor);
|
|
18360
17351
|
return allMatches;
|
|
18361
17352
|
}
|
|
18362
|
-
async function findResourceInRcs(builder, kind, name, folderPath) {
|
|
18363
|
-
const allMatches = await searchRcsResources(builder, kind, name);
|
|
17353
|
+
async function findResourceInRcs(builder, kind, name, folderPath, propagateErrors = false) {
|
|
17354
|
+
const allMatches = propagateErrors ? await searchRcsResourcesStrict(builder, kind, name) : await searchRcsResources(builder, kind, name);
|
|
18364
17355
|
if (allMatches.length === 0) {
|
|
18365
17356
|
return;
|
|
18366
17357
|
}
|
|
@@ -18458,9 +17449,15 @@ async function readUiprojName(uiprojPath) {
|
|
|
18458
17449
|
return;
|
|
18459
17450
|
}
|
|
18460
17451
|
}
|
|
17452
|
+
async function snapshotResourceIdentities(builder) {
|
|
17453
|
+
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
17454
|
+
if (loadError || !solution)
|
|
17455
|
+
return;
|
|
17456
|
+
return new Set((solution.resources ?? []).map((resource) => resource.key ? resource.key.toLowerCase() : `${resource.kind}:${resource.name}`.toLowerCase()));
|
|
17457
|
+
}
|
|
18461
17458
|
async function reconcileSolutionProjects(builder, solutionDir, projectSubTypes) {
|
|
18462
17459
|
const fs = getFileSystem();
|
|
18463
|
-
const outcome = { projectsCount: 0 };
|
|
17460
|
+
const outcome = { projectsCount: 0, resourcesAdded: 0 };
|
|
18464
17461
|
const uipxProjects = await readUipxProjects(solutionDir);
|
|
18465
17462
|
const projectDetails = uipxProjects.flatMap((project) => {
|
|
18466
17463
|
const reconcileType = mapUipxTypeToReconcileType(project.type);
|
|
@@ -18478,6 +17475,7 @@ async function reconcileSolutionProjects(builder, solutionDir, projectSubTypes)
|
|
|
18478
17475
|
if (projectDetails.length === 0)
|
|
18479
17476
|
return outcome;
|
|
18480
17477
|
const solutionName = fs.path.basename(solutionDir);
|
|
17478
|
+
const before = await snapshotResourceIdentities(builder);
|
|
18481
17479
|
const [reconcileError] = await catchError(builder.reconcileProjectsAsync({
|
|
18482
17480
|
solutionName,
|
|
18483
17481
|
projects: projectDetails
|
|
@@ -18487,6 +17485,10 @@ async function reconcileSolutionProjects(builder, solutionDir, projectSubTypes)
|
|
|
18487
17485
|
return outcome;
|
|
18488
17486
|
}
|
|
18489
17487
|
outcome.projectsCount = projectDetails.length;
|
|
17488
|
+
const after = before && await snapshotResourceIdentities(builder);
|
|
17489
|
+
if (before && after) {
|
|
17490
|
+
outcome.resourcesAdded = [...after].filter((identity) => !before.has(identity)).length;
|
|
17491
|
+
}
|
|
18490
17492
|
logger.info(`Reconciled ${projectDetails.length} .uipx project(s) in solution ${solutionName}`);
|
|
18491
17493
|
return outcome;
|
|
18492
17494
|
}
|
|
@@ -18528,12 +17530,48 @@ function findBindingsSchemaError(content) {
|
|
|
18528
17530
|
}
|
|
18529
17531
|
return null;
|
|
18530
17532
|
}
|
|
18531
|
-
|
|
17533
|
+
function bindingSources(solutionDir, projectPaths, projects, projectBindings) {
|
|
17534
|
+
const sources = [{ directory: solutionDir }];
|
|
17535
|
+
const fileDirectories = new Set([solutionDir]);
|
|
17536
|
+
const contributedIds = new Set;
|
|
17537
|
+
for (const directory of new Set(projectPaths)) {
|
|
17538
|
+
const owners = projects.filter((project) => project.path === directory);
|
|
17539
|
+
for (const project of owners) {
|
|
17540
|
+
const bindings = projectBindings?.get(project.id);
|
|
17541
|
+
if (bindings === undefined || contributedIds.has(project.id))
|
|
17542
|
+
continue;
|
|
17543
|
+
contributedIds.add(project.id);
|
|
17544
|
+
sources.push({
|
|
17545
|
+
directory,
|
|
17546
|
+
contribution: { projectId: project.id, bindings }
|
|
17547
|
+
});
|
|
17548
|
+
}
|
|
17549
|
+
const needsFile = owners.length === 0 || owners.some((project) => !projectBindings?.has(project.id));
|
|
17550
|
+
if (needsFile && !fileDirectories.has(directory)) {
|
|
17551
|
+
fileDirectories.add(directory);
|
|
17552
|
+
sources.push({ directory });
|
|
17553
|
+
}
|
|
17554
|
+
}
|
|
17555
|
+
return sources;
|
|
17556
|
+
}
|
|
17557
|
+
async function collectBindings(bindingsJsonFallbackDirs, serializer, sources) {
|
|
18532
17558
|
const fs = getFileSystem();
|
|
18533
17559
|
const allBindings = [];
|
|
18534
17560
|
const parseErrors = [];
|
|
18535
|
-
const
|
|
18536
|
-
|
|
17561
|
+
for (const { directory: dir, contribution } of sources) {
|
|
17562
|
+
if (contribution) {
|
|
17563
|
+
if (contribution.bindings.length === 0)
|
|
17564
|
+
continue;
|
|
17565
|
+
const parsed2 = deserializeBindings(JSON.stringify({
|
|
17566
|
+
version: "2.0",
|
|
17567
|
+
resources: contribution.bindings
|
|
17568
|
+
}), `${dir} (bindings contributed by the project's tool; project ${contribution.projectId})`, serializer);
|
|
17569
|
+
if ("error" in parsed2)
|
|
17570
|
+
parseErrors.push(parsed2.error);
|
|
17571
|
+
else
|
|
17572
|
+
allBindings.push(...parsed2.resources);
|
|
17573
|
+
continue;
|
|
17574
|
+
}
|
|
18537
17575
|
const v2Path = fs.path.join(dir, "bindings_v2.json");
|
|
18538
17576
|
let bindingsPath = v2Path;
|
|
18539
17577
|
let exists = await fs.exists(v2Path);
|
|
@@ -18552,37 +17590,44 @@ async function collectBindings(solutionDir, projectPaths, bindingsJsonFallbackDi
|
|
|
18552
17590
|
});
|
|
18553
17591
|
continue;
|
|
18554
17592
|
}
|
|
18555
|
-
const
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
|
|
18559
|
-
|
|
18560
|
-
|
|
18561
|
-
|
|
18562
|
-
|
|
18563
|
-
|
|
18564
|
-
|
|
17593
|
+
const parsed = deserializeBindings(new TextDecoder().decode(content), bindingsPath, serializer);
|
|
17594
|
+
if ("error" in parsed)
|
|
17595
|
+
parseErrors.push(parsed.error);
|
|
17596
|
+
else
|
|
17597
|
+
allBindings.push(...parsed.resources);
|
|
17598
|
+
}
|
|
17599
|
+
return { bindings: allBindings, parseErrors };
|
|
17600
|
+
}
|
|
17601
|
+
function deserializeBindings(decoded, source, serializer) {
|
|
17602
|
+
let success;
|
|
17603
|
+
let metadata;
|
|
17604
|
+
try {
|
|
17605
|
+
const result = serializer.tryDeserialize(decoded);
|
|
17606
|
+
success = result.success;
|
|
17607
|
+
metadata = result.metadata;
|
|
17608
|
+
} catch (err) {
|
|
17609
|
+
return {
|
|
17610
|
+
error: {
|
|
17611
|
+
path: source,
|
|
18565
17612
|
reason: findBindingsSchemaError(decoded) ?? `does not match the expected v2 bindings schema — check each resource's 'kind' and required fields${err instanceof Error ? ` (${err.message})` : ""}`
|
|
18566
|
-
}
|
|
18567
|
-
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18571
|
-
|
|
17613
|
+
}
|
|
17614
|
+
};
|
|
17615
|
+
}
|
|
17616
|
+
if (!success) {
|
|
17617
|
+
return {
|
|
17618
|
+
error: {
|
|
17619
|
+
path: source,
|
|
18572
17620
|
reason: findBindingsSchemaError(decoded) ?? "does not match the expected v2 bindings schema (the serializer rejected it)"
|
|
18573
|
-
}
|
|
18574
|
-
|
|
18575
|
-
}
|
|
18576
|
-
if (!metadata?.resources?.length) {
|
|
18577
|
-
continue;
|
|
18578
|
-
}
|
|
18579
|
-
allBindings.push(...metadata.resources);
|
|
17621
|
+
}
|
|
17622
|
+
};
|
|
18580
17623
|
}
|
|
18581
|
-
return {
|
|
17624
|
+
return { resources: metadata?.resources ?? [] };
|
|
18582
17625
|
}
|
|
18583
|
-
async function syncAndLog(solutionDir, projectSubTypes) {
|
|
18584
|
-
const [syncError, syncResult] = await catchError(syncResourcesFromBindings(solutionDir, undefined, projectSubTypes));
|
|
17626
|
+
async function syncAndLog(solutionDir, projectSubTypes, options) {
|
|
17627
|
+
const [syncError, syncResult] = await catchError(syncResourcesFromBindings(solutionDir, undefined, projectSubTypes, options?.projectBindings));
|
|
18585
17628
|
if (syncError) {
|
|
17629
|
+
if (options?.failOnUnresolved)
|
|
17630
|
+
throw syncError;
|
|
18586
17631
|
logger.warn(`Resource sync failed: ${syncError.message}. Continuing.`);
|
|
18587
17632
|
return;
|
|
18588
17633
|
}
|
|
@@ -18592,6 +17637,9 @@ async function syncAndLog(solutionDir, projectSubTypes) {
|
|
|
18592
17637
|
for (const warning of syncResult.warnings) {
|
|
18593
17638
|
logger.warn(warning);
|
|
18594
17639
|
}
|
|
17640
|
+
if (options?.failOnUnresolved && syncResult.catalogLookupFailure && syncResult.unresolved.length > 0) {
|
|
17641
|
+
throw new CatalogLookupError(syncResult.catalogLookupFailure, syncResult.unresolved);
|
|
17642
|
+
}
|
|
18595
17643
|
}
|
|
18596
17644
|
|
|
18597
17645
|
// ../solution-sdk/src/resources/services/resource-refresh-service.ts
|
|
@@ -18628,7 +17676,11 @@ async function resourceRefreshAsync(solutionPath = ".", options = {}) {
|
|
|
18628
17676
|
const resolverWarnings = subTypesError ? [
|
|
18629
17677
|
`Could not resolve project subTypes: ${subTypesError.message}. Project artefacts for types that need a variant were left as they are; fix the tool install and re-run 'uip solution resources refresh'.`
|
|
18630
17678
|
] : [];
|
|
18631
|
-
const [
|
|
17679
|
+
const [bindingsError, projectBindings] = await catchError(options.resolveProjectBindingsAsync?.() ?? Promise.resolve(new Map));
|
|
17680
|
+
if (bindingsError) {
|
|
17681
|
+
resolverWarnings.push(`Could not read the bindings projects contribute: ${bindingsError.message}. Those projects were synced from any bindings_v2.json on disk instead; fix the tool install and re-run 'uip solution resources refresh'.`);
|
|
17682
|
+
}
|
|
17683
|
+
const [syncError, result] = await catchError(syncResourcesFromBindings(resolvedPath, undefined, projectSubTypes ?? new Map, projectBindings ?? new Map));
|
|
18632
17684
|
if (syncError) {
|
|
18633
17685
|
return {
|
|
18634
17686
|
ok: false,
|
|
@@ -18642,6 +17694,7 @@ async function resourceRefreshAsync(solutionPath = ".", options = {}) {
|
|
|
18642
17694
|
imported: result.imported,
|
|
18643
17695
|
skipped: result.skipped,
|
|
18644
17696
|
pruned: result.pruned,
|
|
17697
|
+
projectResourcesCreated: result.projectResourcesCreated,
|
|
18645
17698
|
warnings: [...resolverWarnings, ...result.warnings]
|
|
18646
17699
|
};
|
|
18647
17700
|
}
|
|
@@ -18823,6 +17876,7 @@ function sortKeysDeep(value) {
|
|
|
18823
17876
|
return sorted;
|
|
18824
17877
|
}
|
|
18825
17878
|
export {
|
|
17879
|
+
CatalogLookupError,
|
|
18826
17880
|
EntryPointSpecEnhancer,
|
|
18827
17881
|
MAX_RESOURCE_NAME_LENGTH,
|
|
18828
17882
|
ProjectManifestError,
|
|
@@ -18835,7 +17889,9 @@ export {
|
|
|
18835
17889
|
createProjectInSolutionBuilder,
|
|
18836
17890
|
createResourceBuilderServices,
|
|
18837
17891
|
createResourceKindMetadataResolver,
|
|
17892
|
+
exportResourceConfigurationsAsync,
|
|
18838
17893
|
exportResourceDefinitionAsync,
|
|
17894
|
+
findCatalogEntitiesAsync,
|
|
18839
17895
|
findCatalogEntityAsync,
|
|
18840
17896
|
findMatchingLocalResource,
|
|
18841
17897
|
findMatchingMemberResource,
|
|
@@ -18843,21 +17899,26 @@ export {
|
|
|
18843
17899
|
findProjectFile,
|
|
18844
17900
|
findResourceByKeyInRcs,
|
|
18845
17901
|
findResourceInRcs,
|
|
17902
|
+
findResourcesByNameAsync,
|
|
18846
17903
|
formatResourceSubtypes,
|
|
18847
17904
|
getRemoteResourceClients,
|
|
18848
17905
|
hasAnyTemplateRow,
|
|
18849
17906
|
hasBareTemplateRow,
|
|
18850
17907
|
isMissingProjectTypeError,
|
|
18851
17908
|
isProjectManifestError,
|
|
17909
|
+
isResourceKeyNotFound,
|
|
18852
17910
|
normalizeFolderPath,
|
|
18853
17911
|
normalizeResourceCasing,
|
|
18854
17912
|
normalizeResourceFileCasing,
|
|
18855
17913
|
readProjectFile,
|
|
17914
|
+
readResourceConfigurationAsync,
|
|
17915
|
+
readResourceConfigurationsAsync,
|
|
18856
17916
|
readSolutionFile,
|
|
18857
17917
|
readSolutionManifest,
|
|
18858
17918
|
readSpecEntryPoints,
|
|
18859
17919
|
readSpecProperty,
|
|
18860
17920
|
readUipxProjects,
|
|
17921
|
+
refreshArtefactSpecsAsync,
|
|
18861
17922
|
resolveProjectDirFromManifest,
|
|
18862
17923
|
resolveResourceKindMetadata,
|
|
18863
17924
|
resolveSolutionFilePath,
|
|
@@ -18877,4 +17938,4 @@ export {
|
|
|
18877
17938
|
writeSolutionFile
|
|
18878
17939
|
};
|
|
18879
17940
|
|
|
18880
|
-
//# debugId=
|
|
17941
|
+
//# debugId=5E4C07501CF1039D64756E2164756E21
|