@magnet-cms/plugin-stripe 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,317 @@
1
+ import { StripePluginConfig, SubscriptionAccessResponse, CreateCheckoutDto, SessionResponse, StripeMetricsResponse, CreatePortalDto } from '../index.cjs';
2
+ export { StripePlugin } from '../index.cjs';
3
+ import { Model, BaseSchema } from '@magnet-cms/common';
4
+ import { OnModuleInit } from '@nestjs/common';
5
+ import Stripe from 'stripe';
6
+
7
+ /**
8
+ * Stripe Plugin Module
9
+ *
10
+ * Registers all Stripe schemas, services, and controllers.
11
+ * Auto-imported by the @Plugin decorator's `module` field.
12
+ */
13
+ declare class StripeModule {
14
+ }
15
+
16
+ /**
17
+ * Stripe Price — synced from Stripe via webhooks.
18
+ * Represents a pricing option for a product.
19
+ */
20
+ declare class StripePrice {
21
+ /** Stripe Price ID (price_...) */
22
+ stripePriceId: string;
23
+ /** Reference to the StripeProduct.stripeProductId */
24
+ productId: string;
25
+ /** Price amount in the smallest currency unit (e.g., cents) */
26
+ unitAmount: number;
27
+ /** Three-letter ISO currency code (e.g., 'usd') */
28
+ currency: string;
29
+ /** Pricing type */
30
+ type: 'one_time' | 'recurring';
31
+ /** Billing interval for recurring prices */
32
+ interval?: 'day' | 'week' | 'month' | 'year';
33
+ /** Number of intervals between billings */
34
+ intervalCount?: number;
35
+ /** Whether this price is currently active */
36
+ active: boolean;
37
+ }
38
+
39
+ /**
40
+ * Stripe Product — synced from Stripe via webhooks.
41
+ * Represents a product available for purchase.
42
+ */
43
+ declare class StripeProduct {
44
+ /** Stripe Product ID (prod_...) */
45
+ stripeProductId: string;
46
+ /** Product name */
47
+ name: string;
48
+ /** Product description */
49
+ description?: string;
50
+ /** Whether the product is currently active in Stripe */
51
+ active: boolean;
52
+ /** Arbitrary metadata from Stripe */
53
+ metadata?: Record<string, string>;
54
+ /** Product image URLs */
55
+ images?: string[];
56
+ /** When the product was last synced */
57
+ updatedAt: Date;
58
+ }
59
+
60
+ /**
61
+ * Core Stripe SDK service.
62
+ *
63
+ * Initializes the Stripe client from plugin options and provides
64
+ * typed access for other services to use.
65
+ */
66
+ declare class StripeService implements OnModuleInit {
67
+ private readonly config;
68
+ private readonly logger;
69
+ private stripe;
70
+ constructor(config: StripePluginConfig);
71
+ onModuleInit(): void;
72
+ /** Get the initialized Stripe client */
73
+ get client(): Stripe;
74
+ /** Get the plugin configuration */
75
+ get pluginConfig(): StripePluginConfig;
76
+ /**
77
+ * Verify that raw body is available on the request.
78
+ * Must be called before webhook signature verification.
79
+ * Consumers must enable `rawBody: true` in NestFactory.create().
80
+ */
81
+ verifyRawBodyAvailable(req: {
82
+ rawBody?: Buffer;
83
+ }): asserts req is {
84
+ rawBody: Buffer;
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Stripe Customer — maps a Stripe customer to a Magnet user.
90
+ * Synced from Stripe via webhooks.
91
+ */
92
+ declare class StripeCustomer {
93
+ /** Stripe Customer ID (cus_...) */
94
+ stripeCustomerId: string;
95
+ /** Customer email address */
96
+ email: string;
97
+ /** Customer display name */
98
+ name?: string;
99
+ /** Reference to the Magnet user ID */
100
+ userId?: string;
101
+ /** Arbitrary metadata from Stripe */
102
+ metadata?: Record<string, string>;
103
+ /** When the customer was created in Stripe */
104
+ createdAt: Date;
105
+ }
106
+
107
+ declare class StripeCustomerService {
108
+ private readonly customerModel;
109
+ constructor(customerModel: Model<StripeCustomer>);
110
+ /**
111
+ * Upsert a Stripe customer record from a Stripe Customer object.
112
+ */
113
+ upsertFromStripe(stripeCustomer: Stripe.Customer): Promise<BaseSchema<StripeCustomer>>;
114
+ /**
115
+ * Delete a customer record by Stripe Customer ID.
116
+ */
117
+ deleteByStripeId(stripeCustomerId: string): Promise<void>;
118
+ /**
119
+ * Find a customer by Magnet user ID.
120
+ */
121
+ findByUserId(userId: string): Promise<BaseSchema<StripeCustomer> | null>;
122
+ /**
123
+ * Find a customer by Stripe Customer ID.
124
+ */
125
+ findByStripeId(stripeCustomerId: string): Promise<BaseSchema<StripeCustomer> | null>;
126
+ /**
127
+ * List all customers.
128
+ */
129
+ findAll(): Promise<BaseSchema<StripeCustomer>[]>;
130
+ /**
131
+ * Link a Stripe customer to a Magnet user.
132
+ */
133
+ linkToUser(stripeCustomerId: string, userId: string): Promise<BaseSchema<StripeCustomer>>;
134
+ }
135
+
136
+ /**
137
+ * Stripe Subscription — synced from Stripe via webhooks.
138
+ * Tracks active, canceled, and past subscriptions.
139
+ */
140
+ declare class StripeSubscription {
141
+ /** Stripe Subscription ID (sub_...) */
142
+ stripeSubscriptionId: string;
143
+ /** Reference to StripeCustomer.stripeCustomerId */
144
+ customerId: string;
145
+ /** Reference to StripePrice.stripePriceId */
146
+ priceId: string;
147
+ /** Subscription status from Stripe */
148
+ status: string;
149
+ /** Start of the current billing period */
150
+ currentPeriodStart: Date;
151
+ /** End of the current billing period */
152
+ currentPeriodEnd: Date;
153
+ /** Whether the subscription will be canceled at the end of the period */
154
+ cancelAtPeriodEnd: boolean;
155
+ /** When the trial ends (null if no trial) */
156
+ trialEnd?: Date;
157
+ /** When the subscription was last synced */
158
+ updatedAt: Date;
159
+ }
160
+
161
+ declare class StripeSubscriptionService {
162
+ private readonly subscriptionModel;
163
+ private readonly stripeService;
164
+ constructor(subscriptionModel: Model<StripeSubscription>, stripeService: StripeService);
165
+ /**
166
+ * Upsert a subscription from a Stripe Subscription object.
167
+ */
168
+ syncSubscription(stripeSub: Stripe.Subscription): Promise<BaseSchema<StripeSubscription>>;
169
+ /**
170
+ * Delete a subscription record by Stripe Subscription ID.
171
+ */
172
+ deleteByStripeId(stripeSubscriptionId: string): Promise<void>;
173
+ /**
174
+ * Find active subscription for a customer.
175
+ */
176
+ findActiveByCustomerId(customerId: string): Promise<BaseSchema<StripeSubscription> | null>;
177
+ /**
178
+ * List all subscriptions.
179
+ */
180
+ findAll(): Promise<BaseSchema<StripeSubscription>[]>;
181
+ /**
182
+ * Cancel a subscription via the Stripe API.
183
+ */
184
+ cancel(stripeSubscriptionId: string): Promise<void>;
185
+ }
186
+
187
+ declare class StripeAccessService {
188
+ private readonly stripeService;
189
+ private readonly customerService;
190
+ private readonly subscriptionService;
191
+ private readonly priceModel;
192
+ private readonly productModel;
193
+ constructor(stripeService: StripeService, customerService: StripeCustomerService, subscriptionService: StripeSubscriptionService, priceModel: Model<StripePrice>, productModel: Model<StripeProduct>);
194
+ /**
195
+ * Get subscription access info for a user.
196
+ * Returns subscription status, plan name, and feature flags.
197
+ */
198
+ getAccess(userId: string): Promise<SubscriptionAccessResponse>;
199
+ /**
200
+ * Resolve feature flags for a plan name from plugin config.
201
+ */
202
+ private resolveFeaturesForPlan;
203
+ }
204
+
205
+ declare class StripeCheckoutService {
206
+ private readonly stripeService;
207
+ constructor(stripeService: StripeService);
208
+ /**
209
+ * Create a Stripe Checkout session.
210
+ */
211
+ createCheckoutSession(dto: CreateCheckoutDto): Promise<SessionResponse>;
212
+ }
213
+
214
+ /**
215
+ * Stripe Payment — records payment history from invoices and charges.
216
+ * Synced from Stripe via webhooks.
217
+ */
218
+ declare class StripePayment {
219
+ /** Stripe PaymentIntent ID (pi_...) or Invoice ID (in_...) */
220
+ stripePaymentIntentId: string;
221
+ /** Reference to StripeCustomer.stripeCustomerId */
222
+ customerId: string;
223
+ /** Payment amount in the smallest currency unit (e.g., cents) */
224
+ amount: number;
225
+ /** Three-letter ISO currency code */
226
+ currency: string;
227
+ /** Payment status */
228
+ status: string;
229
+ /** URL for the payment receipt */
230
+ receiptUrl?: string;
231
+ /** Stripe Invoice ID if payment is from an invoice */
232
+ invoiceId?: string;
233
+ /** When the payment was created */
234
+ createdAt: Date;
235
+ }
236
+
237
+ declare class StripeMetricsService {
238
+ private readonly paymentModel;
239
+ private readonly subscriptionModel;
240
+ private readonly stripeService;
241
+ constructor(paymentModel: Model<StripePayment>, subscriptionModel: Model<StripeSubscription>, stripeService: StripeService);
242
+ /**
243
+ * Get dashboard metrics — hybrid of live Stripe API and local DB data.
244
+ */
245
+ getMetrics(): Promise<StripeMetricsResponse>;
246
+ /**
247
+ * Calculate MRR from active subscriptions via live Stripe API.
248
+ */
249
+ private calculateMRR;
250
+ private countActiveSubscriptions;
251
+ private calculateRevenueThisMonth;
252
+ private calculateChurnRate;
253
+ private getRevenueByMonth;
254
+ private getRecentPayments;
255
+ }
256
+
257
+ declare class StripePortalService {
258
+ private readonly stripeService;
259
+ private readonly customerService;
260
+ constructor(stripeService: StripeService, customerService: StripeCustomerService);
261
+ /**
262
+ * Create a Stripe Customer Portal session.
263
+ */
264
+ createPortalSession(dto: CreatePortalDto): Promise<SessionResponse>;
265
+ }
266
+
267
+ declare class StripeProductService {
268
+ private readonly productModel;
269
+ private readonly priceModel;
270
+ constructor(productModel: Model<StripeProduct>, priceModel: Model<StripePrice>);
271
+ /**
272
+ * Upsert a product from a Stripe Product object.
273
+ */
274
+ syncProduct(stripeProduct: Stripe.Product): Promise<BaseSchema<StripeProduct>>;
275
+ /**
276
+ * Upsert a price from a Stripe Price object.
277
+ */
278
+ syncPrice(stripePrice: Stripe.Price): Promise<BaseSchema<StripePrice>>;
279
+ /**
280
+ * Delete a product by Stripe Product ID.
281
+ */
282
+ deleteProduct(stripeProductId: string): Promise<void>;
283
+ /**
284
+ * Delete a price by Stripe Price ID.
285
+ */
286
+ deletePrice(stripePriceId: string): Promise<void>;
287
+ /**
288
+ * List all active products with their prices.
289
+ */
290
+ findActiveProductsWithPrices(): Promise<Array<{
291
+ product: BaseSchema<StripeProduct>;
292
+ prices: BaseSchema<StripePrice>[];
293
+ }>>;
294
+ /**
295
+ * List all products.
296
+ */
297
+ findAllProducts(): Promise<BaseSchema<StripeProduct>[]>;
298
+ /**
299
+ * List all prices.
300
+ */
301
+ findAllPrices(): Promise<BaseSchema<StripePrice>[]>;
302
+ }
303
+
304
+ /**
305
+ * Stripe Processed Event — idempotency tracking for webhook events.
306
+ * Stores event IDs to prevent duplicate processing.
307
+ */
308
+ declare class StripeProcessedEvent {
309
+ /** Stripe Event ID (evt_...) — unique to prevent reprocessing */
310
+ stripeEventId: string;
311
+ /** Event type (e.g., 'invoice.paid', 'customer.subscription.updated') */
312
+ eventType: string;
313
+ /** When this event was processed */
314
+ processedAt: Date;
315
+ }
316
+
317
+ export { CreateCheckoutDto, CreatePortalDto, SessionResponse, StripeAccessService, StripeCheckoutService, StripeCustomer, StripeCustomerService, StripeMetricsResponse, StripeMetricsService, StripeModule, StripePayment, StripePluginConfig, StripePortalService, StripePrice, StripeProcessedEvent, StripeProduct, StripeProductService, StripeService, StripeSubscription, StripeSubscriptionService, SubscriptionAccessResponse };
@@ -0,0 +1,317 @@
1
+ import { StripePluginConfig, SubscriptionAccessResponse, CreateCheckoutDto, SessionResponse, StripeMetricsResponse, CreatePortalDto } from '../index.js';
2
+ export { StripePlugin } from '../index.js';
3
+ import { Model, BaseSchema } from '@magnet-cms/common';
4
+ import { OnModuleInit } from '@nestjs/common';
5
+ import Stripe from 'stripe';
6
+
7
+ /**
8
+ * Stripe Plugin Module
9
+ *
10
+ * Registers all Stripe schemas, services, and controllers.
11
+ * Auto-imported by the @Plugin decorator's `module` field.
12
+ */
13
+ declare class StripeModule {
14
+ }
15
+
16
+ /**
17
+ * Stripe Price — synced from Stripe via webhooks.
18
+ * Represents a pricing option for a product.
19
+ */
20
+ declare class StripePrice {
21
+ /** Stripe Price ID (price_...) */
22
+ stripePriceId: string;
23
+ /** Reference to the StripeProduct.stripeProductId */
24
+ productId: string;
25
+ /** Price amount in the smallest currency unit (e.g., cents) */
26
+ unitAmount: number;
27
+ /** Three-letter ISO currency code (e.g., 'usd') */
28
+ currency: string;
29
+ /** Pricing type */
30
+ type: 'one_time' | 'recurring';
31
+ /** Billing interval for recurring prices */
32
+ interval?: 'day' | 'week' | 'month' | 'year';
33
+ /** Number of intervals between billings */
34
+ intervalCount?: number;
35
+ /** Whether this price is currently active */
36
+ active: boolean;
37
+ }
38
+
39
+ /**
40
+ * Stripe Product — synced from Stripe via webhooks.
41
+ * Represents a product available for purchase.
42
+ */
43
+ declare class StripeProduct {
44
+ /** Stripe Product ID (prod_...) */
45
+ stripeProductId: string;
46
+ /** Product name */
47
+ name: string;
48
+ /** Product description */
49
+ description?: string;
50
+ /** Whether the product is currently active in Stripe */
51
+ active: boolean;
52
+ /** Arbitrary metadata from Stripe */
53
+ metadata?: Record<string, string>;
54
+ /** Product image URLs */
55
+ images?: string[];
56
+ /** When the product was last synced */
57
+ updatedAt: Date;
58
+ }
59
+
60
+ /**
61
+ * Core Stripe SDK service.
62
+ *
63
+ * Initializes the Stripe client from plugin options and provides
64
+ * typed access for other services to use.
65
+ */
66
+ declare class StripeService implements OnModuleInit {
67
+ private readonly config;
68
+ private readonly logger;
69
+ private stripe;
70
+ constructor(config: StripePluginConfig);
71
+ onModuleInit(): void;
72
+ /** Get the initialized Stripe client */
73
+ get client(): Stripe;
74
+ /** Get the plugin configuration */
75
+ get pluginConfig(): StripePluginConfig;
76
+ /**
77
+ * Verify that raw body is available on the request.
78
+ * Must be called before webhook signature verification.
79
+ * Consumers must enable `rawBody: true` in NestFactory.create().
80
+ */
81
+ verifyRawBodyAvailable(req: {
82
+ rawBody?: Buffer;
83
+ }): asserts req is {
84
+ rawBody: Buffer;
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Stripe Customer — maps a Stripe customer to a Magnet user.
90
+ * Synced from Stripe via webhooks.
91
+ */
92
+ declare class StripeCustomer {
93
+ /** Stripe Customer ID (cus_...) */
94
+ stripeCustomerId: string;
95
+ /** Customer email address */
96
+ email: string;
97
+ /** Customer display name */
98
+ name?: string;
99
+ /** Reference to the Magnet user ID */
100
+ userId?: string;
101
+ /** Arbitrary metadata from Stripe */
102
+ metadata?: Record<string, string>;
103
+ /** When the customer was created in Stripe */
104
+ createdAt: Date;
105
+ }
106
+
107
+ declare class StripeCustomerService {
108
+ private readonly customerModel;
109
+ constructor(customerModel: Model<StripeCustomer>);
110
+ /**
111
+ * Upsert a Stripe customer record from a Stripe Customer object.
112
+ */
113
+ upsertFromStripe(stripeCustomer: Stripe.Customer): Promise<BaseSchema<StripeCustomer>>;
114
+ /**
115
+ * Delete a customer record by Stripe Customer ID.
116
+ */
117
+ deleteByStripeId(stripeCustomerId: string): Promise<void>;
118
+ /**
119
+ * Find a customer by Magnet user ID.
120
+ */
121
+ findByUserId(userId: string): Promise<BaseSchema<StripeCustomer> | null>;
122
+ /**
123
+ * Find a customer by Stripe Customer ID.
124
+ */
125
+ findByStripeId(stripeCustomerId: string): Promise<BaseSchema<StripeCustomer> | null>;
126
+ /**
127
+ * List all customers.
128
+ */
129
+ findAll(): Promise<BaseSchema<StripeCustomer>[]>;
130
+ /**
131
+ * Link a Stripe customer to a Magnet user.
132
+ */
133
+ linkToUser(stripeCustomerId: string, userId: string): Promise<BaseSchema<StripeCustomer>>;
134
+ }
135
+
136
+ /**
137
+ * Stripe Subscription — synced from Stripe via webhooks.
138
+ * Tracks active, canceled, and past subscriptions.
139
+ */
140
+ declare class StripeSubscription {
141
+ /** Stripe Subscription ID (sub_...) */
142
+ stripeSubscriptionId: string;
143
+ /** Reference to StripeCustomer.stripeCustomerId */
144
+ customerId: string;
145
+ /** Reference to StripePrice.stripePriceId */
146
+ priceId: string;
147
+ /** Subscription status from Stripe */
148
+ status: string;
149
+ /** Start of the current billing period */
150
+ currentPeriodStart: Date;
151
+ /** End of the current billing period */
152
+ currentPeriodEnd: Date;
153
+ /** Whether the subscription will be canceled at the end of the period */
154
+ cancelAtPeriodEnd: boolean;
155
+ /** When the trial ends (null if no trial) */
156
+ trialEnd?: Date;
157
+ /** When the subscription was last synced */
158
+ updatedAt: Date;
159
+ }
160
+
161
+ declare class StripeSubscriptionService {
162
+ private readonly subscriptionModel;
163
+ private readonly stripeService;
164
+ constructor(subscriptionModel: Model<StripeSubscription>, stripeService: StripeService);
165
+ /**
166
+ * Upsert a subscription from a Stripe Subscription object.
167
+ */
168
+ syncSubscription(stripeSub: Stripe.Subscription): Promise<BaseSchema<StripeSubscription>>;
169
+ /**
170
+ * Delete a subscription record by Stripe Subscription ID.
171
+ */
172
+ deleteByStripeId(stripeSubscriptionId: string): Promise<void>;
173
+ /**
174
+ * Find active subscription for a customer.
175
+ */
176
+ findActiveByCustomerId(customerId: string): Promise<BaseSchema<StripeSubscription> | null>;
177
+ /**
178
+ * List all subscriptions.
179
+ */
180
+ findAll(): Promise<BaseSchema<StripeSubscription>[]>;
181
+ /**
182
+ * Cancel a subscription via the Stripe API.
183
+ */
184
+ cancel(stripeSubscriptionId: string): Promise<void>;
185
+ }
186
+
187
+ declare class StripeAccessService {
188
+ private readonly stripeService;
189
+ private readonly customerService;
190
+ private readonly subscriptionService;
191
+ private readonly priceModel;
192
+ private readonly productModel;
193
+ constructor(stripeService: StripeService, customerService: StripeCustomerService, subscriptionService: StripeSubscriptionService, priceModel: Model<StripePrice>, productModel: Model<StripeProduct>);
194
+ /**
195
+ * Get subscription access info for a user.
196
+ * Returns subscription status, plan name, and feature flags.
197
+ */
198
+ getAccess(userId: string): Promise<SubscriptionAccessResponse>;
199
+ /**
200
+ * Resolve feature flags for a plan name from plugin config.
201
+ */
202
+ private resolveFeaturesForPlan;
203
+ }
204
+
205
+ declare class StripeCheckoutService {
206
+ private readonly stripeService;
207
+ constructor(stripeService: StripeService);
208
+ /**
209
+ * Create a Stripe Checkout session.
210
+ */
211
+ createCheckoutSession(dto: CreateCheckoutDto): Promise<SessionResponse>;
212
+ }
213
+
214
+ /**
215
+ * Stripe Payment — records payment history from invoices and charges.
216
+ * Synced from Stripe via webhooks.
217
+ */
218
+ declare class StripePayment {
219
+ /** Stripe PaymentIntent ID (pi_...) or Invoice ID (in_...) */
220
+ stripePaymentIntentId: string;
221
+ /** Reference to StripeCustomer.stripeCustomerId */
222
+ customerId: string;
223
+ /** Payment amount in the smallest currency unit (e.g., cents) */
224
+ amount: number;
225
+ /** Three-letter ISO currency code */
226
+ currency: string;
227
+ /** Payment status */
228
+ status: string;
229
+ /** URL for the payment receipt */
230
+ receiptUrl?: string;
231
+ /** Stripe Invoice ID if payment is from an invoice */
232
+ invoiceId?: string;
233
+ /** When the payment was created */
234
+ createdAt: Date;
235
+ }
236
+
237
+ declare class StripeMetricsService {
238
+ private readonly paymentModel;
239
+ private readonly subscriptionModel;
240
+ private readonly stripeService;
241
+ constructor(paymentModel: Model<StripePayment>, subscriptionModel: Model<StripeSubscription>, stripeService: StripeService);
242
+ /**
243
+ * Get dashboard metrics — hybrid of live Stripe API and local DB data.
244
+ */
245
+ getMetrics(): Promise<StripeMetricsResponse>;
246
+ /**
247
+ * Calculate MRR from active subscriptions via live Stripe API.
248
+ */
249
+ private calculateMRR;
250
+ private countActiveSubscriptions;
251
+ private calculateRevenueThisMonth;
252
+ private calculateChurnRate;
253
+ private getRevenueByMonth;
254
+ private getRecentPayments;
255
+ }
256
+
257
+ declare class StripePortalService {
258
+ private readonly stripeService;
259
+ private readonly customerService;
260
+ constructor(stripeService: StripeService, customerService: StripeCustomerService);
261
+ /**
262
+ * Create a Stripe Customer Portal session.
263
+ */
264
+ createPortalSession(dto: CreatePortalDto): Promise<SessionResponse>;
265
+ }
266
+
267
+ declare class StripeProductService {
268
+ private readonly productModel;
269
+ private readonly priceModel;
270
+ constructor(productModel: Model<StripeProduct>, priceModel: Model<StripePrice>);
271
+ /**
272
+ * Upsert a product from a Stripe Product object.
273
+ */
274
+ syncProduct(stripeProduct: Stripe.Product): Promise<BaseSchema<StripeProduct>>;
275
+ /**
276
+ * Upsert a price from a Stripe Price object.
277
+ */
278
+ syncPrice(stripePrice: Stripe.Price): Promise<BaseSchema<StripePrice>>;
279
+ /**
280
+ * Delete a product by Stripe Product ID.
281
+ */
282
+ deleteProduct(stripeProductId: string): Promise<void>;
283
+ /**
284
+ * Delete a price by Stripe Price ID.
285
+ */
286
+ deletePrice(stripePriceId: string): Promise<void>;
287
+ /**
288
+ * List all active products with their prices.
289
+ */
290
+ findActiveProductsWithPrices(): Promise<Array<{
291
+ product: BaseSchema<StripeProduct>;
292
+ prices: BaseSchema<StripePrice>[];
293
+ }>>;
294
+ /**
295
+ * List all products.
296
+ */
297
+ findAllProducts(): Promise<BaseSchema<StripeProduct>[]>;
298
+ /**
299
+ * List all prices.
300
+ */
301
+ findAllPrices(): Promise<BaseSchema<StripePrice>[]>;
302
+ }
303
+
304
+ /**
305
+ * Stripe Processed Event — idempotency tracking for webhook events.
306
+ * Stores event IDs to prevent duplicate processing.
307
+ */
308
+ declare class StripeProcessedEvent {
309
+ /** Stripe Event ID (evt_...) — unique to prevent reprocessing */
310
+ stripeEventId: string;
311
+ /** Event type (e.g., 'invoice.paid', 'customer.subscription.updated') */
312
+ eventType: string;
313
+ /** When this event was processed */
314
+ processedAt: Date;
315
+ }
316
+
317
+ export { CreateCheckoutDto, CreatePortalDto, SessionResponse, StripeAccessService, StripeCheckoutService, StripeCustomer, StripeCustomerService, StripeMetricsResponse, StripeMetricsService, StripeModule, StripePayment, StripePluginConfig, StripePortalService, StripePrice, StripeProcessedEvent, StripeProduct, StripeProductService, StripeService, StripeSubscription, StripeSubscriptionService, SubscriptionAccessResponse };
@@ -0,0 +1,19 @@
1
+ import { init_stripe_module, init_access_service, init_checkout_service, init_customer_service, init_metrics_service, init_portal_service, init_product_service, init_subscription_service, init_stripe_service, init_customer_schema, init_payment_schema, init_price_schema, init_processed_event_schema, init_product_schema, init_subscription_schema } from '../chunk-IPPZL6QM.js';
2
+ export { StripeAccessService, StripeCheckoutService, StripeCustomer, StripeCustomerService, StripeMetricsService, StripeModule, StripePayment, StripePlugin, StripePortalService, StripePrice, StripeProcessedEvent, StripeProduct, StripeProductService, StripeService, StripeSubscription, StripeSubscriptionService } from '../chunk-IPPZL6QM.js';
3
+
4
+ // src/backend/index.ts
5
+ init_stripe_module();
6
+ init_access_service();
7
+ init_checkout_service();
8
+ init_customer_service();
9
+ init_metrics_service();
10
+ init_portal_service();
11
+ init_product_service();
12
+ init_subscription_service();
13
+ init_stripe_service();
14
+ init_customer_schema();
15
+ init_payment_schema();
16
+ init_price_schema();
17
+ init_processed_event_schema();
18
+ init_product_schema();
19
+ init_subscription_schema();