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
package/dist/sdk/index.js
CHANGED
|
@@ -10954,6 +10954,15 @@ function createReferralCodeResponseFromJSON(jsonString) {
|
|
|
10954
10954
|
`Failed to parse 'CreateReferralCodeResponse' from JSON`
|
|
10955
10955
|
);
|
|
10956
10956
|
}
|
|
10957
|
+
var CreateScheduleFreeTrialDurationType = {
|
|
10958
|
+
Day: "day",
|
|
10959
|
+
Month: "month",
|
|
10960
|
+
Year: "year"
|
|
10961
|
+
};
|
|
10962
|
+
var CreateScheduleOnEnd = {
|
|
10963
|
+
Bill: "bill",
|
|
10964
|
+
Revert: "revert"
|
|
10965
|
+
};
|
|
10957
10966
|
var CreateScheduleRedirectMode = {
|
|
10958
10967
|
Always: "always",
|
|
10959
10968
|
IfRequired: "if_required",
|
|
@@ -10963,7 +10972,7 @@ var CreateScheduleBillingBehavior = {
|
|
|
10963
10972
|
ProrateImmediately: "prorate_immediately",
|
|
10964
10973
|
None: "none"
|
|
10965
10974
|
};
|
|
10966
|
-
var
|
|
10975
|
+
var PhaseStartDurationType = {
|
|
10967
10976
|
Month: "month",
|
|
10968
10977
|
Year: "year"
|
|
10969
10978
|
};
|
|
@@ -11121,6 +11130,34 @@ var CreateScheduleCode = {
|
|
|
11121
11130
|
PaymentFailed: "payment_failed",
|
|
11122
11131
|
PaymentProcessing: "payment_processing"
|
|
11123
11132
|
};
|
|
11133
|
+
var CreateScheduleFreeTrialDurationType$outboundSchema = z70__namespace.enum(CreateScheduleFreeTrialDurationType);
|
|
11134
|
+
var CreateScheduleOnEnd$outboundSchema = z70__namespace.enum(CreateScheduleOnEnd);
|
|
11135
|
+
var CreateScheduleFreeTrialParams$outboundSchema = z70__namespace.pipe(
|
|
11136
|
+
z70__namespace.object({
|
|
11137
|
+
durationLength: z70__namespace.number(),
|
|
11138
|
+
durationType: z70__namespace._default(
|
|
11139
|
+
CreateScheduleFreeTrialDurationType$outboundSchema,
|
|
11140
|
+
"month"
|
|
11141
|
+
),
|
|
11142
|
+
cardRequired: z70__namespace._default(z70__namespace.boolean(), true),
|
|
11143
|
+
onEnd: z70__namespace.optional(CreateScheduleOnEnd$outboundSchema)
|
|
11144
|
+
}),
|
|
11145
|
+
z70__namespace.transform((v) => {
|
|
11146
|
+
return remap(v, {
|
|
11147
|
+
durationLength: "duration_length",
|
|
11148
|
+
durationType: "duration_type",
|
|
11149
|
+
cardRequired: "card_required",
|
|
11150
|
+
onEnd: "on_end"
|
|
11151
|
+
});
|
|
11152
|
+
})
|
|
11153
|
+
);
|
|
11154
|
+
function createScheduleFreeTrialParamsToJSON(createScheduleFreeTrialParams) {
|
|
11155
|
+
return JSON.stringify(
|
|
11156
|
+
CreateScheduleFreeTrialParams$outboundSchema.parse(
|
|
11157
|
+
createScheduleFreeTrialParams
|
|
11158
|
+
)
|
|
11159
|
+
);
|
|
11160
|
+
}
|
|
11124
11161
|
var CreateScheduleInvoiceMode$outboundSchema = z70__namespace.pipe(
|
|
11125
11162
|
z70__namespace.object({
|
|
11126
11163
|
enabled: z70__namespace.boolean(),
|
|
@@ -11167,10 +11204,10 @@ var StartsAt2$outboundSchema = smartUnion([z70__namespace.number(), z70__namespa
|
|
|
11167
11204
|
function startsAt2ToJSON(startsAt2) {
|
|
11168
11205
|
return JSON.stringify(StartsAt2$outboundSchema.parse(startsAt2));
|
|
11169
11206
|
}
|
|
11170
|
-
var
|
|
11207
|
+
var PhaseStartDurationType$outboundSchema = z70__namespace.enum(PhaseStartDurationType);
|
|
11171
11208
|
var StartingAfter2$outboundSchema = z70__namespace.pipe(
|
|
11172
11209
|
z70__namespace.object({
|
|
11173
|
-
durationType:
|
|
11210
|
+
durationType: PhaseStartDurationType$outboundSchema,
|
|
11174
11211
|
durationCount: z70__namespace.int()
|
|
11175
11212
|
}),
|
|
11176
11213
|
z70__namespace.transform((v) => {
|
|
@@ -11806,6 +11843,7 @@ function createScheduleCustomize2ToJSON(createScheduleCustomize2) {
|
|
|
11806
11843
|
var CreateSchedulePlan2$outboundSchema = z70__namespace.pipe(
|
|
11807
11844
|
z70__namespace.object({
|
|
11808
11845
|
planId: z70__namespace.string(),
|
|
11846
|
+
entityId: z70__namespace.optional(z70__namespace.nullable(z70__namespace.string())),
|
|
11809
11847
|
featureQuantities: z70__namespace.optional(
|
|
11810
11848
|
z70__namespace.array(z70__namespace.lazy(() => CreateScheduleFeatureQuantity2$outboundSchema))
|
|
11811
11849
|
),
|
|
@@ -11818,6 +11856,7 @@ var CreateSchedulePlan2$outboundSchema = z70__namespace.pipe(
|
|
|
11818
11856
|
z70__namespace.transform((v) => {
|
|
11819
11857
|
return remap(v, {
|
|
11820
11858
|
planId: "plan_id",
|
|
11859
|
+
entityId: "entity_id",
|
|
11821
11860
|
featureQuantities: "feature_quantities",
|
|
11822
11861
|
subscriptionId: "subscription_id"
|
|
11823
11862
|
});
|
|
@@ -11855,6 +11894,10 @@ var CreateScheduleParams$outboundSchema = z70__namespace.pipe(
|
|
|
11855
11894
|
z70__namespace.object({
|
|
11856
11895
|
customerId: z70__namespace.string(),
|
|
11857
11896
|
entityId: z70__namespace.optional(z70__namespace.string()),
|
|
11897
|
+
freeTrial: z70__namespace.optional(
|
|
11898
|
+
z70__namespace.nullable(z70__namespace.lazy(() => CreateScheduleFreeTrialParams$outboundSchema))
|
|
11899
|
+
),
|
|
11900
|
+
currency: z70__namespace.optional(z70__namespace.string()),
|
|
11858
11901
|
invoiceMode: z70__namespace.optional(
|
|
11859
11902
|
z70__namespace.lazy(() => CreateScheduleInvoiceMode$outboundSchema)
|
|
11860
11903
|
),
|
|
@@ -11870,19 +11913,22 @@ var CreateScheduleParams$outboundSchema = z70__namespace.pipe(
|
|
|
11870
11913
|
billingBehavior: z70__namespace.optional(CreateScheduleBillingBehavior$outboundSchema),
|
|
11871
11914
|
billingCycleAnchor: z70__namespace.optional(z70__namespace.literal("now")),
|
|
11872
11915
|
enablePlanImmediately: z70__namespace.optional(z70__namespace.boolean()),
|
|
11916
|
+
preserveAddOns: z70__namespace.optional(z70__namespace.boolean()),
|
|
11873
11917
|
phases: z70__namespace.array(z70__namespace.lazy(() => PhaseStart$outboundSchema))
|
|
11874
11918
|
}),
|
|
11875
11919
|
z70__namespace.transform((v) => {
|
|
11876
11920
|
return remap(v, {
|
|
11877
11921
|
customerId: "customer_id",
|
|
11878
11922
|
entityId: "entity_id",
|
|
11923
|
+
freeTrial: "free_trial",
|
|
11879
11924
|
invoiceMode: "invoice_mode",
|
|
11880
11925
|
successUrl: "success_url",
|
|
11881
11926
|
checkoutSessionParams: "checkout_session_params",
|
|
11882
11927
|
redirectMode: "redirect_mode",
|
|
11883
11928
|
billingBehavior: "billing_behavior",
|
|
11884
11929
|
billingCycleAnchor: "billing_cycle_anchor",
|
|
11885
|
-
enablePlanImmediately: "enable_plan_immediately"
|
|
11930
|
+
enablePlanImmediately: "enable_plan_immediately",
|
|
11931
|
+
preserveAddOns: "preserve_add_ons"
|
|
11886
11932
|
});
|
|
11887
11933
|
})
|
|
11888
11934
|
);
|
|
@@ -19699,6 +19745,10 @@ var MultiAttachOnEnd = {
|
|
|
19699
19745
|
Bill: "bill",
|
|
19700
19746
|
Revert: "revert"
|
|
19701
19747
|
};
|
|
19748
|
+
var MultiAttachBillingBehavior = {
|
|
19749
|
+
ProrateImmediately: "prorate_immediately",
|
|
19750
|
+
None: "none"
|
|
19751
|
+
};
|
|
19702
19752
|
var MultiAttachRedirectMode = {
|
|
19703
19753
|
Always: "always",
|
|
19704
19754
|
IfRequired: "if_required",
|
|
@@ -19960,13 +20010,15 @@ var MultiAttachPlan$outboundSchema = z70__namespace.pipe(
|
|
|
19960
20010
|
z70__namespace.array(z70__namespace.lazy(() => MultiAttachFeatureQuantity$outboundSchema))
|
|
19961
20011
|
),
|
|
19962
20012
|
version: z70__namespace.optional(z70__namespace.number()),
|
|
19963
|
-
subscriptionId: z70__namespace.optional(z70__namespace.string())
|
|
20013
|
+
subscriptionId: z70__namespace.optional(z70__namespace.string()),
|
|
20014
|
+
entityId: z70__namespace.optional(z70__namespace.nullable(z70__namespace.string()))
|
|
19964
20015
|
}),
|
|
19965
20016
|
z70__namespace.transform((v) => {
|
|
19966
20017
|
return remap(v, {
|
|
19967
20018
|
planId: "plan_id",
|
|
19968
20019
|
featureQuantities: "feature_quantities",
|
|
19969
|
-
subscriptionId: "subscription_id"
|
|
20020
|
+
subscriptionId: "subscription_id",
|
|
20021
|
+
entityId: "entity_id"
|
|
19970
20022
|
});
|
|
19971
20023
|
})
|
|
19972
20024
|
);
|
|
@@ -20034,6 +20086,7 @@ function multiAttachAttachDiscountToJSON(multiAttachAttachDiscount) {
|
|
|
20034
20086
|
MultiAttachAttachDiscount$outboundSchema.parse(multiAttachAttachDiscount)
|
|
20035
20087
|
);
|
|
20036
20088
|
}
|
|
20089
|
+
var MultiAttachBillingBehavior$outboundSchema = z70__namespace.enum(MultiAttachBillingBehavior);
|
|
20037
20090
|
var MultiAttachRedirectMode$outboundSchema = z70__namespace.enum(MultiAttachRedirectMode);
|
|
20038
20091
|
var MultiAttachLimitType$outboundSchema = z70__namespace.enum(MultiAttachLimitType);
|
|
20039
20092
|
var MultiAttachSpendLimit$outboundSchema = z70__namespace.pipe(
|
|
@@ -20189,6 +20242,7 @@ var MultiAttachParams$outboundSchema = z70__namespace.pipe(
|
|
|
20189
20242
|
freeTrial: z70__namespace.optional(
|
|
20190
20243
|
z70__namespace.nullable(z70__namespace.lazy(() => MultiAttachFreeTrialParams$outboundSchema))
|
|
20191
20244
|
),
|
|
20245
|
+
startsAt: z70__namespace.optional(z70__namespace.int()),
|
|
20192
20246
|
currency: z70__namespace.optional(z70__namespace.string()),
|
|
20193
20247
|
invoiceMode: z70__namespace.optional(
|
|
20194
20248
|
z70__namespace.lazy(() => MultiAttachInvoiceMode$outboundSchema)
|
|
@@ -20196,6 +20250,7 @@ var MultiAttachParams$outboundSchema = z70__namespace.pipe(
|
|
|
20196
20250
|
discounts: z70__namespace.optional(
|
|
20197
20251
|
z70__namespace.array(z70__namespace.lazy(() => MultiAttachAttachDiscount$outboundSchema))
|
|
20198
20252
|
),
|
|
20253
|
+
billingBehavior: z70__namespace.optional(MultiAttachBillingBehavior$outboundSchema),
|
|
20199
20254
|
successUrl: z70__namespace.optional(z70__namespace.string()),
|
|
20200
20255
|
checkoutSessionParams: z70__namespace.optional(z70__namespace.record(z70__namespace.string(), z70__namespace.any())),
|
|
20201
20256
|
redirectMode: z70__namespace._default(
|
|
@@ -20212,7 +20267,9 @@ var MultiAttachParams$outboundSchema = z70__namespace.pipe(
|
|
|
20212
20267
|
customerId: "customer_id",
|
|
20213
20268
|
entityId: "entity_id",
|
|
20214
20269
|
freeTrial: "free_trial",
|
|
20270
|
+
startsAt: "starts_at",
|
|
20215
20271
|
invoiceMode: "invoice_mode",
|
|
20272
|
+
billingBehavior: "billing_behavior",
|
|
20216
20273
|
successUrl: "success_url",
|
|
20217
20274
|
checkoutSessionParams: "checkout_session_params",
|
|
20218
20275
|
redirectMode: "redirect_mode",
|
|
@@ -22296,6 +22353,10 @@ var PreviewMultiAttachOnEnd = {
|
|
|
22296
22353
|
Bill: "bill",
|
|
22297
22354
|
Revert: "revert"
|
|
22298
22355
|
};
|
|
22356
|
+
var PreviewMultiAttachBillingBehavior = {
|
|
22357
|
+
ProrateImmediately: "prorate_immediately",
|
|
22358
|
+
None: "none"
|
|
22359
|
+
};
|
|
22299
22360
|
var PreviewMultiAttachRedirectMode = {
|
|
22300
22361
|
Always: "always",
|
|
22301
22362
|
IfRequired: "if_required",
|
|
@@ -22585,13 +22646,15 @@ var PreviewMultiAttachPlan$outboundSchema = z70__namespace.pipe(
|
|
|
22585
22646
|
)
|
|
22586
22647
|
),
|
|
22587
22648
|
version: z70__namespace.optional(z70__namespace.number()),
|
|
22588
|
-
subscriptionId: z70__namespace.optional(z70__namespace.string())
|
|
22649
|
+
subscriptionId: z70__namespace.optional(z70__namespace.string()),
|
|
22650
|
+
entityId: z70__namespace.optional(z70__namespace.nullable(z70__namespace.string()))
|
|
22589
22651
|
}),
|
|
22590
22652
|
z70__namespace.transform((v) => {
|
|
22591
22653
|
return remap(v, {
|
|
22592
22654
|
planId: "plan_id",
|
|
22593
22655
|
featureQuantities: "feature_quantities",
|
|
22594
|
-
subscriptionId: "subscription_id"
|
|
22656
|
+
subscriptionId: "subscription_id",
|
|
22657
|
+
entityId: "entity_id"
|
|
22595
22658
|
});
|
|
22596
22659
|
})
|
|
22597
22660
|
);
|
|
@@ -22670,6 +22733,7 @@ function previewMultiAttachAttachDiscountToJSON(previewMultiAttachAttachDiscount
|
|
|
22670
22733
|
)
|
|
22671
22734
|
);
|
|
22672
22735
|
}
|
|
22736
|
+
var PreviewMultiAttachBillingBehavior$outboundSchema = z70__namespace.enum(PreviewMultiAttachBillingBehavior);
|
|
22673
22737
|
var PreviewMultiAttachRedirectMode$outboundSchema = z70__namespace.enum(PreviewMultiAttachRedirectMode);
|
|
22674
22738
|
var PreviewMultiAttachLimitType$outboundSchema = z70__namespace.enum(PreviewMultiAttachLimitType);
|
|
22675
22739
|
var PreviewMultiAttachSpendLimit$outboundSchema = z70__namespace.pipe(
|
|
@@ -22841,6 +22905,7 @@ var PreviewMultiAttachParams$outboundSchema = z70__namespace.pipe(
|
|
|
22841
22905
|
z70__namespace.lazy(() => PreviewMultiAttachFreeTrialParams$outboundSchema)
|
|
22842
22906
|
)
|
|
22843
22907
|
),
|
|
22908
|
+
startsAt: z70__namespace.optional(z70__namespace.int()),
|
|
22844
22909
|
currency: z70__namespace.optional(z70__namespace.string()),
|
|
22845
22910
|
invoiceMode: z70__namespace.optional(
|
|
22846
22911
|
z70__namespace.lazy(() => PreviewMultiAttachInvoiceMode$outboundSchema)
|
|
@@ -22848,6 +22913,9 @@ var PreviewMultiAttachParams$outboundSchema = z70__namespace.pipe(
|
|
|
22848
22913
|
discounts: z70__namespace.optional(
|
|
22849
22914
|
z70__namespace.array(z70__namespace.lazy(() => PreviewMultiAttachAttachDiscount$outboundSchema))
|
|
22850
22915
|
),
|
|
22916
|
+
billingBehavior: z70__namespace.optional(
|
|
22917
|
+
PreviewMultiAttachBillingBehavior$outboundSchema
|
|
22918
|
+
),
|
|
22851
22919
|
successUrl: z70__namespace.optional(z70__namespace.string()),
|
|
22852
22920
|
checkoutSessionParams: z70__namespace.optional(z70__namespace.record(z70__namespace.string(), z70__namespace.any())),
|
|
22853
22921
|
redirectMode: z70__namespace._default(
|
|
@@ -22866,7 +22934,9 @@ var PreviewMultiAttachParams$outboundSchema = z70__namespace.pipe(
|
|
|
22866
22934
|
customerId: "customer_id",
|
|
22867
22935
|
entityId: "entity_id",
|
|
22868
22936
|
freeTrial: "free_trial",
|
|
22937
|
+
startsAt: "starts_at",
|
|
22869
22938
|
invoiceMode: "invoice_mode",
|
|
22939
|
+
billingBehavior: "billing_behavior",
|
|
22870
22940
|
successUrl: "success_url",
|
|
22871
22941
|
checkoutSessionParams: "checkout_session_params",
|
|
22872
22942
|
redirectMode: "redirect_mode",
|
|
@@ -32798,15 +32868,17 @@ var FailOpenHook = class {
|
|
|
32798
32868
|
var DEFAULT_TIMEOUT_MS = 5e3;
|
|
32799
32869
|
var AUTO_TIMEOUT_OPERATION_IDS = /* @__PURE__ */ new Set(["check", "track"]);
|
|
32800
32870
|
var TimeoutFixHook = class {
|
|
32801
|
-
|
|
32802
|
-
|
|
32803
|
-
|
|
32804
|
-
|
|
32805
|
-
|
|
32806
|
-
|
|
32807
|
-
|
|
32808
|
-
|
|
32809
|
-
|
|
32871
|
+
beforeCreateRequest(hookCtx, input) {
|
|
32872
|
+
if (input.options?.signal || !AUTO_TIMEOUT_OPERATION_IDS.has(hookCtx.operationID)) {
|
|
32873
|
+
return input;
|
|
32874
|
+
}
|
|
32875
|
+
return {
|
|
32876
|
+
...input,
|
|
32877
|
+
options: {
|
|
32878
|
+
...input.options,
|
|
32879
|
+
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS)
|
|
32880
|
+
}
|
|
32881
|
+
};
|
|
32810
32882
|
}
|
|
32811
32883
|
};
|
|
32812
32884
|
|
|
@@ -32815,7 +32887,7 @@ function initHooks(hooks) {
|
|
|
32815
32887
|
const failOpenHook = new FailOpenHook();
|
|
32816
32888
|
const timeoutFixHook = new TimeoutFixHook();
|
|
32817
32889
|
hooks.registerSDKInitHook(failOpenHook);
|
|
32818
|
-
hooks.
|
|
32890
|
+
hooks.registerBeforeCreateRequestHook(timeoutFixHook);
|
|
32819
32891
|
hooks.registerAfterErrorHook(failOpenHook);
|
|
32820
32892
|
}
|
|
32821
32893
|
|
|
@@ -34617,11 +34689,13 @@ var Billing = class extends ClientSDK {
|
|
|
34617
34689
|
* @example
|
|
34618
34690
|
* ```typescript
|
|
34619
34691
|
* // Schedule a transition from a trial plan to a paid plan
|
|
34620
|
-
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":
|
|
34692
|
+
* const response = await client.billing.createSchedule({ customerId: "cus_123", phases: [{"startsAt":1785760797907,"plans":[{"planId":"trial_plan"}]},{"startsAt":1786970397907,"plans":[{"planId":"pro_plan"}]}] });
|
|
34621
34693
|
* ```
|
|
34622
34694
|
*
|
|
34623
34695
|
* @param customerId - The ID of the customer to create the schedule for.
|
|
34624
34696
|
* @param entityId - Optional entity ID for an entity-scoped schedule. (optional)
|
|
34697
|
+
* @param freeTrial - Free trial configuration applied to every plan in the immediate phase. (optional)
|
|
34698
|
+
* @param currency - Currency used to bill the immediate phase. (optional)
|
|
34625
34699
|
* @param invoiceMode - Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase. (optional)
|
|
34626
34700
|
* @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)
|
|
34627
34701
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
@@ -34630,6 +34704,7 @@ var Billing = class extends ClientSDK {
|
|
|
34630
34704
|
* @param billingBehavior - Whether to prorate the immediate phase. 'none' skips proration charges and credits. (optional)
|
|
34631
34705
|
* @param billingCycleAnchor - Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time. (optional)
|
|
34632
34706
|
* @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)
|
|
34707
|
+
* @param preserveAddOns - If true, active recurring add-ons in scopes represented by the phase plans are retained. (optional)
|
|
34633
34708
|
* @param phases - Ordered phase definitions for the schedule.
|
|
34634
34709
|
*
|
|
34635
34710
|
* @returns A create-schedule response with the schedule ID, persisted phases, and any required payment or checkout URL.
|
|
@@ -34668,9 +34743,11 @@ var Billing = class extends ClientSDK {
|
|
|
34668
34743
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
34669
34744
|
* @param plans - The list of plans to attach to the customer.
|
|
34670
34745
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
34746
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
34671
34747
|
* @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)
|
|
34672
34748
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
34673
34749
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
34750
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
34674
34751
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
34675
34752
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
34676
34753
|
* @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)
|
|
@@ -34751,9 +34828,11 @@ var Billing = class extends ClientSDK {
|
|
|
34751
34828
|
* @param entityId - The ID of the entity to attach the plans to. (optional)
|
|
34752
34829
|
* @param plans - The list of plans to attach to the customer.
|
|
34753
34830
|
* @param freeTrial - Free trial configuration applied to all plans. Pass an object to set a custom trial, or null to remove any trial. (optional)
|
|
34831
|
+
* @param startsAt - Unix timestamp in milliseconds for backdating every plan in this multi-attach. (optional)
|
|
34754
34832
|
* @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)
|
|
34755
34833
|
* @param invoiceMode - Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. (optional)
|
|
34756
34834
|
* @param discounts - List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code. (optional)
|
|
34835
|
+
* @param billingBehavior - How to handle billing. 'prorate_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything. (optional)
|
|
34757
34836
|
* @param successUrl - URL to redirect to after successful checkout. (optional)
|
|
34758
34837
|
* @param checkoutSessionParams - Additional parameters to pass into the creation of the Stripe checkout session. (optional)
|
|
34759
34838
|
* @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)
|
|
@@ -39410,10 +39489,11 @@ exports.CreateScheduleBillingControls2$outboundSchema = CreateScheduleBillingCon
|
|
|
39410
39489
|
exports.CreateScheduleCode = CreateScheduleCode;
|
|
39411
39490
|
exports.CreateScheduleCode$inboundSchema = CreateScheduleCode$inboundSchema;
|
|
39412
39491
|
exports.CreateScheduleCustomize2$outboundSchema = CreateScheduleCustomize2$outboundSchema;
|
|
39413
|
-
exports.CreateScheduleDurationType2 = CreateScheduleDurationType2;
|
|
39414
|
-
exports.CreateScheduleDurationType2$outboundSchema = CreateScheduleDurationType2$outboundSchema;
|
|
39415
39492
|
exports.CreateScheduleFeatureQuantity2$outboundSchema = CreateScheduleFeatureQuantity2$outboundSchema;
|
|
39416
39493
|
exports.CreateScheduleFilter2$outboundSchema = CreateScheduleFilter2$outboundSchema;
|
|
39494
|
+
exports.CreateScheduleFreeTrialDurationType = CreateScheduleFreeTrialDurationType;
|
|
39495
|
+
exports.CreateScheduleFreeTrialDurationType$outboundSchema = CreateScheduleFreeTrialDurationType$outboundSchema;
|
|
39496
|
+
exports.CreateScheduleFreeTrialParams$outboundSchema = CreateScheduleFreeTrialParams$outboundSchema;
|
|
39417
39497
|
exports.CreateScheduleIntervalRemoveItemEnum3 = CreateScheduleIntervalRemoveItemEnum3;
|
|
39418
39498
|
exports.CreateScheduleIntervalRemoveItemEnum3$outboundSchema = CreateScheduleIntervalRemoveItemEnum3$outboundSchema;
|
|
39419
39499
|
exports.CreateScheduleIntervalRemoveItemEnum4 = CreateScheduleIntervalRemoveItemEnum4;
|
|
@@ -39444,6 +39524,8 @@ exports.CreateScheduleItemTierBehavior2 = CreateScheduleItemTierBehavior2;
|
|
|
39444
39524
|
exports.CreateScheduleItemTierBehavior2$outboundSchema = CreateScheduleItemTierBehavior2$outboundSchema;
|
|
39445
39525
|
exports.CreateScheduleLimitType2 = CreateScheduleLimitType2;
|
|
39446
39526
|
exports.CreateScheduleLimitType2$outboundSchema = CreateScheduleLimitType2$outboundSchema;
|
|
39527
|
+
exports.CreateScheduleOnEnd = CreateScheduleOnEnd;
|
|
39528
|
+
exports.CreateScheduleOnEnd$outboundSchema = CreateScheduleOnEnd$outboundSchema;
|
|
39447
39529
|
exports.CreateScheduleOverageAllowed2$outboundSchema = CreateScheduleOverageAllowed2$outboundSchema;
|
|
39448
39530
|
exports.CreateScheduleParams$outboundSchema = CreateScheduleParams$outboundSchema;
|
|
39449
39531
|
exports.CreateSchedulePlan2$outboundSchema = CreateSchedulePlan2$outboundSchema;
|
|
@@ -40157,6 +40239,8 @@ exports.MintKeyResponse$inboundSchema = MintKeyResponse$inboundSchema;
|
|
|
40157
40239
|
exports.MultiAttachAdditionalCurrency$outboundSchema = MultiAttachAdditionalCurrency$outboundSchema;
|
|
40158
40240
|
exports.MultiAttachAttachDiscount$outboundSchema = MultiAttachAttachDiscount$outboundSchema;
|
|
40159
40241
|
exports.MultiAttachBasePrice$outboundSchema = MultiAttachBasePrice$outboundSchema;
|
|
40242
|
+
exports.MultiAttachBillingBehavior = MultiAttachBillingBehavior;
|
|
40243
|
+
exports.MultiAttachBillingBehavior$outboundSchema = MultiAttachBillingBehavior$outboundSchema;
|
|
40160
40244
|
exports.MultiAttachBillingControls$outboundSchema = MultiAttachBillingControls$outboundSchema;
|
|
40161
40245
|
exports.MultiAttachBillingMethod = MultiAttachBillingMethod;
|
|
40162
40246
|
exports.MultiAttachBillingMethod$outboundSchema = MultiAttachBillingMethod$outboundSchema;
|
|
@@ -40237,6 +40321,8 @@ exports.OverageAllowedSource = OverageAllowedSource;
|
|
|
40237
40321
|
exports.OverageAllowedSource$inboundSchema = OverageAllowedSource$inboundSchema;
|
|
40238
40322
|
exports.PhaseResponse$inboundSchema = PhaseResponse$inboundSchema;
|
|
40239
40323
|
exports.PhaseStart$outboundSchema = PhaseStart$outboundSchema;
|
|
40324
|
+
exports.PhaseStartDurationType = PhaseStartDurationType;
|
|
40325
|
+
exports.PhaseStartDurationType$outboundSchema = PhaseStartDurationType$outboundSchema;
|
|
40240
40326
|
exports.PhaseStartUnion$outboundSchema = PhaseStartUnion$outboundSchema;
|
|
40241
40327
|
exports.Plan$inboundSchema = Plan$inboundSchema;
|
|
40242
40328
|
exports.PlanAddItemBillingMethod = PlanAddItemBillingMethod;
|
|
@@ -40482,6 +40568,8 @@ exports.PreviewAttachUsageLineItemPeriod$inboundSchema = PreviewAttachUsageLineI
|
|
|
40482
40568
|
exports.PreviewMultiAttachAdditionalCurrency$outboundSchema = PreviewMultiAttachAdditionalCurrency$outboundSchema;
|
|
40483
40569
|
exports.PreviewMultiAttachAttachDiscount$outboundSchema = PreviewMultiAttachAttachDiscount$outboundSchema;
|
|
40484
40570
|
exports.PreviewMultiAttachBasePrice$outboundSchema = PreviewMultiAttachBasePrice$outboundSchema;
|
|
40571
|
+
exports.PreviewMultiAttachBillingBehavior = PreviewMultiAttachBillingBehavior;
|
|
40572
|
+
exports.PreviewMultiAttachBillingBehavior$outboundSchema = PreviewMultiAttachBillingBehavior$outboundSchema;
|
|
40485
40573
|
exports.PreviewMultiAttachBillingControls$outboundSchema = PreviewMultiAttachBillingControls$outboundSchema;
|
|
40486
40574
|
exports.PreviewMultiAttachBillingMethod = PreviewMultiAttachBillingMethod;
|
|
40487
40575
|
exports.PreviewMultiAttachBillingMethod$outboundSchema = PreviewMultiAttachBillingMethod$outboundSchema;
|
|
@@ -41705,6 +41793,7 @@ exports.createScheduleBillingControls2ToJSON = createScheduleBillingControls2ToJ
|
|
|
41705
41793
|
exports.createScheduleCustomize2ToJSON = createScheduleCustomize2ToJSON;
|
|
41706
41794
|
exports.createScheduleFeatureQuantity2ToJSON = createScheduleFeatureQuantity2ToJSON;
|
|
41707
41795
|
exports.createScheduleFilter2ToJSON = createScheduleFilter2ToJSON;
|
|
41796
|
+
exports.createScheduleFreeTrialParamsToJSON = createScheduleFreeTrialParamsToJSON;
|
|
41708
41797
|
exports.createScheduleIntervalUnion2ToJSON = createScheduleIntervalUnion2ToJSON;
|
|
41709
41798
|
exports.createScheduleInvoiceFromJSON = createScheduleInvoiceFromJSON;
|
|
41710
41799
|
exports.createScheduleInvoiceModeToJSON = createScheduleInvoiceModeToJSON;
|