import type { GraphQLClient } from '../client.js'; import { type WalletBalanceQuery, type WalletTransactionsQuery, type WalletTransactionsConnectionQuery, type WalletTransactionsConnectionQueryVariables, type AppBudgetQuery, type AppBudgetsQuery, type SetAppBudgetMutation } from '../generated/graphql.js'; /** * Org wallet + per-app budgets — exposed as `client.billing` (and grouped under * `client.admin`). * * Part of the management surface. Reads require the `view_billing` org/app * permission; {@link setAppBudget} requires `manage_billing`. Monetary values * are minor currency units (`*Cents`) and serialized as `BigInt` decimal * strings. * * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING` * per the permission notes above. */ export declare class BillingAPI { private readonly api; constructor(api: GraphQLClient); /** * Return an organization's wallet balance. Requires the `view_billing` org * permission. * * @param orgId - Numeric org id (`BigInt` as a decimal string). * @returns The wallet balance (cents as a decimal string). */ walletBalance(orgId: string): Promise; /** * List an organization's wallet transactions (newest first). Requires the * `view_billing` org permission. * * @param orgId - Numeric org id. * @param opts - Optional `limit` / `offset` (default limit 50). * @returns The wallet transactions. */ walletTransactions(orgId: string, opts?: { limit?: number; offset?: number; }): Promise; /** * Return the spend budget for one app. Requires the `view_billing` app * permission. * * @param orgId - Numeric org id that owns the app. * @param appId - Numeric app id. * @returns The app budget, or `null` if unset. */ appBudget(orgId: string, appId: string): Promise; /** * List the spend budgets for every app under an org. Requires the * `view_billing` org permission. * * @param orgId - Numeric org id. * @returns The app budgets. */ appBudgets(orgId: string): Promise; /** * Set (or clear) an app's monthly spend cap. Requires the `manage_billing` * app permission. * * @param orgId - Numeric org id. * @param appId - Numeric app id. * @param monthlyLimitCents - Monthly cap in minor currency units (decimal * string); `"0"` disables the cap. * @returns The updated app budget. */ setAppBudget(orgId: string, appId: string, monthlyLimitCents: string): Promise; /** * Relay-style cursor pagination over an org's wallet transactions — the * preferred alternative to {@link walletTransactions}. Requires the * `view_billing` org permission. See * https://docs.crowdedkingdoms.com/overview/pagination. * * @param args - `orgId` plus optional `first` and `after`. * @returns A wallet-transactions connection. */ walletTransactionsConnection(args: WalletTransactionsConnectionQueryVariables): Promise; } //# sourceMappingURL=billing.d.ts.map