Home Manual Reference Source
public class | source

Maps4News

Expression Extends:

class Maps4News extends mix(null, Injectable)

Base API class

Constructor Summary

Public Constructor
public

constructor(auth: OAuth | string, host: string)

Member Summary

Public Members
public get

auth: OAuth: *

Get authentication provider instance

public set

auth(value: OAuth)

Set authentication provider instance

public get

Test if the client is authenticated with the api and has a valid token

public get

Get if the api should automatically call logout when it counters an AuthenticationException

public set

Set if the api should automatically call logout when it counters an AuthenticationException

public get

axios: AxiosInstance: *

Pre-configured Axios instance

public get

Get the shared cache instance

public get

Choropleth accessor

public get

Color accessor

public get

Contract accessor

public

defaults: {cacheSeconds: number, shareCache: boolean, autoUpdateSharedCache: boolean, dereferenceCache: boolean}

Defaults for common parameters.

public get

Dimension set accessor

public get

Dimension accessor

public get

Faq accessor

public get

Featured jobs accessor

public get

Feature accessor

public get

FontFamily accessor

public get

Font accessor

public get

Highlight accessor

public get

host: string: *

The current host

public set

host(value: string)

The remote host

public get

InsetMap accessor

public get

JobShare accessor

public get

JobType accessor

public get

Job accessor

public get

Language accessor

public get

Layer accessor

public get

Get logger instance

public get

MapstyleSet accessor

public get

Mapstyle accessor

public get

Notification accessor

public get

Organisation accessor

public get

Permission accessor

public get

PlaceName accessor

public get

Role accessor

public get

SvgSet accessor

public get

Svg accessor

public get

Tag accessor

public get

User accessor

public get

Get api version

Method Summary

Public Methods
public

Authenticate with the api using the authentication method provided.

public

Get font styles

public
this method was deprecated. Use getSvgSetTypes

Get SVG set types

public

Get SVG set types

public

logout(): *

Forget the current session This will clean up any stored OAuth states stored using StateContainer and any OAuth tokens stored

public

saveToken(name: string)

Saves the session token so that it can be recovered at a later time.

public

static(Target: string | function, Constructor: function): ResourceProxy

Static proxy generation

Public Constructors

public constructor(auth: OAuth | string, host: string) source

Params:

NameTypeAttributeDescription
auth OAuth | string

Authentication flow

host string

Remote API host

Public Members

public get auth: OAuth: * source

Get authentication provider instance

Return:

OAuth

OAuth instance

public set auth(value: OAuth) source

Set authentication provider instance

public get authenticated: boolean: * source

Test if the client is authenticated with the api and has a valid token

Return:

boolean

If the client is authenticated with the api

public get autoLogout: boolean: * source

Get if the api should automatically call logout when it counters an AuthenticationException

Return:

boolean

Auto logout

See:

public set autoLogout(value: boolean) source

Set if the api should automatically call logout when it counters an AuthenticationException

See:

public get axios: AxiosInstance: * source

Pre-configured Axios instance

Return:

AxiosInstance

Axios instance

public get cache: ResourceCache: * source

Get the shared cache instance

Return:

ResourceCache

Shared cache instance

public get choropleths: GeoResourceProxy: * source

Choropleth accessor

Return:

GeoResourceProxy

A proxy for accessing the resource

See:

public get colors: ResourceProxy: * source

Color accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get contracts: ResourceProxy: * source

Contract accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public defaults: {cacheSeconds: number, shareCache: boolean, autoUpdateSharedCache: boolean, dereferenceCache: boolean} source

Defaults for common parameters. These are populated during the build process using the .env file.

public get dimensionSets: ResourceProxy: * source

Dimension set accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get dimensions: ResourceProxy: * source

Dimension accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get faqs: ResourceProxy: * source

Faq accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get featuredMaps: SimpleResourceProxy: * source

Featured jobs accessor

Return:

SimpleResourceProxy

A proxy for accessing the resource

See:

public get features: ResourceProxy: * source

Feature accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get fontFamilies: ResourceProxy: * source

FontFamily accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get fonts: ResourceProxy: * source

Font accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get highlights: GeoResourceProxy: * source

Highlight accessor

Return:

GeoResourceProxy

A proxy for accessing the resource

See:

public get host: string: * source

The current host

Return:

string

The current host

public set host(value: string) source

The remote host

public get insetMaps: GeoResourceProxy: * source

InsetMap accessor

Return:

GeoResourceProxy

A proxy for accessing the resource

See:

public get jobShares: ResourceProxy: * source

JobShare accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get jobTypes: ResourceProxy: * source

JobType accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get jobs: ResourceProxy: * source

Job accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get languages: ResourceProxy: * source

Language accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get layers: ResourceProxy: * source

Layer accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get logger: Logger: * source

Get logger instance

Return:

Logger

Logger instance

public get mapstyleSets: ResourceProxy: * source

MapstyleSet accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get mapstyles: ResourceProxy: * source

Mapstyle accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get notifications: ResourceProxy: * source

Notification accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get organisations: ResourceProxy: * source

Organisation accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get permissions: ResourceProxy: * source

Permission accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get placeNames: ResourceProxy: * source

PlaceName accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get roles: ResourceProxy: * source

Role accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get svgSets: ResourceProxy: * source

SvgSet accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get svgs: ResourceProxy: * source

Svg accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get tags: ResourceProxy: * source

Tag accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get users: ResourceProxy: * source

User accessor

Return:

ResourceProxy

A proxy for accessing the resource

See:

public get version: string: string source

Get api version

Return:

string

Api version

Public Methods

public async authenticate(): Promise<Maps4News> source

Authenticate with the api using the authentication method provided.

Return:

Promise<Maps4News>

current instance

Throw:

OAuthError

ApiError

public async getFontStyles(): Promise<Enum> source

Get font styles

Return:

Promise<Enum>

Contains all the possible font styles

Throw:

ApiError

See:

public getSvgSetType(): Promise<Enum> source

this method was deprecated. Use getSvgSetTypes

Get SVG set types

Return:

Promise<Enum>

Contains all the possible SVG set types

Throw:

ApiError

See:

TODO:

  • Remove

public async getSvgSetTypes(): Promise<Enum> source

Get SVG set types

Return:

Promise<Enum>

Contains all the possible SVG set types

Throw:

ApiError

See:

public logout(): * source

Forget the current session This will clean up any stored OAuth states stored using StateContainer and any OAuth tokens stored

Return:

*

public saveToken(name: string) source

Saves the session token so that it can be recovered at a later time. The wrapper can find the token most of the time if the name parameter is left blank.

Params:

NameTypeAttributeDescription
name string

name of the token

public static(Target: string | function, Constructor: function): ResourceProxy source

Static proxy generation

Params:

NameTypeAttributeDescription
Target string | function

Constructor or url

Constructor function

Constructor for a resource that the results should be cast to

Return:

ResourceProxy

A proxy for accessing the resource

Example:

api.static('/custom/resource/path/{id}/').get(123);
class FooBar extends ResourceBase {
   static get resourceName() {
     return 'custom';
   }
}

api.static(FooBar)
  .get(1)
  .then(console.log);

api.static('/foo-bar-custom', FooBar).lister();