import { RESTController } from "https://deno.land/x/dynablox_opencloud@v0.2.2/src/rest/RESTController.ts";
Properties
String-string aliases for URLs, Whenever an a lias is found in a URL, it will attempt to format it.
E.g.: RBXURL
key with value {0}.roblox.com
. When we format it with this.formatUrl()
, if the URL is: {RBXURL:auth}/v1/logout
, we replace {0}
with "auth".
The authentication type of the client.
If it is "APIKey" then it will authenticate through the OpenCloud endpoints.
If it is "Bearer" then it will authenticate through the OAuth endpoints.
If it is "OAuthApplication" then it will authenticate through the OAuth application endpoints.
The default headers to add to requests, values may be modified later on.
Custom fetch implementation to use instead of the default fetch
.
Methods
Format a body to be used in requests. This will also return a contentType
to be sent in the headers.
Formats a URL given a URL string, query, protocol, and aliases. Aliases will be found and formatted with the parameters with this.formatWithAliases(target)
Format a string with aliases given a target
. Unknown alias calles are replaced with null
.
E.g.: RBXURL
key with value {0}.roblox.com
. When we format it if the URL is: {RBXURL:auth}/v1/logout
, we replace {0}
with "auth" from alias and replace the alias call.
Public-facing request function. This is different from the protected _httpRequest
function in a way that error handling can be done.
Set the current credentials value. Note: When we migrate all authentication fields to credentials
, this will be much more type-safe.