mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
refactor: comment out unused APIs (#7323)
* refactor: comment out unused API hints in autocomplete.js * refactor: comment out unused API translations in postman and bruno translators Temporarily disable certain API translations due to UI update issues affecting their functionality. A note has been added to restore these translations once the UI fixes are implemented. * refactor: temporarily skip tests for collection variable translations due to UI update issues Commented out tests related to `setCollectionVar`, `deleteCollectionVar`, and related functionalities until the necessary UI updates are implemented. A note has been added to restore these tests once the fixes are live. * refactor: comment out variable deletion and retrieval methods due to UI sync issues * revert: ping.bru * refactor: update postman translation tests to enable previously skipped cases
This commit is contained in:
@@ -257,21 +257,25 @@ class Bru {
|
||||
this.globalEnvironmentVariables[key] = value;
|
||||
}
|
||||
|
||||
deleteGlobalEnvVar(key) {
|
||||
delete this.globalEnvironmentVariables[key];
|
||||
}
|
||||
// TODO: deleteGlobalEnvVar works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// deleteGlobalEnvVar(key) {
|
||||
// delete this.globalEnvironmentVariables[key];
|
||||
// }
|
||||
|
||||
getAllGlobalEnvVars() {
|
||||
return Object.assign({}, this.globalEnvironmentVariables);
|
||||
}
|
||||
|
||||
deleteAllGlobalEnvVars() {
|
||||
for (let key in this.globalEnvironmentVariables) {
|
||||
if (this.globalEnvironmentVariables.hasOwnProperty(key)) {
|
||||
delete this.globalEnvironmentVariables[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: deleteAllGlobalEnvVars works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// deleteAllGlobalEnvVars() {
|
||||
// for (let key in this.globalEnvironmentVariables) {
|
||||
// if (this.globalEnvironmentVariables.hasOwnProperty(key)) {
|
||||
// delete this.globalEnvironmentVariables[key];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
getOauth2CredentialVar(key) {
|
||||
return this.interpolate(this.oauth2CredentialVariables[key]);
|
||||
@@ -345,40 +349,48 @@ class Bru {
|
||||
return this.interpolate(this.collectionVariables[key]);
|
||||
}
|
||||
|
||||
setCollectionVar(key, value) {
|
||||
if (!key) {
|
||||
throw new Error('Creating a variable without specifying a name is not allowed.');
|
||||
}
|
||||
|
||||
if (variableNameRegex.test(key) === false) {
|
||||
throw new Error(
|
||||
`Variable name: "${key}" contains invalid characters!`
|
||||
+ ' Names must only contain alpha-numeric characters, "-", "_", "."'
|
||||
);
|
||||
}
|
||||
|
||||
this.collectionVariables[key] = value;
|
||||
}
|
||||
// TODO: setCollectionVar works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// setCollectionVar(key, value) {
|
||||
// if (!key) {
|
||||
// throw new Error('Creating a variable without specifying a name is not allowed.');
|
||||
// }
|
||||
//
|
||||
// if (variableNameRegex.test(key) === false) {
|
||||
// throw new Error(
|
||||
// `Variable name: "${key}" contains invalid characters!`
|
||||
// + ' Names must only contain alpha-numeric characters, "-", "_", "."'
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// this.collectionVariables[key] = value;
|
||||
// }
|
||||
|
||||
hasCollectionVar(key) {
|
||||
return Object.hasOwn(this.collectionVariables, key);
|
||||
}
|
||||
|
||||
deleteCollectionVar(key) {
|
||||
delete this.collectionVariables[key];
|
||||
}
|
||||
// TODO: deleteCollectionVar works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// deleteCollectionVar(key) {
|
||||
// delete this.collectionVariables[key];
|
||||
// }
|
||||
|
||||
deleteAllCollectionVars() {
|
||||
for (let key in this.collectionVariables) {
|
||||
if (this.collectionVariables.hasOwnProperty(key)) {
|
||||
delete this.collectionVariables[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: deleteAllCollectionVars works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// deleteAllCollectionVars() {
|
||||
// for (let key in this.collectionVariables) {
|
||||
// if (this.collectionVariables.hasOwnProperty(key)) {
|
||||
// delete this.collectionVariables[key];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
getAllCollectionVars() {
|
||||
return Object.assign({}, this.collectionVariables);
|
||||
}
|
||||
// TODO: getAllCollectionVars works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// getAllCollectionVars() {
|
||||
// return Object.assign({}, this.collectionVariables);
|
||||
// }
|
||||
|
||||
getFolderVar(key) {
|
||||
return this.interpolate(this.folderVariables[key]);
|
||||
|
||||
@@ -101,11 +101,13 @@ const addBruShimToContext = (vm, bru) => {
|
||||
vm.setProp(bruObject, 'setGlobalEnvVar', setGlobalEnvVar);
|
||||
setGlobalEnvVar.dispose();
|
||||
|
||||
let deleteGlobalEnvVar = vm.newFunction('deleteGlobalEnvVar', function (key) {
|
||||
bru.deleteGlobalEnvVar(vm.dump(key));
|
||||
});
|
||||
vm.setProp(bruObject, 'deleteGlobalEnvVar', deleteGlobalEnvVar);
|
||||
deleteGlobalEnvVar.dispose();
|
||||
// TODO: deleteGlobalEnvVar works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// let deleteGlobalEnvVar = vm.newFunction('deleteGlobalEnvVar', function (key) {
|
||||
// bru.deleteGlobalEnvVar(vm.dump(key));
|
||||
// });
|
||||
// vm.setProp(bruObject, 'deleteGlobalEnvVar', deleteGlobalEnvVar);
|
||||
// deleteGlobalEnvVar.dispose();
|
||||
|
||||
let getAllGlobalEnvVars = vm.newFunction('getAllGlobalEnvVars', function () {
|
||||
return marshallToVm(bru.getAllGlobalEnvVars(), vm);
|
||||
@@ -113,11 +115,13 @@ const addBruShimToContext = (vm, bru) => {
|
||||
vm.setProp(bruObject, 'getAllGlobalEnvVars', getAllGlobalEnvVars);
|
||||
getAllGlobalEnvVars.dispose();
|
||||
|
||||
let deleteAllGlobalEnvVars = vm.newFunction('deleteAllGlobalEnvVars', function () {
|
||||
bru.deleteAllGlobalEnvVars();
|
||||
});
|
||||
vm.setProp(bruObject, 'deleteAllGlobalEnvVars', deleteAllGlobalEnvVars);
|
||||
deleteAllGlobalEnvVars.dispose();
|
||||
// TODO: deleteAllGlobalEnvVars works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// let deleteAllGlobalEnvVars = vm.newFunction('deleteAllGlobalEnvVars', function () {
|
||||
// bru.deleteAllGlobalEnvVars();
|
||||
// });
|
||||
// vm.setProp(bruObject, 'deleteAllGlobalEnvVars', deleteAllGlobalEnvVars);
|
||||
// deleteAllGlobalEnvVars.dispose();
|
||||
|
||||
let hasVar = vm.newFunction('hasVar', function (key) {
|
||||
return marshallToVm(bru.hasVar(vm.dump(key)), vm);
|
||||
@@ -209,11 +213,13 @@ const addBruShimToContext = (vm, bru) => {
|
||||
vm.setProp(bruObject, 'getCollectionVar', getCollectionVar);
|
||||
getCollectionVar.dispose();
|
||||
|
||||
let setCollectionVar = vm.newFunction('setCollectionVar', function (key, value) {
|
||||
bru.setCollectionVar(vm.dump(key), vm.dump(value));
|
||||
});
|
||||
vm.setProp(bruObject, 'setCollectionVar', setCollectionVar);
|
||||
setCollectionVar.dispose();
|
||||
// TODO: setCollectionVar works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// let setCollectionVar = vm.newFunction('setCollectionVar', function (key, value) {
|
||||
// bru.setCollectionVar(vm.dump(key), vm.dump(value));
|
||||
// });
|
||||
// vm.setProp(bruObject, 'setCollectionVar', setCollectionVar);
|
||||
// setCollectionVar.dispose();
|
||||
|
||||
let hasCollectionVar = vm.newFunction('hasCollectionVar', function (key) {
|
||||
return marshallToVm(bru.hasCollectionVar(vm.dump(key)), vm);
|
||||
@@ -221,23 +227,29 @@ const addBruShimToContext = (vm, bru) => {
|
||||
vm.setProp(bruObject, 'hasCollectionVar', hasCollectionVar);
|
||||
hasCollectionVar.dispose();
|
||||
|
||||
let deleteCollectionVar = vm.newFunction('deleteCollectionVar', function (key) {
|
||||
bru.deleteCollectionVar(vm.dump(key));
|
||||
});
|
||||
vm.setProp(bruObject, 'deleteCollectionVar', deleteCollectionVar);
|
||||
deleteCollectionVar.dispose();
|
||||
// TODO: deleteCollectionVar works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// let deleteCollectionVar = vm.newFunction('deleteCollectionVar', function (key) {
|
||||
// bru.deleteCollectionVar(vm.dump(key));
|
||||
// });
|
||||
// vm.setProp(bruObject, 'deleteCollectionVar', deleteCollectionVar);
|
||||
// deleteCollectionVar.dispose();
|
||||
|
||||
let deleteAllCollectionVars = vm.newFunction('deleteAllCollectionVars', function () {
|
||||
bru.deleteAllCollectionVars();
|
||||
});
|
||||
vm.setProp(bruObject, 'deleteAllCollectionVars', deleteAllCollectionVars);
|
||||
deleteAllCollectionVars.dispose();
|
||||
// TODO: deleteAllCollectionVars works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// let deleteAllCollectionVars = vm.newFunction('deleteAllCollectionVars', function () {
|
||||
// bru.deleteAllCollectionVars();
|
||||
// });
|
||||
// vm.setProp(bruObject, 'deleteAllCollectionVars', deleteAllCollectionVars);
|
||||
// deleteAllCollectionVars.dispose();
|
||||
|
||||
let getAllCollectionVars = vm.newFunction('getAllCollectionVars', function () {
|
||||
return marshallToVm(bru.getAllCollectionVars(), vm);
|
||||
});
|
||||
vm.setProp(bruObject, 'getAllCollectionVars', getAllCollectionVars);
|
||||
getAllCollectionVars.dispose();
|
||||
// TODO: getAllCollectionVars works in the request lifecycle but does not update the UI.
|
||||
// Re-enable once the UI sync issue is resolved.
|
||||
// let getAllCollectionVars = vm.newFunction('getAllCollectionVars', function () {
|
||||
// return marshallToVm(bru.getAllCollectionVars(), vm);
|
||||
// });
|
||||
// vm.setProp(bruObject, 'getAllCollectionVars', getAllCollectionVars);
|
||||
// getAllCollectionVars.dispose();
|
||||
|
||||
let getTestResults = vm.newFunction('getTestResults', () => {
|
||||
const promise = vm.newPromise();
|
||||
|
||||
Reference in New Issue
Block a user