mgbuild 2.1.5 → 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 { 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.5",
3
+ "version": "2.1.6",
4
4
  "scripts": {},
5
5
  "description": "",
6
6
  "main": "lib/index.js",