m
This commit is contained in:
@@ -10,5 +10,6 @@ export {
|
||||
CategoryInfo,
|
||||
DescriptiveGradingRecord,
|
||||
Question,
|
||||
TargetInfo
|
||||
TargetInfo,
|
||||
User
|
||||
} from "./models.js";
|
||||
|
||||
@@ -200,3 +200,56 @@ export class TargetInfo {
|
||||
return new TargetInfo($$parsedSource as Partial<TargetInfo>);
|
||||
}
|
||||
}
|
||||
|
||||
export class User {
|
||||
"id": number;
|
||||
"username": string;
|
||||
"password": string;
|
||||
"nickname": string;
|
||||
"phone": string;
|
||||
|
||||
/**
|
||||
* 'pending', 'approved', 'rejected'
|
||||
*/
|
||||
"status": string;
|
||||
"apiKey": string;
|
||||
"createdAt": string;
|
||||
|
||||
/** Creates a new User instance. */
|
||||
constructor($$source: Partial<User> = {}) {
|
||||
if (!("id" in $$source)) {
|
||||
this["id"] = 0;
|
||||
}
|
||||
if (!("username" in $$source)) {
|
||||
this["username"] = "";
|
||||
}
|
||||
if (!("password" in $$source)) {
|
||||
this["password"] = "";
|
||||
}
|
||||
if (!("nickname" in $$source)) {
|
||||
this["nickname"] = "";
|
||||
}
|
||||
if (!("phone" in $$source)) {
|
||||
this["phone"] = "";
|
||||
}
|
||||
if (!("status" in $$source)) {
|
||||
this["status"] = "";
|
||||
}
|
||||
if (!("apiKey" in $$source)) {
|
||||
this["apiKey"] = "";
|
||||
}
|
||||
if (!("createdAt" in $$source)) {
|
||||
this["createdAt"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new User instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): User {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new User($$parsedSource as Partial<User>);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,33 @@
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as application$0 from "../github.com/wailsapp/wails/v3/pkg/application/models.js";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as $models from "./models.js";
|
||||
|
||||
/**
|
||||
* AddBookmark adds a source and question ID to the Bookmark table
|
||||
* AddBookmark adds a source and question ID to the Bookmark table for a user
|
||||
*/
|
||||
export function AddBookmark(source: string, questionID: number): $CancellablePromise<void> {
|
||||
return $Call.ByID(2172709195, source, questionID);
|
||||
export function AddBookmark(username: string, source: string, questionID: number): $CancellablePromise<void> {
|
||||
return $Call.ByID(2172709195, username, source, questionID);
|
||||
}
|
||||
|
||||
/**
|
||||
* AddGeminiKey adds a new Gemini API Key to database
|
||||
*/
|
||||
export function AddGeminiKey(key: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(4245109295, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* ApproveRegistration approves a registration request
|
||||
*/
|
||||
export function ApproveRegistration(username: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(3158451936, username);
|
||||
}
|
||||
|
||||
export function AskGemini(source: string, id: number, prompt: string, base64Image: string): $CancellablePromise<string> {
|
||||
@@ -21,28 +39,49 @@ export function AskGemini(source: string, id: number, prompt: string, base64Imag
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedCategories retrieves categories that have bookmarked questions
|
||||
* ChangePassword updates user password
|
||||
*/
|
||||
export function GetBookmarkedCategories(): $CancellablePromise<$models.CategoryInfo[]> {
|
||||
return $Call.ByID(2614333737).then(($result: any) => {
|
||||
export function ChangePassword(username: string, oldPassword: string, newPassword: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(182621021, username, oldPassword, newPassword);
|
||||
}
|
||||
|
||||
/**
|
||||
* DeleteGeminiKey deletes a Gemini API Key from database
|
||||
*/
|
||||
export function DeleteGeminiKey(key: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(939796543, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* DeleteUser deletes a user from Users table (admin only)
|
||||
*/
|
||||
export function DeleteUser(username: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(4061081732, username);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedCategories retrieves categories that have bookmarked questions for a user
|
||||
*/
|
||||
export function GetBookmarkedCategories(username: string): $CancellablePromise<$models.CategoryInfo[]> {
|
||||
return $Call.ByID(2614333737, username).then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedQuestions retrieves all bookmarked questions for a given category and difficulty
|
||||
* GetBookmarkedQuestions retrieves all bookmarked questions for a given category and difficulty for a user
|
||||
*/
|
||||
export function GetBookmarkedQuestions(category: string, difficulty: string): $CancellablePromise<$models.Question[]> {
|
||||
return $Call.ByID(1774610406, category, difficulty).then(($result: any) => {
|
||||
export function GetBookmarkedQuestions(username: string, category: string, difficulty: string): $CancellablePromise<$models.Question[]> {
|
||||
return $Call.ByID(1774610406, username, category, difficulty).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedTargets retrieves difficulties (targets) that have bookmarked questions within a category
|
||||
* GetBookmarkedTargets retrieves difficulties (targets) that have bookmarked questions within a category for a user
|
||||
*/
|
||||
export function GetBookmarkedTargets(category: string): $CancellablePromise<$models.TargetInfo[]> {
|
||||
return $Call.ByID(859878861, category).then(($result: any) => {
|
||||
export function GetBookmarkedTargets(username: string, category: string): $CancellablePromise<$models.TargetInfo[]> {
|
||||
return $Call.ByID(859878861, username, category).then(($result: any) => {
|
||||
return $$createType5($result);
|
||||
});
|
||||
}
|
||||
@@ -53,14 +92,48 @@ export function GetCategories(): $CancellablePromise<$models.CategoryInfo[]> {
|
||||
});
|
||||
}
|
||||
|
||||
export function GetDescriptiveGradingHistory(source: string, questionID: number): $CancellablePromise<$models.DescriptiveGradingRecord[]> {
|
||||
return $Call.ByID(1670245718, source, questionID).then(($result: any) => {
|
||||
/**
|
||||
* GetCategoriesForUser retrieves categories based on user authorization
|
||||
*/
|
||||
export function GetCategoriesForUser(username: string): $CancellablePromise<$models.CategoryInfo[]> {
|
||||
return $Call.ByID(2664331048, username).then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetDescriptiveGradingHistory(username: string, source: string, questionID: number): $CancellablePromise<$models.DescriptiveGradingRecord[]> {
|
||||
return $Call.ByID(1670245718, username, source, questionID).then(($result: any) => {
|
||||
return $$createType7($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetQuestions(category: string, difficulty: string, subject: string): $CancellablePromise<$models.Question[]> {
|
||||
return $Call.ByID(2580577541, category, difficulty, subject).then(($result: any) => {
|
||||
/**
|
||||
* GetGeminiKeys returns all stored Gemini API Keys
|
||||
*/
|
||||
export function GetGeminiKeys(): $CancellablePromise<string[]> {
|
||||
return $Call.ByID(2410372615).then(($result: any) => {
|
||||
return $$createType8($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetPendingRegistrations retrieves list of pending sign-ups (admin only)
|
||||
*/
|
||||
export function GetPendingRegistrations(): $CancellablePromise<$models.User[]> {
|
||||
return $Call.ByID(1284545415).then(($result: any) => {
|
||||
return $$createType10($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetPreferredModel returns the user's preferred Gemini model from database
|
||||
*/
|
||||
export function GetPreferredModel(): $CancellablePromise<string> {
|
||||
return $Call.ByID(2043611586);
|
||||
}
|
||||
|
||||
export function GetQuestions(username: string, category: string, difficulty: string, subject: string): $CancellablePromise<$models.Question[]> {
|
||||
return $Call.ByID(2580577541, username, category, difficulty, subject).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
@@ -77,23 +150,68 @@ export function GetTargets(category: string): $CancellablePromise<$models.Target
|
||||
});
|
||||
}
|
||||
|
||||
export function GradeDescriptiveAnswer(source: string, questionID: number, userAnswer: string): $CancellablePromise<$models.DescriptiveGradingRecord | null> {
|
||||
return $Call.ByID(642001377, source, questionID, userAnswer).then(($result: any) => {
|
||||
return $$createType9($result);
|
||||
/**
|
||||
* GetUserAllowedCategories returns allowed category names for a specific user
|
||||
*/
|
||||
export function GetUserAllowedCategories(username: string): $CancellablePromise<string[]> {
|
||||
return $Call.ByID(850277733, username).then(($result: any) => {
|
||||
return $$createType8($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* RemoveBookmark removes a source and question ID from the Bookmark table
|
||||
* GetUsers returns list of all users (admin only)
|
||||
*/
|
||||
export function RemoveBookmark(source: string, questionID: number): $CancellablePromise<void> {
|
||||
return $Call.ByID(189585076, source, questionID);
|
||||
export function GetUsers(): $CancellablePromise<$models.User[]> {
|
||||
return $Call.ByID(4202172424).then(($result: any) => {
|
||||
return $$createType10($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GradeDescriptiveAnswer(username: string, source: string, questionID: number, userAnswer: string): $CancellablePromise<$models.DescriptiveGradingRecord | null> {
|
||||
return $Call.ByID(642001377, username, source, questionID, userAnswer).then(($result: any) => {
|
||||
return $$createType11($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Login authenticates a user
|
||||
*/
|
||||
export function Login(username: string, password: string): $CancellablePromise<$models.User | null> {
|
||||
return $Call.ByID(3841810241, username, password).then(($result: any) => {
|
||||
return $$createType12($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register creates a new registration application
|
||||
*/
|
||||
export function Register(username: string, password: string, nickname: string, phone: string, apiKey: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(2274424021, username, password, nickname, phone, apiKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* RejectRegistration rejects a registration request
|
||||
*/
|
||||
export function RejectRegistration(username: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(822104546, username);
|
||||
}
|
||||
|
||||
/**
|
||||
* RemoveBookmark removes a source and question ID from the Bookmark table for a user
|
||||
*/
|
||||
export function RemoveBookmark(username: string, source: string, questionID: number): $CancellablePromise<void> {
|
||||
return $Call.ByID(189585076, username, source, questionID);
|
||||
}
|
||||
|
||||
export function SaveAiExplanation(source: string, id: number, explanation: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(71515486, source, id, explanation);
|
||||
}
|
||||
|
||||
export function SetApp(app: application$0.App | null): $CancellablePromise<void> {
|
||||
return $Call.ByID(1456464199, app);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetGeminiKey sets the API key for Gemini calls
|
||||
*/
|
||||
@@ -101,6 +219,34 @@ export function SetGeminiKey(key: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(2865570266, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetPreferredModel saves the user's preferred Gemini model to database
|
||||
*/
|
||||
export function SetPreferredModel(modelName: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(1264102078, modelName);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetUserAllowedCategories replaces user's allowed categories
|
||||
*/
|
||||
export function SetUserAllowedCategories(username: string, categories: string[]): $CancellablePromise<void> {
|
||||
return $Call.ByID(2086723649, username, categories);
|
||||
}
|
||||
|
||||
/**
|
||||
* UpdateUserApiKey updates a user's personal API key in Users table and seeds it to GeminiKeys
|
||||
*/
|
||||
export function UpdateUserApiKey(username: string, apiKey: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(1770417973, username, apiKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* UpdateUserInfoForce updates user details by admin force (admin only)
|
||||
*/
|
||||
export function UpdateUserInfoForce(username: string, nickname: string, phone: string, password: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(1431090105, username, nickname, phone, password);
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = $models.CategoryInfo.createFrom;
|
||||
const $$createType1 = $Create.Array($$createType0);
|
||||
@@ -111,4 +257,7 @@ const $$createType5 = $Create.Array($$createType4);
|
||||
const $$createType6 = $models.DescriptiveGradingRecord.createFrom;
|
||||
const $$createType7 = $Create.Array($$createType6);
|
||||
const $$createType8 = $Create.Array($Create.Any);
|
||||
const $$createType9 = $Create.Nullable($$createType6);
|
||||
const $$createType9 = $models.User.createFrom;
|
||||
const $$createType10 = $Create.Array($$createType9);
|
||||
const $$createType11 = $Create.Nullable($$createType6);
|
||||
const $$createType12 = $Create.Nullable($$createType9);
|
||||
|
||||
Reference in New Issue
Block a user