import * as _fragno_dev_core_client0 from "@fragno-dev/core/client"; import { FragnoPublicClientConfig } from "@fragno-dev/core/client"; import * as stripe0 from "stripe"; import Stripe from "stripe"; 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_core10 from "@fragno-dev/core"; import * as _fragno_dev_core0 from "@fragno-dev/core"; import { FragnoRouteConfig } from "@fragno-dev/core"; 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 zod0 from "zod"; import { z } from "zod"; import * as _fragno_dev_core_api0 from "@fragno-dev/core/api"; import * as _standard_schema_spec0 from "@standard-schema/spec"; import * as zod_v4_core0 from "zod/v4/core"; import * as _fragno_dev_db_query0 from "@fragno-dev/db/query"; import { TableToInsertValues } from "@fragno-dev/db/query"; 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, zod0.ZodObject<{ success: zod0.ZodBoolean; }, zod_v4_core0.$strip>, "MISSING_SIGNATURE" | "WEBHOOK_SIGNATURE_INVALID" | "WEBHOOK_ERROR", string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/customers", zod0.ZodObject<{ limit: zod0.ZodDefault>; startingAfter: zod0.ZodOptional; }, zod_v4_core0.$strip>, zod0.ZodObject<{ customers: zod0.ZodArray; balance: zod0.ZodNumber; business_name: zod0.ZodOptional; created: zod0.ZodNumber; currency: zod0.ZodOptional>; deleted: zod0.ZodOptional; delinquent: zod0.ZodOptional>; description: zod0.ZodNullable; email: zod0.ZodNullable; individual_name: zod0.ZodOptional; invoice_credit_balance: zod0.ZodOptional>; invoice_prefix: zod0.ZodOptional>; livemode: zod0.ZodBoolean; metadata: zod0.ZodRecord; name: zod0.ZodOptional>; next_invoice_sequence: zod0.ZodOptional; phone: zod0.ZodOptional>; preferred_locales: zod0.ZodOptional>>; }, zod_v4_core0.$strip>>; hasMore: zod0.ZodBoolean; }, zod_v4_core0.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/portal", zod0.ZodObject<{ returnUrl: zod0.ZodURL; }, zod_v4_core0.$strip>, zod0.ZodObject<{ url: zod0.ZodURL; redirect: zod0.ZodBoolean; }, zod_v4_core0.$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, zod0.ZodObject<{ subscriptions: zod0.ZodArray; status: zod0.ZodEnum<{ incomplete: "incomplete"; active: "active"; canceled: "canceled"; incomplete_expired: "incomplete_expired"; past_due: "past_due"; paused: "paused"; trialing: "trialing"; unpaid: "unpaid"; }>; periodStart: zod0.ZodNullable; periodEnd: zod0.ZodNullable; trialStart: zod0.ZodNullable; trialEnd: zod0.ZodNullable; cancelAtPeriodEnd: zod0.ZodNullable; cancelAt: zod0.ZodNullable; seats: zod0.ZodNullable; createdAt: zod0.ZodDate; updatedAt: zod0.ZodDate; }, zod_v4_core0.$strip>>; }, zod_v4_core0.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"POST", "/subscription/upgrade", zod0.ZodObject<{ priceId: zod0.ZodString; quantity: zod0.ZodNumber; successUrl: zod0.ZodURL; cancelUrl: zod0.ZodURL; returnUrl: zod0.ZodOptional; promotionCode: zod0.ZodOptional; subscriptionId: zod0.ZodOptional; }, zod_v4_core0.$strip>, zod0.ZodObject<{ url: zod0.ZodString; redirect: zod0.ZodBoolean; sessionId: zod0.ZodOptional; }, zod_v4_core0.$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", zod0.ZodObject<{ returnUrl: zod0.ZodURL; subscriptionId: zod0.ZodOptional; }, zod_v4_core0.$strip>, zod0.ZodObject<{ url: zod0.ZodURL; redirect: zod0.ZodBoolean; }, zod_v4_core0.$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", zod0.ZodObject<{ limit: zod0.ZodDefault>; startingAfter: zod0.ZodOptional; }, zod_v4_core0.$strip>, zod0.ZodObject<{ products: zod0.ZodArray; active: zod0.ZodBoolean; created: zod0.ZodNumber; default_price: zod0.ZodOptional>>; deleted: zod0.ZodOptional; description: zod0.ZodNullable; images: zod0.ZodArray; livemode: zod0.ZodBoolean; marketing_features: zod0.ZodArray; metadata: zod0.ZodAny; name: zod0.ZodString; package_dimensions: zod0.ZodNullable; shippable: zod0.ZodNullable; statement_descriptor: zod0.ZodOptional>; tax_code: zod0.ZodNullable>; type: zod0.ZodString; unit_label: zod0.ZodOptional>; updated: zod0.ZodNumber; url: zod0.ZodNullable; }, zod_v4_core0.$strip>>; hasMore: zod0.ZodBoolean; }, zod_v4_core0.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, _fragno_dev_core0.FragnoRouteConfig<"GET", "/admin/products/:productId/prices", zod0.ZodObject<{ limit: zod0.ZodDefault>; startingAfter: zod0.ZodOptional; }, zod_v4_core0.$strip>, zod0.ZodObject<{ prices: zod0.ZodArray; active: zod0.ZodBoolean; billing_scheme: zod0.ZodString; created: zod0.ZodNumber; currency: zod0.ZodString; custom_unit_amount: zod0.ZodOptional>; deleted: zod0.ZodOptional; livemode: zod0.ZodBoolean; lookup_key: zod0.ZodOptional>; metadata: zod0.ZodAny; nickname: zod0.ZodOptional>; product: zod0.ZodUnion; recurring: zod0.ZodOptional>; interval: zod0.ZodEnum<{ day: "day"; week: "week"; month: "month"; year: "year"; }>; interval_count: zod0.ZodNumber; meter: zod0.ZodOptional>; trial_period_days: zod0.ZodOptional>; usage_type: zod0.ZodString; }, zod_v4_core0.$strip>>>; tax_behavior: zod0.ZodOptional>; tiers_mode: zod0.ZodOptional>; transform_quantity: zod0.ZodOptional>; type: zod0.ZodEnum<{ recurring: "recurring"; one_time: "one_time"; }>; unit_amount: zod0.ZodOptional>; unit_amount_decimal: zod0.ZodOptional>; }, zod_v4_core0.$strip>>; hasMore: zod0.ZodBoolean; }, zod_v4_core0.$strip>, string, string, _fragno_dev_db0.DatabaseRequestContext<_fragno_dev_db0.HooksMap>>, ..._fragno_dev_core0.FragnoRouteConfig<_fragno_dev_core_api0.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", zod0.ZodObject<{ customers: zod0.ZodArray; balance: zod0.ZodNumber; business_name: zod0.ZodOptional; created: zod0.ZodNumber; currency: zod0.ZodOptional>; deleted: zod0.ZodOptional; delinquent: zod0.ZodOptional>; description: zod0.ZodNullable; email: zod0.ZodNullable; individual_name: zod0.ZodOptional; invoice_credit_balance: zod0.ZodOptional>; invoice_prefix: zod0.ZodOptional>; livemode: zod0.ZodBoolean; metadata: zod0.ZodRecord; name: zod0.ZodOptional>; next_invoice_sequence: zod0.ZodOptional; phone: zod0.ZodOptional>; preferred_locales: zod0.ZodOptional>>; }, zod_v4_core0.$strip>>; hasMore: zod0.ZodBoolean; }, zod_v4_core0.$strip>, string, string>; useProducts: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/products", zod0.ZodObject<{ products: zod0.ZodArray; active: zod0.ZodBoolean; created: zod0.ZodNumber; default_price: zod0.ZodOptional>>; deleted: zod0.ZodOptional; description: zod0.ZodNullable; images: zod0.ZodArray; livemode: zod0.ZodBoolean; marketing_features: zod0.ZodArray; metadata: zod0.ZodAny; name: zod0.ZodString; package_dimensions: zod0.ZodNullable; shippable: zod0.ZodNullable; statement_descriptor: zod0.ZodOptional>; tax_code: zod0.ZodNullable>; type: zod0.ZodString; unit_label: zod0.ZodOptional>; updated: zod0.ZodNumber; url: zod0.ZodNullable; }, zod_v4_core0.$strip>>; hasMore: zod0.ZodBoolean; }, zod_v4_core0.$strip>, string, string>; usePrices: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/products/:productId/prices", zod0.ZodObject<{ prices: zod0.ZodArray; active: zod0.ZodBoolean; billing_scheme: zod0.ZodString; created: zod0.ZodNumber; currency: zod0.ZodString; custom_unit_amount: zod0.ZodOptional>; deleted: zod0.ZodOptional; livemode: zod0.ZodBoolean; lookup_key: zod0.ZodOptional>; metadata: zod0.ZodAny; nickname: zod0.ZodOptional>; product: zod0.ZodUnion; recurring: zod0.ZodOptional>; interval: zod0.ZodEnum<{ day: "day"; week: "week"; month: "month"; year: "year"; }>; interval_count: zod0.ZodNumber; meter: zod0.ZodOptional>; trial_period_days: zod0.ZodOptional>; usage_type: zod0.ZodString; }, zod_v4_core0.$strip>>>; tax_behavior: zod0.ZodOptional>; tiers_mode: zod0.ZodOptional>; transform_quantity: zod0.ZodOptional>; type: zod0.ZodEnum<{ recurring: "recurring"; one_time: "one_time"; }>; unit_amount: zod0.ZodOptional>; unit_amount_decimal: zod0.ZodOptional>; }, zod_v4_core0.$strip>>; hasMore: zod0.ZodBoolean; }, zod_v4_core0.$strip>, string, string>; useSubscription: _fragno_dev_core_client0.FragnoClientHookData<"GET", "/admin/subscriptions", zod0.ZodObject<{ subscriptions: zod0.ZodArray; status: zod0.ZodEnum<{ incomplete: "incomplete"; active: "active"; canceled: "canceled"; incomplete_expired: "incomplete_expired"; past_due: "past_due"; paused: "paused"; trialing: "trialing"; unpaid: "unpaid"; }>; periodStart: zod0.ZodNullable; periodEnd: zod0.ZodNullable; trialStart: zod0.ZodNullable; trialEnd: zod0.ZodNullable; cancelAtPeriodEnd: zod0.ZodNullable; cancelAt: zod0.ZodNullable; seats: zod0.ZodNullable; createdAt: zod0.ZodDate; updatedAt: zod0.ZodDate; }, zod_v4_core0.$strip>>; }, zod_v4_core0.$strip>, string, string>; useBillingPortal: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api0.NonGetHTTPMethod, "/portal", zod0.ZodObject<{ returnUrl: zod0.ZodURL; }, zod_v4_core0.$strip> | undefined, zod0.ZodObject<{ url: zod0.ZodURL; redirect: zod0.ZodBoolean; }, zod_v4_core0.$strip> | undefined, "NO_STRIPE_CUSTOMER_FOR_ENTITY", string>; upgradeSubscription: _fragno_dev_core_client0.FragnoClientMutatorData<_fragno_dev_core_api0.NonGetHTTPMethod, "/subscription/upgrade", zod0.ZodObject<{ priceId: zod0.ZodString; quantity: zod0.ZodNumber; successUrl: zod0.ZodURL; cancelUrl: zod0.ZodURL; returnUrl: zod0.ZodOptional; promotionCode: zod0.ZodOptional; subscriptionId: zod0.ZodOptional; }, zod_v4_core0.$strip> | undefined, zod0.ZodObject<{ url: zod0.ZodString; redirect: zod0.ZodBoolean; sessionId: zod0.ZodOptional; }, zod_v4_core0.$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_api0.NonGetHTTPMethod, "/subscription/cancel", zod0.ZodObject<{ returnUrl: zod0.ZodURL; subscriptionId: zod0.ZodOptional; }, zod_v4_core0.$strip> | undefined, zod0.ZodObject<{ url: zod0.ZodURL; redirect: zod0.ZodBoolean; }, zod_v4_core0.$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