Skip to content

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

chore: formatting updates

James George1855faabbc4f
diff --git a/packages/hoppscotch-common/src/lib/sync/collections/gqlCollections.sync.ts b/packages/hoppscotch-common/src/lib/sync/collections/gqlCollections.sync.ts
index 8f1f1c7f0..3da8e5036 100644
--- a/packages/hoppscotch-common/src/lib/sync/collections/gqlCollections.sync.ts
+++ b/packages/hoppscotch-common/src/lib/sync/collections/gqlCollections.sync.ts
@@ -25,7 +25,11 @@ import {
import { getSettingSubject, settingsStore } from "~/newstore/settings"
import { getSyncInitFunction, StoreSyncDefinitionOf } from ".."
import { createMapper } from "../mapper"
-import { applyDuplicatedCollectionResult, moveOrReorderRequests, ensurePathSynced } from "./sync"
+import {
+ applyDuplicatedCollectionResult,
+ moveOrReorderRequests,
+ ensurePathSynced,
+} from "./sync"
import { ReqType } from "~/helpers/backend/graphql"
import { stripClientLocalValuesForWire } from "~/helpers/clientLocalVariables"
diff --git a/packages/hoppscotch-common/src/lib/sync/collections/index.ts b/packages/hoppscotch-common/src/lib/sync/collections/index.ts
index 2030655e6..a1a04ff74 100644
--- a/packages/hoppscotch-common/src/lib/sync/collections/index.ts
+++ b/packages/hoppscotch-common/src/lib/sync/collections/index.ts
@@ -385,7 +385,10 @@ async function loadUserCollections(collectionType: "REST" | "GQL") {
? restCollectionStore.value.state
: graphqlCollectionStore.value.state
- const mergedCollections = mergeCollections(localCollections, fetchedCollections)
+ const mergedCollections = mergeCollections(
+ localCollections,
+ fetchedCollections
+ )
runDispatchWithOutSyncing(() => {
collectionType == "REST"
diff --git a/packages/hoppscotch-common/src/lib/sync/collections/sync.ts b/packages/hoppscotch-common/src/lib/sync/collections/sync.ts
index 87037dbbc..ea6d0d61f 100644
--- a/packages/hoppscotch-common/src/lib/sync/collections/sync.ts
+++ b/packages/hoppscotch-common/src/lib/sync/collections/sync.ts
@@ -435,7 +435,10 @@ export async function ensurePathSynced(
if (path === null || path === undefined || path === "") return true
const collections = collectionStore.value.state
- const pathIndexes = typeof path === "number" ? [path] : path.split("/").map((index) => parseInt(index))
+ const pathIndexes =
+ typeof path === "number"
+ ? [path]
+ : path.split("/").map((index) => parseInt(index))
let highestUnsyncedPath: number[] | null = null
let parentID: string | undefined = undefined
@@ -454,14 +457,20 @@ export async function ensurePathSynced(
}
if (highestUnsyncedPath) {
- const collectionToSync = navigateToFolderWithIndexPath(collections, highestUnsyncedPath)
+ const collectionToSync = navigateToFolderWithIndexPath(
+ collections,
+ highestUnsyncedPath
+ )
if (collectionToSync) {
await recursivelySyncFn(
collectionToSync,
highestUnsyncedPath.join("/"),
parentID
)
- const targetCollection = navigateToFolderWithIndexPath(collections, pathIndexes)
+ const targetCollection = navigateToFolderWithIndexPath(
+ collections,
+ pathIndexes
+ )
return !!targetCollection?.id
}
}
@@ -652,12 +661,13 @@ export const storeSyncDefinition: StoreSyncDefinitionOf<
collections,
newSourcePath.split("/").map((index) => parseInt(index))
)
- const destCollection = destinationPath && newDestinationPath
- ? navigateToFolderWithIndexPath(
- collections,
- newDestinationPath.split("/").map((index) => parseInt(index))
- )
- : null
+ const destCollection =
+ destinationPath && newDestinationPath
+ ? navigateToFolderWithIndexPath(
+ collections,
+ newDestinationPath.split("/").map((index) => parseInt(index))
+ )
+ : null
const wasSourceSynced = !!sourceCollection?.id
const wasDestSynced = destinationPath ? !!destCollection?.id : true
diff --git a/packages/hoppscotch-common/src/lib/sync/history/index.ts b/packages/hoppscotch-common/src/lib/sync/history/index.ts
index c2e505584..86171d97b 100644
--- a/packages/hoppscotch-common/src/lib/sync/history/index.ts
+++ b/packages/hoppscotch-common/src/lib/sync/history/index.ts
@@ -87,7 +87,7 @@ function setupSubscriptions() {
}
function mergeHistoryEntries<
- T extends { id?: string; updatedOn?: Date | string | null }
+ T extends { id?: string; updatedOn?: Date | string | null },
>(local: T[], fetched: T[]): T[] {
const fetchedMap = new Map<string, T>()
for (const entry of fetched) {
diff --git a/packages/hoppscotch-common/src/services/persistence/__tests__/index.spec.ts b/packages/hoppscotch-common/src/services/persistence/__tests__/index.spec.ts
index b72921f83..d5523c96f 100644
--- a/packages/hoppscotch-common/src/services/persistence/__tests__/index.spec.ts
+++ b/packages/hoppscotch-common/src/services/persistence/__tests__/index.spec.ts
@@ -880,9 +880,14 @@ describe("PersistenceService", () => {
// 3. Malformed stringified responseMeta (non-numeric duration/statusCode) should fail and fall back to catch values
const entryWithMalformedStr = {
...REST_HISTORY_MOCK[0],
- responseMeta: JSON.stringify({ duration: "invalid", statusCode: 200 }),
+ responseMeta: JSON.stringify({
+ duration: "invalid",
+ statusCode: 200,
+ }),
}
- const parseResult = REST_HISTORY_ENTRY_SCHEMA.safeParse(entryWithMalformedStr)
+ const parseResult = REST_HISTORY_ENTRY_SCHEMA.safeParse(
+ entryWithMalformedStr
+ )
expect(parseResult.success).toBe(true)
expect(parseResult.data?.responseMeta).toEqual({
duration: null,
diff --git a/packages/hoppscotch-common/src/services/persistence/index.ts b/packages/hoppscotch-common/src/services/persistence/index.ts
index a3dee2f53..7561f657f 100644
--- a/packages/hoppscotch-common/src/services/persistence/index.ts
+++ b/packages/hoppscotch-common/src/services/persistence/index.ts
@@ -541,7 +541,10 @@ export class PersistenceService extends Service {
const translatedData = result.data.map(translateToNewRESTHistory)
setRESTHistoryEntries(translatedData)
} else {
- console.error(`Failed parsing persisted REST_HISTORY:`, result.error.message)
+ console.error(
+ `Failed parsing persisted REST_HISTORY:`,
+ result.error.message
+ )
this.showErrorToast(STORE_KEYS.REST_HISTORY)
await Store.set(
STORE_NAMESPACE,
diff --git a/packages/hoppscotch-kernel/src/io/v/1.ts b/packages/hoppscotch-kernel/src/io/v/1.ts
index 91632c0bc..26fafce86 100644
--- a/packages/hoppscotch-kernel/src/io/v/1.ts
+++ b/packages/hoppscotch-kernel/src/io/v/1.ts
@@ -24,14 +24,10 @@ export type OpenExternalLinkOptions = {
}
export type SaveFileResponse =
- | { type: "unknown" }
- | { type: "cancelled" }
- | { type: "saved"; path: string }
+ { type: "unknown" } | { type: "cancelled" } | { type: "saved"; path: string }
export type OpenExternalLinkResponse =
- | { type: "unknown" }
- | { type: "cancelled" }
- | { type: "opened" }
+ { type: "unknown" } | { type: "cancelled" } | { type: "opened" }
export interface IoV1 {
saveFileWithDialog: (
diff --git a/packages/hoppscotch-kernel/src/log/impl/desktop/v/1.ts b/packages/hoppscotch-kernel/src/log/impl/desktop/v/1.ts
index 484561b24..b370a8f32 100644
--- a/packages/hoppscotch-kernel/src/log/impl/desktop/v/1.ts
+++ b/packages/hoppscotch-kernel/src/log/impl/desktop/v/1.ts
@@ -21,8 +21,7 @@ const FLUSH_INTERVAL_MS = 500
// lazy-loaded Tauri invoke. loaded once, shared across all instances
let invoke:
- | (<T>(cmd: string, args?: Record<string, unknown>) => Promise<T>)
- | null = null
+ (<T>(cmd: string, args?: Record<string, unknown>) => Promise<T>) | null = null
let invokePromise: Promise<void> | null = null
const ensureInvoke = async () => {
diff --git a/packages/hoppscotch-kernel/src/relay/v/1.ts b/packages/hoppscotch-kernel/src/relay/v/1.ts
index dbdf0a43b..b9bcd190b 100644
--- a/packages/hoppscotch-kernel/src/relay/v/1.ts
+++ b/packages/hoppscotch-kernel/src/relay/v/1.ts
@@ -209,12 +209,7 @@ export interface RelayRequestEvents {
}
stateChange: {
state:
- | "preparing"
- | "connecting"
- | "sending"
- | "waiting"
- | "receiving"
- | "done"
+ "preparing" | "connecting" | "sending" | "waiting" | "receiving" | "done"
}
authChallenge: {
type: "basic" | "digest" | "oauth2"
@@ -272,14 +267,7 @@ export type ContentCapability =
| "compression"
export type AuthCapability =
- | "none"
- | "basic"
- | "bearer"
- | "digest"
- | "oauth2"
- | "apikey"
- | "aws"
- | "mtls"
+ "none" | "basic" | "bearer" | "digest" | "oauth2" | "apikey" | "aws" | "mtls"
export type SecurityCapability =
| "clientcertificates"
@@ -289,11 +277,7 @@ export type SecurityCapability =
| "peerverification"
export type ProxyCapability =
- | "http"
- | "https"
- | "socks"
- | "authentication"
- | "certificates"
+ "http" | "https" | "socks" | "authentication" | "certificates"
export type AdvancedCapability =
| "retry"
diff --git a/packages/hoppscotch-selfhost-web/src/components/Login.vue b/packages/hoppscotch-selfhost-web/src/components/Login.vue
index 626838210..e9ba4ce18 100644
--- a/packages/hoppscotch-selfhost-web/src/components/Login.vue
+++ b/packages/hoppscotch-selfhost-web/src/components/Login.vue
@@ -55,9 +55,7 @@ const DeviceTokenResponse = z.object({
})
type FlowStates =
- | { type: "loading" }
- | { type: "waiting"; openURL: string }
- | { type: "error" }
+ { type: "loading" } | { type: "waiting"; openURL: string } | { type: "error" }
const authFlowState = ref<FlowStates>({ type: "loading" })
const copyIcon = refAutoReset(IconLink, 1000)
diff --git a/packages/hoppscotch-selfhost-web/src/kernel/store.ts b/packages/hoppscotch-selfhost-web/src/kernel/store.ts
index 6c11b8858..72db3e9db 100644
--- a/packages/hoppscotch-selfhost-web/src/kernel/store.ts
+++ b/packages/hoppscotch-selfhost-web/src/kernel/store.ts
@@ -16,8 +16,7 @@ let cachedStorePath: string | undefined
// For more context, take a look at how `hoppscotch-kernel/.../store/v1/` works
// and how the `web` mode store kernel ignores the first file directory input.
let invoke:
- | (<T>(cmd: string, args?: Record<string, unknown>) => Promise<T>)
- | undefined
+ (<T>(cmd: string, args?: Record<string, unknown>) => Promise<T>) | undefined
let join: ((...paths: string[]) => Promise<string>) | undefined
// Single init promise to avoid multiple imports and race conditions
diff --git a/packages/hoppscotch-selfhost-web/src/platform/instance/desktop/index.ts b/packages/hoppscotch-selfhost-web/src/platform/instance/desktop/index.ts
index 5054a7f93..283a1bd6f 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/instance/desktop/index.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/instance/desktop/index.ts
@@ -1124,12 +1124,10 @@ export class DesktopInstanceService
TE.chainFirst(() =>
this.removeFromRecentInstancesTE(instance.serverUrl)
),
- TE.map(
- (): OperationResult => ({
- success: true,
- message: `Successfully removed ${instance.displayName}`,
- })
- )
+ TE.map((): OperationResult => ({
+ success: true,
+ message: `Successfully removed ${instance.displayName}`,
+ }))
)
)
)
@@ -1148,12 +1146,10 @@ export class DesktopInstanceService
const instancesToKeep = vendoredInstance ? [vendoredInstance] : []
return this.setRecentInstances(instancesToKeep)
}),
- TE.map(
- (): OperationResult => ({
- success: true,
- message: "Cache cleared successfully",
- })
- )
+ TE.map((): OperationResult => ({
+ success: true,
+ message: "Cache cleared successfully",
+ }))
)
}
@@ -1230,12 +1226,10 @@ export class DesktopInstanceService
pipe(
this.createOrGetInstanceTE(normalizedUrl, instanceKind, displayName),
TE.chain((instance) => this.loadInstanceTE(instance, options)),
- TE.map(
- (): OperationResult => ({
- success: true,
- message: `Successfully connected to ${displayName || serverUrl}`,
- })
- )
+ TE.map((): OperationResult => ({
+ success: true,
+ message: `Successfully connected to ${displayName || serverUrl}`,
+ }))
)
)
)
@@ -1294,12 +1288,10 @@ export class DesktopInstanceService
return pipe(
this.performCloseTE(),
TE.chain((response) => this.validateCloseResponseTE(response)),
- TE.map(
- (): OperationResult => ({
- success: true,
- message: "Disconnected successfully",
- })
- ),
+ TE.map((): OperationResult => ({
+ success: true,
+ message: "Disconnected successfully",
+ })),
TE.orElse((error) => {
if (error.includes("Cannot close main window")) {
console.log(