@ui5/task-adaptation 1.2.0 → 1.3.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/eslint.config.js +52 -0
  3. package/package.json +42 -52
  4. package/scripts/metadataDownloadHelper.ts +8 -7
  5. package/scripts/rollup/bundle.d.ts +25 -0
  6. package/scripts/rollup/bundleDefinition.js +11 -1
  7. package/scripts/{bundler.ts → rollup/bundler.ts} +6 -17
  8. package/scripts/rollup/overrides/sap/base/config.js +10 -0
  9. package/scripts/rollup/project/package.json +2 -1
  10. package/scripts/rollup/project/ui5.yaml +1 -1
  11. package/scripts/rollup/ui5Resolve.ts +14 -38
  12. package/scripts/rollup.ts +67 -23
  13. package/types/ui5.d.ts +44 -0
  14. package/dist/annotationManager.d.ts +0 -18
  15. package/dist/annotationManager.js +0 -80
  16. package/dist/annotations/comparator/comparator.d.ts +0 -47
  17. package/dist/annotations/comparator/comparator.js +0 -279
  18. package/dist/annotations/comparator/diffCase.d.ts +0 -4
  19. package/dist/annotations/comparator/diffCase.js +0 -3
  20. package/dist/annotations/comparator/interchangableCase.d.ts +0 -25
  21. package/dist/annotations/comparator/interchangableCase.js +0 -65
  22. package/dist/annotations/converter/metadataJsonReferenceUtil.d.ts +0 -12
  23. package/dist/annotations/converter/metadataJsonReferenceUtil.js +0 -50
  24. package/dist/annotations/converter/metadataJsonUtil.d.ts +0 -30
  25. package/dist/annotations/converter/metadataJsonUtil.js +0 -73
  26. package/dist/annotations/converter/ui5JsonConverter.d.ts +0 -21
  27. package/dist/annotations/converter/ui5JsonConverter.js +0 -253
  28. package/dist/annotations/converter/ui5MetadataJsonUtil.d.ts +0 -3
  29. package/dist/annotations/converter/ui5MetadataJsonUtil.js +0 -13
  30. package/dist/annotations/converter/ui5XmlConverter.d.ts +0 -5
  31. package/dist/annotations/converter/ui5XmlConverter.js +0 -17
  32. package/dist/annotations/dataSource/dataSource.d.ts +0 -34
  33. package/dist/annotations/dataSource/dataSource.js +0 -62
  34. package/dist/annotations/dataSource/dataSourceManager.d.ts +0 -12
  35. package/dist/annotations/dataSource/dataSourceManager.js +0 -50
  36. package/dist/annotations/dataSource/dataSourceOData.d.ts +0 -17
  37. package/dist/annotations/dataSource/dataSourceOData.js +0 -47
  38. package/dist/annotations/dataSource/dataSourceODataAnnotation.d.ts +0 -6
  39. package/dist/annotations/dataSource/dataSourceODataAnnotation.js +0 -18
  40. package/dist/annotations/serviceRequestor.d.ts +0 -9
  41. package/dist/annotations/serviceRequestor.js +0 -71
  42. package/dist/annotations/transformers/convertV2ToV4.d.ts +0 -4
  43. package/dist/annotations/transformers/convertV2ToV4.js +0 -16
  44. package/dist/annotations/transformers/makeAnnotationNamespaceUnique.d.ts +0 -6
  45. package/dist/annotations/transformers/makeAnnotationNamespaceUnique.js +0 -44
  46. package/dist/annotations/transformers/removeAllSchemaNodesExceptAnnotations.d.ts +0 -4
  47. package/dist/annotations/transformers/removeAllSchemaNodesExceptAnnotations.js +0 -17
  48. package/dist/annotations/transformers/transformer.d.ts +0 -12
  49. package/dist/annotations/transformers/transformer.js +0 -3
  50. package/dist/annotations/transformers/traverseReferences.d.ts +0 -9
  51. package/dist/annotations/transformers/traverseReferences.js +0 -67
  52. package/dist/appVariantManager.d.ts +0 -12
  53. package/dist/appVariantManager.js +0 -105
  54. package/dist/baseAppManager.d.ts +0 -29
  55. package/dist/baseAppManager.js +0 -141
  56. package/dist/buildStrategy.d.ts +0 -7
  57. package/dist/buildStrategy.js +0 -21
  58. package/dist/bundle-odata.js +0 -5498
  59. package/dist/bundle.js +0 -3475
  60. package/dist/cache/annotationsCacheManager.d.ts +0 -8
  61. package/dist/cache/annotationsCacheManager.js +0 -18
  62. package/dist/cache/baseAppFilesCacheManager.d.ts +0 -6
  63. package/dist/cache/baseAppFilesCacheManager.js +0 -15
  64. package/dist/cache/cacheManager.d.ts +0 -16
  65. package/dist/cache/cacheManager.js +0 -68
  66. package/dist/i18nManager.d.ts +0 -43
  67. package/dist/i18nManager.js +0 -203
  68. package/dist/index.d.ts +0 -1
  69. package/dist/index.js +0 -27
  70. package/dist/model/annotationDiffStructureError.d.ts +0 -3
  71. package/dist/model/annotationDiffStructureError.js +0 -11
  72. package/dist/model/language.d.ts +0 -13
  73. package/dist/model/language.js +0 -37
  74. package/dist/model/noAuthorizationProvidedError.d.ts +0 -3
  75. package/dist/model/noAuthorizationProvidedError.js +0 -9
  76. package/dist/model/serverError.d.ts +0 -3
  77. package/dist/model/serverError.js +0 -9
  78. package/dist/model/types.d.ts +0 -119
  79. package/dist/model/types.js +0 -3
  80. package/dist/processors/abapProcessor.d.ts +0 -21
  81. package/dist/processors/abapProcessor.js +0 -36
  82. package/dist/processors/cfProcessor.d.ts +0 -17
  83. package/dist/processors/cfProcessor.js +0 -46
  84. package/dist/processors/processor.d.ts +0 -7
  85. package/dist/processors/processor.js +0 -36
  86. package/dist/repositories/abapRepoManager.d.ts +0 -13
  87. package/dist/repositories/abapRepoManager.js +0 -82
  88. package/dist/repositories/html5RepoManager.d.ts +0 -11
  89. package/dist/repositories/html5RepoManager.js +0 -89
  90. package/dist/util/cfUtil.d.ts +0 -30
  91. package/dist/util/cfUtil.js +0 -173
  92. package/dist/util/commonUtil.d.ts +0 -13
  93. package/dist/util/commonUtil.js +0 -129
  94. package/dist/util/i18nMerger.d.ts +0 -28
  95. package/dist/util/i18nMerger.js +0 -103
  96. package/dist/util/requestUtil.d.ts +0 -8
  97. package/dist/util/requestUtil.js +0 -57
  98. package/dist/util/resourceUtil.d.ts +0 -11
  99. package/dist/util/resourceUtil.js +0 -65
  100. package/dist/util/urlUtil.d.ts +0 -4
  101. package/dist/util/urlUtil.js +0 -21
  102. package/dist/util/xmlUtil.d.ts +0 -4
  103. package/dist/util/xmlUtil.js +0 -24
  104. package/dist/util/zipUtil.d.ts +0 -2
  105. package/dist/util/zipUtil.js +0 -20
  106. package/scripts/rollup/bundleDefinition-odata.js +0 -9
@@ -1,8 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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
@@ -1,6 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
@@ -1,16 +0,0 @@
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
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs = require("fs");
4
- const path = require("path");
5
- const resourceUtil_1 = require("../util/resourceUtil");
6
- const rimraf = require("rimraf");
7
- const tempFolder = require('temp-dir');
8
- class CacheManager {
9
- constructor(configuration) {
10
- this.configuration = configuration;
11
- }
12
- getTempFolder() {
13
- return path.join(tempFolder, this.getTempId());
14
- }
15
- async getFiles(fetchMetadata, fetchFiles) {
16
- const tempMetadata = this.readTempMetadata();
17
- const metadata = await fetchMetadata();
18
- if (this.isMetadataSame(tempMetadata, metadata)) {
19
- return this.readTemp();
20
- }
21
- else {
22
- const files = await fetchFiles();
23
- if (files?.size > 0) {
24
- await this.writeTemp(files, metadata);
25
- }
26
- return files;
27
- }
28
- }
29
- isMetadataSame(tempMetadata, metadata) {
30
- // TODO: Implement correct metadata comparision.
31
- return tempMetadata && metadata && tempMetadata.changedOn === metadata.changedOn;
32
- }
33
- readTempMetadata() {
34
- const tempFolder = this.getTempFolder();
35
- const filename = this.getMetadataFilename();
36
- const metadataPath = path.resolve(tempFolder, filename);
37
- if (fs.existsSync(metadataPath)) {
38
- return JSON.parse(fs.readFileSync(metadataPath, { encoding: "utf-8" }));
39
- }
40
- }
41
- writeTemp(files, metadata) {
42
- this.deleteTemp();
43
- const filesToCache = this.getFilesToCache(files, metadata);
44
- return resourceUtil_1.default.write(this.getTempFolder(), filesToCache);
45
- }
46
- async readTemp() {
47
- const files = new Map();
48
- const tempFolder = this.getTempFolder();
49
- if (fs.existsSync(tempFolder)) {
50
- resourceUtil_1.default.read(tempFolder, tempFolder, files, [this.getMetadataFilename()]);
51
- }
52
- return files;
53
- }
54
- deleteTemp() {
55
- rimraf.sync(this.getTempFolder());
56
- }
57
- normalizeId(id) {
58
- return id.replace(/\/\\/g, "_");
59
- }
60
- getFilesToCache(files, metadata) {
61
- const filename = this.getMetadataFilename();
62
- const filesClone = new Map([...files]);
63
- filesClone.set(filename, JSON.stringify(metadata));
64
- return filesClone;
65
- }
66
- }
67
- exports.default = CacheManager;
68
- //# sourceMappingURL=cacheManager.js.map
@@ -1,43 +0,0 @@
1
- import { IDiffProperty } from "./annotations/comparator/comparator";
2
- import { IJsonPerLanguage, IJsonPromisePerLanguage } from "./model/types";
3
- import Language from "./model/language";
4
- export declare class PropertyValue {
5
- value: string;
6
- isReference: boolean;
7
- qualifier: string;
8
- language: Language;
9
- private static OLD;
10
- private static NEW;
11
- private constructor();
12
- get isOld(): boolean;
13
- set(diff: any, references: Map<string, string>): void;
14
- static oldFrom(language: Language, value?: string): PropertyValue;
15
- static newFrom(language: Language, value?: string): PropertyValue;
16
- }
17
- export declare class I18nFileContent {
18
- private properties;
19
- constructor(languages: Language[]);
20
- add(prop: PropertyValue, key: string): void;
21
- private initKeyValuesForOtherLanguages;
22
- hasTranslations(): boolean;
23
- private getOrCreateLanguageContent;
24
- createFiles(i18nPathName: string): Map<string, string>;
25
- }
26
- export default class I18nManager {
27
- private modelName;
28
- private appVariantId;
29
- private references;
30
- private existingKeys;
31
- private i18nFileContent;
32
- constructor(modelName: string, appVariantId: string, languages: Language[]);
33
- processDiff(properties: Set<IDiffProperty>, previousLanguage: Language, currentLanguage: Language): void;
34
- createFiles(i18nPathName: string): Map<string, string>;
35
- populateTranslations(annotationJsons: Map<Language, Promise<any>>): Promise<IJsonPromisePerLanguage>;
36
- populate(annotationJsons: [Language, Promise<any>][], defaultAnnotation: IJsonPerLanguage): Promise<IJsonPerLanguage>;
37
- static extractDefaultLanguageAnnotation(annotationJsons: Map<Language, Promise<any>>): IJsonPromisePerLanguage;
38
- private replaceWithModelReference;
39
- private createReference;
40
- getUniqueKeyForValue(value: string): string;
41
- hasTranslations(): boolean;
42
- private initPropertyValues;
43
- }
@@ -1,203 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.I18nFileContent = exports.PropertyValue = void 0;
4
- const comparator_1 = require("./annotations/comparator/comparator");
5
- const annotationDiffStructureError_1 = require("./model/annotationDiffStructureError");
6
- const commonUtil_1 = require("./util/commonUtil");
7
- const posix_1 = require("path/posix"); // Ensure standardized dir separators to ensure Windows compatibility
8
- // To generate keys, english language is more common, so compare all other
9
- // languages with it
10
- class PropertyValue {
11
- constructor(qualifier, language, value) {
12
- this.isReference = false;
13
- this.qualifier = qualifier;
14
- this.language = language;
15
- this.value = value;
16
- }
17
- get isOld() {
18
- return this.qualifier === PropertyValue.OLD;
19
- }
20
- set(diff, references) {
21
- this.value = diff[this.qualifier];
22
- this.isReference = references.has(diff[this.qualifier]);
23
- }
24
- static oldFrom(language, value = "") {
25
- return new PropertyValue(PropertyValue.OLD, language, value);
26
- }
27
- static newFrom(language, value = "") {
28
- return new PropertyValue(PropertyValue.NEW, language, value);
29
- }
30
- }
31
- exports.PropertyValue = PropertyValue;
32
- PropertyValue.OLD = "__old";
33
- PropertyValue.NEW = "__new";
34
- class I18nFileContent {
35
- constructor(languages) {
36
- this.properties = new Map();
37
- languages.forEach(language => this.properties.set(language, new Map()));
38
- }
39
- add(prop, key) {
40
- this.getOrCreateLanguageContent(prop.language).set(key, prop.value);
41
- this.initKeyValuesForOtherLanguages(prop, key);
42
- }
43
- initKeyValuesForOtherLanguages(prop, key) {
44
- // "", EN, EN_US, DE, FR
45
- // If we already compared 2 languages and saved translations, we assume
46
- // that we have generated all property keys, but suddenly 3d language or
47
- // further contain translation which was not present in previous
48
- // languages we need to update all other languages then. These values
49
- // will be overwritten later by actual values of the language:
50
- // this.getOrCreateLanguageContent(prop.language).set(key, prop.value);
51
- if (prop.isOld) {
52
- this.properties.forEach((keyValue, language) => {
53
- if (language !== prop.language && !keyValue.has(key)) {
54
- keyValue.set(key, prop.value);
55
- }
56
- });
57
- }
58
- }
59
- hasTranslations() {
60
- // this.properties.size can be 0 or 2+, it can't be 1
61
- return [...this.properties.values()].some(keyValue => keyValue.size > 0);
62
- }
63
- getOrCreateLanguageContent(language) {
64
- if (!this.properties.has(language)) {
65
- this.properties.set(language, new Map());
66
- }
67
- return this.properties.get(language);
68
- }
69
- createFiles(i18nPathName) {
70
- const files = new Map();
71
- if (this.hasTranslations()) {
72
- this.properties.forEach((i18nLines, language) => {
73
- let filename = "i18n";
74
- if (language.i18n) {
75
- filename += "_" + language.i18n;
76
- }
77
- const filepath = (0, posix_1.join)(i18nPathName, filename + ".properties");
78
- files.set(filepath, [...i18nLines].map(([key, value]) => `${key}=${value}`).join("\n"));
79
- });
80
- }
81
- return files;
82
- }
83
- }
84
- exports.I18nFileContent = I18nFileContent;
85
- class I18nManager {
86
- constructor(modelName, appVariantId, languages) {
87
- this.references = new Map();
88
- this.existingKeys = new Set();
89
- this.modelName = modelName;
90
- this.appVariantId = appVariantId;
91
- this.i18nFileContent = new I18nFileContent(languages);
92
- }
93
- processDiff(properties, previousLanguage, currentLanguage) {
94
- // json-diff uses __old and __new value as diff,
95
- // so we assign it with languages which were in comparison
96
- const propertyValues = [
97
- PropertyValue.oldFrom(previousLanguage),
98
- PropertyValue.newFrom(currentLanguage)
99
- ];
100
- for (const property of properties) {
101
- this.replaceWithModelReference(property, propertyValues);
102
- }
103
- }
104
- createFiles(i18nPathName) {
105
- return this.i18nFileContent.createFiles(i18nPathName);
106
- }
107
- async populateTranslations(annotationJsons) {
108
- /* We compare annotations. Diff gives us:
109
- {
110
- "string": {
111
- "__old": "A"
112
- "__new": "B"
113
- }
114
- }
115
- we generate key and extract to properties file. Now it looks so:
116
- {
117
- "string": "{@i18n>id_KEY}"
118
- }
119
- and we compare this with next language and diff gives us:
120
- {
121
- "string": {
122
- "__old": "{@i18n>id_KEY}"
123
- "__new": "C"
124
- }
125
- }
126
- we use already generate key id_KEY and extract translation value to
127
- properties file again. And then compare with the next language and so on
128
- and so on */
129
- let defaultAnnotation = I18nManager.extractDefaultLanguageAnnotation(annotationJsons);
130
- if (annotationJsons.size > 0 && defaultAnnotation) {
131
- defaultAnnotation = await this.populate([...annotationJsons], defaultAnnotation);
132
- }
133
- return defaultAnnotation;
134
- }
135
- async populate(annotationJsons, defaultAnnotation) {
136
- let p = defaultAnnotation;
137
- for (const c of annotationJsons.map(([language, json]) => ({ language, json }))) {
138
- try {
139
- const comparator = new comparator_1.default(await p.json, await c.json);
140
- const pDiff = comparator.compare();
141
- this.processDiff(pDiff.properties, p.language, c.language);
142
- p.json = pDiff.json;
143
- }
144
- catch (error) {
145
- if (error instanceof annotationDiffStructureError_1.default) {
146
- throw new Error(`The structure of the OData annotation xml of language '${p.language}' is different from xml of language '${c.language}' near element: ${error.message}`);
147
- }
148
- throw error;
149
- }
150
- }
151
- return p;
152
- }
153
- static extractDefaultLanguageAnnotation(annotationJsons) {
154
- let json = null;
155
- for (const [language, json] of annotationJsons) {
156
- if (language.isDefault) {
157
- annotationJsons.delete(language);
158
- return { json, language };
159
- }
160
- }
161
- const language = [...annotationJsons.keys()][0];
162
- json = annotationJsons.get(language);
163
- annotationJsons.delete(language);
164
- return { json, language };
165
- }
166
- replaceWithModelReference({ object, property }, propertyValues) {
167
- const diff = object[property];
168
- this.initPropertyValues(diff, propertyValues);
169
- // If there are already generated key, like on step 3. above comment, we
170
- // take it (from __old), so we don't need to generate new
171
- const propReference = propertyValues.find(prop => prop.isReference);
172
- let reference = propReference?.value ?? this.createReference(diff.__old);
173
- object[property] = reference;
174
- // Other values, which are not references, are extracted to .properties
175
- const key = this.references.get(reference);
176
- if (key) {
177
- propertyValues.filter(prop => !prop.isReference).forEach(prop => this.i18nFileContent.add(prop, key));
178
- }
179
- }
180
- createReference(value) {
181
- const key = this.appVariantId + "_" + this.getUniqueKeyForValue(value);
182
- const reference = `{${this.modelName}>${key}}`;
183
- this.references.set(reference, key);
184
- return reference;
185
- }
186
- getUniqueKeyForValue(value) {
187
- if (typeof value !== "string") {
188
- throw new Error("Failed to create unique key from: " + JSON.stringify(value));
189
- }
190
- const propertyName = value.replace(/\W/gi, "_").toUpperCase();
191
- const key = (0, commonUtil_1.getUniqueName)([...this.existingKeys.keys()], propertyName);
192
- this.existingKeys.add(key);
193
- return key;
194
- }
195
- hasTranslations() {
196
- return this.i18nFileContent.hasTranslations();
197
- }
198
- initPropertyValues(diff, propertyValues) {
199
- propertyValues.forEach(prop => prop.set(diff, this.references));
200
- }
201
- }
202
- exports.default = I18nManager;
203
- //# sourceMappingURL=i18nManager.js.map
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/index.js DELETED
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const dotenv = require("dotenv");
4
- const commonUtil_1 = require("./util/commonUtil");
5
- const appVariantManager_1 = require("./appVariantManager");
6
- const baseAppManager_1 = require("./baseAppManager");
7
- const i18nMerger_1 = require("./util/i18nMerger");
8
- const processor_1 = require("./processors/processor");
9
- /**
10
- * Creates an appVariant bundle from the provided resources.
11
- */
12
- module.exports = ({ workspace, options, taskUtil }) => {
13
- dotenv.config();
14
- async function process(workspace, taskUtil) {
15
- await (0, commonUtil_1.logBuilderVersion)();
16
- (0, commonUtil_1.logBetaUsage)();
17
- const processor = (0, processor_1.determineProcessor)(options.configuration);
18
- const appVariantResources = await appVariantManager_1.default.getAppVariantResourcesToProcess(workspace);
19
- const appVariantInfo = await appVariantManager_1.default.process(appVariantResources, options.projectNamespace, taskUtil);
20
- const baseAppFiles = await processor.getBaseAppFiles(appVariantInfo.reference);
21
- const { resources, manifestInfo } = await baseAppManager_1.default.process(baseAppFiles, appVariantInfo, options, processor);
22
- const mergedResources = await i18nMerger_1.default.mergeI18NFiles(resources, appVariantResources, options.projectNamespace, manifestInfo.i18nPath, appVariantInfo, taskUtil);
23
- await Promise.all(mergedResources.map(resource => workspace.write(resource)));
24
- }
25
- return process(workspace, taskUtil);
26
- };
27
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- export default class AnnotationDiffStructureError extends Error {
2
- constructor(json: any);
3
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class AnnotationDiffStructureError extends Error {
4
- constructor(json) {
5
- super(JSON.stringify(json));
6
- this.name = "AnnotationDiffStructureError";
7
- this.message = `The structure of the OData annotation xml is different near element: ${JSON.stringify(json)}`;
8
- }
9
- }
10
- exports.default = AnnotationDiffStructureError;
11
- //# sourceMappingURL=annotationDiffStructureError.js.map
@@ -1,13 +0,0 @@
1
- export default class Language {
2
- sap: string;
3
- i18n: string;
4
- isDefault: boolean;
5
- constructor(sap: string, i18n: string);
6
- /**
7
- * Create a language array from languages in configuration and default language.
8
- * @param languages Typically an array of objects. Probably could be undefined.
9
- * @returns An array of type Language, where the default language is placed first,
10
- * followed by the passed config languages.
11
- */
12
- static create(languages: any[] | undefined): Language[];
13
- }
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class Language {
4
- constructor(sap, i18n) {
5
- this.sap = sap;
6
- this.i18n = i18n;
7
- this.isDefault = sap === "";
8
- }
9
- /**
10
- * Create a language array from languages in configuration and default language.
11
- * @param languages Typically an array of objects. Probably could be undefined.
12
- * @returns An array of type Language, where the default language is placed first,
13
- * followed by the passed config languages.
14
- */
15
- static create(languages) {
16
- const defaultLanguage = new Language("", "");
17
- let configLanguages = [];
18
- if (languages !== undefined) {
19
- configLanguages = languages.map(item => {
20
- if (typeof item === "string") {
21
- // For legacy language format support which is just a string and doesn't contain i18n
22
- return new Language(item, item.toLowerCase());
23
- }
24
- else if (item.sap !== undefined && item.i18n !== undefined) {
25
- return new Language(item.sap, item.i18n);
26
- }
27
- else {
28
- throw new Error("Can not parse languages from ui5.yaml configuration. Please use the 'AdaptationProject: Create wizard' to generate the project.");
29
- }
30
- });
31
- }
32
- return [defaultLanguage, ...configLanguages];
33
- }
34
- ;
35
- }
36
- exports.default = Language;
37
- //# sourceMappingURL=language.js.map
@@ -1,3 +0,0 @@
1
- export default class NoAuthorizationProvidedError extends Error {
2
- constructor(uri: string);
3
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class NoAuthorizationProvidedError extends Error {
4
- constructor(uri) {
5
- super(`Request requires authorization: '${uri}'`);
6
- }
7
- }
8
- exports.default = NoAuthorizationProvidedError;
9
- //# sourceMappingURL=noAuthorizationProvidedError.js.map
@@ -1,3 +0,0 @@
1
- export default class ServerError extends Error {
2
- constructor(uri: string, error: any);
3
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class ServerError extends Error {
4
- constructor(uri, error) {
5
- super(`Request ${uri} failed with Server error: ${error.response.status}${error.response.data ?? ""}`);
6
- }
7
- }
8
- exports.default = ServerError;
9
- //# sourceMappingURL=serverError.js.map
@@ -1,119 +0,0 @@
1
- import Language from "./language";
2
- export interface IConfiguration {
3
- writeTempFiles?: any;
4
- appHostId?: string;
5
- appId?: string;
6
- appName?: string;
7
- appVersion?: string;
8
- spaceGuid?: string;
9
- orgGuid?: string;
10
- sapCloudService?: string;
11
- destination?: string;
12
- credentials?: IAuth;
13
- type?: "cf" | "abap";
14
- languages?: any[] | undefined;
15
- enableAnnotationCache?: boolean;
16
- enableBetaFeatures?: boolean;
17
- }
18
- export interface IProjectOptions {
19
- configuration: IConfiguration;
20
- projectNamespace: string;
21
- }
22
- export interface ICreateServiceInstanceParams {
23
- spaceGuid: string;
24
- planName: string;
25
- serviceName: string;
26
- serviceInstanceName?: string;
27
- tags: string[];
28
- parameters?: any;
29
- }
30
- export interface IGetServiceInstanceParams {
31
- [key: string]: string[] | undefined;
32
- spaceGuids?: string[];
33
- planNames?: string[];
34
- names: string[];
35
- }
36
- export interface IServiceInstance {
37
- name: string;
38
- guid: string;
39
- }
40
- export interface IResource {
41
- name: string;
42
- guid: string;
43
- tags: string[];
44
- visibility_type: string;
45
- }
46
- export interface IServiceKeys {
47
- credentials: ICredentials;
48
- serviceInstance: IServiceInstance;
49
- }
50
- export interface ICredentials {
51
- [key: string]: any;
52
- uaa: IUaa;
53
- uri: string;
54
- endpoints: any;
55
- }
56
- export interface IUaa {
57
- clientid: string;
58
- clientsecret: string;
59
- url: string;
60
- }
61
- export interface IAppVariantInfo {
62
- id: string;
63
- reference: string;
64
- layer?: string;
65
- changes: IChange[];
66
- }
67
- export interface IAppVariantManifest {
68
- id: string;
69
- reference: string;
70
- layer?: string;
71
- content: IChange[];
72
- }
73
- export interface IChange {
74
- changeType: string;
75
- texts?: IChangeText;
76
- layer?: string;
77
- content?: IChangeContent;
78
- }
79
- export interface IChangeText {
80
- i18n: string;
81
- }
82
- export interface IChangeContent {
83
- bundleUrl?: string;
84
- fallbackLocale?: string;
85
- modelId?: string;
86
- supportedLocales?: string[];
87
- }
88
- export interface ITaskParameters {
89
- workspace: any;
90
- options: IProjectOptions;
91
- taskUtil: any;
92
- }
93
- export interface IBaseAppInfo {
94
- filepath: string;
95
- content: any;
96
- }
97
- export interface IHTML5RepoInfo {
98
- token: string;
99
- baseUri: string;
100
- }
101
- export interface IAuth {
102
- username: string;
103
- password: string;
104
- }
105
- export interface IMetadata {
106
- changedOn: string;
107
- id?: string;
108
- }
109
- export type KeyedMap<T, K extends keyof T, V> = {
110
- [k in K]: V;
111
- };
112
- export interface IJsonPerLanguage {
113
- language: Language;
114
- json: any;
115
- }
116
- export interface IJsonPromisePerLanguage {
117
- language: Language;
118
- json: Promise<any>;
119
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1,21 +0,0 @@
1
- import AbapRepoManager from "../repositories/abapRepoManager";
2
- import AnnotationManager from "../annotationManager";
3
- import BaseAppFilesCacheManager from "../cache/baseAppFilesCacheManager";
4
- import { IConfiguration } from "../model/types";
5
- import IProcessor from "./processor";
6
- export default class AbapProcessor implements IProcessor {
7
- private abapRepoManager;
8
- private configuration;
9
- private cacheManager;
10
- private annotationManager;
11
- constructor(configuration: IConfiguration, cacheManager: BaseAppFilesCacheManager, abapRepoManager: AbapRepoManager, annotationManager: AnnotationManager);
12
- getBaseAppFiles(baseAppId: string): Promise<Map<string, string>>;
13
- validateConfiguration(): void;
14
- updateLandscapeSpecificContent(renamedBaseAppManifest: any, baseAppFiles?: Map<string, string>): Promise<void>;
15
- getConfigurationType(): string;
16
- createAppVariantHierarchyItem(appVariantId: string, version: string): {
17
- appVariantId: string;
18
- version: string;
19
- layer: string;
20
- };
21
- }