Skip to content

Commit

Permalink
Bump packages
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Mar 24, 2024
1 parent c539eb9 commit ed7c5ed
Show file tree
Hide file tree
Showing 8 changed files with 2,785 additions and 2,724 deletions.
50 changes: 28 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,35 @@
"prod:prepare": "yarn migrations:run && yarn db:seed"
},
"dependencies": {
"@fastify/static": "6.5.0",
"@fastify/static": "7.0.1",
"@mtucourses/rate-my-professors": "^2.0.1",
"@mtucourses/scraper": "^3.0.2",
"@mtucourses/thumbor": "^2.0.0",
"@nestjs/cli": "^9.1.4",
"@nestjs/common": "^9.1.4",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.1.4",
"@nestjs/platform-express": "^9.1.4",
"@nestjs/platform-fastify": "^9.1.4",
"@nestjs/schedule": "^2.1.0",
"@nestjs/schematics": "^9.0.3",
"@nestjs/swagger": "^6.1.2",
"@nestjs/cache-manager": "2.2.1",
"@nestjs/cli": "^10.3.2",
"@nestjs/common": "^10.3.5",
"@nestjs/config": "^3.2.0",
"@nestjs/core": "^10.3.5",
"@nestjs/platform-express": "^10.3.5",
"@nestjs/platform-fastify": "^10.3.5",
"@nestjs/schedule": "^4.0.1",
"@nestjs/schematics": "^10.1.1",
"@nestjs/swagger": "^7.3.0",
"@prisma/client": "^4.5.0",
"@rschedule/core": "^1.2.3",
"@rschedule/json-tools": "^1.2.3",
"@rschedule/standard-date-adapter": "^1.2.3",
"@sentry/node": "7.76.0",
"@sentry/profiling-node": "1.2.1",
"@sentry/profiling-node": "7.108.0",
"@sentry/tracing": "7.76.0",
"JSONStream": "1.3.5",
"arr-diff": "^4.0.0",
"cache-manager": "^3.4.0",
"cache-manager": "5.4.0",
"class-transformer": "^0.3.2",
"class-validator": "^0.13.1",
"deep-equal": "^2.0.5",
"fastify": "4.9.2",
"fastify-swagger": "^3.5.0",
"fastify": "4.26.2",
"fastify-swagger": "^5.2.0",
"got": "^11.8.2",
"graphile-worker": "0.13.0",
"nestjs-graphile-worker": "0.5.1",
Expand All @@ -67,27 +68,28 @@
"zapatos": "6.1.1"
},
"devDependencies": {
"@nestjs/testing": "^9.1.4",
"@nestjs/testing": "^10.3.5",
"@swc-node/register": "1.5.4",
"@swc/core": "1.3.9",
"@types/arr-diff": "^4.0.0",
"@types/cache-manager": "^3.4.2",
"@types/cron": "^1.7.3",
"@types/deep-equal": "^1.0.1",
"@types/express": "^4.17.13",
"@types/glob": "8.1.0",
"@types/node": "^16.6.0",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ava": "4.3.3",
"ava-postgres": "1.0.4",
"c8": "7.12.0",
"delay": "^4.4.0",
"esbuild": "0.15.12",
"esbuild-runner": "2.2.2",
"eslint": "^7.32.0",
"eslint-config-xo-typescript": "^0.38.0",
"eslint-plugin-unused-imports": "^1.1.1",
"eslint": "^8.57.0",
"eslint-config-xo-typescript": "^4.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
"glob": "8.0.3",
"husky": "^4.3.6",
"lint-staged": "^10.5.3",
Expand All @@ -96,9 +98,13 @@
"ts-loader": "^9.2.5",
"tsconfig-paths": "4.1.0",
"type-fest": "^1.0.1",
"typescript": "^4.8.4",
"typescript": "^5.4.3",
"webpack": "^5.50.0",
"xo": "^0.52.4"
"xo": "^0.58.0"
},
"resolutions": {
"wrap-ansi": "7.0.0",
"string-width": "4.1.0"
},
"husky": {
"hooks": {
Expand Down
3 changes: 2 additions & 1 deletion src/cache/cache.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Module, CacheModule as Cache} from '@nestjs/common';
import {Module} from '@nestjs/common';
import {CacheModule as Cache} from "@nestjs/cache-manager"

@Module({
imports: [
Expand Down
6 changes: 4 additions & 2 deletions src/courses/courses.controller.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import {CacheInterceptor, Controller, Get, Injectable, Query, Res, UseInterceptors} from '@nestjs/common';
import {Controller, Get, Injectable, Query, Res, UseInterceptors} from '@nestjs/common';
import {FastifyReply} from 'fastify';
import {NoCacheUpdatedSinceInterceptor} from 'src/interceptors/no-cache-updated-since';
import {CoursesService} from './courses.service';
import {GetCoursesParameters, GetUniqueCoursesParameters, FindFirstCourseParameters} from './types';
import {streamSqlQuery} from '~/lib/stream-sql-query';
import {PoolService} from '~/pool/pool.service';
import { CacheKey } from '@nestjs/cache-manager';

@Controller('courses')
@UseInterceptors(CacheInterceptor, NoCacheUpdatedSinceInterceptor)
@UseInterceptors(NoCacheUpdatedSinceInterceptor)
@Injectable()
export class CoursesController {
constructor(private readonly pool: PoolService, private readonly service: CoursesService) {}

@Get()
@CacheKey('courses-list')
async getAllCourses(@Res() reply: FastifyReply, @Query() parameters?: GetCoursesParameters) {
reply.raw.setHeader('Cache-Control', 'public, max-age=120, stale-while-revalidate=86400');
reply.raw.setHeader('Access-Control-Allow-Origin', '*');
Expand Down
3 changes: 2 additions & 1 deletion src/instructors/instructors.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {CacheInterceptor, Controller, Get, Header, Injectable, Query, UseInterceptors} from '@nestjs/common';
import {Controller, Get, Header, Injectable, Query, UseInterceptors} from '@nestjs/common';
import {Thumbor} from '@mtucourses/thumbor';
import {NoCacheUpdatedSinceInterceptor} from 'src/interceptors/no-cache-updated-since';
import * as db from 'zapatos/db';
import {GetInstructorsParameters} from './types';
import {PoolService} from '~/pool/pool.service';
import { CacheInterceptor } from '@nestjs/cache-manager';

@Controller('instructors')
@UseInterceptors(CacheInterceptor, NoCacheUpdatedSinceInterceptor)
Expand Down
4 changes: 4 additions & 0 deletions src/lib/stream-sql-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export const streamSqlQuery = async ({query, pool, reply}: Options) => {
reject(error);
}

if (!client) {
throw new Error('Client is undefined');
}

const stream = client.query(new QueryStream(query.text, query.values));
stream.on('end', () => {
done();
Expand Down
3 changes: 2 additions & 1 deletion src/passfaildrop/passfaildrop.controller.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {Body, CacheInterceptor, Controller, Get, Injectable, Put, UseInterceptors, Headers, Header, Query} from '@nestjs/common';
import {Body, Controller, Get, Injectable, Put, UseInterceptors, Headers, Header, Query} from '@nestjs/common';
import checkAuthHeader from 'src/lib/check-auth-header';
import * as db from 'zapatos/db';
import type {WhereableForTable} from 'zapatos/schema';
import type {PutDto} from './types';
import {GetAllParameters} from './types';
import {PoolService} from '~/pool/pool.service';
import { CacheInterceptor } from '@nestjs/cache-manager';

@Controller('passfaildrop')
@UseInterceptors(CacheInterceptor)
Expand Down
4 changes: 2 additions & 2 deletions src/sections/sections.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CacheInterceptor, Controller, Get, Injectable, Query, UseInterceptors, Res} from '@nestjs/common';
import {Controller, Get, Injectable, Query, UseInterceptors, Res} from '@nestjs/common';
import {FastifyReply} from 'fastify';
import {NoCacheUpdatedSinceInterceptor} from 'src/interceptors/no-cache-updated-since';
import {GetSectionsParameters, FindFirstSectionParamters} from './types';
Expand All @@ -7,7 +7,7 @@ import {PoolService} from '~/pool/pool.service';
import {streamSqlQuery} from '~/lib/stream-sql-query';

@Controller('sections')
@UseInterceptors(CacheInterceptor, NoCacheUpdatedSinceInterceptor)
@UseInterceptors(NoCacheUpdatedSinceInterceptor)
@Injectable()
export class SectionsController {
constructor(private readonly pool: PoolService, private readonly service: SectionsService) {}
Expand Down
Loading

0 comments on commit ed7c5ed

Please sign in to comment.