@heavstal/api 2.0.5
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/LICENSE +21 -0
- package/README.md +224 -0
- package/dist/index.d.mts +221 -0
- package/dist/index.d.ts +221 -0
- package/dist/index.js +362 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +334 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HEAVSTAL TECH™
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://heavstal.com.ng/ht_icon.svg" width="120" alt="Heavstal Tech Logo" />
|
|
3
|
+
<h1>@heavstal/api</h1>
|
|
4
|
+
|
|
5
|
+
<p>
|
|
6
|
+
<img alt="NPM Version" src="https://img.shields.io/npm/v/@heavstal/api?style=flat-square">
|
|
7
|
+
<img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/HeavstalTech/heavstaltech-api/test.yml?style=flat-square&label=tests">
|
|
8
|
+
<img alt="License" src="https://img.shields.io/npm/l/@heavstal/api?style=flat-square">
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
> [!WARNING]
|
|
13
|
+
> **Migration Notice:** `@heavstaltech/api` has been renamed to **[@heavstal/api](https://www.npmjs.com/package/@heavstal/api)**.
|
|
14
|
+
> The legacy `@heavstaltech/api` package is now deprecated. Please update your dependencies to continue receiving security updates and new features.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
A powerful, zero-dependency multi-purpose SDK client for interacting with Heavstal Tech API Utilities. Supports ESM and CJS.
|
|
18
|
+
|
|
19
|
+
This module provides streamlined programmatic access to media parsing, search engines, file compilation, and AI utility tools without requiring external dependencies like Puppeteer or Axios.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Install via npm:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @heavstal/api
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Install via yarn:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn add @heavstal/api
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Authentication
|
|
40
|
+
|
|
41
|
+
To use this SDK, you must have a valid API Key from [Heavstal Tech Credentials](https://heavstal.com.ng/credentials). The SDK supports two methods of authentication:
|
|
42
|
+
|
|
43
|
+
### 1. Environment Variable (Recommended)
|
|
44
|
+
The SDK will automatically detect your API key if it is set in your environment variables.
|
|
45
|
+
|
|
46
|
+
```env
|
|
47
|
+
# .env
|
|
48
|
+
HEAVSTAL_API_KEY=ht_live_your_api_key_here
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Manual Configuration Object
|
|
52
|
+
If you prefer not to use environment variables, or need to switch keys dynamically, you can pass a configuration object as the final argument to any function.
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
const config = { apiKey: "ht_live_your_api_key_here" };
|
|
56
|
+
|
|
57
|
+
// Example passing the config
|
|
58
|
+
const result = await downloader.tiktok("https://vt.tiktok.com/...", config);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
This library is a hybrid module, meaning it seamlessly supports both **CommonJS (`require`)** and **ES Modules (`import`)**.
|
|
66
|
+
|
|
67
|
+
### ES Modules / TypeScript (`import`)
|
|
68
|
+
```typescript
|
|
69
|
+
import { downloader, search, tools } from '@heavstal/api';
|
|
70
|
+
|
|
71
|
+
// Or import specific standalone methods
|
|
72
|
+
import { tiktok, apk, unzipToText } from '@heavstal/api';
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### CommonJS (`require`)
|
|
76
|
+
```javascript
|
|
77
|
+
const { downloader, search, tools } = require('@heavstal/api');
|
|
78
|
+
|
|
79
|
+
// Or require specific standalone methods
|
|
80
|
+
const { tiktok, apk, unzipToText } = require('@heavstal/api');
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## API Documentation
|
|
86
|
+
|
|
87
|
+
### 1. Social Media Utilities
|
|
88
|
+
|
|
89
|
+
**TikTok (Video & Slides)**
|
|
90
|
+
Extract videos without watermarks, audio tracks, and slide images.
|
|
91
|
+
```javascript
|
|
92
|
+
// Video Extraction
|
|
93
|
+
const video = await downloader.tiktok("https://vt.tiktok.com/...");
|
|
94
|
+
console.log(video.no_watermark);
|
|
95
|
+
|
|
96
|
+
// Image Slides Extraction
|
|
97
|
+
const slide = await downloader.tiktokSlide("https://vt.tiktok.com/...");
|
|
98
|
+
console.log(slide.slideImages);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Instagram (Reels, Images, Videos)**
|
|
102
|
+
Extract media from public Instagram posts.
|
|
103
|
+
```javascript
|
|
104
|
+
const ig = await downloader.igdl("https://www.instagram.com/p/...");
|
|
105
|
+
console.log(ig);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Facebook**
|
|
109
|
+
Extract public Facebook Watch and post videos.
|
|
110
|
+
```javascript
|
|
111
|
+
const fb = await downloader.fbdl("https://fb.watch/...");
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Twitter / X**
|
|
115
|
+
Extract media from X.com (Twitter). Returns standard and high-definition video links.
|
|
116
|
+
```javascript
|
|
117
|
+
const tweet = await downloader.xdl("https://x.com/user/status/...");
|
|
118
|
+
console.log(tweet.video_hd);
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 2. YouTube Search & Extraction
|
|
122
|
+
|
|
123
|
+
**Search**
|
|
124
|
+
```javascript
|
|
125
|
+
const results = await search.youtube("No Copyright Sounds");
|
|
126
|
+
console.log(results[0].url);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Extract Audio / Video**
|
|
130
|
+
```javascript
|
|
131
|
+
// Extract MP3 Audio
|
|
132
|
+
const audio = await downloader.ytmp3("https://youtu.be/...");
|
|
133
|
+
|
|
134
|
+
// Extract MP4 Video
|
|
135
|
+
const video = await downloader.ytmp4("https://youtu.be/...");
|
|
136
|
+
|
|
137
|
+
// Play (Search and instantly extract first result)
|
|
138
|
+
const song = await downloader.play("Adele Hello", "mp3");
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 3. Search Utilities
|
|
142
|
+
|
|
143
|
+
**APK Metadata & Downloads**
|
|
144
|
+
Search for Android applications and fetch high-speed download links.
|
|
145
|
+
```javascript
|
|
146
|
+
const app = await search.apk("WhatsApp");
|
|
147
|
+
console.log(`Version: ${app.version} | Link: ${app.dl_url}`);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Song Lyrics (LRCLIB & Genius)**
|
|
151
|
+
Fetch accurate song metadata and lyrics.
|
|
152
|
+
```javascript
|
|
153
|
+
const song = await search.lyrics("Kendrick Lamar DNA");
|
|
154
|
+
console.log(song.lyrics);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Wattpad & Chords**
|
|
158
|
+
```javascript
|
|
159
|
+
// Search Wattpad stories
|
|
160
|
+
const stories = await search.wattpad("Science Fiction");
|
|
161
|
+
|
|
162
|
+
// Fetch Guitar Chords
|
|
163
|
+
const chords = await search.chords("Ed Sheeran Perfect");
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 4. General & AI Tools
|
|
167
|
+
|
|
168
|
+
**Repository/ZIP to Text Extractor**
|
|
169
|
+
Downloads a remote ZIP file, recursively extracts it, and compiles it into a single text buffer. Highly optimized for feeding codebases into Large Language Models (LLMs).
|
|
170
|
+
```javascript
|
|
171
|
+
const fs = require('fs');
|
|
172
|
+
|
|
173
|
+
// includeBinary: false skips images/PDFs, perfect for text/code extraction
|
|
174
|
+
const codebase = await tools.unzip("https://github.com/user/repo/archive/main.zip", {
|
|
175
|
+
includeBinary: false
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
fs.writeFileSync(codebase.filename, codebase.buffer);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
**Text to Speech (Google TTS)**
|
|
183
|
+
Convert text into spoken audio buffer.
|
|
184
|
+
```javascript
|
|
185
|
+
// Second argument is the language code (e.g., 'en', 'ja', 'es')
|
|
186
|
+
const audioBuffer = await tools.tts("Hello World", "en");
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Website Screenshot**
|
|
190
|
+
Capture responsive screenshots of any given URL.
|
|
191
|
+
```javascript
|
|
192
|
+
// Device options: 'desktop', 'tablet', 'phone'
|
|
193
|
+
const imgBuffer = await tools.ssweb("https://google.com", "desktop");
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Text Styling & Morse Code**
|
|
197
|
+
```javascript
|
|
198
|
+
// Generate stylized text variations
|
|
199
|
+
const fonts = await tools.styleText("Heavstal Tech");
|
|
200
|
+
|
|
201
|
+
// Morse code encoding/decoding
|
|
202
|
+
const morseStr = await tools.morse("HELLO", "encode"); // Output: .... . .-.. .-.. ---
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Heavstal Tech Ecosystem
|
|
208
|
+
|
|
209
|
+
This package is part of the Heavstal Tech platform. For endpoint documentation, uptime status, and higher rate limits, please visit our official portals:
|
|
210
|
+
|
|
211
|
+
* **Documentation:** [https://docs.heavstal.com.ng](https://docs.heavstal.com.ng)
|
|
212
|
+
* **API Key:** [https://heavstal.com.ng/credentials](https://heavstal.com.ng/credentials)
|
|
213
|
+
* **Pricing:** [https://heavstal.com.ng/pricing](https://heavstal.com.ng/pricing)
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
This project is licensed under the **MIT License**.
|
|
220
|
+
|
|
221
|
+
<div align="center">
|
|
222
|
+
<p>Maintained by <a href="https://heavstal.com.ng">HEAVSTAL TECH</a></p>
|
|
223
|
+
<p><i>Building Tomorrow's Web, Today.</i></p>
|
|
224
|
+
</div>
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
interface Author {
|
|
2
|
+
name: string;
|
|
3
|
+
source: string;
|
|
4
|
+
}
|
|
5
|
+
declare const AUTHOR: Author;
|
|
6
|
+
interface TikTokResult {
|
|
7
|
+
author: Author;
|
|
8
|
+
status: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
cover?: string;
|
|
11
|
+
origin_cover?: string;
|
|
12
|
+
no_watermark?: string;
|
|
13
|
+
watermark?: string;
|
|
14
|
+
music?: string;
|
|
15
|
+
views?: number | string;
|
|
16
|
+
likes?: number | string;
|
|
17
|
+
comments?: number | string;
|
|
18
|
+
shares?: number | string;
|
|
19
|
+
downloads?: number | string;
|
|
20
|
+
uniqueId?: string;
|
|
21
|
+
profileUrl?: string;
|
|
22
|
+
profileImage?: string;
|
|
23
|
+
hashtags?: string[];
|
|
24
|
+
slideImages?: string[];
|
|
25
|
+
author_name?: string;
|
|
26
|
+
}
|
|
27
|
+
interface SocialResult {
|
|
28
|
+
author: Author;
|
|
29
|
+
status: boolean;
|
|
30
|
+
type: 'video' | 'image';
|
|
31
|
+
title?: string;
|
|
32
|
+
thumbnail?: string;
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
35
|
+
interface YouTubeResult {
|
|
36
|
+
author: Author;
|
|
37
|
+
title: string;
|
|
38
|
+
thumbnail: string;
|
|
39
|
+
channel: string;
|
|
40
|
+
published: string;
|
|
41
|
+
views: string;
|
|
42
|
+
url: string;
|
|
43
|
+
duration?: number | string;
|
|
44
|
+
status?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface YouTubeSearchResult {
|
|
47
|
+
type: 'video' | 'channel' | 'list' | 'live';
|
|
48
|
+
url: string;
|
|
49
|
+
title: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
image?: string;
|
|
52
|
+
thumbnail?: string;
|
|
53
|
+
seconds?: number;
|
|
54
|
+
timestamp?: string;
|
|
55
|
+
views?: number;
|
|
56
|
+
ago?: string;
|
|
57
|
+
author?: {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
interface UtilsResult {
|
|
63
|
+
author: Author;
|
|
64
|
+
status: boolean;
|
|
65
|
+
data: Buffer | string | any;
|
|
66
|
+
}
|
|
67
|
+
interface TwitterResult {
|
|
68
|
+
author: Author;
|
|
69
|
+
status: boolean;
|
|
70
|
+
desc: string;
|
|
71
|
+
thumbnail: string;
|
|
72
|
+
video_sd?: string;
|
|
73
|
+
video_hd?: string;
|
|
74
|
+
audio?: string;
|
|
75
|
+
}
|
|
76
|
+
interface LyricsResult {
|
|
77
|
+
author: Author;
|
|
78
|
+
status: boolean;
|
|
79
|
+
title: string;
|
|
80
|
+
artist: string;
|
|
81
|
+
image: string;
|
|
82
|
+
url: string;
|
|
83
|
+
lyrics: string;
|
|
84
|
+
}
|
|
85
|
+
interface ApkResult {
|
|
86
|
+
author: Author;
|
|
87
|
+
status: boolean;
|
|
88
|
+
name: string;
|
|
89
|
+
package_id: string;
|
|
90
|
+
version: string;
|
|
91
|
+
downloads: number;
|
|
92
|
+
size: string;
|
|
93
|
+
icon: string;
|
|
94
|
+
dl_url: string;
|
|
95
|
+
last_updated?: string;
|
|
96
|
+
}
|
|
97
|
+
interface HeavstalConfig {
|
|
98
|
+
apiKey?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface UnzipOptions {
|
|
102
|
+
includeBinary?: boolean;
|
|
103
|
+
}
|
|
104
|
+
declare const unzipToText: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
105
|
+
author: typeof AUTHOR;
|
|
106
|
+
buffer: Buffer;
|
|
107
|
+
filename: string;
|
|
108
|
+
}>;
|
|
109
|
+
|
|
110
|
+
declare const tiktok: (input: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
111
|
+
declare const tiktokSlide: (url: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
112
|
+
|
|
113
|
+
declare const fbdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
114
|
+
declare const igdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
115
|
+
|
|
116
|
+
declare const twitter: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
117
|
+
|
|
118
|
+
declare const search$1: (query: string, config?: HeavstalConfig) => Promise<YouTubeSearchResult[]>;
|
|
119
|
+
declare const ytmp3: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
120
|
+
declare const ytmp4: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
121
|
+
declare const play: (query: string, format?: "mp3" | "mp4", config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
122
|
+
|
|
123
|
+
declare const ssweb: (url: string, device?: "desktop" | "tablet" | "phone", config?: HeavstalConfig) => Promise<Buffer>;
|
|
124
|
+
declare const styleText: (text: string, config?: HeavstalConfig) => Promise<{
|
|
125
|
+
author: Author;
|
|
126
|
+
name: string;
|
|
127
|
+
result: string;
|
|
128
|
+
}[]>;
|
|
129
|
+
declare const wattpad: (query: string, config?: HeavstalConfig) => Promise<any[]>;
|
|
130
|
+
declare const morse: (input: string, mode?: "encode" | "decode", config?: HeavstalConfig) => Promise<string>;
|
|
131
|
+
declare const tts: (text: string, lang?: string, config?: HeavstalConfig) => Promise<Buffer>;
|
|
132
|
+
declare const chords: (query: string, config?: HeavstalConfig) => Promise<any>;
|
|
133
|
+
|
|
134
|
+
declare const ephoto: (style: string, text: string, config?: HeavstalConfig) => Promise<string>;
|
|
135
|
+
|
|
136
|
+
declare const lyrics: (query: string, config?: HeavstalConfig) => Promise<LyricsResult>;
|
|
137
|
+
|
|
138
|
+
declare const apk: (query: string, config?: HeavstalConfig) => Promise<ApkResult>;
|
|
139
|
+
|
|
140
|
+
declare const downloader: {
|
|
141
|
+
tiktok: (input: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
142
|
+
tiktokSlide: (url: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
143
|
+
igdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
144
|
+
fbdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
145
|
+
twitter: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
146
|
+
xdl: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
147
|
+
ytmp3: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
148
|
+
ytmp4: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
149
|
+
play: (query: string, format?: "mp3" | "mp4", config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
150
|
+
};
|
|
151
|
+
declare const search: {
|
|
152
|
+
youtube: (query: string, config?: HeavstalConfig) => Promise<YouTubeSearchResult[]>;
|
|
153
|
+
wattpad: (query: string, config?: HeavstalConfig) => Promise<any[]>;
|
|
154
|
+
chords: (query: string, config?: HeavstalConfig) => Promise<any>;
|
|
155
|
+
lyrics: (query: string, config?: HeavstalConfig) => Promise<LyricsResult>;
|
|
156
|
+
apk: (query: string, config?: HeavstalConfig) => Promise<ApkResult>;
|
|
157
|
+
};
|
|
158
|
+
declare const tools: {
|
|
159
|
+
ssweb: (url: string, device?: "desktop" | "tablet" | "phone", config?: HeavstalConfig) => Promise<Buffer>;
|
|
160
|
+
unzipToText: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
161
|
+
author: typeof AUTHOR;
|
|
162
|
+
buffer: Buffer;
|
|
163
|
+
filename: string;
|
|
164
|
+
}>;
|
|
165
|
+
unzip: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
166
|
+
author: typeof AUTHOR;
|
|
167
|
+
buffer: Buffer;
|
|
168
|
+
filename: string;
|
|
169
|
+
}>;
|
|
170
|
+
styleText: (text: string, config?: HeavstalConfig) => Promise<{
|
|
171
|
+
author: Author;
|
|
172
|
+
name: string;
|
|
173
|
+
result: string;
|
|
174
|
+
}[]>;
|
|
175
|
+
morse: (input: string, mode?: "encode" | "decode", config?: HeavstalConfig) => Promise<string>;
|
|
176
|
+
tts: (text: string, lang?: string, config?: HeavstalConfig) => Promise<Buffer>;
|
|
177
|
+
ephoto: (style: string, text: string, config?: HeavstalConfig) => Promise<string>;
|
|
178
|
+
};
|
|
179
|
+
declare const _default: {
|
|
180
|
+
downloader: {
|
|
181
|
+
tiktok: (input: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
182
|
+
tiktokSlide: (url: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
183
|
+
igdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
184
|
+
fbdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
185
|
+
twitter: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
186
|
+
xdl: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
187
|
+
ytmp3: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
188
|
+
ytmp4: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
189
|
+
play: (query: string, format?: "mp3" | "mp4", config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
190
|
+
};
|
|
191
|
+
search: {
|
|
192
|
+
youtube: (query: string, config?: HeavstalConfig) => Promise<YouTubeSearchResult[]>;
|
|
193
|
+
wattpad: (query: string, config?: HeavstalConfig) => Promise<any[]>;
|
|
194
|
+
chords: (query: string, config?: HeavstalConfig) => Promise<any>;
|
|
195
|
+
lyrics: (query: string, config?: HeavstalConfig) => Promise<LyricsResult>;
|
|
196
|
+
apk: (query: string, config?: HeavstalConfig) => Promise<ApkResult>;
|
|
197
|
+
};
|
|
198
|
+
tools: {
|
|
199
|
+
ssweb: (url: string, device?: "desktop" | "tablet" | "phone", config?: HeavstalConfig) => Promise<Buffer>;
|
|
200
|
+
unzipToText: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
201
|
+
author: typeof AUTHOR;
|
|
202
|
+
buffer: Buffer;
|
|
203
|
+
filename: string;
|
|
204
|
+
}>;
|
|
205
|
+
unzip: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
206
|
+
author: typeof AUTHOR;
|
|
207
|
+
buffer: Buffer;
|
|
208
|
+
filename: string;
|
|
209
|
+
}>;
|
|
210
|
+
styleText: (text: string, config?: HeavstalConfig) => Promise<{
|
|
211
|
+
author: Author;
|
|
212
|
+
name: string;
|
|
213
|
+
result: string;
|
|
214
|
+
}[]>;
|
|
215
|
+
morse: (input: string, mode?: "encode" | "decode", config?: HeavstalConfig) => Promise<string>;
|
|
216
|
+
tts: (text: string, lang?: string, config?: HeavstalConfig) => Promise<Buffer>;
|
|
217
|
+
ephoto: (style: string, text: string, config?: HeavstalConfig) => Promise<string>;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export { AUTHOR, type ApkResult, type Author, type HeavstalConfig, type LyricsResult, type SocialResult, type TikTokResult, type TwitterResult, type UtilsResult, type YouTubeResult, type YouTubeSearchResult, apk, chords, _default as default, downloader, ephoto, fbdl, igdl, lyrics, morse, play, search, ssweb, styleText, tiktok, tiktokSlide, tools, tts, twitter, unzipToText, wattpad, twitter as xdl, search$1 as ytSearch, ytmp3, ytmp4 };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
interface Author {
|
|
2
|
+
name: string;
|
|
3
|
+
source: string;
|
|
4
|
+
}
|
|
5
|
+
declare const AUTHOR: Author;
|
|
6
|
+
interface TikTokResult {
|
|
7
|
+
author: Author;
|
|
8
|
+
status: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
cover?: string;
|
|
11
|
+
origin_cover?: string;
|
|
12
|
+
no_watermark?: string;
|
|
13
|
+
watermark?: string;
|
|
14
|
+
music?: string;
|
|
15
|
+
views?: number | string;
|
|
16
|
+
likes?: number | string;
|
|
17
|
+
comments?: number | string;
|
|
18
|
+
shares?: number | string;
|
|
19
|
+
downloads?: number | string;
|
|
20
|
+
uniqueId?: string;
|
|
21
|
+
profileUrl?: string;
|
|
22
|
+
profileImage?: string;
|
|
23
|
+
hashtags?: string[];
|
|
24
|
+
slideImages?: string[];
|
|
25
|
+
author_name?: string;
|
|
26
|
+
}
|
|
27
|
+
interface SocialResult {
|
|
28
|
+
author: Author;
|
|
29
|
+
status: boolean;
|
|
30
|
+
type: 'video' | 'image';
|
|
31
|
+
title?: string;
|
|
32
|
+
thumbnail?: string;
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
35
|
+
interface YouTubeResult {
|
|
36
|
+
author: Author;
|
|
37
|
+
title: string;
|
|
38
|
+
thumbnail: string;
|
|
39
|
+
channel: string;
|
|
40
|
+
published: string;
|
|
41
|
+
views: string;
|
|
42
|
+
url: string;
|
|
43
|
+
duration?: number | string;
|
|
44
|
+
status?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface YouTubeSearchResult {
|
|
47
|
+
type: 'video' | 'channel' | 'list' | 'live';
|
|
48
|
+
url: string;
|
|
49
|
+
title: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
image?: string;
|
|
52
|
+
thumbnail?: string;
|
|
53
|
+
seconds?: number;
|
|
54
|
+
timestamp?: string;
|
|
55
|
+
views?: number;
|
|
56
|
+
ago?: string;
|
|
57
|
+
author?: {
|
|
58
|
+
name: string;
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
interface UtilsResult {
|
|
63
|
+
author: Author;
|
|
64
|
+
status: boolean;
|
|
65
|
+
data: Buffer | string | any;
|
|
66
|
+
}
|
|
67
|
+
interface TwitterResult {
|
|
68
|
+
author: Author;
|
|
69
|
+
status: boolean;
|
|
70
|
+
desc: string;
|
|
71
|
+
thumbnail: string;
|
|
72
|
+
video_sd?: string;
|
|
73
|
+
video_hd?: string;
|
|
74
|
+
audio?: string;
|
|
75
|
+
}
|
|
76
|
+
interface LyricsResult {
|
|
77
|
+
author: Author;
|
|
78
|
+
status: boolean;
|
|
79
|
+
title: string;
|
|
80
|
+
artist: string;
|
|
81
|
+
image: string;
|
|
82
|
+
url: string;
|
|
83
|
+
lyrics: string;
|
|
84
|
+
}
|
|
85
|
+
interface ApkResult {
|
|
86
|
+
author: Author;
|
|
87
|
+
status: boolean;
|
|
88
|
+
name: string;
|
|
89
|
+
package_id: string;
|
|
90
|
+
version: string;
|
|
91
|
+
downloads: number;
|
|
92
|
+
size: string;
|
|
93
|
+
icon: string;
|
|
94
|
+
dl_url: string;
|
|
95
|
+
last_updated?: string;
|
|
96
|
+
}
|
|
97
|
+
interface HeavstalConfig {
|
|
98
|
+
apiKey?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface UnzipOptions {
|
|
102
|
+
includeBinary?: boolean;
|
|
103
|
+
}
|
|
104
|
+
declare const unzipToText: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
105
|
+
author: typeof AUTHOR;
|
|
106
|
+
buffer: Buffer;
|
|
107
|
+
filename: string;
|
|
108
|
+
}>;
|
|
109
|
+
|
|
110
|
+
declare const tiktok: (input: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
111
|
+
declare const tiktokSlide: (url: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
112
|
+
|
|
113
|
+
declare const fbdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
114
|
+
declare const igdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
115
|
+
|
|
116
|
+
declare const twitter: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
117
|
+
|
|
118
|
+
declare const search$1: (query: string, config?: HeavstalConfig) => Promise<YouTubeSearchResult[]>;
|
|
119
|
+
declare const ytmp3: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
120
|
+
declare const ytmp4: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
121
|
+
declare const play: (query: string, format?: "mp3" | "mp4", config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
122
|
+
|
|
123
|
+
declare const ssweb: (url: string, device?: "desktop" | "tablet" | "phone", config?: HeavstalConfig) => Promise<Buffer>;
|
|
124
|
+
declare const styleText: (text: string, config?: HeavstalConfig) => Promise<{
|
|
125
|
+
author: Author;
|
|
126
|
+
name: string;
|
|
127
|
+
result: string;
|
|
128
|
+
}[]>;
|
|
129
|
+
declare const wattpad: (query: string, config?: HeavstalConfig) => Promise<any[]>;
|
|
130
|
+
declare const morse: (input: string, mode?: "encode" | "decode", config?: HeavstalConfig) => Promise<string>;
|
|
131
|
+
declare const tts: (text: string, lang?: string, config?: HeavstalConfig) => Promise<Buffer>;
|
|
132
|
+
declare const chords: (query: string, config?: HeavstalConfig) => Promise<any>;
|
|
133
|
+
|
|
134
|
+
declare const ephoto: (style: string, text: string, config?: HeavstalConfig) => Promise<string>;
|
|
135
|
+
|
|
136
|
+
declare const lyrics: (query: string, config?: HeavstalConfig) => Promise<LyricsResult>;
|
|
137
|
+
|
|
138
|
+
declare const apk: (query: string, config?: HeavstalConfig) => Promise<ApkResult>;
|
|
139
|
+
|
|
140
|
+
declare const downloader: {
|
|
141
|
+
tiktok: (input: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
142
|
+
tiktokSlide: (url: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
143
|
+
igdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
144
|
+
fbdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
145
|
+
twitter: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
146
|
+
xdl: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
147
|
+
ytmp3: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
148
|
+
ytmp4: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
149
|
+
play: (query: string, format?: "mp3" | "mp4", config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
150
|
+
};
|
|
151
|
+
declare const search: {
|
|
152
|
+
youtube: (query: string, config?: HeavstalConfig) => Promise<YouTubeSearchResult[]>;
|
|
153
|
+
wattpad: (query: string, config?: HeavstalConfig) => Promise<any[]>;
|
|
154
|
+
chords: (query: string, config?: HeavstalConfig) => Promise<any>;
|
|
155
|
+
lyrics: (query: string, config?: HeavstalConfig) => Promise<LyricsResult>;
|
|
156
|
+
apk: (query: string, config?: HeavstalConfig) => Promise<ApkResult>;
|
|
157
|
+
};
|
|
158
|
+
declare const tools: {
|
|
159
|
+
ssweb: (url: string, device?: "desktop" | "tablet" | "phone", config?: HeavstalConfig) => Promise<Buffer>;
|
|
160
|
+
unzipToText: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
161
|
+
author: typeof AUTHOR;
|
|
162
|
+
buffer: Buffer;
|
|
163
|
+
filename: string;
|
|
164
|
+
}>;
|
|
165
|
+
unzip: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
166
|
+
author: typeof AUTHOR;
|
|
167
|
+
buffer: Buffer;
|
|
168
|
+
filename: string;
|
|
169
|
+
}>;
|
|
170
|
+
styleText: (text: string, config?: HeavstalConfig) => Promise<{
|
|
171
|
+
author: Author;
|
|
172
|
+
name: string;
|
|
173
|
+
result: string;
|
|
174
|
+
}[]>;
|
|
175
|
+
morse: (input: string, mode?: "encode" | "decode", config?: HeavstalConfig) => Promise<string>;
|
|
176
|
+
tts: (text: string, lang?: string, config?: HeavstalConfig) => Promise<Buffer>;
|
|
177
|
+
ephoto: (style: string, text: string, config?: HeavstalConfig) => Promise<string>;
|
|
178
|
+
};
|
|
179
|
+
declare const _default: {
|
|
180
|
+
downloader: {
|
|
181
|
+
tiktok: (input: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
182
|
+
tiktokSlide: (url: string, config?: HeavstalConfig) => Promise<TikTokResult>;
|
|
183
|
+
igdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
184
|
+
fbdl: (url: string, config?: HeavstalConfig) => Promise<SocialResult[]>;
|
|
185
|
+
twitter: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
186
|
+
xdl: (url: string, config?: HeavstalConfig) => Promise<TwitterResult>;
|
|
187
|
+
ytmp3: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
188
|
+
ytmp4: (url: string, config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
189
|
+
play: (query: string, format?: "mp3" | "mp4", config?: HeavstalConfig) => Promise<YouTubeResult>;
|
|
190
|
+
};
|
|
191
|
+
search: {
|
|
192
|
+
youtube: (query: string, config?: HeavstalConfig) => Promise<YouTubeSearchResult[]>;
|
|
193
|
+
wattpad: (query: string, config?: HeavstalConfig) => Promise<any[]>;
|
|
194
|
+
chords: (query: string, config?: HeavstalConfig) => Promise<any>;
|
|
195
|
+
lyrics: (query: string, config?: HeavstalConfig) => Promise<LyricsResult>;
|
|
196
|
+
apk: (query: string, config?: HeavstalConfig) => Promise<ApkResult>;
|
|
197
|
+
};
|
|
198
|
+
tools: {
|
|
199
|
+
ssweb: (url: string, device?: "desktop" | "tablet" | "phone", config?: HeavstalConfig) => Promise<Buffer>;
|
|
200
|
+
unzipToText: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
201
|
+
author: typeof AUTHOR;
|
|
202
|
+
buffer: Buffer;
|
|
203
|
+
filename: string;
|
|
204
|
+
}>;
|
|
205
|
+
unzip: (url: string, options?: UnzipOptions, config?: HeavstalConfig) => Promise<{
|
|
206
|
+
author: typeof AUTHOR;
|
|
207
|
+
buffer: Buffer;
|
|
208
|
+
filename: string;
|
|
209
|
+
}>;
|
|
210
|
+
styleText: (text: string, config?: HeavstalConfig) => Promise<{
|
|
211
|
+
author: Author;
|
|
212
|
+
name: string;
|
|
213
|
+
result: string;
|
|
214
|
+
}[]>;
|
|
215
|
+
morse: (input: string, mode?: "encode" | "decode", config?: HeavstalConfig) => Promise<string>;
|
|
216
|
+
tts: (text: string, lang?: string, config?: HeavstalConfig) => Promise<Buffer>;
|
|
217
|
+
ephoto: (style: string, text: string, config?: HeavstalConfig) => Promise<string>;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export { AUTHOR, type ApkResult, type Author, type HeavstalConfig, type LyricsResult, type SocialResult, type TikTokResult, type TwitterResult, type UtilsResult, type YouTubeResult, type YouTubeSearchResult, apk, chords, _default as default, downloader, ephoto, fbdl, igdl, lyrics, morse, play, search, ssweb, styleText, tiktok, tiktokSlide, tools, tts, twitter, unzipToText, wattpad, twitter as xdl, search$1 as ytSearch, ytmp3, ytmp4 };
|