1 /**
2 * @oas [post] /admin/uploads/presigned-urls
3 * operationId: PostUploadsPresignedUrls
4 * summary: Get Presigned Upload URL
5 * description: Get a presigned URL for uploading a file to the configured File Module Provider. The presigned URL can be used to upload files directly to the third-party provider. This only works if
6 * your configured provider supports presigned URLs, such as the S3 provider.
7 * x-authenticated: true
8 * security:
9 * - api_token: []
10 * - cookie_auth: []
11 * - jwt_token: []
12 * requestBody:
13 * content:
14 * application/json:
15 * schema:
16 * $ref: "#/components/schemas/AdminUploadPreSignedUrl"
17 * x-codeSamples:
18 * - lang: JavaScript
19 * label: JS SDK
20 * source: |-
21 * import Medusa from "@medusajs/js-sdk"
22 *
23 * export const sdk = new Medusa({
24 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
25 * debug: import.meta.env.DEV,
26 * auth: {
27 * type: "session",
28 * },
29 * })
30 *
31 * sdk.admin.upload.presignedUrl({
32 * name: "test.txt",
33 * size: 1000,
34 * type: "text/plain",
35 * }))
36 * - lang: Shell
37 * label: cURL
38 * source: |-
39 * curl -X POST '{backend_url}/admin/uploads/presigned-urls' \
40 * -H 'Authorization: Bearer {jwt_token}' \
41 * -H 'Content-Type: application/json' \
42 * --data-raw '{
43 * "originalname": "{value}",
44 * "size": 43,
45 * "mime_type": "{value}"
46 * }'
47 * tags:
48 * - Uploads
49 * responses:
50 * "200":
51 * description: OK
52 * content:
53 * application/json:
54 * schema:
55 * $ref: "#/components/schemas/AdminUploadPreSignedUrlResponse"
56 * "400":
57 * $ref: "#/components/responses/400_error"
58 * "401":
59 * $ref: "#/components/responses/unauthorized"
60 * "404":
61 * $ref: "#/components/responses/not_found_error"
62 * "409":
63 * $ref: "#/components/responses/invalid_state_error"
64 * "422":
65 * $ref: "#/components/responses/invalid_request_error"
66 * "500":
67 * $ref: "#/components/responses/500_error"
68 *
69 */
70