@crysoline/lib 0.1.5 → 0.1.7
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/core/anime/123anime/index.d.ts +27 -0
- package/dist/core/anime/123anime/index.js +18 -0
- package/dist/core/anime/anicore/index.d.ts +27 -0
- package/dist/core/anime/anicore/index.js +18 -0
- package/dist/core/anime/anicore/types.d.ts +16 -0
- package/dist/core/anime/anicore/types.js +1 -0
- package/dist/core/anime/anidap/index.d.ts +27 -0
- package/dist/core/anime/anidap/index.js +18 -0
- package/dist/core/anime/aniliberty/index.d.ts +28 -0
- package/dist/core/anime/aniliberty/index.js +19 -0
- package/dist/core/anime/aniliberty/types.d.ts +31 -0
- package/dist/core/anime/aniliberty/types.js +1 -0
- package/dist/core/anime/anime3rb/index.d.ts +28 -0
- package/dist/core/anime/anime3rb/index.js +19 -0
- package/dist/core/anime/anime3rb/types.d.ts +7 -0
- package/dist/core/anime/anime3rb/types.js +1 -0
- package/dist/core/anime/animeav1/index.d.ts +28 -0
- package/dist/core/anime/animeav1/index.js +19 -0
- package/dist/core/anime/animeav1/types.d.ts +17 -0
- package/dist/core/anime/animeav1/types.js +1 -0
- package/dist/core/anime/animegg/index.d.ts +28 -0
- package/dist/core/anime/animegg/index.js +19 -0
- package/dist/core/anime/animegg/types.d.ts +14 -0
- package/dist/core/anime/animegg/types.js +1 -0
- package/dist/core/anime/animeheaven/index.d.ts +27 -0
- package/dist/core/anime/animeheaven/index.js +18 -0
- package/dist/core/anime/animeheaven/types.d.ts +1 -1
- package/dist/core/anime/animekai/index.d.ts +27 -0
- package/dist/core/anime/animekai/index.js +18 -0
- package/dist/core/anime/animekai/types.d.ts +7 -7
- package/dist/core/anime/animelib/index.d.ts +32 -0
- package/dist/core/anime/animelib/index.js +19 -0
- package/dist/core/anime/animelib/types.d.ts +12 -0
- package/dist/core/anime/animelib/types.js +1 -0
- package/dist/core/anime/animemeow/index.d.ts +28 -0
- package/dist/core/anime/animemeow/index.js +19 -0
- package/dist/core/anime/animemeow/types.d.ts +6 -0
- package/dist/core/anime/animemeow/types.js +1 -0
- package/dist/core/anime/animenexus/index.d.ts +27 -0
- package/dist/core/anime/animenexus/index.js +18 -0
- package/dist/core/anime/animenexus/types.d.ts +16 -16
- package/dist/core/anime/animenix/index.d.ts +28 -0
- package/dist/core/anime/animenix/index.js +19 -0
- package/dist/core/anime/animenix/types.d.ts +6 -0
- package/dist/core/anime/animenix/types.js +1 -0
- package/dist/core/anime/animeonsen/index.d.ts +27 -0
- package/dist/core/anime/animeonsen/index.js +18 -0
- package/dist/core/anime/animeonsen/types.d.ts +8 -8
- package/dist/core/anime/animepahe/index.d.ts +27 -0
- package/dist/core/anime/animepahe/index.js +18 -0
- package/dist/core/anime/animeparadise/index.d.ts +26 -0
- package/dist/core/anime/animeparadise/index.js +18 -0
- package/dist/core/anime/anizone/index.d.ts +27 -0
- package/dist/core/anime/anizone/index.js +18 -0
- package/dist/core/anime/anizone/types.d.ts +5 -5
- package/dist/core/anime/hianime/index.d.ts +31 -0
- package/dist/core/anime/hianime/index.js +18 -0
- package/dist/core/anime/hianime/types.d.ts +8 -8
- package/dist/core/anime/index.d.ts +175 -44
- package/dist/core/anime/index.js +52 -233
- package/dist/core/anime/kickassanime/index.d.ts +27 -0
- package/dist/core/anime/kickassanime/index.js +18 -0
- package/dist/core/anime/kickassanime/types.d.ts +8 -8
- package/dist/core/anime/lunar/index.d.ts +28 -0
- package/dist/core/anime/lunar/index.js +19 -0
- package/dist/core/anime/lunar/types.d.ts +8 -8
- package/dist/core/anime/uniquestream/index.d.ts +27 -0
- package/dist/core/anime/uniquestream/index.js +18 -0
- package/dist/core/anime/uniquestream/types.d.ts +3 -3
- package/dist/core/extractors/index.d.ts +16 -0
- package/dist/core/extractors/index.js +10 -0
- package/dist/core/extractors/kodik/index.d.ts +1 -0
- package/dist/core/extractors/kodik/index.js +1 -0
- package/dist/core/extractors/kodik/types.d.ts +14 -0
- package/dist/core/extractors/kodik/types.js +1 -0
- package/dist/core/hentai/hanime/index.d.ts +28 -0
- package/dist/core/hentai/hanime/index.js +19 -0
- package/dist/core/hentai/hentaigasm/index.d.ts +14 -0
- package/dist/core/hentai/hentaigasm/index.js +5 -0
- package/dist/core/hentai/hentaigasm/types.d.ts +15 -0
- package/dist/core/hentai/hentaigasm/types.js +1 -0
- package/dist/core/hentai/hentaihaven/index.d.ts +30 -0
- package/dist/core/hentai/hentaihaven/index.js +21 -0
- package/dist/core/hentai/hstream/index.d.ts +27 -0
- package/dist/core/hentai/hstream/index.js +18 -0
- package/dist/core/hentai/index.d.ts +39 -13
- package/dist/core/hentai/index.js +13 -58
- package/dist/core/hentai/watchhentai/index.d.ts +28 -0
- package/dist/core/hentai/watchhentai/index.js +19 -0
- package/dist/core/hentai/watchhentai/types.d.ts +16 -0
- package/dist/core/hentai/watchhentai/types.js +1 -0
- package/dist/core/index.d.ts +7 -5
- package/dist/core/index.js +7 -5
- package/dist/core/manga/1manga/index.d.ts +27 -0
- package/dist/core/manga/1manga/index.js +20 -0
- package/dist/core/manga/1manga/types.d.ts +17 -0
- package/dist/core/manga/1manga/types.js +1 -0
- package/dist/core/manga/comix/index.d.ts +28 -0
- package/dist/core/manga/comix/index.js +20 -0
- package/dist/core/manga/comix/types.d.ts +15 -0
- package/dist/core/manga/comix/types.js +1 -0
- package/dist/core/manga/index.d.ts +243 -11
- package/dist/core/manga/index.js +36 -67
- package/dist/core/manga/lunar/index.d.ts +27 -0
- package/dist/core/manga/lunar/index.js +19 -0
- package/dist/core/manga/lunar/types.d.ts +2 -2
- package/dist/core/manga/mangadex/index.d.ts +28 -0
- package/dist/core/manga/mangadex/index.js +20 -0
- package/dist/core/manga/mangadex/types.d.ts +2 -2
- package/dist/core/manga/mangafire/index.d.ts +27 -0
- package/dist/core/manga/mangafire/index.js +19 -0
- package/dist/core/manga/mangafire/types.d.ts +4 -4
- package/dist/core/manga/mbbcdn/index.d.ts +288 -0
- package/dist/core/manga/mbbcdn/index.js +200 -0
- package/dist/core/manga/mbbcdn/types.d.ts +14 -0
- package/dist/core/manga/mbbcdn/types.js +1 -0
- package/dist/core/manga/toonilycdn/index.d.ts +131 -0
- package/dist/core/manga/toonilycdn/index.js +91 -0
- package/dist/core/manga/toonilycdn/types.d.ts +14 -0
- package/dist/core/manga/toonilycdn/types.js +1 -0
- package/dist/core/manga/weebcentral/index.d.ts +28 -0
- package/dist/core/manga/weebcentral/index.js +20 -0
- package/dist/core/manga/weebcentral/types.d.ts +22 -0
- package/dist/core/manga/weebcentral/types.js +1 -0
- package/dist/core/mapper/index.d.ts +1 -0
- package/dist/core/mapper/index.js +1 -0
- package/dist/core/meta/anilist/index.d.ts +21 -0
- package/dist/core/meta/anilist/index.js +19 -0
- package/dist/core/meta/anilist/types.d.ts +69 -0
- package/dist/core/meta/anilist/types.js +1 -0
- package/dist/core/meta/index.d.ts +14 -8
- package/dist/core/meta/index.js +8 -51
- package/dist/core/meta/myanimelist/index.d.ts +20 -0
- package/dist/core/meta/myanimelist/index.js +18 -0
- package/dist/core/meta/myanimelist/types.d.ts +15 -15
- package/dist/core/meta/mymangalist/index.d.ts +7 -0
- package/dist/core/meta/mymangalist/index.js +5 -0
- package/dist/core/meta/mymangalist/types.d.ts +9 -9
- package/dist/core/novels/index.d.ts +41 -0
- package/dist/core/novels/index.js +11 -0
- package/dist/core/novels/jnovels/index.d.ts +26 -0
- package/dist/core/novels/jnovels/index.js +19 -0
- package/dist/core/novels/novelfire/index.d.ts +28 -0
- package/dist/core/novels/novelfire/index.js +20 -0
- package/dist/core/novels/novelfire/types.d.ts +4 -0
- package/dist/core/novels/novelfire/types.js +1 -0
- package/dist/core/novels/novelhall/index.d.ts +26 -0
- package/dist/core/novels/novelhall/index.js +19 -0
- package/dist/core/types.d.ts +8 -7
- package/dist/helpers/fetch.d.ts +14 -0
- package/dist/helpers/fetch.js +30 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +2 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface MyMangaListSearchMeta {
|
|
2
2
|
type: string | null;
|
|
3
3
|
score: string | null;
|
|
4
4
|
members: string | null;
|
|
5
5
|
volumes: string | null;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface MyMangaListLink {
|
|
8
8
|
label: string | null;
|
|
9
9
|
url: string | null;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface MyMangaListRelation {
|
|
12
12
|
id: number | null;
|
|
13
13
|
image: string | null;
|
|
14
14
|
title: string | null;
|
|
15
15
|
relationType: string | null;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface MyMangaListCharacter {
|
|
18
18
|
id: number | null;
|
|
19
19
|
image: string | null;
|
|
20
20
|
name: string | null;
|
|
21
21
|
role: string | null;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface MyMangaListVoiceActor {
|
|
24
24
|
id: number | null;
|
|
25
25
|
image: string | null;
|
|
26
26
|
name: string | null;
|
|
27
27
|
language: string | null;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface MyMangaListInfoMeta {
|
|
30
30
|
moreInfo: string | null;
|
|
31
31
|
score: string | null;
|
|
32
32
|
rank: string | null;
|
|
@@ -42,7 +42,7 @@ export interface MMLInfoMeta {
|
|
|
42
42
|
themes: string[] | null;
|
|
43
43
|
authors: string[] | null;
|
|
44
44
|
favorites: string | null;
|
|
45
|
-
externalLinks:
|
|
46
|
-
relations:
|
|
47
|
-
characters:
|
|
45
|
+
externalLinks: MyMangaListLink[] | null;
|
|
46
|
+
relations: MyMangaListRelation[] | null;
|
|
47
|
+
characters: MyMangaListCharacter[] | null;
|
|
48
48
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const Novels: {
|
|
2
|
+
JNovels: (apiKey: string) => {
|
|
3
|
+
name: string;
|
|
4
|
+
} & {
|
|
5
|
+
search: (q: string) => Promise<import("../types").Search<unknown>[]>;
|
|
6
|
+
info: (id: string | number) => Promise<import("../types").Info<unknown, import("../types").Episode<unknown>>>;
|
|
7
|
+
chapters: (id: string | number) => Promise<import("../types").Chapter<unknown>[]>;
|
|
8
|
+
pages: (params: {
|
|
9
|
+
id: string | number;
|
|
10
|
+
chapterId: string | number;
|
|
11
|
+
lang?: string;
|
|
12
|
+
}) => Promise<import("../types").Page[]>;
|
|
13
|
+
};
|
|
14
|
+
NovelFire: (apiKey: string) => {
|
|
15
|
+
name: string;
|
|
16
|
+
} & {
|
|
17
|
+
search: (q: string) => Promise<import("../types").Search<import("./novelfire").NovelFireSearchMeta>[]>;
|
|
18
|
+
info: (id: string | number) => Promise<import("../types").Info<unknown, import("../types").Episode<unknown>>>;
|
|
19
|
+
chapters: (id: string | number) => Promise<import("../types").Chapter<unknown>[]>;
|
|
20
|
+
pages: (params: {
|
|
21
|
+
id: string | number;
|
|
22
|
+
chapterId: string | number;
|
|
23
|
+
lang?: string;
|
|
24
|
+
}) => Promise<import("../types").Page[]>;
|
|
25
|
+
};
|
|
26
|
+
NovelHall: (apiKey: string) => {
|
|
27
|
+
name: string;
|
|
28
|
+
} & {
|
|
29
|
+
search: (q: string) => Promise<import("../types").Search<unknown>[]>;
|
|
30
|
+
info: (id: string | number) => Promise<import("../types").Info<unknown, import("../types").Episode<unknown>>>;
|
|
31
|
+
chapters: (id: string | number) => Promise<import("../types").Chapter<unknown>[]>;
|
|
32
|
+
pages: (params: {
|
|
33
|
+
id: string | number;
|
|
34
|
+
chapterId: string | number;
|
|
35
|
+
lang?: string;
|
|
36
|
+
}) => Promise<import("../types").Page[]>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export * from './jnovels';
|
|
40
|
+
export * from './novelfire';
|
|
41
|
+
export * from './novelhall';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JNovels } from './jnovels';
|
|
2
|
+
import { NovelFire } from './novelfire';
|
|
3
|
+
import { NovelHall } from './novelhall';
|
|
4
|
+
export const Novels = {
|
|
5
|
+
JNovels,
|
|
6
|
+
NovelFire,
|
|
7
|
+
NovelHall,
|
|
8
|
+
};
|
|
9
|
+
export * from './jnovels';
|
|
10
|
+
export * from './novelfire';
|
|
11
|
+
export * from './novelhall';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a JNovels API client.
|
|
3
|
+
*
|
|
4
|
+
* @param apiKey - Your API key for authentication
|
|
5
|
+
* @returns API client with methods: search, info, chapters, pages
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = JNovels(process.env.API_KEY);
|
|
10
|
+
* const results = await client.search("one piece");
|
|
11
|
+
* const info = await client.info(results[0].id);
|
|
12
|
+
* const chapters = await client.chapters(results[0].id);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const JNovels: (apiKey: string) => {
|
|
16
|
+
name: string;
|
|
17
|
+
} & {
|
|
18
|
+
search: (q: string) => Promise<import("../../types").Search<unknown>[]>;
|
|
19
|
+
info: (id: string | number) => Promise<import("../../types").Info<unknown, import("../../types").Episode<unknown>>>;
|
|
20
|
+
chapters: (id: string | number) => Promise<import("../../types").Chapter<unknown>[]>;
|
|
21
|
+
pages: (params: {
|
|
22
|
+
id: string | number;
|
|
23
|
+
chapterId: string | number;
|
|
24
|
+
lang?: string;
|
|
25
|
+
}) => Promise<import("../../types").Page[]>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NovelFetch } from '../../../helpers';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a JNovels API client.
|
|
4
|
+
*
|
|
5
|
+
* @param apiKey - Your API key for authentication
|
|
6
|
+
* @returns API client with methods: search, info, chapters, pages
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const client = JNovels(process.env.API_KEY);
|
|
11
|
+
* const results = await client.search("one piece");
|
|
12
|
+
* const info = await client.info(results[0].id);
|
|
13
|
+
* const chapters = await client.chapters(results[0].id);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const JNovels = (apiKey) => NovelFetch({
|
|
17
|
+
provider: 'jnovels',
|
|
18
|
+
apiKey,
|
|
19
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NovelFireSearchMeta } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a NovelFire API client.
|
|
4
|
+
*
|
|
5
|
+
* @param apiKey - Your API key for authentication
|
|
6
|
+
* @returns API client with methods: search, info, chapters, pages
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const client = NovelFire(process.env.API_KEY);
|
|
11
|
+
* const results = await client.search("one piece");
|
|
12
|
+
* const info = await client.info(results[0].id);
|
|
13
|
+
* const chapters = await client.chapters(results[0].id);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const NovelFire: (apiKey: string) => {
|
|
17
|
+
name: string;
|
|
18
|
+
} & {
|
|
19
|
+
search: (q: string) => Promise<import("../../types").Search<NovelFireSearchMeta>[]>;
|
|
20
|
+
info: (id: string | number) => Promise<import("../../types").Info<unknown, import("../../types").Episode<unknown>>>;
|
|
21
|
+
chapters: (id: string | number) => Promise<import("../../types").Chapter<unknown>[]>;
|
|
22
|
+
pages: (params: {
|
|
23
|
+
id: string | number;
|
|
24
|
+
chapterId: string | number;
|
|
25
|
+
lang?: string;
|
|
26
|
+
}) => Promise<import("../../types").Page[]>;
|
|
27
|
+
};
|
|
28
|
+
export * from './types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NovelFetch } from '../../../helpers';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a NovelFire API client.
|
|
4
|
+
*
|
|
5
|
+
* @param apiKey - Your API key for authentication
|
|
6
|
+
* @returns API client with methods: search, info, chapters, pages
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const client = NovelFire(process.env.API_KEY);
|
|
11
|
+
* const results = await client.search("one piece");
|
|
12
|
+
* const info = await client.info(results[0].id);
|
|
13
|
+
* const chapters = await client.chapters(results[0].id);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const NovelFire = (apiKey) => NovelFetch({
|
|
17
|
+
provider: 'novelfire',
|
|
18
|
+
apiKey,
|
|
19
|
+
});
|
|
20
|
+
export * from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a NovelHall API client.
|
|
3
|
+
*
|
|
4
|
+
* @param apiKey - Your API key for authentication
|
|
5
|
+
* @returns API client with methods: search, info, chapters, pages
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const client = NovelHall(process.env.API_KEY);
|
|
10
|
+
* const results = await client.search("one piece");
|
|
11
|
+
* const info = await client.info(results[0].id);
|
|
12
|
+
* const chapters = await client.chapters(results[0].id);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const NovelHall: (apiKey: string) => {
|
|
16
|
+
name: string;
|
|
17
|
+
} & {
|
|
18
|
+
search: (q: string) => Promise<import("../../types").Search<unknown>[]>;
|
|
19
|
+
info: (id: string | number) => Promise<import("../../types").Info<unknown, import("../../types").Episode<unknown>>>;
|
|
20
|
+
chapters: (id: string | number) => Promise<import("../../types").Chapter<unknown>[]>;
|
|
21
|
+
pages: (params: {
|
|
22
|
+
id: string | number;
|
|
23
|
+
chapterId: string | number;
|
|
24
|
+
lang?: string;
|
|
25
|
+
}) => Promise<import("../../types").Page[]>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NovelFetch } from '../../../helpers';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a NovelHall API client.
|
|
4
|
+
*
|
|
5
|
+
* @param apiKey - Your API key for authentication
|
|
6
|
+
* @returns API client with methods: search, info, chapters, pages
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const client = NovelHall(process.env.API_KEY);
|
|
11
|
+
* const results = await client.search("one piece");
|
|
12
|
+
* const info = await client.info(results[0].id);
|
|
13
|
+
* const chapters = await client.chapters(results[0].id);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const NovelHall = (apiKey) => NovelFetch({
|
|
17
|
+
provider: 'novelhall',
|
|
18
|
+
apiKey,
|
|
19
|
+
});
|
package/dist/core/types.d.ts
CHANGED
|
@@ -5,13 +5,14 @@ export interface Image {
|
|
|
5
5
|
large: string;
|
|
6
6
|
}
|
|
7
7
|
export interface Title {
|
|
8
|
-
english?: string | null
|
|
9
|
-
romaji?: string | null
|
|
10
|
-
japanese?: string | null
|
|
11
|
-
native?: string | null
|
|
8
|
+
english?: string | null;
|
|
9
|
+
romaji?: string | null;
|
|
10
|
+
japanese?: string | null;
|
|
11
|
+
native?: string | null;
|
|
12
|
+
other?: string | null;
|
|
12
13
|
}
|
|
13
14
|
export interface Chapter<T = unknown> {
|
|
14
|
-
id?: string | null;
|
|
15
|
+
id?: string | number | null;
|
|
15
16
|
title?: string | null;
|
|
16
17
|
number?: number | null;
|
|
17
18
|
rating?: number | null;
|
|
@@ -39,7 +40,7 @@ export interface Info<T = unknown, E = unknown> {
|
|
|
39
40
|
synonyms?: string[] | null;
|
|
40
41
|
description?: string | null;
|
|
41
42
|
image?: Image | null;
|
|
42
|
-
|
|
43
|
+
background?: Image | null;
|
|
43
44
|
logo?: Image | null;
|
|
44
45
|
airedEpisodes?: number | null;
|
|
45
46
|
totalEpisodes?: number | null;
|
|
@@ -78,7 +79,7 @@ export interface Download {
|
|
|
78
79
|
export interface VideoSource {
|
|
79
80
|
url?: string | null;
|
|
80
81
|
isM3U8?: boolean | null;
|
|
81
|
-
type?: VideoType | null;
|
|
82
|
+
type?: VideoType | string | null;
|
|
82
83
|
quality?: string | null;
|
|
83
84
|
isDub?: boolean | null;
|
|
84
85
|
}
|
package/dist/helpers/fetch.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { KodikTranslation } from '../core/extractors/kodik/types';
|
|
1
2
|
import type { Mapping } from '../core/mapper/types';
|
|
2
3
|
import type { Chapter, Episode, Info, Page, Search, Server, Source } from '../core/types';
|
|
3
4
|
type SearchRoute<T = unknown> = (q: string) => Promise<Search<T>[]>;
|
|
@@ -19,6 +20,7 @@ type PagesRoute = (params: {
|
|
|
19
20
|
chapterId: string | number;
|
|
20
21
|
lang?: string;
|
|
21
22
|
}) => Promise<Page[]>;
|
|
23
|
+
type TranslationsRoute = (id: string | number) => Promise<KodikTranslation[]>;
|
|
22
24
|
type MapRoute = (params: {
|
|
23
25
|
id: number;
|
|
24
26
|
provider: string;
|
|
@@ -31,6 +33,7 @@ type RouteMap<TSearchMeta = unknown, TInfoMeta = unknown, TEpisodeMeta = unknown
|
|
|
31
33
|
servers: ServersRoute<TServerMeta>;
|
|
32
34
|
chapters: ChaptersRoute<TChapterMeta>;
|
|
33
35
|
pages: PagesRoute;
|
|
36
|
+
translations: TranslationsRoute;
|
|
34
37
|
map: MapRoute;
|
|
35
38
|
};
|
|
36
39
|
type SelectRoutes = {
|
|
@@ -68,6 +71,12 @@ export declare const MangaFetch: <TSearchMeta = unknown, TInfoMeta = unknown, TC
|
|
|
68
71
|
chapters: true;
|
|
69
72
|
pages: true;
|
|
70
73
|
}>(config: FetchModuleConfig) => BuildMangaRoutes<S, TSearchMeta, TInfoMeta, TChapterMeta>;
|
|
74
|
+
export declare const NovelFetch: <TSearchMeta = unknown, TInfoMeta = unknown, TChapterMeta = unknown, S extends SelectRoutes = {
|
|
75
|
+
search: true;
|
|
76
|
+
info: true;
|
|
77
|
+
chapters: true;
|
|
78
|
+
pages: true;
|
|
79
|
+
}>(config: FetchModuleConfig) => BuildMangaRoutes<S, TSearchMeta, TInfoMeta, TChapterMeta>;
|
|
71
80
|
export declare const MetaFetch: <TSearchMeta = unknown, TInfoMeta = unknown, S extends SelectRoutes = {
|
|
72
81
|
search: true;
|
|
73
82
|
info: true;
|
|
@@ -75,4 +84,9 @@ export declare const MetaFetch: <TSearchMeta = unknown, TInfoMeta = unknown, S e
|
|
|
75
84
|
export declare const MapperFetch: (config: FetchModuleConfig) => BuildRoutes<{
|
|
76
85
|
map: true;
|
|
77
86
|
}>;
|
|
87
|
+
export declare const KodikFetch: (config: FetchModuleConfig) => BuildRoutes<{
|
|
88
|
+
episodes: true;
|
|
89
|
+
translations: true;
|
|
90
|
+
sources: true;
|
|
91
|
+
}>;
|
|
78
92
|
export {};
|
package/dist/helpers/fetch.js
CHANGED
|
@@ -71,6 +71,22 @@ export const MangaFetch = (config) => {
|
|
|
71
71
|
pages,
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
+
export const NovelFetch = (config) => {
|
|
75
|
+
const { baseUrl = 'https://api.crysoline.moe', provider, apiKey } = config;
|
|
76
|
+
const basePath = `${baseUrl}/api/novels/${provider}/`;
|
|
77
|
+
const fetcher = fetchFn(basePath, apiKey);
|
|
78
|
+
const search = async (q) => fetcher('search', { q });
|
|
79
|
+
const info = async (id) => fetcher(`info/${encodeURIComponent(id)}`);
|
|
80
|
+
const chapters = async (id) => fetcher(`chapters/${encodeURIComponent(id)}`);
|
|
81
|
+
const pages = (params) => fetcher('pages', params);
|
|
82
|
+
return {
|
|
83
|
+
name: provider,
|
|
84
|
+
search,
|
|
85
|
+
info,
|
|
86
|
+
chapters,
|
|
87
|
+
pages,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
74
90
|
export const MetaFetch = (config) => {
|
|
75
91
|
const { baseUrl = 'https://api.crysoline.moe', provider, apiKey } = config;
|
|
76
92
|
const basePath = `${baseUrl}/api/meta/${provider}/`;
|
|
@@ -92,3 +108,17 @@ export const MapperFetch = (config) => {
|
|
|
92
108
|
map,
|
|
93
109
|
};
|
|
94
110
|
};
|
|
111
|
+
export const KodikFetch = (config) => {
|
|
112
|
+
const { baseUrl = 'https://api.crysoline.moe', provider, apiKey } = config;
|
|
113
|
+
const basePath = `${baseUrl}/extractor/${provider}/`;
|
|
114
|
+
const fetcher = fetchFn(basePath, apiKey);
|
|
115
|
+
const episodes = async (id) => fetcher(`episodes/${encodeURIComponent(id)}`);
|
|
116
|
+
const sources = (params) => fetcher('sources', params);
|
|
117
|
+
const translations = (id) => fetcher(`translations/${encodeURIComponent(id)}`);
|
|
118
|
+
return {
|
|
119
|
+
name: provider,
|
|
120
|
+
episodes,
|
|
121
|
+
sources,
|
|
122
|
+
translations,
|
|
123
|
+
};
|
|
124
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fetch';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fetch';
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './core';
|
|
2
|
+
export * from './core/types';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './core';
|
|
2
|
+
export * from './core/types';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@crysoline/lib",
|
|
3
3
|
"description": "The official crysoline library for anime, manga using the Crysoline API",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.7",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"format": "biome format . --write"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@biomejs/biome": "2.3.
|
|
33
|
+
"@biomejs/biome": "2.3.13",
|
|
34
34
|
"typescript": "^5",
|
|
35
35
|
"@types/bun": "latest"
|
|
36
36
|
},
|