import * as _fragno_dev_core10 from "@fragno-dev/core"; import * as _fragno_dev_core0 from "@fragno-dev/core"; import { FragnoRouteConfig } from "@fragno-dev/core"; import * as zod199 from "zod"; import { z } from "zod"; import * as zod_v4_core14 from "zod/v4/core"; import * as _fragno_dev_core_api2 from "@fragno-dev/core/api"; import * as _fragno_dev_core_client0 from "@fragno-dev/core/client"; import { FragnoPublicClientConfig } from "@fragno-dev/core/client"; import * as _standard_schema_spec0 from "@standard-schema/spec"; import * as _fragno_dev_db56 from "@fragno-dev/db"; import * as _fragno_dev_db42 from "@fragno-dev/db"; import * as _fragno_dev_db0 from "@fragno-dev/db"; import { FragnoPublicConfigWithDatabase } from "@fragno-dev/db"; import * as stripe0 from "stripe"; import Stripe from "stripe"; import * as _fragno_dev_db_query0 from "@fragno-dev/db/query"; import { TableToInsertValues } from "@fragno-dev/db/query"; import * as _fragno_dev_db_schema125 from "@fragno-dev/db/schema"; import * as _fragno_dev_db_schema93 from "@fragno-dev/db/schema"; import * as _fragno_dev_db_schema0 from "@fragno-dev/db/schema"; import * as _fragno_dev_db_fragment_definition_builder0$1 from "@fragno-dev/db/fragment-definition-builder"; import * as _fragno_dev_db_fragment_definition_builder0 from "@fragno-dev/db/fragment-definition-builder"; //#region src/database/schema.d.ts /** * Database schema for subscriptions that are linked to external stripe subscriptions. */ declare const stripeSchema: _fragno_dev_db_schema125.Schema & Record<"id", _fragno_dev_db_schema125.IdColumn<"varchar(30)", string | _fragno_dev_db_schema125.FragnoId | null, _fragno_dev_db_schema125.FragnoId>> & Record<"referenceId", _fragno_dev_db_schema125.Column<"string", string | null, string | null>> & Record<"stripePriceId", _fragno_dev_db_schema125.Column<"string", string, string>> & Record<"stripeCustomerId", _fragno_dev_db_schema125.Column<"string", string, string>> & Record<"stripeSubscriptionId", _fragno_dev_db_schema125.Column<"string", string, string>> & Record<"status", _fragno_dev_db_schema125.Column<"string", string | null, string>> & Record<"periodStart", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date | null>> & Record<"periodEnd", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date | null>> & Record<"trialStart", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date | null>> & Record<"trialEnd", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date | null>> & Record<"cancelAtPeriodEnd", _fragno_dev_db_schema125.Column<"bool", boolean | null, boolean>> & Record<"cancelAt", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date | null>> & Record<"seats", _fragno_dev_db_schema125.Column<"integer", number | null, number | null>> & Record<"createdAt", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema125.Column<"timestamp", (_fragno_dev_db56.DbNow | Date) | null, Date>>, Record, Record> & Record<"idx_stripe_customer_id", _fragno_dev_db_schema125.Index] & _fragno_dev_db_schema125.AnyColumn[], readonly ["stripeCustomerId"]>> & Record<"idx_stripe_subscription_id", _fragno_dev_db_schema125.Index] & _fragno_dev_db_schema125.AnyColumn[], readonly ["stripeSubscriptionId"]>> & Record<"idx_reference_id", _fragno_dev_db_schema125.Index] & _fragno_dev_db_schema125.AnyColumn[], readonly ["referenceId"]>>>>>; //# sourceMappingURL=schema.d.ts.map //#endregion //#region src/models/subscriptions.d.ts declare const SubscriptionReponseSchema: z.ZodObject<{ id: z.ZodString; stripeSubscriptionId: z.ZodString; stripeCustomerId: z.ZodString; stripePriceId: z.ZodString; referenceId: z.ZodNullable; status: z.ZodEnum<{ incomplete: "incomplete"; active: "active"; canceled: "canceled"; incomplete_expired: "incomplete_expired"; past_due: "past_due"; paused: "paused"; trialing: "trialing"; unpaid: "unpaid"; }>; periodStart: z.ZodNullable; periodEnd: z.ZodNullable; trialStart: z.ZodNullable; trialEnd: z.ZodNullable; cancelAtPeriodEnd: z.ZodNullable; cancelAt: z.ZodNullable; seats: z.ZodNullable; createdAt: z.ZodDate; updatedAt: z.ZodDate; }, z.core.$strip>; type SubscriptionResponse = z.infer; //# sourceMappingURL=subscriptions.d.ts.map //#endregion //#region src/types.d.ts interface Logger { log(...data: unknown[]): void; info(...data: unknown[]): void; error(...data: unknown[]): void; warn(...data: unknown[]): void; debug(...data: unknown[]): void; } type StripeRequestContext = { method: string; path: string; pathParams: Record; query: URLSearchParams; headers: Headers; rawBody: string | undefined; input: { schema: unknown; valid: () => Promise; }; }; type StripeEntityData = { /** * The unique identifier for the entity (user, organization, etc.) in your system */ referenceId: string; /** * The Stripe Customer ID associated with this entity, if one exists */ stripeCustomerId: string | undefined; /** * The email address of the customer */ customerEmail: string; /** * Custom metadata to be attached to Stripe Customer for this entity */ stripeMetadata: Record; }; interface StripeFragmentConfig { stripeSecretKey: string; webhookSecret: string; stripeClientOptions?: Stripe.StripeConfig; enableAdminRoutes: boolean; /** * Resolves the authenticated entity (user, organization or something) from the request context * and returns their Stripe-related data. * * This callback is invoked on user-specific routes (/subscription/upgrade and /subscription/cancel) * to identify which entity is making the request. Extract authentication information * from the request context (e.g., session cookies, JWT tokens in headers) and return * the entity's Stripe customer ID, subscription ID (if exists), email, and custom metadata. * * @param context - Request context containing headers, query params, path params, and request body * @returns Promise resolving to the entity's Stripe-related data */ resolveEntityFromRequest: (context: StripeRequestContext) => Promise; /** * Callback that gets called when a Stripe Customer is created. * * Use this callback when you want to store a reference to the customer id in your app. */ onStripeCustomerCreated: (stripeCustomerId: string, referenceId: string) => Promise; /** * Optional callback for custom Stripe event handlers. * * This callback runs BEFORE the default handling. */ onEvent?: (args: { event: Stripe.Event; stripeClient: Stripe; }) => Promise; logger?: Logger; } interface StripeFragmentDeps { stripe: Stripe; stripeClientOptions?: Stripe.StripeConfig; log: Logger; } interface StripeFragmentServices { /** * Get the Stripe client instance */ getStripeClient(): Stripe; /** * Create a new subscription record in the database * Note: createdAt and updatedAt are automatically set by the service */ createSubscription(data: Omit, "id" | "createdAt" | "updatedAt">): Promise; /** * Update an existing subscription record */ updateSubscription(id: string, data: Partial, "id">>): Promise; /** * Find a subscription by Stripe subscription ID */ getSubscriptionByStripeId(stripeSubscriptionId: string): Promise; /** * Find all subscriptions for a Stripe customer ID */ getSubscriptionsByStripeCustomerId(stripeCustomerId: string): Promise; /** * Delete a subscription record */ deleteSubscription(id: string): Promise; deleteSubscriptionsByReferenceId(referenceId: string): Promise<{ success: boolean; }>; /** * Get all subscriptions */ getAllSubscriptions(): Promise; /** * Get subscriptions by id (internal) */ getSubscriptionById(id: string): Promise; getSubscriptionsByReferenceId(referenceId: string): Promise; syncStripeSubscriptions(referenceId: string, customerId: string): Promise<{ success: boolean; }>; } //# sourceMappingURL=types.d.ts.map //#endregion //#region src/definition.d.ts declare const stripeFragmentDefinition: _fragno_dev_core10.FragmentDefinition & Record<"id", _fragno_dev_db_schema93.IdColumn<"varchar(30)", string | _fragno_dev_db_schema93.FragnoId | null, _fragno_dev_db_schema93.FragnoId>> & Record<"referenceId", _fragno_dev_db_schema93.Column<"string", string | null, string | null>> & Record<"stripePriceId", _fragno_dev_db_schema93.Column<"string", string, string>> & Record<"stripeCustomerId", _fragno_dev_db_schema93.Column<"string", string, string>> & Record<"stripeSubscriptionId", _fragno_dev_db_schema93.Column<"string", string, string>> & Record<"status", _fragno_dev_db_schema93.Column<"string", string | null, string>> & Record<"periodStart", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date | null>> & Record<"periodEnd", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date | null>> & Record<"trialStart", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date | null>> & Record<"trialEnd", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date | null>> & Record<"cancelAtPeriodEnd", _fragno_dev_db_schema93.Column<"bool", boolean | null, boolean>> & Record<"cancelAt", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date | null>> & Record<"seats", _fragno_dev_db_schema93.Column<"integer", number | null, number | null>> & Record<"createdAt", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema93.Column<"timestamp", (_fragno_dev_db42.DbNow | Date) | null, Date>>, Record, Record> & Record<"idx_stripe_customer_id", _fragno_dev_db_schema93.Index] & _fragno_dev_db_schema93.AnyColumn[], readonly ["stripeCustomerId"]>> & Record<"idx_stripe_subscription_id", _fragno_dev_db_schema93.Index] & _fragno_dev_db_schema93.AnyColumn[], readonly ["stripeSubscriptionId"]>> & Record<"idx_reference_id", _fragno_dev_db_schema93.Index] & _fragno_dev_db_schema93.AnyColumn[], readonly ["referenceId"]>>>>>>, { getStripeClient(): Stripe; createSubscription(data: Omit, "id" | "createdAt" | "updatedAt">): Promise; updateSubscription(id: string, data: Partial, "id">>): Promise; getSubscriptionByStripeId(stripeSubscriptionId: string): Promise; getSubscriptionsByStripeCustomerId(stripeCustomerId: string): Promise; deleteSubscription(id: string): Promise; deleteSubscriptionsByReferenceId(referenceId: string): Promise<{ success: boolean; }>; getAllSubscriptions(): Promise; getSubscriptionById(id: string): Promise; getSubscriptionsByReferenceId(referenceId: string): Promise; syncStripeSubscriptions(referenceId: string, customerId: string): Promise<{ success: boolean; }>; }, {}, {}, {}, _fragno_dev_db42.DatabaseServiceContext<_fragno_dev_db42.HooksMap>, _fragno_dev_db42.DatabaseRequestContext<_fragno_dev_db42.HooksMap>, _fragno_dev_db_fragment_definition_builder0$1.DatabaseRequestStorage, { _fragno_internal: _fragno_dev_db42.InternalFragmentInstance; }>; //# sourceMappingURL=definition.d.ts.map //#endregion //#region src/index.d.ts declare function createStripeFragment(config: StripeFragmentConfig, fragnoConfig: FragnoPublicConfigWithDatabase): _fragno_dev_core0.FragnoInstantiatedFragment | undefined, zod199.ZodObject<{ success: zod199.ZodBoolean; }, zod_v4_core14.$strip>, "MISSING_SIGNATURE" | "WEBHOOK_SIGNATURE_INVALID" | "WEBHOOK_ERROR", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/customers", zod199.ZodObject<{ limit: zod199.ZodDefault>; startingAfter: zod199.ZodOptional; }, zod_v4_core14.$strip>, zod199.ZodObject<{ customers: zod199.ZodArray; balance: zod199.ZodNumber; business_name: zod199.ZodOptional; created: zod199.ZodNumber; currency: zod199.ZodOptional>; deleted: zod199.ZodOptional; delinquent: zod199.ZodOptional>; description: zod199.ZodNullable; email: zod199.ZodNullable; individual_name: zod199.ZodOptional; invoice_credit_balance: zod199.ZodOptional>; invoice_prefix: zod199.ZodOptional>; livemode: zod199.ZodBoolean; metadata: zod199.ZodRecord; name: zod199.ZodOptional>; next_invoice_sequence: zod199.ZodOptional; phone: zod199.ZodOptional>; preferred_locales: zod199.ZodOptional>>; }, zod_v4_core14.$strip>>; hasMore: zod199.ZodBoolean; }, zod_v4_core14.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/portal", zod199.ZodObject<{ returnUrl: zod199.ZodURL; }, zod_v4_core14.$strip>, zod199.ZodObject<{ url: zod199.ZodURL; redirect: zod199.ZodBoolean; }, zod_v4_core14.$strip>, "NO_STRIPE_CUSTOMER_FOR_ENTITY", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/subscriptions", _standard_schema_spec0.StandardSchemaV1 | undefined, zod199.ZodObject<{ subscriptions: zod199.ZodArray; status: zod199.ZodEnum<{ incomplete: "incomplete"; active: "active"; canceled: "canceled"; incomplete_expired: "incomplete_expired"; past_due: "past_due"; paused: "paused"; trialing: "trialing"; unpaid: "unpaid"; }>; periodStart: zod199.ZodNullable; periodEnd: zod199.ZodNullable; trialStart: zod199.ZodNullable; trialEnd: zod199.ZodNullable; cancelAtPeriodEnd: zod199.ZodNullable; cancelAt: zod199.ZodNullable; seats: zod199.ZodNullable; createdAt: zod199.ZodDate; updatedAt: zod199.ZodDate; }, zod_v4_core14.$strip>>; }, zod_v4_core14.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/subscription/upgrade", zod199.ZodObject<{ priceId: zod199.ZodString; quantity: zod199.ZodNumber; successUrl: zod199.ZodURL; cancelUrl: zod199.ZodURL; returnUrl: zod199.ZodOptional; promotionCode: zod199.ZodOptional; subscriptionId: zod199.ZodOptional; }, zod_v4_core14.$strip>, zod199.ZodObject<{ url: zod199.ZodString; redirect: zod199.ZodBoolean; sessionId: zod199.ZodOptional; }, zod_v4_core14.$strip>, "MISSING_CUSTOMER_INFO" | "SUBSCRIPTION_NOT_FOUND" | "CUSTOMER_SUBSCRIPTION_MISMATCH" | "UPGRADE_HAS_NO_EFFECT" | "SUBSCRIPTION_UPDATE_NOT_ALLOWED" | "SUBSCRIPTION_UPDATE_PROMO_CODE_NOT_ALLOWED" | "PROMOTION_CODE_CUSTOMER_NOT_FIRST_TIME" | "MULTIPLE_ACTIVE_SUBSCRIPTIONS" | "NO_ACTIVE_SUBSCRIPTIONS", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/subscription/cancel", zod199.ZodObject<{ returnUrl: zod199.ZodURL; subscriptionId: zod199.ZodOptional; }, zod_v4_core14.$strip>, zod199.ZodObject<{ url: zod199.ZodURL; redirect: zod199.ZodBoolean; }, zod_v4_core14.$strip>, "SUBSCRIPTION_NOT_FOUND" | "NO_SUBSCRIPTION_TO_CANCEL" | "SUBSCRIPTION_ALREADY_CANCELED" | "NO_STRIPE_CUSTOMER_LINKED" | "MULTIPLE_SUBSCRIPTIONS_FOUND", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/products", zod199.ZodObject<{ limit: zod199.ZodDefault>; startingAfter: zod199.ZodOptional; }, zod_v4_core14.$strip>, zod199.ZodObject<{ products: zod199.ZodArray; active: zod199.ZodBoolean; created: zod199.ZodNumber; default_price: zod199.ZodOptional>>; deleted: zod199.ZodOptional; description: zod199.ZodNullable; images: zod199.ZodArray; livemode: zod199.ZodBoolean; marketing_features: zod199.ZodArray; metadata: zod199.ZodAny; name: zod199.ZodString; package_dimensions: zod199.ZodNullable; shippable: zod199.ZodNullable; statement_descriptor: zod199.ZodOptional>; tax_code: zod199.ZodNullable>; type: zod199.ZodString; unit_label: zod199.ZodOptional>; updated: zod199.ZodNumber; url: zod199.ZodNullable; }, zod_v4_core14.$strip>>; hasMore: zod199.ZodBoolean; }, zod_v4_core14.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/products/:productId/prices", zod199.ZodObject<{ limit: zod199.ZodDefault>; startingAfter: zod199.ZodOptional; }, zod_v4_core14.$strip>, zod199.ZodObject<{ prices: zod199.ZodArray; active: zod199.ZodBoolean; billing_scheme: zod199.ZodString; created: zod199.ZodNumber; currency: zod199.ZodString; custom_unit_amount: zod199.ZodOptional>; deleted: zod199.ZodOptional; livemode: zod199.ZodBoolean; lookup_key: zod199.ZodOptional>; metadata: zod199.ZodAny; nickname: zod199.ZodOptional>; product: zod199.ZodUnion; recurring: zod199.ZodOptional>; interval: zod199.ZodEnum<{ day: "day"; week: "week"; month: "month"; year: "year"; }>; interval_count: zod199.ZodNumber; meter: zod199.ZodOptional>; trial_period_days: zod199.ZodOptional>; usage_type: zod199.ZodString; }, zod_v4_core14.$strip>>>; tax_behavior: zod199.ZodOptional>; tiers_mode: zod199.ZodOptional>; transform_quantity: zod199.ZodOptional>; type: zod199.ZodEnum<{ recurring: "recurring"; one_time: "one_time"; }>; unit_amount: zod199.ZodOptional>; unit_amount_decimal: zod199.ZodOptional>; }, zod_v4_core14.$strip>>; hasMore: zod199.ZodBoolean; }, zod_v4_core14.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, ..._fragno_dev_core0.FragnoRouteConfig<_fragno_dev_core_api2.HTTPMethod, `/_internal/${string}`, any, any, any, any, any>[]], { stripe: stripe0.Stripe; log: Logger; } & _fragno_dev_db0.ImplicitDatabaseDependencies<_fragno_dev_db_schema0.Schema & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"referenceId", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"stripePriceId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"stripeCustomerId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"stripeSubscriptionId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"status", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"periodStart", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"periodEnd", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"trialStart", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"trialEnd", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"cancelAtPeriodEnd", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"cancelAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"seats", _fragno_dev_db_schema0.Column<"integer", number | null, number | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record, Record> & Record<"idx_stripe_customer_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["stripeCustomerId"]>> & Record<"idx_stripe_subscription_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["stripeSubscriptionId"]>> & Record<"idx_reference_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["referenceId"]>>>>>>, _fragno_dev_core0.BoundServices<{ getStripeClient(): stripe0.Stripe; createSubscription(data: Omit<_fragno_dev_db_query0.TableToInsertValues<_fragno_dev_db_schema0.Table & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"referenceId", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"stripePriceId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"stripeCustomerId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"stripeSubscriptionId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"status", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"periodStart", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"periodEnd", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"trialStart", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"trialEnd", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"cancelAtPeriodEnd", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"cancelAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"seats", _fragno_dev_db_schema0.Column<"integer", number | null, number | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record, Record> & Record<"idx_stripe_customer_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["stripeCustomerId"]>> & Record<"idx_stripe_subscription_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["stripeSubscriptionId"]>> & Record<"idx_reference_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["referenceId"]>>>>, "id" | "createdAt" | "updatedAt">): Promise; updateSubscription(id: string, data: Partial & Record<"id", _fragno_dev_db_schema0.IdColumn<"varchar(30)", string | _fragno_dev_db_schema0.FragnoId | null, _fragno_dev_db_schema0.FragnoId>> & Record<"referenceId", _fragno_dev_db_schema0.Column<"string", string | null, string | null>> & Record<"stripePriceId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"stripeCustomerId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"stripeSubscriptionId", _fragno_dev_db_schema0.Column<"string", string, string>> & Record<"status", _fragno_dev_db_schema0.Column<"string", string | null, string>> & Record<"periodStart", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"periodEnd", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"trialStart", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"trialEnd", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"cancelAtPeriodEnd", _fragno_dev_db_schema0.Column<"bool", boolean | null, boolean>> & Record<"cancelAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date | null>> & Record<"seats", _fragno_dev_db_schema0.Column<"integer", number | null, number | null>> & Record<"createdAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>> & Record<"updatedAt", _fragno_dev_db_schema0.Column<"timestamp", (_fragno_dev_db0.DbNow | Date) | null, Date>>, Record, Record> & Record<"idx_stripe_customer_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["stripeCustomerId"]>> & Record<"idx_stripe_subscription_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["stripeSubscriptionId"]>> & Record<"idx_reference_id", _fragno_dev_db_schema0.Index] & _fragno_dev_db_schema0.AnyColumn[], readonly ["referenceId"]>>>>, "id">>): Promise; getSubscriptionByStripeId(stripeSubscriptionId: string): Promise; getSubscriptionsByStripeCustomerId(stripeCustomerId: string): Promise; deleteSubscription(id: string): Promise; deleteSubscriptionsByReferenceId(referenceId: string): Promise<{ success: boolean; }>; getAllSubscriptions(): Promise; getSubscriptionById(id: string): Promise; getSubscriptionsByReferenceId(referenceId: string): Promise; syncStripeSubscriptions(referenceId: string, customerId: string): Promise<{ success: boolean; }>; }>, _fragno_dev_db0.DatabaseServiceContext<_fragno_dev_db0.HooksMap>, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>, _fragno_dev_db_fragment_definition_builder0.DatabaseRequestStorage, FragnoPublicConfigWithDatabase, { _fragno_internal: _fragno_dev_db0.InternalFragmentInstance; }>; declare function createStripeFragmentClients(fragnoConfig?: FragnoPublicClientConfig): { useCustomers: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/customers", zod199.ZodObject<{ customers: zod199.ZodArray; balance: zod199.ZodNumber; business_name: zod199.ZodOptional; created: zod199.ZodNumber; currency: zod199.ZodOptional>; deleted: zod199.ZodOptional; delinquent: zod199.ZodOptional>; description: zod199.ZodNullable; email: zod199.ZodNullable; individual_name: zod199.ZodOptional; invoice_credit_balance: zod199.ZodOptional>; invoice_prefix: zod199.ZodOptional>; livemode: zod199.ZodBoolean; metadata: zod199.ZodRecord; name: zod199.ZodOptional>; next_invoice_sequence: zod199.ZodOptional; phone: zod199.ZodOptional>; preferred_locales: zod199.ZodOptional>>; }, zod_v4_core14.$strip>>; hasMore: zod199.ZodBoolean; }, zod_v4_core14.$strip>, string, string>; useProducts: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/products", zod199.ZodObject<{ products: zod199.ZodArray; active: zod199.ZodBoolean; created: zod199.ZodNumber; default_price: zod199.ZodOptional>>; deleted: zod199.ZodOptional; description: zod199.ZodNullable; images: zod199.ZodArray; livemode: zod199.ZodBoolean; marketing_features: zod199.ZodArray; metadata: zod199.ZodAny; name: zod199.ZodString; package_dimensions: zod199.ZodNullable; shippable: zod199.ZodNullable; statement_descriptor: zod199.ZodOptional>; tax_code: zod199.ZodNullable>; type: zod199.ZodString; unit_label: zod199.ZodOptional>; updated: zod199.ZodNumber; url: zod199.ZodNullable; }, zod_v4_core14.$strip>>; hasMore: zod199.ZodBoolean; }, zod_v4_core14.$strip>, string, string>; usePrices: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/products/:productId/prices", zod199.ZodObject<{ prices: zod199.ZodArray; active: zod199.ZodBoolean; billing_scheme: zod199.ZodString; created: zod199.ZodNumber; currency: zod199.ZodString; custom_unit_amount: zod199.ZodOptional>; deleted: zod199.ZodOptional; livemode: zod199.ZodBoolean; lookup_key: zod199.ZodOptional>; metadata: zod199.ZodAny; nickname: zod199.ZodOptional>; product: zod199.ZodUnion; recurring: zod199.ZodOptional>; interval: zod199.ZodEnum<{ day: "day"; week: "week"; month: "month"; year: "year"; }>; interval_count: zod199.ZodNumber; meter: zod199.ZodOptional>; trial_period_days: zod199.ZodOptional>; usage_type: zod199.ZodString; }, zod_v4_core14.$strip>>>; tax_behavior: zod199.ZodOptional>; tiers_mode: zod199.ZodOptional>; transform_quantity: zod199.ZodOptional>; type: zod199.ZodEnum<{ recurring: "recurring"; one_time: "one_time"; }>; unit_amount: zod199.ZodOptional>; unit_amount_decimal: zod199.ZodOptional>; }, zod_v4_core14.$strip>>; hasMore: zod199.ZodBoolean; }, zod_v4_core14.$strip>, string, string>; useSubscription: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/subscriptions", zod199.ZodObject<{ subscriptions: zod199.ZodArray; status: zod199.ZodEnum<{ incomplete: "incomplete"; active: "active"; canceled: "canceled"; incomplete_expired: "incomplete_expired"; past_due: "past_due"; paused: "paused"; trialing: "trialing"; unpaid: "unpaid"; }>; periodStart: zod199.ZodNullable; periodEnd: zod199.ZodNullable; trialStart: zod199.ZodNullable; trialEnd: zod199.ZodNullable; cancelAtPeriodEnd: zod199.ZodNullable; cancelAt: zod199.ZodNullable; seats: zod199.ZodNullable; createdAt: zod199.ZodDate; updatedAt: zod199.ZodDate; }, zod_v4_core14.$strip>>; }, zod_v4_core14.$strip>, string, string>; useBillingPortal: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api2.NonGetHTTPMethod, "/portal", zod199.ZodObject<{ returnUrl: zod199.ZodURL; }, zod_v4_core14.$strip> | undefined, zod199.ZodObject<{ url: zod199.ZodURL; redirect: zod199.ZodBoolean; }, zod_v4_core14.$strip> | undefined, "NO_STRIPE_CUSTOMER_FOR_ENTITY", string>; upgradeSubscription: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api2.NonGetHTTPMethod, "/subscription/upgrade", zod199.ZodObject<{ priceId: zod199.ZodString; quantity: zod199.ZodNumber; successUrl: zod199.ZodURL; cancelUrl: zod199.ZodURL; returnUrl: zod199.ZodOptional; promotionCode: zod199.ZodOptional; subscriptionId: zod199.ZodOptional; }, zod_v4_core14.$strip> | undefined, zod199.ZodObject<{ url: zod199.ZodString; redirect: zod199.ZodBoolean; sessionId: zod199.ZodOptional; }, zod_v4_core14.$strip> | undefined, "MISSING_CUSTOMER_INFO" | "SUBSCRIPTION_NOT_FOUND" | "CUSTOMER_SUBSCRIPTION_MISMATCH" | "UPGRADE_HAS_NO_EFFECT" | "SUBSCRIPTION_UPDATE_NOT_ALLOWED" | "SUBSCRIPTION_UPDATE_PROMO_CODE_NOT_ALLOWED" | "PROMOTION_CODE_CUSTOMER_NOT_FIRST_TIME" | "MULTIPLE_ACTIVE_SUBSCRIPTIONS" | "NO_ACTIVE_SUBSCRIPTIONS", string>; cancelSubscription: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api2.NonGetHTTPMethod, "/subscription/cancel", zod199.ZodObject<{ returnUrl: zod199.ZodURL; subscriptionId: zod199.ZodOptional; }, zod_v4_core14.$strip> | undefined, zod199.ZodObject<{ url: zod199.ZodURL; redirect: zod199.ZodBoolean; }, zod_v4_core14.$strip> | undefined, "SUBSCRIPTION_NOT_FOUND" | "NO_SUBSCRIPTION_TO_CANCEL" | "SUBSCRIPTION_ALREADY_CANCELED" | "NO_STRIPE_CUSTOMER_LINKED" | "MULTIPLE_SUBSCRIPTIONS_FOUND", string>; }; //#endregion export { type FragnoRouteConfig, type Logger, type StripeFragmentConfig, type StripeFragmentDeps, type StripeFragmentServices, createStripeFragment, createStripeFragmentClients, stripeFragmentDefinition }; //# sourceMappingURL=index.d.ts.map