Fix: middleware
Deskripsi - Fix middleware - Fix metode login ( sekarang menggunakan api )
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"version": "1.2.5",
|
||||
"private": true,
|
||||
"prisma": {
|
||||
"seed": "npx tsx prisma/seed.ts --yes"
|
||||
"seed": "npx tsx prisma/seed.ts --yes"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "next dev --experimental-https",
|
||||
@@ -89,6 +89,7 @@
|
||||
"utf-8-validate": "^6.0.3",
|
||||
"uuid": "^9.0.1",
|
||||
"wibu": "bipproduction/wibu",
|
||||
"wibu-cli": "^1.0.91",
|
||||
"wibu-pkg": "^1.0.3",
|
||||
"yaml": "^2.3.2"
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ model User {
|
||||
id String @id @default(cuid())
|
||||
username String @unique
|
||||
nomor String @unique
|
||||
active Boolean @default(true)
|
||||
active Boolean @default(false)
|
||||
createdAt DateTime? @default(now())
|
||||
updatedAt DateTime? @updatedAt
|
||||
MasterUserRole MasterUserRole @relation(fields: [masterUserRoleId], references: [id])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { funCheckCookies } from "@/app_modules/_global/fun/get/fun_check_cookies";
|
||||
|
||||
import { Login } from "@/app_modules/auth";
|
||||
import versionUpdate from "../../../../package.json";
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { Register } from "@/app_modules/auth";
|
||||
import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let otpId = params.id;
|
||||
const dataOtp = await auth_getCodeOtpByNumber({ kodeId: otpId });
|
||||
return <Register dataOtp={dataOtp} />;
|
||||
}
|
||||
5
src/app/(user)/register/page.tsx
Normal file
5
src/app/(user)/register/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Register } from "@/app_modules/auth";
|
||||
|
||||
export default async function Page() {
|
||||
return <Register />;
|
||||
}
|
||||
7
src/app/(user)/splash/page.tsx
Normal file
7
src/app/(user)/splash/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { SplashScreen } from "@/app_modules/auth";
|
||||
|
||||
export default async function Page() {
|
||||
return <>
|
||||
<SplashScreen/>
|
||||
</>
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Validasi } from "@/app_modules/auth";
|
||||
import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let kodeId = params.id;
|
||||
const dataOtp = await auth_getCodeOtpByNumber({ kodeId: kodeId });
|
||||
|
||||
return <Validasi dataOtp={dataOtp as any} />;
|
||||
}
|
||||
5
src/app/(user)/validasi/page.tsx
Normal file
5
src/app/(user)/validasi/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Validasi } from "@/app_modules/auth";
|
||||
|
||||
export default async function Page() {
|
||||
return <Validasi />;
|
||||
}
|
||||
19
src/app/(user)/waiting-room/page.tsx
Normal file
19
src/app/(user)/waiting-room/page.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { funGlobal_checkActivationUseById } from "@/app_modules/_global/fun/get/fun_check_activation_use_by_id";
|
||||
import WaitingRoom_View from "@/app_modules/waiting_room/view";
|
||||
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const activationUser = await funGlobal_checkActivationUseById({
|
||||
userId: userLoginId as string,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<WaitingRoom_View
|
||||
activationUser={activationUser as boolean}
|
||||
userLoginId={userLoginId as string}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
21
src/app/api/auth/check/route.ts
Normal file
21
src/app/api/auth/check/route.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { data } from "autoprefixer";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
const id = searchParams.get("id");
|
||||
|
||||
try {
|
||||
const data = await prisma.kodeOtp.findFirst({
|
||||
where: {
|
||||
id: id as string,
|
||||
},
|
||||
});
|
||||
return new Response(JSON.stringify({ data }), { status: 200 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify({ data: null }), { status: 404 });
|
||||
}
|
||||
@@ -1,31 +1,64 @@
|
||||
|
||||
|
||||
import { prisma } from "@/app/lib";
|
||||
import { randomOTP } from "@/app_modules/auth/fun/rondom_otp";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
const codeOtp = randomOTP();
|
||||
const body = await req.json();
|
||||
// console.log(body);
|
||||
const { nomor } = body;
|
||||
|
||||
if (body.nomor === "1234567890") {
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
status: 200,
|
||||
message: "Login Success",
|
||||
});
|
||||
} else {
|
||||
try {
|
||||
await fetch(
|
||||
`https://wa.wibudev.com/code?nom=${body.nomor}&text=Masukan Kode OTP:${body.otp}`
|
||||
try {
|
||||
const res = await fetch(
|
||||
`https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
|
||||
\n
|
||||
>> Kode OTP anda: ${codeOtp}.
|
||||
`
|
||||
);
|
||||
|
||||
const sendWa = await res.json();
|
||||
if (sendWa.status !== "success")
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Nomor Whatsapp Tidak Aktif",
|
||||
}),
|
||||
{ status: 400 }
|
||||
);
|
||||
return NextResponse.json({
|
||||
body,
|
||||
status: 200,
|
||||
message: "Login Success",
|
||||
});
|
||||
} catch (error) {
|
||||
return NextResponse.json({ status: 500, message: "Server Error !!!" });
|
||||
}
|
||||
|
||||
const createOtpId = await prisma.kodeOtp.create({
|
||||
data: {
|
||||
nomor: nomor,
|
||||
otp: codeOtp,
|
||||
},
|
||||
});
|
||||
|
||||
if (!createOtpId)
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Gagal Membuat Kode OTP",
|
||||
}),
|
||||
{ status: 400 }
|
||||
);
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
message: "Kode Verifikasi Dikirim",
|
||||
kodeId: createOtpId.id,
|
||||
}),
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Server Whatsapp Error !!",
|
||||
}),
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
return NextResponse.json({ success: false });
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse } from "next/server";
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
const id = searchParams.get("id");
|
||||
|
||||
export async function GET() {
|
||||
cookies().set({
|
||||
name: "mySession",
|
||||
value: "",
|
||||
maxAge: 0,
|
||||
});
|
||||
const delToken = await prisma.userSession.delete({
|
||||
where: {
|
||||
userId: id as string,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({ status: 200, message: "Logout" });
|
||||
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
||||
return new Response(JSON.stringify({ success: true, message: "Logout Berhasil" }), {status: 200});
|
||||
}
|
||||
|
||||
// import { cookies } from "next/headers";
|
||||
// import { NextResponse } from "next/server";
|
||||
|
||||
// export async function GET() {
|
||||
// cookies().set({
|
||||
// name: "mySession",
|
||||
// value: "",
|
||||
// maxAge: 0,
|
||||
// });
|
||||
|
||||
// return NextResponse.json({ status: 200, message: "Logout" });
|
||||
// }
|
||||
|
||||
@@ -1,51 +1,69 @@
|
||||
import { sessionCreate } from "@/app/auth/_lib/session_create";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { ServerEnv } from "@/app/lib/server_env";
|
||||
import { sealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
const body = await req.json();
|
||||
// MyConsole(body);
|
||||
const { data } = await req.json();
|
||||
|
||||
const cekUsername = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: body.username,
|
||||
username: data.username,
|
||||
},
|
||||
});
|
||||
|
||||
if (cekUsername)
|
||||
return NextResponse.json({ status: 400, message: "Username sudah ada" });
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Username sudah digunakan",
|
||||
}),
|
||||
{ status: 400 }
|
||||
);
|
||||
|
||||
const data = await prisma.user.create({
|
||||
const createUser = await prisma.user.create({
|
||||
data: {
|
||||
username: body.username,
|
||||
nomor: body.nomor,
|
||||
username: data.username,
|
||||
nomor: data.nomor,
|
||||
},
|
||||
});
|
||||
|
||||
if (data) {
|
||||
const seal = await sealData(
|
||||
JSON.stringify({
|
||||
id: data.id,
|
||||
username: data.username,
|
||||
}),
|
||||
{
|
||||
password: ServerEnv.value?.WIBU_PWD as string,
|
||||
}
|
||||
);
|
||||
const token = await sessionCreate({
|
||||
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||
user: createUser as any,
|
||||
});
|
||||
|
||||
cookies().set({
|
||||
name: "mySession",
|
||||
value: seal,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
try {
|
||||
const createUserSession = await prisma.userSession.create({
|
||||
data: {
|
||||
token: token as string,
|
||||
userId: createUser.id,
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({ status: 201 });
|
||||
if (!createUserSession)
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Gagal Membuat Session",
|
||||
}),
|
||||
{ status: 400 }
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
message: "Berhasil Login",
|
||||
}),
|
||||
|
||||
{ status: 200 }
|
||||
);
|
||||
}
|
||||
return NextResponse.json({ success: false });
|
||||
return new Response(
|
||||
JSON.stringify({ success: false, message: "Method Not Allowed" }),
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
65
src/app/api/auth/resend/route.ts
Normal file
65
src/app/api/auth/resend/route.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { randomOTP } from "@/app_modules/auth/fun/rondom_otp";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
const codeOtp = randomOTP();
|
||||
const body = await req.json();
|
||||
const { nomor } = body;
|
||||
|
||||
try {
|
||||
const res = await fetch(
|
||||
`https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
|
||||
\n
|
||||
>> Kode OTP anda: ${codeOtp}.
|
||||
`
|
||||
);
|
||||
|
||||
const sendWa = await res.json();
|
||||
if (sendWa.status !== "success")
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Nomor Whatsapp Tidak Aktif",
|
||||
}),
|
||||
{ status: 400 }
|
||||
);
|
||||
|
||||
const createOtpId = await prisma.kodeOtp.create({
|
||||
data: {
|
||||
nomor: nomor,
|
||||
otp: codeOtp,
|
||||
},
|
||||
});
|
||||
|
||||
if (!createOtpId)
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Gagal Membuat Kode OTP",
|
||||
}),
|
||||
{ status: 400 }
|
||||
);
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
message: "Kode Verifikasi Dikirim",
|
||||
kodeId: createOtpId.id,
|
||||
}),
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: false,
|
||||
message: "Server Whatsapp Error !!",
|
||||
}),
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
return NextResponse.json({ success: false });
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { sessionCreate } from "@/app/auth/_lib/session_create";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { ServerEnv } from "@/app/lib/server_env";
|
||||
import { sealData } from "iron-session";
|
||||
@@ -7,45 +8,100 @@ import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
const body = await req.json();
|
||||
const { nomor } = await req.json();
|
||||
|
||||
const data = await prisma.user.findUnique({
|
||||
const dataUser = await prisma.user.findUnique({
|
||||
where: {
|
||||
nomor: body.nomor,
|
||||
nomor: nomor,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
nomor: true,
|
||||
username: true,
|
||||
active: true,
|
||||
masterUserRoleId: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!data) return NextResponse.json({ status: 404 });
|
||||
|
||||
if (data) {
|
||||
const res = await sealData(
|
||||
JSON.stringify({
|
||||
id: data.id,
|
||||
username: data.username,
|
||||
}),
|
||||
{
|
||||
password: ServerEnv.value?.WIBU_PWD as string,
|
||||
}
|
||||
if (dataUser === null)
|
||||
return new Response(
|
||||
JSON.stringify({ success: false, message: "Nomor Belum Terdaftar" }),
|
||||
{ status: 404 }
|
||||
);
|
||||
|
||||
cookies().set({
|
||||
name: "mySession",
|
||||
value: res,
|
||||
maxAge: 60 * 60 * 24 * 7,
|
||||
const token = await sessionCreate({
|
||||
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||
user: dataUser as any,
|
||||
});
|
||||
|
||||
const cekSessionUser = await prisma.userSession.findFirst({
|
||||
where: {
|
||||
userId: dataUser.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (cekSessionUser !== null) {
|
||||
await prisma.userSession.delete({
|
||||
where: {
|
||||
userId: dataUser.id,
|
||||
},
|
||||
});
|
||||
|
||||
revalidatePath("/dev/home");
|
||||
|
||||
return NextResponse.json({ status: 200, data });
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
try {
|
||||
const createUserSession = await prisma.userSession.create({
|
||||
data: {
|
||||
token: token as string,
|
||||
userId: dataUser.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!createUserSession)
|
||||
return new Response(
|
||||
JSON.stringify({ success: false, message: "Gagal Membuat Session" }),
|
||||
{ status: 400 }
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
// if (data) {
|
||||
// const res = await sealData(
|
||||
// JSON.stringify({
|
||||
// id: data.id,
|
||||
// username: data.username,
|
||||
// }),
|
||||
// {
|
||||
// password: ServerEnv.value?.WIBU_PWD as string,
|
||||
// }
|
||||
// );
|
||||
|
||||
// cookies().set({
|
||||
// name: "mySession",
|
||||
// value: res,
|
||||
// maxAge: 60 * 60 * 24 * 7,
|
||||
// });
|
||||
|
||||
// revalidatePath("/dev/home");
|
||||
|
||||
// return NextResponse.json({ status: 200, data });
|
||||
// }
|
||||
|
||||
// return NextResponse.json({ success: true });
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
message: "Berhasil Login",
|
||||
roleId: dataUser.masterUserRoleId,
|
||||
active: dataUser.active,
|
||||
}),
|
||||
{ status: 200 }
|
||||
);
|
||||
}
|
||||
return NextResponse.json({ success: false });
|
||||
return new Response(
|
||||
JSON.stringify({ success: false, message: "Method Not Allowed" }),
|
||||
{ status: 405 }
|
||||
);
|
||||
}
|
||||
|
||||
7
src/app/api/validasi/route.ts
Normal file
7
src/app/api/validasi/route.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export async function GET(req: Request) {
|
||||
const auth = req.headers.get("Authorization");
|
||||
const token = auth?.split(" ")[1];
|
||||
if (!token)
|
||||
return new Response(JSON.stringify({ success: false }), { status: 401 });
|
||||
return new Response(JSON.stringify({ success: true }));
|
||||
}
|
||||
22
src/app/auth/_lib/decrypt.ts
Normal file
22
src/app/auth/_lib/decrypt.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { jwtVerify } from "jose";
|
||||
|
||||
export async function decrypt({
|
||||
token,
|
||||
encodedKey,
|
||||
}: {
|
||||
token: string;
|
||||
encodedKey: string;
|
||||
}): Promise<Record<string, any> | null> {
|
||||
try {
|
||||
const enc = new TextEncoder().encode(encodedKey);
|
||||
const { payload } = await jwtVerify(token, enc, {
|
||||
algorithms: ["HS256"],
|
||||
});
|
||||
return (payload.user as Record<string, any>) || null;
|
||||
} catch (error) {
|
||||
console.error("Gagal verifikasi session", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// wibu:0.2.82
|
||||
25
src/app/auth/_lib/encrypt.ts
Normal file
25
src/app/auth/_lib/encrypt.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { SignJWT } from "jose";
|
||||
|
||||
export async function encrypt({
|
||||
user,
|
||||
exp = "7 year",
|
||||
encodedKey,
|
||||
}: {
|
||||
user: Record<string, any>;
|
||||
exp?: string;
|
||||
encodedKey: string;
|
||||
}): Promise<string | null> {
|
||||
try {
|
||||
const enc = new TextEncoder().encode(encodedKey);
|
||||
return new SignJWT({ user })
|
||||
.setProtectedHeader({ alg: "HS256" })
|
||||
.setIssuedAt()
|
||||
.setExpirationTime(exp)
|
||||
.sign(enc);
|
||||
} catch (error) {
|
||||
console.error("Gagal mengenkripsi", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// wibu:0.2.82
|
||||
35
src/app/auth/_lib/session_create.ts
Normal file
35
src/app/auth/_lib/session_create.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { encrypt } from "./encrypt";
|
||||
|
||||
export async function sessionCreate({
|
||||
sessionKey,
|
||||
exp = "7 year",
|
||||
encodedKey,
|
||||
user,
|
||||
}: {
|
||||
sessionKey: string;
|
||||
exp?: string;
|
||||
encodedKey: string;
|
||||
user: Record<string, unknown>;
|
||||
}) {
|
||||
const token = await encrypt({
|
||||
exp,
|
||||
encodedKey,
|
||||
user,
|
||||
});
|
||||
|
||||
const cookie: any = {
|
||||
key: sessionKey,
|
||||
value: token,
|
||||
options: {
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
path: "/",
|
||||
},
|
||||
};
|
||||
|
||||
cookies().set(cookie.key, cookie.value, { ...cookie.options });
|
||||
return token;
|
||||
}
|
||||
|
||||
// wibu:0.2.82
|
||||
27
src/app/auth/api/login/route.ts
Normal file
27
src/app/auth/api/login/route.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { prisma } from "@/app/lib";
|
||||
import { sessionCreate } from "../../_lib/session_create";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
nomor: "6281339158911",
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
nomor: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!user)
|
||||
return new Response(
|
||||
JSON.stringify({ success: false, message: "User not found" }), {status: 404}
|
||||
);
|
||||
|
||||
const token = await sessionCreate({
|
||||
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||
user: user as any,
|
||||
});
|
||||
|
||||
return new Response(JSON.stringify({ success: true, token }));
|
||||
}
|
||||
5
src/app/auth/api/logout/route.ts
Normal file
5
src/app/auth/api/logout/route.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { cookies } from "next/headers";
|
||||
export async function GET() {
|
||||
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
||||
return new Response(JSON.stringify({ success: true }));
|
||||
}
|
||||
39
src/app/auth/login/page.tsx
Normal file
39
src/app/auth/login/page.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
"use client";
|
||||
import { Button } from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Page() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
|
||||
async function login() {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch("/auth/api/login", {
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
const dataText = await res.text();
|
||||
|
||||
if (!res.ok) {
|
||||
console.error(dataText);
|
||||
throw new Error(res.statusText);
|
||||
}
|
||||
|
||||
const dataJson = JSON.parse(dataText);
|
||||
console.log(dataJson);
|
||||
// window.location.replace("/dev/home");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Button loading={loading} onClick={login}>
|
||||
Login
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import { redirect } from "next/navigation";
|
||||
export default async function Page() {
|
||||
const version = versionUpdate.version;
|
||||
|
||||
const checkCookies = await funCheckCookies();
|
||||
console.log(checkCookies, "ini halaman login");
|
||||
if (!checkCookies) return redirect("/");
|
||||
// const checkCookies = await funCheckCookies();
|
||||
// console.log(checkCookies, "ini halaman login");
|
||||
// if (!checkCookies) return redirect("/");
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -4,5 +4,5 @@ import { auth_getCodeOtpByNumber } from "@/app_modules/auth/fun/get_kode_otp_by_
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let otpId = params.id;
|
||||
const dataOtp = await auth_getCodeOtpByNumber({ kodeId: otpId });
|
||||
return <Register dataOtp={dataOtp} />;
|
||||
return <Register />;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SplashScreen } from "@/app_modules/auth";
|
||||
export default async function PageSplash() {
|
||||
return (
|
||||
<>
|
||||
<SplashScreen checkCookies/>
|
||||
<SplashScreen />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,5 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
let kodeId = params.id;
|
||||
const dataOtp = await auth_getCodeOtpByNumber({ kodeId: kodeId });
|
||||
|
||||
|
||||
return <Validasi dataOtp={dataOtp as any} />;
|
||||
return <Validasi />;
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ import { CheckCookies_UiView } from "@/app_modules/check_cookies";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Page() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const dataUser = await funGlobal_getUserById({ userId: userLoginId });
|
||||
// const userLoginId = await funGetUserIdByToken();
|
||||
// const dataUser = await funGlobal_getUserById({ userId: userLoginId });
|
||||
|
||||
if (dataUser?.masterUserRoleId === "1") {
|
||||
return redirect(RouterHome.main_home);
|
||||
}
|
||||
// if (dataUser?.masterUserRoleId === "1") {
|
||||
// return redirect(RouterHome.main_home);
|
||||
// }
|
||||
|
||||
if (dataUser?.masterUserRoleId !== "1") {
|
||||
return redirect(RouterAdminDashboard.splash_admin);
|
||||
}
|
||||
// if (dataUser?.masterUserRoleId !== "1") {
|
||||
// return redirect(RouterAdminDashboard.splash_admin);
|
||||
// }
|
||||
|
||||
// return <CheckCookies_UiView />;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
page: 1,
|
||||
});
|
||||
|
||||
dataPosting?.isActive === false && redirect(RouterForum.beranda);
|
||||
// dataPosting?.isActive === false && redirect(RouterForum.beranda);
|
||||
|
||||
const countKomentar = await forum_countTotalKomenById(postingId);
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { HomeView } from "@/app_modules/home";
|
||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import { job_getTwoForHomeView } from "@/app_modules/job/fun/get/get_two_for_home_view";
|
||||
import notifikasi_countUserNotifikasi from "@/app_modules/notifikasi/fun/count/fun_count_by_id";
|
||||
|
||||
export default async function Page() {
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function PageHome() {
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
const dataUser = await user_getOneByUserId(userLoginId as string);
|
||||
const dataJob = await job_getTwoForHomeView();
|
||||
@@ -16,8 +20,8 @@ export default async function Page() {
|
||||
// if (dataUser?.active === false) {
|
||||
// return redirect(RouterHome.home_user_non_active);
|
||||
// }
|
||||
// if (dataUser?.masterUserRoleId === "2" || dataUser?.masterUserRoleId === "3")
|
||||
// return redirect(RouterAdminDashboard.splash_admin);
|
||||
if (dataUser?.masterUserRoleId === "2" || dataUser?.masterUserRoleId === "3")
|
||||
return redirect(RouterAdminDashboard.main_admin);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { funCheckCookies } from "@/app_modules/_global/fun/get/fun_check_cookies";
|
||||
import { permanentRedirect, redirect } from "next/navigation";
|
||||
import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
|
||||
import { redirect } from "next/navigation";
|
||||
import { RealtimeProvider } from "../lib";
|
||||
import { ServerEnv } from "../lib/server_env";
|
||||
import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
|
||||
import { RouterHome } from "../lib/router_hipmi/router_home";
|
||||
import { CheckCookies_UiLayout } from "@/app_modules/check_cookies";
|
||||
import { RouterAdminDashboard } from "../lib/router_hipmi/router_admin";
|
||||
import { funGlobal_checkActivationUseById } from "@/app_modules/_global/fun/get/fun_check_activation_use_by_id";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const checkCookies = await funCheckCookies();
|
||||
const userLoginId = await funGetUserIdByToken();
|
||||
if (!checkCookies) return redirect("/");
|
||||
|
||||
// const dataUser = await funGlobal_getUserById({ userId: userLoginId });
|
||||
// console.log(dataUser?.active, dataUser?.username, "ini di layout");
|
||||
|
||||
// if(dataUser?.active == false) return permanentRedirect(RouterHome.home_user_non_active);
|
||||
// const WIBU_REALTIME_TOKEN = process.env.NEXT_PUBLIC_WIBU_REALTIME_TOKEN;
|
||||
// console.log(WIBU_REALTIME_TOKEN, "check cookies di layout dalam");
|
||||
|
||||
const activationUser = await funGlobal_checkActivationUseById({
|
||||
userId: userLoginId as string,
|
||||
});
|
||||
console.log(activationUser, "ini di layout");
|
||||
if (activationUser == false) return redirect("/waiting-room");
|
||||
|
||||
return (
|
||||
<>
|
||||
<RealtimeProvider
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Home_UserNonActive } from "@/app_modules/home";
|
||||
// import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -16,7 +16,7 @@ export default async function Layout({
|
||||
<>
|
||||
<LayoutVote_DetailSemuaRiwayat
|
||||
votingId={votingId}
|
||||
userLoginId={userLoginId}
|
||||
userLoginId={userLoginId as string}
|
||||
>
|
||||
{children}
|
||||
</LayoutVote_DetailSemuaRiwayat>
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import MqttLoader from "@/util/mqtt_loader";
|
||||
import RootStyleRegistry from "./emotion";
|
||||
// import "./globals.css";
|
||||
import { TokenProvider } from "./lib/token";
|
||||
import dotenv from "dotenv";
|
||||
import { ServerEnv } from "./lib/server_env";
|
||||
import { RealtimeProvider } from "./lib";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { funCheckCookies } from "@/app_modules/_global/fun/get/fun_check_cookies";
|
||||
import { redirect } from "next/navigation";
|
||||
import { TokenProvider } from "./lib/token";
|
||||
dotenv.config({
|
||||
path: ".env",
|
||||
});
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
import { funCheckCookies } from "@/app_modules/_global/fun/get/fun_check_cookies";
|
||||
import PageSplash from "./dev/auth/splash/page";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Login, SplashScreen } from "@/app_modules/auth";
|
||||
import { RouterAuth } from "./lib/router_hipmi/router_auth";
|
||||
import versionUpdate from "../../package.json";
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { funGlobal_getUserById } from "@/app_modules/_global/fun/get/fun_get_user_by_id";
|
||||
import { RouterHome } from "./lib/router_hipmi/router_home";
|
||||
import { RouterAdminDashboard } from "./lib/router_hipmi/router_admin";
|
||||
|
||||
export default async function Page() {
|
||||
const version = versionUpdate.version;
|
||||
|
||||
const checkCookies = await funCheckCookies();
|
||||
// console.log(checkCookies, "ini check cookies di page awal");
|
||||
if (checkCookies) return redirect("/dev/check-cookies");
|
||||
return redirect("/login");
|
||||
// const WIBU_REALTIME_TOKEN = process.env.NEXT_PUBLIC_WIBU_REALTIME_TOKEN;
|
||||
|
||||
// return <Login version={version} />;
|
||||
// return <SplashScreen checkCookies={checkCookies} />;
|
||||
return <PageSplash />;
|
||||
return redirect("/dev/home");
|
||||
// return <PageSplash />;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
"use server";
|
||||
|
||||
import { prisma } from "@/app/lib";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import { permanentRedirect } from "next/navigation";
|
||||
|
||||
export async function funGlobal_checkActivationUseById({
|
||||
userId,
|
||||
}: {
|
||||
userId: string;
|
||||
}) {
|
||||
const data = await prisma.user.findFirst({
|
||||
where: {
|
||||
id: userId,
|
||||
},
|
||||
select: {
|
||||
active: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data?.active;
|
||||
}
|
||||
@@ -1,26 +1,27 @@
|
||||
"use server";
|
||||
|
||||
import { prisma } from "@/app/lib";
|
||||
import { ServerEnv } from "@/app/lib/server_env";
|
||||
import { unsealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export async function funGetUserIdByToken() {
|
||||
const c = cookies().get("mySession");
|
||||
const c = cookies().get(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
||||
|
||||
const token = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
password: process.env.WIBU_PWD as string,
|
||||
})
|
||||
);
|
||||
// const token = JSON.parse(
|
||||
// await unsealData(c?.value as string, {
|
||||
// password: process.env.WIBU_PWD as string,
|
||||
// })
|
||||
// );
|
||||
// return token.id;
|
||||
|
||||
return token.id;
|
||||
// const token = c?.value
|
||||
// const cekToken = await prisma.userSession.findFirst({
|
||||
// where: {
|
||||
// token: token,
|
||||
// },
|
||||
// });
|
||||
const token = c?.value
|
||||
const cekToken = await prisma.userSession.findFirst({
|
||||
where: {
|
||||
token: token,
|
||||
},
|
||||
});
|
||||
|
||||
// if (cekToken === null) return null
|
||||
// return cekToken.userId;
|
||||
return cekToken?.userId
|
||||
}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import { AccentColor } from "@/app_modules/_global/color";
|
||||
import {
|
||||
ComponentGlobal_NotifikasiBerhasil,
|
||||
ComponentGlobal_NotifikasiPeringatan,
|
||||
} from "@/app_modules/_global/notif_global";
|
||||
import { auth_Logout } from "@/app_modules/auth/fun/fun_logout";
|
||||
import { gs_kodeId } from "@/app_modules/auth/state/state";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global";
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import {
|
||||
ActionIcon,
|
||||
@@ -25,7 +19,6 @@ import {
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconPhone, IconUser, IconUserCircle } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -38,21 +31,18 @@ export function Admin_ComponentButtonUserCircle({
|
||||
const [isOpenMenuUser, setOpenMenuUser] = useState(false);
|
||||
const [openPop, setOpenPop] = useState(false);
|
||||
const [openModal, setOpenModal] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [kodeId, setKodeId] = useAtom(gs_kodeId);
|
||||
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||
|
||||
async function onClickLogout() {
|
||||
const res = await auth_Logout();
|
||||
setLoadingLogout(true);
|
||||
const res = await fetch(`/api/auth/logout?id=${dataUser.id}`, {
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
if (res.status === 200) {
|
||||
console.log(res);
|
||||
setLoadingLogout(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
setKodeId("");
|
||||
setOpenModal(false);
|
||||
router.push(RouterAuth.login, { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/", { scroll: false });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +104,6 @@ export function Admin_ComponentButtonUserCircle({
|
||||
<Button
|
||||
onClick={() => {
|
||||
setOpenModal(false);
|
||||
setLoading(false);
|
||||
}}
|
||||
radius={50}
|
||||
>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { gs_admin_ntf } from "@/app/lib/global_state";
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Button,
|
||||
Divider,
|
||||
Drawer,
|
||||
Grid,
|
||||
@@ -18,8 +19,10 @@ import {
|
||||
import { useMediaQuery, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconBell } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { AccentColor } from "../_global/color";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "../_global/notif_global";
|
||||
import { MODEL_USER } from "../home/model/interface";
|
||||
import { MODEL_NOTIFIKASI } from "../notifikasi/model/interface";
|
||||
import {
|
||||
@@ -47,6 +50,7 @@ export function Admin_NewLayout({
|
||||
listNotifikasi: MODEL_NOTIFIKASI[];
|
||||
version: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const matches = useMediaQuery("(min-width: 1024px)");
|
||||
const [dataUser, setDataUser] = useState(user);
|
||||
const userRoleId = dataUser.masterUserRoleId;
|
||||
@@ -72,6 +76,20 @@ export function Admin_NewLayout({
|
||||
setDrawerNotifikasi(true);
|
||||
}
|
||||
|
||||
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||
async function onClickLogout() {
|
||||
setLoadingLogout(true);
|
||||
const res = await fetch(`/api/auth/logout?id=${user.id}`, {
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/", { scroll: false });
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
@@ -168,6 +186,7 @@ export function Admin_NewLayout({
|
||||
<Title order={4} align="center">
|
||||
View Only Available For Desktop
|
||||
</Title>
|
||||
<Button onClick={() => onClickLogout()}>Logout</Button>
|
||||
</Stack>
|
||||
) : (
|
||||
children
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function auth_funDeleteAktivasiKodeOtpById({
|
||||
export async function auth_funDeleteAktivasiKodeOtpByNomor({
|
||||
nomor,
|
||||
}: {
|
||||
nomor: string;
|
||||
}) {
|
||||
// console.log(otpId);
|
||||
|
||||
|
||||
|
||||
const updt = await prisma.kodeOtp.deleteMany({
|
||||
where: {
|
||||
nomor: nomor,
|
||||
|
||||
@@ -2,12 +2,12 @@ import SplashScreen from "./splash/view";
|
||||
import Login from "./login/view";
|
||||
import Validasi from "./validasi/view";
|
||||
import Register from "./register/view";
|
||||
import Component_Logout from "./logout/view";
|
||||
import Component_ButtonLogout from "./logout/view";
|
||||
|
||||
export {
|
||||
SplashScreen,
|
||||
Login,
|
||||
Validasi,
|
||||
Register,
|
||||
Component_Logout as Logout,
|
||||
Component_ButtonLogout as Logout,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
@@ -8,10 +7,10 @@ import {
|
||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||
import {
|
||||
ComponentGlobal_NotifikasiBerhasil,
|
||||
ComponentGlobal_NotifikasiGagal,
|
||||
ComponentGlobal_NotifikasiPeringatan,
|
||||
} from "@/app_modules/_global/notif_global";
|
||||
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
||||
import { auth_funLogin } from "@/app_modules/auth/fun/fun_login";
|
||||
import { Box, Button, Center, Stack, Text, Title } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -28,23 +27,28 @@ export default function Login({ version }: { version: string }) {
|
||||
const nomor = phone.substring(1);
|
||||
if (nomor.length <= 4) return setError(true);
|
||||
|
||||
const res = await auth_funLogin({ nomor: nomor });
|
||||
if (res.status === 200) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
||||
// router.push(RouterAuth.validasi + res.kodeId, { scroll: false });
|
||||
router.push("/validasi/" + res.kodeId, { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
}
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch("/api/auth/login", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ nomor: nomor }),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
// await fetch(ApiHipmi.login, {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// body: JSON.stringify(body),
|
||||
// })
|
||||
const result = await res.json();
|
||||
if (res.status === 200) {
|
||||
localStorage.setItem("hipmi_auth_code_id", result.kodeId);
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message, 2000);
|
||||
router.push("/validasi", { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(result.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ComponentGlobal_NotifikasiGagal("Terjadi Kesalahan");
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -96,16 +100,11 @@ export default function Login({ version }: { version: string }) {
|
||||
|
||||
<Box pos={"fixed"} bottom={10}>
|
||||
<Text fw={"bold"} c={"white"} fs={"italic"} fz={"xs"}>
|
||||
V.{version}
|
||||
v {version}
|
||||
</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</UIGlobal_LayoutDefault>
|
||||
{/* <BackgroundImage
|
||||
src={"/aset/global/main_background.png"}
|
||||
h={"100vh"}
|
||||
// pos={"static"}
|
||||
></BackgroundImage> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,18 +11,21 @@ import { useState } from "react";
|
||||
import { auth_Logout } from "../fun/fun_logout";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
|
||||
export default function Component_Logout() {
|
||||
export default function Component_ButtonLogout({userId}: {userId: string}) {
|
||||
const router = useRouter();
|
||||
const [opened, setOpened] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onClickLogout() {
|
||||
const res = await auth_Logout();
|
||||
setLoading(true);
|
||||
const res = await fetch(`/api/auth/logout?id=${userId}`, {
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push("/login", { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/", { scroll: false });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +52,6 @@ export default function Component_Logout() {
|
||||
bg={Warna.merah}
|
||||
color="red"
|
||||
onClick={() => {
|
||||
setLoading(true);
|
||||
onClickLogout();
|
||||
}}
|
||||
>
|
||||
|
||||
19
src/app_modules/auth/register/skeleton.tsx
Normal file
19
src/app_modules/auth/register/skeleton.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Stack, Skeleton } from "@mantine/core";
|
||||
|
||||
export default function Register_SkeletonView() {
|
||||
return (
|
||||
<>
|
||||
<Stack h={"100vh"} align="center" justify="center" spacing={50}>
|
||||
<Skeleton h={30} w={250} radius={"xl"} />
|
||||
|
||||
<Skeleton h={100} w={100} radius={"50%"} />
|
||||
|
||||
<Stack spacing={"sm"}>
|
||||
<Skeleton h={20} w={300} radius={"xl"} />
|
||||
<Skeleton h={50} w={300} radius={"sm"} />
|
||||
<Skeleton h={50} w={300} radius={"sm"} />
|
||||
</Stack>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
import { GlobalEnv } from "@/app/lib/token";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
MainColor
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
@@ -12,65 +9,95 @@ import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/noti
|
||||
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
||||
import {
|
||||
Button,
|
||||
Center,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Title
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconUserCircle } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { auth_funDeleteAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
||||
import { Auth_funRegister } from "../fun/fun_register";
|
||||
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
||||
import Register_SkeletonView from "./skeleton";
|
||||
|
||||
export default function Register({ dataOtp }: { dataOtp: any }) {
|
||||
export default function Register() {
|
||||
const router = useRouter();
|
||||
const [nomor, setNomor] = useState(dataOtp.nomor);
|
||||
const [nomor, setNomor] = useState("");
|
||||
const [value, setValue] = useState("");
|
||||
const [isValue, setIsValue] = useState(false);
|
||||
const focusTrapRef = useFocusTrap();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
useShallowEffect(() => {
|
||||
const kodeId = localStorage.getItem("hipmi_auth_code_id");
|
||||
if (kodeId != null) {
|
||||
onCheckAuthCode({ kodeId: kodeId as string, onSetData: setNomor });
|
||||
} else {
|
||||
console.log("code id not found");
|
||||
}
|
||||
}, [setNomor]);
|
||||
|
||||
async function onCheckAuthCode({
|
||||
kodeId,
|
||||
onSetData,
|
||||
}: {
|
||||
kodeId: string;
|
||||
onSetData: any;
|
||||
}) {
|
||||
const res = await fetch(`/api/auth/check?id=${kodeId}`);
|
||||
const result = await res.json();
|
||||
|
||||
onSetData(result.data.nomor);
|
||||
}
|
||||
|
||||
async function onRegistarsi() {
|
||||
const body = {
|
||||
const data = {
|
||||
username: value,
|
||||
nomor: nomor,
|
||||
};
|
||||
|
||||
if (body.username === "") {
|
||||
setIsValue(true);
|
||||
return null;
|
||||
}
|
||||
if (body.username.length < 5) return null;
|
||||
if (_.values(body.username).includes(" ")) return null;
|
||||
|
||||
const res = await Auth_funRegister({
|
||||
data: body,
|
||||
HIPMI_PWD: GlobalEnv.value?.WIBU_PWD as string,
|
||||
});
|
||||
if (res.status === 200) {
|
||||
await auth_funDeleteAktivasiKodeOtpById({ nomor: nomor }).then((val) => {
|
||||
if (val.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoading(true);
|
||||
router.push(RouterHome.main_home, { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(val.message);
|
||||
}
|
||||
try {
|
||||
setLoading(true);
|
||||
const res = await fetch("/api/auth/register", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
data,
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
|
||||
const result = await res.json();
|
||||
|
||||
if (res.status === 200) {
|
||||
localStorage.removeItem("hipmi_auth_code_id");
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/waiting-room", { scroll: false });
|
||||
|
||||
const resAktivasi = await auth_funDeleteAktivasiKodeOtpByNomor({
|
||||
nomor: data.nomor,
|
||||
});
|
||||
}
|
||||
|
||||
if(res.status === 400){
|
||||
setLoading(false);
|
||||
ComponentGlobal_NotifikasiPeringatan(result.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutDefault>
|
||||
<Center h={"100vh"}>
|
||||
<Stack h={"100%"} align="center" justify="center" spacing={70}>
|
||||
{nomor == "" ? (
|
||||
<Register_SkeletonView />
|
||||
) : (
|
||||
<Stack h={"100vh"} align="center" justify="center" spacing={50}>
|
||||
<Title order={2} c={MainColor.yellow}>
|
||||
REGISTRASI
|
||||
</Title>
|
||||
@@ -78,7 +105,7 @@ export default function Register({ dataOtp }: { dataOtp: any }) {
|
||||
<IconUserCircle size={100} color="white" />
|
||||
|
||||
<Stack spacing={"sm"} w={300}>
|
||||
<Text fz={10} c={"white"}>
|
||||
<Text align="center" c={"white"}>
|
||||
Anda akan terdaftar dengan nomor berikut{" "}
|
||||
<Text inherit span fw={"bold"}>
|
||||
+{nomor}
|
||||
@@ -109,6 +136,11 @@ export default function Register({ dataOtp }: { dataOtp: any }) {
|
||||
/>
|
||||
<Stack>
|
||||
<Button
|
||||
disabled={
|
||||
value === "" ||
|
||||
value.length < 5 ||
|
||||
_.values(value).includes(" ")
|
||||
}
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
radius={"md"}
|
||||
@@ -117,9 +149,6 @@ export default function Register({ dataOtp }: { dataOtp: any }) {
|
||||
c={"black"}
|
||||
bg={MainColor.yellow}
|
||||
color={"yellow"}
|
||||
style={{
|
||||
borderColor: AccentColor.yellow,
|
||||
}}
|
||||
onClick={() => {
|
||||
onRegistarsi();
|
||||
}}
|
||||
@@ -129,7 +158,7 @@ export default function Register({ dataOtp }: { dataOtp: any }) {
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Center>
|
||||
)}
|
||||
</UIGlobal_LayoutDefault>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -10,20 +10,16 @@ import { Avatar, BackgroundImage, Center, Image, Stack } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function SplashScreen({
|
||||
checkCookies,
|
||||
}: {
|
||||
checkCookies: boolean;
|
||||
}) {
|
||||
export default function SplashScreen() {
|
||||
const router = useRouter();
|
||||
|
||||
useShallowEffect(() => {
|
||||
// if (!checkCookies) return router.push(RouterAuth.login, { scroll: false });
|
||||
// onCheckUser();
|
||||
|
||||
// setTimeout(() => {
|
||||
// router.push(RouterAuth.login, { scroll: false });
|
||||
// }, 1000);
|
||||
setTimeout(() => {
|
||||
router.push("/login", { scroll: false });
|
||||
}, 1000);
|
||||
// if (!userLoginId) {
|
||||
// setTimeout(() => {
|
||||
// router.push(RouterAuth.login, { scroll: false });
|
||||
|
||||
25
src/app_modules/auth/validasi/skeleton.tsx
Normal file
25
src/app_modules/auth/validasi/skeleton.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Stack, Skeleton, Group } from "@mantine/core";
|
||||
|
||||
export default function Validasi_SkeletonView() {
|
||||
return (
|
||||
<>
|
||||
<Stack align="center" justify="center" h={"100vh"} spacing={50}>
|
||||
<Skeleton h={30} w={250} radius={"xl"} />
|
||||
<Stack>
|
||||
<Skeleton h={20} w={250} radius={"xl"} />
|
||||
<Skeleton h={20} w={250} radius={"xl"} />
|
||||
</Stack>
|
||||
|
||||
<Group>
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<Skeleton key={i} h={50} w={50} radius={"sm"} />
|
||||
))}
|
||||
</Group>
|
||||
|
||||
<Skeleton h={20} w={250} radius={"xl"} />
|
||||
|
||||
<Skeleton h={50} w={250} radius={"sm"} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
import { GlobalEnv } from "@/app/lib/token";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
@@ -16,103 +14,175 @@ import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Loader,
|
||||
PinInput,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { IconChevronLeft } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { auth_funResendCode } from "../fun";
|
||||
import { auth_funDeleteAktivasiKodeOtpById } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
||||
import { auth_funValidasi } from "../fun/fun_validasi";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export default function Validasi({
|
||||
dataOtp,
|
||||
}: {
|
||||
dataOtp: Prisma.KodeOtpSelect;
|
||||
}) {
|
||||
import Validasi_SkeletonView from "./skeleton";
|
||||
import { auth_funDeleteAktivasiKodeOtpByNomor } from "../fun/fun_edit_aktivasi_kode_otp_by_id";
|
||||
import { IconChevronLeft } from "@tabler/icons-react";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global";
|
||||
import { auth_funResendCode } from "../fun";
|
||||
|
||||
export default function Validasi() {
|
||||
const router = useRouter();
|
||||
const nomor = dataOtp.nomor as any;
|
||||
const code = dataOtp.otp as any;
|
||||
const [inputCode, setInputOtp] = useState("");
|
||||
const focusTrapRef = useFocusTrap();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [counter, setCounter] = useState(7);
|
||||
const [loadingResend, setLoadingResend] = useState(false);
|
||||
const [triggerOtp, setTriggerOtp] = useState(false);
|
||||
|
||||
const [counter, setCounter] = useState(60);
|
||||
const [data, setData] = useState({
|
||||
nomor: "",
|
||||
code: "",
|
||||
});
|
||||
|
||||
useShallowEffect(() => {
|
||||
const kodeId = localStorage.getItem("hipmi_auth_code_id");
|
||||
if (kodeId != null) {
|
||||
onCheckAuthCode({ kodeId: kodeId as string, onSetData: setData });
|
||||
} else {
|
||||
console.log("code id not found");
|
||||
}
|
||||
|
||||
if (triggerOtp) {
|
||||
const kodeId = localStorage.getItem("hipmi_auth_code_id");
|
||||
if (kodeId != null) {
|
||||
onCheckAuthCode({ kodeId: kodeId as string, onSetData: setData });
|
||||
} else {
|
||||
console.log("code id not found");
|
||||
}
|
||||
setTriggerOtp(false);
|
||||
}
|
||||
}, [triggerOtp, setData, setTriggerOtp]);
|
||||
|
||||
async function onCheckAuthCode({
|
||||
kodeId,
|
||||
onSetData,
|
||||
}: {
|
||||
kodeId: string;
|
||||
onSetData: any;
|
||||
}) {
|
||||
const res = await fetch(`/api/auth/check?id=${kodeId}`);
|
||||
const result = await res.json();
|
||||
|
||||
onSetData({
|
||||
nomor: result.data.nomor,
|
||||
code: result.data.otp,
|
||||
});
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
counter > 0 && setTimeout(() => setCounter(counter - 1), 1000);
|
||||
}, [counter]);
|
||||
|
||||
async function onVerifikasi() {
|
||||
if (!inputCode)
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Kode");
|
||||
if (code != inputCode)
|
||||
if (data.code != inputCode)
|
||||
return ComponentGlobal_NotifikasiPeringatan("Kode Salah");
|
||||
|
||||
const res = await auth_funValidasi({
|
||||
nomor: nomor,
|
||||
HIPMI_PWD: GlobalEnv.value?.WIBU_PWD as string,
|
||||
});
|
||||
if (res.status === 200) {
|
||||
const resAktivasi = await auth_funDeleteAktivasiKodeOtpById(
|
||||
dataOtp.id as any
|
||||
);
|
||||
if (resAktivasi.status === 200) {
|
||||
if (res.role === "1") {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoading(true);
|
||||
router.push(RouterHome.main_home, { scroll: false });
|
||||
try {
|
||||
setLoading(true);
|
||||
const res = await fetch("/api/auth/validasi", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
nomor: data.nomor,
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
|
||||
if (res.status === 200) {
|
||||
localStorage.removeItem("hipmi_auth_code_id");
|
||||
|
||||
if (result.roleId === "1") {
|
||||
if (result.active === true) {
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push(RouterHome.main_home, { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/waiting-room", { scroll: false });
|
||||
}
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiBerhasil("Admin Logged in");
|
||||
setLoading(true);
|
||||
router.push(RouterAdminDashboard.splash_admin, { scroll: false });
|
||||
}
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(resAktivasi.message);
|
||||
}
|
||||
}
|
||||
|
||||
if (res.status === 400) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push("/register/" + dataOtp.id, { scroll: false });
|
||||
}
|
||||
|
||||
if (res.status === 401) {
|
||||
const resAktivasi = await auth_funDeleteAktivasiKodeOtpById({
|
||||
nomor: nomor,
|
||||
});
|
||||
if (resAktivasi.status === 200) {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
router.push("/login", { scroll: false });
|
||||
const resAktivasi = await auth_funDeleteAktivasiKodeOtpByNomor({
|
||||
nomor: data.nomor,
|
||||
});
|
||||
}
|
||||
|
||||
if (res.status === 404) {
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/register", { scroll: false });
|
||||
}
|
||||
|
||||
if (res.status === 400) {
|
||||
ComponentGlobal_NotifikasiPeringatan(result.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
async function onBack() {
|
||||
await auth_funDeleteAktivasiKodeOtpById({ nomor: nomor });
|
||||
localStorage.removeItem("hipmi_auth_code_id");
|
||||
await auth_funDeleteAktivasiKodeOtpByNomor({ nomor: data.nomor });
|
||||
router.back();
|
||||
}
|
||||
|
||||
async function onResendCode() {
|
||||
const res = await auth_funResendCode({ nomor: nomor });
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message, 2000);
|
||||
router.push("/validasi/" + res.kodeId, { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
setLoadingResend(true);
|
||||
localStorage.removeItem("hipmi_auth_code_id");
|
||||
|
||||
try {
|
||||
const res = await fetch("/api/auth/resend", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ nomor: data.nomor }),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
|
||||
if (res.status === 200) {
|
||||
localStorage.setItem("hipmi_auth_code_id", result.kodeId);
|
||||
ComponentGlobal_NotifikasiBerhasil("Kode Berhasil Dikirim", 2000);
|
||||
setTriggerOtp(true);
|
||||
setCounter(7);
|
||||
setLoadingResend(false);
|
||||
// router.push("/validasi", { scroll: false });
|
||||
} else {
|
||||
setLoadingResend(false);
|
||||
ComponentGlobal_NotifikasiPeringatan(result.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setLoadingResend(false);
|
||||
ComponentGlobal_NotifikasiGagal("Terjadi Kesalahan");
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(data.code);
|
||||
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutDefault>
|
||||
<Stack h={"100vh"}>
|
||||
<Box
|
||||
{/* <Box
|
||||
pt={"md"}
|
||||
px={"md"}
|
||||
style={{
|
||||
@@ -123,70 +193,84 @@ export default function Validasi({
|
||||
<ActionIcon variant="transparent" onClick={() => onBack()}>
|
||||
<IconChevronLeft color="white" />
|
||||
</ActionIcon>
|
||||
</Box>
|
||||
</Box> */}
|
||||
{data.nomor == "" && data.code == "" ? (
|
||||
<Validasi_SkeletonView />
|
||||
) : (
|
||||
<Stack align="center" justify="center" h={"100vh"} spacing={50}>
|
||||
<Title order={2} color={MainColor.yellow}>
|
||||
Verifikasi Kode OTP
|
||||
</Title>
|
||||
|
||||
<Stack align="center" justify="center" h={"100vh"} spacing={50}>
|
||||
<Title order={2} color={MainColor.yellow}>
|
||||
Verifikasi Kode OTP
|
||||
</Title>
|
||||
|
||||
<Stack spacing={"md"} align="center">
|
||||
<Stack spacing={0} align="center">
|
||||
<Text c={"white"}>Masukan 4 digit kode otp</Text>
|
||||
<Text c={"white"}>
|
||||
Yang dikirim ke{" "}
|
||||
<Text span inherit fw={"bold"}>
|
||||
{" "}
|
||||
+{nomor}
|
||||
<Stack spacing={"md"} align="center">
|
||||
<Stack spacing={0} align="center">
|
||||
<Text c={"white"}>Masukan 4 digit kode otp</Text>
|
||||
<Text c={"white"}>
|
||||
Yang dikirim ke{" "}
|
||||
<Text span inherit fw={"bold"}>
|
||||
{" "}
|
||||
+{data.nomor}
|
||||
</Text>
|
||||
</Text>
|
||||
</Text>
|
||||
</Stack>
|
||||
<Center>
|
||||
<PinInput
|
||||
size="xl"
|
||||
type={"number"}
|
||||
ref={focusTrapRef}
|
||||
spacing={"md"}
|
||||
mt={"md"}
|
||||
onChange={(val) => {
|
||||
setInputOtp(val);
|
||||
}}
|
||||
/>
|
||||
</Center>
|
||||
|
||||
<Stack h={"5vh"} align="center" justify="center">
|
||||
<Text fs="italic" c={"white"} >
|
||||
Tidak menerima kode ?{" "}
|
||||
{counter > 0 ? (
|
||||
<Text fw={"bold"} inherit span>
|
||||
{counter + "s"}
|
||||
</Text>
|
||||
) : loadingResend ? (
|
||||
<Loader ml={"sm"} size={"xs"} color="yellow" />
|
||||
) : (
|
||||
<Text
|
||||
inherit
|
||||
span
|
||||
onClick={() => {
|
||||
onResendCode();
|
||||
}}
|
||||
fw={"bold"}
|
||||
>
|
||||
Kirim ulang
|
||||
</Text>
|
||||
)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Stack>
|
||||
<Center>
|
||||
<PinInput
|
||||
size="xl"
|
||||
type={"number"}
|
||||
ref={focusTrapRef}
|
||||
spacing={"md"}
|
||||
mt={"md"}
|
||||
onChange={(val) => {
|
||||
setInputOtp(val);
|
||||
}}
|
||||
/>
|
||||
</Center>
|
||||
|
||||
<Text fs="italic" mt={"sm"} c={"white"}>
|
||||
Tidak menerima kode ?{" "}
|
||||
{counter > 0 ? (
|
||||
<Text fw={"bold"} inherit span>
|
||||
{counter + "s"}
|
||||
</Text>
|
||||
) : (
|
||||
<Text inherit span onClick={() => onResendCode()}>
|
||||
Kirim ulang
|
||||
</Text>
|
||||
)}
|
||||
</Text>
|
||||
<Button
|
||||
w={300}
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
radius={"md"}
|
||||
compact
|
||||
h={40}
|
||||
c={"black"}
|
||||
bg={MainColor.yellow}
|
||||
color={"yellow"}
|
||||
style={{
|
||||
borderColor: AccentColor.yellow,
|
||||
}}
|
||||
onClick={() => {
|
||||
onVerifikasi();
|
||||
}}
|
||||
>
|
||||
<Text>VERIFIKASI</Text>
|
||||
</Button>
|
||||
</Stack>
|
||||
<Button
|
||||
w={300}
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
radius={"md"}
|
||||
compact
|
||||
h={40}
|
||||
c={"black"}
|
||||
bg={MainColor.yellow}
|
||||
color={"yellow"}
|
||||
style={{
|
||||
borderColor: AccentColor.yellow,
|
||||
}}
|
||||
onClick={() => {
|
||||
onVerifikasi();
|
||||
}}
|
||||
>
|
||||
<Text>VERIFIKASI</Text>
|
||||
</Button>
|
||||
</Stack>
|
||||
)}
|
||||
</Stack>
|
||||
</UIGlobal_LayoutDefault>
|
||||
</>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
||||
import { Logout } from "@/app_modules/auth";
|
||||
import Component_Logout from "@/app_modules/auth/logout/view";
|
||||
import Component_ButtonLogout from "@/app_modules/auth/logout/view";
|
||||
import { Center, Group, Skeleton, Stack, Text, Title } from "@mantine/core";
|
||||
|
||||
export default function Home_UserNotActive() {
|
||||
@@ -46,7 +45,7 @@ export default function Home_UserNotActive() {
|
||||
<Title order={4} c={"gray"}>
|
||||
Tunggu Konfirmasi Admin !
|
||||
</Title>
|
||||
<Component_Logout />
|
||||
<Component_ButtonLogout userId="" />
|
||||
</Stack>
|
||||
</Center>
|
||||
</UIGlobal_LayoutDefault>
|
||||
|
||||
@@ -32,6 +32,7 @@ export function ComponentKatalog_ButtonHeaderRight({
|
||||
opened={opened}
|
||||
close={() => close()}
|
||||
profileId={profileId}
|
||||
userId={userLoginId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
} from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||
import Component_Logout from "@/app_modules/auth/logout/view";
|
||||
import Component_ButtonLogout from "@/app_modules/auth/logout/view";
|
||||
import {
|
||||
ActionIcon,
|
||||
Drawer,
|
||||
@@ -27,10 +27,12 @@ export function ComponentKatalog_DrawerKatalog({
|
||||
opened,
|
||||
close,
|
||||
profileId,
|
||||
userId
|
||||
}: {
|
||||
opened: boolean;
|
||||
close: () => void;
|
||||
profileId: string;
|
||||
userId: string
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [pageId, setPageId] = useState("");
|
||||
@@ -121,7 +123,8 @@ export function ComponentKatalog_DrawerKatalog({
|
||||
</Text>
|
||||
</Stack>
|
||||
))}
|
||||
<Component_Logout />
|
||||
|
||||
<Component_ButtonLogout userId={userId} />
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</Drawer>
|
||||
|
||||
@@ -47,21 +47,27 @@ export function Profile_ComponentCreateNewProfile({
|
||||
"Lengkapi background profile"
|
||||
);
|
||||
|
||||
setLoading(true);
|
||||
|
||||
const uploadPhoto = await funGlobal_UploadToStorage({
|
||||
file: filePP,
|
||||
dirId: DIRECTORY_ID.profile_foto,
|
||||
});
|
||||
if (!uploadPhoto.success)
|
||||
if (!uploadPhoto.success) {
|
||||
setLoading(false);
|
||||
return ComponentGlobal_NotifikasiPeringatan("Gagal upload foto profile");
|
||||
}
|
||||
|
||||
const uploadBackground = await funGlobal_UploadToStorage({
|
||||
file: fileBG,
|
||||
dirId: DIRECTORY_ID.profile_background,
|
||||
});
|
||||
if (!uploadBackground.success)
|
||||
if (!uploadBackground.success) {
|
||||
setLoading(false);
|
||||
return ComponentGlobal_NotifikasiPeringatan(
|
||||
"Gagal upload background profile"
|
||||
);
|
||||
}
|
||||
|
||||
const create = await funCreateNewProfile({
|
||||
data: newData as any,
|
||||
@@ -70,11 +76,11 @@ export function Profile_ComponentCreateNewProfile({
|
||||
});
|
||||
|
||||
if (create.status === 201) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil membuat profile", 3000);
|
||||
router.push(RouterHome.main_home, { scroll: false });
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(create.message);
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
108
src/app_modules/waiting_room/view.tsx
Normal file
108
src/app_modules/waiting_room/view.tsx
Normal file
@@ -0,0 +1,108 @@
|
||||
"use client";
|
||||
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global";
|
||||
import { UIGlobal_LayoutDefault } from "@/app_modules/_global/ui";
|
||||
import {
|
||||
Button,
|
||||
Center,
|
||||
Group,
|
||||
Skeleton,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { redirect, useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function WaitingRoom_View({
|
||||
activationUser,
|
||||
userLoginId,
|
||||
}: {
|
||||
activationUser: boolean;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
async function onClickLogout() {
|
||||
setLoading(true);
|
||||
const res = await fetch(`/api/auth/logout?id=${userLoginId}`, {
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
const result = await res.json();
|
||||
if (res.status === 200) {
|
||||
ComponentGlobal_NotifikasiBerhasil(result.message);
|
||||
router.push("/", { scroll: false });
|
||||
}
|
||||
}
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (activationUser == true) {
|
||||
return redirect("/");
|
||||
}
|
||||
}, [activationUser]);
|
||||
|
||||
const listhHuruf = [
|
||||
{
|
||||
huruf: "H",
|
||||
},
|
||||
{
|
||||
huruf: "I",
|
||||
},
|
||||
{
|
||||
huruf: "P",
|
||||
},
|
||||
{
|
||||
huruf: "M",
|
||||
},
|
||||
{
|
||||
huruf: "I",
|
||||
},
|
||||
];
|
||||
const customLOader = (
|
||||
<Center>
|
||||
<Group>
|
||||
{listhHuruf.map((e, i) => (
|
||||
<Center key={i} h={"100%"}>
|
||||
<Skeleton height={50} circle radius={"100%"} />
|
||||
<Text sx={{ position: "absolute" }} c={"gray.5"} fw={"bold"}>
|
||||
{e.huruf}
|
||||
</Text>
|
||||
</Center>
|
||||
))}
|
||||
</Group>
|
||||
</Center>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutDefault>
|
||||
<Center h={"100vh"}>
|
||||
<Stack align="center" spacing={50}>
|
||||
{/* {customLOader} */}
|
||||
|
||||
<Stack align="center" spacing={5}>
|
||||
<Title order={3} c={"white"}>
|
||||
Anda telah berhasil mendaftar,
|
||||
</Title>
|
||||
<Title order={3} c={"white"}>
|
||||
Mohon menunggu konfirmansi Admin !
|
||||
</Title>
|
||||
</Stack>
|
||||
|
||||
<Button
|
||||
color="red"
|
||||
loaderPosition="center"
|
||||
loading={loading}
|
||||
radius={"xl"}
|
||||
onClick={() => onClickLogout()}
|
||||
>
|
||||
Keluar
|
||||
</Button>
|
||||
</Stack>
|
||||
</Center>
|
||||
</UIGlobal_LayoutDefault>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
src/middleware.back.txt
Normal file
55
src/middleware.back.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
// This function can be marked `async` if using `await` inside
|
||||
export const middleware = async (request: NextRequest) => {
|
||||
console.log("middleware");
|
||||
console.log(request.method);
|
||||
console.log(request.url);
|
||||
|
||||
const origin = request.headers.get("origin");
|
||||
console.log(origin);
|
||||
|
||||
const { pathname } = request.nextUrl;
|
||||
|
||||
// CROS
|
||||
const corsRespone = handleCors(request);
|
||||
if (corsRespone) {
|
||||
return setCorsHeaders(
|
||||
NextResponse.redirect(new URL("/login", request.url))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
function handleCors(req: NextRequest): NextResponse | null {
|
||||
if (req.method === "OPTIONS") {
|
||||
return new NextResponse(null, {
|
||||
status: 204,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
||||
"Access-Control-Allow-Headers": "Content-Type, Authorization",
|
||||
"Access-Control-Max-Age": "86400",
|
||||
},
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function setCorsHeaders(res: NextResponse): NextResponse {
|
||||
res.headers.set("Access-Control-Allow-Origin", "*");
|
||||
res.headers.set(
|
||||
"Access-Control-Allow-Methods",
|
||||
"GET, POST, PUT, DELETE, OPTIONS"
|
||||
);
|
||||
res.headers.set(
|
||||
"Access-Control-Allow-Headers",
|
||||
"Content-Type, Authorization"
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
|
||||
};
|
||||
@@ -1,28 +1,179 @@
|
||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||
import { user_getOneByUserId } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import { unsealData } from "iron-session";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { RouterHome } from "./app/lib/router_hipmi/router_home";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { jwtVerify } from "jose";
|
||||
import { apies, pages } from "./lib/routes";
|
||||
|
||||
type MiddlewareConfig = {
|
||||
apiPath: string;
|
||||
loginPath: string;
|
||||
userPath: string;
|
||||
publicRoutes: string[];
|
||||
encodedKey: string;
|
||||
sessionKey: string;
|
||||
validationApiRoute: string;
|
||||
log: boolean;
|
||||
};
|
||||
|
||||
// This function can be marked `async` if using `await` inside
|
||||
export function middleware(request: NextRequest) {
|
||||
let c = request.cookies.get("mySession");
|
||||
const middlewareConfig: MiddlewareConfig = {
|
||||
apiPath: "/api",
|
||||
loginPath: "/login",
|
||||
userPath: "/dev/home",
|
||||
publicRoutes: [
|
||||
// "/",
|
||||
"/api/auth/*",
|
||||
"/login",
|
||||
"/register",
|
||||
"/validasi",
|
||||
"/splash",
|
||||
"/auth/login",
|
||||
"/auth/api/login",
|
||||
"/aset/global/main_background.png",
|
||||
"/aset/logo/logo-hipmi.png",
|
||||
],
|
||||
encodedKey: process.env.NEXT_PUBLIC_BASE_TOKEN_KEY!,
|
||||
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
||||
validationApiRoute: "/api/validation",
|
||||
log: false,
|
||||
};
|
||||
export const middleware = async (req: NextRequest) => {
|
||||
const {
|
||||
apiPath,
|
||||
encodedKey,
|
||||
loginPath,
|
||||
publicRoutes,
|
||||
sessionKey,
|
||||
validationApiRoute,
|
||||
userPath,
|
||||
} = middlewareConfig;
|
||||
const { pathname } = req.nextUrl;
|
||||
|
||||
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
||||
console.log("tidak ada user middleware");
|
||||
// CORS handling
|
||||
const corsResponse = handleCors(req);
|
||||
if (corsResponse) {
|
||||
return setCorsHeaders(corsResponse);
|
||||
}
|
||||
|
||||
// Skip authentication for public routes
|
||||
const isPublicRoute = [...publicRoutes, loginPath, validationApiRoute].some(
|
||||
(route) => {
|
||||
const pattern = route.replace(/\*/g, ".*");
|
||||
return new RegExp(`^${pattern}$`).test(pathname);
|
||||
}
|
||||
);
|
||||
|
||||
// return NextResponse.redirect(new URL("/dev/auth/login", request.url));
|
||||
// return NextResponse.redirect(new URL(RouterAuth.login, request.url));
|
||||
} else {
|
||||
console.log("ada user middleware");
|
||||
return NextResponse.redirect(new URL(RouterHome.main_home, request.url));
|
||||
if (isPublicRoute) {
|
||||
return setCorsHeaders(NextResponse.next());
|
||||
}
|
||||
|
||||
const token =
|
||||
req.cookies.get(sessionKey)?.value ||
|
||||
req.headers.get("Authorization")?.split(" ")[1];
|
||||
|
||||
// Token verification
|
||||
const user = await verifyToken({ token, encodedKey });
|
||||
|
||||
if (!user) {
|
||||
if (pathname.startsWith(apiPath)) {
|
||||
return setCorsHeaders(unauthorizedResponse());
|
||||
}
|
||||
|
||||
return setCorsHeaders(NextResponse.redirect(new URL(loginPath, req.url)));
|
||||
}
|
||||
|
||||
// Redirect authenticated user away from login page
|
||||
if (user && pathname === loginPath) {
|
||||
return setCorsHeaders(NextResponse.redirect(new URL(userPath, req.url)));
|
||||
}
|
||||
|
||||
if (req.nextUrl.pathname.startsWith(apiPath)) {
|
||||
const reqToken = req.headers.get("Authorization")?.split(" ")[1];
|
||||
// Validate user access with external API
|
||||
const validationResponse = await fetch(
|
||||
new URL(validationApiRoute, req.url),
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${reqToken}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!validationResponse.ok) {
|
||||
return setCorsHeaders(unauthorizedResponse());
|
||||
}
|
||||
}
|
||||
|
||||
// Proceed with the request
|
||||
return setCorsHeaders(NextResponse.next());
|
||||
};
|
||||
|
||||
function unauthorizedResponse(): NextResponse {
|
||||
return new NextResponse(JSON.stringify({ error: "Unauthorized" }), {
|
||||
status: 401,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
}
|
||||
|
||||
function setCorsHeaders(res: NextResponse): NextResponse {
|
||||
res.headers.set("Access-Control-Allow-Origin", "*");
|
||||
res.headers.set(
|
||||
"Access-Control-Allow-Methods",
|
||||
"GET, POST, PUT, DELETE, OPTIONS"
|
||||
);
|
||||
res.headers.set(
|
||||
"Access-Control-Allow-Headers",
|
||||
"Content-Type, Authorization"
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
function handleCors(req: NextRequest): NextResponse | null {
|
||||
if (req.method === "OPTIONS") {
|
||||
return new NextResponse(null, {
|
||||
status: 204,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
||||
"Access-Control-Allow-Headers": "Content-Type, Authorization",
|
||||
"Access-Control-Max-Age": "86400",
|
||||
},
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function verifyToken({
|
||||
token,
|
||||
encodedKey,
|
||||
}: {
|
||||
token: string | undefined;
|
||||
encodedKey: string;
|
||||
}): Promise<Record<string, unknown> | null> {
|
||||
if (!token) return null;
|
||||
|
||||
return await decrypt({ token, encodedKey });
|
||||
}
|
||||
|
||||
async function decrypt({
|
||||
token,
|
||||
encodedKey,
|
||||
}: {
|
||||
token: string;
|
||||
encodedKey: string;
|
||||
}): Promise<Record<string, any> | null> {
|
||||
try {
|
||||
const enc = new TextEncoder().encode(encodedKey);
|
||||
const { payload } = await jwtVerify(token, enc, {
|
||||
algorithms: ["HS256"],
|
||||
});
|
||||
return (payload.user as Record<string, any>) || null;
|
||||
} catch (error) {
|
||||
console.error("Gagal verifikasi session", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ["/((?!_next|static|favicon.ico|manifest).*)"],
|
||||
};
|
||||
|
||||
// wibu:0.2.82
|
||||
|
||||
388
yarn.lock
388
yarn.lock
@@ -256,6 +256,13 @@
|
||||
react-pdf "^9.0.0"
|
||||
styled-components "^6.1.11"
|
||||
|
||||
"@emnapi/runtime@^1.2.0":
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.3.1.tgz#0fcaa575afc31f455fd33534c19381cfce6c6f60"
|
||||
integrity sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==
|
||||
dependencies:
|
||||
tslib "^2.4.0"
|
||||
|
||||
"@emotion/babel-plugin@^11.13.5":
|
||||
version "11.13.5"
|
||||
resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz#eab8d65dbded74e0ecfd28dc218e75607c4e7bc0"
|
||||
@@ -465,6 +472,21 @@
|
||||
resolved "https://registry.yarnpkg.com/@hookstate/core/-/core-4.0.1.tgz#6744380e96ce13fe3488c926c1cbae93bbea0ff6"
|
||||
integrity sha512-Uh2D8Z0z/pqOJ7t+SfC+2sj13JQcB4yFhtL+T1choCaBxTSlgOS/CKRBohgJ4cjTKoxOmTT8uSQysu3gUjX+Gw==
|
||||
|
||||
"@huggingface/jinja@^0.3.2":
|
||||
version "0.3.2"
|
||||
resolved "https://registry.yarnpkg.com/@huggingface/jinja/-/jinja-0.3.2.tgz#c1967f0685c69657c2d3b169459f72d5c6acbdec"
|
||||
integrity sha512-F2FvuIc+w1blGsaqJI/OErRbWH6bVJDCBI8Rm5D86yZ2wlwrGERsfIaru7XUv9eYC3DMP3ixDRRtF0h6d8AZcQ==
|
||||
|
||||
"@huggingface/transformers@^3.0.2":
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@huggingface/transformers/-/transformers-3.1.0.tgz#83599f49283e47412a5a36def9b5a90aca423ac8"
|
||||
integrity sha512-NeaZk/KBBrvy8v8gvRBE5bficnn1a9cKJDJlgr9jv+fcEiqsgqt5Mh7LKKuLxeO/bFtLppFceJVwM9gbUQyLnA==
|
||||
dependencies:
|
||||
"@huggingface/jinja" "^0.3.2"
|
||||
onnxruntime-node "1.20.1"
|
||||
onnxruntime-web "1.20.1"
|
||||
sharp "^0.33.5"
|
||||
|
||||
"@humanwhocodes/config-array@^0.11.10":
|
||||
version "0.11.14"
|
||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b"
|
||||
@@ -484,6 +506,119 @@
|
||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3"
|
||||
integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==
|
||||
|
||||
"@img/sharp-darwin-arm64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz#ef5b5a07862805f1e8145a377c8ba6e98813ca08"
|
||||
integrity sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-darwin-arm64" "1.0.4"
|
||||
|
||||
"@img/sharp-darwin-x64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz#e03d3451cd9e664faa72948cc70a403ea4063d61"
|
||||
integrity sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-darwin-x64" "1.0.4"
|
||||
|
||||
"@img/sharp-libvips-darwin-arm64@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz#447c5026700c01a993c7804eb8af5f6e9868c07f"
|
||||
integrity sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==
|
||||
|
||||
"@img/sharp-libvips-darwin-x64@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz#e0456f8f7c623f9dbfbdc77383caa72281d86062"
|
||||
integrity sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==
|
||||
|
||||
"@img/sharp-libvips-linux-arm64@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz#979b1c66c9a91f7ff2893556ef267f90ebe51704"
|
||||
integrity sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==
|
||||
|
||||
"@img/sharp-libvips-linux-arm@1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz#99f922d4e15216ec205dcb6891b721bfd2884197"
|
||||
integrity sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==
|
||||
|
||||
"@img/sharp-libvips-linux-s390x@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz#f8a5eb1f374a082f72b3f45e2fb25b8118a8a5ce"
|
||||
integrity sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==
|
||||
|
||||
"@img/sharp-libvips-linux-x64@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz#d4c4619cdd157774906e15770ee119931c7ef5e0"
|
||||
integrity sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==
|
||||
|
||||
"@img/sharp-libvips-linuxmusl-arm64@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz#166778da0f48dd2bded1fa3033cee6b588f0d5d5"
|
||||
integrity sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==
|
||||
|
||||
"@img/sharp-libvips-linuxmusl-x64@1.0.4":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz#93794e4d7720b077fcad3e02982f2f1c246751ff"
|
||||
integrity sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==
|
||||
|
||||
"@img/sharp-linux-arm64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz#edb0697e7a8279c9fc829a60fc35644c4839bb22"
|
||||
integrity sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-linux-arm64" "1.0.4"
|
||||
|
||||
"@img/sharp-linux-arm@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz#422c1a352e7b5832842577dc51602bcd5b6f5eff"
|
||||
integrity sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-linux-arm" "1.0.5"
|
||||
|
||||
"@img/sharp-linux-s390x@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz#f5c077926b48e97e4a04d004dfaf175972059667"
|
||||
integrity sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-linux-s390x" "1.0.4"
|
||||
|
||||
"@img/sharp-linux-x64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz#d806e0afd71ae6775cc87f0da8f2d03a7c2209cb"
|
||||
integrity sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-linux-x64" "1.0.4"
|
||||
|
||||
"@img/sharp-linuxmusl-arm64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz#252975b915894fb315af5deea174651e208d3d6b"
|
||||
integrity sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-linuxmusl-arm64" "1.0.4"
|
||||
|
||||
"@img/sharp-linuxmusl-x64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz#3f4609ac5d8ef8ec7dadee80b560961a60fd4f48"
|
||||
integrity sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==
|
||||
optionalDependencies:
|
||||
"@img/sharp-libvips-linuxmusl-x64" "1.0.4"
|
||||
|
||||
"@img/sharp-wasm32@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz#6f44f3283069d935bb5ca5813153572f3e6f61a1"
|
||||
integrity sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==
|
||||
dependencies:
|
||||
"@emnapi/runtime" "^1.2.0"
|
||||
|
||||
"@img/sharp-win32-ia32@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz#1a0c839a40c5351e9885628c85f2e5dfd02b52a9"
|
||||
integrity sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==
|
||||
|
||||
"@img/sharp-win32-x64@0.33.5":
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz#56f00962ff0c4e0eb93d34a047d29fa995e3e342"
|
||||
integrity sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==
|
||||
|
||||
"@isaacs/cliui@^8.0.2":
|
||||
version "8.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550"
|
||||
@@ -496,6 +631,13 @@
|
||||
wrap-ansi "^8.1.0"
|
||||
wrap-ansi-cjs "npm:wrap-ansi@^7.0.0"
|
||||
|
||||
"@isaacs/fs-minipass@^4.0.0":
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz#2d59ae3ab4b38fb4270bfa23d30f8e2e86c7fe32"
|
||||
integrity sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==
|
||||
dependencies:
|
||||
minipass "^7.0.4"
|
||||
|
||||
"@jridgewell/gen-mapping@^0.3.2", "@jridgewell/gen-mapping@^0.3.5":
|
||||
version "0.3.5"
|
||||
resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36"
|
||||
@@ -1134,6 +1276,59 @@
|
||||
dependencies:
|
||||
"@prisma/debug" "5.22.0"
|
||||
|
||||
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
|
||||
integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==
|
||||
|
||||
"@protobufjs/base64@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
|
||||
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
|
||||
|
||||
"@protobufjs/codegen@^2.0.4":
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
|
||||
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
|
||||
|
||||
"@protobufjs/eventemitter@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70"
|
||||
integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==
|
||||
|
||||
"@protobufjs/fetch@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45"
|
||||
integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.1"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
|
||||
"@protobufjs/float@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
|
||||
integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==
|
||||
|
||||
"@protobufjs/inquire@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
|
||||
integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==
|
||||
|
||||
"@protobufjs/path@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
|
||||
integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==
|
||||
|
||||
"@protobufjs/pool@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
|
||||
integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==
|
||||
|
||||
"@protobufjs/utf8@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
|
||||
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
|
||||
|
||||
"@radix-ui/number@1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@radix-ui/number/-/number-1.0.0.tgz#4c536161d0de750b3f5d55860fc3de46264f897b"
|
||||
@@ -1950,6 +2145,13 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.5.tgz#9dc0a5cb1ccce4f7a731660935ab70b9c00a5d69"
|
||||
integrity sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg==
|
||||
|
||||
"@types/node@>=13.7.0":
|
||||
version "22.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766"
|
||||
integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==
|
||||
dependencies:
|
||||
undici-types "~6.20.0"
|
||||
|
||||
"@types/node@^17.0.41":
|
||||
version "17.0.45"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190"
|
||||
@@ -2886,6 +3088,11 @@ chownr@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
|
||||
integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==
|
||||
|
||||
chownr@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/chownr/-/chownr-3.0.0.tgz#9855e64ecd240a9cc4267ce8a4aa5d24a1da15e4"
|
||||
integrity sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==
|
||||
|
||||
classnames@^2.2.5:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.5.1.tgz#ba774c614be0f016da105c858e7159eae8e7687b"
|
||||
@@ -2953,7 +3160,7 @@ color-name@^1.0.0, color-name@~1.1.4:
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
color-string@^1.9.1:
|
||||
color-string@^1.9.0, color-string@^1.9.1:
|
||||
version "1.9.1"
|
||||
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4"
|
||||
integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==
|
||||
@@ -2966,6 +3173,14 @@ color-support@^1.1.1, color-support@^1.1.2:
|
||||
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
|
||||
integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==
|
||||
|
||||
color@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a"
|
||||
integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
color-string "^1.9.0"
|
||||
|
||||
colors-cli@^1.0.26:
|
||||
version "1.0.33"
|
||||
resolved "https://registry.yarnpkg.com/colors-cli/-/colors-cli-1.0.33.tgz#22810216e3aaf726b821f6dd3a431a9340ae99cf"
|
||||
@@ -2983,6 +3198,11 @@ combined-stream@^1.0.8:
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
commander@^12.1.0:
|
||||
version "12.1.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
|
||||
integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==
|
||||
|
||||
commander@^4.0.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
|
||||
@@ -3249,7 +3469,7 @@ dequal@^2.0.3:
|
||||
resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be"
|
||||
integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==
|
||||
|
||||
detect-libc@^2.0.0:
|
||||
detect-libc@^2.0.0, detect-libc@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700"
|
||||
integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==
|
||||
@@ -3281,6 +3501,11 @@ dir-glob@^3.0.1:
|
||||
dependencies:
|
||||
path-type "^4.0.0"
|
||||
|
||||
directory-import@^3.3.1:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/directory-import/-/directory-import-3.3.1.tgz#9981192615c0d69bfb758d249157acef79cf13f5"
|
||||
integrity sha512-d9paCbverdqmuwR+B40phSqiHhgPKiP8dpsMz5WT9U6ug2VVQ3tqXNCedpa6iGHg6mgv9lHaoq5DJUu2IXMjsQ==
|
||||
|
||||
dlv@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
|
||||
@@ -3998,6 +4223,11 @@ flat-cache@^3.0.4:
|
||||
keyv "^4.5.3"
|
||||
rimraf "^3.0.2"
|
||||
|
||||
flatbuffers@^1.12.0:
|
||||
version "1.12.0"
|
||||
resolved "https://registry.yarnpkg.com/flatbuffers/-/flatbuffers-1.12.0.tgz#72e87d1726cb1b216e839ef02658aa87dcef68aa"
|
||||
integrity sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==
|
||||
|
||||
flatted@^3.2.9:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27"
|
||||
@@ -4227,7 +4457,7 @@ glob@7.1.7:
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^10.3.10:
|
||||
glob@^10.3.10, glob@^10.3.7:
|
||||
version "10.4.5"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956"
|
||||
integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==
|
||||
@@ -4310,6 +4540,11 @@ grid-index@^1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/grid-index/-/grid-index-1.1.0.tgz#97f8221edec1026c8377b86446a7c71e79522ea7"
|
||||
integrity sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==
|
||||
|
||||
guid-typescript@^1.0.9:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/guid-typescript/-/guid-typescript-1.0.9.tgz#e35f77003535b0297ea08548f5ace6adb1480ddc"
|
||||
integrity sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==
|
||||
|
||||
has-ansi@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||
@@ -5093,6 +5328,11 @@ lodash@^4.17.21, lodash@^4.17.4, lodash@~>=4.17.21:
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
long@^5.0.0, long@^5.2.3:
|
||||
version "5.2.3"
|
||||
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
|
||||
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
|
||||
|
||||
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||
@@ -5316,7 +5556,7 @@ minipass@^5.0.0:
|
||||
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
|
||||
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==
|
||||
|
||||
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2:
|
||||
"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4, minipass@^7.1.2:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707"
|
||||
integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==
|
||||
@@ -5329,6 +5569,14 @@ minizlib@^2.1.1:
|
||||
minipass "^3.0.0"
|
||||
yallist "^4.0.0"
|
||||
|
||||
minizlib@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-3.0.1.tgz#46d5329d1eb3c83924eff1d3b858ca0a31581012"
|
||||
integrity sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==
|
||||
dependencies:
|
||||
minipass "^7.0.4"
|
||||
rimraf "^5.0.5"
|
||||
|
||||
mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
|
||||
version "0.5.3"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
|
||||
@@ -5339,6 +5587,11 @@ mkdirp@^1.0.3:
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
|
||||
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
|
||||
|
||||
mkdirp@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50"
|
||||
integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==
|
||||
|
||||
moment@^2.29.4:
|
||||
version "2.30.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
|
||||
@@ -5737,6 +5990,31 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0:
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
onnxruntime-common@1.20.1:
|
||||
version "1.20.1"
|
||||
resolved "https://registry.yarnpkg.com/onnxruntime-common/-/onnxruntime-common-1.20.1.tgz#b42e317d4d6728745b9e8089617c8cd938d312dc"
|
||||
integrity sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw==
|
||||
|
||||
onnxruntime-node@1.20.1:
|
||||
version "1.20.1"
|
||||
resolved "https://registry.yarnpkg.com/onnxruntime-node/-/onnxruntime-node-1.20.1.tgz#a5ba0bd160aeccdb4b7d36fbc2f6a97bde1f7843"
|
||||
integrity sha512-di/I4HDXRw+FLgq+TyHmQEDd3cEp9iFFZm0r4uJ1Wd7b/WE1VXtKWo8yemex347c6GNF/3Pv86ZfPhIWxORr0w==
|
||||
dependencies:
|
||||
onnxruntime-common "1.20.1"
|
||||
tar "^7.0.1"
|
||||
|
||||
onnxruntime-web@1.20.1:
|
||||
version "1.20.1"
|
||||
resolved "https://registry.yarnpkg.com/onnxruntime-web/-/onnxruntime-web-1.20.1.tgz#71dc4495bb75cdd56a9dc981cf27723a599189f7"
|
||||
integrity sha512-TePF6XVpLL1rWVMIl5Y9ACBQcyCNFThZON/jgElNd9Txb73CIEGlklhYR3UEr1cp5r0rbGI6nDwwrs79g7WjoA==
|
||||
dependencies:
|
||||
flatbuffers "^1.12.0"
|
||||
guid-typescript "^1.0.9"
|
||||
long "^5.2.3"
|
||||
onnxruntime-common "1.20.1"
|
||||
platform "^1.3.6"
|
||||
protobufjs "^7.2.4"
|
||||
|
||||
openai@^4.60.0:
|
||||
version "4.72.0"
|
||||
resolved "https://registry.yarnpkg.com/openai/-/openai-4.72.0.tgz#61630553157a0c9bb1c304b1dd4d2f90e9ec4cf7"
|
||||
@@ -5951,6 +6229,11 @@ pirates@^4.0.1:
|
||||
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9"
|
||||
integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==
|
||||
|
||||
platform@^1.3.6:
|
||||
version "1.3.6"
|
||||
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
|
||||
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==
|
||||
|
||||
pluralize@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-3.1.0.tgz#84213d0a12356069daa84060c559242633161368"
|
||||
@@ -6271,6 +6554,24 @@ prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.13.3, pros
|
||||
prosemirror-state "^1.0.0"
|
||||
prosemirror-transform "^1.1.0"
|
||||
|
||||
protobufjs@^7.2.4:
|
||||
version "7.4.0"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a"
|
||||
integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.2"
|
||||
"@protobufjs/base64" "^1.1.2"
|
||||
"@protobufjs/codegen" "^2.0.4"
|
||||
"@protobufjs/eventemitter" "^1.1.0"
|
||||
"@protobufjs/fetch" "^1.1.0"
|
||||
"@protobufjs/float" "^1.0.2"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
"@protobufjs/path" "^1.1.2"
|
||||
"@protobufjs/pool" "^1.1.0"
|
||||
"@protobufjs/utf8" "^1.1.0"
|
||||
"@types/node" ">=13.7.0"
|
||||
long "^5.0.0"
|
||||
|
||||
protocol-buffers-schema@^3.3.1:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz#77bc75a48b2ff142c1ad5b5b90c94cd0fa2efd03"
|
||||
@@ -6619,7 +6920,7 @@ readdirp@^3.6.0, readdirp@~3.6.0:
|
||||
dependencies:
|
||||
picomatch "^2.2.1"
|
||||
|
||||
readdirp@^4.0.1:
|
||||
readdirp@^4.0.1, readdirp@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.0.2.tgz#388fccb8b75665da3abffe2d8f8ed59fe74c230a"
|
||||
integrity sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==
|
||||
@@ -6736,6 +7037,13 @@ rimraf@^3.0.2:
|
||||
dependencies:
|
||||
glob "^7.1.3"
|
||||
|
||||
rimraf@^5.0.5:
|
||||
version "5.0.10"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.10.tgz#23b9843d3dc92db71f96e1a2ce92e39fd2a8221c"
|
||||
integrity sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==
|
||||
dependencies:
|
||||
glob "^10.3.7"
|
||||
|
||||
rope-sequence@^1.3.0:
|
||||
version "1.3.4"
|
||||
resolved "https://registry.yarnpkg.com/rope-sequence/-/rope-sequence-1.3.4.tgz#df85711aaecd32f1e756f76e43a415171235d425"
|
||||
@@ -6869,6 +7177,35 @@ shallowequal@1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
|
||||
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
|
||||
|
||||
sharp@^0.33.5:
|
||||
version "0.33.5"
|
||||
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.33.5.tgz#13e0e4130cc309d6a9497596715240b2ec0c594e"
|
||||
integrity sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==
|
||||
dependencies:
|
||||
color "^4.2.3"
|
||||
detect-libc "^2.0.3"
|
||||
semver "^7.6.3"
|
||||
optionalDependencies:
|
||||
"@img/sharp-darwin-arm64" "0.33.5"
|
||||
"@img/sharp-darwin-x64" "0.33.5"
|
||||
"@img/sharp-libvips-darwin-arm64" "1.0.4"
|
||||
"@img/sharp-libvips-darwin-x64" "1.0.4"
|
||||
"@img/sharp-libvips-linux-arm" "1.0.5"
|
||||
"@img/sharp-libvips-linux-arm64" "1.0.4"
|
||||
"@img/sharp-libvips-linux-s390x" "1.0.4"
|
||||
"@img/sharp-libvips-linux-x64" "1.0.4"
|
||||
"@img/sharp-libvips-linuxmusl-arm64" "1.0.4"
|
||||
"@img/sharp-libvips-linuxmusl-x64" "1.0.4"
|
||||
"@img/sharp-linux-arm" "0.33.5"
|
||||
"@img/sharp-linux-arm64" "0.33.5"
|
||||
"@img/sharp-linux-s390x" "0.33.5"
|
||||
"@img/sharp-linux-x64" "0.33.5"
|
||||
"@img/sharp-linuxmusl-arm64" "0.33.5"
|
||||
"@img/sharp-linuxmusl-x64" "0.33.5"
|
||||
"@img/sharp-wasm32" "0.33.5"
|
||||
"@img/sharp-win32-ia32" "0.33.5"
|
||||
"@img/sharp-win32-x64" "0.33.5"
|
||||
|
||||
shebang-command@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
|
||||
@@ -7372,6 +7709,18 @@ tar@^6.1.11:
|
||||
mkdirp "^1.0.3"
|
||||
yallist "^4.0.0"
|
||||
|
||||
tar@^7.0.1:
|
||||
version "7.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tar/-/tar-7.4.3.tgz#88bbe9286a3fcd900e94592cda7a22b192e80571"
|
||||
integrity sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==
|
||||
dependencies:
|
||||
"@isaacs/fs-minipass" "^4.0.0"
|
||||
chownr "^3.0.0"
|
||||
minipass "^7.1.2"
|
||||
minizlib "^3.0.1"
|
||||
mkdirp "^3.0.1"
|
||||
yallist "^5.0.0"
|
||||
|
||||
term-canvas@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/term-canvas/-/term-canvas-0.0.5.tgz#597afac2fa6369a6f17860bce9c5f66d6ea0ca96"
|
||||
@@ -7644,6 +7993,11 @@ undici-types@~6.19.8:
|
||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
|
||||
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
|
||||
|
||||
undici-types@~6.20.0:
|
||||
version "6.20.0"
|
||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433"
|
||||
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
|
||||
|
||||
unicode-properties@^1.4.0, unicode-properties@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/unicode-properties/-/unicode-properties-1.4.1.tgz#96a9cffb7e619a0dc7368c28da27e05fc8f9be5f"
|
||||
@@ -7916,6 +8270,25 @@ which@^2.0.1:
|
||||
dependencies:
|
||||
isexe "^2.0.0"
|
||||
|
||||
wibu-cli@^1.0.91:
|
||||
version "1.0.91"
|
||||
resolved "https://registry.yarnpkg.com/wibu-cli/-/wibu-cli-1.0.91.tgz#c17a3f98d6942e8bb6fa2d9ac14b8f9278016e9b"
|
||||
integrity sha512-FR7nkbfcb4aqu9lAcW6xZWTIpTKvVXlXDMrg8hSlMLsR+Xen5nhVSp73H7h15c9N2GGxejGEgHIE/1yRCdWygw==
|
||||
dependencies:
|
||||
"@huggingface/transformers" "^3.0.2"
|
||||
"@types/lodash" "^4.17.13"
|
||||
"@types/web-push" "^3.6.4"
|
||||
app-root-path "^3.1.0"
|
||||
commander "^12.1.0"
|
||||
dedent "^1.5.3"
|
||||
directory-import "^3.3.1"
|
||||
dotenv "^16.4.5"
|
||||
json-to-ts "^2.1.0"
|
||||
loading-cli "^1.1.2"
|
||||
lodash "^4.17.21"
|
||||
readdirp "^4.0.2"
|
||||
web-push "^3.6.7"
|
||||
|
||||
wibu-pkg@^1.0.3:
|
||||
version "1.0.67"
|
||||
resolved "https://registry.yarnpkg.com/wibu-pkg/-/wibu-pkg-1.0.67.tgz#b9020f3463267fa22fedf3b253e66bb96e92c53c"
|
||||
@@ -8092,6 +8465,11 @@ yallist@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
||||
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
|
||||
|
||||
yallist@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-5.0.0.tgz#00e2de443639ed0d78fd87de0d27469fbcffb533"
|
||||
integrity sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==
|
||||
|
||||
yaml@^1.10.0:
|
||||
version "1.10.2"
|
||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
|
||||
|
||||
Reference in New Issue
Block a user