mgbuild 1.8.1 → 1.8.3

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.
@@ -1,3 +1,3 @@
1
1
  /// <reference types="cheerio" />
2
2
  import { ScrapedManga } from "../../@types";
3
- export declare function getManga($: cheerio.Root, slug: string): ScrapedManga;
3
+ export declare function getManga($: cheerio.Root): ScrapedManga;
@@ -0,0 +1,101 @@
1
+ export type Book = {
2
+ book_name_original: string;
3
+ book_name: string;
4
+ book_image: string;
5
+ book_image_opt: string;
6
+ book_id: number;
7
+ book_redirect_link: any;
8
+ book_name_alternatives: string;
9
+ book_status: number;
10
+ book_date_updated: string;
11
+ book_views: number;
12
+ book_synopsis: string;
13
+ book_publication_year: number;
14
+ book_language_id: any;
15
+ book_scan_id: number;
16
+ book_flagged: number;
17
+ book_uuid: string;
18
+ book_content_warning: any;
19
+ book_nsfw: number;
20
+ book_genre_id: number;
21
+ scan: Scan;
22
+ genre: Genre;
23
+ author: Author;
24
+ book_tag: BookTag[];
25
+ book_categories: BookCategory[];
26
+ book_temp: BookTemp[];
27
+ book_infos: BookInfo[];
28
+ events: any;
29
+ cached: boolean;
30
+ };
31
+ export type Scan = {
32
+ scan_id: number;
33
+ scan_name: string;
34
+ };
35
+ export type Genre = {
36
+ genre_name: string;
37
+ };
38
+ export type Author = {
39
+ author_name: string;
40
+ author_id: number;
41
+ };
42
+ export type BookTag = {
43
+ tag: Tag;
44
+ };
45
+ export type Tag = {
46
+ tag_name: string;
47
+ tag_id: number;
48
+ tag_name_ptBR: string;
49
+ tag_nsfw: boolean;
50
+ };
51
+ export type BookCategory = {
52
+ categories: Categories;
53
+ };
54
+ export type Categories = {
55
+ cat_name: string;
56
+ cat_id: number;
57
+ cat_name_ptBR: string;
58
+ cat_nsfw: boolean;
59
+ };
60
+ export type BookTemp = {
61
+ bt_id: number;
62
+ bt_season: number;
63
+ };
64
+ export type BookInfo = {
65
+ book_info_id: number;
66
+ book_info_book_id: number;
67
+ book_info_content: BookInfoContent;
68
+ book_info_date_created: string;
69
+ book_info_date_updated: string;
70
+ };
71
+ export type BookInfoContent = {
72
+ type: string;
73
+ mangadexId?: string;
74
+ avaiablesProviders?: AvaiablesProviders;
75
+ chapters?: Chapter[];
76
+ serielazationsManga?: SerielazationsManga[];
77
+ };
78
+ export type AvaiablesProviders = {
79
+ al: string;
80
+ mu: string;
81
+ mal: string;
82
+ raw: string;
83
+ engtl: string;
84
+ };
85
+ export type Chapter = {
86
+ id: string;
87
+ src?: string;
88
+ name: string;
89
+ img256?: string;
90
+ img512?: string;
91
+ locale?: string;
92
+ volume?: string;
93
+ chapter?: string;
94
+ scanlator?: string;
95
+ externalUrl: any;
96
+ };
97
+ export type SerielazationsManga = {
98
+ url: string;
99
+ name: string;
100
+ type?: string;
101
+ };
@@ -0,0 +1,20 @@
1
+ export type PageDetails = {
2
+ btc_id: number;
3
+ btc_cap: number;
4
+ btc_scan_id: number;
5
+ btc_name: string;
6
+ btc_external_link: any;
7
+ scan: Scan;
8
+ book_temp_caps_colab: any[];
9
+ book_temp_cap_unit: BookTempCapUnit[];
10
+ };
11
+ export type Scan = {
12
+ scan_name: string;
13
+ scan_id: number;
14
+ };
15
+ export type BookTempCapUnit = {
16
+ btcu_content?: string;
17
+ btcu_image: string;
18
+ btcu_provider_host: number;
19
+ btcu_downloaded_status: number;
20
+ };
@@ -0,0 +1,12 @@
1
+ export type ChapterListItem = {
2
+ btc_id: number;
3
+ btc_cap: number;
4
+ btc_date_updated: string;
5
+ btc_external_link: any;
6
+ btc_name: string;
7
+ btc_volume: any;
8
+ scan: {
9
+ scan_name: string;
10
+ scan_id: number;
11
+ };
12
+ };
@@ -0,0 +1,10 @@
1
+ import { type Book } from "./book";
2
+ import { type RecentBook } from "./recents";
3
+ export declare class SlimeApi {
4
+ static getBook(bookId: string | number): Promise<Book>;
5
+ static getBookChapters(bookId: string | number): Promise<{
6
+ chapter: string;
7
+ }[]>;
8
+ static getBookChapter(mangaId: string | number, chapterNumber: number): Promise<string[]>;
9
+ static getRecents(page?: number): Promise<RecentBook[]>;
10
+ }
@@ -0,0 +1,49 @@
1
+ export type RecentBook = {
2
+ book_name_original: string;
3
+ book_name: string;
4
+ book_nsfw: number;
5
+ book_image: string;
6
+ book_id: number;
7
+ book_publication_year: number;
8
+ book_flagged: number;
9
+ book_redirect_link: any;
10
+ book_tag: BookTag[];
11
+ book_date_created: string;
12
+ book_categories: BookCategory[];
13
+ book_temp: BookTemp[];
14
+ book_genre_id: number;
15
+ book_language_id: any;
16
+ book_name_alternatives: string;
17
+ nsfw: boolean;
18
+ };
19
+ export type BookTag = {
20
+ tag: Tag;
21
+ };
22
+ export type Tag = {
23
+ tag_nsfw: boolean;
24
+ tag_name: string;
25
+ tag_name_ptBR: string;
26
+ };
27
+ export type BookCategory = {
28
+ categories: Categories;
29
+ };
30
+ export type Categories = {
31
+ cat_name: string;
32
+ cat_nsfw: boolean;
33
+ cat_name_ptBR: string;
34
+ };
35
+ export type BookTemp = {
36
+ book_temp_caps: BookTempCap[];
37
+ };
38
+ export type BookTempCap = {
39
+ btc_cap: number;
40
+ btc_date_created: string;
41
+ btc_date_updated: string;
42
+ btc_name: string;
43
+ scan: Scan;
44
+ };
45
+ export type Scan = {
46
+ scan_auto_update: boolean;
47
+ scan_id: number;
48
+ scan_name: string;
49
+ };
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ manga: {
3
+ SCRAPE_BASE_URL: string;
4
+ EMPTY_THUMB: string;
5
+ EMPTY_BACKGROUND: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,65 @@
1
+ declare const _default: {
2
+ manga: {
3
+ Referer: string;
4
+ "Referrer-Policy": string;
5
+ accept: string;
6
+ "accept-language": string;
7
+ "cache-control": string;
8
+ priority: string;
9
+ pragma: string;
10
+ "sec-ch-ua": string;
11
+ "sec-ch-ua-mobile": string;
12
+ "sec-ch-ua-platform": string;
13
+ "sec-fetch-dest": string;
14
+ "sec-fetch-mode": string;
15
+ "sec-fetch-site": string;
16
+ "sec-fetch-user": string;
17
+ "sec-gpc": string;
18
+ "upgrade-insecure-requests": string;
19
+ "user-agent": string;
20
+ };
21
+ chapters: {
22
+ accept: string;
23
+ "accept-language": string;
24
+ authorization: string;
25
+ priority: string;
26
+ requestid: string;
27
+ "sec-ch-ua": string;
28
+ "sec-ch-ua-mobile": string;
29
+ "sec-ch-ua-platform": string;
30
+ "sec-fetch-dest": string;
31
+ "sec-fetch-mode": string;
32
+ "sec-fetch-site": string;
33
+ "sec-gpc": string;
34
+ };
35
+ chapter: {
36
+ origin: string;
37
+ requestid: string;
38
+ accept: string;
39
+ "accept-language": string;
40
+ priority: string;
41
+ "sec-ch-ua": string;
42
+ "sec-ch-ua-mobile": string;
43
+ "sec-ch-ua-platform": string;
44
+ "sec-fetch-dest": string;
45
+ "sec-fetch-mode": string;
46
+ "sec-fetch-site": string;
47
+ "sec-fetch-user": string;
48
+ "sec-gpc": string;
49
+ "user-agent": string;
50
+ };
51
+ recent: {
52
+ accept: string;
53
+ "accept-language": string;
54
+ priority: string;
55
+ requestid: string;
56
+ "sec-ch-ua": string;
57
+ "sec-ch-ua-mobile": string;
58
+ "sec-ch-ua-platform": string;
59
+ "sec-fetch-dest": string;
60
+ "sec-fetch-mode": string;
61
+ "sec-fetch-site": string;
62
+ "sec-gpc": string;
63
+ };
64
+ };
65
+ export default _default;
@@ -0,0 +1,20 @@
1
+ type Log = {
2
+ type: "ping" | "error";
3
+ method: string;
4
+ url: string;
5
+ time: string;
6
+ };
7
+ type Logger = (log: Log) => any;
8
+ export declare class Scraper {
9
+ private logger?;
10
+ constructor(logger?: Logger);
11
+ manga(manga_code: string): Promise<import("../..").ScrapedManga>;
12
+ chapterById(chapter_id: string | number): Promise<{
13
+ pages: string[];
14
+ }>;
15
+ chapter(manga_code: string, chapter_number: number): Promise<{
16
+ pages: string[];
17
+ }>;
18
+ recents(page?: number): Promise<import("../..").RecentScrapeList[]>;
19
+ }
20
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ScrapedHostChapter, ScrapedManga } from "../../@types";
2
+ import { Book } from "./api/book";
3
+ interface MangaLike {
4
+ code: string | number;
5
+ slug: string;
6
+ }
7
+ export declare function extractChapters(chapterList: {
8
+ chapter?: string;
9
+ }[], manga: MangaLike): ScrapedHostChapter[];
10
+ export declare function getManga(book: Book, code: string | number): ScrapedManga;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ import { RecentScrapeList } from "../../@types";
2
+ import { RecentBook } from "./api/recents";
3
+ export declare function getRecentList(books: RecentBook[]): RecentScrapeList[];
@@ -1,9 +1,10 @@
1
1
  /// <reference types="cheerio" />
2
2
  import { RequestInit } from "node-fetch";
3
3
  import { MainLanguages } from "./type";
4
+ export declare function zlibDecode<T>(data: string): T;
4
5
  export declare function getText(url: string, options?: RequestInit): Promise<string>;
5
6
  export declare function urlFromSrcSet(srcset?: string): string;
6
- export declare function getJSON(url: string, options?: RequestInit): Promise<any>;
7
+ export declare function getJSON<T>(url: string, options?: RequestInit): Promise<T>;
7
8
  export declare function HTML(url: string, options?: RequestInit): Promise<cheerio.Root>;
8
9
  export declare function checkThumb(thumbnail?: string): string | undefined;
9
10
  export declare function hasFinished(finished?: string): boolean;
@@ -21,3 +22,4 @@ export declare function getChapterId(url?: string): number | false;
21
22
  export declare function unionChapterNumberFormat(chapter_number: number): string;
22
23
  export declare function atob(data: string): string;
23
24
  export declare function btoa(data: string): string;
25
+ export declare function removeDuplicates<T>(array: T[], callback: (a: T) => unknown): NonNullable<T>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgbuild",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [],