@sap-ux/axios-extension
Advanced tools
Comparing version 0.9.5 to 0.9.6
@@ -99,2 +99,3 @@ "use strict"; | ||
* all the available transport numbers are returned. | ||
* | ||
* @param doc | ||
@@ -119,2 +120,3 @@ * @returns | ||
* A single, previously provided transport number is returned in the list. | ||
* | ||
* @param doc | ||
@@ -121,0 +123,0 @@ * @returns |
@@ -21,3 +21,20 @@ "use strict"; | ||
]); | ||
const xmlReplaceMap = { | ||
'&': '&', | ||
'"': '"', | ||
"'": ''', | ||
'<': '<', | ||
'>': '>' | ||
}; | ||
const xmlReplaceRegex = /[<>&"']/g; | ||
/** | ||
* Escape invalid characters for XML values. | ||
* | ||
* @param xmlValue | ||
* @returns escaped xml value | ||
*/ | ||
function encodeXmlValue(xmlValue) { | ||
return xmlValue.replace(xmlReplaceRegex, (c) => xmlReplaceMap[c]); | ||
} | ||
/** | ||
* Extension of the generic OData client simplifying the consumption of the UI5 repository service | ||
@@ -154,2 +171,3 @@ */ | ||
const time = new Date().toISOString(); | ||
const escapedName = encodeXmlValue(name); | ||
return (`<entry xmlns="http://www.w3.org/2005/Atom"` + | ||
@@ -159,12 +177,12 @@ ` xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"` + | ||
` xml:base="${this.defaults.baseURL}">` + | ||
` <id>${this.defaults.baseURL}/Repositories('${name}')</id>` + | ||
` <title type="text">Repositories('${name}')</title>` + | ||
` <id>${this.defaults.baseURL}/Repositories('${escapedName}')</id>` + | ||
` <title type="text">Repositories('${escapedName}')</title>` + | ||
` <updated>${time}</updated>` + | ||
` <category term="/UI5/ABAP_REPOSITORY_SRV.Repository" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>` + | ||
` <link href="Repositories('${name}')" rel="edit" title="Repository"/>` + | ||
` <link href="Repositories('${escapedName}')" rel="edit" title="Repository"/>` + | ||
` <content type="application/xml">` + | ||
` <m:properties>` + | ||
` <d:Name>${name}</d:Name>` + | ||
` <d:Name>${escapedName}</d:Name>` + | ||
` <d:Package>${abapPackage === null || abapPackage === void 0 ? void 0 : abapPackage.toUpperCase()}</d:Package>` + | ||
` <d:Description>${description}</d:Description>` + | ||
` <d:Description>${encodeXmlValue(description)}</d:Description>` + | ||
` <d:ZipArchive>${base64Data}</d:ZipArchive>` + | ||
@@ -171,0 +189,0 @@ ` <d:Info/>` + |
{ | ||
"name": "@sap-ux/axios-extension", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"description": "Extension of the Axios module adding convinience 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
180828
4042