From de4635df23d4eb21db90ac5d039eb6fc4d5c5b79 Mon Sep 17 00:00:00 2001 From: Akash K <57758277+amk-dev@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:38:11 +0530 Subject: [PATCH] chore: add workspace type property in request run analytics event (#3820) Co-authored-by: Andrew Bastin --- packages/hoppscotch-common/src/components/http/Request.vue | 4 ++++ packages/hoppscotch-common/src/platform/analytics.ts | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-common/src/components/http/Request.vue b/packages/hoppscotch-common/src/components/http/Request.vue index d71ad238e..9191057ff 100644 --- a/packages/hoppscotch-common/src/components/http/Request.vue +++ b/packages/hoppscotch-common/src/components/http/Request.vue @@ -263,6 +263,7 @@ import { HoppTab } from "~/services/tab" import { HoppRESTDocument } from "~/helpers/rest/document" import { RESTTabService } from "~/services/tab/rest" import { getMethodLabelColor } from "~/helpers/rest/labelColoring" +import { WorkspaceService } from "~/services/workspace.service" const t = useI18n() const interceptorService = useService(InterceptorService) @@ -326,6 +327,8 @@ const inspectionService = useService(InspectionService) const tabs = useService(RESTTabService) +const workspaceService = useService(WorkspaceService) + const newSendRequest = async () => { if (newEndpoint.value === "" || /^\s+$/.test(newEndpoint.value)) { toast.error(`${t("empty.endpoint")}`) @@ -341,6 +344,7 @@ const newSendRequest = async () => { type: "HOPP_REQUEST_RUN", platform: "rest", strategy: interceptorService.currentInterceptorID.value!, + workspaceType: workspaceService.currentWorkspace.value.type, }) const [cancel, streamPromise] = runRESTRequest$(tab) diff --git a/packages/hoppscotch-common/src/platform/analytics.ts b/packages/hoppscotch-common/src/platform/analytics.ts index cd230cc30..60ddd4cf2 100644 --- a/packages/hoppscotch-common/src/platform/analytics.ts +++ b/packages/hoppscotch-common/src/platform/analytics.ts @@ -1,6 +1,11 @@ export type HoppRequestEvent = | { - platform: "rest" | "graphql-query" | "graphql-schema" + platform: "rest" + strategy: string + workspaceType: "personal" | "team" + } + | { + platform: "graphql-query" | "graphql-schema" strategy: string } | { platform: "wss" | "sse" | "socketio" | "mqtt" }