Repository 2024.12.24 | Serving showdex · v1.2.5 |
---|
Repository of Showdex asset bundles. This serves as a CDN for the most up-to-date versions of pre-bundled assets that Showdexes v1.2.4+ will periodically update from.
If you're looking for Showdex's source code, this isn't it (try here instead!).
tl;dr also like the only explanation lmao jk I added some more c:
- basically how we keep data fresh w/out having to build a new version since we've never gone MIA & stuff no cap fr fr ong ¯\_(ツ)_/¯
- powered by GitHub Pages
Caution
You are about to get in the zone, the developer zone.
If you do not wish to get in the zone, the developer zone, please visit this zone instead.
- API-style routes w/ only GET requests cause wait it's all files ?? always has been
- so no tokens or oauth2 or any of that shiz
- these files map to a path that look like API route endpoints (e.g.,
'https://bake.dex.tize.io/v1/buns'
)- but don't be fooled !! :o
- they're actually just extensionless UTF-8 files (i.e., fancy way of saying text files without the
*.txt
part) - they also just contain stringified JSON, prettified & all, so ya nothing cray
- the official AF-looking API
'/v1'
prefix (+ other things LOL) exist for the added street cred ( ͡° ͜ʖ ͡°)
terminology bout to get confusing real quick so:
- (asset) bundle contains a bunch of assets (i.e., some stuff), like Calcdex player titles & Pokémon sets1
- bundle namespace contains a bunch of bundles, all with the same kind of asset
Tip
you can think of a bundle like a folder containing all of your JavaScript projects, which that itself is inside of a folder or bundle namespace called " Programming Projects ", which can have other bundles for your HTML2 ( ͡° ͜ʖ ͡°) & Python projects idk lmao
haven't invested much into my analogy conjuration skill tree sorry v_v
-
bundle catalog is that link I mentioned earlier, ya kno the one with the
'/v1/buns'
??- contains a list of all available bundle namespaces along with the info about the bundles they contain, such as what the bundles are called, what kind of assets they contain & when they were last updated
- they might call this the package or release manifest / catalog / index in the biz
- but idk I just whipped this together real quicc
-
ayy lmao
Tip
can't be bothered & wanna see how Showdex does it?
here's where all the :・゚✧ magic ✧゚・: is! → @showdex/utils/app/bakeBakedexBundles()
ya nerd jkjk (。◕‿◕。)
warning: little (& terrible) documention in that one sorry v_v glhf tho
Caution
ah put your type charts away it's not that kind of type LOL
- it's the boring
type
- but gotta know what we're dealing with!
- every API endpoint / JSON file in this repo will have this basic skeleton
- you can conveniently do a sanity check by checking if we're
ok
- the
ntt
(i.e., the en-ti-ty or entity get it hehehe) tells you what's in thepayload
- the goodies you're looking for will be in
payload
// note: simplified; not actual type definition
export interface BakedexApiResponse {
ok: true; // quicc sanity check (e.g., const data = await response.json(); if (!data.ok) return;)
status: [code: 200, label: 'OK']; // all cool APIs have this; feel free to ignore
ntt: 'buns' | 'presets' | 'tiers' | 'titles'; // the entity, or what's inside `payload`
payload: unknown; // the good stuff, based on what `ntt` is
}
- remember how bundle catalogs contain information about the bundles in a bundle namespace?
- ya here's what that information on a bundle would actually look like, more or less
- this is the basic skeleton, but more props may exist depending on the
ntt
Caution
in hindsight, I realize that something called a "ShowdexAssetBundle
" would imply an asset bundle used in Showdex, but is not actually that... LOL. it's technically the metadata of that asset bundle... so really, it's missing a "–Metadata
" suffix to the name HAHA but fucc it yolo srry
// note: this interface is used for other Showdex-related stuff like loading translation files,
// so you'll find some extraneous props like `ext` & `label` here
export interface ShowdexAssetBundle {
id: string; // bundle's id
ext?: string; // file extension, which doesn't exist here; will be `null` most likely!
ntt: 'buns' | 'presets' | 'tiers' | 'titles'; // entity
name: string; // bundle's name
label?: string; // what users will see in the UI if specified; dw about this tho
author?: string; // bundle's author(s) -- it's a just string, so no format enforcement here lol
desc?: string; // optional description
created: string; // ISO 8601 timestamp
updated: string; // ISO 8601 timestamp
disabled: false; // bundle's killswitch; will always be `false` here, but exists cause all the cool kids do it
}
Important
- Base URL:
'https://bake.dex.tize.io'
- → A:
'https://doshidak.github.io/bakedex'
- → A:
GET /v1/buns
- Accept:
'text/plain'
Suggested Request Headers
// note: simplified; not actual type definition
export type BakedexApiBunsResponse = BakedexApiResponse & {
ntt: 'buns';
payload: {
// info about the 'players' namespace of Calcdex player title bundles
players: {
// info about a particular bundle (e.g., 'titles' here)
// you'll want to hang onto the bundle's `id` if you wanna grab the bundle after!!
// (also note: the `id` of the ShowdexAssetBundle will match the `id` key here)
[id: string]: ShowdexAssetBundle & {
ntt: 'titles';
};
};
// info about the 'presets' namespace of Pokemon set bundles
presets: {
[id: string]: ShowdexAssetBundle & {
ntt: 'presets';
gen: GenerationNum; // -> 1 | 2 | 3 | ... | 8 | 9 (i.e., number enum)
format: string; // genless; e.g., 'randombattle', 'ou', 'vgc3005'
};
};
// info about the 'supporters' namespace, containing a bundle of the real ones
supporters: {
[id: string]: ShowdexAssetBundle & {
ntt: 'tiers';
};
};
};
};
GET /v1/players/:id
- Accept:
'text/plain'
Suggested Request Headers
// note: simplified; not actual type definition
export type BakedexApiTitlesResponse = BakedexApiBunsResponse & {
ntt: 'titles';
payload: ShowdexPlayerTitle[];
};
Source:
@showdex/interfaces/api/BakedexApiTitlesResponse
@showdex/interfaces/app/ShowdexPlayerTitle
GET /v1/presets/:id
- Accept:
'text/plain'
Suggested Request Headers
// note: simplified; not actual type definition
export type BakedexApiPresetsResponse = BakedexApiBunsResponse & {
ntt: 'presets';
payload: CalcdexPokemonPreset[];
};
Source:
@showdex/interfaces/api/BakedexApiPresetsResponse
@showdex/interfaces/calc/CalcdexPokemonPreset
- Accept:
'text/plain'
Suggested Request Headers
// note: simplified; not actual type definition
export type BakedexApiTiersResponse = BakedexApiBunsResponse & {
ntt: 'tiers';
payload: ShowdexSupporterTier[];
};
Source:
@showdex/interfaces/api/BakedexApiTiersResponse
@showdex/interfaces/app/ShowdexSupporterTier
Footnotes
-
Pokémon sets are internally referred to as presets within the Showdex codebase to avoid collisions, mostly of the mental variety, with the commonly used
set
keyword. Otherwise, they're referred to as sets in any text displayed to the user. ↩ -
Hope you liked that "HTML is a programming language" joke ( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°) ↩