generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Extend axios-extension services (#1958)
* feat: extend axios-extension services * refactor: change function name * refactor: enhance logging in error handling * test: add tests * test: add tests * test: add tests * refactor: remove method * fix: fix lint errors * fix: fix build * feat: export types and refactor * refactor: change log * refactor: refactor methods * fix: fix sonar issue * refactor: update service schema
- Loading branch information
Showing
10 changed files
with
256 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sap-ux/axios-extension': patch | ||
--- | ||
|
||
Extend axios-extension services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/axios-extension/src/abap/adt-catalog/services/ui5-rt-version-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { AdtCategory } from '../../types'; | ||
import { AdtService } from './adt-service'; | ||
|
||
/** | ||
* UI5RtVersionService implements ADT requests to get UI5 Version | ||
* of ABAP system. | ||
*/ | ||
export class UI5RtVersionService extends AdtService { | ||
/** | ||
* @see AdtService.getAdtCatagory() | ||
*/ | ||
private static adtCategory = { | ||
scheme: 'http://www.sap.com/adt/categories/filestore', | ||
term: 'ui5-rt-version' | ||
}; | ||
|
||
/** | ||
* Get ADT scheme ID. | ||
* | ||
* @returns AdtCategory | ||
*/ | ||
public static getAdtCatagory(): AdtCategory { | ||
return UI5RtVersionService.adtCategory; | ||
} | ||
|
||
/** | ||
* Get UI5 Version of ABAP system. | ||
* | ||
* @returns UI5 Version on the connected ABAP System. | ||
*/ | ||
public async getUI5Version(): Promise<string> { | ||
try { | ||
const result = await this.get(''); | ||
return result.data as string; | ||
} catch (error) { | ||
this.log.error('Could not fetch UI5 Version.'); | ||
this.log.debug(error); | ||
throw error; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters