feat: add events app + "multi-tenants" aka multi-events
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { gamesApiListGames } from "./api";
|
||||
import type { GamesApiListGamesResponse } from "./api/types.gen";
|
||||
import { gamesApiListEventGames } from "./api";
|
||||
import type { GamesApiListEventGamesResponse } from "./api/types.gen";
|
||||
|
||||
interface Props {
|
||||
eventPath: string;
|
||||
marketEnabled?: string | boolean;
|
||||
}
|
||||
|
||||
@@ -11,11 +12,11 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
marketEnabled: true,
|
||||
});
|
||||
|
||||
const games = ref<GamesApiListGamesResponse | undefined>();
|
||||
const games = ref<GamesApiListEventGamesResponse | undefined>();
|
||||
const loading = ref(true);
|
||||
const imageErrors = ref<Set<number>>(new Set());
|
||||
|
||||
const getHeaderImage = (game: GamesApiListGamesResponse[number]) => {
|
||||
const getHeaderImage = (game: GamesApiListEventGamesResponse[number]) => {
|
||||
if (game.image) {
|
||||
return game.image;
|
||||
}
|
||||
@@ -30,7 +31,7 @@ const onImageError = (gameId: number) => {
|
||||
};
|
||||
|
||||
const navigate = (path: string) => {
|
||||
window.location.href = path;
|
||||
window.location.href = `/${props.eventPath}${path}`;
|
||||
};
|
||||
|
||||
const isMarketEnabled = () => {
|
||||
@@ -41,8 +42,10 @@ const isMarketEnabled = () => {
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
// Fetch games list
|
||||
const response = await gamesApiListGames();
|
||||
// Fetch games enabled for this event
|
||||
const response = await gamesApiListEventGames({
|
||||
path: { event_path: props.eventPath },
|
||||
});
|
||||
if (response.data) {
|
||||
games.value = response.data;
|
||||
}
|
||||
|
||||
@@ -4,20 +4,28 @@ import { storeToRefs } from "pinia";
|
||||
import { useMarketStore } from "./stores/market";
|
||||
import MarketCard from "./components/MarketCard.vue";
|
||||
import UserBets from "./components/UserBets.vue";
|
||||
import { provideEventPath } from "./composables/useEventPath";
|
||||
|
||||
interface Props {
|
||||
eventPath: string;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
provideEventPath(props.eventPath);
|
||||
|
||||
const marketStore = useMarketStore();
|
||||
const { markets, userInfo, isLoading } = storeToRefs(marketStore);
|
||||
|
||||
const goHome = () => {
|
||||
window.location.href = "/";
|
||||
window.location.href = `/${props.eventPath}/`;
|
||||
};
|
||||
|
||||
const reloadPage = async () => {
|
||||
await marketStore.refreshPage();
|
||||
await marketStore.refreshPage(props.eventPath);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
marketStore.initializeMarketPage();
|
||||
marketStore.initializeMarketPage(props.eventPath);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,19 +8,24 @@ import Winners from "@/components/Winners.vue";
|
||||
import PuzzleResults from "@/components/PuzzleResults.vue";
|
||||
import TopUsersLeaderboard from "@/components/TopUsersLeaderboard.vue";
|
||||
import { polylanSubmitterApiGetUserInfo, opusMagnumApiGetCollection } from "@/api";
|
||||
import { errorHelpers } from "@/services/apiService";
|
||||
import { apiService, errorHelpers } from "@/services/apiService";
|
||||
import { usePuzzlesStore } from "@/stores/puzzles";
|
||||
import { useSubmissionsStore } from "@/stores/submissions";
|
||||
import { provideEventPath } from "@/composables/useEventPath";
|
||||
import type { PuzzleResponse, UserInfo, SteamCollection } from "@/types";
|
||||
import { useCountdown } from "@vueuse/core";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
const props = defineProps<{
|
||||
eventPath: string;
|
||||
collectionTitle: string;
|
||||
collectionUrl: string;
|
||||
collectionDescription: string;
|
||||
}>();
|
||||
|
||||
provideEventPath(props.eventPath);
|
||||
apiService.setEventPath(props.eventPath);
|
||||
|
||||
const puzzlesStore = usePuzzlesStore();
|
||||
const submissionsStore = useSubmissionsStore();
|
||||
|
||||
@@ -77,7 +82,9 @@ async function initialize() {
|
||||
|
||||
// Load collection data
|
||||
console.log("Loading collection...");
|
||||
const collectionResponse = await opusMagnumApiGetCollection();
|
||||
const collectionResponse = await opusMagnumApiGetCollection({
|
||||
path: { event_path: props.eventPath },
|
||||
});
|
||||
if (collectionResponse.data) {
|
||||
collection.value = collectionResponse.data as SteamCollection;
|
||||
console.log("Collection loaded:", collectionResponse.data);
|
||||
@@ -87,7 +94,7 @@ async function initialize() {
|
||||
|
||||
// Load puzzles from API using store
|
||||
console.log("Loading puzzles...");
|
||||
await puzzlesStore.loadPuzzles();
|
||||
await puzzlesStore.loadPuzzles(props.eventPath);
|
||||
console.log("Puzzles loaded:", puzzlesStore.puzzles.length);
|
||||
|
||||
// Load existing submissions using store
|
||||
@@ -129,7 +136,7 @@ const reloadPage = () => {
|
||||
};
|
||||
|
||||
const goHome = () => {
|
||||
window.location.href = "/";
|
||||
window.location.href = `/${props.eventPath}/`;
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@ import { storeToRefs } from "pinia";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
import { submissionsApiCreateSubmission, submissionsApiListUserSubmissions, submissionsApiCreateImageCrop, submissionsApiDeleteImageCrop, submissionsApiProcessFileOcr, submissionsApiProcessCropOcr } from "@/api";
|
||||
import { useSubmissionsWebSocket } from "@/composables/useSubmissionsWebSocket";
|
||||
import { provideEventPath } from "@/composables/useEventPath";
|
||||
|
||||
interface Props {
|
||||
eventPath: string;
|
||||
gamePath?: string;
|
||||
gameName?: string;
|
||||
gameImage?: string;
|
||||
@@ -19,6 +21,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
gameSteamId: "",
|
||||
});
|
||||
|
||||
provideEventPath(props.eventPath);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const { userInfo } = storeToRefs(userStore);
|
||||
|
||||
@@ -238,7 +242,7 @@ const submitCrop = async () => {
|
||||
isCreatingCrop.value = true;
|
||||
try {
|
||||
const { data: newCrop } = await submissionsApiCreateImageCrop({
|
||||
path: { submission_file_id: selectedSubmissionFile.value.id },
|
||||
path: { event_path: props.eventPath, submission_file_id: selectedSubmissionFile.value.id },
|
||||
body: {
|
||||
x1: Math.round(currentCrop.value.x1),
|
||||
y1: Math.round(currentCrop.value.y1),
|
||||
@@ -270,7 +274,7 @@ const deleteCrop = async (cropId: string) => {
|
||||
|
||||
try {
|
||||
await submissionsApiDeleteImageCrop({
|
||||
path: { crop_id: cropId },
|
||||
path: { event_path: props.eventPath, crop_id: cropId },
|
||||
});
|
||||
selectedSubmissionFile.value.crops = selectedSubmissionFile.value.crops.filter(
|
||||
(c: any) => c.id !== cropId
|
||||
@@ -293,7 +297,7 @@ const processFileOcr = async () => {
|
||||
|
||||
try {
|
||||
await submissionsApiProcessFileOcr({
|
||||
path: { file_id: selectedSubmissionFile.value.id },
|
||||
path: { event_path: props.eventPath, file_id: selectedSubmissionFile.value.id },
|
||||
});
|
||||
selectedSubmissionFile.value.ocr_status = "processing";
|
||||
} catch (error) {
|
||||
@@ -305,7 +309,7 @@ const processFileOcr = async () => {
|
||||
const processCropOcr = async (cropId: string) => {
|
||||
try {
|
||||
await submissionsApiProcessCropOcr({
|
||||
path: { crop_id: cropId },
|
||||
path: { event_path: props.eventPath, crop_id: cropId },
|
||||
});
|
||||
// Update the crop status in the list
|
||||
if (selectedSubmissionFile.value?.crops) {
|
||||
@@ -398,6 +402,7 @@ const submitSubmission = async () => {
|
||||
isUploading.value = true;
|
||||
try {
|
||||
await submissionsApiCreateSubmission({
|
||||
path: { event_path: props.eventPath },
|
||||
query: { game_path: props.gamePath },
|
||||
body: {
|
||||
files: uploadedFiles.value,
|
||||
@@ -418,7 +423,7 @@ const submitSubmission = async () => {
|
||||
};
|
||||
|
||||
const goHome = () => {
|
||||
window.location.href = "/";
|
||||
window.location.href = `/${props.eventPath}/`;
|
||||
};
|
||||
|
||||
const formatFileSize = (bytes: number) => {
|
||||
@@ -454,6 +459,7 @@ const loadUserSubmissions = async () => {
|
||||
isLoadingSubmissions.value = true;
|
||||
try {
|
||||
const { data } = await submissionsApiListUserSubmissions({
|
||||
path: { event_path: props.eventPath },
|
||||
query: { game_path: props.gamePath },
|
||||
});
|
||||
if (data && Array.isArray(data)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { animationsApiPuzzleResults, animationsApiResults, animationsApiTopSubmissions, gamesApiListGames, marketApiCloseMarket, marketApiCreateBet, marketApiListMarkets, marketApiListUserBets, marketApiResolveMarket, noitaApiGetLeaderboard, noitaApiGetResults, noitaApiSubmitLogFile, type Options, opusMagnumApiCreateSubmission, opusMagnumApiDeleteSubmission, opusMagnumApiGetCollection, opusMagnumApiGetStats, opusMagnumApiGetSubmission, opusMagnumApiListPuzzles, opusMagnumApiListResponsesNeedingValidation, opusMagnumApiListSubmissions, opusMagnumApiValidateAuto, opusMagnumApiValidateResponse, opusMagnumApiValidateSubmission, polylanSubmitterApiClearCache, polylanSubmitterApiGetUserInfo, polylanSubmitterApiHealthCheck, submissionsApiCreateImageCrop, submissionsApiCreateSubmission, submissionsApiDeleteImageCrop, submissionsApiGetSubmission, submissionsApiListSubmissionsByGame, submissionsApiListUserSubmissions, submissionsApiProcessCropOcr, submissionsApiProcessFileOcr } from './sdk.gen';
|
||||
export type { AnimationsApiPuzzleResultsData, AnimationsApiPuzzleResultsResponse, AnimationsApiPuzzleResultsResponses, AnimationsApiResultsData, AnimationsApiResultsResponse, AnimationsApiResultsResponses, AnimationsApiTopSubmissionsData, AnimationsApiTopSubmissionsResponse, AnimationsApiTopSubmissionsResponses, ClientOptions, GameOut, GamesApiListGamesData, GamesApiListGamesResponse, GamesApiListGamesResponses, ImageCropIn, ImageCropOut, Input, LeaderboardEntryOut, LeaderboardOut, MarketApiCloseMarketData, MarketApiCloseMarketResponses, MarketApiCreateBetData, MarketApiCreateBetResponse, MarketApiCreateBetResponses, MarketApiListMarketsData, MarketApiListMarketsResponse, MarketApiListMarketsResponses, MarketApiListUserBetsData, MarketApiListUserBetsResponse, MarketApiListUserBetsResponses, MarketApiResolveMarketData, MarketApiResolveMarketResponse, MarketApiResolveMarketResponses, MarketListSchema, MarketOptionSchema, NoitaApiGetLeaderboardData, NoitaApiGetLeaderboardResponse, NoitaApiGetLeaderboardResponses, NoitaApiGetResultsData, NoitaApiGetResultsResponse, NoitaApiGetResultsResponses, NoitaApiSubmitLogFileData, NoitaApiSubmitLogFileError, NoitaApiSubmitLogFileErrors, NoitaApiSubmitLogFileResponse, NoitaApiSubmitLogFileResponses, NoitaSubmissionOut, ObjectivResultOut, OpusMagnumApiCreateSubmissionData, OpusMagnumApiCreateSubmissionResponse, OpusMagnumApiCreateSubmissionResponses, OpusMagnumApiDeleteSubmissionData, OpusMagnumApiDeleteSubmissionResponses, OpusMagnumApiGetCollectionData, OpusMagnumApiGetCollectionResponse, OpusMagnumApiGetCollectionResponses, OpusMagnumApiGetStatsData, OpusMagnumApiGetStatsResponses, OpusMagnumApiGetSubmissionData, OpusMagnumApiGetSubmissionResponse, OpusMagnumApiGetSubmissionResponses, OpusMagnumApiListPuzzlesData, OpusMagnumApiListPuzzlesResponse, OpusMagnumApiListPuzzlesResponses, OpusMagnumApiListResponsesNeedingValidationData, OpusMagnumApiListResponsesNeedingValidationResponse, OpusMagnumApiListResponsesNeedingValidationResponses, OpusMagnumApiListSubmissionsData, OpusMagnumApiListSubmissionsResponse, OpusMagnumApiListSubmissionsResponses, OpusMagnumApiValidateAutoData, OpusMagnumApiValidateAutoResponse, OpusMagnumApiValidateAutoResponses, OpusMagnumApiValidateResponseData, OpusMagnumApiValidateResponseResponse, OpusMagnumApiValidateResponseResponses, OpusMagnumApiValidateSubmissionData, OpusMagnumApiValidateSubmissionResponse, OpusMagnumApiValidateSubmissionResponses, PagedSubmissionOut, PolylanSubmitterApiClearCacheData, PolylanSubmitterApiClearCacheResponses, PolylanSubmitterApiGetUserInfoData, PolylanSubmitterApiGetUserInfoResponse, PolylanSubmitterApiGetUserInfoResponses, PolylanSubmitterApiHealthCheckData, PolylanSubmitterApiHealthCheckResponses, PuzzlePointsFactorOut, PuzzleResponseIn, PuzzleResponseOut, PuzzleResponseRankingOut, PuzzleResultsOut, PuzzleSubmissionsOut, PuzzleSubmissionWithRankOut, RankingSchema, ResolveMarketSchema, ResultsOut, SteamCollectionItemOut, SteamCollectionOut, SubmissionFileOut, SubmissionIn, SubmissionOut, SubmissionsApiCreateImageCropData, SubmissionsApiCreateImageCropResponse, SubmissionsApiCreateImageCropResponses, SubmissionsApiCreateSubmissionData, SubmissionsApiCreateSubmissionResponse, SubmissionsApiCreateSubmissionResponses, SubmissionsApiDeleteImageCropData, SubmissionsApiDeleteImageCropResponse, SubmissionsApiDeleteImageCropResponses, SubmissionsApiGetSubmissionData, SubmissionsApiGetSubmissionResponse, SubmissionsApiGetSubmissionResponses, SubmissionsApiListSubmissionsByGameData, SubmissionsApiListSubmissionsByGameResponse, SubmissionsApiListSubmissionsByGameResponses, SubmissionsApiListUserSubmissionsData, SubmissionsApiListUserSubmissionsResponse, SubmissionsApiListUserSubmissionsResponses, SubmissionsApiProcessCropOcrData, SubmissionsApiProcessCropOcrResponse, SubmissionsApiProcessCropOcrResponses, SubmissionsApiProcessFileOcrData, SubmissionsApiProcessFileOcrResponse, SubmissionsApiProcessFileOcrResponses, TournamentPuzzleResultsOut, TournamentSubmissionsOut, UserBetCreateSchema, UserBetSchema, UserDisplayOut, UserInfoOut, ValidationIn, WinnerFileOut, WinnerResponseOut } from './types.gen';
|
||||
export { animationsApiPuzzleResults, animationsApiResults, animationsApiTopSubmissions, gamesApiListEventGames, gamesApiListGames, marketApiCloseMarket, marketApiCreateBet, marketApiListMarkets, marketApiListUserBets, marketApiResolveMarket, noitaApiGetLeaderboard, noitaApiGetResults, noitaApiSubmitLogFile, type Options, opusMagnumApiCreateSubmission, opusMagnumApiDeleteSubmission, opusMagnumApiGetCollection, opusMagnumApiGetStats, opusMagnumApiGetSubmission, opusMagnumApiListPuzzles, opusMagnumApiListResponsesNeedingValidation, opusMagnumApiListSubmissions, opusMagnumApiValidateAuto, opusMagnumApiValidateResponse, opusMagnumApiValidateSubmission, polylanSubmitterApiClearCache, polylanSubmitterApiGetUserInfo, polylanSubmitterApiHealthCheck, submissionsApiCreateImageCrop, submissionsApiCreateSubmission, submissionsApiDeleteImageCrop, submissionsApiGetSubmission, submissionsApiListSubmissionsByGame, submissionsApiListUserSubmissions, submissionsApiProcessCropOcr, submissionsApiProcessFileOcr } from './sdk.gen';
|
||||
export type { AnimationsApiPuzzleResultsData, AnimationsApiPuzzleResultsResponse, AnimationsApiPuzzleResultsResponses, AnimationsApiResultsData, AnimationsApiResultsResponse, AnimationsApiResultsResponses, AnimationsApiTopSubmissionsData, AnimationsApiTopSubmissionsResponse, AnimationsApiTopSubmissionsResponses, ClientOptions, GameOut, GamesApiListEventGamesData, GamesApiListEventGamesResponse, GamesApiListEventGamesResponses, GamesApiListGamesData, GamesApiListGamesResponse, GamesApiListGamesResponses, ImageCropIn, ImageCropOut, Input, LeaderboardEntryOut, LeaderboardOut, MarketApiCloseMarketData, MarketApiCloseMarketResponses, MarketApiCreateBetData, MarketApiCreateBetResponse, MarketApiCreateBetResponses, MarketApiListMarketsData, MarketApiListMarketsResponse, MarketApiListMarketsResponses, MarketApiListUserBetsData, MarketApiListUserBetsResponse, MarketApiListUserBetsResponses, MarketApiResolveMarketData, MarketApiResolveMarketResponse, MarketApiResolveMarketResponses, MarketListSchema, MarketOptionSchema, NoitaApiGetLeaderboardData, NoitaApiGetLeaderboardResponse, NoitaApiGetLeaderboardResponses, NoitaApiGetResultsData, NoitaApiGetResultsResponse, NoitaApiGetResultsResponses, NoitaApiSubmitLogFileData, NoitaApiSubmitLogFileError, NoitaApiSubmitLogFileErrors, NoitaApiSubmitLogFileResponse, NoitaApiSubmitLogFileResponses, NoitaSubmissionOut, ObjectivResultOut, OpusMagnumApiCreateSubmissionData, OpusMagnumApiCreateSubmissionResponse, OpusMagnumApiCreateSubmissionResponses, OpusMagnumApiDeleteSubmissionData, OpusMagnumApiDeleteSubmissionResponses, OpusMagnumApiGetCollectionData, OpusMagnumApiGetCollectionResponse, OpusMagnumApiGetCollectionResponses, OpusMagnumApiGetStatsData, OpusMagnumApiGetStatsResponses, OpusMagnumApiGetSubmissionData, OpusMagnumApiGetSubmissionResponse, OpusMagnumApiGetSubmissionResponses, OpusMagnumApiListPuzzlesData, OpusMagnumApiListPuzzlesResponse, OpusMagnumApiListPuzzlesResponses, OpusMagnumApiListResponsesNeedingValidationData, OpusMagnumApiListResponsesNeedingValidationResponse, OpusMagnumApiListResponsesNeedingValidationResponses, OpusMagnumApiListSubmissionsData, OpusMagnumApiListSubmissionsResponse, OpusMagnumApiListSubmissionsResponses, OpusMagnumApiValidateAutoData, OpusMagnumApiValidateAutoResponse, OpusMagnumApiValidateAutoResponses, OpusMagnumApiValidateResponseData, OpusMagnumApiValidateResponseResponse, OpusMagnumApiValidateResponseResponses, OpusMagnumApiValidateSubmissionData, OpusMagnumApiValidateSubmissionResponse, OpusMagnumApiValidateSubmissionResponses, PagedSubmissionOut, PolylanSubmitterApiClearCacheData, PolylanSubmitterApiClearCacheResponses, PolylanSubmitterApiGetUserInfoData, PolylanSubmitterApiGetUserInfoResponse, PolylanSubmitterApiGetUserInfoResponses, PolylanSubmitterApiHealthCheckData, PolylanSubmitterApiHealthCheckResponses, PuzzlePointsFactorOut, PuzzleResponseIn, PuzzleResponseOut, PuzzleResponseRankingOut, PuzzleResultsOut, PuzzleSubmissionsOut, PuzzleSubmissionWithRankOut, RankingSchema, ResolveMarketSchema, ResultsOut, SteamCollectionItemOut, SteamCollectionOut, SubmissionFileOut, SubmissionIn, SubmissionOut, SubmissionsApiCreateImageCropData, SubmissionsApiCreateImageCropResponse, SubmissionsApiCreateImageCropResponses, SubmissionsApiCreateSubmissionData, SubmissionsApiCreateSubmissionResponse, SubmissionsApiCreateSubmissionResponses, SubmissionsApiDeleteImageCropData, SubmissionsApiDeleteImageCropResponse, SubmissionsApiDeleteImageCropResponses, SubmissionsApiGetSubmissionData, SubmissionsApiGetSubmissionResponse, SubmissionsApiGetSubmissionResponses, SubmissionsApiListSubmissionsByGameData, SubmissionsApiListSubmissionsByGameResponse, SubmissionsApiListSubmissionsByGameResponses, SubmissionsApiListUserSubmissionsData, SubmissionsApiListUserSubmissionsResponse, SubmissionsApiListUserSubmissionsResponses, SubmissionsApiProcessCropOcrData, SubmissionsApiProcessCropOcrResponse, SubmissionsApiProcessCropOcrResponses, SubmissionsApiProcessFileOcrData, SubmissionsApiProcessFileOcrResponse, SubmissionsApiProcessFileOcrResponses, TournamentPuzzleResultsOut, TournamentSubmissionsOut, UserBetCreateSchema, UserBetSchema, UserDisplayOut, UserInfoOut, ValidationIn, WinnerFileOut, WinnerResponseOut } from './types.gen';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
|
||||
import { client } from './client.gen';
|
||||
import type { AnimationsApiPuzzleResultsData, AnimationsApiPuzzleResultsResponses, AnimationsApiResultsData, AnimationsApiResultsResponses, AnimationsApiTopSubmissionsData, AnimationsApiTopSubmissionsResponses, GamesApiListGamesData, GamesApiListGamesResponses, MarketApiCloseMarketData, MarketApiCloseMarketResponses, MarketApiCreateBetData, MarketApiCreateBetResponses, MarketApiListMarketsData, MarketApiListMarketsResponses, MarketApiListUserBetsData, MarketApiListUserBetsResponses, MarketApiResolveMarketData, MarketApiResolveMarketResponses, NoitaApiGetLeaderboardData, NoitaApiGetLeaderboardResponses, NoitaApiGetResultsData, NoitaApiGetResultsResponses, NoitaApiSubmitLogFileData, NoitaApiSubmitLogFileErrors, NoitaApiSubmitLogFileResponses, OpusMagnumApiCreateSubmissionData, OpusMagnumApiCreateSubmissionResponses, OpusMagnumApiDeleteSubmissionData, OpusMagnumApiDeleteSubmissionResponses, OpusMagnumApiGetCollectionData, OpusMagnumApiGetCollectionResponses, OpusMagnumApiGetStatsData, OpusMagnumApiGetStatsResponses, OpusMagnumApiGetSubmissionData, OpusMagnumApiGetSubmissionResponses, OpusMagnumApiListPuzzlesData, OpusMagnumApiListPuzzlesResponses, OpusMagnumApiListResponsesNeedingValidationData, OpusMagnumApiListResponsesNeedingValidationResponses, OpusMagnumApiListSubmissionsData, OpusMagnumApiListSubmissionsResponses, OpusMagnumApiValidateAutoData, OpusMagnumApiValidateAutoResponses, OpusMagnumApiValidateResponseData, OpusMagnumApiValidateResponseResponses, OpusMagnumApiValidateSubmissionData, OpusMagnumApiValidateSubmissionResponses, PolylanSubmitterApiClearCacheData, PolylanSubmitterApiClearCacheResponses, PolylanSubmitterApiGetUserInfoData, PolylanSubmitterApiGetUserInfoResponses, PolylanSubmitterApiHealthCheckData, PolylanSubmitterApiHealthCheckResponses, SubmissionsApiCreateImageCropData, SubmissionsApiCreateImageCropResponses, SubmissionsApiCreateSubmissionData, SubmissionsApiCreateSubmissionResponses, SubmissionsApiDeleteImageCropData, SubmissionsApiDeleteImageCropResponses, SubmissionsApiGetSubmissionData, SubmissionsApiGetSubmissionResponses, SubmissionsApiListSubmissionsByGameData, SubmissionsApiListSubmissionsByGameResponses, SubmissionsApiListUserSubmissionsData, SubmissionsApiListUserSubmissionsResponses, SubmissionsApiProcessCropOcrData, SubmissionsApiProcessCropOcrResponses, SubmissionsApiProcessFileOcrData, SubmissionsApiProcessFileOcrResponses } from './types.gen';
|
||||
import type { AnimationsApiPuzzleResultsData, AnimationsApiPuzzleResultsResponses, AnimationsApiResultsData, AnimationsApiResultsResponses, AnimationsApiTopSubmissionsData, AnimationsApiTopSubmissionsResponses, GamesApiListEventGamesData, GamesApiListEventGamesResponses, GamesApiListGamesData, GamesApiListGamesResponses, MarketApiCloseMarketData, MarketApiCloseMarketResponses, MarketApiCreateBetData, MarketApiCreateBetResponses, MarketApiListMarketsData, MarketApiListMarketsResponses, MarketApiListUserBetsData, MarketApiListUserBetsResponses, MarketApiResolveMarketData, MarketApiResolveMarketResponses, NoitaApiGetLeaderboardData, NoitaApiGetLeaderboardResponses, NoitaApiGetResultsData, NoitaApiGetResultsResponses, NoitaApiSubmitLogFileData, NoitaApiSubmitLogFileErrors, NoitaApiSubmitLogFileResponses, OpusMagnumApiCreateSubmissionData, OpusMagnumApiCreateSubmissionResponses, OpusMagnumApiDeleteSubmissionData, OpusMagnumApiDeleteSubmissionResponses, OpusMagnumApiGetCollectionData, OpusMagnumApiGetCollectionResponses, OpusMagnumApiGetStatsData, OpusMagnumApiGetStatsResponses, OpusMagnumApiGetSubmissionData, OpusMagnumApiGetSubmissionResponses, OpusMagnumApiListPuzzlesData, OpusMagnumApiListPuzzlesResponses, OpusMagnumApiListResponsesNeedingValidationData, OpusMagnumApiListResponsesNeedingValidationResponses, OpusMagnumApiListSubmissionsData, OpusMagnumApiListSubmissionsResponses, OpusMagnumApiValidateAutoData, OpusMagnumApiValidateAutoResponses, OpusMagnumApiValidateResponseData, OpusMagnumApiValidateResponseResponses, OpusMagnumApiValidateSubmissionData, OpusMagnumApiValidateSubmissionResponses, PolylanSubmitterApiClearCacheData, PolylanSubmitterApiClearCacheResponses, PolylanSubmitterApiGetUserInfoData, PolylanSubmitterApiGetUserInfoResponses, PolylanSubmitterApiHealthCheckData, PolylanSubmitterApiHealthCheckResponses, SubmissionsApiCreateImageCropData, SubmissionsApiCreateImageCropResponses, SubmissionsApiCreateSubmissionData, SubmissionsApiCreateSubmissionResponses, SubmissionsApiDeleteImageCropData, SubmissionsApiDeleteImageCropResponses, SubmissionsApiGetSubmissionData, SubmissionsApiGetSubmissionResponses, SubmissionsApiListSubmissionsByGameData, SubmissionsApiListSubmissionsByGameResponses, SubmissionsApiListUserSubmissionsData, SubmissionsApiListUserSubmissionsResponses, SubmissionsApiProcessCropOcrData, SubmissionsApiProcessCropOcrResponses, SubmissionsApiProcessFileOcrData, SubmissionsApiProcessFileOcrResponses } from './types.gen';
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ export const polylanSubmitterApiHealthCheck = <ThrowOnError extends boolean = fa
|
||||
/**
|
||||
* Clear Cache
|
||||
*
|
||||
* Clear all API caches (admin only)
|
||||
* Clear API caches (admin only). Pass event_path to clear just that event's keys.
|
||||
*/
|
||||
export const polylanSubmitterApiClearCache = <ThrowOnError extends boolean = false>(options?: Options<PolylanSubmitterApiClearCacheData, ThrowOnError>) => (options?.client ?? client).post<PolylanSubmitterApiClearCacheResponses, unknown, ThrowOnError>({ url: '/api/cache/clear', ...options });
|
||||
|
||||
@@ -39,26 +39,31 @@ export const polylanSubmitterApiClearCache = <ThrowOnError extends boolean = fal
|
||||
*/
|
||||
export const polylanSubmitterApiGetUserInfo = <ThrowOnError extends boolean = false>(options?: Options<PolylanSubmitterApiGetUserInfoData, ThrowOnError>) => (options?.client ?? client).get<PolylanSubmitterApiGetUserInfoResponses, unknown, ThrowOnError>({ url: '/api/user', ...options });
|
||||
|
||||
/**
|
||||
* List Games
|
||||
*/
|
||||
export const gamesApiListGames = <ThrowOnError extends boolean = false>(options?: Options<GamesApiListGamesData, ThrowOnError>) => (options?.client ?? client).get<GamesApiListGamesResponses, unknown, ThrowOnError>({ url: '/api/games/', ...options });
|
||||
|
||||
/**
|
||||
* List Puzzles
|
||||
*
|
||||
* Get list of available puzzles
|
||||
*/
|
||||
export const opusMagnumApiListPuzzles = <ThrowOnError extends boolean = false>(options?: Options<OpusMagnumApiListPuzzlesData, ThrowOnError>) => (options?.client ?? client).get<OpusMagnumApiListPuzzlesResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/puzzles', ...options });
|
||||
export const opusMagnumApiListPuzzles = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiListPuzzlesData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiListPuzzlesResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/puzzles', ...options });
|
||||
|
||||
/**
|
||||
* Get Collection
|
||||
*
|
||||
* Get the active collection details
|
||||
*/
|
||||
export const opusMagnumApiGetCollection = <ThrowOnError extends boolean = false>(options?: Options<OpusMagnumApiGetCollectionData, ThrowOnError>) => (options?.client ?? client).get<OpusMagnumApiGetCollectionResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/collection', ...options });
|
||||
export const opusMagnumApiGetCollection = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiGetCollectionData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiGetCollectionResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/collection', ...options });
|
||||
|
||||
/**
|
||||
* List Submissions
|
||||
*
|
||||
* Get paginated list of submissions
|
||||
*/
|
||||
export const opusMagnumApiListSubmissions = <ThrowOnError extends boolean = false>(options?: Options<OpusMagnumApiListSubmissionsData, ThrowOnError>) => (options?.client ?? client).get<OpusMagnumApiListSubmissionsResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/submissions', ...options });
|
||||
export const opusMagnumApiListSubmissions = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiListSubmissionsData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiListSubmissionsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/submissions', ...options });
|
||||
|
||||
/**
|
||||
* Create Submission
|
||||
@@ -67,7 +72,7 @@ export const opusMagnumApiListSubmissions = <ThrowOnError extends boolean = fals
|
||||
*/
|
||||
export const opusMagnumApiCreateSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiCreateSubmissionData, ThrowOnError>) => (options.client ?? client).post<OpusMagnumApiCreateSubmissionResponses, unknown, ThrowOnError>({
|
||||
...formDataBodySerializer,
|
||||
url: '/api/opus-magnum/submissions',
|
||||
url: '/api/events/{event_path}/opus-magnum/submissions',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': null,
|
||||
@@ -80,14 +85,14 @@ export const opusMagnumApiCreateSubmission = <ThrowOnError extends boolean = fal
|
||||
*
|
||||
* Delete a submission (admin only)
|
||||
*/
|
||||
export const opusMagnumApiDeleteSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiDeleteSubmissionData, ThrowOnError>) => (options.client ?? client).delete<OpusMagnumApiDeleteSubmissionResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/submissions/{submission_id}', ...options });
|
||||
export const opusMagnumApiDeleteSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiDeleteSubmissionData, ThrowOnError>) => (options.client ?? client).delete<OpusMagnumApiDeleteSubmissionResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/submissions/{submission_id}', ...options });
|
||||
|
||||
/**
|
||||
* Get Submission
|
||||
*
|
||||
* Get detailed submission by ID
|
||||
*/
|
||||
export const opusMagnumApiGetSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiGetSubmissionData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiGetSubmissionResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/submissions/{submission_id}', ...options });
|
||||
export const opusMagnumApiGetSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiGetSubmissionData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiGetSubmissionResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/submissions/{submission_id}', ...options });
|
||||
|
||||
/**
|
||||
* Validate Response
|
||||
@@ -95,7 +100,7 @@ export const opusMagnumApiGetSubmission = <ThrowOnError extends boolean = false>
|
||||
* Manually validate a puzzle response
|
||||
*/
|
||||
export const opusMagnumApiValidateResponse = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiValidateResponseData, ThrowOnError>) => (options.client ?? client).put<OpusMagnumApiValidateResponseResponses, unknown, ThrowOnError>({
|
||||
url: '/api/opus-magnum/responses/{response_id}/validate',
|
||||
url: '/api/events/{event_path}/opus-magnum/responses/{response_id}/validate',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -108,52 +113,52 @@ export const opusMagnumApiValidateResponse = <ThrowOnError extends boolean = fal
|
||||
*
|
||||
* Try to auto validate a puzzle response
|
||||
*/
|
||||
export const opusMagnumApiValidateAuto = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiValidateAutoData, ThrowOnError>) => (options.client ?? client).put<OpusMagnumApiValidateAutoResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/responses/{response_id}/validate/auto', ...options });
|
||||
export const opusMagnumApiValidateAuto = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiValidateAutoData, ThrowOnError>) => (options.client ?? client).put<OpusMagnumApiValidateAutoResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/responses/{response_id}/validate/auto', ...options });
|
||||
|
||||
/**
|
||||
* List Responses Needing Validation
|
||||
*
|
||||
* Get all responses that need manual validation
|
||||
*/
|
||||
export const opusMagnumApiListResponsesNeedingValidation = <ThrowOnError extends boolean = false>(options?: Options<OpusMagnumApiListResponsesNeedingValidationData, ThrowOnError>) => (options?.client ?? client).get<OpusMagnumApiListResponsesNeedingValidationResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/responses/needs-validation', ...options });
|
||||
export const opusMagnumApiListResponsesNeedingValidation = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiListResponsesNeedingValidationData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiListResponsesNeedingValidationResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/responses/needs-validation', ...options });
|
||||
|
||||
/**
|
||||
* Validate Submission
|
||||
*
|
||||
* Mark entire submission as validated
|
||||
*/
|
||||
export const opusMagnumApiValidateSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiValidateSubmissionData, ThrowOnError>) => (options.client ?? client).post<OpusMagnumApiValidateSubmissionResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/submissions/{submission_id}/validate', ...options });
|
||||
export const opusMagnumApiValidateSubmission = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiValidateSubmissionData, ThrowOnError>) => (options.client ?? client).post<OpusMagnumApiValidateSubmissionResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/submissions/{submission_id}/validate', ...options });
|
||||
|
||||
/**
|
||||
* Get Stats
|
||||
*
|
||||
* Get submission statistics
|
||||
*/
|
||||
export const opusMagnumApiGetStats = <ThrowOnError extends boolean = false>(options?: Options<OpusMagnumApiGetStatsData, ThrowOnError>) => (options?.client ?? client).get<OpusMagnumApiGetStatsResponses, unknown, ThrowOnError>({ url: '/api/opus-magnum/stats', ...options });
|
||||
export const opusMagnumApiGetStats = <ThrowOnError extends boolean = false>(options: Options<OpusMagnumApiGetStatsData, ThrowOnError>) => (options.client ?? client).get<OpusMagnumApiGetStatsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/opus-magnum/stats', ...options });
|
||||
|
||||
/**
|
||||
* Results
|
||||
*/
|
||||
export const animationsApiResults = <ThrowOnError extends boolean = false>(options?: Options<AnimationsApiResultsData, ThrowOnError>) => (options?.client ?? client).get<AnimationsApiResultsResponses, unknown, ThrowOnError>({ url: '/api/results/results', ...options });
|
||||
export const animationsApiResults = <ThrowOnError extends boolean = false>(options: Options<AnimationsApiResultsData, ThrowOnError>) => (options.client ?? client).get<AnimationsApiResultsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/results/results', ...options });
|
||||
|
||||
/**
|
||||
* Top Submissions
|
||||
*
|
||||
* Get tournament top submissions for each puzzle. Only available when tournament is closed.
|
||||
*/
|
||||
export const animationsApiTopSubmissions = <ThrowOnError extends boolean = false>(options?: Options<AnimationsApiTopSubmissionsData, ThrowOnError>) => (options?.client ?? client).get<AnimationsApiTopSubmissionsResponses, unknown, ThrowOnError>({ url: '/api/results/top-submissions', ...options });
|
||||
export const animationsApiTopSubmissions = <ThrowOnError extends boolean = false>(options: Options<AnimationsApiTopSubmissionsData, ThrowOnError>) => (options.client ?? client).get<AnimationsApiTopSubmissionsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/results/top-submissions', ...options });
|
||||
|
||||
/**
|
||||
* Puzzle Results
|
||||
*
|
||||
* Get tournament results organized by puzzle with coefficients. Only available when tournament is closed.
|
||||
*/
|
||||
export const animationsApiPuzzleResults = <ThrowOnError extends boolean = false>(options?: Options<AnimationsApiPuzzleResultsData, ThrowOnError>) => (options?.client ?? client).get<AnimationsApiPuzzleResultsResponses, unknown, ThrowOnError>({ url: '/api/results/puzzle-results', ...options });
|
||||
export const animationsApiPuzzleResults = <ThrowOnError extends boolean = false>(options: Options<AnimationsApiPuzzleResultsData, ThrowOnError>) => (options.client ?? client).get<AnimationsApiPuzzleResultsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/results/puzzle-results', ...options });
|
||||
|
||||
/**
|
||||
* Get Results
|
||||
*/
|
||||
export const noitaApiGetResults = <ThrowOnError extends boolean = false>(options?: Options<NoitaApiGetResultsData, ThrowOnError>) => (options?.client ?? client).get<NoitaApiGetResultsResponses, unknown, ThrowOnError>({ url: '/api/noita/results', ...options });
|
||||
export const noitaApiGetResults = <ThrowOnError extends boolean = false>(options: Options<NoitaApiGetResultsData, ThrowOnError>) => (options.client ?? client).get<NoitaApiGetResultsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/noita/results', ...options });
|
||||
|
||||
/**
|
||||
* Get Leaderboard
|
||||
@@ -162,7 +167,7 @@ export const noitaApiGetResults = <ThrowOnError extends boolean = false>(options
|
||||
*
|
||||
* Uses Window functions to rank users by their total score in descending order.
|
||||
*/
|
||||
export const noitaApiGetLeaderboard = <ThrowOnError extends boolean = false>(options?: Options<NoitaApiGetLeaderboardData, ThrowOnError>) => (options?.client ?? client).get<NoitaApiGetLeaderboardResponses, unknown, ThrowOnError>({ url: '/api/noita/leaderboard', ...options });
|
||||
export const noitaApiGetLeaderboard = <ThrowOnError extends boolean = false>(options: Options<NoitaApiGetLeaderboardData, ThrowOnError>) => (options.client ?? client).get<NoitaApiGetLeaderboardResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/noita/leaderboard', ...options });
|
||||
|
||||
/**
|
||||
* Submit Log File
|
||||
@@ -178,7 +183,7 @@ export const noitaApiGetLeaderboard = <ThrowOnError extends boolean = false>(opt
|
||||
*/
|
||||
export const noitaApiSubmitLogFile = <ThrowOnError extends boolean = false>(options: Options<NoitaApiSubmitLogFileData, ThrowOnError>) => (options.client ?? client).post<NoitaApiSubmitLogFileResponses, NoitaApiSubmitLogFileErrors, ThrowOnError>({
|
||||
...formDataBodySerializer,
|
||||
url: '/api/noita/submit',
|
||||
url: '/api/events/{event_path}/noita/submit',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': null,
|
||||
@@ -187,16 +192,16 @@ export const noitaApiSubmitLogFile = <ThrowOnError extends boolean = false>(opti
|
||||
});
|
||||
|
||||
/**
|
||||
* List Games
|
||||
* List Event Games
|
||||
*/
|
||||
export const gamesApiListGames = <ThrowOnError extends boolean = false>(options?: Options<GamesApiListGamesData, ThrowOnError>) => (options?.client ?? client).get<GamesApiListGamesResponses, unknown, ThrowOnError>({ url: '/api/games/', ...options });
|
||||
export const gamesApiListEventGames = <ThrowOnError extends boolean = false>(options: Options<GamesApiListEventGamesData, ThrowOnError>) => (options.client ?? client).get<GamesApiListEventGamesResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/games', ...options });
|
||||
|
||||
/**
|
||||
* Create Submission
|
||||
*/
|
||||
export const submissionsApiCreateSubmission = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiCreateSubmissionData, ThrowOnError>) => (options.client ?? client).post<SubmissionsApiCreateSubmissionResponses, unknown, ThrowOnError>({
|
||||
...formDataBodySerializer,
|
||||
url: '/api/submissions/submission/create',
|
||||
url: '/api/events/{event_path}/submissions/submission/create',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': null,
|
||||
@@ -207,23 +212,23 @@ export const submissionsApiCreateSubmission = <ThrowOnError extends boolean = fa
|
||||
/**
|
||||
* List User Submissions
|
||||
*/
|
||||
export const submissionsApiListUserSubmissions = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiListUserSubmissionsData, ThrowOnError>) => (options.client ?? client).get<SubmissionsApiListUserSubmissionsResponses, unknown, ThrowOnError>({ url: '/api/submissions/submission/by/user', ...options });
|
||||
export const submissionsApiListUserSubmissions = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiListUserSubmissionsData, ThrowOnError>) => (options.client ?? client).get<SubmissionsApiListUserSubmissionsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/submissions/submission/by/user', ...options });
|
||||
|
||||
/**
|
||||
* List Submissions By Game
|
||||
*/
|
||||
export const submissionsApiListSubmissionsByGame = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiListSubmissionsByGameData, ThrowOnError>) => (options.client ?? client).get<SubmissionsApiListSubmissionsByGameResponses, unknown, ThrowOnError>({ url: '/api/submissions/submission/by/game', ...options });
|
||||
export const submissionsApiListSubmissionsByGame = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiListSubmissionsByGameData, ThrowOnError>) => (options.client ?? client).get<SubmissionsApiListSubmissionsByGameResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/submissions/submission/by/game', ...options });
|
||||
|
||||
/**
|
||||
* Get Submission
|
||||
*/
|
||||
export const submissionsApiGetSubmission = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiGetSubmissionData, ThrowOnError>) => (options.client ?? client).get<SubmissionsApiGetSubmissionResponses, unknown, ThrowOnError>({ url: '/api/submissions/submission/{submission_id}', ...options });
|
||||
export const submissionsApiGetSubmission = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiGetSubmissionData, ThrowOnError>) => (options.client ?? client).get<SubmissionsApiGetSubmissionResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/submissions/submission/{submission_id}', ...options });
|
||||
|
||||
/**
|
||||
* Create Image Crop
|
||||
*/
|
||||
export const submissionsApiCreateImageCrop = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiCreateImageCropData, ThrowOnError>) => (options.client ?? client).post<SubmissionsApiCreateImageCropResponses, unknown, ThrowOnError>({
|
||||
url: '/api/submissions/crops/s/{submission_file_id}',
|
||||
url: '/api/events/{event_path}/submissions/crops/s/{submission_file_id}',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -234,38 +239,38 @@ export const submissionsApiCreateImageCrop = <ThrowOnError extends boolean = fal
|
||||
/**
|
||||
* Delete Image Crop
|
||||
*/
|
||||
export const submissionsApiDeleteImageCrop = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiDeleteImageCropData, ThrowOnError>) => (options.client ?? client).delete<SubmissionsApiDeleteImageCropResponses, unknown, ThrowOnError>({ url: '/api/submissions/crops/{crop_id}', ...options });
|
||||
export const submissionsApiDeleteImageCrop = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiDeleteImageCropData, ThrowOnError>) => (options.client ?? client).delete<SubmissionsApiDeleteImageCropResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/submissions/crops/{crop_id}', ...options });
|
||||
|
||||
/**
|
||||
* Process File Ocr
|
||||
*/
|
||||
export const submissionsApiProcessFileOcr = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiProcessFileOcrData, ThrowOnError>) => (options.client ?? client).post<SubmissionsApiProcessFileOcrResponses, unknown, ThrowOnError>({ url: '/api/submissions/files/{file_id}/process-ocr', ...options });
|
||||
export const submissionsApiProcessFileOcr = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiProcessFileOcrData, ThrowOnError>) => (options.client ?? client).post<SubmissionsApiProcessFileOcrResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/submissions/files/{file_id}/process-ocr', ...options });
|
||||
|
||||
/**
|
||||
* Process Crop Ocr
|
||||
*/
|
||||
export const submissionsApiProcessCropOcr = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiProcessCropOcrData, ThrowOnError>) => (options.client ?? client).post<SubmissionsApiProcessCropOcrResponses, unknown, ThrowOnError>({ url: '/api/submissions/crops/{crop_id}/process-ocr', ...options });
|
||||
export const submissionsApiProcessCropOcr = <ThrowOnError extends boolean = false>(options: Options<SubmissionsApiProcessCropOcrData, ThrowOnError>) => (options.client ?? client).post<SubmissionsApiProcessCropOcrResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/submissions/crops/{crop_id}/process-ocr', ...options });
|
||||
|
||||
/**
|
||||
* List Markets
|
||||
*
|
||||
* List all markets (excludes draft markets).
|
||||
*/
|
||||
export const marketApiListMarkets = <ThrowOnError extends boolean = false>(options?: Options<MarketApiListMarketsData, ThrowOnError>) => (options?.client ?? client).get<MarketApiListMarketsResponses, unknown, ThrowOnError>({ url: '/api/market/', ...options });
|
||||
export const marketApiListMarkets = <ThrowOnError extends boolean = false>(options: Options<MarketApiListMarketsData, ThrowOnError>) => (options.client ?? client).get<MarketApiListMarketsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/market/', ...options });
|
||||
|
||||
/**
|
||||
* List User Bets
|
||||
*
|
||||
* List all bets placed by the current user.
|
||||
*/
|
||||
export const marketApiListUserBets = <ThrowOnError extends boolean = false>(options?: Options<MarketApiListUserBetsData, ThrowOnError>) => (options?.client ?? client).get<MarketApiListUserBetsResponses, unknown, ThrowOnError>({ url: '/api/market/user/bets', ...options });
|
||||
export const marketApiListUserBets = <ThrowOnError extends boolean = false>(options: Options<MarketApiListUserBetsData, ThrowOnError>) => (options.client ?? client).get<MarketApiListUserBetsResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/market/user/bets', ...options });
|
||||
|
||||
/**
|
||||
* Close Market
|
||||
*
|
||||
* Close a market. Admin only.
|
||||
*/
|
||||
export const marketApiCloseMarket = <ThrowOnError extends boolean = false>(options: Options<MarketApiCloseMarketData, ThrowOnError>) => (options.client ?? client).post<MarketApiCloseMarketResponses, unknown, ThrowOnError>({ url: '/api/market/{market_uuid}/actions/close', ...options });
|
||||
export const marketApiCloseMarket = <ThrowOnError extends boolean = false>(options: Options<MarketApiCloseMarketData, ThrowOnError>) => (options.client ?? client).post<MarketApiCloseMarketResponses, unknown, ThrowOnError>({ url: '/api/events/{event_path}/market/{market_uuid}/actions/close', ...options });
|
||||
|
||||
/**
|
||||
* Resolve Market
|
||||
@@ -273,7 +278,7 @@ export const marketApiCloseMarket = <ThrowOnError extends boolean = false>(optio
|
||||
* Resolve a market with a winning option. Admin only.
|
||||
*/
|
||||
export const marketApiResolveMarket = <ThrowOnError extends boolean = false>(options: Options<MarketApiResolveMarketData, ThrowOnError>) => (options.client ?? client).post<MarketApiResolveMarketResponses, unknown, ThrowOnError>({
|
||||
url: '/api/market/{market_uuid}/actions/resolve',
|
||||
url: '/api/events/{event_path}/market/{market_uuid}/actions/resolve',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -287,7 +292,7 @@ export const marketApiResolveMarket = <ThrowOnError extends boolean = false>(opt
|
||||
* Place a bet on a market option.
|
||||
*/
|
||||
export const marketApiCreateBet = <ThrowOnError extends boolean = false>(options: Options<MarketApiCreateBetData, ThrowOnError>) => (options.client ?? client).post<MarketApiCreateBetResponses, unknown, ThrowOnError>({
|
||||
url: '/api/market/{market_uuid}/bets',
|
||||
url: '/api/events/{event_path}/market/{market_uuid}/bets',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -52,6 +52,32 @@ export type UserInfoOut = {
|
||||
cas_groups?: Array<string> | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* GameOut
|
||||
*/
|
||||
export type GameOut = {
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* Steam App Id
|
||||
*/
|
||||
steam_app_id?: number | null;
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Image
|
||||
*/
|
||||
image?: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* PuzzlePointsFactorOut
|
||||
*
|
||||
@@ -890,32 +916,6 @@ export type NoitaSubmissionOut = {
|
||||
processed: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* GameOut
|
||||
*/
|
||||
export type GameOut = {
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* Steam App Id
|
||||
*/
|
||||
steam_app_id?: number | null;
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Image
|
||||
*/
|
||||
image?: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* ImageCropOut
|
||||
*/
|
||||
@@ -1102,7 +1102,12 @@ export type PolylanSubmitterApiHealthCheckResponses = {
|
||||
export type PolylanSubmitterApiClearCacheData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
query?: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path?: string | null;
|
||||
};
|
||||
url: '/api/cache/clear';
|
||||
};
|
||||
|
||||
@@ -1129,11 +1134,34 @@ export type PolylanSubmitterApiGetUserInfoResponses = {
|
||||
|
||||
export type PolylanSubmitterApiGetUserInfoResponse = PolylanSubmitterApiGetUserInfoResponses[keyof PolylanSubmitterApiGetUserInfoResponses];
|
||||
|
||||
export type OpusMagnumApiListPuzzlesData = {
|
||||
export type GamesApiListGamesData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/puzzles';
|
||||
url: '/api/games/';
|
||||
};
|
||||
|
||||
export type GamesApiListGamesResponses = {
|
||||
/**
|
||||
* Response
|
||||
*
|
||||
* OK
|
||||
*/
|
||||
200: Array<GameOut>;
|
||||
};
|
||||
|
||||
export type GamesApiListGamesResponse = GamesApiListGamesResponses[keyof GamesApiListGamesResponses];
|
||||
|
||||
export type OpusMagnumApiListPuzzlesData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/events/{event_path}/opus-magnum/puzzles';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiListPuzzlesResponses = {
|
||||
@@ -1149,9 +1177,14 @@ export type OpusMagnumApiListPuzzlesResponse = OpusMagnumApiListPuzzlesResponses
|
||||
|
||||
export type OpusMagnumApiGetCollectionData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/collection';
|
||||
url: '/api/events/{event_path}/opus-magnum/collection';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiGetCollectionResponses = {
|
||||
@@ -1165,7 +1198,12 @@ export type OpusMagnumApiGetCollectionResponse = OpusMagnumApiGetCollectionRespo
|
||||
|
||||
export type OpusMagnumApiListSubmissionsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: {
|
||||
/**
|
||||
* Limit
|
||||
@@ -1176,7 +1214,7 @@ export type OpusMagnumApiListSubmissionsData = {
|
||||
*/
|
||||
offset?: number;
|
||||
};
|
||||
url: '/api/opus-magnum/submissions';
|
||||
url: '/api/events/{event_path}/opus-magnum/submissions';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiListSubmissionsResponses = {
|
||||
@@ -1199,9 +1237,14 @@ export type OpusMagnumApiCreateSubmissionData = {
|
||||
files: Array<Blob | File>;
|
||||
data: SubmissionIn;
|
||||
};
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/submissions';
|
||||
url: '/api/events/{event_path}/opus-magnum/submissions';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiCreateSubmissionResponses = {
|
||||
@@ -1216,13 +1259,17 @@ export type OpusMagnumApiCreateSubmissionResponse = OpusMagnumApiCreateSubmissio
|
||||
export type OpusMagnumApiDeleteSubmissionData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Submission Id
|
||||
*/
|
||||
submission_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/submissions/{submission_id}';
|
||||
url: '/api/events/{event_path}/opus-magnum/submissions/{submission_id}';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiDeleteSubmissionResponses = {
|
||||
@@ -1235,13 +1282,17 @@ export type OpusMagnumApiDeleteSubmissionResponses = {
|
||||
export type OpusMagnumApiGetSubmissionData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Submission Id
|
||||
*/
|
||||
submission_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/submissions/{submission_id}';
|
||||
url: '/api/events/{event_path}/opus-magnum/submissions/{submission_id}';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiGetSubmissionResponses = {
|
||||
@@ -1256,13 +1307,17 @@ export type OpusMagnumApiGetSubmissionResponse = OpusMagnumApiGetSubmissionRespo
|
||||
export type OpusMagnumApiValidateResponseData = {
|
||||
body: ValidationIn;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Response Id
|
||||
*/
|
||||
response_id: number;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/responses/{response_id}/validate';
|
||||
url: '/api/events/{event_path}/opus-magnum/responses/{response_id}/validate';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiValidateResponseResponses = {
|
||||
@@ -1277,13 +1332,17 @@ export type OpusMagnumApiValidateResponseResponse = OpusMagnumApiValidateRespons
|
||||
export type OpusMagnumApiValidateAutoData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Response Id
|
||||
*/
|
||||
response_id: number;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/responses/{response_id}/validate/auto';
|
||||
url: '/api/events/{event_path}/opus-magnum/responses/{response_id}/validate/auto';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiValidateAutoResponses = {
|
||||
@@ -1297,9 +1356,14 @@ export type OpusMagnumApiValidateAutoResponse = OpusMagnumApiValidateAutoRespons
|
||||
|
||||
export type OpusMagnumApiListResponsesNeedingValidationData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/responses/needs-validation';
|
||||
url: '/api/events/{event_path}/opus-magnum/responses/needs-validation';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiListResponsesNeedingValidationResponses = {
|
||||
@@ -1316,13 +1380,17 @@ export type OpusMagnumApiListResponsesNeedingValidationResponse = OpusMagnumApiL
|
||||
export type OpusMagnumApiValidateSubmissionData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Submission Id
|
||||
*/
|
||||
submission_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/submissions/{submission_id}/validate';
|
||||
url: '/api/events/{event_path}/opus-magnum/submissions/{submission_id}/validate';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiValidateSubmissionResponses = {
|
||||
@@ -1336,9 +1404,14 @@ export type OpusMagnumApiValidateSubmissionResponse = OpusMagnumApiValidateSubmi
|
||||
|
||||
export type OpusMagnumApiGetStatsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/opus-magnum/stats';
|
||||
url: '/api/events/{event_path}/opus-magnum/stats';
|
||||
};
|
||||
|
||||
export type OpusMagnumApiGetStatsResponses = {
|
||||
@@ -1350,9 +1423,14 @@ export type OpusMagnumApiGetStatsResponses = {
|
||||
|
||||
export type AnimationsApiResultsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/results/results';
|
||||
url: '/api/events/{event_path}/results/results';
|
||||
};
|
||||
|
||||
export type AnimationsApiResultsResponses = {
|
||||
@@ -1366,14 +1444,19 @@ export type AnimationsApiResultsResponse = AnimationsApiResultsResponses[keyof A
|
||||
|
||||
export type AnimationsApiTopSubmissionsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: {
|
||||
/**
|
||||
* Limit
|
||||
*/
|
||||
limit?: number;
|
||||
};
|
||||
url: '/api/results/top-submissions';
|
||||
url: '/api/events/{event_path}/results/top-submissions';
|
||||
};
|
||||
|
||||
export type AnimationsApiTopSubmissionsResponses = {
|
||||
@@ -1387,14 +1470,19 @@ export type AnimationsApiTopSubmissionsResponse = AnimationsApiTopSubmissionsRes
|
||||
|
||||
export type AnimationsApiPuzzleResultsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: {
|
||||
/**
|
||||
* Limit
|
||||
*/
|
||||
limit?: number;
|
||||
};
|
||||
url: '/api/results/puzzle-results';
|
||||
url: '/api/events/{event_path}/results/puzzle-results';
|
||||
};
|
||||
|
||||
export type AnimationsApiPuzzleResultsResponses = {
|
||||
@@ -1408,9 +1496,14 @@ export type AnimationsApiPuzzleResultsResponse = AnimationsApiPuzzleResultsRespo
|
||||
|
||||
export type NoitaApiGetResultsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/noita/results';
|
||||
url: '/api/events/{event_path}/noita/results';
|
||||
};
|
||||
|
||||
export type NoitaApiGetResultsResponses = {
|
||||
@@ -1424,9 +1517,14 @@ export type NoitaApiGetResultsResponse = NoitaApiGetResultsResponses[keyof Noita
|
||||
|
||||
export type NoitaApiGetLeaderboardData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/noita/leaderboard';
|
||||
url: '/api/events/{event_path}/noita/leaderboard';
|
||||
};
|
||||
|
||||
export type NoitaApiGetLeaderboardResponses = {
|
||||
@@ -1448,9 +1546,14 @@ export type NoitaApiSubmitLogFileData = {
|
||||
*/
|
||||
file: Blob | File;
|
||||
};
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/noita/submit';
|
||||
url: '/api/events/{event_path}/noita/submit';
|
||||
};
|
||||
|
||||
export type NoitaApiSubmitLogFileErrors = {
|
||||
@@ -1475,14 +1578,19 @@ export type NoitaApiSubmitLogFileResponses = {
|
||||
|
||||
export type NoitaApiSubmitLogFileResponse = NoitaApiSubmitLogFileResponses[keyof NoitaApiSubmitLogFileResponses];
|
||||
|
||||
export type GamesApiListGamesData = {
|
||||
export type GamesApiListEventGamesData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/games/';
|
||||
url: '/api/events/{event_path}/games';
|
||||
};
|
||||
|
||||
export type GamesApiListGamesResponses = {
|
||||
export type GamesApiListEventGamesResponses = {
|
||||
/**
|
||||
* Response
|
||||
*
|
||||
@@ -1491,7 +1599,7 @@ export type GamesApiListGamesResponses = {
|
||||
200: Array<GameOut>;
|
||||
};
|
||||
|
||||
export type GamesApiListGamesResponse = GamesApiListGamesResponses[keyof GamesApiListGamesResponses];
|
||||
export type GamesApiListEventGamesResponse = GamesApiListEventGamesResponses[keyof GamesApiListEventGamesResponses];
|
||||
|
||||
export type SubmissionsApiCreateSubmissionData = {
|
||||
/**
|
||||
@@ -1507,14 +1615,19 @@ export type SubmissionsApiCreateSubmissionData = {
|
||||
*/
|
||||
notes?: string | null;
|
||||
};
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query: {
|
||||
/**
|
||||
* Game Path
|
||||
*/
|
||||
game_path: string;
|
||||
};
|
||||
url: '/api/submissions/submission/create';
|
||||
url: '/api/events/{event_path}/submissions/submission/create';
|
||||
};
|
||||
|
||||
export type SubmissionsApiCreateSubmissionResponses = {
|
||||
@@ -1528,14 +1641,19 @@ export type SubmissionsApiCreateSubmissionResponse = SubmissionsApiCreateSubmiss
|
||||
|
||||
export type SubmissionsApiListUserSubmissionsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query: {
|
||||
/**
|
||||
* Game Path
|
||||
*/
|
||||
game_path: string;
|
||||
};
|
||||
url: '/api/submissions/submission/by/user';
|
||||
url: '/api/events/{event_path}/submissions/submission/by/user';
|
||||
};
|
||||
|
||||
export type SubmissionsApiListUserSubmissionsResponses = {
|
||||
@@ -1551,14 +1669,19 @@ export type SubmissionsApiListUserSubmissionsResponse = SubmissionsApiListUserSu
|
||||
|
||||
export type SubmissionsApiListSubmissionsByGameData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query: {
|
||||
/**
|
||||
* Game Path
|
||||
*/
|
||||
game_path: string;
|
||||
};
|
||||
url: '/api/submissions/submission/by/game';
|
||||
url: '/api/events/{event_path}/submissions/submission/by/game';
|
||||
};
|
||||
|
||||
export type SubmissionsApiListSubmissionsByGameResponses = {
|
||||
@@ -1575,13 +1698,17 @@ export type SubmissionsApiListSubmissionsByGameResponse = SubmissionsApiListSubm
|
||||
export type SubmissionsApiGetSubmissionData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Submission Id
|
||||
*/
|
||||
submission_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/submissions/submission/{submission_id}';
|
||||
url: '/api/events/{event_path}/submissions/submission/{submission_id}';
|
||||
};
|
||||
|
||||
export type SubmissionsApiGetSubmissionResponses = {
|
||||
@@ -1596,13 +1723,17 @@ export type SubmissionsApiGetSubmissionResponse = SubmissionsApiGetSubmissionRes
|
||||
export type SubmissionsApiCreateImageCropData = {
|
||||
body: ImageCropIn;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Submission File Id
|
||||
*/
|
||||
submission_file_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/submissions/crops/s/{submission_file_id}';
|
||||
url: '/api/events/{event_path}/submissions/crops/s/{submission_file_id}';
|
||||
};
|
||||
|
||||
export type SubmissionsApiCreateImageCropResponses = {
|
||||
@@ -1617,13 +1748,17 @@ export type SubmissionsApiCreateImageCropResponse = SubmissionsApiCreateImageCro
|
||||
export type SubmissionsApiDeleteImageCropData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Crop Id
|
||||
*/
|
||||
crop_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/submissions/crops/{crop_id}';
|
||||
url: '/api/events/{event_path}/submissions/crops/{crop_id}';
|
||||
};
|
||||
|
||||
export type SubmissionsApiDeleteImageCropResponses = {
|
||||
@@ -1642,13 +1777,17 @@ export type SubmissionsApiDeleteImageCropResponse = SubmissionsApiDeleteImageCro
|
||||
export type SubmissionsApiProcessFileOcrData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* File Id
|
||||
*/
|
||||
file_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/submissions/files/{file_id}/process-ocr';
|
||||
url: '/api/events/{event_path}/submissions/files/{file_id}/process-ocr';
|
||||
};
|
||||
|
||||
export type SubmissionsApiProcessFileOcrResponses = {
|
||||
@@ -1667,13 +1806,17 @@ export type SubmissionsApiProcessFileOcrResponse = SubmissionsApiProcessFileOcrR
|
||||
export type SubmissionsApiProcessCropOcrData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Crop Id
|
||||
*/
|
||||
crop_id: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/submissions/crops/{crop_id}/process-ocr';
|
||||
url: '/api/events/{event_path}/submissions/crops/{crop_id}/process-ocr';
|
||||
};
|
||||
|
||||
export type SubmissionsApiProcessCropOcrResponses = {
|
||||
@@ -1691,9 +1834,14 @@ export type SubmissionsApiProcessCropOcrResponse = SubmissionsApiProcessCropOcrR
|
||||
|
||||
export type MarketApiListMarketsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/market/';
|
||||
url: '/api/events/{event_path}/market/';
|
||||
};
|
||||
|
||||
export type MarketApiListMarketsResponses = {
|
||||
@@ -1709,9 +1857,14 @@ export type MarketApiListMarketsResponse = MarketApiListMarketsResponses[keyof M
|
||||
|
||||
export type MarketApiListUserBetsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/market/user/bets';
|
||||
url: '/api/events/{event_path}/market/user/bets';
|
||||
};
|
||||
|
||||
export type MarketApiListUserBetsResponses = {
|
||||
@@ -1728,13 +1881,17 @@ export type MarketApiListUserBetsResponse = MarketApiListUserBetsResponses[keyof
|
||||
export type MarketApiCloseMarketData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Market Uuid
|
||||
*/
|
||||
market_uuid: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/market/{market_uuid}/actions/close';
|
||||
url: '/api/events/{event_path}/market/{market_uuid}/actions/close';
|
||||
};
|
||||
|
||||
export type MarketApiCloseMarketResponses = {
|
||||
@@ -1747,13 +1904,17 @@ export type MarketApiCloseMarketResponses = {
|
||||
export type MarketApiResolveMarketData = {
|
||||
body: ResolveMarketSchema;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Market Uuid
|
||||
*/
|
||||
market_uuid: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/market/{market_uuid}/actions/resolve';
|
||||
url: '/api/events/{event_path}/market/{market_uuid}/actions/resolve';
|
||||
};
|
||||
|
||||
export type MarketApiResolveMarketResponses = {
|
||||
@@ -1768,13 +1929,17 @@ export type MarketApiResolveMarketResponse = MarketApiResolveMarketResponses[key
|
||||
export type MarketApiCreateBetData = {
|
||||
body: UserBetCreateSchema;
|
||||
path: {
|
||||
/**
|
||||
* Event Path
|
||||
*/
|
||||
event_path: string;
|
||||
/**
|
||||
* Market Uuid
|
||||
*/
|
||||
market_uuid: string;
|
||||
};
|
||||
query?: never;
|
||||
url: '/api/market/{market_uuid}/bets';
|
||||
url: '/api/events/{event_path}/market/{market_uuid}/bets';
|
||||
};
|
||||
|
||||
export type MarketApiCreateBetResponses = {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ref, computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { marketApiCreateBet, marketApiCloseMarket, marketApiResolveMarket } from "../api";
|
||||
import { useMarketStore } from "../stores/market";
|
||||
import { useEventPath } from "../composables/useEventPath";
|
||||
import type { Market, MarketOption } from "../types";
|
||||
import type { UserBetSchema } from "../api/types.gen";
|
||||
|
||||
@@ -14,6 +15,7 @@ const emit = defineEmits<{
|
||||
refresh: [];
|
||||
}>();
|
||||
|
||||
const eventPath = useEventPath();
|
||||
const marketStore = useMarketStore();
|
||||
const { userInfo, userBets } = storeToRefs(marketStore);
|
||||
|
||||
@@ -82,7 +84,7 @@ const closeMarket = async () => {
|
||||
|
||||
try {
|
||||
await marketApiCloseMarket({
|
||||
path: { market_uuid: props.market.uuid },
|
||||
path: { event_path: eventPath, market_uuid: props.market.uuid },
|
||||
});
|
||||
emit("refresh");
|
||||
} catch (e) {
|
||||
@@ -103,7 +105,7 @@ const resolveMarket = async () => {
|
||||
|
||||
try {
|
||||
await marketApiResolveMarket({
|
||||
path: { market_uuid: props.market.uuid },
|
||||
path: { event_path: eventPath, market_uuid: props.market.uuid },
|
||||
body: { winning_option_uuid: selectedWinningOption.value },
|
||||
});
|
||||
emit("refresh");
|
||||
@@ -132,6 +134,7 @@ const placeBet = async () => {
|
||||
try {
|
||||
const response = await marketApiCreateBet({
|
||||
path: {
|
||||
event_path: eventPath,
|
||||
market_uuid: props.market.uuid
|
||||
},
|
||||
body: {
|
||||
@@ -142,7 +145,7 @@ const placeBet = async () => {
|
||||
|
||||
if (!response.error) {
|
||||
// Reload user bets to reflect the new bet
|
||||
await marketStore.loadUserBets();
|
||||
await marketStore.loadUserBets(eventPath);
|
||||
updateExistingBet();
|
||||
betAmount.value = 0;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { inject, provide, type InjectionKey } from 'vue'
|
||||
|
||||
export const EventPathKey: InjectionKey<string> = Symbol('eventPath')
|
||||
|
||||
export function provideEventPath(eventPath: string) {
|
||||
provide(EventPathKey, eventPath)
|
||||
}
|
||||
|
||||
export function useEventPath(): string {
|
||||
const eventPath = inject(EventPathKey)
|
||||
if (!eventPath) {
|
||||
throw new Error('useEventPath() called without a provided eventPath - is this component mounted under a page that calls provideEventPath()?')
|
||||
}
|
||||
return eventPath
|
||||
}
|
||||
@@ -37,12 +37,28 @@ interface SubmissionStats {
|
||||
|
||||
// API Service Class
|
||||
export class ApiService {
|
||||
private eventPath: string | null = null
|
||||
|
||||
// Every endpoint this service calls is event-scoped (/api/events/{event_path}/...),
|
||||
// so the owning page sets this once (via provideEventPath()'s value) before any
|
||||
// request is made, instead of threading eventPath through every method signature.
|
||||
setEventPath(eventPath: string) {
|
||||
this.eventPath = eventPath
|
||||
}
|
||||
|
||||
private buildUrl(endpoint: string): string {
|
||||
if (!this.eventPath) {
|
||||
throw new Error('ApiService.setEventPath() must be called before making requests')
|
||||
}
|
||||
return `${API_BASE_URL}/events/${this.eventPath}${endpoint}`
|
||||
}
|
||||
|
||||
private async request<T>(
|
||||
endpoint: string,
|
||||
options: RequestInit = {}
|
||||
): Promise<ApiResponse<T>> {
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
||||
const response = await fetch(this.buildUrl(endpoint), {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers,
|
||||
@@ -76,7 +92,7 @@ export class ApiService {
|
||||
formData: FormData
|
||||
): Promise<ApiResponse<T>> {
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
||||
const response = await fetch(this.buildUrl(endpoint), {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
})
|
||||
|
||||
@@ -25,9 +25,9 @@ export const useMarketStore = defineStore('market', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const loadMarkets = async () => {
|
||||
const loadMarkets = async (eventPath: string) => {
|
||||
try {
|
||||
const response = await marketApiListMarkets()
|
||||
const response = await marketApiListMarkets({ path: { event_path: eventPath } })
|
||||
if (response.data) {
|
||||
markets.value = response.data as unknown as Market[]
|
||||
}
|
||||
@@ -37,9 +37,9 @@ export const useMarketStore = defineStore('market', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const loadUserBets = async () => {
|
||||
const loadUserBets = async (eventPath: string) => {
|
||||
try {
|
||||
const response = await marketApiListUserBets()
|
||||
const response = await marketApiListUserBets({ path: { event_path: eventPath } })
|
||||
if (response.data) {
|
||||
userBets.value = response.data
|
||||
}
|
||||
@@ -49,30 +49,30 @@ export const useMarketStore = defineStore('market', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const initializeMarketPage = async () => {
|
||||
const initializeMarketPage = async (eventPath: string) => {
|
||||
isLoading.value = true
|
||||
error.value = ''
|
||||
|
||||
try {
|
||||
await Promise.all([
|
||||
loadUserInfo(),
|
||||
loadMarkets(),
|
||||
loadMarkets(eventPath),
|
||||
])
|
||||
|
||||
// Load user bets if authenticated
|
||||
if (userInfo.value?.is_authenticated) {
|
||||
await loadUserBets()
|
||||
await loadUserBets(eventPath)
|
||||
}
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const refreshPage = async () => {
|
||||
const refreshPage = async (eventPath: string) => {
|
||||
await Promise.all([
|
||||
loadUserInfo(),
|
||||
loadMarkets(),
|
||||
userInfo.value?.is_authenticated ? loadUserBets() : Promise.resolve(),
|
||||
loadMarkets(eventPath),
|
||||
userInfo.value?.is_authenticated ? loadUserBets(eventPath) : Promise.resolve(),
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
@@ -31,14 +31,14 @@ export const usePuzzlesStore = defineStore('puzzles', () => {
|
||||
})
|
||||
|
||||
// Actions
|
||||
const loadPuzzles = async () => {
|
||||
const loadPuzzles = async (eventPath: string) => {
|
||||
if (puzzles.value.length > 0) return // Already loaded
|
||||
|
||||
try {
|
||||
isLoading.value = true
|
||||
error.value = ''
|
||||
|
||||
const response = await opusMagnumApiListPuzzles()
|
||||
const response = await opusMagnumApiListPuzzles({ path: { event_path: eventPath } })
|
||||
if (response.error) {
|
||||
error.value = String(response.error)
|
||||
console.error('Failed to load puzzles:', response.error)
|
||||
@@ -56,9 +56,9 @@ export const usePuzzlesStore = defineStore('puzzles', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const refreshPuzzles = async () => {
|
||||
const refreshPuzzles = async (eventPath: string) => {
|
||||
puzzles.value = []
|
||||
await loadPuzzles()
|
||||
await loadPuzzles(eventPath)
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user