autumn-js 0.0.77 → 0.0.79

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 (197) hide show
  1. package/dist/libraries/backend/express.d.mts +3 -2
  2. package/dist/libraries/backend/express.d.ts +3 -2
  3. package/dist/libraries/backend/express.js +2 -2
  4. package/dist/libraries/backend/express.mjs +2 -2
  5. package/dist/libraries/backend/fastify.d.mts +1 -0
  6. package/dist/libraries/backend/fastify.d.ts +1 -0
  7. package/dist/libraries/backend/fastify.js +19 -0
  8. package/dist/libraries/backend/fastify.mjs +7 -0
  9. package/dist/libraries/backend/hono.d.mts +2 -0
  10. package/dist/libraries/backend/hono.d.ts +2 -0
  11. package/dist/libraries/backend/hono.js +20 -1
  12. package/dist/libraries/backend/hono.mjs +8 -1
  13. package/dist/libraries/backend/react-router.d.mts +1 -1
  14. package/dist/libraries/backend/react-router.d.ts +1 -1
  15. package/dist/libraries/backend/react-router.js +21 -0
  16. package/dist/libraries/backend/react-router.mjs +9 -0
  17. package/dist/libraries/backend/{referralTypes-DiYwS4QY.d.mts → referralTypes-DUHggPfB.d.mts} +126 -126
  18. package/dist/libraries/backend/{referralTypes-CSbCGBim.d.ts → referralTypes-PidjhXlJ.d.ts} +126 -126
  19. package/dist/libraries/backend/supabase.d.mts +1 -0
  20. package/dist/libraries/backend/supabase.d.ts +1 -0
  21. package/dist/libraries/backend/supabase.js +21 -0
  22. package/dist/libraries/backend/supabase.mjs +9 -0
  23. package/dist/libraries/backend/tanstack.d.mts +1 -0
  24. package/dist/libraries/backend/tanstack.d.ts +1 -0
  25. package/dist/libraries/backend/tanstack.js +21 -0
  26. package/dist/libraries/backend/tanstack.mjs +9 -0
  27. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  28. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  29. package/dist/libraries/react/AutumnContext.d.mts +4 -5
  30. package/dist/libraries/react/AutumnContext.d.ts +4 -5
  31. package/dist/libraries/react/AutumnContext.mjs +7 -7
  32. package/dist/libraries/react/BaseAutumnProvider.css +1264 -0
  33. package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -5
  34. package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -5
  35. package/dist/libraries/react/BaseAutumnProvider.js +2 -1
  36. package/dist/libraries/react/BaseAutumnProvider.mjs +17 -16
  37. package/dist/libraries/react/{ReactAutumnClient-CrkFLuOn.d.mts → ReactAutumnClient-BUpLpfaT.d.mts} +3 -4
  38. package/dist/libraries/react/{ReactAutumnClient-A7x9envm.d.ts → ReactAutumnClient-DykUHFzU.d.ts} +3 -4
  39. package/dist/libraries/react/ReactAutumnProvider.css +1264 -0
  40. package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
  41. package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
  42. package/dist/libraries/react/ReactAutumnProvider.js +2 -1
  43. package/dist/libraries/react/ReactAutumnProvider.mjs +17 -16
  44. package/dist/libraries/react/{chunk-XXMAVKQ4.mjs → chunk-2E22VDNL.mjs} +2 -2
  45. package/dist/libraries/react/{chunk-FINFVKJY.mjs → chunk-4FM7BXFT.mjs} +23 -19
  46. package/dist/libraries/react/{chunk-UMZA5GHL.mjs → chunk-ANT5FRPE.mjs} +1 -1
  47. package/dist/libraries/react/chunk-OWFX3JFF.mjs +23 -0
  48. package/dist/libraries/react/{chunk-WI6WFW54.mjs → chunk-QMPP4FVB.mjs} +2 -1
  49. package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -5
  50. package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -5
  51. package/dist/libraries/react/client/ReactAutumnClient.mjs +6 -6
  52. package/dist/libraries/react/client/clientCompMethods.d.mts +4 -5
  53. package/dist/libraries/react/client/clientCompMethods.d.ts +4 -5
  54. package/dist/libraries/react/client/clientCusMethods.d.mts +4 -5
  55. package/dist/libraries/react/client/clientCusMethods.d.ts +4 -5
  56. package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -5
  57. package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -5
  58. package/dist/libraries/react/client/clientGenMethods.d.mts +4 -5
  59. package/dist/libraries/react/client/clientGenMethods.d.ts +4 -5
  60. package/dist/libraries/react/client/clientProdMethods.d.mts +4 -5
  61. package/dist/libraries/react/client/clientProdMethods.d.ts +4 -5
  62. package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -5
  63. package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -5
  64. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +1264 -0
  65. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -2
  66. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -2
  67. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +2 -1
  68. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +17 -16
  69. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -2
  70. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -2
  71. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -2
  72. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -2
  73. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +2 -2
  74. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -2
  75. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -2
  76. package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +1264 -0
  77. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -2
  78. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -2
  79. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +19 -2
  80. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +17 -16
  81. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  82. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  83. package/dist/libraries/react/cusTypes-CrTZaKED.d.mts +225 -0
  84. package/dist/libraries/react/cusTypes-CrTZaKED.d.ts +225 -0
  85. package/dist/libraries/react/{entTypes-8gkfAi3g.d.mts → entTypes-C-4aVfR8.d.mts} +1 -1
  86. package/dist/libraries/react/{entTypes-C8jD10M8.d.ts → entTypes-DWKPjkGS.d.ts} +1 -1
  87. package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
  88. package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
  89. package/dist/libraries/react/hooks/useAutumn.css +1264 -0
  90. package/dist/libraries/react/hooks/useAutumn.d.mts +2 -3
  91. package/dist/libraries/react/hooks/useAutumn.d.ts +2 -3
  92. package/dist/libraries/react/hooks/useAutumn.js +2 -1
  93. package/dist/libraries/react/hooks/useAutumn.mjs +17 -16
  94. package/dist/libraries/react/hooks/useAutumnBase.css +1264 -0
  95. package/dist/libraries/react/hooks/useAutumnBase.d.mts +4 -5
  96. package/dist/libraries/react/hooks/useAutumnBase.d.ts +4 -5
  97. package/dist/libraries/react/hooks/useAutumnBase.js +2 -1
  98. package/dist/libraries/react/hooks/useAutumnBase.mjs +17 -16
  99. package/dist/libraries/react/hooks/useCustomer.css +1264 -0
  100. package/dist/libraries/react/hooks/useCustomer.d.mts +4 -5
  101. package/dist/libraries/react/hooks/useCustomer.d.ts +4 -5
  102. package/dist/libraries/react/hooks/useCustomer.js +2 -1
  103. package/dist/libraries/react/hooks/useCustomer.mjs +17 -16
  104. package/dist/libraries/react/hooks/useCustomerBase.css +1264 -0
  105. package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -5
  106. package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -5
  107. package/dist/libraries/react/hooks/useCustomerBase.js +2 -1
  108. package/dist/libraries/react/hooks/useCustomerBase.mjs +17 -16
  109. package/dist/libraries/react/hooks/useEntity.css +1264 -0
  110. package/dist/libraries/react/hooks/useEntity.d.mts +3 -4
  111. package/dist/libraries/react/hooks/useEntity.d.ts +3 -4
  112. package/dist/libraries/react/hooks/useEntity.js +2 -1
  113. package/dist/libraries/react/hooks/useEntity.mjs +17 -16
  114. package/dist/libraries/react/hooks/useEntityBase.css +1264 -0
  115. package/dist/libraries/react/hooks/useEntityBase.d.mts +4 -5
  116. package/dist/libraries/react/hooks/useEntityBase.d.ts +4 -5
  117. package/dist/libraries/react/hooks/useEntityBase.js +2 -1
  118. package/dist/libraries/react/hooks/useEntityBase.mjs +17 -16
  119. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -2
  120. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -2
  121. package/dist/libraries/react/hooks/usePricingTable.js +1 -0
  122. package/dist/libraries/react/hooks/usePricingTable.mjs +9 -9
  123. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -5
  124. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -5
  125. package/dist/libraries/react/hooks/usePricingTableBase.js +1 -0
  126. package/dist/libraries/react/hooks/usePricingTableBase.mjs +8 -8
  127. package/dist/libraries/react/hooks/useProductsBase.mjs +7 -7
  128. package/dist/libraries/react/index.d.ts +115 -115
  129. package/dist/libraries/react/index.js +44 -3
  130. package/dist/libraries/react/index.mjs +44 -3
  131. package/dist/libraries/react/{response-DLD-1iva.d.ts → response-D0CcXse-.d.ts} +2 -3
  132. package/dist/libraries/react/{response-BGS7hGc7.d.mts → response-DwYxo3Li.d.mts} +2 -3
  133. package/dist/libraries/react/utils/inject-styles.d.mts +4 -0
  134. package/dist/libraries/react/utils/inject-styles.d.ts +4 -0
  135. package/dist/libraries/react/utils/inject-styles.js +47 -0
  136. package/dist/libraries/react/utils/inject-styles.mjs +10 -0
  137. package/dist/next/{AutumnProvider-BdIwgk_j.d.mts → AutumnProvider-CGdXoZNQ.d.mts} +116 -7
  138. package/dist/next/{AutumnProvider-BdIwgk_j.d.ts → AutumnProvider-CGdXoZNQ.d.ts} +116 -7
  139. package/dist/next/AutumnProvider.d.mts +1 -1
  140. package/dist/next/AutumnProvider.d.ts +1 -1
  141. package/dist/next/client/NextAutumnClient.d.mts +4 -4
  142. package/dist/next/client/NextAutumnClient.d.ts +4 -4
  143. package/dist/next/client/NextAutumnProvider.d.mts +1 -1
  144. package/dist/next/client/NextAutumnProvider.d.ts +1 -1
  145. package/dist/next/client/{clientGenTypes-CXkGuJ6W.d.ts → clientGenTypes-KQqk1H9-.d.mts} +2 -2
  146. package/dist/next/client/{clientGenTypes-Dh9BiE0s.d.mts → clientGenTypes-_eDeut4m.d.ts} +2 -2
  147. package/dist/next/client/clientUtils.d.mts +2 -2
  148. package/dist/next/client/clientUtils.d.ts +2 -2
  149. package/dist/next/client/cusTypes-CSbB7Wu9.d.mts +225 -0
  150. package/dist/next/client/cusTypes-CSbB7Wu9.d.ts +225 -0
  151. package/dist/next/client/{entTypes-C1-bumir.d.mts → entTypes-6xEkbn32.d.mts} +1 -1
  152. package/dist/next/client/{entTypes-CKc2qHBt.d.ts → entTypes-B3R2yjLW.d.ts} +1 -1
  153. package/dist/next/client/error-DHbclCVh.d.mts +17 -0
  154. package/dist/next/client/error-DHbclCVh.d.ts +17 -0
  155. package/dist/next/client/hooks/useAutumn.d.mts +4 -4
  156. package/dist/next/client/hooks/useAutumn.d.ts +4 -4
  157. package/dist/next/client/hooks/useCustomer.d.mts +4 -4
  158. package/dist/next/client/hooks/useCustomer.d.ts +4 -4
  159. package/dist/next/client/hooks/useEntity.d.mts +5 -5
  160. package/dist/next/client/hooks/useEntity.d.ts +5 -5
  161. package/dist/next/client/hooks/usePricingTable.d.mts +2 -2
  162. package/dist/next/client/hooks/usePricingTable.d.ts +2 -2
  163. package/dist/next/client/types.d.mts +2 -2
  164. package/dist/next/client/types.d.ts +2 -2
  165. package/dist/next/index.d.mts +2 -111
  166. package/dist/next/index.d.ts +2 -111
  167. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  168. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  169. package/dist/next/server/componentActions.d.mts +1 -1
  170. package/dist/next/server/componentActions.d.ts +1 -1
  171. package/dist/next/server/cusActions.d.mts +1 -121
  172. package/dist/next/server/cusActions.d.ts +1 -121
  173. package/dist/next/server/cusTypes-ASrCF4fa.d.mts +244 -0
  174. package/dist/next/server/cusTypes-ASrCF4fa.d.ts +244 -0
  175. package/dist/next/server/genActions.d.mts +1 -1
  176. package/dist/next/server/genActions.d.ts +1 -1
  177. package/dist/sdk/index.d.mts +130 -130
  178. package/dist/sdk/index.d.ts +130 -130
  179. package/dist/styles/global.css +50 -3
  180. package/package.json +3 -2
  181. package/scripts/css-transform-plugin.js +28 -0
  182. package/scripts/post-build.js +65 -15
  183. package/scripts/sync-registry.ts +10 -0
  184. package/tsup.config.ts +6 -2
  185. package/tsup.dev.config.ts +6 -2
  186. package/dist/libraries/react/checkTypes-Bz2m_2pr.d.ts +0 -112
  187. package/dist/libraries/react/checkTypes-Cjk7BjiU.d.mts +0 -112
  188. package/dist/libraries/react/cusTypes-DNx5bwlw.d.mts +0 -116
  189. package/dist/libraries/react/cusTypes-DNx5bwlw.d.ts +0 -116
  190. package/dist/next/client/checkTypes-BVlLFoUT.d.ts +0 -128
  191. package/dist/next/client/checkTypes-CGZpuidI.d.mts +0 -128
  192. package/dist/next/client/cusTypes-CV5q3GIA.d.mts +0 -116
  193. package/dist/next/client/cusTypes-CV5q3GIA.d.ts +0 -116
  194. package/dist/next/server/cusTypes-Cc8NWXXF.d.mts +0 -124
  195. package/dist/next/server/cusTypes-Cc8NWXXF.d.ts +0 -124
  196. package/dist/libraries/react/{chunk-4CRZJJPY.mjs → chunk-KGHDNAQT.mjs} +17 -17
  197. package/dist/libraries/react/{chunk-27OTS3Q5.mjs → chunk-QJEJ7E65.mjs} +3 -3
@@ -1,10 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
- declare enum AppEnv {
4
- Sandbox = "sandbox",
5
- Live = "live"
6
- }
7
-
8
3
  declare const Infinite = "inf";
9
4
  declare enum FreeTrialDuration {
10
5
  Day = "day"
@@ -27,6 +22,119 @@ declare enum ProductItemInterval {
27
22
  }
28
23
  type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
29
24
 
25
+ type CheckFeatureScenario = "usage_limit" | "feature_flag";
26
+ interface CheckFeatureResult extends CoreCustomerFeature {
27
+ allowed: boolean;
28
+ feature_id: string;
29
+ customer_id: string;
30
+ entity_id?: string;
31
+ required_balance: number;
32
+ code: string;
33
+ preview?: CheckFeaturePreview;
34
+ }
35
+ interface CheckFeaturePreview {
36
+ scenario: CheckFeatureScenario;
37
+ title: string;
38
+ message: string;
39
+ feature_id: string;
40
+ feature_name: string;
41
+ products: Product[];
42
+ }
43
+ type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
44
+ interface CheckProductResult {
45
+ allowed: boolean;
46
+ customer_id: string;
47
+ product_id: string;
48
+ code: string;
49
+ status?: string;
50
+ preview?: CheckProductPreview;
51
+ }
52
+ interface CheckProductPreview {
53
+ scenario: ProductScenario;
54
+ product_id: string;
55
+ product_name: string;
56
+ recurring: boolean;
57
+ error_on_attach?: boolean;
58
+ next_cycle_at?: number;
59
+ current_product_name?: string;
60
+ items?: {
61
+ price: string;
62
+ description: string;
63
+ usage_model?: UsageModelType;
64
+ }[];
65
+ options?: {
66
+ feature_id: string;
67
+ feature_name: string;
68
+ billing_units: number;
69
+ price?: number;
70
+ tiers?: {
71
+ to: number | string;
72
+ amount: number;
73
+ }[];
74
+ }[];
75
+ due_today?: {
76
+ price: number;
77
+ currency: string;
78
+ };
79
+ due_next_cycle?: {
80
+ price: number;
81
+ currency: string;
82
+ };
83
+ }
84
+
85
+ declare enum AppEnv {
86
+ Sandbox = "sandbox",
87
+ Live = "live"
88
+ }
89
+
90
+ interface ProductItem {
91
+ feature_id?: string;
92
+ included_usage?: number | typeof Infinite;
93
+ interval?: ProductItemIntervalType;
94
+ usage_model?: UsageModel;
95
+ price?: number;
96
+ billing_units?: number;
97
+ entity_feature_id?: string;
98
+ reset_usage_when_enabled?: boolean;
99
+ display?: {
100
+ primary_text?: string;
101
+ secondary_text?: string;
102
+ };
103
+ }
104
+ interface FreeTrial {
105
+ duration: FreeTrialDuration;
106
+ length: number;
107
+ unique_fingerprint: boolean;
108
+ trial_available?: boolean;
109
+ }
110
+ interface Product {
111
+ id: string;
112
+ created_at: number;
113
+ name: string;
114
+ env: AppEnv;
115
+ is_add_on: boolean;
116
+ is_default: boolean;
117
+ group: string;
118
+ version: number;
119
+ items: ProductItem[];
120
+ free_trial: FreeTrial | null;
121
+ scenario?: ProductScenario;
122
+ base_variant_id: string | null;
123
+ properties?: {
124
+ is_free?: boolean;
125
+ is_one_off?: boolean;
126
+ interval_group?: string;
127
+ };
128
+ display?: {
129
+ name?: string;
130
+ description?: string;
131
+ button_text?: string;
132
+ recommend_text?: string;
133
+ everything_from?: string;
134
+ button_url?: string;
135
+ };
136
+ }
137
+
30
138
  declare enum ProductStatus {
31
139
  Active = "active",
32
140
  Expired = "expired",
@@ -34,7 +142,7 @@ declare enum ProductStatus {
34
142
  Scheduled = "scheduled",
35
143
  PastDue = "past_due"
36
144
  }
37
- type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities";
145
+ type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
38
146
 
39
147
  interface CoreCustomerFeature {
40
148
  unlimited?: boolean;
@@ -75,6 +183,7 @@ interface CustomerProduct {
75
183
  entity_id?: string;
76
184
  is_add_on: boolean;
77
185
  is_default: boolean;
186
+ items: ProductItem[];
78
187
  }
79
188
  interface Customer {
80
189
  id: string | null;
@@ -133,4 +242,4 @@ interface AutumnProviderProps {
133
242
  }
134
243
  declare const AutumnProvider: ({ customerId, customerData, authPlugin, children, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
135
244
 
136
- export { AppEnv as A, type BillingPortalResult as B, type CustomerProduct as C, FreeTrialDuration as F, Infinite as I, type ProductItemIntervalType as P, UsageModel as U, type CustomerFeature as a, type CustomerInvoice as b, type CoreCustomerFeature as c, type UsageModelType as d, type CustomerData as e, type CreateCustomerParams as f, type Customer as g, type CustomerExpandOption as h, AutumnProvider as i };
245
+ export { AutumnProvider as A, type BillingPortalResult as B, type CustomerProduct as C, type ProductItem as P, type CustomerFeature as a, type CustomerInvoice as b, type CustomerData as c, type CheckFeatureResult as d, type CheckProductResult as e, type ProductScenario as f, type CreateCustomerParams as g, type Customer as h, type Product as i, type CustomerExpandOption as j };
@@ -1,2 +1,2 @@
1
1
  import 'react/jsx-runtime';
2
- export { i as AutumnProvider } from './AutumnProvider-BdIwgk_j.mjs';
2
+ export { A as AutumnProvider } from './AutumnProvider-CGdXoZNQ.mjs';
@@ -1,2 +1,2 @@
1
1
  import 'react/jsx-runtime';
2
- export { i as AutumnProvider } from './AutumnProvider-BdIwgk_j.js';
2
+ export { A as AutumnProvider } from './AutumnProvider-CGdXoZNQ.js';
@@ -1,8 +1,8 @@
1
- import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, g as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-Dh9BiE0s.mjs';
2
- import { C as CustomerData, f as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-CV5q3GIA.mjs';
3
- import { E as Entity, D as DeleteEntityResult } from './entTypes-C1-bumir.mjs';
1
+ import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, g as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-KQqk1H9-.mjs';
2
+ import { f as ProductItem, g as ProductScenario, C as CustomerData, h as CreateCustomerParams, a as Customer, B as BillingPortalResult, P as Product } from './cusTypes-CSbB7Wu9.mjs';
3
+ import { E as Entity, D as DeleteEntityResult } from './entTypes-6xEkbn32.mjs';
4
4
  import { C as CreateReferralCodeParams, a as CreateReferralCodeResult, R as RedeemReferralCodeParams, b as RedeemReferralCodeResult } from './clientReferralTypes-C9JiOk2s.mjs';
5
- import { a as ProductItem, b as ProductScenario, A as AutumnError, P as Product } from './checkTypes-CGZpuidI.mjs';
5
+ import { A as AutumnError } from './error-DHbclCVh.mjs';
6
6
 
7
7
  interface PricingTableProduct {
8
8
  id: string;
@@ -1,8 +1,8 @@
1
- import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, g as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-CXkGuJ6W.js';
2
- import { C as CustomerData, f as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-CV5q3GIA.js';
3
- import { E as Entity, D as DeleteEntityResult } from './entTypes-CKc2qHBt.js';
1
+ import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, g as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-_eDeut4m.js';
2
+ import { f as ProductItem, g as ProductScenario, C as CustomerData, h as CreateCustomerParams, a as Customer, B as BillingPortalResult, P as Product } from './cusTypes-CSbB7Wu9.js';
3
+ import { E as Entity, D as DeleteEntityResult } from './entTypes-B3R2yjLW.js';
4
4
  import { C as CreateReferralCodeParams, a as CreateReferralCodeResult, R as RedeemReferralCodeParams, b as RedeemReferralCodeResult } from './clientReferralTypes-C9JiOk2s.js';
5
- import { a as ProductItem, b as ProductScenario, A as AutumnError, P as Product } from './checkTypes-BVlLFoUT.js';
5
+ import { A as AutumnError } from './error-DHbclCVh.js';
6
6
 
7
7
  interface PricingTableProduct {
8
8
  id: string;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CustomerData } from './cusTypes-CV5q3GIA.mjs';
2
+ import { C as CustomerData } from './cusTypes-CSbB7Wu9.mjs';
3
3
 
4
4
  declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children, }: {
5
5
  encryptedCustomerId?: string;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CustomerData } from './cusTypes-CV5q3GIA.js';
2
+ import { C as CustomerData } from './cusTypes-CSbB7Wu9.js';
3
3
 
4
4
  declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children, }: {
5
5
  encryptedCustomerId?: string;
@@ -1,5 +1,5 @@
1
- import { C as CustomerData } from './cusTypes-CV5q3GIA.js';
2
- import { C as CheckFeatureResult, c as CheckProductResult, A as AutumnError } from './checkTypes-BVlLFoUT.js';
1
+ import { C as CustomerData, i as CheckFeatureResult, j as CheckProductResult } from './cusTypes-CSbB7Wu9.mjs';
2
+ import { A as AutumnError } from './error-DHbclCVh.mjs';
3
3
 
4
4
  interface CancelResult {
5
5
  success: boolean;
@@ -1,5 +1,5 @@
1
- import { C as CustomerData } from './cusTypes-CV5q3GIA.mjs';
2
- import { C as CheckFeatureResult, c as CheckProductResult, A as AutumnError } from './checkTypes-CGZpuidI.mjs';
1
+ import { C as CustomerData, i as CheckFeatureResult, j as CheckProductResult } from './cusTypes-CSbB7Wu9.js';
2
+ import { A as AutumnError } from './error-DHbclCVh.js';
3
3
 
4
4
  interface CancelResult {
5
5
  success: boolean;
@@ -1,6 +1,6 @@
1
1
  import { AutumnClientError, PricingTableProduct } from './types.mjs';
2
- import './cusTypes-CV5q3GIA.mjs';
3
- import './entTypes-C1-bumir.mjs';
2
+ import './cusTypes-CSbB7Wu9.mjs';
3
+ import './entTypes-6xEkbn32.mjs';
4
4
 
5
5
  declare const toClientErrorResponse: (error: any) => {
6
6
  data: null;
@@ -1,6 +1,6 @@
1
1
  import { AutumnClientError, PricingTableProduct } from './types.js';
2
- import './cusTypes-CV5q3GIA.js';
3
- import './entTypes-CKc2qHBt.js';
2
+ import './cusTypes-CSbB7Wu9.js';
3
+ import './entTypes-B3R2yjLW.js';
4
4
 
5
5
  declare const toClientErrorResponse: (error: any) => {
6
6
  data: null;
@@ -0,0 +1,225 @@
1
+ declare const Infinite = "inf";
2
+ declare enum FreeTrialDuration {
3
+ Day = "day"
4
+ }
5
+ declare enum UsageModel {
6
+ Prepaid = "prepaid",
7
+ PayPerUse = "pay_per_use"
8
+ }
9
+ type UsageModelType = "prepaid" | "pay_per_use";
10
+ declare enum ProductItemInterval {
11
+ Minute = "minute",
12
+ Hour = "hour",
13
+ Day = "day",
14
+ Week = "week",
15
+ Month = "month",
16
+ Quarter = "quarter",
17
+ SemiAnnual = "semi_annual",
18
+ Year = "year",
19
+ Multiple = "multiple"
20
+ }
21
+ type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
22
+
23
+ type CheckFeatureScenario = "usage_limit" | "feature_flag";
24
+ interface CheckFeatureResult extends CoreCustomerFeature {
25
+ allowed: boolean;
26
+ feature_id: string;
27
+ customer_id: string;
28
+ entity_id?: string;
29
+ required_balance: number;
30
+ code: string;
31
+ preview?: CheckFeaturePreview;
32
+ }
33
+ interface CheckFeaturePreview {
34
+ scenario: CheckFeatureScenario;
35
+ title: string;
36
+ message: string;
37
+ feature_id: string;
38
+ feature_name: string;
39
+ products: Product[];
40
+ }
41
+ type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
42
+ interface CheckProductResult {
43
+ allowed: boolean;
44
+ customer_id: string;
45
+ product_id: string;
46
+ code: string;
47
+ status?: string;
48
+ preview?: CheckProductPreview;
49
+ }
50
+ interface CheckProductPreview {
51
+ scenario: ProductScenario;
52
+ product_id: string;
53
+ product_name: string;
54
+ recurring: boolean;
55
+ error_on_attach?: boolean;
56
+ next_cycle_at?: number;
57
+ current_product_name?: string;
58
+ items?: {
59
+ price: string;
60
+ description: string;
61
+ usage_model?: UsageModelType;
62
+ }[];
63
+ options?: {
64
+ feature_id: string;
65
+ feature_name: string;
66
+ billing_units: number;
67
+ price?: number;
68
+ tiers?: {
69
+ to: number | string;
70
+ amount: number;
71
+ }[];
72
+ }[];
73
+ due_today?: {
74
+ price: number;
75
+ currency: string;
76
+ };
77
+ due_next_cycle?: {
78
+ price: number;
79
+ currency: string;
80
+ };
81
+ }
82
+
83
+ declare enum AppEnv {
84
+ Sandbox = "sandbox",
85
+ Live = "live"
86
+ }
87
+
88
+ interface ProductItem {
89
+ feature_id?: string;
90
+ included_usage?: number | typeof Infinite;
91
+ interval?: ProductItemIntervalType;
92
+ usage_model?: UsageModel;
93
+ price?: number;
94
+ billing_units?: number;
95
+ entity_feature_id?: string;
96
+ reset_usage_when_enabled?: boolean;
97
+ display?: {
98
+ primary_text?: string;
99
+ secondary_text?: string;
100
+ };
101
+ }
102
+ interface FreeTrial {
103
+ duration: FreeTrialDuration;
104
+ length: number;
105
+ unique_fingerprint: boolean;
106
+ trial_available?: boolean;
107
+ }
108
+ interface Product {
109
+ id: string;
110
+ created_at: number;
111
+ name: string;
112
+ env: AppEnv;
113
+ is_add_on: boolean;
114
+ is_default: boolean;
115
+ group: string;
116
+ version: number;
117
+ items: ProductItem[];
118
+ free_trial: FreeTrial | null;
119
+ scenario?: ProductScenario;
120
+ base_variant_id: string | null;
121
+ properties?: {
122
+ is_free?: boolean;
123
+ is_one_off?: boolean;
124
+ interval_group?: string;
125
+ };
126
+ display?: {
127
+ name?: string;
128
+ description?: string;
129
+ button_text?: string;
130
+ recommend_text?: string;
131
+ everything_from?: string;
132
+ button_url?: string;
133
+ };
134
+ }
135
+
136
+ declare enum ProductStatus {
137
+ Active = "active",
138
+ Expired = "expired",
139
+ Trialing = "trialing",
140
+ Scheduled = "scheduled",
141
+ PastDue = "past_due"
142
+ }
143
+ type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
144
+
145
+ interface CoreCustomerFeature {
146
+ unlimited?: boolean;
147
+ interval?: ProductItemInterval | null;
148
+ balance?: number;
149
+ usage?: number;
150
+ included_usage?: number;
151
+ next_reset_at?: number | null;
152
+ overage_allowed?: boolean;
153
+ breakdown?: {
154
+ interval: ProductItemInterval;
155
+ balance?: number;
156
+ usage?: number;
157
+ included_usage?: number;
158
+ next_reset_at?: number;
159
+ }[];
160
+ credit_schema?: {
161
+ feature_id: string;
162
+ credit_amount: number;
163
+ }[];
164
+ }
165
+ interface CustomerFeature extends CoreCustomerFeature {
166
+ id: string;
167
+ name: string;
168
+ type: "static" | "single_use" | "continuous_use";
169
+ }
170
+ interface CustomerProduct {
171
+ id: string;
172
+ name: string | null;
173
+ group: string | null;
174
+ status: ProductStatus;
175
+ started_at: number;
176
+ canceled_at: number | null;
177
+ subscription_ids?: string[] | null;
178
+ current_period_start?: number | null;
179
+ current_period_end?: number | null;
180
+ trial_ends_at?: number;
181
+ entity_id?: string;
182
+ is_add_on: boolean;
183
+ is_default: boolean;
184
+ items: ProductItem[];
185
+ }
186
+ interface Customer {
187
+ id: string | null;
188
+ created_at: number;
189
+ name: string | null;
190
+ email: string | null;
191
+ fingerprint: string | null;
192
+ stripe_id: string | null;
193
+ env: AppEnv;
194
+ metadata: Record<string, any>;
195
+ products: CustomerProduct[];
196
+ features: Record<string, CustomerFeature>;
197
+ invoices?: CustomerInvoice[];
198
+ }
199
+ interface CustomerData {
200
+ name?: string;
201
+ email?: string;
202
+ fingerprint?: string;
203
+ }
204
+ interface CreateCustomerParams {
205
+ id?: string | null;
206
+ email?: string | null;
207
+ name?: string | null;
208
+ fingerprint?: string | null;
209
+ metadata?: Record<string, any>;
210
+ expand?: CustomerExpandOption[];
211
+ }
212
+ interface BillingPortalResult {
213
+ customer_id: string;
214
+ url: string;
215
+ }
216
+ interface CustomerInvoice {
217
+ product_ids: string[];
218
+ stripe_id: string;
219
+ status: string;
220
+ total: number;
221
+ currency: string;
222
+ created_at: number;
223
+ }
224
+
225
+ export type { BillingPortalResult as B, CustomerData as C, Product as P, Customer as a, CustomerExpandOption as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e, ProductItem as f, ProductScenario as g, CreateCustomerParams as h, CheckFeatureResult as i, CheckProductResult as j };
@@ -0,0 +1,225 @@
1
+ declare const Infinite = "inf";
2
+ declare enum FreeTrialDuration {
3
+ Day = "day"
4
+ }
5
+ declare enum UsageModel {
6
+ Prepaid = "prepaid",
7
+ PayPerUse = "pay_per_use"
8
+ }
9
+ type UsageModelType = "prepaid" | "pay_per_use";
10
+ declare enum ProductItemInterval {
11
+ Minute = "minute",
12
+ Hour = "hour",
13
+ Day = "day",
14
+ Week = "week",
15
+ Month = "month",
16
+ Quarter = "quarter",
17
+ SemiAnnual = "semi_annual",
18
+ Year = "year",
19
+ Multiple = "multiple"
20
+ }
21
+ type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
22
+
23
+ type CheckFeatureScenario = "usage_limit" | "feature_flag";
24
+ interface CheckFeatureResult extends CoreCustomerFeature {
25
+ allowed: boolean;
26
+ feature_id: string;
27
+ customer_id: string;
28
+ entity_id?: string;
29
+ required_balance: number;
30
+ code: string;
31
+ preview?: CheckFeaturePreview;
32
+ }
33
+ interface CheckFeaturePreview {
34
+ scenario: CheckFeatureScenario;
35
+ title: string;
36
+ message: string;
37
+ feature_id: string;
38
+ feature_name: string;
39
+ products: Product[];
40
+ }
41
+ type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
42
+ interface CheckProductResult {
43
+ allowed: boolean;
44
+ customer_id: string;
45
+ product_id: string;
46
+ code: string;
47
+ status?: string;
48
+ preview?: CheckProductPreview;
49
+ }
50
+ interface CheckProductPreview {
51
+ scenario: ProductScenario;
52
+ product_id: string;
53
+ product_name: string;
54
+ recurring: boolean;
55
+ error_on_attach?: boolean;
56
+ next_cycle_at?: number;
57
+ current_product_name?: string;
58
+ items?: {
59
+ price: string;
60
+ description: string;
61
+ usage_model?: UsageModelType;
62
+ }[];
63
+ options?: {
64
+ feature_id: string;
65
+ feature_name: string;
66
+ billing_units: number;
67
+ price?: number;
68
+ tiers?: {
69
+ to: number | string;
70
+ amount: number;
71
+ }[];
72
+ }[];
73
+ due_today?: {
74
+ price: number;
75
+ currency: string;
76
+ };
77
+ due_next_cycle?: {
78
+ price: number;
79
+ currency: string;
80
+ };
81
+ }
82
+
83
+ declare enum AppEnv {
84
+ Sandbox = "sandbox",
85
+ Live = "live"
86
+ }
87
+
88
+ interface ProductItem {
89
+ feature_id?: string;
90
+ included_usage?: number | typeof Infinite;
91
+ interval?: ProductItemIntervalType;
92
+ usage_model?: UsageModel;
93
+ price?: number;
94
+ billing_units?: number;
95
+ entity_feature_id?: string;
96
+ reset_usage_when_enabled?: boolean;
97
+ display?: {
98
+ primary_text?: string;
99
+ secondary_text?: string;
100
+ };
101
+ }
102
+ interface FreeTrial {
103
+ duration: FreeTrialDuration;
104
+ length: number;
105
+ unique_fingerprint: boolean;
106
+ trial_available?: boolean;
107
+ }
108
+ interface Product {
109
+ id: string;
110
+ created_at: number;
111
+ name: string;
112
+ env: AppEnv;
113
+ is_add_on: boolean;
114
+ is_default: boolean;
115
+ group: string;
116
+ version: number;
117
+ items: ProductItem[];
118
+ free_trial: FreeTrial | null;
119
+ scenario?: ProductScenario;
120
+ base_variant_id: string | null;
121
+ properties?: {
122
+ is_free?: boolean;
123
+ is_one_off?: boolean;
124
+ interval_group?: string;
125
+ };
126
+ display?: {
127
+ name?: string;
128
+ description?: string;
129
+ button_text?: string;
130
+ recommend_text?: string;
131
+ everything_from?: string;
132
+ button_url?: string;
133
+ };
134
+ }
135
+
136
+ declare enum ProductStatus {
137
+ Active = "active",
138
+ Expired = "expired",
139
+ Trialing = "trialing",
140
+ Scheduled = "scheduled",
141
+ PastDue = "past_due"
142
+ }
143
+ type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
144
+
145
+ interface CoreCustomerFeature {
146
+ unlimited?: boolean;
147
+ interval?: ProductItemInterval | null;
148
+ balance?: number;
149
+ usage?: number;
150
+ included_usage?: number;
151
+ next_reset_at?: number | null;
152
+ overage_allowed?: boolean;
153
+ breakdown?: {
154
+ interval: ProductItemInterval;
155
+ balance?: number;
156
+ usage?: number;
157
+ included_usage?: number;
158
+ next_reset_at?: number;
159
+ }[];
160
+ credit_schema?: {
161
+ feature_id: string;
162
+ credit_amount: number;
163
+ }[];
164
+ }
165
+ interface CustomerFeature extends CoreCustomerFeature {
166
+ id: string;
167
+ name: string;
168
+ type: "static" | "single_use" | "continuous_use";
169
+ }
170
+ interface CustomerProduct {
171
+ id: string;
172
+ name: string | null;
173
+ group: string | null;
174
+ status: ProductStatus;
175
+ started_at: number;
176
+ canceled_at: number | null;
177
+ subscription_ids?: string[] | null;
178
+ current_period_start?: number | null;
179
+ current_period_end?: number | null;
180
+ trial_ends_at?: number;
181
+ entity_id?: string;
182
+ is_add_on: boolean;
183
+ is_default: boolean;
184
+ items: ProductItem[];
185
+ }
186
+ interface Customer {
187
+ id: string | null;
188
+ created_at: number;
189
+ name: string | null;
190
+ email: string | null;
191
+ fingerprint: string | null;
192
+ stripe_id: string | null;
193
+ env: AppEnv;
194
+ metadata: Record<string, any>;
195
+ products: CustomerProduct[];
196
+ features: Record<string, CustomerFeature>;
197
+ invoices?: CustomerInvoice[];
198
+ }
199
+ interface CustomerData {
200
+ name?: string;
201
+ email?: string;
202
+ fingerprint?: string;
203
+ }
204
+ interface CreateCustomerParams {
205
+ id?: string | null;
206
+ email?: string | null;
207
+ name?: string | null;
208
+ fingerprint?: string | null;
209
+ metadata?: Record<string, any>;
210
+ expand?: CustomerExpandOption[];
211
+ }
212
+ interface BillingPortalResult {
213
+ customer_id: string;
214
+ url: string;
215
+ }
216
+ interface CustomerInvoice {
217
+ product_ids: string[];
218
+ stripe_id: string;
219
+ status: string;
220
+ total: number;
221
+ currency: string;
222
+ created_at: number;
223
+ }
224
+
225
+ export type { BillingPortalResult as B, CustomerData as C, Product as P, Customer as a, CustomerExpandOption as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e, ProductItem as f, ProductScenario as g, CreateCustomerParams as h, CheckFeatureResult as i, CheckProductResult as j };