@ui5/task-adaptation 1.0.15 → 1.0.16

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