riotapi-fetch-typed 1.2.2-dev → 1.2.3-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,132 @@
1
+ import { a as webhooks, i as paths, n as components, r as operations, t as $defs } from "./openapi-BkMGeXC5.d.mts";
2
+ //#region src/index.ts
3
+ /**
4
+ * Error Class for a 4xx/5xx response code in a fetch to the Riot API
5
+ */
6
+ var RiotError = class extends Error {
7
+ constructor(message, statusCode, data) {
8
+ super(message);
9
+ this.statusCode = statusCode;
10
+ this.data = data;
11
+ }
12
+ statusCode;
13
+ data;
14
+ };
15
+ /**
16
+ * Type guard to check if an object is in the form of an riot error.
17
+ * The API may return a structure like that on error, but we cannot be sure.
18
+ *
19
+ * @param obj obj to be checked
20
+ * @returns true if obj has the form of RiotErroData
21
+ */
22
+ function isRiotErrorData(obj) {
23
+ if (typeof obj !== "object" || obj === null) return false;
24
+ const data = obj;
25
+ if (data.status !== void 0) {
26
+ if (typeof data.status !== "object") return false;
27
+ if ("status_code" in data.status && typeof data.status.status_code !== "number") return false;
28
+ if ("message" in data.status && typeof data.status.message !== "string") return false;
29
+ }
30
+ return true;
31
+ }
32
+ /**
33
+ * Creates a new function that basically wraps the provided fetch function to provide type information.
34
+ *
35
+ * @param {CreateRiotFetchOptions} createRiotFetchOptions Options for the createRiotFetch function
36
+ * @param defaultOptions Options that get passed to the fetch function by default
37
+ * @returns A fetch function to get fetch the Riot Games API type-safe
38
+ */
39
+ function createRiotFetch({ apiKey, fetchFn = fetch, baseUrl = (region) => `https://${region}.api.riotgames.com/`, throwOnResponseError = false }, defaultOptions = {}) {
40
+ const headers = new Headers(defaultOptions.headers);
41
+ headers.append("X-Riot-Token", apiKey);
42
+ headers.append("Content-Type", "application/json");
43
+ defaultOptions.headers = headers;
44
+ /**
45
+ * A functions that can be used to fetch the Riot Games API with already defined defaults and type information
46
+ * based on it's OpenAPI specification.
47
+ *
48
+ * @template Path The literal type of the path, inferred by `request`
49
+ * @template UsableMethods All Methods that can be selected, used to autocomplete `method`
50
+ * @template ChosenMethod The method
51
+ * @param request The path of the resource requested. Gets merged using `URL`
52
+ * @returns Response Object, a promise for the return body, depending on Path, Method and Status Code and an error indicator
53
+ * @throws { RiotError } if `throwOnResponseError = true` and !response.ok
54
+ */
55
+ return async (request, options) => {
56
+ const baseURL = baseUrl(options.region);
57
+ const req = new URL(request, baseURL);
58
+ if (options.query) for (const [key, value] of Object.entries(options.query)) req.searchParams.set(key, String(value));
59
+ const response = await fetchFn(req, {
60
+ ...defaultOptions,
61
+ ...options,
62
+ body: JSON.stringify(options.body)
63
+ });
64
+ if (!response.ok) {
65
+ const riotErrorData = await response.json().then((obj) => isRiotErrorData(obj) ? obj : void 0).catch(() => void 0);
66
+ if (throwOnResponseError) throw new RiotError("Riot Games Fetch Error", response.status, riotErrorData);
67
+ return {
68
+ response,
69
+ data: riotErrorData,
70
+ error: true
71
+ };
72
+ }
73
+ return {
74
+ response,
75
+ data: await response.json(),
76
+ error: false
77
+ };
78
+ };
79
+ }
80
+ const Queues = {
81
+ CUSTOM: 0,
82
+ HEXAKILL: 75,
83
+ URF: [76, 1900],
84
+ AR_URF: 900,
85
+ ARAM: {
86
+ BUTCHERS_BRIDGE: 100,
87
+ HOWLING_ABYSS: 450,
88
+ ALL: [100, 450]
89
+ },
90
+ ALL_RANDOM: 325,
91
+ BLIND: 430,
92
+ DRAFT: 400,
93
+ QUICKPLAY: 490,
94
+ RANKED_SOLO: 420,
95
+ RANKED_FLEX: 440,
96
+ CLASH: {
97
+ SUMMONERS_RIFT: 700,
98
+ HOWLING_ABYSS: 720,
99
+ ARAM: 720,
100
+ ALL: [700, 720]
101
+ },
102
+ COOP_VS_AI: {
103
+ INTRO: 870,
104
+ BEGINNER: 880,
105
+ INTERMEDIATE: 890,
106
+ ALL: [
107
+ 870,
108
+ 880,
109
+ 890
110
+ ]
111
+ },
112
+ DOOM_BOTS: 960,
113
+ ONE_FOR_ALL: 1020,
114
+ NEXUS_BLITZ: 1300,
115
+ SPELLBOOK: 1400,
116
+ ARENA: [1700, 1710],
117
+ SWARM: [
118
+ 1810,
119
+ 1820,
120
+ 1830,
121
+ 1840
122
+ ],
123
+ TUTORIAL: [
124
+ 2e3,
125
+ 2010,
126
+ 2020
127
+ ]
128
+ };
129
+ //#endregion
130
+ export { $defs, Queues, RiotError, components, createRiotFetch, operations, paths, webhooks };
131
+
132
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { paths, components } from './types/openapi.d.js';\n\nexport * from './types/openapi.d.js';\n\n\n/** Every possible API path, based on the OpenAPI document */\nexport type Paths = keyof paths;\n\n/**\n * Type util that replaces all occurences of curly brackets pairs in a string literal type to string placeholders,\n * resulting in a template literal type. For that it recursively tests the string for curly bracket pairs.\n *\n * @example TemplatifyPath<'summoner/{summonerName}/ranked'> -> `summoner/${string}/ranked`\n */\nexport type TemplatifyPathRecursive<Path extends string> =\n\tPath extends `${infer Start}/{${string}}${infer End}`\n\t\t? `${Start}/${string}${TemplatifyPathRecursive<End>}`\n\t\t: Path;\n\n\n/** Every possible API path, but templatified */\nexport type TemplatePaths = TemplatifyPathRecursive<Paths>;\n\n/** Splits a Path by `/` into an array */\nexport type SplitPathRecursive<Path extends string> = Path extends `${infer Head}/${infer Tail}`\n\t? [Head, ...SplitPathRecursive<Tail>]\n\t: [Path];\n\nexport type SplitPath<Path extends string> =\n\tPath extends `${infer A}/${infer B}/${infer C}/${infer D}/${infer E}/${infer F}/${infer G}/${infer H}/${infer I}`\n\t\t? [A, B, C, D, E, F, G, H, I]\n\t\t: Path extends `${infer A}/${infer B}/${infer C}/${infer D}/${infer E}/${infer F}/${infer G}/${infer H}`\n\t\t\t? [A, B, C, D, E, F, G, H]\n\t\t\t: Path extends `${infer A}/${infer B}/${infer C}/${infer D}/${infer E}/${infer F}/${infer G}`\n\t\t\t\t? [A, B, C, D, E, F, G]\n\t\t\t\t: Path extends `${infer A}/${infer B}/${infer C}/${infer D}/${infer E}/${infer F}`\n\t\t\t\t\t? [A, B, C, D, E, F]\n\t\t\t\t\t: Path extends `${infer A}/${infer B}/${infer C}/${infer D}/${infer E}`\n\t\t\t\t\t\t? [A, B, C, D, E]\n\t\t\t\t\t\t: Path extends `${infer A}/${infer B}/${infer C}/${infer D}`\n\t\t\t\t\t\t\t? [A, B, C, D]\n\t\t\t\t\t\t\t: Path extends `${infer A}/${infer B}/${infer C}`\n\t\t\t\t\t\t\t\t? [A, B, C]\n\t\t\t\t\t\t\t\t: Path extends `${infer A}/${infer B}`\n\t\t\t\t\t\t\t\t\t? [A, B]\n\t\t\t\t\t\t\t\t\t: [Path];\n\n/**\n * Compares two splitted paths.\n *\n * Type is true if both splitted paths have the same length and every segment of Concrete extends its corresponding segment Template\n * */\nexport type MatchSegmentsRecursive<Template extends string[], Concrete extends string[]> =\n\tTemplate extends [infer TemplateSegment, ...infer TemplateRest]\n\t\t? Concrete extends [infer ConcreteSegment, ...infer ConcreteRest]\n\t\t\t? ConcreteSegment extends TemplateSegment\n\t\t\t\t? TemplateRest extends string[]\n\t\t\t\t\t? ConcreteRest extends string[]\n\t\t\t\t\t\t? MatchSegmentsRecursive<TemplateRest, ConcreteRest>\n\t\t\t\t\t\t: never\n\t\t\t\t\t: never\n\t\t\t\t: false\n\t\t\t: Concrete extends []\n\t\t\t\t? Template extends []\n\t\t\t\t\t? true\n\t\t\t\t\t: false\n\t\t\t\t: false\n\t\t: Template extends []\n\t\t\t? Concrete extends []\n\t\t\t\t? true\n\t\t\t\t: false\n\t\t\t: false;\n\nexport type MatchSegments<\n\tT extends [string?, string?, string?, string?, string?, string?, string?, string?, string?],\n\tC extends [string?, string?, string?, string?, string?, string?, string?, string?, string?]\n> =\n\tT['length'] extends C['length'] ? (\n\t\tC[0] extends T[0] ?\n\t\t\tC[1] extends T[1] ?\n\t\t\t\tC[2] extends T[2] ?\n\t\t\t\t\tC[3] extends T[3] ?\n\t\t\t\t\t\tC[4] extends T[4] ?\n\t\t\t\t\t\t\tC[5] extends T[5] ?\n\t\t\t\t\t\t\t\tC[6] extends T[6] ?\n\t\t\t\t\t\t\t\t\tC[7] extends T[7] ?\n\t\t\t\t\t\t\t\t\t\tC[8] extends T[8] ?\n\t\t\t\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\tfalse :\n\t\t\t\t\tfalse :\n\t\t\t\tfalse :\n\t\t\tfalse\n\t)\n\t\t: false;\n\n/**\n * Gives all API Paths that matches the path. Basically the reverse operation of TemplatifyPath\n *\n * @example ResolveTemplatePath<`/riot/account/v1/accounts/by-puuid/${string}`>\n * -> \"/riot/account/v1/accounts/by-puuid/{puuid}\"\n *\n * @example ResolveTemplatePath<`/riot/account/v1/accounts/by-riot-id/gameName/gameTag`>\n * -> \"/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}\"\n */\nexport type ResolveTemplatePath<Path extends TemplatePaths> = {\n\t[P in Paths]: MatchSegments<SplitPath<TemplatifyPathRecursive<P>>, SplitPath<Path>> extends true ? P : never\n}[Paths];\n\nexport type HTTPMethods = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';\n\n/**\n * Get all available methods for a specific API path\n */\nexport type Methods<Path extends Paths> = Exclude<keyof {\n\t[K in keyof paths[Path] as paths[Path][K] extends undefined ? never : K]: paths[Path][K]\n}, 'parameters'>;\n\n/** Get all possible responses for a specific API path and method */\nexport type GetResponses<Path extends Paths, Method extends Methods<Path>> =\n\tpaths[Path][Method] extends { responses: infer Responses }\n\t\t? Responses\n\t\t: never;\n\n\n/** Get the response body for a specific API path, method and status code */\nexport type GetResponseBody<Path extends Paths, Method extends Methods<Path>, StatusCode extends number> =\n\tGetResponses<Path, Method> extends Record<StatusCode, { content?: { 'application/json': infer Body } }>\n\t\t? Body\n\t\t: never;\n\n\nexport type GetRequestBody<Path extends Paths, Method extends Methods<Path>> =\n\tpaths[Path][Method] extends { requestBody?: never }\n\t\t? { body?: never }\n\t\t: paths[Path][Method] extends { requestBody: { content: { 'application/json': infer U } } }\n\t\t\t? { body: U }\n\t\t\t: paths[Path][Method] extends { requestBody?: { content: { 'application/json': infer U } } }\n\t\t\t\t? { body?: U }\n\t\t\t\t: unknown;\n\n\n/** Get the query parameters for a specific API path and method */\nexport type GetQuery<Path extends Paths, Method extends Methods<Path>> = Pick<paths[Path][Method]['parameters'], 'query'>;\n\n/** Regions for /riot/account/ endpoints */\nexport type AccountRegion = 'americas' | 'asia' | 'europe';\n/** Regions for some lol and tft endpoints */\nexport type LolRegion = 'br1' | 'eun1' | 'euw1' | 'jp1' | 'kr' | 'la1' | 'la2' | 'me1' | 'na1' | 'oc1' | 'ph2' | 'ru' | 'sg2' | 'th2' | 'tr1' | 'tw2' | 'vn2';\n/** Regions for lol and tft matches endpoints */\nexport type MatchRegion = 'americas' | 'asia' | 'europe' | 'sea';\n/** Regions for /lor/ endpoints */\nexport type LorRegion = 'americas' | 'europe' | 'sea';\n/** Regions for /val/ endpoints */\nexport type ValorantRegion = 'ap' | 'br' | 'eu' | 'latam' | 'na' | 'esports' | 'kr';\n\n\n/** Get the relevant subdomains, depending on the endpoint */\n// i dont like eslint indenting here\n/* eslint-disable @stylistic/indent */\nexport type GetSubdomain<Path extends TemplatePaths> =\n\tPath extends `/riot/account/${string}` ? AccountRegion :\n\tPath extends `/lol/champion-mastery/${string}` ? LolRegion :\n\tPath extends `/lol/platform/${string}` ? LolRegion :\n\tPath extends `/lol/clash/${string}` ? LolRegion :\n\tPath extends `/lol/league-exp/${string}` ? LolRegion :\n\tPath extends `/lol/league/${string}` ? LolRegion :\n\tPath extends `/lol/challenges/${string}` ? LolRegion :\n\tPath extends `/lol/rso-match/${string}` ? MatchRegion :\n\tPath extends `/lol/status/${string}` ? LolRegion :\n\tPath extends `/lor/deck/${string}` ? LorRegion :\n\tPath extends `/lor/inventory/${string}` ? LorRegion :\n\tPath extends `/lor/match/${string}` ? LorRegion | 'apac' :\n\tPath extends `/lor/ranked/${string}` ? LorRegion :\n\tPath extends `/lor/status/${string}` ? LorRegion :\n\tPath extends `/lol/match/${string}` ? MatchRegion :\n\tPath extends `/lol/spectator/${string}` ? LolRegion :\n\tPath extends `/fulfillment/${string}` ? LolRegion :\n\tPath extends `/lol/summoner/${string}` ? LolRegion :\n\tPath extends `/tft/league/${string}` ? LolRegion :\n\tPath extends `/tft/match/${string}` ? MatchRegion | 'esports' | 'esportseu' :\n\tPath extends `/tft/status/${string}` ? LolRegion :\n\tPath extends `/tft/summoner/${string}` ? LolRegion :\n\t// seems like only americas but not sure\n\tPath extends `/lol/tournament-stub/${string}` ? 'americas' :\n\t// don't know, can't see in api reference\n\tPath extends `/lol/tournament/${string}` ? LolRegion | MatchRegion :\n\t// The api docs do not include all regions for console, but for stability we will just include them\n\tPath extends `/val/match/console/${string}` ? ValorantRegion :\n\tPath extends `/val/console/ranked/${string}` ? ValorantRegion :\n\tPath extends `/val/content/${string}` ? ValorantRegion :\n\tPath extends `/val/match/${string}` ? ValorantRegion :\n\tPath extends `/val/ranked/${string}` ? ValorantRegion :\n\tPath extends `/val/status/${string}` ? Exclude<ValorantRegion, 'esports'>\n\t: never;\n/* eslint-enable @stylistic/indent */\n\n/** Typical structure for a RiotError json object. */\nexport type RiotErrorData = components['schemas']['Error'];\n\n/**\n * Error Class for a 4xx/5xx response code in a fetch to the Riot API\n */\nexport class RiotError extends Error {\n\tconstructor(message: string, statusCode: number, data?: RiotErrorData) {\n\t\tsuper(message);\n\t\tthis.statusCode = statusCode;\n\t\tthis.data = data;\n\t}\n\tstatusCode: number;\n\tdata: RiotErrorData | undefined;\n}\n\n/**\n * Type guard to check if an object is in the form of an riot error.\n * The API may return a structure like that on error, but we cannot be sure.\n *\n * @param obj obj to be checked\n * @returns true if obj has the form of RiotErroData\n */\nfunction isRiotErrorData(obj: unknown): obj is RiotErrorData {\n\tif (typeof obj !== 'object' || obj === null) return false;\n\n\tconst data = obj as RiotErrorData;\n\n\tif (data.status !== undefined) {\n\t\tif (typeof data.status !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ('status_code' in data.status && typeof data.status.status_code !== 'number')\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ('message' in data.status && typeof data.status.message !== 'string')\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n\n/**\n * This is a mess. I am sorry for this type abonimation.\n *\n * @template Path the Path of the API route\n * @template ChosenMethod the Method that is chosen, has to be one of the available methods of the Path\n * @template ThrowOnError Wether createRiotFetch is configured to throw on http errors or not\n * @template error response.ok, used for type narrowing\n */\nexport type RiotFetchReturn<\n\tPath extends TemplatePaths,\n\tChosenMethod extends Methods<ResolveTemplatePath<Path>>,\n\tThrowOnError extends boolean,\n\terror extends boolean,\n> = ThrowOnError extends true\n\t? error extends false\n\t\t? {\n\t\t\t/** The response object of the fetch */\n\t\t\tresponse: Response;\n\t\t\t/** Typed result of response.json() */\n\t\t\tdata: GetResponseBody<ResolveTemplatePath<Path>, ChosenMethod, 200>;\n\t\t}\n\t\t: never\n\t: error extends false\n\t\t? {\n\t\t\t/** The response object of the fetch */\n\t\t\tresponse: Response;\n\t\t\t/** Typed result of response.json() or eventual error data */\n\t\t\tdata: GetResponseBody<ResolveTemplatePath<Path>, ChosenMethod, 200>;\n\t\t\t/** Wether the fetch errored */\n\t\t\terror: false;\n\t\t}\n\t\t: {\n\t\t\t/** The response object of the fetch */\n\t\t\tresponse: Response;\n\t\t\t/** Typed result of response.json() or eventual error data */\n\t\t\tdata:RiotErrorData | undefined;\n\t\t\t/** Wether the fetch errored */\n\t\t\terror: true;\n\t\t};\n\n/**\n * Options for the createRiotFetch functions\n * @template FetchOptions Options the fetch function can accept\n * @template ThrowOnError We set throwOnResponseError as a generic literal boolean, so that we can better type it\n */\nexport interface CreateRiotFetchOptions<FetchOptions, ThrowOnError extends boolean> {\n\t/** The Api Key obtained from Riot Games */\n\tapiKey: string\n\t/** fetch function that gets called (default: `undici.fetch`) */\n\tfetchFn?: (request: URL | RequestInfo, fetchOptions: FetchOptions) => Promise<Response>\n\t/** Function for dynamically creating the base url based on the given region. (default: standard riot api) */\n\tbaseUrl?: (region: string) => string,\n\t/**\n\t * Wether on 4xx/5xx response status the fetch should error or set error = true and include eventual error data in data\n\t * @see RiotError\n\t */\n\tthrowOnResponseError?: ThrowOnError,\n}\n\n/**\n * Basic Fetch Options that are essential for the functioning of createRiotFetch\n */\nexport interface BaseFetchOptions {\n\tmethod?: HTTPMethods,\n\theaders?: Headers,\n}\n\n/**\n * Creates a new function that basically wraps the provided fetch function to provide type information.\n *\n * @param {CreateRiotFetchOptions} createRiotFetchOptions Options for the createRiotFetch function\n * @param defaultOptions Options that get passed to the fetch function by default\n * @returns A fetch function to get fetch the Riot Games API type-safe\n */\nexport function createRiotFetch<\n\tFetchOptions extends BaseFetchOptions & Record<string, unknown>,\n\tThrowOnError extends boolean = false\n>(\n\t{\n\t\tapiKey,\n\t\tfetchFn = fetch,\n\t\tbaseUrl = (region: string) => `https://${region}.api.riotgames.com/`,\n\t\tthrowOnResponseError = false as ThrowOnError\n\t}: CreateRiotFetchOptions<FetchOptions & { body?: BodyInit }, ThrowOnError>,\n\tdefaultOptions: FetchOptions = {} as FetchOptions\n) {\n\tconst headers = new Headers(defaultOptions.headers);\n\theaders.append('X-Riot-Token', apiKey);\n\theaders.append('Content-Type', 'application/json');\n\tdefaultOptions.headers = headers;\n\n\t/**\n\t * A functions that can be used to fetch the Riot Games API with already defined defaults and type information\n\t * based on it's OpenAPI specification.\n\t *\n\t * @template Path The literal type of the path, inferred by `request`\n\t * @template UsableMethods All Methods that can be selected, used to autocomplete `method`\n\t * @template ChosenMethod The method\n\t * @param request The path of the resource requested. Gets merged using `URL`\n\t * @returns Response Object, a promise for the return body, depending on Path, Method and Status Code and an error indicator\n\t * @throws { RiotError } if `throwOnResponseError = true` and !response.ok\n\t */\n\treturn async <\n\t\tPath extends TemplatePaths,\n\t\tUsableMethods extends Methods<ResolveTemplatePath<Path>>,\n\t\tChosenMethod extends UsableMethods | undefined = 'get' extends UsableMethods ? 'get' : UsableMethods,\n\t>(\n\t\trequest: Path,\n\t\toptions: FetchOptions & {\n\t\t\tregion: GetSubdomain<ResolveTemplatePath<Path>>,\n\t\t\tmethod?: UsableMethods,\n\t\t}\n\t\t\t& GetRequestBody<ResolveTemplatePath<Path>, Extract<ChosenMethod, HTTPMethods>>\n\t\t\t& GetQuery<ResolveTemplatePath<Path>, Extract<ChosenMethod, HTTPMethods>>,\n\t): Promise<\n\tRiotFetchReturn<Path, Extract<ChosenMethod, HTTPMethods>, ThrowOnError, true>\n\t|\tRiotFetchReturn<Path, Extract<ChosenMethod, HTTPMethods>, ThrowOnError, false>\n\t> => {\n\t\tconst baseURL = baseUrl(options.region);\n\t\tconst req = new URL(request, baseURL);\n\t\tif (options.query) {\n\t\t\tfor (const [key, value] of Object.entries(options.query)) {\n\t\t\t\treq.searchParams.set(key, String(value));\n\t\t\t}\n\t\t}\n\n\t\tconst response = await fetchFn(req, {\n\t\t\t...defaultOptions,\n\t\t\t...options,\n\t\t\tbody: JSON.stringify(options.body)\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tconst riotErrorData = await response.json()\n\t\t\t\t.then(obj => isRiotErrorData(obj) ? obj : undefined)\n\t\t\t\t.catch(() => undefined);\n\n\n\t\t\tif (throwOnResponseError) {\n\t\t\t\tthrow new RiotError(\n\t\t\t\t\t'Riot Games Fetch Error',\n\t\t\t\t\tresponse.status,\n\t\t\t\t\triotErrorData\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tresponse,\n\t\t\t\tdata: riotErrorData,\n\t\t\t\terror: true,\n\t\t\t} as RiotFetchReturn<Path, Extract<ChosenMethod, HTTPMethods>, ThrowOnError, true>;\n\t\t}\n\n\t\treturn {\n\t\t\tresponse,\n\t\t\tdata: await response.json() as GetResponseBody<ResolveTemplatePath<Path>, Extract<ChosenMethod, HTTPMethods>, 200>,\n\t\t\terror: false,\n\t\t} as RiotFetchReturn<Path, Extract<ChosenMethod, HTTPMethods>, ThrowOnError, false>;\n\t};\n}\n\nexport const Queues = {\n\tCUSTOM: 0,\n\tHEXAKILL: 75,\n\tURF: [76, 1900],\n\tAR_URF: 900,\n\tARAM: {\n\t\tBUTCHERS_BRIDGE: 100,\n\t\tHOWLING_ABYSS: 450,\n\t\tALL: [100, 450]\n\t},\n\tALL_RANDOM: 325,\n\tBLIND: 430,\n\tDRAFT: 400,\n\tQUICKPLAY: 490,\n\tRANKED_SOLO: 420,\n\tRANKED_FLEX: 440,\n\tCLASH: {\n\t\tSUMMONERS_RIFT: 700,\n\t\tHOWLING_ABYSS: 720,\n\t\tARAM: 720,\n\t\tALL: [700, 720]\n\t},\n\tCOOP_VS_AI: {\n\t\tINTRO: 870,\n\t\tBEGINNER: 880,\n\t\tINTERMEDIATE: 890,\n\t\tALL: [870, 880, 890],\n\t},\n\tDOOM_BOTS: 960,\n\tONE_FOR_ALL: 1020,\n\tNEXUS_BLITZ: 1300,\n\tSPELLBOOK: 1400,\n\tARENA: [1700, 1710],\n\tSWARM: [1810, 1820, 1830, 1840],\n\tTUTORIAL: [2000, 2010, 2020]\n} as const;"],"mappings":";;;;;AA+MA,IAAa,YAAb,cAA+B,MAAM;CACpC,YAAY,SAAiB,YAAoB,MAAsB;EACtE,MAAM,OAAO;EACb,KAAK,aAAa;EAClB,KAAK,OAAO;CACb;CACA;CACA;AACD;;;;;;;;AASA,SAAS,gBAAgB,KAAoC;CAC5D,IAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM,OAAO;CAEpD,MAAM,OAAO;CAEb,IAAI,KAAK,WAAW,KAAA,GAAW;EAC9B,IAAI,OAAO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