autumn-js 0.1.5 → 0.1.7

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 (232) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +6 -46
  2. package/dist/libraries/backend/better-auth.d.ts +6 -46
  3. package/dist/libraries/backend/better-auth.js +43 -13
  4. package/dist/libraries/backend/better-auth.mjs +23 -21
  5. package/dist/libraries/backend/{chunk-NTPYEOME.mjs → chunk-33ET4N4V.mjs} +1 -1
  6. package/dist/libraries/backend/{chunk-2LSEWYPD.mjs → chunk-3OVRYTZX.mjs} +6 -6
  7. package/dist/libraries/backend/{chunk-TTNUEXHB.mjs → chunk-AREWK25J.mjs} +28 -0
  8. package/dist/libraries/backend/{chunk-WBYCMG34.mjs → chunk-GO7TVFSN.mjs} +1 -1
  9. package/dist/libraries/backend/{chunk-7Z2OYXN4.mjs → chunk-LL53FE2Z.mjs} +1 -1
  10. package/dist/libraries/backend/{chunk-Y63QWBQ6.mjs → chunk-TFYLV3GN.mjs} +1 -1
  11. package/dist/libraries/backend/{chunk-QVLMREDB.mjs → chunk-VBHBF3GP.mjs} +1 -1
  12. package/dist/libraries/backend/convex.js +28 -0
  13. package/dist/libraries/backend/convex.mjs +7 -7
  14. package/dist/libraries/backend/elysia.js +28 -0
  15. package/dist/libraries/backend/elysia.mjs +7 -7
  16. package/dist/libraries/backend/express.d.mts +1 -1
  17. package/dist/libraries/backend/express.d.ts +1 -1
  18. package/dist/libraries/backend/express.js +28 -0
  19. package/dist/libraries/backend/express.mjs +7 -7
  20. package/dist/libraries/backend/fastify.js +28 -0
  21. package/dist/libraries/backend/fastify.mjs +7 -7
  22. package/dist/libraries/backend/hono.js +28 -0
  23. package/dist/libraries/backend/hono.mjs +7 -7
  24. package/dist/libraries/backend/index.d.mts +1 -1
  25. package/dist/libraries/backend/index.d.ts +1 -1
  26. package/dist/libraries/backend/index.js +28 -0
  27. package/dist/libraries/backend/index.mjs +7 -7
  28. package/dist/libraries/backend/next.js +28 -0
  29. package/dist/libraries/backend/next.mjs +7 -7
  30. package/dist/libraries/backend/react-router.js +28 -0
  31. package/dist/libraries/backend/react-router.mjs +7 -7
  32. package/dist/libraries/backend/{referralTypes-BfrNJ62q.d.mts → referralTypes-B50JL4PY.d.mts} +69 -2
  33. package/dist/libraries/backend/{referralTypes-Djyi4iGt.d.ts → referralTypes-dW2HaxKV.d.ts} +69 -2
  34. package/dist/libraries/backend/remix_dep.js +28 -0
  35. package/dist/libraries/backend/remix_dep.mjs +7 -7
  36. package/dist/libraries/backend/routes/backendRouter.js +28 -0
  37. package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
  38. package/dist/libraries/backend/routes/entityRoutes.js +28 -0
  39. package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
  40. package/dist/libraries/backend/routes/genRoutes.js +28 -0
  41. package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
  42. package/dist/libraries/backend/routes/productRoutes.js +28 -0
  43. package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
  44. package/dist/libraries/backend/routes/referralRoutes.js +28 -0
  45. package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
  46. package/dist/libraries/backend/supabase.js +28 -0
  47. package/dist/libraries/backend/supabase.mjs +7 -7
  48. package/dist/libraries/backend/tanstack.js +28 -0
  49. package/dist/libraries/backend/tanstack.mjs +7 -7
  50. package/dist/libraries/backend/utils/backendRes.js +28 -0
  51. package/dist/libraries/backend/utils/backendRes.mjs +1 -1
  52. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  53. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  54. package/dist/libraries/backend/utils/withAuth.js +28 -0
  55. package/dist/libraries/backend/utils/withAuth.mjs +2 -2
  56. package/dist/libraries/react/AutumnContext.d.mts +6 -6
  57. package/dist/libraries/react/AutumnContext.d.ts +6 -6
  58. package/dist/libraries/react/AutumnContext.js +35 -1
  59. package/dist/libraries/react/AutumnContext.mjs +5 -5
  60. package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
  61. package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
  62. package/dist/libraries/react/BaseAutumnProvider.js +35 -1
  63. package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
  64. package/dist/libraries/react/{ReactAutumnClient-DM5ZRTfX.d.ts → ReactAutumnClient-BUq9E84_.d.ts} +8 -6
  65. package/dist/libraries/react/{ReactAutumnClient-BHjd9Tw5.d.mts → ReactAutumnClient-CpAGyyur.d.mts} +8 -6
  66. package/dist/libraries/react/ReactAutumnProvider.d.mts +4 -3
  67. package/dist/libraries/react/ReactAutumnProvider.d.ts +4 -3
  68. package/dist/libraries/react/ReactAutumnProvider.js +39 -3
  69. package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
  70. package/dist/libraries/react/{attachTypes-Bz1_JTvk.d.ts → attachTypes-CcB6xjSF.d.ts} +1 -1
  71. package/dist/{next/client/attachTypes-9VCTaz0m.d.mts → libraries/react/attachTypes-DqUN3q8s.d.mts} +5 -5
  72. package/dist/libraries/react/{chunk-KZVVSY52.mjs → chunk-56PEGK2Z.mjs} +2 -2
  73. package/dist/libraries/react/{chunk-ZT5TN67S.mjs → chunk-ECOBNPRU.mjs} +7 -5
  74. package/dist/libraries/react/{chunk-5K2M3CQZ.mjs → chunk-FEISQQNM.mjs} +1 -1
  75. package/dist/libraries/react/{chunk-BXMZYHE7.mjs → chunk-FJWZPMWU.mjs} +3 -3
  76. package/dist/libraries/react/{chunk-PGU4IXT7.mjs → chunk-FMRBH4CP.mjs} +1 -1
  77. package/dist/libraries/react/{chunk-KLSRAX2F.mjs → chunk-GWVZB5GK.mjs} +3 -3
  78. package/dist/libraries/react/{chunk-QV6Q2XXO.mjs → chunk-HIC6P67K.mjs} +14 -8
  79. package/dist/libraries/react/{chunk-33OTK7MB.mjs → chunk-HMZZIUCF.mjs} +1 -1
  80. package/dist/libraries/react/{chunk-WT5K3J2K.mjs → chunk-I2A7PK2L.mjs} +17 -17
  81. package/dist/libraries/react/{chunk-TJMYXANS.mjs → chunk-JFTZRU2U.mjs} +1 -1
  82. package/dist/libraries/react/{chunk-YCDNQZT5.mjs → chunk-JGDTNJTR.mjs} +2 -2
  83. package/dist/libraries/react/{chunk-7AJBRRXV.mjs → chunk-JNR7QAPG.mjs} +1 -1
  84. package/dist/libraries/react/{chunk-M7SUFZ42.mjs → chunk-KUS3X33V.mjs} +1 -1
  85. package/dist/libraries/react/{chunk-EXK6MS5M.mjs → chunk-KYZ3DYMI.mjs} +454 -456
  86. package/dist/libraries/react/{chunk-W5XUD2S6.mjs → chunk-MW2FSYG3.mjs} +1 -1
  87. package/dist/libraries/react/{chunk-2TQBFCWM.mjs → chunk-OTZ65PCT.mjs} +4 -4
  88. package/dist/libraries/react/{chunk-IM2FNHYV.mjs → chunk-QQKJE2ND.mjs} +2 -2
  89. package/dist/libraries/react/{chunk-GUDRYJ3O.mjs → chunk-SFGXTDMX.mjs} +2 -2
  90. package/dist/libraries/react/{chunk-QW2YS3JY.mjs → chunk-SZJOMZTC.mjs} +2 -2
  91. package/dist/libraries/react/{chunk-F5QUME7S.mjs → chunk-ULIUD6YP.mjs} +3 -3
  92. package/dist/libraries/react/{chunk-EK2RMWXP.mjs → chunk-WQXUZO6K.mjs} +28 -0
  93. package/dist/libraries/react/{chunk-NHDZWWMZ.mjs → chunk-YWQTQ72B.mjs} +2 -2
  94. package/dist/libraries/react/{chunk-SFDHYUHA.mjs → chunk-ZJBEC254.mjs} +1 -1
  95. package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
  96. package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
  97. package/dist/libraries/react/client/ReactAutumnClient.js +35 -1
  98. package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
  99. package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
  100. package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
  101. package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
  102. package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
  103. package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
  104. package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
  105. package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
  106. package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
  107. package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
  108. package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
  109. package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
  110. package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
  111. package/dist/libraries/react/client/types/clientGenTypes.js +28 -0
  112. package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
  113. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
  114. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
  115. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +35 -1
  116. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +29 -29
  117. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
  118. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
  119. package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
  120. package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
  121. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +35 -1
  122. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +29 -29
  123. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
  124. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
  125. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  126. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  127. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +35 -1
  128. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +29 -29
  129. package/dist/libraries/react/components/ui/accordion.mjs +3 -3
  130. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  131. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  132. package/dist/libraries/react/components/ui/dialog.mjs +4 -4
  133. package/dist/libraries/react/components/ui/popover.mjs +5 -5
  134. package/dist/libraries/react/components/ui/switch.mjs +3 -3
  135. package/dist/libraries/react/{cusTypes-DT-gAUL9.d.mts → cusTypes-CSmAk5io.d.mts} +1 -1
  136. package/dist/libraries/react/{cusTypes-yJ0fSxbq.d.ts → cusTypes-DHjT-9rV.d.ts} +1 -1
  137. package/dist/libraries/react/{entTypes-BPdjCunj.d.ts → entTypes-CoF9enrR.d.ts} +1 -1
  138. package/dist/libraries/react/{entTypes-D79XPrxo.d.mts → entTypes-S4hkh1RG.d.mts} +1 -1
  139. package/dist/libraries/react/{genTypes-DJUAkD36.d.ts → genTypes-DsiuvyWS.d.ts} +1 -1
  140. package/dist/libraries/react/{genTypes-BV-Jc6Q1.d.mts → genTypes-fEH_nqSm.d.mts} +1 -1
  141. package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
  142. package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
  143. package/dist/libraries/react/hooks/helpers/handleCheck.js +28 -0
  144. package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
  145. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -6
  146. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -6
  147. package/dist/libraries/react/hooks/helpers/useAutumnBase.js +28 -0
  148. package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
  149. package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
  150. package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
  151. package/dist/libraries/react/hooks/useAnalytics.js +35 -1
  152. package/dist/libraries/react/hooks/useAnalytics.mjs +6 -6
  153. package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
  154. package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
  155. package/dist/libraries/react/hooks/useCustomer.js +35 -1
  156. package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
  157. package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
  158. package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
  159. package/dist/libraries/react/hooks/useCustomerBase.js +35 -1
  160. package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
  161. package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
  162. package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
  163. package/dist/libraries/react/hooks/useEntity.js +35 -1
  164. package/dist/libraries/react/hooks/useEntity.mjs +10 -10
  165. package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
  166. package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
  167. package/dist/libraries/react/hooks/useEntityBase.js +35 -1
  168. package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
  169. package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
  170. package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
  171. package/dist/libraries/react/hooks/usePaywall.js +35 -1
  172. package/dist/libraries/react/hooks/usePaywall.mjs +6 -6
  173. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  174. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  175. package/dist/libraries/react/hooks/usePricingTable.js +35 -1
  176. package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
  177. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
  178. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
  179. package/dist/libraries/react/hooks/usePricingTableBase.js +28 -0
  180. package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
  181. package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
  182. package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
  183. package/dist/libraries/react/index.d.mts +2 -1
  184. package/dist/libraries/react/index.d.ts +2 -1
  185. package/dist/libraries/react/index.js +39 -3
  186. package/dist/libraries/react/index.mjs +39 -3
  187. package/dist/libraries/react/{prodTypes-2tlu9Pyz.d.mts → prodTypes--VvnyGlN.d.mts} +1 -1
  188. package/dist/libraries/react/{prodTypes-2tlu9Pyz.d.ts → prodTypes--VvnyGlN.d.ts} +1 -1
  189. package/dist/next/client/NextAutumnClient.d.mts +21 -19
  190. package/dist/next/client/NextAutumnClient.d.ts +21 -19
  191. package/dist/next/client/NextAutumnProvider.d.mts +2 -2
  192. package/dist/next/client/NextAutumnProvider.d.ts +2 -2
  193. package/dist/next/client/{attachTypes-DLxEa_Wj.d.ts → attachTypes-DKlQexnQ.d.ts} +5 -5
  194. package/dist/{libraries/react/attachTypes-C9FJTCo6.d.mts → next/client/attachTypes-EvdK0fPK.d.mts} +5 -5
  195. package/dist/next/client/{clientAttachTypes-umadXlvp.d.ts → clientAttachTypes-CGPjsdPk.d.ts} +27 -27
  196. package/dist/next/client/{clientAttachTypes-BzsPgggN.d.mts → clientAttachTypes-CZFjz8Rq.d.mts} +27 -27
  197. package/dist/next/client/clientUtils.d.mts +3 -3
  198. package/dist/next/client/clientUtils.d.ts +3 -3
  199. package/dist/next/client/{cusTypes-CYojUJSJ.d.ts → cusTypes-DEURYNg4.d.ts} +5 -5
  200. package/dist/next/client/{cusTypes-CIGvysWL.d.mts → cusTypes-y5wEmx07.d.mts} +5 -5
  201. package/dist/next/client/{entTypes-BAD1NMvb.d.ts → entTypes-CRFgWhOr.d.ts} +1 -1
  202. package/dist/next/client/{entTypes-mOI7WnPZ.d.mts → entTypes-KRxjcMFv.d.mts} +1 -1
  203. package/dist/next/client/hooks/useAutumn.d.mts +5 -5
  204. package/dist/next/client/hooks/useAutumn.d.ts +5 -5
  205. package/dist/next/client/hooks/useCustomer.d.mts +5 -5
  206. package/dist/next/client/hooks/useCustomer.d.ts +5 -5
  207. package/dist/next/client/hooks/useEntity.d.mts +7 -7
  208. package/dist/next/client/hooks/useEntity.d.ts +7 -7
  209. package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
  210. package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
  211. package/dist/next/client/types.d.mts +3 -3
  212. package/dist/next/client/types.d.ts +3 -3
  213. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  214. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  215. package/dist/next/server/componentActions.d.mts +1 -1
  216. package/dist/next/server/componentActions.d.ts +1 -1
  217. package/dist/next/server/cusActions.d.mts +84 -17
  218. package/dist/next/server/cusActions.d.ts +84 -17
  219. package/dist/next/server/genActions.d.mts +1 -1
  220. package/dist/next/server/genActions.d.ts +1 -1
  221. package/dist/sdk/index.d.mts +70 -3
  222. package/dist/sdk/index.d.ts +70 -3
  223. package/dist/sdk/index.js +28 -0
  224. package/dist/sdk/index.mjs +28 -0
  225. package/dist/utils/encryptUtils.js +28 -0
  226. package/dist/utils/encryptUtils.mjs +28 -0
  227. package/package.json +1 -1
  228. package/dist/libraries/react/{chunk-KWNH6C27.mjs → chunk-7TYAAD2T.mjs} +11 -11
  229. package/dist/next/client/{prodTypes-CxvB1YY3.d.mts → prodTypes-DzTLP57C.d.mts} +8 -8
  230. package/dist/next/client/{prodTypes-CxvB1YY3.d.ts → prodTypes-DzTLP57C.d.ts} +8 -8
  231. package/dist/next/server/{cusTypes-DgoOZMIt.d.ts → cusTypes-CwopPHB0.d.mts} +8 -8
  232. package/dist/next/server/{cusTypes-DgoOZMIt.d.mts → cusTypes-CwopPHB0.d.ts} +8 -8
@@ -10,6 +10,7 @@ declare const autumn: (options?: {
10
10
  createCustomer: {
11
11
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
12
12
  body: {
13
+ errorOnNotFound?: boolean | undefined;
13
14
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
14
15
  };
15
16
  } & {
@@ -36,34 +37,15 @@ declare const autumn: (options?: {
36
37
  } : any>;
37
38
  options: {
38
39
  method: "POST";
39
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
40
- session: {
41
- session: Record<string, any> & {
42
- id: string;
43
- token: string;
44
- userId: string;
45
- expiresAt: Date;
46
- createdAt: Date;
47
- updatedAt: Date;
48
- ipAddress?: string | null | undefined;
49
- userAgent?: string | null | undefined;
50
- };
51
- user: Record<string, any> & {
52
- id: string;
53
- name: string;
54
- emailVerified: boolean;
55
- email: string;
56
- createdAt: Date;
57
- updatedAt: Date;
58
- image?: string | null | undefined;
59
- };
60
- };
61
- }>)[];
40
+ use: never[];
62
41
  body: z.ZodObject<{
42
+ errorOnNotFound: z.ZodOptional<z.ZodBoolean>;
63
43
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
64
44
  }, "strip", z.ZodTypeAny, {
45
+ errorOnNotFound?: boolean | undefined;
65
46
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
66
47
  }, {
48
+ errorOnNotFound?: boolean | undefined;
67
49
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
68
50
  }>;
69
51
  metadata: {
@@ -99,29 +81,7 @@ declare const autumn: (options?: {
99
81
  } : any>;
100
82
  options: {
101
83
  method: "GET";
102
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
103
- session: {
104
- session: Record<string, any> & {
105
- id: string;
106
- token: string;
107
- userId: string;
108
- expiresAt: Date;
109
- createdAt: Date;
110
- updatedAt: Date;
111
- ipAddress?: string | null | undefined;
112
- userAgent?: string | null | undefined;
113
- };
114
- user: Record<string, any> & {
115
- id: string;
116
- name: string;
117
- emailVerified: boolean;
118
- email: string;
119
- createdAt: Date;
120
- updatedAt: Date;
121
- image?: string | null | undefined;
122
- };
123
- };
124
- }>)[];
84
+ use: never[];
125
85
  } & {
126
86
  use: any[];
127
87
  };
@@ -10,6 +10,7 @@ declare const autumn: (options?: {
10
10
  createCustomer: {
11
11
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
12
12
  body: {
13
+ errorOnNotFound?: boolean | undefined;
13
14
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
14
15
  };
15
16
  } & {
@@ -36,34 +37,15 @@ declare const autumn: (options?: {
36
37
  } : any>;
37
38
  options: {
38
39
  method: "POST";
39
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
40
- session: {
41
- session: Record<string, any> & {
42
- id: string;
43
- token: string;
44
- userId: string;
45
- expiresAt: Date;
46
- createdAt: Date;
47
- updatedAt: Date;
48
- ipAddress?: string | null | undefined;
49
- userAgent?: string | null | undefined;
50
- };
51
- user: Record<string, any> & {
52
- id: string;
53
- name: string;
54
- emailVerified: boolean;
55
- email: string;
56
- createdAt: Date;
57
- updatedAt: Date;
58
- image?: string | null | undefined;
59
- };
60
- };
61
- }>)[];
40
+ use: never[];
62
41
  body: z.ZodObject<{
42
+ errorOnNotFound: z.ZodOptional<z.ZodBoolean>;
63
43
  expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
64
44
  }, "strip", z.ZodTypeAny, {
45
+ errorOnNotFound?: boolean | undefined;
65
46
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
66
47
  }, {
48
+ errorOnNotFound?: boolean | undefined;
67
49
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
68
50
  }>;
69
51
  metadata: {
@@ -99,29 +81,7 @@ declare const autumn: (options?: {
99
81
  } : any>;
100
82
  options: {
101
83
  method: "GET";
102
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
103
- session: {
104
- session: Record<string, any> & {
105
- id: string;
106
- token: string;
107
- userId: string;
108
- expiresAt: Date;
109
- createdAt: Date;
110
- updatedAt: Date;
111
- ipAddress?: string | null | undefined;
112
- userAgent?: string | null | undefined;
113
- };
114
- user: Record<string, any> & {
115
- id: string;
116
- name: string;
117
- emailVerified: boolean;
118
- email: string;
119
- createdAt: Date;
120
- updatedAt: Date;
121
- image?: string | null | undefined;
122
- };
123
- };
124
- }>)[];
84
+ use: never[];
125
85
  } & {
126
86
  use: any[];
127
87
  };
@@ -387,6 +387,32 @@ var logger = {
387
387
  }
388
388
  };
389
389
 
390
+ // src/sdk/features/featureMethods.ts
391
+ var featureMethods = (instance) => {
392
+ return {
393
+ list: () => staticWrapper(listFeatures, instance, {})
394
+ };
395
+ };
396
+ var listFeatures = async ({
397
+ instance,
398
+ params
399
+ }) => {
400
+ let path = "/features";
401
+ if (params) {
402
+ const queryParams = new URLSearchParams();
403
+ for (const [key, value] of Object.entries(params)) {
404
+ if (value !== void 0) {
405
+ queryParams.append(key, String(value));
406
+ }
407
+ }
408
+ const queryString = queryParams.toString();
409
+ if (queryString) {
410
+ path += `?${queryString}`;
411
+ }
412
+ }
413
+ return instance.get(path);
414
+ };
415
+
390
416
  // src/sdk/client.ts
391
417
  var LATEST_API_VERSION = "1.2";
392
418
  var Autumn = class {
@@ -444,10 +470,12 @@ var Autumn = class {
444
470
  static products = productMethods();
445
471
  static entities = entityMethods();
446
472
  static referrals = referralMethods();
473
+ static features = featureMethods();
447
474
  customers = customerMethods(this);
448
475
  products = productMethods(this);
449
476
  entities = entityMethods(this);
450
477
  referrals = referralMethods(this);
478
+ features = featureMethods(this);
451
479
  static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
452
480
  async checkout(params) {
453
481
  return handleCheckout({
@@ -1184,7 +1212,7 @@ var router = createRouterWithOptions();
1184
1212
  var betterAuthPathMap = {
1185
1213
  // "create-customer": "customers",
1186
1214
  // "customers/get": "customers",
1187
- "checkout": "checkout",
1215
+ checkout: "checkout",
1188
1216
  attach: "attach",
1189
1217
  check: "check",
1190
1218
  track: "track",
@@ -1197,7 +1225,8 @@ var betterAuthPathMap = {
1197
1225
  var handleReq = async ({
1198
1226
  ctx,
1199
1227
  options,
1200
- method
1228
+ method,
1229
+ session
1201
1230
  }) => {
1202
1231
  let { found, error: resError } = secretKeyCheck();
1203
1232
  if (!found && !options?.secretKey) {
@@ -1226,16 +1255,16 @@ var handleReq = async ({
1226
1255
  const { data, params: pathParams } = match;
1227
1256
  const { handler } = data;
1228
1257
  const body = ctx.body;
1229
- const session = ctx.context.session;
1258
+ const finalSession = session || ctx.context.session;
1230
1259
  const identify = async () => {
1231
- if (!session) {
1260
+ if (!finalSession) {
1232
1261
  return;
1233
1262
  }
1234
1263
  return {
1235
- customerId: session.user.id,
1264
+ customerId: finalSession.user.id,
1236
1265
  customerData: {
1237
- email: session.user.email,
1238
- name: session.user.name
1266
+ email: finalSession.user.email,
1267
+ name: finalSession.user.name
1239
1268
  }
1240
1269
  };
1241
1270
  };
@@ -1256,8 +1285,6 @@ var handleReq = async ({
1256
1285
  return ctx.json(result.body, { status: result.statusCode });
1257
1286
  };
1258
1287
  var autumn = (options) => {
1259
- let secretKey = options?.secretKey;
1260
- let url = options?.url;
1261
1288
  return {
1262
1289
  id: "autumn",
1263
1290
  endpoints: {
@@ -1265,8 +1292,9 @@ var autumn = (options) => {
1265
1292
  "/autumn/customers",
1266
1293
  {
1267
1294
  method: "POST",
1268
- use: [import_api.sessionMiddleware],
1295
+ use: [],
1269
1296
  body: import_zod8.z.object({
1297
+ errorOnNotFound: import_zod8.z.boolean().optional(),
1270
1298
  expand: import_zod8.z.array(CustomerExpandEnum).optional()
1271
1299
  }),
1272
1300
  metadata: {
@@ -1274,17 +1302,19 @@ var autumn = (options) => {
1274
1302
  }
1275
1303
  },
1276
1304
  async (ctx) => {
1277
- return await handleReq({ ctx, options, method: "POST" });
1305
+ const session = await (0, import_api.getSessionFromCtx)(ctx);
1306
+ return await handleReq({ ctx, options, method: "POST", session });
1278
1307
  }
1279
1308
  ),
1280
1309
  listProducts: (0, import_plugins.createAuthEndpoint)(
1281
1310
  "/autumn/products",
1282
1311
  {
1283
1312
  method: "GET",
1284
- use: [import_api.sessionMiddleware]
1313
+ use: []
1285
1314
  },
1286
1315
  async (ctx) => {
1287
- return await handleReq({ ctx, options, method: "GET" });
1316
+ const session = await (0, import_api.getSessionFromCtx)(ctx);
1317
+ return await handleReq({ ctx, options, method: "GET", session });
1288
1318
  }
1289
1319
  ),
1290
1320
  checkout: (0, import_plugins.createAuthEndpoint)(
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-UNZHJTEY.mjs";
4
4
  import {
5
5
  createRouterWithOptions
6
- } from "./chunk-2LSEWYPD.mjs";
7
- import "./chunk-QVLMREDB.mjs";
8
- import "./chunk-WBYCMG34.mjs";
9
- import "./chunk-Y63QWBQ6.mjs";
10
- import "./chunk-7Z2OYXN4.mjs";
11
- import "./chunk-NTPYEOME.mjs";
6
+ } from "./chunk-3OVRYTZX.mjs";
7
+ import "./chunk-VBHBF3GP.mjs";
8
+ import "./chunk-GO7TVFSN.mjs";
9
+ import "./chunk-TFYLV3GN.mjs";
10
+ import "./chunk-LL53FE2Z.mjs";
11
+ import "./chunk-33ET4N4V.mjs";
12
12
  import {
13
13
  AttachParamsSchema,
14
14
  Autumn,
@@ -20,7 +20,7 @@ import {
20
20
  CustomerExpandEnum,
21
21
  RedeemReferralCodeParamsSchema,
22
22
  TrackParamsSchema
23
- } from "./chunk-TTNUEXHB.mjs";
23
+ } from "./chunk-AREWK25J.mjs";
24
24
  import "./chunk-2TEL6LR5.mjs";
25
25
  import "./chunk-KSG3E4Q2.mjs";
26
26
 
@@ -28,13 +28,13 @@ import "./chunk-KSG3E4Q2.mjs";
28
28
  import { createAuthEndpoint } from "better-auth/plugins";
29
29
  import { APIError, createEndpoint } from "better-call";
30
30
  import { findRoute } from "rou3";
31
- import { sessionMiddleware } from "better-auth/api";
31
+ import { getSessionFromCtx, sessionMiddleware } from "better-auth/api";
32
32
  import { z } from "zod";
33
33
  var router = createRouterWithOptions();
34
34
  var betterAuthPathMap = {
35
35
  // "create-customer": "customers",
36
36
  // "customers/get": "customers",
37
- "checkout": "checkout",
37
+ checkout: "checkout",
38
38
  attach: "attach",
39
39
  check: "check",
40
40
  track: "track",
@@ -47,7 +47,8 @@ var betterAuthPathMap = {
47
47
  var handleReq = async ({
48
48
  ctx,
49
49
  options,
50
- method
50
+ method,
51
+ session
51
52
  }) => {
52
53
  let { found, error: resError } = secretKeyCheck();
53
54
  if (!found && !options?.secretKey) {
@@ -76,16 +77,16 @@ var handleReq = async ({
76
77
  const { data, params: pathParams } = match;
77
78
  const { handler } = data;
78
79
  const body = ctx.body;
79
- const session = ctx.context.session;
80
+ const finalSession = session || ctx.context.session;
80
81
  const identify = async () => {
81
- if (!session) {
82
+ if (!finalSession) {
82
83
  return;
83
84
  }
84
85
  return {
85
- customerId: session.user.id,
86
+ customerId: finalSession.user.id,
86
87
  customerData: {
87
- email: session.user.email,
88
- name: session.user.name
88
+ email: finalSession.user.email,
89
+ name: finalSession.user.name
89
90
  }
90
91
  };
91
92
  };
@@ -106,8 +107,6 @@ var handleReq = async ({
106
107
  return ctx.json(result.body, { status: result.statusCode });
107
108
  };
108
109
  var autumn = (options) => {
109
- let secretKey = options?.secretKey;
110
- let url = options?.url;
111
110
  return {
112
111
  id: "autumn",
113
112
  endpoints: {
@@ -115,8 +114,9 @@ var autumn = (options) => {
115
114
  "/autumn/customers",
116
115
  {
117
116
  method: "POST",
118
- use: [sessionMiddleware],
117
+ use: [],
119
118
  body: z.object({
119
+ errorOnNotFound: z.boolean().optional(),
120
120
  expand: z.array(CustomerExpandEnum).optional()
121
121
  }),
122
122
  metadata: {
@@ -124,17 +124,19 @@ var autumn = (options) => {
124
124
  }
125
125
  },
126
126
  async (ctx) => {
127
- return await handleReq({ ctx, options, method: "POST" });
127
+ const session = await getSessionFromCtx(ctx);
128
+ return await handleReq({ ctx, options, method: "POST", session });
128
129
  }
129
130
  ),
130
131
  listProducts: createAuthEndpoint(
131
132
  "/autumn/products",
132
133
  {
133
134
  method: "GET",
134
- use: [sessionMiddleware]
135
+ use: []
135
136
  },
136
137
  async (ctx) => {
137
- return await handleReq({ ctx, options, method: "GET" });
138
+ const session = await getSessionFromCtx(ctx);
139
+ return await handleReq({ ctx, options, method: "GET", session });
138
140
  }
139
141
  ),
140
142
  checkout: createAuthEndpoint(
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  toBackendError,
3
3
  toBackendRes
4
- } from "./chunk-TTNUEXHB.mjs";
4
+ } from "./chunk-AREWK25J.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-2TEL6LR5.mjs";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  addGenRoutes
3
- } from "./chunk-QVLMREDB.mjs";
3
+ } from "./chunk-VBHBF3GP.mjs";
4
4
  import {
5
5
  addProductRoutes
6
- } from "./chunk-WBYCMG34.mjs";
6
+ } from "./chunk-GO7TVFSN.mjs";
7
7
  import {
8
8
  addReferralRoutes
9
- } from "./chunk-Y63QWBQ6.mjs";
9
+ } from "./chunk-TFYLV3GN.mjs";
10
10
  import {
11
11
  addEntityRoutes
12
- } from "./chunk-7Z2OYXN4.mjs";
12
+ } from "./chunk-LL53FE2Z.mjs";
13
13
  import {
14
14
  withAuth
15
- } from "./chunk-NTPYEOME.mjs";
15
+ } from "./chunk-33ET4N4V.mjs";
16
16
  import {
17
17
  fetchPricingTable
18
- } from "./chunk-TTNUEXHB.mjs";
18
+ } from "./chunk-AREWK25J.mjs";
19
19
  import {
20
20
  BASE_PATH
21
21
  } from "./chunk-KSG3E4Q2.mjs";
@@ -324,6 +324,32 @@ var toContainerResult = async ({
324
324
  }
325
325
  };
326
326
 
327
+ // src/sdk/features/featureMethods.ts
328
+ var featureMethods = (instance) => {
329
+ return {
330
+ list: () => staticWrapper(listFeatures, instance, {})
331
+ };
332
+ };
333
+ var listFeatures = async ({
334
+ instance,
335
+ params
336
+ }) => {
337
+ let path = "/features";
338
+ if (params) {
339
+ const queryParams = new URLSearchParams();
340
+ for (const [key, value] of Object.entries(params)) {
341
+ if (value !== void 0) {
342
+ queryParams.append(key, String(value));
343
+ }
344
+ }
345
+ const queryString = queryParams.toString();
346
+ if (queryString) {
347
+ path += `?${queryString}`;
348
+ }
349
+ }
350
+ return instance.get(path);
351
+ };
352
+
327
353
  // src/sdk/client.ts
328
354
  var LATEST_API_VERSION = "1.2";
329
355
  var Autumn = class {
@@ -381,10 +407,12 @@ var Autumn = class {
381
407
  static products = productMethods();
382
408
  static entities = entityMethods();
383
409
  static referrals = referralMethods();
410
+ static features = featureMethods();
384
411
  customers = customerMethods(this);
385
412
  products = productMethods(this);
386
413
  entities = entityMethods(this);
387
414
  referrals = referralMethods(this);
415
+ features = featureMethods(this);
388
416
  static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
389
417
  async checkout(params) {
390
418
  return handleCheckout({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-NTPYEOME.mjs";
3
+ } from "./chunk-33ET4N4V.mjs";
4
4
  import {
5
5
  BASE_PATH
6
6
  } from "./chunk-KSG3E4Q2.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-NTPYEOME.mjs";
3
+ } from "./chunk-33ET4N4V.mjs";
4
4
 
5
5
  // src/libraries/backend/routes/entityRoutes.ts
6
6
  import { addRoute } from "rou3";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-NTPYEOME.mjs";
3
+ } from "./chunk-33ET4N4V.mjs";
4
4
  import {
5
5
  BASE_PATH
6
6
  } from "./chunk-KSG3E4Q2.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withAuth
3
- } from "./chunk-NTPYEOME.mjs";
3
+ } from "./chunk-33ET4N4V.mjs";
4
4
  import {
5
5
  BASE_PATH
6
6
  } from "./chunk-KSG3E4Q2.mjs";
@@ -384,6 +384,32 @@ var logger = {
384
384
  }
385
385
  };
386
386
 
387
+ // src/sdk/features/featureMethods.ts
388
+ var featureMethods = (instance) => {
389
+ return {
390
+ list: () => staticWrapper(listFeatures, instance, {})
391
+ };
392
+ };
393
+ var listFeatures = async ({
394
+ instance,
395
+ params
396
+ }) => {
397
+ let path = "/features";
398
+ if (params) {
399
+ const queryParams = new URLSearchParams();
400
+ for (const [key, value] of Object.entries(params)) {
401
+ if (value !== void 0) {
402
+ queryParams.append(key, String(value));
403
+ }
404
+ }
405
+ const queryString = queryParams.toString();
406
+ if (queryString) {
407
+ path += `?${queryString}`;
408
+ }
409
+ }
410
+ return instance.get(path);
411
+ };
412
+
387
413
  // src/sdk/client.ts
388
414
  var LATEST_API_VERSION = "1.2";
389
415
  var Autumn = class {
@@ -441,10 +467,12 @@ var Autumn = class {
441
467
  static products = productMethods();
442
468
  static entities = entityMethods();
443
469
  static referrals = referralMethods();
470
+ static features = featureMethods();
444
471
  customers = customerMethods(this);
445
472
  products = productMethods(this);
446
473
  entities = entityMethods(this);
447
474
  referrals = referralMethods(this);
475
+ features = featureMethods(this);
448
476
  static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
449
477
  async checkout(params) {
450
478
  return handleCheckout({
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-UNZHJTEY.mjs";
4
4
  import {
5
5
  createRouterWithOptions
6
- } from "./chunk-2LSEWYPD.mjs";
7
- import "./chunk-QVLMREDB.mjs";
8
- import "./chunk-WBYCMG34.mjs";
9
- import "./chunk-Y63QWBQ6.mjs";
10
- import "./chunk-7Z2OYXN4.mjs";
11
- import "./chunk-NTPYEOME.mjs";
6
+ } from "./chunk-3OVRYTZX.mjs";
7
+ import "./chunk-VBHBF3GP.mjs";
8
+ import "./chunk-GO7TVFSN.mjs";
9
+ import "./chunk-TFYLV3GN.mjs";
10
+ import "./chunk-LL53FE2Z.mjs";
11
+ import "./chunk-33ET4N4V.mjs";
12
12
  import {
13
13
  Autumn
14
- } from "./chunk-TTNUEXHB.mjs";
14
+ } from "./chunk-AREWK25J.mjs";
15
15
  import "./chunk-2TEL6LR5.mjs";
16
16
  import "./chunk-KSG3E4Q2.mjs";
17
17
 
@@ -385,6 +385,32 @@ var logger = {
385
385
  }
386
386
  };
387
387
 
388
+ // src/sdk/features/featureMethods.ts
389
+ var featureMethods = (instance) => {
390
+ return {
391
+ list: () => staticWrapper(listFeatures, instance, {})
392
+ };
393
+ };
394
+ var listFeatures = async ({
395
+ instance,
396
+ params
397
+ }) => {
398
+ let path = "/features";
399
+ if (params) {
400
+ const queryParams = new URLSearchParams();
401
+ for (const [key, value] of Object.entries(params)) {
402
+ if (value !== void 0) {
403
+ queryParams.append(key, String(value));
404
+ }
405
+ }
406
+ const queryString = queryParams.toString();
407
+ if (queryString) {
408
+ path += `?${queryString}`;
409
+ }
410
+ }
411
+ return instance.get(path);
412
+ };
413
+
388
414
  // src/sdk/client.ts
389
415
  var LATEST_API_VERSION = "1.2";
390
416
  var Autumn = class {
@@ -442,10 +468,12 @@ var Autumn = class {
442
468
  static products = productMethods();
443
469
  static entities = entityMethods();
444
470
  static referrals = referralMethods();
471
+ static features = featureMethods();
445
472
  customers = customerMethods(this);
446
473
  products = productMethods(this);
447
474
  entities = entityMethods(this);
448
475
  referrals = referralMethods(this);
476
+ features = featureMethods(this);
449
477
  static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
450
478
  async checkout(params) {
451
479
  return handleCheckout({
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-UNZHJTEY.mjs";
4
4
  import {
5
5
  createRouterWithOptions
6
- } from "./chunk-2LSEWYPD.mjs";
7
- import "./chunk-QVLMREDB.mjs";
8
- import "./chunk-WBYCMG34.mjs";
9
- import "./chunk-Y63QWBQ6.mjs";
10
- import "./chunk-7Z2OYXN4.mjs";
11
- import "./chunk-NTPYEOME.mjs";
6
+ } from "./chunk-3OVRYTZX.mjs";
7
+ import "./chunk-VBHBF3GP.mjs";
8
+ import "./chunk-GO7TVFSN.mjs";
9
+ import "./chunk-TFYLV3GN.mjs";
10
+ import "./chunk-LL53FE2Z.mjs";
11
+ import "./chunk-33ET4N4V.mjs";
12
12
  import {
13
13
  Autumn
14
- } from "./chunk-TTNUEXHB.mjs";
14
+ } from "./chunk-AREWK25J.mjs";
15
15
  import "./chunk-2TEL6LR5.mjs";
16
16
  import {
17
17
  autumnApiUrl
@@ -1,4 +1,4 @@
1
- import { A as Autumn } from './referralTypes-BfrNJ62q.mjs';
1
+ import { A as Autumn } from './referralTypes-B50JL4PY.mjs';
2
2
  import { AuthResult } from './utils/AuthFunction.mjs';
3
3
  import 'zod';
4
4
  import './response-CV6KGWH5.mjs';
@@ -1,4 +1,4 @@
1
- import { A as Autumn } from './referralTypes-Djyi4iGt.js';
1
+ import { A as Autumn } from './referralTypes-dW2HaxKV.js';
2
2
  import { AuthResult } from './utils/AuthFunction.js';
3
3
  import 'zod';
4
4
  import './response-CV6KGWH5.js';