Skip to content

Commit 437bc00

Browse files
committed
import videos
1 parent 3532dd3 commit 437bc00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1648
-503
lines changed

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dev": "pnpm -w cap-setup && dotenv -e ../../.env -- pnpm run preparescript && dotenv -e ../../.env -- pnpm tauri dev",
66
"build:tauri": "dotenv -e ../../.env -- pnpm run preparescript && dotenv -e ../../.env -- pnpm tauri build",
77
"preparescript": "node scripts/prepare.js",
8-
"localdev": "dotenv -e ../../.env -- vinxi dev --port 3001",
8+
"localdev": "dotenv -e ../../.env -- vinxi dev --port 3002",
99
"build": "vinxi build",
1010
"tauri": "tauri"
1111
},

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"mainBinaryName": "Cap - Development",
66
"build": {
77
"beforeDevCommand": "pnpm localdev",
8-
"devUrl": "http://localhost:3001",
8+
"devUrl": "http://localhost:3002",
99
"beforeBuildCommand": "pnpm turbo build --filter @cap/desktop",
1010
"frontendDist": "../.output/public"
1111
},

apps/discord-bot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"scripts": {
55
"deploy": "wrangler deploy",
6-
"dev": "wrangler dev",
6+
"bot-dev": "wrangler dev",
77
"start": "wrangler dev",
88
"test": "vitest",
99
"cf-typegen": "wrangler types"

apps/tasks/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"main": "src/index.ts",
66
"scripts": {
77
"start": "node dist/src/index.js",
8-
"dev": "ts-node src/index.ts",
98
"build": "tsc",
109
"start:dist": "node dist/src/index.js",
1110
"test": "jest",

apps/web/app/(org)/dashboard/admin/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import AdminDashboardClient from "./AdminDashboardClient";
55
export default async function AdminDashboard() {
66
const currentUser = await getCurrentUser();
77

8-
if (currentUser?.email !== "richie@mcilroy.co") {
8+
if (
9+
currentUser?.email !== "richie@mcilroy.co" ||
10+
currentUser.email.endsWith("@cap.so")
11+
) {
912
redirect("/dashboard");
1013
}
1114

apps/web/app/(org)/verify-otp/form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function VerifyOTPForm({
7878
// shoutout https://github.com/buoyad/Tally/pull/14
7979
const res = await fetch(
8080
`/api/auth/callback/email?email=${encodeURIComponent(email)}&token=${encodeURIComponent(otpCode)}&callbackUrl=${encodeURIComponent("/login-success")}`,
81+
{ redirect: "manual" },
8182
);
8283

8384
if (!res.url.includes("/login-success")) {

apps/web/app/api/desktop/[...route]/session.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { db } from "@cap/database";
2-
import { authOptions } from "@cap/database/auth/auth-options";
32
import { getCurrentUser } from "@cap/database/auth/session";
43
import { authApiKeys } from "@cap/database/schema";
54
import { serverEnv } from "@cap/env";
65
import { zValidator } from "@hono/zod-validator";
76
import { Hono } from "hono";
87
import { getCookie } from "hono/cookie";
9-
import { getServerSession } from "next-auth";
108
import { decode } from "next-auth/jwt";
119
import { z } from "zod";
1210

apps/web/app/api/erpc/workflows/route.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import {
2+
CurrentUser,
3+
HttpAuthMiddleware,
4+
Loom,
5+
Workflows,
6+
} from "@cap/web-domain";
7+
import {
8+
HttpApi,
9+
HttpApiBuilder,
10+
HttpApiEndpoint,
11+
HttpApiError,
12+
HttpApiGroup,
13+
} from "@effect/platform";
14+
import { Effect, Layer, Option, Schema } from "effect";
15+
import { apiToHandler } from "@/lib/server";
16+
17+
export const revalidate = "force-dynamic";
18+
19+
class Api extends HttpApi.make("CapWebApi")
20+
.add(
21+
HttpApiGroup.make("root").add(
22+
HttpApiEndpoint.post("loom")`/import-video`
23+
.setPayload(
24+
Schema.Struct({
25+
loom: Schema.Struct({
26+
downloadUrl: Schema.String,
27+
videoId: Schema.String,
28+
}),
29+
}),
30+
)
31+
.middleware(HttpAuthMiddleware)
32+
.addError(HttpApiError.InternalServerError),
33+
),
34+
)
35+
.prefix("/api/loom") {}
36+
37+
const ApiLive = HttpApiBuilder.api(Api).pipe(
38+
Layer.provide(
39+
HttpApiBuilder.group(Api, "root", (handlers) =>
40+
handlers.handle(
41+
"loom",
42+
Effect.fn(
43+
function* ({ payload }) {
44+
const { workflows } = yield* Workflows.HttpClient;
45+
const user = yield* CurrentUser;
46+
47+
yield* workflows.LoomImportVideo({
48+
payload: {
49+
cap: {
50+
userId: user.id,
51+
orgId: user.activeOrgId,
52+
},
53+
loom: {
54+
userId: "loomVideoId123",
55+
orgId: "loomOrgId123",
56+
video: {
57+
id: payload.loom.videoId,
58+
name: "loom video name",
59+
downloadUrl: payload.loom.downloadUrl,
60+
width: Option.none(),
61+
height: Option.none(),
62+
durationSecs: Option.none(),
63+
fps: Option.none(),
64+
},
65+
},
66+
},
67+
});
68+
},
69+
(e) =>
70+
e.pipe(
71+
Effect.tapDefect(Effect.log),
72+
Effect.catchAll(() => new HttpApiError.InternalServerError()),
73+
),
74+
),
75+
),
76+
),
77+
),
78+
);
79+
80+
const { handler } = apiToHandler(ApiLive);
81+
82+
export const GET = handler;
83+
export const HEAD = handler;
84+
export const POST = handler;

apps/web/app/api/playlist/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const ApiLive = HttpApiBuilder.api(Api).pipe(
6161
);
6262

6363
const [S3ProviderLayer, customBucket] =
64-
yield* s3Buckets.getProviderById(video.bucketId);
64+
yield* s3Buckets.getProviderForBucket(video.bucketId);
6565

6666
return yield* getPlaylistResponse(
6767
video,

0 commit comments

Comments
 (0)