fix(index.ts): fix syntax errors for source mapping
This commit is contained in:
parent
4abf5eea02
commit
e9521af29a
@ -16,6 +16,7 @@
|
||||
"build:linux64": "pkg . --targets node18-linux-x64 --experimental-modules --output dist/codtrackerjs-aio-linux-amd64",
|
||||
"start": "node app.js",
|
||||
"prettify": "prettier --write .",
|
||||
"map": "tsc",
|
||||
"lint": "eslint --no-config-lookup .",
|
||||
"lint:fix": "eslint --no-config-lookup . --fix",
|
||||
"dev": "nodemon app.js"
|
||||
|
255
src/js/index.d.ts
vendored
255
src/js/index.d.ts
vendored
@ -1,181 +1,123 @@
|
||||
declare enum platforms {
|
||||
All = 'all',
|
||||
Activision = 'acti',
|
||||
Battlenet = 'battle',
|
||||
PSN = 'psn',
|
||||
Steam = 'steam',
|
||||
Uno = 'uno',
|
||||
XBOX = 'xbl',
|
||||
ios = 'ios',
|
||||
NULL = '_',
|
||||
All = "all",
|
||||
Activision = "acti",
|
||||
Battlenet = "battle",
|
||||
PSN = "psn",
|
||||
Steam = "steam",
|
||||
Uno = "uno",
|
||||
XBOX = "xbl",
|
||||
ios = "ios",
|
||||
NULL = "_"
|
||||
}
|
||||
declare enum games {
|
||||
ModernWarfare = 'mw',
|
||||
ModernWarfare2 = 'mw2',
|
||||
Vanguard = 'vg',
|
||||
ColdWar = 'cw',
|
||||
NULL = '_',
|
||||
ModernWarfare = "mw",
|
||||
ModernWarfare2 = "mw2",
|
||||
Vanguard = "vg",
|
||||
ColdWar = "cw",
|
||||
NULL = "_"
|
||||
}
|
||||
declare enum friendActions {
|
||||
Invite = 'invite',
|
||||
Uninvite = 'uninvite',
|
||||
Remove = 'remove',
|
||||
Block = 'block',
|
||||
Unblock = 'unblock',
|
||||
Invite = "invite",
|
||||
Uninvite = "uninvite",
|
||||
Remove = "remove",
|
||||
Block = "block",
|
||||
Unblock = "unblock"
|
||||
}
|
||||
declare const enableDebugMode: () => boolean;
|
||||
declare const disableDebugMode: () => boolean;
|
||||
declare const login: (ssoToken: string) => boolean;
|
||||
declare const telescopeLogin: (
|
||||
username: string,
|
||||
password: string
|
||||
) => Promise<boolean>;
|
||||
declare const telescopeLogin: (username: string, password: string) => Promise<boolean>;
|
||||
declare class WZ {
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
cleanGameMode: (mode: string) => Promise<string>;
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
cleanGameMode: (mode: string) => Promise<string>;
|
||||
}
|
||||
declare class MW {
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
mapList: (platform: platforms) => Promise<unknown>;
|
||||
communityMapDataForMapMode: (
|
||||
mapId: string,
|
||||
gamemode: string,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
mapList: (platform: platforms) => Promise<unknown>;
|
||||
communityMapDataForMapMode: (mapId: string, gamemode: string, platform: platforms) => Promise<unknown>;
|
||||
}
|
||||
declare class MW2 {
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
}
|
||||
declare class WZ2 {
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
}
|
||||
declare class MW3 {
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
}
|
||||
declare class WZM {
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
fullData: (unoId: string) => Promise<unknown>;
|
||||
matches: (unoId: string) => Promise<unknown>;
|
||||
matchInfo: (unoId: string, matchId: string) => Promise<unknown>;
|
||||
}
|
||||
declare class CW {
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
mapList: (platform: platforms) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
mapList: (platform: platforms) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
}
|
||||
declare class VG {
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (
|
||||
gamertag: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
mapList: (platform: platforms) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
mapList: (platform: platforms) => Promise<unknown>;
|
||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||
}
|
||||
declare class SHOP {
|
||||
purchasableItems: (gameId: string) => Promise<unknown>;
|
||||
bundleInformation: (title: string, bundleId: string) => Promise<unknown>;
|
||||
battlePassLoot: (
|
||||
title: games,
|
||||
season: number,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
purchasableItems: (gameId: string) => Promise<unknown>;
|
||||
bundleInformation: (title: string, bundleId: string) => Promise<unknown>;
|
||||
battlePassLoot: (title: games, season: number, platform: platforms) => Promise<unknown>;
|
||||
}
|
||||
declare class USER {
|
||||
friendFeed: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
eventFeed: () => Promise<unknown>;
|
||||
loggedInIdentities: () => Promise<unknown>;
|
||||
codPoints: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
connectedAccounts: (
|
||||
gamertag: string,
|
||||
platform: platforms
|
||||
) => Promise<unknown>;
|
||||
settings: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
friendAction: (
|
||||
gamertag: string,
|
||||
platform: platforms,
|
||||
action: friendActions
|
||||
) => Promise<unknown>;
|
||||
userInfo: () => Promise<unknown>;
|
||||
friendFeed: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
eventFeed: () => Promise<unknown>;
|
||||
loggedInIdentities: () => Promise<unknown>;
|
||||
userInfo: () => Promise<any>;
|
||||
codPoints: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
connectedAccounts: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
settings: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
friendAction: (gamertag: string, platform: platforms, action: friendActions) => Promise<unknown>;
|
||||
}
|
||||
declare class DB {
|
||||
accolades: () => Promise<unknown>;
|
||||
allCDNData: () => Promise<unknown>;
|
||||
accolades: () => Promise<unknown>;
|
||||
allCDNData: () => Promise<unknown>;
|
||||
}
|
||||
declare class ALT {
|
||||
search: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
cleanWeapon: (weapon: string) => Promise<string>;
|
||||
search: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||
cleanWeapon: (weapon: string) => Promise<string>;
|
||||
}
|
||||
declare const Warzone: WZ;
|
||||
declare const ModernWarfare: MW;
|
||||
@ -189,23 +131,4 @@ declare const Store: SHOP;
|
||||
declare const Me: USER;
|
||||
declare const CDN: DB;
|
||||
declare const Misc: ALT;
|
||||
export {
|
||||
login,
|
||||
telescopeLogin,
|
||||
platforms,
|
||||
friendActions,
|
||||
Warzone,
|
||||
ModernWarfare,
|
||||
ModernWarfare2,
|
||||
ModernWarfare3,
|
||||
WarzoneMobile,
|
||||
Warzone2,
|
||||
ColdWar,
|
||||
Vanguard,
|
||||
Store,
|
||||
Me,
|
||||
CDN,
|
||||
Misc,
|
||||
enableDebugMode,
|
||||
disableDebugMode,
|
||||
};
|
||||
export { CDN, ColdWar, disableDebugMode, enableDebugMode, friendActions, login, Me, Misc, ModernWarfare, ModernWarfare2, ModernWarfare3, platforms, Store, telescopeLogin, Vanguard, Warzone, Warzone2, WarzoneMobile, };
|
||||
|
2359
src/js/index.js
2359
src/js/index.js
File diff suppressed because it is too large
Load Diff
1
src/js/index.js.map
Normal file
1
src/js/index.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,4 +1,7 @@
|
||||
import { IncomingHttpHeaders } from 'http';
|
||||
interface IncomingHttpHeaders {
|
||||
[header: string]: string | string[] | undefined;
|
||||
}
|
||||
|
||||
import { request } from 'undici';
|
||||
import wzMappings from '../data/game-modes.json';
|
||||
import weaponMappings from '../data/weapon-ids.json';
|
||||
@ -9,14 +12,26 @@ let baseCookie: string = 'new_SiteId=cod;ACT_SSO_LOCALE=en_US;country=US;';
|
||||
let baseSsoToken: string = '';
|
||||
let debugMode = false;
|
||||
|
||||
interface CustomHeaders extends IncomingHttpHeaders {
|
||||
'X-XSRF-TOKEN'?: string | undefined;
|
||||
'X-CSRF-TOKEN'?: string | undefined;
|
||||
'Atvi-Auth'?: string | undefined;
|
||||
ACT_SSO_COOKIE?: string | undefined;
|
||||
atkn?: string | undefined;
|
||||
cookie?: string | undefined;
|
||||
'content-type'?: string | undefined;
|
||||
interface CustomHeaders extends Record<string, string | string[] | undefined> {
|
||||
'X-XSRF-TOKEN'?: string;
|
||||
'X-CSRF-TOKEN'?: string;
|
||||
'Atvi-Auth'?: string;
|
||||
ACT_SSO_COOKIE?: string;
|
||||
atkn?: string;
|
||||
cookie?: string;
|
||||
'content-type'?: string;
|
||||
'user-agent'?: string;
|
||||
accept?: string;
|
||||
authorization?: string;
|
||||
'accept-language'?: string;
|
||||
'cache-control'?: string;
|
||||
pragma?: string;
|
||||
'sec-ch-ua'?: string;
|
||||
'sec-ch-ua-mobile'?: string;
|
||||
'sec-ch-ua-platform'?: string;
|
||||
'sec-fetch-dest'?: string;
|
||||
'sec-fetch-mode'?: string;
|
||||
'sec-fetch-site'?: string;
|
||||
}
|
||||
|
||||
let baseHeaders: CustomHeaders = {
|
||||
@ -446,7 +461,7 @@ class Endpoints {
|
||||
`/crm/cod/v2/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/matches/${this.mode}/start/${startTime}/end/${endTime}`;
|
||||
matchInfo = (matchId: string) =>
|
||||
`/crm/cod/v2/title/${this.game}/platform/${this.platform}/fullMatch/wz/${matchId}/en`;
|
||||
matchHeatMap = (matchId) =>
|
||||
matchHeatMap = (matchId: string) =>
|
||||
`/ce/v1/title/${this.game}/platform/${this.platform}/match/${matchId}/matchMapEvents`;
|
||||
seasonLoot = () =>
|
||||
`/loot/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/status/en`;
|
||||
|
22
tsconfig.json
Normal file
22
tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"importHelpers": true,
|
||||
"resolveJsonModule": true,
|
||||
"module": "CommonJS",
|
||||
"target": "es2015",
|
||||
"esModuleInterop": true,
|
||||
"lib": ["esnext", "dom"],
|
||||
"outDir": "./src/js/dist",
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"skipLibCheck": true,
|
||||
"typeRoots": [
|
||||
"./@types",
|
||||
"./node_modules/@types"
|
||||
]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user