Skip to content

Commit c6be71f

Browse files
Merge branch 'backend-api' of https://github.com/monicasmith463/study-assistant into backend-api
2 parents 7ff1e88 + 309245e commit c6be71f

3 files changed

Lines changed: 350 additions & 1 deletion

File tree

frontend/src/client/schemas.gen.ts

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3+
export const Body_documents_create_documentSchema = {
4+
properties: {
5+
file: {
6+
type: 'string',
7+
format: 'binary',
8+
title: 'File'
9+
}
10+
},
11+
type: 'object',
12+
required: ['file'],
13+
title: 'Body_documents-create_document'
14+
} as const;
15+
316
export const Body_login_login_access_tokenSchema = {
417
properties: {
518
grant_type: {
@@ -55,6 +68,172 @@ export const Body_login_login_access_tokenSchema = {
5568
title: 'Body_login-login_access_token'
5669
} as const;
5770

71+
export const DocumentPublicSchema = {
72+
properties: {
73+
filename: {
74+
type: 'string',
75+
title: 'Filename'
76+
},
77+
s3_url: {
78+
anyOf: [
79+
{
80+
type: 'string',
81+
maxLength: 255
82+
},
83+
{
84+
type: 'null'
85+
}
86+
],
87+
title: 'S3 Url'
88+
},
89+
s3_key: {
90+
anyOf: [
91+
{
92+
type: 'string',
93+
maxLength: 1024
94+
},
95+
{
96+
type: 'null'
97+
}
98+
],
99+
title: 'S3 Key'
100+
},
101+
content_type: {
102+
anyOf: [
103+
{
104+
type: 'string'
105+
},
106+
{
107+
type: 'null'
108+
}
109+
],
110+
title: 'Content Type'
111+
},
112+
size: {
113+
anyOf: [
114+
{
115+
type: 'integer'
116+
},
117+
{
118+
type: 'null'
119+
}
120+
],
121+
title: 'Size'
122+
},
123+
id: {
124+
type: 'string',
125+
format: 'uuid',
126+
title: 'Id'
127+
},
128+
owner_id: {
129+
type: 'string',
130+
format: 'uuid',
131+
title: 'Owner Id'
132+
},
133+
extracted_text: {
134+
anyOf: [
135+
{
136+
type: 'string'
137+
},
138+
{
139+
type: 'null'
140+
}
141+
],
142+
title: 'Extracted Text'
143+
}
144+
},
145+
type: 'object',
146+
required: ['filename', 'id', 'owner_id'],
147+
title: 'DocumentPublic'
148+
} as const;
149+
150+
export const DocumentUpdateSchema = {
151+
properties: {
152+
filename: {
153+
anyOf: [
154+
{
155+
type: 'string',
156+
maxLength: 255,
157+
minLength: 1
158+
},
159+
{
160+
type: 'null'
161+
}
162+
],
163+
title: 'Filename'
164+
},
165+
s3_url: {
166+
anyOf: [
167+
{
168+
type: 'string',
169+
maxLength: 255
170+
},
171+
{
172+
type: 'null'
173+
}
174+
],
175+
title: 'S3 Url'
176+
},
177+
s3_key: {
178+
anyOf: [
179+
{
180+
type: 'string',
181+
maxLength: 1024
182+
},
183+
{
184+
type: 'null'
185+
}
186+
],
187+
title: 'S3 Key'
188+
},
189+
content_type: {
190+
anyOf: [
191+
{
192+
type: 'string',
193+
maxLength: 255
194+
},
195+
{
196+
type: 'null'
197+
}
198+
],
199+
title: 'Content Type'
200+
},
201+
size: {
202+
anyOf: [
203+
{
204+
type: 'integer',
205+
minimum: 0
206+
},
207+
{
208+
type: 'null'
209+
}
210+
],
211+
title: 'Size'
212+
}
213+
},
214+
type: 'object',
215+
title: 'DocumentUpdate'
216+
} as const;
217+
218+
export const DocumentsPublicSchema = {
219+
properties: {
220+
data: {
221+
items: {
222+
'$ref': '#/components/schemas/DocumentPublic'
223+
},
224+
type: 'array',
225+
title: 'Data'
226+
},
227+
count: {
228+
type: 'integer',
229+
title: 'Count'
230+
}
231+
},
232+
type: 'object',
233+
required: ['data', 'count'],
234+
title: 'DocumentsPublic'
235+
} as const;
236+
58237
export const HTTPValidationErrorSchema = {
59238
properties: {
60239
detail: {

frontend/src/client/sdk.gen.ts

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,117 @@
33
import type { CancelablePromise } from './core/CancelablePromise';
44
import { OpenAPI } from './core/OpenAPI';
55
import { request as __request } from './core/request';
6-
import type { 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, 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';
7+
8+
export class DocumentsService {
9+
/**
10+
* Create Document
11+
* @param data The data for the request.
12+
* @param data.formData
13+
* @returns DocumentPublic Successful Response
14+
* @throws ApiError
15+
*/
16+
public static createDocument(data: DocumentsCreateDocumentData): CancelablePromise<DocumentsCreateDocumentResponse> {
17+
return __request(OpenAPI, {
18+
method: 'POST',
19+
url: '/api/v1/documents/',
20+
formData: data.formData,
21+
mediaType: 'multipart/form-data',
22+
errors: {
23+
422: 'Validation Error'
24+
}
25+
});
26+
}
27+
28+
/**
29+
* Read Documents
30+
* Retrieve documents.
31+
* @param data The data for the request.
32+
* @param data.skip
33+
* @param data.limit
34+
* @returns DocumentsPublic Successful Response
35+
* @throws ApiError
36+
*/
37+
public static readDocuments(data: DocumentsReadDocumentsData = {}): CancelablePromise<DocumentsReadDocumentsResponse> {
38+
return __request(OpenAPI, {
39+
method: 'GET',
40+
url: '/api/v1/documents/',
41+
query: {
42+
skip: data.skip,
43+
limit: data.limit
44+
},
45+
errors: {
46+
422: 'Validation Error'
47+
}
48+
});
49+
}
50+
51+
/**
52+
* Read Document
53+
* Get document by ID.
54+
* @param data The data for the request.
55+
* @param data.id
56+
* @returns DocumentPublic Successful Response
57+
* @throws ApiError
58+
*/
59+
public static readDocument(data: DocumentsReadDocumentData): CancelablePromise<DocumentsReadDocumentResponse> {
60+
return __request(OpenAPI, {
61+
method: 'GET',
62+
url: '/api/v1/documents/{id}',
63+
path: {
64+
id: data.id
65+
},
66+
errors: {
67+
422: 'Validation Error'
68+
}
69+
});
70+
}
71+
72+
/**
73+
* Update Document
74+
* Update an document.
75+
* @param data The data for the request.
76+
* @param data.id
77+
* @param data.requestBody
78+
* @returns DocumentPublic Successful Response
79+
* @throws ApiError
80+
*/
81+
public static updateDocument(data: DocumentsUpdateDocumentData): CancelablePromise<DocumentsUpdateDocumentResponse> {
82+
return __request(OpenAPI, {
83+
method: 'PUT',
84+
url: '/api/v1/documents/{id}',
85+
path: {
86+
id: data.id
87+
},
88+
body: data.requestBody,
89+
mediaType: 'application/json',
90+
errors: {
91+
422: 'Validation Error'
92+
}
93+
});
94+
}
95+
96+
/**
97+
* Delete Document
98+
* Delete an document.
99+
* @param data The data for the request.
100+
* @param data.id
101+
* @returns Message Successful Response
102+
* @throws ApiError
103+
*/
104+
public static deleteDocument(data: DocumentsDeleteDocumentData): CancelablePromise<DocumentsDeleteDocumentResponse> {
105+
return __request(OpenAPI, {
106+
method: 'DELETE',
107+
url: '/api/v1/documents/{id}',
108+
path: {
109+
id: data.id
110+
},
111+
errors: {
112+
422: 'Validation Error'
113+
}
114+
});
115+
}
116+
}
7117

8118
export class ItemsService {
9119
/**

frontend/src/client/types.gen.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3+
export type Body_documents_create_document = {
4+
file: (Blob | File);
5+
};
6+
37
export type Body_login_login_access_token = {
48
grant_type?: (string | null);
59
username: string;
@@ -9,6 +13,30 @@ export type Body_login_login_access_token = {
913
client_secret?: (string | null);
1014
};
1115

16+
export type DocumentPublic = {
17+
filename: string;
18+
s3_url?: (string | null);
19+
s3_key?: (string | null);
20+
content_type?: (string | null);
21+
size?: (number | null);
22+
id: string;
23+
owner_id: string;
24+
extracted_text?: (string | null);
25+
};
26+
27+
export type DocumentsPublic = {
28+
data: Array<DocumentPublic>;
29+
count: number;
30+
};
31+
32+
export type DocumentUpdate = {
33+
filename?: (string | null);
34+
s3_url?: (string | null);
35+
s3_key?: (string | null);
36+
content_type?: (string | null);
37+
size?: (number | null);
38+
};
39+
1240
export type HTTPValidationError = {
1341
detail?: Array<ValidationError>;
1442
};
@@ -107,6 +135,38 @@ export type ValidationError = {
107135
type: string;
108136
};
109137

138+
export type DocumentsCreateDocumentData = {
139+
formData: Body_documents_create_document;
140+
};
141+
142+
export type DocumentsCreateDocumentResponse = (DocumentPublic);
143+
144+
export type DocumentsReadDocumentsData = {
145+
limit?: number;
146+
skip?: number;
147+
};
148+
149+
export type DocumentsReadDocumentsResponse = (DocumentsPublic);
150+
151+
export type DocumentsReadDocumentData = {
152+
id: string;
153+
};
154+
155+
export type DocumentsReadDocumentResponse = (DocumentPublic);
156+
157+
export type DocumentsUpdateDocumentData = {
158+
id: string;
159+
requestBody: DocumentUpdate;
160+
};
161+
162+
export type DocumentsUpdateDocumentResponse = (DocumentPublic);
163+
164+
export type DocumentsDeleteDocumentData = {
165+
id: string;
166+
};
167+
168+
export type DocumentsDeleteDocumentResponse = (Message);
169+
110170
export type ItemsReadItemsData = {
111171
limit?: number;
112172
skip?: number;

0 commit comments

Comments
 (0)