@better-auth/stripe 1.4.6 → 1.4.7-beta.2

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.
@@ -1,16 +1,16 @@
1
1
 
2
- > @better-auth/stripe@1.4.6 build /home/runner/work/better-auth/better-auth/packages/stripe
2
+ > @better-auth/stripe@1.4.7-beta.2 build /home/runner/work/better-auth/better-auth/packages/stripe
3
3
  > tsdown
4
4
 
5
- ℹ tsdown v0.17.0 powered by rolldown v1.0.0-beta.53
5
+ ℹ tsdown v0.17.2 powered by rolldown v1.0.0-beta.53
6
6
  ℹ config file: /home/runner/work/better-auth/better-auth/packages/stripe/tsdown.config.ts
7
7
  ℹ entry: src/index.ts, src/client.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ dist/index.mjs 40.32 kB │ gzip: 7.52 kB
10
+ ℹ dist/index.mjs 40.34 kB │ gzip: 7.53 kB
11
11
  ℹ dist/client.mjs  0.26 kB │ gzip: 0.20 kB
12
12
  ℹ dist/client.d.mts  0.62 kB │ gzip: 0.35 kB
13
13
  ℹ dist/index.d.mts  0.21 kB │ gzip: 0.14 kB
14
14
  ℹ dist/index-B_7z2Xag.d.mts 25.09 kB │ gzip: 4.83 kB
15
- ℹ 5 files, total: 66.51 kB
16
- ✔ Build complete in 11661ms
15
+ ℹ 5 files, total: 66.53 kB
16
+ ✔ Build complete in 12150ms
package/dist/index.mjs CHANGED
@@ -943,7 +943,7 @@ const getSchema = (options) => {
943
943
  };
944
944
  else baseSchema = { ...user };
945
945
  if (options.schema && !options.subscription?.enabled && "subscription" in options.schema) {
946
- const { subscription, ...restSchema } = options.schema;
946
+ const { subscription: _subscription, ...restSchema } = options.schema;
947
947
  return mergeSchema(baseSchema, restSchema);
948
948
  }
949
949
  return mergeSchema(baseSchema, options.schema);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@better-auth/stripe",
3
3
  "author": "Bereket Engida",
4
- "version": "1.4.6",
4
+ "version": "1.4.7-beta.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
7
7
  "types": "dist/index.d.mts",
@@ -50,20 +50,21 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "stripe": "^18 || ^19 || ^20",
53
- "@better-auth/core": "1.4.6",
54
- "better-auth": "1.4.6"
53
+ "@better-auth/core": "1.4.7-beta.2",
54
+ "better-auth": "1.4.7-beta.2"
55
55
  },
56
56
  "devDependencies": {
57
57
  "better-call": "1.1.5",
58
58
  "stripe": "^20.0.0",
59
- "tsdown": "^0.17.0",
60
- "@better-auth/core": "1.4.6",
61
- "better-auth": "1.4.6"
59
+ "tsdown": "^0.17.2",
60
+ "@better-auth/core": "1.4.7-beta.2",
61
+ "better-auth": "1.4.7-beta.2"
62
62
  },
63
63
  "scripts": {
64
64
  "test": "vitest",
65
65
  "coverage": "vitest run --coverage",
66
66
  "lint:package": "publint run --strict",
67
+ "lint:types": "attw --profile esm-only --pack .",
67
68
  "build": "tsdown",
68
69
  "dev": "tsdown --watch",
69
70
  "typecheck": "tsc --project tsconfig.json"
package/src/schema.ts CHANGED
@@ -84,7 +84,7 @@ export const getSchema = (options: StripeOptions) => {
84
84
  !options.subscription?.enabled &&
85
85
  "subscription" in options.schema
86
86
  ) {
87
- const { subscription, ...restSchema } = options.schema;
87
+ const { subscription: _subscription, ...restSchema } = options.schema;
88
88
  return mergeSchema(baseSchema, restSchema);
89
89
  }
90
90
 
@@ -168,18 +168,6 @@ describe("stripe", async () => {
168
168
  vi.clearAllMocks();
169
169
  });
170
170
 
171
- async function getHeader() {
172
- const headers = new Headers();
173
- const userRes = await authClient.signIn.email(testUser, {
174
- throw: true,
175
- onSuccess: setCookieToHeader(headers),
176
- });
177
- return {
178
- headers,
179
- response: userRes,
180
- };
181
- }
182
-
183
171
  it("should create a customer on sign up", async () => {
184
172
  const userRes = await authClient.signUp.email(testUser, {
185
173
  throw: true,
@@ -642,15 +630,6 @@ describe("stripe", async () => {
642
630
  stripeWebhookSecret: "test_secret",
643
631
  } as unknown as StripeOptions;
644
632
 
645
- const testAuth = betterAuth({
646
- baseURL: "http://localhost:3000",
647
- database: memory,
648
- emailAndPassword: {
649
- enabled: true,
650
- },
651
- plugins: [stripe(testOptions)],
652
- });
653
-
654
633
  // Test subscription complete handler
655
634
  const completeEvent = {
656
635
  type: "checkout.session.completed",
@@ -1097,7 +1076,7 @@ describe("stripe", async () => {
1097
1076
  });
1098
1077
 
1099
1078
  it("should only call Stripe customers.create once for signup and upgrade", async () => {
1100
- const userRes = await authClient.signUp.email(
1079
+ await authClient.signUp.email(
1101
1080
  { ...testUser, email: "single-create@email.com" },
1102
1081
  { throw: true },
1103
1082
  );
@@ -2107,7 +2086,7 @@ describe("stripe", async () => {
2107
2086
  plugins: [stripe(testOptions)],
2108
2087
  });
2109
2088
 
2110
- const { id: subId } = await ctx.adapter.create({
2089
+ await ctx.adapter.create({
2111
2090
  model: "subscription",
2112
2091
  data: {
2113
2092
  referenceId: userId,
@@ -2249,7 +2228,7 @@ describe("stripe", async () => {
2249
2228
  plugins: [stripe(testOptions)],
2250
2229
  });
2251
2230
 
2252
- const { id: subId } = await ctx.adapter.create({
2231
+ await ctx.adapter.create({
2253
2232
  model: "subscription",
2254
2233
  data: {
2255
2234
  referenceId: userId,