Skip to content

Commit

Permalink
Merge branch 'develop' into fix/deployment-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage authored Nov 7, 2024
2 parents 47b0523 + 8feb589 commit b83c6f3
Show file tree
Hide file tree
Showing 177 changed files with 1,268 additions and 800 deletions.
5 changes: 0 additions & 5 deletions .changeset/cold-shirts-wonder.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cool-buckets-remember.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/early-queens-prove.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/eleven-students-cover.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/heavy-pears-mix.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/shiny-spiders-raise.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tall-starfishes-travel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tame-sloths-pump.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/tough-spiders-admire.md

This file was deleted.

24 changes: 23 additions & 1 deletion integration-tests/http/__tests__/auth/admin/auth.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { generateResetPasswordTokenWorkflow } from "@medusajs/core-flows"
import jwt from "jsonwebtoken"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import jwt from "jsonwebtoken"
import {
adminHeaders,
createAdminUser,
Expand Down Expand Up @@ -264,6 +264,28 @@ medusaIntegrationTestRunner({
expect(response.response.status).toEqual(401)
expect(response.response.data.message).toEqual("Invalid token")
})

it("should fail if no token is passed", async () => {
jest.useFakeTimers()

// Register user
await api.post("/auth/user/emailpass/register", {
email: "[email protected]",
password: "secret_password",
})

// Advance time by 15 minutes
jest.advanceTimersByTime(15 * 60 * 1000)

const response = await api
.post(`/auth/user/emailpass/update`, {
email: "[email protected]",
})
.catch((e) => e)

expect(response.response.status).toEqual(401)
expect(response.response.data.message).toEqual("Invalid token")
})
})

it("should refresh the token successfully", async () => {
Expand Down
85 changes: 84 additions & 1 deletion integration-tests/modules/__tests__/cart/store/carts.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RemoteLink } from "@medusajs/modules-sdk"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
IApiKeyModuleService,
ICartModuleService,
Expand All @@ -21,7 +22,6 @@ import {
PromotionType,
RuleOperator,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
createAdminUser,
generatePublishableKey,
Expand Down Expand Up @@ -1178,6 +1178,89 @@ medusaIntegrationTestRunner({
)
})

it("should update a carts tax lines with a reduced product type rate", async () => {
await setupTaxStructure(taxModule)

const region = await regionModule.createRegions({
name: "US",
currency_code: "usd",
automatic_taxes: false,
countries: ["ca"],
})

const cart = await cartModule.createCarts({
currency_code: "usd",
region_id: region.id,
shipping_address: {
address_1: "test address 1",
address_2: "test address 2",
city: "CA",
country_code: "CA",
province: "QC",
postal_code: "94016",
},
items: [
{
id: "item-1",
unit_price: 2000,
quantity: 1,
title: "Test item",
product_id: "prod_tshirt_reduced_tax",
product_type_id: "product_type_id_3",
} as any,
{
id: "item-2",
unit_price: 1000,
quantity: 1,
title: "Test item two",
product_id: "prod_tshirt",
} as any,
],
})

let updated = await api.post(
`/store/carts/${cart.id}/taxes`,
{},
storeHeaders
)

expect(updated.status).toEqual(200)

expect(updated.data.cart).toEqual(
expect.objectContaining({
id: cart.id,
items: expect.arrayContaining([
expect.objectContaining({
id: "item-2",
tax_lines: expect.arrayContaining([
// Regional rate for Quebec, Canada
expect.objectContaining({
description: "QC Default Rate",
code: "QCDEFAULT",
rate: 2,
provider_id: "system",
}),
]),
adjustments: [],
}),
expect.objectContaining({
id: "item-1",
tax_lines: expect.arrayContaining([
// Reduced rate for product types in Quebec, Canada
expect.objectContaining({
description: "QC Reduced Rate for Product Type",
code: "QCREDUCE_TYPE",
rate: 1,
provider_id: "system",
}),
]),
adjustments: [],
}),
]),
})
)
})

it("should throw error when shipping is not present", async () => {
await setupTaxStructure(taxModule)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
ICartModuleService,
IFulfillmentModuleService,
Expand All @@ -10,7 +11,6 @@ import {
ITaxModuleService,
} from "@medusajs/types"
import { ContainerRegistrationKeys, Modules } from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
adminHeaders,
createAdminUser,
Expand Down Expand Up @@ -244,6 +244,7 @@ medusaIntegrationTestRunner({
product_description: null,
product_subtitle: null,
product_type: null,
product_type_id: null,
product_collection: null,
product_handle: "test-product",
variant_sku: null,
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/modules/__tests__/order/order.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import { IOrderModuleService } from "@medusajs/types"
import { Modules } from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
adminHeaders,
createAdminUser,
Expand Down Expand Up @@ -157,6 +157,7 @@ medusaIntegrationTestRunner({
product_description: null,
product_subtitle: null,
product_type: null,
product_type_id: null,
product_collection: null,
product_handle: null,
variant_sku: null,
Expand Down
9 changes: 9 additions & 0 deletions packages/admin/admin-bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @medusajs/admin-bundler

## 2.0.2

### Patch Changes

- Updated dependencies [[`b3cbc160eb94025402b5a0ef21653c207bbe8ccd`](https://github.com/medusajs/medusa/commit/b3cbc160eb94025402b5a0ef21653c207bbe8ccd)]:
- @medusajs/dashboard@2.0.2
- @medusajs/admin-shared@2.0.2
- @medusajs/admin-vite-plugin@2.0.2

## 2.0.1

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/admin/admin-bundler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@medusajs/admin-bundler",
"version": "2.0.1",
"version": "2.0.2",
"description": "Bundler for the Medusa admin dashboard.",
"author": "Kasper Kristensen <[email protected]>",
"scripts": {
Expand All @@ -18,17 +18,17 @@
"package.json"
],
"devDependencies": {
"@medusajs/types": "^2.0.1",
"@medusajs/types": "^2.0.2",
"@types/compression": "^1.7.5",
"copyfiles": "^2.4.1",
"express": "^4.21.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
},
"dependencies": {
"@medusajs/admin-shared": "2.0.1",
"@medusajs/admin-vite-plugin": "2.0.1",
"@medusajs/dashboard": "2.0.1",
"@medusajs/admin-shared": "2.0.2",
"@medusajs/admin-vite-plugin": "2.0.2",
"@medusajs/dashboard": "2.0.2",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"compression": "^1.7.4",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @medusajs/admin-sdk

## 2.0.2

### Patch Changes

- Updated dependencies []:
- @medusajs/admin-shared@2.0.2

## 2.0.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/admin-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@medusajs/admin-sdk",
"description": "SDK for building extension for the Medusa admin dashboard.",
"version": "2.0.1",
"version": "2.0.2",
"author": "Kasper Kristensen <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand All @@ -25,7 +25,7 @@
"zod": "^3.22"
},
"dependencies": {
"@medusajs/admin-shared": "^2.0.1"
"@medusajs/admin-shared": "^2.0.2"
},
"peerDependencies": {
"zod": "^3.22"
Expand Down
2 changes: 2 additions & 0 deletions packages/admin/admin-shared/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @medusajs/admin-shared

## 2.0.2

## 2.0.1

## 2.0.0
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/admin-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@medusajs/admin-shared",
"description": "Shared code for Medusa admin packages.",
"version": "2.0.1",
"version": "2.0.2",
"author": "Kasper Kristensen <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-vite-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @medusajs/admin-vite-plugin

## 2.0.2

### Patch Changes

- Updated dependencies []:
- @medusajs/admin-shared@2.0.2

## 2.0.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/admin-vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@medusajs/admin-vite-plugin",
"version": "2.0.1",
"version": "2.0.2",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@babel/parser": "7.25.6",
"@babel/traverse": "7.25.6",
"@medusajs/admin-shared": "2.0.1",
"@medusajs/admin-shared": "2.0.2",
"chokidar": "3.5.3",
"fdir": "6.1.1",
"magic-string": "0.30.5",
Expand Down
11 changes: 11 additions & 0 deletions packages/admin/dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @medusajs/dashboard

## 2.0.2

### Patch Changes

- [#9947](https://github.com/medusajs/medusa/pull/9947) [`b3cbc160eb94025402b5a0ef21653c207bbe8ccd`](https://github.com/medusajs/medusa/commit/b3cbc160eb94025402b5a0ef21653c207bbe8ccd) Thanks [@sradevski](https://github.com/sradevski)! - fix: Default to a relative path for backend URL in admin

- Updated dependencies [[`30edc8fa40ff5ed6ecc8c55f555f9d975df497f5`](https://github.com/medusajs/medusa/commit/30edc8fa40ff5ed6ecc8c55f555f9d975df497f5)]:
- @medusajs/js-sdk@2.0.2
- @medusajs/admin-shared@2.0.2
- @medusajs/icons@2.0.2

## 2.0.1

### Patch Changes
Expand Down
Loading

0 comments on commit b83c6f3

Please sign in to comment.