fix(oas): fix paths and fix schema names to match convention (#3288)
This commit is contained in:
6
.changeset/tame-geese-applaud.md
Normal file
6
.changeset/tame-geese-applaud.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/medusa-js": patch
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(oas): fix paths and fix schema names to match convention
|
||||
@@ -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<string, any> = {}
|
||||
): ResponsePromise<AdminPaymentCollectionsRes> {
|
||||
let path = `/admin/payment-collections/${id}`
|
||||
|
||||
@@ -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<string, any> = {}
|
||||
): ResponsePromise<StorePaymentCollectionsRes> {
|
||||
let path = `/store/payment-collections/${id}`
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user