autumn-js 0.0.101 → 0.0.102

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 (175) hide show
  1. package/dist/compose/index.d.mts +67 -93
  2. package/dist/compose/index.d.ts +67 -93
  3. package/dist/compose/index.js +14 -83
  4. package/dist/compose/index.mjs +14 -80
  5. package/dist/libraries/backend/better-auth.d.mts +18 -18
  6. package/dist/libraries/backend/better-auth.d.ts +18 -18
  7. package/dist/libraries/backend/elysia.d.mts +1 -1
  8. package/dist/libraries/backend/elysia.d.ts +1 -1
  9. package/dist/libraries/backend/express.d.mts +1 -1
  10. package/dist/libraries/backend/express.d.ts +1 -1
  11. package/dist/libraries/backend/next.js +94 -94
  12. package/dist/libraries/backend/next.mjs +94 -94
  13. package/dist/libraries/backend/{referralTypes-HAk2vTns.d.ts → referralTypes-D1Q2i3mG.d.ts} +28 -27
  14. package/dist/libraries/backend/{referralTypes-Dg9pRvI7.d.mts → referralTypes-Dfg6if8j.d.mts} +28 -27
  15. package/dist/libraries/backend/tanstack.js +2 -2
  16. package/dist/libraries/backend/tanstack.mjs +2 -2
  17. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  18. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  19. package/dist/libraries/react/AutumnContext.d.mts +4 -4
  20. package/dist/libraries/react/AutumnContext.d.ts +4 -4
  21. package/dist/libraries/react/AutumnContext.mjs +4 -4
  22. package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -4
  23. package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -4
  24. package/dist/libraries/react/BaseAutumnProvider.js +7 -2
  25. package/dist/libraries/react/BaseAutumnProvider.mjs +9 -9
  26. package/dist/libraries/react/{ReactAutumnClient-B4P_QjY1.d.ts → ReactAutumnClient-DBbq29Nn.d.ts} +3 -3
  27. package/dist/libraries/react/{ReactAutumnClient-DCdPx-ps.d.mts → ReactAutumnClient-YzfxjqPK.d.mts} +3 -3
  28. package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
  29. package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
  30. package/dist/libraries/react/ReactAutumnProvider.js +7 -2
  31. package/dist/libraries/react/ReactAutumnProvider.mjs +10 -10
  32. package/dist/libraries/react/{chunk-T5PIJ4HG.mjs → chunk-3VHO7VUQ.mjs} +4 -3
  33. package/dist/libraries/react/{chunk-DVMVIAZE.mjs → chunk-5NDO7C7R.mjs} +3 -3
  34. package/dist/libraries/react/{chunk-AOJCMXVS.mjs → chunk-5URK7LI3.mjs} +3 -3
  35. package/dist/libraries/react/{chunk-YLZ5NFYO.mjs → chunk-AL3VJLFU.mjs} +1 -1
  36. package/dist/libraries/react/{chunk-LVDONEVF.mjs → chunk-CE33P32V.mjs} +7 -3
  37. package/dist/libraries/react/{chunk-G3FBFZLU.mjs → chunk-GQ3TAHSV.mjs} +1 -1
  38. package/dist/libraries/react/{chunk-CAMHARUX.mjs → chunk-H2NGSCWI.mjs} +2 -2
  39. package/dist/libraries/react/{chunk-6CJ3FB74.mjs → chunk-JI7WQ6AC.mjs} +2 -2
  40. package/dist/libraries/react/{chunk-24EVX3BR.mjs → chunk-LKV32IPT.mjs} +20 -41
  41. package/dist/libraries/react/{chunk-RQG36YPD.mjs → chunk-LXSKONN2.mjs} +5 -9
  42. package/dist/libraries/react/{chunk-R46CJXF7.mjs → chunk-OAPUYXBO.mjs} +6 -6
  43. package/dist/libraries/react/{chunk-3CJSWXNT.mjs → chunk-OAWFFAKA.mjs} +6 -6
  44. package/dist/libraries/react/{chunk-CPITDC7S.mjs → chunk-SDMBKRAI.mjs} +37 -172
  45. package/dist/libraries/react/{chunk-APDR7D6A.mjs → chunk-SY5GNYZ7.mjs} +2 -2
  46. package/dist/libraries/react/{chunk-5G3DYUNT.mjs → chunk-T73WQC2X.mjs} +1 -1
  47. package/dist/libraries/react/{chunk-R4BYOLST.mjs → chunk-TPKQIL3N.mjs} +2 -2
  48. package/dist/libraries/react/{chunk-MZDRIPNS.mjs → chunk-X6RY6VG5.mjs} +2 -2
  49. package/dist/libraries/react/{chunk-RQEL7G2O.mjs → chunk-ZVQKDPUP.mjs} +3 -3
  50. package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -4
  51. package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -4
  52. package/dist/libraries/react/client/ReactAutumnClient.mjs +3 -3
  53. package/dist/libraries/react/client/clientCompMethods.d.mts +4 -4
  54. package/dist/libraries/react/client/clientCompMethods.d.ts +4 -4
  55. package/dist/libraries/react/client/clientCusMethods.d.mts +4 -4
  56. package/dist/libraries/react/client/clientCusMethods.d.ts +4 -4
  57. package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -4
  58. package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -4
  59. package/dist/libraries/react/client/clientGenMethods.d.mts +4 -4
  60. package/dist/libraries/react/client/clientGenMethods.d.ts +4 -4
  61. package/dist/libraries/react/client/clientProdMethods.d.mts +4 -4
  62. package/dist/libraries/react/client/clientProdMethods.d.ts +4 -4
  63. package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -4
  64. package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -4
  65. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +111 -116
  66. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -1
  67. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -1
  68. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +76 -212
  69. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +23 -23
  70. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -1
  71. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -1
  72. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
  73. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
  74. package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +47 -169
  75. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +5 -5
  76. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
  77. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
  78. package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +111 -116
  79. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  80. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  81. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +76 -215
  82. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +23 -23
  83. package/dist/libraries/react/components/ui/button.js +3 -3
  84. package/dist/libraries/react/components/ui/button.mjs +2 -2
  85. package/dist/libraries/react/components/ui/dialog.js +43 -157
  86. package/dist/libraries/react/components/ui/dialog.mjs +3 -3
  87. package/dist/libraries/react/components/ui/switch.js +12 -12
  88. package/dist/libraries/react/components/ui/switch.mjs +3 -3
  89. package/dist/libraries/react/{cusTypes-Bf1qr9iE.d.ts → cusTypes-CFofdxsA.d.mts} +2 -1
  90. package/dist/libraries/react/{cusTypes-Bf1qr9iE.d.mts → cusTypes-CFofdxsA.d.ts} +2 -1
  91. package/dist/libraries/react/{entTypes-CscyyE1A.d.mts → entTypes-BeWtfIqo.d.mts} +1 -1
  92. package/dist/libraries/react/{entTypes-O8YXxhrA.d.ts → entTypes-BhUZh8uE.d.ts} +1 -1
  93. package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
  94. package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
  95. package/dist/libraries/react/hooks/useAutumn.d.mts +2 -2
  96. package/dist/libraries/react/hooks/useAutumn.d.ts +2 -2
  97. package/dist/libraries/react/hooks/useAutumn.js +5 -1
  98. package/dist/libraries/react/hooks/useAutumn.mjs +7 -7
  99. package/dist/libraries/react/hooks/useAutumnBase.d.mts +6 -5
  100. package/dist/libraries/react/hooks/useAutumnBase.d.ts +6 -5
  101. package/dist/libraries/react/hooks/useAutumnBase.js +5 -1
  102. package/dist/libraries/react/hooks/useAutumnBase.mjs +6 -6
  103. package/dist/libraries/react/hooks/useCustomer.d.mts +4 -4
  104. package/dist/libraries/react/hooks/useCustomer.d.ts +4 -4
  105. package/dist/libraries/react/hooks/useCustomer.js +7 -2
  106. package/dist/libraries/react/hooks/useCustomer.mjs +8 -8
  107. package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -4
  108. package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -4
  109. package/dist/libraries/react/hooks/useCustomerBase.js +7 -2
  110. package/dist/libraries/react/hooks/useCustomerBase.mjs +7 -7
  111. package/dist/libraries/react/hooks/useEntity.d.mts +3 -3
  112. package/dist/libraries/react/hooks/useEntity.d.ts +3 -3
  113. package/dist/libraries/react/hooks/useEntity.js +5 -1
  114. package/dist/libraries/react/hooks/useEntity.mjs +8 -8
  115. package/dist/libraries/react/hooks/useEntityBase.d.mts +4 -4
  116. package/dist/libraries/react/hooks/useEntityBase.d.ts +4 -4
  117. package/dist/libraries/react/hooks/useEntityBase.js +5 -1
  118. package/dist/libraries/react/hooks/useEntityBase.mjs +7 -7
  119. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  120. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  121. package/dist/libraries/react/hooks/usePricingTable.mjs +6 -6
  122. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -4
  123. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -4
  124. package/dist/libraries/react/hooks/usePricingTableBase.mjs +5 -5
  125. package/dist/libraries/react/hooks/useProductsBase.mjs +4 -4
  126. package/dist/libraries/react/index.d.mts +1 -0
  127. package/dist/libraries/react/index.d.ts +1 -0
  128. package/dist/libraries/react/index.js +80 -222
  129. package/dist/libraries/react/index.mjs +65 -207
  130. package/dist/libraries/react/{response-B4VzjWEU.d.mts → response-AGK9KlYm.d.mts} +1 -1
  131. package/dist/libraries/react/{response-C3S90max.d.ts → response-CxMWdpyl.d.ts} +1 -1
  132. package/dist/next/{AutumnProvider-CCYZC_bN.d.mts → AutumnProvider-Xl1mqxls.d.mts} +1 -0
  133. package/dist/next/{AutumnProvider-CCYZC_bN.d.ts → AutumnProvider-Xl1mqxls.d.ts} +1 -0
  134. package/dist/next/AutumnProvider.d.mts +1 -1
  135. package/dist/next/AutumnProvider.d.ts +1 -1
  136. package/dist/next/client/NextAutumnClient.d.mts +10 -10
  137. package/dist/next/client/NextAutumnClient.d.ts +10 -10
  138. package/dist/next/client/NextAutumnProvider.d.mts +1 -1
  139. package/dist/next/client/NextAutumnProvider.d.ts +1 -1
  140. package/dist/next/client/{clientGenTypes-9ngy1q97.d.mts → clientGenTypes-BcRfHmUS.d.mts} +17 -17
  141. package/dist/next/client/{clientGenTypes-CxB4go6q.d.ts → clientGenTypes-D8f8BwMo.d.ts} +17 -17
  142. package/dist/next/client/clientUtils.d.mts +2 -2
  143. package/dist/next/client/clientUtils.d.ts +2 -2
  144. package/dist/next/client/{cusTypes-D8lhXGaX.d.mts → cusTypes-Gh2wfcmj.d.mts} +1 -0
  145. package/dist/next/client/{cusTypes-D8lhXGaX.d.ts → cusTypes-Gh2wfcmj.d.ts} +1 -0
  146. package/dist/next/client/{entTypes-Dq2mbehl.d.ts → entTypes-B_w6I3y-.d.ts} +1 -1
  147. package/dist/next/client/{entTypes-B-2_9hzP.d.mts → entTypes-C_xS1VPE.d.mts} +1 -1
  148. package/dist/next/client/hooks/useAutumn.d.mts +2 -2
  149. package/dist/next/client/hooks/useAutumn.d.ts +2 -2
  150. package/dist/next/client/hooks/useCustomer.d.mts +3 -3
  151. package/dist/next/client/hooks/useCustomer.d.ts +3 -3
  152. package/dist/next/client/hooks/useEntity.d.mts +5 -5
  153. package/dist/next/client/hooks/useEntity.d.ts +5 -5
  154. package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
  155. package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
  156. package/dist/next/client/types.d.mts +2 -2
  157. package/dist/next/client/types.d.ts +2 -2
  158. package/dist/next/index.d.mts +2 -2
  159. package/dist/next/index.d.ts +2 -2
  160. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  161. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  162. package/dist/next/server/componentActions.d.mts +1 -1
  163. package/dist/next/server/componentActions.d.ts +1 -1
  164. package/dist/next/server/cusActions.d.mts +21 -21
  165. package/dist/next/server/cusActions.d.ts +21 -21
  166. package/dist/next/server/{cusTypes-DhOYtM7H.d.mts → cusTypes-DVA6iu7V.d.mts} +3 -2
  167. package/dist/next/server/{cusTypes-DhOYtM7H.d.ts → cusTypes-DVA6iu7V.d.ts} +3 -2
  168. package/dist/next/server/genActions.d.mts +1 -1
  169. package/dist/next/server/genActions.d.ts +1 -1
  170. package/dist/sdk/index.d.mts +1 -0
  171. package/dist/sdk/index.d.ts +1 -0
  172. package/dist/styles/global.css +111 -116
  173. package/package.json +9 -22
  174. package/tsup.config.ts +0 -1
  175. package/dist/libraries/react/{chunk-ALFXUHDD.mjs → chunk-ALIGIMSK.mjs} +6 -6
@@ -192,6 +192,7 @@ interface CustomerProduct {
192
192
  status: ProductStatus;
193
193
  started_at: number;
194
194
  canceled_at: number | null;
195
+ version: number;
195
196
  subscription_ids?: string[] | null;
196
197
  current_period_start?: number | null;
197
198
  current_period_end?: number | null;
@@ -230,19 +231,19 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
230
231
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
231
232
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
232
233
  }, "strip", z.ZodTypeAny, {
233
- id?: string | null | undefined;
234
+ metadata?: Record<string, any> | undefined;
235
+ expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
234
236
  name?: string | null | undefined;
237
+ id?: string | null | undefined;
235
238
  email?: string | null | undefined;
236
239
  fingerprint?: string | null | undefined;
240
+ }, {
237
241
  metadata?: Record<string, any> | undefined;
238
242
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
239
- }, {
240
- id?: string | null | undefined;
241
243
  name?: string | null | undefined;
244
+ id?: string | null | undefined;
242
245
  email?: string | null | undefined;
243
246
  fingerprint?: string | null | undefined;
244
- metadata?: Record<string, any> | undefined;
245
- expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
246
247
  }>;
247
248
  type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
248
249
  interface UpdateCustomerParams {
@@ -294,13 +295,13 @@ declare const AttachParamsSchema: z.ZodObject<{
294
295
  reward: z.ZodOptional<z.ZodString>;
295
296
  }, "strip", z.ZodTypeAny, {
296
297
  customer_id: string;
297
- entity_id?: string | undefined;
298
298
  options?: {
299
299
  feature_id: string;
300
300
  quantity: number;
301
301
  }[] | undefined;
302
302
  metadata?: Record<string, string> | undefined;
303
303
  product_id?: string | undefined;
304
+ entity_id?: string | undefined;
304
305
  product_ids?: string[] | undefined;
305
306
  free_trial?: boolean | undefined;
306
307
  success_url?: string | undefined;
@@ -311,13 +312,13 @@ declare const AttachParamsSchema: z.ZodObject<{
311
312
  reward?: string | undefined;
312
313
  }, {
313
314
  customer_id: string;
314
- entity_id?: string | undefined;
315
315
  options?: {
316
316
  feature_id: string;
317
317
  quantity: number;
318
318
  }[] | undefined;
319
319
  metadata?: Record<string, string> | undefined;
320
320
  product_id?: string | undefined;
321
+ entity_id?: string | undefined;
321
322
  product_ids?: string[] | undefined;
322
323
  free_trial?: boolean | undefined;
323
324
  success_url?: string | undefined;
@@ -356,18 +357,18 @@ declare const TrackParamsSchema: z.ZodObject<{
356
357
  entity_data: z.ZodOptional<z.ZodAny>;
357
358
  }, "strip", z.ZodTypeAny, {
358
359
  customer_id: string;
359
- feature_id?: string | undefined;
360
- entity_id?: string | undefined;
361
360
  value?: number | undefined;
361
+ entity_id?: string | undefined;
362
+ feature_id?: string | undefined;
362
363
  customer_data?: any;
363
364
  entity_data?: any;
364
365
  event_name?: string | undefined;
365
366
  idempotency_key?: string | undefined;
366
367
  }, {
367
368
  customer_id: string;
368
- feature_id?: string | undefined;
369
- entity_id?: string | undefined;
370
369
  value?: number | undefined;
370
+ entity_id?: string | undefined;
371
+ feature_id?: string | undefined;
371
372
  customer_data?: any;
372
373
  entity_data?: any;
373
374
  event_name?: string | undefined;
@@ -395,28 +396,28 @@ declare const CheckParamsSchema: z.ZodObject<{
395
396
  }>>;
396
397
  }, "strip", z.ZodTypeAny, {
397
398
  customer_id: string;
398
- feature_id?: string | undefined;
399
- entity_id?: string | undefined;
400
- required_balance?: number | undefined;
401
399
  product_id?: string | undefined;
400
+ entity_id?: string | undefined;
401
+ feature_id?: string | undefined;
402
402
  customer_data?: any;
403
403
  entity_data?: {
404
404
  feature_id: string;
405
405
  name?: string | undefined;
406
406
  } | undefined;
407
+ required_balance?: number | undefined;
407
408
  send_event?: boolean | undefined;
408
409
  with_preview?: boolean | undefined;
409
410
  }, {
410
411
  customer_id: string;
411
- feature_id?: string | undefined;
412
- entity_id?: string | undefined;
413
- required_balance?: number | undefined;
414
412
  product_id?: string | undefined;
413
+ entity_id?: string | undefined;
414
+ feature_id?: string | undefined;
415
415
  customer_data?: any;
416
416
  entity_data?: {
417
417
  feature_id: string;
418
418
  name?: string | undefined;
419
419
  } | undefined;
420
+ required_balance?: number | undefined;
420
421
  send_event?: boolean | undefined;
421
422
  with_preview?: boolean | undefined;
422
423
  }>;
@@ -507,18 +508,18 @@ declare class Autumn {
507
508
  redeemCode: (params: RedeemReferralCodeParams) => Promise<Result<any, AutumnError>>;
508
509
  };
509
510
  static attach: (params: AttachParams) => Promise<Result<{
510
- customer_id: string;
511
- code: string;
512
511
  message: string;
512
+ code: string;
513
+ customer_id: string;
513
514
  product_ids: string[];
514
515
  customer_data?: any;
515
516
  checkout_url?: string | undefined;
516
517
  }, AutumnError>>;
517
518
  static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
518
519
  attach(params: AttachParams): Promise<Result<{
519
- customer_id: string;
520
- code: string;
521
520
  message: string;
521
+ code: string;
522
+ customer_id: string;
522
523
  product_ids: string[];
523
524
  customer_data?: any;
524
525
  checkout_url?: string | undefined;
@@ -552,8 +553,8 @@ declare class Autumn {
552
553
  * Please use the new track() method instead.
553
554
  */
554
555
  static event: (params: TrackParams) => Promise<Result<{
555
- customer_id: string;
556
556
  code: string;
557
+ customer_id: string;
557
558
  id: string;
558
559
  feature_id?: string | undefined;
559
560
  event_name?: string | undefined;
@@ -563,22 +564,22 @@ declare class Autumn {
563
564
  * Please use the new track() method instead.
564
565
  */
565
566
  event(params: TrackParams): Promise<Result<{
566
- customer_id: string;
567
567
  code: string;
568
+ customer_id: string;
568
569
  id: string;
569
570
  feature_id?: string | undefined;
570
571
  event_name?: string | undefined;
571
572
  }, AutumnError>>;
572
573
  static track: (params: TrackParams) => Promise<Result<{
573
- customer_id: string;
574
574
  code: string;
575
+ customer_id: string;
575
576
  id: string;
576
577
  feature_id?: string | undefined;
577
578
  event_name?: string | undefined;
578
579
  }, AutumnError>>;
579
580
  track(params: TrackParams): Promise<Result<{
580
- customer_id: string;
581
581
  code: string;
582
+ customer_id: string;
582
583
  id: string;
583
584
  feature_id?: string | undefined;
584
585
  event_name?: string | undefined;
@@ -629,11 +630,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
629
630
  code: z.ZodString;
630
631
  customer_id: z.ZodString;
631
632
  }, "strip", z.ZodTypeAny, {
632
- customer_id: string;
633
633
  code: string;
634
- }, {
635
634
  customer_id: string;
635
+ }, {
636
636
  code: string;
637
+ customer_id: string;
637
638
  }>;
638
639
  type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
639
640
 
@@ -192,6 +192,7 @@ interface CustomerProduct {
192
192
  status: ProductStatus;
193
193
  started_at: number;
194
194
  canceled_at: number | null;
195
+ version: number;
195
196
  subscription_ids?: string[] | null;
196
197
  current_period_start?: number | null;
197
198
  current_period_end?: number | null;
@@ -230,19 +231,19 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
230
231
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
231
232
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
232
233
  }, "strip", z.ZodTypeAny, {
233
- id?: string | null | undefined;
234
+ metadata?: Record<string, any> | undefined;
235
+ expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
234
236
  name?: string | null | undefined;
237
+ id?: string | null | undefined;
235
238
  email?: string | null | undefined;
236
239
  fingerprint?: string | null | undefined;
240
+ }, {
237
241
  metadata?: Record<string, any> | undefined;
238
242
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
239
- }, {
240
- id?: string | null | undefined;
241
243
  name?: string | null | undefined;
244
+ id?: string | null | undefined;
242
245
  email?: string | null | undefined;
243
246
  fingerprint?: string | null | undefined;
244
- metadata?: Record<string, any> | undefined;
245
- expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
246
247
  }>;
247
248
  type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
248
249
  interface UpdateCustomerParams {
@@ -294,13 +295,13 @@ declare const AttachParamsSchema: z.ZodObject<{
294
295
  reward: z.ZodOptional<z.ZodString>;
295
296
  }, "strip", z.ZodTypeAny, {
296
297
  customer_id: string;
297
- entity_id?: string | undefined;
298
298
  options?: {
299
299
  feature_id: string;
300
300
  quantity: number;
301
301
  }[] | undefined;
302
302
  metadata?: Record<string, string> | undefined;
303
303
  product_id?: string | undefined;
304
+ entity_id?: string | undefined;
304
305
  product_ids?: string[] | undefined;
305
306
  free_trial?: boolean | undefined;
306
307
  success_url?: string | undefined;
@@ -311,13 +312,13 @@ declare const AttachParamsSchema: z.ZodObject<{
311
312
  reward?: string | undefined;
312
313
  }, {
313
314
  customer_id: string;
314
- entity_id?: string | undefined;
315
315
  options?: {
316
316
  feature_id: string;
317
317
  quantity: number;
318
318
  }[] | undefined;
319
319
  metadata?: Record<string, string> | undefined;
320
320
  product_id?: string | undefined;
321
+ entity_id?: string | undefined;
321
322
  product_ids?: string[] | undefined;
322
323
  free_trial?: boolean | undefined;
323
324
  success_url?: string | undefined;
@@ -356,18 +357,18 @@ declare const TrackParamsSchema: z.ZodObject<{
356
357
  entity_data: z.ZodOptional<z.ZodAny>;
357
358
  }, "strip", z.ZodTypeAny, {
358
359
  customer_id: string;
359
- feature_id?: string | undefined;
360
- entity_id?: string | undefined;
361
360
  value?: number | undefined;
361
+ entity_id?: string | undefined;
362
+ feature_id?: string | undefined;
362
363
  customer_data?: any;
363
364
  entity_data?: any;
364
365
  event_name?: string | undefined;
365
366
  idempotency_key?: string | undefined;
366
367
  }, {
367
368
  customer_id: string;
368
- feature_id?: string | undefined;
369
- entity_id?: string | undefined;
370
369
  value?: number | undefined;
370
+ entity_id?: string | undefined;
371
+ feature_id?: string | undefined;
371
372
  customer_data?: any;
372
373
  entity_data?: any;
373
374
  event_name?: string | undefined;
@@ -395,28 +396,28 @@ declare const CheckParamsSchema: z.ZodObject<{
395
396
  }>>;
396
397
  }, "strip", z.ZodTypeAny, {
397
398
  customer_id: string;
398
- feature_id?: string | undefined;
399
- entity_id?: string | undefined;
400
- required_balance?: number | undefined;
401
399
  product_id?: string | undefined;
400
+ entity_id?: string | undefined;
401
+ feature_id?: string | undefined;
402
402
  customer_data?: any;
403
403
  entity_data?: {
404
404
  feature_id: string;
405
405
  name?: string | undefined;
406
406
  } | undefined;
407
+ required_balance?: number | undefined;
407
408
  send_event?: boolean | undefined;
408
409
  with_preview?: boolean | undefined;
409
410
  }, {
410
411
  customer_id: string;
411
- feature_id?: string | undefined;
412
- entity_id?: string | undefined;
413
- required_balance?: number | undefined;
414
412
  product_id?: string | undefined;
413
+ entity_id?: string | undefined;
414
+ feature_id?: string | undefined;
415
415
  customer_data?: any;
416
416
  entity_data?: {
417
417
  feature_id: string;
418
418
  name?: string | undefined;
419
419
  } | undefined;
420
+ required_balance?: number | undefined;
420
421
  send_event?: boolean | undefined;
421
422
  with_preview?: boolean | undefined;
422
423
  }>;
@@ -507,18 +508,18 @@ declare class Autumn {
507
508
  redeemCode: (params: RedeemReferralCodeParams) => Promise<Result<any, AutumnError>>;
508
509
  };
509
510
  static attach: (params: AttachParams) => Promise<Result<{
510
- customer_id: string;
511
- code: string;
512
511
  message: string;
512
+ code: string;
513
+ customer_id: string;
513
514
  product_ids: string[];
514
515
  customer_data?: any;
515
516
  checkout_url?: string | undefined;
516
517
  }, AutumnError>>;
517
518
  static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
518
519
  attach(params: AttachParams): Promise<Result<{
519
- customer_id: string;
520
- code: string;
521
520
  message: string;
521
+ code: string;
522
+ customer_id: string;
522
523
  product_ids: string[];
523
524
  customer_data?: any;
524
525
  checkout_url?: string | undefined;
@@ -552,8 +553,8 @@ declare class Autumn {
552
553
  * Please use the new track() method instead.
553
554
  */
554
555
  static event: (params: TrackParams) => Promise<Result<{
555
- customer_id: string;
556
556
  code: string;
557
+ customer_id: string;
557
558
  id: string;
558
559
  feature_id?: string | undefined;
559
560
  event_name?: string | undefined;
@@ -563,22 +564,22 @@ declare class Autumn {
563
564
  * Please use the new track() method instead.
564
565
  */
565
566
  event(params: TrackParams): Promise<Result<{
566
- customer_id: string;
567
567
  code: string;
568
+ customer_id: string;
568
569
  id: string;
569
570
  feature_id?: string | undefined;
570
571
  event_name?: string | undefined;
571
572
  }, AutumnError>>;
572
573
  static track: (params: TrackParams) => Promise<Result<{
573
- customer_id: string;
574
574
  code: string;
575
+ customer_id: string;
575
576
  id: string;
576
577
  feature_id?: string | undefined;
577
578
  event_name?: string | undefined;
578
579
  }, AutumnError>>;
579
580
  track(params: TrackParams): Promise<Result<{
580
- customer_id: string;
581
581
  code: string;
582
+ customer_id: string;
582
583
  id: string;
583
584
  feature_id?: string | undefined;
584
585
  event_name?: string | undefined;
@@ -629,11 +630,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
629
630
  code: z.ZodString;
630
631
  customer_id: z.ZodString;
631
632
  }, "strip", z.ZodTypeAny, {
632
- customer_id: string;
633
633
  code: string;
634
- }, {
635
634
  customer_id: string;
635
+ }, {
636
636
  code: string;
637
+ customer_id: string;
637
638
  }>;
638
639
  type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
639
640
 
@@ -1089,7 +1089,7 @@ function splitSetCookieString(cookiesString) {
1089
1089
  return cookiesStrings;
1090
1090
  }
1091
1091
 
1092
- // ../node_modules/.pnpm/@tanstack+router-core@1.127.8/node_modules/@tanstack/router-core/dist/esm/ssr/headers.js
1092
+ // ../node_modules/.pnpm/@tanstack+start-client-core@1.121.34/node_modules/@tanstack/start-client-core/dist/esm/headers.js
1093
1093
  function toHeadersInstance(init) {
1094
1094
  if (init instanceof Headers) {
1095
1095
  return new Headers(init);
@@ -1116,7 +1116,7 @@ function mergeHeaders(...headers) {
1116
1116
  }, new Headers());
1117
1117
  }
1118
1118
 
1119
- // ../node_modules/.pnpm/@tanstack+router-core@1.127.8/node_modules/@tanstack/router-core/dist/esm/ssr/json.js
1119
+ // ../node_modules/.pnpm/@tanstack+start-client-core@1.121.34/node_modules/@tanstack/start-client-core/dist/esm/json.js
1120
1120
  function json(payload, init) {
1121
1121
  return new Response(JSON.stringify(payload), {
1122
1122
  ...init,
@@ -78,7 +78,7 @@ function splitSetCookieString(cookiesString) {
78
78
  return cookiesStrings;
79
79
  }
80
80
 
81
- // ../node_modules/.pnpm/@tanstack+router-core@1.127.8/node_modules/@tanstack/router-core/dist/esm/ssr/headers.js
81
+ // ../node_modules/.pnpm/@tanstack+start-client-core@1.121.34/node_modules/@tanstack/start-client-core/dist/esm/headers.js
82
82
  function toHeadersInstance(init) {
83
83
  if (init instanceof Headers) {
84
84
  return new Headers(init);
@@ -105,7 +105,7 @@ function mergeHeaders(...headers) {
105
105
  }, new Headers());
106
106
  }
107
107
 
108
- // ../node_modules/.pnpm/@tanstack+router-core@1.127.8/node_modules/@tanstack/router-core/dist/esm/ssr/json.js
108
+ // ../node_modules/.pnpm/@tanstack+start-client-core@1.121.34/node_modules/@tanstack/start-client-core/dist/esm/json.js
109
109
  function json(payload, init) {
110
110
  return new Response(JSON.stringify(payload), {
111
111
  ...init,
@@ -1,4 +1,4 @@
1
- import { A as Autumn, C as CustomerData } from '../referralTypes-Dg9pRvI7.mjs';
1
+ import { A as Autumn, C as CustomerData } from '../referralTypes-Dfg6if8j.mjs';
2
2
  import { AuthResult } from './AuthFunction.mjs';
3
3
  import 'zod';
4
4
  import '../response-CV6KGWH5.mjs';
@@ -1,4 +1,4 @@
1
- import { A as Autumn, C as CustomerData } from '../referralTypes-HAk2vTns.js';
1
+ import { A as Autumn, C as CustomerData } from '../referralTypes-D1Q2i3mG.js';
2
2
  import { AuthResult } from './AuthFunction.js';
3
3
  import 'zod';
4
4
  import '../response-CV6KGWH5.js';
@@ -1,12 +1,12 @@
1
1
  import * as React$1 from 'react';
2
- import { A as AutumnClient } from './ReactAutumnClient-DCdPx-ps.mjs';
2
+ import { A as AutumnClient } from './ReactAutumnClient-YzfxjqPK.mjs';
3
3
  import './client/types/clientEntTypes.mjs';
4
4
  import './client/types/clientGenTypes.mjs';
5
5
  import 'zod';
6
6
  import './error-DHbclCVh.mjs';
7
- import './response-B4VzjWEU.mjs';
8
- import './cusTypes-Bf1qr9iE.mjs';
9
- import './entTypes-CscyyE1A.mjs';
7
+ import './response-AGK9KlYm.mjs';
8
+ import './cusTypes-CFofdxsA.mjs';
9
+ import './entTypes-BeWtfIqo.mjs';
10
10
 
11
11
  interface AutumnDialogContext {
12
12
  props: any;
@@ -1,12 +1,12 @@
1
1
  import * as React$1 from 'react';
2
- import { A as AutumnClient } from './ReactAutumnClient-B4P_QjY1.js';
2
+ import { A as AutumnClient } from './ReactAutumnClient-DBbq29Nn.js';
3
3
  import './client/types/clientEntTypes.js';
4
4
  import './client/types/clientGenTypes.js';
5
5
  import 'zod';
6
6
  import './error-DHbclCVh.js';
7
- import './response-C3S90max.js';
8
- import './cusTypes-Bf1qr9iE.js';
9
- import './entTypes-O8YXxhrA.js';
7
+ import './response-CxMWdpyl.js';
8
+ import './cusTypes-CFofdxsA.js';
9
+ import './entTypes-BhUZh8uE.js';
10
10
 
11
11
  interface AutumnDialogContext {
12
12
  props: any;
@@ -3,12 +3,12 @@
3
3
  import {
4
4
  AutumnContext,
5
5
  useAutumnContext
6
- } from "./chunk-G3FBFZLU.mjs";
7
- import "./chunk-ALFXUHDD.mjs";
8
- import "./chunk-JVCOY7ZL.mjs";
9
- import "./chunk-CIBQ4BJU.mjs";
6
+ } from "./chunk-GQ3TAHSV.mjs";
7
+ import "./chunk-ALIGIMSK.mjs";
10
8
  import "./chunk-V575SGOW.mjs";
11
9
  import "./chunk-ZV4RPZTM.mjs";
10
+ import "./chunk-JVCOY7ZL.mjs";
11
+ import "./chunk-CIBQ4BJU.mjs";
12
12
  import "./chunk-VTGR7VVK.mjs";
13
13
  import "./chunk-WFFVOEUG.mjs";
14
14
  import "./chunk-ZF2HUCN6.mjs";
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
- import { A as AutumnClient } from './ReactAutumnClient-DCdPx-ps.mjs';
3
+ import { A as AutumnClient } from './ReactAutumnClient-YzfxjqPK.mjs';
4
4
  import './client/types/clientEntTypes.mjs';
5
5
  import './client/types/clientGenTypes.mjs';
6
6
  import 'zod';
7
7
  import './error-DHbclCVh.mjs';
8
- import './response-B4VzjWEU.mjs';
9
- import './cusTypes-Bf1qr9iE.mjs';
10
- import './entTypes-CscyyE1A.mjs';
8
+ import './response-AGK9KlYm.mjs';
9
+ import './cusTypes-CFofdxsA.mjs';
10
+ import './entTypes-BeWtfIqo.mjs';
11
11
 
12
12
  declare function BaseAutumnProvider({ client, children, AutumnContext, }: {
13
13
  client: AutumnClient;
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
- import { A as AutumnClient } from './ReactAutumnClient-B4P_QjY1.js';
3
+ import { A as AutumnClient } from './ReactAutumnClient-DBbq29Nn.js';
4
4
  import './client/types/clientEntTypes.js';
5
5
  import './client/types/clientGenTypes.js';
6
6
  import 'zod';
7
7
  import './error-DHbclCVh.js';
8
- import './response-C3S90max.js';
9
- import './cusTypes-Bf1qr9iE.js';
10
- import './entTypes-O8YXxhrA.js';
8
+ import './response-CxMWdpyl.js';
9
+ import './cusTypes-CFofdxsA.js';
10
+ import './entTypes-BhUZh8uE.js';
11
11
 
12
12
  declare function BaseAutumnProvider({ client, children, AutumnContext, }: {
13
13
  client: AutumnClient;
@@ -1214,7 +1214,8 @@ var usePricingTableBase = ({
1214
1214
  // src/libraries/react/hooks/useAutumnBase.tsx
1215
1215
  var useAutumnBase = ({
1216
1216
  AutumnContext: AutumnContext2,
1217
- authClient
1217
+ authClient,
1218
+ refetchCustomer
1218
1219
  }) => {
1219
1220
  const context = useAutumnContext({
1220
1221
  AutumnContext: AutumnContext2,
@@ -1253,6 +1254,9 @@ var useAutumnBase = ({
1253
1254
  }
1254
1255
  }
1255
1256
  await refetchPricingTable();
1257
+ if (refetchCustomer) {
1258
+ await refetchCustomer();
1259
+ }
1256
1260
  if (setAttachOpen) {
1257
1261
  setAttachOpen(false);
1258
1262
  }
@@ -1501,7 +1505,8 @@ var useCustomerBase = ({
1501
1505
  let autumnFunctions = emptyDefaultFunctions;
1502
1506
  if (AutumnContext2) {
1503
1507
  autumnFunctions = useAutumnBase({
1504
- AutumnContext: AutumnContext2
1508
+ AutumnContext: AutumnContext2,
1509
+ refetchCustomer: mutate
1505
1510
  });
1506
1511
  }
1507
1512
  return {
@@ -3,18 +3,18 @@
3
3
  "use client";
4
4
  import {
5
5
  BaseAutumnProvider
6
- } from "./chunk-DVMVIAZE.mjs";
7
- import "./chunk-T5PIJ4HG.mjs";
8
- import "./chunk-3JJC2VU5.mjs";
9
- import "./chunk-LVDONEVF.mjs";
10
- import "./chunk-R4BYOLST.mjs";
6
+ } from "./chunk-5NDO7C7R.mjs";
11
7
  import "./chunk-4QPHNIQ7.mjs";
12
- import "./chunk-G3FBFZLU.mjs";
13
- import "./chunk-ALFXUHDD.mjs";
14
- import "./chunk-JVCOY7ZL.mjs";
15
- import "./chunk-CIBQ4BJU.mjs";
8
+ import "./chunk-3VHO7VUQ.mjs";
9
+ import "./chunk-3JJC2VU5.mjs";
10
+ import "./chunk-CE33P32V.mjs";
11
+ import "./chunk-TPKQIL3N.mjs";
12
+ import "./chunk-GQ3TAHSV.mjs";
13
+ import "./chunk-ALIGIMSK.mjs";
16
14
  import "./chunk-V575SGOW.mjs";
17
15
  import "./chunk-ZV4RPZTM.mjs";
16
+ import "./chunk-JVCOY7ZL.mjs";
17
+ import "./chunk-CIBQ4BJU.mjs";
18
18
  import "./chunk-VTGR7VVK.mjs";
19
19
  import "./chunk-WFFVOEUG.mjs";
20
20
  import "./chunk-ZF2HUCN6.mjs";
@@ -2,9 +2,9 @@ import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTyp
2
2
  import { OpenBillingPortalParams, SetupPaymentParams } from './client/types/clientGenTypes.js';
3
3
  import * as React from 'react';
4
4
  import { A as AutumnError } from './error-DHbclCVh.js';
5
- import { R as Result, A as AutumnPromise, b as CheckResult, S as SetupPaymentResult } from './response-C3S90max.js';
6
- import { h as ProductItem, l as ProductScenario, C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult, P as Product } from './cusTypes-Bf1qr9iE.js';
7
- import { E as Entity, D as DeleteEntityResult } from './entTypes-O8YXxhrA.js';
5
+ import { R as Result, A as AutumnPromise, b as CheckResult, S as SetupPaymentResult } from './response-CxMWdpyl.js';
6
+ import { i as ProductItem, l as ProductScenario, C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult, P as Product } from './cusTypes-CFofdxsA.js';
7
+ import { E as Entity, D as DeleteEntityResult } from './entTypes-BhUZh8uE.js';
8
8
 
9
9
  interface PricingTableProduct {
10
10
  id: string;
@@ -2,9 +2,9 @@ import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTyp
2
2
  import { OpenBillingPortalParams, SetupPaymentParams } from './client/types/clientGenTypes.mjs';
3
3
  import * as React from 'react';
4
4
  import { A as AutumnError } from './error-DHbclCVh.mjs';
5
- import { R as Result, A as AutumnPromise, b as CheckResult, S as SetupPaymentResult } from './response-B4VzjWEU.mjs';
6
- import { h as ProductItem, l as ProductScenario, C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult, P as Product } from './cusTypes-Bf1qr9iE.mjs';
7
- import { E as Entity, D as DeleteEntityResult } from './entTypes-CscyyE1A.mjs';
5
+ import { R as Result, A as AutumnPromise, b as CheckResult, S as SetupPaymentResult } from './response-AGK9KlYm.mjs';
6
+ import { i as ProductItem, l as ProductScenario, C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult, P as Product } from './cusTypes-CFofdxsA.mjs';
7
+ import { E as Entity, D as DeleteEntityResult } from './entTypes-BeWtfIqo.mjs';
8
8
 
9
9
  interface PricingTableProduct {
10
10
  id: string;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CustomerData } from './cusTypes-Bf1qr9iE.mjs';
2
+ import { C as CustomerData } from './cusTypes-CFofdxsA.mjs';
3
3
  import 'zod';
4
4
 
5
5
  declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, }: {
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CustomerData } from './cusTypes-Bf1qr9iE.js';
2
+ import { C as CustomerData } from './cusTypes-CFofdxsA.js';
3
3
  import 'zod';
4
4
 
5
5
  declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, }: {
@@ -1215,7 +1215,8 @@ var usePricingTableBase = ({
1215
1215
  // src/libraries/react/hooks/useAutumnBase.tsx
1216
1216
  var useAutumnBase = ({
1217
1217
  AutumnContext: AutumnContext2,
1218
- authClient
1218
+ authClient,
1219
+ refetchCustomer
1219
1220
  }) => {
1220
1221
  const context = useAutumnContext({
1221
1222
  AutumnContext: AutumnContext2,
@@ -1254,6 +1255,9 @@ var useAutumnBase = ({
1254
1255
  }
1255
1256
  }
1256
1257
  await refetchPricingTable();
1258
+ if (refetchCustomer) {
1259
+ await refetchCustomer();
1260
+ }
1257
1261
  if (setAttachOpen) {
1258
1262
  setAttachOpen(false);
1259
1263
  }
@@ -1502,7 +1506,8 @@ var useCustomerBase = ({
1502
1506
  let autumnFunctions = emptyDefaultFunctions;
1503
1507
  if (AutumnContext2) {
1504
1508
  autumnFunctions = useAutumnBase({
1505
- AutumnContext: AutumnContext2
1509
+ AutumnContext: AutumnContext2,
1510
+ refetchCustomer: mutate
1506
1511
  });
1507
1512
  }
1508
1513
  return {