Skip to content

v1.3.0

Compare
Choose a tag to compare
@samuelthomas2774 samuelthomas2774 released this 02 Aug 16:26
· 317 commits to main since this release
v1.3.0
67b6052
  • Update Coral (Nintendo Switch Online) version to 2.2.0 (#14)
    • Added new web service JavaScript APIs in the Electron app.
  • Add commands for using friend codes and sending friend requests
    • nxapi nso friendcode to get your friend code URL
      • The URL includes a friendCodeHash parameter, which is required for Nintendo's app to open the link. It is not known how this is generated.
    • nxapi nso lookup 0000-0000-0000 to look up a friend code and get the user's name and image URL
    • nxapi nso add-friend 0000-0000-0000 to send a friend request using a friend code
  • Add API proxy routes for using friend codes
    • /api/znc/friendcode to get your friend code URL
    • /api/znc/friendcode/0000-0000-0000 to look up a friend code and get the user's name and image URL
  • The Nintendo eShop button added to Discord activites now links to a webpage for selecting a Nintendo eShop region
    • This allows selecting the correct Nintendo website region, instead of always using the region of the user sharing their presence.
    • For Splatoon 2, which has different versions for different regions, this webpage replaces the title ID with the correct title ID of the selected region.
    • Example (Splatoon 2, EU): https://fancy.org.uk/api/nxapi/title/0100f8f0000a2000/redirect
  • Improve reliability when using Discord Rich Presence
    • nxapi will now connect to Discord in the background, without blocking the update loop.
    • nxapi will continue to attempt to connect to Discord infinitely instead of throwing an error if it cannot connect after 10 attempts.
  • Update Discord title configuration
  • [Breaking change] When creating a CoralApi, MoonApi or SplatNet2Api object, a helper function should be used instead of calling the constructor directly
    • This is to prevent future updates breaking anything.
    • Added CoralApi.createWithSavedToken(data: CoralAuthData), which takes the data object returned by CoralApi.createWithSessionToken and CoralApi.loginWithSessionToken.
    • Added MoonApi.createWithSavedToken(data: MoonAuthData), which takes the data object returned by MoonApi.createWithSessionToken and MoonApi.loginWithSessionToken.
    • Added SplatNet2Api.createWithSavedToken(data: SplatNet2AuthData), which takes the data object returned by SplatNet2Api.createWithCoral, SplatNet2Api.loginWithCoral and SplatNet2Api.loginWithWebServiceToken.
    • Added SplatNet2Api.createWithCliTokenData(data: SplatNet2CliTokenDate), which takes the JSON-encoded data output from nxapi splatnet2 token --json.
    • Added SplatNet2Api.createWithIksmSession(iksm_session: string, unique_id: string).
  • Add an environment variable to set the user agent string when running the nxapi command in a script or other program
  • The API library and types are now exported in separate modules using the package.json exports field
  • Coral and Moon (Nintendo Switch Parental Controls) versions are now fetched from a configuration file on my server
    • This means future updates from Nintendo will not require an update.
    • This is done in a safe way, so that if Nintendo make changes to the behaviour of their apps, older versions of nxapi will refuse to connect to Nintendo APIs.
    • The configuration data can be seen using the nxapi util remote-config command.
    • This can be disabled using an environment variable: NXAPI_ENABLE_REMOTE_CONFIG=0. Remote configuration should not be disabled if nxapi has ever been run while it's enabled, as this can result in reporting older versions to Nintendo than have been used before, which is possible using Nintendo's apps (by updating the app, then restoring a full device backup created with an older version of the app installed), but should be extremely rare.
    • This can be overridden in development builds by creating a remote-config.json file in the data directory with the JSON-encoded configuration data.
  • The nxapi command will now refuse to attempt to authenticate to Nintendo services repeatedly within a short period
    • For the parental controls API, the limit is 4 attempts/15 minutes. For all other APIs, the limit is 4 attempts/60 minutes.
    • This is to prevent spamming Nintendo services with invalid requests if a program using the nxapi command does not handle errors properly.
    • This does not apply when running the nxapi command manually in a terminal, or when using the Electron app.
  • All HTTP error messages now include the response data in the stack trace

Build artifacts: https://gitlab.com/samuelthomas2774/nxapi/-/jobs/2803844835/artifacts/browse
Full changelog: v1.2.0...v1.3.0