chore: rename localclient interceptor to native

This commit is contained in:
Andrew Bastin
2023-10-11 13:41:10 +05:30
parent 4587cee189
commit 20ba4bed5d
7 changed files with 23 additions and 14 deletions

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>http://localhost:3000/settings</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/websocket</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/sse</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/socketio</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/mqtt</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/profile</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/join-team</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/import</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/graphql</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/enter</loc><lastmod>2023-10-11T06:31:17.965Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url></urlset>
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>http://localhost:3000/settings</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/websocket</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/sse</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/socketio</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/realtime/mqtt</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/profile</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/join-team</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/import</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/graphql</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url><url><loc>http://localhost:3000/enter</loc><lastmod>2023-10-11T08:05:53.439Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url></urlset>

View File

@@ -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",

View File

@@ -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();

View File

@@ -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 },

View File

@@ -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<AuthEvent | { event: "token_refresh" }>()
const currentUser$ = new BehaviorSubject<HoppUser | null>(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
}));

View File

@@ -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)