Maxim-Mazurok/google-api-typings-generator

Add Google Ads API

davecardwell opened this issue · 8 comments

The Google Ads API has a discovery document available but it is not listed in the googleapis.com API list for some reason.

I can generate the types manually using npm start -- --url https://googleads.googleapis.com/\\\$discovery/rest?version=v7 but couldn’t see any way of adding it to the automated generating/linting/testing/publishing pipeline.

For APIs that are not listed in the API list am I best off adding directly to DefinitelyTyped or is there a simple way to support hard-coded discovery doc URLs in this project?

Hello Dave!
Hm, it's a very good find, thanks for that.
For sure it's better to add this to the CI pipeline.
I will try to add it today.
BTW, where did you find that URL?

@davecardwell I've included googleads API to the CI. And opened PRs to add it to DT.
For now, you can use it from https://www.npmjs.com/package/@maxim_mazurok/gapi.client.googleads
It'll get hourly updates as all other API types from now on.
Let me know if there's anything else I can help you with :)
And please, consider giving this repo a star if you found it useful ;)

@Maxim-Mazurok awesome turnaround, thank you.

I honestly can’t remember where I found the discovery doc originally, sorry!

@davecardwell https://www.npmjs.com/package/@types/gapi.client.googleads just got published, feel free to replace @maxim_mazurok/gapi.client.googleads with @types/gapi.client.googleads. Cheers!

@davecardwell Hello Dave, I see that the current Google Ads API version is 11, and we're still only publishing types for version 7... I'm working on multiple versions support for #652 and just wanted to confirm with you that you are/were using Google Ads on the client-side (front-end)?

@davecardwell I finally managed to make Google Ads API work on the client using gapi.client.request(), see https://github.com/Maxim-Mazurok/google-tasks-api-ts-example/tree/googleads branch

Still can't make it work using gapi.client.googleads.something() approach tho... Did you use .request() or .googleads approach?

@Maxim-Mazurok I was using it on the front-end. Unfortunately I don’t recall the exact method and I have moved on from that company so no longer have access to the project to check.

I see, thanks anyway for confirming, since it can be used on FE - I'll make sure we keep on generating types for it, cheers!