autumn-js 0.1.1 → 0.1.2
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/dist/libraries/backend/better-auth.d.mts +144 -9
- package/dist/libraries/backend/better-auth.d.ts +144 -9
- package/dist/libraries/backend/better-auth.js +12 -0
- package/dist/libraries/backend/better-auth.mjs +20 -7
- package/dist/libraries/backend/{chunk-J2VSPYGM.mjs → chunk-F4A665AR.mjs} +1 -1
- package/dist/libraries/backend/{chunk-XB7LGW7G.mjs → chunk-GVPYJINB.mjs} +1 -1
- package/dist/libraries/backend/{chunk-KTOGBCW7.mjs → chunk-IG3DW6CW.mjs} +1 -1
- package/dist/libraries/backend/{chunk-TMPFQRFY.mjs → chunk-JARFSM7F.mjs} +1 -1
- package/dist/libraries/backend/{chunk-K4QNWERT.mjs → chunk-KYMRM3HV.mjs} +1 -1
- package/dist/libraries/backend/{chunk-DXWCLQ3N.mjs → chunk-LYDMLZB7.mjs} +1 -0
- package/dist/libraries/backend/{chunk-M74V7TUF.mjs → chunk-UZ7WFRWB.mjs} +6 -6
- package/dist/libraries/backend/convex.d.mts +0 -1
- package/dist/libraries/backend/convex.d.ts +0 -1
- package/dist/libraries/backend/convex.js +2 -2
- package/dist/libraries/backend/convex.mjs +9 -9
- 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.mjs +7 -7
- package/dist/libraries/backend/fastify.mjs +7 -7
- 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.mjs +7 -7
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.mjs +7 -7
- 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.mjs +2 -2
- package/dist/libraries/react/{chunk-FEISQQNM.mjs → chunk-5K2M3CQZ.mjs} +1 -1
- package/dist/libraries/react/{chunk-FJWZPMWU.mjs → chunk-BXMZYHE7.mjs} +3 -3
- package/dist/libraries/react/{chunk-HJI7QUTD.mjs → chunk-KIKDDSHG.mjs} +424 -422
- package/dist/libraries/react/{chunk-KUS3X33V.mjs → chunk-M7SUFZ42.mjs} +1 -1
- package/dist/libraries/react/{chunk-OTZ65PCT.mjs → chunk-MN66ZM7X.mjs} +6 -6
- package/dist/libraries/react/{chunk-YWQTQ72B.mjs → chunk-NHDZWWMZ.mjs} +2 -2
- package/dist/libraries/react/{chunk-I2A7PK2L.mjs → chunk-WT5K3J2K.mjs} +17 -17
- package/dist/libraries/react/{chunk-JGDTNJTR.mjs → chunk-YCDNQZT5.mjs} +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +14 -14
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +14 -14
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +14 -14
- package/dist/libraries/react/components/ui/accordion.mjs +3 -3
- 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 +4 -4
- package/dist/libraries/react/components/ui/popover.mjs +5 -5
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +1 -1
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +1 -1
- package/dist/libraries/react/hooks/useEntity.d.mts +2 -2
- package/dist/libraries/react/hooks/useEntity.d.ts +2 -2
- package/dist/libraries/react/hooks/useEntityBase.d.mts +2 -2
- package/dist/libraries/react/hooks/useEntityBase.d.ts +2 -2
- package/dist/next/client/NextAutumnClient.d.mts +6 -6
- package/dist/next/client/NextAutumnClient.d.ts +6 -6
- package/dist/next/client/NextAutumnProvider.d.mts +1 -1
- package/dist/next/client/NextAutumnProvider.d.ts +1 -1
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/{entTypes-DC0vr4aU.d.mts → entTypes-BcoGsNYC.d.mts} +1 -1
- package/dist/next/client/{entTypes-BRilmNmx.d.ts → entTypes-sKOZyw0N.d.ts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +3 -3
- package/dist/next/client/hooks/useAutumn.d.ts +3 -3
- package/dist/next/client/hooks/useCustomer.d.mts +4 -4
- package/dist/next/client/hooks/useCustomer.d.ts +4 -4
- package/dist/next/client/hooks/useEntity.d.mts +3 -3
- package/dist/next/client/hooks/useEntity.d.ts +3 -3
- package/dist/next/client/types.d.mts +2 -2
- package/dist/next/client/types.d.ts +2 -2
- 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 +17 -17
- package/dist/next/server/cusActions.d.ts +17 -17
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/package.json +1 -1
- package/dist/libraries/backend/{referralTypes-CQf4mX3z.d.ts → referralTypes-C4KG2r29.d.ts} +6 -6
- package/dist/libraries/backend/{referralTypes-Bxe9iJlv.d.mts → referralTypes-DA9Hp6Bm.d.mts} +6 -6
- package/dist/libraries/react/{chunk-7TYAAD2T.mjs → chunk-KWNH6C27.mjs} +11 -11
- package/dist/next/client/{attachTypes-B1E-U8us.d.mts → attachTypes-CAvqbMDV.d.mts} +2 -2
- package/dist/next/client/{attachTypes-92MRramY.d.ts → attachTypes-zg5EhNcS.d.ts} +2 -2
- package/dist/next/client/{clientAttachTypes-CBBghfgO.d.mts → clientAttachTypes-B-zWythK.d.mts} +2 -2
- package/dist/next/client/{clientAttachTypes-D6mgEcpb.d.ts → clientAttachTypes-DLh_8bIG.d.ts} +2 -2
- package/dist/next/client/{cusTypes-BVKU6cVB.d.ts → cusTypes-Crh2qzWb.d.ts} +2 -2
- package/dist/next/client/{cusTypes-BZtsQdTQ.d.mts → cusTypes-XE8bnuf2.d.mts} +2 -2
- package/dist/next/server/{cusTypes-Cy5gmwaq.d.ts → cusTypes-DUjCLJ7f.d.mts} +4 -4
- package/dist/next/server/{cusTypes-Cy5gmwaq.d.mts → cusTypes-DUjCLJ7f.d.ts} +4 -4
|
@@ -127,6 +127,141 @@ declare const autumn: (options?: {
|
|
|
127
127
|
};
|
|
128
128
|
path: "/autumn/products";
|
|
129
129
|
};
|
|
130
|
+
checkout: {
|
|
131
|
+
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
132
|
+
body: {
|
|
133
|
+
product_id: string;
|
|
134
|
+
options?: {
|
|
135
|
+
feature_id: string;
|
|
136
|
+
quantity: number;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
entity_id?: string | undefined;
|
|
139
|
+
success_url?: string | undefined;
|
|
140
|
+
customer_data?: {
|
|
141
|
+
name?: string | null | undefined;
|
|
142
|
+
email?: string | null | undefined;
|
|
143
|
+
fingerprint?: string | null | undefined;
|
|
144
|
+
} | undefined;
|
|
145
|
+
entity_data?: any;
|
|
146
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
147
|
+
reward?: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
} & {
|
|
150
|
+
method?: "POST" | undefined;
|
|
151
|
+
} & {
|
|
152
|
+
query?: Record<string, any> | undefined;
|
|
153
|
+
} & {
|
|
154
|
+
params?: Record<string, any>;
|
|
155
|
+
} & {
|
|
156
|
+
request?: Request;
|
|
157
|
+
} & {
|
|
158
|
+
headers?: HeadersInit;
|
|
159
|
+
} & {
|
|
160
|
+
asResponse?: boolean;
|
|
161
|
+
returnHeaders?: boolean;
|
|
162
|
+
use?: better_auth.Middleware[];
|
|
163
|
+
path?: string;
|
|
164
|
+
} & {
|
|
165
|
+
asResponse?: AsResponse | undefined;
|
|
166
|
+
returnHeaders?: ReturnHeaders | undefined;
|
|
167
|
+
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
168
|
+
headers: Headers;
|
|
169
|
+
response: any;
|
|
170
|
+
} : any>;
|
|
171
|
+
options: {
|
|
172
|
+
method: "POST";
|
|
173
|
+
body: z.ZodObject<Omit<{
|
|
174
|
+
customer_id: z.ZodString;
|
|
175
|
+
product_id: z.ZodString;
|
|
176
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
177
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
feature_id: z.ZodString;
|
|
179
|
+
quantity: z.ZodNumber;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
feature_id: string;
|
|
182
|
+
quantity: number;
|
|
183
|
+
}, {
|
|
184
|
+
feature_id: string;
|
|
185
|
+
quantity: number;
|
|
186
|
+
}>, "many">>;
|
|
187
|
+
success_url: z.ZodOptional<z.ZodString>;
|
|
188
|
+
customer_data: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
name?: string | null | undefined;
|
|
194
|
+
email?: string | null | undefined;
|
|
195
|
+
fingerprint?: string | null | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
name?: string | null | undefined;
|
|
198
|
+
email?: string | null | undefined;
|
|
199
|
+
fingerprint?: string | null | undefined;
|
|
200
|
+
}>>;
|
|
201
|
+
entity_data: z.ZodOptional<z.ZodAny>;
|
|
202
|
+
checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
203
|
+
reward: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
205
|
+
product_id: string;
|
|
206
|
+
options?: {
|
|
207
|
+
feature_id: string;
|
|
208
|
+
quantity: number;
|
|
209
|
+
}[] | undefined;
|
|
210
|
+
entity_id?: string | undefined;
|
|
211
|
+
success_url?: string | undefined;
|
|
212
|
+
customer_data?: {
|
|
213
|
+
name?: string | null | undefined;
|
|
214
|
+
email?: string | null | undefined;
|
|
215
|
+
fingerprint?: string | null | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
entity_data?: any;
|
|
218
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
219
|
+
reward?: string | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
product_id: string;
|
|
222
|
+
options?: {
|
|
223
|
+
feature_id: string;
|
|
224
|
+
quantity: number;
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
entity_id?: string | undefined;
|
|
227
|
+
success_url?: string | undefined;
|
|
228
|
+
customer_data?: {
|
|
229
|
+
name?: string | null | undefined;
|
|
230
|
+
email?: string | null | undefined;
|
|
231
|
+
fingerprint?: string | null | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
entity_data?: any;
|
|
234
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
235
|
+
reward?: string | undefined;
|
|
236
|
+
}>;
|
|
237
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
238
|
+
session: {
|
|
239
|
+
session: Record<string, any> & {
|
|
240
|
+
id: string;
|
|
241
|
+
token: string;
|
|
242
|
+
userId: string;
|
|
243
|
+
expiresAt: Date;
|
|
244
|
+
createdAt: Date;
|
|
245
|
+
updatedAt: Date;
|
|
246
|
+
ipAddress?: string | null | undefined;
|
|
247
|
+
userAgent?: string | null | undefined;
|
|
248
|
+
};
|
|
249
|
+
user: Record<string, any> & {
|
|
250
|
+
id: string;
|
|
251
|
+
name: string;
|
|
252
|
+
emailVerified: boolean;
|
|
253
|
+
email: string;
|
|
254
|
+
createdAt: Date;
|
|
255
|
+
updatedAt: Date;
|
|
256
|
+
image?: string | null | undefined;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
}>)[];
|
|
260
|
+
} & {
|
|
261
|
+
use: any[];
|
|
262
|
+
};
|
|
263
|
+
path: "/autumn/checkout";
|
|
264
|
+
};
|
|
130
265
|
attach: {
|
|
131
266
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
132
267
|
body: {
|
|
@@ -137,10 +272,7 @@ declare const autumn: (options?: {
|
|
|
137
272
|
metadata?: Record<string, string> | undefined;
|
|
138
273
|
product_id?: string | undefined;
|
|
139
274
|
entity_id?: string | undefined;
|
|
140
|
-
product_ids?: string[] | undefined;
|
|
141
|
-
free_trial?: boolean | undefined;
|
|
142
275
|
success_url?: string | undefined;
|
|
143
|
-
force_checkout?: boolean | undefined;
|
|
144
276
|
customer_data?: {
|
|
145
277
|
name?: string | null | undefined;
|
|
146
278
|
email?: string | null | undefined;
|
|
@@ -149,6 +281,9 @@ declare const autumn: (options?: {
|
|
|
149
281
|
entity_data?: any;
|
|
150
282
|
checkout_session_params?: Record<string, any> | undefined;
|
|
151
283
|
reward?: string | undefined;
|
|
284
|
+
product_ids?: string[] | undefined;
|
|
285
|
+
free_trial?: boolean | undefined;
|
|
286
|
+
force_checkout?: boolean | undefined;
|
|
152
287
|
};
|
|
153
288
|
} & {
|
|
154
289
|
method?: "POST" | undefined;
|
|
@@ -217,10 +352,7 @@ declare const autumn: (options?: {
|
|
|
217
352
|
metadata?: Record<string, string> | undefined;
|
|
218
353
|
product_id?: string | undefined;
|
|
219
354
|
entity_id?: string | undefined;
|
|
220
|
-
product_ids?: string[] | undefined;
|
|
221
|
-
free_trial?: boolean | undefined;
|
|
222
355
|
success_url?: string | undefined;
|
|
223
|
-
force_checkout?: boolean | undefined;
|
|
224
356
|
customer_data?: {
|
|
225
357
|
name?: string | null | undefined;
|
|
226
358
|
email?: string | null | undefined;
|
|
@@ -229,6 +361,9 @@ declare const autumn: (options?: {
|
|
|
229
361
|
entity_data?: any;
|
|
230
362
|
checkout_session_params?: Record<string, any> | undefined;
|
|
231
363
|
reward?: string | undefined;
|
|
364
|
+
product_ids?: string[] | undefined;
|
|
365
|
+
free_trial?: boolean | undefined;
|
|
366
|
+
force_checkout?: boolean | undefined;
|
|
232
367
|
}, {
|
|
233
368
|
options?: {
|
|
234
369
|
feature_id: string;
|
|
@@ -237,10 +372,7 @@ declare const autumn: (options?: {
|
|
|
237
372
|
metadata?: Record<string, string> | undefined;
|
|
238
373
|
product_id?: string | undefined;
|
|
239
374
|
entity_id?: string | undefined;
|
|
240
|
-
product_ids?: string[] | undefined;
|
|
241
|
-
free_trial?: boolean | undefined;
|
|
242
375
|
success_url?: string | undefined;
|
|
243
|
-
force_checkout?: boolean | undefined;
|
|
244
376
|
customer_data?: {
|
|
245
377
|
name?: string | null | undefined;
|
|
246
378
|
email?: string | null | undefined;
|
|
@@ -249,6 +381,9 @@ declare const autumn: (options?: {
|
|
|
249
381
|
entity_data?: any;
|
|
250
382
|
checkout_session_params?: Record<string, any> | undefined;
|
|
251
383
|
reward?: string | undefined;
|
|
384
|
+
product_ids?: string[] | undefined;
|
|
385
|
+
free_trial?: boolean | undefined;
|
|
386
|
+
force_checkout?: boolean | undefined;
|
|
252
387
|
}>;
|
|
253
388
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
254
389
|
session: {
|
|
@@ -127,6 +127,141 @@ declare const autumn: (options?: {
|
|
|
127
127
|
};
|
|
128
128
|
path: "/autumn/products";
|
|
129
129
|
};
|
|
130
|
+
checkout: {
|
|
131
|
+
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
132
|
+
body: {
|
|
133
|
+
product_id: string;
|
|
134
|
+
options?: {
|
|
135
|
+
feature_id: string;
|
|
136
|
+
quantity: number;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
entity_id?: string | undefined;
|
|
139
|
+
success_url?: string | undefined;
|
|
140
|
+
customer_data?: {
|
|
141
|
+
name?: string | null | undefined;
|
|
142
|
+
email?: string | null | undefined;
|
|
143
|
+
fingerprint?: string | null | undefined;
|
|
144
|
+
} | undefined;
|
|
145
|
+
entity_data?: any;
|
|
146
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
147
|
+
reward?: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
} & {
|
|
150
|
+
method?: "POST" | undefined;
|
|
151
|
+
} & {
|
|
152
|
+
query?: Record<string, any> | undefined;
|
|
153
|
+
} & {
|
|
154
|
+
params?: Record<string, any>;
|
|
155
|
+
} & {
|
|
156
|
+
request?: Request;
|
|
157
|
+
} & {
|
|
158
|
+
headers?: HeadersInit;
|
|
159
|
+
} & {
|
|
160
|
+
asResponse?: boolean;
|
|
161
|
+
returnHeaders?: boolean;
|
|
162
|
+
use?: better_auth.Middleware[];
|
|
163
|
+
path?: string;
|
|
164
|
+
} & {
|
|
165
|
+
asResponse?: AsResponse | undefined;
|
|
166
|
+
returnHeaders?: ReturnHeaders | undefined;
|
|
167
|
+
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
168
|
+
headers: Headers;
|
|
169
|
+
response: any;
|
|
170
|
+
} : any>;
|
|
171
|
+
options: {
|
|
172
|
+
method: "POST";
|
|
173
|
+
body: z.ZodObject<Omit<{
|
|
174
|
+
customer_id: z.ZodString;
|
|
175
|
+
product_id: z.ZodString;
|
|
176
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
177
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
feature_id: z.ZodString;
|
|
179
|
+
quantity: z.ZodNumber;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
feature_id: string;
|
|
182
|
+
quantity: number;
|
|
183
|
+
}, {
|
|
184
|
+
feature_id: string;
|
|
185
|
+
quantity: number;
|
|
186
|
+
}>, "many">>;
|
|
187
|
+
success_url: z.ZodOptional<z.ZodString>;
|
|
188
|
+
customer_data: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
name?: string | null | undefined;
|
|
194
|
+
email?: string | null | undefined;
|
|
195
|
+
fingerprint?: string | null | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
name?: string | null | undefined;
|
|
198
|
+
email?: string | null | undefined;
|
|
199
|
+
fingerprint?: string | null | undefined;
|
|
200
|
+
}>>;
|
|
201
|
+
entity_data: z.ZodOptional<z.ZodAny>;
|
|
202
|
+
checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
203
|
+
reward: z.ZodOptional<z.ZodString>;
|
|
204
|
+
}, "customer_id">, "strip", z.ZodTypeAny, {
|
|
205
|
+
product_id: string;
|
|
206
|
+
options?: {
|
|
207
|
+
feature_id: string;
|
|
208
|
+
quantity: number;
|
|
209
|
+
}[] | undefined;
|
|
210
|
+
entity_id?: string | undefined;
|
|
211
|
+
success_url?: string | undefined;
|
|
212
|
+
customer_data?: {
|
|
213
|
+
name?: string | null | undefined;
|
|
214
|
+
email?: string | null | undefined;
|
|
215
|
+
fingerprint?: string | null | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
entity_data?: any;
|
|
218
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
219
|
+
reward?: string | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
product_id: string;
|
|
222
|
+
options?: {
|
|
223
|
+
feature_id: string;
|
|
224
|
+
quantity: number;
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
entity_id?: string | undefined;
|
|
227
|
+
success_url?: string | undefined;
|
|
228
|
+
customer_data?: {
|
|
229
|
+
name?: string | null | undefined;
|
|
230
|
+
email?: string | null | undefined;
|
|
231
|
+
fingerprint?: string | null | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
entity_data?: any;
|
|
234
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
235
|
+
reward?: string | undefined;
|
|
236
|
+
}>;
|
|
237
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
238
|
+
session: {
|
|
239
|
+
session: Record<string, any> & {
|
|
240
|
+
id: string;
|
|
241
|
+
token: string;
|
|
242
|
+
userId: string;
|
|
243
|
+
expiresAt: Date;
|
|
244
|
+
createdAt: Date;
|
|
245
|
+
updatedAt: Date;
|
|
246
|
+
ipAddress?: string | null | undefined;
|
|
247
|
+
userAgent?: string | null | undefined;
|
|
248
|
+
};
|
|
249
|
+
user: Record<string, any> & {
|
|
250
|
+
id: string;
|
|
251
|
+
name: string;
|
|
252
|
+
emailVerified: boolean;
|
|
253
|
+
email: string;
|
|
254
|
+
createdAt: Date;
|
|
255
|
+
updatedAt: Date;
|
|
256
|
+
image?: string | null | undefined;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
}>)[];
|
|
260
|
+
} & {
|
|
261
|
+
use: any[];
|
|
262
|
+
};
|
|
263
|
+
path: "/autumn/checkout";
|
|
264
|
+
};
|
|
130
265
|
attach: {
|
|
131
266
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
132
267
|
body: {
|
|
@@ -137,10 +272,7 @@ declare const autumn: (options?: {
|
|
|
137
272
|
metadata?: Record<string, string> | undefined;
|
|
138
273
|
product_id?: string | undefined;
|
|
139
274
|
entity_id?: string | undefined;
|
|
140
|
-
product_ids?: string[] | undefined;
|
|
141
|
-
free_trial?: boolean | undefined;
|
|
142
275
|
success_url?: string | undefined;
|
|
143
|
-
force_checkout?: boolean | undefined;
|
|
144
276
|
customer_data?: {
|
|
145
277
|
name?: string | null | undefined;
|
|
146
278
|
email?: string | null | undefined;
|
|
@@ -149,6 +281,9 @@ declare const autumn: (options?: {
|
|
|
149
281
|
entity_data?: any;
|
|
150
282
|
checkout_session_params?: Record<string, any> | undefined;
|
|
151
283
|
reward?: string | undefined;
|
|
284
|
+
product_ids?: string[] | undefined;
|
|
285
|
+
free_trial?: boolean | undefined;
|
|
286
|
+
force_checkout?: boolean | undefined;
|
|
152
287
|
};
|
|
153
288
|
} & {
|
|
154
289
|
method?: "POST" | undefined;
|
|
@@ -217,10 +352,7 @@ declare const autumn: (options?: {
|
|
|
217
352
|
metadata?: Record<string, string> | undefined;
|
|
218
353
|
product_id?: string | undefined;
|
|
219
354
|
entity_id?: string | undefined;
|
|
220
|
-
product_ids?: string[] | undefined;
|
|
221
|
-
free_trial?: boolean | undefined;
|
|
222
355
|
success_url?: string | undefined;
|
|
223
|
-
force_checkout?: boolean | undefined;
|
|
224
356
|
customer_data?: {
|
|
225
357
|
name?: string | null | undefined;
|
|
226
358
|
email?: string | null | undefined;
|
|
@@ -229,6 +361,9 @@ declare const autumn: (options?: {
|
|
|
229
361
|
entity_data?: any;
|
|
230
362
|
checkout_session_params?: Record<string, any> | undefined;
|
|
231
363
|
reward?: string | undefined;
|
|
364
|
+
product_ids?: string[] | undefined;
|
|
365
|
+
free_trial?: boolean | undefined;
|
|
366
|
+
force_checkout?: boolean | undefined;
|
|
232
367
|
}, {
|
|
233
368
|
options?: {
|
|
234
369
|
feature_id: string;
|
|
@@ -237,10 +372,7 @@ declare const autumn: (options?: {
|
|
|
237
372
|
metadata?: Record<string, string> | undefined;
|
|
238
373
|
product_id?: string | undefined;
|
|
239
374
|
entity_id?: string | undefined;
|
|
240
|
-
product_ids?: string[] | undefined;
|
|
241
|
-
free_trial?: boolean | undefined;
|
|
242
375
|
success_url?: string | undefined;
|
|
243
|
-
force_checkout?: boolean | undefined;
|
|
244
376
|
customer_data?: {
|
|
245
377
|
name?: string | null | undefined;
|
|
246
378
|
email?: string | null | undefined;
|
|
@@ -249,6 +381,9 @@ declare const autumn: (options?: {
|
|
|
249
381
|
entity_data?: any;
|
|
250
382
|
checkout_session_params?: Record<string, any> | undefined;
|
|
251
383
|
reward?: string | undefined;
|
|
384
|
+
product_ids?: string[] | undefined;
|
|
385
|
+
free_trial?: boolean | undefined;
|
|
386
|
+
force_checkout?: boolean | undefined;
|
|
252
387
|
}>;
|
|
253
388
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
254
389
|
session: {
|
|
@@ -1183,6 +1183,7 @@ var router = createRouterWithOptions();
|
|
|
1183
1183
|
var betterAuthPathMap = {
|
|
1184
1184
|
// "create-customer": "customers",
|
|
1185
1185
|
// "customers/get": "customers",
|
|
1186
|
+
"checkout": "checkout",
|
|
1186
1187
|
attach: "attach",
|
|
1187
1188
|
check: "check",
|
|
1188
1189
|
track: "track",
|
|
@@ -1285,6 +1286,17 @@ var autumn = (options) => {
|
|
|
1285
1286
|
return await handleReq({ ctx, options, method: "GET" });
|
|
1286
1287
|
}
|
|
1287
1288
|
),
|
|
1289
|
+
checkout: (0, import_plugins.createAuthEndpoint)(
|
|
1290
|
+
"/autumn/checkout",
|
|
1291
|
+
{
|
|
1292
|
+
method: "POST",
|
|
1293
|
+
body: CheckoutParamsSchema.omit({
|
|
1294
|
+
customer_id: true
|
|
1295
|
+
}),
|
|
1296
|
+
use: [import_api.sessionMiddleware]
|
|
1297
|
+
},
|
|
1298
|
+
async (ctx) => handleReq({ ctx, options, method: "POST" })
|
|
1299
|
+
),
|
|
1288
1300
|
attach: (0, import_plugins.createAuthEndpoint)(
|
|
1289
1301
|
"/autumn/attach",
|
|
1290
1302
|
{
|
|
@@ -3,23 +3,24 @@ 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-UZ7WFRWB.mjs";
|
|
7
|
+
import "./chunk-GVPYJINB.mjs";
|
|
8
|
+
import "./chunk-KYMRM3HV.mjs";
|
|
9
|
+
import "./chunk-IG3DW6CW.mjs";
|
|
10
|
+
import "./chunk-JARFSM7F.mjs";
|
|
11
|
+
import "./chunk-F4A665AR.mjs";
|
|
12
12
|
import {
|
|
13
13
|
AttachParamsSchema,
|
|
14
14
|
Autumn,
|
|
15
15
|
BillingPortalParamsSchema,
|
|
16
16
|
CancelParamsSchema,
|
|
17
17
|
CheckParamsSchema,
|
|
18
|
+
CheckoutParamsSchema,
|
|
18
19
|
CreateReferralCodeParamsSchema,
|
|
19
20
|
CustomerExpandEnum,
|
|
20
21
|
RedeemReferralCodeParamsSchema,
|
|
21
22
|
TrackParamsSchema
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LYDMLZB7.mjs";
|
|
23
24
|
import "./chunk-2TEL6LR5.mjs";
|
|
24
25
|
import "./chunk-KSG3E4Q2.mjs";
|
|
25
26
|
|
|
@@ -33,6 +34,7 @@ var router = createRouterWithOptions();
|
|
|
33
34
|
var betterAuthPathMap = {
|
|
34
35
|
// "create-customer": "customers",
|
|
35
36
|
// "customers/get": "customers",
|
|
37
|
+
"checkout": "checkout",
|
|
36
38
|
attach: "attach",
|
|
37
39
|
check: "check",
|
|
38
40
|
track: "track",
|
|
@@ -135,6 +137,17 @@ var autumn = (options) => {
|
|
|
135
137
|
return await handleReq({ ctx, options, method: "GET" });
|
|
136
138
|
}
|
|
137
139
|
),
|
|
140
|
+
checkout: createAuthEndpoint(
|
|
141
|
+
"/autumn/checkout",
|
|
142
|
+
{
|
|
143
|
+
method: "POST",
|
|
144
|
+
body: CheckoutParamsSchema.omit({
|
|
145
|
+
customer_id: true
|
|
146
|
+
}),
|
|
147
|
+
use: [sessionMiddleware]
|
|
148
|
+
},
|
|
149
|
+
async (ctx) => handleReq({ ctx, options, method: "POST" })
|
|
150
|
+
),
|
|
138
151
|
attach: createAuthEndpoint(
|
|
139
152
|
"/autumn/attach",
|
|
140
153
|
{
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addGenRoutes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GVPYJINB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
addProductRoutes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KYMRM3HV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
addReferralRoutes
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IG3DW6CW.mjs";
|
|
10
10
|
import {
|
|
11
11
|
addEntityRoutes
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JARFSM7F.mjs";
|
|
13
13
|
import {
|
|
14
14
|
withAuth
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-F4A665AR.mjs";
|
|
16
16
|
import {
|
|
17
17
|
fetchPricingTable
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LYDMLZB7.mjs";
|
|
19
19
|
import {
|
|
20
20
|
BASE_PATH
|
|
21
21
|
} from "./chunk-KSG3E4Q2.mjs";
|
|
@@ -1182,7 +1182,7 @@ function autumnHandler(options) {
|
|
|
1182
1182
|
return new Response(null, {
|
|
1183
1183
|
headers: new Headers({
|
|
1184
1184
|
// e.g. https://mywebsite.com, configured on your Convex dashboard, or passed in as an option
|
|
1185
|
-
"Access-Control-Allow-Origin":
|
|
1185
|
+
"Access-Control-Allow-Origin": process.env.CLIENT_ORIGIN ?? "http://localhost:3000",
|
|
1186
1186
|
"Access-Control-Allow-Methods": "POST, GET, PATCH, DELETE, OPTIONS",
|
|
1187
1187
|
"Access-Control-Allow-Headers": "Content-Type, Digest, Authorization, Cookie",
|
|
1188
1188
|
"Access-Control-Allow-Credentials": "true",
|
|
@@ -1226,7 +1226,7 @@ function autumnHandler(options) {
|
|
|
1226
1226
|
return Response.json(result.body, {
|
|
1227
1227
|
status: result.statusCode,
|
|
1228
1228
|
headers: new Headers({
|
|
1229
|
-
"Access-Control-Allow-Origin":
|
|
1229
|
+
"Access-Control-Allow-Origin": process.env.CLIENT_ORIGIN ?? "http://localhost:3000",
|
|
1230
1230
|
"Access-Control-Allow-Credentials": "true",
|
|
1231
1231
|
Vary: "origin"
|
|
1232
1232
|
})
|
|
@@ -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-UZ7WFRWB.mjs";
|
|
7
|
+
import "./chunk-GVPYJINB.mjs";
|
|
8
|
+
import "./chunk-KYMRM3HV.mjs";
|
|
9
|
+
import "./chunk-IG3DW6CW.mjs";
|
|
10
|
+
import "./chunk-JARFSM7F.mjs";
|
|
11
|
+
import "./chunk-F4A665AR.mjs";
|
|
12
12
|
import {
|
|
13
13
|
Autumn
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LYDMLZB7.mjs";
|
|
15
15
|
import "./chunk-2TEL6LR5.mjs";
|
|
16
16
|
import "./chunk-KSG3E4Q2.mjs";
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ function autumnHandler(options) {
|
|
|
25
25
|
return new Response(null, {
|
|
26
26
|
headers: new Headers({
|
|
27
27
|
// e.g. https://mywebsite.com, configured on your Convex dashboard, or passed in as an option
|
|
28
|
-
"Access-Control-Allow-Origin":
|
|
28
|
+
"Access-Control-Allow-Origin": process.env.CLIENT_ORIGIN ?? "http://localhost:3000",
|
|
29
29
|
"Access-Control-Allow-Methods": "POST, GET, PATCH, DELETE, OPTIONS",
|
|
30
30
|
"Access-Control-Allow-Headers": "Content-Type, Digest, Authorization, Cookie",
|
|
31
31
|
"Access-Control-Allow-Credentials": "true",
|
|
@@ -69,7 +69,7 @@ function autumnHandler(options) {
|
|
|
69
69
|
return Response.json(result.body, {
|
|
70
70
|
status: result.statusCode,
|
|
71
71
|
headers: new Headers({
|
|
72
|
-
"Access-Control-Allow-Origin":
|
|
72
|
+
"Access-Control-Allow-Origin": process.env.CLIENT_ORIGIN ?? "http://localhost:3000",
|
|
73
73
|
"Access-Control-Allow-Credentials": "true",
|
|
74
74
|
Vary: "origin"
|
|
75
75
|
})
|