autumn-js 0.0.109 → 0.0.111

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 (152) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +18 -18
  2. package/dist/libraries/backend/better-auth.d.ts +18 -18
  3. package/dist/libraries/backend/express.d.mts +1 -1
  4. package/dist/libraries/backend/express.d.ts +1 -1
  5. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  6. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  7. package/dist/libraries/react/AutumnContext.d.mts +6 -6
  8. package/dist/libraries/react/AutumnContext.d.ts +6 -6
  9. package/dist/libraries/react/AutumnContext.mjs +6 -6
  10. package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
  11. package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
  12. package/dist/libraries/react/BaseAutumnProvider.js +16 -10
  13. package/dist/libraries/react/BaseAutumnProvider.mjs +9 -9
  14. package/dist/libraries/react/{ReactAutumnClient-Cf3-brZx.d.ts → ReactAutumnClient-BW-6a3gM.d.ts} +5 -5
  15. package/dist/libraries/react/{ReactAutumnClient-C4CPCKrp.d.mts → ReactAutumnClient-Cs9voLwk.d.mts} +5 -5
  16. package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
  17. package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
  18. package/dist/libraries/react/ReactAutumnProvider.js +16 -10
  19. package/dist/libraries/react/ReactAutumnProvider.mjs +10 -10
  20. package/dist/libraries/react/{attachTypes-C1BZ4HNs.d.mts → attachTypes-4AuOXG1E.d.mts} +1 -1
  21. package/dist/libraries/react/{attachTypes-BKzcsvuA.d.ts → attachTypes-DWeMSBmL.d.ts} +1 -1
  22. package/dist/libraries/react/{chunk-T4Z5BKOW.mjs → chunk-673LDIYO.mjs} +3 -3
  23. package/dist/libraries/react/{chunk-FE5GYL7P.mjs → chunk-6ZY2HQCJ.mjs} +2 -2
  24. package/dist/libraries/react/{chunk-WSB47D4U.mjs → chunk-7BVXQ3DF.mjs} +2 -2
  25. package/dist/libraries/react/{chunk-VAWI6RK6.mjs → chunk-AGQVYTPY.mjs} +14 -14
  26. package/dist/libraries/react/{chunk-MIITU3Q2.mjs → chunk-CK7IHYXM.mjs} +6 -6
  27. package/dist/libraries/react/{chunk-V2XCEJ4T.mjs → chunk-J7CZEH52.mjs} +1 -1
  28. package/dist/libraries/react/{chunk-3LLAOCW3.mjs → chunk-KX42ZLE6.mjs} +12 -6
  29. package/dist/libraries/react/{chunk-PDCSW5VX.mjs → chunk-S7DJFJ6P.mjs} +1 -1
  30. package/dist/libraries/react/{chunk-2H7G6M6Z.mjs → chunk-THV76QT6.mjs} +1 -1
  31. package/dist/libraries/react/{chunk-K7IJMDIV.mjs → chunk-UJHH6JP6.mjs} +1 -1
  32. package/dist/libraries/react/{chunk-BF36ZT6M.mjs → chunk-WR2HU2B2.mjs} +13 -4
  33. package/dist/libraries/react/{chunk-OXPO56ZD.mjs → chunk-YN4HCDGX.mjs} +1 -1
  34. package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
  35. package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
  36. package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
  37. package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
  38. package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
  39. package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
  40. package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
  41. package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
  42. package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
  43. package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
  44. package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
  45. package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
  46. package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
  47. package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
  48. package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
  49. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +2 -2
  50. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +2 -2
  51. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +16 -10
  52. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +21 -21
  53. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +2 -2
  54. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +2 -2
  55. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +21 -21
  56. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
  57. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
  58. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
  59. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
  60. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  61. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  62. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +16 -10
  63. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +21 -21
  64. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  65. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  66. package/dist/libraries/react/{cusTypes-DmFGAdnp.d.mts → cusTypes-BnKb-vxP.d.mts} +1 -1
  67. package/dist/libraries/react/{cusTypes-DG6zrQYk.d.ts → cusTypes-CWMup6bJ.d.ts} +1 -1
  68. package/dist/libraries/react/{entTypes-DG9rJhum.d.ts → entTypes-B0UaW3Jh.d.ts} +2 -2
  69. package/dist/libraries/react/{entTypes-BbmxlLGb.d.mts → entTypes-BqZEH0S_.d.mts} +2 -2
  70. package/dist/libraries/react/{genTypes-CHD2Kdqf.d.ts → genTypes-CNkoakWD.d.ts} +1 -1
  71. package/dist/libraries/react/{genTypes-CHerQ_Ka.d.mts → genTypes-DufheKvo.d.mts} +1 -1
  72. package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +11 -8
  73. package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +11 -8
  74. package/dist/libraries/react/hooks/helpers/handleCheck.js +12 -6
  75. package/dist/libraries/react/hooks/helpers/handleCheck.mjs +1 -1
  76. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -6
  77. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -6
  78. package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
  79. package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
  80. package/dist/libraries/react/hooks/useAnalytics.mjs +7 -7
  81. package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
  82. package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
  83. package/dist/libraries/react/hooks/useCustomer.js +16 -10
  84. package/dist/libraries/react/hooks/useCustomer.mjs +9 -9
  85. package/dist/libraries/react/hooks/useCustomerBase.d.mts +7 -7
  86. package/dist/libraries/react/hooks/useCustomerBase.d.ts +7 -7
  87. package/dist/libraries/react/hooks/useCustomerBase.js +16 -10
  88. package/dist/libraries/react/hooks/useCustomerBase.mjs +8 -8
  89. package/dist/libraries/react/hooks/useEntity.d.mts +10 -7
  90. package/dist/libraries/react/hooks/useEntity.d.ts +10 -7
  91. package/dist/libraries/react/hooks/useEntity.js +43 -6
  92. package/dist/libraries/react/hooks/useEntity.mjs +9 -9
  93. package/dist/libraries/react/hooks/useEntityBase.d.mts +12 -9
  94. package/dist/libraries/react/hooks/useEntityBase.d.ts +12 -9
  95. package/dist/libraries/react/hooks/useEntityBase.js +43 -6
  96. package/dist/libraries/react/hooks/useEntityBase.mjs +8 -8
  97. package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
  98. package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
  99. package/dist/libraries/react/hooks/usePaywall.mjs +7 -7
  100. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  101. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  102. package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
  103. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
  104. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
  105. package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
  106. package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
  107. package/dist/libraries/react/index.d.mts +5 -2
  108. package/dist/libraries/react/index.d.ts +5 -2
  109. package/dist/libraries/react/index.js +25 -11
  110. package/dist/libraries/react/index.mjs +25 -11
  111. package/dist/libraries/react/{prodTypes-Mrr6azoz.d.mts → prodTypes-BlLYTHoR.d.mts} +1 -1
  112. package/dist/libraries/react/{prodTypes-Mrr6azoz.d.ts → prodTypes-BlLYTHoR.d.ts} +1 -1
  113. package/dist/next/client/NextAutumnClient.d.mts +6 -6
  114. package/dist/next/client/NextAutumnClient.d.ts +6 -6
  115. package/dist/next/client/NextAutumnProvider.d.mts +1 -1
  116. package/dist/next/client/NextAutumnProvider.d.ts +1 -1
  117. package/dist/next/client/{clientAttachTypes-SPRZ0-u3.d.ts → clientAttachTypes-BeoVoLvx.d.ts} +3 -3
  118. package/dist/next/client/{clientAttachTypes-Dde-B-ga.d.mts → clientAttachTypes-CWF6N5NJ.d.mts} +3 -3
  119. package/dist/next/client/clientUtils.d.mts +2 -2
  120. package/dist/next/client/clientUtils.d.ts +2 -2
  121. package/dist/next/client/{entTypes-DzTUirPM.d.mts → entTypes-CKUB-m_4.d.mts} +1 -1
  122. package/dist/next/client/{entTypes-BYx5xBXO.d.ts → entTypes-DTHm0Be2.d.ts} +1 -1
  123. package/dist/next/client/hooks/useAutumn.d.mts +3 -3
  124. package/dist/next/client/hooks/useAutumn.d.ts +3 -3
  125. package/dist/next/client/hooks/useCustomer.d.mts +5 -5
  126. package/dist/next/client/hooks/useCustomer.d.ts +5 -5
  127. package/dist/next/client/hooks/useEntity.d.mts +7 -4
  128. package/dist/next/client/hooks/useEntity.d.ts +7 -4
  129. package/dist/next/client/types.d.mts +2 -2
  130. package/dist/next/client/types.d.ts +2 -2
  131. package/dist/next/index.d.mts +5 -2
  132. package/dist/next/index.d.ts +5 -2
  133. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  134. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  135. package/dist/next/server/componentActions.d.mts +1 -1
  136. package/dist/next/server/componentActions.d.ts +1 -1
  137. package/dist/next/server/cusActions.d.mts +15 -15
  138. package/dist/next/server/cusActions.d.ts +15 -15
  139. package/dist/next/server/genActions.d.mts +1 -1
  140. package/dist/next/server/genActions.d.ts +1 -1
  141. package/dist/sdk/index.d.mts +1 -1
  142. package/dist/sdk/index.d.ts +1 -1
  143. package/package.json +1 -1
  144. package/dist/libraries/backend/{referralTypes-CpEs5id9.d.mts → referralTypes-C9zChWVP.d.mts} +35 -35
  145. package/dist/libraries/backend/{referralTypes-PV0SFnx_.d.ts → referralTypes-DuBjp_OL.d.ts} +35 -35
  146. package/dist/libraries/react/{chunk-MS4UEBVX.mjs → chunk-EEEUDTTP.mjs} +16 -16
  147. package/dist/next/client/{attachTypes-DJ4Lz7dN.d.ts → attachTypes-DM5XWLRr.d.ts} +2 -2
  148. package/dist/next/client/{attachTypes-Hja4wFD-.d.mts → attachTypes-Pf0NPwsI.d.mts} +2 -2
  149. package/dist/next/client/{cusTypes-CkonzuMA.d.mts → cusTypes-Dv_i9zPh.d.mts} +2 -2
  150. package/dist/next/client/{cusTypes-CGQNbPsC.d.ts → cusTypes-QmO8mj7R.d.ts} +2 -2
  151. package/dist/next/server/{cusTypes-BpoYhIJ2.d.mts → cusTypes-d13IMtrx.d.mts} +4 -4
  152. package/dist/next/server/{cusTypes-BpoYhIJ2.d.ts → cusTypes-d13IMtrx.d.ts} +4 -4
@@ -1,4 +1,4 @@
1
- import { C as CustomerData, B as BillingPortalParams } from './cusTypes-BpoYhIJ2.js';
1
+ import { C as CustomerData, B as BillingPortalParams } from './cusTypes-d13IMtrx.js';
2
2
  import 'zod';
3
3
 
4
4
  declare const attachAction: (args: Omit<{
@@ -829,7 +829,7 @@ type Failure<E> = {
829
829
  error: E;
830
830
  statusCode?: number;
831
831
  };
832
- declare const toContainerResult: ({ response, logger, logError }: {
832
+ declare const toContainerResult: ({ response, logger, logError, }: {
833
833
  response: Response;
834
834
  logger: Console;
835
835
  logError?: boolean;
@@ -829,7 +829,7 @@ type Failure<E> = {
829
829
  error: E;
830
830
  statusCode?: number;
831
831
  };
832
- declare const toContainerResult: ({ response, logger, logError }: {
832
+ declare const toContainerResult: ({ response, logger, logError, }: {
833
833
  response: Response;
834
834
  logger: Console;
835
835
  logError?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.0.109",
4
+ "version": "0.0.111",
5
5
  "main": "./dist/sdk/index.js",
6
6
  "files": [
7
7
  "dist",
@@ -68,12 +68,12 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
68
68
  credit_amount: number;
69
69
  }>, "many">>;
70
70
  }, "strip", z.ZodTypeAny, {
71
- customer_id: string;
71
+ allowed: boolean;
72
72
  feature_id: string;
73
+ customer_id: string;
73
74
  required_balance: number;
74
- allowed: boolean;
75
- entity_id?: string | undefined;
76
75
  usage_limit?: number | undefined;
76
+ entity_id?: string | undefined;
77
77
  unlimited?: boolean | undefined;
78
78
  interval?: ProductItemInterval | undefined;
79
79
  balance?: number | undefined;
@@ -93,12 +93,12 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
93
93
  credit_amount: number;
94
94
  }[] | undefined;
95
95
  }, {
96
- customer_id: string;
96
+ allowed: boolean;
97
97
  feature_id: string;
98
+ customer_id: string;
98
99
  required_balance: number;
99
- allowed: boolean;
100
- entity_id?: string | undefined;
101
100
  usage_limit?: number | undefined;
101
+ entity_id?: string | undefined;
102
102
  unlimited?: boolean | undefined;
103
103
  interval?: ProductItemInterval | undefined;
104
104
  balance?: number | undefined;
@@ -385,19 +385,19 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
385
385
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
386
386
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
387
387
  }, "strip", z.ZodTypeAny, {
388
- metadata?: Record<string, any> | undefined;
389
- expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
388
+ id?: string | null | undefined;
390
389
  name?: string | null | undefined;
391
390
  email?: string | null | undefined;
392
391
  fingerprint?: string | null | undefined;
393
- id?: string | null | undefined;
394
- }, {
395
392
  metadata?: Record<string, any> | undefined;
396
393
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
394
+ }, {
395
+ id?: string | null | undefined;
397
396
  name?: string | null | undefined;
398
397
  email?: string | null | undefined;
399
398
  fingerprint?: string | null | undefined;
400
- id?: string | null | undefined;
399
+ metadata?: Record<string, any> | undefined;
400
+ expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
401
401
  }>;
402
402
  type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
403
403
  interface UpdateCustomerParams {
@@ -456,18 +456,18 @@ declare const TrackParamsSchema: z.ZodObject<{
456
456
  entity_data: z.ZodOptional<z.ZodAny>;
457
457
  }, "strip", z.ZodTypeAny, {
458
458
  customer_id: string;
459
- value?: number | undefined;
460
- entity_id?: string | undefined;
461
459
  feature_id?: string | undefined;
460
+ entity_id?: string | undefined;
461
+ value?: number | undefined;
462
462
  customer_data?: any;
463
463
  entity_data?: any;
464
464
  event_name?: string | undefined;
465
465
  idempotency_key?: string | undefined;
466
466
  }, {
467
467
  customer_id: string;
468
- value?: number | undefined;
469
- entity_id?: string | undefined;
470
468
  feature_id?: string | undefined;
469
+ entity_id?: string | undefined;
470
+ value?: number | undefined;
471
471
  customer_data?: any;
472
472
  entity_data?: any;
473
473
  event_name?: string | undefined;
@@ -495,28 +495,28 @@ declare const CheckParamsSchema: z.ZodObject<{
495
495
  }>>;
496
496
  }, "strip", z.ZodTypeAny, {
497
497
  customer_id: string;
498
- product_id?: string | undefined;
499
- entity_id?: string | undefined;
500
498
  feature_id?: string | undefined;
499
+ entity_id?: string | undefined;
500
+ required_balance?: number | undefined;
501
+ product_id?: string | undefined;
501
502
  customer_data?: any;
502
503
  entity_data?: {
503
504
  feature_id: string;
504
505
  name?: string | undefined;
505
506
  } | undefined;
506
- required_balance?: number | undefined;
507
507
  send_event?: boolean | undefined;
508
508
  with_preview?: boolean | undefined;
509
509
  }, {
510
510
  customer_id: string;
511
- product_id?: string | undefined;
512
- entity_id?: string | undefined;
513
511
  feature_id?: string | undefined;
512
+ entity_id?: string | undefined;
513
+ required_balance?: number | undefined;
514
+ product_id?: string | undefined;
514
515
  customer_data?: any;
515
516
  entity_data?: {
516
517
  feature_id: string;
517
518
  name?: string | undefined;
518
519
  } | undefined;
519
- required_balance?: number | undefined;
520
520
  send_event?: boolean | undefined;
521
521
  with_preview?: boolean | undefined;
522
522
  }>;
@@ -547,12 +547,12 @@ declare const QueryParamsSchema: z.ZodObject<{
547
547
  feature_id: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
548
548
  range: z.ZodOptional<z.ZodEnum<["24h", "7d", "30d", "90d", "last_cycle"]>>;
549
549
  }, "strip", z.ZodTypeAny, {
550
- customer_id: string;
551
550
  feature_id: string | string[];
551
+ customer_id: string;
552
552
  range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
553
553
  }, {
554
- customer_id: string;
555
554
  feature_id: string | string[];
555
+ customer_id: string;
556
556
  range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
557
557
  }>;
558
558
  type QueryParams = z.infer<typeof QueryParamsSchema>;
@@ -612,13 +612,13 @@ declare const AttachParamsSchema: z.ZodObject<{
612
612
  reward: z.ZodOptional<z.ZodString>;
613
613
  }, "strip", z.ZodTypeAny, {
614
614
  customer_id: string;
615
+ entity_id?: string | undefined;
615
616
  options?: {
616
617
  feature_id: string;
617
618
  quantity: number;
618
619
  }[] | undefined;
619
620
  metadata?: Record<string, string> | undefined;
620
621
  product_id?: string | undefined;
621
- entity_id?: string | undefined;
622
622
  product_ids?: string[] | undefined;
623
623
  free_trial?: boolean | undefined;
624
624
  success_url?: string | undefined;
@@ -633,13 +633,13 @@ declare const AttachParamsSchema: z.ZodObject<{
633
633
  reward?: string | undefined;
634
634
  }, {
635
635
  customer_id: string;
636
+ entity_id?: string | undefined;
636
637
  options?: {
637
638
  feature_id: string;
638
639
  quantity: number;
639
640
  }[] | undefined;
640
641
  metadata?: Record<string, string> | undefined;
641
642
  product_id?: string | undefined;
642
- entity_id?: string | undefined;
643
643
  product_ids?: string[] | undefined;
644
644
  free_trial?: boolean | undefined;
645
645
  success_url?: string | undefined;
@@ -685,11 +685,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
685
685
  }, "strip", z.ZodTypeAny, {
686
686
  customer_id: string;
687
687
  product_id: string;
688
+ entity_id?: string | undefined;
688
689
  options?: {
689
690
  feature_id: string;
690
691
  quantity: number;
691
692
  }[] | undefined;
692
- entity_id?: string | undefined;
693
693
  success_url?: string | undefined;
694
694
  customer_data?: {
695
695
  name?: string | null | undefined;
@@ -699,11 +699,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
699
699
  }, {
700
700
  customer_id: string;
701
701
  product_id: string;
702
+ entity_id?: string | undefined;
702
703
  options?: {
703
704
  feature_id: string;
704
705
  quantity: number;
705
706
  }[] | undefined;
706
- entity_id?: string | undefined;
707
707
  success_url?: string | undefined;
708
708
  customer_data?: {
709
709
  name?: string | null | undefined;
@@ -798,18 +798,18 @@ declare class Autumn {
798
798
  static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
799
799
  checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
800
800
  static attach: (params: AttachParams) => Promise<Result<{
801
- message: string;
802
- code: string;
803
801
  customer_id: string;
802
+ code: string;
803
+ message: string;
804
804
  product_ids: string[];
805
805
  customer_data?: any;
806
806
  checkout_url?: string | undefined;
807
807
  }, AutumnError>>;
808
808
  static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
809
809
  attach(params: AttachParams): Promise<Result<{
810
- message: string;
811
- code: string;
812
810
  customer_id: string;
811
+ code: string;
812
+ message: string;
813
813
  product_ids: string[];
814
814
  customer_data?: any;
815
815
  checkout_url?: string | undefined;
@@ -829,15 +829,15 @@ declare class Autumn {
829
829
  static check: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
830
830
  check(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
831
831
  static track: (params: TrackParams) => Promise<Result<{
832
- code: string;
833
832
  customer_id: string;
833
+ code: string;
834
834
  id: string;
835
835
  feature_id?: string | undefined;
836
836
  event_name?: string | undefined;
837
837
  }, AutumnError>>;
838
838
  track(params: TrackParams): Promise<Result<{
839
- code: string;
840
839
  customer_id: string;
840
+ code: string;
841
841
  id: string;
842
842
  feature_id?: string | undefined;
843
843
  event_name?: string | undefined;
@@ -890,11 +890,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
890
890
  code: z.ZodString;
891
891
  customer_id: z.ZodString;
892
892
  }, "strip", z.ZodTypeAny, {
893
- code: string;
894
893
  customer_id: string;
895
- }, {
896
894
  code: string;
895
+ }, {
897
896
  customer_id: string;
897
+ code: string;
898
898
  }>;
899
899
  type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
900
900
 
@@ -68,12 +68,12 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
68
68
  credit_amount: number;
69
69
  }>, "many">>;
70
70
  }, "strip", z.ZodTypeAny, {
71
- customer_id: string;
71
+ allowed: boolean;
72
72
  feature_id: string;
73
+ customer_id: string;
73
74
  required_balance: number;
74
- allowed: boolean;
75
- entity_id?: string | undefined;
76
75
  usage_limit?: number | undefined;
76
+ entity_id?: string | undefined;
77
77
  unlimited?: boolean | undefined;
78
78
  interval?: ProductItemInterval | undefined;
79
79
  balance?: number | undefined;
@@ -93,12 +93,12 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
93
93
  credit_amount: number;
94
94
  }[] | undefined;
95
95
  }, {
96
- customer_id: string;
96
+ allowed: boolean;
97
97
  feature_id: string;
98
+ customer_id: string;
98
99
  required_balance: number;
99
- allowed: boolean;
100
- entity_id?: string | undefined;
101
100
  usage_limit?: number | undefined;
101
+ entity_id?: string | undefined;
102
102
  unlimited?: boolean | undefined;
103
103
  interval?: ProductItemInterval | undefined;
104
104
  balance?: number | undefined;
@@ -385,19 +385,19 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
385
385
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
386
386
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
387
387
  }, "strip", z.ZodTypeAny, {
388
- metadata?: Record<string, any> | undefined;
389
- expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
388
+ id?: string | null | undefined;
390
389
  name?: string | null | undefined;
391
390
  email?: string | null | undefined;
392
391
  fingerprint?: string | null | undefined;
393
- id?: string | null | undefined;
394
- }, {
395
392
  metadata?: Record<string, any> | undefined;
396
393
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
394
+ }, {
395
+ id?: string | null | undefined;
397
396
  name?: string | null | undefined;
398
397
  email?: string | null | undefined;
399
398
  fingerprint?: string | null | undefined;
400
- id?: string | null | undefined;
399
+ metadata?: Record<string, any> | undefined;
400
+ expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
401
401
  }>;
402
402
  type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
403
403
  interface UpdateCustomerParams {
@@ -456,18 +456,18 @@ declare const TrackParamsSchema: z.ZodObject<{
456
456
  entity_data: z.ZodOptional<z.ZodAny>;
457
457
  }, "strip", z.ZodTypeAny, {
458
458
  customer_id: string;
459
- value?: number | undefined;
460
- entity_id?: string | undefined;
461
459
  feature_id?: string | undefined;
460
+ entity_id?: string | undefined;
461
+ value?: number | undefined;
462
462
  customer_data?: any;
463
463
  entity_data?: any;
464
464
  event_name?: string | undefined;
465
465
  idempotency_key?: string | undefined;
466
466
  }, {
467
467
  customer_id: string;
468
- value?: number | undefined;
469
- entity_id?: string | undefined;
470
468
  feature_id?: string | undefined;
469
+ entity_id?: string | undefined;
470
+ value?: number | undefined;
471
471
  customer_data?: any;
472
472
  entity_data?: any;
473
473
  event_name?: string | undefined;
@@ -495,28 +495,28 @@ declare const CheckParamsSchema: z.ZodObject<{
495
495
  }>>;
496
496
  }, "strip", z.ZodTypeAny, {
497
497
  customer_id: string;
498
- product_id?: string | undefined;
499
- entity_id?: string | undefined;
500
498
  feature_id?: string | undefined;
499
+ entity_id?: string | undefined;
500
+ required_balance?: number | undefined;
501
+ product_id?: string | undefined;
501
502
  customer_data?: any;
502
503
  entity_data?: {
503
504
  feature_id: string;
504
505
  name?: string | undefined;
505
506
  } | undefined;
506
- required_balance?: number | undefined;
507
507
  send_event?: boolean | undefined;
508
508
  with_preview?: boolean | undefined;
509
509
  }, {
510
510
  customer_id: string;
511
- product_id?: string | undefined;
512
- entity_id?: string | undefined;
513
511
  feature_id?: string | undefined;
512
+ entity_id?: string | undefined;
513
+ required_balance?: number | undefined;
514
+ product_id?: string | undefined;
514
515
  customer_data?: any;
515
516
  entity_data?: {
516
517
  feature_id: string;
517
518
  name?: string | undefined;
518
519
  } | undefined;
519
- required_balance?: number | undefined;
520
520
  send_event?: boolean | undefined;
521
521
  with_preview?: boolean | undefined;
522
522
  }>;
@@ -547,12 +547,12 @@ declare const QueryParamsSchema: z.ZodObject<{
547
547
  feature_id: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
548
548
  range: z.ZodOptional<z.ZodEnum<["24h", "7d", "30d", "90d", "last_cycle"]>>;
549
549
  }, "strip", z.ZodTypeAny, {
550
- customer_id: string;
551
550
  feature_id: string | string[];
551
+ customer_id: string;
552
552
  range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
553
553
  }, {
554
- customer_id: string;
555
554
  feature_id: string | string[];
555
+ customer_id: string;
556
556
  range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
557
557
  }>;
558
558
  type QueryParams = z.infer<typeof QueryParamsSchema>;
@@ -612,13 +612,13 @@ declare const AttachParamsSchema: z.ZodObject<{
612
612
  reward: z.ZodOptional<z.ZodString>;
613
613
  }, "strip", z.ZodTypeAny, {
614
614
  customer_id: string;
615
+ entity_id?: string | undefined;
615
616
  options?: {
616
617
  feature_id: string;
617
618
  quantity: number;
618
619
  }[] | undefined;
619
620
  metadata?: Record<string, string> | undefined;
620
621
  product_id?: string | undefined;
621
- entity_id?: string | undefined;
622
622
  product_ids?: string[] | undefined;
623
623
  free_trial?: boolean | undefined;
624
624
  success_url?: string | undefined;
@@ -633,13 +633,13 @@ declare const AttachParamsSchema: z.ZodObject<{
633
633
  reward?: string | undefined;
634
634
  }, {
635
635
  customer_id: string;
636
+ entity_id?: string | undefined;
636
637
  options?: {
637
638
  feature_id: string;
638
639
  quantity: number;
639
640
  }[] | undefined;
640
641
  metadata?: Record<string, string> | undefined;
641
642
  product_id?: string | undefined;
642
- entity_id?: string | undefined;
643
643
  product_ids?: string[] | undefined;
644
644
  free_trial?: boolean | undefined;
645
645
  success_url?: string | undefined;
@@ -685,11 +685,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
685
685
  }, "strip", z.ZodTypeAny, {
686
686
  customer_id: string;
687
687
  product_id: string;
688
+ entity_id?: string | undefined;
688
689
  options?: {
689
690
  feature_id: string;
690
691
  quantity: number;
691
692
  }[] | undefined;
692
- entity_id?: string | undefined;
693
693
  success_url?: string | undefined;
694
694
  customer_data?: {
695
695
  name?: string | null | undefined;
@@ -699,11 +699,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
699
699
  }, {
700
700
  customer_id: string;
701
701
  product_id: string;
702
+ entity_id?: string | undefined;
702
703
  options?: {
703
704
  feature_id: string;
704
705
  quantity: number;
705
706
  }[] | undefined;
706
- entity_id?: string | undefined;
707
707
  success_url?: string | undefined;
708
708
  customer_data?: {
709
709
  name?: string | null | undefined;
@@ -798,18 +798,18 @@ declare class Autumn {
798
798
  static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
799
799
  checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
800
800
  static attach: (params: AttachParams) => Promise<Result<{
801
- message: string;
802
- code: string;
803
801
  customer_id: string;
802
+ code: string;
803
+ message: string;
804
804
  product_ids: string[];
805
805
  customer_data?: any;
806
806
  checkout_url?: string | undefined;
807
807
  }, AutumnError>>;
808
808
  static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
809
809
  attach(params: AttachParams): Promise<Result<{
810
- message: string;
811
- code: string;
812
810
  customer_id: string;
811
+ code: string;
812
+ message: string;
813
813
  product_ids: string[];
814
814
  customer_data?: any;
815
815
  checkout_url?: string | undefined;
@@ -829,15 +829,15 @@ declare class Autumn {
829
829
  static check: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
830
830
  check(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
831
831
  static track: (params: TrackParams) => Promise<Result<{
832
- code: string;
833
832
  customer_id: string;
833
+ code: string;
834
834
  id: string;
835
835
  feature_id?: string | undefined;
836
836
  event_name?: string | undefined;
837
837
  }, AutumnError>>;
838
838
  track(params: TrackParams): Promise<Result<{
839
- code: string;
840
839
  customer_id: string;
840
+ code: string;
841
841
  id: string;
842
842
  feature_id?: string | undefined;
843
843
  event_name?: string | undefined;
@@ -890,11 +890,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
890
890
  code: z.ZodString;
891
891
  customer_id: z.ZodString;
892
892
  }, "strip", z.ZodTypeAny, {
893
- code: string;
894
893
  customer_id: string;
895
- }, {
896
894
  code: string;
895
+ }, {
897
896
  customer_id: string;
897
+ code: string;
898
898
  }>;
899
899
  type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
900
900
 
@@ -4,22 +4,6 @@ import {
4
4
  AutumnError,
5
5
  toContainerResult
6
6
  } from "./chunk-D3GL2QV3.mjs";
7
- import {
8
- listProductsMethod
9
- } from "./chunk-V575SGOW.mjs";
10
- import {
11
- createCode,
12
- redeemCode
13
- } from "./chunk-ZV4RPZTM.mjs";
14
- import {
15
- logAuthError
16
- } from "./chunk-JVCOY7ZL.mjs";
17
- import {
18
- logFetchError
19
- } from "./chunk-CIBQ4BJU.mjs";
20
- import {
21
- getPricingTableMethod
22
- } from "./chunk-VTGR7VVK.mjs";
23
7
  import {
24
8
  createCustomerMethod
25
9
  } from "./chunk-WFFVOEUG.mjs";
@@ -38,6 +22,22 @@ import {
38
22
  setupPaymentMethod,
39
23
  trackMethod
40
24
  } from "./chunk-BCLKTVUX.mjs";
25
+ import {
26
+ listProductsMethod
27
+ } from "./chunk-V575SGOW.mjs";
28
+ import {
29
+ createCode,
30
+ redeemCode
31
+ } from "./chunk-ZV4RPZTM.mjs";
32
+ import {
33
+ logAuthError
34
+ } from "./chunk-JVCOY7ZL.mjs";
35
+ import {
36
+ logFetchError
37
+ } from "./chunk-CIBQ4BJU.mjs";
38
+ import {
39
+ getPricingTableMethod
40
+ } from "./chunk-VTGR7VVK.mjs";
41
41
 
42
42
  // src/libraries/react/client/ReactAutumnClient.tsx
43
43
  var AutumnClient = class {
@@ -20,16 +20,16 @@ declare const AttachResultSchema: z.ZodObject<{
20
20
  message: z.ZodString;
21
21
  customer_data: z.ZodOptional<z.ZodAny>;
22
22
  }, "strip", z.ZodTypeAny, {
23
+ customer_id: string;
23
24
  code: string;
24
25
  message: string;
25
- customer_id: string;
26
26
  product_ids: string[];
27
27
  checkout_url?: string | undefined;
28
28
  customer_data?: any;
29
29
  }, {
30
+ customer_id: string;
30
31
  code: string;
31
32
  message: string;
32
- customer_id: string;
33
33
  product_ids: string[];
34
34
  checkout_url?: string | undefined;
35
35
  customer_data?: any;
@@ -20,16 +20,16 @@ declare const AttachResultSchema: z.ZodObject<{
20
20
  message: z.ZodString;
21
21
  customer_data: z.ZodOptional<z.ZodAny>;
22
22
  }, "strip", z.ZodTypeAny, {
23
+ customer_id: string;
23
24
  code: string;
24
25
  message: string;
25
- customer_id: string;
26
26
  product_ids: string[];
27
27
  checkout_url?: string | undefined;
28
28
  customer_data?: any;
29
29
  }, {
30
+ customer_id: string;
30
31
  code: string;
31
32
  message: string;
32
- customer_id: string;
33
33
  product_ids: string[];
34
34
  checkout_url?: string | undefined;
35
35
  customer_data?: any;
@@ -147,17 +147,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
147
147
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
148
148
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
149
149
  }, "strip", z.ZodTypeAny, {
150
+ id?: string | null | undefined;
150
151
  name?: string | null | undefined;
151
152
  email?: string | null | undefined;
152
153
  fingerprint?: string | null | undefined;
153
- id?: string | null | undefined;
154
154
  metadata?: Record<string, any> | undefined;
155
155
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
156
156
  }, {
157
+ id?: string | null | undefined;
157
158
  name?: string | null | undefined;
158
159
  email?: string | null | undefined;
159
160
  fingerprint?: string | null | undefined;
160
- id?: string | null | undefined;
161
161
  metadata?: Record<string, any> | undefined;
162
162
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
163
163
  }>;
@@ -147,17 +147,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
147
147
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
148
148
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
149
149
  }, "strip", z.ZodTypeAny, {
150
+ id?: string | null | undefined;
150
151
  name?: string | null | undefined;
151
152
  email?: string | null | undefined;
152
153
  fingerprint?: string | null | undefined;
153
- id?: string | null | undefined;
154
154
  metadata?: Record<string, any> | undefined;
155
155
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
156
156
  }, {
157
+ id?: string | null | undefined;
157
158
  name?: string | null | undefined;
158
159
  email?: string | null | undefined;
159
160
  fingerprint?: string | null | undefined;
160
- id?: string | null | undefined;
161
161
  metadata?: Record<string, any> | undefined;
162
162
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
163
163
  }>;
@@ -67,9 +67,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
67
67
  credit_amount: number;
68
68
  }>, "many">>;
69
69
  }, "strip", z.ZodTypeAny, {
70
- customer_id: string;
71
70
  allowed: boolean;
72
71
  feature_id: string;
72
+ customer_id: string;
73
73
  required_balance: number;
74
74
  usage_limit?: number | undefined;
75
75
  entity_id?: string | undefined;
@@ -92,9 +92,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
92
92
  credit_amount: number;
93
93
  }[] | undefined;
94
94
  }, {
95
- customer_id: string;
96
95
  allowed: boolean;
97
96
  feature_id: string;
97
+ customer_id: string;
98
98
  required_balance: number;
99
99
  usage_limit?: number | undefined;
100
100
  entity_id?: string | undefined;
@@ -384,17 +384,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
384
384
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
385
385
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
386
386
  }, "strip", z.ZodTypeAny, {
387
+ id?: string | null | undefined;
387
388
  name?: string | null | undefined;
388
389
  email?: string | null | undefined;
389
390
  fingerprint?: string | null | undefined;
390
- id?: string | null | undefined;
391
391
  metadata?: Record<string, any> | undefined;
392
392
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
393
393
  }, {
394
+ id?: string | null | undefined;
394
395
  name?: string | null | undefined;
395
396
  email?: string | null | undefined;
396
397
  fingerprint?: string | null | undefined;
397
- id?: string | null | undefined;
398
398
  metadata?: Record<string, any> | undefined;
399
399
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
400
400
  }>;