From 5fb9c1f82eb0fc71f8eccd8fcf8919fb9d5a4585 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 2 Oct 2024 18:21:40 +0300 Subject: [PATCH] chore(oas): general fixes to OAS (#9413) General fixes to OAS --- .../post_auth_[actor_type]_[auth_provider].ts | 6 +-- ...h_[actor_type]_[auth_provider]_callback.ts | 2 +- .../post_auth_[actor_type]_[auth_provider].ts | 6 +-- ...h_[actor_type]_[auth_provider]_callback.ts | 2 +- .../store/post_store_carts_[id]_complete.ts | 6 ++- .../post_store_carts_[id]_shipping-methods.ts | 2 +- .../schemas/AuthCallbackResponse.ts | 2 +- .../oas-output/schemas/BaseRegion.ts | 2 +- .../src/classes/helpers/schema-factory.ts | 40 +++++++++++++++++++ 9 files changed, 51 insertions(+), 17 deletions(-) diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts index 26b88c19ba..60321fb376 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider].ts @@ -37,14 +37,10 @@ * "email": "admin@medusa-test.com", * "password": "supersecret" * }' - * - lang: Shell + * - lang: Bash * label: Google Provider * source: |- * curl -X POST '{backend_url}/auth/user/google' - * - lang: Shell - * label: GitHub Provider - * source: |- - * curl -X POST '{backend_url}/auth/user/github' * tags: * - Auth * responses: diff --git a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts index 7ddf9ecb3d..62c384eb79 100644 --- a/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts +++ b/www/utils/generated/oas-output/operations/admin/post_auth_[actor_type]_[auth_provider]_callback.ts @@ -27,7 +27,7 @@ * - lang: Shell * label: Google Provider * source: curl -X POST '{backend_url}/auth/user/google/callback?code=123' - * - lang: Shell + * - lang: Bash * label: GitHub Provider * source: curl -X POST '{backend_url}/auth/user/github/callback?code=123' * tags: diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts index af4159ef25..76ffab1cb8 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider].ts @@ -37,14 +37,10 @@ * "email": "customer@gmail.com", * "password": "supersecret" * }' - * - lang: Shell + * - lang: Bash * label: Google Provider * source: |- * curl -X POST '{backend_url}/auth/customer/google' - * - lang: Shell - * label: GitHub Provider - * source: |- - * curl -X POST '{backend_url}/auth/customer/github' * tags: * - Auth * responses: diff --git a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts index eceb646de1..de779aa624 100644 --- a/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts +++ b/www/utils/generated/oas-output/operations/store/post_auth_[actor_type]_[auth_provider]_callback.ts @@ -27,7 +27,7 @@ * - lang: Shell * label: Google Provider * source: curl -X POST '{backend_url}/auth/customer/google/callback?code=123' - * - lang: Shell + * - lang: Bash * label: GitHub Provider * source: curl -X POST '{backend_url}/auth/customer/github/callback?code=123' * tags: diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts index 56c3332214..7eb34f9cf0 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_complete.ts @@ -32,6 +32,8 @@ * 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" * x-codeSamples: * - lang: Shell * label: cURL @@ -56,7 +58,7 @@ * type: * type: string * title: type - * description: The type of the returned object. + * description: The type of the returned object. In this case, the order is returned because the cart was completed successfully. * default: order * order: * $ref: "#/components/schemas/StoreOrder" @@ -70,7 +72,7 @@ * type: * type: string * title: type - * description: The type of the returned object. + * description: The type of the returned object. In this case, the cart is returned because an error has occurred. * default: cart * cart: * $ref: "#/components/schemas/StoreCart" diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts index 9529cf451f..7460ed069f 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_shipping-methods.ts @@ -51,7 +51,7 @@ * description: Any additional data relevant for the third-party fulfillment provider to process the shipment. * externalDocs: * url: https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping#data-request-body-parameter - * description: Learn more about the `data` parameter. + * description: Learn more about the data parameter. * x-codeSamples: * - lang: Shell * label: cURL diff --git a/www/utils/generated/oas-output/schemas/AuthCallbackResponse.ts b/www/utils/generated/oas-output/schemas/AuthCallbackResponse.ts index 7fc135dcea..3af5df4089 100644 --- a/www/utils/generated/oas-output/schemas/AuthCallbackResponse.ts +++ b/www/utils/generated/oas-output/schemas/AuthCallbackResponse.ts @@ -6,7 +6,7 @@ * required: * - location * properties: - * token: + * location: * type: string * title: location * description: The location to redirect the user to for further authentication with the third-party provider. diff --git a/www/utils/generated/oas-output/schemas/BaseRegion.ts b/www/utils/generated/oas-output/schemas/BaseRegion.ts index de59008442..5434b339e9 100644 --- a/www/utils/generated/oas-output/schemas/BaseRegion.ts +++ b/www/utils/generated/oas-output/schemas/BaseRegion.ts @@ -1,7 +1,7 @@ /** * @schema BaseRegion * type: object - * description: The parent's region. + * description: The region's details. * x-schemaName: BaseRegion * required: * - id diff --git a/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts b/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts index 64a6ca548b..c5bcc3aee3 100644 --- a/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts +++ b/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts @@ -37,6 +37,46 @@ class SchemaFactory { BigNumberValue: { type: "number", }, + expand: { + type: "string", + title: "expand", + description: + "Comma-separated relations that should be expanded in the returned data.", + }, + fields: { + 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", + }, + }, + offset: { + type: "number", + title: "offset", + description: "The number of items to skip when retrieving a list.", + externalDocs: { + url: "#pagination", + }, + }, + limit: { + type: "number", + title: "limit", + description: "Limit the number of items returned in the list.", + externalDocs: { + url: "#pagination", + }, + }, + order: { + type: "string", + title: "order", + description: + "The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.", + externalDocs: { + url: "#pagination", + }, + }, File: { type: "object", description: "A File to upload.",