autumn-js 1.2.47 → 1.2.49
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 +9090 -8895
- package/dist/backend/adapters/express.mjs +9 -9
- package/dist/backend/adapters/fetch.js +9090 -8895
- package/dist/backend/adapters/fetch.mjs +9 -9
- package/dist/backend/adapters/hono.js +9090 -8895
- package/dist/backend/adapters/hono.mjs +9 -9
- package/dist/backend/adapters/index.js +9090 -8895
- package/dist/backend/adapters/index.mjs +12 -12
- package/dist/backend/adapters/next.js +9090 -8895
- package/dist/backend/adapters/next.mjs +9 -9
- package/dist/backend/{chunk-L6YI6MKA.mjs → chunk-25GD3WCE.mjs} +1 -1
- package/dist/backend/chunk-2OM5IYSI.mjs +5948 -0
- package/dist/backend/{chunk-67VOIV5C.mjs → chunk-EIR56X56.mjs} +1 -1
- package/dist/backend/{chunk-S6JJU673.mjs → chunk-FZQWS6KN.mjs} +1 -1
- package/dist/backend/{chunk-77GKCX3Z.mjs → chunk-K7BBOM2C.mjs} +7 -7
- package/dist/backend/{chunk-JG66WX4B.mjs → chunk-QEJJM4BY.mjs} +5233 -5078
- package/dist/backend/{chunk-XTQXSCZZ.mjs → chunk-TW3CT5JS.mjs} +1 -1
- package/dist/backend/{chunk-I4AHQU6F.mjs → chunk-WIIJIELJ.mjs} +5 -5
- 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 +9090 -8895
- 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 +9090 -8895
- 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 +9090 -8895
- 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 +9090 -8895
- 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 +3864 -3824
- 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 +3864 -3824
- 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 +9090 -8895
- package/dist/backend/index.mjs +10 -10
- package/dist/backend/{routeTypes-D4za8Mi4.d.mts → routeTypes-6-0oSlbI.d.mts} +110 -0
- package/dist/backend/{routeTypes-Dzcm4w8Y.d.ts → routeTypes-NNlpTwza.d.ts} +110 -0
- package/dist/better-auth/chunk-4E2XIHMW.mjs +6009 -0
- package/dist/better-auth/{chunk-APNGRMN6.mjs → chunk-JB7C63BT.mjs} +5234 -5079
- package/dist/better-auth/{chunk-HEIFJSJZ.mjs → chunk-KTJ7KXKK.mjs} +1 -1
- package/dist/better-auth/index.js +11338 -11143
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +3864 -3824
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +9090 -8895
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +11338 -11143
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/sdk/index.d.mts +138 -1
- package/dist/sdk/index.d.ts +138 -1
- package/dist/sdk/index.js +7393 -7218
- package/dist/sdk/index.mjs +7381 -7218
- package/package.json +1 -1
- package/dist/backend/chunk-HVAWZLIS.mjs +0 -5908
- package/dist/better-auth/chunk-RRPADBHG.mjs +0 -5969
- package/dist/backend/{chunk-IXUCY7AU.mjs → chunk-MOHYGUMA.mjs} +3 -3
package/dist/backend/index.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./chunk-WYDGEDEU.mjs";
|
|
2
2
|
import "./chunk-VXND2UDT.mjs";
|
|
3
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-WIIJIELJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createCoreHandler
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K7BBOM2C.mjs";
|
|
7
|
+
import "./chunk-QEJJM4BY.mjs";
|
|
8
|
+
import "./chunk-MOHYGUMA.mjs";
|
|
9
|
+
import "./chunk-TBQ27LIK.mjs";
|
|
10
|
+
import "./chunk-J44WR3QZ.mjs";
|
|
7
11
|
import "./chunk-TSF4YCUO.mjs";
|
|
8
12
|
import {
|
|
9
13
|
buildRouter
|
|
10
14
|
} from "./chunk-UAR3TMWI.mjs";
|
|
11
|
-
import "./chunk-JG66WX4B.mjs";
|
|
12
15
|
import {
|
|
13
16
|
routeConfigs
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-IXUCY7AU.mjs";
|
|
17
|
+
} from "./chunk-2OM5IYSI.mjs";
|
|
16
18
|
import "./chunk-OTXV5FY7.mjs";
|
|
17
|
-
import {
|
|
18
|
-
sanitizeBody
|
|
19
|
-
} from "./chunk-I7CD6EB6.mjs";
|
|
20
19
|
import {
|
|
21
20
|
secretKeyCheck
|
|
22
21
|
} from "./chunk-VZIMT7AO.mjs";
|
|
23
|
-
import
|
|
24
|
-
|
|
22
|
+
import {
|
|
23
|
+
sanitizeBody
|
|
24
|
+
} from "./chunk-I7CD6EB6.mjs";
|
|
25
25
|
import {
|
|
26
26
|
backendError,
|
|
27
27
|
backendSuccess,
|
|
@@ -10012,6 +10012,112 @@ type CreateReferralCodeResponse = {
|
|
|
10012
10012
|
createdAt: number;
|
|
10013
10013
|
};
|
|
10014
10014
|
|
|
10015
|
+
/**
|
|
10016
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10017
|
+
*/
|
|
10018
|
+
declare const RedeemOnRequest: {
|
|
10019
|
+
readonly CustomerCreation: "customer_creation";
|
|
10020
|
+
readonly Checkout: "checkout";
|
|
10021
|
+
};
|
|
10022
|
+
/**
|
|
10023
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10024
|
+
*/
|
|
10025
|
+
type RedeemOnRequest = ClosedEnum<typeof RedeemOnRequest>;
|
|
10026
|
+
/**
|
|
10027
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10028
|
+
*/
|
|
10029
|
+
declare const ReceivedByRequest: {
|
|
10030
|
+
readonly Referrer: "referrer";
|
|
10031
|
+
readonly All: "all";
|
|
10032
|
+
};
|
|
10033
|
+
/**
|
|
10034
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10035
|
+
*/
|
|
10036
|
+
type ReceivedByRequest = ClosedEnum<typeof ReceivedByRequest>;
|
|
10037
|
+
type CreateReferralProgramParams = {
|
|
10038
|
+
id: string;
|
|
10039
|
+
rewardId: string;
|
|
10040
|
+
/**
|
|
10041
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10042
|
+
*/
|
|
10043
|
+
redeemOn: RedeemOnRequest;
|
|
10044
|
+
/**
|
|
10045
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10046
|
+
*/
|
|
10047
|
+
receivedBy: ReceivedByRequest;
|
|
10048
|
+
/**
|
|
10049
|
+
* A positive redemption limit, or null for unlimited redemptions.
|
|
10050
|
+
*/
|
|
10051
|
+
maxRedemptions?: number | null | undefined;
|
|
10052
|
+
/**
|
|
10053
|
+
* Required when redeem_on is checkout. Plan IDs must be unique.
|
|
10054
|
+
*/
|
|
10055
|
+
planIds?: Array<string> | null | undefined;
|
|
10056
|
+
/**
|
|
10057
|
+
* Whether checkouts that start a trial should skip granting the reward.
|
|
10058
|
+
*/
|
|
10059
|
+
excludeTrial?: boolean | null | undefined;
|
|
10060
|
+
};
|
|
10061
|
+
/**
|
|
10062
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10063
|
+
*/
|
|
10064
|
+
declare const RedeemOnResponse: {
|
|
10065
|
+
readonly CustomerCreation: "customer_creation";
|
|
10066
|
+
readonly Checkout: "checkout";
|
|
10067
|
+
};
|
|
10068
|
+
/**
|
|
10069
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10070
|
+
*/
|
|
10071
|
+
type RedeemOnResponse = OpenEnum<typeof RedeemOnResponse>;
|
|
10072
|
+
/**
|
|
10073
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10074
|
+
*/
|
|
10075
|
+
declare const ReceivedByResponse: {
|
|
10076
|
+
readonly Referrer: "referrer";
|
|
10077
|
+
readonly All: "all";
|
|
10078
|
+
};
|
|
10079
|
+
/**
|
|
10080
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10081
|
+
*/
|
|
10082
|
+
type ReceivedByResponse = OpenEnum<typeof ReceivedByResponse>;
|
|
10083
|
+
/**
|
|
10084
|
+
* OK
|
|
10085
|
+
*/
|
|
10086
|
+
type CreateReferralProgramResponse = {
|
|
10087
|
+
/**
|
|
10088
|
+
* The unique identifier for the referral program.
|
|
10089
|
+
*/
|
|
10090
|
+
id: string;
|
|
10091
|
+
/**
|
|
10092
|
+
* The ID of the reward granted when a code is redeemed.
|
|
10093
|
+
*/
|
|
10094
|
+
rewardId: string;
|
|
10095
|
+
/**
|
|
10096
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10097
|
+
*/
|
|
10098
|
+
redeemOn: RedeemOnResponse;
|
|
10099
|
+
/**
|
|
10100
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10101
|
+
*/
|
|
10102
|
+
receivedBy: ReceivedByResponse;
|
|
10103
|
+
/**
|
|
10104
|
+
* The maximum number of times a referral code can be redeemed.
|
|
10105
|
+
*/
|
|
10106
|
+
maxRedemptions?: number | null | undefined;
|
|
10107
|
+
/**
|
|
10108
|
+
* The plans whose checkout triggers the reward. Only used when redeem_on is checkout.
|
|
10109
|
+
*/
|
|
10110
|
+
planIds?: Array<string> | null | undefined;
|
|
10111
|
+
/**
|
|
10112
|
+
* Whether checkouts that start a trial should skip granting the reward.
|
|
10113
|
+
*/
|
|
10114
|
+
excludeTrial?: boolean | null | undefined;
|
|
10115
|
+
/**
|
|
10116
|
+
* The Unix timestamp (in milliseconds) when the referral program was created.
|
|
10117
|
+
*/
|
|
10118
|
+
createdAt: number;
|
|
10119
|
+
};
|
|
10120
|
+
|
|
10015
10121
|
declare const DurationTypeRequestBody: {
|
|
10016
10122
|
readonly OneOff: "one_off";
|
|
10017
10123
|
readonly Months: "months";
|
|
@@ -33182,6 +33288,10 @@ declare class Referrals extends ClientSDK {
|
|
|
33182
33288
|
* Redeem a referral code for a customer.
|
|
33183
33289
|
*/
|
|
33184
33290
|
redeemCode(request: RedeemReferralCodeParams, options?: RequestOptions): Promise<RedeemReferralCodeResponse>;
|
|
33291
|
+
/**
|
|
33292
|
+
* Create a referral program linked to an existing reward.
|
|
33293
|
+
*/
|
|
33294
|
+
createProgram(request: CreateReferralProgramParams, options?: RequestOptions): Promise<CreateReferralProgramResponse>;
|
|
33185
33295
|
}
|
|
33186
33296
|
|
|
33187
33297
|
declare class Rewards extends ClientSDK {
|
|
@@ -10012,6 +10012,112 @@ type CreateReferralCodeResponse = {
|
|
|
10012
10012
|
createdAt: number;
|
|
10013
10013
|
};
|
|
10014
10014
|
|
|
10015
|
+
/**
|
|
10016
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10017
|
+
*/
|
|
10018
|
+
declare const RedeemOnRequest: {
|
|
10019
|
+
readonly CustomerCreation: "customer_creation";
|
|
10020
|
+
readonly Checkout: "checkout";
|
|
10021
|
+
};
|
|
10022
|
+
/**
|
|
10023
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10024
|
+
*/
|
|
10025
|
+
type RedeemOnRequest = ClosedEnum<typeof RedeemOnRequest>;
|
|
10026
|
+
/**
|
|
10027
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10028
|
+
*/
|
|
10029
|
+
declare const ReceivedByRequest: {
|
|
10030
|
+
readonly Referrer: "referrer";
|
|
10031
|
+
readonly All: "all";
|
|
10032
|
+
};
|
|
10033
|
+
/**
|
|
10034
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10035
|
+
*/
|
|
10036
|
+
type ReceivedByRequest = ClosedEnum<typeof ReceivedByRequest>;
|
|
10037
|
+
type CreateReferralProgramParams = {
|
|
10038
|
+
id: string;
|
|
10039
|
+
rewardId: string;
|
|
10040
|
+
/**
|
|
10041
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10042
|
+
*/
|
|
10043
|
+
redeemOn: RedeemOnRequest;
|
|
10044
|
+
/**
|
|
10045
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10046
|
+
*/
|
|
10047
|
+
receivedBy: ReceivedByRequest;
|
|
10048
|
+
/**
|
|
10049
|
+
* A positive redemption limit, or null for unlimited redemptions.
|
|
10050
|
+
*/
|
|
10051
|
+
maxRedemptions?: number | null | undefined;
|
|
10052
|
+
/**
|
|
10053
|
+
* Required when redeem_on is checkout. Plan IDs must be unique.
|
|
10054
|
+
*/
|
|
10055
|
+
planIds?: Array<string> | null | undefined;
|
|
10056
|
+
/**
|
|
10057
|
+
* Whether checkouts that start a trial should skip granting the reward.
|
|
10058
|
+
*/
|
|
10059
|
+
excludeTrial?: boolean | null | undefined;
|
|
10060
|
+
};
|
|
10061
|
+
/**
|
|
10062
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10063
|
+
*/
|
|
10064
|
+
declare const RedeemOnResponse: {
|
|
10065
|
+
readonly CustomerCreation: "customer_creation";
|
|
10066
|
+
readonly Checkout: "checkout";
|
|
10067
|
+
};
|
|
10068
|
+
/**
|
|
10069
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10070
|
+
*/
|
|
10071
|
+
type RedeemOnResponse = OpenEnum<typeof RedeemOnResponse>;
|
|
10072
|
+
/**
|
|
10073
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10074
|
+
*/
|
|
10075
|
+
declare const ReceivedByResponse: {
|
|
10076
|
+
readonly Referrer: "referrer";
|
|
10077
|
+
readonly All: "all";
|
|
10078
|
+
};
|
|
10079
|
+
/**
|
|
10080
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10081
|
+
*/
|
|
10082
|
+
type ReceivedByResponse = OpenEnum<typeof ReceivedByResponse>;
|
|
10083
|
+
/**
|
|
10084
|
+
* OK
|
|
10085
|
+
*/
|
|
10086
|
+
type CreateReferralProgramResponse = {
|
|
10087
|
+
/**
|
|
10088
|
+
* The unique identifier for the referral program.
|
|
10089
|
+
*/
|
|
10090
|
+
id: string;
|
|
10091
|
+
/**
|
|
10092
|
+
* The ID of the reward granted when a code is redeemed.
|
|
10093
|
+
*/
|
|
10094
|
+
rewardId: string;
|
|
10095
|
+
/**
|
|
10096
|
+
* When the reward is granted: on redemption, or when the redeemer checks out.
|
|
10097
|
+
*/
|
|
10098
|
+
redeemOn: RedeemOnResponse;
|
|
10099
|
+
/**
|
|
10100
|
+
* Who receives the reward: the referrer only, or both parties.
|
|
10101
|
+
*/
|
|
10102
|
+
receivedBy: ReceivedByResponse;
|
|
10103
|
+
/**
|
|
10104
|
+
* The maximum number of times a referral code can be redeemed.
|
|
10105
|
+
*/
|
|
10106
|
+
maxRedemptions?: number | null | undefined;
|
|
10107
|
+
/**
|
|
10108
|
+
* The plans whose checkout triggers the reward. Only used when redeem_on is checkout.
|
|
10109
|
+
*/
|
|
10110
|
+
planIds?: Array<string> | null | undefined;
|
|
10111
|
+
/**
|
|
10112
|
+
* Whether checkouts that start a trial should skip granting the reward.
|
|
10113
|
+
*/
|
|
10114
|
+
excludeTrial?: boolean | null | undefined;
|
|
10115
|
+
/**
|
|
10116
|
+
* The Unix timestamp (in milliseconds) when the referral program was created.
|
|
10117
|
+
*/
|
|
10118
|
+
createdAt: number;
|
|
10119
|
+
};
|
|
10120
|
+
|
|
10015
10121
|
declare const DurationTypeRequestBody: {
|
|
10016
10122
|
readonly OneOff: "one_off";
|
|
10017
10123
|
readonly Months: "months";
|
|
@@ -33182,6 +33288,10 @@ declare class Referrals extends ClientSDK {
|
|
|
33182
33288
|
* Redeem a referral code for a customer.
|
|
33183
33289
|
*/
|
|
33184
33290
|
redeemCode(request: RedeemReferralCodeParams, options?: RequestOptions): Promise<RedeemReferralCodeResponse>;
|
|
33291
|
+
/**
|
|
33292
|
+
* Create a referral program linked to an existing reward.
|
|
33293
|
+
*/
|
|
33294
|
+
createProgram(request: CreateReferralProgramParams, options?: RequestOptions): Promise<CreateReferralProgramResponse>;
|
|
33185
33295
|
}
|
|
33186
33296
|
|
|
33187
33297
|
declare class Rewards extends ClientSDK {
|