chore(docs): Generated API Reference (#2927)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
19d7be31eb
commit
cd32795595
@@ -0,0 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.uploads.delete({
|
||||
file_key
|
||||
})
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.uploads.getPresignedDownloadUrl({
|
||||
file_key
|
||||
})
|
||||
.then(({ download_url }) => {
|
||||
console.log(download_url);
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"file_key": "{file_key}"
|
||||
}'
|
||||
@@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"file_key": "{file_key}"
|
||||
}'
|
||||
Reference in New Issue
Block a user