autumn-js 0.0.115 → 0.0.116
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.
- package/README.md +1 -139
- package/dist/libraries/backend/better-auth.d.mts +18 -18
- package/dist/libraries/backend/better-auth.d.ts +18 -18
- package/dist/libraries/backend/better-auth.js +17 -0
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-VJTYMTEE.mjs → chunk-BDMGQV75.mjs} +1 -1
- package/dist/libraries/backend/{chunk-CZIMXJXT.mjs → chunk-BX2LACTF.mjs} +1 -1
- package/dist/libraries/backend/{chunk-5OVGQBAX.mjs → chunk-EIP7LDKF.mjs} +1 -1
- package/dist/libraries/backend/{chunk-FV6S6G2B.mjs → chunk-N4PGGU3D.mjs} +1 -1
- package/dist/libraries/backend/{chunk-SLHP34YX.mjs → chunk-O6KXYXQN.mjs} +1 -1
- package/dist/libraries/backend/{chunk-BBXZMPWZ.mjs → chunk-QGX7ZACH.mjs} +17 -0
- package/dist/libraries/backend/{chunk-RZCIKER6.mjs → chunk-WTKY2U3S.mjs} +10 -10
- package/dist/libraries/backend/convex.js +17 -0
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +17 -0
- package/dist/libraries/backend/elysia.mjs +7 -7
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +17 -0
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +17 -0
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +17 -0
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/index.d.mts +1 -1
- package/dist/libraries/backend/index.d.ts +1 -1
- package/dist/libraries/backend/index.js +17 -0
- package/dist/libraries/backend/index.mjs +7 -7
- package/dist/libraries/backend/next.js +17 -0
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +17 -0
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-Tn4tzWbT.d.ts → referralTypes-DXhjwazw.d.ts} +90 -35
- package/dist/libraries/backend/{referralTypes-CxBMvbW7.d.mts → referralTypes-Dxn4bOpT.d.mts} +90 -35
- package/dist/libraries/backend/remix_dep.js +17 -0
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +17 -0
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +17 -0
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +17 -0
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +17 -0
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +17 -0
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +17 -0
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +17 -0
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +17 -0
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/backend/utils/withAuth.js +17 -0
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +6 -6
- package/dist/libraries/react/AutumnContext.d.ts +6 -6
- package/dist/libraries/react/AutumnContext.js +17 -0
- package/dist/libraries/react/AutumnContext.mjs +5 -5
- package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.js +17 -0
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{ReactAutumnClient-DWq3CtTo.d.ts → ReactAutumnClient-5mFEwitR.d.ts} +8 -8
- package/dist/libraries/react/{ReactAutumnClient-Deg9KIoK.d.mts → ReactAutumnClient-DooIpMm0.d.mts} +8 -8
- package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.js +17 -0
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
- package/dist/libraries/react/{attachTypes-BfITg8QI.d.mts → attachTypes-By0coJIV.d.mts} +3 -3
- package/dist/{next/client/attachTypes-D1J8GKaX.d.ts → libraries/react/attachTypes-CSutLgVn.d.ts} +5 -5
- package/dist/libraries/react/{chunk-JKCNFNPN.mjs → chunk-77DMPCGK.mjs} +28 -30
- package/dist/libraries/react/{chunk-WLMUN7LO.mjs → chunk-7RICWVXV.mjs} +2 -2
- package/dist/libraries/react/{chunk-2ZJIVJC3.mjs → chunk-AXHU3KAH.mjs} +3 -3
- package/dist/libraries/react/{chunk-HRD7CMV2.mjs → chunk-CZBWEEWD.mjs} +17 -0
- package/dist/libraries/react/{chunk-TTQ2JFWO.mjs → chunk-EXUNRZTP.mjs} +3 -3
- package/dist/libraries/react/{chunk-UO4CQY4C.mjs → chunk-H4J73SMR.mjs} +1 -1
- package/dist/libraries/react/{chunk-SQETBIDZ.mjs → chunk-IFZCH7DR.mjs} +2 -2
- package/dist/libraries/react/{chunk-GB3FANSE.mjs → chunk-LFLX6NJU.mjs} +1 -1
- package/dist/libraries/react/{chunk-WEOR6KVG.mjs → chunk-LMQMA7VL.mjs} +7 -7
- package/dist/libraries/react/{chunk-YOP5NTBJ.mjs → chunk-MPA65MFU.mjs} +1 -1
- package/dist/libraries/react/{chunk-MRJXFGYA.mjs → chunk-MRZA4JWN.mjs} +1 -1
- package/dist/libraries/react/{chunk-GUN6SIBL.mjs → chunk-PFN52PHR.mjs} +2 -2
- package/dist/libraries/react/{chunk-ID6R6YXN.mjs → chunk-QJJC6MB3.mjs} +2 -2
- package/dist/libraries/react/{chunk-IJNOJKLD.mjs → chunk-UAK4XMNC.mjs} +1 -1
- package/dist/libraries/react/{chunk-6ZNJROK5.mjs → chunk-UCUAGLCJ.mjs} +1 -1
- package/dist/libraries/react/{chunk-3TWEC5VD.mjs → chunk-WZG3QTZI.mjs} +3 -3
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.js +17 -0
- package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
- package/dist/libraries/react/client/types/clientGenTypes.js +17 -0
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +17 -0
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +27 -27
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +17 -0
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +27 -27
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +4 -4
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +4 -4
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +18 -3
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +27 -27
- package/dist/libraries/react/components/ui/button.d.mts +1 -1
- package/dist/libraries/react/components/ui/button.d.ts +1 -1
- package/dist/libraries/react/components/ui/dialog.mjs +2 -2
- package/dist/libraries/react/components/ui/popover.mjs +2 -2
- package/dist/libraries/react/{cusTypes-CMj2sP-4.d.ts → cusTypes-Bbmd8V3j.d.mts} +23 -5
- package/dist/libraries/react/{cusTypes-Dj2tcwg7.d.mts → cusTypes-d_DR9uFs.d.ts} +23 -5
- package/dist/libraries/react/{entTypes-Cltx_-C_.d.mts → entTypes-B2DgO6PV.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-fYtiTl7W.d.ts → entTypes-D6eoGCKH.d.ts} +1 -1
- package/dist/libraries/react/{genTypes-A2nf2M_h.d.ts → genTypes-BNXXZTFn.d.ts} +5 -5
- package/dist/libraries/react/{genTypes-CH9EbOfb.d.mts → genTypes-C2VFQqmX.d.mts} +5 -5
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.js +17 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -6
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -6
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +17 -0
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.js +17 -0
- package/dist/libraries/react/hooks/useAnalytics.mjs +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomer.js +17 -0
- package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.js +17 -0
- package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
- package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.js +17 -0
- package/dist/libraries/react/hooks/useEntity.mjs +10 -10
- package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.js +17 -0
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
- package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
- package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
- package/dist/libraries/react/hooks/usePaywall.js +17 -0
- package/dist/libraries/react/hooks/usePaywall.mjs +6 -6
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.js +17 -0
- package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.js +17 -0
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
- package/dist/libraries/react/index.d.mts +37 -1
- package/dist/libraries/react/index.d.ts +37 -1
- package/dist/libraries/react/index.js +18 -3
- package/dist/libraries/react/index.mjs +18 -3
- package/dist/libraries/react/{prodTypes-DZUJPsRN.d.mts → prodTypes-B3iWy6kz.d.mts} +21 -3
- package/dist/libraries/react/{prodTypes-DZUJPsRN.d.ts → prodTypes-B3iWy6kz.d.ts} +21 -3
- package/dist/next/client/NextAutumnClient.d.mts +7 -7
- package/dist/next/client/NextAutumnClient.d.ts +7 -7
- package/dist/next/client/NextAutumnProvider.d.mts +2 -2
- package/dist/next/client/NextAutumnProvider.d.ts +2 -2
- package/dist/{libraries/react/attachTypes-ZMWuxpzI.d.ts → next/client/attachTypes-BCt7D8ym.d.ts} +5 -5
- package/dist/next/client/{attachTypes-Ds4c3m_f.d.mts → attachTypes-BThbMcvF.d.mts} +3 -3
- package/dist/next/client/{clientAttachTypes-CTlrbiN0.d.ts → clientAttachTypes-Df5FVGkw.d.ts} +3 -3
- package/dist/next/client/{clientAttachTypes-BkPjc5Md.d.mts → clientAttachTypes-whHUVrE3.d.mts} +3 -3
- package/dist/next/client/clientUtils.d.mts +3 -3
- package/dist/next/client/clientUtils.d.ts +3 -3
- package/dist/next/client/{cusTypes-cin7tsQv.d.mts → cusTypes-BuLw67IH.d.mts} +21 -3
- package/dist/next/client/{cusTypes-7rPpQ98G.d.ts → cusTypes-CqAsUZEp.d.ts} +21 -3
- package/dist/next/client/{entTypes-Nr9DDaGQ.d.ts → entTypes-BLLymqnn.d.ts} +1 -1
- package/dist/next/client/{entTypes-DhVNxsHB.d.mts → entTypes-DTRFxh07.d.mts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +4 -4
- package/dist/next/client/hooks/useAutumn.d.ts +4 -4
- package/dist/next/client/hooks/useCustomer.d.mts +5 -5
- package/dist/next/client/hooks/useCustomer.d.ts +5 -5
- package/dist/next/client/hooks/useEntity.d.mts +4 -4
- package/dist/next/client/hooks/useEntity.d.ts +4 -4
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/client/{prodTypes-CYd9Q1Rw.d.mts → prodTypes-UFM-PYm-.d.mts} +18 -0
- package/dist/next/client/{prodTypes-CYd9Q1Rw.d.ts → prodTypes-UFM-PYm-.d.ts} +18 -0
- package/dist/next/client/types.d.mts +3 -3
- package/dist/next/client/types.d.ts +3 -3
- package/dist/next/server/auth/withNextAuth.d.mts +1 -1
- package/dist/next/server/auth/withNextAuth.d.ts +1 -1
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +20 -1
- package/dist/next/server/cusActions.d.ts +20 -1
- package/dist/next/server/{cusTypes-wfx--BDG.d.mts → cusTypes-MnneoF1F.d.mts} +36 -0
- package/dist/next/server/{cusTypes-wfx--BDG.d.ts → cusTypes-MnneoF1F.d.ts} +36 -0
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +56 -1
- package/dist/sdk/index.d.ts +56 -1
- package/dist/sdk/index.js +18 -0
- package/dist/sdk/index.mjs +18 -1
- package/dist/utils/encryptUtils.js +17 -0
- package/dist/utils/encryptUtils.mjs +17 -0
- package/package.json +1 -1
- package/dist/libraries/react/{chunk-7JNU5ABT.mjs → chunk-FJWZPMWU.mjs} +3 -3
- package/dist/libraries/react/{chunk-LCWL3TIT.mjs → chunk-OTZ65PCT.mjs} +3 -3
package/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# Autumn JS Library
|
|
2
2
|
|
|
3
|
-
autumn-js is a
|
|
3
|
+
autumn-js is a JavaScript/TypeScript library for interacting with the Autumn pricing and billing platform. This package provides both a server-side SDK for the Autumn API and a React package for client-side implementation.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- 🚀 Complete Autumn API SDK
|
|
8
|
-
- ⚡ Next.js Integration
|
|
9
8
|
- 🔒 Type-safe API interactions
|
|
10
9
|
- 🛠️ Easy-to-use hooks and components
|
|
11
10
|
|
|
@@ -14,140 +13,3 @@ autumn-js is a comprehensive JavaScript/TypeScript library for interacting with
|
|
|
14
13
|
```bash
|
|
15
14
|
npm install autumn-js
|
|
16
15
|
```
|
|
17
|
-
|
|
18
|
-
## Configuration
|
|
19
|
-
|
|
20
|
-
Add your Autumn secret key to your environment variables:
|
|
21
|
-
|
|
22
|
-
```env
|
|
23
|
-
AUTUMN_SECRET_KEY=your_secret_key_here
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
### Server-Side SDK
|
|
29
|
-
|
|
30
|
-
For server-side applications (Node.js, Express, etc.), use the SDK like this:
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
import { Autumn } from 'autumn-js'
|
|
34
|
-
|
|
35
|
-
// Initialize Autumn
|
|
36
|
-
const autumn = new Autumn()
|
|
37
|
-
|
|
38
|
-
// Create a customer
|
|
39
|
-
await autumn.customers.create({
|
|
40
|
-
id: "customer_123",
|
|
41
|
-
name: "John Doe"
|
|
42
|
-
})
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Next.js Integration
|
|
46
|
-
|
|
47
|
-
For Next.js applications, Autumn.js provides a dedicated integration with helpful hooks and components.
|
|
48
|
-
|
|
49
|
-
**1.** First, wrap your application with the `AutumnProvider` in your root layout.tsx (this must be a Server Component):
|
|
50
|
-
|
|
51
|
-
```jsx
|
|
52
|
-
// app/layout.tsx
|
|
53
|
-
|
|
54
|
-
import { AutumnProvider } from 'autumn-js/next'
|
|
55
|
-
|
|
56
|
-
export default function RootLayout({
|
|
57
|
-
children,
|
|
58
|
-
}: {
|
|
59
|
-
children: React.ReactNode
|
|
60
|
-
}) {
|
|
61
|
-
return (
|
|
62
|
-
<html>
|
|
63
|
-
<body>
|
|
64
|
-
<AutumnProvider customerId="YOUR_CUSTOMER_ID">
|
|
65
|
-
{children}
|
|
66
|
-
</AutumnProvider>
|
|
67
|
-
</body>
|
|
68
|
-
</html>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**2.** Then use the `useAutumn` hook in your components:
|
|
74
|
-
|
|
75
|
-
```jsx
|
|
76
|
-
import { useAutumn } from 'autumn-js/next'
|
|
77
|
-
|
|
78
|
-
export default function BillingPage() {
|
|
79
|
-
const { attach, openBillingPortal } = useAutumn()
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<div>
|
|
83
|
-
<button onClick={() => openBillingPortal()}>
|
|
84
|
-
Manage Billing
|
|
85
|
-
</button>
|
|
86
|
-
<button onClick={() => attach()}>
|
|
87
|
-
Upgrade to Pro
|
|
88
|
-
</button>
|
|
89
|
-
</div>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
The `useAutumn` hook exports several useful functions:
|
|
95
|
-
|
|
96
|
-
- `attach({ productId })`: Opens a checkout URL automatically when called to attach a product to the customer
|
|
97
|
-
- `check({ featureId })`: Checks if the customer is entitled to use a specific feature
|
|
98
|
-
- `track({ featureId, value })`: Send usage for a particular feature
|
|
99
|
-
- `openBillingPortal()`: Opens Stripe's billing portal for the current customer to manage their subscription and billing settings
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<br/>
|
|
103
|
-
|
|
104
|
-
**3.** For authentication, you can either pass a customer ID directly or use our auth plugin (which allows you to easily integrate with popular providers like Better Auth):
|
|
105
|
-
|
|
106
|
-
Better Auth Example:
|
|
107
|
-
```jsx
|
|
108
|
-
<AutumnProvider
|
|
109
|
-
authPlugin={{
|
|
110
|
-
provider: "better-auth",
|
|
111
|
-
instance: auth, // Your server-side better-auth instance
|
|
112
|
-
useOrg: true, // Set to true if organizations are your customers
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
115
|
-
{children}
|
|
116
|
-
</AutumnProvider>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Supabase Example:
|
|
120
|
-
```jsx
|
|
121
|
-
<AutumnProvider
|
|
122
|
-
authPlugin={{
|
|
123
|
-
provider: "supabase",
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
{children}
|
|
127
|
-
</AutumnProvider>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Clerk Example:
|
|
131
|
-
```jsx
|
|
132
|
-
<AutumnProvider
|
|
133
|
-
authPlugin={{
|
|
134
|
-
provider: "clerk",
|
|
135
|
-
useOrg: true,
|
|
136
|
-
}}
|
|
137
|
-
>
|
|
138
|
-
{children}
|
|
139
|
-
</AutumnProvider>
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
## API Reference
|
|
144
|
-
|
|
145
|
-
For detailed API documentation, visit [docs.useautumn.com](https://docs.useautumn.com)
|
|
146
|
-
|
|
147
|
-
## Support
|
|
148
|
-
|
|
149
|
-
For support, email hey@useautumn.com!
|
|
150
|
-
|
|
151
|
-
## License
|
|
152
|
-
|
|
153
|
-
MIT
|
|
@@ -130,13 +130,13 @@ declare const autumn: (options?: {
|
|
|
130
130
|
attach: {
|
|
131
131
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
132
132
|
body: {
|
|
133
|
-
entity_id?: string | undefined;
|
|
134
133
|
options?: {
|
|
135
134
|
feature_id: string;
|
|
136
135
|
quantity: number;
|
|
137
136
|
}[] | undefined;
|
|
138
137
|
metadata?: Record<string, string> | undefined;
|
|
139
138
|
product_id?: string | undefined;
|
|
139
|
+
entity_id?: string | undefined;
|
|
140
140
|
product_ids?: string[] | undefined;
|
|
141
141
|
free_trial?: boolean | undefined;
|
|
142
142
|
success_url?: string | undefined;
|
|
@@ -210,13 +210,13 @@ declare const autumn: (options?: {
|
|
|
210
210
|
checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
211
211
|
reward: z.ZodOptional<z.ZodString>;
|
|
212
212
|
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
213
|
-
entity_id?: string | undefined;
|
|
214
213
|
options?: {
|
|
215
214
|
feature_id: string;
|
|
216
215
|
quantity: number;
|
|
217
216
|
}[] | undefined;
|
|
218
217
|
metadata?: Record<string, string> | undefined;
|
|
219
218
|
product_id?: string | undefined;
|
|
219
|
+
entity_id?: string | undefined;
|
|
220
220
|
product_ids?: string[] | undefined;
|
|
221
221
|
free_trial?: boolean | undefined;
|
|
222
222
|
success_url?: string | undefined;
|
|
@@ -230,13 +230,13 @@ declare const autumn: (options?: {
|
|
|
230
230
|
checkout_session_params?: Record<string, any> | undefined;
|
|
231
231
|
reward?: string | undefined;
|
|
232
232
|
}, {
|
|
233
|
-
entity_id?: string | undefined;
|
|
234
233
|
options?: {
|
|
235
234
|
feature_id: string;
|
|
236
235
|
quantity: number;
|
|
237
236
|
}[] | undefined;
|
|
238
237
|
metadata?: Record<string, string> | undefined;
|
|
239
238
|
product_id?: string | undefined;
|
|
239
|
+
entity_id?: string | undefined;
|
|
240
240
|
product_ids?: string[] | undefined;
|
|
241
241
|
free_trial?: boolean | undefined;
|
|
242
242
|
success_url?: string | undefined;
|
|
@@ -281,15 +281,15 @@ declare const autumn: (options?: {
|
|
|
281
281
|
check: {
|
|
282
282
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
283
283
|
body: {
|
|
284
|
-
feature_id?: string | undefined;
|
|
285
|
-
entity_id?: string | undefined;
|
|
286
|
-
required_balance?: number | undefined;
|
|
287
284
|
product_id?: string | undefined;
|
|
285
|
+
entity_id?: string | undefined;
|
|
286
|
+
feature_id?: string | undefined;
|
|
288
287
|
customer_data?: any;
|
|
289
288
|
entity_data?: {
|
|
290
289
|
feature_id: string;
|
|
291
290
|
name?: string | undefined;
|
|
292
291
|
} | undefined;
|
|
292
|
+
required_balance?: number | undefined;
|
|
293
293
|
send_event?: boolean | undefined;
|
|
294
294
|
with_preview?: boolean | undefined;
|
|
295
295
|
};
|
|
@@ -337,27 +337,27 @@ declare const autumn: (options?: {
|
|
|
337
337
|
name?: string | undefined;
|
|
338
338
|
}>>;
|
|
339
339
|
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
340
|
-
feature_id?: string | undefined;
|
|
341
|
-
entity_id?: string | undefined;
|
|
342
|
-
required_balance?: number | undefined;
|
|
343
340
|
product_id?: string | undefined;
|
|
341
|
+
entity_id?: string | undefined;
|
|
342
|
+
feature_id?: string | undefined;
|
|
344
343
|
customer_data?: any;
|
|
345
344
|
entity_data?: {
|
|
346
345
|
feature_id: string;
|
|
347
346
|
name?: string | undefined;
|
|
348
347
|
} | undefined;
|
|
348
|
+
required_balance?: number | undefined;
|
|
349
349
|
send_event?: boolean | undefined;
|
|
350
350
|
with_preview?: boolean | undefined;
|
|
351
351
|
}, {
|
|
352
|
-
feature_id?: string | undefined;
|
|
353
|
-
entity_id?: string | undefined;
|
|
354
|
-
required_balance?: number | undefined;
|
|
355
352
|
product_id?: string | undefined;
|
|
353
|
+
entity_id?: string | undefined;
|
|
354
|
+
feature_id?: string | undefined;
|
|
356
355
|
customer_data?: any;
|
|
357
356
|
entity_data?: {
|
|
358
357
|
feature_id: string;
|
|
359
358
|
name?: string | undefined;
|
|
360
359
|
} | undefined;
|
|
360
|
+
required_balance?: number | undefined;
|
|
361
361
|
send_event?: boolean | undefined;
|
|
362
362
|
with_preview?: boolean | undefined;
|
|
363
363
|
}>;
|
|
@@ -392,9 +392,9 @@ declare const autumn: (options?: {
|
|
|
392
392
|
track: {
|
|
393
393
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
394
394
|
body: {
|
|
395
|
-
feature_id?: string | undefined;
|
|
396
|
-
entity_id?: string | undefined;
|
|
397
395
|
value?: number | undefined;
|
|
396
|
+
entity_id?: string | undefined;
|
|
397
|
+
feature_id?: string | undefined;
|
|
398
398
|
customer_data?: any;
|
|
399
399
|
entity_data?: any;
|
|
400
400
|
event_name?: string | undefined;
|
|
@@ -434,17 +434,17 @@ declare const autumn: (options?: {
|
|
|
434
434
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
435
435
|
entity_data: z.ZodOptional<z.ZodAny>;
|
|
436
436
|
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
437
|
-
feature_id?: string | undefined;
|
|
438
|
-
entity_id?: string | undefined;
|
|
439
437
|
value?: number | undefined;
|
|
438
|
+
entity_id?: string | undefined;
|
|
439
|
+
feature_id?: string | undefined;
|
|
440
440
|
customer_data?: any;
|
|
441
441
|
entity_data?: any;
|
|
442
442
|
event_name?: string | undefined;
|
|
443
443
|
idempotency_key?: string | undefined;
|
|
444
444
|
}, {
|
|
445
|
-
feature_id?: string | undefined;
|
|
446
|
-
entity_id?: string | undefined;
|
|
447
445
|
value?: number | undefined;
|
|
446
|
+
entity_id?: string | undefined;
|
|
447
|
+
feature_id?: string | undefined;
|
|
448
448
|
customer_data?: any;
|
|
449
449
|
entity_data?: any;
|
|
450
450
|
event_name?: string | undefined;
|
|
@@ -130,13 +130,13 @@ declare const autumn: (options?: {
|
|
|
130
130
|
attach: {
|
|
131
131
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
132
132
|
body: {
|
|
133
|
-
entity_id?: string | undefined;
|
|
134
133
|
options?: {
|
|
135
134
|
feature_id: string;
|
|
136
135
|
quantity: number;
|
|
137
136
|
}[] | undefined;
|
|
138
137
|
metadata?: Record<string, string> | undefined;
|
|
139
138
|
product_id?: string | undefined;
|
|
139
|
+
entity_id?: string | undefined;
|
|
140
140
|
product_ids?: string[] | undefined;
|
|
141
141
|
free_trial?: boolean | undefined;
|
|
142
142
|
success_url?: string | undefined;
|
|
@@ -210,13 +210,13 @@ declare const autumn: (options?: {
|
|
|
210
210
|
checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
211
211
|
reward: z.ZodOptional<z.ZodString>;
|
|
212
212
|
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
213
|
-
entity_id?: string | undefined;
|
|
214
213
|
options?: {
|
|
215
214
|
feature_id: string;
|
|
216
215
|
quantity: number;
|
|
217
216
|
}[] | undefined;
|
|
218
217
|
metadata?: Record<string, string> | undefined;
|
|
219
218
|
product_id?: string | undefined;
|
|
219
|
+
entity_id?: string | undefined;
|
|
220
220
|
product_ids?: string[] | undefined;
|
|
221
221
|
free_trial?: boolean | undefined;
|
|
222
222
|
success_url?: string | undefined;
|
|
@@ -230,13 +230,13 @@ declare const autumn: (options?: {
|
|
|
230
230
|
checkout_session_params?: Record<string, any> | undefined;
|
|
231
231
|
reward?: string | undefined;
|
|
232
232
|
}, {
|
|
233
|
-
entity_id?: string | undefined;
|
|
234
233
|
options?: {
|
|
235
234
|
feature_id: string;
|
|
236
235
|
quantity: number;
|
|
237
236
|
}[] | undefined;
|
|
238
237
|
metadata?: Record<string, string> | undefined;
|
|
239
238
|
product_id?: string | undefined;
|
|
239
|
+
entity_id?: string | undefined;
|
|
240
240
|
product_ids?: string[] | undefined;
|
|
241
241
|
free_trial?: boolean | undefined;
|
|
242
242
|
success_url?: string | undefined;
|
|
@@ -281,15 +281,15 @@ declare const autumn: (options?: {
|
|
|
281
281
|
check: {
|
|
282
282
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
283
283
|
body: {
|
|
284
|
-
feature_id?: string | undefined;
|
|
285
|
-
entity_id?: string | undefined;
|
|
286
|
-
required_balance?: number | undefined;
|
|
287
284
|
product_id?: string | undefined;
|
|
285
|
+
entity_id?: string | undefined;
|
|
286
|
+
feature_id?: string | undefined;
|
|
288
287
|
customer_data?: any;
|
|
289
288
|
entity_data?: {
|
|
290
289
|
feature_id: string;
|
|
291
290
|
name?: string | undefined;
|
|
292
291
|
} | undefined;
|
|
292
|
+
required_balance?: number | undefined;
|
|
293
293
|
send_event?: boolean | undefined;
|
|
294
294
|
with_preview?: boolean | undefined;
|
|
295
295
|
};
|
|
@@ -337,27 +337,27 @@ declare const autumn: (options?: {
|
|
|
337
337
|
name?: string | undefined;
|
|
338
338
|
}>>;
|
|
339
339
|
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
340
|
-
feature_id?: string | undefined;
|
|
341
|
-
entity_id?: string | undefined;
|
|
342
|
-
required_balance?: number | undefined;
|
|
343
340
|
product_id?: string | undefined;
|
|
341
|
+
entity_id?: string | undefined;
|
|
342
|
+
feature_id?: string | undefined;
|
|
344
343
|
customer_data?: any;
|
|
345
344
|
entity_data?: {
|
|
346
345
|
feature_id: string;
|
|
347
346
|
name?: string | undefined;
|
|
348
347
|
} | undefined;
|
|
348
|
+
required_balance?: number | undefined;
|
|
349
349
|
send_event?: boolean | undefined;
|
|
350
350
|
with_preview?: boolean | undefined;
|
|
351
351
|
}, {
|
|
352
|
-
feature_id?: string | undefined;
|
|
353
|
-
entity_id?: string | undefined;
|
|
354
|
-
required_balance?: number | undefined;
|
|
355
352
|
product_id?: string | undefined;
|
|
353
|
+
entity_id?: string | undefined;
|
|
354
|
+
feature_id?: string | undefined;
|
|
356
355
|
customer_data?: any;
|
|
357
356
|
entity_data?: {
|
|
358
357
|
feature_id: string;
|
|
359
358
|
name?: string | undefined;
|
|
360
359
|
} | undefined;
|
|
360
|
+
required_balance?: number | undefined;
|
|
361
361
|
send_event?: boolean | undefined;
|
|
362
362
|
with_preview?: boolean | undefined;
|
|
363
363
|
}>;
|
|
@@ -392,9 +392,9 @@ declare const autumn: (options?: {
|
|
|
392
392
|
track: {
|
|
393
393
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
394
394
|
body: {
|
|
395
|
-
feature_id?: string | undefined;
|
|
396
|
-
entity_id?: string | undefined;
|
|
397
395
|
value?: number | undefined;
|
|
396
|
+
entity_id?: string | undefined;
|
|
397
|
+
feature_id?: string | undefined;
|
|
398
398
|
customer_data?: any;
|
|
399
399
|
entity_data?: any;
|
|
400
400
|
event_name?: string | undefined;
|
|
@@ -434,17 +434,17 @@ declare const autumn: (options?: {
|
|
|
434
434
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
435
435
|
entity_data: z.ZodOptional<z.ZodAny>;
|
|
436
436
|
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
437
|
-
feature_id?: string | undefined;
|
|
438
|
-
entity_id?: string | undefined;
|
|
439
437
|
value?: number | undefined;
|
|
438
|
+
entity_id?: string | undefined;
|
|
439
|
+
feature_id?: string | undefined;
|
|
440
440
|
customer_data?: any;
|
|
441
441
|
entity_data?: any;
|
|
442
442
|
event_name?: string | undefined;
|
|
443
443
|
idempotency_key?: string | undefined;
|
|
444
444
|
}, {
|
|
445
|
-
feature_id?: string | undefined;
|
|
446
|
-
entity_id?: string | undefined;
|
|
447
445
|
value?: number | undefined;
|
|
446
|
+
entity_id?: string | undefined;
|
|
447
|
+
feature_id?: string | undefined;
|
|
448
448
|
customer_data?: any;
|
|
449
449
|
entity_data?: any;
|
|
450
450
|
event_name?: string | undefined;
|
|
@@ -183,6 +183,7 @@ var entityMethods = (instance) => {
|
|
|
183
183
|
params
|
|
184
184
|
}),
|
|
185
185
|
create: (customer_id, params) => staticWrapper(createEntity, instance, { customer_id, params }),
|
|
186
|
+
transfer: (customer_id, params) => staticWrapper(transferProduct, instance, { customer_id, params }),
|
|
186
187
|
delete: (customer_id, entity_id) => staticWrapper(deleteEntity, instance, { customer_id, entity_id })
|
|
187
188
|
};
|
|
188
189
|
};
|
|
@@ -218,6 +219,13 @@ var deleteEntity = async ({
|
|
|
218
219
|
}) => {
|
|
219
220
|
return instance.delete(`/customers/${customer_id}/entities/${entity_id}`);
|
|
220
221
|
};
|
|
222
|
+
var transferProduct = async ({
|
|
223
|
+
instance,
|
|
224
|
+
customer_id,
|
|
225
|
+
params
|
|
226
|
+
}) => {
|
|
227
|
+
return instance.post(`/customers/${customer_id}/transfer`, params);
|
|
228
|
+
};
|
|
221
229
|
|
|
222
230
|
// src/sdk/products/prodMethods.ts
|
|
223
231
|
var productMethods = (instance) => {
|
|
@@ -524,6 +532,10 @@ var CoreCusFeatureSchema = import_zod2.z.object({
|
|
|
524
532
|
next_reset_at: import_zod2.z.number().nullish(),
|
|
525
533
|
overage_allowed: import_zod2.z.boolean().optional(),
|
|
526
534
|
usage_limit: import_zod2.z.number().optional(),
|
|
535
|
+
rollovers: import_zod2.z.object({
|
|
536
|
+
balance: import_zod2.z.number(),
|
|
537
|
+
expires_at: import_zod2.z.number()
|
|
538
|
+
}).optional(),
|
|
527
539
|
breakdown: import_zod2.z.array(
|
|
528
540
|
import_zod2.z.object({
|
|
529
541
|
interval: import_zod2.z.nativeEnum(ProductItemInterval),
|
|
@@ -573,6 +585,11 @@ var EntityDataSchema = import_zod4.z.object({
|
|
|
573
585
|
name: import_zod4.z.string().optional(),
|
|
574
586
|
feature_id: import_zod4.z.string()
|
|
575
587
|
});
|
|
588
|
+
var TransferProductParamsSchema = import_zod4.z.object({
|
|
589
|
+
from_entity_id: import_zod4.z.string(),
|
|
590
|
+
to_entity_id: import_zod4.z.string(),
|
|
591
|
+
product_id: import_zod4.z.string()
|
|
592
|
+
});
|
|
576
593
|
|
|
577
594
|
// src/sdk/general/genTypes.ts
|
|
578
595
|
var import_zod5 = require("zod");
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-UNZHJTEY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createRouterWithOptions
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WTKY2U3S.mjs";
|
|
7
|
+
import "./chunk-EIP7LDKF.mjs";
|
|
8
|
+
import "./chunk-BX2LACTF.mjs";
|
|
9
|
+
import "./chunk-N4PGGU3D.mjs";
|
|
10
|
+
import "./chunk-BDMGQV75.mjs";
|
|
11
|
+
import "./chunk-O6KXYXQN.mjs";
|
|
12
12
|
import {
|
|
13
13
|
AttachParamsSchema,
|
|
14
14
|
Autumn,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
CustomerExpandEnum,
|
|
20
20
|
RedeemReferralCodeParamsSchema,
|
|
21
21
|
TrackParamsSchema
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QGX7ZACH.mjs";
|
|
23
23
|
import "./chunk-2TEL6LR5.mjs";
|
|
24
24
|
import "./chunk-KSG3E4Q2.mjs";
|
|
25
25
|
|
|
@@ -157,6 +157,7 @@ var entityMethods = (instance) => {
|
|
|
157
157
|
params
|
|
158
158
|
}),
|
|
159
159
|
create: (customer_id, params) => staticWrapper(createEntity, instance, { customer_id, params }),
|
|
160
|
+
transfer: (customer_id, params) => staticWrapper(transferProduct, instance, { customer_id, params }),
|
|
160
161
|
delete: (customer_id, entity_id) => staticWrapper(deleteEntity, instance, { customer_id, entity_id })
|
|
161
162
|
};
|
|
162
163
|
};
|
|
@@ -192,6 +193,13 @@ var deleteEntity = async ({
|
|
|
192
193
|
}) => {
|
|
193
194
|
return instance.delete(`/customers/${customer_id}/entities/${entity_id}`);
|
|
194
195
|
};
|
|
196
|
+
var transferProduct = async ({
|
|
197
|
+
instance,
|
|
198
|
+
customer_id,
|
|
199
|
+
params
|
|
200
|
+
}) => {
|
|
201
|
+
return instance.post(`/customers/${customer_id}/transfer`, params);
|
|
202
|
+
};
|
|
195
203
|
|
|
196
204
|
// src/sdk/products/prodMethods.ts
|
|
197
205
|
var productMethods = (instance) => {
|
|
@@ -461,6 +469,10 @@ var CoreCusFeatureSchema = z2.object({
|
|
|
461
469
|
next_reset_at: z2.number().nullish(),
|
|
462
470
|
overage_allowed: z2.boolean().optional(),
|
|
463
471
|
usage_limit: z2.number().optional(),
|
|
472
|
+
rollovers: z2.object({
|
|
473
|
+
balance: z2.number(),
|
|
474
|
+
expires_at: z2.number()
|
|
475
|
+
}).optional(),
|
|
464
476
|
breakdown: z2.array(
|
|
465
477
|
z2.object({
|
|
466
478
|
interval: z2.nativeEnum(ProductItemInterval),
|
|
@@ -510,6 +522,11 @@ var EntityDataSchema = z4.object({
|
|
|
510
522
|
name: z4.string().optional(),
|
|
511
523
|
feature_id: z4.string()
|
|
512
524
|
});
|
|
525
|
+
var TransferProductParamsSchema = z4.object({
|
|
526
|
+
from_entity_id: z4.string(),
|
|
527
|
+
to_entity_id: z4.string(),
|
|
528
|
+
product_id: z4.string()
|
|
529
|
+
});
|
|
513
530
|
|
|
514
531
|
// src/sdk/general/genTypes.ts
|
|
515
532
|
import { z as z5 } from "zod";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addReferralRoutes
|
|
3
|
-
} from "./chunk-FV6S6G2B.mjs";
|
|
4
|
-
import {
|
|
5
|
-
addEntityRoutes
|
|
6
|
-
} from "./chunk-VJTYMTEE.mjs";
|
|
7
1
|
import {
|
|
8
2
|
addGenRoutes
|
|
9
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EIP7LDKF.mjs";
|
|
10
4
|
import {
|
|
11
5
|
addProductRoutes
|
|
12
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BX2LACTF.mjs";
|
|
7
|
+
import {
|
|
8
|
+
addReferralRoutes
|
|
9
|
+
} from "./chunk-N4PGGU3D.mjs";
|
|
10
|
+
import {
|
|
11
|
+
addEntityRoutes
|
|
12
|
+
} from "./chunk-BDMGQV75.mjs";
|
|
13
13
|
import {
|
|
14
14
|
withAuth
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-O6KXYXQN.mjs";
|
|
16
16
|
import {
|
|
17
17
|
fetchPricingTable
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QGX7ZACH.mjs";
|
|
19
19
|
import {
|
|
20
20
|
BASE_PATH
|
|
21
21
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -180,6 +180,7 @@ var entityMethods = (instance) => {
|
|
|
180
180
|
params
|
|
181
181
|
}),
|
|
182
182
|
create: (customer_id, params) => staticWrapper(createEntity, instance, { customer_id, params }),
|
|
183
|
+
transfer: (customer_id, params) => staticWrapper(transferProduct, instance, { customer_id, params }),
|
|
183
184
|
delete: (customer_id, entity_id) => staticWrapper(deleteEntity, instance, { customer_id, entity_id })
|
|
184
185
|
};
|
|
185
186
|
};
|
|
@@ -215,6 +216,13 @@ var deleteEntity = async ({
|
|
|
215
216
|
}) => {
|
|
216
217
|
return instance.delete(`/customers/${customer_id}/entities/${entity_id}`);
|
|
217
218
|
};
|
|
219
|
+
var transferProduct = async ({
|
|
220
|
+
instance,
|
|
221
|
+
customer_id,
|
|
222
|
+
params
|
|
223
|
+
}) => {
|
|
224
|
+
return instance.post(`/customers/${customer_id}/transfer`, params);
|
|
225
|
+
};
|
|
218
226
|
|
|
219
227
|
// src/sdk/products/prodMethods.ts
|
|
220
228
|
var productMethods = (instance) => {
|
|
@@ -521,6 +529,10 @@ var CoreCusFeatureSchema = import_zod2.z.object({
|
|
|
521
529
|
next_reset_at: import_zod2.z.number().nullish(),
|
|
522
530
|
overage_allowed: import_zod2.z.boolean().optional(),
|
|
523
531
|
usage_limit: import_zod2.z.number().optional(),
|
|
532
|
+
rollovers: import_zod2.z.object({
|
|
533
|
+
balance: import_zod2.z.number(),
|
|
534
|
+
expires_at: import_zod2.z.number()
|
|
535
|
+
}).optional(),
|
|
524
536
|
breakdown: import_zod2.z.array(
|
|
525
537
|
import_zod2.z.object({
|
|
526
538
|
interval: import_zod2.z.nativeEnum(ProductItemInterval),
|
|
@@ -570,6 +582,11 @@ var EntityDataSchema = import_zod4.z.object({
|
|
|
570
582
|
name: import_zod4.z.string().optional(),
|
|
571
583
|
feature_id: import_zod4.z.string()
|
|
572
584
|
});
|
|
585
|
+
var TransferProductParamsSchema = import_zod4.z.object({
|
|
586
|
+
from_entity_id: import_zod4.z.string(),
|
|
587
|
+
to_entity_id: import_zod4.z.string(),
|
|
588
|
+
product_id: import_zod4.z.string()
|
|
589
|
+
});
|
|
573
590
|
|
|
574
591
|
// src/sdk/general/genTypes.ts
|
|
575
592
|
var import_zod5 = require("zod");
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-UNZHJTEY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createRouterWithOptions
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WTKY2U3S.mjs";
|
|
7
|
+
import "./chunk-EIP7LDKF.mjs";
|
|
8
|
+
import "./chunk-BX2LACTF.mjs";
|
|
9
|
+
import "./chunk-N4PGGU3D.mjs";
|
|
10
|
+
import "./chunk-BDMGQV75.mjs";
|
|
11
|
+
import "./chunk-O6KXYXQN.mjs";
|
|
12
12
|
import {
|
|
13
13
|
Autumn
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QGX7ZACH.mjs";
|
|
15
15
|
import "./chunk-2TEL6LR5.mjs";
|
|
16
16
|
import "./chunk-KSG3E4Q2.mjs";
|
|
17
17
|
|