Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Socket

Hierarchy

  • Socket

Index

Constructors

constructor

  • new Socket(url?: any): Socket

Methods

get

  • get(uri: string | string[]): SuperAgentRequest
  • Create a GET request to Dicoogle.

    Parameters

    • uri: string | string[]

      the URI to the intended service, relative to Dicoogle's base URL

    Returns SuperAgentRequest

    a superagent object for a new request to this service

getBase

  • getBase(): string

getRoles

  • getRoles(): string[] | null

getToken

  • getToken(): string | null

getUsername

  • getUsername(): string | null

hasToken

  • hasToken(): boolean

login

  • login(username: string, password: password): Promise<{ admin: boolean; roles: string[]; token: string; user: string }>
  • Parameters

    Returns Promise<{ admin: boolean; roles: string[]; token: string; user: string }>

logout

  • logout(): Promise<void>

post

  • post(uri: string | string[]): SuperAgentRequest
  • Create a POST request to Dicoogle.

    Parameters

    • uri: string | string[]

      the URI to the intended service, relative to Dicoogle's base URL

    Returns SuperAgentRequest

    a superagent object for a new request to this service

put

  • put(uri: string | string[]): SuperAgentRequest
  • Create a PUT request to Dicoogle.

    Parameters

    • uri: string | string[]

      the URI to the intended service, relative to Dicoogle's base URL

    Returns SuperAgentRequest

    a superagent object for a new request to this service

request

  • request(method?: string, uri?: string | string[]): SuperAgentRequest
  • Create a request to Dicoogle.

    Parameters

    • Default value method: string = "GET"

      the intended HTTP method ('GET', 'POST', ...)

    • Optional uri: string | string[]

      the URI to the intended service, relative to Dicoogle's base URL

    Returns SuperAgentRequest

    a superagent object for a new request to this service

reset

  • reset(): void

restore

  • restore(token: string): Promise<UserInfo>

setToken

  • setToken(token: string | null): void
  • Parameters

    • token: string | null

    Returns void

Generated using TypeDoc