docs: fix bugs in API reference (#10557)

This commit is contained in:
Shahed Nasser
2024-12-11 18:32:58 +02:00
committed by GitHub
parent 0264294ab5
commit cccce65ef9
26 changed files with 91 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/line-items' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"variant_id": "{value}",
"quantity": 3360689747918848,

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/line-items/{line_id}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"quantity": 8980402259623936,
"metadata": {}

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/promotions' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"promo_codes": [
"{value}"

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/carts/{id}/shipping-methods' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"option_id": "{value}"
}'

View File

@@ -1,7 +1,7 @@
curl -X POST '{backend_url}/store/customers' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"email": "Monserrate.Leannon88@yahoo.com",
"company_name": "{value}",

View File

@@ -1,7 +1,7 @@
curl -X POST '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"company_name": "{value}",
"first_name": "{value}",

View File

@@ -1,7 +1,7 @@
curl -X POST '{backend_url}/store/customers/me/addresses' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"metadata": {},
"first_name": "{value}",

View File

@@ -1,3 +1,3 @@
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,7 +1,7 @@
curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"first_name": "{value}",
}'

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/payment-collections' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"cart_id": "{value}"
}'

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/payment-collections/{id}/payment-sessions' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"provider_id": "{value}"
}'

View File

@@ -1,6 +1,6 @@
curl -X POST '{backend_url}/store/return' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"order_id": "{value}",
"items": [

View File

@@ -935,8 +935,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/carts/{id}/line-items' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"variant_id": "{value}",
"quantity": 3360689747918848,
@@ -1007,8 +1007,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/carts/{id}/line-items/{line_id}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"quantity": 8980402259623936,
"metadata": {}
@@ -1167,8 +1167,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/carts/{id}/promotions' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"promo_codes": [
"{value}"
@@ -1303,8 +1303,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/carts/{id}/shipping-methods' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"option_id": "{value}"
}'
@@ -2252,8 +2252,8 @@ paths:
source: |-
curl -X POST '{backend_url}/store/customers' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"email": "Monserrate.Leannon88@yahoo.com",
"company_name": "{value}",
@@ -2371,8 +2371,8 @@ paths:
source: |-
curl -X POST '{backend_url}/store/customers/me' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"company_name": "{value}",
"first_name": "{value}",
@@ -2625,8 +2625,8 @@ paths:
source: |-
curl -X POST '{backend_url}/store/customers/me/addresses' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"metadata": {},
"first_name": "{value}",
@@ -2815,8 +2815,8 @@ paths:
source: |-
curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"first_name": "{value}",
}'
@@ -2875,8 +2875,8 @@ paths:
- lang: Shell
label: cURL
source: |-
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
-H 'Authorization: Bearer {access_token}'
tags:
- Customers
@@ -3430,8 +3430,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/payment-collections' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"cart_id": "{value}"
}'
@@ -3494,8 +3494,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/payment-collections/{id}/payment-sessions' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"provider_id": "{value}"
}'
@@ -5451,8 +5451,8 @@ paths:
label: cURL
source: |-
curl -X POST '{backend_url}/store/return' \
-H 'Content-Type: application/json' \ \
-H 'x-publishable-api-key: {your_publishable_api_key}'
-H 'Content-Type: application/json' \
-H 'x-publishable-api-key: {your_publishable_api_key}' \
--data-raw '{
"order_id": "{value}",
"items": [

View File

@@ -107,15 +107,30 @@ export const CodeTabs = ({
return
}
const codeBlockProps = codeBlock.props as CodeBlockProps
let codeBlockProps = codeBlock.props as CodeBlockProps
const commonProps = {
badgeLabel: undefined,
hasTabs: true,
className: clsx("!my-0", codeBlockProps.className),
}
if (
typeof codeBlock.type !== "string" &&
"name" in codeBlock.type &&
codeBlock.type.name === "CodeBlock"
) {
codeBlockProps = {
...codeBlockProps,
...commonProps,
}
}
const modifiedProps: CodeBlockProps = {
...(getCodeBlockProps(codeBlock) || {
source: "",
}),
badgeLabel: undefined,
hasTabs: true,
className: clsx("!my-0", codeBlockProps.className),
...commonProps,
}
tempTabs.push({

View File

@@ -34,8 +34,8 @@
* - lang: Shell
* label: cURL
* source: |-
* curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* -H 'Authorization: Bearer {access_token}'
* tags:
* - Customers

View File

@@ -37,8 +37,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/carts/{id}/line-items' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "variant_id": "{value}",
* "quantity": 3360689747918848,

View File

@@ -43,8 +43,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/carts/{id}/line-items/{line_id}' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "quantity": 8980402259623936,
* "metadata": {}

View File

@@ -45,8 +45,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/carts/{id}/promotions' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "promo_codes": [
* "{value}"

View File

@@ -51,8 +51,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/carts/{id}/shipping-methods' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "option_id": "{value}"
* }'

View File

@@ -31,8 +31,8 @@
* source: |-
* curl -X POST '{backend_url}/store/customers' \
* -H 'Authorization: Bearer {token}' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "email": "Monserrate.Leannon88@yahoo.com",
* "company_name": "{value}",

View File

@@ -34,8 +34,8 @@
* source: |-
* curl -X POST '{backend_url}/store/customers/me' \
* -H 'Authorization: Bearer {access_token}' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "company_name": "{value}",
* "first_name": "{value}",

View File

@@ -92,8 +92,8 @@
* source: |-
* curl -X POST '{backend_url}/store/customers/me/addresses' \
* -H 'Authorization: Bearer {access_token}' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "metadata": {},
* "first_name": "{value}",

View File

@@ -98,8 +98,8 @@
* source: |-
* curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
* -H 'Authorization: Bearer {access_token}' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "first_name": "{value}",
* }'

View File

@@ -30,8 +30,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/payment-collections' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "cart_id": "{value}"
* }'

View File

@@ -38,8 +38,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/payment-collections/{id}/payment-sessions' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "provider_id": "{value}"
* }'

View File

@@ -14,8 +14,8 @@
* label: cURL
* source: |-
* curl -X POST '{backend_url}/store/return' \
* -H 'Content-Type: application/json' \ \
* -H 'x-publishable-api-key: {your_publishable_api_key}'
* -H 'Content-Type: application/json' \
* -H 'x-publishable-api-key: {your_publishable_api_key}' \
* --data-raw '{
* "order_id": "{value}",
* "items": [