Skip to content

Commit

Permalink
Run prettier rules with the latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielemery committed Dec 23, 2024
1 parent 5cd9df4 commit 5f3804a
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/activity/activity.gql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import DataLoader from 'dataloader';

import { QuizlordContext } from '..';
import { authorisationService, activityService, userService } from '../service.locator';
import { RecentActivityItem } from './activity.service';
Expand Down
1 change: 1 addition & 0 deletions src/auth/authorisation.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Role } from '@prisma/client';

import { QuizlordContext } from '..';
import { UnauthorisedError } from './authorisation.errors';

Expand Down
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import './instrument';
import { ApolloServer } from '@apollo/server';
import { expressMiddleware } from '@apollo/server/express4';
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
import * as Sentry from '@sentry/node';
import bodyParser from 'body-parser';
import cors from 'cors';
import express from 'express';
import { GraphQLScalarType, Kind } from 'graphql';
import http from 'http';
import * as Sentry from '@sentry/node';

import { authenticationService, prismaService, queueService, userService } from './service.locator';
import { activityQueries, activityChildren } from './activity/activity.gql';
import config from './config/config';
import typeDefs from './gql';
import { userQueries } from './user/user.gql';
import { activityQueries, activityChildren } from './activity/activity.gql';
import './instrument';
import { quizMutations, quizQueries } from './quiz/quiz.gql';
import { Role } from './user/user.dto';
import { authenticationService, prismaService, queueService, userService } from './service.locator';
import { statisticsQueries } from './statistics/statistics.gql';
import { Role } from './user/user.dto';
import { userQueries } from './user/user.gql';

const QUIZLORD_VERSION_HEADER = 'X-Quizlord-Api-Version';

Expand Down
2 changes: 2 additions & 0 deletions src/instrument.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as Sentry from '@sentry/node';

import config from './config/config';

Sentry.init({
dsn: config.SENTRY_DSN,
integrations: [Sentry.prismaIntegration()],
Expand Down
2 changes: 1 addition & 1 deletion src/quiz/quiz.gql.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QuizlordContext } from '..';
import { base64Decode, base64Encode, PagedResult } from '../util/paging-helpers';
import { authorisationService, quizService } from '../service.locator';
import { base64Decode, base64Encode, PagedResult } from '../util/paging-helpers';
import { CreateQuizResult, Quiz, QuizCompletion, QuizDetails, QuizFilters, QuizImageType, QuizType } from './quiz.dto';

async function quizzes(
Expand Down
2 changes: 1 addition & 1 deletion src/quiz/quiz.persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Quiz, QuizImage, QuizNoteType } from '@prisma/client';
import { v4 as uuidv4 } from 'uuid';

import { PrismaService } from '../database/prisma.service';
import { QuizFilters } from './quiz.dto';
import { slicePagedResults, getPagedQuery } from '../util/paging-helpers';
import { QuizFilters } from './quiz.dto';

export class QuizPersistence {
#prisma: PrismaService;
Expand Down
6 changes: 3 additions & 3 deletions src/quiz/quiz.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Decimal } from '@prisma/client/runtime/library';
import { v4 as uuidv4, Version4Options } from 'uuid';

import { QuizService } from './quiz.service';
import { QuizPersistence } from './quiz.persistence';
import { S3FileService } from '../file/s3.service';
import { Decimal } from '@prisma/client/runtime/library';
import { UserService } from '../user/user.service';
import { MustProvideAtLeastOneFileError } from './quiz.errors';
import { QuizPersistence } from './quiz.persistence';
import { QuizService } from './quiz.service';

jest.mock('uuid');

Expand Down
6 changes: 3 additions & 3 deletions src/quiz/quiz.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { v4 as uuidv4 } from 'uuid';
import {
Quiz as QuizPersistenceModel,
QuizCompletion as QuizCompletionPersistenceModel,
Expand All @@ -8,12 +7,13 @@ import {
QuizImageType,
QuizType,
} from '@prisma/client';
import { v4 as uuidv4 } from 'uuid';

import { Quiz, QuizCompletion, QuizFilters, QuizImage } from './quiz.dto';
import { S3FileService } from '../file/s3.service';
import { QuizPersistence } from './quiz.persistence';
import { UserService } from '../user/user.service';
import { Quiz, QuizCompletion, QuizFilters, QuizImage } from './quiz.dto';
import { MustProvideAtLeastOneFileError } from './quiz.errors';
import { QuizPersistence } from './quiz.persistence';

const MAXIMUM_QUIZ_PAGE_SIZE = 100;

Expand Down
3 changes: 1 addition & 2 deletions src/service.locator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActivityService } from './activity/activity.service';
import { AuthenticationService } from './auth/authentication.service';
import { AuthorisationService } from './auth/authorisation.service';
import config from './config/config';
import { PrismaService } from './database/prisma.service';
import { S3FileService } from './file/s3.service';
import { SQSQueueService } from './queue/sqs.service';
Expand All @@ -11,8 +12,6 @@ import { UserPersistence } from './user/user.persistence';
import { UserService } from './user/user.service';
import { MemoryCache } from './util/cache';

import config from './config/config';

const memoryCache = new MemoryCache();

// auth
Expand Down
4 changes: 2 additions & 2 deletions src/statistics/statistics.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Cache } from '../util/cache';
import { QuizService } from '../quiz/quiz.service';
import { UserService } from '../user/user.service';
import { StatisticsService } from './statistics.service';
import { Cache } from '../util/cache';
import { IndividualUserStatisticsSortOption } from './statistics.dto';
import { StatisticsService } from './statistics.service';

const mockUserService = {
getUsers: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion src/user/user.gql.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QuizlordContext } from '..';
import { base64Decode, base64Encode, PagedResult } from '../util/paging-helpers';
import { authorisationService, userService } from '../service.locator';
import { base64Decode, base64Encode, PagedResult } from '../util/paging-helpers';
import { User, UserDetails, UserSortOption } from './user.dto';
import { GetUsersResult } from './user.service';

Expand Down
2 changes: 1 addition & 1 deletion src/user/user.persistence.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Role, User } from '@prisma/client';

import { RecentActivityItem } from '../activity/activity.service';
import { PrismaService } from '../database/prisma.service';
import { UserSortOption } from '../user/user.dto';
import { getPagedQuery, slicePagedResults } from '../util/paging-helpers';
import { RecentActivityItem } from '../activity/activity.service';

export interface GetUsersWithRoleResult {
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/user/user.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { v4 as uuidv4, Version4Options } from 'uuid';

import { UserNotFoundError } from './user.errors';
import { UserPersistence } from './user.persistence';
import { UserService } from './user.service';
import { UserNotFoundError } from './user.errors';

jest.mock('uuid');

Expand Down
6 changes: 3 additions & 3 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { v4 as uuidv4 } from 'uuid';
import { User as UserPersistenceModel, Role as RolePersistenceModel } from '@prisma/client';
import { v4 as uuidv4 } from 'uuid';

import { RecentActivityItem } from '../activity/activity.service';
import { Role, User, UserSortOption } from './user.dto';
import { UserPersistence } from './user.persistence';
import { UserNotFoundError } from './user.errors';
import { RecentActivityItem } from '../activity/activity.service';
import { UserPersistence } from './user.persistence';

export interface GetUsersResult {
data: User[];
Expand Down

0 comments on commit 5f3804a

Please sign in to comment.