Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ jobs:
- name: Set up Node.js
if: steps.changes.outputs.typescript-backend == 'true'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "14.15.5"
node-version: "20.12.2"
cache: "yarn"
cache-dependency-path: |
backend/typescript/yarn.lock
cache-dependency-path: "backend/typescript/yarn.lock"

- name: Install Node.js dependencies
if: steps.changes.outputs.typescript-backend == 'true'
Expand Down
2 changes: 1 addition & 1 deletion backend/typescript/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14.15.5-slim
FROM node:20.12.2-slim

WORKDIR /app

Expand Down
5 changes: 2 additions & 3 deletions backend/typescript/graphql/resolvers/dashboardResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ const dashboardResolvers = {
_parent: undefined,
{ secondChoice }: { secondChoice: ApplicantRole },
): Promise<Array<ApplicationDTO>> => {
const applications = await dashboardService.getApplicationsBySecondChoiceRole(
secondChoice,
);
const applications =
await dashboardService.getApplicationsBySecondChoiceRole(secondChoice);
return applications;
},
dashboardsByApplicationId: async (
Expand Down
8 changes: 4 additions & 4 deletions backend/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
"sequelize-typescript": "^2.1.0",
"swagger-ui-express": "^4.1.6",
"ts-node": "^10.0.0",
"umzug": "^3.0.0-beta.16",
"umzug": "^3.8.2",
"uuid": "^8.3.2",
"winston": "^3.3.3",
"yamljs": "^0.3.0"
},
"devDependencies": {
"@types/cookie-parser": "^1.4.2",
"@types/cors": "^2.8.10",
"@types/dotenv": "^8.2.0",
"@types/dotenv": "^8.2.3",
"@types/express": "^4.17.11",
"@types/jest": "^26.0.23",
"@types/lodash": "^4.14.168",
Expand All @@ -73,13 +73,13 @@
"nodemon": "^2.0.7",
"prettier": "^2.2.1",
"ts-jest": "^27.0.3",
"typescript": "4.1.6"
"typescript": "^5.8.3"
},
"resolutions": {
"fs-capacitor": "^6.2.0",
"graphql-upload": "^11.0.0"
},
"engines": {
"node": "14.15.5"
"node": "20.12.2"
}
}
27 changes: 11 additions & 16 deletions backend/typescript/services/implementations/appDashboardService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class AppDashboardService implements IAppDashboardService {
);
},
);
applicationsBySecondChoiceRoleDTO = await applicationsBySecondChoiceRole.map(
(application) => {
applicationsBySecondChoiceRoleDTO =
await applicationsBySecondChoiceRole.map((application) => {
return {
id: application.id,
academicOrCoop: application.academicOrCoop,
Expand All @@ -191,8 +191,7 @@ class AppDashboardService implements IAppDashboardService {
timesApplied: application.timesApplied,
timestamp: application.timestamp,
};
},
);
});
} catch (error: unknown) {
Logger.error(
`Failed to get applications by this second choice role = ${role}. Reason = ${getErrorMessage(
Expand Down Expand Up @@ -243,15 +242,13 @@ class AppDashboardService implements IAppDashboardService {
role: ApplicantRole,
): Promise<ApplicationDashboardRowDTO[]> {
// get all the applications for the role
const applications: Array<ApplicationDTO> = await this.getApplicationsByRole(
role,
);
const applications: Array<ApplicationDTO> =
await this.getApplicationsByRole(role);
// get the dashboards associated with the applications
const appDashRows: Array<ApplicationDashboardRowDTO> = await Promise.all(
applications.map(async (application) => {
const reviewDashboards: Array<ApplicationDashboardDTO> = await this.getDashboardsByApplicationId(
application.id,
);
const reviewDashboards: Array<ApplicationDashboardDTO> =
await this.getDashboardsByApplicationId(application.id);
const reviewers: Array<UserDTO> = await Promise.all(
reviewDashboards.map(async (dash) => {
return userService.getUserByEmail(dash.reviewerEmail);
Expand All @@ -271,15 +268,13 @@ class AppDashboardService implements IAppDashboardService {
role: ApplicantRole,
): Promise<ApplicationDashboardRowDTO[]> {
// get all the applications for the role
const applications: Array<ApplicationDTO> = await this.getApplicationsBySecondChoiceRole(
role,
);
const applications: Array<ApplicationDTO> =
await this.getApplicationsBySecondChoiceRole(role);
// get the dashboards associated with the applications
const appDashRows: Array<ApplicationDashboardRowDTO> = await Promise.all(
applications.map(async (application) => {
const reviewDashboards: Array<ApplicationDashboardDTO> = await this.getDashboardsByApplicationId(
application.id,
);
const reviewDashboards: Array<ApplicationDashboardDTO> =
await this.getDashboardsByApplicationId(application.id);
const reviewers: Array<UserDTO> = await Promise.all(
reviewDashboards.map(async (dash) => {
return userService.getUserByEmail(dash.reviewerEmail);
Expand Down
15 changes: 6 additions & 9 deletions backend/typescript/services/implementations/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ class AuthService implements IAuthService {
roles: Set<Role>,
): Promise<boolean> {
try {
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken = await firebaseAdmin
.auth()
.verifyIdToken(accessToken, true);
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken =
await firebaseAdmin.auth().verifyIdToken(accessToken, true);
const userRole = await this.userService.getUserRoleByAuthId(
decodedIdToken.uid,
);
Expand All @@ -187,9 +186,8 @@ class AuthService implements IAuthService {
requestedUserId: string,
): Promise<boolean> {
try {
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken = await firebaseAdmin
.auth()
.verifyIdToken(accessToken, true);
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken =
await firebaseAdmin.auth().verifyIdToken(accessToken, true);
const tokenUserId = await this.userService.getUserIdByAuthId(
decodedIdToken.uid,
);
Expand All @@ -211,9 +209,8 @@ class AuthService implements IAuthService {
requestedEmail: string,
): Promise<boolean> {
try {
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken = await firebaseAdmin
.auth()
.verifyIdToken(accessToken, true);
const decodedIdToken: firebaseAdmin.auth.DecodedIdToken =
await firebaseAdmin.auth().verifyIdToken(accessToken, true);

const firebaseUser = await firebaseAdmin
.auth()
Expand Down
7 changes: 3 additions & 4 deletions backend/typescript/services/implementations/reviewService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ class ReviewService implements IReviewService {
});
if (users && users.length === 1) {
const user = users[0];
const application: ApplicationDashboardTable | null = await ApplicationDashboardTable.findOne(
{
const application: ApplicationDashboardTable | null =
await ApplicationDashboardTable.findOne({
where: {
reviewerId: user.id,
applicationId,
},
},
);
});
if (application) return true;
return false;
}
Expand Down
15 changes: 6 additions & 9 deletions backend/typescript/utilities/firebaseRestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ const FirebaseRestClient = {
},
);

const responseJson:
| PasswordSignInResponse
| RequestError = await response.json();
const responseJson: PasswordSignInResponse | RequestError =
await response.json();

if (!response.ok) {
const errorMessage = [
Expand Down Expand Up @@ -123,9 +122,8 @@ const FirebaseRestClient = {
},
);

const responseJson:
| OAuthSignInResponse
| RequestError = await response.json();
const responseJson: OAuthSignInResponse | RequestError =
await response.json();

if (!response.ok) {
const errorMessage = [
Expand Down Expand Up @@ -155,9 +153,8 @@ const FirebaseRestClient = {
},
);

const responseJson:
| RefreshTokenResponse
| RequestError = await response.json();
const responseJson: RefreshTokenResponse | RequestError =
await response.json();

if (!response.ok) {
const errorMessage = [
Expand Down
Loading
Loading