-
#377
48ca265Thanks @mvantellingen! - Make the storage engine async to support pluggable persistent storage backends (e.g., SQLite, PostgreSQL). AllAbstractStoragemethods now return Promises. This is a breaking change for users who callctMock.project().unsafeAdd(),ctMock.project().get(), orctMock.clear()— these methods are now async and must be awaited.ctMock.project().unsafeAdd(type, resource)is now async — useawait ctMock.project().unsafeAdd(type, resource)ctMock.project().get(type, id)is now async — useawait ctMock.project().get(type, id)ctMock.clear()is now async — useawait ctMock.clear()
AbstractStorageandInMemoryStorageare now exported from the package, allowing custom storage backend implementations- New
storageoption onCommercetoolsMockOptionsto inject a custom storage backend
-
#377
50bcd7dThanks @mvantellingen! - Replace the internal HTTP server with Fastify. The standalone mock server now uses Fastify for routing and request handling, improving performance and maintainability. -
#377
ba62b38Thanks @mvantellingen! - Remove deprecatedstart(),stop(), andadd()methods. UseregisterHandlers()to bind to an msw server andunsafeAdd()for adding resources directly.
-
#377
50bcd7dThanks @mvantellingen! - AddcreatedByandlastModifiedByfields to all resources, reflecting the client credentials used when creating or updating them. -
#377
5056e4aThanks @mvantellingen! - Add draft validation for resource creation when strict mode is enabled. Generated Zod schemas validate incoming request bodies against the commercetools API spec before passing them to repositories. -
#377
35bd4caThanks @mvantellingen! - AddSQLiteStoragebackend using Node.js built-innode:sqlitemodule (available since v22.5.0). This provides a persistent storage option that stores data in a SQLite database file while maintaining full compatibility with the existing in-memory backend.SQLiteStorageis available as a separate entry point to avoid breaking compatibility with Node.js < 22.5.0:import { CommercetoolsMock } from "@labdigital/commercetools-mock"; import { SQLiteStorage } from "@labdigital/commercetools-mock/sqlite"; // File-based persistent storage const storage = new SQLiteStorage({ filename: "my-mock.db" }); const ctMock = new CommercetoolsMock({ storage }); // In-memory SQLite (useful for tests) const storage = new SQLiteStorage({ filename: ":memory:" });
@labdigital/commercetools-mock/sqlite— Separate entry point exportingSQLiteStorageandSQLiteStorageOptions
-
#379
90d3287Thanks @mvantellingen! - Unify logging to use Pino (via Fastify's built-in logger) instead of console.error. Add support for passing a custom Pino logger instance via the newloggeroption onCommercetoolsMockOptions. The standalone server now uses pino-pretty for human-readable output.
-
#377
16dc10eThanks @mvantellingen! - Add setKey, changeName, and changeDescription update actions for product types -
#377
50bcd7dThanks @mvantellingen! - Fix cart discount code handling based on review feedback from PR #360. -
#379
5f269f2Thanks @mvantellingen! - Fix creating categories with a parent specified by key instead of id. Previously, only theidfield was used when storing the parent reference, causing a "ResourceIdentifier requires an 'id' xor a 'key'" error when the parent was specified by key. -
#379
c8511f9Thanks @mvantellingen! - Fix Fastify rejecting DELETE requests with an empty JSON body by adding a custom content-type parser that tolerates empty bodies. -
#379
7dc5dccThanks @mvantellingen! - Route all error responses through the central error handler by converting directreply.status(4xx).send()calls to throwCommercetoolsErrorinstead. This ensures all error responses are logged when thesilentoption is set tofalseand provides consistent error response bodies withstatusCode,message, anderrorsfields. -
#379
1e9b331Thanks @mvantellingen! - Optimize custom object lookups by container and key from O(n) to O(1):- Add a secondary in-memory index (container+key -> id) in InMemoryStorage, maintained on add/delete
- Add a
json_extractexpression index in SQLiteStorage for direct SQL lookup instead of loading all rows - Replace the full-scan
all()+find()inCustomObjectRepository.getWithContainerAndKey()with the new indexed lookup
-
#379
b573a84Thanks @mvantellingen! - Improve resource creation performance, especially noticeable with SQLite storage and large numbers of resources:- Eliminate redundant re-fetch after inserting a resource in both SQLite and InMemory storage backends
- Cache known project keys in SQLite storage to skip repeated INSERT+SELECT on the projects table
- Avoid double-fetching the resource in the service POST handler by reusing the already-created resource instead of re-fetching from storage
-
#379
1e9b331Thanks @mvantellingen! - Fix performance degradation with large datasets (40k+ resources) in SQLite storage:- Add indexed
containerandco_keycolumns to the SQLite resources table, replacing the O(n)json_extract-based custom object lookup with an O(log n) indexed query - Include automatic schema migration for existing databases
- Add
count()method to storage backends, enabling fast O(1) existence checks - Short-circuit review statistics calculation when no reviews exist, avoiding a full table scan on every product creation/retrieval
- Add indexed
-
#377
50bcd7dThanks @mvantellingen! - Update project dependencies to their latest compatible versions. -
#377
0b36231Thanks @mvantellingen! - Upgrade zod from v3 to v4 and remove zod-validation-error dependency. Validation error messages now use a built-in formatter that produces commercetools-style error details.
- #375
5cbccdeThanks @BramKaashoek! - include custom type in Order Return Items
- #373
0729881Thanks @stephanbeek! - Added support for addDelivery order update action
- #370
a0f4312Thanks @BramKaashoek! - Add email token verification
- #368
a91c04eThanks @demeyerthom! - Add order search endpoint functionality
-
#365
ef7ef13Thanks @robertmoelker! - Add HighPrecisionMoney support -
#360
06315c6Thanks @daanjo3! - Add basic support for discount codes in the cart repository
- #363
18bf0cbThanks @BramKaashoek! - properly fetch the business unit key in getBusinessUnitKeyReference
- #361
378ad0dThanks @BramKaashoek! - Add support for as associate shopping lists
-
#357
b07c7c9Thanks @mvantellingen! - Fix file ref to typings file -
#359
564b3f8Thanks @BramKaashoek! - fix: allow business unit address actions to work with key as well as ID
- #355
263e40fThanks @mvantellingen! - Fix release by properly referencing theindex.mjsfile in the package.json
- #353
88af65cThanks @BramKaashoek! - Generate an ID for address when one has not been passed
-
#350
cfbc4acThanks @mvantellingen! - Update release process to use trusted publishing -
#352
93cebc5Thanks @mvantellingen! - Update build process for the docker version -
#350
cfbc4acThanks @mvantellingen! - update various depdendencies to resolve potential security issues
-
#349
85b06f7Thanks @BramKaashoek! - Add taxedPrice to cart and order -
#346
375f7a2Thanks @robertmoelker! - feat(cart): add support for set line-item prices
- #344
0fb00beThanks @BramKaashoek! - Add shippingInfo to orders
-
#341
bde20b2Thanks @mikedebock! - feat: implement support for set line-item custom types and fields on carts and orders -
#343
e36d8dcThanks @BramKaashoek! - update MSW depedency to 2.8.4
-
#340
d2e5bf8Thanks @BramKaashoek! - Feat: takes store key from cart draft if not avaiable from context -
#338
a5cc7d7Thanks @BramKaashoek! - Feat: set shipping method from cart draft as shipping method
- #336
72bae12Thanks @BramKaashoek! - fix: include business and customer from draft on order import
-
#332
71ecce0Thanks @jsm1t! - Add support for get my business unit by key -
#333
7948f69Thanks @demeyerthom! - Added additional features to project endpoints, updated project starting defaults to align with commercetools
-
#331
35da11eThanks @BramKaashoek! - fix: make tax rate for custom line item dependent on the cart.shippingAddress.country ?? cart.country -
#329
9a70063Thanks @BramKaashoek! - fix: implement tax rate on custom line items
- #326
8c3dcfeThanks @BramKaashoek! - Add support for custom line items on cart
-
#320
7a466c6Thanks @BramKaashoek! - fix: IN operator can be both a list and a single value -
#327
be5a2b5Thanks @BramKaashoek! - Fix IN operator to work correctly with array values in predicate parser
- #323
e29f6e1Thanks @BramKaashoek! - Add support for attributes at Product level Add DiscountGroup, RecurrencePolicy, and RecurringOrder services Add PaymentUpdateAction methods Add invalidateOlderTokens to customer token creation
-
#321
43a4299Thanks @BramKaashoek! - Implements the following previously missing BusinessUnit update action handlers:removeShippingAddressId- Remove an address ID from shipping addressesaddBillingAddressId- Add an address ID to billing addressesremoveBillingAddressId- Remove an address ID from billing addressessetDefaultBillingAddress- Set the default billing addresssetCustomField- Set a custom field value on the business unitsetAddressCustomField- Set a custom field value on a specific addresssetAddressCustomType- Set the custom type for a specific addressremoveAssociate- Remove an associate from the business unitchangeAssociate- Change an existing associate's role assignments
Fixes the
changeAddressaction to properly replace an existing address instead of adding a new one.
- #318
eab2927Thanks @BramKaashoek! - fix: predicate parser bugs in IN and WITHIN
- #316
e455a60Thanks @BramKaashoek! - Fixes a bug where main variants were not included in where predicates. Fixes a bug where vars were not read in predicates with AND statements
- #315
f26a6dcThanks @martinaplaceres! - added business unit actions
- #311
dbee365Thanks @copilot-swe-agent! - Add support for filtering on stock in Product Search
- #308
d711323Thanks @mikedebock! - add missing "/me/business-units/*" endpoints
- #306
6840ef0Thanks @copilot-swe-agent! - Improve test coverage for src/services directory to meet 80% threshold
-
#298
1161924Thanks @demeyerthom! - Added support for business units to cart creation -
#295
b19fc03Thanks @daanjo3! - Adds custom line item field handling on cart creation
- #296
0f56cafThanks @demeyerthom! - Set request document size limit to 16mb to allow for testing scenarios with large documents
-
393f1b3Thanks @mvantellingen! - Only release ESM version -
393f1b3Thanks @mvantellingen! - Cleanup dependencies and use built-in where possible -
393f1b3Thanks @mvantellingen! - Switch fromtsuptotsdownfor packaging
0568d33Thanks @mvantellingen! - Replace isEqual with isDeepStrictEqual
-
393f1b3Thanks @mvantellingen! - Only release ESM version -
393f1b3Thanks @mvantellingen! - Cleanup dependencies and use built-in where possible -
393f1b3Thanks @mvantellingen! - Switch fromtsuptotsdownfor packaging
0568d33Thanks @mvantellingen! - Replace isEqual with isDeepStrictEqual
- #291
0d2119bThanks @davidweterings! - Fix removeShippingMethod not working
- #289
c1ef7a3Thanks @davidweterings! - Add setShippingAddressCustomField and removeShippingMethod
2564e8cThanks @mvantellingen! - Fix readable stream error
b1c9fbfThanks @mvantellingen! - Add retrieval of quote requests using as-associate endpoint
94d2786Thanks @mvantellingen! - Improve 404 response on get by id and get by key calls
7729301Thanks @mvantellingen! - Upgrade dependencies (express 5 and more)
-
#281
c38c5f3Thanks @jsm1t! - Product search - add support for values in exact query -
#285
ae6d8c5Thanks @mvantellingen! - Update the@commercetools/platform-sdkversion -
#285
3ff268cThanks @mvantellingen! - Add really basic quote functionality suppport, this is far from working correctly, but a good start
-
#272
6a3b6edThanks @jsm1t! - Fix predicate parser identifying uuid property key as int -
#279
3e606b8Thanks @mvantellingen! - Support settingcustomerIDwhen creating a cart
7ee6729Thanks @mvantellingen! - Support product images and assets creation
- #270
9eccae3Thanks @mvantellingen! - Remove unused argument fromgetHandlers()
- #268
0212cb4Thanks @mvantellingen! - AddctMock().getHandlers()to return all msw handlers for initial setup
- #266
8d8e802Thanks @mvantellingen! - Remove errornous console.error statemetn for concurrent modifications
-
#263
55b0bfcThanks @mvantellingen! - Add astrictboolean option to make the mock service strict and throw errors when certain values are missing -
#246
2774582Thanks @mvantellingen! - Add deprecation warning forctMock.add()
- #261
d20c176Thanks @demeyerthom! - Added missing mutations for custom fields on associate roles, product selections and business units
- #259
a7166d7Thanks @mvantellingen! - Support as-associate endpoints for carts and orders
- #257
36c79e2Thanks @jsm1t! - Allow setting associates to business unit, if its created without associates
-
#248
1530420Thanks @gijsmin! - add missing addParcelCustomField action to order -
#252
f40bbeaThanks @mikedebock! - Add support for lowercaseEmail on customers
- #242
c970b6eThanks @demeyerthom! - Added cart discount set stores support
-
#245
ac90ac3Thanks @mvantellingen! - Improve mocking of customer updates. This includes adding support forremoveAddress,removeBillingAddressId,removeShippingAddressId,setCustomerGroup,setDateOfBirth,setDefaultShippingAddress,setDefaultBillingAddress,setMiddleName,setTitle. -
d9cc9b1Thanks @mvantellingen! - Use type-safe quality operators (===)
- #243
3a148e0Thanks @jsm1t! - Fix for defaultBillingAddress & defaultShippingAddress customer create options not working
-
#236
d11863dThanks @saraghaedi! - add handler for creating in-store customer token -
#241
1c9f082Thanks @demeyerthom! - Added support for more search indexes on projects
-
#237
a0525a4Thanks @saraghaedi! - implement my business unit service -
#238
b86edf4Thanks @mvantellingen! - Add ability to set shipping and billing addresses when creating customer
- #234
83dd885Thanks @mickdekkers! - Populate cart.shippingInfo when setShippingMethod is called
- #232
860a1b5Thanks @davidweterings! - Set store key reference on create cart
- #224
1177aa1Thanks @webwiebe! - Added the setShippingAddressCustomType and setBillingAddressCustomType actions to the cart repository
- #221
70fee89Thanks @mikedebock! - add support for "setPurchaseOrderNumber" order update action
- #219
0fd9b7bThanks @mikedebock! - add support for "addAddress", "addBillingAddressId" and "addShippingAddressId" customer update actions
- #217
d5709d1Thanks @callumhemming! - allows addedAt override in add to cart and add to wishlist
- #211
91b0255Thanks @yugaWicaksono! - Added missing test OrderChangeShipmentStateAction in order action
- #209
2b74155Thanks @borisvankatwijk! - Addition of "products/search" POST endpoint. Also known as "Storefront Search -> Product Search".
- #207
28bca80Thanks @demeyerthom! - Added additional options to project settings
- #199
be62944Thanks @leongraumans! - add support for "setProductPriceCustomField" product update action
- #204
a4e5a6cThanks @yugaWicaksono! - Added missing test to cover OrderSetDeliveryCustomFieldAction in the form of method setDeliveryCustomField inside of OrderUpdateHandler
- #202
8737a6aThanks @demeyerthom! - Fixed issues with business units, updated sdk to latest
2b5dc4cThanks @mvantellingen! - Implement customer reset flow for global scope
- #194
cb84e0aThanks @pvaneveld! - Add support for customer set custom type
- #191
ffcbd97Thanks @pvaneveld! - add support for customer setLocale action
- #190
7cce673Thanks @pvaneveld! - add support for "setExternalId" customer update action
- #188
a21f259Thanks @pvaneveld! - add support for the customer email verify flow
- #186
5cdc614Thanks @mikedebock! - Fix customObject withContainer postProcessResource arguments
- #181
934673bThanks @TiagoUmemura! - update express version to 4.19.2
- #178
871e39aThanks @leongraumans! - Add changeTaxRoundingMode to cart mock
-
#176
0999495Thanks @tleguijt! - Add support for cart setCustomerId and setAnonymousId action -
#176
0999495Thanks @tleguijt! - Includecustomwhen creating order from cart
222fa1cThanks @mvantellingen! - Handlevar.*in query endpoints correctly
3ed13bbThanks @mvantellingen! - Add missing fields to category creation
7454fdaThanks @mvantellingen! - Improve the customer create endpoint
5f7dee5Thanks @mvantellingen! - Handle category expand when doing queries
756c94bThanks @mvantellingen! - Properly handle expanding ancestors on Category
08e651bThanks @mvantellingen! - Return proper values for Category.ancestors
- #169
09da22dThanks @mikedebock! - add support for customer setCustomerId action
-
#166
851ab0bThanks @mikedebock! - add support for customer setSalutation action -
#164
879a26cThanks @stephanbeek! - add support for customer setKey action
8474ddaThanks @mvantellingen! - UseSetupServerApifor registerHandler as type
e9f337aThanks @mvantellingen! - Validate update json body for version and actions
-
2c6e829Thanks @mvantellingen! - Refactor customer password reset flow to better mock commercetools -
d801cf3Thanks @mvantellingen! - Show deprecation warnings when start() and stop() are used.
-
f101f3bThanks @mvantellingen! - Return correct type for customer create (CustomerSignInResult) -
19df959Thanks @mvantellingen! - Format the refresh tokens to match commercetools
- #158
91c4637Thanks @mikedebock! - add support for cart setDirectDiscounts action
- #156
c426209Thanks @BramKaashoek! - correctly set productID on ShoppingListLineItem when adding line item by sku
-
#154
282bf59Thanks @mikedebock! - add support for customer setCustomerNumber action -
#152
7c83048Thanks @BramKaashoek! - Adds variant IDs when creating ShoppingListLineItems. Implement Variant expansion on ShoppingListLineItems. Implement ShoppingList update actions.
c36ccb6Thanks @mvantellingen! - Implement all Payment update actions
- #148
438fc00Thanks @demeyerthom! - Fixed /me password not found error response
- #145
7c2c3caThanks @demeyerthom! - Added additional functionality to customer and me/customer
-
73efc3dThanks @mvantellingen! - Add various update actions to the Payment API -
82a4dc6Thanks @mvantellingen! - Update all dependencies to their latest version
- #143
b3dd521Thanks @mikedebock! - Add order syncInfo support
04c9b41Thanks @mvantellingen! - Read refresh token from body
ffa83f9Thanks @mvantellingen! - Expose the authServer publically
6f0dc45Thanks @mvantellingen! - Add support for refresh token flow
a9f0031Thanks @mvantellingen! - Add ability to create anonymous tokens
- #136
7927c24Thanks @mikedebock! - add support for cart recalculate action
-
bab0609Thanks @mvantellingen! - Add cart action to set custom shipping method -
31bce78Thanks @mvantellingen! - Improve support for custom-objects -
768cb56Thanks @mvantellingen! - Improve mocking of the shipping-methods/matching-cart endpoint
abc58e8Thanks @mvantellingen! - Disable token validation if the validate flag is not set
-
361fbefThanks @mvantellingen! - Add support for reviews endpoint -
16e1237Thanks @mvantellingen! - Add support for returnInfo on orders -
61e5729Thanks @mvantellingen! - Add priceSelector logic to product-projections query endpoint
-
dded2b9Thanks @mvantellingen! - Expose the MSW server via mswServer() -
efc6495Thanks @mvantellingen! - Upgrade to commercetools sdk 6.0.0 -
a7d3305Thanks @mvantellingen! - Don't overwrite the expanded obj if already set -
aa4c63aThanks @mvantellingen! - Keep price channel intact when creating product
b1370cfThanks @mvantellingen! - Improve support for /me endpoint
f6f9069Thanks @mvantellingen! - Don't clear msw handlers when calling ctMock.clear()
419a0e1Thanks @mvantellingen! - Improve integration options with msw by adding registerHandlers()
- #130
1197e45Thanks @mikedebock! - Add support for HEAD requests
-
#129
92a232fThanks @whyhankee! - feat(categories): add extra actions- changeName
- changeParent
-
#126
a0946b7Thanks @TiagoUmemura! - add support for setAttributeInAllVariants
4c09cafThanks @demeyerthom! - Extended product resource support
f66d431Thanks @mvantellingen! - Fix Premature close errors by switching from supertest to light-my-request for mapping between msw and express
- #120
5bf3c6eThanks @mvantellingen! - Improve mocking of customer authentication
- #108
0073abeThanks @mvantellingen! - Switch from nock to MSW 2.0 to support native fetch calls. This requires Node 18+
- #117
a8b52d9Thanks @mikedebock! - add support for cart addItemShippingAddress and setLineItemShippingDetails
-
44822abThanks @demeyerthom! - Added support for business units -
44822abThanks @demeyerthom! - Added SetCustomType action for CartDiscount
- #104
4d83b97Thanks @mvantellingen! - Improve mocking of the product projection search
fef6934Thanks @demeyerthom! - Added changeBuyerAssignable action to associate-role repo
df59ca9Thanks @demeyerthom! - Added associate role resources
1396677Thanks @demeyerthom! - Added category asset actions and cart discount custom fields
f63d8dbThanks @mvantellingen! - Fix product projection get by id
-
#92
c53c2b4Thanks @demeyerthom! - Added logic for attribute groups -
#95
957864dThanks @mvantellingen! - Fix implementation of the product projection query endpoint. This also fixes some issues with passing condition values as separate values (var.name)
9de64b0Thanks @okkevandereijk! - add setCustomField to customer
-
131ef6cThanks @okkevandereijk! - fix: remove general error from customer -
acbba1fThanks @okkevandereijk! - update docker github actions, fix container build
de55a18Thanks @mvantellingen! - Move to pure ESM module, we still export the CommonJS module too
de55a18Thanks @mvantellingen! - Vendor both pratt and perplex dependencies to make them work with ESM
9c01157Thanks @mvantellingen! - Attempt to fix perplex constructor error
7528ac2Thanks @mvantellingen! - Fix error related to perplex when used from ESM
-
0f4cbbfThanks @mvantellingen! - Remove peerDependency for @commercetools/platform-sdk and make sure we only import types -
0f4cbbfThanks @mvantellingen! - Add support for Cart.changeLineItemQuantity -
0f4cbbfThanks @mvantellingen! - Update most dependencies to latest version
0f4cbbfThanks @mvantellingen! - Switch to using vitest instead of jest
612de44Thanks @davidweterings! - Add shipping method localized name action
c0d5850Thanks @mvantellingen! - Move from lodash to lodash.isequal
- #74
b521a4aThanks @okkevandereijk! - fix: use tsup onSuccess instead of nodemon
- #72
d6b123bThanks @okkevandereijk! - fix: revert start script to old situation, running server
-
#70
2776347Thanks @mikedebock! -- Add addPrice product update action
- Add changePrice product update action
- Add removePrice product update action
-
#68
7b74869Thanks @okkevandereijk! -⚠️ This is a major update dropping support for Node 14 and under.- Updated node to version 18
- Updated pnpm to version 8
- Enforce eslint with default library
fc0f786Thanks @mvantellingen! - Fix release process to build before publishing to npm
- #62
d81b817Thanks @bala-goflink! - Add support for standalone-prices
600a470Thanks @mvantellingen! - Switch to using @changesets for releases
- Store deleteDaysAfterCreation on project settings
- Add addExternalImage and removeImage product update actions
- Various fixes to the internal type system
- Implement update by key and delete by key support for all resources
- Added support for updating
authenticationModeof a customer - Improve handling of staged vs current product data for products
- Improve version identifier increments to match commercetools
- Refactor product projection to handle published vs non published products
- Added boolean parsing logic for predicates.
- Include
key,descriptionandmetaDescriptionwhen converting product to product projection - Add support for updating transitions in state
- Set fractionDigits for money based on currency code
- Improve logic to mask secret values in resources
- Implement experimental support for facets in the product projection search.
- Add support for multiple RANGE() clauses in the product projection endpoint.
- Fix a packaging error in the GitHub workflow. The artifact for version 0.7.0 didn't contain the bundled output files.
- Rewrite the mock implementation of the product projection search endpoint to work with products created via the product endpoint. This also adds support for multiple filters.
- Replace tsdx with tsup for building the library
- Drop support for Node 12 and add Node 18.