From 4449664c15520ef89348e4eb1090ba4115ea8659 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Thu, 27 Oct 2022 19:29:05 +0800 Subject: [PATCH] feat: switch back to s3s' namespace (0.1.11) https://github.com/frozenpandaman/s3s/issues/65 --- src/constant.ts | 3 ++- src/exporters/stat.ink.ts | 6 +++--- src/utils.ts | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/constant.ts b/src/constant.ts index e1503aa..2c890f0 100644 --- a/src/constant.ts +++ b/src/constant.ts @@ -1,7 +1,7 @@ import type { StatInkPostBody, VsHistoryDetail } from "./types.ts"; export const AGENT_NAME = "s3si.ts"; -export const S3SI_VERSION = "0.1.10"; +export const S3SI_VERSION = "0.1.11"; export const NSOAPP_VERSION = "2.3.1"; export const WEB_VIEW_VERSION = "1.0.0-5644e7a2"; export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts"; @@ -14,6 +14,7 @@ export const DEFAULT_APP_USER_AGENT = export const SPLATNET3_URL = "https://api.lp1.av5ja.srv.nintendo.net"; export const SPLATNET3_ENDPOINT = "https://api.lp1.av5ja.srv.nintendo.net/api/graphql"; +export const S3S_NAMESPACE = "b3a2dbf5-2c09-4792-b78c-00b548b70aeb"; export const S3SI_NAMESPACE = "63941e1c-e32e-4b56-9a1d-f6fbe19ef6e1"; export const SPLATNET3_STATINK_MAP: { diff --git a/src/exporters/stat.ink.ts b/src/exporters/stat.ink.ts index c49cade..b763322 100644 --- a/src/exporters/stat.ink.ts +++ b/src/exporters/stat.ink.ts @@ -1,5 +1,7 @@ import { AGENT_NAME, + S3S_NAMESPACE, + S3SI_NAMESPACE, S3SI_VERSION, SPLATNET3_STATINK_MAP, USERAGENT, @@ -18,8 +20,6 @@ import { base64, msgpack } from "../../deps.ts"; import { APIError } from "../APIError.ts"; import { cache, gameId } from "../utils.ts"; -const S3S_NAMESPACE = "b3a2dbf5-2c09-4792-b78c-00b548b70aeb"; - /** * Decode ID and get number after '-' */ @@ -100,7 +100,7 @@ export class StatInkExporter implements GameExporter { for (const id of list) { const s3sId = await gameId(id, S3S_NAMESPACE); - const s3siId = await gameId(id); + const s3siId = await gameId(id, S3SI_NAMESPACE); if (!uuid.includes(s3sId) && !uuid.includes(s3siId)) { out.push(id); diff --git a/src/utils.ts b/src/utils.ts index b8a31d8..cb4bf72 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ import { APIError } from "./APIError.ts"; -import { S3SI_NAMESPACE } from "./constant.ts"; +import { S3S_NAMESPACE } from "./constant.ts"; import { base64, io, uuid } from "../deps.ts"; const stdinLines = io.readLines(Deno.stdin); @@ -89,7 +89,7 @@ export async function showError(p: Promise): Promise { */ export function gameId( id: string, - namespace = S3SI_NAMESPACE, + namespace = S3S_NAMESPACE, ): Promise { const fullId = base64.decode(id); const tsUuid = fullId.slice(fullId.length - 52, fullId.length);