import type { Answer, CheckoutParams, CheckoutResponse, CurrentPhase, FeatureName, Features, Limits, LookupOrgResponse, Model, OrgInfo, OrgName, PaymentMethodsResponse, Phase, PushResponse, ReportParams, ScheduleParams, ScheduleResponse, SubscribeParams, TierGetClientOptions, TierWithClock, Usage, WhoAmIResponse, WhoIsResponse } from './client.js'; import { Tier } from './client.js'; /** * Pull the full {@link types.Model} pushed to Tier * * Convenience wrapper for {@link client.Tier.pull | Tier.pull} */ export declare function pull(clientOptions?: TierGetClientOptions): Promise; /** * Similar to {@link client.Tier.pull}, but filters plans to only include * the highest version of each plan. Plan versions are sorted numerically * if they are decimal integers, or lexically in the `en` locale otherwise. * * So, for example, the plan version `20test` will be considered "lower" * than `9test`, because the non-numeric string causes it to be lexically * sorted. But the plan version `20` sill be considered "higher" than the * plan version `9`, because both are strictly numeric. * * Convenience wrapper for {@link client.Tier.pullLatest | Tier.pullLatest} * * **Note** Plan versions are inherently arbitrary, and as such, they really * should not be sorted or given any special priority by being "latest". * * This method will be removed in version 6 of this SDK. * * @deprecated */ export declare function pullLatest(clientOptions?: TierGetClientOptions): Promise; /** * Look up the limits for all features for a given {@link types.OrgName} * * Convenience wrapper for {@link client.Tier.lookupLimits | Tier.lookupLimits} */ export declare function lookupLimits(org: OrgName, clientOptions?: TierGetClientOptions): Promise; /** * Look up limits for a given {@link types.FeatureName} and {@link types.OrgName} * * Convenience wrapper for {@link client.Tier.lookupLimit | Tier.lookupLimit} */ export declare function lookupLimit(org: OrgName, feature: FeatureName, clientOptions?: TierGetClientOptions): Promise; /** * Report metered feature usage * * Convenience wrapper for {@link client.Tier.report | Tier.report} */ export declare function report(org: OrgName, feature: FeatureName, n?: number, options?: ReportParams, clientOptions?: TierGetClientOptions): Promise<{}>; /** * Return an {@link answer.Answer} indicating whether an org can * access a feature, or if they are at their plan limit. * * Convenience wrapper for {@link client.Tier.can | Tier.can} */ export declare function can(org: OrgName, feature: FeatureName, clientOptions?: TierGetClientOptions): Promise; /** * Generate a checkout URL to set an org's payment info, and optionally * to create a subscription on completion. * * `successUrl` param should be a URL within your application where the * user will be redirected upon completion. * * Convenience wrapper for {@link client.Tier.checkout | Tier.checkout} */ export declare function checkout(org: OrgName, successUrl: string, { cancelUrl, features, trialDays }?: CheckoutParams, clientOptions?: TierGetClientOptions): Promise; /** * Simple interface for creating a new phase in the org's subscription * schedule. * * Setting `trialDays` will cause it to prepend a "trial" phase on the * effective date, and delay the creation of the actual non-trial * subscription phase by the specified number of days. * * Convenience wrapper for {@link client.Tier.subscribe | Tier.subscribe} */ export declare function subscribe(org: OrgName, features: Features | Features[], { effective, info, trialDays }?: SubscribeParams, clientOptions?: TierGetClientOptions): Promise; /** * Cancel an org's subscriptions * * Convenience wrapper for {@link client.Tier.cancel | Tier.cancel} */ export declare function cancel(org: OrgName, clientOptions?: TierGetClientOptions): Promise; /** * Advanced interface for creating arbitrary schedule phases in any * order. * * Convenience wrapper for {@link client.Tier.schedule | Tier.schedule} */ export declare function schedule(org: OrgName, phases?: Phase[], { info }?: ScheduleParams, clientOptions?: TierGetClientOptions): Promise; /** * Update an org's metadata. Note that any fields not set (other than * `metadata`) will be reset to empty `''` values on any update. * * Convenience wrapper for {@link client.Tier.updateOrg | Tier.updateOrg} */ export declare function updateOrg(org: OrgName, info: OrgInfo): Promise; /** * Get an org's billing provider identifier * * Convenience wrapper for {@link client.Tier.whois | Tier.whois} */ export declare function whois(org: OrgName): Promise; /** * Look up all {@link types.OrgInfo} metadata about an org * * Convenience wrapper for {@link client.Tier.lookupOrg | Tier.lookupOrg} */ export declare function lookupOrg(org: OrgName): Promise; /** * Look up all the Payment Methods available for a given {@link types.OrgName} * * Convenience wrapper for {@link client.Tier.lookupPaymentMethods | Tier.lookupPaymentMethods} */ export declare function lookupPaymentMethods(org: OrgName): Promise; /** * Get information about the current sidecare API in use * * Convenience wrapper for {@link client.Tier.whoami | Tier.whoami} */ export declare function whoami(): Promise; /** * Fetch the current phase for an org * * Convenience wrapper for {@link client.Tier.lookupPhase | Tier.lookupPhase} */ export declare function lookupPhase(org: OrgName): Promise; /** * Push a new {@link types.Model} to Tier * * Any previously pushed {@link types.PlanName} will be ignored, new * plans will be added. * * Convenience wrapper for {@link client.Tier.push | Tier.push} */ export declare function push(model: Model): Promise; /** * Return a new Tier client that has a test clock */ export declare function withClock(name: string, start?: Date, options?: TierGetClientOptions): Promise; /** * Get a client with the settings from the environment */ export declare function fromEnv(options?: TierGetClientOptions): Promise; export * from './client.js'; export type { TierGetClientOptions, TierWithClock } from './client.js'; export type { Aggregate, CancelPhase, CheckoutParams, CheckoutResponse, CurrentPhase, CurrentPhaseResponse, Divide, FeatureDefinition, FeatureName, FeatureNameVersioned, Features, FeatureTier, Interval, Limits, LookupOrgResponse, Mode, Model, OrgInfo, OrgName, PaymentMethodsResponse, Phase, Plan, PlanName, PushResponse, ReportParams, ReportResponse, ScheduleParams, ScheduleResponse, SubscribeParams, Usage, WhoAmIResponse, WhoIsResponse, } from './tier-types.js'; /** * @deprecated alias for lookupLimits */ export declare function limits(org: OrgName): Promise; /** * @deprecated alias for lookupLimit */ export declare function limit(org: OrgName, feature: FeatureName): Promise; /** * @deprecated alias for lookupPhase */ export declare function phase(org: OrgName): Promise; declare const TIER: { isErrorResponse: (e: any) => e is import("./tier-error.js").ErrorResponse; isFeatureName: (f: any) => f is `feature:${string}`; isFeatureNameVersioned: (f: any) => f is `feature:${string}@plan:${string}@${string}`; isFeatures: (f: any) => f is Features; isOrgName: (o: any) => o is `org:${string}`; isPhase: (p: any) => p is Phase; isPlanName: (p: any) => p is `plan:${string}@${string}`; isTierError: (e: any) => e is import("./tier-error.js").TierError; validateFeatureDefinition: (f: any) => void; validateFeatureTier: (t: any) => void; validateModel: (m: any) => asserts m is Model; validatePlan: (p: any) => void; Tier: typeof Tier; can: typeof can; cancel: typeof cancel; checkout: typeof checkout; lookupLimit: typeof lookupLimit; lookupLimits: typeof lookupLimits; lookupOrg: typeof lookupOrg; lookupPaymentMethods: typeof lookupPaymentMethods; lookupPhase: typeof lookupPhase; pull: typeof pull; push: typeof push; report: typeof report; schedule: typeof schedule; subscribe: typeof subscribe; updateOrg: typeof updateOrg; whoami: typeof whoami; whois: typeof whois; withClock: typeof withClock; fromEnv: typeof fromEnv; pullLatest: typeof pullLatest; limit: typeof limit; limits: typeof limits; phase: typeof phase; }; export default TIER; //# sourceMappingURL=index.d.ts.map