@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, each seen by the next read in every process:

    • bustCustomer — clears the customer's tags in every tagged namespace, auth included.
    • clearNamespace — SCAN + DEL over one namespace.
    • flushAll — the same clear across every namespace EXCEPT auth-token caches (clearing those forces a partner re-auth).
    Index
    instance: (...args: []) => CacheBusterService = ...

    The process default: the shared Valkey keyspace from ValkeyClient.instance().

    • Clear every entry that projects the customer or lists records under it, in every tagged namespace. That includes its cached API-key auth lookups, so its next API request reads the credential again. 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 entries (SCAN + DEL by <namespace>::*). 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-count"
                | "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"
                | "verification-template-search"
                | "customer-document-search"
                | "deposit-search"
                | "deposit-quote-search"
                | "withdrawal-search"
                | "withdrawal-quote-search"
                | "wire-file-search"
                | "customer-terms-search"
                | "internal-slack-channel-search"
                | "utila-vault-search"
                | "customer-pricing-schedule-get"
                | "reward-event-names"
                | "reward-event-config"
                | "product-search"
                | "product-fee-rule-search"
                | "product-limit-rule-search"
                | "product-activation-rule-search"
                | "product-vendor-search"
                | "product-route-search"
                | "transaction-admin-search"
                | "transaction-admin-count"
                | "entity-product-search"
                | "entity-document-upload"
                | "bank-search"
                | "bank-document-search"
                | "bank-transaction-search"
                | "program-search"
                | "bank-instant-payment-eligibility-get"
                | "fed-ach-dir-search"
                | "fed-participant-dir-search"
                | "swift-bic-get"
                | "swift-rtn-get"
                | "wallet-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"
                | "sms-template-search"
                | "slack-template-search"
                | "sms-template-version"
                | "admin-step-up"
                | "api-key-auth-cache"
                | "victor-auth-token"
                | "fib-session"
                | "dashboard-session";
        }

      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[] } },
      >