init, auth-ui, auth-api, auth-core

This commit is contained in:
echo committed 2025-03-24 00:47:33 +01:00
1 parent 094cdb12f8
commit c527aa7bb7
92 files changed
+21484

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
{
"name": "@mono/auth-core",
"version": "0.1.0",
"private": true,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts --clean --tsconfig tsconfig.json",
"dev": "tsup src/index.ts --format cjs,esm --dts --watch --clean --tsconfig tsconfig.json",
"clean": "rm -rf dist",
"lint": "eslint src/",
"check-types": "tsc --noEmit"
},
"dependencies": {
"zod": "^3.22.4"
},
"devDependencies": {
"tsup": "^8.0.2",
"typescript": "^5.3.3",
"@types/node": "^20.11.24"
}
}
+1
View File
@@ -0,0 +1 @@
export * from './types';
+27
View File
@@ -0,0 +1,27 @@
import { z } from 'zod';
export const UserSchema = z.object({
id: z.string(),
email: z.string().email(),
name: z.string().optional(),
});
export type User = z.infer<typeof UserSchema>;
export const LoginInputSchema = z.object({
email: z.string().email(),
password: z.string().min(8),
});
export type LoginInput = z.infer<typeof LoginInputSchema>;
export const RegisterInputSchema = LoginInputSchema.extend({
name: z.string().min(2).optional(),
});
export type RegisterInput = z.infer<typeof RegisterInputSchema>;
export interface AuthTokens {
accessToken: string;
refreshToken: string;
}
+12
View File
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"composite": true,
"declaration": true,
"declarationMap": true,
"incremental": true
},
"include": ["src"]
}