@zivue/zuuid 0.2.1 → 0.2.2
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/CHANGELOG.md +8 -0
- package/README.md +66 -16
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +36 -0
- package/dist/identity.d.ts +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/providers/gamesdb/client.d.ts +19 -0
- package/dist/providers/gamesdb/client.d.ts.map +1 -0
- package/dist/providers/gamesdb/client.js +57 -0
- package/dist/providers/gamesdb/constants.d.ts +2 -0
- package/dist/providers/gamesdb/constants.d.ts.map +1 -1
- package/dist/providers/gamesdb/constants.js +2 -0
- package/dist/providers/gamesdb/game.d.ts +7 -5
- package/dist/providers/gamesdb/game.d.ts.map +1 -1
- package/dist/providers/gamesdb/game.js +203 -22
- package/dist/providers/gamesdb/index.d.ts +2 -0
- package/dist/providers/gamesdb/index.d.ts.map +1 -1
- package/dist/providers/gamesdb/index.js +2 -0
- package/dist/providers/gamesdb/platform.d.ts +5 -2
- package/dist/providers/gamesdb/platform.d.ts.map +1 -1
- package/dist/providers/gamesdb/platform.js +87 -4
- package/dist/providers/gamesdb/types.d.ts +21 -0
- package/dist/providers/gamesdb/types.d.ts.map +1 -0
- package/dist/providers/gamesdb/types.js +1 -0
- package/dist/providers/imdb/client.d.ts +16 -0
- package/dist/providers/imdb/client.d.ts.map +1 -0
- package/dist/providers/imdb/client.js +29 -0
- package/dist/providers/imdb/constants.d.ts +4 -0
- package/dist/providers/imdb/constants.d.ts.map +1 -0
- package/dist/providers/imdb/constants.js +3 -0
- package/dist/providers/imdb/index.d.ts +4 -0
- package/dist/providers/imdb/index.d.ts.map +1 -0
- package/dist/providers/imdb/index.js +3 -0
- package/dist/providers/imdb/movie.d.ts +16 -0
- package/dist/providers/imdb/movie.d.ts.map +1 -0
- package/dist/providers/imdb/movie.js +183 -0
- package/dist/providers/imdb/types.d.ts +10 -0
- package/dist/providers/imdb/types.d.ts.map +1 -0
- package/dist/providers/imdb/types.js +1 -0
- package/dist/providers/tmdb/tv.d.ts.map +1 -1
- package/dist/providers/tmdb/tv.js +0 -1
- package/package.json +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.2 - 2026-05-25
|
|
4
|
+
|
|
5
|
+
- Added IMDb fetch-by-ID scraper support for movie and TV title pages.
|
|
6
|
+
- Added GamesDB live game search/fetch, platform fetch, `play.gamesdb` client support, and native API envelope/image handling.
|
|
7
|
+
- Removed hardcoded fixture payloads from the fetch example; examples now cover live fetch-capable providers only.
|
|
8
|
+
- Removed duplicate transformed TMDB TV `content_ratings` details while keeping normalized `certifications`.
|
|
9
|
+
- Added `AGENTS.md` guidance for AI coding agents working in this repository.
|
|
10
|
+
|
|
3
11
|
## 0.2.1 - 2026-05-24
|
|
4
12
|
|
|
5
13
|
- Normalized provider ratings to a shared `0-5` scale while preserving native provider scores in `provider_rating` details.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Search, fetch, and normalize media metadata from external providers into a share
|
|
|
4
4
|
|
|
5
5
|
This package is meant to be used by apps that need provider-backed lookup and transformation, but do not want provider-specific response shapes leaking through the app.
|
|
6
6
|
|
|
7
|
-
TMDB
|
|
7
|
+
TMDB, Open Library, and GamesDB include live search/fetch clients. IMDb includes a fetch-by-ID title-page scraper for movie and TV titles. Additional providers currently expose source-record transformers: you provide the raw provider payload, and this package normalizes it into `ZuuidData`.
|
|
8
8
|
|
|
9
9
|
Storage, caching, indexing, review state, object-store keys, and persistence belong in a layer outside this package.
|
|
10
10
|
|
|
@@ -110,7 +110,9 @@ Ratings are normalized to a `0-5` scale when the provider exposes a compatible n
|
|
|
110
110
|
| Open Library | book | yes | yes | yes |
|
|
111
111
|
| Open Library | author | yes | yes | yes |
|
|
112
112
|
| ComicVine | volume, issue, story_arc, character, person, publisher | no | no | yes |
|
|
113
|
-
|
|
|
113
|
+
| IMDb | movie, tv | no | yes | yes |
|
|
114
|
+
| GamesDB | game | yes | yes | yes |
|
|
115
|
+
| GamesDB | platform | no | yes | yes |
|
|
114
116
|
| Jikan | anime, manga, producer, magazine, character, person | no | no | yes |
|
|
115
117
|
| MusicBrainz | release, release-group, recording, artist, label, work | no | no | yes |
|
|
116
118
|
| OpenFoodFacts | product | no | no | yes |
|
|
@@ -120,7 +122,56 @@ Ratings are normalized to a `0-5` scale when the provider exposes a compatible n
|
|
|
120
122
|
| Ticketmaster | event, attraction, venue | no | no | yes |
|
|
121
123
|
| Wger | exercise, equipment | no | no | yes |
|
|
122
124
|
|
|
123
|
-
For transformer-only providers, "Search" and "Fetch" are marked `no` because this package does not perform those HTTP requests yet. Use your own provider client or stored payloads, wrap the payload in a `SourceRecord`, and call the category transformer.
|
|
125
|
+
For IMDb, search is marked `no` because the scraper fetches known title IDs such as `tt0137523`; it does not implement IMDb search. GamesDB platform search is marked `no` because only game search and ID fetches are currently implemented. For transformer-only providers, "Search" and "Fetch" are marked `no` because this package does not perform those HTTP requests yet. Use your own provider client or stored payloads, wrap the payload in a `SourceRecord`, and call the category transformer.
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
## GamesDB Credentials
|
|
130
|
+
|
|
131
|
+
`GamesDbProvider` uses TheGamesDB v1 API and requires an API key:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
import { GamesDbProvider } from "@zivue/zuuid/providers/gamesdb";
|
|
135
|
+
|
|
136
|
+
const gamesdb = new GamesDbProvider({
|
|
137
|
+
apiKey: process.env.GAMESDB_API_KEY!
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const game = await gamesdb.fetchGame({ id: 17444 });
|
|
141
|
+
const search = await gamesdb.searchGames({ query: "Chrono Trigger" });
|
|
142
|
+
const platform = await gamesdb.fetchPlatform({ id: 6 });
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The category-first client exposes GamesDB under `play.gamesdb`:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
const zuuid = createZuuidClient({
|
|
149
|
+
providers: { gamesdb: { apiKey: process.env.GAMESDB_API_KEY! } }
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const game = await zuuid.play.gamesdb?.game.fetch({ id: 17444 });
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
GamesDB transforms accept both simple flat payloads and native TheGamesDB API envelopes with `data.games`, `data.platforms`, lookup maps, and `boxart` image metadata.
|
|
156
|
+
|
|
157
|
+
## IMDb Scraper
|
|
158
|
+
|
|
159
|
+
IMDb can be used as a credential-free alternative source when you already have an IMDb title ID. It scrapes the title page, preserves the fetched HTML and extracted JSON-LD in the raw `SourceRecord`, and transforms the JSON-LD into normalized `ZuuidData`.
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import { ImdbProvider } from "@zivue/zuuid/providers/imdb";
|
|
163
|
+
|
|
164
|
+
const imdb = new ImdbProvider();
|
|
165
|
+
const movie = await imdb.fetchMovie({ id: "tt0137523" });
|
|
166
|
+
const tv = await imdb.fetchTv({ id: "tt0944947" });
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The category-first client exposes the same fetch-only provider under `movie.imdb` and `tv.imdb`:
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
const zuuid = createZuuidClient({ providers: { imdb: {} } });
|
|
173
|
+
const movie = await zuuid.movie.imdb?.fetch({ id: "tt0137523" });
|
|
174
|
+
```
|
|
124
175
|
|
|
125
176
|
## TMDB Credentials
|
|
126
177
|
|
|
@@ -357,22 +408,17 @@ npm run example:fetch -- book OL82563W
|
|
|
357
408
|
npm run example:fetch -- author OL23919A
|
|
358
409
|
```
|
|
359
410
|
|
|
360
|
-
Fetch
|
|
411
|
+
Fetch live provider examples:
|
|
361
412
|
|
|
362
413
|
```sh
|
|
363
|
-
npm run example:fetch --
|
|
364
|
-
npm run example:fetch --
|
|
365
|
-
npm run example:fetch --
|
|
366
|
-
npm run example:fetch --
|
|
367
|
-
npm run example:fetch -- comicvine:issue 101
|
|
368
|
-
npm run example:fetch -- comicvine:story_arc 201
|
|
369
|
-
npm run example:fetch -- jikan:producer 14
|
|
370
|
-
npm run example:fetch -- jikan:magazine 1
|
|
371
|
-
npm run example:fetch -- openfoodfacts:product 3017620422003
|
|
372
|
-
npm run example:fetch -- openstreetmap:venue W123456
|
|
373
|
-
npm run example:fetch -- wger:equipment 7
|
|
414
|
+
npm run example:fetch -- imdb:movie tt0137523
|
|
415
|
+
npm run example:fetch -- imdb:tv tt0944947
|
|
416
|
+
GAMESDB_API_KEY=... npm run example:fetch -- gamesdb:game 17444
|
|
417
|
+
GAMESDB_API_KEY=... npm run example:fetch -- gamesdb:platform 6
|
|
374
418
|
```
|
|
375
419
|
|
|
420
|
+
Transformer-only providers do not have fetch examples. Wrap a real payload from your own provider client in a `SourceRecord` and call the transformer directly.
|
|
421
|
+
|
|
376
422
|
`example:fetch` writes both raw and transformed JSON:
|
|
377
423
|
|
|
378
424
|
```text
|
|
@@ -403,14 +449,18 @@ Provider exports:
|
|
|
403
449
|
|
|
404
450
|
- `TmdbProvider`
|
|
405
451
|
- `OpenLibraryProvider`
|
|
452
|
+
- `ImdbProvider`
|
|
453
|
+
- `GamesDbProvider`
|
|
406
454
|
- `transformTmdbMovie(sourceRecord, options?)`
|
|
407
455
|
- `transformTmdbTv(sourceRecord, options?)`
|
|
408
456
|
- `transformTmdbPerson(sourceRecord, options?)`
|
|
457
|
+
- `transformImdbMovie(sourceRecord, options?)`
|
|
458
|
+
- `transformImdbTv(sourceRecord, options?)`
|
|
409
459
|
- `transformOpenLibraryBook(sourceRecord, options?)`
|
|
410
460
|
- `transformOpenLibraryAuthor(sourceRecord, options?)`
|
|
411
461
|
- `transformComicVine(sourceRecord)`
|
|
412
462
|
- `transformGamesDbGame(sourceRecord, options?)`
|
|
413
|
-
- `transformGamesDbPlatform(sourceRecord)`
|
|
463
|
+
- `transformGamesDbPlatform(sourceRecord, options?)`
|
|
414
464
|
- `transformJikan(sourceRecord)`
|
|
415
465
|
- `transformMusicBrainzRelease(sourceRecord, options?)`
|
|
416
466
|
- `transformMusicBrainzReleaseGroup(sourceRecord, options?)`
|
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { SearchResponse, ZuuidData, ZuuidSearchResult } from "./entity.js";
|
|
2
2
|
import { type FetchOpenLibraryAuthorInput, type FetchOpenLibraryBookInput, type OpenLibraryProviderOptions, type OpenLibrarySearchInput } from "./providers/openlibrary/index.js";
|
|
3
3
|
import { type FetchTmdbMovieInput, type FetchTmdbPersonInput, type FetchTmdbTvInput, type TmdbProviderOptions, type TmdbSearchInput } from "./providers/tmdb/index.js";
|
|
4
|
+
import { type FetchGamesDbGameInput, type FetchGamesDbPlatformInput, type GamesDbProviderOptions, type GamesDbSearchInput } from "./providers/gamesdb/index.js";
|
|
5
|
+
import { type FetchImdbTitleInput, type ImdbProviderOptions } from "./providers/imdb/index.js";
|
|
4
6
|
import type { SourceRecord } from "./source.js";
|
|
5
7
|
export type ProviderConfigs = {
|
|
8
|
+
gamesdb?: GamesDbProviderOptions;
|
|
9
|
+
imdb?: ImdbProviderOptions;
|
|
6
10
|
openlibrary?: OpenLibraryProviderOptions;
|
|
7
11
|
tmdb?: TmdbProviderOptions;
|
|
8
12
|
};
|
|
@@ -16,6 +20,11 @@ export type MovieProviderClient<TFetchInput> = {
|
|
|
16
20
|
searchSourceRecords(input: TmdbSearchInput): Promise<SearchResponse<SourceRecord>>;
|
|
17
21
|
transform(source: SourceRecord): Promise<ZuuidData>;
|
|
18
22
|
};
|
|
23
|
+
export type FetchOnlyProviderClient<TFetchInput> = {
|
|
24
|
+
fetch(input: TFetchInput): Promise<ZuuidData | undefined>;
|
|
25
|
+
fetchSourceRecord(input: TFetchInput): Promise<SourceRecord | undefined>;
|
|
26
|
+
transform(source: SourceRecord): Promise<ZuuidData>;
|
|
27
|
+
};
|
|
19
28
|
export type ProviderClient<TFetchInput, TSearchInput> = {
|
|
20
29
|
fetch(input: TFetchInput): Promise<ZuuidData | undefined>;
|
|
21
30
|
fetchSourceRecord(input: TFetchInput): Promise<SourceRecord | undefined>;
|
|
@@ -25,9 +34,11 @@ export type ProviderClient<TFetchInput, TSearchInput> = {
|
|
|
25
34
|
};
|
|
26
35
|
export type ZuuidClient = {
|
|
27
36
|
movie: {
|
|
37
|
+
imdb?: FetchOnlyProviderClient<FetchImdbTitleInput>;
|
|
28
38
|
tmdb?: ProviderClient<FetchTmdbMovieInput, TmdbSearchInput>;
|
|
29
39
|
};
|
|
30
40
|
tv: {
|
|
41
|
+
imdb?: FetchOnlyProviderClient<FetchImdbTitleInput>;
|
|
31
42
|
tmdb?: ProviderClient<FetchTmdbTvInput, TmdbSearchInput>;
|
|
32
43
|
};
|
|
33
44
|
people: {
|
|
@@ -37,6 +48,12 @@ export type ZuuidClient = {
|
|
|
37
48
|
read: {
|
|
38
49
|
openlibrary?: ProviderClient<FetchOpenLibraryBookInput, OpenLibrarySearchInput>;
|
|
39
50
|
};
|
|
51
|
+
play: {
|
|
52
|
+
gamesdb?: {
|
|
53
|
+
game: ProviderClient<FetchGamesDbGameInput, GamesDbSearchInput>;
|
|
54
|
+
platform: FetchOnlyProviderClient<FetchGamesDbPlatformInput>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
40
57
|
};
|
|
41
58
|
export declare function createZuuidClient(config?: ZuuidClientConfig): ZuuidClient;
|
|
42
59
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,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C;KACjF,CAAC;IACF,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE;YACR,IAAI,EAAE,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;YAChE,QAAQ,EAAE,uBAAuB,CAAC,yBAAyB,CAAC,CAAC;SAC9D,CAAC;KACH,CAAC;CACH,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,iBAAsB,GAAG,WAAW,CA6F7E"}
|
package/dist/client.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { OpenLibraryProvider, transformOpenLibraryAuthor, transformOpenLibraryBook } from "./providers/openlibrary/index.js";
|
|
2
2
|
import { TmdbProvider, transformTmdbMovie, transformTmdbPerson, transformTmdbTv } from "./providers/tmdb/index.js";
|
|
3
|
+
import { GamesDbProvider, transformGamesDbGame, transformGamesDbPlatform } from "./providers/gamesdb/index.js";
|
|
4
|
+
import { ImdbProvider, transformImdbMovie, transformImdbTv } from "./providers/imdb/index.js";
|
|
3
5
|
export function createZuuidClient(config = {}) {
|
|
6
|
+
const gamesdb = config.providers?.gamesdb ? new GamesDbProvider(config.providers.gamesdb) : undefined;
|
|
7
|
+
const imdb = config.providers?.imdb ? new ImdbProvider(config.providers.imdb) : undefined;
|
|
4
8
|
const openlibrary = config.providers?.openlibrary ? new OpenLibraryProvider(config.providers.openlibrary) : undefined;
|
|
5
9
|
const tmdb = config.providers?.tmdb ? new TmdbProvider(config.providers.tmdb) : undefined;
|
|
6
10
|
return Object.freeze({
|
|
7
11
|
movie: Object.freeze({
|
|
12
|
+
imdb: imdb
|
|
13
|
+
? Object.freeze({
|
|
14
|
+
fetch: (input) => imdb.fetchMovie(input),
|
|
15
|
+
fetchSourceRecord: (input) => imdb.fetchMovieSourceRecord(input),
|
|
16
|
+
transform: (source) => transformImdbMovie(source, imdb.transformOptions())
|
|
17
|
+
})
|
|
18
|
+
: undefined,
|
|
8
19
|
tmdb: tmdb
|
|
9
20
|
? Object.freeze({
|
|
10
21
|
fetch: (input) => tmdb.fetchMovie(input),
|
|
@@ -16,6 +27,13 @@ export function createZuuidClient(config = {}) {
|
|
|
16
27
|
: undefined
|
|
17
28
|
}),
|
|
18
29
|
tv: Object.freeze({
|
|
30
|
+
imdb: imdb
|
|
31
|
+
? Object.freeze({
|
|
32
|
+
fetch: (input) => imdb.fetchTv(input),
|
|
33
|
+
fetchSourceRecord: (input) => imdb.fetchTvSourceRecord(input),
|
|
34
|
+
transform: (source) => transformImdbTv(source, imdb.transformOptions())
|
|
35
|
+
})
|
|
36
|
+
: undefined,
|
|
19
37
|
tmdb: tmdb
|
|
20
38
|
? Object.freeze({
|
|
21
39
|
fetch: (input) => tmdb.fetchTv(input),
|
|
@@ -56,6 +74,24 @@ export function createZuuidClient(config = {}) {
|
|
|
56
74
|
transform: (source) => transformOpenLibraryBook(source, openlibrary.transformOptions())
|
|
57
75
|
})
|
|
58
76
|
: undefined
|
|
77
|
+
}),
|
|
78
|
+
play: Object.freeze({
|
|
79
|
+
gamesdb: gamesdb
|
|
80
|
+
? Object.freeze({
|
|
81
|
+
game: Object.freeze({
|
|
82
|
+
fetch: (input) => gamesdb.fetchGame(input),
|
|
83
|
+
fetchSourceRecord: (input) => gamesdb.fetchGameSourceRecord(input),
|
|
84
|
+
search: (input) => gamesdb.searchGames(input),
|
|
85
|
+
searchSourceRecords: (input) => gamesdb.searchGameSourceRecords(input),
|
|
86
|
+
transform: (source) => transformGamesDbGame(source, gamesdb.transformOptions())
|
|
87
|
+
}),
|
|
88
|
+
platform: Object.freeze({
|
|
89
|
+
fetch: (input) => gamesdb.fetchPlatform(input),
|
|
90
|
+
fetchSourceRecord: (input) => gamesdb.fetchPlatformSourceRecord(input),
|
|
91
|
+
transform: (source) => transformGamesDbPlatform(source, gamesdb.transformOptions())
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
: undefined
|
|
59
95
|
})
|
|
60
96
|
});
|
|
61
97
|
}
|
package/dist/identity.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ProviderName = "musicbrainz" | "gamesdb" | "openlibrary" | "tmdb" | "jikan" | "comicvine" | "setlistfm" | "ticketmaster" | "podcast" | "openstreetmap" | "wger" | "openfoodfacts" | "goodreads" | "rss" | "web";
|
|
1
|
+
export type ProviderName = "musicbrainz" | "gamesdb" | "openlibrary" | "imdb" | "tmdb" | "jikan" | "comicvine" | "setlistfm" | "ticketmaster" | "podcast" | "openstreetmap" | "wger" | "openfoodfacts" | "goodreads" | "rss" | "web";
|
|
2
2
|
export type ProviderNamespace = {
|
|
3
3
|
provider: ProviderName;
|
|
4
4
|
namespace: string;
|
package/dist/identity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,SAAS,GACT,aAAa,GACb,MAAM,GACN,OAAO,GACP,WAAW,GACX,WAAW,GACX,cAAc,GACd,SAAS,GACT,eAAe,GACf,MAAM,GACN,eAAe,GACf,WAAW,GACX,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,SAAS,GACT,aAAa,GACb,MAAM,GACN,MAAM,GACN,OAAO,GACP,WAAW,GACX,WAAW,GACX,cAAc,GACd,SAAS,GACT,eAAe,GACf,MAAM,GACN,eAAe,GACf,WAAW,GACX,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAiBlD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEtE;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB9E"}
|
package/dist/identity.js
CHANGED
|
@@ -3,6 +3,7 @@ export const PROVIDER_NAMESPACES = [
|
|
|
3
3
|
{ provider: "musicbrainz", namespace: "9e4a2c71-f528-4d83-b710-a40c3e917f2a" },
|
|
4
4
|
{ provider: "gamesdb", namespace: "7ca1b820-aebc-41d2-90c5-00d05fe440d9" },
|
|
5
5
|
{ provider: "openlibrary", namespace: "3ea1c742-b50f-4a93-912d-7c8e1fa364d1" },
|
|
6
|
+
{ provider: "imdb", namespace: "0a29a9f5-9d8f-45d7-8d18-03d966bdadfb" },
|
|
6
7
|
{ provider: "tmdb", namespace: "6ba7b810-9dad-11d1-80b4-00c04fd430c8" },
|
|
7
8
|
{ provider: "jikan", namespace: "7ca8b920-aebe-22e2-91c5-01d15ee541d9" },
|
|
8
9
|
{ provider: "comicvine", namespace: "8db9ca31-bfcf-33f3-a2d6-12e26ff652ea" },
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./entity.js";
|
|
|
4
4
|
export * from "./identity.js";
|
|
5
5
|
export * from "./providers/comicvine/index.js";
|
|
6
6
|
export * from "./providers/gamesdb/index.js";
|
|
7
|
+
export * from "./providers/imdb/index.js";
|
|
7
8
|
export * from "./providers/jikan/index.js";
|
|
8
9
|
export * from "./providers/musicbrainz/index.js";
|
|
9
10
|
export * from "./providers/openlibrary/index.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./entity.js";
|
|
|
4
4
|
export * from "./identity.js";
|
|
5
5
|
export * from "./providers/comicvine/index.js";
|
|
6
6
|
export * from "./providers/gamesdb/index.js";
|
|
7
|
+
export * from "./providers/imdb/index.js";
|
|
7
8
|
export * from "./providers/jikan/index.js";
|
|
8
9
|
export * from "./providers/musicbrainz/index.js";
|
|
9
10
|
export * from "./providers/openlibrary/index.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SearchResponse, ZuuidData, ZuuidSearchResult } from "../../entity.js";
|
|
2
|
+
import type { SourceRecord } from "../../source.js";
|
|
3
|
+
import type { FetchGamesDbGameInput, FetchGamesDbPlatformInput, GamesDbProviderOptions, GamesDbSearchInput, GamesDbTransformOptions } from "./types.js";
|
|
4
|
+
export declare class GamesDbProvider {
|
|
5
|
+
readonly apiBase: string;
|
|
6
|
+
readonly imageBaseUrl: string | null;
|
|
7
|
+
private readonly apiKey;
|
|
8
|
+
private readonly fetchImpl;
|
|
9
|
+
constructor(options: GamesDbProviderOptions);
|
|
10
|
+
getJson<T>(path: string, params: Record<string, string>): Promise<T | undefined>;
|
|
11
|
+
transformOptions(): GamesDbTransformOptions;
|
|
12
|
+
fetchGameSourceRecord(input: FetchGamesDbGameInput): Promise<SourceRecord | undefined>;
|
|
13
|
+
fetchGame(input: FetchGamesDbGameInput): Promise<ZuuidData | undefined>;
|
|
14
|
+
searchGameSourceRecords(input: GamesDbSearchInput): Promise<SearchResponse<SourceRecord>>;
|
|
15
|
+
searchGames(input: GamesDbSearchInput): Promise<SearchResponse<ZuuidSearchResult>>;
|
|
16
|
+
fetchPlatformSourceRecord(input: FetchGamesDbPlatformInput): Promise<SourceRecord | undefined>;
|
|
17
|
+
fetchPlatform(input: FetchGamesDbPlatformInput): Promise<ZuuidData | undefined>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/providers/gamesdb/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAoB,sBAAsB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1K,qBAAa,eAAe;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;gBAEjC,OAAO,EAAE,sBAAsB;IAUrC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAmBtF,gBAAgB,IAAI,uBAAuB;IAIrC,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAItF,SAAS,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAKvE,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAIzF,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAIlF,yBAAyB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAI9F,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CAItF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { GAMESDB_API_BASE, GAMESDB_IMAGE_BASE_URL } from "./constants.js";
|
|
2
|
+
import { fetchGamesDbGameSourceRecord, searchGamesDbGameSourceRecords, searchGamesDbGames, transformGamesDbGame } from "./game.js";
|
|
3
|
+
import { fetchGamesDbPlatformSourceRecord, transformGamesDbPlatform } from "./platform.js";
|
|
4
|
+
export class GamesDbProvider {
|
|
5
|
+
apiBase;
|
|
6
|
+
imageBaseUrl;
|
|
7
|
+
apiKey;
|
|
8
|
+
fetchImpl;
|
|
9
|
+
constructor(options) {
|
|
10
|
+
this.apiKey = options.apiKey.trim();
|
|
11
|
+
if (!this.apiKey) {
|
|
12
|
+
throw new Error("GamesDB API key must not be empty");
|
|
13
|
+
}
|
|
14
|
+
this.apiBase = options.apiBase ?? GAMESDB_API_BASE;
|
|
15
|
+
this.fetchImpl = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
16
|
+
this.imageBaseUrl = options.imageBaseUrl === undefined ? GAMESDB_IMAGE_BASE_URL : options.imageBaseUrl;
|
|
17
|
+
}
|
|
18
|
+
async getJson(path, params) {
|
|
19
|
+
const url = new URL(`${this.apiBase.replace(/\/$/, "")}/${path.replace(/^\//, "")}`);
|
|
20
|
+
url.searchParams.set("apikey", this.apiKey);
|
|
21
|
+
for (const [key, value] of Object.entries(params)) {
|
|
22
|
+
url.searchParams.set(key, value);
|
|
23
|
+
}
|
|
24
|
+
const response = await this.fetchImpl(url, { headers: { accept: "application/json" } });
|
|
25
|
+
if (response.status === 404) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
const body = await response.text().catch(() => "");
|
|
30
|
+
throw new Error(`GamesDB API returned ${response.status}: ${body}`);
|
|
31
|
+
}
|
|
32
|
+
return response.json();
|
|
33
|
+
}
|
|
34
|
+
transformOptions() {
|
|
35
|
+
return { imageBaseUrl: this.imageBaseUrl };
|
|
36
|
+
}
|
|
37
|
+
async fetchGameSourceRecord(input) {
|
|
38
|
+
return fetchGamesDbGameSourceRecord(this, input);
|
|
39
|
+
}
|
|
40
|
+
async fetchGame(input) {
|
|
41
|
+
const source = await this.fetchGameSourceRecord(input);
|
|
42
|
+
return source ? transformGamesDbGame(source, this.transformOptions()) : undefined;
|
|
43
|
+
}
|
|
44
|
+
async searchGameSourceRecords(input) {
|
|
45
|
+
return searchGamesDbGameSourceRecords(this, input);
|
|
46
|
+
}
|
|
47
|
+
async searchGames(input) {
|
|
48
|
+
return searchGamesDbGames(this, input, this.transformOptions());
|
|
49
|
+
}
|
|
50
|
+
async fetchPlatformSourceRecord(input) {
|
|
51
|
+
return fetchGamesDbPlatformSourceRecord(this, input);
|
|
52
|
+
}
|
|
53
|
+
async fetchPlatform(input) {
|
|
54
|
+
const source = await this.fetchPlatformSourceRecord(input);
|
|
55
|
+
return source ? transformGamesDbPlatform(source, this.transformOptions()) : undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const GAMESDB_PROVIDER = "gamesdb";
|
|
2
|
+
export declare const GAMESDB_API_BASE = "https://api.thegamesdb.net/v1";
|
|
3
|
+
export declare const GAMESDB_IMAGE_BASE_URL = "https://cdn.thegamesdb.net/images";
|
|
2
4
|
export declare const GAMESDB_GAME_CATEGORY = "game";
|
|
3
5
|
export declare const GAMESDB_PLATFORM_CATEGORY = "platform";
|
|
4
6
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/providers/gamesdb/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAC5C,eAAO,MAAM,yBAAyB,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/providers/gamesdb/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAChE,eAAO,MAAM,sBAAsB,sCAAsC,CAAC;AAC1E,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAC5C,eAAO,MAAM,yBAAyB,aAAa,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export const GAMESDB_PROVIDER = "gamesdb";
|
|
2
|
+
export const GAMESDB_API_BASE = "https://api.thegamesdb.net/v1";
|
|
3
|
+
export const GAMESDB_IMAGE_BASE_URL = "https://cdn.thegamesdb.net/images";
|
|
2
4
|
export const GAMESDB_GAME_CATEGORY = "game";
|
|
3
5
|
export const GAMESDB_PLATFORM_CATEGORY = "platform";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ZuuidData } from "../../entity.js";
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { SearchResponse, ZuuidData, ZuuidSearchResult } from "../../entity.js";
|
|
2
|
+
import { type SourceRecord } from "../../source.js";
|
|
3
|
+
import type { GamesDbProvider } from "./client.js";
|
|
4
|
+
import type { FetchGamesDbGameInput, GamesDbSearchInput, GamesDbTransformOptions } from "./types.js";
|
|
5
|
+
export declare function fetchGamesDbGameSourceRecord(provider: GamesDbProvider, input: FetchGamesDbGameInput): Promise<SourceRecord | undefined>;
|
|
6
|
+
export declare function searchGamesDbGameSourceRecords(provider: GamesDbProvider, input: GamesDbSearchInput): Promise<SearchResponse<SourceRecord>>;
|
|
7
|
+
export declare function searchGamesDbGames(provider: GamesDbProvider, input: GamesDbSearchInput, options?: GamesDbTransformOptions): Promise<SearchResponse<ZuuidSearchResult>>;
|
|
6
8
|
export declare function transformGamesDbGame(source: SourceRecord, options?: GamesDbTransformOptions): Promise<ZuuidData>;
|
|
7
9
|
//# sourceMappingURL=game.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../../src/providers/gamesdb/game.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../../src/providers/gamesdb/game.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAmBrG,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CASnC;AAED,wBAAsB,8BAA8B,CAClD,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAOvC;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAyB5C;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,SAAS,CAAC,CAoCpB"}
|