classcharts-api
Advanced tools
Comparing version 0.3.1 to 0.4.0
import { RequestOptions } from "undici/types/dispatcher"; | ||
import { ActivityResponse, BadgesResponse, BehaviourResponse, DetentionsResponse, GetActivityOptions, GetBehaviourOptions, GetHomeworkOptions, GetLessonsOptions, HomeworksResponse, LessonsResponse, Student } from "./types"; | ||
import { ActivityResponse, AnnoucementsResponse, BadgesResponse, BehaviourResponse, DetentionsResponse, GetActivityOptions, GetBehaviourOptions, GetHomeworkOptions, GetLessonsOptions, HomeworksResponse, LessonsResponse, Student } from "./types"; | ||
/** | ||
@@ -63,2 +63,7 @@ * The base client | ||
/** | ||
* Lists the logged in student's annoucements | ||
* @returns Array of annoucements | ||
*/ | ||
listAnnoucements(): Promise<AnnoucementsResponse>; | ||
/** | ||
* Gets the logged in student's detentions | ||
@@ -65,0 +70,0 @@ * @returns Array of detentions |
@@ -178,2 +178,11 @@ "use strict"; | ||
/** | ||
* Lists the logged in student's annoucements | ||
* @returns Array of annoucements | ||
*/ | ||
async listAnnoucements() { | ||
return await this.makeAuthedRequest(consts_1.API_BASE + "/annoucements/" + this.studentId, { | ||
method: "GET", | ||
}); | ||
} | ||
/** | ||
* Gets the logged in student's detentions | ||
@@ -180,0 +189,0 @@ * @returns Array of detentions |
@@ -0,1 +1,2 @@ | ||
declare type BooleanHumean = "yes" | "no"; | ||
export interface Student { | ||
@@ -145,4 +146,4 @@ id: number; | ||
mark_relative: number; | ||
ticked: "yes" | "no"; | ||
allow_attachments: "yes" | "no"; | ||
ticked: BooleanHumean; | ||
allow_attachments: BooleanHumean; | ||
first_seen_date: string; | ||
@@ -213,3 +214,3 @@ last_seen_date: string; | ||
id: number; | ||
attended: "yes" | "no" | "upscaled" | "pending"; | ||
attended: BooleanHumean | "upscaled" | "pending"; | ||
date: string | null; | ||
@@ -225,5 +226,5 @@ length: number | null; | ||
school: { | ||
opt_notes_names: "yes" | "no"; | ||
opt_notes_comments: "yes" | "no"; | ||
opt_notes_comments_pupils: "yes" | "no"; | ||
opt_notes_names: BooleanHumean; | ||
opt_notes_comments: BooleanHumean; | ||
opt_notes_comments_pupils: BooleanHumean; | ||
}; | ||
@@ -253,1 +254,28 @@ }; | ||
export declare type DetentionsResponse = Array<Detention>; | ||
export interface Annoucement { | ||
id: number; | ||
title: string; | ||
description: string | null; | ||
school_name: string; | ||
teacher_name: string; | ||
school_logo: string | null; | ||
sticky: BooleanHumean; | ||
state: string | null; | ||
timestamp: string; | ||
attachments: Array<{ | ||
filename: string; | ||
url: string; | ||
}>; | ||
for_pupils: Array<any>; | ||
comment_visibility: string; | ||
allow_comments: BooleanHumean; | ||
allow_reactions: BooleanHumean; | ||
allow_consent: BooleanHumean; | ||
priority_pinned: BooleanHumean; | ||
requires_consent: BooleanHumean; | ||
can_change_consent: boolean; | ||
consent: string | null; | ||
pupil_consents: Array<any>; | ||
} | ||
export declare type AnnoucementsResponse = Array<Annoucement>; | ||
export {}; |
{ | ||
"name": "classcharts-api", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "", | ||
@@ -24,3 +24,3 @@ "repository": { | ||
"devDependencies": { | ||
"@types/node": "^17.0.13", | ||
"@types/node": "^17.0.15", | ||
"@typescript-eslint/eslint-plugin": "^5.10.2", | ||
@@ -27,0 +27,0 @@ "@typescript-eslint/parser": "^5.10.2", |
19482
568