1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 11:58:13 +00:00

feat: add all functions of avaliable classcharts

This commit is contained in:
James Cook 2021-10-28 20:40:04 +01:00
parent 7e988a06f9
commit 18c80a13b9
6 changed files with 178 additions and 47 deletions

81
types/index.d.ts vendored
View file

@ -1,4 +1,4 @@
export interface User {
export interface Student {
id: number
name: string
first_name: string
@ -36,6 +36,61 @@ export interface User {
survey_id: number | null
detention_alias_plural_uc: string
}
export interface GetActivityOptions {
from: string | undefined
to: string | undefined
}
export interface ActivityTimelinePoint {
positive: number
negative: number
name: string
start: string
end: string
}
export interface ActivityResponse {
timeline: Array<ActivityTimelinePoint>
positiveReasons: Record<string, string>
negative_reasons: Record<string, string>
other_positive: Array
other_negative: Array
other_positive_count: Array
other_negative_count: Array
}
export interface GetBehaviourOptions {
from: string | undefined
to: string | undefined
last_id: string | undefined
}
export interface BehaviourPoint {
id: number
type: string
polarity: string
reason: string
score: number
timestamp: string
timestamp_custom_time: string | null
style: {
border_color: string | null
custom_class: string | null
}
pupil_name: string
lesson_name: string
teacher_name: string
room_name: string | null
note: string
_can_delete: string
detention_date: string | null
detention_time: string | null
detention_location: string | null
detention_type: string | null
}
export type BehaviourResponse = Array<BehaviourPoint>
export type DisplayDate = 'due_date' | 'issue_date'
export interface GetHomeworkOptions {
displayDate: DisplayDate
fromDate: string
toDate: string
}
export interface Homework {
lesson: string
subject: string
@ -65,4 +120,26 @@ export interface Homework {
validated_links: Array
validated_attachments: Array
}
export type DisplayDate = 'due_date' | 'issue_date'
export type HomeworksResponse = Array<Homework>
export interface GetLessonsOptions {
date: string
}
export interface Lesson {
teacher_name: string
lesson_name: string
subject_name: string
is_alternative_lesson: boolean
period_name: string
period_number: string
room_name: string
date: string
start_time: string
end_time: string
key: number
note_abstract: string
note: string
pupil_note_abstract: string
pupil_note: string
pupil_note_raw: string
}
export type LessonsResponse = Array<Lesson>