From ec686e25abb39464d6a5ad5d90659c2d8810bb65 Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Fri, 25 Oct 2024 15:41:13 +0000 Subject: [PATCH 1/2] chore(docs): Generated API Reference (automated) --- .../post.sh | 2 + .../admin/components/schemas/BaseProduct.yaml | 128 +++---- .../schemas/BaseProductCategory.yaml | 4 +- .../components/schemas/OrderExchange.yaml | 15 +- .../admin/components/schemas/Return.yaml | 15 +- .../schemas/StoreUpdateCustomer.yaml | 3 + .../specs/admin/openapi.full.yaml | 348 +++++++++++++----- .../api-reference/specs/admin/openapi.yaml | 2 + .../admin_customers_{id}_customer-groups.yaml | 81 ++++ .../specs/admin/paths/admin_draft-orders.yaml | 30 +- ..._inventory-items_{id}_location-levels.yaml | 14 - .../specs/admin/paths/admin_orders.yaml | 30 +- .../specs/admin/paths/admin_returns.yaml | 30 +- .../components/schemas/BaseCollection.yaml | 2 +- .../store/components/schemas/BaseProduct.yaml | 128 +++---- .../schemas/BaseProductCategory.yaml | 6 +- .../components/schemas/OrderExchange.yaml | 15 +- .../store/components/schemas/Return.yaml | 17 +- .../schemas/StoreUpdateCustomer.yaml | 3 + .../specs/store/openapi.full.yaml | 165 +++++---- .../admin/get_admin_draft-orders.ts | 30 +- ...in_inventory-items_[id]_location-levels.ts | 14 - .../operations/admin/get_admin_orders.ts | 30 +- .../operations/admin/get_admin_returns.ts | 30 +- ...st_admin_customers_[id]_customer-groups.ts | 83 +++++ .../oas-output/schemas/BaseCollection.ts | 2 +- .../oas-output/schemas/BaseProduct.ts | 128 +++---- .../oas-output/schemas/BaseProductCategory.ts | 6 +- .../oas-output/schemas/OrderExchange.ts | 15 +- .../generated/oas-output/schemas/Return.ts | 15 +- .../oas-output/schemas/StoreUpdateCustomer.ts | 3 + 31 files changed, 943 insertions(+), 451 deletions(-) create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_customers_{id}_customer-groups/post.sh create mode 100644 www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_customers_{id}_customer-groups/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_customers_{id}_customer-groups/post.sh new file mode 100644 index 0000000000000..b9bef7b10e336 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_customers_{id}_customer-groups/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/customers/{id}/customer-groups' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml index 14c8bc48fa242..51b5946075787 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml @@ -29,42 +29,83 @@ required: - updated_at - deleted_at properties: + collection: + $ref: ./BaseCollection.yaml + categories: + type: array + description: The product's categories. + items: + $ref: ./BaseProductCategory.yaml + variants: + type: array + description: The product's variants. + items: + type: object + type: + $ref: ./BaseProductType.yaml + tags: + type: array + description: The product's tags. + items: + $ref: ./BaseProductTag.yaml + length: + type: number + title: length + description: The product's length. + title: + type: string + title: title + description: The product's title. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + options: + type: array + description: The product's options. + items: + $ref: ./BaseProductOption.yaml + description: + type: string + title: description + description: The product's description. id: type: string title: id description: The product's ID. - title: + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + created_at: type: string - title: title - description: The product's title. + format: date-time + title: created_at + description: The date the product was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the product was updated. handle: type: string title: handle - description: The product's handle. + description: The product's unique handle. subtitle: type: string title: subtitle description: The product's subtitle. - description: - type: string - title: description - description: The product's description. is_giftcard: type: boolean title: is_giftcard description: Whether the product is a gift card. - status: - type: string - description: The product's status. - enum: - - draft - - proposed - - published - - rejected thumbnail: type: string title: thumbnail - description: The product's thumbnail URL. + description: The product's thumbnail. width: type: number title: width @@ -73,10 +114,6 @@ properties: type: number title: weight description: The product's weight. - length: - type: number - title: length - description: The product's length. height: type: number title: height @@ -88,47 +125,23 @@ properties: hs_code: type: string title: hs_code - description: The product's hs code. + description: The product's HS code. mid_code: type: string title: mid_code - description: The product's mid code. + description: The product's MID code. material: type: string title: material description: The product's material. - collection: - $ref: ./BaseCollection.yaml collection_id: type: string title: collection_id - description: The ID of the collection the product belongs to. - categories: - type: array - description: The product's categories. - items: - $ref: ./BaseProductCategory.yaml - type: - $ref: ./BaseProductType.yaml + description: The ID of the collection that the product belongs to. type_id: type: string title: type_id - description: The ID of the type the product belongs to. - tags: - type: array - description: The product's tags. - items: - $ref: ./BaseProductTag.yaml - variants: - type: array - description: The product's variants. - items: - type: object - options: - type: array - description: The product's options. - items: - $ref: ./BaseProductOption.yaml + description: The ID of the product's type. images: type: array description: The product's images. @@ -137,26 +150,13 @@ properties: discountable: type: boolean title: discountable - description: Whether the product is discountable. + description: Whether discounts can be applied on the product. external_id: type: string title: external_id - description: The ID of the product in an external or third-party system. - created_at: - type: string - format: date-time - title: created_at - description: The date the product was created. - updated_at: - type: string - format: date-time - title: updated_at - description: The date the product was updated. + description: The ID of a product in an external system, such as an ERP or CMS. deleted_at: type: string format: date-time title: deleted_at description: The date the product was deleted. - metadata: - type: object - description: The product's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml index e8b62d10e8c3c..b7311e22133fc 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml @@ -20,9 +20,9 @@ properties: type: array description: The category's children. items: - type: object + $ref: ./AdminProductCategory.yaml parent_category: - type: object + $ref: ./AdminProductCategory.yaml products: type: array description: The category's products. diff --git a/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml b/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml index 857b9ed634090..f248767bb4db8 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml @@ -23,8 +23,19 @@ properties: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - type: number - title: difference_due + oneOf: + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. description: >- The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the diff --git a/www/apps/api-reference/specs/admin/components/schemas/Return.yaml b/www/apps/api-reference/specs/admin/components/schemas/Return.yaml index cfefdef18c517..2f8d70244f7db 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/Return.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/Return.yaml @@ -22,8 +22,19 @@ properties: - received - partially_received refund_amount: - type: number - title: refund_amount + oneOf: + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. description: The amount refunded by this return. order_id: type: string diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml index 0eaa5dda8bc1a..0384a1809c13d 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml @@ -18,3 +18,6 @@ properties: type: string title: phone description: The customer's phone. + metadata: + type: object + description: The customer's metadata. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index ed25422bf8563..db86bc18ef629 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -11424,6 +11424,85 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: deleteCustomerAddressesWorkflow + /admin/customers/{id}/customer-groups: + post: + operationId: PostCustomersIdCustomerGroups + summary: Add Customer Group to Customer + description: Add a Customer Group to a customer + x-authenticated: true + parameters: + - name: id + in: path + description: The customer's ID. + required: true + schema: + type: string + - name: fields + in: query + 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. + required: false + schema: + 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + type: object + description: SUMMARY + properties: + add: + type: array + description: The customer's add. + items: + type: string + title: add + description: The add's details. + remove: + type: array + description: The customer's remove. + items: + type: string + title: remove + description: The remove's details. + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/customers/{id}/customer-groups' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerResponse' + '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' + x-workflow: linkCustomerGroupsToCustomerWorkflow /admin/draft-orders: get: operationId: GetDraftOrders @@ -12393,12 +12472,16 @@ paths: description: Filter by region IDs to retrieve their associated draft orders. required: false schema: - type: array - description: Filter by region IDs to retrieve their associated draft orders. - items: - type: string - title: region_id - description: A region's ID. + oneOf: + - type: string + title: region_id + description: The draft order's region id. + - type: array + description: The draft order's region id. + items: + type: string + title: region_id + description: The region id's details. - name: q in: query description: Search term to filter the order's searchable properties. @@ -12869,6 +12952,20 @@ paths: type: boolean title: $exists description: Filter by whether a value for this parameter exists (not `null`). + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The draft order's customer id. + - type: array + description: The draft order's customer id. + items: + type: string + title: customer_id + description: The customer id's details. security: - api_token: [] - cookie_auth: [] @@ -16853,20 +16950,6 @@ paths: 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 `-`. - - name: location_id - in: query - required: false - schema: - oneOf: - - type: string - title: location_id - description: Filter by an associated location's ID. - - type: array - description: Filter by associated location IDs. - items: - type: string - title: location_id - description: An associated location ID. - name: $and in: query required: false @@ -19031,12 +19114,16 @@ paths: description: Filter by region IDs to retrieve their associated orders. required: false schema: - type: array - description: Filter by region IDs to retrieve their associated orders. - items: - type: string - title: region_id - description: A region ID. + oneOf: + - type: string + title: region_id + description: The order's region id. + - type: array + description: The order's region id. + items: + type: string + title: region_id + description: The region id's details. - name: q in: query description: Search term to filter the order's searchable properties. @@ -19507,6 +19594,20 @@ paths: type: boolean title: $exists description: Filter by whether a value for this parameter exists (not `null`). + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The order's customer id. + - type: array + description: The order's customer id. + items: + type: string + title: customer_id + description: The customer id's details. security: - api_token: [] - cookie_auth: [] @@ -33451,12 +33552,16 @@ paths: description: Filter by region IDs to retrieve their associated returns. required: false schema: - type: array - description: Filter by region IDs to retrieve their associated returns. - items: - type: string - title: region_id - description: The region id's details. + oneOf: + - type: string + title: region_id + description: The return's region id. + - type: array + description: The return's region id. + items: + type: string + title: region_id + description: The region id's details. - name: q in: query description: Search term to filter the return's searchable properties. @@ -33927,6 +34032,20 @@ paths: type: boolean title: $exists description: Filter by whether a value for this parameter exists (not `null`). + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The return's customer id. + - type: array + description: The return's customer id. + items: + type: string + title: customer_id + description: The customer id's details. security: - api_token: [] - cookie_auth: [] @@ -56608,42 +56727,83 @@ components: - updated_at - deleted_at properties: + collection: + $ref: '#/components/schemas/BaseCollection' + categories: + type: array + description: The product's categories. + items: + $ref: '#/components/schemas/BaseProductCategory' + variants: + type: array + description: The product's variants. + items: + type: object + type: + $ref: '#/components/schemas/BaseProductType' + tags: + type: array + description: The product's tags. + items: + $ref: '#/components/schemas/BaseProductTag' + length: + type: number + title: length + description: The product's length. + title: + type: string + title: title + description: The product's title. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + options: + type: array + description: The product's options. + items: + $ref: '#/components/schemas/BaseProductOption' + description: + type: string + title: description + description: The product's description. id: type: string title: id description: The product's ID. - title: + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + created_at: type: string - title: title - description: The product's title. + format: date-time + title: created_at + description: The date the product was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the product was updated. handle: type: string title: handle - description: The product's handle. + description: The product's unique handle. subtitle: type: string title: subtitle description: The product's subtitle. - description: - type: string - title: description - description: The product's description. is_giftcard: type: boolean title: is_giftcard description: Whether the product is a gift card. - status: - type: string - description: The product's status. - enum: - - draft - - proposed - - published - - rejected thumbnail: type: string title: thumbnail - description: The product's thumbnail URL. + description: The product's thumbnail. width: type: number title: width @@ -56652,10 +56812,6 @@ components: type: number title: weight description: The product's weight. - length: - type: number - title: length - description: The product's length. height: type: number title: height @@ -56667,47 +56823,23 @@ components: hs_code: type: string title: hs_code - description: The product's hs code. + description: The product's HS code. mid_code: type: string title: mid_code - description: The product's mid code. + description: The product's MID code. material: type: string title: material description: The product's material. - collection: - $ref: '#/components/schemas/BaseCollection' collection_id: type: string title: collection_id - description: The ID of the collection the product belongs to. - categories: - type: array - description: The product's categories. - items: - $ref: '#/components/schemas/BaseProductCategory' - type: - $ref: '#/components/schemas/BaseProductType' + description: The ID of the collection that the product belongs to. type_id: type: string title: type_id - description: The ID of the type the product belongs to. - tags: - type: array - description: The product's tags. - items: - $ref: '#/components/schemas/BaseProductTag' - variants: - type: array - description: The product's variants. - items: - type: object - options: - type: array - description: The product's options. - items: - $ref: '#/components/schemas/BaseProductOption' + description: The ID of the product's type. images: type: array description: The product's images. @@ -56716,29 +56848,16 @@ components: discountable: type: boolean title: discountable - description: Whether the product is discountable. + description: Whether discounts can be applied on the product. external_id: type: string title: external_id - description: The ID of the product in an external or third-party system. - created_at: - type: string - format: date-time - title: created_at - description: The date the product was created. - updated_at: - type: string - format: date-time - title: updated_at - description: The date the product was updated. + description: The ID of a product in an external system, such as an ERP or CMS. deleted_at: type: string format: date-time title: deleted_at description: The date the product was deleted. - metadata: - type: object - description: The product's metadata, can hold custom key-value pairs. BaseProductCategory: type: object description: The product category's details. @@ -56762,9 +56881,9 @@ components: type: array description: The category's children. items: - type: object + $ref: '#/components/schemas/AdminProductCategory' parent_category: - type: object + $ref: '#/components/schemas/AdminProductCategory' products: type: array description: The category's products. @@ -58673,8 +58792,19 @@ components: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - type: number - title: difference_due + oneOf: + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer. return: $ref: '#/components/schemas/Return' @@ -59553,8 +59683,19 @@ components: - received - partially_received refund_amount: - type: number - title: refund_amount + oneOf: + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. description: The amount refunded by this return. order_id: type: string @@ -68394,6 +68535,9 @@ components: type: string title: phone description: The customer's phone. + metadata: + type: object + description: The customer's metadata. UpdateAddress: type: object description: The details to update in the address. diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index a9f8c93ee4bbe..9aa4f767af531 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -693,6 +693,8 @@ paths: $ref: paths/admin_customers_{id}_addresses.yaml /admin/customers/{id}/addresses/{address_id}: $ref: paths/admin_customers_{id}_addresses_{address_id}.yaml + /admin/customers/{id}/customer-groups: + $ref: paths/admin_customers_{id}_customer-groups.yaml /admin/draft-orders: $ref: paths/admin_draft-orders.yaml /admin/draft-orders/{id}: diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml new file mode 100644 index 0000000000000..29ebfd3fba279 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml @@ -0,0 +1,81 @@ +post: + operationId: PostCustomersIdCustomerGroups + summary: Add Customer Group to Customer + description: Add a Customer Group to a customer + x-authenticated: true + parameters: + - name: id + in: path + description: The customer's ID. + required: true + schema: + type: string + - name: fields + in: query + 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. + required: false + schema: + 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' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + type: object + description: SUMMARY + properties: + add: + type: array + description: The customer's add. + items: + type: string + title: add + description: The add's details. + remove: + type: array + description: The customer's remove. + items: + type: string + title: remove + description: The remove's details. + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_customers_{id}_customer-groups/post.sh + tags: + - Customers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminCustomerResponse.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 + x-workflow: linkCustomerGroupsToCustomerWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml index 36603570fbcb3..eb5835a85ca54 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml @@ -1217,12 +1217,16 @@ get: description: Filter by region IDs to retrieve their associated draft orders. required: false schema: - type: array - description: Filter by region IDs to retrieve their associated draft orders. - items: - type: string - title: region_id - description: A region's ID. + oneOf: + - type: string + title: region_id + description: The draft order's region id. + - type: array + description: The draft order's region id. + items: + type: string + title: region_id + description: The region id's details. - name: q in: query description: Search term to filter the order's searchable properties. @@ -1769,6 +1773,20 @@ get: type: boolean title: $exists description: Filter by whether a value for this parameter exists (not `null`). + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The draft order's customer id. + - type: array + description: The draft order's customer id. + items: + type: string + title: customer_id + description: The customer id's details. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml index 93ae3939bc806..c35d324e01c0f 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_inventory-items_{id}_location-levels.yaml @@ -64,20 +64,6 @@ get: 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 `-`. - - name: location_id - in: query - required: false - schema: - oneOf: - - type: string - title: location_id - description: Filter by an associated location's ID. - - type: array - description: Filter by associated location IDs. - items: - type: string - title: location_id - description: An associated location ID. - name: $and in: query required: false diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders.yaml index 356f783919ab6..69d8fa22e63ca 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders.yaml @@ -171,12 +171,16 @@ get: description: Filter by region IDs to retrieve their associated orders. required: false schema: - type: array - description: Filter by region IDs to retrieve their associated orders. - items: - type: string - title: region_id - description: A region ID. + oneOf: + - type: string + title: region_id + description: The order's region id. + - type: array + description: The order's region id. + items: + type: string + title: region_id + description: The region id's details. - name: q in: query description: Search term to filter the order's searchable properties. @@ -723,6 +727,20 @@ get: type: boolean title: $exists description: Filter by whether a value for this parameter exists (not `null`). + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The order's customer id. + - type: array + description: The order's customer id. + items: + type: string + title: customer_id + description: The customer id's details. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns.yaml index 3e0130d91130e..51b3f4ad94b3a 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns.yaml @@ -169,12 +169,16 @@ get: description: Filter by region IDs to retrieve their associated returns. required: false schema: - type: array - description: Filter by region IDs to retrieve their associated returns. - items: - type: string - title: region_id - description: The region id's details. + oneOf: + - type: string + title: region_id + description: The return's region id. + - type: array + description: The return's region id. + items: + type: string + title: region_id + description: The region id's details. - name: q in: query description: Search term to filter the return's searchable properties. @@ -721,6 +725,20 @@ get: type: boolean title: $exists description: Filter by whether a value for this parameter exists (not `null`). + - name: customer_id + in: query + required: false + schema: + oneOf: + - type: string + title: customer_id + description: The return's customer id. + - type: array + description: The return's customer id. + items: + type: string + title: customer_id + description: The customer id's details. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml index 58ab3baab3f94..3aedaefa436b9 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml @@ -41,7 +41,7 @@ properties: type: array description: The collection's products. items: - type: object + $ref: ./BaseProduct.yaml metadata: type: object description: The collection's metadata, used to store custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml index 14c8bc48fa242..51b5946075787 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml @@ -29,42 +29,83 @@ required: - updated_at - deleted_at properties: + collection: + $ref: ./BaseCollection.yaml + categories: + type: array + description: The product's categories. + items: + $ref: ./BaseProductCategory.yaml + variants: + type: array + description: The product's variants. + items: + type: object + type: + $ref: ./BaseProductType.yaml + tags: + type: array + description: The product's tags. + items: + $ref: ./BaseProductTag.yaml + length: + type: number + title: length + description: The product's length. + title: + type: string + title: title + description: The product's title. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + options: + type: array + description: The product's options. + items: + $ref: ./BaseProductOption.yaml + description: + type: string + title: description + description: The product's description. id: type: string title: id description: The product's ID. - title: + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + created_at: type: string - title: title - description: The product's title. + format: date-time + title: created_at + description: The date the product was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the product was updated. handle: type: string title: handle - description: The product's handle. + description: The product's unique handle. subtitle: type: string title: subtitle description: The product's subtitle. - description: - type: string - title: description - description: The product's description. is_giftcard: type: boolean title: is_giftcard description: Whether the product is a gift card. - status: - type: string - description: The product's status. - enum: - - draft - - proposed - - published - - rejected thumbnail: type: string title: thumbnail - description: The product's thumbnail URL. + description: The product's thumbnail. width: type: number title: width @@ -73,10 +114,6 @@ properties: type: number title: weight description: The product's weight. - length: - type: number - title: length - description: The product's length. height: type: number title: height @@ -88,47 +125,23 @@ properties: hs_code: type: string title: hs_code - description: The product's hs code. + description: The product's HS code. mid_code: type: string title: mid_code - description: The product's mid code. + description: The product's MID code. material: type: string title: material description: The product's material. - collection: - $ref: ./BaseCollection.yaml collection_id: type: string title: collection_id - description: The ID of the collection the product belongs to. - categories: - type: array - description: The product's categories. - items: - $ref: ./BaseProductCategory.yaml - type: - $ref: ./BaseProductType.yaml + description: The ID of the collection that the product belongs to. type_id: type: string title: type_id - description: The ID of the type the product belongs to. - tags: - type: array - description: The product's tags. - items: - $ref: ./BaseProductTag.yaml - variants: - type: array - description: The product's variants. - items: - type: object - options: - type: array - description: The product's options. - items: - $ref: ./BaseProductOption.yaml + description: The ID of the product's type. images: type: array description: The product's images. @@ -137,26 +150,13 @@ properties: discountable: type: boolean title: discountable - description: Whether the product is discountable. + description: Whether discounts can be applied on the product. external_id: type: string title: external_id - description: The ID of the product in an external or third-party system. - created_at: - type: string - format: date-time - title: created_at - description: The date the product was created. - updated_at: - type: string - format: date-time - title: updated_at - description: The date the product was updated. + description: The ID of a product in an external system, such as an ERP or CMS. deleted_at: type: string format: date-time title: deleted_at description: The date the product was deleted. - metadata: - type: object - description: The product's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml index e8b62d10e8c3c..5fcced7319784 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml @@ -20,14 +20,14 @@ properties: type: array description: The category's children. items: - type: object + $ref: ./AdminProductCategory.yaml parent_category: - type: object + $ref: ./AdminProductCategory.yaml products: type: array description: The category's products. items: - type: object + $ref: ./AdminProduct.yaml name: type: string title: name diff --git a/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml b/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml index 857b9ed634090..f248767bb4db8 100644 --- a/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml @@ -23,8 +23,19 @@ properties: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - type: number - title: difference_due + oneOf: + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. description: >- The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the diff --git a/www/apps/api-reference/specs/store/components/schemas/Return.yaml b/www/apps/api-reference/specs/store/components/schemas/Return.yaml index cfefdef18c517..07c01f09432fb 100644 --- a/www/apps/api-reference/specs/store/components/schemas/Return.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/Return.yaml @@ -22,8 +22,19 @@ properties: - received - partially_received refund_amount: - type: number - title: refund_amount + oneOf: + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. description: The amount refunded by this return. order_id: type: string @@ -83,7 +94,7 @@ properties: title: exchange_id description: The ID of the exchange this return belongs to, if any. exchange: - type: object + $ref: ./OrderExchange.yaml claim_id: type: string title: claim_id diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml index 0eaa5dda8bc1a..0384a1809c13d 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml @@ -18,3 +18,6 @@ properties: type: string title: phone description: The customer's phone. + metadata: + type: object + description: The customer's metadata. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 01eae7863b211..9afba2688a2e4 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -18757,42 +18757,83 @@ components: - updated_at - deleted_at properties: + collection: + $ref: '#/components/schemas/BaseCollection' + categories: + type: array + description: The product's categories. + items: + $ref: '#/components/schemas/BaseProductCategory' + variants: + type: array + description: The product's variants. + items: + type: object + type: + $ref: '#/components/schemas/BaseProductType' + tags: + type: array + description: The product's tags. + items: + $ref: '#/components/schemas/BaseProductTag' + length: + type: number + title: length + description: The product's length. + title: + type: string + title: title + description: The product's title. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + options: + type: array + description: The product's options. + items: + $ref: '#/components/schemas/BaseProductOption' + description: + type: string + title: description + description: The product's description. id: type: string title: id description: The product's ID. - title: + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + created_at: type: string - title: title - description: The product's title. + format: date-time + title: created_at + description: The date the product was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the product was updated. handle: type: string title: handle - description: The product's handle. + description: The product's unique handle. subtitle: type: string title: subtitle description: The product's subtitle. - description: - type: string - title: description - description: The product's description. is_giftcard: type: boolean title: is_giftcard description: Whether the product is a gift card. - status: - type: string - description: The product's status. - enum: - - draft - - proposed - - published - - rejected thumbnail: type: string title: thumbnail - description: The product's thumbnail URL. + description: The product's thumbnail. width: type: number title: width @@ -18801,10 +18842,6 @@ components: type: number title: weight description: The product's weight. - length: - type: number - title: length - description: The product's length. height: type: number title: height @@ -18816,47 +18853,23 @@ components: hs_code: type: string title: hs_code - description: The product's hs code. + description: The product's HS code. mid_code: type: string title: mid_code - description: The product's mid code. + description: The product's MID code. material: type: string title: material description: The product's material. - collection: - $ref: '#/components/schemas/BaseCollection' collection_id: type: string title: collection_id - description: The ID of the collection the product belongs to. - categories: - type: array - description: The product's categories. - items: - $ref: '#/components/schemas/BaseProductCategory' - type: - $ref: '#/components/schemas/BaseProductType' + description: The ID of the collection that the product belongs to. type_id: type: string title: type_id - description: The ID of the type the product belongs to. - tags: - type: array - description: The product's tags. - items: - $ref: '#/components/schemas/BaseProductTag' - variants: - type: array - description: The product's variants. - items: - type: object - options: - type: array - description: The product's options. - items: - $ref: '#/components/schemas/BaseProductOption' + description: The ID of the product's type. images: type: array description: The product's images. @@ -18865,29 +18878,16 @@ components: discountable: type: boolean title: discountable - description: Whether the product is discountable. + description: Whether discounts can be applied on the product. external_id: type: string title: external_id - description: The ID of the product in an external or third-party system. - created_at: - type: string - format: date-time - title: created_at - description: The date the product was created. - updated_at: - type: string - format: date-time - title: updated_at - description: The date the product was updated. + description: The ID of a product in an external system, such as an ERP or CMS. deleted_at: type: string format: date-time title: deleted_at description: The date the product was deleted. - metadata: - type: object - description: The product's metadata, can hold custom key-value pairs. BaseProductCategory: type: object description: The product category's details. @@ -18911,9 +18911,9 @@ components: type: array description: The category's children. items: - type: object + $ref: '#/components/schemas/AdminProductCategory' parent_category: - type: object + $ref: '#/components/schemas/AdminProductCategory' products: type: array description: The category's products. @@ -20822,8 +20822,19 @@ components: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - type: number - title: difference_due + oneOf: + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. + - type: string + title: difference_due + description: The exchange's difference due. + - type: number + title: difference_due + description: The exchange's difference due. description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer. return: $ref: '#/components/schemas/Return' @@ -21702,8 +21713,19 @@ components: - received - partially_received refund_amount: - type: number - title: refund_amount + oneOf: + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. + - type: string + title: refund_amount + description: The return order's refund amount. + - type: number + title: refund_amount + description: The return order's refund amount. description: The amount refunded by this return. order_id: type: string @@ -30543,6 +30565,9 @@ components: type: string title: phone description: The customer's phone. + metadata: + type: object + description: The customer's metadata. UpdateAddress: type: object description: The details to update in the address. diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts index 2b7bb7fb53789..0d33d01b743db 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts @@ -969,12 +969,16 @@ * description: Filter by region IDs to retrieve their associated draft orders. * required: false * schema: - * type: array - * description: Filter by region IDs to retrieve their associated draft orders. - * items: - * type: string - * title: region_id - * description: A region's ID. + * oneOf: + * - type: string + * title: region_id + * description: The draft order's region id. + * - type: array + * description: The draft order's region id. + * items: + * type: string + * title: region_id + * description: The region id's details. * - name: q * in: query * description: Search term to filter the order's searchable properties. @@ -1445,6 +1449,20 @@ * type: boolean * title: $exists * description: Filter by whether a value for this parameter exists (not `null`). + * - name: customer_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: The draft order's customer id. + * - type: array + * description: The draft order's customer id. + * items: + * type: string + * title: customer_id + * description: The customer id's details. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts index 3f1b899ef4883..a64c55ebb6681 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_inventory-items_[id]_location-levels.ts @@ -51,20 +51,6 @@ * 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 `-`. - * - name: location_id - * in: query - * required: false - * schema: - * oneOf: - * - type: string - * title: location_id - * description: Filter by an associated location's ID. - * - type: array - * description: Filter by associated location IDs. - * items: - * type: string - * title: location_id - * description: An associated location ID. * - name: $and * in: query * required: false diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts index 2b908e741b902..87135964eb6f7 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts @@ -149,12 +149,16 @@ * description: Filter by region IDs to retrieve their associated orders. * required: false * schema: - * type: array - * description: Filter by region IDs to retrieve their associated orders. - * items: - * type: string - * title: region_id - * description: A region ID. + * oneOf: + * - type: string + * title: region_id + * description: The order's region id. + * - type: array + * description: The order's region id. + * items: + * type: string + * title: region_id + * description: The region id's details. * - name: q * in: query * description: Search term to filter the order's searchable properties. @@ -625,6 +629,20 @@ * type: boolean * title: $exists * description: Filter by whether a value for this parameter exists (not `null`). + * - name: customer_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: The order's customer id. + * - type: array + * description: The order's customer id. + * items: + * type: string + * title: customer_id + * description: The customer id's details. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts b/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts index 31ccf3d84d9d5..d86942519b710 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts @@ -149,12 +149,16 @@ * description: Filter by region IDs to retrieve their associated returns. * required: false * schema: - * type: array - * description: Filter by region IDs to retrieve their associated returns. - * items: - * type: string - * title: region_id - * description: The region id's details. + * oneOf: + * - type: string + * title: region_id + * description: The return's region id. + * - type: array + * description: The return's region id. + * items: + * type: string + * title: region_id + * description: The region id's details. * - name: q * in: query * description: Search term to filter the return's searchable properties. @@ -625,6 +629,20 @@ * type: boolean * title: $exists * description: Filter by whether a value for this parameter exists (not `null`). + * - name: customer_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: customer_id + * description: The return's customer id. + * - type: array + * description: The return's customer id. + * items: + * type: string + * title: customer_id + * description: The customer id's details. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts new file mode 100644 index 0000000000000..73c8a3290c7a4 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts @@ -0,0 +1,83 @@ +/** + * @oas [post] /admin/customers/{id}/customer-groups + * operationId: PostCustomersIdCustomerGroups + * summary: Add Customer Group to Customer + * description: Add a Customer Group to a customer + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The customer's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * 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. + * required: false + * schema: + * 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" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * type: object + * description: SUMMARY + * properties: + * add: + * type: array + * description: The customer's add. + * items: + * type: string + * title: add + * description: The add's details. + * remove: + * type: array + * description: The customer's remove. + * items: + * type: string + * title: remove + * description: The remove's details. + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/customers/{id}/customer-groups' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Customers + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminCustomerResponse" + * "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" + * x-workflow: linkCustomerGroupsToCustomerWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/BaseCollection.ts b/www/utils/generated/oas-output/schemas/BaseCollection.ts index f111322b18374..e70937934c3d7 100644 --- a/www/utils/generated/oas-output/schemas/BaseCollection.ts +++ b/www/utils/generated/oas-output/schemas/BaseCollection.ts @@ -43,7 +43,7 @@ * type: array * description: The collection's products. * items: - * $ref: "#/components/schemas/AdminProduct" + * $ref: "#/components/schemas/BaseProduct" * metadata: * type: object * description: The collection's metadata, used to store custom key-value pairs. diff --git a/www/utils/generated/oas-output/schemas/BaseProduct.ts b/www/utils/generated/oas-output/schemas/BaseProduct.ts index 6a610a4f3f707..9ecef6332e6b9 100644 --- a/www/utils/generated/oas-output/schemas/BaseProduct.ts +++ b/www/utils/generated/oas-output/schemas/BaseProduct.ts @@ -31,42 +31,83 @@ * - updated_at * - deleted_at * properties: + * collection: + * $ref: "#/components/schemas/BaseCollection" + * categories: + * type: array + * description: The product's categories. + * items: + * $ref: "#/components/schemas/BaseProductCategory" + * variants: + * type: array + * description: The product's variants. + * items: + * $ref: "#/components/schemas/BaseProductVariant" + * type: + * $ref: "#/components/schemas/BaseProductType" + * tags: + * type: array + * description: The product's tags. + * items: + * $ref: "#/components/schemas/BaseProductTag" + * length: + * type: number + * title: length + * description: The product's length. + * title: + * type: string + * title: title + * description: The product's title. + * status: + * type: string + * description: The product's status. + * enum: + * - draft + * - proposed + * - published + * - rejected + * options: + * type: array + * description: The product's options. + * items: + * $ref: "#/components/schemas/BaseProductOption" + * description: + * type: string + * title: description + * description: The product's description. * id: * type: string * title: id * description: The product's ID. - * title: + * metadata: + * type: object + * description: The product's metadata, can hold custom key-value pairs. + * created_at: * type: string - * title: title - * description: The product's title. + * format: date-time + * title: created_at + * description: The date the product was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the product was updated. * handle: * type: string * title: handle - * description: The product's handle. + * description: The product's unique handle. * subtitle: * type: string * title: subtitle * description: The product's subtitle. - * description: - * type: string - * title: description - * description: The product's description. * is_giftcard: * type: boolean * title: is_giftcard * description: Whether the product is a gift card. - * status: - * type: string - * description: The product's status. - * enum: - * - draft - * - proposed - * - published - * - rejected * thumbnail: * type: string * title: thumbnail - * description: The product's thumbnail URL. + * description: The product's thumbnail. * width: * type: number * title: width @@ -75,10 +116,6 @@ * type: number * title: weight * description: The product's weight. - * length: - * type: number - * title: length - * description: The product's length. * height: * type: number * title: height @@ -90,47 +127,23 @@ * hs_code: * type: string * title: hs_code - * description: The product's hs code. + * description: The product's HS code. * mid_code: * type: string * title: mid_code - * description: The product's mid code. + * description: The product's MID code. * material: * type: string * title: material * description: The product's material. - * collection: - * $ref: "#/components/schemas/BaseCollection" * collection_id: * type: string * title: collection_id - * description: The ID of the collection the product belongs to. - * categories: - * type: array - * description: The product's categories. - * items: - * $ref: "#/components/schemas/BaseProductCategory" - * type: - * $ref: "#/components/schemas/BaseProductType" + * description: The ID of the collection that the product belongs to. * type_id: * type: string * title: type_id - * description: The ID of the type the product belongs to. - * tags: - * type: array - * description: The product's tags. - * items: - * $ref: "#/components/schemas/BaseProductTag" - * variants: - * type: array - * description: The product's variants. - * items: - * $ref: "#/components/schemas/BaseProductVariant" - * options: - * type: array - * description: The product's options. - * items: - * $ref: "#/components/schemas/BaseProductOption" + * description: The ID of the product's type. * images: * type: array * description: The product's images. @@ -139,29 +152,16 @@ * discountable: * type: boolean * title: discountable - * description: Whether the product is discountable. + * description: Whether discounts can be applied on the product. * external_id: * type: string * title: external_id - * description: The ID of the product in an external or third-party system. - * created_at: - * type: string - * format: date-time - * title: created_at - * description: The date the product was created. - * updated_at: - * type: string - * format: date-time - * title: updated_at - * description: The date the product was updated. + * description: The ID of a product in an external system, such as an ERP or CMS. * deleted_at: * type: string * format: date-time * title: deleted_at * description: The date the product was deleted. - * metadata: - * type: object - * description: The product's metadata, can hold custom key-value pairs. * */ diff --git a/www/utils/generated/oas-output/schemas/BaseProductCategory.ts b/www/utils/generated/oas-output/schemas/BaseProductCategory.ts index 221ce6fdce257..170ffe7e54714 100644 --- a/www/utils/generated/oas-output/schemas/BaseProductCategory.ts +++ b/www/utils/generated/oas-output/schemas/BaseProductCategory.ts @@ -22,14 +22,14 @@ * type: array * description: The category's children. * items: - * $ref: "#/components/schemas/BaseProductCategory" + * $ref: "#/components/schemas/AdminProductCategory" * parent_category: - * $ref: "#/components/schemas/BaseProductCategory" + * $ref: "#/components/schemas/AdminProductCategory" * products: * type: array * description: The category's products. * items: - * $ref: "#/components/schemas/BaseProduct" + * $ref: "#/components/schemas/AdminProduct" * name: * type: string * title: name diff --git a/www/utils/generated/oas-output/schemas/OrderExchange.ts b/www/utils/generated/oas-output/schemas/OrderExchange.ts index a1b7f92eb6d9f..c254d2e817634 100644 --- a/www/utils/generated/oas-output/schemas/OrderExchange.ts +++ b/www/utils/generated/oas-output/schemas/OrderExchange.ts @@ -25,8 +25,19 @@ * title: no_notification * description: Whether to send the customer notifications when the exchange is updated. * difference_due: - * type: number - * title: difference_due + * oneOf: + * - type: string + * title: difference_due + * description: The exchange's difference due. + * - type: number + * title: difference_due + * description: The exchange's difference due. + * - type: string + * title: difference_due + * description: The exchange's difference due. + * - type: number + * title: difference_due + * description: The exchange's difference due. * description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer. * return: * $ref: "#/components/schemas/Return" diff --git a/www/utils/generated/oas-output/schemas/Return.ts b/www/utils/generated/oas-output/schemas/Return.ts index b4d003ec8de7b..12bfa984105a3 100644 --- a/www/utils/generated/oas-output/schemas/Return.ts +++ b/www/utils/generated/oas-output/schemas/Return.ts @@ -24,8 +24,19 @@ * - received * - partially_received * refund_amount: - * type: number - * title: refund_amount + * oneOf: + * - type: string + * title: refund_amount + * description: The return order's refund amount. + * - type: number + * title: refund_amount + * description: The return order's refund amount. + * - type: string + * title: refund_amount + * description: The return order's refund amount. + * - type: number + * title: refund_amount + * description: The return order's refund amount. * description: The amount refunded by this return. * order_id: * type: string diff --git a/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts b/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts index 710a85ffcd88f..0a288a8f765ba 100644 --- a/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts +++ b/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts @@ -20,6 +20,9 @@ * type: string * title: phone * description: The customer's phone. + * metadata: + * type: object + * description: The customer's metadata. * */ From 5e8ce11a6be1596813fa90efdd27f2a0f6f0f0b6 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 28 Oct 2024 06:21:16 +0200 Subject: [PATCH 2/2] fixes --- .../admin/components/schemas/BaseProduct.yaml | 2 +- .../schemas/BaseProductCategory.yaml | 4 +- .../components/schemas/OrderExchange.yaml | 15 +-- .../admin/components/schemas/Return.yaml | 15 +-- .../schemas/StoreUpdateCustomer.yaml | 2 +- .../specs/admin/openapi.full.yaml | 93 +++++++------------ .../admin_customers_{id}_customer-groups.yaml | 26 ++++-- .../specs/admin/paths/admin_draft-orders.yaml | 12 +-- .../specs/admin/paths/admin_orders.yaml | 12 +-- .../specs/admin/paths/admin_returns.yaml | 12 +-- .../components/schemas/BaseCollection.yaml | 2 +- .../store/components/schemas/BaseProduct.yaml | 2 +- .../schemas/BaseProductCategory.yaml | 6 +- .../components/schemas/OrderExchange.yaml | 15 +-- .../store/components/schemas/Return.yaml | 17 +--- .../schemas/StoreUpdateCustomer.yaml | 2 +- .../specs/store/openapi.full.yaml | 38 ++------ .../admin/get_admin_draft-orders.ts | 12 +-- .../operations/admin/get_admin_orders.ts | 12 +-- .../operations/admin/get_admin_returns.ts | 12 +-- ...st_admin_customers_[id]_customer-groups.ts | 19 ++-- .../oas-output/schemas/BaseProduct.ts | 2 +- .../oas-output/schemas/BaseProductCategory.ts | 6 +- .../oas-output/schemas/OrderExchange.ts | 15 +-- .../generated/oas-output/schemas/Return.ts | 15 +-- .../oas-output/schemas/StoreUpdateCustomer.ts | 2 +- 26 files changed, 134 insertions(+), 236 deletions(-) diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml index 51b5946075787..c3796a9a2522a 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseProduct.yaml @@ -105,7 +105,7 @@ properties: thumbnail: type: string title: thumbnail - description: The product's thumbnail. + description: The product's thumbnail URL. width: type: number title: width diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml index b7311e22133fc..e8b62d10e8c3c 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseProductCategory.yaml @@ -20,9 +20,9 @@ properties: type: array description: The category's children. items: - $ref: ./AdminProductCategory.yaml + type: object parent_category: - $ref: ./AdminProductCategory.yaml + type: object products: type: array description: The category's products. diff --git a/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml b/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml index f248767bb4db8..857b9ed634090 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/OrderExchange.yaml @@ -23,19 +23,8 @@ properties: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - oneOf: - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. + type: number + title: difference_due description: >- The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the diff --git a/www/apps/api-reference/specs/admin/components/schemas/Return.yaml b/www/apps/api-reference/specs/admin/components/schemas/Return.yaml index 2f8d70244f7db..cfefdef18c517 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/Return.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/Return.yaml @@ -22,19 +22,8 @@ properties: - received - partially_received refund_amount: - oneOf: - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. + type: number + title: refund_amount description: The amount refunded by this return. order_id: type: string diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml index 0384a1809c13d..700e28826a85e 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreUpdateCustomer.yaml @@ -20,4 +20,4 @@ properties: description: The customer's phone. metadata: type: object - description: The customer's metadata. + description: The customer's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index db86bc18ef629..956cfa996a64a 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -11427,8 +11427,9 @@ paths: /admin/customers/{id}/customer-groups: post: operationId: PostCustomersIdCustomerGroups - summary: Add Customer Group to Customer - description: Add a Customer Group to a customer + summary: Manage Customer Groups of Customer + x-sidebar-summary: Manage Customer Groups + description: Manage the customer groups of a customer to add or remove the customer from these groups. x-authenticated: true parameters: - name: id @@ -11441,8 +11442,8 @@ paths: in: query 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. + 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. required: false schema: type: string @@ -11459,22 +11460,22 @@ paths: application/json: schema: type: object - description: SUMMARY + description: The customer groups to add or remove the customer from. properties: add: type: array - description: The customer's add. + description: The customer groups to add the customer to. items: type: string title: add - description: The add's details. + description: The ID of a customer group to add the customer to. remove: type: array - description: The customer's remove. + description: The customer groups to remove the customer from. items: type: string title: remove - description: The remove's details. + description: The ID of a customer group to remove the customer from. x-codeSamples: - lang: Shell label: cURL @@ -12475,13 +12476,13 @@ paths: oneOf: - type: string title: region_id - description: The draft order's region id. + description: Filter by a region ID to retrieve its associated draft orders. - type: array - description: The draft order's region id. + description: Filter by region IDs to retrieve their associated draft orders. items: type: string title: region_id - description: The region id's details. + description: A region ID. - name: q in: query description: Search term to filter the order's searchable properties. @@ -12959,13 +12960,13 @@ paths: oneOf: - type: string title: customer_id - description: The draft order's customer id. + description: Filter by a customer ID to retrieve their draft orders. - type: array - description: The draft order's customer id. + description: Filter by customer IDs to retrieve their draft orders. items: type: string title: customer_id - description: The customer id's details. + description: A customer ID. security: - api_token: [] - cookie_auth: [] @@ -19117,13 +19118,13 @@ paths: oneOf: - type: string title: region_id - description: The order's region id. + description: Filter by a region ID to retrieve its associated orders. - type: array - description: The order's region id. + description: Filter by region IDs to retrieve their associated orders. items: type: string title: region_id - description: The region id's details. + description: A region's ID. - name: q in: query description: Search term to filter the order's searchable properties. @@ -19601,13 +19602,13 @@ paths: oneOf: - type: string title: customer_id - description: The order's customer id. + description: Filter by a customer ID to retrieve its associated orders. - type: array - description: The order's customer id. + description: Filter by customer IDs to retrieve their associated orders. items: type: string title: customer_id - description: The customer id's details. + description: A customer's ID. security: - api_token: [] - cookie_auth: [] @@ -33555,13 +33556,13 @@ paths: oneOf: - type: string title: region_id - description: The return's region id. + description: Filter by a region ID to retrieve its associated returns. - type: array - description: The return's region id. + description: Filter by region IDs to retrieve their associated returns. items: type: string title: region_id - description: The region id's details. + description: A region's ID. - name: q in: query description: Search term to filter the return's searchable properties. @@ -34039,13 +34040,13 @@ paths: oneOf: - type: string title: customer_id - description: The return's customer id. + description: Filter by a customer ID to retrieve its associated returns. - type: array - description: The return's customer id. + description: Filter by customer IDs to retrieve their associated returns. items: type: string title: customer_id - description: The customer id's details. + description: A customer's ID. security: - api_token: [] - cookie_auth: [] @@ -56803,7 +56804,7 @@ components: thumbnail: type: string title: thumbnail - description: The product's thumbnail. + description: The product's thumbnail URL. width: type: number title: width @@ -56881,9 +56882,9 @@ components: type: array description: The category's children. items: - $ref: '#/components/schemas/AdminProductCategory' + type: object parent_category: - $ref: '#/components/schemas/AdminProductCategory' + type: object products: type: array description: The category's products. @@ -58792,19 +58793,8 @@ components: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - oneOf: - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. + type: number + title: difference_due description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer. return: $ref: '#/components/schemas/Return' @@ -59683,19 +59673,8 @@ components: - received - partially_received refund_amount: - oneOf: - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. + type: number + title: refund_amount description: The amount refunded by this return. order_id: type: string @@ -68537,7 +68516,7 @@ components: description: The customer's phone. metadata: type: object - description: The customer's metadata. + description: The customer's metadata, can hold custom key-value pairs. UpdateAddress: type: object description: The details to update in the address. diff --git a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml index 29ebfd3fba279..0cb2224910b6d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_customers_{id}_customer-groups.yaml @@ -1,7 +1,10 @@ post: operationId: PostCustomersIdCustomerGroups - summary: Add Customer Group to Customer - description: Add a Customer Group to a customer + summary: Manage Customer Groups of Customer + x-sidebar-summary: Manage Customer Groups + description: >- + Manage the customer groups of a customer to add or remove the customer from + these groups. x-authenticated: true parameters: - name: id @@ -12,10 +15,13 @@ post: type: string - name: fields in: query - description: |- + 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. + + 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. required: false schema: type: string @@ -36,22 +42,22 @@ post: application/json: schema: type: object - description: SUMMARY + description: The customer groups to add or remove the customer from. properties: add: type: array - description: The customer's add. + description: The customer groups to add the customer to. items: type: string title: add - description: The add's details. + description: The ID of a customer group to add the customer to. remove: type: array - description: The customer's remove. + description: The customer groups to remove the customer from. items: type: string title: remove - description: The remove's details. + description: The ID of a customer group to remove the customer from. x-codeSamples: - lang: Shell label: cURL diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml index eb5835a85ca54..4386df78abd98 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml @@ -1220,13 +1220,13 @@ get: oneOf: - type: string title: region_id - description: The draft order's region id. + description: Filter by a region ID to retrieve its associated draft orders. - type: array - description: The draft order's region id. + description: Filter by region IDs to retrieve their associated draft orders. items: type: string title: region_id - description: The region id's details. + description: A region ID. - name: q in: query description: Search term to filter the order's searchable properties. @@ -1780,13 +1780,13 @@ get: oneOf: - type: string title: customer_id - description: The draft order's customer id. + description: Filter by a customer ID to retrieve their draft orders. - type: array - description: The draft order's customer id. + description: Filter by customer IDs to retrieve their draft orders. items: type: string title: customer_id - description: The customer id's details. + description: A customer ID. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders.yaml index 69d8fa22e63ca..a46cd63f17416 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders.yaml @@ -174,13 +174,13 @@ get: oneOf: - type: string title: region_id - description: The order's region id. + description: Filter by a region ID to retrieve its associated orders. - type: array - description: The order's region id. + description: Filter by region IDs to retrieve their associated orders. items: type: string title: region_id - description: The region id's details. + description: A region's ID. - name: q in: query description: Search term to filter the order's searchable properties. @@ -734,13 +734,13 @@ get: oneOf: - type: string title: customer_id - description: The order's customer id. + description: Filter by a customer ID to retrieve its associated orders. - type: array - description: The order's customer id. + description: Filter by customer IDs to retrieve their associated orders. items: type: string title: customer_id - description: The customer id's details. + description: A customer's ID. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_returns.yaml b/www/apps/api-reference/specs/admin/paths/admin_returns.yaml index 51b3f4ad94b3a..c5cdc7a8d0720 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_returns.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_returns.yaml @@ -172,13 +172,13 @@ get: oneOf: - type: string title: region_id - description: The return's region id. + description: Filter by a region ID to retrieve its associated returns. - type: array - description: The return's region id. + description: Filter by region IDs to retrieve their associated returns. items: type: string title: region_id - description: The region id's details. + description: A region's ID. - name: q in: query description: Search term to filter the return's searchable properties. @@ -732,13 +732,13 @@ get: oneOf: - type: string title: customer_id - description: The return's customer id. + description: Filter by a customer ID to retrieve its associated returns. - type: array - description: The return's customer id. + description: Filter by customer IDs to retrieve their associated returns. items: type: string title: customer_id - description: The customer id's details. + description: A customer's ID. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml index 3aedaefa436b9..58ab3baab3f94 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml @@ -41,7 +41,7 @@ properties: type: array description: The collection's products. items: - $ref: ./BaseProduct.yaml + type: object metadata: type: object description: The collection's metadata, used to store custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml index 51b5946075787..c3796a9a2522a 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseProduct.yaml @@ -105,7 +105,7 @@ properties: thumbnail: type: string title: thumbnail - description: The product's thumbnail. + description: The product's thumbnail URL. width: type: number title: width diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml index 5fcced7319784..e8b62d10e8c3c 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml @@ -20,14 +20,14 @@ properties: type: array description: The category's children. items: - $ref: ./AdminProductCategory.yaml + type: object parent_category: - $ref: ./AdminProductCategory.yaml + type: object products: type: array description: The category's products. items: - $ref: ./AdminProduct.yaml + type: object name: type: string title: name diff --git a/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml b/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml index f248767bb4db8..857b9ed634090 100644 --- a/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/OrderExchange.yaml @@ -23,19 +23,8 @@ properties: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - oneOf: - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. + type: number + title: difference_due description: >- The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the diff --git a/www/apps/api-reference/specs/store/components/schemas/Return.yaml b/www/apps/api-reference/specs/store/components/schemas/Return.yaml index 07c01f09432fb..cfefdef18c517 100644 --- a/www/apps/api-reference/specs/store/components/schemas/Return.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/Return.yaml @@ -22,19 +22,8 @@ properties: - received - partially_received refund_amount: - oneOf: - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. + type: number + title: refund_amount description: The amount refunded by this return. order_id: type: string @@ -94,7 +83,7 @@ properties: title: exchange_id description: The ID of the exchange this return belongs to, if any. exchange: - $ref: ./OrderExchange.yaml + type: object claim_id: type: string title: claim_id diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml index 0384a1809c13d..700e28826a85e 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreUpdateCustomer.yaml @@ -20,4 +20,4 @@ properties: description: The customer's phone. metadata: type: object - description: The customer's metadata. + description: The customer's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 9afba2688a2e4..622607a47d9c3 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -18833,7 +18833,7 @@ components: thumbnail: type: string title: thumbnail - description: The product's thumbnail. + description: The product's thumbnail URL. width: type: number title: width @@ -18911,9 +18911,9 @@ components: type: array description: The category's children. items: - $ref: '#/components/schemas/AdminProductCategory' + type: object parent_category: - $ref: '#/components/schemas/AdminProductCategory' + type: object products: type: array description: The category's products. @@ -20822,19 +20822,8 @@ components: title: no_notification description: Whether to send the customer notifications when the exchange is updated. difference_due: - oneOf: - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. - - type: string - title: difference_due - description: The exchange's difference due. - - type: number - title: difference_due - description: The exchange's difference due. + type: number + title: difference_due description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer. return: $ref: '#/components/schemas/Return' @@ -21713,19 +21702,8 @@ components: - received - partially_received refund_amount: - oneOf: - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. - - type: string - title: refund_amount - description: The return order's refund amount. - - type: number - title: refund_amount - description: The return order's refund amount. + type: number + title: refund_amount description: The amount refunded by this return. order_id: type: string @@ -30567,7 +30545,7 @@ components: description: The customer's phone. metadata: type: object - description: The customer's metadata. + description: The customer's metadata, can hold custom key-value pairs. UpdateAddress: type: object description: The details to update in the address. diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts index 0d33d01b743db..ce6bb5f3bba1e 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_draft-orders.ts @@ -972,13 +972,13 @@ * oneOf: * - type: string * title: region_id - * description: The draft order's region id. + * description: Filter by a region ID to retrieve its associated draft orders. * - type: array - * description: The draft order's region id. + * description: Filter by region IDs to retrieve their associated draft orders. * items: * type: string * title: region_id - * description: The region id's details. + * description: A region ID. * - name: q * in: query * description: Search term to filter the order's searchable properties. @@ -1456,13 +1456,13 @@ * oneOf: * - type: string * title: customer_id - * description: The draft order's customer id. + * description: Filter by a customer ID to retrieve their draft orders. * - type: array - * description: The draft order's customer id. + * description: Filter by customer IDs to retrieve their draft orders. * items: * type: string * title: customer_id - * description: The customer id's details. + * description: A customer ID. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts index 87135964eb6f7..1ff39692bf9c4 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders.ts @@ -152,13 +152,13 @@ * oneOf: * - type: string * title: region_id - * description: The order's region id. + * description: Filter by a region ID to retrieve its associated orders. * - type: array - * description: The order's region id. + * description: Filter by region IDs to retrieve their associated orders. * items: * type: string * title: region_id - * description: The region id's details. + * description: A region's ID. * - name: q * in: query * description: Search term to filter the order's searchable properties. @@ -636,13 +636,13 @@ * oneOf: * - type: string * title: customer_id - * description: The order's customer id. + * description: Filter by a customer ID to retrieve its associated orders. * - type: array - * description: The order's customer id. + * description: Filter by customer IDs to retrieve their associated orders. * items: * type: string * title: customer_id - * description: The customer id's details. + * description: A customer's ID. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts b/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts index d86942519b710..3874aaf93d802 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_returns.ts @@ -152,13 +152,13 @@ * oneOf: * - type: string * title: region_id - * description: The return's region id. + * description: Filter by a region ID to retrieve its associated returns. * - type: array - * description: The return's region id. + * description: Filter by region IDs to retrieve their associated returns. * items: * type: string * title: region_id - * description: The region id's details. + * description: A region's ID. * - name: q * in: query * description: Search term to filter the return's searchable properties. @@ -636,13 +636,13 @@ * oneOf: * - type: string * title: customer_id - * description: The return's customer id. + * description: Filter by a customer ID to retrieve its associated returns. * - type: array - * description: The return's customer id. + * description: Filter by customer IDs to retrieve their associated returns. * items: * type: string * title: customer_id - * description: The customer id's details. + * description: A customer's ID. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts index 73c8a3290c7a4..ae914baa45c09 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_customers_[id]_customer-groups.ts @@ -1,8 +1,9 @@ /** * @oas [post] /admin/customers/{id}/customer-groups * operationId: PostCustomersIdCustomerGroups - * summary: Add Customer Group to Customer - * description: Add a Customer Group to a customer + * summary: Manage Customer Groups of Customer + * x-sidebar-summary: Manage Customer Groups + * description: Manage the customer groups of a customer to add or remove the customer from these groups. * x-authenticated: true * parameters: * - name: id @@ -15,8 +16,8 @@ * in: query * 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. + * 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. * required: false * schema: * type: string @@ -34,22 +35,22 @@ * application/json: * schema: * type: object - * description: SUMMARY + * description: The customer groups to add or remove the customer from. * properties: * add: * type: array - * description: The customer's add. + * description: The customer groups to add the customer to. * items: * type: string * title: add - * description: The add's details. + * description: The ID of a customer group to add the customer to. * remove: * type: array - * description: The customer's remove. + * description: The customer groups to remove the customer from. * items: * type: string * title: remove - * description: The remove's details. + * description: The ID of a customer group to remove the customer from. * x-codeSamples: * - lang: Shell * label: cURL diff --git a/www/utils/generated/oas-output/schemas/BaseProduct.ts b/www/utils/generated/oas-output/schemas/BaseProduct.ts index 9ecef6332e6b9..6af8341a086af 100644 --- a/www/utils/generated/oas-output/schemas/BaseProduct.ts +++ b/www/utils/generated/oas-output/schemas/BaseProduct.ts @@ -107,7 +107,7 @@ * thumbnail: * type: string * title: thumbnail - * description: The product's thumbnail. + * description: The product's thumbnail URL. * width: * type: number * title: width diff --git a/www/utils/generated/oas-output/schemas/BaseProductCategory.ts b/www/utils/generated/oas-output/schemas/BaseProductCategory.ts index 170ffe7e54714..221ce6fdce257 100644 --- a/www/utils/generated/oas-output/schemas/BaseProductCategory.ts +++ b/www/utils/generated/oas-output/schemas/BaseProductCategory.ts @@ -22,14 +22,14 @@ * type: array * description: The category's children. * items: - * $ref: "#/components/schemas/AdminProductCategory" + * $ref: "#/components/schemas/BaseProductCategory" * parent_category: - * $ref: "#/components/schemas/AdminProductCategory" + * $ref: "#/components/schemas/BaseProductCategory" * products: * type: array * description: The category's products. * items: - * $ref: "#/components/schemas/AdminProduct" + * $ref: "#/components/schemas/BaseProduct" * name: * type: string * title: name diff --git a/www/utils/generated/oas-output/schemas/OrderExchange.ts b/www/utils/generated/oas-output/schemas/OrderExchange.ts index c254d2e817634..a1b7f92eb6d9f 100644 --- a/www/utils/generated/oas-output/schemas/OrderExchange.ts +++ b/www/utils/generated/oas-output/schemas/OrderExchange.ts @@ -25,19 +25,8 @@ * title: no_notification * description: Whether to send the customer notifications when the exchange is updated. * difference_due: - * oneOf: - * - type: string - * title: difference_due - * description: The exchange's difference due. - * - type: number - * title: difference_due - * description: The exchange's difference due. - * - type: string - * title: difference_due - * description: The exchange's difference due. - * - type: number - * title: difference_due - * description: The exchange's difference due. + * type: number + * title: difference_due * description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer. * return: * $ref: "#/components/schemas/Return" diff --git a/www/utils/generated/oas-output/schemas/Return.ts b/www/utils/generated/oas-output/schemas/Return.ts index 12bfa984105a3..b4d003ec8de7b 100644 --- a/www/utils/generated/oas-output/schemas/Return.ts +++ b/www/utils/generated/oas-output/schemas/Return.ts @@ -24,19 +24,8 @@ * - received * - partially_received * refund_amount: - * oneOf: - * - type: string - * title: refund_amount - * description: The return order's refund amount. - * - type: number - * title: refund_amount - * description: The return order's refund amount. - * - type: string - * title: refund_amount - * description: The return order's refund amount. - * - type: number - * title: refund_amount - * description: The return order's refund amount. + * type: number + * title: refund_amount * description: The amount refunded by this return. * order_id: * type: string diff --git a/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts b/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts index 0a288a8f765ba..90f0b31d5d913 100644 --- a/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts +++ b/www/utils/generated/oas-output/schemas/StoreUpdateCustomer.ts @@ -22,7 +22,7 @@ * description: The customer's phone. * metadata: * type: object - * description: The customer's metadata. + * description: The customer's metadata, can hold custom key-value pairs. * */