diff --git a/.changeset/tame-geese-applaud.md b/.changeset/tame-geese-applaud.md new file mode 100644 index 0000000000..28b4e7a07e --- /dev/null +++ b/.changeset/tame-geese-applaud.md @@ -0,0 +1,6 @@ +--- +"@medusajs/medusa-js": patch +"@medusajs/medusa": patch +--- + +fix(oas): fix paths and fix schema names to match convention diff --git a/packages/medusa-js/src/resources/admin/payment-collections.ts b/packages/medusa-js/src/resources/admin/payment-collections.ts index 15bd741dee..ed381dca2f 100644 --- a/packages/medusa-js/src/resources/admin/payment-collections.ts +++ b/packages/medusa-js/src/resources/admin/payment-collections.ts @@ -1,8 +1,8 @@ import { - AdminUpdatePaymentCollectionsReq, + AdminGetPaymentCollectionsParams, AdminPaymentCollectionDeleteRes, AdminPaymentCollectionsRes, - GetPaymentCollectionsParams, + AdminUpdatePaymentCollectionsReq, } from "@medusajs/medusa" import { ResponsePromise } from "../../typings" import BaseResource from "../base" @@ -11,7 +11,7 @@ import qs from "qs" class AdminPaymentCollectionsResource extends BaseResource { retrieve( id: string, - query?: GetPaymentCollectionsParams, + query?: AdminGetPaymentCollectionsParams, customHeaders: Record = {} ): ResponsePromise { let path = `/admin/payment-collections/${id}` diff --git a/packages/medusa-js/src/resources/payment-collections.ts b/packages/medusa-js/src/resources/payment-collections.ts index 8150013f4e..4bd30e9468 100644 --- a/packages/medusa-js/src/resources/payment-collections.ts +++ b/packages/medusa-js/src/resources/payment-collections.ts @@ -1,10 +1,10 @@ import { - GetPaymentCollectionsParams, - StorePostPaymentCollectionsBatchSessionsReq, - StorePostPaymentCollectionsBatchSessionsAuthorizeReq, + StoreGetPaymentCollectionsParams, StorePaymentCollectionSessionsReq, - StorePaymentCollectionsSessionRes, StorePaymentCollectionsRes, + StorePaymentCollectionsSessionRes, + StorePostPaymentCollectionsBatchSessionsAuthorizeReq, + StorePostPaymentCollectionsBatchSessionsReq, } from "@medusajs/medusa" import { ResponsePromise } from "../typings" import BaseResource from "./base" @@ -13,7 +13,7 @@ import qs from "qs" class PaymentCollectionsResource extends BaseResource { retrieve( id: string, - query?: GetPaymentCollectionsParams, + query?: StoreGetPaymentCollectionsParams, customHeaders: Record = {} ): ResponsePromise { let path = `/store/payment-collections/${id}` diff --git a/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts b/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts index 78abe0ab09..e62896afa2 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/update-draft-order.ts @@ -21,7 +21,7 @@ import { validator } from "../../../../utils/validator" import { IsType } from "../../../../utils/validators/is-type" /** - * @oas [post] /admin/draft-orders/{id} + * @oas [post] /draft-orders/{id} * operationId: PostDraftOrdersDraftOrder * summary: Update a Draft Order * description: "Updates a Draft Order." diff --git a/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts index 68130d68fd..0939a4ea07 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts @@ -13,7 +13,7 @@ import { FindParams } from "../../../../types/common" * - (query) fields {string} Comma separated list of fields to include in the results. * x-codegen: * method: retrieve - * queryParams: GetPaymentCollectionsParams + * queryParams: AdminGetPaymentCollectionsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -71,4 +71,4 @@ export default async (req, res) => { res.status(200).json({ payment_collection: paymentCollection }) } -export class GetPaymentCollectionsParams extends FindParams {} +export class AdminGetPaymentCollectionsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/payment-collections/index.ts b/packages/medusa/src/api/routes/admin/payment-collections/index.ts index 9d86ae6dfc..99538714e2 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/index.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/index.ts @@ -6,7 +6,7 @@ import middlewares, { } from "../../../middlewares" import { PaymentCollection } from "../../../../models" -import { GetPaymentCollectionsParams } from "./get-payment-collection" +import { AdminGetPaymentCollectionsParams } from "./get-payment-collection" import { AdminUpdatePaymentCollectionsReq } from "./update-payment-collection" const route = Router() @@ -16,7 +16,7 @@ export default (app, container) => { route.get( "/:id", - transformQuery(GetPaymentCollectionsParams, { + transformQuery(AdminGetPaymentCollectionsParams, { defaultFields: defaultPaymentCollectionFields, defaultRelations: defaulPaymentCollectionRelations, isList: false, diff --git a/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts b/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts index 52344b4540..bbe48a0b34 100644 --- a/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts +++ b/packages/medusa/src/api/routes/admin/uploads/delete-upload.ts @@ -2,7 +2,7 @@ import { IsString } from "class-validator" /** * @oas [delete] /uploads - * operationId: "AdminDeleteUploads" + * operationId: "DeleteUploads" * summary: "Delete an Uploaded File" * description: "Removes an uploaded file using the installed fileservice" * x-authenticated: true diff --git a/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts b/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts index fe266b166e..ce2bf9a75a 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts @@ -13,7 +13,7 @@ import { FindParams } from "../../../../types/common" * - (query) fields {string} Comma separated list of fields to include in the results. * x-codegen: * method: retrieve - * queryParams: GetPaymentCollectionsParams + * queryParams: StoreGetPaymentCollectionsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -70,4 +70,4 @@ export default async (req, res) => { res.status(200).json({ payment_collection: paymentCollection }) } -export class GetPaymentCollectionsParams extends FindParams {} +export class StoreGetPaymentCollectionsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/store/payment-collections/index.ts b/packages/medusa/src/api/routes/store/payment-collections/index.ts index 8bfb8b663c..5a3b14665c 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/index.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/index.ts @@ -7,7 +7,7 @@ import middlewares, { import { PaymentCollection, PaymentSession } from "../../../../models" import { StorePostPaymentCollectionsBatchSessionsAuthorizeReq } from "./authorize-batch-payment-sessions" -import { GetPaymentCollectionsParams } from "./get-payment-collection" +import { StoreGetPaymentCollectionsParams } from "./get-payment-collection" import { StorePostPaymentCollectionsBatchSessionsReq } from "./manage-batch-payment-sessions" import { StorePaymentCollectionSessionsReq } from "./manage-payment-session" @@ -18,7 +18,7 @@ export default (app, container) => { route.get( "/:id", - transformQuery(GetPaymentCollectionsParams, { + transformQuery(StoreGetPaymentCollectionsParams, { defaultFields: defaultPaymentCollectionFields, defaultRelations: defaultPaymentCollectionRelations, isList: false,