netlify / js-client

A Open-API derived JS + Node.js API client for Netlify
https://www.npmjs.com/package/netlify
215 stars 43 forks source link

Type definition file for typescript support. #50

Closed santoshyadavdev closed 2 years ago

santoshyadavdev commented 5 years ago

- Do you want to request a feature or report a bug?Feature

- What is the current behavior? we only have js client - If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?

- Please mention your node.js, and operating system version.

sumitparakh commented 5 years ago

I'll pick this one.

imranmomin commented 4 years ago

@sumitparakh - any update on when will it be available

sumitparakh commented 4 years ago

@imranmomin Sorry it took long. But I'll try to complete it by 22 March.

sumitparakh commented 4 years ago

@imranmomin . Most of the things are done though.

simenandre commented 4 years ago

Hello šŸ‘‹

I wanted to check-in. How far are you on implementing the types, @sumitparakh? :) Maybe I can do something to move things along? I'll happily add a PR on it.

sumitparakh commented 4 years ago

Hi @cobraz. Sorry I couldn't continue my work on this. I pushed my changes here at netlify branch

simenandre commented 4 years ago

Hello! I hoped to have time to help with this, but Iā€™m not sure when. I am a bit busy with other projects now, maybe someone else wants a go at it?

czerwinskilukasz1 commented 4 years ago

Hi, @cobraz . What's the current status of this task? How far is it from being done? CC @sumitparakh

simenandre commented 4 years ago

I haven't been able to do anything with it yet, I'm afraid.

czerwinskilukasz1 commented 4 years ago

@sumitparakh, what's missing in the current definitions you created?

CanRau commented 4 years ago

Any news?

gjolund commented 3 years ago

any progress on this? I'm willing to sponsor work to get this completed.

JGAntunes commented 3 years ago

Hey folks šŸ‘‹

I don't believe anyone is actively working on this (do correct me if I'm wrong and you have more information though). As always, we're open to contributions, so if you do want to pick this up @austinrivas feel free to do so and we'll provide as much help and feedback as we can šŸ‘

erezrokah commented 3 years ago

We're generating the methods in the client from a swagger.json (see here and here) so this tool could be helpful.

gjolund commented 3 years ago

Hey folks

I don't believe anyone is actively working on this (do correct me if I'm wrong and you have more information though). As always, we're open to contributions, so if you do want to pick this up @austinrivas feel free to do so and we'll provide as much help and feedback as we can

I implemented the types locally in my repo based on what is in definitelytyped already, however I am having a hard time following the openapi docs as it isn't very clear on what fields are mandatory and what is required.

Also, the codegen for the js-client makes it pretty challenged to see what the actual method signatures are.

For right now I am just going to stick to typing the methods I need.

It seems to me that the typegen tool @erezrokah mentioned should be the best route and could easily be integrated into your ci pipeline @JGAntunes

mfanuzzi commented 2 years ago

Another voice for this: it's very difficult to tell (without running tests) what the shape of the expected output of, say, success and failure states for each call are. Right now the result of any function call is a black box. It'd almost be preferable to just use fetch because at least then it's clear how to get the response (as the HTTP code), especially if all you really need is pass/fail (eg a delete operation).

It's also just surprising to me that in our projects, which may contain dozens of libraries, this is the only one for which there are no type definitions, and most of the libraries we use are not from companies with a hundred-million series D raise šŸ™ƒ We'd greatly appreciate if this issue got a little attention. Thank you!

MoshikoConf commented 2 years ago

Are there any workarounds for now?

seivan commented 2 years ago

Are there any workarounds for now?

add this to your global types in root

declare module 'netlify'

How the Netlify team can be so callous about this is understandable. Trying to taking over the entire pipeline. I just need to send you a blob host via an API/CLI, I don't need to give you access to the repo so you can larp a CI.

lukasholzer commented 2 years ago

The package got moved to https://github.com/netlify/build under packages/js-client and has now a typescript build in place (currently just leveraging the js files but generating already and shipping d.ts files.

We are more than happy to accept PR's that increase the quality of the shipped types therefore I will close this issue as the repo get's archived