autumn-js
Version:
Autumn JS Library
96 lines (92 loc) • 2.67 kB
text/typescript
import { P as ProductItemInterval, A as AppEnv } from './prodEnums-C1lccCWI.mjs';
declare enum ProductStatus {
Active = "active",
Expired = "expired",
Trialing = "trialing",
Scheduled = "scheduled",
PastDue = "past_due"
}
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities";
interface CustomerFeature {
id: string;
name: string;
unlimited?: boolean;
interval?: ProductItemInterval | null;
balance?: number;
usage?: number;
included_usage?: number;
next_reset_at?: number | null;
breakdown?: {
interval: ProductItemInterval;
balance?: number;
usage?: number;
included_usage?: number;
next_reset_at?: number;
}[];
}
interface CustomerProduct {
id: string;
name: string | null;
group: string | null;
status: ProductStatus;
started_at: number;
canceled_at: number | null;
subscription_ids?: string[] | null;
current_period_start?: number | null;
current_period_end?: number | null;
trial_ends_at?: number;
entity_id?: string;
is_add_on: boolean;
is_default: boolean;
}
interface Customer {
id: string | null;
created_at: number;
name: string | null;
email: string | null;
fingerprint: string | null;
stripe_id: string | null;
env: AppEnv;
metadata: Record<string, any>;
products: CustomerProduct[];
features: Record<string, CustomerFeature>;
invoices?: CustomerInvoice[];
}
interface CustomerData {
name?: string;
email?: string;
fingerprint?: string;
}
interface GetCustomerParams {
expand?: CustomerExpandOption[];
}
interface CreateCustomerParams {
id?: string | null;
email?: string | null;
name?: string | null;
fingerprint?: string | null;
metadata?: Record<string, any>;
expand?: CustomerExpandOption[];
}
interface UpdateCustomerParams {
id?: string | null;
name?: string | null;
email?: string | null;
fingerprint?: string | null;
}
interface BillingPortalParams {
return_url?: string;
}
interface BillingPortalResponse {
customer_id: string;
url: string;
}
interface CustomerInvoice {
product_ids: string[];
stripe_id: string;
status: string;
total: number;
currency: string;
created_at: number;
}
export { type BillingPortalParams as B, type Customer as C, type GetCustomerParams as G, ProductStatus as P, type UpdateCustomerParams as U, type CreateCustomerParams as a, type BillingPortalResponse as b, type CustomerFeature as c, type CustomerProduct as d, type CustomerData as e, type CustomerInvoice as f, type CustomerExpandOption as g };