@medusajs/utils

2.21.2

Patch Changes

2.21.1

Patch Changes

  • #16816 1c1607cced6c1e552e9e800cf571a2235098d0fd Thanks @shahednasser! - fix(medusa, utils): apply default http.authMethodsPerActor and gate /auth/:auth_provider/user by config

  • #16749 3538aab7bc5fcff61591a83bb98e6643823cb947 Thanks @yfwmaniish! - fix(utils): compare Date values by time in deepEqualObj

  • #16467 893d96850320f8f00c623c66f46e9fcde5ab1cdf Thanks @tushardev-365! - fix(utils): make the migration skip flag actually skip migrations

  • #16903 75f3d03b84b1404cc05b9f5f15c6be4a2c2f1d18 Thanks @sradevski! - feat(utils): extend the graphSeed and graphConsume search helpers so an index whose documents need more than one query.graph read can use them instead of a hand-written seed and consume: a context option forwarded to every read including the catch-up pass (e.g. the pricing context variants.calculated_price needs), and a transform that receives the whole page, may be async, and marks a row as leaving the index by returning no document for it — so enrichment such as prices in several currencies costs a fixed number of reads per page, and an awaited resolve_ids that receives the ingestion context, so an event about a related entity can be mapped to the documents it affects

  • Updated dependencies []:

2.21.0

Patch Changes

MathBN.convert(value, decimalPlaces) guarded the rounding step with if (decimalPlaces), so passing 0 (round to an integer, e.g. for zero-decimal currencies) was treated the same as omitting the argument and no rounding was applied. It now checks decimalPlaces != null so 0 rounds as expected while an omitted argument still skips rounding.

2.20.1

Patch Changes

2.20.0

Patch Changes

Log seed/reindex progress (count, rate, last key) so large catalogs can be followed.

2.19.0

Patch Changes

2.18.0

Minor Changes

Patch Changes

calculateAdjustmentTotal wrote the plural running accumulators (adjustmentsSubtotal/adjustmentsTotal) onto each adjustment's own subtotal/total, instead of the singular per-adjustment values. Every adjustment after the first was inflated to the cumulative total; the bug was masked for lines with a single adjustment. The aggregate return values were unaffected.

BigNumber implemented valueOf, toJSON, and [Symbol.toPrimitive] but not toString(), so an explicit bn.toString() fell through to Object.prototype.toString and returned "[object Object]". This silently broke callers such as parseFloat(bn.toString()) (returned NaN). toString() is now the single source of truth for string coercion, returning the same value as the [Symbol.toPrimitive] string hint, which delegates to it so the two stay consistent.

Pass driverOptions.dynamicPassword and driverOptions.expirationChecker through to the Knex connection config, enabling AWS RDS IAM authentication and other rotating-credential patterns.

refundable_total / refundable_total_per_unit were understated for a non-tax-inclusive line item that carries a discount (adjustment) and has a pending or partially received return. setRefundableTotal subtracted the tax-inclusive discount (adjustmentsTotal) and then applied tax to the remaining amount, which taxed the discount a second time.

The discount basis now follows the item's tax inclusivity: tax-inclusive items keep using the tax-inclusive discount (the unit price already includes tax, and no tax is added back), while non-tax-inclusive items subtract the pre-tax discount before tax is applied once. For example, a non-tax-inclusive item at unit_price 100, quantity 2, 10% tax, a 20 discount, with 1 unit requested for return now reports refundable_total 99 instead of 97.9.

2.17.2

Patch Changes

2.17.1

Patch Changes

2.17.0

Minor Changes

Patch Changes

2.16.0

Patch Changes

Adds a GMD entry to the hardcoded currency maps in packages/core/utils/src/defaults/currencies.ts, packages/admin/dashboard/src/lib/data/currencies.ts, and packages/plugins/loyalty/src/admin/lib/currencies.ts. Without it, admin pages that map over store.supported_currencies and look each one up — most notably the Regions create/edit form — crash with TypeError: Cannot read properties of undefined (reading 'code') when a store has GMD as a supported currency.

The applied-promotions accumulator stored adjustment amounts in each promotion's own tax base, so a tax-inclusive promotion compared its remaining applicable amount (incl-tax) against amounts a previous non-tax-inclusive promotion recorded excl-tax. The mismatched bases let the combined discount exceed the line item value and drive the taxable base negative. Applied amounts are now tracked tax-exclusively and converted to the promotion's base before being subtracted, for both each and across allocations.

2.15.5

Patch Changes

2.15.4

Patch Changes

2.15.3

Patch Changes

2.15.2

Patch Changes

2.15.1

Patch Changes

2.15.0

Patch Changes

2.14.2

Patch Changes

2.14.1

Patch Changes

2.14.0

Patch Changes

2.13.6

Patch Changes

2.13.5

Patch Changes

2.13.4

Patch Changes

2.13.3

Patch Changes

2.13.2

Patch Changes

2.13.1

Patch Changes

2.13.0

Minor Changes

Patch Changes

2.12.6

Patch Changes

2.12.5

Patch Changes

2.12.4

Patch Changes

2.12.3

Patch Changes

2.12.2

Patch Changes

2.12.1

Patch Changes

2.12.0

Patch Changes

2.11.3

Patch Changes

2.11.2

Patch Changes

2.11.1

Patch Changes

2.11.0

Patch Changes

2.10.3

Patch Changes

2.10.2

Patch Changes

2.10.1

Patch Changes

2.10.0

Minor Changes

Patch Changes

2.9.0

Patch Changes

2.8.8

Patch Changes

2.8.7

Patch Changes

2.8.6

Patch Changes

2.8.5

Patch Changes

2.8.4

Patch Changes

2.8.3

Patch Changes

2.8.2

Patch Changes

2.8.1

Patch Changes

2.8.0

Patch Changes

2.7.1

Patch Changes

2.7.0

Patch Changes

2.6.1

Patch Changes

2.6.0

Patch Changes

2.5.1

Patch Changes

2.5.0

Patch Changes

2.4.0

Minor Changes

Patch Changes

2.3.1

Patch Changes

2.3.0

Patch Changes

2.2.0

Patch Changes

2.1.3

Patch Changes

2.1.2

Patch Changes

2.1.1

Patch Changes

2.1.0

Patch Changes

2.0.7

Patch Changes

2.0.6

Patch Changes

2.0.5

Patch Changes

2.0.4

Patch Changes

2.0.3

Patch Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

2.0.0

Major Changes

Patch Changes

1.11.9

Patch Changes

1.11.8

Patch Changes

1.11.7

Patch Changes

1.11.6

Patch Changes

1.11.5

Patch Changes

1.11.4

Patch Changes

1.11.3

Patch Changes

1.11.2

Patch Changes

  • #5752 079f0da83 Thanks @riqwan! - feat(core-flows,pricing,medusa,pricing,types,utils): Price List Prices can have their own rules

  • #5755 8f25ed8a1 Thanks @adrien2p! - feat(link-modules, pricing, product, utils): Should be able to set some custom database config even in shared mode

  • Updated dependencies [079f0da83]:

1.11.1

Patch Changes

1.11.0

Minor Changes

Patch Changes

1.10.5

Patch Changes

1.10.4

Patch Changes

1.10.3

Patch Changes

1.10.2

Patch Changes

  • #5161 cc4169a94 Thanks @adrien2p! - feat(utils): Provide an utils that allows to convert an array of fields to a complete remote query object

  • #5214 1e7db5a5c Thanks @riqwan! - feat(types,pricing,utils): Exact match based on context + fallback on rule priority if not

  • Updated dependencies [1e7db5a5c]:

1.10.1

Patch Changes

1.10.0

Minor Changes

Patch Changes

1.9.7

Patch Changes

1.9.6

Patch Changes

  • #4626 3f3a84262 Thanks @adrien2p! - [WIP] feat(types, product, utils, medusa): Include shared connection for modules

  • #4733 30ce35b16 Thanks @shahednasser! - feat(create-medusa-app, utils, medusa-cli): add database options + remove util from @medusajs/utils

1.9.5

Patch Changes

1.9.4

Patch Changes

  • #4623 107ae23a3 Thanks @riqwan! - fix(utils, types, medusa-plugin-meilisearch, medusa-plugin-algolia): move SoftDeletableFilterKey, variantKeys, indexTypes from types to utils

1.9.3

Patch Changes

  • #4535 131477faf Thanks @riqwan! - feat(product,types,utils): Add tags, types, categories, collection and options CRUD to product module services

1.9.2

Patch Changes

1.9.1

Patch Changes

1.9.0

Minor Changes

  • #4146 db4199530 Thanks @fPolic! - chore(medusa, utils, inventory, stock-location): clear deps in the utils package

Patch Changes

1.8.5

Patch Changes

1.8.4

Patch Changes

1.8.3

Patch Changes

1.8.2

Patch Changes

1.8.1

Patch Changes

1.8.0

Patch Changes

0.0.2-rc.2

Patch Changes

0.0.2-rc.1

Patch Changes

  • chore: Fix RC package versions

0.0.2-rc.0

Patch Changes