autumn-js 0.0.93 → 0.0.95
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 +175 -210
- package/dist/libraries/backend/better-auth.d.ts +175 -210
- package/dist/libraries/backend/better-auth.js +150 -162
- package/dist/libraries/backend/better-auth.mjs +64 -134
- package/dist/libraries/backend/{chunk-VFTHGJ5N.mjs → chunk-33NT3WE5.mjs} +1 -1
- package/dist/libraries/backend/{chunk-V6M7KRGN.mjs → chunk-6VS7TU7O.mjs} +109 -35
- package/dist/libraries/backend/{chunk-JPNRDMMC.mjs → chunk-AKV5N4WO.mjs} +1 -1
- package/dist/libraries/backend/{chunk-7QSJB2C5.mjs → chunk-CEZHD5H6.mjs} +1 -1
- package/dist/libraries/backend/{chunk-NTFR7Z2G.mjs → chunk-DUDRVC7W.mjs} +6 -6
- package/dist/libraries/backend/{chunk-FCEB2GBS.mjs → chunk-J3L3OBSS.mjs} +1 -1
- package/dist/libraries/backend/{chunk-U7335VZS.mjs → chunk-RA4AC56B.mjs} +1 -1
- package/dist/libraries/backend/convex.js +101 -35
- package/dist/libraries/backend/convex.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 +101 -35
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +101 -35
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +101 -35
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/next.js +103 -37
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +101 -35
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-ecz_wESO.d.mts → referralTypes-Dg9pRvI7.d.mts} +196 -95
- package/dist/libraries/backend/{referralTypes-BAYl5TR1.d.ts → referralTypes-HAk2vTns.d.ts} +196 -95
- package/dist/libraries/backend/remix_dep.js +101 -35
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +101 -35
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +101 -35
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +101 -35
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +101 -35
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +101 -35
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +101 -35
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +101 -35
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +101 -35
- 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 +101 -35
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +4 -4
- package/dist/libraries/react/AutumnContext.d.ts +4 -4
- package/dist/libraries/react/AutumnContext.js +129 -52
- package/dist/libraries/react/AutumnContext.mjs +8 -8
- package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.js +135 -62
- package/dist/libraries/react/BaseAutumnProvider.mjs +13 -13
- package/dist/libraries/react/{ReactAutumnClient-Z3DcfZ0x.d.mts → ReactAutumnClient-BuSRDMJN.d.mts} +18 -8
- package/dist/libraries/react/{ReactAutumnClient-GEzKNujl.d.ts → ReactAutumnClient-k0qbHX8f.d.ts} +18 -8
- package/dist/libraries/react/ReactAutumnProvider.d.mts +3 -3
- package/dist/libraries/react/ReactAutumnProvider.d.ts +3 -3
- package/dist/libraries/react/ReactAutumnProvider.js +138 -64
- package/dist/libraries/react/ReactAutumnProvider.mjs +14 -14
- package/dist/libraries/react/{chunk-TBKIB6DH.mjs → chunk-5G3DYUNT.mjs} +1 -1
- package/dist/libraries/react/{chunk-QTEFT7SA.mjs → chunk-6CJ3FB74.mjs} +2 -2
- package/dist/libraries/react/{chunk-QAHVMSK4.mjs → chunk-ALFXUHDD.mjs} +123 -49
- package/dist/libraries/react/{chunk-TD6CFKDQ.mjs → chunk-AOJCMXVS.mjs} +6 -5
- package/dist/libraries/react/{chunk-SJAAUTL2.mjs → chunk-APDR7D6A.mjs} +2 -2
- package/dist/libraries/react/{chunk-GK75OJJJ.mjs → chunk-CAMHARUX.mjs} +2 -2
- package/dist/libraries/react/{chunk-CZAXPWHV.mjs → chunk-CHXNYNH3.mjs} +7 -7
- package/dist/libraries/react/{chunk-UHUADKEF.mjs → chunk-DVMVIAZE.mjs} +1 -1
- package/dist/libraries/react/{chunk-ITN754AD.mjs → chunk-G3FBFZLU.mjs} +4 -1
- package/dist/libraries/react/{chunk-3WP2MI55.mjs → chunk-LVDONEVF.mjs} +2 -2
- package/dist/libraries/react/{chunk-6JOSRG5Z.mjs → chunk-MZDRIPNS.mjs} +2 -2
- package/dist/libraries/react/{chunk-CHQRTGXF.mjs → chunk-R4BYOLST.mjs} +2 -2
- package/dist/libraries/react/{chunk-CRIKYVUD.mjs → chunk-T5PIJ4HG.mjs} +8 -12
- package/dist/libraries/react/{chunk-YUV2Y2RW.mjs → chunk-V575SGOW.mjs} +1 -1
- package/dist/libraries/react/{chunk-NZ5PEXT2.mjs → chunk-VTGR7VVK.mjs} +1 -1
- package/dist/libraries/react/{chunk-JNM4BLTM.mjs → chunk-VUBJ6JM3.mjs} +6 -6
- package/dist/libraries/react/{chunk-TGX6UKKS.mjs → chunk-WFFVOEUG.mjs} +1 -1
- package/dist/libraries/react/{chunk-V5PKOA5A.mjs → chunk-ZF2HUCN6.mjs} +3 -3
- package/dist/libraries/react/{chunk-3EYF7OI5.mjs → chunk-ZV4RPZTM.mjs} +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.js +126 -52
- package/dist/libraries/react/client/ReactAutumnClient.mjs +7 -7
- package/dist/libraries/react/client/clientCompMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientCompMethods.js +1 -1
- package/dist/libraries/react/client/clientCompMethods.mjs +1 -1
- package/dist/libraries/react/client/clientCusMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientCusMethods.js +1 -1
- package/dist/libraries/react/client/clientCusMethods.mjs +1 -1
- package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.js +3 -3
- package/dist/libraries/react/client/clientEntityMethods.mjs +1 -1
- package/dist/libraries/react/client/clientGenMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientGenMethods.js +6 -6
- package/dist/libraries/react/client/clientGenMethods.mjs +1 -1
- package/dist/libraries/react/client/clientProdMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientProdMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientProdMethods.js +1 -1
- package/dist/libraries/react/client/clientProdMethods.mjs +1 -1
- package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.js +2 -2
- package/dist/libraries/react/client/clientReferralMethods.mjs +1 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +135 -62
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +21 -21
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -1
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +135 -62
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +21 -21
- 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/{cusTypes-DUC0TrK5.d.ts → cusTypes-Vw94kPR9.d.mts} +1 -1
- package/dist/libraries/react/{cusTypes-DUC0TrK5.d.mts → cusTypes-Vw94kPR9.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-Ddl0CGp9.d.ts → entTypes-B7nuhHD7.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-Mq0F4CAa.d.mts → entTypes-Ho-VocKG.d.mts} +1 -1
- package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
- package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
- package/dist/libraries/react/hooks/useAutumn.d.mts +2 -2
- package/dist/libraries/react/hooks/useAutumn.d.ts +2 -2
- package/dist/libraries/react/hooks/useAutumn.js +129 -52
- package/dist/libraries/react/hooks/useAutumn.mjs +11 -11
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +4 -4
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +4 -4
- package/dist/libraries/react/hooks/useAutumnBase.js +129 -52
- package/dist/libraries/react/hooks/useAutumnBase.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomer.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomer.d.ts +4 -4
- package/dist/libraries/react/hooks/useCustomer.js +135 -62
- package/dist/libraries/react/hooks/useCustomer.mjs +12 -12
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -5
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -5
- package/dist/libraries/react/hooks/useCustomerBase.js +135 -62
- package/dist/libraries/react/hooks/useCustomerBase.mjs +11 -11
- package/dist/libraries/react/hooks/useEntity.d.mts +15 -5
- package/dist/libraries/react/hooks/useEntity.d.ts +15 -5
- package/dist/libraries/react/hooks/useEntity.js +129 -52
- package/dist/libraries/react/hooks/useEntity.mjs +12 -12
- package/dist/libraries/react/hooks/useEntityBase.d.mts +16 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +16 -6
- package/dist/libraries/react/hooks/useEntityBase.js +129 -52
- package/dist/libraries/react/hooks/useEntityBase.mjs +11 -11
- 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 +129 -52
- package/dist/libraries/react/hooks/usePricingTable.mjs +10 -10
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -4
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -4
- package/dist/libraries/react/hooks/usePricingTableBase.js +129 -52
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +9 -9
- package/dist/libraries/react/hooks/useProductsBase.js +129 -52
- package/dist/libraries/react/hooks/useProductsBase.mjs +8 -8
- package/dist/libraries/react/index.d.mts +57 -26
- package/dist/libraries/react/index.d.ts +57 -26
- package/dist/libraries/react/index.js +138 -64
- package/dist/libraries/react/index.mjs +138 -64
- package/dist/libraries/react/{response-B8Tq3x66.d.ts → response-CQf3mDB8.d.ts} +32 -10
- package/dist/libraries/react/{response-CMrRLv9c.d.mts → response-CWluLfIs.d.mts} +32 -10
- package/dist/next/{AutumnProvider-DtLqoQp6.d.mts → AutumnProvider-CCYZC_bN.d.mts} +1 -1
- package/dist/next/{AutumnProvider-DtLqoQp6.d.ts → AutumnProvider-CCYZC_bN.d.ts} +1 -1
- package/dist/next/AutumnProvider.d.mts +1 -1
- package/dist/next/AutumnProvider.d.ts +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +16 -6
- package/dist/next/client/NextAutumnClient.d.ts +16 -6
- package/dist/next/client/{clientGenTypes-DWrGEdrD.d.mts → clientGenTypes-9ngy1q97.d.mts} +31 -9
- package/dist/next/client/{clientGenTypes-D_Ea92Du.d.ts → clientGenTypes-CxB4go6q.d.ts} +31 -9
- package/dist/next/client/hooks/useAutumn.d.mts +1 -1
- package/dist/next/client/hooks/useAutumn.d.ts +1 -1
- package/dist/next/client/hooks/useCustomer.d.mts +1 -2
- package/dist/next/client/hooks/useCustomer.d.ts +1 -2
- package/dist/next/client/hooks/useEntity.d.mts +13 -3
- package/dist/next/client/hooks/useEntity.d.ts +13 -3
- package/dist/next/index.d.mts +80 -39
- package/dist/next/index.d.ts +80 -39
- 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 +175 -79
- package/dist/next/server/cusActions.d.ts +175 -79
- package/dist/next/server/{cusTypes-C86FOl99.d.mts → cusTypes-Cy72qmFx.d.mts} +11 -6
- package/dist/next/server/{cusTypes-C86FOl99.d.ts → cusTypes-Cy72qmFx.d.ts} +11 -6
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +234 -81
- package/dist/sdk/index.d.ts +234 -81
- package/dist/sdk/index.js +74 -4
- package/dist/sdk/index.mjs +65 -5
- package/dist/utils/encryptUtils.js +101 -35
- package/dist/utils/encryptUtils.mjs +101 -35
- package/package.json +1 -1
|
@@ -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-DUDRVC7W.mjs";
|
|
7
|
+
import "./chunk-33NT3WE5.mjs";
|
|
8
|
+
import "./chunk-RA4AC56B.mjs";
|
|
9
|
+
import "./chunk-J3L3OBSS.mjs";
|
|
10
|
+
import "./chunk-AKV5N4WO.mjs";
|
|
11
|
+
import "./chunk-CEZHD5H6.mjs";
|
|
12
12
|
import {
|
|
13
13
|
Autumn
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6VS7TU7O.mjs";
|
|
15
15
|
import "./chunk-45WVZY23.mjs";
|
|
16
16
|
import {
|
|
17
17
|
autumnApiUrl
|
package/dist/libraries/backend/{referralTypes-ecz_wESO.d.mts → referralTypes-Dg9pRvI7.d.mts}
RENAMED
|
@@ -230,19 +230,19 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
230
230
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
231
231
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
232
232
|
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
metadata?: Record<string, any> | undefined;
|
|
234
233
|
id?: string | null | undefined;
|
|
235
234
|
name?: string | null | undefined;
|
|
236
235
|
email?: string | null | undefined;
|
|
237
236
|
fingerprint?: string | null | undefined;
|
|
238
|
-
expand?: ("referrals" | "invoices" | "rewards" | "trials_used" | "entities" | "payment_method")[] | undefined;
|
|
239
|
-
}, {
|
|
240
237
|
metadata?: Record<string, any> | undefined;
|
|
238
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
239
|
+
}, {
|
|
241
240
|
id?: string | null | undefined;
|
|
242
241
|
name?: string | null | undefined;
|
|
243
242
|
email?: string | null | undefined;
|
|
244
243
|
fingerprint?: string | null | undefined;
|
|
245
|
-
|
|
244
|
+
metadata?: Record<string, any> | undefined;
|
|
245
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
246
246
|
}>;
|
|
247
247
|
type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
|
|
248
248
|
interface UpdateCustomerParams {
|
|
@@ -251,9 +251,14 @@ interface UpdateCustomerParams {
|
|
|
251
251
|
email?: string | null;
|
|
252
252
|
fingerprint?: string | null;
|
|
253
253
|
}
|
|
254
|
-
|
|
255
|
-
return_url
|
|
256
|
-
}
|
|
254
|
+
declare const BillingPortalParamsSchema: z.ZodObject<{
|
|
255
|
+
return_url: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
return_url?: string | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
return_url?: string | undefined;
|
|
260
|
+
}>;
|
|
261
|
+
type BillingPortalParams = z.infer<typeof BillingPortalParamsSchema>;
|
|
257
262
|
interface CustomerInvoice {
|
|
258
263
|
product_ids: string[];
|
|
259
264
|
stripe_id: string;
|
|
@@ -264,38 +269,6 @@ interface CustomerInvoice {
|
|
|
264
269
|
hosted_invoice_url: string;
|
|
265
270
|
}
|
|
266
271
|
|
|
267
|
-
type EntityExpandOption = "invoices";
|
|
268
|
-
|
|
269
|
-
interface CreateEntityParams {
|
|
270
|
-
id: string;
|
|
271
|
-
name: string;
|
|
272
|
-
feature_id: string;
|
|
273
|
-
customer_data?: CustomerData;
|
|
274
|
-
}
|
|
275
|
-
interface CreateEntityResult {
|
|
276
|
-
success: boolean;
|
|
277
|
-
}
|
|
278
|
-
interface DeleteEntityResult {
|
|
279
|
-
success: boolean;
|
|
280
|
-
}
|
|
281
|
-
interface GetEntityParams {
|
|
282
|
-
expand?: EntityExpandOption[];
|
|
283
|
-
}
|
|
284
|
-
interface Entity {
|
|
285
|
-
id: string;
|
|
286
|
-
name: string;
|
|
287
|
-
customer_id: string;
|
|
288
|
-
created_at: number;
|
|
289
|
-
env: string;
|
|
290
|
-
products: CustomerProduct[];
|
|
291
|
-
features: Record<string, CustomerFeature>;
|
|
292
|
-
invoices?: CustomerInvoice[];
|
|
293
|
-
}
|
|
294
|
-
interface EntityData {
|
|
295
|
-
name?: string;
|
|
296
|
-
feature_id: string;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
272
|
declare const AttachParamsSchema: z.ZodObject<{
|
|
300
273
|
customer_id: z.ZodString;
|
|
301
274
|
product_id: z.ZodOptional<z.ZodString>;
|
|
@@ -304,11 +277,11 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
304
277
|
feature_id: z.ZodString;
|
|
305
278
|
quantity: z.ZodNumber;
|
|
306
279
|
}, "strip", z.ZodTypeAny, {
|
|
307
|
-
quantity: number;
|
|
308
280
|
feature_id: string;
|
|
309
|
-
}, {
|
|
310
281
|
quantity: number;
|
|
282
|
+
}, {
|
|
311
283
|
feature_id: string;
|
|
284
|
+
quantity: number;
|
|
312
285
|
}>, "many">>;
|
|
313
286
|
product_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
314
287
|
free_trial: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -321,13 +294,12 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
321
294
|
reward: z.ZodOptional<z.ZodString>;
|
|
322
295
|
}, "strip", z.ZodTypeAny, {
|
|
323
296
|
customer_id: string;
|
|
324
|
-
|
|
297
|
+
entity_id?: string | undefined;
|
|
325
298
|
options?: {
|
|
326
|
-
quantity: number;
|
|
327
299
|
feature_id: string;
|
|
300
|
+
quantity: number;
|
|
328
301
|
}[] | undefined;
|
|
329
|
-
|
|
330
|
-
entity_id?: string | undefined;
|
|
302
|
+
metadata?: Record<string, string> | undefined;
|
|
331
303
|
product_id?: string | undefined;
|
|
332
304
|
product_ids?: string[] | undefined;
|
|
333
305
|
free_trial?: boolean | undefined;
|
|
@@ -336,15 +308,15 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
336
308
|
customer_data?: any;
|
|
337
309
|
entity_data?: any;
|
|
338
310
|
checkout_session_params?: Record<string, any> | undefined;
|
|
311
|
+
reward?: string | undefined;
|
|
339
312
|
}, {
|
|
340
313
|
customer_id: string;
|
|
341
|
-
|
|
314
|
+
entity_id?: string | undefined;
|
|
342
315
|
options?: {
|
|
343
|
-
quantity: number;
|
|
344
316
|
feature_id: string;
|
|
317
|
+
quantity: number;
|
|
345
318
|
}[] | undefined;
|
|
346
|
-
|
|
347
|
-
entity_id?: string | undefined;
|
|
319
|
+
metadata?: Record<string, string> | undefined;
|
|
348
320
|
product_id?: string | undefined;
|
|
349
321
|
product_ids?: string[] | undefined;
|
|
350
322
|
free_trial?: boolean | undefined;
|
|
@@ -353,47 +325,102 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
353
325
|
customer_data?: any;
|
|
354
326
|
entity_data?: any;
|
|
355
327
|
checkout_session_params?: Record<string, any> | undefined;
|
|
328
|
+
reward?: string | undefined;
|
|
356
329
|
}>;
|
|
357
330
|
type AttachParams = z.infer<typeof AttachParamsSchema>;
|
|
358
|
-
|
|
331
|
+
declare const CancelParamsSchema: z.ZodObject<{
|
|
332
|
+
customer_id: z.ZodString;
|
|
333
|
+
product_id: z.ZodString;
|
|
334
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
335
|
+
cancel_immediately: z.ZodOptional<z.ZodBoolean>;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
359
337
|
customer_id: string;
|
|
360
338
|
product_id: string;
|
|
361
|
-
entity_id?: string;
|
|
362
|
-
cancel_immediately?: boolean;
|
|
363
|
-
}
|
|
364
|
-
interface CancelResult {
|
|
365
|
-
success: boolean;
|
|
339
|
+
entity_id?: string | undefined;
|
|
340
|
+
cancel_immediately?: boolean | undefined;
|
|
341
|
+
}, {
|
|
366
342
|
customer_id: string;
|
|
367
343
|
product_id: string;
|
|
368
|
-
|
|
369
|
-
|
|
344
|
+
entity_id?: string | undefined;
|
|
345
|
+
cancel_immediately?: boolean | undefined;
|
|
346
|
+
}>;
|
|
347
|
+
type CancelParams = z.infer<typeof CancelParamsSchema>;
|
|
348
|
+
declare const TrackParamsSchema: z.ZodObject<{
|
|
349
|
+
customer_id: z.ZodString;
|
|
350
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
feature_id: z.ZodOptional<z.ZodString>;
|
|
352
|
+
event_name: z.ZodOptional<z.ZodString>;
|
|
353
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
354
|
+
customer_data: z.ZodOptional<z.ZodAny>;
|
|
355
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
356
|
+
entity_data: z.ZodOptional<z.ZodAny>;
|
|
357
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
358
|
customer_id: string;
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
interface TrackResult {
|
|
380
|
-
id: string;
|
|
381
|
-
code: string;
|
|
359
|
+
feature_id?: string | undefined;
|
|
360
|
+
entity_id?: string | undefined;
|
|
361
|
+
value?: number | undefined;
|
|
362
|
+
customer_data?: any;
|
|
363
|
+
entity_data?: any;
|
|
364
|
+
event_name?: string | undefined;
|
|
365
|
+
idempotency_key?: string | undefined;
|
|
366
|
+
}, {
|
|
382
367
|
customer_id: string;
|
|
383
|
-
feature_id?: string;
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
368
|
+
feature_id?: string | undefined;
|
|
369
|
+
entity_id?: string | undefined;
|
|
370
|
+
value?: number | undefined;
|
|
371
|
+
customer_data?: any;
|
|
372
|
+
entity_data?: any;
|
|
373
|
+
event_name?: string | undefined;
|
|
374
|
+
idempotency_key?: string | undefined;
|
|
375
|
+
}>;
|
|
376
|
+
type TrackParams = z.infer<typeof TrackParamsSchema>;
|
|
377
|
+
declare const CheckParamsSchema: z.ZodObject<{
|
|
378
|
+
customer_id: z.ZodString;
|
|
379
|
+
feature_id: z.ZodOptional<z.ZodString>;
|
|
380
|
+
product_id: z.ZodOptional<z.ZodString>;
|
|
381
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
382
|
+
customer_data: z.ZodOptional<z.ZodAny>;
|
|
383
|
+
required_balance: z.ZodOptional<z.ZodNumber>;
|
|
384
|
+
send_event: z.ZodOptional<z.ZodBoolean>;
|
|
385
|
+
with_preview: z.ZodOptional<z.ZodBoolean>;
|
|
386
|
+
entity_data: z.ZodOptional<z.ZodObject<{
|
|
387
|
+
name: z.ZodOptional<z.ZodString>;
|
|
388
|
+
feature_id: z.ZodString;
|
|
389
|
+
}, "strip", z.ZodTypeAny, {
|
|
390
|
+
feature_id: string;
|
|
391
|
+
name?: string | undefined;
|
|
392
|
+
}, {
|
|
393
|
+
feature_id: string;
|
|
394
|
+
name?: string | undefined;
|
|
395
|
+
}>>;
|
|
396
|
+
}, "strip", z.ZodTypeAny, {
|
|
387
397
|
customer_id: string;
|
|
388
|
-
feature_id?: string;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
398
|
+
feature_id?: string | undefined;
|
|
399
|
+
entity_id?: string | undefined;
|
|
400
|
+
required_balance?: number | undefined;
|
|
401
|
+
product_id?: string | undefined;
|
|
402
|
+
customer_data?: any;
|
|
403
|
+
entity_data?: {
|
|
404
|
+
feature_id: string;
|
|
405
|
+
name?: string | undefined;
|
|
406
|
+
} | undefined;
|
|
407
|
+
send_event?: boolean | undefined;
|
|
408
|
+
with_preview?: boolean | undefined;
|
|
409
|
+
}, {
|
|
410
|
+
customer_id: string;
|
|
411
|
+
feature_id?: string | undefined;
|
|
412
|
+
entity_id?: string | undefined;
|
|
413
|
+
required_balance?: number | undefined;
|
|
414
|
+
product_id?: string | undefined;
|
|
415
|
+
customer_data?: any;
|
|
416
|
+
entity_data?: {
|
|
417
|
+
feature_id: string;
|
|
418
|
+
name?: string | undefined;
|
|
419
|
+
} | undefined;
|
|
420
|
+
send_event?: boolean | undefined;
|
|
421
|
+
with_preview?: boolean | undefined;
|
|
422
|
+
}>;
|
|
423
|
+
type CheckParams = z.infer<typeof CheckParamsSchema>;
|
|
397
424
|
type CheckResult = CheckFeatureResult & CheckProductResult;
|
|
398
425
|
interface UsageParams {
|
|
399
426
|
customer_id: string;
|
|
@@ -480,26 +507,34 @@ declare class Autumn {
|
|
|
480
507
|
redeemCode: (params: RedeemReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
481
508
|
};
|
|
482
509
|
static attach: (params: AttachParams) => Promise<Result<{
|
|
483
|
-
message: string;
|
|
484
|
-
code: string;
|
|
485
510
|
customer_id: string;
|
|
511
|
+
code: string;
|
|
512
|
+
message: string;
|
|
486
513
|
product_ids: string[];
|
|
487
514
|
customer_data?: any;
|
|
488
515
|
checkout_url?: string | undefined;
|
|
489
516
|
}, AutumnError>>;
|
|
490
517
|
static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
|
|
491
518
|
attach(params: AttachParams): Promise<Result<{
|
|
492
|
-
message: string;
|
|
493
|
-
code: string;
|
|
494
519
|
customer_id: string;
|
|
520
|
+
code: string;
|
|
521
|
+
message: string;
|
|
495
522
|
product_ids: string[];
|
|
496
523
|
customer_data?: any;
|
|
497
524
|
checkout_url?: string | undefined;
|
|
498
525
|
}, AutumnError>>;
|
|
499
526
|
static setupPayment: (params: SetupPaymentParams) => Promise<Result<SetupPaymentResult, AutumnError>>;
|
|
500
527
|
setupPayment(params: SetupPaymentParams): Promise<Result<SetupPaymentResult, AutumnError>>;
|
|
501
|
-
static cancel: (params: CancelParams) => Promise<Result<
|
|
502
|
-
|
|
528
|
+
static cancel: (params: CancelParams) => Promise<Result<{
|
|
529
|
+
customer_id: string;
|
|
530
|
+
product_id: string;
|
|
531
|
+
success: boolean;
|
|
532
|
+
}, AutumnError>>;
|
|
533
|
+
cancel(params: CancelParams): Promise<Result<{
|
|
534
|
+
customer_id: string;
|
|
535
|
+
product_id: string;
|
|
536
|
+
success: boolean;
|
|
537
|
+
}, AutumnError>>;
|
|
503
538
|
/**
|
|
504
539
|
* @deprecated This method is deprecated and will be removed in a future version.
|
|
505
540
|
* Please use the new check() method instead.
|
|
@@ -516,24 +551,90 @@ declare class Autumn {
|
|
|
516
551
|
* @deprecated This method is deprecated and will be removed in a future version.
|
|
517
552
|
* Please use the new track() method instead.
|
|
518
553
|
*/
|
|
519
|
-
static event: (params: TrackParams) => Promise<Result<
|
|
554
|
+
static event: (params: TrackParams) => Promise<Result<{
|
|
555
|
+
customer_id: string;
|
|
556
|
+
code: string;
|
|
557
|
+
id: string;
|
|
558
|
+
feature_id?: string | undefined;
|
|
559
|
+
event_name?: string | undefined;
|
|
560
|
+
}, AutumnError>>;
|
|
520
561
|
/**
|
|
521
562
|
* @deprecated This method is deprecated and will be removed in a future version.
|
|
522
563
|
* Please use the new track() method instead.
|
|
523
564
|
*/
|
|
524
|
-
event(params: TrackParams): Promise<Result<
|
|
525
|
-
|
|
526
|
-
|
|
565
|
+
event(params: TrackParams): Promise<Result<{
|
|
566
|
+
customer_id: string;
|
|
567
|
+
code: string;
|
|
568
|
+
id: string;
|
|
569
|
+
feature_id?: string | undefined;
|
|
570
|
+
event_name?: string | undefined;
|
|
571
|
+
}, AutumnError>>;
|
|
572
|
+
static track: (params: TrackParams) => Promise<Result<{
|
|
573
|
+
customer_id: string;
|
|
574
|
+
code: string;
|
|
575
|
+
id: string;
|
|
576
|
+
feature_id?: string | undefined;
|
|
577
|
+
event_name?: string | undefined;
|
|
578
|
+
}, AutumnError>>;
|
|
579
|
+
track(params: TrackParams): Promise<Result<{
|
|
580
|
+
customer_id: string;
|
|
581
|
+
code: string;
|
|
582
|
+
id: string;
|
|
583
|
+
feature_id?: string | undefined;
|
|
584
|
+
event_name?: string | undefined;
|
|
585
|
+
}, AutumnError>>;
|
|
527
586
|
usage(params: UsageParams): Promise<Result<UsageResult, AutumnError>>;
|
|
528
587
|
}
|
|
529
588
|
|
|
530
|
-
|
|
589
|
+
type EntityExpandOption = "invoices";
|
|
590
|
+
|
|
591
|
+
interface CreateEntityParams {
|
|
592
|
+
id: string;
|
|
593
|
+
name: string;
|
|
594
|
+
feature_id: string;
|
|
595
|
+
customer_data?: CustomerData;
|
|
596
|
+
}
|
|
597
|
+
interface CreateEntityResult {
|
|
598
|
+
success: boolean;
|
|
599
|
+
}
|
|
600
|
+
interface DeleteEntityResult {
|
|
601
|
+
success: boolean;
|
|
602
|
+
}
|
|
603
|
+
interface GetEntityParams {
|
|
604
|
+
expand?: EntityExpandOption[];
|
|
605
|
+
}
|
|
606
|
+
interface Entity {
|
|
607
|
+
id: string;
|
|
608
|
+
name: string;
|
|
531
609
|
customer_id: string;
|
|
532
|
-
|
|
610
|
+
created_at: number;
|
|
611
|
+
env: string;
|
|
612
|
+
products: CustomerProduct[];
|
|
613
|
+
features: Record<string, CustomerFeature>;
|
|
614
|
+
invoices?: CustomerInvoice[];
|
|
533
615
|
}
|
|
534
|
-
|
|
616
|
+
|
|
617
|
+
declare const CreateReferralCodeParamsSchema: z.ZodObject<{
|
|
618
|
+
customer_id: z.ZodString;
|
|
619
|
+
program_id: z.ZodString;
|
|
620
|
+
}, "strip", z.ZodTypeAny, {
|
|
621
|
+
customer_id: string;
|
|
622
|
+
program_id: string;
|
|
623
|
+
}, {
|
|
624
|
+
customer_id: string;
|
|
625
|
+
program_id: string;
|
|
626
|
+
}>;
|
|
627
|
+
type CreateReferralCodeParams = z.infer<typeof CreateReferralCodeParamsSchema>;
|
|
628
|
+
declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
|
|
629
|
+
code: z.ZodString;
|
|
630
|
+
customer_id: z.ZodString;
|
|
631
|
+
}, "strip", z.ZodTypeAny, {
|
|
632
|
+
customer_id: string;
|
|
535
633
|
code: string;
|
|
634
|
+
}, {
|
|
536
635
|
customer_id: string;
|
|
537
|
-
|
|
636
|
+
code: string;
|
|
637
|
+
}>;
|
|
638
|
+
type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
|
|
538
639
|
|
|
539
640
|
export { Autumn as A, type CustomerData as C };
|