Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
browser.pause(1000, function () {
var exampleTestResult = "Kriging_Result";
request.delete(GlobeParameter.dataspatialAnalystURL + exampleTestResult);
});
browser.end();
browser.pause(1000, function () {
var exampleTestResult = "Density_Result";
request.delete(GlobeParameter.dataspatialAnalystURL + exampleTestResult);
});
browser.end();
return new Promise(async (resolve, reject) => {
try {
var token = await this.getAccessToken();
var options = {
url: 'https://api.spotify.com/v1' + endPoint,
headers: { 'Authorization': 'Bearer ' + token },
json: true
};
if (data) options.body = data;
console.log('DELETE: ' + endPoint);
request.delete(options, function(error, response, body) {
if (!error && Spotify.requestOk(response)) {
resolve(body || true);
} else {
console.log(body);
reject(response.statusCode);
}
});
} catch (err) {
reject(err);
}
});
}
const unregister = function(onUnregister) {
const data = {
name: packageJson.name
};
request.delete(registryServer, {
json: data
}, onUnregister);
}
callback(err, body);
};
switch (method.toLowerCase())
{
case "get":
request.get(options, requestCallback);
break;
case "post":
request.post(options, requestCallback);
break;
case "put":
request.put(options, requestCallback);
break;
case "delete":
request.delete(options, requestCallback);
break;
}
};
}
function deleteReplicaSet(requestOptions, params, cb) {
requestOptions = injectCerts(requestOptions);
requestOptions.uri += '/' + params.rsName;
requestOptions.body = {
gracePeriodSeconds: 0
};
request.delete(requestOptions, function (error, response, body) {
return cb(error, body);
});
}
return new Promise((resolve,reject) => {
request.delete(reqParams, (err, res) => {
if (!err && (res.statusCode === 204 || res.statusCode === 404)) {
return resolve(id);
} else {
return reject(err || new Error('Status code: ' + res.statusCode + '. ' + res.body));
}
});
});
};
return new Promise((resolve, reject) => {
if (!sitename || sitename == "") {
reject({});
}
let url = cliConfs.getApiUrl() + 'instances/' + sitename + "/" + operation;
url = `${url}?version=${packageJson.version}&id=${id}`;
request.delete({
headers: {
"x-auth-token": config.token
},
url: url,
json: true,
timeout: 300000
}, function optionalCallback(err, httpResponse, body) {
if (err || httpResponse.statusCode != 200) {
reject(body);
} else {
resolve(body);
}
});
});
}
exports.deleteService = function deleteService(serviceID, cb) {
request.delete(
{
url: `${CONFIG.URLs.metadataUrl}/${serviceID}`,
agentOptions: {
cert: fs.readFileSync(certFile),
key: fs.readFileSync(keyFile)
},
}, function (error, httpResponse, body) {
LOGGER.logger.info("inside delete service")
LOGGER.logger.info("kyma returned: ")
LOGGER.logger.info(body)
cb(body)
}
)
}
function deleteMessage(id, seq, callback) {
request.delete(
config.apiServer + '/message/' + id + '/' + (seq ? seq : ''),
{
json: true
},
(error, response, info) => {
if (error || response.statusCode !== 200) {
if (info && info.error) {
error = new Error(info.error);
}
return callback(error || new Error('Invalid response code ' + response.statusCode));
}
return callback(null, info);
}
);
}