js-client icon indicating copy to clipboard operation
js-client copied to clipboard

Type definition file for typescript support.

Open santoshyadavdev opened this issue 6 years ago • 18 comments
trafficstars

**- 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.

santoshyadavdev avatar Jun 01 '19 16:06 santoshyadavdev

I'll pick this one.

sumitparakh avatar Nov 17 '19 14:11 sumitparakh

@sumitparakh - any update on when will it be available

imranmomin avatar Mar 11 '20 17:03 imranmomin

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

sumitparakh avatar Mar 11 '20 18:03 sumitparakh

@imranmomin . Most of the things are done though.

sumitparakh avatar Mar 11 '20 18:03 sumitparakh

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.

simenandre avatar May 02 '20 20:05 simenandre

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

sumitparakh avatar May 02 '20 21:05 sumitparakh

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?

simenandre avatar May 15 '20 16:05 simenandre

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

czerwinskilukasz1 avatar Jul 03 '20 17:07 czerwinskilukasz1

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

simenandre avatar Jul 03 '20 18:07 simenandre

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

czerwinskilukasz1 avatar Jul 06 '20 11:07 czerwinskilukasz1

Any news?

CanRau avatar Sep 10 '20 05:09 CanRau

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

gjolund avatar Feb 08 '21 08:02 gjolund

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 šŸ‘

JGAntunes avatar Feb 08 '21 12:02 JGAntunes

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

erezrokah avatar Feb 08 '21 12:02 erezrokah

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

gjolund avatar Feb 08 '21 15:02 gjolund

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!

mfanuzzi avatar Dec 14 '21 01:12 mfanuzzi

Are there any workarounds for now?

MoshikoConf avatar Apr 24 '22 06:04 MoshikoConf

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.

seivan avatar Jun 30 '22 07:06 seivan

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

lukasholzer avatar Oct 10 '22 13:10 lukasholzer