autumn-js 0.1.46 → 0.1.48

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 (139) hide show
  1. package/dist/libraries/backend/better-auth.mjs +3 -3
  2. package/dist/libraries/backend/convex.mjs +3 -3
  3. package/dist/libraries/backend/elysia.mjs +3 -3
  4. package/dist/libraries/backend/express.mjs +3 -3
  5. package/dist/libraries/backend/fastify.mjs +3 -3
  6. package/dist/libraries/backend/hono.mjs +3 -3
  7. package/dist/libraries/backend/index.mjs +3 -3
  8. package/dist/libraries/backend/next.mjs +3 -3
  9. package/dist/libraries/backend/react-router.mjs +3 -3
  10. package/dist/libraries/backend/remix_dep.mjs +3 -3
  11. package/dist/libraries/backend/routes/backendRouter.mjs +3 -3
  12. package/dist/libraries/backend/supabase.mjs +3 -3
  13. package/dist/libraries/backend/tanstack.mjs +3 -3
  14. package/dist/libraries/react/AutumnContext.d.mts +2 -2
  15. package/dist/libraries/react/AutumnContext.d.ts +2 -2
  16. package/dist/libraries/react/AutumnContext.mjs +3 -3
  17. package/dist/libraries/react/BaseAutumnProvider.d.mts +3 -4
  18. package/dist/libraries/react/BaseAutumnProvider.d.ts +3 -4
  19. package/dist/libraries/react/BaseAutumnProvider.js +1 -1
  20. package/dist/libraries/react/BaseAutumnProvider.mjs +6 -6
  21. package/dist/libraries/react/{ReactAutumnClient-BKD0cnO7.d.mts → ReactAutumnClient-BJDtE2am.d.mts} +15 -2
  22. package/dist/libraries/react/{ReactAutumnClient-DUrXdDH1.d.ts → ReactAutumnClient-CbVApkWG.d.ts} +15 -2
  23. package/dist/libraries/react/ReactAutumnProvider.d.mts +3 -3
  24. package/dist/libraries/react/ReactAutumnProvider.d.ts +3 -3
  25. package/dist/libraries/react/ReactAutumnProvider.js +8 -7
  26. package/dist/libraries/react/ReactAutumnProvider.mjs +8 -8
  27. package/dist/libraries/react/{chunk-UCIY5MTL.mjs → chunk-32BXVAYB.mjs} +7 -6
  28. package/dist/libraries/react/{chunk-X2GXNTVV.mjs → chunk-4CVRCTEQ.mjs} +1 -1
  29. package/dist/libraries/react/{chunk-5F2PN2U7.mjs → chunk-4XXJ4V7H.mjs} +1 -1
  30. package/dist/libraries/react/{chunk-YO4NMHA4.mjs → chunk-5HXYQHAH.mjs} +4 -4
  31. package/dist/libraries/react/{chunk-GQFGQMVJ.mjs → chunk-DOFQBXNO.mjs} +2 -2
  32. package/dist/libraries/react/{chunk-3Z4DD3GF.mjs → chunk-KBAOWIBN.mjs} +1 -1
  33. package/dist/libraries/react/{chunk-C64U4AIA.mjs → chunk-KDWU3NXR.mjs} +2 -2
  34. package/dist/libraries/react/{chunk-NUEHHCMZ.mjs → chunk-POGRWGHO.mjs} +2 -2
  35. package/dist/libraries/react/{chunk-7QY4UVZ4.mjs → chunk-RLUPTZ2E.mjs} +1 -1
  36. package/dist/libraries/react/{chunk-N7Z76MFX.mjs → chunk-TFTS75VA.mjs} +2 -2
  37. package/dist/libraries/react/{chunk-CBXUYF7A.mjs → chunk-V4RYP3EY.mjs} +1 -1
  38. package/dist/libraries/react/{chunk-SXPVDYPW.mjs → chunk-XCKJBGJ3.mjs} +1 -1
  39. package/dist/libraries/react/{chunk-BRKWC2LL.mjs → chunk-XJ3IEXOB.mjs} +16 -16
  40. package/dist/libraries/react/client/ConvexAutumnClient.d.mts +2 -2
  41. package/dist/libraries/react/client/ConvexAutumnClient.d.ts +2 -2
  42. package/dist/libraries/react/client/ConvexAutumnClient.js +7 -6
  43. package/dist/libraries/react/client/ConvexAutumnClient.mjs +1 -1
  44. package/dist/libraries/react/client/ReactAutumnClient.d.mts +2 -2
  45. package/dist/libraries/react/client/ReactAutumnClient.d.ts +2 -2
  46. package/dist/libraries/react/client/ReactAutumnClient.mjs +2 -2
  47. package/dist/libraries/react/client/clientCompMethods.d.mts +2 -2
  48. package/dist/libraries/react/client/clientCompMethods.d.ts +2 -2
  49. package/dist/libraries/react/client/clientCusMethods.d.mts +2 -2
  50. package/dist/libraries/react/client/clientCusMethods.d.ts +2 -2
  51. package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -4
  52. package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -4
  53. package/dist/libraries/react/client/clientGenMethods.d.mts +2 -2
  54. package/dist/libraries/react/client/clientGenMethods.d.ts +2 -2
  55. package/dist/libraries/react/client/clientProdMethods.d.mts +4 -4
  56. package/dist/libraries/react/client/clientProdMethods.d.ts +4 -4
  57. package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -4
  58. package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -4
  59. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +3 -4
  60. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +3 -4
  61. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +1 -1
  62. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +20 -20
  63. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +3 -3
  64. package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +3 -3
  65. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.d.mts +2 -2
  66. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.d.ts +2 -2
  67. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +20 -20
  68. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +2 -2
  69. package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +2 -2
  70. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +6 -7
  71. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +6 -7
  72. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +1 -1
  73. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +20 -20
  74. package/dist/libraries/react/components/ui/button.d.mts +4 -7
  75. package/dist/libraries/react/components/ui/button.d.ts +4 -7
  76. package/dist/libraries/react/components/ui/dialog.d.mts +3 -4
  77. package/dist/libraries/react/components/ui/dialog.d.ts +3 -4
  78. package/dist/libraries/react/components/ui/popover.mjs +2 -2
  79. package/dist/libraries/react/entTypes-CiODXSok.d.ts +17 -0
  80. package/dist/libraries/react/entTypes-SfJb3hb2.d.mts +17 -0
  81. package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +2 -2
  82. package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +2 -2
  83. package/dist/libraries/react/hooks/helpers/handleCheck.js +1 -1
  84. package/dist/libraries/react/hooks/helpers/handleCheck.mjs +1 -1
  85. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +3 -3
  86. package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +3 -3
  87. package/dist/libraries/react/hooks/useAnalytics.mjs +4 -4
  88. package/dist/libraries/react/hooks/useCustomer.d.mts +2 -2
  89. package/dist/libraries/react/hooks/useCustomer.d.ts +2 -2
  90. package/dist/libraries/react/hooks/useCustomer.js +1 -1
  91. package/dist/libraries/react/hooks/useCustomer.mjs +6 -6
  92. package/dist/libraries/react/hooks/useCustomerBase.d.mts +2 -2
  93. package/dist/libraries/react/hooks/useCustomerBase.d.ts +2 -2
  94. package/dist/libraries/react/hooks/useCustomerBase.js +1 -1
  95. package/dist/libraries/react/hooks/useCustomerBase.mjs +5 -5
  96. package/dist/libraries/react/hooks/useEntity.d.mts +10 -18
  97. package/dist/libraries/react/hooks/useEntity.d.ts +10 -18
  98. package/dist/libraries/react/hooks/useEntity.js +1 -1
  99. package/dist/libraries/react/hooks/useEntity.mjs +6 -6
  100. package/dist/libraries/react/hooks/useEntityBase.d.mts +14 -22
  101. package/dist/libraries/react/hooks/useEntityBase.d.ts +14 -22
  102. package/dist/libraries/react/hooks/useEntityBase.js +1 -1
  103. package/dist/libraries/react/hooks/useEntityBase.mjs +5 -5
  104. package/dist/libraries/react/hooks/usePaywall.mjs +4 -4
  105. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -2
  106. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -2
  107. package/dist/libraries/react/hooks/usePricingTable.mjs +4 -4
  108. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +3 -4
  109. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +3 -4
  110. package/dist/libraries/react/hooks/useProductsBase.d.mts +2 -2
  111. package/dist/libraries/react/hooks/useProductsBase.d.ts +2 -2
  112. package/dist/libraries/react/index.d.mts +14 -21
  113. package/dist/libraries/react/index.d.ts +14 -21
  114. package/dist/libraries/react/index.js +8 -7
  115. package/dist/libraries/react/index.mjs +8 -7
  116. package/dist/next/AutumnProvider.d.mts +2 -2
  117. package/dist/next/AutumnProvider.d.ts +2 -2
  118. package/dist/next/client/NextAutumnClient.d.mts +2 -1
  119. package/dist/next/client/NextAutumnClient.d.ts +2 -1
  120. package/dist/next/client/NextAutumnProvider.d.mts +2 -2
  121. package/dist/next/client/NextAutumnProvider.d.ts +2 -2
  122. package/dist/next/client/{clientAttachTypes-B6sYxDWl.d.ts → clientAttachTypes-BEgqHiPe.d.ts} +1 -15
  123. package/dist/next/client/{clientAttachTypes-BOJD2U3t.d.mts → clientAttachTypes-Bii5Xkzu.d.mts} +1 -15
  124. package/dist/next/client/hooks/useAutumn.d.mts +2 -1
  125. package/dist/next/client/hooks/useAutumn.d.ts +2 -1
  126. package/dist/next/client/hooks/useCustomer.d.mts +2 -1
  127. package/dist/next/client/hooks/useCustomer.d.ts +2 -1
  128. package/dist/next/client/hooks/useEntity.d.mts +10 -18
  129. package/dist/next/client/hooks/useEntity.d.ts +10 -18
  130. package/dist/next/client/hooks/usePricingTable.d.mts +1 -2
  131. package/dist/next/client/hooks/usePricingTable.d.ts +1 -2
  132. package/dist/next/client/response-CLgEplsF.d.ts +16 -0
  133. package/dist/next/client/response-DKQ_cb7U.d.mts +16 -0
  134. package/package.json +1 -1
  135. package/dist/libraries/react/entTypes-35x0LnYH.d.mts +0 -31
  136. package/dist/libraries/react/entTypes-n2T2wpRx.d.ts +0 -31
  137. package/dist/libraries/backend/{chunk-VN6I3CJR.mjs → chunk-56DMVCCC.mjs} +6 -6
  138. package/dist/libraries/react/{chunk-MM4LTFTB.mjs → chunk-AHFPBGNV.mjs} +3 -3
  139. package/dist/libraries/react/{chunk-TD4GS7JB.mjs → chunk-IXIFYTKC.mjs} +3 -3
@@ -1091,7 +1091,7 @@ var handleProductCheck = ({
1091
1091
  params
1092
1092
  }) => {
1093
1093
  let product = customer.products.find((p) => p.id == params.productId);
1094
- let allowed = product?.status === "active";
1094
+ let allowed = product?.status === "active" || product?.status === "trialing";
1095
1095
  let result = {
1096
1096
  allowed,
1097
1097
  customer_id: isEntity ? customer.customer_id : customer.id,
@@ -2103,7 +2103,7 @@ var ConvexAutumnClient = class {
2103
2103
  // Core methods that wrap Convex actions
2104
2104
  attach = async (args) => {
2105
2105
  try {
2106
- const { dialog, ...backendArgs } = args;
2106
+ const { dialog, openInNewTab, ...backendArgs } = args;
2107
2107
  const result = await this.convex.action(
2108
2108
  this.convexApi.attach,
2109
2109
  backendArgs
@@ -2121,7 +2121,7 @@ var ConvexAutumnClient = class {
2121
2121
  };
2122
2122
  checkout = async (args) => {
2123
2123
  try {
2124
- const { dialog, ...backendArgs } = args;
2124
+ const { dialog, openInNewTab, ...backendArgs } = args;
2125
2125
  const result = await this.convex.action(
2126
2126
  this.convexApi.checkout,
2127
2127
  backendArgs
@@ -2181,10 +2181,11 @@ var ConvexAutumnClient = class {
2181
2181
  };
2182
2182
  openBillingPortal = async (args) => {
2183
2183
  try {
2184
- const result = await this.convex.action(this.convexApi.billingPortal, {
2185
- ...args,
2186
- openInNewTab: void 0
2187
- });
2184
+ const { openInNewTab, ...backendArgs } = args;
2185
+ const result = await this.convex.action(
2186
+ this.convexApi.billingPortal,
2187
+ backendArgs
2188
+ );
2188
2189
  return result;
2189
2190
  } catch (error) {
2190
2191
  return {
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { z } from 'zod/v4';
2
+ import React from 'react';
3
3
 
4
4
  declare const CustomerDataSchema: z.ZodObject<{
5
5
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -25,6 +25,6 @@ interface AutumnProviderProps {
25
25
  children?: React.ReactNode;
26
26
  defaultReturnUrl?: string;
27
27
  }
28
- declare const AutumnProvider: ({ customerId, customerData, authPlugin, children, defaultReturnUrl, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
28
+ declare const AutumnProvider: ({ customerId, customerData, authPlugin, children, defaultReturnUrl, }: AutumnProviderProps) => React.JSX.Element;
29
29
 
30
30
  export { AutumnProvider };
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { z } from 'zod/v4';
2
+ import React from 'react';
3
3
 
4
4
  declare const CustomerDataSchema: z.ZodObject<{
5
5
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -25,6 +25,6 @@ interface AutumnProviderProps {
25
25
  children?: React.ReactNode;
26
26
  defaultReturnUrl?: string;
27
27
  }
28
- declare const AutumnProvider: ({ customerId, customerData, authPlugin, children, defaultReturnUrl, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
28
+ declare const AutumnProvider: ({ customerId, customerData, authPlugin, children, defaultReturnUrl, }: AutumnProviderProps) => React.JSX.Element;
29
29
 
30
30
  export { AutumnProvider };
@@ -1,5 +1,6 @@
1
- import { a as AutumnPromise, R as Result, g as CheckResult, d as SetupPaymentResult, Q as QueryResult, A as AttachParams, C as CancelParams, c as CancelResult, f as CheckParams, T as TrackParams, b as TrackResult, O as OpenBillingPortalParams } from './clientAttachTypes-BOJD2U3t.mjs';
1
+ import { f as CheckResult, c as SetupPaymentResult, Q as QueryResult, A as AttachParams, C as CancelParams, b as CancelResult, e as CheckParams, T as TrackParams, a as TrackResult, O as OpenBillingPortalParams } from './clientAttachTypes-Bii5Xkzu.mjs';
2
2
  import { C as CheckoutResult, a as CreateReferralCodeResult, R as RedeemReferralCodeResult, A as AttachResult, b as CreateEntityParams, G as GetEntityParams } from './clientEntTypes-aLfa3lyP.mjs';
3
+ import { A as AutumnPromise, R as Result } from './response-DKQ_cb7U.mjs';
3
4
  import { C as CustomerData, b as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-CXjHwB-c.mjs';
4
5
  import { E as Entity, D as DeleteEntityResult } from './entTypes-BkN-Puru.mjs';
5
6
  import { A as AutumnError } from './error-DHbclCVh.mjs';
@@ -1,5 +1,6 @@
1
- import { a as AutumnPromise, R as Result, g as CheckResult, d as SetupPaymentResult, Q as QueryResult, A as AttachParams, C as CancelParams, c as CancelResult, f as CheckParams, T as TrackParams, b as TrackResult, O as OpenBillingPortalParams } from './clientAttachTypes-B6sYxDWl.js';
1
+ import { f as CheckResult, c as SetupPaymentResult, Q as QueryResult, A as AttachParams, C as CancelParams, b as CancelResult, e as CheckParams, T as TrackParams, a as TrackResult, O as OpenBillingPortalParams } from './clientAttachTypes-BEgqHiPe.js';
2
2
  import { C as CheckoutResult, a as CreateReferralCodeResult, R as RedeemReferralCodeResult, A as AttachResult, b as CreateEntityParams, G as GetEntityParams } from './clientEntTypes-Bsi7ciUF.js';
3
+ import { A as AutumnPromise, R as Result } from './response-CLgEplsF.js';
3
4
  import { C as CustomerData, b as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-B-rJwpui.js';
4
5
  import { E as Entity, D as DeleteEntityResult } from './entTypes-DjKFS-Zk.js';
5
6
  import { A as AutumnError } from './error-DHbclCVh.js';
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import { C as CustomerData } from './cusTypes-CXjHwB-c.mjs';
3
3
  import './prodTypes-B_VMILpU.mjs';
4
4
  import 'zod/v4';
@@ -8,6 +8,6 @@ declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children
8
8
  customerData?: CustomerData;
9
9
  children: React.ReactNode;
10
10
  defaultReturnUrl?: string;
11
- }) => react_jsx_runtime.JSX.Element;
11
+ }) => React.JSX.Element;
12
12
 
13
13
  export { NextAutumnProvider };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import { C as CustomerData } from './cusTypes-B-rJwpui.js';
3
3
  import './prodTypes-B_VMILpU.js';
4
4
  import 'zod/v4';
@@ -8,6 +8,6 @@ declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children
8
8
  customerData?: CustomerData;
9
9
  children: React.ReactNode;
10
10
  defaultReturnUrl?: string;
11
- }) => react_jsx_runtime.JSX.Element;
11
+ }) => React.JSX.Element;
12
12
 
13
13
  export { NextAutumnProvider };
@@ -1,6 +1,5 @@
1
1
  import { C as CheckFeatureResult, c as CheckProductResult } from './prodTypes-B_VMILpU.js';
2
2
  import { z } from 'zod/v4';
3
- import { A as AutumnError } from './error-DHbclCVh.js';
4
3
 
5
4
  declare const CancelResultSchema: z.ZodObject<{
6
5
  success: z.ZodBoolean;
@@ -29,19 +28,6 @@ type QueryResult = {
29
28
  }>;
30
29
  };
31
30
 
32
- type Success<T> = {
33
- data: T;
34
- error: null;
35
- statusCode?: number;
36
- };
37
- type Failure<E> = {
38
- data: null;
39
- error: E;
40
- statusCode?: number;
41
- };
42
- type Result<T, E> = Success<T> | Failure<E>;
43
- type AutumnPromise<T> = Promise<Result<T, AutumnError>>;
44
-
45
31
  declare const CancelParamsSchema: z.ZodObject<{
46
32
  productId: z.ZodString;
47
33
  entityId: z.ZodOptional<z.ZodString>;
@@ -119,4 +105,4 @@ declare const CheckoutParamsSchema: z.ZodObject<{
119
105
  }, z.core.$strip>;
120
106
  type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;
121
107
 
122
- export type { AttachParams as A, CancelParams as C, OpenBillingPortalParams as O, QueryResult as Q, Result as R, SetupPaymentParams as S, TrackParams as T, AutumnPromise as a, TrackResult as b, CancelResult as c, SetupPaymentResult as d, CheckoutParams as e, CheckParams as f, CheckResult as g, Success as h };
108
+ export type { AttachParams as A, CancelParams as C, OpenBillingPortalParams as O, QueryResult as Q, SetupPaymentParams as S, TrackParams as T, TrackResult as a, CancelResult as b, SetupPaymentResult as c, CheckoutParams as d, CheckParams as e, CheckResult as f };
@@ -1,6 +1,5 @@
1
1
  import { C as CheckFeatureResult, c as CheckProductResult } from './prodTypes-B_VMILpU.mjs';
2
2
  import { z } from 'zod/v4';
3
- import { A as AutumnError } from './error-DHbclCVh.mjs';
4
3
 
5
4
  declare const CancelResultSchema: z.ZodObject<{
6
5
  success: z.ZodBoolean;
@@ -29,19 +28,6 @@ type QueryResult = {
29
28
  }>;
30
29
  };
31
30
 
32
- type Success<T> = {
33
- data: T;
34
- error: null;
35
- statusCode?: number;
36
- };
37
- type Failure<E> = {
38
- data: null;
39
- error: E;
40
- statusCode?: number;
41
- };
42
- type Result<T, E> = Success<T> | Failure<E>;
43
- type AutumnPromise<T> = Promise<Result<T, AutumnError>>;
44
-
45
31
  declare const CancelParamsSchema: z.ZodObject<{
46
32
  productId: z.ZodString;
47
33
  entityId: z.ZodOptional<z.ZodString>;
@@ -119,4 +105,4 @@ declare const CheckoutParamsSchema: z.ZodObject<{
119
105
  }, z.core.$strip>;
120
106
  type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;
121
107
 
122
- export type { AttachParams as A, CancelParams as C, OpenBillingPortalParams as O, QueryResult as Q, Result as R, SetupPaymentParams as S, TrackParams as T, AutumnPromise as a, TrackResult as b, CancelResult as c, SetupPaymentResult as d, CheckoutParams as e, CheckParams as f, CheckResult as g, Success as h };
108
+ export type { AttachParams as A, CancelParams as C, OpenBillingPortalParams as O, QueryResult as Q, SetupPaymentParams as S, TrackParams as T, TrackResult as a, CancelResult as b, SetupPaymentResult as c, CheckoutParams as d, CheckParams as e, CheckResult as f };
@@ -1,4 +1,5 @@
1
- import { A as AttachParams, T as TrackParams, a as AutumnPromise, b as TrackResult, C as CancelParams, c as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, d as SetupPaymentResult, e as CheckoutParams } from '../clientAttachTypes-BOJD2U3t.mjs';
1
+ import { A as AttachParams, T as TrackParams, a as TrackResult, C as CancelParams, b as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, c as SetupPaymentResult, d as CheckoutParams } from '../clientAttachTypes-Bii5Xkzu.mjs';
2
+ import { A as AutumnPromise } from '../response-DKQ_cb7U.mjs';
2
3
  import { B as BillingPortalResult } from '../cusTypes-CXjHwB-c.mjs';
3
4
  import '../prodTypes-B_VMILpU.mjs';
4
5
  import 'zod/v4';
@@ -1,4 +1,5 @@
1
- import { A as AttachParams, T as TrackParams, a as AutumnPromise, b as TrackResult, C as CancelParams, c as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, d as SetupPaymentResult, e as CheckoutParams } from '../clientAttachTypes-B6sYxDWl.js';
1
+ import { A as AttachParams, T as TrackParams, a as TrackResult, C as CancelParams, b as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, c as SetupPaymentResult, d as CheckoutParams } from '../clientAttachTypes-BEgqHiPe.js';
2
+ import { A as AutumnPromise } from '../response-CLgEplsF.js';
2
3
  import { B as BillingPortalResult } from '../cusTypes-B-rJwpui.js';
3
4
  import '../prodTypes-B_VMILpU.js';
4
5
  import 'zod/v4';
@@ -1,6 +1,7 @@
1
1
  import { A as AutumnError } from '../error-DHbclCVh.mjs';
2
- import { A as AttachParams, a as AutumnPromise, g as CheckResult, T as TrackParams, b as TrackResult, C as CancelParams, c as CancelResult, S as SetupPaymentParams, d as SetupPaymentResult, O as OpenBillingPortalParams, e as CheckoutParams, f as CheckParams, h as Success } from '../clientAttachTypes-BOJD2U3t.mjs';
2
+ import { A as AttachParams, f as CheckResult, T as TrackParams, a as TrackResult, C as CancelParams, b as CancelResult, S as SetupPaymentParams, c as SetupPaymentResult, O as OpenBillingPortalParams, d as CheckoutParams, e as CheckParams } from '../clientAttachTypes-Bii5Xkzu.mjs';
3
3
  import { A as AttachResult, C as CheckoutResult, b as CreateEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../clientEntTypes-aLfa3lyP.mjs';
4
+ import { A as AutumnPromise, S as Success } from '../response-DKQ_cb7U.mjs';
4
5
  import { f as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-CXjHwB-c.mjs';
5
6
  import { E as Entity } from '../entTypes-BkN-Puru.mjs';
6
7
  import { SWRConfiguration } from 'swr';
@@ -1,6 +1,7 @@
1
1
  import { A as AutumnError } from '../error-DHbclCVh.js';
2
- import { A as AttachParams, a as AutumnPromise, g as CheckResult, T as TrackParams, b as TrackResult, C as CancelParams, c as CancelResult, S as SetupPaymentParams, d as SetupPaymentResult, O as OpenBillingPortalParams, e as CheckoutParams, f as CheckParams, h as Success } from '../clientAttachTypes-B6sYxDWl.js';
2
+ import { A as AttachParams, f as CheckResult, T as TrackParams, a as TrackResult, C as CancelParams, b as CancelResult, S as SetupPaymentParams, c as SetupPaymentResult, O as OpenBillingPortalParams, d as CheckoutParams, e as CheckParams } from '../clientAttachTypes-BEgqHiPe.js';
3
3
  import { A as AttachResult, C as CheckoutResult, b as CreateEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from '../clientEntTypes-Bsi7ciUF.js';
4
+ import { A as AutumnPromise, S as Success } from '../response-CLgEplsF.js';
4
5
  import { f as CustomerExpandOption, a as Customer, B as BillingPortalResult } from '../cusTypes-B-rJwpui.js';
5
6
  import { E as Entity } from '../entTypes-DjKFS-Zk.js';
6
7
  import { SWRConfiguration } from 'swr';
@@ -1,33 +1,25 @@
1
- import { f as CheckParams, g as CheckResult, A as AttachParams, C as CancelParams, a as AutumnPromise, T as TrackParams } from '../clientAttachTypes-BOJD2U3t.mjs';
1
+ import { e as CheckParams, f as CheckResult, A as AttachParams, C as CancelParams, T as TrackParams } from '../clientAttachTypes-Bii5Xkzu.mjs';
2
+ import { A as AutumnError } from '../error-DHbclCVh.mjs';
2
3
  import { G as GetEntityParams, E as Entity } from '../entTypes-BkN-Puru.mjs';
3
- import * as swr from 'swr';
4
4
  import '../prodTypes-B_VMILpU.mjs';
5
5
  import 'zod/v4';
6
- import '../error-DHbclCVh.mjs';
7
6
  import '../cusTypes-CXjHwB-c.mjs';
8
7
 
9
8
  declare const useEntity: (entityId: string | null, params?: GetEntityParams) => {
10
9
  entity: Entity | null;
11
10
  isLoading: boolean;
12
- error: any;
13
- refetch: swr.KeyedMutator<Entity | null>;
11
+ error: AutumnError | undefined | null;
12
+ refetch: () => void;
14
13
  check: (params: CheckParams) => {
15
14
  data: CheckResult;
16
15
  error: null;
16
+ } | {
17
+ data: null;
18
+ error: AutumnError;
17
19
  };
18
- attach: (params: AttachParams) => Promise<any>;
19
- cancel: (params: CancelParams) => AutumnPromise<{
20
- success: boolean;
21
- customer_id: string;
22
- product_id: string;
23
- }>;
24
- track: (params: TrackParams) => AutumnPromise<{
25
- id: string;
26
- code: string;
27
- customer_id: string;
28
- feature_id?: string | undefined;
29
- event_name?: string | undefined;
30
- }>;
20
+ attach: (params: AttachParams) => void;
21
+ cancel: (params: CancelParams) => void;
22
+ track: (params: TrackParams) => void;
31
23
  };
32
24
 
33
25
  export { useEntity };
@@ -1,33 +1,25 @@
1
- import { f as CheckParams, g as CheckResult, A as AttachParams, C as CancelParams, a as AutumnPromise, T as TrackParams } from '../clientAttachTypes-B6sYxDWl.js';
1
+ import { e as CheckParams, f as CheckResult, A as AttachParams, C as CancelParams, T as TrackParams } from '../clientAttachTypes-BEgqHiPe.js';
2
+ import { A as AutumnError } from '../error-DHbclCVh.js';
2
3
  import { G as GetEntityParams, E as Entity } from '../entTypes-DjKFS-Zk.js';
3
- import * as swr from 'swr';
4
4
  import '../prodTypes-B_VMILpU.js';
5
5
  import 'zod/v4';
6
- import '../error-DHbclCVh.js';
7
6
  import '../cusTypes-B-rJwpui.js';
8
7
 
9
8
  declare const useEntity: (entityId: string | null, params?: GetEntityParams) => {
10
9
  entity: Entity | null;
11
10
  isLoading: boolean;
12
- error: any;
13
- refetch: swr.KeyedMutator<Entity | null>;
11
+ error: AutumnError | undefined | null;
12
+ refetch: () => void;
14
13
  check: (params: CheckParams) => {
15
14
  data: CheckResult;
16
15
  error: null;
16
+ } | {
17
+ data: null;
18
+ error: AutumnError;
17
19
  };
18
- attach: (params: AttachParams) => Promise<any>;
19
- cancel: (params: CancelParams) => AutumnPromise<{
20
- success: boolean;
21
- customer_id: string;
22
- product_id: string;
23
- }>;
24
- track: (params: TrackParams) => AutumnPromise<{
25
- id: string;
26
- code: string;
27
- customer_id: string;
28
- feature_id?: string | undefined;
29
- event_name?: string | undefined;
30
- }>;
20
+ attach: (params: AttachParams) => void;
21
+ cancel: (params: CancelParams) => void;
22
+ track: (params: TrackParams) => void;
31
23
  };
32
24
 
33
25
  export { useEntity };
@@ -1,4 +1,3 @@
1
- import * as swr from 'swr';
2
1
  import { A as AutumnError } from '../error-DHbclCVh.mjs';
3
2
  import { P as Product } from '../prodTypes-B_VMILpU.mjs';
4
3
  import 'zod/v4';
@@ -28,7 +27,7 @@ declare const usePricingTable: (params?: {
28
27
  products: Product[] | null;
29
28
  isLoading: boolean;
30
29
  error: AutumnError | undefined;
31
- refetch: swr.KeyedMutator<Product[]>;
30
+ refetch: () => void;
32
31
  };
33
32
 
34
33
  export { usePricingTable };
@@ -1,4 +1,3 @@
1
- import * as swr from 'swr';
2
1
  import { A as AutumnError } from '../error-DHbclCVh.js';
3
2
  import { P as Product } from '../prodTypes-B_VMILpU.js';
4
3
  import 'zod/v4';
@@ -28,7 +27,7 @@ declare const usePricingTable: (params?: {
28
27
  products: Product[] | null;
29
28
  isLoading: boolean;
30
29
  error: AutumnError | undefined;
31
- refetch: swr.KeyedMutator<Product[]>;
30
+ refetch: () => void;
32
31
  };
33
32
 
34
33
  export { usePricingTable };
@@ -0,0 +1,16 @@
1
+ import { A as AutumnError } from './error-DHbclCVh.js';
2
+
3
+ type Success<T> = {
4
+ data: T;
5
+ error: null;
6
+ statusCode?: number;
7
+ };
8
+ type Failure<E> = {
9
+ data: null;
10
+ error: E;
11
+ statusCode?: number;
12
+ };
13
+ type Result<T, E> = Success<T> | Failure<E>;
14
+ type AutumnPromise<T> = Promise<Result<T, AutumnError>>;
15
+
16
+ export type { AutumnPromise as A, Result as R, Success as S };
@@ -0,0 +1,16 @@
1
+ import { A as AutumnError } from './error-DHbclCVh.mjs';
2
+
3
+ type Success<T> = {
4
+ data: T;
5
+ error: null;
6
+ statusCode?: number;
7
+ };
8
+ type Failure<E> = {
9
+ data: null;
10
+ error: E;
11
+ statusCode?: number;
12
+ };
13
+ type Result<T, E> = Success<T> | Failure<E>;
14
+ type AutumnPromise<T> = Promise<Result<T, AutumnError>>;
15
+
16
+ export type { AutumnPromise as A, Result as R, Success as S };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.1.46",
4
+ "version": "0.1.48",
5
5
  "repository": "github:useautumn/autumn-js",
6
6
  "homepage": "https://docs.useautumn.com",
7
7
  "main": "./dist/sdk/index.js",
@@ -1,31 +0,0 @@
1
- import { A as AutumnError } from './error-DHbclCVh.mjs';
2
- import { d as CustomerProduct, e as CustomerFeature, f as CustomerInvoice } from './cusTypes-RU0fmR-t.mjs';
3
-
4
- type Success<T> = {
5
- data: T;
6
- error: null;
7
- statusCode?: number;
8
- };
9
- type Failure<E> = {
10
- data: null;
11
- error: E;
12
- statusCode?: number;
13
- };
14
- type Result<T, E> = Success<T> | Failure<E>;
15
- type AutumnPromise<T> = Promise<Result<T, AutumnError>>;
16
-
17
- interface DeleteEntityResult {
18
- success: boolean;
19
- }
20
- interface Entity {
21
- id: string;
22
- name: string;
23
- customer_id: string;
24
- created_at: number;
25
- env: string;
26
- products: CustomerProduct[];
27
- features: Record<string, CustomerFeature>;
28
- invoices?: CustomerInvoice[];
29
- }
30
-
31
- export type { AutumnPromise as A, DeleteEntityResult as D, Entity as E, Result as R, Success as S };
@@ -1,31 +0,0 @@
1
- import { A as AutumnError } from './error-DHbclCVh.js';
2
- import { d as CustomerProduct, e as CustomerFeature, f as CustomerInvoice } from './cusTypes-D3QQXjif.js';
3
-
4
- type Success<T> = {
5
- data: T;
6
- error: null;
7
- statusCode?: number;
8
- };
9
- type Failure<E> = {
10
- data: null;
11
- error: E;
12
- statusCode?: number;
13
- };
14
- type Result<T, E> = Success<T> | Failure<E>;
15
- type AutumnPromise<T> = Promise<Result<T, AutumnError>>;
16
-
17
- interface DeleteEntityResult {
18
- success: boolean;
19
- }
20
- interface Entity {
21
- id: string;
22
- name: string;
23
- customer_id: string;
24
- created_at: number;
25
- env: string;
26
- products: CustomerProduct[];
27
- features: Record<string, CustomerFeature>;
28
- invoices?: CustomerInvoice[];
29
- }
30
-
31
- export type { AutumnPromise as A, DeleteEntityResult as D, Entity as E, Result as R, Success as S };
@@ -1,15 +1,15 @@
1
- import {
2
- addGenRoutes
3
- } from "./chunk-N3VJUVPG.mjs";
4
- import {
5
- addProductRoutes
6
- } from "./chunk-IVBYU3TD.mjs";
7
1
  import {
8
2
  addReferralRoutes
9
3
  } from "./chunk-7MOIXHFG.mjs";
10
4
  import {
11
5
  addEntityRoutes
12
6
  } from "./chunk-DKXKK76P.mjs";
7
+ import {
8
+ addGenRoutes
9
+ } from "./chunk-N3VJUVPG.mjs";
10
+ import {
11
+ addProductRoutes
12
+ } from "./chunk-IVBYU3TD.mjs";
13
13
  import {
14
14
  withAuth
15
15
  } from "./chunk-RN3IUPE5.mjs";
@@ -1,5 +1,8 @@
1
1
  "use client";
2
2
 
3
+ import {
4
+ useSize
5
+ } from "./chunk-2CIFBRPG.mjs";
3
6
  import {
4
7
  Combination_default,
5
8
  DismissableLayer,
@@ -13,9 +16,6 @@ import {
13
16
  Presence,
14
17
  useId
15
18
  } from "./chunk-3HGWHP3P.mjs";
16
- import {
17
- useSize
18
- } from "./chunk-2CIFBRPG.mjs";
19
19
  import {
20
20
  Primitive,
21
21
  composeEventHandlers,
@@ -1,5 +1,8 @@
1
1
  "use client";
2
2
 
3
+ import {
4
+ logFetchError
5
+ } from "./chunk-CIBQ4BJU.mjs";
3
6
  import {
4
7
  attachMethod,
5
8
  cancelMethod,
@@ -20,9 +23,6 @@ import {
20
23
  import {
21
24
  logAuthError
22
25
  } from "./chunk-JVCOY7ZL.mjs";
23
- import {
24
- logFetchError
25
- } from "./chunk-CIBQ4BJU.mjs";
26
26
  import {
27
27
  AutumnError,
28
28
  toContainerResult