feat: implement start.gg OAuth integration and services

- Added start.gg OAuth server and session management in startgg.ts
- Implemented functions to fetch recent tournaments and tournament players from start.gg
- Created utility functions for string and country code handling
- Introduced Challonge OAuth server and services for tournament data fetching
- Refactored shared types and utility functions for better organization
- Updated scoreboard graphics to use new country resolution utilities
- Removed legacy startgg.ts file to streamline codebase
This commit is contained in:
2026-06-04 17:42:44 +02:00
parent 71c18b479b
commit 3a6289a2ea
24 changed files with 956 additions and 960 deletions
+1
View File
@@ -0,0 +1 @@
export {};
+28
View File
@@ -0,0 +1,28 @@
export const getStringProp = (payload, key) => {
if (typeof payload !== 'object' || payload === null || !(key in payload))
return '';
const value = payload[key];
return typeof value === 'string' ? value.trim() : String(value ?? '').trim();
};
export const getNumberProp = (payload, keys) => {
for (const key of keys) {
const raw = payload[key];
if (typeof raw === 'number' && Number.isFinite(raw))
return raw;
if (typeof raw === 'string') {
const parsed = Number(raw);
if (Number.isFinite(parsed))
return parsed;
}
}
return null;
};
export const normalizeTournamentSlug = (value) => {
const trimmed = value.trim();
if (!trimmed)
return '';
return trimmed
.replace(/^https?:\/\/[^/]+\//i, '')
.replace(/^tournaments\//i, '')
.replace(/^\/+/, '');
};