Skip to content

Releases: samuelthomas2774/nxapi

v1.6.1

01 Mar 15:23
v1.6.1
6da54cd
Compare
Choose a tag to compare

Electron app

  • Fix opening external links in SplatNet 3

CLI

  • Fix SplatNet 3 monitoring when no battle/coop history/album photos exist

Discord Rich Presence

SplatNet 3

  • Add share outfit query

Presence server

  • Fix Splatoon 3 Splatfest vote state in the all users endpoint

Other

  • Update Coral to v2.5.0
  • Update SplatNet 3 to v3.0.0-2857bc50
  • Send coral platform/version to f generation API
  • Handle ECONNRESET as a temporary error
  • Handle HTTP 502 Bad Gateway, 503 Service Unavailable and 504 Gateway Timeout as temporary errors
  • Handle Cloudflare HTTP 521 Web Server Is Down, 522 Connection Timed Out, 523 Origin Is Unreachable, 524 A Timeout Occurred and 530 as temporary errors
  • Fix handling timeouts as a temporary error
  • Fix cache duration for friend code data in the Coral API proxy

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/4863/artifacts/browse
Full changelog: v1.6.0...v1.6.1

v1.6.0

20 Dec 14:51
v1.6.0
11077b0
Compare
Choose a tag to compare

Electron app

  • Add open in background option on Windows
    • This also works on Linux. Starting the app with the --app-open-at-login=1 option causes the app to show the open in background option. This must be added to a login script manually.

Windows users: The open at login option must be disabled before updating to prevent creating duplicate login items.

Apple Silicon macOS users: A native ARM64 build is now available. Because the app isn't signed and notarised macOS will refuse to open it when downloaded using a web browser. Using the secondary click menu to open the app does not bypass this and the quarantine flag must be removed manually by running xattr -r -d com.apple.quarantine .../Nintendo\ Switch\ Online.app in a terminal.

Discord Rich Presence

  • Add an option to show presence to the nearest hour
  • Add support for Big Run for Splatoon 3 presence
  • Fix error handling when using a presence URL
  • Fix clearing the activity when reconnecting to Discord
  • Update Discord title configuration

SplatNet 3

  • GraphQL persisted queries are now upgraded automatically
    • Updated query IDs are fetched using nxapi's remote configuration.
    • The NXAPI_SPLATNET3_UPGRADE_QUERIES environment variable can be used to control when queries are upgraded:
      • If set to 0 persisted query IDs are never upgraded (not recommended).
      • If set to 1 persisted query IDs are upgraded if they do not contain potentially breaking changes (not recommended).
      • If set to 2 persisted query IDs are upgraded, but requests that contain potentially breaking changes are rejected. Removed queries are rejected.
      • If set to 3 (default) persisted query IDs are always upgraded, including requests that contain potentially breaking changes. Removed queries are rejected.
  • Add X Ranking leaderboard queries

Presence server

  • Add presence API event streams
    • This can be used to continuously receive updated presence data more efficiently than polling the API. The API itself continuously fetches presence data and pushes new data to the client.
    • This can be used in a browser using the EventSource API.
    • nxapi will automatically use the event stream if the environment variable NXAPI_PRESENCE_SSE is set to 1.
    • An update event is emitted with no data when the server checks for new data.
    • A supported_events event is emitted with an array of supported events.
    • An event for each response key (friend, title, splatoon3, splatoon3_fest_team, splatoon3_vs_setting, splatoon3_coop_setting, splatoon3_fest) is emitted when the value is added/updated. No event is emitted if the value is removed.
  • Add Retry-After header to Coral API proxy and presence API errors
    • nxapi v1.5.0 and later uses this header to automatically retry temporary errors.
  • Presence API now tracks and returns the timestamp the user started playing the current title
  • Add SplatNet 3 proxy for use with the presence API server
  • Add environment variables to configure the presence API server
  • Coral API proxy and presence API now returns formatted JSON when accessed in a browser
  • Presence API now returns original high quality image URLs for Splatoon 3 stages
  • Splatoon 3 presence data is no longer returned by the presence API if the user is not playing Splatoon 3
  • Allow updating presence server data every 10 minutes if the requested user was not friends with the presence server user
  • Fix running presence server with the default user

Other

  • Update Coral to v2.4.0
  • Update SplatNet 3 to v2.0.0-bd36a652
  • Response data in error messages is now limited to 100 characters
    • Full response bodies are still written to stdout.
  • Add automatic renewal of Moon (Nintendo Switch Parental Controls) and NookLink tokens
  • Internal changes to Coral API proxy and presence API
  • The update check is now skipped when running in a Docker container
  • Fix authentication limit is ignored when renewing Coral and SplatNet 3 tokens
  • Ignore SplatNet 3 ConfigureAnalyticsQuery errors (occurs when the user has never played Anarchy Battle and didn't import Splatoon 2 data)

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/4566/artifacts/browse
Full changelog: v1.5.0...v1.6.0

v1.5.0

28 Oct 14:51
v1.5.0
a6acd99
Compare
Choose a tag to compare

Electron app

  • Added a preferences window
    • This includes all additional options for customising Discord activities.
    • For macOS and Windows, login item settings can also be found here.
    Screenshot 2022-10-28 at 15 43 58
  • Add support for SplatNet 3
    • The exit button and unnecessary scroll bars are now hidden.
    • Data can be refreshed using Cmd+R/Ctrl+R.
    • Added new web service JavaScript APIs used by SplatNet 3.
  • Add support for using web service deep links while the web service is open
  • The default browser can now be used to add an account by holding Shift when pressing the add account button
  • Web services in the menu are now fetched from the API instead of being hardcoded in the app
  • Improved error handling when launching web services and renewing web service tokens
  • Hide menus in web service windows on Windows and Linux
  • Fix user selection menu for deep links is closed immediately
  • Disabled Chromium's built-in hostname resolver
    • This was only enabled in macOS due to Electron's default settings and causes system encrypted DNS settings to be ignored.
  • fix: use correct title for Windows notifications by @Rexogamer in https://gitlab.fancy.org.uk/samuel/nxapi/-/merge_requests/1

CLI

  • Add SplatNet 3 commands
    • Added nxapi splatnet3 user to show the authenticated user.
    • Added nxapi splatnet3 token to get an access token for SplatNet 3. The --json option is available for use with SplatNet3Api.createWithCliTokenData and scripts.
    • Added nxapi splatnet3 schedule --json to get the current schedule data as JSON.
    • Added nxapi splatnet3 battles to show the last 50 battles. (--json option supported.)
    • Added nxapi splatnet3 dump-records to download all history, hero and catalog records and stage and weapon stats.
    • Added nxapi splatnet3 dump-fests to download all Splatfest records.
    • Added nxapi splatnet3 dump-album to download all photo album items.
    • Added nxapi splatnet3 dump-results to download all battle and Salmon Run result data.
    • Added nxapi splatnet3 monitor to continuously download all battle and Salmon Run results and photo album items.
    • Added nxapi splatnet3 friends to show Nintendo Switch Online friends who have played Splatoon 3. (--json option supported.)
    • Added nxapi splatnet3 festivals to show Splatfests in your region. (--json option supported.)
    • Added nxapi splatnet3 festival {id} to show a specific Splatfest. (--json option supported.)
  • Added nxapi nso active-event to get the current Online Lounge/voice chat event
  • Add coop (salmon run) types and results for SplatNet 3 by @telgniw in #23
  • Fix an issue causing the CLI process to crash when showing desktop notifications
  • Fix importing node-notifier for desktop notifications

JavaScript/TypeScript library

  • Add SplatNet 3 API client
    • This can be accessed from the nxapi/splatnet3 module.
    • SplatNet3Api instances can be created in the same way as SplatNet2Api.
    • API types are published separately in the splatnet3-types package.
  • All API functions now return the Response object
    • This can be accessed by importing the ResponseSymbol symbol from the nxapi module.
  • The Coral API functions now return the result object directly
    • The raw response object can be retrieved using the ResponseDataSymbol symbol from the nxapi/coral module.
    • The correlationId value can be retrieved using the CorrelationIdSymbol symbol from the nxapi/coral module.
    • This is compatible with existing code expecting the status, result and correlationId to exist on the returned object, however new code should expect to access the result object directly.
    • The symbol and deprecated raw response keys will not exist when serialised to JSON.

Discord Rich Presence

  • Add detailed Rich Presence information using SplatNet 3 while playing Splatoon 3
    • This must be enabled in preferences or using the --splatnet3-monitor flag. When enabled the current game mode, rule and stages will appear in Discord. This only applies to online modes; hero mode and other offline modes will not show additional information in Discord.
    • This requires using a secondary account with your main account added as a friend to retrieve your presence data.
    • The secondary account must be able access to SplatNet 3. This means it must have an active Nintendo Switch Online membership and have Splatoon 3 data. Note that it is only necessary to get to the point where you have set a Splatfest region to be able to access SplatNet 3; completing the tutorial or playing an online battle is not necessary. This can be checked by attempting to open SplatNet 3 in the app or by running nxapi splatnet3 user.

      Screenshot showing Splatoon 3 as a Discord activity with SplatNet 3 presence information
  • Presence data is now saved so restarting the app while playing does not reset the start time
  • Temporary errors reported by an external presence URL will now be ignored and the request will be retried after a delay suggested by the server
  • Update Discord title configuration
  • Slight rich presence demo list improvements by @Adrthegamedev in #20

Other

  • Add support for the updated flapg API
    • The flapg API no longer requires client authentication, so will still be supported without the splatnet2statink API.
    • This can be used by setting the NXAPI_ZNCA_API environment variable to flapg.
  • nxapi's f-generation server is now a separate repository
  • Fix getting web service tokens when the Coral token has expired

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/4275/artifacts/browse
Full changelog: v1.4.0...v1.5.0

v1.4.0

24 Aug 20:34
v1.4.0
89ce793
Compare
Choose a tag to compare
  • Add friend code lookup and friend requests to the Electron app
    Screenshot 2022-08-13 at 00 26 25 3
  • Fixed authenticating to the Nintendo Switch Online app API (#17)
    • Nintendo updated the API on 23/08/2022 to properly validate the timestamp parameter sent in authentication requests. This change affects all software that authenticates to Nintendo's API automatically and requires an update to all clients and f parameter generation APIs. More information.
    • Due to this change the flapg API is no longer supported immediately. It can still be used, however until it is updated authentication may not work reliably.
  • Changed the default API for Coral client authentication to the imink API
    • This also applies to v1.3.0, unless remote configuration is disabled.
    • The splatnet2statink and flapg APIs can still be used by setting the NXAPI_ZNCA_API environment variable to flapg, however the splatnet2statink API is deprecated and scheduled to be shut down by the end of 2022.
  • Update Discord title configuration
  • Friends last online timestamp now appears as a relative timestamp ("1 hour ago") and also appear in the friends list
  • Update NookLink version
    • Nintendo doesn't check this anyway, but this is now also fetched from my server so can be updated remotely.
  • [Breaking change] When creating a NooklinkApi or NooklinkUserApi object, a helper function should be used instead of calling the constructor directly
    • This matches the changes in v1.3.0 for CoralApi, MoonApi and SplatNet2Api, and is to prevent future updates breaking anything.
    • Added NooklinkApi.createWithSavedToken(data: NooklinkAuthData), which takes the data object returned by NooklinkApi.createWithCoral, NooklinkApi.loginWithCoral and NooklinkApi.loginWithWebServiceToken.
    • Added NooklinkUserApi.createWithSavedToken(data: NooklinkUserAuthData), which takes the data object returned by NooklinkApi.createUserClient.
    • Added NooklinkUserApi.createWithCliTokenData(data: NooklinkUserCliTokenData), which takes the JSON-encoded data output from nxapi nooklink user-token --json.
  • Added compatibility with imink's API request format to the znca API server
    • The timestamp parameter is no longer required and when not provided it will be generated and returned in the response. This parameter generally should not be provided to prevent causing issues when the value does not match the value that would be generated on the Android device/emulator. (#17)
    • Additionally the request_id/uuid parameter is also no longer required and will be generated and returned in the response if not provided. This value is safe to generate on the client, but providing this in the response makes it easier to use the API in Paw and other HTTP clients.
  • Remove the unidentified-script user agent string when running the API proxy server
  • Prevent detecting running the nxapi command in an automated script when redirecting output
  • Prevent making requests to match Nintendo's app's behaviour when not necessary
  • Fix an issue where an error is thrown when handling errors in the packaged Electron app
  • Fix an issue where multiple f parameter generation requests received by the znca API server at the same time result in invalid tokens being returned
  • Disable client hints for web services
    • This is not available in Nintendo's app and exposes the true client platform.
  • Fix an issue where standard OAuth 2.0/OpenID Connect errors from Nintendo are not handled properly
  • Fix an issue where updating Nintendo Switch Online app data never completes
  • Fix friend context menus not updating
  • Fix some issues with X Rank season calculation

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

v1.3.0

02 Aug 16:26
v1.3.0
67b6052
Compare
Choose a tag to compare
  • 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

v1.2.0

02 Jul 13:30
v1.2.0
1698155
Compare
Choose a tag to compare
  • Rename ZncApi to CoralApi
    • ZncApi and znc will be removed later. Use CoralApi and coral instead.
  • Add commands to get the SplatNet 2 iksm_session cookie and NookLink user token
    • These commands are suitable for use in scripts. For example, curl --header "Cookie: iksm_session=`nxapi splatnet2 token`" https://app.splatoon2.nintendo.net/api/records works (but doesn't attempt to appear as a normal SplatNet 2 API request).
    • nxapi splatnet2 token will print the iksm_session cookie to stdout.
    • nxapi splatnet2 token --json will print the iksm_session cookie, region and unique player ID embedded in the SplatNet 2 HTML template to stdout.
    • nxapi nooklink user-token will print the authentication token for the selected NookLink user to stdout.
    • nxapi nooklink user-token --json will print the authentication token for the selected NookLink user and the NookLink user ID to stdout.
  • Add a command and helper functions for Splatoon 2 X Rank seasons
    • X Rank seasons are calculated locally (by the SplatNet 2 web app and nxapi). The SplatNet 2 API doesn't actually provide this information.
    • nxapi splatnet2 x-rank-seasons [--json] prints all X Rank seasons.
    • getSplatNet2XRankSeasons, getSplatNet2XRankSeason, getSplatNet2NextXRankSeason, getSplatNet2PreviousXRankSeason are exported for use in JavaScript/TypeScript code.
  • Add a function to set a User-Agent for s2s/flapg/imink/nxapi API requests
    • addUserAgent should be called when using nxapi as a dependency, e.g. addUserAgent('your-app-name/1.0.0').
  • Update Discord title configuration
    • Added custom application for Pokémon UNITE (#6)
  • Added an icon for the system tray menu
  • Remove unused dependencies from the app build
    • This makes the app quite a bit smaller.
  • Improved error handling in the app
  • Fix update message is not cleared after updating

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3707/artifacts/browse
Full changelog: v1.1.0...v1.2.0

v1.1.0

19 Jun 20:17
v1.1.0
57d8556
Compare
Choose a tag to compare
  • Added guided Discord Rich Presence setup for authenticated users
    • When Discord Rich Presence is not enabled and a user that can access the selected user's presence has been added, a setup button will appear in the main window.
    • When pressed, the Discord Rich Presence window is opened with only authenticated friends listed.
  • The app now always stays open in the background
    • Previously the app would only stay open in the background on macOS
  • Update Discord title configuration
    • Added custom application for Monster Hunter Rise (#5)
  • The app now starts immediately, without waiting for presence monitors to start
  • Added a link to show friend's game in Nintendo eShop
  • Add support for game-specific service deeplinks
    • This is used by Happy Home Network in NookLink (which I don't have, so this hasn't been tested properly).
    • The Nintendo Switch Online app only allows launching game-specific services with the deepLinkingEnabled attribute set (only NookLink currently). nxapi allows launching any game-specific service, e.g. SplatNet 2: com.nintendo.znca://znca/game/5741031244955648.
    • NookLink uses https://dpl.sd.lp1.acbaa.srv.nintendo.net (acbaa = ACNH, dpl = deeplink?) to open these links. dpl.lp1.av5ja.srv.nintendo.net (av5ja = Splatoon 3) exists (but doesn't resolve)... so maybe SplatNet 3 uses deeplinks as well?
  • Add X-AppColorScheme header when loading game-specific services (#3)
  • Fix light button appearance on macOS

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3624/artifacts/browse
Full changelog: v1.0.0...v1.1.0

v1.0.0

12 Jun 19:31
v1.0.0
1ebfa89
Compare
Choose a tag to compare

Initial release of the full Electron app.

macOS:

https://github.com/samuelthomas2774/nxapi/blob/v1.0.0/resources/app.png

Windows:

Screenshot 2022-06-12 203300

  • Add support for sharing images/links from game-specific services
  • Fix issues with API requests

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3589/artifacts/browse
Full changelog: v0.3.0...v1.0.0

v0.3.0

26 May 12:06
v0.3.0
551daa8
Compare
Choose a tag to compare
  • Updated znca version to 2.1.1
  • Add an option to use the imink API to generate f parameters
  • Add an option to use a specific Discord client by user ID
  • Enable start timestamp for all titles by default when sharing presence to Discord
    • The updated timestamp from Nintendo is used so this is now accurate
    • This makes the activity appear in the Active Now panel in Discord
  • Internal changes related to the Electron app

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3548/artifacts/browse
Full changelog: v0.2.1...v0.3.0

v0.2.1

07 May 22:39
v0.2.1
7ba59ac
Compare
Choose a tag to compare
v0.2.1 Pre-release
Pre-release
  • Fix not work in Windows by @YDKK in #2
  • Fix running from a path with spaces/other URL-encoded special characters

Build artifacts: https://gitlab.fancy.org.uk/samuel/nxapi/-/jobs/3454/artifacts/browse
Full changelog: v0.2.0...v0.2.1