Initializes a new instance of the NsApi class.
A string identifying you to the NationStates API. Using the name of your main nation is recommended.
Other options.
Gets the delay before API requests in milliseconds.
Sets the delay before API requests in milliseconds. Must be greater than or equal to 600.
Gets whether the API is blocked from performing any further requests.
Sets whether the API is blocked from performing any further requests.
Gets whether new API requests are blocked from being added to the queue.
Sets whether new API requests are blocked from being added to the queue.
Gets whether API requests should be cached.
Sets whether API requests should be cached.
Gets the number of seconds that API requests should stay cached.
Sets the number of seconds that API requests should stay cached.
Gets whether a delay is introduced before API and telegram requests.
Setting this value re-initializes the API scheduler.
Sets a value indicating whether a delay is introduced before API and telegram requests.
Setting this value re-initializes the API scheduler.
Gets the delay before non-recruitment telegram requests in milliseconds.
Sets the delay before non-recruitment telegram requests in milliseconds. Must be greater than or equal to 60000.
Gets the delay before recruitment telegram requests in milliseconds. Must be greater than or equal to 180000.
Sets the delay before recruitment telegram requests in milliseconds.
Gets whether an API request is in progress.
Gets whether there is at least one API request in the queue.
Gets a string identifying you to the NationStates API.
Sets a string identifying you to the NationStates API. Using the name of your main nation is recommended.
Creates a NationStates API path from a set of parameters.
Requests data from the NationStates API.
The NationStates API path to request data from.
The telegram type, or undefined if this is not a telegram request.
Authentication information for private shards.
A promise returning the data from the NationStates API.
Sends an authentication request using the NationStates authentication API.
Note that authentication requests are never cached.
The nation to authenticate.
The checksum to perform authentication with.
Site-specific token. No token will be specified if this value is left undefined.
A promise returning true if authenticated or false if not authenticated.
Cancels all requests in the API queue and turns off the API scheduler.
After this function is called, no further requests can be made using this API instance, including requests currently in the queue.
Clears the API request cache.
Cancels all API requests in the queue.
Initializes the API scheduler.
Executes a NationStates nation command. Even if request caching is enabled, these requests are never cached.
Authentication information for private shards.
The name of the nation to execute a command for.
The command to execute.
Additional command-specific parameters.
Whether this command requires a prepare.
A promise providing data from the API.
Requests data from the NationStates nation API.
The name of the nation to request data for.
An array of nation API shards. No shards will be specified if left undefined.
Additional shard-specific parameters.
Authentication information for private shards.
If the request cache is enabled, disable it for this request.
A promise providing data from the API.
Parses XML into a JSON object.
The XML to parse.
A promise returning a JSON object.
Requests data from the NationStates region API.
The name of the region to request data for.
An array of region API shards. No shards will be specified if left undefined.
Additional shard-specific parameters.
If the request cache is enabled, disable it for this request.
A promise providing data from the API.
Sends a telegram using the NationStates telegram API. Even if request caching is enabled, these requests are never cached.
The client key.
The ID of the telegram API template.
The secret key of the telegram API template.
The name of the recipient.
The telegram type for rate limit purposes.
A promise providing confirmation from the telegram API.
Requests data from the NationStates World Assembly API.
The council of the World Assembly to request data for.
An array of World Assembly API shards. No shards will be specified if left undefined.
Additional shard-specific parameters.
If the request cache is enabled, disable it for this request.
A promise providing data from the API.
Requests data from the NationStates world API.
This API can also be used to request information from the trading cards API if the "card" or "cards" shard is supplied.
An array of world or trading card API shards. No shards will be specified if left undefined.
Additional shard-specific parameters.
If the request cache is enabled, disable it for this request.
A promise providing data from the API.
Requests XML data from the NationStates API.
Shards to add to the NationStates API path.
Additional shard-specific parameters.
Additional URI-level parameters.
Authentication information for private shards.
If the request cache is enabled, disable it for this request.
A promise returning the data from the NationStates API.
Converts names to a fixed form: all lowercase, with spaces replaced with underscores.
The name to convert.
The converted name.
Generated using TypeDoc
Provides access to the NationStates API.