lekzo-prem 0.0.0-stage → 1.0.0

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.
Files changed (4) hide show
  1. package/README.md +155 -2
  2. package/index.js +53 -0
  3. package/install.js +29 -0
  4. package/package.json +27 -4
package/README.md CHANGED
@@ -1,3 +1,156 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="https://readme-typing-svg.demolab.com/?font=Fira+Code&weight=600&size=28&duration=3000&pause=1000&color=58A6FF&center=true&vCenter=true&width=800&lines=Lightweight+Node.js+Utility;API+Request+Handling;Token+Verification+%26+Batch+Processing" alt="lekzo-prem typing banner" />
4
+
5
+ [![NPM](https://img.shields.io/npm/dw/lekzo-prem?label=NPM&color=%23CB3837)](https://www.npmjs.com/package/lekzo-prem)
6
+
7
+ </div>
8
+
9
+ ## 📸 Project Showcase
10
+
11
+ <div align="center">
12
+
13
+ <img src="https://u.pone.rs/yyryctxs.jpg" width="800" alt="lekzo-prem project showcase" />
14
+
15
+ *A simple, efficient utility for API integration.*
16
+
17
+ </div>
18
+
19
+ ## ⚠️ Disclaimer & Liability
20
+
21
+ `lekzo-prem` is an independent open-source project and is not affiliated with, endorsed by, or officially connected to any third-party service or organization. Users are responsible for how they configure and use this package, including ensuring that their activities comply with applicable terms, policies, and laws. The maintainers are not responsible for misuse, service interruptions, data loss, or damages resulting from the use of this software.
22
+
23
+ ## Table of Contents
24
+
25
+ - [Features](#features)
26
+ - [Requirements](#requirements)
27
+ - [Installation](#installation)
28
+ - [Import](#import)
29
+ - [Quick Start](#quick-start)
30
+ - [Batch Processing](#batch-processing)
31
+ - [Error Handling](#error-handling)
32
+ - [Contributing](#contributing)
33
+ - [License](#license)
34
+
35
+ ## Features
36
+
37
+ ### Core
38
+
39
+ | Feature | Description |
40
+ |---|---|
41
+ | ⚡ Lightweight | A small utility package for Node.js projects. |
42
+ | 🚀 Efficient | Designed to support straightforward and efficient workflows. |
43
+ | 📦 Batch Processing | Supports processing multiple items in a batch. |
44
+ | 🔐 Secure | Encourages responsible input validation and careful handling of sensitive values. |
45
+ | 🛡️ Auto Error Handling | Helps provide a consistent approach to request error handling. |
46
+
47
+ ### Functions
48
+
49
+ | Function | Description |
50
+ |---|---|
51
+ | 🌐 `requestAuth` | Sends an authentication-related request using an email address. |
52
+ | 🔎 `processToken` | Processes a token using an email address and token link. |
53
+ | 📚 `batchProcess` | Starts a batch operation with the specified batch size. |
54
+
55
+ ## Requirements
56
+
57
+ - Node.js `>= 18.0.0`
58
+
59
+ ## Installation
60
+
61
+ Install the package using NPM:
62
+
63
+ ```bash
64
+ npm install lekzo-prem
65
+ ```
66
+
67
+ ## Import
68
+
69
+ Import the available functions into your project:
70
+
71
+ ```javascript
72
+ import { requestAuth, processToken, batchProcess } from 'lekzo-prem';
73
+ ```
74
+
75
+ ## Quick Start
76
+
77
+ The following examples demonstrate the basic function signatures. Replace the sample values with data you are authorized to use.
78
+
79
+ ### Request Auth
80
+
81
+ ```javascript
82
+ const email = 'user@example.com';
83
+
84
+ const result = await requestAuth(email);
85
+ console.log(result);
86
+ ```
87
+
88
+ ### Process Token
89
+
90
+ ```javascript
91
+ const email = 'user@example.com';
92
+ const tokenLink = 'https://example.com/token';
93
+
94
+ const result = await processToken(email, tokenLink);
95
+ console.log(result);
96
+ ```
97
+
98
+ ## Batch Processing
99
+
100
+ Run a batch operation with a batch size of `3`:
101
+
102
+ ```javascript
103
+ const result = await batchProcess(3);
104
+ console.log(result);
105
+ ```
106
+
107
+ ## Error Handling
108
+
109
+ Use `try...catch` to handle errors from asynchronous operations:
110
+
111
+ ```javascript
112
+ try {
113
+ const result = await requestAuth('user@example.com');
114
+ console.log('Request completed:', result);
115
+ } catch (error) {
116
+ console.error('Request failed:', error.message);
117
+ }
118
+ ```
119
+
120
+ ## Why Choose lekzo-prem?
121
+
122
+ `lekzo-prem` provides a lightweight set of Node.js utilities for API integration, making it a practical component for Telegram bots, Discord bots, and web applications that need clear request handling and simple batch workflows.
123
+
124
+ ## Contributing
125
+
126
+ Contributions are welcome. To contribute:
127
+
128
+ 1. Fork the repository.
129
+ 2. Create a new branch for your changes.
130
+ 3. Make your updates and test them locally.
131
+ 4. Commit your changes with a clear and descriptive message.
132
+ 5. Push your branch to your fork.
133
+ 6. Open a pull request with a summary of your changes.
134
+
135
+ ## License
136
+
137
+ MIT License
138
+
139
+ Copyright (c) 2026 Lekzo
140
+
141
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
142
+
143
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
144
+
145
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
146
+
147
+ <div align="center">
148
+
149
+ **lekzo-prem --- Lightweight Node.js Utility**
150
+
151
+ [![NPM](https://img.shields.io/npm/v/lekzo-prem?label=NPM&color=%23CB3837)](https://www.npmjs.com/package/lekzo-prem)
152
+ [![GitHub](https://img.shields.io/badge/GitHub-lekzsync%2Flekzo--utils-181717?logo=github)](https://github.com/lekzsync/lekzo-prem)
153
+
154
+ Made with by Lekzo
155
+
156
+ </div>
package/index.js ADDED
@@ -0,0 +1,53 @@
1
+ const BASE_URL = 'https://lekzoasync.my.id';
2
+
3
+ export async function requestAuth(email) {
4
+ if (!email || !email.includes('@')) throw new Error('Invalid email format!');
5
+ try {
6
+ const response = await fetch(`${BASE_URL}/api/send`, {
7
+ method: 'POST',
8
+ headers: { 'Content-Type': 'application/json' },
9
+ body: JSON.stringify({ gmail: email })
10
+ });
11
+ let data;
12
+ try { data = await response.json(); } catch (err) { throw new Error(`Server Error (HTTP ${response.status})`); }
13
+ if (!data.success) throw new Error(data.error || 'Request failed');
14
+ return data;
15
+ } catch (error) {
16
+ throw new Error(`Request process failed: ${error.message}`);
17
+ }
18
+ }
19
+
20
+ export async function processToken(email, tokenLink) {
21
+ if (!email || !email.includes('@')) throw new Error('Invalid email format!');
22
+ if (!tokenLink || !tokenLink.startsWith('https://')) throw new Error('Invalid token link!');
23
+ try {
24
+ const response = await fetch(`${BASE_URL}/api/verif`, {
25
+ method: 'POST',
26
+ headers: { 'Content-Type': 'application/json' },
27
+ body: JSON.stringify({ gmail: email, link: tokenLink })
28
+ });
29
+ let data;
30
+ try { data = await response.json(); } catch (err) { throw new Error(`Server Error (HTTP ${response.status})`); }
31
+ if (!data.success) throw new Error(data.error || 'Processing failed');
32
+ return data;
33
+ } catch (error) {
34
+ throw new Error(`Token process failed: ${error.message}`);
35
+ }
36
+ }
37
+
38
+ export async function batchProcess(total) {
39
+ if (!total || total < 1 || total > 5) throw new Error('Batch size must be between 1 and 5!');
40
+ try {
41
+ const response = await fetch(`${BASE_URL}/api/bulk`, {
42
+ method: 'POST',
43
+ headers: { 'Content-Type': 'application/json' },
44
+ body: JSON.stringify({ total })
45
+ });
46
+ let data;
47
+ try { data = await response.json(); } catch (err) { throw new Error(`Server Error (HTTP ${response.status})`); }
48
+ if (!data.success) throw new Error(data.error || 'Batch process failed');
49
+ return data;
50
+ } catch (error) {
51
+ throw new Error(`Batch process failed: ${error.message}`);
52
+ }
53
+ }
package/install.js ADDED
@@ -0,0 +1,29 @@
1
+ import chalk from 'chalk';
2
+
3
+ console.log(chalk.green(`
4
+ ⠀⠀⠀⢠⣾⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
5
+ ⠀⠀⣰⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
6
+ ⠀⢰⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
7
+ ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
8
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
9
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣀⣤⣤⣶⣾⣿⣿⣿⡷
10
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁
11
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀
12
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀
13
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀
14
+ ⣿⣿⣿⡇⠀⡾⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀
15
+ ⣿⣿⣿⣧⡀⠁⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀
16
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠉⢹⠉⠙⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀
17
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣀⠀⣀⣼⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀
18
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀
19
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
20
+ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠀⠤⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
21
+ ⣿⣿⣿⣿⠿⣿⣿⣿⣿⣿⣿⣿⠿⠋⢃⠈⠢⡁⠒⠄⡀⠈⠁⠀⠀⠀⠀⠀⠀⠀
22
+ ⣿⣿⠟⠁⠀⠀⠈⠉⠉⠁⠀⠀⠀⠀⠈⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
23
+ ⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`));
24
+
25
+ console.log("\n");
26
+ console.log(chalk.magenta("Hi, Thanks For Installing This Utility Package"));
27
+ console.log("\n");
28
+ console.log(chalk.cyan("Follow : @LekzoMarketV2 For More Update"));
29
+ console.log("\n");
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "lekzo-prem",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "A lightweight Node.js utility for API request handling and token verification.",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "postinstall": "node install.js"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/lekzsync/lekzo-prem.git"
13
+ },
14
+ "keywords": [
15
+ "api",
16
+ "utils",
17
+ "http",
18
+ "verification",
19
+ "token"
20
+ ],
21
+ "author": "Lekzo",
22
+ "license": "MIT",
23
+ "engines": {
24
+ "node": ">=18.0.0"
25
+ },
26
+ "dependencies": {
27
+ "chalk": "^5.6.2"
28
+ }
29
+ }