import type { GraphQLClient } from '../client.js'; import { type SharedEnvPlansQuery, type OrgFreeAppQuotaQuery, type AppSharedSubscriptionQuery, type AppRuntimeStateQuery, type OrgAutoBillingQuery, type OrgPaymentMethodsQuery, type PublishAppToSharedMutation, type CancelSharedSubscriptionMutation, type SetAppSpendCapsMutation, type SetAutoBillingMutation, type SetupSharedPaymentMethodMutation, type RemoveSharedPaymentMethodMutation, type PaymentProvider } from '../generated/graphql.js'; /** * Shared-environment app publishing, runtime gating, spend caps, and * auto-billing — exposed as `client.sharedEnvironment` (and grouped under * `client.admin`). * * Part of the management surface. {@link plans} is public; the read operations * require org membership; spend-cap / auto-billing / subscription mutations * require the `manage_billing` org permission; {@link publishApp} currently * requires super-admin (preview). Monetary values are `*Cents` (minor units). * * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING` * per the permission notes above; `IDEMPOTENCY_CONFLICT` on key reuse with * different args. */ export declare class SharedEnvironmentAPI { private readonly api; constructor(api: GraphQLClient); /** * Public catalog of paid shared-environment app-slot plans. * * @returns The available plans. */ plans(): Promise; /** * An org's free shared-app slot quota and usage. Caller must be an org member. * * @param orgId - Numeric org id. * @returns The {@link FreeAppQuota}. */ freeAppQuota(orgId: string): Promise; /** * An app's paid shared subscription, or `null` when on the free quota. * * @param appId - Numeric app id. * @returns The {@link AppSharedSubscription} or `null`. */ appSubscription(appId: string): Promise; /** * The shared-environment runtime gate + current usage for an app. * * @param appId - Numeric app id. * @returns The {@link AppRuntimeState}. */ appRuntimeState(appId: string): Promise; /** * An org's off-session auto-billing configuration. * * @param orgId - Numeric org id. * @returns The {@link OrgAutoBilling} config. */ autoBilling(orgId: string): Promise; /** * List an org's saved (vaulted) payment methods. * * @param orgId - Numeric org id. * @returns The saved payment methods. */ paymentMethods(orgId: string): Promise; /** * Publish an app to the shared game-api. Free under the org quota (no charge); * pass `planId` for a paid subscription (returns a checkout to complete). * Currently super-admin only (preview). * * @param appId - Numeric app id. * @param opts - Optional `planId`, `provider`, `successUrl`, `cancelUrl`, and * `idempotencyKey`. * @returns The {@link PublishAppResult} (free flag + optional checkout). */ publishApp(appId: string, opts?: { planId?: string; provider?: PaymentProvider; successUrl?: string; cancelUrl?: string; idempotencyKey?: string; }): Promise; /** * Cancel an app's paid shared subscription. Requires `manage_billing`. * * @param appId - Numeric app id. * @param idempotencyKey - Optional idempotency key for safe retries. * @returns The updated {@link AppSharedSubscription}. */ cancelSubscription(appId: string, idempotencyKey?: string): Promise; /** * Set per-app hourly/daily spend caps (cents); `null` clears a cap. Requires * `manage_billing`. Returns the re-evaluated runtime state. * * @param appId - Numeric app id. * @param caps - `hourlyLimitCents` and/or `dailyLimitCents` (decimal strings). * @returns The updated {@link AppRuntimeState}. */ setSpendCaps(appId: string, caps?: { hourlyLimitCents?: string | null; dailyLimitCents?: string | null; }): Promise; /** * Enable/disable and configure off-session auto-billing for an org. Requires * `manage_billing`. * * @param orgId - Numeric org id. * @param config - `enabled` plus optional `limitCents`, `rechargeAmountCents`, * `lowWaterThresholdCents`, and `idempotencyKey`. * @returns The updated {@link OrgAutoBilling} config. */ setAutoBilling(orgId: string, config: { enabled: boolean; limitCents?: string | null; rechargeAmountCents?: string | null; lowWaterThresholdCents?: string | null; idempotencyKey?: string; }): Promise; /** * Begin vaulting a card for off-session auto-billing (returns a Stripe * SetupIntent client secret). No charge here. Requires `manage_billing`. * * @param orgId - Numeric org id. * @param idempotencyKey - Optional idempotency key. * @returns The {@link PaymentMethodSetup} handle. */ setupPaymentMethod(orgId: string, idempotencyKey?: string): Promise; /** * Remove a saved payment method from an org. Requires `manage_billing`. * * @param orgId - Numeric org id. * @param paymentMethodId - Numeric id of the saved method to remove. * @param idempotencyKey - Optional idempotency key. * @returns `true` on success. */ removePaymentMethod(orgId: string, paymentMethodId: string, idempotencyKey?: string): Promise; } //# sourceMappingURL=sharedEnvironment.d.ts.map