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

fix: types

This commit is contained in:
James Cook 2022-02-06 11:13:23 +00:00
parent cb7be6e70b
commit 3cfaa20f2a
2 changed files with 15 additions and 14 deletions

View file

@ -122,6 +122,7 @@ export class ClasschartsClient {
const params = new URLSearchParams(); const params = new URLSearchParams();
options?.from && params.append("from", options?.from); options?.from && params.append("from", options?.from);
options?.to && params.append("to", options?.to); options?.to && params.append("to", options?.to);
options?.last_id && params.append("last_id", options?.last_id);
return this.makeAuthedRequest( return this.makeAuthedRequest(
API_BASE + "/activity/" + this.sessionId + "?" + params.toString(), API_BASE + "/activity/" + this.sessionId + "?" + params.toString(),
{ {
@ -140,7 +141,6 @@ export class ClasschartsClient {
const params = new URLSearchParams(); const params = new URLSearchParams();
options?.from && params.append("from", options?.from); options?.from && params.append("from", options?.from);
options?.to && params.append("to", options?.to); options?.to && params.append("to", options?.to);
options?.last_id && params.append("last_id", options?.last_id);
return await this.makeAuthedRequest( return await this.makeAuthedRequest(
API_BASE + "/behaviour/" + this.studentId + "?" + params.toString(), API_BASE + "/behaviour/" + this.studentId + "?" + params.toString(),
{ {

View file

@ -37,32 +37,32 @@ export interface Student {
survey_id: number | null; survey_id: number | null;
detention_alias_plural_uc: string; detention_alias_plural_uc: string;
} }
export interface GetActivityOptions { export interface GetBehaviourOptions {
from?: string; from?: string;
to?: string; to?: string;
} }
export interface ActivityTimelinePoint { export interface BehaviourTimelinePoint {
positive: number; positive: number;
negative: number; negative: number;
name: string; name: string;
start: string; start: string;
end: string; end: string;
} }
export interface ActivityResponse { export interface BehaviourResponse {
timeline: Array<ActivityTimelinePoint>; timeline: Array<BehaviourTimelinePoint>;
positiveReasons: Record<string, string>; positive_reasons: Record<string, number>;
negative_reasons: Record<string, string>; negative_reasons: Record<string, number>;
other_positive: Array<any>; other_positive: Array<string>;
other_negative: Array<any>; other_negative: Array<string>;
other_positive_count: Array<any>; other_positive_count: Array<Record<string, number>>;
other_negative_count: Array<any>; other_negative_count: Array<Record<string, number>>;
} }
export interface GetBehaviourOptions { export interface GetActivityOptions {
from?: string; from?: string;
to?: string; to?: string;
last_id?: string; last_id?: string;
} }
export interface BehaviourPoint { export interface ActivityPoint {
id: number; id: number;
type: string; type: string;
polarity: string; polarity: string;
@ -80,12 +80,13 @@ export interface BehaviourPoint {
room_name: string | null; room_name: string | null;
note: string; note: string;
_can_delete: boolean; _can_delete: boolean;
badges: string | undefined;
detention_date: string | null; detention_date: string | null;
detention_time: string | null; detention_time: string | null;
detention_location: string | null; detention_location: string | null;
detention_type: string | null; detention_type: string | null;
} }
export type BehaviourResponse = Array<BehaviourPoint>; export type ActivityResponse = Array<ActivityPoint>;
export type DisplayDate = "due_date" | "issue_date"; export type DisplayDate = "due_date" | "issue_date";
export interface GetHomeworkOptions { export interface GetHomeworkOptions {
displayDate?: DisplayDate; displayDate?: DisplayDate;