@sap-ux/adp-tooling 0.18.107 → 0.18.109

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.
@@ -1,4 +1,5 @@
1
1
  import type { ToolsLogger } from '@sap-ux/logger';
2
+ import type { ManifestNamespace } from '@sap-ux/project-access';
2
3
  import type { CfConfig, CFApp, RequestArguments, ServiceKeys, GetServiceInstanceParams, ServiceInstance, MtaYaml, ServiceInfo, CfUi5AppInfo } from '../../types';
3
4
  interface CreateServiceOptions {
4
5
  xsSecurityProjectName?: string;
@@ -40,6 +41,17 @@ export declare function getFDCApps(appHostIds: string[], cfConfig: CfConfig, log
40
41
  * @returns {Promise<CfUi5AppInfo>} The ui5AppInfo.json content.
41
42
  */
42
43
  export declare function getCfUi5AppInfo(appId: string, appHostIds: string[], cfConfig: CfConfig, logger?: ToolsLogger): Promise<CfUi5AppInfo>;
44
+ /**
45
+ * Get inbounds for a base application from the FDC service.
46
+ *
47
+ * @param {string} appId - The application ID.
48
+ * @param {string} appHostId - The app host ID.
49
+ * @param {CfConfig} cfConfig - The CF config.
50
+ * @param {ToolsLogger} logger - The logger.
51
+ * @param {string} lang - The language parameter (defaults to 'en').
52
+ * @returns {Promise<ManifestNamespace.Inbound | undefined>} The inbounds or undefined if empty.
53
+ */
54
+ export declare function getCfBaseAppInbounds(appId: string, appHostId: string, cfConfig: CfConfig, logger?: ToolsLogger, lang?: string): Promise<ManifestNamespace.Inbound | undefined>;
43
55
  /**
44
56
  * Creates a service instance.
45
57
  *
@@ -40,6 +40,7 @@ exports.getBusinessServiceInfo = getBusinessServiceInfo;
40
40
  exports.getFDCRequestArguments = getFDCRequestArguments;
41
41
  exports.getFDCApps = getFDCApps;
42
42
  exports.getCfUi5AppInfo = getCfUi5AppInfo;
43
+ exports.getCfBaseAppInbounds = getCfBaseAppInbounds;
43
44
  exports.createServiceInstance = createServiceInstance;
44
45
  exports.getServiceNameByTags = getServiceNameByTags;
45
46
  exports.createServices = createServices;
@@ -177,6 +178,35 @@ async function getCfUi5AppInfo(appId, appHostIds, cfConfig, logger) {
177
178
  throw new Error(`Failed to get ui5AppInfo.json from FDC: ${error.message}`);
178
179
  }
179
180
  }
181
+ /**
182
+ * Get inbounds for a base application from the FDC service.
183
+ *
184
+ * @param {string} appId - The application ID.
185
+ * @param {string} appHostId - The app host ID.
186
+ * @param {CfConfig} cfConfig - The CF config.
187
+ * @param {ToolsLogger} logger - The logger.
188
+ * @param {string} lang - The language parameter (defaults to 'en').
189
+ * @returns {Promise<ManifestNamespace.Inbound | undefined>} The inbounds or undefined if empty.
190
+ */
191
+ async function getCfBaseAppInbounds(appId, appHostId, cfConfig, logger, lang = 'en') {
192
+ const requestArguments = getFDCRequestArguments(cfConfig);
193
+ const params = new URLSearchParams({ appId, appHostId, 'sap-language': lang });
194
+ const url = `${requestArguments.url}/api/business-service/inbounds?${params}`;
195
+ logger?.log(`Fetching inbounds from FDC: ${url}`);
196
+ try {
197
+ const response = await axios_1.default.get(url, requestArguments.options);
198
+ if (response.status !== 200) {
199
+ throw new Error((0, i18n_1.t)('error.failedToConnectToFDCService', { status: response.status }));
200
+ }
201
+ logger?.log('Successfully retrieved inbounds from FDC');
202
+ const inbounds = response.data.inbounds;
203
+ return inbounds && Object.keys(inbounds).length > 0 ? inbounds : undefined;
204
+ }
205
+ catch (e) {
206
+ logger?.debug(e);
207
+ throw new Error((0, i18n_1.t)('error.failedToGetFDCInbounds', { error: e.message }));
208
+ }
209
+ }
180
210
  /**
181
211
  * Creates a service instance.
182
212
  *
@@ -104,6 +104,7 @@
104
104
  "xsSecurityJsonCouldNotBeParsed": "The xs-security.json file could not be parsed. Ensure the xs-security.json file exists and try again.",
105
105
  "failedToCreateServiceInstance": "Failed to create the service instance: '{{serviceInstanceName}}'. Error: {{error}}",
106
106
  "failedToGetFDCApps": "Retrieving FDC apps failed: {{error}}",
107
+ "failedToGetFDCInbounds": "Retrieving inbounds from the UI5 Flexibility Design and Configuration service failed: {{error}}",
107
108
  "failedToConnectToFDCService": "Failed to connect to the FDC service: '{{status}}'",
108
109
  "baseAppRequired": "A base app is required for Cloud Foundry project generation. Please select a base app and try again.",
109
110
  "projectTypeNotProvided": "The project type is missing.",
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.18.107",
12
+ "version": "0.18.109",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -39,12 +39,12 @@
39
39
  "@sap-ux/axios-extension": "1.25.28",
40
40
  "@sap-ux/btp-utils": "1.1.12",
41
41
  "@sap-ux/i18n": "0.3.10",
42
- "@sap-ux/inquirer-common": "0.11.32",
42
+ "@sap-ux/inquirer-common": "0.11.33",
43
43
  "@sap-ux/logger": "0.8.4",
44
44
  "@sap-ux/nodejs-utils": "0.2.19",
45
- "@sap-ux/odata-service-writer": "0.31.4",
46
- "@sap-ux/project-access": "1.35.17",
47
- "@sap-ux/project-input-validator": "0.6.73",
45
+ "@sap-ux/odata-service-writer": "0.31.5",
46
+ "@sap-ux/project-access": "1.35.18",
47
+ "@sap-ux/project-input-validator": "0.6.74",
48
48
  "@sap-ux/store": "1.5.12",
49
49
  "@sap-ux/system-access": "0.7.4",
50
50
  "@sap-ux/ui5-config": "0.30.1",