diff --git a/packages/hoppscotch-selfhost-desktop/.sitemap-gen/sitemap.xml b/packages/hoppscotch-selfhost-desktop/.sitemap-gen/sitemap.xml index d2df7e305..b2692b2ab 100644 --- a/packages/hoppscotch-selfhost-desktop/.sitemap-gen/sitemap.xml +++ b/packages/hoppscotch-selfhost-desktop/.sitemap-gen/sitemap.xml @@ -1 +1 @@ -http://localhost:3000/settings2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/realtime2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/realtime/websocket2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/realtime/sse2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/realtime/socketio2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/realtime/mqtt2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/profile2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/join-team2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/import2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/graphql2023-10-11T06:31:17.965Zdaily1.0http://localhost:3000/enter2023-10-11T06:31:17.965Zdaily1.0 \ No newline at end of file +http://localhost:3000/settings2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/realtime2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/realtime/websocket2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/realtime/sse2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/realtime/socketio2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/realtime/mqtt2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/profile2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/join-team2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/import2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/graphql2023-10-11T08:05:53.439Zdaily1.0http://localhost:3000/enter2023-10-11T08:05:53.439Zdaily1.0 \ No newline at end of file diff --git a/packages/hoppscotch-selfhost-desktop/package.json b/packages/hoppscotch-selfhost-desktop/package.json index 3367c5972..101a687f9 100644 --- a/packages/hoppscotch-selfhost-desktop/package.json +++ b/packages/hoppscotch-selfhost-desktop/package.json @@ -34,6 +34,7 @@ "devDependencies": { "@intlify/vite-plugin-vue-i18n": "^6.0.1", "@rushstack/eslint-patch": "^1.1.4", + "@types/lodash-es": "^4.17.9", "@types/node": "^18.7.10", "@typescript-eslint/eslint-plugin": "^5.19.0", "@typescript-eslint/parser": "^5.19.0", diff --git a/packages/hoppscotch-selfhost-desktop/src-tauri/src/main.rs b/packages/hoppscotch-selfhost-desktop/src-tauri/src/main.rs index 8d5d2358e..8bc4066c9 100644 --- a/packages/hoppscotch-selfhost-desktop/src-tauri/src/main.rs +++ b/packages/hoppscotch-selfhost-desktop/src-tauri/src/main.rs @@ -35,7 +35,7 @@ fn main() { tauri_plugin_deep_link::register( "hoppscotch", move |request| { - println!("{:?}", request); + println!("{:?}", request); handle.emit_all("scheme-request-received", request).unwrap(); }, ).unwrap(); diff --git a/packages/hoppscotch-selfhost-desktop/src/main.ts b/packages/hoppscotch-selfhost-desktop/src/main.ts index 6eb3ceb5a..420580a08 100644 --- a/packages/hoppscotch-selfhost-desktop/src/main.ts +++ b/packages/hoppscotch-selfhost-desktop/src/main.ts @@ -5,7 +5,7 @@ import { def as collectionsDef } from "./platform/collections/collections.platfo import { def as settingsDef } from "./platform/settings/settings.platform" import { def as historyDef } from "./platform/history/history.platform" import { def as tabStateDef } from "./platform/tabState/tabState.platform" -import { localclientInterceptor } from "./platform/std/interceptors/localclient" +import { nativeInterceptor } from "./platform/interceptors/native" import { browserInterceptor } from "@hoppscotch/common/platform/std/interceptors/browser" import { proxyInterceptor } from "@hoppscotch/common/platform/std/interceptors/proxy" import { ExtensionInspectorService } from "@hoppscotch/common/platform/std/inspections/extension.inspector" @@ -40,9 +40,9 @@ createHoppApp("#app", { tabState: tabStateDef, }, interceptors: { - default: "localclient", + default: "native", interceptors: [ - { type: "standalone", interceptor: localclientInterceptor }, + { type: "standalone", interceptor: nativeInterceptor }, { type: "standalone", interceptor: browserInterceptor }, { type: "standalone", interceptor: proxyInterceptor }, { type: "service", service: ExtensionInterceptorService }, diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/auth.ts b/packages/hoppscotch-selfhost-desktop/src/platform/auth.ts index b91eb01c4..dc6e7c16f 100644 --- a/packages/hoppscotch-selfhost-desktop/src/platform/auth.ts +++ b/packages/hoppscotch-selfhost-desktop/src/platform/auth.ts @@ -15,7 +15,6 @@ import { open } from '@tauri-apps/api/shell' import { Body, getClient } from '@tauri-apps/api/http' import { listen } from '@tauri-apps/api/event' import { Store } from "tauri-plugin-store-api"; -import { P } from "@tauri-apps/api/event-41a9edf5" export const authEvents$ = new Subject() const currentUser$ = new BehaviorSubject(null) @@ -25,7 +24,7 @@ async function logout() { let client = await getClient(); await client.get(`${import.meta.env.VITE_BACKEND_API_URL}/auth/logout`) - const store = new Store("/Users/vivek/.creds.dat") + const store = new Store("/Users/vivek/.creds.dat") await store.set("refresh_token", {}) await store.set("access_token", {}) await store.save() @@ -337,7 +336,7 @@ export const def: AuthPlatformDef = { let verifyToken = getLocalConfig("verifyToken") const client = await getClient(); - let res = await client.post(`${import.meta.env.VITE_BACKEND_API_URL}/auth/verify`, Body.json({ + let res = await client.post(`${import.meta.env.VITE_BACKEND_API_URL}/auth/verify`, Body.json({ token: verifyToken, deviceIdentifier })); diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/std/interceptors/localclient.ts b/packages/hoppscotch-selfhost-desktop/src/platform/interceptors/native.ts similarity index 93% rename from packages/hoppscotch-selfhost-desktop/src/platform/std/interceptors/localclient.ts rename to packages/hoppscotch-selfhost-desktop/src/platform/interceptors/native.ts index 157a43834..751cd49f9 100644 --- a/packages/hoppscotch-selfhost-desktop/src/platform/std/interceptors/localclient.ts +++ b/packages/hoppscotch-selfhost-desktop/src/platform/interceptors/native.ts @@ -3,7 +3,7 @@ import { Interceptor, InterceptorError, RequestRunResult, -} from "../../../services/interceptor.service" +} from "@hoppscotch/common/services/interceptor.service" import axios, { AxiosRequestConfig, CancelToken } from "axios" import { cloneDeep } from "lodash-es" import { Body, HttpVerb, ResponseType, getClient } from '@tauri-apps/api/http' @@ -56,12 +56,12 @@ async function runRequest( let body_data = {} for (const entry of processedReq.data.entries()) { const [name, value] = entry; - + if (value instanceof File) { let file_data = await value.arrayBuffer() body_data[name] = { - file: new Uint8Array(file_data as number[]), + file: new Uint8Array(file_data), fileName: value.name } } @@ -123,9 +123,9 @@ async function runRequest( } } -export const localclientInterceptor: Interceptor = { - interceptorID: "localclient", - name: () => "localclient", +export const nativeInterceptor: Interceptor = { + interceptorID: "native", + name: () => "Native", selectable: { type: "selectable" }, runRequest(req) { const processedReq = preProcessRequest(req) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e8f2ac811..461fcb48e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -947,6 +947,9 @@ importers: '@rushstack/eslint-patch': specifier: ^1.1.4 version: 1.3.3 + '@types/lodash-es': + specifier: ^4.17.9 + version: 4.17.10 '@types/node': specifier: ^18.7.10 version: 18.18.8 @@ -10246,6 +10249,12 @@ packages: '@types/lodash': 4.14.200 dev: true + /@types/lodash-es@4.17.10: + resolution: {integrity: sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==} + dependencies: + '@types/lodash': 4.14.199 + dev: true + /@types/lodash-es@4.17.8: resolution: {integrity: sha512-euY3XQcZmIzSy7YH5+Unb3b2X12Wtk54YWINBvvGQ5SmMvwb11JQskGsfkH/5HXK77Kr8GF0wkVDIxzAisWtog==} dependencies: