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:
@@ -233,6 +233,7 @@ tags:
|
|||||||
description: How to manage users
|
description: How to manage users
|
||||||
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
||||||
servers:
|
servers:
|
||||||
|
- url: http://localhost:9000
|
||||||
- url: https://api.medusa-commerce.com
|
- url: https://api.medusa-commerce.com
|
||||||
paths: { }
|
paths: { }
|
||||||
components:
|
components:
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ tags:
|
|||||||
description: How to create a swap in a storefront
|
description: How to create a swap in a storefront
|
||||||
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
|
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
|
||||||
servers:
|
servers:
|
||||||
|
- url: http://localhost:9000
|
||||||
- url: https://api.medusa-commerce.com
|
- url: https://api.medusa-commerce.com
|
||||||
paths: { }
|
paths: { }
|
||||||
components:
|
components:
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import { EntityManager } from "typeorm"
|
|||||||
import PublishableApiKeyService from "../../../../services/publishable-api-key"
|
import PublishableApiKeyService from "../../../../services/publishable-api-key"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @oas [post] /admin/publishable-api-key/{id}
|
* @oas [post] /admin/publishable-api-keys/{id}
|
||||||
* operationId: "PostPublishableApiKysPublishableApiKey"
|
* operationId: "PostPublishableApiKysPublishableApiKey"
|
||||||
* summary: "Update Publishable API Key"
|
* summary: "Update Publishable API Key"
|
||||||
* description: "Update a Publishable API Key's details."
|
* description: "Update a Publishable API Key's details."
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ tags:
|
|||||||
description: How to manage users
|
description: How to manage users
|
||||||
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
||||||
servers:
|
servers:
|
||||||
|
- url: http://localhost:9000
|
||||||
- url: https://api.medusa-commerce.com
|
- url: https://api.medusa-commerce.com
|
||||||
paths:
|
paths:
|
||||||
/admin/apps:
|
/admin/apps:
|
||||||
@@ -14157,79 +14158,6 @@ paths:
|
|||||||
$ref: '#/components/responses/invalid_request_error'
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
'500':
|
'500':
|
||||||
$ref: '#/components/responses/500_error'
|
$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:
|
/admin/publishable-api-keys:
|
||||||
get:
|
get:
|
||||||
operationId: GetPublishableApiKeys
|
operationId: GetPublishableApiKeys
|
||||||
@@ -14446,6 +14374,78 @@ paths:
|
|||||||
$ref: '#/components/responses/invalid_request_error'
|
$ref: '#/components/responses/invalid_request_error'
|
||||||
'500':
|
'500':
|
||||||
$ref: '#/components/responses/500_error'
|
$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:
|
delete:
|
||||||
operationId: DeletePublishableApiKeysPublishableApiKey
|
operationId: DeletePublishableApiKeysPublishableApiKey
|
||||||
summary: Delete Publishable API Key
|
summary: Delete Publishable API Key
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ tags:
|
|||||||
description: How to manage users
|
description: How to manage users
|
||||||
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
url: https://docs.medusajs.com/modules/users/admin/manage-users
|
||||||
servers:
|
servers:
|
||||||
|
- url: http://localhost:9000
|
||||||
- url: https://api.medusa-commerce.com
|
- url: https://api.medusa-commerce.com
|
||||||
paths:
|
paths:
|
||||||
/admin/apps:
|
/admin/apps:
|
||||||
@@ -563,8 +564,6 @@ paths:
|
|||||||
$ref: paths/admin_products_{id}_variants.yaml
|
$ref: paths/admin_products_{id}_variants.yaml
|
||||||
/admin/products/{id}/variants/{variant_id}:
|
/admin/products/{id}/variants/{variant_id}:
|
||||||
$ref: paths/admin_products_{id}_variants_{variant_id}.yaml
|
$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:
|
/admin/publishable-api-keys:
|
||||||
$ref: paths/admin_publishable-api-keys.yaml
|
$ref: paths/admin_publishable-api-keys.yaml
|
||||||
/admin/publishable-api-keys/{id}:
|
/admin/publishable-api-keys/{id}:
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -46,6 +46,60 @@ get:
|
|||||||
$ref: ../components/responses/invalid_request_error.yaml
|
$ref: ../components/responses/invalid_request_error.yaml
|
||||||
'500':
|
'500':
|
||||||
$ref: ../components/responses/500_error.yaml
|
$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:
|
delete:
|
||||||
operationId: DeletePublishableApiKeysPublishableApiKey
|
operationId: DeletePublishableApiKeysPublishableApiKey
|
||||||
summary: Delete Publishable API Key
|
summary: Delete Publishable API Key
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ tags:
|
|||||||
description: How to create a swap in a storefront
|
description: How to create a swap in a storefront
|
||||||
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
|
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
|
||||||
servers:
|
servers:
|
||||||
|
- url: http://localhost:9000
|
||||||
- url: https://api.medusa-commerce.com
|
- url: https://api.medusa-commerce.com
|
||||||
paths:
|
paths:
|
||||||
/store/auth:
|
/store/auth:
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ tags:
|
|||||||
description: How to create a swap in a storefront
|
description: How to create a swap in a storefront
|
||||||
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
|
url: https://docs.medusajs.com/modules/orders/storefront/create-swap
|
||||||
servers:
|
servers:
|
||||||
|
- url: http://localhost:9000
|
||||||
- url: https://api.medusa-commerce.com
|
- url: https://api.medusa-commerce.com
|
||||||
paths:
|
paths:
|
||||||
/store/auth:
|
/store/auth:
|
||||||
|
|||||||
Reference in New Issue
Block a user