import type { BillingTypes } from "@cargo-ai/types"; import { z } from "zod"; import type { ApiType, DateToString } from "../types.js"; export declare namespace Billing { type Subscription = ApiType; type EnrichedSubscription = ApiType; type SubscriptionCreditsOverageBehavior = ApiType; type Invoice = ApiType; type CreditCard = ApiType; type SubscriptionCadence = ApiType; type UsageMetric = ApiType; type UsageUnit = ApiType; type CreditsCost = ApiType; namespace Api { type GetSubscriptionResult = { subscription: EnrichedSubscription; }; type GetInvoicesResult = { invoices: Invoice[]; }; type GetCreditCardResult = { creditCard: CreditCard | undefined; }; type UpdatePaymentMethodPayload = DateToString<{ paymentMethodId: string; }>; const zodUpdatePaymentMethodResultErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; paymentMethodNotFound: "paymentMethodNotFound"; cardDeclined: "cardDeclined"; authenticationRequired: "authenticationRequired"; }>; type GetStripePublishableKeyResult = { publishableKey: string; }; const zodGetStripePublishableKeyErrorReason: z.ZodEnum<{ publishableKeyNotConfigured: "publishableKeyNotConfigured"; }>; type CreateSetupIntentResult = { setupIntent: { clientSecret: string; }; }; const zodCreateSetupIntentResultErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; failedToCreateSetupIntent: "failedToCreateSetupIntent"; }>; type CreatePortalSessionResult = { portalSession: { url: string; }; }; const zodCreatePortalSessionErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; }>; type CreatePaymentMethodPortalSessionResult = { portalSession: { url: string; }; }; const zodCreatePaymentMethodPortalSessionErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; }>; type UpdatePlanPayload = DateToString<{ creditsCount: number; cadence: BillingTypes.SubscriptionCadence; }>; type UpdatePlanResult = { subscription: EnrichedSubscription; }; const zodUpdatePlanResultErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; paymentMethodNotFound: "paymentMethodNotFound"; customerNotFound: "customerNotFound"; scheduleSubscriptionChangeFailed: "scheduleSubscriptionChangeFailed"; subscriptionNotElligible: "subscriptionNotElligible"; subscriptionAlreadyInUpdateState: "subscriptionAlreadyInUpdateState"; customerNotMigratedToOrb: "customerNotMigratedToOrb"; }>; type UpdateTopupPayload = DateToString<{ enabled: boolean; creditsCount: number; threshold: number; }>; type UpdateTopupResult = { subscription: EnrichedSubscription; }; const zodUpdateTopupResultErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; paymentMethodNotFound: "paymentMethodNotFound"; customerNotFound: "customerNotFound"; subscriptionNotElligible: "subscriptionNotElligible"; customerNotMigratedToOrb: "customerNotMigratedToOrb"; }>; type UpdateCreditsOverageBehaviorsPayload = DateToString<{ creditsOverageBehaviors: BillingTypes.SubscriptionCreditsOverageBehavior[]; }>; const zodUpdateCreditsOverageBehaviorsResultErrorReason: z.ZodEnum<{ subscriptionNotFound: "subscriptionNotFound"; subscriptionNotEnterprise: "subscriptionNotEnterprise"; }>; type UsageMetricsPayload = DateToString<{ workflowUuid?: string; modelUuid?: string; connectorUuid?: string; integrationSlug?: string; slug?: string; agentUuid?: string; from: string; to: string; groupBy?: "integration_slug" | "connector_uuid" | "model_uuid" | "workflow_uuid" | "agent_uuid"; unit?: BillingTypes.UsageUnit; }>; type UsageMetricsResult = { metrics: UsageMetric[]; }; } const subscriptionsKeys: { get: (workspaceUuid: string) => readonly ["subscriptions", string]; getInvoices: (workspaceUuid: string) => readonly ["subscriptions", string, "getInvoices"]; getCreditCard: (workspaceUuid: string) => readonly ["subscriptions", string, "getCreditCard"]; createSetupIntent: (workspaceUuid: string) => readonly ["subscriptions", string, "createSetupIntent"]; }; const usagesKeys: { all: (workspaceUuid: string) => readonly ["usages", string]; getMetrics: (workspaceUuid: string, payload: Api.UsageMetricsPayload) => readonly ["usages", string, "getMetrics", { workflowUuid?: string | undefined; modelUuid?: string | undefined; connectorUuid?: string | undefined; integrationSlug?: string | undefined; slug?: string | undefined; agentUuid?: string | undefined; from: string; to: string; groupBy?: "integration_slug" | "connector_uuid" | "model_uuid" | "workflow_uuid" | "agent_uuid" | undefined; unit?: BillingTypes.UsageUnit | undefined; }]; }; } //# sourceMappingURL=billing.d.ts.map