Using version latest version 32.0.0 here: https://www.npmjs.com/package/googleapis
Documentation / Code example states that we should be using V3 of the api here: https://cloud.google.com/talent-solution/job-search/docs/before-you-begin
After installing googleapis and trying the example snippet I get
Error: Unable to load endpoint jobs("v3"): ctr is not a constructor
at Object.getAPI (/Users/me/Sites/match/node_modules/googleapis/build/src/shared/src/apiIndex.js:37:15)
at GoogleApis.jobs (/Users/me/Sites/match/node_modules/googleapis/build/src/apis/jobs/index.js:22:18)
at google.auth.getApplicationDefault (/Users/me/Sites/match/utils/company.js:21:35)
at /Users/me/Sites/match/node_modules/google-auth-library/build/src/auth/googleauth.js:179:45
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Further investigation has shown me that in /node_modules/googleapis/build/src/apis/jobs/index.js has specified:
exports.VERSIONS = {
'v2': v2_1.jobs_v2.Jobs,
};
Please include support for v3.
Thanks!
We just need to run the generator. @kinwa91 maybe you could take a crack at this :)
Just run make generate, make fix, then submit a PR with the changes!
@JustinBeckwith @kinwa91 has this been resolved yet, I just discovered this one? I actually fixed my first issue of usign the nodejs module with AWS Lambda for a job searching API i'm building because I wasn't uploading and pointing to the JSON file for GOOGLE_APPLICATION_CREDENTIALS. Now the module can implicitly verify my credentials in the lambda script, but now I have the same issue as the OP of this issue:
{
"statusCode": "400",
"body": "Unable to load endpoint jobs(\"v3\"): ctr is not a constructor",
"headers": {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token",
"Access-Control-Allow-Credentials": true
}
}
I see this PR is open. I understand its Sunday and you're probably busy so I'm curious how I can make this work on my end if the PR is going to take some time to integrate.
Thanks for your time!
Sorry for one last message on this thread, its unclear to me if this is related to me using v2 for right now but in Cloudwatch I see this spit out by the node module when trying to use v2:
google.auth.getApplicationDefault((err, authClient) => {
if (err) {
console.error("Failed to acquire credentials");
console.error(err);
done(err, null);
}
// rest of code here
This err block triggers. Is this not the appropriate way to load in the JSON file in something serverless like Lambda with this module?

Edit:
i wanted to also add the output of printing out the authClient from my lambda script, in case its helpful:
JWT {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
transporter: DefaultTransporter {},
credentials: { refresh_token: 'jwt-placeholder', expiry_date: 1 },
certificateCache: null,
certificateExpiry: null,
refreshTokenPromises: Map {},
_clientId: undefined,
_clientSecret: undefined,
redirectUri: undefined,
authBaseUrl: undefined,
tokenUrl: undefined,
eagerRefreshThresholdMillis: 300000,
email: '[email protected]',
keyFile: undefined,
key: '-----BEGIN PRIVATE KEY-----SECREEEEEEET-----END PRIVATE KEY-----\n',
scopes: [ 'https://www.googleapis.com/auth/jobs' ],
subject: undefined,
additionalClaims: undefined }
Basically it seems like even though I'm setting up authClient as per one of the v3 examples in the docs, it seems like its undefined since authClient.createScopedRequired yields cannot read property createScopedRequired of undefined.
Greetings folks - this is out!
awesome thanks @JustinBeckwith !
Sadly, our client ended up cancelling the project I needed this for but its awesome that you've been so prompt and helpful.
Thank you for updating with V3!!!
Most helpful comment
We just need to run the generator. @kinwa91 maybe you could take a crack at this :)
Just run
make generate,make fix, then submit a PR with the changes!