chore(oas): replace response with $ref to res class JSDoc OAS (A-C) (#3002)
This commit is contained in:
@@ -37,10 +37,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* apps:
|
||||
* $ref: "#/components/schemas/OAuth"
|
||||
* $ref: "#/components/schemas/AdminAppsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -16,10 +16,26 @@ export default (app) => {
|
||||
return app
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminAppsRes
|
||||
* type: object
|
||||
* properties:
|
||||
* apps:
|
||||
* $ref: "#/components/schemas/OAuth"
|
||||
*/
|
||||
export type AdminAppsRes = {
|
||||
apps: Oauth
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminAppsListRes
|
||||
* type: object
|
||||
* properties:
|
||||
* apps:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/OAuth"
|
||||
*/
|
||||
export type AdminAppsListRes = {
|
||||
apps: Oauth[]
|
||||
}
|
||||
|
||||
@@ -23,12 +23,7 @@ import { OauthService } from "../../../../services"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* apps:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/OAuth"
|
||||
* $ref: "#/components/schemas/AdminAppsListRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -50,10 +50,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* user:
|
||||
* $ref: "#/components/schemas/User"
|
||||
* $ref: "#/components/schemas/AdminAuthRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -34,10 +34,7 @@ import _ from "lodash"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* user:
|
||||
* $ref: "#/components/schemas/User"
|
||||
* $ref: "#/components/schemas/AdminAuthRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -23,6 +23,13 @@ export default (app) => {
|
||||
return app
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminAuthRes
|
||||
* type: object
|
||||
* properties:
|
||||
* user:
|
||||
* $ref: "#/components/schemas/User"
|
||||
*/
|
||||
export type AdminAuthRes = {
|
||||
user: Omit<User, "password_hash">
|
||||
}
|
||||
|
||||
@@ -36,10 +36,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_job:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
* $ref: "#/components/schemas/AdminBatchJobRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -36,10 +36,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_job:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
* $ref: "#/components/schemas/AdminBatchJobRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -51,10 +51,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_job:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
* $ref: "#/components/schemas/AdminBatchJobRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -33,10 +33,7 @@
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_job:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
* $ref: "#/components/schemas/AdminBatchJobRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -42,12 +42,35 @@ export default (app) => {
|
||||
return app
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminBatchJobRes
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_job:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
*/
|
||||
export type AdminBatchJobRes = {
|
||||
batch_job: BatchJob
|
||||
}
|
||||
|
||||
export type AdminBatchJobDeleteRes = DeleteResponse
|
||||
|
||||
/**
|
||||
* @schema AdminBatchJobListRes
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_jobs:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
*/
|
||||
export type AdminBatchJobListRes = PaginatedResponse & {
|
||||
batch_jobs: BatchJob[]
|
||||
}
|
||||
|
||||
@@ -237,21 +237,7 @@ import { isDefined } from "medusa-core-utils"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* batch_jobs:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/BatchJob"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
* $ref: "#/components/schemas/AdminBatchJobListRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -40,10 +40,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* collection:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
* $ref: "#/components/schemas/AdminCollectionsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -47,10 +47,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* collection:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
* $ref: "#/components/schemas/AdminCollectionsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -38,19 +38,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* description: The ID of the deleted Collection
|
||||
* object:
|
||||
* type: string
|
||||
* description: The type of the object that was deleted.
|
||||
* default: product-collection
|
||||
* deleted:
|
||||
* type: boolean
|
||||
* description: Whether the collection was deleted successfully or not.
|
||||
* default: true
|
||||
* $ref: "#/components/schemas/AdminCollectionsDeleteRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -38,10 +38,7 @@ import { defaultAdminCollectionsRelations } from "."
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* collection:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
* $ref: "#/components/schemas/AdminCollectionsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -69,12 +69,77 @@ export const defaultAdminCollectionsFields = [
|
||||
]
|
||||
export const defaultAdminCollectionsRelations = ["products"]
|
||||
|
||||
/**
|
||||
* @schema AdminCollectionsListRes
|
||||
* type: object
|
||||
* properties:
|
||||
* collections:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
*/
|
||||
export type AdminCollectionsListRes = PaginatedResponse & {
|
||||
collections: ProductCollection[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminCollectionsDeleteRes
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* description: The ID of the deleted Collection
|
||||
* object:
|
||||
* type: string
|
||||
* description: The type of the object that was deleted.
|
||||
* default: product-collection
|
||||
* deleted:
|
||||
* type: boolean
|
||||
* description: Whether the collection was deleted successfully or not.
|
||||
* default: true
|
||||
*/
|
||||
export type AdminCollectionsDeleteRes = DeleteResponse
|
||||
|
||||
/**
|
||||
* @schema AdminDeleteProductsFromCollectionRes
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* description: "The ID of the collection"
|
||||
* object:
|
||||
* type: string
|
||||
* description: "The type of object the removal was executed on"
|
||||
* default: product-collection
|
||||
* removed_products:
|
||||
* description: "The IDs of the products removed from the collection"
|
||||
* type: array
|
||||
* items:
|
||||
* description: "The ID of a Product to add to the Product Collection."
|
||||
* type: string
|
||||
*/
|
||||
export type AdminDeleteProductsFromCollectionRes = {
|
||||
id: string
|
||||
object: string
|
||||
removed_products: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminCollectionsRes
|
||||
* type: object
|
||||
* properties:
|
||||
* collection:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
*/
|
||||
export type AdminCollectionsRes = {
|
||||
collection: ProductCollection
|
||||
}
|
||||
|
||||
@@ -111,21 +111,7 @@ import { Type } from "class-transformer"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* collections:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
* $ref: "#/components/schemas/AdminCollectionsListRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -40,21 +40,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* description: "The ID of the collection"
|
||||
* object:
|
||||
* type: string
|
||||
* description: "The type of object the removal was executed on"
|
||||
* default: product-collection
|
||||
* removed_products:
|
||||
* description: "The IDs of the products removed from the collection"
|
||||
* type: array
|
||||
* items:
|
||||
* description: "The ID of a Product to add to the Product Collection."
|
||||
* type: string
|
||||
* $ref: "#/components/schemas/AdminDeleteProductsFromCollectionRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -49,10 +49,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* collection:
|
||||
* $ref: "#/components/schemas/ProductCollection"
|
||||
* $ref: "#/components/schemas/AdminCollectionsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -32,10 +32,35 @@ export default (app) => {
|
||||
return app
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminCurrenciesListRes
|
||||
* type: object
|
||||
* properties:
|
||||
* currencies:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/Currency"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
*/
|
||||
export type AdminCurrenciesListRes = PaginatedResponse & {
|
||||
currencies: Currency[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminCurrenciesRes
|
||||
* type: object
|
||||
* properties:
|
||||
* currency:
|
||||
* $ref: "#/components/schemas/Currency"
|
||||
*/
|
||||
export type AdminCurrenciesRes = {
|
||||
currency: Currency
|
||||
}
|
||||
|
||||
@@ -42,21 +42,7 @@ import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* currencies:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/Currency"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
* $ref: "#/components/schemas/AdminCurrenciesListRes"
|
||||
*/
|
||||
export default async (req: ExtendedRequest<Currency>, res) => {
|
||||
const currencyService: CurrencyService = req.scope.resolve("currencyService")
|
||||
|
||||
@@ -48,10 +48,7 @@ import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/ta
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* currency:
|
||||
* $ref: "#/components/schemas/Currency"
|
||||
* $ref: "#/components/schemas/AdminCurrenciesRes"
|
||||
*/
|
||||
export default async (req: ExtendedRequest<Currency>, res) => {
|
||||
const code = req.params.code as string
|
||||
|
||||
@@ -61,10 +61,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_group:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -47,10 +47,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_group:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -38,19 +38,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* description: The ID of the deleted customer group.
|
||||
* object:
|
||||
* type: string
|
||||
* description: The type of the object that was deleted.
|
||||
* default: customer_group
|
||||
* deleted:
|
||||
* type: boolean
|
||||
* description: Whether the customer group was deleted successfully or not.
|
||||
* default: true
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsDeleteRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -61,10 +61,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_group:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -37,21 +37,7 @@ import CustomerController from "../../../../controllers/customers"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customers:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
* $ref: "#/components/schemas/AdminCustomersListRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -40,10 +40,7 @@ import { FindParams } from "../../../../types/common"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_group:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -56,13 +56,53 @@ export default (app) => {
|
||||
/* ************************************** */
|
||||
/* ******** EXPORT API CLIENT TYPES ***** */
|
||||
/* ************************************** */
|
||||
|
||||
/**
|
||||
* @schema AdminCustomerGroupsRes
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_group:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
*/
|
||||
export type AdminCustomerGroupsRes = {
|
||||
customer_group: CustomerGroup
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminCustomerGroupsDeleteRes
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
* description: The ID of the deleted customer group.
|
||||
* object:
|
||||
* type: string
|
||||
* description: The type of the object that was deleted.
|
||||
* default: customer_group
|
||||
* deleted:
|
||||
* type: boolean
|
||||
* description: Whether the customer group was deleted successfully or not.
|
||||
* default: true
|
||||
*/
|
||||
export type AdminCustomerGroupsDeleteRes = DeleteResponse
|
||||
|
||||
/**
|
||||
* @schema AdminCustomerGroupsListRes
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_groups:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
*/
|
||||
export type AdminCustomerGroupsListRes = PaginatedResponse & {
|
||||
customer_groups: CustomerGroup[]
|
||||
}
|
||||
|
||||
@@ -127,21 +127,7 @@ import { Type } from "class-transformer"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_groups:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsListRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -53,10 +53,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer_group:
|
||||
* $ref: "#/components/schemas/CustomerGroup"
|
||||
* $ref: "#/components/schemas/AdminCustomerGroupsRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -54,10 +54,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
* $ref: "#/components/schemas/AdminCustomersRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -40,10 +40,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
* $ref: "#/components/schemas/AdminCustomersRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Router } from "express"
|
||||
import { Customer } from "../../../.."
|
||||
import { DeleteResponse, PaginatedResponse } from "../../../../types/common"
|
||||
import { PaginatedResponse } from "../../../../types/common"
|
||||
import middlewares from "../../../middlewares"
|
||||
|
||||
const route = Router()
|
||||
@@ -20,12 +20,35 @@ export default (app) => {
|
||||
return app
|
||||
}
|
||||
|
||||
/**
|
||||
* @schema AdminCustomersRes
|
||||
* type: object
|
||||
* properties:
|
||||
* customer:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
*/
|
||||
export type AdminCustomersRes = {
|
||||
customer: Customer
|
||||
}
|
||||
|
||||
export type AdminCustomersDeleteRes = DeleteResponse
|
||||
|
||||
/**
|
||||
* @schema AdminCustomersListRes
|
||||
* type: object
|
||||
* properties:
|
||||
* customers:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
*/
|
||||
export type AdminCustomersListRes = PaginatedResponse & {
|
||||
customers: Customer[]
|
||||
}
|
||||
|
||||
@@ -43,21 +43,7 @@ import customerController from "../../../../controllers/customers"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customers:
|
||||
* type: array
|
||||
* items:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
* count:
|
||||
* type: integer
|
||||
* description: The total number of items available
|
||||
* offset:
|
||||
* type: integer
|
||||
* description: The number of items skipped before these items
|
||||
* limit:
|
||||
* type: integer
|
||||
* description: The number of items per page
|
||||
* $ref: "#/components/schemas/AdminCustomersListRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
@@ -63,10 +63,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* customer:
|
||||
* $ref: "#/components/schemas/Customer"
|
||||
* $ref: "#/components/schemas/AdminCustomersRes"
|
||||
* "400":
|
||||
* $ref: "#/components/responses/400_error"
|
||||
* "401":
|
||||
|
||||
Reference in New Issue
Block a user