The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.
TypeScript b2b-marketplacecomposable-commerceecommerceenterpriseheadless-commercemarketplacemedusamedusajsmulti-vendortypescript
chore: v2.0.0-canary.27
vholikdb29a73a417b
diff --git a/packages/admin/package.json b/packages/admin/package.jsonindex 5c3d081b8..c3b03860b 100644--- a/packages/admin/package.json+++ b/packages/admin/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/admin",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",@@ -29,8 +29,8 @@"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"},"dependencies": {- "@mercurjs/dashboard-shared": "2.0.0-canary.26",- "@mercurjs/client": "2.0.0-canary.26",+ "@mercurjs/dashboard-shared": "2.0.0-canary.27",+ "@mercurjs/client": "2.0.0-canary.27","@ariakit/react": "^0.4.15","@babel/runtime": "^7.26.10","@dnd-kit/core": "^6.1.0",diff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 4abddcaf1..e90d71264 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/cli",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",diff --git a/packages/cli/src/codegen/constants.ts b/packages/cli/src/codegen/constants.tsindex b8bff2124..3fd784704 100644--- a/packages/cli/src/codegen/constants.ts+++ b/packages/cli/src/codegen/constants.ts@@ -301,6 +301,8 @@ export const defaultMercurRoutes = {"/admin/order-groups/:id": "typeof import(\"@mercurjs/core-plugin/api/admin/order-groups/[id]/route\")","/admin/payouts": "typeof import(\"@mercurjs/core-plugin/api/admin/payouts/route\")","/admin/payouts/:id": "typeof import(\"@mercurjs/core-plugin/api/admin/payouts/[id]/route\")",+ "/admin/orders": "typeof import(\"@mercurjs/core-plugin/api/admin/orders/route\")",+ "/admin/products": "typeof import(\"@mercurjs/core-plugin/api/admin/products/route\")","/admin/sellers": "typeof import(\"@mercurjs/core-plugin/api/admin/sellers/route\")","/admin/sellers/:id": "typeof import(\"@mercurjs/core-plugin/api/admin/sellers/[id]/route\")",diff --git a/packages/client/package.json b/packages/client/package.jsonindex 99727d0a1..32dc4878c 100644--- a/packages/client/package.json+++ b/packages/client/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/client",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",diff --git a/packages/core-plugin/package.json b/packages/core-plugin/package.jsonindex b3696bba5..241951f72 100644--- a/packages/core-plugin/package.json+++ b/packages/core-plugin/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/core-plugin",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",diff --git a/packages/core-plugin/src/api/admin/middlewares.ts b/packages/core-plugin/src/api/admin/middlewares.tsindex e4be05a6b..4fd5d9fca 100644--- a/packages/core-plugin/src/api/admin/middlewares.ts+++ b/packages/core-plugin/src/api/admin/middlewares.ts@@ -13,8 +13,10 @@ import { adminSellersMiddlewares } from "./sellers/middlewares"import { adminCommissionRatesMiddlewares } from "./commission-rates/middlewares"import { AdminGetProductsParams } from "./products/validators"import { listProductQueryConfig } from "@medusajs/medusa/api/admin/products/query-config"+import { AdminGetOrdersParams } from "./orders/validators"+import { listTransformQueryConfig as listOrderQueryConfig } from "@medusajs/medusa/api/admin/orders/query-config"-const maybeApplySellerFilter = (+const maybeApplySellerProductFilter = (req: AuthenticatedMedusaRequest,res: MedusaResponse,next: MedusaNextFunction@@ -30,6 +32,22 @@ const maybeApplySellerFilter = (})(req, res, next)}+const maybeApplySellerOrderFilter = (+ req: AuthenticatedMedusaRequest,+ res: MedusaResponse,+ next: MedusaNextFunction+) => {+ if (!req.filterableFields.seller_id) {+ return next()+ }++ return maybeApplyLinkFilter({+ entryPoint: "order_seller",+ resourceId: "order_id",+ filterableField: "seller_id",+ })(req, res, next)+}+export const adminMiddlewares: MiddlewareRoute[] = [...adminOrderGroupsMiddlewares,...adminPayoutsMiddlewares,@@ -43,7 +61,18 @@ export const adminMiddlewares: MiddlewareRoute[] = [AdminGetProductsParams,listProductQueryConfig),- maybeApplySellerFilter,+ maybeApplySellerProductFilter,+ ],+ },+ {+ method: ["GET"],+ matcher: "/admin/orders",+ middlewares: [+ validateAndTransformQuery(+ AdminGetOrdersParams,+ listOrderQueryConfig+ ),+ maybeApplySellerOrderFilter,],},]diff --git a/packages/core-plugin/src/api/admin/orders/route.ts b/packages/core-plugin/src/api/admin/orders/route.tsnew file mode 100644index 000000000..cfd5fba85--- /dev/null+++ b/packages/core-plugin/src/api/admin/orders/route.ts@@ -0,0 +1,5 @@+import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework";+import { HttpTypes } from "@medusajs/types";+import { AdminGetOrdersParamsType } from "./validators";++export declare const GET: (req: AuthenticatedMedusaRequest<AdminGetOrdersParamsType>, res: MedusaResponse<HttpTypes.AdminOrderListResponse>) => Promise<void>;diff --git a/packages/core-plugin/src/api/admin/orders/validators.ts b/packages/core-plugin/src/api/admin/orders/validators.tsnew file mode 100644index 000000000..17c99e7d3--- /dev/null+++ b/packages/core-plugin/src/api/admin/orders/validators.ts@@ -0,0 +1,8 @@+import { z } from "zod"+import { AdminGetOrdersParams as BaseAdminGetOrdersParams } from "@medusajs/medusa/api/admin/orders/validators"++export const AdminGetOrdersParams = BaseAdminGetOrdersParams.extend({+ seller_id: z.union([z.string(), z.array(z.string())]).optional(),+})++export type AdminGetOrdersParamsType = z.infer<typeof AdminGetOrdersParams>diff --git a/packages/core-plugin/src/api/admin/products/validators.ts b/packages/core-plugin/src/api/admin/products/validators.tsindex c4c66ddcc..382077ab5 100644--- a/packages/core-plugin/src/api/admin/products/validators.ts+++ b/packages/core-plugin/src/api/admin/products/validators.ts@@ -2,7 +2,7 @@ import { z } from "zod"import { AdminGetProductsParams as BaseAdminGetProductsParams } from "@medusajs/medusa/api/admin/products/validators"export const AdminGetProductsParams = BaseAdminGetProductsParams._def.schema.extend({- seller_id: z.string().optional(),+ seller_id: z.union([z.string(), z.array(z.string())]).optional(),})export type AdminGetProductsParamsType = z.infer<typeof AdminGetProductsParams>\ No newline at end of filediff --git a/packages/dashboard-sdk/package.json b/packages/dashboard-sdk/package.jsonindex 3b5e0ff5a..af6c2a641 100644--- a/packages/dashboard-sdk/package.json+++ b/packages/dashboard-sdk/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/dashboard-sdk",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",diff --git a/packages/dashboard-shared/package.json b/packages/dashboard-shared/package.jsonindex c98252246..2b5526557 100644--- a/packages/dashboard-shared/package.json+++ b/packages/dashboard-shared/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/dashboard-shared",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",@@ -23,7 +23,7 @@"build": "tsup"},"dependencies": {- "@mercurjs/client": "2.0.0-canary.26",+ "@mercurjs/client": "2.0.0-canary.27","@ariakit/react": "^0.4.15","@babel/runtime": "^7.26.10","@dnd-kit/core": "^6.1.0",diff --git a/packages/types/package.json b/packages/types/package.jsonindex 75bb0800b..fabb588bb 100644--- a/packages/types/package.json+++ b/packages/types/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/types",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",diff --git a/packages/vendor/package.json b/packages/vendor/package.jsonindex c2c13f4c5..a27507068 100644--- a/packages/vendor/package.json+++ b/packages/vendor/package.json@@ -1,6 +1,6 @@{"name": "@mercurjs/vendor",- "version": "2.0.0-canary.26",+ "version": "2.0.0-canary.27","repository": {"type": "git","url": "https://github.com/mercurjs/mercur",@@ -29,8 +29,8 @@"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"},"dependencies": {- "@mercurjs/dashboard-shared": "2.0.0-canary.26",- "@mercurjs/client": "2.0.0-canary.26",+ "@mercurjs/dashboard-shared": "2.0.0-canary.27",+ "@mercurjs/client": "2.0.0-canary.27","@ariakit/react": "^0.4.15","@babel/runtime": "^7.26.10","@dnd-kit/core": "^6.1.0",