autumn-js 0.0.107 → 0.0.108

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 (127) hide show
  1. package/dist/libraries/backend/better-auth.mjs +2 -2
  2. package/dist/libraries/backend/convex.mjs +2 -2
  3. package/dist/libraries/backend/elysia.mjs +2 -2
  4. package/dist/libraries/backend/express.mjs +2 -2
  5. package/dist/libraries/backend/fastify.mjs +2 -2
  6. package/dist/libraries/backend/hono.mjs +2 -2
  7. package/dist/libraries/backend/next.mjs +2 -2
  8. package/dist/libraries/backend/react-router.mjs +2 -2
  9. package/dist/libraries/backend/remix_dep.mjs +2 -2
  10. package/dist/libraries/backend/routes/backendRouter.mjs +2 -2
  11. package/dist/libraries/backend/supabase.mjs +2 -2
  12. package/dist/libraries/backend/tanstack.mjs +2 -2
  13. package/dist/libraries/react/AutumnContext.d.mts +5 -5
  14. package/dist/libraries/react/AutumnContext.d.ts +5 -5
  15. package/dist/libraries/react/AutumnContext.mjs +6 -6
  16. package/dist/libraries/react/BaseAutumnProvider.d.mts +5 -5
  17. package/dist/libraries/react/BaseAutumnProvider.d.ts +5 -5
  18. package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
  19. package/dist/libraries/react/{ReactAutumnClient-BpXo7k9S.d.mts → ReactAutumnClient-BjRiaYDN.d.mts} +7 -7
  20. package/dist/libraries/react/{ReactAutumnClient-Cr0JiREm.d.ts → ReactAutumnClient-O2XzkzGM.d.ts} +7 -7
  21. package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
  22. package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
  23. package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
  24. package/dist/libraries/react/{attachTypes-DfACqtlD.d.ts → attachTypes-1Dbkyo_d.d.ts} +3 -3
  25. package/dist/libraries/react/{attachTypes-CRCMAcZg.d.mts → attachTypes-DoFoPh8g.d.mts} +3 -3
  26. package/dist/libraries/react/{chunk-VWVC5X2R.mjs → chunk-3XJ7NFT2.mjs} +15 -13
  27. package/dist/libraries/react/{chunk-2LCMYER5.mjs → chunk-4CHWEUKX.mjs} +2 -2
  28. package/dist/libraries/react/{chunk-FB6W5XQX.mjs → chunk-6RNG47NV.mjs} +1 -1
  29. package/dist/libraries/react/{chunk-HQTQYHKS.mjs → chunk-7DINVACK.mjs} +2 -2
  30. package/dist/libraries/react/{chunk-5YEDOCUG.mjs → chunk-DRAIZ3UZ.mjs} +3 -3
  31. package/dist/libraries/react/chunk-JGRLRPKG.mjs +56 -0
  32. package/dist/libraries/react/{chunk-WAFSQH6N.mjs → chunk-JPLUWGH4.mjs} +7 -1
  33. package/dist/libraries/react/{chunk-IZSSJHYG.mjs → chunk-KDD5RMQ3.mjs} +2 -2
  34. package/dist/libraries/react/{chunk-A4HGGTVT.mjs → chunk-KJLHVBV4.mjs} +2 -2
  35. package/dist/libraries/react/{chunk-4K7ZXCEU.mjs → chunk-LXD6AEZW.mjs} +1 -1
  36. package/dist/libraries/react/{chunk-NPEXC3I5.mjs → chunk-OEIUKLFH.mjs} +2 -2
  37. package/dist/libraries/react/{chunk-HRE3F4SD.mjs → chunk-OM3ROIZO.mjs} +2 -2
  38. package/dist/libraries/react/{chunk-X2ZMWBM7.mjs → chunk-OTYSAMRH.mjs} +2 -2
  39. package/dist/libraries/react/{chunk-4A53GN44.mjs → chunk-PC6V4RE7.mjs} +4 -4
  40. package/dist/libraries/react/{chunk-CUWUAQML.mjs → chunk-QJPZFEVW.mjs} +8 -49
  41. package/dist/libraries/react/{chunk-QKNW5ACT.mjs → chunk-XXGKLOAK.mjs} +3 -3
  42. package/dist/libraries/react/client/ReactAutumnClient.d.mts +5 -5
  43. package/dist/libraries/react/client/ReactAutumnClient.d.ts +5 -5
  44. package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
  45. package/dist/libraries/react/client/clientCompMethods.d.mts +5 -5
  46. package/dist/libraries/react/client/clientCompMethods.d.ts +5 -5
  47. package/dist/libraries/react/client/clientCusMethods.d.mts +5 -5
  48. package/dist/libraries/react/client/clientCusMethods.d.ts +5 -5
  49. package/dist/libraries/react/client/clientEntityMethods.d.mts +5 -5
  50. package/dist/libraries/react/client/clientEntityMethods.d.ts +5 -5
  51. package/dist/libraries/react/client/clientGenMethods.d.mts +5 -5
  52. package/dist/libraries/react/client/clientGenMethods.d.ts +5 -5
  53. package/dist/libraries/react/client/clientProdMethods.d.mts +5 -5
  54. package/dist/libraries/react/client/clientProdMethods.d.ts +5 -5
  55. package/dist/libraries/react/client/clientReferralMethods.d.mts +5 -5
  56. package/dist/libraries/react/client/clientReferralMethods.d.ts +5 -5
  57. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +2 -2
  58. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +2 -2
  59. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +123 -112
  60. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +25 -24
  61. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +2 -2
  62. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +2 -2
  63. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
  64. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
  65. package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +117 -3
  66. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +4 -3
  67. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
  68. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
  69. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
  70. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
  71. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
  72. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
  73. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +109 -98
  74. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +25 -24
  75. package/dist/libraries/react/components/ui/accordion.mjs +2 -1
  76. package/dist/libraries/react/components/ui/dialog.js +115 -1
  77. package/dist/libraries/react/components/ui/dialog.mjs +2 -1
  78. package/dist/libraries/react/{cusTypes-B9PUlh3i.d.ts → cusTypes-COIU0NG3.d.mts} +5 -5
  79. package/dist/libraries/react/{cusTypes-B9PUlh3i.d.mts → cusTypes-COIU0NG3.d.ts} +5 -5
  80. package/dist/libraries/react/{entTypes-DgHZw9Eg.d.mts → entTypes-BVPtpycG.d.mts} +1 -1
  81. package/dist/libraries/react/{entTypes-GuU6bc8U.d.ts → entTypes-Ck3_WfOz.d.ts} +1 -1
  82. package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
  83. package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
  84. package/dist/libraries/react/hooks/useAutumn.d.mts +3 -3
  85. package/dist/libraries/react/hooks/useAutumn.d.ts +3 -3
  86. package/dist/libraries/react/hooks/useAutumn.mjs +9 -9
  87. package/dist/libraries/react/hooks/useAutumnBase.d.mts +5 -5
  88. package/dist/libraries/react/hooks/useAutumnBase.d.ts +5 -5
  89. package/dist/libraries/react/hooks/useAutumnBase.mjs +8 -8
  90. package/dist/libraries/react/hooks/useCustomer.d.mts +5 -5
  91. package/dist/libraries/react/hooks/useCustomer.d.ts +5 -5
  92. package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
  93. package/dist/libraries/react/hooks/useCustomerBase.d.mts +5 -5
  94. package/dist/libraries/react/hooks/useCustomerBase.d.ts +5 -5
  95. package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
  96. package/dist/libraries/react/hooks/useEntity.d.mts +3 -3
  97. package/dist/libraries/react/hooks/useEntity.d.ts +3 -3
  98. package/dist/libraries/react/hooks/useEntity.mjs +10 -10
  99. package/dist/libraries/react/hooks/useEntityBase.d.mts +5 -5
  100. package/dist/libraries/react/hooks/useEntityBase.d.ts +5 -5
  101. package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
  102. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
  103. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
  104. package/dist/libraries/react/hooks/usePricingTable.mjs +8 -8
  105. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +5 -5
  106. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +5 -5
  107. package/dist/libraries/react/hooks/usePricingTableBase.mjs +7 -7
  108. package/dist/libraries/react/hooks/useProductsBase.mjs +6 -6
  109. package/dist/libraries/react/index.js +109 -98
  110. package/dist/libraries/react/index.mjs +109 -98
  111. package/dist/libraries/react/{response-BCyzYfES.d.ts → response-C7P_oYqV.d.ts} +6 -6
  112. package/dist/libraries/react/{response-pYjgZr_V.d.mts → response-dnzFyX91.d.mts} +6 -6
  113. package/dist/next/client/NextAutumnClient.d.mts +13 -13
  114. package/dist/next/client/NextAutumnClient.d.ts +13 -13
  115. package/dist/next/client/hooks/useAutumn.d.mts +5 -5
  116. package/dist/next/client/hooks/useAutumn.d.ts +5 -5
  117. package/dist/next/client/hooks/useCustomer.d.mts +2 -2
  118. package/dist/next/client/hooks/useCustomer.d.ts +2 -2
  119. package/dist/next/client/hooks/useEntity.d.mts +6 -6
  120. package/dist/next/client/hooks/useEntity.d.ts +6 -6
  121. package/package.json +1 -1
  122. package/dist/libraries/backend/{chunk-ICPSX5WQ.mjs → chunk-2RZ2FZX2.mjs} +3 -3
  123. package/dist/libraries/react/{chunk-5ZJQVPJY.mjs → chunk-2PVRCDDK.mjs} +13 -13
  124. package/dist/next/client/{attachTypes-c0nmQ7FA.d.ts → attachTypes-CJ7OSUSn.d.ts} +4 -4
  125. package/dist/next/client/{attachTypes-BE_gD21A.d.mts → attachTypes-DZlF8AAj.d.mts} +4 -4
  126. package/dist/next/client/{clientAttachTypes-BBDJRxyt.d.ts → clientAttachTypes-D0_L-cnv.d.ts} +24 -24
  127. package/dist/next/client/{clientAttachTypes-C-bSiO35.d.mts → clientAttachTypes-D84PT2G0.d.mts} +24 -24
@@ -1,5 +1,5 @@
1
- import { R as Result, b as AutumnPromise, C as CheckResult, O as OpenBillingPortalParams, S as SetupPaymentParams, f as SetupPaymentResult, A as AttachParams, d as CancelParams, e as CancelResult, a as CheckParams, T as TrackParams, c as TrackResult } from './clientAttachTypes-BBDJRxyt.js';
2
- import { C as CheckoutResult, A as AttachResult } from './attachTypes-c0nmQ7FA.js';
1
+ import { R as Result, b as AutumnPromise, C as CheckResult, O as OpenBillingPortalParams, S as SetupPaymentParams, f as SetupPaymentResult, A as AttachParams, d as CancelParams, e as CancelResult, a as CheckParams, T as TrackParams, c as TrackResult } from './clientAttachTypes-D0_L-cnv.js';
2
+ import { C as CheckoutResult, A as AttachResult } from './attachTypes-CJ7OSUSn.js';
3
3
  import { P as ProductItem, f as ProductScenario, C as CustomerData, g as CreateCustomerParams, a as Customer, B as BillingPortalResult, b as Product } from './cusTypes-DT2ujoSl.js';
4
4
  import { E as Entity, D as DeleteEntityResult } from './entTypes-C-7Uoct9.js';
5
5
  import { C as CreateEntityParams, G as GetEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from './clientEntTypes-BFkleT6a.js';
@@ -63,38 +63,38 @@ declare class AutumnClient {
63
63
  }, AutumnError>>;
64
64
  attach: (params: {
65
65
  options?: {
66
- quantity: number;
67
66
  featureId: string;
67
+ quantity: number;
68
68
  }[] | undefined;
69
69
  metadata?: Record<string, string> | undefined;
70
- reward?: string | undefined;
71
70
  productId?: string | undefined;
72
71
  entityId?: string | undefined;
73
- dialog?: any;
74
- entityData?: any;
75
72
  productIds?: string[] | undefined;
76
73
  freeTrial?: boolean | undefined;
77
74
  successUrl?: string | undefined;
78
75
  forceCheckout?: boolean | undefined;
76
+ dialog?: any;
77
+ entityData?: any;
79
78
  openInNewTab?: boolean | undefined;
79
+ reward?: string | undefined;
80
80
  checkoutSessionParams?: Record<string, any> | undefined;
81
81
  }) => AutumnPromise<{
82
82
  code: string;
83
83
  message: string;
84
84
  customer_id: string;
85
85
  product_ids: string[];
86
- customer_data?: any;
87
86
  checkout_url?: string | undefined;
87
+ customer_data?: any;
88
88
  }>;
89
89
  checkout: (params: {
90
90
  productId: string;
91
91
  options?: {
92
- quantity: number;
93
92
  featureId: string;
93
+ quantity: number;
94
94
  }[] | undefined;
95
95
  entityId?: string | undefined;
96
- dialog?: any;
97
96
  successUrl?: string | undefined;
97
+ dialog?: any;
98
98
  openInNewTab?: boolean | undefined;
99
99
  }) => AutumnPromise<CheckoutResult>;
100
100
  cancel: (params: {
@@ -103,18 +103,18 @@ declare class AutumnClient {
103
103
  cancelImmediately?: boolean | undefined;
104
104
  }) => AutumnPromise<{
105
105
  customer_id: string;
106
- product_id: string;
107
106
  success: boolean;
107
+ product_id: string;
108
108
  }>;
109
109
  check: (params: {
110
110
  productId?: string | undefined;
111
111
  entityId?: string | undefined;
112
112
  featureId?: string | undefined;
113
+ dialog?: any;
114
+ entityData?: any;
113
115
  requiredBalance?: number | undefined;
114
116
  sendEvent?: boolean | undefined;
115
117
  withPreview?: boolean | undefined;
116
- dialog?: any;
117
- entityData?: any;
118
118
  }) => AutumnPromise<CheckResult>;
119
119
  track: (params: {
120
120
  value?: number | undefined;
@@ -125,8 +125,8 @@ declare class AutumnClient {
125
125
  idempotencyKey?: string | undefined;
126
126
  }) => AutumnPromise<{
127
127
  code: string;
128
- customer_id: string;
129
128
  id: string;
129
+ customer_id: string;
130
130
  feature_id?: string | undefined;
131
131
  event_name?: string | undefined;
132
132
  }>;
@@ -1,18 +1,18 @@
1
- import { A as AttachParams, R as Result, C as CheckResult, a as CheckParams, b as AutumnPromise, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, f as SetupPaymentResult, g as CheckoutParams } from '../clientAttachTypes-C-bSiO35.mjs';
1
+ import { A as AttachParams, R as Result, C as CheckResult, a as CheckParams, b as AutumnPromise, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, f as SetupPaymentResult, g as CheckoutParams } from '../clientAttachTypes-D84PT2G0.mjs';
2
2
  import { A as AutumnError } from '../error-DHbclCVh.mjs';
3
- import { C as CheckoutResult } from '../attachTypes-BE_gD21A.mjs';
3
+ import { C as CheckoutResult } from '../attachTypes-DZlF8AAj.mjs';
4
4
  import { B as BillingPortalResult } from '../cusTypes-DT2ujoSl.mjs';
5
5
  import 'zod';
6
6
 
7
7
  declare const useAutumn: () => {
8
- attach: (params: AttachParams) => Promise<Result<{
9
- customer_id: string;
8
+ attach: (params: AttachParams) => Promise<Result<CheckResult | {
10
9
  code: string;
11
10
  message: string;
11
+ customer_id: string;
12
12
  product_ids: string[];
13
13
  customer_data?: any;
14
14
  checkout_url?: string | undefined;
15
- } | CheckResult, AutumnError>>;
15
+ }, AutumnError>>;
16
16
  check: (params: CheckParams) => AutumnPromise<CheckResult>;
17
17
  track: (params: TrackParams) => AutumnPromise<TrackResult>;
18
18
  cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
@@ -1,18 +1,18 @@
1
- import { A as AttachParams, R as Result, C as CheckResult, a as CheckParams, b as AutumnPromise, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, f as SetupPaymentResult, g as CheckoutParams } from '../clientAttachTypes-BBDJRxyt.js';
1
+ import { A as AttachParams, R as Result, C as CheckResult, a as CheckParams, b as AutumnPromise, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, f as SetupPaymentResult, g as CheckoutParams } from '../clientAttachTypes-D0_L-cnv.js';
2
2
  import { A as AutumnError } from '../error-DHbclCVh.js';
3
- import { C as CheckoutResult } from '../attachTypes-c0nmQ7FA.js';
3
+ import { C as CheckoutResult } from '../attachTypes-CJ7OSUSn.js';
4
4
  import { B as BillingPortalResult } from '../cusTypes-DT2ujoSl.js';
5
5
  import 'zod';
6
6
 
7
7
  declare const useAutumn: () => {
8
- attach: (params: AttachParams) => Promise<Result<{
9
- customer_id: string;
8
+ attach: (params: AttachParams) => Promise<Result<CheckResult | {
10
9
  code: string;
11
10
  message: string;
11
+ customer_id: string;
12
12
  product_ids: string[];
13
13
  customer_data?: any;
14
14
  checkout_url?: string | undefined;
15
- } | CheckResult, AutumnError>>;
15
+ }, AutumnError>>;
16
16
  check: (params: CheckParams) => AutumnPromise<CheckResult>;
17
17
  track: (params: TrackParams) => AutumnPromise<TrackResult>;
18
18
  cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
@@ -1,6 +1,6 @@
1
1
  import { A as AutumnError } from '../error-DHbclCVh.mjs';
2
- import { A as AttachParams, b as AutumnPromise, a as CheckParams, C as CheckResult, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, S as SetupPaymentParams, f as SetupPaymentResult, O as OpenBillingPortalParams, g as CheckoutParams } from '../clientAttachTypes-C-bSiO35.mjs';
3
- import { A as AttachResult, C as CheckoutResult } from '../attachTypes-BE_gD21A.mjs';
2
+ import { A as AttachParams, b as AutumnPromise, a as CheckParams, C as CheckResult, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, S as SetupPaymentParams, f as SetupPaymentResult, O as OpenBillingPortalParams, g as CheckoutParams } from '../clientAttachTypes-D84PT2G0.mjs';
3
+ import { A as AttachResult, C as CheckoutResult } from '../attachTypes-DZlF8AAj.mjs';
4
4
  import { h as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-DT2ujoSl.mjs';
5
5
  import { E as Entity } from '../entTypes-CXGgMuHO.mjs';
6
6
  import { C as CreateEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../clientEntTypes-BFkleT6a.mjs';
@@ -1,6 +1,6 @@
1
1
  import { A as AutumnError } from '../error-DHbclCVh.js';
2
- import { A as AttachParams, b as AutumnPromise, a as CheckParams, C as CheckResult, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, S as SetupPaymentParams, f as SetupPaymentResult, O as OpenBillingPortalParams, g as CheckoutParams } from '../clientAttachTypes-BBDJRxyt.js';
3
- import { A as AttachResult, C as CheckoutResult } from '../attachTypes-c0nmQ7FA.js';
2
+ import { A as AttachParams, b as AutumnPromise, a as CheckParams, C as CheckResult, T as TrackParams, c as TrackResult, d as CancelParams, e as CancelResult, S as SetupPaymentParams, f as SetupPaymentResult, O as OpenBillingPortalParams, g as CheckoutParams } from '../clientAttachTypes-D0_L-cnv.js';
3
+ import { A as AttachResult, C as CheckoutResult } from '../attachTypes-CJ7OSUSn.js';
4
4
  import { h as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-DT2ujoSl.js';
5
5
  import { E as Entity } from '../entTypes-C-7Uoct9.js';
6
6
  import { C as CreateEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../clientEntTypes-BFkleT6a.js';
@@ -1,4 +1,4 @@
1
- import { a as CheckParams, b as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, d as CancelParams, T as TrackParams } from '../clientAttachTypes-C-bSiO35.mjs';
1
+ import { a as CheckParams, b as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, d as CancelParams, T as TrackParams } from '../clientAttachTypes-D84PT2G0.mjs';
2
2
  import { A as AutumnError } from '../error-DHbclCVh.mjs';
3
3
  import { G as GetEntityParams, E as Entity } from '../entTypes-CXGgMuHO.mjs';
4
4
  import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.mjs';
@@ -13,23 +13,23 @@ declare const useEntity: (entityId: string | null, params?: GetEntityParams) =>
13
13
  refetch: swr.KeyedMutator<Entity | null>;
14
14
  allowed: (params: AllowedParams) => boolean;
15
15
  check: (params: CheckParams) => AutumnPromise<CheckResult>;
16
- attach: (params: AttachParams) => Promise<Result<{
17
- customer_id: string;
16
+ attach: (params: AttachParams) => Promise<Result<CheckResult | {
18
17
  code: string;
19
18
  message: string;
19
+ customer_id: string;
20
20
  product_ids: string[];
21
21
  customer_data?: any;
22
22
  checkout_url?: string | undefined;
23
- } | CheckResult, AutumnError>>;
23
+ }, AutumnError>>;
24
24
  cancel: (params: CancelParams) => AutumnPromise<{
25
25
  customer_id: string;
26
- product_id: string;
27
26
  success: boolean;
27
+ product_id: string;
28
28
  }>;
29
29
  track: (params: TrackParams) => AutumnPromise<{
30
- customer_id: string;
31
30
  code: string;
32
31
  id: string;
32
+ customer_id: string;
33
33
  feature_id?: string | undefined;
34
34
  event_name?: string | undefined;
35
35
  }>;
@@ -1,4 +1,4 @@
1
- import { a as CheckParams, b as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, d as CancelParams, T as TrackParams } from '../clientAttachTypes-BBDJRxyt.js';
1
+ import { a as CheckParams, b as AutumnPromise, C as CheckResult, A as AttachParams, R as Result, d as CancelParams, T as TrackParams } from '../clientAttachTypes-D0_L-cnv.js';
2
2
  import { A as AutumnError } from '../error-DHbclCVh.js';
3
3
  import { G as GetEntityParams, E as Entity } from '../entTypes-C-7Uoct9.js';
4
4
  import { A as AllowedParams } from '../handleAllowed-B8TBAzfI.js';
@@ -13,23 +13,23 @@ declare const useEntity: (entityId: string | null, params?: GetEntityParams) =>
13
13
  refetch: swr.KeyedMutator<Entity | null>;
14
14
  allowed: (params: AllowedParams) => boolean;
15
15
  check: (params: CheckParams) => AutumnPromise<CheckResult>;
16
- attach: (params: AttachParams) => Promise<Result<{
17
- customer_id: string;
16
+ attach: (params: AttachParams) => Promise<Result<CheckResult | {
18
17
  code: string;
19
18
  message: string;
19
+ customer_id: string;
20
20
  product_ids: string[];
21
21
  customer_data?: any;
22
22
  checkout_url?: string | undefined;
23
- } | CheckResult, AutumnError>>;
23
+ }, AutumnError>>;
24
24
  cancel: (params: CancelParams) => AutumnPromise<{
25
25
  customer_id: string;
26
- product_id: string;
27
26
  success: boolean;
27
+ product_id: string;
28
28
  }>;
29
29
  track: (params: TrackParams) => AutumnPromise<{
30
- customer_id: string;
31
30
  code: string;
32
31
  id: string;
32
+ customer_id: string;
33
33
  feature_id?: string | undefined;
34
34
  event_name?: string | undefined;
35
35
  }>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.0.107",
4
+ "version": "0.0.108",
5
5
  "main": "./dist/sdk/index.js",
6
6
  "files": [
7
7
  "dist",
@@ -1,6 +1,3 @@
1
- import {
2
- addGenRoutes
3
- } from "./chunk-HHMIVOXX.mjs";
4
1
  import {
5
2
  addProductRoutes
6
3
  } from "./chunk-5EKNB4IJ.mjs";
@@ -10,6 +7,9 @@ import {
10
7
  import {
11
8
  addEntityRoutes
12
9
  } from "./chunk-K7JGEYUX.mjs";
10
+ import {
11
+ addGenRoutes
12
+ } from "./chunk-HHMIVOXX.mjs";
13
13
  import {
14
14
  withAuth
15
15
  } from "./chunk-5H6HVCOP.mjs";
@@ -1,5 +1,18 @@
1
1
  "use client";
2
2
 
3
+ import {
4
+ listProductsMethod
5
+ } from "./chunk-V575SGOW.mjs";
6
+ import {
7
+ createCode,
8
+ redeemCode
9
+ } from "./chunk-ZV4RPZTM.mjs";
10
+ import {
11
+ logAuthError
12
+ } from "./chunk-JVCOY7ZL.mjs";
13
+ import {
14
+ logFetchError
15
+ } from "./chunk-CIBQ4BJU.mjs";
3
16
  import {
4
17
  getPricingTableMethod
5
18
  } from "./chunk-VTGR7VVK.mjs";
@@ -20,19 +33,6 @@ import {
20
33
  setupPaymentMethod,
21
34
  trackMethod
22
35
  } from "./chunk-253MTZP3.mjs";
23
- import {
24
- listProductsMethod
25
- } from "./chunk-V575SGOW.mjs";
26
- import {
27
- createCode,
28
- redeemCode
29
- } from "./chunk-ZV4RPZTM.mjs";
30
- import {
31
- logAuthError
32
- } from "./chunk-JVCOY7ZL.mjs";
33
- import {
34
- logFetchError
35
- } from "./chunk-CIBQ4BJU.mjs";
36
36
 
37
37
  // src/sdk/error.ts
38
38
  var AutumnError = class _AutumnError extends Error {
@@ -5,11 +5,11 @@ declare const AttachFeatureOptionsSchema: z.ZodObject<{
5
5
  feature_id: z.ZodString;
6
6
  quantity: z.ZodNumber;
7
7
  }, "strip", z.ZodTypeAny, {
8
- feature_id: string;
9
8
  quantity: number;
10
- }, {
11
9
  feature_id: string;
10
+ }, {
12
11
  quantity: number;
12
+ feature_id: string;
13
13
  }>;
14
14
  type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
15
15
  declare const AttachResultSchema: z.ZodObject<{
@@ -24,15 +24,15 @@ declare const AttachResultSchema: z.ZodObject<{
24
24
  message: string;
25
25
  customer_id: string;
26
26
  product_ids: string[];
27
- customer_data?: any;
28
27
  checkout_url?: string | undefined;
28
+ customer_data?: any;
29
29
  }, {
30
30
  code: string;
31
31
  message: string;
32
32
  customer_id: string;
33
33
  product_ids: string[];
34
- customer_data?: any;
35
34
  checkout_url?: string | undefined;
35
+ customer_data?: any;
36
36
  }>;
37
37
  type AttachResult = z.infer<typeof AttachResultSchema>;
38
38
  type CheckoutResult = {
@@ -5,11 +5,11 @@ declare const AttachFeatureOptionsSchema: z.ZodObject<{
5
5
  feature_id: z.ZodString;
6
6
  quantity: z.ZodNumber;
7
7
  }, "strip", z.ZodTypeAny, {
8
- feature_id: string;
9
8
  quantity: number;
10
- }, {
11
9
  feature_id: string;
10
+ }, {
12
11
  quantity: number;
12
+ feature_id: string;
13
13
  }>;
14
14
  type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
15
15
  declare const AttachResultSchema: z.ZodObject<{
@@ -24,15 +24,15 @@ declare const AttachResultSchema: z.ZodObject<{
24
24
  message: string;
25
25
  customer_id: string;
26
26
  product_ids: string[];
27
- customer_data?: any;
28
27
  checkout_url?: string | undefined;
28
+ customer_data?: any;
29
29
  }, {
30
30
  code: string;
31
31
  message: string;
32
32
  customer_id: string;
33
33
  product_ids: string[];
34
- customer_data?: any;
35
34
  checkout_url?: string | undefined;
35
+ customer_data?: any;
36
36
  }>;
37
37
  type AttachResult = z.infer<typeof AttachResultSchema>;
38
38
  type CheckoutResult = {
@@ -8,12 +8,12 @@ declare const CancelResultSchema: z.ZodObject<{
8
8
  product_id: z.ZodString;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  customer_id: string;
11
- product_id: string;
12
11
  success: boolean;
12
+ product_id: string;
13
13
  }, {
14
14
  customer_id: string;
15
- product_id: string;
16
15
  success: boolean;
16
+ product_id: string;
17
17
  }>;
18
18
  type CancelResult = z.infer<typeof CancelResultSchema>;
19
19
  declare const TrackResultSchema: z.ZodObject<{
@@ -24,14 +24,14 @@ declare const TrackResultSchema: z.ZodObject<{
24
24
  event_name: z.ZodOptional<z.ZodString>;
25
25
  }, "strip", z.ZodTypeAny, {
26
26
  code: string;
27
- customer_id: string;
28
27
  id: string;
28
+ customer_id: string;
29
29
  feature_id?: string | undefined;
30
30
  event_name?: string | undefined;
31
31
  }, {
32
32
  code: string;
33
- customer_id: string;
34
33
  id: string;
34
+ customer_id: string;
35
35
  feature_id?: string | undefined;
36
36
  event_name?: string | undefined;
37
37
  }>;
@@ -82,20 +82,20 @@ declare const CheckParamsSchema: z.ZodObject<{
82
82
  productId?: string | undefined;
83
83
  entityId?: string | undefined;
84
84
  featureId?: string | undefined;
85
+ dialog?: any;
86
+ entityData?: any;
85
87
  requiredBalance?: number | undefined;
86
88
  sendEvent?: boolean | undefined;
87
89
  withPreview?: boolean | undefined;
88
- dialog?: any;
89
- entityData?: any;
90
90
  }, {
91
91
  productId?: string | undefined;
92
92
  entityId?: string | undefined;
93
93
  featureId?: string | undefined;
94
+ dialog?: any;
95
+ entityData?: any;
94
96
  requiredBalance?: number | undefined;
95
97
  sendEvent?: boolean | undefined;
96
98
  withPreview?: boolean | undefined;
97
- dialog?: any;
98
- entityData?: any;
99
99
  }>;
100
100
  type CheckParams = z.infer<typeof CheckParamsSchema>;
101
101
  declare const TrackParamsSchema: z.ZodObject<{
@@ -138,11 +138,11 @@ declare const AttachParamsSchema: z.ZodObject<{
138
138
  featureId: z.ZodString;
139
139
  quantity: z.ZodNumber;
140
140
  }, "strip", z.ZodTypeAny, {
141
- quantity: number;
142
141
  featureId: string;
143
- }, {
144
142
  quantity: number;
143
+ }, {
145
144
  featureId: string;
145
+ quantity: number;
146
146
  }>, "many">>;
147
147
  productIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
148
148
  freeTrial: z.ZodOptional<z.ZodBoolean>;
@@ -159,37 +159,37 @@ declare const AttachParamsSchema: z.ZodObject<{
159
159
  checkoutSessionParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
160
160
  }, "strip", z.ZodTypeAny, {
161
161
  options?: {
162
- quantity: number;
163
162
  featureId: string;
163
+ quantity: number;
164
164
  }[] | undefined;
165
165
  metadata?: Record<string, string> | undefined;
166
- reward?: string | undefined;
167
166
  productId?: string | undefined;
168
167
  entityId?: string | undefined;
169
- dialog?: any;
170
- entityData?: any;
171
168
  productIds?: string[] | undefined;
172
169
  freeTrial?: boolean | undefined;
173
170
  successUrl?: string | undefined;
174
171
  forceCheckout?: boolean | undefined;
172
+ dialog?: any;
173
+ entityData?: any;
175
174
  openInNewTab?: boolean | undefined;
175
+ reward?: string | undefined;
176
176
  checkoutSessionParams?: Record<string, any> | undefined;
177
177
  }, {
178
178
  options?: {
179
- quantity: number;
180
179
  featureId: string;
180
+ quantity: number;
181
181
  }[] | undefined;
182
182
  metadata?: Record<string, string> | undefined;
183
- reward?: string | undefined;
184
183
  productId?: string | undefined;
185
184
  entityId?: string | undefined;
186
- dialog?: any;
187
- entityData?: any;
188
185
  productIds?: string[] | undefined;
189
186
  freeTrial?: boolean | undefined;
190
187
  successUrl?: string | undefined;
191
188
  forceCheckout?: boolean | undefined;
189
+ dialog?: any;
190
+ entityData?: any;
192
191
  openInNewTab?: boolean | undefined;
192
+ reward?: string | undefined;
193
193
  checkoutSessionParams?: Record<string, any> | undefined;
194
194
  }>;
195
195
  type AttachParams = z.infer<typeof AttachParamsSchema>;
@@ -200,11 +200,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
200
200
  featureId: z.ZodString;
201
201
  quantity: z.ZodNumber;
202
202
  }, "strip", z.ZodTypeAny, {
203
- quantity: number;
204
203
  featureId: string;
205
- }, {
206
204
  quantity: number;
205
+ }, {
207
206
  featureId: string;
207
+ quantity: number;
208
208
  }>, "many">>;
209
209
  successUrl: z.ZodOptional<z.ZodString>;
210
210
  openInNewTab: z.ZodOptional<z.ZodBoolean>;
@@ -212,22 +212,22 @@ declare const CheckoutParamsSchema: z.ZodObject<{
212
212
  }, "strip", z.ZodTypeAny, {
213
213
  productId: string;
214
214
  options?: {
215
- quantity: number;
216
215
  featureId: string;
216
+ quantity: number;
217
217
  }[] | undefined;
218
218
  entityId?: string | undefined;
219
- dialog?: any;
220
219
  successUrl?: string | undefined;
220
+ dialog?: any;
221
221
  openInNewTab?: boolean | undefined;
222
222
  }, {
223
223
  productId: string;
224
224
  options?: {
225
- quantity: number;
226
225
  featureId: string;
226
+ quantity: number;
227
227
  }[] | undefined;
228
228
  entityId?: string | undefined;
229
- dialog?: any;
230
229
  successUrl?: string | undefined;
230
+ dialog?: any;
231
231
  openInNewTab?: boolean | undefined;
232
232
  }>;
233
233
  type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;
@@ -8,12 +8,12 @@ declare const CancelResultSchema: z.ZodObject<{
8
8
  product_id: z.ZodString;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  customer_id: string;
11
- product_id: string;
12
11
  success: boolean;
12
+ product_id: string;
13
13
  }, {
14
14
  customer_id: string;
15
- product_id: string;
16
15
  success: boolean;
16
+ product_id: string;
17
17
  }>;
18
18
  type CancelResult = z.infer<typeof CancelResultSchema>;
19
19
  declare const TrackResultSchema: z.ZodObject<{
@@ -24,14 +24,14 @@ declare const TrackResultSchema: z.ZodObject<{
24
24
  event_name: z.ZodOptional<z.ZodString>;
25
25
  }, "strip", z.ZodTypeAny, {
26
26
  code: string;
27
- customer_id: string;
28
27
  id: string;
28
+ customer_id: string;
29
29
  feature_id?: string | undefined;
30
30
  event_name?: string | undefined;
31
31
  }, {
32
32
  code: string;
33
- customer_id: string;
34
33
  id: string;
34
+ customer_id: string;
35
35
  feature_id?: string | undefined;
36
36
  event_name?: string | undefined;
37
37
  }>;
@@ -82,20 +82,20 @@ declare const CheckParamsSchema: z.ZodObject<{
82
82
  productId?: string | undefined;
83
83
  entityId?: string | undefined;
84
84
  featureId?: string | undefined;
85
+ dialog?: any;
86
+ entityData?: any;
85
87
  requiredBalance?: number | undefined;
86
88
  sendEvent?: boolean | undefined;
87
89
  withPreview?: boolean | undefined;
88
- dialog?: any;
89
- entityData?: any;
90
90
  }, {
91
91
  productId?: string | undefined;
92
92
  entityId?: string | undefined;
93
93
  featureId?: string | undefined;
94
+ dialog?: any;
95
+ entityData?: any;
94
96
  requiredBalance?: number | undefined;
95
97
  sendEvent?: boolean | undefined;
96
98
  withPreview?: boolean | undefined;
97
- dialog?: any;
98
- entityData?: any;
99
99
  }>;
100
100
  type CheckParams = z.infer<typeof CheckParamsSchema>;
101
101
  declare const TrackParamsSchema: z.ZodObject<{
@@ -138,11 +138,11 @@ declare const AttachParamsSchema: z.ZodObject<{
138
138
  featureId: z.ZodString;
139
139
  quantity: z.ZodNumber;
140
140
  }, "strip", z.ZodTypeAny, {
141
- quantity: number;
142
141
  featureId: string;
143
- }, {
144
142
  quantity: number;
143
+ }, {
145
144
  featureId: string;
145
+ quantity: number;
146
146
  }>, "many">>;
147
147
  productIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
148
148
  freeTrial: z.ZodOptional<z.ZodBoolean>;
@@ -159,37 +159,37 @@ declare const AttachParamsSchema: z.ZodObject<{
159
159
  checkoutSessionParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
160
160
  }, "strip", z.ZodTypeAny, {
161
161
  options?: {
162
- quantity: number;
163
162
  featureId: string;
163
+ quantity: number;
164
164
  }[] | undefined;
165
165
  metadata?: Record<string, string> | undefined;
166
- reward?: string | undefined;
167
166
  productId?: string | undefined;
168
167
  entityId?: string | undefined;
169
- dialog?: any;
170
- entityData?: any;
171
168
  productIds?: string[] | undefined;
172
169
  freeTrial?: boolean | undefined;
173
170
  successUrl?: string | undefined;
174
171
  forceCheckout?: boolean | undefined;
172
+ dialog?: any;
173
+ entityData?: any;
175
174
  openInNewTab?: boolean | undefined;
175
+ reward?: string | undefined;
176
176
  checkoutSessionParams?: Record<string, any> | undefined;
177
177
  }, {
178
178
  options?: {
179
- quantity: number;
180
179
  featureId: string;
180
+ quantity: number;
181
181
  }[] | undefined;
182
182
  metadata?: Record<string, string> | undefined;
183
- reward?: string | undefined;
184
183
  productId?: string | undefined;
185
184
  entityId?: string | undefined;
186
- dialog?: any;
187
- entityData?: any;
188
185
  productIds?: string[] | undefined;
189
186
  freeTrial?: boolean | undefined;
190
187
  successUrl?: string | undefined;
191
188
  forceCheckout?: boolean | undefined;
189
+ dialog?: any;
190
+ entityData?: any;
192
191
  openInNewTab?: boolean | undefined;
192
+ reward?: string | undefined;
193
193
  checkoutSessionParams?: Record<string, any> | undefined;
194
194
  }>;
195
195
  type AttachParams = z.infer<typeof AttachParamsSchema>;
@@ -200,11 +200,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
200
200
  featureId: z.ZodString;
201
201
  quantity: z.ZodNumber;
202
202
  }, "strip", z.ZodTypeAny, {
203
- quantity: number;
204
203
  featureId: string;
205
- }, {
206
204
  quantity: number;
205
+ }, {
207
206
  featureId: string;
207
+ quantity: number;
208
208
  }>, "many">>;
209
209
  successUrl: z.ZodOptional<z.ZodString>;
210
210
  openInNewTab: z.ZodOptional<z.ZodBoolean>;
@@ -212,22 +212,22 @@ declare const CheckoutParamsSchema: z.ZodObject<{
212
212
  }, "strip", z.ZodTypeAny, {
213
213
  productId: string;
214
214
  options?: {
215
- quantity: number;
216
215
  featureId: string;
216
+ quantity: number;
217
217
  }[] | undefined;
218
218
  entityId?: string | undefined;
219
- dialog?: any;
220
219
  successUrl?: string | undefined;
220
+ dialog?: any;
221
221
  openInNewTab?: boolean | undefined;
222
222
  }, {
223
223
  productId: string;
224
224
  options?: {
225
- quantity: number;
226
225
  featureId: string;
226
+ quantity: number;
227
227
  }[] | undefined;
228
228
  entityId?: string | undefined;
229
- dialog?: any;
230
229
  successUrl?: string | undefined;
230
+ dialog?: any;
231
231
  openInNewTab?: boolean | undefined;
232
232
  }>;
233
233
  type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;