diff --git a/README.md b/README.md index 7b05149..9e4d596 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,8 @@ Environment variable | Description `NXAPI_REMOTE_CONFIG_FALLBACK` | Allows using local configuration data if the remote configuration data cannot be fetched if set to `1`. This should not be used, as it can cause nxapi to revert to local configuration data after previously using newer remote configuration data. `NXAPI_CONFIG_URL` | Sets the URL to fetch remote configuration data from. `NXAPI_SKIP_UPDATE_CHECK` | Disables the update check in the nxapi command and the Electron app if set to `1`. +`NXAPI_SPLATNET3_UPGRADE_QUERIES` | Sets when the SplatNet 3 client is allowed to upgrade persisted query IDs to newer versions. If `0` queries are never upgraded (not recommended). If `1` queries are upgraded if they do not contain potentially breaking changes (not recommended, as like `0` this allows older queries to be sent to the API). If `2` queries are upgraded, requests that would include breaking changes are rejected. If `3` all queries are upgraded, even if they contain potentially breaking changes (default). +`NXAPI_SPLATNET3_STRICT` | Disables strict handling of errors from the SplatNet 3 GraphQL API if set to `0`. If set to `1` (default) requests will be rejected if the response includes any errors, even if the response includes a result. `DEBUG` | Used by the [debug](https://github.com/debug-js/debug) package. Sets which modules should have debug logging enabled. See [debug logs](#debug-logs). Other environment variables may also be used by Node.js, Electron or other packages nxapi depends on. diff --git a/src/api/splatnet3.ts b/src/api/splatnet3.ts index 417026e..1095eb0 100644 --- a/src/api/splatnet3.ts +++ b/src/api/splatnet3.ts @@ -921,7 +921,7 @@ export default class SplatNet3Api { return new this( data.bullet_token.bulletToken, data.version, - {}, + data.queries ?? {}, getMapPersistedQueriesModeFromEnvironment(), data.bullet_token.lang, data.useragent, @@ -932,7 +932,7 @@ export default class SplatNet3Api { return new this( data.bullet_token, data.version, - {}, + data.queries ?? {}, getMapPersistedQueriesModeFromEnvironment(), data.language, SPLATNET3_WEBSERVICE_USERAGENT, @@ -1026,6 +1026,7 @@ export default class SplatNet3Api { language, country: user.country, version, + queries: config.map_queries, bullet_token, created_at, @@ -1053,6 +1054,7 @@ export interface SplatNet3AuthData { language: string; country: string; version: string; + queries?: Partial>; bullet_token: BulletToken; created_at: number; @@ -1070,6 +1072,7 @@ export interface SplatNet3CliTokenData { expires_at: number; language: string; version: string; + queries?: Partial>; } export enum XRankingRegion { diff --git a/src/cli/splatnet3/token.ts b/src/cli/splatnet3/token.ts index 53f8cb3..2309100 100644 --- a/src/cli/splatnet3/token.ts +++ b/src/cli/splatnet3/token.ts @@ -41,6 +41,7 @@ export async function handler(argv: ArgumentsCamelCase) { expires_at: data.expires_at, language: data.bullet_token.lang, version: data.version, + queries: data.queries, }; console.log(JSON.stringify(result, null, argv.jsonPrettyPrint ? 4 : 0)); diff --git a/src/common/remote-config.ts b/src/common/remote-config.ts index 8cc1d34..f407f8b 100644 --- a/src/common/remote-config.ts +++ b/src/common/remote-config.ts @@ -259,4 +259,5 @@ export interface SplatNet3RemoteConfig { app_ver: string; version: string; revision: string; + map_queries?: Partial>; }