@zthun/romulator-client 1.18.4 → 1.18.5

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.cjs CHANGED
@@ -18,7 +18,7 @@ class ZRomulatorConfigGamesMetadata {
18
18
  }
19
19
  }
20
20
 
21
- function _define_property$5(obj, key, value) {
21
+ function _define_property$6(obj, key, value) {
22
22
  if (key in obj) {
23
23
  Object.defineProperty(obj, key, {
24
24
  value: value,
@@ -51,11 +51,11 @@ class ZRomulatorConfigGamesBuilder {
51
51
  return structuredClone(this._config);
52
52
  }
53
53
  constructor(){
54
- _define_property$5(this, "_config", {});
54
+ _define_property$6(this, "_config", {});
55
55
  }
56
56
  }
57
57
 
58
- function _define_property$4(obj, key, value) {
58
+ function _define_property$5(obj, key, value) {
59
59
  if (key in obj) {
60
60
  Object.defineProperty(obj, key, {
61
61
  value: value,
@@ -117,7 +117,7 @@ class ZRomulatorConfigBuilder {
117
117
  return structuredClone(this._config);
118
118
  }
119
119
  constructor(){
120
- _define_property$4(this, "_config", {
120
+ _define_property$5(this, "_config", {
121
121
  id: "games",
122
122
  name: "",
123
123
  file: ""
@@ -125,7 +125,7 @@ class ZRomulatorConfigBuilder {
125
125
  }
126
126
  }
127
127
 
128
- function _define_property$3(obj, key, value) {
128
+ function _define_property$4(obj, key, value) {
129
129
  if (key in obj) {
130
130
  Object.defineProperty(obj, key, {
131
131
  value: value,
@@ -211,7 +211,7 @@ function _define_property$3(obj, key, value) {
211
211
  return structuredClone(this._players);
212
212
  }
213
213
  constructor(){
214
- _define_property$3(this, "_players", {
214
+ _define_property$4(this, "_players", {
215
215
  min: 1,
216
216
  max: 1
217
217
  });
@@ -220,25 +220,25 @@ function _define_property$3(obj, key, value) {
220
220
  *
221
221
  * @returns
222
222
  * This object.
223
- */ _define_property$3(this, "singlePlayer", this.range.bind(this, 1, 1));
223
+ */ _define_property$4(this, "singlePlayer", this.range.bind(this, 1, 1));
224
224
  /**
225
225
  * Sets the player count to 2 for max and 1 for min.
226
226
  *
227
227
  * @returns
228
228
  * This object.
229
- */ _define_property$3(this, "twoPlayer", this.range.bind(this, 1, 2));
229
+ */ _define_property$4(this, "twoPlayer", this.range.bind(this, 1, 2));
230
230
  /**
231
231
  * Sets the player count to 4 for max and 1 for min.
232
232
  *
233
233
  * @returns
234
234
  * This object.
235
- */ _define_property$3(this, "fourPlayer", this.range.bind(this, 1, 4));
235
+ */ _define_property$4(this, "fourPlayer", this.range.bind(this, 1, 4));
236
236
  /**
237
237
  * Sets the player count to 8 for max and 1 for min.
238
238
  *
239
239
  * @returns
240
240
  * This object.
241
- */ _define_property$3(this, "eightPlayer", this.range.bind(this, 1, 8));
241
+ */ _define_property$4(this, "eightPlayer", this.range.bind(this, 1, 8));
242
242
  }
243
243
  }
244
244
 
@@ -425,7 +425,7 @@ const ZRomulatorSystemIdMap = lodashEs.keyBy(Object.values(ZRomulatorSystemId));
425
425
  return typeof candidate === "string" && Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate);
426
426
  }
427
427
 
428
- function _define_property$2(obj, key, value) {
428
+ function _define_property$3(obj, key, value) {
429
429
  if (key in obj) {
430
430
  Object.defineProperty(obj, key, {
431
431
  value: value,
@@ -600,7 +600,7 @@ function _define_property$2(obj, key, value) {
600
600
  return lodashEs.omitBy(clone, lodashEs.isUndefined);
601
601
  }
602
602
  constructor(){
603
- _define_property$2(this, "_game", {
603
+ _define_property$3(this, "_game", {
604
604
  id: "",
605
605
  name: "",
606
606
  file: "",
@@ -614,6 +614,164 @@ function _define_property$2(obj, key, value) {
614
614
  }
615
615
  }
616
616
 
617
+ /**
618
+ * Represents the supported job types.
619
+ */ var ZJobType = /*#__PURE__*/ function(ZJobType) {
620
+ /**
621
+ * A quick hello world style job.
622
+ *
623
+ * Will always succeed. This is
624
+ * just to validate that the job
625
+ * engine is working.
626
+ *
627
+ * Ping has no context and no parameters.
628
+ */ ZJobType["Ping"] = "ping";
629
+ /**
630
+ * A scrape job.
631
+ *
632
+ * A scrape job downloads media from
633
+ * a scraper and saves it to the
634
+ * media folder.
635
+ *
636
+ * A scrape job with no context scrapes
637
+ * all systems and games.
638
+ */ ZJobType["Scrape"] = "scrape";
639
+ return ZJobType;
640
+ }({});
641
+ /**
642
+ * Gets whether a candidate value represents a job type.
643
+ *
644
+ * @param candidate -
645
+ * The object to check.
646
+ *
647
+ * @returns
648
+ * True if candidate can be a ZJobType object. False otherwise.
649
+ */ function isJobType(candidate) {
650
+ return candidate != null && typeof candidate == "string" && Object.values(ZJobType).includes(candidate);
651
+ }
652
+
653
+ function _define_property$2(obj, key, value) {
654
+ if (key in obj) {
655
+ Object.defineProperty(obj, key, {
656
+ value: value,
657
+ enumerable: true,
658
+ configurable: true,
659
+ writable: true
660
+ });
661
+ } else {
662
+ obj[key] = value;
663
+ }
664
+ return obj;
665
+ }
666
+ /**
667
+ * A builder that constructs IZJob instances.
668
+ */ class ZJobBuilder {
669
+ /**
670
+ * Sets the unique identifier for the job.
671
+ *
672
+ * @param val -
673
+ * Job id. If this is falsy, then the id
674
+ * is cleared.
675
+ * @returns
676
+ * This builder.
677
+ */ id(val) {
678
+ this._job.id = val;
679
+ return this;
680
+ }
681
+ /**
682
+ * Sets the id to a new generated guid if the id is not set.
683
+ *
684
+ * @returns
685
+ * This object.
686
+ */ guid() {
687
+ return this._job.id ? this : this.id(helpfulFn.createGuid());
688
+ }
689
+ /**
690
+ * Sets the job type.
691
+ *
692
+ * @param val -
693
+ * The job type.
694
+ * @returns
695
+ * This builder.
696
+ */ type(val) {
697
+ this._job.type = val;
698
+ return this;
699
+ }
700
+ /**
701
+ * Sets the job context or parameters.
702
+ *
703
+ * @param val -
704
+ * Context to attach to the job.
705
+ * @returns
706
+ * This builder.
707
+ */ context(val) {
708
+ this._job.context = val;
709
+ return this;
710
+ }
711
+ /**
712
+ * Sets the date and time when the job was created.
713
+ *
714
+ * @param val -
715
+ * The iso string representation of the job creation date.
716
+ *
717
+ * @returns
718
+ * This object.
719
+ */ createdAt(val) {
720
+ this._job.createdAt = val;
721
+ return this;
722
+ }
723
+ /**
724
+ * Removes information about the job that does not need to be written
725
+ * to a job file.
726
+ *
727
+ * This removes any created and updated date as the file's audit
728
+ * information is source of truth for these.
729
+ *
730
+ * @returns
731
+ * This object.
732
+ */ redact() {
733
+ delete this._job.createdAt;
734
+ return this;
735
+ }
736
+ /**
737
+ * Copies the values from another job into this builder.
738
+ *
739
+ * @param other -
740
+ * The job to duplicate.
741
+ * @returns
742
+ * This builder.
743
+ */ copy(other) {
744
+ this._job = structuredClone(other);
745
+ return this;
746
+ }
747
+ /**
748
+ * Builds a clean IZJob instance with undefined values removed.
749
+ *
750
+ * @returns
751
+ * The constructed job.
752
+ */ build() {
753
+ const clone = structuredClone(this._job);
754
+ return lodashEs.omitBy(clone, lodashEs.isUndefined);
755
+ }
756
+ constructor(){
757
+ _define_property$2(this, "_job", {
758
+ type: ZJobType.Ping
759
+ });
760
+ /**
761
+ * Sets the job type to ping.
762
+ *
763
+ * @returns
764
+ * This object.
765
+ */ _define_property$2(this, "ping", this.type.bind(this, ZJobType.Ping));
766
+ /**
767
+ * Sets the job type to scrape.
768
+ *
769
+ * @returns
770
+ * This object.
771
+ */ _define_property$2(this, "scrape", this.type.bind(this, ZJobType.Scrape));
772
+ }
773
+ }
774
+
617
775
  var ZRomulatorGameMediaType = /*#__PURE__*/ function(ZRomulatorGameMediaType) {
618
776
  /**
619
777
  * A 3d representation of the box art.
@@ -1129,6 +1287,8 @@ function _define_property(obj, key, value) {
1129
1287
  }
1130
1288
  }
1131
1289
 
1290
+ exports.ZJobBuilder = ZJobBuilder;
1291
+ exports.ZJobType = ZJobType;
1132
1292
  exports.ZRomulatorConfigBuilder = ZRomulatorConfigBuilder;
1133
1293
  exports.ZRomulatorConfigGamesBuilder = ZRomulatorConfigGamesBuilder;
1134
1294
  exports.ZRomulatorConfigGamesMetadata = ZRomulatorConfigGamesMetadata;
@@ -1145,6 +1305,7 @@ exports.ZRomulatorSystemId = ZRomulatorSystemId;
1145
1305
  exports.ZRomulatorSystemMediaFormat = ZRomulatorSystemMediaFormat;
1146
1306
  exports.ZRomulatorSystemMediaType = ZRomulatorSystemMediaType;
1147
1307
  exports.isGameMediaType = isGameMediaType;
1308
+ exports.isJobType = isJobType;
1148
1309
  exports.isMediaType = isMediaType;
1149
1310
  exports.isSystemContentType = isSystemContentType;
1150
1311
  exports.isSystemHardwareType = isSystemHardwareType;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/players/players.mts","../src/system/system-id.mts","../src/game/game.mts","../src/media/media-type.mts","../src/media/media.mts","../src/players/players-serialize.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { get } from \"lodash-es\";\n\n/**\n * Represents a player range for a game.\n */\nexport interface IZRomulatorPlayers {\n /**\n * The minimum number of players.\n *\n * This is almost always (read 99.99%)\n * 1.\n */\n min: number;\n /**\n * The maximum number of players.\n */\n max: number;\n}\n\n/**\n * Creates player range instances\n */\nexport class ZRomulatorPlayersBuilder {\n private _players: IZRomulatorPlayers = { min: 1, max: 1 };\n\n /**\n * Sets the minimum supported players.\n *\n * @param players -\n * Minimum number of players.\n *\n * @returns\n * This object.\n */\n public min(players: number) {\n this._players.min = players;\n return this;\n }\n\n /**\n * Sets the maximum supported players.\n *\n * @param players -\n * Maximum number of players.\n *\n * @returns\n * This object.\n */\n public max(players: number) {\n this._players.max = players;\n return this;\n }\n\n private range(min: number, max: number) {\n return this.min(min).max(max);\n }\n\n /**\n * Sets the player count to 1 player for both min and max.\n *\n * @returns\n * This object.\n */\n public singlePlayer = this.range.bind(this, 1, 1);\n\n /**\n * Sets the player count to 2 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public twoPlayer = this.range.bind(this, 1, 2);\n\n /**\n * Sets the player count to 4 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public fourPlayer = this.range.bind(this, 1, 4);\n\n /**\n * Sets the player count to 8 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public eightPlayer = this.range.bind(this, 1, 8);\n\n private parseMax(candidate: object) {\n const max = get(candidate, \"max\");\n\n return typeof max === \"number\" ? this.max(max) : this;\n }\n\n private parseMin(candidate: object) {\n const min = get(candidate, \"min\");\n\n return typeof min === \"number\" ? this.min(min) : this;\n }\n\n /**\n * Attempts to read player range values from an arbitrary candidate.\n *\n * @param candidate -\n * Source object to inspect.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseMin(candidate).parseMax(candidate);\n }\n\n /**\n * Copies an existing player range into this builder.\n *\n * @param other -\n * Players object to duplicate.\n *\n * @returns\n * This object\n */\n public copy(other: IZRomulatorPlayers) {\n this._players = structuredClone(other);\n return this;\n }\n\n /**\n * Creates the final player range instance.\n *\n * @returns\n * A cloned IZRomulatorPlayers instance.\n */\n public build() {\n return structuredClone(this._players);\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { get, isUndefined, omitBy } from \"lodash-es\";\nimport {\n ZRomulatorPlayersBuilder,\n type IZRomulatorPlayers,\n} from \"../players/players.mjs\";\nimport { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file: string;\n\n /**\n * The system id that this game belongs to.\n */\n system: ZRomulatorSystemId;\n\n /**\n * The date the game was released.\n */\n release: string;\n\n /**\n * The developer studio.\n */\n developer: string;\n\n /**\n * The publisher studio.\n */\n publisher: string;\n\n /**\n * The game description.\n */\n description: string;\n\n /**\n * The player information.\n */\n players: IZRomulatorPlayers;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = {\n id: \"\",\n name: \"\",\n file: \"\",\n system: ZRomulatorSystemId.Adam,\n release: \"\",\n description: \"\",\n developer: \"\",\n publisher: \"\",\n players: new ZRomulatorPlayersBuilder().build(),\n };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Sets the release date for the game.\n *\n * @param release -\n * The release information for the game.\n * @returns\n * This instance.\n */\n public release(release: string): this {\n this._game.release = release;\n return this;\n }\n\n /**\n * Sets the developer studio for the game.\n *\n * @param developer -\n * The developer name.\n * @returns\n * This instance.\n */\n public developer(developer: string): this {\n this._game.developer = developer;\n return this;\n }\n\n /**\n * Sets the publisher studio for the game.\n *\n * @param publisher -\n * The publisher name.\n * @returns\n * This instance.\n */\n public publisher(publisher: string): this {\n this._game.publisher = publisher;\n return this;\n }\n\n /**\n * Sets the description for the game.\n *\n * @param description -\n * The game description.\n * @returns\n * This instance.\n */\n public description(description: string): this {\n this._game.description = description;\n return this;\n }\n\n /**\n * Sets the player configuration for the game.\n *\n * @param players -\n * The player configuration.\n * @returns\n * This instance.\n */\n public players(players: IZRomulatorPlayers): this {\n this._game.players = new ZRomulatorPlayersBuilder().copy(players).build();\n return this;\n }\n\n private parseDeveloper(candidate: object): this {\n const developer = get(candidate, \"developer\");\n\n return typeof developer === \"string\" ? this.developer(developer) : this;\n }\n\n private parsePublisher(candidate: object): this {\n const publisher = get(candidate, \"publisher\");\n\n return typeof publisher === \"string\" ? this.publisher(publisher) : this;\n }\n\n private parseReleaseDate(candidate: object): this {\n const release = get(candidate, \"release\");\n\n return typeof release == \"string\" ? this.release(release) : this;\n }\n\n private parsePlayers(candidate: object): this {\n const players = get(candidate, \"players\");\n\n return this.players(\n new ZRomulatorPlayersBuilder()\n .copy(this._game.players)\n .parse(players)\n .build(),\n );\n }\n\n private parseDescription(candidate: object): this {\n const description = get(candidate, \"description\");\n\n return typeof description === \"string\"\n ? this.description(description)\n : this;\n }\n\n private parseName(candidate: object): this {\n const name = get(candidate, \"name\");\n\n return typeof name === \"string\" ? this.name(name) : this;\n }\n\n /**\n * Attempts to parse a game from a game entry in a system.json game\n * list.\n *\n * @param candidate -\n * The candidate to parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown): this {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseName(candidate)\n .parseDescription(candidate)\n .parsePlayers(candidate)\n .parseReleaseDate(candidate)\n .parseDeveloper(candidate)\n .parsePublisher(candidate);\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(title) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(title).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","import type { IZSerialize, ZOptional } from \"@zthun/helpful-fn\";\nimport type { IZRomulatorPlayers } from \"./players.mjs\";\n\n/**\n * Represents a serializer for a players object.\n *\n * The serialized form of players is a single digit if min and max are equal, or\n * a range string of #min-#max if they are different.\n */\nexport class ZRomulatorPlayersSerialize implements IZSerialize<IZRomulatorPlayers> {\n public serialize(\n candidate: ZOptional<IZRomulatorPlayers>,\n ): string | undefined {\n if (candidate == null) {\n return undefined;\n }\n\n const { min, max } = candidate;\n\n return min === max ? `${min}` : `${min}-${max}`;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n\nconst ZRomulatorSystemContentTypeMap = keyBy(\n Object.values(ZRomulatorSystemContentType),\n);\n\n/**\n * Gets whether a candidate string represents a system content type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system content type.\n */\nexport function isSystemContentType(\n candidate: any,\n): candidate is ZRomulatorSystemContentType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemContentTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * No idea what this is.\n */\n Unknown = \"unknown\",\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n\nconst ZRomulatorSystemHardwareTypeMap = keyBy(\n Object.values(ZRomulatorSystemHardwareType),\n);\n\n/**\n * Gets whether a candidate string represents a system hardware type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system hardware type.\n */\nexport function isSystemHardwareType(\n candidate: any,\n): candidate is ZRomulatorSystemHardwareType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemHardwareTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormat {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n\nconst ZRomulatorSystemMediaFormatMap = keyBy(\n Object.values(ZRomulatorSystemMediaFormat),\n);\n\n/**\n * Gets whether a candidate string represents a system media format.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system media format.\n */\nexport function isSystemMediaFormat(\n candidate: any,\n): candidate is ZRomulatorSystemMediaFormat {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaFormatMap,\n candidate,\n )\n );\n}\n","import { castExtension } from \"@zthun/helpful-fn\";\nimport { castArray, get, lowerCase, uniqBy } from \"lodash-es\";\nimport {\n isSystemContentType,\n ZRomulatorSystemContentType,\n} from \"./system-content-type.mjs\";\nimport {\n isSystemHardwareType,\n ZRomulatorSystemHardwareType,\n} from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport {\n isSystemMediaFormat,\n ZRomulatorSystemMediaFormat,\n} from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * Type classifications for the system.\n */\n classification: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat: ZRomulatorSystemMediaFormat;\n\n /**\n * The digital format of the game media.\n */\n contentType: ZRomulatorSystemContentType;\n };\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name: string;\n\n /**\n * The company that published the system.\n */\n company: string;\n\n /**\n * The years the system was in production until.\n */\n productionYears: {\n /**\n * The first year the system went into production.\n *\n * Uses ? if we are not sure.\n */\n start: number | \"?\";\n /**\n * The year when production stopped.\n *\n * Current implies that production is still happening.\n */\n end: number | \"current\";\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n name: \"\",\n\n classification: {\n hardwareType: ZRomulatorSystemHardwareType.Unknown,\n mediaFormat: ZRomulatorSystemMediaFormat.Unknown,\n contentType: ZRomulatorSystemContentType.Unknown,\n },\n\n company: \"\",\n\n productionYears: {\n start: \"?\",\n end: \"current\",\n },\n\n extensions: [\".zip\", \".7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormat): this {\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production start value.\n *\n * @param start -\n * The year the system was released into production.\n * Use '?' if you do not know this information.\n *\n * @returns\n * This object.\n */\n public productionStart(start: number | \"?\") {\n this._system.productionYears.start = start;\n\n return this;\n }\n\n /**\n * Sets the production end of life value.\n *\n * @param end -\n * The end of life year. Set to current\n * to mark no end of life.\n *\n * @returns\n * This object.\n */\n public productionEnd(end: number | \"current\") {\n this._system.productionYears.end = end;\n\n return this;\n }\n\n /**\n * Sets the full production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(\n start: number | \"?\" = \"?\",\n end: number | \"current\" = \"current\",\n ) {\n return this.productionStart(start).productionEnd(end);\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const current = this._system.extensions.slice();\n const extensions = castArray(extension).map((e) => castExtension(e));\n const unique = uniqBy(current.concat(extensions), lowerCase);\n\n this._system.extensions = unique\n .filter((e) => e != null)\n .map((e) => e?.toLowerCase());\n\n return this;\n }\n\n private parseId(candidate: object) {\n const id = get(candidate, \"id\");\n\n return isSystemId(id) ? this.id(id) : this;\n }\n\n private parseName(candidate: object) {\n const name = get(candidate, \"name\");\n\n return name != null && typeof name === \"string\" ? this.name(name) : this;\n }\n\n private parseCompany(candidate: object) {\n const company = get(candidate, \"company\");\n\n return company != null && typeof company === \"string\"\n ? this.company(company)\n : this;\n }\n\n private parseExtensions(candidate: object) {\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\")\n .map((ext) => castExtension(ext));\n\n return this.extension(extensions);\n }\n\n private parseHardwareType(classification: object) {\n const hardwareType = get(classification, \"hardwareType\");\n\n return isSystemHardwareType(hardwareType)\n ? this.hardware(hardwareType)\n : this;\n }\n\n private parseMediaFormat(classification: object) {\n const mediaFormat = get(classification, \"mediaFormat\");\n\n return isSystemMediaFormat(mediaFormat)\n ? this.mediaFormat(mediaFormat)\n : this;\n }\n\n private parseContentType(classification: object) {\n const contentType = get(classification, \"contentType\");\n\n return isSystemContentType(contentType)\n ? this.contentType(contentType)\n : this;\n }\n\n private parseClassification(candidate: object) {\n const classification = get(candidate, \"classification\");\n\n return classification != null && typeof classification === \"object\"\n ? this.parseHardwareType(classification)\n .parseMediaFormat(classification)\n .parseContentType(classification)\n : this;\n }\n\n private parseProductionStart(productionYears: object) {\n const start = get(productionYears, \"start\");\n\n return typeof start === \"number\" || start === \"?\"\n ? this.productionStart(start)\n : this;\n }\n\n private parseProductionEnd(productionYears: object) {\n const end = get(productionYears, \"end\");\n\n return typeof end === \"number\" || end === \"current\"\n ? this.productionEnd(end)\n : this;\n }\n\n private parseProductionYears(candidate: object) {\n const production = get(candidate, \"productionYears\");\n\n return production != null && typeof production === \"object\"\n ? this.parseProductionStart(production).parseProductionEnd(production)\n : this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n this.parseId(candidate)\n .parseName(candidate)\n .parseCompany(candidate)\n .parseExtensions(candidate)\n .parseClassification(candidate)\n .parseProductionYears(candidate);\n\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","games","_config","copy","other","structuredClone","assign","_define_property","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorPlayersBuilder","min","players","_players","max","range","parseMax","candidate","get","parseMin","parse","singlePlayer","bind","twoPlayer","fourPlayer","eightPlayer","ZRomulatorSystemId","ZRomulatorSystemIdMap","keyBy","Object","values","isSystemId","prototype","hasOwnProperty","call","ZRomulatorGameBuilder","_game","system","release","developer","publisher","parseDeveloper","parsePublisher","parseReleaseDate","parsePlayers","parseDescription","parseName","clone","omitBy","isUndefined","Adam","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","ZRomulatorGameMediaTypeMap","isSystemMediaType","isGameMediaType","isMediaType","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorPlayersSerialize","serialize","ZRomulatorSystemContentType","ZRomulatorSystemContentTypeMap","isSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemHardwareTypeMap","isSystemHardwareType","ZRomulatorSystemMediaFormat","ZRomulatorSystemMediaFormatMap","isSystemMediaFormat","ZRomulatorSystemBuilder","_system","company","hardware","classification","hardwareType","mediaFormat","contentType","productionStart","start","productionYears","productionEnd","end","extension","current","extensions","slice","map","e","castExtension","unique","uniqBy","lowerCase","filter","toLowerCase","parseId","parseCompany","parseExtensions","parseHardwareType","parseMediaFormat","parseContentType","parseClassification","parseProductionStart","parseProductionEnd","parseProductionYears","production","Nintendo","Unknown"],"mappings":";;;;;;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,6BACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;;;;;;;;;;;;;;ACbO,MAAMC,4BAAAA,CAAAA;AAGJT,IAAAA,WAAAA,CAAYU,KAAa,EAAQ;AACtC,QAAA,IAAI,CAACC,OAAO,CAACX,WAAW,GAAGU,KAAAA;AAC3B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,IAAAA,CAAKC,KAA6B,EAAE;QACzC,IAAI,CAACF,OAAO,GAAGG,eAAgBD,CAAAA,KAAAA,CAAAA;AAC/B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,MAAAA,CAAOF,KAAsC,EAAE;QACpD,IAAI,CAACF,OAAO,GAAG;YAAE,GAAG,IAAI,CAACA,OAAO;AAAE,YAAA,GAAGE;AAAM,SAAA;AAC3C,QAAA,OAAO,IAAI;AACb;IAEOL,KAAgC,GAAA;QACrC,OAAOM,eAAAA,CAAgB,IAAI,CAACH,OAAO,C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ACb;AAEA,QAAA,IAAI,CAACkG,OAAO,CAAClG,SACV6B,CAAAA,CAAAA,SAAS,CAAC7B,SACVmG,CAAAA,CAAAA,YAAY,CAACnG,SAAAA,CAAAA,CACboG,eAAe,CAACpG,SAAAA,CAAAA,CAChBwG,mBAAmB,CAACxG,SAAAA,CAAAA,CACpB2G,oBAAoB,CAAC3G,SAAAA,CAAAA;AAExB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMC,MACD,KAAe,GAAA;QACb,OAAOpB,eAAAA,CAAgB,IAAI,CAAC8F,OAAO,CAAA;AACrC;;AA5SA,QAAA,gBAAA,CAAA,IAAA,EAAQA,SAA6B,EAAA;AACnC1G,YAAAA,EAAAA,EAAIyC,mBAAmBoG,QAAQ;YAC/B3I,IAAM,EAAA,EAAA;YAEN2G,cAAgB,EAAA;AACdC,gBAAAA,YAAAA,EAAcX,6BAA6B2C,OAAO;AAClD/B,gBAAAA,WAAAA,EAAaT,4BAA4BwC,OAAO;AAChD9B,gBAAAA,WAAAA,EAAahB,4BAA4B8C;AAC3C,aAAA;YAEAnC,OAAS,EAAA,EAAA;YAETQ,eAAiB,EAAA;gBACfD,KAAO,EAAA,GAAA;gBACPG,GAAK,EAAA;AACP,aAAA;YAEAG,UAAY,EAAA;AAAC,gBAAA,MAAA;AAAQ,gBAAA;AAAM;AAC7B,SAAA,CAAA;;AA2RF;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/players/players.mts","../src/system/system-id.mts","../src/game/game.mts","../src/job/job-type.mts","../src/job/job.mts","../src/media/media-type.mts","../src/media/media.mts","../src/players/players-serialize.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { get } from \"lodash-es\";\n\n/**\n * Represents a player range for a game.\n */\nexport interface IZRomulatorPlayers {\n /**\n * The minimum number of players.\n *\n * This is almost always (read 99.99%)\n * 1.\n */\n min: number;\n /**\n * The maximum number of players.\n */\n max: number;\n}\n\n/**\n * Creates player range instances\n */\nexport class ZRomulatorPlayersBuilder {\n private _players: IZRomulatorPlayers = { min: 1, max: 1 };\n\n /**\n * Sets the minimum supported players.\n *\n * @param players -\n * Minimum number of players.\n *\n * @returns\n * This object.\n */\n public min(players: number) {\n this._players.min = players;\n return this;\n }\n\n /**\n * Sets the maximum supported players.\n *\n * @param players -\n * Maximum number of players.\n *\n * @returns\n * This object.\n */\n public max(players: number) {\n this._players.max = players;\n return this;\n }\n\n private range(min: number, max: number) {\n return this.min(min).max(max);\n }\n\n /**\n * Sets the player count to 1 player for both min and max.\n *\n * @returns\n * This object.\n */\n public singlePlayer = this.range.bind(this, 1, 1);\n\n /**\n * Sets the player count to 2 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public twoPlayer = this.range.bind(this, 1, 2);\n\n /**\n * Sets the player count to 4 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public fourPlayer = this.range.bind(this, 1, 4);\n\n /**\n * Sets the player count to 8 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public eightPlayer = this.range.bind(this, 1, 8);\n\n private parseMax(candidate: object) {\n const max = get(candidate, \"max\");\n\n return typeof max === \"number\" ? this.max(max) : this;\n }\n\n private parseMin(candidate: object) {\n const min = get(candidate, \"min\");\n\n return typeof min === \"number\" ? this.min(min) : this;\n }\n\n /**\n * Attempts to read player range values from an arbitrary candidate.\n *\n * @param candidate -\n * Source object to inspect.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseMin(candidate).parseMax(candidate);\n }\n\n /**\n * Copies an existing player range into this builder.\n *\n * @param other -\n * Players object to duplicate.\n *\n * @returns\n * This object\n */\n public copy(other: IZRomulatorPlayers) {\n this._players = structuredClone(other);\n return this;\n }\n\n /**\n * Creates the final player range instance.\n *\n * @returns\n * A cloned IZRomulatorPlayers instance.\n */\n public build() {\n return structuredClone(this._players);\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { get, isUndefined, omitBy } from \"lodash-es\";\nimport {\n ZRomulatorPlayersBuilder,\n type IZRomulatorPlayers,\n} from \"../players/players.mjs\";\nimport { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file: string;\n\n /**\n * The system id that this game belongs to.\n */\n system: ZRomulatorSystemId;\n\n /**\n * The date the game was released.\n */\n release: string;\n\n /**\n * The developer studio.\n */\n developer: string;\n\n /**\n * The publisher studio.\n */\n publisher: string;\n\n /**\n * The game description.\n */\n description: string;\n\n /**\n * The player information.\n */\n players: IZRomulatorPlayers;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = {\n id: \"\",\n name: \"\",\n file: \"\",\n system: ZRomulatorSystemId.Adam,\n release: \"\",\n description: \"\",\n developer: \"\",\n publisher: \"\",\n players: new ZRomulatorPlayersBuilder().build(),\n };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Sets the release date for the game.\n *\n * @param release -\n * The release information for the game.\n * @returns\n * This instance.\n */\n public release(release: string): this {\n this._game.release = release;\n return this;\n }\n\n /**\n * Sets the developer studio for the game.\n *\n * @param developer -\n * The developer name.\n * @returns\n * This instance.\n */\n public developer(developer: string): this {\n this._game.developer = developer;\n return this;\n }\n\n /**\n * Sets the publisher studio for the game.\n *\n * @param publisher -\n * The publisher name.\n * @returns\n * This instance.\n */\n public publisher(publisher: string): this {\n this._game.publisher = publisher;\n return this;\n }\n\n /**\n * Sets the description for the game.\n *\n * @param description -\n * The game description.\n * @returns\n * This instance.\n */\n public description(description: string): this {\n this._game.description = description;\n return this;\n }\n\n /**\n * Sets the player configuration for the game.\n *\n * @param players -\n * The player configuration.\n * @returns\n * This instance.\n */\n public players(players: IZRomulatorPlayers): this {\n this._game.players = new ZRomulatorPlayersBuilder().copy(players).build();\n return this;\n }\n\n private parseDeveloper(candidate: object): this {\n const developer = get(candidate, \"developer\");\n\n return typeof developer === \"string\" ? this.developer(developer) : this;\n }\n\n private parsePublisher(candidate: object): this {\n const publisher = get(candidate, \"publisher\");\n\n return typeof publisher === \"string\" ? this.publisher(publisher) : this;\n }\n\n private parseReleaseDate(candidate: object): this {\n const release = get(candidate, \"release\");\n\n return typeof release == \"string\" ? this.release(release) : this;\n }\n\n private parsePlayers(candidate: object): this {\n const players = get(candidate, \"players\");\n\n return this.players(\n new ZRomulatorPlayersBuilder()\n .copy(this._game.players)\n .parse(players)\n .build(),\n );\n }\n\n private parseDescription(candidate: object): this {\n const description = get(candidate, \"description\");\n\n return typeof description === \"string\"\n ? this.description(description)\n : this;\n }\n\n private parseName(candidate: object): this {\n const name = get(candidate, \"name\");\n\n return typeof name === \"string\" ? this.name(name) : this;\n }\n\n /**\n * Attempts to parse a game from a game entry in a system.json game\n * list.\n *\n * @param candidate -\n * The candidate to parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown): this {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseName(candidate)\n .parseDescription(candidate)\n .parsePlayers(candidate)\n .parseReleaseDate(candidate)\n .parseDeveloper(candidate)\n .parsePublisher(candidate);\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","/**\n * Represents the supported job types.\n */\nexport enum ZJobType {\n /**\n * A quick hello world style job.\n *\n * Will always succeed. This is\n * just to validate that the job\n * engine is working.\n *\n * Ping has no context and no parameters.\n */\n Ping = \"ping\",\n /**\n * A scrape job.\n *\n * A scrape job downloads media from\n * a scraper and saves it to the\n * media folder.\n *\n * A scrape job with no context scrapes\n * all systems and games.\n */\n Scrape = \"scrape\",\n}\n\n/**\n * Gets whether a candidate value represents a job type.\n *\n * @param candidate -\n * The object to check.\n *\n * @returns\n * True if candidate can be a ZJobType object. False otherwise.\n */\nexport function isJobType(candidate: unknown): candidate is ZJobType {\n return (\n candidate != null &&\n typeof candidate == \"string\" &&\n Object.values<string>(ZJobType).includes(candidate)\n );\n}\n","import { createGuid } from \"@zthun/helpful-fn\";\nimport { isUndefined, omitBy } from \"lodash-es\";\nimport { ZJobType } from \"./job-type.mjs\";\n\n/**\n * Represents a job in the romulator system.\n */\nexport interface IZJob {\n /**\n * The id of the job.\n */\n id?: string;\n\n /**\n * The job type.\n */\n type: ZJobType;\n\n /**\n * The parameters for the job.\n */\n context?: any;\n\n /**\n * The creation date of the job.\n */\n createdAt?: string;\n}\n\n/**\n * A builder that constructs IZJob instances.\n */\nexport class ZJobBuilder {\n private _job: IZJob = {\n type: ZJobType.Ping,\n };\n\n /**\n * Sets the unique identifier for the job.\n *\n * @param val -\n * Job id. If this is falsy, then the id\n * is cleared.\n * @returns\n * This builder.\n */\n public id(val?: string) {\n this._job.id = val;\n return this;\n }\n\n /**\n * Sets the id to a new generated guid if the id is not set.\n *\n * @returns\n * This object.\n */\n public guid() {\n return this._job.id ? this : this.id(createGuid());\n }\n\n /**\n * Sets the job type.\n *\n * @param val -\n * The job type.\n * @returns\n * This builder.\n */\n public type(val: ZJobType) {\n this._job.type = val;\n return this;\n }\n\n /**\n * Sets the job type to ping.\n *\n * @returns\n * This object.\n */\n public ping = this.type.bind(this, ZJobType.Ping);\n\n /**\n * Sets the job type to scrape.\n *\n * @returns\n * This object.\n */\n public scrape = this.type.bind(this, ZJobType.Scrape);\n\n /**\n * Sets the job context or parameters.\n *\n * @param val -\n * Context to attach to the job.\n * @returns\n * This builder.\n */\n public context(val: any) {\n this._job.context = val;\n return this;\n }\n\n /**\n * Sets the date and time when the job was created.\n *\n * @param val -\n * The iso string representation of the job creation date.\n *\n * @returns\n * This object.\n */\n public createdAt(val?: string) {\n this._job.createdAt = val;\n return this;\n }\n\n /**\n * Removes information about the job that does not need to be written\n * to a job file.\n *\n * This removes any created and updated date as the file's audit\n * information is source of truth for these.\n *\n * @returns\n * This object.\n */\n public redact() {\n delete this._job.createdAt;\n\n return this;\n }\n\n /**\n * Copies the values from another job into this builder.\n *\n * @param other -\n * The job to duplicate.\n * @returns\n * This builder.\n */\n public copy(other: IZJob) {\n this._job = structuredClone(other);\n return this;\n }\n\n /**\n * Builds a clean IZJob instance with undefined values removed.\n *\n * @returns\n * The constructed job.\n */\n public build() {\n const clone = structuredClone(this._job);\n return omitBy(clone, isUndefined) as IZJob;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(title) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(title).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","import type { IZSerialize, ZOptional } from \"@zthun/helpful-fn\";\nimport type { IZRomulatorPlayers } from \"./players.mjs\";\n\n/**\n * Represents a serializer for a players object.\n *\n * The serialized form of players is a single digit if min and max are equal, or\n * a range string of #min-#max if they are different.\n */\nexport class ZRomulatorPlayersSerialize implements IZSerialize<IZRomulatorPlayers> {\n public serialize(\n candidate: ZOptional<IZRomulatorPlayers>,\n ): string | undefined {\n if (candidate == null) {\n return undefined;\n }\n\n const { min, max } = candidate;\n\n return min === max ? `${min}` : `${min}-${max}`;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n\nconst ZRomulatorSystemContentTypeMap = keyBy(\n Object.values(ZRomulatorSystemContentType),\n);\n\n/**\n * Gets whether a candidate string represents a system content type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system content type.\n */\nexport function isSystemContentType(\n candidate: any,\n): candidate is ZRomulatorSystemContentType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemContentTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * No idea what this is.\n */\n Unknown = \"unknown\",\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n\nconst ZRomulatorSystemHardwareTypeMap = keyBy(\n Object.values(ZRomulatorSystemHardwareType),\n);\n\n/**\n * Gets whether a candidate string represents a system hardware type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system hardware type.\n */\nexport function isSystemHardwareType(\n candidate: any,\n): candidate is ZRomulatorSystemHardwareType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemHardwareTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormat {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n\nconst ZRomulatorSystemMediaFormatMap = keyBy(\n Object.values(ZRomulatorSystemMediaFormat),\n);\n\n/**\n * Gets whether a candidate string represents a system media format.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system media format.\n */\nexport function isSystemMediaFormat(\n candidate: any,\n): candidate is ZRomulatorSystemMediaFormat {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaFormatMap,\n candidate,\n )\n );\n}\n","import { castExtension } from \"@zthun/helpful-fn\";\nimport { castArray, get, lowerCase, uniqBy } from \"lodash-es\";\nimport {\n isSystemContentType,\n ZRomulatorSystemContentType,\n} from \"./system-content-type.mjs\";\nimport {\n isSystemHardwareType,\n ZRomulatorSystemHardwareType,\n} from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport {\n isSystemMediaFormat,\n ZRomulatorSystemMediaFormat,\n} from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * Type classifications for the system.\n */\n classification: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat: ZRomulatorSystemMediaFormat;\n\n /**\n * The digital format of the game media.\n */\n contentType: ZRomulatorSystemContentType;\n };\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name: string;\n\n /**\n * The company that published the system.\n */\n company: string;\n\n /**\n * The years the system was in production until.\n */\n productionYears: {\n /**\n * The first year the system went into production.\n *\n * Uses ? if we are not sure.\n */\n start: number | \"?\";\n /**\n * The year when production stopped.\n *\n * Current implies that production is still happening.\n */\n end: number | \"current\";\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n name: \"\",\n\n classification: {\n hardwareType: ZRomulatorSystemHardwareType.Unknown,\n mediaFormat: ZRomulatorSystemMediaFormat.Unknown,\n contentType: ZRomulatorSystemContentType.Unknown,\n },\n\n company: \"\",\n\n productionYears: {\n start: \"?\",\n end: \"current\",\n },\n\n extensions: [\".zip\", \".7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormat): this {\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production start value.\n *\n * @param start -\n * The year the system was released into production.\n * Use '?' if you do not know this information.\n *\n * @returns\n * This object.\n */\n public productionStart(start: number | \"?\") {\n this._system.productionYears.start = start;\n\n return this;\n }\n\n /**\n * Sets the production end of life value.\n *\n * @param end -\n * The end of life year. Set to current\n * to mark no end of life.\n *\n * @returns\n * This object.\n */\n public productionEnd(end: number | \"current\") {\n this._system.productionYears.end = end;\n\n return this;\n }\n\n /**\n * Sets the full production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(\n start: number | \"?\" = \"?\",\n end: number | \"current\" = \"current\",\n ) {\n return this.productionStart(start).productionEnd(end);\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const current = this._system.extensions.slice();\n const extensions = castArray(extension).map((e) => castExtension(e));\n const unique = uniqBy(current.concat(extensions), lowerCase);\n\n this._system.extensions = unique\n .filter((e) => e != null)\n .map((e) => e?.toLowerCase());\n\n return this;\n }\n\n private parseId(candidate: object) {\n const id = get(candidate, \"id\");\n\n return isSystemId(id) ? this.id(id) : this;\n }\n\n private parseName(candidate: object) {\n const name = get(candidate, \"name\");\n\n return name != null && typeof name === \"string\" ? this.name(name) : this;\n }\n\n private parseCompany(candidate: object) {\n const company = get(candidate, \"company\");\n\n return company != null && typeof company === \"string\"\n ? this.company(company)\n : this;\n }\n\n private parseExtensions(candidate: object) {\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\")\n .map((ext) => castExtension(ext));\n\n return this.extension(extensions);\n }\n\n private parseHardwareType(classification: object) {\n const hardwareType = get(classification, \"hardwareType\");\n\n return isSystemHardwareType(hardwareType)\n ? this.hardware(hardwareType)\n : this;\n }\n\n private parseMediaFormat(classification: object) {\n const mediaFormat = get(classification, \"mediaFormat\");\n\n return isSystemMediaFormat(mediaFormat)\n ? this.mediaFormat(mediaFormat)\n : this;\n }\n\n private parseContentType(classification: object) {\n const contentType = get(classification, \"contentType\");\n\n return isSystemContentType(contentType)\n ? this.contentType(contentType)\n : this;\n }\n\n private parseClassification(candidate: object) {\n const classification = get(candidate, \"classification\");\n\n return classification != null && typeof classification === \"object\"\n ? this.parseHardwareType(classification)\n .parseMediaFormat(classification)\n .parseContentType(classification)\n : this;\n }\n\n private parseProductionStart(productionYears: object) {\n const start = get(productionYears, \"start\");\n\n return typeof start === \"number\" || start === \"?\"\n ? this.productionStart(start)\n : this;\n }\n\n private parseProductionEnd(productionYears: object) {\n const end = get(productionYears, \"end\");\n\n return typeof end === \"number\" || end === \"current\"\n ? this.productionEnd(end)\n : this;\n }\n\n private parseProductionYears(candidate: object) {\n const production = get(candidate, \"productionYears\");\n\n return production != null && typeof production === \"object\"\n ? this.parseProductionStart(production).parseProductionEnd(production)\n : this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n this.parseId(candidate)\n .parseName(candidate)\n .parseCompany(candidate)\n .parseExtensions(candidate)\n .parseClassification(candidate)\n .parseProductionYears(candidate);\n\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","games","_config","copy","other","structuredClone","assign","_define_property","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorPlayersBuilder","min","players","_players","max","range","parseMax","candidate","get","parseMin","parse","singlePlayer","bind","twoPlayer","fourPlayer","eightPlayer","ZRomulatorSystemId","ZRomulatorSystemIdMap","keyBy","Object","values","isSystemId","prototype","hasOwnProperty","call","ZRomulatorGameBuilder","_game","system","release","developer","publisher","parseDeveloper","parsePublisher","parseReleaseDate","parsePlayers","parseDescription","parseName","clone","omitBy","isUndefined","Adam","ZJobType","isJobType","includes","ZJobBuilder","val","_job","createGuid","type","context","createdAt","Ping","ping","scrape","Scrape","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","ZRomulatorGameMediaTypeMap","isSystemMediaType","isGameMediaType","isMediaType","ZRomulatorMediaBuilder","_media","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorPlayersSerialize","serialize","ZRomulatorSystemContentType","ZRomulatorSystemContentTypeMap","isSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemHardwareTypeMap","isSystemHardwareType","ZRomulatorSystemMediaFormat","ZRomulatorSystemMediaFormatMap","isSystemMediaFormat","ZRomulatorSystemBuilder","_system","company","hardware","classification","hardwareType","mediaFormat","contentType","productionStart","start","productionYears","productionEnd","end","extension","current","extensions","slice","map","e","castExtension","unique","uniqBy","lowerCase","filter","toLowerCase","parseId","parseCompany","parseExtensions","parseHardwareType","parseMediaFormat","parseContentType","parseClassification","parseProductionStart","parseProductionEnd","parseProductionYears","production","Nintendo","Unknown"],"mappings":";;;;;;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,6BACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;;;;;;;;;;;;;;ACbO,MAAMC,4BAAAA,CAAAA;AAGJT,IAAAA,WAAAA,CAAYU,KAAa,EAAQ;AACtC,QAAA,IAAI,CAACC,OAAO,CAACX,WAAW,GAAGU,KAAAA;AAC3B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,IAAAA,CAAKC,KAA6B,EAAE;QACzC,IAAI,CAACF,OAAO,GAAGG,eAAgBD,CAAAA,KAAAA,CAAAA;AAC/B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,MAAAA,CAAOF,KAAsC,EAAE;QACpD,IAAI,CAACF,OAAO,GAAG;YAAE,GAAG,IAAI,CAACA,OAAO;AAAE,YAAA,GAAGE;AAAM,SAAA;AAC3C,QAAA,O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2G,OAAO,CAAA;AACrC;;AA5SA,QAAA,gBAAA,CAAA,IAAA,EAAQA,SAA6B,EAAA;AACnCvH,YAAAA,EAAAA,EAAIyC,mBAAmBiH,QAAQ;YAC/BxJ,IAAM,EAAA,EAAA;YAENwH,cAAgB,EAAA;AACdC,gBAAAA,YAAAA,EAAcX,6BAA6B2C,OAAO;AAClD/B,gBAAAA,WAAAA,EAAaT,4BAA4BwC,OAAO;AAChD9B,gBAAAA,WAAAA,EAAahB,4BAA4B8C;AAC3C,aAAA;YAEAnC,OAAS,EAAA,EAAA;YAETQ,eAAiB,EAAA;gBACfD,KAAO,EAAA,GAAA;gBACPG,GAAK,EAAA;AACP,aAAA;YAEAG,UAAY,EAAA;AAAC,gBAAA,MAAA;AAAQ,gBAAA;AAAM;AAC7B,SAAA,CAAA;;AA2RF;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.mts CHANGED
@@ -2,6 +2,8 @@ export * from './config/config-games-metadata.mjs';
2
2
  export * from './config/config-games.mjs';
3
3
  export * from './config/config.mjs';
4
4
  export * from './game/game.mjs';
5
+ export * from './job/job-type.mjs';
6
+ export * from './job/job.mjs';
5
7
  export * from './media/media-type.mjs';
6
8
  export * from './media/media.mjs';
7
9
  export * from './players/players-serialize.mjs';