@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
    • 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 one namespace's L2 entries (SCAN + DEL by <namespace>::*). L2 is wiped cluster-wide immediately; peer L1 copies fall out within the namespace's L1 TTL (a clear does not publish per-key deletes). Returns the number of keys removed.

      Takes a CacheNamespace, not a string — an unregistered namespace is a compile error, so there is no "unknown namespace" case to handle here. Callers holding an untrusted string (the server action behind the operator form) narrow it with isCacheNamespace at their trust boundary.

      Parameters

      • input: {
            namespace:
                | "transaction-search"
                | "transaction-method-aggregate"
                | "ledger-account-search"
                | "customer-search"
                | "virtual-account-search"
                | "victor-account-search"
                | "girasol-card-search"
                | "deposit-bank-memo-search"
                | "organization-search"
                | "identity-search"
                | "payment-instrument-search"
                | "customer-terms-search"
                | "customer-pricing-schedule-get"
                | "reward-event-names"
                | "transaction-admin-search"
                | "entity-document-upload"
                | "bank-search"
                | "bank-transaction-search"
                | "route-fusion-program-search"
                | "bank-instant-payment-eligibility-get"
                | "fed-ach-dir-search"
                | "fed-participant-dir-search"
                | "swift-bic-get"
                | "solana-balance-timeseries"
                | "bank-balance-timeseries"
                | "cash-deposit-retailers"
                | "greendot-store-locations"
                | "transaction-metadata"
                | "short-url-redirect"
                | "token-config"
                | "chain-config"
                | "backoffice-wallet"
                | "solana-program-hash"
                | "email-template-search"
                | "api-key-auth-cache"
                | "victor-auth-token"
                | "zenus-auth-token"
                | "metcap-tokens";
        }

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