|
|
|
@@ -0,0 +1,947 @@
|
|
|
|
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
|
|
|
|
|
|
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/vue-query';
|
|
|
|
|
|
|
|
|
|
import { client } from '../client.gen';
|
|
|
|
|
import { animationsApiPuzzleResults, animationsApiResults, animationsApiTopSubmissions, clockApiCurrentState, clockApiMyStats, gamesApiListEventGames, gamesApiListEventSteamGames, gamesApiListGames, marketApiBetHistory, marketApiCloseMarket, marketApiCreateBet, marketApiGetUserPoints, marketApiListMarkets, marketApiListUserBets, marketApiResolveMarket, noitaApiGetLeaderboard, noitaApiGetResults, noitaApiSubmitLogFile, type Options, opusMagnumApiCreateSubmission, opusMagnumApiDeleteSubmission, opusMagnumApiGetCollection, opusMagnumApiGetStats, opusMagnumApiGetSubmission, opusMagnumApiListPuzzles, opusMagnumApiListResponsesNeedingValidation, opusMagnumApiListSubmissions, opusMagnumApiValidateAuto, opusMagnumApiValidateResponse, opusMagnumApiValidateSubmission, placeApiCanvas, placeApiEvolutionGif, polylanSubmitterApiClearCache, polylanSubmitterApiGetUserInfo, polylanSubmitterApiHealthCheck, submissionsApiCreateImageCrop, submissionsApiCreateSubmission, submissionsApiDeleteImageCrop, submissionsApiGetSubmission, submissionsApiListAvailableScopes, submissionsApiListMyScopes, submissionsApiListSubmissionsByGame, submissionsApiListUserSubmissions, submissionsApiProcessCropOcr, submissionsApiProcessFileOcr } from '../sdk.gen';
|
|
|
|
|
import type { AnimationsApiPuzzleResultsData, AnimationsApiPuzzleResultsResponse, AnimationsApiResultsData, AnimationsApiResultsResponse, AnimationsApiTopSubmissionsData, AnimationsApiTopSubmissionsResponse, ClockApiCurrentStateData, ClockApiCurrentStateResponse, ClockApiMyStatsData, ClockApiMyStatsResponse, GamesApiListEventGamesData, GamesApiListEventGamesResponse, GamesApiListEventSteamGamesData, GamesApiListEventSteamGamesResponse, GamesApiListGamesData, GamesApiListGamesResponse, MarketApiBetHistoryData, MarketApiBetHistoryResponse, MarketApiCloseMarketData, MarketApiCreateBetData, MarketApiCreateBetResponse, MarketApiGetUserPointsData, MarketApiGetUserPointsResponse, MarketApiListMarketsData, MarketApiListMarketsResponse, MarketApiListUserBetsData, MarketApiListUserBetsResponse, MarketApiResolveMarketData, MarketApiResolveMarketResponse, NoitaApiGetLeaderboardData, NoitaApiGetLeaderboardResponse, NoitaApiGetResultsData, NoitaApiGetResultsResponse, NoitaApiSubmitLogFileData, NoitaApiSubmitLogFileError, NoitaApiSubmitLogFileResponse, OpusMagnumApiCreateSubmissionData, OpusMagnumApiCreateSubmissionResponse, OpusMagnumApiDeleteSubmissionData, OpusMagnumApiGetCollectionData, OpusMagnumApiGetCollectionResponse, OpusMagnumApiGetStatsData, OpusMagnumApiGetSubmissionData, OpusMagnumApiGetSubmissionResponse, OpusMagnumApiListPuzzlesData, OpusMagnumApiListPuzzlesResponse, OpusMagnumApiListResponsesNeedingValidationData, OpusMagnumApiListResponsesNeedingValidationResponse, OpusMagnumApiListSubmissionsData, OpusMagnumApiListSubmissionsResponse, OpusMagnumApiValidateAutoData, OpusMagnumApiValidateAutoResponse, OpusMagnumApiValidateResponseData, OpusMagnumApiValidateResponseResponse, OpusMagnumApiValidateSubmissionData, OpusMagnumApiValidateSubmissionResponse, PlaceApiCanvasData, PlaceApiEvolutionGifData, PolylanSubmitterApiClearCacheData, PolylanSubmitterApiGetUserInfoData, PolylanSubmitterApiGetUserInfoResponse, PolylanSubmitterApiHealthCheckData, SubmissionsApiCreateImageCropData, SubmissionsApiCreateImageCropResponse, SubmissionsApiCreateSubmissionData, SubmissionsApiCreateSubmissionError, SubmissionsApiCreateSubmissionResponse, SubmissionsApiDeleteImageCropData, SubmissionsApiDeleteImageCropResponse, SubmissionsApiGetSubmissionData, SubmissionsApiGetSubmissionResponse, SubmissionsApiListAvailableScopesData, SubmissionsApiListAvailableScopesError, SubmissionsApiListAvailableScopesResponse, SubmissionsApiListMyScopesData, SubmissionsApiListMyScopesError, SubmissionsApiListMyScopesResponse, SubmissionsApiListSubmissionsByGameData, SubmissionsApiListSubmissionsByGameResponse, SubmissionsApiListUserSubmissionsData, SubmissionsApiListUserSubmissionsError, SubmissionsApiListUserSubmissionsResponse, SubmissionsApiProcessCropOcrData, SubmissionsApiProcessCropOcrResponse, SubmissionsApiProcessFileOcrData, SubmissionsApiProcessFileOcrResponse } from '../types.gen';
|
|
|
|
|
|
|
|
|
|
export type QueryKey<TOptions extends Options> = [
|
|
|
|
|
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
|
|
|
|
_id: string;
|
|
|
|
|
_infinite?: boolean;
|
|
|
|
|
tags?: ReadonlyArray<string>;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
|
|
|
|
|
QueryKey<TOptions>[0]
|
|
|
|
|
] => {
|
|
|
|
|
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0];
|
|
|
|
|
if (infinite) {
|
|
|
|
|
params._infinite = infinite;
|
|
|
|
|
}
|
|
|
|
|
if (tags) {
|
|
|
|
|
params.tags = tags;
|
|
|
|
|
}
|
|
|
|
|
if (options?.body) {
|
|
|
|
|
params.body = options.body;
|
|
|
|
|
}
|
|
|
|
|
if (options?.headers) {
|
|
|
|
|
params.headers = options.headers;
|
|
|
|
|
}
|
|
|
|
|
if (options?.path) {
|
|
|
|
|
params.path = options.path;
|
|
|
|
|
}
|
|
|
|
|
if (options?.query) {
|
|
|
|
|
params.query = options.query;
|
|
|
|
|
}
|
|
|
|
|
return [params];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const polylanSubmitterApiHealthCheckQueryKey = (options?: Options<PolylanSubmitterApiHealthCheckData>) => createQueryKey('polylanSubmitterApiHealthCheck', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Health Check
|
|
|
|
|
*
|
|
|
|
|
* Health check endpoint
|
|
|
|
|
*/
|
|
|
|
|
export const polylanSubmitterApiHealthCheckOptions = (options?: Options<PolylanSubmitterApiHealthCheckData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof polylanSubmitterApiHealthCheckQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await polylanSubmitterApiHealthCheck({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: polylanSubmitterApiHealthCheckQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Clear Cache
|
|
|
|
|
*
|
|
|
|
|
* Clear API caches (admin only). Pass event_path to clear just that event's keys.
|
|
|
|
|
*/
|
|
|
|
|
export const polylanSubmitterApiClearCacheMutation = (options?: Partial<Options<PolylanSubmitterApiClearCacheData>>): UseMutationOptions<unknown, DefaultError, Options<PolylanSubmitterApiClearCacheData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PolylanSubmitterApiClearCacheData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await polylanSubmitterApiClearCache({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const polylanSubmitterApiGetUserInfoQueryKey = (options?: Options<PolylanSubmitterApiGetUserInfoData>) => createQueryKey('polylanSubmitterApiGetUserInfo', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get User Info
|
|
|
|
|
*
|
|
|
|
|
* Get current user information
|
|
|
|
|
*/
|
|
|
|
|
export const polylanSubmitterApiGetUserInfoOptions = (options?: Options<PolylanSubmitterApiGetUserInfoData>) => queryOptions<PolylanSubmitterApiGetUserInfoResponse, DefaultError, PolylanSubmitterApiGetUserInfoResponse, ReturnType<typeof polylanSubmitterApiGetUserInfoQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await polylanSubmitterApiGetUserInfo({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: polylanSubmitterApiGetUserInfoQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const gamesApiListGamesQueryKey = (options?: Options<GamesApiListGamesData>) => createQueryKey('gamesApiListGames', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Games
|
|
|
|
|
*/
|
|
|
|
|
export const gamesApiListGamesOptions = (options?: Options<GamesApiListGamesData>) => queryOptions<GamesApiListGamesResponse, DefaultError, GamesApiListGamesResponse, ReturnType<typeof gamesApiListGamesQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await gamesApiListGames({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: gamesApiListGamesQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiListPuzzlesQueryKey = (options: Options<OpusMagnumApiListPuzzlesData>) => createQueryKey('opusMagnumApiListPuzzles', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Puzzles
|
|
|
|
|
*
|
|
|
|
|
* Get list of available puzzles
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiListPuzzlesOptions = (options: Options<OpusMagnumApiListPuzzlesData>) => queryOptions<OpusMagnumApiListPuzzlesResponse, DefaultError, OpusMagnumApiListPuzzlesResponse, ReturnType<typeof opusMagnumApiListPuzzlesQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await opusMagnumApiListPuzzles({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiListPuzzlesQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiGetCollectionQueryKey = (options: Options<OpusMagnumApiGetCollectionData>) => createQueryKey('opusMagnumApiGetCollection', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Collection
|
|
|
|
|
*
|
|
|
|
|
* Get the active collection details
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiGetCollectionOptions = (options: Options<OpusMagnumApiGetCollectionData>) => queryOptions<OpusMagnumApiGetCollectionResponse, DefaultError, OpusMagnumApiGetCollectionResponse, ReturnType<typeof opusMagnumApiGetCollectionQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await opusMagnumApiGetCollection({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiGetCollectionQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiListSubmissionsQueryKey = (options: Options<OpusMagnumApiListSubmissionsData>) => createQueryKey('opusMagnumApiListSubmissions', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Submissions
|
|
|
|
|
*
|
|
|
|
|
* Get paginated list of submissions
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiListSubmissionsOptions = (options: Options<OpusMagnumApiListSubmissionsData>) => queryOptions<OpusMagnumApiListSubmissionsResponse, DefaultError, OpusMagnumApiListSubmissionsResponse, ReturnType<typeof opusMagnumApiListSubmissionsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await opusMagnumApiListSubmissions({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiListSubmissionsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const createInfiniteParams = <K extends Pick<QueryKey<Options>[0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey<Options>, page: K) => {
|
|
|
|
|
const params = { ...queryKey[0] };
|
|
|
|
|
if (page.body) {
|
|
|
|
|
params.body = {
|
|
|
|
|
...queryKey[0].body as any,
|
|
|
|
|
...page.body as any
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (page.headers) {
|
|
|
|
|
params.headers = {
|
|
|
|
|
...queryKey[0].headers,
|
|
|
|
|
...page.headers
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (page.path) {
|
|
|
|
|
params.path = {
|
|
|
|
|
...queryKey[0].path as any,
|
|
|
|
|
...page.path as any
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (page.query) {
|
|
|
|
|
params.query = {
|
|
|
|
|
...queryKey[0].query as any,
|
|
|
|
|
...page.query as any
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return params as unknown as typeof page;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiListSubmissionsInfiniteQueryKey = (options: Options<OpusMagnumApiListSubmissionsData>): QueryKey<Options<OpusMagnumApiListSubmissionsData>> => createQueryKey('opusMagnumApiListSubmissions', options, true);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Submissions
|
|
|
|
|
*
|
|
|
|
|
* Get paginated list of submissions
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiListSubmissionsInfiniteOptions = (options: Options<OpusMagnumApiListSubmissionsData>) => infiniteQueryOptions<OpusMagnumApiListSubmissionsResponse, DefaultError, InfiniteData<OpusMagnumApiListSubmissionsResponse>, QueryKey<Options<OpusMagnumApiListSubmissionsData>>, number | Pick<QueryKey<Options<OpusMagnumApiListSubmissionsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
{
|
|
|
|
|
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
const page: Pick<QueryKey<Options<OpusMagnumApiListSubmissionsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
|
|
|
query: {
|
|
|
|
|
offset: pageParam
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const params = createInfiniteParams(queryKey, page);
|
|
|
|
|
const { data } = await opusMagnumApiListSubmissions({
|
|
|
|
|
...options,
|
|
|
|
|
...params,
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiListSubmissionsInfiniteQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create Submission
|
|
|
|
|
*
|
|
|
|
|
* Create a new submission with multiple puzzle responses
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiCreateSubmissionMutation = (options?: Partial<Options<OpusMagnumApiCreateSubmissionData>>): UseMutationOptions<OpusMagnumApiCreateSubmissionResponse, DefaultError, Options<OpusMagnumApiCreateSubmissionData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<OpusMagnumApiCreateSubmissionResponse, DefaultError, Options<OpusMagnumApiCreateSubmissionData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await opusMagnumApiCreateSubmission({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete Submission
|
|
|
|
|
*
|
|
|
|
|
* Delete a submission (admin only)
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiDeleteSubmissionMutation = (options?: Partial<Options<OpusMagnumApiDeleteSubmissionData>>): UseMutationOptions<unknown, DefaultError, Options<OpusMagnumApiDeleteSubmissionData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<OpusMagnumApiDeleteSubmissionData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await opusMagnumApiDeleteSubmission({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiGetSubmissionQueryKey = (options: Options<OpusMagnumApiGetSubmissionData>) => createQueryKey('opusMagnumApiGetSubmission', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Submission
|
|
|
|
|
*
|
|
|
|
|
* Get detailed submission by ID
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiGetSubmissionOptions = (options: Options<OpusMagnumApiGetSubmissionData>) => queryOptions<OpusMagnumApiGetSubmissionResponse, DefaultError, OpusMagnumApiGetSubmissionResponse, ReturnType<typeof opusMagnumApiGetSubmissionQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await opusMagnumApiGetSubmission({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiGetSubmissionQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Validate Response
|
|
|
|
|
*
|
|
|
|
|
* Manually validate a puzzle response
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiValidateResponseMutation = (options?: Partial<Options<OpusMagnumApiValidateResponseData>>): UseMutationOptions<OpusMagnumApiValidateResponseResponse, DefaultError, Options<OpusMagnumApiValidateResponseData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<OpusMagnumApiValidateResponseResponse, DefaultError, Options<OpusMagnumApiValidateResponseData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await opusMagnumApiValidateResponse({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Validate Auto
|
|
|
|
|
*
|
|
|
|
|
* Try to auto validate a puzzle response
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiValidateAutoMutation = (options?: Partial<Options<OpusMagnumApiValidateAutoData>>): UseMutationOptions<OpusMagnumApiValidateAutoResponse, DefaultError, Options<OpusMagnumApiValidateAutoData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<OpusMagnumApiValidateAutoResponse, DefaultError, Options<OpusMagnumApiValidateAutoData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await opusMagnumApiValidateAuto({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiListResponsesNeedingValidationQueryKey = (options: Options<OpusMagnumApiListResponsesNeedingValidationData>) => createQueryKey('opusMagnumApiListResponsesNeedingValidation', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Responses Needing Validation
|
|
|
|
|
*
|
|
|
|
|
* Get all responses that need manual validation
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiListResponsesNeedingValidationOptions = (options: Options<OpusMagnumApiListResponsesNeedingValidationData>) => queryOptions<OpusMagnumApiListResponsesNeedingValidationResponse, DefaultError, OpusMagnumApiListResponsesNeedingValidationResponse, ReturnType<typeof opusMagnumApiListResponsesNeedingValidationQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await opusMagnumApiListResponsesNeedingValidation({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiListResponsesNeedingValidationQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Validate Submission
|
|
|
|
|
*
|
|
|
|
|
* Mark entire submission as validated
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiValidateSubmissionMutation = (options?: Partial<Options<OpusMagnumApiValidateSubmissionData>>): UseMutationOptions<OpusMagnumApiValidateSubmissionResponse, DefaultError, Options<OpusMagnumApiValidateSubmissionData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<OpusMagnumApiValidateSubmissionResponse, DefaultError, Options<OpusMagnumApiValidateSubmissionData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await opusMagnumApiValidateSubmission({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const opusMagnumApiGetStatsQueryKey = (options: Options<OpusMagnumApiGetStatsData>) => createQueryKey('opusMagnumApiGetStats', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Stats
|
|
|
|
|
*
|
|
|
|
|
* Get submission statistics
|
|
|
|
|
*/
|
|
|
|
|
export const opusMagnumApiGetStatsOptions = (options: Options<OpusMagnumApiGetStatsData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof opusMagnumApiGetStatsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await opusMagnumApiGetStats({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: opusMagnumApiGetStatsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const animationsApiResultsQueryKey = (options: Options<AnimationsApiResultsData>) => createQueryKey('animationsApiResults', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Results
|
|
|
|
|
*/
|
|
|
|
|
export const animationsApiResultsOptions = (options: Options<AnimationsApiResultsData>) => queryOptions<AnimationsApiResultsResponse, DefaultError, AnimationsApiResultsResponse, ReturnType<typeof animationsApiResultsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await animationsApiResults({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: animationsApiResultsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const animationsApiTopSubmissionsQueryKey = (options: Options<AnimationsApiTopSubmissionsData>) => createQueryKey('animationsApiTopSubmissions', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Top Submissions
|
|
|
|
|
*
|
|
|
|
|
* Get tournament top submissions for each puzzle. Only available when tournament is closed.
|
|
|
|
|
*/
|
|
|
|
|
export const animationsApiTopSubmissionsOptions = (options: Options<AnimationsApiTopSubmissionsData>) => queryOptions<AnimationsApiTopSubmissionsResponse, DefaultError, AnimationsApiTopSubmissionsResponse, ReturnType<typeof animationsApiTopSubmissionsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await animationsApiTopSubmissions({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: animationsApiTopSubmissionsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const animationsApiPuzzleResultsQueryKey = (options: Options<AnimationsApiPuzzleResultsData>) => createQueryKey('animationsApiPuzzleResults', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Puzzle Results
|
|
|
|
|
*
|
|
|
|
|
* Get tournament results organized by puzzle with coefficients. Only available when tournament is closed.
|
|
|
|
|
*/
|
|
|
|
|
export const animationsApiPuzzleResultsOptions = (options: Options<AnimationsApiPuzzleResultsData>) => queryOptions<AnimationsApiPuzzleResultsResponse, DefaultError, AnimationsApiPuzzleResultsResponse, ReturnType<typeof animationsApiPuzzleResultsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await animationsApiPuzzleResults({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: animationsApiPuzzleResultsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const noitaApiGetResultsQueryKey = (options: Options<NoitaApiGetResultsData>) => createQueryKey('noitaApiGetResults', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Results
|
|
|
|
|
*/
|
|
|
|
|
export const noitaApiGetResultsOptions = (options: Options<NoitaApiGetResultsData>) => queryOptions<NoitaApiGetResultsResponse, DefaultError, NoitaApiGetResultsResponse, ReturnType<typeof noitaApiGetResultsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await noitaApiGetResults({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: noitaApiGetResultsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const noitaApiGetLeaderboardQueryKey = (options: Options<NoitaApiGetLeaderboardData>) => createQueryKey('noitaApiGetLeaderboard', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Leaderboard
|
|
|
|
|
*
|
|
|
|
|
* Get the global leaderboard for all users ranked by total score.
|
|
|
|
|
*
|
|
|
|
|
* Uses Window functions to rank users by their total score in descending order.
|
|
|
|
|
*/
|
|
|
|
|
export const noitaApiGetLeaderboardOptions = (options: Options<NoitaApiGetLeaderboardData>) => queryOptions<NoitaApiGetLeaderboardResponse, DefaultError, NoitaApiGetLeaderboardResponse, ReturnType<typeof noitaApiGetLeaderboardQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await noitaApiGetLeaderboard({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: noitaApiGetLeaderboardQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Submit Log File
|
|
|
|
|
*
|
|
|
|
|
* Submit a Noita run file (log file, screenshot, or video).
|
|
|
|
|
*
|
|
|
|
|
* Accepts:
|
|
|
|
|
* - Text files (.txt) for polylan_mod_log.txt
|
|
|
|
|
* - Images (.png, .jpg, .gif)
|
|
|
|
|
* - Videos (.mp4, .webm)
|
|
|
|
|
*
|
|
|
|
|
* Max file size: 256 MB
|
|
|
|
|
*/
|
|
|
|
|
export const noitaApiSubmitLogFileMutation = (options?: Partial<Options<NoitaApiSubmitLogFileData>>): UseMutationOptions<NoitaApiSubmitLogFileResponse, NoitaApiSubmitLogFileError, Options<NoitaApiSubmitLogFileData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<NoitaApiSubmitLogFileResponse, NoitaApiSubmitLogFileError, Options<NoitaApiSubmitLogFileData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await noitaApiSubmitLogFile({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const gamesApiListEventGamesQueryKey = (options: Options<GamesApiListEventGamesData>) => createQueryKey('gamesApiListEventGames', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Event Games
|
|
|
|
|
*/
|
|
|
|
|
export const gamesApiListEventGamesOptions = (options: Options<GamesApiListEventGamesData>) => queryOptions<GamesApiListEventGamesResponse, DefaultError, GamesApiListEventGamesResponse, ReturnType<typeof gamesApiListEventGamesQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await gamesApiListEventGames({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: gamesApiListEventGamesQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const gamesApiListEventSteamGamesQueryKey = (options: Options<GamesApiListEventSteamGamesData>) => createQueryKey('gamesApiListEventSteamGames', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Event Steam Games
|
|
|
|
|
*
|
|
|
|
|
* The event's Steam games with their store info (price, discount, blurb).
|
|
|
|
|
*/
|
|
|
|
|
export const gamesApiListEventSteamGamesOptions = (options: Options<GamesApiListEventSteamGamesData>) => queryOptions<GamesApiListEventSteamGamesResponse, DefaultError, GamesApiListEventSteamGamesResponse, ReturnType<typeof gamesApiListEventSteamGamesQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await gamesApiListEventSteamGames({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: gamesApiListEventSteamGamesQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const submissionsApiListMyScopesQueryKey = (options: Options<SubmissionsApiListMyScopesData>) => createQueryKey('submissionsApiListMyScopes', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List My Scopes
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiListMyScopesOptions = (options: Options<SubmissionsApiListMyScopesData>) => queryOptions<SubmissionsApiListMyScopesResponse, SubmissionsApiListMyScopesError, SubmissionsApiListMyScopesResponse, ReturnType<typeof submissionsApiListMyScopesQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await submissionsApiListMyScopes({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: submissionsApiListMyScopesQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const submissionsApiListAvailableScopesQueryKey = (options: Options<SubmissionsApiListAvailableScopesData>) => createQueryKey('submissionsApiListAvailableScopes', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Available Scopes
|
|
|
|
|
*
|
|
|
|
|
* Scopes the current user may submit to for this game - superusers see
|
|
|
|
|
* every active scope, everyone else only the ones assigned to them. Used
|
|
|
|
|
* by the submissions-select and submissions-detail pages, both to list
|
|
|
|
|
* scopes and (for the detail page) to confirm the requested scope_id is
|
|
|
|
|
* one the current user is actually allowed to see.
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiListAvailableScopesOptions = (options: Options<SubmissionsApiListAvailableScopesData>) => queryOptions<SubmissionsApiListAvailableScopesResponse, SubmissionsApiListAvailableScopesError, SubmissionsApiListAvailableScopesResponse, ReturnType<typeof submissionsApiListAvailableScopesQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await submissionsApiListAvailableScopes({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: submissionsApiListAvailableScopesQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create Submission
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiCreateSubmissionMutation = (options?: Partial<Options<SubmissionsApiCreateSubmissionData>>): UseMutationOptions<SubmissionsApiCreateSubmissionResponse, SubmissionsApiCreateSubmissionError, Options<SubmissionsApiCreateSubmissionData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<SubmissionsApiCreateSubmissionResponse, SubmissionsApiCreateSubmissionError, Options<SubmissionsApiCreateSubmissionData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await submissionsApiCreateSubmission({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const submissionsApiListUserSubmissionsQueryKey = (options: Options<SubmissionsApiListUserSubmissionsData>) => createQueryKey('submissionsApiListUserSubmissions', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List User Submissions
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiListUserSubmissionsOptions = (options: Options<SubmissionsApiListUserSubmissionsData>) => queryOptions<SubmissionsApiListUserSubmissionsResponse, SubmissionsApiListUserSubmissionsError, SubmissionsApiListUserSubmissionsResponse, ReturnType<typeof submissionsApiListUserSubmissionsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await submissionsApiListUserSubmissions({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: submissionsApiListUserSubmissionsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const submissionsApiListSubmissionsByGameQueryKey = (options: Options<SubmissionsApiListSubmissionsByGameData>) => createQueryKey('submissionsApiListSubmissionsByGame', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Submissions By Game
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiListSubmissionsByGameOptions = (options: Options<SubmissionsApiListSubmissionsByGameData>) => queryOptions<SubmissionsApiListSubmissionsByGameResponse, DefaultError, SubmissionsApiListSubmissionsByGameResponse, ReturnType<typeof submissionsApiListSubmissionsByGameQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await submissionsApiListSubmissionsByGame({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: submissionsApiListSubmissionsByGameQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const submissionsApiGetSubmissionQueryKey = (options: Options<SubmissionsApiGetSubmissionData>) => createQueryKey('submissionsApiGetSubmission', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Submission
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiGetSubmissionOptions = (options: Options<SubmissionsApiGetSubmissionData>) => queryOptions<SubmissionsApiGetSubmissionResponse, DefaultError, SubmissionsApiGetSubmissionResponse, ReturnType<typeof submissionsApiGetSubmissionQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await submissionsApiGetSubmission({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: submissionsApiGetSubmissionQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create Image Crop
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiCreateImageCropMutation = (options?: Partial<Options<SubmissionsApiCreateImageCropData>>): UseMutationOptions<SubmissionsApiCreateImageCropResponse, DefaultError, Options<SubmissionsApiCreateImageCropData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<SubmissionsApiCreateImageCropResponse, DefaultError, Options<SubmissionsApiCreateImageCropData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await submissionsApiCreateImageCrop({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete Image Crop
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiDeleteImageCropMutation = (options?: Partial<Options<SubmissionsApiDeleteImageCropData>>): UseMutationOptions<SubmissionsApiDeleteImageCropResponse, DefaultError, Options<SubmissionsApiDeleteImageCropData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<SubmissionsApiDeleteImageCropResponse, DefaultError, Options<SubmissionsApiDeleteImageCropData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await submissionsApiDeleteImageCrop({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Process File Ocr
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiProcessFileOcrMutation = (options?: Partial<Options<SubmissionsApiProcessFileOcrData>>): UseMutationOptions<SubmissionsApiProcessFileOcrResponse, DefaultError, Options<SubmissionsApiProcessFileOcrData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<SubmissionsApiProcessFileOcrResponse, DefaultError, Options<SubmissionsApiProcessFileOcrData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await submissionsApiProcessFileOcr({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Process Crop Ocr
|
|
|
|
|
*/
|
|
|
|
|
export const submissionsApiProcessCropOcrMutation = (options?: Partial<Options<SubmissionsApiProcessCropOcrData>>): UseMutationOptions<SubmissionsApiProcessCropOcrResponse, DefaultError, Options<SubmissionsApiProcessCropOcrData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<SubmissionsApiProcessCropOcrResponse, DefaultError, Options<SubmissionsApiProcessCropOcrData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await submissionsApiProcessCropOcr({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const clockApiCurrentStateQueryKey = (options: Options<ClockApiCurrentStateData>) => createQueryKey('clockApiCurrentState', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Current State
|
|
|
|
|
*/
|
|
|
|
|
export const clockApiCurrentStateOptions = (options: Options<ClockApiCurrentStateData>) => queryOptions<ClockApiCurrentStateResponse, DefaultError, ClockApiCurrentStateResponse, ReturnType<typeof clockApiCurrentStateQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await clockApiCurrentState({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: clockApiCurrentStateQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const clockApiMyStatsQueryKey = (options: Options<ClockApiMyStatsData>) => createQueryKey('clockApiMyStats', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* My Stats
|
|
|
|
|
*/
|
|
|
|
|
export const clockApiMyStatsOptions = (options: Options<ClockApiMyStatsData>) => queryOptions<ClockApiMyStatsResponse, DefaultError, ClockApiMyStatsResponse, ReturnType<typeof clockApiMyStatsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await clockApiMyStats({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: clockApiMyStatsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const placeApiCanvasQueryKey = (options: Options<PlaceApiCanvasData>) => createQueryKey('placeApiCanvas', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Canvas
|
|
|
|
|
*
|
|
|
|
|
* The one-time full-grid load. Every placement after that arrives as a
|
|
|
|
|
* single websocket message, never a re-fetch.
|
|
|
|
|
*/
|
|
|
|
|
export const placeApiCanvasOptions = (options: Options<PlaceApiCanvasData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof placeApiCanvasQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await placeApiCanvas({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: placeApiCanvasQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const placeApiEvolutionGifQueryKey = (options: Options<PlaceApiEvolutionGifData>) => createQueryKey('placeApiEvolutionGif', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Evolution Gif
|
|
|
|
|
*
|
|
|
|
|
* Admin-only: replays the full placement history as an animated GIF.
|
|
|
|
|
*/
|
|
|
|
|
export const placeApiEvolutionGifOptions = (options: Options<PlaceApiEvolutionGifData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof placeApiEvolutionGifQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await placeApiEvolutionGif({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: placeApiEvolutionGifQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const marketApiListMarketsQueryKey = (options: Options<MarketApiListMarketsData>) => createQueryKey('marketApiListMarkets', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Markets
|
|
|
|
|
*
|
|
|
|
|
* List all markets (excludes draft markets).
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiListMarketsOptions = (options: Options<MarketApiListMarketsData>) => queryOptions<MarketApiListMarketsResponse, DefaultError, MarketApiListMarketsResponse, ReturnType<typeof marketApiListMarketsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await marketApiListMarkets({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: marketApiListMarketsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const marketApiListUserBetsQueryKey = (options: Options<MarketApiListUserBetsData>) => createQueryKey('marketApiListUserBets', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List User Bets
|
|
|
|
|
*
|
|
|
|
|
* List all bets placed by the current user.
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiListUserBetsOptions = (options: Options<MarketApiListUserBetsData>) => queryOptions<MarketApiListUserBetsResponse, DefaultError, MarketApiListUserBetsResponse, ReturnType<typeof marketApiListUserBetsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await marketApiListUserBets({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: marketApiListUserBetsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const marketApiGetUserPointsQueryKey = (options: Options<MarketApiGetUserPointsData>) => createQueryKey('marketApiGetUserPoints', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get User Points
|
|
|
|
|
*
|
|
|
|
|
* Get the current user's points balance for this event.
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiGetUserPointsOptions = (options: Options<MarketApiGetUserPointsData>) => queryOptions<MarketApiGetUserPointsResponse, DefaultError, MarketApiGetUserPointsResponse, ReturnType<typeof marketApiGetUserPointsQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await marketApiGetUserPoints({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: marketApiGetUserPointsQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const marketApiBetHistoryQueryKey = (options: Options<MarketApiBetHistoryData>) => createQueryKey('marketApiBetHistory', options);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bet History
|
|
|
|
|
*
|
|
|
|
|
* Points added to each option over time (anonymous, one entry per bet placed/increased).
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiBetHistoryOptions = (options: Options<MarketApiBetHistoryData>) => queryOptions<MarketApiBetHistoryResponse, DefaultError, MarketApiBetHistoryResponse, ReturnType<typeof marketApiBetHistoryQueryKey>>({
|
|
|
|
|
queryFn: async ({ queryKey, signal }) => {
|
|
|
|
|
const { data } = await marketApiBetHistory({
|
|
|
|
|
...options,
|
|
|
|
|
...queryKey[0],
|
|
|
|
|
signal,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
},
|
|
|
|
|
queryKey: marketApiBetHistoryQueryKey(options)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Close Market
|
|
|
|
|
*
|
|
|
|
|
* Close a market. Admin only.
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiCloseMarketMutation = (options?: Partial<Options<MarketApiCloseMarketData>>): UseMutationOptions<unknown, DefaultError, Options<MarketApiCloseMarketData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<MarketApiCloseMarketData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await marketApiCloseMarket({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Resolve Market
|
|
|
|
|
*
|
|
|
|
|
* Resolve a market with a winning option. Admin only.
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiResolveMarketMutation = (options?: Partial<Options<MarketApiResolveMarketData>>): UseMutationOptions<MarketApiResolveMarketResponse, DefaultError, Options<MarketApiResolveMarketData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<MarketApiResolveMarketResponse, DefaultError, Options<MarketApiResolveMarketData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await marketApiResolveMarket({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create Bet
|
|
|
|
|
*
|
|
|
|
|
* Place a bet on a market option.
|
|
|
|
|
*/
|
|
|
|
|
export const marketApiCreateBetMutation = (options?: Partial<Options<MarketApiCreateBetData>>): UseMutationOptions<MarketApiCreateBetResponse, DefaultError, Options<MarketApiCreateBetData>> => {
|
|
|
|
|
const mutationOptions: UseMutationOptions<MarketApiCreateBetResponse, DefaultError, Options<MarketApiCreateBetData>> = {
|
|
|
|
|
mutationFn: async (fnOptions) => {
|
|
|
|
|
const { data } = await marketApiCreateBet({
|
|
|
|
|
...options,
|
|
|
|
|
...fnOptions,
|
|
|
|
|
throwOnError: true
|
|
|
|
|
});
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return mutationOptions;
|
|
|
|
|
};
|