changed to Daphnis
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
import { randomUUID } from "crypto";
|
import { randomUUID } from "crypto";
|
||||||
import { Resend } from "resend";
|
import { Resend } from "resend";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
@ -39,7 +39,7 @@ export async function EmailPasswordResetLink(data: FormData) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = await lachesis.user.findUnique({
|
const user = await daphnis.user.findUnique({
|
||||||
where: { email },
|
where: { email },
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ export async function EmailPasswordResetLink(data: FormData) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = await lachesis.passwordResetToken.create({
|
const token = await daphnis.passwordResetToken.create({
|
||||||
data: {
|
data: {
|
||||||
id: randomUUID(),
|
id: randomUUID(),
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { Argon2id } from "oslo/password";
|
import { Argon2id } from "oslo/password";
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ export async function resetPassword(token: string, data: FormData) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const passwordResetToken = await lachesis.passwordResetToken.findUnique({
|
const passwordResetToken = await daphnis.passwordResetToken.findUnique({
|
||||||
where: {
|
where: {
|
||||||
token,
|
token,
|
||||||
createdAt: { gt: new Date(Date.now() - 1000 * 60 * 60 * 4) },
|
createdAt: { gt: new Date(Date.now() - 1000 * 60 * 60 * 4) },
|
||||||
@ -37,14 +37,14 @@ export async function resetPassword(token: string, data: FormData) {
|
|||||||
const argon2 = new Argon2id();
|
const argon2 = new Argon2id();
|
||||||
const encrypted = await argon2.hash(password);
|
const encrypted = await argon2.hash(password);
|
||||||
|
|
||||||
const updateUser = lachesis.user.update({
|
const updateUser = daphnis.user.update({
|
||||||
where: { id: passwordResetToken.userId },
|
where: { id: passwordResetToken.userId },
|
||||||
data: {
|
data: {
|
||||||
hashedPassword: encrypted,
|
hashedPassword: encrypted,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateToken = lachesis.passwordResetToken.update({
|
const updateToken = daphnis.passwordResetToken.update({
|
||||||
where: {
|
where: {
|
||||||
id: passwordResetToken.id,
|
id: passwordResetToken.id,
|
||||||
},
|
},
|
||||||
@ -54,7 +54,7 @@ export async function resetPassword(token: string, data: FormData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await lachesis.$transaction([updateUser, updateToken]);
|
await daphnis.$transaction([updateUser, updateToken]);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
return {
|
return {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { getAuth } from "@/auth/queries/getauth";
|
import { getAuth } from "@/auth/queries/getauth";
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
import { randomUUID } from "crypto";
|
import { randomUUID } from "crypto";
|
||||||
import { randomBytes } from "crypto";
|
import { randomBytes } from "crypto";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
@ -20,7 +20,7 @@ export async function generateShareToken(id: number): Promise<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gernatetoken = randomBytes(5).readUInt32BE(0).toString();
|
const gernatetoken = randomBytes(5).readUInt32BE(0).toString();
|
||||||
const token = await lachesis.linkSharingToken.create({
|
const token = await daphnis.linkSharingToken.create({
|
||||||
data: {
|
data: {
|
||||||
playlogId: id,
|
playlogId: id,
|
||||||
id: randomUUID(),
|
id: randomUUID(),
|
||||||
@ -34,7 +34,7 @@ export async function generateShareToken(id: number): Promise<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function shareScore(token: string) {
|
export async function shareScore(token: string) {
|
||||||
const PublicPage = await lachesis.linkSharingToken.findUnique({
|
const PublicPage = await daphnis.linkSharingToken.findUnique({
|
||||||
where: {
|
where: {
|
||||||
token,
|
token,
|
||||||
},
|
},
|
||||||
@ -52,7 +52,7 @@ export async function shareScore(token: string) {
|
|||||||
const tokenAgeLimit = 1000 * 60 * 60 * 24; // 1 day in milliseconds
|
const tokenAgeLimit = 1000 * 60 * 60 * 24; // 1 day in milliseconds
|
||||||
|
|
||||||
if (tokenAge > tokenAgeLimit) {
|
if (tokenAge > tokenAgeLimit) {
|
||||||
await lachesis.linkSharingToken.update({
|
await daphnis.linkSharingToken.update({
|
||||||
where: {
|
where: {
|
||||||
token,
|
token,
|
||||||
},
|
},
|
||||||
|
@ -5,7 +5,7 @@ import "./globals.css";
|
|||||||
import ReactQueryProvider from "./provider";
|
import ReactQueryProvider from "./provider";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Lachesis",
|
title: "Daphnis",
|
||||||
description: "Artemis score viewer",
|
description: "Artemis score viewer",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { cookies } from "next/headers";
|
|||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { Argon2id } from "oslo/password";
|
import { Argon2id } from "oslo/password";
|
||||||
import { lucia } from "@/lib/lucia";
|
import { lucia } from "@/lib/lucia";
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
|
|
||||||
const signIn = async (formData: FormData) => {
|
const signIn = async (formData: FormData) => {
|
||||||
const formDataRaw = {
|
const formDataRaw = {
|
||||||
@ -13,7 +13,7 @@ const signIn = async (formData: FormData) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const user = await lachesis.user.findUnique({
|
const user = await daphnis.user.findUnique({
|
||||||
where: { username: formDataRaw.username },
|
where: { username: formDataRaw.username },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { cookies } from "next/headers";
|
|||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { Argon2id } from "oslo/password";
|
import { Argon2id } from "oslo/password";
|
||||||
import { lucia } from "@/lib/lucia";
|
import { lucia } from "@/lib/lucia";
|
||||||
import { lachesis, artemis } from "@/lib/prisma";
|
import { daphnis, artemis } from "@/lib/prisma";
|
||||||
|
|
||||||
const signUp = async (formData: FormData) => {
|
const signUp = async (formData: FormData) => {
|
||||||
const formDataRaw = {
|
const formDataRaw = {
|
||||||
@ -21,8 +21,8 @@ const signUp = async (formData: FormData) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Check if access code is already used in lachesis database
|
// Check if access code is already used in daphnis database
|
||||||
const existingUser = await lachesis.user.findFirst({
|
const existingUser = await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
accessCode: formDataRaw.accessCode,
|
accessCode: formDataRaw.accessCode,
|
||||||
},
|
},
|
||||||
@ -32,8 +32,8 @@ const signUp = async (formData: FormData) => {
|
|||||||
return { error: "Access Code already in use" };
|
return { error: "Access Code already in use" };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if username is already used in lachesis database
|
// Check if username is already used in daphnis database
|
||||||
const existingUsername = await lachesis.user.findFirst({
|
const existingUsername = await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
username: formDataRaw.username,
|
username: formDataRaw.username,
|
||||||
},
|
},
|
||||||
@ -43,7 +43,7 @@ const signUp = async (formData: FormData) => {
|
|||||||
return { error: "Username is currently taken" };
|
return { error: "Username is currently taken" };
|
||||||
}
|
}
|
||||||
|
|
||||||
const existingEmail = await lachesis.user.findFirst({
|
const existingEmail = await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
email: formDataRaw.email,
|
email: formDataRaw.email,
|
||||||
},
|
},
|
||||||
@ -67,8 +67,8 @@ const signUp = async (formData: FormData) => {
|
|||||||
const hashedPassword = await new Argon2id().hash(formDataRaw.password);
|
const hashedPassword = await new Argon2id().hash(formDataRaw.password);
|
||||||
const userId = generateId(15);
|
const userId = generateId(15);
|
||||||
|
|
||||||
// Create user in the lachesis database
|
// Create user in the daphnis database
|
||||||
await lachesis.user.create({
|
await daphnis.user.create({
|
||||||
data: {
|
data: {
|
||||||
id: userId,
|
id: userId,
|
||||||
username: formDataRaw.username,
|
username: formDataRaw.username,
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { getAuth } from "@/auth/queries/getauth";
|
import { getAuth } from "@/auth/queries/getauth";
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
|
|
||||||
export async function getLachesisInUseCards() {
|
export async function getdaphnisInUseCards() {
|
||||||
const { user } = await getAuth();
|
const { user } = await getAuth();
|
||||||
|
|
||||||
if (!user || !user.accessCode) {
|
if (!user || !user.accessCode) {
|
||||||
throw new Error("User is not authenticated or accessCode is missing");
|
throw new Error("User is not authenticated or accessCode is missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
const aimeUser = await lachesis.user.findFirst({
|
const aimeUser = await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
accessCode: user.accessCode,
|
accessCode: user.accessCode,
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { getAuth } from "@/auth/queries/getauth";
|
import { getAuth } from "@/auth/queries/getauth";
|
||||||
import { artemis } from "@/lib/prisma";
|
import { artemis } from "@/lib/prisma";
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
|
|
||||||
export const LinkAimeCard = async (formData: FormData) => {
|
export const LinkAimeCard = async (formData: FormData) => {
|
||||||
const { user } = await getAuth();
|
const { user } = await getAuth();
|
||||||
@ -12,8 +12,8 @@ export const LinkAimeCard = async (formData: FormData) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Check if access code is already used by another user in lachesis database
|
// Check if access code is already used by another user in daphnis database
|
||||||
const existingUserWithAccessCode = await lachesis.user.findFirst({
|
const existingUserWithAccessCode = await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
accessCode: formDataRaw.accessCode,
|
accessCode: formDataRaw.accessCode,
|
||||||
id: {
|
id: {
|
||||||
@ -37,7 +37,7 @@ export const LinkAimeCard = async (formData: FormData) => {
|
|||||||
throw new Error("Not in artemis's database, Nice try ^_^");
|
throw new Error("Not in artemis's database, Nice try ^_^");
|
||||||
}
|
}
|
||||||
|
|
||||||
const userHoldsAccessCode = await lachesis.user.findFirst({
|
const userHoldsAccessCode = await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
accessCode: formDataRaw.accessCode,
|
accessCode: formDataRaw.accessCode,
|
||||||
},
|
},
|
||||||
@ -48,7 +48,7 @@ export const LinkAimeCard = async (formData: FormData) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update current user's access code
|
// Update current user's access code
|
||||||
await lachesis.user.update({
|
await daphnis.user.update({
|
||||||
where: {
|
where: {
|
||||||
id: user?.id,
|
id: user?.id,
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import { getAuth } from "@/auth/queries/getauth";
|
import { getAuth } from "@/auth/queries/getauth";
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
import { Argon2id } from "oslo/password";
|
import { Argon2id } from "oslo/password";
|
||||||
|
|
||||||
export const InApplicationPasswordReset = async (
|
export const InApplicationPasswordReset = async (
|
||||||
@ -22,7 +22,7 @@ export const InApplicationPasswordReset = async (
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Fetch user from database
|
// Fetch user from database
|
||||||
const existingUser = await lachesis.user.findUnique({
|
const existingUser = await daphnis.user.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
},
|
},
|
||||||
@ -46,7 +46,7 @@ export const InApplicationPasswordReset = async (
|
|||||||
const hashedPassword = await new Argon2id().hash(newPassword);
|
const hashedPassword = await new Argon2id().hash(newPassword);
|
||||||
|
|
||||||
// Update user's password
|
// Update user's password
|
||||||
await lachesis.user.update({
|
await daphnis.user.update({
|
||||||
where: {
|
where: {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
},
|
},
|
||||||
|
10
lib/api.ts
10
lib/api.ts
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
import { getAuth } from "@/auth/queries/getauth";
|
import { getAuth } from "@/auth/queries/getauth";
|
||||||
import { artemis } from "@/lib/prisma";
|
import { artemis } from "@/lib/prisma";
|
||||||
import { lachesis } from "@/lib/prisma";
|
import { daphnis } from "@/lib/prisma";
|
||||||
|
|
||||||
|
|
||||||
export async function getSongsWithTitles(userId: number) {
|
export async function getSongsWithTitles(userId: number) {
|
||||||
try {
|
try {
|
||||||
// Fetch songs from ChuniScorePlaylog
|
// Fetch songs from ChuniScorePlaylog
|
||||||
@ -92,7 +94,7 @@ export async function getSongsWithTitles(userId: number) {
|
|||||||
|
|
||||||
export async function SharingPlaylogId(playlogid: number) {
|
export async function SharingPlaylogId(playlogid: number) {
|
||||||
try {
|
try {
|
||||||
const tokens = await lachesis.linkSharingToken.findMany({
|
const tokens = await daphnis.linkSharingToken.findMany({
|
||||||
where: {
|
where: {
|
||||||
playlogId: playlogid,
|
playlogId: playlogid,
|
||||||
},
|
},
|
||||||
@ -114,7 +116,7 @@ export async function SharingPlaylogId(playlogid: number) {
|
|||||||
export const getUsername = async () => {
|
export const getUsername = async () => {
|
||||||
const { user } = await getAuth(); // Assuming getAuth() returns an auth object with user info
|
const { user } = await getAuth(); // Assuming getAuth() returns an auth object with user info
|
||||||
if (user) {
|
if (user) {
|
||||||
return await lachesis.user.findFirst({
|
return await daphnis.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
@ -131,7 +133,7 @@ export async function getAllAimeCards() {
|
|||||||
throw new Error("User is not authenticated or accessCode is missing");
|
throw new Error("User is not authenticated or accessCode is missing");
|
||||||
}
|
}
|
||||||
|
|
||||||
const aimeUser = await lachesis.user.findMany({
|
const aimeUser = await daphnis.user.findMany({
|
||||||
where: {
|
where: {
|
||||||
accessCode: user.accessCode,
|
accessCode: user.accessCode,
|
||||||
},
|
},
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Lucia } from "lucia";
|
import { Lucia } from "lucia";
|
||||||
import { PrismaAdapter } from "@lucia-auth/adapter-prisma";
|
import { PrismaAdapter } from "@lucia-auth/adapter-prisma";
|
||||||
import { lachesis } from "./prisma";
|
import { daphnis } from "./prisma";
|
||||||
|
|
||||||
const adapter = new PrismaAdapter(lachesis.session, lachesis.user);
|
const adapter = new PrismaAdapter(daphnis.session, daphnis.user);
|
||||||
|
|
||||||
export const lucia = new Lucia(adapter, {
|
export const lucia = new Lucia(adapter, {
|
||||||
sessionCookie: {
|
sessionCookie: {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { PrismaClient as lachesisClient } from "@/prisma/schemas/lachesis/generated/lachesis";
|
import { PrismaClient as dahnisClient } from "@/prisma/schemas/daphnis/generated/daphnis";
|
||||||
import { PrismaClient as artemisClient } from "@/prisma/schemas/artemis/generated/artemis";
|
import { PrismaClient as artemisClient } from "@/prisma/schemas/artemis/generated/artemis";
|
||||||
|
|
||||||
const lachesisSingleton = () => {
|
const DaphnisSingleton = () => {
|
||||||
return new lachesisClient();
|
return new dahnisClient();
|
||||||
};
|
};
|
||||||
|
|
||||||
const aremisSingleton = () => {
|
const aremisSingleton = () => {
|
||||||
@ -10,11 +10,11 @@ const aremisSingleton = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
var lachesis: undefined | ReturnType<typeof lachesisSingleton>;
|
var daphnis: undefined | ReturnType<typeof DaphnisSingleton>;
|
||||||
var artemis: undefined | ReturnType<typeof aremisSingleton>;
|
var artemis: undefined | ReturnType<typeof aremisSingleton>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const lachesis = globalThis.lachesis ?? lachesisSingleton();
|
export const daphnis = globalThis.daphnis ?? DaphnisSingleton();
|
||||||
export const artemis = globalThis.artemis ?? aremisSingleton();
|
export const artemis = globalThis.artemis ?? aremisSingleton();
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "production") globalThis.lachesis = lachesis;
|
if (process.env.NODE_ENV !== "production") globalThis.daphnis = daphnis;
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"db:init": "npx prisma migrate dev --name init --schema prisma/schemas/lachesis/schema.prisma; npx prisma db pull --schema prisma/schemas/artemis/schema.prisma",
|
"db:init": "npx prisma migrate dev --name init --schema prisma/schemas/daphnis/schema.prisma; npx prisma db pull --schema prisma/schemas/artemis/schema.prisma",
|
||||||
"artemis:generate": "prisma generate --schema=./prisma/schemas/artemis/schema.prisma",
|
"artemis:generate": "prisma generate --schema=./prisma/schemas/artemis/schema.prisma",
|
||||||
"lachesis:migrate": "prisma migrate dev --schema=./prisma/schemas/lachesis/schema.prisma",
|
"daphnis:generate": "prisma generate --schema=./prisma/schemas/daphnis/schema.prisma",
|
||||||
"lachesis:drop": "prisma migrate reset --schema=./prisma/schemas/lachesis/schema.prisma",
|
"daphnis:migrate": "prisma migrate dev --schema=./prisma/schemas/daphnis/schema.prisma",
|
||||||
|
"daphnis:drop": "prisma migrate reset --schema=./prisma/schemas/daphnis/schema.prisma",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -3647,7 +3647,7 @@ const config = {
|
|||||||
"value": "prisma-client-js"
|
"value": "prisma-client-js"
|
||||||
},
|
},
|
||||||
"output": {
|
"output": {
|
||||||
"value": "/home/polaris/Documents/projects/lachesis/prisma/schemas/artemis/generated/artemis",
|
"value": "/home/polaris/Documents/daphnis/prisma/schemas/artemis/generated/artemis",
|
||||||
"fromEnvVar": null
|
"fromEnvVar": null
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
@ -3648,7 +3648,7 @@ const config = {
|
|||||||
"value": "prisma-client-js"
|
"value": "prisma-client-js"
|
||||||
},
|
},
|
||||||
"output": {
|
"output": {
|
||||||
"value": "/home/polaris/Documents/projects/lachesis/prisma/schemas/artemis/generated/artemis",
|
"value": "/home/polaris/Documents/daphnis/prisma/schemas/artemis/generated/artemis",
|
||||||
"fromEnvVar": null
|
"fromEnvVar": null
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
@ -150,7 +150,7 @@ const config = {
|
|||||||
"value": "prisma-client-js"
|
"value": "prisma-client-js"
|
||||||
},
|
},
|
||||||
"output": {
|
"output": {
|
||||||
"value": "/home/polaris/Documents/projects/lachesis/prisma/schemas/lachesis/generated/lachesis",
|
"value": "/home/polaris/Documents/daphnis/prisma/schemas/daphnis/generated/daphnis",
|
||||||
"fromEnvVar": null
|
"fromEnvVar": null
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
@ -167,7 +167,7 @@ const config = {
|
|||||||
"isCustomOutput": true
|
"isCustomOutput": true
|
||||||
},
|
},
|
||||||
"relativeEnvPaths": {
|
"relativeEnvPaths": {
|
||||||
"rootEnvPath": null,
|
"rootEnvPath": "../../../../../.env",
|
||||||
"schemaEnvPath": "../../../../../.env"
|
"schemaEnvPath": "../../../../../.env"
|
||||||
},
|
},
|
||||||
"relativePath": "../..",
|
"relativePath": "../..",
|
||||||
@ -177,6 +177,7 @@ const config = {
|
|||||||
"db"
|
"db"
|
||||||
],
|
],
|
||||||
"activeProvider": "mysql",
|
"activeProvider": "mysql",
|
||||||
|
"postinstall": false,
|
||||||
"inlineDatasources": {
|
"inlineDatasources": {
|
||||||
"db": {
|
"db": {
|
||||||
"url": {
|
"url": {
|
||||||
@ -185,8 +186,8 @@ const config = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"./generated/lachesis\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"DATABASE_URL\")\n}\n\nenum UserRole {\n ADMIN\n USER\n}\n\nmodel User {\n id String @id\n sessions Session[]\n username String @unique\n accessCode String @unique\n hashedPassword String\n email String @unique\n role UserRole @default(USER)\n PasswordResetToken PasswordResetToken[]\n LinkSharingToken LinkSharingToken[]\n}\n\nmodel PasswordResetToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n resetAt DateTime?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel LinkSharingToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n tokenExpiredAt DateTime?\n playlogId Int?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel Session {\n id String @id\n expiresAt DateTime\n userId String\n user User @relation(references: [id], fields: [userId], onDelete: Cascade)\n}\n",
|
"inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"./generated/daphnis\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"DATABASE_URL\")\n}\n\nenum UserRole {\n ADMIN\n USER\n}\n\nmodel User {\n id String @id\n sessions Session[]\n username String @unique\n accessCode String @unique\n hashedPassword String\n email String @unique\n role UserRole @default(USER)\n PasswordResetToken PasswordResetToken[]\n LinkSharingToken LinkSharingToken[]\n}\n\nmodel PasswordResetToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n resetAt DateTime?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel LinkSharingToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n tokenExpiredAt DateTime?\n playlogId Int?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel Session {\n id String @id\n expiresAt DateTime\n userId String\n user User @relation(references: [id], fields: [userId], onDelete: Cascade)\n}\n",
|
||||||
"inlineSchemaHash": "4a941b08f33d6fbdef31c4059e37314345fc724bfa3f4c300d6cb38dc73636a9",
|
"inlineSchemaHash": "d87f50b9542355418c6259e30d43d396260e40a71d7c943615f89f3e1af2e4a0",
|
||||||
"copyEngine": true
|
"copyEngine": true
|
||||||
}
|
}
|
||||||
config.dirname = '/'
|
config.dirname = '/'
|
@ -151,7 +151,7 @@ const config = {
|
|||||||
"value": "prisma-client-js"
|
"value": "prisma-client-js"
|
||||||
},
|
},
|
||||||
"output": {
|
"output": {
|
||||||
"value": "/home/polaris/Documents/projects/lachesis/prisma/schemas/lachesis/generated/lachesis",
|
"value": "/home/polaris/Documents/daphnis/prisma/schemas/daphnis/generated/daphnis",
|
||||||
"fromEnvVar": null
|
"fromEnvVar": null
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
@ -168,7 +168,7 @@ const config = {
|
|||||||
"isCustomOutput": true
|
"isCustomOutput": true
|
||||||
},
|
},
|
||||||
"relativeEnvPaths": {
|
"relativeEnvPaths": {
|
||||||
"rootEnvPath": null,
|
"rootEnvPath": "../../../../../.env",
|
||||||
"schemaEnvPath": "../../../../../.env"
|
"schemaEnvPath": "../../../../../.env"
|
||||||
},
|
},
|
||||||
"relativePath": "../..",
|
"relativePath": "../..",
|
||||||
@ -178,6 +178,7 @@ const config = {
|
|||||||
"db"
|
"db"
|
||||||
],
|
],
|
||||||
"activeProvider": "mysql",
|
"activeProvider": "mysql",
|
||||||
|
"postinstall": false,
|
||||||
"inlineDatasources": {
|
"inlineDatasources": {
|
||||||
"db": {
|
"db": {
|
||||||
"url": {
|
"url": {
|
||||||
@ -186,8 +187,8 @@ const config = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"./generated/lachesis\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"DATABASE_URL\")\n}\n\nenum UserRole {\n ADMIN\n USER\n}\n\nmodel User {\n id String @id\n sessions Session[]\n username String @unique\n accessCode String @unique\n hashedPassword String\n email String @unique\n role UserRole @default(USER)\n PasswordResetToken PasswordResetToken[]\n LinkSharingToken LinkSharingToken[]\n}\n\nmodel PasswordResetToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n resetAt DateTime?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel LinkSharingToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n tokenExpiredAt DateTime?\n playlogId Int?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel Session {\n id String @id\n expiresAt DateTime\n userId String\n user User @relation(references: [id], fields: [userId], onDelete: Cascade)\n}\n",
|
"inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"./generated/daphnis\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"DATABASE_URL\")\n}\n\nenum UserRole {\n ADMIN\n USER\n}\n\nmodel User {\n id String @id\n sessions Session[]\n username String @unique\n accessCode String @unique\n hashedPassword String\n email String @unique\n role UserRole @default(USER)\n PasswordResetToken PasswordResetToken[]\n LinkSharingToken LinkSharingToken[]\n}\n\nmodel PasswordResetToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n resetAt DateTime?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel LinkSharingToken {\n id String @id\n token String @unique\n createdAt DateTime @default(now())\n userId String\n tokenExpiredAt DateTime?\n playlogId Int?\n\n user User @relation(fields: [userId], references: [id])\n}\n\nmodel Session {\n id String @id\n expiresAt DateTime\n userId String\n user User @relation(references: [id], fields: [userId], onDelete: Cascade)\n}\n",
|
||||||
"inlineSchemaHash": "4a941b08f33d6fbdef31c4059e37314345fc724bfa3f4c300d6cb38dc73636a9",
|
"inlineSchemaHash": "d87f50b9542355418c6259e30d43d396260e40a71d7c943615f89f3e1af2e4a0",
|
||||||
"copyEngine": true
|
"copyEngine": true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,8 +197,8 @@ const fs = require('fs')
|
|||||||
config.dirname = __dirname
|
config.dirname = __dirname
|
||||||
if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
|
if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
|
||||||
const alternativePaths = [
|
const alternativePaths = [
|
||||||
"prisma/schemas/lachesis/generated/lachesis",
|
"prisma/schemas/daphnis/generated/daphnis",
|
||||||
"schemas/lachesis/generated/lachesis",
|
"schemas/daphnis/generated/daphnis",
|
||||||
]
|
]
|
||||||
|
|
||||||
const alternativePath = alternativePaths.find((altPath) => {
|
const alternativePath = alternativePaths.find((altPath) => {
|
||||||
@ -226,7 +227,7 @@ Object.assign(exports, Prisma)
|
|||||||
|
|
||||||
// file annotations for bundling tools to include these files
|
// file annotations for bundling tools to include these files
|
||||||
path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node");
|
path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node");
|
||||||
path.join(process.cwd(), "prisma/schemas/lachesis/generated/lachesis/libquery_engine-debian-openssl-3.0.x.so.node")
|
path.join(process.cwd(), "prisma/schemas/daphnis/generated/daphnis/libquery_engine-debian-openssl-3.0.x.so.node")
|
||||||
// file annotations for bundling tools to include these files
|
// file annotations for bundling tools to include these files
|
||||||
path.join(__dirname, "schema.prisma");
|
path.join(__dirname, "schema.prisma");
|
||||||
path.join(process.cwd(), "prisma/schemas/lachesis/generated/lachesis/schema.prisma")
|
path.join(process.cwd(), "prisma/schemas/daphnis/generated/daphnis/schema.prisma")
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "prisma-client-70fb468b9272f6dedf5cd5bbd165ea4d0acb5a3a3690a9faf3c1349f968a09e4",
|
"name": "prisma-client-aabc54979c11ed9fe0760e616a5aa0e1ec79c6db5c25a69f7c0abd1fa7e08ee5",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"browser": "index-browser.js",
|
"browser": "index-browser.js",
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
output = "./generated/lachesis"
|
output = "./generated/daphnis"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
output = "./generated/lachesis"
|
output = "./generated/daphnis"
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
Binary file not shown.
Reference in New Issue
Block a user