Skip to content

Commit

Permalink
fix: 馃悰 error loading SKOLA24_CHILDREN SAML
Browse files Browse the repository at this point in the history
  • Loading branch information
kajetan-kazimierczak committed Nov 26, 2021
1 parent 0a76e6c commit 508b079
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion libs/api-skolplattformen/lib/api.ts
Expand Up @@ -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'
Expand Down Expand Up @@ -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
) {
Expand Down
4 changes: 2 additions & 2 deletions libs/api/lib/fetcher.ts
@@ -1,4 +1,4 @@
import { Response } from './types'
import { Response, Fetch, RequestInit } from './types'

export interface CallInfo extends RequestInit {
name: string
Expand Down Expand Up @@ -48,7 +48,7 @@ const record = async (
}

export default function wrap(
fetch: typeof global.fetch,
fetch: Fetch,
options: FetcherOptions = {}
): Fetcher {
return async (
Expand Down
16 changes: 16 additions & 0 deletions libs/api/lib/types.ts
Expand Up @@ -88,6 +88,12 @@ export interface Classmate {
guardians: Guardian[]
}



export interface Fetch {
(url: string, init?: RequestInit): Promise<Response>
}

/**
* @export
* @interface Guardian
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 508b079

Please sign in to comment.