@sap-ux/adp-tooling 0.15.37 → 0.16.0

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 (54) hide show
  1. package/dist/cf/app/discovery.d.ts +19 -0
  2. package/dist/cf/app/discovery.js +42 -0
  3. package/dist/cf/app/html5-repo.d.ts +36 -0
  4. package/dist/cf/app/html5-repo.js +137 -0
  5. package/dist/cf/app/index.d.ts +3 -0
  6. package/dist/cf/app/index.js +19 -0
  7. package/dist/cf/core/auth.d.ts +18 -0
  8. package/dist/cf/core/auth.js +38 -0
  9. package/dist/cf/core/config.d.ts +10 -0
  10. package/dist/cf/core/config.js +68 -0
  11. package/dist/cf/core/index.d.ts +3 -0
  12. package/dist/cf/core/index.js +19 -0
  13. package/dist/cf/index.d.ts +6 -0
  14. package/dist/cf/index.js +22 -0
  15. package/dist/cf/project/index.d.ts +4 -0
  16. package/dist/cf/project/index.js +20 -0
  17. package/dist/cf/project/mta.d.ts +57 -0
  18. package/dist/cf/project/mta.js +175 -0
  19. package/dist/cf/project/yaml-loader.d.ts +24 -0
  20. package/dist/cf/project/yaml-loader.js +54 -0
  21. package/dist/cf/project/yaml.d.ts +51 -0
  22. package/dist/cf/project/yaml.js +436 -0
  23. package/dist/cf/services/api.d.ts +65 -0
  24. package/dist/cf/services/api.js +291 -0
  25. package/dist/cf/services/cli.d.ts +31 -0
  26. package/dist/cf/services/cli.js +93 -0
  27. package/dist/cf/services/index.d.ts +3 -0
  28. package/dist/cf/services/index.js +19 -0
  29. package/dist/cf/utils/index.d.ts +2 -0
  30. package/dist/cf/utils/index.js +18 -0
  31. package/dist/cf/utils/validation.d.ts +37 -0
  32. package/dist/cf/utils/validation.js +134 -0
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.js +2 -0
  35. package/dist/source/manifest.d.ts +7 -0
  36. package/dist/source/manifest.js +10 -0
  37. package/dist/translations/adp-tooling.i18n.json +33 -0
  38. package/dist/types.d.ts +410 -1
  39. package/dist/types.js +15 -1
  40. package/dist/writer/cf.d.ts +14 -0
  41. package/dist/writer/cf.js +65 -0
  42. package/dist/writer/changes/writers/component-usages-writer.js +1 -1
  43. package/dist/writer/project-utils.d.ts +24 -1
  44. package/dist/writer/project-utils.js +104 -0
  45. package/dist/writer/writer-config.d.ts +8 -1
  46. package/dist/writer/writer-config.js +47 -0
  47. package/package.json +13 -8
  48. package/templates/cf/_gitignore +6 -0
  49. package/templates/cf/approuter/package.json +13 -0
  50. package/templates/cf/approuter/xs-app.json +15 -0
  51. package/templates/cf/i18n/i18n.properties +3 -0
  52. package/templates/cf/package.json +30 -0
  53. package/templates/cf/ui5.yaml +19 -0
  54. package/templates/cf/xs-security.json +7 -0
@@ -0,0 +1,19 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { CfConfig, CFApp, CfCredentials } from '../../types';
3
+ /**
4
+ * Get the app host ids.
5
+ *
6
+ * @param {CfCredentials[]} credentials - The credentials.
7
+ * @returns {string[]} The app host ids.
8
+ */
9
+ export declare function getAppHostIds(credentials: CfCredentials[]): string[];
10
+ /**
11
+ * Discover apps from FDC API based on credentials.
12
+ *
13
+ * @param {CfCredentials[]} credentials - The credentials containing app host IDs
14
+ * @param {CfConfig} cfConfig - The CF configuration
15
+ * @param {ToolsLogger} logger - The logger
16
+ * @returns {Promise<CFApp[]>} The discovered apps
17
+ */
18
+ export declare function getCfApps(credentials: CfCredentials[], cfConfig: CfConfig, logger: ToolsLogger): Promise<CFApp[]>;
19
+ //# sourceMappingURL=discovery.d.ts.map
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAppHostIds = getAppHostIds;
4
+ exports.getCfApps = getCfApps;
5
+ const i18n_1 = require("../../i18n");
6
+ const api_1 = require("../services/api");
7
+ /**
8
+ * Get the app host ids.
9
+ *
10
+ * @param {CfCredentials[]} credentials - The credentials.
11
+ * @returns {string[]} The app host ids.
12
+ */
13
+ function getAppHostIds(credentials) {
14
+ const appHostIds = [];
15
+ for (const credential of credentials) {
16
+ const appHostId = credential['html5-apps-repo']?.app_host_id;
17
+ if (appHostId) {
18
+ // There might be multiple appHostIds separated by comma
19
+ const ids = appHostId.split(',').map((item) => item.trim());
20
+ appHostIds.push(...ids);
21
+ }
22
+ }
23
+ return [...new Set(appHostIds)];
24
+ }
25
+ /**
26
+ * Discover apps from FDC API based on credentials.
27
+ *
28
+ * @param {CfCredentials[]} credentials - The credentials containing app host IDs
29
+ * @param {CfConfig} cfConfig - The CF configuration
30
+ * @param {ToolsLogger} logger - The logger
31
+ * @returns {Promise<CFApp[]>} The discovered apps
32
+ */
33
+ async function getCfApps(credentials, cfConfig, logger) {
34
+ const appHostIds = getAppHostIds(credentials);
35
+ logger?.log(`App Host Ids: ${JSON.stringify(appHostIds)}`);
36
+ // Validate appHostIds array length (max 100 as per API specification)
37
+ if (appHostIds.length > 100) {
38
+ throw new Error((0, i18n_1.t)('error.tooManyAppHostIds', { appHostIdsLength: appHostIds.length }));
39
+ }
40
+ return (0, api_1.getFDCApps)(appHostIds, cfConfig, logger);
41
+ }
42
+ //# sourceMappingURL=discovery.js.map
@@ -0,0 +1,36 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { HTML5Content, ServiceKeys, Uaa, CfAppParams } from '../../types';
3
+ /**
4
+ * Get the OAuth token from HTML5 repository.
5
+ *
6
+ * @param {Uaa} uaa UAA credentials
7
+ * @returns {Promise<string>} OAuth token
8
+ */
9
+ export declare function getToken(uaa: Uaa): Promise<string>;
10
+ /**
11
+ * Download zip from HTML5 repository.
12
+ *
13
+ * @param {string} token - HTML5 reposiotry token.
14
+ * @param {string} appHostId - appHostId where content is stored.
15
+ * @param {string} uri - URL with parameters.
16
+ * @returns {Promise<Buffer>} File buffer content.
17
+ */
18
+ export declare function downloadZip(token: string, appHostId: string, uri: string): Promise<Buffer>;
19
+ /**
20
+ * Get HTML5 repo credentials.
21
+ *
22
+ * @param {string} spaceGuid space guid
23
+ * @param {ToolsLogger} logger logger to log messages
24
+ * @returns {Promise<ServiceKeys>} credentials json object
25
+ */
26
+ export declare function getHtml5RepoCredentials(spaceGuid: string, logger: ToolsLogger): Promise<ServiceKeys>;
27
+ /**
28
+ * Download base app manifest.json and xs-app.json from HTML5 repository.
29
+ *
30
+ * @param {string} spaceGuid current space guid
31
+ * @param {CfAppParams} parameters appName, appVersion, appHostId
32
+ * @param {ToolsLogger} logger logger to log messages
33
+ * @returns {Promise<AdmZip.IZipEntry[]>} manifest.json and xs-app.json
34
+ */
35
+ export declare function downloadAppContent(spaceGuid: string, parameters: CfAppParams, logger: ToolsLogger): Promise<HTML5Content>;
36
+ //# sourceMappingURL=html5-repo.d.ts.map
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getToken = getToken;
7
+ exports.downloadZip = downloadZip;
8
+ exports.getHtml5RepoCredentials = getHtml5RepoCredentials;
9
+ exports.downloadAppContent = downloadAppContent;
10
+ const axios_1 = __importDefault(require("axios"));
11
+ const adm_zip_1 = __importDefault(require("adm-zip"));
12
+ const i18n_1 = require("../../i18n");
13
+ const api_1 = require("../services/api");
14
+ const HTML5_APPS_REPO_RUNTIME = 'html5-apps-repo-runtime';
15
+ /**
16
+ * Get the OAuth token from HTML5 repository.
17
+ *
18
+ * @param {Uaa} uaa UAA credentials
19
+ * @returns {Promise<string>} OAuth token
20
+ */
21
+ async function getToken(uaa) {
22
+ const auth = Buffer.from(`${uaa.clientid}:${uaa.clientsecret}`);
23
+ const options = {
24
+ headers: {
25
+ 'Content-Type': 'application/json',
26
+ 'Authorization': 'Basic ' + auth.toString('base64')
27
+ }
28
+ };
29
+ const uri = `${uaa.url}/oauth/token?grant_type=client_credentials`;
30
+ try {
31
+ const response = await axios_1.default.get(uri, options);
32
+ return response.data['access_token'];
33
+ }
34
+ catch (e) {
35
+ throw new Error((0, i18n_1.t)('error.failedToGetAuthKey', { error: e.message }));
36
+ }
37
+ }
38
+ /**
39
+ * Download zip from HTML5 repository.
40
+ *
41
+ * @param {string} token - HTML5 reposiotry token.
42
+ * @param {string} appHostId - appHostId where content is stored.
43
+ * @param {string} uri - URL with parameters.
44
+ * @returns {Promise<Buffer>} File buffer content.
45
+ */
46
+ async function downloadZip(token, appHostId, uri) {
47
+ try {
48
+ const response = await axios_1.default.get(uri, {
49
+ responseType: 'arraybuffer',
50
+ headers: {
51
+ 'Content-Type': 'application/json',
52
+ 'Authorization': 'Bearer ' + token,
53
+ 'x-app-host-id': appHostId
54
+ }
55
+ });
56
+ return response.data;
57
+ }
58
+ catch (e) {
59
+ throw new Error((0, i18n_1.t)('error.failedToDownloadZipFromHtml5Repo', { error: e.message }));
60
+ }
61
+ }
62
+ /**
63
+ * Get HTML5 repo credentials.
64
+ *
65
+ * @param {string} spaceGuid space guid
66
+ * @param {ToolsLogger} logger logger to log messages
67
+ * @returns {Promise<ServiceKeys>} credentials json object
68
+ */
69
+ async function getHtml5RepoCredentials(spaceGuid, logger) {
70
+ try {
71
+ let serviceKeys = await (0, api_1.getServiceInstanceKeys)({
72
+ spaceGuids: [spaceGuid],
73
+ planNames: ['app-runtime'],
74
+ names: [HTML5_APPS_REPO_RUNTIME]
75
+ }, logger);
76
+ if (!serviceKeys?.credentials?.length) {
77
+ await (0, api_1.createService)(spaceGuid, 'app-runtime', HTML5_APPS_REPO_RUNTIME, ['html5-apps-repo-rt'], undefined, undefined, logger);
78
+ serviceKeys = await (0, api_1.getServiceInstanceKeys)({ names: [HTML5_APPS_REPO_RUNTIME] }, logger);
79
+ if (!serviceKeys?.credentials?.length) {
80
+ logger.debug((0, i18n_1.t)('error.noUaaCredentialsFoundForHtml5Repo'));
81
+ throw new Error((0, i18n_1.t)('error.cannotFindHtml5RepoRuntime'));
82
+ }
83
+ }
84
+ return serviceKeys;
85
+ }
86
+ catch (e) {
87
+ throw new Error((0, i18n_1.t)('error.failedToGetCredentialsFromHtml5Repo', { error: e.message }));
88
+ }
89
+ }
90
+ /**
91
+ * Download base app manifest.json and xs-app.json from HTML5 repository.
92
+ *
93
+ * @param {string} spaceGuid current space guid
94
+ * @param {CfAppParams} parameters appName, appVersion, appHostId
95
+ * @param {ToolsLogger} logger logger to log messages
96
+ * @returns {Promise<AdmZip.IZipEntry[]>} manifest.json and xs-app.json
97
+ */
98
+ async function downloadAppContent(spaceGuid, parameters, logger) {
99
+ const { appHostId, appName, appVersion } = parameters;
100
+ const appNameVersion = `${appName}-${appVersion}`;
101
+ try {
102
+ const htmlRepoCredentials = await getHtml5RepoCredentials(spaceGuid, logger);
103
+ const token = await getToken(htmlRepoCredentials?.credentials[0]?.uaa);
104
+ const uri = `${htmlRepoCredentials?.credentials[0]?.uri}/applications/content/${appNameVersion}?pathSuffixFilter=manifest.json,xs-app.json`;
105
+ const zip = await downloadZip(token, appHostId, uri);
106
+ let admZip;
107
+ try {
108
+ admZip = new adm_zip_1.default(zip);
109
+ }
110
+ catch (e) {
111
+ throw new Error((0, i18n_1.t)('error.failedToParseZipContent', { error: e.message }));
112
+ }
113
+ if (!admZip?.getEntries?.().length) {
114
+ throw new Error((0, i18n_1.t)('error.noZipContentParsed'));
115
+ }
116
+ const zipEntry = admZip.getEntries().find((zipEntry) => zipEntry.entryName === 'manifest.json');
117
+ if (!zipEntry) {
118
+ throw new Error((0, i18n_1.t)('error.failedToFindManifestJsonInHtml5Repo'));
119
+ }
120
+ try {
121
+ const manifest = JSON.parse(zipEntry.getData().toString('utf8'));
122
+ return {
123
+ entries: admZip.getEntries(),
124
+ serviceInstanceGuid: htmlRepoCredentials.serviceInstance.guid,
125
+ manifest: manifest
126
+ };
127
+ }
128
+ catch (e) {
129
+ throw new Error((0, i18n_1.t)('error.failedToParseManifestJson', { error: e.message }));
130
+ }
131
+ }
132
+ catch (e) {
133
+ logger.error(e);
134
+ throw new Error((0, i18n_1.t)('error.failedToDownloadAppContent', { spaceGuid, appName, appHostId, error: e.message }));
135
+ }
136
+ }
137
+ //# sourceMappingURL=html5-repo.js.map
@@ -0,0 +1,3 @@
1
+ export * from './discovery';
2
+ export * from './html5-repo';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./discovery"), exports);
18
+ __exportStar(require("./html5-repo"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,18 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { CfConfig } from '../../types';
3
+ /**
4
+ * Check if the external login is enabled.
5
+ *
6
+ * @param {any} vscode - The vscode instance.
7
+ * @returns {Promise<boolean>} Whether the external login is enabled.
8
+ */
9
+ export declare function isExternalLoginEnabled(vscode: any): Promise<boolean>;
10
+ /**
11
+ * Check if the user is logged in Cloud Foundry.
12
+ *
13
+ * @param {CfConfig} cfConfig - The CF config.
14
+ * @param {ToolsLogger} logger - The logger.
15
+ * @returns {Promise<boolean>} Whether the user is logged in.
16
+ */
17
+ export declare function isLoggedInCf(cfConfig: CfConfig, logger: ToolsLogger): Promise<boolean>;
18
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isExternalLoginEnabled = isExternalLoginEnabled;
4
+ exports.isLoggedInCf = isLoggedInCf;
5
+ const CFLocal = require("@sap/cf-tools/out/src/cf-local");
6
+ /**
7
+ * Check if the external login is enabled.
8
+ *
9
+ * @param {any} vscode - The vscode instance.
10
+ * @returns {Promise<boolean>} Whether the external login is enabled.
11
+ */
12
+ async function isExternalLoginEnabled(vscode) {
13
+ const commands = await vscode.commands.getCommands();
14
+ return commands?.includes('cf.login');
15
+ }
16
+ /**
17
+ * Check if the user is logged in Cloud Foundry.
18
+ *
19
+ * @param {CfConfig} cfConfig - The CF config.
20
+ * @param {ToolsLogger} logger - The logger.
21
+ * @returns {Promise<boolean>} Whether the user is logged in.
22
+ */
23
+ async function isLoggedInCf(cfConfig, logger) {
24
+ if (!cfConfig) {
25
+ logger?.error('CF config is not provided');
26
+ return false;
27
+ }
28
+ try {
29
+ const orgs = (await CFLocal.cfGetAvailableOrgs());
30
+ logger?.log(`Available organizations: ${JSON.stringify(orgs)}`);
31
+ return true;
32
+ }
33
+ catch (e) {
34
+ logger?.error(`Error occurred while trying to check if it is logged in: ${e?.message}`);
35
+ }
36
+ return false;
37
+ }
38
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1,10 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { CfConfig } from '../../types';
3
+ /**
4
+ * Load the CF configuration.
5
+ *
6
+ * @param {ToolsLogger} logger - The logger.
7
+ * @returns {CfConfig} The CF configuration.
8
+ */
9
+ export declare function loadCfConfig(logger: ToolsLogger): CfConfig;
10
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.loadCfConfig = loadCfConfig;
7
+ const node_os_1 = __importDefault(require("node:os"));
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ /**
11
+ * Get the home directory.
12
+ *
13
+ * @returns {string} The home directory.
14
+ */
15
+ function getHomedir() {
16
+ let homedir = node_os_1.default.homedir();
17
+ const homeDrive = process.env?.['HOMEDRIVE'];
18
+ const homePath = process.env?.['HOMEPATH'];
19
+ if (process.platform === 'win32' && typeof homeDrive === 'string' && typeof homePath === 'string') {
20
+ homedir = node_path_1.default.join(homeDrive, homePath);
21
+ }
22
+ return homedir;
23
+ }
24
+ /**
25
+ * Load the CF configuration.
26
+ *
27
+ * @param {ToolsLogger} logger - The logger.
28
+ * @returns {CfConfig} The CF configuration.
29
+ */
30
+ function loadCfConfig(logger) {
31
+ let cfHome = process.env['CF_HOME'];
32
+ if (!cfHome) {
33
+ cfHome = node_path_1.default.join(getHomedir(), '.cf');
34
+ }
35
+ const configFileLocation = node_path_1.default.join(cfHome, 'config.json');
36
+ let config = {};
37
+ try {
38
+ const configAsString = node_fs_1.default.readFileSync(configFileLocation, 'utf-8');
39
+ config = JSON.parse(configAsString);
40
+ }
41
+ catch (e) {
42
+ logger?.error('Cannot receive token from config.json');
43
+ }
44
+ const result = {};
45
+ if (config) {
46
+ if (config.Target) {
47
+ const apiCfIndex = config.Target.indexOf('api.cf.');
48
+ result.url = config.Target.substring(apiCfIndex + 'api.cf.'.length);
49
+ }
50
+ if (config.AccessToken) {
51
+ result.token = config.AccessToken.substring('bearer '.length);
52
+ }
53
+ if (config.OrganizationFields) {
54
+ result.org = {
55
+ Name: config.OrganizationFields.Name,
56
+ GUID: config.OrganizationFields.GUID
57
+ };
58
+ }
59
+ if (config.SpaceFields) {
60
+ result.space = {
61
+ Name: config.SpaceFields.Name,
62
+ GUID: config.SpaceFields.GUID
63
+ };
64
+ }
65
+ }
66
+ return result;
67
+ }
68
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,3 @@
1
+ export * from './auth';
2
+ export * from './config';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth"), exports);
18
+ __exportStar(require("./config"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ export * from './project';
2
+ export * from './app';
3
+ export * from './core';
4
+ export * from './services';
5
+ export * from './utils';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./project"), exports);
18
+ __exportStar(require("./app"), exports);
19
+ __exportStar(require("./core"), exports);
20
+ __exportStar(require("./services"), exports);
21
+ __exportStar(require("./utils"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ export * from './yaml';
2
+ export * from './yaml-loader';
3
+ export * from './mta';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./yaml"), exports);
18
+ __exportStar(require("./yaml-loader"), exports);
19
+ __exportStar(require("./mta"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,57 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { BusinessServiceResource, AppRouterType } from '../../types';
3
+ /**
4
+ * Get the approuter type.
5
+ *
6
+ * @param {string} mtaProjectPath - The path to the mta project.
7
+ * @returns {AppRouterType} The approuter type.
8
+ */
9
+ export declare function getApprouterType(mtaProjectPath: string): AppRouterType;
10
+ /**
11
+ * Get the module names.
12
+ *
13
+ * @param {string} mtaProjectPath - The path to the mta project.
14
+ * @returns {string[]} The module names.
15
+ */
16
+ export declare function getModuleNames(mtaProjectPath: string): string[];
17
+ /**
18
+ * Get the services for the file.
19
+ *
20
+ * @param {string} mtaFilePath - The path to the mta file.
21
+ * @param {ToolsLogger} logger - The logger.
22
+ * @returns {BusinessServiceResource[]} The services.
23
+ */
24
+ export declare function getServicesForFile(mtaFilePath: string, logger: ToolsLogger): BusinessServiceResource[];
25
+ /**
26
+ * Check if the project has an approuter.
27
+ *
28
+ * @param {string} projectName - The project name.
29
+ * @param {string[]} moduleNames - The module names.
30
+ * @returns {boolean} Whether the project has an approuter.
31
+ */
32
+ export declare function hasApprouter(projectName: string, moduleNames: string[]): boolean;
33
+ /**
34
+ * Get the services for the MTA project.
35
+ *
36
+ * @param {string} projectPath - The path to the project.
37
+ * @param {ToolsLogger} logger - The logger.
38
+ * @returns {Promise<string[]>} The services.
39
+ */
40
+ export declare function getMtaServices(projectPath: string, logger: ToolsLogger): Promise<string[]>;
41
+ /**
42
+ * Get the resources for the MTA file.
43
+ *
44
+ * @param {string} mtaFilePath - The path to the mta file.
45
+ * @param {ToolsLogger} logger - The logger.
46
+ * @returns {Promise<string[]>} The resources.
47
+ */
48
+ export declare function getResources(mtaFilePath: string, logger: ToolsLogger): Promise<string[]>;
49
+ /**
50
+ * Read the MTA file.
51
+ *
52
+ * @param {string} projectPath - The path to the project.
53
+ * @param {ToolsLogger} logger - The logger.
54
+ * @returns {Promise<string[]>} The resources.
55
+ */
56
+ export declare function readMta(projectPath: string, logger: ToolsLogger): Promise<string[]>;
57
+ //# sourceMappingURL=mta.d.ts.map