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",
|
"build:linux64": "pkg . --targets node18-linux-x64 --experimental-modules --output dist/codtrackerjs-aio-linux-amd64",
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
"prettify": "prettier --write .",
|
"prettify": "prettier --write .",
|
||||||
|
"map": "tsc",
|
||||||
"lint": "eslint --no-config-lookup .",
|
"lint": "eslint --no-config-lookup .",
|
||||||
"lint:fix": "eslint --no-config-lookup . --fix",
|
"lint:fix": "eslint --no-config-lookup . --fix",
|
||||||
"dev": "nodemon app.js"
|
"dev": "nodemon app.js"
|
||||||
|
145
src/js/index.d.ts
vendored
145
src/js/index.d.ts
vendored
@ -1,81 +1,54 @@
|
|||||||
declare enum platforms {
|
declare enum platforms {
|
||||||
All = 'all',
|
All = "all",
|
||||||
Activision = 'acti',
|
Activision = "acti",
|
||||||
Battlenet = 'battle',
|
Battlenet = "battle",
|
||||||
PSN = 'psn',
|
PSN = "psn",
|
||||||
Steam = 'steam',
|
Steam = "steam",
|
||||||
Uno = 'uno',
|
Uno = "uno",
|
||||||
XBOX = 'xbl',
|
XBOX = "xbl",
|
||||||
ios = 'ios',
|
ios = "ios",
|
||||||
NULL = '_',
|
NULL = "_"
|
||||||
}
|
}
|
||||||
declare enum games {
|
declare enum games {
|
||||||
ModernWarfare = 'mw',
|
ModernWarfare = "mw",
|
||||||
ModernWarfare2 = 'mw2',
|
ModernWarfare2 = "mw2",
|
||||||
Vanguard = 'vg',
|
Vanguard = "vg",
|
||||||
ColdWar = 'cw',
|
ColdWar = "cw",
|
||||||
NULL = '_',
|
NULL = "_"
|
||||||
}
|
}
|
||||||
declare enum friendActions {
|
declare enum friendActions {
|
||||||
Invite = 'invite',
|
Invite = "invite",
|
||||||
Uninvite = 'uninvite',
|
Uninvite = "uninvite",
|
||||||
Remove = 'remove',
|
Remove = "remove",
|
||||||
Block = 'block',
|
Block = "block",
|
||||||
Unblock = 'unblock',
|
Unblock = "unblock"
|
||||||
}
|
}
|
||||||
declare const enableDebugMode: () => boolean;
|
declare const enableDebugMode: () => boolean;
|
||||||
declare const disableDebugMode: () => boolean;
|
declare const disableDebugMode: () => boolean;
|
||||||
declare const login: (ssoToken: string) => boolean;
|
declare const login: (ssoToken: string) => boolean;
|
||||||
declare const telescopeLogin: (
|
declare const telescopeLogin: (username: string, password: string) => Promise<boolean>;
|
||||||
username: string,
|
|
||||||
password: string
|
|
||||||
) => Promise<boolean>;
|
|
||||||
declare class WZ {
|
declare class WZ {
|
||||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistoryWithDate: (
|
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
breakdownWithDate: (
|
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||||
cleanGameMode: (mode: string) => Promise<string>;
|
cleanGameMode: (mode: string) => Promise<string>;
|
||||||
}
|
}
|
||||||
declare class MW {
|
declare class MW {
|
||||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistoryWithDate: (
|
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
breakdownWithDate: (
|
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
matchInfo: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||||
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
matchHeatMap: (matchId: string, platform: platforms) => Promise<unknown>;
|
||||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
mapList: (platform: platforms) => Promise<unknown>;
|
mapList: (platform: platforms) => Promise<unknown>;
|
||||||
communityMapDataForMapMode: (
|
communityMapDataForMapMode: (mapId: string, gamemode: string, platform: platforms) => Promise<unknown>;
|
||||||
mapId: string,
|
|
||||||
gamemode: string,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
}
|
}
|
||||||
declare class MW2 {
|
declare class MW2 {
|
||||||
fullData: (unoId: string) => Promise<unknown>;
|
fullData: (unoId: string) => Promise<unknown>;
|
||||||
@ -100,19 +73,9 @@ declare class WZM {
|
|||||||
declare class CW {
|
declare class CW {
|
||||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistoryWithDate: (
|
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
breakdownWithDate: (
|
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
@ -123,19 +86,9 @@ declare class CW {
|
|||||||
declare class VG {
|
declare class VG {
|
||||||
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
fullData: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
combatHistory: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
combatHistoryWithDate: (
|
combatHistoryWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
breakdown: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
breakdownWithDate: (
|
breakdownWithDate: (gamertag: string, startTime: number, endTime: number, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
startTime: number,
|
|
||||||
endTime: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
seasonloot: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
bpProg: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
bundleInfo: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
@ -146,28 +99,17 @@ declare class VG {
|
|||||||
declare class SHOP {
|
declare class SHOP {
|
||||||
purchasableItems: (gameId: string) => Promise<unknown>;
|
purchasableItems: (gameId: string) => Promise<unknown>;
|
||||||
bundleInformation: (title: string, bundleId: string) => Promise<unknown>;
|
bundleInformation: (title: string, bundleId: string) => Promise<unknown>;
|
||||||
battlePassLoot: (
|
battlePassLoot: (title: games, season: number, platform: platforms) => Promise<unknown>;
|
||||||
title: games,
|
|
||||||
season: number,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
}
|
}
|
||||||
declare class USER {
|
declare class USER {
|
||||||
friendFeed: (gamertag: string, platform: platforms) => Promise<unknown>;
|
friendFeed: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
eventFeed: () => Promise<unknown>;
|
eventFeed: () => Promise<unknown>;
|
||||||
loggedInIdentities: () => Promise<unknown>;
|
loggedInIdentities: () => Promise<unknown>;
|
||||||
|
userInfo: () => Promise<any>;
|
||||||
codPoints: (gamertag: string, platform: platforms) => Promise<unknown>;
|
codPoints: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
connectedAccounts: (
|
connectedAccounts: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
platform: platforms
|
|
||||||
) => Promise<unknown>;
|
|
||||||
settings: (gamertag: string, platform: platforms) => Promise<unknown>;
|
settings: (gamertag: string, platform: platforms) => Promise<unknown>;
|
||||||
friendAction: (
|
friendAction: (gamertag: string, platform: platforms, action: friendActions) => Promise<unknown>;
|
||||||
gamertag: string,
|
|
||||||
platform: platforms,
|
|
||||||
action: friendActions
|
|
||||||
) => Promise<unknown>;
|
|
||||||
userInfo: () => Promise<unknown>;
|
|
||||||
}
|
}
|
||||||
declare class DB {
|
declare class DB {
|
||||||
accolades: () => Promise<unknown>;
|
accolades: () => Promise<unknown>;
|
||||||
@ -189,23 +131,4 @@ declare const Store: SHOP;
|
|||||||
declare const Me: USER;
|
declare const Me: USER;
|
||||||
declare const CDN: DB;
|
declare const CDN: DB;
|
||||||
declare const Misc: ALT;
|
declare const Misc: ALT;
|
||||||
export {
|
export { CDN, ColdWar, disableDebugMode, enableDebugMode, friendActions, login, Me, Misc, ModernWarfare, ModernWarfare2, ModernWarfare3, platforms, Store, telescopeLogin, Vanguard, Warzone, Warzone2, WarzoneMobile, };
|
||||||
login,
|
|
||||||
telescopeLogin,
|
|
||||||
platforms,
|
|
||||||
friendActions,
|
|
||||||
Warzone,
|
|
||||||
ModernWarfare,
|
|
||||||
ModernWarfare2,
|
|
||||||
ModernWarfare3,
|
|
||||||
WarzoneMobile,
|
|
||||||
Warzone2,
|
|
||||||
ColdWar,
|
|
||||||
Vanguard,
|
|
||||||
Store,
|
|
||||||
Me,
|
|
||||||
CDN,
|
|
||||||
Misc,
|
|
||||||
enableDebugMode,
|
|
||||||
disableDebugMode,
|
|
||||||
};
|
|
||||||
|
1323
src/js/index.js
1323
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 { request } from 'undici';
|
||||||
import wzMappings from '../data/game-modes.json';
|
import wzMappings from '../data/game-modes.json';
|
||||||
import weaponMappings from '../data/weapon-ids.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 baseSsoToken: string = '';
|
||||||
let debugMode = false;
|
let debugMode = false;
|
||||||
|
|
||||||
interface CustomHeaders extends IncomingHttpHeaders {
|
interface CustomHeaders extends Record<string, string | string[] | undefined> {
|
||||||
'X-XSRF-TOKEN'?: string | undefined;
|
'X-XSRF-TOKEN'?: string;
|
||||||
'X-CSRF-TOKEN'?: string | undefined;
|
'X-CSRF-TOKEN'?: string;
|
||||||
'Atvi-Auth'?: string | undefined;
|
'Atvi-Auth'?: string;
|
||||||
ACT_SSO_COOKIE?: string | undefined;
|
ACT_SSO_COOKIE?: string;
|
||||||
atkn?: string | undefined;
|
atkn?: string;
|
||||||
cookie?: string | undefined;
|
cookie?: string;
|
||||||
'content-type'?: string | undefined;
|
'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 = {
|
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}`;
|
`/crm/cod/v2/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/matches/${this.mode}/start/${startTime}/end/${endTime}`;
|
||||||
matchInfo = (matchId: string) =>
|
matchInfo = (matchId: string) =>
|
||||||
`/crm/cod/v2/title/${this.game}/platform/${this.platform}/fullMatch/wz/${matchId}/en`;
|
`/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`;
|
`/ce/v1/title/${this.game}/platform/${this.platform}/match/${matchId}/matchMapEvents`;
|
||||||
seasonLoot = () =>
|
seasonLoot = () =>
|
||||||
`/loot/title/${this.game}/platform/${this.platform}/${this.lookupType}/${this.gamertag}/status/en`;
|
`/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