Skip to content

Releases: anjo0803/nationscript

v2.1.0 | Issues Warnings

28 Jun 13:36
Compare
Choose a tag to compare

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

11 May 16:47
Compare
Choose a tag to compare

Backwards-incompatible changes

  • Generally:
    • All types have been moved internally, from the typedefs folder to the type folder.
    • Card, CardWorld, Nation, Region, World, and WorldAssembly 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.
  • Card type:
    • type property removed in favour of new category property.
    • flag, category, name, region, motto, and pretitle properties are now contained within a new depicted property.
  • Dispatch and ListDispatch types: Removed category 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 of REMOTE.
  • EmbassyData type: Removed in favour of the Embassy type:
    • Accordingly, the embassies property of a Region now is an Embassy[].
    • Added EmbassyPhase enum to describe Embassy states.
  • Issue type: Removed images property in favour of new distinct properties:
    • imageLarge, containing the large rectangular picture
    • imageSmall, containing the small square picture
  • IssueCommand class:
    • dismiss function removed.
    • answer function removed in favour of a new setOption function.
  • LegalityDecision type:
    • reason made nullable.
    • decision property removed in favour of new ruling property.
  • Market type: Removed type property in favour of new isAsk property.
  • Nation type:
    • freedoms property removed in favour of freedomDescriptions property.
    • freedomValues property removed in favour of new freedomScores property.
    • id property removed in favour of new dbID 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 new banlist property.
    • id property removed in favour of new dbID property.
    • foundedTime property removed in favour of new foundedTimestamp property.
  • RMBActivityAggregate type: Renamed to RMBActivity
  • World type:
    • censusScaleName property removed in favour of new censusScale property.
  • Removal of deprecated properties:
    • FreedomsData type: Removed in favour of FreedomsTextData type.
    • Nation type: freedoms removed in favour of freedomDescriptions.
    • NationShard enum: FREEDOM removed in favour of FREEDOM_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

16 Mar 12:35
Compare
Choose a tag to compare

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 NoticeTypes:
    • 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

03 Mar 13:42
Compare
Choose a tag to compare

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

29 Jul 11:25
Compare
Choose a tag to compare

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

28 Jul 10:26
Compare
Choose a tag to compare

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

26 Jul 09:30
Compare
Choose a tag to compare

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 NoticeType for a failed login attempt (BAD_LOGIN), and
  • a WABadgeType for injunction badges (INJUNCTION).

v1.0.3 - Undocumented Nation Shard Update

02 Jul 15:08
Compare
Choose a tag to compare

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

22 Jun 16:43
Compare
Choose a tag to compare

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!