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
typedefsfolder to thetypefolder. Card,CardWorld,Nation,Region,World, andWorldAssemblyare no longer classes, but normal typedefs.- Minimum Node version set to
14.0.0due to internal usage of the??operator and optional chaining.
- All types have been moved internally, from the
Cardtype:typeproperty removed in favour of newcategoryproperty.flag,category,name,region,motto, andpretitleproperties are now contained within a newdepictedproperty.
DispatchandListDispatchtypes: Removedcategoryproperty in favour of new distinct properties:categoryTop, containing the top-level category.categorySub, containing the subcategory.
DispatchSubcategoryenum: Values themselves are now simply in the form[subcategory]instead of the combined[category]:[subcategory].DumpModeenum:READ_REMOTEvalue removed in favour ofREMOTE.EmbassyDatatype: Removed in favour of theEmbassytype:- Accordingly, the
embassiesproperty of aRegionnow is anEmbassy[]. - Added
EmbassyPhaseenum to describeEmbassystates.
- Accordingly, the
Issuetype: Removedimagesproperty in favour of new distinct properties:imageLarge, containing the large rectangular pictureimageSmall, containing the small square picture
IssueCommandclass:dismissfunction removed.answerfunction removed in favour of a newsetOptionfunction.
LegalityDecisiontype:reasonmade nullable.decisionproperty removed in favour of newrulingproperty.
Markettype: Removedtypeproperty in favour of newisAskproperty.Nationtype:freedomsproperty removed in favour offreedomDescriptionsproperty.freedomValuesproperty removed in favour of newfreedomScoresproperty.idproperty removed in favour of newdbIDproperty.
NSobject:- 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.
Regiontype:bannedproperty removed in favour of newbanlistproperty.idproperty removed in favour of newdbIDproperty.foundedTimeproperty removed in favour of newfoundedTimestampproperty.
RMBActivityAggregatetype: Renamed toRMBActivityWorldtype:censusScaleNameproperty removed in favour of newcensusScaleproperty.
- Removal of deprecated properties:
FreedomsDatatype: Removed in favour ofFreedomsTextDatatype.Nationtype:freedomsremoved in favour offreedomDescriptions.NationShardenum:FREEDOMremoved 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
NoticeIconenum: Contains the values for the various icons displayed on notices - Support for another three missed
NoticeTypes:NEW_ISSUERMB_QUOTE_DISPATCHTELEGRAM
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:
CensusScales for the region-specific alphabetic ordering (REGION_ALPHABET) and number-of-nations (REGION_POPULATION) scales,- a
NoticeTypefor a failed login attempt (BAD_LOGIN), and - a
WABadgeTypefor 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!