autumn-js 0.1.11 → 0.1.12

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 (192) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +30 -26
  2. package/dist/libraries/backend/better-auth.d.ts +30 -26
  3. package/dist/libraries/backend/better-auth.js +172 -2
  4. package/dist/libraries/backend/better-auth.mjs +7 -7
  5. package/dist/libraries/backend/{chunk-EW2R7722.mjs → chunk-2DWGCQCF.mjs} +1 -1
  6. package/dist/libraries/backend/{chunk-VNJ3MFJE.mjs → chunk-56RGUNOT.mjs} +1 -1
  7. package/dist/libraries/backend/{chunk-P3ARLB2M.mjs → chunk-6JI6MF4S.mjs} +1 -1
  8. package/dist/libraries/backend/{chunk-5DDCZMDB.mjs → chunk-FA5Z2MOT.mjs} +1 -1
  9. package/dist/libraries/backend/{chunk-RAHKKJED.mjs → chunk-NWPFUFXX.mjs} +6 -6
  10. package/dist/libraries/backend/{chunk-NAP2URIW.mjs → chunk-Q7SD535L.mjs} +172 -2
  11. package/dist/libraries/backend/{chunk-7K3RATTK.mjs → chunk-SDL7BFTH.mjs} +1 -1
  12. package/dist/libraries/backend/convex.js +172 -2
  13. package/dist/libraries/backend/convex.mjs +7 -7
  14. package/dist/libraries/backend/elysia.js +172 -2
  15. package/dist/libraries/backend/elysia.mjs +7 -7
  16. package/dist/libraries/backend/express.d.mts +1 -1
  17. package/dist/libraries/backend/express.d.ts +1 -1
  18. package/dist/libraries/backend/express.js +172 -2
  19. package/dist/libraries/backend/express.mjs +7 -7
  20. package/dist/libraries/backend/fastify.js +172 -2
  21. package/dist/libraries/backend/fastify.mjs +7 -7
  22. package/dist/libraries/backend/hono.js +172 -2
  23. package/dist/libraries/backend/hono.mjs +7 -7
  24. package/dist/libraries/backend/index.d.mts +1 -1
  25. package/dist/libraries/backend/index.d.ts +1 -1
  26. package/dist/libraries/backend/index.js +172 -2
  27. package/dist/libraries/backend/index.mjs +7 -7
  28. package/dist/libraries/backend/next.js +172 -2
  29. package/dist/libraries/backend/next.mjs +7 -7
  30. package/dist/libraries/backend/react-router.js +172 -2
  31. package/dist/libraries/backend/react-router.mjs +7 -7
  32. package/dist/libraries/backend/{referralTypes-C1eZ8cjO.d.mts → referralTypes-BOsjdpOb.d.mts} +176 -6
  33. package/dist/libraries/backend/{referralTypes-FlI0fYwz.d.ts → referralTypes-DcfU8B6R.d.ts} +176 -6
  34. package/dist/libraries/backend/remix_dep.js +172 -2
  35. package/dist/libraries/backend/remix_dep.mjs +7 -7
  36. package/dist/libraries/backend/routes/backendRouter.js +172 -2
  37. package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
  38. package/dist/libraries/backend/routes/entityRoutes.js +172 -2
  39. package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
  40. package/dist/libraries/backend/routes/genRoutes.js +172 -2
  41. package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
  42. package/dist/libraries/backend/routes/productRoutes.js +172 -2
  43. package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
  44. package/dist/libraries/backend/routes/referralRoutes.js +172 -2
  45. package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
  46. package/dist/libraries/backend/supabase.js +172 -2
  47. package/dist/libraries/backend/supabase.mjs +7 -7
  48. package/dist/libraries/backend/tanstack.js +172 -2
  49. package/dist/libraries/backend/tanstack.mjs +7 -7
  50. package/dist/libraries/backend/utils/backendRes.js +172 -2
  51. package/dist/libraries/backend/utils/backendRes.mjs +1 -1
  52. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  53. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  54. package/dist/libraries/backend/utils/withAuth.js +172 -2
  55. package/dist/libraries/backend/utils/withAuth.mjs +2 -2
  56. package/dist/libraries/react/AutumnContext.d.mts +6 -6
  57. package/dist/libraries/react/AutumnContext.d.ts +6 -6
  58. package/dist/libraries/react/AutumnContext.js +172 -2
  59. package/dist/libraries/react/AutumnContext.mjs +4 -4
  60. package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
  61. package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
  62. package/dist/libraries/react/BaseAutumnProvider.js +172 -13
  63. package/dist/libraries/react/BaseAutumnProvider.mjs +9 -9
  64. package/dist/libraries/react/{ReactAutumnClient-CfDtucnL.d.ts → ReactAutumnClient-CIAkiqwV.d.ts} +5 -5
  65. package/dist/libraries/react/{ReactAutumnClient-IFdMWiu5.d.mts → ReactAutumnClient-zBxnpPLM.d.mts} +5 -5
  66. package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
  67. package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
  68. package/dist/libraries/react/ReactAutumnProvider.js +172 -13
  69. package/dist/libraries/react/ReactAutumnProvider.mjs +10 -10
  70. package/dist/libraries/react/{attachTypes-CLK4jfuj.d.ts → attachTypes-BQaZHr5e.d.ts} +1 -1
  71. package/dist/libraries/react/{attachTypes-C5gcbNrS.d.mts → attachTypes-Cuxn1ThG.d.mts} +1 -1
  72. package/dist/libraries/react/{chunk-4NZ7ML7V.mjs → chunk-26K62U62.mjs} +2 -2
  73. package/dist/libraries/react/{chunk-WYQMHQUE.mjs → chunk-5O3IHYFF.mjs} +172 -2
  74. package/dist/libraries/react/{chunk-3MF54MDU.mjs → chunk-5RTUQSYZ.mjs} +1 -1
  75. package/dist/libraries/react/{chunk-XK3AXQED.mjs → chunk-6X76WFOV.mjs} +3 -13
  76. package/dist/libraries/react/{chunk-JHFJKAXG.mjs → chunk-7A2PZDUO.mjs} +25 -25
  77. package/dist/libraries/react/{chunk-YHT2JUXO.mjs → chunk-7HRCOEUW.mjs} +1 -1
  78. package/dist/libraries/react/{chunk-KP2Q65Y3.mjs → chunk-CMUWZZWV.mjs} +2 -2
  79. package/dist/libraries/react/{chunk-KMYL54B4.mjs → chunk-DKOF357C.mjs} +1 -1
  80. package/dist/libraries/react/{chunk-67RWFVWN.mjs → chunk-HNIU2WNT.mjs} +2 -2
  81. package/dist/libraries/react/{chunk-U3OQJXCW.mjs → chunk-JTYEHM27.mjs} +4 -4
  82. package/dist/libraries/react/{chunk-6D6TYTTO.mjs → chunk-P6CAHZVT.mjs} +1 -2
  83. package/dist/libraries/react/{chunk-TTLL63A4.mjs → chunk-QNMB7QR6.mjs} +3 -3
  84. package/dist/libraries/react/{chunk-2ENHPIYQ.mjs → chunk-RK4NRHHQ.mjs} +3 -3
  85. package/dist/libraries/react/{chunk-VZY225C6.mjs → chunk-ROKCGZ77.mjs} +2 -2
  86. package/dist/libraries/react/{chunk-FDNQ6GRK.mjs → chunk-TE2MOBO7.mjs} +1 -1
  87. package/dist/libraries/react/{chunk-OMJJLT2Q.mjs → chunk-VGNA76RG.mjs} +1 -1
  88. package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
  89. package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
  90. package/dist/libraries/react/client/ReactAutumnClient.js +172 -2
  91. package/dist/libraries/react/client/ReactAutumnClient.mjs +3 -3
  92. package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
  93. package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
  94. package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
  95. package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
  96. package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
  97. package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
  98. package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
  99. package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
  100. package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
  101. package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
  102. package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
  103. package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
  104. package/dist/libraries/react/client/types/clientGenTypes.js +172 -2
  105. package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
  106. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
  107. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
  108. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +172 -13
  109. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +26 -26
  110. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
  111. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
  112. package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
  113. package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
  114. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +172 -2
  115. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +26 -26
  116. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
  117. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
  118. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  119. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  120. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +172 -13
  121. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +26 -26
  122. package/dist/libraries/react/components/ui/button.d.mts +2 -2
  123. package/dist/libraries/react/components/ui/button.d.ts +2 -2
  124. package/dist/libraries/react/components/ui/dialog.mjs +2 -2
  125. package/dist/libraries/react/components/ui/popover.mjs +2 -2
  126. package/dist/libraries/react/{cusTypes-CBapqjzm.d.mts → cusTypes-B2m4-oz4.d.mts} +1 -1
  127. package/dist/libraries/react/{cusTypes-D13MXEN7.d.ts → cusTypes-lMnznWYJ.d.ts} +1 -1
  128. package/dist/libraries/react/{entTypes-C1bM1Zpv.d.mts → entTypes-D-gn1jj2.d.mts} +1 -1
  129. package/dist/libraries/react/{entTypes-DbIrfEpl.d.ts → entTypes-WMQRyYAv.d.ts} +1 -1
  130. package/dist/libraries/react/{genTypes-C_ilxndU.d.mts → genTypes-DdYlVEah.d.mts} +1 -1
  131. package/dist/libraries/react/{genTypes-DjcQWIOM.d.ts → genTypes-aPPwPimh.d.ts} +1 -1
  132. package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
  133. package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
  134. package/dist/libraries/react/hooks/helpers/handleCheck.js +172 -2
  135. package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
  136. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -6
  137. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -6
  138. package/dist/libraries/react/hooks/helpers/useAutumnBase.js +172 -3
  139. package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
  140. package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
  141. package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
  142. package/dist/libraries/react/hooks/useAnalytics.js +172 -2
  143. package/dist/libraries/react/hooks/useAnalytics.mjs +5 -5
  144. package/dist/libraries/react/hooks/useCustomer.d.mts +66 -8
  145. package/dist/libraries/react/hooks/useCustomer.d.ts +66 -8
  146. package/dist/libraries/react/hooks/useCustomer.js +172 -13
  147. package/dist/libraries/react/hooks/useCustomer.mjs +9 -9
  148. package/dist/libraries/react/hooks/useCustomerBase.d.mts +50 -9
  149. package/dist/libraries/react/hooks/useCustomerBase.d.ts +50 -9
  150. package/dist/libraries/react/hooks/useCustomerBase.js +172 -13
  151. package/dist/libraries/react/hooks/useCustomerBase.mjs +8 -8
  152. package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
  153. package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
  154. package/dist/libraries/react/hooks/useEntity.js +172 -3
  155. package/dist/libraries/react/hooks/useEntity.mjs +9 -9
  156. package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
  157. package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
  158. package/dist/libraries/react/hooks/useEntityBase.js +172 -3
  159. package/dist/libraries/react/hooks/useEntityBase.mjs +8 -8
  160. package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
  161. package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
  162. package/dist/libraries/react/hooks/usePaywall.js +172 -2
  163. package/dist/libraries/react/hooks/usePaywall.mjs +5 -5
  164. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  165. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  166. package/dist/libraries/react/hooks/usePricingTable.js +172 -2
  167. package/dist/libraries/react/hooks/usePricingTable.mjs +6 -6
  168. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
  169. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
  170. package/dist/libraries/react/hooks/usePricingTableBase.js +172 -2
  171. package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
  172. package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
  173. package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
  174. package/dist/libraries/react/index.d.mts +104 -7
  175. package/dist/libraries/react/index.d.ts +104 -7
  176. package/dist/libraries/react/index.js +172 -13
  177. package/dist/libraries/react/index.mjs +172 -13
  178. package/dist/libraries/react/{prodTypes-B8NdKyKo.d.ts → prodTypes-C8xRoBP7.d.mts} +1 -1
  179. package/dist/libraries/react/{prodTypes-B8NdKyKo.d.mts → prodTypes-C8xRoBP7.d.ts} +1 -1
  180. package/dist/next/client/hooks/useCustomer.d.mts +44 -7
  181. package/dist/next/client/hooks/useCustomer.d.ts +44 -7
  182. package/dist/next/server/cusActions.d.mts +176 -6
  183. package/dist/next/server/cusActions.d.ts +176 -6
  184. package/dist/sdk/index.d.mts +174 -4
  185. package/dist/sdk/index.d.ts +174 -4
  186. package/dist/sdk/index.js +171 -1
  187. package/dist/sdk/index.mjs +171 -1
  188. package/dist/utils/encryptUtils.js +172 -2
  189. package/dist/utils/encryptUtils.mjs +172 -2
  190. package/package.json +1 -1
  191. package/dist/libraries/react/{chunk-7JNU5ABT.mjs → chunk-FJWZPMWU.mjs} +3 -3
  192. package/dist/libraries/react/{chunk-LCWL3TIT.mjs → chunk-OTZ65PCT.mjs} +3 -3
@@ -92,11 +92,13 @@ declare const autumn: (options?: {
92
92
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
93
93
  body: {
94
94
  product_id: string;
95
- entity_id?: string | undefined;
96
95
  options?: {
97
96
  feature_id: string;
98
97
  quantity: number;
99
98
  }[] | undefined;
99
+ entity_id?: string | undefined;
100
+ force_checkout?: boolean | undefined;
101
+ invoice?: boolean | undefined;
100
102
  success_url?: string | undefined;
101
103
  customer_data?: {
102
104
  name?: string | null | undefined;
@@ -132,12 +134,14 @@ declare const autumn: (options?: {
132
134
  options: {
133
135
  method: "POST";
134
136
  body: z.ZodObject<{
135
- entity_id: z.ZodOptional<z.ZodString>;
136
- product_id: z.ZodString;
137
137
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
138
138
  feature_id: z.ZodString;
139
139
  quantity: z.ZodNumber;
140
140
  }, z.core.$strip>>>;
141
+ product_id: z.ZodString;
142
+ entity_id: z.ZodOptional<z.ZodString>;
143
+ force_checkout: z.ZodOptional<z.ZodBoolean>;
144
+ invoice: z.ZodOptional<z.ZodBoolean>;
141
145
  success_url: z.ZodOptional<z.ZodString>;
142
146
  customer_data: z.ZodOptional<z.ZodObject<{
143
147
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -179,17 +183,16 @@ declare const autumn: (options?: {
179
183
  attach: {
180
184
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
181
185
  body: {
182
- entity_id?: string | undefined;
183
- metadata?: Record<string, string> | undefined;
184
- product_id?: string | undefined;
185
186
  options?: {
186
187
  feature_id: string;
187
188
  quantity: number;
188
189
  }[] | undefined;
189
- product_ids?: string[] | undefined;
190
- free_trial?: boolean | undefined;
191
- success_url?: string | undefined;
190
+ metadata?: Record<string, string> | undefined;
191
+ product_id?: string | undefined;
192
+ entity_id?: string | undefined;
192
193
  force_checkout?: boolean | undefined;
194
+ invoice?: boolean | undefined;
195
+ success_url?: string | undefined;
193
196
  customer_data?: {
194
197
  name?: string | null | undefined;
195
198
  email?: string | null | undefined;
@@ -198,7 +201,8 @@ declare const autumn: (options?: {
198
201
  entity_data?: any;
199
202
  checkout_session_params?: Record<string, any> | undefined;
200
203
  reward?: string | undefined;
201
- invoice?: boolean | undefined;
204
+ product_ids?: string[] | undefined;
205
+ free_trial?: boolean | undefined;
202
206
  };
203
207
  } & {
204
208
  method?: "POST" | undefined;
@@ -225,17 +229,16 @@ declare const autumn: (options?: {
225
229
  options: {
226
230
  method: "POST";
227
231
  body: z.ZodObject<{
228
- entity_id: z.ZodOptional<z.ZodString>;
229
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
230
- product_id: z.ZodOptional<z.ZodString>;
231
232
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
232
233
  feature_id: z.ZodString;
233
234
  quantity: z.ZodNumber;
234
235
  }, z.core.$strip>>>;
235
- product_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
- free_trial: z.ZodOptional<z.ZodBoolean>;
237
- success_url: z.ZodOptional<z.ZodString>;
236
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
237
+ product_id: z.ZodOptional<z.ZodString>;
238
+ entity_id: z.ZodOptional<z.ZodString>;
238
239
  force_checkout: z.ZodOptional<z.ZodBoolean>;
240
+ invoice: z.ZodOptional<z.ZodBoolean>;
241
+ success_url: z.ZodOptional<z.ZodString>;
239
242
  customer_data: z.ZodOptional<z.ZodObject<{
240
243
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
241
244
  email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -244,7 +247,8 @@ declare const autumn: (options?: {
244
247
  entity_data: z.ZodOptional<z.ZodAny>;
245
248
  checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
246
249
  reward: z.ZodOptional<z.ZodString>;
247
- invoice: z.ZodOptional<z.ZodBoolean>;
250
+ product_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
251
+ free_trial: z.ZodOptional<z.ZodBoolean>;
248
252
  }, z.core.$strip>;
249
253
  use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
250
254
  session: {
@@ -277,15 +281,15 @@ declare const autumn: (options?: {
277
281
  check: {
278
282
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
279
283
  body: {
280
- feature_id?: string | undefined;
281
- entity_id?: string | undefined;
282
- required_balance?: number | undefined;
283
284
  product_id?: string | undefined;
285
+ entity_id?: string | undefined;
286
+ feature_id?: string | undefined;
284
287
  customer_data?: any;
285
288
  entity_data?: {
286
289
  feature_id: string;
287
290
  name?: string | undefined;
288
291
  } | undefined;
292
+ required_balance?: number | undefined;
289
293
  send_event?: boolean | undefined;
290
294
  with_preview?: boolean | undefined;
291
295
  };
@@ -314,15 +318,15 @@ declare const autumn: (options?: {
314
318
  options: {
315
319
  method: "POST";
316
320
  body: z.ZodObject<{
317
- feature_id: z.ZodOptional<z.ZodString>;
318
- entity_id: z.ZodOptional<z.ZodString>;
319
- required_balance: z.ZodOptional<z.ZodNumber>;
320
321
  product_id: z.ZodOptional<z.ZodString>;
322
+ entity_id: z.ZodOptional<z.ZodString>;
323
+ feature_id: z.ZodOptional<z.ZodString>;
321
324
  customer_data: z.ZodOptional<z.ZodAny>;
322
325
  entity_data: z.ZodOptional<z.ZodObject<{
323
326
  name: z.ZodOptional<z.ZodString>;
324
327
  feature_id: z.ZodString;
325
328
  }, z.core.$strip>>;
329
+ required_balance: z.ZodOptional<z.ZodNumber>;
326
330
  send_event: z.ZodOptional<z.ZodBoolean>;
327
331
  with_preview: z.ZodOptional<z.ZodBoolean>;
328
332
  }, z.core.$strip>;
@@ -357,8 +361,8 @@ declare const autumn: (options?: {
357
361
  track: {
358
362
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
359
363
  body: {
360
- feature_id?: string | undefined;
361
364
  entity_id?: string | undefined;
365
+ feature_id?: string | undefined;
362
366
  customer_data?: any;
363
367
  entity_data?: any;
364
368
  value?: number | undefined;
@@ -390,8 +394,8 @@ declare const autumn: (options?: {
390
394
  options: {
391
395
  method: "POST";
392
396
  body: z.ZodObject<{
393
- feature_id: z.ZodOptional<z.ZodString>;
394
397
  entity_id: z.ZodOptional<z.ZodString>;
398
+ feature_id: z.ZodOptional<z.ZodString>;
395
399
  customer_data: z.ZodOptional<z.ZodAny>;
396
400
  entity_data: z.ZodOptional<z.ZodAny>;
397
401
  value: z.ZodOptional<z.ZodNumber>;
@@ -458,8 +462,8 @@ declare const autumn: (options?: {
458
462
  options: {
459
463
  method: "POST";
460
464
  body: z.ZodObject<{
461
- entity_id: z.ZodOptional<z.ZodString>;
462
465
  product_id: z.ZodString;
466
+ entity_id: z.ZodOptional<z.ZodString>;
463
467
  cancel_immediately: z.ZodOptional<z.ZodBoolean>;
464
468
  }, z.core.$strip>;
465
469
  use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
@@ -92,11 +92,13 @@ declare const autumn: (options?: {
92
92
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
93
93
  body: {
94
94
  product_id: string;
95
- entity_id?: string | undefined;
96
95
  options?: {
97
96
  feature_id: string;
98
97
  quantity: number;
99
98
  }[] | undefined;
99
+ entity_id?: string | undefined;
100
+ force_checkout?: boolean | undefined;
101
+ invoice?: boolean | undefined;
100
102
  success_url?: string | undefined;
101
103
  customer_data?: {
102
104
  name?: string | null | undefined;
@@ -132,12 +134,14 @@ declare const autumn: (options?: {
132
134
  options: {
133
135
  method: "POST";
134
136
  body: z.ZodObject<{
135
- entity_id: z.ZodOptional<z.ZodString>;
136
- product_id: z.ZodString;
137
137
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
138
138
  feature_id: z.ZodString;
139
139
  quantity: z.ZodNumber;
140
140
  }, z.core.$strip>>>;
141
+ product_id: z.ZodString;
142
+ entity_id: z.ZodOptional<z.ZodString>;
143
+ force_checkout: z.ZodOptional<z.ZodBoolean>;
144
+ invoice: z.ZodOptional<z.ZodBoolean>;
141
145
  success_url: z.ZodOptional<z.ZodString>;
142
146
  customer_data: z.ZodOptional<z.ZodObject<{
143
147
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -179,17 +183,16 @@ declare const autumn: (options?: {
179
183
  attach: {
180
184
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
181
185
  body: {
182
- entity_id?: string | undefined;
183
- metadata?: Record<string, string> | undefined;
184
- product_id?: string | undefined;
185
186
  options?: {
186
187
  feature_id: string;
187
188
  quantity: number;
188
189
  }[] | undefined;
189
- product_ids?: string[] | undefined;
190
- free_trial?: boolean | undefined;
191
- success_url?: string | undefined;
190
+ metadata?: Record<string, string> | undefined;
191
+ product_id?: string | undefined;
192
+ entity_id?: string | undefined;
192
193
  force_checkout?: boolean | undefined;
194
+ invoice?: boolean | undefined;
195
+ success_url?: string | undefined;
193
196
  customer_data?: {
194
197
  name?: string | null | undefined;
195
198
  email?: string | null | undefined;
@@ -198,7 +201,8 @@ declare const autumn: (options?: {
198
201
  entity_data?: any;
199
202
  checkout_session_params?: Record<string, any> | undefined;
200
203
  reward?: string | undefined;
201
- invoice?: boolean | undefined;
204
+ product_ids?: string[] | undefined;
205
+ free_trial?: boolean | undefined;
202
206
  };
203
207
  } & {
204
208
  method?: "POST" | undefined;
@@ -225,17 +229,16 @@ declare const autumn: (options?: {
225
229
  options: {
226
230
  method: "POST";
227
231
  body: z.ZodObject<{
228
- entity_id: z.ZodOptional<z.ZodString>;
229
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
230
- product_id: z.ZodOptional<z.ZodString>;
231
232
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
232
233
  feature_id: z.ZodString;
233
234
  quantity: z.ZodNumber;
234
235
  }, z.core.$strip>>>;
235
- product_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
- free_trial: z.ZodOptional<z.ZodBoolean>;
237
- success_url: z.ZodOptional<z.ZodString>;
236
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
237
+ product_id: z.ZodOptional<z.ZodString>;
238
+ entity_id: z.ZodOptional<z.ZodString>;
238
239
  force_checkout: z.ZodOptional<z.ZodBoolean>;
240
+ invoice: z.ZodOptional<z.ZodBoolean>;
241
+ success_url: z.ZodOptional<z.ZodString>;
239
242
  customer_data: z.ZodOptional<z.ZodObject<{
240
243
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
241
244
  email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -244,7 +247,8 @@ declare const autumn: (options?: {
244
247
  entity_data: z.ZodOptional<z.ZodAny>;
245
248
  checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
246
249
  reward: z.ZodOptional<z.ZodString>;
247
- invoice: z.ZodOptional<z.ZodBoolean>;
250
+ product_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
251
+ free_trial: z.ZodOptional<z.ZodBoolean>;
248
252
  }, z.core.$strip>;
249
253
  use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
250
254
  session: {
@@ -277,15 +281,15 @@ declare const autumn: (options?: {
277
281
  check: {
278
282
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
279
283
  body: {
280
- feature_id?: string | undefined;
281
- entity_id?: string | undefined;
282
- required_balance?: number | undefined;
283
284
  product_id?: string | undefined;
285
+ entity_id?: string | undefined;
286
+ feature_id?: string | undefined;
284
287
  customer_data?: any;
285
288
  entity_data?: {
286
289
  feature_id: string;
287
290
  name?: string | undefined;
288
291
  } | undefined;
292
+ required_balance?: number | undefined;
289
293
  send_event?: boolean | undefined;
290
294
  with_preview?: boolean | undefined;
291
295
  };
@@ -314,15 +318,15 @@ declare const autumn: (options?: {
314
318
  options: {
315
319
  method: "POST";
316
320
  body: z.ZodObject<{
317
- feature_id: z.ZodOptional<z.ZodString>;
318
- entity_id: z.ZodOptional<z.ZodString>;
319
- required_balance: z.ZodOptional<z.ZodNumber>;
320
321
  product_id: z.ZodOptional<z.ZodString>;
322
+ entity_id: z.ZodOptional<z.ZodString>;
323
+ feature_id: z.ZodOptional<z.ZodString>;
321
324
  customer_data: z.ZodOptional<z.ZodAny>;
322
325
  entity_data: z.ZodOptional<z.ZodObject<{
323
326
  name: z.ZodOptional<z.ZodString>;
324
327
  feature_id: z.ZodString;
325
328
  }, z.core.$strip>>;
329
+ required_balance: z.ZodOptional<z.ZodNumber>;
326
330
  send_event: z.ZodOptional<z.ZodBoolean>;
327
331
  with_preview: z.ZodOptional<z.ZodBoolean>;
328
332
  }, z.core.$strip>;
@@ -357,8 +361,8 @@ declare const autumn: (options?: {
357
361
  track: {
358
362
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
359
363
  body: {
360
- feature_id?: string | undefined;
361
364
  entity_id?: string | undefined;
365
+ feature_id?: string | undefined;
362
366
  customer_data?: any;
363
367
  entity_data?: any;
364
368
  value?: number | undefined;
@@ -390,8 +394,8 @@ declare const autumn: (options?: {
390
394
  options: {
391
395
  method: "POST";
392
396
  body: z.ZodObject<{
393
- feature_id: z.ZodOptional<z.ZodString>;
394
397
  entity_id: z.ZodOptional<z.ZodString>;
398
+ feature_id: z.ZodOptional<z.ZodString>;
395
399
  customer_data: z.ZodOptional<z.ZodAny>;
396
400
  entity_data: z.ZodOptional<z.ZodAny>;
397
401
  value: z.ZodOptional<z.ZodNumber>;
@@ -458,8 +462,8 @@ declare const autumn: (options?: {
458
462
  options: {
459
463
  method: "POST";
460
464
  body: z.ZodObject<{
461
- entity_id: z.ZodOptional<z.ZodString>;
462
465
  product_id: z.ZodString;
466
+ entity_id: z.ZodOptional<z.ZodString>;
463
467
  cancel_immediately: z.ZodOptional<z.ZodBoolean>;
464
468
  }, z.core.$strip>;
465
469
  use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
@@ -476,22 +476,92 @@ var Autumn = class {
476
476
  entities = entityMethods(this);
477
477
  referrals = referralMethods(this);
478
478
  features = featureMethods(this);
479
- static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
479
+ /**
480
+ * Initiates a checkout flow for a product purchase.
481
+ *
482
+ * The checkout function handles the purchase process for products with pricing.
483
+ * It determines whether to show a dialog for user input or redirect directly
484
+ * to Stripe based on the customer's state and product requirements.
485
+ *
486
+ * @param params - Checkout parameters including product ID, customer data, and options
487
+ * @returns Promise resolving to checkout details including pricing, prorations, and URLs
488
+ *
489
+ * @example
490
+ * ```typescript
491
+ * const result = await autumn.checkout({
492
+ * customer_id: "user_123",
493
+ * product_id: "pro",
494
+ * success_url: "https://myapp.com/success"
495
+ * });
496
+ *
497
+ * if (result.url) {
498
+ * // Redirect to Stripe checkout
499
+ * window.location.href = result.url;
500
+ * }
501
+ * ```
502
+ */
480
503
  async checkout(params) {
481
504
  return handleCheckout({
482
505
  instance: this,
483
506
  params
484
507
  });
485
508
  }
486
- static attach = (params) => staticWrapper(handleAttach, void 0, { params });
509
+ static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
487
510
  static usage = (params) => staticWrapper(handleUsage, void 0, { params });
511
+ /**
512
+ * Attaches a product to a customer, enabling access and handling billing.
513
+ *
514
+ * The attach function activates a product for a customer and applies all product items.
515
+ * When you attach a product:
516
+ * - The customer gains access to all features in the product
517
+ * - If the product has prices, the customer will be billed accordingly
518
+ * - If there's no existing payment method, a checkout URL will be generated
519
+ *
520
+ * @param params - Attach parameters including customer ID, product ID, and options
521
+ * @returns Promise resolving to attachment result with checkout URL if needed
522
+ *
523
+ * @example
524
+ * ```typescript
525
+ * const result = await autumn.attach({
526
+ * customer_id: "user_123",
527
+ * product_id: "pro",
528
+ * success_url: "https://myapp.com/success"
529
+ * });
530
+ *
531
+ * if (result.checkout_url) {
532
+ * // Payment required - redirect to checkout
533
+ * window.location.href = result.checkout_url;
534
+ * } else {
535
+ * // Product successfully attached
536
+ * console.log("Access granted:", result.message);
537
+ * }
538
+ * ```
539
+ */
488
540
  async attach(params) {
489
541
  return handleAttach({
490
542
  instance: this,
491
543
  params
492
544
  });
493
545
  }
546
+ static attach = (params) => staticWrapper(handleAttach, void 0, { params });
494
547
  static setupPayment = (params) => staticWrapper(handleSetupPayment, void 0, { params });
548
+ /**
549
+ * Sets up a payment method for a customer.
550
+ *
551
+ * This method allows you to set up payment methods for customers without
552
+ * immediately charging them. Useful for collecting payment information
553
+ * before product attachment or for updating existing payment methods.
554
+ *
555
+ * @param params - Setup payment parameters including customer information
556
+ * @returns Promise resolving to setup payment result
557
+ *
558
+ * @example
559
+ * ```typescript
560
+ * const result = await autumn.setupPayment({
561
+ * customer_id: "user_123"
562
+ * });
563
+ * ```
564
+ */
495
565
  async setupPayment(params) {
496
566
  return handleSetupPayment({
497
567
  instance: this,
@@ -499,6 +569,24 @@ var Autumn = class {
499
569
  });
500
570
  }
501
571
  static cancel = (params) => staticWrapper(handleCancel, void 0, { params });
572
+ /**
573
+ * Cancels a customer's subscription or product attachment.
574
+ *
575
+ * This method allows you to cancel a customer's subscription to a specific product.
576
+ * You can choose to cancel immediately or at the end of the billing cycle.
577
+ *
578
+ * @param params - Cancel parameters including customer ID and product ID
579
+ * @returns Promise resolving to cancellation result
580
+ *
581
+ * @example
582
+ * ```typescript
583
+ * const result = await autumn.cancel({
584
+ * customer_id: "user_123",
585
+ * product_id: "pro",
586
+ * cancel_immediately: false // Cancel at end of billing cycle
587
+ * });
588
+ * ```
589
+ */
502
590
  async cancel(params) {
503
591
  return handleCancel({
504
592
  instance: this,
@@ -506,6 +594,29 @@ var Autumn = class {
506
594
  });
507
595
  }
508
596
  static check = (params) => staticWrapper(handleCheck, void 0, { params });
597
+ /**
598
+ * Checks if a customer has access to a specific feature.
599
+ *
600
+ * This method verifies whether a customer has permission to use a feature
601
+ * and checks their remaining balance/usage limits. It can be used to gate
602
+ * features and determine when to show upgrade prompts.
603
+ *
604
+ * @param params - Check parameters including customer ID and feature ID
605
+ * @returns Promise resolving to access check result with allowed status and balance info
606
+ *
607
+ * @example
608
+ * ```typescript
609
+ * const result = await autumn.check({
610
+ * customer_id: "user_123",
611
+ * feature_id: "messages",
612
+ * required_balance: 1
613
+ * });
614
+ *
615
+ * if (!result.allowed) {
616
+ * console.log("Feature access denied - upgrade required");
617
+ * }
618
+ * ```
619
+ */
509
620
  async check(params) {
510
621
  return handleCheck({
511
622
  instance: this,
@@ -513,12 +624,50 @@ var Autumn = class {
513
624
  });
514
625
  }
515
626
  static track = (params) => staticWrapper(handleTrack, void 0, { params });
627
+ /**
628
+ * Tracks usage events for features or analytics.
629
+ *
630
+ * This method records usage events for metered features, updating the customer's
631
+ * balance and usage statistics. It's typically used server-side to ensure
632
+ * accurate tracking that cannot be manipulated by users.
633
+ *
634
+ * @param params - Track parameters including customer ID, feature ID, and usage value
635
+ * @returns Promise resolving to tracking result
636
+ *
637
+ * @example
638
+ * ```typescript
639
+ * const result = await autumn.track({
640
+ * customer_id: "user_123",
641
+ * feature_id: "messages",
642
+ * value: 1 // Track 1 message sent
643
+ * });
644
+ * ```
645
+ */
516
646
  async track(params) {
517
647
  return handleTrack({
518
648
  instance: this,
519
649
  params
520
650
  });
521
651
  }
652
+ /**
653
+ * Retrieves usage statistics and analytics for a customer.
654
+ *
655
+ * This method fetches detailed usage information for a customer's features,
656
+ * including current balances, usage history, and analytics data. Useful
657
+ * for displaying usage dashboards or generating reports.
658
+ *
659
+ * @param params - Usage parameters including customer ID and optional filters
660
+ * @returns Promise resolving to usage statistics and analytics data
661
+ *
662
+ * @example
663
+ * ```typescript
664
+ * const result = await autumn.usage({
665
+ * customer_id: "user_123",
666
+ * feature_id: "messages"
667
+ * value: 20 // Usage value
668
+ * });
669
+ * ```
670
+ */
522
671
  async usage(params) {
523
672
  return handleUsage({
524
673
  instance: this,
@@ -526,6 +675,25 @@ var Autumn = class {
526
675
  });
527
676
  }
528
677
  static query = (params) => staticWrapper(handleQuery, void 0, { params });
678
+ /**
679
+ * Performs advanced queries on customer data and analytics.
680
+ *
681
+ * This method allows you to run complex queries against customer data,
682
+ * usage patterns, and billing information. Useful for generating reports,
683
+ * analytics, and custom data insights.
684
+ *
685
+ * @param params - Query parameters including customer ID and query specifications
686
+ * @returns Promise resolving to query results with requested data
687
+ *
688
+ * @example
689
+ * ```typescript
690
+ * const result = await autumn.query({
691
+ * customer_id: "user_123",
692
+ * feature_id: "messages" // feature id to fetch for query, can also be an array
693
+ * });
694
+ *
695
+ * ```
696
+ */
529
697
  async query(params) {
530
698
  return handleQuery({
531
699
  instance: this,
@@ -765,6 +933,8 @@ var CheckoutParamsSchema = import_v47.z.object({
765
933
  product_id: import_v47.z.string(),
766
934
  entity_id: import_v47.z.string().optional(),
767
935
  options: import_v47.z.array(AttachFeatureOptionsSchema).optional(),
936
+ force_checkout: import_v47.z.boolean().optional(),
937
+ invoice: import_v47.z.boolean().optional(),
768
938
  success_url: import_v47.z.string().optional(),
769
939
  customer_data: CustomerDataSchema.optional(),
770
940
  entity_data: import_v47.z.any().optional(),
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-UNZHJTEY.mjs";
4
4
  import {
5
5
  createRouterWithOptions
6
- } from "./chunk-RAHKKJED.mjs";
7
- import "./chunk-VNJ3MFJE.mjs";
8
- import "./chunk-7K3RATTK.mjs";
9
- import "./chunk-EW2R7722.mjs";
10
- import "./chunk-P3ARLB2M.mjs";
11
- import "./chunk-5DDCZMDB.mjs";
6
+ } from "./chunk-NWPFUFXX.mjs";
7
+ import "./chunk-56RGUNOT.mjs";
8
+ import "./chunk-SDL7BFTH.mjs";
9
+ import "./chunk-2DWGCQCF.mjs";
10
+ import "./chunk-6JI6MF4S.mjs";
11
+ import "./chunk-FA5Z2MOT.mjs";
12
12
  import {
13
13
  AttachParamsSchema,
14
14
  Autumn,
@@ -20,7 +20,7 @@ import {
20
20
  CustomerExpandEnum,
21
21
  RedeemReferralCodeParamsSchema,
22
22
  TrackParamsSchema
23
- } from "./chunk-NAP2URIW.mjs";
23
+ } from "./chunk-Q7SD535L.mjs";
24
24
  import "./chunk-2TEL6LR5.mjs";
25
25
  import "./chunk-KSG3E4Q2.mjs";
26
26
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-5DDCZMDB.mjs";
3
+ } from "./chunk-FA5Z2MOT.mjs";
4
4
  import {
5
5
  BASE_PATH
6
6
  } from "./chunk-KSG3E4Q2.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-5DDCZMDB.mjs";
3
+ } from "./chunk-FA5Z2MOT.mjs";
4
4
  import {
5
5
  BASE_PATH
6
6
  } from "./chunk-KSG3E4Q2.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-5DDCZMDB.mjs";
3
+ } from "./chunk-FA5Z2MOT.mjs";
4
4
 
5
5
  // src/libraries/backend/routes/entityRoutes.ts
6
6
  import { addRoute } from "rou3";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  toBackendError,
3
3
  toBackendRes
4
- } from "./chunk-NAP2URIW.mjs";
4
+ } from "./chunk-Q7SD535L.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-2TEL6LR5.mjs";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  addGenRoutes
3
- } from "./chunk-VNJ3MFJE.mjs";
3
+ } from "./chunk-56RGUNOT.mjs";
4
4
  import {
5
5
  addProductRoutes
6
- } from "./chunk-7K3RATTK.mjs";
6
+ } from "./chunk-SDL7BFTH.mjs";
7
7
  import {
8
8
  addReferralRoutes
9
- } from "./chunk-EW2R7722.mjs";
9
+ } from "./chunk-2DWGCQCF.mjs";
10
10
  import {
11
11
  addEntityRoutes
12
- } from "./chunk-P3ARLB2M.mjs";
12
+ } from "./chunk-6JI6MF4S.mjs";
13
13
  import {
14
14
  withAuth
15
- } from "./chunk-5DDCZMDB.mjs";
15
+ } from "./chunk-FA5Z2MOT.mjs";
16
16
  import {
17
17
  fetchPricingTable
18
- } from "./chunk-NAP2URIW.mjs";
18
+ } from "./chunk-Q7SD535L.mjs";
19
19
  import {
20
20
  BASE_PATH
21
21
  } from "./chunk-KSG3E4Q2.mjs";