From 3cee0bc8fc986cba2bca7697ad4d1ba429087b7f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 10:59:43 +0200 Subject: [PATCH] chore(docs): Generated API Reference (#2649) Co-authored-by: kodiakhq[bot] --- docs/api/admin-spec3.json | 3 +- docs/api/admin-spec3.yaml | 3 +- docs/api/admin/paths/product-types.yaml | 2 +- docs/api/admin/paths/products_types.yaml | 1 + docs/api/store-spec3.json | 154 ++++++++++++++++++ docs/api/store-spec3.yaml | 154 ++++++++++++++++++ .../JavaScript/product-types/getundefined | 7 + .../Shell/product-types/getundefined | 2 + docs/api/store/openapi.yaml | 2 + docs/api/store/paths/product-types.yaml | 139 ++++++++++++++++ 10 files changed, 464 insertions(+), 3 deletions(-) create mode 100644 docs/api/store/code_samples/JavaScript/product-types/getundefined create mode 100644 docs/api/store/code_samples/Shell/product-types/getundefined create mode 100644 docs/api/store/paths/product-types.yaml diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index f76a6777ec..776f7aef99 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -11766,7 +11766,7 @@ paths: description: The number of types to return. schema: type: integer - default: 10 + default: 20 - in: query name: offset description: The number of items to skip before the results. @@ -13792,6 +13792,7 @@ paths: $ref: '#/components/responses/500_error' /products/types: get: + deprecated: true operationId: GetProductsTypes summary: List Product Types description: Retrieves a list of Product Types. diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index f76a6777ec..776f7aef99 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -11766,7 +11766,7 @@ paths: description: The number of types to return. schema: type: integer - default: 10 + default: 20 - in: query name: offset description: The number of items to skip before the results. @@ -13792,6 +13792,7 @@ paths: $ref: '#/components/responses/500_error' /products/types: get: + deprecated: true operationId: GetProductsTypes summary: List Product Types description: Retrieves a list of Product Types. diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 00e7e2f1c4..8de545f6f4 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -9,7 +9,7 @@ get: description: The number of types to return. schema: type: integer - default: 10 + default: 20 - in: query name: offset description: The number of items to skip before the results. diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/products_types.yaml index f1cfcefb71..9aa1316d58 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/products_types.yaml @@ -1,4 +1,5 @@ get: + deprecated: true operationId: GetProductsTypes summary: List Product Types description: Retrieves a list of Product Types. diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 099ae6e9ff..7433eef331 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -2937,6 +2937,160 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + 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.store.productTypes.list() + + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/product-types' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product_types: + $ref: '#/components/schemas/product_type' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' '/products/{id}': get: operationId: GetProductsProduct diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 099ae6e9ff..7433eef331 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -2937,6 +2937,160 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + 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.store.productTypes.list() + + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/product-types' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product_types: + $ref: '#/components/schemas/product_type' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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' '/products/{id}': get: operationId: GetProductsProduct diff --git a/docs/api/store/code_samples/JavaScript/product-types/getundefined b/docs/api/store/code_samples/JavaScript/product-types/getundefined new file mode 100644 index 0000000000..355ccb321a --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/product-types/getundefined @@ -0,0 +1,7 @@ +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.store.productTypes.list() +.then(({ product_types }) => { + console.log(product_types.length); +}); diff --git a/docs/api/store/code_samples/Shell/product-types/getundefined b/docs/api/store/code_samples/Shell/product-types/getundefined new file mode 100644 index 0000000000..8b3ab56826 --- /dev/null +++ b/docs/api/store/code_samples/Shell/product-types/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/store/product-types' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 502e0635a4..399b57e9e8 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -207,6 +207,8 @@ paths: $ref: paths/orders_{id}.yaml /orders: $ref: paths/orders.yaml + /product-types: + $ref: paths/product-types.yaml /products/{id}: $ref: paths/products_{id}.yaml /products: diff --git a/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/product-types.yaml new file mode 100644 index 0000000000..8de545f6f4 --- /dev/null +++ b/docs/api/store/paths/product-types.yaml @@ -0,0 +1,139 @@ +get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/product-types/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/product-types/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product_types: + $ref: ../components/schemas/product_type.yaml + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '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