Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

consume web api contract in web app

Brendan Allan77aafe526756
diff --git a/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx b/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx
index 48dd8e969..6b02ba4f9 100644
--- a/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx
+++ b/apps/embed/app/view/[videoId]/_components/ShareVideo.tsx
@@ -330,7 +330,7 @@ export const ShareVideo = ({
} else if (transcriptionStatus === "COMPLETE") {
fetchSubtitles();
clearInterval(intervalId);
- } else if (transcriptionStatus === "FAILED") {
+ } else if (transcriptionStatus === "ERROR") {
clearInterval(intervalId);
}
});
diff --git a/apps/web/app/api/desktop/feedback/route.ts b/apps/web/app/api/desktop/feedback/route.ts
index b10c8d983..227e3866d 100644
--- a/apps/web/app/api/desktop/feedback/route.ts
+++ b/apps/web/app/api/desktop/feedback/route.ts
@@ -52,31 +52,32 @@ export async function POST(req: NextRequest) {
const originalOrigin = req.nextUrl.origin;
if (!user) {
- return new Response(JSON.stringify({ error: "User not authenticated" }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- "Access-Control-Allow-Origin":
- origin && allowedOrigins.includes(origin)
- ? origin
- : allowedOrigins.includes(originalOrigin)
- ? originalOrigin
- : "null",
- "Access-Control-Allow-Credentials": "true",
- },
- });
+ return Response.json(
+ { error: "User not authenticated" },
+ {
+ status: 401,
+ headers: {
+ "Access-Control-Allow-Origin":
+ origin && allowedOrigins.includes(origin)
+ ? origin
+ : allowedOrigins.includes(originalOrigin)
+ ? originalOrigin
+ : "null",
+ "Access-Control-Allow-Credentials": "true",
+ },
+ }
+ );
}
const formData = await req.formData();
const feedbackText = formData.get("feedback") as string;
if (!feedbackText) {
- return new Response(
- JSON.stringify({ error: "Feedback text is required" }),
+ return Response.json(
+ { error: "Feedback text is required" },
{
status: 400,
headers: {
- "Content-Type": "application/json",
"Access-Control-Allow-Origin":
origin && allowedOrigins.includes(origin)
? origin
@@ -112,15 +113,14 @@ export async function POST(req: NextRequest) {
);
}
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
success: true,
message: "Feedback submitted successfully",
- }),
+ },
{
status: 200,
headers: {
- "Content-Type": "application/json",
"Access-Control-Allow-Origin":
origin && allowedOrigins.includes(origin)
? origin
@@ -132,12 +132,11 @@ export async function POST(req: NextRequest) {
}
);
} catch (error) {
- return new Response(
- JSON.stringify({ error: "Failed to submit feedback" }),
+ return Response.json(
+ { error: "Failed to submit feedback" },
{
status: 500,
headers: {
- "Content-Type": "application/json",
"Access-Control-Allow-Origin":
origin && allowedOrigins.includes(origin)
? origin
diff --git a/apps/web/app/api/desktop/plan/route.ts b/apps/web/app/api/desktop/plan/route.ts
index 9e982e3d3..29c98feef 100644
--- a/apps/web/app/api/desktop/plan/route.ts
+++ b/apps/web/app/api/desktop/plan/route.ts
@@ -55,12 +55,7 @@ export async function GET(req: NextRequest) {
const user = await getCurrentUser();
if (!user) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
let isSubscribed = isUserOnProPlan({
diff --git a/apps/web/app/api/desktop/session/authenticate/route.ts b/apps/web/app/api/desktop/session/authenticate/route.ts
index d8abcd980..279565667 100644
--- a/apps/web/app/api/desktop/session/authenticate/route.ts
+++ b/apps/web/app/api/desktop/session/authenticate/route.ts
@@ -6,14 +6,9 @@ export async function GET(req: NextRequest) {
const redirect = searchParams.get("redirect");
if (!token) {
- return new Response(
- JSON.stringify({ error: true, message: "Token not supplied" }),
- {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: true, message: "Token not supplied" },
+ { status: 401 }
);
}
diff --git a/apps/web/app/api/desktop/session/verify/route.ts b/apps/web/app/api/desktop/session/verify/route.ts
index 4f1bab552..f073862f4 100644
--- a/apps/web/app/api/desktop/session/verify/route.ts
+++ b/apps/web/app/api/desktop/session/verify/route.ts
@@ -6,21 +6,9 @@ export async function GET(req: NextRequest) {
const session = await getServerSession(authOptions);
if (session) {
- return new Response(
- JSON.stringify({ isLoggedIn: true, user: session.user }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { isLoggedIn: true, user: session.user },
+ { status: 200 }
);
- } else {
- return new Response(JSON.stringify({ isLoggedIn: false }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
- }
+ } else return Response.json({ isLoggedIn: false }, { status: 401 });
}
diff --git a/apps/web/app/api/desktop/subscribe/route.ts b/apps/web/app/api/desktop/subscribe/route.ts
index 2ab70531b..9ce466c35 100644
--- a/apps/web/app/api/desktop/subscribe/route.ts
+++ b/apps/web/app/api/desktop/subscribe/route.ts
@@ -57,35 +57,39 @@ export async function POST(request: NextRequest) {
const originalOrigin = request.nextUrl.origin;
if (!priceId) {
- return new Response(JSON.stringify({ error: true }), {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- "Access-Control-Allow-Origin":
- origin && allowedOrigins.includes(origin)
- ? origin
- : allowedOrigins.includes(originalOrigin)
- ? originalOrigin
- : "null",
- "Access-Control-Allow-Credentials": "true",
- },
- });
+ return Response.json(
+ { error: true },
+ {
+ status: 400,
+ headers: {
+ "Access-Control-Allow-Origin":
+ origin && allowedOrigins.includes(origin)
+ ? origin
+ : allowedOrigins.includes(originalOrigin)
+ ? originalOrigin
+ : "null",
+ "Access-Control-Allow-Credentials": "true",
+ },
+ }
+ );
}
if (!user) {
- return new Response(JSON.stringify({ error: true, auth: false }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- "Access-Control-Allow-Origin":
- origin && allowedOrigins.includes(origin)
- ? origin
- : allowedOrigins.includes(originalOrigin)
- ? originalOrigin
- : "null",
- "Access-Control-Allow-Credentials": "true",
- },
- });
+ return Response.json(
+ { error: true, auth: false },
+ {
+ status: 401,
+ headers: {
+ "Access-Control-Allow-Origin":
+ origin && allowedOrigins.includes(origin)
+ ? origin
+ : allowedOrigins.includes(originalOrigin)
+ ? originalOrigin
+ : "null",
+ "Access-Control-Allow-Credentials": "true",
+ },
+ }
+ );
}
if (
@@ -93,19 +97,21 @@ export async function POST(request: NextRequest) {
subscriptionStatus: user.stripeSubscriptionStatus as string,
})
) {
- return new Response(JSON.stringify({ error: true, subscription: true }), {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- "Access-Control-Allow-Origin":
- origin && allowedOrigins.includes(origin)
- ? origin
- : allowedOrigins.includes(originalOrigin)
- ? originalOrigin
- : "null",
- "Access-Control-Allow-Credentials": "true",
- },
- });
+ return Response.json(
+ { error: true, subscription: true },
+ {
+ status: 400,
+ headers: {
+ "Access-Control-Allow-Origin":
+ origin && allowedOrigins.includes(origin)
+ ? origin
+ : allowedOrigins.includes(originalOrigin)
+ ? originalOrigin
+ : "null",
+ "Access-Control-Allow-Credentials": "true",
+ },
+ }
+ );
}
if (!user.stripeCustomerId) {
@@ -141,10 +147,28 @@ export async function POST(request: NextRequest) {
});
if (checkoutSession.url) {
- return new Response(JSON.stringify({ url: checkoutSession.url }), {
- status: 200,
+ return Response.json(
+ { url: checkoutSession.url },
+ {
+ status: 200,
+ headers: {
+ "Access-Control-Allow-Origin":
+ origin && allowedOrigins.includes(origin)
+ ? origin
+ : allowedOrigins.includes(originalOrigin)
+ ? originalOrigin
+ : "null",
+ "Access-Control-Allow-Credentials": "true",
+ },
+ }
+ );
+ }
+
+ return Response.json(
+ { error: true },
+ {
+ status: 400,
headers: {
- "Content-Type": "application/json",
"Access-Control-Allow-Origin":
origin && allowedOrigins.includes(origin)
? origin
@@ -153,20 +177,6 @@ export async function POST(request: NextRequest) {
: "null",
"Access-Control-Allow-Credentials": "true",
},
- });
- }
-
- return new Response(JSON.stringify({ error: true }), {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- "Access-Control-Allow-Origin":
- origin && allowedOrigins.includes(origin)
- ? origin
- : allowedOrigins.includes(originalOrigin)
- ? originalOrigin
- : "null",
- "Access-Control-Allow-Credentials": "true",
- },
- });
+ }
+ );
}
diff --git a/apps/web/app/api/desktop/video/metadata/create/route.ts b/apps/web/app/api/desktop/video/metadata/create/route.ts
index 4fea6d9f1..7aab7600c 100644
--- a/apps/web/app/api/desktop/video/metadata/create/route.ts
+++ b/apps/web/app/api/desktop/video/metadata/create/route.ts
@@ -12,14 +12,9 @@ export async function GET(request: NextRequest) {
const xStreamInfo = url.searchParams.get("xStreamInfo");
if (!videoId || !xStreamInfo) {
- return new Response(
- JSON.stringify({ error: "Missing required fields" }),
- {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: "Missing required fields" },
+ { status: 400 }
);
}
@@ -28,19 +23,9 @@ export async function GET(request: NextRequest) {
.set({ xStreamInfo: xStreamInfo })
.where(eq(videos.id, videoId));
- return new Response(JSON.stringify({ success: true }), {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ success: true }, { status: 200 });
} catch (error) {
console.error("Error updating xStreamInfo", error);
- return new Response(JSON.stringify({ error: "Internal server error" }), {
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Internal server error" }, { status: 500 });
}
}
diff --git a/apps/web/app/api/desktop/video/metadata/retrieve/route.ts b/apps/web/app/api/desktop/video/metadata/retrieve/route.ts
index 9246d5265..4a1bee085 100644
--- a/apps/web/app/api/desktop/video/metadata/retrieve/route.ts
+++ b/apps/web/app/api/desktop/video/metadata/retrieve/route.ts
@@ -11,26 +11,16 @@ export async function GET(request: NextRequest) {
const videoId = url.searchParams.get("videoId");
if (!videoId) {
- return new Response(
- JSON.stringify({ error: "Missing required fields" }),
- {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: "Missing required fields" },
+ { status: 400 }
);
}
const query = await db.select().from(videos).where(eq(videos.id, videoId));
if (query.length === 0) {
- return new Response(JSON.stringify({ error: "Video not found" }), {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Video not found" }, { status: 404 });
}
const video = query[0]!;
@@ -43,22 +33,12 @@ export async function GET(request: NextRequest) {
const timeDifference = videoStartTime - audioStartTime;
- return new Response(
- JSON.stringify({ success: true, difference: timeDifference }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { success: true, difference: timeDifference },
+ { status: 200 }
);
} catch (error) {
console.error("Error updating video or audio start time", error);
- return new Response(JSON.stringify({ error: "Internal server error" }), {
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Internal server error" }, { status: 500 });
}
}
diff --git a/apps/web/app/api/releases/macos/route.ts b/apps/web/app/api/releases/macos/route.ts
index f76c2ad31..6605ef6c9 100644
--- a/apps/web/app/api/releases/macos/route.ts
+++ b/apps/web/app/api/releases/macos/route.ts
@@ -44,19 +44,9 @@ export async function GET(
const url = asset.browser_download_url;
- return new Response(JSON.stringify({ version, notes, pub_date, url }), {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ version, notes, pub_date, url }, { status: 200 });
} catch (error) {
console.error("Error fetching latest release:", error);
- return new Response(JSON.stringify({ error: "Missing required fields" }), {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Missing required fields" }, { status: 400 });
}
}
diff --git a/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts b/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
index f5b95c068..b92eca1f4 100644
--- a/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
+++ b/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
@@ -61,22 +61,12 @@ export async function GET(
(r) => r.text()
);
- return new Response(
- JSON.stringify({ version, notes, pub_date, url, signature }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { version, notes, pub_date, url, signature },
+ { status: 200 }
);
} catch (error) {
console.error("Error fetching latest release:", error);
- return new Response(JSON.stringify({ error: "Missing required fields" }), {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Missing required fields" }, { status: 400 });
}
}
diff --git a/apps/web/app/api/settings/billing/manage/route.ts b/apps/web/app/api/settings/billing/manage/route.ts
index 2cf06fc16..f0d798530 100644
--- a/apps/web/app/api/settings/billing/manage/route.ts
+++ b/apps/web/app/api/settings/billing/manage/route.ts
@@ -12,12 +12,7 @@ export async function POST(request: NextRequest) {
if (!user) {
console.error("User not found");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
if (!user.stripeCustomerId) {
diff --git a/apps/web/app/api/settings/billing/subscribe/route.ts b/apps/web/app/api/settings/billing/subscribe/route.ts
index bc56d8d44..3d13532e2 100644
--- a/apps/web/app/api/settings/billing/subscribe/route.ts
+++ b/apps/web/app/api/settings/billing/subscribe/route.ts
@@ -16,26 +16,21 @@ export async function POST(request: NextRequest) {
if (!priceId) {
console.error("Price ID not found");
- return new Response(JSON.stringify({ error: true }), {
- status: 400,
- headers: { "Content-Type": "application/json" },
- });
+ return Response.json({ error: true }, { status: 400 });
}
if (!user) {
console.error("User not found");
- return new Response(JSON.stringify({ error: true, auth: false }), {
- status: 401,
- headers: { "Content-Type": "application/json" },
- });
+ return Response.json({ error: true, auth: false }, { status: 401 });
}
-
- if (isUserOnProPlan({ subscriptionStatus: user.stripeSubscriptionStatus as string })) {
+
+ if (
+ isUserOnProPlan({
+ subscriptionStatus: user.stripeSubscriptionStatus as string,
+ })
+ ) {
console.error("User already has pro plan");
- return new Response(JSON.stringify({ error: true, subscription: true }), {
- status: 400,
- headers: { "Content-Type": "application/json" },
- });
+ return Response.json({ error: true, subscription: true }, { status: 400 });
}
try {
@@ -73,22 +68,13 @@ export async function POST(request: NextRequest) {
if (checkoutSession.url) {
console.log("Successfully created checkout session");
- return new Response(JSON.stringify({ url: checkoutSession.url }), {
- status: 200,
- headers: { "Content-Type": "application/json" },
- });
+ return Response.json({ url: checkoutSession.url }, { status: 200 });
}
console.error("Checkout session created but no URL returned");
- return new Response(JSON.stringify({ error: true }), {
- status: 400,
- headers: { "Content-Type": "application/json" },
- });
+ return Response.json({ error: true }, { status: 400 });
} catch (error) {
console.error("Error creating checkout session:", error);
- return new Response(JSON.stringify({ error: true }), {
- status: 500,
- headers: { "Content-Type": "application/json" },
- });
+ return Response.json({ error: true }, { status: 500 });
}
}
diff --git a/apps/web/app/api/settings/billing/usage/route.ts b/apps/web/app/api/settings/billing/usage/route.ts
index eeee1900e..2a0bb87e8 100644
--- a/apps/web/app/api/settings/billing/usage/route.ts
+++ b/apps/web/app/api/settings/billing/usage/route.ts
@@ -9,12 +9,7 @@ export async function GET(request: NextRequest) {
const user = await getCurrentUser();
if (!user) {
- return new Response(JSON.stringify({ auth: false }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ auth: false }, { status: 401 });
}
const numberOfVideos = await db
@@ -23,16 +18,9 @@ export async function GET(request: NextRequest) {
.where(eq(videos.ownerId, user.id));
if (!numberOfVideos[0]) {
- return new Response(
- JSON.stringify({
- error: "Could not fetch video count",
- }),
- {
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: "Could not fetch video count" },
+ { status: 500 }
);
}
@@ -41,32 +29,22 @@ export async function GET(request: NextRequest) {
subscriptionStatus: user.stripeSubscriptionStatus as string,
})
) {
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
subscription: true,
videoLimit: 0,
videoCount: numberOfVideos[0].count,
- }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ },
+ { status: 200 }
);
} else {
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
subscription: false,
videoLimit: 25,
videoCount: numberOfVideos[0].count,
- }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ },
+ { status: 200 }
);
}
}
diff --git a/apps/web/app/api/settings/onboarding/route.ts b/apps/web/app/api/settings/onboarding/route.ts
index 441e46fac..434908db3 100644
--- a/apps/web/app/api/settings/onboarding/route.ts
+++ b/apps/web/app/api/settings/onboarding/route.ts
@@ -12,12 +12,7 @@ export async function POST(request: NextRequest) {
if (!user) {
console.error("User not found");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
await db
@@ -62,16 +57,8 @@ export async function POST(request: NextRequest) {
}
// After updating user and creating space
- return new Response(
- JSON.stringify({
- success: true,
- message: "Onboarding completed successfully",
- }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { success: true, message: "Onboarding completed successfully" },
+ { status: 200 }
);
}
diff --git a/apps/web/app/api/settings/user/name/route.ts b/apps/web/app/api/settings/user/name/route.ts
index 1c4daf5d3..70de72548 100644
--- a/apps/web/app/api/settings/user/name/route.ts
+++ b/apps/web/app/api/settings/user/name/route.ts
@@ -11,12 +11,7 @@ export async function POST(request: NextRequest) {
if (!user) {
console.error("User not found");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
await db
@@ -27,12 +22,7 @@ export async function POST(request: NextRequest) {
})
.where(eq(users.id, user.id));
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, {
+ status: 200,
+ });
}
diff --git a/apps/web/app/api/settings/workspace/details/route.ts b/apps/web/app/api/settings/workspace/details/route.ts
index 15bab5fae..074ade52a 100644
--- a/apps/web/app/api/settings/workspace/details/route.ts
+++ b/apps/web/app/api/settings/workspace/details/route.ts
@@ -9,33 +9,17 @@ export async function POST(request: NextRequest) {
const { workspaceName, allowedEmailDomain, spaceId } = await request.json();
if (!user) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
-
const space = await db.select().from(spaces).where(eq(spaces.id, spaceId));
if (!space) {
- return new Response(JSON.stringify({ error: true }), {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 404 });
}
if (space.length > 0 && space[0]?.ownerId !== user.id) {
- return new Response(JSON.stringify({ error: true }), {
- status: 403,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 403 });
}
await db
@@ -46,12 +30,5 @@ export async function POST(request: NextRequest) {
})
.where(eq(spaces.id, spaceId));
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, { status: 200 });
}
diff --git a/apps/web/app/api/settings/workspace/invite/remove/route.ts b/apps/web/app/api/settings/workspace/invite/remove/route.ts
index f30048575..f1cb355e4 100644
--- a/apps/web/app/api/settings/workspace/invite/remove/route.ts
+++ b/apps/web/app/api/settings/workspace/invite/remove/route.ts
@@ -12,12 +12,7 @@ export async function POST(request: NextRequest) {
if (!user) {
console.error("User not found");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
console.log(`User found: ${user.id}`);
@@ -31,22 +26,12 @@ export async function POST(request: NextRequest) {
if (!space || space.length === 0) {
console.error(`Space not found for spaceId: ${spaceId}`);
- return new Response(JSON.stringify({ error: true }), {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 404 });
}
if (space[0]?.ownerId !== user.id) {
console.error(`User ${user.id} is not the owner of space ${spaceId}`);
- return new Response(JSON.stringify({ error: true }), {
- status: 403,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 403 });
}
const result = await db
@@ -57,19 +42,9 @@ export async function POST(request: NextRequest) {
if (result.rowsAffected === 0) {
console.error(`No invite found with id ${inviteId} for space ${spaceId}`);
- return new Response(JSON.stringify({ error: true }), {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 404 });
}
console.log("Workspace invite removed successfully");
- return new Response(JSON.stringify({ success: true }), {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ success: true }, { status: 200 });
}
diff --git a/apps/web/app/api/settings/workspace/invite/send/route.ts b/apps/web/app/api/settings/workspace/invite/send/route.ts
index 5d438a58f..5d689abe3 100644
--- a/apps/web/app/api/settings/workspace/invite/send/route.ts
+++ b/apps/web/app/api/settings/workspace/invite/send/route.ts
@@ -15,12 +15,7 @@ export async function POST(request: NextRequest) {
if (!user) {
console.error("User not found");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
console.log(`User found: ${user.id}`);
@@ -30,22 +25,12 @@ export async function POST(request: NextRequest) {
if (!space || space.length === 0) {
console.error(`Space not found for spaceId: ${spaceId}`);
- return new Response(JSON.stringify({ error: true }), {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 404 });
}
if (space[0]?.ownerId !== user.id) {
console.error(`User ${user.id} is not the owner of space ${spaceId}`);
- return new Response(JSON.stringify({ error: true }), {
- status: 403,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 403 });
}
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
@@ -77,12 +62,5 @@ export async function POST(request: NextRequest) {
}
console.log("Workspace invites created and emails sent successfully");
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, { status: 200 });
}
diff --git a/apps/web/app/api/settings/workspace/lookup/route.ts b/apps/web/app/api/settings/workspace/lookup/route.ts
index b15e8979c..1004e34c0 100644
--- a/apps/web/app/api/settings/workspace/lookup/route.ts
+++ b/apps/web/app/api/settings/workspace/lookup/route.ts
@@ -10,14 +10,9 @@ export async function GET(request: NextRequest) {
if (!spaceId) {
console.log("[workspace/lookup] Missing spaceId parameter");
- return new Response(
- JSON.stringify({ error: "Space ID parameter is required" }),
- {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: "Space ID parameter is required" },
+ { status: 400 }
);
}
@@ -32,32 +27,22 @@ export async function GET(request: NextRequest) {
.where(eq(spaces.id, spaceId));
console.log("[workspace/lookup] Found space:", space);
-
+
if (!space || !space.workosOrganizationId || !space.workosConnectionId) {
console.log("[workspace/lookup] Space not found or missing SSO config");
- return new Response(
- JSON.stringify({ error: "Space not found or SSO not configured" }),
- {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: "Space not found or SSO not configured" },
+ { status: 404 }
);
}
console.log("[workspace/lookup] Found space:", space.name);
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
organizationId: space.workosOrganizationId,
connectionId: space.workosConnectionId,
name: space.name,
- }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ },
+ { status: 200 }
);
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/api/settings/workspace/sso/route.ts b/apps/web/app/api/settings/workspace/sso/route.ts
index a8ba97889..49caad572 100644
--- a/apps/web/app/api/settings/workspace/sso/route.ts
+++ b/apps/web/app/api/settings/workspace/sso/route.ts
@@ -6,29 +6,17 @@ import { eq } from "drizzle-orm";
export async function POST(request: NextRequest) {
const user = await getCurrentUser();
- const { spaceId, workosOrganizationId, workosConnectionId } = await request.json();
+ const { spaceId, workosOrganizationId, workosConnectionId } =
+ await request.json();
if (!user) {
- return new Response(JSON.stringify({ error: "Unauthorized" }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Unauthorized" }, { status: 401 });
}
- const [space] = await db
- .select()
- .from(spaces)
- .where(eq(spaces.id, spaceId));
+ const [space] = await db.select().from(spaces).where(eq(spaces.id, spaceId));
if (!space || space.ownerId !== user.id) {
- return new Response(JSON.stringify({ error: "Unauthorized" }), {
- status: 403,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: "Unauthorized" }, { status: 403 });
}
await db
@@ -39,13 +27,5 @@ export async function POST(request: NextRequest) {
})
.where(eq(spaces.id, spaceId));
- return new Response(
- JSON.stringify({ success: true }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
- );
-}
\ No newline at end of file
+ return Response.json({ success: true }, { status: 200 });
+}
diff --git a/apps/web/app/api/upload/new/route.ts b/apps/web/app/api/upload/new/route.ts
index 887d0a1b1..b4f10da89 100644
--- a/apps/web/app/api/upload/new/route.ts
+++ b/apps/web/app/api/upload/new/route.ts
@@ -19,12 +19,7 @@ export async function POST(request: NextRequest) {
if (!user || !awsRegion || !awsBucket || !filename || !blobData) {
console.error("Missing required data in /api/upload/new/route.ts");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
const fullFilepath = `${user.id}/${videoId}/${filename}`;
@@ -44,22 +39,10 @@ export async function POST(request: NextRequest) {
if (!upload) {
console.error("Upload failed");
- return new Response(JSON.stringify({ error: true }), {
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 500 });
}
console.log("Upload successful");
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, { status: 200 });
}
diff --git a/apps/web/app/api/upload/signed/route.ts b/apps/web/app/api/upload/signed/route.ts
index 12ed10d42..9124eac64 100644
--- a/apps/web/app/api/upload/signed/route.ts
+++ b/apps/web/app/api/upload/signed/route.ts
@@ -3,7 +3,10 @@ import {
createPresignedPost,
type PresignedPost,
} from "@aws-sdk/s3-presigned-post";
-import { CloudFrontClient, CreateInvalidationCommand } from "@aws-sdk/client-cloudfront";
+import {
+ CloudFrontClient,
+ CreateInvalidationCommand,
+} from "@aws-sdk/client-cloudfront";
import { db } from "@cap/database";
import { getCurrentUser } from "@cap/database/auth/session";
import { s3Buckets } from "@cap/database/schema";
@@ -18,14 +21,9 @@ export async function POST(request: NextRequest) {
if (!fileKey) {
console.error("Missing required fields in /api/upload/signed/route.ts");
- return new Response(
- JSON.stringify({ error: "Missing required fields" }),
- {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: "Missing required fields" },
+ { status: 400 }
);
}
@@ -45,12 +43,7 @@ export async function POST(request: NextRequest) {
console.log("/api/upload/signed user", user);
if (!user) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
try {
@@ -59,24 +52,30 @@ export async function POST(request: NextRequest) {
.from(s3Buckets)
.where(eq(s3Buckets.ownerId, user.id));
- const s3Config = bucket ? {
- endpoint: bucket.endpoint || undefined,
- region: bucket.region,
- accessKeyId: bucket.accessKeyId,
- secretAccessKey: bucket.secretAccessKey,
- } : null;
+ const s3Config = bucket
+ ? {
+ endpoint: bucket.endpoint || undefined,
+ region: bucket.region,
+ accessKeyId: bucket.accessKeyId,
+ secretAccessKey: bucket.secretAccessKey,
+ }
+ : null;
- if (!bucket || !s3Config || bucket.bucketName !== process.env.CAP_S3_BUCKET) {
+ if (
+ !bucket ||
+ !s3Config ||
+ bucket.bucketName !== process.env.CAP_S3_BUCKET
+ ) {
const distributionId = process.env.CAP_CLOUDFRONT_DISTRIBUTION_ID;
if (distributionId) {
console.log("Creating CloudFront invalidation for", fileKey);
-
+
const cloudfront = new CloudFrontClient({
region: process.env.NEXT_PUBLIC_CAP_AWS_REGION || "us-east-1",
credentials: {
accessKeyId: process.env.CAP_AWS_ACCESS_KEY || "",
secretAccessKey: process.env.CAP_AWS_SECRET_KEY || "",
- }
+ },
});
const pathToInvalidate = "/" + fileKey;
@@ -136,54 +135,49 @@ export async function POST(request: NextRequest) {
const presignedPostData: PresignedPost = await createPresignedPost(
s3Client,
- {
- Bucket: bucketName,
- Key: fileKey,
- Fields,
- Expires: 1800
+ {
+ Bucket: bucketName,
+ Key: fileKey,
+ Fields,
+ Expires: 1800,
}
);
console.log("Presigned URL created successfully");
// After successful presigned URL creation, trigger revalidation
- const videoId = fileKey.split('/')[1]; // Assuming fileKey format is userId/videoId/...
+ const videoId = fileKey.split("/")[1]; // Assuming fileKey format is userId/videoId/...
if (videoId) {
try {
await fetch(`${process.env.NEXT_PUBLIC_URL}/api/revalidate`, {
- method: 'POST',
+ method: "POST",
headers: {
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({ videoId }),
});
} catch (revalidateError) {
- console.error('Failed to revalidate page:', revalidateError);
+ console.error("Failed to revalidate page:", revalidateError);
}
}
- return new Response(JSON.stringify({ presignedPostData }), {
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ presignedPostData });
} catch (s3Error) {
console.error("S3 operation failed:", s3Error);
- throw new Error(`S3 operation failed: ${s3Error instanceof Error ? s3Error.message : 'Unknown error'}`);
+ throw new Error(
+ `S3 operation failed: ${
+ s3Error instanceof Error ? s3Error.message : "Unknown error"
+ }`
+ );
}
} catch (error) {
console.error("Error creating presigned URL", error);
- return new Response(
- JSON.stringify({
- error: "Error creating presigned URL",
- details: error instanceof Error ? error.message : String(error)
- }),
+ return Response.json(
{
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ error: "Error creating presigned URL",
+ details: error instanceof Error ? error.message : String(error),
+ },
+ { status: 500 }
);
}
}
diff --git a/apps/web/app/api/video/analytics/route.ts b/apps/web/app/api/video/analytics/route.ts
index 6a7f29221..ed78d9847 100644
--- a/apps/web/app/api/video/analytics/route.ts
+++ b/apps/web/app/api/video/analytics/route.ts
@@ -9,12 +9,7 @@ export async function GET(request: NextRequest) {
const videoId = searchParams.get("videoId");
if (!videoId) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
try {
@@ -25,41 +20,21 @@ export async function GET(request: NextRequest) {
const { clicks: analytics } = response as ClicksCount;
if (typeof analytics !== "number" || analytics === null) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
- return new Response(JSON.stringify({ count: analytics }), {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ count: analytics }, { status: 200 });
} catch (error: any) {
if (error.code === "not_found") {
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
error: true,
message: "Video link not found.",
docUrl: error.docUrl,
- }),
- {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ },
+ { status: 404 }
);
}
- return new Response(JSON.stringify({ error: true }), {
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 500 });
}
}
diff --git a/apps/web/app/api/video/comment/route.ts b/apps/web/app/api/video/comment/route.ts
index f0c3016cc..997d32f35 100644
--- a/apps/web/app/api/video/comment/route.ts
+++ b/apps/web/app/api/video/comment/route.ts
@@ -12,20 +12,20 @@ async function handlePost(request: NextRequest) {
await request.json();
const userId = user?.id || "anonymous";
- const parentCommentIdSanitized = parentCommentId ? parentCommentId.replace("temp-", "") : null;
+ const parentCommentIdSanitized = parentCommentId
+ ? parentCommentId.replace("temp-", "")
+ : null;
if (!type || !content || !videoId) {
console.error("Missing required data in /api/video/comment/route.ts");
- return new Response(JSON.stringify({
- error: true,
- message: "Missing required fields: type, content, or videoId"
- }), {
- status: 400,
- headers: {
- "Content-Type": "application/json",
+ return Response.json(
+ {
+ error: true,
+ message: "Missing required fields: type, content, or videoId",
},
- });
+ { status: 400 }
+ );
}
const id = nanoId();
@@ -45,29 +45,21 @@ async function handlePost(request: NextRequest) {
await db.insert(comments).values(newComment);
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
...newComment,
authorName: user?.name || "Anonymous",
- }), {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ },
+ { status: 200 }
);
} catch (error) {
console.error("Error creating comment:", error);
- return new Response(
- JSON.stringify({
+ return Response.json(
+ {
error: true,
- message: "Failed to create comment"
- }), {
- status: 500,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ message: "Failed to create comment",
+ },
+ { status: 500 }
);
}
}
diff --git a/apps/web/app/api/video/delete/route.ts b/apps/web/app/api/video/delete/route.ts
index 0b8a608b0..b78831583 100644
--- a/apps/web/app/api/video/delete/route.ts
+++ b/apps/web/app/api/video/delete/route.ts
@@ -21,12 +21,7 @@ export async function DELETE(request: NextRequest) {
if (!videoId || !userId) {
console.error("Missing required data in /api/video/delete/route.ts");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
const query = await db
@@ -84,12 +79,7 @@ export async function DELETE(request: NextRequest) {
await s3Client.send(deleteObjectsCommand);
}
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, {
+ status: 200,
+ });
}
diff --git a/apps/web/app/api/video/metadata/route.ts b/apps/web/app/api/video/metadata/route.ts
index f6bf3ecc5..79e9eac7f 100644
--- a/apps/web/app/api/video/metadata/route.ts
+++ b/apps/web/app/api/video/metadata/route.ts
@@ -12,42 +12,22 @@ export async function PUT(request: NextRequest) {
if (!user || !videoId || !metadata) {
console.error("Missing required data in /api/video/metadata/route.ts");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
const query = await db.select().from(videos).where(eq(videos.id, videoId));
if (query.length === 0) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
const result = query[0];
if (!result) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
if (result.ownerId !== userId) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
await db
@@ -57,12 +37,5 @@ export async function PUT(request: NextRequest) {
})
.where(eq(videos.id, videoId));
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, { status: 200 });
}
diff --git a/apps/web/app/api/video/title/route.ts b/apps/web/app/api/video/title/route.ts
index db73436da..a73c08710 100644
--- a/apps/web/app/api/video/title/route.ts
+++ b/apps/web/app/api/video/title/route.ts
@@ -15,42 +15,22 @@ export async function handlePut(request: NextRequest) {
if (!user || !title || !videoId) {
console.error("Missing required data in /api/video/title/route.ts");
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
const query = await db.select().from(videos).where(eq(videos.id, videoId));
if (query.length === 0) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
const video = query[0];
if (!video) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
if (video.ownerId !== userId) {
- return new Response(JSON.stringify({ error: true }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ error: true }, { status: 401 });
}
await db
@@ -60,14 +40,7 @@ export async function handlePut(request: NextRequest) {
})
.where(eq(videos.id, videoId));
- return new Response(
- JSON.stringify({
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- })
- );
+ return Response.json(true, { status: 200 });
}
export const PUT = (request: NextRequest) => {
diff --git a/apps/web/app/api/video/transcribe/status/route.ts b/apps/web/app/api/video/transcribe/status/route.ts
index b0fe1ddda..8cb2877a6 100644
--- a/apps/web/app/api/video/transcribe/status/route.ts
+++ b/apps/web/app/api/video/transcribe/status/route.ts
@@ -11,49 +11,27 @@ export async function GET(request: NextRequest) {
const videoId = url.searchParams.get("videoId");
if (!user) {
- return new Response(JSON.stringify({ auth: false }), {
- status: 401,
- headers: {
- "Content-Type": "application/json",
- },
- });
+ return Response.json({ auth: false }, { status: 401 });
}
if (!videoId) {
- return new Response(
- JSON.stringify({ error: true, message: "videoId not supplied" }),
- {
- status: 400,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: true, message: "videoId not supplied" },
+ { status: 400 }
);
}
const video = await db.select().from(videos).where(eq(videos.id, videoId));
if (video.length === 0 || !video[0]) {
- return new Response(
- JSON.stringify({ error: true, message: "Video does not exist" }),
- {
- status: 404,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { error: true, message: "Video does not exist" },
+ { status: 404 }
);
}
- return new Response(
- JSON.stringify({
- transcriptionStatus: video[0].transcriptionStatus,
- }),
- {
- status: 200,
- headers: {
- "Content-Type": "application/json",
- },
- }
+ return Response.json(
+ { transcriptionStatus: video[0].transcriptionStatus },
+ { status: 200 }
);
}
diff --git a/apps/web/app/dashboard/caps/Caps.tsx b/apps/web/app/dashboard/caps/Caps.tsx
index 5c482ce3d..b34de2555 100644
--- a/apps/web/app/dashboard/caps/Caps.tsx
+++ b/apps/web/app/dashboard/caps/Caps.tsx
@@ -6,6 +6,7 @@ import { useSharedContext } from "@/app/dashboard/_components/DynamicSharedLayou
import { CapCard } from "./components/CapCard";
import { EmptyCapState } from "./components/EmptyCapState";
import { CapPagination } from "./components/CapPagination";
+import { apiClient } from "@/utils/web-api";
type VideoData = {
id: string;
@@ -40,15 +41,16 @@ export const Caps = ({
const analyticsData: Record<string, number> = {};
for (const video of data) {
- const response = await fetch(
- `/api/video/analytics?videoId=${video.id}`,
- {
+ const response = await apiClient.video.getAnalytics({
+ query: { videoId: video.id },
+ fetchOptions: {
cache: "force-cache",
- }
- );
- const data = await response.json();
+ },
+ });
- analyticsData[video.id] = data.count || 0;
+ if (response.status !== 200) continue;
+
+ analyticsData[video.id] = response.body.count || 0;
}
setAnalytics(analyticsData);
};
@@ -65,11 +67,9 @@ export const Caps = ({
return;
}
- const response = await fetch(`/api/video/delete?videoId=${videoId}`, {
- method: "DELETE",
- });
+ const response = await apiClient.video.delete({ query: { videoId } });
- if (response.ok) {
+ if (response.status === 200) {
refresh();
toast.success("Cap deleted successfully");
} else {
diff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
index f5a22b50d..0dafc5c4c 100644
--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
@@ -15,6 +15,7 @@ import { userSelectProps } from "@cap/database/auth/session";
import { fromVtt, Subtitle } from "subtitles-parser-vtt";
import toast from "react-hot-toast";
import { Tooltip } from "react-tooltip";
+import { apiClient } from "@/utils/web-api";
declare global {
interface Window {
@@ -417,15 +418,18 @@ export const ShareVideo = forwardRef<
return;
}
- fetch(`/api/video/transcribe/status?videoId=${data.id}`)
- .then((response) => response.json())
- .then(({ transcriptionStatus }) => {
+ apiClient.video
+ .getTranscribeStatus({ query: { videoId: data.id } })
+ .then((data) => {
+ if (data.status !== 200) return;
+
+ const { transcriptionStatus } = data.body;
if (transcriptionStatus === "PROCESSING") {
setIsTranscriptionProcessing(true);
} else if (transcriptionStatus === "COMPLETE") {
fetchSubtitles();
clearInterval(intervalId);
- } else if (transcriptionStatus === "FAILED") {
+ } else if (transcriptionStatus === "ERROR") {
clearInterval(intervalId);
}
});
diff --git a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
index 8b3daac1b..e3d6905f1 100644
--- a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
+++ b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
@@ -164,7 +164,7 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {
} else if (transcriptionStatus === "COMPLETE") {
fetchTranscript();
clearInterval(intervalId);
- } else if (transcriptionStatus === "FAILED") {
+ } else if (transcriptionStatus === "ERROR") {
clearInterval(intervalId);
setIsLoading(false);
}
diff --git a/apps/web/package.json b/apps/web/package.json
index 257d3afa1..93a5765eb 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -17,6 +17,7 @@
"@cap/database": "workspace:*",
"@cap/ui": "workspace:*",
"@cap/utils": "workspace:*",
+ "@cap/web-api-contract": "workspace:*",
"@deepgram/sdk": "^3.3.4",
"@ffmpeg/ffmpeg": "^0.12.10",
"@ffmpeg/util": "^0.12.1",
@@ -31,6 +32,7 @@
"@tanstack/react-query": "^5.51.11",
"@tanstack/react-store": "^0.5.5",
"@tanstack/store": "^0.5.5",
+ "@ts-rest/core": "^3.51.0",
"@workos-inc/node": "^7.34.0",
"aws-sdk": "^2.1530.0",
"clsx": "^2.0.0",
diff --git a/apps/web/utils/web-api.ts b/apps/web/utils/web-api.ts
new file mode 100644
index 000000000..d3f813cbd
--- /dev/null
+++ b/apps/web/utils/web-api.ts
@@ -0,0 +1,9 @@
+import { initClient } from "@ts-rest/core";
+import { contract } from "@cap/web-api-contract";
+
+export const apiClient = initClient(contract, {
+ baseUrl:
+ typeof window !== "undefined"
+ ? `${process.env.NEXT_PUBLIC_URL}/api`
+ : "/api",
+});
diff --git a/packages/web-api-contract/src/desktop.ts b/packages/web-api-contract/src/desktop.ts
new file mode 100644
index 000000000..953f1dc66
--- /dev/null
+++ b/packages/web-api-contract/src/desktop.ts
@@ -0,0 +1,135 @@
+import { z } from "zod";
+
+import { c } from "./util";
+
+const CHANGELOG = z.object({
+ metadata: z.object({
+ title: z.string(),
+ app: z.string(),
+ publishedAt: z.string(),
+ version: z.string(),
+ image: z.string().optional(),
+ }),
+ content: z.string(),
+ slug: z.number(),
+});
+
+const publicContract = c.router({
+ getChangelogPosts: {
+ method: "GET",
+ path: "/changelog",
+ query: z.object({
+ origin: z.string(),
+ }),
+ responses: {
+ 200: z.array(
+ z.object({ content: z.string() }).and(CHANGELOG.shape.metadata)
+ ),
+ },
+ },
+ getChangelogStatus: {
+ method: "GET",
+ path: "/changelog/status",
+ query: z.object({
+ version: z.string(),
+ }),
+ responses: {
+ 200: z.object({ hasUpdate: z.boolean() }),
+ },
+ },
+});
+
+const protectedContract = c.router(
+ {
+ submitDesktopFeedback: {
+ method: "POST",
+ path: "/desktop/feedback",
+ contentType: "application/x-www-form-urlencoded",
+ body: z.object({ feedback: z.string() }),
+ responses: {
+ 200: z.object({ success: z.boolean() }),
+ },
+ },
+ getUserPlan: {
+ method: "GET",
+ path: "/desktop/plan",
+ responses: {
+ 200: z.object({ upgraded: z.boolean() }),
+ },
+ },
+ getS3Config: {
+ method: "GET",
+ path: "/desktop/s3/config/get",
+ responses: {
+ 200: z.object({
+ config: z.custom<{
+ provider: string;
+ accessKeyId: string | null;
+ secretAccessKey: string | null;
+ endpoint: string | null;
+ bucketName: string | null;
+ region: string | null;
+ }>(),
+ }),
+ },
+ },
+ setS3Config: {
+ method: "POST",
+ path: "/desktop/s3/config",
+ responses: {
+ 200: z.object({ success: z.literal(true) }),
+ },
+ body: z.object({
+ provider: z.string(),
+ accessKeyId: z.string(),
+ secretAccessKey: z.string(),
+ endpoint: z.string(),
+ bucketName: z.string(),
+ region: z.string(),
+ }),
+ },
+ deleteS3Config: {
+ method: "DELETE",
+ path: "/dekstop/s3/config/delete",
+ responses: { 200: z.object({ success: z.literal(true) }) },
+ },
+ testS3Config: {
+ method: "POST",
+ path: "/desktop/s3/config/test",
+ body: z.object({
+ provider: z.string(),
+ accessKeyId: z.string(),
+ secretAccessKey: z.string(),
+ endpoint: z.string(),
+ bucketName: z.string(),
+ region: z.string(),
+ }),
+ responses: { 200: z.object({ success: z.literal(true) }) },
+ },
+ getProSubscribeURL: {
+ method: "POST",
+ path: "/desktop/subscribe",
+ body: z.object({ priceId: z.string() }),
+ responses: {
+ 200: z.object({ url: z.string() }),
+ 400: z.object({
+ error: z.literal(true),
+ subscription: z.literal(true).optional(),
+ }),
+ 401: z.object({
+ error: z.literal(true),
+ auth: z.literal(false),
+ }),
+ },
+ },
+ },
+ {
+ baseHeaders: z.object({ authorization: z.string() }),
+ commonResponses: { 401: z.object({ error: z.string().or(z.boolean()) }) },
+ }
+);
+
+export default {
+ ...publicContract,
+ ...protectedContract,
+};
diff --git a/packages/web-api-contract/src/index.ts b/packages/web-api-contract/src/index.ts
index d83f9b8a7..b4b93a502 100644
--- a/packages/web-api-contract/src/index.ts
+++ b/packages/web-api-contract/src/index.ts
@@ -1,136 +1,35 @@
-import { initContract } from "@ts-rest/core";
import { z } from "zod";
+import desktop from "./desktop";
+import { c } from "./util";
-const c = initContract();
-
-const CHANGELOG = z.object({
- metadata: z.object({
- title: z.string(),
- app: z.string(),
- publishedAt: z.string(),
- version: z.string(),
- image: z.string().optional(),
- }),
- content: z.string(),
- slug: z.number(),
-});
-
-const publicContract = c.router({
- getChangelogPosts: {
- method: "GET",
- path: "/changelog",
- query: z.object({
- origin: z.string(),
- }),
- responses: {
- 200: z.array(
- z.object({ content: z.string() }).and(CHANGELOG.shape.metadata)
- ),
- },
- },
- getChangelogStatus: {
- method: "GET",
- path: "/changelog/status",
- query: z.object({
- version: z.string(),
- }),
- responses: {
- 200: z.object({ hasUpdate: z.boolean() }),
- },
- },
-});
-
-const protectedContract = c.router(
- {
- submitDesktopFeedback: {
- method: "POST",
- path: "/desktop/feedback",
- contentType: "application/x-www-form-urlencoded",
- body: z.object({ feedback: z.string() }),
- responses: {
- 200: z.object({ success: z.boolean() }),
- },
- },
- getUserPlan: {
- method: "GET",
- path: "/desktop/plan",
- responses: {
- 200: z.object({ upgraded: z.boolean() }),
- },
- },
- getS3Config: {
+export const contract = c.router({
+ desktop,
+ video: c.router({
+ getTranscribeStatus: {
method: "GET",
- path: "/desktop/s3/config/get",
+ path: "/video/transcribe/status",
+ query: z.object({ videoId: z.string() }),
responses: {
200: z.object({
- config: z.custom<{
- provider: string;
- accessKeyId: string | null;
- secretAccessKey: string | null;
- endpoint: string | null;
- bucketName: string | null;
- region: string | null;
- }>(),
+ transcriptionStatus: z
+ .custom<"PROCESSING" | "COMPLETE" | "ERROR">()
+ .nullable(),
}),
},
},
- setS3Config: {
- method: "POST",
- path: "/desktop/s3/config",
- responses: {
- 200: z.object({ success: z.literal(true) }),
- },
- body: z.object({
- provider: z.string(),
- accessKeyId: z.string(),
- secretAccessKey: z.string(),
- endpoint: z.string(),
- bucketName: z.string(),
- region: z.string(),
- }),
- },
- deleteS3Config: {
+ delete: {
method: "DELETE",
- path: "/dekstop/s3/config/delete",
- responses: { 200: z.object({ success: z.literal(true) }) },
- },
- testS3Config: {
- method: "POST",
- path: "/desktop/s3/config/test",
- body: z.object({
- provider: z.string(),
- accessKeyId: z.string(),
- secretAccessKey: z.string(),
- endpoint: z.string(),
- bucketName: z.string(),
- region: z.string(),
- }),
- responses: { 200: z.object({ success: z.literal(true) }) },
+ path: "/video/delete",
+ query: z.object({ videoId: z.string() }),
+ responses: { 200: z.unknown() },
},
- getProSubscribeURL: {
- method: "POST",
- path: "/desktop/subscribe",
- body: z.object({ priceId: z.string() }),
+ getAnalytics: {
+ method: "GET",
+ path: "/video/analytics",
+ query: z.object({ videoId: z.string() }),
responses: {
- 200: z.object({ url: z.string() }),
- 400: z.object({
- error: z.literal(true),
- subscription: z.literal(true).optional(),
- }),
- 401: z.object({
- error: z.literal(true),
- auth: z.literal(false),
- }),
+ 200: z.object({ count: z.number() }),
},
},
- },
- {
- baseHeaders: z.object({ authorization: z.string() }),
- commonResponses: { 401: z.object({ error: z.string().or(z.boolean()) }) },
- }
-);
-
-export const contract = c.router({
- ...publicContract,
- ...protectedContract,
+ }),
});
diff --git a/packages/web-api-contract/src/util.ts b/packages/web-api-contract/src/util.ts
new file mode 100644
index 000000000..ee3c6a64e
--- /dev/null
+++ b/packages/web-api-contract/src/util.ts
@@ -0,0 +1,3 @@
+import { initContract } from "@ts-rest/core";
+
+export const c = initContract();
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 16e44579b..19573e67a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -247,7 +247,7 @@ importers:
next-auth:
specifier: ^4.24.5
react:
specifier: ^18.2.0
version: 18.3.1
@@ -464,6 +464,9 @@ importers:
'@cap/utils':
specifier: workspace:*
version: link:../../packages/utils
+ '@cap/web-api-contract':
+ specifier: workspace:*
+ version: link:../../packages/web-api-contract
'@deepgram/sdk':
specifier: ^3.3.4
version: 3.7.0
@@ -506,6 +509,9 @@ importers:
'@tanstack/store':
specifier: ^0.5.5
version: 0.5.5
+ '@ts-rest/core':
+ specifier: ^3.51.0
+ version: 3.51.0(@types/[email protected])([email protected])
'@workos-inc/node':
specifier: ^7.34.0
@@ -729,7 +735,7 @@ importers:
next-auth:
specifier: ^4.24.5
react-email:
specifier: ^1.10.1
version: 1.10.1
@@ -751,7 +757,7 @@ importers:
version: 18.3.9
'@types/react-dom':
specifier: latest
- version: 18.3.1
+ version: 19.0.0
dotenv-cli:
specifier: latest
version: 7.4.4
@@ -789,25 +795,25 @@ importers:
'@radix-ui/react-dialog':
specifier: ^1.0.5
'@radix-ui/react-dropdown-menu':
specifier: ^2.0.6
'@radix-ui/react-label':
specifier: ^2.0.2
'@radix-ui/react-navigation-menu':
specifier: ^1.1.4
'@radix-ui/react-popover':
specifier: ^1.0.7
'@radix-ui/react-slot':
specifier: ^1.0.2
version: 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-switch':
specifier: ^1.1.0
'@tailwindcss/typography':
specifier: ^0.5.9
@@ -838,7 +844,7 @@ importers:
version: 18.3.9
'@types/react-dom':
specifier: latest
- version: 18.3.1
+ version: 19.0.0
'@vitejs/plugin-react':
specifier: ^4.0.3
@@ -4291,10 +4297,10 @@ packages:
react-dom:
optional: true
- '@storybook/[email protected]':
- resolution: {integrity: sha512-VUET1tIFRG0PwMiL9M1dF1CGGvuY2rN1ntvLW8T84GkV1CHjkNnpY8kKL3whMaDnWhAFHeeeZMTvXJ30MJBNag==}
+ '@storybook/[email protected]':
+ resolution: {integrity: sha512-jAfMwEt/mm469T3Vsx8E0xwCen8M+dd5zb87WUqgGbKZfle8xycZLNu2CvY6wlpIfxrLb+hHNRtFN/9W1i4Exg==}
peerDependencies:
- storybook: ^8.5.0-alpha.17
+ storybook: ^8.5.0-alpha.18
vite: ^4.0.0 || ^5.0.0 || ^6.0.0
'@storybook/[email protected]':
@@ -4305,10 +4311,10 @@ packages:
peerDependencies:
storybook: ^8.3.3
- '@storybook/[email protected]':
- resolution: {integrity: sha512-oQaIfeBBcitICVIR/WboYNg0jYyK8NizYduElnNGlt7yGtxf0Y090tqd1mC6gNRYPM6aAb9Eo9ui+3uKoMjOYQ==}
+ '@storybook/[email protected]':
+ resolution: {integrity: sha512-RYwwErCZBUEjpryOHjFR8ZlQNxlo5LRRMiOroNFnyiG2Mpc76ztJ3v8i+frhTgEMKofWcrhnc+rFjmTHh46pTQ==}
peerDependencies:
- storybook: ^8.5.0-alpha.17
+ storybook: ^8.5.0-alpha.18
'@storybook/[email protected]':
resolution: {integrity: sha512-dHYFQH3mA+EtnCkHXzicbLgsvzYjcDJ1JWsogbItZogkPHgSJM/Wr71uMkcvw8v9mmCyP4NpXJuu6bPoVsOnzg==}
@@ -4806,8 +4812,8 @@ packages:
resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==}
- '@types/[email protected]':
- resolution: {integrity: sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-1KfiQKsH1o00p9m5ag12axHQSb3FOU9H20UTrujVSkNhuCrRHiQWFqgEnTNK5ZNfnzZv8UWrnXVqCmCF9fgY3w==}
resolution: {integrity: sha512-UzjzmgY/VH3Str6DcAGTLMA1mVVhGOyARNTANExrirtp+JgxhaIOVDxq4TIRmpSi4voLv+w4HA9CC5GvhhCA0A==}
@@ -10748,15 +10754,6 @@ packages:
webpack-sources:
optional: true
- resolution: {integrity: sha512-jTPIs63W+DUEDW207ztbaoO7cQ4p5aVaB823LSlxpsFEU3Mykwxf3ZGC/wzxFJeZlASZYgVrWeo7LgOrqJZ8RA==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- webpack-sources: ^3
- peerDependenciesMeta:
- webpack-sources:
- optional: true
-
resolution: {integrity: sha512-5liCNPuJW8dqh3+DM6uNM2EI3MLLpCKp/KY+9pB5M2S2SR2qvvDHhKgBOaTWEbZTAws3CXfB0rKTIolWKL05VQ==}
engines: {node: '>=14.0.0'}
@@ -13737,26 +13734,26 @@ snapshots:
'@radix-ui/[email protected]': {}
dependencies:
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-slot': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -13809,18 +13806,18 @@ snapshots:
transitivePeerDependencies:
- '@types/react'
dependencies:
'@radix-ui/primitive': 1.1.0
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-focus-guards': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-focus-scope': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-focus-scope': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-slot': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
aria-hidden: 1.2.4
@@ -13829,7 +13826,7 @@ snapshots:
react-remove-scroll: 2.5.7(@types/[email protected])([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -13848,33 +13845,33 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
'@radix-ui/primitive': 1.1.0
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-escape-keydown': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@radix-ui/primitive': 1.1.0
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -13896,16 +13893,16 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -13920,31 +13917,31 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.9
dependencies:
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@radix-ui/primitive': 1.1.0
- '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-focus-guards': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-focus-scope': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-focus-scope': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-roving-focus': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-roving-focus': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-slot': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
aria-hidden: 1.2.4
@@ -13953,43 +13950,43 @@ snapshots:
react-remove-scroll: 2.5.7(@types/[email protected])([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@radix-ui/primitive': 1.1.0
- '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-previous': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-visually-hidden': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-visually-hidden': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@radix-ui/primitive': 1.1.0
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-dismissable-layer': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-focus-guards': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-focus-scope': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-focus-scope': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-slot': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
aria-hidden: 1.2.4
@@ -13998,15 +13995,15 @@ snapshots:
react-remove-scroll: 2.5.7(@types/[email protected])([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@floating-ui/react-dom': 2.1.2([email protected]([email protected]))([email protected])
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-rect': 1.1.0(@types/[email protected])([email protected])
@@ -14016,7 +14013,7 @@ snapshots:
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -14025,15 +14022,15 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -14043,7 +14040,7 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])
@@ -14051,7 +14048,7 @@ snapshots:
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -14060,31 +14057,31 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
'@radix-ui/react-slot': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
'@radix-ui/primitive': 1.1.0
- '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -14107,12 +14104,12 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.9
dependencies:
'@radix-ui/primitive': 1.1.0
'@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
'@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-previous': 1.1.0(@types/[email protected])([email protected])
'@radix-ui/react-use-size': 1.1.0(@types/[email protected])([email protected])
@@ -14120,7 +14117,7 @@ snapshots:
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
dependencies:
@@ -14190,14 +14187,14 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.9
dependencies:
- '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
react: 18.3.1
react-dom: 18.3.1([email protected])
optionalDependencies:
'@types/react': 18.3.9
- '@types/react-dom': 18.3.1
+ '@types/react-dom': 19.0.0
'@radix-ui/[email protected]': {}
@@ -14965,8 +14962,6 @@ snapshots:
rehype-slug: 6.0.0
storybook: 8.3.3
ts-dedent: 2.2.0
- transitivePeerDependencies:
- - webpack-sources
dependencies:
@@ -14981,8 +14976,6 @@ snapshots:
'@storybook/addon-viewport': 8.3.3([email protected])
storybook: 8.3.3
ts-dedent: 2.2.0
- transitivePeerDependencies:
- - webpack-sources
dependencies:
@@ -15049,9 +15042,9 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
dependencies:
- '@storybook/csf-plugin': 8.5.0-alpha.17([email protected])
+ '@storybook/csf-plugin': 8.5.0-alpha.18([email protected])
browser-assert: 1.2.1
storybook: 8.3.3
ts-dedent: 2.2.0
@@ -15080,11 +15073,9 @@ snapshots:
dependencies:
storybook: 8.3.3
- unplugin: 1.15.0
- transitivePeerDependencies:
- - webpack-sources
+ unplugin: 1.16.0
dependencies:
storybook: 8.3.3
unplugin: 1.16.0
@@ -15626,7 +15617,7 @@ snapshots:
dependencies:
'@types/react': 18.3.9
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
'@types/react': 18.3.9
@@ -15865,8 +15856,8 @@ snapshots:
dependencies:
'@mapbox/node-pre-gyp': 1.0.11
'@rollup/pluginutils': 4.2.1
- acorn: 8.12.1
- acorn-import-attributes: 1.9.5([email protected])
+ acorn: 8.14.0
+ acorn-import-attributes: 1.9.5([email protected])
async-sema: 3.1.1
bindings: 1.5.0
estree-walker: 2.0.2
@@ -16038,9 +16029,9 @@ snapshots:
mime-types: 2.1.35
negotiator: 0.6.3
dependencies:
- acorn: 8.12.1
+ acorn: 8.14.0
dependencies:
@@ -16056,7 +16047,7 @@ snapshots:
dependencies:
- acorn: 8.12.1
+ acorn: 8.14.0
dependencies:
@@ -17815,7 +17806,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.1
eslint-import-resolver-node: 0.3.9
hasown: 2.0.2
is-core-module: 2.15.1
is-glob: 4.0.3
@@ -20882,7 +20873,7 @@ snapshots:
dependencies:
- acorn: 8.12.1
+ acorn: 8.14.0
pathe: 1.1.2
pkg-types: 1.2.0
ufo: 1.5.4
@@ -20978,7 +20969,7 @@ snapshots:
optionalDependencies:
nodemailer: 6.9.15
dependencies:
'@babel/runtime': 7.25.6
'@panva/hkdf': 1.2.1
@@ -22622,7 +22613,7 @@ snapshots:
dependencies:
- '@storybook/builder-vite': 8.5.0-alpha.17([email protected])([email protected](@types/[email protected])([email protected]))
+ '@storybook/builder-vite': 8.5.0-alpha.18([email protected])([email protected](@types/[email protected])([email protected]))
transitivePeerDependencies:
- storybook
- vite
@@ -23401,11 +23392,6 @@ snapshots:
acorn: 8.12.1
webpack-virtual-modules: 0.6.2
- dependencies:
- acorn: 8.14.0
- webpack-virtual-modules: 0.6.2
-
dependencies:
acorn: 8.14.0
@@ -23442,9 +23428,7 @@ snapshots:
mlly: 1.7.1
pathe: 1.1.2
pkg-types: 1.2.0
- unplugin: 1.15.0
- transitivePeerDependencies:
- - webpack-sources
+ unplugin: 1.16.0
dependencies: