repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/index.ts
packages/hoppscotch-common/src/helpers/auth/index.ts
import { getService } from "~/modules/dioc" import { RESTTabService } from "~/services/tab/rest" import { parseTemplateStringE } from "@hoppscotch/data" import * as E from "fp-ts/Either" import { getCombinedEnvVariables } from "../utils/environments" export const replaceTemplateStringsInObjectValues = < T extends Re...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/auth-types.ts
packages/hoppscotch-common/src/helpers/auth/auth-types.ts
import { Environment, HoppRESTAuth, HoppRESTHeader, HoppRESTParam, HoppRESTRequest, } from "@hoppscotch/data" import { generateApiKeyAuthHeaders, generateApiKeyAuthParams, } from "./types/api-key" import { generateAwsSignatureAuthHeaders, generateAwsSignatureAuthParams, } from "./types/aws-signature" ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/oauth2.ts
packages/hoppscotch-common/src/helpers/auth/types/oauth2.ts
import { parseTemplateString, HoppRESTAuth, Environment, HoppRESTHeader, HoppRESTParam, } from "@hoppscotch/data" export async function generateOAuth2AuthHeaders( auth: HoppRESTAuth & { authType: "oauth-2" }, envVars: Environment["variables"], showKeyIfSecret = false ): Promise<HoppRESTHeader[]> { if...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/jwt.ts
packages/hoppscotch-common/src/helpers/auth/types/jwt.ts
import { Environment, generateJWTToken, HoppRESTAuth, HoppRESTHeader, HoppRESTParam, parseTemplateString, } from "@hoppscotch/data" export async function generateJwtAuthHeaders( auth: HoppRESTAuth & { authType: "jwt" }, envVars: Environment["variables"], showKeyIfSecret = false ): Promise<HoppRESTHea...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/digest.ts
packages/hoppscotch-common/src/helpers/auth/types/digest.ts
import { parseTemplateString, HoppRESTAuth, HoppRESTRequest, Environment, HoppRESTHeader, } from "@hoppscotch/data" import { DigestAuthParams, fetchInitialDigestAuthInfo, generateDigestAuthHeader, } from "../digest" import { getFinalBodyFromRequest } from "~/helpers/utils/EffectiveURL" export async fun...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/aws-signature.ts
packages/hoppscotch-common/src/helpers/auth/types/aws-signature.ts
import { Environment, HoppRESTAuth, HoppRESTHeader, HoppRESTParam, HoppRESTParams, HoppRESTRequest, parseTemplateString, } from "@hoppscotch/data" import { AwsV4Signer } from "aws4fetch" import { getFinalBodyFromRequest } from "~/helpers/utils/EffectiveURL" type SignOptions = { auth: HoppRESTAuth & { a...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/basic.ts
packages/hoppscotch-common/src/helpers/auth/types/basic.ts
import { parseTemplateString, HoppRESTAuth, Environment, HoppRESTHeader, } from "@hoppscotch/data" export async function generateBasicAuthHeaders( auth: HoppRESTAuth & { authType: "basic" }, envVars: Environment["variables"], showKeyIfSecret = false ): Promise<HoppRESTHeader[]> { const username = parse...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/bearer.ts
packages/hoppscotch-common/src/helpers/auth/types/bearer.ts
import { parseTemplateString, HoppRESTAuth, Environment, HoppRESTHeader, } from "@hoppscotch/data" export async function generateBearerAuthHeaders( auth: HoppRESTAuth & { authType: "bearer" }, envVars: Environment["variables"], showKeyIfSecret = false ): Promise<HoppRESTHeader[]> { const token = parseT...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/api-key.ts
packages/hoppscotch-common/src/helpers/auth/types/api-key.ts
import { parseTemplateString, HoppRESTAuth, Environment, HoppRESTHeader, HoppRESTParam, } from "@hoppscotch/data" export async function generateApiKeyAuthHeaders( auth: HoppRESTAuth & { authType: "api-key" }, envVars: Environment["variables"], showKeyIfSecret = false ): Promise<HoppRESTHeader[]> { if...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/hawk.ts
packages/hoppscotch-common/src/helpers/auth/types/hawk.ts
import { parseTemplateString, calculateHawkHeader, HoppRESTAuth, HoppRESTRequest, Environment, HoppRESTHeader, } from "@hoppscotch/data" import { getFinalBodyFromRequest } from "~/helpers/utils/EffectiveURL" export async function generateHawkAuthHeaders( auth: HoppRESTAuth, request: HoppRESTRequest, ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/bearer.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/bearer.spec.ts
import { HoppRESTAuth } from "@hoppscotch/data" import { describe, expect, test } from "vitest" import { generateBearerAuthHeaders } from "../bearer" import { mockEnvVars } from "./test-utils" describe("Bearer Auth", () => { describe("generateBearerAuthHeaders", () => { test("generates bearer auth header with to...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/aws-signature.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/aws-signature.spec.ts
import type { Environment, HoppRESTAuth } from "@hoppscotch/data" import { afterEach, beforeEach, describe, expect, test, vi } from "vitest" import { generateAwsSignatureAuthHeaders, generateAwsSignatureAuthParams, } from "../aws-signature" import { createBaseRequest } from "./test-utils" vi.mock("aws4fetch", () =...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/hawk.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/hawk.spec.ts
import { describe, test, expect, vi, beforeEach } from "vitest" import { generateHawkAuthHeaders } from "../hawk" import { createBaseRequest, mockEnvVars } from "./test-utils" import { HoppRESTAuth } from "@hoppscotch/data" // Mock the calculateHawkHeader function vi.mock("@hoppscotch/data", async () => { const actu...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/test-utils.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/test-utils.ts
import { Environment, makeRESTRequest } from "@hoppscotch/data" // Helper function to create base request export const createBaseRequest = ( overrides: Partial<Parameters<typeof makeRESTRequest>[0]> = {} ) => { const baseRequest: Parameters<typeof makeRESTRequest>[0] = { method: "GET", endpoint: "https://a...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/api-key.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/api-key.spec.ts
import { HoppRESTAuth } from "@hoppscotch/data" import { describe, expect, test } from "vitest" import { generateApiKeyAuthHeaders, generateApiKeyAuthParams } from "../api-key" import { mockEnvVars } from "./test-utils" describe("API Key Auth", () => { describe("generateApiKeyAuthHeaders", () => { test("generate...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/jwt.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/jwt.spec.ts
import { HoppRESTAuth } from "@hoppscotch/data" import { beforeEach, describe, expect, test, vi } from "vitest" import { generateJwtAuthHeaders } from "../jwt" import { mockEnvVars } from "./test-utils" // Mock the jwt helper vi.mock("@hoppscotch/data", async () => { const actual = await vi.importActual("@hoppscotch...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/oauth2.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/oauth2.spec.ts
import { HoppRESTAuth } from "@hoppscotch/data" import { describe, expect, test } from "vitest" import { generateOAuth2AuthHeaders } from "../oauth2" import { mockEnvVars } from "./test-utils" describe("OAuth2 Auth", () => { describe("generateOAuth2AuthHeaders", () => { test("generates OAuth2 auth header for Aut...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/basic.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/basic.spec.ts
import { HoppRESTAuth } from "@hoppscotch/data" import { describe, expect, test } from "vitest" import { generateBasicAuthHeaders } from "../basic" import { mockEnvVars } from "./test-utils" describe("Basic Auth", () => { describe("generateBasicAuthHeaders", () => { test("generates basic auth header with credent...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/auth/types/__tests__/digest.spec.ts
packages/hoppscotch-common/src/helpers/auth/types/__tests__/digest.spec.ts
import { describe, test, expect, vi, beforeEach } from "vitest" import { generateDigestAuthHeaders } from "../digest" import { createBaseRequest, mockEnvVars } from "./test-utils" import { HoppRESTAuth } from "@hoppscotch/data" // Mock the digest helper functions vi.mock("~/helpers/auth/digest", () => ({ generateDig...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/workers/documentation.worker.ts
packages/hoppscotch-common/src/helpers/workers/documentation.worker.ts
import { HoppCollection, HoppRESTRequest } from "@hoppscotch/data" import { DocumentationItem } from "~/composables/useDocumentationWorker" interface GatherDocumentationMessage { type: "GATHER_DOCUMENTATION" collection: string // JSON stringified collection pathOrID: string | null isTeamCollection?: boolean //...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/workers/sandbox.worker.ts
packages/hoppscotch-common/src/helpers/workers/sandbox.worker.ts
import { Cookie, Environment, HoppRESTRequest } from "@hoppscotch/data" import { RunPostRequestScriptOptions, RunPreRequestScriptOptions, SandboxPreRequestResult, SandboxTestResult, TestResult, } from "@hoppscotch/js-sandbox" import { runPreRequestScript, runTestScript } from "@hoppscotch/js-sandbox/web" impo...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/mockServer/exampleCollection.ts
packages/hoppscotch-common/src/helpers/mockServer/exampleCollection.ts
import { HoppCollection, HoppRESTRequest, makeCollection, makeRESTRequest, } from "@hoppscotch/data" import { uniqueID } from "~/helpers/utils/uniqueID" const MOCK_URL_VAR = "<<mockUrl>>" /** * Returns a JSON string of the Pet Store example collection for import * @returns JSON string representation of the ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/mockServer/exampleMockCollection.ts
packages/hoppscotch-common/src/helpers/mockServer/exampleMockCollection.ts
import { pipe } from "fp-ts/function" import * as TE from "fp-ts/TaskEither" import * as E from "fp-ts/Either" import { HoppRESTRequest, RESTReqSchemaVersion, makeCollection, } from "@hoppscotch/data" import { createNewRootCollection } from "~/helpers/backend/mutations/TeamCollection" import { createRequestInColl...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/new-codegen/har.ts
packages/hoppscotch-common/src/helpers/new-codegen/har.ts
import * as RA from "fp-ts/ReadonlyArray" import * as S from "fp-ts/string" import { pipe, flow } from "fp-ts/function" import * as Har from "har-format" import { HoppRESTRequest } from "@hoppscotch/data" import { FieldEquals, objectFieldIncludes } from "../typeutils" // Hoppscotch support HAR Spec 1.2 // For more inf...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/new-codegen/index.ts
packages/hoppscotch-common/src/helpers/new-codegen/index.ts
import { HTTPSnippet } from "@hoppscotch/httpsnippet" import { HoppRESTRequest } from "@hoppscotch/data" import * as O from "fp-ts/Option" import * as E from "fp-ts/Either" import { pipe } from "fp-ts/function" import { buildHarRequest } from "./har" // Hoppscotch's Code Generation is Powered by HTTPSnippet (https://g...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/curlparser.ts
packages/hoppscotch-common/src/helpers/curl/curlparser.ts
/** * the direct import from yargs-parser uses fs which is a built in node module, * just adding the /browser import as a fix for now, which does not have type info on DefinitelyTyped. * remove/update this comment before merging the vue3 port. */ import { FormDataKeyValue, HoppRESTReqBody, makeRESTRequest, } ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/index.ts
packages/hoppscotch-common/src/helpers/curl/index.ts
import { flow } from "fp-ts/function" import { cloneDeep } from "lodash-es" import { parseCurlCommand } from "./curlparser" export const parseCurlToHoppRESTReq = flow(parseCurlCommand, cloneDeep)
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/headers.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/headers.ts
import { HoppRESTHeader } from "@hoppscotch/data" import * as A from "fp-ts/Array" import { flow, pipe } from "fp-ts/function" import * as O from "fp-ts/Option" import * as S from "fp-ts/string" import parser from "yargs-parser" import { objHasArrayProperty, objHasProperty, } from "~/helpers/functional/object" impo...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/cookies.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/cookies.ts
import { pipe } from "fp-ts/function" import * as O from "fp-ts/Option" import { objHasArrayProperty, objHasProperty, } from "~/helpers/functional/object" /** * Parses cookies from curl arguments * Handles both -b flag and --cookie parameter */ export const getCookies = (parsedArguments: any): Record<string, st...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/preproc.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/preproc.ts
import { pipe, flow } from "fp-ts/function" import * as S from "fp-ts/string" import * as O from "fp-ts/Option" import * as A from "fp-ts/Array" const replaceables: { [key: string]: string } = { "--request": "-X", "--header": "-H", "--url": "", "--form": "-F", "--data-raw": "--data", "--data": "-d", "--d...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/auth.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/auth.ts
import { HoppRESTAuth } from "@hoppscotch/data" import parser from "yargs-parser" import * as O from "fp-ts/Option" import * as S from "fp-ts/string" import { pipe } from "fp-ts/function" import { getDefaultRESTRequest } from "~/helpers/rest/default" import { objHasProperty } from "~/helpers/functional/object" const d...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/url.ts
import parser from "yargs-parser" import { pipe } from "fp-ts/function" import * as O from "fp-ts/Option" import * as A from "fp-ts/Array" import { getDefaultRESTRequest } from "~/helpers/rest/default" import { stringArrayJoin } from "~/helpers/functional/array" const defaultRESTReq = getDefaultRESTRequest() const ge...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/contentParser.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/contentParser.ts
import { HoppRESTReqBody } from "@hoppscotch/data" import * as O from "fp-ts/Option" import * as RA from "fp-ts/ReadonlyArray" import * as S from "fp-ts/string" import { pipe, flow } from "fp-ts/function" import { tupleToRecord } from "~/helpers/functional/record" import { safeParseJSON } from "~/helpers/functional/jso...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/queries.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/queries.ts
import { HoppRESTParam } from "@hoppscotch/data" import * as A from "fp-ts/Array" import { flow, pipe } from "fp-ts/function" import * as O from "fp-ts/Option" import * as Sep from "fp-ts/Separated" const isDangling = ([, value]: [string, string]) => !value /** * Converts queries to HoppRESTParam format and separate...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/method.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/method.ts
import parser from "yargs-parser" import { pipe } from "fp-ts/function" import * as O from "fp-ts/Option" import * as R from "fp-ts/Refinement" import { getDefaultRESTRequest } from "~/helpers/rest/default" import { objHasProperty, objHasArrayProperty, } from "~/helpers/functional/object" const defaultRESTReq = ge...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/curl/sub_helpers/body.ts
packages/hoppscotch-common/src/helpers/curl/sub_helpers/body.ts
import parser from "yargs-parser" import { pipe, flow } from "fp-ts/function" import * as O from "fp-ts/Option" import * as A from "fp-ts/Array" import * as RNEA from "fp-ts/ReadonlyNonEmptyArray" import * as S from "fp-ts/string" import { HoppRESTReqBody, HoppRESTReqBodyFormData, ValidContentTypes, knownConten...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/app/index.ts
packages/hoppscotch-common/src/helpers/app/index.ts
import { platform } from "~/platform" let initialized = false export function initializeApp() { if (!initialized) { try { platform.auth.performAuthInit() platform.sync.settings.initSettingsSync() platform.sync.collections.initCollectionsSync() platform.sync.history.initHistorySync() ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamListAdapter.ts
packages/hoppscotch-common/src/helpers/teams/TeamListAdapter.ts
import * as E from "fp-ts/Either" import { BehaviorSubject } from "rxjs" import { platform } from "~/platform" import { GQLError } from "../backend/GQLClient" import { GetMyTeamsQuery } from "../backend/graphql" const BACKEND_PAGE_SIZE = 10 const POLL_DURATION = 10000 export default class TeamListAdapter { error$: ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamEnvironment.ts
packages/hoppscotch-common/src/helpers/teams/TeamEnvironment.ts
import { Environment } from "@hoppscotch/data" /** * Defines how a Team Environment is represented in the TeamEnvironmentAdapter */ export interface TeamEnvironment { id: string teamID: string environment: Environment }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamEnvironmentAdapter.ts
packages/hoppscotch-common/src/helpers/teams/TeamEnvironmentAdapter.ts
import * as E from "fp-ts/Either" import { BehaviorSubject, Subscription } from "rxjs" import { Subscription as WSubscription } from "wonka" import { pipe } from "fp-ts/function" import { GQLError, runGQLQuery, runGQLSubscription } from "../backend/GQLClient" import { GetTeamEnvironmentsDocument, TeamEnvironmentCre...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamRequest.ts
packages/hoppscotch-common/src/helpers/teams/TeamRequest.ts
import { HoppRESTRequest } from "@hoppscotch/data" import { runGQLQuery } from "../backend/GQLClient" import { GetCollectionChildrenDocument, GetCollectionRequestsDocument, GetSingleRequestDocument, } from "../backend/graphql" /** * Defines how a Teams request is represented in TeamCollectionAdapter */ export ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts
packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts
import { HoppCollectionVariable, HoppRESTAuth, HoppRESTHeader, HoppRESTRequest, getDefaultRESTRequest, } from "@hoppscotch/data" import axios from "axios" import { Service } from "dioc" import * as E from "fp-ts/Either" import { Ref, ref } from "vue" import { getSingleCollection, TeamCollection } from "./Team...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts
packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts
import * as E from "fp-ts/Either" import { BehaviorSubject, Subscription } from "rxjs" import { HoppCollectionVariable, HoppRESTAuth, HoppRESTHeader, translateToNewRequest, } from "@hoppscotch/data" import { pull, remove } from "lodash-es" import { Subscription as WSubscription } from "wonka" import { runGQLQue...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
true
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/teams/TeamCollection.ts
packages/hoppscotch-common/src/helpers/teams/TeamCollection.ts
import { runGQLQuery } from "../backend/GQLClient" import { GetCollectionChildrenDocument, GetSingleCollectionDocument, } from "../backend/graphql" import { TeamRequest } from "./TeamRequest" /** * Defines how a Team Collection is represented in the TeamCollectionAdapter */ export interface TeamCollection { id...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/query.ts
packages/hoppscotch-common/src/helpers/graphql/query.ts
import { useService } from "dioc/vue" import { ArgumentNode, DocumentNode, FieldNode, getNamedType, GraphQLArgument, GraphQLField, GraphQLType, Kind, OperationDefinitionNode, OperationTypeNode, print, } from "graphql" import { ref } from "vue" import { GQLTabService } from "~/services/tab/graphql"...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/connection.ts
packages/hoppscotch-common/src/helpers/graphql/connection.ts
import { HoppGQLAuth, HoppGQLRequest, HoppRESTHeaders, makeGQLRequest, } from "@hoppscotch/data" import { OperationType } from "@urql/core" import { AwsV4Signer } from "aws4fetch" import * as E from "fp-ts/Either" import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType,...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/eq.ts
packages/hoppscotch-common/src/helpers/graphql/eq.ts
import * as Eq from "fp-ts/Eq" import * as S from "fp-ts/string" import isEqual from "lodash-es/isEqual" /* * Eq-s are fp-ts an interface (type class) that defines how the equality * of 2 values of a certain type are matched as equal */ /** * Create an Eq from a non-undefinable value and makes it accept undefined...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/default.ts
packages/hoppscotch-common/src/helpers/graphql/default.ts
import { parse, print } from "graphql" import { HoppGQLRequest, GQL_REQ_SCHEMA_VERSION } from "@hoppscotch/data" const DEFAULT_QUERY = print( parse( ` query Request { method url headers { key value } } `, { allowLegacyFragmentVariables: true...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/document.ts
packages/hoppscotch-common/src/helpers/graphql/document.ts
import { HoppGQLRequest } from "@hoppscotch/data" import { GQLResponseEvent } from "./connection" import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue" import { HoppInheritedProperty } from "../types/HoppInheritedProperties" export type HoppGQLSaveContext = | { /** * The origin source ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/explorer.ts
packages/hoppscotch-common/src/helpers/graphql/explorer.ts
import { ref, computed, h, VNode } from "vue" import type { GraphQLSchema, GraphQLNamedType, GraphQLField, GraphQLInputField, GraphQLArgument, GraphQLType, } from "graphql" import { isNamedType, isObjectType, isInputObjectType, isScalarType, isEnumType, isInterfaceType, isUnionType, isNonNul...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/graphql/index.ts
packages/hoppscotch-common/src/helpers/graphql/index.ts
import { HoppGQLRequest, ValidContentTypes } from "@hoppscotch/data" import * as Eq from "fp-ts/Eq" import * as N from "fp-ts/number" import * as S from "fp-ts/string" import { lodashIsEqualEq, mapThenEq, undefinedEq } from "./eq" export type FormDataKeyValue = { key: string active: boolean } & ({ isFile: true; va...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/gql/response.ts
packages/hoppscotch-common/src/helpers/kernel/gql/response.ts
import * as O from "fp-ts/Option" import { pipe } from "fp-ts/function" import { RelayResponse } from "@hoppscotch/kernel" import { RunQueryOptions } from "~/helpers/graphql/connection" import { OperationType } from "@urql/core" import { parseBodyAsJSON } from "~/helpers/functional/json" export type HoppGQLSuccessResp...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/gql/request.ts
packages/hoppscotch-common/src/helpers/kernel/gql/request.ts
import * as TE from "fp-ts/TaskEither" import * as T from "fp-ts/Task" import { pipe } from "fp-ts/function" import { AuthType, MediaType, content } from "@hoppscotch/kernel" import { HoppGQLRequest } from "@hoppscotch/data" import { transformAuth } from "~/helpers/kernel/common" import { defaultAuth } from "~/helper...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/__tests__/kernel.spec.ts
packages/hoppscotch-common/src/helpers/kernel/__tests__/kernel.spec.ts
import { describe, expect, it } from "vitest" import { GQLResponse } from "../gql/response" import { GQLRequest } from "../gql/request" import { RESTResponse } from "../rest/response" import { RESTRequest } from "../rest/request" import { HoppRESTRequest } from "@hoppscotch/data" import { RunQueryOptions } from "~/help...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/common/content.ts
packages/hoppscotch-common/src/helpers/kernel/common/content.ts
import * as E from "fp-ts/Either" import * as TE from "fp-ts/TaskEither" import * as O from "fp-ts/Option" import { pipe } from "fp-ts/function" import { ContentType, MediaType, content } from "@hoppscotch/kernel" import { EffectiveHoppRESTRequest } from "~/helpers/utils/EffectiveURL" /** * Content processors for co...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/common/auth.ts
packages/hoppscotch-common/src/helpers/kernel/common/auth.ts
import { HoppRESTRequest, HoppRESTAuthOAuth2 } from "@hoppscotch/data" import { AuthType } from "@hoppscotch/kernel" import * as E from "fp-ts/Either" import * as O from "fp-ts/Option" import * as TE from "fp-ts/TaskEither" import { flow, pipe } from "fp-ts/function" type HoppAuth = HoppRESTRequest["auth"] type OAuth2...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/common/index.ts
packages/hoppscotch-common/src/helpers/kernel/common/index.ts
export { transformContent } from "./content" export { transformAuth } from "./auth"
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/rest/index.ts
packages/hoppscotch-common/src/helpers/kernel/rest/index.ts
export { RESTRequest } from "./request" export { RESTResponse } from "./response"
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/rest/response.ts
packages/hoppscotch-common/src/helpers/kernel/rest/response.ts
import { RelayResponse } from "@hoppscotch/kernel" import { HoppRESTRequest } from "@hoppscotch/data" import { HoppRESTResponseHeader, HoppRESTSuccessResponse, } from "~/helpers/types/HoppRESTResponse" export type HoppRESTTransformError = { type: "fail" error: { type: "transform_error" message: string ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/kernel/rest/request.ts
packages/hoppscotch-common/src/helpers/kernel/rest/request.ts
import * as TE from "fp-ts/TaskEither" import * as T from "fp-ts/Task" import * as O from "fp-ts/Option" import { pipe } from "fp-ts/function" import { Method, RelayRequest, ContentType, AuthType } from "@hoppscotch/kernel" import { EffectiveHoppRESTRequest } from "~/helpers/utils/EffectiveURL" import { transformAuth...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/utils.ts
packages/hoppscotch-common/src/helpers/editor/utils.ts
export function convertIndexToLineCh( text: string, i: number ): { line: number; ch: number } { const lines = text.split("\n") let line = 0 let counter = 0 while (line < lines.length) { if (i > lines[line].length + counter) { counter += lines[line].length + 1 line++ } else { retu...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/gql/operation.ts
packages/hoppscotch-common/src/helpers/editor/gql/operation.ts
import { EditorState, Range } from "@codemirror/state" import { Decoration, ViewPlugin } from "@codemirror/view" import { syntaxTree } from "@codemirror/language" function getOperationDefsPosInEditor(state: EditorState) { const tree = syntaxTree(state) const defs: Array<{ from: number; to: number }> = [] tree....
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/extensions/HoppEnvironment.ts
packages/hoppscotch-common/src/helpers/editor/extensions/HoppEnvironment.ts
import { Compartment } from "@codemirror/state" import { Decoration, EditorView, MatchDecorator, ViewPlugin, hoverTooltip, } from "@codemirror/view" import { StreamSubscriberFunc } from "@composables/stream" import { parseTemplateStringE, HoppRESTRequestVariables, } from "@hoppscotch/data" import * as E f...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/extensions/helpers.ts
packages/hoppscotch-common/src/helpers/editor/extensions/helpers.ts
import { syntaxTree } from "@codemirror/language" import { EditorState } from "@codemirror/state" /** * Check if the cursor is inside a comment * @param state Editor state * @param pos Position of the cursor * @return Boolean value indicating if the cursor is inside a comment */ export const isComment = (state: E...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/extensions/HoppPredefinedVariables.ts
packages/hoppscotch-common/src/helpers/editor/extensions/HoppPredefinedVariables.ts
import { Compartment } from "@codemirror/state" import { Decoration, MatchDecorator, ViewPlugin, hoverTooltip, } from "@codemirror/view" import { HOPP_SUPPORTED_PREDEFINED_VARIABLES } from "@hoppscotch/data" import IconSquareAsterisk from "~icons/lucide/square-asterisk?raw" import { isComment } from "./helpers...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/preRequest.ts
packages/hoppscotch-common/src/helpers/editor/linting/preRequest.ts
import * as esprima from "esprima" import { LinterDefinition, LinterResult } from "./linter" import { performPreRequestLinting } from "~/helpers/tern" const linter: LinterDefinition = async (text) => { let results: LinterResult[] = [] // Semantic linting const semanticLints = await performPreRequestLinting(text...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/rawKeyValue.ts
packages/hoppscotch-common/src/helpers/editor/linting/rawKeyValue.ts
import * as E from "fp-ts/Either" import { strictParseRawKeyValueEntriesE } from "@hoppscotch/data" import { convertIndexToLineCh } from "../utils" import { LinterDefinition, LinterResult } from "./linter" const linter: LinterDefinition = (text) => { const result = strictParseRawKeyValueEntriesE(text) if (E.isLeft...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/linter.ts
packages/hoppscotch-common/src/helpers/editor/linting/linter.ts
export type LinterResult = { message: string severity: "warning" | "error" from: { line: number; ch: number } to: { line: number; ch: number } } export type LinterDefinition = (text: string) => Promise<LinterResult[]>
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/json.ts
packages/hoppscotch-common/src/helpers/editor/linting/json.ts
import { convertIndexToLineCh } from "../utils" import { LinterDefinition, LinterResult } from "./linter" import jsonParse from "~/helpers/jsonParse" const linter: LinterDefinition = (text) => { try { jsonParse(text) return Promise.resolve([]) } catch (e: any) { return Promise.resolve([ <LinterRe...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/testScript.ts
packages/hoppscotch-common/src/helpers/editor/linting/testScript.ts
import * as esprima from "esprima" import { LinterDefinition, LinterResult } from "./linter" import { performTestLinting } from "~/helpers/tern" const linter: LinterDefinition = async (text) => { let results: LinterResult[] = [] // Semantic linting const semanticLints = await performTestLinting(text) results...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/jsoncPretty.ts
packages/hoppscotch-common/src/helpers/editor/linting/jsoncPretty.ts
import { format, applyEdits } from "jsonc-parser" export function prettifyJSONC(str: string) { const editResult = format(str, undefined, { insertSpaces: true, tabSize: 2, insertFinalNewline: true, }) return applyEdits(str, editResult) }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/gqlQuery.ts
packages/hoppscotch-common/src/helpers/editor/linting/gqlQuery.ts
import { Ref } from "vue" import { GraphQLError, GraphQLSchema, parse as gqlParse, validate as gqlValidate, } from "graphql" import { LinterDefinition, LinterResult } from "./linter" /** * Creates a Linter function that can lint a GQL query against a given * schema */ export const createGQLQueryLinter: ( ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/linting/jsonc.ts
packages/hoppscotch-common/src/helpers/editor/linting/jsonc.ts
import { Node, parseTree, stripComments as stripComments_ } from "jsonc-parser" import jsoncParse from "~/helpers/jsoncParse" import { convertIndexToLineCh } from "../utils" import { LinterDefinition, LinterResult } from "./linter" const linter: LinterDefinition = (text) => { try { jsoncParse(text) return Pr...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/themes/baseTheme.ts
packages/hoppscotch-common/src/helpers/editor/themes/baseTheme.ts
import { EditorView, keymap, highlightSpecialChars, highlightActiveLine, drawSelection, dropCursor, lineNumbers, highlightActiveLineGutter, rectangularSelection, crosshairCursor, } from "@codemirror/view" import { HighlightStyle, defaultHighlightStyle, foldKeymap, foldGutter, codeFolding, ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/completion/preRequest.ts
packages/hoppscotch-common/src/helpers/editor/completion/preRequest.ts
import { Completer, CompletionEntry } from "." import { getPreRequestScriptCompletions } from "~/helpers/tern" const completer: Completer = async (text, completePos) => { const results = await getPreRequestScriptCompletions( text, completePos.line, completePos.ch ) const completions = results.comple...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/completion/testScript.ts
packages/hoppscotch-common/src/helpers/editor/completion/testScript.ts
import { Completer, CompletionEntry } from "." import { getTestScriptCompletions } from "~/helpers/tern" export const completer: Completer = async (text, completePos) => { const results = await getTestScriptCompletions( text, completePos.line, completePos.ch ) const completions = results.completions...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/completion/gqlQuery.ts
packages/hoppscotch-common/src/helpers/editor/completion/gqlQuery.ts
import { Ref } from "vue" import { GraphQLSchema } from "graphql" import { getAutocompleteSuggestions } from "graphql-language-service-interface" import { Completer, CompleterResult, CompletionEntry } from "." const completer: (schemaRef: Ref<GraphQLSchema | null>) => Completer = (schemaRef: Ref<GraphQLSchema | null...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/editor/completion/index.ts
packages/hoppscotch-common/src/helpers/editor/completion/index.ts
export type CompletionEntry = { text: string meta: string score: number } export type CompleterResult = { /** * List of completions to display */ completions: CompletionEntry[] } export type Completer = ( /** * The contents of the editor */ text: string, /** * Position where the complet...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/rules/BodyTransition.ts
packages/hoppscotch-common/src/helpers/rules/BodyTransition.ts
/** * Defines how body should be updated for movement between different * content-types */ import { pipe } from "fp-ts/function" import * as A from "fp-ts/Array" import { FormDataKeyValue, HoppRESTReqBody, ValidContentTypes, parseRawKeyValueEntries, rawKeyValueEntriesToString, RawKeyValueEntry, } from "...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/collection/affectedIndex.ts
packages/hoppscotch-common/src/helpers/collection/affectedIndex.ts
/** * Get the indexes that are affected by the reorder * @param from index of the item before reorder * @param to index of the item after reorder * @returns Map of from to to */ export function getAffectedIndexes(from: number, to: number) { const indexes = new Map<number, number>() indexes.set(from, to) if ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/collection/collection.ts
packages/hoppscotch-common/src/helpers/collection/collection.ts
import { HoppCollection } from "@hoppscotch/data" import { getAffectedIndexes } from "./affectedIndex" import { GetSingleRequestDocument } from "../backend/graphql" import { runGQLQuery } from "../backend/GQLClient" import * as E from "fp-ts/Either" import { getService } from "~/modules/dioc" import { RESTTabService } ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/collection/request.ts
packages/hoppscotch-common/src/helpers/collection/request.ts
import { HoppCollection, HoppGQLRequest, HoppRESTRequest, RESTReqSchemaVersion, } from "@hoppscotch/data" import { getAffectedIndexes } from "./affectedIndex" import { RESTTabService } from "~/services/tab/rest" import { getService } from "~/modules/dioc" /** * Resolve save context on reorder * @param payloa...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/sortEnvironmentsAlphabetically.ts
packages/hoppscotch-common/src/helpers/utils/sortEnvironmentsAlphabetically.ts
import { Environment } from "@hoppscotch/data" import { TeamEnvironment } from "../teams/TeamEnvironment" type SortOrder = "asc" | "desc" type EnvironmentWithIndex<T> = { env: T index: number } /** * Sorts an array of environments alphabetically based on a specified name getter function. * * @template T - The...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/contenttypes.ts
packages/hoppscotch-common/src/helpers/utils/contenttypes.ts
import { ValidContentTypes } from "@hoppscotch/data" export type Content = "json" | "xml" | "multipart" | "html" | "plain" | "binary" export const knownContentTypes: Record<ValidContentTypes, Content> = { "application/json": "json", "application/ld+json": "json", "application/hal+json": "json", "application/v...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/environments.ts
packages/hoppscotch-common/src/helpers/utils/environments.ts
import { Environment } from "@hoppscotch/data" import { cloneDeep } from "lodash-es" import { getService } from "~/modules/dioc" import { getCurrentEnvironment, getGlobalVariables, } from "~/newstore/environments" import { CurrentValueService } from "~/services/current-environment-value.service" import { SecretEnv...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/b64.ts
packages/hoppscotch-common/src/helpers/utils/b64.ts
export function decodeB64StringToArrayBuffer(input: string): ArrayBuffer { const bytes = Math.floor((input.length / 4) * 3) const ab = new ArrayBuffer(bytes) const uarray = new Uint8Array(ab) const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" let chr1, chr2, chr3 let en...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/number.ts
packages/hoppscotch-common/src/helpers/utils/number.ts
/** * Check if a value is numeric — either a valid number or a numeric string * * @param value - The value to check * @returns True if the value is numeric, false otherwise */ export const isNumeric = (value: unknown): boolean => { if (typeof value === "number") return !Number.isNaN(value) // handle actual numbe...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/StreamUtils.ts
packages/hoppscotch-common/src/helpers/utils/StreamUtils.ts
import { combineLatest, Observable } from "rxjs" import { map } from "rxjs/operators" /** * Constructs a stream of a object from a collection of other observables * * @param streamObj The object containing key of observables to assemble from * * @returns The constructed object observable */ export function const...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/organization.ts
packages/hoppscotch-common/src/helpers/utils/organization.ts
/** * Extract initials from organization name (1-2 characters) * Trims whitespace and handles edge cases like special characters */ export const getOrgInitials = (name: string): string => { const trimmedName = name.trim() // Return "?" for empty or whitespace-only strings if (!trimmedName) return "?" const...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/file-extension.ts
packages/hoppscotch-common/src/helpers/utils/file-extension.ts
export function hasValidExtension( filename: string, allowedExtensions: string[] ): boolean { const ext = filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2) return allowedExtensions.includes(`.${ext.toLowerCase()}`) }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/dom.ts
packages/hoppscotch-common/src/helpers/utils/dom.ts
export function isDOMElement(el: any): el is HTMLElement { return !!el && (el instanceof Element || el instanceof HTMLElement) } export function isTypableElement(el: HTMLElement): boolean { // If content editable, then it is editable if (el.isContentEditable) return true // If element is an input and the inpu...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/interfaceLanguages.ts
packages/hoppscotch-common/src/helpers/utils/interfaceLanguages.ts
export const interfaceLanguages = { cJSON: "cjson", "C++": "cpp", "C#": "csharp", Crystal: "crystal", Dart: "dart", Elm: "elm", Flow: "flow", Go: "go", Haskell: "haskell", Java: "java", JavaScript: "javascript", Kotlin: "kotlin", "Objective-C": "objective-c", PHP: "php", Pike: "pike", Py...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/inheritedCollectionVarTransformer.ts
packages/hoppscotch-common/src/helpers/utils/inheritedCollectionVarTransformer.ts
import { AggregateEnvironment } from "~/newstore/environments" import { HoppInheritedProperty } from "../types/HoppInheritedProperties" import { SecretEnvironmentService } from "~/services/secret-environment.service" import { CurrentValueService } from "~/services/current-environment-value.service" import { getService ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/uniqueID.ts
packages/hoppscotch-common/src/helpers/utils/uniqueID.ts
export const uniqueID = (length = 16) => { return Math.random().toString(36).substring(2, length) }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/clipboard.ts
packages/hoppscotch-common/src/helpers/utils/clipboard.ts
/** * Copies a given string to the clipboard using * the legacy exec method * * @param content The content to be copied */ export function copyToClipboard(content: string) { if (navigator.clipboard) { navigator.clipboard.writeText(content) } else { const dummy = document.createElement("textarea") d...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/userAgent.ts
packages/hoppscotch-common/src/helpers/utils/userAgent.ts
export const browserIsChrome = () => /Chrome/i.test(navigator.userAgent) && /Google/i.test(navigator.vendor) export const browserIsFirefox = () => /Firefox/i.test(navigator.userAgent)
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/JsonFormattedError.ts
packages/hoppscotch-common/src/helpers/utils/JsonFormattedError.ts
export class JsonFormattedError extends Error { constructor(jsonObject: any) { super(JSON.stringify(jsonObject, null, 2)) } }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/json-to-language.ts
packages/hoppscotch-common/src/helpers/utils/json-to-language.ts
import { quicktype, InputData, jsonInputForTargetLanguage, } from "quicktype-core" import { InterfaceLanguage } from "./interfaceLanguages" async function jsonToLanguage( targetLanguage: InterfaceLanguage, jsonString: string ) { const jsonInput = jsonInputForTargetLanguage(targetLanguage) await jsonInpu...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/statusCodes.ts
packages/hoppscotch-common/src/helpers/utils/statusCodes.ts
const statusCodes: { [key: number]: string } = { // 1xx Informational // Request received, continuing process.[2] // This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. Since HTTP/1.0 did not define any 1xx stat...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts
import { Environment, FormDataKeyValue, HoppRESTAuth, HoppRESTHeader, HoppRESTHeaders, HoppRESTParam, HoppRESTParams, HoppRESTReqBody, HoppRESTRequest, parseBodyEnvVariables, parseRawKeyValueEntriesE, parseTemplateString, parseTemplateStringE, } from "@hoppscotch/data" import * as A from "fp-t...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false