Releases: fuwa-org/fuwa
@fuwa/ws@0.5.0
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
@fuwa/ws@0.4.0 This tag represents v0.4.0 of `@fuwa/ws`.
@fuwa/rest@0.4.0-beta.1
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 anoptions
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
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" })
- eg:
@fuwa/rest@0.2.2
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
Republish of new code, npm didn't update the updated build folder.
@fuwa/rest@0.2.0
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 withRequestManager
. - 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
@fuwa/rest@0.1.1 [@splatterxl]
🎉 @fuwa/rest has been released for public use! See the README for usage details.
Changelog
- chore(rest): release by @splatterxl