Constructor Summary
Public Constructor | ||
public |
constructor(auth: OAuth | string, host: string) |
Member Summary
Public Members | ||
public get |
Get authentication provider instance |
|
public set |
Set authentication provider instance |
|
public get |
authenticated: boolean: * Test if the client is authenticated with the api and has a valid token |
|
public get |
autoLogout: boolean: * Get if the api should automatically call logout when it counters an AuthenticationException |
|
public set |
autoLogout(value: boolean) Set if the api should automatically call logout when it counters an AuthenticationException |
|
public get |
axios: AxiosInstance: * Pre-configured Axios instance |
|
public get |
cache: ResourceCache: * Get the shared cache instance |
|
public get |
Choropleth accessor |
|
public get |
colors: ResourceProxy: * 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 |
faqs: ResourceProxy: * Faq accessor |
|
public get |
Featured jobs accessor |
|
public get |
Feature accessor |
|
public get |
FontFamily accessor |
|
public get |
fonts: ResourceProxy: * Font accessor |
|
public get |
Highlight accessor |
|
public get |
The current host |
|
public set |
The remote host |
|
public get |
InsetMap accessor |
|
public get |
JobShare accessor |
|
public get |
JobType accessor |
|
public get |
jobs: ResourceProxy: * Job accessor |
|
public get |
Language accessor |
|
public get |
layers: ResourceProxy: * 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 |
roles: ResourceProxy: * Role accessor |
|
public get |
svgSets: ResourceProxy: * SvgSet accessor |
|
public get |
svgs: ResourceProxy: * Svg accessor |
|
public get |
tags: ResourceProxy: * Tag accessor |
|
public get |
users: ResourceProxy: * User accessor |
|
public get |
Get api version |
Method Summary
Public Methods | ||
public |
async authenticate(): Promise<Maps4News> Authenticate with the api using the authentication method provided. |
|
public |
async getFontStyles(): Promise<Enum> Get font styles |
|
public |
getSvgSetType(): Promise<Enum> this method was deprecated. Use getSvgSetTypes
Get SVG set types |
|
public |
async getSvgSetTypes(): Promise<Enum> 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 |
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 Members
public get authenticated: boolean: * source
Test if the client is authenticated with the api and has a valid token
public get autoLogout: boolean: * source
Get if the api should automatically call logout when it counters an AuthenticationException
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 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 Methods
public async authenticate(): Promise<Maps4News> source
Authenticate with the api using the authentication method provided.
Throw:
public getSvgSetType(): Promise<Enum> source
Get SVG set types
Throw:
See:
TODO:
- Remove
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:
Name | Type | Attribute | Description |
name | string | name of the token |
public static(Target: string | function, Constructor: function): ResourceProxy source
Static proxy generation
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();