InvalidateNamespace

tagtree · /core·type

Typed invalidation surface generated from a CacheSchemaShape; exposes a method per declared entity plus tenant and all shortcuts, so callers get autocompletion and type-checked params instead of constructing raw tag arrays by hand.

Definition

@nordcom/commerce-tagtree
type InvalidateNamespace = EntityInvalidators<E, T> & { all: unknown; tenant: unknown };

EntityInvalidators<E, T> & { all: unknown; tenant: unknown }

Example

// Invalidate a single product by ID for a specific tenant.
await cache.invalidate.product({ tenant: shop, id: '123' });
// Invalidate all entries for a tenant.
await cache.invalidate.tenant(shop);
// Purge the entire namespace.
await cache.invalidate.all();

ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape

On this page