diff --git a/packages/medusa/oas/admin.oas.base.yaml b/packages/medusa/oas/admin.oas.base.yaml index a1a45644bc..5020a9636f 100644 --- a/packages/medusa/oas/admin.oas.base.yaml +++ b/packages/medusa/oas/admin.oas.base.yaml @@ -233,6 +233,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: { } components: diff --git a/packages/medusa/oas/store.oas.base.yaml b/packages/medusa/oas/store.oas.base.yaml index ee0a848f5c..39a2a44b47 100644 --- a/packages/medusa/oas/store.oas.base.yaml +++ b/packages/medusa/oas/store.oas.base.yaml @@ -109,6 +109,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: { } components: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts index 73bb02b31d..6d8e3692fe 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts @@ -5,7 +5,7 @@ import { EntityManager } from "typeorm" import PublishableApiKeyService from "../../../../services/publishable-api-key" /** - * @oas [post] /admin/publishable-api-key/{id} + * @oas [post] /admin/publishable-api-keys/{id} * operationId: "PostPublishableApiKysPublishableApiKey" * summary: "Update Publishable API Key" * description: "Update a Publishable API Key's details." diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_publishable-api-key_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}/post.js similarity index 100% rename from www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_publishable-api-key_{id}/post.js rename to www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_publishable-api-keys_{id}/post.js diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_publishable-api-key_{id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_publishable-api-keys_{id}/post.sh similarity index 100% rename from www/apps/api-reference/specs/admin/code_samples/Shell/admin_publishable-api-key_{id}/post.sh rename to www/apps/api-reference/specs/admin/code_samples/Shell/admin_publishable-api-keys_{id}/post.sh diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index b90c192a51..b5faf7f6cc 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -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 diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index 0476dcc10c..bc9deb20d2 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -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}: diff --git a/www/apps/api-reference/specs/admin/paths/admin_publishable-api-key_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_publishable-api-key_{id}.yaml deleted file mode 100644 index f274a8bca7..0000000000 --- a/www/apps/api-reference/specs/admin/paths/admin_publishable-api-key_{id}.yaml +++ /dev/null @@ -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 diff --git a/www/apps/api-reference/specs/admin/paths/admin_publishable-api-keys_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_publishable-api-keys_{id}.yaml index 91e4c40b23..7259f2977e 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_publishable-api-keys_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_publishable-api-keys_{id}.yaml @@ -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 diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index d0c1366451..ea4a923270 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -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: diff --git a/www/apps/api-reference/specs/store/openapi.yaml b/www/apps/api-reference/specs/store/openapi.yaml index 314d6b84c6..4698b5580c 100644 --- a/www/apps/api-reference/specs/store/openapi.yaml +++ b/www/apps/api-reference/specs/store/openapi.yaml @@ -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: