-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Przemek
committed
Jan 14, 2025
1 parent
8acd517
commit 027d503
Showing
23 changed files
with
1,016 additions
and
1,018 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { DefaultResponse, DefaultResponseError } from "./core"; | ||
|
||
export type LoginRequest = { | ||
email: string; | ||
password: string; | ||
remember_me?: 1 | 0; | ||
}; | ||
|
||
export type LoginResponse = DefaultResponse<{ | ||
token: string; | ||
expires_at: string; | ||
}>; | ||
|
||
export type RegisterRequest = { | ||
email: string; | ||
password: string; | ||
password_confirmation: string; | ||
first_name: string; | ||
last_name: string; | ||
return_url: string; | ||
} & Record<string, string | number | boolean>; | ||
|
||
export type RegisterResponse = | ||
| { | ||
success: true; | ||
token: string; | ||
} | ||
| DefaultResponseError; | ||
|
||
export type ForgotRequest = { | ||
email: string; | ||
return_url: string; | ||
}; | ||
|
||
export type AuthResponse = | ||
| { | ||
message: string; | ||
success: boolean; | ||
} | ||
| DefaultResponseError; | ||
|
||
export type ResetPasswordRequest = { | ||
token: string; | ||
password: string; | ||
email: string; | ||
}; | ||
|
||
export type ChangePasswordRequest = { | ||
current_password: string; | ||
new_password: string; | ||
new_confirm_password: string; | ||
}; | ||
|
||
export type UpdateUserEmail = { | ||
email?: string; | ||
}; | ||
|
||
export interface CompleteSocialAuth { | ||
email: string; | ||
return_url: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { DefaultMetaResponse, Nullable, PaginationParams } from "./core"; | ||
import { BookmarkableType, TopicType } from "./enums"; | ||
import { User } from "./user"; | ||
|
||
export type BookmarkNoteBase = { | ||
id: number; | ||
value: string | null; | ||
created_at: Date | string; | ||
updated_at: Date | string; | ||
bookmarkable_id: number; | ||
user_id: number; | ||
user: Nullable<User>; | ||
}; | ||
|
||
export type BookmarkCourse = BookmarkNoteBase & { | ||
bookmarkable_type: BookmarkableType.Course; | ||
// TODO: after backend support this should be typed well | ||
bookmarkable: null; | ||
}; | ||
|
||
export type BookmarkLesson = BookmarkNoteBase & { | ||
bookmarkable_type: BookmarkableType.Lesson; | ||
// TODO: after backend support this should be typed well | ||
bookmarkable: null; | ||
}; | ||
|
||
export type BookmarkTopic = BookmarkNoteBase & { | ||
bookmarkable_type: BookmarkableType.Topic; | ||
bookmarkable: { | ||
id: number; | ||
title: string; | ||
type: TopicType; | ||
lesson_id: number; | ||
course_id: number; | ||
course_title: string; | ||
}; | ||
}; | ||
|
||
export type BookmarkNoteParams = | ||
EscolaLms.Bookmarks.Http.Requests.ListBookmarkRequest & | ||
PaginationParams & { | ||
order_by?: "created_at" | "id" | "value"; | ||
order?: "ASC" | "DESC"; | ||
has_value?: boolean | 1 | 0; | ||
bookmarkable_id?: number; | ||
bookmarkable_ids?: number[]; | ||
bookmarkable_type?: BookmarkableType; | ||
}; | ||
|
||
export type CreateBookmarkNote = { | ||
value: Nullable<string>; | ||
bookmarkable_id: number; | ||
bookmarkable_type: BookmarkableType; | ||
}; | ||
export type BookmarkNote = BookmarkCourse | BookmarkLesson | BookmarkTopic; | ||
export type BookmarkNoteList = DefaultMetaResponse<BookmarkNote>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { DefaultMetaResponse, Nullable, PaginationParams } from "./core"; | ||
import { CompetencyChallengeType } from "./enums"; | ||
import { Author } from "./user"; | ||
|
||
export type Scale = { | ||
parent_category_id: number; | ||
category_id: number; | ||
scale_min: number; | ||
}; | ||
|
||
export type ResultValue = { | ||
category_id: number; | ||
scale_category_id: number; | ||
parent_category_id: number; | ||
score: number; | ||
max_score: number; | ||
matched_course: number[]; | ||
}; | ||
|
||
export type CompetencyTestResults = { | ||
attempt_id: number; | ||
created_at: string; | ||
id: number; | ||
scale: Scale[][]; | ||
value: ResultValue[]; | ||
}; | ||
|
||
export type CompetencyChallengeCategory = { | ||
id: number; | ||
name: string; | ||
parent_id?: number; | ||
}; | ||
|
||
export type BaseCompetencyChallenge = { | ||
id: number; | ||
name: string; | ||
description: string; | ||
summary: string; | ||
image_path?: Nullable<string>; | ||
is_active: boolean; | ||
is_highlighted: boolean; | ||
quiz_id?: Nullable<number>; | ||
created_at: Date | string; | ||
categories?: number[]; | ||
authors?: Author[]; | ||
results: CompetencyTestResults[]; | ||
results_count: number; | ||
}; | ||
|
||
export type SimpleCompetencyChallenge = BaseCompetencyChallenge & { | ||
type: CompetencyChallengeType.Simple; | ||
category: CompetencyChallengeCategory; | ||
}; | ||
|
||
export type ComplexCompetencyChallenge = BaseCompetencyChallenge & { | ||
type: CompetencyChallengeType.Complex; | ||
}; | ||
|
||
export type CompetencyChallenge = | ||
| SimpleCompetencyChallenge | ||
| ComplexCompetencyChallenge; | ||
|
||
export type ChallengesList = DefaultMetaResponse<CompetencyChallenge>; | ||
|
||
export type ChallengesParams = PaginationParams & { | ||
order_by?: "id" | "name" | "created_at"; | ||
type?: "simple" | "complex"; | ||
order?: "ASC" | "DESC"; | ||
name?: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Category, PaginationParams } from "./core"; | ||
|
||
export type DictionariesParams = { | ||
word?: string; | ||
// Example: url?category_ids[]=1&category_ids[]=2category_ids[]=3 | ||
"category_ids[]"?: number[]; | ||
word_start?: string; | ||
abort_prev?: boolean; | ||
}; | ||
|
||
export type DictionariesWordsParams = DictionariesParams & PaginationParams; | ||
|
||
export type DictionariesWordsCategory = Pick< | ||
Category, | ||
"name" | "name_with_breadcrumbs" | "id" | ||
>; | ||
|
||
export type DictionaryWordData = { | ||
id?: number; | ||
title?: string; | ||
description?: string; | ||
video_url?: string; | ||
}; | ||
|
||
export type DictionariesWords = { | ||
id: number; | ||
word: string; | ||
dictionary_id: number; | ||
created_at: string; | ||
updated_at: string; | ||
categories: DictionariesWordsCategory[]; | ||
description?: string; | ||
data?: { | ||
descriptions?: DictionaryWordData[]; | ||
}; | ||
}; | ||
|
||
export type DictionariesAccess = { | ||
dictionary_id: number; | ||
name: string; | ||
slug: string; | ||
end_date: string; | ||
is_active: boolean; | ||
}; |
Oops, something went wrong.