autumn-js 0.1.5 → 0.1.6

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 (131) hide show
  1. package/dist/libraries/backend/better-auth.d.mts +36 -76
  2. package/dist/libraries/backend/better-auth.d.ts +36 -76
  3. package/dist/libraries/backend/better-auth.js +15 -13
  4. package/dist/libraries/backend/better-auth.mjs +16 -14
  5. package/dist/libraries/backend/express.d.mts +1 -1
  6. package/dist/libraries/backend/express.d.ts +1 -1
  7. package/dist/libraries/backend/index.d.mts +1 -1
  8. package/dist/libraries/backend/index.d.ts +1 -1
  9. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  10. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  11. package/dist/libraries/react/AutumnContext.d.mts +6 -6
  12. package/dist/libraries/react/AutumnContext.d.ts +6 -6
  13. package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
  14. package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
  15. package/dist/libraries/react/{ReactAutumnClient-DM5ZRTfX.d.ts → ReactAutumnClient-CK8k8OA5.d.ts} +17 -17
  16. package/dist/libraries/react/{ReactAutumnClient-BHjd9Tw5.d.mts → ReactAutumnClient-CjaZ_g4X.d.mts} +17 -17
  17. package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
  18. package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
  19. package/dist/libraries/react/{attachTypes-Bz1_JTvk.d.ts → attachTypes-BetWkt95.d.ts} +5 -5
  20. package/dist/libraries/react/{attachTypes-C9FJTCo6.d.mts → attachTypes-DbI59BLC.d.mts} +5 -5
  21. package/dist/libraries/react/{chunk-EXK6MS5M.mjs → chunk-7PFOXY3Y.mjs} +449 -451
  22. package/dist/libraries/react/{chunk-5K2M3CQZ.mjs → chunk-FEISQQNM.mjs} +1 -1
  23. package/dist/libraries/react/{chunk-BXMZYHE7.mjs → chunk-FJWZPMWU.mjs} +3 -3
  24. package/dist/libraries/react/{chunk-WT5K3J2K.mjs → chunk-I2A7PK2L.mjs} +17 -17
  25. package/dist/libraries/react/{chunk-YCDNQZT5.mjs → chunk-JGDTNJTR.mjs} +2 -2
  26. package/dist/libraries/react/{chunk-M7SUFZ42.mjs → chunk-KUS3X33V.mjs} +1 -1
  27. package/dist/libraries/react/{chunk-2TQBFCWM.mjs → chunk-OTZ65PCT.mjs} +4 -4
  28. package/dist/libraries/react/{chunk-NHDZWWMZ.mjs → chunk-YWQTQ72B.mjs} +2 -2
  29. package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
  30. package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
  31. package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
  32. package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
  33. package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
  34. package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
  35. package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
  36. package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
  37. package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
  38. package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
  39. package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
  40. package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
  41. package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
  42. package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
  43. package/dist/libraries/react/client/types/clientAttachTypes.d.mts +20 -20
  44. package/dist/libraries/react/client/types/clientAttachTypes.d.ts +20 -20
  45. package/dist/libraries/react/client/types/clientGenTypes.d.mts +4 -4
  46. package/dist/libraries/react/client/types/clientGenTypes.d.ts +4 -4
  47. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
  48. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
  49. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +15 -15
  50. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
  51. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
  52. package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
  53. package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
  54. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +15 -15
  55. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
  56. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
  57. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  58. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  59. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +15 -15
  60. package/dist/libraries/react/components/ui/accordion.mjs +3 -3
  61. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  62. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  63. package/dist/libraries/react/components/ui/dialog.mjs +4 -4
  64. package/dist/libraries/react/components/ui/popover.mjs +5 -5
  65. package/dist/libraries/react/components/ui/switch.mjs +3 -3
  66. package/dist/libraries/react/{cusTypes-yJ0fSxbq.d.ts → cusTypes-D5d_cu-K.d.ts} +5 -5
  67. package/dist/libraries/react/{cusTypes-DT-gAUL9.d.mts → cusTypes-DINgmPwV.d.mts} +5 -5
  68. package/dist/libraries/react/{entTypes-BPdjCunj.d.ts → entTypes-DNW_l3s0.d.ts} +1 -1
  69. package/dist/libraries/react/{entTypes-D79XPrxo.d.mts → entTypes-biskqmpT.d.mts} +1 -1
  70. package/dist/libraries/react/{genTypes-BV-Jc6Q1.d.mts → genTypes-DSvR32on.d.mts} +5 -5
  71. package/dist/libraries/react/{genTypes-DJUAkD36.d.ts → genTypes-EyxQImzh.d.ts} +5 -5
  72. package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
  73. package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
  74. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +7 -7
  75. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +7 -7
  76. package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
  77. package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
  78. package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
  79. package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
  80. package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
  81. package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
  82. package/dist/libraries/react/hooks/useEntity.d.mts +6 -6
  83. package/dist/libraries/react/hooks/useEntity.d.ts +6 -6
  84. package/dist/libraries/react/hooks/useEntityBase.d.mts +8 -8
  85. package/dist/libraries/react/hooks/useEntityBase.d.ts +8 -8
  86. package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
  87. package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
  88. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  89. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  90. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
  91. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
  92. package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
  93. package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
  94. package/dist/next/client/NextAutumnClient.d.mts +6 -6
  95. package/dist/next/client/NextAutumnClient.d.ts +6 -6
  96. package/dist/next/client/NextAutumnProvider.d.mts +1 -1
  97. package/dist/next/client/NextAutumnProvider.d.ts +1 -1
  98. package/dist/next/client/clientUtils.d.mts +2 -2
  99. package/dist/next/client/clientUtils.d.ts +2 -2
  100. package/dist/next/client/{entTypes-mOI7WnPZ.d.mts → entTypes-CHHBdhBK.d.mts} +1 -1
  101. package/dist/next/client/{entTypes-BAD1NMvb.d.ts → entTypes-vjIG3B1G.d.ts} +1 -1
  102. package/dist/next/client/hooks/useAutumn.d.mts +3 -3
  103. package/dist/next/client/hooks/useAutumn.d.ts +3 -3
  104. package/dist/next/client/hooks/useCustomer.d.mts +4 -4
  105. package/dist/next/client/hooks/useCustomer.d.ts +4 -4
  106. package/dist/next/client/hooks/useEntity.d.mts +3 -3
  107. package/dist/next/client/hooks/useEntity.d.ts +3 -3
  108. package/dist/next/client/types.d.mts +2 -2
  109. package/dist/next/client/types.d.ts +2 -2
  110. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  111. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  112. package/dist/next/server/componentActions.d.mts +1 -1
  113. package/dist/next/server/componentActions.d.ts +1 -1
  114. package/dist/next/server/cusActions.d.mts +15 -15
  115. package/dist/next/server/cusActions.d.ts +15 -15
  116. package/dist/next/server/genActions.d.mts +1 -1
  117. package/dist/next/server/genActions.d.ts +1 -1
  118. package/package.json +1 -1
  119. package/dist/libraries/backend/{referralTypes-Djyi4iGt.d.ts → referralTypes-B0_fYSI3.d.ts} +41 -41
  120. package/dist/libraries/backend/{referralTypes-BfrNJ62q.d.mts → referralTypes-CYvuZZeF.d.mts} +41 -41
  121. package/dist/libraries/react/{chunk-KWNH6C27.mjs → chunk-7TYAAD2T.mjs} +11 -11
  122. package/dist/libraries/react/{prodTypes-2tlu9Pyz.d.mts → prodTypes-Bmoibf-M.d.mts} +4 -4
  123. package/dist/libraries/react/{prodTypes-2tlu9Pyz.d.ts → prodTypes-Bmoibf-M.d.ts} +4 -4
  124. package/dist/next/client/{attachTypes-9VCTaz0m.d.mts → attachTypes-DZFtFEmv.d.mts} +2 -2
  125. package/dist/next/client/{attachTypes-DLxEa_Wj.d.ts → attachTypes-DxJ0LCjT.d.ts} +2 -2
  126. package/dist/next/client/{clientAttachTypes-umadXlvp.d.ts → clientAttachTypes-BXtfXB4v.d.ts} +2 -2
  127. package/dist/next/client/{clientAttachTypes-BzsPgggN.d.mts → clientAttachTypes-qsdoMt_B.d.mts} +2 -2
  128. package/dist/next/client/{cusTypes-CYojUJSJ.d.ts → cusTypes-BHYpk8bK.d.ts} +2 -2
  129. package/dist/next/client/{cusTypes-CIGvysWL.d.mts → cusTypes-Q54uLNO5.d.mts} +2 -2
  130. package/dist/next/server/{cusTypes-DgoOZMIt.d.mts → cusTypes-D38IpLCT.d.mts} +4 -4
  131. package/dist/next/server/{cusTypes-DgoOZMIt.d.ts → cusTypes-D38IpLCT.d.ts} +4 -4
@@ -11,6 +11,7 @@ declare const autumn: (options?: {
11
11
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
12
12
  body: {
13
13
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
14
+ errorOnNotFound?: boolean | undefined;
14
15
  };
15
16
  } & {
16
17
  method?: "POST" | undefined;
@@ -36,35 +37,16 @@ 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, {
65
45
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
46
+ errorOnNotFound?: boolean | undefined;
66
47
  }, {
67
48
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
49
+ errorOnNotFound?: boolean | undefined;
68
50
  }>;
69
51
  metadata: {
70
52
  isAction: boolean;
@@ -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
  };
@@ -131,11 +91,11 @@ declare const autumn: (options?: {
131
91
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
132
92
  body: {
133
93
  product_id: string;
94
+ entity_id?: string | undefined;
134
95
  options?: {
135
96
  feature_id: string;
136
97
  quantity: number;
137
98
  }[] | undefined;
138
- entity_id?: string | undefined;
139
99
  success_url?: string | undefined;
140
100
  customer_data?: {
141
101
  name?: string | null | undefined;
@@ -203,11 +163,11 @@ declare const autumn: (options?: {
203
163
  reward: z.ZodOptional<z.ZodString>;
204
164
  }, "customer_id">, "strip", z.ZodTypeAny, {
205
165
  product_id: string;
166
+ entity_id?: string | undefined;
206
167
  options?: {
207
168
  feature_id: string;
208
169
  quantity: number;
209
170
  }[] | undefined;
210
- entity_id?: string | undefined;
211
171
  success_url?: string | undefined;
212
172
  customer_data?: {
213
173
  name?: string | null | undefined;
@@ -219,11 +179,11 @@ declare const autumn: (options?: {
219
179
  reward?: string | undefined;
220
180
  }, {
221
181
  product_id: string;
182
+ entity_id?: string | undefined;
222
183
  options?: {
223
184
  feature_id: string;
224
185
  quantity: number;
225
186
  }[] | undefined;
226
- entity_id?: string | undefined;
227
187
  success_url?: string | undefined;
228
188
  customer_data?: {
229
189
  name?: string | null | undefined;
@@ -265,14 +225,17 @@ declare const autumn: (options?: {
265
225
  attach: {
266
226
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
267
227
  body: {
228
+ entity_id?: string | undefined;
268
229
  options?: {
269
230
  feature_id: string;
270
231
  quantity: number;
271
232
  }[] | undefined;
272
233
  metadata?: Record<string, string> | undefined;
273
234
  product_id?: string | undefined;
274
- entity_id?: string | undefined;
235
+ product_ids?: string[] | undefined;
236
+ free_trial?: boolean | undefined;
275
237
  success_url?: string | undefined;
238
+ force_checkout?: boolean | undefined;
276
239
  customer_data?: {
277
240
  name?: string | null | undefined;
278
241
  email?: string | null | undefined;
@@ -281,9 +244,6 @@ declare const autumn: (options?: {
281
244
  entity_data?: any;
282
245
  checkout_session_params?: Record<string, any> | undefined;
283
246
  reward?: string | undefined;
284
- product_ids?: string[] | undefined;
285
- free_trial?: boolean | undefined;
286
- force_checkout?: boolean | undefined;
287
247
  };
288
248
  } & {
289
249
  method?: "POST" | undefined;
@@ -345,14 +305,17 @@ declare const autumn: (options?: {
345
305
  checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
346
306
  reward: z.ZodOptional<z.ZodString>;
347
307
  }, "customer_id">, "strip", z.ZodTypeAny, {
308
+ entity_id?: string | undefined;
348
309
  options?: {
349
310
  feature_id: string;
350
311
  quantity: number;
351
312
  }[] | undefined;
352
313
  metadata?: Record<string, string> | undefined;
353
314
  product_id?: string | undefined;
354
- entity_id?: string | undefined;
315
+ product_ids?: string[] | undefined;
316
+ free_trial?: boolean | undefined;
355
317
  success_url?: string | undefined;
318
+ force_checkout?: boolean | undefined;
356
319
  customer_data?: {
357
320
  name?: string | null | undefined;
358
321
  email?: string | null | undefined;
@@ -361,18 +324,18 @@ declare const autumn: (options?: {
361
324
  entity_data?: any;
362
325
  checkout_session_params?: Record<string, any> | undefined;
363
326
  reward?: string | undefined;
364
- product_ids?: string[] | undefined;
365
- free_trial?: boolean | undefined;
366
- force_checkout?: boolean | undefined;
367
327
  }, {
328
+ entity_id?: string | undefined;
368
329
  options?: {
369
330
  feature_id: string;
370
331
  quantity: number;
371
332
  }[] | undefined;
372
333
  metadata?: Record<string, string> | undefined;
373
334
  product_id?: string | undefined;
374
- entity_id?: string | undefined;
335
+ product_ids?: string[] | undefined;
336
+ free_trial?: boolean | undefined;
375
337
  success_url?: string | undefined;
338
+ force_checkout?: boolean | undefined;
376
339
  customer_data?: {
377
340
  name?: string | null | undefined;
378
341
  email?: string | null | undefined;
@@ -381,9 +344,6 @@ declare const autumn: (options?: {
381
344
  entity_data?: any;
382
345
  checkout_session_params?: Record<string, any> | undefined;
383
346
  reward?: string | undefined;
384
- product_ids?: string[] | undefined;
385
- free_trial?: boolean | undefined;
386
- force_checkout?: boolean | undefined;
387
347
  }>;
388
348
  use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
389
349
  session: {
@@ -416,15 +376,15 @@ declare const autumn: (options?: {
416
376
  check: {
417
377
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
418
378
  body: {
419
- product_id?: string | undefined;
420
- entity_id?: string | undefined;
421
379
  feature_id?: string | undefined;
380
+ entity_id?: string | undefined;
381
+ required_balance?: number | undefined;
382
+ product_id?: string | undefined;
422
383
  customer_data?: any;
423
384
  entity_data?: {
424
385
  feature_id: string;
425
386
  name?: string | undefined;
426
387
  } | undefined;
427
- required_balance?: number | undefined;
428
388
  send_event?: boolean | undefined;
429
389
  with_preview?: boolean | undefined;
430
390
  };
@@ -472,27 +432,27 @@ declare const autumn: (options?: {
472
432
  name?: string | undefined;
473
433
  }>>;
474
434
  }, "customer_id">, "strip", z.ZodTypeAny, {
475
- product_id?: string | undefined;
476
- entity_id?: string | undefined;
477
435
  feature_id?: string | undefined;
436
+ entity_id?: string | undefined;
437
+ required_balance?: number | undefined;
438
+ product_id?: string | undefined;
478
439
  customer_data?: any;
479
440
  entity_data?: {
480
441
  feature_id: string;
481
442
  name?: string | undefined;
482
443
  } | undefined;
483
- required_balance?: number | undefined;
484
444
  send_event?: boolean | undefined;
485
445
  with_preview?: boolean | undefined;
486
446
  }, {
487
- product_id?: string | undefined;
488
- entity_id?: string | undefined;
489
447
  feature_id?: string | undefined;
448
+ entity_id?: string | undefined;
449
+ required_balance?: number | undefined;
450
+ product_id?: string | undefined;
490
451
  customer_data?: any;
491
452
  entity_data?: {
492
453
  feature_id: string;
493
454
  name?: string | undefined;
494
455
  } | undefined;
495
- required_balance?: number | undefined;
496
456
  send_event?: boolean | undefined;
497
457
  with_preview?: boolean | undefined;
498
458
  }>;
@@ -527,9 +487,9 @@ declare const autumn: (options?: {
527
487
  track: {
528
488
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
529
489
  body: {
530
- value?: number | undefined;
531
- entity_id?: string | undefined;
532
490
  feature_id?: string | undefined;
491
+ entity_id?: string | undefined;
492
+ value?: number | undefined;
533
493
  customer_data?: any;
534
494
  entity_data?: any;
535
495
  event_name?: string | undefined;
@@ -569,17 +529,17 @@ declare const autumn: (options?: {
569
529
  idempotency_key: z.ZodOptional<z.ZodString>;
570
530
  entity_data: z.ZodOptional<z.ZodAny>;
571
531
  }, "customer_id">, "strip", z.ZodTypeAny, {
572
- value?: number | undefined;
573
- entity_id?: string | undefined;
574
532
  feature_id?: string | undefined;
533
+ entity_id?: string | undefined;
534
+ value?: number | undefined;
575
535
  customer_data?: any;
576
536
  entity_data?: any;
577
537
  event_name?: string | undefined;
578
538
  idempotency_key?: string | undefined;
579
539
  }, {
580
- value?: number | undefined;
581
- entity_id?: string | undefined;
582
540
  feature_id?: string | undefined;
541
+ entity_id?: string | undefined;
542
+ value?: number | undefined;
583
543
  customer_data?: any;
584
544
  entity_data?: any;
585
545
  event_name?: string | undefined;
@@ -11,6 +11,7 @@ declare const autumn: (options?: {
11
11
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
12
12
  body: {
13
13
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
14
+ errorOnNotFound?: boolean | undefined;
14
15
  };
15
16
  } & {
16
17
  method?: "POST" | undefined;
@@ -36,35 +37,16 @@ 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, {
65
45
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
46
+ errorOnNotFound?: boolean | undefined;
66
47
  }, {
67
48
  expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
49
+ errorOnNotFound?: boolean | undefined;
68
50
  }>;
69
51
  metadata: {
70
52
  isAction: boolean;
@@ -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
  };
@@ -131,11 +91,11 @@ declare const autumn: (options?: {
131
91
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
132
92
  body: {
133
93
  product_id: string;
94
+ entity_id?: string | undefined;
134
95
  options?: {
135
96
  feature_id: string;
136
97
  quantity: number;
137
98
  }[] | undefined;
138
- entity_id?: string | undefined;
139
99
  success_url?: string | undefined;
140
100
  customer_data?: {
141
101
  name?: string | null | undefined;
@@ -203,11 +163,11 @@ declare const autumn: (options?: {
203
163
  reward: z.ZodOptional<z.ZodString>;
204
164
  }, "customer_id">, "strip", z.ZodTypeAny, {
205
165
  product_id: string;
166
+ entity_id?: string | undefined;
206
167
  options?: {
207
168
  feature_id: string;
208
169
  quantity: number;
209
170
  }[] | undefined;
210
- entity_id?: string | undefined;
211
171
  success_url?: string | undefined;
212
172
  customer_data?: {
213
173
  name?: string | null | undefined;
@@ -219,11 +179,11 @@ declare const autumn: (options?: {
219
179
  reward?: string | undefined;
220
180
  }, {
221
181
  product_id: string;
182
+ entity_id?: string | undefined;
222
183
  options?: {
223
184
  feature_id: string;
224
185
  quantity: number;
225
186
  }[] | undefined;
226
- entity_id?: string | undefined;
227
187
  success_url?: string | undefined;
228
188
  customer_data?: {
229
189
  name?: string | null | undefined;
@@ -265,14 +225,17 @@ declare const autumn: (options?: {
265
225
  attach: {
266
226
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
267
227
  body: {
228
+ entity_id?: string | undefined;
268
229
  options?: {
269
230
  feature_id: string;
270
231
  quantity: number;
271
232
  }[] | undefined;
272
233
  metadata?: Record<string, string> | undefined;
273
234
  product_id?: string | undefined;
274
- entity_id?: string | undefined;
235
+ product_ids?: string[] | undefined;
236
+ free_trial?: boolean | undefined;
275
237
  success_url?: string | undefined;
238
+ force_checkout?: boolean | undefined;
276
239
  customer_data?: {
277
240
  name?: string | null | undefined;
278
241
  email?: string | null | undefined;
@@ -281,9 +244,6 @@ declare const autumn: (options?: {
281
244
  entity_data?: any;
282
245
  checkout_session_params?: Record<string, any> | undefined;
283
246
  reward?: string | undefined;
284
- product_ids?: string[] | undefined;
285
- free_trial?: boolean | undefined;
286
- force_checkout?: boolean | undefined;
287
247
  };
288
248
  } & {
289
249
  method?: "POST" | undefined;
@@ -345,14 +305,17 @@ declare const autumn: (options?: {
345
305
  checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
346
306
  reward: z.ZodOptional<z.ZodString>;
347
307
  }, "customer_id">, "strip", z.ZodTypeAny, {
308
+ entity_id?: string | undefined;
348
309
  options?: {
349
310
  feature_id: string;
350
311
  quantity: number;
351
312
  }[] | undefined;
352
313
  metadata?: Record<string, string> | undefined;
353
314
  product_id?: string | undefined;
354
- entity_id?: string | undefined;
315
+ product_ids?: string[] | undefined;
316
+ free_trial?: boolean | undefined;
355
317
  success_url?: string | undefined;
318
+ force_checkout?: boolean | undefined;
356
319
  customer_data?: {
357
320
  name?: string | null | undefined;
358
321
  email?: string | null | undefined;
@@ -361,18 +324,18 @@ declare const autumn: (options?: {
361
324
  entity_data?: any;
362
325
  checkout_session_params?: Record<string, any> | undefined;
363
326
  reward?: string | undefined;
364
- product_ids?: string[] | undefined;
365
- free_trial?: boolean | undefined;
366
- force_checkout?: boolean | undefined;
367
327
  }, {
328
+ entity_id?: string | undefined;
368
329
  options?: {
369
330
  feature_id: string;
370
331
  quantity: number;
371
332
  }[] | undefined;
372
333
  metadata?: Record<string, string> | undefined;
373
334
  product_id?: string | undefined;
374
- entity_id?: string | undefined;
335
+ product_ids?: string[] | undefined;
336
+ free_trial?: boolean | undefined;
375
337
  success_url?: string | undefined;
338
+ force_checkout?: boolean | undefined;
376
339
  customer_data?: {
377
340
  name?: string | null | undefined;
378
341
  email?: string | null | undefined;
@@ -381,9 +344,6 @@ declare const autumn: (options?: {
381
344
  entity_data?: any;
382
345
  checkout_session_params?: Record<string, any> | undefined;
383
346
  reward?: string | undefined;
384
- product_ids?: string[] | undefined;
385
- free_trial?: boolean | undefined;
386
- force_checkout?: boolean | undefined;
387
347
  }>;
388
348
  use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
389
349
  session: {
@@ -416,15 +376,15 @@ declare const autumn: (options?: {
416
376
  check: {
417
377
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
418
378
  body: {
419
- product_id?: string | undefined;
420
- entity_id?: string | undefined;
421
379
  feature_id?: string | undefined;
380
+ entity_id?: string | undefined;
381
+ required_balance?: number | undefined;
382
+ product_id?: string | undefined;
422
383
  customer_data?: any;
423
384
  entity_data?: {
424
385
  feature_id: string;
425
386
  name?: string | undefined;
426
387
  } | undefined;
427
- required_balance?: number | undefined;
428
388
  send_event?: boolean | undefined;
429
389
  with_preview?: boolean | undefined;
430
390
  };
@@ -472,27 +432,27 @@ declare const autumn: (options?: {
472
432
  name?: string | undefined;
473
433
  }>>;
474
434
  }, "customer_id">, "strip", z.ZodTypeAny, {
475
- product_id?: string | undefined;
476
- entity_id?: string | undefined;
477
435
  feature_id?: string | undefined;
436
+ entity_id?: string | undefined;
437
+ required_balance?: number | undefined;
438
+ product_id?: string | undefined;
478
439
  customer_data?: any;
479
440
  entity_data?: {
480
441
  feature_id: string;
481
442
  name?: string | undefined;
482
443
  } | undefined;
483
- required_balance?: number | undefined;
484
444
  send_event?: boolean | undefined;
485
445
  with_preview?: boolean | undefined;
486
446
  }, {
487
- product_id?: string | undefined;
488
- entity_id?: string | undefined;
489
447
  feature_id?: string | undefined;
448
+ entity_id?: string | undefined;
449
+ required_balance?: number | undefined;
450
+ product_id?: string | undefined;
490
451
  customer_data?: any;
491
452
  entity_data?: {
492
453
  feature_id: string;
493
454
  name?: string | undefined;
494
455
  } | undefined;
495
- required_balance?: number | undefined;
496
456
  send_event?: boolean | undefined;
497
457
  with_preview?: boolean | undefined;
498
458
  }>;
@@ -527,9 +487,9 @@ declare const autumn: (options?: {
527
487
  track: {
528
488
  <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
529
489
  body: {
530
- value?: number | undefined;
531
- entity_id?: string | undefined;
532
490
  feature_id?: string | undefined;
491
+ entity_id?: string | undefined;
492
+ value?: number | undefined;
533
493
  customer_data?: any;
534
494
  entity_data?: any;
535
495
  event_name?: string | undefined;
@@ -569,17 +529,17 @@ declare const autumn: (options?: {
569
529
  idempotency_key: z.ZodOptional<z.ZodString>;
570
530
  entity_data: z.ZodOptional<z.ZodAny>;
571
531
  }, "customer_id">, "strip", z.ZodTypeAny, {
572
- value?: number | undefined;
573
- entity_id?: string | undefined;
574
532
  feature_id?: string | undefined;
533
+ entity_id?: string | undefined;
534
+ value?: number | undefined;
575
535
  customer_data?: any;
576
536
  entity_data?: any;
577
537
  event_name?: string | undefined;
578
538
  idempotency_key?: string | undefined;
579
539
  }, {
580
- value?: number | undefined;
581
- entity_id?: string | undefined;
582
540
  feature_id?: string | undefined;
541
+ entity_id?: string | undefined;
542
+ value?: number | undefined;
583
543
  customer_data?: any;
584
544
  entity_data?: any;
585
545
  event_name?: string | undefined;
@@ -1184,7 +1184,7 @@ var router = createRouterWithOptions();
1184
1184
  var betterAuthPathMap = {
1185
1185
  // "create-customer": "customers",
1186
1186
  // "customers/get": "customers",
1187
- "checkout": "checkout",
1187
+ checkout: "checkout",
1188
1188
  attach: "attach",
1189
1189
  check: "check",
1190
1190
  track: "track",
@@ -1197,7 +1197,8 @@ var betterAuthPathMap = {
1197
1197
  var handleReq = async ({
1198
1198
  ctx,
1199
1199
  options,
1200
- method
1200
+ method,
1201
+ session
1201
1202
  }) => {
1202
1203
  let { found, error: resError } = secretKeyCheck();
1203
1204
  if (!found && !options?.secretKey) {
@@ -1226,16 +1227,16 @@ var handleReq = async ({
1226
1227
  const { data, params: pathParams } = match;
1227
1228
  const { handler } = data;
1228
1229
  const body = ctx.body;
1229
- const session = ctx.context.session;
1230
+ const finalSession = session || ctx.context.session;
1230
1231
  const identify = async () => {
1231
- if (!session) {
1232
+ if (!finalSession) {
1232
1233
  return;
1233
1234
  }
1234
1235
  return {
1235
- customerId: session.user.id,
1236
+ customerId: finalSession.user.id,
1236
1237
  customerData: {
1237
- email: session.user.email,
1238
- name: session.user.name
1238
+ email: finalSession.user.email,
1239
+ name: finalSession.user.name
1239
1240
  }
1240
1241
  };
1241
1242
  };
@@ -1256,8 +1257,6 @@ var handleReq = async ({
1256
1257
  return ctx.json(result.body, { status: result.statusCode });
1257
1258
  };
1258
1259
  var autumn = (options) => {
1259
- let secretKey = options?.secretKey;
1260
- let url = options?.url;
1261
1260
  return {
1262
1261
  id: "autumn",
1263
1262
  endpoints: {
@@ -1265,8 +1264,9 @@ var autumn = (options) => {
1265
1264
  "/autumn/customers",
1266
1265
  {
1267
1266
  method: "POST",
1268
- use: [import_api.sessionMiddleware],
1267
+ use: [],
1269
1268
  body: import_zod8.z.object({
1269
+ errorOnNotFound: import_zod8.z.boolean().optional(),
1270
1270
  expand: import_zod8.z.array(CustomerExpandEnum).optional()
1271
1271
  }),
1272
1272
  metadata: {
@@ -1274,17 +1274,19 @@ var autumn = (options) => {
1274
1274
  }
1275
1275
  },
1276
1276
  async (ctx) => {
1277
- return await handleReq({ ctx, options, method: "POST" });
1277
+ const session = await (0, import_api.getSessionFromCtx)(ctx);
1278
+ return await handleReq({ ctx, options, method: "POST", session });
1278
1279
  }
1279
1280
  ),
1280
1281
  listProducts: (0, import_plugins.createAuthEndpoint)(
1281
1282
  "/autumn/products",
1282
1283
  {
1283
1284
  method: "GET",
1284
- use: [import_api.sessionMiddleware]
1285
+ use: []
1285
1286
  },
1286
1287
  async (ctx) => {
1287
- return await handleReq({ ctx, options, method: "GET" });
1288
+ const session = await (0, import_api.getSessionFromCtx)(ctx);
1289
+ return await handleReq({ ctx, options, method: "GET", session });
1288
1290
  }
1289
1291
  ),
1290
1292
  checkout: (0, import_plugins.createAuthEndpoint)(