Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return this.toJXML("", request, function(error, xmlObject) {
if (error) {
return callback(error);
}
var xml = jstoxml.toXML(xmlObject, {
header : true,
indent : " ",
filter : xmlFilters
});
if (debug.enabled) {
debug("Descript Path request: returns: " + xml);
}
// logger.verbose("Request description path: " + xml);
response.setHeader("Content-Type", "text/xml; charset=\"utf-8\"");
response.end(xml, "UTF-8");
return callback(null, true);
});
convertRSS() {
this.setState({singleRSS: toXML(this.state.singlePublicPost)});
setTimeout(this.postRSS, 300);
}
customerSessionId : parameters.customerSessionId,
customerIpAddress : parameters.customerIpAddress,
customerUserAgent : parameters.customerUserAgent
};
delete(parameters.customerSessionId);
delete(parameters.customerIpAddress);
delete(parameters.customerUserAgent);
customer = querystring.stringify(customer);
var paramsAsString = customer +"&json&";
if (sendAsREST){
paramsAsString += querystring.stringify(parameters);
}
else {
paramsAsString += querystring.stringify({"xml" : parser.toXML(parameters)});
}
return paramsAsString;
}
function savePlaylist(url, title) {
let trackList = [];
$("#playlist").find("button").each(function () {
trackList.push({
track: {
location: (!$(this).attr("location").startsWith("http") ? "file://" :
"") + escape($(this).attr("location")),
title: escape($(this).text()),
creator: escape($(this).attr("creator"))
}
})
});
let playlist = js2xml.toXML({
playlist: {
_attrs: {
xmlns: "http://xspf.org/ns/0/",
version: "1"
},
title: title || "Playlist",
trackList: trackList
}
}, {
header: true,
indent: " "
});
fs.writeFile(url, playlist, 'utf-8')
.then(function () {
new Notification({
title: "Playlist successfully saved",
responseSoap(response, functionName, body, callback) {
var jxml = {
_name: "s:Envelope",
_attrs: {
xmlns: Xmlns.UPNP_SERVICE,
"xmlns:s": Xmlns.SOAP_ENVELOPE,
"s:encodingStyle": "http://schemas.xmlsoap.org/soap/encoding/"
},
_content: {
"s:Body": body
}
};
var xml = jstoxml.toXML(jxml, {
header: true,
indent: "",
filter: xmlFilters
});
debug("responseSoap", "function=", functionName, "response=", xml);
response.setHeader("Content-Type", "text/xml; charset=\"utf-8\"");
response.end(xml, "utf8");
callback(null);
}
function buildBucketNotFound(bucketName) {
return jstoxml.toXML({
Error: {
Code: 'NoSuchBucket',
Message: 'The resource you requested does not exist',
Resource: bucketName,
RequestId: 1
}
}, XML_OPTIONS);
}
function buildFolderNotFound(key) {
return jstoxml.toXML({
Error: {
Code: 'NoSuchKey',
Message: 'The specified folder already exists',
Resource: key,
RequestId: 1
}
}, XML_OPTIONS);
}
function toDIDLXml(content) {
const didl = toXML({
_name: 'DIDL-Lite',
_attrs: {
'xmlns': 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/',
'xmlns:dc': 'http://purl.org/dc/elements/1.1/',
'xmlns:upnp': 'urn:schemas-upnp-org:metadata-1-0/upnp/',
'xmlns:pv': 'http://www.pv.com/pvns/',
'xmlns:sec': 'http://www.sec.co.kr/'
},
_content: content
})
debug(didl)
return didl
}
let trackList = [];
let file = await Shell.selectFile(Shell.ACTION_SAVE, {
defaultPath: ofdDefaultPath,
buttonLabel: "Export"
});
for (const track of playlist.childNodes) {
trackList.push({
track: {
location: new URL((!file.location.startsWith("http") ? "file://" : "") +
escape(file.location)).href,
title: escape(track.innerText),
creator: escape(track.creator)
}
});
}
let playlist = js2xml.toXML({
playlist: {
_attrs: {
xmlns: "http://xspf.org/ns/0/",
version: "1"
},
title: title || "Playlist",
trackList: trackList
}
}, {
header: true,
indent: " "
});
await fsp.writeFile(url, playlist, 'utf-8');
new Notification("Playlist successfully saved", {
actions: [{
title: "Show in folder",
proto.putChannel = async function putChannel(id, conf, options) {
options = options || {};
options.subres = 'live';
const params = this._objectRequestParams('PUT', id, options);
params.xmlResponse = true;
params.content = jstoxml.toXML({
LiveChannelConfiguration: conf
});
params.successStatuses = [200];
const result = await this.request(params);
let publishUrls = result.data.PublishUrls.Url;
if (!Array.isArray(publishUrls)) {
publishUrls = [publishUrls];
}
let playUrls = result.data.PlayUrls.Url;
if (!Array.isArray(playUrls)) {
playUrls = [playUrls];
}
return {