autumn-js 1.2.33 → 1.2.34

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.
Files changed (145) hide show
  1. package/dist/backend/adapters/express.js +5463 -2499
  2. package/dist/backend/adapters/express.mjs +5 -5
  3. package/dist/backend/adapters/fetch.js +5463 -2499
  4. package/dist/backend/adapters/fetch.mjs +5 -5
  5. package/dist/backend/adapters/hono.js +5463 -2499
  6. package/dist/backend/adapters/hono.mjs +5 -5
  7. package/dist/backend/adapters/index.js +5463 -2499
  8. package/dist/backend/adapters/index.mjs +8 -8
  9. package/dist/backend/adapters/next.js +5463 -2499
  10. package/dist/backend/adapters/next.mjs +5 -5
  11. package/dist/backend/{chunk-PB6FZBYH.mjs → chunk-4LKEHLXR.mjs} +156 -16
  12. package/dist/backend/{chunk-J5DUSBPT.mjs → chunk-7MRAUIPE.mjs} +1 -1
  13. package/dist/backend/{chunk-PU2XVYEY.mjs → chunk-DDRD5BKK.mjs} +2 -2
  14. package/dist/backend/{chunk-KP266SMS.mjs → chunk-EQJ5B7OA.mjs} +5334 -2510
  15. package/dist/backend/{chunk-AXZQCFUM.mjs → chunk-HMGGMVFC.mjs} +1 -1
  16. package/dist/backend/{chunk-ZLJM5JJW.mjs → chunk-KXRDZE5L.mjs} +2 -2
  17. package/dist/backend/{chunk-EBDK2CKN.mjs → chunk-SA6MCT5X.mjs} +1 -1
  18. package/dist/backend/{chunk-NXOYATCB.mjs → chunk-WCZLA72P.mjs} +1 -1
  19. package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
  20. package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
  21. package/dist/backend/core/handlers/coreHandler.js +5463 -2499
  22. package/dist/backend/core/handlers/coreHandler.mjs +3 -3
  23. package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
  24. package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
  25. package/dist/backend/core/handlers/handleRouteByName.js +5463 -2499
  26. package/dist/backend/core/handlers/handleRouteByName.mjs +3 -3
  27. package/dist/backend/core/handlers/index.d.mts +1 -1
  28. package/dist/backend/core/handlers/index.d.ts +1 -1
  29. package/dist/backend/core/handlers/index.js +5463 -2499
  30. package/dist/backend/core/handlers/index.mjs +4 -4
  31. package/dist/backend/core/index.d.mts +1 -1
  32. package/dist/backend/core/index.d.ts +1 -1
  33. package/dist/backend/core/index.js +5463 -2499
  34. package/dist/backend/core/index.mjs +4 -4
  35. package/dist/backend/core/routes/index.d.mts +1 -1
  36. package/dist/backend/core/routes/index.d.ts +1 -1
  37. package/dist/backend/core/routes/index.js +156 -16
  38. package/dist/backend/core/routes/index.mjs +1 -1
  39. package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
  40. package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
  41. package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
  42. package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
  43. package/dist/backend/core/routes/routeConfigs.js +156 -16
  44. package/dist/backend/core/routes/routeConfigs.mjs +1 -1
  45. package/dist/backend/core/types/handlerTypes.d.mts +1 -1
  46. package/dist/backend/core/types/handlerTypes.d.ts +1 -1
  47. package/dist/backend/core/types/index.d.mts +1 -1
  48. package/dist/backend/core/types/index.d.ts +1 -1
  49. package/dist/backend/core/types/routeTypes.d.mts +1 -1
  50. package/dist/backend/core/types/routeTypes.d.ts +1 -1
  51. package/dist/backend/index.d.mts +2 -2
  52. package/dist/backend/index.d.ts +2 -2
  53. package/dist/backend/index.js +5463 -2499
  54. package/dist/backend/index.mjs +4 -4
  55. package/dist/backend/{routeTypes-BeQuce3K.d.mts → routeTypes-Bb3L3YJy.d.mts} +12979 -9377
  56. package/dist/backend/{routeTypes-CK8YMxkF.d.ts → routeTypes-BhZ9UovL.d.ts} +12979 -9377
  57. package/dist/better-auth/{chunk-V7IOGEY6.mjs → chunk-4VW7A2HS.mjs} +5335 -2511
  58. package/dist/better-auth/{chunk-VAB47XDU.mjs → chunk-B2PHHBLY.mjs} +156 -16
  59. package/dist/better-auth/{chunk-WAXGX4HV.mjs → chunk-D3DYQ36C.mjs} +1 -1
  60. package/dist/better-auth/index.js +5705 -2741
  61. package/dist/better-auth/index.mjs +3 -3
  62. package/dist/better-auth/utils/createAutumnEndpoint.js +156 -16
  63. package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
  64. package/dist/better-auth/utils/handleBetterAuthRoute.js +5463 -2499
  65. package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
  66. package/dist/better-auth/utils/index.js +5705 -2741
  67. package/dist/better-auth/utils/index.mjs +3 -3
  68. package/dist/react/AutumnContext.d.mts +4 -3
  69. package/dist/react/AutumnContext.d.ts +4 -3
  70. package/dist/react/AutumnProvider.js +678 -497
  71. package/dist/react/AutumnProvider.mjs +2 -2
  72. package/dist/react/{chunk-3CXPC6AS.mjs → chunk-6KIRT7EK.mjs} +1 -1
  73. package/dist/react/{chunk-PVCGOFQF.mjs → chunk-AAPQJY55.mjs} +1 -1
  74. package/dist/react/{chunk-N2L457YE.mjs → chunk-DDMHYLY3.mjs} +1 -1
  75. package/dist/react/{chunk-X7BHGQHX.mjs → chunk-ERN74FDW.mjs} +1 -1
  76. package/dist/react/{chunk-P23GII4V.mjs → chunk-FU6VEECB.mjs} +428 -235
  77. package/dist/react/{chunk-C4DMB2FQ.mjs → chunk-JH5BXBEU.mjs} +1 -1
  78. package/dist/react/{chunk-4TB3RHNC.mjs → chunk-M3L6EE7I.mjs} +1 -1
  79. package/dist/react/{chunk-Q3SFYOOM.mjs → chunk-VJDFB54U.mjs} +2 -2
  80. package/dist/react/{chunk-ZLGDHFMS.mjs → chunk-YZ23DM7M.mjs} +1 -1
  81. package/dist/react/client/AutumnClient.d.mts +4 -3
  82. package/dist/react/client/AutumnClient.d.ts +4 -3
  83. package/dist/react/client/IAutumnClient.d.mts +4 -661
  84. package/dist/react/client/IAutumnClient.d.ts +4 -661
  85. package/dist/react/client/index.d.mts +4 -3
  86. package/dist/react/client/index.d.ts +4 -3
  87. package/dist/react/{customer-CaXD8bb5.d.mts → customer-Djhe48ql.d.ts} +4 -4
  88. package/dist/react/{customer-Doa3UnAJ.d.ts → customer-IVcJjz9u.d.mts} +4 -4
  89. package/dist/react/hooks/index.d.mts +4 -3
  90. package/dist/react/hooks/index.d.ts +4 -3
  91. package/dist/react/hooks/index.js +292 -193
  92. package/dist/react/hooks/index.mjs +8 -8
  93. package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
  94. package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
  95. package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
  96. package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
  97. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
  98. package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
  99. package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
  100. package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
  101. package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
  102. package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
  103. package/dist/react/hooks/internal/useCustomerActions.d.mts +4 -3
  104. package/dist/react/hooks/internal/useCustomerActions.d.ts +4 -3
  105. package/dist/react/hooks/internal/useCustomerActions.js +1 -1
  106. package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
  107. package/dist/react/hooks/useAggregateEvents.d.mts +17 -17
  108. package/dist/react/hooks/useAggregateEvents.d.ts +17 -17
  109. package/dist/react/hooks/useAggregateEvents.js +292 -193
  110. package/dist/react/hooks/useAggregateEvents.mjs +2 -2
  111. package/dist/react/hooks/useCustomer.d.mts +3 -3
  112. package/dist/react/hooks/useCustomer.d.ts +3 -3
  113. package/dist/react/hooks/useCustomer.js +292 -193
  114. package/dist/react/hooks/useCustomer.mjs +3 -3
  115. package/dist/react/hooks/useEntity.d.mts +2 -2
  116. package/dist/react/hooks/useEntity.d.ts +2 -2
  117. package/dist/react/hooks/useEntity.js +292 -193
  118. package/dist/react/hooks/useEntity.mjs +2 -2
  119. package/dist/react/hooks/useListEvents.d.mts +17 -17
  120. package/dist/react/hooks/useListEvents.d.ts +17 -17
  121. package/dist/react/hooks/useListEvents.js +292 -193
  122. package/dist/react/hooks/useListEvents.mjs +2 -2
  123. package/dist/react/hooks/useListPlans.d.mts +5 -4
  124. package/dist/react/hooks/useListPlans.d.ts +5 -4
  125. package/dist/react/hooks/useListPlans.js +292 -193
  126. package/dist/react/hooks/useListPlans.mjs +2 -2
  127. package/dist/react/hooks/useReferrals.d.mts +2 -2
  128. package/dist/react/hooks/useReferrals.d.ts +2 -2
  129. package/dist/react/hooks/useReferrals.js +292 -193
  130. package/dist/react/hooks/useReferrals.mjs +2 -2
  131. package/dist/react/index.d.mts +4 -3
  132. package/dist/react/index.d.ts +4 -3
  133. package/dist/react/index.js +1586 -1393
  134. package/dist/react/index.mjs +9 -9
  135. package/dist/react/list-plans-op-ByqRxdNR.d.mts +1224 -0
  136. package/dist/react/list-plans-op-D-K2LRZV.d.ts +1224 -0
  137. package/dist/react/{params-De-y8uix.d.mts → params-CFhvUVCf.d.ts} +2 -2
  138. package/dist/react/{params-Dn_5H61j.d.ts → params-D3ra6In7.d.mts} +2 -2
  139. package/dist/react/{plan-CLcmg-03.d.mts → plan-DOxbvjQY.d.mts} +582 -19
  140. package/dist/react/{plan-CLcmg-03.d.ts → plan-DOxbvjQY.d.ts} +582 -19
  141. package/dist/sdk/index.d.mts +13120 -8731
  142. package/dist/sdk/index.d.ts +13120 -8731
  143. package/dist/sdk/index.js +13326 -9173
  144. package/dist/sdk/index.mjs +12736 -9053
  145. package/package.json +1 -1
@@ -1,664 +1,7 @@
1
- import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, w as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, v as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, s as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-Dn_5H61j.js';
2
- import { C as Customer } from '../customer-Doa3UnAJ.js';
3
- import { O as OpenEnum } from '../plan-CLcmg-03.js';
4
-
5
- /**
6
- * Billing interval (e.g. 'month', 'year').
7
- */
8
- declare const ListPlansPriceInterval: {
9
- readonly OneOff: "one_off";
10
- readonly Week: "week";
11
- readonly Month: "month";
12
- readonly Quarter: "quarter";
13
- readonly SemiAnnual: "semi_annual";
14
- readonly Year: "year";
15
- };
16
- /**
17
- * Billing interval (e.g. 'month', 'year').
18
- */
19
- type ListPlansPriceInterval = OpenEnum<typeof ListPlansPriceInterval>;
20
- /**
21
- * Display text for showing this price in pricing pages.
22
- */
23
- type ListPlansPriceDisplay = {
24
- /**
25
- * Main display text (e.g. '$10' or '100 messages').
26
- */
27
- primaryText: string;
28
- /**
29
- * Secondary display text (e.g. 'per month' or 'then $0.5 per 100').
30
- */
31
- secondaryText?: string | undefined;
32
- };
33
- type ListPlansPrice = {
34
- /**
35
- * Base price amount for the plan.
36
- */
37
- amount: number;
38
- /**
39
- * Billing interval (e.g. 'month', 'year').
40
- */
41
- interval: ListPlansPriceInterval;
42
- /**
43
- * Number of intervals per billing cycle. Defaults to 1.
44
- */
45
- intervalCount?: number | undefined;
46
- /**
47
- * Display text for showing this price in pricing pages.
48
- */
49
- display?: ListPlansPriceDisplay | undefined;
50
- };
51
- /**
52
- * The type of the feature
53
- */
54
- declare const ListPlansType: {
55
- readonly Static: "static";
56
- readonly Boolean: "boolean";
57
- readonly SingleUse: "single_use";
58
- readonly ContinuousUse: "continuous_use";
59
- readonly CreditSystem: "credit_system";
60
- readonly AiCreditSystem: "ai_credit_system";
61
- };
62
- /**
63
- * The type of the feature
64
- */
65
- type ListPlansType = OpenEnum<typeof ListPlansType>;
66
- type ListPlansFeatureDisplay = {
67
- /**
68
- * The singular display name for the feature.
69
- */
70
- singular: string;
71
- /**
72
- * The plural display name for the feature.
73
- */
74
- plural: string;
75
- };
76
- type ListPlansCreditSchema = {
77
- /**
78
- * The ID of the metered feature (should be a single_use feature).
79
- */
80
- meteredFeatureId: string;
81
- /**
82
- * The credit cost of the metered feature.
83
- */
84
- creditCost: number;
85
- };
86
- /**
87
- * The full feature object if expanded.
88
- */
89
- type ListPlansFeature = {
90
- /**
91
- * The ID of the feature, used to refer to it in other API calls like /track or /check.
92
- */
93
- id: string;
94
- /**
95
- * The name of the feature.
96
- */
97
- name?: string | null | undefined;
98
- /**
99
- * The type of the feature
100
- */
101
- type: ListPlansType;
102
- /**
103
- * Singular and plural display names for the feature.
104
- */
105
- display?: ListPlansFeatureDisplay | null | undefined;
106
- /**
107
- * Credit cost schema for credit system features.
108
- */
109
- creditSchema?: Array<ListPlansCreditSchema> | null | undefined;
110
- /**
111
- * Whether or not the feature is archived.
112
- */
113
- archived?: boolean | null | undefined;
114
- };
115
- /**
116
- * The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
117
- */
118
- declare const ListPlansResetInterval: {
119
- readonly OneOff: "one_off";
120
- readonly Minute: "minute";
121
- readonly Hour: "hour";
122
- readonly Day: "day";
123
- readonly Week: "week";
124
- readonly Month: "month";
125
- readonly Quarter: "quarter";
126
- readonly SemiAnnual: "semi_annual";
127
- readonly Year: "year";
128
- };
129
- /**
130
- * The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
131
- */
132
- type ListPlansResetInterval = OpenEnum<typeof ListPlansResetInterval>;
133
- type ListPlansReset = {
134
- /**
135
- * The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
136
- */
137
- interval: ListPlansResetInterval;
138
- /**
139
- * Number of intervals between resets. Defaults to 1.
140
- */
141
- intervalCount?: number | undefined;
142
- };
143
- type ListPlansTier = {
144
- to: number | string;
145
- amount: number;
146
- flatAmount?: number | undefined;
147
- };
148
- declare const ListPlansTierBehavior: {
149
- readonly Graduated: "graduated";
150
- readonly Volume: "volume";
151
- };
152
- type ListPlansTierBehavior = OpenEnum<typeof ListPlansTierBehavior>;
153
- /**
154
- * Billing interval for this price. For consumable features, should match reset.interval.
155
- */
156
- declare const ListPlansPriceItemInterval: {
157
- readonly OneOff: "one_off";
158
- readonly Week: "week";
159
- readonly Month: "month";
160
- readonly Quarter: "quarter";
161
- readonly SemiAnnual: "semi_annual";
162
- readonly Year: "year";
163
- };
164
- /**
165
- * Billing interval for this price. For consumable features, should match reset.interval.
166
- */
167
- type ListPlansPriceItemInterval = OpenEnum<typeof ListPlansPriceItemInterval>;
168
- /**
169
- * 'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage.
170
- */
171
- declare const ListPlansBillingMethod: {
172
- readonly Prepaid: "prepaid";
173
- readonly UsageBased: "usage_based";
174
- };
175
- /**
176
- * 'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage.
177
- */
178
- type ListPlansBillingMethod = OpenEnum<typeof ListPlansBillingMethod>;
179
- type ListPlansItemPrice = {
180
- /**
181
- * Price per billing_units after included usage is consumed. Mutually exclusive with tiers.
182
- */
183
- amount?: number | undefined;
184
- /**
185
- * Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
186
- */
187
- tiers?: Array<ListPlansTier> | undefined;
188
- tierBehavior?: ListPlansTierBehavior | undefined;
189
- /**
190
- * Billing interval for this price. For consumable features, should match reset.interval.
191
- */
192
- interval: ListPlansPriceItemInterval;
193
- /**
194
- * Number of intervals per billing cycle. Defaults to 1.
195
- */
196
- intervalCount?: number | undefined;
197
- /**
198
- * Number of units per price increment. Usage is rounded UP to the nearest billing_units when billed (e.g. billing_units=100 means 101 usage rounds to 200).
199
- */
200
- billingUnits: number;
201
- /**
202
- * 'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage.
203
- */
204
- billingMethod: ListPlansBillingMethod;
205
- /**
206
- * Maximum units a customer can purchase beyond included. E.g. if included=100 and max_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
207
- */
208
- maxPurchase: number | null;
209
- };
210
- /**
211
- * Display text for showing this item in pricing pages.
212
- */
213
- type ListPlansItemDisplay = {
214
- /**
215
- * Main display text (e.g. '$10' or '100 messages').
216
- */
217
- primaryText: string;
218
- /**
219
- * Secondary display text (e.g. 'per month' or 'then $0.5 per 100').
220
- */
221
- secondaryText?: string | undefined;
222
- };
223
- /**
224
- * When rolled over units expire.
225
- */
226
- declare const ListPlansExpiryDurationType: {
227
- readonly Month: "month";
228
- readonly Forever: "forever";
229
- };
230
- /**
231
- * When rolled over units expire.
232
- */
233
- type ListPlansExpiryDurationType = OpenEnum<typeof ListPlansExpiryDurationType>;
234
- /**
235
- * Rollover configuration for unused units. If set, unused included units roll over to the next period.
236
- */
237
- type ListPlansRollover = {
238
- /**
239
- * Maximum rollover units. Null for unlimited rollover.
240
- */
241
- max: number | null;
242
- /**
243
- * Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
244
- */
245
- maxPercentage?: number | null | undefined;
246
- /**
247
- * When rolled over units expire.
248
- */
249
- expiryDurationType: ListPlansExpiryDurationType;
250
- /**
251
- * Number of periods before expiry.
252
- */
253
- expiryDurationLength?: number | undefined;
254
- };
255
- type ListPlansItem = {
256
- /**
257
- * The ID of the feature this item configures.
258
- */
259
- featureId: string;
260
- /**
261
- * The full feature object if expanded.
262
- */
263
- feature?: ListPlansFeature | undefined;
264
- /**
265
- * Number of free units included. For consumable features, balance resets to this number each interval.
266
- */
267
- included: number;
268
- /**
269
- * Whether the customer has unlimited access to this feature.
270
- */
271
- unlimited: boolean;
272
- /**
273
- * Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
274
- */
275
- reset: ListPlansReset | null;
276
- /**
277
- * Pricing configuration for usage beyond included units. Null if feature is entirely free.
278
- */
279
- price: ListPlansItemPrice | null;
280
- /**
281
- * Display text for showing this item in pricing pages.
282
- */
283
- display?: ListPlansItemDisplay | undefined;
284
- /**
285
- * Rollover configuration for unused units. If set, unused included units roll over to the next period.
286
- */
287
- rollover?: ListPlansRollover | undefined;
288
- };
289
- /**
290
- * Unit of time for the trial duration ('day', 'month', 'year').
291
- */
292
- declare const ListPlansDurationType: {
293
- readonly Day: "day";
294
- readonly Month: "month";
295
- readonly Year: "year";
296
- };
297
- /**
298
- * Unit of time for the trial duration ('day', 'month', 'year').
299
- */
300
- type ListPlansDurationType = OpenEnum<typeof ListPlansDurationType>;
301
- declare const ListPlansOnEnd: {
302
- readonly Bill: "bill";
303
- readonly Revert: "revert";
304
- };
305
- type ListPlansOnEnd = OpenEnum<typeof ListPlansOnEnd>;
306
- /**
307
- * Free trial configuration. If set, new customers can try this plan before being charged.
308
- */
309
- type ListPlansFreeTrial = {
310
- /**
311
- * Number of duration_type periods the trial lasts.
312
- */
313
- durationLength: number;
314
- /**
315
- * Unit of time for the trial duration ('day', 'month', 'year').
316
- */
317
- durationType: ListPlansDurationType;
318
- /**
319
- * Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
320
- */
321
- cardRequired: boolean;
322
- /**
323
- * Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
324
- */
325
- onEnd?: ListPlansOnEnd | null | undefined;
326
- };
327
- /**
328
- * Environment this plan belongs to ('sandbox' or 'live').
329
- */
330
- declare const ListPlansEnv: {
331
- readonly Sandbox: "sandbox";
332
- readonly Live: "live";
333
- };
334
- /**
335
- * Environment this plan belongs to ('sandbox' or 'live').
336
- */
337
- type ListPlansEnv = OpenEnum<typeof ListPlansEnv>;
338
- /**
339
- * Miscellaneous plan-level configuration flags.
340
- */
341
- type ListPlansConfig = {
342
- /**
343
- * If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
344
- */
345
- ignorePastDue: boolean;
346
- };
347
- /**
348
- * The time interval for the purchase limit window.
349
- */
350
- declare const ListPlansPurchaseLimitInterval: {
351
- readonly Hour: "hour";
352
- readonly Day: "day";
353
- readonly Week: "week";
354
- readonly Month: "month";
355
- };
356
- /**
357
- * The time interval for the purchase limit window.
358
- */
359
- type ListPlansPurchaseLimitInterval = OpenEnum<typeof ListPlansPurchaseLimitInterval>;
360
- /**
361
- * Optional rate limit to cap how often auto top-ups occur.
362
- */
363
- type ListPlansPurchaseLimit = {
364
- /**
365
- * The time interval for the purchase limit window.
366
- */
367
- interval: ListPlansPurchaseLimitInterval;
368
- /**
369
- * Number of intervals in the purchase limit window.
370
- */
371
- intervalCount: number;
372
- /**
373
- * Maximum number of auto top-ups allowed within the interval.
374
- */
375
- limit: number;
376
- };
377
- type ListPlansAutoTopup = {
378
- /**
379
- * The ID of the feature (credit balance) to auto top-up.
380
- */
381
- featureId: string;
382
- /**
383
- * Whether auto top-up is enabled.
384
- */
385
- enabled: boolean;
386
- /**
387
- * When the balance drops below this threshold, an auto top-up will be purchased.
388
- */
389
- threshold: number;
390
- /**
391
- * Amount of credits to add per auto top-up.
392
- */
393
- quantity: number;
394
- /**
395
- * Optional rate limit to cap how often auto top-ups occur.
396
- */
397
- purchaseLimit?: ListPlansPurchaseLimit | undefined;
398
- /**
399
- * When true, auto top-up creates a send_invoice invoice instead of auto-charging.
400
- */
401
- invoiceMode?: boolean | undefined;
402
- };
403
- /**
404
- * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
405
- */
406
- declare const ListPlansLimitType: {
407
- readonly Absolute: "absolute";
408
- readonly UsagePercentage: "usage_percentage";
409
- };
410
- /**
411
- * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
412
- */
413
- type ListPlansLimitType = OpenEnum<typeof ListPlansLimitType>;
414
- type ListPlansSpendLimit = {
415
- /**
416
- * Optional feature ID this spend limit applies to.
417
- */
418
- featureId?: string | undefined;
419
- /**
420
- * Whether the overage spend limit is enabled.
421
- */
422
- enabled: boolean;
423
- /**
424
- * How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
425
- */
426
- limitType?: ListPlansLimitType | undefined;
427
- /**
428
- * Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage.
429
- */
430
- overageLimit?: number | undefined;
431
- };
432
- /**
433
- * Interval for the cap, aligned to the customer's billing cycle.
434
- */
435
- declare const ListPlansUsageLimitInterval: {
436
- readonly Day: "day";
437
- readonly Week: "week";
438
- readonly Month: "month";
439
- readonly Year: "year";
440
- };
441
- /**
442
- * Interval for the cap, aligned to the customer's billing cycle.
443
- */
444
- type ListPlansUsageLimitInterval = OpenEnum<typeof ListPlansUsageLimitInterval>;
445
- type ListPlansUsageLimit = {
446
- /**
447
- * The feature this usage limit applies to.
448
- */
449
- featureId: string;
450
- /**
451
- * Whether this usage limit is enabled.
452
- */
453
- enabled: boolean;
454
- /**
455
- * Maximum units allowed per interval.
456
- */
457
- limit: number;
458
- /**
459
- * Interval for the cap, aligned to the customer's billing cycle.
460
- */
461
- interval: ListPlansUsageLimitInterval;
462
- };
463
- /**
464
- * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
465
- */
466
- declare const ListPlansThresholdType: {
467
- readonly Usage: "usage";
468
- readonly UsagePercentage: "usage_percentage";
469
- readonly Remaining: "remaining";
470
- readonly RemainingPercentage: "remaining_percentage";
471
- };
472
- /**
473
- * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
474
- */
475
- type ListPlansThresholdType = OpenEnum<typeof ListPlansThresholdType>;
476
- type ListPlansUsageAlert = {
477
- /**
478
- * The feature ID this alert applies to.
479
- */
480
- featureId?: string | undefined;
481
- /**
482
- * Whether this usage alert is enabled.
483
- */
484
- enabled: boolean;
485
- /**
486
- * The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage_percentage or remaining_percentage, this is a percentage (0-100).
487
- */
488
- threshold: number;
489
- /**
490
- * Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
491
- */
492
- thresholdType: ListPlansThresholdType;
493
- /**
494
- * Optional user-defined label to distinguish multiple alerts on the same feature.
495
- */
496
- name?: string | undefined;
497
- };
498
- type ListPlansOverageAllowed = {
499
- /**
500
- * The feature ID this overage allowed control applies to.
501
- */
502
- featureId: string;
503
- /**
504
- * Whether overage is allowed for this feature.
505
- */
506
- enabled: boolean;
507
- };
508
- /**
509
- * Plan-level billing controls used as customer defaults.
510
- */
511
- type ListPlansBillingControls = {
512
- /**
513
- * List of auto top-up configurations per feature.
514
- */
515
- autoTopups?: Array<ListPlansAutoTopup> | undefined;
516
- /**
517
- * List of overage spend limits per feature (caps overage spend).
518
- */
519
- spendLimits?: Array<ListPlansSpendLimit> | undefined;
520
- /**
521
- * List of hard usage caps per feature (max units per interval).
522
- */
523
- usageLimits?: Array<ListPlansUsageLimit> | undefined;
524
- /**
525
- * List of usage alert configurations per feature.
526
- */
527
- usageAlerts?: Array<ListPlansUsageAlert> | undefined;
528
- /**
529
- * List of overage allowed controls per feature. When enabled, usage can exceed balance.
530
- */
531
- overageAllowed?: Array<ListPlansOverageAllowed> | undefined;
532
- };
533
- /**
534
- * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
535
- */
536
- declare const ListPlansStatus: {
537
- readonly Active: "active";
538
- readonly Scheduled: "scheduled";
539
- };
540
- /**
541
- * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
542
- */
543
- type ListPlansStatus = OpenEnum<typeof ListPlansStatus>;
544
- /**
545
- * The action that would occur if this plan were attached to the customer.
546
- */
547
- declare const ListPlansAttachAction: {
548
- readonly Activate: "activate";
549
- readonly Upgrade: "upgrade";
550
- readonly Downgrade: "downgrade";
551
- readonly None: "none";
552
- readonly Purchase: "purchase";
553
- };
554
- /**
555
- * The action that would occur if this plan were attached to the customer.
556
- */
557
- type ListPlansAttachAction = OpenEnum<typeof ListPlansAttachAction>;
558
- type ListPlansCustomerEligibility = {
559
- /**
560
- * Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
561
- */
562
- trialAvailable?: boolean | undefined;
563
- /**
564
- * The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
565
- */
566
- status?: ListPlansStatus | undefined;
567
- /**
568
- * Whether the customer's active instance of this plan is set to cancel.
569
- */
570
- canceling?: boolean | undefined;
571
- /**
572
- * Whether the customer is currently on a free trial of this plan.
573
- */
574
- trialing?: boolean | undefined;
575
- /**
576
- * The action that would occur if this plan were attached to the customer.
577
- */
578
- attachAction: ListPlansAttachAction;
579
- };
580
- /**
581
- * A plan defines a set of features, pricing, and entitlements that can be attached to customers.
582
- */
583
- type ListPlansList = {
584
- /**
585
- * Unique identifier for the plan.
586
- */
587
- id: string;
588
- /**
589
- * Display name of the plan.
590
- */
591
- name: string;
592
- /**
593
- * Optional description of the plan.
594
- */
595
- description: string | null;
596
- /**
597
- * Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
598
- */
599
- group: string | null;
600
- /**
601
- * Version number of the plan. Incremented when plan configuration changes.
602
- */
603
- version: number;
604
- /**
605
- * Whether this is an add-on plan that can be attached alongside a main plan.
606
- */
607
- addOn: boolean;
608
- /**
609
- * If true, this plan is automatically attached when a customer is created. Used for free plans.
610
- */
611
- autoEnable: boolean;
612
- /**
613
- * Base recurring price for the plan. Null for free plans or usage-only plans.
614
- */
615
- price: ListPlansPrice | null;
616
- /**
617
- * Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
618
- */
619
- items: Array<ListPlansItem>;
620
- /**
621
- * Free trial configuration. If set, new customers can try this plan before being charged.
622
- */
623
- freeTrial?: ListPlansFreeTrial | undefined;
624
- /**
625
- * Unix timestamp (ms) when the plan was created.
626
- */
627
- createdAt: number;
628
- /**
629
- * Environment this plan belongs to ('sandbox' or 'live').
630
- */
631
- env: ListPlansEnv;
632
- /**
633
- * Whether the plan is archived. Archived plans cannot be attached to new customers.
634
- */
635
- archived: boolean;
636
- /**
637
- * If this is a variant, the ID of the base plan it was created from.
638
- */
639
- baseVariantId: string | null;
640
- /**
641
- * Miscellaneous plan-level configuration flags.
642
- */
643
- config: ListPlansConfig;
644
- /**
645
- * Plan-level billing controls used as customer defaults.
646
- */
647
- billingControls?: ListPlansBillingControls | undefined;
648
- /**
649
- * Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
650
- */
651
- metadata: {
652
- [k: string]: any;
653
- };
654
- customerEligibility?: ListPlansCustomerEligibility | undefined;
655
- };
656
- /**
657
- * OK
658
- */
659
- type ListPlansResponse = {
660
- list: Array<ListPlansList>;
661
- };
1
+ import { d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse, b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse, t as ClientListPlansParams, e as ClientListEventsParams, L as ListEventsResponse, C as ClientAggregateEventsParams, u as AggregateEventsResponse, c as ClientGetEntityParams, G as GetEntityResponse } from '../params-CFhvUVCf.js';
2
+ import { C as Customer } from '../customer-Djhe48ql.js';
3
+ import { L as ListPlansResponse } from '../list-plans-op-D-K2LRZV.js';
4
+ import '../plan-DOxbvjQY.js';
662
5
 
663
6
  /** Client interface matching backend RPC routes */
664
7
  interface IAutumnClient {
@@ -1,6 +1,7 @@
1
1
  export { AutumnClientConfig, createAutumnClient } from './AutumnClient.mjs';
2
2
  export { AutumnClientError } from './AutumnClientError.mjs';
3
3
  export { IAutumnClient } from './IAutumnClient.mjs';
4
- import '../params-De-y8uix.mjs';
5
- import '../plan-CLcmg-03.mjs';
6
- import '../customer-CaXD8bb5.mjs';
4
+ import '../params-D3ra6In7.mjs';
5
+ import '../plan-DOxbvjQY.mjs';
6
+ import '../customer-IVcJjz9u.mjs';
7
+ import '../list-plans-op-ByqRxdNR.mjs';
@@ -1,6 +1,7 @@
1
1
  export { AutumnClientConfig, createAutumnClient } from './AutumnClient.js';
2
2
  export { AutumnClientError } from './AutumnClientError.js';
3
3
  export { IAutumnClient } from './IAutumnClient.js';
4
- import '../params-Dn_5H61j.js';
5
- import '../plan-CLcmg-03.js';
6
- import '../customer-Doa3UnAJ.js';
4
+ import '../params-CFhvUVCf.js';
5
+ import '../plan-DOxbvjQY.js';
6
+ import '../customer-Djhe48ql.js';
7
+ import '../list-plans-op-D-K2LRZV.js';