@uipath/agent-tool 1.203.0-preview.203 → 1.204.0-preview.206
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +43 -5
- package/dist/{agent-tool-OK5DK57D-rjan4r3q.js → agent-tool-OK5DK57D-w2sn5ft0.js} +3 -2
- package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
- package/dist/executor-tool.js +7 -3
- package/dist/{index-s1mvhfbj.js → index-2gm7tb8q.js} +448 -980
- package/dist/index-q0fkqv6h.js +5339 -0
- package/dist/index-rgfg9t8f.js +663 -0
- package/dist/index.js +8 -4
- package/dist/memory-runtime-service-8b2j31ww.js +138 -0
- package/dist/packager-tool-22e4nhzm.js +1176 -0
- package/dist/packager-tool-af0drshm.js +988 -0
- package/dist/{packager-tool-byvnxap3.js → packager-tool-c6sb5jfp.js} +16 -1183
- package/dist/packager-tool-cxp7cwv2.js +5075 -0
- package/dist/packager-tool-kb4fk2pb.js +540 -0
- package/dist/packager-tool-nqcmgnpm.js +36786 -0
- package/dist/{packager-tool-tnz82jk0.js → packager-tool-ryge2f2x.js} +1826 -5310
- package/dist/packager-tool-xhvv7tkq.js +1376 -0
- package/dist/{packager-tool-cve3ftcb.js → packager-tool-ygxda1hn.js} +948 -2752
- package/dist/packager-tool.js +5 -5
- package/dist/tool.js +8 -4
- package/package.json +2 -2
- package/dist/packager-tool-y533fyyc.js +0 -1751
|
@@ -7,20 +7,27 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
FirstPartyServiceApi
|
|
9
9
|
} from "./packager-tool-53w8skv5.js";
|
|
10
|
+
import {
|
|
11
|
+
findSolutionFileUpward,
|
|
12
|
+
normalizeProjectType,
|
|
13
|
+
toPortableRelativePath
|
|
14
|
+
} from "./packager-tool-kb4fk2pb.js";
|
|
10
15
|
import {
|
|
11
16
|
UsersApi,
|
|
17
|
+
createApiClient
|
|
18
|
+
} from "./packager-tool-nqcmgnpm.js";
|
|
19
|
+
import {
|
|
20
|
+
getAuthContext,
|
|
21
|
+
getLoginStatusAsync
|
|
22
|
+
} from "./packager-tool-xhvv7tkq.js";
|
|
23
|
+
import {
|
|
12
24
|
catchError,
|
|
13
|
-
createApiClient,
|
|
14
25
|
extractErrorMessage,
|
|
15
|
-
findSolutionFileUpward,
|
|
16
|
-
getAuthContext,
|
|
17
26
|
getFileSystem,
|
|
18
|
-
getLoginStatusAsync,
|
|
19
27
|
isGuid,
|
|
20
|
-
logger
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "./packager-tool-tnz82jk0.js";
|
|
28
|
+
logger
|
|
29
|
+
} from "./packager-tool-ryge2f2x.js";
|
|
30
|
+
import"./packager-tool-22e4nhzm.js";
|
|
24
31
|
import"./packager-tool-b098y4a2.js";
|
|
25
32
|
import {
|
|
26
33
|
__commonJS,
|
|
@@ -2389,875 +2396,6 @@ var require_cjs = __commonJS(function(exports) {
|
|
|
2389
2396
|
return dependency_container_1.instance;
|
|
2390
2397
|
} });
|
|
2391
2398
|
});
|
|
2392
|
-
// ../packager/packager-core/src/i18n/types.ts
|
|
2393
|
-
function isPluralForm(value) {
|
|
2394
|
-
return typeof value === "object" && value !== null && "other" in value;
|
|
2395
|
-
}
|
|
2396
|
-
function selectPluralForm(forms, count) {
|
|
2397
|
-
if (count === 0 && forms.zero !== undefined) {
|
|
2398
|
-
return forms.zero;
|
|
2399
|
-
}
|
|
2400
|
-
if (count === 1 && forms.one !== undefined) {
|
|
2401
|
-
return forms.one;
|
|
2402
|
-
}
|
|
2403
|
-
if (count === 2 && forms.two !== undefined) {
|
|
2404
|
-
return forms.two;
|
|
2405
|
-
}
|
|
2406
|
-
if (forms.few !== undefined) {
|
|
2407
|
-
const mod10 = count % 10;
|
|
2408
|
-
const mod100 = count % 100;
|
|
2409
|
-
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
2410
|
-
return forms.few;
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
if (forms.many !== undefined) {
|
|
2414
|
-
const mod10 = count % 10;
|
|
2415
|
-
const mod100 = count % 100;
|
|
2416
|
-
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
|
|
2417
|
-
return forms.many;
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
return forms.other;
|
|
2421
|
-
}
|
|
2422
|
-
|
|
2423
|
-
// ../packager/packager-core/src/i18n/i18n-manager.ts
|
|
2424
|
-
class I18nManager {
|
|
2425
|
-
static translations = {};
|
|
2426
|
-
static currentLocale = "en";
|
|
2427
|
-
static fallbackLocale = "en";
|
|
2428
|
-
static registerTranslations(locale, catalog) {
|
|
2429
|
-
if (!I18nManager.translations[locale]) {
|
|
2430
|
-
I18nManager.translations[locale] = {};
|
|
2431
|
-
}
|
|
2432
|
-
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
|
|
2433
|
-
}
|
|
2434
|
-
static setLocale(locale) {
|
|
2435
|
-
const normalized = I18nManager.normalizeLocale(locale);
|
|
2436
|
-
if (I18nManager.translations[normalized]) {
|
|
2437
|
-
I18nManager.currentLocale = normalized;
|
|
2438
|
-
return normalized;
|
|
2439
|
-
}
|
|
2440
|
-
const baseLocale = normalized.split("-")[0];
|
|
2441
|
-
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
|
|
2442
|
-
I18nManager.currentLocale = baseLocale;
|
|
2443
|
-
return baseLocale;
|
|
2444
|
-
}
|
|
2445
|
-
return I18nManager.currentLocale;
|
|
2446
|
-
}
|
|
2447
|
-
static getLocale() {
|
|
2448
|
-
return I18nManager.currentLocale;
|
|
2449
|
-
}
|
|
2450
|
-
static setFallbackLocale(locale) {
|
|
2451
|
-
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
|
|
2452
|
-
}
|
|
2453
|
-
static t(key, params, locale) {
|
|
2454
|
-
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
2455
|
-
let value = I18nManager.getTranslationValue(key, targetLocale);
|
|
2456
|
-
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
|
|
2457
|
-
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
|
|
2458
|
-
}
|
|
2459
|
-
if (value === undefined) {
|
|
2460
|
-
return key;
|
|
2461
|
-
}
|
|
2462
|
-
if (isPluralForm(value) && params && "count" in params) {
|
|
2463
|
-
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
2464
|
-
value = selectPluralForm(value, count);
|
|
2465
|
-
} else if (isPluralForm(value)) {
|
|
2466
|
-
value = value.other;
|
|
2467
|
-
}
|
|
2468
|
-
if (typeof value !== "string") {
|
|
2469
|
-
return key;
|
|
2470
|
-
}
|
|
2471
|
-
return params ? I18nManager.interpolate(value, params) : value;
|
|
2472
|
-
}
|
|
2473
|
-
static has(key, locale) {
|
|
2474
|
-
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
2475
|
-
const value = I18nManager.getTranslationValue(key, targetLocale);
|
|
2476
|
-
if (value !== undefined) {
|
|
2477
|
-
return true;
|
|
2478
|
-
}
|
|
2479
|
-
if (targetLocale !== I18nManager.fallbackLocale) {
|
|
2480
|
-
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
|
|
2481
|
-
}
|
|
2482
|
-
return false;
|
|
2483
|
-
}
|
|
2484
|
-
static getAvailableLocales() {
|
|
2485
|
-
return Object.keys(I18nManager.translations);
|
|
2486
|
-
}
|
|
2487
|
-
static clearTranslations() {
|
|
2488
|
-
I18nManager.translations = {};
|
|
2489
|
-
I18nManager.currentLocale = "en";
|
|
2490
|
-
}
|
|
2491
|
-
static getTranslationValue(key, locale) {
|
|
2492
|
-
const catalog = I18nManager.translations[locale];
|
|
2493
|
-
if (!catalog) {
|
|
2494
|
-
return;
|
|
2495
|
-
}
|
|
2496
|
-
const keys = key.split(".");
|
|
2497
|
-
let value = catalog;
|
|
2498
|
-
for (const k of keys) {
|
|
2499
|
-
if (value && typeof value === "object" && k in value) {
|
|
2500
|
-
value = value[k];
|
|
2501
|
-
} else {
|
|
2502
|
-
return;
|
|
2503
|
-
}
|
|
2504
|
-
}
|
|
2505
|
-
return value;
|
|
2506
|
-
}
|
|
2507
|
-
static interpolate(template, params) {
|
|
2508
|
-
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
2509
|
-
const value = params[key];
|
|
2510
|
-
return value !== undefined ? String(value) : `{${key}}`;
|
|
2511
|
-
});
|
|
2512
|
-
}
|
|
2513
|
-
static normalizeLocale(locale) {
|
|
2514
|
-
const normalized = locale.toLowerCase().replace(/_/g, "-");
|
|
2515
|
-
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
|
|
2516
|
-
if (specialLocales.includes(normalized)) {
|
|
2517
|
-
return normalized;
|
|
2518
|
-
}
|
|
2519
|
-
return normalized.split("-")[0];
|
|
2520
|
-
}
|
|
2521
|
-
static deepMerge(target, source) {
|
|
2522
|
-
const result = { ...target };
|
|
2523
|
-
for (const key of Object.keys(source)) {
|
|
2524
|
-
const sourceValue = source[key];
|
|
2525
|
-
const targetValue = result[key];
|
|
2526
|
-
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
2527
|
-
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
|
|
2528
|
-
} else {
|
|
2529
|
-
result[key] = sourceValue;
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
return result;
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
// ../packager/packager-core/src/i18n/locales/de.ts
|
|
2537
|
-
var de = {
|
|
2538
|
-
toolCore: {
|
|
2539
|
-
errors: {
|
|
2540
|
-
internal: "Internal error: {message}",
|
|
2541
|
-
fileNotFound: "File not found: {path}",
|
|
2542
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2543
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2544
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2545
|
-
invalidPath: "{path} is not a valid path",
|
|
2546
|
-
operationCanceled: "Operation was canceled",
|
|
2547
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2548
|
-
},
|
|
2549
|
-
progress: {
|
|
2550
|
-
copying: "Copying files...",
|
|
2551
|
-
building: "Building project...",
|
|
2552
|
-
packaging: "Creating package...",
|
|
2553
|
-
validating: "Validating...",
|
|
2554
|
-
analyzing: "Analyzing...",
|
|
2555
|
-
restoring: "Restoring dependencies..."
|
|
2556
|
-
},
|
|
2557
|
-
validation: {
|
|
2558
|
-
requiredField: "{field} is required",
|
|
2559
|
-
invalidValue: "Invalid value for {field}",
|
|
2560
|
-
pathNotFound: "Path not found: {path}",
|
|
2561
|
-
fileRequired: "File is required: {path}",
|
|
2562
|
-
directoryRequired: "Directory is required: {path}"
|
|
2563
|
-
},
|
|
2564
|
-
warnings: {
|
|
2565
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2566
|
-
},
|
|
2567
|
-
info: {
|
|
2568
|
-
operationComplete: "Operation completed successfully",
|
|
2569
|
-
filesProcessed: {
|
|
2570
|
-
zero: "No files processed",
|
|
2571
|
-
one: "{count} file processed",
|
|
2572
|
-
other: "{count} files processed"
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
|
|
2578
|
-
// ../packager/packager-core/src/i18n/locales/en.ts
|
|
2579
|
-
var en = {
|
|
2580
|
-
toolCore: {
|
|
2581
|
-
errors: {
|
|
2582
|
-
internal: "Internal error: {message}",
|
|
2583
|
-
fileNotFound: "File not found: {path}",
|
|
2584
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2585
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2586
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2587
|
-
invalidPath: "{path} is not a valid path",
|
|
2588
|
-
operationCanceled: "Operation was canceled",
|
|
2589
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2590
|
-
},
|
|
2591
|
-
progress: {
|
|
2592
|
-
copying: "Copying files...",
|
|
2593
|
-
building: "Building project...",
|
|
2594
|
-
packaging: "Creating package...",
|
|
2595
|
-
validating: "Validating...",
|
|
2596
|
-
analyzing: "Analyzing...",
|
|
2597
|
-
restoring: "Restoring dependencies..."
|
|
2598
|
-
},
|
|
2599
|
-
validation: {
|
|
2600
|
-
requiredField: "{field} is required",
|
|
2601
|
-
invalidValue: "Invalid value for {field}",
|
|
2602
|
-
pathNotFound: "Path not found: {path}",
|
|
2603
|
-
fileRequired: "File is required: {path}",
|
|
2604
|
-
directoryRequired: "Directory is required: {path}"
|
|
2605
|
-
},
|
|
2606
|
-
warnings: {
|
|
2607
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2608
|
-
},
|
|
2609
|
-
info: {
|
|
2610
|
-
operationComplete: "Operation completed successfully",
|
|
2611
|
-
filesProcessed: {
|
|
2612
|
-
zero: "No files processed",
|
|
2613
|
-
one: "{count} file processed",
|
|
2614
|
-
other: "{count} files processed"
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
}
|
|
2618
|
-
};
|
|
2619
|
-
|
|
2620
|
-
// ../packager/packager-core/src/i18n/locales/es.ts
|
|
2621
|
-
var es = {
|
|
2622
|
-
toolCore: {
|
|
2623
|
-
errors: {
|
|
2624
|
-
internal: "Internal error: {message}",
|
|
2625
|
-
fileNotFound: "File not found: {path}",
|
|
2626
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2627
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2628
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2629
|
-
invalidPath: "{path} is not a valid path",
|
|
2630
|
-
operationCanceled: "Operation was canceled",
|
|
2631
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2632
|
-
},
|
|
2633
|
-
progress: {
|
|
2634
|
-
copying: "Copying files...",
|
|
2635
|
-
building: "Building project...",
|
|
2636
|
-
packaging: "Creating package...",
|
|
2637
|
-
validating: "Validating...",
|
|
2638
|
-
analyzing: "Analyzing...",
|
|
2639
|
-
restoring: "Restoring dependencies..."
|
|
2640
|
-
},
|
|
2641
|
-
validation: {
|
|
2642
|
-
requiredField: "{field} is required",
|
|
2643
|
-
invalidValue: "Invalid value for {field}",
|
|
2644
|
-
pathNotFound: "Path not found: {path}",
|
|
2645
|
-
fileRequired: "File is required: {path}",
|
|
2646
|
-
directoryRequired: "Directory is required: {path}"
|
|
2647
|
-
},
|
|
2648
|
-
warnings: {
|
|
2649
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2650
|
-
},
|
|
2651
|
-
info: {
|
|
2652
|
-
operationComplete: "Operation completed successfully",
|
|
2653
|
-
filesProcessed: {
|
|
2654
|
-
zero: "No files processed",
|
|
2655
|
-
one: "{count} file processed",
|
|
2656
|
-
other: "{count} files processed"
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
|
-
}
|
|
2660
|
-
};
|
|
2661
|
-
|
|
2662
|
-
// ../packager/packager-core/src/i18n/locales/es-MX.ts
|
|
2663
|
-
var es_MX = {
|
|
2664
|
-
toolCore: {
|
|
2665
|
-
errors: {
|
|
2666
|
-
internal: "Internal error: {message}",
|
|
2667
|
-
fileNotFound: "File not found: {path}",
|
|
2668
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2669
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2670
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2671
|
-
invalidPath: "{path} is not a valid path",
|
|
2672
|
-
operationCanceled: "Operation was canceled",
|
|
2673
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2674
|
-
},
|
|
2675
|
-
progress: {
|
|
2676
|
-
copying: "Copying files...",
|
|
2677
|
-
building: "Building project...",
|
|
2678
|
-
packaging: "Creating package...",
|
|
2679
|
-
validating: "Validating...",
|
|
2680
|
-
analyzing: "Analyzing...",
|
|
2681
|
-
restoring: "Restoring dependencies..."
|
|
2682
|
-
},
|
|
2683
|
-
validation: {
|
|
2684
|
-
requiredField: "{field} is required",
|
|
2685
|
-
invalidValue: "Invalid value for {field}",
|
|
2686
|
-
pathNotFound: "Path not found: {path}",
|
|
2687
|
-
fileRequired: "File is required: {path}",
|
|
2688
|
-
directoryRequired: "Directory is required: {path}"
|
|
2689
|
-
},
|
|
2690
|
-
warnings: {
|
|
2691
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2692
|
-
},
|
|
2693
|
-
info: {
|
|
2694
|
-
operationComplete: "Operation completed successfully",
|
|
2695
|
-
filesProcessed: {
|
|
2696
|
-
zero: "No files processed",
|
|
2697
|
-
one: "{count} file processed",
|
|
2698
|
-
other: "{count} files processed"
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
}
|
|
2702
|
-
};
|
|
2703
|
-
|
|
2704
|
-
// ../packager/packager-core/src/i18n/locales/fr.ts
|
|
2705
|
-
var fr = {
|
|
2706
|
-
toolCore: {
|
|
2707
|
-
errors: {
|
|
2708
|
-
internal: "Internal error: {message}",
|
|
2709
|
-
fileNotFound: "File not found: {path}",
|
|
2710
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2711
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2712
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2713
|
-
invalidPath: "{path} is not a valid path",
|
|
2714
|
-
operationCanceled: "Operation was canceled",
|
|
2715
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2716
|
-
},
|
|
2717
|
-
progress: {
|
|
2718
|
-
copying: "Copying files...",
|
|
2719
|
-
building: "Building project...",
|
|
2720
|
-
packaging: "Creating package...",
|
|
2721
|
-
validating: "Validating...",
|
|
2722
|
-
analyzing: "Analyzing...",
|
|
2723
|
-
restoring: "Restoring dependencies..."
|
|
2724
|
-
},
|
|
2725
|
-
validation: {
|
|
2726
|
-
requiredField: "{field} is required",
|
|
2727
|
-
invalidValue: "Invalid value for {field}",
|
|
2728
|
-
pathNotFound: "Path not found: {path}",
|
|
2729
|
-
fileRequired: "File is required: {path}",
|
|
2730
|
-
directoryRequired: "Directory is required: {path}"
|
|
2731
|
-
},
|
|
2732
|
-
warnings: {
|
|
2733
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2734
|
-
},
|
|
2735
|
-
info: {
|
|
2736
|
-
operationComplete: "Operation completed successfully",
|
|
2737
|
-
filesProcessed: {
|
|
2738
|
-
zero: "No files processed",
|
|
2739
|
-
one: "{count} file processed",
|
|
2740
|
-
other: "{count} files processed"
|
|
2741
|
-
}
|
|
2742
|
-
}
|
|
2743
|
-
}
|
|
2744
|
-
};
|
|
2745
|
-
|
|
2746
|
-
// ../packager/packager-core/src/i18n/locales/ja.ts
|
|
2747
|
-
var ja = {
|
|
2748
|
-
toolCore: {
|
|
2749
|
-
errors: {
|
|
2750
|
-
internal: "Internal error: {message}",
|
|
2751
|
-
fileNotFound: "File not found: {path}",
|
|
2752
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2753
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2754
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2755
|
-
invalidPath: "{path} is not a valid path",
|
|
2756
|
-
operationCanceled: "Operation was canceled",
|
|
2757
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2758
|
-
},
|
|
2759
|
-
progress: {
|
|
2760
|
-
copying: "Copying files...",
|
|
2761
|
-
building: "Building project...",
|
|
2762
|
-
packaging: "Creating package...",
|
|
2763
|
-
validating: "Validating...",
|
|
2764
|
-
analyzing: "Analyzing...",
|
|
2765
|
-
restoring: "Restoring dependencies..."
|
|
2766
|
-
},
|
|
2767
|
-
validation: {
|
|
2768
|
-
requiredField: "{field} is required",
|
|
2769
|
-
invalidValue: "Invalid value for {field}",
|
|
2770
|
-
pathNotFound: "Path not found: {path}",
|
|
2771
|
-
fileRequired: "File is required: {path}",
|
|
2772
|
-
directoryRequired: "Directory is required: {path}"
|
|
2773
|
-
},
|
|
2774
|
-
warnings: {
|
|
2775
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2776
|
-
},
|
|
2777
|
-
info: {
|
|
2778
|
-
operationComplete: "Operation completed successfully",
|
|
2779
|
-
filesProcessed: {
|
|
2780
|
-
zero: "No files processed",
|
|
2781
|
-
one: "{count} file processed",
|
|
2782
|
-
other: "{count} files processed"
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
}
|
|
2786
|
-
};
|
|
2787
|
-
|
|
2788
|
-
// ../packager/packager-core/src/i18n/locales/ko.ts
|
|
2789
|
-
var ko = {
|
|
2790
|
-
toolCore: {
|
|
2791
|
-
errors: {
|
|
2792
|
-
internal: "Internal error: {message}",
|
|
2793
|
-
fileNotFound: "File not found: {path}",
|
|
2794
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2795
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2796
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2797
|
-
invalidPath: "{path} is not a valid path",
|
|
2798
|
-
operationCanceled: "Operation was canceled",
|
|
2799
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2800
|
-
},
|
|
2801
|
-
progress: {
|
|
2802
|
-
copying: "Copying files...",
|
|
2803
|
-
building: "Building project...",
|
|
2804
|
-
packaging: "Creating package...",
|
|
2805
|
-
validating: "Validating...",
|
|
2806
|
-
analyzing: "Analyzing...",
|
|
2807
|
-
restoring: "Restoring dependencies..."
|
|
2808
|
-
},
|
|
2809
|
-
validation: {
|
|
2810
|
-
requiredField: "{field} is required",
|
|
2811
|
-
invalidValue: "Invalid value for {field}",
|
|
2812
|
-
pathNotFound: "Path not found: {path}",
|
|
2813
|
-
fileRequired: "File is required: {path}",
|
|
2814
|
-
directoryRequired: "Directory is required: {path}"
|
|
2815
|
-
},
|
|
2816
|
-
warnings: {
|
|
2817
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2818
|
-
},
|
|
2819
|
-
info: {
|
|
2820
|
-
operationComplete: "Operation completed successfully",
|
|
2821
|
-
filesProcessed: {
|
|
2822
|
-
zero: "No files processed",
|
|
2823
|
-
one: "{count} file processed",
|
|
2824
|
-
other: "{count} files processed"
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
};
|
|
2829
|
-
|
|
2830
|
-
// ../packager/packager-core/src/i18n/locales/pt.ts
|
|
2831
|
-
var pt = {
|
|
2832
|
-
toolCore: {
|
|
2833
|
-
errors: {
|
|
2834
|
-
internal: "Internal error: {message}",
|
|
2835
|
-
fileNotFound: "File not found: {path}",
|
|
2836
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2837
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2838
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2839
|
-
invalidPath: "{path} is not a valid path",
|
|
2840
|
-
operationCanceled: "Operation was canceled",
|
|
2841
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2842
|
-
},
|
|
2843
|
-
progress: {
|
|
2844
|
-
copying: "Copying files...",
|
|
2845
|
-
building: "Building project...",
|
|
2846
|
-
packaging: "Creating package...",
|
|
2847
|
-
validating: "Validating...",
|
|
2848
|
-
analyzing: "Analyzing...",
|
|
2849
|
-
restoring: "Restoring dependencies..."
|
|
2850
|
-
},
|
|
2851
|
-
validation: {
|
|
2852
|
-
requiredField: "{field} is required",
|
|
2853
|
-
invalidValue: "Invalid value for {field}",
|
|
2854
|
-
pathNotFound: "Path not found: {path}",
|
|
2855
|
-
fileRequired: "File is required: {path}",
|
|
2856
|
-
directoryRequired: "Directory is required: {path}"
|
|
2857
|
-
},
|
|
2858
|
-
warnings: {
|
|
2859
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2860
|
-
},
|
|
2861
|
-
info: {
|
|
2862
|
-
operationComplete: "Operation completed successfully",
|
|
2863
|
-
filesProcessed: {
|
|
2864
|
-
zero: "No files processed",
|
|
2865
|
-
one: "{count} file processed",
|
|
2866
|
-
other: "{count} files processed"
|
|
2867
|
-
}
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
};
|
|
2871
|
-
|
|
2872
|
-
// ../packager/packager-core/src/i18n/locales/pt-BR.ts
|
|
2873
|
-
var pt_BR = {
|
|
2874
|
-
toolCore: {
|
|
2875
|
-
errors: {
|
|
2876
|
-
internal: "Internal error: {message}",
|
|
2877
|
-
fileNotFound: "File not found: {path}",
|
|
2878
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2879
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2880
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2881
|
-
invalidPath: "{path} is not a valid path",
|
|
2882
|
-
operationCanceled: "Operation was canceled",
|
|
2883
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2884
|
-
},
|
|
2885
|
-
progress: {
|
|
2886
|
-
copying: "Copying files...",
|
|
2887
|
-
building: "Building project...",
|
|
2888
|
-
packaging: "Creating package...",
|
|
2889
|
-
validating: "Validating...",
|
|
2890
|
-
analyzing: "Analyzing...",
|
|
2891
|
-
restoring: "Restoring dependencies..."
|
|
2892
|
-
},
|
|
2893
|
-
validation: {
|
|
2894
|
-
requiredField: "{field} is required",
|
|
2895
|
-
invalidValue: "Invalid value for {field}",
|
|
2896
|
-
pathNotFound: "Path not found: {path}",
|
|
2897
|
-
fileRequired: "File is required: {path}",
|
|
2898
|
-
directoryRequired: "Directory is required: {path}"
|
|
2899
|
-
},
|
|
2900
|
-
warnings: {
|
|
2901
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2902
|
-
},
|
|
2903
|
-
info: {
|
|
2904
|
-
operationComplete: "Operation completed successfully",
|
|
2905
|
-
filesProcessed: {
|
|
2906
|
-
zero: "No files processed",
|
|
2907
|
-
one: "{count} file processed",
|
|
2908
|
-
other: "{count} files processed"
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
};
|
|
2913
|
-
|
|
2914
|
-
// ../packager/packager-core/src/i18n/locales/ro.ts
|
|
2915
|
-
var ro = {
|
|
2916
|
-
toolCore: {
|
|
2917
|
-
errors: {
|
|
2918
|
-
internal: "Internal error: {message}",
|
|
2919
|
-
fileNotFound: "File not found: {path}",
|
|
2920
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2921
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2922
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2923
|
-
invalidPath: "{path} is not a valid path",
|
|
2924
|
-
operationCanceled: "Operation was canceled",
|
|
2925
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2926
|
-
},
|
|
2927
|
-
progress: {
|
|
2928
|
-
copying: "Copying files...",
|
|
2929
|
-
building: "Building project...",
|
|
2930
|
-
packaging: "Creating package...",
|
|
2931
|
-
validating: "Validating...",
|
|
2932
|
-
analyzing: "Analyzing...",
|
|
2933
|
-
restoring: "Restoring dependencies..."
|
|
2934
|
-
},
|
|
2935
|
-
validation: {
|
|
2936
|
-
requiredField: "{field} is required",
|
|
2937
|
-
invalidValue: "Invalid value for {field}",
|
|
2938
|
-
pathNotFound: "Path not found: {path}",
|
|
2939
|
-
fileRequired: "File is required: {path}",
|
|
2940
|
-
directoryRequired: "Directory is required: {path}"
|
|
2941
|
-
},
|
|
2942
|
-
warnings: {
|
|
2943
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2944
|
-
},
|
|
2945
|
-
info: {
|
|
2946
|
-
operationComplete: "Operation completed successfully",
|
|
2947
|
-
filesProcessed: {
|
|
2948
|
-
zero: "No files processed",
|
|
2949
|
-
one: "{count} file processed",
|
|
2950
|
-
other: "{count} files processed"
|
|
2951
|
-
}
|
|
2952
|
-
}
|
|
2953
|
-
}
|
|
2954
|
-
};
|
|
2955
|
-
|
|
2956
|
-
// ../packager/packager-core/src/i18n/locales/ru.ts
|
|
2957
|
-
var ru = {
|
|
2958
|
-
toolCore: {
|
|
2959
|
-
errors: {
|
|
2960
|
-
internal: "Internal error: {message}",
|
|
2961
|
-
fileNotFound: "File not found: {path}",
|
|
2962
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
2963
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
2964
|
-
directoryNotFound: "Directory not found: {path}",
|
|
2965
|
-
invalidPath: "{path} is not a valid path",
|
|
2966
|
-
operationCanceled: "Operation was canceled",
|
|
2967
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
2968
|
-
},
|
|
2969
|
-
progress: {
|
|
2970
|
-
copying: "Copying files...",
|
|
2971
|
-
building: "Building project...",
|
|
2972
|
-
packaging: "Creating package...",
|
|
2973
|
-
validating: "Validating...",
|
|
2974
|
-
analyzing: "Analyzing...",
|
|
2975
|
-
restoring: "Restoring dependencies..."
|
|
2976
|
-
},
|
|
2977
|
-
validation: {
|
|
2978
|
-
requiredField: "{field} is required",
|
|
2979
|
-
invalidValue: "Invalid value for {field}",
|
|
2980
|
-
pathNotFound: "Path not found: {path}",
|
|
2981
|
-
fileRequired: "File is required: {path}",
|
|
2982
|
-
directoryRequired: "Directory is required: {path}"
|
|
2983
|
-
},
|
|
2984
|
-
warnings: {
|
|
2985
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
2986
|
-
},
|
|
2987
|
-
info: {
|
|
2988
|
-
operationComplete: "Operation completed successfully",
|
|
2989
|
-
filesProcessed: {
|
|
2990
|
-
zero: "No files processed",
|
|
2991
|
-
one: "{count} file processed",
|
|
2992
|
-
other: "{count} files processed"
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
2995
|
-
}
|
|
2996
|
-
};
|
|
2997
|
-
|
|
2998
|
-
// ../packager/packager-core/src/i18n/locales/tr.ts
|
|
2999
|
-
var tr = {
|
|
3000
|
-
toolCore: {
|
|
3001
|
-
errors: {
|
|
3002
|
-
internal: "Internal error: {message}",
|
|
3003
|
-
fileNotFound: "File not found: {path}",
|
|
3004
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
3005
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
3006
|
-
directoryNotFound: "Directory not found: {path}",
|
|
3007
|
-
invalidPath: "{path} is not a valid path",
|
|
3008
|
-
operationCanceled: "Operation was canceled",
|
|
3009
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
3010
|
-
},
|
|
3011
|
-
progress: {
|
|
3012
|
-
copying: "Copying files...",
|
|
3013
|
-
building: "Building project...",
|
|
3014
|
-
packaging: "Creating package...",
|
|
3015
|
-
validating: "Validating...",
|
|
3016
|
-
analyzing: "Analyzing...",
|
|
3017
|
-
restoring: "Restoring dependencies..."
|
|
3018
|
-
},
|
|
3019
|
-
validation: {
|
|
3020
|
-
requiredField: "{field} is required",
|
|
3021
|
-
invalidValue: "Invalid value for {field}",
|
|
3022
|
-
pathNotFound: "Path not found: {path}",
|
|
3023
|
-
fileRequired: "File is required: {path}",
|
|
3024
|
-
directoryRequired: "Directory is required: {path}"
|
|
3025
|
-
},
|
|
3026
|
-
warnings: {
|
|
3027
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
3028
|
-
},
|
|
3029
|
-
info: {
|
|
3030
|
-
operationComplete: "Operation completed successfully",
|
|
3031
|
-
filesProcessed: {
|
|
3032
|
-
zero: "No files processed",
|
|
3033
|
-
one: "{count} file processed",
|
|
3034
|
-
other: "{count} files processed"
|
|
3035
|
-
}
|
|
3036
|
-
}
|
|
3037
|
-
}
|
|
3038
|
-
};
|
|
3039
|
-
|
|
3040
|
-
// ../packager/packager-core/src/i18n/locales/zh-CN.ts
|
|
3041
|
-
var zh_CN = {
|
|
3042
|
-
toolCore: {
|
|
3043
|
-
errors: {
|
|
3044
|
-
internal: "Internal error: {message}",
|
|
3045
|
-
fileNotFound: "File not found: {path}",
|
|
3046
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
3047
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
3048
|
-
directoryNotFound: "Directory not found: {path}",
|
|
3049
|
-
invalidPath: "{path} is not a valid path",
|
|
3050
|
-
operationCanceled: "Operation was canceled",
|
|
3051
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
3052
|
-
},
|
|
3053
|
-
progress: {
|
|
3054
|
-
copying: "Copying files...",
|
|
3055
|
-
building: "Building project...",
|
|
3056
|
-
packaging: "Creating package...",
|
|
3057
|
-
validating: "Validating...",
|
|
3058
|
-
analyzing: "Analyzing...",
|
|
3059
|
-
restoring: "Restoring dependencies..."
|
|
3060
|
-
},
|
|
3061
|
-
validation: {
|
|
3062
|
-
requiredField: "{field} is required",
|
|
3063
|
-
invalidValue: "Invalid value for {field}",
|
|
3064
|
-
pathNotFound: "Path not found: {path}",
|
|
3065
|
-
fileRequired: "File is required: {path}",
|
|
3066
|
-
directoryRequired: "Directory is required: {path}"
|
|
3067
|
-
},
|
|
3068
|
-
warnings: {
|
|
3069
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
3070
|
-
},
|
|
3071
|
-
info: {
|
|
3072
|
-
operationComplete: "Operation completed successfully",
|
|
3073
|
-
filesProcessed: {
|
|
3074
|
-
zero: "No files processed",
|
|
3075
|
-
one: "{count} file processed",
|
|
3076
|
-
other: "{count} files processed"
|
|
3077
|
-
}
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
|
-
};
|
|
3081
|
-
|
|
3082
|
-
// ../packager/packager-core/src/i18n/locales/zh-TW.ts
|
|
3083
|
-
var zh_TW = {
|
|
3084
|
-
toolCore: {
|
|
3085
|
-
errors: {
|
|
3086
|
-
internal: "Internal error: {message}",
|
|
3087
|
-
fileNotFound: "File not found: {path}",
|
|
3088
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
3089
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
3090
|
-
directoryNotFound: "Directory not found: {path}",
|
|
3091
|
-
invalidPath: "{path} is not a valid path",
|
|
3092
|
-
operationCanceled: "Operation was canceled",
|
|
3093
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
3094
|
-
},
|
|
3095
|
-
progress: {
|
|
3096
|
-
copying: "Copying files...",
|
|
3097
|
-
building: "Building project...",
|
|
3098
|
-
packaging: "Creating package...",
|
|
3099
|
-
validating: "Validating...",
|
|
3100
|
-
analyzing: "Analyzing...",
|
|
3101
|
-
restoring: "Restoring dependencies..."
|
|
3102
|
-
},
|
|
3103
|
-
validation: {
|
|
3104
|
-
requiredField: "{field} is required",
|
|
3105
|
-
invalidValue: "Invalid value for {field}",
|
|
3106
|
-
pathNotFound: "Path not found: {path}",
|
|
3107
|
-
fileRequired: "File is required: {path}",
|
|
3108
|
-
directoryRequired: "Directory is required: {path}"
|
|
3109
|
-
},
|
|
3110
|
-
warnings: {
|
|
3111
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
3112
|
-
},
|
|
3113
|
-
info: {
|
|
3114
|
-
operationComplete: "Operation completed successfully",
|
|
3115
|
-
filesProcessed: {
|
|
3116
|
-
zero: "No files processed",
|
|
3117
|
-
one: "{count} file processed",
|
|
3118
|
-
other: "{count} files processed"
|
|
3119
|
-
}
|
|
3120
|
-
}
|
|
3121
|
-
}
|
|
3122
|
-
};
|
|
3123
|
-
|
|
3124
|
-
// ../packager/packager-core/src/i18n/locales/zu.ts
|
|
3125
|
-
var zu = {
|
|
3126
|
-
toolCore: {
|
|
3127
|
-
errors: {
|
|
3128
|
-
internal: "Internal error: {message}",
|
|
3129
|
-
fileNotFound: "File not found: {path}",
|
|
3130
|
-
fileReadFailed: "Failed to read file: {path}",
|
|
3131
|
-
fileWriteFailed: "Failed to write file: {path}",
|
|
3132
|
-
directoryNotFound: "Directory not found: {path}",
|
|
3133
|
-
invalidPath: "{path} is not a valid path",
|
|
3134
|
-
operationCanceled: "Operation was canceled",
|
|
3135
|
-
invalidParameter: "Invalid parameter: {parameter}"
|
|
3136
|
-
},
|
|
3137
|
-
progress: {
|
|
3138
|
-
copying: "Copying files...",
|
|
3139
|
-
building: "Building project...",
|
|
3140
|
-
packaging: "Creating package...",
|
|
3141
|
-
validating: "Validating...",
|
|
3142
|
-
analyzing: "Analyzing...",
|
|
3143
|
-
restoring: "Restoring dependencies..."
|
|
3144
|
-
},
|
|
3145
|
-
validation: {
|
|
3146
|
-
requiredField: "{field} is required",
|
|
3147
|
-
invalidValue: "Invalid value for {field}",
|
|
3148
|
-
pathNotFound: "Path not found: {path}",
|
|
3149
|
-
fileRequired: "File is required: {path}",
|
|
3150
|
-
directoryRequired: "Directory is required: {path}"
|
|
3151
|
-
},
|
|
3152
|
-
warnings: {
|
|
3153
|
-
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
3154
|
-
},
|
|
3155
|
-
info: {
|
|
3156
|
-
operationComplete: "Operation completed successfully",
|
|
3157
|
-
filesProcessed: {
|
|
3158
|
-
zero: "No files processed",
|
|
3159
|
-
one: "{count} file processed",
|
|
3160
|
-
other: "{count} files processed"
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
};
|
|
3165
|
-
|
|
3166
|
-
// ../packager/packager-core/src/i18n/translation-service.ts
|
|
3167
|
-
class TranslationService {
|
|
3168
|
-
static instance;
|
|
3169
|
-
currentLocale = "en";
|
|
3170
|
-
constructor() {}
|
|
3171
|
-
static getInstance() {
|
|
3172
|
-
if (!TranslationService.instance) {
|
|
3173
|
-
TranslationService.instance = new TranslationService;
|
|
3174
|
-
}
|
|
3175
|
-
return TranslationService.instance;
|
|
3176
|
-
}
|
|
3177
|
-
setLocale(locale) {
|
|
3178
|
-
this.currentLocale = I18nManager.setLocale(locale);
|
|
3179
|
-
}
|
|
3180
|
-
getLocale() {
|
|
3181
|
-
return this.currentLocale;
|
|
3182
|
-
}
|
|
3183
|
-
t(key, params) {
|
|
3184
|
-
return I18nManager.t(key, params, this.currentLocale);
|
|
3185
|
-
}
|
|
3186
|
-
tLocale(key, locale, params) {
|
|
3187
|
-
return I18nManager.t(key, params, locale);
|
|
3188
|
-
}
|
|
3189
|
-
has(key) {
|
|
3190
|
-
return I18nManager.has(key, this.currentLocale);
|
|
3191
|
-
}
|
|
3192
|
-
getAvailableLocales() {
|
|
3193
|
-
return I18nManager.getAvailableLocales();
|
|
3194
|
-
}
|
|
3195
|
-
}
|
|
3196
|
-
var translate = TranslationService.getInstance();
|
|
3197
|
-
|
|
3198
|
-
// ../packager/packager-core/src/i18n/index.ts
|
|
3199
|
-
I18nManager.registerTranslations("en", en);
|
|
3200
|
-
I18nManager.registerTranslations("de", de);
|
|
3201
|
-
I18nManager.registerTranslations("es", es);
|
|
3202
|
-
I18nManager.registerTranslations("es-mx", es_MX);
|
|
3203
|
-
I18nManager.registerTranslations("fr", fr);
|
|
3204
|
-
I18nManager.registerTranslations("ja", ja);
|
|
3205
|
-
I18nManager.registerTranslations("ko", ko);
|
|
3206
|
-
I18nManager.registerTranslations("pt", pt);
|
|
3207
|
-
I18nManager.registerTranslations("pt-br", pt_BR);
|
|
3208
|
-
I18nManager.registerTranslations("ro", ro);
|
|
3209
|
-
I18nManager.registerTranslations("ru", ru);
|
|
3210
|
-
I18nManager.registerTranslations("tr", tr);
|
|
3211
|
-
I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
3212
|
-
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
3213
|
-
I18nManager.registerTranslations("zu", zu);
|
|
3214
|
-
I18nManager.setLocale("en");
|
|
3215
|
-
// ../packager/packager-core/src/services/tools-factory-repository.ts
|
|
3216
|
-
class ToolsFactoryRepository {
|
|
3217
|
-
projectFactoryMap = new Map;
|
|
3218
|
-
solutionFactory = null;
|
|
3219
|
-
registerProjectToolFactory(factory) {
|
|
3220
|
-
for (const type of factory.supportedTypes) {
|
|
3221
|
-
const existing = this.projectFactoryMap.get(type);
|
|
3222
|
-
if (existing) {
|
|
3223
|
-
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
3224
|
-
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
3225
|
-
}
|
|
3226
|
-
continue;
|
|
3227
|
-
}
|
|
3228
|
-
this.projectFactoryMap.set(type, factory);
|
|
3229
|
-
}
|
|
3230
|
-
}
|
|
3231
|
-
registerSolutionToolFactory(factory) {
|
|
3232
|
-
this.solutionFactory = factory;
|
|
3233
|
-
}
|
|
3234
|
-
getSolutionToolFactory() {
|
|
3235
|
-
if (!this.solutionFactory) {
|
|
3236
|
-
throw new Error("No solution tool factory is registered");
|
|
3237
|
-
}
|
|
3238
|
-
return this.solutionFactory;
|
|
3239
|
-
}
|
|
3240
|
-
canHandleProject(projectType) {
|
|
3241
|
-
return this.projectFactoryMap.has(projectType);
|
|
3242
|
-
}
|
|
3243
|
-
getProjectToolFactory(projectType) {
|
|
3244
|
-
const factory = this.projectFactoryMap.get(projectType);
|
|
3245
|
-
if (!factory) {
|
|
3246
|
-
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
|
|
3247
|
-
}
|
|
3248
|
-
return factory;
|
|
3249
|
-
}
|
|
3250
|
-
reset() {
|
|
3251
|
-
this.projectFactoryMap.clear();
|
|
3252
|
-
this.solutionFactory = null;
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
3256
|
-
var _global = globalThis;
|
|
3257
|
-
if (!_global[REGISTRY_KEY]) {
|
|
3258
|
-
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
3259
|
-
}
|
|
3260
|
-
var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
3261
2399
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/file-storage-provider.js
|
|
3262
2400
|
function isFileNotFoundError(error) {
|
|
3263
2401
|
if (!error || typeof error != "object")
|
|
@@ -3309,7 +2447,6 @@ class InMemoryCacheProvider {
|
|
|
3309
2447
|
this._defaultTtlMs = defaultTtlMs;
|
|
3310
2448
|
}
|
|
3311
2449
|
}
|
|
3312
|
-
|
|
3313
2450
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/ip-range-bypass-secret-provider.js
|
|
3314
2451
|
class NullIpRangeBypassSecretProvider {
|
|
3315
2452
|
async getIpRangeBypassSecretAsync(_cancellationToken) {
|
|
@@ -3330,6 +2467,183 @@ class NullSecretsProvider {
|
|
|
3330
2467
|
}
|
|
3331
2468
|
}
|
|
3332
2469
|
|
|
2470
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/timeout-exception.js
|
|
2471
|
+
class TimeoutException extends Error {
|
|
2472
|
+
constructor(message, timeoutMs) {
|
|
2473
|
+
super(message);
|
|
2474
|
+
this.name = "TimeoutException";
|
|
2475
|
+
this.timeoutMs = timeoutMs;
|
|
2476
|
+
if (Error.captureStackTrace)
|
|
2477
|
+
Error.captureStackTrace(this, TimeoutException);
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/helpers/timeout.js
|
|
2482
|
+
function createTimeoutSignal(timeoutMs, description, linkedSignal) {
|
|
2483
|
+
const controller = new AbortController;
|
|
2484
|
+
let timeoutId;
|
|
2485
|
+
const dispose = () => {
|
|
2486
|
+
if (timeoutId !== undefined) {
|
|
2487
|
+
clearTimeout(timeoutId);
|
|
2488
|
+
timeoutId = undefined;
|
|
2489
|
+
}
|
|
2490
|
+
linkedSignal?.removeEventListener("abort", onLinkedAbort);
|
|
2491
|
+
};
|
|
2492
|
+
const onLinkedAbort = () => {
|
|
2493
|
+
dispose();
|
|
2494
|
+
controller.abort(linkedSignal?.reason);
|
|
2495
|
+
};
|
|
2496
|
+
if (linkedSignal?.aborted) {
|
|
2497
|
+
controller.abort(linkedSignal.reason);
|
|
2498
|
+
return {
|
|
2499
|
+
signal: controller.signal,
|
|
2500
|
+
dispose
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
timeoutId = setTimeout(() => {
|
|
2504
|
+
dispose();
|
|
2505
|
+
controller.abort(new TimeoutException(`${description} timed out after ${timeoutMs}ms`, timeoutMs));
|
|
2506
|
+
}, timeoutMs);
|
|
2507
|
+
linkedSignal?.addEventListener("abort", onLinkedAbort, {
|
|
2508
|
+
once: true
|
|
2509
|
+
});
|
|
2510
|
+
return {
|
|
2511
|
+
signal: controller.signal,
|
|
2512
|
+
dispose
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
var MAX_TIMEOUT_MS = 2147483647;
|
|
2516
|
+
function isValidTimeoutMs(value) {
|
|
2517
|
+
return typeof value == "number" && Number.isFinite(value) && value > 0 && value <= MAX_TIMEOUT_MS;
|
|
2518
|
+
}
|
|
2519
|
+
function readTimeoutOverrideMs(storageKey) {
|
|
2520
|
+
try {
|
|
2521
|
+
if ("u" < typeof localStorage)
|
|
2522
|
+
return;
|
|
2523
|
+
const raw = localStorage.getItem(storageKey);
|
|
2524
|
+
if (raw === null || raw.trim() === "")
|
|
2525
|
+
return;
|
|
2526
|
+
const parsed = Number(raw);
|
|
2527
|
+
return isValidTimeoutMs(parsed) ? parsed : undefined;
|
|
2528
|
+
} catch {
|
|
2529
|
+
return;
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/operation-cancelled-exception.js
|
|
2534
|
+
class OperationCancelledException extends Error {
|
|
2535
|
+
constructor(message, operationName) {
|
|
2536
|
+
super(message ?? "The operation was cancelled");
|
|
2537
|
+
this.name = "OperationCancelledException";
|
|
2538
|
+
this.operationName = operationName;
|
|
2539
|
+
if (Error.captureStackTrace)
|
|
2540
|
+
Error.captureStackTrace(this, OperationCancelledException);
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/providers/timeout-file-storage-provider.js
|
|
2545
|
+
class TimeoutFileStorageProvider2 {
|
|
2546
|
+
fileExistsAsync(path, cancellationToken) {
|
|
2547
|
+
return this.guard(`fileExists(${path})`, cancellationToken, (signal) => this.inner.fileExistsAsync(path, signal));
|
|
2548
|
+
}
|
|
2549
|
+
async openFileAsync(path, cancellationToken) {
|
|
2550
|
+
const stream = await this.guard(`openFile(${path})`, cancellationToken, (signal) => this.inner.openFileAsync(path, signal));
|
|
2551
|
+
return this.bindReadsToTimeout(stream, `read(${path})`, cancellationToken);
|
|
2552
|
+
}
|
|
2553
|
+
bindReadsToTimeout(stream, description, cancellationToken) {
|
|
2554
|
+
const reader = stream.getReader();
|
|
2555
|
+
return new ReadableStream({
|
|
2556
|
+
pull: async (controller) => {
|
|
2557
|
+
let result;
|
|
2558
|
+
try {
|
|
2559
|
+
result = await this.guard(description, cancellationToken, () => reader.read());
|
|
2560
|
+
} catch (error) {
|
|
2561
|
+
reader.cancel(error).catch(() => {});
|
|
2562
|
+
throw error;
|
|
2563
|
+
}
|
|
2564
|
+
if (result.done)
|
|
2565
|
+
controller.close();
|
|
2566
|
+
else
|
|
2567
|
+
controller.enqueue(result.value);
|
|
2568
|
+
},
|
|
2569
|
+
cancel: (reason) => reader.cancel(reason)
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
readFileToEndAsync(path, cancellationToken) {
|
|
2573
|
+
return this.guard(`readFileToEnd(${path})`, cancellationToken, (signal) => this.inner.readFileToEndAsync(path, signal));
|
|
2574
|
+
}
|
|
2575
|
+
writeFileAsync(path, content, cancellationToken) {
|
|
2576
|
+
return this.guard(`writeFile(${path})`, cancellationToken, (signal) => this.inner.writeFileAsync(path, content, signal));
|
|
2577
|
+
}
|
|
2578
|
+
deleteFileAsync(path, cancellationToken) {
|
|
2579
|
+
return this.guard(`deleteFile(${path})`, cancellationToken, (signal) => this.inner.deleteFileAsync(path, signal));
|
|
2580
|
+
}
|
|
2581
|
+
getFilesAsync(path, searchPattern, cancellationToken) {
|
|
2582
|
+
return this.guard(`getFiles(${path ?? ""}, ${searchPattern ?? ""})`, cancellationToken, (signal) => this.inner.getFilesAsync(path, searchPattern, signal));
|
|
2583
|
+
}
|
|
2584
|
+
async guard(description, cancellationToken, operation) {
|
|
2585
|
+
const timeout = createTimeoutSignal(this.timeoutMs, `File storage operation ${description}`, cancellationToken);
|
|
2586
|
+
try {
|
|
2587
|
+
return await Promise.race([
|
|
2588
|
+
operation(timeout.signal),
|
|
2589
|
+
rejectOnAbort(timeout.signal)
|
|
2590
|
+
]);
|
|
2591
|
+
} catch (error) {
|
|
2592
|
+
if (cancellationToken?.aborted)
|
|
2593
|
+
throw cancellationToken.reason instanceof OperationCancelledException ? cancellationToken.reason : new OperationCancelledException(undefined, description);
|
|
2594
|
+
if (timeout.signal.aborted && timeout.signal.reason instanceof TimeoutException)
|
|
2595
|
+
throw timeout.signal.reason;
|
|
2596
|
+
throw error;
|
|
2597
|
+
} finally {
|
|
2598
|
+
timeout.dispose();
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
constructor(inner, timeoutMs) {
|
|
2602
|
+
this.inner = inner;
|
|
2603
|
+
this.timeoutMs = timeoutMs;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
function rejectOnAbort(signal) {
|
|
2607
|
+
return new Promise((_, reject) => {
|
|
2608
|
+
if (signal.aborted)
|
|
2609
|
+
return void reject(signal.reason);
|
|
2610
|
+
signal.addEventListener("abort", () => reject(signal.reason), {
|
|
2611
|
+
once: true
|
|
2612
|
+
});
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
function withFileOperationTimeout2(provider, timeoutMs) {
|
|
2616
|
+
if (!isValidTimeoutMs(timeoutMs) || provider instanceof TimeoutFileStorageProvider2)
|
|
2617
|
+
return provider;
|
|
2618
|
+
return new TimeoutFileStorageProvider2(provider, timeoutMs);
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/solution-context-options.js
|
|
2622
|
+
var DEFAULT_SOLUTION_CONTEXT_OPTIONS = {
|
|
2623
|
+
lockTimeoutMs: 30000,
|
|
2624
|
+
fileOperationTimeoutMs: 30000
|
|
2625
|
+
};
|
|
2626
|
+
var SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY = "SOL_RB_SOLUTION_CONTEXT_TIMEOUT_MS";
|
|
2627
|
+
var FILE_OPERATION_TIMEOUT_STORAGE_KEY = "SOL_RB_FILE_OPERATION_TIMEOUT_MS";
|
|
2628
|
+
function resolveTimeoutMs(storageKey, configured, fallback) {
|
|
2629
|
+
const override = readTimeoutOverrideMs(storageKey);
|
|
2630
|
+
if (override !== undefined)
|
|
2631
|
+
return override;
|
|
2632
|
+
return isValidTimeoutMs(configured) ? configured : fallback;
|
|
2633
|
+
}
|
|
2634
|
+
function resolveLockTimeoutMs(options) {
|
|
2635
|
+
return resolveTimeoutMs(SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY, options?.lockTimeoutMs, DEFAULT_SOLUTION_CONTEXT_OPTIONS.lockTimeoutMs);
|
|
2636
|
+
}
|
|
2637
|
+
function resolveFileOperationTimeoutMs(options) {
|
|
2638
|
+
return resolveTimeoutMs(FILE_OPERATION_TIMEOUT_STORAGE_KEY, options?.fileOperationTimeoutMs, DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs);
|
|
2639
|
+
}
|
|
2640
|
+
function mergeSolutionContextOptions(options) {
|
|
2641
|
+
return {
|
|
2642
|
+
lockTimeoutMs: isValidTimeoutMs(options?.lockTimeoutMs) ? options.lockTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.lockTimeoutMs,
|
|
2643
|
+
fileOperationTimeoutMs: isValidTimeoutMs(options?.fileOperationTimeoutMs) ? options.fileOperationTimeoutMs : DEFAULT_SOLUTION_CONTEXT_OPTIONS.fileOperationTimeoutMs
|
|
2644
|
+
};
|
|
2645
|
+
}
|
|
2646
|
+
|
|
3333
2647
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/models.js
|
|
3334
2648
|
var SolutionConstants = {
|
|
3335
2649
|
RESOURCE_FILES_FOLDER_NAME: "resources",
|
|
@@ -3464,17 +2778,6 @@ class DisconnectedException extends Error {
|
|
|
3464
2778
|
}
|
|
3465
2779
|
}
|
|
3466
2780
|
|
|
3467
|
-
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/operation-cancelled-exception.js
|
|
3468
|
-
class OperationCancelledException extends Error {
|
|
3469
|
-
constructor(message, operationName) {
|
|
3470
|
-
super(message ?? "The operation was cancelled");
|
|
3471
|
-
this.name = "OperationCancelledException";
|
|
3472
|
-
this.operationName = operationName;
|
|
3473
|
-
if (Error.captureStackTrace)
|
|
3474
|
-
Error.captureStackTrace(this, OperationCancelledException);
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
|
|
3478
2781
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/exceptions/invalid-operation-exception.js
|
|
3479
2782
|
class InvalidOperationException extends Error {
|
|
3480
2783
|
constructor(message) {
|
|
@@ -4139,10 +3442,14 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
4139
3442
|
this._jsonSerializer = this.jsonSerializerFactory.getByName(JsonSerializerNames.CamelCaseIndented);
|
|
4140
3443
|
return this._jsonSerializer;
|
|
4141
3444
|
}
|
|
3445
|
+
async getFileStorageProviderAsync(context, cancellationToken) {
|
|
3446
|
+
const provider = await this.fileStorageProviderFactory.getProviderAsync(context, cancellationToken);
|
|
3447
|
+
return withFileOperationTimeout2(provider, resolveFileOperationTimeoutMs(this.options));
|
|
3448
|
+
}
|
|
4142
3449
|
async readAsync(context, cancellationToken) {
|
|
4143
3450
|
this.logger.info("Reading multi-file solution definition for solution %s", context.path);
|
|
4144
3451
|
const solutionKey = this.getSolutionKey(context);
|
|
4145
|
-
const fileStorageProvider = await this.
|
|
3452
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
4146
3453
|
const resources = [];
|
|
4147
3454
|
const solutionFiles = [];
|
|
4148
3455
|
let hashes;
|
|
@@ -4218,6 +3525,12 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
4218
3525
|
invalidFiles.push(resourceFile);
|
|
4219
3526
|
}
|
|
4220
3527
|
} catch (ex) {
|
|
3528
|
+
if (ex instanceof OperationCancelledException || cancellationToken?.aborted) {
|
|
3529
|
+
this.logger.warn("Operation cancelled while reading file %s for solution %s", resourceFile, context.path);
|
|
3530
|
+
throw ex instanceof OperationCancelledException ? ex : new OperationCancelledException;
|
|
3531
|
+
}
|
|
3532
|
+
if (ex instanceof TimeoutException)
|
|
3533
|
+
throw new TimeoutException(`Reading resource file ${resourceFile} for solution ${context.path} timed out: ${ex.message}`, ex.timeoutMs);
|
|
4221
3534
|
if (isFileNotFoundError(ex)) {
|
|
4222
3535
|
this.logger.warn("Resource file listed but missing in storage for solution %s: %s", resourceFile, context.path);
|
|
4223
3536
|
missingFiles.push(resourceFile);
|
|
@@ -4270,7 +3583,7 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
4270
3583
|
async writeAsync(context, solution, cancellationToken) {
|
|
4271
3584
|
if (context.isReadOnly)
|
|
4272
3585
|
return;
|
|
4273
|
-
const fileStorageProvider = await this.
|
|
3586
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
4274
3587
|
const existingHashes = this.getHashes(context);
|
|
4275
3588
|
const existingPaths = this.getPaths(context);
|
|
4276
3589
|
const existingTree = this.getTree(context);
|
|
@@ -4345,7 +3658,7 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
4345
3658
|
async deleteFilesAsync(context, filesToDelete, cancellationToken) {
|
|
4346
3659
|
if (!filesToDelete || filesToDelete.length === 0 || context.isReadOnly)
|
|
4347
3660
|
return;
|
|
4348
|
-
const fileStorageProvider = await this.
|
|
3661
|
+
const fileStorageProvider = await this.getFileStorageProviderAsync(context, cancellationToken);
|
|
4349
3662
|
for (const file of filesToDelete)
|
|
4350
3663
|
try {
|
|
4351
3664
|
const outputPath = this.joinPath("resourceFiles", file.name);
|
|
@@ -4542,7 +3855,8 @@ class MultiFileSolutionDefinitionProvider {
|
|
|
4542
3855
|
const hex = Math.abs(hash).toString(16).padStart(8, "0");
|
|
4543
3856
|
return `${hex.slice(0, 8)}-${hex.slice(0, 4)}-4${hex.slice(1, 4)}-8${hex.slice(1, 4)}-${hex.slice(0, 12).padEnd(12, "0")}`;
|
|
4544
3857
|
}
|
|
4545
|
-
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory) {
|
|
3858
|
+
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory, options) {
|
|
3859
|
+
this.options = options;
|
|
4546
3860
|
this._caseInsensitiveSerializer = null;
|
|
4547
3861
|
this._jsonSerializer = null;
|
|
4548
3862
|
this.fileStorageProviderFactory = fileStorageProviderFactory;
|
|
@@ -4555,12 +3869,13 @@ MultiFileSolutionDefinitionProvider.INVALID_FILE_NAME_CHARS = /[<>:"/\\|?*\x00-\
|
|
|
4555
3869
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/solution/multi-file-solution-definition-factory.js
|
|
4556
3870
|
class MultiFileSolutionDefinitionFactory {
|
|
4557
3871
|
async getProviderAsync(cancellationToken) {
|
|
4558
|
-
return new MultiFileSolutionDefinitionProvider(this.fileStorageProviderFactory, this.jsonSerializerFactory, this.loggerFactory);
|
|
3872
|
+
return new MultiFileSolutionDefinitionProvider(this.fileStorageProviderFactory, this.jsonSerializerFactory, this.loggerFactory, this.options);
|
|
4559
3873
|
}
|
|
4560
|
-
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory) {
|
|
3874
|
+
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory, options) {
|
|
4561
3875
|
this.fileStorageProviderFactory = fileStorageProviderFactory;
|
|
4562
3876
|
this.jsonSerializerFactory = jsonSerializerFactory;
|
|
4563
3877
|
this.loggerFactory = loggerFactory;
|
|
3878
|
+
this.options = options;
|
|
4564
3879
|
this.logger = loggerFactory.create("MultiFileSolutionDefinitionFactory");
|
|
4565
3880
|
}
|
|
4566
3881
|
}
|
|
@@ -4568,7 +3883,7 @@ class MultiFileSolutionDefinitionFactory {
|
|
|
4568
3883
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/embedded-files-default.js
|
|
4569
3884
|
async function createDefaultEmbeddedFileReaderAsync() {
|
|
4570
3885
|
const [{ EmbeddedFileReader }, { JsonSerializerFactory: JsonSerializerFactory2 }] = await Promise.all([
|
|
4571
|
-
import("./embedded-file-reader-
|
|
3886
|
+
import("./embedded-file-reader-v8c2yj2a.js"),
|
|
4572
3887
|
import("./index-kmp9fmhb.js")
|
|
4573
3888
|
]);
|
|
4574
3889
|
return new EmbeddedFileReader(new JsonSerializerFactory2);
|
|
@@ -4601,7 +3916,8 @@ var ServiceTokens = {
|
|
|
4601
3916
|
JsonSerializerFactory: "IJsonSerializerFactory",
|
|
4602
3917
|
SerializerProxy: "ISerializerProxy",
|
|
4603
3918
|
StreamSerializer: "IStreamSerializer",
|
|
4604
|
-
HttpReaderOptions: "HttpReaderOptions"
|
|
3919
|
+
HttpReaderOptions: "HttpReaderOptions",
|
|
3920
|
+
SolutionContextOptions: "SolutionContextOptions"
|
|
4605
3921
|
};
|
|
4606
3922
|
var Tokens = {
|
|
4607
3923
|
IMediator: "IMediator",
|
|
@@ -5167,7 +4483,8 @@ class BindingOverwritesHandler {
|
|
|
5167
4483
|
[BindingsKnownKeys.FolderKeyPropertyName]: resourceOverwrite.folderKey ?? ""
|
|
5168
4484
|
};
|
|
5169
4485
|
else {
|
|
5170
|
-
const
|
|
4486
|
+
const isBusinessRule = bindingResource.binding.resourceType === models_BindingsResourceType.BusinessRule;
|
|
4487
|
+
const folderPath = bindingResource.isArtefactResource && !isBusinessRule ? "" : resourceOverwrite.folderFullyQualifiedName ?? "";
|
|
5171
4488
|
overwrite = {
|
|
5172
4489
|
[BindingsKnownKeys.FolderPathPropertyName]: folderPath,
|
|
5173
4490
|
[BindingsKnownKeys.NamePropertyName]: resourceOverwrite.resourceName
|
|
@@ -5325,42 +4642,6 @@ class AsyncSemaphore {
|
|
|
5325
4642
|
this._permits = permits;
|
|
5326
4643
|
}
|
|
5327
4644
|
}
|
|
5328
|
-
function createTimeoutSignal(timeoutMs, linkedSignal) {
|
|
5329
|
-
const controller = new AbortController;
|
|
5330
|
-
const timeoutId = setTimeout(() => {
|
|
5331
|
-
controller.abort(new Error(`Operation timed out after ${timeoutMs}ms`));
|
|
5332
|
-
}, timeoutMs);
|
|
5333
|
-
if (linkedSignal)
|
|
5334
|
-
if (linkedSignal.aborted) {
|
|
5335
|
-
clearTimeout(timeoutId);
|
|
5336
|
-
controller.abort(linkedSignal.reason);
|
|
5337
|
-
} else
|
|
5338
|
-
linkedSignal.addEventListener("abort", () => {
|
|
5339
|
-
clearTimeout(timeoutId);
|
|
5340
|
-
controller.abort(linkedSignal.reason);
|
|
5341
|
-
}, {
|
|
5342
|
-
signal: controller.signal
|
|
5343
|
-
});
|
|
5344
|
-
controller.signal.addEventListener("abort", () => {
|
|
5345
|
-
clearTimeout(timeoutId);
|
|
5346
|
-
});
|
|
5347
|
-
return controller.signal;
|
|
5348
|
-
}
|
|
5349
|
-
var DEFAULT_TIMEOUT_MS = 5000;
|
|
5350
|
-
var SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY = "SOL_RB_SOLUTION_CONTEXT_TIMEOUT_MS";
|
|
5351
|
-
function getLockTimeoutMs() {
|
|
5352
|
-
try {
|
|
5353
|
-
if ("u" < typeof localStorage)
|
|
5354
|
-
return DEFAULT_TIMEOUT_MS;
|
|
5355
|
-
const raw = localStorage.getItem(SOLUTION_CONTEXT_TIMEOUT_STORAGE_KEY);
|
|
5356
|
-
if (raw === null || raw.trim() === "")
|
|
5357
|
-
return DEFAULT_TIMEOUT_MS;
|
|
5358
|
-
const parsed = Number(raw);
|
|
5359
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_TIMEOUT_MS;
|
|
5360
|
-
} catch {
|
|
5361
|
-
return DEFAULT_TIMEOUT_MS;
|
|
5362
|
-
}
|
|
5363
|
-
}
|
|
5364
4645
|
|
|
5365
4646
|
class SolutionContext {
|
|
5366
4647
|
get isLoaded() {
|
|
@@ -5488,30 +4769,42 @@ class SolutionContext {
|
|
|
5488
4769
|
throw new FileDependencyNotFoundException(missingFileDependencies);
|
|
5489
4770
|
}
|
|
5490
4771
|
async doWithLockAsync(doWork, cancellationToken) {
|
|
5491
|
-
const
|
|
5492
|
-
|
|
4772
|
+
const lockTimeoutMs = resolveLockTimeoutMs(this._options);
|
|
4773
|
+
const lockTimeout = createTimeoutSignal(lockTimeoutMs, `Waiting for the lock on solution ${this.path}`, cancellationToken);
|
|
5493
4774
|
try {
|
|
5494
|
-
|
|
4775
|
+
await this._semaphore.acquire(lockTimeout.signal);
|
|
4776
|
+
} catch (error) {
|
|
4777
|
+
if (!cancellationToken?.aborted && lockTimeout.signal.reason instanceof TimeoutException)
|
|
4778
|
+
throw lockTimeout.signal.reason;
|
|
4779
|
+
throw error;
|
|
4780
|
+
} finally {
|
|
4781
|
+
lockTimeout.dispose();
|
|
4782
|
+
}
|
|
4783
|
+
try {
|
|
4784
|
+
return await doWork(cancellationToken);
|
|
5495
4785
|
} finally {
|
|
5496
4786
|
this._semaphore.release();
|
|
5497
4787
|
}
|
|
5498
4788
|
}
|
|
5499
|
-
constructor(path, isReadOnlyOrProvider,
|
|
4789
|
+
constructor(path, isReadOnlyOrProvider, definitionProviderOrOptions, options) {
|
|
5500
4790
|
this._definition = null;
|
|
5501
4791
|
this._semaphore = new AsyncSemaphore(1);
|
|
5502
4792
|
this._items = {};
|
|
5503
4793
|
this._persistChanges = true;
|
|
5504
4794
|
ArgumentException.throwIfNullOrEmpty(path, "path");
|
|
5505
4795
|
if (typeof isReadOnlyOrProvider == "boolean") {
|
|
4796
|
+
const definitionProvider = definitionProviderOrOptions;
|
|
5506
4797
|
ArgumentException.throwIfNull(definitionProvider, "definitionProvider");
|
|
5507
4798
|
this.path = path;
|
|
5508
4799
|
this.isReadOnly = isReadOnlyOrProvider;
|
|
5509
4800
|
this._definitionProvider = definitionProvider;
|
|
4801
|
+
this._options = options;
|
|
5510
4802
|
} else {
|
|
5511
4803
|
ArgumentException.throwIfNull(isReadOnlyOrProvider, "definitionProvider");
|
|
5512
4804
|
this.path = path;
|
|
5513
4805
|
this.isReadOnly = false;
|
|
5514
4806
|
this._definitionProvider = isReadOnlyOrProvider;
|
|
4807
|
+
this._options = definitionProviderOrOptions;
|
|
5515
4808
|
}
|
|
5516
4809
|
}
|
|
5517
4810
|
}
|
|
@@ -5522,7 +4815,8 @@ class SolutionContextFactory {
|
|
|
5522
4815
|
ArgumentException.throwIfNullOrEmpty(path, "path");
|
|
5523
4816
|
const solutionDefinitionFactory = this._container.resolve(Tokens.ISolutionDefinitionFactory);
|
|
5524
4817
|
const solutionDefinitionProvider = await solutionDefinitionFactory.getProviderAsync(cancellationToken);
|
|
5525
|
-
|
|
4818
|
+
const options = this._container.isRegistered(ServiceTokens.SolutionContextOptions, true) ? this._container.resolve(ServiceTokens.SolutionContextOptions) : undefined;
|
|
4819
|
+
return new SolutionContext(path, isReadOnly, solutionDefinitionProvider, options);
|
|
5526
4820
|
}
|
|
5527
4821
|
constructor(_container) {
|
|
5528
4822
|
this._container = _container;
|
|
@@ -6544,7 +5838,13 @@ var solutionsSubtypesMap = {
|
|
|
6544
5838
|
Api: "api",
|
|
6545
5839
|
Function: "function",
|
|
6546
5840
|
McpServer: "mcpserver",
|
|
6547
|
-
BusinessRule: "businessRule"
|
|
5841
|
+
BusinessRule: "businessRule",
|
|
5842
|
+
Native: "native",
|
|
5843
|
+
Federated: "federated",
|
|
5844
|
+
Case: "case",
|
|
5845
|
+
CaseMain: "caseMain",
|
|
5846
|
+
CaseComment: "caseComment",
|
|
5847
|
+
CaseDocument: "caseDocument"
|
|
6548
5848
|
};
|
|
6549
5849
|
function mapResourceToSolutionSubtype(entitySubtype) {
|
|
6550
5850
|
if (!entitySubtype)
|
|
@@ -14975,9 +14275,9 @@ class UnconfiguredEmbeddedFileReader {
|
|
|
14975
14275
|
}
|
|
14976
14276
|
|
|
14977
14277
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/container.js
|
|
14978
|
-
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader) {
|
|
14278
|
+
function createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, embeddedFileReader, solutionContextOptions) {
|
|
14979
14279
|
const childContainer = import_tsyringe6.container.createChildContainer();
|
|
14980
|
-
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory);
|
|
14280
|
+
registerProviders(childContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions);
|
|
14981
14281
|
registerServices(childContainer, embeddedFileReader);
|
|
14982
14282
|
registerHandlers(childContainer);
|
|
14983
14283
|
childContainer.register(ServiceTokens.Mediator, {
|
|
@@ -15001,7 +14301,7 @@ function registerProvider(diContainer, token, provider) {
|
|
|
15001
14301
|
break;
|
|
15002
14302
|
}
|
|
15003
14303
|
}
|
|
15004
|
-
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory) {
|
|
14304
|
+
function registerProviders(diContainer, accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, httpReaderOptions, loggerFactory, solutionContextOptions) {
|
|
15005
14305
|
registerProvider(diContainer, ServiceTokens.AccessProvider, accessProvider);
|
|
15006
14306
|
registerProvider(diContainer, ServiceTokens.CacheProvider, cacheProvider);
|
|
15007
14307
|
registerProvider(diContainer, ServiceTokens.SecretsProvider, secretsProvider);
|
|
@@ -15016,6 +14316,7 @@ function registerProviders(diContainer, accessProvider, cacheProvider, secretsPr
|
|
|
15016
14316
|
...httpReaderOptions
|
|
15017
14317
|
};
|
|
15018
14318
|
diContainer.registerInstance(ServiceTokens.HttpReaderOptions, mergedOptions);
|
|
14319
|
+
diContainer.registerInstance(ServiceTokens.SolutionContextOptions, mergeSolutionContextOptions(solutionContextOptions));
|
|
15019
14320
|
}
|
|
15020
14321
|
function registerServices(diContainer, embeddedFileReader) {
|
|
15021
14322
|
diContainer.register(ServiceTokens.AutomationSolutionsClientProxy, {
|
|
@@ -15580,15 +14881,15 @@ class ResourceBuilderServices {
|
|
|
15580
14881
|
}
|
|
15581
14882
|
|
|
15582
14883
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/logging/logger.js
|
|
15583
|
-
var logger_LogLevel = /* @__PURE__ */ function(
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
return
|
|
14884
|
+
var logger_LogLevel = /* @__PURE__ */ function(LogLevel2) {
|
|
14885
|
+
LogLevel2[LogLevel2["Trace"] = 0] = "Trace";
|
|
14886
|
+
LogLevel2[LogLevel2["Debug"] = 1] = "Debug";
|
|
14887
|
+
LogLevel2[LogLevel2["Information"] = 2] = "Information";
|
|
14888
|
+
LogLevel2[LogLevel2["Warning"] = 3] = "Warning";
|
|
14889
|
+
LogLevel2[LogLevel2["Error"] = 4] = "Error";
|
|
14890
|
+
LogLevel2[LogLevel2["Critical"] = 5] = "Critical";
|
|
14891
|
+
LogLevel2[LogLevel2["None"] = 6] = "None";
|
|
14892
|
+
return LogLevel2;
|
|
15592
14893
|
}({});
|
|
15593
14894
|
function parseLogLevel(level) {
|
|
15594
14895
|
if (level === undefined)
|
|
@@ -15750,6 +15051,10 @@ class ResourceBuilderConfiguration {
|
|
|
15750
15051
|
this._httpReaderOptions = options;
|
|
15751
15052
|
return this;
|
|
15752
15053
|
}
|
|
15054
|
+
addSolutionContextOptions(options) {
|
|
15055
|
+
this._solutionContextOptions = options;
|
|
15056
|
+
return this;
|
|
15057
|
+
}
|
|
15753
15058
|
addLoggerFactory(factoryProvider, lifetime = service_tokens_ServiceLifetime.Singleton) {
|
|
15754
15059
|
this._loggerFactoryProvider = factoryProvider;
|
|
15755
15060
|
this._loggerFactoryLifetime = lifetime;
|
|
@@ -15814,7 +15119,7 @@ class ResourceBuilderConfiguration {
|
|
|
15814
15119
|
};
|
|
15815
15120
|
} else if (!solutionDefinitionProvider && fileStorageProviderFactory)
|
|
15816
15121
|
solutionDefinitionFactory = {
|
|
15817
|
-
instance: new MultiFileSolutionDefinitionFactory(fileStorageProviderFactory.instance, new JsonSerializerFactory, loggerFactoryInstance),
|
|
15122
|
+
instance: new MultiFileSolutionDefinitionFactory(fileStorageProviderFactory.instance, new JsonSerializerFactory, loggerFactoryInstance, this._solutionContextOptions),
|
|
15818
15123
|
lifetime: service_tokens_ServiceLifetime.Scoped
|
|
15819
15124
|
};
|
|
15820
15125
|
const artifactResourceSpecEnhancerInstance = this._artifactResourceSpecEnhancerProvider ? await this.resolveGenericProvider(this._artifactResourceSpecEnhancerProvider) : new DefaultArtifactResourceSpecEnhancer;
|
|
@@ -15823,7 +15128,7 @@ class ResourceBuilderConfiguration {
|
|
|
15823
15128
|
lifetime: this._artifactResourceSpecEnhancerLifetime
|
|
15824
15129
|
};
|
|
15825
15130
|
const embeddedFileReader = await createDefaultEmbeddedFileReaderAsync();
|
|
15826
|
-
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader);
|
|
15131
|
+
const container3 = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions);
|
|
15827
15132
|
return new ResourceBuilderServices(container3);
|
|
15828
15133
|
}
|
|
15829
15134
|
async buildServices() {
|
|
@@ -15844,7 +15149,6 @@ class ResourceBuilderConfiguration {
|
|
|
15844
15149
|
function createResourceBuilderConfiguration() {
|
|
15845
15150
|
return new ResourceBuilderConfiguration;
|
|
15846
15151
|
}
|
|
15847
|
-
|
|
15848
15152
|
// ../solution-sdk/src/resources/services/solution-manifest.ts
|
|
15849
15153
|
async function assertSolutionManifest(dir) {
|
|
15850
15154
|
const fs = getFileSystem();
|
|
@@ -16414,11 +15718,11 @@ async function restoreSolutionFile(filePath, rawContent) {
|
|
|
16414
15718
|
return writeError;
|
|
16415
15719
|
}
|
|
16416
15720
|
async function createProjectInSolutionBuilder(solutionDir, projectId, projectName, projectType, subType) {
|
|
16417
|
-
const [servicesError,
|
|
15721
|
+
const [servicesError, services] = await catchError(createResourceBuilderServices());
|
|
16418
15722
|
if (servicesError) {
|
|
16419
15723
|
return servicesError;
|
|
16420
15724
|
}
|
|
16421
|
-
const [builderError, solutionBuilder] = await catchError(
|
|
15725
|
+
const [builderError, solutionBuilder] = await catchError(services.getSolutionBuilder(solutionDir));
|
|
16422
15726
|
if (builderError) {
|
|
16423
15727
|
return builderError;
|
|
16424
15728
|
}
|
|
@@ -16513,6 +15817,81 @@ function hasAnyTemplateRow(projectType) {
|
|
|
16513
15817
|
return key === wanted || key.startsWith(`${wanted}_`);
|
|
16514
15818
|
});
|
|
16515
15819
|
}
|
|
15820
|
+
// ../solution-sdk/src/resources/services/remote-resources.ts
|
|
15821
|
+
function getRemoteResourceClients(services) {
|
|
15822
|
+
return {
|
|
15823
|
+
catalog: services.container.resolve(Tokens.IResourceCatalogClientProxy),
|
|
15824
|
+
importer: services.container.resolve(Tokens.IImportResourceHelper)
|
|
15825
|
+
};
|
|
15826
|
+
}
|
|
15827
|
+
async function findCatalogEntityAsync(catalog, query, match) {
|
|
15828
|
+
let pageCursor;
|
|
15829
|
+
do {
|
|
15830
|
+
const page = await catalog.searchFolderEntities({
|
|
15831
|
+
...query,
|
|
15832
|
+
pageSize: 100,
|
|
15833
|
+
pageCursor
|
|
15834
|
+
});
|
|
15835
|
+
const found = (page.items ?? []).find(match);
|
|
15836
|
+
if (found) {
|
|
15837
|
+
return found;
|
|
15838
|
+
}
|
|
15839
|
+
pageCursor = page.nextPage ?? undefined;
|
|
15840
|
+
} while (pageCursor);
|
|
15841
|
+
return;
|
|
15842
|
+
}
|
|
15843
|
+
function toResourceReference(entity) {
|
|
15844
|
+
return toCatalogReference({
|
|
15845
|
+
kind: entity.entityType ?? "",
|
|
15846
|
+
type: entity.entitySubType ?? undefined,
|
|
15847
|
+
key: entity.entityKey ?? "",
|
|
15848
|
+
name: entity.entityName ?? undefined,
|
|
15849
|
+
folderPath: entity.fullyQualifiedName ?? undefined,
|
|
15850
|
+
folderKey: entity.folderKey ?? undefined
|
|
15851
|
+
});
|
|
15852
|
+
}
|
|
15853
|
+
function toCatalogReference(reference) {
|
|
15854
|
+
const { folderPath, folderKey, ...rest } = reference;
|
|
15855
|
+
return {
|
|
15856
|
+
...rest,
|
|
15857
|
+
folder: folderPath ? { fullyQualifiedName: folderPath, folderKey } : undefined
|
|
15858
|
+
};
|
|
15859
|
+
}
|
|
15860
|
+
async function exportResourceDefinitionAsync(importer, reference) {
|
|
15861
|
+
const payload = await importer.exportResourceAsync(reference);
|
|
15862
|
+
return payload.resourceDefinitions.find((d) => d.key === reference.key);
|
|
15863
|
+
}
|
|
15864
|
+
function readSpecProperty(spec, name) {
|
|
15865
|
+
if (!spec) {
|
|
15866
|
+
return;
|
|
15867
|
+
}
|
|
15868
|
+
if (spec[name] !== undefined) {
|
|
15869
|
+
return spec[name];
|
|
15870
|
+
}
|
|
15871
|
+
const lower = name.toLowerCase();
|
|
15872
|
+
const key = Object.keys(spec).find((k) => k.toLowerCase() === lower);
|
|
15873
|
+
return key === undefined ? undefined : spec[key];
|
|
15874
|
+
}
|
|
15875
|
+
function readSpecEntryPoints(spec) {
|
|
15876
|
+
const entryPoints = parseJsonString(readSpecProperty(spec, "entryPoints"));
|
|
15877
|
+
if (!Array.isArray(entryPoints) || !entryPoints.every((entry) => entry !== null && typeof entry === "object")) {
|
|
15878
|
+
return;
|
|
15879
|
+
}
|
|
15880
|
+
return entryPoints.map((entry) => ({
|
|
15881
|
+
UniqueId: String(readSpecProperty(entry, "uniqueId") ?? ""),
|
|
15882
|
+
Path: String(readSpecProperty(entry, "path") ?? ""),
|
|
15883
|
+
DisplayName: String(readSpecProperty(entry, "displayName") ?? ""),
|
|
15884
|
+
InputArguments: readSpecProperty(entry, "inputArguments"),
|
|
15885
|
+
OutputArguments: readSpecProperty(entry, "outputArguments")
|
|
15886
|
+
}));
|
|
15887
|
+
}
|
|
15888
|
+
function parseJsonString(raw) {
|
|
15889
|
+
if (typeof raw !== "string") {
|
|
15890
|
+
return raw;
|
|
15891
|
+
}
|
|
15892
|
+
const [error, parsed] = catchError(() => JSON.parse(raw));
|
|
15893
|
+
return error ? undefined : parsed;
|
|
15894
|
+
}
|
|
16516
15895
|
// ../solution-sdk/src/resources/services/resource-casing.ts
|
|
16517
15896
|
var RESOURCE_FILES_FOLDER_NAME = "resources";
|
|
16518
15897
|
function lowerFirstChar(value) {
|
|
@@ -16670,6 +16049,47 @@ function parseResourceHeader(content) {
|
|
|
16670
16049
|
return null;
|
|
16671
16050
|
}
|
|
16672
16051
|
}
|
|
16052
|
+
// ../solution-sdk/src/resources/services/resource-name.ts
|
|
16053
|
+
var MAX_RESOURCE_NAME_LENGTH = 256;
|
|
16054
|
+
var UNSAFE_NAME_CHARS = /[\\/:*?"<>|]/;
|
|
16055
|
+
function hasControlChar(value) {
|
|
16056
|
+
for (let i = 0;i < value.length; i++) {
|
|
16057
|
+
if (value.charCodeAt(i) < 32)
|
|
16058
|
+
return true;
|
|
16059
|
+
}
|
|
16060
|
+
return false;
|
|
16061
|
+
}
|
|
16062
|
+
function validateResourceName(name, options = {}) {
|
|
16063
|
+
const optionName = options.optionName ?? "--name";
|
|
16064
|
+
if (name.trim() === "") {
|
|
16065
|
+
return {
|
|
16066
|
+
ok: false,
|
|
16067
|
+
message: `${optionName} must not be blank`,
|
|
16068
|
+
instructions: "Pass a non-empty resource name."
|
|
16069
|
+
};
|
|
16070
|
+
}
|
|
16071
|
+
if (name.length > MAX_RESOURCE_NAME_LENGTH) {
|
|
16072
|
+
return {
|
|
16073
|
+
ok: false,
|
|
16074
|
+
message: `${optionName} exceeds the ${MAX_RESOURCE_NAME_LENGTH}-character limit (got ${name.length})`,
|
|
16075
|
+
instructions: "Shorten the resource name. Orchestrator name limits are kind-specific (queues cap at 50, assets at 256)."
|
|
16076
|
+
};
|
|
16077
|
+
}
|
|
16078
|
+
if (UNSAFE_NAME_CHARS.test(name) || hasControlChar(name)) {
|
|
16079
|
+
return {
|
|
16080
|
+
ok: false,
|
|
16081
|
+
message: `${optionName} contains unsafe characters`,
|
|
16082
|
+
instructions: 'Resource names cannot contain path separators (/, \\), control characters, or any of: : * ? " < > |'
|
|
16083
|
+
};
|
|
16084
|
+
}
|
|
16085
|
+
return { ok: true };
|
|
16086
|
+
}
|
|
16087
|
+
function assertValidResourceName(name, options = {}) {
|
|
16088
|
+
const result = validateResourceName(name, options);
|
|
16089
|
+
if (!result.ok) {
|
|
16090
|
+
throw new Error(`${result.message}. ${result.instructions}`);
|
|
16091
|
+
}
|
|
16092
|
+
}
|
|
16673
16093
|
// ../solution-sdk/src/solution-auth.ts
|
|
16674
16094
|
async function getSolutionAuthContext(options) {
|
|
16675
16095
|
const ctx = await getAuthContext({
|
|
@@ -16686,11 +16106,15 @@ async function getSolutionAuthContext(options) {
|
|
|
16686
16106
|
accessToken: ctx.accessToken,
|
|
16687
16107
|
basePath,
|
|
16688
16108
|
organizationId,
|
|
16689
|
-
tenantName
|
|
16109
|
+
tenantName,
|
|
16110
|
+
identity: ctx.identity
|
|
16690
16111
|
};
|
|
16691
16112
|
}
|
|
16692
|
-
|
|
16693
16113
|
// ../solution-sdk/src/resources/services/sync-resources-from-bindings.ts
|
|
16114
|
+
var TYPE_IS_IDENTITY_REPLACE_OPTIONS = new Set([
|
|
16115
|
+
"SameType",
|
|
16116
|
+
"SameNameAndType"
|
|
16117
|
+
]);
|
|
16694
16118
|
var BINDINGS_JSON_FALLBACK_TYPES = new Set(["agent", "function"]);
|
|
16695
16119
|
function placeholderForType(type) {
|
|
16696
16120
|
switch ((type ?? "string").toLowerCase()) {
|
|
@@ -16720,7 +16144,7 @@ async function buildKindResolver(metadataReader) {
|
|
|
16720
16144
|
byKind.set(key, list);
|
|
16721
16145
|
}
|
|
16722
16146
|
return async (kind, type) => {
|
|
16723
|
-
const cacheKey = `${kind}|${type
|
|
16147
|
+
const cacheKey = (type === undefined ? kind : `${kind}|${type}`).toLowerCase();
|
|
16724
16148
|
if (cache.has(cacheKey))
|
|
16725
16149
|
return cache.get(cacheKey);
|
|
16726
16150
|
const list = byKind.get(kind.toLowerCase());
|
|
@@ -16728,7 +16152,9 @@ async function buildKindResolver(metadataReader) {
|
|
|
16728
16152
|
cache.set(cacheKey, undefined);
|
|
16729
16153
|
return;
|
|
16730
16154
|
}
|
|
16731
|
-
const
|
|
16155
|
+
const subtypes = list.flatMap((r) => r.type ? [r.type] : []);
|
|
16156
|
+
const matched = type === undefined ? undefined : findSubtypeEntry(list, type);
|
|
16157
|
+
const entry = matched ?? list[0];
|
|
16732
16158
|
const version = entry.versions?.[0];
|
|
16733
16159
|
const requiredDefaults = [];
|
|
16734
16160
|
for (const prop of version?.spec ?? []) {
|
|
@@ -16747,16 +16173,35 @@ async function buildKindResolver(metadataReader) {
|
|
|
16747
16173
|
}
|
|
16748
16174
|
}
|
|
16749
16175
|
}
|
|
16176
|
+
const takesFreeFormType = type !== undefined && type.trim() !== "" && subtypes.length === 0 && TYPE_IS_IDENTITY_REPLACE_OPTIONS.has(String(version?.replaceOption));
|
|
16750
16177
|
const resolved = {
|
|
16751
16178
|
type: entry.type,
|
|
16752
16179
|
virtualizable: version?.supportsInLineCreation ?? false,
|
|
16753
16180
|
requiredDefaults,
|
|
16754
|
-
specProperties
|
|
16181
|
+
specProperties,
|
|
16182
|
+
subtypes,
|
|
16183
|
+
typeMatched: type === undefined || matched !== undefined || takesFreeFormType
|
|
16755
16184
|
};
|
|
16756
16185
|
cache.set(cacheKey, resolved);
|
|
16757
16186
|
return resolved;
|
|
16758
16187
|
};
|
|
16759
16188
|
}
|
|
16189
|
+
function formatResourceSubtypes(subtypes) {
|
|
16190
|
+
return subtypes.map((subtype) => {
|
|
16191
|
+
const alias = mapSolutionToResourceSubtype(subtype);
|
|
16192
|
+
return alias && alias.toLowerCase() !== subtype.toLowerCase() ? `${subtype} (${alias})` : subtype;
|
|
16193
|
+
}).join(", ");
|
|
16194
|
+
}
|
|
16195
|
+
function sameResourceSubtype(a, b) {
|
|
16196
|
+
if (a === undefined || b === undefined)
|
|
16197
|
+
return false;
|
|
16198
|
+
if (a.toLowerCase() === b.toLowerCase())
|
|
16199
|
+
return true;
|
|
16200
|
+
return mapSolutionToResourceSubtype(a)?.toLowerCase() === mapSolutionToResourceSubtype(b)?.toLowerCase();
|
|
16201
|
+
}
|
|
16202
|
+
function findSubtypeEntry(list, type) {
|
|
16203
|
+
return list.find((r) => !!r.type && sameResourceSubtype(r.type, type));
|
|
16204
|
+
}
|
|
16760
16205
|
function resolveBindingResourceIdentity(binding) {
|
|
16761
16206
|
switch (binding.resourceType) {
|
|
16762
16207
|
case models_BindingsResourceType.TimeTrigger:
|
|
@@ -16785,12 +16230,12 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
16785
16230
|
return result;
|
|
16786
16231
|
}
|
|
16787
16232
|
const bindingsJsonFallbackDirs = new Set(uipxProjects.filter((p) => BINDINGS_JSON_FALLBACK_TYPES.has(p.type.toLowerCase())).map((p) => p.path));
|
|
16788
|
-
const [servicesError,
|
|
16233
|
+
const [servicesError, services] = await catchError(createResourceBuilderServices());
|
|
16789
16234
|
if (servicesError) {
|
|
16790
16235
|
logger.warn(`Failed to create resource builder services: ${servicesError.message}`);
|
|
16791
16236
|
return result;
|
|
16792
16237
|
}
|
|
16793
|
-
const serializer =
|
|
16238
|
+
const serializer = services.container.resolve(Tokens.IBindingsMetadataSerializer);
|
|
16794
16239
|
const { bindings: allBindings, parseErrors } = await collectBindings(solutionDir, paths, bindingsJsonFallbackDirs, serializer);
|
|
16795
16240
|
if (parseErrors.length > 0) {
|
|
16796
16241
|
const detail = parseErrors.map((e) => `${e.path}: ${e.reason}`).join("; ");
|
|
@@ -16800,7 +16245,7 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
16800
16245
|
return result;
|
|
16801
16246
|
}
|
|
16802
16247
|
await normalizeResourceFileCasing(solutionDir);
|
|
16803
|
-
const [builderError, builder] = await catchError(
|
|
16248
|
+
const [builderError, builder] = await catchError(services.getSolutionBuilder(solutionDir));
|
|
16804
16249
|
if (builderError) {
|
|
16805
16250
|
logger.warn(`Failed to get solution builder: ${builderError.message}`);
|
|
16806
16251
|
return result;
|
|
@@ -16816,7 +16261,7 @@ async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTy
|
|
|
16816
16261
|
return result;
|
|
16817
16262
|
}
|
|
16818
16263
|
logger.info(`Found ${allBindings.length} bindings to sync`);
|
|
16819
|
-
const metadataReader =
|
|
16264
|
+
const metadataReader = services.container.resolve(Tokens.IMetadataReader);
|
|
16820
16265
|
const resolveKindMetadata = await buildKindResolver(metadataReader);
|
|
16821
16266
|
const solution = await builder.context.loadAsync();
|
|
16822
16267
|
const knownResourceKeys = new Set((solution.resources ?? []).map((r) => r.key?.toLowerCase()).filter((k) => !!k));
|
|
@@ -17069,14 +16514,18 @@ async function findResourceByKeyInRcs(builder, kind, expectedKey, folderPath, pr
|
|
|
17069
16514
|
return;
|
|
17070
16515
|
}
|
|
17071
16516
|
async function searchRcsResources(builder, kind, name) {
|
|
16517
|
+
const [searchError, matches] = await catchError(searchRcsResourcesStrict(builder, kind, name));
|
|
16518
|
+
if (searchError) {
|
|
16519
|
+
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
16520
|
+
return [];
|
|
16521
|
+
}
|
|
16522
|
+
return matches;
|
|
16523
|
+
}
|
|
16524
|
+
async function searchRcsResourcesStrict(builder, kind, name) {
|
|
17072
16525
|
let pageCursor;
|
|
17073
16526
|
const allMatches = [];
|
|
17074
16527
|
do {
|
|
17075
|
-
const
|
|
17076
|
-
if (searchError) {
|
|
17077
|
-
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
17078
|
-
return [];
|
|
17079
|
-
}
|
|
16528
|
+
const result = await builder.searchResourcesAsync(kind, undefined, name, pageCursor, 50, undefined, false);
|
|
17080
16529
|
for (const folderResources of result.availableResources) {
|
|
17081
16530
|
const matches = folderResources.resources.filter((r) => r.name.toLowerCase() === name.toLowerCase());
|
|
17082
16531
|
for (const match of matches) {
|
|
@@ -17120,17 +16569,23 @@ async function findResourceInRcs(builder, kind, name, folderPath) {
|
|
|
17120
16569
|
logger.warn(`Found ${allMatches.length} ${kind} resources named "${name}" across folders and binding has no folder hint. Marking unresolved.`);
|
|
17121
16570
|
return;
|
|
17122
16571
|
}
|
|
17123
|
-
async function createResourceKindMetadataResolver(
|
|
17124
|
-
const metadataReader =
|
|
16572
|
+
async function createResourceKindMetadataResolver(services) {
|
|
16573
|
+
const metadataReader = services.container.resolve(Tokens.IMetadataReader);
|
|
17125
16574
|
return buildKindResolver(metadataReader);
|
|
17126
16575
|
}
|
|
17127
|
-
async function resolveResourceKindMetadata(
|
|
17128
|
-
const resolver = await createResourceKindMetadataResolver(
|
|
16576
|
+
async function resolveResourceKindMetadata(services, kind, type) {
|
|
16577
|
+
const resolver = await createResourceKindMetadataResolver(services);
|
|
17129
16578
|
return resolver(kind, type);
|
|
17130
16579
|
}
|
|
17131
16580
|
async function createLocalResource(params) {
|
|
17132
|
-
const { builder, services
|
|
17133
|
-
|
|
16581
|
+
const { builder, services, kind, type, name } = params;
|
|
16582
|
+
if (type !== undefined && type.trim() === "") {
|
|
16583
|
+
throw new Error(`Type for kind ${kind} is empty.`);
|
|
16584
|
+
}
|
|
16585
|
+
const metadata = await resolveResourceKindMetadata(services, kind, type);
|
|
16586
|
+
if (type !== undefined && metadata && !metadata.typeMatched) {
|
|
16587
|
+
throw new Error(metadata.subtypes.length > 0 ? `Unknown type "${type}" for kind ${kind}. Use one of: ${formatResourceSubtypes(metadata.subtypes)}` : `Kind ${kind} has no subtypes, so type "${type}" does not apply.`);
|
|
16588
|
+
}
|
|
17134
16589
|
const minted = await mintVirtualResource(builder, kind, metadata?.type ?? type, name, metadata);
|
|
17135
16590
|
if (!minted?.resource)
|
|
17136
16591
|
return;
|
|
@@ -17407,7 +16862,7 @@ async function resourceRemoteSyncAsync(solutionPath = ".", resourceKey, options
|
|
|
17407
16862
|
message: await extractErrorMessage(authError)
|
|
17408
16863
|
};
|
|
17409
16864
|
}
|
|
17410
|
-
const [servicesError,
|
|
16865
|
+
const [servicesError, services] = await catchError(createResourceBuilderServices());
|
|
17411
16866
|
if (servicesError) {
|
|
17412
16867
|
return {
|
|
17413
16868
|
ok: false,
|
|
@@ -17416,7 +16871,7 @@ async function resourceRemoteSyncAsync(solutionPath = ".", resourceKey, options
|
|
|
17416
16871
|
};
|
|
17417
16872
|
}
|
|
17418
16873
|
await normalizeResourceFileCasing(resolvedPath);
|
|
17419
|
-
const [builderError, builder] = await catchError(
|
|
16874
|
+
const [builderError, builder] = await catchError(services.getSolutionBuilder(resolvedPath, !options.force));
|
|
17420
16875
|
if (builderError) {
|
|
17421
16876
|
return {
|
|
17422
16877
|
ok: false,
|
|
@@ -17555,21 +17010,27 @@ function sortKeysDeep(value) {
|
|
|
17555
17010
|
}
|
|
17556
17011
|
export {
|
|
17557
17012
|
EntryPointSpecEnhancer,
|
|
17013
|
+
MAX_RESOURCE_NAME_LENGTH,
|
|
17558
17014
|
ProjectManifestError,
|
|
17559
17015
|
addProjectArtifactsToSolutionAsync,
|
|
17560
17016
|
applyEntryPointEnhancementAsync,
|
|
17561
17017
|
assertSolutionManifest,
|
|
17018
|
+
assertValidResourceName,
|
|
17562
17019
|
computeEntryPointSpec,
|
|
17563
17020
|
createLocalResource,
|
|
17564
17021
|
createProjectInSolutionBuilder,
|
|
17565
17022
|
createResourceBuilderServices,
|
|
17566
17023
|
createResourceKindMetadataResolver,
|
|
17024
|
+
exportResourceDefinitionAsync,
|
|
17025
|
+
findCatalogEntityAsync,
|
|
17567
17026
|
findMatchingLocalResource,
|
|
17568
17027
|
findMatchingMemberResource,
|
|
17569
17028
|
findMemberCloneResources,
|
|
17570
17029
|
findProjectFile,
|
|
17571
17030
|
findResourceByKeyInRcs,
|
|
17572
17031
|
findResourceInRcs,
|
|
17032
|
+
formatResourceSubtypes,
|
|
17033
|
+
getRemoteResourceClients,
|
|
17573
17034
|
hasAnyTemplateRow,
|
|
17574
17035
|
hasBareTemplateRow,
|
|
17575
17036
|
isMissingProjectTypeError,
|
|
@@ -17580,6 +17041,8 @@ export {
|
|
|
17580
17041
|
readProjectFile,
|
|
17581
17042
|
readSolutionFile,
|
|
17582
17043
|
readSolutionManifest,
|
|
17044
|
+
readSpecEntryPoints,
|
|
17045
|
+
readSpecProperty,
|
|
17583
17046
|
readUipxProjects,
|
|
17584
17047
|
resolveProjectDirFromManifest,
|
|
17585
17048
|
resolveResourceKindMetadata,
|
|
@@ -17587,12 +17050,17 @@ export {
|
|
|
17587
17050
|
resourceRefreshAsync,
|
|
17588
17051
|
resourceRemoteSyncAsync,
|
|
17589
17052
|
restoreSolutionFile,
|
|
17053
|
+
sameResourceSubtype,
|
|
17590
17054
|
saveCasingNormalized,
|
|
17591
17055
|
searchRcsResources,
|
|
17056
|
+
searchRcsResourcesStrict,
|
|
17592
17057
|
syncAndLog,
|
|
17593
17058
|
syncResourcesFromBindings,
|
|
17059
|
+
toCatalogReference,
|
|
17060
|
+
toResourceReference,
|
|
17594
17061
|
uniqueNameForResource,
|
|
17062
|
+
validateResourceName,
|
|
17595
17063
|
writeSolutionFile
|
|
17596
17064
|
};
|
|
17597
17065
|
|
|
17598
|
-
//# debugId=
|
|
17066
|
+
//# debugId=A6C87F3B69C2499E64756E2164756E21
|