Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add V3 to Google Jobs #1292

Closed
nwkeeley opened this issue Aug 15, 2018 · 6 comments
Closed

Please add V3 to Google Jobs #1292

nwkeeley opened this issue Aug 15, 2018 · 6 comments
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@nwkeeley
Copy link

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!

@JustinBeckwith JustinBeckwith added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Aug 16, 2018
@JustinBeckwith
Copy link
Contributor

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!

@tetreault
Copy link

tetreault commented Aug 19, 2018

@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!

@tetreault
Copy link

tetreault commented Aug 19, 2018

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?

screenshot 2018-08-19 11 36 33

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: 'XXXX@XXX-123456.iam.gserviceaccount.com',
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.

@JustinBeckwith
Copy link
Contributor

Greetings folks - this is out!

@tetreault
Copy link

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.

@nwkeeley
Copy link
Author

Thank you for updating with V3!!!

@JustinBeckwith JustinBeckwith self-assigned this Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants