Skip to content

Commit 3b975cd

Browse files
committed
updated frontend accordingly
1 parent 8160d5c commit 3b975cd

File tree

7 files changed

+27
-82
lines changed

7 files changed

+27
-82
lines changed

frontend/src/api/DocProcessingHooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ const useUploadDocument = () =>
7171
useMutation({
7272
mutationFn: DocprocessingService.uploadFiles,
7373
meta: {
74-
successMessage: (data: string) =>
75-
`Successfully uploaded documents and started PreprocessingJob in the background! (${data})`,
74+
successMessage: (data: number) =>
75+
`Successfully uploaded ${data} documents and started PreprocessingJob in the background!`,
7676
},
7777
});
7878

frontend/src/api/openapi/models/Body_project_upload_project_sdoc.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

frontend/src/api/openapi/models/SourceDocumentStatusDetailed.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export type SourceDocumentStatusDetailed = {
2121
* Project the SourceDocument belongs to
2222
*/
2323
project_id: number;
24+
/**
25+
* ID of the SourceDocument
26+
*/
27+
id: number;
2428
/**
2529
* Number of processed jobs (depending on the doctype)
2630
*/

frontend/src/api/openapi/models/SourceDocumentStatusSimple.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export type SourceDocumentStatusSimple = {
2121
* Project the SourceDocument belongs to
2222
*/
2323
project_id: number;
24+
/**
25+
* ID of the SourceDocument
26+
*/
27+
id: number;
2428
/**
2529
* Number of processed jobs (depending on the doctype)
2630
*/

frontend/src/api/openapi/services/DocprocessingService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class DocprocessingService {
6060
}
6161
/**
6262
* Uploads one or multiple files to the Project with the given ID if it exists
63-
* @returns string Successful Response
63+
* @returns number Successful Response
6464
* @throws ApiError
6565
*/
6666
public static uploadFiles({
@@ -69,7 +69,7 @@ export class DocprocessingService {
6969
}: {
7070
projId: number;
7171
formData: Body_docprocessing_upload_files;
72-
}): CancelablePromise<string> {
72+
}): CancelablePromise<number> {
7373
return __request(OpenAPI, {
7474
method: "PUT",
7575
url: "/docprocessing/project/{proj_id}",

frontend/src/api/openapi/services/ProjectService.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/* istanbul ignore file */
33
/* tslint:disable */
44
/* eslint-disable */
5-
import type { Body_project_upload_project_sdoc } from "../models/Body_project_upload_project_sdoc";
65
import type { ProjectCreate } from "../models/ProjectCreate";
76
import type { ProjectRead } from "../models/ProjectRead";
87
import type { ProjectUpdate } from "../models/ProjectUpdate";
@@ -85,31 +84,6 @@ export class ProjectService {
8584
},
8685
});
8786
}
88-
/**
89-
* Uploads one or multiple SourceDocument to the Project with the given ID if it exists
90-
* @returns any Successful Response
91-
* @throws ApiError
92-
*/
93-
public static uploadProjectSdoc({
94-
projId,
95-
formData,
96-
}: {
97-
projId: number;
98-
formData: Body_project_upload_project_sdoc;
99-
}): CancelablePromise<any> {
100-
return __request(OpenAPI, {
101-
method: "PUT",
102-
url: "/project/{proj_id}/sdoc",
103-
path: {
104-
proj_id: projId,
105-
},
106-
formData: formData,
107-
mediaType: "multipart/form-data",
108-
errors: {
109-
422: `Validation Error`,
110-
},
111-
});
112-
}
11387
/**
11488
* Returns the Id of the SourceDocument identified by project_id and filename if it exists
11589
* @returns number Successful Response

frontend/src/openapi.json

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,7 @@
10841084
"200": {
10851085
"description": "Successful Response",
10861086
"content": {
1087-
"application/json": {
1088-
"schema": { "type": "string", "format": "date-time", "title": "Response Docprocessing-Upload Files" }
1089-
}
1087+
"application/json": { "schema": { "type": "integer", "title": "Response Docprocessing-Upload Files" } }
10901088
}
10911089
},
10921090
"422": {
@@ -2762,30 +2760,6 @@
27622760
}
27632761
}
27642762
},
2765-
"/project/{proj_id}/sdoc": {
2766-
"put": {
2767-
"tags": ["project"],
2768-
"summary": "Uploads one or multiple SourceDocument to the Project with the given ID if it exists",
2769-
"operationId": "upload_project_sdoc",
2770-
"security": [{ "OAuth2PasswordBearer": [] }],
2771-
"parameters": [
2772-
{ "name": "proj_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Proj Id" } }
2773-
],
2774-
"requestBody": {
2775-
"required": true,
2776-
"content": {
2777-
"multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_project-upload_project_sdoc" } }
2778-
}
2779-
},
2780-
"responses": {
2781-
"200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } },
2782-
"422": {
2783-
"description": "Validation Error",
2784-
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } }
2785-
}
2786-
}
2787-
}
2788-
},
27892763
"/project/{proj_id}/resolve_filename/{filename}": {
27902764
"get": {
27912765
"tags": ["project"],
@@ -6575,19 +6549,6 @@
65756549
"required": ["filter", "sorts"],
65766550
"title": "Body_perspectives-visualize_documents"
65776551
},
6578-
"Body_project-upload_project_sdoc": {
6579-
"properties": {
6580-
"uploaded_files": {
6581-
"items": { "type": "string", "format": "binary" },
6582-
"type": "array",
6583-
"title": "Uploaded Files",
6584-
"description": "File(s) that get uploaded and represented by the SourceDocument(s)"
6585-
}
6586-
},
6587-
"type": "object",
6588-
"required": ["uploaded_files"],
6589-
"title": "Body_project-upload_project_sdoc"
6590-
},
65916552
"Body_rag-rag_session": {
65926553
"properties": {
65936554
"query": {
@@ -7465,6 +7426,12 @@
74657426
"required": ["project_id", "urls"],
74667427
"title": "CrawlerJobInput"
74677428
},
7429+
"CrawlerJobOutput": {
7430+
"properties": { "crawled_data_zip": { "type": "string", "format": "path", "title": "Crawled Data Zip" } },
7431+
"type": "object",
7432+
"required": ["crawled_data_zip"],
7433+
"title": "CrawlerJobOutput"
7434+
},
74687435
"CrawlerJobRead": {
74697436
"properties": {
74707437
"job_id": { "type": "string", "title": "Job Id", "description": "RQ job ID" },
@@ -7492,7 +7459,10 @@
74927459
"description": "Total number of steps in the job process"
74937460
},
74947461
"input": { "$ref": "#/components/schemas/CrawlerJobInput", "description": "Input for the job" },
7495-
"output": { "type": "null", "title": "Output", "description": "Output for the job" },
7462+
"output": {
7463+
"anyOf": [{ "$ref": "#/components/schemas/CrawlerJobOutput" }, { "type": "null" }],
7464+
"description": "Output for the job"
7465+
},
74967466
"created": {
74977467
"type": "string",
74987468
"format": "date-time",
@@ -10658,6 +10628,7 @@
1065810628
"title": "Project Id",
1065910629
"description": "Project the SourceDocument belongs to"
1066010630
},
10631+
"id": { "type": "integer", "title": "Id", "description": "ID of the SourceDocument" },
1066110632
"processed_jobs": {
1066210633
"type": "integer",
1066310634
"title": "Processed Jobs",
@@ -10726,6 +10697,7 @@
1072610697
"filename",
1072710698
"doctype",
1072810699
"project_id",
10700+
"id",
1072910701
"processed_jobs",
1073010702
"total_jobs",
1073110703
"processed_status",
@@ -10769,6 +10741,7 @@
1076910741
"title": "Project Id",
1077010742
"description": "Project the SourceDocument belongs to"
1077110743
},
10744+
"id": { "type": "integer", "title": "Id", "description": "ID of the SourceDocument" },
1077210745
"processed_jobs": {
1077310746
"type": "integer",
1077410747
"title": "Processed Jobs",
@@ -10785,7 +10758,7 @@
1078510758
}
1078610759
},
1078710760
"type": "object",
10788-
"required": ["filename", "doctype", "project_id", "processed_jobs", "total_jobs", "processed_status"],
10761+
"required": ["filename", "doctype", "project_id", "id", "processed_jobs", "total_jobs", "processed_status"],
1078910762
"title": "SourceDocumentStatusSimple"
1079010763
},
1079110764
"SourceDocumentTagLinks": {

0 commit comments

Comments
 (0)