import { ActionProcedureDescriptor } from '@voltro/protocol'; import { PluginRpcClientDescriptor } from '@voltro/protocol'; import { QueryProcedureDescriptor } from '@voltro/protocol'; import { Schema } from 'effect'; import { YieldableError } from 'effect/Cause'; /** * A billing failure. `transient: true` marks failures the service retries * (network blip talking to the provider); non-transient failures (a 4xx * from the provider, a misconfigured plan) are surfaced immediately. The * `billingPlugin` registers this via `errorSchemas` so it decodes TYPED on * the client rather than crossing as an untyped defect. */ declare class BillingError extends BillingError_base { } declare const BillingError_base: Schema.Class, YieldableError>; /** Declared for the codegen (`VoltroPlugin.rpcClientDescriptors`) so each tag is * emitted into the generated client group. Kept in lockstep with the exports. */ export declare const billingRpcClientImports: ReadonlyArray; /** The customer's own cancellation: active until the paid period ends, then * ended. `cancelAt` on the answer is when. */ export declare const cancelSubscriptionDescriptor: ActionProcedureDescriptor<"billing.cancel", Schema.Struct<{}>, Schema.Struct<{ readonly subscription: Schema.Struct<{ readonly plan: Schema.String; readonly status: Schema.String; readonly quantity: Schema.Number; readonly currentPeriodEnd: Schema.NullOr; readonly cancelAt: Schema.NullOr; }>; }>, typeof BillingError>; export declare const changePlanDescriptor: ActionProcedureDescriptor<"billing.changePlan", Schema.Struct<{ readonly plan: Schema.String; }>, Schema.Struct<{ readonly plan: Schema.String; readonly quantity: Schema.Number; /** Integer minor-unit settlement: > 0 charge, < 0 credit, 0 at boundary. */ readonly prorationMinor: Schema.Number; readonly currency: Schema.String; }>, typeof BillingError>; export declare const changeSeatsDescriptor: ActionProcedureDescriptor<"billing.changeSeats", Schema.Struct<{ readonly quantity: Schema.Number; }>, Schema.Struct<{ readonly plan: Schema.String; readonly quantity: Schema.Number; /** Integer minor-unit settlement: > 0 charge, < 0 credit, 0 at boundary. */ readonly prorationMinor: Schema.Number; readonly currency: Schema.String; }>, typeof BillingError>; /** * "Is this tenant entitled right now?" — the dunning-aware answer a billing * banner needs. `entitled: false` means the grace period expired; `inGrace` * with a `graceEndsAt` is the "your payment failed, you have until …" state. * Timestamps are ISO strings (the descriptor's Schema is String, so a Date * would fail encode at the boundary). */ export declare const entitlementStatusDescriptor: QueryProcedureDescriptor<"billing.entitlementStatus", Schema.Struct<{}>, Schema.Struct<{ readonly plan: Schema.String; readonly billedPlan: Schema.String; readonly status: Schema.String; readonly entitled: Schema.Boolean; readonly inGrace: Schema.Boolean; readonly graceEndsAt: Schema.NullOr; readonly lockedSince: Schema.NullOr; readonly lockout: Schema.String; }>, typeof BillingError>; /** The provider's invoice history. `hostedUrl` / `pdfUrl` are the provider's * own pages — we never render an invoice ourselves. */ export declare const invoicesDescriptor: QueryProcedureDescriptor<"billing.invoices", Schema.Struct<{}>, Schema.Struct<{ readonly invoices: Schema.$Array; readonly hostedUrl: Schema.NullOr; readonly pdfUrl: Schema.NullOr; }>>; }>, typeof BillingError>; export declare const portalUrlDescriptor: ActionProcedureDescriptor<"billing.portalUrl", Schema.Struct<{ readonly returnUrl: Schema.String; }>, Schema.Struct<{ readonly url: Schema.String; }>, typeof BillingError>; /** What a plan/seat change would cost, from the provider's invoice preview. * Quote THIS in a confirmation dialog — a locally-estimated figure differs * from the charge by the provider's rounding, tax and credit balance. */ export declare const previewChangeDescriptor: ActionProcedureDescriptor<"billing.previewChange", Schema.Struct<{ readonly plan: Schema.optional; readonly quantity: Schema.optional; }>, Schema.Struct<{ readonly plan: Schema.String; readonly quantity: Schema.Number; /** Integer minor-unit settlement: > 0 charge, < 0 credit, 0 at boundary. */ readonly prorationMinor: Schema.Number; readonly currency: Schema.String; }>, typeof BillingError>; export declare const reportUsageDescriptor: ActionProcedureDescriptor<"billing.reportUsage", Schema.Struct<{ readonly key: Schema.String; readonly quantity: Schema.Number; }>, Schema.Struct<{ readonly ok: Schema.Boolean; }>, typeof BillingError>; /** Take back a cancellation before the period ends. */ export declare const resumeSubscriptionDescriptor: ActionProcedureDescriptor<"billing.resume", Schema.Struct<{}>, Schema.Struct<{ readonly subscription: Schema.Struct<{ readonly plan: Schema.String; readonly status: Schema.String; readonly quantity: Schema.Number; readonly currentPeriodEnd: Schema.NullOr; readonly cancelAt: Schema.NullOr; }>; }>, typeof BillingError>; export declare const startCheckoutDescriptor: ActionProcedureDescriptor<"billing.startCheckout", Schema.Struct<{ readonly plan: Schema.String; readonly successUrl: Schema.String; readonly cancelUrl: Schema.String; /** Seats to buy up front. Omit for 1. */ readonly quantity: Schema.optional; }>, Schema.Struct<{ readonly url: Schema.String; }>, typeof BillingError>; export declare const subscriptionDescriptor: QueryProcedureDescriptor<"billing.subscription", Schema.Struct<{}>, Schema.Struct<{ readonly subscription: Schema.NullOr; readonly cancelAt: Schema.NullOr; }>>; }>, typeof BillingError>; /** The checkpoint: sync the caller's tenant from the provider and answer with * its current subscription. Call it on the return from checkout or the * portal, and when a billing page loads. */ export declare const syncDescriptor: ActionProcedureDescriptor<"billing.sync", Schema.Struct<{}>, Schema.Struct<{ readonly subscription: Schema.NullOr; readonly cancelAt: Schema.NullOr; }>>; }>, typeof BillingError>; export { }