diff --git a/www/app/api/apis/DefaultApi.ts b/www/app/api/apis/DefaultApi.ts index 147fd770..752ef536 100644 --- a/www/app/api/apis/DefaultApi.ts +++ b/www/app/api/apis/DefaultApi.ts @@ -55,6 +55,10 @@ export interface V1TranscriptGetAudioRequest { transcriptId: any; } +export interface V1TranscriptGetAudioMp3Request { + transcriptId: any; +} + export interface V1TranscriptGetTopicsRequest { transcriptId: any; } @@ -159,6 +163,14 @@ export class DefaultApi extends runtime.BaseAPI { const headerParameters: runtime.HTTPHeaders = {}; + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken( + "OAuth2AuthorizationCodeBearer", + [], + ); + } + const response = await this.request( { path: `/v1/transcripts/{transcript_id}`.replace( @@ -212,6 +224,14 @@ export class DefaultApi extends runtime.BaseAPI { const headerParameters: runtime.HTTPHeaders = {}; + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken( + "OAuth2AuthorizationCodeBearer", + [], + ); + } + const response = await this.request( { path: `/v1/transcripts/{transcript_id}`.replace( @@ -299,6 +319,61 @@ export class DefaultApi extends runtime.BaseAPI { return await response.value(); } + /** + * Transcript Get Audio Mp3 + */ + async v1TranscriptGetAudioMp3Raw( + requestParameters: V1TranscriptGetAudioMp3Request, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if ( + requestParameters.transcriptId === null || + requestParameters.transcriptId === undefined + ) { + throw new runtime.RequiredError( + "transcriptId", + "Required parameter requestParameters.transcriptId was null or undefined when calling v1TranscriptGetAudioMp3.", + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request( + { + path: `/v1/transcripts/{transcript_id}/audio/mp3`.replace( + `{${"transcript_id"}}`, + encodeURIComponent(String(requestParameters.transcriptId)), + ), + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Transcript Get Audio Mp3 + */ + async v1TranscriptGetAudioMp3( + requestParameters: V1TranscriptGetAudioMp3Request, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.v1TranscriptGetAudioMp3Raw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + /** * Transcript Get Topics */ @@ -510,6 +585,14 @@ export class DefaultApi extends runtime.BaseAPI { headerParameters["Content-Type"] = "application/json"; + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken( + "OAuth2AuthorizationCodeBearer", + [], + ); + } + const response = await this.request( { path: `/v1/transcripts/{transcript_id}`.replace( @@ -566,6 +649,14 @@ export class DefaultApi extends runtime.BaseAPI { headerParameters["Content-Type"] = "application/json"; + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken( + "OAuth2AuthorizationCodeBearer", + [], + ); + } + const response = await this.request( { path: `/v1/transcripts`, @@ -615,6 +706,14 @@ export class DefaultApi extends runtime.BaseAPI { const headerParameters: runtime.HTTPHeaders = {}; + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken( + "OAuth2AuthorizationCodeBearer", + [], + ); + } + const response = await this.request( { path: `/v1/transcripts`, diff --git a/www/app/fiefWrapper.tsx b/www/app/fiefWrapper.tsx new file mode 100644 index 00000000..187fef7c --- /dev/null +++ b/www/app/fiefWrapper.tsx @@ -0,0 +1,11 @@ +"use client"; + +import { FiefAuthProvider } from "@fief/fief/nextjs/react"; + +export default function FiefWrapper({ children }) { + return ( + + {children} + + ); +} diff --git a/www/app/layout.tsx b/www/app/layout.tsx index e98b2cc4..85a8f17b 100644 --- a/www/app/layout.tsx +++ b/www/app/layout.tsx @@ -1,7 +1,8 @@ import "./styles/globals.scss"; import { Roboto } from "next/font/google"; import { Metadata } from "next"; -import { FiefAuthProvider } from "@fief/fief/nextjs/react"; +import FiefWrapper from "./fiefWrapper"; +import UserInfo from "./userInfo"; const roboto = Roboto({ subsets: ["latin"], weight: "400" }); @@ -51,14 +52,13 @@ export const metadata: Metadata = { export default function RootLayout({ children }) { return ( - - {" "} - {} - - + + + + {children} - - - + + + ); } diff --git a/www/app/lib/fief.ts b/www/app/lib/fief.ts index 4b83a03b..a2e610b2 100644 --- a/www/app/lib/fief.ts +++ b/www/app/lib/fief.ts @@ -1,3 +1,4 @@ +"use client"; import { Fief, FiefUserInfo } from "@fief/fief"; import { FiefAuth, IUserInfoCache } from "@fief/fief/nextjs"; diff --git a/www/app/transcripts/useTranscript.tsx b/www/app/transcripts/useTranscript.tsx index 11510020..26e0d440 100644 --- a/www/app/transcripts/useTranscript.tsx +++ b/www/app/transcripts/useTranscript.tsx @@ -17,6 +17,7 @@ const useTranscript = (): UseTranscript => { const apiConfiguration = new Configuration({ basePath: process.env.NEXT_PUBLIC_API_URL, + // accessToken: }); const api = new DefaultApi(apiConfiguration); diff --git a/www/app/userInfo.tsx b/www/app/userInfo.tsx new file mode 100644 index 00000000..bf8d19c5 --- /dev/null +++ b/www/app/userInfo.tsx @@ -0,0 +1,23 @@ +"use client"; +import { useFiefUserinfo } from "@fief/fief/nextjs/react"; + +export default function UserInfo() { + const userinfo = useFiefUserinfo(); + + return ( + <> + {userinfo && ( + <> +

Logged In

+

{userinfo.email}

+ + )} + + {!userinfo && ( + <> +

Not Logged In

+ + )} + + ); +}