Content-Length: 271776 | pFad | http://github.com/googleapis/google-api-nodejs-client/issues/3677

41 google.webmasters auth typing error with GoogleAuth<JSONClient> after v150.0.1 · Issue #3677 · googleapis/google-api-nodejs-client · GitHub
Skip to content

google.webmasters auth typing error with GoogleAuth<JSONClient> after v150.0.1 #3677

Open
@Towerss

Description

@Towerss

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

Hi maintainers 👋

After upgrading googleapis from version ^149.0.0 to 150.0.1, I ran into a TypeScript type error related to the auth property when initialising the webmasters API.

Image

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/Towerss/c4885527a8ddc5e66c4cffa543398d19

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Run tsc to see the typing error.

A clear and concise description of what the bug is, and what you expected to happen.

After upgrading from googleapis@^149.0.0 to 150.0.1, TypeScript no longer accepts a GoogleAuth instance as a valid auth parameter when initializing the webmasters API client.

This code worked previously:

const auth = new GoogleAuth<JSONClient>({
  keyFile: 'path/to/key.json',
  scopes: ['https://www.googleapis.com/auth/webmasters'],
});

const searchConsole = google.webmasters({ version: 'v3', auth }); // ✅ worked in v149.x

But now produces a type error in v150.0.1:

Type 'GoogleAuth' is not assignable to type 'GoogleAuth'
Property '#private' in type 'GoogleAuth' refers to a different member that cannot be accessed from within type 'GoogleAuth'

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

googleapis.webmasters should allow passing GoogleAuth as the auth parameter, as it was supported in earlier versions and is the type returned from the current google-auth-library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/googleapis/google-api-nodejs-client/issues/3677

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy