canvas-api-ts
Version:
Strongly typed canvas lms api
96 lines (95 loc) • 3.67 kB
TypeScript
import * as U from '../api/userTypes';
import { Match } from '../request/requestBuidler';
import * as ResponseType from '../api/responseTypes';
export declare function getSelf(): Promise<ResponseType.User>;
export declare function getUser(userId: Match<U.ShowUserDetail, "uriParams">["id"]): Promise<ResponseType.User>;
export declare function getUserProfile(user: ResponseType.User): Promise<Match<U.GetUesrProfile, "response">>;
export declare function getUserProfile(userId: Match<U.GetUesrProfile, "uriParams">["user_id"]): Promise<Match<U.GetUesrProfile, "response">>;
export declare function getUserActivityStream(config: Match<U.ListActivityStream, "param">): Promise<({
created_at: string;
updated_at: string;
id: number;
title: string;
message: string;
type: "DiscussionTopic" | "Conversation" | "Message" | "Submission" | "Conference" | "Collaboration" | "AssessmentRequest";
read_state: boolean;
context_type: "course" | "group";
course_id: number;
group_id?: number | undefined;
html_url: string;
} & {
type: "DiscussionTopic";
discussion_topic_id: number;
total_root_discussion_entries: number;
require_initial_post: boolean;
user_has_posted: boolean;
root_discussion_entries: {
[entry: string]: string;
};
}) | ({
created_at: string;
updated_at: string;
id: number;
title: string;
message: string;
type: "DiscussionTopic" | "Conversation" | "Message" | "Submission" | "Conference" | "Collaboration" | "AssessmentRequest";
read_state: boolean;
context_type: "course" | "group";
course_id: number;
group_id?: number | undefined;
html_url: string;
} & {
type: "Conversation";
conversation_id: number;
private: boolean;
participant_count: number;
}) | ({
created_at: string;
updated_at: string;
id: number;
title: string;
message: string;
type: "DiscussionTopic" | "Conversation" | "Message" | "Submission" | "Conference" | "Collaboration" | "AssessmentRequest";
read_state: boolean;
context_type: "course" | "group";
course_id: number;
group_id?: number | undefined;
html_url: string;
} & {
type: "Message";
message_id: number;
notification_category: string;
}) | ({
created_at: string;
updated_at: string;
id: number;
title: string;
message: string;
type: "DiscussionTopic" | "Conversation" | "Message" | "Submission" | "Conference" | "Collaboration" | "AssessmentRequest";
read_state: boolean;
context_type: "course" | "group";
course_id: number;
group_id?: number | undefined;
html_url: string;
} & {
type: "Collaboration";
collaboration_id: number;
}) | ({
created_at: string;
updated_at: string;
id: number;
title: string;
message: string;
type: "DiscussionTopic" | "Conversation" | "Message" | "Submission" | "Conference" | "Collaboration" | "AssessmentRequest";
read_state: boolean;
context_type: "course" | "group";
course_id: number;
group_id?: number | undefined;
html_url: string;
} & {
type: "AssessmentRequest";
assessment_request_id: number;
})>;
export declare function getUserPageViews(userId: Match<U.ListUserPageViews, "uriParams">["user_id"], period?: [Date, Date]): Promise<Match<U.ListUserPageViews, "response">>;
export declare function getUserPageViews(user: ResponseType.User, period?: [Date, Date]): Promise<Match<U.ListUserPageViews, "response">>;
export declare function getUsersInAccount(accountId: Match<U.ListUserInAccount, "uriParams">["account_id"], config: Match<U.ListUserInAccount, "param">): Promise<ResponseType.User[]>;