autumn-js 1.2.45 → 1.2.46
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/backend/adapters/express.js +109 -23
- package/dist/backend/adapters/express.mjs +9 -9
- package/dist/backend/adapters/fetch.js +109 -23
- package/dist/backend/adapters/fetch.mjs +9 -9
- package/dist/backend/adapters/hono.js +109 -23
- package/dist/backend/adapters/hono.mjs +9 -9
- package/dist/backend/adapters/index.js +109 -23
- package/dist/backend/adapters/index.mjs +12 -12
- package/dist/backend/adapters/next.js +109 -23
- package/dist/backend/adapters/next.mjs +9 -9
- package/dist/backend/{chunk-L7N6FVEE.mjs → chunk-564D2O3W.mjs} +1 -1
- package/dist/backend/{chunk-DY6WMOCT.mjs → chunk-KW47VZ73.mjs} +5 -5
- package/dist/backend/{chunk-PVDDMLWT.mjs → chunk-RPUV2OZA.mjs} +91 -19
- package/dist/backend/{chunk-5DLBV5WP.mjs → chunk-SBZEXVB4.mjs} +7 -7
- package/dist/backend/{chunk-67LHAREL.mjs → chunk-TEDQUFQV.mjs} +1 -1
- package/dist/backend/{chunk-YKRFY5TK.mjs → chunk-UJS4Q7J4.mjs} +18 -4
- package/dist/backend/{chunk-P2TFPTAM.mjs → chunk-WR6ZPCQG.mjs} +1 -1
- package/dist/backend/{chunk-J2VZ3UZS.mjs → chunk-XOAX5KAL.mjs} +1 -1
- package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
- package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
- package/dist/backend/core/handlers/coreHandler.js +109 -23
- package/dist/backend/core/handlers/coreHandler.mjs +7 -7
- package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
- package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
- package/dist/backend/core/handlers/executeRoute.mjs +4 -4
- package/dist/backend/core/handlers/handleRouteByName.js +109 -23
- package/dist/backend/core/handlers/handleRouteByName.mjs +7 -7
- package/dist/backend/core/handlers/index.d.mts +1 -1
- package/dist/backend/core/handlers/index.d.ts +1 -1
- package/dist/backend/core/handlers/index.js +109 -23
- package/dist/backend/core/handlers/index.mjs +10 -10
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +109 -23
- package/dist/backend/core/index.mjs +10 -10
- package/dist/backend/core/routes/index.d.mts +1 -1
- package/dist/backend/core/routes/index.d.ts +1 -1
- package/dist/backend/core/routes/index.js +18 -4
- package/dist/backend/core/routes/index.mjs +2 -2
- package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
- package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.js +18 -4
- package/dist/backend/core/routes/routeConfigs.mjs +2 -2
- package/dist/backend/core/types/handlerTypes.d.mts +1 -1
- package/dist/backend/core/types/handlerTypes.d.ts +1 -1
- package/dist/backend/core/types/index.d.mts +1 -1
- package/dist/backend/core/types/index.d.ts +1 -1
- package/dist/backend/core/types/routeTypes.d.mts +1 -1
- package/dist/backend/core/types/routeTypes.d.ts +1 -1
- package/dist/backend/core/utils/index.mjs +3 -3
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +109 -23
- package/dist/backend/index.mjs +10 -10
- package/dist/backend/{routeTypes-UN48tvoc.d.mts → routeTypes-DnUY8ksp.d.mts} +121 -8
- package/dist/backend/{routeTypes-COLvwrcx.d.ts → routeTypes-TbN5QHEp.d.ts} +121 -8
- package/dist/better-auth/{chunk-MOCG3CBD.mjs → chunk-SABPXZTZ.mjs} +92 -20
- package/dist/better-auth/{chunk-3LKXO3EE.mjs → chunk-TOQRV6D7.mjs} +1 -1
- package/dist/better-auth/{chunk-J3W4EO5H.mjs → chunk-YRHQ4VL7.mjs} +18 -4
- package/dist/better-auth/index.js +109 -23
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +18 -4
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +109 -23
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +109 -23
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +1 -1
- package/dist/react/AutumnContext.d.ts +1 -1
- package/dist/react/AutumnProvider.js +1 -1
- package/dist/react/AutumnProvider.mjs +2 -2
- package/dist/react/{chunk-EE3XPYSL.mjs → chunk-2C6RX3EW.mjs} +1 -1
- package/dist/react/{chunk-SBCI4L22.mjs → chunk-2X7HXG2W.mjs} +1 -1
- package/dist/react/{chunk-7SRCZYRC.mjs → chunk-3WU4ZFXU.mjs} +1 -1
- package/dist/react/{chunk-LUBYNTYC.mjs → chunk-4HU5BGSM.mjs} +1 -1
- package/dist/react/{chunk-RTZAB46K.mjs → chunk-7RF3IGDO.mjs} +1 -1
- package/dist/react/{chunk-KCOHZSS3.mjs → chunk-C6I2RW56.mjs} +8 -8
- package/dist/react/{chunk-CQF3ER2L.mjs → chunk-NWF7OFFQ.mjs} +2 -2
- package/dist/react/{chunk-CSJHU3F2.mjs → chunk-SRSYG5ZV.mjs} +1 -1
- package/dist/react/{chunk-QUGX6XRQ.mjs → chunk-UNQZV3K5.mjs} +1 -1
- package/dist/react/client/AutumnClient.d.mts +1 -1
- package/dist/react/client/AutumnClient.d.ts +1 -1
- package/dist/react/client/IAutumnClient.d.mts +1 -1
- package/dist/react/client/IAutumnClient.d.ts +1 -1
- package/dist/react/client/index.d.mts +1 -1
- package/dist/react/client/index.d.ts +1 -1
- package/dist/react/hooks/index.d.mts +1 -1
- package/dist/react/hooks/index.d.ts +1 -1
- package/dist/react/hooks/index.js +7 -7
- package/dist/react/hooks/index.mjs +8 -8
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.d.mts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.d.ts +1 -1
- package/dist/react/hooks/internal/useCustomerActions.js +1 -1
- package/dist/react/hooks/internal/useCustomerActions.mjs +2 -2
- package/dist/react/hooks/useAggregateEvents.d.mts +1 -1
- package/dist/react/hooks/useAggregateEvents.d.ts +1 -1
- package/dist/react/hooks/useAggregateEvents.js +7 -7
- package/dist/react/hooks/useAggregateEvents.mjs +2 -2
- package/dist/react/hooks/useCustomer.d.mts +1 -1
- package/dist/react/hooks/useCustomer.d.ts +1 -1
- package/dist/react/hooks/useCustomer.js +7 -7
- package/dist/react/hooks/useCustomer.mjs +3 -3
- package/dist/react/hooks/useEntity.d.mts +1 -1
- package/dist/react/hooks/useEntity.d.ts +1 -1
- package/dist/react/hooks/useEntity.js +7 -7
- package/dist/react/hooks/useEntity.mjs +2 -2
- package/dist/react/hooks/useListEvents.d.mts +1 -1
- package/dist/react/hooks/useListEvents.d.ts +1 -1
- package/dist/react/hooks/useListEvents.js +7 -7
- package/dist/react/hooks/useListEvents.mjs +2 -2
- package/dist/react/hooks/useListPlans.d.mts +1 -1
- package/dist/react/hooks/useListPlans.d.ts +1 -1
- package/dist/react/hooks/useListPlans.js +7 -7
- package/dist/react/hooks/useListPlans.mjs +2 -2
- package/dist/react/hooks/useReferrals.d.mts +1 -1
- package/dist/react/hooks/useReferrals.d.ts +1 -1
- package/dist/react/hooks/useReferrals.js +7 -7
- package/dist/react/hooks/useReferrals.mjs +2 -2
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/index.mjs +9 -9
- package/dist/react/{params-DlzWLPN2.d.mts → params-BrFcJdeO.d.mts} +50 -4
- package/dist/react/{params-ChMwkOJA.d.ts → params-BwHZca3H.d.ts} +50 -4
- package/dist/sdk/index.d.mts +151 -10
- package/dist/sdk/index.d.ts +151 -10
- package/dist/sdk/index.js +110 -21
- package/dist/sdk/index.mjs +99 -20
- package/package.json +1 -1
- package/dist/backend/{chunk-IXUCY7AU.mjs → chunk-MOHYGUMA.mjs} +3 -3
|
@@ -8568,6 +8568,15 @@ var CreateReferralCodeResponse$inboundSchema = z22.pipe(
|
|
|
8568
8568
|
|
|
8569
8569
|
// ../sdk/src/models/create-schedule-op.ts
|
|
8570
8570
|
var z23 = __toESM(require("zod/v4-mini"), 1);
|
|
8571
|
+
var CreateScheduleFreeTrialDurationType = {
|
|
8572
|
+
Day: "day",
|
|
8573
|
+
Month: "month",
|
|
8574
|
+
Year: "year"
|
|
8575
|
+
};
|
|
8576
|
+
var CreateScheduleOnEnd = {
|
|
8577
|
+
Bill: "bill",
|
|
8578
|
+
Revert: "revert"
|
|
8579
|
+
};
|
|
8571
8580
|
var CreateScheduleRedirectMode = {
|
|
8572
8581
|
Always: "always",
|
|
8573
8582
|
IfRequired: "if_required",
|
|
@@ -8577,7 +8586,7 @@ var CreateScheduleBillingBehavior = {
|
|
|
8577
8586
|
ProrateImmediately: "prorate_immediately",
|
|
8578
8587
|
None: "none"
|
|
8579
8588
|
};
|
|
8580
|
-
var
|
|
8589
|
+
var PhaseStartDurationType = {
|
|
8581
8590
|
Month: "month",
|
|
8582
8591
|
Year: "year"
|
|
8583
8592
|
};
|
|
@@ -8735,6 +8744,27 @@ var CreateScheduleCode = {
|
|
|
8735
8744
|
PaymentFailed: "payment_failed",
|
|
8736
8745
|
PaymentProcessing: "payment_processing"
|
|
8737
8746
|
};
|
|
8747
|
+
var CreateScheduleFreeTrialDurationType$outboundSchema = z23.enum(CreateScheduleFreeTrialDurationType);
|
|
8748
|
+
var CreateScheduleOnEnd$outboundSchema = z23.enum(CreateScheduleOnEnd);
|
|
8749
|
+
var CreateScheduleFreeTrialParams$outboundSchema = z23.pipe(
|
|
8750
|
+
z23.object({
|
|
8751
|
+
durationLength: z23.number(),
|
|
8752
|
+
durationType: z23._default(
|
|
8753
|
+
CreateScheduleFreeTrialDurationType$outboundSchema,
|
|
8754
|
+
"month"
|
|
8755
|
+
),
|
|
8756
|
+
cardRequired: z23._default(z23.boolean(), true),
|
|
8757
|
+
onEnd: z23.optional(CreateScheduleOnEnd$outboundSchema)
|
|
8758
|
+
}),
|
|
8759
|
+
z23.transform((v) => {
|
|
8760
|
+
return remap(v, {
|
|
8761
|
+
durationLength: "duration_length",
|
|
8762
|
+
durationType: "duration_type",
|
|
8763
|
+
cardRequired: "card_required",
|
|
8764
|
+
onEnd: "on_end"
|
|
8765
|
+
});
|
|
8766
|
+
})
|
|
8767
|
+
);
|
|
8738
8768
|
var CreateScheduleInvoiceMode$outboundSchema = z23.pipe(
|
|
8739
8769
|
z23.object({
|
|
8740
8770
|
enabled: z23.boolean(),
|
|
@@ -8766,10 +8796,10 @@ var CreateScheduleAttachDiscount$outboundSchema = z23.pipe(
|
|
|
8766
8796
|
var CreateScheduleRedirectMode$outboundSchema = z23.enum(CreateScheduleRedirectMode);
|
|
8767
8797
|
var CreateScheduleBillingBehavior$outboundSchema = z23.enum(CreateScheduleBillingBehavior);
|
|
8768
8798
|
var StartsAt2$outboundSchema = smartUnion([z23.number(), z23.string()]);
|
|
8769
|
-
var
|
|
8799
|
+
var PhaseStartDurationType$outboundSchema = z23.enum(PhaseStartDurationType);
|
|
8770
8800
|
var StartingAfter2$outboundSchema = z23.pipe(
|
|
8771
8801
|
z23.object({
|
|
8772
|
-
durationType:
|
|
8802
|
+
durationType: PhaseStartDurationType$outboundSchema,
|
|
8773
8803
|
durationCount: z23.int()
|
|
8774
8804
|
}),
|
|
8775
8805
|
z23.transform((v) => {
|
|
@@ -9228,6 +9258,7 @@ var CreateScheduleCustomize2$outboundSchema = z23.pipe(
|
|
|
9228
9258
|
var CreateSchedulePlan2$outboundSchema = z23.pipe(
|
|
9229
9259
|
z23.object({
|
|
9230
9260
|
planId: z23.string(),
|
|
9261
|
+
entityId: z23.optional(z23.nullable(z23.string())),
|
|
9231
9262
|
featureQuantities: z23.optional(
|
|
9232
9263
|
z23.array(z23.lazy(() => CreateScheduleFeatureQuantity2$outboundSchema))
|
|
9233
9264
|
),
|
|
@@ -9240,6 +9271,7 @@ var CreateSchedulePlan2$outboundSchema = z23.pipe(
|
|
|
9240
9271
|
z23.transform((v) => {
|
|
9241
9272
|
return remap(v, {
|
|
9242
9273
|
planId: "plan_id",
|
|
9274
|
+
entityId: "entity_id",
|
|
9243
9275
|
featureQuantities: "feature_quantities",
|
|
9244
9276
|
subscriptionId: "subscription_id"
|
|
9245
9277
|
});
|
|
@@ -9266,6 +9298,10 @@ var CreateScheduleParams$outboundSchema = z23.pipe(
|
|
|
9266
9298
|
z23.object({
|
|
9267
9299
|
customerId: z23.string(),
|
|
9268
9300
|
entityId: z23.optional(z23.string()),
|
|
9301
|
+
freeTrial: z23.optional(
|
|
9302
|
+
z23.nullable(z23.lazy(() => CreateScheduleFreeTrialParams$outboundSchema))
|
|
9303
|
+
),
|
|
9304
|
+
currency: z23.optional(z23.string()),
|
|
9269
9305
|
invoiceMode: z23.optional(
|
|
9270
9306
|
z23.lazy(() => CreateScheduleInvoiceMode$outboundSchema)
|
|
9271
9307
|
),
|
|
@@ -9281,19 +9317,22 @@ var CreateScheduleParams$outboundSchema = z23.pipe(
|
|
|
9281
9317
|
billingBehavior: z23.optional(CreateScheduleBillingBehavior$outboundSchema),
|
|
9282
9318
|
billingCycleAnchor: z23.optional(z23.literal("now")),
|
|
9283
9319
|
enablePlanImmediately: z23.optional(z23.boolean()),
|
|
9320
|
+
preserveAddOns: z23.optional(z23.boolean()),
|
|
9284
9321
|
phases: z23.array(z23.lazy(() => PhaseStart$outboundSchema))
|
|
9285
9322
|
}),
|
|
9286
9323
|
z23.transform((v) => {
|
|
9287
9324
|
return remap(v, {
|
|
9288
9325
|
customerId: "customer_id",
|
|
9289
9326
|
entityId: "entity_id",
|
|
9327
|
+
freeTrial: "free_trial",
|
|
9290
9328
|
invoiceMode: "invoice_mode",
|
|
9291
9329
|
successUrl: "success_url",
|
|
9292
9330
|
checkoutSessionParams: "checkout_session_params",
|
|
9293
9331
|
redirectMode: "redirect_mode",
|
|
9294
9332
|
billingBehavior: "billing_behavior",
|
|
9295
9333
|
billingCycleAnchor: "billing_cycle_anchor",
|
|
9296
|
-
enablePlanImmediately: "enable_plan_immediately"
|
|
9334
|
+
enablePlanImmediately: "enable_plan_immediately",
|
|
9335
|
+
preserveAddOns: "preserve_add_ons"
|
|
9297
9336
|
});
|
|
9298
9337
|
})
|
|
9299
9338
|
);
|
|
@@ -15041,6 +15080,10 @@ var MultiAttachOnEnd = {
|
|
|
15041
15080
|
Bill: "bill",
|
|
15042
15081
|
Revert: "revert"
|
|
15043
15082
|
};
|
|
15083
|
+
var MultiAttachBillingBehavior = {
|
|
15084
|
+
ProrateImmediately: "prorate_immediately",
|
|
15085
|
+
None: "none"
|
|
15086
|
+
};
|
|
15044
15087
|
var MultiAttachRedirectMode = {
|
|
15045
15088
|
Always: "always",
|
|
15046
15089
|
IfRequired: "if_required",
|
|
@@ -15235,13 +15278,15 @@ var MultiAttachPlan$outboundSchema = z49.pipe(
|
|
|
15235
15278
|
z49.array(z49.lazy(() => MultiAttachFeatureQuantity$outboundSchema))
|
|
15236
15279
|
),
|
|
15237
15280
|
version: z49.optional(z49.number()),
|
|
15238
|
-
subscriptionId: z49.optional(z49.string())
|
|
15281
|
+
subscriptionId: z49.optional(z49.string()),
|
|
15282
|
+
entityId: z49.optional(z49.nullable(z49.string()))
|
|
15239
15283
|
}),
|
|
15240
15284
|
z49.transform((v) => {
|
|
15241
15285
|
return remap(v, {
|
|
15242
15286
|
planId: "plan_id",
|
|
15243
15287
|
featureQuantities: "feature_quantities",
|
|
15244
|
-
subscriptionId: "subscription_id"
|
|
15288
|
+
subscriptionId: "subscription_id",
|
|
15289
|
+
entityId: "entity_id"
|
|
15245
15290
|
});
|
|
15246
15291
|
})
|
|
15247
15292
|
);
|
|
@@ -15291,6 +15336,7 @@ var MultiAttachAttachDiscount$outboundSchema = z49.pipe(
|
|
|
15291
15336
|
});
|
|
15292
15337
|
})
|
|
15293
15338
|
);
|
|
15339
|
+
var MultiAttachBillingBehavior$outboundSchema = z49.enum(MultiAttachBillingBehavior);
|
|
15294
15340
|
var MultiAttachRedirectMode$outboundSchema = z49.enum(MultiAttachRedirectMode);
|
|
15295
15341
|
var MultiAttachLimitType$outboundSchema = z49.enum(MultiAttachLimitType);
|
|
15296
15342
|
var MultiAttachSpendLimit$outboundSchema = z49.pipe(
|
|
@@ -15406,6 +15452,7 @@ var MultiAttachParams$outboundSchema = z49.pipe(
|
|
|
15406
15452
|
freeTrial: z49.optional(
|
|
15407
15453
|
z49.nullable(z49.lazy(() => MultiAttachFreeTrialParams$outboundSchema))
|
|
15408
15454
|
),
|
|
15455
|
+
startsAt: z49.optional(z49.int()),
|
|
15409
15456
|
currency: z49.optional(z49.string()),
|
|
15410
15457
|
invoiceMode: z49.optional(
|
|
15411
15458
|
z49.lazy(() => MultiAttachInvoiceMode$outboundSchema)
|
|
@@ -15413,6 +15460,7 @@ var MultiAttachParams$outboundSchema = z49.pipe(
|
|
|
15413
15460
|
discounts: z49.optional(
|
|
15414
15461
|
z49.array(z49.lazy(() => MultiAttachAttachDiscount$outboundSchema))
|
|
15415
15462
|
),
|
|
15463
|
+
billingBehavior: z49.optional(MultiAttachBillingBehavior$outboundSchema),
|
|
15416
15464
|
successUrl: z49.optional(z49.string()),
|
|
15417
15465
|
checkoutSessionParams: z49.optional(z49.record(z49.string(), z49.any())),
|
|
15418
15466
|
redirectMode: z49._default(
|
|
@@ -15429,7 +15477,9 @@ var MultiAttachParams$outboundSchema = z49.pipe(
|
|
|
15429
15477
|
customerId: "customer_id",
|
|
15430
15478
|
entityId: "entity_id",
|
|
15431
15479
|
freeTrial: "free_trial",
|
|
15480
|
+
startsAt: "starts_at",
|
|
15432
15481
|
invoiceMode: "invoice_mode",
|
|
15482
|
+
billingBehavior: "billing_behavior",
|
|
15433
15483
|
successUrl: "success_url",
|
|
15434
15484
|
checkoutSessionParams: "checkout_session_params",
|
|
15435
15485
|
redirectMode: "redirect_mode",
|
|
@@ -17014,6 +17064,10 @@ var PreviewMultiAttachOnEnd = {
|
|
|
17014
17064
|
Bill: "bill",
|
|
17015
17065
|
Revert: "revert"
|
|
17016
17066
|
};
|
|
17067
|
+
var PreviewMultiAttachBillingBehavior = {
|
|
17068
|
+
ProrateImmediately: "prorate_immediately",
|
|
17069
|
+
None: "none"
|
|
17070
|
+
};
|
|
17017
17071
|
var PreviewMultiAttachRedirectMode = {
|
|
17018
17072
|
Always: "always",
|
|
17019
17073
|
IfRequired: "if_required",
|
|
@@ -17224,13 +17278,15 @@ var PreviewMultiAttachPlan$outboundSchema = z53.pipe(
|
|
|
17224
17278
|
)
|
|
17225
17279
|
),
|
|
17226
17280
|
version: z53.optional(z53.number()),
|
|
17227
|
-
subscriptionId: z53.optional(z53.string())
|
|
17281
|
+
subscriptionId: z53.optional(z53.string()),
|
|
17282
|
+
entityId: z53.optional(z53.nullable(z53.string()))
|
|
17228
17283
|
}),
|
|
17229
17284
|
z53.transform((v) => {
|
|
17230
17285
|
return remap(v, {
|
|
17231
17286
|
planId: "plan_id",
|
|
17232
17287
|
featureQuantities: "feature_quantities",
|
|
17233
|
-
subscriptionId: "subscription_id"
|
|
17288
|
+
subscriptionId: "subscription_id",
|
|
17289
|
+
entityId: "entity_id"
|
|
17234
17290
|
});
|
|
17235
17291
|
})
|
|
17236
17292
|
);
|
|
@@ -17283,6 +17339,7 @@ var PreviewMultiAttachAttachDiscount$outboundSchema = z53.pipe(
|
|
|
17283
17339
|
});
|
|
17284
17340
|
})
|
|
17285
17341
|
);
|
|
17342
|
+
var PreviewMultiAttachBillingBehavior$outboundSchema = z53.enum(PreviewMultiAttachBillingBehavior);
|
|
17286
17343
|
var PreviewMultiAttachRedirectMode$outboundSchema = z53.enum(PreviewMultiAttachRedirectMode);
|
|
17287
17344
|
var PreviewMultiAttachLimitType$outboundSchema = z53.enum(PreviewMultiAttachLimitType);
|
|
17288
17345
|
var PreviewMultiAttachSpendLimit$outboundSchema = z53.pipe(
|
|
@@ -17400,6 +17457,7 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
|
|
|
17400
17457
|
z53.lazy(() => PreviewMultiAttachFreeTrialParams$outboundSchema)
|
|
17401
17458
|
)
|
|
17402
17459
|
),
|
|
17460
|
+
startsAt: z53.optional(z53.int()),
|
|
17403
17461
|
currency: z53.optional(z53.string()),
|
|
17404
17462
|
invoiceMode: z53.optional(
|
|
17405
17463
|
z53.lazy(() => PreviewMultiAttachInvoiceMode$outboundSchema)
|
|
@@ -17407,6 +17465,9 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
|
|
|
17407
17465
|
discounts: z53.optional(
|
|
17408
17466
|
z53.array(z53.lazy(() => PreviewMultiAttachAttachDiscount$outboundSchema))
|
|
17409
17467
|
),
|
|
17468
|
+
billingBehavior: z53.optional(
|
|
17469
|
+
PreviewMultiAttachBillingBehavior$outboundSchema
|
|
17470
|
+
),
|
|
17410
17471
|
successUrl: z53.optional(z53.string()),
|
|
17411
17472
|
checkoutSessionParams: z53.optional(z53.record(z53.string(), z53.any())),
|
|
17412
17473
|
redirectMode: z53._default(
|
|
@@ -17425,7 +17486,9 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
|
|
|
17425
17486
|
customerId: "customer_id",
|
|
17426
17487
|
entityId: "entity_id",
|
|
17427
17488
|
freeTrial: "free_trial",
|
|
17489
|
+
startsAt: "starts_at",
|
|
17428
17490
|
invoiceMode: "invoice_mode",
|
|
17491
|
+
billingBehavior: "billing_behavior",
|
|
17429
17492
|
successUrl: "success_url",
|
|
17430
17493
|
checkoutSessionParams: "checkout_session_params",
|
|
17431
17494
|
redirectMode: "redirect_mode",
|
|
@@ -24956,15 +25019,17 @@ var FailOpenHook = class {
|
|
|
24956
25019
|
var DEFAULT_TIMEOUT_MS = 5e3;
|
|
24957
25020
|
var AUTO_TIMEOUT_OPERATION_IDS = /* @__PURE__ */ new Set(["check", "track"]);
|
|
24958
25021
|
var TimeoutFixHook = class {
|
|
24959
|
-
|
|
24960
|
-
|
|
24961
|
-
|
|
24962
|
-
|
|
24963
|
-
|
|
24964
|
-
|
|
24965
|
-
|
|
24966
|
-
|
|
24967
|
-
|
|
25022
|
+
beforeCreateRequest(hookCtx, input) {
|
|
25023
|
+
if (input.options?.signal || !AUTO_TIMEOUT_OPERATION_IDS.has(hookCtx.operationID)) {
|
|
25024
|
+
return input;
|
|
25025
|
+
}
|
|
25026
|
+
return {
|
|
25027
|
+
...input,
|
|
25028
|
+
options: {
|
|
25029
|
+
...input.options,
|
|
25030
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
25031
|
+
}
|
|
25032
|
+
};
|
|
24968
25033
|
}
|
|
24969
25034
|
};
|
|
24970
25035
|
|
|
@@ -24973,7 +25038,7 @@ function initHooks(hooks) {
|
|
|
24973
25038
|
const failOpenHook = new FailOpenHook();
|
|
24974
25039
|
const timeoutFixHook = new TimeoutFixHook();
|
|
24975
25040
|
hooks.registerSDKInitHook(failOpenHook);
|
|
24976
|
-
hooks.
|
|
25041
|
+
hooks.registerBeforeCreateRequestHook(timeoutFixHook);
|
|
24977
25042
|
hooks.registerAfterErrorHook(failOpenHook);
|
|
24978
25043
|
}
|
|
24979
25044
|
|
|
@@ -26819,11 +26884,13 @@ var Billing = class extends ClientSDK {
|
|
|
26819
26884
|
* @example
|
|
26820
26885
|
* ```typescript
|
|
26821
26886
|
* // Schedule a transition from a trial plan to a paid plan
|
|
26822
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
26887
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
|
|
26823
26888
|
* ```
|
|
26824
26889
|
*
|
|
26825
26890
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
26826
26891
|
* @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
|
|
26892
|
+
* @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
|
|
26893
|
+
* @param currency - Currency used to bill the immediate phase. (optional)
|
|
26827
26894
|
* @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
|
|
26828
26895
|
* @param discounts - List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
26829
26896
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
@@ -26832,6 +26899,7 @@ var Billing = class extends ClientSDK {
|
|
|
26832
26899
|
* @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
|
|
26833
26900
|
* @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
|
|
26834
26901
|
* @param enablePlanImmediately - If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed. (optional)
|
|
26902
|
+
* @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
|
|
26835
26903
|
* @param phases - Ordered phase definitions for the schedule.
|
|
26836
26904
|
*
|
|
26837
26905
|
* @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
|
|
@@ -26870,9 +26938,11 @@ var Billing = class extends ClientSDK {
|
|
|
26870
26938
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
26871
26939
|
* @param plans - The list of plans to attach to the customer.
|
|
26872
26940
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
26941
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
26873
26942
|
* @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
|
|
26874
26943
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
26875
26944
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
26945
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
26876
26946
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
26877
26947
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
26878
26948
|
* @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
|
|
@@ -26953,9 +27023,11 @@ var Billing = class extends ClientSDK {
|
|
|
26953
27023
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
26954
27024
|
* @param plans - The list of plans to attach to the customer.
|
|
26955
27025
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
27026
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
26956
27027
|
* @param currency - Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default. (optional)
|
|
26957
27028
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
26958
27029
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
27030
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
26959
27031
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
26960
27032
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
26961
27033
|
* @param redirectMode - Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if_required' only when payment action is needed, 'never' disables redirects. (optional)
|
|
@@ -32542,7 +32614,8 @@ var multiAttachPlanOutboundSchema = import_v47.z.object({
|
|
|
32542
32614
|
customize: import_v47.z.union([multiAttachCustomizeOutboundSchema, import_v47.z.undefined()]).optional(),
|
|
32543
32615
|
feature_quantities: import_v47.z.union([import_v47.z.array(multiAttachFeatureQuantityOutboundSchema), import_v47.z.undefined()]).optional(),
|
|
32544
32616
|
version: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
|
|
32545
|
-
subscription_id: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional()
|
|
32617
|
+
subscription_id: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32618
|
+
entity_id: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional().nullable()
|
|
32546
32619
|
});
|
|
32547
32620
|
var multiAttachFreeTrialParamsOutboundSchema = import_v47.z.object({
|
|
32548
32621
|
duration_length: import_v47.z.number(),
|
|
@@ -32670,7 +32743,8 @@ var multiAttachPlanSchema = import_v47.z.object({
|
|
|
32670
32743
|
customize: import_v47.z.union([multiAttachCustomizeSchema, import_v47.z.undefined()]).optional(),
|
|
32671
32744
|
featureQuantities: import_v47.z.union([import_v47.z.array(multiAttachFeatureQuantitySchema), import_v47.z.undefined()]).optional(),
|
|
32672
32745
|
version: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
|
|
32673
|
-
subscriptionId: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional()
|
|
32746
|
+
subscriptionId: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32747
|
+
entityId: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional().nullable()
|
|
32674
32748
|
});
|
|
32675
32749
|
var multiAttachDurationTypeSchema = closedEnumSchema4;
|
|
32676
32750
|
var multiAttachOnEndSchema = closedEnumSchema4;
|
|
@@ -32680,6 +32754,7 @@ var multiAttachFreeTrialParamsSchema = import_v47.z.object({
|
|
|
32680
32754
|
cardRequired: import_v47.z.union([import_v47.z.boolean(), import_v47.z.undefined()]).optional(),
|
|
32681
32755
|
onEnd: import_v47.z.union([multiAttachOnEndSchema, import_v47.z.undefined()]).optional()
|
|
32682
32756
|
});
|
|
32757
|
+
var multiAttachBillingBehaviorSchema = closedEnumSchema4;
|
|
32683
32758
|
var multiAttachRedirectModeSchema = closedEnumSchema4;
|
|
32684
32759
|
var multiAttachLimitTypeSchema = closedEnumSchema4;
|
|
32685
32760
|
var multiAttachSpendLimitSchema = import_v47.z.object({
|
|
@@ -32721,9 +32796,11 @@ var multiAttachParamsSchema = import_v47.z.object({
|
|
|
32721
32796
|
entityId: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32722
32797
|
plans: import_v47.z.array(multiAttachPlanSchema),
|
|
32723
32798
|
freeTrial: import_v47.z.union([multiAttachFreeTrialParamsSchema, import_v47.z.undefined()]).optional().nullable(),
|
|
32799
|
+
startsAt: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
|
|
32724
32800
|
currency: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32725
32801
|
invoiceMode: import_v47.z.union([multiAttachInvoiceModeSchema, import_v47.z.undefined()]).optional(),
|
|
32726
32802
|
discounts: import_v47.z.union([import_v47.z.array(multiAttachAttachDiscountSchema), import_v47.z.undefined()]).optional(),
|
|
32803
|
+
billingBehavior: import_v47.z.union([multiAttachBillingBehaviorSchema, import_v47.z.undefined()]).optional(),
|
|
32727
32804
|
successUrl: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32728
32805
|
checkoutSessionParams: import_v47.z.union([import_v47.z.record(import_v47.z.string(), import_v47.z.any()), import_v47.z.undefined()]).optional(),
|
|
32729
32806
|
redirectMode: import_v47.z.union([multiAttachRedirectModeSchema, import_v47.z.undefined()]).optional(),
|
|
@@ -32749,9 +32826,11 @@ var multiAttachParamsOutboundSchema = import_v47.z.object({
|
|
|
32749
32826
|
entity_id: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32750
32827
|
plans: import_v47.z.array(multiAttachPlanOutboundSchema),
|
|
32751
32828
|
free_trial: import_v47.z.union([multiAttachFreeTrialParamsOutboundSchema, import_v47.z.undefined()]).optional().nullable(),
|
|
32829
|
+
starts_at: import_v47.z.union([import_v47.z.number(), import_v47.z.undefined()]).optional(),
|
|
32752
32830
|
currency: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32753
32831
|
invoice_mode: import_v47.z.union([multiAttachInvoiceModeOutboundSchema, import_v47.z.undefined()]).optional(),
|
|
32754
32832
|
discounts: import_v47.z.union([import_v47.z.array(multiAttachAttachDiscountOutboundSchema), import_v47.z.undefined()]).optional(),
|
|
32833
|
+
billing_behavior: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32755
32834
|
success_url: import_v47.z.union([import_v47.z.string(), import_v47.z.undefined()]).optional(),
|
|
32756
32835
|
checkout_session_params: import_v47.z.union([import_v47.z.record(import_v47.z.string(), import_v47.z.any()), import_v47.z.undefined()]).optional(),
|
|
32757
32836
|
redirect_mode: import_v47.z.string(),
|
|
@@ -33897,7 +33976,8 @@ var previewMultiAttachPlanOutboundSchema = import_v410.z.object({
|
|
|
33897
33976
|
import_v410.z.undefined()
|
|
33898
33977
|
]).optional(),
|
|
33899
33978
|
version: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
|
|
33900
|
-
subscription_id: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional()
|
|
33979
|
+
subscription_id: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
33980
|
+
entity_id: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional().nullable()
|
|
33901
33981
|
});
|
|
33902
33982
|
var previewMultiAttachFreeTrialParamsOutboundSchema = import_v410.z.object({
|
|
33903
33983
|
duration_length: import_v410.z.number(),
|
|
@@ -34035,7 +34115,8 @@ var previewMultiAttachPlanSchema = import_v410.z.object({
|
|
|
34035
34115
|
import_v410.z.undefined()
|
|
34036
34116
|
]).optional(),
|
|
34037
34117
|
version: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
|
|
34038
|
-
subscriptionId: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional()
|
|
34118
|
+
subscriptionId: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34119
|
+
entityId: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional().nullable()
|
|
34039
34120
|
});
|
|
34040
34121
|
var previewMultiAttachDurationTypeSchema = closedEnumSchema6;
|
|
34041
34122
|
var previewMultiAttachOnEndSchema = closedEnumSchema6;
|
|
@@ -34045,6 +34126,7 @@ var previewMultiAttachFreeTrialParamsSchema = import_v410.z.object({
|
|
|
34045
34126
|
cardRequired: import_v410.z.union([import_v410.z.boolean(), import_v410.z.undefined()]).optional(),
|
|
34046
34127
|
onEnd: import_v410.z.union([previewMultiAttachOnEndSchema, import_v410.z.undefined()]).optional()
|
|
34047
34128
|
});
|
|
34129
|
+
var previewMultiAttachBillingBehaviorSchema = closedEnumSchema6;
|
|
34048
34130
|
var previewMultiAttachRedirectModeSchema = closedEnumSchema6;
|
|
34049
34131
|
var previewMultiAttachLimitTypeSchema = closedEnumSchema6;
|
|
34050
34132
|
var previewMultiAttachSpendLimitSchema = import_v410.z.object({
|
|
@@ -34086,9 +34168,11 @@ var previewMultiAttachParamsSchema = import_v410.z.object({
|
|
|
34086
34168
|
entityId: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34087
34169
|
plans: import_v410.z.array(previewMultiAttachPlanSchema),
|
|
34088
34170
|
freeTrial: import_v410.z.union([previewMultiAttachFreeTrialParamsSchema, import_v410.z.undefined()]).optional().nullable(),
|
|
34171
|
+
startsAt: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
|
|
34089
34172
|
currency: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34090
34173
|
invoiceMode: import_v410.z.union([previewMultiAttachInvoiceModeSchema, import_v410.z.undefined()]).optional(),
|
|
34091
34174
|
discounts: import_v410.z.union([import_v410.z.array(previewMultiAttachAttachDiscountSchema), import_v410.z.undefined()]).optional(),
|
|
34175
|
+
billingBehavior: import_v410.z.union([previewMultiAttachBillingBehaviorSchema, import_v410.z.undefined()]).optional(),
|
|
34092
34176
|
successUrl: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34093
34177
|
checkoutSessionParams: import_v410.z.union([import_v410.z.record(import_v410.z.string(), import_v410.z.any()), import_v410.z.undefined()]).optional(),
|
|
34094
34178
|
redirectMode: import_v410.z.union([previewMultiAttachRedirectModeSchema, import_v410.z.undefined()]).optional(),
|
|
@@ -34142,12 +34226,14 @@ var previewMultiAttachParamsOutboundSchema = import_v410.z.object({
|
|
|
34142
34226
|
entity_id: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34143
34227
|
plans: import_v410.z.array(previewMultiAttachPlanOutboundSchema),
|
|
34144
34228
|
free_trial: import_v410.z.union([previewMultiAttachFreeTrialParamsOutboundSchema, import_v410.z.undefined()]).optional().nullable(),
|
|
34229
|
+
starts_at: import_v410.z.union([import_v410.z.number(), import_v410.z.undefined()]).optional(),
|
|
34145
34230
|
currency: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34146
34231
|
invoice_mode: import_v410.z.union([previewMultiAttachInvoiceModeOutboundSchema, import_v410.z.undefined()]).optional(),
|
|
34147
34232
|
discounts: import_v410.z.union([
|
|
34148
34233
|
import_v410.z.array(previewMultiAttachAttachDiscountOutboundSchema),
|
|
34149
34234
|
import_v410.z.undefined()
|
|
34150
34235
|
]).optional(),
|
|
34236
|
+
billing_behavior: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34151
34237
|
success_url: import_v410.z.union([import_v410.z.string(), import_v410.z.undefined()]).optional(),
|
|
34152
34238
|
checkout_session_params: import_v410.z.union([import_v410.z.record(import_v410.z.string(), import_v410.z.any()), import_v410.z.undefined()]).optional(),
|
|
34153
34239
|
redirect_mode: import_v410.z.string(),
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autumnHandler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-WR6ZPCQG.mjs";
|
|
4
4
|
import "../chunk-WYDGEDEU.mjs";
|
|
5
5
|
import "../chunk-VXND2UDT.mjs";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-KW47VZ73.mjs";
|
|
7
|
+
import "../chunk-SBZEXVB4.mjs";
|
|
8
|
+
import "../chunk-RPUV2OZA.mjs";
|
|
9
|
+
import "../chunk-MOHYGUMA.mjs";
|
|
10
|
+
import "../chunk-TBQ27LIK.mjs";
|
|
11
|
+
import "../chunk-J44WR3QZ.mjs";
|
|
8
12
|
import "../chunk-TSF4YCUO.mjs";
|
|
9
13
|
import "../chunk-UAR3TMWI.mjs";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-YKRFY5TK.mjs";
|
|
12
|
-
import "../chunk-IXUCY7AU.mjs";
|
|
14
|
+
import "../chunk-UJS4Q7J4.mjs";
|
|
13
15
|
import "../chunk-OTXV5FY7.mjs";
|
|
14
|
-
import "../chunk-I7CD6EB6.mjs";
|
|
15
16
|
import "../chunk-VZIMT7AO.mjs";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-J44WR3QZ.mjs";
|
|
17
|
+
import "../chunk-I7CD6EB6.mjs";
|
|
18
18
|
import "../chunk-N7NFYY54.mjs";
|
|
19
19
|
export {
|
|
20
20
|
autumnHandler
|