Module: interfaces/RESTInterfaces
Table of contents
Type aliases
- RESTControllerOptions
- RESTCreateCookieOptions
- RESTRequestHandler
- RESTRequestOptions
- RESTRequester
- RESTResponseDataType
- RESTResponseHandler
- RESTResponseOptions
Variables
- DefaultCreateCookieOptions
- DefaultRESTControllerOptions
- DefaultRESTRequestOptions
- DefaultRESTResponseOptions
Type aliases
RESTControllerOptions
Ƭ RESTControllerOptions: object
Type declaration:
| Name | Type | Description |
|---|---|---|
proxy? |
string | If specified, the url which the request will be proxied through |
requester |
(requestOptions: RESTRequestOptions) => Promise<RESTResponseDataType> |
- |
userAgent? |
string | If specified, the user agent that will be used for the requests |
xcsrf? |
string | The current XCSRF token |
xcsrfRefreshInterval? |
number | Refresh interval in ms for XCSRF token updating |
xcsrfRefreshMaxRetries? |
number | The amount of retries to be made to refresh XCSRF tokens on Token Validation errors |
xcsrfSet? |
number | The time in ms when the xcsrf was last set |
Defined in: interfaces/RESTInterfaces.ts:9
RESTCreateCookieOptions
Ƭ RESTCreateCookieOptions: object
Type declaration:
| Name | Type |
|---|---|
domain |
string |
hostOnly |
boolean |
httpOnly |
boolean |
key |
string |
value |
string |
Defined in: interfaces/RESTInterfaces.ts:38
RESTRequestHandler
Ƭ RESTRequestHandler: (request: default) => boolean | Error
Type declaration:
▸ (request: default): boolean | Error
Parameters:
| Name | Type |
|---|---|
request |
default |
Returns: boolean | Error
Defined in: interfaces/RESTInterfaces.ts:6
RESTRequestOptions
Ƭ RESTRequestOptions: object
Type declaration:
| Name | Type | Description |
|---|---|---|
body? |
unknown | - |
checks? |
RESTResponseOptions[checks] | Sets the state of any checks |
excludeCookies? |
boolean | If it should exclude the cookies from being included in the requests |
followAllRedirects? |
boolean | If the request should follow all redirects |
form? |
object | The form body |
formData? |
object | The form data body |
headers? |
object | Add some custom headers that will override / merge with the "base" headers |
json? |
unknown[] | { [key: string]: unknown; } | string | The JSON body |
method? |
GET | POST | PUT | DELETE | PATCH | OPTIONS | string | The request method to use |
proxy? |
string | The proxy to use |
qs? |
object | Any query params? |
responseOptions? |
RESTResponseOptions | The optional response options |
throwHttpErrors? |
boolean | If it should throw http errors if the statuscode is != 200 |
url |
string | The URL to send the request to |
userAgent? |
string | An "overriding" user agent for the request |
verification? |
string | Roblox's "old" verification system with general verification tokens |
xcsrf? |
string | boolean | If you want to use a "custom" xcsrf token |
Defined in: interfaces/RESTInterfaces.ts:46
RESTRequester
Ƭ RESTRequester: (requestOptions: RESTRequestOptions) => Promise<RESTResponseDataType>
Type declaration:
▸ (requestOptions: RESTRequestOptions): Promise<RESTResponseDataType>
Parameters:
| Name | Type |
|---|---|
requestOptions |
RESTRequestOptions |
Returns: Promise<RESTResponseDataType>
Defined in: interfaces/RESTInterfaces.ts:5
RESTResponseDataType
Ƭ RESTResponseDataType: object
Type declaration:
| Name | Type |
|---|---|
body |
any |
headers |
Record<string, string> |
statusCode |
number |
statusMessage |
string |
Defined in: interfaces/RESTInterfaces.ts:129
RESTResponseHandler
Ƭ RESTResponseHandler: (response: default) => boolean | Error
Type declaration:
▸ (response: default): boolean | Error
Parameters:
| Name | Type |
|---|---|
response |
default |
Returns: boolean | Error
Defined in: interfaces/RESTInterfaces.ts:7
RESTResponseOptions
Ƭ RESTResponseOptions: object
Type declaration:
| Name | Type |
|---|---|
allowedStatusCodes? |
number[] |
allowedStatusMessages? |
string[] |
checks? |
object |
checks.body? |
boolean |
checks.captcha? |
boolean |
checks.statusCode? |
boolean |
checks.statusMessage? |
boolean |
checks.xcsrf? |
boolean |
disallowedStatusCodes? |
number[] |
disallowedStatusMessages? |
string[] |
onlyJSON? |
boolean |
Defined in: interfaces/RESTInterfaces.ts:114
Variables
DefaultCreateCookieOptions
• Const DefaultCreateCookieOptions: object
Type declaration:
| Name | Type |
|---|---|
domain |
string |
hostOnly |
boolean |
httpOnly |
boolean |
Defined in: interfaces/RESTInterfaces.ts:153
DefaultRESTControllerOptions
• Const DefaultRESTControllerOptions: object
Type declaration:
| Name | Type |
|---|---|
proxy |
undefined |
userAgent |
string |
xcsrf |
undefined |
xcsrfRefreshInterval |
number |
xcsrfRefreshMaxRetries |
number |
xcsrfSet |
undefined |
Defined in: interfaces/RESTInterfaces.ts:159
DefaultRESTRequestOptions
• Const DefaultRESTRequestOptions: object
Type declaration:
| Name | Type |
|---|---|
checks |
object |
checks.body |
boolean |
checks.captcha |
boolean |
checks.statusCode |
boolean |
checks.statusMessage |
boolean |
checks.xcsrf |
boolean |
headers |
object |
method |
string |
responseOptions |
object |
responseOptions.allowedStatusCodes |
number[] |
Defined in: interfaces/RESTInterfaces.ts:140
DefaultRESTResponseOptions
• Const DefaultRESTResponseOptions: object
Type declaration:
| Name | Type |
|---|---|
allowedStatusCodes |
number[] |
Defined in: interfaces/RESTInterfaces.ts:136