From 722bb2ba1a1840ae4b5b1a41047709dd37222db2 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 23 Aug 2023 17:03:19 +0200 Subject: [PATCH] Fix some typings --- src/api_module.ts | 16 ++++++++-------- src/http.ts | 2 +- src/types/auth.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/api_module.ts b/src/api_module.ts index 6ec2193..fcec773 100644 --- a/src/api_module.ts +++ b/src/api_module.ts @@ -52,7 +52,7 @@ class BaseModule { } class CRDModule extends BaseModule { - index(auth: AuthInterface): AsyncGenerator { + index(auth: AuthInterface): AsyncGenerator { return indexGenerator(this.url, auth, new Scope()); } @@ -91,7 +91,7 @@ export class AlbumModule extends CRUDModule { index( auth: AuthInterface, scope = new AlbumsScope(), - ): AsyncGenerator { + ): AsyncGenerator { return indexGenerator(this.url, auth, scope); } @@ -124,7 +124,7 @@ export class ArtistModule extends CRUDModule { index( auth: AuthInterface, scope = new ArtistsScope(), - ): AsyncGenerator { + ): AsyncGenerator { return indexGenerator(this.url, auth, scope); } @@ -154,7 +154,7 @@ export class AuthTokenModule extends BaseModule { super(baseURL, "auth_tokens"); } - index(auth: AuthInterface): AsyncGenerator { + index(auth: AuthInterface): AsyncGenerator { return indexGenerator(this.url, auth, new Scope()); } @@ -277,7 +277,7 @@ export class PlayModule extends BaseModule { index( auth: AuthInterface, scope = new PlaysScope(), - ): AsyncGenerator { + ): AsyncGenerator { return indexGenerator(this.url, auth, scope); } @@ -288,7 +288,7 @@ export class PlayModule extends BaseModule { stats( auth: AuthInterface, scope = new PlaysScope(), - ): AsyncGenerator { + ): AsyncGenerator { return indexGenerator( `${this.url}/stats`, auth, @@ -302,7 +302,7 @@ export class RescanModule extends BaseModule { super(baseURL, "rescans"); } - index(auth: AuthInterface): AsyncGenerator { + index(auth: AuthInterface): AsyncGenerator { return indexGenerator(this.url, auth, new Scope()); } @@ -335,7 +335,7 @@ export class TrackModule extends CRUDModule { index( auth: AuthInterface, scope = new TracksScope(), - ): AsyncGenerator { + ): AsyncGenerator { return indexGenerator(this.url, auth, scope); } diff --git a/src/http.ts b/src/http.ts index 5df49dd..f0d412e 100644 --- a/src/http.ts +++ b/src/http.ts @@ -14,7 +14,7 @@ export async function* indexGenerator( path: string, auth: AuthInterface, scope: ST, -): AsyncGenerator { +): AsyncGenerator { let page = 1; while (true) { let response: Response; diff --git a/src/types/auth.ts b/src/types/auth.ts index 0e445fc..35f82a1 100644 --- a/src/types/auth.ts +++ b/src/types/auth.ts @@ -17,7 +17,7 @@ export type AuthTokenWithSecret = AuthToken & { export interface AuthTokenParams { name: string; password: string; - auth_token: { + auth_token?: { user_agent: string; }; }