Skip to content

Commit 3f4e815

Browse files
author
github-actions
committed
✨ Autogenerate frontend client
1 parent bb8e18a commit 3f4e815

File tree

3 files changed

+369
-1
lines changed

3 files changed

+369
-1
lines changed

frontend/src/client/schemas.gen.ts

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,151 @@ export const DocumentsPublicSchema = {
234234
title: 'DocumentsPublic'
235235
} as const;
236236

237+
export const ExamPublicSchema = {
238+
properties: {
239+
title: {
240+
type: 'string',
241+
title: 'Title'
242+
},
243+
description: {
244+
anyOf: [
245+
{
246+
type: 'string'
247+
},
248+
{
249+
type: 'null'
250+
}
251+
],
252+
title: 'Description'
253+
},
254+
duration_minutes: {
255+
anyOf: [
256+
{
257+
type: 'integer'
258+
},
259+
{
260+
type: 'null'
261+
}
262+
],
263+
title: 'Duration Minutes'
264+
},
265+
is_published: {
266+
type: 'boolean',
267+
title: 'Is Published',
268+
default: false
269+
},
270+
id: {
271+
type: 'string',
272+
format: 'uuid',
273+
title: 'Id'
274+
},
275+
owner_id: {
276+
type: 'string',
277+
format: 'uuid',
278+
title: 'Owner Id'
279+
},
280+
questions: {
281+
items: {
282+
'$ref': '#/components/schemas/QuestionPublic'
283+
},
284+
type: 'array',
285+
title: 'Questions'
286+
}
287+
},
288+
type: 'object',
289+
required: ['title', 'id', 'owner_id'],
290+
title: 'ExamPublic'
291+
} as const;
292+
293+
export const ExamUpdateSchema = {
294+
properties: {
295+
title: {
296+
anyOf: [
297+
{
298+
type: 'string',
299+
maxLength: 255
300+
},
301+
{
302+
type: 'null'
303+
}
304+
],
305+
title: 'Title'
306+
},
307+
description: {
308+
anyOf: [
309+
{
310+
type: 'string',
311+
maxLength: 1000
312+
},
313+
{
314+
type: 'null'
315+
}
316+
],
317+
title: 'Description'
318+
},
319+
duration_minutes: {
320+
anyOf: [
321+
{
322+
type: 'integer',
323+
minimum: 1
324+
},
325+
{
326+
type: 'null'
327+
}
328+
],
329+
title: 'Duration Minutes'
330+
},
331+
is_published: {
332+
anyOf: [
333+
{
334+
type: 'boolean'
335+
},
336+
{
337+
type: 'null'
338+
}
339+
],
340+
title: 'Is Published'
341+
}
342+
},
343+
type: 'object',
344+
title: 'ExamUpdate'
345+
} as const;
346+
347+
export const ExamsPublicSchema = {
348+
properties: {
349+
data: {
350+
items: {
351+
'$ref': '#/components/schemas/ExamPublic'
352+
},
353+
type: 'array',
354+
title: 'Data'
355+
},
356+
count: {
357+
type: 'integer',
358+
title: 'Count'
359+
}
360+
},
361+
type: 'object',
362+
required: ['data', 'count'],
363+
title: 'ExamsPublic'
364+
} as const;
365+
366+
export const GenerateQuestionsRequestSchema = {
367+
properties: {
368+
document_ids: {
369+
items: {
370+
type: 'string',
371+
format: 'uuid'
372+
},
373+
type: 'array',
374+
title: 'Document Ids'
375+
}
376+
},
377+
type: 'object',
378+
required: ['document_ids'],
379+
title: 'GenerateQuestionsRequest'
380+
} as const;
381+
237382
export const HTTPValidationErrorSchema = {
238383
properties: {
239384
detail: {
@@ -416,6 +561,51 @@ export const PrivateUserCreateSchema = {
416561
title: 'PrivateUserCreate'
417562
} as const;
418563

564+
export const QuestionPublicSchema = {
565+
properties: {
566+
question: {
567+
type: 'string',
568+
title: 'Question'
569+
},
570+
answer: {
571+
anyOf: [
572+
{
573+
type: 'string'
574+
},
575+
{
576+
type: 'null'
577+
}
578+
],
579+
title: 'Answer'
580+
},
581+
id: {
582+
type: 'string',
583+
format: 'uuid',
584+
title: 'Id'
585+
},
586+
type: {
587+
'$ref': '#/components/schemas/QuestionType'
588+
},
589+
options: {
590+
items: {
591+
type: 'string'
592+
},
593+
type: 'array',
594+
title: 'Options',
595+
default: []
596+
}
597+
},
598+
type: 'object',
599+
required: ['question', 'id', 'type'],
600+
title: 'QuestionPublic'
601+
} as const;
602+
603+
export const QuestionTypeSchema = {
604+
type: 'string',
605+
enum: ['multiple_choice', 'true_false', 'short_answer'],
606+
title: 'QuestionType'
607+
} as const;
608+
419609
export const TokenSchema = {
420610
properties: {
421611
access_token: {

frontend/src/client/sdk.gen.ts

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import type { CancelablePromise } from './core/CancelablePromise';
44
import { OpenAPI } from './core/OpenAPI';
55
import { request as __request } from './core/request';
6-
import type { DocumentsCreateDocumentData, DocumentsCreateDocumentResponse, DocumentsReadDocumentsData, DocumentsReadDocumentsResponse, DocumentsReadDocumentData, DocumentsReadDocumentResponse, DocumentsUpdateDocumentData, DocumentsUpdateDocumentResponse, DocumentsDeleteDocumentData, DocumentsDeleteDocumentResponse, ItemsReadItemsData, ItemsReadItemsResponse, ItemsCreateItemData, ItemsCreateItemResponse, ItemsReadItemData, ItemsReadItemResponse, ItemsUpdateItemData, ItemsUpdateItemResponse, ItemsDeleteItemData, ItemsDeleteItemResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginTestTokenResponse, LoginRecoverPasswordData, LoginRecoverPasswordResponse, LoginResetPasswordData, LoginResetPasswordResponse, LoginRecoverPasswordHtmlContentData, LoginRecoverPasswordHtmlContentResponse, PrivateCreateUserData, PrivateCreateUserResponse, UsersReadUsersData, UsersReadUsersResponse, UsersCreateUserData, UsersCreateUserResponse, UsersReadUserMeResponse, UsersDeleteUserMeResponse, UsersUpdateUserMeData, UsersUpdateUserMeResponse, UsersUpdatePasswordMeData, UsersUpdatePasswordMeResponse, UsersRegisterUserData, UsersRegisterUserResponse, UsersReadUserByIdData, UsersReadUserByIdResponse, UsersUpdateUserData, UsersUpdateUserResponse, UsersDeleteUserData, UsersDeleteUserResponse, UtilsTestEmailData, UtilsTestEmailResponse, UtilsHealthCheckResponse } from './types.gen';
6+
import type { DocumentsCreateDocumentData, DocumentsCreateDocumentResponse, DocumentsReadDocumentsData, DocumentsReadDocumentsResponse, DocumentsReadDocumentData, DocumentsReadDocumentResponse, DocumentsUpdateDocumentData, DocumentsUpdateDocumentResponse, DocumentsDeleteDocumentData, DocumentsDeleteDocumentResponse, ExamsGenerateExamData, ExamsGenerateExamResponse, ExamsReadExamData, ExamsReadExamResponse, ExamsUpdateExamData, ExamsUpdateExamResponse, ExamsDeleteExamData, ExamsDeleteExamResponse, ExamsReadExamsData, ExamsReadExamsResponse, ItemsReadItemsData, ItemsReadItemsResponse, ItemsCreateItemData, ItemsCreateItemResponse, ItemsReadItemData, ItemsReadItemResponse, ItemsUpdateItemData, ItemsUpdateItemResponse, ItemsDeleteItemData, ItemsDeleteItemResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginTestTokenResponse, LoginRecoverPasswordData, LoginRecoverPasswordResponse, LoginResetPasswordData, LoginResetPasswordResponse, LoginRecoverPasswordHtmlContentData, LoginRecoverPasswordHtmlContentResponse, PrivateCreateUserData, PrivateCreateUserResponse, UsersReadUsersData, UsersReadUsersResponse, UsersCreateUserData, UsersCreateUserResponse, UsersReadUserMeResponse, UsersDeleteUserMeResponse, UsersUpdateUserMeData, UsersUpdateUserMeResponse, UsersUpdatePasswordMeData, UsersUpdatePasswordMeResponse, UsersRegisterUserData, UsersRegisterUserResponse, UsersReadUserByIdData, UsersReadUserByIdResponse, UsersUpdateUserData, UsersUpdateUserResponse, UsersDeleteUserData, UsersDeleteUserResponse, UtilsTestEmailData, UtilsTestEmailResponse, UtilsHealthCheckResponse } from './types.gen';
77

88
export class DocumentsService {
99
/**
@@ -115,6 +115,116 @@ export class DocumentsService {
115115
}
116116
}
117117

118+
export class ExamsService {
119+
/**
120+
* Generate Exam
121+
* @param data The data for the request.
122+
* @param data.requestBody
123+
* @returns ExamPublic Successful Response
124+
* @throws ApiError
125+
*/
126+
public static generateExam(data: ExamsGenerateExamData): CancelablePromise<ExamsGenerateExamResponse> {
127+
return __request(OpenAPI, {
128+
method: 'POST',
129+
url: '/api/v1/exams/generate',
130+
body: data.requestBody,
131+
mediaType: 'application/json',
132+
errors: {
133+
422: 'Validation Error'
134+
}
135+
});
136+
}
137+
138+
/**
139+
* Read Exam
140+
* Get exam by ID.
141+
* @param data The data for the request.
142+
* @param data.id
143+
* @returns ExamPublic Successful Response
144+
* @throws ApiError
145+
*/
146+
public static readExam(data: ExamsReadExamData): CancelablePromise<ExamsReadExamResponse> {
147+
return __request(OpenAPI, {
148+
method: 'GET',
149+
url: '/api/v1/exams/{id}',
150+
path: {
151+
id: data.id
152+
},
153+
errors: {
154+
422: 'Validation Error'
155+
}
156+
});
157+
}
158+
159+
/**
160+
* Update Exam
161+
* Update an exam.
162+
* @param data The data for the request.
163+
* @param data.id
164+
* @param data.requestBody
165+
* @returns ExamPublic Successful Response
166+
* @throws ApiError
167+
*/
168+
public static updateExam(data: ExamsUpdateExamData): CancelablePromise<ExamsUpdateExamResponse> {
169+
return __request(OpenAPI, {
170+
method: 'PUT',
171+
url: '/api/v1/exams/{id}',
172+
path: {
173+
id: data.id
174+
},
175+
body: data.requestBody,
176+
mediaType: 'application/json',
177+
errors: {
178+
422: 'Validation Error'
179+
}
180+
});
181+
}
182+
183+
/**
184+
* Delete Exam
185+
* Delete an exam.
186+
* @param data The data for the request.
187+
* @param data.id
188+
* @returns Message Successful Response
189+
* @throws ApiError
190+
*/
191+
public static deleteExam(data: ExamsDeleteExamData): CancelablePromise<ExamsDeleteExamResponse> {
192+
return __request(OpenAPI, {
193+
method: 'DELETE',
194+
url: '/api/v1/exams/{id}',
195+
path: {
196+
id: data.id
197+
},
198+
errors: {
199+
422: 'Validation Error'
200+
}
201+
});
202+
}
203+
204+
/**
205+
* Read Exams
206+
* Retrieve exams.
207+
* @param data The data for the request.
208+
* @param data.skip
209+
* @param data.limit
210+
* @returns ExamsPublic Successful Response
211+
* @throws ApiError
212+
*/
213+
public static readExams(data: ExamsReadExamsData = {}): CancelablePromise<ExamsReadExamsResponse> {
214+
return __request(OpenAPI, {
215+
method: 'GET',
216+
url: '/api/v1/exams/',
217+
query: {
218+
skip: data.skip,
219+
limit: data.limit
220+
},
221+
errors: {
222+
422: 'Validation Error'
223+
}
224+
});
225+
}
226+
}
227+
118228
export class ItemsService {
119229
/**
120230
* Read Items

0 commit comments

Comments
 (0)