export type PublishViewType = 1 | 2 | 3 | 4; export type APIWorkspaceViewType = 2 | 3; export type LessonWSParams = {pageNumber?: number | undefined, pageRows?: number | undefined, is3D?: boolean | undefined, is360?: boolean | undefined, isMVB?: boolean | undefined, pubType?: PublishViewType | undefined, viewType?: APIWorkspaceViewType | undefined, sortBy?: (string | null) | undefined, categoryId?: number | undefined, searchTerm?: (string | null) | undefined, institutionId?: number | undefined}; export type CreateApiWorkspaceGetMyLessonsArgs = {'X-Version'?: string | undefined, body: LessonWSParams}; export type CreateApiWorkspaceGetMyLessonsOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get My Workspace Lessons * * POST /Workspace/GetMyLessons */ export const createApiWorkspaceGetMyLessons = async (args: CreateApiWorkspaceGetMyLessonsArgs, options: CreateApiWorkspaceGetMyLessonsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Version'] != null) headers.set("X-Version", String(args['X-Version'])) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/Workspace/GetMyLessons${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };