@sap-ux/axios-extension
Advanced tools
Comparing version 1.14.1 to 1.14.2
@@ -11,2 +11,20 @@ import type { Service } from '../base/service-provider'; | ||
export type AppIndex = Partial<App>[]; | ||
export type AsyncHintsLib = { | ||
name: string; | ||
}; | ||
export type AsyncHintsRequest = { | ||
name: string; | ||
reference: string; | ||
}; | ||
export type Ui5AppInfo = Record<string, Ui5AppInfoContent>; | ||
export interface Ui5AppInfoContent { | ||
name: string; | ||
url: string; | ||
manifestUrl?: string; | ||
manifest?: string; | ||
asyncHints: { | ||
libs: AsyncHintsLib[]; | ||
requests: AsyncHintsRequest[]; | ||
}; | ||
} | ||
/** | ||
@@ -28,3 +46,10 @@ * A class representing the app index service allowing to search applications deployed on an ABAP system. | ||
}, resultFields?: string[]): Promise<AppIndex>; | ||
/** | ||
* Gets the app info for the specified id. | ||
* | ||
* @param {string} appId - The id of the app. | ||
* @returns {Promise<Ui5AppInfo>} App info. | ||
*/ | ||
getAppInfo(appId: string): Promise<Ui5AppInfo>; | ||
} | ||
//# sourceMappingURL=app-index-service.d.ts.map |
@@ -14,2 +14,3 @@ "use strict"; | ||
const axios_1 = require("axios"); | ||
const odata_request_error_1 = require("../base/odata-request-error"); | ||
/** | ||
@@ -36,2 +37,26 @@ * A class representing the app index service allowing to search applications deployed on an ABAP system. | ||
} | ||
/** | ||
* Gets the app info for the specified id. | ||
* | ||
* @param {string} appId - The id of the app. | ||
* @returns {Promise<Ui5AppInfo>} App info. | ||
*/ | ||
getAppInfo(appId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const response = yield this.get('/ui5_app_info_json', { params: { id: appId } }); | ||
return JSON.parse(response.data); | ||
} | ||
catch (error) { | ||
if ((0, odata_request_error_1.isAxiosError)(error)) { | ||
this.log.error(`Failed fetching ui5_app_info_json for app with id ${appId}.`); | ||
} | ||
else { | ||
this.log.error(`Parsing error: ui5_app_info_json is not in expected format for app with id ${appId}.`); | ||
} | ||
this.log.debug(error); | ||
throw error; | ||
} | ||
}); | ||
} | ||
} | ||
@@ -38,0 +63,0 @@ exports.AppIndexService = AppIndexService; |
export { AppInfo, BspConfig, DeployConfig, Ui5AbapRepositoryService, UndeployConfig } from './ui5-abap-repository-service'; | ||
export { LayeredRepositoryService, AdaptationConfig, MergedAppDescriptor } from './lrep-service'; | ||
export { AbapServiceProvider } from './abap-service-provider'; | ||
export { AppIndex, AppIndexService } from './app-index-service'; | ||
export { AppIndex, AppIndexService, Ui5AppInfo } from './app-index-service'; | ||
export * from './message'; | ||
@@ -6,0 +6,0 @@ export * from './catalog'; |
{ | ||
"name": "@sap-ux/axios-extension", | ||
"version": "1.14.1", | ||
"version": "1.14.2", | ||
"description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.", | ||
@@ -32,3 +32,3 @@ "repository": { | ||
"supertest": "6.3.3", | ||
"@sap-ux/project-access": "1.22.2" | ||
"@sap-ux/project-access": "1.22.3" | ||
}, | ||
@@ -35,0 +35,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273816
6247