@uipath/codedapp-tool 1.205.0-preview.284 → 1.206.0-preview.282
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/README.md +48 -0
- package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-z97p0ezf.js} +5 -6
- package/dist/{embedded-file-reader-r66242ey.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/{index-0k30knwv.js → index-0py5k2e9.js} +177 -2055
- package/dist/index-c3zcyvwz.js +20 -0
- package/dist/index-cw1j9s6d.js +3176 -0
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index.js +14 -17
- package/dist/{jmespath-e4a59c8w.js → jmespath-wwym30dp.js} +1 -1
- package/dist/{js-yaml-87cdx6bm.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{node-strategy-myagr1zp.js → node-strategy-fk02jqd8.js} +9 -12
- package/dist/{packager-tool-5ebgtev7.js → packager-tool-06tdd0p9.js} +3168 -3092
- package/dist/{packager-tool-je2re4j6.js → packager-tool-0ajs8pnk.js} +53 -8
- package/dist/{packager-tool-vc19fcdp.js → packager-tool-19x86hb2.js} +3 -21
- package/dist/{packager-tool-0gctz400.js → packager-tool-2rwzcase.js} +2 -5
- package/dist/{packager-tool-s8h46737.js → packager-tool-3ss96mpk.js} +82 -709
- package/dist/{packager-tool-d94wjncg.js → packager-tool-5t7c439j.js} +97 -97
- package/dist/{packager-tool-1yh8g550.js → packager-tool-6an893wm.js} +12 -3
- package/dist/packager-tool-8pm90w77.js +6640 -0
- package/dist/{packager-tool-cmfktvbt.js → packager-tool-h9q8znad.js} +885 -439
- package/dist/{packager-tool-ahrmbx21.js → packager-tool-hzve3h1v.js} +1676 -1451
- package/dist/{packager-tool-gdtpsdn7.js → packager-tool-mm1x18d6.js} +223 -28
- package/dist/{packager-tool-qa9gftnj.js → packager-tool-xd2w5pct.js} +3 -3
- package/dist/packager-tool.js +7 -8
- package/dist/tool.js +13 -16
- package/package.json +2 -2
- package/dist/first-party-service-srxaftkn.js +0 -27
- package/dist/index-78bnpdqb.js +0 -3177
- package/dist/index-kmp9fmhb.js +0 -25
- package/dist/index-wbp18pm0.js +0 -157
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-m7tmga2c.js +0 -20538
- /package/dist/{packager-tool-yc4kw997.js → packager-tool-1qg04b7q.js} +0 -0
|
@@ -1,43 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./packager-tool-5ebgtev7.js";
|
|
5
|
-
import {
|
|
6
|
-
JsonSerializerFactory,
|
|
7
|
-
JsonSerializerNames,
|
|
8
|
-
JsonSerializerProxy,
|
|
9
|
-
StreamSerializer
|
|
10
|
-
} from "./packager-tool-gdtpsdn7.js";
|
|
2
|
+
getFileSystem
|
|
3
|
+
} from "./packager-tool-0ajs8pnk.js";
|
|
11
4
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
catchError,
|
|
6
|
+
logger,
|
|
7
|
+
isGuid
|
|
8
|
+
} from "./packager-tool-h9q8znad.js";
|
|
9
|
+
import"./packager-tool-5t7c439j.js";
|
|
14
10
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
JsonSerializerNames2,
|
|
12
|
+
JsonSerializerFactory2,
|
|
13
|
+
JsonSerializerProxy2,
|
|
14
|
+
StreamSerializer2,
|
|
15
|
+
FirstPartyServiceApi2
|
|
16
|
+
} from "./packager-tool-mm1x18d6.js";
|
|
17
|
+
import"./packager-tool-1qg04b7q.js";
|
|
19
18
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from "./packager-tool-s8h46737.js";
|
|
23
|
-
import"./packager-tool-d94wjncg.js";
|
|
19
|
+
getLoginStatusAsync2
|
|
20
|
+
} from "./packager-tool-3ss96mpk.js";
|
|
24
21
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
logger
|
|
29
|
-
} from "./packager-tool-cmfktvbt.js";
|
|
30
|
-
import"./packager-tool-0gctz400.js";
|
|
31
|
-
import"./packager-tool-qa9gftnj.js";
|
|
22
|
+
UsersApi2,
|
|
23
|
+
createApiClient2
|
|
24
|
+
} from "./packager-tool-06tdd0p9.js";
|
|
32
25
|
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
normalizeProjectType,
|
|
27
|
+
toPortableRelativePath
|
|
28
|
+
} from "./packager-tool-19x86hb2.js";
|
|
36
29
|
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} from "./packager-tool-1yh8g550.js";
|
|
30
|
+
__toESM,
|
|
31
|
+
__commonJS
|
|
32
|
+
} from "./packager-tool-6an893wm.js";
|
|
41
33
|
|
|
42
34
|
// ../../node_modules/reflect-metadata/Reflect.js
|
|
43
35
|
var require_Reflect = __commonJS(function() {
|
|
@@ -56,16 +48,16 @@ var require_Reflect = __commonJS(function() {
|
|
|
56
48
|
and limitations under the License.
|
|
57
49
|
***************************************************************************** */
|
|
58
50
|
var Reflect2;
|
|
59
|
-
(function(
|
|
51
|
+
(function(Reflect2) {
|
|
60
52
|
(function(factory) {
|
|
61
53
|
var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
|
|
62
|
-
var exporter = makeExporter(
|
|
54
|
+
var exporter = makeExporter(Reflect2);
|
|
63
55
|
if (typeof root.Reflect !== "undefined") {
|
|
64
56
|
exporter = makeExporter(root.Reflect, exporter);
|
|
65
57
|
}
|
|
66
58
|
factory(exporter, root);
|
|
67
59
|
if (typeof root.Reflect === "undefined") {
|
|
68
|
-
root.Reflect =
|
|
60
|
+
root.Reflect = Reflect2;
|
|
69
61
|
}
|
|
70
62
|
function makeExporter(target, previous) {
|
|
71
63
|
return function(key, value) {
|
|
@@ -249,8 +241,8 @@ var require_Reflect = __commonJS(function() {
|
|
|
249
241
|
return descriptor;
|
|
250
242
|
}
|
|
251
243
|
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
252
|
-
var
|
|
253
|
-
if (
|
|
244
|
+
var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
245
|
+
if (hasOwn)
|
|
254
246
|
return true;
|
|
255
247
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
256
248
|
if (!IsNull(parent))
|
|
@@ -264,8 +256,8 @@ var require_Reflect = __commonJS(function() {
|
|
|
264
256
|
return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
|
|
265
257
|
}
|
|
266
258
|
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
267
|
-
var
|
|
268
|
-
if (
|
|
259
|
+
var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
260
|
+
if (hasOwn)
|
|
269
261
|
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
270
262
|
var parent = OrdinaryGetPrototypeOf(O);
|
|
271
263
|
if (!IsNull(parent))
|
|
@@ -597,48 +589,48 @@ var require_Reflect = __commonJS(function() {
|
|
|
597
589
|
}
|
|
598
590
|
}
|
|
599
591
|
function GetOrCreateMetadataRegistry() {
|
|
600
|
-
var
|
|
592
|
+
var metadataRegistry;
|
|
601
593
|
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
602
|
-
|
|
594
|
+
metadataRegistry = root.Reflect[registrySymbol];
|
|
603
595
|
}
|
|
604
|
-
if (IsUndefined(
|
|
605
|
-
|
|
596
|
+
if (IsUndefined(metadataRegistry)) {
|
|
597
|
+
metadataRegistry = CreateMetadataRegistry();
|
|
606
598
|
}
|
|
607
599
|
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
608
600
|
Object.defineProperty(root.Reflect, registrySymbol, {
|
|
609
601
|
enumerable: false,
|
|
610
602
|
configurable: false,
|
|
611
603
|
writable: false,
|
|
612
|
-
value:
|
|
604
|
+
value: metadataRegistry
|
|
613
605
|
});
|
|
614
606
|
}
|
|
615
|
-
return
|
|
607
|
+
return metadataRegistry;
|
|
616
608
|
}
|
|
617
609
|
function CreateMetadataProvider(registry) {
|
|
618
|
-
var
|
|
610
|
+
var metadata = new _WeakMap;
|
|
619
611
|
var provider = {
|
|
620
612
|
isProviderFor: function(O, P) {
|
|
621
|
-
var targetMetadata =
|
|
613
|
+
var targetMetadata = metadata.get(O);
|
|
622
614
|
if (IsUndefined(targetMetadata))
|
|
623
615
|
return false;
|
|
624
616
|
return targetMetadata.has(P);
|
|
625
617
|
},
|
|
626
|
-
OrdinaryDefineOwnMetadata
|
|
627
|
-
OrdinaryHasOwnMetadata
|
|
628
|
-
OrdinaryGetOwnMetadata
|
|
629
|
-
OrdinaryOwnMetadataKeys
|
|
618
|
+
OrdinaryDefineOwnMetadata,
|
|
619
|
+
OrdinaryHasOwnMetadata,
|
|
620
|
+
OrdinaryGetOwnMetadata,
|
|
621
|
+
OrdinaryOwnMetadataKeys,
|
|
630
622
|
OrdinaryDeleteMetadata
|
|
631
623
|
};
|
|
632
624
|
metadataRegistry.registerProvider(provider);
|
|
633
625
|
return provider;
|
|
634
626
|
function GetOrCreateMetadataMap(O, P, Create) {
|
|
635
|
-
var targetMetadata =
|
|
627
|
+
var targetMetadata = metadata.get(O);
|
|
636
628
|
var createdTargetMetadata = false;
|
|
637
629
|
if (IsUndefined(targetMetadata)) {
|
|
638
630
|
if (!Create)
|
|
639
631
|
return;
|
|
640
632
|
targetMetadata = new _Map;
|
|
641
|
-
|
|
633
|
+
metadata.set(O, targetMetadata);
|
|
642
634
|
createdTargetMetadata = true;
|
|
643
635
|
}
|
|
644
636
|
var metadataMap = targetMetadata.get(P);
|
|
@@ -650,30 +642,30 @@ var require_Reflect = __commonJS(function() {
|
|
|
650
642
|
if (!registry.setProvider(O, P, provider)) {
|
|
651
643
|
targetMetadata.delete(P);
|
|
652
644
|
if (createdTargetMetadata) {
|
|
653
|
-
|
|
645
|
+
metadata.delete(O);
|
|
654
646
|
}
|
|
655
647
|
throw new Error("Wrong provider for target.");
|
|
656
648
|
}
|
|
657
649
|
}
|
|
658
650
|
return metadataMap;
|
|
659
651
|
}
|
|
660
|
-
function
|
|
652
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
661
653
|
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
662
654
|
if (IsUndefined(metadataMap))
|
|
663
655
|
return false;
|
|
664
656
|
return ToBoolean(metadataMap.has(MetadataKey));
|
|
665
657
|
}
|
|
666
|
-
function
|
|
658
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
667
659
|
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
668
660
|
if (IsUndefined(metadataMap))
|
|
669
661
|
return;
|
|
670
662
|
return metadataMap.get(MetadataKey);
|
|
671
663
|
}
|
|
672
|
-
function
|
|
664
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
673
665
|
var metadataMap = GetOrCreateMetadataMap(O, P, true);
|
|
674
666
|
metadataMap.set(MetadataKey, MetadataValue);
|
|
675
667
|
}
|
|
676
|
-
function
|
|
668
|
+
function OrdinaryOwnMetadataKeys(O, P) {
|
|
677
669
|
var keys = [];
|
|
678
670
|
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
679
671
|
if (IsUndefined(metadataMap))
|
|
@@ -707,11 +699,11 @@ var require_Reflect = __commonJS(function() {
|
|
|
707
699
|
if (!metadataMap.delete(MetadataKey))
|
|
708
700
|
return false;
|
|
709
701
|
if (metadataMap.size === 0) {
|
|
710
|
-
var targetMetadata =
|
|
702
|
+
var targetMetadata = metadata.get(O);
|
|
711
703
|
if (!IsUndefined(targetMetadata)) {
|
|
712
704
|
targetMetadata.delete(P);
|
|
713
705
|
if (targetMetadata.size === 0) {
|
|
714
|
-
|
|
706
|
+
metadata.delete(targetMetadata);
|
|
715
707
|
}
|
|
716
708
|
}
|
|
717
709
|
}
|
|
@@ -719,7 +711,7 @@ var require_Reflect = __commonJS(function() {
|
|
|
719
711
|
}
|
|
720
712
|
}
|
|
721
713
|
function CreateFallbackProvider(reflect) {
|
|
722
|
-
var { defineMetadata
|
|
714
|
+
var { defineMetadata, hasOwnMetadata, getOwnMetadata, getOwnMetadataKeys, deleteMetadata } = reflect;
|
|
723
715
|
var metadataOwner = new _WeakMap;
|
|
724
716
|
var provider = {
|
|
725
717
|
isProviderFor: function(O, P) {
|
|
@@ -727,7 +719,7 @@ var require_Reflect = __commonJS(function() {
|
|
|
727
719
|
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
|
|
728
720
|
return true;
|
|
729
721
|
}
|
|
730
|
-
if (
|
|
722
|
+
if (getOwnMetadataKeys(O, P).length) {
|
|
731
723
|
if (IsUndefined(metadataPropertySet)) {
|
|
732
724
|
metadataPropertySet = new _Set;
|
|
733
725
|
metadataOwner.set(O, metadataPropertySet);
|
|
@@ -737,11 +729,11 @@ var require_Reflect = __commonJS(function() {
|
|
|
737
729
|
}
|
|
738
730
|
return false;
|
|
739
731
|
},
|
|
740
|
-
OrdinaryDefineOwnMetadata:
|
|
741
|
-
OrdinaryHasOwnMetadata:
|
|
742
|
-
OrdinaryGetOwnMetadata:
|
|
743
|
-
OrdinaryOwnMetadataKeys:
|
|
744
|
-
OrdinaryDeleteMetadata:
|
|
732
|
+
OrdinaryDefineOwnMetadata: defineMetadata,
|
|
733
|
+
OrdinaryHasOwnMetadata: hasOwnMetadata,
|
|
734
|
+
OrdinaryGetOwnMetadata: getOwnMetadata,
|
|
735
|
+
OrdinaryOwnMetadataKeys: getOwnMetadataKeys,
|
|
736
|
+
OrdinaryDeleteMetadata: deleteMetadata
|
|
745
737
|
};
|
|
746
738
|
return provider;
|
|
747
739
|
}
|
|
@@ -762,19 +754,19 @@ var require_Reflect = __commonJS(function() {
|
|
|
762
754
|
var cacheSentinel = {};
|
|
763
755
|
var arraySentinel = [];
|
|
764
756
|
var MapIterator = function() {
|
|
765
|
-
function
|
|
757
|
+
function MapIterator(keys, values, selector) {
|
|
766
758
|
this._index = 0;
|
|
767
759
|
this._keys = keys;
|
|
768
760
|
this._values = values;
|
|
769
761
|
this._selector = selector;
|
|
770
762
|
}
|
|
771
|
-
|
|
763
|
+
MapIterator.prototype["@@iterator"] = function() {
|
|
772
764
|
return this;
|
|
773
765
|
};
|
|
774
|
-
|
|
766
|
+
MapIterator.prototype[iteratorSymbol] = function() {
|
|
775
767
|
return this;
|
|
776
768
|
};
|
|
777
|
-
|
|
769
|
+
MapIterator.prototype.next = function() {
|
|
778
770
|
var index = this._index;
|
|
779
771
|
if (index >= 0 && index < this._keys.length) {
|
|
780
772
|
var result = this._selector(this._keys[index], this._values[index]);
|
|
@@ -789,7 +781,7 @@ var require_Reflect = __commonJS(function() {
|
|
|
789
781
|
}
|
|
790
782
|
return { value: undefined, done: true };
|
|
791
783
|
};
|
|
792
|
-
|
|
784
|
+
MapIterator.prototype.throw = function(error) {
|
|
793
785
|
if (this._index >= 0) {
|
|
794
786
|
this._index = -1;
|
|
795
787
|
this._keys = arraySentinel;
|
|
@@ -797,7 +789,7 @@ var require_Reflect = __commonJS(function() {
|
|
|
797
789
|
}
|
|
798
790
|
throw error;
|
|
799
791
|
};
|
|
800
|
-
|
|
792
|
+
MapIterator.prototype.return = function(value) {
|
|
801
793
|
if (this._index >= 0) {
|
|
802
794
|
this._index = -1;
|
|
803
795
|
this._keys = arraySentinel;
|
|
@@ -805,35 +797,35 @@ var require_Reflect = __commonJS(function() {
|
|
|
805
797
|
}
|
|
806
798
|
return { value, done: true };
|
|
807
799
|
};
|
|
808
|
-
return
|
|
800
|
+
return MapIterator;
|
|
809
801
|
}();
|
|
810
802
|
var Map2 = function() {
|
|
811
|
-
function
|
|
803
|
+
function Map2() {
|
|
812
804
|
this._keys = [];
|
|
813
805
|
this._values = [];
|
|
814
806
|
this._cacheKey = cacheSentinel;
|
|
815
807
|
this._cacheIndex = -2;
|
|
816
808
|
}
|
|
817
|
-
Object.defineProperty(
|
|
809
|
+
Object.defineProperty(Map2.prototype, "size", {
|
|
818
810
|
get: function() {
|
|
819
811
|
return this._keys.length;
|
|
820
812
|
},
|
|
821
813
|
enumerable: true,
|
|
822
814
|
configurable: true
|
|
823
815
|
});
|
|
824
|
-
|
|
816
|
+
Map2.prototype.has = function(key) {
|
|
825
817
|
return this._find(key, false) >= 0;
|
|
826
818
|
};
|
|
827
|
-
|
|
819
|
+
Map2.prototype.get = function(key) {
|
|
828
820
|
var index = this._find(key, false);
|
|
829
821
|
return index >= 0 ? this._values[index] : undefined;
|
|
830
822
|
};
|
|
831
|
-
|
|
823
|
+
Map2.prototype.set = function(key, value) {
|
|
832
824
|
var index = this._find(key, true);
|
|
833
825
|
this._values[index] = value;
|
|
834
826
|
return this;
|
|
835
827
|
};
|
|
836
|
-
|
|
828
|
+
Map2.prototype.delete = function(key) {
|
|
837
829
|
var index = this._find(key, false);
|
|
838
830
|
if (index >= 0) {
|
|
839
831
|
var size = this._keys.length;
|
|
@@ -851,28 +843,28 @@ var require_Reflect = __commonJS(function() {
|
|
|
851
843
|
}
|
|
852
844
|
return false;
|
|
853
845
|
};
|
|
854
|
-
|
|
846
|
+
Map2.prototype.clear = function() {
|
|
855
847
|
this._keys.length = 0;
|
|
856
848
|
this._values.length = 0;
|
|
857
849
|
this._cacheKey = cacheSentinel;
|
|
858
850
|
this._cacheIndex = -2;
|
|
859
851
|
};
|
|
860
|
-
|
|
852
|
+
Map2.prototype.keys = function() {
|
|
861
853
|
return new MapIterator(this._keys, this._values, getKey);
|
|
862
854
|
};
|
|
863
|
-
|
|
855
|
+
Map2.prototype.values = function() {
|
|
864
856
|
return new MapIterator(this._keys, this._values, getValue);
|
|
865
857
|
};
|
|
866
|
-
|
|
858
|
+
Map2.prototype.entries = function() {
|
|
867
859
|
return new MapIterator(this._keys, this._values, getEntry);
|
|
868
860
|
};
|
|
869
|
-
|
|
861
|
+
Map2.prototype["@@iterator"] = function() {
|
|
870
862
|
return this.entries();
|
|
871
863
|
};
|
|
872
|
-
|
|
864
|
+
Map2.prototype[iteratorSymbol] = function() {
|
|
873
865
|
return this.entries();
|
|
874
866
|
};
|
|
875
|
-
|
|
867
|
+
Map2.prototype._find = function(key, insert) {
|
|
876
868
|
if (!SameValueZero(this._cacheKey, key)) {
|
|
877
869
|
this._cacheIndex = -1;
|
|
878
870
|
for (var i = 0;i < this._keys.length; i++) {
|
|
@@ -889,7 +881,7 @@ var require_Reflect = __commonJS(function() {
|
|
|
889
881
|
}
|
|
890
882
|
return this._cacheIndex;
|
|
891
883
|
};
|
|
892
|
-
return
|
|
884
|
+
return Map2;
|
|
893
885
|
}();
|
|
894
886
|
return Map2;
|
|
895
887
|
function getKey(key, _) {
|
|
@@ -904,44 +896,44 @@ var require_Reflect = __commonJS(function() {
|
|
|
904
896
|
}
|
|
905
897
|
function CreateSetPolyfill() {
|
|
906
898
|
var Set2 = function() {
|
|
907
|
-
function
|
|
899
|
+
function Set2() {
|
|
908
900
|
this._map = new _Map;
|
|
909
901
|
}
|
|
910
|
-
Object.defineProperty(
|
|
902
|
+
Object.defineProperty(Set2.prototype, "size", {
|
|
911
903
|
get: function() {
|
|
912
904
|
return this._map.size;
|
|
913
905
|
},
|
|
914
906
|
enumerable: true,
|
|
915
907
|
configurable: true
|
|
916
908
|
});
|
|
917
|
-
|
|
909
|
+
Set2.prototype.has = function(value) {
|
|
918
910
|
return this._map.has(value);
|
|
919
911
|
};
|
|
920
|
-
|
|
912
|
+
Set2.prototype.add = function(value) {
|
|
921
913
|
return this._map.set(value, value), this;
|
|
922
914
|
};
|
|
923
|
-
|
|
915
|
+
Set2.prototype.delete = function(value) {
|
|
924
916
|
return this._map.delete(value);
|
|
925
917
|
};
|
|
926
|
-
|
|
918
|
+
Set2.prototype.clear = function() {
|
|
927
919
|
this._map.clear();
|
|
928
920
|
};
|
|
929
|
-
|
|
921
|
+
Set2.prototype.keys = function() {
|
|
930
922
|
return this._map.keys();
|
|
931
923
|
};
|
|
932
|
-
|
|
924
|
+
Set2.prototype.values = function() {
|
|
933
925
|
return this._map.keys();
|
|
934
926
|
};
|
|
935
|
-
|
|
927
|
+
Set2.prototype.entries = function() {
|
|
936
928
|
return this._map.entries();
|
|
937
929
|
};
|
|
938
|
-
|
|
930
|
+
Set2.prototype["@@iterator"] = function() {
|
|
939
931
|
return this.keys();
|
|
940
932
|
};
|
|
941
|
-
|
|
933
|
+
Set2.prototype[iteratorSymbol] = function() {
|
|
942
934
|
return this.keys();
|
|
943
935
|
};
|
|
944
|
-
return
|
|
936
|
+
return Set2;
|
|
945
937
|
}();
|
|
946
938
|
return Set2;
|
|
947
939
|
}
|
|
@@ -1380,8 +1372,8 @@ var require_tslib = __commonJS(function(exports, module) {
|
|
|
1380
1372
|
};
|
|
1381
1373
|
}
|
|
1382
1374
|
function settle(resolve, reject, d, v) {
|
|
1383
|
-
Promise.resolve(v).then(function(
|
|
1384
|
-
resolve({ value:
|
|
1375
|
+
Promise.resolve(v).then(function(v) {
|
|
1376
|
+
resolve({ value: v, done: d });
|
|
1385
1377
|
}, reject);
|
|
1386
1378
|
}
|
|
1387
1379
|
};
|
|
@@ -1451,11 +1443,11 @@ var require_tslib = __commonJS(function(exports, module) {
|
|
|
1451
1443
|
var require_lifecycle = __commonJS(function(exports) {
|
|
1452
1444
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1453
1445
|
var Lifecycle;
|
|
1454
|
-
(function(
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1446
|
+
(function(Lifecycle) {
|
|
1447
|
+
Lifecycle[Lifecycle["Transient"] = 0] = "Transient";
|
|
1448
|
+
Lifecycle[Lifecycle["Singleton"] = 1] = "Singleton";
|
|
1449
|
+
Lifecycle[Lifecycle["ResolutionScoped"] = 2] = "ResolutionScoped";
|
|
1450
|
+
Lifecycle[Lifecycle["ContainerScoped"] = 3] = "ContainerScoped";
|
|
1459
1451
|
})(Lifecycle || (Lifecycle = {}));
|
|
1460
1452
|
exports.default = Lifecycle;
|
|
1461
1453
|
});
|
|
@@ -1964,9 +1956,9 @@ var require_dependency_container = __commonJS(function(exports) {
|
|
|
1964
1956
|
}
|
|
1965
1957
|
this.executePreResolutionInterceptor(token, "All");
|
|
1966
1958
|
if (registrations) {
|
|
1967
|
-
const
|
|
1968
|
-
this.executePostResolutionInterceptor(token,
|
|
1969
|
-
return
|
|
1959
|
+
const result = registrations.map((item) => this.resolveRegistration(item, context));
|
|
1960
|
+
this.executePostResolutionInterceptor(token, result, "All");
|
|
1961
|
+
return result;
|
|
1970
1962
|
}
|
|
1971
1963
|
const result = [this.construct(token, context)];
|
|
1972
1964
|
this.executePostResolutionInterceptor(token, result, "All");
|
|
@@ -3486,12 +3478,12 @@ function cancellationError(signal) {
|
|
|
3486
3478
|
class MultiFileSolutionDefinitionProvider {
|
|
3487
3479
|
get caseInsensitiveSerializer() {
|
|
3488
3480
|
if (!this._caseInsensitiveSerializer)
|
|
3489
|
-
this._caseInsensitiveSerializer = this.jsonSerializerFactory.getByName(
|
|
3481
|
+
this._caseInsensitiveSerializer = this.jsonSerializerFactory.getByName(JsonSerializerNames2.CaseInsensitive);
|
|
3490
3482
|
return this._caseInsensitiveSerializer;
|
|
3491
3483
|
}
|
|
3492
3484
|
get jsonSerializer() {
|
|
3493
3485
|
if (!this._jsonSerializer)
|
|
3494
|
-
this._jsonSerializer = this.jsonSerializerFactory.getByName(
|
|
3486
|
+
this._jsonSerializer = this.jsonSerializerFactory.getByName(JsonSerializerNames2.CamelCaseIndented);
|
|
3495
3487
|
return this._jsonSerializer;
|
|
3496
3488
|
}
|
|
3497
3489
|
async getFileStorageProviderAsync(context, cancellationToken) {
|
|
@@ -4141,11 +4133,11 @@ class MultiFileSolutionDefinitionFactory {
|
|
|
4141
4133
|
|
|
4142
4134
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/embedded-files-default.js
|
|
4143
4135
|
async function createDefaultEmbeddedFileReaderAsync() {
|
|
4144
|
-
const [{ EmbeddedFileReader }, { JsonSerializerFactory
|
|
4145
|
-
import("./embedded-file-reader-
|
|
4146
|
-
import("./index-
|
|
4136
|
+
const [{ EmbeddedFileReader }, { JsonSerializerFactory }] = await Promise.all([
|
|
4137
|
+
import("./embedded-file-reader-0228j82a.js"),
|
|
4138
|
+
import("./index-z2qk2qn6.js")
|
|
4147
4139
|
]);
|
|
4148
|
-
return new EmbeddedFileReader(new
|
|
4140
|
+
return new EmbeddedFileReader(new JsonSerializerFactory);
|
|
4149
4141
|
}
|
|
4150
4142
|
|
|
4151
4143
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/services/artifact-resource-spec-enhancer.js
|
|
@@ -4367,15 +4359,6 @@ function getResourceName(resource) {
|
|
|
4367
4359
|
function hasName(resource) {
|
|
4368
4360
|
return BindingsKnownKeys.NamePropertyName in resource.dynamicValues;
|
|
4369
4361
|
}
|
|
4370
|
-
function getFolderPathProperty(resource) {
|
|
4371
|
-
const folderPath = resource.dynamicValues[BindingsKnownKeys.FolderPathPropertyName];
|
|
4372
|
-
if (folderPath && folderPath.defaultValue != null)
|
|
4373
|
-
return folderPath;
|
|
4374
|
-
return {
|
|
4375
|
-
defaultValue: ".",
|
|
4376
|
-
isExpression: false
|
|
4377
|
-
};
|
|
4378
|
-
}
|
|
4379
4362
|
function canBeOverridden(resource) {
|
|
4380
4363
|
return isSolutionResource(resource.metadata) && !!resource.bindingKey && Object.values(resource.dynamicValues).some((v) => !v.isExpression);
|
|
4381
4364
|
}
|
|
@@ -5910,7 +5893,7 @@ class ValidateSolutionDefinitionRequestHandler {
|
|
|
5910
5893
|
}
|
|
5911
5894
|
jsonContent = new TextDecoder("utf-8").decode(combined);
|
|
5912
5895
|
}
|
|
5913
|
-
const caseInsensitiveSerializer = this.jsonSerializerFactory.getByName(
|
|
5896
|
+
const caseInsensitiveSerializer = this.jsonSerializerFactory.getByName(JsonSerializerNames2.CaseInsensitive);
|
|
5914
5897
|
const solution = caseInsensitiveSerializer.deserialize(jsonContent);
|
|
5915
5898
|
if (solution == null) {
|
|
5916
5899
|
this.logger.warn("Deserialization failed: the solution definition file is not valid");
|
|
@@ -6810,7 +6793,7 @@ class ResourceOverwritesService {
|
|
|
6810
6793
|
this.useGetByKeysOverwriteValidation = useGetByKeysOverwriteValidation;
|
|
6811
6794
|
this._overwritesPath = DebugOverwritesConstants.ResourceOverwritesFileName;
|
|
6812
6795
|
this.logger = loggerFactory.create("ResourceOverwritesService");
|
|
6813
|
-
this.indentedSerializer = jsonSerializerFactory.getByName(
|
|
6796
|
+
this.indentedSerializer = jsonSerializerFactory.getByName(JsonSerializerNames2.CamelCaseIndented);
|
|
6814
6797
|
}
|
|
6815
6798
|
}
|
|
6816
6799
|
var GUID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
@@ -7552,9 +7535,9 @@ class SolutionDefinitionHelper {
|
|
|
7552
7535
|
noOtherResourceInProjectReferencesDependency(solution, resourceToDelete, dependency) {
|
|
7553
7536
|
return !(solution.resources ?? []).some((r) => r !== resourceToDelete && r.projectKey === resourceToDelete.projectKey && (r.dependencies ?? []).some((dep) => invariantEquals(dep.name.trim(), dependency.name.trim()) && invariantEquals(dep.kind.trim(), dependency.kind.trim())));
|
|
7554
7537
|
}
|
|
7555
|
-
constructor(metadataReader,
|
|
7538
|
+
constructor(metadataReader, logger) {
|
|
7556
7539
|
this.metadataReader = metadataReader;
|
|
7557
|
-
this.logger =
|
|
7540
|
+
this.logger = logger;
|
|
7558
7541
|
}
|
|
7559
7542
|
}
|
|
7560
7543
|
|
|
@@ -7889,9 +7872,9 @@ class AllConfigurationsRequestHandler {
|
|
|
7889
7872
|
await this.collectResourceConfigurations(context, solution, depResource, visited, resources, cancellationToken);
|
|
7890
7873
|
}
|
|
7891
7874
|
}
|
|
7892
|
-
constructor(mediator,
|
|
7875
|
+
constructor(mediator, logger) {
|
|
7893
7876
|
this.mediator = mediator;
|
|
7894
|
-
this.logger =
|
|
7877
|
+
this.logger = logger;
|
|
7895
7878
|
}
|
|
7896
7879
|
}
|
|
7897
7880
|
|
|
@@ -8143,17 +8126,17 @@ class CreateVirtualResourceCommandHandler {
|
|
|
8143
8126
|
this.metadataReader = metadataReader;
|
|
8144
8127
|
}
|
|
8145
8128
|
}
|
|
8146
|
-
async function deleteResourceInternalAsync(context, resourceKey, allowProjectResourceDelete, metadataReader, resourceOverwritesService,
|
|
8129
|
+
async function deleteResourceInternalAsync(context, resourceKey, allowProjectResourceDelete, metadataReader, resourceOverwritesService, logger, cancellationToken) {
|
|
8147
8130
|
const solution = await context.loadAsync(cancellationToken);
|
|
8148
|
-
|
|
8131
|
+
logger.info("Deleting resource from solution", {
|
|
8149
8132
|
resourceKey
|
|
8150
8133
|
});
|
|
8151
8134
|
const resource = solution.resources.find((r) => r.key === resourceKey);
|
|
8152
8135
|
if (!resource)
|
|
8153
|
-
return void
|
|
8136
|
+
return void logger.warn("Resource not found in solution", {
|
|
8154
8137
|
resourceKey
|
|
8155
8138
|
});
|
|
8156
|
-
const helper = new SolutionDefinitionHelper(metadataReader,
|
|
8139
|
+
const helper = new SolutionDefinitionHelper(metadataReader, logger);
|
|
8157
8140
|
await helper.verifyIfResourceCanBeDeletedAsync(solution, resource, allowProjectResourceDelete, cancellationToken);
|
|
8158
8141
|
const resourcesToDelete = helper.getResourcesToDelete(solution, resource);
|
|
8159
8142
|
const allRemovedKeys = new Set(resourcesToDelete.map((r) => r.key));
|
|
@@ -8173,7 +8156,7 @@ async function deleteResourceInternalAsync(context, resourceKey, allowProjectRes
|
|
|
8173
8156
|
...allRemovedKeys
|
|
8174
8157
|
], cancellationToken);
|
|
8175
8158
|
} catch (error) {
|
|
8176
|
-
|
|
8159
|
+
logger.warn("Failed to remove overwrites for deleted resources", error);
|
|
8177
8160
|
}
|
|
8178
8161
|
}
|
|
8179
8162
|
|
|
@@ -9592,7 +9575,7 @@ class ValidateResourceDefinitionRequestHandler {
|
|
|
9592
9575
|
offset += chunk.length;
|
|
9593
9576
|
}
|
|
9594
9577
|
const jsonContent = new TextDecoder("utf-8").decode(combined);
|
|
9595
|
-
const caseInsensitiveSerializer = this.jsonSerializerFactory.getByName(
|
|
9578
|
+
const caseInsensitiveSerializer = this.jsonSerializerFactory.getByName(JsonSerializerNames2.CaseInsensitive);
|
|
9596
9579
|
const solution = caseInsensitiveSerializer.deserialize(jsonContent);
|
|
9597
9580
|
if (solution == null) {
|
|
9598
9581
|
this.logger.warn("Deserialization failed: the solution definition file is not valid");
|
|
@@ -9690,9 +9673,9 @@ class HttpClient {
|
|
|
9690
9673
|
};
|
|
9691
9674
|
this.createAbortSignal = (cancelToken) => {
|
|
9692
9675
|
if (this.abortControllers.has(cancelToken)) {
|
|
9693
|
-
const
|
|
9694
|
-
if (
|
|
9695
|
-
return
|
|
9676
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
9677
|
+
if (abortController)
|
|
9678
|
+
return abortController.signal;
|
|
9696
9679
|
return;
|
|
9697
9680
|
}
|
|
9698
9681
|
const abortController = new AbortController;
|
|
@@ -9727,11 +9710,11 @@ class HttpClient {
|
|
|
9727
9710
|
r.data = null;
|
|
9728
9711
|
r.error = null;
|
|
9729
9712
|
const responseToParse = responseFormat ? response.clone() : response;
|
|
9730
|
-
const data = responseFormat ? await responseToParse[responseFormat]().then((
|
|
9713
|
+
const data = responseFormat ? await responseToParse[responseFormat]().then((data) => {
|
|
9731
9714
|
if (r.ok)
|
|
9732
|
-
r.data =
|
|
9715
|
+
r.data = data;
|
|
9733
9716
|
else
|
|
9734
|
-
r.error =
|
|
9717
|
+
r.error = data;
|
|
9735
9718
|
return r;
|
|
9736
9719
|
}).catch((e) => {
|
|
9737
9720
|
r.error = e;
|
|
@@ -10645,7 +10628,7 @@ class FirstPartyServiceClientFactory {
|
|
|
10645
10628
|
throw new Error(`Unable to obtain access token for scope: ${FIRST_PARTY_SERVICE_SCOPE}`);
|
|
10646
10629
|
if (!accountKey)
|
|
10647
10630
|
throw new Error("Unable to obtain account key");
|
|
10648
|
-
const client = new
|
|
10631
|
+
const client = new FirstPartyServiceApi2({
|
|
10649
10632
|
baseUrl,
|
|
10650
10633
|
baseApiParams: {
|
|
10651
10634
|
secure: true
|
|
@@ -10741,11 +10724,11 @@ class FirstPartyServiceClientProxy {
|
|
|
10741
10724
|
});
|
|
10742
10725
|
} catch (error) {
|
|
10743
10726
|
if (isAbortError(error)) {
|
|
10744
|
-
const
|
|
10745
|
-
this.logger.error(
|
|
10746
|
-
const
|
|
10747
|
-
|
|
10748
|
-
throw
|
|
10727
|
+
const errorMessage = buildServiceExportErrorMessage(serviceName, resourceArray);
|
|
10728
|
+
this.logger.error(errorMessage, error instanceof Error ? error : new Error(errorMessage));
|
|
10729
|
+
const ex = new BadRequestException(ErrorCodes.ImportCancelled, error instanceof Error ? error.message : errorMessage, error);
|
|
10730
|
+
ex.exceptionData = getExceptionData(error, serviceName, resourceArray);
|
|
10731
|
+
throw ex;
|
|
10749
10732
|
}
|
|
10750
10733
|
if (error instanceof DisconnectedException) {
|
|
10751
10734
|
this.logger.error("Cannot export resources in disconnected mode.", error);
|
|
@@ -10783,7 +10766,7 @@ class FirstPartyServiceClientProxy {
|
|
|
10783
10766
|
const tenantKey = await this.accessProvider.getTenantKeyAsync(cancellationToken);
|
|
10784
10767
|
if (!accountKey)
|
|
10785
10768
|
throw new BadRequestException(ErrorCodes.AuthenticationFailed, "Unable to obtain account key");
|
|
10786
|
-
const client = new (await import("./first-party-service-
|
|
10769
|
+
const client = new (await import("./first-party-service-ahcc6xc6.js")).FirstPartyServiceApi({
|
|
10787
10770
|
baseUrl: fullBaseUrl,
|
|
10788
10771
|
baseApiParams: {
|
|
10789
10772
|
secure: true
|
|
@@ -10952,9 +10935,9 @@ class HttpClient2 {
|
|
|
10952
10935
|
};
|
|
10953
10936
|
this.createAbortSignal = (cancelToken) => {
|
|
10954
10937
|
if (this.abortControllers.has(cancelToken)) {
|
|
10955
|
-
const
|
|
10956
|
-
if (
|
|
10957
|
-
return
|
|
10938
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
10939
|
+
if (abortController)
|
|
10940
|
+
return abortController.signal;
|
|
10958
10941
|
return;
|
|
10959
10942
|
}
|
|
10960
10943
|
const abortController = new AbortController;
|
|
@@ -10989,11 +10972,11 @@ class HttpClient2 {
|
|
|
10989
10972
|
r.data = null;
|
|
10990
10973
|
r.error = null;
|
|
10991
10974
|
const responseToParse = responseFormat ? response.clone() : response;
|
|
10992
|
-
const data = responseFormat ? await responseToParse[responseFormat]().then((
|
|
10975
|
+
const data = responseFormat ? await responseToParse[responseFormat]().then((data) => {
|
|
10993
10976
|
if (r.ok)
|
|
10994
|
-
r.data =
|
|
10977
|
+
r.data = data;
|
|
10995
10978
|
else
|
|
10996
|
-
r.error =
|
|
10979
|
+
r.error = data;
|
|
10997
10980
|
return r;
|
|
10998
10981
|
}).catch((e) => {
|
|
10999
10982
|
r.error = e;
|
|
@@ -14618,9 +14601,9 @@ class ProjectResourcesDescriptorFactory {
|
|
|
14618
14601
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/config/projects/project-configuration-service.js
|
|
14619
14602
|
class ProjectConfigurationService {
|
|
14620
14603
|
async getDefaultConfigurationAsync(cancellationToken) {
|
|
14621
|
-
const
|
|
14604
|
+
const projectsConfiguration = this.projectConfigurationReader.getAll();
|
|
14622
14605
|
const language = this.getCurrentLanguage();
|
|
14623
|
-
const entries = Object.entries(
|
|
14606
|
+
const entries = Object.entries(projectsConfiguration);
|
|
14624
14607
|
const results = {};
|
|
14625
14608
|
for (const [projectType, config] of entries) {
|
|
14626
14609
|
const supportedResources = await this.projectResourcesDescriptorFactory.createAsync(projectType, language, cancellationToken);
|
|
@@ -14864,18 +14847,18 @@ function registerServices(diContainer, embeddedFileReader) {
|
|
|
14864
14847
|
return new ResourceBuilder(metadataReader, translationsReader, mediator);
|
|
14865
14848
|
}
|
|
14866
14849
|
});
|
|
14867
|
-
diContainer.registerInstance(ServiceTokens.JsonSerializerFactory, new
|
|
14850
|
+
diContainer.registerInstance(ServiceTokens.JsonSerializerFactory, new JsonSerializerFactory2);
|
|
14868
14851
|
diContainer.register(ServiceTokens.SerializerProxy, {
|
|
14869
14852
|
useFactory: (c) => {
|
|
14870
14853
|
const jsonSerializerFactory = c.resolve(ServiceTokens.JsonSerializerFactory);
|
|
14871
14854
|
const loggerFactory = c.resolve(ServiceTokens.LoggerFactory);
|
|
14872
|
-
return new
|
|
14855
|
+
return new JsonSerializerProxy2(jsonSerializerFactory, loggerFactory);
|
|
14873
14856
|
}
|
|
14874
14857
|
});
|
|
14875
14858
|
diContainer.register(ServiceTokens.StreamSerializer, {
|
|
14876
14859
|
useFactory: (c) => {
|
|
14877
14860
|
const jsonSerializerFactory = c.resolve(ServiceTokens.JsonSerializerFactory);
|
|
14878
|
-
return new
|
|
14861
|
+
return new StreamSerializer2(jsonSerializerFactory);
|
|
14879
14862
|
}
|
|
14880
14863
|
});
|
|
14881
14864
|
}
|
|
@@ -14931,8 +14914,8 @@ function registerHandlers(diContainer) {
|
|
|
14931
14914
|
useFactory: (c) => {
|
|
14932
14915
|
const mediator = c.resolve(ServiceTokens.Mediator);
|
|
14933
14916
|
const loggerFactory = c.resolve(ServiceTokens.LoggerFactory);
|
|
14934
|
-
const
|
|
14935
|
-
return new AllConfigurationsRequestHandler(mediator,
|
|
14917
|
+
const logger = loggerFactory.create("AllConfigurationsRequestHandler");
|
|
14918
|
+
return new AllConfigurationsRequestHandler(mediator, logger);
|
|
14936
14919
|
}
|
|
14937
14920
|
});
|
|
14938
14921
|
diContainer.register(createRequestHandlerToken(RetrieveConfigurationRequest.name), {
|
|
@@ -15263,21 +15246,21 @@ class ResourceBuilderServices {
|
|
|
15263
15246
|
const factory = this._container.resolve(Tokens.ISolutionBuilderFactory);
|
|
15264
15247
|
return factory.createAsync(solutionPath, isReadOnly, cancellationToken);
|
|
15265
15248
|
}
|
|
15266
|
-
constructor(
|
|
15267
|
-
this._container =
|
|
15249
|
+
constructor(container) {
|
|
15250
|
+
this._container = container;
|
|
15268
15251
|
}
|
|
15269
15252
|
}
|
|
15270
15253
|
|
|
15271
15254
|
// ../../node_modules/@uipath/resource-builder-sdk/dist/logging/logger.js
|
|
15272
|
-
var logger_LogLevel = /* @__PURE__ */ function(
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
return
|
|
15255
|
+
var logger_LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
15256
|
+
LogLevel[LogLevel["Trace"] = 0] = "Trace";
|
|
15257
|
+
LogLevel[LogLevel["Debug"] = 1] = "Debug";
|
|
15258
|
+
LogLevel[LogLevel["Information"] = 2] = "Information";
|
|
15259
|
+
LogLevel[LogLevel["Warning"] = 3] = "Warning";
|
|
15260
|
+
LogLevel[LogLevel["Error"] = 4] = "Error";
|
|
15261
|
+
LogLevel[LogLevel["Critical"] = 5] = "Critical";
|
|
15262
|
+
LogLevel[LogLevel["None"] = 6] = "None";
|
|
15263
|
+
return LogLevel;
|
|
15281
15264
|
}({});
|
|
15282
15265
|
function parseLogLevel(level) {
|
|
15283
15266
|
if (level === undefined)
|
|
@@ -15517,7 +15500,7 @@ class ResourceBuilderConfiguration {
|
|
|
15517
15500
|
};
|
|
15518
15501
|
} else if (!solutionDefinitionProvider && fileStorageProviderFactory)
|
|
15519
15502
|
solutionDefinitionFactory = {
|
|
15520
|
-
instance: new MultiFileSolutionDefinitionFactory(fileStorageProviderFactory.instance, new
|
|
15503
|
+
instance: new MultiFileSolutionDefinitionFactory(fileStorageProviderFactory.instance, new JsonSerializerFactory2, loggerFactoryInstance, this._solutionContextOptions),
|
|
15521
15504
|
lifetime: service_tokens_ServiceLifetime.Scoped
|
|
15522
15505
|
};
|
|
15523
15506
|
const artifactResourceSpecEnhancerInstance = this._artifactResourceSpecEnhancerProvider ? await this.resolveGenericProvider(this._artifactResourceSpecEnhancerProvider) : new DefaultArtifactResourceSpecEnhancer;
|
|
@@ -15526,8 +15509,8 @@ class ResourceBuilderConfiguration {
|
|
|
15526
15509
|
lifetime: this._artifactResourceSpecEnhancerLifetime
|
|
15527
15510
|
};
|
|
15528
15511
|
const embeddedFileReader = await createDefaultEmbeddedFileReaderAsync();
|
|
15529
|
-
const
|
|
15530
|
-
return new ResourceBuilderServices(
|
|
15512
|
+
const container = createContainer(accessProvider, cacheProvider, secretsProvider, fileStorageProviderFactory, ipRangeBypassSecretProvider, solutionDefinitionProvider, solutionDefinitionFactory, artifactResourceSpecEnhancer, this._httpReaderOptions, loggerFactory, embeddedFileReader, this._solutionContextOptions, featureFlagProvider);
|
|
15513
|
+
return new ResourceBuilderServices(container);
|
|
15531
15514
|
}
|
|
15532
15515
|
async buildServices() {
|
|
15533
15516
|
return this.build();
|
|
@@ -15549,14 +15532,6 @@ function createResourceBuilderConfiguration() {
|
|
|
15549
15532
|
return new ResourceBuilderConfiguration;
|
|
15550
15533
|
}
|
|
15551
15534
|
// ../solution-sdk/src/resources/services/solution-manifest.ts
|
|
15552
|
-
async function assertSolutionManifest(dir) {
|
|
15553
|
-
const fs = getFileSystem();
|
|
15554
|
-
const entries = await fs.readdir(dir);
|
|
15555
|
-
const hasManifest = entries.some((f) => f.endsWith(".uipx"));
|
|
15556
|
-
if (!hasManifest) {
|
|
15557
|
-
throw new Error(`${dir} is not a UiPath solution (no .uipx manifest found). Run 'uip solution init' first, or pass --solution-folder pointing at an existing solution.`);
|
|
15558
|
-
}
|
|
15559
|
-
}
|
|
15560
15535
|
async function readSolutionManifest(fs, solutionDir) {
|
|
15561
15536
|
const [readdirError, entries] = await catchError(fs.readdir(solutionDir));
|
|
15562
15537
|
if (readdirError || !entries)
|
|
@@ -15638,12 +15613,6 @@ async function computeEntryPointSpec(fs, solutionDir, projectKey) {
|
|
|
15638
15613
|
entryPointUniqueId: only ? only.uniqueId ?? null : null
|
|
15639
15614
|
};
|
|
15640
15615
|
}
|
|
15641
|
-
async function applyEntryPointEnhancementAsync(context, resource, spec) {
|
|
15642
|
-
const specMap = new Map(Object.entries(spec));
|
|
15643
|
-
const enhancer = new EntryPointSpecEnhancer;
|
|
15644
|
-
await enhancer.enhanceSpecAsync(context, resource, new Map, specMap);
|
|
15645
|
-
return Object.fromEntries(specMap.entries());
|
|
15646
|
-
}
|
|
15647
15616
|
|
|
15648
15617
|
// ../solution-sdk/src/resources/providers/artefact-pair-binding-provider.ts
|
|
15649
15618
|
var ARTEFACT_KIND_APP = "app";
|
|
@@ -15709,7 +15678,15 @@ class ArtefactPairBindingProvider extends MultiFileSolutionDefinitionProvider {
|
|
|
15709
15678
|
}
|
|
15710
15679
|
}
|
|
15711
15680
|
|
|
15712
|
-
class ArtefactPairBindingSolutionDefinitionFactory
|
|
15681
|
+
class ArtefactPairBindingSolutionDefinitionFactory {
|
|
15682
|
+
fileStorageProviderFactory;
|
|
15683
|
+
jsonSerializerFactory;
|
|
15684
|
+
loggerFactory;
|
|
15685
|
+
constructor(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory) {
|
|
15686
|
+
this.fileStorageProviderFactory = fileStorageProviderFactory;
|
|
15687
|
+
this.jsonSerializerFactory = jsonSerializerFactory;
|
|
15688
|
+
this.loggerFactory = loggerFactory;
|
|
15689
|
+
}
|
|
15713
15690
|
async getProviderAsync() {
|
|
15714
15691
|
return new ArtefactPairBindingProvider(this.fileStorageProviderFactory, this.jsonSerializerFactory, this.loggerFactory);
|
|
15715
15692
|
}
|
|
@@ -15907,7 +15884,7 @@ class FileSystemFileStorageProviderFactory {
|
|
|
15907
15884
|
const profilePath = fs.path.join(context.path, "userProfile", userId);
|
|
15908
15885
|
const exists = await fs.exists(profilePath);
|
|
15909
15886
|
if (!exists) {
|
|
15910
|
-
await fs.mkdir(profilePath
|
|
15887
|
+
await fs.mkdir(profilePath);
|
|
15911
15888
|
}
|
|
15912
15889
|
return new FileSystemFileStorageProvider(profilePath);
|
|
15913
15890
|
}
|
|
@@ -15977,7 +15954,7 @@ class SolutionAccessProvider {
|
|
|
15977
15954
|
userKey = undefined;
|
|
15978
15955
|
async getStatus() {
|
|
15979
15956
|
if (!this.loginStatus) {
|
|
15980
|
-
this.loginStatus = await
|
|
15957
|
+
this.loginStatus = await getLoginStatusAsync2();
|
|
15981
15958
|
}
|
|
15982
15959
|
return this.loginStatus;
|
|
15983
15960
|
}
|
|
@@ -16009,7 +15986,7 @@ class SolutionAccessProvider {
|
|
|
16009
15986
|
if (this.userKey !== undefined) {
|
|
16010
15987
|
return this.userKey;
|
|
16011
15988
|
}
|
|
16012
|
-
const [apiError, api] = await catchError(
|
|
15989
|
+
const [apiError, api] = await catchError(createApiClient2(UsersApi2));
|
|
16013
15990
|
if (apiError) {
|
|
16014
15991
|
logger.warn(`Failed to create UsersApi client: ${apiError.message}`);
|
|
16015
15992
|
return null;
|
|
@@ -16039,150 +16016,11 @@ class SolutionAccessProvider {
|
|
|
16039
16016
|
async function createResourceBuilderServices() {
|
|
16040
16017
|
const loggerFactory = new CliResourceBuilderLoggerFactory;
|
|
16041
16018
|
const fileStorageProviderFactory = new FileSystemFileStorageProviderFactory;
|
|
16042
|
-
const jsonSerializerFactory = new
|
|
16019
|
+
const jsonSerializerFactory = new JsonSerializerFactory2;
|
|
16043
16020
|
return await createResourceBuilderConfiguration().addAccessProvider(new SolutionAccessProvider).addFileStorageProviderFactory(fileStorageProviderFactory).addLoggerFactory(loggerFactory).addSolutionDefinitionFactory(new ArtefactPairBindingSolutionDefinitionFactory(fileStorageProviderFactory, jsonSerializerFactory, loggerFactory)).addArtifactResourceSpecEnhancer(new EntryPointSpecEnhancer).build();
|
|
16044
16021
|
}
|
|
16045
16022
|
|
|
16046
16023
|
// ../solution-sdk/src/resources/commands/project-utils.ts
|
|
16047
|
-
async function findProjectFile(projectDir) {
|
|
16048
|
-
const fs = getFileSystem();
|
|
16049
|
-
const uiprojPath = fs.path.join(projectDir, "project.uiproj");
|
|
16050
|
-
const jsonProjPath = fs.path.join(projectDir, "project.json");
|
|
16051
|
-
const uipathJsonPath = fs.path.join(projectDir, "uipath.json");
|
|
16052
|
-
if (await fs.exists(uiprojPath)) {
|
|
16053
|
-
return [
|
|
16054
|
-
null,
|
|
16055
|
-
{
|
|
16056
|
-
filePath: uiprojPath,
|
|
16057
|
-
fileName: "project.uiproj",
|
|
16058
|
-
useProjectJson: false
|
|
16059
|
-
}
|
|
16060
|
-
];
|
|
16061
|
-
}
|
|
16062
|
-
if (await fs.exists(jsonProjPath)) {
|
|
16063
|
-
return [
|
|
16064
|
-
null,
|
|
16065
|
-
{
|
|
16066
|
-
filePath: jsonProjPath,
|
|
16067
|
-
fileName: "project.json",
|
|
16068
|
-
useProjectJson: true
|
|
16069
|
-
}
|
|
16070
|
-
];
|
|
16071
|
-
}
|
|
16072
|
-
if (await fs.exists(uipathJsonPath)) {
|
|
16073
|
-
return [
|
|
16074
|
-
null,
|
|
16075
|
-
{
|
|
16076
|
-
filePath: uipathJsonPath,
|
|
16077
|
-
fileName: "uipath.json",
|
|
16078
|
-
useProjectJson: false
|
|
16079
|
-
}
|
|
16080
|
-
];
|
|
16081
|
-
}
|
|
16082
|
-
return [
|
|
16083
|
-
new Error(`No project file found in ${projectDir}. Expected project.uiproj, project.json, or uipath.json (Functions).`),
|
|
16084
|
-
null
|
|
16085
|
-
];
|
|
16086
|
-
}
|
|
16087
|
-
|
|
16088
|
-
class ProjectManifestError extends Error {
|
|
16089
|
-
__projectManifestError = true;
|
|
16090
|
-
reason;
|
|
16091
|
-
constructor(message, reason) {
|
|
16092
|
-
super(message);
|
|
16093
|
-
this.name = "ProjectManifestError";
|
|
16094
|
-
this.reason = reason;
|
|
16095
|
-
}
|
|
16096
|
-
}
|
|
16097
|
-
function isProjectManifestError(error) {
|
|
16098
|
-
return !!error && typeof error === "object" && error.__projectManifestError === true;
|
|
16099
|
-
}
|
|
16100
|
-
function isMissingProjectTypeError(error) {
|
|
16101
|
-
return isProjectManifestError(error) && error.reason === "no-project-type";
|
|
16102
|
-
}
|
|
16103
|
-
function lastPathSegment(filePath) {
|
|
16104
|
-
const parts = filePath.split(/[/\\]/);
|
|
16105
|
-
return parts[parts.length - 1] ?? filePath;
|
|
16106
|
-
}
|
|
16107
|
-
async function readProjectFile(filePath, useProjectJson) {
|
|
16108
|
-
const fs = getFileSystem();
|
|
16109
|
-
const [readError, rawContent] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
16110
|
-
if (readError || !rawContent) {
|
|
16111
|
-
return [readError ?? new Error("Unable to read project file"), null];
|
|
16112
|
-
}
|
|
16113
|
-
const [parseError, content] = catchError(() => JSON.parse(rawContent));
|
|
16114
|
-
if (parseError) {
|
|
16115
|
-
return [
|
|
16116
|
-
new ProjectManifestError(`Invalid JSON in project file: ${parseError.message}`, "invalid-json"),
|
|
16117
|
-
null
|
|
16118
|
-
];
|
|
16119
|
-
}
|
|
16120
|
-
const projectType = useProjectJson ? content.designOptions?.outputType ?? content.ProjectType : content.ProjectType;
|
|
16121
|
-
if (!projectType) {
|
|
16122
|
-
if (content.functions && typeof content.functions === "object") {
|
|
16123
|
-
return [
|
|
16124
|
-
null,
|
|
16125
|
-
{
|
|
16126
|
-
content,
|
|
16127
|
-
projectType: normalizeProjectType("Function" /* Function */)
|
|
16128
|
-
}
|
|
16129
|
-
];
|
|
16130
|
-
}
|
|
16131
|
-
if (lastPathSegment(filePath) === "uipath.json") {
|
|
16132
|
-
return [
|
|
16133
|
-
new ProjectManifestError(`${filePath} has no 'ProjectType'. A uipath.json is only read as a code-first Functions project, which also needs a 'functions' entry. Other project types are registered from project.uiproj or project.json, not from uipath.json.`, "no-project-type"),
|
|
16134
|
-
null
|
|
16135
|
-
];
|
|
16136
|
-
}
|
|
16137
|
-
return [
|
|
16138
|
-
new ProjectManifestError(`ProjectType not found in ${filePath}`, "no-project-type"),
|
|
16139
|
-
null
|
|
16140
|
-
];
|
|
16141
|
-
}
|
|
16142
|
-
return [null, { content, projectType: normalizeProjectType(projectType) }];
|
|
16143
|
-
}
|
|
16144
|
-
async function readSolutionFile(filePath) {
|
|
16145
|
-
const fs = getFileSystem();
|
|
16146
|
-
const [readError, rawContent] = await catchError(fs.readFile(filePath, "utf-8"));
|
|
16147
|
-
if (readError || !rawContent) {
|
|
16148
|
-
return [readError ?? new Error("Unable to read solution file"), null];
|
|
16149
|
-
}
|
|
16150
|
-
const [parseError, solution] = catchError(() => JSON.parse(rawContent));
|
|
16151
|
-
if (parseError) {
|
|
16152
|
-
return [
|
|
16153
|
-
new Error(`Invalid JSON in solution file: ${parseError.message}`),
|
|
16154
|
-
null
|
|
16155
|
-
];
|
|
16156
|
-
}
|
|
16157
|
-
return [null, { solution, rawContent }];
|
|
16158
|
-
}
|
|
16159
|
-
async function resolveSolutionFilePath(solutionFileOption, searchStartDir) {
|
|
16160
|
-
const fs = getFileSystem();
|
|
16161
|
-
if (solutionFileOption) {
|
|
16162
|
-
const resolved = fs.path.resolve(fs.env.cwd(), solutionFileOption);
|
|
16163
|
-
const exists = await fs.exists(resolved);
|
|
16164
|
-
if (!exists) {
|
|
16165
|
-
return [new Error(`Solution file not found: ${resolved}`), null];
|
|
16166
|
-
}
|
|
16167
|
-
return [null, resolved];
|
|
16168
|
-
}
|
|
16169
|
-
const [findError, found] = await catchError(findSolutionFileUpward(fs, searchStartDir));
|
|
16170
|
-
if (findError) {
|
|
16171
|
-
return [findError, null];
|
|
16172
|
-
}
|
|
16173
|
-
return [null, found];
|
|
16174
|
-
}
|
|
16175
|
-
async function writeSolutionFile(filePath, solution) {
|
|
16176
|
-
const fs = getFileSystem();
|
|
16177
|
-
const [writeError] = await catchError(fs.writeFile(filePath, `${JSON.stringify(solution, null, 2)}
|
|
16178
|
-
`));
|
|
16179
|
-
return writeError;
|
|
16180
|
-
}
|
|
16181
|
-
async function restoreSolutionFile(filePath, rawContent) {
|
|
16182
|
-
const fs = getFileSystem();
|
|
16183
|
-
const [writeError] = await catchError(fs.writeFile(filePath, rawContent));
|
|
16184
|
-
return writeError;
|
|
16185
|
-
}
|
|
16186
16024
|
async function createProjectInSolutionBuilder(solutionDir, projectId, projectName, projectType, subType) {
|
|
16187
16025
|
const [servicesError, services] = await catchError(createResourceBuilderServices());
|
|
16188
16026
|
if (servicesError) {
|
|
@@ -16199,168 +16037,7 @@ async function createProjectInSolutionBuilder(solutionDir, projectId, projectNam
|
|
|
16199
16037
|
subType
|
|
16200
16038
|
}));
|
|
16201
16039
|
await catchError(solutionBuilder.disposeAsync());
|
|
16202
|
-
return createError;
|
|
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
|
-
}
|
|
16306
|
-
// ../solution-sdk/src/resources/services/local-resource-matcher.ts
|
|
16307
|
-
function normalizeFolderPath(path) {
|
|
16308
|
-
if (!path)
|
|
16309
|
-
return;
|
|
16310
|
-
if (path === "." || path === "solution_folder")
|
|
16311
|
-
return;
|
|
16312
|
-
return path.toLowerCase();
|
|
16313
|
-
}
|
|
16314
|
-
function findMatchingLocalResource(resources, kind, name, folderPath) {
|
|
16315
|
-
const normalizedFolder = normalizeFolderPath(folderPath);
|
|
16316
|
-
const lowerKind = kind.toLowerCase();
|
|
16317
|
-
const matchesName = nameSuffixRegex(name, false);
|
|
16318
|
-
return resources.find((r) => {
|
|
16319
|
-
if ((r.kind ?? "").toLowerCase() !== lowerKind)
|
|
16320
|
-
return false;
|
|
16321
|
-
if (normalizeFolderPath(r.folders?.[0]?.fullyQualifiedName) !== normalizedFolder)
|
|
16322
|
-
return false;
|
|
16323
|
-
return matchesName.test(r.name ?? "");
|
|
16324
|
-
});
|
|
16325
|
-
}
|
|
16326
|
-
function nameSuffixRegex(name, suffixedOnly) {
|
|
16327
|
-
const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16328
|
-
return new RegExp(`^${escaped}(_\\d+)${suffixedOnly ? "" : "?"}$`, "i");
|
|
16329
|
-
}
|
|
16330
|
-
function isMemberArtefact(resource, memberProjectKeys) {
|
|
16331
|
-
if (resource.isArtefactResource !== true)
|
|
16332
|
-
return false;
|
|
16333
|
-
const projectKey = resource.projectKey?.toLowerCase();
|
|
16334
|
-
return !!projectKey && memberProjectKeys.has(projectKey);
|
|
16335
|
-
}
|
|
16336
|
-
function findMatchingMemberResource(resources, kind, name, memberProjectKeys) {
|
|
16337
|
-
if (memberProjectKeys.size === 0)
|
|
16338
|
-
return;
|
|
16339
|
-
const lowerKind = kind.toLowerCase();
|
|
16340
|
-
const matchesName = nameSuffixRegex(name, false);
|
|
16341
|
-
return resources.find((r) => isMemberArtefact(r, memberProjectKeys) && (r.kind ?? "").toLowerCase() === lowerKind && matchesName.test(r.name ?? ""));
|
|
16342
|
-
}
|
|
16343
|
-
function findMemberCloneResources(resources, memberProjectKeys) {
|
|
16344
|
-
if (memberProjectKeys.size === 0)
|
|
16345
|
-
return [];
|
|
16346
|
-
const members = resources.filter((r) => isMemberArtefact(r, memberProjectKeys));
|
|
16347
|
-
if (members.length === 0)
|
|
16348
|
-
return [];
|
|
16349
|
-
return resources.filter((candidate) => {
|
|
16350
|
-
if (candidate.isArtefactResource === true)
|
|
16351
|
-
return false;
|
|
16352
|
-
if (candidate.projectKey)
|
|
16353
|
-
return false;
|
|
16354
|
-
if (!hasPackageDependency(candidate))
|
|
16355
|
-
return false;
|
|
16356
|
-
const candidateName = candidate.name ?? "";
|
|
16357
|
-
const candidateKind = (candidate.kind ?? "").toLowerCase();
|
|
16358
|
-
const candidateType = (candidate.type ?? "").toLowerCase();
|
|
16359
|
-
return members.some((member) => member.key !== candidate.key && (member.kind ?? "").toLowerCase() === candidateKind && (member.type ?? "").toLowerCase() === candidateType && nameSuffixRegex(member.name ?? "", true).test(candidateName));
|
|
16360
|
-
});
|
|
16361
|
-
}
|
|
16362
|
-
function hasPackageDependency(resource) {
|
|
16363
|
-
return (resource.dependencies ?? []).some((dependency) => (dependency.kind ?? "").toLowerCase() === "package");
|
|
16040
|
+
return createError ?? null;
|
|
16364
16041
|
}
|
|
16365
16042
|
// ../solution-sdk/src/resources/services/project-artifacts-service.ts
|
|
16366
16043
|
async function addProjectArtifactsToSolutionAsync(options) {
|
|
@@ -16371,1571 +16048,16 @@ function artifactFailure(options, error) {
|
|
|
16371
16048
|
logger.warn(`Solution artifact-resource generation failed for project "${options.projectName}": ${error.message}. ` + "The project was created and registered, but 'uip solution pack' may omit its resource. " + "Re-run init with --force to retry, or run 'uip solution projects add' to finish setup.");
|
|
16372
16049
|
return { Created: false, Error: error.message };
|
|
16373
16050
|
}
|
|
16374
|
-
// ../solution-sdk/src/resources/services/project-template-types.ts
|
|
16375
|
-
var reader;
|
|
16376
|
-
function hasBareTemplateRow(projectType) {
|
|
16377
|
-
reader ??= new EmbeddedProjectConfigurationReader;
|
|
16378
|
-
return reader.getTemplateResourcesByType(projectType, undefined, false).length > 0;
|
|
16379
|
-
}
|
|
16380
|
-
function hasAnyTemplateRow(projectType) {
|
|
16381
|
-
reader ??= new EmbeddedProjectConfigurationReader;
|
|
16382
|
-
const wanted = projectType.toLowerCase();
|
|
16383
|
-
return Object.keys(reader.getAll()).some((row) => {
|
|
16384
|
-
const key = row.toLowerCase();
|
|
16385
|
-
return key === wanted || key.startsWith(`${wanted}_`);
|
|
16386
|
-
});
|
|
16387
|
-
}
|
|
16388
|
-
// ../solution-sdk/src/resources/services/remote-resources.ts
|
|
16389
|
-
function getRemoteResourceClients(services) {
|
|
16390
|
-
return {
|
|
16391
|
-
catalog: services.container.resolve(Tokens.IResourceCatalogClientProxy),
|
|
16392
|
-
importer: services.container.resolve(Tokens.IImportResourceHelper)
|
|
16393
|
-
};
|
|
16394
|
-
}
|
|
16395
|
-
async function findCatalogEntityAsync(catalog, query, match) {
|
|
16396
|
-
let pageCursor;
|
|
16397
|
-
do {
|
|
16398
|
-
const page = await catalog.searchFolderEntities({
|
|
16399
|
-
...query,
|
|
16400
|
-
pageSize: 100,
|
|
16401
|
-
pageCursor
|
|
16402
|
-
});
|
|
16403
|
-
const found = (page.items ?? []).find(match);
|
|
16404
|
-
if (found) {
|
|
16405
|
-
return found;
|
|
16406
|
-
}
|
|
16407
|
-
pageCursor = page.nextPage ?? undefined;
|
|
16408
|
-
} while (pageCursor);
|
|
16409
|
-
return;
|
|
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
|
-
}
|
|
16425
|
-
function toResourceReference(entity) {
|
|
16426
|
-
return toCatalogReference({
|
|
16427
|
-
kind: entity.entityType ?? "",
|
|
16428
|
-
type: entity.entitySubType ?? undefined,
|
|
16429
|
-
key: entity.entityKey ?? "",
|
|
16430
|
-
name: entity.entityName ?? undefined,
|
|
16431
|
-
folderPath: entity.fullyQualifiedName ?? undefined,
|
|
16432
|
-
folderKey: entity.folderKey ?? undefined
|
|
16433
|
-
});
|
|
16434
|
-
}
|
|
16435
|
-
function toCatalogReference(reference) {
|
|
16436
|
-
const { folderPath, folderKey, ...rest } = reference;
|
|
16437
|
-
return {
|
|
16438
|
-
...rest,
|
|
16439
|
-
folder: folderPath ? { fullyQualifiedName: folderPath, folderKey } : undefined
|
|
16440
|
-
};
|
|
16441
|
-
}
|
|
16442
|
-
async function exportResourceDefinitionAsync(importer, reference) {
|
|
16443
|
-
const payload = await importer.exportResourceAsync(reference);
|
|
16444
|
-
return payload.resourceDefinitions.find((d) => d.key === reference.key);
|
|
16445
|
-
}
|
|
16446
|
-
function readSpecProperty(spec, name) {
|
|
16447
|
-
if (!spec) {
|
|
16448
|
-
return;
|
|
16449
|
-
}
|
|
16450
|
-
if (spec[name] !== undefined) {
|
|
16451
|
-
return spec[name];
|
|
16452
|
-
}
|
|
16453
|
-
const lower = name.toLowerCase();
|
|
16454
|
-
const key = Object.keys(spec).find((k) => k.toLowerCase() === lower);
|
|
16455
|
-
return key === undefined ? undefined : spec[key];
|
|
16456
|
-
}
|
|
16457
|
-
function readSpecEntryPoints(spec) {
|
|
16458
|
-
const entryPoints = parseJsonString(readSpecProperty(spec, "entryPoints"));
|
|
16459
|
-
if (!Array.isArray(entryPoints) || !entryPoints.every((entry) => entry !== null && typeof entry === "object")) {
|
|
16460
|
-
return;
|
|
16461
|
-
}
|
|
16462
|
-
return entryPoints.map((entry) => ({
|
|
16463
|
-
UniqueId: String(readSpecProperty(entry, "uniqueId") ?? ""),
|
|
16464
|
-
Path: String(readSpecProperty(entry, "path") ?? ""),
|
|
16465
|
-
DisplayName: String(readSpecProperty(entry, "displayName") ?? ""),
|
|
16466
|
-
InputArguments: readSpecProperty(entry, "inputArguments"),
|
|
16467
|
-
OutputArguments: readSpecProperty(entry, "outputArguments")
|
|
16468
|
-
}));
|
|
16469
|
-
}
|
|
16470
|
-
function parseJsonString(raw) {
|
|
16471
|
-
if (typeof raw !== "string") {
|
|
16472
|
-
return raw;
|
|
16473
|
-
}
|
|
16474
|
-
const [error, parsed] = catchError(() => JSON.parse(raw));
|
|
16475
|
-
return error ? undefined : parsed;
|
|
16476
|
-
}
|
|
16477
|
-
// ../solution-sdk/src/resources/services/resource-casing.ts
|
|
16478
|
-
var RESOURCE_FILES_FOLDER_NAME2 = "resources";
|
|
16479
|
-
function lowerFirstChar(value) {
|
|
16480
|
-
return value ? value.charAt(0).toLowerCase() + value.slice(1) : value;
|
|
16481
|
-
}
|
|
16482
|
-
function normalizeResourceCasing(solution) {
|
|
16483
|
-
let normalized = 0;
|
|
16484
|
-
for (const resource of solution?.resources ?? []) {
|
|
16485
|
-
const kind = lowerFirstChar(resource.kind);
|
|
16486
|
-
const type = resource.type ? lowerFirstChar(resource.type) : resource.type;
|
|
16487
|
-
if (kind === resource.kind && type === resource.type)
|
|
16488
|
-
continue;
|
|
16489
|
-
resource.kind = kind;
|
|
16490
|
-
resource.type = type;
|
|
16491
|
-
normalized++;
|
|
16492
|
-
}
|
|
16493
|
-
return normalized;
|
|
16494
|
-
}
|
|
16495
|
-
async function saveCasingNormalized(builder) {
|
|
16496
|
-
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
16497
|
-
if (loadError) {
|
|
16498
|
-
logger.warn(`Skipping resource casing normalization; failed to load solution: ${loadError.message}`);
|
|
16499
|
-
} else {
|
|
16500
|
-
normalizeResourceCasing(solution);
|
|
16501
|
-
}
|
|
16502
|
-
const [disposeError] = await catchError(builder.disposeAsync());
|
|
16503
|
-
return disposeError ?? null;
|
|
16504
|
-
}
|
|
16505
|
-
async function normalizeResourceFileCasing(solutionDir) {
|
|
16506
|
-
const fs = getFileSystem();
|
|
16507
|
-
const root = fs.path.join(solutionDir, RESOURCE_FILES_FOLDER_NAME2);
|
|
16508
|
-
if (!await fs.exists(root))
|
|
16509
|
-
return [];
|
|
16510
|
-
const byTarget = new Map;
|
|
16511
|
-
for (const [path, target] of await collectResourceFiles(root, [])) {
|
|
16512
|
-
byTarget.set(target, [...byTarget.get(target) ?? [], path]);
|
|
16513
|
-
}
|
|
16514
|
-
const changed = [];
|
|
16515
|
-
for (const [target, paths] of byTarget) {
|
|
16516
|
-
const keep = paths.includes(target) ? target : paths[0];
|
|
16517
|
-
for (const path of paths) {
|
|
16518
|
-
if (path === keep)
|
|
16519
|
-
continue;
|
|
16520
|
-
const [removeError] = await catchError(fs.rm(path));
|
|
16521
|
-
if (removeError) {
|
|
16522
|
-
logger.warn(`Could not remove case-variant resource file ${path}: ${removeError.message}`);
|
|
16523
|
-
continue;
|
|
16524
|
-
}
|
|
16525
|
-
changed.push(path);
|
|
16526
|
-
logger.info(`Removed case-variant resource file ${path}; ${keep} holds the same resource`);
|
|
16527
|
-
}
|
|
16528
|
-
if (keep === target)
|
|
16529
|
-
continue;
|
|
16530
|
-
if (keep.toLowerCase() === target.toLowerCase() && await fs.exists(target)) {
|
|
16531
|
-
continue;
|
|
16532
|
-
}
|
|
16533
|
-
const [makeDirError] = await catchError(fs.mkdir(fs.path.dirname(target)));
|
|
16534
|
-
if (makeDirError) {
|
|
16535
|
-
logger.warn(`Could not create directory for resource file ${target}: ${makeDirError.message}`);
|
|
16536
|
-
continue;
|
|
16537
|
-
}
|
|
16538
|
-
const [renameError] = await catchError(fs.rename(keep, target));
|
|
16539
|
-
if (renameError) {
|
|
16540
|
-
logger.warn(`Could not move resource file ${keep} to ${target}: ${renameError.message}`);
|
|
16541
|
-
continue;
|
|
16542
|
-
}
|
|
16543
|
-
changed.push(target);
|
|
16544
|
-
logger.info(`Moved resource file ${keep} to ${target}`);
|
|
16545
|
-
}
|
|
16546
|
-
if (changed.length > 0)
|
|
16547
|
-
await removeEmptyDirectories(root, true);
|
|
16548
|
-
return changed;
|
|
16549
|
-
}
|
|
16550
|
-
function targetSegments(segments, kind, type) {
|
|
16551
|
-
const target = [...segments];
|
|
16552
|
-
const kindIndex = type ? target.length - 3 : target.length - 2;
|
|
16553
|
-
if (kindIndex < 0)
|
|
16554
|
-
return target;
|
|
16555
|
-
if (sameIgnoringCase(target[kindIndex], kind)) {
|
|
16556
|
-
target[kindIndex] = lowerFirstChar(kind);
|
|
16557
|
-
}
|
|
16558
|
-
if (type && sameIgnoringCase(target[kindIndex + 1], type)) {
|
|
16559
|
-
target[kindIndex + 1] = lowerFirstChar(type);
|
|
16560
|
-
}
|
|
16561
|
-
return target;
|
|
16562
|
-
}
|
|
16563
|
-
function sameIgnoringCase(a, b) {
|
|
16564
|
-
return a.toLowerCase() === b.toLowerCase();
|
|
16565
|
-
}
|
|
16566
|
-
async function collectResourceFiles(root, segments) {
|
|
16567
|
-
const fs = getFileSystem();
|
|
16568
|
-
const [readError, names] = await catchError(fs.readdir(fs.path.join(root, ...segments)));
|
|
16569
|
-
if (readError || !names)
|
|
16570
|
-
return [];
|
|
16571
|
-
const files = [];
|
|
16572
|
-
for (const name of [...names].sort()) {
|
|
16573
|
-
const childSegments = [...segments, name];
|
|
16574
|
-
const path = fs.path.join(root, ...childSegments);
|
|
16575
|
-
const [statError, stats] = await catchError(fs.stat(path));
|
|
16576
|
-
if (statError) {
|
|
16577
|
-
logger.warn(`Could not inspect resource path ${path}: ${statError.message}`);
|
|
16578
|
-
continue;
|
|
16579
|
-
}
|
|
16580
|
-
if (!stats)
|
|
16581
|
-
continue;
|
|
16582
|
-
if (stats.isDirectory()) {
|
|
16583
|
-
files.push(...await collectResourceFiles(root, childSegments));
|
|
16584
|
-
continue;
|
|
16585
|
-
}
|
|
16586
|
-
if (!name.toLowerCase().endsWith(".json"))
|
|
16587
|
-
continue;
|
|
16588
|
-
const [readFileError, content] = await catchError(fs.readFile(path, "utf-8"));
|
|
16589
|
-
if (readFileError) {
|
|
16590
|
-
logger.warn(`Could not read resource file ${path}: ${readFileError.message}`);
|
|
16591
|
-
continue;
|
|
16592
|
-
}
|
|
16593
|
-
const header = content ? parseResourceHeader(content) : null;
|
|
16594
|
-
if (!header)
|
|
16595
|
-
continue;
|
|
16596
|
-
const target = targetSegments(childSegments, header.kind, header.type);
|
|
16597
|
-
files.push([path, fs.path.join(root, ...target)]);
|
|
16598
|
-
}
|
|
16599
|
-
return files;
|
|
16600
|
-
}
|
|
16601
|
-
async function removeEmptyDirectories(dir, isRoot) {
|
|
16602
|
-
const fs = getFileSystem();
|
|
16603
|
-
const [readError, names] = await catchError(fs.readdir(dir));
|
|
16604
|
-
if (readError || !names)
|
|
16605
|
-
return false;
|
|
16606
|
-
let remaining = names.length;
|
|
16607
|
-
for (const name of names) {
|
|
16608
|
-
const childPath = fs.path.join(dir, name);
|
|
16609
|
-
const [statError, stats] = await catchError(fs.stat(childPath));
|
|
16610
|
-
if (statError) {
|
|
16611
|
-
logger.warn(`Could not inspect resource path ${childPath}: ${statError.message}`);
|
|
16612
|
-
continue;
|
|
16613
|
-
}
|
|
16614
|
-
if (!stats?.isDirectory())
|
|
16615
|
-
continue;
|
|
16616
|
-
if (await removeEmptyDirectories(childPath, false))
|
|
16617
|
-
remaining--;
|
|
16618
|
-
}
|
|
16619
|
-
if (remaining > 0 || isRoot)
|
|
16620
|
-
return false;
|
|
16621
|
-
const [removeError] = await catchError(fs.rm(dir));
|
|
16622
|
-
return !removeError;
|
|
16623
|
-
}
|
|
16624
|
-
function parseResourceHeader(content) {
|
|
16625
|
-
try {
|
|
16626
|
-
const wrapper = JSON.parse(content);
|
|
16627
|
-
const resource = wrapper?.resource;
|
|
16628
|
-
if (!resource || typeof resource.kind !== "string")
|
|
16629
|
-
return null;
|
|
16630
|
-
return {
|
|
16631
|
-
kind: resource.kind,
|
|
16632
|
-
type: typeof resource.type === "string" ? resource.type : undefined
|
|
16633
|
-
};
|
|
16634
|
-
} catch {
|
|
16635
|
-
return null;
|
|
16636
|
-
}
|
|
16637
|
-
}
|
|
16638
16051
|
// ../solution-sdk/src/resources/services/resource-configurations.ts
|
|
16639
16052
|
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
|
-
}
|
|
16750
|
-
// ../solution-sdk/src/resources/services/resource-name.ts
|
|
16751
|
-
var MAX_RESOURCE_NAME_LENGTH = 256;
|
|
16752
|
-
var UNSAFE_NAME_CHARS = /[\\/:*?"<>|]/;
|
|
16753
|
-
function hasControlChar(value) {
|
|
16754
|
-
for (let i = 0;i < value.length; i++) {
|
|
16755
|
-
if (value.charCodeAt(i) < 32)
|
|
16756
|
-
return true;
|
|
16757
|
-
}
|
|
16758
|
-
return false;
|
|
16759
|
-
}
|
|
16760
|
-
function validateResourceName(name, options = {}) {
|
|
16761
|
-
const optionName = options.optionName ?? "--name";
|
|
16762
|
-
if (name.trim() === "") {
|
|
16763
|
-
return {
|
|
16764
|
-
ok: false,
|
|
16765
|
-
message: `${optionName} must not be blank`,
|
|
16766
|
-
instructions: "Pass a non-empty resource name."
|
|
16767
|
-
};
|
|
16768
|
-
}
|
|
16769
|
-
if (name.length > MAX_RESOURCE_NAME_LENGTH) {
|
|
16770
|
-
return {
|
|
16771
|
-
ok: false,
|
|
16772
|
-
message: `${optionName} exceeds the ${MAX_RESOURCE_NAME_LENGTH}-character limit (got ${name.length})`,
|
|
16773
|
-
instructions: "Shorten the resource name. Orchestrator name limits are kind-specific (queues cap at 50, assets at 256)."
|
|
16774
|
-
};
|
|
16775
|
-
}
|
|
16776
|
-
if (UNSAFE_NAME_CHARS.test(name) || hasControlChar(name)) {
|
|
16777
|
-
return {
|
|
16778
|
-
ok: false,
|
|
16779
|
-
message: `${optionName} contains unsafe characters`,
|
|
16780
|
-
instructions: 'Resource names cannot contain path separators (/, \\), control characters, or any of: : * ? " < > |'
|
|
16781
|
-
};
|
|
16782
|
-
}
|
|
16783
|
-
return { ok: true };
|
|
16784
|
-
}
|
|
16785
|
-
function assertValidResourceName(name, options = {}) {
|
|
16786
|
-
const result = validateResourceName(name, options);
|
|
16787
|
-
if (!result.ok) {
|
|
16788
|
-
throw new Error(`${result.message}. ${result.instructions}`);
|
|
16789
|
-
}
|
|
16790
|
-
}
|
|
16791
|
-
// ../solution-sdk/src/solution-auth.ts
|
|
16792
|
-
async function getSolutionAuthContext(options) {
|
|
16793
|
-
const ctx = await getAuthContext({
|
|
16794
|
-
tenant: options.tenant,
|
|
16795
|
-
ensureTokenValidityMinutes: options.loginValidity ?? 10,
|
|
16796
|
-
envFilePath: options.envFilePath,
|
|
16797
|
-
requireOrganizationId: true,
|
|
16798
|
-
requireTenantName: true
|
|
16799
|
-
});
|
|
16800
|
-
const organizationId = ctx.organizationId;
|
|
16801
|
-
const tenantName = ctx.tenantName;
|
|
16802
|
-
const basePath = `${ctx.baseUrl}/${organizationId}/${tenantName}/automationsolutions_`;
|
|
16803
|
-
return {
|
|
16804
|
-
accessToken: ctx.accessToken,
|
|
16805
|
-
basePath,
|
|
16806
|
-
organizationId,
|
|
16807
|
-
tenantName,
|
|
16808
|
-
identity: ctx.identity
|
|
16809
|
-
};
|
|
16810
|
-
}
|
|
16811
16053
|
// ../solution-sdk/src/resources/services/sync-resources-from-bindings.ts
|
|
16812
16054
|
var TYPE_IS_IDENTITY_REPLACE_OPTIONS = new Set([
|
|
16813
16055
|
"SameType",
|
|
16814
16056
|
"SameNameAndType"
|
|
16815
16057
|
]);
|
|
16816
16058
|
var BINDINGS_JSON_FALLBACK_TYPES = new Set(["agent", "function"]);
|
|
16817
|
-
|
|
16818
|
-
class OverwriteRefreshError extends Error {
|
|
16819
|
-
}
|
|
16820
|
-
function placeholderForType(type) {
|
|
16821
|
-
switch ((type ?? "string").toLowerCase()) {
|
|
16822
|
-
case "boolean":
|
|
16823
|
-
return false;
|
|
16824
|
-
case "integer":
|
|
16825
|
-
case "number":
|
|
16826
|
-
return 0;
|
|
16827
|
-
default:
|
|
16828
|
-
return "";
|
|
16829
|
-
}
|
|
16830
|
-
}
|
|
16831
|
-
async function buildKindResolver(metadataReader) {
|
|
16832
|
-
const cache = new Map;
|
|
16833
|
-
const [orderedErr, ordered] = await catchError((async () => metadataReader.getOrderedAsync())());
|
|
16834
|
-
if (orderedErr || !ordered) {
|
|
16835
|
-
logger.warn(`Failed to load SDK resource metadata; kind resolution disabled: ${orderedErr?.message ?? "unknown"}`);
|
|
16836
|
-
return async () => {
|
|
16837
|
-
return;
|
|
16838
|
-
};
|
|
16839
|
-
}
|
|
16840
|
-
const byKind = new Map;
|
|
16841
|
-
for (const resource of ordered) {
|
|
16842
|
-
const key = resource.kind.toLowerCase();
|
|
16843
|
-
const list = byKind.get(key) ?? [];
|
|
16844
|
-
list.push(resource);
|
|
16845
|
-
byKind.set(key, list);
|
|
16846
|
-
}
|
|
16847
|
-
return async (kind, type) => {
|
|
16848
|
-
const cacheKey = (type === undefined ? kind : `${kind}|${type}`).toLowerCase();
|
|
16849
|
-
if (cache.has(cacheKey))
|
|
16850
|
-
return cache.get(cacheKey);
|
|
16851
|
-
const list = byKind.get(kind.toLowerCase());
|
|
16852
|
-
if (!list || list.length === 0) {
|
|
16853
|
-
cache.set(cacheKey, undefined);
|
|
16854
|
-
return;
|
|
16855
|
-
}
|
|
16856
|
-
const subtypes = list.flatMap((r) => r.type ? [r.type] : []);
|
|
16857
|
-
const matched = type === undefined ? undefined : findSubtypeEntry(list, type);
|
|
16858
|
-
const entry = matched ?? list[0];
|
|
16859
|
-
const version = entry.versions?.[0];
|
|
16860
|
-
const requiredDefaults = [];
|
|
16861
|
-
for (const prop of version?.spec ?? []) {
|
|
16862
|
-
if (prop.required && prop.defaultValue === undefined) {
|
|
16863
|
-
requiredDefaults.push({
|
|
16864
|
-
property: prop.property,
|
|
16865
|
-
placeholder: placeholderForType(prop.type)
|
|
16866
|
-
});
|
|
16867
|
-
}
|
|
16868
|
-
}
|
|
16869
|
-
const specProperties = new Set;
|
|
16870
|
-
for (const metadataVersion of entry.versions ?? []) {
|
|
16871
|
-
for (const prop of metadataVersion.spec ?? []) {
|
|
16872
|
-
if (prop.property) {
|
|
16873
|
-
specProperties.add(prop.property.toLowerCase());
|
|
16874
|
-
}
|
|
16875
|
-
}
|
|
16876
|
-
}
|
|
16877
|
-
const takesFreeFormType = type !== undefined && type.trim() !== "" && subtypes.length === 0 && TYPE_IS_IDENTITY_REPLACE_OPTIONS.has(String(version?.replaceOption));
|
|
16878
|
-
const resolved = {
|
|
16879
|
-
type: entry.type,
|
|
16880
|
-
virtualizable: version?.supportsInLineCreation ?? false,
|
|
16881
|
-
requiredDefaults,
|
|
16882
|
-
specProperties,
|
|
16883
|
-
subtypes,
|
|
16884
|
-
typeMatched: type === undefined || matched !== undefined || takesFreeFormType
|
|
16885
|
-
};
|
|
16886
|
-
cache.set(cacheKey, resolved);
|
|
16887
|
-
return resolved;
|
|
16888
|
-
};
|
|
16889
|
-
}
|
|
16890
|
-
function formatResourceSubtypes(subtypes) {
|
|
16891
|
-
return subtypes.map((subtype) => {
|
|
16892
|
-
const alias = mapSolutionToResourceSubtype(subtype);
|
|
16893
|
-
return alias && alias.toLowerCase() !== subtype.toLowerCase() ? `${subtype} (${alias})` : subtype;
|
|
16894
|
-
}).join(", ");
|
|
16895
|
-
}
|
|
16896
|
-
function sameResourceSubtype(a, b) {
|
|
16897
|
-
if (a === undefined || b === undefined)
|
|
16898
|
-
return false;
|
|
16899
|
-
if (a.toLowerCase() === b.toLowerCase())
|
|
16900
|
-
return true;
|
|
16901
|
-
return mapSolutionToResourceSubtype(a)?.toLowerCase() === mapSolutionToResourceSubtype(b)?.toLowerCase();
|
|
16902
|
-
}
|
|
16903
|
-
function findSubtypeEntry(list, type) {
|
|
16904
|
-
return list.find((r) => !!r.type && sameResourceSubtype(r.type, type));
|
|
16905
|
-
}
|
|
16906
|
-
function resolveBindingResourceIdentity(binding) {
|
|
16907
|
-
switch (binding.resourceType) {
|
|
16908
|
-
case models_BindingsResourceType.TimeTrigger:
|
|
16909
|
-
return { kind: "trigger", type: "timeTrigger" };
|
|
16910
|
-
case models_BindingsResourceType.AppsTrigger:
|
|
16911
|
-
return {
|
|
16912
|
-
kind: lowerFirstChar(getResourceKindForBinding(binding.resourceType))
|
|
16913
|
-
};
|
|
16914
|
-
default:
|
|
16915
|
-
return {
|
|
16916
|
-
kind: lowerFirstChar(getResourceKindForBinding(binding.resourceType))
|
|
16917
|
-
};
|
|
16918
|
-
}
|
|
16919
|
-
}
|
|
16920
|
-
async function syncResourcesFromBindings(solutionDir, projectPaths, projectSubTypes, projectBindings) {
|
|
16921
|
-
const result = {
|
|
16922
|
-
created: 0,
|
|
16923
|
-
imported: 0,
|
|
16924
|
-
skipped: 0,
|
|
16925
|
-
pruned: 0,
|
|
16926
|
-
projectResourcesCreated: 0,
|
|
16927
|
-
warnings: [],
|
|
16928
|
-
unresolved: []
|
|
16929
|
-
};
|
|
16930
|
-
const uipxProjects = await readUipxProjects(solutionDir);
|
|
16931
|
-
const paths = projectPaths ?? uipxProjects.map((p) => p.path);
|
|
16932
|
-
if (paths.length === 0) {
|
|
16933
|
-
return result;
|
|
16934
|
-
}
|
|
16935
|
-
const bindingsJsonFallbackDirs = new Set(uipxProjects.filter((p) => BINDINGS_JSON_FALLBACK_TYPES.has(p.type.toLowerCase())).map((p) => p.path));
|
|
16936
|
-
const [servicesError, services] = await catchError(createResourceBuilderServices());
|
|
16937
|
-
if (servicesError) {
|
|
16938
|
-
logger.warn(`Failed to create resource builder services: ${servicesError.message}`);
|
|
16939
|
-
return result;
|
|
16940
|
-
}
|
|
16941
|
-
const serializer = services.container.resolve(Tokens.IBindingsMetadataSerializer);
|
|
16942
|
-
const { bindings: allBindings, parseErrors } = await collectBindings(bindingsJsonFallbackDirs, serializer, bindingSources(solutionDir, paths, uipxProjects, projectBindings));
|
|
16943
|
-
if (parseErrors.length > 0) {
|
|
16944
|
-
const detail = parseErrors.map((e) => `${e.path}: ${e.reason}`).join("; ");
|
|
16945
|
-
throw new Error(`Invalid bindings file — ${detail}`);
|
|
16946
|
-
}
|
|
16947
|
-
if (allBindings.length === 0 && projectPaths !== undefined) {
|
|
16948
|
-
return result;
|
|
16949
|
-
}
|
|
16950
|
-
await normalizeResourceFileCasing(solutionDir);
|
|
16951
|
-
const [builderError, builder] = await catchError(services.getSolutionBuilder(solutionDir));
|
|
16952
|
-
if (builderError) {
|
|
16953
|
-
logger.warn(`Failed to get solution builder: ${builderError.message}`);
|
|
16954
|
-
return result;
|
|
16955
|
-
}
|
|
16956
|
-
const reconcileOutcome = await reconcileSolutionProjects(builder, solutionDir, projectSubTypes);
|
|
16957
|
-
result.projectResourcesCreated = reconcileOutcome.resourcesAdded;
|
|
16958
|
-
const memberProjectKeys = new Set(uipxProjects.map((project) => project.id.toLowerCase()));
|
|
16959
|
-
await pruneMemberClones(builder, memberProjectKeys, result);
|
|
16960
|
-
if (allBindings.length === 0) {
|
|
16961
|
-
const saveError2 = await saveAndDisposeBuilder(builder, solutionDir);
|
|
16962
|
-
if (saveError2) {
|
|
16963
|
-
throw new Error(`Failed to save solution changes: ${saveError2.message}`);
|
|
16964
|
-
}
|
|
16965
|
-
return result;
|
|
16966
|
-
}
|
|
16967
|
-
logger.info(`Found ${allBindings.length} bindings to sync`);
|
|
16968
|
-
const metadataReader = services.container.resolve(Tokens.IMetadataReader);
|
|
16969
|
-
const resolveKindMetadata = await buildKindResolver(metadataReader);
|
|
16970
|
-
const solution = await builder.context.loadAsync();
|
|
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
|
-
};
|
|
16994
|
-
const virtualCandidates = [];
|
|
16995
|
-
for (const binding of allBindings) {
|
|
16996
|
-
const identity = resolveBindingResourceIdentity(binding);
|
|
16997
|
-
const kind = identity.kind;
|
|
16998
|
-
if (kind.toLowerCase() === "unknown") {
|
|
16999
|
-
logger.warn(`Skipping unsupported binding type: ${binding.originalResourceType}`);
|
|
17000
|
-
continue;
|
|
17001
|
-
}
|
|
17002
|
-
const isConnection = isConnectionBinding(binding);
|
|
17003
|
-
const metadata = await resolveKindMetadata(kind, identity.type);
|
|
17004
|
-
const name = getResourceName(binding);
|
|
17005
|
-
const folderPath = getFolderPathProperty(binding).defaultValue;
|
|
17006
|
-
const directCloudKey = isConnection ? getConnectionKey(binding) : undefined;
|
|
17007
|
-
if (isConnection && !directCloudKey) {
|
|
17008
|
-
continue;
|
|
17009
|
-
}
|
|
17010
|
-
if (!isConnection && !name) {
|
|
17011
|
-
continue;
|
|
17012
|
-
}
|
|
17013
|
-
if (!isConnection && !normalizeFolderPath(folderPath) && findMatchingLocalResource(solution.resources ?? [], kind, name, folderPath)) {
|
|
17014
|
-
result.skipped++;
|
|
17015
|
-
logger.info(`Skipping ${kind} "${name}" — an in-solution resource already covers this solution-relative binding`);
|
|
17016
|
-
continue;
|
|
17017
|
-
}
|
|
17018
|
-
if (!isConnection && findMatchingMemberResource(solution.resources ?? [], kind, name, memberProjectKeys)) {
|
|
17019
|
-
result.skipped++;
|
|
17020
|
-
logger.info(`Skipping ${kind} "${name}" — the solution provisions this project itself; its member declaration covers the binding`);
|
|
17021
|
-
continue;
|
|
17022
|
-
}
|
|
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
|
-
}
|
|
17029
|
-
const resolvedType = identity.type ?? rcsMatch?.type ?? metadata?.type;
|
|
17030
|
-
if (!rcsMatch) {
|
|
17031
|
-
if (isConnection) {
|
|
17032
|
-
result.warnings.push(normalizeFolderPath(folderPath) ? `Connection ${directCloudKey} not found in Resource Catalog in the required folder "${folderPath}" (it may exist in a different folder)` : `Connection ${directCloudKey} not found in Resource Catalog`);
|
|
17033
|
-
continue;
|
|
17034
|
-
}
|
|
17035
|
-
virtualCandidates.push({
|
|
17036
|
-
binding,
|
|
17037
|
-
kind,
|
|
17038
|
-
type: resolvedType,
|
|
17039
|
-
metadata,
|
|
17040
|
-
name,
|
|
17041
|
-
folderPath
|
|
17042
|
-
});
|
|
17043
|
-
continue;
|
|
17044
|
-
}
|
|
17045
|
-
if (!isConnection && rcsMatch.key && knownResourceKeys.has(rcsMatch.key.toLowerCase())) {
|
|
17046
|
-
result.skipped++;
|
|
17047
|
-
resolvedKeys.add(bindingKey(kind, name));
|
|
17048
|
-
continue;
|
|
17049
|
-
}
|
|
17050
|
-
const callType = isConnection ? binding.metadata?.connector : resolvedType;
|
|
17051
|
-
const wasKnown = !!rcsMatch.key && knownResourceKeys.has(rcsMatch.key.toLowerCase());
|
|
17052
|
-
const reference = {
|
|
17053
|
-
kind,
|
|
17054
|
-
type: callType,
|
|
17055
|
-
key: rcsMatch.key,
|
|
17056
|
-
name: rcsMatch.name,
|
|
17057
|
-
folder: rcsMatch.folder
|
|
17058
|
-
};
|
|
17059
|
-
const [importError] = await catchError(wasKnown ? refreshKnownResource(services, builder, reference, overwrittenKeys) : builder.addOrUpdateResourceToSolutionAsync(reference, true));
|
|
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
|
-
}
|
|
17067
|
-
if (rcsMatch.key) {
|
|
17068
|
-
knownResourceKeys.add(rcsMatch.key.toLowerCase());
|
|
17069
|
-
overwrittenKeys.add(rcsMatch.key.toLowerCase());
|
|
17070
|
-
}
|
|
17071
|
-
result.imported++;
|
|
17072
|
-
logger.info(`Imported ${kind} "${rcsMatch.name}" (key: ${rcsMatch.key}) into solution`);
|
|
17073
|
-
continue;
|
|
17074
|
-
}
|
|
17075
|
-
if (stopsCatalogLookups(classifyCatalogFailure(importError))) {
|
|
17076
|
-
await recordUnchecked(importError, kind, name, directCloudKey);
|
|
17077
|
-
continue;
|
|
17078
|
-
}
|
|
17079
|
-
if (isConnection) {
|
|
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);
|
|
17084
|
-
continue;
|
|
17085
|
-
}
|
|
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);
|
|
17089
|
-
virtualCandidates.push({
|
|
17090
|
-
binding,
|
|
17091
|
-
kind,
|
|
17092
|
-
type: resolvedType,
|
|
17093
|
-
metadata,
|
|
17094
|
-
name,
|
|
17095
|
-
folderPath
|
|
17096
|
-
});
|
|
17097
|
-
}
|
|
17098
|
-
const virtualCandidatesSeen = new Set;
|
|
17099
|
-
const dedupedVirtuals = virtualCandidates.filter((c) => {
|
|
17100
|
-
const key = `${c.kind}:${c.name}`.toLowerCase();
|
|
17101
|
-
if (virtualCandidatesSeen.has(key))
|
|
17102
|
-
return false;
|
|
17103
|
-
virtualCandidatesSeen.add(key);
|
|
17104
|
-
return true;
|
|
17105
|
-
});
|
|
17106
|
-
for (const candidate of dedupedVirtuals) {
|
|
17107
|
-
const [syncError, created] = await catchError(createVirtualForBinding(builder, candidate.binding, candidate.kind, candidate.type, candidate.metadata, candidate.name, candidate.folderPath, result));
|
|
17108
|
-
if (syncError) {
|
|
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));
|
|
17112
|
-
}
|
|
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
|
-
}
|
|
17130
|
-
const saveError = await saveAndDisposeBuilder(builder, solutionDir);
|
|
17131
|
-
if (saveError) {
|
|
17132
|
-
throw new Error(`Failed to save solution changes: ${saveError.message}`);
|
|
17133
|
-
}
|
|
17134
|
-
return result;
|
|
17135
|
-
}
|
|
17136
|
-
async function pruneMemberClones(builder, memberProjectKeys, result) {
|
|
17137
|
-
if (memberProjectKeys.size === 0)
|
|
17138
|
-
return;
|
|
17139
|
-
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
17140
|
-
if (loadError || !solution) {
|
|
17141
|
-
logger.warn(`Skipping member clone cleanup; failed to load solution: ${loadError?.message ?? "unknown"}`);
|
|
17142
|
-
return;
|
|
17143
|
-
}
|
|
17144
|
-
const clones = findMemberCloneResources(solution.resources ?? [], memberProjectKeys);
|
|
17145
|
-
for (const clone of clones) {
|
|
17146
|
-
const [deleteError] = await catchError(builder.deleteSolutionResourceAsync(clone.key));
|
|
17147
|
-
if (deleteError) {
|
|
17148
|
-
const warning = `Could not remove duplicate ${clone.kind} "${clone.name}" (key: ${clone.key}): ${deleteError.message}`;
|
|
17149
|
-
result.warnings.push(warning);
|
|
17150
|
-
logger.warn(warning);
|
|
17151
|
-
continue;
|
|
17152
|
-
}
|
|
17153
|
-
result.pruned++;
|
|
17154
|
-
logger.info(`Removed duplicate ${clone.kind} "${clone.name}" (key: ${clone.key}) — the solution provisions this project itself`);
|
|
17155
|
-
}
|
|
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
|
-
}
|
|
17194
|
-
async function saveAndDisposeBuilder(builder, solutionDir) {
|
|
17195
|
-
const context = builder.context;
|
|
17196
|
-
if (!context?.forceSaveChangesAsync) {
|
|
17197
|
-
await builder.disposeAsync();
|
|
17198
|
-
return new Error("Builder context exposes no force save method; solution changes were not persisted");
|
|
17199
|
-
}
|
|
17200
|
-
const [loadError, solution] = await catchError(builder.context.loadAsync());
|
|
17201
|
-
if (loadError) {
|
|
17202
|
-
logger.warn(`Skipping resource casing normalization; failed to load solution: ${loadError.message}`);
|
|
17203
|
-
} else {
|
|
17204
|
-
normalizeResourceCasing(solution);
|
|
17205
|
-
}
|
|
17206
|
-
const [saveError] = await catchError(context.forceSaveChangesAsync.call(context));
|
|
17207
|
-
await builder.disposeAsync();
|
|
17208
|
-
if (!saveError) {
|
|
17209
|
-
await normalizeResourceFileCasing(solutionDir);
|
|
17210
|
-
}
|
|
17211
|
-
return saveError;
|
|
17212
|
-
}
|
|
17213
|
-
function isConnectionBinding(binding) {
|
|
17214
|
-
return binding.resourceType === models_BindingsResourceType.Connection || binding.resourceType === models_BindingsResourceType.EventTrigger;
|
|
17215
|
-
}
|
|
17216
|
-
function getConnectionKey(binding) {
|
|
17217
|
-
return binding.dynamicValues[BindingsKnownKeys.ConnectionIdPropertyName]?.defaultValue || binding.bindingKey;
|
|
17218
|
-
}
|
|
17219
|
-
function uniqueNameForResource(name, kind, excludeKey, solution) {
|
|
17220
|
-
const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17221
|
-
const suffixRegex = new RegExp(`^${escaped}(_\\d+)?$`, "i");
|
|
17222
|
-
const conflicts = solution.resources.filter((r) => r.key !== excludeKey && (r.kind ?? "").toLowerCase() === kind.toLowerCase() && !!r.name && suffixRegex.test(r.name));
|
|
17223
|
-
if (conflicts.length === 0)
|
|
17224
|
-
return name;
|
|
17225
|
-
const lastIndex = Math.max(...conflicts.map((r) => {
|
|
17226
|
-
const m = r.name.match(/_(\d+)$/);
|
|
17227
|
-
return m ? Number.parseInt(m[1], 10) : 0;
|
|
17228
|
-
}));
|
|
17229
|
-
return `${name}_${lastIndex + 1}`;
|
|
17230
|
-
}
|
|
17231
|
-
async function mintVirtualResource(builder, kind, type, name, metadata) {
|
|
17232
|
-
const res = await builder.createVirtualResourceAsync({ kind, type });
|
|
17233
|
-
const key = res.key;
|
|
17234
|
-
if (!key) {
|
|
17235
|
-
logger.warn(`createVirtualResourceAsync returned no key for ${kind}`);
|
|
17236
|
-
return;
|
|
17237
|
-
}
|
|
17238
|
-
const solution = await builder.context.loadAsync();
|
|
17239
|
-
const resource = solution.resources.find((r) => r.key === key);
|
|
17240
|
-
if (!resource) {
|
|
17241
|
-
return { finalName: name };
|
|
17242
|
-
}
|
|
17243
|
-
const uniqueName = uniqueNameForResource(name, kind, key, solution);
|
|
17244
|
-
resource.name = uniqueName;
|
|
17245
|
-
if (resource.spec) {
|
|
17246
|
-
resource.spec.name = uniqueName;
|
|
17247
|
-
const specBag = resource.spec;
|
|
17248
|
-
for (const { property, placeholder } of metadata?.requiredDefaults ?? []) {
|
|
17249
|
-
if (specBag[property] === undefined) {
|
|
17250
|
-
specBag[property] = placeholder;
|
|
17251
|
-
}
|
|
17252
|
-
}
|
|
17253
|
-
}
|
|
17254
|
-
return { resource, finalName: uniqueName };
|
|
17255
|
-
}
|
|
17256
|
-
async function createVirtualForBinding(builder, _binding, kind, type, metadata, name, folderPath, result) {
|
|
17257
|
-
const virtualizable = metadata?.virtualizable ?? false;
|
|
17258
|
-
const preLoadSolution = await builder.context.loadAsync();
|
|
17259
|
-
const alreadyVirtualized = findMatchingLocalResource(preLoadSolution.resources, kind, name, undefined);
|
|
17260
|
-
if (alreadyVirtualized) {
|
|
17261
|
-
result.skipped++;
|
|
17262
|
-
logger.info(`Skipping virtual ${kind} "${name}" — existing resource "${alreadyVirtualized.name}" in solution_folder already covers this binding (requested folder "${folderPath}")`);
|
|
17263
|
-
return true;
|
|
17264
|
-
}
|
|
17265
|
-
const minted = await mintVirtualResource(builder, kind, type, name, metadata);
|
|
17266
|
-
if (!minted)
|
|
17267
|
-
return false;
|
|
17268
|
-
result.created++;
|
|
17269
|
-
logger.info(`Created ${kind} "${name}" in solution`);
|
|
17270
|
-
if (!virtualizable) {
|
|
17271
|
-
const warning = `${kind} "${name}" not found in Orchestrator. Link it before deploy: uip solution deploy config link <file> "${name}" --name <existing-name>`;
|
|
17272
|
-
result.warnings.push(warning);
|
|
17273
|
-
logger.warn(warning);
|
|
17274
|
-
}
|
|
17275
|
-
return true;
|
|
17276
|
-
}
|
|
17277
|
-
async function findResourceByKeyInRcs(builder, kind, expectedKey, folderPath, propagateErrors = false) {
|
|
17278
|
-
const expectedLower = expectedKey.toLowerCase();
|
|
17279
|
-
const normalizedFolder = normalizeFolderPath(folderPath);
|
|
17280
|
-
const mismatchedFolders = [];
|
|
17281
|
-
let pageCursor;
|
|
17282
|
-
do {
|
|
17283
|
-
const [searchError, result] = await catchError(builder.searchResourcesAsync(kind, undefined, undefined, pageCursor, 100, undefined, false));
|
|
17284
|
-
if (searchError) {
|
|
17285
|
-
if (propagateErrors) {
|
|
17286
|
-
throw searchError;
|
|
17287
|
-
}
|
|
17288
|
-
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
17289
|
-
return;
|
|
17290
|
-
}
|
|
17291
|
-
for (const folderResources of result.availableResources) {
|
|
17292
|
-
for (const resource of folderResources.resources) {
|
|
17293
|
-
if (resource.key.toLowerCase() === expectedLower) {
|
|
17294
|
-
const match = {
|
|
17295
|
-
key: resource.key,
|
|
17296
|
-
name: resource.name,
|
|
17297
|
-
type: resource.type,
|
|
17298
|
-
folder: {
|
|
17299
|
-
fullyQualifiedName: folderResources.fullyQualifiedName,
|
|
17300
|
-
folderKey: folderResources.key,
|
|
17301
|
-
path: folderResources.path
|
|
17302
|
-
}
|
|
17303
|
-
};
|
|
17304
|
-
if (!normalizedFolder) {
|
|
17305
|
-
return match;
|
|
17306
|
-
}
|
|
17307
|
-
if (normalizeFolderPath(match.folder.fullyQualifiedName) === normalizedFolder) {
|
|
17308
|
-
return match;
|
|
17309
|
-
}
|
|
17310
|
-
mismatchedFolders.push(match.folder.fullyQualifiedName || "<tenant>");
|
|
17311
|
-
}
|
|
17312
|
-
}
|
|
17313
|
-
}
|
|
17314
|
-
pageCursor = result.nextPage;
|
|
17315
|
-
} while (pageCursor);
|
|
17316
|
-
if (mismatchedFolders.length > 0) {
|
|
17317
|
-
logger.warn(`Found ${kind} ${expectedKey} in folder(s) ${mismatchedFolders.join(", ")}, but binding requires "${folderPath}". Marking unresolved.`);
|
|
17318
|
-
}
|
|
17319
|
-
return;
|
|
17320
|
-
}
|
|
17321
|
-
async function searchRcsResources(builder, kind, name) {
|
|
17322
|
-
const [searchError, matches] = await catchError(searchRcsResourcesStrict(builder, kind, name));
|
|
17323
|
-
if (searchError) {
|
|
17324
|
-
logger.warn(`Failed to search ${kind} resources in RCS: ${searchError.message}`);
|
|
17325
|
-
return [];
|
|
17326
|
-
}
|
|
17327
|
-
return matches;
|
|
17328
|
-
}
|
|
17329
|
-
async function searchRcsResourcesStrict(builder, kind, name) {
|
|
17330
|
-
let pageCursor;
|
|
17331
|
-
const allMatches = [];
|
|
17332
|
-
do {
|
|
17333
|
-
const result = await builder.searchResourcesAsync(kind, undefined, name, pageCursor, 50, undefined, false);
|
|
17334
|
-
for (const folderResources of result.availableResources) {
|
|
17335
|
-
const matches = folderResources.resources.filter((r) => r.name.toLowerCase() === name.toLowerCase());
|
|
17336
|
-
for (const match of matches) {
|
|
17337
|
-
allMatches.push({
|
|
17338
|
-
key: match.key,
|
|
17339
|
-
name: match.name,
|
|
17340
|
-
type: match.type,
|
|
17341
|
-
folder: {
|
|
17342
|
-
fullyQualifiedName: folderResources.fullyQualifiedName,
|
|
17343
|
-
folderKey: folderResources.key,
|
|
17344
|
-
path: folderResources.path
|
|
17345
|
-
}
|
|
17346
|
-
});
|
|
17347
|
-
}
|
|
17348
|
-
}
|
|
17349
|
-
pageCursor = result.nextPage;
|
|
17350
|
-
} while (pageCursor);
|
|
17351
|
-
return allMatches;
|
|
17352
|
-
}
|
|
17353
|
-
async function findResourceInRcs(builder, kind, name, folderPath, propagateErrors = false) {
|
|
17354
|
-
const allMatches = propagateErrors ? await searchRcsResourcesStrict(builder, kind, name) : await searchRcsResources(builder, kind, name);
|
|
17355
|
-
if (allMatches.length === 0) {
|
|
17356
|
-
return;
|
|
17357
|
-
}
|
|
17358
|
-
if (allMatches.length === 1) {
|
|
17359
|
-
return allMatches[0];
|
|
17360
|
-
}
|
|
17361
|
-
const normalized = normalizeFolderPath(folderPath);
|
|
17362
|
-
if (normalized) {
|
|
17363
|
-
const inFolder = allMatches.filter((m) => m.folder?.fullyQualifiedName?.toLowerCase() === normalized);
|
|
17364
|
-
if (inFolder.length === 1) {
|
|
17365
|
-
return inFolder[0];
|
|
17366
|
-
}
|
|
17367
|
-
if (inFolder.length > 1) {
|
|
17368
|
-
logger.warn(`Found ${inFolder.length} ${kind} resources named "${name}" in folder "${folderPath}" (same name, different subtype). Marking unresolved.`);
|
|
17369
|
-
return;
|
|
17370
|
-
}
|
|
17371
|
-
logger.warn(`Found ${allMatches.length} ${kind} resources named "${name}", none in folder "${folderPath}". Marking unresolved.`);
|
|
17372
|
-
return;
|
|
17373
|
-
}
|
|
17374
|
-
logger.warn(`Found ${allMatches.length} ${kind} resources named "${name}" across folders and binding has no folder hint. Marking unresolved.`);
|
|
17375
|
-
return;
|
|
17376
|
-
}
|
|
17377
|
-
async function createResourceKindMetadataResolver(services) {
|
|
17378
|
-
const metadataReader = services.container.resolve(Tokens.IMetadataReader);
|
|
17379
|
-
return buildKindResolver(metadataReader);
|
|
17380
|
-
}
|
|
17381
|
-
async function resolveResourceKindMetadata(services, kind, type) {
|
|
17382
|
-
const resolver = await createResourceKindMetadataResolver(services);
|
|
17383
|
-
return resolver(kind, type);
|
|
17384
|
-
}
|
|
17385
|
-
async function createLocalResource(params) {
|
|
17386
|
-
const { builder, services, kind, type, name } = params;
|
|
17387
|
-
if (type !== undefined && type.trim() === "") {
|
|
17388
|
-
throw new Error(`Type for kind ${kind} is empty.`);
|
|
17389
|
-
}
|
|
17390
|
-
const metadata = await resolveResourceKindMetadata(services, kind, type);
|
|
17391
|
-
if (type !== undefined && metadata && !metadata.typeMatched) {
|
|
17392
|
-
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.`);
|
|
17393
|
-
}
|
|
17394
|
-
const minted = await mintVirtualResource(builder, kind, metadata?.type ?? type, name, metadata);
|
|
17395
|
-
if (!minted?.resource)
|
|
17396
|
-
return;
|
|
17397
|
-
return { resource: minted.resource, finalName: minted.finalName };
|
|
17398
|
-
}
|
|
17399
|
-
function mapUipxTypeToReconcileType(uipxType) {
|
|
17400
|
-
const lower = uipxType.toLowerCase();
|
|
17401
|
-
if (lower === "apiautomation")
|
|
17402
|
-
return "Api";
|
|
17403
|
-
if (lower === "library" || lower === "tests") {
|
|
17404
|
-
return null;
|
|
17405
|
-
}
|
|
17406
|
-
return uipxType;
|
|
17407
|
-
}
|
|
17408
|
-
async function readUipxProjects(solutionDir) {
|
|
17409
|
-
const fs = getFileSystem();
|
|
17410
|
-
const uipxPath = await findUipxFile(solutionDir);
|
|
17411
|
-
if (!uipxPath)
|
|
17412
|
-
return [];
|
|
17413
|
-
const [readError, content] = await catchError(fs.readFile(uipxPath));
|
|
17414
|
-
if (readError || !content)
|
|
17415
|
-
return [];
|
|
17416
|
-
let parsed;
|
|
17417
|
-
try {
|
|
17418
|
-
parsed = JSON.parse(new TextDecoder().decode(content));
|
|
17419
|
-
} catch (err) {
|
|
17420
|
-
logger.warn(`Failed to parse ${uipxPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
17421
|
-
return [];
|
|
17422
|
-
}
|
|
17423
|
-
const projects = [];
|
|
17424
|
-
for (const entry of parsed.Projects ?? []) {
|
|
17425
|
-
if (!entry.Type || !entry.Id || !entry.ProjectRelativePath)
|
|
17426
|
-
continue;
|
|
17427
|
-
const projFilePath = fs.path.join(solutionDir, toPortableRelativePath(entry.ProjectRelativePath));
|
|
17428
|
-
const projectDir = fs.path.dirname(projFilePath);
|
|
17429
|
-
const name = await readUiprojName(projFilePath) ?? fs.path.basename(projectDir);
|
|
17430
|
-
projects.push({
|
|
17431
|
-
type: entry.Type,
|
|
17432
|
-
id: entry.Id,
|
|
17433
|
-
path: projectDir,
|
|
17434
|
-
name
|
|
17435
|
-
});
|
|
17436
|
-
}
|
|
17437
|
-
return projects;
|
|
17438
|
-
}
|
|
17439
|
-
async function readUiprojName(uiprojPath) {
|
|
17440
|
-
const fs = getFileSystem();
|
|
17441
|
-
const [readError, content] = await catchError(fs.readFile(uiprojPath));
|
|
17442
|
-
if (readError || !content)
|
|
17443
|
-
return;
|
|
17444
|
-
try {
|
|
17445
|
-
const parsed = JSON.parse(new TextDecoder().decode(content));
|
|
17446
|
-
return parsed.Name;
|
|
17447
|
-
} catch (err) {
|
|
17448
|
-
logger.warn(`Failed to parse ${uiprojPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
17449
|
-
return;
|
|
17450
|
-
}
|
|
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
|
-
}
|
|
17458
|
-
async function reconcileSolutionProjects(builder, solutionDir, projectSubTypes) {
|
|
17459
|
-
const fs = getFileSystem();
|
|
17460
|
-
const outcome = { projectsCount: 0, resourcesAdded: 0 };
|
|
17461
|
-
const uipxProjects = await readUipxProjects(solutionDir);
|
|
17462
|
-
const projectDetails = uipxProjects.flatMap((project) => {
|
|
17463
|
-
const reconcileType = mapUipxTypeToReconcileType(project.type);
|
|
17464
|
-
if (!reconcileType)
|
|
17465
|
-
return [];
|
|
17466
|
-
return [
|
|
17467
|
-
{
|
|
17468
|
-
projectKey: project.id,
|
|
17469
|
-
name: project.name,
|
|
17470
|
-
type: reconcileType,
|
|
17471
|
-
subType: projectSubTypes?.get(project.id)
|
|
17472
|
-
}
|
|
17473
|
-
];
|
|
17474
|
-
});
|
|
17475
|
-
if (projectDetails.length === 0)
|
|
17476
|
-
return outcome;
|
|
17477
|
-
const solutionName = fs.path.basename(solutionDir);
|
|
17478
|
-
const before = await snapshotResourceIdentities(builder);
|
|
17479
|
-
const [reconcileError] = await catchError(builder.reconcileProjectsAsync({
|
|
17480
|
-
solutionName,
|
|
17481
|
-
projects: projectDetails
|
|
17482
|
-
}));
|
|
17483
|
-
if (reconcileError) {
|
|
17484
|
-
logger.warn(`reconcileProjectsAsync failed: ${reconcileError.message}. Project artefacts may be missing.`);
|
|
17485
|
-
return outcome;
|
|
17486
|
-
}
|
|
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
|
-
}
|
|
17492
|
-
logger.info(`Reconciled ${projectDetails.length} .uipx project(s) in solution ${solutionName}`);
|
|
17493
|
-
return outcome;
|
|
17494
|
-
}
|
|
17495
|
-
async function findUipxFile(solutionDir) {
|
|
17496
|
-
const fs = getFileSystem();
|
|
17497
|
-
const entries = await fs.readdir(solutionDir);
|
|
17498
|
-
const uipxFile = entries.find((e) => e.endsWith(".uipx"));
|
|
17499
|
-
return uipxFile ? fs.path.join(solutionDir, uipxFile) : null;
|
|
17500
|
-
}
|
|
17501
|
-
function findBindingsSchemaError(content) {
|
|
17502
|
-
let parsed;
|
|
17503
|
-
try {
|
|
17504
|
-
parsed = JSON.parse(content);
|
|
17505
|
-
} catch {
|
|
17506
|
-
return "not valid JSON";
|
|
17507
|
-
}
|
|
17508
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
17509
|
-
return "expected a JSON object with a 'resources' array";
|
|
17510
|
-
}
|
|
17511
|
-
const resources = parsed.resources;
|
|
17512
|
-
if (resources === undefined) {
|
|
17513
|
-
return "missing the required 'resources' array";
|
|
17514
|
-
}
|
|
17515
|
-
if (!Array.isArray(resources)) {
|
|
17516
|
-
return "'resources' must be an array";
|
|
17517
|
-
}
|
|
17518
|
-
for (let i = 0;i < resources.length; i++) {
|
|
17519
|
-
const r = resources[i];
|
|
17520
|
-
if (!r || typeof r !== "object") {
|
|
17521
|
-
return `resource at index ${i} is not an object`;
|
|
17522
|
-
}
|
|
17523
|
-
const label = typeof r.name === "string" && r.name.length > 0 ? `'${r.name}'` : `at index ${i}`;
|
|
17524
|
-
if (typeof r.kind !== "string" || r.kind.length === 0) {
|
|
17525
|
-
return `resource ${label} is missing the required string field 'kind' (e.g. "kind": "Queue")`;
|
|
17526
|
-
}
|
|
17527
|
-
if (typeof r.name !== "string" || r.name.length === 0) {
|
|
17528
|
-
return `resource at index ${i} is missing the required string field 'name'`;
|
|
17529
|
-
}
|
|
17530
|
-
}
|
|
17531
|
-
return null;
|
|
17532
|
-
}
|
|
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) {
|
|
17558
|
-
const fs = getFileSystem();
|
|
17559
|
-
const allBindings = [];
|
|
17560
|
-
const parseErrors = [];
|
|
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
|
-
}
|
|
17575
|
-
const v2Path = fs.path.join(dir, "bindings_v2.json");
|
|
17576
|
-
let bindingsPath = v2Path;
|
|
17577
|
-
let exists = await fs.exists(v2Path);
|
|
17578
|
-
if (!exists && bindingsJsonFallbackDirs.has(dir)) {
|
|
17579
|
-
bindingsPath = fs.path.join(dir, "bindings.json");
|
|
17580
|
-
exists = await fs.exists(bindingsPath);
|
|
17581
|
-
}
|
|
17582
|
-
if (!exists) {
|
|
17583
|
-
continue;
|
|
17584
|
-
}
|
|
17585
|
-
const [readError, content] = await catchError(fs.readFile(bindingsPath));
|
|
17586
|
-
if (readError || !content) {
|
|
17587
|
-
parseErrors.push({
|
|
17588
|
-
path: bindingsPath,
|
|
17589
|
-
reason: readError?.message ?? "file exists but could not be read or is empty"
|
|
17590
|
-
});
|
|
17591
|
-
continue;
|
|
17592
|
-
}
|
|
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,
|
|
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})` : ""}`
|
|
17613
|
-
}
|
|
17614
|
-
};
|
|
17615
|
-
}
|
|
17616
|
-
if (!success) {
|
|
17617
|
-
return {
|
|
17618
|
-
error: {
|
|
17619
|
-
path: source,
|
|
17620
|
-
reason: findBindingsSchemaError(decoded) ?? "does not match the expected v2 bindings schema (the serializer rejected it)"
|
|
17621
|
-
}
|
|
17622
|
-
};
|
|
17623
|
-
}
|
|
17624
|
-
return { resources: metadata?.resources ?? [] };
|
|
17625
|
-
}
|
|
17626
|
-
async function syncAndLog(solutionDir, projectSubTypes, options) {
|
|
17627
|
-
const [syncError, syncResult] = await catchError(syncResourcesFromBindings(solutionDir, undefined, projectSubTypes, options?.projectBindings));
|
|
17628
|
-
if (syncError) {
|
|
17629
|
-
if (options?.failOnUnresolved)
|
|
17630
|
-
throw syncError;
|
|
17631
|
-
logger.warn(`Resource sync failed: ${syncError.message}. Continuing.`);
|
|
17632
|
-
return;
|
|
17633
|
-
}
|
|
17634
|
-
if (syncResult.created > 0 || syncResult.imported > 0 || syncResult.pruned > 0) {
|
|
17635
|
-
logger.info(`Synced resources: ${syncResult.created} created, ${syncResult.imported} imported, ${syncResult.skipped} skipped, ${syncResult.pruned} duplicates removed`);
|
|
17636
|
-
}
|
|
17637
|
-
for (const warning of syncResult.warnings) {
|
|
17638
|
-
logger.warn(warning);
|
|
17639
|
-
}
|
|
17640
|
-
if (options?.failOnUnresolved && syncResult.catalogLookupFailure && syncResult.unresolved.length > 0) {
|
|
17641
|
-
throw new CatalogLookupError(syncResult.catalogLookupFailure, syncResult.unresolved);
|
|
17642
|
-
}
|
|
17643
|
-
}
|
|
17644
|
-
|
|
17645
|
-
// ../solution-sdk/src/resources/services/resource-refresh-service.ts
|
|
17646
|
-
async function resourceRefreshAsync(solutionPath = ".", options = {}) {
|
|
17647
|
-
const fs = getFileSystem();
|
|
17648
|
-
const resolvedPath = fs.path.resolve(fs.env.cwd(), solutionPath);
|
|
17649
|
-
if (!await fs.exists(resolvedPath)) {
|
|
17650
|
-
return {
|
|
17651
|
-
ok: false,
|
|
17652
|
-
reason: "solution_not_found",
|
|
17653
|
-
message: `Solution directory not found: ${resolvedPath}`
|
|
17654
|
-
};
|
|
17655
|
-
}
|
|
17656
|
-
const [manifestError] = await catchError(assertSolutionManifest(resolvedPath));
|
|
17657
|
-
if (manifestError) {
|
|
17658
|
-
return {
|
|
17659
|
-
ok: false,
|
|
17660
|
-
reason: "not_a_solution",
|
|
17661
|
-
message: manifestError.message
|
|
17662
|
-
};
|
|
17663
|
-
}
|
|
17664
|
-
const [authError] = await catchError(getSolutionAuthContext({
|
|
17665
|
-
loginValidity: options.loginValidity,
|
|
17666
|
-
envFilePath: options.envFilePath
|
|
17667
|
-
}));
|
|
17668
|
-
if (authError) {
|
|
17669
|
-
return {
|
|
17670
|
-
ok: false,
|
|
17671
|
-
reason: "auth_failed",
|
|
17672
|
-
message: await extractErrorMessage(authError)
|
|
17673
|
-
};
|
|
17674
|
-
}
|
|
17675
|
-
const [subTypesError, projectSubTypes] = await catchError(options.resolveProjectSubTypesAsync?.() ?? Promise.resolve(new Map));
|
|
17676
|
-
const resolverWarnings = subTypesError ? [
|
|
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'.`
|
|
17678
|
-
] : [];
|
|
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));
|
|
17684
|
-
if (syncError) {
|
|
17685
|
-
return {
|
|
17686
|
-
ok: false,
|
|
17687
|
-
reason: "sync_failed",
|
|
17688
|
-
message: syncError.message
|
|
17689
|
-
};
|
|
17690
|
-
}
|
|
17691
|
-
return {
|
|
17692
|
-
ok: true,
|
|
17693
|
-
created: result.created,
|
|
17694
|
-
imported: result.imported,
|
|
17695
|
-
skipped: result.skipped,
|
|
17696
|
-
pruned: result.pruned,
|
|
17697
|
-
projectResourcesCreated: result.projectResourcesCreated,
|
|
17698
|
-
warnings: [...resolverWarnings, ...result.warnings]
|
|
17699
|
-
};
|
|
17700
|
-
}
|
|
17701
|
-
// ../solution-sdk/src/resources/services/resource-remote-sync.ts
|
|
17702
|
-
var NOT_FOUND_PATTERN = /not found/i;
|
|
17703
|
-
async function resourceRemoteSyncAsync(solutionPath = ".", resourceKey, options = {}) {
|
|
17704
|
-
const fs = getFileSystem();
|
|
17705
|
-
const resolvedPath = fs.path.resolve(fs.env.cwd(), solutionPath);
|
|
17706
|
-
if (!await fs.exists(resolvedPath)) {
|
|
17707
|
-
return {
|
|
17708
|
-
ok: false,
|
|
17709
|
-
reason: "solution_not_found",
|
|
17710
|
-
message: `Solution directory not found: ${resolvedPath}`
|
|
17711
|
-
};
|
|
17712
|
-
}
|
|
17713
|
-
const [manifestError] = await catchError(assertSolutionManifest(resolvedPath));
|
|
17714
|
-
if (manifestError) {
|
|
17715
|
-
return {
|
|
17716
|
-
ok: false,
|
|
17717
|
-
reason: "not_a_solution",
|
|
17718
|
-
message: manifestError.message
|
|
17719
|
-
};
|
|
17720
|
-
}
|
|
17721
|
-
const [authError] = await catchError(getSolutionAuthContext({
|
|
17722
|
-
loginValidity: options.loginValidity,
|
|
17723
|
-
envFilePath: options.envFilePath
|
|
17724
|
-
}));
|
|
17725
|
-
if (authError) {
|
|
17726
|
-
return {
|
|
17727
|
-
ok: false,
|
|
17728
|
-
reason: "auth_failed",
|
|
17729
|
-
message: await extractErrorMessage(authError)
|
|
17730
|
-
};
|
|
17731
|
-
}
|
|
17732
|
-
const [servicesError, services] = await catchError(createResourceBuilderServices());
|
|
17733
|
-
if (servicesError) {
|
|
17734
|
-
return {
|
|
17735
|
-
ok: false,
|
|
17736
|
-
reason: "sync_failed",
|
|
17737
|
-
message: servicesError.message
|
|
17738
|
-
};
|
|
17739
|
-
}
|
|
17740
|
-
await normalizeResourceFileCasing(resolvedPath);
|
|
17741
|
-
const [builderError, builder] = await catchError(services.getSolutionBuilder(resolvedPath, !options.force));
|
|
17742
|
-
if (builderError) {
|
|
17743
|
-
return {
|
|
17744
|
-
ok: false,
|
|
17745
|
-
reason: "sync_failed",
|
|
17746
|
-
message: builderError.message
|
|
17747
|
-
};
|
|
17748
|
-
}
|
|
17749
|
-
const [runError, result] = await catchError(runSyncAsync(builder, resourceKey, options));
|
|
17750
|
-
const disposeError = await saveCasingNormalized(builder);
|
|
17751
|
-
if (!disposeError) {
|
|
17752
|
-
await normalizeResourceFileCasing(resolvedPath);
|
|
17753
|
-
}
|
|
17754
|
-
if (runError) {
|
|
17755
|
-
return { ok: false, reason: "sync_failed", message: runError.message };
|
|
17756
|
-
}
|
|
17757
|
-
if (disposeError && result.ok && result.applied) {
|
|
17758
|
-
return {
|
|
17759
|
-
ok: false,
|
|
17760
|
-
reason: "save_failed",
|
|
17761
|
-
message: `Resource synced but the solution could not be saved: ${disposeError.message}`
|
|
17762
|
-
};
|
|
17763
|
-
}
|
|
17764
|
-
return result;
|
|
17765
|
-
}
|
|
17766
|
-
async function runSyncAsync(builder, resourceKey, options) {
|
|
17767
|
-
const [configError, before] = await catchError(builder.getConfigurationAsync(resourceKey));
|
|
17768
|
-
if (configError) {
|
|
17769
|
-
return {
|
|
17770
|
-
ok: false,
|
|
17771
|
-
reason: NOT_FOUND_PATTERN.test(configError.message) ? "resource_not_found" : "sync_failed",
|
|
17772
|
-
message: configError.message
|
|
17773
|
-
};
|
|
17774
|
-
}
|
|
17775
|
-
const [referenceError, reference] = await catchError(builder.getResourceDebugReferenceAsync(resourceKey));
|
|
17776
|
-
if (referenceError) {
|
|
17777
|
-
return {
|
|
17778
|
-
ok: false,
|
|
17779
|
-
reason: "sync_failed",
|
|
17780
|
-
message: referenceError.message
|
|
17781
|
-
};
|
|
17782
|
-
}
|
|
17783
|
-
if (!reference) {
|
|
17784
|
-
return {
|
|
17785
|
-
ok: false,
|
|
17786
|
-
reason: "no_remote_reference",
|
|
17787
|
-
message: `No cloud reference is recorded for resource ${resourceKey} in this solution, so there is nothing to sync from. Either the resource has no cloud counterpart at all (a '--source local' stub, or a project's own artefact resource), or it was imported by a different user or against a different tenant — the reference lives in userProfile/<your-user-id>/debug_overwrites.json and is not shared. In the second case, re-import it with 'uip solution resources add --source remote' to record the reference for your user.`
|
|
17788
|
-
};
|
|
17789
|
-
}
|
|
17790
|
-
const [cloudError, cloudSpec] = await catchError(readCloudSpecAsync(builder, resourceKey));
|
|
17791
|
-
if (cloudError) {
|
|
17792
|
-
return {
|
|
17793
|
-
ok: false,
|
|
17794
|
-
reason: "sync_failed",
|
|
17795
|
-
message: cloudError.message
|
|
17796
|
-
};
|
|
17797
|
-
}
|
|
17798
|
-
if (cloudSpec === undefined) {
|
|
17799
|
-
return {
|
|
17800
|
-
ok: false,
|
|
17801
|
-
reason: "comparison_unavailable",
|
|
17802
|
-
message: `The cloud definition for resource ${resourceKey} could not be read, so there is nothing to compare against. Check the resource still exists in the cloud, or that you still have access to its folder.`
|
|
17803
|
-
};
|
|
17804
|
-
}
|
|
17805
|
-
const localSpec = before.spec ?? {};
|
|
17806
|
-
if (!options.force) {
|
|
17807
|
-
return {
|
|
17808
|
-
ok: true,
|
|
17809
|
-
applied: false,
|
|
17810
|
-
key: resourceKey,
|
|
17811
|
-
changed: diffSpecKeys(localSpec, cloudSpec),
|
|
17812
|
-
skipped: [],
|
|
17813
|
-
spec: localSpec
|
|
17814
|
-
};
|
|
17815
|
-
}
|
|
17816
|
-
const [writeError, after] = await catchError(builder.updateConfigurationAsync(resourceKey, cloudSpec));
|
|
17817
|
-
if (writeError) {
|
|
17818
|
-
return {
|
|
17819
|
-
ok: false,
|
|
17820
|
-
reason: "sync_failed",
|
|
17821
|
-
message: writeError.message
|
|
17822
|
-
};
|
|
17823
|
-
}
|
|
17824
|
-
const afterSpec = after.spec ?? {};
|
|
17825
|
-
return {
|
|
17826
|
-
ok: true,
|
|
17827
|
-
applied: true,
|
|
17828
|
-
key: after.key ?? resourceKey,
|
|
17829
|
-
changed: diffSpecKeys(localSpec, afterSpec),
|
|
17830
|
-
skipped: diffSpecKeys(afterSpec, cloudSpec),
|
|
17831
|
-
spec: afterSpec
|
|
17832
|
-
};
|
|
17833
|
-
}
|
|
17834
|
-
async function readCloudSpecAsync(builder, resourceKey) {
|
|
17835
|
-
const comparison = await builder.getResourceConfigurationsComparisonAsync([
|
|
17836
|
-
resourceKey
|
|
17837
|
-
]);
|
|
17838
|
-
const wanted = resourceKey.toLowerCase();
|
|
17839
|
-
const pair = comparison.resources.find((r) => r.solutionResourceKey?.toLowerCase() === wanted);
|
|
17840
|
-
return pair?.fpsConfig?.spec ?? undefined;
|
|
17841
|
-
}
|
|
17842
|
-
function diffSpecKeys(before, after) {
|
|
17843
|
-
const keys = new Set([...Object.keys(before), ...Object.keys(after)]);
|
|
17844
|
-
const changed = [];
|
|
17845
|
-
for (const key of keys) {
|
|
17846
|
-
if (isEmpty(before[key]) && isEmpty(after[key])) {
|
|
17847
|
-
continue;
|
|
17848
|
-
}
|
|
17849
|
-
if (canonicalize(before[key]) !== canonicalize(after[key])) {
|
|
17850
|
-
changed.push(key);
|
|
17851
|
-
}
|
|
17852
|
-
}
|
|
17853
|
-
return changed.sort();
|
|
17854
|
-
}
|
|
17855
|
-
function canonicalize(value) {
|
|
17856
|
-
return JSON.stringify(sortKeysDeep(value) ?? null);
|
|
17857
|
-
}
|
|
17858
|
-
function isEmpty(value) {
|
|
17859
|
-
return value === null || value === undefined;
|
|
17860
|
-
}
|
|
17861
|
-
function sortKeysDeep(value) {
|
|
17862
|
-
if (Array.isArray(value)) {
|
|
17863
|
-
return value.map(sortKeysDeep);
|
|
17864
|
-
}
|
|
17865
|
-
if (isEmpty(value) || typeof value !== "object") {
|
|
17866
|
-
return value;
|
|
17867
|
-
}
|
|
17868
|
-
const source = value;
|
|
17869
|
-
const sorted = {};
|
|
17870
|
-
for (const key of Object.keys(source).sort()) {
|
|
17871
|
-
if (isEmpty(source[key])) {
|
|
17872
|
-
continue;
|
|
17873
|
-
}
|
|
17874
|
-
sorted[key] = sortKeysDeep(source[key]);
|
|
17875
|
-
}
|
|
17876
|
-
return sorted;
|
|
17877
|
-
}
|
|
17878
16059
|
export {
|
|
17879
|
-
|
|
17880
|
-
EntryPointSpecEnhancer,
|
|
17881
|
-
MAX_RESOURCE_NAME_LENGTH,
|
|
17882
|
-
ProjectManifestError,
|
|
17883
|
-
addProjectArtifactsToSolutionAsync,
|
|
17884
|
-
applyEntryPointEnhancementAsync,
|
|
17885
|
-
assertSolutionManifest,
|
|
17886
|
-
assertValidResourceName,
|
|
17887
|
-
computeEntryPointSpec,
|
|
17888
|
-
createLocalResource,
|
|
17889
|
-
createProjectInSolutionBuilder,
|
|
17890
|
-
createResourceBuilderServices,
|
|
17891
|
-
createResourceKindMetadataResolver,
|
|
17892
|
-
exportResourceConfigurationsAsync,
|
|
17893
|
-
exportResourceDefinitionAsync,
|
|
17894
|
-
findCatalogEntitiesAsync,
|
|
17895
|
-
findCatalogEntityAsync,
|
|
17896
|
-
findMatchingLocalResource,
|
|
17897
|
-
findMatchingMemberResource,
|
|
17898
|
-
findMemberCloneResources,
|
|
17899
|
-
findProjectFile,
|
|
17900
|
-
findResourceByKeyInRcs,
|
|
17901
|
-
findResourceInRcs,
|
|
17902
|
-
findResourcesByNameAsync,
|
|
17903
|
-
formatResourceSubtypes,
|
|
17904
|
-
getRemoteResourceClients,
|
|
17905
|
-
hasAnyTemplateRow,
|
|
17906
|
-
hasBareTemplateRow,
|
|
17907
|
-
isMissingProjectTypeError,
|
|
17908
|
-
isProjectManifestError,
|
|
17909
|
-
isResourceKeyNotFound,
|
|
17910
|
-
normalizeFolderPath,
|
|
17911
|
-
normalizeResourceCasing,
|
|
17912
|
-
normalizeResourceFileCasing,
|
|
17913
|
-
readProjectFile,
|
|
17914
|
-
readResourceConfigurationAsync,
|
|
17915
|
-
readResourceConfigurationsAsync,
|
|
17916
|
-
readSolutionFile,
|
|
17917
|
-
readSolutionManifest,
|
|
17918
|
-
readSpecEntryPoints,
|
|
17919
|
-
readSpecProperty,
|
|
17920
|
-
readUipxProjects,
|
|
17921
|
-
refreshArtefactSpecsAsync,
|
|
17922
|
-
resolveProjectDirFromManifest,
|
|
17923
|
-
resolveResourceKindMetadata,
|
|
17924
|
-
resolveSolutionFilePath,
|
|
17925
|
-
resourceRefreshAsync,
|
|
17926
|
-
resourceRemoteSyncAsync,
|
|
17927
|
-
restoreSolutionFile,
|
|
17928
|
-
sameResourceSubtype,
|
|
17929
|
-
saveCasingNormalized,
|
|
17930
|
-
searchRcsResources,
|
|
17931
|
-
searchRcsResourcesStrict,
|
|
17932
|
-
syncAndLog,
|
|
17933
|
-
syncResourcesFromBindings,
|
|
17934
|
-
toCatalogReference,
|
|
17935
|
-
toResourceReference,
|
|
17936
|
-
uniqueNameForResource,
|
|
17937
|
-
validateResourceName,
|
|
17938
|
-
writeSolutionFile
|
|
16060
|
+
addProjectArtifactsToSolutionAsync
|
|
17939
16061
|
};
|
|
17940
16062
|
|
|
17941
|
-
//# debugId=
|
|
16063
|
+
//# debugId=7D7DDBB7DF82859764756E2164756E21
|