mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
Merge pull request #343 from Monadical-SAS/exp-move-to-openapi-typescript-codegen
Upload file / NextJS 14 / Move to openapi typescript codegen
This commit is contained in:
@@ -24,6 +24,11 @@ It also uses https://github.com/fief-dev for authentication, and Vercel for depl
|
||||
- [Back-End](#back-end)
|
||||
- [Installation](#installation-1)
|
||||
- [Start the API/Backend](#start-the-apibackend)
|
||||
- [Redis (Mac)](#redis-mac)
|
||||
- [Redis (Windows)](#redis-windows)
|
||||
- [Update the database schema (run on first install, and after each pull containing a migration)](#update-the-database-schema-run-on-first-install-and-after-each-pull-containing-a-migration)
|
||||
- [Main Server](#main-server)
|
||||
- [Crontab (optional)](#crontab-optional)
|
||||
- [Using docker](#using-docker)
|
||||
- [Using local GPT4All](#using-local-gpt4all)
|
||||
- [Using local files](#using-local-files)
|
||||
@@ -152,7 +157,7 @@ redis-server
|
||||
## Update the database schema (run on first install, and after each pull containing a migration)
|
||||
|
||||
```bash
|
||||
poetry run python alembic head
|
||||
poetry run alembic heads
|
||||
```
|
||||
|
||||
## Main Server
|
||||
|
||||
@@ -72,18 +72,18 @@ export default function TranscriptBrowser() {
|
||||
<></>
|
||||
)}
|
||||
|
||||
{item.sourceLanguage ? (
|
||||
{item.source_language ? (
|
||||
<div className="inline-block bg-blue-500 text-white px-2 py-1 rounded-full text-xs font-semibold">
|
||||
{item.sourceLanguage}
|
||||
{item.source_language}
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
<div className="text-xs text-gray-700">
|
||||
{new Date(item.createdAt).toLocaleDateString("en-US")}
|
||||
{new Date(item.created_at).toLocaleDateString("en-US")}
|
||||
</div>
|
||||
<div className="text-sm">{item.shortSummary}</div>
|
||||
<div className="text-sm">{item.short_summary}</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import "../styles/globals.scss";
|
||||
import { Poppins } from "next/font/google";
|
||||
import { Metadata } from "next";
|
||||
import { Metadata, Viewport } from "next";
|
||||
import FiefWrapper from "../(auth)/fiefWrapper";
|
||||
import UserInfo from "../(auth)/userInfo";
|
||||
import { ErrorProvider } from "../(errors)/errorContext";
|
||||
@@ -17,7 +17,15 @@ import { SESSION_COOKIE_NAME } from "../lib/fief";
|
||||
|
||||
const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] });
|
||||
|
||||
export const viewport: Viewport = {
|
||||
themeColor: "black",
|
||||
width: "device-width",
|
||||
initialScale: 1,
|
||||
maximumScale: 1,
|
||||
};
|
||||
|
||||
export const metadata: Metadata = {
|
||||
metadataBase: new URL(process.env.DEV_URL || "https://reflector.media"),
|
||||
title: {
|
||||
template: "%s – Reflector",
|
||||
default: "Reflector - AI-Powered Meeting Transcriptions by Monadical",
|
||||
@@ -54,12 +62,6 @@ export const metadata: Metadata = {
|
||||
shortcut: "/r-icon.png",
|
||||
apple: "/r-icon.png",
|
||||
},
|
||||
viewport: {
|
||||
width: "device-width",
|
||||
initialScale: 1,
|
||||
maximumScale: 1,
|
||||
},
|
||||
|
||||
robots: { index: false, follow: false, noarchive: true, noimageindex: true },
|
||||
};
|
||||
|
||||
|
||||
@@ -16,9 +16,8 @@ import ShareModal from "./shareModal";
|
||||
import Player from "../player";
|
||||
import WaveformLoading from "../waveformLoading";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { featureEnabled } from "../../domainContext";
|
||||
import { toShareMode } from "../../../lib/shareMode";
|
||||
|
||||
type TranscriptDetails = {
|
||||
params: {
|
||||
@@ -91,7 +90,7 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
<Player
|
||||
topics={topics?.topics || []}
|
||||
useActiveTopic={useActiveTopic}
|
||||
waveform={waveform.waveform.data}
|
||||
waveform={waveform.waveform}
|
||||
media={mp3.media}
|
||||
mediaDuration={transcript.response.duration}
|
||||
/>
|
||||
@@ -110,10 +109,10 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
|
||||
<div className="w-full h-full grid grid-rows-layout-one grid-cols-1 gap-2 lg:gap-4">
|
||||
<section className=" bg-blue-400/20 rounded-lg md:rounded-xl p-2 md:px-4 h-full">
|
||||
{transcript.response.longSummary ? (
|
||||
{transcript.response.long_summary ? (
|
||||
<FinalSummary
|
||||
fullTranscript={fullTranscript}
|
||||
summary={transcript.response.longSummary}
|
||||
summary={transcript.response.long_summary}
|
||||
transcriptId={transcript.response.id}
|
||||
openZulipModal={() => setShowModal(true)}
|
||||
/>
|
||||
@@ -142,8 +141,8 @@ export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
<div className="flex-grow max-w-full">
|
||||
<ShareLink
|
||||
transcriptId={transcript?.response?.id}
|
||||
userId={transcript?.response?.userId}
|
||||
shareMode={transcript?.response?.shareMode}
|
||||
userId={transcript?.response?.user_id}
|
||||
shareMode={toShareMode(transcript?.response?.share_mode)}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -75,10 +75,8 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
}, [webSockets.status.value, transcript.response?.status]);
|
||||
|
||||
useEffect(() => {
|
||||
if (webSockets.duration) {
|
||||
mp3.getNow();
|
||||
}
|
||||
}, [webSockets.duration]);
|
||||
if (transcript.response?.status === "ended") mp3.getNow();
|
||||
}, [transcript.response]);
|
||||
|
||||
useEffect(() => {
|
||||
lockWakeState();
|
||||
@@ -112,6 +110,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
}}
|
||||
getAudioStream={getAudioStream}
|
||||
audioDevices={audioDevices}
|
||||
transcriptId={details.params.transcriptId}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -1,48 +1,32 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
DefaultApi,
|
||||
V1TranscriptsCreateRequest,
|
||||
} from "../../api/apis/DefaultApi";
|
||||
import { GetTranscript } from "../../api";
|
||||
import { useState } from "react";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import { GetTranscript, CreateTranscript } from "../../api";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
type CreateTranscript = {
|
||||
response: GetTranscript | null;
|
||||
type UseTranscript = {
|
||||
transcript: GetTranscript | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
create: (params: V1TranscriptsCreateRequest["createTranscript"]) => void;
|
||||
create: (transcriptCreationDetails: CreateTranscript) => void;
|
||||
};
|
||||
|
||||
const useCreateTranscript = (): CreateTranscript => {
|
||||
const [response, setResponse] = useState<GetTranscript | null>(null);
|
||||
const useCreateTranscript = (): UseTranscript => {
|
||||
const [transcript, setTranscript] = useState<GetTranscript | null>(null);
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [error, setErrorState] = useState<Error | null>(null);
|
||||
const { setError } = useError();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
const create = (params: V1TranscriptsCreateRequest["createTranscript"]) => {
|
||||
const create = (transcriptCreationDetails: CreateTranscript) => {
|
||||
if (loading || !api) return;
|
||||
|
||||
setLoading(true);
|
||||
const requestParameters: V1TranscriptsCreateRequest = {
|
||||
createTranscript: {
|
||||
name: params.name || "Unnamed Transcript", // Default
|
||||
targetLanguage: params.targetLanguage || "en", // Default
|
||||
},
|
||||
};
|
||||
|
||||
console.debug(
|
||||
"POST - /v1/transcripts/ - Requesting new transcription creation",
|
||||
requestParameters,
|
||||
);
|
||||
|
||||
api
|
||||
.v1TranscriptsCreate(requestParameters)
|
||||
.then((result) => {
|
||||
setResponse(result);
|
||||
.v1TranscriptsCreate(transcriptCreationDetails)
|
||||
.then((transcript) => {
|
||||
setTranscript(transcript);
|
||||
setLoading(false);
|
||||
console.debug("New transcript created:", result);
|
||||
})
|
||||
.catch((err) => {
|
||||
setError(
|
||||
@@ -54,7 +38,7 @@ const useCreateTranscript = (): CreateTranscript => {
|
||||
});
|
||||
};
|
||||
|
||||
return { response, loading, error, create };
|
||||
return { transcript, loading, error, create };
|
||||
};
|
||||
|
||||
export default useCreateTranscript;
|
||||
|
||||
50
www/app/[domain]/transcripts/fileUploadButton.tsx
Normal file
50
www/app/[domain]/transcripts/fileUploadButton.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
import React from "react";
|
||||
import useApi from "../../lib/useApi";
|
||||
import { Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post } from "../../api";
|
||||
|
||||
type FileUploadButton = {
|
||||
transcriptId: string;
|
||||
};
|
||||
|
||||
export default function FileUploadButton(props: FileUploadButton) {
|
||||
const fileInputRef = React.useRef<HTMLInputElement>(null);
|
||||
const api = useApi();
|
||||
|
||||
const triggerFileUpload = () => {
|
||||
fileInputRef.current?.click();
|
||||
};
|
||||
|
||||
const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = event.target.files?.[0];
|
||||
|
||||
if (file) {
|
||||
console.log("Calling api.v1TranscriptRecordUpload()...");
|
||||
|
||||
// Create an object of the expected type
|
||||
const uploadData = {
|
||||
file: file,
|
||||
// Add other properties if required by the type definition
|
||||
};
|
||||
|
||||
api?.v1TranscriptRecordUpload(props.transcriptId, uploadData);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
className="bg-blue-400 hover:bg-blue-500 focus-visible:bg-blue-500 text-white ml-2 md:ml:4 md:h-[78px] md:min-w-[100px] text-lg"
|
||||
onClick={triggerFileUpload}
|
||||
>
|
||||
Upload File
|
||||
</button>
|
||||
|
||||
<input
|
||||
type="file"
|
||||
ref={fileInputRef}
|
||||
style={{ display: "none" }}
|
||||
onChange={handleFileUpload}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -2,8 +2,9 @@ import { useRef, useState } from "react";
|
||||
import React from "react";
|
||||
import Markdown from "react-markdown";
|
||||
import "../../styles/markdown.css";
|
||||
import getApi from "../../lib/getApi";
|
||||
import { featureEnabled } from "../domainContext";
|
||||
import { UpdateTranscript } from "../../api";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
type FinalSummaryProps = {
|
||||
summary: string;
|
||||
@@ -19,17 +20,17 @@ export default function FinalSummary(props: FinalSummaryProps) {
|
||||
const [isEditMode, setIsEditMode] = useState(false);
|
||||
const [preEditSummary, setPreEditSummary] = useState(props.summary);
|
||||
const [editedSummary, setEditedSummary] = useState(props.summary);
|
||||
const api = getApi();
|
||||
|
||||
const updateSummary = async (newSummary: string, transcriptId: string) => {
|
||||
if (!api) return;
|
||||
try {
|
||||
const updatedTranscript = await api.v1TranscriptUpdate({
|
||||
const api = useApi();
|
||||
const requestBody: UpdateTranscript = {
|
||||
long_summary: newSummary,
|
||||
};
|
||||
const updatedTranscript = await api?.v1TranscriptUpdate(
|
||||
transcriptId,
|
||||
updateTranscript: {
|
||||
longSummary: newSummary,
|
||||
},
|
||||
});
|
||||
requestBody,
|
||||
);
|
||||
console.log("Updated long summary:", updatedTranscript);
|
||||
} catch (err) {
|
||||
console.error("Failed to update long summary:", err);
|
||||
|
||||
@@ -18,7 +18,7 @@ const TranscriptCreate = () => {
|
||||
const isAuthenticated = useFiefIsAuthenticated();
|
||||
const requireLogin = featureEnabled("requireLogin");
|
||||
|
||||
const [name, setName] = useState<string>();
|
||||
const [name, setName] = useState<string>("");
|
||||
const nameChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setName(event.target.value);
|
||||
};
|
||||
@@ -35,13 +35,13 @@ const TranscriptCreate = () => {
|
||||
const send = () => {
|
||||
if (loadingSend || createTranscript.loading || permissionDenied) return;
|
||||
setLoadingSend(true);
|
||||
createTranscript.create({ name, targetLanguage });
|
||||
createTranscript.create({ name, target_language: targetLanguage });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
createTranscript.response &&
|
||||
router.push(`/transcripts/${createTranscript.response.id}/record`);
|
||||
}, [createTranscript.response]);
|
||||
createTranscript.transcript &&
|
||||
router.push(`/transcripts/${createTranscript.transcript.id}/record`);
|
||||
}, [createTranscript.transcript]);
|
||||
|
||||
useEffect(() => {
|
||||
if (createTranscript.error) setLoadingSend(false);
|
||||
@@ -59,6 +59,7 @@ const TranscriptCreate = () => {
|
||||
<h1 className="text-2xl font-bold mb-2">
|
||||
Welcome to reflector.media
|
||||
</h1>
|
||||
<button>Test upload</button>
|
||||
<p>
|
||||
Reflector is a transcription and summarization pipeline that
|
||||
transforms audio into knowledge.
|
||||
|
||||
@@ -14,7 +14,7 @@ type PlayerProps = {
|
||||
Topic | null,
|
||||
React.Dispatch<React.SetStateAction<Topic | null>>,
|
||||
];
|
||||
waveform: AudioWaveform["data"];
|
||||
waveform: AudioWaveform;
|
||||
media: HTMLMediaElement;
|
||||
mediaDuration: number;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ import AudioInputsDropdown from "./audioInputsDropdown";
|
||||
import { Option } from "react-dropdown";
|
||||
import { waveSurferStyles } from "../../styles/recorder";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import FileUploadButton from "./fileUploadButton";
|
||||
|
||||
type RecorderProps = {
|
||||
setStream: React.Dispatch<React.SetStateAction<MediaStream | null>>;
|
||||
@@ -19,6 +20,7 @@ type RecorderProps = {
|
||||
onRecord?: () => void;
|
||||
getAudioStream: (deviceId) => Promise<MediaStream | null>;
|
||||
audioDevices: Option[];
|
||||
transcriptId: string;
|
||||
};
|
||||
|
||||
export default function Recorder(props: RecorderProps) {
|
||||
@@ -307,6 +309,11 @@ export default function Recorder(props: RecorderProps) {
|
||||
>
|
||||
{isRecording ? "Stop" : "Record"}
|
||||
</button>
|
||||
|
||||
<FileUploadButton
|
||||
transcriptId={props.transcriptId}
|
||||
></FileUploadButton>
|
||||
|
||||
{!isRecording && (
|
||||
<button
|
||||
className={`${
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { useState, useRef, useEffect, use } from "react";
|
||||
import { featureEnabled } from "../domainContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import { useFiefUserinfo } from "@fief/fief/nextjs/react";
|
||||
import SelectSearch from "react-select-search";
|
||||
import "react-select-search/style.css";
|
||||
@@ -8,11 +7,13 @@ import "../../styles/button.css";
|
||||
import "../../styles/form.scss";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
import { UpdateTranscript } from "../../api";
|
||||
import { ShareMode, toShareMode } from "../../lib/shareMode";
|
||||
import useApi from "../../lib/useApi";
|
||||
type ShareLinkProps = {
|
||||
transcriptId: string;
|
||||
userId: string | null;
|
||||
shareMode: string;
|
||||
shareMode: ShareMode;
|
||||
};
|
||||
|
||||
const ShareLink = (props: ShareLinkProps) => {
|
||||
@@ -21,10 +22,10 @@ const ShareLink = (props: ShareLinkProps) => {
|
||||
const [currentUrl, setCurrentUrl] = useState<string>("");
|
||||
const requireLogin = featureEnabled("requireLogin");
|
||||
const [isOwner, setIsOwner] = useState(false);
|
||||
const [shareMode, setShareMode] = useState(props.shareMode);
|
||||
const [shareMode, setShareMode] = useState<ShareMode>(props.shareMode);
|
||||
const [shareLoading, setShareLoading] = useState(false);
|
||||
const userinfo = useFiefUserinfo();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentUrl(window.location.href);
|
||||
@@ -48,15 +49,19 @@ const ShareLink = (props: ShareLinkProps) => {
|
||||
};
|
||||
|
||||
const updateShareMode = async (selectedShareMode: string) => {
|
||||
if (!api) return;
|
||||
if (!api)
|
||||
throw new Error("ShareLink's API should always be ready at this point");
|
||||
|
||||
setShareLoading(true);
|
||||
const updatedTranscript = await api.v1TranscriptUpdate({
|
||||
transcriptId: props.transcriptId,
|
||||
updateTranscript: {
|
||||
shareMode: selectedShareMode,
|
||||
},
|
||||
});
|
||||
setShareMode(updatedTranscript.shareMode);
|
||||
const requestBody: UpdateTranscript = {
|
||||
share_mode: toShareMode(selectedShareMode),
|
||||
};
|
||||
|
||||
const updatedTranscript = await api.v1TranscriptUpdate(
|
||||
props.transcriptId,
|
||||
requestBody,
|
||||
);
|
||||
setShareMode(toShareMode(updatedTranscript.share_mode));
|
||||
setShareLoading(false);
|
||||
};
|
||||
const privacyEnabled = featureEnabled("privacy");
|
||||
@@ -89,7 +94,7 @@ const ShareLink = (props: ShareLinkProps) => {
|
||||
{ name: "Secure", value: "semi-private" },
|
||||
{ name: "Public", value: "public" },
|
||||
]}
|
||||
value={shareMode}
|
||||
value={shareMode?.toString()}
|
||||
onChange={updateShareMode}
|
||||
closeOnSelect={true}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import getApi from "../../lib/getApi";
|
||||
import { UpdateTranscript } from "../../api";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
type TranscriptTitle = {
|
||||
title: string;
|
||||
@@ -10,17 +11,19 @@ const TranscriptTitle = (props: TranscriptTitle) => {
|
||||
const [displayedTitle, setDisplayedTitle] = useState(props.title);
|
||||
const [preEditTitle, setPreEditTitle] = useState(props.title);
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
const updateTitle = async (newTitle: string, transcriptId: string) => {
|
||||
if (!api) return;
|
||||
try {
|
||||
const updatedTranscript = await api.v1TranscriptUpdate({
|
||||
const requestBody: UpdateTranscript = {
|
||||
title: newTitle,
|
||||
};
|
||||
const api = useApi();
|
||||
const updatedTranscript = await api?.v1TranscriptUpdate(
|
||||
transcriptId,
|
||||
updateTranscript: {
|
||||
title: newTitle,
|
||||
},
|
||||
});
|
||||
requestBody,
|
||||
);
|
||||
console.log("Updated transcript:", updatedTranscript);
|
||||
} catch (err) {
|
||||
console.error("Failed to update transcript:", err);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { DomainContext } from "../domainContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import getApi from "../../lib/useApi";
|
||||
import { useFiefAccessTokenInfo } from "@fief/fief/build/esm/nextjs/react";
|
||||
|
||||
export type Mp3Response = {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
DefaultApi,
|
||||
V1TranscriptGetTopicsRequest,
|
||||
} from "../../api/apis/DefaultApi";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import { Topic } from "./webSocketTypes";
|
||||
import getApi from "../../lib/getApi";
|
||||
import useApi from "../../lib/useApi";
|
||||
import { shouldShowError } from "../../lib/errorUtils";
|
||||
|
||||
type TranscriptTopics = {
|
||||
@@ -19,17 +15,14 @@ const useTopics = (id: string): TranscriptTopics => {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [error, setErrorState] = useState<Error | null>(null);
|
||||
const { setError } = useError();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
if (!id || !api) return;
|
||||
|
||||
setLoading(true);
|
||||
const requestParameters: V1TranscriptGetTopicsRequest = {
|
||||
transcriptId: id,
|
||||
};
|
||||
api
|
||||
.v1TranscriptGetTopics(requestParameters)
|
||||
.v1TranscriptGetTopics(id)
|
||||
.then((result) => {
|
||||
setTopics(result);
|
||||
setLoading(false);
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { V1TranscriptGetRequest } from "../../api/apis/DefaultApi";
|
||||
import { GetTranscript } from "../../api";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import { shouldShowError } from "../../lib/errorUtils";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
type ErrorTranscript = {
|
||||
error: Error;
|
||||
@@ -30,17 +29,15 @@ const useTranscript = (
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setErrorState] = useState<Error | null>(null);
|
||||
const { setError } = useError();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
if (!id || !api) return;
|
||||
|
||||
setLoading(true);
|
||||
const requestParameters: V1TranscriptGetRequest = {
|
||||
transcriptId: id,
|
||||
};
|
||||
|
||||
api
|
||||
.v1TranscriptGet(requestParameters)
|
||||
.v1TranscriptGet(id)
|
||||
.then((result) => {
|
||||
setResponse(result);
|
||||
setLoading(false);
|
||||
|
||||
@@ -1,32 +1,28 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { GetTranscriptFromJSON, PageGetTranscript } from "../../api";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import useApi from "../../lib/useApi";
|
||||
import { Page_GetTranscript_ } from "../../api";
|
||||
|
||||
type TranscriptList = {
|
||||
response: PageGetTranscript | null;
|
||||
response: Page_GetTranscript_ | null;
|
||||
loading: boolean;
|
||||
error: Error | null;
|
||||
};
|
||||
|
||||
//always protected
|
||||
const useTranscriptList = (page: number): TranscriptList => {
|
||||
const [response, setResponse] = useState<PageGetTranscript | null>(null);
|
||||
const [response, setResponse] = useState<Page_GetTranscript_ | null>(null);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setErrorState] = useState<Error | null>(null);
|
||||
const { setError } = useError();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
if (!api) return;
|
||||
setLoading(true);
|
||||
api
|
||||
.v1TranscriptsList({ page })
|
||||
.v1TranscriptsList(page)
|
||||
.then((response) => {
|
||||
// issue with API layer, conversion for items is not happening
|
||||
response.items = response.items.map((item) =>
|
||||
GetTranscriptFromJSON(item),
|
||||
);
|
||||
setResponse(response);
|
||||
setLoading(false);
|
||||
})
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { V1TranscriptGetAudioWaveformRequest } from "../../api/apis/DefaultApi";
|
||||
import { AudioWaveform } from "../../api";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import useApi from "../../lib/useApi";
|
||||
import { shouldShowError } from "../../lib/errorUtils";
|
||||
|
||||
type AudioWaveFormResponse = {
|
||||
@@ -16,16 +15,13 @@ const useWaveform = (id: string): AudioWaveFormResponse => {
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setErrorState] = useState<Error | null>(null);
|
||||
const { setError } = useError();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
if (!id || !api) return;
|
||||
setLoading(true);
|
||||
const requestParameters: V1TranscriptGetAudioWaveformRequest = {
|
||||
transcriptId: id,
|
||||
};
|
||||
api
|
||||
.v1TranscriptGetAudioWaveform(requestParameters)
|
||||
.v1TranscriptGetAudioWaveform(id)
|
||||
.then((result) => {
|
||||
setWaveform(result);
|
||||
setLoading(false);
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import Peer from "simple-peer";
|
||||
import {
|
||||
DefaultApi,
|
||||
V1TranscriptRecordWebrtcRequest,
|
||||
} from "../../api/apis/DefaultApi";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import getApi from "../../lib/getApi";
|
||||
import useApi from "../../lib/useApi";
|
||||
import { RtcOffer } from "../../api";
|
||||
|
||||
const useWebRTC = (
|
||||
stream: MediaStream | null,
|
||||
@@ -13,7 +10,7 @@ const useWebRTC = (
|
||||
): Peer => {
|
||||
const [peer, setPeer] = useState<Peer | null>(null);
|
||||
const { setError } = useError();
|
||||
const api = getApi();
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
if (!stream || !transcriptId) {
|
||||
@@ -38,16 +35,13 @@ const useWebRTC = (
|
||||
p.on("signal", (data: any) => {
|
||||
if (!api) return;
|
||||
if ("sdp" in data) {
|
||||
const requestParameters: V1TranscriptRecordWebrtcRequest = {
|
||||
transcriptId: transcriptId,
|
||||
rtcOffer: {
|
||||
sdp: data.sdp,
|
||||
type: data.type,
|
||||
},
|
||||
const rtcOffer: RtcOffer = {
|
||||
sdp: data.sdp,
|
||||
type: data.type,
|
||||
};
|
||||
|
||||
api
|
||||
.v1TranscriptRecordWebrtc(requestParameters)
|
||||
.v1TranscriptRecordWebrtc(transcriptId, rtcOffer)
|
||||
.then((answer) => {
|
||||
try {
|
||||
p.signal(answer);
|
||||
|
||||
@@ -2,7 +2,8 @@ import { useContext, useEffect, useState } from "react";
|
||||
import { Topic, FinalSummary, Status } from "./webSocketTypes";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import { DomainContext } from "../domainContext";
|
||||
import { AudioWaveform } from "../../api";
|
||||
import { AudioWaveform, GetTranscriptSegmentTopic } from "../../api";
|
||||
import useApi from "../../lib/useApi";
|
||||
|
||||
export type UseWebSockets = {
|
||||
transcriptText: string;
|
||||
@@ -11,7 +12,7 @@ export type UseWebSockets = {
|
||||
topics: Topic[];
|
||||
finalSummary: FinalSummary;
|
||||
status: Status;
|
||||
waveform: AudioWaveform["data"] | null;
|
||||
waveform: AudioWaveform | null;
|
||||
duration: number | null;
|
||||
};
|
||||
|
||||
@@ -32,6 +33,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||
const { setError } = useError();
|
||||
|
||||
const { websocket_url } = useContext(DomainContext);
|
||||
const api = useApi();
|
||||
|
||||
useEffect(() => {
|
||||
if (isProcessing || textQueue.length === 0) {
|
||||
@@ -57,6 +59,39 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||
useEffect(() => {
|
||||
document.onkeyup = (e) => {
|
||||
if (e.key === "a" && process.env.NEXT_PUBLIC_ENV === "development") {
|
||||
const segments: GetTranscriptSegmentTopic[] = [
|
||||
{
|
||||
speaker: 1,
|
||||
start: 0,
|
||||
text: "This is the transcription of an example title",
|
||||
},
|
||||
{
|
||||
speaker: 2,
|
||||
start: 10,
|
||||
text: "This is the second speaker",
|
||||
},
|
||||
{
|
||||
speaker: 3,
|
||||
start: 90,
|
||||
text: "This is the third speaker",
|
||||
},
|
||||
{
|
||||
speaker: 4,
|
||||
start: 90,
|
||||
text: "This is the fourth speaker",
|
||||
},
|
||||
{
|
||||
speaker: 5,
|
||||
start: 123,
|
||||
text: "This is the fifth speaker",
|
||||
},
|
||||
{
|
||||
speaker: 6,
|
||||
start: 300,
|
||||
text: "This is the sixth speaker",
|
||||
},
|
||||
];
|
||||
|
||||
setTranscriptText("Lorem Ipsum");
|
||||
setTopics([
|
||||
{
|
||||
@@ -67,39 +102,6 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||
title: "Topic 1: Introduction to Quantum Mechanics",
|
||||
transcript:
|
||||
"A brief overview of quantum mechanics and its principles.",
|
||||
segments: [
|
||||
{
|
||||
speaker: 1,
|
||||
start: 0,
|
||||
text: "This is the transcription of an example title",
|
||||
},
|
||||
{
|
||||
speaker: 2,
|
||||
start: 10,
|
||||
text: "This is the second speaker",
|
||||
},
|
||||
,
|
||||
{
|
||||
speaker: 3,
|
||||
start: 90,
|
||||
text: "This is the third speaker",
|
||||
},
|
||||
{
|
||||
speaker: 4,
|
||||
start: 90,
|
||||
text: "This is the fourth speaker",
|
||||
},
|
||||
{
|
||||
speaker: 5,
|
||||
start: 123,
|
||||
text: "This is the fifth speaker",
|
||||
},
|
||||
{
|
||||
speaker: 6,
|
||||
start: 300,
|
||||
text: "This is the sixth speaker",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
@@ -306,7 +308,9 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||
}
|
||||
};
|
||||
|
||||
if (!transcriptId) return;
|
||||
if (!transcriptId || !api) return;
|
||||
|
||||
api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => {});
|
||||
|
||||
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
|
||||
let ws = new WebSocket(url);
|
||||
@@ -412,7 +416,9 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||
console.debug("WebSocket connection closed");
|
||||
switch (event.code) {
|
||||
case 1000: // Normal Closure:
|
||||
break;
|
||||
case 1005: // Closure by client FF
|
||||
break;
|
||||
default:
|
||||
setError(
|
||||
new Error(`WebSocket closed unexpectedly with code: ${event.code}`),
|
||||
@@ -431,7 +437,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||
return () => {
|
||||
ws.close();
|
||||
};
|
||||
}, [transcriptId]);
|
||||
}, [transcriptId, !api]);
|
||||
|
||||
return {
|
||||
transcriptText,
|
||||
|
||||
36
www/app/api/Api.ts
Normal file
36
www/app/api/Api.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseHttpRequest } from "./core/BaseHttpRequest";
|
||||
import type { OpenAPIConfig } from "./core/OpenAPI";
|
||||
import { FetchHttpRequest } from "./core/FetchHttpRequest";
|
||||
|
||||
import { DefaultService } from "./services/DefaultService";
|
||||
|
||||
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
||||
|
||||
export class Api {
|
||||
public readonly default: DefaultService;
|
||||
|
||||
public readonly request: BaseHttpRequest;
|
||||
|
||||
constructor(
|
||||
config?: Partial<OpenAPIConfig>,
|
||||
HttpRequest: HttpRequestConstructor = FetchHttpRequest,
|
||||
) {
|
||||
this.request = new HttpRequest({
|
||||
BASE: config?.BASE ?? "",
|
||||
VERSION: config?.VERSION ?? "0.1.0",
|
||||
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
||||
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
||||
TOKEN: config?.TOKEN,
|
||||
USERNAME: config?.USERNAME,
|
||||
PASSWORD: config?.PASSWORD,
|
||||
HEADERS: config?.HEADERS,
|
||||
ENCODE_PATH: config?.ENCODE_PATH,
|
||||
});
|
||||
|
||||
this.default = new DefaultService(this.request);
|
||||
}
|
||||
}
|
||||
36
www/app/api/OpenApi.ts
Normal file
36
www/app/api/OpenApi.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { BaseHttpRequest } from "./core/BaseHttpRequest";
|
||||
import type { OpenAPIConfig } from "./core/OpenAPI";
|
||||
import { FetchHttpRequest } from "./core/FetchHttpRequest";
|
||||
|
||||
import { DefaultService } from "./services/DefaultService";
|
||||
|
||||
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
||||
|
||||
export class OpenApi {
|
||||
public readonly default: DefaultService;
|
||||
|
||||
public readonly request: BaseHttpRequest;
|
||||
|
||||
constructor(
|
||||
config?: Partial<OpenAPIConfig>,
|
||||
HttpRequest: HttpRequestConstructor = FetchHttpRequest,
|
||||
) {
|
||||
this.request = new HttpRequest({
|
||||
BASE: config?.BASE ?? "",
|
||||
VERSION: config?.VERSION ?? "0.1.0",
|
||||
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
||||
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
||||
TOKEN: config?.TOKEN,
|
||||
USERNAME: config?.USERNAME,
|
||||
PASSWORD: config?.PASSWORD,
|
||||
HEADERS: config?.HEADERS,
|
||||
ENCODE_PATH: config?.ENCODE_PATH,
|
||||
});
|
||||
|
||||
this.default = new DefaultService(this.request);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from "./DefaultApi";
|
||||
29
www/app/api/core/ApiError.ts
Normal file
29
www/app/api/core/ApiError.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
import type { ApiResult } from "./ApiResult";
|
||||
|
||||
export class ApiError extends Error {
|
||||
public readonly url: string;
|
||||
public readonly status: number;
|
||||
public readonly statusText: string;
|
||||
public readonly body: any;
|
||||
public readonly request: ApiRequestOptions;
|
||||
|
||||
constructor(
|
||||
request: ApiRequestOptions,
|
||||
response: ApiResult,
|
||||
message: string,
|
||||
) {
|
||||
super(message);
|
||||
|
||||
this.name = "ApiError";
|
||||
this.url = response.url;
|
||||
this.status = response.status;
|
||||
this.statusText = response.statusText;
|
||||
this.body = response.body;
|
||||
this.request = request;
|
||||
}
|
||||
}
|
||||
24
www/app/api/core/ApiRequestOptions.ts
Normal file
24
www/app/api/core/ApiRequestOptions.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApiRequestOptions = {
|
||||
readonly method:
|
||||
| "GET"
|
||||
| "PUT"
|
||||
| "POST"
|
||||
| "DELETE"
|
||||
| "OPTIONS"
|
||||
| "HEAD"
|
||||
| "PATCH";
|
||||
readonly url: string;
|
||||
readonly path?: Record<string, any>;
|
||||
readonly cookies?: Record<string, any>;
|
||||
readonly headers?: Record<string, any>;
|
||||
readonly query?: Record<string, any>;
|
||||
readonly formData?: Record<string, any>;
|
||||
readonly body?: any;
|
||||
readonly mediaType?: string;
|
||||
readonly responseHeader?: string;
|
||||
readonly errors?: Record<number, string>;
|
||||
};
|
||||
11
www/app/api/core/ApiResult.ts
Normal file
11
www/app/api/core/ApiResult.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApiResult = {
|
||||
readonly url: string;
|
||||
readonly ok: boolean;
|
||||
readonly status: number;
|
||||
readonly statusText: string;
|
||||
readonly body: any;
|
||||
};
|
||||
13
www/app/api/core/BaseHttpRequest.ts
Normal file
13
www/app/api/core/BaseHttpRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
import type { CancelablePromise } from "./CancelablePromise";
|
||||
import type { OpenAPIConfig } from "./OpenAPI";
|
||||
|
||||
export abstract class BaseHttpRequest {
|
||||
constructor(public readonly config: OpenAPIConfig) {}
|
||||
|
||||
public abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
||||
}
|
||||
130
www/app/api/core/CancelablePromise.ts
Normal file
130
www/app/api/core/CancelablePromise.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export class CancelError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = "CancelError";
|
||||
}
|
||||
|
||||
public get isCancelled(): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export interface OnCancel {
|
||||
readonly isResolved: boolean;
|
||||
readonly isRejected: boolean;
|
||||
readonly isCancelled: boolean;
|
||||
|
||||
(cancelHandler: () => void): void;
|
||||
}
|
||||
|
||||
export class CancelablePromise<T> implements Promise<T> {
|
||||
#isResolved: boolean;
|
||||
#isRejected: boolean;
|
||||
#isCancelled: boolean;
|
||||
readonly #cancelHandlers: (() => void)[];
|
||||
readonly #promise: Promise<T>;
|
||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||
#reject?: (reason?: any) => void;
|
||||
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: OnCancel,
|
||||
) => void,
|
||||
) {
|
||||
this.#isResolved = false;
|
||||
this.#isRejected = false;
|
||||
this.#isCancelled = false;
|
||||
this.#cancelHandlers = [];
|
||||
this.#promise = new Promise<T>((resolve, reject) => {
|
||||
this.#resolve = resolve;
|
||||
this.#reject = reject;
|
||||
|
||||
const onResolve = (value: T | PromiseLike<T>): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isResolved = true;
|
||||
this.#resolve?.(value);
|
||||
};
|
||||
|
||||
const onReject = (reason?: any): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isRejected = true;
|
||||
this.#reject?.(reason);
|
||||
};
|
||||
|
||||
const onCancel = (cancelHandler: () => void): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#cancelHandlers.push(cancelHandler);
|
||||
};
|
||||
|
||||
Object.defineProperty(onCancel, "isResolved", {
|
||||
get: (): boolean => this.#isResolved,
|
||||
});
|
||||
|
||||
Object.defineProperty(onCancel, "isRejected", {
|
||||
get: (): boolean => this.#isRejected,
|
||||
});
|
||||
|
||||
Object.defineProperty(onCancel, "isCancelled", {
|
||||
get: (): boolean => this.#isCancelled,
|
||||
});
|
||||
|
||||
return executor(onResolve, onReject, onCancel as OnCancel);
|
||||
});
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return "Cancellable Promise";
|
||||
}
|
||||
|
||||
public then<TResult1 = T, TResult2 = never>(
|
||||
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
||||
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
|
||||
): Promise<TResult1 | TResult2> {
|
||||
return this.#promise.then(onFulfilled, onRejected);
|
||||
}
|
||||
|
||||
public catch<TResult = never>(
|
||||
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
|
||||
): Promise<T | TResult> {
|
||||
return this.#promise.catch(onRejected);
|
||||
}
|
||||
|
||||
public finally(onFinally?: (() => void) | null): Promise<T> {
|
||||
return this.#promise.finally(onFinally);
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isCancelled = true;
|
||||
if (this.#cancelHandlers.length) {
|
||||
try {
|
||||
for (const cancelHandler of this.#cancelHandlers) {
|
||||
cancelHandler();
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("Cancellation threw an error", error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.#cancelHandlers.length = 0;
|
||||
this.#reject?.(new CancelError("Request aborted"));
|
||||
}
|
||||
|
||||
public get isCancelled(): boolean {
|
||||
return this.#isCancelled;
|
||||
}
|
||||
}
|
||||
25
www/app/api/core/FetchHttpRequest.ts
Normal file
25
www/app/api/core/FetchHttpRequest.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
import { BaseHttpRequest } from "./BaseHttpRequest";
|
||||
import type { CancelablePromise } from "./CancelablePromise";
|
||||
import type { OpenAPIConfig } from "./OpenAPI";
|
||||
import { request as __request } from "./request";
|
||||
|
||||
export class FetchHttpRequest extends BaseHttpRequest {
|
||||
constructor(config: OpenAPIConfig) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Request method
|
||||
* @param options The request options from the service
|
||||
* @returns CancelablePromise<T>
|
||||
* @throws ApiError
|
||||
*/
|
||||
public override request<T>(options: ApiRequestOptions): CancelablePromise<T> {
|
||||
return __request(this.config, options);
|
||||
}
|
||||
}
|
||||
32
www/app/api/core/OpenAPI.ts
Normal file
32
www/app/api/core/OpenAPI.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
|
||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||
type Headers = Record<string, string>;
|
||||
|
||||
export type OpenAPIConfig = {
|
||||
BASE: string;
|
||||
VERSION: string;
|
||||
WITH_CREDENTIALS: boolean;
|
||||
CREDENTIALS: "include" | "omit" | "same-origin";
|
||||
TOKEN?: string | Resolver<string> | undefined;
|
||||
USERNAME?: string | Resolver<string> | undefined;
|
||||
PASSWORD?: string | Resolver<string> | undefined;
|
||||
HEADERS?: Headers | Resolver<Headers> | undefined;
|
||||
ENCODE_PATH?: ((path: string) => string) | undefined;
|
||||
};
|
||||
|
||||
export const OpenAPI: OpenAPIConfig = {
|
||||
BASE: "",
|
||||
VERSION: "0.1.0",
|
||||
WITH_CREDENTIALS: false,
|
||||
CREDENTIALS: "include",
|
||||
TOKEN: undefined,
|
||||
USERNAME: undefined,
|
||||
PASSWORD: undefined,
|
||||
HEADERS: undefined,
|
||||
ENCODE_PATH: undefined,
|
||||
};
|
||||
361
www/app/api/core/request.ts
Normal file
361
www/app/api/core/request.ts
Normal file
@@ -0,0 +1,361 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import { ApiError } from "./ApiError";
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
import type { ApiResult } from "./ApiResult";
|
||||
import { CancelablePromise } from "./CancelablePromise";
|
||||
import type { OnCancel } from "./CancelablePromise";
|
||||
import type { OpenAPIConfig } from "./OpenAPI";
|
||||
|
||||
export const isDefined = <T>(
|
||||
value: T | null | undefined,
|
||||
): value is Exclude<T, null | undefined> => {
|
||||
return value !== undefined && value !== null;
|
||||
};
|
||||
|
||||
export const isString = (value: any): value is string => {
|
||||
return typeof value === "string";
|
||||
};
|
||||
|
||||
export const isStringWithValue = (value: any): value is string => {
|
||||
return isString(value) && value !== "";
|
||||
};
|
||||
|
||||
export const isBlob = (value: any): value is Blob => {
|
||||
return (
|
||||
typeof value === "object" &&
|
||||
typeof value.type === "string" &&
|
||||
typeof value.stream === "function" &&
|
||||
typeof value.arrayBuffer === "function" &&
|
||||
typeof value.constructor === "function" &&
|
||||
typeof value.constructor.name === "string" &&
|
||||
/^(Blob|File)$/.test(value.constructor.name) &&
|
||||
/^(Blob|File)$/.test(value[Symbol.toStringTag])
|
||||
);
|
||||
};
|
||||
|
||||
export const isFormData = (value: any): value is FormData => {
|
||||
return value instanceof FormData;
|
||||
};
|
||||
|
||||
export const base64 = (str: string): string => {
|
||||
try {
|
||||
return btoa(str);
|
||||
} catch (err) {
|
||||
// @ts-ignore
|
||||
return Buffer.from(str).toString("base64");
|
||||
}
|
||||
};
|
||||
|
||||
export const getQueryString = (params: Record<string, any>): string => {
|
||||
const qs: string[] = [];
|
||||
|
||||
const append = (key: string, value: any) => {
|
||||
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
||||
};
|
||||
|
||||
const process = (key: string, value: any) => {
|
||||
if (isDefined(value)) {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((v) => {
|
||||
process(key, v);
|
||||
});
|
||||
} else if (typeof value === "object") {
|
||||
Object.entries(value).forEach(([k, v]) => {
|
||||
process(`${key}[${k}]`, v);
|
||||
});
|
||||
} else {
|
||||
append(key, value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
process(key, value);
|
||||
});
|
||||
|
||||
if (qs.length > 0) {
|
||||
return `?${qs.join("&")}`;
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
||||
const encoder = config.ENCODE_PATH || encodeURI;
|
||||
|
||||
const path = options.url
|
||||
.replace("{api-version}", config.VERSION)
|
||||
.replace(/{(.*?)}/g, (substring: string, group: string) => {
|
||||
if (options.path?.hasOwnProperty(group)) {
|
||||
return encoder(String(options.path[group]));
|
||||
}
|
||||
return substring;
|
||||
});
|
||||
|
||||
const url = `${config.BASE}${path}`;
|
||||
if (options.query) {
|
||||
return `${url}${getQueryString(options.query)}`;
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
export const getFormData = (
|
||||
options: ApiRequestOptions,
|
||||
): FormData | undefined => {
|
||||
if (options.formData) {
|
||||
const formData = new FormData();
|
||||
|
||||
const process = (key: string, value: any) => {
|
||||
if (isString(value) || isBlob(value)) {
|
||||
formData.append(key, value);
|
||||
} else {
|
||||
formData.append(key, JSON.stringify(value));
|
||||
}
|
||||
};
|
||||
|
||||
Object.entries(options.formData)
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.forEach(([key, value]) => {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((v) => process(key, v));
|
||||
} else {
|
||||
process(key, value);
|
||||
}
|
||||
});
|
||||
|
||||
return formData;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||
|
||||
export const resolve = async <T>(
|
||||
options: ApiRequestOptions,
|
||||
resolver?: T | Resolver<T>,
|
||||
): Promise<T | undefined> => {
|
||||
if (typeof resolver === "function") {
|
||||
return (resolver as Resolver<T>)(options);
|
||||
}
|
||||
return resolver;
|
||||
};
|
||||
|
||||
export const getHeaders = async (
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
): Promise<Headers> => {
|
||||
const token = await resolve(options, config.TOKEN);
|
||||
const username = await resolve(options, config.USERNAME);
|
||||
const password = await resolve(options, config.PASSWORD);
|
||||
const additionalHeaders = await resolve(options, config.HEADERS);
|
||||
|
||||
const headers = Object.entries({
|
||||
Accept: "application/json",
|
||||
...additionalHeaders,
|
||||
...options.headers,
|
||||
})
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.reduce(
|
||||
(headers, [key, value]) => ({
|
||||
...headers,
|
||||
[key]: String(value),
|
||||
}),
|
||||
{} as Record<string, string>,
|
||||
);
|
||||
|
||||
if (isStringWithValue(token)) {
|
||||
headers["Authorization"] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
if (isStringWithValue(username) && isStringWithValue(password)) {
|
||||
const credentials = base64(`${username}:${password}`);
|
||||
headers["Authorization"] = `Basic ${credentials}`;
|
||||
}
|
||||
|
||||
if (options.body) {
|
||||
if (options.mediaType) {
|
||||
headers["Content-Type"] = options.mediaType;
|
||||
} else if (isBlob(options.body)) {
|
||||
headers["Content-Type"] = options.body.type || "application/octet-stream";
|
||||
} else if (isString(options.body)) {
|
||||
headers["Content-Type"] = "text/plain";
|
||||
} else if (!isFormData(options.body)) {
|
||||
headers["Content-Type"] = "application/json";
|
||||
}
|
||||
}
|
||||
|
||||
return new Headers(headers);
|
||||
};
|
||||
|
||||
export const getRequestBody = (options: ApiRequestOptions): any => {
|
||||
if (options.body !== undefined) {
|
||||
if (options.mediaType?.includes("/json")) {
|
||||
return JSON.stringify(options.body);
|
||||
} else if (
|
||||
isString(options.body) ||
|
||||
isBlob(options.body) ||
|
||||
isFormData(options.body)
|
||||
) {
|
||||
return options.body;
|
||||
} else {
|
||||
return JSON.stringify(options.body);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const sendRequest = async (
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
url: string,
|
||||
body: any,
|
||||
formData: FormData | undefined,
|
||||
headers: Headers,
|
||||
onCancel: OnCancel,
|
||||
): Promise<Response> => {
|
||||
const controller = new AbortController();
|
||||
|
||||
const request: RequestInit = {
|
||||
headers,
|
||||
body: body ?? formData,
|
||||
method: options.method,
|
||||
signal: controller.signal,
|
||||
};
|
||||
|
||||
if (config.WITH_CREDENTIALS) {
|
||||
request.credentials = config.CREDENTIALS;
|
||||
}
|
||||
|
||||
onCancel(() => controller.abort());
|
||||
|
||||
return await fetch(url, request);
|
||||
};
|
||||
|
||||
export const getResponseHeader = (
|
||||
response: Response,
|
||||
responseHeader?: string,
|
||||
): string | undefined => {
|
||||
if (responseHeader) {
|
||||
const content = response.headers.get(responseHeader);
|
||||
if (isString(content)) {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const getResponseBody = async (response: Response): Promise<any> => {
|
||||
if (response.status !== 204) {
|
||||
try {
|
||||
const contentType = response.headers.get("Content-Type");
|
||||
if (contentType) {
|
||||
const jsonTypes = ["application/json", "application/problem+json"];
|
||||
const isJSON = jsonTypes.some((type) =>
|
||||
contentType.toLowerCase().startsWith(type),
|
||||
);
|
||||
if (isJSON) {
|
||||
return await response.json();
|
||||
} else {
|
||||
return await response.text();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
export const catchErrorCodes = (
|
||||
options: ApiRequestOptions,
|
||||
result: ApiResult,
|
||||
): void => {
|
||||
const errors: Record<number, string> = {
|
||||
400: "Bad Request",
|
||||
401: "Unauthorized",
|
||||
403: "Forbidden",
|
||||
404: "Not Found",
|
||||
500: "Internal Server Error",
|
||||
502: "Bad Gateway",
|
||||
503: "Service Unavailable",
|
||||
...options.errors,
|
||||
};
|
||||
|
||||
const error = errors[result.status];
|
||||
if (error) {
|
||||
throw new ApiError(options, result, error);
|
||||
}
|
||||
|
||||
if (!result.ok) {
|
||||
const errorStatus = result.status ?? "unknown";
|
||||
const errorStatusText = result.statusText ?? "unknown";
|
||||
const errorBody = (() => {
|
||||
try {
|
||||
return JSON.stringify(result.body, null, 2);
|
||||
} catch (e) {
|
||||
return undefined;
|
||||
}
|
||||
})();
|
||||
|
||||
throw new ApiError(
|
||||
options,
|
||||
result,
|
||||
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Request method
|
||||
* @param config The OpenAPI configuration object
|
||||
* @param options The request options from the service
|
||||
* @returns CancelablePromise<T>
|
||||
* @throws ApiError
|
||||
*/
|
||||
export const request = <T>(
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
): CancelablePromise<T> => {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const url = getUrl(config, options);
|
||||
const formData = getFormData(options);
|
||||
const body = getRequestBody(options);
|
||||
const headers = await getHeaders(config, options);
|
||||
|
||||
if (!onCancel.isCancelled) {
|
||||
const response = await sendRequest(
|
||||
config,
|
||||
options,
|
||||
url,
|
||||
body,
|
||||
formData,
|
||||
headers,
|
||||
onCancel,
|
||||
);
|
||||
const responseBody = await getResponseBody(response);
|
||||
const responseHeader = getResponseHeader(
|
||||
response,
|
||||
options.responseHeader,
|
||||
);
|
||||
|
||||
const result: ApiResult = {
|
||||
url,
|
||||
ok: response.ok,
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
body: responseHeader ?? responseBody,
|
||||
};
|
||||
|
||||
catchErrorCodes(options, result);
|
||||
|
||||
resolve(result.body);
|
||||
}
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -1,5 +1,38 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from "./runtime";
|
||||
export * from "./apis";
|
||||
export * from "./models";
|
||||
export { OpenApi } from "./OpenApi";
|
||||
|
||||
export { ApiError } from "./core/ApiError";
|
||||
export { BaseHttpRequest } from "./core/BaseHttpRequest";
|
||||
export { CancelablePromise, CancelError } from "./core/CancelablePromise";
|
||||
export { OpenAPI } from "./core/OpenAPI";
|
||||
export type { OpenAPIConfig } from "./core/OpenAPI";
|
||||
|
||||
export type { AudioWaveform } from "./models/AudioWaveform";
|
||||
export type { Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post } from "./models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post";
|
||||
export type { CreateParticipant } from "./models/CreateParticipant";
|
||||
export type { CreateTranscript } from "./models/CreateTranscript";
|
||||
export type { DeletionStatus } from "./models/DeletionStatus";
|
||||
export type { GetTranscript } from "./models/GetTranscript";
|
||||
export type { GetTranscriptSegmentTopic } from "./models/GetTranscriptSegmentTopic";
|
||||
export type { GetTranscriptTopic } from "./models/GetTranscriptTopic";
|
||||
export type { GetTranscriptTopicWithWords } from "./models/GetTranscriptTopicWithWords";
|
||||
export type { GetTranscriptTopicWithWordsPerSpeaker } from "./models/GetTranscriptTopicWithWordsPerSpeaker";
|
||||
export type { HTTPValidationError } from "./models/HTTPValidationError";
|
||||
export type { Page_GetTranscript_ } from "./models/Page_GetTranscript_";
|
||||
export type { Participant } from "./models/Participant";
|
||||
export type { RtcOffer } from "./models/RtcOffer";
|
||||
export type { SpeakerAssignment } from "./models/SpeakerAssignment";
|
||||
export type { SpeakerAssignmentStatus } from "./models/SpeakerAssignmentStatus";
|
||||
export type { SpeakerMerge } from "./models/SpeakerMerge";
|
||||
export type { SpeakerWords } from "./models/SpeakerWords";
|
||||
export type { TranscriptParticipant } from "./models/TranscriptParticipant";
|
||||
export type { UpdateParticipant } from "./models/UpdateParticipant";
|
||||
export type { UpdateTranscript } from "./models/UpdateTranscript";
|
||||
export type { UserInfo } from "./models/UserInfo";
|
||||
export type { ValidationError } from "./models/ValidationError";
|
||||
export type { Word } from "./models/Word";
|
||||
|
||||
export { DefaultService } from "./services/DefaultService";
|
||||
|
||||
@@ -1,66 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AudioWaveform
|
||||
*/
|
||||
export interface AudioWaveform {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof AudioWaveform
|
||||
*/
|
||||
data: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AudioWaveform interface.
|
||||
*/
|
||||
export function instanceOfAudioWaveform(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "data" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function AudioWaveformFromJSON(json: any): AudioWaveform {
|
||||
return AudioWaveformFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AudioWaveformFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): AudioWaveform {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
data: json["data"],
|
||||
};
|
||||
}
|
||||
|
||||
export function AudioWaveformToJSON(value?: AudioWaveform | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
data: value.data,
|
||||
};
|
||||
}
|
||||
export type AudioWaveform = {
|
||||
data: Array<number>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post =
|
||||
{
|
||||
file: Blob;
|
||||
};
|
||||
@@ -1,74 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface CreateParticipant
|
||||
*/
|
||||
export interface CreateParticipant {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof CreateParticipant
|
||||
*/
|
||||
speaker?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof CreateParticipant
|
||||
*/
|
||||
name: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the CreateParticipant interface.
|
||||
*/
|
||||
export function instanceOfCreateParticipant(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "name" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function CreateParticipantFromJSON(json: any): CreateParticipant {
|
||||
return CreateParticipantFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateParticipantFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): CreateParticipant {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
speaker: !exists(json, "speaker") ? undefined : json["speaker"],
|
||||
name: json["name"],
|
||||
};
|
||||
}
|
||||
|
||||
export function CreateParticipantToJSON(value?: CreateParticipant | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
speaker: value.speaker,
|
||||
name: value.name,
|
||||
};
|
||||
}
|
||||
export type CreateParticipant = {
|
||||
speaker?: number | null;
|
||||
name: string;
|
||||
};
|
||||
|
||||
@@ -1,86 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface CreateTranscript
|
||||
*/
|
||||
export interface CreateTranscript {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof CreateTranscript
|
||||
*/
|
||||
name: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof CreateTranscript
|
||||
*/
|
||||
sourceLanguage?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof CreateTranscript
|
||||
*/
|
||||
targetLanguage?: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the CreateTranscript interface.
|
||||
*/
|
||||
export function instanceOfCreateTranscript(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "name" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function CreateTranscriptFromJSON(json: any): CreateTranscript {
|
||||
return CreateTranscriptFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateTranscriptFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): CreateTranscript {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
name: json["name"],
|
||||
sourceLanguage: !exists(json, "source_language")
|
||||
? undefined
|
||||
: json["source_language"],
|
||||
targetLanguage: !exists(json, "target_language")
|
||||
? undefined
|
||||
: json["target_language"],
|
||||
};
|
||||
}
|
||||
|
||||
export function CreateTranscriptToJSON(value?: CreateTranscript | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
name: value.name,
|
||||
source_language: value.sourceLanguage,
|
||||
target_language: value.targetLanguage,
|
||||
};
|
||||
}
|
||||
export type CreateTranscript = {
|
||||
name: string;
|
||||
source_language?: string;
|
||||
target_language?: string;
|
||||
};
|
||||
|
||||
@@ -1,66 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface DeletionStatus
|
||||
*/
|
||||
export interface DeletionStatus {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof DeletionStatus
|
||||
*/
|
||||
status: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the DeletionStatus interface.
|
||||
*/
|
||||
export function instanceOfDeletionStatus(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "status" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function DeletionStatusFromJSON(json: any): DeletionStatus {
|
||||
return DeletionStatusFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DeletionStatusFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): DeletionStatus {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
status: json["status"],
|
||||
};
|
||||
}
|
||||
|
||||
export function DeletionStatusToJSON(value?: DeletionStatus | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
status: value.status,
|
||||
};
|
||||
}
|
||||
export type DeletionStatus = {
|
||||
status: string;
|
||||
};
|
||||
|
||||
@@ -1,191 +1,24 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GetTranscript
|
||||
*/
|
||||
export interface GetTranscript {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
id: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
userId: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
name: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
status: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
locked: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
duration: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
title: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
shortSummary: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
longSummary: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
createdAt: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
shareMode?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
sourceLanguage: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
targetLanguage: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
participants: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscript
|
||||
*/
|
||||
reviewed: any | null;
|
||||
}
|
||||
import type { TranscriptParticipant } from "./TranscriptParticipant";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetTranscript interface.
|
||||
*/
|
||||
export function instanceOfGetTranscript(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "userId" in value;
|
||||
isInstance = isInstance && "name" in value;
|
||||
isInstance = isInstance && "status" in value;
|
||||
isInstance = isInstance && "locked" in value;
|
||||
isInstance = isInstance && "duration" in value;
|
||||
isInstance = isInstance && "title" in value;
|
||||
isInstance = isInstance && "shortSummary" in value;
|
||||
isInstance = isInstance && "longSummary" in value;
|
||||
isInstance = isInstance && "createdAt" in value;
|
||||
isInstance = isInstance && "sourceLanguage" in value;
|
||||
isInstance = isInstance && "targetLanguage" in value;
|
||||
isInstance = isInstance && "participants" in value;
|
||||
isInstance = isInstance && "reviewed" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function GetTranscriptFromJSON(json: any): GetTranscript {
|
||||
return GetTranscriptFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GetTranscriptFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): GetTranscript {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: json["id"],
|
||||
userId: json["user_id"],
|
||||
name: json["name"],
|
||||
status: json["status"],
|
||||
locked: json["locked"],
|
||||
duration: json["duration"],
|
||||
title: json["title"],
|
||||
shortSummary: json["short_summary"],
|
||||
longSummary: json["long_summary"],
|
||||
createdAt: json["created_at"],
|
||||
shareMode: !exists(json, "share_mode") ? undefined : json["share_mode"],
|
||||
sourceLanguage: json["source_language"],
|
||||
targetLanguage: json["target_language"],
|
||||
participants: json["participants"],
|
||||
reviewed: json["reviewed"],
|
||||
};
|
||||
}
|
||||
|
||||
export function GetTranscriptToJSON(value?: GetTranscript | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
user_id: value.userId,
|
||||
name: value.name,
|
||||
status: value.status,
|
||||
locked: value.locked,
|
||||
duration: value.duration,
|
||||
title: value.title,
|
||||
short_summary: value.shortSummary,
|
||||
long_summary: value.longSummary,
|
||||
created_at: value.createdAt,
|
||||
share_mode: value.shareMode,
|
||||
source_language: value.sourceLanguage,
|
||||
target_language: value.targetLanguage,
|
||||
participants: value.participants,
|
||||
reviewed: value.reviewed,
|
||||
};
|
||||
}
|
||||
export type GetTranscript = {
|
||||
id: string;
|
||||
user_id: string | null;
|
||||
name: string;
|
||||
status: string;
|
||||
locked: boolean;
|
||||
duration: number;
|
||||
title: string | null;
|
||||
short_summary: string | null;
|
||||
long_summary: string | null;
|
||||
created_at: string;
|
||||
share_mode?: string;
|
||||
source_language: string | null;
|
||||
target_language: string | null;
|
||||
participants: Array<TranscriptParticipant> | null;
|
||||
reviewed: boolean;
|
||||
};
|
||||
|
||||
@@ -1,88 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GetTranscriptSegmentTopic
|
||||
*/
|
||||
export interface GetTranscriptSegmentTopic {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptSegmentTopic
|
||||
*/
|
||||
text: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptSegmentTopic
|
||||
*/
|
||||
start: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptSegmentTopic
|
||||
*/
|
||||
speaker: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetTranscriptSegmentTopic interface.
|
||||
*/
|
||||
export function instanceOfGetTranscriptSegmentTopic(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "text" in value;
|
||||
isInstance = isInstance && "start" in value;
|
||||
isInstance = isInstance && "speaker" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function GetTranscriptSegmentTopicFromJSON(
|
||||
json: any,
|
||||
): GetTranscriptSegmentTopic {
|
||||
return GetTranscriptSegmentTopicFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GetTranscriptSegmentTopicFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): GetTranscriptSegmentTopic {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
text: json["text"],
|
||||
start: json["start"],
|
||||
speaker: json["speaker"],
|
||||
};
|
||||
}
|
||||
|
||||
export function GetTranscriptSegmentTopicToJSON(
|
||||
value?: GetTranscriptSegmentTopic | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
text: value.text,
|
||||
start: value.start,
|
||||
speaker: value.speaker,
|
||||
};
|
||||
}
|
||||
export type GetTranscriptSegmentTopic = {
|
||||
text: string;
|
||||
start: number;
|
||||
speaker: number;
|
||||
};
|
||||
|
||||
@@ -1,121 +1,16 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GetTranscriptTopic
|
||||
*/
|
||||
export interface GetTranscriptTopic {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
id: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
title: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
summary: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
timestamp: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
duration: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
transcript: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopic
|
||||
*/
|
||||
segments?: any | null;
|
||||
}
|
||||
import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetTranscriptTopic interface.
|
||||
*/
|
||||
export function instanceOfGetTranscriptTopic(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "title" in value;
|
||||
isInstance = isInstance && "summary" in value;
|
||||
isInstance = isInstance && "timestamp" in value;
|
||||
isInstance = isInstance && "duration" in value;
|
||||
isInstance = isInstance && "transcript" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicFromJSON(json: any): GetTranscriptTopic {
|
||||
return GetTranscriptTopicFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): GetTranscriptTopic {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: json["id"],
|
||||
title: json["title"],
|
||||
summary: json["summary"],
|
||||
timestamp: json["timestamp"],
|
||||
duration: json["duration"],
|
||||
transcript: json["transcript"],
|
||||
segments: !exists(json, "segments") ? undefined : json["segments"],
|
||||
};
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicToJSON(
|
||||
value?: GetTranscriptTopic | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
title: value.title,
|
||||
summary: value.summary,
|
||||
timestamp: value.timestamp,
|
||||
duration: value.duration,
|
||||
transcript: value.transcript,
|
||||
segments: value.segments,
|
||||
};
|
||||
}
|
||||
export type GetTranscriptTopic = {
|
||||
id: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
timestamp: number;
|
||||
duration: number | null;
|
||||
transcript: string;
|
||||
segments?: Array<GetTranscriptSegmentTopic>;
|
||||
};
|
||||
|
||||
@@ -1,131 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GetTranscriptTopicWithWords
|
||||
*/
|
||||
export interface GetTranscriptTopicWithWords {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
id: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
title: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
summary: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
timestamp: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
duration: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
transcript: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
segments?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWords
|
||||
*/
|
||||
words?: any | null;
|
||||
}
|
||||
import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
||||
import type { Word } from "./Word";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetTranscriptTopicWithWords interface.
|
||||
*/
|
||||
export function instanceOfGetTranscriptTopicWithWords(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "title" in value;
|
||||
isInstance = isInstance && "summary" in value;
|
||||
isInstance = isInstance && "timestamp" in value;
|
||||
isInstance = isInstance && "duration" in value;
|
||||
isInstance = isInstance && "transcript" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicWithWordsFromJSON(
|
||||
json: any,
|
||||
): GetTranscriptTopicWithWords {
|
||||
return GetTranscriptTopicWithWordsFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicWithWordsFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): GetTranscriptTopicWithWords {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: json["id"],
|
||||
title: json["title"],
|
||||
summary: json["summary"],
|
||||
timestamp: json["timestamp"],
|
||||
duration: json["duration"],
|
||||
transcript: json["transcript"],
|
||||
segments: !exists(json, "segments") ? undefined : json["segments"],
|
||||
words: !exists(json, "words") ? undefined : json["words"],
|
||||
};
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicWithWordsToJSON(
|
||||
value?: GetTranscriptTopicWithWords | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
title: value.title,
|
||||
summary: value.summary,
|
||||
timestamp: value.timestamp,
|
||||
duration: value.duration,
|
||||
transcript: value.transcript,
|
||||
segments: value.segments,
|
||||
words: value.words,
|
||||
};
|
||||
}
|
||||
export type GetTranscriptTopicWithWords = {
|
||||
id: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
timestamp: number;
|
||||
duration: number | null;
|
||||
transcript: string;
|
||||
segments?: Array<GetTranscriptSegmentTopic>;
|
||||
words?: Array<Word>;
|
||||
};
|
||||
|
||||
@@ -1,135 +1,18 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
export interface GetTranscriptTopicWithWordsPerSpeaker {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
id: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
title: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
summary: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
timestamp: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
duration: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
transcript: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
segments?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof GetTranscriptTopicWithWordsPerSpeaker
|
||||
*/
|
||||
wordsPerSpeaker?: any | null;
|
||||
}
|
||||
import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
||||
import type { SpeakerWords } from "./SpeakerWords";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GetTranscriptTopicWithWordsPerSpeaker interface.
|
||||
*/
|
||||
export function instanceOfGetTranscriptTopicWithWordsPerSpeaker(
|
||||
value: object,
|
||||
): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "title" in value;
|
||||
isInstance = isInstance && "summary" in value;
|
||||
isInstance = isInstance && "timestamp" in value;
|
||||
isInstance = isInstance && "duration" in value;
|
||||
isInstance = isInstance && "transcript" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicWithWordsPerSpeakerFromJSON(
|
||||
json: any,
|
||||
): GetTranscriptTopicWithWordsPerSpeaker {
|
||||
return GetTranscriptTopicWithWordsPerSpeakerFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicWithWordsPerSpeakerFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): GetTranscriptTopicWithWordsPerSpeaker {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: json["id"],
|
||||
title: json["title"],
|
||||
summary: json["summary"],
|
||||
timestamp: json["timestamp"],
|
||||
duration: json["duration"],
|
||||
transcript: json["transcript"],
|
||||
segments: !exists(json, "segments") ? undefined : json["segments"],
|
||||
wordsPerSpeaker: !exists(json, "words_per_speaker")
|
||||
? undefined
|
||||
: json["words_per_speaker"],
|
||||
};
|
||||
}
|
||||
|
||||
export function GetTranscriptTopicWithWordsPerSpeakerToJSON(
|
||||
value?: GetTranscriptTopicWithWordsPerSpeaker | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
title: value.title,
|
||||
summary: value.summary,
|
||||
timestamp: value.timestamp,
|
||||
duration: value.duration,
|
||||
transcript: value.transcript,
|
||||
segments: value.segments,
|
||||
words_per_speaker: value.wordsPerSpeaker,
|
||||
};
|
||||
}
|
||||
export type GetTranscriptTopicWithWordsPerSpeaker = {
|
||||
id: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
timestamp: number;
|
||||
duration: number | null;
|
||||
transcript: string;
|
||||
segments?: Array<GetTranscriptSegmentTopic>;
|
||||
words_per_speaker?: Array<SpeakerWords>;
|
||||
};
|
||||
|
||||
@@ -1,67 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface HTTPValidationError
|
||||
*/
|
||||
export interface HTTPValidationError {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof HTTPValidationError
|
||||
*/
|
||||
detail?: any | null;
|
||||
}
|
||||
import type { ValidationError } from "./ValidationError";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the HTTPValidationError interface.
|
||||
*/
|
||||
export function instanceOfHTTPValidationError(value: object): boolean {
|
||||
let isInstance = true;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function HTTPValidationErrorFromJSON(json: any): HTTPValidationError {
|
||||
return HTTPValidationErrorFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function HTTPValidationErrorFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): HTTPValidationError {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
detail: !exists(json, "detail") ? undefined : json["detail"],
|
||||
};
|
||||
}
|
||||
|
||||
export function HTTPValidationErrorToJSON(
|
||||
value?: HTTPValidationError | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
detail: value.detail,
|
||||
};
|
||||
}
|
||||
export type HTTPValidationError = {
|
||||
detail?: Array<ValidationError>;
|
||||
};
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface PageGetTranscript
|
||||
*/
|
||||
export interface PageGetTranscript {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof PageGetTranscript
|
||||
*/
|
||||
items: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof PageGetTranscript
|
||||
*/
|
||||
total: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof PageGetTranscript
|
||||
*/
|
||||
page: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof PageGetTranscript
|
||||
*/
|
||||
size: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof PageGetTranscript
|
||||
*/
|
||||
pages?: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the PageGetTranscript interface.
|
||||
*/
|
||||
export function instanceOfPageGetTranscript(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "items" in value;
|
||||
isInstance = isInstance && "total" in value;
|
||||
isInstance = isInstance && "page" in value;
|
||||
isInstance = isInstance && "size" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function PageGetTranscriptFromJSON(json: any): PageGetTranscript {
|
||||
return PageGetTranscriptFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function PageGetTranscriptFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): PageGetTranscript {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
items: json["items"],
|
||||
total: json["total"],
|
||||
page: json["page"],
|
||||
size: json["size"],
|
||||
pages: !exists(json, "pages") ? undefined : json["pages"],
|
||||
};
|
||||
}
|
||||
|
||||
export function PageGetTranscriptToJSON(value?: PageGetTranscript | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
items: value.items,
|
||||
total: value.total,
|
||||
page: value.page,
|
||||
size: value.size,
|
||||
pages: value.pages,
|
||||
};
|
||||
}
|
||||
14
www/app/api/models/Page_GetTranscript_.ts
Normal file
14
www/app/api/models/Page_GetTranscript_.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { GetTranscript } from "./GetTranscript";
|
||||
|
||||
export type Page_GetTranscript_ = {
|
||||
items: Array<GetTranscript>;
|
||||
total: number;
|
||||
page: number | null;
|
||||
size: number | null;
|
||||
pages?: number | null;
|
||||
};
|
||||
@@ -1,84 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface Participant
|
||||
*/
|
||||
export interface Participant {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Participant
|
||||
*/
|
||||
id: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Participant
|
||||
*/
|
||||
speaker: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Participant
|
||||
*/
|
||||
name: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the Participant interface.
|
||||
*/
|
||||
export function instanceOfParticipant(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "speaker" in value;
|
||||
isInstance = isInstance && "name" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function ParticipantFromJSON(json: any): Participant {
|
||||
return ParticipantFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ParticipantFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): Participant {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: json["id"],
|
||||
speaker: json["speaker"],
|
||||
name: json["name"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ParticipantToJSON(value?: Participant | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
speaker: value.speaker,
|
||||
name: value.name,
|
||||
};
|
||||
}
|
||||
export type Participant = {
|
||||
id: string;
|
||||
speaker: number | null;
|
||||
name: string;
|
||||
};
|
||||
|
||||
@@ -1,75 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface RtcOffer
|
||||
*/
|
||||
export interface RtcOffer {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof RtcOffer
|
||||
*/
|
||||
sdp: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof RtcOffer
|
||||
*/
|
||||
type: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the RtcOffer interface.
|
||||
*/
|
||||
export function instanceOfRtcOffer(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "sdp" in value;
|
||||
isInstance = isInstance && "type" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function RtcOfferFromJSON(json: any): RtcOffer {
|
||||
return RtcOfferFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function RtcOfferFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): RtcOffer {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
sdp: json["sdp"],
|
||||
type: json["type"],
|
||||
};
|
||||
}
|
||||
|
||||
export function RtcOfferToJSON(value?: RtcOffer | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
sdp: value.sdp,
|
||||
type: value.type,
|
||||
};
|
||||
}
|
||||
export type RtcOffer = {
|
||||
sdp: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
@@ -1,91 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SpeakerAssignment
|
||||
*/
|
||||
export interface SpeakerAssignment {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerAssignment
|
||||
*/
|
||||
speaker?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerAssignment
|
||||
*/
|
||||
participant?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerAssignment
|
||||
*/
|
||||
timestampFrom: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerAssignment
|
||||
*/
|
||||
timestampTo: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the SpeakerAssignment interface.
|
||||
*/
|
||||
export function instanceOfSpeakerAssignment(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "timestampFrom" in value;
|
||||
isInstance = isInstance && "timestampTo" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function SpeakerAssignmentFromJSON(json: any): SpeakerAssignment {
|
||||
return SpeakerAssignmentFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SpeakerAssignmentFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): SpeakerAssignment {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
speaker: !exists(json, "speaker") ? undefined : json["speaker"],
|
||||
participant: !exists(json, "participant") ? undefined : json["participant"],
|
||||
timestampFrom: json["timestamp_from"],
|
||||
timestampTo: json["timestamp_to"],
|
||||
};
|
||||
}
|
||||
|
||||
export function SpeakerAssignmentToJSON(value?: SpeakerAssignment | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
speaker: value.speaker,
|
||||
participant: value.participant,
|
||||
timestamp_from: value.timestampFrom,
|
||||
timestamp_to: value.timestampTo,
|
||||
};
|
||||
}
|
||||
export type SpeakerAssignment = {
|
||||
speaker?: number | null;
|
||||
participant?: string | null;
|
||||
timestamp_from: number;
|
||||
timestamp_to: number;
|
||||
};
|
||||
|
||||
@@ -1,70 +1,8 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SpeakerAssignmentStatus
|
||||
*/
|
||||
export interface SpeakerAssignmentStatus {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerAssignmentStatus
|
||||
*/
|
||||
status: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the SpeakerAssignmentStatus interface.
|
||||
*/
|
||||
export function instanceOfSpeakerAssignmentStatus(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "status" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function SpeakerAssignmentStatusFromJSON(
|
||||
json: any,
|
||||
): SpeakerAssignmentStatus {
|
||||
return SpeakerAssignmentStatusFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SpeakerAssignmentStatusFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): SpeakerAssignmentStatus {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
status: json["status"],
|
||||
};
|
||||
}
|
||||
|
||||
export function SpeakerAssignmentStatusToJSON(
|
||||
value?: SpeakerAssignmentStatus | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
status: value.status,
|
||||
};
|
||||
}
|
||||
export type SpeakerAssignmentStatus = {
|
||||
status: string;
|
||||
};
|
||||
|
||||
@@ -1,75 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SpeakerMerge
|
||||
*/
|
||||
export interface SpeakerMerge {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerMerge
|
||||
*/
|
||||
speakerFrom: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerMerge
|
||||
*/
|
||||
speakerTo: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the SpeakerMerge interface.
|
||||
*/
|
||||
export function instanceOfSpeakerMerge(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "speakerFrom" in value;
|
||||
isInstance = isInstance && "speakerTo" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function SpeakerMergeFromJSON(json: any): SpeakerMerge {
|
||||
return SpeakerMergeFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SpeakerMergeFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): SpeakerMerge {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
speakerFrom: json["speaker_from"],
|
||||
speakerTo: json["speaker_to"],
|
||||
};
|
||||
}
|
||||
|
||||
export function SpeakerMergeToJSON(value?: SpeakerMerge | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
speaker_from: value.speakerFrom,
|
||||
speaker_to: value.speakerTo,
|
||||
};
|
||||
}
|
||||
export type SpeakerMerge = {
|
||||
speaker_from: number;
|
||||
speaker_to: number;
|
||||
};
|
||||
|
||||
@@ -1,75 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SpeakerWords
|
||||
*/
|
||||
export interface SpeakerWords {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerWords
|
||||
*/
|
||||
speaker: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof SpeakerWords
|
||||
*/
|
||||
words: any | null;
|
||||
}
|
||||
import type { Word } from "./Word";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the SpeakerWords interface.
|
||||
*/
|
||||
export function instanceOfSpeakerWords(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "speaker" in value;
|
||||
isInstance = isInstance && "words" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function SpeakerWordsFromJSON(json: any): SpeakerWords {
|
||||
return SpeakerWordsFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function SpeakerWordsFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): SpeakerWords {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
speaker: json["speaker"],
|
||||
words: json["words"],
|
||||
};
|
||||
}
|
||||
|
||||
export function SpeakerWordsToJSON(value?: SpeakerWords | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
speaker: value.speaker,
|
||||
words: value.words,
|
||||
};
|
||||
}
|
||||
export type SpeakerWords = {
|
||||
speaker: number;
|
||||
words: Array<Word>;
|
||||
};
|
||||
|
||||
@@ -1,87 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TranscriptParticipant
|
||||
*/
|
||||
export interface TranscriptParticipant {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptParticipant
|
||||
*/
|
||||
id?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptParticipant
|
||||
*/
|
||||
speaker: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptParticipant
|
||||
*/
|
||||
name: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TranscriptParticipant interface.
|
||||
*/
|
||||
export function instanceOfTranscriptParticipant(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "speaker" in value;
|
||||
isInstance = isInstance && "name" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function TranscriptParticipantFromJSON(
|
||||
json: any,
|
||||
): TranscriptParticipant {
|
||||
return TranscriptParticipantFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TranscriptParticipantFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): TranscriptParticipant {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: !exists(json, "id") ? undefined : json["id"],
|
||||
speaker: json["speaker"],
|
||||
name: json["name"],
|
||||
};
|
||||
}
|
||||
|
||||
export function TranscriptParticipantToJSON(
|
||||
value?: TranscriptParticipant | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
speaker: value.speaker,
|
||||
name: value.name,
|
||||
};
|
||||
}
|
||||
export type TranscriptParticipant = {
|
||||
id?: string;
|
||||
speaker: number | null;
|
||||
name: string;
|
||||
};
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TranscriptSegmentTopic
|
||||
*/
|
||||
export interface TranscriptSegmentTopic {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptSegmentTopic
|
||||
*/
|
||||
speaker: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptSegmentTopic
|
||||
*/
|
||||
text: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptSegmentTopic
|
||||
*/
|
||||
timestamp: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TranscriptSegmentTopic interface.
|
||||
*/
|
||||
export function instanceOfTranscriptSegmentTopic(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "speaker" in value;
|
||||
isInstance = isInstance && "text" in value;
|
||||
isInstance = isInstance && "timestamp" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function TranscriptSegmentTopicFromJSON(
|
||||
json: any,
|
||||
): TranscriptSegmentTopic {
|
||||
return TranscriptSegmentTopicFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TranscriptSegmentTopicFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): TranscriptSegmentTopic {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
speaker: json["speaker"],
|
||||
text: json["text"],
|
||||
timestamp: json["timestamp"],
|
||||
};
|
||||
}
|
||||
|
||||
export function TranscriptSegmentTopicToJSON(
|
||||
value?: TranscriptSegmentTopic | null,
|
||||
): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
speaker: value.speaker,
|
||||
text: value.text,
|
||||
timestamp: value.timestamp,
|
||||
};
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TranscriptTopic
|
||||
*/
|
||||
export interface TranscriptTopic {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptTopic
|
||||
*/
|
||||
id?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptTopic
|
||||
*/
|
||||
title: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptTopic
|
||||
*/
|
||||
summary: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptTopic
|
||||
*/
|
||||
timestamp: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof TranscriptTopic
|
||||
*/
|
||||
segments?: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TranscriptTopic interface.
|
||||
*/
|
||||
export function instanceOfTranscriptTopic(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "title" in value;
|
||||
isInstance = isInstance && "summary" in value;
|
||||
isInstance = isInstance && "timestamp" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function TranscriptTopicFromJSON(json: any): TranscriptTopic {
|
||||
return TranscriptTopicFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TranscriptTopicFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): TranscriptTopic {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
id: !exists(json, "id") ? undefined : json["id"],
|
||||
title: json["title"],
|
||||
summary: json["summary"],
|
||||
timestamp: json["timestamp"],
|
||||
segments: !exists(json, "segments") ? undefined : json["segments"],
|
||||
};
|
||||
}
|
||||
|
||||
export function TranscriptTopicToJSON(value?: TranscriptTopic | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
id: value.id,
|
||||
title: value.title,
|
||||
summary: value.summary,
|
||||
timestamp: value.timestamp,
|
||||
segments: value.segments,
|
||||
};
|
||||
}
|
||||
@@ -1,73 +1,9 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateParticipant
|
||||
*/
|
||||
export interface UpdateParticipant {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateParticipant
|
||||
*/
|
||||
speaker?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateParticipant
|
||||
*/
|
||||
name?: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UpdateParticipant interface.
|
||||
*/
|
||||
export function instanceOfUpdateParticipant(value: object): boolean {
|
||||
let isInstance = true;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function UpdateParticipantFromJSON(json: any): UpdateParticipant {
|
||||
return UpdateParticipantFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateParticipantFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): UpdateParticipant {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
speaker: !exists(json, "speaker") ? undefined : json["speaker"],
|
||||
name: !exists(json, "name") ? undefined : json["name"],
|
||||
};
|
||||
}
|
||||
|
||||
export function UpdateParticipantToJSON(value?: UpdateParticipant | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
speaker: value.speaker,
|
||||
name: value.name,
|
||||
};
|
||||
}
|
||||
export type UpdateParticipant = {
|
||||
speaker?: number | null;
|
||||
name?: string | null;
|
||||
};
|
||||
|
||||
@@ -1,127 +1,17 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateTranscript
|
||||
*/
|
||||
export interface UpdateTranscript {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
name?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
locked?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
title?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
shortSummary?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
longSummary?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
shareMode?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
participants?: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UpdateTranscript
|
||||
*/
|
||||
reviewed?: any | null;
|
||||
}
|
||||
import type { TranscriptParticipant } from "./TranscriptParticipant";
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UpdateTranscript interface.
|
||||
*/
|
||||
export function instanceOfUpdateTranscript(value: object): boolean {
|
||||
let isInstance = true;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function UpdateTranscriptFromJSON(json: any): UpdateTranscript {
|
||||
return UpdateTranscriptFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateTranscriptFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): UpdateTranscript {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
name: !exists(json, "name") ? undefined : json["name"],
|
||||
locked: !exists(json, "locked") ? undefined : json["locked"],
|
||||
title: !exists(json, "title") ? undefined : json["title"],
|
||||
shortSummary: !exists(json, "short_summary")
|
||||
? undefined
|
||||
: json["short_summary"],
|
||||
longSummary: !exists(json, "long_summary")
|
||||
? undefined
|
||||
: json["long_summary"],
|
||||
shareMode: !exists(json, "share_mode") ? undefined : json["share_mode"],
|
||||
participants: !exists(json, "participants")
|
||||
? undefined
|
||||
: json["participants"],
|
||||
reviewed: !exists(json, "reviewed") ? undefined : json["reviewed"],
|
||||
};
|
||||
}
|
||||
|
||||
export function UpdateTranscriptToJSON(value?: UpdateTranscript | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
name: value.name,
|
||||
locked: value.locked,
|
||||
title: value.title,
|
||||
short_summary: value.shortSummary,
|
||||
long_summary: value.longSummary,
|
||||
share_mode: value.shareMode,
|
||||
participants: value.participants,
|
||||
reviewed: value.reviewed,
|
||||
};
|
||||
}
|
||||
export type UpdateTranscript = {
|
||||
name?: string | null;
|
||||
locked?: boolean | null;
|
||||
title?: string | null;
|
||||
short_summary?: string | null;
|
||||
long_summary?: string | null;
|
||||
share_mode?: "public" | "semi-private" | "private" | null;
|
||||
participants?: Array<TranscriptParticipant> | null;
|
||||
reviewed?: boolean | null;
|
||||
};
|
||||
|
||||
@@ -1,84 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UserInfo
|
||||
*/
|
||||
export interface UserInfo {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UserInfo
|
||||
*/
|
||||
sub: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UserInfo
|
||||
*/
|
||||
email: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof UserInfo
|
||||
*/
|
||||
emailVerified: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UserInfo interface.
|
||||
*/
|
||||
export function instanceOfUserInfo(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "sub" in value;
|
||||
isInstance = isInstance && "email" in value;
|
||||
isInstance = isInstance && "emailVerified" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function UserInfoFromJSON(json: any): UserInfo {
|
||||
return UserInfoFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UserInfoFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): UserInfo {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
sub: json["sub"],
|
||||
email: json["email"],
|
||||
emailVerified: json["email_verified"],
|
||||
};
|
||||
}
|
||||
|
||||
export function UserInfoToJSON(value?: UserInfo | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
sub: value.sub,
|
||||
email: value.email,
|
||||
email_verified: value.emailVerified,
|
||||
};
|
||||
}
|
||||
export type UserInfo = {
|
||||
sub: string;
|
||||
email: string | null;
|
||||
email_verified: boolean | null;
|
||||
};
|
||||
|
||||
@@ -1,84 +1,10 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ValidationError
|
||||
*/
|
||||
export interface ValidationError {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof ValidationError
|
||||
*/
|
||||
loc: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof ValidationError
|
||||
*/
|
||||
msg: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof ValidationError
|
||||
*/
|
||||
type: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ValidationError interface.
|
||||
*/
|
||||
export function instanceOfValidationError(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "loc" in value;
|
||||
isInstance = isInstance && "msg" in value;
|
||||
isInstance = isInstance && "type" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function ValidationErrorFromJSON(json: any): ValidationError {
|
||||
return ValidationErrorFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ValidationErrorFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): ValidationError {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
loc: json["loc"],
|
||||
msg: json["msg"],
|
||||
type: json["type"],
|
||||
};
|
||||
}
|
||||
|
||||
export function ValidationErrorToJSON(value?: ValidationError | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
loc: value.loc,
|
||||
msg: value.msg,
|
||||
type: value.type,
|
||||
};
|
||||
}
|
||||
export type ValidationError = {
|
||||
loc: Array<string | number>;
|
||||
msg: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
@@ -1,92 +1,11 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* FastAPI
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from "../runtime";
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface Word
|
||||
*/
|
||||
export interface Word {
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Word
|
||||
*/
|
||||
text: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Word
|
||||
*/
|
||||
start: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Word
|
||||
*/
|
||||
end: any | null;
|
||||
/**
|
||||
*
|
||||
* @type {any}
|
||||
* @memberof Word
|
||||
*/
|
||||
speaker?: any | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the Word interface.
|
||||
*/
|
||||
export function instanceOfWord(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "text" in value;
|
||||
isInstance = isInstance && "start" in value;
|
||||
isInstance = isInstance && "end" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function WordFromJSON(json: any): Word {
|
||||
return WordFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function WordFromJSONTyped(
|
||||
json: any,
|
||||
ignoreDiscriminator: boolean,
|
||||
): Word {
|
||||
if (json === undefined || json === null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
text: json["text"],
|
||||
start: json["start"],
|
||||
end: json["end"],
|
||||
speaker: !exists(json, "speaker") ? undefined : json["speaker"],
|
||||
};
|
||||
}
|
||||
|
||||
export function WordToJSON(value?: Word | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
text: value.text,
|
||||
start: value.start,
|
||||
end: value.end,
|
||||
speaker: value.speaker,
|
||||
};
|
||||
}
|
||||
export type Word = {
|
||||
text: string;
|
||||
start: number;
|
||||
end: number;
|
||||
speaker?: number;
|
||||
};
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from "./AudioWaveform";
|
||||
export * from "./CreateParticipant";
|
||||
export * from "./CreateTranscript";
|
||||
export * from "./DeletionStatus";
|
||||
export * from "./GetTranscript";
|
||||
export * from "./GetTranscriptSegmentTopic";
|
||||
export * from "./GetTranscriptTopic";
|
||||
export * from "./GetTranscriptTopicWithWords";
|
||||
export * from "./GetTranscriptTopicWithWordsPerSpeaker";
|
||||
export * from "./HTTPValidationError";
|
||||
export * from "./PageGetTranscript";
|
||||
export * from "./Participant";
|
||||
export * from "./RtcOffer";
|
||||
export * from "./SpeakerAssignment";
|
||||
export * from "./SpeakerAssignmentStatus";
|
||||
export * from "./SpeakerMerge";
|
||||
export * from "./SpeakerWords";
|
||||
export * from "./TranscriptParticipant";
|
||||
export * from "./UpdateParticipant";
|
||||
export * from "./UpdateTranscript";
|
||||
export * from "./UserInfo";
|
||||
export * from "./ValidationError";
|
||||
export * from "./Word";
|
||||
547
www/app/api/services/DefaultService.ts
Normal file
547
www/app/api/services/DefaultService.ts
Normal file
@@ -0,0 +1,547 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { AudioWaveform } from "../models/AudioWaveform";
|
||||
import type { Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post } from "../models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post";
|
||||
import type { CreateParticipant } from "../models/CreateParticipant";
|
||||
import type { CreateTranscript } from "../models/CreateTranscript";
|
||||
import type { DeletionStatus } from "../models/DeletionStatus";
|
||||
import type { GetTranscript } from "../models/GetTranscript";
|
||||
import type { GetTranscriptTopic } from "../models/GetTranscriptTopic";
|
||||
import type { GetTranscriptTopicWithWords } from "../models/GetTranscriptTopicWithWords";
|
||||
import type { GetTranscriptTopicWithWordsPerSpeaker } from "../models/GetTranscriptTopicWithWordsPerSpeaker";
|
||||
import type { Page_GetTranscript_ } from "../models/Page_GetTranscript_";
|
||||
import type { Participant } from "../models/Participant";
|
||||
import type { RtcOffer } from "../models/RtcOffer";
|
||||
import type { SpeakerAssignment } from "../models/SpeakerAssignment";
|
||||
import type { SpeakerAssignmentStatus } from "../models/SpeakerAssignmentStatus";
|
||||
import type { SpeakerMerge } from "../models/SpeakerMerge";
|
||||
import type { UpdateParticipant } from "../models/UpdateParticipant";
|
||||
import type { UpdateTranscript } from "../models/UpdateTranscript";
|
||||
import type { UserInfo } from "../models/UserInfo";
|
||||
|
||||
import type { CancelablePromise } from "../core/CancelablePromise";
|
||||
import type { BaseHttpRequest } from "../core/BaseHttpRequest";
|
||||
|
||||
export class DefaultService {
|
||||
constructor(public readonly httpRequest: BaseHttpRequest) {}
|
||||
|
||||
/**
|
||||
* Metrics
|
||||
* Endpoint that serves Prometheus metrics.
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public metrics(): CancelablePromise<any> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/metrics",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcripts List
|
||||
* @param page Page number
|
||||
* @param size Page size
|
||||
* @returns Page_GetTranscript_ Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptsList(
|
||||
page: number = 1,
|
||||
size: number = 50,
|
||||
): CancelablePromise<Page_GetTranscript_> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts",
|
||||
query: {
|
||||
page: page,
|
||||
size: size,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcripts Create
|
||||
* @param requestBody
|
||||
* @returns GetTranscript Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptsCreate(
|
||||
requestBody: CreateTranscript,
|
||||
): CancelablePromise<GetTranscript> {
|
||||
return this.httpRequest.request({
|
||||
method: "POST",
|
||||
url: "/v1/transcripts",
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get
|
||||
* @param transcriptId
|
||||
* @returns GetTranscript Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGet(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<GetTranscript> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Update
|
||||
* @param transcriptId
|
||||
* @param requestBody
|
||||
* @returns GetTranscript Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptUpdate(
|
||||
transcriptId: string,
|
||||
requestBody: UpdateTranscript,
|
||||
): CancelablePromise<GetTranscript> {
|
||||
return this.httpRequest.request({
|
||||
method: "PATCH",
|
||||
url: "/v1/transcripts/{transcript_id}",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Delete
|
||||
* @param transcriptId
|
||||
* @returns DeletionStatus Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptDelete(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<DeletionStatus> {
|
||||
return this.httpRequest.request({
|
||||
method: "DELETE",
|
||||
url: "/v1/transcripts/{transcript_id}",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Topics
|
||||
* @param transcriptId
|
||||
* @returns GetTranscriptTopic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetTopics(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<Array<GetTranscriptTopic>> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/topics",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Topics With Words
|
||||
* @param transcriptId
|
||||
* @returns GetTranscriptTopicWithWords Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetTopicsWithWords(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<Array<GetTranscriptTopicWithWords>> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/topics/with-words",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Topics With Words Per Speaker
|
||||
* @param transcriptId
|
||||
* @param topicId
|
||||
* @returns GetTranscriptTopicWithWordsPerSpeaker Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetTopicsWithWordsPerSpeaker(
|
||||
transcriptId: string,
|
||||
topicId: string,
|
||||
): CancelablePromise<GetTranscriptTopicWithWordsPerSpeaker> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/topics/{topic_id}/words-per-speaker",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
topic_id: topicId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Audio Mp3
|
||||
* @param transcriptId
|
||||
* @param token
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptHeadAudioMp3(
|
||||
transcriptId: string,
|
||||
token?: string | null,
|
||||
): CancelablePromise<any> {
|
||||
return this.httpRequest.request({
|
||||
method: "HEAD",
|
||||
url: "/v1/transcripts/{transcript_id}/audio/mp3",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
query: {
|
||||
token: token,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Audio Mp3
|
||||
* @param transcriptId
|
||||
* @param token
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetAudioMp3(
|
||||
transcriptId: string,
|
||||
token?: string | null,
|
||||
): CancelablePromise<any> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/audio/mp3",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
query: {
|
||||
token: token,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Audio Waveform
|
||||
* @param transcriptId
|
||||
* @returns AudioWaveform Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetAudioWaveform(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<AudioWaveform> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/audio/waveform",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Participants
|
||||
* @param transcriptId
|
||||
* @returns Participant Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetParticipants(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<Array<Participant>> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/participants",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Add Participant
|
||||
* @param transcriptId
|
||||
* @param requestBody
|
||||
* @returns Participant Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptAddParticipant(
|
||||
transcriptId: string,
|
||||
requestBody: CreateParticipant,
|
||||
): CancelablePromise<Participant> {
|
||||
return this.httpRequest.request({
|
||||
method: "POST",
|
||||
url: "/v1/transcripts/{transcript_id}/participants",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Participant
|
||||
* @param transcriptId
|
||||
* @param participantId
|
||||
* @returns Participant Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetParticipant(
|
||||
transcriptId: string,
|
||||
participantId: string,
|
||||
): CancelablePromise<Participant> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
participant_id: participantId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Update Participant
|
||||
* @param transcriptId
|
||||
* @param participantId
|
||||
* @param requestBody
|
||||
* @returns Participant Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptUpdateParticipant(
|
||||
transcriptId: string,
|
||||
participantId: string,
|
||||
requestBody: UpdateParticipant,
|
||||
): CancelablePromise<Participant> {
|
||||
return this.httpRequest.request({
|
||||
method: "PATCH",
|
||||
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
participant_id: participantId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Delete Participant
|
||||
* @param transcriptId
|
||||
* @param participantId
|
||||
* @returns DeletionStatus Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptDeleteParticipant(
|
||||
transcriptId: string,
|
||||
participantId: string,
|
||||
): CancelablePromise<DeletionStatus> {
|
||||
return this.httpRequest.request({
|
||||
method: "DELETE",
|
||||
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
participant_id: participantId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Assign Speaker
|
||||
* @param transcriptId
|
||||
* @param requestBody
|
||||
* @returns SpeakerAssignmentStatus Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptAssignSpeaker(
|
||||
transcriptId: string,
|
||||
requestBody: SpeakerAssignment,
|
||||
): CancelablePromise<SpeakerAssignmentStatus> {
|
||||
return this.httpRequest.request({
|
||||
method: "PATCH",
|
||||
url: "/v1/transcripts/{transcript_id}/speaker/assign",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Merge Speaker
|
||||
* @param transcriptId
|
||||
* @param requestBody
|
||||
* @returns SpeakerAssignmentStatus Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptMergeSpeaker(
|
||||
transcriptId: string,
|
||||
requestBody: SpeakerMerge,
|
||||
): CancelablePromise<SpeakerAssignmentStatus> {
|
||||
return this.httpRequest.request({
|
||||
method: "PATCH",
|
||||
url: "/v1/transcripts/{transcript_id}/speaker/merge",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Record Upload
|
||||
* @param transcriptId
|
||||
* @param formData
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptRecordUpload(
|
||||
transcriptId: string,
|
||||
formData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post,
|
||||
): CancelablePromise<any> {
|
||||
return this.httpRequest.request({
|
||||
method: "POST",
|
||||
url: "/v1/transcripts/{transcript_id}/record/upload",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
formData: formData,
|
||||
mediaType: "multipart/form-data",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Get Websocket Events
|
||||
* @param transcriptId
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptGetWebsocketEvents(
|
||||
transcriptId: string,
|
||||
): CancelablePromise<any> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/transcripts/{transcript_id}/events",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Transcript Record Webrtc
|
||||
* @param transcriptId
|
||||
* @param requestBody
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1TranscriptRecordWebrtc(
|
||||
transcriptId: string,
|
||||
requestBody: RtcOffer,
|
||||
): CancelablePromise<any> {
|
||||
return this.httpRequest.request({
|
||||
method: "POST",
|
||||
url: "/v1/transcripts/{transcript_id}/record/webrtc",
|
||||
path: {
|
||||
transcript_id: transcriptId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* User Me
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public v1UserMe(): CancelablePromise<UserInfo | null> {
|
||||
return this.httpRequest.request({
|
||||
method: "GET",
|
||||
url: "/v1/me",
|
||||
});
|
||||
}
|
||||
}
|
||||
7
www/app/lib/shareMode.ts
Normal file
7
www/app/lib/shareMode.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type ShareMode = "public" | "semi-private" | "private" | null;
|
||||
|
||||
export function toShareMode(value: string | undefined | null): ShareMode {
|
||||
return value === "public" || value === "semi-private" || value === "private"
|
||||
? value
|
||||
: null;
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
import { Configuration } from "../api/runtime";
|
||||
import { DefaultApi } from "../api/apis/DefaultApi";
|
||||
|
||||
import { useFiefAccessTokenInfo } from "@fief/fief/nextjs/react";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { DomainContext, featureEnabled } from "../[domain]/domainContext";
|
||||
import { CookieContext } from "../(auth)/fiefWrapper";
|
||||
import { OpenApi, DefaultService } from "../api";
|
||||
|
||||
export default function getApi(): DefaultApi | undefined {
|
||||
export default function useApi(): DefaultService | null {
|
||||
const accessTokenInfo = useFiefAccessTokenInfo();
|
||||
const api_url = useContext(DomainContext).api_url;
|
||||
const requireLogin = featureEnabled("requireLogin");
|
||||
const [api, setApi] = useState<DefaultApi>();
|
||||
const [api, setApi] = useState<OpenApi | null>(null);
|
||||
const { hasAuthCookie } = useContext(CookieContext);
|
||||
|
||||
if (!api_url) throw new Error("no API URL");
|
||||
@@ -20,14 +18,15 @@ export default function getApi(): DefaultApi | undefined {
|
||||
return;
|
||||
}
|
||||
|
||||
const apiConfiguration = new Configuration({
|
||||
basePath: api_url,
|
||||
accessToken: accessTokenInfo
|
||||
? "Bearer " + accessTokenInfo.access_token
|
||||
: undefined,
|
||||
if (!accessTokenInfo) return;
|
||||
|
||||
const openApi = new OpenApi({
|
||||
BASE: api_url,
|
||||
TOKEN: accessTokenInfo?.access_token,
|
||||
});
|
||||
setApi(new DefaultApi(apiConfiguration));
|
||||
|
||||
setApi(openApi);
|
||||
}, [!accessTokenInfo, hasAuthCookie]);
|
||||
|
||||
return api;
|
||||
return api?.default ?? null;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export function getZulipMessage(
|
||||
topics: GetTranscriptTopic[] | null,
|
||||
includeTopics: boolean,
|
||||
) {
|
||||
const date = new Date(transcript.createdAt);
|
||||
const date = new Date(transcript.created_at);
|
||||
|
||||
// Get the timezone offset in minutes and convert it to hours and minutes
|
||||
const timezoneOffset = -date.getTimezoneOffset();
|
||||
@@ -72,7 +72,7 @@ export function getZulipMessage(
|
||||
}
|
||||
|
||||
let summary = "```spoiler Summary\n";
|
||||
summary += transcript.longSummary;
|
||||
summary += transcript.long_summary;
|
||||
summary += "```\n\n";
|
||||
|
||||
const message = headerText + summary + topicText + "-----\n";
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"format": "prettier --write .",
|
||||
"openapi": "openapi-generator-cli generate -i http://localhost:1250/openapi.json -g typescript-fetch -o app/api && yarn format"
|
||||
"openapi": "openapi --input http://127.0.0.1:1250/openapi.json --name OpenApi --output app/api && yarn format"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fief/fief": "^0.13.5",
|
||||
@@ -19,10 +19,12 @@
|
||||
"@vercel/edge-config": "^0.4.1",
|
||||
"autoprefixer": "10.4.14",
|
||||
"axios": "^1.6.2",
|
||||
"eslint-config-next": "^14.0.4",
|
||||
"fontawesome": "^5.6.3",
|
||||
"jest-worker": "^29.6.2",
|
||||
"next": "^13.4.9",
|
||||
"next": "^14.0.4",
|
||||
"postcss": "8.4.25",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-dropdown": "^1.11.0",
|
||||
@@ -44,6 +46,7 @@
|
||||
"devDependencies": {
|
||||
"@openapitools/openapi-generator-cli": "^2.7.0",
|
||||
"@types/react": "18.2.20",
|
||||
"openapi-typescript-codegen": "^0.25.0",
|
||||
"prettier": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
1389
www/yarn.lock
1389
www/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user