Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

refactor: real-time system (#2228)

Anwarul Islamf6950bac0fbe
diff --git a/packages/hoppscotch-app/assets/icons/send.svg b/packages/hoppscotch-app/assets/icons/send.svg
new file mode 100644
index 000000000..b1de9a99e
--- /dev/null
+++ b/packages/hoppscotch-app/assets/icons/send.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <line x1="22" y1="2" x2="11" y2="13"></line>
+ <polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
+</svg>
\ No newline at end of file
diff --git a/packages/hoppscotch-app/components/app/PaneLayout.vue b/packages/hoppscotch-app/components/app/PaneLayout.vue
index 0fbb92388..e5b0f7079 100644
--- a/packages/hoppscotch-app/components/app/PaneLayout.vue
+++ b/packages/hoppscotch-app/components/app/PaneLayout.vue
@@ -28,7 +28,7 @@
</Splitpanes>
</Pane>
<Pane
- v-if="SIDEBAR"
+ v-if="SIDEBAR && hasSidebar"
size="25"
min-size="20"
class="hide-scrollbar !overflow-auto flex flex-col"
@@ -42,6 +42,7 @@
import { Splitpanes, Pane } from "splitpanes"
import "splitpanes/dist/splitpanes.css"
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"
+import { computed, useSlots } from "@nuxtjs/composition-api"
import { useSetting } from "~/newstore/settings"
const SIDEBAR_ON_LEFT = useSetting("SIDEBAR_ON_LEFT")
@@ -52,4 +53,8 @@ const mdAndLarger = breakpoints.greater("md")
const COLUMN_LAYOUT = useSetting("COLUMN_LAYOUT")
const SIDEBAR = useSetting("SIDEBAR")
+
+const slots = useSlots()
+
+const hasSidebar = computed(() => !!slots.sidebar)
</script>
diff --git a/packages/hoppscotch-app/components/realtime/Communication.vue b/packages/hoppscotch-app/components/realtime/Communication.vue
new file mode 100644
index 000000000..b96a634f2
--- /dev/null
+++ b/packages/hoppscotch-app/components/realtime/Communication.vue
@@ -0,0 +1,221 @@
+<template>
+ <div class="flex flex-col flex-1">
+ <div v-if="showEventField" class="flex items-center justify-between p-4">
+ <input
+ id="event_name"
+ v-model="eventName"
+ class="input"
+ name="event_name"
+ :placeholder="`${t('socketio.event_name')}`"
+ type="text"
+ autocomplete="off"
+ />
+ </div>
+ <div
+ class="sticky z-10 flex items-center justify-between pl-4 border-b bg-primary border-dividerLight top-upperMobileSecondaryStickyFold sm:top-upperSecondaryStickyFold"
+ >
+ <span class="flex items-center">
+ <label class="font-semibold text-secondaryLight">
+ {{ $t("websocket.message") }}
+ </label>
+ <tippy
+ ref="contentTypeOptions"
+ interactive
+ trigger="click"
+ theme="popover"
+ arrow
+ >
+ <template #trigger>
+ <span class="select-wrapper">
+ <ButtonSecondary
+ :label="contentType || $t('state.none').toLowerCase()"
+ class="pr-8 ml-2 rounded-none"
+ />
+ </span>
+ </template>
+ <div class="flex flex-col" role="menu">
+ <SmartItem
+ v-for="(contentTypeItem, index) in validContentTypes"
+ :key="`contentTypeItem-${index}`"
+ :label="contentTypeItem"
+ :info-icon="contentTypeItem === contentType ? 'done' : ''"
+ :active-info-icon="contentTypeItem === contentType"
+ @click.native="
+ () => {
+ contentType = contentTypeItem
+ $refs.contentTypeOptions.tippy().hide()
+ }
+ "
+ />
+ </div>
+ </tippy>
+ </span>
+ <div class="flex">
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip', delay: [500, 20], allowHTML: true }"
+ :title="`${t('action.send')}`"
+ :label="`${t('action.send')}`"
+ :disabled="!communicationBody || !isConnected"
+ svg="send"
+ class="rounded-none !text-accent !hover:text-accentDark"
+ @click.native="sendMessage()"
+ />
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ to="https://docs.hoppscotch.io/features/body"
+ blank
+ :title="t('app.wiki')"
+ svg="help-circle"
+ />
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('state.linewrap')"
+ :class="{ '!text-accent': linewrapEnabled }"
+ svg="wrap-text"
+ @click.native.prevent="linewrapEnabled = !linewrapEnabled"
+ />
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('action.clear')"
+ svg="trash-2"
+ @click.native="clearContent"
+ />
+ <ButtonSecondary
+ v-if="contentType && contentType == 'JSON'"
+ ref="prettifyRequest"
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('action.prettify')"
+ :svg="prettifyIcon"
+ @click.native="prettifyRequestBody"
+ />
+ <label for="payload">
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('import.title')"
+ svg="file-plus"
+ @click.native="$refs.payload.click()"
+ />
+ </label>
+ <input
+ ref="payload"
+ class="input"
+ name="payload"
+ type="file"
+ @change="uploadPayload"
+ />
+ </div>
+ </div>
+ <div ref="wsCommunicationBody" class="flex flex-col flex-1"></div>
+ </div>
+</template>
+<script setup lang="ts">
+import { computed, reactive, ref } from "@nuxtjs/composition-api"
+import { pipe } from "fp-ts/function"
+import * as TO from "fp-ts/TaskOption"
+import * as O from "fp-ts/Option"
+import { useCodemirror } from "~/helpers/editor/codemirror"
+import jsonLinter from "~/helpers/editor/linting/json"
+import { readFileAsText } from "~/helpers/functional/files"
+import { useI18n, useToast } from "~/helpers/utils/composables"
+import { isJSONContentType } from "~/helpers/utils/contenttypes"
+
+defineProps({
+ showEventField: {
+ type: Boolean,
+ default: false,
+ },
+ isConnected: {
+ type: Boolean,
+ default: false,
+ },
+})
+
+const emit = defineEmits<{
+ (
+ e: "send-message",
+ body: {
+ eventName: string
+ message: string
+ }
+ ): void
+}>()
+
+const t = useI18n()
+const toast = useToast()
+
+const linewrapEnabled = ref(true)
+const wsCommunicationBody = ref<HTMLElement>()
+const prettifyIcon = ref<"wand" | "check" | "info">("wand")
+
+const knownContentTypes = {
+ JSON: "application/ld+json",
+ Raw: "text/plain",
+} as const
+
+const validContentTypes = Object.keys(knownContentTypes)
+
+const contentType = ref<keyof typeof knownContentTypes>("JSON")
+const eventName = ref("")
+const communicationBody = ref("")
+
+const rawInputEditorLang = computed(() => knownContentTypes[contentType.value])
+const langLinter = computed(() =>
+ isJSONContentType(contentType.value) ? jsonLinter : null
+)
+
+useCodemirror(
+ wsCommunicationBody,
+ communicationBody,
+ reactive({
+ extendedEditorConfig: {
+ lineWrapping: linewrapEnabled,
+ mode: rawInputEditorLang,
+ placeholder: t("websocket.message").toString(),
+ },
+ linter: langLinter,
+ completer: null,
+ environmentHighlights: true,
+ })
+)
+
+const clearContent = () => {
+ communicationBody.value = ""
+}
+
+const sendMessage = () => {
+ if (!communicationBody.value) return
+
+ emit("send-message", {
+ eventName: eventName.value,
+ message: communicationBody.value,
+ })
+ communicationBody.value = ""
+}
+
+const uploadPayload = async (e: InputEvent) => {
+ const result = await pipe(
+ (e.target as HTMLInputElement).files?.[0],
+ TO.fromNullable,
+ TO.chain(readFileAsText)
+ )()
+
+ if (O.isSome(result)) {
+ communicationBody.value = result.value
+ toast.success(`${t("state.file_imported")}`)
+ } else {
+ toast.error(`${t("action.choose_file")}`)
+ }
+}
+const prettifyRequestBody = () => {
+ try {
+ const jsonObj = JSON.parse(communicationBody.value)
+ communicationBody.value = JSON.stringify(jsonObj, null, 2)
+ prettifyIcon.value = "check"
+ } catch (e) {
+ console.error(e)
+ prettifyIcon.value = "info"
+ toast.error(`${t("error.json_prettify_invalid_body")}`)
+ }
+ setTimeout(() => (prettifyIcon.value = "wand"), 1000)
+}
+</script>
diff --git a/packages/hoppscotch-app/components/realtime/Log.vue b/packages/hoppscotch-app/components/realtime/Log.vue
index e46dc21d0..eb7ec006a 100644
--- a/packages/hoppscotch-app/components/realtime/Log.vue
+++ b/packages/hoppscotch-app/components/realtime/Log.vue
@@ -61,7 +61,8 @@ import { useThrottleFn, useScroll } from "@vueuse/core"
import { useI18n } from "~/helpers/utils/composables"
export type LogEntryData = {
- ts: number
+ prefix?: string
+ ts: number | undefined
source: "info" | "client" | "server" | "disconnected"
payload: string
event: "connecting" | "connected" | "disconnected" | "error"
diff --git a/packages/hoppscotch-app/components/realtime/LogEntry.vue b/packages/hoppscotch-app/components/realtime/LogEntry.vue
index e9389e424..56a8537b7 100644
--- a/packages/hoppscotch-app/components/realtime/LogEntry.vue
+++ b/packages/hoppscotch-app/components/realtime/LogEntry.vue
@@ -11,7 +11,10 @@
@click.native="copyQuery(entry.payload)"
/>
</div>
- <div class="items-center hidden px-1 w-18 sm:inline-flex">
+ <div
+ v-if="entry.ts !== undefined"
+ class="items-center hidden px-1 w-18 sm:inline-flex"
+ >
<span
v-tippy="{ theme: 'tooltip' }"
:title="relativeTime"
@@ -25,6 +28,9 @@
@click="toggleExpandPayload()"
>
<div class="truncate">
+ <span v-if="entry.prefix !== undefined" class="!inline">{{
+ entry.prefix
+ }}</span>
{{ entry.payload }}
</div>
</div>
@@ -312,26 +318,20 @@ const copyQuery = (entry: string) => {
}
// Relative Time
-const relativeTime = useTimeAgo(computed(() => props.entry.ts))
+// TS could be undefined here. We're just assigning a default value to 0 because we're not showing it in the UI
+const relativeTime = useTimeAgo(computed(() => props.entry.ts ?? 0))
+
+const ENTRY_COLORS = {
+ connected: "#10b981",
+ connecting: "#10b981",
+ error: "#ff5555",
+ disconnected: "#ff5555",
+} as const
// Assigns color based on entry event
-const entryColor = computed(() => {
- switch (props.entry.event) {
- case "connected":
- return "#10b981"
- case "connecting":
- return "#10b981"
- case "error":
- return "#ff5555"
- case "disconnected":
- return "#ff5555"
- }
-})
+const entryColor = computed(() => ENTRY_COLORS[props.entry.event])
-const ICONS: Record<
- LogEntryData["source"],
- { iconName: string; iconColor: string }
-> = {
+const ICONS = {
info: {
iconName: "info-realtime",
iconColor: "#10b981",
@@ -348,7 +348,7 @@ const ICONS: Record<
iconName: "info-disconnect",
iconColor: "#ff5555",
},
-}
+} as const
const iconColor = computed(() => ICONS[props.entry.source].iconColor)
const iconName = computed(() => ICONS[props.entry.source].iconName)
diff --git a/packages/hoppscotch-app/components/realtime/Mqtt.vue b/packages/hoppscotch-app/components/realtime/Mqtt.vue
index b04000091..dd4d63882 100644
--- a/packages/hoppscotch-app/components/realtime/Mqtt.vue
+++ b/packages/hoppscotch-app/components/realtime/Mqtt.vue
@@ -13,17 +13,22 @@
spellcheck="false"
class="w-full px-4 py-2 border rounded bg-primaryLight border-divider text-secondaryDark"
:placeholder="$t('mqtt.url')"
- :disabled="connectionState"
- @keyup.enter="validUrl ? toggleConnection() : null"
+ :disabled="
+ connectionState === 'CONNECTED' ||
+ connectionState === 'CONNECTING'
+ "
+ @keyup.enter="isUrlValid ? toggleConnection() : null"
/>
<ButtonPrimary
id="connect"
- :disabled="!validUrl"
+ :disabled="!isUrlValid"
class="w-32"
:label="
- connectionState ? $t('action.disconnect') : $t('action.connect')
+ connectionState === 'DISCONNECTED'
+ ? t('action.connect')
+ : t('action.disconnect')
"
- :loading="connectingState"
+ :loading="connectionState === 'CONNECTING'"
@click.native="toggleConnection"
/>
</div>
@@ -56,14 +61,14 @@
</template>
<template #sidebar>
<div class="flex items-center justify-between p-4">
- <label for="pub_topic" class="font-semibold text-secondaryLight">
+ <label for="pubTopic" class="font-semibold text-secondaryLight">
{{ $t("mqtt.topic") }}
</label>
</div>
<div class="flex px-4">
<input
- id="pub_topic"
- v-model="pub_topic"
+ id="pubTopic"
+ v-model="pubTopic"
class="input"
:placeholder="$t('mqtt.topic_name')"
type="text"
@@ -79,7 +84,7 @@
<div class="flex px-4 space-x-2">
<input
id="mqtt-message"
- v-model="msg"
+ v-model="message"
class="input"
type="text"
autocomplete="off"
@@ -89,7 +94,7 @@
<ButtonPrimary
id="publish"
name="get"
- :disabled="!canpublish"
+ :disabled="!canPublish"
:label="$t('mqtt.publish')"
@click.native="publish"
/>
@@ -97,14 +102,14 @@
<div
class="flex items-center justify-between p-4 mt-4 border-t border-dividerLight"
>
- <label for="sub_topic" class="font-semibold text-secondaryLight">
+ <label for="subTopic" class="font-semibold text-secondaryLight">
{{ $t("mqtt.topic") }}
</label>
</div>
<div class="flex px-4 space-x-2">
<input
- id="sub_topic"
- v-model="sub_topic"
+ id="subTopic"
+ v-model="subTopic"
type="text"
autocomplete="off"
:placeholder="$t('mqtt.topic_name')"
@@ -114,7 +119,7 @@
<ButtonPrimary
id="subscribe"
name="get"
- :disabled="!cansubscribe"
+ :disabled="!canSubscribe"
:label="
subscriptionState ? $t('mqtt.unsubscribe') : $t('mqtt.subscribe')
"
@@ -126,264 +131,220 @@
</AppPaneLayout>
</template>
-<script>
-import { defineComponent } from "@nuxtjs/composition-api"
-import Paho from "paho-mqtt"
+<script setup lang="ts">
+import {
+ computed,
+ onMounted,
+ onUnmounted,
+ ref,
+ watch,
+} from "@nuxtjs/composition-api"
import debounce from "lodash/debounce"
-import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
+import { MQTTConnection, MQTTError } from "~/helpers/realtime/MQTTConnection"
+import {
+ useI18n,
+ useNuxt,
+ useReadonlyStream,
+ useStream,
+ useStreamSubscriber,
+ useToast,
+} from "~/helpers/utils/composables"
import {
+ addMQTTLogLine,
+ MQTTConn$,
MQTTEndpoint$,
- setMQTTEndpoint,
- MQTTConnectingState$,
- MQTTConnectionState$,
- setMQTTConnectingState,
- setMQTTConnectionState,
- MQTTSubscriptionState$,
- setMQTTSubscriptionState,
- MQTTSocket$,
- setMQTTSocket,
MQTTLog$,
+ setMQTTConn,
+ setMQTTEndpoint,
setMQTTLog,
- addMQTTLogLine,
} from "~/newstore/MQTTSession"
-import { useStream } from "~/helpers/utils/composables"
-export default defineComponent({
- setup() {
- return {
- url: useStream(MQTTEndpoint$, "", setMQTTEndpoint),
- connectionState: useStream(
- MQTTConnectionState$,
- false,
- setMQTTConnectionState
- ),
- connectingState: useStream(
- MQTTConnectingState$,
- false,
- setMQTTConnectingState
- ),
- subscriptionState: useStream(
- MQTTSubscriptionState$,
- false,
- setMQTTSubscriptionState
- ),
- log: useStream(MQTTLog$, null, setMQTTLog),
- client: useStream(MQTTSocket$, null, setMQTTSocket),
- }
- },
- data() {
- return {
- isUrlValid: true,
- pub_topic: "",
- sub_topic: "",
- msg: "",
- manualDisconnect: false,
- username: "",
- password: "",
- }
- },
- computed: {
- validUrl() {
- return this.isUrlValid
- },
- canpublish() {
- return this.pub_topic !== "" && this.msg !== "" && this.connectionState
- },
- cansubscribe() {
- return this.sub_topic !== "" && this.connectionState
- },
- },
- watch: {
- url() {
- this.debouncer()
- },
- },
- created() {
- if (process.browser) {
- this.worker = this.$worker.createRejexWorker()
- this.worker.addEventListener("message", this.workerResponseHandler)
- }
- },
- destroyed() {
- this.worker.terminate()
- },
- methods: {
- debouncer: debounce(function () {
- this.worker.postMessage({ type: "ws", url: this.url })
- }, 1000),
- workerResponseHandler({ data }) {
- if (data.url === this.url) this.isUrlValid = data.result
- },
- connect() {
- this.connectingState = true
- this.log = [
- {
- payload: this.$t("state.connecting_to", { name: this.url }),
- source: "info",
- event: "connecting",
- ts: Date.now(),
- },
- ]
- const parseUrl = new URL(this.url)
- this.client = new Paho.Client(
- `${parseUrl.hostname}${
- parseUrl.pathname !== "/" ? parseUrl.pathname : ""
- }`,
- parseUrl.port !== "" ? Number(parseUrl.port) : 8081,
- "hoppscotch"
- )
- const connectOptions = {
- onSuccess: this.onConnectionSuccess,
- onFailure: this.onConnectionFailure,
- useSSL: parseUrl.protocol !== "ws:",
- }
- if (this.username !== "") {
- connectOptions.userName = this.username
- }
- if (this.password !== "") {
- connectOptions.password = this.password
- }
- this.client.connect(connectOptions)
- this.client.onConnectionLost = this.onConnectionLost
- this.client.onMessageArrived = this.onMessageArrived
+const t = useI18n()
+const nuxt = useNuxt()
+const toast = useToast()
+const { subscribeToStream } = useStreamSubscriber()
+
+const url = useStream(MQTTEndpoint$, "", setMQTTEndpoint)
+const log = useStream(MQTTLog$, [], setMQTTLog)
+const socket = useStream(MQTTConn$, new MQTTConnection(), setMQTTConn)
+const connectionState = useReadonlyStream(
+ socket.value.connectionState$,
+ "DISCONNECTED"
+)
+const subscriptionState = useReadonlyStream(
+ socket.value.subscriptionState$,
+ false
+)
+
+const isUrlValid = ref(true)
+const pubTopic = ref("")
+const subTopic = ref("")
+const message = ref("")
+const username = ref("")
+const password = ref("")
+
+let worker: Worker
+
+const canPublish = computed(
+ () =>
+ pubTopic.value !== "" &&
+ message.value !== "" &&
+ connectionState.value === "CONNECTED"
+)
+const canSubscribe = computed(
+ () => subTopic.value !== "" && connectionState.value === "CONNECTED"
+)
+
+const workerResponseHandler = ({
+ data,
+}: {
+ data: { url: string; result: boolean }
+}) => {
+ if (data.url === url.value) isUrlValid.value = data.result
+}
- logHoppRequestRunToAnalytics({
- platform: "mqtt",
- })
- },
- onConnectionFailure() {
- this.connectingState = false
- this.connectionState = false
- addMQTTLogLine({
- payload: this.$t("error.something_went_wrong"),
- source: "info",
- event: "error",
- ts: Date.now(),
- })
- },
- onConnectionSuccess() {
- this.connectingState = false
- this.connectionState = true
- addMQTTLogLine({
- payload: this.$t("state.connected_to", { name: this.url }),
- source: "info",
- event: "connected",
- ts: Date.now(),
- })
- this.$toast.success(this.$t("state.connected"))
- },
- onMessageArrived({ payloadString, destinationName }) {
- addMQTTLogLine({
- payload: `Message: ${payloadString} arrived on topic: ${destinationName}`,
- source: "info",
- event: "info",
- ts: Date.now(),
- })
- },
- toggleConnection() {
- if (this.connectionState) {
- this.disconnect()
- } else {
- this.connect()
- }
- },
- disconnect() {
- this.manualDisconnect = true
- this.client.disconnect()
- addMQTTLogLine({
- payload: this.$t("state.disconnected_from", { name: this.url }),
- source: "disconnected",
- event: "disconnected",
- ts: Date.now(),
- })
- },
- onConnectionLost() {
- this.connectingState = false
- this.connectionState = false
- if (this.manualDisconnect) {
- this.$toast.error(this.$t("state.disconnected"))
- } else {
- this.$toast.error(this.$t("error.something_went_wrong"))
- }
- this.manualDisconnect = false
- this.subscriptionState = false
- },
- publish() {
- try {
- this.client.publish(this.pub_topic, this.msg, 0, false)
+onMounted(() => {
+ worker = nuxt.value.$worker.createRejexWorker()
+ worker.addEventListener("message", workerResponseHandler)
+
+ subscribeToStream(socket.value.event$, (event) => {
+ switch (event?.type) {
+ case "CONNECTING":
+ log.value = [
+ {
+ payload: `${t("state.connecting_to", { name: url.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
+ ts: undefined,
+ },
+ ]
+ break
+
+ case "CONNECTED":
+ log.value = [
+ {
+ payload: `${t("state.connected_to", { name: url.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
+ ts: Date.now(),
+ },
+ ]
+ toast.success(`${t("state.connected")}`)
+ break
+
+ case "MESSAGE_SENT":
addMQTTLogLine({
- payload: `Published message: ${this.msg} to topic: ${this.pub_topic}`,
+ prefix: `${event.message.topic}`,
+ payload: event.message.message,
+ source: "client",
ts: Date.now(),
- source: "info",
- event: "info",
})
- } catch (e) {
+ break
+
+ case "MESSAGE_RECEIVED":
+ addMQTTLogLine({
+ prefix: `${event.message.topic}`,
+ payload: event.message.message,
+ source: "server",
+ ts: event.time,
+ })
+ break
+
+ case "SUBSCRIBED":
addMQTTLogLine({
- payload:
- this.$t("error.something_went_wrong") +
- `while publishing msg: ${this.msg} to topic: ${this.pub_topic}`,
- source: "info",
- event: "error",
- ts: Date.now(),
+ payload: subscriptionState.value
+ ? `${t("state.subscribed_success", { topic: subTopic.value })}`
+ : `${t("state.unsubscribed_success", { topic: subTopic.value })}`,
+ source: "server",
+ ts: event.time,
})
- }
- },
- toggleSubscription() {
- if (this.subscriptionState) {
- this.unsubscribe()
- } else {
- this.subscribe()
- }
- },
- subscribe() {
- try {
- this.client.subscribe(this.sub_topic, {
- onSuccess: this.usubSuccess,
- onFailure: this.usubFailure,
+ break
+
+ case "SUBSCRIPTION_FAILED":
+ addMQTTLogLine({
+ payload: subscriptionState.value
+ ? `${t("state.subscribed_failed", { topic: subTopic.value })}`
+ : `${t("state.unsubscribed_failed", { topic: subTopic.value })}`,
+ source: "server",
+ ts: event.time,
})
- } catch (e) {
+ break
+
+ case "ERROR":
addMQTTLogLine({
- payload:
- this.$t("error.something_went_wrong") +
- `while subscribing to topic: ${this.sub_topic}`,
+ payload: getI18nError(event.error),
source: "info",
- event: "error",
- ts: Date.now(),
+ color: "#ff5555",
+ ts: event.time,
+ })
+ break
+
+ case "DISCONNECTED":
+ addMQTTLogLine({
+ payload: t("state.disconnected_from", { name: url.value }).toString(),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
})
- }
- },
- usubSuccess() {
- this.subscriptionState = !this.subscriptionState
- addMQTTLogLine({
- payload:
- `Successfully ` +
- (this.subscriptionState ? "subscribed" : "unsubscribed") +
- ` to topic: ${this.sub_topic}`,
- source: "info",
- event: "info",
- ts: Date.now(),
- })
- },
- usubFailure() {
- addMQTTLogLine({
- payload:
- `Failed to ` +
- (this.subscriptionState ? "unsubscribe" : "subscribe") +
- ` to topic: ${this.sub_topic}`,
- source: "info",
- color: "error",
- ts: Date.now(),
- })
- },
- unsubscribe() {
- this.client.unsubscribe(this.sub_topic, {
- onSuccess: this.usubSuccess,
- onFailure: this.usubFailure,
- })
- },
- clearLogEntries() {
- this.log = []
- },
- },
+ toast.error(`${t("state.disconnected")}`)
+ break
+ }
+ })
+})
+
+const debouncer = debounce(function () {
+ worker.postMessage({ type: "ws", url: url.value })
+}, 1000)
+
+watch(url, (newUrl) => {
+ if (newUrl) debouncer()
})
+
+onUnmounted(() => {
+ worker.terminate()
+})
+
+// METHODS
+const toggleConnection = () => {
+ // If it is connecting:
+ if (connectionState.value === "DISCONNECTED") {
+ return socket.value.connect(url.value, username.value, password.value)
+ }
+ // Otherwise, it's disconnecting.
+ socket.value.disconnect()
+}
+const publish = () => {
+ socket.value?.publish(pubTopic.value, message.value)
+}
+const toggleSubscription = () => {
+ if (subscriptionState.value) {
+ socket.value.unsubscribe(subTopic.value)
+ } else {
+ socket.value.subscribe(subTopic.value)
+ }
+}
+
+const getI18nError = (error: MQTTError): string => {
+ if (typeof error === "string") return error
+
+ switch (error.type) {
+ case "CONNECTION_NOT_ESTABLISHED":
+ return t("state.connection_lost").toString()
+ case "SUBSCRIPTION_FAILED":
+ return t("state.mqtt_subscription_failed", {
+ topic: error.topic,
+ }).toString()
+ case "PUBLISH_ERROR":
+ return t("state.publish_error", { topic: error.topic }).toString()
+ case "CONNECTION_LOST":
+ return t("state.connection_lost").toString()
+ case "CONNECTION_FAILED":
+ return t("state.connection_failed").toString()
+ default:
+ return t("state.disconnected_from", { name: url.value }).toString()
+ }
+}
+const clearLogEntries = () => {
+ log.value = []
+}
</script>
diff --git a/packages/hoppscotch-app/components/realtime/Socketio.vue b/packages/hoppscotch-app/components/realtime/Socketio.vue
index 79623d227..fc02f857d 100644
--- a/packages/hoppscotch-app/components/realtime/Socketio.vue
+++ b/packages/hoppscotch-app/components/realtime/Socketio.vue
@@ -23,13 +23,16 @@
class="flex px-4 py-2 font-semibold border rounded-l cursor-pointer bg-primaryLight border-divider text-secondaryDark w-26"
:value="`Client ${clientVersion}`"
readonly
- :disabled="connectionState"
+ :disabled="
+ connectionState === 'CONNECTED' ||
+ connectionState === 'CONNECTING'
+ "
/>
</span>
</template>
<div class="flex flex-col" role="menu">
<SmartItem
- v-for="(_, version) in socketIoClients"
+ v-for="version in SIOVersions"
:key="`client-${version}`"
:label="`Client ${version}`"
@click.native="onSelectVersion(version)"
@@ -43,487 +46,390 @@
type="url"
autocomplete="off"
spellcheck="false"
- :class="{ error: !urlValid }"
+ :class="{ error: !isUrlValid }"
class="flex flex-1 w-full px-4 py-2 border bg-primaryLight border-divider text-secondaryDark"
- :placeholder="$t('socketio.url')"
- :disabled="connectionState"
- @keyup.enter="urlValid ? toggleConnection() : null"
+ :placeholder="`${t('socketio.url')}`"
+ :disabled="
+ connectionState === 'CONNECTED' ||
+ connectionState === 'CONNECTING'
+ "
+ @keyup.enter="isUrlValid ? toggleConnection() : null"
/>
<input
id="socketio-path"
v-model="path"
class="flex flex-1 w-full px-4 py-2 border rounded-r bg-primaryLight border-divider text-secondaryDark"
spellcheck="false"
- :disabled="connectionState"
- @keyup.enter="urlValid ? toggleConnection() : null"
+ :disabled="
+ connectionState === 'CONNECTED' ||
+ connectionState === 'CONNECTING'
+ "
+ @keyup.enter="isUrlValid ? toggleConnection() : null"
/>
</div>
<ButtonPrimary
id="connect"
- :disabled="!urlValid"
+ :disabled="!isUrlValid"
name="connect"
class="w-32"
:label="
- !connectionState ? $t('action.connect') : $t('action.disconnect')
+ connectionState === 'DISCONNECTED'
+ ? t('action.connect')
+ : t('action.disconnect')
"
- :loading="connectingState"
+ :loading="connectionState === 'CONNECTING'"
@click.native="toggleConnection"
/>
</div>
</div>
- <div
- class="sticky z-10 flex items-center justify-between pl-4 border-b bg-primary border-dividerLight top-upperPrimaryStickyFold"
+
+ <SmartTabs
+ v-model="selectedTab"
+ styles="sticky bg-primary top-upperMobilePrimaryStickyFold sm:top-upperPrimaryStickyFold z-10"
>
- <span class="flex items-center">
- <label class="font-semibold text-secondaryLight">
- {{ $t("authorization.type") }}
- </label>
- <tippy
- ref="authTypeOptions"
- interactive
- trigger="click"
- theme="popover"
- arrow
+ <SmartTab
+ :id="'communication'"
+ :label="`${t('websocket.communication')}`"
+ >
+ <RealtimeCommunication
+ :show-event-field="true"
+ :is-connected="connectionState === 'CONNECTED'"
+ @send-message="sendMessage($event)"
+ ></RealtimeCommunication>
+ </SmartTab>
+ <SmartTab :id="'protocols'" :label="`${t('request.authorization')}`">
+ <div
+ class="sticky z-10 flex items-center justify-between pl-4 border-b bg-primary border-dividerLight top-upperPrimaryStickyFold"
>
- <template #trigger>
- <span class="select-wrapper">
- <ButtonSecondary
- class="pr-8 ml-2 rounded-none"
- :label="authType"
- />
- </span>
- </template>
- <div class="flex flex-col" role="menu">
- <SmartItem
- label="None"
- :icon="
- authType === 'None'
- ? 'radio_button_checked'
- : 'radio_button_unchecked'
- "
- :active="authType === 'None'"
- @click.native="
- () => {
- authType = 'None'
- authTypeOptions.tippy().hide()
- }
- "
+ <span class="flex items-center">
+ <label class="font-semibold text-secondaryLight">
+ {{ t("authorization.type") }}
+ </label>
+ <tippy
+ ref="authTypeOptions"
+ interactive
+ trigger="click"
+ theme="popover"
+ arrow
+ >
+ <template #trigger>
+ <span class="select-wrapper">
+ <ButtonSecondary
+ class="pr-8 ml-2 rounded-none"
+ :label="authType"
+ />
+ </span>
+ </template>
+ <div class="flex flex-col" role="menu">
+ <SmartItem
+ label="None"
+ :icon="
+ authType === 'None'
+ ? 'radio_button_checked'
+ : 'radio_button_unchecked'
+ "
+ :active="authType === 'None'"
+ @click.native="
+ () => {
+ authType = 'None'
+ authTypeOptions.tippy().hide()
+ }
+ "
+ />
+ <SmartItem
+ label="Bearer Token"
+ :icon="
+ authType === 'Bearer'
+ ? 'radio_button_checked'
+ : 'radio_button_unchecked'
+ "
+ :active="authType === 'Bearer'"
+ @click.native="
+ () => {
+ authType = 'Bearer'
+ authTypeOptions.tippy().hide()
+ }
+ "
+ />
+ </div>
+ </tippy>
+ </span>
+ <div class="flex">
+ <SmartCheckbox
+ :on="authActive"
+ class="px-2"
+ @change="authActive = !authActive"
+ >
+ {{ t("state.enabled") }}
+ </SmartCheckbox>
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ to="https://docs.hoppscotch.io/features/authorization"
+ blank
+ :title="t('app.wiki')"
+ svg="help-circle"
/>
- <SmartItem
- label="Bearer Token"
- :icon="
- authType === 'Bearer'
- ? 'radio_button_checked'
- : 'radio_button_unchecked'
- "
- :active="authType === 'Bearer'"
- @click.native="
- () => {
- authType = 'Bearer'
- authTypeOptions.tippy().hide()
- }
- "
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('action.clear')"
+ svg="trash-2"
+ @click.native="clearContent"
/>
</div>
- </tippy>
- </span>
- <div class="flex">
- <SmartCheckbox
- :on="authActive"
- class="px-2"
- @change="authActive = !authActive"
- >
- {{ $t("state.enabled") }}
- </SmartCheckbox>
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- to="https://docs.hoppscotch.io/features/authorization"
- blank
- :title="$t('app.wiki')"
- svg="help-circle"
- />
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- :title="$t('action.clear')"
- svg="trash-2"
- @click.native="clearContent"
- />
- </div>
- </div>
- <div
- v-if="authType === 'None'"
- class="flex flex-col items-center justify-center p-4 text-secondaryLight"
- >
- <img
- :src="`/images/states/${$colorMode.value}/login.svg`"
- loading="lazy"
- class="inline-flex flex-col object-contain object-center w-16 h-16 my-4"
- :alt="$t('empty.authorization')"
- />
- <span class="pb-4 text-center">
- This SocketIO connection does not use any authentication.
- </span>
- <ButtonSecondary
- outline
- :label="$t('app.documentation')"
- to="https://docs.hoppscotch.io/features/authorization"
- blank
- svg="external-link"
- reverse
- class="mb-4"
- />
- </div>
- <div
- v-if="authType === 'Bearer'"
- class="flex flex-1 border-b border-dividerLight"
- >
- <div class="w-2/3 border-r border-dividerLight">
- <div class="flex flex-1 border-b border-dividerLight">
- <SmartEnvInput v-model="bearerToken" placeholder="Token" />
</div>
- </div>
- <div
- class="sticky h-full p-4 overflow-auto bg-primary top-upperTertiaryStickyFold min-w-46 max-w-1/3 z-9"
- >
- <div class="p-2">
- <div class="pb-2 text-secondaryLight">
- {{ $t("helpers.authorization") }}
- </div>
- <SmartAnchor
- class="link"
- :label="`${$t('authorization.learn')} \xA0 →`"
+ <div
+ v-if="authType === 'None'"
+ class="flex flex-col items-center justify-center p-4 text-secondaryLight"
+ >
+ <img
+ :src="`/images/states/${$colorMode.value}/login.svg`"
+ loading="lazy"
+ class="inline-flex flex-col object-contain object-center w-16 h-16 my-4"
+ :alt="`${t('empty.authorization')}`"
+ />
+ <span class="pb-4 text-center">
+ {{ t("socketio.connection_not_authorized") }}
+ </span>
+ <ButtonSecondary
+ outline
+ :label="t('app.documentation')"
to="https://docs.hoppscotch.io/features/authorization"
blank
+ svg="external-link"
+ reverse
+ class="mb-4"
/>
</div>
- </div>
- </div>
+ <div
+ v-if="authType === 'Bearer'"
+ class="flex flex-1 border-b border-dividerLight"
+ >
+ <div class="w-2/3 border-r border-dividerLight">
+ <div class="flex flex-1 border-b border-dividerLight">
+ <SmartEnvInput v-model="bearerToken" placeholder="Token" />
+ </div>
+ </div>
+ <div
+ class="sticky h-full p-4 overflow-auto bg-primary top-upperTertiaryStickyFold min-w-46 max-w-1/3 z-9"
+ >
+ <div class="p-2">
+ <div class="pb-2 text-secondaryLight">
+ {{ t("helpers.authorization") }}
+ </div>
+ <SmartAnchor
+ class="link"
+ :label="`${t('authorization.learn')} \xA0 →`"
+ to="https://docs.hoppscotch.io/features/authorization"
+ blank
+ />
+ </div>
+ </div>
+ </div>
+ </SmartTab>
+ </SmartTabs>
</template>
<template #secondary>
<RealtimeLog
- :title="$t('socketio.log')"
+ :title="t('socketio.log')"
:log="log"
@delete="clearLogEntries()"
/>
</template>
- <template #sidebar>
- <div class="flex items-center justify-between p-4">
- <label for="events" class="font-semibold text-secondaryLight">
- {{ $t("socketio.events") }}
- </label>
- </div>
- <div class="flex px-4">
- <input
- id="event_name"
- v-model="communication.eventName"
- class="input"
- name="event_name"
- :placeholder="$t('socketio.event_name')"
- type="text"
- autocomplete="off"
- :disabled="!connectionState"
- />
- </div>
- <div class="flex items-center justify-between p-4">
- <label class="font-semibold text-secondaryLight">
- {{ $t("socketio.communication") }}
- </label>
- <div class="flex">
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- :title="$t('add.new')"
- svg="plus"
- @click.native="addCommunicationInput"
- />
- </div>
- </div>
- <div class="flex flex-col px-4 pb-4 space-y-2">
- <div
- v-for="(input, index) of communication.inputs"
- :key="`input-${index}`"
- >
- <div class="flex space-x-2">
- <input
- v-model="communication.inputs[index]"
- class="input"
- name="message"
- :placeholder="$t('count.message', { count: index + 1 })"
- type="text"
- autocomplete="off"
- :disabled="!connectionState"
- @keyup.enter="connectionState ? sendMessage() : null"
- />
- <ButtonSecondary
- v-if="index + 1 !== communication.inputs.length"
- v-tippy="{ theme: 'tooltip' }"
- :title="$t('action.remove')"
- svg="trash"
- color="red"
- outline
- @click.native="removeCommunicationInput({ index })"
- />
- <ButtonPrimary
- v-if="index + 1 === communication.inputs.length"
- id="send"
- name="send"
- :disabled="!connectionState"
- :label="$t('action.send')"
- @click.native="sendMessage"
- />
- </div>
- </div>
- </div>
- </template>
</AppPaneLayout>
</template>
-<script>
-import { defineComponent, ref } from "@nuxtjs/composition-api"
-// All Socket.IO client version imports
-import ClientV2 from "socket.io-client-v2"
-import { io as ClientV3 } from "socket.io-client-v3"
-import { io as ClientV4 } from "socket.io-client-v4"
-import wildcard from "socketio-wildcard"
+<script setup lang="ts">
+import { onMounted, onUnmounted, ref, watch } from "@nuxtjs/composition-api"
import debounce from "lodash/debounce"
-import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
import {
- SIOEndpoint$,
+ SIOConnection,
+ SIOError,
+ SIOMessage,
+ SOCKET_CLIENTS,
+} from "~/helpers/realtime/SIOConnection"
+import {
+ useI18n,
+ useNuxt,
+ useReadonlyStream,
+ useStream,
+ useStreamSubscriber,
+ useToast,
+} from "~/helpers/utils/composables"
+import {
+ addSIOLogLine,
setSIOEndpoint,
- SIOVersion$,
- setSIOVersion,
- SIOPath$,
+ setSIOLog,
setSIOPath,
- SIOConnectionState$,
- SIOConnectingState$,
- setSIOConnectionState,
- setSIOConnectingState,
- SIOSocket$,
- setSIOSocket,
+ setSIOVersion,
+ SIOClientVersion,
+ SIOEndpoint$,
SIOLog$,
- setSIOLog,
- addSIOLogLine,
+ SIOPath$,
+ SIOVersion$,
} from "~/newstore/SocketIOSession"
-import { useStream } from "~/helpers/utils/composables"
-const socketIoClients = {
- v4: ClientV4,
- v3: ClientV3,
- v2: ClientV2,
+const t = useI18n()
+const toast = useToast()
+const nuxt = useNuxt()
+const { subscribeToStream } = useStreamSubscriber()
+
+type SIOTab = "communication" | "protocols"
+const selectedTab = ref<SIOTab>("communication")
+
+const SIOVersions = Object.keys(SOCKET_CLIENTS)
+const url = useStream(SIOEndpoint$, "", setSIOEndpoint)
+const clientVersion = useStream(SIOVersion$, "v4", setSIOVersion)
+const path = useStream(SIOPath$, "", setSIOPath)
+const socket = new SIOConnection()
+const connectionState = useReadonlyStream(
+ socket.connectionState$,
+ "DISCONNECTED"
+)
+const log = useStream(SIOLog$, [], setSIOLog)
+const authTypeOptions = ref<any>(null)
+const versionOptions = ref<any | null>(null)
+
+const isUrlValid = ref(true)
+const authType = ref<"None" | "Bearer">("None")
+const bearerToken = ref("")
+const authActive = ref(true)
+
+let worker: Worker
+
+const workerResponseHandler = ({
+ data,
+}: {
+ data: { url: string; result: boolean }
+}) => {
+ if (data.url === url.value) isUrlValid.value = data.result
}
-export default defineComponent({
- setup() {
- return {
- socketIoClients,
- url: useStream(SIOEndpoint$, "", setSIOEndpoint),
- clientVersion: useStream(SIOVersion$, "", setSIOVersion),
- path: useStream(SIOPath$, "", setSIOPath),
- connectingState: useStream(
- SIOConnectingState$,
- false,
- setSIOConnectingState
- ),
- connectionState: useStream(
- SIOConnectionState$,
- false,
- setSIOConnectionState
- ),
- io: useStream(SIOSocket$, null, setSIOSocket),
- log: useStream(SIOLog$, [], setSIOLog),
- authTypeOptions: ref(null),
- }
- },
- data() {
- return {
- isUrlValid: true,
- communication: {
- eventName: "",
- inputs: [""],
- },
- authType: "None",
- bearerToken: "",
- authActive: true,
- }
- },
- computed: {
- urlValid() {
- return this.isUrlValid
- },
- },
- watch: {
- url() {
- this.debouncer()
- },
- connectionState(connected) {
- if (connected) this.$refs.versionOptions.tippy().disable()
- else this.$refs.versionOptions.tippy().enable()
- },
- },
- created() {
- if (process.browser) {
- this.worker = this.$worker.createRejexWorker()
- this.worker.addEventListener("message", this.workerResponseHandler)
- }
- },
- destroyed() {
- this.worker.terminate()
- },
- methods: {
- debouncer: debounce(function () {
- this.worker.postMessage({ type: "socketio", url: this.url })
- }, 1000),
- workerResponseHandler({ data }) {
- if (data.url === this.url) this.isUrlValid = data.result
- },
- removeCommunicationInput({ index }) {
- this.$delete(this.communication.inputs, index)
- },
- addCommunicationInput() {
- this.communication.inputs.push("")
- },
- toggleConnection() {
- // If it is connecting:
- if (!this.connectionState) return this.connect()
- // Otherwise, it's disconnecting.
- else return this.disconnect()
- },
- connect() {
- this.connectingState = true
- this.log = [
- {
- payload: this.$t("state.connecting_to", { name: this.url }),
- source: "info",
- event: "connecting",
- ts: Date.now(),
- },
- ]
+const getMessagePayload = (data: SIOMessage): string =>
+ typeof data.value === "object" ? JSON.stringify(data.value) : `${data.value}`
- try {
- if (!this.path) {
- this.path = "/socket.io"
- }
- const Client = socketIoClients[this.clientVersion]
- if (this.authActive && this.authType === "Bearer") {
- this.io = new Client(this.url, {
- path: this.path,
- auth: {
- token: this.bearerToken,
- },
- })
- } else {
- this.io = new Client(this.url, { path: this.path })
- }
+const getErrorPayload = (error: SIOError): string => {
+ switch (error.type) {
+ case "CONNECTION":
+ return t("state.connection_error").toString()
+ case "RECONNECT_ERROR":
+ return t("state.reconnection_error").toString()
+ default:
+ return t("state.disconnected_from", { name: url.value }).toString()
+ }
+}
- // Add ability to listen to all events
- wildcard(Client.Manager)(this.io)
- this.io.on("connect", () => {
- this.connectingState = false
- this.connectionState = true
- this.log = [
- {
- payload: this.$t("state.connected_to", { name: this.url }),
- source: "info",
- event: "connected",
- ts: Date.now(),
- },
- ]
- this.$toast.success(this.$t("state.connected"))
- })
- this.io.on("*", ({ data }) => {
- const [eventName, message] = data
- addSIOLogLine({
- payload: `[${eventName}] ${message ? JSON.stringify(message) : ""}`,
- source: "server",
- ts: Date.now(),
- })
- })
- this.io.on("connect_error", (error) => {
- this.handleError(error)
- })
- this.io.on("reconnect_error", (error) => {
- this.handleError(error)
- })
- this.io.on("error", () => {
- this.handleError()
- })
- this.io.on("disconnect", () => {
- this.connectingState = false
- this.connectionState = false
- addSIOLogLine({
- payload: this.$t("state.disconnected_from", { name: this.url }),
- source: "disconnected",
- event: "disconnected",
- ts: Date.now(),
- })
- this.$toast.error(this.$t("state.disconnected"))
- })
- } catch (e) {
- this.handleError(e)
- this.$toast.error(this.$t("error.something_went_wrong"))
- }
+onMounted(() => {
+ worker = nuxt.value.$worker.createRejexWorker()
+ worker.addEventListener("message", workerResponseHandler)
+
+ subscribeToStream(socket.event$, (event) => {
+ switch (event?.type) {
+ case "CONNECTING":
+ log.value = [
+ {
+ payload: `${t("state.connecting_to", { name: url.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
+ ts: undefined,
+ },
+ ]
+ break
- logHoppRequestRunToAnalytics({
- platform: "socketio",
- })
- },
- disconnect() {
- this.io.close()
- },
- handleError(error) {
- this.disconnect()
- this.connectingState = false
- this.connectionState = false
- addSIOLogLine({
- payload: this.$t("error.something_went_wrong"),
- source: "info",
- event: "error",
- ts: Date.now(),
- })
- if (error !== null)
+ case "CONNECTED":
+ log.value = [
+ {
+ payload: `${t("state.connected_to", { name: url.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
+ ts: event.time,
+ },
+ ]
+ toast.success(`${t("state.connected")}`)
+ break
+
+ case "MESSAGE_SENT":
addSIOLogLine({
- payload: error,
- source: "info",
- event: "error",
- ts: Date.now(),
+ prefix: `[${event.message.eventName}]`,
+ payload: getMessagePayload(event.message),
+ source: "client",
+ ts: event.time,
})
- },
- sendMessage() {
- const eventName = this.communication.eventName
- const messages = (this.communication.inputs || [])
- .map((input) => {
- try {
- return JSON.parse(input)
- } catch (e) {
- return input
- }
+ break
+
+ case "MESSAGE_RECEIVED":
+ addSIOLogLine({
+ prefix: `[${event.message.eventName}]`,
+ payload: getMessagePayload(event.message),
+ source: "server",
+ ts: event.time,
})
- .filter((message) => !!message)
+ break
- if (this.io) {
- this.io.emit(eventName, ...messages, (data) => {
- // receive response from server
- addSIOLogLine({
- payload: `[${eventName}] ${JSON.stringify(data)}`,
- source: "server",
- ts: Date.now(),
- })
+ case "ERROR":
+ addSIOLogLine({
+ payload: getErrorPayload(event.error),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
})
+ break
+ case "DISCONNECTED":
addSIOLogLine({
- payload: `[${eventName}] ${JSON.stringify(messages)}`,
- source: "client",
- ts: Date.now(),
+ payload: t("state.disconnected_from", { name: url.value }).toString(),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
})
- this.communication.inputs = [""]
- }
- },
- onSelectVersion(version) {
- this.clientVersion = version
- this.$refs.versionOptions.tippy().hide()
- },
- clearLogEntries() {
- this.log = []
- },
- },
+ toast.error(`${t("state.disconnected")}`)
+ break
+ }
+ })
+})
+
+watch(url, (newUrl) => {
+ if (newUrl) debouncer()
+})
+
+watch(connectionState, (connected) => {
+ if (connected) versionOptions.value.tippy().disable()
+ else versionOptions.value.tippy().enable()
+})
+
+onUnmounted(() => {
+ worker.terminate()
})
+
+const debouncer = debounce(function () {
+ worker.postMessage({ type: "socketio", url: url.value })
+}, 1000)
+
+const toggleConnection = () => {
+ // If it is connecting:
+ if (connectionState.value === "DISCONNECTED") {
+ return socket.connect({
+ url: url.value,
+ path: path.value || "/socket.io",
+ clientVersion: clientVersion.value,
+ auth: authActive.value
+ ? {
+ type: authType.value,
+ token: bearerToken.value,
+ }
+ : undefined,
+ })
+ }
+ // Otherwise, it's disconnecting.
+ socket.disconnect()
+}
+const sendMessage = (event: { message: string; eventName: string }) => {
+ socket.sendMessage(event)
+}
+const onSelectVersion = (version: SIOClientVersion) => {
+ clientVersion.value = version
+ versionOptions.value.tippy().hide()
+}
+const clearLogEntries = () => {
+ log.value = []
+}
</script>
diff --git a/packages/hoppscotch-app/components/realtime/Sse.vue b/packages/hoppscotch-app/components/realtime/Sse.vue
index ac5ca388c..d9b4a7136 100644
--- a/packages/hoppscotch-app/components/realtime/Sse.vue
+++ b/packages/hoppscotch-app/components/realtime/Sse.vue
@@ -11,11 +11,13 @@
v-model="server"
type="url"
autocomplete="off"
- :class="{ error: !serverValid }"
+ :class="{ error: !isUrlValid }"
class="flex flex-1 w-full px-4 py-2 border rounded-l bg-primaryLight border-divider text-secondaryDark"
:placeholder="$t('sse.url')"
- :disabled="connectionSSEState"
- @keyup.enter="serverValid ? toggleSSEConnection() : null"
+ :disabled="
+ connectionState === 'STARTED' || connectionState === 'STARTING'
+ "
+ @keyup.enter="isUrlValid ? toggleSSEConnection() : null"
/>
<label
for="event-type"
@@ -28,19 +30,23 @@
v-model="eventType"
class="flex flex-1 w-full px-4 py-2 border rounded-r bg-primaryLight border-divider text-secondaryDark"
spellcheck="false"
- :disabled="connectionSSEState"
- @keyup.enter="serverValid ? toggleSSEConnection() : null"
+ :disabled="
+ connectionState === 'STARTED' || connectionState === 'STARTING'
+ "
+ @keyup.enter="isUrlValid ? toggleSSEConnection() : null"
/>
</div>
<ButtonPrimary
id="start"
- :disabled="!serverValid"
+ :disabled="!isUrlValid"
name="start"
class="w-32"
:label="
- !connectionSSEState ? $t('action.start') : $t('action.stop')
+ connectionState === 'STOPPED'
+ ? t('action.start')
+ : t('action.stop')
"
- :loading="connectingState"
+ :loading="connectionState === 'STARTING'"
@click.native="toggleSSEConnection"
/>
</div>
@@ -56,11 +62,10 @@
</AppPaneLayout>
</template>
-<script>
-import { defineComponent } from "@nuxtjs/composition-api"
+<script setup lang="ts">
+import { ref, watch, onUnmounted, onMounted } from "@nuxtjs/composition-api"
import "splitpanes/dist/splitpanes.css"
import debounce from "lodash/debounce"
-import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
import {
SSEEndpoint$,
setSSEEndpoint,
@@ -68,163 +73,127 @@ import {
setSSEEventType,
SSESocket$,
setSSESocket,
- SSEConnectingState$,
- SSEConnectionState$,
- setSSEConnectionState,
- setSSEConnectingState,
SSELog$,
setSSELog,
addSSELogLine,
} from "~/newstore/SSESession"
-import { useStream } from "~/helpers/utils/composables"
-
-export default defineComponent({
- setup() {
- return {
- connectionSSEState: useStream(
- SSEConnectionState$,
- false,
- setSSEConnectionState
- ),
- connectingState: useStream(
- SSEConnectingState$,
- false,
- setSSEConnectingState
- ),
- server: useStream(SSEEndpoint$, "", setSSEEndpoint),
- eventType: useStream(SSEEventType$, "", setSSEEventType),
- sse: useStream(SSESocket$, null, setSSESocket),
- log: useStream(SSELog$, [], setSSELog),
- }
- },
- data() {
- return {
- isUrlValid: true,
- }
- },
- computed: {
- serverValid() {
- return this.isUrlValid
- },
- },
- watch: {
- server() {
- this.debouncer()
- },
- },
- created() {
- if (process.browser) {
- this.worker = this.$worker.createRejexWorker()
- this.worker.addEventListener("message", this.workerResponseHandler)
- }
- },
- destroyed() {
- this.worker.terminate()
- },
- methods: {
- debouncer: debounce(function () {
- this.worker.postMessage({ type: "sse", url: this.server })
- }, 1000),
- workerResponseHandler({ data }) {
- if (data.url === this.url) this.isUrlValid = data.result
- },
- toggleSSEConnection() {
- // If it is connecting:
- if (!this.connectionSSEState) return this.start()
- // Otherwise, it's disconnecting.
- else return this.stop()
- },
- start() {
- this.connectingState = true
- this.log = [
- {
- payload: this.$t("state.connecting_to", { name: this.server }),
- source: "info",
- event: "connecting",
- ts: Date.now(),
- },
- ]
- if (typeof EventSource !== "undefined") {
- try {
- this.sse = new EventSource(this.server)
- this.sse.onopen = () => {
- this.connectingState = false
- this.connectionSSEState = true
- this.log = [
- {
- payload: this.$t("state.connected_to", { name: this.server }),
- source: "info",
- event: "connected",
- ts: Date.now(),
- },
- ]
- this.$toast.success(this.$t("state.connected"))
- }
- this.sse.onerror = () => {
- this.handleSSEError()
- }
- this.sse.onclose = () => {
- this.connectionSSEState = false
- addSSELogLine({
- payload: this.$t("state.disconnected_from", {
- name: this.server,
- }),
- source: "disconnected",
- event: "disconnected",
- ts: Date.now(),
- })
- this.$toast.error(this.$t("state.disconnected"))
- }
- this.sse.addEventListener(this.eventType, ({ data }) => {
- addSSELogLine({
- payload: data,
- source: "server",
- ts: Date.now(),
- })
- })
- } catch (e) {
- this.handleSSEError(e)
- this.$toast.error(this.$t("error.something_went_wrong"))
- }
- } else {
- this.log = [
+import {
+ useNuxt,
+ useStream,
+ useToast,
+ useI18n,
+ useStreamSubscriber,
+ useReadonlyStream,
+} from "~/helpers/utils/composables"
+import { SSEConnection } from "~/helpers/realtime/SSEConnection"
+
+const t = useI18n()
+const nuxt = useNuxt()
+const toast = useToast()
+const { subscribeToStream } = useStreamSubscriber()
+
+const sse = useStream(SSESocket$, new SSEConnection(), setSSESocket)
+const connectionState = useReadonlyStream(sse.value.connectionState$, "STOPPED")
+const server = useStream(SSEEndpoint$, "", setSSEEndpoint)
+const eventType = useStream(SSEEventType$, "", setSSEEventType)
+const log = useStream(SSELog$, [], setSSELog)
+
+const isUrlValid = ref(true)
+
+let worker: Worker
+
+const debouncer = debounce(function () {
+ worker.postMessage({ type: "sse", url: server.value })
+}, 1000)
+
+watch(server, (url) => {
+ if (url) debouncer()
+})
+
+const workerResponseHandler = ({
+ data,
+}: {
+ data: { url: string; result: boolean }
+}) => {
+ if (data.url === server.value) isUrlValid.value = data.result
+}
+
+onMounted(() => {
+ worker = nuxt.value.$worker.createRejexWorker()
+ worker.addEventListener("message", workerResponseHandler)
+
+ subscribeToStream(sse.value.event$, (event) => {
+ switch (event?.type) {
+ case "STARTING":
+ log.value = [
{
- payload: this.$t("error.browser_support_sse"),
- source: "disconnected",
- event: "error",
+ payload: `${t("state.connecting_to", { name: server.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
+ ts: undefined,
+ },
+ ]
+ break
+
+ case "STARTED":
+ log.value = [
+ {
+ payload: `${t("state.connected_to", { name: server.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
ts: Date.now(),
},
]
- }
-
- logHoppRequestRunToAnalytics({
- platform: "sse",
- })
- },
- handleSSEError(error) {
- this.stop()
- this.connectionSSEState = false
- addSSELogLine({
- payload: this.$t("error.something_went_wrong"),
- source: "disconnected",
- event: "error",
- ts: Date.now(),
- })
- if (error !== null)
+ toast.success(`${t("state.connected")}`)
+ break
+
+ case "MESSAGE_RECEIVED":
+ addSSELogLine({
+ payload: event.message,
+ source: "server",
+ ts: event.time,
+ })
+ break
+
+ case "ERROR":
+ addSSELogLine({
+ payload: t("error.browser_support_sse").toString(),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
+ })
+ break
+
+ case "STOPPED":
addSSELogLine({
- payload: error,
- source: "disconnected",
- event: "error",
- ts: Date.now(),
+ payload: t("state.disconnected_from", {
+ name: server.value,
+ }).toString(),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
})
- },
- stop() {
- this.sse.close()
- this.sse.onclose()
- },
- clearLogEntries() {
- this.log = []
- },
- },
+ toast.error(`${t("state.disconnected")}`)
+ break
+ }
+ })
+})
+
+// METHODS
+
+const toggleSSEConnection = () => {
+ // If it is connecting:
+ if (connectionState.value === "STOPPED") {
+ return sse.value.start(server.value, eventType.value)
+ }
+ // Otherwise, it's disconnecting.
+ sse.value.stop()
+}
+
+onUnmounted(() => {
+ worker.terminate()
})
+const clearLogEntries = () => {
+ log.value = []
+}
</script>
diff --git a/packages/hoppscotch-app/components/realtime/Websocket.vue b/packages/hoppscotch-app/components/realtime/Websocket.vue
index 9ac8705a8..ecf21fe4f 100644
--- a/packages/hoppscotch-app/components/realtime/Websocket.vue
+++ b/packages/hoppscotch-app/components/realtime/Websocket.vue
@@ -12,133 +12,156 @@
type="url"
autocomplete="off"
spellcheck="false"
- :class="{ error: !urlValid }"
- :placeholder="$t('websocket.url')"
- :disabled="connectionState"
- @keyup.enter="urlValid ? toggleConnection() : null"
+ :class="{ error: !isUrlValid }"
+ :placeholder="`${t('websocket.url')}`"
+ :disabled="
+ connectionState === 'CONNECTED' ||
+ connectionState === 'CONNECTING'
+ "
+ @keyup.enter="isUrlValid ? toggleConnection() : null"
/>
<ButtonPrimary
id="connect"
- :disabled="!urlValid"
+ :disabled="!isUrlValid"
class="w-32"
name="connect"
:label="
- !connectionState ? $t('action.connect') : $t('action.disconnect')
+ connectionState === 'DISCONNECTED'
+ ? t('action.connect')
+ : t('action.disconnect')
"
- :loading="connectingState"
+ :loading="connectionState === 'CONNECTING'"
@click.native="toggleConnection"
/>
</div>
</div>
- <div
- class="sticky z-10 flex items-center justify-between pl-4 border-b bg-primary border-dividerLight top-upperPrimaryStickyFold"
- >
- <label class="font-semibold text-secondaryLight">
- {{ $t("websocket.protocols") }}
- </label>
- <div class="flex">
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- :title="$t('action.clear_all')"
- svg="trash-2"
- @click.native="clearContent"
- />
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- :title="$t('add.new')"
- svg="plus"
- @click.native="addProtocol"
- />
- </div>
- </div>
- <draggable
- v-model="protocols"
- animation="250"
- handle=".draggable-handle"
- draggable=".draggable-content"
- ghost-class="cursor-move"
- chosen-class="bg-primaryLight"
- drag-class="cursor-grabbing"
+ <SmartTabs
+ v-model="selectedTab"
+ styles="sticky bg-primary top-upperMobilePrimaryStickyFold sm:top-upperPrimaryStickyFold z-10"
>
- <div
- v-for="(protocol, index) of protocols"
- :key="`protocol-${index}`"
- class="flex border-b divide-x divide-dividerLight border-dividerLight draggable-content group"
+ <SmartTab
+ :id="'communication'"
+ :label="`${$t('websocket.communication')}`"
>
- <span>
- <ButtonSecondary
- svg="grip-vertical"
- class="cursor-auto text-primary hover:text-primary"
- :class="{
- 'draggable-handle group-hover:text-secondaryLight !cursor-grab':
- index !== protocols?.length - 1,
- }"
- tabindex="-1"
- />
- </span>
- <input
- v-model="protocol.value"
- class="flex flex-1 px-4 py-2 bg-transparent"
- :placeholder="$t('count.protocol', { count: index + 1 })"
- name="message"
- type="text"
- autocomplete="off"
- @change="
- updateProtocol(index, {
- value: $event.target.value,
- active: protocol.active,
- })
- "
- />
- <span>
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- :title="
- protocol.hasOwnProperty('active')
- ? protocol.active
- ? $t('action.turn_off')
- : $t('action.turn_on')
- : $t('action.turn_off')
- "
- :svg="
- protocol.hasOwnProperty('active')
- ? protocol.active
- ? 'check-circle'
- : 'circle'
- : 'check-circle'
- "
- color="green"
- @click.native="
- updateProtocol(index, {
- value: protocol.value,
- active: !protocol.active,
- })
- "
+ <RealtimeCommunication
+ :is-connected="connectionState === 'CONNECTED'"
+ @send-message="sendMessage($event)"
+ ></RealtimeCommunication>
+ </SmartTab>
+ <SmartTab :id="'protocols'" :label="`${$t('websocket.protocols')}`">
+ <div
+ class="sticky z-10 flex items-center justify-between pl-4 border-b bg-primary border-dividerLight top-upperPrimaryStickyFold"
+ >
+ <label class="font-semibold text-secondaryLight">
+ {{ t("websocket.protocols") }}
+ </label>
+ <div class="flex">
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('action.clear_all')"
+ svg="trash-2"
+ @click.native="clearContent"
+ />
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('add.new')"
+ svg="plus"
+ @click.native="addProtocol"
+ />
+ </div>
+ </div>
+ <draggable
+ v-model="protocols"
+ animation="250"
+ handle=".draggable-handle"
+ draggable=".draggable-content"
+ ghost-class="cursor-move"
+ chosen-class="bg-primaryLight"
+ drag-class="cursor-grabbing"
+ >
+ <div
+ v-for="(protocol, index) of protocols"
+ :key="`protocol-${index}`"
+ class="flex border-b divide-x divide-dividerLight border-dividerLight draggable-content group"
+ >
+ <span>
+ <ButtonSecondary
+ svg="grip-vertical"
+ class="cursor-auto text-primary hover:text-primary"
+ :class="{
+ 'draggable-handle group-hover:text-secondaryLight !cursor-grab':
+ index !== protocols?.length - 1,
+ }"
+ tabindex="-1"
+ />
+ </span>
+ <input
+ v-model="protocol.value"
+ class="flex flex-1 px-4 py-2 bg-transparent"
+ :placeholder="`${t('count.protocol', { count: index + 1 })}`"
+ name="message"
+ type="text"
+ autocomplete="off"
+ @change="
+ updateProtocol(index, {
+ value: $event.target.value,
+ active: protocol.active,
+ })
+ "
+ />
+ <span>
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="
+ protocol.hasOwnProperty('active')
+ ? protocol.active
+ ? t('action.turn_off')
+ : t('action.turn_on')
+ : t('action.turn_off')
+ "
+ :svg="
+ protocol.hasOwnProperty('active')
+ ? protocol.active
+ ? 'check-circle'
+ : 'circle'
+ : 'check-circle'
+ "
+ color="green"
+ @click.native="
+ updateProtocol(index, {
+ value: protocol.value,
+ active: !protocol.active,
+ })
+ "
+ />
+ </span>
+ <span>
+ <ButtonSecondary
+ v-tippy="{ theme: 'tooltip' }"
+ :title="t('action.remove')"
+ svg="trash"
+ color="red"
+ @click.native="deleteProtocol(index)"
+ />
+ </span>
+ </div>
+ </draggable>
+ <div
+ v-if="protocols.length === 0"
+ class="flex flex-col items-center justify-center p-4 text-secondaryLight"
+ >
+ <img
+ :src="`/images/states/${$colorMode.value}/add_category.svg`"
+ loading="lazy"
+ class="inline-flex flex-col object-contain object-center w-16 h-16 my-4"
+ :alt="`${t('empty.protocols')}`"
/>
- </span>
- <span>
- <ButtonSecondary
- v-tippy="{ theme: 'tooltip' }"
- :title="$t('action.remove')"
- svg="trash"
- color="red"
- @click.native="deleteProtocol({ index })"
- />
- </span>
- </div>
- </draggable>
- <div
- v-if="protocols.length === 0"
- class="flex flex-col items-center justify-center p-4 text-secondaryLight"
- >
- <img
- :src="`/images/states/${$colorMode.value}/add_category.svg`"
- loading="lazy"
- class="inline-flex flex-col object-contain object-center w-16 h-16 my-4"
- :alt="$t('empty.protocols')"
- />
- <span class="mb-4 text-center">{{ $t("empty.protocols") }}</span>
- </div>
+ <span class="mb-4 text-center">
+ {{ t("empty.protocols") }}
+ </span>
+ </div>
+ </SmartTab>
+ </SmartTabs>
</template>
<template #secondary>
<RealtimeLog
@@ -147,45 +170,12 @@
@delete="clearLogEntries()"
/>
</template>
- <template #sidebar>
- <div class="flex items-center justify-between p-4">
- <label
- for="websocket-message"
- class="font-semibold text-secondaryLight"
- >{{ $t("websocket.communication") }}</label
- >
- </div>
- <div class="flex px-4 space-x-2">
- <input
- id="websocket-message"
- v-model="communication.input"
- name="message"
- type="text"
- autocomplete="off"
- :disabled="!connectionState"
- :placeholder="$t('websocket.message')"
- class="input"
- @keyup.enter="connectionState ? sendMessage() : null"
- @keyup.up="connectionState ? walkHistory('up') : null"
- @keyup.down="connectionState ? walkHistory('down') : null"
- />
- <ButtonPrimary
- id="send"
- name="send"
- :disabled="!connectionState"
- :label="$t('action.send')"
- @click.native="sendMessage"
- />
- </div>
- </template>
</AppPaneLayout>
</template>
-
-<script>
-import { defineComponent } from "@nuxtjs/composition-api"
+<script setup lang="ts">
+import { ref, watch, onUnmounted, onMounted } from "@nuxtjs/composition-api"
import debounce from "lodash/debounce"
import draggable from "vuedraggable"
-import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"
import {
setWSEndpoint,
WSEndpoint$,
@@ -195,244 +185,185 @@ import {
deleteWSProtocol,
updateWSProtocol,
deleteAllWSProtocols,
- WSSocket$,
- setWSSocket,
- setWSConnectionState,
- setWSConnectingState,
- WSConnectionState$,
- WSConnectingState$,
addWSLogLine,
WSLog$,
setWSLog,
+ HoppWSProtocol,
+ setWSSocket,
+ WSSocket$,
} from "~/newstore/WebSocketSession"
-import { useStream } from "~/helpers/utils/composables"
+import {
+ useI18n,
+ useStream,
+ useToast,
+ useNuxt,
+ useStreamSubscriber,
+ useReadonlyStream,
+} from "~/helpers/utils/composables"
+import { WSConnection, WSErrorMessage } from "~/helpers/realtime/WSConnection"
-export default defineComponent({
- components: {
- draggable,
- },
- setup() {
- return {
- url: useStream(WSEndpoint$, "", setWSEndpoint),
- protocols: useStream(WSProtocols$, [], setWSProtocols),
- connectionState: useStream(
- WSConnectionState$,
- false,
- setWSConnectionState
- ),
- connectingState: useStream(
- WSConnectingState$,
- false,
- setWSConnectingState
- ),
- socket: useStream(WSSocket$, null, setWSSocket),
- log: useStream(WSLog$, [], setWSLog),
- }
- },
- data() {
- return {
- isUrlValid: true,
- communication: {
- input: "",
- },
- currentIndex: -1, // index of the message log array to put in input box
- activeProtocols: [],
- }
- },
- computed: {
- urlValid() {
- return this.isUrlValid
- },
- },
- watch: {
- url() {
- this.debouncer()
- },
- protocols: {
- handler(newVal) {
- this.activeProtocols = newVal
- .filter((item) =>
- Object.prototype.hasOwnProperty.call(item, "active")
- ? item.active === true
- : true
- )
- .map(({ value }) => value)
- },
- deep: true,
- },
- },
- created() {
- if (process.browser) {
- this.worker = this.$worker.createRejexWorker()
- this.worker.addEventListener("message", this.workerResponseHandler)
- }
- },
- destroyed() {
- this.worker.terminate()
+const nuxt = useNuxt()
+const t = useI18n()
+const toast = useToast()
+const { subscribeToStream } = useStreamSubscriber()
+
+const selectedTab = ref<"communication" | "protocols">("communication")
+const url = useStream(WSEndpoint$, "", setWSEndpoint)
+const protocols = useStream(WSProtocols$, [], setWSProtocols)
+
+const socket = useStream(WSSocket$, new WSConnection(), setWSSocket)
+
+const connectionState = useReadonlyStream(
+ socket.value.connectionState$,
+ "DISCONNECTED"
+)
+
+const log = useStream(WSLog$, [], setWSLog)
+// DATA
+const isUrlValid = ref(true)
+const activeProtocols = ref<string[]>([])
+let worker: Worker
+watch(url, (newUrl) => {
+ if (newUrl) debouncer()
+})
+watch(
+ protocols,
+ (newProtocols) => {
+ activeProtocols.value = newProtocols
+ .filter((item) =>
+ Object.prototype.hasOwnProperty.call(item, "active")
+ ? item.active === true
+ : true
+ )
+ .map(({ value }) => value)
},
- methods: {
- clearContent() {
- deleteAllWSProtocols()
- },
- debouncer: debounce(function () {
- this.worker.postMessage({ type: "ws", url: this.url })
- }, 1000),
- workerResponseHandler({ data }) {
- if (data.url === this.url) this.isUrlValid = data.result
- },
- toggleConnection() {
- // If it is connecting:
- if (!this.connectionState) return this.connect()
- // Otherwise, it's disconnecting.
- else return this.disconnect()
- },
- clearLogEntries() {
- this.log = []
- },
- connect() {
- this.log = [
- {
- payload: this.$t("state.connecting_to", { name: this.url }),
- source: "info",
- event: "connecting",
- ts: Date.now(),
- },
- ]
- try {
- this.connectingState = true
- this.socket = new WebSocket(this.url, this.activeProtocols)
- this.socket.onopen = () => {
- this.connectingState = false
- this.connectionState = true
- this.log = [
- {
- payload: this.$t("state.connected_to", { name: this.url }),
- source: "info",
- event: "connected",
- ts: Date.now(),
- },
- ]
- this.$toast.success(this.$t("state.connected"))
- }
- this.socket.onerror = () => {
- this.handleError()
- }
- this.socket.onclose = () => {
- this.connectionState = false
- addWSLogLine({
- payload: this.$t("state.disconnected_from", { name: this.url }),
- source: "disconnected",
- event: "disconnected",
- ts: Date.now(),
- })
- this.$toast.error(this.$t("state.disconnected"))
- }
- this.socket.onmessage = ({ data }) => {
- addWSLogLine({
- payload: data,
- source: "server",
+ { deep: true }
+)
+const workerResponseHandler = ({
+ data,
+}: {
+ data: { url: string; result: boolean }
+}) => {
+ if (data.url === url.value) isUrlValid.value = data.result
+}
+
+const getErrorPayload = (error: WSErrorMessage): string => {
+ if (error instanceof SyntaxError) {
+ return error.message
+ }
+ return t("error.something_went_wrong").toString()
+}
+
+onMounted(() => {
+ worker = nuxt.value.$worker.createRejexWorker()
+ worker.addEventListener("message", workerResponseHandler)
+
+ subscribeToStream(socket.value.event$, (event) => {
+ switch (event?.type) {
+ case "CONNECTING":
+ log.value = [
+ {
+ payload: `${t("state.connecting_to", { name: url.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
+ ts: undefined,
+ },
+ ]
+ break
+
+ case "CONNECTED":
+ log.value = [
+ {
+ payload: `${t("state.connected_to", { name: url.value })}`,
+ source: "info",
+ color: "var(--accent-color)",
ts: Date.now(),
- })
- }
- } catch (e) {
- this.handleError(e)
- this.$toast.error(this.$t("error.something_went_wrong"))
- }
+ },
+ ]
+ toast.success(`${t("state.connected")}`)
+ break
- logHoppRequestRunToAnalytics({
- platform: "wss",
- })
- },
- disconnect() {
- if (this.socket) {
- this.socket.close()
- this.connectionState = false
- this.connectingState = false
- }
- },
- handleError(error) {
- this.disconnect()
- this.connectionState = false
- addWSLogLine({
- payload: this.$t("error.something_went_wrong"),
- source: "info",
- event: "error",
- ts: Date.now(),
- })
- if (error !== null)
+ case "MESSAGE_SENT":
addWSLogLine({
- payload: error,
- source: "info",
- event: "error",
+ payload: event.message,
+ source: "client",
ts: Date.now(),
})
- },
- sendMessage() {
- const message = this.communication.input
- this.socket.send(message)
- addWSLogLine({
- payload: message,
- source: "client",
- ts: Date.now(),
- })
- this.communication.input = ""
- },
- walkHistory(direction) {
- const clientMessages = this.log.filter(
- ({ source }) => source === "client"
- )
- const length = clientMessages.length
- switch (direction) {
- case "up":
- if (length > 0 && this.currentIndex !== 0) {
- // does nothing if message log is empty or the currentIndex is 0 when up arrow is pressed
- if (this.currentIndex === -1) {
- this.currentIndex = length - 1
- this.communication.input =
- clientMessages[this.currentIndex].payload
- } else if (this.currentIndex === 0) {
- this.communication.input = clientMessages[0].payload
- } else if (this.currentIndex > 0) {
- this.currentIndex = this.currentIndex - 1
- this.communication.input =
- clientMessages[this.currentIndex].payload
- }
- }
- break
- case "down":
- if (length > 0 && this.currentIndex > -1) {
- if (this.currentIndex === length - 1) {
- this.currentIndex = -1
- this.communication.input = ""
- } else if (this.currentIndex < length - 1) {
- this.currentIndex = this.currentIndex + 1
- this.communication.input =
- clientMessages[this.currentIndex].payload
- }
- }
- break
- }
- },
- addProtocol() {
- addWSProtocol({ value: "", active: true })
- },
- deleteProtocol({ index }) {
- const oldProtocols = this.protocols.slice()
- deleteWSProtocol(index)
- this.$toast.success(this.$t("state.deleted"), {
- action: {
- text: this.$t("action.undo"),
- duration: 4000,
- onClick: (_, toastObject) => {
- this.protocols = oldProtocols
- toastObject.remove()
- },
- },
- })
- },
- updateProtocol(index, updated) {
- updateWSProtocol(index, updated)
- },
- },
+ break
+
+ case "MESSAGE_RECEIVED":
+ addWSLogLine({
+ payload: event.message,
+ source: "server",
+ ts: event.time,
+ })
+ break
+
+ case "ERROR":
+ addWSLogLine({
+ payload: getErrorPayload(event.error),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
+ })
+ break
+
+ case "DISCONNECTED":
+ addWSLogLine({
+ payload: t("state.disconnected_from", { name: url.value }).toString(),
+ source: "info",
+ color: "#ff5555",
+ ts: event.time,
+ })
+ toast.error(`${t("state.disconnected")}`)
+ break
+ }
+ })
})
+
+onUnmounted(() => {
+ if (worker) worker.terminate()
+})
+const clearContent = () => {
+ deleteAllWSProtocols()
+}
+const debouncer = debounce(function () {
+ worker.postMessage({ type: "ws", url: url.value })
+}, 1000)
+
+const toggleConnection = () => {
+ // If it is connecting:
+ if (connectionState.value === "DISCONNECTED") {
+ return socket.value.connect(url.value, activeProtocols.value)
+ }
+ // Otherwise, it's disconnecting.
+ socket.value.disconnect()
+}
+
+const sendMessage = (event: { message: string; eventName: string }) => {
+ socket.value.sendMessage(event)
+}
+const addProtocol = () => {
+ addWSProtocol({ value: "", active: true })
+}
+const deleteProtocol = (index: number) => {
+ const oldProtocols = protocols.value.slice()
+ deleteWSProtocol(index)
+ toast.success(`${t("state.deleted")}`, {
+ duration: 4000,
+ action: {
+ text: `${t("action.undo")}`,
+ onClick: (_, toastObject) => {
+ protocols.value = oldProtocols
+ toastObject.goAway()
+ },
+ },
+ })
+}
+const updateProtocol = (index: number, updated: HoppWSProtocol) => {
+ updateWSProtocol(index, updated)
+}
+const clearLogEntries = () => {
+ log.value = []
+}
</script>
diff --git a/packages/hoppscotch-app/helpers/editor/codemirror.ts b/packages/hoppscotch-app/helpers/editor/codemirror.ts
index fd7b25c1d..7e6ed56f8 100644
--- a/packages/hoppscotch-app/helpers/editor/codemirror.ts
+++ b/packages/hoppscotch-app/helpers/editor/codemirror.ts
@@ -28,8 +28,6 @@ import { javascriptLanguage } from "@codemirror/lang-javascript"
import { xmlLanguage } from "@codemirror/lang-xml"
import { jsonLanguage } from "@codemirror/lang-json"
import { GQLLanguage } from "@hoppscotch/codemirror-lang-graphql"
-import { pipe } from "fp-ts/function"
-import * as O from "fp-ts/Option"
import { StreamLanguage } from "@codemirror/stream-parser"
import { html } from "@codemirror/legacy-modes/mode/xml"
import { shell } from "@codemirror/legacy-modes/mode/shell"
@@ -96,8 +94,10 @@ const hoppCompleterExt = (completer: Completer): Extension => {
})
}
-const hoppLinterExt = (hoppLinter: LinterDefinition): Extension => {
+const hoppLinterExt = (hoppLinter: LinterDefinition | undefined): Extension => {
return linter(async (view) => {
+ if (!hoppLinter) return []
+
// Requires full document scan, hence expensive on big files, force disable on big files ?
const linterResult = await hoppLinter(
view.state.doc.toJSON().join(view.state.lineBreak)
@@ -119,16 +119,16 @@ const hoppLinterExt = (hoppLinter: LinterDefinition): Extension => {
}
const hoppLang = (
- language: Language,
+ language: Language | undefined,
linter?: LinterDefinition | undefined,
completer?: Completer | undefined
-) => {
+): Extension | LanguageSupport => {
const exts: Extension[] = []
- if (linter) exts.push(hoppLinterExt(linter))
+ exts.push(hoppLinterExt(linter))
if (completer) exts.push(hoppCompleterExt(completer))
- return new LanguageSupport(language, exts)
+ return language ? new LanguageSupport(language, exts) : exts
}
const getLanguage = (langMime: string): Language | null => {
@@ -156,12 +156,7 @@ const getEditorLanguage = (
langMime: string,
linter: LinterDefinition | undefined,
completer: Completer | undefined
-): Extension =>
- pipe(
- O.fromNullable(getLanguage(langMime)),
- O.map((lang) => hoppLang(lang, linter, completer)),
- O.getOrElseW(() => [])
- )
+): Extension => hoppLang(getLanguage(langMime) ?? undefined, linter, completer)
export function useCodemirror(
el: Ref<any | null>,
diff --git a/packages/hoppscotch-app/helpers/realtime/MQTTConnection.ts b/packages/hoppscotch-app/helpers/realtime/MQTTConnection.ts
new file mode 100644
index 000000000..978663d57
--- /dev/null
+++ b/packages/hoppscotch-app/helpers/realtime/MQTTConnection.ts
@@ -0,0 +1,223 @@
+import Paho, { ConnectionOptions } from "paho-mqtt"
+import { BehaviorSubject, Subject } from "rxjs"
+import { logHoppRequestRunToAnalytics } from "../fb/analytics"
+
+export type MQTTMessage = { topic: string; message: string }
+export type MQTTError =
+ | { type: "CONNECTION_NOT_ESTABLISHED"; value: unknown }
+ | { type: "CONNECTION_LOST" }
+ | { type: "CONNECTION_FAILED" }
+ | { type: "SUBSCRIPTION_FAILED"; topic: string }
+ | { type: "PUBLISH_ERROR"; topic: string; message: string }
+
+export type MQTTEvent = { time: number } & (
+ | { type: "CONNECTING" }
+ | { type: "CONNECTED" }
+ | { type: "MESSAGE_SENT"; message: MQTTMessage }
+ | { type: "SUBSCRIBED"; topic: string }
+ | { type: "SUBSCRIPTION_FAILED"; topic: string }
+ | { type: "MESSAGE_RECEIVED"; message: MQTTMessage }
+ | { type: "DISCONNECTED"; manual: boolean }
+ | { type: "ERROR"; error: MQTTError }
+)
+
+export type ConnectionState = "CONNECTING" | "CONNECTED" | "DISCONNECTED"
+
+export class MQTTConnection {
+ subscriptionState$ = new BehaviorSubject<boolean>(false)
+ connectionState$ = new BehaviorSubject<ConnectionState>("DISCONNECTED")
+ event$: Subject<MQTTEvent> = new Subject()
+
+ private mqttClient: Paho.Client | undefined
+ private manualDisconnect = false
+
+ private addEvent(event: MQTTEvent) {
+ this.event$.next(event)
+ }
+
+ connect(url: string, username: string, password: string) {
+ try {
+ this.connectionState$.next("CONNECTING")
+
+ this.addEvent({
+ time: Date.now(),
+ type: "CONNECTING",
+ })
+
+ const parseUrl = new URL(url)
+ const { hostname, pathname, port } = parseUrl
+ this.mqttClient = new Paho.Client(
+ `${hostname + (pathname !== "/" ? pathname : "")}`,
+ port !== "" ? Number(port) : 8081,
+ "hoppscotch"
+ )
+ const connectOptions: ConnectionOptions = {
+ onSuccess: this.onConnectionSuccess.bind(this),
+ onFailure: this.onConnectionFailure.bind(this),
+ useSSL: parseUrl.protocol !== "ws:",
+ }
+ if (username !== "") {
+ connectOptions.userName = username
+ }
+ if (password !== "") {
+ connectOptions.password = password
+ }
+ this.mqttClient.connect(connectOptions)
+ this.mqttClient.onConnectionLost = this.onConnectionLost.bind(this)
+ this.mqttClient.onMessageArrived = this.onMessageArrived.bind(this)
+ } catch (e) {
+ this.handleError(e)
+ }
+
+ logHoppRequestRunToAnalytics({
+ platform: "mqtt",
+ })
+ }
+
+ onConnectionFailure() {
+ this.connectionState$.next("DISCONNECTED")
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type: "CONNECTION_FAILED",
+ },
+ })
+ }
+
+ onConnectionSuccess() {
+ this.connectionState$.next("CONNECTED")
+ this.addEvent({
+ type: "CONNECTED",
+ time: Date.now(),
+ })
+ }
+
+ onConnectionLost() {
+ this.connectionState$.next("DISCONNECTED")
+ if (this.manualDisconnect) {
+ this.addEvent({
+ time: Date.now(),
+ type: "DISCONNECTED",
+ manual: this.manualDisconnect,
+ })
+ } else {
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type: "CONNECTION_LOST",
+ },
+ })
+ }
+ this.manualDisconnect = false
+ this.subscriptionState$.next(false)
+ }
+
+ onMessageArrived({
+ payloadString: message,
+ destinationName: topic,
+ }: {
+ payloadString: string
+ destinationName: string
+ }) {
+ this.addEvent({
+ time: Date.now(),
+ type: "MESSAGE_RECEIVED",
+ message: {
+ topic,
+ message,
+ },
+ })
+ }
+
+ private handleError(error: unknown) {
+ this.disconnect()
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type: "CONNECTION_NOT_ESTABLISHED",
+ value: error,
+ },
+ })
+ }
+
+ publish(topic: string, message: string) {
+ if (this.connectionState$.value === "DISCONNECTED") return
+
+ try {
+ // it was publish
+ this.mqttClient?.send(topic, message, 0, false)
+ this.addEvent({
+ time: Date.now(),
+ type: "MESSAGE_SENT",
+ message: {
+ topic,
+ message,
+ },
+ })
+ } catch (e) {
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type: "PUBLISH_ERROR",
+ topic,
+ message,
+ },
+ })
+ }
+ }
+
+ subscribe(topic: string) {
+ try {
+ this.mqttClient?.subscribe(topic, {
+ onSuccess: this.usubSuccess.bind(this, topic),
+ onFailure: this.usubFailure.bind(this, topic),
+ })
+ } catch (e) {
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type: "SUBSCRIPTION_FAILED",
+ topic,
+ },
+ })
+ }
+ }
+
+ usubSuccess(topic: string) {
+ this.subscriptionState$.next(!this.subscriptionState$.value)
+ this.addEvent({
+ time: Date.now(),
+ type: "SUBSCRIBED",
+ topic,
+ })
+ }
+
+ usubFailure(topic: string) {
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type: "SUBSCRIPTION_FAILED",
+ topic,
+ },
+ })
+ }
+
+ unsubscribe(topic: string) {
+ this.mqttClient?.unsubscribe(topic, {
+ onSuccess: this.usubSuccess.bind(this, topic),
+ onFailure: this.usubFailure.bind(this, topic),
+ })
+ }
+
+ disconnect() {
+ this.manualDisconnect = true
+ this.mqttClient?.disconnect()
+ this.connectionState$.next("DISCONNECTED")
+ }
+}
diff --git a/packages/hoppscotch-app/helpers/realtime/SIOClients.ts b/packages/hoppscotch-app/helpers/realtime/SIOClients.ts
new file mode 100644
index 000000000..c0a9fc20e
--- /dev/null
+++ b/packages/hoppscotch-app/helpers/realtime/SIOClients.ts
@@ -0,0 +1,84 @@
+import wildcard from "socketio-wildcard"
+import ClientV2 from "socket.io-client-v2"
+import { io as ClientV4, Socket as SocketV4 } from "socket.io-client-v4"
+import { io as ClientV3, Socket as SocketV3 } from "socket.io-client-v3"
+
+type Options = {
+ path: string
+ auth: {
+ token: string | undefined
+ }
+}
+
+type PossibleEvent =
+ | "connect"
+ | "connect_error"
+ | "reconnect_error"
+ | "error"
+ | "disconnect"
+ | "*"
+
+export interface SIOClient {
+ connect(url: string, opts?: Options): void
+ on(event: PossibleEvent, cb: (data: any) => void): void
+ emit(event: string, data: any, cb: (data: any) => void): void
+ close(): void
+}
+
+export class SIOClientV4 implements SIOClient {
+ private client: SocketV4 | undefined
+ connect(url: string, opts?: Options) {
+ this.client = ClientV4(url, opts)
+ }
+
+ on(event: PossibleEvent, cb: (data: any) => void) {
+ this.client?.on(event, cb)
+ }
+
+ emit(event: string, data: any, cb: (data: any) => void): void {
+ this.client?.emit(event, data, cb)
+ }
+
+ close(): void {
+ this.client?.close()
+ }
+}
+
+export class SIOClientV3 implements SIOClient {
+ private client: SocketV3 | undefined
+ connect(url: string, opts?: Options) {
+ this.client = ClientV3(url, opts)
+ }
+
+ on(event: PossibleEvent, cb: (data: any) => void): void {
+ this.client?.on(event, cb)
+ }
+
+ emit(event: string, data: any, cb: (data: any) => void): void {
+ this.client?.emit(event, data, cb)
+ }
+
+ close(): void {
+ this.client?.close()
+ }
+}
+
+export class SIOClientV2 implements SIOClient {
+ private client: any | undefined
+ connect(url: string, opts?: Options) {
+ this.client = new ClientV2(url, opts)
+ wildcard(ClientV2.Manager)(this.client)
+ }
+
+ on(event: PossibleEvent, cb: (data: any) => void): void {
+ this.client?.on(event, cb)
+ }
+
+ emit(event: string, data: any, cb: (data: any) => void): void {
+ this.client?.emit(event, data, cb)
+ }
+
+ close(): void {
+ this.client?.close()
+ }
+}
diff --git a/packages/hoppscotch-app/helpers/realtime/SIOConnection.ts b/packages/hoppscotch-app/helpers/realtime/SIOConnection.ts
new file mode 100644
index 000000000..5f215685b
--- /dev/null
+++ b/packages/hoppscotch-app/helpers/realtime/SIOConnection.ts
@@ -0,0 +1,163 @@
+import { BehaviorSubject, Subject } from "rxjs"
+import { logHoppRequestRunToAnalytics } from "../fb/analytics"
+import { SIOClientV2, SIOClientV3, SIOClientV4, SIOClient } from "./SIOClients"
+import { SIOClientVersion } from "~/newstore/SocketIOSession"
+
+export const SOCKET_CLIENTS = {
+ v2: SIOClientV2,
+ v3: SIOClientV3,
+ v4: SIOClientV4,
+} as const
+
+type SIOAuth = { type: "None" } | { type: "Bearer"; token: string }
+
+export type ConnectionOption = {
+ url: string
+ path: string
+ clientVersion: SIOClientVersion
+ auth: SIOAuth | undefined
+}
+
+export type SIOMessage = {
+ eventName: string
+ value: unknown
+}
+
+type SIOErrorType = "CONNECTION" | "RECONNECT_ERROR" | "UNKNOWN"
+export type SIOError = {
+ type: SIOErrorType
+ value: unknown
+}
+
+export type SIOEvent = { time: number } & (
+ | { type: "CONNECTING" }
+ | { type: "CONNECTED" }
+ | { type: "MESSAGE_SENT"; message: SIOMessage }
+ | { type: "MESSAGE_RECEIVED"; message: SIOMessage }
+ | { type: "DISCONNECTED"; manual: boolean }
+ | { type: "ERROR"; error: SIOError }
+)
+
+export type ConnectionState = "CONNECTING" | "CONNECTED" | "DISCONNECTED"
+
+export class SIOConnection {
+ connectionState$: BehaviorSubject<ConnectionState>
+ event$: Subject<SIOEvent> = new Subject()
+ socket: SIOClient | undefined
+ constructor() {
+ this.connectionState$ = new BehaviorSubject<ConnectionState>("DISCONNECTED")
+ }
+
+ private addEvent(event: SIOEvent) {
+ this.event$.next(event)
+ }
+
+ connect({ url, path, clientVersion, auth }: ConnectionOption) {
+ this.connectionState$.next("CONNECTING")
+ this.addEvent({
+ time: Date.now(),
+ type: "CONNECTING",
+ })
+ try {
+ this.socket = new SOCKET_CLIENTS[clientVersion]()
+
+ if (auth?.type === "Bearer") {
+ this.socket.connect(url, {
+ path,
+ auth: {
+ token: auth.token,
+ },
+ })
+ } else {
+ this.socket.connect(url)
+ }
+
+ this.socket.on("connect", () => {
+ this.connectionState$.next("CONNECTED")
+ this.addEvent({
+ type: "CONNECTED",
+ time: Date.now(),
+ })
+ })
+
+ this.socket.on("*", ({ data }: { data: string[] }) => {
+ const [eventName, message] = data
+ this.addEvent({
+ message: { eventName, value: message },
+ type: "MESSAGE_RECEIVED",
+ time: Date.now(),
+ })
+ })
+
+ this.socket.on("connect_error", (error: unknown) => {
+ this.handleError(error, "CONNECTION")
+ })
+
+ this.socket.on("reconnect_error", (error: unknown) => {
+ this.handleError(error, "RECONNECT_ERROR")
+ })
+
+ this.socket.on("error", (error: unknown) => {
+ this.handleError(error, "UNKNOWN")
+ })
+
+ this.socket.on("disconnect", () => {
+ this.connectionState$.next("DISCONNECTED")
+ this.addEvent({
+ type: "DISCONNECTED",
+ time: Date.now(),
+ manual: true,
+ })
+ })
+ } catch (error) {
+ this.handleError(error, "CONNECTION")
+ }
+
+ logHoppRequestRunToAnalytics({
+ platform: "socketio",
+ })
+ }
+
+ private handleError(error: unknown, type: SIOErrorType) {
+ this.disconnect()
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error: {
+ type,
+ value: error,
+ },
+ })
+ }
+
+ sendMessage(event: { message: string; eventName: string }) {
+ if (this.connectionState$.value === "DISCONNECTED") return
+ const { message, eventName } = event
+
+ this.socket?.emit(eventName, message, (data) => {
+ // receive response from server
+ this.addEvent({
+ time: Date.now(),
+ type: "MESSAGE_RECEIVED",
+ message: {
+ eventName,
+ value: data,
+ },
+ })
+ })
+
+ this.addEvent({
+ time: Date.now(),
+ type: "MESSAGE_SENT",
+ message: {
+ eventName,
+ value: message,
+ },
+ })
+ }
+
+ disconnect() {
+ this.socket?.close()
+ this.connectionState$.next("DISCONNECTED")
+ }
+}
diff --git a/packages/hoppscotch-app/helpers/realtime/SSEConnection.ts b/packages/hoppscotch-app/helpers/realtime/SSEConnection.ts
new file mode 100644
index 000000000..54acb2576
--- /dev/null
+++ b/packages/hoppscotch-app/helpers/realtime/SSEConnection.ts
@@ -0,0 +1,86 @@
+import { BehaviorSubject, Subject } from "rxjs"
+import { logHoppRequestRunToAnalytics } from "../fb/analytics"
+
+export type SSEEvent = { time: number } & (
+ | { type: "STARTING" }
+ | { type: "STARTED" }
+ | { type: "MESSAGE_RECEIVED"; message: string }
+ | { type: "STOPPED"; manual: boolean }
+ | { type: "ERROR"; error: Event | null }
+)
+
+export type ConnectionState = "STARTING" | "STARTED" | "STOPPED"
+
+export class SSEConnection {
+ connectionState$: BehaviorSubject<ConnectionState>
+ event$: Subject<SSEEvent> = new Subject()
+ sse: EventSource | undefined
+ constructor() {
+ this.connectionState$ = new BehaviorSubject<ConnectionState>("STOPPED")
+ }
+
+ private addEvent(event: SSEEvent) {
+ this.event$.next(event)
+ }
+
+ start(url: string, eventType: string) {
+ this.connectionState$.next("STARTING")
+ this.addEvent({
+ time: Date.now(),
+ type: "STARTING",
+ })
+ if (typeof EventSource !== "undefined") {
+ try {
+ this.sse = new EventSource(url)
+ this.sse.onopen = () => {
+ this.connectionState$.next("STARTED")
+ this.addEvent({
+ type: "STARTED",
+ time: Date.now(),
+ })
+ }
+ this.sse.onerror = this.handleError
+ this.sse.addEventListener(eventType, ({ data }) => {
+ this.addEvent({
+ type: "MESSAGE_RECEIVED",
+ message: data,
+ time: Date.now(),
+ })
+ })
+ } catch (error) {
+ // A generic event type returned if anything goes wrong or browser doesn't support SSE
+ // https://developer.mozilla.org/en-US/docs/Web/API/EventSource/error_event#event_type
+ this.handleError(error as Event)
+ }
+ } else {
+ this.addEvent({
+ type: "ERROR",
+ time: Date.now(),
+ error: null,
+ })
+ }
+
+ logHoppRequestRunToAnalytics({
+ platform: "sse",
+ })
+ }
+
+ private handleError(error: Event) {
+ this.stop()
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error,
+ })
+ }
+
+ stop() {
+ this.sse?.close()
+ this.connectionState$.next("STOPPED")
+ this.addEvent({
+ type: "STOPPED",
+ time: Date.now(),
+ manual: true,
+ })
+ }
+}
diff --git a/packages/hoppscotch-app/helpers/realtime/WSConnection.ts b/packages/hoppscotch-app/helpers/realtime/WSConnection.ts
new file mode 100644
index 000000000..f0c4a1616
--- /dev/null
+++ b/packages/hoppscotch-app/helpers/realtime/WSConnection.ts
@@ -0,0 +1,102 @@
+import { BehaviorSubject, Subject } from "rxjs"
+import { logHoppRequestRunToAnalytics } from "../fb/analytics"
+
+export type WSErrorMessage = SyntaxError | Event
+
+export type WSEvent = { time: number } & (
+ | { type: "CONNECTING" }
+ | { type: "CONNECTED" }
+ | { type: "MESSAGE_SENT"; message: string }
+ | { type: "MESSAGE_RECEIVED"; message: string }
+ | { type: "DISCONNECTED"; manual: boolean }
+ | { type: "ERROR"; error: WSErrorMessage }
+)
+
+export type ConnectionState = "CONNECTING" | "CONNECTED" | "DISCONNECTED"
+
+export class WSConnection {
+ connectionState$: BehaviorSubject<ConnectionState>
+ event$: Subject<WSEvent> = new Subject()
+ socket: WebSocket | undefined
+
+ constructor() {
+ this.connectionState$ = new BehaviorSubject<ConnectionState>("DISCONNECTED")
+ }
+
+ private addEvent(event: WSEvent) {
+ this.event$.next(event)
+ }
+
+ connect(url: string, protocols: string[]) {
+ try {
+ this.connectionState$.next("CONNECTING")
+ this.socket = new WebSocket(url, protocols)
+
+ this.addEvent({
+ time: Date.now(),
+ type: "CONNECTING",
+ })
+
+ this.socket.onopen = () => {
+ this.connectionState$.next("CONNECTED")
+ this.addEvent({
+ type: "CONNECTED",
+ time: Date.now(),
+ })
+ }
+
+ this.socket.onerror = (error) => {
+ this.handleError(error)
+ }
+
+ this.socket.onclose = () => {
+ this.connectionState$.next("DISCONNECTED")
+ this.addEvent({
+ type: "DISCONNECTED",
+ time: Date.now(),
+ manual: true,
+ })
+ }
+
+ this.socket.onmessage = ({ data }) => {
+ this.addEvent({
+ time: Date.now(),
+ type: "MESSAGE_RECEIVED",
+ message: data,
+ })
+ }
+ } catch (error) {
+ // We will have SyntaxError if anything goes wrong with WebSocket constructor
+ // See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket#exceptions
+ this.handleError(error as SyntaxError)
+ }
+
+ logHoppRequestRunToAnalytics({
+ platform: "wss",
+ })
+ }
+
+ private handleError(error: WSErrorMessage) {
+ this.disconnect()
+ this.addEvent({
+ time: Date.now(),
+ type: "ERROR",
+ error,
+ })
+ }
+
+ sendMessage(event: { message: string; eventName: string }) {
+ if (this.connectionState$.value === "DISCONNECTED") return
+ const { message } = event
+ this.socket?.send(message)
+ this.addEvent({
+ time: Date.now(),
+ type: "MESSAGE_SENT",
+ message,
+ })
+ }
+
+ disconnect() {
+ this.socket?.close()
+ }
+}
diff --git a/packages/hoppscotch-app/helpers/types/HoppRealtimeLog.ts b/packages/hoppscotch-app/helpers/types/HoppRealtimeLog.ts
index 4132a487d..9756fce72 100644
--- a/packages/hoppscotch-app/helpers/types/HoppRealtimeLog.ts
+++ b/packages/hoppscotch-app/helpers/types/HoppRealtimeLog.ts
@@ -1,8 +1,9 @@
export type HoppRealtimeLogLine = {
+ prefix?: string
payload: string
source: string
color?: string
- ts: string
+ ts: number | undefined
}
export type HoppRealtimeLog = HoppRealtimeLogLine[]
diff --git a/packages/hoppscotch-app/locales/en.json b/packages/hoppscotch-app/locales/en.json
index 458ac5f19..8b5ab871f 100644
--- a/packages/hoppscotch-app/locales/en.json
+++ b/packages/hoppscotch-app/locales/en.json
@@ -508,7 +508,8 @@
"event_name": "Event Name",
"events": "Events",
"log": "Log",
- "url": "URL"
+ "url": "URL",
+ "connection_not_authorized": "This SocketIO connection does not use any authentication."
},
"sse": {
"event_type": "Event type",
@@ -538,7 +539,19 @@
"loading": "Loading...",
"none": "None",
"nothing_found": "Nothing found for",
- "waiting_send_request": "Waiting to send request"
+ "waiting_send_request": "Waiting to send request",
+ "subscribed_success": "Successfully subscribed to topic: {topic}",
+ "unsubscribed_success": "Successfully unsubscribed from topic: {topic}",
+ "subscribed_failed": "Failed to subscribe to topic: {topic}",
+ "unsubscribed_failed": "Failed to unsubscribe from topic: {topic}",
+ "published_message": "Published message: {message} to topic: {topic}",
+ "published_error": "Something went wrong while publishing msg: {topic} to topic: {message}",
+ "message_received": "Message: {message} arrived on topic: {topic}",
+ "mqtt_subscription_failed": "Something went wrong while subscribing to topic: {topic}",
+ "connection_lost": "Connection lost",
+ "connection_failed": "Connection failed",
+ "connection_error": "Failed to connect",
+ "reconnection_error": "Failed to reconnect"
},
"support": {
"changelog": "Read more about latest releases",
diff --git a/packages/hoppscotch-app/newstore/MQTTSession.ts b/packages/hoppscotch-app/newstore/MQTTSession.ts
index e67382709..cad1e8d68 100644
--- a/packages/hoppscotch-app/newstore/MQTTSession.ts
+++ b/packages/hoppscotch-app/newstore/MQTTSession.ts
@@ -1,6 +1,6 @@
-import { pluck, distinctUntilChanged } from "rxjs/operators"
-import { Client as MQTTClient } from "paho-mqtt"
+import { distinctUntilChanged, pluck } from "rxjs/operators"
import DispatchingStore, { defineDispatchers } from "./DispatchingStore"
+import { MQTTConnection } from "~/helpers/realtime/MQTTConnection"
import {
HoppRealtimeLog,
HoppRealtimeLogLine,
@@ -12,11 +12,9 @@ type HoppMQTTRequest = {
type HoppMQTTSession = {
request: HoppMQTTRequest
- connectingState: boolean
- connectionState: boolean
subscriptionState: boolean
log: HoppRealtimeLog
- socket: MQTTClient | null
+ socket: MQTTConnection
}
const defaultMQTTRequest: HoppMQTTRequest = {
@@ -25,10 +23,8 @@ const defaultMQTTRequest: HoppMQTTRequest = {
const defaultMQTTSession: HoppMQTTSession = {
request: defaultMQTTRequest,
- connectionState: false,
- connectingState: false,
subscriptionState: false,
- socket: null,
+ socket: new MQTTConnection(),
log: [],
}
@@ -48,21 +44,11 @@ const dispatchers = defineDispatchers({
},
}
},
- setSocket(_: HoppMQTTSession, { socket }: { socket: MQTTClient }) {
+ setConn(_: HoppMQTTSession, { socket }: { socket: MQTTConnection }) {
return {
socket,
}
},
- setConnectionState(_: HoppMQTTSession, { state }: { state: boolean }) {
- return {
- connectionState: state,
- }
- },
- setConnectingState(_: HoppMQTTSession, { state }: { state: boolean }) {
- return {
- connectingState: state,
- }
- },
setSubscriptionState(_: HoppMQTTSession, { state }: { state: boolean }) {
return {
subscriptionState: state,
@@ -100,33 +86,15 @@ export function setMQTTEndpoint(newEndpoint: string) {
})
}
-export function setMQTTSocket(socket: MQTTClient) {
+export function setMQTTConn(socket: MQTTConnection) {
MQTTSessionStore.dispatch({
- dispatcher: "setSocket",
+ dispatcher: "setConn",
payload: {
socket,
},
})
}
-export function setMQTTConnectionState(state: boolean) {
- MQTTSessionStore.dispatch({
- dispatcher: "setConnectionState",
- payload: {
- state,
- },
- })
-}
-
-export function setMQTTConnectingState(state: boolean) {
- MQTTSessionStore.dispatch({
- dispatcher: "setConnectingState",
- payload: {
- state,
- },
- })
-}
-
export function setMQTTSubscriptionState(state: boolean) {
MQTTSessionStore.dispatch({
dispatcher: "setSubscriptionState",
@@ -179,7 +147,7 @@ export const MQTTSubscriptionState$ = MQTTSessionStore.subject$.pipe(
distinctUntilChanged()
)
-export const MQTTSocket$ = MQTTSessionStore.subject$.pipe(
+export const MQTTConn$ = MQTTSessionStore.subject$.pipe(
pluck("socket"),
distinctUntilChanged()
)
diff --git a/packages/hoppscotch-app/newstore/SSESession.ts b/packages/hoppscotch-app/newstore/SSESession.ts
index fec8770d7..3577483ae 100644
--- a/packages/hoppscotch-app/newstore/SSESession.ts
+++ b/packages/hoppscotch-app/newstore/SSESession.ts
@@ -4,6 +4,7 @@ import {
HoppRealtimeLog,
HoppRealtimeLogLine,
} from "~/helpers/types/HoppRealtimeLog"
+import { SSEConnection } from "~/helpers/realtime/SSEConnection"
type HoppSSERequest = {
endpoint: string
@@ -12,10 +13,8 @@ type HoppSSERequest = {
type HoppSSESession = {
request: HoppSSERequest
- connectingState: boolean
- connectionState: boolean
log: HoppRealtimeLog
- socket: EventSource | null
+ socket: SSEConnection
}
const defaultSSERequest: HoppSSERequest = {
@@ -25,9 +24,7 @@ const defaultSSERequest: HoppSSERequest = {
const defaultSSESession: HoppSSESession = {
request: defaultSSERequest,
- connectionState: false,
- connectingState: false,
- socket: null,
+ socket: new SSEConnection(),
log: [],
}
@@ -56,21 +53,11 @@ const dispatchers = defineDispatchers({
},
}
},
- setSocket(_: HoppSSESession, { socket }: { socket: EventSource }) {
+ setSocket(_: HoppSSESession, { socket }: { socket: SSEConnection }) {
return {
socket,
}
},
- setConnectionState(_: HoppSSESession, { state }: { state: boolean }) {
- return {
- connectionState: state,
- }
- },
- setConnectingState(_: HoppSSESession, { state }: { state: boolean }) {
- return {
- connectingState: state,
- }
- },
setLog(_: HoppSSESession, { log }: { log: HoppRealtimeLog }) {
return {
log,
@@ -112,7 +99,7 @@ export function setSSEEventType(newType: string) {
})
}
-export function setSSESocket(socket: EventSource) {
+export function setSSESocket(socket: SSEConnection) {
SSESessionStore.dispatch({
dispatcher: "setSocket",
payload: {
@@ -121,23 +108,6 @@ export function setSSESocket(socket: EventSource) {
})
}
-export function setSSEConnectionState(state: boolean) {
- SSESessionStore.dispatch({
- dispatcher: "setConnectionState",
- payload: {
- state,
- },
- })
-}
-export function setSSEConnectingState(state: boolean) {
- SSESessionStore.dispatch({
- dispatcher: "setConnectingState",
- payload: {
- state,
- },
- })
-}
-
export function setSSELog(log: HoppRealtimeLog) {
SSESessionStore.dispatch({
dispatcher: "setLog",
@@ -176,11 +146,6 @@ export const SSEConnectingState$ = SSESessionStore.subject$.pipe(
distinctUntilChanged()
)
-export const SSEConnectionState$ = SSESessionStore.subject$.pipe(
- pluck("connectionState"),
- distinctUntilChanged()
-)
-
export const SSESocket$ = SSESessionStore.subject$.pipe(
pluck("socket"),
distinctUntilChanged()
diff --git a/packages/hoppscotch-app/newstore/SocketIOSession.ts b/packages/hoppscotch-app/newstore/SocketIOSession.ts
index 4b3aa57a4..f8561bdef 100644
--- a/packages/hoppscotch-app/newstore/SocketIOSession.ts
+++ b/packages/hoppscotch-app/newstore/SocketIOSession.ts
@@ -10,16 +10,16 @@ import {
type SocketIO = SocketV2 | SocketV3 | SocketV4
+export type SIOClientVersion = "v4" | "v3" | "v2"
+
type HoppSIORequest = {
endpoint: string
path: string
- version: string
+ version: SIOClientVersion
}
type HoppSIOSession = {
request: HoppSIORequest
- connectingState: boolean
- connectionState: boolean
log: HoppRealtimeLog
socket: SocketIO | null
}
@@ -32,8 +32,6 @@ const defaultSIORequest: HoppSIORequest = {
const defaultSIOSession: HoppSIOSession = {
request: defaultSIORequest,
- connectionState: false,
- connectingState: false,
socket: null,
log: [],
}
@@ -63,7 +61,10 @@ const dispatchers = defineDispatchers({
},
}
},
- setVersion(curr: HoppSIOSession, { newVersion }: { newVersion: string }) {
+ setVersion(
+ curr: HoppSIOSession,
+ { newVersion }: { newVersion: SIOClientVersion }
+ ) {
return {
request: {
...curr.request,
@@ -76,16 +77,6 @@ const dispatchers = defineDispatchers({
socket,
}
},
- setConnectionState(_: HoppSIOSession, { state }: { state: boolean }) {
- return {
- connectionState: state,
- }
- },
- setConnectingState(_: HoppSIOSession, { state }: { state: boolean }) {
- return {
- connectingState: state,
- }
- },
setLog(_: HoppSIOSession, { log }: { log: HoppRealtimeLog }) {
return {
log,
@@ -145,23 +136,6 @@ export function setSIOSocket(socket: SocketIO) {
})
}
-export function setSIOConnectionState(state: boolean) {
- SIOSessionStore.dispatch({
- dispatcher: "setConnectionState",
- payload: {
- state,
- },
- })
-}
-export function setSIOConnectingState(state: boolean) {
- SIOSessionStore.dispatch({
- dispatcher: "setConnectingState",
- payload: {
- state,
- },
- })
-}
-
export function setSIOLog(log: HoppRealtimeLog) {
SIOSessionStore.dispatch({
dispatcher: "setLog",
@@ -200,11 +174,6 @@ export const SIOPath$ = SIOSessionStore.subject$.pipe(
distinctUntilChanged()
)
-export const SIOConnectingState$ = SIOSessionStore.subject$.pipe(
- pluck("connectingState"),
- distinctUntilChanged()
-)
-
export const SIOConnectionState$ = SIOSessionStore.subject$.pipe(
pluck("connectionState"),
distinctUntilChanged()
diff --git a/packages/hoppscotch-app/newstore/WebSocketSession.ts b/packages/hoppscotch-app/newstore/WebSocketSession.ts
index 9d2d76873..6f5759e0a 100644
--- a/packages/hoppscotch-app/newstore/WebSocketSession.ts
+++ b/packages/hoppscotch-app/newstore/WebSocketSession.ts
@@ -4,8 +4,9 @@ import {
HoppRealtimeLog,
HoppRealtimeLogLine,
} from "~/helpers/types/HoppRealtimeLog"
+import { WSConnection } from "~/helpers/realtime/WSConnection"
-type HoppWSProtocol = {
+export type HoppWSProtocol = {
value: string
active: boolean
}
@@ -17,10 +18,8 @@ type HoppWSRequest = {
export type HoppWSSession = {
request: HoppWSRequest
- connectingState: boolean
- connectionState: boolean
log: HoppRealtimeLog
- socket: WebSocket | null
+ socket: WSConnection
}
const defaultWSRequest: HoppWSRequest = {
@@ -30,9 +29,7 @@ const defaultWSRequest: HoppWSRequest = {
const defaultWSSession: HoppWSSession = {
request: defaultWSRequest,
- connectionState: false,
- connectingState: false,
- socket: null,
+ socket: new WSConnection(),
log: [],
}
@@ -101,21 +98,11 @@ const dispatchers = defineDispatchers({
},
}
},
- setSocket(_: HoppWSSession, { socket }: { socket: WebSocket }) {
+ setSocket(_: HoppWSSession, { socket }: { socket: WSConnection }) {
return {
socket,
}
},
- setConnectionState(_: HoppWSSession, { state }: { state: boolean }) {
- return {
- connectionState: state,
- }
- },
- setConnectingState(_: HoppWSSession, { state }: { state: boolean }) {
- return {
- connectingState: state,
- }
- },
setLog(_: HoppWSSession, { log }: { log: HoppRealtimeLog }) {
return {
log,
@@ -195,7 +182,7 @@ export function updateWSProtocol(
})
}
-export function setWSSocket(socket: WebSocket) {
+export function setWSSocket(socket: WSConnection) {
WSSessionStore.dispatch({
dispatcher: "setSocket",
payload: {
@@ -204,23 +191,6 @@ export function setWSSocket(socket: WebSocket) {
})
}
-export function setWSConnectionState(state: boolean) {
- WSSessionStore.dispatch({
- dispatcher: "setConnectionState",
- payload: {
- state,
- },
- })
-}
-export function setWSConnectingState(state: boolean) {
- WSSessionStore.dispatch({
- dispatcher: "setConnectingState",
- payload: {
- state,
- },
- })
-}
-
export function setWSLog(log: HoppRealtimeLog) {
WSSessionStore.dispatch({
dispatcher: "setLog",
diff --git a/packages/hoppscotch-app/package.json b/packages/hoppscotch-app/package.json
index 1a9547dba..e69ce859c 100644
--- a/packages/hoppscotch-app/package.json
+++ b/packages/hoppscotch-app/package.json
@@ -153,6 +153,7 @@
"@types/paho-mqtt": "^1.0.6",
"@types/postman-collection": "^3.5.7",
"@types/qs": "^6.9.7",
+ "@types/socketio-wildcard": "^2.0.4",
"@types/splitpanes": "^2.2.1",
"@types/uuid": "^8.3.4",
"@types/yargs-parser": "^21.0.0",
diff --git a/packages/hoppscotch-app/types/socket-io-2.d.ts b/packages/hoppscotch-app/types/socket-io-2.d.ts
index 7302c5400..533cab964 100644
--- a/packages/hoppscotch-app/types/socket-io-2.d.ts
+++ b/packages/hoppscotch-app/types/socket-io-2.d.ts
@@ -2,6 +2,21 @@
// tsc, this is really annoying (and maybe dangerous)
// We don't have access to the 2.4.0 typings, hence we make do with this,
// Check docs before you correct types again as you need
+
+type Options = {
+ path: string
+ auth: {
+ token: string | undefined
+ }
+}
+
declare module "socket.io-client-v2" {
- export type Socket = any
+ export type Socket = unknown
+ export default class ClientV2 {
+ static Manager: { prototype: EventEmitter } | undefined
+ constructor(url: string, opts?: Options)
+ on(event: string, cb: (data: any) => void): void
+ emit(event: string, data: any, cb: (data: any) => void): void
+ close(): void
+ }
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9e3b88c4d..05d209fb9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -112,6 +112,7 @@ importers:
'@types/paho-mqtt': ^1.0.6
'@types/postman-collection': ^3.5.7
'@types/qs': ^6.9.7
+ '@types/socketio-wildcard': ^2.0.4
'@types/splitpanes': ^2.2.1
'@types/uuid': ^8.3.4
'@types/yargs-parser': ^21.0.0
@@ -314,6 +315,7 @@ importers:
'@types/paho-mqtt': 1.0.6
'@types/postman-collection': 3.5.7
'@types/qs': 6.9.7
+ '@types/socketio-wildcard': 2.0.4
'@types/splitpanes': 2.2.1
'@types/uuid': 8.3.4
'@types/yargs-parser': 21.0.0
@@ -380,7 +382,7 @@ importers:
'@hoppscotch/data': link:../hoppscotch-data
'@hoppscotch/js-sandbox': link:../hoppscotch-js-sandbox
'@relmify/jest-fp-ts': [email protected][email protected]
- '@swc/core': 1.2.181
+ '@swc/core': 1.2.182
'@types/axios': 0.14.0
'@types/chalk': 2.2.0
'@types/commander': 2.12.2
@@ -732,7 +734,7 @@ packages:
dependencies:
'@babel/helper-get-function-arity': 7.16.7
'@babel/template': 7.16.7
- '@babel/types': 7.16.8
+ '@babel/types': 7.17.0
/@babel/helper-function-name/7.17.9:
resolution: {integrity: sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==}
@@ -751,7 +753,7 @@ packages:
resolution: {integrity: sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.16.8
+ '@babel/types': 7.17.0
/@babel/helper-hoist-variables/7.16.0:
resolution: {integrity: sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==}
@@ -795,7 +797,7 @@ packages:
'@babel/helper-validator-identifier': 7.16.7
'@babel/template': 7.16.7
'@babel/traverse': 7.17.9
- '@babel/types': 7.16.8
+ '@babel/types': 7.17.0
transitivePeerDependencies:
- supports-color
@@ -850,7 +852,7 @@ packages:
resolution: {integrity: sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==}
engines: {node: '>=6.9.0'}
dependencies:
- '@babel/types': 7.16.8
+ '@babel/types': 7.17.0
/@babel/helper-simple-access/7.17.7:
resolution: {integrity: sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==}
@@ -2218,10 +2220,10 @@ packages:
'@types/node': 17.0.24
chalk: 4.1.2
cosmiconfig: 7.0.1
- cosmiconfig-typescript-loader: 1.0.9_kpiehm6dkipypriomyghl2wcpq
+ cosmiconfig-typescript-loader: 1.0.9_c6ucwwwirjo6ockovr3lj3o2cm
lodash: 4.17.21
resolve-from: 5.0.0
- typescript: 4.6.4
+ typescript: 4.6.3
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@@ -3699,7 +3701,7 @@ packages:
'@jest/schemas': 28.0.2
'@types/istanbul-lib-coverage': 2.0.4
'@types/istanbul-reports': 3.0.1
- '@types/node': 17.0.31
+ '@types/node': 17.0.24
'@types/yargs': 17.0.10
chalk: 4.1.2
dev: true
@@ -3867,17 +3869,17 @@ packages:
consola: 2.15.3
crc: 3.8.0
defu: 4.0.1
- destr: 1.1.0
+ destr: 1.1.1
execa: 5.1.1
exit: 0.1.2
fs-extra: 9.1.0
globby: 11.1.0
hable: 3.0.0
lodash: 4.17.21
- minimist: 1.2.5
+ minimist: 1.2.6
opener: 1.5.2
pretty-bytes: 5.6.0
- semver: 7.3.6
+ semver: 7.3.7
serve-static: 1.14.1
std-env: 2.3.1
upath: 2.0.1
@@ -3894,7 +3896,7 @@ packages:
glob: 7.2.0
globby: 11.1.0
scule: 0.2.1
- semver: 7.3.6
+ semver: 7.3.7
upath: 2.0.1
vue-template-compiler: 2.6.14
dev: false
@@ -3905,10 +3907,10 @@ packages:
'@nuxt/utils': 2.15.8
consola: 2.15.3
defu: 4.0.1
- destr: 1.1.0
+ destr: 1.1.1
dotenv: 9.0.2
lodash: 4.17.21
- rc9: 1.2.0
+ rc9: 1.2.2
std-env: 2.3.1
ufo: 0.7.11
dev: false
@@ -3959,11 +3961,11 @@ packages:
ufo: 0.7.11
dev: false
- /@nuxt/kit-edge/3.0.0-rc.3-27536597.3359b3b:
- resolution: {integrity: sha512-vQWAzbsHk8sP0tGXLfKX6EfnR6cb6sG4CJLcj2sptuyKwnXrHjQTfdWxKkJLqVBKq4O/8Vej9Xm9r5VLGOpNPA==}
+ /@nuxt/kit-edge/3.0.0-rc.3-27545866.cd37a21:
+ resolution: {integrity: sha512-iBU1wEwj2peSN/sS4QIuZfUQluplh7YCarvz+MCUcybdOw17kXALPQjUY6q5ISXmNsTiY/fLqHvYz3k6UjkS5w==}
engines: {node: ^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0}
dependencies:
- '@nuxt/schema': /@nuxt/schema-edge/3.0.0-rc.3-27536597.3359b3b
+ '@nuxt/schema': /@nuxt/schema-edge/3.0.0-rc.3-27545866.cd37a21
c12: 0.2.7
consola: 2.15.3
defu: 6.0.0
@@ -4011,8 +4013,8 @@ packages:
- encoding
dev: false
- /@nuxt/schema-edge/3.0.0-rc.3-27536597.3359b3b:
- resolution: {integrity: sha512-+a/6Irx+EL2oxD+TX0Saervw3SXbr3SqFnAUE5QfTQppzG5Zf3Y9KBf+wzafB7qEDoQiCl0DWBuFVaPt+Ibt3g==}
+ /@nuxt/schema-edge/3.0.0-rc.3-27545866.cd37a21:
+ resolution: {integrity: sha512-7EOInYwj96i688RLlYKy1CIOM3Lo1GQkYNPfbNcD1k74QeQorUqn0/Tr5Cyce3/SqZ77c8PcQ4bc3p7PNPu9XA==}
engines: {node: ^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0}
dependencies:
c12: 0.2.7
@@ -4064,7 +4066,7 @@ packages:
consola: 2.15.3
create-require: 1.1.1
defu: 5.0.1
- destr: 1.1.0
+ destr: 1.1.1
dotenv: 9.0.2
fs-extra: 8.1.0
git-url-parse: 11.6.0
@@ -4074,7 +4076,7 @@ packages:
nanoid: 3.3.1
node-fetch: 2.6.7
parse-git-config: 3.0.0
- rc9: 1.2.0
+ rc9: 1.2.2
std-env: 2.3.1
transitivePeerDependencies:
- encoding
@@ -4135,7 +4137,7 @@ packages:
jiti: 1.13.0
lodash: 4.17.21
proper-lockfile: 4.1.2
- semver: 7.3.6
+ semver: 7.3.7
serialize-javascript: 5.0.1
signal-exit: 3.0.5
ua-parser-js: 0.7.31
@@ -4206,7 +4208,7 @@ packages:
postcss-loader: 3.0.0
postcss-preset-env: 6.7.0
postcss-url: 8.0.0
- semver: 7.3.6
+ semver: 7.3.7
std-env: 2.3.1
style-resources-loader: [email protected]
terser-webpack-plugin: [email protected]
@@ -4589,7 +4591,7 @@ packages:
requiresBuild: true
dependencies:
https-proxy-agent: 5.0.0
- mkdirp: 0.5.5
+ mkdirp: 0.5.6
node-fetch: 2.6.7
npmlog: 4.1.2
progress: 2.0.3
@@ -4761,10 +4763,9 @@ packages:
/@socket.io/component-emitter/3.0.0:
resolution: {integrity: sha512-2pTGuibAXJswAPJjaKisthqS/NOK5ypG4LYT6tEAV0S/mxW0zOIvYvGK0V8w8+SHxAm6vRMSjqSalFXeBAqs+Q==}
- dev: false
- /@swc/core-android-arm-eabi/1.2.181:
- resolution: {integrity: sha512-H3HNf8j6M13uIbSruef8iMsCElJJDZOhp5qxwm/+P1jAG4eQ4vPfajIlTVdFJes8Adrbr4WQaVvl+m4BQw51JQ==}
+ /@swc/core-android-arm-eabi/1.2.182:
+ resolution: {integrity: sha512-NLjye+oyMoGsGFO+w5Opo9Q55GOZw1bnXhw7MHlGibUIhxkJk3kJ+EgFNdXUPgh2B3c9qsDqY2d6v3WD+N4XyA==}
engines: {node: '>=10'}
cpu: [arm]
os: [android]
@@ -4772,8 +4773,8 @@ packages:
dev: true
optional: true
- /@swc/core-android-arm64/1.2.181:
- resolution: {integrity: sha512-b1apYKeosBaXl28xE/By4QVHYrXaR2+nOdcP6rsDXg6nyLBArtoiS5YUFikFN/VQbSAQqNeJQ+rovT5zITrgSQ==}
+ /@swc/core-android-arm64/1.2.182:
+ resolution: {integrity: sha512-80wldTfsY3JtSQQkIZKj8Vc9QpKObVapWXBfOrebfN1vJesUN/NSf2RGue8RGGkiqjZI0g4ErVHZXZl1CC3hBw==}
engines: {node: '>=10'}
cpu: [arm64]
os: [android]
@@ -4781,8 +4782,8 @@ packages:
dev: true
optional: true
- /@swc/core-darwin-arm64/1.2.181:
- resolution: {integrity: sha512-M3/PPeO6NTN7GYa1mOWPNMaAPxEQH8xd+X6FHMa7OBCi+Qxkarafu4DZRfzR88TcS3XikqFLgmmzSP7Z/tye2w==}
+ /@swc/core-darwin-arm64/1.2.182:
+ resolution: {integrity: sha512-CrJToIWnrh6mPHHxPW8bwAZzlQ85sbQmtWh5/DNWQe3MAtrcPDdxxoEIMu+d+HVFcO24EpqOvxI9ok7Cj0SaLQ==}
engines: {node: '>=10'}
cpu: [arm64]
os: [darwin]
@@ -4790,8 +4791,8 @@ packages:
dev: true
optional: true
- /@swc/core-darwin-x64/1.2.181:
- resolution: {integrity: sha512-8Uc6gx7YN5+eSnk3h7aHqp1f3RFoBJPDPeH9cURm4mfE4BTgkVgkctUm0IE5sS5AotazVbrOwhEFrl7TONSfPA==}
+ /@swc/core-darwin-x64/1.2.182:
+ resolution: {integrity: sha512-FFtLCYcSxJDw6OTQMz8TmfudxwcCuinC4O2qdph5ocOb5fAbw/QQS9M3oYuCPN8KXlLyfQ/2zebaAUbKD1mr7g==}
engines: {node: '>=10'}
cpu: [x64]
os: [darwin]
@@ -4799,8 +4800,8 @@ packages:
dev: true
optional: true
- /@swc/core-freebsd-x64/1.2.181:
- resolution: {integrity: sha512-SbnsbJHGFNY7VSTA5OhBh2PmLgQumIGerAxTCTYO1IgtbADCTL+gCjU0TK0viG/zpH4jnjaL965BI4JTo/bpRg==}
+ /@swc/core-freebsd-x64/1.2.182:
+ resolution: {integrity: sha512-evWeqrw8HnhZroHhPsiWtCQKSFZ6knQfejeDx8Jqu99NGjYm6WtUKSG+yXPJRhlTTxDB0zj8QzjF1C0HDU1EFw==}
engines: {node: '>=10'}
cpu: [x64]
os: [freebsd]
@@ -4808,8 +4809,8 @@ packages:
dev: true
optional: true
- /@swc/core-linux-arm-gnueabihf/1.2.181:
- resolution: {integrity: sha512-aWO6Lr9wea96Z7AEagzf4reKgDb3UWXZnClwJK7baScwF8KV+Mh99vVgkSe1nj2gKOZ31pBLp62RDJkc3gdlnA==}
+ /@swc/core-linux-arm-gnueabihf/1.2.182:
+ resolution: {integrity: sha512-vix9LI1QUkaa33F42t0T4nmk9Yqeyh+P7zkc8STn26sc/mFaJ1T4PrF8rLZfACcX1B1vJxJ3+HoGLdTLqFBPRg==}
engines: {node: '>=10'}
cpu: [arm]
os: [linux]
@@ -4817,8 +4818,8 @@ packages:
dev: true
optional: true
- /@swc/core-linux-arm64-gnu/1.2.181:
- resolution: {integrity: sha512-+7fzDwsvcbhPafKdminMQrU3Ej1NHltXy7k+zgjj8BDPZbfi8hRzQcONeBV7sfl4xvw3d3roNHu2UMmKzLNs0w==}
+ /@swc/core-linux-arm64-gnu/1.2.182:
+ resolution: {integrity: sha512-co6NlUl2gxTUcN3/U5OJMIqUGK1j1OZSI9R2FMknaf0olymtSoRB0ww/+p/PKPD69sl+pZd7DvzeIjFrJKeOPw==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
@@ -4826,8 +4827,8 @@ packages:
dev: true
optional: true
- /@swc/core-linux-arm64-musl/1.2.181:
- resolution: {integrity: sha512-U9k8pv2oCxYYfu9DdOO1ZZgqbmF97NgJzSaIu3PsTedF4RcGIiPcuGOFqrUECsGUW2i6uKejE8onbXPj9UmaZQ==}
+ /@swc/core-linux-arm64-musl/1.2.182:
+ resolution: {integrity: sha512-NoT9aZjjANCtS/yECBRiwmA2oJjFn6X/NhXcQdapcNk2vVid9Hr3NZD5CgBhs3XncXUF/Fjfn6lbRNgZ4MqDRg==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
@@ -4835,8 +4836,8 @@ packages:
dev: true
optional: true
- /@swc/core-linux-x64-gnu/1.2.181:
- resolution: {integrity: sha512-9AQXrvZ9BFQJeqYMpKQZRf9h/DEwhfHIR39krehO+g594i+mkkp+UNTToez6Ifn+NBYl58xyEcQGwsYIqtdYVw==}
+ /@swc/core-linux-x64-gnu/1.2.182:
+ resolution: {integrity: sha512-Fq7sGcc3NyuEVCFIme5xAJLQ2d27ztAoI9Ct5a3/4mP6+E/uEIPSs9eridOOqedq5bi4ZEPU1GsisLUmkVML0g==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
@@ -4844,8 +4845,8 @@ packages:
dev: true
optional: true
- /@swc/core-linux-x64-musl/1.2.181:
- resolution: {integrity: sha512-Pq/aBMj3F4CR4tXq85t7IW3piu76a677nIoo6QtBkAjrQ5QuJqpaez/5aewipG+kIXpiu/DNFIN+cISa1QeC8A==}
+ /@swc/core-linux-x64-musl/1.2.182:
+ resolution: {integrity: sha512-O8nZOXPMTLL4m0AVJPygkxU8pp/Mv7WeNgFlEqYcQbK0ZdmW7jU0ZWwAD+IfgzUhdvy3nezorsBnNCRT/YVLiA==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
@@ -4853,8 +4854,8 @@ packages:
dev: true
optional: true
- /@swc/core-win32-arm64-msvc/1.2.181:
- resolution: {integrity: sha512-m24036tVFDE8ZJ3fBVBfsHw4tHd0BG6g3TvT2MLAiW2MezYeTdrGpmvPBz4Woz686I/06cWeSg7cZF1/ZcZMMA==}
+ /@swc/core-win32-arm64-msvc/1.2.182:
+ resolution: {integrity: sha512-KAr39wz+H7nqZ3wmzkR1h1FmFJhRNfDDvmBfIcqZCtM45YpeikRgxUrbq+Ph7lUob/6cUIKA8QGP5mHmxxzN1A==}
engines: {node: '>=10'}
cpu: [arm64]
os: [win32]
@@ -4862,8 +4863,8 @@ packages:
dev: true
optional: true
- /@swc/core-win32-ia32-msvc/1.2.181:
- resolution: {integrity: sha512-OPROzGapmr29qqwvB/aP9SA80r2eIukj+q7gghdQVptJrQU4GrTyzW1TpnGtpzj8rLZz4hEG6KtyPUh54bJZ/g==}
+ /@swc/core-win32-ia32-msvc/1.2.182:
+ resolution: {integrity: sha512-Ng2b/AE3CUulaattHo19+xPhCKQ9xjwKUgK8zBzx9h8yU7NdRJw5KCe58lMi5axVF0uIqbu0hFdHfQWQIX+bhQ==}
engines: {node: '>=10'}
cpu: [ia32]
os: [win32]
@@ -4871,8 +4872,8 @@ packages:
dev: true
optional: true
- /@swc/core-win32-x64-msvc/1.2.181:
- resolution: {integrity: sha512-YrIaS63XsGiQ9AgxUVZ7Irt4pwQc3c2TPN7PyQP7ok9zBZxY5pBTwRTdLctlF4LNsSavlHE5+rvdPzcYAG0ekQ==}
+ /@swc/core-win32-x64-msvc/1.2.182:
+ resolution: {integrity: sha512-GRN6AyTVZsvbfMMXKblf+27kQwFnVguaLYqK1H1xk6UKx0U26wcrCM/01hczcoD3NmIVtljANm3VOqqbwlNAJQ==}
engines: {node: '>=10'}
cpu: [x64]
os: [win32]
@@ -4880,24 +4881,24 @@ packages:
dev: true
optional: true
- /@swc/core/1.2.181:
- resolution: {integrity: sha512-evQX+Br/gC+FYLbUIF1dOQa7hUzBpowrcbgPkIRCEvi4HrCn7pGBZ2ZHBXmwEtBdLfOlyQvN/8USClApQKK4Rw==}
+ /@swc/core/1.2.182:
+ resolution: {integrity: sha512-ao/6J7VPS8NElpSElGw5KtAB2aYJriSvRkDdjFnX7N06H3w4qo+CweeS8NXnS2/XCoFuCtPBGEpecuBhfKkHNA==}
engines: {node: '>=10'}
hasBin: true
optionalDependencies:
- '@swc/core-android-arm-eabi': 1.2.181
- '@swc/core-android-arm64': 1.2.181
- '@swc/core-darwin-arm64': 1.2.181
- '@swc/core-darwin-x64': 1.2.181
- '@swc/core-freebsd-x64': 1.2.181
- '@swc/core-linux-arm-gnueabihf': 1.2.181
- '@swc/core-linux-arm64-gnu': 1.2.181
- '@swc/core-linux-arm64-musl': 1.2.181
- '@swc/core-linux-x64-gnu': 1.2.181
- '@swc/core-linux-x64-musl': 1.2.181
- '@swc/core-win32-arm64-msvc': 1.2.181
- '@swc/core-win32-ia32-msvc': 1.2.181
- '@swc/core-win32-x64-msvc': 1.2.181
+ '@swc/core-android-arm-eabi': 1.2.182
+ '@swc/core-android-arm64': 1.2.182
+ '@swc/core-darwin-arm64': 1.2.182
+ '@swc/core-darwin-x64': 1.2.182
+ '@swc/core-freebsd-x64': 1.2.182
+ '@swc/core-linux-arm-gnueabihf': 1.2.182
+ '@swc/core-linux-arm64-gnu': 1.2.182
+ '@swc/core-linux-arm64-musl': 1.2.182
+ '@swc/core-linux-x64-gnu': 1.2.182
+ '@swc/core-linux-x64-musl': 1.2.182
+ '@swc/core-win32-arm64-msvc': 1.2.182
+ '@swc/core-win32-ia32-msvc': 1.2.182
+ '@swc/core-win32-x64-msvc': 1.2.182
dev: true
/@szmarczak/http-timer/1.1.2:
@@ -5001,7 +5002,7 @@ packages:
/@types/babel__generator/7.6.3:
resolution: {integrity: sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==}
dependencies:
- '@babel/types': 7.16.0
+ '@babel/types': 7.17.0
dev: true
/@types/babel__generator/7.6.4:
@@ -5013,7 +5014,7 @@ packages:
/@types/babel__template/7.4.1:
resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==}
dependencies:
- '@babel/parser': 7.17.9
+ '@babel/parser': 7.16.2
'@babel/types': 7.17.0
dev: true
@@ -5027,7 +5028,7 @@ packages:
resolution: {integrity: sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==}
dependencies:
'@types/connect': 3.4.34
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
dev: true
/@types/browserslist/4.15.0:
@@ -5042,7 +5043,7 @@ packages:
dependencies:
'@types/http-cache-semantics': 4.0.1
'@types/keyv': 3.1.3
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
'@types/responselike': 1.0.0
dev: true
@@ -5093,6 +5094,12 @@ packages:
resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==}
dev: true
+ /@types/engine.io/3.1.7:
+ resolution: {integrity: sha512-qNjVXcrp+1sS8YpRUa714r0pgzOwESdW5UjHL7D/2ZFdBX0BXUXtg1LUrp+ylvqbvMcMWUy73YpRoxPN2VoKAQ==}
+ dependencies:
+ '@types/node': 17.0.24
+ dev: true
+
/@types/eslint/7.29.0:
resolution: {integrity: sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==}
dependencies:
@@ -5123,7 +5130,7 @@ packages:
/@types/express-serve-static-core/4.17.24:
resolution: {integrity: sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
'@types/qs': 6.9.7
'@types/range-parser': 1.2.4
dev: true
@@ -5172,7 +5179,7 @@ packages:
/@types/http-proxy/1.17.7:
resolution: {integrity: sha512-9hdj6iXH64tHSLTY+Vt2eYOGzSogC+JQ2H7bdPWkuh7KXP5qLllWx++t+K9Wk556c3dkDdPws/SpMRi0sdCT1w==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
dev: false
/@types/httpsnippet/1.23.1:
@@ -5231,7 +5238,7 @@ packages:
/@types/keyv/3.1.3:
resolution: {integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
dev: true
/@types/less/3.0.2:
@@ -5282,10 +5289,6 @@ packages:
/@types/node/17.0.24:
resolution: {integrity: sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==}
- /@types/node/17.0.31:
- resolution: {integrity: sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==}
- dev: true
-
/@types/node/17.0.6:
resolution: {integrity: sha512-+XBAjfZmmivILUzO0HwBJoYkAyyySSLg5KCGBDFLomJo0sV6szvVLAf4ANZZ0pfWzgEds5KmGLG9D5hfEqOhaA==}
@@ -5342,7 +5345,7 @@ packages:
/@types/responselike/1.0.0:
resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
dev: true
/@types/sass-loader/8.0.1:
@@ -5362,7 +5365,7 @@ packages:
/@types/sax/1.2.3:
resolution: {integrity: sha512-+QSw6Tqvs/KQpZX8DvIl3hZSjNFLW/OqE5nlyHXtTwODaJvioN2rOWpBNEWZp2HZUFhOh+VohmJku/WxEXU2XA==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
dev: false
/@types/semver/7.3.9:
@@ -5376,6 +5379,38 @@ packages:
'@types/node': 17.0.6
dev: true
+ /@types/socket.io-client/1.4.36:
+ resolution: {integrity: sha512-ZJWjtFBeBy1kRSYpVbeGYTElf6BqPQUkXDlHHD4k/42byCN5Rh027f4yARHCink9sKAkbtGZXEAmR0ZCnc2/Ag==}
+ dev: true
+
+ /@types/socket.io-parser/3.0.0:
+ resolution: {integrity: sha512-Ry/rbTE6HQNL9eu3LpL1Ocup5VexXu1bSSGlSho/IR5LuRc8YvxwSNJ3JxqTltVJEATLbZkMQETSbxfKNgp4Ew==}
+ deprecated: This is a stub types definition. socket.io-parser provides its own type definitions, so you do not need this installed.
+ dependencies:
+ socket.io-parser: 4.1.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@types/socket.io/2.1.13:
+ resolution: {integrity: sha512-JRgH3nCgsWel4OPANkhH8TelpXvacAJ9VeryjuqCDiaVDMpLysd6sbt0dr6Z15pqH3p2YpOT3T1C5vQ+O/7uyg==}
+ dependencies:
+ '@types/engine.io': 3.1.7
+ '@types/node': 17.0.24
+ '@types/socket.io-parser': 3.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
+ /@types/socketio-wildcard/2.0.4:
+ resolution: {integrity: sha512-02BK7Bf3stIcvKXWjRFtPgCOMYi4KWhASPhVzkYpZOR9qQbtj7xBJEPi0fkksDJeqeRXCF23azFEOaRBXuUCNA==}
+ dependencies:
+ '@types/socket.io': 2.1.13
+ '@types/socket.io-client': 1.4.36
+ transitivePeerDependencies:
+ - supports-color
+ dev: true
+
/@types/source-list-map/0.1.2:
resolution: {integrity: sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==}
@@ -5484,7 +5519,7 @@ packages:
/@types/webpack/4.41.31:
resolution: {integrity: sha512-/i0J7sepXFIp1ZT7FjUGi1eXMCg8HCCzLJEQkKsOtbJFontsJLolBcDC+3qxn5pPwiCt1G0ZdRmYRzNBtvpuGQ==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
'@types/tapable': 1.0.8
'@types/uglify-js': 3.13.1
'@types/webpack-sources': 3.2.0
@@ -5495,7 +5530,7 @@ packages:
/@types/websocket/1.0.4:
resolution: {integrity: sha512-qn1LkcFEKK8RPp459jkjzsfpbsx36BBt3oC3pITYtkoBw/aVX+EZFa5j3ThCRTNpLFvIMr5dSTD4RaMdilIOpA==}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
/@types/websocket/1.0.5:
resolution: {integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==}
@@ -5696,7 +5731,7 @@ packages:
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
- semver: 7.3.6
+ semver: 7.3.7
typescript: 4.6.3
transitivePeerDependencies:
@@ -6672,7 +6707,7 @@ packages:
babel-plugin-istanbul: 6.1.1
babel-preset-jest: 27.5.1_@[email protected]
chalk: 4.1.2
- graceful-fs: 4.2.10
+ graceful-fs: 4.2.9
slash: 3.0.0
transitivePeerDependencies:
- supports-color
@@ -6944,7 +6979,7 @@ packages:
dev: true
/backo2/1.0.2:
- resolution: {integrity: sha1-MasayLEpNjRj41s+u2n038+6eUc=}
+ resolution: {integrity: sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==}
/balanced-match/1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
@@ -7153,6 +7188,17 @@ packages:
picocolors: 1.0.0
dev: true
+ /browserslist/4.19.1:
+ resolution: {integrity: sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+ dependencies:
+ caniuse-lite: 1.0.30001311
+ electron-to-chromium: 1.4.68
+ escalade: 3.1.1
+ node-releases: 2.0.2
+ picocolors: 1.0.0
+
/browserslist/4.20.0:
resolution: {integrity: sha512-bnpOoa+DownbciXj0jVGENf8VYQnE2LNWomhYuCsMmmx9Jd9lwq0WXODuwpSsp8AVdKM2/HorrzxAfbKvWTByQ==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
@@ -7230,16 +7276,6 @@ packages:
resolution: {integrity: sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=}
dev: false
- /bundle-require/[email protected]:
- resolution: {integrity: sha512-VXG6epB1yrLAvWVQpl92qF347/UXmncQj7J3U8kZEbdVZ1ZkQyr4hYeL/9RvcE8vVVdp53dY78Fd/3pqfRqI1A==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
- peerDependencies:
- esbuild: '>=0.13'
- dependencies:
- esbuild: 0.14.34
- load-tsconfig: 0.2.3
- dev: true
-
/bundle-require/[email protected]:
resolution: {integrity: sha512-VXG6epB1yrLAvWVQpl92qF347/UXmncQj7J3U8kZEbdVZ1ZkQyr4hYeL/9RvcE8vVVdp53dY78Fd/3pqfRqI1A==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@@ -7455,6 +7491,9 @@ packages:
/caniuse-lite/1.0.30001274:
resolution: {integrity: sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew==}
+ /caniuse-lite/1.0.30001311:
+ resolution: {integrity: sha512-mleTFtFKfykEeW34EyfhGIFjGCqzhh38Y0LhdQ9aWF+HorZTtdgKV/1hEE0NlFkG2ubvisPV6l400tlbPys98A==}
+
/caniuse-lite/1.0.30001315:
resolution: {integrity: sha512-5v7LFQU4Sb/qvkz7JcZkvtSH1Ko+1x2kgo3ocdBeMGZSOFpuE1kkm0kpTwLtWeFrw5qw08ulLxJjVIXIS8MkiQ==}
@@ -8058,7 +8097,7 @@ packages:
/core-js-compat/3.20.3:
resolution: {integrity: sha512-c8M5h0IkNZ+I92QhIpuSijOxGAcj3lgpsWdkCqmUTZNwidujF4r3pi6x1DCN+Vcs5qTS2XWWMfWSuCqyupX8gw==}
dependencies:
- browserslist: 4.20.2
+ browserslist: 4.19.1
semver: 7.0.0
/core-js/2.6.12:
@@ -8084,7 +8123,7 @@ packages:
dependencies:
'@iarna/toml': 2.2.5
- /cosmiconfig-typescript-loader/1.0.9_kpiehm6dkipypriomyghl2wcpq:
+ /cosmiconfig-typescript-loader/1.0.9_c6ucwwwirjo6ockovr3lj3o2cm:
resolution: {integrity: sha512-tRuMRhxN4m1Y8hP9SNYfz7jRwt8lZdWxdjg/ohg5esKmsndJIn4yT96oJVcf5x0eA11taXl+sIp+ielu529k6g==}
engines: {node: '>=12', npm: '>=6'}
peerDependencies:
@@ -8093,8 +8132,8 @@ packages:
dependencies:
'@types/node': 17.0.24
cosmiconfig: 7.0.1
- ts-node: 10.7.0_kpiehm6dkipypriomyghl2wcpq
- typescript: 4.6.4
+ ts-node: 10.7.0_c6ucwwwirjo6ockovr3lj3o2cm
+ typescript: 4.6.3
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@@ -8716,10 +8755,6 @@ packages:
is-descriptor: 1.0.2
isobject: 3.0.1
- /defu/2.0.4:
- resolution: {integrity: sha512-G9pEH1UUMxShy6syWk01VQSRVs3CDWtlxtZu7A+NyqjxaCA4gSlWAKDBx6QiUEKezqS8+DUlXLI14Fp05Hmpwg==}
- dev: false
-
/defu/3.2.2:
resolution: {integrity: sha512-8UWj5lNv7HD+kB0e9w77Z7TdQlbUYDVWqITLHNqFIn6khrNHv5WQo38Dcm1f6HeNyZf0U7UbPf6WeZDSdCzGDQ==}
dev: true
@@ -8737,7 +8772,6 @@ packages:
/defu/6.0.0:
resolution: {integrity: sha512-t2MZGLf1V2rV4VBZbWIaXKdX/mUcYW0n2znQZoADBkGGxYL8EWqCuCZBmJPJ/Yy9fofJkyuuSuo5GSwo0XdEgw==}
- dev: true
/delayed-stream/1.0.0:
resolution: {integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=}
@@ -8763,13 +8797,8 @@ packages:
minimalistic-assert: 1.0.1
dev: false
- /destr/1.1.0:
- resolution: {integrity: sha512-Ev/sqS5AzzDwlpor/5wFCDu0dYMQu/0x2D6XfAsQ0E7uQmamIgYJ6Dppo2T2EOFVkeVYWjc+PCLKaqZZ57qmLg==}
- dev: false
-
/destr/1.1.1:
resolution: {integrity: sha512-QqkneF8LrYmwATMdnuD2MLI3GHQIcBnG6qFC2q9bSH430VTCDAVjcspPmUaKhPGtAtPAftIUFqY1obQYQuwmbg==}
- dev: true
/destroy/1.0.4:
resolution: {integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=}
@@ -9021,6 +9050,9 @@ packages:
/electron-to-chromium/1.4.111:
resolution: {integrity: sha512-/s3+fwhKf1YK4k7btOImOzCQLpUjS6MaPf0ODTNuT4eTM1Bg4itBpLkydhOzJmpmH6Z9eXFyuuK5czsmzRzwtw==}
+ /electron-to-chromium/1.4.68:
+ resolution: {integrity: sha512-cId+QwWrV8R1UawO6b9BR1hnkJ4EJPCPAr4h315vliHUtVUJDk39Sg1PMNnaWKfj5x+93ssjeJ9LKL6r8LaMiA==}
+
/electron-to-chromium/1.4.82:
resolution: {integrity: sha512-Ks+ANzLoIrFDUOJdjxYMH6CMKB8UQo5modAwvSZTxgF+vEs/U7G5IbWFUp6dS4klPkTDVdxbORuk8xAXXhMsWw==}
@@ -9150,7 +9182,7 @@ packages:
resolution: {integrity: sha1-oRXDJQS2MC6Fp2Jp16V8zdli41k=}
engines: {node: '>=0.6'}
dependencies:
- graceful-fs: 4.2.8
+ graceful-fs: 4.2.10
memory-fs: 0.3.0
object-assign: 4.1.1
tapable: 0.2.9
@@ -9226,15 +9258,6 @@ packages:
is-date-object: 1.0.5
is-symbol: 1.0.4
- /esbuild-android-64/0.14.34:
- resolution: {integrity: sha512-XfxcfJqmMYsT/LXqrptzFxmaR3GWzXHDLdFNIhm6S00zPaQF1TBBWm+9t0RZ6LRR7iwH57DPjaOeW20vMqI4Yw==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [android]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-android-64/0.14.36:
resolution: {integrity: sha512-jwpBhF1jmo0tVCYC/ORzVN+hyVcNZUWuozGcLHfod0RJCedTDTvR4nwlTXdx1gtncDqjk33itjO+27OZHbiavw==}
engines: {node: '>=12'}
@@ -9243,15 +9266,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-android-arm64/0.14.34:
- resolution: {integrity: sha512-T02+NXTmSRL1Mc6puz+R9CB54rSPICkXKq6+tw8B6vxZFnCPzbJxgwIX4kcluz9p8nYBjF3+lSilTGWb7+Xgew==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [android]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-android-arm64/0.14.36:
resolution: {integrity: sha512-/hYkyFe7x7Yapmfv4X/tBmyKnggUmdQmlvZ8ZlBnV4+PjisrEhAvC3yWpURuD9XoB8Wa1d5dGkTsF53pIvpjsg==}
engines: {node: '>=12'}
@@ -9260,15 +9274,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-darwin-64/0.14.34:
- resolution: {integrity: sha512-pLRip2Bh4Ng7Bf6AMgCrSp3pPe/qZyf11h5Qo2mOfJqLWzSVjxrXW+CFRJfrOVP7TCnh/gmZSM2AFdCPB72vtw==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [darwin]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-darwin-64/0.14.36:
resolution: {integrity: sha512-kkl6qmV0dTpyIMKagluzYqlc1vO0ecgpviK/7jwPbRDEv5fejRTaBBEE2KxEQbTHcLhiiDbhG7d5UybZWo/1zQ==}
engines: {node: '>=12'}
@@ -9277,15 +9282,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-darwin-arm64/0.14.34:
- resolution: {integrity: sha512-vpidSJEBxx6lf1NWgXC+DCmGqesJuZ5Y8aQVVsaoO4i8tRXbXb0whChRvop/zd3nfNM4dIl5EXAky0knRX5I6w==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [darwin]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-darwin-arm64/0.14.36:
resolution: {integrity: sha512-q8fY4r2Sx6P0Pr3VUm//eFYKVk07C5MHcEinU1BjyFnuYz4IxR/03uBbDwluR6ILIHnZTE7AkTUWIdidRi1Jjw==}
engines: {node: '>=12'}
@@ -9294,15 +9290,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-freebsd-64/0.14.34:
- resolution: {integrity: sha512-m0HBjePhe0hAQJgtMRMNV9kMgIyV4/qSnzPx42kRMQBcPhgjAq1JRu4Il26czC+9FgpMbFkUktb07f/Lwnc6CA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [freebsd]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-freebsd-64/0.14.36:
resolution: {integrity: sha512-Hn8AYuxXXRptybPqoMkga4HRFE7/XmhtlQjXFHoAIhKUPPMeJH35GYEUWGbjteai9FLFvBAjEAlwEtSGxnqWww==}
engines: {node: '>=12'}
@@ -9311,15 +9298,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-freebsd-arm64/0.14.34:
- resolution: {integrity: sha512-cpRc2B94L1KvMPPYB4D6G39jLqpKlD3noAMY4/e86iXXXkhUYJJEtTuyNFTa9JRpWM0xCAp4mxjHjoIiLuoCLA==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [freebsd]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-freebsd-arm64/0.14.36:
resolution: {integrity: sha512-S3C0attylLLRiCcHiJd036eDEMOY32+h8P+jJ3kTcfhJANNjP0TNBNL30TZmEdOSx/820HJFgRrqpNAvTbjnDA==}
engines: {node: '>=12'}
@@ -9328,15 +9306,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-32/0.14.34:
- resolution: {integrity: sha512-8nQaEaoW7MH/K/RlozJa+lE1ejHIr8fuPIHhc513UebRav7HtXgQvxHQ6VZRUkWtep23M6dd7UqhwO1tMOfzQQ==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-32/0.14.36:
resolution: {integrity: sha512-Eh9OkyTrEZn9WGO4xkI3OPPpUX7p/3QYvdG0lL4rfr73Ap2HAr6D9lP59VMF64Ex01LhHSXwIsFG/8AQjh6eNw==}
engines: {node: '>=12'}
@@ -9345,15 +9314,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-64/0.14.34:
- resolution: {integrity: sha512-Y3of4qQoLLlAgf042MlrY1P+7PnN9zWj8nVtw9XQG5hcLOZLz7IKpU35oeu7n4wvyaZHwvQqDJ93gRLqdJekcQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-64/0.14.36:
resolution: {integrity: sha512-vFVFS5ve7PuwlfgoWNyRccGDi2QTNkQo/2k5U5ttVD0jRFaMlc8UQee708fOZA6zTCDy5RWsT5MJw3sl2X6KDg==}
engines: {node: '>=12'}
@@ -9362,15 +9322,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-arm/0.14.34:
- resolution: {integrity: sha512-9lpq1NcJqssAF7alCO6zL3gvBVVt/lKw4oetUM7OgNnRX0OWpB+ZIO9FwCrSj/dMdmgDhPLf+119zB8QxSMmAg==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-arm/0.14.36:
resolution: {integrity: sha512-NhgU4n+NCsYgt7Hy61PCquEz5aevI6VjQvxwBxtxrooXsxt5b2xtOUXYZe04JxqQo+XZk3d1gcr7pbV9MAQ/Lg==}
engines: {node: '>=12'}
@@ -9379,15 +9330,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-arm64/0.14.34:
- resolution: {integrity: sha512-IlWaGtj9ir7+Nrume1DGcyzBDlK8GcnJq0ANKwcI9pVw8tqr+6GD0eqyF9SF1mR8UmAp+odrx1H5NdR2cHdFHA==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-arm64/0.14.36:
resolution: {integrity: sha512-24Vq1M7FdpSmaTYuu1w0Hdhiqkbto1I5Pjyi+4Cdw5fJKGlwQuw+hWynTcRI/cOZxBcBpP21gND7W27gHAiftw==}
engines: {node: '>=12'}
@@ -9396,15 +9338,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-mips64le/0.14.34:
- resolution: {integrity: sha512-k3or+01Rska1AjUyNjA4buEwB51eyN/xPQAoOx1CjzAQC3l8rpjUDw55kXyL63O/1MUi4ISvtNtl8gLwdyEcxw==}
- engines: {node: '>=12'}
- cpu: [mips64el]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-mips64le/0.14.36:
resolution: {integrity: sha512-hZUeTXvppJN+5rEz2EjsOFM9F1bZt7/d2FUM1lmQo//rXh1RTFYzhC0txn7WV0/jCC7SvrGRaRz0NMsRPf8SIA==}
engines: {node: '>=12'}
@@ -9413,15 +9346,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-ppc64le/0.14.34:
- resolution: {integrity: sha512-+qxb8M9FfM2CJaVU7GgYpJOHM1ngQOx+/VrtBjb4C8oVqaPcESCeg2anjl+HRZy8VpYc71q/iBYausPPbJ+Keg==}
- engines: {node: '>=12'}
- cpu: [ppc64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-ppc64le/0.14.36:
resolution: {integrity: sha512-1Bg3QgzZjO+QtPhP9VeIBhAduHEc2kzU43MzBnMwpLSZ890azr4/A9Dganun8nsqD/1TBcqhId0z4mFDO8FAvg==}
engines: {node: '>=12'}
@@ -9430,15 +9354,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-riscv64/0.14.34:
- resolution: {integrity: sha512-Y717ltBdQ5j5sZIHdy1DV9kieo0wMip0dCmVSTceowCPYSn1Cg33Kd6981+F/3b9FDMzNWldZFOBRILViENZSA==}
- engines: {node: '>=12'}
- cpu: [riscv64]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-riscv64/0.14.36:
resolution: {integrity: sha512-dOE5pt3cOdqEhaufDRzNCHf5BSwxgygVak9UR7PH7KPVHwSTDAZHDoEjblxLqjJYpc5XaU9+gKJ9F8mp9r5I4A==}
engines: {node: '>=12'}
@@ -9447,15 +9362,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-linux-s390x/0.14.34:
- resolution: {integrity: sha512-bDDgYO4LhL4+zPs+WcBkXph+AQoPcQRTv18FzZS0WhjfH8TZx2QqlVPGhmhZ6WidrY+jKthUqO6UhGyIb4MpmA==}
- engines: {node: '>=12'}
- cpu: [s390x]
- os: [linux]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-linux-s390x/0.14.36:
resolution: {integrity: sha512-g4FMdh//BBGTfVHjF6MO7Cz8gqRoDPzXWxRvWkJoGroKA18G9m0wddvPbEqcQf5Tbt2vSc1CIgag7cXwTmoTXg==}
engines: {node: '>=12'}
@@ -9464,15 +9370,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-netbsd-64/0.14.34:
- resolution: {integrity: sha512-cfaFGXdRt0+vHsjNPyF0POM4BVSHPSbhLPe8mppDc7GDDxjIl08mV1Zou14oDWMp/XZMjYN1kWYRSfftiD0vvQ==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [netbsd]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-netbsd-64/0.14.36:
resolution: {integrity: sha512-UB2bVImxkWk4vjnP62ehFNZ73lQY1xcnL5ZNYF3x0AG+j8HgdkNF05v67YJdCIuUJpBuTyCK8LORCYo9onSW+A==}
engines: {node: '>=12'}
@@ -9481,15 +9378,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-openbsd-64/0.14.34:
- resolution: {integrity: sha512-vmy9DxXVnRiI14s8GKuYBtess+EVcDALkbpTqd5jw4XITutIzyB7n4x0Tj5utAkKsgZJB22lLWGekr0ABnSLow==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [openbsd]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-openbsd-64/0.14.36:
resolution: {integrity: sha512-NvGB2Chf8GxuleXRGk8e9zD3aSdRO5kLt9coTQbCg7WMGXeX471sBgh4kSg8pjx0yTXRt0MlrUDnjVYnetyivg==}
engines: {node: '>=12'}
@@ -9498,15 +9386,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-sunos-64/0.14.34:
- resolution: {integrity: sha512-eNPVatNET1F7tRMhii7goL/eptfxc0ALRjrj9SPFNqp0zmxrehBFD6BaP3R4LjMn6DbMO0jOAnTLFKr8NqcJAA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [sunos]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-sunos-64/0.14.36:
resolution: {integrity: sha512-VkUZS5ftTSjhRjuRLp+v78auMO3PZBXu6xl4ajomGenEm2/rGuWlhFSjB7YbBNErOchj51Jb2OK8lKAo8qdmsQ==}
engines: {node: '>=12'}
@@ -9515,15 +9394,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-windows-32/0.14.34:
- resolution: {integrity: sha512-EFhpXyHEcnqWYe2rAHFd8dRw8wkrd9U+9oqcyoEL84GbanAYjiiIjBZsnR8kl0sCQ5w6bLpk7vCEIA2VS32Vcg==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-windows-32/0.14.36:
resolution: {integrity: sha512-bIar+A6hdytJjZrDxfMBUSEHHLfx3ynoEZXx/39nxy86pX/w249WZm8Bm0dtOAByAf4Z6qV0LsnTIJHiIqbw0w==}
engines: {node: '>=12'}
@@ -9532,15 +9402,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-windows-64/0.14.34:
- resolution: {integrity: sha512-a8fbl8Ky7PxNEjf1aJmtxdDZj32/hC7S1OcA2ckEpCJRTjiKslI9vAdPpSjrKIWhws4Galpaawy0nB7fjHYf5Q==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-windows-64/0.14.36:
resolution: {integrity: sha512-+p4MuRZekVChAeueT1Y9LGkxrT5x7YYJxYE8ZOTcEfeUUN43vktSn6hUNsvxzzATrSgq5QqRdllkVBxWZg7KqQ==}
engines: {node: '>=12'}
@@ -9549,15 +9410,6 @@ packages:
requiresBuild: true
optional: true
- /esbuild-windows-arm64/0.14.34:
- resolution: {integrity: sha512-EYvmKbSa2B3sPnpC28UEu9jBK5atGV4BaVRE7CYGUci2Hlz4AvtV/LML+TcDMT6gBgibnN2gcltWclab3UutMg==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [win32]
- requiresBuild: true
- dev: true
- optional: true
-
/esbuild-windows-arm64/0.14.36:
resolution: {integrity: sha512-fBB4WlDqV1m18EF/aheGYQkQZHfPHiHJSBYzXIo8yKehek+0BtBwo/4PNwKGJ5T0YK0oc8pBKjgwPbzSrPLb+Q==}
engines: {node: '>=12'}
@@ -9572,34 +9424,6 @@ packages:
requiresBuild: true
dev: true
- /esbuild/0.14.34:
- resolution: {integrity: sha512-QIWdPT/gFF6hCaf4m7kP0cJ+JIuFkdHibI7vVFvu3eJS1HpVmYHWDulyN5WXwbRA0SX/7ZDaJ/1DH8SdY9xOJg==}
- engines: {node: '>=12'}
- hasBin: true
- requiresBuild: true
- optionalDependencies:
- esbuild-android-64: 0.14.34
- esbuild-android-arm64: 0.14.34
- esbuild-darwin-64: 0.14.34
- esbuild-darwin-arm64: 0.14.34
- esbuild-freebsd-64: 0.14.34
- esbuild-freebsd-arm64: 0.14.34
- esbuild-linux-32: 0.14.34
- esbuild-linux-64: 0.14.34
- esbuild-linux-arm: 0.14.34
- esbuild-linux-arm64: 0.14.34
- esbuild-linux-mips64le: 0.14.34
- esbuild-linux-ppc64le: 0.14.34
- esbuild-linux-riscv64: 0.14.34
- esbuild-linux-s390x: 0.14.34
- esbuild-netbsd-64: 0.14.34
- esbuild-openbsd-64: 0.14.34
- esbuild-sunos-64: 0.14.34
- esbuild-windows-32: 0.14.34
- esbuild-windows-64: 0.14.34
- esbuild-windows-arm64: 0.14.34
- dev: true
-
/esbuild/0.14.36:
resolution: {integrity: sha512-HhFHPiRXGYOCRlrhpiVDYKcFJRdO0sBElZ668M4lh2ER0YgnkLxECuFe7uWCf23FrcLc59Pqr7dHkTqmRPDHmw==}
engines: {node: '>=12'}
@@ -9847,7 +9671,7 @@ packages:
read-pkg-up: 7.0.1
regexp-tree: 0.1.24
safe-regex: 2.1.1
- semver: 7.3.6
+ semver: 7.3.7
strip-indent: 3.0.0
dev: true
@@ -10210,16 +10034,6 @@ packages:
merge2: 1.4.1
micromatch: 4.0.5
- /fast-glob/3.2.7:
- resolution: {integrity: sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==}
- engines: {node: '>=8'}
- dependencies:
- '@nodelib/fs.stat': 2.0.5
- '@nodelib/fs.walk': 1.2.8
- glob-parent: 5.1.2
- merge2: 1.4.1
- micromatch: 4.0.4
-
/fast-json-stable-stringify/2.1.0:
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
@@ -10908,7 +10722,7 @@ packages:
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
- fast-glob: 3.2.7
+ fast-glob: 3.2.11
ignore: 5.2.0
merge2: 1.4.1
slash: 3.0.0
@@ -12749,7 +12563,7 @@ packages:
jest-util: 27.5.1
natural-compare: 1.4.0
pretty-format: 27.5.1
- semver: 7.3.6
+ semver: 7.3.7
transitivePeerDependencies:
- supports-color
dev: true
@@ -12771,7 +12585,7 @@ packages:
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
dependencies:
'@jest/types': 28.1.0
- '@types/node': 17.0.31
+ '@types/node': 17.0.24
chalk: 4.1.2
ci-info: 3.3.0
graceful-fs: 4.2.10
@@ -12807,7 +12621,7 @@ packages:
resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==}
engines: {node: '>= 10.13.0'}
dependencies:
- '@types/node': 17.0.18
+ '@types/node': 17.0.24
merge-stream: 2.0.0
supports-color: 7.2.0
dev: false
@@ -13597,6 +13411,7 @@ packages:
/lru-cache/7.8.1:
resolution: {integrity: sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==}
engines: {node: '>=12'}
+ dev: true
/lru_map/0.3.3:
resolution: {integrity: sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=}
@@ -13964,9 +13779,6 @@ packages:
kind-of: 6.0.3
dev: true
- /minimist/1.2.5:
- resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==}
-
/minimist/1.2.6:
resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
@@ -14054,13 +13866,6 @@ packages:
mkdirp: '>=0.5.0'
dev: false
- /mkdirp/0.5.5:
- resolution: {integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==}
- hasBin: true
- dependencies:
- minimist: 1.2.6
- dev: false
-
/mkdirp/0.5.6:
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
hasBin: true
@@ -14452,7 +14257,7 @@ packages:
/nuxt-windicss/2.2.11:
resolution: {integrity: sha512-xobq725D6vqpIgYOrLJ6CVlR4xLlFGwuq//gZikXKOdoVRpoK8C+NpHazPd4+f17urGQ4H0LqGBCIujTvV1V0g==}
dependencies:
- '@nuxt/kit': /@nuxt/kit-edge/3.0.0-rc.3-27536597.3359b3b
+ '@nuxt/kit': /@nuxt/kit-edge/3.0.0-rc.3-27545866.cd37a21
'@windicss/plugin-utils': 1.8.4
consola: 2.15.3
defu: 6.0.0
@@ -16189,21 +15994,12 @@ packages:
strip-json-comments: 2.0.1
dev: true
- /rc9/1.2.0:
- resolution: {integrity: sha512-/jknmhG0USFAx5uoKkAKhtG40sONds9RWhFHrP1UzJ3OvVfqFWOypSUpmsQD0fFwAV7YtzHhsn3QNasfAoxgcQ==}
- dependencies:
- defu: 2.0.4
- destr: 1.1.0
- flat: 5.0.2
- dev: false
-
/rc9/1.2.2:
resolution: {integrity: sha512-zbe8+HR2X28eZepAwohuKkebbEsA67h0DO9I7g12QrHa2CQopR9gztOLPIPXXGTvcxeUjAN4wZ+b29t3m/u05g==}
dependencies:
defu: 6.0.0
destr: 1.1.1
flat: 5.0.2
- dev: true
/react-is/17.0.2:
resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
@@ -16641,14 +16437,6 @@ packages:
typescript: 4.6.3
dev: true
- /rollup/2.70.1:
- resolution: {integrity: sha512-CRYsI5EuzLbXdxC6RnYhOuRdtz4bhejPMSWjsFLfVM/7w/85n2szZv6yExqUXsBdz5KT8eoubeyDUDjhLHEslA==}
- engines: {node: '>=10.0.0'}
- hasBin: true
- optionalDependencies:
- fsevents: 2.3.2
- dev: true
-
/rollup/2.70.2:
resolution: {integrity: sha512-EitogNZnfku65I1DD5Mxe8JYRUCy0hkK5X84IlDtUs+O6JRMpRciXTzyCUuX11b5L5pvjH+OmFXiQ3XjabcXgg==}
engines: {node: '>=10.0.0'}
@@ -16868,6 +16656,7 @@ packages:
hasBin: true
dependencies:
lru-cache: 7.8.1
+ dev: true
/semver/7.3.7:
resolution: {integrity: sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==}
@@ -17223,7 +17012,6 @@ packages:
debug: 4.3.4
transitivePeerDependencies:
- supports-color
- dev: false
/socketio-wildcard/2.0.0:
resolution: {integrity: sha1-JGboMidrGRY1Y77ncjiHR/kSR1s=}
@@ -18370,7 +18158,7 @@ packages:
json5: 2.2.1
lodash.memoize: 4.1.2
make-error: 1.3.6
- semver: 7.3.6
+ semver: 7.3.7
typescript: 4.6.3
yargs-parser: 20.2.9
dev: true
@@ -18404,7 +18192,7 @@ packages:
json5: 2.2.1
lodash.memoize: 4.1.2
make-error: 1.3.6
- semver: 7.3.6
+ semver: 7.3.7
typescript: 4.6.4
yargs-parser: 20.2.9
dev: true
@@ -18438,7 +18226,7 @@ packages:
json5: 2.2.1
lodash.memoize: 4.1.2
make-error: 1.3.6
- semver: 7.3.6
+ semver: 7.3.7
typescript: 4.6.3
yargs-parser: 20.2.9
dev: true
@@ -18462,7 +18250,7 @@ packages:
resolution: {integrity: sha512-DEQrfv6l7IvN2jlzc/VTdZJYsWUnQNCsueYjMkC/iXoEoi5fNan6MjeDqkvhfzbmHgdz9UxDUluX3V5HdjTydQ==}
dev: true
- /ts-node/10.7.0_kpiehm6dkipypriomyghl2wcpq:
+ /ts-node/10.7.0_c6ucwwwirjo6ockovr3lj3o2cm:
resolution: {integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==}
hasBin: true
peerDependencies:
@@ -18488,7 +18276,7 @@ packages:
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
- typescript: 4.6.4
+ typescript: 4.6.3
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: true
@@ -18525,7 +18313,7 @@ packages:
dependencies:
'@types/json5': 0.0.29
json5: 1.0.1
- minimist: 1.2.5
+ minimist: 1.2.6
strip-bom: 3.0.0
dev: true
@@ -18582,17 +18370,17 @@ packages:
typescript:
optional: true
dependencies:
- bundle-require: [email protected]
+ bundle-require: [email protected]
cac: 6.7.12
chokidar: 3.5.3
debug: 4.3.4
- esbuild: 0.14.34
+ esbuild: 0.14.36
execa: 5.1.1
globby: 11.1.0
joycon: 3.1.1
postcss-load-config: 3.1.4
resolve-from: 5.0.0
- rollup: 2.70.1
+ rollup: 2.70.2
source-map: 0.7.3
sucrase: 3.21.0
tree-kill: 1.2.2
@@ -18734,7 +18522,7 @@ packages:
acorn: 8.7.0
estree-walker: 2.0.2
magic-string: 0.26.1
- unplugin: 0.6.2
+ unplugin: 0.6.3
transitivePeerDependencies:
- esbuild
- rollup
@@ -18901,28 +18689,6 @@ packages:
webpack-virtual-modules: 0.4.3
dev: false
- /unplugin/0.6.2:
- resolution: {integrity: sha512-+QONc2uBFQbeo4x5mlJHjTKjR6pmuchMpGVrWhwdGFFMb4ttFZ4E9KqhOOrNcm3Q8NNyB1vJ4s5e36IZC7UWYw==}
- peerDependencies:
- esbuild: '>=0.13'
- rollup: ^2.50.0
- vite: ^2.3.0
- webpack: 4 || 5
- peerDependenciesMeta:
- esbuild:
- optional: true
- rollup:
- optional: true
- vite:
- optional: true
- webpack:
- optional: true
- dependencies:
- chokidar: 3.5.3
- webpack-sources: 3.2.3
- webpack-virtual-modules: 0.4.3
- dev: true
-
/unplugin/0.6.3:
resolution: {integrity: sha512-CoW88FQfCW/yabVc4bLrjikN9HC8dEvMU4O7B6K2jsYMPK0l6iAnd9dpJwqGcmXJKRCU9vwSsy653qg+RK0G6A==}
peerDependencies: