mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
Migrate to openapi-ts generator
This commit is contained in:
@@ -37,7 +37,7 @@ export default function TranscriptCorrect({
|
|||||||
const markAsDone = () => {
|
const markAsDone = () => {
|
||||||
if (transcript.response && !transcript.response.reviewed) {
|
if (transcript.response && !transcript.response.reviewed) {
|
||||||
api
|
api
|
||||||
?.v1TranscriptUpdate(transcriptId, { reviewed: true })
|
?.v1TranscriptUpdate({ transcriptId, requestBody: { reviewed: true } })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
router.push(`/transcripts/${transcriptId}`);
|
router.push(`/transcripts/${transcriptId}`);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -123,10 +123,13 @@ const ParticipantList = ({
|
|||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
await api?.v1TranscriptAssignSpeaker(transcriptId, {
|
await api?.v1TranscriptAssignSpeaker({
|
||||||
participant: participant.id,
|
transcriptId,
|
||||||
timestamp_from: selectedText.start,
|
requestBody: {
|
||||||
timestamp_to: selectedText.end,
|
participant: participant.id,
|
||||||
|
timestamp_from: selectedText.start,
|
||||||
|
timestamp_to: selectedText.end,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
onSuccess();
|
onSuccess();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -142,9 +145,12 @@ const ParticipantList = ({
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
if (participantTo.speaker) {
|
if (participantTo.speaker) {
|
||||||
try {
|
try {
|
||||||
await api?.v1TranscriptMergeSpeaker(transcriptId, {
|
await api?.v1TranscriptMergeSpeaker({
|
||||||
speaker_from: speakerFrom,
|
transcriptId,
|
||||||
speaker_to: participantTo.speaker,
|
requestBody: {
|
||||||
|
speaker_from: speakerFrom,
|
||||||
|
speaker_to: participantTo.speaker,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
onSuccess();
|
onSuccess();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -153,11 +159,11 @@ const ParticipantList = ({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
await api?.v1TranscriptUpdateParticipant(
|
await api?.v1TranscriptUpdateParticipant({
|
||||||
transcriptId,
|
transcriptId,
|
||||||
participantTo.id,
|
participantId: participantTo.id,
|
||||||
{ speaker: speakerFrom },
|
requestBody: { speaker: speakerFrom },
|
||||||
);
|
});
|
||||||
onSuccess();
|
onSuccess();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setError(error, "There was an error merging (update)");
|
setError(error, "There was an error merging (update)");
|
||||||
@@ -183,8 +189,12 @@ const ParticipantList = ({
|
|||||||
if (participant && participant.name !== participantInput) {
|
if (participant && participant.name !== participantInput) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
?.v1TranscriptUpdateParticipant(transcriptId, participant.id, {
|
?.v1TranscriptUpdateParticipant({
|
||||||
name: participantInput,
|
transcriptId,
|
||||||
|
participantId: participant.id,
|
||||||
|
requestBody: {
|
||||||
|
name: participantInput,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
participants.refetch();
|
participants.refetch();
|
||||||
@@ -202,9 +212,12 @@ const ParticipantList = ({
|
|||||||
) {
|
) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
?.v1TranscriptAddParticipant(transcriptId, {
|
?.v1TranscriptAddParticipant({
|
||||||
name: participantInput,
|
transcriptId,
|
||||||
speaker: selectedText,
|
requestBody: {
|
||||||
|
name: participantInput,
|
||||||
|
speaker: selectedText,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
participants.refetch();
|
participants.refetch();
|
||||||
@@ -222,12 +235,12 @@ const ParticipantList = ({
|
|||||||
) {
|
) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const participant = await api?.v1TranscriptAddParticipant(
|
const participant = await api?.v1TranscriptAddParticipant({
|
||||||
transcriptId,
|
transcriptId,
|
||||||
{
|
requestBody: {
|
||||||
name: participantInput,
|
name: participantInput,
|
||||||
},
|
},
|
||||||
);
|
});
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
assignTo(participant)().catch(() => {
|
assignTo(participant)().catch(() => {
|
||||||
// error and loading are handled by assignTo catch
|
// error and loading are handled by assignTo catch
|
||||||
@@ -240,8 +253,11 @@ const ParticipantList = ({
|
|||||||
} else if (action == "Create") {
|
} else if (action == "Create") {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
?.v1TranscriptAddParticipant(transcriptId, {
|
?.v1TranscriptAddParticipant({
|
||||||
name: participantInput,
|
transcriptId,
|
||||||
|
requestBody: {
|
||||||
|
name: participantInput,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
participants.refetch();
|
participants.refetch();
|
||||||
@@ -261,7 +277,7 @@ const ParticipantList = ({
|
|||||||
if (loading || participants.loading || topicWithWords.loading) return;
|
if (loading || participants.loading || topicWithWords.loading) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
?.v1TranscriptDeleteParticipant(transcriptId, participantId)
|
?.v1TranscriptDeleteParticipant({ transcriptId, participantId })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
participants.refetch();
|
participants.refetch();
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ export default function FinalSummary(props: FinalSummaryProps) {
|
|||||||
const requestBody: UpdateTranscript = {
|
const requestBody: UpdateTranscript = {
|
||||||
long_summary: newSummary,
|
long_summary: newSummary,
|
||||||
};
|
};
|
||||||
const updatedTranscript = await api?.v1TranscriptUpdate(
|
const updatedTranscript = await api?.v1TranscriptUpdate({
|
||||||
transcriptId,
|
transcriptId,
|
||||||
requestBody,
|
requestBody,
|
||||||
);
|
});
|
||||||
console.log("Updated long summary:", updatedTranscript);
|
console.log("Updated long summary:", updatedTranscript);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Failed to update long summary:", err);
|
console.error("Failed to update long summary:", err);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const useCreateTranscript = (): UseCreateTranscript => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
api
|
api
|
||||||
.v1TranscriptsCreate(transcriptCreationDetails)
|
.v1TranscriptsCreate({ requestBody: transcriptCreationDetails })
|
||||||
.then((transcript) => {
|
.then((transcript) => {
|
||||||
setTranscript(transcript);
|
setTranscript(transcript);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ export default function FileUploadButton(props: FileUploadButton) {
|
|||||||
// Add other properties if required by the type definition
|
// Add other properties if required by the type definition
|
||||||
};
|
};
|
||||||
|
|
||||||
api?.v1TranscriptRecordUpload(props.transcriptId, uploadData);
|
api?.v1TranscriptRecordUpload({
|
||||||
|
transcriptId: props.transcriptId,
|
||||||
|
formData: uploadData,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ export default function ShareAndPrivacy(props: ShareAndPrivacyProps) {
|
|||||||
share_mode: toShareMode(selectedShareMode.value),
|
share_mode: toShareMode(selectedShareMode.value),
|
||||||
};
|
};
|
||||||
|
|
||||||
const updatedTranscript = await api.v1TranscriptUpdate(
|
const updatedTranscript = await api.v1TranscriptUpdate({
|
||||||
props.transcriptResponse.id,
|
transcriptId: props.transcriptResponse.id,
|
||||||
requestBody,
|
requestBody,
|
||||||
);
|
});
|
||||||
setShareMode(
|
setShareMode(
|
||||||
shareOptions.find(
|
shareOptions.find(
|
||||||
(option) => option.value === updatedTranscript.share_mode,
|
(option) => option.value === updatedTranscript.share_mode,
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ const TranscriptTitle = (props: TranscriptTitle) => {
|
|||||||
const requestBody: UpdateTranscript = {
|
const requestBody: UpdateTranscript = {
|
||||||
title: newTitle,
|
title: newTitle,
|
||||||
};
|
};
|
||||||
const updatedTranscript = await api?.v1TranscriptUpdate(
|
const updatedTranscript = await api?.v1TranscriptUpdate({
|
||||||
transcriptId,
|
transcriptId,
|
||||||
requestBody,
|
requestBody,
|
||||||
);
|
});
|
||||||
console.log("Updated transcript:", updatedTranscript);
|
console.log("Updated transcript:", updatedTranscript);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Failed to update transcript:", err);
|
console.error("Failed to update transcript:", err);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const useParticipants = (transcriptId: string): UseParticipants => {
|
|||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
.v1TranscriptGetParticipants(transcriptId)
|
.v1TranscriptGetParticipants({ transcriptId })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
setResponse(result);
|
setResponse(result);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const useTopicWithWords = (
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
api
|
api
|
||||||
.v1TranscriptGetTopicsWithWordsPerSpeaker(transcriptId, topicId)
|
.v1TranscriptGetTopicsWithWordsPerSpeaker({ transcriptId, topicId })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
setResponse(result);
|
setResponse(result);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const useTopics = (id: string): TranscriptTopics => {
|
|||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
.v1TranscriptGetTopics(id)
|
.v1TranscriptGetTopics({ transcriptId: id })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
setTopics(result);
|
setTopics(result);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const useTranscript = (
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
api
|
api
|
||||||
.v1TranscriptGet(id)
|
.v1TranscriptGet({ transcriptId: id })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
setResponse(result);
|
setResponse(result);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const useTranscriptList = (page: number): TranscriptList => {
|
|||||||
if (!api) return;
|
if (!api) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
.v1TranscriptsList(page)
|
.v1TranscriptsList({ page })
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
setResponse(response);
|
setResponse(response);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const useWaveform = (id: string): AudioWaveFormResponse => {
|
|||||||
if (!id || !api) return;
|
if (!id || !api) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
api
|
api
|
||||||
.v1TranscriptGetAudioWaveform(id)
|
.v1TranscriptGetAudioWaveform({ transcriptId: id })
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
setWaveform(result);
|
setWaveform(result);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const useWebRTC = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
api
|
api
|
||||||
.v1TranscriptRecordWebrtc(transcriptId, rtcOffer)
|
.v1TranscriptRecordWebrtc({ transcriptId, requestBody: rtcOffer })
|
||||||
.then((answer) => {
|
.then((answer) => {
|
||||||
try {
|
try {
|
||||||
p.signal(answer);
|
p.signal(answer);
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
|||||||
|
|
||||||
if (!transcriptId || !api) return;
|
if (!transcriptId || !api) return;
|
||||||
|
|
||||||
api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => {});
|
api?.v1TranscriptGetWebsocketEvents({ transcriptId }).then((result) => {});
|
||||||
|
|
||||||
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
|
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
|
||||||
let ws = new WebSocket(url);
|
let ws = new WebSocket(url);
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
6.6.0
|
|
||||||
@@ -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 { BaseHttpRequest } from "./core/BaseHttpRequest";
|
||||||
import type { OpenAPIConfig } from "./core/OpenAPI";
|
import type { OpenAPIConfig } from "./core/OpenAPI";
|
||||||
import { FetchHttpRequest } from "./core/FetchHttpRequest";
|
import { AxiosHttpRequest } from "./core/AxiosHttpRequest";
|
||||||
|
|
||||||
import { DefaultService } from "./services/DefaultService";
|
import { DefaultService } from "./services/DefaultService";
|
||||||
|
|
||||||
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
||||||
|
|
||||||
export class OpenApi {
|
export class OpenApi {
|
||||||
public readonly default: DefaultService;
|
public readonly default: DefaultService;
|
||||||
|
|
||||||
public readonly request: BaseHttpRequest;
|
public readonly request: BaseHttpRequest;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
config?: Partial<OpenAPIConfig>,
|
config?: Partial<OpenAPIConfig>,
|
||||||
HttpRequest: HttpRequestConstructor = FetchHttpRequest,
|
HttpRequest: HttpRequestConstructor = AxiosHttpRequest,
|
||||||
) {
|
) {
|
||||||
this.request = new HttpRequest({
|
this.request = new HttpRequest({
|
||||||
BASE: config?.BASE ?? "",
|
BASE: config?.BASE ?? "",
|
||||||
@@ -25,6 +26,7 @@ export class OpenApi {
|
|||||||
HEADERS: config?.HEADERS,
|
HEADERS: config?.HEADERS,
|
||||||
ENCODE_PATH: config?.ENCODE_PATH,
|
ENCODE_PATH: config?.ENCODE_PATH,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.default = new DefaultService(this.request);
|
this.default = new DefaultService(this.request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 { ApiRequestOptions } from "./ApiRequestOptions";
|
||||||
import type { ApiResult } from "./ApiResult";
|
import type { ApiResult } from "./ApiResult";
|
||||||
|
|
||||||
@@ -9,7 +5,7 @@ export class ApiError extends Error {
|
|||||||
public readonly url: string;
|
public readonly url: string;
|
||||||
public readonly status: number;
|
public readonly status: number;
|
||||||
public readonly statusText: string;
|
public readonly statusText: string;
|
||||||
public readonly body: any;
|
public readonly body: unknown;
|
||||||
public readonly request: ApiRequestOptions;
|
public readonly request: ApiRequestOptions;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type ApiRequestOptions = {
|
export type ApiRequestOptions = {
|
||||||
readonly method:
|
readonly method:
|
||||||
| "GET"
|
| "GET"
|
||||||
@@ -12,11 +8,11 @@ export type ApiRequestOptions = {
|
|||||||
| "HEAD"
|
| "HEAD"
|
||||||
| "PATCH";
|
| "PATCH";
|
||||||
readonly url: string;
|
readonly url: string;
|
||||||
readonly path?: Record<string, any>;
|
readonly path?: Record<string, unknown>;
|
||||||
readonly cookies?: Record<string, any>;
|
readonly cookies?: Record<string, unknown>;
|
||||||
readonly headers?: Record<string, any>;
|
readonly headers?: Record<string, unknown>;
|
||||||
readonly query?: Record<string, any>;
|
readonly query?: Record<string, unknown>;
|
||||||
readonly formData?: Record<string, any>;
|
readonly formData?: Record<string, unknown>;
|
||||||
readonly body?: any;
|
readonly body?: any;
|
||||||
readonly mediaType?: string;
|
readonly mediaType?: string;
|
||||||
readonly responseHeader?: string;
|
readonly responseHeader?: string;
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
export type ApiResult<TData = any> = {
|
||||||
/* istanbul ignore file */
|
readonly body: TData;
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type ApiResult = {
|
|
||||||
readonly url: string;
|
|
||||||
readonly ok: boolean;
|
readonly ok: boolean;
|
||||||
readonly status: number;
|
readonly status: number;
|
||||||
readonly statusText: string;
|
readonly statusText: string;
|
||||||
readonly body: any;
|
readonly url: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||||
import { BaseHttpRequest } from "./BaseHttpRequest";
|
import { BaseHttpRequest } from "./BaseHttpRequest";
|
||||||
import type { CancelablePromise } from "./CancelablePromise";
|
import type { CancelablePromise } from "./CancelablePromise";
|
||||||
import type { OpenAPIConfig } from "./OpenAPI";
|
import type { OpenAPIConfig } from "./OpenAPI";
|
||||||
import { request as __request } from "./request";
|
import { request as __request } from "./request";
|
||||||
|
|
||||||
export class FetchHttpRequest extends BaseHttpRequest {
|
export class AxiosHttpRequest extends BaseHttpRequest {
|
||||||
constructor(config: OpenAPIConfig) {
|
constructor(config: OpenAPIConfig) {
|
||||||
super(config);
|
super(config);
|
||||||
}
|
}
|
||||||
@@ -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 { ApiRequestOptions } from "./ApiRequestOptions";
|
||||||
import type { CancelablePromise } from "./CancelablePromise";
|
import type { CancelablePromise } from "./CancelablePromise";
|
||||||
import type { OpenAPIConfig } from "./OpenAPI";
|
import type { OpenAPIConfig } from "./OpenAPI";
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export class CancelError extends Error {
|
export class CancelError extends Error {
|
||||||
constructor(message: string) {
|
constructor(message: string) {
|
||||||
super(message);
|
super(message);
|
||||||
@@ -28,12 +24,12 @@ export class CancelablePromise<T> implements Promise<T> {
|
|||||||
readonly #cancelHandlers: (() => void)[];
|
readonly #cancelHandlers: (() => void)[];
|
||||||
readonly #promise: Promise<T>;
|
readonly #promise: Promise<T>;
|
||||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||||
#reject?: (reason?: any) => void;
|
#reject?: (reason?: unknown) => void;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
executor: (
|
executor: (
|
||||||
resolve: (value: T | PromiseLike<T>) => void,
|
resolve: (value: T | PromiseLike<T>) => void,
|
||||||
reject: (reason?: any) => void,
|
reject: (reason?: unknown) => void,
|
||||||
onCancel: OnCancel,
|
onCancel: OnCancel,
|
||||||
) => void,
|
) => void,
|
||||||
) {
|
) {
|
||||||
@@ -53,7 +49,7 @@ export class CancelablePromise<T> implements Promise<T> {
|
|||||||
if (this.#resolve) this.#resolve(value);
|
if (this.#resolve) this.#resolve(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onReject = (reason?: any): void => {
|
const onReject = (reason?: unknown): void => {
|
||||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -90,13 +86,13 @@ export class CancelablePromise<T> implements Promise<T> {
|
|||||||
|
|
||||||
public then<TResult1 = T, TResult2 = never>(
|
public then<TResult1 = T, TResult2 = never>(
|
||||||
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
||||||
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
|
onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null,
|
||||||
): Promise<TResult1 | TResult2> {
|
): Promise<TResult1 | TResult2> {
|
||||||
return this.#promise.then(onFulfilled, onRejected);
|
return this.#promise.then(onFulfilled, onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public catch<TResult = never>(
|
public catch<TResult = never>(
|
||||||
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,
|
onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null,
|
||||||
): Promise<T | TResult> {
|
): Promise<T | TResult> {
|
||||||
return this.#promise.catch(onRejected);
|
return this.#promise.catch(onRejected);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 { ApiRequestOptions } from "./ApiRequestOptions";
|
||||||
|
import type { TConfig, TResult } from "./types";
|
||||||
|
|
||||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||||
type Headers = Record<string, string>;
|
type Headers = Record<string, string>;
|
||||||
|
|
||||||
export type OpenAPIConfig = {
|
export type OpenAPIConfig = {
|
||||||
BASE: string;
|
BASE: string;
|
||||||
VERSION: string;
|
|
||||||
WITH_CREDENTIALS: boolean;
|
|
||||||
CREDENTIALS: "include" | "omit" | "same-origin";
|
CREDENTIALS: "include" | "omit" | "same-origin";
|
||||||
|
ENCODE_PATH?: ((path: string) => string) | undefined;
|
||||||
|
HEADERS?: Headers | Resolver<Headers> | undefined;
|
||||||
|
PASSWORD?: string | Resolver<string> | undefined;
|
||||||
|
RESULT?: TResult;
|
||||||
TOKEN?: string | Resolver<string> | undefined;
|
TOKEN?: string | Resolver<string> | undefined;
|
||||||
USERNAME?: string | Resolver<string> | undefined;
|
USERNAME?: string | Resolver<string> | undefined;
|
||||||
PASSWORD?: string | Resolver<string> | undefined;
|
VERSION: string;
|
||||||
HEADERS?: Headers | Resolver<Headers> | undefined;
|
WITH_CREDENTIALS: boolean;
|
||||||
ENCODE_PATH?: ((path: string) => string) | undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const OpenAPI: OpenAPIConfig = {
|
export const OpenAPI: OpenAPIConfig = {
|
||||||
BASE: "",
|
BASE: "",
|
||||||
VERSION: "0.1.0",
|
|
||||||
WITH_CREDENTIALS: false,
|
|
||||||
CREDENTIALS: "include",
|
CREDENTIALS: "include",
|
||||||
|
ENCODE_PATH: undefined,
|
||||||
|
HEADERS: undefined,
|
||||||
|
PASSWORD: undefined,
|
||||||
|
RESULT: "body",
|
||||||
TOKEN: undefined,
|
TOKEN: undefined,
|
||||||
USERNAME: undefined,
|
USERNAME: undefined,
|
||||||
PASSWORD: undefined,
|
VERSION: "0.1.0",
|
||||||
HEADERS: undefined,
|
WITH_CREDENTIALS: false,
|
||||||
ENCODE_PATH: undefined,
|
};
|
||||||
|
|
||||||
|
export const mergeOpenApiConfig = <T extends TResult>(
|
||||||
|
config: OpenAPIConfig,
|
||||||
|
overrides: TConfig<T>,
|
||||||
|
) => {
|
||||||
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
import axios from "axios";
|
||||||
/* istanbul ignore file */
|
import type {
|
||||||
/* tslint:disable */
|
AxiosError,
|
||||||
/* eslint-disable */
|
AxiosRequestConfig,
|
||||||
|
AxiosResponse,
|
||||||
|
AxiosInstance,
|
||||||
|
} from "axios";
|
||||||
|
import FormData from "form-data";
|
||||||
|
|
||||||
import { ApiError } from "./ApiError";
|
import { ApiError } from "./ApiError";
|
||||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||||
import type { ApiResult } from "./ApiResult";
|
import type { ApiResult } from "./ApiResult";
|
||||||
@@ -9,22 +14,17 @@ import { CancelablePromise } from "./CancelablePromise";
|
|||||||
import type { OnCancel } from "./CancelablePromise";
|
import type { OnCancel } from "./CancelablePromise";
|
||||||
import type { OpenAPIConfig } from "./OpenAPI";
|
import type { OpenAPIConfig } from "./OpenAPI";
|
||||||
|
|
||||||
export const isDefined = <T>(
|
export const isString = (value: unknown): value is string => {
|
||||||
value: T | null | undefined,
|
|
||||||
): value is Exclude<T, null | undefined> => {
|
|
||||||
return value !== undefined && value !== null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isString = (value: any): value is string => {
|
|
||||||
return typeof value === "string";
|
return typeof value === "string";
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isStringWithValue = (value: any): value is string => {
|
export const isStringWithValue = (value: unknown): value is string => {
|
||||||
return isString(value) && value !== "";
|
return isString(value) && value !== "";
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isBlob = (value: any): value is Blob => {
|
export const isBlob = (value: any): value is Blob => {
|
||||||
return (
|
return (
|
||||||
|
value !== null &&
|
||||||
typeof value === "object" &&
|
typeof value === "object" &&
|
||||||
typeof value.type === "string" &&
|
typeof value.type === "string" &&
|
||||||
typeof value.stream === "function" &&
|
typeof value.stream === "function" &&
|
||||||
@@ -32,14 +32,19 @@ export const isBlob = (value: any): value is Blob => {
|
|||||||
typeof value.constructor === "function" &&
|
typeof value.constructor === "function" &&
|
||||||
typeof value.constructor.name === "string" &&
|
typeof value.constructor.name === "string" &&
|
||||||
/^(Blob|File)$/.test(value.constructor.name) &&
|
/^(Blob|File)$/.test(value.constructor.name) &&
|
||||||
|
// @ts-ignore
|
||||||
/^(Blob|File)$/.test(value[Symbol.toStringTag])
|
/^(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;
|
return value instanceof FormData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isSuccess = (status: number): boolean => {
|
||||||
|
return status >= 200 && status < 300;
|
||||||
|
};
|
||||||
|
|
||||||
export const base64 = (str: string): string => {
|
export const base64 = (str: string): string => {
|
||||||
try {
|
try {
|
||||||
return btoa(str);
|
return btoa(str);
|
||||||
@@ -49,38 +54,30 @@ export const base64 = (str: string): string => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getQueryString = (params: Record<string, any>): string => {
|
export const getQueryString = (params: Record<string, unknown>): string => {
|
||||||
const qs: string[] = [];
|
const qs: string[] = [];
|
||||||
|
|
||||||
const append = (key: string, value: any) => {
|
const append = (key: string, value: unknown) => {
|
||||||
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const process = (key: string, value: any) => {
|
const encodePair = (key: string, value: unknown) => {
|
||||||
if (isDefined(value)) {
|
if (value === undefined || value === null) {
|
||||||
if (Array.isArray(value)) {
|
return;
|
||||||
value.forEach((v) => {
|
}
|
||||||
process(key, v);
|
|
||||||
});
|
if (Array.isArray(value)) {
|
||||||
} else if (typeof value === "object") {
|
value.forEach((v) => encodePair(key, v));
|
||||||
Object.entries(value).forEach(([k, v]) => {
|
} else if (typeof value === "object") {
|
||||||
process(`${key}[${k}]`, v);
|
Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));
|
||||||
});
|
} else {
|
||||||
} else {
|
append(key, value);
|
||||||
append(key, value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.entries(params).forEach(([key, value]) => {
|
Object.entries(params).forEach(([key, value]) => encodePair(key, value));
|
||||||
process(key, value);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (qs.length > 0) {
|
return qs.length ? `?${qs.join("&")}` : "";
|
||||||
return `?${qs.join("&")}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
||||||
@@ -95,11 +92,8 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
|||||||
return substring;
|
return substring;
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = `${config.BASE}${path}`;
|
const url = config.BASE + path;
|
||||||
if (options.query) {
|
return options.query ? url + getQueryString(options.query) : url;
|
||||||
return `${url}${getQueryString(options.query)}`;
|
|
||||||
}
|
|
||||||
return url;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getFormData = (
|
export const getFormData = (
|
||||||
@@ -117,7 +111,7 @@ export const getFormData = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
Object.entries(options.formData)
|
Object.entries(options.formData)
|
||||||
.filter(([_, value]) => isDefined(value))
|
.filter(([_, value]) => value !== undefined && value !== null)
|
||||||
.forEach(([key, value]) => {
|
.forEach(([key, value]) => {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
value.forEach((v) => process(key, v));
|
value.forEach((v) => process(key, v));
|
||||||
@@ -146,7 +140,8 @@ export const resolve = async <T>(
|
|||||||
export const getHeaders = async (
|
export const getHeaders = async (
|
||||||
config: OpenAPIConfig,
|
config: OpenAPIConfig,
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions,
|
||||||
): Promise<Headers> => {
|
formData?: FormData,
|
||||||
|
): Promise<Record<string, string>> => {
|
||||||
const [token, username, password, additionalHeaders] = await Promise.all([
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
||||||
resolve(options, config.TOKEN),
|
resolve(options, config.TOKEN),
|
||||||
resolve(options, config.USERNAME),
|
resolve(options, config.USERNAME),
|
||||||
@@ -154,12 +149,17 @@ export const getHeaders = async (
|
|||||||
resolve(options, config.HEADERS),
|
resolve(options, config.HEADERS),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const formHeaders =
|
||||||
|
(typeof formData?.getHeaders === "function" && formData?.getHeaders()) ||
|
||||||
|
{};
|
||||||
|
|
||||||
const headers = Object.entries({
|
const headers = Object.entries({
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
...additionalHeaders,
|
...additionalHeaders,
|
||||||
...options.headers,
|
...options.headers,
|
||||||
|
...formHeaders,
|
||||||
})
|
})
|
||||||
.filter(([_, value]) => isDefined(value))
|
.filter(([_, value]) => value !== undefined && value !== null)
|
||||||
.reduce(
|
.reduce(
|
||||||
(headers, [key, value]) => ({
|
(headers, [key, value]) => ({
|
||||||
...headers,
|
...headers,
|
||||||
@@ -189,59 +189,56 @@ export const getHeaders = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Headers(headers);
|
return headers;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getRequestBody = (options: ApiRequestOptions): any => {
|
export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
||||||
if (options.body !== undefined) {
|
if (options.body) {
|
||||||
if (options.mediaType?.includes("/json")) {
|
return options.body;
|
||||||
return JSON.stringify(options.body);
|
|
||||||
} else if (
|
|
||||||
isString(options.body) ||
|
|
||||||
isBlob(options.body) ||
|
|
||||||
isFormData(options.body)
|
|
||||||
) {
|
|
||||||
return options.body;
|
|
||||||
} else {
|
|
||||||
return JSON.stringify(options.body);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendRequest = async (
|
export const sendRequest = async <T>(
|
||||||
config: OpenAPIConfig,
|
config: OpenAPIConfig,
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions,
|
||||||
url: string,
|
url: string,
|
||||||
body: any,
|
body: unknown,
|
||||||
formData: FormData | undefined,
|
formData: FormData | undefined,
|
||||||
headers: Headers,
|
headers: Record<string, string>,
|
||||||
onCancel: OnCancel,
|
onCancel: OnCancel,
|
||||||
): Promise<Response> => {
|
axiosClient: AxiosInstance,
|
||||||
|
): Promise<AxiosResponse<T>> => {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
|
|
||||||
const request: RequestInit = {
|
const requestConfig: AxiosRequestConfig = {
|
||||||
|
url,
|
||||||
headers,
|
headers,
|
||||||
body: body ?? formData,
|
data: body ?? formData,
|
||||||
method: options.method,
|
method: options.method,
|
||||||
|
withCredentials: config.WITH_CREDENTIALS,
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (config.WITH_CREDENTIALS) {
|
|
||||||
request.credentials = config.CREDENTIALS;
|
|
||||||
}
|
|
||||||
|
|
||||||
onCancel(() => controller.abort());
|
onCancel(() => controller.abort());
|
||||||
|
|
||||||
return await fetch(url, request);
|
try {
|
||||||
|
return await axiosClient.request(requestConfig);
|
||||||
|
} catch (error) {
|
||||||
|
const axiosError = error as AxiosError<T>;
|
||||||
|
if (axiosError.response) {
|
||||||
|
return axiosError.response;
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getResponseHeader = (
|
export const getResponseHeader = (
|
||||||
response: Response,
|
response: AxiosResponse<unknown>,
|
||||||
responseHeader?: string,
|
responseHeader?: string,
|
||||||
): string | undefined => {
|
): string | undefined => {
|
||||||
if (responseHeader) {
|
if (responseHeader) {
|
||||||
const content = response.headers.get(responseHeader);
|
const content = response.headers[responseHeader];
|
||||||
if (isString(content)) {
|
if (isString(content)) {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
@@ -249,24 +246,9 @@ export const getResponseHeader = (
|
|||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getResponseBody = async (response: Response): Promise<any> => {
|
export const getResponseBody = (response: AxiosResponse<unknown>): unknown => {
|
||||||
if (response.status !== 204) {
|
if (response.status !== 204) {
|
||||||
try {
|
return response.data;
|
||||||
const contentType = response.headers.get("Content-Type");
|
|
||||||
if (contentType) {
|
|
||||||
const jsonTypes = ["application/json", "application/problem+json"];
|
|
||||||
const isJSON = jsonTypes.some((type) =>
|
|
||||||
contentType.toLowerCase().startsWith(type),
|
|
||||||
);
|
|
||||||
if (isJSON) {
|
|
||||||
return await response.json();
|
|
||||||
} else {
|
|
||||||
return await response.text();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
@@ -314,22 +296,24 @@ export const catchErrorCodes = (
|
|||||||
* Request method
|
* Request method
|
||||||
* @param config The OpenAPI configuration object
|
* @param config The OpenAPI configuration object
|
||||||
* @param options The request options from the service
|
* @param options The request options from the service
|
||||||
|
* @param axiosClient The axios client instance to use
|
||||||
* @returns CancelablePromise<T>
|
* @returns CancelablePromise<T>
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
export const request = <T>(
|
export const request = <T>(
|
||||||
config: OpenAPIConfig,
|
config: OpenAPIConfig,
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions,
|
||||||
|
axiosClient: AxiosInstance = axios,
|
||||||
): CancelablePromise<T> => {
|
): CancelablePromise<T> => {
|
||||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||||
try {
|
try {
|
||||||
const url = getUrl(config, options);
|
const url = getUrl(config, options);
|
||||||
const formData = getFormData(options);
|
const formData = getFormData(options);
|
||||||
const body = getRequestBody(options);
|
const body = getRequestBody(options);
|
||||||
const headers = await getHeaders(config, options);
|
const headers = await getHeaders(config, options, formData);
|
||||||
|
|
||||||
if (!onCancel.isCancelled) {
|
if (!onCancel.isCancelled) {
|
||||||
const response = await sendRequest(
|
const response = await sendRequest<T>(
|
||||||
config,
|
config,
|
||||||
options,
|
options,
|
||||||
url,
|
url,
|
||||||
@@ -337,8 +321,9 @@ export const request = <T>(
|
|||||||
formData,
|
formData,
|
||||||
headers,
|
headers,
|
||||||
onCancel,
|
onCancel,
|
||||||
|
axiosClient,
|
||||||
);
|
);
|
||||||
const responseBody = await getResponseBody(response);
|
const responseBody = getResponseBody(response);
|
||||||
const responseHeader = getResponseHeader(
|
const responseHeader = getResponseHeader(
|
||||||
response,
|
response,
|
||||||
options.responseHeader,
|
options.responseHeader,
|
||||||
@@ -346,7 +331,7 @@ export const request = <T>(
|
|||||||
|
|
||||||
const result: ApiResult = {
|
const result: ApiResult = {
|
||||||
url,
|
url,
|
||||||
ok: response.ok,
|
ok: isSuccess(response.status),
|
||||||
status: response.status,
|
status: response.status,
|
||||||
statusText: response.statusText,
|
statusText: response.statusText,
|
||||||
body: responseHeader ?? responseBody,
|
body: responseHeader ?? responseBody,
|
||||||
|
|||||||
14
www/app/api/core/types.ts
Normal file
14
www/app/api/core/types.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import type { ApiResult } from "./ApiResult";
|
||||||
|
|
||||||
|
export type TResult = "body" | "raw";
|
||||||
|
|
||||||
|
export type TApiResponse<T extends TResult, TData> = Exclude<
|
||||||
|
T,
|
||||||
|
"raw"
|
||||||
|
> extends never
|
||||||
|
? ApiResult<TData>
|
||||||
|
: ApiResult<TData>["body"];
|
||||||
|
|
||||||
|
export type TConfig<T extends TResult> = {
|
||||||
|
_result?: T;
|
||||||
|
};
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export { OpenApi } from "./OpenApi";
|
export { OpenApi } from "./OpenApi";
|
||||||
|
|
||||||
export { ApiError } from "./core/ApiError";
|
export { ApiError } from "./core/ApiError";
|
||||||
@@ -35,4 +31,29 @@ export type { UserInfo } from "./models/UserInfo";
|
|||||||
export type { ValidationError } from "./models/ValidationError";
|
export type { ValidationError } from "./models/ValidationError";
|
||||||
export type { Word } from "./models/Word";
|
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 { DefaultService } from "./services/DefaultService";
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type AudioWaveform = {
|
export type AudioWaveform = {
|
||||||
data: Array<number>;
|
data: Array<number>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 =
|
export type Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post =
|
||||||
{
|
{
|
||||||
file: Blob;
|
file: Blob;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type CreateParticipant = {
|
export type CreateParticipant = {
|
||||||
speaker?: number | null;
|
speaker?: number | null;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type CreateTranscript = {
|
export type CreateTranscript = {
|
||||||
name: string;
|
name: string;
|
||||||
source_language?: string;
|
source_language?: string;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type DeletionStatus = {
|
export type DeletionStatus = {
|
||||||
status: string;
|
status: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { TranscriptParticipant } from "./TranscriptParticipant";
|
import type { TranscriptParticipant } from "./TranscriptParticipant";
|
||||||
|
|
||||||
export type GetTranscript = {
|
export type GetTranscript = {
|
||||||
id: string;
|
id: string;
|
||||||
user_id: string | null;
|
user_id: string | null;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type GetTranscriptSegmentTopic = {
|
export type GetTranscriptSegmentTopic = {
|
||||||
text: string;
|
text: string;
|
||||||
start: number;
|
start: number;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
import type { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
||||||
|
|
||||||
export type GetTranscriptTopic = {
|
export type GetTranscriptTopic = {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@@ -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 { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
||||||
import type { Word } from "./Word";
|
import type { Word } from "./Word";
|
||||||
|
|
||||||
export type GetTranscriptTopicWithWords = {
|
export type GetTranscriptTopicWithWords = {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@@ -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 { GetTranscriptSegmentTopic } from "./GetTranscriptSegmentTopic";
|
||||||
import type { SpeakerWords } from "./SpeakerWords";
|
import type { SpeakerWords } from "./SpeakerWords";
|
||||||
|
|
||||||
export type GetTranscriptTopicWithWordsPerSpeaker = {
|
export type GetTranscriptTopicWithWordsPerSpeaker = {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { ValidationError } from "./ValidationError";
|
import type { ValidationError } from "./ValidationError";
|
||||||
|
|
||||||
export type HTTPValidationError = {
|
export type HTTPValidationError = {
|
||||||
detail?: Array<ValidationError>;
|
detail?: Array<ValidationError>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { GetTranscript } from "./GetTranscript";
|
import type { GetTranscript } from "./GetTranscript";
|
||||||
|
|
||||||
export type Page_GetTranscript_ = {
|
export type Page_GetTranscript_ = {
|
||||||
items: Array<GetTranscript>;
|
items: Array<GetTranscript>;
|
||||||
total: number;
|
total: number;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type Participant = {
|
export type Participant = {
|
||||||
id: string;
|
id: string;
|
||||||
speaker: number | null;
|
speaker: number | null;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type RtcOffer = {
|
export type RtcOffer = {
|
||||||
sdp: string;
|
sdp: string;
|
||||||
type: string;
|
type: string;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type SpeakerAssignment = {
|
export type SpeakerAssignment = {
|
||||||
speaker?: number | null;
|
speaker?: number | null;
|
||||||
participant?: string | null;
|
participant?: string | null;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type SpeakerAssignmentStatus = {
|
export type SpeakerAssignmentStatus = {
|
||||||
status: string;
|
status: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type SpeakerMerge = {
|
export type SpeakerMerge = {
|
||||||
speaker_from: number;
|
speaker_from: number;
|
||||||
speaker_to: number;
|
speaker_to: number;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { Word } from "./Word";
|
import type { Word } from "./Word";
|
||||||
|
|
||||||
export type SpeakerWords = {
|
export type SpeakerWords = {
|
||||||
speaker: number;
|
speaker: number;
|
||||||
words: Array<Word>;
|
words: Array<Word>;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type TranscriptParticipant = {
|
export type TranscriptParticipant = {
|
||||||
id?: string;
|
id?: string;
|
||||||
speaker: number | null;
|
speaker: number | null;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type UpdateParticipant = {
|
export type UpdateParticipant = {
|
||||||
speaker?: number | null;
|
speaker?: number | null;
|
||||||
name?: string | null;
|
name?: string | null;
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { TranscriptParticipant } from "./TranscriptParticipant";
|
import type { TranscriptParticipant } from "./TranscriptParticipant";
|
||||||
|
|
||||||
export type UpdateTranscript = {
|
export type UpdateTranscript = {
|
||||||
name?: string | null;
|
name?: string | null;
|
||||||
locked?: boolean | null;
|
locked?: boolean | null;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type UserInfo = {
|
export type UserInfo = {
|
||||||
sub: string;
|
sub: string;
|
||||||
email: string | null;
|
email: string | null;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type ValidationError = {
|
export type ValidationError = {
|
||||||
loc: Array<string | number>;
|
loc: Array<string | number>;
|
||||||
msg: string;
|
msg: string;
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
export type Word = {
|
export type Word = {
|
||||||
text: string;
|
text: string;
|
||||||
start: number;
|
start: number;
|
||||||
|
|||||||
@@ -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<string>
|
|
||||||
| ((name?: string, scopes?: string[]) => string | Promise<string>); // 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<string>)
|
|
||||||
| 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<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
|
|
||||||
const next = this.clone<T>();
|
|
||||||
next.middleware = next.middleware.concat(...middlewares);
|
|
||||||
return next;
|
|
||||||
}
|
|
||||||
|
|
||||||
withPreMiddleware<T extends BaseAPI>(
|
|
||||||
this: T,
|
|
||||||
...preMiddlewares: Array<Middleware["pre"]>
|
|
||||||
) {
|
|
||||||
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
||||||
return this.withMiddleware<T>(...middlewares);
|
|
||||||
}
|
|
||||||
|
|
||||||
withPostMiddleware<T extends BaseAPI>(
|
|
||||||
this: T,
|
|
||||||
...postMiddlewares: Array<Middleware["post"]>
|
|
||||||
) {
|
|
||||||
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
||||||
return this.withMiddleware<T>(...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<Response> {
|
|
||||||
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<T extends BaseAPI>(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<string | number | null | boolean>
|
|
||||||
| Set<string | number | null | boolean>
|
|
||||||
| 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<RequestInit>;
|
|
||||||
|
|
||||||
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<string | number | null | boolean>
|
|
||||||
| Set<string | number | null | boolean>
|
|
||||||
| 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<FetchParams | void>;
|
|
||||||
post?(context: ResponseContext): Promise<Response | void>;
|
|
||||||
onError?(context: ErrorContext): Promise<Response | void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ApiResponse<T> {
|
|
||||||
raw: Response;
|
|
||||||
value(): Promise<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ResponseTransformer<T> {
|
|
||||||
(json: any): T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class JSONApiResponse<T> {
|
|
||||||
constructor(
|
|
||||||
public raw: Response,
|
|
||||||
private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
async value(): Promise<T> {
|
|
||||||
return this.transformer(await this.raw.json());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class VoidApiResponse {
|
|
||||||
constructor(public raw: Response) {}
|
|
||||||
|
|
||||||
async value(): Promise<void> {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class BlobApiResponse {
|
|
||||||
constructor(public raw: Response) {}
|
|
||||||
|
|
||||||
async value(): Promise<Blob> {
|
|
||||||
return await this.raw.blob();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TextApiResponse {
|
|
||||||
constructor(public raw: Response) {}
|
|
||||||
|
|
||||||
async value(): Promise<string> {
|
|
||||||
return await this.raw.text();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
11
www/app/api/schemas/$AudioWaveform.ts
Normal file
11
www/app/api/schemas/$AudioWaveform.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export const $AudioWaveform = {
|
||||||
|
properties: {
|
||||||
|
data: {
|
||||||
|
type: "array",
|
||||||
|
contains: {
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
@@ -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;
|
||||||
19
www/app/api/schemas/$CreateParticipant.ts
Normal file
19
www/app/api/schemas/$CreateParticipant.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
export const $CreateParticipant = {
|
||||||
|
properties: {
|
||||||
|
speaker: {
|
||||||
|
type: "any-of",
|
||||||
|
contains: [
|
||||||
|
{
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "null",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: "string",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
14
www/app/api/schemas/$CreateTranscript.ts
Normal file
14
www/app/api/schemas/$CreateTranscript.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export const $CreateTranscript = {
|
||||||
|
properties: {
|
||||||
|
name: {
|
||||||
|
type: "string",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
source_language: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
target_language: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
8
www/app/api/schemas/$DeletionStatus.ts
Normal file
8
www/app/api/schemas/$DeletionStatus.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const $DeletionStatus = {
|
||||||
|
properties: {
|
||||||
|
status: {
|
||||||
|
type: "string",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
123
www/app/api/schemas/$GetTranscript.ts
Normal file
123
www/app/api/schemas/$GetTranscript.ts
Normal file
@@ -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;
|
||||||
16
www/app/api/schemas/$GetTranscriptSegmentTopic.ts
Normal file
16
www/app/api/schemas/$GetTranscriptSegmentTopic.ts
Normal file
@@ -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;
|
||||||
42
www/app/api/schemas/$GetTranscriptTopic.ts
Normal file
42
www/app/api/schemas/$GetTranscriptTopic.ts
Normal file
@@ -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;
|
||||||
48
www/app/api/schemas/$GetTranscriptTopicWithWords.ts
Normal file
48
www/app/api/schemas/$GetTranscriptTopicWithWords.ts
Normal file
@@ -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;
|
||||||
@@ -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;
|
||||||
10
www/app/api/schemas/$HTTPValidationError.ts
Normal file
10
www/app/api/schemas/$HTTPValidationError.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export const $HTTPValidationError = {
|
||||||
|
properties: {
|
||||||
|
detail: {
|
||||||
|
type: "array",
|
||||||
|
contains: {
|
||||||
|
type: "ValidationError",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
52
www/app/api/schemas/$Page_GetTranscript_.ts
Normal file
52
www/app/api/schemas/$Page_GetTranscript_.ts
Normal file
@@ -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;
|
||||||
24
www/app/api/schemas/$Participant.ts
Normal file
24
www/app/api/schemas/$Participant.ts
Normal file
@@ -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;
|
||||||
12
www/app/api/schemas/$RtcOffer.ts
Normal file
12
www/app/api/schemas/$RtcOffer.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export const $RtcOffer = {
|
||||||
|
properties: {
|
||||||
|
sdp: {
|
||||||
|
type: "string",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: "string",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
34
www/app/api/schemas/$SpeakerAssignment.ts
Normal file
34
www/app/api/schemas/$SpeakerAssignment.ts
Normal file
@@ -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;
|
||||||
8
www/app/api/schemas/$SpeakerAssignmentStatus.ts
Normal file
8
www/app/api/schemas/$SpeakerAssignmentStatus.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const $SpeakerAssignmentStatus = {
|
||||||
|
properties: {
|
||||||
|
status: {
|
||||||
|
type: "string",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
12
www/app/api/schemas/$SpeakerMerge.ts
Normal file
12
www/app/api/schemas/$SpeakerMerge.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export const $SpeakerMerge = {
|
||||||
|
properties: {
|
||||||
|
speaker_from: {
|
||||||
|
type: "number",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
speaker_to: {
|
||||||
|
type: "number",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
15
www/app/api/schemas/$SpeakerWords.ts
Normal file
15
www/app/api/schemas/$SpeakerWords.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
export const $SpeakerWords = {
|
||||||
|
properties: {
|
||||||
|
speaker: {
|
||||||
|
type: "number",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
words: {
|
||||||
|
type: "array",
|
||||||
|
contains: {
|
||||||
|
type: "Word",
|
||||||
|
},
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
23
www/app/api/schemas/$TranscriptParticipant.ts
Normal file
23
www/app/api/schemas/$TranscriptParticipant.ts
Normal file
@@ -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;
|
||||||
26
www/app/api/schemas/$UpdateParticipant.ts
Normal file
26
www/app/api/schemas/$UpdateParticipant.ts
Normal file
@@ -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;
|
||||||
95
www/app/api/schemas/$UpdateTranscript.ts
Normal file
95
www/app/api/schemas/$UpdateTranscript.ts
Normal file
@@ -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;
|
||||||
32
www/app/api/schemas/$UserInfo.ts
Normal file
32
www/app/api/schemas/$UserInfo.ts
Normal file
@@ -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;
|
||||||
27
www/app/api/schemas/$ValidationError.ts
Normal file
27
www/app/api/schemas/$ValidationError.ts
Normal file
@@ -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;
|
||||||
19
www/app/api/schemas/$Word.ts
Normal file
19
www/app/api/schemas/$Word.ts
Normal file
@@ -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;
|
||||||
@@ -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 { 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 { 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 { CreateParticipant } from "../models/CreateParticipant";
|
||||||
@@ -22,52 +18,138 @@ import type { UpdateTranscript } from "../models/UpdateTranscript";
|
|||||||
import type { UserInfo } from "../models/UserInfo";
|
import type { UserInfo } from "../models/UserInfo";
|
||||||
import type { CancelablePromise } from "../core/CancelablePromise";
|
import type { CancelablePromise } from "../core/CancelablePromise";
|
||||||
import type { BaseHttpRequest } from "../core/BaseHttpRequest";
|
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 {
|
export class DefaultService {
|
||||||
constructor(public readonly httpRequest: BaseHttpRequest) {}
|
constructor(public readonly httpRequest: BaseHttpRequest) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metrics
|
* Metrics
|
||||||
* Endpoint that serves Prometheus metrics.
|
* Endpoint that serves Prometheus metrics.
|
||||||
* @returns any Successful Response
|
* @returns unknown Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public metrics(): CancelablePromise<any> {
|
public metrics(): CancelablePromise<unknown> {
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/metrics",
|
url: "/metrics",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcripts List
|
* Transcripts List
|
||||||
* @param page Page number
|
|
||||||
* @param size Page size
|
|
||||||
* @returns Page_GetTranscript_ Successful Response
|
* @returns Page_GetTranscript_ Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptsList(
|
public v1TranscriptsList(
|
||||||
page: number = 1,
|
data: TDataV1TranscriptsList = {},
|
||||||
size: number = 50,
|
|
||||||
): CancelablePromise<Page_GetTranscript_> {
|
): CancelablePromise<Page_GetTranscript_> {
|
||||||
|
const { page = 1, size = 50 } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts",
|
url: "/v1/transcripts",
|
||||||
query: {
|
query: {
|
||||||
page: page,
|
page,
|
||||||
size: size,
|
size,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: `Validation Error`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcripts Create
|
* Transcripts Create
|
||||||
* @param requestBody
|
|
||||||
* @returns GetTranscript Successful Response
|
* @returns GetTranscript Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptsCreate(
|
public v1TranscriptsCreate(
|
||||||
requestBody: CreateTranscript,
|
data: TDataV1TranscriptsCreate,
|
||||||
): CancelablePromise<GetTranscript> {
|
): CancelablePromise<GetTranscript> {
|
||||||
|
const { requestBody } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/v1/transcripts",
|
url: "/v1/transcripts",
|
||||||
@@ -78,15 +160,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get
|
* Transcript Get
|
||||||
* @param transcriptId
|
|
||||||
* @returns GetTranscript Successful Response
|
* @returns GetTranscript Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGet(
|
public v1TranscriptGet(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGet,
|
||||||
): CancelablePromise<GetTranscript> {
|
): CancelablePromise<GetTranscript> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}",
|
url: "/v1/transcripts/{transcript_id}",
|
||||||
@@ -98,17 +181,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Update
|
* Transcript Update
|
||||||
* @param transcriptId
|
|
||||||
* @param requestBody
|
|
||||||
* @returns GetTranscript Successful Response
|
* @returns GetTranscript Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptUpdate(
|
public v1TranscriptUpdate(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptUpdate,
|
||||||
requestBody: UpdateTranscript,
|
|
||||||
): CancelablePromise<GetTranscript> {
|
): CancelablePromise<GetTranscript> {
|
||||||
|
const { requestBody, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/v1/transcripts/{transcript_id}",
|
url: "/v1/transcripts/{transcript_id}",
|
||||||
@@ -122,15 +204,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Delete
|
* Transcript Delete
|
||||||
* @param transcriptId
|
|
||||||
* @returns DeletionStatus Successful Response
|
* @returns DeletionStatus Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptDelete(
|
public v1TranscriptDelete(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptDelete,
|
||||||
): CancelablePromise<DeletionStatus> {
|
): CancelablePromise<DeletionStatus> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: "/v1/transcripts/{transcript_id}",
|
url: "/v1/transcripts/{transcript_id}",
|
||||||
@@ -142,15 +225,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Topics
|
* Transcript Get Topics
|
||||||
* @param transcriptId
|
|
||||||
* @returns GetTranscriptTopic Successful Response
|
* @returns GetTranscriptTopic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetTopics(
|
public v1TranscriptGetTopics(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetTopics,
|
||||||
): CancelablePromise<Array<GetTranscriptTopic>> {
|
): CancelablePromise<Array<GetTranscriptTopic>> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/topics",
|
url: "/v1/transcripts/{transcript_id}/topics",
|
||||||
@@ -162,15 +246,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Topics With Words
|
* Transcript Get Topics With Words
|
||||||
* @param transcriptId
|
|
||||||
* @returns GetTranscriptTopicWithWords Successful Response
|
* @returns GetTranscriptTopicWithWords Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetTopicsWithWords(
|
public v1TranscriptGetTopicsWithWords(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetTopicsWithWords,
|
||||||
): CancelablePromise<Array<GetTranscriptTopicWithWords>> {
|
): CancelablePromise<Array<GetTranscriptTopicWithWords>> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/topics/with-words",
|
url: "/v1/transcripts/{transcript_id}/topics/with-words",
|
||||||
@@ -182,17 +267,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Topics With Words Per Speaker
|
* Transcript Get Topics With Words Per Speaker
|
||||||
* @param transcriptId
|
|
||||||
* @param topicId
|
|
||||||
* @returns GetTranscriptTopicWithWordsPerSpeaker Successful Response
|
* @returns GetTranscriptTopicWithWordsPerSpeaker Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetTopicsWithWordsPerSpeaker(
|
public v1TranscriptGetTopicsWithWordsPerSpeaker(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetTopicsWithWordsPerSpeaker,
|
||||||
topicId: string,
|
|
||||||
): CancelablePromise<GetTranscriptTopicWithWordsPerSpeaker> {
|
): CancelablePromise<GetTranscriptTopicWithWordsPerSpeaker> {
|
||||||
|
const { topicId, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/topics/{topic_id}/words-per-speaker",
|
url: "/v1/transcripts/{transcript_id}/topics/{topic_id}/words-per-speaker",
|
||||||
@@ -205,17 +289,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Audio Mp3
|
* Transcript Get Audio Mp3
|
||||||
* @param transcriptId
|
* @returns unknown Successful Response
|
||||||
* @param token
|
|
||||||
* @returns any Successful Response
|
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptHeadAudioMp3(
|
public v1TranscriptHeadAudioMp3(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptHeadAudioMp3,
|
||||||
token?: string | null,
|
): CancelablePromise<unknown> {
|
||||||
): CancelablePromise<any> {
|
const { token, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "HEAD",
|
method: "HEAD",
|
||||||
url: "/v1/transcripts/{transcript_id}/audio/mp3",
|
url: "/v1/transcripts/{transcript_id}/audio/mp3",
|
||||||
@@ -223,24 +306,23 @@ export class DefaultService {
|
|||||||
transcript_id: transcriptId,
|
transcript_id: transcriptId,
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
token: token,
|
token,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: `Validation Error`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Audio Mp3
|
* Transcript Get Audio Mp3
|
||||||
* @param transcriptId
|
* @returns unknown Successful Response
|
||||||
* @param token
|
|
||||||
* @returns any Successful Response
|
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetAudioMp3(
|
public v1TranscriptGetAudioMp3(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetAudioMp3,
|
||||||
token?: string | null,
|
): CancelablePromise<unknown> {
|
||||||
): CancelablePromise<any> {
|
const { token, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/audio/mp3",
|
url: "/v1/transcripts/{transcript_id}/audio/mp3",
|
||||||
@@ -248,22 +330,23 @@ export class DefaultService {
|
|||||||
transcript_id: transcriptId,
|
transcript_id: transcriptId,
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
token: token,
|
token,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: `Validation Error`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Audio Waveform
|
* Transcript Get Audio Waveform
|
||||||
* @param transcriptId
|
|
||||||
* @returns AudioWaveform Successful Response
|
* @returns AudioWaveform Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetAudioWaveform(
|
public v1TranscriptGetAudioWaveform(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetAudioWaveform,
|
||||||
): CancelablePromise<AudioWaveform> {
|
): CancelablePromise<AudioWaveform> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/audio/waveform",
|
url: "/v1/transcripts/{transcript_id}/audio/waveform",
|
||||||
@@ -275,15 +358,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Participants
|
* Transcript Get Participants
|
||||||
* @param transcriptId
|
|
||||||
* @returns Participant Successful Response
|
* @returns Participant Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetParticipants(
|
public v1TranscriptGetParticipants(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetParticipants,
|
||||||
): CancelablePromise<Array<Participant>> {
|
): CancelablePromise<Array<Participant>> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/participants",
|
url: "/v1/transcripts/{transcript_id}/participants",
|
||||||
@@ -295,17 +379,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Add Participant
|
* Transcript Add Participant
|
||||||
* @param transcriptId
|
|
||||||
* @param requestBody
|
|
||||||
* @returns Participant Successful Response
|
* @returns Participant Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptAddParticipant(
|
public v1TranscriptAddParticipant(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptAddParticipant,
|
||||||
requestBody: CreateParticipant,
|
|
||||||
): CancelablePromise<Participant> {
|
): CancelablePromise<Participant> {
|
||||||
|
const { requestBody, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/v1/transcripts/{transcript_id}/participants",
|
url: "/v1/transcripts/{transcript_id}/participants",
|
||||||
@@ -319,17 +402,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Participant
|
* Transcript Get Participant
|
||||||
* @param transcriptId
|
|
||||||
* @param participantId
|
|
||||||
* @returns Participant Successful Response
|
* @returns Participant Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetParticipant(
|
public v1TranscriptGetParticipant(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetParticipant,
|
||||||
participantId: string,
|
|
||||||
): CancelablePromise<Participant> {
|
): CancelablePromise<Participant> {
|
||||||
|
const { participantId, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
||||||
@@ -342,19 +424,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Update Participant
|
* Transcript Update Participant
|
||||||
* @param transcriptId
|
|
||||||
* @param participantId
|
|
||||||
* @param requestBody
|
|
||||||
* @returns Participant Successful Response
|
* @returns Participant Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptUpdateParticipant(
|
public v1TranscriptUpdateParticipant(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptUpdateParticipant,
|
||||||
participantId: string,
|
|
||||||
requestBody: UpdateParticipant,
|
|
||||||
): CancelablePromise<Participant> {
|
): CancelablePromise<Participant> {
|
||||||
|
const { participantId, requestBody, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
||||||
@@ -369,17 +448,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Delete Participant
|
* Transcript Delete Participant
|
||||||
* @param transcriptId
|
|
||||||
* @param participantId
|
|
||||||
* @returns DeletionStatus Successful Response
|
* @returns DeletionStatus Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptDeleteParticipant(
|
public v1TranscriptDeleteParticipant(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptDeleteParticipant,
|
||||||
participantId: string,
|
|
||||||
): CancelablePromise<DeletionStatus> {
|
): CancelablePromise<DeletionStatus> {
|
||||||
|
const { participantId, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
url: "/v1/transcripts/{transcript_id}/participants/{participant_id}",
|
||||||
@@ -392,17 +470,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Assign Speaker
|
* Transcript Assign Speaker
|
||||||
* @param transcriptId
|
|
||||||
* @param requestBody
|
|
||||||
* @returns SpeakerAssignmentStatus Successful Response
|
* @returns SpeakerAssignmentStatus Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptAssignSpeaker(
|
public v1TranscriptAssignSpeaker(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptAssignSpeaker,
|
||||||
requestBody: SpeakerAssignment,
|
|
||||||
): CancelablePromise<SpeakerAssignmentStatus> {
|
): CancelablePromise<SpeakerAssignmentStatus> {
|
||||||
|
const { requestBody, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/v1/transcripts/{transcript_id}/speaker/assign",
|
url: "/v1/transcripts/{transcript_id}/speaker/assign",
|
||||||
@@ -416,17 +493,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Merge Speaker
|
* Transcript Merge Speaker
|
||||||
* @param transcriptId
|
|
||||||
* @param requestBody
|
|
||||||
* @returns SpeakerAssignmentStatus Successful Response
|
* @returns SpeakerAssignmentStatus Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptMergeSpeaker(
|
public v1TranscriptMergeSpeaker(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptMergeSpeaker,
|
||||||
requestBody: SpeakerMerge,
|
|
||||||
): CancelablePromise<SpeakerAssignmentStatus> {
|
): CancelablePromise<SpeakerAssignmentStatus> {
|
||||||
|
const { requestBody, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/v1/transcripts/{transcript_id}/speaker/merge",
|
url: "/v1/transcripts/{transcript_id}/speaker/merge",
|
||||||
@@ -440,17 +516,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Record Upload
|
* Transcript Record Upload
|
||||||
* @param transcriptId
|
* @returns unknown Successful Response
|
||||||
* @param formData
|
|
||||||
* @returns any Successful Response
|
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptRecordUpload(
|
public v1TranscriptRecordUpload(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptRecordUpload,
|
||||||
formData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post,
|
): CancelablePromise<unknown> {
|
||||||
): CancelablePromise<any> {
|
const { formData, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/v1/transcripts/{transcript_id}/record/upload",
|
url: "/v1/transcripts/{transcript_id}/record/upload",
|
||||||
@@ -464,15 +539,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Get Websocket Events
|
* Transcript Get Websocket Events
|
||||||
* @param transcriptId
|
* @returns unknown Successful Response
|
||||||
* @returns any Successful Response
|
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptGetWebsocketEvents(
|
public v1TranscriptGetWebsocketEvents(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptGetWebsocketEvents,
|
||||||
): CancelablePromise<any> {
|
): CancelablePromise<unknown> {
|
||||||
|
const { transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/v1/transcripts/{transcript_id}/events",
|
url: "/v1/transcripts/{transcript_id}/events",
|
||||||
@@ -484,17 +560,16 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transcript Record Webrtc
|
* Transcript Record Webrtc
|
||||||
* @param transcriptId
|
* @returns unknown Successful Response
|
||||||
* @param requestBody
|
|
||||||
* @returns any Successful Response
|
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1TranscriptRecordWebrtc(
|
public v1TranscriptRecordWebrtc(
|
||||||
transcriptId: string,
|
data: TDataV1TranscriptRecordWebrtc,
|
||||||
requestBody: RtcOffer,
|
): CancelablePromise<unknown> {
|
||||||
): CancelablePromise<any> {
|
const { requestBody, transcriptId } = data;
|
||||||
return this.httpRequest.request({
|
return this.httpRequest.request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/v1/transcripts/{transcript_id}/record/webrtc",
|
url: "/v1/transcripts/{transcript_id}/record/webrtc",
|
||||||
@@ -508,9 +583,10 @@ export class DefaultService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User Me
|
* User Me
|
||||||
* @returns any Successful Response
|
* @returns unknown Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public v1UserMe(): CancelablePromise<UserInfo | null> {
|
public v1UserMe(): CancelablePromise<UserInfo | null> {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"format": "prettier --write .",
|
"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": {
|
"dependencies": {
|
||||||
"@chakra-ui/icons": "^2.1.1",
|
"@chakra-ui/icons": "^2.1.1",
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
"license": "All Rights Reserved",
|
"license": "All Rights Reserved",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "18.2.20",
|
"@types/react": "18.2.20",
|
||||||
"openapi-typescript-codegen": "^0.29.0",
|
"@hey-api/openapi-ts": "^0.27.24",
|
||||||
"prettier": "^3.0.0"
|
"prettier": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
resolved "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz"
|
resolved "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz"
|
||||||
integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==
|
integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==
|
||||||
|
|
||||||
"@apidevtools/json-schema-ref-parser@^11.5.4":
|
"@apidevtools/json-schema-ref-parser@11.5.4":
|
||||||
version "11.6.4"
|
version "11.5.4"
|
||||||
resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.4.tgz#0f3e02302f646471d621a8850e6a346d63c8ebd4"
|
resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.5.4.tgz#6a90caf2140834025cf72651280c46084de187ae"
|
||||||
integrity sha512-9K6xOqeevacvweLGik6LnZCb1fBtCOSIWQs8d096XGeqoLKC33UVMGz9+77Gw44KvbH4pKcQPWo4ZpxkXYj05w==
|
integrity sha512-o2fsypTGU0WxRxbax8zQoHiIB4dyrkwYfcm8TxZ+bx9pCzcWZbQtiMqpgBvWA/nJ2TrGjK5adCLfTH8wUeU/Wg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jsdevtools/ono" "^7.1.3"
|
"@jsdevtools/ono" "^7.1.3"
|
||||||
"@types/json-schema" "^7.0.15"
|
"@types/json-schema" "^7.0.15"
|
||||||
@@ -1103,6 +1103,16 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
prop-types "^15.8.1"
|
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":
|
"@humanwhocodes/config-array@^0.11.13":
|
||||||
version "0.11.13"
|
version "0.11.13"
|
||||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297"
|
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"
|
resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz"
|
||||||
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
|
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
|
||||||
|
|
||||||
camelcase@^6.3.0:
|
camelcase@8.0.0:
|
||||||
version "6.3.0"
|
version "8.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-8.0.0.tgz#c0d36d418753fb6ad9c5e0437579745c1c14a534"
|
||||||
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
integrity sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==
|
||||||
|
|
||||||
caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503:
|
caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503:
|
||||||
version "1.0.30001572"
|
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"
|
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"
|
||||||
integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
|
integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
|
||||||
|
|
||||||
commander@^12.0.0:
|
commander@12.0.0:
|
||||||
version "12.1.0"
|
version "12.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592"
|
||||||
integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==
|
integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==
|
||||||
|
|
||||||
commander@^4.0.0:
|
commander@^4.0.0:
|
||||||
version "4.1.1"
|
version "4.1.1"
|
||||||
@@ -2809,15 +2819,6 @@ framesync@6.1.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
tslib "2.4.0"
|
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:
|
fs.realpath@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
|
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
|
||||||
@@ -2997,7 +2998,7 @@ gopd@^1.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
get-intrinsic "^1.1.3"
|
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"
|
version "4.2.11"
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
|
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==
|
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"
|
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
|
||||||
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
||||||
|
|
||||||
handlebars@^4.7.8:
|
handlebars@4.7.8:
|
||||||
version "4.7.8"
|
version "4.7.8"
|
||||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9"
|
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9"
|
||||||
integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==
|
integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==
|
||||||
@@ -3473,15 +3474,6 @@ json5@^1.0.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
minimist "^1.2.0"
|
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:
|
"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5:
|
||||||
version "3.3.5"
|
version "3.3.5"
|
||||||
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a"
|
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:
|
dependencies:
|
||||||
wrappy "1"
|
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:
|
optionator@^0.9.3:
|
||||||
version "0.9.3"
|
version "0.9.3"
|
||||||
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64"
|
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-is "^6.0.0"
|
||||||
unist-util-visit-parents "^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:
|
update-browserslist-db@^1.0.11:
|
||||||
version "1.0.11"
|
version "1.0.11"
|
||||||
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz"
|
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user