Releases: anjo0803/nationscript
v2.1.0 | Issues Warnings
The new version adds support for the new warnings on some issue options that were recently added to the issues
nation private shard.
Furthermore, the Tag
enum has been updated to reflect recent additions and removals of tags from NationStates, and the Notice
type now correctly treats the icon
property as nullable, since not all in-game notices actually display an icon.
v2.0.0 | Types and Parsing
Backwards-incompatible changes
- Generally:
- All types have been moved internally, from the
typedefs
folder to thetype
folder. Card
,CardWorld
,Nation
,Region
,World
, andWorldAssembly
are no longer classes, but normal typedefs.- Minimum Node version set to
14.0.0
due to internal usage of the??
operator and optional chaining.
- All types have been moved internally, from the
Card
type:type
property removed in favour of newcategory
property.flag
,category
,name
,region
,motto
, andpretitle
properties are now contained within a newdepicted
property.
Dispatch
andListDispatch
types: Removedcategory
property in favour of new distinct properties:categoryTop
, containing the top-level category.categorySub
, containing the subcategory.
DispatchSubcategory
enum: Values themselves are now simply in the form[subcategory]
instead of the combined[category]:[subcategory]
.DumpMode
enum:READ_REMOTE
value removed in favour ofREMOTE
.EmbassyData
type: Removed in favour of theEmbassy
type:- Accordingly, the
embassies
property of aRegion
now is anEmbassy[]
. - Added
EmbassyPhase
enum to describeEmbassy
states.
- Accordingly, the
Issue
type: Removedimages
property in favour of new distinct properties:imageLarge
, containing the large rectangular pictureimageSmall
, containing the small square picture
IssueCommand
class:dismiss
function removed.answer
function removed in favour of a newsetOption
function.
LegalityDecision
type:reason
made nullable.decision
property removed in favour of newruling
property.
Market
type: Removedtype
property in favour of newisAsk
property.Nation
type:freedoms
property removed in favour offreedomDescriptions
property.freedomValues
property removed in favour of newfreedomScores
property.id
property removed in favour of newdbID
property.
NS
object:- All command instantiation functions now only take the login credentials as parameters, and those are now optional as well. All further request customisation happens via newly introduced functions on the returned class instance.
Region
type:banned
property removed in favour of newbanlist
property.id
property removed in favour of newdbID
property.foundedTime
property removed in favour of newfoundedTimestamp
property.
RMBActivityAggregate
type: Renamed toRMBActivity
World
type:censusScaleName
property removed in favour of newcensusScale
property.
- Removal of deprecated properties:
FreedomsData
type: Removed in favour ofFreedomsTextData
type.Nation
type:freedoms
removed in favour offreedomDescriptions
.NationShard
enum:FREEDOM
removed in favour ofFREEDOM_DESCRIPTIONS
.
Other changes
- Plenty of missing properties added and faulty ones corrected in the typedefs.
- Various new enums and typedefs added.
- Types have been made available directly via the top-level export
types
.
v1.0.8 | Notice enums additions
Version 1.0.8 mostly concerns expansions of enums relating to notices:
- New
NoticeIcon
enum: Contains the values for the various icons displayed on notices - Support for another three missed
NoticeType
s:NEW_ISSUE
RMB_QUOTE_DISPATCH
TELEGRAM
Additionally, the library will now append a short notice to UserAgents to identify itself as an instance of NationScript. While not mandatory, NationStates staff have indicated on the NS Coders Discord server that such behaviour is preferred.
v1.0.7 | Further Intellisense Fixes
Further occurrences of VSCode falsely treating sub-properties of the custom classes as any
type have been fixed. Not in a particularly elegant way, but fixed nonetheless.
v1.0.6 - Actual Intellisense Fix
I should probably test this more, since the previous release did in fact not fix the issue 😅
So anyway, version 1.0.6 actually fixes the bug where automatic code completion (at least in VS Code) didn't work for non-Dump requests.
v1.0.5 - Intellisense Fix
It turns out that the module
JSDoc tags in the file headers were confusing VSCode Intellisense - since apparently it would try to look for TypeScript type declarations for declared modules - so they've been nuked and replaced with the standard suggested MPL headers, meaning the automatic code completion should work as intended now.
v1.0.4 - Missing Enum Values
Version 1.0.4 adds four enum values missing from previous versions:
CensusScale
s for the region-specific alphabetic ordering (REGION_ALPHABET
) and number-of-nations (REGION_POPULATION
) scales,- a
NoticeType
for a failed login attempt (BAD_LOGIN
), and - a
WABadgeType
for injunction badges (INJUNCTION
).
v1.0.3 - Undocumented Nation Shard Update
Version 1.0.3 simply adds support for the undocumented freedomscores
shard (which I didn't know existed until it was mentioned on the NS forums) for the nations API endpoint.
Since there is now a shard for raw freedom scores and their textual descriptions, the FREEDOM
shard has been renamed to FREEDOM_DESCRIPTIONS
and the freedoms
property of nation objects to freedomDescriptions
; the old names are still supported for now, but have been marked as deprecated.
First (actually stable) Release
It should actually work now, after I accidentally blew up the base.js
module with a vanity JSDoc thing...
Anyway, features! Basically, it supports all the documented API endpoints, plus the Daily Data Dump archive. You can build requests with the many specialised subclasses that each have functions to manipulate all respective query parameters, relying safely on IntelliSense autocompletion. The same also goes for reading API responses, since everything is fully typed using JSDoc.
The library comes with a variety of enums, for everything from valid shards to Regional Officer authority codes to possible Happenings filters. A few (yet) undocumented shards (hdi
for the nations API, mostposts
, mostliked
, and mostlikes
for the regions API, and newnationdetails
for the world API) are also listed!
Anyway, enough features for now, the full list is in the README by now anyway :P
Let's just hope I didn't accidentally break anything again!