From c36b64cff1bbb887c89b472991ec689f49318fb2 Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Wed, 3 Jul 2024 14:16:11 +0200 Subject: [PATCH 1/5] Upgrade to latest openapi codegen --- README.md | 34 +- .../[transcriptId]/record/page.tsx | 2 +- .../[domain]/transcripts/shareAndPrivacy.tsx | 10 +- www/app/[domain]/transcripts/topicList.tsx | 10 +- www/app/api/Api.ts | 36 -- www/app/api/OpenApi.ts | 8 +- www/app/api/core/ApiError.ts | 2 +- www/app/api/core/ApiRequestOptions.ts | 2 +- www/app/api/core/ApiResult.ts | 2 +- www/app/api/core/BaseHttpRequest.ts | 2 +- www/app/api/core/CancelablePromise.ts | 8 +- www/app/api/core/FetchHttpRequest.ts | 2 +- www/app/api/core/OpenAPI.ts | 2 +- www/app/api/core/request.ts | 14 +- www/app/api/index.ts | 2 +- www/app/api/models/AudioWaveform.ts | 3 +- ...ipts__transcript_id__record_upload_post.ts | 3 +- www/app/api/models/CreateParticipant.ts | 3 +- www/app/api/models/CreateTranscript.ts | 3 +- www/app/api/models/DeletionStatus.ts | 3 +- www/app/api/models/GetTranscript.ts | 4 +- .../api/models/GetTranscriptSegmentTopic.ts | 3 +- www/app/api/models/GetTranscriptTopic.ts | 4 +- .../api/models/GetTranscriptTopicWithWords.ts | 4 +- .../GetTranscriptTopicWithWordsPerSpeaker.ts | 4 +- www/app/api/models/HTTPValidationError.ts | 4 +- www/app/api/models/Page_GetTranscript_.ts | 4 +- www/app/api/models/Participant.ts | 3 +- www/app/api/models/RtcOffer.ts | 3 +- www/app/api/models/SpeakerAssignment.ts | 3 +- www/app/api/models/SpeakerAssignmentStatus.ts | 3 +- www/app/api/models/SpeakerMerge.ts | 3 +- www/app/api/models/SpeakerWords.ts | 4 +- www/app/api/models/TranscriptParticipant.ts | 3 +- www/app/api/models/UpdateParticipant.ts | 3 +- www/app/api/models/UpdateTranscript.ts | 4 +- www/app/api/models/UserInfo.ts | 3 +- www/app/api/models/ValidationError.ts | 3 +- www/app/api/models/Word.ts | 3 +- www/app/api/services/DefaultService.ts | 27 +- www/app/lib/zulip.ts | 6 +- www/package.json | 3 +- www/yarn.lock | 569 ++---------------- 43 files changed, 115 insertions(+), 706 deletions(-) delete mode 100644 www/app/api/Api.ts diff --git a/README.md b/README.md index cd967998..83db0f2f 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Reflector Audio Management and Analysis is a cutting-edge web application under The project architecture consists of three primary components: -* **Front-End**: NextJS React project hosted on Vercel, located in `www/`. -* **Back-End**: Python server that offers an API and data persistence, found in `server/`. -* **GPU implementation**: Providing services such as speech-to-text transcription, topic generation, automated summaries, and translations. +- **Front-End**: NextJS React project hosted on Vercel, located in `www/`. +- **Back-End**: Python server that offers an API and data persistence, found in `server/`. +- **GPU implementation**: Providing services such as speech-to-text transcription, topic generation, automated summaries, and translations. It also uses https://github.com/fief-dev for authentication, and Vercel for deployment and configuration of the front-end. @@ -41,26 +41,28 @@ It also uses https://github.com/fief-dev for authentication, and Vercel for depl All new contributions should be made in a separate branch. Before any code is merged into `main`, it requires a code review. ### How to Install Blackhole (Mac Only) + To record both your voice and the meeting you're taking part in, you need : + - For an in-person meeting, make sure your microphone is in range of all participants. - If using several miscrophones, make sure to merge the audio feeds into one with an external tool. - For an online meeting, if you do not use headphones, your microphone should be able to pick up both your voice and the audio feed of the meeting. - If you want to use headphones, you need to merge the audio feeds with an external tool. - This is an external tool for merging the audio feeds as explained in the previous section of this document. Note: We currently do not have instructions for Windows users. -* Install [Blackhole](https://github.com/ExistentialAudio/BlackHole)-2ch (2 ch is enough) by 1 of 2 options listed. -* Setup ["Aggregate device"](https://github.com/ExistentialAudio/BlackHole/wiki/Aggregate-Device) to route web audio and local microphone input. -* Setup [Multi-Output device](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device) -* Then goto ```System Preferences -> Sound``` and choose the devices created from the Output and Input tabs. -* The input from your local microphone, the browser run meeting should be aggregated into one virtual stream to listen to and the output should be fed back to your specified output devices if everything is configured properly. + +- Install [Blackhole](https://github.com/ExistentialAudio/BlackHole)-2ch (2 ch is enough) by 1 of 2 options listed. +- Setup ["Aggregate device"](https://github.com/ExistentialAudio/BlackHole/wiki/Aggregate-Device) to route web audio and local microphone input. +- Setup [Multi-Output device](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device) +- Then goto `System Preferences -> Sound` and choose the devices created from the Output and Input tabs. +- The input from your local microphone, the browser run meeting should be aggregated into one virtual stream to listen to and the output should be fed back to your specified output devices if everything is configured properly. Permissions: You may have to add permission for browser's microphone access to record audio in -```System Preferences -> Privacy & Security -> Microphone``` -```System Preferences -> Privacy & Security -> Accessibility```. You will be prompted to provide these when you try to connect. +`System Preferences -> Privacy & Security -> Microphone` +`System Preferences -> Privacy & Security -> Accessibility`. You will be prompted to provide these when you try to connect. ## Front-End @@ -96,8 +98,6 @@ To generate the TypeScript files from the openapi.json file, make sure the pytho yarn openapi ``` -You may need to run `yarn global add @openapitools/openapi-generator-cli` first. You also need a Java runtime installed on your machine. - ## Back-End Start with `cd server`. @@ -153,11 +153,13 @@ docker compose up -d redis **Option 2** Install: + - [Git for Windows](https://gitforwindows.org/) - [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install) -- Install your preferred Linux distribution via the Microsoft Store (e.g., Ubuntu). +- Install your preferred Linux distribution via the Microsoft Store (e.g., Ubuntu). Open your Linux distribution and update the package list: + ```bash sudo apt update sudo apt install redis-server @@ -198,7 +200,6 @@ docker-compose up server - Ensure the API server is activated in GPT4all - Run with: `LLM_BACKEND=openai LLM_URL=http://localhost:4891/v1/completions LLM_OPENAI_MODEL="GPT4All Falcon" python -m reflector.app` - ### Using local files ``` @@ -207,5 +208,4 @@ poetry run python -m reflector.tools.process path/to/audio.wav ## AI Models -*(Documentation for this section is pending.)* - +_(Documentation for this section is pending.)_ diff --git a/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx index 9c02ed44..fbe219a8 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx @@ -32,7 +32,7 @@ const TranscriptRecord = (details: TranscriptDetails) => { const router = useRouter(); const [status, setStatus] = useState( - webSockets.status.value || transcript.response?.status || "idle" + webSockets.status.value || transcript.response?.status || "idle", ); useEffect(() => { diff --git a/www/app/[domain]/transcripts/shareAndPrivacy.tsx b/www/app/[domain]/transcripts/shareAndPrivacy.tsx index 864a66ab..88ef661e 100644 --- a/www/app/[domain]/transcripts/shareAndPrivacy.tsx +++ b/www/app/[domain]/transcripts/shareAndPrivacy.tsx @@ -41,8 +41,8 @@ export default function ShareAndPrivacy(props: ShareAndPrivacyProps) { const [isOwner, setIsOwner] = useState(false); const [shareMode, setShareMode] = useState( shareOptions.find( - (option) => option.value === props.transcriptResponse.share_mode - ) || shareOptions[0] + (option) => option.value === props.transcriptResponse.share_mode, + ) || shareOptions[0], ); const [shareLoading, setShareLoading] = useState(false); const requireLogin = featureEnabled("requireLogin"); @@ -59,12 +59,12 @@ export default function ShareAndPrivacy(props: ShareAndPrivacyProps) { const updatedTranscript = await api.v1TranscriptUpdate( props.transcriptResponse.id, - requestBody + requestBody, ); setShareMode( shareOptions.find( - (option) => option.value === updatedTranscript.share_mode - ) || shareOptions[0] + (option) => option.value === updatedTranscript.share_mode, + ) || shareOptions[0], ); setShareLoading(false); }; diff --git a/www/app/[domain]/transcripts/topicList.tsx b/www/app/[domain]/transcripts/topicList.tsx index 2a3bbfc6..f6480913 100644 --- a/www/app/[domain]/transcripts/topicList.tsx +++ b/www/app/[domain]/transcripts/topicList.tsx @@ -42,7 +42,7 @@ export function TopicList({ const scrollToTopic = () => { const topicDiv = document.getElementById( - `accordion-button-topic-${activeTopic?.id}` + `accordion-button-topic-${activeTopic?.id}`, ); setTimeout(() => { @@ -63,7 +63,7 @@ export function TopicList({ const toggleScroll = (element) => { const bottom = Math.abs( - element.scrollHeight - element.clientHeight - element.scrollTop + element.scrollHeight - element.clientHeight - element.scrollTop, ) < 2 || element.scrollHeight == element.clientHeight; if (!bottom && autoscrollEnabled) { setAutoscrollEnabled(false); @@ -97,7 +97,7 @@ export function TopicList({ if (!participants.response) return; return ( participants.response.find( - (participant) => participant.speaker == speakerNumber + (participant) => participant.speaker == speakerNumber, )?.name || `Speaker ${speakerNumber}` ); }; @@ -157,7 +157,7 @@ export function TopicList({ { setActiveTopic( - activeTopic?.id == topic.id ? null : topic + activeTopic?.id == topic.id ? null : topic, ); }} > @@ -200,7 +200,7 @@ export function TopicList({ fontSize={"sm"} color={generateHighContrastColor( `Speaker ${segment.speaker}`, - [96, 165, 250] + [96, 165, 250], )} > {" "} diff --git a/www/app/api/Api.ts b/www/app/api/Api.ts deleted file mode 100644 index d80252ec..00000000 --- a/www/app/api/Api.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* 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, - 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); - } -} diff --git a/www/app/api/OpenApi.ts b/www/app/api/OpenApi.ts index 70ac35d9..a66a8146 100644 --- a/www/app/api/OpenApi.ts +++ b/www/app/api/OpenApi.ts @@ -1,20 +1,15 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not 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, HttpRequest: HttpRequestConstructor = FetchHttpRequest, @@ -30,7 +25,6 @@ export class OpenApi { HEADERS: config?.HEADERS, ENCODE_PATH: config?.ENCODE_PATH, }); - this.default = new DefaultService(this.request); } } diff --git a/www/app/api/core/ApiError.ts b/www/app/api/core/ApiError.ts index ebc11612..3335e5aa 100644 --- a/www/app/api/core/ApiError.ts +++ b/www/app/api/core/ApiError.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/core/ApiRequestOptions.ts b/www/app/api/core/ApiRequestOptions.ts index ac9a2ca2..13f2bdf6 100644 --- a/www/app/api/core/ApiRequestOptions.ts +++ b/www/app/api/core/ApiRequestOptions.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/core/ApiResult.ts b/www/app/api/core/ApiResult.ts index 63ed6c44..24c93fc1 100644 --- a/www/app/api/core/ApiResult.ts +++ b/www/app/api/core/ApiResult.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/core/BaseHttpRequest.ts b/www/app/api/core/BaseHttpRequest.ts index f0781151..29c8c164 100644 --- a/www/app/api/core/BaseHttpRequest.ts +++ b/www/app/api/core/BaseHttpRequest.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/core/CancelablePromise.ts b/www/app/api/core/CancelablePromise.ts index 6aefa9e2..442c2beb 100644 --- a/www/app/api/core/CancelablePromise.ts +++ b/www/app/api/core/CancelablePromise.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ @@ -50,7 +50,7 @@ export class CancelablePromise implements Promise { return; } this.#isResolved = true; - this.#resolve?.(value); + if (this.#resolve) this.#resolve(value); }; const onReject = (reason?: any): void => { @@ -58,7 +58,7 @@ export class CancelablePromise implements Promise { return; } this.#isRejected = true; - this.#reject?.(reason); + if (this.#reject) this.#reject(reason); }; const onCancel = (cancelHandler: () => void): void => { @@ -121,7 +121,7 @@ export class CancelablePromise implements Promise { } } this.#cancelHandlers.length = 0; - this.#reject?.(new CancelError("Request aborted")); + if (this.#reject) this.#reject(new CancelError("Request aborted")); } public get isCancelled(): boolean { diff --git a/www/app/api/core/FetchHttpRequest.ts b/www/app/api/core/FetchHttpRequest.ts index 3683c443..63da86ca 100644 --- a/www/app/api/core/FetchHttpRequest.ts +++ b/www/app/api/core/FetchHttpRequest.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/core/OpenAPI.ts b/www/app/api/core/OpenAPI.ts index b1e4d170..d8b7da6b 100644 --- a/www/app/api/core/OpenAPI.ts +++ b/www/app/api/core/OpenAPI.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/core/request.ts b/www/app/api/core/request.ts index 72ed0140..ab66380a 100644 --- a/www/app/api/core/request.ts +++ b/www/app/api/core/request.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ @@ -147,10 +147,12 @@ export const getHeaders = async ( config: OpenAPIConfig, options: ApiRequestOptions, ): Promise => { - 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 [token, username, password, additionalHeaders] = await Promise.all([ + resolve(options, config.TOKEN), + resolve(options, config.USERNAME), + resolve(options, config.PASSWORD), + resolve(options, config.HEADERS), + ]); const headers = Object.entries({ Accept: "application/json", @@ -175,7 +177,7 @@ export const getHeaders = async ( headers["Authorization"] = `Basic ${credentials}`; } - if (options.body) { + if (options.body !== undefined) { if (options.mediaType) { headers["Content-Type"] = options.mediaType; } else if (isBlob(options.body)) { diff --git a/www/app/api/index.ts b/www/app/api/index.ts index 61227da5..6eed94cc 100644 --- a/www/app/api/index.ts +++ b/www/app/api/index.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ diff --git a/www/app/api/models/AudioWaveform.ts b/www/app/api/models/AudioWaveform.ts index 938cf9e2..f48cc681 100644 --- a/www/app/api/models/AudioWaveform.ts +++ b/www/app/api/models/AudioWaveform.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type AudioWaveform = { data: Array; }; diff --git a/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts b/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts index fd182263..b89d4e7e 100644 --- a/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts +++ b/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = { file: Blob; diff --git a/www/app/api/models/CreateParticipant.ts b/www/app/api/models/CreateParticipant.ts index d0c9f9d7..bf1116b2 100644 --- a/www/app/api/models/CreateParticipant.ts +++ b/www/app/api/models/CreateParticipant.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type CreateParticipant = { speaker?: number | null; name: string; diff --git a/www/app/api/models/CreateTranscript.ts b/www/app/api/models/CreateTranscript.ts index 4da1b237..cf69f201 100644 --- a/www/app/api/models/CreateTranscript.ts +++ b/www/app/api/models/CreateTranscript.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type CreateTranscript = { name: string; source_language?: string; diff --git a/www/app/api/models/DeletionStatus.ts b/www/app/api/models/DeletionStatus.ts index 1a70c8ee..0a7a8373 100644 --- a/www/app/api/models/DeletionStatus.ts +++ b/www/app/api/models/DeletionStatus.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type DeletionStatus = { status: string; }; diff --git a/www/app/api/models/GetTranscript.ts b/www/app/api/models/GetTranscript.ts index fb6de536..d5f76dce 100644 --- a/www/app/api/models/GetTranscript.ts +++ b/www/app/api/models/GetTranscript.ts @@ -1,10 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { TranscriptParticipant } from "./TranscriptParticipant"; - export type GetTranscript = { id: string; user_id: string | null; diff --git a/www/app/api/models/GetTranscriptSegmentTopic.ts b/www/app/api/models/GetTranscriptSegmentTopic.ts index c616cd25..bb648d46 100644 --- a/www/app/api/models/GetTranscriptSegmentTopic.ts +++ b/www/app/api/models/GetTranscriptSegmentTopic.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type GetTranscriptSegmentTopic = { text: string; start: number; diff --git a/www/app/api/models/GetTranscriptTopic.ts b/www/app/api/models/GetTranscriptTopic.ts index 318c2f44..14d63dc2 100644 --- a/www/app/api/models/GetTranscriptTopic.ts +++ b/www/app/api/models/GetTranscriptTopic.ts @@ -1,10 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; - export type GetTranscriptTopic = { id: string; title: string; diff --git a/www/app/api/models/GetTranscriptTopicWithWords.ts b/www/app/api/models/GetTranscriptTopicWithWords.ts index e96949c0..49f242d6 100644 --- a/www/app/api/models/GetTranscriptTopicWithWords.ts +++ b/www/app/api/models/GetTranscriptTopicWithWords.ts @@ -1,11 +1,9 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; import type { Word } from "./Word"; - export type GetTranscriptTopicWithWords = { id: string; title: string; diff --git a/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts b/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts index 8febf307..99fb96e6 100644 --- a/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts +++ b/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts @@ -1,11 +1,9 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; import type { SpeakerWords } from "./SpeakerWords"; - export type GetTranscriptTopicWithWordsPerSpeaker = { id: string; title: string; diff --git a/www/app/api/models/HTTPValidationError.ts b/www/app/api/models/HTTPValidationError.ts index 0f7e0013..11c031ec 100644 --- a/www/app/api/models/HTTPValidationError.ts +++ b/www/app/api/models/HTTPValidationError.ts @@ -1,10 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { ValidationError } from "./ValidationError"; - export type HTTPValidationError = { detail?: Array; }; diff --git a/www/app/api/models/Page_GetTranscript_.ts b/www/app/api/models/Page_GetTranscript_.ts index b14f89ac..e105580e 100644 --- a/www/app/api/models/Page_GetTranscript_.ts +++ b/www/app/api/models/Page_GetTranscript_.ts @@ -1,10 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { GetTranscript } from "./GetTranscript"; - export type Page_GetTranscript_ = { items: Array; total: number; diff --git a/www/app/api/models/Participant.ts b/www/app/api/models/Participant.ts index f9f3b837..7f08f43e 100644 --- a/www/app/api/models/Participant.ts +++ b/www/app/api/models/Participant.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type Participant = { id: string; speaker: number | null; diff --git a/www/app/api/models/RtcOffer.ts b/www/app/api/models/RtcOffer.ts index 90a1139b..c6ef6f66 100644 --- a/www/app/api/models/RtcOffer.ts +++ b/www/app/api/models/RtcOffer.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type RtcOffer = { sdp: string; type: string; diff --git a/www/app/api/models/SpeakerAssignment.ts b/www/app/api/models/SpeakerAssignment.ts index 433442bd..c7c4032f 100644 --- a/www/app/api/models/SpeakerAssignment.ts +++ b/www/app/api/models/SpeakerAssignment.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type SpeakerAssignment = { speaker?: number | null; participant?: string | null; diff --git a/www/app/api/models/SpeakerAssignmentStatus.ts b/www/app/api/models/SpeakerAssignmentStatus.ts index 57be491a..6b8c98df 100644 --- a/www/app/api/models/SpeakerAssignmentStatus.ts +++ b/www/app/api/models/SpeakerAssignmentStatus.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type SpeakerAssignmentStatus = { status: string; }; diff --git a/www/app/api/models/SpeakerMerge.ts b/www/app/api/models/SpeakerMerge.ts index af9214bd..1bebc68f 100644 --- a/www/app/api/models/SpeakerMerge.ts +++ b/www/app/api/models/SpeakerMerge.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type SpeakerMerge = { speaker_from: number; speaker_to: number; diff --git a/www/app/api/models/SpeakerWords.ts b/www/app/api/models/SpeakerWords.ts index 5aacf7f9..99a73737 100644 --- a/www/app/api/models/SpeakerWords.ts +++ b/www/app/api/models/SpeakerWords.ts @@ -1,10 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { Word } from "./Word"; - export type SpeakerWords = { speaker: number; words: Array; diff --git a/www/app/api/models/TranscriptParticipant.ts b/www/app/api/models/TranscriptParticipant.ts index b606a3d9..babcb686 100644 --- a/www/app/api/models/TranscriptParticipant.ts +++ b/www/app/api/models/TranscriptParticipant.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type TranscriptParticipant = { id?: string; speaker: number | null; diff --git a/www/app/api/models/UpdateParticipant.ts b/www/app/api/models/UpdateParticipant.ts index 8915240d..cce7b226 100644 --- a/www/app/api/models/UpdateParticipant.ts +++ b/www/app/api/models/UpdateParticipant.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type UpdateParticipant = { speaker?: number | null; name?: string | null; diff --git a/www/app/api/models/UpdateTranscript.ts b/www/app/api/models/UpdateTranscript.ts index 274f55d2..07c00113 100644 --- a/www/app/api/models/UpdateTranscript.ts +++ b/www/app/api/models/UpdateTranscript.ts @@ -1,10 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - import type { TranscriptParticipant } from "./TranscriptParticipant"; - export type UpdateTranscript = { name?: string | null; locked?: boolean | null; diff --git a/www/app/api/models/UserInfo.ts b/www/app/api/models/UserInfo.ts index e8a423d5..4f8c888f 100644 --- a/www/app/api/models/UserInfo.ts +++ b/www/app/api/models/UserInfo.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type UserInfo = { sub: string; email: string | null; diff --git a/www/app/api/models/ValidationError.ts b/www/app/api/models/ValidationError.ts index c725678a..aa015bfd 100644 --- a/www/app/api/models/ValidationError.ts +++ b/www/app/api/models/ValidationError.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type ValidationError = { loc: Array; msg: string; diff --git a/www/app/api/models/Word.ts b/www/app/api/models/Word.ts index 69b1b18d..e0ebf7d8 100644 --- a/www/app/api/models/Word.ts +++ b/www/app/api/models/Word.ts @@ -1,8 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ - export type Word = { text: string; start: number; diff --git a/www/app/api/services/DefaultService.ts b/www/app/api/services/DefaultService.ts index 0a0ce0c5..6452d5e5 100644 --- a/www/app/api/services/DefaultService.ts +++ b/www/app/api/services/DefaultService.ts @@ -1,4 +1,4 @@ -/* generated using openapi-typescript-codegen -- do no edit */ +/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ @@ -20,13 +20,10 @@ 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. @@ -39,7 +36,6 @@ export class DefaultService { url: "/metrics", }); } - /** * Transcripts List * @param page Page number @@ -63,7 +59,6 @@ export class DefaultService { }, }); } - /** * Transcripts Create * @param requestBody @@ -83,7 +78,6 @@ export class DefaultService { }, }); } - /** * Transcript Get * @param transcriptId @@ -104,7 +98,6 @@ export class DefaultService { }, }); } - /** * Transcript Update * @param transcriptId @@ -129,7 +122,6 @@ export class DefaultService { }, }); } - /** * Transcript Delete * @param transcriptId @@ -150,7 +142,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Topics * @param transcriptId @@ -171,7 +162,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Topics With Words * @param transcriptId @@ -192,7 +182,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Topics With Words Per Speaker * @param transcriptId @@ -216,7 +205,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Audio Mp3 * @param transcriptId @@ -242,7 +230,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Audio Mp3 * @param transcriptId @@ -268,7 +255,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Audio Waveform * @param transcriptId @@ -289,7 +275,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Participants * @param transcriptId @@ -310,7 +295,6 @@ export class DefaultService { }, }); } - /** * Transcript Add Participant * @param transcriptId @@ -335,7 +319,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Participant * @param transcriptId @@ -359,7 +342,6 @@ export class DefaultService { }, }); } - /** * Transcript Update Participant * @param transcriptId @@ -387,7 +369,6 @@ export class DefaultService { }, }); } - /** * Transcript Delete Participant * @param transcriptId @@ -411,7 +392,6 @@ export class DefaultService { }, }); } - /** * Transcript Assign Speaker * @param transcriptId @@ -436,7 +416,6 @@ export class DefaultService { }, }); } - /** * Transcript Merge Speaker * @param transcriptId @@ -461,7 +440,6 @@ export class DefaultService { }, }); } - /** * Transcript Record Upload * @param transcriptId @@ -486,7 +464,6 @@ export class DefaultService { }, }); } - /** * Transcript Get Websocket Events * @param transcriptId @@ -507,7 +484,6 @@ export class DefaultService { }, }); } - /** * Transcript Record Webrtc * @param transcriptId @@ -532,7 +508,6 @@ export class DefaultService { }, }); } - /** * User Me * @returns any Successful Response diff --git a/www/app/lib/zulip.ts b/www/app/lib/zulip.ts index 12e761a4..042f501c 100644 --- a/www/app/lib/zulip.ts +++ b/www/app/lib/zulip.ts @@ -5,7 +5,7 @@ import { extractDomain } from "./utils"; export async function sendZulipMessage( stream: string, topic: string, - message: string + message: string, ) { console.log("Sendiing zulip message", stream, topic); try { @@ -28,14 +28,14 @@ export const ZULIP_MSG_MAX_LENGTH = 10000; export function getZulipMessage( transcript: GetTranscript, topics: GetTranscriptTopic[] | null, - includeTopics: boolean + includeTopics: boolean, ) { const date = new Date(transcript.created_at); // Get the timezone offset in minutes and convert it to hours and minutes const timezoneOffset = -date.getTimezoneOffset(); const offsetHours = String( - Math.floor(Math.abs(timezoneOffset) / 60) + Math.floor(Math.abs(timezoneOffset) / 60), ).padStart(2, "0"); const offsetMinutes = String(Math.abs(timezoneOffset) % 60).padStart(2, "0"); const offsetSign = timezoneOffset >= 0 ? "+" : "-"; diff --git a/www/package.json b/www/package.json index 8c86456e..37a15374 100644 --- a/www/package.json +++ b/www/package.json @@ -55,9 +55,8 @@ "author": "Andreas ", "license": "All Rights Reserved", "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.7.0", "@types/react": "18.2.20", - "openapi-typescript-codegen": "^0.25.0", + "openapi-typescript-codegen": "^0.29.0", "prettier": "^3.0.0" } } diff --git a/www/yarn.lock b/www/yarn.lock index baac24ec..9f2317bf 100644 --- a/www/yarn.lock +++ b/www/yarn.lock @@ -12,14 +12,13 @@ resolved "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz" integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== -"@apidevtools/json-schema-ref-parser@9.0.9": - version "9.0.9" - resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#d720f9256e3609621280584f2b47ae165359268b" - integrity sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w== +"@apidevtools/json-schema-ref-parser@^11.5.4": + version "11.6.4" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.4.tgz#0f3e02302f646471d621a8850e6a346d63c8ebd4" + integrity sha512-9K6xOqeevacvweLGik6LnZCb1fBtCOSIWQs8d096XGeqoLKC33UVMGz9+77Gw44KvbH4pKcQPWo4ZpxkXYj05w== dependencies: "@jsdevtools/ono" "^7.1.3" - "@types/json-schema" "^7.0.6" - call-me-maybe "^1.0.1" + "@types/json-schema" "^7.0.15" js-yaml "^4.1.0" "@babel/code-frame@^7.0.0": @@ -63,13 +62,6 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.21.0": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.10.tgz#ae3e9631fd947cb7e3610d3e9d8fef5f76696682" - integrity sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ== - dependencies: - regenerator-runtime "^0.14.0" - "@babel/types@^7.22.15": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" @@ -1191,39 +1183,6 @@ resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== -"@lukeed/csprng@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.1.0.tgz#1e3e4bd05c1cc7a0b2ddbd8a03f39f6e4b5e6cfe" - integrity sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA== - -"@nestjs/axios@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@nestjs/axios/-/axios-0.1.0.tgz#6cf93df11ef93b598b3c7411adb980eedd13b3e3" - integrity sha512-b2TT2X6BFbnNoeteiaxCIiHaFcSbVW+S5yygYqiIq5i6H77yIU3IVuLdpQkHq8/EqOWFwMopLN8jdkUT71Am9w== - dependencies: - axios "0.27.2" - -"@nestjs/common@9.3.11": - version "9.3.11" - resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.11.tgz#95a54a2dd0fec0a7abc1edba793c53a53b59c783" - integrity sha512-IFZ2G/5UKWC2Uo7tJ4SxGed2+aiA+sJyWeWsGTogKVDhq90oxVBToh+uCDeI31HNUpqYGoWmkletfty42zUd8A== - dependencies: - uid "2.0.1" - iterare "1.2.1" - tslib "2.5.0" - -"@nestjs/core@9.3.11": - version "9.3.11" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.11.tgz#1be65db0e889f8f12b87aec12c9cf66ea6043205" - integrity sha512-CI27a2JFd5rvvbgkalWqsiwQNhcP4EAG5BUK8usjp29wVp1kx30ghfBT8FLqIgmkRVo65A0IcEnWsxeXMntkxQ== - dependencies: - uid "2.0.1" - "@nuxtjs/opencollective" "0.3.2" - fast-safe-stringify "2.1.1" - iterare "1.2.1" - path-to-regexp "3.2.0" - tslib "2.5.0" - "@next/env@14.0.4": version "14.0.4" resolved "https://registry.yarnpkg.com/@next/env/-/env-14.0.4.tgz#d5cda0c4a862d70ae760e58c0cd96a8899a2e49a" @@ -1302,37 +1261,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nuxtjs/opencollective@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz#620ce1044f7ac77185e825e1936115bb38e2681c" - integrity sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA== - dependencies: - chalk "^4.1.0" - consola "^2.15.0" - node-fetch "^2.6.1" - -"@openapitools/openapi-generator-cli@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.7.0.tgz#5e8001a01b088bbb65ee7aa85cb73cdf88a0363e" - integrity sha512-ieEpHTA/KsDz7ANw03lLPYyjdedDEXYEyYoGBRWdduqXWSX65CJtttjqa8ZaB1mNmIjMtchUHwAYQmTLVQ8HYg== - dependencies: - "@nestjs/axios" "0.1.0" - "@nestjs/common" "9.3.11" - "@nestjs/core" "9.3.11" - "@nuxtjs/opencollective" "0.3.2" - chalk "4.1.2" - commander "8.3.0" - compare-versions "4.1.4" - concurrently "6.5.1" - console.table "0.10.0" - fs-extra "10.1.0" - glob "7.1.6" - inquirer "8.2.5" - lodash "4.17.21" - reflect-metadata "0.1.13" - rxjs "7.8.0" - tslib "2.0.3" - "@popperjs/core@^2.9.3": version "2.11.8" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" @@ -1543,7 +1471,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/json-schema@^7.0.6": +"@types/json-schema@^7.0.15": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -1746,13 +1674,6 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -1765,7 +1686,7 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -1932,14 +1853,6 @@ axe-core@=4.7.0: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.0.tgz#34ba5a48a8b564f67e103f0aa5768d76e15bbbbf" integrity sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ== -axios@0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - axios@^1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" @@ -1985,15 +1898,6 @@ binary-extensions@^2.0.0: resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" @@ -2026,14 +1930,6 @@ browserslist@^4.21.5: node-releases "^2.0.12" update-browserslist-db "^1.0.11" -buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^6.0.3: version "6.0.3" resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" @@ -2066,11 +1962,6 @@ call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: get-intrinsic "^1.2.1" set-function-length "^1.1.1" -call-me-maybe@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" - integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2106,14 +1997,6 @@ chalk@3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -2123,16 +2006,19 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + character-entities@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - "chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" @@ -2158,42 +2044,11 @@ classnames@^2.2.3: resolved "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz" integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw== -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-spinners@^2.5.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.0.tgz#5881d0ad96381e117bbe07ad91f2008fe6ffd8db" - integrity sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g== - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - client-only@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz" integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== - color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -2235,15 +2090,10 @@ comma-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== -commander@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - -commander@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" - integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ== +commander@^12.0.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== commander@^4.0.0: version "4.1.1" @@ -2255,11 +2105,6 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== -compare-versions@4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-4.1.4.tgz#3571f4d610924d4414846a4183d386c8f3d51112" - integrity sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw== - component-emitter@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -2275,32 +2120,6 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concurrently@6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-6.5.1.tgz#4518c67f7ac680cf5c34d5adf399a2a2047edc8c" - integrity sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag== - dependencies: - chalk "^4.1.0" - date-fns "^2.16.1" - lodash "^4.17.21" - rxjs "^6.6.3" - spawn-command "^0.0.2-1" - supports-color "^8.1.0" - tree-kill "^1.2.2" - yargs "^16.2.0" - -consola@^2.15.0: - version "2.15.3" - resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550" - integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw== - -console.table@0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/console.table/-/console.table-0.10.0.tgz#0917025588875befd70cf2eff4bef2c6e2d75d04" - integrity sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g== - dependencies: - easy-table "1.1.0" - convert-source-map@^1.5.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" @@ -2365,13 +2184,6 @@ damerau-levenshtein@^1.0.8: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -date-fns@^2.16.1: - version "2.30.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" - integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== - dependencies: - "@babel/runtime" "^7.21.0" - debug@4, debug@^4.0.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" @@ -2398,13 +2210,6 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -defaults@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" - integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== - dependencies: - clone "^1.0.2" - define-data-property@^1.0.1, define-data-property@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" @@ -2492,23 +2297,11 @@ dom-helpers@^5.0.1: "@babel/runtime" "^7.8.7" csstype "^3.0.2" -easy-table@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/easy-table/-/easy-table-1.1.0.tgz#86f9ab4c102f0371b7297b92a651d5824bc8cb73" - integrity sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA== - optionalDependencies: - wcwidth ">=1.0.1" - electron-to-chromium@^1.4.431: version "1.4.455" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.455.tgz" integrity sha512-8tgdX0Odl24LtmLwxotpJCVjIndN559AvaOtd67u+2mo+IDsgsTF580NB+uuDCqsHw8yFg53l5+imFV9Fw3cbA== -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - emoji-regex@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" @@ -2862,15 +2655,6 @@ extend@^3.0.0: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2908,7 +2692,7 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== -fast-safe-stringify@2.1.1, fast-safe-stringify@^2.1.1: +fast-safe-stringify@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== @@ -2920,13 +2704,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -2975,7 +2752,7 @@ focus-lock@^1.0.0: dependencies: tslib "^2.0.3" -follow-redirects@^1.14.9, follow-redirects@^1.15.0: +follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== @@ -3032,16 +2809,7 @@ framesync@6.1.2: dependencies: tslib "2.4.0" -fs-extra@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-extra@^11.1.1: +fs-extra@^11.2.0: version "11.2.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== @@ -3090,11 +2858,6 @@ get-browser-rtc@^1.1.0: resolved "https://registry.npmjs.org/get-browser-rtc/-/get-browser-rtc-1.1.0.tgz" integrity sha512-MghbMJ61EJrRsDe7w1Bvqt3ZsBuqhce5nrn/XAwgwOXhcsz53/ltdxOse1h/8eKXj5slzxdsz56g5rzOFSGwfQ== -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - get-intrinsic@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" @@ -3244,7 +3007,7 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -handlebars@^4.7.7: +handlebars@^4.7.8: version "4.7.8" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== @@ -3356,13 +3119,6 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" @@ -3370,7 +3126,7 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -ieee754@^1.1.13, ieee754@^1.2.1: +ieee754@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -3411,7 +3167,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@^2.0.4: +inherits@2, inherits@^2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3421,27 +3177,6 @@ inline-style-parser@0.1.1: resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== -inquirer@8.2.5: - version "8.2.5" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.5.tgz#d8654a7542c35a9b9e069d27e2df4858784d54f8" - integrity sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^7.0.0" - internal-slot@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.6.tgz#37e756098c4911c5e912b8edbf71ed3aa116f930" @@ -3532,11 +3267,6 @@ is-finalizationregistry@^1.0.2: dependencies: call-bind "^1.0.2" -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - is-generator-function@^1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" @@ -3551,11 +3281,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - is-map@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" @@ -3636,11 +3361,6 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: dependencies: which-typed-array "^1.1.11" -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - is-weakmap@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" @@ -3671,11 +3391,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -iterare@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/iterare/-/iterare-1.2.1.tgz#139c400ff7363690e33abffa33cbba8920f00042" - integrity sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q== - iterator.prototype@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.2.tgz#5e29c8924f01916cb9335f1ff80619dcff22b0c0" @@ -3741,13 +3456,6 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json-schema-ref-parser@^9.0.9: - version "9.0.9" - resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#66ea538e7450b12af342fa3d5b8458bc1e1e013f" - integrity sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q== - dependencies: - "@apidevtools/json-schema-ref-parser" "9.0.9" - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3852,19 +3560,6 @@ lodash.mergewith@4.6.2: resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== -lodash@4.17.21, lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" @@ -4164,11 +3859,6 @@ mime@2.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - minimatch@9.0.3: version "9.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" @@ -4212,11 +3902,6 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - mz@^2.7.0: version "2.7.0" resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" @@ -4265,7 +3950,7 @@ next@^14.0.4: "@next/swc-win32-ia32-msvc" "14.0.4" "@next/swc-win32-x64-msvc" "14.0.4" -node-fetch@^2.6.1, node-fetch@^2.6.7: +node-fetch@^2.6.7: version "2.6.12" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== @@ -4374,23 +4059,16 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -openapi-typescript-codegen@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/openapi-typescript-codegen/-/openapi-typescript-codegen-0.25.0.tgz#0cb028f54b33b0a63bd9da3756c1c41b4e1a70e2" - integrity sha512-nN/TnIcGbP58qYgwEEy5FrAAjePcYgfMaCe3tsmYyTgI3v4RR9v8os14L+LEWDvV50+CmqiyTzRkKKtJeb6Ybg== +openapi-typescript-codegen@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/openapi-typescript-codegen/-/openapi-typescript-codegen-0.29.0.tgz#e98a1daa223ccdeb1cc51b2e2dc11bafae6fe746" + integrity sha512-/wC42PkD0LGjDTEULa/XiWQbv4E9NwLjwLjsaJ/62yOsoYhwvmBR31kPttn1DzQ2OlGe5stACcF/EIkZk43M6w== dependencies: + "@apidevtools/json-schema-ref-parser" "^11.5.4" camelcase "^6.3.0" - commander "^11.0.0" - fs-extra "^11.1.1" - handlebars "^4.7.7" - json-schema-ref-parser "^9.0.9" + commander "^12.0.0" + fs-extra "^11.2.0" + handlebars "^4.7.8" optionator@^0.9.3: version "0.9.3" @@ -4404,26 +4082,6 @@ optionator@^0.9.3: prelude-ls "^1.2.1" type-check "^0.4.0" -ora@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -4475,11 +4133,6 @@ path-parse@^1.0.7: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-3.2.0.tgz#fa7877ecbc495c601907562222453c43cc204a5f" - integrity sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA== - path-to-regexp@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz#d54934d6798eb9e5ef14e7af7962c945906918e5" @@ -4781,7 +4434,7 @@ read-cache@^1.0.0: dependencies: pify "^2.3.0" -readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@^3.6.0: version "3.6.2" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -4797,11 +4450,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -reflect-metadata@0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" - integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== - reflect.getprototypeof@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz#aaccbf41aca3821b87bb71d9dcbc7ad0ba50a3f3" @@ -4849,11 +4497,6 @@ remark-rehype@^11.0.0: unified "^11.0.0" vfile "^6.0.0" -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -4882,14 +4525,6 @@ resolve@^2.0.0-next.4: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - reusify@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" @@ -4909,11 +4544,6 @@ rollup@2.78.0: optionalDependencies: fsevents "~2.3.2" -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" @@ -4921,27 +4551,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@7.8.0: - version "7.8.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" - integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== - dependencies: - tslib "^2.1.0" - -rxjs@^6.6.3: - version "6.6.7" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" - integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== - dependencies: - tslib "^1.9.0" - -rxjs@^7.5.5: - version "7.8.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== - dependencies: - tslib "^2.1.0" - safe-array-concat@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" @@ -4966,7 +4575,7 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": +"safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -5039,11 +4648,6 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - simple-peer@^9.11.1: version "9.11.1" resolved "https://registry.npmjs.org/simple-peer/-/simple-peer-9.11.1.tgz" @@ -5082,11 +4686,6 @@ space-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== - stacktrace-parser@^0.1.10: version "0.1.10" resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" @@ -5099,15 +4698,6 @@ streamsearch@^1.1.0: resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string.prototype.matchall@^4.0.8: version "4.0.10" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz#a1553eb532221d4180c51581d6072cd65d1ee100" @@ -5157,7 +4747,7 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -5236,7 +4826,7 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0, supports-color@^8.1.0: +supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -5306,23 +4896,11 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - tiny-invariant@^1.0.6: version "1.3.1" resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.1.tgz#8560808c916ef02ecfd55e66090df23a4b7aa642" integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw== -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -5345,11 +4923,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - trim-lines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" @@ -5380,26 +4953,11 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" - integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== - tslib@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== -tslib@2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - tslib@^2.0.0, tslib@^2.0.3: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" @@ -5427,11 +4985,6 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - type-fest@^0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" @@ -5486,13 +5039,6 @@ uglify-js@^3.1.4: resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== -uid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uid/-/uid-2.0.1.tgz#a3f57c962828ea65256cd622fc363028cdf4526b" - integrity sha512-PF+1AnZgycpAIEmNtjxGBVmKbZAQguaa4pBUq6KNaGEcpzZ2klCNZLM34tsjp76maN00TttiiUf6zkIBpJQm2A== - dependencies: - "@lukeed/csprng" "^1.0.0" - unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -5629,13 +5175,6 @@ wavesurfer.js@^7.4.2: resolved "https://registry.yarnpkg.com/wavesurfer.js/-/wavesurfer.js-7.4.2.tgz#59f5c87193d4eeeb199858688ddac1ad7ba86b3a" integrity sha512-4pNQ1porOCUBYBmd2F1TqVuBnB2wBPipaw2qI920zYLuPnada0Rd1CURgh8HRuPGKxijj2iyZDFN2UZwsaEuhA== -wcwidth@>=1.0.1, wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== - dependencies: - defaults "^1.0.3" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -5716,25 +5255,11 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" @@ -5750,24 +5275,6 @@ yaml@^2.1.1: resolved "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz" integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From ef531f64919768386fcc3e2e0fcebdcd64c579e4 Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Wed, 3 Jul 2024 15:08:54 +0200 Subject: [PATCH 2/5] Migrate to openapi-ts generator --- .../[transcriptId]/correct/page.tsx | 2 +- .../correct/participantList.tsx | 60 +- .../[transcriptId]/finalSummary.tsx | 4 +- .../[domain]/transcripts/createTranscript.ts | 2 +- .../[domain]/transcripts/fileUploadButton.tsx | 5 +- .../[domain]/transcripts/shareAndPrivacy.tsx | 6 +- .../[domain]/transcripts/transcriptTitle.tsx | 4 +- .../[domain]/transcripts/useParticipants.ts | 2 +- .../[domain]/transcripts/useTopicWithWords.ts | 2 +- www/app/[domain]/transcripts/useTopics.ts | 2 +- www/app/[domain]/transcripts/useTranscript.ts | 2 +- .../[domain]/transcripts/useTranscriptList.ts | 2 +- www/app/[domain]/transcripts/useWaveform.ts | 2 +- www/app/[domain]/transcripts/useWebRTC.ts | 2 +- www/app/[domain]/transcripts/useWebSockets.ts | 2 +- www/app/api/.openapi-generator-ignore | 23 - www/app/api/.openapi-generator/FILES | 28 - www/app/api/.openapi-generator/VERSION | 1 - www/app/api/OpenApi.ts | 14 +- www/app/api/core/ApiError.ts | 6 +- www/app/api/core/ApiRequestOptions.ts | 14 +- www/app/api/core/ApiResult.ts | 10 +- ...etchHttpRequest.ts => AxiosHttpRequest.ts} | 6 +- www/app/api/core/BaseHttpRequest.ts | 4 - www/app/api/core/CancelablePromise.ts | 14 +- www/app/api/core/OpenAPI.ts | 44 +- www/app/api/core/request.ts | 169 +++--- www/app/api/core/types.ts | 14 + www/app/api/index.ts | 29 +- www/app/api/models/AudioWaveform.ts | 4 - ...ipts__transcript_id__record_upload_post.ts | 4 - www/app/api/models/CreateParticipant.ts | 4 - www/app/api/models/CreateTranscript.ts | 4 - www/app/api/models/DeletionStatus.ts | 4 - www/app/api/models/GetTranscript.ts | 5 +- .../api/models/GetTranscriptSegmentTopic.ts | 4 - www/app/api/models/GetTranscriptTopic.ts | 5 +- .../api/models/GetTranscriptTopicWithWords.ts | 5 +- .../GetTranscriptTopicWithWordsPerSpeaker.ts | 5 +- www/app/api/models/HTTPValidationError.ts | 5 +- www/app/api/models/Page_GetTranscript_.ts | 5 +- www/app/api/models/Participant.ts | 4 - www/app/api/models/RtcOffer.ts | 4 - www/app/api/models/SpeakerAssignment.ts | 4 - www/app/api/models/SpeakerAssignmentStatus.ts | 4 - www/app/api/models/SpeakerMerge.ts | 4 - www/app/api/models/SpeakerWords.ts | 5 +- www/app/api/models/TranscriptParticipant.ts | 4 - www/app/api/models/UpdateParticipant.ts | 4 - www/app/api/models/UpdateTranscript.ts | 5 +- www/app/api/models/UserInfo.ts | 4 - www/app/api/models/ValidationError.ts | 4 - www/app/api/models/Word.ts | 4 - www/app/api/runtime.ts | 520 ------------------ www/app/api/schemas/$AudioWaveform.ts | 11 + ...ipts__transcript_id__record_upload_post.ts | 10 + www/app/api/schemas/$CreateParticipant.ts | 19 + www/app/api/schemas/$CreateTranscript.ts | 14 + www/app/api/schemas/$DeletionStatus.ts | 8 + www/app/api/schemas/$GetTranscript.ts | 123 +++++ .../api/schemas/$GetTranscriptSegmentTopic.ts | 16 + www/app/api/schemas/$GetTranscriptTopic.ts | 42 ++ .../schemas/$GetTranscriptTopicWithWords.ts | 48 ++ .../$GetTranscriptTopicWithWordsPerSpeaker.ts | 48 ++ www/app/api/schemas/$HTTPValidationError.ts | 10 + www/app/api/schemas/$Page_GetTranscript_.ts | 52 ++ www/app/api/schemas/$Participant.ts | 24 + www/app/api/schemas/$RtcOffer.ts | 12 + www/app/api/schemas/$SpeakerAssignment.ts | 34 ++ .../api/schemas/$SpeakerAssignmentStatus.ts | 8 + www/app/api/schemas/$SpeakerMerge.ts | 12 + www/app/api/schemas/$SpeakerWords.ts | 15 + www/app/api/schemas/$TranscriptParticipant.ts | 23 + www/app/api/schemas/$UpdateParticipant.ts | 26 + www/app/api/schemas/$UpdateTranscript.ts | 95 ++++ www/app/api/schemas/$UserInfo.ts | 32 ++ www/app/api/schemas/$ValidationError.ts | 27 + www/app/api/schemas/$Word.ts | 19 + www/app/api/services/DefaultService.ts | 258 ++++++--- www/package.json | 4 +- www/yarn.lock | 72 +-- 81 files changed, 1157 insertions(+), 1004 deletions(-) delete mode 100644 www/app/api/.openapi-generator-ignore delete mode 100644 www/app/api/.openapi-generator/FILES delete mode 100644 www/app/api/.openapi-generator/VERSION rename www/app/api/core/{FetchHttpRequest.ts => AxiosHttpRequest.ts} (76%) create mode 100644 www/app/api/core/types.ts delete mode 100644 www/app/api/runtime.ts create mode 100644 www/app/api/schemas/$AudioWaveform.ts create mode 100644 www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts create mode 100644 www/app/api/schemas/$CreateParticipant.ts create mode 100644 www/app/api/schemas/$CreateTranscript.ts create mode 100644 www/app/api/schemas/$DeletionStatus.ts create mode 100644 www/app/api/schemas/$GetTranscript.ts create mode 100644 www/app/api/schemas/$GetTranscriptSegmentTopic.ts create mode 100644 www/app/api/schemas/$GetTranscriptTopic.ts create mode 100644 www/app/api/schemas/$GetTranscriptTopicWithWords.ts create mode 100644 www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts create mode 100644 www/app/api/schemas/$HTTPValidationError.ts create mode 100644 www/app/api/schemas/$Page_GetTranscript_.ts create mode 100644 www/app/api/schemas/$Participant.ts create mode 100644 www/app/api/schemas/$RtcOffer.ts create mode 100644 www/app/api/schemas/$SpeakerAssignment.ts create mode 100644 www/app/api/schemas/$SpeakerAssignmentStatus.ts create mode 100644 www/app/api/schemas/$SpeakerMerge.ts create mode 100644 www/app/api/schemas/$SpeakerWords.ts create mode 100644 www/app/api/schemas/$TranscriptParticipant.ts create mode 100644 www/app/api/schemas/$UpdateParticipant.ts create mode 100644 www/app/api/schemas/$UpdateTranscript.ts create mode 100644 www/app/api/schemas/$UserInfo.ts create mode 100644 www/app/api/schemas/$ValidationError.ts create mode 100644 www/app/api/schemas/$Word.ts diff --git a/www/app/[domain]/transcripts/[transcriptId]/correct/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/correct/page.tsx index aab003f1..9eff7b60 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/correct/page.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/correct/page.tsx @@ -37,7 +37,7 @@ export default function TranscriptCorrect({ const markAsDone = () => { if (transcript.response && !transcript.response.reviewed) { api - ?.v1TranscriptUpdate(transcriptId, { reviewed: true }) + ?.v1TranscriptUpdate({ transcriptId, requestBody: { reviewed: true } }) .then(() => { router.push(`/transcripts/${transcriptId}`); }) diff --git a/www/app/[domain]/transcripts/[transcriptId]/correct/participantList.tsx b/www/app/[domain]/transcripts/[transcriptId]/correct/participantList.tsx index 9a00b61a..93979c53 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/correct/participantList.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/correct/participantList.tsx @@ -123,10 +123,13 @@ const ParticipantList = ({ setLoading(true); try { - await api?.v1TranscriptAssignSpeaker(transcriptId, { - participant: participant.id, - timestamp_from: selectedText.start, - timestamp_to: selectedText.end, + await api?.v1TranscriptAssignSpeaker({ + transcriptId, + requestBody: { + participant: participant.id, + timestamp_from: selectedText.start, + timestamp_to: selectedText.end, + }, }); onSuccess(); } catch (error) { @@ -142,9 +145,12 @@ const ParticipantList = ({ setLoading(true); if (participantTo.speaker) { try { - await api?.v1TranscriptMergeSpeaker(transcriptId, { - speaker_from: speakerFrom, - speaker_to: participantTo.speaker, + await api?.v1TranscriptMergeSpeaker({ + transcriptId, + requestBody: { + speaker_from: speakerFrom, + speaker_to: participantTo.speaker, + }, }); onSuccess(); } catch (error) { @@ -153,11 +159,11 @@ const ParticipantList = ({ } } else { try { - await api?.v1TranscriptUpdateParticipant( + await api?.v1TranscriptUpdateParticipant({ transcriptId, - participantTo.id, - { speaker: speakerFrom }, - ); + participantId: participantTo.id, + requestBody: { speaker: speakerFrom }, + }); onSuccess(); } catch (error) { setError(error, "There was an error merging (update)"); @@ -183,8 +189,12 @@ const ParticipantList = ({ if (participant && participant.name !== participantInput) { setLoading(true); api - ?.v1TranscriptUpdateParticipant(transcriptId, participant.id, { - name: participantInput, + ?.v1TranscriptUpdateParticipant({ + transcriptId, + participantId: participant.id, + requestBody: { + name: participantInput, + }, }) .then(() => { participants.refetch(); @@ -202,9 +212,12 @@ const ParticipantList = ({ ) { setLoading(true); api - ?.v1TranscriptAddParticipant(transcriptId, { - name: participantInput, - speaker: selectedText, + ?.v1TranscriptAddParticipant({ + transcriptId, + requestBody: { + name: participantInput, + speaker: selectedText, + }, }) .then(() => { participants.refetch(); @@ -222,12 +235,12 @@ const ParticipantList = ({ ) { setLoading(true); try { - const participant = await api?.v1TranscriptAddParticipant( + const participant = await api?.v1TranscriptAddParticipant({ transcriptId, - { + requestBody: { name: participantInput, }, - ); + }); setLoading(false); assignTo(participant)().catch(() => { // error and loading are handled by assignTo catch @@ -240,8 +253,11 @@ const ParticipantList = ({ } else if (action == "Create") { setLoading(true); api - ?.v1TranscriptAddParticipant(transcriptId, { - name: participantInput, + ?.v1TranscriptAddParticipant({ + transcriptId, + requestBody: { + name: participantInput, + }, }) .then(() => { participants.refetch(); @@ -261,7 +277,7 @@ const ParticipantList = ({ if (loading || participants.loading || topicWithWords.loading) return; setLoading(true); api - ?.v1TranscriptDeleteParticipant(transcriptId, participantId) + ?.v1TranscriptDeleteParticipant({ transcriptId, participantId }) .then(() => { participants.refetch(); setLoading(false); diff --git a/www/app/[domain]/transcripts/[transcriptId]/finalSummary.tsx b/www/app/[domain]/transcripts/[transcriptId]/finalSummary.tsx index afde0aac..00f5dec7 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/finalSummary.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/finalSummary.tsx @@ -49,10 +49,10 @@ export default function FinalSummary(props: FinalSummaryProps) { const requestBody: UpdateTranscript = { long_summary: newSummary, }; - const updatedTranscript = await api?.v1TranscriptUpdate( + const updatedTranscript = await api?.v1TranscriptUpdate({ transcriptId, requestBody, - ); + }); console.log("Updated long summary:", updatedTranscript); } catch (err) { console.error("Failed to update long summary:", err); diff --git a/www/app/[domain]/transcripts/createTranscript.ts b/www/app/[domain]/transcripts/createTranscript.ts index cf68498c..015c82de 100644 --- a/www/app/[domain]/transcripts/createTranscript.ts +++ b/www/app/[domain]/transcripts/createTranscript.ts @@ -24,7 +24,7 @@ const useCreateTranscript = (): UseCreateTranscript => { setLoading(true); api - .v1TranscriptsCreate(transcriptCreationDetails) + .v1TranscriptsCreate({ requestBody: transcriptCreationDetails }) .then((transcript) => { setTranscript(transcript); setLoading(false); diff --git a/www/app/[domain]/transcripts/fileUploadButton.tsx b/www/app/[domain]/transcripts/fileUploadButton.tsx index 2e25398d..419245e2 100644 --- a/www/app/[domain]/transcripts/fileUploadButton.tsx +++ b/www/app/[domain]/transcripts/fileUploadButton.tsx @@ -27,7 +27,10 @@ export default function FileUploadButton(props: FileUploadButton) { // Add other properties if required by the type definition }; - api?.v1TranscriptRecordUpload(props.transcriptId, uploadData); + api?.v1TranscriptRecordUpload({ + transcriptId: props.transcriptId, + formData: uploadData, + }); } }; diff --git a/www/app/[domain]/transcripts/shareAndPrivacy.tsx b/www/app/[domain]/transcripts/shareAndPrivacy.tsx index 88ef661e..5bf53c3b 100644 --- a/www/app/[domain]/transcripts/shareAndPrivacy.tsx +++ b/www/app/[domain]/transcripts/shareAndPrivacy.tsx @@ -57,10 +57,10 @@ export default function ShareAndPrivacy(props: ShareAndPrivacyProps) { share_mode: toShareMode(selectedShareMode.value), }; - const updatedTranscript = await api.v1TranscriptUpdate( - props.transcriptResponse.id, + const updatedTranscript = await api.v1TranscriptUpdate({ + transcriptId: props.transcriptResponse.id, requestBody, - ); + }); setShareMode( shareOptions.find( (option) => option.value === updatedTranscript.share_mode, diff --git a/www/app/[domain]/transcripts/transcriptTitle.tsx b/www/app/[domain]/transcripts/transcriptTitle.tsx index 14ce7c97..5e103924 100644 --- a/www/app/[domain]/transcripts/transcriptTitle.tsx +++ b/www/app/[domain]/transcripts/transcriptTitle.tsx @@ -21,10 +21,10 @@ const TranscriptTitle = (props: TranscriptTitle) => { const requestBody: UpdateTranscript = { title: newTitle, }; - const updatedTranscript = await api?.v1TranscriptUpdate( + const updatedTranscript = await api?.v1TranscriptUpdate({ transcriptId, requestBody, - ); + }); console.log("Updated transcript:", updatedTranscript); } catch (err) { console.error("Failed to update transcript:", err); diff --git a/www/app/[domain]/transcripts/useParticipants.ts b/www/app/[domain]/transcripts/useParticipants.ts index d1a4b3e1..38f5aa35 100644 --- a/www/app/[domain]/transcripts/useParticipants.ts +++ b/www/app/[domain]/transcripts/useParticipants.ts @@ -49,7 +49,7 @@ const useParticipants = (transcriptId: string): UseParticipants => { setLoading(true); api - .v1TranscriptGetParticipants(transcriptId) + .v1TranscriptGetParticipants({ transcriptId }) .then((result) => { setResponse(result); setLoading(false); diff --git a/www/app/[domain]/transcripts/useTopicWithWords.ts b/www/app/[domain]/transcripts/useTopicWithWords.ts index eed618e4..29d0b982 100644 --- a/www/app/[domain]/transcripts/useTopicWithWords.ts +++ b/www/app/[domain]/transcripts/useTopicWithWords.ts @@ -56,7 +56,7 @@ const useTopicWithWords = ( setLoading(true); api - .v1TranscriptGetTopicsWithWordsPerSpeaker(transcriptId, topicId) + .v1TranscriptGetTopicsWithWordsPerSpeaker({ transcriptId, topicId }) .then((result) => { setResponse(result); setLoading(false); diff --git a/www/app/[domain]/transcripts/useTopics.ts b/www/app/[domain]/transcripts/useTopics.ts index 75864107..d0b0aaf4 100644 --- a/www/app/[domain]/transcripts/useTopics.ts +++ b/www/app/[domain]/transcripts/useTopics.ts @@ -23,7 +23,7 @@ const useTopics = (id: string): TranscriptTopics => { setLoading(true); api - .v1TranscriptGetTopics(id) + .v1TranscriptGetTopics({ transcriptId: id }) .then((result) => { setTopics(result); setLoading(false); diff --git a/www/app/[domain]/transcripts/useTranscript.ts b/www/app/[domain]/transcripts/useTranscript.ts index 5a8836ce..1e2d7ed0 100644 --- a/www/app/[domain]/transcripts/useTranscript.ts +++ b/www/app/[domain]/transcripts/useTranscript.ts @@ -37,7 +37,7 @@ const useTranscript = ( setLoading(true); api - .v1TranscriptGet(id) + .v1TranscriptGet({ transcriptId: id }) .then((result) => { setResponse(result); setLoading(false); diff --git a/www/app/[domain]/transcripts/useTranscriptList.ts b/www/app/[domain]/transcripts/useTranscriptList.ts index 1e55cf7a..378b3036 100644 --- a/www/app/[domain]/transcripts/useTranscriptList.ts +++ b/www/app/[domain]/transcripts/useTranscriptList.ts @@ -28,7 +28,7 @@ const useTranscriptList = (page: number): TranscriptList => { if (!api) return; setLoading(true); api - .v1TranscriptsList(page) + .v1TranscriptsList({ page }) .then((response) => { setResponse(response); setLoading(false); diff --git a/www/app/[domain]/transcripts/useWaveform.ts b/www/app/[domain]/transcripts/useWaveform.ts index 19291c93..3fbf2187 100644 --- a/www/app/[domain]/transcripts/useWaveform.ts +++ b/www/app/[domain]/transcripts/useWaveform.ts @@ -21,7 +21,7 @@ const useWaveform = (id: string): AudioWaveFormResponse => { if (!id || !api) return; setLoading(true); api - .v1TranscriptGetAudioWaveform(id) + .v1TranscriptGetAudioWaveform({ transcriptId: id }) .then((result) => { setWaveform(result); setLoading(false); diff --git a/www/app/[domain]/transcripts/useWebRTC.ts b/www/app/[domain]/transcripts/useWebRTC.ts index a51b1c6f..9b4d57a0 100644 --- a/www/app/[domain]/transcripts/useWebRTC.ts +++ b/www/app/[domain]/transcripts/useWebRTC.ts @@ -41,7 +41,7 @@ const useWebRTC = ( }; api - .v1TranscriptRecordWebrtc(transcriptId, rtcOffer) + .v1TranscriptRecordWebrtc({ transcriptId, requestBody: rtcOffer }) .then((answer) => { try { p.signal(answer); diff --git a/www/app/[domain]/transcripts/useWebSockets.ts b/www/app/[domain]/transcripts/useWebSockets.ts index 94b988e9..4a7d1b38 100644 --- a/www/app/[domain]/transcripts/useWebSockets.ts +++ b/www/app/[domain]/transcripts/useWebSockets.ts @@ -316,7 +316,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => { if (!transcriptId || !api) return; - api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => {}); + api?.v1TranscriptGetWebsocketEvents({ transcriptId }).then((result) => {}); const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`; let ws = new WebSocket(url); diff --git a/www/app/api/.openapi-generator-ignore b/www/app/api/.openapi-generator-ignore deleted file mode 100644 index 7484ee59..00000000 --- a/www/app/api/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/www/app/api/.openapi-generator/FILES b/www/app/api/.openapi-generator/FILES deleted file mode 100644 index 0ba155bf..00000000 --- a/www/app/api/.openapi-generator/FILES +++ /dev/null @@ -1,28 +0,0 @@ -apis/DefaultApi.ts -apis/index.ts -index.ts -models/AudioWaveform.ts -models/CreateParticipant.ts -models/CreateTranscript.ts -models/DeletionStatus.ts -models/GetTranscript.ts -models/GetTranscriptSegmentTopic.ts -models/GetTranscriptTopic.ts -models/GetTranscriptTopicWithWords.ts -models/GetTranscriptTopicWithWordsPerSpeaker.ts -models/HTTPValidationError.ts -models/PageGetTranscript.ts -models/Participant.ts -models/RtcOffer.ts -models/SpeakerAssignment.ts -models/SpeakerAssignmentStatus.ts -models/SpeakerMerge.ts -models/SpeakerWords.ts -models/TranscriptParticipant.ts -models/UpdateParticipant.ts -models/UpdateTranscript.ts -models/UserInfo.ts -models/ValidationError.ts -models/Word.ts -models/index.ts -runtime.ts diff --git a/www/app/api/.openapi-generator/VERSION b/www/app/api/.openapi-generator/VERSION deleted file mode 100644 index cd802a1e..00000000 --- a/www/app/api/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.6.0 \ No newline at end of file diff --git a/www/app/api/OpenApi.ts b/www/app/api/OpenApi.ts index a66a8146..19cbbf31 100644 --- a/www/app/api/OpenApi.ts +++ b/www/app/api/OpenApi.ts @@ -1,18 +1,19 @@ -/* generated using openapi-typescript-codegen -- do not 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 { AxiosHttpRequest } from "./core/AxiosHttpRequest"; + 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, - HttpRequest: HttpRequestConstructor = FetchHttpRequest, + HttpRequest: HttpRequestConstructor = AxiosHttpRequest, ) { this.request = new HttpRequest({ BASE: config?.BASE ?? "", @@ -25,6 +26,7 @@ export class OpenApi { HEADERS: config?.HEADERS, ENCODE_PATH: config?.ENCODE_PATH, }); + this.default = new DefaultService(this.request); } } diff --git a/www/app/api/core/ApiError.ts b/www/app/api/core/ApiError.ts index 3335e5aa..1d07bb31 100644 --- a/www/app/api/core/ApiError.ts +++ b/www/app/api/core/ApiError.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ApiRequestOptions } from "./ApiRequestOptions"; import type { ApiResult } from "./ApiResult"; @@ -9,7 +5,7 @@ export class ApiError extends Error { public readonly url: string; public readonly status: number; public readonly statusText: string; - public readonly body: any; + public readonly body: unknown; public readonly request: ApiRequestOptions; constructor( diff --git a/www/app/api/core/ApiRequestOptions.ts b/www/app/api/core/ApiRequestOptions.ts index 13f2bdf6..28e1917c 100644 --- a/www/app/api/core/ApiRequestOptions.ts +++ b/www/app/api/core/ApiRequestOptions.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type ApiRequestOptions = { readonly method: | "GET" @@ -12,11 +8,11 @@ export type ApiRequestOptions = { | "HEAD" | "PATCH"; readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; + readonly path?: Record; + readonly cookies?: Record; + readonly headers?: Record; + readonly query?: Record; + readonly formData?: Record; readonly body?: any; readonly mediaType?: string; readonly responseHeader?: string; diff --git a/www/app/api/core/ApiResult.ts b/www/app/api/core/ApiResult.ts index 24c93fc1..05040ba8 100644 --- a/www/app/api/core/ApiResult.ts +++ b/www/app/api/core/ApiResult.ts @@ -1,11 +1,7 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; +export type ApiResult = { + readonly body: TData; readonly ok: boolean; readonly status: number; readonly statusText: string; - readonly body: any; + readonly url: string; }; diff --git a/www/app/api/core/FetchHttpRequest.ts b/www/app/api/core/AxiosHttpRequest.ts similarity index 76% rename from www/app/api/core/FetchHttpRequest.ts rename to www/app/api/core/AxiosHttpRequest.ts index 63da86ca..5cd27cda 100644 --- a/www/app/api/core/FetchHttpRequest.ts +++ b/www/app/api/core/AxiosHttpRequest.ts @@ -1,14 +1,10 @@ -/* generated using openapi-typescript-codegen -- do not 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 { +export class AxiosHttpRequest extends BaseHttpRequest { constructor(config: OpenAPIConfig) { super(config); } diff --git a/www/app/api/core/BaseHttpRequest.ts b/www/app/api/core/BaseHttpRequest.ts index 29c8c164..cf68a62a 100644 --- a/www/app/api/core/BaseHttpRequest.ts +++ b/www/app/api/core/BaseHttpRequest.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ApiRequestOptions } from "./ApiRequestOptions"; import type { CancelablePromise } from "./CancelablePromise"; import type { OpenAPIConfig } from "./OpenAPI"; diff --git a/www/app/api/core/CancelablePromise.ts b/www/app/api/core/CancelablePromise.ts index 442c2beb..b1ebd8ca 100644 --- a/www/app/api/core/CancelablePromise.ts +++ b/www/app/api/core/CancelablePromise.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export class CancelError extends Error { constructor(message: string) { super(message); @@ -28,12 +24,12 @@ export class CancelablePromise implements Promise { readonly #cancelHandlers: (() => void)[]; readonly #promise: Promise; #resolve?: (value: T | PromiseLike) => void; - #reject?: (reason?: any) => void; + #reject?: (reason?: unknown) => void; constructor( executor: ( resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, + reject: (reason?: unknown) => void, onCancel: OnCancel, ) => void, ) { @@ -53,7 +49,7 @@ export class CancelablePromise implements Promise { if (this.#resolve) this.#resolve(value); }; - const onReject = (reason?: any): void => { + const onReject = (reason?: unknown): void => { if (this.#isResolved || this.#isRejected || this.#isCancelled) { return; } @@ -90,13 +86,13 @@ export class CancelablePromise implements Promise { public then( onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null, ): Promise { return this.#promise.then(onFulfilled, onRejected); } public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null, ): Promise { return this.#promise.catch(onRejected); } diff --git a/www/app/api/core/OpenAPI.ts b/www/app/api/core/OpenAPI.ts index d8b7da6b..2749e631 100644 --- a/www/app/api/core/OpenAPI.ts +++ b/www/app/api/core/OpenAPI.ts @@ -1,32 +1,48 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ApiRequestOptions } from "./ApiRequestOptions"; +import type { TConfig, TResult } from "./types"; type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; export type OpenAPIConfig = { BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; CREDENTIALS: "include" | "omit" | "same-origin"; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + RESULT?: TResult; TOKEN?: string | Resolver | undefined; USERNAME?: string | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - HEADERS?: Headers | Resolver | undefined; - ENCODE_PATH?: ((path: string) => string) | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; }; export const OpenAPI: OpenAPIConfig = { BASE: "", - VERSION: "0.1.0", - WITH_CREDENTIALS: false, CREDENTIALS: "include", + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + RESULT: "body", TOKEN: undefined, USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, + VERSION: "0.1.0", + WITH_CREDENTIALS: false, +}; + +export const mergeOpenApiConfig = ( + config: OpenAPIConfig, + overrides: TConfig, +) => { + const merged = { ...config }; + Object.entries(overrides) + .filter(([key]) => key.startsWith("_")) + .forEach(([key, value]) => { + const k = key.slice(1).toLocaleUpperCase() as keyof typeof merged; + if (merged.hasOwnProperty(k)) { + // @ts-ignore + merged[k] = value; + } + }); + return merged; }; diff --git a/www/app/api/core/request.ts b/www/app/api/core/request.ts index ab66380a..c750d804 100644 --- a/www/app/api/core/request.ts +++ b/www/app/api/core/request.ts @@ -1,7 +1,12 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ +import axios from "axios"; +import type { + AxiosError, + AxiosRequestConfig, + AxiosResponse, + AxiosInstance, +} from "axios"; +import FormData from "form-data"; + import { ApiError } from "./ApiError"; import type { ApiRequestOptions } from "./ApiRequestOptions"; import type { ApiResult } from "./ApiResult"; @@ -9,22 +14,17 @@ import { CancelablePromise } from "./CancelablePromise"; import type { OnCancel } from "./CancelablePromise"; import type { OpenAPIConfig } from "./OpenAPI"; -export const isDefined = ( - value: T | null | undefined, -): value is Exclude => { - return value !== undefined && value !== null; -}; - -export const isString = (value: any): value is string => { +export const isString = (value: unknown): value is string => { return typeof value === "string"; }; -export const isStringWithValue = (value: any): value is string => { +export const isStringWithValue = (value: unknown): value is string => { return isString(value) && value !== ""; }; export const isBlob = (value: any): value is Blob => { return ( + value !== null && typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && @@ -32,14 +32,19 @@ export const isBlob = (value: any): value is Blob => { typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && + // @ts-ignore /^(Blob|File)$/.test(value[Symbol.toStringTag]) ); }; -export const isFormData = (value: any): value is FormData => { +export const isFormData = (value: unknown): value is FormData => { return value instanceof FormData; }; +export const isSuccess = (status: number): boolean => { + return status >= 200 && status < 300; +}; + export const base64 = (str: string): string => { try { return btoa(str); @@ -49,38 +54,30 @@ export const base64 = (str: string): string => { } }; -export const getQueryString = (params: Record): string => { +export const getQueryString = (params: Record): string => { const qs: string[] = []; - const append = (key: string, value: any) => { + const append = (key: string, value: unknown) => { 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); - } + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } + + if (Array.isArray(value)) { + value.forEach((v) => encodePair(key, v)); + } else if (typeof value === "object") { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); } }; - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - if (qs.length > 0) { - return `?${qs.join("&")}`; - } - - return ""; + return qs.length ? `?${qs.join("&")}` : ""; }; const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { @@ -95,11 +92,8 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { return substring; }); - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; }; export const getFormData = ( @@ -117,7 +111,7 @@ export const getFormData = ( }; Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) + .filter(([_, value]) => value !== undefined && value !== null) .forEach(([key, value]) => { if (Array.isArray(value)) { value.forEach((v) => process(key, v)); @@ -146,7 +140,8 @@ export const resolve = async ( export const getHeaders = async ( config: OpenAPIConfig, options: ApiRequestOptions, -): Promise => { + formData?: FormData, +): Promise> => { const [token, username, password, additionalHeaders] = await Promise.all([ resolve(options, config.TOKEN), resolve(options, config.USERNAME), @@ -154,12 +149,17 @@ export const getHeaders = async ( resolve(options, config.HEADERS), ]); + const formHeaders = + (typeof formData?.getHeaders === "function" && formData?.getHeaders()) || + {}; + const headers = Object.entries({ Accept: "application/json", ...additionalHeaders, ...options.headers, + ...formHeaders, }) - .filter(([_, value]) => isDefined(value)) + .filter(([_, value]) => value !== undefined && value !== null) .reduce( (headers, [key, value]) => ({ ...headers, @@ -189,59 +189,56 @@ export const getHeaders = async ( } } - return new Headers(headers); + return 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); - } +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + return options.body; } return undefined; }; -export const sendRequest = async ( +export const sendRequest = async ( config: OpenAPIConfig, options: ApiRequestOptions, url: string, - body: any, + body: unknown, formData: FormData | undefined, - headers: Headers, + headers: Record, onCancel: OnCancel, -): Promise => { + axiosClient: AxiosInstance, +): Promise> => { const controller = new AbortController(); - const request: RequestInit = { + const requestConfig: AxiosRequestConfig = { + url, headers, - body: body ?? formData, + data: body ?? formData, method: options.method, + withCredentials: config.WITH_CREDENTIALS, signal: controller.signal, }; - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - onCancel(() => controller.abort()); - return await fetch(url, request); + try { + return await axiosClient.request(requestConfig); + } catch (error) { + const axiosError = error as AxiosError; + if (axiosError.response) { + return axiosError.response; + } + throw error; + } }; export const getResponseHeader = ( - response: Response, + response: AxiosResponse, responseHeader?: string, ): string | undefined => { if (responseHeader) { - const content = response.headers.get(responseHeader); + const content = response.headers[responseHeader]; if (isString(content)) { return content; } @@ -249,24 +246,9 @@ export const getResponseHeader = ( return undefined; }; -export const getResponseBody = async (response: Response): Promise => { +export const getResponseBody = (response: AxiosResponse): unknown => { 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 response.data; } return undefined; }; @@ -314,22 +296,24 @@ export const catchErrorCodes = ( * Request method * @param config The OpenAPI configuration object * @param options The request options from the service + * @param axiosClient The axios client instance to use * @returns CancelablePromise * @throws ApiError */ export const request = ( config: OpenAPIConfig, options: ApiRequestOptions, + axiosClient: AxiosInstance = axios, ): CancelablePromise => { 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); + const headers = await getHeaders(config, options, formData); if (!onCancel.isCancelled) { - const response = await sendRequest( + const response = await sendRequest( config, options, url, @@ -337,8 +321,9 @@ export const request = ( formData, headers, onCancel, + axiosClient, ); - const responseBody = await getResponseBody(response); + const responseBody = getResponseBody(response); const responseHeader = getResponseHeader( response, options.responseHeader, @@ -346,7 +331,7 @@ export const request = ( const result: ApiResult = { url, - ok: response.ok, + ok: isSuccess(response.status), status: response.status, statusText: response.statusText, body: responseHeader ?? responseBody, diff --git a/www/app/api/core/types.ts b/www/app/api/core/types.ts new file mode 100644 index 00000000..8e915c44 --- /dev/null +++ b/www/app/api/core/types.ts @@ -0,0 +1,14 @@ +import type { ApiResult } from "./ApiResult"; + +export type TResult = "body" | "raw"; + +export type TApiResponse = Exclude< + T, + "raw" +> extends never + ? ApiResult + : ApiResult["body"]; + +export type TConfig = { + _result?: T; +}; diff --git a/www/app/api/index.ts b/www/app/api/index.ts index 6eed94cc..0d54a439 100644 --- a/www/app/api/index.ts +++ b/www/app/api/index.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export { OpenApi } from "./OpenApi"; export { ApiError } from "./core/ApiError"; @@ -35,4 +31,29 @@ export type { UserInfo } from "./models/UserInfo"; export type { ValidationError } from "./models/ValidationError"; export type { Word } from "./models/Word"; +export { $AudioWaveform } from "./schemas/$AudioWaveform"; +export { $Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post } from "./schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post"; +export { $CreateParticipant } from "./schemas/$CreateParticipant"; +export { $CreateTranscript } from "./schemas/$CreateTranscript"; +export { $DeletionStatus } from "./schemas/$DeletionStatus"; +export { $GetTranscript } from "./schemas/$GetTranscript"; +export { $GetTranscriptSegmentTopic } from "./schemas/$GetTranscriptSegmentTopic"; +export { $GetTranscriptTopic } from "./schemas/$GetTranscriptTopic"; +export { $GetTranscriptTopicWithWords } from "./schemas/$GetTranscriptTopicWithWords"; +export { $GetTranscriptTopicWithWordsPerSpeaker } from "./schemas/$GetTranscriptTopicWithWordsPerSpeaker"; +export { $HTTPValidationError } from "./schemas/$HTTPValidationError"; +export { $Page_GetTranscript_ } from "./schemas/$Page_GetTranscript_"; +export { $Participant } from "./schemas/$Participant"; +export { $RtcOffer } from "./schemas/$RtcOffer"; +export { $SpeakerAssignment } from "./schemas/$SpeakerAssignment"; +export { $SpeakerAssignmentStatus } from "./schemas/$SpeakerAssignmentStatus"; +export { $SpeakerMerge } from "./schemas/$SpeakerMerge"; +export { $SpeakerWords } from "./schemas/$SpeakerWords"; +export { $TranscriptParticipant } from "./schemas/$TranscriptParticipant"; +export { $UpdateParticipant } from "./schemas/$UpdateParticipant"; +export { $UpdateTranscript } from "./schemas/$UpdateTranscript"; +export { $UserInfo } from "./schemas/$UserInfo"; +export { $ValidationError } from "./schemas/$ValidationError"; +export { $Word } from "./schemas/$Word"; + export { DefaultService } from "./services/DefaultService"; diff --git a/www/app/api/models/AudioWaveform.ts b/www/app/api/models/AudioWaveform.ts index f48cc681..60dd57ec 100644 --- a/www/app/api/models/AudioWaveform.ts +++ b/www/app/api/models/AudioWaveform.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type AudioWaveform = { data: Array; }; diff --git a/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts b/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts index b89d4e7e..b313fa1b 100644 --- a/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts +++ b/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = { file: Blob; diff --git a/www/app/api/models/CreateParticipant.ts b/www/app/api/models/CreateParticipant.ts index bf1116b2..0d7f1950 100644 --- a/www/app/api/models/CreateParticipant.ts +++ b/www/app/api/models/CreateParticipant.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type CreateParticipant = { speaker?: number | null; name: string; diff --git a/www/app/api/models/CreateTranscript.ts b/www/app/api/models/CreateTranscript.ts index cf69f201..32fd6a1b 100644 --- a/www/app/api/models/CreateTranscript.ts +++ b/www/app/api/models/CreateTranscript.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type CreateTranscript = { name: string; source_language?: string; diff --git a/www/app/api/models/DeletionStatus.ts b/www/app/api/models/DeletionStatus.ts index 0a7a8373..9bd016e0 100644 --- a/www/app/api/models/DeletionStatus.ts +++ b/www/app/api/models/DeletionStatus.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type DeletionStatus = { status: string; }; diff --git a/www/app/api/models/GetTranscript.ts b/www/app/api/models/GetTranscript.ts index d5f76dce..b755d62a 100644 --- a/www/app/api/models/GetTranscript.ts +++ b/www/app/api/models/GetTranscript.ts @@ -1,8 +1,5 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { TranscriptParticipant } from "./TranscriptParticipant"; + export type GetTranscript = { id: string; user_id: string | null; diff --git a/www/app/api/models/GetTranscriptSegmentTopic.ts b/www/app/api/models/GetTranscriptSegmentTopic.ts index bb648d46..bba84fb7 100644 --- a/www/app/api/models/GetTranscriptSegmentTopic.ts +++ b/www/app/api/models/GetTranscriptSegmentTopic.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type GetTranscriptSegmentTopic = { text: string; start: number; diff --git a/www/app/api/models/GetTranscriptTopic.ts b/www/app/api/models/GetTranscriptTopic.ts index 14d63dc2..808c825a 100644 --- a/www/app/api/models/GetTranscriptTopic.ts +++ b/www/app/api/models/GetTranscriptTopic.ts @@ -1,8 +1,5 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; + export type GetTranscriptTopic = { id: string; title: string; diff --git a/www/app/api/models/GetTranscriptTopicWithWords.ts b/www/app/api/models/GetTranscriptTopicWithWords.ts index 49f242d6..ffc0cd5f 100644 --- a/www/app/api/models/GetTranscriptTopicWithWords.ts +++ b/www/app/api/models/GetTranscriptTopicWithWords.ts @@ -1,9 +1,6 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; import type { Word } from "./Word"; + export type GetTranscriptTopicWithWords = { id: string; title: string; diff --git a/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts b/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts index 99fb96e6..c77bfe9a 100644 --- a/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts +++ b/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts @@ -1,9 +1,6 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; import type { SpeakerWords } from "./SpeakerWords"; + export type GetTranscriptTopicWithWordsPerSpeaker = { id: string; title: string; diff --git a/www/app/api/models/HTTPValidationError.ts b/www/app/api/models/HTTPValidationError.ts index 11c031ec..e12e0ef9 100644 --- a/www/app/api/models/HTTPValidationError.ts +++ b/www/app/api/models/HTTPValidationError.ts @@ -1,8 +1,5 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ValidationError } from "./ValidationError"; + export type HTTPValidationError = { detail?: Array; }; diff --git a/www/app/api/models/Page_GetTranscript_.ts b/www/app/api/models/Page_GetTranscript_.ts index e105580e..bff594b2 100644 --- a/www/app/api/models/Page_GetTranscript_.ts +++ b/www/app/api/models/Page_GetTranscript_.ts @@ -1,8 +1,5 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { GetTranscript } from "./GetTranscript"; + export type Page_GetTranscript_ = { items: Array; total: number; diff --git a/www/app/api/models/Participant.ts b/www/app/api/models/Participant.ts index 7f08f43e..90b07edf 100644 --- a/www/app/api/models/Participant.ts +++ b/www/app/api/models/Participant.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type Participant = { id: string; speaker: number | null; diff --git a/www/app/api/models/RtcOffer.ts b/www/app/api/models/RtcOffer.ts index c6ef6f66..38d0e205 100644 --- a/www/app/api/models/RtcOffer.ts +++ b/www/app/api/models/RtcOffer.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type RtcOffer = { sdp: string; type: string; diff --git a/www/app/api/models/SpeakerAssignment.ts b/www/app/api/models/SpeakerAssignment.ts index c7c4032f..3ba7c28a 100644 --- a/www/app/api/models/SpeakerAssignment.ts +++ b/www/app/api/models/SpeakerAssignment.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type SpeakerAssignment = { speaker?: number | null; participant?: string | null; diff --git a/www/app/api/models/SpeakerAssignmentStatus.ts b/www/app/api/models/SpeakerAssignmentStatus.ts index 6b8c98df..645cd97d 100644 --- a/www/app/api/models/SpeakerAssignmentStatus.ts +++ b/www/app/api/models/SpeakerAssignmentStatus.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type SpeakerAssignmentStatus = { status: string; }; diff --git a/www/app/api/models/SpeakerMerge.ts b/www/app/api/models/SpeakerMerge.ts index 1bebc68f..8c0c9df2 100644 --- a/www/app/api/models/SpeakerMerge.ts +++ b/www/app/api/models/SpeakerMerge.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type SpeakerMerge = { speaker_from: number; speaker_to: number; diff --git a/www/app/api/models/SpeakerWords.ts b/www/app/api/models/SpeakerWords.ts index 99a73737..22e5d490 100644 --- a/www/app/api/models/SpeakerWords.ts +++ b/www/app/api/models/SpeakerWords.ts @@ -1,8 +1,5 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { Word } from "./Word"; + export type SpeakerWords = { speaker: number; words: Array; diff --git a/www/app/api/models/TranscriptParticipant.ts b/www/app/api/models/TranscriptParticipant.ts index babcb686..77c0479d 100644 --- a/www/app/api/models/TranscriptParticipant.ts +++ b/www/app/api/models/TranscriptParticipant.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type TranscriptParticipant = { id?: string; speaker: number | null; diff --git a/www/app/api/models/UpdateParticipant.ts b/www/app/api/models/UpdateParticipant.ts index cce7b226..86bec423 100644 --- a/www/app/api/models/UpdateParticipant.ts +++ b/www/app/api/models/UpdateParticipant.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type UpdateParticipant = { speaker?: number | null; name?: string | null; diff --git a/www/app/api/models/UpdateTranscript.ts b/www/app/api/models/UpdateTranscript.ts index 07c00113..824e5edb 100644 --- a/www/app/api/models/UpdateTranscript.ts +++ b/www/app/api/models/UpdateTranscript.ts @@ -1,8 +1,5 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { TranscriptParticipant } from "./TranscriptParticipant"; + export type UpdateTranscript = { name?: string | null; locked?: boolean | null; diff --git a/www/app/api/models/UserInfo.ts b/www/app/api/models/UserInfo.ts index 4f8c888f..ad05efae 100644 --- a/www/app/api/models/UserInfo.ts +++ b/www/app/api/models/UserInfo.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type UserInfo = { sub: string; email: string | null; diff --git a/www/app/api/models/ValidationError.ts b/www/app/api/models/ValidationError.ts index aa015bfd..03252ff0 100644 --- a/www/app/api/models/ValidationError.ts +++ b/www/app/api/models/ValidationError.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type ValidationError = { loc: Array; msg: string; diff --git a/www/app/api/models/Word.ts b/www/app/api/models/Word.ts index e0ebf7d8..be83d3e1 100644 --- a/www/app/api/models/Word.ts +++ b/www/app/api/models/Word.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type Word = { text: string; start: number; diff --git a/www/app/api/runtime.ts b/www/app/api/runtime.ts deleted file mode 100644 index 6a4bc1f8..00000000 --- a/www/app/api/runtime.ts +++ /dev/null @@ -1,520 +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. - */ - -export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); - -export interface ConfigurationParameters { - basePath?: string; // override base path - fetchApi?: FetchAPI; // override for fetch implementation - middleware?: Middleware[]; // middleware to apply before/after fetch requests - queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings - username?: string; // parameter for basic security - password?: string; // parameter for basic security - apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security - headers?: HTTPHeaders; //header params we want to use on every request - credentials?: RequestCredentials; //value for the credentials param we want to use on each request -} - -export class Configuration { - constructor(private configuration: ConfigurationParameters = {}) {} - - set config(configuration: Configuration) { - this.configuration = configuration; - } - - get basePath(): string { - return this.configuration.basePath != null - ? this.configuration.basePath - : BASE_PATH; - } - - get fetchApi(): FetchAPI | undefined { - return this.configuration.fetchApi; - } - - get middleware(): Middleware[] { - return this.configuration.middleware || []; - } - - get queryParamsStringify(): (params: HTTPQuery) => string { - return this.configuration.queryParamsStringify || querystring; - } - - get username(): string | undefined { - return this.configuration.username; - } - - get password(): string | undefined { - return this.configuration.password; - } - - get apiKey(): ((name: string) => string) | undefined { - const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === "function" ? apiKey : () => apiKey; - } - return undefined; - } - - get accessToken(): - | ((name?: string, scopes?: string[]) => string | Promise) - | undefined { - const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === "function" - ? accessToken - : async () => accessToken; - } - return undefined; - } - - get headers(): HTTPHeaders | undefined { - return this.configuration.headers; - } - - get credentials(): RequestCredentials | undefined { - return this.configuration.credentials; - } -} - -export const DefaultConfig = new Configuration(); - -/** - * This is the base class for all generated API classes. - */ -export class BaseAPI { - private static readonly jsonRegex = new RegExp( - "^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", - "i", - ); - private middleware: Middleware[]; - - constructor(protected configuration = DefaultConfig) { - this.middleware = configuration.middleware; - } - - withMiddleware(this: T, ...middlewares: Middleware[]) { - const next = this.clone(); - next.middleware = next.middleware.concat(...middlewares); - return next; - } - - withPreMiddleware( - this: T, - ...preMiddlewares: Array - ) { - const middlewares = preMiddlewares.map((pre) => ({ pre })); - return this.withMiddleware(...middlewares); - } - - withPostMiddleware( - this: T, - ...postMiddlewares: Array - ) { - const middlewares = postMiddlewares.map((post) => ({ post })); - return this.withMiddleware(...middlewares); - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - protected isJsonMime(mime: string | null | undefined): boolean { - if (!mime) { - return false; - } - return BaseAPI.jsonRegex.test(mime); - } - - protected async request( - context: RequestOpts, - initOverrides?: RequestInit | InitOverrideFunction, - ): Promise { - const { url, init } = await this.createFetchParams(context, initOverrides); - const response = await this.fetchApi(url, init); - if (response && response.status >= 200 && response.status < 300) { - return response; - } - throw new ResponseError(response, "Response returned an error code"); - } - - private async createFetchParams( - context: RequestOpts, - initOverrides?: RequestInit | InitOverrideFunction, - ) { - let url = this.configuration.basePath + context.path; - if ( - context.query !== undefined && - Object.keys(context.query).length !== 0 - ) { - // only add the querystring to the URL if there are query parameters. - // this is done to avoid urls ending with a "?" character which buggy webservers - // do not handle correctly sometimes. - url += "?" + this.configuration.queryParamsStringify(context.query); - } - - const headers = Object.assign( - {}, - this.configuration.headers, - context.headers, - ); - Object.keys(headers).forEach((key) => - headers[key] === undefined ? delete headers[key] : {}, - ); - - const initOverrideFn = - typeof initOverrides === "function" - ? initOverrides - : async () => initOverrides; - - const initParams = { - method: context.method, - headers, - body: context.body, - credentials: this.configuration.credentials, - }; - - const overriddenInit: RequestInit = { - ...initParams, - ...(await initOverrideFn({ - init: initParams, - context, - })), - }; - - const init: RequestInit = { - ...overriddenInit, - body: - isFormData(overriddenInit.body) || - overriddenInit.body instanceof URLSearchParams || - isBlob(overriddenInit.body) - ? overriddenInit.body - : JSON.stringify(overriddenInit.body), - }; - - return { url, init }; - } - - private fetchApi = async (url: string, init: RequestInit) => { - let fetchParams = { url, init }; - for (const middleware of this.middleware) { - if (middleware.pre) { - fetchParams = - (await middleware.pre({ - fetch: this.fetchApi, - ...fetchParams, - })) || fetchParams; - } - } - let response: Response | undefined = undefined; - try { - response = await (this.configuration.fetchApi || fetch)( - fetchParams.url, - fetchParams.init, - ); - } catch (e) { - for (const middleware of this.middleware) { - if (middleware.onError) { - response = - (await middleware.onError({ - fetch: this.fetchApi, - url: fetchParams.url, - init: fetchParams.init, - error: e, - response: response ? response.clone() : undefined, - })) || response; - } - } - if (response === undefined) { - if (e instanceof Error) { - throw new FetchError( - e, - "The request failed and the interceptors did not return an alternative response", - ); - } else { - throw e; - } - } - } - for (const middleware of this.middleware) { - if (middleware.post) { - response = - (await middleware.post({ - fetch: this.fetchApi, - url: fetchParams.url, - init: fetchParams.init, - response: response.clone(), - })) || response; - } - } - return response; - }; - - /** - * Create a shallow clone of `this` by constructing a new instance - * and then shallow cloning data members. - */ - private clone(this: T): T { - const constructor = this.constructor as any; - const next = new constructor(this.configuration); - next.middleware = this.middleware.slice(); - return next; - } -} - -function isBlob(value: any): value is Blob { - return typeof Blob !== "undefined" && value instanceof Blob; -} - -function isFormData(value: any): value is FormData { - return typeof FormData !== "undefined" && value instanceof FormData; -} - -export class ResponseError extends Error { - override name: "ResponseError" = "ResponseError"; - constructor( - public response: Response, - msg?: string, - ) { - super(msg); - } -} - -export class FetchError extends Error { - override name: "FetchError" = "FetchError"; - constructor( - public cause: Error, - msg?: string, - ) { - super(msg); - } -} - -export class RequiredError extends Error { - override name: "RequiredError" = "RequiredError"; - constructor( - public field: string, - msg?: string, - ) { - super(msg); - } -} - -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; - -export type FetchAPI = WindowOrWorkerGlobalScope["fetch"]; - -export type Json = any; -export type HTTPMethod = - | "GET" - | "POST" - | "PUT" - | "PATCH" - | "DELETE" - | "OPTIONS" - | "HEAD"; -export type HTTPHeaders = { [key: string]: string }; -export type HTTPQuery = { - [key: string]: - | string - | number - | null - | boolean - | Array - | Set - | HTTPQuery; -}; -export type HTTPBody = Json | FormData | URLSearchParams; -export type HTTPRequestInit = { - headers?: HTTPHeaders; - method: HTTPMethod; - credentials?: RequestCredentials; - body?: HTTPBody; -}; -export type ModelPropertyNaming = - | "camelCase" - | "snake_case" - | "PascalCase" - | "original"; - -export type InitOverrideFunction = (requestContext: { - init: HTTPRequestInit; - context: RequestOpts; -}) => Promise; - -export interface FetchParams { - url: string; - init: RequestInit; -} - -export interface RequestOpts { - path: string; - method: HTTPMethod; - headers: HTTPHeaders; - query?: HTTPQuery; - body?: HTTPBody; -} - -export function exists(json: any, key: string) { - const value = json[key]; - return value !== null && value !== undefined; -} - -export function querystring(params: HTTPQuery, prefix: string = ""): string { - return Object.keys(params) - .map((key) => querystringSingleKey(key, params[key], prefix)) - .filter((part) => part.length > 0) - .join("&"); -} - -function querystringSingleKey( - key: string, - value: - | string - | number - | null - | undefined - | boolean - | Array - | Set - | HTTPQuery, - keyPrefix: string = "", -): string { - const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); - if (value instanceof Array) { - const multiValue = value - .map((singleValue) => encodeURIComponent(String(singleValue))) - .join(`&${encodeURIComponent(fullKey)}=`); - return `${encodeURIComponent(fullKey)}=${multiValue}`; - } - if (value instanceof Set) { - const valueAsArray = Array.from(value); - return querystringSingleKey(key, valueAsArray, keyPrefix); - } - if (value instanceof Date) { - return `${encodeURIComponent(fullKey)}=${encodeURIComponent( - value.toISOString(), - )}`; - } - if (value instanceof Object) { - return querystring(value as HTTPQuery, fullKey); - } - return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; -} - -export function mapValues(data: any, fn: (item: any) => any) { - return Object.keys(data).reduce( - (acc, key) => ({ ...acc, [key]: fn(data[key]) }), - {}, - ); -} - -export function canConsumeForm(consumes: Consume[]): boolean { - for (const consume of consumes) { - if ("multipart/form-data" === consume.contentType) { - return true; - } - } - return false; -} - -export interface Consume { - contentType: string; -} - -export interface RequestContext { - fetch: FetchAPI; - url: string; - init: RequestInit; -} - -export interface ResponseContext { - fetch: FetchAPI; - url: string; - init: RequestInit; - response: Response; -} - -export interface ErrorContext { - fetch: FetchAPI; - url: string; - init: RequestInit; - error: unknown; - response?: Response; -} - -export interface Middleware { - pre?(context: RequestContext): Promise; - post?(context: ResponseContext): Promise; - onError?(context: ErrorContext): Promise; -} - -export interface ApiResponse { - raw: Response; - value(): Promise; -} - -export interface ResponseTransformer { - (json: any): T; -} - -export class JSONApiResponse { - constructor( - public raw: Response, - private transformer: ResponseTransformer = (jsonValue: any) => jsonValue, - ) {} - - async value(): Promise { - return this.transformer(await this.raw.json()); - } -} - -export class VoidApiResponse { - constructor(public raw: Response) {} - - async value(): Promise { - return undefined; - } -} - -export class BlobApiResponse { - constructor(public raw: Response) {} - - async value(): Promise { - return await this.raw.blob(); - } -} - -export class TextApiResponse { - constructor(public raw: Response) {} - - async value(): Promise { - return await this.raw.text(); - } -} diff --git a/www/app/api/schemas/$AudioWaveform.ts b/www/app/api/schemas/$AudioWaveform.ts new file mode 100644 index 00000000..cfa2964f --- /dev/null +++ b/www/app/api/schemas/$AudioWaveform.ts @@ -0,0 +1,11 @@ +export const $AudioWaveform = { + properties: { + data: { + type: "array", + contains: { + type: "number", + }, + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts b/www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts new file mode 100644 index 00000000..60678cca --- /dev/null +++ b/www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts @@ -0,0 +1,10 @@ +export const $Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = + { + properties: { + file: { + type: "binary", + isRequired: true, + format: "binary", + }, + }, + } as const; diff --git a/www/app/api/schemas/$CreateParticipant.ts b/www/app/api/schemas/$CreateParticipant.ts new file mode 100644 index 00000000..acb580e8 --- /dev/null +++ b/www/app/api/schemas/$CreateParticipant.ts @@ -0,0 +1,19 @@ +export const $CreateParticipant = { + properties: { + speaker: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + }, + name: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$CreateTranscript.ts b/www/app/api/schemas/$CreateTranscript.ts new file mode 100644 index 00000000..5e0baef5 --- /dev/null +++ b/www/app/api/schemas/$CreateTranscript.ts @@ -0,0 +1,14 @@ +export const $CreateTranscript = { + properties: { + name: { + type: "string", + isRequired: true, + }, + source_language: { + type: "string", + }, + target_language: { + type: "string", + }, + }, +} as const; diff --git a/www/app/api/schemas/$DeletionStatus.ts b/www/app/api/schemas/$DeletionStatus.ts new file mode 100644 index 00000000..a2afbfb6 --- /dev/null +++ b/www/app/api/schemas/$DeletionStatus.ts @@ -0,0 +1,8 @@ +export const $DeletionStatus = { + properties: { + status: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$GetTranscript.ts b/www/app/api/schemas/$GetTranscript.ts new file mode 100644 index 00000000..7ff805e7 --- /dev/null +++ b/www/app/api/schemas/$GetTranscript.ts @@ -0,0 +1,123 @@ +export const $GetTranscript = { + properties: { + id: { + type: "string", + isRequired: true, + }, + user_id: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + name: { + type: "string", + isRequired: true, + }, + status: { + type: "string", + isRequired: true, + }, + locked: { + type: "boolean", + isRequired: true, + }, + duration: { + type: "number", + isRequired: true, + }, + title: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + short_summary: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + long_summary: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + created_at: { + type: "string", + isRequired: true, + format: "date-time", + }, + share_mode: { + type: "string", + }, + source_language: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + target_language: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + participants: { + type: "any-of", + contains: [ + { + type: "array", + contains: { + type: "TranscriptParticipant", + }, + }, + { + type: "null", + }, + ], + isRequired: true, + }, + reviewed: { + type: "boolean", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$GetTranscriptSegmentTopic.ts b/www/app/api/schemas/$GetTranscriptSegmentTopic.ts new file mode 100644 index 00000000..c7cb3cd5 --- /dev/null +++ b/www/app/api/schemas/$GetTranscriptSegmentTopic.ts @@ -0,0 +1,16 @@ +export const $GetTranscriptSegmentTopic = { + properties: { + text: { + type: "string", + isRequired: true, + }, + start: { + type: "number", + isRequired: true, + }, + speaker: { + type: "number", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$GetTranscriptTopic.ts b/www/app/api/schemas/$GetTranscriptTopic.ts new file mode 100644 index 00000000..36456769 --- /dev/null +++ b/www/app/api/schemas/$GetTranscriptTopic.ts @@ -0,0 +1,42 @@ +export const $GetTranscriptTopic = { + properties: { + id: { + type: "string", + isRequired: true, + }, + title: { + type: "string", + isRequired: true, + }, + summary: { + type: "string", + isRequired: true, + }, + timestamp: { + type: "number", + isRequired: true, + }, + duration: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + transcript: { + type: "string", + isRequired: true, + }, + segments: { + type: "array", + contains: { + type: "GetTranscriptSegmentTopic", + }, + }, + }, +} as const; diff --git a/www/app/api/schemas/$GetTranscriptTopicWithWords.ts b/www/app/api/schemas/$GetTranscriptTopicWithWords.ts new file mode 100644 index 00000000..252ac3cb --- /dev/null +++ b/www/app/api/schemas/$GetTranscriptTopicWithWords.ts @@ -0,0 +1,48 @@ +export const $GetTranscriptTopicWithWords = { + properties: { + id: { + type: "string", + isRequired: true, + }, + title: { + type: "string", + isRequired: true, + }, + summary: { + type: "string", + isRequired: true, + }, + timestamp: { + type: "number", + isRequired: true, + }, + duration: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + transcript: { + type: "string", + isRequired: true, + }, + segments: { + type: "array", + contains: { + type: "GetTranscriptSegmentTopic", + }, + }, + words: { + type: "array", + contains: { + type: "Word", + }, + }, + }, +} as const; diff --git a/www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts b/www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts new file mode 100644 index 00000000..25164f7b --- /dev/null +++ b/www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts @@ -0,0 +1,48 @@ +export const $GetTranscriptTopicWithWordsPerSpeaker = { + properties: { + id: { + type: "string", + isRequired: true, + }, + title: { + type: "string", + isRequired: true, + }, + summary: { + type: "string", + isRequired: true, + }, + timestamp: { + type: "number", + isRequired: true, + }, + duration: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + transcript: { + type: "string", + isRequired: true, + }, + segments: { + type: "array", + contains: { + type: "GetTranscriptSegmentTopic", + }, + }, + words_per_speaker: { + type: "array", + contains: { + type: "SpeakerWords", + }, + }, + }, +} as const; diff --git a/www/app/api/schemas/$HTTPValidationError.ts b/www/app/api/schemas/$HTTPValidationError.ts new file mode 100644 index 00000000..dd7ec8af --- /dev/null +++ b/www/app/api/schemas/$HTTPValidationError.ts @@ -0,0 +1,10 @@ +export const $HTTPValidationError = { + properties: { + detail: { + type: "array", + contains: { + type: "ValidationError", + }, + }, + }, +} as const; diff --git a/www/app/api/schemas/$Page_GetTranscript_.ts b/www/app/api/schemas/$Page_GetTranscript_.ts new file mode 100644 index 00000000..d692773a --- /dev/null +++ b/www/app/api/schemas/$Page_GetTranscript_.ts @@ -0,0 +1,52 @@ +export const $Page_GetTranscript_ = { + properties: { + items: { + type: "array", + contains: { + type: "GetTranscript", + }, + isRequired: true, + }, + total: { + type: "number", + isRequired: true, + }, + page: { + type: "any-of", + contains: [ + { + type: "number", + minimum: 1, + }, + { + type: "null", + }, + ], + isRequired: true, + }, + size: { + type: "any-of", + contains: [ + { + type: "number", + minimum: 1, + }, + { + type: "null", + }, + ], + isRequired: true, + }, + pages: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + }, + }, +} as const; diff --git a/www/app/api/schemas/$Participant.ts b/www/app/api/schemas/$Participant.ts new file mode 100644 index 00000000..25b6c710 --- /dev/null +++ b/www/app/api/schemas/$Participant.ts @@ -0,0 +1,24 @@ +export const $Participant = { + properties: { + id: { + type: "string", + isRequired: true, + }, + speaker: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + name: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$RtcOffer.ts b/www/app/api/schemas/$RtcOffer.ts new file mode 100644 index 00000000..b5ec33a1 --- /dev/null +++ b/www/app/api/schemas/$RtcOffer.ts @@ -0,0 +1,12 @@ +export const $RtcOffer = { + properties: { + sdp: { + type: "string", + isRequired: true, + }, + type: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$SpeakerAssignment.ts b/www/app/api/schemas/$SpeakerAssignment.ts new file mode 100644 index 00000000..869f407a --- /dev/null +++ b/www/app/api/schemas/$SpeakerAssignment.ts @@ -0,0 +1,34 @@ +export const $SpeakerAssignment = { + properties: { + speaker: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + }, + participant: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + }, + timestamp_from: { + type: "number", + isRequired: true, + }, + timestamp_to: { + type: "number", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$SpeakerAssignmentStatus.ts b/www/app/api/schemas/$SpeakerAssignmentStatus.ts new file mode 100644 index 00000000..e8aa81e0 --- /dev/null +++ b/www/app/api/schemas/$SpeakerAssignmentStatus.ts @@ -0,0 +1,8 @@ +export const $SpeakerAssignmentStatus = { + properties: { + status: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$SpeakerMerge.ts b/www/app/api/schemas/$SpeakerMerge.ts new file mode 100644 index 00000000..fc662b8f --- /dev/null +++ b/www/app/api/schemas/$SpeakerMerge.ts @@ -0,0 +1,12 @@ +export const $SpeakerMerge = { + properties: { + speaker_from: { + type: "number", + isRequired: true, + }, + speaker_to: { + type: "number", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$SpeakerWords.ts b/www/app/api/schemas/$SpeakerWords.ts new file mode 100644 index 00000000..a9c45af7 --- /dev/null +++ b/www/app/api/schemas/$SpeakerWords.ts @@ -0,0 +1,15 @@ +export const $SpeakerWords = { + properties: { + speaker: { + type: "number", + isRequired: true, + }, + words: { + type: "array", + contains: { + type: "Word", + }, + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$TranscriptParticipant.ts b/www/app/api/schemas/$TranscriptParticipant.ts new file mode 100644 index 00000000..d9f16714 --- /dev/null +++ b/www/app/api/schemas/$TranscriptParticipant.ts @@ -0,0 +1,23 @@ +export const $TranscriptParticipant = { + properties: { + id: { + type: "string", + }, + speaker: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + name: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$UpdateParticipant.ts b/www/app/api/schemas/$UpdateParticipant.ts new file mode 100644 index 00000000..97352e58 --- /dev/null +++ b/www/app/api/schemas/$UpdateParticipant.ts @@ -0,0 +1,26 @@ +export const $UpdateParticipant = { + properties: { + speaker: { + type: "any-of", + contains: [ + { + type: "number", + }, + { + type: "null", + }, + ], + }, + name: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + }, + }, +} as const; diff --git a/www/app/api/schemas/$UpdateTranscript.ts b/www/app/api/schemas/$UpdateTranscript.ts new file mode 100644 index 00000000..b3d5fb07 --- /dev/null +++ b/www/app/api/schemas/$UpdateTranscript.ts @@ -0,0 +1,95 @@ +export const $UpdateTranscript = { + properties: { + name: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + }, + locked: { + type: "any-of", + contains: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], + }, + title: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + }, + short_summary: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + }, + long_summary: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + }, + share_mode: { + type: "any-of", + contains: [ + { + type: "Enum", + }, + { + type: "null", + }, + ], + }, + participants: { + type: "any-of", + contains: [ + { + type: "array", + contains: { + type: "TranscriptParticipant", + }, + }, + { + type: "null", + }, + ], + }, + reviewed: { + type: "any-of", + contains: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], + }, + }, +} as const; diff --git a/www/app/api/schemas/$UserInfo.ts b/www/app/api/schemas/$UserInfo.ts new file mode 100644 index 00000000..b1d406f4 --- /dev/null +++ b/www/app/api/schemas/$UserInfo.ts @@ -0,0 +1,32 @@ +export const $UserInfo = { + properties: { + sub: { + type: "string", + isRequired: true, + }, + email: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + email_verified: { + type: "any-of", + contains: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$ValidationError.ts b/www/app/api/schemas/$ValidationError.ts new file mode 100644 index 00000000..ee241461 --- /dev/null +++ b/www/app/api/schemas/$ValidationError.ts @@ -0,0 +1,27 @@ +export const $ValidationError = { + properties: { + loc: { + type: "array", + contains: { + type: "any-of", + contains: [ + { + type: "string", + }, + { + type: "number", + }, + ], + }, + isRequired: true, + }, + msg: { + type: "string", + isRequired: true, + }, + type: { + type: "string", + isRequired: true, + }, + }, +} as const; diff --git a/www/app/api/schemas/$Word.ts b/www/app/api/schemas/$Word.ts new file mode 100644 index 00000000..f69fba99 --- /dev/null +++ b/www/app/api/schemas/$Word.ts @@ -0,0 +1,19 @@ +export const $Word = { + properties: { + text: { + type: "string", + isRequired: true, + }, + start: { + type: "number", + isRequired: true, + }, + end: { + type: "number", + isRequired: true, + }, + speaker: { + type: "number", + }, + }, +} as const; diff --git a/www/app/api/services/DefaultService.ts b/www/app/api/services/DefaultService.ts index 6452d5e5..fe6092e9 100644 --- a/www/app/api/services/DefaultService.ts +++ b/www/app/api/services/DefaultService.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not 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"; @@ -22,52 +18,138 @@ 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 type TDataV1TranscriptsList = { + /** + * Page number + */ + page?: number; + /** + * Page size + */ + size?: number; +}; +export type TDataV1TranscriptsCreate = { + requestBody: CreateTranscript; +}; +export type TDataV1TranscriptGet = { + transcriptId: string; +}; +export type TDataV1TranscriptUpdate = { + requestBody: UpdateTranscript; + transcriptId: string; +}; +export type TDataV1TranscriptDelete = { + transcriptId: string; +}; +export type TDataV1TranscriptGetTopics = { + transcriptId: string; +}; +export type TDataV1TranscriptGetTopicsWithWords = { + transcriptId: string; +}; +export type TDataV1TranscriptGetTopicsWithWordsPerSpeaker = { + topicId: string; + transcriptId: string; +}; +export type TDataV1TranscriptHeadAudioMp3 = { + token?: string | null; + transcriptId: string; +}; +export type TDataV1TranscriptGetAudioMp3 = { + token?: string | null; + transcriptId: string; +}; +export type TDataV1TranscriptGetAudioWaveform = { + transcriptId: string; +}; +export type TDataV1TranscriptGetParticipants = { + transcriptId: string; +}; +export type TDataV1TranscriptAddParticipant = { + requestBody: CreateParticipant; + transcriptId: string; +}; +export type TDataV1TranscriptGetParticipant = { + participantId: string; + transcriptId: string; +}; +export type TDataV1TranscriptUpdateParticipant = { + participantId: string; + requestBody: UpdateParticipant; + transcriptId: string; +}; +export type TDataV1TranscriptDeleteParticipant = { + participantId: string; + transcriptId: string; +}; +export type TDataV1TranscriptAssignSpeaker = { + requestBody: SpeakerAssignment; + transcriptId: string; +}; +export type TDataV1TranscriptMergeSpeaker = { + requestBody: SpeakerMerge; + transcriptId: string; +}; +export type TDataV1TranscriptRecordUpload = { + formData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post; + transcriptId: string; +}; +export type TDataV1TranscriptGetWebsocketEvents = { + transcriptId: string; +}; +export type TDataV1TranscriptRecordWebrtc = { + requestBody: RtcOffer; + transcriptId: string; +}; + export class DefaultService { constructor(public readonly httpRequest: BaseHttpRequest) {} + /** * Metrics * Endpoint that serves Prometheus metrics. - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ - public metrics(): CancelablePromise { + public metrics(): CancelablePromise { 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, + data: TDataV1TranscriptsList = {}, ): CancelablePromise { + const { page = 1, size = 50 } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts", query: { - page: page, - size: size, + page, + size, }, errors: { 422: `Validation Error`, }, }); } + /** * Transcripts Create - * @param requestBody * @returns GetTranscript Successful Response * @throws ApiError */ public v1TranscriptsCreate( - requestBody: CreateTranscript, + data: TDataV1TranscriptsCreate, ): CancelablePromise { + const { requestBody } = data; return this.httpRequest.request({ method: "POST", url: "/v1/transcripts", @@ -78,15 +160,16 @@ export class DefaultService { }, }); } + /** * Transcript Get - * @param transcriptId * @returns GetTranscript Successful Response * @throws ApiError */ public v1TranscriptGet( - transcriptId: string, + data: TDataV1TranscriptGet, ): CancelablePromise { + const { transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}", @@ -98,17 +181,16 @@ export class DefaultService { }, }); } + /** * Transcript Update - * @param transcriptId - * @param requestBody * @returns GetTranscript Successful Response * @throws ApiError */ public v1TranscriptUpdate( - transcriptId: string, - requestBody: UpdateTranscript, + data: TDataV1TranscriptUpdate, ): CancelablePromise { + const { requestBody, transcriptId } = data; return this.httpRequest.request({ method: "PATCH", url: "/v1/transcripts/{transcript_id}", @@ -122,15 +204,16 @@ export class DefaultService { }, }); } + /** * Transcript Delete - * @param transcriptId * @returns DeletionStatus Successful Response * @throws ApiError */ public v1TranscriptDelete( - transcriptId: string, + data: TDataV1TranscriptDelete, ): CancelablePromise { + const { transcriptId } = data; return this.httpRequest.request({ method: "DELETE", url: "/v1/transcripts/{transcript_id}", @@ -142,15 +225,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Topics - * @param transcriptId * @returns GetTranscriptTopic Successful Response * @throws ApiError */ public v1TranscriptGetTopics( - transcriptId: string, + data: TDataV1TranscriptGetTopics, ): CancelablePromise> { + const { transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/topics", @@ -162,15 +246,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Topics With Words - * @param transcriptId * @returns GetTranscriptTopicWithWords Successful Response * @throws ApiError */ public v1TranscriptGetTopicsWithWords( - transcriptId: string, + data: TDataV1TranscriptGetTopicsWithWords, ): CancelablePromise> { + const { transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/topics/with-words", @@ -182,17 +267,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Topics With Words Per Speaker - * @param transcriptId - * @param topicId * @returns GetTranscriptTopicWithWordsPerSpeaker Successful Response * @throws ApiError */ public v1TranscriptGetTopicsWithWordsPerSpeaker( - transcriptId: string, - topicId: string, + data: TDataV1TranscriptGetTopicsWithWordsPerSpeaker, ): CancelablePromise { + const { topicId, transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/topics/{topic_id}/words-per-speaker", @@ -205,17 +289,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Audio Mp3 - * @param transcriptId - * @param token - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ public v1TranscriptHeadAudioMp3( - transcriptId: string, - token?: string | null, - ): CancelablePromise { + data: TDataV1TranscriptHeadAudioMp3, + ): CancelablePromise { + const { token, transcriptId } = data; return this.httpRequest.request({ method: "HEAD", url: "/v1/transcripts/{transcript_id}/audio/mp3", @@ -223,24 +306,23 @@ export class DefaultService { transcript_id: transcriptId, }, query: { - token: token, + token, }, errors: { 422: `Validation Error`, }, }); } + /** * Transcript Get Audio Mp3 - * @param transcriptId - * @param token - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ public v1TranscriptGetAudioMp3( - transcriptId: string, - token?: string | null, - ): CancelablePromise { + data: TDataV1TranscriptGetAudioMp3, + ): CancelablePromise { + const { token, transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/audio/mp3", @@ -248,22 +330,23 @@ export class DefaultService { transcript_id: transcriptId, }, query: { - token: token, + token, }, errors: { 422: `Validation Error`, }, }); } + /** * Transcript Get Audio Waveform - * @param transcriptId * @returns AudioWaveform Successful Response * @throws ApiError */ public v1TranscriptGetAudioWaveform( - transcriptId: string, + data: TDataV1TranscriptGetAudioWaveform, ): CancelablePromise { + const { transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/audio/waveform", @@ -275,15 +358,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Participants - * @param transcriptId * @returns Participant Successful Response * @throws ApiError */ public v1TranscriptGetParticipants( - transcriptId: string, + data: TDataV1TranscriptGetParticipants, ): CancelablePromise> { + const { transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/participants", @@ -295,17 +379,16 @@ export class DefaultService { }, }); } + /** * Transcript Add Participant - * @param transcriptId - * @param requestBody * @returns Participant Successful Response * @throws ApiError */ public v1TranscriptAddParticipant( - transcriptId: string, - requestBody: CreateParticipant, + data: TDataV1TranscriptAddParticipant, ): CancelablePromise { + const { requestBody, transcriptId } = data; return this.httpRequest.request({ method: "POST", url: "/v1/transcripts/{transcript_id}/participants", @@ -319,17 +402,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Participant - * @param transcriptId - * @param participantId * @returns Participant Successful Response * @throws ApiError */ public v1TranscriptGetParticipant( - transcriptId: string, - participantId: string, + data: TDataV1TranscriptGetParticipant, ): CancelablePromise { + const { participantId, transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/participants/{participant_id}", @@ -342,19 +424,16 @@ export class DefaultService { }, }); } + /** * Transcript Update Participant - * @param transcriptId - * @param participantId - * @param requestBody * @returns Participant Successful Response * @throws ApiError */ public v1TranscriptUpdateParticipant( - transcriptId: string, - participantId: string, - requestBody: UpdateParticipant, + data: TDataV1TranscriptUpdateParticipant, ): CancelablePromise { + const { participantId, requestBody, transcriptId } = data; return this.httpRequest.request({ method: "PATCH", url: "/v1/transcripts/{transcript_id}/participants/{participant_id}", @@ -369,17 +448,16 @@ export class DefaultService { }, }); } + /** * Transcript Delete Participant - * @param transcriptId - * @param participantId * @returns DeletionStatus Successful Response * @throws ApiError */ public v1TranscriptDeleteParticipant( - transcriptId: string, - participantId: string, + data: TDataV1TranscriptDeleteParticipant, ): CancelablePromise { + const { participantId, transcriptId } = data; return this.httpRequest.request({ method: "DELETE", url: "/v1/transcripts/{transcript_id}/participants/{participant_id}", @@ -392,17 +470,16 @@ export class DefaultService { }, }); } + /** * Transcript Assign Speaker - * @param transcriptId - * @param requestBody * @returns SpeakerAssignmentStatus Successful Response * @throws ApiError */ public v1TranscriptAssignSpeaker( - transcriptId: string, - requestBody: SpeakerAssignment, + data: TDataV1TranscriptAssignSpeaker, ): CancelablePromise { + const { requestBody, transcriptId } = data; return this.httpRequest.request({ method: "PATCH", url: "/v1/transcripts/{transcript_id}/speaker/assign", @@ -416,17 +493,16 @@ export class DefaultService { }, }); } + /** * Transcript Merge Speaker - * @param transcriptId - * @param requestBody * @returns SpeakerAssignmentStatus Successful Response * @throws ApiError */ public v1TranscriptMergeSpeaker( - transcriptId: string, - requestBody: SpeakerMerge, + data: TDataV1TranscriptMergeSpeaker, ): CancelablePromise { + const { requestBody, transcriptId } = data; return this.httpRequest.request({ method: "PATCH", url: "/v1/transcripts/{transcript_id}/speaker/merge", @@ -440,17 +516,16 @@ export class DefaultService { }, }); } + /** * Transcript Record Upload - * @param transcriptId - * @param formData - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ public v1TranscriptRecordUpload( - transcriptId: string, - formData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post, - ): CancelablePromise { + data: TDataV1TranscriptRecordUpload, + ): CancelablePromise { + const { formData, transcriptId } = data; return this.httpRequest.request({ method: "POST", url: "/v1/transcripts/{transcript_id}/record/upload", @@ -464,15 +539,16 @@ export class DefaultService { }, }); } + /** * Transcript Get Websocket Events - * @param transcriptId - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ public v1TranscriptGetWebsocketEvents( - transcriptId: string, - ): CancelablePromise { + data: TDataV1TranscriptGetWebsocketEvents, + ): CancelablePromise { + const { transcriptId } = data; return this.httpRequest.request({ method: "GET", url: "/v1/transcripts/{transcript_id}/events", @@ -484,17 +560,16 @@ export class DefaultService { }, }); } + /** * Transcript Record Webrtc - * @param transcriptId - * @param requestBody - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ public v1TranscriptRecordWebrtc( - transcriptId: string, - requestBody: RtcOffer, - ): CancelablePromise { + data: TDataV1TranscriptRecordWebrtc, + ): CancelablePromise { + const { requestBody, transcriptId } = data; return this.httpRequest.request({ method: "POST", url: "/v1/transcripts/{transcript_id}/record/webrtc", @@ -508,9 +583,10 @@ export class DefaultService { }, }); } + /** * User Me - * @returns any Successful Response + * @returns unknown Successful Response * @throws ApiError */ public v1UserMe(): CancelablePromise { diff --git a/www/package.json b/www/package.json index 37a15374..ba3b3f83 100644 --- a/www/package.json +++ b/www/package.json @@ -8,7 +8,7 @@ "start": "next start", "lint": "next lint", "format": "prettier --write .", - "openapi": "openapi --input http://127.0.0.1:1250/openapi.json --name OpenApi --output app/api && yarn format" + "openapi": "openapi-ts --input http://127.0.0.1:1250/openapi.json --name OpenApi --output app/api && yarn format" }, "dependencies": { "@chakra-ui/icons": "^2.1.1", @@ -56,7 +56,7 @@ "license": "All Rights Reserved", "devDependencies": { "@types/react": "18.2.20", - "openapi-typescript-codegen": "^0.29.0", + "@hey-api/openapi-ts": "^0.27.24", "prettier": "^3.0.0" } } diff --git a/www/yarn.lock b/www/yarn.lock index 9f2317bf..51e9c96d 100644 --- a/www/yarn.lock +++ b/www/yarn.lock @@ -12,10 +12,10 @@ resolved "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz" integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== -"@apidevtools/json-schema-ref-parser@^11.5.4": - version "11.6.4" - resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.4.tgz#0f3e02302f646471d621a8850e6a346d63c8ebd4" - integrity sha512-9K6xOqeevacvweLGik6LnZCb1fBtCOSIWQs8d096XGeqoLKC33UVMGz9+77Gw44KvbH4pKcQPWo4ZpxkXYj05w== +"@apidevtools/json-schema-ref-parser@11.5.4": + version "11.5.4" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.5.4.tgz#6a90caf2140834025cf72651280c46084de187ae" + integrity sha512-o2fsypTGU0WxRxbax8zQoHiIB4dyrkwYfcm8TxZ+bx9pCzcWZbQtiMqpgBvWA/nJ2TrGjK5adCLfTH8wUeU/Wg== dependencies: "@jsdevtools/ono" "^7.1.3" "@types/json-schema" "^7.0.15" @@ -1103,6 +1103,16 @@ dependencies: prop-types "^15.8.1" +"@hey-api/openapi-ts@^0.27.24": + version "0.27.39" + resolved "https://registry.yarnpkg.com/@hey-api/openapi-ts/-/openapi-ts-0.27.39.tgz#130be15a33cda0ea04dc51166089b7eb77190479" + integrity sha512-sqcMU4QUR/KDwYYj6YlYwAwo8F3bm9Sy9PNwWZ8K/kVNMajtcFkWXDMygeGHaLEVE0zwxmYuO+mcSN+lTD5ZCQ== + dependencies: + "@apidevtools/json-schema-ref-parser" "11.5.4" + camelcase "8.0.0" + commander "12.0.0" + handlebars "4.7.8" + "@humanwhocodes/config-array@^0.11.13": version "0.11.13" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297" @@ -1972,10 +1982,10 @@ camelcase-css@^2.0.1: resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz" integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== -camelcase@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== +camelcase@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-8.0.0.tgz#c0d36d418753fb6ad9c5e0437579745c1c14a534" + integrity sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA== caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503: version "1.0.30001572" @@ -2090,10 +2100,10 @@ comma-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== -commander@^12.0.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" - integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== +commander@12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" + integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== commander@^4.0.0: version "4.1.1" @@ -2809,15 +2819,6 @@ framesync@6.1.2: dependencies: tslib "2.4.0" -fs-extra@^11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" - integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" @@ -2997,7 +2998,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -3007,7 +3008,7 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -handlebars@^4.7.8: +handlebars@4.7.8: version "4.7.8" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== @@ -3473,15 +3474,6 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5: version "3.3.5" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" @@ -4059,17 +4051,6 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" -openapi-typescript-codegen@^0.29.0: - version "0.29.0" - resolved "https://registry.yarnpkg.com/openapi-typescript-codegen/-/openapi-typescript-codegen-0.29.0.tgz#e98a1daa223ccdeb1cc51b2e2dc11bafae6fe746" - integrity sha512-/wC42PkD0LGjDTEULa/XiWQbv4E9NwLjwLjsaJ/62yOsoYhwvmBR31kPttn1DzQ2OlGe5stACcF/EIkZk43M6w== - dependencies: - "@apidevtools/json-schema-ref-parser" "^11.5.4" - camelcase "^6.3.0" - commander "^12.0.0" - fs-extra "^11.2.0" - handlebars "^4.7.8" - optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -5100,11 +5081,6 @@ unist-util-visit@^5.0.0: unist-util-is "^6.0.0" unist-util-visit-parents "^6.0.0" -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz" From 92a99fba2cc2ff7c53d8c6468f03cecfeaba2584 Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Wed, 3 Jul 2024 16:33:43 +0200 Subject: [PATCH 3/5] Migrate to the latest openapi-ts --- www/app/api/OpenApi.ts | 7 +- www/app/api/core/ApiRequestOptions.ts | 5 +- www/app/api/core/AxiosHttpRequest.ts | 4 +- www/app/api/core/BaseHttpRequest.ts | 4 +- www/app/api/core/CancelablePromise.ts | 70 +- www/app/api/core/OpenAPI.ts | 51 +- www/app/api/core/request.ts | 111 ++- www/app/api/core/types.ts | 14 - www/app/api/index.ts | 60 +- www/app/api/models/AudioWaveform.ts | 3 - ...ipts__transcript_id__record_upload_post.ts | 4 - www/app/api/models/CreateParticipant.ts | 4 - www/app/api/models/CreateTranscript.ts | 5 - www/app/api/models/DeletionStatus.ts | 3 - www/app/api/models/GetTranscript.ts | 19 - .../api/models/GetTranscriptSegmentTopic.ts | 5 - www/app/api/models/GetTranscriptTopic.ts | 11 - .../api/models/GetTranscriptTopicWithWords.ts | 13 - .../GetTranscriptTopicWithWordsPerSpeaker.ts | 13 - www/app/api/models/HTTPValidationError.ts | 5 - www/app/api/models/Page_GetTranscript_.ts | 9 - www/app/api/models/Participant.ts | 5 - www/app/api/models/RtcOffer.ts | 4 - www/app/api/models/SpeakerAssignment.ts | 6 - www/app/api/models/SpeakerAssignmentStatus.ts | 3 - www/app/api/models/SpeakerMerge.ts | 4 - www/app/api/models/SpeakerWords.ts | 6 - www/app/api/models/TranscriptParticipant.ts | 5 - www/app/api/models/UpdateParticipant.ts | 4 - www/app/api/models/UpdateTranscript.ts | 12 - www/app/api/models/UserInfo.ts | 5 - www/app/api/models/ValidationError.ts | 5 - www/app/api/models/Word.ts | 6 - www/app/api/schemas.gen.ts | 845 ++++++++++++++++++ www/app/api/schemas/$AudioWaveform.ts | 11 - ...ipts__transcript_id__record_upload_post.ts | 10 - www/app/api/schemas/$CreateParticipant.ts | 19 - www/app/api/schemas/$CreateTranscript.ts | 14 - www/app/api/schemas/$DeletionStatus.ts | 8 - www/app/api/schemas/$GetTranscript.ts | 123 --- .../api/schemas/$GetTranscriptSegmentTopic.ts | 16 - www/app/api/schemas/$GetTranscriptTopic.ts | 42 - .../schemas/$GetTranscriptTopicWithWords.ts | 48 - .../$GetTranscriptTopicWithWordsPerSpeaker.ts | 48 - www/app/api/schemas/$HTTPValidationError.ts | 10 - www/app/api/schemas/$Page_GetTranscript_.ts | 52 -- www/app/api/schemas/$Participant.ts | 24 - www/app/api/schemas/$RtcOffer.ts | 12 - www/app/api/schemas/$SpeakerAssignment.ts | 34 - .../api/schemas/$SpeakerAssignmentStatus.ts | 8 - www/app/api/schemas/$SpeakerMerge.ts | 12 - www/app/api/schemas/$SpeakerWords.ts | 15 - www/app/api/schemas/$TranscriptParticipant.ts | 23 - www/app/api/schemas/$UpdateParticipant.ts | 26 - www/app/api/schemas/$UpdateTranscript.ts | 95 -- www/app/api/schemas/$UserInfo.ts | 32 - www/app/api/schemas/$ValidationError.ts | 27 - www/app/api/schemas/$Word.ts | 19 - www/app/api/services.gen.ts | 579 ++++++++++++ www/app/api/services/DefaultService.ts | 598 ------------- www/app/api/types.gen.ts | 642 +++++++++++++ www/openapi-ts.config.ts | 14 + www/package.json | 4 +- www/yarn.lock | 297 +++++- 64 files changed, 2524 insertions(+), 1668 deletions(-) delete mode 100644 www/app/api/core/types.ts delete mode 100644 www/app/api/models/AudioWaveform.ts delete mode 100644 www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts delete mode 100644 www/app/api/models/CreateParticipant.ts delete mode 100644 www/app/api/models/CreateTranscript.ts delete mode 100644 www/app/api/models/DeletionStatus.ts delete mode 100644 www/app/api/models/GetTranscript.ts delete mode 100644 www/app/api/models/GetTranscriptSegmentTopic.ts delete mode 100644 www/app/api/models/GetTranscriptTopic.ts delete mode 100644 www/app/api/models/GetTranscriptTopicWithWords.ts delete mode 100644 www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts delete mode 100644 www/app/api/models/HTTPValidationError.ts delete mode 100644 www/app/api/models/Page_GetTranscript_.ts delete mode 100644 www/app/api/models/Participant.ts delete mode 100644 www/app/api/models/RtcOffer.ts delete mode 100644 www/app/api/models/SpeakerAssignment.ts delete mode 100644 www/app/api/models/SpeakerAssignmentStatus.ts delete mode 100644 www/app/api/models/SpeakerMerge.ts delete mode 100644 www/app/api/models/SpeakerWords.ts delete mode 100644 www/app/api/models/TranscriptParticipant.ts delete mode 100644 www/app/api/models/UpdateParticipant.ts delete mode 100644 www/app/api/models/UpdateTranscript.ts delete mode 100644 www/app/api/models/UserInfo.ts delete mode 100644 www/app/api/models/ValidationError.ts delete mode 100644 www/app/api/models/Word.ts create mode 100644 www/app/api/schemas.gen.ts delete mode 100644 www/app/api/schemas/$AudioWaveform.ts delete mode 100644 www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts delete mode 100644 www/app/api/schemas/$CreateParticipant.ts delete mode 100644 www/app/api/schemas/$CreateTranscript.ts delete mode 100644 www/app/api/schemas/$DeletionStatus.ts delete mode 100644 www/app/api/schemas/$GetTranscript.ts delete mode 100644 www/app/api/schemas/$GetTranscriptSegmentTopic.ts delete mode 100644 www/app/api/schemas/$GetTranscriptTopic.ts delete mode 100644 www/app/api/schemas/$GetTranscriptTopicWithWords.ts delete mode 100644 www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts delete mode 100644 www/app/api/schemas/$HTTPValidationError.ts delete mode 100644 www/app/api/schemas/$Page_GetTranscript_.ts delete mode 100644 www/app/api/schemas/$Participant.ts delete mode 100644 www/app/api/schemas/$RtcOffer.ts delete mode 100644 www/app/api/schemas/$SpeakerAssignment.ts delete mode 100644 www/app/api/schemas/$SpeakerAssignmentStatus.ts delete mode 100644 www/app/api/schemas/$SpeakerMerge.ts delete mode 100644 www/app/api/schemas/$SpeakerWords.ts delete mode 100644 www/app/api/schemas/$TranscriptParticipant.ts delete mode 100644 www/app/api/schemas/$UpdateParticipant.ts delete mode 100644 www/app/api/schemas/$UpdateTranscript.ts delete mode 100644 www/app/api/schemas/$UserInfo.ts delete mode 100644 www/app/api/schemas/$ValidationError.ts delete mode 100644 www/app/api/schemas/$Word.ts create mode 100644 www/app/api/services.gen.ts delete mode 100644 www/app/api/services/DefaultService.ts create mode 100644 www/app/api/types.gen.ts create mode 100644 www/openapi-ts.config.ts diff --git a/www/app/api/OpenApi.ts b/www/app/api/OpenApi.ts index 19cbbf31..23cc35f3 100644 --- a/www/app/api/OpenApi.ts +++ b/www/app/api/OpenApi.ts @@ -1,8 +1,9 @@ import type { BaseHttpRequest } from "./core/BaseHttpRequest"; import type { OpenAPIConfig } from "./core/OpenAPI"; +import { Interceptors } from "./core/OpenAPI"; import { AxiosHttpRequest } from "./core/AxiosHttpRequest"; -import { DefaultService } from "./services/DefaultService"; +import { DefaultService } from "./services.gen"; type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; @@ -25,6 +26,10 @@ export class OpenApi { PASSWORD: config?.PASSWORD, HEADERS: config?.HEADERS, ENCODE_PATH: config?.ENCODE_PATH, + interceptors: { + request: config?.interceptors?.request ?? new Interceptors(), + response: config?.interceptors?.response ?? new Interceptors(), + }, }); this.default = new DefaultService(this.request); diff --git a/www/app/api/core/ApiRequestOptions.ts b/www/app/api/core/ApiRequestOptions.ts index 28e1917c..57fbb095 100644 --- a/www/app/api/core/ApiRequestOptions.ts +++ b/www/app/api/core/ApiRequestOptions.ts @@ -1,4 +1,4 @@ -export type ApiRequestOptions = { +export type ApiRequestOptions = { readonly method: | "GET" | "PUT" @@ -16,5 +16,6 @@ export type ApiRequestOptions = { readonly body?: any; readonly mediaType?: string; readonly responseHeader?: string; - readonly errors?: Record; + readonly responseTransformer?: (data: unknown) => Promise; + readonly errors?: Record; }; diff --git a/www/app/api/core/AxiosHttpRequest.ts b/www/app/api/core/AxiosHttpRequest.ts index 5cd27cda..aba5096e 100644 --- a/www/app/api/core/AxiosHttpRequest.ts +++ b/www/app/api/core/AxiosHttpRequest.ts @@ -15,7 +15,9 @@ export class AxiosHttpRequest extends BaseHttpRequest { * @returns CancelablePromise * @throws ApiError */ - public override request(options: ApiRequestOptions): CancelablePromise { + public override request( + options: ApiRequestOptions, + ): CancelablePromise { return __request(this.config, options); } } diff --git a/www/app/api/core/BaseHttpRequest.ts b/www/app/api/core/BaseHttpRequest.ts index cf68a62a..3f89861c 100644 --- a/www/app/api/core/BaseHttpRequest.ts +++ b/www/app/api/core/BaseHttpRequest.ts @@ -5,5 +5,7 @@ import type { OpenAPIConfig } from "./OpenAPI"; export abstract class BaseHttpRequest { constructor(public readonly config: OpenAPIConfig) {} - public abstract request(options: ApiRequestOptions): CancelablePromise; + public abstract request( + options: ApiRequestOptions, + ): CancelablePromise; } diff --git a/www/app/api/core/CancelablePromise.ts b/www/app/api/core/CancelablePromise.ts index b1ebd8ca..0640e989 100644 --- a/www/app/api/core/CancelablePromise.ts +++ b/www/app/api/core/CancelablePromise.ts @@ -18,13 +18,13 @@ export interface OnCancel { } export class CancelablePromise implements Promise { - #isResolved: boolean; - #isRejected: boolean; - #isCancelled: boolean; - readonly #cancelHandlers: (() => void)[]; - readonly #promise: Promise; - #resolve?: (value: T | PromiseLike) => void; - #reject?: (reason?: unknown) => void; + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; constructor( executor: ( @@ -33,47 +33,47 @@ export class CancelablePromise implements Promise { onCancel: OnCancel, ) => void, ) { - this.#isResolved = false; - this.#isRejected = false; - this.#isCancelled = false; - this.#cancelHandlers = []; - this.#promise = new Promise((resolve, reject) => { - this.#resolve = resolve; - this.#reject = reject; + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; const onResolve = (value: T | PromiseLike): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#isResolved = true; - if (this.#resolve) this.#resolve(value); + this._isResolved = true; + if (this._resolve) this._resolve(value); }; const onReject = (reason?: unknown): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#isRejected = true; - if (this.#reject) this.#reject(reason); + this._isRejected = true; + if (this._reject) this._reject(reason); }; const onCancel = (cancelHandler: () => void): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#cancelHandlers.push(cancelHandler); + this.cancelHandlers.push(cancelHandler); }; Object.defineProperty(onCancel, "isResolved", { - get: (): boolean => this.#isResolved, + get: (): boolean => this._isResolved, }); Object.defineProperty(onCancel, "isRejected", { - get: (): boolean => this.#isRejected, + get: (): boolean => this._isRejected, }); Object.defineProperty(onCancel, "isCancelled", { - get: (): boolean => this.#isCancelled, + get: (): boolean => this._isCancelled, }); return executor(onResolve, onReject, onCancel as OnCancel); @@ -88,27 +88,27 @@ export class CancelablePromise implements Promise { onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null, ): Promise { - return this.#promise.then(onFulfilled, onRejected); + return this.promise.then(onFulfilled, onRejected); } public catch( onRejected?: ((reason: unknown) => TResult | PromiseLike) | null, ): Promise { - return this.#promise.catch(onRejected); + return this.promise.catch(onRejected); } public finally(onFinally?: (() => void) | null): Promise { - return this.#promise.finally(onFinally); + return this.promise.finally(onFinally); } public cancel(): void { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#isCancelled = true; - if (this.#cancelHandlers.length) { + this._isCancelled = true; + if (this.cancelHandlers.length) { try { - for (const cancelHandler of this.#cancelHandlers) { + for (const cancelHandler of this.cancelHandlers) { cancelHandler(); } } catch (error) { @@ -116,11 +116,11 @@ export class CancelablePromise implements Promise { return; } } - this.#cancelHandlers.length = 0; - if (this.#reject) this.#reject(new CancelError("Request aborted")); + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError("Request aborted")); } public get isCancelled(): boolean { - return this.#isCancelled; + return this._isCancelled; } } diff --git a/www/app/api/core/OpenAPI.ts b/www/app/api/core/OpenAPI.ts index 2749e631..20ea0ed9 100644 --- a/www/app/api/core/OpenAPI.ts +++ b/www/app/api/core/OpenAPI.ts @@ -1,8 +1,28 @@ +import type { AxiosRequestConfig, AxiosResponse } from "axios"; import type { ApiRequestOptions } from "./ApiRequestOptions"; -import type { TConfig, TResult } from "./types"; -type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn]; + } +} export type OpenAPIConfig = { BASE: string; @@ -10,11 +30,14 @@ export type OpenAPIConfig = { ENCODE_PATH?: ((path: string) => string) | undefined; HEADERS?: Headers | Resolver | undefined; PASSWORD?: string | Resolver | undefined; - RESULT?: TResult; TOKEN?: string | Resolver | undefined; USERNAME?: string | Resolver | undefined; VERSION: string; WITH_CREDENTIALS: boolean; + interceptors: { + request: Interceptors; + response: Interceptors; + }; }; export const OpenAPI: OpenAPIConfig = { @@ -23,26 +46,12 @@ export const OpenAPI: OpenAPIConfig = { ENCODE_PATH: undefined, HEADERS: undefined, PASSWORD: undefined, - RESULT: "body", TOKEN: undefined, USERNAME: undefined, VERSION: "0.1.0", WITH_CREDENTIALS: false, -}; - -export const mergeOpenApiConfig = ( - config: OpenAPIConfig, - overrides: TConfig, -) => { - const merged = { ...config }; - Object.entries(overrides) - .filter(([key]) => key.startsWith("_")) - .forEach(([key, value]) => { - const k = key.slice(1).toLocaleUpperCase() as keyof typeof merged; - if (merged.hasOwnProperty(k)) { - // @ts-ignore - merged[k] = value; - } - }); - return merged; + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, }; diff --git a/www/app/api/core/request.ts b/www/app/api/core/request.ts index c750d804..b576207e 100644 --- a/www/app/api/core/request.ts +++ b/www/app/api/core/request.ts @@ -5,7 +5,6 @@ import type { AxiosResponse, AxiosInstance, } from "axios"; -import FormData from "form-data"; import { ApiError } from "./ApiError"; import type { ApiRequestOptions } from "./ApiRequestOptions"; @@ -23,18 +22,7 @@ export const isStringWithValue = (value: unknown): value is string => { }; export const isBlob = (value: any): value is Blob => { - return ( - value !== null && - 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) && - // @ts-ignore - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); + return value instanceof Blob; }; export const isFormData = (value: unknown): value is FormData => { @@ -66,7 +54,9 @@ export const getQueryString = (params: Record): string => { return; } - if (Array.isArray(value)) { + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { value.forEach((v) => encodePair(key, v)); } else if (typeof value === "object") { Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); @@ -102,7 +92,7 @@ export const getFormData = ( if (options.formData) { const formData = new FormData(); - const process = (key: string, value: any) => { + const process = (key: string, value: unknown) => { if (isString(value) || isBlob(value)) { formData.append(key, value); } else { @@ -111,7 +101,7 @@ export const getFormData = ( }; Object.entries(options.formData) - .filter(([_, value]) => value !== undefined && value !== null) + .filter(([, value]) => value !== undefined && value !== null) .forEach(([key, value]) => { if (Array.isArray(value)) { value.forEach((v) => process(key, v)); @@ -125,10 +115,10 @@ export const getFormData = ( return undefined; }; -type Resolver = (options: ApiRequestOptions) => Promise; +type Resolver = (options: ApiRequestOptions) => Promise; export const resolve = async ( - options: ApiRequestOptions, + options: ApiRequestOptions, resolver?: T | Resolver, ): Promise => { if (typeof resolver === "function") { @@ -137,29 +127,27 @@ export const resolve = async ( return resolver; }; -export const getHeaders = async ( +export const getHeaders = async ( config: OpenAPIConfig, - options: ApiRequestOptions, - formData?: FormData, + options: ApiRequestOptions, ): Promise> => { const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore resolve(options, config.TOKEN), + // @ts-ignore resolve(options, config.USERNAME), + // @ts-ignore resolve(options, config.PASSWORD), + // @ts-ignore resolve(options, config.HEADERS), ]); - const formHeaders = - (typeof formData?.getHeaders === "function" && formData?.getHeaders()) || - {}; - const headers = Object.entries({ Accept: "application/json", ...additionalHeaders, ...options.headers, - ...formHeaders, }) - .filter(([_, value]) => value !== undefined && value !== null) + .filter(([, value]) => value !== undefined && value !== null) .reduce( (headers, [key, value]) => ({ ...headers, @@ -187,6 +175,10 @@ export const getHeaders = async ( } else if (!isFormData(options.body)) { headers["Content-Type"] = "application/json"; } + } else if (options.formData !== undefined) { + if (options.mediaType) { + headers["Content-Type"] = options.mediaType; + } } return headers; @@ -201,7 +193,7 @@ export const getRequestBody = (options: ApiRequestOptions): unknown => { export const sendRequest = async ( config: OpenAPIConfig, - options: ApiRequestOptions, + options: ApiRequestOptions, url: string, body: unknown, formData: FormData | undefined, @@ -211,17 +203,21 @@ export const sendRequest = async ( ): Promise> => { const controller = new AbortController(); - const requestConfig: AxiosRequestConfig = { - url, - headers, + let requestConfig: AxiosRequestConfig = { data: body ?? formData, + headers, method: options.method, - withCredentials: config.WITH_CREDENTIALS, signal: controller.signal, + url, + withCredentials: config.WITH_CREDENTIALS, }; onCancel(() => controller.abort()); + for (const fn of config.interceptors.request._fns) { + requestConfig = await fn(requestConfig); + } + try { return await axiosClient.request(requestConfig); } catch (error) { @@ -260,11 +256,44 @@ export const catchErrorCodes = ( const errors: Record = { 400: "Bad Request", 401: "Unauthorized", + 402: "Payment Required", 403: "Forbidden", 404: "Not Found", + 405: "Method Not Allowed", + 406: "Not Acceptable", + 407: "Proxy Authentication Required", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 412: "Precondition Failed", + 413: "Payload Too Large", + 414: "URI Too Long", + 415: "Unsupported Media Type", + 416: "Range Not Satisfiable", + 417: "Expectation Failed", + 418: "Im a teapot", + 421: "Misdirected Request", + 422: "Unprocessable Content", + 423: "Locked", + 424: "Failed Dependency", + 425: "Too Early", + 426: "Upgrade Required", + 428: "Precondition Required", + 429: "Too Many Requests", + 431: "Request Header Fields Too Large", + 451: "Unavailable For Legal Reasons", 500: "Internal Server Error", + 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", + 504: "Gateway Timeout", + 505: "HTTP Version Not Supported", + 506: "Variant Also Negotiates", + 507: "Insufficient Storage", + 508: "Loop Detected", + 510: "Not Extended", + 511: "Network Authentication Required", ...options.errors, }; @@ -302,7 +331,7 @@ export const catchErrorCodes = ( */ export const request = ( config: OpenAPIConfig, - options: ApiRequestOptions, + options: ApiRequestOptions, axiosClient: AxiosInstance = axios, ): CancelablePromise => { return new CancelablePromise(async (resolve, reject, onCancel) => { @@ -310,10 +339,10 @@ export const request = ( const url = getUrl(config, options); const formData = getFormData(options); const body = getRequestBody(options); - const headers = await getHeaders(config, options, formData); + const headers = await getHeaders(config, options); if (!onCancel.isCancelled) { - const response = await sendRequest( + let response = await sendRequest( config, options, url, @@ -323,18 +352,28 @@ export const request = ( onCancel, axiosClient, ); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + const responseBody = getResponseBody(response); const responseHeader = getResponseHeader( response, options.responseHeader, ); + let transformedBody = responseBody; + if (options.responseTransformer && isSuccess(response.status)) { + transformedBody = await options.responseTransformer(responseBody); + } + const result: ApiResult = { url, ok: isSuccess(response.status), status: response.status, statusText: response.statusText, - body: responseHeader ?? responseBody, + body: responseHeader ?? transformedBody, }; catchErrorCodes(options, result); diff --git a/www/app/api/core/types.ts b/www/app/api/core/types.ts deleted file mode 100644 index 8e915c44..00000000 --- a/www/app/api/core/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ApiResult } from "./ApiResult"; - -export type TResult = "body" | "raw"; - -export type TApiResponse = Exclude< - T, - "raw" -> extends never - ? ApiResult - : ApiResult["body"]; - -export type TConfig = { - _result?: T; -}; diff --git a/www/app/api/index.ts b/www/app/api/index.ts index 0d54a439..27fbb57d 100644 --- a/www/app/api/index.ts +++ b/www/app/api/index.ts @@ -1,59 +1,9 @@ +// This file is auto-generated by @hey-api/openapi-ts 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 { $AudioWaveform } from "./schemas/$AudioWaveform"; -export { $Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post } from "./schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post"; -export { $CreateParticipant } from "./schemas/$CreateParticipant"; -export { $CreateTranscript } from "./schemas/$CreateTranscript"; -export { $DeletionStatus } from "./schemas/$DeletionStatus"; -export { $GetTranscript } from "./schemas/$GetTranscript"; -export { $GetTranscriptSegmentTopic } from "./schemas/$GetTranscriptSegmentTopic"; -export { $GetTranscriptTopic } from "./schemas/$GetTranscriptTopic"; -export { $GetTranscriptTopicWithWords } from "./schemas/$GetTranscriptTopicWithWords"; -export { $GetTranscriptTopicWithWordsPerSpeaker } from "./schemas/$GetTranscriptTopicWithWordsPerSpeaker"; -export { $HTTPValidationError } from "./schemas/$HTTPValidationError"; -export { $Page_GetTranscript_ } from "./schemas/$Page_GetTranscript_"; -export { $Participant } from "./schemas/$Participant"; -export { $RtcOffer } from "./schemas/$RtcOffer"; -export { $SpeakerAssignment } from "./schemas/$SpeakerAssignment"; -export { $SpeakerAssignmentStatus } from "./schemas/$SpeakerAssignmentStatus"; -export { $SpeakerMerge } from "./schemas/$SpeakerMerge"; -export { $SpeakerWords } from "./schemas/$SpeakerWords"; -export { $TranscriptParticipant } from "./schemas/$TranscriptParticipant"; -export { $UpdateParticipant } from "./schemas/$UpdateParticipant"; -export { $UpdateTranscript } from "./schemas/$UpdateTranscript"; -export { $UserInfo } from "./schemas/$UserInfo"; -export { $ValidationError } from "./schemas/$ValidationError"; -export { $Word } from "./schemas/$Word"; - -export { DefaultService } from "./services/DefaultService"; +export { OpenAPI, type OpenAPIConfig } from "./core/OpenAPI"; +export * from "./schemas.gen"; +export * from "./services.gen"; +export * from "./types.gen"; diff --git a/www/app/api/models/AudioWaveform.ts b/www/app/api/models/AudioWaveform.ts deleted file mode 100644 index 60dd57ec..00000000 --- a/www/app/api/models/AudioWaveform.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type AudioWaveform = { - data: Array; -}; diff --git a/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts b/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts deleted file mode 100644 index b313fa1b..00000000 --- a/www/app/api/models/Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = - { - file: Blob; - }; diff --git a/www/app/api/models/CreateParticipant.ts b/www/app/api/models/CreateParticipant.ts deleted file mode 100644 index 0d7f1950..00000000 --- a/www/app/api/models/CreateParticipant.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type CreateParticipant = { - speaker?: number | null; - name: string; -}; diff --git a/www/app/api/models/CreateTranscript.ts b/www/app/api/models/CreateTranscript.ts deleted file mode 100644 index 32fd6a1b..00000000 --- a/www/app/api/models/CreateTranscript.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type CreateTranscript = { - name: string; - source_language?: string; - target_language?: string; -}; diff --git a/www/app/api/models/DeletionStatus.ts b/www/app/api/models/DeletionStatus.ts deleted file mode 100644 index 9bd016e0..00000000 --- a/www/app/api/models/DeletionStatus.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type DeletionStatus = { - status: string; -}; diff --git a/www/app/api/models/GetTranscript.ts b/www/app/api/models/GetTranscript.ts deleted file mode 100644 index b755d62a..00000000 --- a/www/app/api/models/GetTranscript.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { TranscriptParticipant } from "./TranscriptParticipant"; - -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 | null; - reviewed: boolean; -}; diff --git a/www/app/api/models/GetTranscriptSegmentTopic.ts b/www/app/api/models/GetTranscriptSegmentTopic.ts deleted file mode 100644 index bba84fb7..00000000 --- a/www/app/api/models/GetTranscriptSegmentTopic.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type GetTranscriptSegmentTopic = { - text: string; - start: number; - speaker: number; -}; diff --git a/www/app/api/models/GetTranscriptTopic.ts b/www/app/api/models/GetTranscriptTopic.ts deleted file mode 100644 index 808c825a..00000000 --- a/www/app/api/models/GetTranscriptTopic.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; - -export type GetTranscriptTopic = { - id: string; - title: string; - summary: string; - timestamp: number; - duration: number | null; - transcript: string; - segments?: Array; -}; diff --git a/www/app/api/models/GetTranscriptTopicWithWords.ts b/www/app/api/models/GetTranscriptTopicWithWords.ts deleted file mode 100644 index ffc0cd5f..00000000 --- a/www/app/api/models/GetTranscriptTopicWithWords.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; -import type { Word } from "./Word"; - -export type GetTranscriptTopicWithWords = { - id: string; - title: string; - summary: string; - timestamp: number; - duration: number | null; - transcript: string; - segments?: Array; - words?: Array; -}; diff --git a/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts b/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts deleted file mode 100644 index c77bfe9a..00000000 --- a/www/app/api/models/GetTranscriptTopicWithWordsPerSpeaker.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic"; -import type { SpeakerWords } from "./SpeakerWords"; - -export type GetTranscriptTopicWithWordsPerSpeaker = { - id: string; - title: string; - summary: string; - timestamp: number; - duration: number | null; - transcript: string; - segments?: Array; - words_per_speaker?: Array; -}; diff --git a/www/app/api/models/HTTPValidationError.ts b/www/app/api/models/HTTPValidationError.ts deleted file mode 100644 index e12e0ef9..00000000 --- a/www/app/api/models/HTTPValidationError.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ValidationError } from "./ValidationError"; - -export type HTTPValidationError = { - detail?: Array; -}; diff --git a/www/app/api/models/Page_GetTranscript_.ts b/www/app/api/models/Page_GetTranscript_.ts deleted file mode 100644 index bff594b2..00000000 --- a/www/app/api/models/Page_GetTranscript_.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { GetTranscript } from "./GetTranscript"; - -export type Page_GetTranscript_ = { - items: Array; - total: number; - page: number | null; - size: number | null; - pages?: number | null; -}; diff --git a/www/app/api/models/Participant.ts b/www/app/api/models/Participant.ts deleted file mode 100644 index 90b07edf..00000000 --- a/www/app/api/models/Participant.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type Participant = { - id: string; - speaker: number | null; - name: string; -}; diff --git a/www/app/api/models/RtcOffer.ts b/www/app/api/models/RtcOffer.ts deleted file mode 100644 index 38d0e205..00000000 --- a/www/app/api/models/RtcOffer.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type RtcOffer = { - sdp: string; - type: string; -}; diff --git a/www/app/api/models/SpeakerAssignment.ts b/www/app/api/models/SpeakerAssignment.ts deleted file mode 100644 index 3ba7c28a..00000000 --- a/www/app/api/models/SpeakerAssignment.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type SpeakerAssignment = { - speaker?: number | null; - participant?: string | null; - timestamp_from: number; - timestamp_to: number; -}; diff --git a/www/app/api/models/SpeakerAssignmentStatus.ts b/www/app/api/models/SpeakerAssignmentStatus.ts deleted file mode 100644 index 645cd97d..00000000 --- a/www/app/api/models/SpeakerAssignmentStatus.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type SpeakerAssignmentStatus = { - status: string; -}; diff --git a/www/app/api/models/SpeakerMerge.ts b/www/app/api/models/SpeakerMerge.ts deleted file mode 100644 index 8c0c9df2..00000000 --- a/www/app/api/models/SpeakerMerge.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type SpeakerMerge = { - speaker_from: number; - speaker_to: number; -}; diff --git a/www/app/api/models/SpeakerWords.ts b/www/app/api/models/SpeakerWords.ts deleted file mode 100644 index 22e5d490..00000000 --- a/www/app/api/models/SpeakerWords.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Word } from "./Word"; - -export type SpeakerWords = { - speaker: number; - words: Array; -}; diff --git a/www/app/api/models/TranscriptParticipant.ts b/www/app/api/models/TranscriptParticipant.ts deleted file mode 100644 index 77c0479d..00000000 --- a/www/app/api/models/TranscriptParticipant.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type TranscriptParticipant = { - id?: string; - speaker: number | null; - name: string; -}; diff --git a/www/app/api/models/UpdateParticipant.ts b/www/app/api/models/UpdateParticipant.ts deleted file mode 100644 index 86bec423..00000000 --- a/www/app/api/models/UpdateParticipant.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type UpdateParticipant = { - speaker?: number | null; - name?: string | null; -}; diff --git a/www/app/api/models/UpdateTranscript.ts b/www/app/api/models/UpdateTranscript.ts deleted file mode 100644 index 824e5edb..00000000 --- a/www/app/api/models/UpdateTranscript.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { TranscriptParticipant } from "./TranscriptParticipant"; - -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 | null; - reviewed?: boolean | null; -}; diff --git a/www/app/api/models/UserInfo.ts b/www/app/api/models/UserInfo.ts deleted file mode 100644 index ad05efae..00000000 --- a/www/app/api/models/UserInfo.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type UserInfo = { - sub: string; - email: string | null; - email_verified: boolean | null; -}; diff --git a/www/app/api/models/ValidationError.ts b/www/app/api/models/ValidationError.ts deleted file mode 100644 index 03252ff0..00000000 --- a/www/app/api/models/ValidationError.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type ValidationError = { - loc: Array; - msg: string; - type: string; -}; diff --git a/www/app/api/models/Word.ts b/www/app/api/models/Word.ts deleted file mode 100644 index be83d3e1..00000000 --- a/www/app/api/models/Word.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type Word = { - text: string; - start: number; - end: number; - speaker?: number; -}; diff --git a/www/app/api/schemas.gen.ts b/www/app/api/schemas.gen.ts new file mode 100644 index 00000000..01e3f6ba --- /dev/null +++ b/www/app/api/schemas.gen.ts @@ -0,0 +1,845 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const $AudioWaveform = { + properties: { + data: { + items: { + type: "number", + }, + type: "array", + title: "Data", + }, + }, + type: "object", + required: ["data"], + title: "AudioWaveform", +} as const; + +export const $Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = + { + properties: { + file: { + type: "string", + format: "binary", + title: "File", + }, + }, + type: "object", + required: ["file"], + title: + "Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post", + } as const; + +export const $CreateParticipant = { + properties: { + speaker: { + anyOf: [ + { + type: "integer", + }, + { + type: "null", + }, + ], + title: "Speaker", + }, + name: { + type: "string", + title: "Name", + }, + }, + type: "object", + required: ["name"], + title: "CreateParticipant", +} as const; + +export const $CreateTranscript = { + properties: { + name: { + type: "string", + title: "Name", + }, + source_language: { + type: "string", + title: "Source Language", + default: "en", + }, + target_language: { + type: "string", + title: "Target Language", + default: "en", + }, + }, + type: "object", + required: ["name"], + title: "CreateTranscript", +} as const; + +export const $DeletionStatus = { + properties: { + status: { + type: "string", + title: "Status", + }, + }, + type: "object", + required: ["status"], + title: "DeletionStatus", +} as const; + +export const $GetTranscript = { + properties: { + id: { + type: "string", + title: "Id", + }, + user_id: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "User Id", + }, + name: { + type: "string", + title: "Name", + }, + status: { + type: "string", + title: "Status", + }, + locked: { + type: "boolean", + title: "Locked", + }, + duration: { + type: "number", + title: "Duration", + }, + title: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Title", + }, + short_summary: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Short Summary", + }, + long_summary: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Long Summary", + }, + created_at: { + type: "string", + format: "date-time", + title: "Created At", + }, + share_mode: { + type: "string", + title: "Share Mode", + default: "private", + }, + source_language: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Source Language", + }, + target_language: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Target Language", + }, + participants: { + anyOf: [ + { + items: { + $ref: "#/components/schemas/TranscriptParticipant", + }, + type: "array", + }, + { + type: "null", + }, + ], + title: "Participants", + }, + reviewed: { + type: "boolean", + title: "Reviewed", + }, + }, + type: "object", + required: [ + "id", + "user_id", + "name", + "status", + "locked", + "duration", + "title", + "short_summary", + "long_summary", + "created_at", + "source_language", + "target_language", + "participants", + "reviewed", + ], + title: "GetTranscript", +} as const; + +export const $GetTranscriptSegmentTopic = { + properties: { + text: { + type: "string", + title: "Text", + }, + start: { + type: "number", + title: "Start", + }, + speaker: { + type: "integer", + title: "Speaker", + }, + }, + type: "object", + required: ["text", "start", "speaker"], + title: "GetTranscriptSegmentTopic", +} as const; + +export const $GetTranscriptTopic = { + properties: { + id: { + type: "string", + title: "Id", + }, + title: { + type: "string", + title: "Title", + }, + summary: { + type: "string", + title: "Summary", + }, + timestamp: { + type: "number", + title: "Timestamp", + }, + duration: { + anyOf: [ + { + type: "number", + }, + { + type: "null", + }, + ], + title: "Duration", + }, + transcript: { + type: "string", + title: "Transcript", + }, + segments: { + items: { + $ref: "#/components/schemas/GetTranscriptSegmentTopic", + }, + type: "array", + title: "Segments", + default: [], + }, + }, + type: "object", + required: ["id", "title", "summary", "timestamp", "duration", "transcript"], + title: "GetTranscriptTopic", +} as const; + +export const $GetTranscriptTopicWithWords = { + properties: { + id: { + type: "string", + title: "Id", + }, + title: { + type: "string", + title: "Title", + }, + summary: { + type: "string", + title: "Summary", + }, + timestamp: { + type: "number", + title: "Timestamp", + }, + duration: { + anyOf: [ + { + type: "number", + }, + { + type: "null", + }, + ], + title: "Duration", + }, + transcript: { + type: "string", + title: "Transcript", + }, + segments: { + items: { + $ref: "#/components/schemas/GetTranscriptSegmentTopic", + }, + type: "array", + title: "Segments", + default: [], + }, + words: { + items: { + $ref: "#/components/schemas/Word", + }, + type: "array", + title: "Words", + default: [], + }, + }, + type: "object", + required: ["id", "title", "summary", "timestamp", "duration", "transcript"], + title: "GetTranscriptTopicWithWords", +} as const; + +export const $GetTranscriptTopicWithWordsPerSpeaker = { + properties: { + id: { + type: "string", + title: "Id", + }, + title: { + type: "string", + title: "Title", + }, + summary: { + type: "string", + title: "Summary", + }, + timestamp: { + type: "number", + title: "Timestamp", + }, + duration: { + anyOf: [ + { + type: "number", + }, + { + type: "null", + }, + ], + title: "Duration", + }, + transcript: { + type: "string", + title: "Transcript", + }, + segments: { + items: { + $ref: "#/components/schemas/GetTranscriptSegmentTopic", + }, + type: "array", + title: "Segments", + default: [], + }, + words_per_speaker: { + items: { + $ref: "#/components/schemas/SpeakerWords", + }, + type: "array", + title: "Words Per Speaker", + default: [], + }, + }, + type: "object", + required: ["id", "title", "summary", "timestamp", "duration", "transcript"], + title: "GetTranscriptTopicWithWordsPerSpeaker", +} as const; + +export const $HTTPValidationError = { + properties: { + detail: { + items: { + $ref: "#/components/schemas/ValidationError", + }, + type: "array", + title: "Detail", + }, + }, + type: "object", + title: "HTTPValidationError", +} as const; + +export const $Page_GetTranscript_ = { + properties: { + items: { + items: { + $ref: "#/components/schemas/GetTranscript", + }, + type: "array", + title: "Items", + }, + total: { + type: "integer", + minimum: 0, + title: "Total", + }, + page: { + anyOf: [ + { + type: "integer", + minimum: 1, + }, + { + type: "null", + }, + ], + title: "Page", + }, + size: { + anyOf: [ + { + type: "integer", + minimum: 1, + }, + { + type: "null", + }, + ], + title: "Size", + }, + pages: { + anyOf: [ + { + type: "integer", + minimum: 0, + }, + { + type: "null", + }, + ], + title: "Pages", + }, + }, + type: "object", + required: ["items", "total", "page", "size"], + title: "Page[GetTranscript]", +} as const; + +export const $Participant = { + properties: { + id: { + type: "string", + title: "Id", + }, + speaker: { + anyOf: [ + { + type: "integer", + }, + { + type: "null", + }, + ], + title: "Speaker", + }, + name: { + type: "string", + title: "Name", + }, + }, + type: "object", + required: ["id", "speaker", "name"], + title: "Participant", +} as const; + +export const $RtcOffer = { + properties: { + sdp: { + type: "string", + title: "Sdp", + }, + type: { + type: "string", + title: "Type", + }, + }, + type: "object", + required: ["sdp", "type"], + title: "RtcOffer", +} as const; + +export const $SpeakerAssignment = { + properties: { + speaker: { + anyOf: [ + { + type: "integer", + minimum: 0, + }, + { + type: "null", + }, + ], + title: "Speaker", + }, + participant: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Participant", + }, + timestamp_from: { + type: "number", + title: "Timestamp From", + }, + timestamp_to: { + type: "number", + title: "Timestamp To", + }, + }, + type: "object", + required: ["timestamp_from", "timestamp_to"], + title: "SpeakerAssignment", +} as const; + +export const $SpeakerAssignmentStatus = { + properties: { + status: { + type: "string", + title: "Status", + }, + }, + type: "object", + required: ["status"], + title: "SpeakerAssignmentStatus", +} as const; + +export const $SpeakerMerge = { + properties: { + speaker_from: { + type: "integer", + title: "Speaker From", + }, + speaker_to: { + type: "integer", + title: "Speaker To", + }, + }, + type: "object", + required: ["speaker_from", "speaker_to"], + title: "SpeakerMerge", +} as const; + +export const $SpeakerWords = { + properties: { + speaker: { + type: "integer", + title: "Speaker", + }, + words: { + items: { + $ref: "#/components/schemas/Word", + }, + type: "array", + title: "Words", + }, + }, + type: "object", + required: ["speaker", "words"], + title: "SpeakerWords", +} as const; + +export const $TranscriptParticipant = { + properties: { + id: { + type: "string", + title: "Id", + }, + speaker: { + anyOf: [ + { + type: "integer", + }, + { + type: "null", + }, + ], + title: "Speaker", + }, + name: { + type: "string", + title: "Name", + }, + }, + type: "object", + required: ["speaker", "name"], + title: "TranscriptParticipant", +} as const; + +export const $UpdateParticipant = { + properties: { + speaker: { + anyOf: [ + { + type: "integer", + }, + { + type: "null", + }, + ], + title: "Speaker", + }, + name: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Name", + }, + }, + type: "object", + title: "UpdateParticipant", +} as const; + +export const $UpdateTranscript = { + properties: { + name: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Name", + }, + locked: { + anyOf: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], + title: "Locked", + }, + title: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Title", + }, + short_summary: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Short Summary", + }, + long_summary: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Long Summary", + }, + share_mode: { + anyOf: [ + { + type: "string", + enum: ["public", "semi-private", "private"], + }, + { + type: "null", + }, + ], + title: "Share Mode", + }, + participants: { + anyOf: [ + { + items: { + $ref: "#/components/schemas/TranscriptParticipant", + }, + type: "array", + }, + { + type: "null", + }, + ], + title: "Participants", + }, + reviewed: { + anyOf: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], + title: "Reviewed", + }, + }, + type: "object", + title: "UpdateTranscript", +} as const; + +export const $UserInfo = { + properties: { + sub: { + type: "string", + title: "Sub", + }, + email: { + anyOf: [ + { + type: "string", + }, + { + type: "null", + }, + ], + title: "Email", + }, + email_verified: { + anyOf: [ + { + type: "boolean", + }, + { + type: "null", + }, + ], + title: "Email Verified", + }, + }, + type: "object", + required: ["sub", "email", "email_verified"], + title: "UserInfo", +} as const; + +export const $ValidationError = { + properties: { + loc: { + items: { + anyOf: [ + { + type: "string", + }, + { + type: "integer", + }, + ], + }, + type: "array", + title: "Location", + }, + msg: { + type: "string", + title: "Message", + }, + type: { + type: "string", + title: "Error Type", + }, + }, + type: "object", + required: ["loc", "msg", "type"], + title: "ValidationError", +} as const; + +export const $Word = { + properties: { + text: { + type: "string", + title: "Text", + }, + start: { + type: "number", + title: "Start", + }, + end: { + type: "number", + title: "End", + }, + speaker: { + type: "integer", + title: "Speaker", + default: 0, + }, + }, + type: "object", + required: ["text", "start", "end"], + title: "Word", +} as const; diff --git a/www/app/api/schemas/$AudioWaveform.ts b/www/app/api/schemas/$AudioWaveform.ts deleted file mode 100644 index cfa2964f..00000000 --- a/www/app/api/schemas/$AudioWaveform.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const $AudioWaveform = { - properties: { - data: { - type: "array", - contains: { - type: "number", - }, - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts b/www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts deleted file mode 100644 index 60678cca..00000000 --- a/www/app/api/schemas/$Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const $Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = - { - properties: { - file: { - type: "binary", - isRequired: true, - format: "binary", - }, - }, - } as const; diff --git a/www/app/api/schemas/$CreateParticipant.ts b/www/app/api/schemas/$CreateParticipant.ts deleted file mode 100644 index acb580e8..00000000 --- a/www/app/api/schemas/$CreateParticipant.ts +++ /dev/null @@ -1,19 +0,0 @@ -export const $CreateParticipant = { - properties: { - speaker: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - }, - name: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$CreateTranscript.ts b/www/app/api/schemas/$CreateTranscript.ts deleted file mode 100644 index 5e0baef5..00000000 --- a/www/app/api/schemas/$CreateTranscript.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const $CreateTranscript = { - properties: { - name: { - type: "string", - isRequired: true, - }, - source_language: { - type: "string", - }, - target_language: { - type: "string", - }, - }, -} as const; diff --git a/www/app/api/schemas/$DeletionStatus.ts b/www/app/api/schemas/$DeletionStatus.ts deleted file mode 100644 index a2afbfb6..00000000 --- a/www/app/api/schemas/$DeletionStatus.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const $DeletionStatus = { - properties: { - status: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$GetTranscript.ts b/www/app/api/schemas/$GetTranscript.ts deleted file mode 100644 index 7ff805e7..00000000 --- a/www/app/api/schemas/$GetTranscript.ts +++ /dev/null @@ -1,123 +0,0 @@ -export const $GetTranscript = { - properties: { - id: { - type: "string", - isRequired: true, - }, - user_id: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - name: { - type: "string", - isRequired: true, - }, - status: { - type: "string", - isRequired: true, - }, - locked: { - type: "boolean", - isRequired: true, - }, - duration: { - type: "number", - isRequired: true, - }, - title: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - short_summary: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - long_summary: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - created_at: { - type: "string", - isRequired: true, - format: "date-time", - }, - share_mode: { - type: "string", - }, - source_language: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - target_language: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - participants: { - type: "any-of", - contains: [ - { - type: "array", - contains: { - type: "TranscriptParticipant", - }, - }, - { - type: "null", - }, - ], - isRequired: true, - }, - reviewed: { - type: "boolean", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$GetTranscriptSegmentTopic.ts b/www/app/api/schemas/$GetTranscriptSegmentTopic.ts deleted file mode 100644 index c7cb3cd5..00000000 --- a/www/app/api/schemas/$GetTranscriptSegmentTopic.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const $GetTranscriptSegmentTopic = { - properties: { - text: { - type: "string", - isRequired: true, - }, - start: { - type: "number", - isRequired: true, - }, - speaker: { - type: "number", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$GetTranscriptTopic.ts b/www/app/api/schemas/$GetTranscriptTopic.ts deleted file mode 100644 index 36456769..00000000 --- a/www/app/api/schemas/$GetTranscriptTopic.ts +++ /dev/null @@ -1,42 +0,0 @@ -export const $GetTranscriptTopic = { - properties: { - id: { - type: "string", - isRequired: true, - }, - title: { - type: "string", - isRequired: true, - }, - summary: { - type: "string", - isRequired: true, - }, - timestamp: { - type: "number", - isRequired: true, - }, - duration: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - transcript: { - type: "string", - isRequired: true, - }, - segments: { - type: "array", - contains: { - type: "GetTranscriptSegmentTopic", - }, - }, - }, -} as const; diff --git a/www/app/api/schemas/$GetTranscriptTopicWithWords.ts b/www/app/api/schemas/$GetTranscriptTopicWithWords.ts deleted file mode 100644 index 252ac3cb..00000000 --- a/www/app/api/schemas/$GetTranscriptTopicWithWords.ts +++ /dev/null @@ -1,48 +0,0 @@ -export const $GetTranscriptTopicWithWords = { - properties: { - id: { - type: "string", - isRequired: true, - }, - title: { - type: "string", - isRequired: true, - }, - summary: { - type: "string", - isRequired: true, - }, - timestamp: { - type: "number", - isRequired: true, - }, - duration: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - transcript: { - type: "string", - isRequired: true, - }, - segments: { - type: "array", - contains: { - type: "GetTranscriptSegmentTopic", - }, - }, - words: { - type: "array", - contains: { - type: "Word", - }, - }, - }, -} as const; diff --git a/www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts b/www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts deleted file mode 100644 index 25164f7b..00000000 --- a/www/app/api/schemas/$GetTranscriptTopicWithWordsPerSpeaker.ts +++ /dev/null @@ -1,48 +0,0 @@ -export const $GetTranscriptTopicWithWordsPerSpeaker = { - properties: { - id: { - type: "string", - isRequired: true, - }, - title: { - type: "string", - isRequired: true, - }, - summary: { - type: "string", - isRequired: true, - }, - timestamp: { - type: "number", - isRequired: true, - }, - duration: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - transcript: { - type: "string", - isRequired: true, - }, - segments: { - type: "array", - contains: { - type: "GetTranscriptSegmentTopic", - }, - }, - words_per_speaker: { - type: "array", - contains: { - type: "SpeakerWords", - }, - }, - }, -} as const; diff --git a/www/app/api/schemas/$HTTPValidationError.ts b/www/app/api/schemas/$HTTPValidationError.ts deleted file mode 100644 index dd7ec8af..00000000 --- a/www/app/api/schemas/$HTTPValidationError.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const $HTTPValidationError = { - properties: { - detail: { - type: "array", - contains: { - type: "ValidationError", - }, - }, - }, -} as const; diff --git a/www/app/api/schemas/$Page_GetTranscript_.ts b/www/app/api/schemas/$Page_GetTranscript_.ts deleted file mode 100644 index d692773a..00000000 --- a/www/app/api/schemas/$Page_GetTranscript_.ts +++ /dev/null @@ -1,52 +0,0 @@ -export const $Page_GetTranscript_ = { - properties: { - items: { - type: "array", - contains: { - type: "GetTranscript", - }, - isRequired: true, - }, - total: { - type: "number", - isRequired: true, - }, - page: { - type: "any-of", - contains: [ - { - type: "number", - minimum: 1, - }, - { - type: "null", - }, - ], - isRequired: true, - }, - size: { - type: "any-of", - contains: [ - { - type: "number", - minimum: 1, - }, - { - type: "null", - }, - ], - isRequired: true, - }, - pages: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - }, - }, -} as const; diff --git a/www/app/api/schemas/$Participant.ts b/www/app/api/schemas/$Participant.ts deleted file mode 100644 index 25b6c710..00000000 --- a/www/app/api/schemas/$Participant.ts +++ /dev/null @@ -1,24 +0,0 @@ -export const $Participant = { - properties: { - id: { - type: "string", - isRequired: true, - }, - speaker: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - name: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$RtcOffer.ts b/www/app/api/schemas/$RtcOffer.ts deleted file mode 100644 index b5ec33a1..00000000 --- a/www/app/api/schemas/$RtcOffer.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const $RtcOffer = { - properties: { - sdp: { - type: "string", - isRequired: true, - }, - type: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$SpeakerAssignment.ts b/www/app/api/schemas/$SpeakerAssignment.ts deleted file mode 100644 index 869f407a..00000000 --- a/www/app/api/schemas/$SpeakerAssignment.ts +++ /dev/null @@ -1,34 +0,0 @@ -export const $SpeakerAssignment = { - properties: { - speaker: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - }, - participant: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - }, - timestamp_from: { - type: "number", - isRequired: true, - }, - timestamp_to: { - type: "number", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$SpeakerAssignmentStatus.ts b/www/app/api/schemas/$SpeakerAssignmentStatus.ts deleted file mode 100644 index e8aa81e0..00000000 --- a/www/app/api/schemas/$SpeakerAssignmentStatus.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const $SpeakerAssignmentStatus = { - properties: { - status: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$SpeakerMerge.ts b/www/app/api/schemas/$SpeakerMerge.ts deleted file mode 100644 index fc662b8f..00000000 --- a/www/app/api/schemas/$SpeakerMerge.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const $SpeakerMerge = { - properties: { - speaker_from: { - type: "number", - isRequired: true, - }, - speaker_to: { - type: "number", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$SpeakerWords.ts b/www/app/api/schemas/$SpeakerWords.ts deleted file mode 100644 index a9c45af7..00000000 --- a/www/app/api/schemas/$SpeakerWords.ts +++ /dev/null @@ -1,15 +0,0 @@ -export const $SpeakerWords = { - properties: { - speaker: { - type: "number", - isRequired: true, - }, - words: { - type: "array", - contains: { - type: "Word", - }, - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$TranscriptParticipant.ts b/www/app/api/schemas/$TranscriptParticipant.ts deleted file mode 100644 index d9f16714..00000000 --- a/www/app/api/schemas/$TranscriptParticipant.ts +++ /dev/null @@ -1,23 +0,0 @@ -export const $TranscriptParticipant = { - properties: { - id: { - type: "string", - }, - speaker: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - name: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$UpdateParticipant.ts b/www/app/api/schemas/$UpdateParticipant.ts deleted file mode 100644 index 97352e58..00000000 --- a/www/app/api/schemas/$UpdateParticipant.ts +++ /dev/null @@ -1,26 +0,0 @@ -export const $UpdateParticipant = { - properties: { - speaker: { - type: "any-of", - contains: [ - { - type: "number", - }, - { - type: "null", - }, - ], - }, - name: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - }, - }, -} as const; diff --git a/www/app/api/schemas/$UpdateTranscript.ts b/www/app/api/schemas/$UpdateTranscript.ts deleted file mode 100644 index b3d5fb07..00000000 --- a/www/app/api/schemas/$UpdateTranscript.ts +++ /dev/null @@ -1,95 +0,0 @@ -export const $UpdateTranscript = { - properties: { - name: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - }, - locked: { - type: "any-of", - contains: [ - { - type: "boolean", - }, - { - type: "null", - }, - ], - }, - title: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - }, - short_summary: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - }, - long_summary: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - }, - share_mode: { - type: "any-of", - contains: [ - { - type: "Enum", - }, - { - type: "null", - }, - ], - }, - participants: { - type: "any-of", - contains: [ - { - type: "array", - contains: { - type: "TranscriptParticipant", - }, - }, - { - type: "null", - }, - ], - }, - reviewed: { - type: "any-of", - contains: [ - { - type: "boolean", - }, - { - type: "null", - }, - ], - }, - }, -} as const; diff --git a/www/app/api/schemas/$UserInfo.ts b/www/app/api/schemas/$UserInfo.ts deleted file mode 100644 index b1d406f4..00000000 --- a/www/app/api/schemas/$UserInfo.ts +++ /dev/null @@ -1,32 +0,0 @@ -export const $UserInfo = { - properties: { - sub: { - type: "string", - isRequired: true, - }, - email: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - email_verified: { - type: "any-of", - contains: [ - { - type: "boolean", - }, - { - type: "null", - }, - ], - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$ValidationError.ts b/www/app/api/schemas/$ValidationError.ts deleted file mode 100644 index ee241461..00000000 --- a/www/app/api/schemas/$ValidationError.ts +++ /dev/null @@ -1,27 +0,0 @@ -export const $ValidationError = { - properties: { - loc: { - type: "array", - contains: { - type: "any-of", - contains: [ - { - type: "string", - }, - { - type: "number", - }, - ], - }, - isRequired: true, - }, - msg: { - type: "string", - isRequired: true, - }, - type: { - type: "string", - isRequired: true, - }, - }, -} as const; diff --git a/www/app/api/schemas/$Word.ts b/www/app/api/schemas/$Word.ts deleted file mode 100644 index f69fba99..00000000 --- a/www/app/api/schemas/$Word.ts +++ /dev/null @@ -1,19 +0,0 @@ -export const $Word = { - properties: { - text: { - type: "string", - isRequired: true, - }, - start: { - type: "number", - isRequired: true, - }, - end: { - type: "number", - isRequired: true, - }, - speaker: { - type: "number", - }, - }, -} as const; diff --git a/www/app/api/services.gen.ts b/www/app/api/services.gen.ts new file mode 100644 index 00000000..b546e7b4 --- /dev/null +++ b/www/app/api/services.gen.ts @@ -0,0 +1,579 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from "./core/CancelablePromise"; +import type { BaseHttpRequest } from "./core/BaseHttpRequest"; +import type { + MetricsResponse, + V1TranscriptsListData, + V1TranscriptsListResponse, + V1TranscriptsCreateData, + V1TranscriptsCreateResponse, + V1TranscriptGetData, + V1TranscriptGetResponse, + V1TranscriptUpdateData, + V1TranscriptUpdateResponse, + V1TranscriptDeleteData, + V1TranscriptDeleteResponse, + V1TranscriptGetTopicsData, + V1TranscriptGetTopicsResponse, + V1TranscriptGetTopicsWithWordsData, + V1TranscriptGetTopicsWithWordsResponse, + V1TranscriptGetTopicsWithWordsPerSpeakerData, + V1TranscriptGetTopicsWithWordsPerSpeakerResponse, + V1TranscriptHeadAudioMp3Data, + V1TranscriptHeadAudioMp3Response, + V1TranscriptGetAudioMp3Data, + V1TranscriptGetAudioMp3Response, + V1TranscriptGetAudioWaveformData, + V1TranscriptGetAudioWaveformResponse, + V1TranscriptGetParticipantsData, + V1TranscriptGetParticipantsResponse, + V1TranscriptAddParticipantData, + V1TranscriptAddParticipantResponse, + V1TranscriptGetParticipantData, + V1TranscriptGetParticipantResponse, + V1TranscriptUpdateParticipantData, + V1TranscriptUpdateParticipantResponse, + V1TranscriptDeleteParticipantData, + V1TranscriptDeleteParticipantResponse, + V1TranscriptAssignSpeakerData, + V1TranscriptAssignSpeakerResponse, + V1TranscriptMergeSpeakerData, + V1TranscriptMergeSpeakerResponse, + V1TranscriptRecordUploadData, + V1TranscriptRecordUploadResponse, + V1TranscriptGetWebsocketEventsData, + V1TranscriptGetWebsocketEventsResponse, + V1TranscriptRecordWebrtcData, + V1TranscriptRecordWebrtcResponse, + V1UserMeResponse, +} from "./types.gen"; + +export class DefaultService { + constructor(public readonly httpRequest: BaseHttpRequest) {} + + /** + * Metrics + * Endpoint that serves Prometheus metrics. + * @returns unknown Successful Response + * @throws ApiError + */ + public metrics(): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/metrics", + }); + } + + /** + * Transcripts List + * @param data The data for the request. + * @param data.page Page number + * @param data.size Page size + * @returns Page_GetTranscript_ Successful Response + * @throws ApiError + */ + public v1TranscriptsList( + data: V1TranscriptsListData = {}, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts", + query: { + page: data.page, + size: data.size, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcripts Create + * @param data The data for the request. + * @param data.requestBody + * @returns GetTranscript Successful Response + * @throws ApiError + */ + public v1TranscriptsCreate( + data: V1TranscriptsCreateData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/v1/transcripts", + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get + * @param data The data for the request. + * @param data.transcriptId + * @returns GetTranscript Successful Response + * @throws ApiError + */ + public v1TranscriptGet( + data: V1TranscriptGetData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Update + * @param data The data for the request. + * @param data.transcriptId + * @param data.requestBody + * @returns GetTranscript Successful Response + * @throws ApiError + */ + public v1TranscriptUpdate( + data: V1TranscriptUpdateData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/v1/transcripts/{transcript_id}", + path: { + transcript_id: data.transcriptId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Delete + * @param data The data for the request. + * @param data.transcriptId + * @returns DeletionStatus Successful Response + * @throws ApiError + */ + public v1TranscriptDelete( + data: V1TranscriptDeleteData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/v1/transcripts/{transcript_id}", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Topics + * @param data The data for the request. + * @param data.transcriptId + * @returns GetTranscriptTopic Successful Response + * @throws ApiError + */ + public v1TranscriptGetTopics( + data: V1TranscriptGetTopicsData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/topics", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Topics With Words + * @param data The data for the request. + * @param data.transcriptId + * @returns GetTranscriptTopicWithWords Successful Response + * @throws ApiError + */ + public v1TranscriptGetTopicsWithWords( + data: V1TranscriptGetTopicsWithWordsData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/topics/with-words", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Topics With Words Per Speaker + * @param data The data for the request. + * @param data.transcriptId + * @param data.topicId + * @returns GetTranscriptTopicWithWordsPerSpeaker Successful Response + * @throws ApiError + */ + public v1TranscriptGetTopicsWithWordsPerSpeaker( + data: V1TranscriptGetTopicsWithWordsPerSpeakerData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/topics/{topic_id}/words-per-speaker", + path: { + transcript_id: data.transcriptId, + topic_id: data.topicId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Audio Mp3 + * @param data The data for the request. + * @param data.transcriptId + * @param data.token + * @returns unknown Successful Response + * @throws ApiError + */ + public v1TranscriptHeadAudioMp3( + data: V1TranscriptHeadAudioMp3Data, + ): CancelablePromise { + return this.httpRequest.request({ + method: "HEAD", + url: "/v1/transcripts/{transcript_id}/audio/mp3", + path: { + transcript_id: data.transcriptId, + }, + query: { + token: data.token, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Audio Mp3 + * @param data The data for the request. + * @param data.transcriptId + * @param data.token + * @returns unknown Successful Response + * @throws ApiError + */ + public v1TranscriptGetAudioMp3( + data: V1TranscriptGetAudioMp3Data, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/audio/mp3", + path: { + transcript_id: data.transcriptId, + }, + query: { + token: data.token, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Audio Waveform + * @param data The data for the request. + * @param data.transcriptId + * @returns AudioWaveform Successful Response + * @throws ApiError + */ + public v1TranscriptGetAudioWaveform( + data: V1TranscriptGetAudioWaveformData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/audio/waveform", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Participants + * @param data The data for the request. + * @param data.transcriptId + * @returns Participant Successful Response + * @throws ApiError + */ + public v1TranscriptGetParticipants( + data: V1TranscriptGetParticipantsData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/participants", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Add Participant + * @param data The data for the request. + * @param data.transcriptId + * @param data.requestBody + * @returns Participant Successful Response + * @throws ApiError + */ + public v1TranscriptAddParticipant( + data: V1TranscriptAddParticipantData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/v1/transcripts/{transcript_id}/participants", + path: { + transcript_id: data.transcriptId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Participant + * @param data The data for the request. + * @param data.transcriptId + * @param data.participantId + * @returns Participant Successful Response + * @throws ApiError + */ + public v1TranscriptGetParticipant( + data: V1TranscriptGetParticipantData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/participants/{participant_id}", + path: { + transcript_id: data.transcriptId, + participant_id: data.participantId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Update Participant + * @param data The data for the request. + * @param data.transcriptId + * @param data.participantId + * @param data.requestBody + * @returns Participant Successful Response + * @throws ApiError + */ + public v1TranscriptUpdateParticipant( + data: V1TranscriptUpdateParticipantData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/v1/transcripts/{transcript_id}/participants/{participant_id}", + path: { + transcript_id: data.transcriptId, + participant_id: data.participantId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Delete Participant + * @param data The data for the request. + * @param data.transcriptId + * @param data.participantId + * @returns DeletionStatus Successful Response + * @throws ApiError + */ + public v1TranscriptDeleteParticipant( + data: V1TranscriptDeleteParticipantData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "DELETE", + url: "/v1/transcripts/{transcript_id}/participants/{participant_id}", + path: { + transcript_id: data.transcriptId, + participant_id: data.participantId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Assign Speaker + * @param data The data for the request. + * @param data.transcriptId + * @param data.requestBody + * @returns SpeakerAssignmentStatus Successful Response + * @throws ApiError + */ + public v1TranscriptAssignSpeaker( + data: V1TranscriptAssignSpeakerData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/v1/transcripts/{transcript_id}/speaker/assign", + path: { + transcript_id: data.transcriptId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Merge Speaker + * @param data The data for the request. + * @param data.transcriptId + * @param data.requestBody + * @returns SpeakerAssignmentStatus Successful Response + * @throws ApiError + */ + public v1TranscriptMergeSpeaker( + data: V1TranscriptMergeSpeakerData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "PATCH", + url: "/v1/transcripts/{transcript_id}/speaker/merge", + path: { + transcript_id: data.transcriptId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Record Upload + * @param data The data for the request. + * @param data.transcriptId + * @param data.formData + * @returns unknown Successful Response + * @throws ApiError + */ + public v1TranscriptRecordUpload( + data: V1TranscriptRecordUploadData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/v1/transcripts/{transcript_id}/record/upload", + path: { + transcript_id: data.transcriptId, + }, + formData: data.formData, + mediaType: "multipart/form-data", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Get Websocket Events + * @param data The data for the request. + * @param data.transcriptId + * @returns unknown Successful Response + * @throws ApiError + */ + public v1TranscriptGetWebsocketEvents( + data: V1TranscriptGetWebsocketEventsData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/transcripts/{transcript_id}/events", + path: { + transcript_id: data.transcriptId, + }, + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * Transcript Record Webrtc + * @param data The data for the request. + * @param data.transcriptId + * @param data.requestBody + * @returns unknown Successful Response + * @throws ApiError + */ + public v1TranscriptRecordWebrtc( + data: V1TranscriptRecordWebrtcData, + ): CancelablePromise { + return this.httpRequest.request({ + method: "POST", + url: "/v1/transcripts/{transcript_id}/record/webrtc", + path: { + transcript_id: data.transcriptId, + }, + body: data.requestBody, + mediaType: "application/json", + errors: { + 422: "Validation Error", + }, + }); + } + + /** + * User Me + * @returns unknown Successful Response + * @throws ApiError + */ + public v1UserMe(): CancelablePromise { + return this.httpRequest.request({ + method: "GET", + url: "/v1/me", + }); + } +} diff --git a/www/app/api/services/DefaultService.ts b/www/app/api/services/DefaultService.ts deleted file mode 100644 index fe6092e9..00000000 --- a/www/app/api/services/DefaultService.ts +++ /dev/null @@ -1,598 +0,0 @@ -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 type TDataV1TranscriptsList = { - /** - * Page number - */ - page?: number; - /** - * Page size - */ - size?: number; -}; -export type TDataV1TranscriptsCreate = { - requestBody: CreateTranscript; -}; -export type TDataV1TranscriptGet = { - transcriptId: string; -}; -export type TDataV1TranscriptUpdate = { - requestBody: UpdateTranscript; - transcriptId: string; -}; -export type TDataV1TranscriptDelete = { - transcriptId: string; -}; -export type TDataV1TranscriptGetTopics = { - transcriptId: string; -}; -export type TDataV1TranscriptGetTopicsWithWords = { - transcriptId: string; -}; -export type TDataV1TranscriptGetTopicsWithWordsPerSpeaker = { - topicId: string; - transcriptId: string; -}; -export type TDataV1TranscriptHeadAudioMp3 = { - token?: string | null; - transcriptId: string; -}; -export type TDataV1TranscriptGetAudioMp3 = { - token?: string | null; - transcriptId: string; -}; -export type TDataV1TranscriptGetAudioWaveform = { - transcriptId: string; -}; -export type TDataV1TranscriptGetParticipants = { - transcriptId: string; -}; -export type TDataV1TranscriptAddParticipant = { - requestBody: CreateParticipant; - transcriptId: string; -}; -export type TDataV1TranscriptGetParticipant = { - participantId: string; - transcriptId: string; -}; -export type TDataV1TranscriptUpdateParticipant = { - participantId: string; - requestBody: UpdateParticipant; - transcriptId: string; -}; -export type TDataV1TranscriptDeleteParticipant = { - participantId: string; - transcriptId: string; -}; -export type TDataV1TranscriptAssignSpeaker = { - requestBody: SpeakerAssignment; - transcriptId: string; -}; -export type TDataV1TranscriptMergeSpeaker = { - requestBody: SpeakerMerge; - transcriptId: string; -}; -export type TDataV1TranscriptRecordUpload = { - formData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post; - transcriptId: string; -}; -export type TDataV1TranscriptGetWebsocketEvents = { - transcriptId: string; -}; -export type TDataV1TranscriptRecordWebrtc = { - requestBody: RtcOffer; - transcriptId: string; -}; - -export class DefaultService { - constructor(public readonly httpRequest: BaseHttpRequest) {} - - /** - * Metrics - * Endpoint that serves Prometheus metrics. - * @returns unknown Successful Response - * @throws ApiError - */ - public metrics(): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/metrics", - }); - } - - /** - * Transcripts List - * @returns Page_GetTranscript_ Successful Response - * @throws ApiError - */ - public v1TranscriptsList( - data: TDataV1TranscriptsList = {}, - ): CancelablePromise { - const { page = 1, size = 50 } = data; - return this.httpRequest.request({ - method: "GET", - url: "/v1/transcripts", - query: { - page, - size, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcripts Create - * @returns GetTranscript Successful Response - * @throws ApiError - */ - public v1TranscriptsCreate( - data: TDataV1TranscriptsCreate, - ): CancelablePromise { - const { requestBody } = data; - return this.httpRequest.request({ - method: "POST", - url: "/v1/transcripts", - body: requestBody, - mediaType: "application/json", - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Get - * @returns GetTranscript Successful Response - * @throws ApiError - */ - public v1TranscriptGet( - data: TDataV1TranscriptGet, - ): CancelablePromise { - const { transcriptId } = data; - return this.httpRequest.request({ - method: "GET", - url: "/v1/transcripts/{transcript_id}", - path: { - transcript_id: transcriptId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Update - * @returns GetTranscript Successful Response - * @throws ApiError - */ - public v1TranscriptUpdate( - data: TDataV1TranscriptUpdate, - ): CancelablePromise { - const { requestBody, transcriptId } = data; - 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 - * @returns DeletionStatus Successful Response - * @throws ApiError - */ - public v1TranscriptDelete( - data: TDataV1TranscriptDelete, - ): CancelablePromise { - const { transcriptId } = data; - return this.httpRequest.request({ - method: "DELETE", - url: "/v1/transcripts/{transcript_id}", - path: { - transcript_id: transcriptId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Get Topics - * @returns GetTranscriptTopic Successful Response - * @throws ApiError - */ - public v1TranscriptGetTopics( - data: TDataV1TranscriptGetTopics, - ): CancelablePromise> { - const { transcriptId } = data; - 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 - * @returns GetTranscriptTopicWithWords Successful Response - * @throws ApiError - */ - public v1TranscriptGetTopicsWithWords( - data: TDataV1TranscriptGetTopicsWithWords, - ): CancelablePromise> { - const { transcriptId } = data; - 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 - * @returns GetTranscriptTopicWithWordsPerSpeaker Successful Response - * @throws ApiError - */ - public v1TranscriptGetTopicsWithWordsPerSpeaker( - data: TDataV1TranscriptGetTopicsWithWordsPerSpeaker, - ): CancelablePromise { - const { topicId, transcriptId } = data; - 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 - * @returns unknown Successful Response - * @throws ApiError - */ - public v1TranscriptHeadAudioMp3( - data: TDataV1TranscriptHeadAudioMp3, - ): CancelablePromise { - const { token, transcriptId } = data; - return this.httpRequest.request({ - method: "HEAD", - url: "/v1/transcripts/{transcript_id}/audio/mp3", - path: { - transcript_id: transcriptId, - }, - query: { - token, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Get Audio Mp3 - * @returns unknown Successful Response - * @throws ApiError - */ - public v1TranscriptGetAudioMp3( - data: TDataV1TranscriptGetAudioMp3, - ): CancelablePromise { - const { token, transcriptId } = data; - return this.httpRequest.request({ - method: "GET", - url: "/v1/transcripts/{transcript_id}/audio/mp3", - path: { - transcript_id: transcriptId, - }, - query: { - token, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Get Audio Waveform - * @returns AudioWaveform Successful Response - * @throws ApiError - */ - public v1TranscriptGetAudioWaveform( - data: TDataV1TranscriptGetAudioWaveform, - ): CancelablePromise { - const { transcriptId } = data; - return this.httpRequest.request({ - method: "GET", - url: "/v1/transcripts/{transcript_id}/audio/waveform", - path: { - transcript_id: transcriptId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Get Participants - * @returns Participant Successful Response - * @throws ApiError - */ - public v1TranscriptGetParticipants( - data: TDataV1TranscriptGetParticipants, - ): CancelablePromise> { - const { transcriptId } = data; - return this.httpRequest.request({ - method: "GET", - url: "/v1/transcripts/{transcript_id}/participants", - path: { - transcript_id: transcriptId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Add Participant - * @returns Participant Successful Response - * @throws ApiError - */ - public v1TranscriptAddParticipant( - data: TDataV1TranscriptAddParticipant, - ): CancelablePromise { - const { requestBody, transcriptId } = data; - 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 - * @returns Participant Successful Response - * @throws ApiError - */ - public v1TranscriptGetParticipant( - data: TDataV1TranscriptGetParticipant, - ): CancelablePromise { - const { participantId, transcriptId } = data; - 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 - * @returns Participant Successful Response - * @throws ApiError - */ - public v1TranscriptUpdateParticipant( - data: TDataV1TranscriptUpdateParticipant, - ): CancelablePromise { - const { participantId, requestBody, transcriptId } = data; - 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 - * @returns DeletionStatus Successful Response - * @throws ApiError - */ - public v1TranscriptDeleteParticipant( - data: TDataV1TranscriptDeleteParticipant, - ): CancelablePromise { - const { participantId, transcriptId } = data; - 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 - * @returns SpeakerAssignmentStatus Successful Response - * @throws ApiError - */ - public v1TranscriptAssignSpeaker( - data: TDataV1TranscriptAssignSpeaker, - ): CancelablePromise { - const { requestBody, transcriptId } = data; - 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 - * @returns SpeakerAssignmentStatus Successful Response - * @throws ApiError - */ - public v1TranscriptMergeSpeaker( - data: TDataV1TranscriptMergeSpeaker, - ): CancelablePromise { - const { requestBody, transcriptId } = data; - 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 - * @returns unknown Successful Response - * @throws ApiError - */ - public v1TranscriptRecordUpload( - data: TDataV1TranscriptRecordUpload, - ): CancelablePromise { - const { formData, transcriptId } = data; - 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 - * @returns unknown Successful Response - * @throws ApiError - */ - public v1TranscriptGetWebsocketEvents( - data: TDataV1TranscriptGetWebsocketEvents, - ): CancelablePromise { - const { transcriptId } = data; - return this.httpRequest.request({ - method: "GET", - url: "/v1/transcripts/{transcript_id}/events", - path: { - transcript_id: transcriptId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - - /** - * Transcript Record Webrtc - * @returns unknown Successful Response - * @throws ApiError - */ - public v1TranscriptRecordWebrtc( - data: TDataV1TranscriptRecordWebrtc, - ): CancelablePromise { - const { requestBody, transcriptId } = data; - 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 unknown Successful Response - * @throws ApiError - */ - public v1UserMe(): CancelablePromise { - return this.httpRequest.request({ - method: "GET", - url: "/v1/me", - }); - } -} diff --git a/www/app/api/types.gen.ts b/www/app/api/types.gen.ts new file mode 100644 index 00000000..db50d253 --- /dev/null +++ b/www/app/api/types.gen.ts @@ -0,0 +1,642 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AudioWaveform = { + data: Array; +}; + +export type Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post = + { + file: Blob | File; + }; + +export type CreateParticipant = { + speaker?: number | null; + name: string; +}; + +export type CreateTranscript = { + name: string; + source_language?: string; + target_language?: string; +}; + +export type DeletionStatus = { + status: string; +}; + +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 | null; + reviewed: boolean; +}; + +export type GetTranscriptSegmentTopic = { + text: string; + start: number; + speaker: number; +}; + +export type GetTranscriptTopic = { + id: string; + title: string; + summary: string; + timestamp: number; + duration: number | null; + transcript: string; + segments?: Array; +}; + +export type GetTranscriptTopicWithWords = { + id: string; + title: string; + summary: string; + timestamp: number; + duration: number | null; + transcript: string; + segments?: Array; + words?: Array; +}; + +export type GetTranscriptTopicWithWordsPerSpeaker = { + id: string; + title: string; + summary: string; + timestamp: number; + duration: number | null; + transcript: string; + segments?: Array; + words_per_speaker?: Array; +}; + +export type HTTPValidationError = { + detail?: Array; +}; + +export type Page_GetTranscript_ = { + items: Array; + total: number; + page: number | null; + size: number | null; + pages?: number | null; +}; + +export type Participant = { + id: string; + speaker: number | null; + name: string; +}; + +export type RtcOffer = { + sdp: string; + type: string; +}; + +export type SpeakerAssignment = { + speaker?: number | null; + participant?: string | null; + timestamp_from: number; + timestamp_to: number; +}; + +export type SpeakerAssignmentStatus = { + status: string; +}; + +export type SpeakerMerge = { + speaker_from: number; + speaker_to: number; +}; + +export type SpeakerWords = { + speaker: number; + words: Array; +}; + +export type TranscriptParticipant = { + id?: string; + speaker: number | null; + name: string; +}; + +export type UpdateParticipant = { + speaker?: number | null; + name?: string | null; +}; + +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 | null; + reviewed?: boolean | null; +}; + +export type UserInfo = { + sub: string; + email: string | null; + email_verified: boolean | null; +}; + +export type ValidationError = { + loc: Array; + msg: string; + type: string; +}; + +export type Word = { + text: string; + start: number; + end: number; + speaker?: number; +}; + +export type MetricsResponse = unknown; + +export type V1TranscriptsListData = { + /** + * Page number + */ + page?: number; + /** + * Page size + */ + size?: number; +}; + +export type V1TranscriptsListResponse = Page_GetTranscript_; + +export type V1TranscriptsCreateData = { + requestBody: CreateTranscript; +}; + +export type V1TranscriptsCreateResponse = GetTranscript; + +export type V1TranscriptGetData = { + transcriptId: string; +}; + +export type V1TranscriptGetResponse = GetTranscript; + +export type V1TranscriptUpdateData = { + requestBody: UpdateTranscript; + transcriptId: string; +}; + +export type V1TranscriptUpdateResponse = GetTranscript; + +export type V1TranscriptDeleteData = { + transcriptId: string; +}; + +export type V1TranscriptDeleteResponse = DeletionStatus; + +export type V1TranscriptGetTopicsData = { + transcriptId: string; +}; + +export type V1TranscriptGetTopicsResponse = Array; + +export type V1TranscriptGetTopicsWithWordsData = { + transcriptId: string; +}; + +export type V1TranscriptGetTopicsWithWordsResponse = + Array; + +export type V1TranscriptGetTopicsWithWordsPerSpeakerData = { + topicId: string; + transcriptId: string; +}; + +export type V1TranscriptGetTopicsWithWordsPerSpeakerResponse = + GetTranscriptTopicWithWordsPerSpeaker; + +export type V1TranscriptHeadAudioMp3Data = { + token?: string | null; + transcriptId: string; +}; + +export type V1TranscriptHeadAudioMp3Response = unknown; + +export type V1TranscriptGetAudioMp3Data = { + token?: string | null; + transcriptId: string; +}; + +export type V1TranscriptGetAudioMp3Response = unknown; + +export type V1TranscriptGetAudioWaveformData = { + transcriptId: string; +}; + +export type V1TranscriptGetAudioWaveformResponse = AudioWaveform; + +export type V1TranscriptGetParticipantsData = { + transcriptId: string; +}; + +export type V1TranscriptGetParticipantsResponse = Array; + +export type V1TranscriptAddParticipantData = { + requestBody: CreateParticipant; + transcriptId: string; +}; + +export type V1TranscriptAddParticipantResponse = Participant; + +export type V1TranscriptGetParticipantData = { + participantId: string; + transcriptId: string; +}; + +export type V1TranscriptGetParticipantResponse = Participant; + +export type V1TranscriptUpdateParticipantData = { + participantId: string; + requestBody: UpdateParticipant; + transcriptId: string; +}; + +export type V1TranscriptUpdateParticipantResponse = Participant; + +export type V1TranscriptDeleteParticipantData = { + participantId: string; + transcriptId: string; +}; + +export type V1TranscriptDeleteParticipantResponse = DeletionStatus; + +export type V1TranscriptAssignSpeakerData = { + requestBody: SpeakerAssignment; + transcriptId: string; +}; + +export type V1TranscriptAssignSpeakerResponse = SpeakerAssignmentStatus; + +export type V1TranscriptMergeSpeakerData = { + requestBody: SpeakerMerge; + transcriptId: string; +}; + +export type V1TranscriptMergeSpeakerResponse = SpeakerAssignmentStatus; + +export type V1TranscriptRecordUploadData = { + formData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post; + transcriptId: string; +}; + +export type V1TranscriptRecordUploadResponse = unknown; + +export type V1TranscriptGetWebsocketEventsData = { + transcriptId: string; +}; + +export type V1TranscriptGetWebsocketEventsResponse = unknown; + +export type V1TranscriptRecordWebrtcData = { + requestBody: RtcOffer; + transcriptId: string; +}; + +export type V1TranscriptRecordWebrtcResponse = unknown; + +export type V1UserMeResponse = UserInfo | null; + +export type $OpenApiTs = { + "/metrics": { + get: { + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + "/v1/transcripts": { + get: { + req: V1TranscriptsListData; + res: { + /** + * Successful Response + */ + 200: Page_GetTranscript_; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + post: { + req: V1TranscriptsCreateData; + res: { + /** + * Successful Response + */ + 200: GetTranscript; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}": { + get: { + req: V1TranscriptGetData; + res: { + /** + * Successful Response + */ + 200: GetTranscript; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + patch: { + req: V1TranscriptUpdateData; + res: { + /** + * Successful Response + */ + 200: GetTranscript; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + delete: { + req: V1TranscriptDeleteData; + res: { + /** + * Successful Response + */ + 200: DeletionStatus; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/topics": { + get: { + req: V1TranscriptGetTopicsData; + res: { + /** + * Successful Response + */ + 200: Array; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/topics/with-words": { + get: { + req: V1TranscriptGetTopicsWithWordsData; + res: { + /** + * Successful Response + */ + 200: Array; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/topics/{topic_id}/words-per-speaker": { + get: { + req: V1TranscriptGetTopicsWithWordsPerSpeakerData; + res: { + /** + * Successful Response + */ + 200: GetTranscriptTopicWithWordsPerSpeaker; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/audio/mp3": { + head: { + req: V1TranscriptHeadAudioMp3Data; + res: { + /** + * Successful Response + */ + 200: unknown; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + get: { + req: V1TranscriptGetAudioMp3Data; + res: { + /** + * Successful Response + */ + 200: unknown; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/audio/waveform": { + get: { + req: V1TranscriptGetAudioWaveformData; + res: { + /** + * Successful Response + */ + 200: AudioWaveform; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/participants": { + get: { + req: V1TranscriptGetParticipantsData; + res: { + /** + * Successful Response + */ + 200: Array; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + post: { + req: V1TranscriptAddParticipantData; + res: { + /** + * Successful Response + */ + 200: Participant; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/participants/{participant_id}": { + get: { + req: V1TranscriptGetParticipantData; + res: { + /** + * Successful Response + */ + 200: Participant; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + patch: { + req: V1TranscriptUpdateParticipantData; + res: { + /** + * Successful Response + */ + 200: Participant; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + delete: { + req: V1TranscriptDeleteParticipantData; + res: { + /** + * Successful Response + */ + 200: DeletionStatus; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/speaker/assign": { + patch: { + req: V1TranscriptAssignSpeakerData; + res: { + /** + * Successful Response + */ + 200: SpeakerAssignmentStatus; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/speaker/merge": { + patch: { + req: V1TranscriptMergeSpeakerData; + res: { + /** + * Successful Response + */ + 200: SpeakerAssignmentStatus; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/record/upload": { + post: { + req: V1TranscriptRecordUploadData; + res: { + /** + * Successful Response + */ + 200: unknown; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/events": { + get: { + req: V1TranscriptGetWebsocketEventsData; + res: { + /** + * Successful Response + */ + 200: unknown; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/transcripts/{transcript_id}/record/webrtc": { + post: { + req: V1TranscriptRecordWebrtcData; + res: { + /** + * Successful Response + */ + 200: unknown; + /** + * Validation Error + */ + 422: HTTPValidationError; + }; + }; + }; + "/v1/me": { + get: { + res: { + /** + * Successful Response + */ + 200: UserInfo | null; + }; + }; + }; +}; diff --git a/www/openapi-ts.config.ts b/www/openapi-ts.config.ts new file mode 100644 index 00000000..9304b8f7 --- /dev/null +++ b/www/openapi-ts.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from "@hey-api/openapi-ts"; + +export default defineConfig({ + client: "axios", + name: "OpenApi", + input: "http://127.0.0.1:1250/openapi.json", + output: { + path: "./app/api", + format: "prettier", + }, + services: { + asClass: true, + }, +}); diff --git a/www/package.json b/www/package.json index ba3b3f83..f206bfbc 100644 --- a/www/package.json +++ b/www/package.json @@ -8,7 +8,7 @@ "start": "next start", "lint": "next lint", "format": "prettier --write .", - "openapi": "openapi-ts --input http://127.0.0.1:1250/openapi.json --name OpenApi --output app/api && yarn format" + "openapi": "openapi-ts" }, "dependencies": { "@chakra-ui/icons": "^2.1.1", @@ -56,7 +56,7 @@ "license": "All Rights Reserved", "devDependencies": { "@types/react": "18.2.20", - "@hey-api/openapi-ts": "^0.27.24", + "@hey-api/openapi-ts": "^0.48.0", "prettier": "^3.0.0" } } diff --git a/www/yarn.lock b/www/yarn.lock index 51e9c96d..c7fafc37 100644 --- a/www/yarn.lock +++ b/www/yarn.lock @@ -12,10 +12,10 @@ resolved "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz" integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== -"@apidevtools/json-schema-ref-parser@11.5.4": - version "11.5.4" - resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.5.4.tgz#6a90caf2140834025cf72651280c46084de187ae" - integrity sha512-o2fsypTGU0WxRxbax8zQoHiIB4dyrkwYfcm8TxZ+bx9pCzcWZbQtiMqpgBvWA/nJ2TrGjK5adCLfTH8wUeU/Wg== +"@apidevtools/json-schema-ref-parser@11.6.4": + version "11.6.4" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.4.tgz#0f3e02302f646471d621a8850e6a346d63c8ebd4" + integrity sha512-9K6xOqeevacvweLGik6LnZCb1fBtCOSIWQs8d096XGeqoLKC33UVMGz9+77Gw44KvbH4pKcQPWo4ZpxkXYj05w== dependencies: "@jsdevtools/ono" "^7.1.3" "@types/json-schema" "^7.0.15" @@ -1103,14 +1103,15 @@ dependencies: prop-types "^15.8.1" -"@hey-api/openapi-ts@^0.27.24": - version "0.27.39" - resolved "https://registry.yarnpkg.com/@hey-api/openapi-ts/-/openapi-ts-0.27.39.tgz#130be15a33cda0ea04dc51166089b7eb77190479" - integrity sha512-sqcMU4QUR/KDwYYj6YlYwAwo8F3bm9Sy9PNwWZ8K/kVNMajtcFkWXDMygeGHaLEVE0zwxmYuO+mcSN+lTD5ZCQ== +"@hey-api/openapi-ts@^0.48.0": + version "0.48.1" + resolved "https://registry.yarnpkg.com/@hey-api/openapi-ts/-/openapi-ts-0.48.1.tgz#a80e2372e7550057817c3dfb3742d87c395036a9" + integrity sha512-iZBEmS12EWn4yl/nYMui+PA3hprjFR9z+9p+p+s3f0VRXPw+uZWO0yuIfCcsAw1n0isikw2uJEY4qxwlnI07AQ== dependencies: - "@apidevtools/json-schema-ref-parser" "11.5.4" + "@apidevtools/json-schema-ref-parser" "11.6.4" + c12 "1.11.1" camelcase "8.0.0" - commander "12.0.0" + commander "12.1.0" handlebars "4.7.8" "@humanwhocodes/config-array@^0.11.13": @@ -1662,6 +1663,11 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== +acorn@^8.11.3: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" @@ -1955,6 +1961,24 @@ busboy@1.6.0: dependencies: streamsearch "^1.1.0" +c12@1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/c12/-/c12-1.11.1.tgz#d5244e95407af450a523e44eb57e5b87b82f8677" + integrity sha512-KDU0TvSvVdaYcQKQ6iPHATGz/7p/KiVjPg4vQrB6Jg/wX9R0yl5RZxWm9IoZqaIHD2+6PZd81+KMGwRr/lRIUg== + dependencies: + chokidar "^3.6.0" + confbox "^0.1.7" + defu "^6.1.4" + dotenv "^16.4.5" + giget "^1.2.3" + jiti "^1.21.6" + mlly "^1.7.1" + ohash "^1.1.3" + pathe "^1.1.2" + perfect-debounce "^1.0.0" + pkg-types "^1.1.1" + rc9 "^2.1.2" + call-bind@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -2044,11 +2068,38 @@ character-entities@^2.0.0: optionalDependencies: fsevents "~2.3.2" +chokidar@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== + ci-info@^3.2.0: version "3.8.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== +citty@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/citty/-/citty-0.1.6.tgz#0f7904da1ed4625e1a9ea7e0fa780981aab7c5e4" + integrity sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ== + dependencies: + consola "^3.2.3" + classnames@^2.2.3: version "2.3.2" resolved "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz" @@ -2100,10 +2151,10 @@ comma-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== -commander@12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" - integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== +commander@12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== commander@^4.0.0: version "4.1.1" @@ -2130,6 +2181,16 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +confbox@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.1.7.tgz#ccfc0a2bcae36a84838e83a3b7f770fb17d6c579" + integrity sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA== + +consola@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/consola/-/consola-3.2.3.tgz#0741857aa88cfa0d6fd53f1cff0375136e98502f" + integrity sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ== + convert-source-map@^1.5.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" @@ -2158,7 +2219,7 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cross-spawn@^7.0.2: +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2238,6 +2299,11 @@ define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +defu@^6.1.4: + version "6.1.4" + resolved "https://registry.yarnpkg.com/defu/-/defu-6.1.4.tgz#4e0c9cf9ff68fe5f3d7f2765cc1a012dfdcb0479" + integrity sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg== + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -2248,6 +2314,11 @@ dequal@^2.0.0, dequal@^2.0.3: resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== +destr@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/destr/-/destr-2.0.3.tgz#7f9e97cb3d16dbdca7be52aca1644ce402cfe449" + integrity sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ== + detect-node-es@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" @@ -2307,6 +2378,11 @@ dom-helpers@^5.0.1: "@babel/runtime" "^7.8.7" csstype "^3.0.2" +dotenv@^16.4.5: + version "16.4.5" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + electron-to-chromium@^1.4.431: version "1.4.455" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.455.tgz" @@ -2660,6 +2736,21 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +execa@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -2819,6 +2910,13 @@ framesync@6.1.2: dependencies: tslib "2.4.0" +fs-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== + dependencies: + minipass "^3.0.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" @@ -2884,6 +2982,11 @@ get-nonce@^1.0.0: resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q== +get-stream@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" + integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== + get-symbol-description@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" @@ -2899,6 +3002,20 @@ get-tsconfig@^4.5.0: dependencies: resolve-pkg-maps "^1.0.0" +giget@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/giget/-/giget-1.2.3.tgz#ef6845d1140e89adad595f7f3bb60aa31c672cb6" + integrity sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA== + dependencies: + citty "^0.1.6" + consola "^3.2.3" + defu "^6.1.4" + node-fetch-native "^1.6.3" + nypm "^0.3.8" + ohash "^1.1.3" + pathe "^1.1.2" + tar "^6.2.0" + glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" @@ -3120,6 +3237,11 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" +human-signals@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" + integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== + iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" @@ -3341,6 +3463,11 @@ is-shared-array-buffer@^1.0.2: dependencies: call-bind "^1.0.2" +is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== + is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" @@ -3430,6 +3557,11 @@ jiti@^1.18.2: resolved "https://registry.npmjs.org/jiti/-/jiti-1.19.1.tgz" integrity sha512-oVhqoRDaBXf7sjkll95LHVS6Myyyb1zaunVwk4Z0+WPSW4gjS0pl01zYKHScTuyEhQsFxV5L4DR5r+YqSyqyyg== +jiti@^1.21.6: + version "1.21.6" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.6.tgz#6c7f7398dd4b3142767f9a168af2f317a428d268" + integrity sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w== + jose@^4.6.0: version "4.14.4" resolved "https://registry.yarnpkg.com/jose/-/jose-4.14.4.tgz#59e09204e2670c3164ee24cbfe7115c6f8bff9ca" @@ -3851,6 +3983,11 @@ mime@2.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== +mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + minimatch@9.0.3: version "9.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" @@ -3877,6 +4014,26 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +minipass@^3.0.0: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== + dependencies: + yallist "^4.0.0" + +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + +minizlib@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" @@ -3884,6 +4041,21 @@ mkdirp@^0.5.5: dependencies: minimist "^1.2.6" +mkdirp@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +mlly@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.7.1.tgz#e0336429bb0731b6a8e887b438cbdae522c8f32f" + integrity sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA== + dependencies: + acorn "^8.11.3" + pathe "^1.1.2" + pkg-types "^1.1.1" + ufo "^1.5.3" + ms@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" @@ -3942,6 +4114,11 @@ next@^14.0.4: "@next/swc-win32-ia32-msvc" "14.0.4" "@next/swc-win32-x64-msvc" "14.0.4" +node-fetch-native@^1.6.3: + version "1.6.4" + resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.4.tgz#679fc8fd8111266d47d7e72c379f1bed9acff06e" + integrity sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ== + node-fetch@^2.6.7: version "2.6.12" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" @@ -3964,6 +4141,25 @@ normalize-range@^0.1.2: resolved "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz" integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== +npm-run-path@^5.1.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.3.0.tgz#e23353d0ebb9317f174e93417e4a4d82d0249e9f" + integrity sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ== + dependencies: + path-key "^4.0.0" + +nypm@^0.3.8: + version "0.3.9" + resolved "https://registry.yarnpkg.com/nypm/-/nypm-0.3.9.tgz#ab74c55075737466847611aa33c3c67741c01d8f" + integrity sha512-BI2SdqqTHg2d4wJh8P9A1W+bslg33vOE9IZDY6eR2QC+Pu1iNBVZUqczrd43rJb+fMzHU7ltAYKsEFY/kHMFcw== + dependencies: + citty "^0.1.6" + consola "^3.2.3" + execa "^8.0.1" + pathe "^1.1.2" + pkg-types "^1.1.1" + ufo "^1.5.3" + object-assign@^4.0.1, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" @@ -4044,6 +4240,11 @@ object.values@^1.1.6, object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" +ohash@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/ohash/-/ohash-1.1.3.tgz#f12c3c50bfe7271ce3fd1097d42568122ccdcf07" + integrity sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw== + once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" @@ -4051,6 +4252,13 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" +onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== + dependencies: + mimic-fn "^4.0.0" + optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -4109,6 +4317,11 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + path-parse@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" @@ -4124,6 +4337,16 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pathe@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" + integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== + +perfect-debounce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz#9c2e8bc30b169cc984a58b7d5b28049839591d2a" + integrity sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" @@ -4144,6 +4367,15 @@ pirates@^4.0.1: resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== +pkg-types@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.1.3.tgz#161bb1242b21daf7795036803f28e30222e476e3" + integrity sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA== + dependencies: + confbox "^0.1.7" + mlly "^1.7.1" + pathe "^1.1.2" + postcss-import@^15.1.0: version "15.1.0" resolved "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz" @@ -4269,6 +4501,14 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" +rc9@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/rc9/-/rc9-2.1.2.tgz#6282ff638a50caa0a91a31d76af4a0b9cbd1080d" + integrity sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg== + dependencies: + defu "^6.1.4" + destr "^2.0.3" + react-clientside-effect@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/react-clientside-effect/-/react-clientside-effect-1.2.6.tgz#29f9b14e944a376b03fb650eed2a754dd128ea3a" @@ -4629,6 +4869,11 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + simple-peer@^9.11.1: version "9.11.1" resolved "https://registry.npmjs.org/simple-peer/-/simple-peer-9.11.1.tgz" @@ -4740,6 +4985,11 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== +strip-final-newline@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== + strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -4858,6 +5108,18 @@ tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== +tar@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -5015,6 +5277,11 @@ typescript@^5.1.6: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +ufo@^1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.5.3.tgz#3325bd3c977b6c6cd3160bf4ff52989adc9d3344" + integrity sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw== + uglify-js@^3.1.4: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" From bba50da7c79a4adb4844d4977dcf29d81504d74b Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Wed, 3 Jul 2024 19:00:54 +0200 Subject: [PATCH 4/5] Fix redirect to record errors --- .../[domain]/transcripts/[transcriptId]/page.tsx | 14 +++++++++----- www/app/[domain]/transcripts/useWaveform.ts | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/www/app/[domain]/transcripts/[transcriptId]/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/page.tsx index 5faa31e1..519fe7e1 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/page.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/page.tsx @@ -23,16 +23,20 @@ type TranscriptDetails = { export default function TranscriptDetails(details: TranscriptDetails) { const transcriptId = details.params.transcriptId; const router = useRouter(); + const statusToRedirect = ["idle", "recording", "processing"]; const transcript = useTranscript(transcriptId); + const transcriptStatus = transcript.response?.status; + const waiting = + !transcriptStatus || statusToRedirect.includes(transcriptStatus); + const topics = useTopics(transcriptId); - const waveform = useWaveform(transcriptId); + const waveform = useWaveform(transcriptId, waiting); const useActiveTopic = useState(null); - const mp3 = useMp3(transcriptId); + const mp3 = useMp3(transcriptId, waiting); useEffect(() => { - const statusToRedirect = ["idle", "recording", "processing"]; - if (statusToRedirect.includes(transcript.response?.status || "")) { + if (waiting) { const newUrl = "/transcripts/" + details.params.transcriptId + "/record"; // Shallow redirection does not work on NextJS 13 // https://github.com/vercel/next.js/discussions/48110 @@ -40,7 +44,7 @@ export default function TranscriptDetails(details: TranscriptDetails) { router.replace(newUrl); // history.replaceState({}, "", newUrl); } - }, [transcript.response?.status]); + }, [waiting]); if (transcript.error || topics?.error) { return ( diff --git a/www/app/[domain]/transcripts/useWaveform.ts b/www/app/[domain]/transcripts/useWaveform.ts index 3fbf2187..709fd321 100644 --- a/www/app/[domain]/transcripts/useWaveform.ts +++ b/www/app/[domain]/transcripts/useWaveform.ts @@ -10,7 +10,7 @@ type AudioWaveFormResponse = { error: Error | null; }; -const useWaveform = (id: string): AudioWaveFormResponse => { +const useWaveform = (id: string, waiting: boolean): AudioWaveFormResponse => { const [waveform, setWaveform] = useState(null); const [loading, setLoading] = useState(true); const [error, setErrorState] = useState(null); @@ -18,7 +18,7 @@ const useWaveform = (id: string): AudioWaveFormResponse => { const api = useApi(); useEffect(() => { - if (!id || !api) return; + if (!id || !api || waiting) return; setLoading(true); api .v1TranscriptGetAudioWaveform({ transcriptId: id }) @@ -36,7 +36,7 @@ const useWaveform = (id: string): AudioWaveFormResponse => { setError(err); } }); - }, [id, api]); + }, [id, api, waiting]); return { waveform, loading, error }; }; From 5d77b8be0c8fb593efd337bc3cf14e6b42de5bf0 Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Fri, 5 Jul 2024 17:29:29 +0200 Subject: [PATCH 5/5] Separate upload file and record pages --- .../transcripts/[transcriptId]/page.tsx | 3 +- .../[transcriptId]/upload/page.tsx | 113 ++++++++++++++++++ .../[domain]/transcripts/fileUploadButton.tsx | 24 +++- www/app/[domain]/transcripts/new/page.tsx | 47 +++++--- www/app/[domain]/transcripts/recorder.tsx | 4 - 5 files changed, 162 insertions(+), 29 deletions(-) create mode 100644 www/app/[domain]/transcripts/[transcriptId]/upload/page.tsx diff --git a/www/app/[domain]/transcripts/[transcriptId]/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/page.tsx index 519fe7e1..f695786d 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/page.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/page.tsx @@ -27,8 +27,7 @@ export default function TranscriptDetails(details: TranscriptDetails) { const transcript = useTranscript(transcriptId); const transcriptStatus = transcript.response?.status; - const waiting = - !transcriptStatus || statusToRedirect.includes(transcriptStatus); + const waiting = statusToRedirect.includes(transcriptStatus || ""); const topics = useTopics(transcriptId); const waveform = useWaveform(transcriptId, waiting); diff --git a/www/app/[domain]/transcripts/[transcriptId]/upload/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/upload/page.tsx new file mode 100644 index 00000000..c6e9eb69 --- /dev/null +++ b/www/app/[domain]/transcripts/[transcriptId]/upload/page.tsx @@ -0,0 +1,113 @@ +"use client"; +import { useEffect, useState } from "react"; +import useTranscript from "../../useTranscript"; +import { useWebSockets } from "../../useWebSockets"; +import "../../../../styles/button.css"; +import { lockWakeState, releaseWakeState } from "../../../../lib/wakeLock"; +import { useRouter } from "next/navigation"; +import useMp3 from "../../useMp3"; +import { Center, VStack, Text, Heading, Button } from "@chakra-ui/react"; +import FileUploadButton from "../../fileUploadButton"; + +type TranscriptUpload = { + params: { + transcriptId: string; + }; +}; + +const TranscriptUpload = (details: TranscriptUpload) => { + const transcript = useTranscript(details.params.transcriptId); + const [transcriptStarted, setTranscriptStarted] = useState(false); + + const webSockets = useWebSockets(details.params.transcriptId); + + let mp3 = useMp3(details.params.transcriptId, true); + + const router = useRouter(); + + const [status, setStatus] = useState( + webSockets.status.value || transcript.response?.status || "idle", + ); + + useEffect(() => { + if (!transcriptStarted && webSockets.transcriptTextLive.length !== 0) + setTranscriptStarted(true); + }, [webSockets.transcriptTextLive]); + + useEffect(() => { + //TODO HANDLE ERROR STATUS BETTER + const newStatus = + webSockets.status.value || transcript.response?.status || "idle"; + setStatus(newStatus); + if (newStatus && (newStatus == "ended" || newStatus == "error")) { + console.log(newStatus, "redirecting"); + + const newUrl = "/transcripts/" + details.params.transcriptId; + router.replace(newUrl); + } + }, [webSockets.status.value, transcript.response?.status]); + + useEffect(() => { + if (webSockets.waveform && webSockets.waveform) mp3.getNow(); + }, [webSockets.waveform, webSockets.duration]); + + useEffect(() => { + lockWakeState(); + return () => { + releaseWakeState(); + }; + }, []); + + return ( + <> + + Upload meeting +
+ + {status && status == "idle" && ( + <> + + Please select the file, supported formats: .mp3, m4a, .wav, + .mp4, .mov or .webm + + + + )} + {status && status == "uploaded" && ( + File is uploaded, processing... + )} + {(status == "recording" || status == "processing") && ( + <> + Processing your recording... + + You can safely return to the library while your file is being + processed. + + + + )} + +
+
+ + ); +}; + +export default TranscriptUpload; diff --git a/www/app/[domain]/transcripts/fileUploadButton.tsx b/www/app/[domain]/transcripts/fileUploadButton.tsx index 419245e2..3faba127 100644 --- a/www/app/[domain]/transcripts/fileUploadButton.tsx +++ b/www/app/[domain]/transcripts/fileUploadButton.tsx @@ -1,16 +1,15 @@ -import React from "react"; +import React, { useState } from "react"; import useApi from "../../lib/useApi"; -import { Button } from "@chakra-ui/react"; +import { Button, CircularProgress } from "@chakra-ui/react"; type FileUploadButton = { transcriptId: string; - disabled?: boolean; }; export default function FileUploadButton(props: FileUploadButton) { const fileInputRef = React.useRef(null); const api = useApi(); - + const [progress, setProgress] = useState(0); const triggerFileUpload = () => { fileInputRef.current?.click(); }; @@ -27,6 +26,12 @@ export default function FileUploadButton(props: FileUploadButton) { // Add other properties if required by the type definition }; + api?.httpRequest.config.interceptors.request.use((request) => { + request.onUploadProgress = (progressEvent) => { + setProgress((progressEvent.progress || 0) * 100); + }; + return request; + }); api?.v1TranscriptRecordUpload({ transcriptId: props.transcriptId, formData: uploadData, @@ -40,9 +45,16 @@ export default function FileUploadButton(props: FileUploadButton) { onClick={triggerFileUpload} colorScheme="blue" mr={2} - isDisabled={props.disabled} + isDisabled={progress > 0} > - Upload File + {progress > 0 && progress < 100 ? ( + <> + Uploading...  + + + ) : ( + <>Select File + )} { const router = useRouter(); const isAuthenticated = useFiefIsAuthenticated(); @@ -30,21 +30,29 @@ const TranscriptCreate = () => { const createTranscript = useCreateTranscript(); - const [loadingSend, setLoadingSend] = useState(false); + const [loadingRecord, setLoadingRecord] = useState(false); + const [loadingUpload, setLoadingUpload] = useState(false); const send = () => { - if (loadingSend || createTranscript.loading || permissionDenied) return; - setLoadingSend(true); + if (loadingRecord || createTranscript.loading || permissionDenied) return; + setLoadingRecord(true); + createTranscript.create({ name, target_language: targetLanguage }); + }; + + const uploadFile = () => { + if (loadingUpload || createTranscript.loading || permissionDenied) return; + setLoadingUpload(true); createTranscript.create({ name, target_language: targetLanguage }); }; useEffect(() => { + const action = loadingRecord ? "record" : "upload"; createTranscript.transcript && - router.push(`/transcripts/${createTranscript.transcript.id}/record`); + router.push(`/transcripts/${createTranscript.transcript.id}/${action}`); }, [createTranscript.transcript]); useEffect(() => { - if (createTranscript.error) setLoadingSend(false); + if (createTranscript.error) setLoadingRecord(false); }, [createTranscript.error]); const { loading, permissionOk, permissionDenied, requestPermission } = @@ -55,10 +63,7 @@ const TranscriptCreate = () => {
-

- Welcome to reflector.media -

- +

Welcome to Reflector

Reflector is a transcription and summarization pipeline that transforms audio into knowledge. @@ -101,7 +106,6 @@ const TranscriptCreate = () => { />

- - {loading ? (

Checking permissions...

) : permissionOk ? ( @@ -131,13 +134,23 @@ const TranscriptCreate = () => { Request Microphone Permission )} - + {loadingRecord ? "Loading..." : "Record Meeting"} + + + OR + +
)} diff --git a/www/app/[domain]/transcripts/recorder.tsx b/www/app/[domain]/transcripts/recorder.tsx index d583bb74..0f8b23cb 100644 --- a/www/app/[domain]/transcripts/recorder.tsx +++ b/www/app/[domain]/transcripts/recorder.tsx @@ -266,10 +266,6 @@ export default function Recorder(props: RecorderProps) { mr={2} onClick={handleRecClick} /> - {!isRecording && (window as any).chrome && (