import { DateString, HTMLString, URLString, FileNameString, ContentTypeString, MIMETypeString } from './aliases'; import { HTTPMethod } from 'src/request/types'; export interface Account { id: number; name: string; uuid: string; parent_account_id?: number; root_account_id?: number; workflow_state: "active" | "deleted"; } export interface Account { default_storage_quota_mb?: number; default_user_storage_quota_mb?: number; default_group_storage_quota_mb?: number; default_time_zone?: string; sis_account_id?: string; integration_id?: string; sis_import_id?: number; lti_guid: string; } export interface TermOfService { id: number; terms_type: string; passive: boolean; account_id: number; content: string; } export interface Term { id: number; name: string; start_at?: DateString; end_at?: DateString; } export interface CalendarLink { ics: URLString; } export interface Grade { html_url: URLString; current_grade?: string; final_grade?: string; current_score?: string; final_score?: string; current_points?: number; unposted_current_grade?: string; unposted_final_grade?: string; unposted_current_score?: string; unposted_final_score?: string; unposted_current_points?: number; } export interface Enrollment { id: number; course_id: number; sis_course_id?: string; course_integration_id?: string; course_section_id: number; section_integration_id?: string; sis_account_id?: string; sis_section_id?: string; sis_user_id?: string; enrollment_state: "active" | "invited" | "inactive"; limit_privileges_to_course_section: boolean; sis_import_id: number; root_account_id: number; type: 'StudentEnrollment' | 'TeacherEnrollment' | 'TaEnrollment' | 'DesignerEnrollment' | 'ObserverEnrollment'; user_id: number; associated_user_id?: number; role: Enrollment["type"]; role_id: number; created_at: DateString; updated_at: DateString; start_at: DateString; end_at: DateString; last_activity_at: DateString; last_attended_at: DateString; total_activity_time: number; html_url: URLString; grades: { html_url: URLString; current_score: number; current_grade?: string; final_score: number; final_grade?: string; }; user: { id: number; name: string; sortable_name: string; short_name: string; }; override_grade: string; override_score: number; unposted_current_grade: string; unposted_final_grade: string; unposted_current_score: string; unposted_final_score: string; has_grading_periods?: boolean; totals_for_all_grading_periods_option?: boolean; current_grading_period_title?: string; current_grading_period_id?: number; current_period_override_grade: string; current_period_override_score: number; current_period_unposted_current_score?: number; current_period_unposted_final_score?: number; current_period_unposted_current_grade?: string; current_period_unposted_final_grade?: string; } export interface CourseProgress { requirement_count: number; requirement_completed_count: number; next_requirement_url: URLString; completed_at: DateString; } export interface User { id: number; name: string; sortable_name: string; short_name: string; sis_user_id: string; sis_import_id: number; integration_id: string; login_id: string; avatar_url: URLString; enrollments?: Enrollment[]; email?: string; locale?: string; last_login?: DateString; time_zone?: string; bio?: string; } export interface UserDisplay { id: number; short_name: string; avatar_image_url: URLString; html_url: URLString; } export interface AnonymousUserDisplay { anonymous_id: string; avatar_image_url: URLString; } export interface Profile { id: number; name: string; short_name: string; sortable_name: string; title?: string; bio?: string; primary_email: string; login_id: string; sis_user_id: string; lti_user_id?: string; avatar_url: URLString; calendar: null; time_zone?: string; locale?: string; } export interface Avatar { type: "gravatar" | "attachment" | "no_pic"; url: URLString; token: string; display_name: string; id?: number; "content-type"?: MIMETypeString; filename: FileNameString; size: number; } export interface PageView { id: string; app_name: string; url: URLString; context_type: string; asset_type: string; controller: string; action: string; contributed: boolean; interaction_seconds: number; created_at: DateString; user_request: boolean; render_time: number; user_agent: string; participated: boolean; http_method: HTTPMethod; remote_ip: string; links: { user: number; account: number; }; } export interface PageViewLinks { user: number; context: number; asset: number; real_user: number; account: number; } export interface CourseNickName { course_id: number; name: string; nickname: string; } export interface Course { id: number; sis_course_id?: number; uuid: string; integration_id?: number; sis_import_id: number; name: string; course_code: string; workflow_state: "unpublished" | "available" | "completed" | "deleted"; account_id: number; root_account_id: number; enrollment_term_id: number; grading_standard_id: number; grade_passback_setting: string; created_at: DateString; start_at: DateString; end_at: DateString; locale: string; enrollments?: Enrollment[]; total_students?: number; calendar: any[] | null; default_view: "feed"; syllabus_body?: HTMLString; needs_grading_count?: number; term?: Term; course_progress?: CourseProgress; apply_assignment_group_weights?: boolean; permissions?: { create_discussion_topic: boolean; create_announcement: boolean; }; is_public: boolean; is_public_to_auth_users: boolean; public_syllabus: boolean; public_syllabus_to_auth: boolean; public_description?: string; storage_quota_mb: number; storage_quota_used_mb: number; hide_final_grades: boolean; license: string; allow_student_assignment_edits: boolean; allow_wiki_comments: boolean; allow_student_forum_attachments: boolean; open_enrollment: boolean; self_enrollment: boolean; restrict_enrollments_to_course_dates: boolean; course_format: string; access_restricted_by_date?: boolean; time_zone: string; blueprint?: boolean; blueprint_restrictions?: { content: boolean; points: boolean; due_dates: boolean; availability_dates: boolean; }; blueprint_restrictions_by_object_type?: { assignment: { content: boolean; points: boolean; }; wiki_page: { content: boolean; }; }; } export interface File { id: number; uuid: string; folder_id: number; display_name: FileNameString; filename: FileNameString; "content-type": ContentTypeString; url: URLString; size: number; created_at: DateString; updated_at: DateString; unlock_at: DateString; locked: boolean; hidden: boolean; lock_at: DateString; hidden_for_user: boolean; thumbnail_url?: URLString; modified_at: DateString; mime_class: MIMETypeString; media_entry_id: string; locked_for_user: boolean; lock_info?: string; lock_explanation: string; preview_url?: URLString; } export interface Folder { context_type: string; context_id: number; files_count: number; position: number; updated_at: DateString; folders_url: URLString; files_url: URLString; full_name: string; lock_at: DateString; id: number; folders_count: number; name: string; parent_folder_id: number; created_at: DateString; unlock_at?: DateString; hidden: boolean; hidden_for_user: boolean; locked: boolean; locked_for_user: boolean; for_submissions: boolean; } export interface UsageRights { legal_copyright: string; use_justification: "own_copyright" | "public_domain" | "used_by_permission" | "fair_use" | "creative_commons"; license: string; license_name: string; message: string; file_ids: number[]; } export interface Liscense { id: string; name: string; url: URLString; } export interface Progress { id: number; context_id: number; context_type: string; user_id: number; tag: string; completion: number; workflow_state: "queued" | "completed" | "running" | "failed"; created_at: DateString; updated_at: DateString; message?: string; results?: { id: string; }; url: URLString; } export interface DiscussinoTopic { id: number; title: string; message: HTMLString; html_url: URLString; posted_at: DateString; last_reply_at: DateString; require_initial_post: boolean; user_can_see_posts: boolean; discussion_subentry_count: number; read_state: "read" | "unread"; unread_count: number; subscribed: boolean; subscription_hold?: "initial_post_required" | "not_in_group_set" | "not_in_group" | "topic_is_announcement"; assignment_id?: number; delayed_post_at?: DateString; published: boolean; lock_at?: DateString; locked: boolean; pinned: boolean; locked_for_user: boolean; lock_info?: boolean; lock_explanation?: string; user_name: string; topic_children: number[]; group_topic_children: { id: number; group_id: number; }[]; root_topic_id?: number; podcast_url?: URLString; discussion_type: "side_comment" | "threaded"; group_category_id?: number; attachments?: FileAttachment[]; permissions: { attach: boolean; }; allow_rating: boolean; only_graders_can_rate: boolean; sort_by_rating: boolean; } export interface FileAttachment { "content-type": string; url: URLString; filename: FileNameString; display_name: FileNameString; } export interface Conversation { id: number; subject: string; workflow_state: "unread" | "read" | "archived"; last_message: string; start_at: DateString; message_count: number; subscribed: boolean; private: boolean; starred: boolean; properties?: "last_author" | "attachments" | "media_objects"; audience?: number[]; audience_contexts: { courses: { [id: string]: string[]; }; groups: { [id: string]: string[]; }; }; avatar_url: URLString; participants?: ConversationParticipant[]; visible: boolean; context_name: string; } export interface ConversationParticipant { id: number; name: string; full_name: string; avatar_url?: URLString; } export interface ExternalToolTagAttributes { url: URLString; new_tab: boolean; resource_link_id: string; } export interface LookInfo { asset_string: string; unlock_at?: DateString; lock_at: DateString; context_module?: string; manually_locked: boolean; } export interface RubricRating { points: number; id: string; description: string; long_description: string; } export interface RubricCriteria { points: number; id: string; learning_outcome_id?: string; vendor_guid?: string; description: string; long_description: string; criterion_use_range: boolean; ratings?: string; ignore_for_scoring: boolean; } export interface AssignmentDate { id?: number; base?: boolean; title: string; due_at: DateString; unlock_at: DateString; lock_at: DateString; } export interface TurnitinSettings { originality_report_visibility: "after_grading" | "immediate" | "after_due_date" | "never"; s_paper_check: boolean; internet_check: boolean; journal_check: boolean; exclude_biblio: boolean; exclude_quoted: boolean; exclude_small_matches_type?: "percent" | "words"; exclude_small_matches_value: 50; } export interface NeedsGradingCount { section_id: string; needs_grading_count: number; } export interface Assignment { id: number; name: string; description: HTMLString; created_at: DateString; updated_at: DateString; due_at: DateString; lock_at: DateString; unlock_at: DateString; has_overrides: boolean; all_dates: null; course_id: number; html_url: URLString; submissions_download_url: URLString; assinment_group_id: number; due_date_required: boolean; allowed_extensions: string[]; max_name_length: number; turnitin_enabled: boolean; vericite_enabled: boolean; turnitin_settings: null; grade_group_students_individually: boolean; external_tool_tag_attributes: null; peer_reviews: boolean; automatic_peer_reviews: boolean; peer_review_count: number; peer_reviews_assign_at: DateString; intra_group_peer_reviews: boolean; group_category_id: number; needs_grading_count: number; needs_grading_count_by_section: { section_id: string; needs_grading_count: number; }[]; position: number; post_to_sis?: boolean; integration_id?: string; integration_data?: any; points_possible: number; submission_types: ("online_quiz" | "none" | "on_paper" | "discussion_topic" | "external_tool" | "online_upload" | "online_text_entry" | "online_url" | "media_recording")[]; has_submitted_submissions: boolean; grading_type: "points" | "pass_fail" | "percent" | "letter_grade" | "gpa_scale" | "points" | "not_graded"; grading_standard_id?: number; published: boolean; unpublishable: boolean; only_visible_to_overrides: boolean; locked_for_user: boolean; lock_info?: string; lock_explanation: string; quiz_id?: number; anonymous_submissions: boolean; discussion_topic?: string; freeze_on_copy: boolean; frozen: boolean; frozen_attributes?: ("title" | "description" | "lock_at" | "points_possible" | "grading_type" | "submission_types" | "assignment_group_id" | "allowed_extensions" | "group_category_id" | "notify_of_update" | "peer_reviews")[]; submission?: Submission; use_rubric_for_grading: boolean; rubric_settings: string; rubric?: RubricCriteria; assignment_visibility?: number[]; overrides?: AssignmentOverride[]; omit_from_final_grade?: boolean; moderated_grading: boolean; grader_count: number; final_grader_id: number; grader_comments_visible_to_graders: boolean; graders_anonymous_to_graders: boolean; grader_names_visible_to_final_grader: boolean; anonymous_grading: boolean; allowed_attempts: number; post_manually: boolean; } export interface AssignmentOverride { id: number; assignment_id: number; student_ids: number[]; group_id: number; course_section_id: number; title: string; due_at: DateString; all_day: boolean; all_day_date: DateString; unlock_at: DateString; lock_at: DateString; } export interface MediaComment { "content-type": MIMETypeString; display_name: string; media_id: number; media_type: string; url: URLString; } export interface SubmissionComment { id: number; author_id: number; author_name: string; author: UserDisplay; comment: string; created_at: DateString; edited_at: DateString; media_comment?: MediaComment; } export interface Submission { assignment_id: number; assignment?: Assignment; course?: Course; attempt: number; body: string; grade: string; grade_matches_current_submission: boolean; html_url: URLString; preview_url: URLString; score: number; submission_comments?: SubmissionComment; submission_type: "online_text_entry" | "online_url" | "online_upload" | "media_recording"; submitted_at: DateString; url?: DateString; user_id: number; grader_id: number; graded_at: DateString; user?: User; late: boolean; assignment_visible: boolean; excused: boolean; missing: boolean; late_policy_status: "missing" | "none" | "late" | "null"; points_deducted: number; seconds_late: number; workflow_state: "submitted" | "unsubmitted" | "graded" | "pending_review"; extra_attempts: number; anonymous_id: string; posted_at: DateString; } export interface RolePermissions { enabled: boolean; locked: boolean; applies_to_self: boolean; applies_to_descendants: boolean; readonly: boolean; explicit: boolean; prior_default: boolean; } export interface Role { label: string; role: string; base_role_type: "AccountMembership" | Enrollment["type"]; account: { id: number; name: string; parent_account_id: number; root_account_id: number; sis_account_id: string; }; workflow_state: "active" | "inactive" | "built_in"; permissions: { read_course_content: { enabled: boolean; locked: boolean; readonly: boolean; explicit: boolean; prior_default: boolean; }; read_course_list: { enabled: boolean; locked: boolean; readonly: boolean; explicit: boolean; }; read_question_banks: { enabled: boolean; locked: boolean; readonly: boolean; explicit: boolean; prior_default: boolean; }; read_reports: { enabled: boolean; locked: boolean; readonly: boolean; explicit: boolean; }; }; }