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-js-sandbox/src/cage-modules/namespaces/hopp-namespace.ts
packages/hoppscotch-js-sandbox/src/cage-modules/namespaces/hopp-namespace.ts
import { CageModuleCtx, defineSandboxFn } from "faraday-cage/modules" import type { EnvMethods, RequestProps, HoppNamespaceMethods } from "~/types" import type { EnvAPIOptions } from "~/utils/shared" /** * Creates hopp namespace methods for the sandbox environment * Includes environment operations with hopp-specifi...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/constants/http-status-codes.ts
packages/hoppscotch-js-sandbox/src/constants/http-status-codes.ts
/** * HTTP Status Code Reason Phrases * * Standard HTTP status codes and their corresponding reason phrases * as defined in RFC 7231 and related specifications. * * @see https://tools.ietf.org/html/rfc7231#section-6 * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */ export const HTTP_STATUS_REAS...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/constants/sandbox-markers.ts
packages/hoppscotch-js-sandbox/src/constants/sandbox-markers.ts
/** * Special marker constants for preserving undefined and null values * across the sandbox boundary during serialization. * * These markers are used because: * - JSON.stringify converts undefined to null or omits the property * - We need to distinguish between actual null and serialized undefined * - The sandb...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/web/index.ts
packages/hoppscotch-js-sandbox/src/web/index.ts
export { runPreRequestScript } from "./pre-request" export { runTestScript } from "./test-runner"
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/web/pre-request/index.ts
packages/hoppscotch-js-sandbox/src/web/pre-request/index.ts
import { FaradayCage } from "faraday-cage" import { ConsoleEntry } from "faraday-cage/modules" import * as E from "fp-ts/Either" import { cloneDeep } from "lodash" import { HoppFetchHook, RunPreRequestScriptOptions, SandboxPreRequestResult, TestResult, } from "~/types" import { defaultModules, preRequestModule...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/web/pre-request/worker.ts
packages/hoppscotch-js-sandbox/src/web/pre-request/worker.ts
import * as TE from "fp-ts/TaskEither" import { getPreRequestScriptMethods } from "~/utils/shared" import { SandboxPreRequestResult, TestResult } from "~/types" const executeScriptInContext = ( preRequestScript: string, envs: TestResult["envs"] ): TE.TaskEither<string, SandboxPreRequestResult> => { try { co...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/web/test-runner/index.ts
packages/hoppscotch-js-sandbox/src/web/test-runner/index.ts
import { FaradayCage } from "faraday-cage" import { ConsoleEntry } from "faraday-cage/modules" import * as E from "fp-ts/Either" import { cloneDeep } from "lodash-es" import { defaultModules, postRequestModule } from "~/cage-modules" import { HoppFetchHook, RunPostRequestScriptOptions, SandboxTestResult, TestD...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-js-sandbox/src/web/test-runner/worker.ts
packages/hoppscotch-js-sandbox/src/web/test-runner/worker.ts
import * as E from "fp-ts/Either" import * as TE from "fp-ts/TaskEither" import { SandboxTestResult, TestResponse, TestResult } from "~/types" import { getTestRunnerScriptMethods, preventCyclicObjects, } from "~/utils/shared" const executeScriptInContext = ( testScript: string, envs: TestResult["envs"], res...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/tailwind.config.ts
packages/hoppscotch-sh-admin/tailwind.config.ts
import { Config } from 'tailwindcss'; import preset from '@hoppscotch/ui/ui-preset'; export default { content: ['src/**/*.{vue,html}'], presets: [preset], } satisfies Config;
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/vite.config.ts
packages/hoppscotch-sh-admin/vite.config.ts
import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import { FileSystemIconLoader } from 'unplugin-icons/loaders'; import Icons from 'unplugin-icons/vite'; import Unfonts from 'unplugin-fonts/vite'; import IconResolver from 'unplugin-icons/resolver'; import Components from 'unplugin-vue-component...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/components.d.ts
packages/hoppscotch-sh-admin/src/components.d.ts
/* eslint-disable */ // @ts-nocheck // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 // biome-ignore lint: disable export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { AppHeader: typeof import('./components/app/Header.vue')['defau...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/shims-vue.d.ts
packages/hoppscotch-sh-admin/src/shims-vue.d.ts
declare module '*.vue' { import { defineComponent } from 'vue'; const Component: ReturnType<typeof defineComponent>; export default Component; }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/main.ts
packages/hoppscotch-sh-admin/src/main.ts
import { authExchange } from '@urql/exchange-auth'; import urql, { cacheExchange, createClient, fetchExchange } from '@urql/vue'; import { createApp, h } from 'vue'; import App from './App.vue'; import ErrorComponent from './pages/_.vue'; // STYLES import '@fontsource-variable/inter'; import '@fontsource-variable/mate...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/vite-env.d.ts
packages/hoppscotch-sh-admin/src/vite-env.d.ts
/// <reference types="vite/client" /> /// <reference types="vite-plugin-pages/client" /> /// <reference types="vite-plugin-vue-layouts/client" />
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/configs.ts
packages/hoppscotch-sh-admin/src/helpers/configs.ts
import { ref } from 'vue'; import { InfraConfigEnum } from './backend/graphql'; // Check if any input validation has failed export const hasInputValidationFailed = ref(false); export type SsoAuthProviders = 'google' | 'microsoft' | 'github'; export type ServerConfigs = { providers: { google: { name: SsoA...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/Email.ts
packages/hoppscotch-sh-admin/src/helpers/Email.ts
import * as t from "io-ts" const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ interface EmailBrand { readonly Email: unique symbol } export const EmailCodec = t.brand( t.string, (x): x is t....
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/errors.ts
packages/hoppscotch-sh-admin/src/helpers/errors.ts
/* * Type used to send error data to the Fallback catch-all component */ export type ErrorPageData = { message: string; statusCode?: number; }; /* No cookies were found in the auth request * (AuthService) */ export const COOKIES_NOT_FOUND = '[GraphQL] auth/cookies_not_found' as const; export const UNAUTHORIZE...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/userManagement.ts
packages/hoppscotch-sh-admin/src/helpers/userManagement.ts
import { useToast } from '~/composables/toast'; import { getI18n } from '~/modules/i18n'; import { UserDeletionResult } from './backend/graphql'; import { ADMIN_CANNOT_BE_DELETED, USER_IS_OWNER, getCompiledErrorMessage, } from './errors'; type ToastMessage = { message: string; state: 'success' | 'error'; }; ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/localpersistence.ts
packages/hoppscotch-sh-admin/src/helpers/localpersistence.ts
/** * Gets a value in LocalStorage. * * NOTE: Use LocalStorage to only store non-reactive simple data * For more complex data, use stores and connect it to localpersistence */ export function getLocalConfig(name: string) { return window.localStorage.getItem(name); } /** * Sets a value in LocalStorage. * * NO...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/auth.ts
packages/hoppscotch-sh-admin/src/helpers/auth.ts
import { BehaviorSubject, Subject } from 'rxjs'; import { getLocalConfig, removeLocalConfig, setLocalConfig, } from './localpersistence'; import { Ref, ref } from 'vue'; import * as O from 'fp-ts/Option'; import authQuery from './backend/rest/authQuery'; import { COOKIES_NOT_FOUND, UNAUTHORIZED } from './errors';...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/axiosConfig.ts
packages/hoppscotch-sh-admin/src/helpers/axiosConfig.ts
import axios from 'axios'; const baseConfig = { headers: { 'Content-type': 'application/json', }, withCredentials: true, }; const gqlApi = axios.create({ ...baseConfig, baseURL: import.meta.env.VITE_BACKEND_GQL_URL, }); const restApi = axios.create({ ...baseConfig, baseURL: import.meta.env.VITE_BAC...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/utils/readableKey.ts
packages/hoppscotch-sh-admin/src/helpers/utils/readableKey.ts
/** * The makeReadableKey function formats a string to be more human-readable. * It replaces underscores with spaces, converts it to lowercase, * and capitalizes the first letter. * @param string The string to be formatted * @returns A human-readable version of the string */ export const makeReadableKey = (string...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/utils/clipboard.ts
packages/hoppscotch-sh-admin/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'); ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/utils/date.ts
packages/hoppscotch-sh-admin/src/helpers/utils/date.ts
export function shortDateTime( date: string | number | Date, includeTime: boolean = true ) { return new Date(date).toLocaleString("en-US", { year: "numeric", month: "short", day: "numeric", ...(includeTime ? { hour: "numeric", minute: "numeric", second: "numeric...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/helpers/backend/rest/authQuery.ts
packages/hoppscotch-sh-admin/src/helpers/backend/rest/authQuery.ts
import { gqlApi, restApi } from '~/helpers/axiosConfig'; export default { getUserDetails: () => gqlApi.post('', { query: `query Me { me { uid displayName email photoURL isAdmin createdOn } }`, }), refreshToken: () => restApi.get('/auth/r...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/usePagedQuery.ts
packages/hoppscotch-sh-admin/src/composables/usePagedQuery.ts
import { onMounted, ref, Ref } from 'vue'; import { DocumentNode } from 'graphql'; import { TypedDocumentNode, useClientHandle } from '@urql/vue'; export function usePagedQuery< Result, Vars extends Record<string, any>, ListItem >( query: string | TypedDocumentNode<Result, Vars> | DocumentNode, getList: (res...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/useOnboardingConfigHandler.ts
packages/hoppscotch-sh-admin/src/composables/useOnboardingConfigHandler.ts
import { onMounted, ref, watch } from 'vue'; import { useI18n } from './i18n'; import { useToast } from './toast'; import { auth } from '~/helpers/auth'; import { InfraConfigEnum } from '~/helpers/backend/graphql'; import { getLocalConfig, setLocalConfig } from '~/helpers/localpersistence'; import { makeReadableKey } f...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/useConfigHandler.ts
packages/hoppscotch-sh-admin/src/composables/useConfigHandler.ts
import { AnyVariables, UseMutationResponse } from '@urql/vue'; import { cloneDeep } from 'lodash-es'; import { onMounted, ref } from 'vue'; import { useI18n } from '~/composables/i18n'; import { AllowedAuthProvidersDocument, AuthProvider, EnableAndDisableSsoArgs, EnableAndDisableSsoMutation, InfraConfigArgs, ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/stream.ts
packages/hoppscotch-sh-admin/src/composables/stream.ts
import { clone, cloneDeep } from 'lodash-es'; import { Observable, Subscription } from 'rxjs'; import { customRef, onBeforeUnmount, readonly, Ref } from 'vue'; type CloneMode = 'noclone' | 'shallow' | 'deep'; /** * Returns a readonly (no writes) ref for an RxJS Observable * @param stream$ The RxJS Observable to lis...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/i18n.ts
packages/hoppscotch-sh-admin/src/composables/i18n.ts
import { flow } from "fp-ts/function" import { useI18n as _useI18n } from "vue-i18n" export const useI18n = flow(_useI18n, (x) => x.t) export const useFullI18n = _useI18n
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/useClientHandler.ts
packages/hoppscotch-sh-admin/src/composables/useClientHandler.ts
import { TypedDocumentNode, useClientHandle } from '@urql/vue'; import { DocumentNode } from 'graphql'; import { Ref, ref } from 'vue'; /** A composable function to handle grapqhl requests * using urql's useClientHandle * @param query The query to be executed * @param getList A function to get the list from the res...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/toast.ts
packages/hoppscotch-sh-admin/src/composables/toast.ts
import { useToasted } from '@hoppscotch/vue-toasted'; export const useToast = useToasted;
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/composables/useSidebar.ts
packages/hoppscotch-sh-admin/src/composables/useSidebar.ts
import { ref } from 'vue'; /** isOpen is used to indicate whether the sidebar is now visible on the screen */ const isOpen = ref(false); /** isExpanded is used to indicate whether the sidebar is now expanded to also include page names or the sidebar is compressed to show just the icons */ const isExpanded = ref(true)...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/admin.ts
packages/hoppscotch-sh-admin/src/modules/admin.ts
import { auth } from '~/helpers/auth'; import { UNAUTHORIZED } from '~/helpers/errors'; import { HoppModule } from '.'; const isSetupRoute = (to: unknown) => to === 'setup'; const isGuestRoute = (to: unknown) => ['index', 'enter', 'onboarding'].includes(to as string); const getFirstTimeInfraSetupStatus = async () ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/router.ts
packages/hoppscotch-sh-admin/src/modules/router.ts
import { HoppModule, HOPP_MODULES } from '.'; import { createRouter, createWebHistory, RouteLocationNormalized, } from 'vue-router'; import { setupLayouts } from 'virtual:generated-layouts'; import generatedRoutes from 'virtual:generated-pages'; import { readonly, ref } from 'vue'; const routes = setupLayouts(ge...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/ui.ts
packages/hoppscotch-sh-admin/src/modules/ui.ts
import { HoppModule } from '.'; import { plugin as HoppUI, HoppUIPluginOptions } from '@hoppscotch/ui'; const HoppUIOptions: HoppUIPluginOptions = {}; export default <HoppModule>{ onVueAppInit(app) { // disable eslint for this line. it's a hack because there's some unknown type error // eslint-disable-next-...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/v-focus.ts
packages/hoppscotch-sh-admin/src/modules/v-focus.ts
import { nextTick } from "vue" import { HoppModule } from "." /* Declares a `v-focus` directive that can be used for components to acquire focus instantly once mounted */ export default <HoppModule>{ onVueAppInit(app) { app.directive("focus", { mounted: (el) => nextTick(() => el.focus()), }) }, ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/i18n.ts
packages/hoppscotch-sh-admin/src/modules/i18n.ts
import { I18n, createI18n } from 'vue-i18n'; import { HoppModule } from '.'; import messages from '@intlify/unplugin-vue-i18n/messages'; // A reference to the i18n instance let i18nInstance: I18n< Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, string, false > | null = null; /** ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/toast.ts
packages/hoppscotch-sh-admin/src/modules/toast.ts
import Toasted from '@hoppscotch/vue-toasted'; import type { ToastOptions } from '@hoppscotch/vue-toasted'; import { HoppModule } from '.'; import '@hoppscotch/vue-toasted/style.css'; // We are using a fork of Vue Toasted (github.com/clayzar/vue-toasted) which is a bit of // an untrusted fork, we will either want to ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/index.ts
packages/hoppscotch-sh-admin/src/modules/index.ts
import { App } from 'vue'; import { pipe } from 'fp-ts/function'; import * as A from 'fp-ts/Array'; import { NavigationGuardNext, RouteLocationNormalized, Router, } from 'vue-router'; export type HoppModule = { /** * Define this function to get access to Vue App instance and augment * it (installing comp...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-sh-admin/src/modules/tippy.ts
packages/hoppscotch-sh-admin/src/modules/tippy.ts
import { HoppModule } from '.'; import VueTippy, { roundArrow, setDefaultProps } from 'vue-tippy'; import 'tippy.js/dist/tippy.css'; import 'tippy.js/animations/scale-subtle.css'; import 'tippy.js/dist/border.css'; import 'tippy.js/dist/svg-arrow.css'; export default <HoppModule>{ onVueAppInit(app) { app.use(Vu...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/global.d.ts
packages/hoppscotch-backend/global.d.ts
import '@relmify/jest-fp-ts';
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/prisma.config.ts
packages/hoppscotch-backend/prisma.config.ts
import 'dotenv/config'; import { defineConfig, env } from 'prisma/config'; export default defineConfig({ schema: 'prisma/schema.prisma', migrations: { path: 'prisma/migrations', }, datasource: { url: env('DATABASE_URL'), }, });
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/app.controller.ts
packages/hoppscotch-backend/src/app.controller.ts
import { Controller, Get } from '@nestjs/common'; @Controller('ping') export class AppController { @Get() ping(): string { return 'Success'; } }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/errors.ts
packages/hoppscotch-backend/src/errors.ts
export const INVALID_EMAIL = 'invalid/email' as const; export const EMAIL_FAILED = 'email/failed' as const; export const DUPLICATE_EMAIL = 'email/both_emails_cannot_be_same' as const; /** * Only one admin account found in infra * (AdminService) */ export const ONLY_ONE_ADMIN_ACCOUNT = 'admin/only_one_admin_accou...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/app.module.ts
packages/hoppscotch-backend/src/app.module.ts
import { HttpException, Module } from '@nestjs/common'; import { GraphQLModule } from '@nestjs/graphql'; import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo'; import { UserModule } from './user/user.module'; import { GQLComplexityPlugin } from './plugins/GQLComplexityPlugin'; import { AuthModule } from './...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/gql-schema.ts
packages/hoppscotch-backend/src/gql-schema.ts
import { NestFactory } from '@nestjs/core'; import { GraphQLSchemaBuilderModule, GraphQLSchemaFactory, } from '@nestjs/graphql'; import { printSchema } from 'graphql/utilities'; import * as path from 'path'; import * as fs from 'fs'; import { ShortcodeResolver } from './shortcode/shortcode.resolver'; import { TeamC...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/utils.ts
packages/hoppscotch-backend/src/utils.ts
import { ExecutionContext, HttpException } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { GqlExecutionContext } from '@nestjs/graphql'; import { Prisma } from 'src/generated/prisma/client'; import * as A from 'fp-ts/Array'; import * as E from 'fp-ts/Either'; import { pipe } from 'fp-ts/lib/fu...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/main.ts
packages/hoppscotch-backend/src/main.ts
import { NestFactory } from '@nestjs/core'; import { json } from 'express'; import { AppModule } from './app.module'; import cookieParser from 'cookie-parser'; import { ValidationPipe, VersioningType } from '@nestjs/common'; import session from 'express-session'; import { emitGQLSchemaFile } from './gql-schema'; import...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/pubsub/pubsub.module.ts
packages/hoppscotch-backend/src/pubsub/pubsub.module.ts
import { Global, Module } from '@nestjs/common'; import { PubSubService } from './pubsub.service'; @Global() @Module({ providers: [PubSubService], exports: [PubSubService], }) export class PubSubModule {}
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/pubsub/topicsDefs.ts
packages/hoppscotch-backend/src/pubsub/topicsDefs.ts
import { UserRequest, UserRequestReorderData, } from 'src/user-request/user-request.model'; import { User } from 'src/user/user.model'; import { UserSettings } from 'src/user-settings/user-settings.model'; import { UserEnvironment } from '../user-environment/user-environments.model'; import { UserHistory, UserH...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/pubsub/pubsub.service.ts
packages/hoppscotch-backend/src/pubsub/pubsub.service.ts
import { OnModuleInit, Injectable } from '@nestjs/common'; import { PubSub as LocalPubSub } from 'graphql-subscriptions'; import { TopicDef } from './topicsDefs'; /* * Figure out which PubSub to use (simple/local for dev and Redis for production) * and expose it */ @Injectable() export class PubSubService implemen...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/decorators/bearer-token.decorator.ts
packages/hoppscotch-backend/src/decorators/bearer-token.decorator.ts
import { createParamDecorator, ExecutionContext } from '@nestjs/common'; /** ** Decorator to fetch refresh_token from cookie */ export const BearerToken = createParamDecorator( (data: unknown, context: ExecutionContext) => { const request = context.switchToHttp().getRequest<Request>(); // authorization to...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/decorators/gql-user.decorator.ts
packages/hoppscotch-backend/src/decorators/gql-user.decorator.ts
import { createParamDecorator, ExecutionContext } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; export const GqlUser = createParamDecorator( (data: unknown, context: ExecutionContext) => { const ctx = GqlExecutionContext.create(context); const { req, headers } = ctx.getContext...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/decorators/rt-cookie.decorator.ts
packages/hoppscotch-backend/src/decorators/rt-cookie.decorator.ts
import { createParamDecorator, ExecutionContext } from '@nestjs/common'; import { GqlExecutionContext } from '@nestjs/graphql'; /** ** Decorator to fetch refresh_token from cookie */ export const RTCookie = createParamDecorator( (data: unknown, context: ExecutionContext) => { const ctx = GqlExecutionContext.cr...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-settings/user.resolver.ts
packages/hoppscotch-backend/src/user-settings/user.resolver.ts
import { Parent, ResolveField, Resolver } from '@nestjs/graphql'; import { User } from 'src/user/user.model'; import { UserSettings } from './user-settings.model'; import { UserSettingsService } from './user-settings.service'; import * as E from 'fp-ts/Either'; import { throwErr } from 'src/utils'; @Resolver(() => Use...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-settings/user-settings.resolver.ts
packages/hoppscotch-backend/src/user-settings/user-settings.resolver.ts
import { UseGuards } from '@nestjs/common'; import { Args, Mutation, Resolver, Subscription } from '@nestjs/graphql'; import { GqlUser } from 'src/decorators/gql-user.decorator'; import { GqlAuthGuard } from 'src/guards/gql-auth.guard'; import { User } from 'src/user/user.model'; import * as E from 'fp-ts/Either'; impo...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-settings/user-settings.service.ts
packages/hoppscotch-backend/src/user-settings/user-settings.service.ts
import { Injectable } from '@nestjs/common'; import { PrismaService } from 'src/prisma/prisma.service'; import { PubSubService } from 'src/pubsub/pubsub.service'; import { User } from 'src/user/user.model'; import * as E from 'fp-ts/Either'; import { stringToJson } from 'src/utils'; import { UserSettings as DbUserSetti...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-settings/user-settings.module.ts
packages/hoppscotch-backend/src/user-settings/user-settings.module.ts
import { Module } from '@nestjs/common'; import { UserModule } from 'src/user/user.module'; import { UserSettingsResolver } from './user-settings.resolver'; import { UserSettingsService } from './user-settings.service'; import { UserSettingsUserResolver } from './user.resolver'; @Module({ imports: [UserModule], pr...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-settings/user-settings.service.spec.ts
packages/hoppscotch-backend/src/user-settings/user-settings.service.spec.ts
import { mockDeep, mockReset } from 'jest-mock-extended'; import { PrismaService } from 'src/prisma/prisma.service'; import { PubSubService } from 'src/pubsub/pubsub.service'; import { UserSettingsService } from './user-settings.service'; import { JSON_INVALID, USER_SETTINGS_NULL_SETTINGS } from 'src/errors'; import { ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-settings/user-settings.model.ts
packages/hoppscotch-backend/src/user-settings/user-settings.model.ts
import { Field, ID, ObjectType } from '@nestjs/graphql'; @ObjectType() export class UserSettings { @Field(() => ID, { description: 'ID of the User Setting', }) id: string; @Field(() => ID, { description: 'ID of the user this setting belongs to', }) userUid: string; @Field({ description: 'St...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/auth.service.spec.ts
packages/hoppscotch-backend/src/auth/auth.service.spec.ts
import { HttpStatus } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import { Account, VerificationToken } from 'src/generated/prisma/client'; import { mockDeep } from 'jest-mock-extended'; import { INVALID_EMAIL, INVALID_MAGIC_LINK_DATA, INVALID_REFRESH_TOKEN, MAGIC_LINK_EXPIRED, VERIFICATI...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/helper.ts
packages/hoppscotch-backend/src/auth/helper.ts
import { HttpException, HttpStatus } from '@nestjs/common'; import { AuthTokens } from 'src/types/AuthTokens'; import { Response } from 'express'; import * as cookie from 'cookie'; import { AUTH_HEADER_NOT_FOUND, AUTH_PROVIDER_NOT_SPECIFIED, COOKIES_NOT_FOUND, INVALID_AUTH_HEADER, } from 'src/errors'; import { ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/auth.module.ts
packages/hoppscotch-backend/src/auth/auth.module.ts
import { Module } from '@nestjs/common'; import { AuthService } from './auth.service'; import { AuthController } from './auth.controller'; import { UserModule } from 'src/user/user.module'; import { PassportModule } from '@nestjs/passport'; import { JwtModule } from '@nestjs/jwt'; import { JwtStrategy } from './strateg...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/auth.controller.ts
packages/hoppscotch-backend/src/auth/auth.controller.ts
import { Body, Controller, Get, Post, Query, Request, Res, UseGuards, UseInterceptors, } from '@nestjs/common'; import { AuthService } from './auth.service'; import { SignInMagicDto } from './dto/signin-magic.dto'; import { VerifyMagicDto } from './dto/verify-magic.dto'; import { Response } from 'expr...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/auth.service.ts
packages/hoppscotch-backend/src/auth/auth.service.ts
import { HttpStatus, Injectable } from '@nestjs/common'; import { MailerService } from 'src/mailer/mailer.service'; import { PrismaService } from 'src/prisma/prisma.service'; import { UserService } from 'src/user/user.service'; import { VerifyMagicDto } from './dto/verify-magic.dto'; import * as argon2 from 'argon2'; i...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/dto/signin-magic.dto.ts
packages/hoppscotch-backend/src/auth/dto/signin-magic.dto.ts
// Inputs to initiate Magic-Link auth flow export class SignInMagicDto { email: string; }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/dto/verify-magic.dto.ts
packages/hoppscotch-backend/src/auth/dto/verify-magic.dto.ts
// Inputs to verify and sign a user in via magic-link export class VerifyMagicDto { deviceIdentifier: string; token: string; }
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/guards/github-sso.guard.ts
packages/hoppscotch-backend/src/auth/guards/github-sso.guard.ts
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { AuthProvider, authProviderCheck } from '../helper'; import { Observable } from 'rxjs'; import { AUTH_PROVIDER_NOT_SPECIFIED } from 'src/errors'; import { ConfigService } from '@nestjs/confi...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/guards/microsoft-sso.guard.ts
packages/hoppscotch-backend/src/auth/guards/microsoft-sso.guard.ts
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { AuthProvider, authProviderCheck } from '../helper'; import { Observable } from 'rxjs'; import { AUTH_PROVIDER_NOT_SPECIFIED } from 'src/errors'; import { ConfigService } from '@nestjs/confi...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/guards/jwt-auth.guard.ts
packages/hoppscotch-backend/src/auth/guards/jwt-auth.guard.ts
import { Injectable } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; @Injectable() export class JwtAuthGuard extends AuthGuard('jwt') {}
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/guards/rt-jwt-auth.guard.ts
packages/hoppscotch-backend/src/auth/guards/rt-jwt-auth.guard.ts
import { Injectable } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; @Injectable() export class RTJwtAuthGuard extends AuthGuard('jwt-refresh') {}
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/guards/google-sso.guard.ts
packages/hoppscotch-backend/src/auth/guards/google-sso.guard.ts
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { AuthProvider, authProviderCheck } from '../helper'; import { Observable } from 'rxjs'; import { AUTH_PROVIDER_NOT_SPECIFIED } from 'src/errors'; import { ConfigService } from '@nestjs/confi...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/strategies/github.strategy.ts
packages/hoppscotch-backend/src/auth/strategies/github.strategy.ts
import { Strategy, Profile } from 'passport-github2'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, UnauthorizedException } from '@nestjs/common'; import { AuthService } from '../auth.service'; import { UserService } from 'src/user/user.service'; import * as O from 'fp-ts/Option'; import * a...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts
packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts
import { Strategy } from 'passport-microsoft'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, UnauthorizedException } from '@nestjs/common'; import { AuthService } from '../auth.service'; import { UserService } from 'src/user/user.service'; import * as O from 'fp-ts/Option'; import * as E fro...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/strategies/jwt.strategy.ts
packages/hoppscotch-backend/src/auth/strategies/jwt.strategy.ts
import { ExtractJwt, Strategy } from 'passport-jwt'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, ForbiddenException, UnauthorizedException, } from '@nestjs/common'; import { AccessTokenPayload } from 'src/types/AuthTokens'; import { UserService } from 'src/user/user.service'; import ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/strategies/rt-jwt.strategy.ts
packages/hoppscotch-backend/src/auth/strategies/rt-jwt.strategy.ts
import { ExtractJwt, Strategy } from 'passport-jwt'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, ForbiddenException, UnauthorizedException, } from '@nestjs/common'; import { UserService } from 'src/user/user.service'; import { Request } from 'express'; import { RefreshTokenPayload } ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/auth/strategies/google.strategy.ts
packages/hoppscotch-backend/src/auth/strategies/google.strategy.ts
import { Strategy, VerifyCallback, Profile } from 'passport-google-oauth20'; import { PassportStrategy } from '@nestjs/passport'; import { Injectable, UnauthorizedException } from '@nestjs/common'; import { UserService } from 'src/user/user.service'; import * as O from 'fp-ts/Option'; import { AuthService } from '../au...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/mailer/helper.ts
packages/hoppscotch-backend/src/mailer/helper.ts
import { TransportType } from '@nestjs-modules/mailer/dist/interfaces/mailer-options.interface'; import { MAILER_SMTP_PASSWORD_UNDEFINED, MAILER_SMTP_URL_UNDEFINED, MAILER_SMTP_USER_UNDEFINED, } from 'src/errors'; import { throwErr } from 'src/utils'; function isSMTPCustomConfigsEnabled(value) { return value =...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/mailer/MailDescriptions.ts
packages/hoppscotch-backend/src/mailer/MailDescriptions.ts
export type MailDescription = { template: 'team-invitation'; variables: { invitee: string; invite_team_name: string; action_url: string; }; }; export type UserMagicLinkMailDescription = { template: 'user-invitation'; variables: { inviteeEmail: string; magicLink: string; }; }; export ty...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/mailer/mailer.module.ts
packages/hoppscotch-backend/src/mailer/mailer.module.ts
import { Global, Module } from '@nestjs/common'; import { MailerModule as NestMailerModule } from '@nestjs-modules/mailer'; import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; import { MailerService } from './mailer.service'; import { loadInfraConfiguration } from 'src/infra-con...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/mailer/mailer.service.ts
packages/hoppscotch-backend/src/mailer/mailer.service.ts
import { Injectable, Optional } from '@nestjs/common'; import { AdminUserInvitationMailDescription, MailDescription, UserMagicLinkMailDescription, } from './MailDescriptions'; import { throwErr } from 'src/utils'; import { EMAIL_FAILED } from 'src/errors'; import { MailerService as NestMailerService } from '@nest...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/orchestration/sort/sort.service.ts
packages/hoppscotch-backend/src/orchestration/sort/sort.service.ts
import { Injectable } from '@nestjs/common'; import { TeamCollectionService } from 'src/team-collection/team-collection.service'; import * as E from 'fp-ts/Either'; import { SortOptions } from 'src/types/SortOptions'; import { TeamRequestService } from 'src/team-request/team-request.service'; import { PubSubService } f...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/orchestration/sort/sort.module.ts
packages/hoppscotch-backend/src/orchestration/sort/sort.module.ts
import { Module } from '@nestjs/common'; import { SortTeamCollectionResolver } from './sort-team-collection.resolver'; import { SortService } from './sort.service'; import { TeamCollectionModule } from 'src/team-collection/team-collection.module'; import { TeamRequestModule } from 'src/team-request/team-request.module'...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/orchestration/sort/sort-user-collection.resolver.ts
packages/hoppscotch-backend/src/orchestration/sort/sort-user-collection.resolver.ts
import { UseGuards } from '@nestjs/common'; import { Args, ID, Mutation, Resolver, Subscription } from '@nestjs/graphql'; import { GqlThrottlerGuard } from 'src/guards/gql-throttler.guard'; import { SortService } from './sort.service'; import { GqlAuthGuard } from 'src/guards/gql-auth.guard'; import { SortOptions } fro...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/orchestration/sort/sort-team-collection.resolver.ts
packages/hoppscotch-backend/src/orchestration/sort/sort-team-collection.resolver.ts
import { UseGuards } from '@nestjs/common'; import { Args, ID, Mutation, Resolver, Subscription } from '@nestjs/graphql'; import { GqlThrottlerGuard } from 'src/guards/gql-throttler.guard'; import { TeamCollection } from 'src/team-collection/team-collection.model'; import { SortService } from './sort.service'; import {...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/orchestration/sort/sort.model.ts
packages/hoppscotch-backend/src/orchestration/sort/sort.model.ts
import { Field, ID, ObjectType } from '@nestjs/graphql'; import { SortOptions } from 'src/types/SortOptions'; @ObjectType() export class UserCollectionSortData { @Field(() => ID, { description: 'ID of the parent collection', nullable: true, }) parentCollectionID: string; @Field(() => SortOptions, { ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/orchestration/sort/sort.service.spec.ts
packages/hoppscotch-backend/src/orchestration/sort/sort.service.spec.ts
import { mockDeep } from 'jest-mock-extended'; import { PubSubService } from 'src/pubsub/pubsub.service'; import { TeamCollectionService } from 'src/team-collection/team-collection.service'; import { TeamRequestService } from 'src/team-request/team-request.service'; import { UserRequestService } from 'src/user-request/...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/team-collection.model.ts
packages/hoppscotch-backend/src/team-collection/team-collection.model.ts
import { ObjectType, Field, ID } from '@nestjs/graphql'; @ObjectType() export class TeamCollection { @Field(() => ID, { description: 'ID of the collection', }) id: string; @Field({ description: 'Displayed title of the collection', }) title: string; @Field({ description: 'JSON string represe...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/helper.ts
packages/hoppscotch-backend/src/team-collection/helper.ts
import { TeamRequest } from 'src/generated/prisma/client'; // Type of data returned from the query to obtain all search results export type SearchQueryReturnType = { id: string; title: string; type: 'collection' | 'request'; method?: string; }; // Type of data returned from the query to obtain all parents exp...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/input-type.args.ts
packages/hoppscotch-backend/src/team-collection/input-type.args.ts
import { ArgsType, Field, ID } from '@nestjs/graphql'; import { PaginationArgs } from 'src/types/input-types.args'; @ArgsType() export class GetRootTeamCollectionsArgs extends PaginationArgs { @Field(() => ID, { name: 'teamID', description: 'ID of the team' }) teamID: string; } @ArgsType() export class CreateRoot...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/team-collection.controller.ts
packages/hoppscotch-backend/src/team-collection/team-collection.controller.ts
import { Controller, Get, HttpStatus, Param, Query, UseGuards, } from '@nestjs/common'; import { TeamCollectionService } from './team-collection.service'; import * as E from 'fp-ts/Either'; import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard'; import { JwtAuthGuard } from 'src...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/team-collection.service.spec.ts
packages/hoppscotch-backend/src/team-collection/team-collection.service.spec.ts
import { Team, TeamCollection as DBTeamCollection, } from 'src/generated/prisma/client'; import { mockDeep, mockReset } from 'jest-mock-extended'; import { TEAM_COLL_DATA_INVALID, TEAM_COLL_DEST_SAME, TEAM_COLL_INVALID_JSON, TEAM_COLL_IS_PARENT_COLL, TEAM_COLL_NOT_FOUND, TEAM_COLL_NOT_SAME_TEAM, TEAM_...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
true
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts
packages/hoppscotch-backend/src/team-collection/team-collection.service.ts
import { ConflictException, HttpStatus, Injectable } from '@nestjs/common'; import { PrismaService } from '../prisma/prisma.service'; import { TeamCollection } from './team-collection.model'; import { TEAM_COLL_SHORT_TITLE, TEAM_COLL_INVALID_JSON, TEAM_INVALID_COLL_ID, TEAM_NOT_OWNER, TEAM_COLL_NOT_FOUND, T...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
true
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/team-collection.resolver.ts
packages/hoppscotch-backend/src/team-collection/team-collection.resolver.ts
import { Resolver, ResolveField, Parent, Args, Query, Mutation, Subscription, ID, } from '@nestjs/graphql'; import { CollectionReorderData, TeamCollection } from './team-collection.model'; import { Team, TeamAccessRole } from '../team/team.model'; import { TeamCollectionService } from './team-collection...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/team-collection.module.ts
packages/hoppscotch-backend/src/team-collection/team-collection.module.ts
import { Module } from '@nestjs/common'; import { TeamCollectionService } from './team-collection.service'; import { TeamCollectionResolver } from './team-collection.resolver'; import { GqlCollectionTeamMemberGuard } from './guards/gql-collection-team-member.guard'; import { TeamModule } from '../team/team.module'; imp...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-collection/guards/gql-collection-team-member.guard.ts
packages/hoppscotch-backend/src/team-collection/guards/gql-collection-team-member.guard.ts
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { GqlExecutionContext } from '@nestjs/graphql'; import { TeamCollectionService } from '../team-collection.service'; import { TeamService } from '../../team/team.service'; import { TeamAccessRole ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user/user.resolver.ts
packages/hoppscotch-backend/src/user/user.resolver.ts
import { Resolver, Query, Mutation, Args, Subscription } from '@nestjs/graphql'; import { SessionType, User } from './user.model'; import { UseGuards } from '@nestjs/common'; import { GqlAuthGuard } from '../guards/gql-auth.guard'; import { GqlUser } from '../decorators/gql-user.decorator'; import { UserService } from ...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user/user.data.handler.ts
packages/hoppscotch-backend/src/user/user.data.handler.ts
import * as T from 'fp-ts/Task'; import * as TO from 'fp-ts/TaskOption'; import { AuthUser } from '../types/AuthUser'; /** * Defines how external services should handle User Data and User data related operations and actions. */ export interface UserDataHandler { canAllowUserDeletion: (user: AuthUser) => TO.TaskOpt...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false
hoppscotch/hoppscotch
https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user/user.model.ts
packages/hoppscotch-backend/src/user/user.model.ts
import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql'; @ObjectType() export class User { @Field(() => ID, { description: 'UID of the user', }) uid: string; @Field({ nullable: true, description: 'Name of the user (if fetched)', }) displayName?: string; @Field({ nullab...
typescript
MIT
67dff5fe0f99312690c1cb0059388aee804b30e0
2026-01-04T15:25:31.920196Z
false