2022-10-20 20:06:25 -04:00
|
|
|
import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
|
|
|
|
|
|
|
|
|
|
export const AGENT_NAME = "s3si.ts";
|
2022-11-29 09:15:07 -05:00
|
|
|
export const S3SI_VERSION = "0.1.35";
|
2022-10-20 09:45:59 -04:00
|
|
|
export const NSOAPP_VERSION = "2.3.1";
|
2022-11-29 09:15:07 -05:00
|
|
|
export const WEB_VIEW_VERSION = "2.0.0-8a061f6c";
|
2022-10-25 08:37:03 -04:00
|
|
|
export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts";
|
2022-10-20 23:48:45 -04:00
|
|
|
|
2022-10-24 10:28:23 -04:00
|
|
|
export const USERAGENT = `${AGENT_NAME}/${S3SI_VERSION} (${S3SI_LINK})`;
|
2022-10-20 09:45:59 -04:00
|
|
|
export const DEFAULT_APP_USER_AGENT =
|
|
|
|
|
"Mozilla/5.0 (Linux; Android 11; Pixel 5) " +
|
|
|
|
|
"AppleWebKit/537.36 (KHTML, like Gecko) " +
|
|
|
|
|
"Chrome/94.0.4606.61 Mobile Safari/537.36";
|
|
|
|
|
export const SPLATNET3_URL = "https://api.lp1.av5ja.srv.nintendo.net";
|
|
|
|
|
export const SPLATNET3_ENDPOINT =
|
|
|
|
|
"https://api.lp1.av5ja.srv.nintendo.net/api/graphql";
|
2022-11-25 06:07:39 -05:00
|
|
|
export const BATTLE_NAMESPACE = "b3a2dbf5-2c09-4792-b78c-00b548b70aeb";
|
|
|
|
|
export const COOP_NAMESPACE = "f1911910-605e-11ed-a622-7085c2057a9d";
|
2022-10-20 09:45:59 -04:00
|
|
|
export const S3SI_NAMESPACE = "63941e1c-e32e-4b56-9a1d-f6fbe19ef6e1";
|
2022-10-20 20:06:25 -04:00
|
|
|
|
|
|
|
|
export const SPLATNET3_STATINK_MAP: {
|
|
|
|
|
RULE: Record<VsHistoryDetail["vsRule"]["rule"], StatInkPostBody["rule"]>;
|
|
|
|
|
RESULT: Record<VsHistoryDetail["judgement"], StatInkPostBody["result"]>;
|
|
|
|
|
DRAGON: Record<
|
|
|
|
|
NonNullable<VsHistoryDetail["festMatch"]>["dragonMatchType"],
|
|
|
|
|
StatInkPostBody["fest_dragon"]
|
|
|
|
|
>;
|
2022-11-25 06:07:39 -05:00
|
|
|
COOP_EVENT_MAP: Record<number, string | undefined>;
|
|
|
|
|
COOP_UNIFORM_MAP: Record<
|
|
|
|
|
number,
|
|
|
|
|
| "orange"
|
|
|
|
|
| "green"
|
|
|
|
|
| "yellow"
|
|
|
|
|
| "pink"
|
|
|
|
|
| "blue"
|
|
|
|
|
| "black"
|
|
|
|
|
| "white"
|
|
|
|
|
| undefined
|
|
|
|
|
>;
|
|
|
|
|
WATER_LEVEL_MAP: Record<0 | 1 | 2, "low" | "normal" | "high">;
|
2022-10-20 20:06:25 -04:00
|
|
|
} = {
|
|
|
|
|
RULE: {
|
|
|
|
|
TURF_WAR: "nawabari",
|
|
|
|
|
AREA: "area",
|
|
|
|
|
LOFT: "yagura",
|
|
|
|
|
GOAL: "hoko",
|
|
|
|
|
CLAM: "asari",
|
|
|
|
|
// TODO: support tri-color
|
|
|
|
|
TRI_COLOR: "nawabari",
|
|
|
|
|
},
|
|
|
|
|
RESULT: {
|
|
|
|
|
WIN: "win",
|
|
|
|
|
LOSE: "lose",
|
|
|
|
|
DEEMED_LOSE: "lose",
|
|
|
|
|
EXEMPTED_LOSE: "exempted_lose",
|
2022-10-26 05:05:16 -04:00
|
|
|
DRAW: "draw",
|
2022-10-20 20:06:25 -04:00
|
|
|
},
|
|
|
|
|
DRAGON: {
|
|
|
|
|
NORMAL: undefined,
|
|
|
|
|
DECUPLE: "10x",
|
|
|
|
|
DRAGON: "100x",
|
|
|
|
|
DOUBLE_DRAGON: "333x",
|
|
|
|
|
},
|
2022-11-25 06:07:39 -05:00
|
|
|
COOP_EVENT_MAP: {
|
|
|
|
|
1: "rush",
|
|
|
|
|
2: "goldie_seeking",
|
|
|
|
|
3: "griller",
|
|
|
|
|
4: "mothership",
|
|
|
|
|
5: "fog",
|
|
|
|
|
6: "cohock_charge",
|
|
|
|
|
7: "giant_tornado",
|
|
|
|
|
8: "mudmouth_eruption",
|
|
|
|
|
},
|
|
|
|
|
COOP_UNIFORM_MAP: {
|
|
|
|
|
1: "orange",
|
|
|
|
|
2: "green",
|
|
|
|
|
3: "yellow",
|
|
|
|
|
4: "pink",
|
|
|
|
|
5: "blue",
|
|
|
|
|
6: "black",
|
|
|
|
|
7: "white",
|
|
|
|
|
},
|
|
|
|
|
WATER_LEVEL_MAP: {
|
|
|
|
|
0: "low",
|
|
|
|
|
1: "normal",
|
|
|
|
|
2: "high",
|
|
|
|
|
},
|
2022-10-20 20:06:25 -04:00
|
|
|
};
|