From a8f42e21eb420ba52387c14d89fd7a0bd7dcbda1 Mon Sep 17 00:00:00 2001 From: Roemer Hendrikx Date: Mon, 28 Nov 2022 12:41:49 +0100 Subject: [PATCH] fix(typescript): add Promise to requestResource definition to reflect async nature --- types/index.d.ts | 2 +- types/openid-client-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index d54f98a1..d6b5aa0f 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -351,7 +351,7 @@ declare class BaseClient { tokenType?: string; DPoP?: DPoPInput; }, - ): { body?: Buffer } & http.IncomingMessage; + ): Promise<{ body?: Buffer } & http.IncomingMessage>; grant(body: GrantBody, extras?: GrantExtras): Promise; introspect( token: string, diff --git a/types/openid-client-tests.ts b/types/openid-client-tests.ts index 7ca13a5c..dc958155 100644 --- a/types/openid-client-tests.ts +++ b/types/openid-client-tests.ts @@ -167,8 +167,8 @@ async (req: IncomingMessage) => { callbackResponse, { headers: { Accept: 'application/json' } }, ); - console.log(resource.body.byteLength); - console.log(resource.body.toString('utf-8')); + console.log(resource.body!.byteLength); + console.log(resource.body!.toString('utf-8')); //