Sphereon-Opensource / SIOP-OID4VP

Self Issued OpenID Provider v2 (SIOP) with optional OpenID for Verifiable Presentations (OpenID4VP)
Apache License 2.0
77 stars 25 forks source link

fix: import response type #71

Closed TimoGlastra closed 4 months ago

TimoGlastra commented 5 months ago

Imports the response type, as the ResponseType from DOM was used (which isn't availalbe in AFJ and thus type check throws an error)

TimoGlastra commented 5 months ago

In general there's some DOM types used, which we don't have enabled in AFJ (to stay fully platform agnostic) and that is causing type issues:

node_modules/@sphereon/did-auth-siop/dist/authorization-request/AuthorizationRequest.d.ts:33:38 - error TS2552: Cannot find name 'ResponseType'. Did you mean 'Response'?

33     containsResponseType(singleType: ResponseType | string): Promise<boolean>;
                                        ~~~~~~~~~~~~

  node_modules/@types/node/globals.d.ts:363:13
    363 declare var Response: typeof globalThis extends {
                    ~~~~~~~~
    'Response' is declared here.

node_modules/@sphereon/did-auth-siop/dist/helpers/HttpUtils.d.ts:6:21 - error TS2304: Cannot find name 'HeadersInit'.

6     customHeaders?: HeadersInit;
                      ~~~~~~~~~~~

node_modules/@sphereon/did-auth-siop/dist/helpers/HttpUtils.d.ts:9:55 - error TS2304: Cannot find name 'BodyInit'.

9 export declare const formPost: <T>(url: string, body: BodyInit, opts?: {
                                                        ~~~~~~~~

node_modules/@sphereon/did-auth-siop/dist/helpers/HttpUtils.d.ts:13:21 - error TS2304: Cannot find name 'HeadersInit'.

13     customHeaders?: HeadersInit;
                       ~~~~~~~~~~~

node_modules/@sphereon/did-auth-siop/dist/helpers/HttpUtils.d.ts:16:52 - error TS2304: Cannot find name 'BodyInit'.

16 export declare const post: <T>(url: string, body?: BodyInit, opts?: {
                                                      ~~~~~~~~

node_modules/@sphereon/did-auth-siop/dist/helpers/HttpUtils.d.ts:20:21 - error TS2304: Cannot find name 'HeadersInit'.

20     customHeaders?: HeadersInit;
                       ~~~~~~~~~~~

node_modules/@sphereon/did-auth-siop/dist/types/SIOP.types.d.ts:392:22 - error TS2304: Cannot find name 'JsonWebKey'.

392     encryption_key?: JsonWebKey;
                         ~~~~~~~~~~

node_modules/@sphereon/oid4vci-common/dist/functions/HttpUtils.d.ts:9:55 - error TS2304: Cannot find name 'BodyInit'.

9 export declare const formPost: <T>(url: string, body: BodyInit, opts?: {
                                                        ~~~~~~~~

node_modules/@sphereon/oid4vci-common/dist/functions/HttpUtils.d.ts:16:52 - error TS2304: Cannot find name 'BodyInit'.

16 export declare const post: <T>(url: string, body?: BodyInit, opts?: {
                                                      ~~~~~~~~