-
Notifications
You must be signed in to change notification settings - Fork 21
Closed as not planned
Closed as not planned
Copy link
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Environment details
- OS: macOS 13.1 (22C65)
- Node.js version: v18.12.0
- npm version: 8.19.2
google-gaxversion: 3.5.2google-auth-libraryversion: 8.7.0@google-cloud/aiplatformversion: 2.3.0typescriptversion: 4.9.4
Steps to reproduce
I want to create a google auth client and pass it to services in @google-cloud/aiplatform, for example using the JobServiceClient. I get an incompatible type error from TypeScript, see below. JobServiceClient is using ClientOptions from google-gax.
import { JobServiceClient } from "@google-cloud/aiplatform";
import { GoogleAuth } from "google-auth-library";
import { ClientOptions } from "google-gax";
const googleAuth = new GoogleAuth({
scopes: "https://www.googleapis.com/auth/cloud-platform",
});
const googleAuthClient = await googleAuth.getClient();
const clientOptions: ClientOptions = {
authClient: googleAuthClient,
};
const jobServiceClient = new JobServiceClient(clientOptions);throws
TS2322: Type 'Compute | JSONClient' is not assignable to type 'JSONClient'.
Type 'Compute' is not assignable to type 'JSONClient'.
Type 'Compute' is missing the following properties from type 'JWT': createScoped, hasUserScopes, hasAnyScopes, authorize, and 7 more.
11 authClient: googleAuthClient,
~~~~~~~~~~
node_modules/google-auth-library/build/src/auth/googleauth.d.ts:38:5
38 authClient?: T;
~~~~~~~~~~
The expected type comes from property 'authClient' which is declared here on type 'ClientOptions'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.