emusks 2.3.7 → 2.3.9

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.
@@ -1,8 +0,0 @@
1
- import { mintCastleToken } from "../castle.js";
2
-
3
- const t0 = Date.now();
4
- const token = await mintCastleToken();
5
- console.error(`[castle] minted in ${Date.now() - t0}ms`);
6
- console.error(`[castle] len=${token.length} format=${/^[A-Za-z0-9]+\|/.test(token) ? "ok (<id>|<payload>)" : "unexpected"}`);
7
- console.error(`[castle] head=${token.slice(0, 24)}`);
8
- process.exit(0);
@@ -1,28 +0,0 @@
1
- import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
2
- import flowLoginJetfuel from "../flow-jetfuel.js";
3
-
4
- const CODE_FILE = "/tmp/x-code.txt";
5
- const pollCode = async (type) => {
6
- console.error(`[test] NEED ${type} -> write it to ${CODE_FILE}`);
7
- for (let i = 0; i < 90; i++) {
8
- if (existsSync(CODE_FILE)) { const c = readFileSync(CODE_FILE, "utf8").trim(); unlinkSync(CODE_FILE); if (c) { console.error(`[test] got ${type}`); return c; } }
9
- await new Promise((r) => setTimeout(r, 2000));
10
- }
11
- throw new Error(`${type} not provided within timeout`);
12
- };
13
-
14
- try {
15
- const r = await flowLoginJetfuel({
16
- username: process.env.TEST_USER,
17
- password: process.env.TEST_PW,
18
- proxy: process.env.PROXY,
19
- timeout: 30,
20
- debug: true,
21
- onRequest: pollCode,
22
- });
23
- console.error("[test] LOGIN OK userId=", r.userId, "auth_token?", Boolean(r.authToken), "ct0?", Boolean(r.csrfToken));
24
- if (process.env.SESSION_OUT) { writeFileSync(process.env.SESSION_OUT, JSON.stringify(r, null, 2), { mode: 0o600 }); console.error("[test] session ->", process.env.SESSION_OUT); }
25
- } catch (e) {
26
- console.error("[test] FAILED:", e.message);
27
- }
28
- process.exit(0);
@@ -1,11 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import Emusks from "../index.js";
3
-
4
- const s = JSON.parse(readFileSync(process.env.SESSION_IN || "/tmp/emusks-session.json", "utf8"));
5
- const client = new Emusks();
6
- await client.login({ auth_token: s.authToken || s.auth_token, endpoint: "web", transactionIds: true });
7
-
8
- const res = await client.v1_1("get:account/settings", {});
9
- const body = await res.json();
10
- console.error("[verify] status", res.status, "| @" + body.screen_name, "| country", body.country_code);
11
- process.exit(0);