Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
chore: remove unused code
liyasthomas0cedc9ed51c8
diff --git a/README.md b/README.mdindex 492070454..a750d0733 100644--- a/README.md+++ b/README.md@@ -361,7 +361,6 @@ _Add-ons are developed and maintained under **[Official Hoppscotch Organization]- History- Collections- Environments-- Notes✅ **Post-Request Tests β:** Write tests associated with a request that are executed after the request response.@@ -378,10 +377,6 @@ _Add-ons are developed and maintained under **[Official Hoppscotch Organization]</details>-📝 **Notes** : Instantly jot down notes, tasks or whatever you feel like as they come to your mind.--_Notes are only available for signed-in users_-🌱 **Environments** : Environment variables allow you to store and reuse values in your requests and scripts.<details>diff --git a/components/firebase/Feeds.vue b/components/firebase/Feeds.vuedeleted file mode 100644index 6d74513ad..000000000--- a/components/firebase/Feeds.vue+++ /dev/null@@ -1,62 +0,0 @@-<template>- <div- v-if="currentFeeds && currentFeeds.length !== 0"- class="divide-y virtual-list divide-dashed divide-divider"- >- <ul v-for="feed in currentFeeds" :key="feed.id" class="flex-col">- <div data-test="list-item" class="show-on-large-screen">- <li class="info">- <label data-test="list-label" class="break-all">- {{ feed.label || $t("no_label") }}- </label>- </li>- <button class="icon" @click="deleteFeed(feed)">- <i class="material-icons">delete</i>- </button>- </div>- <div class="show-on-large-screen">- <li data-test="list-message" class="info clamb-3">- <label class="break-all">{{ feed.message || $t("empty") }}</label>- </li>- </div>- </ul>- </div>- <ul v-else class="flex-col">- <li>- <p class="info">{{ $t("empty") }}</p>- </li>- </ul>-</template>--<script>-import { deleteFeed, currentFeeds$ } from "~/helpers/fb/feeds"--export default {- subscriptions() {- return {- currentFeeds: currentFeeds$,- }- },- methods: {- async deleteFeed({ id }) {- await deleteFeed(id)- this.$toast.error(this.$t("deleted"), {- icon: "delete",- })- },- },-}-</script>--<style scoped lang="scss">-.virtual-list {- max-height: calc(100vh - 270px);-}--.clamb-3 {- display: -webkit-box;- -webkit-line-clamp: 3;- -webkit-box-orient: vertical;- @apply overflow-hidden;-}-</style>diff --git a/components/firebase/Inputform.vue b/components/firebase/Inputform.vuedeleted file mode 100644index 865de7ae1..000000000--- a/components/firebase/Inputform.vue+++ /dev/null@@ -1,59 +0,0 @@-<template>- <div class="flex-col">- <div class="show-on-large-screen">- <input- v-model="message"- :aria-label="$t('label')"- type="text"- autofocus- :placeholder="$t('paste_a_note')"- class="rounded-t-lg"- @keyup.enter="formPost"- />- </div>- <div class="border-b show-on-large-screen border-divider">- <input- v-model="label"- :aria-label="$t('label')"- type="text"- autofocus- :placeholder="$t('label')"- @keyup.enter="formPost"- />- <button- class="icon"- :disabled="!(message || label)"- value="Save"- @click="formPost"- >- <i class="material-icons">add</i>- <span>Add</span>- </button>- </div>- </div>-</template>--<script lang="ts">-import Vue from "vue"-import { writeFeed } from "~/helpers/fb/feeds"--export default Vue.extend({- data() {- return {- message: null as string | null,- label: null as string | null,- }- },- methods: {- formPost() {- // TODO: Check this ?- if (!(this.message || this.label)) {- return- }- writeFeed(this.label as string, this.message as string)- this.message = null- this.label = null- },- },-})-</script>diff --git a/components/firebase/Login.vue b/components/firebase/Login.vueindex b75b9df33..a061db64a 100644--- a/components/firebase/Login.vue+++ b/components/firebase/Login.vue@@ -71,7 +71,6 @@ export default {applySetting("syncHistory", true)applySetting("syncCollections", true)applySetting("syncEnvironments", true)- this.$router.push({ path: "/settings" })toastObject.remove()},},@@ -144,7 +143,6 @@ export default {applySetting("syncHistory", true)applySetting("syncCollections", true)applySetting("syncEnvironments", true)- this.$router.push({ path: "/settings" })toastObject.remove()},},diff --git a/components/http/Notes.vue b/components/http/Notes.vuedeleted file mode 100644index 874291615..000000000--- a/components/http/Notes.vue+++ /dev/null@@ -1,30 +0,0 @@-<template>- <AppSection ref="sync" :label="$t('notes')" no-legend>- <div v-if="currentUser">- <FirebaseInputform />- <FirebaseFeeds />- </div>- <div v-else>- <p class="info">{{ $t("login_first") }}</p>- <FirebaseLogin @show-email="showEmail = true" />- </div>- <FirebaseEmail :show="showEmail" @hide-modal="showEmail = false" />- </AppSection>-</template>--<script>-import { currentUser$ } from "~/helpers/fb/auth"--export default {- subscriptions() {- return {- currentUser: currentUser$,- }- },- data() {- return {- showEmail: false,- }- },-}-</script>diff --git a/helpers/fb/feeds.ts b/helpers/fb/feeds.tsdeleted file mode 100644index 3ce10e0ec..000000000--- a/helpers/fb/feeds.ts+++ /dev/null@@ -1,91 +0,0 @@-import firebase from "firebase"-import { BehaviorSubject } from "rxjs"-import { currentUser$ } from "./auth"--type HoppFeed = firebase.firestore.DocumentData & {- id: string- label: string- message: string-}--/**- * An observable subject which is defined as an array of feeds- * the current user has.- *- * Note: If this is null, then it means the user is not signed in- */-export const currentFeeds$ = new BehaviorSubject<HoppFeed[] | null>(null)--export function initFeeds() {- let snapshotStop: (() => void) | null = null-- currentUser$.subscribe((user) => {- if (!user && snapshotStop) {- // User has logged out, clean up snapshot listeners- snapshotStop()- snapshotStop = null- } else if (user) {- snapshotStop = firebase- .firestore()- .collection("users")- .doc(user.uid)- .collection("feeds")- .orderBy("createdOn", "desc")- .onSnapshot((feedsRef) => {- const feeds: HoppFeed[] = []-- feedsRef.forEach((doc) => {- const feed = doc.data()- feed.id = doc.id- feeds.push(feed as HoppFeed)- })-- currentFeeds$.next(feeds)- })- }- })-}--export async function writeFeed(label: string, message: string) {- if (currentUser$.value == null)- throw new Error("Logged out user cannot write to feeds")-- const dt = {- createdOn: new Date(),- author: currentUser$.value.uid,- author_name: currentUser$.value.displayName,- author_image: currentUser$.value.photoURL,- message,- label,- }-- try {- await firebase- .firestore()- .collection("users")- .doc(currentUser$.value.uid)- .collection("feeds")- .add(dt)- } catch (e) {- console.error("error inserting", dt, e)- throw e- }-}--export async function deleteFeed(id: string) {- if (currentUser$.value == null)- throw new Error("Logged out user cannot delete feed")-- try {- await firebase- .firestore()- .collection("users")- .doc(currentUser$.value.uid)- .collection("feeds")- .doc(id)- .delete()- } catch (e) {- console.error("error deleting", id, e)- throw e- }-}diff --git a/helpers/fb/index.ts b/helpers/fb/index.tsindex 303d6ff5d..5d03f18b6 100644--- a/helpers/fb/index.ts+++ b/helpers/fb/index.ts@@ -2,7 +2,6 @@ import firebase from "firebase"import { initAuth } from "./auth"import { initCollections } from "./collections"import { initEnvironments } from "./environments"-import { initFeeds } from "./feeds"import { initHistory } from "./history"import { initSettings } from "./settings"@@ -25,5 +24,4 @@ export function initializeFirebase() {initCollections()initHistory()initEnvironments()- initFeeds()}diff --git a/lang/bn-BD.json b/lang/bn-BD.jsonindex a7692998e..486efec88 100644--- a/lang/bn-BD.json+++ b/lang/bn-BD.json@@ -263,10 +263,7 @@"syncCollections": "সংগ্রহ","syncEnvironments": "এনভায়রনমেন্টসমূহ","turn_on": "চালু করুন",- "login_first": "প্রথমে লগিন করুন",- "paste_a_note": "একটি মন্তব্য লিপিবদ্ধ করুন","import_from_sync": "সিঙ্ক থেকে ইমপোর্ট করুন",- "notes": "মন্তব্য","socketio": "সকেট ইনপুট/আউটপুট","event_name": "ইভেন্টের নাম","mqtt": "এম.কিউ.টি.টি",diff --git a/lang/de-DE.json b/lang/de-DE.jsonindex 2a225c75b..ceb9bb16b 100644--- a/lang/de-DE.json+++ b/lang/de-DE.json@@ -90,10 +90,7 @@"syncEnvironments": "Environments","turn_on": "Anschalten","turn_off": "Ausschalten",- "login_first": "Logge dich zuerst ein",- "paste_a_note": "Füge eine Notiz hinzu","import_from_sync": "Von Sync importieren",- "notes": "Notizen","socketio": "Socket.IO","event_name": "Event Name","mqtt": "MQTT",diff --git a/lang/en-US.json b/lang/en-US.jsonindex e8a81fe08..843ef6ab1 100644--- a/lang/en-US.json+++ b/lang/en-US.json@@ -266,10 +266,7 @@"syncEnvironments": "Environments","turn_on": "Turn on","turn_off": "Turn off",- "login_first": "Login first",- "paste_a_note": "Paste a note","import_from_sync": "Import from Sync",- "notes": "Notes","socketio": "Socket.IO","event_name": "Event Name","mqtt": "MQTT",diff --git a/lang/es-ES.json b/lang/es-ES.jsonindex 06cb15e21..353c53b80 100644--- a/lang/es-ES.json+++ b/lang/es-ES.json@@ -240,7 +240,6 @@"syncCollections": "Colecciones","syncEnvironments": "Entornos","turn_on": "Encender",- "login_first": "Inicie sesión primero","import_from_sync": "Importar desde Sync","add_one_variable": "(añade al menos una variable)","check_graphql_valid": "Compruebe la URL para ver si es un endpoint GraphQL válido",@@ -262,8 +261,6 @@"scrollInto_use_toggle": "Auto scroll","prettify_query": "Formatear query","prettify_body": "Formatear cuerpo",- "paste_a_note": "Pegar una nota",- "notes": "Notas","new_environment": "Nuevo entorno","my_new_environment": "Mi nuevo entorno","mqtt_unsubscribe": "Desuscribirse",diff --git a/lang/fr-FR.json b/lang/fr-FR.jsonindex 06a2219a1..1549fc0ec 100644--- a/lang/fr-FR.json+++ b/lang/fr-FR.json@@ -241,7 +241,6 @@"syncCollections": "Collections","syncEnvironments": "Environments","turn_on": "Activer",- "login_first": "Se connecter d'abord","paste_a_collection": "Coller une collection","import_from_sync": "Importer depuis la synchronisation","create_new_collection": "Créer une nouvelle collection",diff --git a/lang/id-ID.json b/lang/id-ID.jsonindex 62728353d..2e5818f52 100644--- a/lang/id-ID.json+++ b/lang/id-ID.json@@ -263,10 +263,7 @@"syncEnvironments": "Lingkungan","turn_on": "Nyalakan","turn_off": "Matikan",- "login_first": "Masuk dahulu",- "paste_a_note": "Tempel catatan","import_from_sync": "Impor dari Sinkronasi",- "notes": "Catatan","socketio": "Socket.IO","event_name": "Nama Kejadian","mqtt": "MQTT",diff --git a/lang/in-IN.json b/lang/in-IN.jsonindex a1d80fd4c..7968d9d99 100644--- a/lang/in-IN.json+++ b/lang/in-IN.json@@ -266,10 +266,7 @@"syncEnvironments": "वातावरण","turn_on": "चालू करो","turn_off": "बंद करें",- "login_first": "पहले प्रवेश करो",- "paste_a_note": "एक नोट चिपकाएं","import_from_sync": "सिंक से आयात करें",- "notes": "टिप्पणियाँ","socketio": "सॉकेट.आईओ","event_name": "घटना नाम","mqtt": "एमक्यूटीटी",diff --git a/lang/ko-KR.json b/lang/ko-KR.jsonindex d4880cddb..006172b39 100644--- a/lang/ko-KR.json+++ b/lang/ko-KR.json@@ -263,10 +263,7 @@"syncCollections": "컬렉션","syncEnvironments": "환경변수","turn_on": "Turn on",- "login_first": "먼저 로그인해주세요.",- "paste_a_note": "노트 붙여넣기","import_from_sync": "동기화에서 가져오기",- "notes": "노트","socketio": "Socket.IO","event_name": "이","mqtt": "MQTT",diff --git a/lang/ml-ML.json b/lang/ml-ML.jsonindex 922016a83..c4f352931 100644--- a/lang/ml-ML.json+++ b/lang/ml-ML.json@@ -263,10 +263,7 @@"syncCollections": "ശേഖരങ്ങൾ","syncEnvironments": "പരിതസ്ഥിതികൾ","turn_on": "ഓൺ ചെയ്യുക",- "login_first": "ആദ്യം പ്രവേശിക്കുക",- "paste_a_note": "ഒരു കുറിപ്പ് ഒട്ടിക്കുക","import_from_sync": "Sync-ൽ നിന്ന് ഇറക്കുമതി ചെയ്യുക",- "notes": "കുറിപ്പുകൾ","socketio": "Socket.IO","event_name": "ഇവന്റിന്റെ പേര്","mqtt": "MQTT",diff --git a/lang/nb-NO.json b/lang/nb-NO.jsonindex 18f930a49..e03c63157 100644--- a/lang/nb-NO.json+++ b/lang/nb-NO.json@@ -266,10 +266,7 @@"syncEnvironments": "Miljøer","turn_on": "Slå på","turn_off": "Slå av",- "login_first": "Logg inn først",- "paste_a_note": "Lim inn et notat","import_from_sync": "Importer fra synkronisering",- "notes": "Notater","socketio": "Socket.IO","event_name": "Hendelsesnavn","mqtt": "MQTT",diff --git a/lang/nl-BE.json b/lang/nl-BE.jsonindex ab3620783..ffb043bd7 100644--- a/lang/nl-BE.json+++ b/lang/nl-BE.json@@ -263,10 +263,7 @@"syncCollections": "Collecties","syncEnvironments": "Omgevingen","turn_on": "Inschakelen",- "login_first": "Meld u eerst aan",- "paste_a_note": "Notitie plakken","import_from_sync": "Importeren van Sync",- "notes": "Notities","socketio": "Socket.IO","event_name": "Event-naam","mqtt": "MQTT",diff --git a/lang/pt-BR.json b/lang/pt-BR.jsonindex 4b273eb5e..eeb0d89a5 100644--- a/lang/pt-BR.json+++ b/lang/pt-BR.json@@ -271,10 +271,7 @@"scrollInto_use_toggle": "Auto rolagem","sync": "Sincronizar","turn_on": "Ligar",- "login_first": "Realize o login primeiro",- "paste_a_note": "Cole uma nota","import_from_sync": "Importar de Sincronização",- "notes": "Notas","socketio": "Socket.IO","event_name": "Nome do Evento","mqtt": "MQTT",diff --git a/lang/pt-PT.json b/lang/pt-PT.jsonindex cf96b5760..a697109c9 100644--- a/lang/pt-PT.json+++ b/lang/pt-PT.json@@ -260,10 +260,7 @@"syncCollections": "Coleções","syncEnvironments": "Ambientes","turn_on": "Ativar",- "login_first": "Entre primeiro",- "paste_a_note": "Cole uma nota","import_from_sync": "Importar from Sync",- "notes": "Notas","socketio": "Socket.IO","event_name": "Nome do evento","mqtt": "MQTT",diff --git a/lang/tr-TR.json b/lang/tr-TR.jsonindex c5a572a85..a47455d7a 100644--- a/lang/tr-TR.json+++ b/lang/tr-TR.json@@ -261,10 +261,7 @@"syncCollections": "Koleksiyonlar","syncEnvironments": "Ortamlar","turn_on": "Aç",- "login_first": "Önce Giriş Yap",- "paste_a_note": "Bir not yapıştır","import_from_sync": "Senkronizasyondan İçeri Aktar",- "notes": "Notlar","socketio": "Socket.IO","event_name": "Olay Adı","mqtt": "MQTT",diff --git a/lang/vi-VN.json b/lang/vi-VN.jsonindex 9495c2261..faddc9fa4 100644--- a/lang/vi-VN.json+++ b/lang/vi-VN.json@@ -263,10 +263,7 @@"syncCollections": "Bộ sưu tập","syncEnvironments": "Môi trường","turn_on": "Bật",- "login_first": "Đăng nhập trước",- "paste_a_note": "Dán ghi chú","import_from_sync": "Nhập từ đồng bồ",- "notes": "Ghi chú","socketio": "Socket.IO","event_name": "Tên Event","mqtt": "MQTT",diff --git a/lang/zh-CN.json b/lang/zh-CN.jsonindex ab259b555..652ca8592 100644--- a/lang/zh-CN.json+++ b/lang/zh-CN.json@@ -268,10 +268,7 @@"syncEnvironments": "环境","turn_on": "点击开启","turn_off": "点击关闭",- "login_first": "请先登录:",- "paste_a_note": "输入新便笺","import_from_sync": "从云存储导入",- "notes": "便笺","socketio": "Socket.IO","event_name": "事件名称","mqtt": "MQTT",diff --git a/lang/zh-TW.json b/lang/zh-TW.jsonindex 640621768..c576ac5e3 100644--- a/lang/zh-TW.json+++ b/lang/zh-TW.json@@ -258,10 +258,7 @@"syncCollections": "收藏庫","syncEnvironments": "環境","turn_on": "打開",- "login_first": "請先登入",- "paste_a_note": "Paste a note","import_from_sync": "Import from Sync",- "notes": "Notes","socketio": "Socket.IO","event_name": "Event Name","mqtt": "MQTT",diff --git a/pages/graphql.vue b/pages/graphql.vueindex bda374e92..452a4da8e 100644--- a/pages/graphql.vue+++ b/pages/graphql.vue@@ -457,14 +457,6 @@<SmartTab :id="'collections'" :label="$t('collections')"><CollectionsGraphql /></SmartTab>-- <!-- <SmartTab :id="'env'" :label="$t('environments')">- <Environments @use-environment="useSelectedEnvironment($event)" />- </SmartTab>-- <SmartTab :id="'notes'" :label="$t('notes')">- <HttpNotes />- </SmartTab> --></SmartTabs></aside></TranslateSlideLeft>diff --git a/pages/index.vue b/pages/index.vueindex 82806848a..b7e51d7eb 100644--- a/pages/index.vue+++ b/pages/index.vue@@ -637,10 +637,6 @@<SmartTab :id="'env'" :label="$t('environments')"><Environments /></SmartTab>-- <SmartTab :id="'notes'" :label="$t('notes')">- <HttpNotes />- </SmartTab></SmartTabs></section></aside>@@ -775,7 +771,11 @@ import runTestScriptWithVariables from "~/helpers/postwomanTesting"import parseTemplateString from "~/helpers/templating"import { tokenRequest, oauthRedirect } from "~/helpers/oauth"import { cancelRunningRequest, sendNetworkRequest } from "~/helpers/network"-import { hasPathParams, addPathParamsToVariables, getQueryParams } from "~/helpers/requestParams"+import {+ hasPathParams,+ addPathParamsToVariables,+ getQueryParams,+} from "~/helpers/requestParams"import { parseUrlAndPath } from "~/helpers/utils/uri"import { httpValid } from "~/helpers/utils/valid"import {diff --git a/pages/settings.vue b/pages/settings.vueindex e899a5ee0..210f5f7a3 100644--- a/pages/settings.vue+++ b/pages/settings.vue@@ -57,13 +57,6 @@{{ SYNC_HISTORY ? $t("enabled") : $t("disabled") }}</SmartToggle></p>-- <p v-if="isSyncDisabled">- <button @click="initSettings">- <i class="material-icons">sync</i>- <span>{{ $t("turn_on") + " " + $t("sync") }}</span>- </button>- </p></div><div v-else><label>{{ $t("login_with") }}</label>@@ -286,9 +279,6 @@ export default Vue.extend({key: this.PROXY_KEY,}},- isSyncDisabled(): boolean {- return this.SYNC_COLLECTIONS && this.SYNC_ENVIRONMENTS && this.SYNC_HISTORY- }},watch: {proxySettings: {@@ -318,11 +308,6 @@ export default Vue.extend({) {this.applySetting(name, value)},- initSettings() {- applySetting("syncHistory", true)- applySetting("syncCollections", true)- applySetting("syncEnvironments", true)- },resetProxy({ target }: { target: HTMLElement }) {applySetting("PROXY_URL", `https://proxy.hoppscotch.io/`)