@cfxlabsinc/b2b-services
    Preparing search index...

    Operator-facing cache control for the System › Cache surface.

    Talks to the shared Valkey store directly (by namespace string), not to the owning services — so it never reopens the per-service "writer self-busts its own cache" boundary. Three actions, three guarantees:

    • bustCustomer — tag invalidation across every customer-scoped namespace; publishes per-key deletes so peer nodes drop their L1 at once.
    • clearNamespaceSCAN + DEL over one namespace's L2 (immediate cluster-wide; peer L1 falls out within that namespace's L1 TTL).
    • flushAll — the same clear across every namespace EXCEPT auth-token caches (clearing those forces a partner re-auth).
    Index

    Constructors

    Methods

    • Bust every customer-scoped cache for one customer. Tag invalidation publishes per-key deletes, so peers drop their L1 copies near-instantly. Returns the namespaces touched (tag invalidation reports no key count).

      Parameters

      • input: { customerId: string }

      Returns Promise<
          | { ok: true; value: { customerId: string; namespaces: string[] } }
          | { error: ServiceError; ok: false },
      >

    • Clear every cache namespace EXCEPT auth-token caches. Clearing an auth-token cache forces a partner re-auth, which is never what "flush all caches" should mean — those are skipped and reported back so the omission is visible.

      Returns Promise<
          | {
              ok: true;
              value: { cleared: ClearedNamespace[]; skipped: string[] };
          }
          | { error: ServiceError; ok: false },
      >