-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): Updated API Reference (automated) (#10641)
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]>
- Loading branch information
1 parent
1232a43
commit 4479ecd
Showing
9 changed files
with
291 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
www/apps/api-reference/specs/admin/components/schemas/StoreShippingOptionResponse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type: object | ||
description: The shipping option's details. | ||
x-schemaName: StoreShippingOptionResponse | ||
required: | ||
- shipping_option | ||
properties: | ||
shipping_option: | ||
$ref: ./StoreCartShippingOption.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...pi-reference/specs/store/code_samples/Shell/store_shipping-options_{id}_calculate/post.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
curl -X POST '{backend_url}/store/shipping-options/{id}/calculate' \ | ||
-H 'x-publishable-api-key: {your_publishable_api_key}' \ | ||
-H 'Content-Type: application/json' \ | ||
--data-raw '{ | ||
"cart_id": "{value}" | ||
}' |
8 changes: 8 additions & 0 deletions
8
www/apps/api-reference/specs/store/components/schemas/StoreShippingOptionResponse.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type: object | ||
description: The shipping option's details. | ||
x-schemaName: StoreShippingOptionResponse | ||
required: | ||
- shipping_option | ||
properties: | ||
shipping_option: | ||
$ref: ./StoreCartShippingOption.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
www/apps/api-reference/specs/store/paths/store_shipping-options_{id}_calculate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
post: | ||
operationId: PostShippingOptionsIdCalculate | ||
summary: Calculate Shipping Option Price | ||
description: Calculate the price of a shipping option in a cart. | ||
x-authenticated: false | ||
parameters: | ||
- name: id | ||
in: path | ||
description: The shipping option's ID. | ||
required: true | ||
schema: | ||
type: string | ||
- name: fields | ||
in: query | ||
description: >- | ||
Comma-separated fields that should be included in the returned data. | ||
if a field is prefixed with `+` it will be added to the default fields, | ||
using `-` will remove it from the default fields. | ||
without prefix it will replace the entire default fields. | ||
required: false | ||
schema: | ||
type: string | ||
title: fields | ||
description: >- | ||
Comma-separated fields that should be included in the returned data. | ||
If a field is prefixed with `+` it will be added to the default | ||
fields, using `-` will remove it from the default fields. Without | ||
prefix it will replace the entire default fields. | ||
externalDocs: | ||
url: '#select-fields-and-relations' | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
description: The calculation's details. | ||
required: | ||
- cart_id | ||
properties: | ||
cart_id: | ||
type: string | ||
title: cart_id | ||
description: The ID of the cart the shipping option is used in. | ||
data: | ||
type: object | ||
description: >- | ||
Custom data that's useful for the fulfillment provider to | ||
calculate the price. | ||
externalDocs: | ||
url: >- | ||
https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property | ||
x-codeSamples: | ||
- lang: Shell | ||
label: cURL | ||
source: | ||
$ref: ../code_samples/Shell/store_shipping-options_{id}_calculate/post.sh | ||
tags: | ||
- Shipping Options | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../components/schemas/StoreShippingOptionResponse.yaml | ||
'400': | ||
$ref: ../components/responses/400_error.yaml | ||
'401': | ||
$ref: ../components/responses/unauthorized.yaml | ||
'404': | ||
$ref: ../components/responses/not_found_error.yaml | ||
'409': | ||
$ref: ../components/responses/invalid_state_error.yaml | ||
'422': | ||
$ref: ../components/responses/invalid_request_error.yaml | ||
'500': | ||
$ref: ../components/responses/500_error.yaml | ||
x-workflow: calculateShippingOptionsPricesWorkflow |
80 changes: 80 additions & 0 deletions
80
...utils/generated/oas-output/operations/store/post_store_shipping-options_[id]_calculate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* @oas [post] /store/shipping-options/{id}/calculate | ||
* operationId: PostShippingOptionsIdCalculate | ||
* summary: Calculate Shipping Option Price | ||
* description: Calculate the price of a shipping option in a cart. | ||
* x-authenticated: false | ||
* parameters: | ||
* - name: id | ||
* in: path | ||
* description: The shipping option's ID. | ||
* required: true | ||
* schema: | ||
* type: string | ||
* - name: fields | ||
* in: query | ||
* description: |- | ||
* Comma-separated fields that should be included in the returned data. | ||
* if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. | ||
* without prefix it will replace the entire default fields. | ||
* required: false | ||
* schema: | ||
* type: string | ||
* title: fields | ||
* description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default | ||
* fields. Without prefix it will replace the entire default fields. | ||
* externalDocs: | ||
* url: "#select-fields-and-relations" | ||
* requestBody: | ||
* content: | ||
* application/json: | ||
* schema: | ||
* type: object | ||
* description: The calculation's details. | ||
* required: | ||
* - cart_id | ||
* properties: | ||
* cart_id: | ||
* type: string | ||
* title: cart_id | ||
* description: The ID of the cart the shipping option is used in. | ||
* data: | ||
* type: object | ||
* description: Custom data that's useful for the fulfillment provider to calculate the price. | ||
* externalDocs: | ||
* url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property | ||
* x-codeSamples: | ||
* - lang: Shell | ||
* label: cURL | ||
* source: |- | ||
* curl -X POST '{backend_url}/store/shipping-options/{id}/calculate' \ | ||
* -H 'x-publishable-api-key: {your_publishable_api_key}' \ | ||
* -H 'Content-Type: application/json' \ | ||
* --data-raw '{ | ||
* "cart_id": "{value}" | ||
* }' | ||
* tags: | ||
* - Shipping Options | ||
* responses: | ||
* "200": | ||
* description: OK | ||
* content: | ||
* application/json: | ||
* schema: | ||
* $ref: "#/components/schemas/StoreShippingOptionResponse" | ||
* "400": | ||
* $ref: "#/components/responses/400_error" | ||
* "401": | ||
* $ref: "#/components/responses/unauthorized" | ||
* "404": | ||
* $ref: "#/components/responses/not_found_error" | ||
* "409": | ||
* $ref: "#/components/responses/invalid_state_error" | ||
* "422": | ||
* $ref: "#/components/responses/invalid_request_error" | ||
* "500": | ||
* $ref: "#/components/responses/500_error" | ||
* x-workflow: calculateShippingOptionsPricesWorkflow | ||
* | ||
*/ | ||
|
13 changes: 13 additions & 0 deletions
13
www/utils/generated/oas-output/schemas/StoreShippingOptionResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @schema StoreShippingOptionResponse | ||
* type: object | ||
* description: The shipping option's details. | ||
* x-schemaName: StoreShippingOptionResponse | ||
* required: | ||
* - shipping_option | ||
* properties: | ||
* shipping_option: | ||
* $ref: "#/components/schemas/StoreCartShippingOption" | ||
* | ||
*/ | ||
|