fix types
This commit is contained in:
parent
d87ad8f1af
commit
e5b7ff5d63
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@bowong/better-auth-stripe",
|
"name": "@bowong/better-auth-stripe",
|
||||||
"author": "Bowong",
|
"author": "Bowong",
|
||||||
"version": "1.4.1",
|
"version": "1.4.0-beta.10",
|
||||||
"main": "dist/index.cjs",
|
"main": "dist/index.cjs",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { BetterAuthClientPlugin } from "better-auth";
|
import {type BetterAuthClientPlugin} from "better-auth";
|
||||||
import type { stripe } from "./index";
|
import type {stripe} from "./index";
|
||||||
|
|
||||||
export const stripeClient = <
|
export const stripeClient = <
|
||||||
O extends {
|
O extends {
|
||||||
|
|
@ -7,7 +7,7 @@ export const stripeClient = <
|
||||||
},
|
},
|
||||||
>(
|
>(
|
||||||
options?: O,
|
options?: O,
|
||||||
) => {
|
): BetterAuthClientPlugin => {
|
||||||
return {
|
return {
|
||||||
id: "stripe-client",
|
id: "stripe-client",
|
||||||
$InferServerPlugin: {} as ReturnType<
|
$InferServerPlugin: {} as ReturnType<
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {
|
import {
|
||||||
type GenericEndpointContext,
|
type GenericEndpointContext,
|
||||||
type BetterAuthPlugin,
|
type BetterAuthPlugin,
|
||||||
logger,
|
logger, type BetterAuthClientPlugin,
|
||||||
} from "better-auth";
|
} from "better-auth";
|
||||||
import {createAuthEndpoint, createAuthMiddleware} from "better-auth/plugins";
|
import {createAuthEndpoint, createAuthMiddleware} from "better-auth/plugins";
|
||||||
import Stripe from "stripe";
|
import Stripe from "stripe";
|
||||||
|
|
@ -64,7 +64,7 @@ async function resolvePriceIdFromLookupKey(
|
||||||
return prices.data[0]?.id;
|
return prices.data[0]?.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const stripe = <O extends StripeOptions>(options: O) => {
|
export const stripe = <O extends StripeOptions>(options: O) : BetterAuthPlugin => {
|
||||||
const client = options.stripeClient;
|
const client = options.stripeClient;
|
||||||
|
|
||||||
const referenceMiddleware = (
|
const referenceMiddleware = (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue