@better-auth/stripe 1.3.8-beta.6 → 1.3.8-beta.8
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/.turbo/turbo-build.log +4 -4
- package/dist/client.d.cts +23 -1
- package/dist/client.d.mts +23 -1
- package/dist/client.d.ts +23 -1
- package/dist/index.cjs +12 -0
- package/dist/index.d.cts +798 -3
- package/dist/index.d.mts +798 -3
- package/dist/index.d.ts +798 -3
- package/dist/index.mjs +12 -0
- package/package.json +4 -5
- package/src/index.ts +7 -0
- package/src/schema.ts +8 -0
- package/src/stripe.test.ts +113 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/stripe@1.3.8-beta.
|
|
2
|
+
> @better-auth/stripe@1.3.8-beta.8 build /home/runner/work/better-auth/better-auth/packages/stripe
|
|
3
3
|
> unbuild
|
|
4
4
|
|
|
5
5
|
Browserslist: caniuse-lite is outdated. Please run:
|
|
@@ -8,13 +8,13 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
8
8
|
[info] Automatically detected entries: src/index, src/client [esm] [cjs] [dts]
|
|
9
9
|
[info] Building stripe
|
|
10
10
|
[success] Build succeeded for stripe
|
|
11
|
-
[log] dist/index.cjs (total size: 43.
|
|
11
|
+
[log] dist/index.cjs (total size: 43.9 kB, chunk size: 43.9 kB, exports: stripe)
|
|
12
12
|
|
|
13
13
|
[log] dist/client.cjs (total size: 224 B, chunk size: 224 B, exports: stripeClient)
|
|
14
14
|
|
|
15
|
-
[log] dist/index.mjs (total size:
|
|
15
|
+
[log] dist/index.mjs (total size: 43 kB, chunk size: 43 kB, exports: stripe)
|
|
16
16
|
|
|
17
17
|
[log] dist/client.mjs (total size: 197 B, chunk size: 197 B, exports: stripeClient)
|
|
18
18
|
|
|
19
|
-
Σ Total dist size (byte size):
|
|
19
|
+
Σ Total dist size (byte size): 224 kB
|
|
20
20
|
[log]
|
package/dist/client.d.cts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
+
import { stripe } from './index.cjs';
|
|
2
|
+
import 'better-auth';
|
|
3
|
+
import 'better-call';
|
|
4
|
+
import 'stripe';
|
|
5
|
+
import 'zod/v4';
|
|
6
|
+
|
|
1
7
|
declare const stripeClient: <O extends {
|
|
2
8
|
subscription: boolean;
|
|
3
|
-
}>(options?: O) =>
|
|
9
|
+
}>(options?: O) => {
|
|
10
|
+
id: "stripe-client";
|
|
11
|
+
$InferServerPlugin: ReturnType<typeof stripe<O["subscription"] extends true ? {
|
|
12
|
+
stripeClient: any;
|
|
13
|
+
stripeWebhookSecret: string;
|
|
14
|
+
subscription: {
|
|
15
|
+
enabled: true;
|
|
16
|
+
plans: [];
|
|
17
|
+
};
|
|
18
|
+
} : {
|
|
19
|
+
stripeClient: any;
|
|
20
|
+
stripeWebhookSecret: string;
|
|
21
|
+
}>>;
|
|
22
|
+
pathMethods: {
|
|
23
|
+
"/subscription/restore": "POST";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
4
26
|
|
|
5
27
|
export { stripeClient };
|
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
+
import { stripe } from './index.mjs';
|
|
2
|
+
import 'better-auth';
|
|
3
|
+
import 'better-call';
|
|
4
|
+
import 'stripe';
|
|
5
|
+
import 'zod/v4';
|
|
6
|
+
|
|
1
7
|
declare const stripeClient: <O extends {
|
|
2
8
|
subscription: boolean;
|
|
3
|
-
}>(options?: O) =>
|
|
9
|
+
}>(options?: O) => {
|
|
10
|
+
id: "stripe-client";
|
|
11
|
+
$InferServerPlugin: ReturnType<typeof stripe<O["subscription"] extends true ? {
|
|
12
|
+
stripeClient: any;
|
|
13
|
+
stripeWebhookSecret: string;
|
|
14
|
+
subscription: {
|
|
15
|
+
enabled: true;
|
|
16
|
+
plans: [];
|
|
17
|
+
};
|
|
18
|
+
} : {
|
|
19
|
+
stripeClient: any;
|
|
20
|
+
stripeWebhookSecret: string;
|
|
21
|
+
}>>;
|
|
22
|
+
pathMethods: {
|
|
23
|
+
"/subscription/restore": "POST";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
4
26
|
|
|
5
27
|
export { stripeClient };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
+
import { stripe } from './index.js';
|
|
2
|
+
import 'better-auth';
|
|
3
|
+
import 'better-call';
|
|
4
|
+
import 'stripe';
|
|
5
|
+
import 'zod/v4';
|
|
6
|
+
|
|
1
7
|
declare const stripeClient: <O extends {
|
|
2
8
|
subscription: boolean;
|
|
3
|
-
}>(options?: O) =>
|
|
9
|
+
}>(options?: O) => {
|
|
10
|
+
id: "stripe-client";
|
|
11
|
+
$InferServerPlugin: ReturnType<typeof stripe<O["subscription"] extends true ? {
|
|
12
|
+
stripeClient: any;
|
|
13
|
+
stripeWebhookSecret: string;
|
|
14
|
+
subscription: {
|
|
15
|
+
enabled: true;
|
|
16
|
+
plans: [];
|
|
17
|
+
};
|
|
18
|
+
} : {
|
|
19
|
+
stripeClient: any;
|
|
20
|
+
stripeWebhookSecret: string;
|
|
21
|
+
}>>;
|
|
22
|
+
pathMethods: {
|
|
23
|
+
"/subscription/restore": "POST";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
4
26
|
|
|
5
27
|
export { stripeClient };
|
package/dist/index.cjs
CHANGED
|
@@ -272,6 +272,14 @@ const subscriptions = {
|
|
|
272
272
|
type: "date",
|
|
273
273
|
required: false
|
|
274
274
|
},
|
|
275
|
+
trialStart: {
|
|
276
|
+
type: "date",
|
|
277
|
+
required: false
|
|
278
|
+
},
|
|
279
|
+
trialEnd: {
|
|
280
|
+
type: "date",
|
|
281
|
+
required: false
|
|
282
|
+
},
|
|
275
283
|
cancelAtPeriodEnd: {
|
|
276
284
|
type: "boolean",
|
|
277
285
|
required: false,
|
|
@@ -1135,6 +1143,9 @@ const stripe = (options) => {
|
|
|
1135
1143
|
{
|
|
1136
1144
|
method: "POST",
|
|
1137
1145
|
body: z__namespace.object({
|
|
1146
|
+
locale: z__namespace.custom((localization) => {
|
|
1147
|
+
return typeof localization === "string";
|
|
1148
|
+
}).optional(),
|
|
1138
1149
|
referenceId: z__namespace.string().optional(),
|
|
1139
1150
|
returnUrl: z__namespace.string().default("/")
|
|
1140
1151
|
}),
|
|
@@ -1171,6 +1182,7 @@ const stripe = (options) => {
|
|
|
1171
1182
|
}
|
|
1172
1183
|
try {
|
|
1173
1184
|
const { url } = await client.billingPortal.sessions.create({
|
|
1185
|
+
locale: ctx.body.locale,
|
|
1174
1186
|
customer: customerId,
|
|
1175
1187
|
return_url: getUrl(ctx, ctx.body.returnUrl)
|
|
1176
1188
|
});
|