mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 12:27:43 +00:00
wip
This commit is contained in:
@@ -18,6 +18,7 @@ import { MysqlDialect } from "kysely";
|
||||
import { createPool } from "mysql2/promise";
|
||||
import { nextCookies } from "better-auth/next-js";
|
||||
import { customSession } from "./auth/plugins/custom-session";
|
||||
import { openAPI } from "@better-auth/open-api";
|
||||
|
||||
const from = process.env.BETTER_AUTH_EMAIL || "delivered@resend.dev";
|
||||
const to = process.env.TEST_EMAIL || "";
|
||||
@@ -148,6 +149,7 @@ export const auth = betterAuth({
|
||||
},
|
||||
}),
|
||||
passkey(),
|
||||
openAPI(),
|
||||
bearer(),
|
||||
admin(),
|
||||
multiSession(),
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@better-auth/open-api": "workspace:1.0.0-canary.12",
|
||||
"@better-fetch/fetch": "1.1.12",
|
||||
"@hookform/resolvers": "^3.9.0",
|
||||
"@libsql/client": "^0.12.0",
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
"@noble/hashes": "^1.5.0",
|
||||
"@simplewebauthn/browser": "^10.0.0",
|
||||
"@simplewebauthn/server": "^10.0.1",
|
||||
"better-call": "0.2.15-beta.7",
|
||||
"better-call": "0.3.1",
|
||||
"consola": "^3.2.3",
|
||||
"defu": "^6.1.4",
|
||||
"jose": "^5.9.4",
|
||||
|
||||
419
packages/better-auth/script/open-api.json
Normal file
419
packages/better-auth/script/open-api.json
Normal file
@@ -0,0 +1,419 @@
|
||||
{
|
||||
"/get-session": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Session"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/verify-email": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "token",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "callbackURL",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/reset-password/:token": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "callbackURL",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/list-sessions": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/list-accounts": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oauth-proxy-callback": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "callbackURL",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "cookies",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/ok": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/error": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
import type { EndpointOptions } from "better-call";
|
||||
import { betterAuth } from "../src";
|
||||
import { ZodObject, ZodString } from "zod";
|
||||
|
||||
export const auth = betterAuth({});
|
||||
|
||||
type SchemaType = "string" | "number" | "boolean" | "object" | "array";
|
||||
import { ZodObject, ZodSchema, ZodString } from "zod";
|
||||
import type { OpenAPISchemaType, OpenAPIParameter } from "better-call";
|
||||
import fs from "fs/promises";
|
||||
import { oAuthProxy } from "../src/plugins";
|
||||
export const auth = betterAuth({
|
||||
plugins: [oAuthProxy()],
|
||||
});
|
||||
|
||||
const components = {
|
||||
schemas: {
|
||||
@@ -35,27 +37,15 @@ interface Path {
|
||||
get?: {
|
||||
tags?: string[];
|
||||
operationId?: string;
|
||||
security?: {
|
||||
bearerAuth: string[];
|
||||
};
|
||||
parameters?: {
|
||||
schema?: {
|
||||
type: SchemaType;
|
||||
minLength: number;
|
||||
description?: string;
|
||||
example?: string;
|
||||
};
|
||||
required?: boolean;
|
||||
name: string;
|
||||
in: string;
|
||||
}[];
|
||||
security?: [{ bearerAuth: string[] }];
|
||||
parameters?: OpenAPIParameter[];
|
||||
responses?: {
|
||||
[key in 200 | 400 | 401 | 403 | 500]: {
|
||||
[key in string]: {
|
||||
description?: string;
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type?: SchemaType;
|
||||
type?: OpenAPISchemaType;
|
||||
properties?: Record<string, any>;
|
||||
required?: string[];
|
||||
$ref?: string;
|
||||
@@ -68,15 +58,124 @@ interface Path {
|
||||
}
|
||||
const paths: Record<string, Path> = {};
|
||||
|
||||
function getTypeFromZodType(zodType: ZodSchema) {
|
||||
switch (zodType.constructor.name) {
|
||||
case "ZodString":
|
||||
return "string";
|
||||
case "ZodNumber":
|
||||
return "number";
|
||||
case "ZodBoolean":
|
||||
return "boolean";
|
||||
case "ZodObject":
|
||||
return "object";
|
||||
case "ZodArray":
|
||||
return "array";
|
||||
default:
|
||||
return "string";
|
||||
}
|
||||
}
|
||||
|
||||
function getParameters(options: EndpointOptions) {
|
||||
const parameters: OpenAPIParameter[] = [];
|
||||
if (options.metadata?.openapi?.parameters) {
|
||||
parameters.push(...options.metadata.openapi.parameters);
|
||||
return parameters;
|
||||
}
|
||||
if (options.query instanceof ZodObject) {
|
||||
Object.entries(options.query.shape).forEach(([key, value]) => {
|
||||
if (value instanceof ZodSchema) {
|
||||
parameters.push({
|
||||
name: key,
|
||||
in: "query",
|
||||
schema: {
|
||||
type: getTypeFromZodType(value),
|
||||
...("minLength" in value && value.minLength
|
||||
? {
|
||||
minLength: value.minLength as number,
|
||||
}
|
||||
: {}),
|
||||
description: value.description,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
|
||||
Object.entries(auth.api).forEach(([key, value]) => {
|
||||
const options = value.options as EndpointOptions;
|
||||
if (options.method === "GET") {
|
||||
if (options.query instanceof ZodObject) {
|
||||
Object.entries(options.query.shape).forEach(([key, value]) => {
|
||||
if (value instanceof ZodString) {
|
||||
console.log(value);
|
||||
paths[value.path] = {
|
||||
get: {
|
||||
tags: options.metadata?.openapi?.tags,
|
||||
operationId: options.metadata?.openapi?.operationId,
|
||||
security: [
|
||||
{
|
||||
bearerAuth: [],
|
||||
},
|
||||
],
|
||||
parameters: getParameters(options),
|
||||
responses: options.metadata?.openapi?.responses || {
|
||||
"200": {
|
||||
description: "Success",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
message: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["message"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"400": {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
message: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["message"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const pkgJSON = await fs.readFile("./package.json", {
|
||||
encoding: "utf-8",
|
||||
});
|
||||
|
||||
const version = JSON.parse(pkgJSON).version;
|
||||
|
||||
fs.writeFile(
|
||||
"./script/open-api.json",
|
||||
JSON.stringify(
|
||||
{
|
||||
openapi: "3.1.1",
|
||||
info: {
|
||||
title: "Better Auth Api",
|
||||
version,
|
||||
},
|
||||
paths,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
@@ -30,6 +30,11 @@ export const getSession = <Option extends BetterAuthOptions>() =>
|
||||
}),
|
||||
),
|
||||
requireHeaders: true,
|
||||
metadata: {
|
||||
openapi: {
|
||||
tags: ["Session"],
|
||||
},
|
||||
},
|
||||
},
|
||||
async (ctx) => {
|
||||
try {
|
||||
|
||||
28
packages/open-api/package.json
Normal file
28
packages/open-api/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@better-auth/open-api",
|
||||
"version": "1.0.0-canary.12",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"scripts": {
|
||||
"test": "vitest",
|
||||
"build": "tsup --dts --minify --clean",
|
||||
"dev": "tsup --watch --sourcemap --dts"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"better-auth": "workspace:*"
|
||||
},
|
||||
"dependencies": {
|
||||
"better-call": "^0.3.0"
|
||||
}
|
||||
}
|
||||
227
packages/open-api/src/generator.ts
Normal file
227
packages/open-api/src/generator.ts
Normal file
@@ -0,0 +1,227 @@
|
||||
import type { Endpoint, EndpointOptions } from "better-call";
|
||||
import { ZodObject, ZodSchema } from "zod";
|
||||
import type { OpenAPISchemaType, OpenAPIParameter } from "better-call";
|
||||
import type { AuthContext, BetterAuthOptions } from "better-auth";
|
||||
import { getEndpoints } from "better-auth/api";
|
||||
|
||||
interface Path {
|
||||
get?: {
|
||||
tags?: string[];
|
||||
operationId?: string;
|
||||
security?: [{ bearerAuth: string[] }];
|
||||
parameters?: OpenAPIParameter[];
|
||||
responses?: {
|
||||
[key in string]: {
|
||||
description?: string;
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type?: OpenAPISchemaType;
|
||||
properties?: Record<string, any>;
|
||||
required?: string[];
|
||||
$ref?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
const paths: Record<string, Path> = {};
|
||||
|
||||
function getTypeFromZodType(zodType: ZodSchema) {
|
||||
switch (zodType.constructor.name) {
|
||||
case "ZodString":
|
||||
return "string";
|
||||
case "ZodNumber":
|
||||
return "number";
|
||||
case "ZodBoolean":
|
||||
return "boolean";
|
||||
case "ZodObject":
|
||||
return "object";
|
||||
case "ZodArray":
|
||||
return "array";
|
||||
default:
|
||||
return "string";
|
||||
}
|
||||
}
|
||||
|
||||
function getParameters(options: EndpointOptions) {
|
||||
const parameters: OpenAPIParameter[] = [];
|
||||
if (options.metadata?.openapi?.parameters) {
|
||||
parameters.push(...options.metadata.openapi.parameters);
|
||||
return parameters;
|
||||
}
|
||||
if (options.query instanceof ZodObject) {
|
||||
Object.entries(options.query.shape).forEach(([key, value]) => {
|
||||
if (value instanceof ZodSchema) {
|
||||
parameters.push({
|
||||
name: key,
|
||||
in: "query",
|
||||
schema: {
|
||||
type: getTypeFromZodType(value),
|
||||
...("minLength" in value && value.minLength
|
||||
? {
|
||||
minLength: value.minLength as number,
|
||||
}
|
||||
: {}),
|
||||
description: value.description,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
|
||||
export async function generator(ctx: AuthContext, options: BetterAuthOptions) {
|
||||
const baseEndpoints = getEndpoints(ctx, {
|
||||
...options,
|
||||
plugins: [],
|
||||
});
|
||||
|
||||
Object.entries(baseEndpoints.api).forEach(([_, value]) => {
|
||||
const options = value.options as EndpointOptions;
|
||||
if (options.method === "GET") {
|
||||
paths[value.path] = {
|
||||
get: {
|
||||
tags: ["core", ...(options.metadata?.openapi?.tags || [])],
|
||||
operationId: options.metadata?.openapi?.operationId,
|
||||
security: [
|
||||
{
|
||||
bearerAuth: [],
|
||||
},
|
||||
],
|
||||
parameters: getParameters(options),
|
||||
responses: options.metadata?.openapi?.responses || {
|
||||
"200": {
|
||||
description: "Success",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
message: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["message"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"400": {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
message: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["message"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
for (const plugin of options.plugins || []) {
|
||||
const pluginEndpoints = getEndpoints(ctx, {
|
||||
...options,
|
||||
plugins: [plugin],
|
||||
});
|
||||
const api = Object.keys(pluginEndpoints.api)
|
||||
.map((key) => {
|
||||
if (
|
||||
baseEndpoints.api[key as keyof typeof baseEndpoints.api] === undefined
|
||||
) {
|
||||
return pluginEndpoints.api[key as keyof typeof pluginEndpoints.api];
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.filter((x) => x !== null) as Endpoint[];
|
||||
Object.entries(api).forEach(([key, value]) => {
|
||||
const options = value.options as EndpointOptions;
|
||||
if (options.method === "GET") {
|
||||
paths[value.path] = {
|
||||
get: {
|
||||
tags: options.metadata?.openapi?.tags || [plugin.id],
|
||||
operationId: options.metadata?.openapi?.operationId,
|
||||
security: [
|
||||
{
|
||||
bearerAuth: [],
|
||||
},
|
||||
],
|
||||
parameters: getParameters(options),
|
||||
responses: options.metadata?.openapi?.responses || {
|
||||
"200": {
|
||||
description: "Success",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
message: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["message"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"400": {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
message: {
|
||||
type: "string",
|
||||
},
|
||||
},
|
||||
required: ["message"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const res = {
|
||||
openapi: "3.1.1",
|
||||
info: {
|
||||
title: "Better Auth Api",
|
||||
description: "API Reference for your Better Auth Instance",
|
||||
},
|
||||
security: [
|
||||
{
|
||||
apiKeyCookie: [],
|
||||
},
|
||||
],
|
||||
servers: [
|
||||
{
|
||||
url: ctx.baseURL,
|
||||
},
|
||||
],
|
||||
tags: [
|
||||
{
|
||||
name: "Authentication",
|
||||
description:
|
||||
"Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.",
|
||||
},
|
||||
],
|
||||
paths,
|
||||
};
|
||||
return res;
|
||||
}
|
||||
45
packages/open-api/src/index.ts
Normal file
45
packages/open-api/src/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { BetterAuthPlugin } from "better-auth";
|
||||
import { createAuthEndpoint } from "better-auth/plugins";
|
||||
import { getEndpoints } from "better-auth/api";
|
||||
import { generator } from "./generator";
|
||||
|
||||
const getHTML = (apiReference: Record<string, any>) => `<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Scalar API Reference</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
<script
|
||||
id="api-reference"
|
||||
type="application/json">
|
||||
${JSON.stringify(apiReference)}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
export const openAPI = () => {
|
||||
return {
|
||||
id: "open-api",
|
||||
endpoints: {
|
||||
openAPI: createAuthEndpoint(
|
||||
"/api-reference",
|
||||
{
|
||||
method: "GET",
|
||||
},
|
||||
async (ctx) => {
|
||||
const schema = await generator(ctx.context, ctx.context.options);
|
||||
return new Response(getHTML(schema), {
|
||||
headers: {
|
||||
"Content-Type": "text/html",
|
||||
},
|
||||
});
|
||||
},
|
||||
),
|
||||
},
|
||||
} satisfies BetterAuthPlugin;
|
||||
};
|
||||
20
packages/open-api/tsconfig.json
Normal file
20
packages/open-api/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "es2022",
|
||||
"allowJs": true,
|
||||
"resolveJsonModule": true,
|
||||
"module": "ESNext",
|
||||
"noEmit": true,
|
||||
"moduleResolution": "Bundler",
|
||||
"moduleDetection": "force",
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"exclude": ["node_modules"],
|
||||
"include": ["src"]
|
||||
}
|
||||
11
packages/open-api/tsup.config.ts
Normal file
11
packages/open-api/tsup.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { defineConfig } from "tsup";
|
||||
|
||||
export default defineConfig((env) => {
|
||||
return {
|
||||
entry: ["src/index.ts"],
|
||||
format: ["esm", "cjs"],
|
||||
bundle: true,
|
||||
skipNodeModulesBundle: true,
|
||||
external: ["better-call", "better-auth"],
|
||||
};
|
||||
});
|
||||
273
pnpm-lock.yaml
generated
273
pnpm-lock.yaml
generated
@@ -44,6 +44,9 @@ importers:
|
||||
|
||||
demo/nextjs:
|
||||
dependencies:
|
||||
'@better-auth/open-api':
|
||||
specifier: workspace:1.0.0-canary.12
|
||||
version: link:../../packages/open-api
|
||||
'@better-fetch/fetch':
|
||||
specifier: 1.1.12
|
||||
version: 1.1.12
|
||||
@@ -423,7 +426,7 @@ importers:
|
||||
version: 1.1.3(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@scalar/nextjs-api-reference':
|
||||
specifier: ^0.4.100
|
||||
version: 0.4.100(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
||||
version: 0.4.101(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)
|
||||
'@tabler/icons-react':
|
||||
specifier: ^3.12.0
|
||||
version: 3.21.0(react@18.3.1)
|
||||
@@ -487,7 +490,6 @@ importers:
|
||||
fumadocs-twoslash:
|
||||
specifier: ^1.1.2
|
||||
version: 1.1.3(fumadocs-ui@14.0.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(shiki@1.23.1)(typescript@5.6.3)
|
||||
version: 1.1.3(fumadocs-ui@14.0.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(shiki@1.23.1)(typescript@5.6.3)
|
||||
fumadocs-typescript:
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2(typescript@5.6.3)
|
||||
@@ -1348,8 +1350,8 @@ importers:
|
||||
specifier: ^10.0.1
|
||||
version: 10.0.1(encoding@0.1.13)
|
||||
better-call:
|
||||
specifier: 0.2.15-beta.7
|
||||
version: 0.2.15-beta.7
|
||||
specifier: 0.3.1
|
||||
version: 0.3.1
|
||||
consola:
|
||||
specifier: ^3.2.3
|
||||
version: 3.2.3
|
||||
@@ -1558,6 +1560,16 @@ importers:
|
||||
specifier: ^1.6.0
|
||||
version: 1.6.0(@types/node@22.8.6)(happy-dom@15.8.0)(lightningcss@1.27.0)(terser@5.36.0)
|
||||
|
||||
packages/open-api:
|
||||
dependencies:
|
||||
better-call:
|
||||
specifier: ^0.3.0
|
||||
version: 0.3.0
|
||||
devDependencies:
|
||||
better-auth:
|
||||
specifier: workspace:*
|
||||
version: link:../better-auth
|
||||
|
||||
packages:
|
||||
|
||||
'@algolia/cache-browser-local-storage@4.24.0':
|
||||
@@ -1620,10 +1632,6 @@ packages:
|
||||
resolution: {integrity: sha512-4gY54eEGEstClvEkGnwVkTkrx0sqwemEFG5OSRRn3tD91XH0+Q8XIkYIfo7IwEWPpJZwILb9GUXeShtplRc/eA==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@apidevtools/json-schema-ref-parser@11.7.2':
|
||||
resolution: {integrity: sha512-4gY54eEGEstClvEkGnwVkTkrx0sqwemEFG5OSRRn3tD91XH0+Q8XIkYIfo7IwEWPpJZwILb9GUXeShtplRc/eA==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@ark-ui/solid@3.13.0':
|
||||
resolution: {integrity: sha512-1zCkFKHKkVidZTSoiYOPGDlUgusQprMmNn6ZyxISwtb7tUkYu1gISjOY6NN32fpGEfNKlOM3XZ/Cr2ASJUTA3w==}
|
||||
peerDependencies:
|
||||
@@ -3552,9 +3560,6 @@ packages:
|
||||
'@formatjs/intl-localematcher@0.5.8':
|
||||
resolution: {integrity: sha512-I+WDNWWJFZie+jkfkiK5Mp4hEDyRSEvmyfYadflOno/mmKJKcB17fEpEH0oJu/OWhhCJ8kJBDz2YMd/6cDl7Mg==}
|
||||
|
||||
'@formatjs/intl-localematcher@0.5.8':
|
||||
resolution: {integrity: sha512-I+WDNWWJFZie+jkfkiK5Mp4hEDyRSEvmyfYadflOno/mmKJKcB17fEpEH0oJu/OWhhCJ8kJBDz2YMd/6cDl7Mg==}
|
||||
|
||||
'@fortawesome/fontawesome-free@6.6.0':
|
||||
resolution: {integrity: sha512-60G28ke/sXdtS9KZCpZSHHkCbdsOGEhIUGlwq6yhY74UpTiToIh8np7A8yphhM4BWsvNFtIvLpi4co+h9Mr9Ow==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -3563,10 +3568,6 @@ packages:
|
||||
resolution: {integrity: sha512-vVnuwLqW8WJsg09EanNHnXnzsjYYsZE7JlD4M1sLvDnWGjvYJKNU6VpRqDxOiDChUszDZFKhxQSNYGShF0bKJg==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
|
||||
'@fumari/json-schema-to-typescript@1.1.1':
|
||||
resolution: {integrity: sha512-vVnuwLqW8WJsg09EanNHnXnzsjYYsZE7JlD4M1sLvDnWGjvYJKNU6VpRqDxOiDChUszDZFKhxQSNYGShF0bKJg==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
|
||||
'@gcornut/valibot-json-schema@0.31.0':
|
||||
resolution: {integrity: sha512-3xGptCurm23e7nuPQkdrE5rEs1FeTPHhAUsBuwwqG4/YeZLwJOoYZv+fmsppUEfo5y9lzUwNQrNqLS/q7HMc7g==}
|
||||
hasBin: true
|
||||
@@ -3791,9 +3792,6 @@ packages:
|
||||
'@jsdevtools/ono@7.1.3':
|
||||
resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==}
|
||||
|
||||
'@jsdevtools/ono@7.1.3':
|
||||
resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==}
|
||||
|
||||
'@jspm/core@2.1.0':
|
||||
resolution: {integrity: sha512-3sRl+pkyFY/kLmHl0cgHiFp2xEqErA8N3ECjMs7serSUBmoJ70lBa0PG5t0IM6WJgdZNyyI0R8YFfi5wM8+mzg==}
|
||||
|
||||
@@ -6256,6 +6254,21 @@ packages:
|
||||
'@rushstack/ts-command-line@4.23.0':
|
||||
resolution: {integrity: sha512-jYREBtsxduPV6ptNq8jOKp9+yx0ld1Tb/Tkdnlj8gTjazl1sF3DwX2VbluyYrNd0meWIL0bNeer7WDf5tKFjaQ==}
|
||||
|
||||
'@scalar/nextjs-api-reference@0.4.101':
|
||||
resolution: {integrity: sha512-iN27nBF1z/JQz1hGDbF60H4ZfcakESusWWQAF8f3YORR43gx20LqpAlsIdMS5IhL++S0Akckajrx+VoWkzkqzw==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
next: ^14.0.0
|
||||
react: ^18.0.0
|
||||
|
||||
'@scalar/openapi-types@0.1.5':
|
||||
resolution: {integrity: sha512-6geH9ehvQ/sG/xUyy3e0lyOw3BaY5s6nn22wHjEJhcobdmWyFER0O6m7AU0ZN4QTjle/gYvFJOjj552l/rsNSw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@scalar/types@0.0.20':
|
||||
resolution: {integrity: sha512-Sx7tqiuV9ZNp2XpIXKD/srzTjjb4I6aof0Y7+U5MgEuKPwrRnYS/BaocdNgWLnpCZisBIg5qp4YSqozxibabVg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
'@sec-ant/readable-stream@0.4.1':
|
||||
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
|
||||
|
||||
@@ -6271,27 +6284,18 @@ packages:
|
||||
'@shikijs/core@1.23.1':
|
||||
resolution: {integrity: sha512-NuOVgwcHgVC6jBVH5V7iblziw6iQbWWHrj5IlZI3Fqu2yx9awH7OIQkXIcsHsUmY19ckwSgUMgrqExEyP5A0TA==}
|
||||
|
||||
'@shikijs/core@1.23.1':
|
||||
resolution: {integrity: sha512-NuOVgwcHgVC6jBVH5V7iblziw6iQbWWHrj5IlZI3Fqu2yx9awH7OIQkXIcsHsUmY19ckwSgUMgrqExEyP5A0TA==}
|
||||
|
||||
'@shikijs/engine-javascript@1.22.2':
|
||||
resolution: {integrity: sha512-iOvql09ql6m+3d1vtvP8fLCVCK7BQD1pJFmHIECsujB0V32BJ0Ab6hxk1ewVSMFA58FI0pR2Had9BKZdyQrxTw==}
|
||||
|
||||
'@shikijs/engine-javascript@1.23.1':
|
||||
resolution: {integrity: sha512-i/LdEwT5k3FVu07SiApRFwRcSJs5QM9+tod5vYCPig1Ywi8GR30zcujbxGQFJHwYD7A5BUqagi8o5KS+LEVgBg==}
|
||||
|
||||
'@shikijs/engine-javascript@1.23.1':
|
||||
resolution: {integrity: sha512-i/LdEwT5k3FVu07SiApRFwRcSJs5QM9+tod5vYCPig1Ywi8GR30zcujbxGQFJHwYD7A5BUqagi8o5KS+LEVgBg==}
|
||||
|
||||
'@shikijs/engine-oniguruma@1.22.2':
|
||||
resolution: {integrity: sha512-GIZPAGzQOy56mGvWMoZRPggn0dTlBf1gutV5TdceLCZlFNqWmuc7u+CzD0Gd9vQUTgLbrt0KLzz6FNprqYAxlA==}
|
||||
|
||||
'@shikijs/engine-oniguruma@1.23.1':
|
||||
resolution: {integrity: sha512-KQ+lgeJJ5m2ISbUZudLR1qHeH3MnSs2mjFg7bnencgs5jDVPeJ2NVDJ3N5ZHbcTsOIh0qIueyAJnwg7lg7kwXQ==}
|
||||
|
||||
'@shikijs/engine-oniguruma@1.23.1':
|
||||
resolution: {integrity: sha512-KQ+lgeJJ5m2ISbUZudLR1qHeH3MnSs2mjFg7bnencgs5jDVPeJ2NVDJ3N5ZHbcTsOIh0qIueyAJnwg7lg7kwXQ==}
|
||||
|
||||
'@shikijs/rehype@1.22.2':
|
||||
resolution: {integrity: sha512-A0RHgiYR5uiHvddwHehBN9j8PhOvfT6/GebSTWrapur6M+fD/4i3mlfUv7aFK4b+4GQ1R42L8fC5N98whZjNcg==}
|
||||
|
||||
@@ -6310,9 +6314,6 @@ packages:
|
||||
'@shikijs/types@1.23.1':
|
||||
resolution: {integrity: sha512-98A5hGyEhzzAgQh2dAeHKrWW4HfCMeoFER2z16p5eJ+vmPeF6lZ/elEne6/UCU551F/WqkopqRsr1l2Yu6+A0g==}
|
||||
|
||||
'@shikijs/types@1.23.1':
|
||||
resolution: {integrity: sha512-98A5hGyEhzzAgQh2dAeHKrWW4HfCMeoFER2z16p5eJ+vmPeF6lZ/elEne6/UCU551F/WqkopqRsr1l2Yu6+A0g==}
|
||||
|
||||
'@shikijs/vscode-textmate@9.3.0':
|
||||
resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==}
|
||||
|
||||
@@ -8105,12 +8106,15 @@ packages:
|
||||
better-call@0.2.14-beta.3:
|
||||
resolution: {integrity: sha512-lA54ETanzM0xUZnQt6lm3BdTr4gVDyAe1DNpCQSTYUnwnGGOmQG8ob0FYivVd0XHsHQK68r01GB5c6cUuu4llQ==}
|
||||
|
||||
better-call@0.2.15-beta.7:
|
||||
resolution: {integrity: sha512-x+sZZPJrGyxtUQSYxrdrIeC175CY8mO68e4+OSHkYGv2WNBxSJQQtDmUStqY/VmFIBspnMbEIwJ2NIbkPaSN2w==}
|
||||
|
||||
better-call@0.2.3-beta.2:
|
||||
resolution: {integrity: sha512-ybOtGcR4pOsHI2XE+urR9zcmK+s0YnhJSx8KDj6ul7MUEyYOiMEnq/bylyH62/7qXuYb9q8Oqkp9NF9vWOZ4Mg==}
|
||||
|
||||
better-call@0.3.0:
|
||||
resolution: {integrity: sha512-nBWeQl+O1NCPMkb958VQzVn0AfSWwILGoLCpLbTzz3p0QnsqFYSTe6z8Uzo4p/6Iah8zrRBoLBQvFLUFl80jxA==}
|
||||
|
||||
better-call@0.3.1:
|
||||
resolution: {integrity: sha512-uJoTAVLHCIrRebBxu2rQ/CPpf7r1c7FrfFIL2OS5dVx1z/64nGMZ5sH2GUtYu22XRjbOGEn7KI9eNkLpIo41CQ==}
|
||||
|
||||
better-opn@3.0.2:
|
||||
resolution: {integrity: sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
@@ -9674,9 +9678,6 @@ packages:
|
||||
emoji-regex-xs@1.0.0:
|
||||
resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==}
|
||||
|
||||
emoji-regex-xs@1.0.0:
|
||||
resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==}
|
||||
|
||||
emoji-regex@10.4.0:
|
||||
resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==}
|
||||
|
||||
@@ -10421,9 +10422,6 @@ packages:
|
||||
foreach@2.0.6:
|
||||
resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==}
|
||||
|
||||
foreach@2.0.6:
|
||||
resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==}
|
||||
|
||||
foreground-child@3.3.0:
|
||||
resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -10764,11 +10762,6 @@ packages:
|
||||
resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
|
||||
hasBin: true
|
||||
|
||||
glob@11.0.0:
|
||||
resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==}
|
||||
engines: {node: 20 || >=22}
|
||||
hasBin: true
|
||||
|
||||
glob@7.1.6:
|
||||
resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==}
|
||||
deprecated: Glob versions prior to v9 are no longer supported
|
||||
@@ -11625,10 +11618,6 @@ packages:
|
||||
jackspeak@3.4.3:
|
||||
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
|
||||
|
||||
jackspeak@4.0.2:
|
||||
resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
javascript-stringify@2.1.0:
|
||||
resolution: {integrity: sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==}
|
||||
|
||||
@@ -11763,9 +11752,6 @@ packages:
|
||||
json-pointer@0.6.2:
|
||||
resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==}
|
||||
|
||||
json-pointer@0.6.2:
|
||||
resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==}
|
||||
|
||||
json-schema-deref-sync@0.13.0:
|
||||
resolution: {integrity: sha512-YBOEogm5w9Op337yb6pAT6ZXDqlxAsQCanM3grid8lMWNxRJO/zWEJi3ZzqDL8boWfwhTFym5EFrNgWwpqcBRg==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
@@ -12177,10 +12163,6 @@ packages:
|
||||
lru-cache@10.4.3:
|
||||
resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
|
||||
|
||||
lru-cache@11.0.2:
|
||||
resolution: {integrity: sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
lru-cache@4.1.5:
|
||||
resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
|
||||
|
||||
@@ -12752,10 +12734,6 @@ packages:
|
||||
resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==}
|
||||
hasBin: true
|
||||
|
||||
minimatch@10.0.1:
|
||||
resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
minimatch@3.0.8:
|
||||
resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==}
|
||||
|
||||
@@ -13000,12 +12978,6 @@ packages:
|
||||
react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||
|
||||
next-themes@0.4.3:
|
||||
resolution: {integrity: sha512-nG84VPkTdUHR2YeD89YchvV4I9RbiMAql3GiLEQlPvq1ioaqPaIReK+yMRdg/zgiXws620qS1rU30TiWmmG9lA==}
|
||||
peerDependencies:
|
||||
react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||
react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
|
||||
|
||||
next-tick@1.1.0:
|
||||
resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
|
||||
|
||||
@@ -13371,9 +13343,6 @@ packages:
|
||||
oniguruma-to-es@0.4.1:
|
||||
resolution: {integrity: sha512-rNcEohFz095QKGRovP/yqPIKc+nP+Sjs4YTHMv33nMePGKrq/r2eu9Yh4646M5XluGJsUnmwoXuiXE69KDs+fQ==}
|
||||
|
||||
oniguruma-to-es@0.4.1:
|
||||
resolution: {integrity: sha512-rNcEohFz095QKGRovP/yqPIKc+nP+Sjs4YTHMv33nMePGKrq/r2eu9Yh4646M5XluGJsUnmwoXuiXE69KDs+fQ==}
|
||||
|
||||
oniguruma-to-js@0.4.3:
|
||||
resolution: {integrity: sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==}
|
||||
|
||||
@@ -13630,10 +13599,6 @@ packages:
|
||||
resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}
|
||||
engines: {node: '>=16 || 14 >=14.18'}
|
||||
|
||||
path-scurry@2.0.0:
|
||||
resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==}
|
||||
engines: {node: 20 || >=22}
|
||||
|
||||
path-to-regexp@0.1.10:
|
||||
resolution: {integrity: sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==}
|
||||
|
||||
@@ -14391,12 +14356,6 @@ packages:
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17 || ^18 || ^19
|
||||
|
||||
react-hook-form@7.53.2:
|
||||
resolution: {integrity: sha512-YVel6fW5sOeedd1524pltpHX+jgU2u3DSDtXEaBORNdqiNrsX/nUI/iGXONegttg0mJVnfrIkiV0cmTU6Oo2xw==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17 || ^18 || ^19
|
||||
|
||||
react-is@16.13.1:
|
||||
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
||||
|
||||
@@ -14697,12 +14656,6 @@ packages:
|
||||
regex-utilities@2.3.0:
|
||||
resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==}
|
||||
|
||||
regex-recursion@4.2.1:
|
||||
resolution: {integrity: sha512-QHNZyZAeKdndD1G3bKAbBEKOSSK4KOHQrAJ01N1LJeb0SoH4DJIeFhp0uUpETgONifS4+P3sOgoA1dhzgrQvhA==}
|
||||
|
||||
regex-utilities@2.3.0:
|
||||
resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==}
|
||||
|
||||
regex@4.4.0:
|
||||
resolution: {integrity: sha512-uCUSuobNVeqUupowbdZub6ggI5/JZkYyJdDogddJr60L764oxC2pMZov1fQ3wM9bdyzUILDG+Sqx6NAKAz9rKQ==}
|
||||
|
||||
@@ -14932,11 +14885,6 @@ packages:
|
||||
deprecated: Rimraf versions prior to v4 are no longer supported
|
||||
hasBin: true
|
||||
|
||||
rimraf@6.0.1:
|
||||
resolution: {integrity: sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==}
|
||||
engines: {node: 20 || >=22}
|
||||
hasBin: true
|
||||
|
||||
robust-predicates@3.0.2:
|
||||
resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==}
|
||||
|
||||
@@ -15162,9 +15110,6 @@ packages:
|
||||
shiki@1.23.1:
|
||||
resolution: {integrity: sha512-8kxV9TH4pXgdKGxNOkrSMydn1Xf6It8lsle0fiqxf7a1149K1WGtdOu3Zb91T5r1JpvRPxqxU3C2XdZZXQnrig==}
|
||||
|
||||
shiki@1.23.1:
|
||||
resolution: {integrity: sha512-8kxV9TH4pXgdKGxNOkrSMydn1Xf6It8lsle0fiqxf7a1149K1WGtdOu3Zb91T5r1JpvRPxqxU3C2XdZZXQnrig==}
|
||||
|
||||
shortid@2.2.16:
|
||||
resolution: {integrity: sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==}
|
||||
deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
|
||||
@@ -17381,12 +17326,6 @@ snapshots:
|
||||
|
||||
'@antfu/utils@0.7.10': {}
|
||||
|
||||
'@apidevtools/json-schema-ref-parser@11.7.2':
|
||||
dependencies:
|
||||
'@jsdevtools/ono': 7.1.3
|
||||
'@types/json-schema': 7.0.15
|
||||
js-yaml: 4.1.0
|
||||
|
||||
'@apidevtools/json-schema-ref-parser@11.7.2':
|
||||
dependencies:
|
||||
'@jsdevtools/ono': 7.1.3
|
||||
@@ -19596,18 +19535,8 @@ snapshots:
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
|
||||
'@formatjs/intl-localematcher@0.5.8':
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
|
||||
'@fortawesome/fontawesome-free@6.6.0': {}
|
||||
|
||||
'@fumari/json-schema-to-typescript@1.1.1':
|
||||
dependencies:
|
||||
'@apidevtools/json-schema-ref-parser': 11.7.2
|
||||
js-yaml: 4.1.0
|
||||
prettier: 3.3.3
|
||||
|
||||
'@fumari/json-schema-to-typescript@1.1.1':
|
||||
dependencies:
|
||||
'@apidevtools/json-schema-ref-parser': 11.7.2
|
||||
@@ -19837,8 +19766,6 @@ snapshots:
|
||||
|
||||
'@jsdevtools/ono@7.1.3': {}
|
||||
|
||||
'@jsdevtools/ono@7.1.3': {}
|
||||
|
||||
'@jspm/core@2.1.0': {}
|
||||
|
||||
'@juggle/resize-observer@3.4.0': {}
|
||||
@@ -22859,6 +22786,19 @@ snapshots:
|
||||
- '@types/node'
|
||||
optional: true
|
||||
|
||||
'@scalar/nextjs-api-reference@0.4.101(next@15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)':
|
||||
dependencies:
|
||||
'@scalar/types': 0.0.20
|
||||
next: 15.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
react: 18.3.1
|
||||
|
||||
'@scalar/openapi-types@0.1.5': {}
|
||||
|
||||
'@scalar/types@0.0.20':
|
||||
dependencies:
|
||||
'@scalar/openapi-types': 0.1.5
|
||||
'@unhead/schema': 1.11.11
|
||||
|
||||
'@sec-ant/readable-stream@0.4.1': {}
|
||||
|
||||
'@segment/loosely-validate-event@2.0.0':
|
||||
@@ -22889,15 +22829,6 @@ snapshots:
|
||||
'@types/hast': 3.0.4
|
||||
hast-util-to-html: 9.0.3
|
||||
|
||||
'@shikijs/core@1.23.1':
|
||||
dependencies:
|
||||
'@shikijs/engine-javascript': 1.23.1
|
||||
'@shikijs/engine-oniguruma': 1.23.1
|
||||
'@shikijs/types': 1.23.1
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
'@types/hast': 3.0.4
|
||||
hast-util-to-html: 9.0.3
|
||||
|
||||
'@shikijs/engine-javascript@1.22.2':
|
||||
dependencies:
|
||||
'@shikijs/types': 1.22.2
|
||||
@@ -22910,12 +22841,6 @@ snapshots:
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
oniguruma-to-es: 0.4.1
|
||||
|
||||
'@shikijs/engine-javascript@1.23.1':
|
||||
dependencies:
|
||||
'@shikijs/types': 1.23.1
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
oniguruma-to-es: 0.4.1
|
||||
|
||||
'@shikijs/engine-oniguruma@1.22.2':
|
||||
dependencies:
|
||||
'@shikijs/types': 1.22.2
|
||||
@@ -22926,11 +22851,6 @@ snapshots:
|
||||
'@shikijs/types': 1.23.1
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
|
||||
'@shikijs/engine-oniguruma@1.23.1':
|
||||
dependencies:
|
||||
'@shikijs/types': 1.23.1
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
|
||||
'@shikijs/rehype@1.22.2':
|
||||
dependencies:
|
||||
'@shikijs/types': 1.22.2
|
||||
@@ -22972,11 +22892,6 @@ snapshots:
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
'@types/hast': 3.0.4
|
||||
|
||||
'@shikijs/types@1.23.1':
|
||||
dependencies:
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
'@types/hast': 3.0.4
|
||||
|
||||
'@shikijs/vscode-textmate@9.3.0': {}
|
||||
|
||||
'@shuding/opentype.js@1.4.0-beta.0':
|
||||
@@ -24511,7 +24426,7 @@ snapshots:
|
||||
'@vue/shared': 3.5.12
|
||||
estree-walker: 2.0.2
|
||||
magic-string: 0.30.12
|
||||
postcss: 8.4.49
|
||||
postcss: 8.4.47
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@vue/compiler-sfc@3.5.13':
|
||||
@@ -25838,14 +25753,6 @@ snapshots:
|
||||
uncrypto: 0.1.3
|
||||
zod: 3.23.8
|
||||
|
||||
better-call@0.2.15-beta.7:
|
||||
dependencies:
|
||||
'@better-fetch/fetch': 1.1.12
|
||||
rou3: 0.5.1
|
||||
set-cookie-parser: 2.7.1
|
||||
uncrypto: 0.1.3
|
||||
zod: 3.23.8
|
||||
|
||||
better-call@0.2.3-beta.2:
|
||||
dependencies:
|
||||
'@better-fetch/fetch': 1.1.12
|
||||
@@ -25854,6 +25761,22 @@ snapshots:
|
||||
set-cookie-parser: 2.7.1
|
||||
typescript: 5.6.3
|
||||
|
||||
better-call@0.3.0:
|
||||
dependencies:
|
||||
'@better-fetch/fetch': 1.1.12
|
||||
rou3: 0.5.1
|
||||
set-cookie-parser: 2.7.1
|
||||
uncrypto: 0.1.3
|
||||
zod: 3.23.8
|
||||
|
||||
better-call@0.3.1:
|
||||
dependencies:
|
||||
'@better-fetch/fetch': 1.1.12
|
||||
rou3: 0.5.1
|
||||
set-cookie-parser: 2.7.1
|
||||
uncrypto: 0.1.3
|
||||
zod: 3.23.8
|
||||
|
||||
better-opn@3.0.2:
|
||||
dependencies:
|
||||
open: 8.4.2
|
||||
@@ -27404,8 +27327,6 @@ snapshots:
|
||||
|
||||
emoji-regex-xs@1.0.0: {}
|
||||
|
||||
emoji-regex-xs@1.0.0: {}
|
||||
|
||||
emoji-regex@10.4.0: {}
|
||||
|
||||
emoji-regex@8.0.0: {}
|
||||
@@ -28689,8 +28610,6 @@ snapshots:
|
||||
|
||||
foreach@2.0.6: {}
|
||||
|
||||
foreach@2.0.6: {}
|
||||
|
||||
foreground-child@3.3.0:
|
||||
dependencies:
|
||||
cross-spawn: 7.0.3
|
||||
@@ -28936,7 +28855,6 @@ snapshots:
|
||||
mdast-util-gfm: 3.0.0
|
||||
mdast-util-to-hast: 13.2.0
|
||||
shiki: 1.23.1
|
||||
shiki: 1.23.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
@@ -29192,15 +29110,6 @@ snapshots:
|
||||
package-json-from-dist: 1.0.1
|
||||
path-scurry: 1.11.1
|
||||
|
||||
glob@11.0.0:
|
||||
dependencies:
|
||||
foreground-child: 3.3.0
|
||||
jackspeak: 4.0.2
|
||||
minimatch: 10.0.1
|
||||
minipass: 7.1.2
|
||||
package-json-from-dist: 1.0.1
|
||||
path-scurry: 2.0.0
|
||||
|
||||
glob@7.1.6:
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
@@ -30164,10 +30073,6 @@ snapshots:
|
||||
optionalDependencies:
|
||||
'@pkgjs/parseargs': 0.11.0
|
||||
|
||||
jackspeak@4.0.2:
|
||||
dependencies:
|
||||
'@isaacs/cliui': 8.0.2
|
||||
|
||||
javascript-stringify@2.1.0: {}
|
||||
|
||||
jest-diff@29.7.0:
|
||||
@@ -30329,10 +30234,6 @@ snapshots:
|
||||
|
||||
json-parse-even-better-errors@3.0.2: {}
|
||||
|
||||
json-pointer@0.6.2:
|
||||
dependencies:
|
||||
foreach: 2.0.6
|
||||
|
||||
json-pointer@0.6.2:
|
||||
dependencies:
|
||||
foreach: 2.0.6
|
||||
@@ -30754,8 +30655,6 @@ snapshots:
|
||||
|
||||
lru-cache@10.4.3: {}
|
||||
|
||||
lru-cache@11.0.2: {}
|
||||
|
||||
lru-cache@4.1.5:
|
||||
dependencies:
|
||||
pseudomap: 1.0.2
|
||||
@@ -31877,10 +31776,6 @@ snapshots:
|
||||
|
||||
mini-svg-data-uri@1.4.4: {}
|
||||
|
||||
minimatch@10.0.1:
|
||||
dependencies:
|
||||
brace-expansion: 2.0.1
|
||||
|
||||
minimatch@3.0.8:
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
@@ -32115,11 +32010,6 @@ snapshots:
|
||||
react: 18.3.1
|
||||
react-dom: 18.3.1(react@18.3.1)
|
||||
|
||||
next-themes@0.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
|
||||
dependencies:
|
||||
react: 18.3.1
|
||||
react-dom: 18.3.1(react@18.3.1)
|
||||
|
||||
next-tick@1.1.0: {}
|
||||
|
||||
next@15.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
|
||||
@@ -33028,11 +32918,6 @@ snapshots:
|
||||
lru-cache: 10.4.3
|
||||
minipass: 7.1.2
|
||||
|
||||
path-scurry@2.0.0:
|
||||
dependencies:
|
||||
lru-cache: 11.0.2
|
||||
minipass: 7.1.2
|
||||
|
||||
path-to-regexp@0.1.10: {}
|
||||
|
||||
path-to-regexp@6.3.0: {}
|
||||
@@ -33768,10 +33653,6 @@ snapshots:
|
||||
dependencies:
|
||||
react: 18.3.1
|
||||
|
||||
react-hook-form@7.53.2(react@18.3.1):
|
||||
dependencies:
|
||||
react: 18.3.1
|
||||
|
||||
react-is@16.13.1: {}
|
||||
|
||||
react-is@17.0.2: {}
|
||||
@@ -34180,12 +34061,6 @@ snapshots:
|
||||
|
||||
regex-utilities@2.3.0: {}
|
||||
|
||||
regex-recursion@4.2.1:
|
||||
dependencies:
|
||||
regex-utilities: 2.3.0
|
||||
|
||||
regex-utilities@2.3.0: {}
|
||||
|
||||
regex@4.4.0: {}
|
||||
|
||||
regex@5.0.2:
|
||||
@@ -34518,11 +34393,6 @@ snapshots:
|
||||
dependencies:
|
||||
glob: 7.2.3
|
||||
|
||||
rimraf@6.0.1:
|
||||
dependencies:
|
||||
glob: 11.0.0
|
||||
package-json-from-dist: 1.0.1
|
||||
|
||||
robust-predicates@3.0.2: {}
|
||||
|
||||
rollup-plugin-visualizer@5.12.0(rollup@4.24.3):
|
||||
@@ -34838,15 +34708,6 @@ snapshots:
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
'@types/hast': 3.0.4
|
||||
|
||||
shiki@1.23.1:
|
||||
dependencies:
|
||||
'@shikijs/core': 1.23.1
|
||||
'@shikijs/engine-javascript': 1.23.1
|
||||
'@shikijs/engine-oniguruma': 1.23.1
|
||||
'@shikijs/types': 1.23.1
|
||||
'@shikijs/vscode-textmate': 9.3.0
|
||||
'@types/hast': 3.0.4
|
||||
|
||||
shortid@2.2.16:
|
||||
dependencies:
|
||||
nanoid: 2.1.11
|
||||
|
||||
Reference in New Issue
Block a user