/** * A JsmClient that charges the invocation's budget for every request. * * The alternative was threading a CallContext through `resolveScheduleId`, * `answerOnCall`, `fetchTimeline` and `resolveIdentities` so each could charge * for itself. That spreads the budget across five files and makes "did you * remember to charge?" a question every future helper has to get right — and a * composite that forgot would be a way around the request budget, which is the * one guarantee the budget exists to make. * * Wrapping the client instead moves the question somewhere it cannot be * forgotten: a request that is not charged is a request that was not made. * * Each public method is wrapped explicitly rather than by a Proxy. A Proxy * would have to rebind `this` so that `getCollection`'s internal `this.request` * re-entered the wrapper, which both double-charges and depends on a detail of * how JsmClient happens to be written today. Delegating to the real method * charges exactly once, per public call, and reads as what it is. * * A test asserts this wraps every public method JsmClient has, so a method * added later cannot quietly bypass the budget. */ import type { JsmClient } from "../../services/client.js"; import type { CallContext } from "./context.js"; /** The public surface this has to cover. Kept in one place for the test to read. */ export declare const BUDGETED_METHODS: readonly ["request", "getCollection", "getOne", "jiraGet"]; export declare function budgetedClient(client: JsmClient, ctx: CallContext): JsmClient; //# sourceMappingURL=budgeted-client.d.ts.map