@sap-ux/adp-tooling 0.13.21 → 0.13.24

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 (43) hide show
  1. package/dist/abap/client.d.ts +18 -0
  2. package/dist/abap/client.js +43 -0
  3. package/dist/abap/config.d.ts +19 -0
  4. package/dist/abap/config.js +50 -0
  5. package/dist/abap/index.d.ts +4 -0
  6. package/dist/{client → abap}/index.js +3 -3
  7. package/dist/abap/provider.d.ts +22 -0
  8. package/dist/abap/provider.js +33 -0
  9. package/dist/base/constants/index.d.ts +8 -0
  10. package/dist/base/constants/index.js +9 -1
  11. package/dist/base/prompt.js +2 -2
  12. package/dist/index.d.ts +3 -1
  13. package/dist/index.js +3 -1
  14. package/dist/preview/routes-handler.js +17 -7
  15. package/dist/source/applications.d.ts +41 -0
  16. package/dist/source/applications.js +94 -0
  17. package/dist/source/index.d.ts +4 -0
  18. package/dist/source/index.js +20 -0
  19. package/dist/source/manifest.d.ts +70 -0
  20. package/dist/source/manifest.js +123 -0
  21. package/dist/{client/target-systems.d.ts → source/systems.d.ts} +2 -2
  22. package/dist/{client/target-systems.js → source/systems.js} +4 -4
  23. package/dist/translations/adp-tooling.i18n.json +2 -1
  24. package/dist/types.d.ts +15 -2
  25. package/dist/ui5/fetch.d.ts +16 -0
  26. package/dist/ui5/fetch.js +34 -0
  27. package/dist/ui5/format.d.ts +80 -0
  28. package/dist/ui5/format.js +135 -0
  29. package/dist/ui5/index.d.ts +4 -0
  30. package/dist/ui5/index.js +20 -0
  31. package/dist/ui5/version-info.d.ts +106 -0
  32. package/dist/ui5/version-info.js +193 -0
  33. package/dist/writer/changes/writers/annotations-writer.js +17 -7
  34. package/dist/writer/project-utils.d.ts +10 -11
  35. package/dist/writer/project-utils.js +10 -8
  36. package/dist/writer/writer-config.d.ts +45 -21
  37. package/dist/writer/writer-config.js +44 -46
  38. package/package.json +1 -1
  39. package/dist/client/abap-provider.d.ts +0 -53
  40. package/dist/client/abap-provider.js +0 -106
  41. package/dist/client/index.d.ts +0 -4
  42. package/dist/client/target-applications.d.ts +0 -56
  43. package/dist/client/target-applications.js +0 -112
@@ -0,0 +1,18 @@
1
+ import { type AbapServiceProvider } from '@sap-ux/axios-extension';
2
+ import type { FlexUISupportedSystem } from '../types';
3
+ /**
4
+ * Fetches system supports Flex UI features.
5
+ *
6
+ * @param {AbapServiceProvider} provider - Instance of the ABAP provider.
7
+ * @param {boolean} isCustomerBase - Indicates whether the adaptation layer is CUSTOMER_BASE.
8
+ * @returns {Promise<FlexUISupportedSystem | undefined>} settings indicating support for onPremise and UI Flex capabilities.
9
+ */
10
+ export declare function getFlexUISupportedSystem(provider: AbapServiceProvider, isCustomerBase: boolean): Promise<FlexUISupportedSystem>;
11
+ /**
12
+ * Fetches system UI5 Version from UI5RtVersionService.
13
+ *
14
+ * @param {AbapServiceProvider} provider - Instance of the ABAP provider.
15
+ * @returns {string | undefined} System UI5 version.
16
+ */
17
+ export declare function getSystemUI5Version(provider: AbapServiceProvider): Promise<string | undefined>;
18
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFlexUISupportedSystem = getFlexUISupportedSystem;
4
+ exports.getSystemUI5Version = getSystemUI5Version;
5
+ const axios_extension_1 = require("@sap-ux/axios-extension");
6
+ const FILTER = {
7
+ 'scheme': 'http://www.sap.com/adt/categories/ui_flex',
8
+ 'term': 'dta_folder'
9
+ };
10
+ /**
11
+ * Fetches system supports Flex UI features.
12
+ *
13
+ * @param {AbapServiceProvider} provider - Instance of the ABAP provider.
14
+ * @param {boolean} isCustomerBase - Indicates whether the adaptation layer is CUSTOMER_BASE.
15
+ * @returns {Promise<FlexUISupportedSystem | undefined>} settings indicating support for onPremise and UI Flex capabilities.
16
+ */
17
+ async function getFlexUISupportedSystem(provider, isCustomerBase) {
18
+ if (!isCustomerBase) {
19
+ return {
20
+ isOnPremise: true,
21
+ isUIFlex: true
22
+ };
23
+ }
24
+ const response = await provider.get(axios_extension_1.AdtCatalogService.ADT_DISCOVERY_SERVICE_PATH, {
25
+ headers: {
26
+ Accept: 'application/*'
27
+ }
28
+ });
29
+ const isOnPremise = response.data.includes(FILTER.term);
30
+ const isUIFlex = response.data.includes(FILTER.scheme);
31
+ return { isOnPremise, isUIFlex };
32
+ }
33
+ /**
34
+ * Fetches system UI5 Version from UI5RtVersionService.
35
+ *
36
+ * @param {AbapServiceProvider} provider - Instance of the ABAP provider.
37
+ * @returns {string | undefined} System UI5 version.
38
+ */
39
+ async function getSystemUI5Version(provider) {
40
+ const service = await provider.getAdtService(axios_extension_1.UI5RtVersionService);
41
+ return service?.getUI5Version();
42
+ }
43
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,19 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { AbapTarget } from '@sap-ux/ui5-config';
3
+ import type { AxiosRequestConfig, ProviderConfiguration } from '@sap-ux/axios-extension';
4
+ export type RequestOptions = AxiosRequestConfig & Partial<ProviderConfiguration>;
5
+ /**
6
+ * Determines the ABAP target configuration based on the running environment and system details.
7
+ *
8
+ * For an App Studio environment, the config is constructed with a destination property.
9
+ * For non-AppStudio environments, the function retrieves system details from the SystemLookup service,
10
+ * maps these details to an AbapTarget, and attaches authentication credentials to the request options if available.
11
+ *
12
+ * @param {string} system - The system identifier (URL or system name).
13
+ * @param {ToolsLogger} logger - The logger for logging errors.
14
+ * @param {RequestOptions} [requestOptions] - Optional request options which will be updated with auth information if available.
15
+ * @param {string} [client] - Optional client number for systems with multiple clients.
16
+ * @returns {Promise<AbapTarget>} A promise that resolves to the configured ABAP configuration.
17
+ */
18
+ export declare function getProviderConfig(system: string, logger: ToolsLogger, requestOptions?: RequestOptions, client?: string): Promise<AbapTarget>;
19
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProviderConfig = getProviderConfig;
4
+ const btp_utils_1 = require("@sap-ux/btp-utils");
5
+ const source_1 = require("../source");
6
+ /**
7
+ * Determines the ABAP target configuration based on the running environment and system details.
8
+ *
9
+ * For an App Studio environment, the config is constructed with a destination property.
10
+ * For non-AppStudio environments, the function retrieves system details from the SystemLookup service,
11
+ * maps these details to an AbapTarget, and attaches authentication credentials to the request options if available.
12
+ *
13
+ * @param {string} system - The system identifier (URL or system name).
14
+ * @param {ToolsLogger} logger - The logger for logging errors.
15
+ * @param {RequestOptions} [requestOptions] - Optional request options which will be updated with auth information if available.
16
+ * @param {string} [client] - Optional client number for systems with multiple clients.
17
+ * @returns {Promise<AbapTarget>} A promise that resolves to the configured ABAP configuration.
18
+ */
19
+ async function getProviderConfig(system, logger, requestOptions, client) {
20
+ let config;
21
+ if ((0, btp_utils_1.isAppStudio)()) {
22
+ config = {
23
+ destination: system
24
+ };
25
+ }
26
+ else {
27
+ const systemLookup = new source_1.SystemLookup(logger);
28
+ const details = await systemLookup.getSystemByName(system);
29
+ if (!details) {
30
+ throw new Error(`No system details found for system: ${system}`);
31
+ }
32
+ config = {
33
+ client: details?.Client ?? client,
34
+ url: details?.Url
35
+ };
36
+ if (details?.Authentication) {
37
+ config.authenticationType = details?.Authentication;
38
+ }
39
+ const username = details?.Credentials?.username;
40
+ const password = details?.Credentials?.password;
41
+ if (requestOptions && username && password) {
42
+ requestOptions.auth = {
43
+ username,
44
+ password
45
+ };
46
+ }
47
+ }
48
+ return config;
49
+ }
50
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,4 @@
1
+ export * from './client';
2
+ export * from './provider';
3
+ export * from './config';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./target-applications"), exports);
18
- __exportStar(require("./target-systems"), exports);
19
- __exportStar(require("./abap-provider"), exports);
17
+ __exportStar(require("./client"), exports);
18
+ __exportStar(require("./provider"), exports);
19
+ __exportStar(require("./config"), exports);
20
20
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { AbapServiceProvider } from '@sap-ux/axios-extension';
3
+ interface ProviderOptions {
4
+ system: string;
5
+ client?: string;
6
+ username?: string;
7
+ password?: string;
8
+ }
9
+ /**
10
+ * Retrieves a fully configured ABAP service provider for the specified system.
11
+ *
12
+ * This function uses the provided system identifier (and optional client and credentials)
13
+ * to build an ABAP target configuration, which is then passed to createAbapServiceProvider.
14
+ *
15
+ * @param {ProviderOptions} options - Options for configuring the provider.
16
+ * @param {ToolsLogger} logger - The logger for logging errors and debug messages.
17
+ * @returns {Promise<AbapServiceProvider>} A promise that resolves to the configured ABAP service provider.
18
+ * @throws {Error} If provider instantiation fails.
19
+ */
20
+ export declare function getConfiguredProvider({ system, client, password, username }: ProviderOptions, logger: ToolsLogger): Promise<AbapServiceProvider>;
21
+ export {};
22
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfiguredProvider = getConfiguredProvider;
4
+ const system_access_1 = require("@sap-ux/system-access");
5
+ const config_1 = require("./config");
6
+ /**
7
+ * Retrieves a fully configured ABAP service provider for the specified system.
8
+ *
9
+ * This function uses the provided system identifier (and optional client and credentials)
10
+ * to build an ABAP target configuration, which is then passed to createAbapServiceProvider.
11
+ *
12
+ * @param {ProviderOptions} options - Options for configuring the provider.
13
+ * @param {ToolsLogger} logger - The logger for logging errors and debug messages.
14
+ * @returns {Promise<AbapServiceProvider>} A promise that resolves to the configured ABAP service provider.
15
+ * @throws {Error} If provider instantiation fails.
16
+ */
17
+ async function getConfiguredProvider({ system, client, password, username }, logger) {
18
+ try {
19
+ const requestOptions = {
20
+ ignoreCertErrors: false
21
+ };
22
+ const config = await (0, config_1.getProviderConfig)(system, logger, requestOptions, client);
23
+ if (username && password) {
24
+ requestOptions.auth = { username, password };
25
+ }
26
+ return await (0, system_access_1.createAbapServiceProvider)(config, requestOptions, false, logger);
27
+ }
28
+ catch (e) {
29
+ logger?.error(`Failed to instantiate provider for system: ${system}. Reason: ${e.message}`);
30
+ throw new Error(e.message);
31
+ }
32
+ }
33
+ //# sourceMappingURL=provider.js.map
@@ -1,3 +1,11 @@
1
+ export declare const UI5_CDN_URL = "https://ui5.sap.com";
2
+ export declare const UI5_VERSIONS_CDN_URL = "https://sapui5.hana.ondemand.com/version.json";
3
+ export declare const UI5_VERSIONS_NEO_CDN_URL = "https://ui5.sap.com/neo-app.json";
4
+ export declare const SNAPSHOT_CDN_URL = "https://sapui5preview-sapui5.dispatcher.int.sap.eu2.hana.ondemand.com:443";
5
+ export declare const CURRENT_SYSTEM_VERSION = "(system version)";
6
+ export declare const LATEST_VERSION = "(latest)";
7
+ export declare const SNAPSHOT_VERSION = "snapshot";
8
+ export declare const SNAPSHOT_UNTESTED_VERSION = "snapshot-untested";
1
9
  export declare const S4HANA_APPS_PARAMS: {
2
10
  'sap.app/type': string;
3
11
  'sap.fiori/cloudDevAdaptationStatus': string;
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ABAP_VARIANT_APPS_PARAMS = exports.ABAP_APPS_PARAMS = exports.S4HANA_APPS_PARAMS = void 0;
3
+ exports.ABAP_VARIANT_APPS_PARAMS = exports.ABAP_APPS_PARAMS = exports.S4HANA_APPS_PARAMS = exports.SNAPSHOT_UNTESTED_VERSION = exports.SNAPSHOT_VERSION = exports.LATEST_VERSION = exports.CURRENT_SYSTEM_VERSION = exports.SNAPSHOT_CDN_URL = exports.UI5_VERSIONS_NEO_CDN_URL = exports.UI5_VERSIONS_CDN_URL = exports.UI5_CDN_URL = void 0;
4
+ exports.UI5_CDN_URL = 'https://ui5.sap.com';
5
+ exports.UI5_VERSIONS_CDN_URL = 'https://sapui5.hana.ondemand.com/version.json';
6
+ exports.UI5_VERSIONS_NEO_CDN_URL = 'https://ui5.sap.com/neo-app.json';
7
+ exports.SNAPSHOT_CDN_URL = 'https://sapui5preview-sapui5.dispatcher.int.sap.eu2.hana.ondemand.com:443';
8
+ exports.CURRENT_SYSTEM_VERSION = '(system version)';
9
+ exports.LATEST_VERSION = '(latest)';
10
+ exports.SNAPSHOT_VERSION = 'snapshot';
11
+ exports.SNAPSHOT_UNTESTED_VERSION = 'snapshot-untested';
4
12
  exports.S4HANA_APPS_PARAMS = {
5
13
  'sap.app/type': 'application',
6
14
  'sap.fiori/cloudDevAdaptationStatus': 'released',
@@ -173,8 +173,8 @@ async function fetchSystemInformation(target, ignoreCertErrors, logger) {
173
173
  adp: {
174
174
  environment: ato.operationsType ?? 'P',
175
175
  support: {
176
- id: packageJson.name,
177
- version: packageJson.version,
176
+ id: packageJson.name ?? '',
177
+ version: packageJson.version ?? '',
178
178
  toolsId: (0, uuid_1.v4)()
179
179
  }
180
180
  }
package/dist/index.d.ts CHANGED
@@ -6,9 +6,11 @@ export * from './base/constants';
6
6
  export * from './base/project-builder';
7
7
  export * from './base/abap/manifest-service';
8
8
  export * from './base/helper';
9
- export * from './client';
9
+ export * from './abap';
10
+ export * from './source';
10
11
  export * from './preview/adp-preview';
11
12
  export * from './writer/writer-config';
13
+ export * from './ui5';
12
14
  export { getCustomConfig } from './writer/project-utils';
13
15
  export { generate, migrate } from './writer';
14
16
  export { generateChange } from './writer/editors';
package/dist/index.js CHANGED
@@ -23,9 +23,11 @@ __exportStar(require("./base/constants"), exports);
23
23
  __exportStar(require("./base/project-builder"), exports);
24
24
  __exportStar(require("./base/abap/manifest-service"), exports);
25
25
  __exportStar(require("./base/helper"), exports);
26
- __exportStar(require("./client"), exports);
26
+ __exportStar(require("./abap"), exports);
27
+ __exportStar(require("./source"), exports);
27
28
  __exportStar(require("./preview/adp-preview"), exports);
28
29
  __exportStar(require("./writer/writer-config"), exports);
30
+ __exportStar(require("./ui5"), exports);
29
31
  var project_utils_1 = require("./writer/project-utils");
30
32
  Object.defineProperty(exports, "getCustomConfig", { enumerable: true, get: function () { return project_utils_1.getCustomConfig; } });
31
33
  var writer_1 = require("./writer");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -0,0 +1,41 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { AbapServiceProvider, App } from '@sap-ux/axios-extension';
3
+ import type { SourceApplication } from '../types';
4
+ /**
5
+ * Compares two applications for sorting, using the title and falling back to the ID if titles are missing or equal.
6
+ * This function ensures that applications are sorted alphabetically by their title or ID in a case-insensitive manner.
7
+ *
8
+ * @param {SourceApplication} appA - The first application to compare.
9
+ * @param {SourceApplication} appB - The second application to compare.
10
+ * @returns {number} A number indicating the sort order.
11
+ */
12
+ export declare const filterApps: (appA: SourceApplication, appB: SourceApplication) => number;
13
+ /**
14
+ * Transforms raw application data into a structured Application object.
15
+ * This function maps properties from a loosely typed app data structure to a strongly typed Application object.
16
+ *
17
+ * @param {Partial<App>} app - The raw application data, possibly incomplete.
18
+ * @returns {SourceApplication} A structured application object with defined properties, even if some may be empty.
19
+ */
20
+ export declare const mapApps: (app: Partial<App>) => SourceApplication;
21
+ /**
22
+ * Checks whether the application supports manifest-first approach.
23
+ *
24
+ * @param {AbapServiceProvider} provider - The ABAP service provider for communicating with the system.
25
+ * @param {string} id - The ID of the application whose manifest should be managed.
26
+ * @param {ToolsLogger} logger - Optional logger for debugging purposes.
27
+ * @returns {Promise<boolean>} True if supported, otherwise throws an error.
28
+ */
29
+ export declare function isAppSupported(provider: AbapServiceProvider, id: string, logger: ToolsLogger): Promise<boolean>;
30
+ /**
31
+ * Loads and processes application data from the ABAP service provider.
32
+ *
33
+ * This function retrieves the application index from the provider and then searches for applications based on system type.
34
+ * If the system is not a cloud system and the base is customer-specific, additional variant applications are fetched and merged.
35
+ *
36
+ * @param {AbapServiceProvider} provider - The ABAP service provider used to retrieve application data.
37
+ * @param {boolean} isCustomerBase - Flag indicating whether the system is customer-based. Affects application selection.
38
+ * @returns {Promise<SourceApplication[]>} A promise that resolves to a sorted list of applications.
39
+ */
40
+ export declare function loadApps(provider: AbapServiceProvider, isCustomerBase: boolean): Promise<SourceApplication[]>;
41
+ //# sourceMappingURL=applications.d.ts.map
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapApps = exports.filterApps = void 0;
4
+ exports.isAppSupported = isAppSupported;
5
+ exports.loadApps = loadApps;
6
+ const i18n_1 = require("../i18n");
7
+ const constants_1 = require("../base/constants");
8
+ /**
9
+ * Compares two applications for sorting, using the title and falling back to the ID if titles are missing or equal.
10
+ * This function ensures that applications are sorted alphabetically by their title or ID in a case-insensitive manner.
11
+ *
12
+ * @param {SourceApplication} appA - The first application to compare.
13
+ * @param {SourceApplication} appB - The second application to compare.
14
+ * @returns {number} A number indicating the sort order.
15
+ */
16
+ const filterApps = (appA, appB) => {
17
+ let titleA = appA.title.toUpperCase();
18
+ let titleB = appB.title.toUpperCase();
19
+ if (!titleA.trim()) {
20
+ titleA = appA.id.toUpperCase();
21
+ }
22
+ if (!titleB.trim()) {
23
+ titleB = appB.id.toUpperCase();
24
+ }
25
+ if (titleA < titleB) {
26
+ return -1;
27
+ }
28
+ if (titleA > titleB) {
29
+ return 1;
30
+ }
31
+ return 0;
32
+ };
33
+ exports.filterApps = filterApps;
34
+ /**
35
+ * Transforms raw application data into a structured Application object.
36
+ * This function maps properties from a loosely typed app data structure to a strongly typed Application object.
37
+ *
38
+ * @param {Partial<App>} app - The raw application data, possibly incomplete.
39
+ * @returns {SourceApplication} A structured application object with defined properties, even if some may be empty.
40
+ */
41
+ const mapApps = (app) => ({
42
+ id: app['sap.app/id'] ?? '',
43
+ title: app['sap.app/title'] ?? '',
44
+ ach: app['sap.app/ach'] ?? '',
45
+ registrationIds: app['sap.fiori/registrationIds'] ?? [],
46
+ fileType: app['fileType'] ?? '',
47
+ bspUrl: app['url'] ?? '',
48
+ bspName: app['repoName'] ?? ''
49
+ });
50
+ exports.mapApps = mapApps;
51
+ /**
52
+ * Checks whether the application supports manifest-first approach.
53
+ *
54
+ * @param {AbapServiceProvider} provider - The ABAP service provider for communicating with the system.
55
+ * @param {string} id - The ID of the application whose manifest should be managed.
56
+ * @param {ToolsLogger} logger - Optional logger for debugging purposes.
57
+ * @returns {Promise<boolean>} True if supported, otherwise throws an error.
58
+ */
59
+ async function isAppSupported(provider, id, logger) {
60
+ const appIndex = provider.getAppIndex();
61
+ const isSupported = await appIndex.getIsManiFirstSupported(id);
62
+ if (!isSupported) {
63
+ logger?.debug(`Application '${id}' is not supported by Adaptation Project`);
64
+ throw new Error((0, i18n_1.t)('validators.appDoesNotSupportManifest'));
65
+ }
66
+ return true;
67
+ }
68
+ /**
69
+ * Loads and processes application data from the ABAP service provider.
70
+ *
71
+ * This function retrieves the application index from the provider and then searches for applications based on system type.
72
+ * If the system is not a cloud system and the base is customer-specific, additional variant applications are fetched and merged.
73
+ *
74
+ * @param {AbapServiceProvider} provider - The ABAP service provider used to retrieve application data.
75
+ * @param {boolean} isCustomerBase - Flag indicating whether the system is customer-based. Affects application selection.
76
+ * @returns {Promise<SourceApplication[]>} A promise that resolves to a sorted list of applications.
77
+ */
78
+ async function loadApps(provider, isCustomerBase) {
79
+ let result = [];
80
+ try {
81
+ const isCloudSystem = await provider.isAbapCloud();
82
+ const appIndex = provider.getAppIndex();
83
+ result = await appIndex.search(isCloudSystem ? constants_1.S4HANA_APPS_PARAMS : constants_1.ABAP_APPS_PARAMS);
84
+ if (!isCloudSystem && isCustomerBase) {
85
+ const extraApps = await appIndex.search(constants_1.ABAP_VARIANT_APPS_PARAMS);
86
+ result = result.concat(extraApps);
87
+ }
88
+ return result.map(exports.mapApps).sort(exports.filterApps);
89
+ }
90
+ catch (e) {
91
+ throw new Error(`Could not load applications: ${e.message}`);
92
+ }
93
+ }
94
+ //# sourceMappingURL=applications.js.map
@@ -0,0 +1,4 @@
1
+ export * from './applications';
2
+ export * from './manifest';
3
+ export * from './systems';
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("./applications"), exports);
18
+ __exportStar(require("./manifest"), exports);
19
+ __exportStar(require("./systems"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,70 @@
1
+ import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { Manifest } from '@sap-ux/project-access';
3
+ import type { AbapServiceProvider } from '@sap-ux/axios-extension';
4
+ /**
5
+ * Evaluates whether the application described by the manifest is a SAP Fiori Elements version 4 application.
6
+ *
7
+ * @param {Manifest} manifest - The application manifest to evaluate.
8
+ * @returns {boolean} True if the application uses SAP Fiori Elements version 4 libraries.
9
+ */
10
+ export declare function isV4Application(manifest?: Manifest): boolean;
11
+ /**
12
+ * Checks if views are loaded synchronously or asynchronously in the UI5 settings of the manifest.
13
+ * Sets the isAppSync property based on the loading method.
14
+ *
15
+ * @param {Manifest['sap.ui5']} ui5Settings - The UI5 settings part of the manifest.
16
+ * @returns {boolean} Boolean if views are loaded synchronously or asynchronously.
17
+ */
18
+ export declare function isSyncLoadedView(ui5Settings?: Manifest['sap.ui5']): boolean;
19
+ /**
20
+ * Service class for handling operations related to application manifests.
21
+ * Manifest and URL are lazily loaded and stored internally.
22
+ */
23
+ export declare class SourceManifest {
24
+ private readonly provider;
25
+ private readonly appId;
26
+ private readonly logger?;
27
+ /**
28
+ * The parsed manifest object, loaded once and cached internally.
29
+ */
30
+ private manifest?;
31
+ /**
32
+ * The manifest URL for the specified application, loaded once and cached internally.
33
+ */
34
+ private manifestUrl?;
35
+ /**
36
+ * Creates an instance of SourceManifest.
37
+ *
38
+ * @param {AbapServiceProvider} provider - The ABAP service provider for communicating with the system.
39
+ * @param {string} appId - The ID of the application whose manifest should be managed.
40
+ * @param {ToolsLogger} logger - Optional logger for debugging purposes.
41
+ */
42
+ constructor(provider: AbapServiceProvider, appId: string, logger?: ToolsLogger | undefined);
43
+ /**
44
+ * Returns the manifest URL, loading it if not already available.
45
+ *
46
+ * @returns {Promise<string>} A promise resolving to the manifest URL string.
47
+ */
48
+ getManifestUrl(): Promise<string>;
49
+ /**
50
+ * Returns the parsed manifest, loading it if not already available.
51
+ *
52
+ * @returns A promise resolving to the parsed manifest object.
53
+ */
54
+ getManifest(): Promise<Manifest>;
55
+ /**
56
+ * Loads the manifest URL from the system using the application ID.
57
+ * The result is stored internally for future access.
58
+ *
59
+ * @returns {Promise<string>} A promise that resolves once the URL has been fetched and set.
60
+ */
61
+ private loadManifestUrl;
62
+ /**
63
+ * Loads the manifest from the system and stores it internally.
64
+ * Requires a manifest URL to be available (loads it if necessary).
65
+ *
66
+ * @returns {Promise<Manifest>} A promise that resolves once the manifest has been fetched and parsed.
67
+ */
68
+ private loadManifest;
69
+ }
70
+ //# sourceMappingURL=manifest.d.ts.map