chore(types, medusa): [3/3] add missing query type arguments (#8880)
Add missing type arguments in listing requests. 3/3
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
import { OperatorMap } from "../../../dal";
|
||||||
import { BaseCollectionListParams } from "../common";
|
import { BaseCollectionListParams } from "../common";
|
||||||
|
|
||||||
export interface StoreCollectionFilters extends BaseCollectionListParams {}
|
export interface StoreCollectionFilters extends Omit<BaseCollectionListParams, "id"> {
|
||||||
|
deleted_at?: OperatorMap<string>
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export * from "./entities"
|
export * from "./entities"
|
||||||
|
export * from "./queries"
|
||||||
export * from "./responses"
|
export * from "./responses"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { BaseFilterable } from "../../../dal";
|
||||||
|
import { FindParams } from "../../common";
|
||||||
|
|
||||||
|
export interface StoreGetCurrencyListParams extends
|
||||||
|
FindParams, BaseFilterable<StoreGetCurrencyListParams> {
|
||||||
|
q?: string
|
||||||
|
code?: string | string[]
|
||||||
|
}
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
import { BaseOrderFilters } from "../common";
|
import { BaseFilterable } from "../../../dal";
|
||||||
|
import { FindParams } from "../../common";
|
||||||
|
|
||||||
export interface StoreOrderFilters extends BaseOrderFilters {}
|
export interface StoreOrderFilters extends
|
||||||
|
FindParams, BaseFilterable<StoreOrderFilters> {
|
||||||
|
id?: string | string[]
|
||||||
|
name?: string | string[]
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export * from "./entities"
|
export * from "./entities"
|
||||||
|
export * from "./payloads"
|
||||||
export * from "./queries"
|
export * from "./queries"
|
||||||
export * from "./responses"
|
export * from "./responses"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export interface StoreCreatePaymentCollection {
|
||||||
|
cart_id: string
|
||||||
|
}
|
||||||
@@ -5,7 +5,9 @@ import {
|
|||||||
} from "../common"
|
} from "../common"
|
||||||
|
|
||||||
export interface StorePaymentProviderFilters
|
export interface StorePaymentProviderFilters
|
||||||
extends BasePaymentProviderFilters {}
|
extends BasePaymentProviderFilters {
|
||||||
|
is_enabled?: boolean
|
||||||
|
}
|
||||||
export interface StorePaymentCollectionFilters
|
export interface StorePaymentCollectionFilters
|
||||||
extends BasePaymentCollectionFilters {}
|
extends BasePaymentCollectionFilters {}
|
||||||
export interface StorePaymentSessionFilters extends BasePaymentSessionFilters {}
|
export interface StorePaymentSessionFilters extends BasePaymentSessionFilters {}
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ export interface StoreProductParams extends BaseProductListParams {
|
|||||||
region_id?: string
|
region_id?: string
|
||||||
currency_code?: string
|
currency_code?: string
|
||||||
variants?: StoreProductVariantParams
|
variants?: StoreProductVariantParams
|
||||||
|
province?: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,8 @@ export interface BaseRegionCountry {
|
|||||||
export interface BaseRegionFilters extends BaseFilterable<BaseRegionFilters> {
|
export interface BaseRegionFilters extends BaseFilterable<BaseRegionFilters> {
|
||||||
q?: string
|
q?: string
|
||||||
id?: string[] | string | OperatorMap<string | string[]>
|
id?: string[] | string | OperatorMap<string | string[]>
|
||||||
name?: string | OperatorMap<string>
|
name?: string | string[]
|
||||||
currency_code?: string | OperatorMap<string>
|
code?: string | string[]
|
||||||
metadata?: Record<string, unknown> | OperatorMap<Record<string, unknown>>
|
|
||||||
created_at?: OperatorMap<string>
|
created_at?: OperatorMap<string>
|
||||||
updated_at?: OperatorMap<string>
|
updated_at?: OperatorMap<string>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export * from "./entities"
|
export * from "./entities"
|
||||||
|
export * from "./payloads"
|
||||||
export * from "./responses"
|
export * from "./responses"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
interface StoreCreateReturnItem {
|
||||||
|
id: string
|
||||||
|
quantity: number
|
||||||
|
reason_id?: string | null
|
||||||
|
note?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
interface StoreCreateReturnShipping {
|
||||||
|
option_id: string
|
||||||
|
price?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StoreCreateReturn {
|
||||||
|
order_id: string
|
||||||
|
items: StoreCreateReturnItem[]
|
||||||
|
return_shipping: StoreCreateReturnShipping
|
||||||
|
note?: string | null
|
||||||
|
receive_now?: boolean
|
||||||
|
location_id?: string | null
|
||||||
|
}
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
export * from "./entities"
|
export * from "./entities"
|
||||||
|
export * from "./queries"
|
||||||
export * from "./responses"
|
export * from "./responses"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { BaseFilterable } from "../../../dal";
|
||||||
|
import { FindParams } from "../../common";
|
||||||
|
|
||||||
|
export interface StoreGetShippingOptionList extends
|
||||||
|
FindParams, BaseFilterable<StoreGetShippingOptionList> {
|
||||||
|
cart_id: string
|
||||||
|
}
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
|
import { BaseFilterable, OperatorMap } from "../../../dal"
|
||||||
import { FindParams } from "../../common"
|
import { FindParams } from "../../common"
|
||||||
|
|
||||||
export interface AdminStockLocationListParams extends FindParams {
|
export interface AdminStockLocationListParams extends
|
||||||
id?: string | string[]
|
FindParams, BaseFilterable<AdminStockLocationListParams> {
|
||||||
q?: string
|
id?: string | string[]
|
||||||
name?: string | string[]
|
q?: string
|
||||||
address_id?: string | string[]
|
name?: string | string[]
|
||||||
sales_channel_id?: string | string[]
|
address_id?: string | string[]
|
||||||
$and?: AdminStockLocationListParams[]
|
sales_channel_id?: string | string[]
|
||||||
$or?: AdminStockLocationListParams[]
|
$and?: AdminStockLocationListParams[]
|
||||||
}
|
$or?: AdminStockLocationListParams[]
|
||||||
|
created_at?: OperatorMap<string>
|
||||||
|
updated_at?: OperatorMap<string>
|
||||||
|
deleted_at?: OperatorMap<string>
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { OperatorMap } from "../../../dal"
|
import { BaseFilterable, OperatorMap } from "../../../dal"
|
||||||
import { FindParams } from "../../common"
|
import { FindParams } from "../../common"
|
||||||
|
|
||||||
export interface AdminTaxRateListParams extends FindParams {
|
export interface AdminTaxRateListParams extends
|
||||||
id?: string | string[]
|
FindParams, BaseFilterable<AdminTaxRateListParams> {
|
||||||
q?: string
|
q?: string
|
||||||
tax_region_id?: string | string[] | OperatorMap<string | string[]>
|
tax_region_id?: string | string[] | OperatorMap<string | string[]>
|
||||||
is_default?: string
|
is_default?: string
|
||||||
service_zone_id?: string
|
service_zone_id?: string
|
||||||
shipping_profile_id?: string
|
shipping_profile_id?: string
|
||||||
provider_id?: string
|
provider_id?: string
|
||||||
shipping_option_type_id?: string
|
shipping_option_type_id?: string
|
||||||
created_at?: string | OperatorMap<string>
|
created_at?: OperatorMap<string>
|
||||||
updated_at?: string | OperatorMap<string>
|
updated_at?: OperatorMap<string>
|
||||||
deleted_at?: string | OperatorMap<string>
|
deleted_at?: OperatorMap<string>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { refetchCustomer } from "../../helpers"
|
|||||||
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
import { AdditionalData, HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCustomerAddressFilters>,
|
||||||
res: MedusaResponse<HttpTypes.AdminCustomerAddressListResponse>
|
res: MedusaResponse<HttpTypes.AdminCustomerAddressListResponse>
|
||||||
) => {
|
) => {
|
||||||
const customerId = req.params.id
|
const customerId = req.params.id
|
||||||
|
|||||||
@@ -9,15 +9,11 @@ import {
|
|||||||
|
|
||||||
import { createStockLocationsWorkflow } from "@medusajs/core-flows"
|
import { createStockLocationsWorkflow } from "@medusajs/core-flows"
|
||||||
import { refetchStockLocation } from "./helpers"
|
import { refetchStockLocation } from "./helpers"
|
||||||
import {
|
|
||||||
AdminCreateStockLocationType,
|
|
||||||
AdminGetStockLocationsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
// Create stock location
|
// Create stock location
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateStockLocationType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateStockLocation>,
|
||||||
res: MedusaResponse<HttpTypes.AdminStockLocationResponse>
|
res: MedusaResponse<HttpTypes.AdminStockLocationResponse>
|
||||||
) => {
|
) => {
|
||||||
const { result } = await createStockLocationsWorkflow(req.scope).run({
|
const { result } = await createStockLocationsWorkflow(req.scope).run({
|
||||||
@@ -34,7 +30,7 @@ export const POST = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetStockLocationsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminStockLocationListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminStockLocationListResponse>
|
res: MedusaResponse<HttpTypes.AdminStockLocationListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { AdminGetStoresParamsType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetStoresParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminStoreListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminStoreListResponse>
|
res: MedusaResponse<HttpTypes.AdminStoreListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -8,14 +8,10 @@ import {
|
|||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { refetchTaxRate } from "./helpers"
|
import { refetchTaxRate } from "./helpers"
|
||||||
import {
|
|
||||||
AdminCreateTaxRateType,
|
|
||||||
AdminGetTaxRatesParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateTaxRateType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateTaxRate>,
|
||||||
res: MedusaResponse<HttpTypes.AdminTaxRateResponse>
|
res: MedusaResponse<HttpTypes.AdminTaxRateResponse>
|
||||||
) => {
|
) => {
|
||||||
const { result } = await createTaxRatesWorkflow(req.scope).run({
|
const { result } = await createTaxRatesWorkflow(req.scope).run({
|
||||||
@@ -36,7 +32,7 @@ export const POST = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetTaxRatesParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminTaxRateListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminTaxRateListResponse>
|
res: MedusaResponse<HttpTypes.AdminTaxRateListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -7,15 +7,11 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import {
|
|
||||||
AdminCreateTaxRegionType,
|
|
||||||
AdminGetTaxRegionsParamsType,
|
|
||||||
} from "./validators"
|
|
||||||
import { refetchTaxRegion } from "./helpers"
|
import { refetchTaxRegion } from "./helpers"
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminCreateTaxRegionType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateTaxRegion>,
|
||||||
res: MedusaResponse<HttpTypes.AdminTaxRegionResponse>
|
res: MedusaResponse<HttpTypes.AdminTaxRegionResponse>
|
||||||
) => {
|
) => {
|
||||||
const { result } = await createTaxRegionsWorkflow(req.scope).run({
|
const { result } = await createTaxRegionsWorkflow(req.scope).run({
|
||||||
@@ -36,7 +32,7 @@ export const POST = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetTaxRegionsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminTaxRegionListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminTaxRegionListResponse>
|
res: MedusaResponse<HttpTypes.AdminTaxRegionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import {
|
|||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { MedusaError } from "@medusajs/utils"
|
import { MedusaError } from "@medusajs/utils"
|
||||||
import { AdminGetUploadParamsType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetUploadParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminUploadFile>,
|
||||||
res: MedusaResponse<HttpTypes.AdminFileListResponse>
|
res: MedusaResponse<HttpTypes.AdminFileListResponse>
|
||||||
) => {
|
) => {
|
||||||
const input = req.files as Express.Multer.File[]
|
const input = req.files as Express.Multer.File[]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminUserListParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminUserListResponse>
|
res: MedusaResponse<HttpTypes.AdminUserListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -3,15 +3,13 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
|
|
||||||
import { AdminGetWorkflowExecutionsParamsType } from "./validators"
|
|
||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
remoteQueryObjectFromString,
|
remoteQueryObjectFromString,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetWorkflowExecutionsParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetWorkflowExecutionsParams>,
|
||||||
res: MedusaResponse<HttpTypes.AdminWorkflowExecutionListResponse>
|
res: MedusaResponse<HttpTypes.AdminWorkflowExecutionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest,
|
req: AuthenticatedMedusaRequest<HttpTypes.StoreCollectionFilters>,
|
||||||
res: MedusaResponse<HttpTypes.StoreCollectionListResponse>
|
res: MedusaResponse<HttpTypes.StoreCollectionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
|||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: MedusaRequest,
|
req: MedusaRequest<HttpTypes.StoreGetCurrencyListParams>,
|
||||||
res: MedusaResponse<HttpTypes.StoreCurrencyListResponse>
|
res: MedusaResponse<HttpTypes.StoreCurrencyListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import { MedusaError } from "@medusajs/utils"
|
|||||||
|
|
||||||
import { createCustomerAccountWorkflow } from "@medusajs/core-flows"
|
import { createCustomerAccountWorkflow } from "@medusajs/core-flows"
|
||||||
import { refetchCustomer } from "./helpers"
|
import { refetchCustomer } from "./helpers"
|
||||||
import { StoreCreateCustomerType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<StoreCreateCustomerType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.StoreCreateCustomer>,
|
||||||
res: MedusaResponse<HttpTypes.StoreCustomerResponse>
|
res: MedusaResponse<HttpTypes.StoreCustomerResponse>
|
||||||
) => {
|
) => {
|
||||||
// If `actor_id` is present, the request carries authentication for an existing customer
|
// If `actor_id` is present, the request carries authentication for an existing customer
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { AdminGetOrdersParamsType } from "../../admin/draft-orders/validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<AdminGetOrdersParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.StoreOrderFilters>,
|
||||||
res: MedusaResponse<HttpTypes.StoreOrderListResponse>
|
res: MedusaResponse<HttpTypes.StoreOrderListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { StoreCreatePaymentCollectionType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: AuthenticatedMedusaRequest<StoreCreatePaymentCollectionType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.StoreCreatePaymentCollection>,
|
||||||
res: MedusaResponse<HttpTypes.StorePaymentCollectionResponse>
|
res: MedusaResponse<HttpTypes.StorePaymentCollectionResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -7,12 +7,11 @@ import {
|
|||||||
MedusaError,
|
MedusaError,
|
||||||
remoteQueryObjectFromString,
|
remoteQueryObjectFromString,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { StoreGetPaymentProvidersParamsType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
// TODO: Add more fields to provider, such as default name and maybe logo.
|
// TODO: Add more fields to provider, such as default name and maybe logo.
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<StoreGetPaymentProvidersParamsType>,
|
req: AuthenticatedMedusaRequest<HttpTypes.StorePaymentProviderFilters>,
|
||||||
res: MedusaResponse<HttpTypes.StorePaymentProviderListResponse>
|
res: MedusaResponse<HttpTypes.StorePaymentProviderListResponse>
|
||||||
) => {
|
) => {
|
||||||
if (!req.filterableFields.region_id) {
|
if (!req.filterableFields.region_id) {
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { StoreProductCategoryListResponse } from "@medusajs/types"
|
import {
|
||||||
|
StoreProductCategoryListParams,
|
||||||
|
StoreProductCategoryListResponse,
|
||||||
|
} from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
remoteQueryObjectFromString,
|
remoteQueryObjectFromString,
|
||||||
@@ -7,10 +10,9 @@ import {
|
|||||||
AuthenticatedMedusaRequest,
|
AuthenticatedMedusaRequest,
|
||||||
MedusaResponse,
|
MedusaResponse,
|
||||||
} from "../../../types/routing"
|
} from "../../../types/routing"
|
||||||
import { StoreProductCategoriesParamsType } from "./validators"
|
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: AuthenticatedMedusaRequest<StoreProductCategoriesParamsType>,
|
req: AuthenticatedMedusaRequest<StoreProductCategoryListParams>,
|
||||||
res: MedusaResponse<StoreProductCategoryListResponse>
|
res: MedusaResponse<StoreProductCategoryListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -5,12 +5,11 @@ import {
|
|||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { MedusaResponse } from "../../../types/routing"
|
import { MedusaResponse } from "../../../types/routing"
|
||||||
import { wrapVariantsWithInventoryQuantity } from "../../utils/middlewares"
|
import { wrapVariantsWithInventoryQuantity } from "../../utils/middlewares"
|
||||||
import { StoreGetProductsParamsType } from "./validators"
|
|
||||||
import { RequestWithContext, wrapProductsWithTaxPrices } from "./helpers"
|
import { RequestWithContext, wrapProductsWithTaxPrices } from "./helpers"
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: RequestWithContext<StoreGetProductsParamsType>,
|
req: RequestWithContext<HttpTypes.StoreProductParams>,
|
||||||
res: MedusaResponse<HttpTypes.StoreProductListResponse>
|
res: MedusaResponse<HttpTypes.StoreProductListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
|||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: MedusaRequest,
|
req: MedusaRequest<HttpTypes.StoreRegionFilters>,
|
||||||
res: MedusaResponse<HttpTypes.StoreRegionListResponse>
|
res: MedusaResponse<HttpTypes.StoreRegionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { createAndCompleteReturnOrderWorkflow } from "@medusajs/core-flows"
|
import { createAndCompleteReturnOrderWorkflow } from "@medusajs/core-flows"
|
||||||
import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
||||||
import { StorePostReturnsReqSchemaType } from "./validators"
|
|
||||||
import { HttpTypes } from "@medusajs/types"
|
import { HttpTypes } from "@medusajs/types"
|
||||||
|
|
||||||
export const POST = async (
|
export const POST = async (
|
||||||
req: MedusaRequest<StorePostReturnsReqSchemaType>,
|
req: MedusaRequest<HttpTypes.StoreCreateReturn>,
|
||||||
res: MedusaResponse<HttpTypes.StoreReturnResponse>
|
res: MedusaResponse<HttpTypes.StoreReturnResponse>
|
||||||
) => {
|
) => {
|
||||||
const input = req.validatedBody as StorePostReturnsReqSchemaType
|
const input = req.validatedBody as HttpTypes.StoreCreateReturn
|
||||||
|
|
||||||
const workflow = createAndCompleteReturnOrderWorkflow(req.scope)
|
const workflow = createAndCompleteReturnOrderWorkflow(req.scope)
|
||||||
const { result } = await workflow.run({
|
const { result } = await workflow.run({
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { MedusaError, ModuleRegistrationName } from "@medusajs/utils"
|
|||||||
import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
import { MedusaRequest, MedusaResponse } from "../../../types/routing"
|
||||||
|
|
||||||
export const GET = async (
|
export const GET = async (
|
||||||
req: MedusaRequest,
|
req: MedusaRequest<HttpTypes.StoreGetShippingOptionList>,
|
||||||
res: MedusaResponse<HttpTypes.StoreShippingOptionListResponse>
|
res: MedusaResponse<HttpTypes.StoreShippingOptionListResponse>
|
||||||
) => {
|
) => {
|
||||||
const { cart_id } = req.filterableFields as { cart_id: string }
|
const { cart_id } = req.filterableFields as { cart_id: string }
|
||||||
|
|||||||
Reference in New Issue
Block a user