mgbuild 2.1.4 → 2.1.6

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.
@@ -0,0 +1,29 @@
1
+ export declare class SakuraMangaAPI {
2
+ static recents(): Promise<{
3
+ code: string;
4
+ img: string;
5
+ title: string;
6
+ chapters: number[];
7
+ }[]>;
8
+ static mangaParams(url: string): Promise<string | undefined>;
9
+ static manga(url: string): Promise<{
10
+ cover: string;
11
+ title: string;
12
+ geek: string;
13
+ slug: string;
14
+ description: string;
15
+ tags: string[];
16
+ available: boolean;
17
+ chapters: {
18
+ title: string;
19
+ number: number;
20
+ id: string;
21
+ geek: string;
22
+ }[];
23
+ }>;
24
+ static chapterParams(url: string): Promise<{
25
+ chapter_id: string | undefined;
26
+ token: string | undefined;
27
+ }>;
28
+ static pages(url: string): Promise<string[]>;
29
+ }
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ manga: {
3
+ SCRAPE_BASE_URL: string;
4
+ };
5
+ };
6
+ export default _default;
@@ -0,0 +1,36 @@
1
+ declare const _default: {
2
+ default: {
3
+ accept: string;
4
+ "accept-language": string;
5
+ "cache-control": string;
6
+ priority: string;
7
+ pragma: string;
8
+ "sec-ch-ua": string;
9
+ "sec-ch-ua-mobile": string;
10
+ "sec-ch-ua-platform": string;
11
+ "sec-fetch-dest": string;
12
+ "sec-fetch-mode": string;
13
+ "sec-fetch-site": string;
14
+ "sec-fetch-user": string;
15
+ "sec-gpc": string;
16
+ "upgrade-insecure-requests": string;
17
+ "user-agent": string;
18
+ };
19
+ XMLHttpRequest: {
20
+ accept: string;
21
+ "accept-language": string;
22
+ priority: string;
23
+ "sec-ch-ua": string;
24
+ "sec-ch-ua-mobile": string;
25
+ "sec-ch-ua-platform": string;
26
+ "sec-fetch-dest": string;
27
+ "sec-fetch-mode": string;
28
+ "sec-fetch-site": string;
29
+ "sec-fetch-user": string;
30
+ "sec-gpc": string;
31
+ "upgrade-insecure-requests": string;
32
+ "user-agent": string;
33
+ "x-requested-with": string;
34
+ };
35
+ };
36
+ export default _default;
@@ -0,0 +1,39 @@
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<{
12
+ cover: string;
13
+ title: string;
14
+ geek: string;
15
+ slug: string;
16
+ description: string;
17
+ tags: string[];
18
+ available: boolean;
19
+ chapters: {
20
+ title: string;
21
+ number: number;
22
+ id: string;
23
+ geek: string;
24
+ }[];
25
+ }>;
26
+ chapterById(chapter_id: string | number): Promise<{
27
+ pages: string[];
28
+ }>;
29
+ chapter(manga_code: string, chapter_number: number): Promise<{
30
+ pages: string[];
31
+ }>;
32
+ recents(): Promise<{
33
+ code: string;
34
+ img: string;
35
+ title: string;
36
+ chapters: number[];
37
+ }[]>;
38
+ }
39
+ export {};
@@ -0,0 +1,6 @@
1
+ import { APIChapterResponse, APIMangaResponse, APIRecentsResponse } from "./types";
2
+ export declare class SussyAPI {
3
+ static recents(): Promise<APIRecentsResponse>;
4
+ static manga(id: string): Promise<APIMangaResponse>;
5
+ static chapter(chapterId: string | number): Promise<APIChapterResponse>;
6
+ }
@@ -9,13 +9,34 @@ export declare class Scraper {
9
9
  private logger?;
10
10
  constructor(logger?: Logger);
11
11
  private chapterList;
12
- manga(manga_code: string): Promise<import("../..").ScrapedManga>;
12
+ manga(manga_code: string): Promise<{
13
+ id: number;
14
+ title: string;
15
+ description: string;
16
+ available: boolean;
17
+ chapters: {
18
+ number: number;
19
+ geek: string;
20
+ title: string;
21
+ id: number;
22
+ }[];
23
+ cover: string;
24
+ geek: string;
25
+ slug: string;
26
+ tags: string[];
27
+ alternative_name: string;
28
+ }>;
13
29
  chapterById(chapter_id: string | number): Promise<{
14
30
  pages: string[];
15
31
  }>;
16
32
  chapter(manga_code: string, chapter_number: number): Promise<{
17
33
  pages: string[];
18
34
  }>;
19
- recents(page?: number): Promise<import("../..").RecentScrapeList[]>;
35
+ recents(): Promise<{
36
+ title: string;
37
+ code: string;
38
+ chapters: number[];
39
+ cover: string;
40
+ }[]>;
20
41
  }
21
42
  export {};
@@ -0,0 +1,116 @@
1
+ export interface APIRecentsResponse {
2
+ tempo: number;
3
+ pagina: number;
4
+ limite: number;
5
+ total: number;
6
+ totalPaginas: number;
7
+ resultados: Resultado[];
8
+ }
9
+ export interface APIMangaResponse {
10
+ resultado: {
11
+ obr_id: number;
12
+ obr_nome: string;
13
+ obr_outros_nomes: any[];
14
+ obr_descricao: string;
15
+ obr_imagem: string;
16
+ obr_imagem_fundo: string;
17
+ obr_visualizacoes: number;
18
+ obr_criada_em: string;
19
+ obr_atualizado_em: string;
20
+ obr_slug: string | null;
21
+ obr_mais_18: boolean;
22
+ scan_id: number;
23
+ leitura_status: any;
24
+ parceira: any;
25
+ formato: Formato;
26
+ status: Status;
27
+ tags: Tag[];
28
+ total_capitulos: number;
29
+ capitulos: Capitulo[];
30
+ rating: string;
31
+ total_rating: number;
32
+ genero: Genero;
33
+ };
34
+ }
35
+ export interface APIChapterResponse {
36
+ resultado: {
37
+ cap_id: number;
38
+ cap_numero: number;
39
+ cap_paginas: CapPagina[];
40
+ obra: Obra;
41
+ };
42
+ }
43
+ export interface CapPagina {
44
+ src: string;
45
+ numero: number;
46
+ }
47
+ export interface Obra {
48
+ obr_id: number;
49
+ obr_nome: string;
50
+ scan_id: number;
51
+ }
52
+ export interface Capitulo {
53
+ cap_id: number;
54
+ cap_nome: string;
55
+ cap_numero: number;
56
+ cap_lancado_em: string;
57
+ cap_new: boolean;
58
+ cap_lido: boolean;
59
+ cap_disponivel: boolean;
60
+ cap_visualizacoes: number;
61
+ }
62
+ export interface Resultado {
63
+ obr_id: number;
64
+ obr_nome: string;
65
+ obr_outros_nomes: string[];
66
+ obr_descricao: string;
67
+ formt_id: number;
68
+ stt_id: number;
69
+ obr_status: string;
70
+ obr_imagem: string;
71
+ obr_imagem_fundo?: string;
72
+ obr_visualizacoes: number;
73
+ obr_criada_em: string;
74
+ obr_atualizado_em: string;
75
+ obr_slug?: string;
76
+ obr_mais_18: boolean;
77
+ obr_vip: boolean;
78
+ scan_id: number;
79
+ parceira_id: any;
80
+ formato: Formato;
81
+ status: Status;
82
+ tags: Tag[];
83
+ total_capitulos: number;
84
+ ultimos_capitulos: UltimosCapitulo[];
85
+ favorito: boolean;
86
+ total_lidos: number;
87
+ genero: Genero;
88
+ rating: number;
89
+ total_rating: number;
90
+ }
91
+ export interface Formato {
92
+ formt_id: number;
93
+ formt_nome: string;
94
+ }
95
+ export interface Status {
96
+ stt_id: number;
97
+ stt_nome: string;
98
+ stt_cor: string;
99
+ }
100
+ export interface Tag {
101
+ tag_id: number;
102
+ tag_nome: string;
103
+ }
104
+ export interface UltimosCapitulo {
105
+ cap_id: number;
106
+ cap_nome: string;
107
+ cap_numero: number;
108
+ cap_lancado_em: string;
109
+ cap_new: boolean;
110
+ cap_lido: boolean;
111
+ cap_disponivel: boolean;
112
+ }
113
+ export interface Genero {
114
+ gen_id: number;
115
+ gen_nome: string;
116
+ }
@@ -0,0 +1,6 @@
1
+ import { RequestInit } from "node-fetch";
2
+ export declare function curl(url: string, options?: RequestInit): Promise<string>;
3
+ export declare function curlFetch(url: string, options?: RequestInit): Promise<{
4
+ text: () => string;
5
+ json: <T = object>() => T;
6
+ }>;
@@ -1,12 +1,16 @@
1
1
  /// <reference types="node" />
2
2
  import { RequestOptions } from "https";
3
+ type Options = RequestOptions & {
4
+ data?: string | object;
5
+ };
3
6
  export declare class TinyFetch {
4
7
  private headers;
5
8
  constructor(headers?: Record<string, string>);
6
9
  private request;
7
- static fetch<T = any>(url: string, options?: RequestOptions): Promise<{
10
+ static fetch<T = any>(url: string, options?: Options): Promise<{
8
11
  json: () => T;
9
12
  text: () => string;
10
13
  buffer: () => Buffer;
11
14
  }>;
12
15
  }
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgbuild",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "scripts": {},
5
5
  "description": "",
6
6
  "main": "lib/index.js",