npm @medusajs/medusa 1.17.2
v1.17.2

latest releases: 2.0.2-preview-20241116150223, 2.0.5-preview-20241116150140, 2.0.2-preview-20241116120232...
13 months ago

Highlights

API Routes

Version 1.17.2 of @medusajs/medusa introduces API Routes - a massive improvement of the developer experience of creating custom endpoints in Medusa.

Custom API endpoints can now be implemented using similar patterns to frameworks like Next.js and Svelte.

// api/admin/products/route.ts

import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"

export async function GET(req: MedusaRequest, res: MedusaResponse) {
  const productService = req.scope.resolve("productService")
  const products = await productService.list()
  res.json({ products })
}

In the above example, we create the endpoint GET /admin/products. The example illustrates a few key points:

  • Endpoint paths are inferred from the file path of the route
  • route.{ts|js} is a new special file that contains the route handlers
  • HTTP methods of route handlers are defined by the handler name (above GET)

Read more about the API Routes in the PR and announcement post.

Features

  • feat(medusa): support file based routing by @kasperkristensen in #5365
  • feat(create-medusa-app): add tracking for selected options by @shahednasser in #5404
  • feat(medusa): add pricing integration feature flag by @pKorsholm in #5287
  • feat(link-modules,modules-sdk,pricing): Medusa App Migrations + Core compatible migrations by @riqwan in #5317
  • feat(pricing,types,utils): Move calculate pricing query to a repository + rule type validation by @riqwan in #5294
  • feat(medusa-file-s3): Added S3 directory config by @pepijn-vanvlaanderen in #5291
  • feat: move create inventory to @medusajs/workflows by @srindom in #5301
  • feat(workflows): update product workflow by @fPolic in #4982

Bugs

Chores

Docs

Full Changelog: v1.17.1...v1.17.2

Don't miss a new medusa release

NewReleases is sending notifications on new releases.