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
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
routeConfigs,
|
|
9
9
|
sanitizeBody,
|
|
10
10
|
secretKeyCheck
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YRHQ4VL7.mjs";
|
|
12
12
|
import {
|
|
13
13
|
getActiveOrganization
|
|
14
14
|
} from "./chunk-BT3EAYVW.mjs";
|
|
@@ -8550,6 +8550,15 @@ var CreateReferralCodeResponse$inboundSchema = z22.pipe(
|
|
|
8550
8550
|
|
|
8551
8551
|
// ../sdk/src/models/create-schedule-op.ts
|
|
8552
8552
|
import * as z23 from "zod/v4-mini";
|
|
8553
|
+
var CreateScheduleFreeTrialDurationType = {
|
|
8554
|
+
Day: "day",
|
|
8555
|
+
Month: "month",
|
|
8556
|
+
Year: "year"
|
|
8557
|
+
};
|
|
8558
|
+
var CreateScheduleOnEnd = {
|
|
8559
|
+
Bill: "bill",
|
|
8560
|
+
Revert: "revert"
|
|
8561
|
+
};
|
|
8553
8562
|
var CreateScheduleRedirectMode = {
|
|
8554
8563
|
Always: "always",
|
|
8555
8564
|
IfRequired: "if_required",
|
|
@@ -8559,7 +8568,7 @@ var CreateScheduleBillingBehavior = {
|
|
|
8559
8568
|
ProrateImmediately: "prorate_immediately",
|
|
8560
8569
|
None: "none"
|
|
8561
8570
|
};
|
|
8562
|
-
var
|
|
8571
|
+
var PhaseStartDurationType = {
|
|
8563
8572
|
Month: "month",
|
|
8564
8573
|
Year: "year"
|
|
8565
8574
|
};
|
|
@@ -8717,6 +8726,27 @@ var CreateScheduleCode = {
|
|
|
8717
8726
|
PaymentFailed: "payment_failed",
|
|
8718
8727
|
PaymentProcessing: "payment_processing"
|
|
8719
8728
|
};
|
|
8729
|
+
var CreateScheduleFreeTrialDurationType$outboundSchema = z23.enum(CreateScheduleFreeTrialDurationType);
|
|
8730
|
+
var CreateScheduleOnEnd$outboundSchema = z23.enum(CreateScheduleOnEnd);
|
|
8731
|
+
var CreateScheduleFreeTrialParams$outboundSchema = z23.pipe(
|
|
8732
|
+
z23.object({
|
|
8733
|
+
durationLength: z23.number(),
|
|
8734
|
+
durationType: z23._default(
|
|
8735
|
+
CreateScheduleFreeTrialDurationType$outboundSchema,
|
|
8736
|
+
"month"
|
|
8737
|
+
),
|
|
8738
|
+
cardRequired: z23._default(z23.boolean(), true),
|
|
8739
|
+
onEnd: z23.optional(CreateScheduleOnEnd$outboundSchema)
|
|
8740
|
+
}),
|
|
8741
|
+
z23.transform((v) => {
|
|
8742
|
+
return remap(v, {
|
|
8743
|
+
durationLength: "duration_length",
|
|
8744
|
+
durationType: "duration_type",
|
|
8745
|
+
cardRequired: "card_required",
|
|
8746
|
+
onEnd: "on_end"
|
|
8747
|
+
});
|
|
8748
|
+
})
|
|
8749
|
+
);
|
|
8720
8750
|
var CreateScheduleInvoiceMode$outboundSchema = z23.pipe(
|
|
8721
8751
|
z23.object({
|
|
8722
8752
|
enabled: z23.boolean(),
|
|
@@ -8748,10 +8778,10 @@ var CreateScheduleAttachDiscount$outboundSchema = z23.pipe(
|
|
|
8748
8778
|
var CreateScheduleRedirectMode$outboundSchema = z23.enum(CreateScheduleRedirectMode);
|
|
8749
8779
|
var CreateScheduleBillingBehavior$outboundSchema = z23.enum(CreateScheduleBillingBehavior);
|
|
8750
8780
|
var StartsAt2$outboundSchema = smartUnion([z23.number(), z23.string()]);
|
|
8751
|
-
var
|
|
8781
|
+
var PhaseStartDurationType$outboundSchema = z23.enum(PhaseStartDurationType);
|
|
8752
8782
|
var StartingAfter2$outboundSchema = z23.pipe(
|
|
8753
8783
|
z23.object({
|
|
8754
|
-
durationType:
|
|
8784
|
+
durationType: PhaseStartDurationType$outboundSchema,
|
|
8755
8785
|
durationCount: z23.int()
|
|
8756
8786
|
}),
|
|
8757
8787
|
z23.transform((v) => {
|
|
@@ -9210,6 +9240,7 @@ var CreateScheduleCustomize2$outboundSchema = z23.pipe(
|
|
|
9210
9240
|
var CreateSchedulePlan2$outboundSchema = z23.pipe(
|
|
9211
9241
|
z23.object({
|
|
9212
9242
|
planId: z23.string(),
|
|
9243
|
+
entityId: z23.optional(z23.nullable(z23.string())),
|
|
9213
9244
|
featureQuantities: z23.optional(
|
|
9214
9245
|
z23.array(z23.lazy(() => CreateScheduleFeatureQuantity2$outboundSchema))
|
|
9215
9246
|
),
|
|
@@ -9222,6 +9253,7 @@ var CreateSchedulePlan2$outboundSchema = z23.pipe(
|
|
|
9222
9253
|
z23.transform((v) => {
|
|
9223
9254
|
return remap(v, {
|
|
9224
9255
|
planId: "plan_id",
|
|
9256
|
+
entityId: "entity_id",
|
|
9225
9257
|
featureQuantities: "feature_quantities",
|
|
9226
9258
|
subscriptionId: "subscription_id"
|
|
9227
9259
|
});
|
|
@@ -9248,6 +9280,10 @@ var CreateScheduleParams$outboundSchema = z23.pipe(
|
|
|
9248
9280
|
z23.object({
|
|
9249
9281
|
customerId: z23.string(),
|
|
9250
9282
|
entityId: z23.optional(z23.string()),
|
|
9283
|
+
freeTrial: z23.optional(
|
|
9284
|
+
z23.nullable(z23.lazy(() => CreateScheduleFreeTrialParams$outboundSchema))
|
|
9285
|
+
),
|
|
9286
|
+
currency: z23.optional(z23.string()),
|
|
9251
9287
|
invoiceMode: z23.optional(
|
|
9252
9288
|
z23.lazy(() => CreateScheduleInvoiceMode$outboundSchema)
|
|
9253
9289
|
),
|
|
@@ -9263,19 +9299,22 @@ var CreateScheduleParams$outboundSchema = z23.pipe(
|
|
|
9263
9299
|
billingBehavior: z23.optional(CreateScheduleBillingBehavior$outboundSchema),
|
|
9264
9300
|
billingCycleAnchor: z23.optional(z23.literal("now")),
|
|
9265
9301
|
enablePlanImmediately: z23.optional(z23.boolean()),
|
|
9302
|
+
preserveAddOns: z23.optional(z23.boolean()),
|
|
9266
9303
|
phases: z23.array(z23.lazy(() => PhaseStart$outboundSchema))
|
|
9267
9304
|
}),
|
|
9268
9305
|
z23.transform((v) => {
|
|
9269
9306
|
return remap(v, {
|
|
9270
9307
|
customerId: "customer_id",
|
|
9271
9308
|
entityId: "entity_id",
|
|
9309
|
+
freeTrial: "free_trial",
|
|
9272
9310
|
invoiceMode: "invoice_mode",
|
|
9273
9311
|
successUrl: "success_url",
|
|
9274
9312
|
checkoutSessionParams: "checkout_session_params",
|
|
9275
9313
|
redirectMode: "redirect_mode",
|
|
9276
9314
|
billingBehavior: "billing_behavior",
|
|
9277
9315
|
billingCycleAnchor: "billing_cycle_anchor",
|
|
9278
|
-
enablePlanImmediately: "enable_plan_immediately"
|
|
9316
|
+
enablePlanImmediately: "enable_plan_immediately",
|
|
9317
|
+
preserveAddOns: "preserve_add_ons"
|
|
9279
9318
|
});
|
|
9280
9319
|
})
|
|
9281
9320
|
);
|
|
@@ -15023,6 +15062,10 @@ var MultiAttachOnEnd = {
|
|
|
15023
15062
|
Bill: "bill",
|
|
15024
15063
|
Revert: "revert"
|
|
15025
15064
|
};
|
|
15065
|
+
var MultiAttachBillingBehavior = {
|
|
15066
|
+
ProrateImmediately: "prorate_immediately",
|
|
15067
|
+
None: "none"
|
|
15068
|
+
};
|
|
15026
15069
|
var MultiAttachRedirectMode = {
|
|
15027
15070
|
Always: "always",
|
|
15028
15071
|
IfRequired: "if_required",
|
|
@@ -15217,13 +15260,15 @@ var MultiAttachPlan$outboundSchema = z49.pipe(
|
|
|
15217
15260
|
z49.array(z49.lazy(() => MultiAttachFeatureQuantity$outboundSchema))
|
|
15218
15261
|
),
|
|
15219
15262
|
version: z49.optional(z49.number()),
|
|
15220
|
-
subscriptionId: z49.optional(z49.string())
|
|
15263
|
+
subscriptionId: z49.optional(z49.string()),
|
|
15264
|
+
entityId: z49.optional(z49.nullable(z49.string()))
|
|
15221
15265
|
}),
|
|
15222
15266
|
z49.transform((v) => {
|
|
15223
15267
|
return remap(v, {
|
|
15224
15268
|
planId: "plan_id",
|
|
15225
15269
|
featureQuantities: "feature_quantities",
|
|
15226
|
-
subscriptionId: "subscription_id"
|
|
15270
|
+
subscriptionId: "subscription_id",
|
|
15271
|
+
entityId: "entity_id"
|
|
15227
15272
|
});
|
|
15228
15273
|
})
|
|
15229
15274
|
);
|
|
@@ -15273,6 +15318,7 @@ var MultiAttachAttachDiscount$outboundSchema = z49.pipe(
|
|
|
15273
15318
|
});
|
|
15274
15319
|
})
|
|
15275
15320
|
);
|
|
15321
|
+
var MultiAttachBillingBehavior$outboundSchema = z49.enum(MultiAttachBillingBehavior);
|
|
15276
15322
|
var MultiAttachRedirectMode$outboundSchema = z49.enum(MultiAttachRedirectMode);
|
|
15277
15323
|
var MultiAttachLimitType$outboundSchema = z49.enum(MultiAttachLimitType);
|
|
15278
15324
|
var MultiAttachSpendLimit$outboundSchema = z49.pipe(
|
|
@@ -15388,6 +15434,7 @@ var MultiAttachParams$outboundSchema = z49.pipe(
|
|
|
15388
15434
|
freeTrial: z49.optional(
|
|
15389
15435
|
z49.nullable(z49.lazy(() => MultiAttachFreeTrialParams$outboundSchema))
|
|
15390
15436
|
),
|
|
15437
|
+
startsAt: z49.optional(z49.int()),
|
|
15391
15438
|
currency: z49.optional(z49.string()),
|
|
15392
15439
|
invoiceMode: z49.optional(
|
|
15393
15440
|
z49.lazy(() => MultiAttachInvoiceMode$outboundSchema)
|
|
@@ -15395,6 +15442,7 @@ var MultiAttachParams$outboundSchema = z49.pipe(
|
|
|
15395
15442
|
discounts: z49.optional(
|
|
15396
15443
|
z49.array(z49.lazy(() => MultiAttachAttachDiscount$outboundSchema))
|
|
15397
15444
|
),
|
|
15445
|
+
billingBehavior: z49.optional(MultiAttachBillingBehavior$outboundSchema),
|
|
15398
15446
|
successUrl: z49.optional(z49.string()),
|
|
15399
15447
|
checkoutSessionParams: z49.optional(z49.record(z49.string(), z49.any())),
|
|
15400
15448
|
redirectMode: z49._default(
|
|
@@ -15411,7 +15459,9 @@ var MultiAttachParams$outboundSchema = z49.pipe(
|
|
|
15411
15459
|
customerId: "customer_id",
|
|
15412
15460
|
entityId: "entity_id",
|
|
15413
15461
|
freeTrial: "free_trial",
|
|
15462
|
+
startsAt: "starts_at",
|
|
15414
15463
|
invoiceMode: "invoice_mode",
|
|
15464
|
+
billingBehavior: "billing_behavior",
|
|
15415
15465
|
successUrl: "success_url",
|
|
15416
15466
|
checkoutSessionParams: "checkout_session_params",
|
|
15417
15467
|
redirectMode: "redirect_mode",
|
|
@@ -16996,6 +17046,10 @@ var PreviewMultiAttachOnEnd = {
|
|
|
16996
17046
|
Bill: "bill",
|
|
16997
17047
|
Revert: "revert"
|
|
16998
17048
|
};
|
|
17049
|
+
var PreviewMultiAttachBillingBehavior = {
|
|
17050
|
+
ProrateImmediately: "prorate_immediately",
|
|
17051
|
+
None: "none"
|
|
17052
|
+
};
|
|
16999
17053
|
var PreviewMultiAttachRedirectMode = {
|
|
17000
17054
|
Always: "always",
|
|
17001
17055
|
IfRequired: "if_required",
|
|
@@ -17206,13 +17260,15 @@ var PreviewMultiAttachPlan$outboundSchema = z53.pipe(
|
|
|
17206
17260
|
)
|
|
17207
17261
|
),
|
|
17208
17262
|
version: z53.optional(z53.number()),
|
|
17209
|
-
subscriptionId: z53.optional(z53.string())
|
|
17263
|
+
subscriptionId: z53.optional(z53.string()),
|
|
17264
|
+
entityId: z53.optional(z53.nullable(z53.string()))
|
|
17210
17265
|
}),
|
|
17211
17266
|
z53.transform((v) => {
|
|
17212
17267
|
return remap(v, {
|
|
17213
17268
|
planId: "plan_id",
|
|
17214
17269
|
featureQuantities: "feature_quantities",
|
|
17215
|
-
subscriptionId: "subscription_id"
|
|
17270
|
+
subscriptionId: "subscription_id",
|
|
17271
|
+
entityId: "entity_id"
|
|
17216
17272
|
});
|
|
17217
17273
|
})
|
|
17218
17274
|
);
|
|
@@ -17265,6 +17321,7 @@ var PreviewMultiAttachAttachDiscount$outboundSchema = z53.pipe(
|
|
|
17265
17321
|
});
|
|
17266
17322
|
})
|
|
17267
17323
|
);
|
|
17324
|
+
var PreviewMultiAttachBillingBehavior$outboundSchema = z53.enum(PreviewMultiAttachBillingBehavior);
|
|
17268
17325
|
var PreviewMultiAttachRedirectMode$outboundSchema = z53.enum(PreviewMultiAttachRedirectMode);
|
|
17269
17326
|
var PreviewMultiAttachLimitType$outboundSchema = z53.enum(PreviewMultiAttachLimitType);
|
|
17270
17327
|
var PreviewMultiAttachSpendLimit$outboundSchema = z53.pipe(
|
|
@@ -17382,6 +17439,7 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
|
|
|
17382
17439
|
z53.lazy(() => PreviewMultiAttachFreeTrialParams$outboundSchema)
|
|
17383
17440
|
)
|
|
17384
17441
|
),
|
|
17442
|
+
startsAt: z53.optional(z53.int()),
|
|
17385
17443
|
currency: z53.optional(z53.string()),
|
|
17386
17444
|
invoiceMode: z53.optional(
|
|
17387
17445
|
z53.lazy(() => PreviewMultiAttachInvoiceMode$outboundSchema)
|
|
@@ -17389,6 +17447,9 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
|
|
|
17389
17447
|
discounts: z53.optional(
|
|
17390
17448
|
z53.array(z53.lazy(() => PreviewMultiAttachAttachDiscount$outboundSchema))
|
|
17391
17449
|
),
|
|
17450
|
+
billingBehavior: z53.optional(
|
|
17451
|
+
PreviewMultiAttachBillingBehavior$outboundSchema
|
|
17452
|
+
),
|
|
17392
17453
|
successUrl: z53.optional(z53.string()),
|
|
17393
17454
|
checkoutSessionParams: z53.optional(z53.record(z53.string(), z53.any())),
|
|
17394
17455
|
redirectMode: z53._default(
|
|
@@ -17407,7 +17468,9 @@ var PreviewMultiAttachParams$outboundSchema = z53.pipe(
|
|
|
17407
17468
|
customerId: "customer_id",
|
|
17408
17469
|
entityId: "entity_id",
|
|
17409
17470
|
freeTrial: "free_trial",
|
|
17471
|
+
startsAt: "starts_at",
|
|
17410
17472
|
invoiceMode: "invoice_mode",
|
|
17473
|
+
billingBehavior: "billing_behavior",
|
|
17411
17474
|
successUrl: "success_url",
|
|
17412
17475
|
checkoutSessionParams: "checkout_session_params",
|
|
17413
17476
|
redirectMode: "redirect_mode",
|
|
@@ -24938,15 +25001,17 @@ var FailOpenHook = class {
|
|
|
24938
25001
|
var DEFAULT_TIMEOUT_MS = 5e3;
|
|
24939
25002
|
var AUTO_TIMEOUT_OPERATION_IDS = /* @__PURE__ */ new Set(["check", "track"]);
|
|
24940
25003
|
var TimeoutFixHook = class {
|
|
24941
|
-
|
|
24942
|
-
|
|
24943
|
-
|
|
24944
|
-
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
|
|
24948
|
-
|
|
24949
|
-
|
|
25004
|
+
beforeCreateRequest(hookCtx, input) {
|
|
25005
|
+
if (input.options?.signal || !AUTO_TIMEOUT_OPERATION_IDS.has(hookCtx.operationID)) {
|
|
25006
|
+
return input;
|
|
25007
|
+
}
|
|
25008
|
+
return {
|
|
25009
|
+
...input,
|
|
25010
|
+
options: {
|
|
25011
|
+
...input.options,
|
|
25012
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
25013
|
+
}
|
|
25014
|
+
};
|
|
24950
25015
|
}
|
|
24951
25016
|
};
|
|
24952
25017
|
|
|
@@ -24955,7 +25020,7 @@ function initHooks(hooks) {
|
|
|
24955
25020
|
const failOpenHook = new FailOpenHook();
|
|
24956
25021
|
const timeoutFixHook = new TimeoutFixHook();
|
|
24957
25022
|
hooks.registerSDKInitHook(failOpenHook);
|
|
24958
|
-
hooks.
|
|
25023
|
+
hooks.registerBeforeCreateRequestHook(timeoutFixHook);
|
|
24959
25024
|
hooks.registerAfterErrorHook(failOpenHook);
|
|
24960
25025
|
}
|
|
24961
25026
|
|
|
@@ -26801,11 +26866,13 @@ var Billing = class extends ClientSDK {
|
|
|
26801
26866
|
* @example
|
|
26802
26867
|
* ```typescript
|
|
26803
26868
|
* // Schedule a transition from a trial plan to a paid plan
|
|
26804
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
26869
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
|
|
26805
26870
|
* ```
|
|
26806
26871
|
*
|
|
26807
26872
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
26808
26873
|
* @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
|
|
26874
|
+
* @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
|
|
26875
|
+
* @param currency - Currency used to bill the immediate phase. (optional)
|
|
26809
26876
|
* @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
|
|
26810
26877
|
* @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)
|
|
26811
26878
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
@@ -26814,6 +26881,7 @@ var Billing = class extends ClientSDK {
|
|
|
26814
26881
|
* @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
|
|
26815
26882
|
* @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
|
|
26816
26883
|
* @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)
|
|
26884
|
+
* @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
|
|
26817
26885
|
* @param phases - Ordered phase definitions for the schedule.
|
|
26818
26886
|
*
|
|
26819
26887
|
* @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
|
|
@@ -26852,9 +26920,11 @@ var Billing = class extends ClientSDK {
|
|
|
26852
26920
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
26853
26921
|
* @param plans - The list of plans to attach to the customer.
|
|
26854
26922
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
26923
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
26855
26924
|
* @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)
|
|
26856
26925
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
26857
26926
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
26927
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
26858
26928
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
26859
26929
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
26860
26930
|
* @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)
|
|
@@ -26935,9 +27005,11 @@ var Billing = class extends ClientSDK {
|
|
|
26935
27005
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
26936
27006
|
* @param plans - The list of plans to attach to the customer.
|
|
26937
27007
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
27008
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
26938
27009
|
* @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)
|
|
26939
27010
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
26940
27011
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
27012
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
26941
27013
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
26942
27014
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
26943
27015
|
* @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)
|
|
@@ -1604,7 +1604,8 @@ var multiAttachPlanOutboundSchema = z7.object({
|
|
|
1604
1604
|
customize: z7.union([multiAttachCustomizeOutboundSchema, z7.undefined()]).optional(),
|
|
1605
1605
|
feature_quantities: z7.union([z7.array(multiAttachFeatureQuantityOutboundSchema), z7.undefined()]).optional(),
|
|
1606
1606
|
version: z7.union([z7.number(), z7.undefined()]).optional(),
|
|
1607
|
-
subscription_id: z7.union([z7.string(), z7.undefined()]).optional()
|
|
1607
|
+
subscription_id: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1608
|
+
entity_id: z7.union([z7.string(), z7.undefined()]).optional().nullable()
|
|
1608
1609
|
});
|
|
1609
1610
|
var multiAttachFreeTrialParamsOutboundSchema = z7.object({
|
|
1610
1611
|
duration_length: z7.number(),
|
|
@@ -1732,7 +1733,8 @@ var multiAttachPlanSchema = z7.object({
|
|
|
1732
1733
|
customize: z7.union([multiAttachCustomizeSchema, z7.undefined()]).optional(),
|
|
1733
1734
|
featureQuantities: z7.union([z7.array(multiAttachFeatureQuantitySchema), z7.undefined()]).optional(),
|
|
1734
1735
|
version: z7.union([z7.number(), z7.undefined()]).optional(),
|
|
1735
|
-
subscriptionId: z7.union([z7.string(), z7.undefined()]).optional()
|
|
1736
|
+
subscriptionId: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1737
|
+
entityId: z7.union([z7.string(), z7.undefined()]).optional().nullable()
|
|
1736
1738
|
});
|
|
1737
1739
|
var multiAttachDurationTypeSchema = closedEnumSchema4;
|
|
1738
1740
|
var multiAttachOnEndSchema = closedEnumSchema4;
|
|
@@ -1742,6 +1744,7 @@ var multiAttachFreeTrialParamsSchema = z7.object({
|
|
|
1742
1744
|
cardRequired: z7.union([z7.boolean(), z7.undefined()]).optional(),
|
|
1743
1745
|
onEnd: z7.union([multiAttachOnEndSchema, z7.undefined()]).optional()
|
|
1744
1746
|
});
|
|
1747
|
+
var multiAttachBillingBehaviorSchema = closedEnumSchema4;
|
|
1745
1748
|
var multiAttachRedirectModeSchema = closedEnumSchema4;
|
|
1746
1749
|
var multiAttachLimitTypeSchema = closedEnumSchema4;
|
|
1747
1750
|
var multiAttachSpendLimitSchema = z7.object({
|
|
@@ -1783,9 +1786,11 @@ var multiAttachParamsSchema = z7.object({
|
|
|
1783
1786
|
entityId: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1784
1787
|
plans: z7.array(multiAttachPlanSchema),
|
|
1785
1788
|
freeTrial: z7.union([multiAttachFreeTrialParamsSchema, z7.undefined()]).optional().nullable(),
|
|
1789
|
+
startsAt: z7.union([z7.number(), z7.undefined()]).optional(),
|
|
1786
1790
|
currency: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1787
1791
|
invoiceMode: z7.union([multiAttachInvoiceModeSchema, z7.undefined()]).optional(),
|
|
1788
1792
|
discounts: z7.union([z7.array(multiAttachAttachDiscountSchema), z7.undefined()]).optional(),
|
|
1793
|
+
billingBehavior: z7.union([multiAttachBillingBehaviorSchema, z7.undefined()]).optional(),
|
|
1789
1794
|
successUrl: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1790
1795
|
checkoutSessionParams: z7.union([z7.record(z7.string(), z7.any()), z7.undefined()]).optional(),
|
|
1791
1796
|
redirectMode: z7.union([multiAttachRedirectModeSchema, z7.undefined()]).optional(),
|
|
@@ -1811,9 +1816,11 @@ var multiAttachParamsOutboundSchema = z7.object({
|
|
|
1811
1816
|
entity_id: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1812
1817
|
plans: z7.array(multiAttachPlanOutboundSchema),
|
|
1813
1818
|
free_trial: z7.union([multiAttachFreeTrialParamsOutboundSchema, z7.undefined()]).optional().nullable(),
|
|
1819
|
+
starts_at: z7.union([z7.number(), z7.undefined()]).optional(),
|
|
1814
1820
|
currency: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1815
1821
|
invoice_mode: z7.union([multiAttachInvoiceModeOutboundSchema, z7.undefined()]).optional(),
|
|
1816
1822
|
discounts: z7.union([z7.array(multiAttachAttachDiscountOutboundSchema), z7.undefined()]).optional(),
|
|
1823
|
+
billing_behavior: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1817
1824
|
success_url: z7.union([z7.string(), z7.undefined()]).optional(),
|
|
1818
1825
|
checkout_session_params: z7.union([z7.record(z7.string(), z7.any()), z7.undefined()]).optional(),
|
|
1819
1826
|
redirect_mode: z7.string(),
|
|
@@ -2959,7 +2966,8 @@ var previewMultiAttachPlanOutboundSchema = z10.object({
|
|
|
2959
2966
|
z10.undefined()
|
|
2960
2967
|
]).optional(),
|
|
2961
2968
|
version: z10.union([z10.number(), z10.undefined()]).optional(),
|
|
2962
|
-
subscription_id: z10.union([z10.string(), z10.undefined()]).optional()
|
|
2969
|
+
subscription_id: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
2970
|
+
entity_id: z10.union([z10.string(), z10.undefined()]).optional().nullable()
|
|
2963
2971
|
});
|
|
2964
2972
|
var previewMultiAttachFreeTrialParamsOutboundSchema = z10.object({
|
|
2965
2973
|
duration_length: z10.number(),
|
|
@@ -3097,7 +3105,8 @@ var previewMultiAttachPlanSchema = z10.object({
|
|
|
3097
3105
|
z10.undefined()
|
|
3098
3106
|
]).optional(),
|
|
3099
3107
|
version: z10.union([z10.number(), z10.undefined()]).optional(),
|
|
3100
|
-
subscriptionId: z10.union([z10.string(), z10.undefined()]).optional()
|
|
3108
|
+
subscriptionId: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3109
|
+
entityId: z10.union([z10.string(), z10.undefined()]).optional().nullable()
|
|
3101
3110
|
});
|
|
3102
3111
|
var previewMultiAttachDurationTypeSchema = closedEnumSchema6;
|
|
3103
3112
|
var previewMultiAttachOnEndSchema = closedEnumSchema6;
|
|
@@ -3107,6 +3116,7 @@ var previewMultiAttachFreeTrialParamsSchema = z10.object({
|
|
|
3107
3116
|
cardRequired: z10.union([z10.boolean(), z10.undefined()]).optional(),
|
|
3108
3117
|
onEnd: z10.union([previewMultiAttachOnEndSchema, z10.undefined()]).optional()
|
|
3109
3118
|
});
|
|
3119
|
+
var previewMultiAttachBillingBehaviorSchema = closedEnumSchema6;
|
|
3110
3120
|
var previewMultiAttachRedirectModeSchema = closedEnumSchema6;
|
|
3111
3121
|
var previewMultiAttachLimitTypeSchema = closedEnumSchema6;
|
|
3112
3122
|
var previewMultiAttachSpendLimitSchema = z10.object({
|
|
@@ -3148,9 +3158,11 @@ var previewMultiAttachParamsSchema = z10.object({
|
|
|
3148
3158
|
entityId: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3149
3159
|
plans: z10.array(previewMultiAttachPlanSchema),
|
|
3150
3160
|
freeTrial: z10.union([previewMultiAttachFreeTrialParamsSchema, z10.undefined()]).optional().nullable(),
|
|
3161
|
+
startsAt: z10.union([z10.number(), z10.undefined()]).optional(),
|
|
3151
3162
|
currency: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3152
3163
|
invoiceMode: z10.union([previewMultiAttachInvoiceModeSchema, z10.undefined()]).optional(),
|
|
3153
3164
|
discounts: z10.union([z10.array(previewMultiAttachAttachDiscountSchema), z10.undefined()]).optional(),
|
|
3165
|
+
billingBehavior: z10.union([previewMultiAttachBillingBehaviorSchema, z10.undefined()]).optional(),
|
|
3154
3166
|
successUrl: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3155
3167
|
checkoutSessionParams: z10.union([z10.record(z10.string(), z10.any()), z10.undefined()]).optional(),
|
|
3156
3168
|
redirectMode: z10.union([previewMultiAttachRedirectModeSchema, z10.undefined()]).optional(),
|
|
@@ -3204,12 +3216,14 @@ var previewMultiAttachParamsOutboundSchema = z10.object({
|
|
|
3204
3216
|
entity_id: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3205
3217
|
plans: z10.array(previewMultiAttachPlanOutboundSchema),
|
|
3206
3218
|
free_trial: z10.union([previewMultiAttachFreeTrialParamsOutboundSchema, z10.undefined()]).optional().nullable(),
|
|
3219
|
+
starts_at: z10.union([z10.number(), z10.undefined()]).optional(),
|
|
3207
3220
|
currency: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3208
3221
|
invoice_mode: z10.union([previewMultiAttachInvoiceModeOutboundSchema, z10.undefined()]).optional(),
|
|
3209
3222
|
discounts: z10.union([
|
|
3210
3223
|
z10.array(previewMultiAttachAttachDiscountOutboundSchema),
|
|
3211
3224
|
z10.undefined()
|
|
3212
3225
|
]).optional(),
|
|
3226
|
+
billing_behavior: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3213
3227
|
success_url: z10.union([z10.string(), z10.undefined()]).optional(),
|
|
3214
3228
|
checkout_session_params: z10.union([z10.record(z10.string(), z10.any()), z10.undefined()]).optional(),
|
|
3215
3229
|
redirect_mode: z10.string(),
|