anilink-api-wrapper 2.2.0 → 3.0.0
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/README.md +16 -11
- package/dist/AniLink.d.ts +10457 -7104
- package/dist/AniLink.mjs +3944 -2214
- package/dist/anilist.d.ts +1 -1
- package/dist/anilist.mjs +1 -1
- package/dist/mal.d.ts +1 -1
- package/dist/mal.mjs +1 -1
- package/package.json +38 -24
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://github.com/RLAlpha49/AniLink/actions/workflows/codeql.yml)
|
|
12
12
|
[](https://anilink.alpha49.com/)
|
|
13
13
|
|
|
14
|
-
A typed TypeScript wrapper for the [AniList GraphQL API](https://docs.anilist.co/) and the [MyAnimeList REST API](https://myanimelist.net/apiconfig/references/api/v2). One class
|
|
14
|
+
A typed TypeScript wrapper for the [AniList GraphQL API](https://docs.anilist.co/) and the [MyAnimeList REST API](https://myanimelist.net/apiconfig/references/api/v2). One class exposes two isolated provider namespaces. Every operation with inputs takes a single typed params object plus an optional trailing options object. The parameterless reads, `mal.user.me(options?)` and `mal.anime.suggestions(options?)`, take the options object alone. Normalized errors, retries, pacing, and caching work identically on both.
|
|
15
15
|
|
|
16
16
|
## Quickstart
|
|
17
17
|
|
|
@@ -19,36 +19,41 @@ A typed TypeScript wrapper for the [AniList GraphQL API](https://docs.anilist.co
|
|
|
19
19
|
npm install anilink-api-wrapper
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
Requires Node.js 22 or later. The package is ESM-only, so use `import` syntax, not CommonJS `require`.
|
|
23
|
+
|
|
22
24
|
```typescript
|
|
23
25
|
import { AniLink } from "anilink-api-wrapper";
|
|
24
26
|
|
|
25
|
-
// AniList (GraphQL)
|
|
27
|
+
// AniList (GraphQL) needs no token for public queries
|
|
26
28
|
const aniLink = new AniLink();
|
|
27
29
|
const anime = await aniLink.anilist.query.media({ id: 21, type: "ANIME" });
|
|
28
30
|
|
|
29
|
-
// MyAnimeList (REST)
|
|
31
|
+
// MyAnimeList (REST) has its own credential slot
|
|
30
32
|
const client = new AniLink({ mal: { accessToken: "mal-token" } });
|
|
31
|
-
const malAnime = await client.mal.anime.get(
|
|
33
|
+
const malAnime = await client.mal.anime.get(
|
|
34
|
+
{ id: 21 },
|
|
35
|
+
{ fields: ["id", "title", "main_picture"] }
|
|
36
|
+
);
|
|
32
37
|
```
|
|
33
38
|
|
|
34
39
|
## What you can do
|
|
35
40
|
|
|
36
|
-
| Provider | Namespace | Capabilities
|
|
37
|
-
| --------------- | ----------------- |
|
|
38
|
-
| **AniList** | `aniLink.anilist` | Queries, page queries, mutations, pagination helpers, `custom()`, data helpers
|
|
39
|
-
| **MyAnimeList** | `aniLink.mal` | `anime.get`, `manga.get`, and `user.me` REST reads with field selection, plus `anime`/`manga` `updateMyListStatus` and `deleteFromList` list-status writes
|
|
41
|
+
| Provider | Namespace | Capabilities |
|
|
42
|
+
| --------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| **AniList** | `aniLink.anilist` | Queries, page queries, mutations, pagination helpers, `custom()`, data helpers, and the `crossLink` AniList to MAL id mapping |
|
|
44
|
+
| **MyAnimeList** | `aniLink.mal` | `anime.get`, `manga.get`, and `user.me`/`user.get` REST reads with field selection, the `anime.search`/`manga.search` keyword searches, the `seasonal`, `anime.ranking`/`manga.ranking`, and `suggestions` discovery reads, paginated `user.animeList`/`user.mangaList` user-list reads, the `forum.boards`/`forum.topics`/`forum.topic` forum reads, plus `anime`/`manga` `updateMyListStatus` and `deleteFromList` list-status writes |
|
|
40
45
|
|
|
41
|
-
Both
|
|
46
|
+
Both namespaces share one transport layer, which handles timeouts, retries, pacing, circuit breaking, and hooks. Each provider slot has its own credentials and transport settings.
|
|
42
47
|
|
|
43
48
|
## Documentation
|
|
44
49
|
|
|
45
|
-
|
|
|
50
|
+
| Docs | Start here |
|
|
46
51
|
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
47
52
|
| **Guides** | [Introduction](https://anilink.alpha49.com/introduction) · [Getting started](https://anilink.alpha49.com/getting-started) · [Provider configuration](https://anilink.alpha49.com/provider-configuration) · [Per-request options](https://anilink.alpha49.com/per-request-options) · [Error handling](https://anilink.alpha49.com/error-handling) · [Retries & resilience](https://anilink.alpha49.com/retries-and-resilience) · [Cancellation & timeouts](https://anilink.alpha49.com/cancellation-and-timeouts) · [Observability](https://anilink.alpha49.com/observability) · [Recipes](https://anilink.alpha49.com/recipes) · [TypeScript patterns](https://anilink.alpha49.com/typescript-patterns) · [Troubleshooting](https://anilink.alpha49.com/troubleshooting) |
|
|
48
53
|
| **AniList guides** | [Authentication](https://anilink.alpha49.com/guides/anilist/authentication) · [Client configuration](https://anilink.alpha49.com/guides/anilist/configuration) · [Querying](https://anilink.alpha49.com/guides/anilist/querying) · [Page queries](https://anilink.alpha49.com/guides/anilist/page-queries) · [Pagination](https://anilink.alpha49.com/guides/anilist/pagination) · [Mutations](https://anilink.alpha49.com/guides/anilist/mutations) · [Custom queries](https://anilink.alpha49.com/guides/anilist/custom-queries) · [Helpers](https://anilink.alpha49.com/guides/anilist/helpers) |
|
|
49
54
|
| **MAL guides** | [Authentication](https://anilink.alpha49.com/guides/mal/authentication) · [Client configuration](https://anilink.alpha49.com/guides/mal/configuration) · [Operations](https://anilink.alpha49.com/guides/mal/operations) |
|
|
50
55
|
| **Operation reference** | [Overview](https://anilink.alpha49.com/operations/) · [AniList catalog](https://anilink.alpha49.com/operations/anilist) · [MAL catalog](https://anilink.alpha49.com/operations/mal) |
|
|
51
|
-
| **API reference (TypeDoc)** | [AniLink](https://anilink.alpha49.com/classes/AniLink.AniLink.html)
|
|
56
|
+
| **API reference (TypeDoc)** | [AniLink](https://anilink.alpha49.com/classes/AniLink.AniLink.html) class; the full generated reference is at the [docs root](https://anilink.alpha49.com/) |
|
|
52
57
|
|
|
53
58
|
## Development
|
|
54
59
|
|