Constructors
constructor
- new Connection(baseURL: string, wsURL: string, useWebSockets?: boolean): Connection
-
Parameters
-
baseURL: string
-
wsURL: string
-
Optional useWebSockets: boolean
Properties
Private $baseURL
$baseURL: string
Methods
Private checkForErrors
- checkForErrors(status: HttpErrorCodes, parsedResponse?: Record<string, unknown>): void
-
Parameters
-
-
Optional parsedResponse: Record<string, unknown>
Returns void
Private createUrl
- createUrl(endpoint: string): string
-
Parameters
Returns string
request
- request<T>(method: HttpMethod, endpoint: string, data?: Data, allowedScopes?: Scopes[], skipParsing?: boolean): Promise<T>
-
Type parameters
Parameters
-
-
endpoint: string
-
Optional data: Data
-
Optional allowedScopes: Scopes[]
-
Optional skipParsing: boolean
Returns Promise<T>
Private setBearerTokenIfRequired
- setBearerTokenIfRequired(headers: any, scopes?: Scopes[]): void
-
Parameters
-
headers: any
-
Optional scopes: Scopes[]
Returns void
setUser
- setUser(user?: User): void
upload
- upload<T>(endpoint: string, body: FormData, allowedScopes: Scopes[]): Promise<T>
-
Type parameters
Parameters
-
endpoint: string
-
body: FormData
-
allowedScopes: Scopes[]
Returns Promise<T>