mgbuild 1.7.6 → 1.7.8

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,10 +1,10 @@
1
- declare type Log = {
1
+ type Log = {
2
2
  type: "ping" | "error";
3
3
  method: string;
4
4
  url: string;
5
5
  time: string;
6
6
  };
7
- declare type Logger = (log: Log) => any;
7
+ type Logger = (log: Log) => any;
8
8
  export declare class Scraper {
9
9
  private logger?;
10
10
  constructor(logger?: Logger);
@@ -4,17 +4,17 @@ import type { GetMangaChaptersResponse } from "../types/chapters";
4
4
  import type { GetRecentChaptersResponse } from "../types/recents";
5
5
  import type { GetChapterPagesResponse } from "../types/pages";
6
6
  import { Languages, MainLanguages } from "../../../utils/type";
7
- export declare type Log = {
7
+ export type Log = {
8
8
  type: "ping" | "error";
9
9
  method: string;
10
10
  url: string;
11
11
  time: string;
12
12
  };
13
- export declare type ChapterConfig = {
13
+ export type ChapterConfig = {
14
14
  page?: number;
15
15
  order?: "asc" | "desc";
16
16
  };
17
- export declare type Logger = (log: Log) => any;
17
+ export type Logger = (log: Log) => any;
18
18
  export declare class BruteScraper {
19
19
  private logger?;
20
20
  constructor(logger?: Logger);
@@ -1,11 +1,11 @@
1
1
  import { LanguageItem, Languages } from "../../../utils/type";
2
2
  export declare const CHAPTERS_PER_PAGE = 96;
3
3
  export declare function getPage(targetChapterPage: number): number;
4
- export declare type ChapterEndpointConfig = {
4
+ export type ChapterEndpointConfig = {
5
5
  number: number;
6
6
  language: Languages;
7
7
  };
8
- export declare type ChaptersEndpointConfig = {
8
+ export type ChaptersEndpointConfig = {
9
9
  order: "asc" | "desc";
10
10
  language: Languages;
11
11
  page: number;
@@ -1,6 +1,6 @@
1
1
  import { Logger } from "./core/scraper";
2
2
  import { Languages, MainLanguages } from "../../utils/type";
3
- declare type MangaConfig = {
3
+ type MangaConfig = {
4
4
  full?: boolean;
5
5
  last?: boolean;
6
6
  language: MainLanguages;
@@ -1,4 +1,4 @@
1
- export declare type GetBulkInfoResponse = {
1
+ export type GetBulkInfoResponse = {
2
2
  result: string;
3
3
  response: string;
4
4
  data: Data[];
@@ -6,13 +6,13 @@ export declare type GetBulkInfoResponse = {
6
6
  offset: number;
7
7
  total: number;
8
8
  };
9
- declare type Data = {
9
+ type Data = {
10
10
  id: string;
11
11
  type: string;
12
12
  attributes: Attributes;
13
13
  relationships: Relationship[];
14
14
  };
15
- declare type Attributes = {
15
+ type Attributes = {
16
16
  title: Title;
17
17
  altTitles: AltTitle[];
18
18
  description: Description;
@@ -34,10 +34,10 @@ declare type Attributes = {
34
34
  availableTranslatedLanguages: string[];
35
35
  latestUploadedChapter: string;
36
36
  };
37
- declare type Title = {
37
+ type Title = {
38
38
  en: string;
39
39
  };
40
- declare type AltTitle = {
40
+ type AltTitle = {
41
41
  en?: string;
42
42
  "ko-ro"?: string;
43
43
  ru?: string;
@@ -57,7 +57,7 @@ declare type AltTitle = {
57
57
  sl?: string;
58
58
  "ja-ro"?: string;
59
59
  };
60
- declare type Description = {
60
+ type Description = {
61
61
  en: string;
62
62
  pt?: string;
63
63
  "es-la"?: string;
@@ -65,7 +65,7 @@ declare type Description = {
65
65
  fr?: string;
66
66
  ru?: string;
67
67
  };
68
- declare type Links = {
68
+ type Links = {
69
69
  al: string;
70
70
  ap: string;
71
71
  bw?: string;
@@ -79,28 +79,28 @@ declare type Links = {
79
79
  raw?: string;
80
80
  engtl?: string;
81
81
  };
82
- declare type Tag = {
82
+ type Tag = {
83
83
  id: string;
84
84
  type: string;
85
85
  attributes: Attributes2;
86
86
  relationships: any[];
87
87
  };
88
- declare type Attributes2 = {
88
+ type Attributes2 = {
89
89
  name: Name;
90
90
  description: object;
91
91
  group: string;
92
92
  version: number;
93
93
  };
94
- declare type Name = {
94
+ type Name = {
95
95
  en: string;
96
96
  };
97
- declare type Relationship = {
97
+ type Relationship = {
98
98
  id: string;
99
99
  type: string;
100
100
  attributes?: Attributes3;
101
101
  related?: string;
102
102
  };
103
- declare type Attributes3 = {
103
+ type Attributes3 = {
104
104
  description: string;
105
105
  volume: string;
106
106
  fileName: string;
@@ -1,4 +1,4 @@
1
- export declare type GetMangaChaptersResponse = {
1
+ export type GetMangaChaptersResponse = {
2
2
  result: string;
3
3
  response: string;
4
4
  data: Data[];
@@ -8,13 +8,13 @@ export declare type GetMangaChaptersResponse = {
8
8
  last_page: number;
9
9
  invalid_page: boolean;
10
10
  };
11
- declare type Data = {
11
+ type Data = {
12
12
  id: string;
13
13
  type: string;
14
14
  attributes: Attributes;
15
15
  relationships: Relationship[];
16
16
  };
17
- declare type Attributes = {
17
+ type Attributes = {
18
18
  volume?: string;
19
19
  chapter: string;
20
20
  title?: string;
@@ -27,12 +27,12 @@ declare type Attributes = {
27
27
  pages: number;
28
28
  version: number;
29
29
  };
30
- declare type Relationship = {
30
+ type Relationship = {
31
31
  id: string;
32
32
  type: string;
33
33
  attributes?: Attributes2;
34
34
  };
35
- declare type Attributes2 = {
35
+ type Attributes2 = {
36
36
  username?: string;
37
37
  roles?: string[];
38
38
  version: number;
@@ -1,21 +1,21 @@
1
1
  import { LanguageItem } from "../../../utils/type";
2
- export declare type GetMangaInfoResponse = {
2
+ export type GetMangaInfoResponse = {
3
3
  result: string;
4
4
  response: string;
5
5
  data: Data;
6
6
  };
7
- export declare type ListMangaResponse = {
7
+ export type ListMangaResponse = {
8
8
  result: string;
9
9
  response: string;
10
10
  data: Data[];
11
11
  };
12
- declare type Data = {
12
+ type Data = {
13
13
  id: string;
14
14
  type: string;
15
15
  attributes: Attributes;
16
16
  relationships: Relationship[];
17
17
  };
18
- declare type Attributes = {
18
+ type Attributes = {
19
19
  title: Title;
20
20
  altTitles: AltTitle[];
21
21
  description: Description;
@@ -37,10 +37,10 @@ declare type Attributes = {
37
37
  availableTranslatedLanguages: string[];
38
38
  latestUploadedChapter: string;
39
39
  };
40
- declare type Title = LanguageItem;
41
- declare type AltTitle = LanguageItem;
42
- declare type Description = LanguageItem;
43
- declare type Links = {
40
+ type Title = LanguageItem;
41
+ type AltTitle = LanguageItem;
42
+ type Description = LanguageItem;
43
+ type Links = {
44
44
  al: string;
45
45
  ap: string;
46
46
  bw: string;
@@ -52,22 +52,22 @@ declare type Links = {
52
52
  raw: string;
53
53
  engtl: string;
54
54
  };
55
- declare type Tag = {
55
+ type Tag = {
56
56
  id: string;
57
57
  type: string;
58
58
  attributes: Attributes2;
59
59
  relationships: any[];
60
60
  };
61
- declare type Attributes2 = {
61
+ type Attributes2 = {
62
62
  name: Name;
63
63
  description: object;
64
64
  group: string;
65
65
  version: number;
66
66
  };
67
- declare type Name = {
67
+ type Name = {
68
68
  en: string;
69
69
  };
70
- declare type Relationship = {
70
+ type Relationship = {
71
71
  id: string;
72
72
  type: string;
73
73
  related?: string;
@@ -1,9 +1,9 @@
1
- export declare type GetChapterPagesResponse = {
1
+ export type GetChapterPagesResponse = {
2
2
  result: string;
3
3
  baseUrl: string;
4
4
  chapter: Chapter;
5
5
  };
6
- declare type Chapter = {
6
+ type Chapter = {
7
7
  hash: string;
8
8
  data: string[];
9
9
  dataSaver: string[];
@@ -1,4 +1,4 @@
1
- export declare type GetRecentChaptersResponse = {
1
+ export type GetRecentChaptersResponse = {
2
2
  result: string;
3
3
  response: string;
4
4
  data: Daum[];
@@ -6,13 +6,13 @@ export declare type GetRecentChaptersResponse = {
6
6
  offset: number;
7
7
  total: number;
8
8
  };
9
- declare type Daum = {
9
+ type Daum = {
10
10
  id: string;
11
11
  type: string;
12
12
  attributes: Attributes;
13
13
  relationships: Relationship[];
14
14
  };
15
- declare type Attributes = {
15
+ type Attributes = {
16
16
  volume?: string;
17
17
  chapter: string;
18
18
  title?: string;
@@ -25,12 +25,12 @@ declare type Attributes = {
25
25
  pages: number;
26
26
  version: number;
27
27
  };
28
- declare type Relationship = {
28
+ type Relationship = {
29
29
  id: string;
30
30
  type: string;
31
31
  attributes: Attributes2;
32
32
  };
33
- declare type Attributes2 = {
33
+ type Attributes2 = {
34
34
  name?: string;
35
35
  altNames?: AltName[];
36
36
  locked?: boolean;
@@ -70,13 +70,13 @@ declare type Attributes2 = {
70
70
  username?: string;
71
71
  roles?: string[];
72
72
  };
73
- declare type AltName = {
73
+ type AltName = {
74
74
  en: string;
75
75
  };
76
- declare type Title = {
76
+ type Title = {
77
77
  en: string;
78
78
  };
79
- declare type AltTitle = {
79
+ type AltTitle = {
80
80
  ja?: string;
81
81
  en?: string;
82
82
  fr?: string;
@@ -102,7 +102,7 @@ declare type AltTitle = {
102
102
  tl?: string;
103
103
  pl?: string;
104
104
  };
105
- declare type Links = {
105
+ type Links = {
106
106
  al?: string;
107
107
  ap?: string;
108
108
  bw?: string;
@@ -116,19 +116,19 @@ declare type Links = {
116
116
  raw?: string;
117
117
  engtl?: string;
118
118
  };
119
- declare type Tag = {
119
+ type Tag = {
120
120
  id: string;
121
121
  type: string;
122
122
  attributes: Attributes3;
123
123
  relationships: any[];
124
124
  };
125
- declare type Attributes3 = {
125
+ type Attributes3 = {
126
126
  name: Name;
127
127
  description: object;
128
128
  group: string;
129
129
  version: number;
130
130
  };
131
- declare type Name = {
131
+ type Name = {
132
132
  en: string;
133
133
  };
134
134
  export {};
@@ -1,11 +1,11 @@
1
1
  import { MainLanguages } from "../../../utils/type";
2
- export declare type Chapter = {
2
+ export type Chapter = {
3
3
  id: string;
4
4
  number: number;
5
5
  title: string;
6
6
  geek: string;
7
7
  };
8
- export declare type Manga = {
8
+ export type Manga = {
9
9
  id: number;
10
10
  title: string;
11
11
  slug: string;
@@ -18,18 +18,18 @@ export declare type Manga = {
18
18
  chapters: Chapter[];
19
19
  chapter_code?: string;
20
20
  };
21
- export declare type Recent = {
21
+ export type Recent = {
22
22
  code: string;
23
23
  chapters: number[];
24
24
  title: string;
25
25
  cover?: string;
26
26
  };
27
- export declare type MangaCoverInfo = {
27
+ export type MangaCoverInfo = {
28
28
  id: string;
29
29
  cover: string;
30
30
  coverPath: string;
31
31
  };
32
- export declare type MangaInfo = {
32
+ export type MangaInfo = {
33
33
  id: string;
34
34
  title: string;
35
35
  slug: string;
@@ -0,0 +1,4 @@
1
+ /// <reference types="cheerio" />
2
+ export declare function getChapter($: cheerio.Root): Promise<{
3
+ pages: string[];
4
+ }>;
@@ -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,73 @@
1
+ declare const _default: {
2
+ manga: {
3
+ referer: string;
4
+ accept: string;
5
+ "accept-language": string;
6
+ "cache-control": string;
7
+ priority: string;
8
+ pragma: string;
9
+ "sec-ch-ua": string;
10
+ "sec-ch-ua-mobile": string;
11
+ "sec-ch-ua-platform": string;
12
+ "sec-fetch-dest": string;
13
+ "sec-fetch-mode": string;
14
+ "sec-fetch-site": string;
15
+ "sec-fetch-user": string;
16
+ "sec-gpc": string;
17
+ "upgrade-insecure-requests": string;
18
+ "user-agent": string;
19
+ };
20
+ chapter: {
21
+ referer: string;
22
+ accept: string;
23
+ "accept-language": string;
24
+ "cache-control": string;
25
+ priority: string;
26
+ pragma: 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-fetch-user": string;
34
+ "sec-gpc": string;
35
+ "upgrade-insecure-requests": string;
36
+ "user-agent": string;
37
+ };
38
+ chapterList: {
39
+ accept: string;
40
+ "accept-language": string;
41
+ "cache-control": string;
42
+ pragma: string;
43
+ priority: string;
44
+ "sec-ch-ua": string;
45
+ "sec-ch-ua-mobile": string;
46
+ "sec-ch-ua-platform": string;
47
+ "sec-fetch-dest": string;
48
+ "sec-fetch-mode": string;
49
+ "sec-fetch-site": string;
50
+ "sec-gpc": string;
51
+ "x-requested-with": string;
52
+ "Referrer-Policy": string;
53
+ };
54
+ recent: {
55
+ referer: string;
56
+ accept: string;
57
+ "accept-language": string;
58
+ "cache-control": string;
59
+ priority: string;
60
+ pragma: string;
61
+ "sec-ch-ua": string;
62
+ "sec-ch-ua-mobile": string;
63
+ "sec-ch-ua-platform": string;
64
+ "sec-fetch-dest": string;
65
+ "sec-fetch-mode": string;
66
+ "sec-fetch-site": string;
67
+ "sec-fetch-user": string;
68
+ "sec-gpc": string;
69
+ "upgrade-insecure-requests": string;
70
+ "user-agent": string;
71
+ };
72
+ };
73
+ export default _default;
@@ -0,0 +1,21 @@
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
+ private chapterList;
12
+ manga(manga_code: string): Promise<import("../..").ScrapedManga>;
13
+ chapterById(chapter_id: string | number): Promise<{
14
+ pages: string[];
15
+ }>;
16
+ chapter(manga_code: string, chapter_number: number): Promise<{
17
+ pages: string[];
18
+ }>;
19
+ recents(page?: number): Promise<import("../..").RecentScrapeList[]>;
20
+ }
21
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="cheerio" />
2
+ import { ScrapedHostChapter, ScrapedManga } from "../../@types";
3
+ export declare function getChapters($: cheerio.Root, slug: string): ScrapedHostChapter[];
4
+ export declare function getManga($: cheerio.Root, slug: string): ScrapedManga;
@@ -0,0 +1,3 @@
1
+ /// <reference types="cheerio" />
2
+ import { RecentScrapeList } from "../../@types";
3
+ export declare function getRecentList($: cheerio.Root): RecentScrapeList[];
@@ -0,0 +1,4 @@
1
+ /// <reference types="cheerio" />
2
+ export declare function getChapter($: cheerio.Root): Promise<{
3
+ pages: string[];
4
+ }>;
@@ -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,60 @@
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
+ chapter: {
22
+ referer: string;
23
+ "Referrer-Policy": string;
24
+ accept: string;
25
+ "accept-language": string;
26
+ "cache-control": string;
27
+ priority: string;
28
+ pragma: string;
29
+ "sec-ch-ua": string;
30
+ "sec-ch-ua-mobile": string;
31
+ "sec-ch-ua-platform": string;
32
+ "sec-fetch-dest": string;
33
+ "sec-fetch-mode": string;
34
+ "sec-fetch-site": string;
35
+ "sec-fetch-user": string;
36
+ "sec-gpc": string;
37
+ "upgrade-insecure-requests": string;
38
+ "user-agent": string;
39
+ };
40
+ recent: {
41
+ referer: string;
42
+ "Referrer-Policy": string;
43
+ accept: string;
44
+ "accept-language": string;
45
+ "cache-control": string;
46
+ priority: string;
47
+ pragma: string;
48
+ "sec-ch-ua": string;
49
+ "sec-ch-ua-mobile": string;
50
+ "sec-ch-ua-platform": string;
51
+ "sec-fetch-dest": string;
52
+ "sec-fetch-mode": string;
53
+ "sec-fetch-site": string;
54
+ "sec-fetch-user": string;
55
+ "sec-gpc": string;
56
+ "upgrade-insecure-requests": string;
57
+ "user-agent": string;
58
+ };
59
+ };
60
+ 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,3 @@
1
+ /// <reference types="cheerio" />
2
+ import { ScrapedManga } from "../../@types";
3
+ export declare function getManga($: cheerio.Root, slug: string): ScrapedManga;
@@ -0,0 +1,3 @@
1
+ /// <reference types="cheerio" />
2
+ import { RecentScrapeList } from "../../@types";
3
+ export declare function getRecentList($: cheerio.Root): RecentScrapeList[];
@@ -2,6 +2,7 @@
2
2
  import { RequestInit } from "node-fetch";
3
3
  import { MainLanguages } from "./type";
4
4
  export declare function getText(url: string, options?: RequestInit): Promise<string>;
5
+ export declare function urlFromSrcSet(srcset?: string): string;
5
6
  export declare function getJSON(url: string, options?: RequestInit): Promise<any>;
6
7
  export declare function HTML(url: string, options?: RequestInit): Promise<cheerio.Root>;
7
8
  export declare function checkThumb(thumbnail?: string): string | undefined;
@@ -1,5 +1,5 @@
1
- export declare type MainLanguages = "en" | "pt" | "es";
2
- export declare type Languages = "en" | "pt" | "pt-br" | "es" | "es-la" | "ja-ro";
3
- export declare type LanguageItem = {
1
+ export type MainLanguages = "en" | "pt" | "es";
2
+ export type Languages = "en" | "pt" | "pt-br" | "es" | "es-la" | "ja-ro";
3
+ export type LanguageItem = {
4
4
  [key in Languages]?: string;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgbuild",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [],