Methods
(static) APIRequest(url, paramsopt) → {dynamic}
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
url | string | |||
params | object | <optional> | {} |
- Source
- Type:
- dynamic
(static) authRequest(req) → {object}
Takes and returns a roUrlTransfer object after adding a Jellyfin "Authorization" header
| Name | Type | Description |
|---|---|---|
req | object |
- Source
- Type:
- object
(static) buildAuthHeader(shouldIncludeDeviceNameopt) → {string}
Returns a string containing the "Authorization" header payload.
DeviceId is the one field here that is load-bearing for session identity: Jellyfin resolves it from THIS header only (never from a query string), and falls back to the DeviceId the auth token was minted under when the header omits it. Every channel that opens a Jellyfin session must therefore send this header, or it silently lands on a different session — see the ws:// receiver in RemoteControlTask and issue #743.
written as a raw string with no header-encoding layer, and a user-set Roku name may carry non-ASCII; the server already holds the device name on the token's device row, and omitting it also avoids a device-row rewrite on every reconnect. HTTP callers keep the default.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
shouldIncludeDeviceName | boolean | <optional> | true | false omits the free-text |
- Source
- Type:
- string
(static) buildParams(paramsopt) → {string}
Functions for making requests to the API
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} |
- Source
- Type:
- string
(static) buildURL(path, paramsopt) → {dynamic}
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
path | string | |||
params | object | <optional> | {} |
- Source
- Type:
- dynamic
(static) executeHttpRequest(req, defaultMethod, logLabel) → {object}
Shared HTTP execution for the API task tiers. Builds the request args (auth header, timeout, Content-Type default) from a request AA and performs the roku-requests call. Returns the raw roku-requests result object, or invalid when the URL is missing/empty (the caller decides how to surface that — Tier 1 maps it to an error response AA, the fire-and-forget SideEffectTask ignores it).
Centralizes what previously lived duplicated in ApiTask.executeRequest() and SideEffectTask.executeSideEffect(); that copy drifted across three separate historical fixes (Content-Type default, URL validation, timeout centralization), each of which had to patch both copies in lockstep. Runs on whichever Task thread invokes it — free functions share the caller's m, so auth/global reads resolve exactly as before.
| Name | Type | Description |
|---|---|---|
req | object | request AA: { method, url, headers?, body?, timeout? } |
defaultMethod | string | HTTP method when req.method is absent ("GET" for the pool, "POST" for side effects) |
logLabel | string | tag prefixed to the invalid-URL log line (e.g. "[ApiTask]") |
roku-requests result (.ok / .statusCode / .json / .text), or invalid on bad URL
- Type:
- object
(static) getJson(req) → {dynamic}
| Name | Type | Description |
|---|---|---|
req | dynamic |
- Source
- Type:
- dynamic
(static) getUrl() → {dynamic}
- Source
- Type:
- dynamic
(static) postJson(req, dataopt) → {dynamic}
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
req | dynamic | |||
data | string | <optional> | "" |
- Source
- Type:
- dynamic
(static) setCertificateAuthority(request) → {void}
sets the certificate authority by file path on the passed node
| Name | Type | Description |
|---|---|---|
request | object |
- Source
- Type:
- void