UNPKG

autumn-js

Version:

Autumn JS Library

105 lines (102 loc) 2.74 kB
import { e as CustomerData } from './cusTypes-BTV6ui4e.js'; import { b as EntityData } from './entTypes-BwLV9Jn4.js'; import { CheckProductFormattedPreview, CheckFeatureFormattedPreview } from './check.js'; import './prodEnums-C1lccCWI.js'; import './products.js'; interface AttachFeatureOptions { feature_id: string; quantity: number; } interface AttachParams { customer_id: string; product_id?: string; entity_id?: string; options?: AttachFeatureOptions[]; product_ids?: string[]; free_trial?: boolean; success_url?: string; metadata?: Record<string, string>; force_checkout?: boolean; customer_data?: CustomerData; entity_data?: EntityData; checkout_session_params?: Record<string, any>; reward?: string; } interface CancelParams { customer_id: string; product_id: string; entity_id?: string; cancel_immediately?: boolean; } interface CancelResult { success: boolean; customer_id: string; product_id: string; } interface AttachResult { checkout_url?: string; customer_id: string; product_ids: string[]; code: string; message: string; customer_data?: CustomerData; } interface TrackParams { customer_id: string; value?: number; feature_id?: string; event_name?: string; entity_id?: string; customer_data?: CustomerData; idempotency_key?: string; entity_data?: EntityData; } interface TrackResult { id: string; code: string; customer_id: string; feature_id?: string; event_name?: string; } interface CheckParams { customer_id: string; feature_id?: string; product_id?: string; entity_id?: string; customer_data?: CustomerData; required_balance?: number; send_event?: boolean; with_preview?: "raw" | "formatted"; entity_data?: EntityData; } interface CheckResult { customer_id: string; allowed: boolean; code: string; feature_id?: string; required_balance?: number; unlimited?: boolean; balance?: number | null; product_id?: string; status?: string; preview?: CheckProductFormattedPreview | CheckFeatureFormattedPreview; } interface EntitledBalance { feature_id: string; unlimited: boolean; balance: number | null; usage_allowed: boolean; required?: number | null; } interface UsageParams { customer_id: string; feature_id: string; value: number; customer_data?: CustomerData; } interface UsageResult { code: string; customer_id: string; feature_id: string; } export type { AttachFeatureOptions, AttachParams, AttachResult, CancelParams, CancelResult, CheckParams, CheckResult, EntitledBalance, TrackParams, TrackResult, UsageParams, UsageResult };