Giter Site home page Giter Site logo

cloudnode-pro / ts-client Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 703 KB

A client library for the Cloudnode API, written in TypeScript.

Home Page: https://cloudnode.pro

License: GNU General Public License v3.0

TypeScript 44.03% Mustache 6.71% Shell 0.10% JavaScript 49.16%
api client cloudnode library

ts-client's People

Contributors

dependabot[bot] avatar dviih avatar km127pl avatar zefir-git avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

km127pl

ts-client's Issues

Move depenendencies as dev-deps?

Our dependencies currently are @types/node, listr-inquirer, listr2, mustache, node-fetch.

I think we can move all of these except node-fetch to dev dependencies.

Wrong error thrown on login endpoint

When invalid credentials are provided, 422 INVALID_DATA is thrown instead of 401 UNAUTHORIZED.

401 requires WWW-Authenticate but the login endpoint does not use Authorization i.e. HTTP authentication schemes, hence 401 is inappropriate here. This was changed internally in the API as part of our process of deprecating basic authentication.

This inaccuracy somehow made it onto the main branch here ๐Ÿ˜ฌ

Change is needed here:

ts-client/schema.json

Lines 594 to 597 in 99af42f

{
"status": 401,
"type": "Error & {code: \"UNAUTHORIZED\"}"
},

Build a browser-friendly SDK

Add a template to generate a separate browser-friendly (non-Node JS) SDK. Or perhaps use some plugin to convert the existing .js to a browser-compatible version.

Smart rate limit handling

Add an option to automatically respect the rate limits by retrying and intentionally delaying requests.

My idea behind this is to avoid sending requests which the client already knows will be rate limited (based on data from recent requests) as to allow the request to still complete after the limit resets instead of failing immediately.

This is just an idea. Further discussion is encouraged

Note: sending an OPTIONS request allows you to check the current rate limit status without decreasing the remaining limit.

Generate readme with docs

Use the JSDoc or the .d.ts or the schema perhaps to generate documentation for the library in the project readme

Include request details in response

Include data such as response headers and status in method return values.

Ideally this should be under a getter with a name that will never collide with the name of a property from a response object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.