@tanakayuto/intmax402-cli 0.1.1 → 0.1.2

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 (2) hide show
  1. package/dist/index.js +6 -6
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const crypto_1 = require("crypto");
5
- const core_1 = require("@tanakayuto/intmax402-core");
6
- const client_1 = require("@tanakayuto/intmax402-client");
5
+ const intmax402_core_1 = require("@tanakayuto/intmax402-core");
6
+ const intmax402_client_1 = require("@tanakayuto/intmax402-client");
7
7
  const [, , command, ...args] = process.argv;
8
8
  async function main() {
9
9
  switch (command) {
@@ -40,7 +40,7 @@ async function testCommand(url) {
40
40
  return;
41
41
  }
42
42
  console.log(` WWW-Authenticate: ${wwwAuth}`);
43
- const challenge = (0, core_1.parseWWWAuthenticate)(wwwAuth);
43
+ const challenge = (0, intmax402_core_1.parseWWWAuthenticate)(wwwAuth);
44
44
  if (!challenge) {
45
45
  console.error(" Failed to parse challenge.");
46
46
  return;
@@ -50,7 +50,7 @@ async function testCommand(url) {
50
50
  // Step 2: Generate key and sign
51
51
  console.log("\nStep 2: Generating key and signing...");
52
52
  const privateKey = "0x" + (0, crypto_1.randomBytes)(32).toString("hex");
53
- const client = new client_1.INTMAX402Client({ privateKey });
53
+ const client = new intmax402_client_1.INTMAX402Client({ privateKey });
54
54
  await client.init();
55
55
  console.log(` Address: ${client.getAddress()}`);
56
56
  const signature = await client.sign(challenge.nonce);
@@ -69,7 +69,7 @@ async function testCommand(url) {
69
69
  }
70
70
  function keygenCommand() {
71
71
  const privateKey = "0x" + (0, crypto_1.randomBytes)(32).toString("hex");
72
- const client = new client_1.INTMAX402Client({ privateKey });
72
+ const client = new intmax402_client_1.INTMAX402Client({ privateKey });
73
73
  console.log("Generated test keypair:");
74
74
  console.log(` Private Key: ${privateKey}`);
75
75
  console.log(` Address: ${client.getAddress()}`);
@@ -79,7 +79,7 @@ function verifyCommand(header) {
79
79
  console.error("Usage: intmax402 verify <authorization-header>");
80
80
  process.exit(1);
81
81
  }
82
- const credential = (0, core_1.parseAuthorization)(header);
82
+ const credential = (0, intmax402_core_1.parseAuthorization)(header);
83
83
  if (!credential) {
84
84
  console.error("Failed to parse Authorization header.");
85
85
  process.exit(1);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@tanakayuto/intmax402-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "intmax402": "dist/index.js"
7
7
  },
8
8
  "dependencies": {
9
- "@tanakayuto/intmax402-core": "0.1.0",
10
- "@tanakayuto/intmax402-client": "0.1.0"
9
+ "@tanakayuto/intmax402-core": "0.1.2",
10
+ "@tanakayuto/intmax402-client": "0.1.2"
11
11
  },
12
12
  "devDependencies": {
13
13
  "typescript": "^5.4.0",