Bolisov / typings-gapi

Google API Typescript definitions
2 stars 0 forks source link

Not in npm registry #2

Closed zorgoz closed 7 years ago

zorgoz commented 7 years ago

Hello,

typings install gapi.client --save yields a big fat error message: Unable to find "gapi.client" ("npm") in the registry. And manual search on the npm page gives no result either.

Bolisov commented 7 years ago

Hi,

Unfortunately, I did'n publish this to typings repository. But you can download typings (*.d.ts files) directly from this repo and save to your project.

For example https://github.com/Bolisov/typings-gapi/blob/master/gapi.client/gapi.client.d.ts for base client definitions and https://github.com/Bolisov/typings-gapi/blob/master/gapi.client.gmail-v1/gapi.client.gmail.d.ts for GMail API.

Please keep in mind, I make this repo long times ago for person use and I didn't update typings in last year. Some things can be broken...

zorgoz commented 7 years ago

Hi,

Actually, typing has downloaded it and I have them in my typings folder. But I am unable to link them seamlessly. The only way I have managed so far to see them in VSC is using such statements: /// . I have tried to add "../typings/" to tsconfig.json typeRoots, but does not help. Using "include" on the other hand is messing up the experimentalDecorators warning suppression for whatever reason.

Could you suggest the proper method?

Thank you very much!

PS: I am aware that the definitions are one year old, but believe me, these are the only ones out there! If you had the time it would help many people a lot if you could create up to date npm packages to be compatible with Typescript 2.0.

Regards, ZorgoZ

2017-07-12 12:20 GMT+02:00 Alexey Bolisov notifications@github.com:

Hi,

Unfortunately, I did'n publish this to typings repository. But you can download typings (*.d.ts files) directly from this repo and save to your project.

For example https://github.com/Bolisov/typings-gapi/blob/master/gapi. client/gapi.client.d.ts for base client definitions and https://github.com/Bolisov/typings-gapi/blob/master/gapi. client.gmail-v1/gapi.client.gmail.d.ts for GMail API.

Please keep in mind, I make this repo long times ago for person use and I didn't update typings in last year. Some things can be broken...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Bolisov/typings-gapi/issues/2#issuecomment-314719771, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfxkkrgZEUbdSNxUVYbrOHMC4ywp6Mgks5sNJ3ugaJpZM4OUOPm .

Bolisov commented 7 years ago

Hi,

Looks like it is problem with tsconfig.json. Could you publish your project somewhere and I will check it and maybe find solution?

zorgoz commented 7 years ago

Hi,

For the start, I can live with the references. There is a bigger issue though.

If you look at the discovery documents (I assume you have used these to generate the definitions), you will notice some "standard parameters". Like alt in https://www.googleapis.com/discovery/v1/apis/drive/v3/rest If you look closely at the API Explorer, https://developers.google.com/drive/v3/reference/files/get you will see that these apply always. For example, I need to include alt=media (see: https://developers.google.com/drive/v3/web/manage-downloads) parameter in the drive.files.get to get the file content (export applies to google docs only, but mine would be json).

This works in JS:

read: function () {
      return getFileId().then(function (id) {
        return gapi.client.drive.files
          .get({ fileId: id, alt: 'media' })
          .then(function (response) {
            return response.result;
          });
      });
    }

image

Any idea how to get it working?

zorgoz commented 7 years ago

Can you share the tool you have used to generate these definitions?

Bolisov commented 7 years ago

Hi,

Yes, it is https://github.com/Bolisov/google-api-typings-generator

Bolisov commented 7 years ago

Done,

I've updated definitions to latest versions. Please check.