bakedex

showdex-lib
bakedex

 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:



Developer Zone

[!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.

Developer SparkNotes™

terminology bout to get confusing real quick so:

[!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

[!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

Types

[!CAUTION] ah put your type charts away it’s not that kind of type LOL

BakedexApiResponse

// 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
}

Source: @showdex/interfaces/api/BakedexApiResponse

ShowdexAssetBundle

[!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
}

Source: @showdex/interfaces/app/ShowdexAssetBundle

API Reference

[!IMPORTANT]

GET /v1/buns

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';
      };
    };
  };
};

Source: @showdex/interfaces/api/BakedexApiBunsResponse


GET /v1/players/:id

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

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


GET /v1/supporters/:id

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


  1. 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. 

  2. Hope you liked that “HTML is a programming language” joke ( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°)