This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ add calendar scraper and dump endpoint (#132)
- Loading branch information
Showing
15 changed files
with
353 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
"An object that includes important dates for a specified quarter." | ||
type QuarterDates { | ||
"When instruction begins for the given quarter." | ||
type TermDates { | ||
"The year of the given term." | ||
year: String! | ||
"The quarter of the given term." | ||
quarter: String! | ||
"When instruction begins for the given term." | ||
instructionStart: Date! | ||
"When instruction ends for the given quarter." | ||
"When instruction ends for the given term." | ||
instructionEnd: Date! | ||
"When finals begin for the given quarter." | ||
"When finals begin for the given term." | ||
finalsStart: Date! | ||
"When finals end for the given quarter." | ||
"When finals end for the given term." | ||
finalsEnd: Date! | ||
"When the Schedule of Classes becomes available for the given term." | ||
socAvailable: Date! | ||
} | ||
|
||
extend type Query { | ||
"Get important dates for a quarter." | ||
calendar(year: String!, quarter: Quarter!): QuarterDates! | ||
"Get all available terms and their important dates." | ||
allTermDates: [TermDates!]! | ||
"Get important dates for a term." | ||
calendar(year: String!, quarter: Quarter!): TermDates! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { quarters } from "@peterportal-api/types"; | ||
import { z } from "zod"; | ||
|
||
export const QuerySchema = z.object({ | ||
year: z | ||
.string({ required_error: 'Parameter "year" not provided' }) | ||
.length(4, { message: "Invalid year provided" }), | ||
export const QuerySchema = z | ||
.object({ | ||
year: z | ||
.string({ required_error: 'Parameter "year" not provided' }) | ||
.length(4, { message: "Invalid year provided" }), | ||
|
||
quarter: z.enum(quarters, { | ||
required_error: 'Parameter "quarter" not provided', | ||
invalid_type_error: "Invalid quarter provided", | ||
}), | ||
}); | ||
quarter: z.enum(quarters, { | ||
required_error: 'Parameter "quarter" not provided', | ||
invalid_type_error: "Invalid quarter provided", | ||
}), | ||
}) | ||
.or(z.object({})); | ||
|
||
export type Query = z.infer<typeof QuerySchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.