awslabs / aws-jwt-verify

JS library for verifying JWTs signed by Amazon Cognito, and any OIDC-compatible IDP that signs JWTs with RS256, RS384, and RS512
Apache License 2.0
598 stars 43 forks source link

[BUG] node_modules/aws-jwt-verify/cognito-verifier.d.ts:95:42 - error TS1005: ',' expected. #95

Closed jamesnight1994 closed 1 year ago

jamesnight1994 commented 1 year ago

Describe the bug Instantiating Cognito JWT Verifier like so...

const { CognitoJwtVerifier } = require("aws-jwt-verify");

... gives me the following error.

node_modules/aws-jwt-verify/cognito-verifier.d.ts:95:42 - error TS1005: ',' expected.

95 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                            ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:95:58 - error TS1005: ',' expected.

95 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                                            ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:95:92 - error TS1005: ',' expected.

95 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                                                                              ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:95:107 - error TS1005: ',' expected.

95 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                                                                                             ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:181:71 - error TS1005: ',' expected.

181     cacheJwks(...[jwks, userPoolId]: MultiIssuer extends false ? [jwks: Jwks, userPoolId?: string] : [jwks: Jwks, userPoolId: string]): void;
                                                                          ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:181:90 - error TS1005: ',' expected.

181     cacheJwks(...[jwks, userPoolId]: MultiIssuer extends false ? [jwks: Jwks, userPoolId?: string] : [jwks: Jwks, userPoolId: string]): void;
                                                                                             ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:181:107 - error TS1005: ',' expected.

181     cacheJwks(...[jwks, userPoolId]: MultiIssuer extends false ? [jwks: Jwks, userPoolId?: string] : [jwks: Jwks, userPoolId: string]): void;
                                                                                                              ~

node_modules/aws-jwt-verify/cognito-verifier.d.ts:181:125 - error TS1005: ',' expected.

181     cacheJwks(...[jwks, userPoolId]: MultiIssuer extends false ? [jwks: Jwks, userPoolId?: string] : [jwks: Jwks, userPoolId: string]): void;
                                                                                                                                ~

node_modules/aws-jwt-verify/jwt-rsa.d.ts:91:42 - error TS1005: ',' expected.

91 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                            ~

node_modules/aws-jwt-verify/jwt-rsa.d.ts:91:58 - error TS1005: ',' expected.

91 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                                            ~

node_modules/aws-jwt-verify/jwt-rsa.d.ts:91:92 - error TS1005: ',' expected.

91 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                                                                              ~

node_modules/aws-jwt-verify/jwt-rsa.d.ts:91:107 - error TS1005: ',' expected.

91 } extends SpecificVerifyProperties ? [jwt: string, props?: SpecificVerifyProperties] : [jwt: string, props: SpecificVerifyProperties];
                                                                      ~                                      ~

node_modules/aws-jwt-verify/jwt-rsa.d.ts:199:82 - error TS1005: ',' expected.

199     cacheJwks(...[jwks, issuer]: MultiIssuer extends false ? [jwks: Jwks, issuer?: string] : [jwks: Jwks, issuer: string]): void; Jwks, issuer: string]): void;
                                                                                     ~

node_modules/aws-jwt-verify/jwt-rsa.d.ts:199:99 - error TS1005: ',' expected.
                                                                                                        Jwks, issuer: string]): void;
199     cacheJwks(...[jwks, issuer]: MultiIssuer extends false ? [jwks: Jwks, issuer?: string] : [jwks: Jwks, issuer: string]): void;
                                                                                                      ~

                                                                                                        Jwks, issuer: string]): void;
node_modules/aws-jwt-verify/jwt-rsa.d.ts:199:113 - error TS1005: ',' expected.

199     cacheJwks(...[jwks, issuer]: MultiIssuer extends false ? [jwks: Jwks, issuer?: string] : [jwks: Jwks, issuer: string]): void;
                                                                                                        Jwks, issuer: string]): void;
             ~                                                                                                      ~

Found 16 errors.

Versions "aws-jwt-verify": "^3.2.0", Node.js: v18.7.0

ottokruse commented 1 year ago

What's your TypeScript version?

npx tsc -v

jamesnight1994 commented 1 year ago

Hello @ottokruse its Version 3.9.9

ottokruse commented 1 year ago

OK that's 0.0.1 too short ;) You need at least 4.0.0 to use this lib

jamesnight1994 commented 1 year ago

Thanks @ottokruse