@ui5/task-adaptation 1.6.4 → 1.6.5-rc.2

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 (55) hide show
  1. package/CHANGELOG.md +53 -6
  2. package/dist/adapters/abapAdapter.d.ts +2 -4
  3. package/dist/adapters/abapAdapter.js +2 -4
  4. package/dist/adapters/commands/downloadAnnotationsCommand.d.ts +2 -4
  5. package/dist/adapters/commands/downloadAnnotationsCommand.js +2 -6
  6. package/dist/annotations/abapAnnotationManager.d.ts +17 -0
  7. package/dist/{annotationManager.js → annotations/abapAnnotationManager.js} +12 -10
  8. package/dist/annotations/annotationManager.d.ts +3 -0
  9. package/dist/annotations/annotationManager.js +2 -0
  10. package/dist/annotations/cfAnnotationManager.d.ts +4 -0
  11. package/dist/annotations/cfAnnotationManager.js +7 -0
  12. package/dist/annotations/localAnnotationManager.d.ts +4 -0
  13. package/dist/annotations/localAnnotationManager.js +7 -0
  14. package/dist/annotations/serviceRequestor.d.ts +3 -3
  15. package/dist/annotations/serviceRequestor.js +4 -4
  16. package/dist/index.js +5 -6
  17. package/dist/landscapeConfiguration.d.ts +9 -0
  18. package/dist/landscapeConfiguration.js +94 -0
  19. package/dist/model/configuration.d.ts +7 -1
  20. package/dist/model/configuration.js +2 -1
  21. package/dist/previewManager.d.ts +2 -2
  22. package/dist/previewManager.js +7 -7
  23. package/dist/repositories/abapProvider.d.ts +1 -1
  24. package/dist/repositories/abapProvider.js +3 -18
  25. package/dist/repositories/{abapRepoManager.d.ts → abapRepository.d.ts} +5 -3
  26. package/dist/repositories/{abapRepoManager.js → abapRepository.js} +17 -4
  27. package/dist/repositories/html5Repository.d.ts +19 -0
  28. package/dist/repositories/{html5RepoManager.js → html5Repository.js} +59 -27
  29. package/dist/repositories/localRepository.d.ts +16 -0
  30. package/dist/repositories/localRepository.js +67 -0
  31. package/dist/repositories/repository.d.ts +8 -0
  32. package/dist/repositories/repository.js +2 -0
  33. package/dist/util/commonUtil.d.ts +1 -0
  34. package/dist/util/commonUtil.js +3 -0
  35. package/dist/util/fsUtil.d.ts +2 -0
  36. package/dist/util/fsUtil.js +34 -0
  37. package/dist/util/validator/abapValidator.d.ts +8 -0
  38. package/dist/util/validator/abapValidator.js +26 -0
  39. package/dist/util/validator/cfValidator.d.ts +6 -0
  40. package/dist/util/validator/cfValidator.js +8 -0
  41. package/dist/util/validator/validator.d.ts +6 -0
  42. package/dist/util/validator/validator.js +4 -0
  43. package/package.json +4 -7
  44. package/scripts/publish.ts +256 -0
  45. package/scripts/test-integration-prep.sh +4 -0
  46. package/dist/annotationManager.d.ts +0 -17
  47. package/dist/processors/abapProcessor.d.ts +0 -18
  48. package/dist/processors/abapProcessor.js +0 -43
  49. package/dist/processors/cfProcessor.d.ts +0 -14
  50. package/dist/processors/cfProcessor.js +0 -46
  51. package/dist/processors/previewProcessor.d.ts +0 -8
  52. package/dist/processors/previewProcessor.js +0 -11
  53. package/dist/processors/processor.d.ts +0 -10
  54. package/dist/processors/processor.js +0 -39
  55. package/dist/repositories/html5RepoManager.d.ts +0 -12
@@ -1,7 +1,14 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import AbapProvider from "./abapProvider.js";
2
8
  import { getLogger } from "@ui5/logger";
3
9
  import { unzipZipEntries } from "../util/zipUtil.js";
4
- const log = getLogger("@ui5/task-adaptation::AbapRepoManager");
10
+ import { cached } from "../cache/cacheHolder.js";
11
+ const log = getLogger("@ui5/task-adaptation::AbapRepository");
5
12
  const REQUEST_OPTIONS_XML = {
6
13
  responseType: "text",
7
14
  headers: {
@@ -13,13 +20,16 @@ const REQUEST_OPTIONS_JSON = {
13
20
  "Accept": "application/json"
14
21
  }
15
22
  };
16
- export default class AbapRepoManager {
23
+ export default class AbapRepository {
17
24
  configuration;
18
25
  abapProvider;
19
26
  constructor(configuration, abapProvider) {
20
27
  this.configuration = configuration;
21
28
  this.abapProvider = abapProvider ? abapProvider : new AbapProvider();
22
29
  }
30
+ fetchReuseLib(_libName, _cachebusterToken, _lib) {
31
+ throw new Error("Preview is not available on SAP S/4HANA On-Premise or Cloud Systems. Please create a ticket on CA-UI5-FL-ADP-BAS component.");
32
+ }
23
33
  async getAppVariantIdHierarchy(id) {
24
34
  const provider = await this.abapProvider.get(this.configuration);
25
35
  const lrep = provider.getLayeredRepository();
@@ -68,7 +78,7 @@ export default class AbapRepoManager {
68
78
  id
69
79
  };
70
80
  }
71
- async fetch(repoName) {
81
+ async fetch(repoName, _cachebusterToken) {
72
82
  const encodedRepoName = encodeURIComponent(repoName);
73
83
  const provider = await this.abapProvider.get(this.configuration);
74
84
  const ui5Repo = provider.getUi5AbapRepository();
@@ -87,4 +97,7 @@ export default class AbapRepoManager {
87
97
  throw new Error(`App '${repoName}' doesn't contain files`);
88
98
  }
89
99
  }
90
- //# sourceMappingURL=abapRepoManager.js.map
100
+ __decorate([
101
+ cached()
102
+ ], AbapRepository.prototype, "fetch", null);
103
+ //# sourceMappingURL=abapRepository.js.map
@@ -0,0 +1,19 @@
1
+ import { IConfiguration, IReuseLibInfo } from "./../model/types.js";
2
+ import IRepository from "./repository.js";
3
+ import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
4
+ export default class HTML5Repository implements IRepository {
5
+ private configuration;
6
+ private validator;
7
+ constructor(configuration: IConfiguration);
8
+ getAppVariantIdHierarchy(appId: string): Promise<IAppVariantIdHierarchyItem[]>;
9
+ fetch(_repoName: string, _cachebusterToken: string): Promise<Map<string, string>>;
10
+ fetchReuseLib(_libName: string, _cachebusterToken: string, lib: IReuseLibInfo): Promise<Map<string, string>>;
11
+ getMetadata(): Promise<any>;
12
+ private getHtml5RepoInfo;
13
+ private getHTML5Credentials;
14
+ private getToken;
15
+ private requestMetadata;
16
+ private getAppZipEntries;
17
+ private download;
18
+ downloadAnnotationFile(_uri: string): Promise<Map<string, string>>;
19
+ }
@@ -1,24 +1,42 @@
1
- import CFUtil from "./../util/cfUtil.js";
2
- import RequestUtil from "./../util/requestUtil.js";
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import CFUtil from "../util/cfUtil.js";
8
+ import RequestUtil from "../util/requestUtil.js";
3
9
  import { getLogger } from "@ui5/logger";
4
- import { unzipZipEntries } from "./../util/zipUtil.js";
5
- const log = getLogger("@ui5/task-adaptation::HTML5RepoManager");
6
- export default class HTML5RepoManager {
7
- static async getBaseAppFiles(configuration) {
8
- const { token, baseUri } = await this.getHtml5RepoInfo(configuration);
9
- const app = {
10
- appName: configuration.appName,
11
- appVersion: configuration.appVersion,
12
- appHostId: configuration.appHostId
13
- };
14
- return this.getAppZipEntries(app, baseUri, token);
10
+ import { unzipZipEntries } from "../util/zipUtil.js";
11
+ import { cached } from "../cache/cacheHolder.js";
12
+ import CFValidator from "../util/validator/cfValidator.js";
13
+ const log = getLogger("@ui5/task-adaptation::HTML5Repository");
14
+ export default class HTML5Repository {
15
+ configuration;
16
+ validator = new CFValidator();
17
+ constructor(configuration) {
18
+ this.configuration = configuration;
19
+ this.validator.validateConfiguration(configuration);
20
+ }
21
+ async getAppVariantIdHierarchy(appId) {
22
+ const metadata = await this.getMetadata();
23
+ return [{
24
+ repoName: this.configuration.appName,
25
+ appVariantId: appId,
26
+ cachebusterToken: metadata.changedOn
27
+ }];
15
28
  }
16
- static async getMetadata(configuration) {
17
- const { token, baseUri } = await this.getHtml5RepoInfo(configuration);
18
- return this.requestMetadata(configuration, baseUri, token);
29
+ async fetch(_repoName, _cachebusterToken) {
30
+ const { token, baseUri } = await this.getHtml5RepoInfo();
31
+ const appData = {
32
+ appName: this.configuration.appName,
33
+ appVersion: this.configuration.appVersion,
34
+ appHostId: this.configuration.appHostId
35
+ };
36
+ return this.getAppZipEntries(appData, baseUri, token);
19
37
  }
20
- static async getReuseLibFiles(configuration, lib) {
21
- const { token, baseUri } = await this.getHtml5RepoInfo(configuration);
38
+ async fetchReuseLib(_libName, _cachebusterToken, lib) {
39
+ const { token, baseUri } = await this.getHtml5RepoInfo();
22
40
  const libAppData = {
23
41
  appName: lib.html5AppName,
24
42
  appVersion: lib.html5AppVersion,
@@ -26,8 +44,12 @@ export default class HTML5RepoManager {
26
44
  };
27
45
  return this.getAppZipEntries(libAppData, baseUri, token);
28
46
  }
29
- static async getHtml5RepoInfo(configuration) {
30
- const spaceGuid = await CFUtil.getSpaceGuid(configuration?.space);
47
+ async getMetadata() {
48
+ const { token, baseUri } = await this.getHtml5RepoInfo();
49
+ return this.requestMetadata(baseUri, token);
50
+ }
51
+ async getHtml5RepoInfo() {
52
+ const spaceGuid = await CFUtil.getSpaceGuid(this.configuration?.space);
31
53
  const credentials = await this.getHTML5Credentials(spaceGuid);
32
54
  const token = await this.getToken(credentials);
33
55
  if (!token || token.length === 0) {
@@ -41,7 +63,7 @@ export default class HTML5RepoManager {
41
63
  baseUri: credentials.uri
42
64
  };
43
65
  }
44
- static async getHTML5Credentials(spaceGuid) {
66
+ async getHTML5Credentials(spaceGuid) {
45
67
  log.verbose("Getting HTML5 Repo Runtime credentials from space " + spaceGuid);
46
68
  const PLAN_NAME = "app-runtime";
47
69
  const SERVIСE_INSTANCE_NAME = "html5-apps-repo-runtime";
@@ -60,7 +82,7 @@ export default class HTML5RepoManager {
60
82
  const serviceKeys = await CFUtil.getServiceInstanceKeys(getParams, createParams);
61
83
  return serviceKeys.credentials;
62
84
  }
63
- static async getToken({ uaa }) {
85
+ async getToken({ uaa }) {
64
86
  log.verbose("Getting HTML5 Repo token");
65
87
  const auth = Buffer.from(uaa.clientid + ":" + uaa.clientsecret);
66
88
  const options = {
@@ -72,8 +94,8 @@ export default class HTML5RepoManager {
72
94
  const uri = `${uaa.url}/oauth/token?grant_type=client_credentials`;
73
95
  return RequestUtil.get(uri, options).then((json) => json["access_token"]);
74
96
  }
75
- static async requestMetadata(options, html5RepoBaseUri, token) {
76
- const { appHostId, appName, appVersion } = options;
97
+ async requestMetadata(html5RepoBaseUri, token) {
98
+ const { appHostId, appName, appVersion } = this.configuration;
77
99
  const uri = `${html5RepoBaseUri}/applications/metadata/`;
78
100
  const requestOptions = {
79
101
  headers: {
@@ -85,12 +107,12 @@ export default class HTML5RepoManager {
85
107
  const metadata = await RequestUtil.get(uri, requestOptions);
86
108
  return metadata.find((item) => item.appHostId === appHostId && item.applicationName === appName && item.applicationVersion === appVersion);
87
109
  }
88
- static async getAppZipEntries(app, html5RepoBaseUri, token) {
110
+ async getAppZipEntries(app, html5RepoBaseUri, token) {
89
111
  const uri = `${html5RepoBaseUri}/applications/content/${app.appName}-${app.appVersion}/`;
90
112
  const zip = await this.download(token, app.appHostId, uri);
91
113
  return unzipZipEntries(zip);
92
114
  }
93
- static async download(token, appHostId, uri) {
115
+ async download(token, appHostId, uri) {
94
116
  if (!token) {
95
117
  throw new Error("HTML5 token is undefined");
96
118
  }
@@ -103,5 +125,15 @@ export default class HTML5RepoManager {
103
125
  }
104
126
  });
105
127
  }
128
+ downloadAnnotationFile(_uri) {
129
+ log.verbose("No annotation processing in CF");
130
+ return Promise.resolve(new Map());
131
+ }
106
132
  }
107
- //# sourceMappingURL=html5RepoManager.js.map
133
+ __decorate([
134
+ cached()
135
+ ], HTML5Repository.prototype, "fetch", null);
136
+ __decorate([
137
+ cached()
138
+ ], HTML5Repository.prototype, "fetchReuseLib", null);
139
+ //# sourceMappingURL=html5Repository.js.map
@@ -0,0 +1,16 @@
1
+ import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
2
+ import { IConfiguration } from "../model/configuration.js";
3
+ import { IReuseLibInfo } from "../model/types.js";
4
+ import IRepository from "./repository.js";
5
+ export default class LocalRepository implements IRepository {
6
+ private configuration;
7
+ constructor(configuration: IConfiguration);
8
+ downloadAnnotationFile(_uri: string): Promise<Map<string, string>>;
9
+ getAppVariantIdHierarchy(appId: string): Promise<IAppVariantIdHierarchyItem[]>;
10
+ fetch(appId: string, cachebusterToken: string): Promise<Map<string, string>>;
11
+ fetchReuseLib(libName: string, cachebusterToken: string, _lib: IReuseLibInfo): Promise<Map<string, string>>;
12
+ private collectAppVariantIdHierarchyItems;
13
+ private getExistingManifestPath;
14
+ private readFilesInBaseAppDir;
15
+ private getLocalFilesDirectory;
16
+ }
@@ -0,0 +1,67 @@
1
+ import { getLogger } from "@ui5/logger";
2
+ import path from "node:path";
3
+ import fs from "node:fs/promises";
4
+ import FsUtil from "../util/fsUtil.js";
5
+ const log = getLogger("@ui5/task-adaptation::LocalRepository");
6
+ export default class LocalRepository {
7
+ configuration;
8
+ constructor(configuration) {
9
+ this.configuration = configuration;
10
+ }
11
+ async downloadAnnotationFile(_uri) {
12
+ log.verbose("Downloading annotation files is not supported in LocalRepository.");
13
+ return new Map();
14
+ }
15
+ async getAppVariantIdHierarchy(appId) {
16
+ const items = [];
17
+ await this.collectAppVariantIdHierarchyItems(appId, items);
18
+ return items;
19
+ }
20
+ fetch(appId, cachebusterToken) {
21
+ return this.readFilesInBaseAppDir(appId, cachebusterToken);
22
+ }
23
+ fetchReuseLib(libName, cachebusterToken, _lib) {
24
+ return this.readFilesInBaseAppDir(libName, cachebusterToken);
25
+ }
26
+ async collectAppVariantIdHierarchyItems(appId, items) {
27
+ const appDir = this.getLocalFilesDirectory(appId);
28
+ const filenames = [
29
+ ["manifest.json"],
30
+ ["manifest.appdescr_variant"],
31
+ ["webapp", "manifest.json"],
32
+ ["webapp", "manifest.appdescr_variant"],
33
+ ];
34
+ const filepaths = filenames.map((filename) => path.join(appDir, ...filename));
35
+ const existingManifestPath = await this.getExistingManifestPath(filepaths);
36
+ items.push({
37
+ appVariantId: appId,
38
+ repoName: appId,
39
+ cachebusterToken: path.dirname(existingManifestPath)
40
+ });
41
+ if (existingManifestPath.endsWith("manifest.appdescr_variant")) {
42
+ const manifestContent = await fs.readFile(existingManifestPath, "utf-8");
43
+ const manifest = JSON.parse(manifestContent);
44
+ await this.collectAppVariantIdHierarchyItems(manifest.reference, items);
45
+ }
46
+ }
47
+ async getExistingManifestPath(filePaths) {
48
+ const existenceChecks = await Promise.all(filePaths.map((filePath) => FsUtil.exists(filePath)));
49
+ const existingIndex = existenceChecks.findIndex((exists) => exists);
50
+ if (existingIndex !== -1) {
51
+ return filePaths[existingIndex];
52
+ }
53
+ throw new Error(`None of the paths exist: '${filePaths.join("', '")}'.`);
54
+ }
55
+ readFilesInBaseAppDir(_appId, cachebusterToken) {
56
+ log.verbose(`Fetching base app files from local directory: ${cachebusterToken}`);
57
+ return FsUtil.readFilesRecursively(cachebusterToken);
58
+ }
59
+ getLocalFilesDirectory(appId) {
60
+ const adpDirConfigured = process.env.ADP_BUILDER_DIR || this.configuration.adpDir;
61
+ const adpDir = adpDirConfigured
62
+ ? path.normalize(adpDirConfigured).replace(/\\/g, "/").replace(/\/+$/, "").split("/")
63
+ : [".."];
64
+ return path.join(process.cwd(), ...adpDir, appId);
65
+ }
66
+ }
67
+ //# sourceMappingURL=localRepository.js.map
@@ -0,0 +1,8 @@
1
+ import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
2
+ import { IReuseLibInfo } from "../model/types.js";
3
+ export default interface IRepository {
4
+ getAppVariantIdHierarchy(appId: string): Promise<IAppVariantIdHierarchyItem[]>;
5
+ fetch(repoName: string, cachebusterToken: string): Promise<Map<string, string>>;
6
+ fetchReuseLib(libName: string, cachebusterToken: string, lib: IReuseLibInfo): Promise<Map<string, string>>;
7
+ downloadAnnotationFile(uri: string): Promise<Map<string, string>>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=repository.js.map
@@ -1,6 +1,7 @@
1
1
  import { IConfiguration } from "../model/types.js";
2
2
  import Language from "../model/language.js";
3
3
  export declare function dotToUnderscore(value: string): string;
4
+ export declare function validateConfiguration<T extends object>(options: T, properties: Array<keyof T>): void;
4
5
  export declare function validateObject<T extends object>(options: T, properties: Array<keyof T>, message: string): void;
5
6
  export declare function escapeRegex(update: string): string;
6
7
  export declare function insertInArray<T>(array: T[], index: number, insert: T): void;
@@ -9,6 +9,9 @@ const MANIFEST_CHANGE = "appdescr_";
9
9
  export function dotToUnderscore(value) {
10
10
  return value.replace(/\./g, "_");
11
11
  }
12
+ export function validateConfiguration(options, properties) {
13
+ validateObject(options, properties, "should be specified in ui5.yaml configuration");
14
+ }
12
15
  export function validateObject(options, properties, message) {
13
16
  for (const property of properties) {
14
17
  if (!options[property]) {
@@ -6,4 +6,6 @@ export default class FsUtil {
6
6
  * @returns true if the path exists, false if not
7
7
  */
8
8
  private static fileExists;
9
+ static readFilesRecursively(rootDirectory: string): Promise<Map<string, string>>;
10
+ static exists(filePath: string): Promise<boolean>;
9
11
  }
@@ -36,5 +36,39 @@ export default class FsUtil {
36
36
  throw e;
37
37
  }
38
38
  }
39
+ static async readFilesRecursively(rootDirectory) {
40
+ const directoriesToScan = [rootDirectory];
41
+ const fileReadTasks = [];
42
+ while (directoriesToScan.length > 0) {
43
+ const currentDirectory = directoriesToScan.pop();
44
+ if (!currentDirectory) {
45
+ continue;
46
+ }
47
+ const entries = await fs.readdir(currentDirectory, { withFileTypes: true });
48
+ for (const entry of entries) {
49
+ const entryPath = path.join(currentDirectory, entry.name);
50
+ if (entry.isDirectory()) {
51
+ directoriesToScan.push(entryPath);
52
+ }
53
+ else if (entry.isFile()) {
54
+ fileReadTasks.push((async () => {
55
+ const relativeFilePath = path.relative(rootDirectory, entryPath);
56
+ const content = await fs.readFile(entryPath, "utf-8");
57
+ return [relativeFilePath, content];
58
+ })());
59
+ }
60
+ }
61
+ }
62
+ return new Map(await Promise.all(fileReadTasks));
63
+ }
64
+ static async exists(filePath) {
65
+ try {
66
+ await fs.access(filePath);
67
+ return true;
68
+ }
69
+ catch {
70
+ return false;
71
+ }
72
+ }
39
73
  }
40
74
  //# sourceMappingURL=fsUtil.js.map
@@ -0,0 +1,8 @@
1
+ import { AbapTarget } from "@sap-ux/system-access";
2
+ import { IAbapTargetMeta, IConfiguration, LandscapeType } from "../../model/configuration.js";
3
+ import IValidator from "./validator.js";
4
+ export default class AbapValidator implements IValidator {
5
+ type: LandscapeType;
6
+ validateAndGetAbapTarget(target: AbapTarget & IAbapTargetMeta | undefined, destination: string | undefined): AbapTarget & IAbapTargetMeta;
7
+ validateConfiguration({ target, destination }: IConfiguration): void;
8
+ }
@@ -0,0 +1,26 @@
1
+ import { validateObject } from "../commonUtil.js";
2
+ import BtpUtils from "@sap-ux/btp-utils";
3
+ import { getLogger } from "@ui5/logger";
4
+ const log = getLogger("@ui5/task-adaptation::AbapValidator");
5
+ export default class AbapValidator {
6
+ type = "abap";
7
+ validateAndGetAbapTarget(target, destination) {
8
+ if (target) {
9
+ // if target configuration appears, we validate that it should be
10
+ // either target/destination for BAS or target/url for IDE we're
11
+ // trying to detect is it destination for BAS or url for IDE
12
+ const abapTargetProperties = BtpUtils.isAppStudio() ? ["destination"] : ["url"];
13
+ validateObject(target, abapTargetProperties, "should be specified in ui5.yaml configuration/target");
14
+ return target;
15
+ }
16
+ else if (destination) {
17
+ log.warn("Destination is deprecated, use target/destination configuration instead");
18
+ return { destination };
19
+ }
20
+ throw new Error("Target should be specified in ui5.yaml configuration to connect the ABAP system");
21
+ }
22
+ validateConfiguration({ target, destination }) {
23
+ this.validateAndGetAbapTarget(target, destination);
24
+ }
25
+ }
26
+ //# sourceMappingURL=abapValidator.js.map
@@ -0,0 +1,6 @@
1
+ import { IConfiguration, LandscapeType } from "../../model/configuration.js";
2
+ import IValidator from "./validator.js";
3
+ export default class CFValidator implements IValidator {
4
+ type: LandscapeType;
5
+ validateConfiguration(configuration: IConfiguration): void;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { validateConfiguration } from "../commonUtil.js";
2
+ export default class CFValidator {
3
+ type = "cf";
4
+ validateConfiguration(configuration) {
5
+ validateConfiguration(configuration, ["appHostId", "appName", "appVersion"]);
6
+ }
7
+ }
8
+ //# sourceMappingURL=cfValidator.js.map
@@ -0,0 +1,6 @@
1
+ import { IConfiguration, LandscapeType } from "../../model/configuration.js";
2
+ export default interface IValidator {
3
+ type: LandscapeType;
4
+ validateConfiguration(configuration: IConfiguration): void;
5
+ }
6
+ export declare function isOneOf<T extends readonly unknown[]>(values: T, value: unknown): value is T[number];
@@ -0,0 +1,4 @@
1
+ export function isOneOf(values, value) {
2
+ return values.includes(value);
3
+ }
4
+ //# sourceMappingURL=validator.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/task-adaptation",
3
- "version": "1.6.4",
3
+ "version": "1.6.5-rc.2",
4
4
  "description": "Custom task for ui5-builder which allows building UI5 Flexibility Adaptation Projects for SAP BTP, Cloud Foundry environment",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -97,25 +97,22 @@
97
97
  "text-summary"
98
98
  ],
99
99
  "exclude": [
100
- ".eslintrc.js",
101
- "docs/**",
102
- "jsdocs/**",
103
100
  "coverage/**",
104
101
  "test/**",
105
- "lib/processors/jsdoc/lib/**",
106
102
  "dist/**",
107
103
  "src/model/types.ts",
108
104
  "src/util/requestUtil.ts",
109
105
  "src/util/renamingHandlers/renamingHandler.ts",
110
106
  "scripts/**/*.js",
111
- "scripts/git/octokitUtil.ts",
112
107
  "*/**/*.d.ts",
113
108
  "src/annotations/comparator/diffCase.ts",
114
109
  "src/annotations/transformers/transformer.ts",
115
110
  "src/model/configuration.ts",
116
111
  "src/model/appVariantIdHierarchyItem.ts",
117
112
  "src/adapters/adapter.ts",
118
- "src/adapters/previewAdapter.ts"
113
+ "src/adapters/previewAdapter.ts",
114
+ "src/repositories/repository.ts",
115
+ "src/annotations/annotationManager.ts"
119
116
  ],
120
117
  "check-coverage": true,
121
118
  "statements": 85,