@sap-ux/axios-extension
Advanced tools
Comparing version 1.14.0 to 1.14.1
@@ -24,2 +24,10 @@ import type { ODataServiceInfo, Annotations, FilterOptions } from './base'; | ||
/** | ||
* Returns the service path for the provided serivce URL. | ||
* | ||
* @param serviceUrl - service url (may be full service url or service path) | ||
* @param baseUrl - base url for the odata service | ||
* @returns - service path | ||
*/ | ||
private getServicePath; | ||
/** | ||
* Map the V2 service information to a version independent structure. | ||
@@ -26,0 +34,0 @@ * |
@@ -32,2 +32,20 @@ "use strict"; | ||
/** | ||
* Returns the service path for the provided serivce URL. | ||
* | ||
* @param serviceUrl - service url (may be full service url or service path) | ||
* @param baseUrl - base url for the odata service | ||
* @returns - service path | ||
*/ | ||
getServicePath(serviceUrl, baseUrl) { | ||
let parsedUrl; | ||
try { | ||
parsedUrl = new URL(serviceUrl); | ||
} | ||
catch (_a) { | ||
// there are cases where the service url is just the path and not the full service url | ||
parsedUrl = new URL(serviceUrl, baseUrl); | ||
} | ||
return parsedUrl.pathname; | ||
} | ||
/** | ||
* Map the V2 service information to a version independent structure. | ||
@@ -40,6 +58,7 @@ * | ||
return services.map((service) => { | ||
const path = this.getServicePath(service.ServiceUrl, this.defaults.baseURL); | ||
return { | ||
id: service.ID, | ||
name: service.TechnicalServiceName, | ||
path: new URL(service.ServiceUrl).pathname, | ||
path: path, | ||
serviceVersion: service.TechnicalServiceVersion + '', | ||
@@ -46,0 +65,0 @@ odataVersion: odata_service_1.ODataVersion.v2 |
{ | ||
"name": "@sap-ux/axios-extension", | ||
"version": "1.14.0", | ||
"version": "1.14.1", | ||
"description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
272193
6197