mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-23 05:39:05 +00:00
refactor: remove api-types.ts compatibility layer
- Migrated all 29 files from api-types.ts to use reflector-api.d.ts directly
- Removed $SourceKind manual enum in favor of OpenAPI-generated types
- Fixed unrelated Spinner component TypeScript error in AuthWrapper.tsx
- All imports now use: import type { components } from "path/to/reflector-api"
- Deleted api-types.ts file completely
This commit is contained in:
@@ -6,7 +6,8 @@ import TopicPlayer from "./topicPlayer";
|
||||
import useParticipants from "../../useParticipants";
|
||||
import useTopicWithWords from "../../useTopicWithWords";
|
||||
import ParticipantList from "./participantList";
|
||||
import { GetTranscriptTopic } from "../../../../lib/api-types";
|
||||
import type { components } from "../../../../reflector-api";
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
import { SelectedText, selectedTextIsTimeSlice } from "./types";
|
||||
import { useTranscriptUpdate } from "../../../../lib/api-hooks";
|
||||
import useTranscript from "../../useTranscript";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { faArrowTurnDown } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { ChangeEvent, useEffect, useRef, useState } from "react";
|
||||
import { Participant } from "../../../../lib/api-types";
|
||||
import type { components } from "../../../../reflector-api";
|
||||
type Participant = components["schemas"]["Participant"];
|
||||
import {
|
||||
useTranscriptSpeakerAssign,
|
||||
useTranscriptSpeakerMerge,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import useTopics from "../../useTopics";
|
||||
import { Dispatch, SetStateAction, useEffect } from "react";
|
||||
import { GetTranscriptTopic } from "../../../../lib/api-types";
|
||||
import type { components } from "../../../../reflector-api";
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
import {
|
||||
BoxProps,
|
||||
Box,
|
||||
|
||||
@@ -2,7 +2,9 @@ import { useEffect, useRef, useState } from "react";
|
||||
import React from "react";
|
||||
import Markdown from "react-markdown";
|
||||
import "../../../styles/markdown.css";
|
||||
import { GetTranscript, GetTranscriptTopic } from "../../../lib/api-types";
|
||||
import type { components } from "../../../reflector-api";
|
||||
type GetTranscript = components["schemas"]["GetTranscript"];
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
import { useTranscriptUpdate } from "../../../lib/api-hooks";
|
||||
import {
|
||||
Flex,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { CreateTranscript, GetTranscript } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
import { useTranscriptCreate } from "../../lib/api-hooks";
|
||||
|
||||
type CreateTranscript = components["schemas"]["CreateTranscript"];
|
||||
type GetTranscript = components["schemas"]["GetTranscript"];
|
||||
|
||||
type UseCreateTranscript = {
|
||||
transcript: GetTranscript | null;
|
||||
loading: boolean;
|
||||
|
||||
@@ -5,7 +5,9 @@ import RegionsPlugin from "wavesurfer.js/dist/plugins/regions.esm.js";
|
||||
|
||||
import { formatTime, formatTimeMs } from "../../lib/time";
|
||||
import { Topic } from "./webSocketTypes";
|
||||
import { AudioWaveform } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
|
||||
type AudioWaveform = components["schemas"]["AudioWaveform"];
|
||||
import { waveSurferStyles } from "../../styles/recorder";
|
||||
import { Box, Flex, IconButton } from "@chakra-ui/react";
|
||||
import { LuPause, LuPlay } from "react-icons/lu";
|
||||
|
||||
@@ -2,11 +2,10 @@ import { useEffect, useState } from "react";
|
||||
import { featureEnabled } from "../../domainContext";
|
||||
|
||||
import { ShareMode, toShareMode } from "../../lib/shareMode";
|
||||
import {
|
||||
GetTranscript,
|
||||
GetTranscriptTopic,
|
||||
UpdateTranscript,
|
||||
} from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
type GetTranscript = components["schemas"]["GetTranscript"];
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
type UpdateTranscript = components["schemas"]["UpdateTranscript"];
|
||||
import {
|
||||
Box,
|
||||
Flex,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { GetTranscript, GetTranscriptTopic } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
type GetTranscript = components["schemas"]["GetTranscript"];
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
import { Button, BoxProps, Box } from "@chakra-ui/react";
|
||||
|
||||
type ShareCopyProps = {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { featureEnabled } from "../../domainContext";
|
||||
import { GetTranscript, GetTranscriptTopic } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
|
||||
type GetTranscript = components["schemas"]["GetTranscript"];
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
import {
|
||||
BoxProps,
|
||||
Button,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { UpdateTranscript } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
|
||||
type UpdateTranscript = components["schemas"]["UpdateTranscript"];
|
||||
import { useTranscriptUpdate } from "../../lib/api-hooks";
|
||||
import { Heading, IconButton, Input, Flex, Spacer } from "@chakra-ui/react";
|
||||
import { LuPen } from "react-icons/lu";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Participant } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
type Participant = components["schemas"]["Participant"];
|
||||
import { useTranscriptParticipants } from "../../lib/api-hooks";
|
||||
|
||||
type ErrorParticipants = {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Wrapper for backward compatibility
|
||||
import { SearchResult, SourceKind } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
type SearchResult = components["schemas"]["SearchResult"];
|
||||
type SourceKind = components["schemas"]["SourceKind"];
|
||||
import { useTranscriptsSearch } from "../../lib/api-hooks";
|
||||
import {
|
||||
PaginationPage,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { GetTranscriptTopicWithWordsPerSpeaker } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
import { useTranscriptTopicsWithWordsPerSpeaker } from "../../lib/api-hooks";
|
||||
|
||||
type GetTranscriptTopicWithWordsPerSpeaker =
|
||||
components["schemas"]["GetTranscriptTopicWithWordsPerSpeaker"];
|
||||
|
||||
type ErrorTopicWithWords = {
|
||||
error: Error;
|
||||
loading: false;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { useTranscriptTopics } from "../../lib/api-hooks";
|
||||
import { GetTranscriptTopic } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
|
||||
type TranscriptTopics = {
|
||||
topics: GetTranscriptTopic[] | null;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { GetTranscript } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
import { useTranscriptGet } from "../../lib/api-hooks";
|
||||
|
||||
type GetTranscript = components["schemas"]["GetTranscript"];
|
||||
|
||||
type ErrorTranscript = {
|
||||
error: Error;
|
||||
loading: false;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { AudioWaveform } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
import { useTranscriptWaveform } from "../../lib/api-hooks";
|
||||
|
||||
type AudioWaveform = components["schemas"]["AudioWaveform"];
|
||||
|
||||
type AudioWaveFormResponse = {
|
||||
waveform: AudioWaveform | null;
|
||||
loading: boolean;
|
||||
|
||||
@@ -2,7 +2,8 @@ import { useEffect, useState } from "react";
|
||||
import Peer from "simple-peer";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import { useTranscriptWebRTC } from "../../lib/api-hooks";
|
||||
import { RtcOffer } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
type RtcOffer = components["schemas"]["RtcOffer"];
|
||||
|
||||
const useWebRTC = (
|
||||
stream: MediaStream | null,
|
||||
|
||||
@@ -2,7 +2,10 @@ import { useContext, useEffect, useState } from "react";
|
||||
import { Topic, FinalSummary, Status } from "./webSocketTypes";
|
||||
import { useError } from "../../(errors)/errorContext";
|
||||
import { DomainContext } from "../../domainContext";
|
||||
import { AudioWaveform, GetTranscriptSegmentTopic } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
type AudioWaveform = components["schemas"]["AudioWaveform"];
|
||||
type GetTranscriptSegmentTopic =
|
||||
components["schemas"]["GetTranscriptSegmentTopic"];
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { $api } from "../../lib/apiClient";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { GetTranscriptTopic } from "../../lib/api-types";
|
||||
import type { components } from "../../reflector-api";
|
||||
|
||||
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
||||
|
||||
export type Topic = GetTranscriptTopic;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user