fix: 🐛 error loading SKOLA24_CHILDREN SAML
This commit is contained in:
parent
0a76e6c9a9
commit
508b0792a1
|
@ -5,17 +5,20 @@ import {
|
|||
Classmate,
|
||||
CookieManager,
|
||||
EtjanstChild,
|
||||
Fetch,
|
||||
Fetcher,
|
||||
FetcherOptions,
|
||||
LoginStatusChecker,
|
||||
MenuItem,
|
||||
NewsItem,
|
||||
Notification,
|
||||
RequestInit,
|
||||
Response,
|
||||
ScheduleItem,
|
||||
Skola24Child,
|
||||
SSOSystem,
|
||||
TimetableEntry,
|
||||
URLSearchParams,
|
||||
User,
|
||||
wrap,
|
||||
} from '@skolplattformen/api'
|
||||
|
@ -67,7 +70,7 @@ export class ApiSkolplattformen extends EventEmitter implements Api {
|
|||
private authorizedSystems: SSOSystems = {}
|
||||
|
||||
constructor(
|
||||
fetch: typeof global.fetch,
|
||||
fetch: Fetch, // typeof global.fetch,
|
||||
cookieManager: CookieManager,
|
||||
options?: FetcherOptions
|
||||
) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Response } from './types'
|
||||
import { Response, Fetch, RequestInit } from './types'
|
||||
|
||||
export interface CallInfo extends RequestInit {
|
||||
name: string
|
||||
|
@ -48,7 +48,7 @@ const record = async (
|
|||
}
|
||||
|
||||
export default function wrap(
|
||||
fetch: typeof global.fetch,
|
||||
fetch: Fetch,
|
||||
options: FetcherOptions = {}
|
||||
): Fetcher {
|
||||
return async (
|
||||
|
|
|
@ -88,6 +88,12 @@ export interface Classmate {
|
|||
guardians: Guardian[]
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface Fetch {
|
||||
(url: string, init?: RequestInit): Promise<Response>
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @interface Guardian
|
||||
|
@ -133,6 +139,16 @@ export interface Notification {
|
|||
type: string
|
||||
}
|
||||
|
||||
export interface RequestInit {
|
||||
headers?: any
|
||||
method?: string
|
||||
body?: string
|
||||
/**
|
||||
* Set to `manual` to extract redirect headers, `error` to reject redirect */
|
||||
redirect?: string
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @interface ScheduleItem
|
||||
|
|
Loading…
Reference in New Issue