@ui5/task-adaptation 1.1.0 → 1.1.1
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 +5 -1
- package/dist/annotationManager.d.ts +0 -3
- package/dist/annotationManager.js +8 -43
- package/dist/annotations/comparator/comparator.d.ts +47 -0
- package/dist/annotations/comparator/comparator.js +276 -0
- package/dist/annotations/comparator/diffCase.d.ts +4 -0
- package/dist/annotations/comparator/diffCase.js +3 -0
- package/dist/annotations/comparator/interchangableCase.d.ts +25 -0
- package/dist/annotations/comparator/interchangableCase.js +65 -0
- package/dist/annotations/converter/metadataJsonReferenceUtil.d.ts +12 -0
- package/dist/annotations/converter/metadataJsonReferenceUtil.js +50 -0
- package/dist/annotations/converter/metadataJsonUtil.d.ts +30 -0
- package/dist/annotations/converter/metadataJsonUtil.js +73 -0
- package/dist/annotations/converter/ui5JsonConverter.d.ts +21 -0
- package/dist/annotations/converter/ui5JsonConverter.js +253 -0
- package/dist/annotations/converter/ui5MetadataJsonUtil.d.ts +3 -0
- package/dist/annotations/converter/ui5MetadataJsonUtil.js +13 -0
- package/dist/annotations/converter/ui5XmlConverter.d.ts +5 -0
- package/dist/annotations/converter/ui5XmlConverter.js +17 -0
- package/dist/annotations/dataSource/dataSource.d.ts +34 -0
- package/dist/annotations/dataSource/dataSource.js +62 -0
- package/dist/annotations/dataSource/dataSourceManager.d.ts +13 -0
- package/dist/annotations/dataSource/dataSourceManager.js +50 -0
- package/dist/annotations/dataSource/dataSourceOData.d.ts +17 -0
- package/dist/annotations/dataSource/dataSourceOData.js +47 -0
- package/dist/annotations/dataSource/dataSourceODataAnnotation.d.ts +6 -0
- package/dist/annotations/dataSource/dataSourceODataAnnotation.js +18 -0
- package/dist/annotations/serviceRequestor.d.ts +1 -9
- package/dist/annotations/serviceRequestor.js +8 -4
- package/dist/annotations/transformers/convertV2ToV4.d.ts +4 -0
- package/dist/annotations/transformers/convertV2ToV4.js +16 -0
- package/dist/annotations/transformers/makeAnnotationNamespaceUnique.d.ts +6 -0
- package/dist/annotations/transformers/makeAnnotationNamespaceUnique.js +44 -0
- package/dist/annotations/transformers/removeAllSchemaNodesExceptAnnotations.d.ts +4 -0
- package/dist/annotations/transformers/removeAllSchemaNodesExceptAnnotations.js +17 -0
- package/dist/annotations/transformers/transformer.d.ts +12 -0
- package/dist/annotations/transformers/transformer.js +3 -0
- package/dist/annotations/transformers/traverseReferences.d.ts +10 -0
- package/dist/annotations/transformers/traverseReferences.js +75 -0
- package/dist/appVariantManager.d.ts +4 -2
- package/dist/appVariantManager.js +44 -18
- package/dist/baseAppManager.d.ts +2 -1
- package/dist/baseAppManager.js +19 -24
- package/dist/bundle-odata.js +5498 -0
- package/dist/bundle.js +1786 -13
- package/dist/i18nManager.d.ts +5 -7
- package/dist/i18nManager.js +29 -32
- package/dist/index.js +4 -3
- package/dist/model/annotationDiffStructureError.js +2 -0
- package/dist/model/language.js +1 -1
- package/dist/model/types.d.ts +13 -2
- package/dist/util/commonUtil.d.ts +7 -0
- package/dist/util/commonUtil.js +72 -18
- package/dist/util/i18nMerger.d.ts +1 -1
- package/dist/util/i18nMerger.js +3 -4
- package/dist/util/resourceUtil.d.ts +3 -0
- package/dist/util/resourceUtil.js +13 -0
- package/package.json +5 -4
- package/scripts/bundler.ts +4 -33
- package/scripts/metadataDownloadHelper.ts +7 -5
- package/scripts/rollup/bundleDefinition-odata.js +9 -0
- package/scripts/rollup/overrides/sap/ui/performance/Measurement.js +4 -0
- package/scripts/rollup/ui5Resolve.ts +34 -5
- package/scripts/rollup.ts +12 -3
- package/dist/annotations/oDataModel.d.ts +0 -20
- package/dist/annotations/oDataModel.js +0 -46
- package/dist/annotations/oDataV2Model.d.ts +0 -4
- package/dist/annotations/oDataV2Model.js +0 -13
- package/dist/util/jsonDiffUtil.d.ts +0 -28
- package/dist/util/jsonDiffUtil.js +0 -74
- package/scripts/rollup/overrides/sap/ui/thirdparty/URI.js +0 -16
package/scripts/rollup.ts
CHANGED
|
@@ -65,14 +65,23 @@ export default class Builder {
|
|
|
65
65
|
project,
|
|
66
66
|
"bundleDefinition.js",
|
|
67
67
|
"./dist/bundle.js",
|
|
68
|
-
"/sap.ui.fl",
|
|
69
68
|
[
|
|
70
69
|
"/resources/sap/ui/fl/**",
|
|
71
70
|
"/resources/sap/suite/ui/generic/template/**"
|
|
71
|
+
]);
|
|
72
|
+
await Bundler.run(
|
|
73
|
+
project,
|
|
74
|
+
"bundleDefinition-odata.js",
|
|
75
|
+
"./dist/bundle-odata.js",
|
|
76
|
+
[
|
|
77
|
+
"/resources/sap/ui/model/**",
|
|
78
|
+
"sap/ui/util/XMLHelper",
|
|
79
|
+
"sap/ui/core/Core"
|
|
72
80
|
],
|
|
73
81
|
[
|
|
74
|
-
"sap/ui/
|
|
75
|
-
]
|
|
82
|
+
"sap/ui/performance/Measurement"
|
|
83
|
+
]
|
|
84
|
+
);
|
|
76
85
|
}
|
|
77
86
|
}
|
|
78
87
|
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import ServiceRequestor, { ILanguageJsonContent, ILanguageXmlContent } from "./serviceRequestor";
|
|
2
|
-
import Language from "../model/language";
|
|
3
|
-
export default class ODataModel {
|
|
4
|
-
protected oDataAnnotations: Map<string, any>;
|
|
5
|
-
private serviceRequestor;
|
|
6
|
-
constructor(serviceRequestor: ServiceRequestor);
|
|
7
|
-
getAnnotationJsons(languages: Language[]): AnnotationJsonPerName[];
|
|
8
|
-
private getPromisesPerLanguage;
|
|
9
|
-
private createAnnotationJsons;
|
|
10
|
-
protected afterXmlDownload({ language, xml }: ILanguageXmlContent): Promise<ILanguageJsonContent>;
|
|
11
|
-
protected transformJsons(annotationJsons: Map<Language, any>): Promise<Map<Language, any>>;
|
|
12
|
-
}
|
|
13
|
-
export interface PromisePerAnnotation {
|
|
14
|
-
promisesPerLanguage: Promise<ILanguageXmlContent>[];
|
|
15
|
-
annotationName: string;
|
|
16
|
-
}
|
|
17
|
-
export interface AnnotationJsonPerName {
|
|
18
|
-
annotationName: string;
|
|
19
|
-
annotationJsons: Promise<Map<Language, any>>;
|
|
20
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const xmlUtil_1 = require("../util/xmlUtil");
|
|
4
|
-
class ODataModel {
|
|
5
|
-
constructor(serviceRequestor) {
|
|
6
|
-
this.oDataAnnotations = new Map();
|
|
7
|
-
this.serviceRequestor = serviceRequestor;
|
|
8
|
-
}
|
|
9
|
-
getAnnotationJsons(languages) {
|
|
10
|
-
const result = [];
|
|
11
|
-
const promisesPerLanguagePerName = this.getPromisesPerLanguage(languages);
|
|
12
|
-
for (const { promisesPerLanguage, annotationName } of promisesPerLanguagePerName) {
|
|
13
|
-
result.push({
|
|
14
|
-
annotationName,
|
|
15
|
-
annotationJsons: this.createAnnotationJsons(promisesPerLanguage)
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
getPromisesPerLanguage(languages) {
|
|
21
|
-
return [...this.oDataAnnotations].map(([annotationName, uri]) => ({
|
|
22
|
-
promisesPerLanguage: languages.map(language => this.serviceRequestor.downloadAnnotation(uri, annotationName, language)
|
|
23
|
-
.then(this.afterXmlDownload)),
|
|
24
|
-
annotationName
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
async createAnnotationJsons(promisesPerLanguage) {
|
|
28
|
-
const annotationJsons = new Map();
|
|
29
|
-
for (const promise of promisesPerLanguage) {
|
|
30
|
-
const { language, json } = await promise;
|
|
31
|
-
annotationJsons.set(language, json);
|
|
32
|
-
}
|
|
33
|
-
return this.transformJsons(annotationJsons);
|
|
34
|
-
}
|
|
35
|
-
async afterXmlDownload({ language, xml }) {
|
|
36
|
-
return {
|
|
37
|
-
json: xmlUtil_1.default.xmlToJson(xml),
|
|
38
|
-
language
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
async transformJsons(annotationJsons) {
|
|
42
|
-
return annotationJsons;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.default = ODataModel;
|
|
46
|
-
//# sourceMappingURL=oDataModel.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const oDataModel_1 = require("./oDataModel");
|
|
4
|
-
class ODataV2Model extends oDataModel_1.default {
|
|
5
|
-
addDataSource({ uri, type }, name) {
|
|
6
|
-
if (uri?.startsWith("/") &&
|
|
7
|
-
type === "ODataAnnotation") {
|
|
8
|
-
this.oDataAnnotations.set(name, uri);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.default = ODataV2Model;
|
|
13
|
-
//# sourceMappingURL=oDataV2Model.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import Language from "../model/language";
|
|
2
|
-
export interface IJsonContent {
|
|
3
|
-
language: Language;
|
|
4
|
-
json: any;
|
|
5
|
-
}
|
|
6
|
-
export interface IDiffProperty {
|
|
7
|
-
object: any;
|
|
8
|
-
property: string | number;
|
|
9
|
-
type: DiffTypeEnum;
|
|
10
|
-
}
|
|
11
|
-
export declare enum DiffTypeEnum {
|
|
12
|
-
MINUS = 0,
|
|
13
|
-
PLUS = 1,
|
|
14
|
-
DELTA = 2
|
|
15
|
-
}
|
|
16
|
-
export interface IDiffJson {
|
|
17
|
-
json: any;
|
|
18
|
-
properties: Set<IDiffProperty>;
|
|
19
|
-
}
|
|
20
|
-
export interface IDiffOptions {
|
|
21
|
-
restoreOriginalValue: boolean;
|
|
22
|
-
throwErrorOnDiffStructure: boolean;
|
|
23
|
-
}
|
|
24
|
-
export default class JsonDiffUtil {
|
|
25
|
-
static diff(jsonA: any, jsonB: any, options?: IDiffOptions): IDiffJson;
|
|
26
|
-
private static findDiffsAndRestoreStructure;
|
|
27
|
-
private static traverseDiffRecursive;
|
|
28
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiffTypeEnum = void 0;
|
|
4
|
-
const jsonDiff = require("json-diff");
|
|
5
|
-
const annotationDiffStructureError_1 = require("../model/annotationDiffStructureError");
|
|
6
|
-
var DiffTypeEnum;
|
|
7
|
-
(function (DiffTypeEnum) {
|
|
8
|
-
DiffTypeEnum[DiffTypeEnum["MINUS"] = 0] = "MINUS";
|
|
9
|
-
DiffTypeEnum[DiffTypeEnum["PLUS"] = 1] = "PLUS";
|
|
10
|
-
DiffTypeEnum[DiffTypeEnum["DELTA"] = 2] = "DELTA";
|
|
11
|
-
})(DiffTypeEnum = exports.DiffTypeEnum || (exports.DiffTypeEnum = {}));
|
|
12
|
-
class JsonDiffUtil {
|
|
13
|
-
static diff(jsonA, jsonB, options = {
|
|
14
|
-
throwErrorOnDiffStructure: true,
|
|
15
|
-
restoreOriginalValue: false
|
|
16
|
-
}) {
|
|
17
|
-
const json = jsonDiff.diff(jsonA, jsonB, { full: true, sort: false });
|
|
18
|
-
const properties = this.findDiffsAndRestoreStructure(json, options);
|
|
19
|
-
return {
|
|
20
|
-
json,
|
|
21
|
-
properties
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
static findDiffsAndRestoreStructure(object, options) {
|
|
25
|
-
const properties = new Set();
|
|
26
|
-
this.traverseDiffRecursive(properties, { object }, "object", options);
|
|
27
|
-
return properties;
|
|
28
|
-
}
|
|
29
|
-
static traverseDiffRecursive(properties, object, property, options) {
|
|
30
|
-
const current = object[property];
|
|
31
|
-
if (typeof current !== "object") {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (Array.isArray(current)) {
|
|
35
|
-
for (let i = 0; i < current.length; i++) {
|
|
36
|
-
const item = current[i];
|
|
37
|
-
if (["~", " ", "-", "+"].some(sign => item[0] === sign)) {
|
|
38
|
-
current[i] = item[1];
|
|
39
|
-
// This is a sign from json-diff plugin, that the property contains differences.
|
|
40
|
-
// We will remove these signs, to restore the original structure
|
|
41
|
-
if (item[0] === "~") {
|
|
42
|
-
this.traverseDiffRecursive(properties, item, 1, options);
|
|
43
|
-
}
|
|
44
|
-
else if (item[0] === "+" || item[0] === "-") {
|
|
45
|
-
if (options.throwErrorOnDiffStructure) {
|
|
46
|
-
throw new annotationDiffStructureError_1.default(item[1]);
|
|
47
|
-
}
|
|
48
|
-
properties.add({
|
|
49
|
-
object: object[property],
|
|
50
|
-
property: i,
|
|
51
|
-
type: item[0] === "+" ? DiffTypeEnum.PLUS : DiffTypeEnum.MINUS
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
for (const key of Object.keys(current)) {
|
|
59
|
-
if (key == "__old" || key == "__new") {
|
|
60
|
-
if (options.restoreOriginalValue) {
|
|
61
|
-
object[property] = current["__old"];
|
|
62
|
-
}
|
|
63
|
-
properties.add({ object, property, type: DiffTypeEnum.DELTA });
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
this.traverseDiffRecursive(properties, current, key, options);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.default = JsonDiffUtil;
|
|
74
|
-
//# sourceMappingURL=jsonDiffUtil.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { posix as path } from "path";
|
|
2
|
-
|
|
3
|
-
export default class URI {
|
|
4
|
-
constructor(value) {
|
|
5
|
-
this.value = value;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
normalize() {
|
|
9
|
-
this.value = path.normalize(this.value).replace(/\\/g, "/");
|
|
10
|
-
return this;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
path() {
|
|
14
|
-
return this.value;
|
|
15
|
-
}
|
|
16
|
-
}
|