Skip to content

Commit 7ac734c

Browse files
github-actions[bot]olivermrblshahednasser
authored
chore(docs): Updated API Reference (automated) (medusajs#12826)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oli Juhl <[email protected]> Co-authored-by: Shahed Nasser <[email protected]>
1 parent 441334a commit 7ac734c

File tree

168 files changed

+2982
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2982
-25
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.product.createImport({
12+
file // uploaded File instance
13+
})
14+
.then(({ transaction_id }) => {
15+
console.log(transaction_id)
16+
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.product.confirmImport("transaction_123")
12+
.then(() => {
13+
console.log("Import confirmed")
14+
})
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.upload.presignedUrl({
12+
name: "test.txt",
13+
size: 1000,
14+
type: "text/plain",
15+
}))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
curl -X POST '{backend_url}/admin/products/imports' \
2+
-H 'Authorization: Bearer {access_token}' \
3+
-H 'Content-Type: application/json' \
4+
--data-raw '{
5+
"file_key": "{value}",
6+
"originalname": "{value}",
7+
"extension": "{value}",
8+
"size": 38,
9+
"mime_type": "{value}"
10+
}'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
curl -X POST '{backend_url}/admin/products/imports/{transaction_id}/confirm' \
2+
-H 'Authorization: Bearer {access_token}'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
curl -X POST '{backend_url}/admin/uploads/presigned-urls' \
2+
-H 'Authorization: Bearer {access_token}' \
3+
-H 'Content-Type: application/json' \
4+
--data-raw '{
5+
"originalname": "{value}",
6+
"size": 43,
7+
"mime_type": "{value}"
8+
}'

www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrder.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ required:
4040
- original_shipping_total
4141
- original_shipping_subtotal
4242
- original_shipping_tax_total
43+
- credit_line_total
4344
properties:
4445
payment_collections:
4546
type: array
@@ -254,3 +255,7 @@ properties:
254255
description: The draft order's credit lines.
255256
items:
256257
$ref: ./OrderCreditLine.yaml
258+
credit_line_total:
259+
type: number
260+
title: credit_line_total
261+
description: The draft order's credit line total.

www/apps/api-reference/specs/admin/components/schemas/AdminDraftOrderPreview.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ required:
4040
- original_shipping_total
4141
- original_shipping_subtotal
4242
- original_shipping_tax_total
43+
- credit_line_total
4344
properties:
4445
return_requested_total:
4546
type: number
@@ -653,3 +654,7 @@ properties:
653654
description: The order preview's credit lines.
654655
items:
655656
$ref: ./OrderCreditLine.yaml
657+
credit_line_total:
658+
type: number
659+
title: credit_line_total
660+
description: The draft order preview's credit line total.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
type: object
2+
description: The details of the product's import file.
3+
x-schemaName: AdminImportProducts
4+
required:
5+
- file_key
6+
- originalname
7+
- extension
8+
- size
9+
- mime_type
10+
properties:
11+
file_key:
12+
type: string
13+
title: file_key
14+
description: The name of the file as stored in the configured File Module Provider.
15+
originalname:
16+
type: string
17+
title: originalname
18+
description: The file's original name.
19+
extension:
20+
type: string
21+
title: extension
22+
description: The file's extension.
23+
example: csv
24+
size:
25+
type: number
26+
title: size
27+
description: The file's size in bytes.
28+
mime_type:
29+
type: string
30+
title: mime_type
31+
description: The file's mime type.
32+
example: text/csv

www/apps/api-reference/specs/admin/components/schemas/AdminOrder.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ required:
4040
- original_shipping_total
4141
- original_shipping_subtotal
4242
- original_shipping_tax_total
43+
- credit_line_total
4344
properties:
4445
payment_collections:
4546
type: array
@@ -247,3 +248,7 @@ properties:
247248
description: The order's credit lines.
248249
items:
249250
$ref: ./OrderCreditLine.yaml
251+
credit_line_total:
252+
type: number
253+
title: credit_line_total
254+
description: The order's credit line total.

0 commit comments

Comments
 (0)