News for hackers. Stuff that matters.
Re:TypeScript is terrible for library developers by dfabulich on Tuesday August 23, 2022 @04:49PM (#32571288)
Because in order to have separate functions, I'd have to define separate functions for every function that Apple supports, i.e. I'd have to autogenerate the list from Apple's OpenAPI specification.

Furthermore, if Apple introduces a new function, I'd have to release a new version of my library to support it. Today, my library can handle any object Apple's API supports, without upgrading.

As it stands, the API works like this. It's fine.

    const {data: app} = await read('apps/123456')
    const {data: apps} = await read('apps')
    const {data: [firstApp]} = await read('apps?limit=1')
Re:TypeScript is terrible for library developers by overgard on Tuesday August 23, 2022 @05:42PM (#32571955)
Swagger can generate that sort of thing. I guess I don't know what things your library provides so I don't want to bash it, but having a generic read/get that doesn't provide types doesn't seem like a big improvement over just using a general purpose tool like axios or fetch.
Re:TypeScript is terrible for library developers by JimDabell on Wednesday August 24, 2022 @04:00AM (#32576161)
The App Store Connect API requires scoped, time-limited tokens to be generated and has specific filtering, pagination, and rate-limiting mechanisms built into every resource. I haven’t looked at this particular library, but I would expect that it’s quite useful beyond simply making the HTTP requests.