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-backend/src/team-environments/gql-team-env-team.guard.ts | packages/hoppscotch-backend/src/team-environments/gql-team-env-team.guard.ts | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { TeamEnvironmentsService } from './team-environments.service';
import {
BUG_AUTH_NO_USER_CTX,
BUG_TEAM_ENV_GUARD_NO_ENV_ID,
BUG_TEAM_ENV_GUARD_NO_REQUIRE_ROLES,
TEAM_ENVIRONMENT_NOT_TEAM... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/interceptors/user-last-active-on.interceptor.ts | packages/hoppscotch-backend/src/interceptors/user-last-active-on.interceptor.ts | import {
Injectable,
NestInterceptor,
ExecutionContext,
CallHandler,
} from '@nestjs/common';
import { GqlContextType, GqlExecutionContext } from '@nestjs/graphql';
import { Observable, throwError } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';
import { AuthUser } from 'src/types/AuthUser';
imp... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/interceptors/access-token.interceptor.ts | packages/hoppscotch-backend/src/interceptors/access-token.interceptor.ts | import {
BadRequestException,
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
} from '@nestjs/common';
import { Observable, map } from 'rxjs';
import { AccessTokenService } from 'src/access-token/access-token.service';
import * as E from 'fp-ts/Either';
import { ACCESS_TOKEN_NOT_FOUND } 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/interceptors/infra-token.interceptor.ts | packages/hoppscotch-backend/src/interceptors/infra-token.interceptor.ts | import {
BadRequestException,
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
} from '@nestjs/common';
import { Observable } from 'rxjs';
import { INFRA_TOKEN_NOT_FOUND } from 'src/errors';
import { InfraTokenService } from 'src/infra-token/infra-token.service';
@Injectable()
export class InfraTo... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/interceptors/user-last-login.interceptor.ts | packages/hoppscotch-backend/src/interceptors/user-last-login.interceptor.ts | import {
Injectable,
NestInterceptor,
ExecutionContext,
CallHandler,
} from '@nestjs/common';
import { Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
import { AuthUser } from 'src/types/AuthUser';
import { UserService } from 'src/user/user.service';
@Injectable()
export class UserLastLoginInte... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts | packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts | import { UseGuards } from '@nestjs/common';
import {
Args,
ID,
Mutation,
Parent,
ResolveField,
Resolver,
Query,
} from '@nestjs/graphql';
import { GqlThrottlerGuard } from 'src/guards/gql-throttler.guard';
import { PublishedDocs, PublishedDocsCollection } from './published-docs.model';
import { GqlAuthGua... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts | packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts | import { PublishedDocs as DBPublishedDocs } from 'src/generated/prisma/client';
import { mockDeep, mockReset } from 'jest-mock-extended';
import {
PUBLISHED_DOCS_CREATION_FAILED,
PUBLISHED_DOCS_DELETION_FAILED,
PUBLISHED_DOCS_INVALID_COLLECTION,
PUBLISHED_DOCS_NOT_FOUND,
PUBLISHED_DOCS_UPDATE_FAILED,
TEAM_I... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | true |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.model.ts | packages/hoppscotch-backend/src/published-docs/published-docs.model.ts | import { ObjectType, Field, ID } from '@nestjs/graphql';
import { ApiProperty } from '@nestjs/swagger';
@ObjectType()
export class PublishedDocs {
@Field(() => ID, {
description: 'ID of the published API documentation',
})
@ApiProperty({
description: 'ID of the published API documentation',
example: ... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/input-type.args.ts | packages/hoppscotch-backend/src/published-docs/input-type.args.ts | import { InputType, Field } from '@nestjs/graphql';
import { IsOptional, Matches } from 'class-validator';
import { WorkspaceType } from 'src/types/WorkspaceTypes';
@InputType()
export class CreatePublishedDocsArgs {
@Field({
name: 'title',
description: 'Title of the published document',
})
title: string... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.module.ts | packages/hoppscotch-backend/src/published-docs/published-docs.module.ts | import { Module } from '@nestjs/common';
import { PublishedDocsResolver } from './published-docs.resolver';
import { PublishedDocsService } from './published-docs.service';
import { TeamModule } from 'src/team/team.module';
import { PublishedDocsController } from './published-docs.controller';
import { UserCollectionMo... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.service.ts | packages/hoppscotch-backend/src/published-docs/published-docs.service.ts | import { Injectable } from '@nestjs/common';
import {
CreatePublishedDocsArgs,
UpdatePublishedDocsArgs,
} from './input-type.args';
import { PrismaService } from 'src/prisma/prisma.service';
import { PublishedDocs as DbPublishedDocs } from 'src/generated/prisma/client';
import { TeamAccessRole } from 'src/team/team... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.controller.ts | packages/hoppscotch-backend/src/published-docs/published-docs.controller.ts | import {
Controller,
Get,
Param,
Query,
HttpCode,
HttpStatus,
} from '@nestjs/common';
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
import { PublishedDocsService } from './published-docs.service';
import { GetPublishedDocsQueryDto } from './published-docs.dto';
import * as E from 'f... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/published-docs/published-docs.dto.ts | packages/hoppscotch-backend/src/published-docs/published-docs.dto.ts | import { IsEnum, IsOptional } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
export enum TreeLevel {
FULL = 'full',
FIRST_LEVEL = 'first_level',
}
export class GetPublishedDocsQueryDto {
@ApiPropertyOptional({
description: 'Specifies whether to return full tree or only first ... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/infra-token/infra-token.service.ts | packages/hoppscotch-backend/src/infra-token/infra-token.service.ts | import { Injectable } from '@nestjs/common';
import { InfraToken as dbInfraToken } from 'src/generated/prisma/client';
import { PrismaService } from 'src/prisma/prisma.service';
import { CreateInfraTokenResponse, InfraToken } from './infra-token.model';
import { calculateExpirationDate, isValidLength } from 'src/utils'... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/infra-token/infra-token.controller.ts | packages/hoppscotch-backend/src/infra-token/infra-token.controller.ts | import {
Body,
Controller,
Delete,
Get,
HttpStatus,
Param,
Patch,
Post,
Query,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { plainToInstance } from 'class-transformer';
import { AdminService } from 'src/admin/admin.service';
import { InfraTokenGuard } from 'src/guards/infra-token.g... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/infra-token/infra-token.resolver.ts | packages/hoppscotch-backend/src/infra-token/infra-token.resolver.ts | import { Args, ID, Mutation, Query, Resolver } from '@nestjs/graphql';
import { CreateInfraTokenResponse, InfraToken } from './infra-token.model';
import { UseGuards } from '@nestjs/common';
import { GqlThrottlerGuard } from 'src/guards/gql-throttler.guard';
import { InfraTokenService } from './infra-token.service';
im... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/infra-token/request-response.dto.ts | packages/hoppscotch-backend/src/infra-token/request-response.dto.ts | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Expose, Type } from 'class-transformer';
import {
ArrayMinSize,
IsArray,
IsBoolean,
IsNotEmpty,
IsOptional,
IsString,
MinLength,
} from 'class-validator';
import { TeamAccessRole } from 'src/team/team.model';
import { OffsetPagin... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/infra-token/infra-token.module.ts | packages/hoppscotch-backend/src/infra-token/infra-token.module.ts | import { Module } from '@nestjs/common';
import { InfraTokenResolver } from './infra-token.resolver';
import { InfraTokenService } from './infra-token.service';
import { InfraTokensController } from './infra-token.controller';
import { AdminModule } from 'src/admin/admin.module';
import { UserModule } from 'src/user/us... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/infra-token/infra-token.model.ts | packages/hoppscotch-backend/src/infra-token/infra-token.model.ts | import { Field, ID, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class InfraToken {
@Field(() => ID, {
description: 'ID of the infra token',
})
id: string;
@Field(() => String, {
description: 'Label of the infra token',
})
label: string;
@Field(() => Date, {
description: 'Date ... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-teaminvite-ext.resolver.ts | packages/hoppscotch-backend/src/team-invitation/team-teaminvite-ext.resolver.ts | import { Parent, ResolveField, Resolver } from '@nestjs/graphql';
import { Team } from 'src/team/team.model';
import { TeamInvitation } from './team-invitation.model';
import { TeamInvitationService } from './team-invitation.service';
@Resolver(() => Team)
export class TeamTeamInviteExtResolver {
constructor(private... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invitation.module.ts | packages/hoppscotch-backend/src/team-invitation/team-invitation.module.ts | import { Module } from '@nestjs/common';
import { TeamModule } from 'src/team/team.module';
import { UserModule } from 'src/user/user.module';
import { TeamInvitationResolver } from './team-invitation.resolver';
import { TeamInvitationService } from './team-invitation.service';
import { TeamInviteTeamOwnerGuard } from ... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invitation.resolver.ts | packages/hoppscotch-backend/src/team-invitation/team-invitation.resolver.ts | import {
Args,
ID,
Mutation,
Parent,
Query,
ResolveField,
Resolver,
Subscription,
} from '@nestjs/graphql';
import { TeamInvitation } from './team-invitation.model';
import { TeamInvitationService } from './team-invitation.service';
import { pipe } from 'fp-ts/function';
import * as TE from 'fp-ts/TaskE... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invite-viewer.guard.ts | packages/hoppscotch-backend/src/team-invitation/team-invite-viewer.guard.ts | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { TeamInvitationService } from './team-invitation.service';
import * as O from 'fp-ts/Option';
import { GqlExecutionContext } from '@nestjs/graphql';
import {
BUG_AUTH_NO_USER_CTX,
BUG_TEAM_INVITE_NO_INVITE_ID,
TEAM_INVITE_NO_INVIT... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/input-type.args.ts | packages/hoppscotch-backend/src/team-invitation/input-type.args.ts | import { ArgsType, Field, ID } from '@nestjs/graphql';
import { TeamAccessRole } from 'src/team/team.model';
@ArgsType()
export class CreateTeamInvitationArgs {
@Field(() => ID, {
name: 'teamID',
description: 'ID of the Team ID to invite from',
})
teamID: string;
@Field({ name: 'inviteeEmail', descrip... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invitation.model.ts | packages/hoppscotch-backend/src/team-invitation/team-invitation.model.ts | import { Field, ID, ObjectType } from '@nestjs/graphql';
import { TeamAccessRole } from '../team/team.model';
@ObjectType()
export class TeamInvitation {
@Field(() => ID, {
description: 'ID of the invite',
})
id: string;
@Field(() => ID, {
description: 'ID of the team the invite is to',
})
teamID:... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invite-team-owner.guard.ts | packages/hoppscotch-backend/src/team-invitation/team-invite-team-owner.guard.ts | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { TeamService } from 'src/team/team.service';
import { TeamInvitationService } from './team-invitation.service';
import * as O from 'fp-ts/Option';
import { GqlExecutionContext } from '@nestjs/graphql';
import {
BUG_AUTH_NO_USER_CTX,
... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invitation.service.ts | packages/hoppscotch-backend/src/team-invitation/team-invitation.service.ts | import { Injectable } from '@nestjs/common';
import * as O from 'fp-ts/Option';
import * as E from 'fp-ts/Either';
import { PrismaService } from 'src/prisma/prisma.service';
import { TeamInvitation as DBTeamInvitation } from 'src/generated/prisma/client';
import { TeamMember, TeamAccessRole } from 'src/team/team.model'... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-invitation/team-invitee.guard.ts | packages/hoppscotch-backend/src/team-invitation/team-invitee.guard.ts | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { TeamInvitationService } from './team-invitation.service';
import * as O from 'fp-ts/Option';
import { GqlExecutionContext } from '@nestjs/graphql';
import {
BUG_AUTH_NO_USER_CTX,
BUG_TEAM_INVITE_NO_INVITE_ID,
TEAM_INVITE_EMAIL_DO... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/user-request.model.ts | packages/hoppscotch-backend/src/user-request/user-request.model.ts | import { Field, ID, ObjectType } from '@nestjs/graphql';
import { ReqType } from 'src/types/RequestTypes';
@ObjectType()
export class UserRequest {
@Field(() => ID, {
description: 'ID of the user request',
})
id: string;
@Field(() => ID, {
description: 'ID of the parent collection ID',
})
collecti... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/input-type.args.ts | packages/hoppscotch-backend/src/user-request/input-type.args.ts | import { Field, ID, ArgsType } from '@nestjs/graphql';
import { PaginationArgs } from 'src/types/input-types.args';
import { ReqType } from 'src/types/RequestTypes';
@ArgsType()
export class GetUserRequestArgs extends PaginationArgs {
@Field(() => ID, {
nullable: true,
defaultValue: undefined,
descriptio... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/user-request.service.spec.ts | packages/hoppscotch-backend/src/user-request/user-request.service.spec.ts | import {
ReqType as DbRequestType,
UserRequest as DbUserRequest,
} from 'src/generated/prisma/client';
import { mockDeep, mockReset } from 'jest-mock-extended';
import {
JSON_INVALID,
USER_REQUEST_NOT_FOUND,
USER_REQUEST_REORDERING_FAILED,
} from 'src/errors';
import { PrismaService } from 'src/prisma/prisma.... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/user-request.module.ts | packages/hoppscotch-backend/src/user-request/user-request.module.ts | import { Module } from '@nestjs/common';
import { UserCollectionModule } from 'src/user-collection/user-collection.module';
import { UserRequestUserCollectionResolver } from './resolvers/user-collection.resolver';
import { UserRequestResolver } from './resolvers/user-request.resolver';
import { UserRequestService } fro... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/user-request.service.ts | packages/hoppscotch-backend/src/user-request/user-request.service.ts | import { ConflictException, Injectable } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
import { PubSubService } from '../pubsub/pubsub.service';
import * as E from 'fp-ts/Either';
import { UserRequest } from './user-request.model';
import {
Prisma,
UserRequest as DbUserRequest,
} ... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/resolvers/user-collection.resolver.ts | packages/hoppscotch-backend/src/user-request/resolvers/user-collection.resolver.ts | import { Args, Parent, ResolveField, Resolver } from '@nestjs/graphql';
import * as E from 'fp-ts/Either';
import { throwErr } from 'src/utils';
import { UserRequestService } from '../user-request.service';
import { UserRequest } from '../user-request.model';
import { AuthUser } from 'src/types/AuthUser';
import { User... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-request/resolvers/user-request.resolver.ts | packages/hoppscotch-backend/src/user-request/resolvers/user-request.resolver.ts | import { UseGuards } from '@nestjs/common';
import {
Args,
ID,
Mutation,
Query,
ResolveField,
Resolver,
Subscription,
} from '@nestjs/graphql';
import { GqlUser } from 'src/decorators/gql-user.decorator';
import { GqlAuthGuard } from 'src/guards/gql-auth.guard';
import { PubSubService } from 'src/pubsub/p... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-history/user.resolver.ts | packages/hoppscotch-backend/src/user-history/user.resolver.ts | import { Args, Parent, ResolveField, Resolver } from '@nestjs/graphql';
import { User } from '../user/user.model';
import { UserHistoryService } from './user-history.service';
import { UserHistory } from './user-history.model';
import { ReqType } from 'src/types/RequestTypes';
import { PaginationArgs } from '../types/i... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-history/user-history.service.ts | packages/hoppscotch-backend/src/user-history/user-history.service.ts | import { Injectable } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
import { PubSubService } from '../pubsub/pubsub.service';
import { UserHistory } from './user-history.model';
import { ReqType } from 'src/types/RequestTypes';
import * as E from 'fp-ts/Either';
import * as O from 'fp... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-history/user-history.model.ts | packages/hoppscotch-backend/src/user-history/user-history.model.ts | import { Field, ID, ObjectType, registerEnumType } from '@nestjs/graphql';
import { ReqType } from 'src/types/RequestTypes';
@ObjectType()
export class UserHistory {
@Field(() => ID, {
description: 'ID of the user request in history',
})
id: string;
@Field(() => ID, {
description: 'ID of the user this... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts | packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts | import { UserHistoryService } from './user-history.service';
import { PrismaService } from '../prisma/prisma.service';
import { PubSubService } from '../pubsub/pubsub.service';
import { mockDeep, mockReset } from 'jest-mock-extended';
import { UserHistory } from './user-history.model';
import { ReqType } from 'src/type... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-history/user-history.resolver.ts | packages/hoppscotch-backend/src/user-history/user-history.resolver.ts | import { Args, ID, Mutation, Resolver, Subscription } from '@nestjs/graphql';
import { UserHistoryService } from './user-history.service';
import { PubSubService } from '../pubsub/pubsub.service';
import { UserHistory, UserHistoryDeletedManyData } from './user-history.model';
import { ReqType } from 'src/types/RequestT... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/user-history/user-history-feature-flag.guard.ts | packages/hoppscotch-backend/src/user-history/user-history-feature-flag.guard.ts | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { USER_HISTORY_FEATURE_FLAG_DISABLED } from 'src/errors';
import { InfraConfigService } from 'src/infra-config/infra-config.service';
import { throwErr } from 'src/utils';
import * as E from 'fp-ts/Either';
import { ServiceStatus } 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-history/user-history.module.ts | packages/hoppscotch-backend/src/user-history/user-history.module.ts | import { Module } from '@nestjs/common';
import { UserModule } from '../user/user.module';
import { UserHistoryUserResolver } from './user.resolver';
import { UserHistoryResolver } from './user-history.resolver';
import { UserHistoryService } from './user-history.service';
import { InfraConfigModule } from 'src/infra-c... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-request/team-request.resolver.ts | packages/hoppscotch-backend/src/team-request/team-request.resolver.ts | import {
Resolver,
ResolveField,
Parent,
Args,
Query,
Mutation,
Subscription,
ID,
} from '@nestjs/graphql';
import { RequestReorderData, TeamRequest } from './team-request.model';
import {
CreateTeamRequestInput,
UpdateTeamRequestInput,
SearchTeamRequestArgs,
GetTeamRequestInCollectionArgs,
Mo... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts | packages/hoppscotch-backend/src/team-request/team-request.service.spec.ts | import { PrismaService } from '../prisma/prisma.service';
import { TeamCollectionService } from '../team-collection/team-collection.service';
import { TeamService } from '../team/team.service';
import { TeamRequestService } from './team-request.service';
import {
TEAM_REQ_INVALID_TARGET_COLL_ID,
TEAM_INVALID_COLL_I... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-request/team-request.service.ts | packages/hoppscotch-backend/src/team-request/team-request.service.ts | import { ConflictException, Injectable } from '@nestjs/common';
import { TeamService } from '../team/team.service';
import { PrismaService } from '../prisma/prisma.service';
import { TeamRequest } from './team-request.model';
import { TeamCollectionService } from '../team-collection/team-collection.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/team-request/team-request.module.ts | packages/hoppscotch-backend/src/team-request/team-request.module.ts | import { Module } from '@nestjs/common';
import { TeamRequestService } from './team-request.service';
import { TeamRequestResolver } from './team-request.resolver';
import { TeamModule } from '../team/team.module';
import { TeamCollectionModule } from '../team-collection/team-collection.module';
import { GqlRequestTeam... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-request/input-type.args.ts | packages/hoppscotch-backend/src/team-request/input-type.args.ts | import { Field, ID, InputType, ArgsType } from '@nestjs/graphql';
import { PaginationArgs } from 'src/types/input-types.args';
@InputType()
export class CreateTeamRequestInput {
@Field(() => ID, {
description: 'ID of the team the collection belongs to',
})
teamID: string;
@Field({
description: 'JSON s... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-request/team-request.model.ts | packages/hoppscotch-backend/src/team-request/team-request.model.ts | import { ObjectType, Field, ID } from '@nestjs/graphql';
@ObjectType()
export class TeamRequest {
@Field(() => ID, {
description: 'ID of the request',
})
id: string;
@Field(() => ID, {
description: 'ID of the collection the request belongs to.',
})
collectionID: string;
@Field(() => ID, {
d... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/src/team-request/guards/gql-request-team-member.guard.ts | packages/hoppscotch-backend/src/team-request/guards/gql-request-team-member.guard.ts | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import { GqlExecutionContext } from '@nestjs/graphql';
import { TeamRequestService } from '../team-request.service';
import { TeamService } from '../../team/team.service';
import { Reflector } from '@nestjs/core';
import { TeamAccessRole } from... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
hoppscotch/hoppscotch | https://github.com/hoppscotch/hoppscotch/blob/67dff5fe0f99312690c1cb0059388aee804b30e0/packages/hoppscotch-backend/test/app.e2e-spec.ts | packages/hoppscotch-backend/test/app.e2e-spec.ts | import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';
describe('AppController (e2e)', () => {
let app: INestApplication;
beforeEach(async () => {
const moduleFixture: Test... | typescript | MIT | 67dff5fe0f99312690c1cb0059388aee804b30e0 | 2026-01-04T15:25:31.920196Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/types.d.ts | src/types.d.ts | declare interface ImportMeta {
env?: {
MODE: string
}
}
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/react.ts | src/react.ts | import React from 'react'
import { createStore } from './vanilla.ts'
import type {
ExtractState,
Mutate,
StateCreator,
StoreApi,
StoreMutatorIdentifier,
} from './vanilla.ts'
type ReadonlyStoreApi<T> = Pick<
StoreApi<T>,
'getState' | 'getInitialState' | 'subscribe'
>
const identity = <T>(arg: T): T => a... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware.ts | src/middleware.ts | export { redux } from './middleware/redux.ts'
export {
devtools,
type DevtoolsOptions,
type NamedSet,
} from './middleware/devtools.ts'
export { subscribeWithSelector } from './middleware/subscribeWithSelector.ts'
export { combine } from './middleware/combine.ts'
export {
persist,
createJSONStorage,
type St... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/shallow.ts | src/shallow.ts | export { shallow } from './vanilla/shallow.ts'
export { useShallow } from './react/shallow.ts'
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/traditional.ts | src/traditional.ts | import React from 'react'
import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector'
import { createStore } from './vanilla.ts'
import type {
ExtractState,
Mutate,
StateCreator,
StoreApi,
StoreMutatorIdentifier,
} from './vanilla.ts'
const { useSyncExternalStoreWithSelector } = useS... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/index.ts | src/index.ts | export * from './vanilla.ts'
export * from './react.ts'
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/vanilla.ts | src/vanilla.ts | type SetStateInternal<T> = {
_(
partial: T | Partial<T> | { _(state: T): T | Partial<T> }['_'],
replace?: false,
): void
_(state: T | { _(state: T): T }['_'], replace: true): void
}['_']
export interface StoreApi<T> {
setState: SetStateInternal<T>
getState: () => T
getInitialState: () => T
subscr... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/persist.ts | src/middleware/persist.ts | import type {
StateCreator,
StoreApi,
StoreMutatorIdentifier,
} from '../vanilla.ts'
export interface StateStorage<R = unknown> {
getItem: (name: string) => string | null | Promise<string | null>
setItem: (name: string, value: string) => R
removeItem: (name: string) => R
}
export type StorageValue<S> = {
... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/combine.ts | src/middleware/combine.ts | import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.ts'
type Write<T, U> = Omit<T, keyof U> & U
export function combine<
T extends object,
U extends object,
Mps extends [StoreMutatorIdentifier, unknown][] = [],
Mcs extends [StoreMutatorIdentifier, unknown][] = [],
>(
initialState: T,
cre... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/immer.ts | src/middleware/immer.ts | import { produce } from 'immer'
import type { Draft } from 'immer'
import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.ts'
type Immer = <
T,
Mps extends [StoreMutatorIdentifier, unknown][] = [],
Mcs extends [StoreMutatorIdentifier, unknown][] = [],
>(
initializer: StateCreator<T, [...Mps, ['z... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/subscribeWithSelector.ts | src/middleware/subscribeWithSelector.ts | import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.ts'
type SubscribeWithSelector = <
T,
Mps extends [StoreMutatorIdentifier, unknown][] = [],
Mcs extends [StoreMutatorIdentifier, unknown][] = [],
>(
initializer: StateCreator<
T,
[...Mps, ['zustand/subscribeWithSelector', never]],
... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/redux.ts | src/middleware/redux.ts | import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.ts'
import type { NamedSet } from './devtools.ts'
type Write<T, U> = Omit<T, keyof U> & U
type Action = { type: string }
type StoreRedux<A> = {
dispatch: (a: A) => A
dispatchFromDevtools: true
}
type ReduxState<A> = {
dispatch: StoreRedux<A... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/ssrSafe.ts | src/middleware/ssrSafe.ts | import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.ts'
// This is experimental middleware. It will be changed before finalizing it.
// https://github.com/pmndrs/zustand/discussions/2740
// TODO Not very happy with the middleware name. Will revisit it later.
export function ssrSafe<
T extends objec... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/middleware/devtools.ts | src/middleware/devtools.ts | import type {} from '@redux-devtools/extension'
import type {
StateCreator,
StoreApi,
StoreMutatorIdentifier,
} from '../vanilla.ts'
type Config = Parameters<
(Window extends { __REDUX_DEVTOOLS_EXTENSION__?: infer T }
? T
: { connect: (param: any) => any })['connect']
>[0]
declare module '../vanilla'... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/vanilla/shallow.ts | src/vanilla/shallow.ts | const isIterable = (obj: object): obj is Iterable<unknown> =>
Symbol.iterator in obj
const hasIterableEntries = (
value: Iterable<unknown>,
): value is Iterable<unknown> & {
entries(): Iterable<[unknown, unknown]>
} =>
// HACK: avoid checking entries type
'entries' in value
const compareEntries = (
valueA... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/src/react/shallow.ts | src/react/shallow.ts | import React from 'react'
import { shallow } from '../vanilla/shallow.ts'
export function useShallow<S, U>(selector: (state: S) => U): (state: S) => U {
const prev = React.useRef<U>(undefined)
return (state) => {
const next = selector(state)
return shallow(prev.current, next)
? (prev.current as U)
... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/shallow.test.tsx | tests/shallow.test.tsx | import { useState } from 'react'
import { act, fireEvent, render, screen } from '@testing-library/react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { create } from 'zustand'
import { shallow, useShallow } from 'zustand/shallow'
import { createWithEqualityFn } from 'zustand/traditional'
descri... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/ssr.test.tsx | tests/ssr.test.tsx | import React, { useEffect } from 'react'
import { act, screen } from '@testing-library/react'
import { renderToString } from 'react-dom/server'
import { describe, expect, it, vi } from 'vitest'
import { create } from 'zustand'
interface BearStoreState {
bears: number
}
interface BearStoreAction {
increasePopulati... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/basic.test.tsx | tests/basic.test.tsx | import {
Component as ClassComponent,
StrictMode,
useEffect,
useLayoutEffect,
useState,
} from 'react'
import type { ReactNode } from 'react'
import { act, fireEvent, render, screen } from '@testing-library/react'
import ReactDOM from 'react-dom'
import { afterEach, expect, it, vi } from 'vitest'
import { cre... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/persistAsync.test.tsx | tests/persistAsync.test.tsx | /// <reference types="node" />
import { StrictMode, useEffect } from 'react'
import { act, render, screen } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { create } from 'zustand'
import { createJSONStorage, persist } from 'zustand/middleware'
import { re... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/setup.ts | tests/setup.ts | import '@testing-library/jest-dom/vitest'
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/test-utils.ts | tests/test-utils.ts | type ReplacedMap = {
type: 'Map'
value: [string, unknown][]
}
export const replacer = (
key: string,
value: unknown,
): ReplacedMap | unknown => {
if (value instanceof Map) {
return {
type: 'Map',
value: Array.from(value.entries()),
}
} else {
return value
}
}
export const revive... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/middlewareTypes.test.tsx | tests/middlewareTypes.test.tsx | /* eslint @typescript-eslint/no-unused-expressions: off */ // FIXME
import { describe, expect, expectTypeOf, it } from 'vitest'
import { create } from 'zustand'
import type { StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand'
import {
combine,
devtools,
persist,
redux,
subscribeWithSelector,
} f... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/persistSync.test.tsx | tests/persistSync.test.tsx | /// <reference types="node" />
import { afterEach, describe, expect, it, vi } from 'vitest'
import { create } from 'zustand'
import { createJSONStorage, persist } from 'zustand/middleware'
import { replacer, reviver } from './test-utils'
const createPersistentStore = (initialValue: string | null) => {
let state = i... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/types.test.tsx | tests/types.test.tsx | import { expect, it } from 'vitest'
import { create } from 'zustand'
import type {
StateCreator,
StoreApi,
StoreMutatorIdentifier,
UseBoundStore,
} from 'zustand'
import { persist } from 'zustand/middleware'
it('can use exposed types', () => {
type ExampleState = {
num: number
numGet: () => number
... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/devtools.test.tsx | tests/devtools.test.tsx | import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type { Mock } from 'vitest'
import { devtools, redux } from 'zustand/middleware'
import { createStore } from 'zustand/vanilla'
import type { StoreApi } from 'zustand/vanilla'
type TupleOfEqualLengthH<
Arr extends unknown[],
T,
Acc ex... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | true |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/subscribe.test.tsx | tests/subscribe.test.tsx | import { describe, expect, it } from 'vitest'
import { create } from 'zustand'
describe('subscribe()', () => {
it('should correctly have access to subscribe', () => {
const { subscribe } = create(() => ({ value: 1 }))
expect(typeof subscribe).toBe('function')
})
})
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/vanilla/shallow.test.tsx | tests/vanilla/shallow.test.tsx | import { describe, expect, it } from 'vitest'
import { shallow } from 'zustand/shallow'
describe('shallow', () => {
it('compares primitive values', () => {
expect(shallow(true, true)).toBe(true)
expect(shallow(true, false)).toBe(false)
expect(shallow(1, 1)).toBe(true)
expect(shallow(1, 2)).toBe(fals... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/vanilla/basic.test.ts | tests/vanilla/basic.test.ts | import { afterEach, expect, it, vi } from 'vitest'
import { createStore } from 'zustand/vanilla'
import type { StoreApi } from 'zustand/vanilla'
// To avoid include react deps on vanilla version
vi.mock('react', () => ({}))
const consoleError = console.error
afterEach(() => {
console.error = consoleError
})
it('cr... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/tests/vanilla/subscribe.test.tsx | tests/vanilla/subscribe.test.tsx | import { describe, expect, it, vi } from 'vitest'
import { subscribeWithSelector } from 'zustand/middleware'
import { createStore } from 'zustand/vanilla'
describe('subscribe()', () => {
it('should not be called if new state identity is the same', () => {
const spy = vi.fn()
const initialState = { value: 1, ... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/examples/starter/vite.config.ts | examples/starter/vite.config.ts | import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/examples/starter/src/index.tsx | examples/starter/src/index.tsx | import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { create } from 'zustand'
import mascot from './assets/zustand-mascot.svg'
import './index.css'
type Store = {
count: number
inc: () => void
}
const useStore = create<Store>((set) => ({
count: 0,
inc: () => set((state) =... | typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
pmndrs/zustand | https://github.com/pmndrs/zustand/blob/f912630524a29f12f86cecdbce1946e4da1af6d3/examples/starter/src/vite-env.d.ts | examples/starter/src/vite-env.d.ts | /// <reference types="vite/client" />
| typescript | MIT | f912630524a29f12f86cecdbce1946e4da1af6d3 | 2026-01-04T15:29:19.605759Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/profiles.ts | tabby-core/src/profiles.ts | import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
import slugify from 'slugify'
import { v4 as uuidv4 } from 'uuid'
import { Injectable } from '@angular/core'
import { ConfigService, NewTabParameters, PartialProfile, Profile, ProfileProvider } from './api'
import { SplitTabComponent, SplitTabRecover... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/config.ts | tabby-core/src/config.ts | import { ConfigProvider } from './api/configProvider'
import { Platform } from './api/hostApp'
/** @hidden */
export class CoreConfigProvider extends ConfigProvider {
platformDefaults = {
[Platform.macOS]: require('./configDefaults.macos.yaml').default,
[Platform.Windows]: require('./configDefaults... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/commands.ts | tabby-core/src/commands.ts | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Injectable } from '@angular/core'
import { TranslateService } from '@ngx-translate/core'
import { HostAppService, Platform } from './api/hostApp'
import { ProfilesService } from './services/profiles.service'
import { CommandProvider, Comma... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/utfSplitter.ts | tabby-core/src/utfSplitter.ts | const partials = [
[0b110, 5, 0],
[0b1110, 4, 1],
[0b11110, 3, 2],
]
export class UTF8Splitter {
private internal = Buffer.alloc(0)
write (data: Buffer): Buffer {
this.internal = Buffer.concat([this.internal, data])
let keep = 0
for (const [pattern, shift, maxOffset] of pa... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/utils.ts | tabby-core/src/utils.ts | import * as os from 'os'
import { NgZone } from '@angular/core'
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
export const WIN_BUILD_CONPTY_SUPPORTED = 17692
export const WIN_BUILD_CONPTY_STABLE = 18309
export const WIN_BUILD_WSL_EXE_DISTRO_FLAG = 17763
export const WIN_BUILD_FLUENT_BG_SUPPORTE... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/cli.ts | tabby-core/src/cli.ts | import { Injectable } from '@angular/core'
import { HostAppService } from './api/hostApp'
import { CLIHandler, CLIEvent } from './api/cli'
import { HostWindowService } from './api/hostWindow'
import { QuickConnectProfileProvider } from './api/profileProvider'
import { ProfilesService } from './services/profiles.service... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/index.ts | tabby-core/src/index.ts | import { NgModule, ModuleWithProviders, LOCALE_ID } from '@angular/core'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { CommonModule } from '@angular/common'
import { FormsModule } from '@angular/forms'
import { NgbModule, NgbTooltipConfig } from '@ng-bootstrap/ng-bootstrap'
imp... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/tabContextMenu.ts | tabby-core/src/tabContextMenu.ts | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Injectable } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { TranslateService } from '@ngx-translate/core'
import { Subscription } from 'rxjs'
import { AppService } from './services/app.service'
import { ... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/theme.ts | tabby-core/src/theme.ts | import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
import { Injectable } from '@angular/core'
import { Theme } from './api'
/** @hidden */
@Injectable({ providedIn: 'root' })
export class NewTheme extends Theme {
name = _('Follow the color scheme')
css = require('./theme.new.scss')
termi... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/hotkeys.ts | tabby-core/src/hotkeys.ts | import { Injectable } from '@angular/core'
import { TranslateService } from '@ngx-translate/core'
import { ProfilesService } from './services/profiles.service'
import { HotkeyDescription, HotkeyProvider } from './api/hotkeyProvider'
/** @hidden */
@Injectable()
export class AppHotkeyProvider extends HotkeyProvider {
... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/selector.service.ts | tabby-core/src/services/selector.service.ts |
import { Injectable } from '@angular/core'
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
import { SelectorModalComponent } from '../components/selectorModal.component'
import { SelectorOption } from '../api/selector'
@Injectable({ providedIn: 'root' })
export class SelectorService {
private ... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/notifications.service.ts | tabby-core/src/services/notifications.service.ts | import { Injectable } from '@angular/core'
import { ToastrService } from 'ngx-toastr'
@Injectable({ providedIn: 'root' })
export class NotificationsService {
private constructor (
private toastr: ToastrService,
) { }
notice (text: string): void {
this.toastr.info(text, undefined, {
... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/profiles.service.ts | tabby-core/src/services/profiles.service.ts | import { Injectable, Inject } from '@angular/core'
import { TranslateService } from '@ngx-translate/core'
import { NewTabParameters } from './tabs.service'
import { BaseTabComponent } from '../components/baseTab.component'
import { QuickConnectProfileProvider, PartialProfile, PartialProfileGroup, Profile, ProfileGroup,... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/hotkeys.service.ts | tabby-core/src/services/hotkeys.service.ts | import { Injectable, Inject, NgZone, EventEmitter } from '@angular/core'
import { Observable, Subject, filter } from 'rxjs'
import { HotkeyDescription, HotkeyProvider } from '../api/hotkeyProvider'
import { KeyEventData, getKeyName, Keystroke, KeyName, getKeystrokeName, metaKeyName, altKeyName } from './hotkeys.util'
i... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/tabRecovery.service.ts | tabby-core/src/services/tabRecovery.service.ts | import { Injectable, Inject } from '@angular/core'
import { TabRecoveryProvider, RecoveryToken } from '../api/tabRecovery'
import { BaseTabComponent, GetRecoveryTokenOptions } from '../components/baseTab.component'
import { Logger, LogService } from './log.service'
import { ConfigService } from './config.service'
impor... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/tabs.service.ts | tabby-core/src/services/tabs.service.ts | import deepClone from 'clone-deep'
import { Injectable, ComponentFactoryResolver, Injector } from '@angular/core'
import { BaseTabComponent } from '../components/baseTab.component'
import { TabRecoveryService } from './tabRecovery.service'
export interface TabComponentType<T extends BaseTabComponent> {
// eslint-d... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Eugeny/tabby | https://github.com/Eugeny/tabby/blob/5c6008deacd3b1fcd12d0a78f5e645db43beec89/tabby-core/src/services/hotkeys.util.ts | tabby-core/src/services/hotkeys.util.ts | /* eslint-disable @typescript-eslint/no-type-alias */
export const metaKeyName = {
darwin: '⌘',
win32: 'Win',
linux: 'Super',
}[process.platform]
export const altKeyName = {
darwin: '⌥',
win32: 'Alt',
linux: 'Alt',
}[process.platform]
export interface KeyEventData {
ctrlKey?: boolean
m... | typescript | MIT | 5c6008deacd3b1fcd12d0a78f5e645db43beec89 | 2026-01-04T15:27:36.904744Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.