@suluk/cost - v0.2.0
    Preparing search index...

    Function attributePrincipal

    • Resolve the principal charged for a fired event per the model's attribution strategy. Returns the @unattributed sentinel (never silent) when nothing resolves: session/job-stamped use the supplied principal; event-expression reads it from the payload. NOTE: an event-expression with trust !== "verified" is attacker-controllable — the caller MUST gate it behind a verified webhook signature before trusting the result for billing.

      Parameters

      • model: CostModel
      • event: Record<string, unknown>
      • OptionalsuppliedPrincipal: string

      Returns string