File tree 2 files changed +5
-22
lines changed
2 files changed +5
-22
lines changed Original file line number Diff line number Diff line change 17
17
"test" : " repo-tools test run --cmd ava -- -T 20s --verbose system-test/*.test.js"
18
18
},
19
19
"dependencies" : {
20
- "googleapis" : " 27.0.0" ,
21
- "safe-buffer" : " 5.1.1" ,
22
- "uuid" : " ^3.2.1" ,
23
- "yargs" : " 11.0.0"
20
+ "googleapis" : " ^35.0.0"
24
21
},
25
22
"devDependencies" : {
26
23
"@google-cloud/nodejs-repo-tools" : " ^3.0.0" ,
27
24
"ava" : " 0.25.0" ,
28
- "proxyquire" : " 2.0.1" ,
29
- "semistandard" : " ^12.0.1"
25
+ "semistandard" : " ^13.0.1"
30
26
}
31
27
}
Original file line number Diff line number Diff line change 18
18
// [START quickstart]
19
19
20
20
// Imports the Google APIs client library
21
- const { google} = require ( 'googleapis' ) ;
22
-
23
- // Acquires credentials
24
- google . auth . getApplicationDefault ( ( err , authClient ) => {
25
- if ( err ) {
26
- console . error ( 'Failed to acquire credentials' ) ;
27
- console . error ( err ) ;
28
- return ;
29
- }
30
-
31
- if ( authClient . createScopedRequired && authClient . createScopedRequired ( ) ) {
32
- authClient = authClient . createScoped ( [
33
- 'https://www.googleapis.com/auth/jobs'
34
- ] ) ;
35
- }
21
+ const { google } = require ( 'googleapis' ) ;
36
22
23
+ google . auth . getClient ( { scopes : [ 'https://www.googleapis.com/auth/jobs' ] } ) . then ( ( auth ) => {
37
24
// Instantiates an authorized client
38
25
const jobs = google . jobs ( {
39
26
version : 'v2' ,
40
- auth : authClient
27
+ auth
41
28
} ) ;
42
29
43
30
// Lists companies
You can’t perform that action at this time.
0 commit comments