docs(api-reference): added local server to list of servers (#5572)

* docs(api-reference): added local server to list of servers

* fix publishable api key route
This commit is contained in:
Shahed Nasser
2023-11-06 17:30:56 +02:00
committed by GitHub
parent d7e1887221
commit 2576a0fd23
11 changed files with 133 additions and 130 deletions

View File

@@ -345,6 +345,7 @@ tags:
description: How to manage users
url: https://docs.medusajs.com/modules/users/admin/manage-users
servers:
- url: http://localhost:9000
- url: https://api.medusa-commerce.com
paths:
/admin/apps:
@@ -14157,79 +14158,6 @@ paths:
$ref: '#/components/responses/invalid_request_error'
'500':
$ref: '#/components/responses/500_error'
/admin/publishable-api-key/{id}:
post:
operationId: PostPublishableApiKysPublishableApiKey
summary: Update Publishable API Key
description: Update a Publishable API Key's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Publishable API Key.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
#/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source: >
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.publishableApiKeys.update(publishableApiKeyId, {
title: "new title"
})
.then(({ publishable_api_key }) => {
console.log(publishable_api_key.id)
})
- lang: Shell
label: cURL
source: |
curl -X POST '{backend_url}/admin/publishable-api-key/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"title": "new title"
}'
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Publishable Api Keys
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AdminPublishableApiKeysRes'
'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'
/admin/publishable-api-keys:
get:
operationId: GetPublishableApiKeys
@@ -14446,6 +14374,78 @@ paths:
$ref: '#/components/responses/invalid_request_error'
'500':
$ref: '#/components/responses/500_error'
post:
operationId: PostPublishableApiKysPublishableApiKey
summary: Update Publishable API Key
description: Update a Publishable API Key's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Publishable API Key.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
#/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source: >
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.publishableApiKeys.update(publishableApiKeyId, {
title: "new title"
})
.then(({ publishable_api_key }) => {
console.log(publishable_api_key.id)
})
- lang: Shell
label: cURL
source: |
curl -X POST '{backend_url}/admin/publishable-api-key/{id}' \
-H 'x-medusa-access-token: {api_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"title": "new title"
}'
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Publishable Api Keys
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AdminPublishableApiKeysRes'
'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'
delete:
operationId: DeletePublishableApiKeysPublishableApiKey
summary: Delete Publishable API Key

View File

@@ -345,6 +345,7 @@ tags:
description: How to manage users
url: https://docs.medusajs.com/modules/users/admin/manage-users
servers:
- url: http://localhost:9000
- url: https://api.medusa-commerce.com
paths:
/admin/apps:
@@ -563,8 +564,6 @@ paths:
$ref: paths/admin_products_{id}_variants.yaml
/admin/products/{id}/variants/{variant_id}:
$ref: paths/admin_products_{id}_variants_{variant_id}.yaml
/admin/publishable-api-key/{id}:
$ref: paths/admin_publishable-api-key_{id}.yaml
/admin/publishable-api-keys:
$ref: paths/admin_publishable-api-keys.yaml
/admin/publishable-api-keys/{id}:

View File

@@ -1,54 +0,0 @@
post:
operationId: PostPublishableApiKysPublishableApiKey
summary: Update Publishable API Key
description: Update a Publishable API Key's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Publishable API Key.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_publishable-api-key_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_publishable-api-key_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Publishable Api Keys
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPublishableApiKeysRes.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

View File

@@ -46,6 +46,60 @@ get:
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostPublishableApiKysPublishableApiKey
summary: Update Publishable API Key
description: Update a Publishable API Key's details.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Publishable API Key.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml
x-codegen:
method: update
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_publishable-api-keys_{id}/post.js
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_publishable-api-keys_{id}/post.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Publishable Api Keys
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminPublishableApiKeysRes.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
delete:
operationId: DeletePublishableApiKeysPublishableApiKey
summary: Delete Publishable API Key

View File

@@ -150,6 +150,7 @@ tags:
description: How to create a swap in a storefront
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
servers:
- url: http://localhost:9000
- url: https://api.medusa-commerce.com
paths:
/store/auth:

View File

@@ -150,6 +150,7 @@ tags:
description: How to create a swap in a storefront
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
servers:
- url: http://localhost:9000
- url: https://api.medusa-commerce.com
paths:
/store/auth: