|
8 | 8 | import { version } from "./package.json" with { type: "json" }; |
9 | 9 | import { z } from "zod/v4"; |
10 | 10 | import { zodSchemaAdapter } from "./src/adapters/zod-schema-adapter"; |
| 11 | +import { UploadFileBody, FormDataBody, UploadFilesBody } from "./src/schema"; |
11 | 12 |
|
12 | 13 | const EntryId = z.coerce.number().int().min(0).meta({ ref: "EntryId" }); |
13 | 14 | type EntryId = z.infer<typeof EntryId>; |
@@ -148,6 +149,48 @@ const app = createApp({ |
148 | 149 | responses: z.string().meta({ contentType: "text/csv" }), |
149 | 150 | }, |
150 | 151 | () => "test", |
| 152 | + ) |
| 153 | + .post( |
| 154 | + "/api/upload-form", |
| 155 | + { |
| 156 | + summary: "Upload Form", |
| 157 | + tags: ["Uploads"], |
| 158 | + body: FormDataBody, |
| 159 | + responses: { |
| 160 | + [HttpStatus.NoContent]: NoResponse, |
| 161 | + }, |
| 162 | + }, |
| 163 | + ({ status, body }) => { |
| 164 | + return status(HttpStatus.NoContent, undefined); |
| 165 | + }, |
| 166 | + ) |
| 167 | + .post( |
| 168 | + "/api/upload-file", |
| 169 | + { |
| 170 | + summary: "Upload File", |
| 171 | + tags: ["Uploads"], |
| 172 | + body: UploadFileBody, |
| 173 | + responses: { |
| 174 | + [HttpStatus.NoContent]: NoResponse, |
| 175 | + }, |
| 176 | + }, |
| 177 | + ({ status, body }) => { |
| 178 | + return status(HttpStatus.NoContent, undefined); |
| 179 | + }, |
| 180 | + ) |
| 181 | + .post( |
| 182 | + "/api/upload-files", |
| 183 | + { |
| 184 | + summary: "Upload Files", |
| 185 | + tags: ["Uploads"], |
| 186 | + body: UploadFilesBody, |
| 187 | + responses: { |
| 188 | + [HttpStatus.NoContent]: NoResponse, |
| 189 | + }, |
| 190 | + }, |
| 191 | + ({ status, body }) => { |
| 192 | + return status(HttpStatus.NoContent, undefined); |
| 193 | + }, |
151 | 194 | ); |
152 | 195 |
|
153 | 196 | console.log( |
|
0 commit comments