63 refetch: () => void;
64}) {
65 const { token, anthropicApiKey } = useAuth();
66 const [images, setImages] = useState<(string|null)[]>([]);
67 const [selectedFiles, setSelectedFiles] = useState<string[]>([]);
81 project,
82 branchId,
83 anthropicApiKey,
84 bearerToken: token,
85 selectedFiles,
32});
33
34// API endpoints
35app.post("/api/commits", async c => {
36 const { token, repo, owner, startDate, endDate } = await c.req.json();
37
55});
56
57app.post("/api/generate-notes", async c => {
58 const { commits } = await c.req.json();
59
77
78// Create a shareable link
79app.post("/api/share", async c => {
80 const data = await c.req.json() as CreateShareRequest;
81
113
114// Get shared release notes
115app.get("/api/share/:id", async c => {
116 const id = c.req.param("id");
117
1import { blob } from "https://esm.town/v/std/blob";
2
3export default async function(req: Request): Promise<Response> {
4 const token = req.headers.get("authorization")?.split(" ")?.at(1);
5
371 headers.map(field => {
372 const value = row[field] == null ? "" : String(row[field]);
373 // Basic CSV escaping: replace " with "" and wrap field in quotes if it contains , " or newline
374 const needsQuotes = /[,"\n]/.test(value);
375 const escapedValue = value.replace(/"/g, "\"\"");
865 headers.map(field => {
866 const value = row[field] == null ? "" : String(row[field]);
867 // Basic CSV escaping: replace " with "" and wrap field in quotes if it contains , " or newline
868 const needsQuotes = /[,"\n]/.test(value);
869 const escapedValue = value.replace(/"/g, "\"\"");
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
23 GROUP BY user_id, username
24 ORDER BY total_price DESC
2import { useAuth } from "./useAuth.tsx";
3
4const PROJECT_ENDPOINT = "/api/project";
5const FILES_ENDPOINT = "/api/project-files";
6
7export function useProject (projectId: string, branchId?: string) {
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/projects-loader";
5
6export function useProjects () {
3import { useAuth } from "./useAuth.tsx";
4
5const ENDPOINT = "/api/create-project";
6
7export function useCreateProject () {
2import { useAuth } from "./useAuth.tsx";
3
4const ENDPOINT = "/api/create-branch";
5
6export function useCreateBranch (projectId: string) {
6 project: any;
7 branchId: string | undefined;
8 anthropicApiKey: string;
9 bearerToken: string;
10 selectedFiles: string[];
16 project,
17 branchId,
18 anthropicApiKey,
19 bearerToken,
20 selectedFiles,
37 status,
38 } = useChat({
39 api: "/api/send-message",
40 body: {
41 project,
42 branchId,
43 anthropicApiKey,
44 selectedFiles,
45 images: images