Skip to content

Releases: fuwa-org/fuwa

@fuwa/ws@0.5.0

16 Sep 18:40
2dd822e
Compare
Choose a tag to compare

This release updates generated code for the latest version of @fuwa/ws.

Full Changelog: https://github.com/fuwa-org/fuwa/compare/@fuwa/ws@0.4.0...@fuwa/ws@0.5.0

@fuwa/ws initial release

16 Sep 18:15
eeb125b
Compare
Choose a tag to compare
@fuwa/ws@0.4.0

This tag represents v0.4.0 of `@fuwa/ws`.

@fuwa/rest@0.4.0-beta.1

16 Sep 19:04
@fuwa/rest@0.4.0-beta.1
32ac6d8
Compare
Choose a tag to compare
Pre-release

This is the first beta version of @fuwa/rest@0.4.0.

What's new

  • updated dependencies
  • simplified RESTClient options
  • all REST endpoints can take an options parameter which will influence the underlying request.
  • you can provide a custom authentication token per-request now
  • file keys can be numbers (e.g. in attachment uploads)

Bug fixes

  • error handler will not throw an "expired token" error if there was no token in the first place

Breaking changes

REST class is now default

Instead of the old RequestManager which provided a barebones implementation of bucket rate limiting being exported by default, the new REST class is exported for simplicity.

Usage is very simple:

import REST from '@fuwa/rest';

const client = new REST("my_token");

await client.patch("/users/@me", {
  body: {
    username: "fuwa_l0v3r"
  },
});

// want it simpler? here you go:
await client.editCurrentUser({
  username: "fuwa_l0v3r_shorthand"
});

Endpoint names revamped

Most endpoint names in REST now match their documentation names which may be more inconsistent. Additionally, any routes taking reason, files, or such properties now moved to the singular options parameter.

Booleans are no longer accepted for RequestOptions.auth

Instead, provide null which will instruct the client to omit the authentication token (if any).

// old
REST.get("/users/@me", {
	auth: false
});

// new
REST.get("/users/@me", {
	auth: null
});

Full Changelog: https://github.com/fuwa-org/fuwa/compare/@fuwa/rest@0.3.0...@fuwa/rest@0.4.0-beta.1

@fuwa/rest@0.3.0

05 Jun 13:03
cb787a0
Compare
Choose a tag to compare

REST entrypoint class

Similar to ottercord but all manual.

Its core function is to provide an easier method of interacting directly with the API
instead of using RequestManager and implementing the extra HTTP boilerplate yourself.

  • a new class, REST, which provides an almost
    @discordjs/rest-like feel has been added
  • easy methods and typings for documented routes have been added to the above class
    • eg: REST.createMessage("channelId", { content: "a" })

@fuwa/rest@0.2.2

05 May 18:03
0885db3
Compare
Choose a tag to compare

This release adds support for custom headers in log output from both RequestManager (debug) and RESTClient (trace).

Usage

new RequestManager(..., {
  logger: {
    header: '[abcdef]',
    header: () => Date.now(),
  }
})

Links

@fuwa/rest@0.2.1

05 May 17:49
65c5f2e
Compare
Choose a tag to compare

Republish of new code, npm didn't update the updated build folder.

@fuwa/rest@0.2.0

05 May 17:36
5fd1fe2
Compare
Choose a tag to compare

This release adds a RequestManagerOptions interface and renames the previous _client parameter in RequestManager.

Notable changes

  • Specifying a debug()/trace() function (as well as passing colors) is now available with RequestManager.
  • You can now specify whether timings of requests (i.e. how long it took) is logged in aforementioned debug/trace functions.

Usage

new RequestManager(..., {
  timings: true,
  logger: {
    debug: console.log,
    trace: console.log,
  }
})

Full Changelog: https://github.com/fuwa-org/fuwa/compare/@fuwa/rest@0.1.1...@fuwa/rest@0.2.0

@fuwa/rest@0.1.1

04 May 07:37
799966b
Compare
Choose a tag to compare

@fuwa/rest@0.1.1 [@splatterxl]

🎉 @fuwa/rest has been released for public use! See the README for usage details.

Changelog