@gelglx/arjunakey 1.0.1 → 1.2.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.
- package/README.md +31 -12
- package/cli.js +29 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,39 +4,58 @@ CLI satu akun untuk:
|
|
|
4
4
|
|
|
5
5
|
1. membuat informasi akun acak,
|
|
6
6
|
2. register ke `https://dash.arjuna.dev/register`,
|
|
7
|
-
3. mempertahankan session hasil register
|
|
8
|
-
4.
|
|
7
|
+
3. mempertahankan session hasil register,
|
|
8
|
+
4. secara opsional mengklaim group code atau redeem voucher,
|
|
9
9
|
5. mengambil API key dari `/api/me`.
|
|
10
10
|
|
|
11
11
|
Tidak ada dependency npm eksternal.
|
|
12
12
|
|
|
13
|
-
## Instalasi
|
|
13
|
+
## Instalasi
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
|
|
17
|
-
npm install -g .
|
|
16
|
+
npm install -g @gelglx/arjunakey@latest
|
|
18
17
|
```
|
|
19
18
|
|
|
20
|
-
##
|
|
19
|
+
## Membuat akun tanpa klaim kode
|
|
21
20
|
|
|
22
21
|
```bash
|
|
23
22
|
arjunakey create
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
CLI tidak menyimpan voucher/group code default karena kode dapat kedaluwarsa atau hanya berlaku sekali.
|
|
26
|
+
|
|
27
|
+
## Klaim group code gratis
|
|
28
|
+
|
|
29
|
+
Kode dari info atau pinned message grup OneStore:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
arjunakey create --group-code KODE-GROUP-AKTIF
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Flag ini hanya memanggil:
|
|
27
36
|
|
|
28
37
|
```text
|
|
29
|
-
|
|
38
|
+
POST /api/billing/signup-bonus
|
|
30
39
|
```
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
## Redeem voucher berbayar
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
Voucher yang diterbitkan admin setelah pembayaran:
|
|
35
44
|
|
|
36
45
|
```bash
|
|
37
|
-
arjunakey create --
|
|
46
|
+
arjunakey create --voucher-code KODE-VOUCHER-AKTIF
|
|
38
47
|
```
|
|
39
48
|
|
|
49
|
+
Flag ini hanya memanggil:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
POST /api/billing/redeem
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`--group-code` dan `--voucher-code` tidak boleh digunakan bersamaan.
|
|
56
|
+
|
|
57
|
+
## Output dan penyimpanan
|
|
58
|
+
|
|
40
59
|
Output hanya API key:
|
|
41
60
|
|
|
42
61
|
```bash
|
|
@@ -69,4 +88,4 @@ Lihat semua opsi:
|
|
|
69
88
|
arjunakey --help
|
|
70
89
|
```
|
|
71
90
|
|
|
72
|
-
CLI sengaja hanya memproses satu akun per eksekusi; tidak menyediakan farm, worker paralel, proxy rotation, atau batch account creation.
|
|
91
|
+
CLI sengaja hanya memproses satu akun per eksekusi; tidak menyediakan brute force, farm, worker paralel, proxy rotation, atau batch account creation.
|
package/cli.js
CHANGED
|
@@ -8,9 +8,8 @@ const https = require('https');
|
|
|
8
8
|
const path = require('path');
|
|
9
9
|
const { URL } = require('url');
|
|
10
10
|
|
|
11
|
-
const VERSION = '1.0
|
|
11
|
+
const VERSION = '1.2.0';
|
|
12
12
|
const DEFAULT_BASE_URL = 'https://dash.arjuna.dev';
|
|
13
|
-
const DEFAULT_CODE = 'ONE-GROUP-6T2E-2V7N-H37Q';
|
|
14
13
|
|
|
15
14
|
class ApiError extends Error {
|
|
16
15
|
constructor(message, response = null) {
|
|
@@ -138,12 +137,20 @@ async function register(client, profile) {
|
|
|
138
137
|
assertOk(response, 'Gagal membuat akun');
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
async function
|
|
140
|
+
async function redeemVoucher(client, code) {
|
|
141
|
+
const voucherResponse = await client.request('POST', '/api/billing/redeem', { code });
|
|
142
|
+
if (voucherResponse.status >= 200 && voucherResponse.status < 300) {
|
|
143
|
+
return { kind: 'voucher', ...voucherResponse.data };
|
|
144
|
+
}
|
|
145
|
+
throw new ApiError(apiMessage(voucherResponse, 'Voucher ditolak'), voucherResponse);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async function claimGroupCode(client, code) {
|
|
142
149
|
const groupResponse = await client.request('POST', '/api/billing/signup-bonus', { code });
|
|
143
150
|
if (groupResponse.status >= 200 && groupResponse.status < 300) {
|
|
144
151
|
return { kind: 'welcome-group', ...groupResponse.data };
|
|
145
152
|
}
|
|
146
|
-
throw new ApiError(apiMessage(groupResponse, 'Group
|
|
153
|
+
throw new ApiError(apiMessage(groupResponse, 'Group code ditolak'), groupResponse);
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
async function getAccount(client) {
|
|
@@ -157,7 +164,8 @@ function parseArgs(argv) {
|
|
|
157
164
|
const opts = {
|
|
158
165
|
command: 'create',
|
|
159
166
|
baseUrl: process.env.ARJUNA_BASE_URL || DEFAULT_BASE_URL,
|
|
160
|
-
|
|
167
|
+
voucherCode: process.env.ARJUNA_VOUCHER_CODE || '',
|
|
168
|
+
groupCode: process.env.ARJUNA_GROUP_CODE || '',
|
|
161
169
|
emailDomain: process.env.ARJUNA_EMAIL_DOMAIN || 'example.com',
|
|
162
170
|
timeout: Number(process.env.ARJUNA_TIMEOUT || 30),
|
|
163
171
|
json: false,
|
|
@@ -168,7 +176,7 @@ function parseArgs(argv) {
|
|
|
168
176
|
|
|
169
177
|
const input = [...argv];
|
|
170
178
|
if (input[0] && !input[0].startsWith('-')) opts.command = input.shift();
|
|
171
|
-
const valueFlags = new Set(['--base-url', '--group-code', '--email-domain', '--name', '--email', '--password', '--save', '--account-out', '--timeout']);
|
|
179
|
+
const valueFlags = new Set(['--base-url', '--voucher-code', '--group-code', '--email-domain', '--name', '--email', '--password', '--save', '--account-out', '--timeout']);
|
|
172
180
|
|
|
173
181
|
for (let i = 0; i < input.length; i++) {
|
|
174
182
|
let flag = input[i];
|
|
@@ -188,6 +196,7 @@ function parseArgs(argv) {
|
|
|
188
196
|
|
|
189
197
|
switch (flag) {
|
|
190
198
|
case '--base-url': opts.baseUrl = value; break;
|
|
199
|
+
case '--voucher-code': opts.voucherCode = value; break;
|
|
191
200
|
case '--group-code': opts.groupCode = value; break;
|
|
192
201
|
case '--email-domain': opts.emailDomain = value; break;
|
|
193
202
|
case '--name': opts.name = value; break;
|
|
@@ -215,6 +224,7 @@ function validateOptions(opts) {
|
|
|
215
224
|
opts.baseUrl = base.origin;
|
|
216
225
|
if (!Number.isFinite(opts.timeout) || opts.timeout < 1 || opts.timeout > 300) throw new Error('Timeout harus 1-300 detik.');
|
|
217
226
|
if (opts.raw && opts.json) throw new Error('Pilih salah satu: --raw atau --json.');
|
|
227
|
+
if (opts.voucherCode && opts.groupCode) throw new Error('Pilih salah satu: --voucher-code atau --group-code.');
|
|
218
228
|
if (opts.command === 'login' && !(opts.email || process.env.ARJUNA_EMAIL)) throw new Error('login membutuhkan --email atau ARJUNA_EMAIL.');
|
|
219
229
|
if (opts.command === 'login' && !(opts.password || process.env.ARJUNA_PASSWORD)) throw new Error('login membutuhkan --password atau ARJUNA_PASSWORD.');
|
|
220
230
|
}
|
|
@@ -260,11 +270,11 @@ Pemakaian:
|
|
|
260
270
|
arjunakey create [opsi]
|
|
261
271
|
arjunakey login --email EMAIL --password PASSWORD [opsi]
|
|
262
272
|
|
|
263
|
-
create membuat satu akun acak
|
|
264
|
-
Kode default: ${DEFAULT_CODE}
|
|
273
|
+
create membuat satu akun acak lalu mengambil API key. Klaim kode bersifat opsional.
|
|
265
274
|
|
|
266
275
|
Opsi:
|
|
267
|
-
--
|
|
276
|
+
--voucher-code CODE Kode berbayar pada form "Redeem voucher"
|
|
277
|
+
--group-code CODE Kode bonus pada form "2. Enter group code"
|
|
268
278
|
--email-domain HOST Domain email acak (default: example.com)
|
|
269
279
|
--name NAME Ganti nama acak
|
|
270
280
|
--email EMAIL Ganti email acak
|
|
@@ -281,7 +291,8 @@ Opsi:
|
|
|
281
291
|
|
|
282
292
|
Environment:
|
|
283
293
|
ARJUNA_EMAIL, ARJUNA_PASSWORD, ARJUNA_BASE_URL,
|
|
284
|
-
ARJUNA_GROUP_CODE, ARJUNA_EMAIL_DOMAIN,
|
|
294
|
+
ARJUNA_VOUCHER_CODE, ARJUNA_GROUP_CODE, ARJUNA_EMAIL_DOMAIN,
|
|
295
|
+
ARJUNA_TIMEOUT`);
|
|
285
296
|
}
|
|
286
297
|
|
|
287
298
|
async function main() {
|
|
@@ -315,10 +326,15 @@ async function main() {
|
|
|
315
326
|
await login(client, profile.email, profile.password);
|
|
316
327
|
}
|
|
317
328
|
|
|
318
|
-
|
|
319
|
-
|
|
329
|
+
const claimCode = opts.groupCode || opts.voucherCode;
|
|
330
|
+
if (!opts.noClaim && claimCode) {
|
|
331
|
+
if (!opts.quiet && !opts.raw && !opts.json) {
|
|
332
|
+
console.error(opts.groupCode ? 'Mengisi group code...' : 'Redeem voucher...');
|
|
333
|
+
}
|
|
320
334
|
try {
|
|
321
|
-
claim =
|
|
335
|
+
claim = opts.groupCode
|
|
336
|
+
? await claimGroupCode(client, opts.groupCode)
|
|
337
|
+
: await redeemVoucher(client, opts.voucherCode);
|
|
322
338
|
} catch (error) {
|
|
323
339
|
if (opts.command === 'login' && error instanceof ApiError && /already|sudah|claimed/i.test(error.message)) {
|
|
324
340
|
claim = { kind: 'already-claimed' };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gelglx/arjunakey",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Single-account CLI for OneStore registration, group-code claiming, and API-key retrieval",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Single-account CLI for OneStore registration, group-code or voucher claiming, and API-key retrieval",
|
|
5
5
|
"bin": {
|
|
6
6
|
"arjunakey": "cli.js"
|
|
7
7
|
},
|