@sap-ux/adp-tooling 0.13.22 → 0.13.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abap/client.d.ts +18 -0
- package/dist/abap/client.js +43 -0
- package/dist/abap/config.d.ts +19 -0
- package/dist/abap/config.js +50 -0
- package/dist/abap/index.d.ts +4 -0
- package/dist/{client → abap}/index.js +3 -3
- package/dist/abap/provider.d.ts +22 -0
- package/dist/abap/provider.js +33 -0
- package/dist/base/constants/index.d.ts +8 -0
- package/dist/base/constants/index.js +9 -1
- package/dist/base/prompt.js +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/{client/target-applications.d.ts → source/applications.d.ts} +19 -9
- package/dist/{client/target-applications.js → source/applications.js} +24 -5
- package/dist/source/index.d.ts +4 -0
- package/dist/source/index.js +20 -0
- package/dist/source/manifest.d.ts +70 -0
- package/dist/source/manifest.js +123 -0
- package/dist/{client/target-systems.d.ts → source/systems.d.ts} +2 -2
- package/dist/{client/target-systems.js → source/systems.js} +4 -4
- package/dist/translations/adp-tooling.i18n.json +2 -1
- package/dist/types.d.ts +15 -6
- package/dist/ui5/fetch.d.ts +16 -0
- package/dist/ui5/fetch.js +34 -0
- package/dist/ui5/format.d.ts +80 -0
- package/dist/ui5/format.js +135 -0
- package/dist/ui5/index.d.ts +4 -0
- package/dist/ui5/index.js +20 -0
- package/dist/ui5/version-info.d.ts +106 -0
- package/dist/ui5/version-info.js +193 -0
- package/dist/writer/project-utils.d.ts +5 -4
- package/dist/writer/project-utils.js +3 -3
- package/dist/writer/writer-config.d.ts +5 -3
- package/dist/writer/writer-config.js +13 -3
- package/package.json +2 -2
- package/dist/client/abap-provider.d.ts +0 -38
- package/dist/client/abap-provider.js +0 -79
- package/dist/client/index.d.ts +0 -4
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Editor } from 'mem-fs-editor';
|
|
2
|
-
import type { AdpWriterConfig, CustomConfig
|
|
2
|
+
import type { AdpWriterConfig, CustomConfig } from '../types';
|
|
3
|
+
import type { Package } from '@sap-ux/project-access';
|
|
3
4
|
import type { OperationsType } from '@sap-ux/axios-extension';
|
|
4
5
|
/**
|
|
5
6
|
* Retrieves the package name and version from the package.json file located two levels up the directory tree.
|
|
6
7
|
*
|
|
7
|
-
* @returns {
|
|
8
|
+
* @returns {Package} An object containing the `name` and `version` of the package.
|
|
8
9
|
*/
|
|
9
|
-
export declare function getPackageJSONInfo():
|
|
10
|
+
export declare function getPackageJSONInfo(): Package;
|
|
10
11
|
/**
|
|
11
12
|
* Constructs a custom configuration object for the Adaptation Project (ADP).
|
|
12
13
|
*
|
|
@@ -16,7 +17,7 @@ export declare function getPackageJSONInfo(): PackageJson;
|
|
|
16
17
|
* @param {string} pkg.version - The version of the tool generating the config.
|
|
17
18
|
* @returns {CustomConfig} The generated ADP custom configuration object.
|
|
18
19
|
*/
|
|
19
|
-
export declare function getCustomConfig(environment: OperationsType, { name: id, version }:
|
|
20
|
+
export declare function getCustomConfig(environment: OperationsType, { name: id, version }: Package): CustomConfig;
|
|
20
21
|
/**
|
|
21
22
|
* Writes a given project template files within a specified folder in the project directory.
|
|
22
23
|
*
|
|
@@ -13,7 +13,7 @@ const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
|
13
13
|
/**
|
|
14
14
|
* Retrieves the package name and version from the package.json file located two levels up the directory tree.
|
|
15
15
|
*
|
|
16
|
-
* @returns {
|
|
16
|
+
* @returns {Package} An object containing the `name` and `version` of the package.
|
|
17
17
|
*/
|
|
18
18
|
function getPackageJSONInfo() {
|
|
19
19
|
const defaultPackage = {
|
|
@@ -41,8 +41,8 @@ function getCustomConfig(environment, { name: id, version }) {
|
|
|
41
41
|
adp: {
|
|
42
42
|
environment,
|
|
43
43
|
support: {
|
|
44
|
-
id,
|
|
45
|
-
version,
|
|
44
|
+
id: id ?? '',
|
|
45
|
+
version: version ?? '',
|
|
46
46
|
toolsId: (0, uuid_1.v4)()
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
+
import type { Package } from '@sap-ux/project-access';
|
|
2
3
|
import type { AbapServiceProvider } from '@sap-ux/axios-extension';
|
|
3
|
-
import
|
|
4
|
+
import { FlexLayer } from '../types';
|
|
5
|
+
import type { AdpWriterConfig, ConfigAnswers } from '../types';
|
|
4
6
|
interface ConfigOptions {
|
|
5
7
|
/**
|
|
6
8
|
* The ABAP service provider instance used to retrieve system-specific information.
|
|
@@ -26,7 +28,7 @@ interface ConfigOptions {
|
|
|
26
28
|
/**
|
|
27
29
|
* The package.json information used to generate custom configuration.
|
|
28
30
|
*/
|
|
29
|
-
packageJson:
|
|
31
|
+
packageJson: Package;
|
|
30
32
|
/**
|
|
31
33
|
* Logger instance for debugging and error reporting.
|
|
32
34
|
*/
|
|
@@ -41,7 +43,7 @@ interface ConfigOptions {
|
|
|
41
43
|
* @param {FlexLayer} options.layer - The FlexLayer indicating the deployment layer.
|
|
42
44
|
* @param {object} options.defaults - Default project parameters.
|
|
43
45
|
* @param {string} options.defaults.namespace - The default namespace to be used.
|
|
44
|
-
* @param {
|
|
46
|
+
* @param {Package} options.packageJson - The package.json information for generating custom configuration.
|
|
45
47
|
* @param {ToolsLogger} options.logger - The logger for debugging and error logging.
|
|
46
48
|
* @returns {Promise<AdpWriterConfig>} A promise that resolves to the generated ADP writer configuration.
|
|
47
49
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getConfig = getConfig;
|
|
4
|
-
const
|
|
4
|
+
const abap_1 = require("../abap");
|
|
5
5
|
const project_utils_1 = require("./project-utils");
|
|
6
6
|
const descriptor_content_1 = require("./descriptor-content");
|
|
7
|
+
const ui5_1 = require("../ui5");
|
|
7
8
|
/**
|
|
8
9
|
* Generates the configuration object for the Adaptation Project.
|
|
9
10
|
*
|
|
@@ -13,7 +14,7 @@ const descriptor_content_1 = require("./descriptor-content");
|
|
|
13
14
|
* @param {FlexLayer} options.layer - The FlexLayer indicating the deployment layer.
|
|
14
15
|
* @param {object} options.defaults - Default project parameters.
|
|
15
16
|
* @param {string} options.defaults.namespace - The default namespace to be used.
|
|
16
|
-
* @param {
|
|
17
|
+
* @param {Package} options.packageJson - The package.json information for generating custom configuration.
|
|
17
18
|
* @param {ToolsLogger} options.logger - The logger for debugging and error logging.
|
|
18
19
|
* @returns {Promise<AdpWriterConfig>} A promise that resolves to the generated ADP writer configuration.
|
|
19
20
|
*/
|
|
@@ -21,8 +22,12 @@ async function getConfig(options) {
|
|
|
21
22
|
const { configAnswers, defaults, layer, logger, packageJson, provider } = options;
|
|
22
23
|
const ato = await provider.getAtoInfo();
|
|
23
24
|
const operationsType = ato.operationsType ?? 'P';
|
|
24
|
-
const target = await (0,
|
|
25
|
+
const target = await (0, abap_1.getProviderConfig)(configAnswers.system, logger);
|
|
25
26
|
const customConfig = (0, project_utils_1.getCustomConfig)(operationsType, packageJson);
|
|
27
|
+
const isCloudProject = await provider.isAbapCloud();
|
|
28
|
+
const isCustomerBase = layer === "CUSTOMER_BASE" /* FlexLayer.CUSTOMER_BASE */;
|
|
29
|
+
const ui5Info = ui5_1.UI5VersionInfo.getInstance(layer);
|
|
30
|
+
const ui5Version = isCloudProject ? ui5Info.getLatestVersion() : ui5Info.getVersionToBeUsed('', isCustomerBase);
|
|
26
31
|
return {
|
|
27
32
|
app: {
|
|
28
33
|
id: defaults.namespace,
|
|
@@ -31,6 +36,11 @@ async function getConfig(options) {
|
|
|
31
36
|
title: '',
|
|
32
37
|
content: [(0, descriptor_content_1.getNewModelEnhanceWithChange)()]
|
|
33
38
|
},
|
|
39
|
+
ui5: {
|
|
40
|
+
minVersion: ui5Version?.split(' ')[0],
|
|
41
|
+
version: (0, ui5_1.getFormattedVersion)(ui5Version),
|
|
42
|
+
frameworkUrl: (0, ui5_1.getOfficialBaseUI5VersionUrl)(ui5Version)
|
|
43
|
+
},
|
|
34
44
|
customConfig,
|
|
35
45
|
target,
|
|
36
46
|
options: {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.13.
|
|
12
|
+
"version": "0.13.25",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"uuid": "10.0.0",
|
|
35
35
|
"@sap-ux/axios-extension": "1.19.2",
|
|
36
36
|
"@sap-ux/btp-utils": "1.0.2",
|
|
37
|
-
"@sap-ux/inquirer-common": "0.6.
|
|
37
|
+
"@sap-ux/inquirer-common": "0.6.33",
|
|
38
38
|
"@sap-ux/logger": "0.6.0",
|
|
39
39
|
"@sap-ux/project-access": "1.29.18",
|
|
40
40
|
"@sap-ux/project-input-validator": "0.5.0",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
-
import type { AbapTarget } from '@sap-ux/ui5-config';
|
|
3
|
-
import type { AbapServiceProvider, AxiosRequestConfig, ProviderConfiguration } from '@sap-ux/axios-extension';
|
|
4
|
-
export type RequestOptions = AxiosRequestConfig & Partial<ProviderConfiguration>;
|
|
5
|
-
interface ProviderOptions {
|
|
6
|
-
system: string;
|
|
7
|
-
client?: string;
|
|
8
|
-
username?: string;
|
|
9
|
-
password?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Retrieves a fully configured ABAP service provider for the specified system.
|
|
13
|
-
*
|
|
14
|
-
* This function uses the provided system identifier (and optional client and credentials)
|
|
15
|
-
* to build an ABAP target configuration, which is then passed to createAbapServiceProvider.
|
|
16
|
-
*
|
|
17
|
-
* @param {ProviderOptions} options - Options for configuring the provider.
|
|
18
|
-
* @param {ToolsLogger} logger - The logger for logging errors and debug messages.
|
|
19
|
-
* @returns {Promise<AbapServiceProvider>} A promise that resolves to the configured ABAP service provider.
|
|
20
|
-
* @throws {Error} If provider instantiation fails.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getConfiguredProvider({ system, client, password, username }: ProviderOptions, logger: ToolsLogger): Promise<AbapServiceProvider>;
|
|
23
|
-
/**
|
|
24
|
-
* Determines the ABAP target configuration based on the running environment and system details.
|
|
25
|
-
*
|
|
26
|
-
* For an App Studio environment, the target is constructed with a destination property.
|
|
27
|
-
* For non-AppStudio environments, the function retrieves system details from the TargetSystems service,
|
|
28
|
-
* maps these details to an AbapTarget, and attaches authentication credentials to the request options if available.
|
|
29
|
-
*
|
|
30
|
-
* @param {string} system - The system identifier (URL or system name).
|
|
31
|
-
* @param {ToolsLogger} logger - The logger for logging errors.
|
|
32
|
-
* @param {RequestOptions} [requestOptions] - Optional request options which will be updated with auth information if available.
|
|
33
|
-
* @param {string} [client] - Optional client number for systems with multiple clients.
|
|
34
|
-
* @returns {Promise<AbapTarget>} A promise that resolves to the configured ABAP target.
|
|
35
|
-
*/
|
|
36
|
-
export declare function getAbapTarget(system: string, logger: ToolsLogger, requestOptions?: RequestOptions, client?: string): Promise<AbapTarget>;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=abap-provider.d.ts.map
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getConfiguredProvider = getConfiguredProvider;
|
|
4
|
-
exports.getAbapTarget = getAbapTarget;
|
|
5
|
-
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
6
|
-
const system_access_1 = require("@sap-ux/system-access");
|
|
7
|
-
const target_systems_1 = require("./target-systems");
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves a fully configured ABAP service provider for the specified system.
|
|
10
|
-
*
|
|
11
|
-
* This function uses the provided system identifier (and optional client and credentials)
|
|
12
|
-
* to build an ABAP target configuration, which is then passed to createAbapServiceProvider.
|
|
13
|
-
*
|
|
14
|
-
* @param {ProviderOptions} options - Options for configuring the provider.
|
|
15
|
-
* @param {ToolsLogger} logger - The logger for logging errors and debug messages.
|
|
16
|
-
* @returns {Promise<AbapServiceProvider>} A promise that resolves to the configured ABAP service provider.
|
|
17
|
-
* @throws {Error} If provider instantiation fails.
|
|
18
|
-
*/
|
|
19
|
-
async function getConfiguredProvider({ system, client, password, username }, logger) {
|
|
20
|
-
try {
|
|
21
|
-
const requestOptions = {
|
|
22
|
-
ignoreCertErrors: false
|
|
23
|
-
};
|
|
24
|
-
const target = await getAbapTarget(system, logger, requestOptions, client);
|
|
25
|
-
if (username && password) {
|
|
26
|
-
requestOptions.auth = { username, password };
|
|
27
|
-
}
|
|
28
|
-
return await (0, system_access_1.createAbapServiceProvider)(target, requestOptions, false, logger);
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
logger?.error(`Failed to instantiate provider for system: ${system}. Reason: ${e.message}`);
|
|
32
|
-
throw new Error(e.message);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Determines the ABAP target configuration based on the running environment and system details.
|
|
37
|
-
*
|
|
38
|
-
* For an App Studio environment, the target is constructed with a destination property.
|
|
39
|
-
* For non-AppStudio environments, the function retrieves system details from the TargetSystems service,
|
|
40
|
-
* maps these details to an AbapTarget, and attaches authentication credentials to the request options if available.
|
|
41
|
-
*
|
|
42
|
-
* @param {string} system - The system identifier (URL or system name).
|
|
43
|
-
* @param {ToolsLogger} logger - The logger for logging errors.
|
|
44
|
-
* @param {RequestOptions} [requestOptions] - Optional request options which will be updated with auth information if available.
|
|
45
|
-
* @param {string} [client] - Optional client number for systems with multiple clients.
|
|
46
|
-
* @returns {Promise<AbapTarget>} A promise that resolves to the configured ABAP target.
|
|
47
|
-
*/
|
|
48
|
-
async function getAbapTarget(system, logger, requestOptions, client) {
|
|
49
|
-
let target;
|
|
50
|
-
const targetSystems = new target_systems_1.TargetSystems(logger);
|
|
51
|
-
if ((0, btp_utils_1.isAppStudio)()) {
|
|
52
|
-
target = {
|
|
53
|
-
destination: system
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
const details = await targetSystems.getSystemByName(system);
|
|
58
|
-
if (!details) {
|
|
59
|
-
throw new Error(`No system details found for system: ${system}`);
|
|
60
|
-
}
|
|
61
|
-
target = {
|
|
62
|
-
client: details?.Client ?? client,
|
|
63
|
-
url: details?.Url
|
|
64
|
-
};
|
|
65
|
-
if (details?.Authentication) {
|
|
66
|
-
target.authenticationType = details?.Authentication;
|
|
67
|
-
}
|
|
68
|
-
const username = details?.Credentials?.username;
|
|
69
|
-
const password = details?.Credentials?.password;
|
|
70
|
-
if (requestOptions && username && password) {
|
|
71
|
-
requestOptions.auth = {
|
|
72
|
-
username,
|
|
73
|
-
password
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return target;
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=abap-provider.js.map
|
package/dist/client/index.d.ts
DELETED