autumn-js
Version:
Autumn JS Library
74 lines (69 loc) • 2.21 kB
text/typescript
import { a as ProductItem, P as Product } from './prodTypes-G6W3NUPg.mjs';
import { z } from 'zod/v4';
declare const AttachFeatureOptionsSchema: z.ZodObject<{
feature_id: z.ZodString;
quantity: z.ZodNumber;
}, z.core.$strip>;
type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
declare const AttachResultSchema: z.ZodObject<{
checkout_url: z.ZodOptional<z.ZodString>;
customer_id: z.ZodString;
product_ids: z.ZodArray<z.ZodString>;
code: z.ZodString;
message: z.ZodString;
customer_data: z.ZodOptional<z.ZodAny>;
invoice: z.ZodOptional<z.ZodObject<{
status: z.ZodString;
stripe_id: z.ZodString;
hosted_invoice_url: z.ZodNullable<z.ZodString>;
total: z.ZodNumber;
currency: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
type AttachResult = z.infer<typeof AttachResultSchema>;
type CheckoutResult = {
url?: string;
customer_id: string;
has_prorations: boolean;
lines: {
description: string;
amount: number;
item: ProductItem;
}[];
total: number;
currency: string;
options: AttachFeatureOptions[];
product: Product;
current_product: Product;
free_trial?: boolean;
next_cycle?: {
starts_at: number;
total: number;
};
};
interface CreateReferralCodeResult {
code: string;
customer_id: string;
created_at: number;
}
interface RedeemReferralCodeResult {
id: string;
customer_id: string;
reward_id: string;
referrer: {
id: string;
name: string | null;
email: string | null;
};
}
declare const CreateEntityParamsSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodOptional<z.ZodString>;
featureId: z.ZodString;
}, z.core.$strip>;
type CreateEntityParams = z.infer<typeof CreateEntityParamsSchema>;
declare const GetEntityParamsSchema: z.ZodObject<{
expand: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
type GetEntityParams = z.infer<typeof GetEntityParamsSchema>;
export type { AttachResult as A, CheckoutResult as C, GetEntityParams as G, RedeemReferralCodeResult as R, CreateEntityParams as a, CreateReferralCodeResult as b };