@ui5/task-adaptation 1.0.15 → 1.0.17
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/CHANGELOG.md +8 -4
- package/README.md +1 -1
- package/dist/annotationManager.d.ts +32 -0
- package/dist/annotationManager.js +276 -0
- package/dist/appVariantManager.js +18 -32
- package/dist/baseAppManager.d.ts +8 -4
- package/dist/baseAppManager.js +37 -62
- package/dist/buildStrategy.js +3 -0
- package/dist/bundle-resourceBundle.js +692 -0
- package/dist/bundle.js +247 -106
- package/dist/cache/annotationsCacheManager.d.ts +8 -0
- package/dist/cache/annotationsCacheManager.js +18 -0
- package/dist/cache/baseAppFilesCacheManager.d.ts +6 -0
- package/dist/cache/baseAppFilesCacheManager.js +15 -0
- package/dist/cache/cacheManager.d.ts +16 -0
- package/dist/cache/cacheManager.js +67 -0
- package/dist/index.js +10 -18
- package/dist/model/noAuthorizationProvidedError.d.ts +3 -0
- package/dist/model/noAuthorizationProvidedError.js +9 -0
- package/dist/model/types.d.ts +13 -1
- package/dist/processors/abapProcessor.d.ts +21 -0
- package/dist/processors/abapProcessor.js +36 -0
- package/dist/processors/cfProcessor.d.ts +17 -0
- package/dist/processors/cfProcessor.js +46 -0
- package/dist/processors/processor.d.ts +7 -0
- package/dist/processors/processor.js +36 -0
- package/dist/repositories/abapRepoManager.d.ts +13 -0
- package/dist/repositories/abapRepoManager.js +81 -0
- package/dist/{html5RepoManager.d.ts → repositories/html5RepoManager.d.ts} +2 -2
- package/dist/repositories/html5RepoManager.js +89 -0
- package/dist/util/cfUtil.js +109 -138
- package/dist/util/commonUtil.js +1 -1
- package/dist/util/requestUtil.d.ts +6 -3
- package/dist/util/requestUtil.js +43 -24
- package/dist/util/resourceUtil.d.ts +2 -10
- package/dist/util/resourceUtil.js +6 -49
- package/dist/util/zipUtil.d.ts +2 -0
- package/dist/util/zipUtil.js +20 -0
- package/package.json +10 -5
- package/scripts/bundler.ts +75 -0
- package/scripts/rollup/bundleDefinition-resourceBundle.js +5 -0
- package/scripts/rollup/overrides/sap/base/i18n/Localization.js +1 -0
- package/scripts/rollup/overrides/sap/base/string/formatMessage.js +1 -0
- package/scripts/rollup/overrides/sap/base/util/Properties.js +1 -0
- package/scripts/rollup/overrides/sap/base/util/merge.js +1 -0
- package/scripts/rollup/project/ui5.yaml +1 -1
- package/scripts/rollup.ts +26 -50
- package/dist/html5RepoManager.js +0 -113
- package/dist/updateCache.d.ts +0 -5
- package/dist/updateCache.js +0 -36
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//1.
|
|
1
|
+
//1.115.0
|
|
2
2
|
var window = {};
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -15,42 +15,31 @@ function _interopNamespace(e) {
|
|
|
15
15
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
16
|
Object.defineProperty(n, k, d.get ? d : {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return e[k];
|
|
20
|
-
}
|
|
18
|
+
get: function () { return e[k]; }
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
|
-
n[
|
|
23
|
+
n["default"] = e;
|
|
26
24
|
return Object.freeze(n);
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
30
28
|
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Change.prototype.getChangeType = function () {
|
|
35
|
-
if (this._oDefinition) {
|
|
36
|
-
return this._oDefinition.flexObjectMetadata ? this._oDefinition.flexObjectMetadata.changeType : this._oDefinition.changeType;
|
|
29
|
+
var fnIsEmptyObject = function isEmptyObject(obj) {
|
|
30
|
+
for (var sName in obj) {
|
|
31
|
+
return false;
|
|
37
32
|
}
|
|
33
|
+
return true;
|
|
38
34
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
Change.prototype.getContent = function () {
|
|
43
|
-
return this._oDefinition.content;
|
|
44
|
-
};
|
|
45
|
-
Change.prototype.getTexts = function () {
|
|
46
|
-
return this._oDefinition.texts;
|
|
47
|
-
};
|
|
35
|
+
|
|
36
|
+
var FlexObjectFactory = function () {};
|
|
48
37
|
|
|
49
38
|
var CHANGES_NAMESPACE = "$sap.ui.fl.changes";
|
|
50
39
|
function getDescriptorChanges(oManifest) {
|
|
51
40
|
var aAppDescriptorChangesRaw = oManifest && oManifest.getEntry && oManifest.getEntry(CHANGES_NAMESPACE) && oManifest.getEntry(CHANGES_NAMESPACE).descriptor || [];
|
|
52
41
|
return aAppDescriptorChangesRaw.map(function (oChange) {
|
|
53
|
-
return
|
|
42
|
+
return FlexObjectFactory.createAppDescriptorChange(oChange);
|
|
54
43
|
});
|
|
55
44
|
}
|
|
56
45
|
var Applier = {
|
|
@@ -65,7 +54,7 @@ var Applier = {
|
|
|
65
54
|
try {
|
|
66
55
|
var oChange = aAppDescriptorChanges[iIndex];
|
|
67
56
|
oUpdatedManifest = oChangeHandler.applyChange(oUpdatedManifest, oChange);
|
|
68
|
-
if (!oChangeHandler.skipPostprocessing && oChange.getTexts()) {
|
|
57
|
+
if (!oChangeHandler.skipPostprocessing && !fnIsEmptyObject(oChange.getTexts())) {
|
|
69
58
|
oUpdatedManifest = mStrategy.processTexts(oUpdatedManifest, oChange.getTexts());
|
|
70
59
|
}
|
|
71
60
|
} catch (oError) {
|
|
@@ -113,6 +102,24 @@ var ApplyUtil = {
|
|
|
113
102
|
}
|
|
114
103
|
};
|
|
115
104
|
|
|
105
|
+
var Change = function (oFile) {
|
|
106
|
+
this._oDefinition = oFile;
|
|
107
|
+
};
|
|
108
|
+
Change.prototype.getChangeType = function () {
|
|
109
|
+
if (this._oDefinition) {
|
|
110
|
+
return this._oDefinition.flexObjectMetadata ? this._oDefinition.flexObjectMetadata.changeType : this._oDefinition.changeType;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
Change.prototype.getLayer = function () {
|
|
114
|
+
return this._oDefinition.layer;
|
|
115
|
+
};
|
|
116
|
+
Change.prototype.getContent = function () {
|
|
117
|
+
return this._oDefinition.content;
|
|
118
|
+
};
|
|
119
|
+
Change.prototype.getTexts = function () {
|
|
120
|
+
return this._oDefinition.texts;
|
|
121
|
+
};
|
|
122
|
+
|
|
116
123
|
var ObjectPath = {};
|
|
117
124
|
var defaultRootContext = window;
|
|
118
125
|
function getObjectPathArray(vObjectPath) {
|
|
@@ -209,6 +216,25 @@ function checkChange(oEntityPropertyChange, aSupportedProperties, aSupportedOper
|
|
|
209
216
|
formatEntityCheck(oEntityPropertyChange, aSupportedProperties, aSupportedOperations);
|
|
210
217
|
}
|
|
211
218
|
}
|
|
219
|
+
function getClearedGenericPath(aSupportedProperties) {
|
|
220
|
+
var aPropertiesClearedGenericPath = [];
|
|
221
|
+
var aPropertiesWithGenericPath = aSupportedProperties.filter(function (sProperty) {
|
|
222
|
+
return sProperty.endsWith("/*");
|
|
223
|
+
});
|
|
224
|
+
aPropertiesWithGenericPath.forEach(function (sProperty) {
|
|
225
|
+
var sClearedProperty = sProperty.replaceAll("/*", "");
|
|
226
|
+
if (sClearedProperty) {
|
|
227
|
+
aPropertiesClearedGenericPath.push(sClearedProperty);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
return aPropertiesClearedGenericPath;
|
|
231
|
+
}
|
|
232
|
+
function isGenericPropertyPathSupported(aSupportedProperties, sPropertyPath) {
|
|
233
|
+
var aClearedGenericPath = getClearedGenericPath(aSupportedProperties);
|
|
234
|
+
return aClearedGenericPath.some(function (path) {
|
|
235
|
+
return sPropertyPath.startsWith(path);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
212
238
|
function formatEntityCheck(oChangeEntity, aSupportedProperties, aSupportedOperations) {
|
|
213
239
|
if (!oChangeEntity.propertyPath) {
|
|
214
240
|
throw new Error("Invalid change format: The mandatory 'propertyPath' is not defined. Please define the mandatory property 'propertyPath'");
|
|
@@ -216,10 +242,12 @@ function formatEntityCheck(oChangeEntity, aSupportedProperties, aSupportedOperat
|
|
|
216
242
|
if (!oChangeEntity.operation) {
|
|
217
243
|
throw new Error("Invalid change format: The mandatory 'operation' is not defined. Please define the mandatory property 'operation'");
|
|
218
244
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
245
|
+
if (oChangeEntity.operation.toUpperCase() !== "DELETE") {
|
|
246
|
+
if (!oChangeEntity.hasOwnProperty("propertyValue")) {
|
|
247
|
+
throw new Error("Invalid change format: The mandatory 'propertyValue' is not defined. Please define the mandatory property 'propertyValue'");
|
|
248
|
+
}
|
|
221
249
|
}
|
|
222
|
-
if (!fnIncludes(aSupportedProperties, oChangeEntity.propertyPath)) {
|
|
250
|
+
if (!fnIncludes(aSupportedProperties, oChangeEntity.propertyPath) && !isGenericPropertyPathSupported(aSupportedProperties, oChangeEntity.propertyPath)) {
|
|
223
251
|
throw new Error("Changing " + oChangeEntity.propertyPath + " is not supported. The supported 'propertyPath' is: " + aSupportedProperties.join("|"));
|
|
224
252
|
}
|
|
225
253
|
if (!fnIncludes(aSupportedOperations, oChangeEntity.operation)) {
|
|
@@ -269,12 +297,14 @@ function getNamespacePrefixForLayer(sLayer) {
|
|
|
269
297
|
var DescriptorChangeCheck = {
|
|
270
298
|
checkEntityPropertyChange: checkEntityPropertyChange,
|
|
271
299
|
checkIdNamespaceCompliance: checkIdNamespaceCompliance,
|
|
272
|
-
getNamespacePrefixForLayer: getNamespacePrefixForLayer
|
|
300
|
+
getNamespacePrefixForLayer: getNamespacePrefixForLayer,
|
|
301
|
+
getClearedGenericPath: getClearedGenericPath,
|
|
302
|
+
isGenericPropertyPathSupported: isGenericPropertyPathSupported
|
|
273
303
|
};
|
|
274
304
|
|
|
275
305
|
var SUPPORTED_OPERATIONS$1 = ["UPDATE", "UPSERT"];
|
|
276
306
|
var SUPPORTED_PROPERTIES$1 = ["uri", "settings/maxAge"];
|
|
277
|
-
var
|
|
307
|
+
var ChangeDataSource = {
|
|
278
308
|
applyChange: function (oManifest, oChange) {
|
|
279
309
|
var oDataSources = oManifest["sap.app"].dataSources;
|
|
280
310
|
var oChangeContent = oChange.getContent();
|
|
@@ -446,7 +476,7 @@ function mergeChange(oManifestContent, oChangeContent, sErrorMessage) {
|
|
|
446
476
|
});
|
|
447
477
|
}
|
|
448
478
|
}
|
|
449
|
-
function merge$
|
|
479
|
+
function merge$2(oManifest, oChange, sRootPath, sChildPath, sModelPath) {
|
|
450
480
|
if (!oManifest[sRootPath][sChildPath]) {
|
|
451
481
|
oManifest[sRootPath][sChildPath] = {};
|
|
452
482
|
}
|
|
@@ -505,8 +535,8 @@ var AddNewModel = {
|
|
|
505
535
|
}
|
|
506
536
|
});
|
|
507
537
|
}
|
|
508
|
-
merge$
|
|
509
|
-
merge$
|
|
538
|
+
merge$2(oManifest, oChange, "sap.ui5", "models", "model");
|
|
539
|
+
merge$2(oManifest, oChange, "sap.app", "dataSources", "dataSource");
|
|
510
540
|
return oManifest;
|
|
511
541
|
}
|
|
512
542
|
};
|
|
@@ -575,7 +605,7 @@ function checkingAnnotationDataSource(oChangeDataSource, aChangeAnnotations, oCh
|
|
|
575
605
|
throw new Error("Invalid change format: The mandatory 'dataSource' object is not defined. Please define the mandatory 'dataSource' object");
|
|
576
606
|
}
|
|
577
607
|
}
|
|
578
|
-
function merge(oManifestDataSources, sChangeDataSourceId, aChangeAnnotations, sChangeAnnotationsInsertPosition, oChangeDataSource) {
|
|
608
|
+
function merge$1(oManifestDataSources, sChangeDataSourceId, aChangeAnnotations, sChangeAnnotationsInsertPosition, oChangeDataSource) {
|
|
579
609
|
mergeAnnotationArray(oManifestDataSources[sChangeDataSourceId], aChangeAnnotations, sChangeAnnotationsInsertPosition);
|
|
580
610
|
mergeAnnotationDataSources(oManifestDataSources, oChangeDataSource);
|
|
581
611
|
}
|
|
@@ -617,13 +647,49 @@ var AddAnnotationsToOData = {
|
|
|
617
647
|
checkingAnnotationsInsertPosition(sChangeAnnotationsInsertPosition);
|
|
618
648
|
checkingAnnotationDataSource(oChangeDataSource, aChangeAnnotations, oChange);
|
|
619
649
|
postChecks(oManifest["sap.app"]["dataSources"], oChangeDataSource, aChangeAnnotations);
|
|
620
|
-
merge(oManifest["sap.app"]["dataSources"], sChangeDataSourceId, aChangeAnnotations, sChangeAnnotationsInsertPosition, oChangeDataSource);
|
|
650
|
+
merge$1(oManifest["sap.app"]["dataSources"], sChangeDataSourceId, aChangeAnnotations, sChangeAnnotationsInsertPosition, oChangeDataSource);
|
|
651
|
+
return oManifest;
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
function checkManifestPath(oManifest) {
|
|
656
|
+
if (!oManifest["sap.app"].hasOwnProperty("crossNavigation")) {
|
|
657
|
+
throw new Error("No sap.app/crossNavigation path exists in the manifest");
|
|
658
|
+
}
|
|
659
|
+
if (!oManifest["sap.app"]["crossNavigation"].hasOwnProperty("inbounds")) {
|
|
660
|
+
throw new Error("No sap.app/crossNavigation/inbounds path exists in the manifest");
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function getAndCheckInboundId$1(oChangeContent) {
|
|
664
|
+
var sInbounds = oChangeContent["inboundId"];
|
|
665
|
+
if (sInbounds === "") {
|
|
666
|
+
throw new Error("The ID of your inbound is empty");
|
|
667
|
+
}
|
|
668
|
+
if (typeof sInbounds !== "string") {
|
|
669
|
+
throw new Error("The type of your inbound ID must be string");
|
|
670
|
+
}
|
|
671
|
+
return sInbounds;
|
|
672
|
+
}
|
|
673
|
+
function merge(oManifest, sInboundId) {
|
|
674
|
+
var oInbound = {};
|
|
675
|
+
oInbound[sInboundId] = oManifest["sap.app"]["crossNavigation"]["inbounds"][sInboundId];
|
|
676
|
+
oManifest["sap.app"]["crossNavigation"]["inbounds"] = oInbound;
|
|
677
|
+
}
|
|
678
|
+
var RemoveAllInboundsExceptOne = {
|
|
679
|
+
applyChange: function (oManifest, oChange) {
|
|
680
|
+
checkManifestPath(oManifest);
|
|
681
|
+
var sInboundId = getAndCheckInboundId$1(oChange.getContent());
|
|
682
|
+
if (oManifest["sap.app"]["crossNavigation"]["inbounds"][sInboundId]) {
|
|
683
|
+
merge(oManifest, sInboundId);
|
|
684
|
+
} else {
|
|
685
|
+
throw new Error("No inbound exists with the ID \"" + sInboundId + "\" in sap.app/crossNavigation/inbounds");
|
|
686
|
+
}
|
|
621
687
|
return oManifest;
|
|
622
688
|
}
|
|
623
689
|
};
|
|
624
690
|
|
|
625
691
|
var SUPPORTED_OPERATIONS = ["UPDATE", "UPSERT"];
|
|
626
|
-
var SUPPORTED_PROPERTIES = ["title", "subTitle", "icon"];
|
|
692
|
+
var SUPPORTED_PROPERTIES = ["title", "subTitle", "icon", "signature/parameters/*"];
|
|
627
693
|
var ChangeInbound = {
|
|
628
694
|
applyChange: function (oManifest, oChange) {
|
|
629
695
|
var oCrossNavigation = oManifest["sap.app"].crossNavigation;
|
|
@@ -643,6 +709,40 @@ var ChangeInbound = {
|
|
|
643
709
|
}
|
|
644
710
|
};
|
|
645
711
|
|
|
712
|
+
function getAndCheckInboundId(oChangeContent) {
|
|
713
|
+
var aInbounds = Object.keys(oChangeContent["inbound"]);
|
|
714
|
+
if (aInbounds.length > 1) {
|
|
715
|
+
throw new Error("It is not allowed to add more than one inbound");
|
|
716
|
+
}
|
|
717
|
+
if (aInbounds.length < 1) {
|
|
718
|
+
throw new Error("Inbound does not exist");
|
|
719
|
+
}
|
|
720
|
+
if (aInbounds[0] === "") {
|
|
721
|
+
throw new Error("The ID of your inbound is empty");
|
|
722
|
+
}
|
|
723
|
+
return aInbounds[aInbounds.length - 1];
|
|
724
|
+
}
|
|
725
|
+
var AddNewInbound = {
|
|
726
|
+
applyChange: function (oManifest, oChange) {
|
|
727
|
+
if (!oManifest["sap.app"]["crossNavigation"]) {
|
|
728
|
+
oManifest["sap.app"]["crossNavigation"] = {};
|
|
729
|
+
}
|
|
730
|
+
if (!oManifest["sap.app"]["crossNavigation"]["inbounds"]) {
|
|
731
|
+
oManifest["sap.app"]["crossNavigation"]["inbounds"] = {};
|
|
732
|
+
}
|
|
733
|
+
var oChangeContent = oChange.getContent();
|
|
734
|
+
var sInboundId = getAndCheckInboundId(oChangeContent);
|
|
735
|
+
var oInboundInManifest = oManifest["sap.app"]["crossNavigation"]["inbounds"][sInboundId];
|
|
736
|
+
if (!oInboundInManifest) {
|
|
737
|
+
DescriptorChangeCheck.checkIdNamespaceCompliance(sInboundId, oChange);
|
|
738
|
+
oManifest["sap.app"]["crossNavigation"]["inbounds"][sInboundId] = oChangeContent["inbound"][sInboundId];
|
|
739
|
+
} else {
|
|
740
|
+
throw new Error("Inbound with ID \"" + sInboundId + "\" already exist.");
|
|
741
|
+
}
|
|
742
|
+
return oManifest;
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
|
|
646
746
|
var SetAbstract = {
|
|
647
747
|
applyChange: function (oManifest, oChange) {
|
|
648
748
|
if (!oChange.getContent().hasOwnProperty("abstract")) {
|
|
@@ -764,7 +864,7 @@ Log.Level = {
|
|
|
764
864
|
TRACE: 5,
|
|
765
865
|
ALL: 5 + 1
|
|
766
866
|
};
|
|
767
|
-
var
|
|
867
|
+
var aLog = [], mMaxLevel = {
|
|
768
868
|
"": Log.Level.ERROR
|
|
769
869
|
}, iLogEntriesLimit = 3000, oListener = null, bLogSupportInfo = false;
|
|
770
870
|
function pad0(i, w) {
|
|
@@ -828,26 +928,26 @@ function getLogEntryListenerInstance() {
|
|
|
828
928
|
}
|
|
829
929
|
return oListener;
|
|
830
930
|
}
|
|
831
|
-
Log.fatal = function (sMessage,
|
|
832
|
-
log(Log.Level.FATAL, sMessage,
|
|
931
|
+
Log.fatal = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
932
|
+
log(Log.Level.FATAL, sMessage, vDetails, sComponent, fnSupportInfo);
|
|
833
933
|
};
|
|
834
|
-
Log.error = function (sMessage,
|
|
835
|
-
log(Log.Level.ERROR, sMessage,
|
|
934
|
+
Log.error = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
935
|
+
log(Log.Level.ERROR, sMessage, vDetails, sComponent, fnSupportInfo);
|
|
836
936
|
};
|
|
837
|
-
Log.warning = function (sMessage,
|
|
838
|
-
log(Log.Level.WARNING, sMessage,
|
|
937
|
+
Log.warning = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
938
|
+
log(Log.Level.WARNING, sMessage, vDetails, sComponent, fnSupportInfo);
|
|
839
939
|
};
|
|
840
|
-
Log.info = function (sMessage,
|
|
841
|
-
log(Log.Level.INFO, sMessage,
|
|
940
|
+
Log.info = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
941
|
+
log(Log.Level.INFO, sMessage, vDetails, sComponent, fnSupportInfo);
|
|
842
942
|
};
|
|
843
|
-
Log.debug = function (sMessage,
|
|
844
|
-
log(Log.Level.DEBUG, sMessage,
|
|
943
|
+
Log.debug = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
944
|
+
log(Log.Level.DEBUG, sMessage, vDetails, sComponent, fnSupportInfo);
|
|
845
945
|
};
|
|
846
|
-
Log.trace = function (sMessage,
|
|
847
|
-
log(Log.Level.TRACE, sMessage,
|
|
946
|
+
Log.trace = function (sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
947
|
+
log(Log.Level.TRACE, sMessage, vDetails, sComponent, fnSupportInfo);
|
|
848
948
|
};
|
|
849
949
|
Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
|
|
850
|
-
sComponent = sComponent ||
|
|
950
|
+
sComponent = sComponent || "";
|
|
851
951
|
if (!_bDefault || mMaxLevel[sComponent] == null) {
|
|
852
952
|
mMaxLevel[sComponent] = iLogLevel;
|
|
853
953
|
var sLogLevel;
|
|
@@ -860,24 +960,23 @@ Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
|
|
|
860
960
|
}
|
|
861
961
|
};
|
|
862
962
|
Log.getLevel = function (sComponent) {
|
|
863
|
-
return level(sComponent
|
|
963
|
+
return level(sComponent);
|
|
864
964
|
};
|
|
865
965
|
Log.isLoggable = function (iLevel, sComponent) {
|
|
866
|
-
return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent
|
|
966
|
+
return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent);
|
|
867
967
|
};
|
|
868
968
|
Log.logSupportInfo = function (bEnabled) {
|
|
869
969
|
bLogSupportInfo = bEnabled;
|
|
870
970
|
};
|
|
871
|
-
function log(iLevel, sMessage,
|
|
872
|
-
if (!fnSupportInfo && !sComponent && typeof
|
|
873
|
-
fnSupportInfo =
|
|
874
|
-
|
|
971
|
+
function log(iLevel, sMessage, vDetails, sComponent, fnSupportInfo) {
|
|
972
|
+
if (!fnSupportInfo && !sComponent && typeof vDetails === "function") {
|
|
973
|
+
fnSupportInfo = vDetails;
|
|
974
|
+
vDetails = "";
|
|
875
975
|
}
|
|
876
976
|
if (!fnSupportInfo && typeof sComponent === "function") {
|
|
877
977
|
fnSupportInfo = sComponent;
|
|
878
978
|
sComponent = "";
|
|
879
979
|
}
|
|
880
|
-
sComponent = sComponent || sDefaultComponent;
|
|
881
980
|
if (iLevel <= level(sComponent)) {
|
|
882
981
|
var fNow = fnNow(), oNow = new Date(fNow), iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000), oLogEntry = {
|
|
883
982
|
time: pad0(oNow.getHours(), 2) + ":" + pad0(oNow.getMinutes(), 2) + ":" + pad0(oNow.getSeconds(), 2) + "." + pad0(oNow.getMilliseconds(), 3) + pad0(iMicroSeconds, 3),
|
|
@@ -885,7 +984,7 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
|
|
|
885
984
|
timestamp: fNow,
|
|
886
985
|
level: iLevel,
|
|
887
986
|
message: String(sMessage || ""),
|
|
888
|
-
details: String(
|
|
987
|
+
details: String(vDetails || ""),
|
|
889
988
|
component: String(sComponent || "")
|
|
890
989
|
};
|
|
891
990
|
if (bLogSupportInfo && typeof fnSupportInfo === "function") {
|
|
@@ -901,27 +1000,27 @@ function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
|
|
|
901
1000
|
oListener.onLogEntry(oLogEntry);
|
|
902
1001
|
}
|
|
903
1002
|
if (console) {
|
|
904
|
-
var isDetailsError =
|
|
1003
|
+
var isDetailsError = vDetails instanceof Error, logText = oLogEntry.date + " " + oLogEntry.time + " " + oLogEntry.message + " - " + oLogEntry.details + " " + oLogEntry.component;
|
|
905
1004
|
switch (iLevel) {
|
|
906
1005
|
case Log.Level.FATAL:
|
|
907
1006
|
case Log.Level.ERROR:
|
|
908
|
-
isDetailsError ? console.error(logText, "\n",
|
|
1007
|
+
isDetailsError ? console.error(logText, "\n", vDetails) : console.error(logText);
|
|
909
1008
|
break;
|
|
910
1009
|
case Log.Level.WARNING:
|
|
911
|
-
isDetailsError ? console.warn(logText, "\n",
|
|
1010
|
+
isDetailsError ? console.warn(logText, "\n", vDetails) : console.warn(logText);
|
|
912
1011
|
break;
|
|
913
1012
|
case Log.Level.INFO:
|
|
914
1013
|
if (console.info) {
|
|
915
|
-
isDetailsError ? console.info(logText, "\n",
|
|
1014
|
+
isDetailsError ? console.info(logText, "\n", vDetails) : console.info(logText);
|
|
916
1015
|
} else {
|
|
917
|
-
isDetailsError ? console.log(logText, "\n",
|
|
1016
|
+
isDetailsError ? console.log(logText, "\n", vDetails) : console.log(logText);
|
|
918
1017
|
}
|
|
919
1018
|
break;
|
|
920
1019
|
case Log.Level.DEBUG:
|
|
921
|
-
isDetailsError ? console.debug(logText, "\n",
|
|
1020
|
+
isDetailsError ? console.debug(logText, "\n", vDetails) : console.debug(logText);
|
|
922
1021
|
break;
|
|
923
1022
|
case Log.Level.TRACE:
|
|
924
|
-
isDetailsError ? console.trace(logText, "\n",
|
|
1023
|
+
isDetailsError ? console.trace(logText, "\n", vDetails) : console.trace(logText);
|
|
925
1024
|
break;
|
|
926
1025
|
}
|
|
927
1026
|
if (console.info && oLogEntry.supportInfo) {
|
|
@@ -1013,6 +1112,9 @@ var fnUniqueSort = function (aArray) {
|
|
|
1013
1112
|
return aArray;
|
|
1014
1113
|
};
|
|
1015
1114
|
|
|
1115
|
+
function isFunction(obj) {
|
|
1116
|
+
return typeof obj === "function";
|
|
1117
|
+
}
|
|
1016
1118
|
var Metadata = function (sClassName, oClassInfo) {
|
|
1017
1119
|
fnAssert(typeof sClassName === "string" && sClassName, "Metadata: sClassName must be a non-empty string");
|
|
1018
1120
|
fnAssert(typeof oClassInfo === "object", "Metadata: oClassInfo must be empty or an object");
|
|
@@ -1024,7 +1126,7 @@ var Metadata = function (sClassName, oClassInfo) {
|
|
|
1024
1126
|
oClassInfo.metadata.__version = 1;
|
|
1025
1127
|
}
|
|
1026
1128
|
oClassInfo.metadata.__version = oClassInfo.metadata.__version || 2;
|
|
1027
|
-
if (
|
|
1129
|
+
if (!isFunction(oClassInfo.constructor)) {
|
|
1028
1130
|
throw Error("constructor for class " + sClassName + " must have been declared before creating metadata for it");
|
|
1029
1131
|
}
|
|
1030
1132
|
this._sClassName = sClassName;
|
|
@@ -1038,9 +1140,17 @@ Metadata.prototype.extend = function (oClassInfo) {
|
|
|
1038
1140
|
Metadata.prototype.applySettings = function (oClassInfo) {
|
|
1039
1141
|
var that = this, oStaticInfo = oClassInfo.metadata, oPrototype;
|
|
1040
1142
|
if (oStaticInfo.baseType) {
|
|
1041
|
-
var oParentClass
|
|
1042
|
-
if (
|
|
1043
|
-
|
|
1143
|
+
var oParentClass;
|
|
1144
|
+
if (isFunction(oStaticInfo.baseType)) {
|
|
1145
|
+
oParentClass = oStaticInfo.baseType;
|
|
1146
|
+
if (!isFunction(oParentClass.getMetadata)) {
|
|
1147
|
+
throw new TypeError("baseType must be a UI5 class with a static getMetadata function");
|
|
1148
|
+
}
|
|
1149
|
+
} else {
|
|
1150
|
+
oParentClass = ObjectPath.get(oStaticInfo.baseType);
|
|
1151
|
+
if (!isFunction(oParentClass)) {
|
|
1152
|
+
Log.fatal("base class '" + oStaticInfo.baseType + "' does not exist");
|
|
1153
|
+
}
|
|
1044
1154
|
}
|
|
1045
1155
|
if (oParentClass.getMetadata) {
|
|
1046
1156
|
this._oParent = oParentClass.getMetadata();
|
|
@@ -1178,12 +1288,12 @@ Metadata.createClass = function (fnBaseClass, sClassName, oClassInfo, FNMetaImpl
|
|
|
1178
1288
|
sClassName = fnBaseClass;
|
|
1179
1289
|
fnBaseClass = null;
|
|
1180
1290
|
}
|
|
1181
|
-
fnAssert(!fnBaseClass ||
|
|
1291
|
+
fnAssert(!fnBaseClass || isFunction(fnBaseClass));
|
|
1182
1292
|
fnAssert(typeof sClassName === "string" && !!sClassName);
|
|
1183
1293
|
fnAssert(!oClassInfo || typeof oClassInfo === "object");
|
|
1184
|
-
fnAssert(!FNMetaImpl ||
|
|
1294
|
+
fnAssert(!FNMetaImpl || isFunction(FNMetaImpl));
|
|
1185
1295
|
FNMetaImpl = FNMetaImpl || Metadata;
|
|
1186
|
-
if (
|
|
1296
|
+
if (isFunction(FNMetaImpl.preprocessClassInfo)) {
|
|
1187
1297
|
oClassInfo = FNMetaImpl.preprocessClassInfo(oClassInfo);
|
|
1188
1298
|
}
|
|
1189
1299
|
oClassInfo = oClassInfo || ({});
|
|
@@ -1192,7 +1302,7 @@ Metadata.createClass = function (fnBaseClass, sClassName, oClassInfo, FNMetaImpl
|
|
|
1192
1302
|
oClassInfo.constructor = undefined;
|
|
1193
1303
|
}
|
|
1194
1304
|
var fnClass = oClassInfo.constructor;
|
|
1195
|
-
fnAssert(!fnClass ||
|
|
1305
|
+
fnAssert(!fnClass || isFunction(fnClass));
|
|
1196
1306
|
if (fnBaseClass) {
|
|
1197
1307
|
if (!fnClass) {
|
|
1198
1308
|
if (oClassInfo.metadata.deprecated) {
|
|
@@ -1208,7 +1318,7 @@ Metadata.createClass = function (fnBaseClass, sClassName, oClassInfo, FNMetaImpl
|
|
|
1208
1318
|
}
|
|
1209
1319
|
fnClass.prototype = Object.create(fnBaseClass.prototype);
|
|
1210
1320
|
fnClass.prototype.constructor = fnClass;
|
|
1211
|
-
oClassInfo.metadata.baseType = fnBaseClass
|
|
1321
|
+
oClassInfo.metadata.baseType = fnBaseClass;
|
|
1212
1322
|
} else {
|
|
1213
1323
|
fnClass = fnClass || (function () {});
|
|
1214
1324
|
delete oClassInfo.metadata.baseType;
|
|
@@ -1507,47 +1617,76 @@ var changePageConfiguration = {
|
|
|
1507
1617
|
}
|
|
1508
1618
|
};
|
|
1509
1619
|
|
|
1510
|
-
var
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
var propertyChange = changeContent === null || changeContent === void 0 ? void 0 : changeContent.entityPropertyChange;
|
|
1518
|
-
if ((propertyChange === null || propertyChange === void 0 ? void 0 : propertyChange.operation) !== "UPSERT" || !(propertyChange !== null && propertyChange !== void 0 && propertyChange.propertyPath) || (propertyChange === null || propertyChange === void 0 ? void 0 : propertyChange.propertyValue) === undefined || propertyChange !== null && propertyChange !== void 0 && propertyChange.propertyPath.startsWith("/")) {
|
|
1620
|
+
var o = {};
|
|
1621
|
+
let e = {};
|
|
1622
|
+
function i(n, o) {
|
|
1623
|
+
const e = o.getContent();
|
|
1624
|
+
const i = e === null || e === void 0 ? void 0 : e.page;
|
|
1625
|
+
const a = e === null || e === void 0 ? void 0 : e.entityPropertyChange;
|
|
1626
|
+
if ((a === null || a === void 0 ? void 0 : a.operation) !== "UPSERT" || !(a !== null && a !== void 0 && a.propertyPath) || (a === null || a === void 0 ? void 0 : a.propertyValue) === undefined || a !== null && a !== void 0 && a.propertyPath.startsWith("/")) {
|
|
1519
1627
|
Log.error("Change content is not a valid");
|
|
1520
|
-
return
|
|
1521
|
-
}
|
|
1522
|
-
for (var p in targets) {
|
|
1523
|
-
if (targets[p].id === pageID) {
|
|
1524
|
-
var _targets$p$name;
|
|
1525
|
-
if ((_targets$p$name = targets[p].name) !== null && _targets$p$name !== void 0 && _targets$p$name.startsWith("sap.fe.templates.")) {
|
|
1526
|
-
var _targets$p, _targets$p$options;
|
|
1527
|
-
pageSettings = ((_targets$p = targets[p]) === null || _targets$p === void 0 ? void 0 : (_targets$p$options = _targets$p.options) === null || _targets$p$options === void 0 ? void 0 : _targets$p$options.settings) || ({});
|
|
1528
|
-
break;
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1628
|
+
return n;
|
|
1531
1629
|
}
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1630
|
+
return r(n, i, a.propertyPath, a.propertyValue);
|
|
1631
|
+
}
|
|
1632
|
+
o.applyChange = i;
|
|
1633
|
+
function r(o, i, r, l, u) {
|
|
1634
|
+
const c = s(o, i);
|
|
1635
|
+
if (c) {
|
|
1636
|
+
const t = a(r);
|
|
1637
|
+
ObjectPath.set(t, l, c);
|
|
1638
|
+
if (u) {
|
|
1639
|
+
e[i] = e[i] || [];
|
|
1640
|
+
e[i].push(r);
|
|
1641
|
+
}
|
|
1642
|
+
} else {
|
|
1643
|
+
Log.error(`No Fiori elements page with ID ${i} found in routing targets.`);
|
|
1535
1644
|
}
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1645
|
+
return o;
|
|
1646
|
+
}
|
|
1647
|
+
o.changeConfiguration = r;
|
|
1648
|
+
function a(t) {
|
|
1649
|
+
let n = t.split("/");
|
|
1650
|
+
if (n[0] === "controlConfiguration") {
|
|
1651
|
+
let t = "";
|
|
1652
|
+
for (let o = 1; o < n.length; o++) {
|
|
1653
|
+
t += (o > 1 ? "/" : "") + n[o];
|
|
1654
|
+
if (t.indexOf("@") > -1) {
|
|
1655
|
+
n = ["controlConfiguration", t].concat(n.slice(o + 1));
|
|
1543
1656
|
break;
|
|
1544
1657
|
}
|
|
1545
1658
|
}
|
|
1546
1659
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1660
|
+
return n;
|
|
1661
|
+
}
|
|
1662
|
+
function s(t, n) {
|
|
1663
|
+
var o, e;
|
|
1664
|
+
let i;
|
|
1665
|
+
const r = ((o = t["sap.ui5"]) === null || o === void 0 ? void 0 : (e = o.routing) === null || e === void 0 ? void 0 : e.targets) ?? ({});
|
|
1666
|
+
for (const t in r) {
|
|
1667
|
+
if (r[t].id === n && r[t].name.startsWith("sap.fe.templates.")) {
|
|
1668
|
+
var a;
|
|
1669
|
+
i = ((a = r[t].options) === null || a === void 0 ? void 0 : a.settings) ?? ({});
|
|
1670
|
+
break;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return i;
|
|
1674
|
+
}
|
|
1675
|
+
function l(t, o, i, r) {
|
|
1676
|
+
o = o ?? ({});
|
|
1677
|
+
const s = e[r] || [];
|
|
1678
|
+
for (const e of s) {
|
|
1679
|
+
const i = a(e);
|
|
1680
|
+
const r = ObjectPath.get(i, t);
|
|
1681
|
+
ObjectPath.set(i, r, o);
|
|
1682
|
+
}
|
|
1683
|
+
return o;
|
|
1684
|
+
}
|
|
1685
|
+
o.applyPageConfigurationChanges = l;
|
|
1686
|
+
function u() {
|
|
1687
|
+
e = {};
|
|
1549
1688
|
}
|
|
1550
|
-
|
|
1689
|
+
o.cleanPageConfigurationChanges = u;
|
|
1551
1690
|
|
|
1552
1691
|
var Registration = {
|
|
1553
1692
|
appdescr_ui5_addLibraries: () => Promise.resolve(AddLibrary),
|
|
@@ -1557,11 +1696,11 @@ var Registration = {
|
|
|
1557
1696
|
appdescr_ovp_removeCard: () => Promise.resolve(DeleteCard),
|
|
1558
1697
|
appdescr_ui_generic_app_addNewObjectPage: () => Promise.resolve(addNewObjectPage),
|
|
1559
1698
|
appdescr_ui_generic_app_changePageConfiguration: () => Promise.resolve(changePageConfiguration),
|
|
1560
|
-
appdescr_fe_changePageConfiguration: () => Promise.resolve(
|
|
1699
|
+
appdescr_fe_changePageConfiguration: () => Promise.resolve(o)
|
|
1561
1700
|
};
|
|
1562
1701
|
|
|
1563
1702
|
var RegistrationBuild = {
|
|
1564
|
-
appdescr_app_changeDataSource: () => Promise.resolve(
|
|
1703
|
+
appdescr_app_changeDataSource: () => Promise.resolve(ChangeDataSource),
|
|
1565
1704
|
appdescr_ui5_addNewModelEnhanceWith: () => Promise.resolve(AddNewModelEnhanceWith),
|
|
1566
1705
|
appdescr_ui5_addComponentUsages: () => Promise.resolve(AddComponentUsages),
|
|
1567
1706
|
appdescr_ui5_setMinUI5Version: () => Promise.resolve(SetMinUI5Version),
|
|
@@ -1569,7 +1708,9 @@ var RegistrationBuild = {
|
|
|
1569
1708
|
appdescr_ui5_setFlexExtensionPointEnabled: () => Promise.resolve(SetFlexExtensionPointEnabled),
|
|
1570
1709
|
appdescr_ui5_addNewModel: () => Promise.resolve(AddNewModel),
|
|
1571
1710
|
appdescr_app_addAnnotationsToOData: () => Promise.resolve(AddAnnotationsToOData),
|
|
1711
|
+
appdescr_app_removeAllInboundsExceptOne: () => Promise.resolve(RemoveAllInboundsExceptOne),
|
|
1572
1712
|
appdescr_app_changeInbound: () => Promise.resolve(ChangeInbound),
|
|
1713
|
+
appdescr_app_addNewInbound: () => Promise.resolve(AddNewInbound),
|
|
1573
1714
|
appdescr_fiori_setAbstract: () => Promise.resolve(SetAbstract)
|
|
1574
1715
|
};
|
|
1575
1716
|
var RegistrationCopy = Object.assign({}, Registration);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import CacheManager from "./cacheManager";
|
|
2
|
+
import { IConfiguration } from "../model/types";
|
|
3
|
+
export default class AnnotationsCacheManager extends CacheManager {
|
|
4
|
+
private tempSubFolder;
|
|
5
|
+
constructor(configuration: IConfiguration, tempSubFolder: string);
|
|
6
|
+
protected getTempId(): string;
|
|
7
|
+
getMetadataFilename(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cacheManager_1 = require("./cacheManager");
|
|
4
|
+
class AnnotationsCacheManager extends cacheManager_1.default {
|
|
5
|
+
constructor(configuration, tempSubFolder) {
|
|
6
|
+
super(configuration);
|
|
7
|
+
this.tempSubFolder = tempSubFolder;
|
|
8
|
+
}
|
|
9
|
+
getTempId() {
|
|
10
|
+
const { destination, appName } = this.configuration;
|
|
11
|
+
return super.normalizeId(`ui5-${destination}-${appName}-${this.tempSubFolder}`);
|
|
12
|
+
}
|
|
13
|
+
getMetadataFilename() {
|
|
14
|
+
return "annotationsmetadata.json";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = AnnotationsCacheManager;
|
|
18
|
+
//# sourceMappingURL=annotationsCacheManager.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cacheManager_1 = require("./cacheManager");
|
|
4
|
+
class BaseAppFilesCacheManager extends cacheManager_1.default {
|
|
5
|
+
getTempId() {
|
|
6
|
+
const { appHostId, appName, appVersion } = this.configuration;
|
|
7
|
+
return super.normalizeId(`ui5-${appHostId}-${appName}-${appVersion}`);
|
|
8
|
+
}
|
|
9
|
+
getMetadataFilename() {
|
|
10
|
+
return BaseAppFilesCacheManager.METADATA_FILENAME;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = BaseAppFilesCacheManager;
|
|
14
|
+
BaseAppFilesCacheManager.METADATA_FILENAME = "html5metadata.json";
|
|
15
|
+
//# sourceMappingURL=baseAppFilesCacheManager.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IConfiguration, IMetadata } from "../model/types";
|
|
2
|
+
export default abstract class CacheManager {
|
|
3
|
+
protected configuration: IConfiguration;
|
|
4
|
+
constructor(configuration: IConfiguration);
|
|
5
|
+
protected abstract getMetadataFilename(): string;
|
|
6
|
+
protected abstract getTempId(): string;
|
|
7
|
+
protected getTempFolder(): string;
|
|
8
|
+
getFiles(fetchMetadata: () => Promise<IMetadata>, fetchFiles: () => Promise<Map<string, string>>): Promise<Map<string, string>>;
|
|
9
|
+
isMetadataSame(tempMetadata: IMetadata, metadata: IMetadata): boolean;
|
|
10
|
+
readTempMetadata(): any;
|
|
11
|
+
writeTemp(files: Map<string, string>, metadata: any): Promise<void[]>;
|
|
12
|
+
readTemp(): Promise<Map<string, string>>;
|
|
13
|
+
deleteTemp(): void;
|
|
14
|
+
protected normalizeId(id: string): string;
|
|
15
|
+
private getFilesToCache;
|
|
16
|
+
}
|