@xtr-dev/rondevu-client 0.12.2 → 0.12.4

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.
@@ -36,14 +36,25 @@ export class RondevuService {
36
36
  this.username = options.username;
37
37
  this.keypair = options.keypair || null;
38
38
  this.api = new RondevuAPI(options.apiUrl, options.credentials);
39
+ console.log('[RondevuService] Constructor called:', {
40
+ username: this.username,
41
+ hasKeypair: !!this.keypair,
42
+ publicKey: this.keypair?.publicKey
43
+ });
39
44
  }
40
45
  /**
41
46
  * Initialize the service - generates keypair if not provided
42
47
  * Call this before using other methods
43
48
  */
44
49
  async initialize() {
50
+ console.log('[RondevuService] Initialize called, hasKeypair:', !!this.keypair);
45
51
  if (!this.keypair) {
52
+ console.log('[RondevuService] Generating new keypair...');
46
53
  this.keypair = await RondevuAPI.generateKeypair();
54
+ console.log('[RondevuService] Generated keypair, publicKey:', this.keypair.publicKey);
55
+ }
56
+ else {
57
+ console.log('[RondevuService] Using existing keypair, publicKey:', this.keypair.publicKey);
47
58
  }
48
59
  // Register with API if no credentials provided
49
60
  if (!this.api['credentials']) {
@@ -131,6 +142,14 @@ export class RondevuService {
131
142
  }
132
143
  try {
133
144
  const check = await this.api.checkUsername(this.username);
145
+ // Debug logging
146
+ console.log('[RondevuService] Username check:', {
147
+ username: this.username,
148
+ available: check.available,
149
+ serverPublicKey: check.publicKey,
150
+ localPublicKey: this.keypair.publicKey,
151
+ match: check.publicKey === this.keypair.publicKey
152
+ });
134
153
  // Username is claimed if it's not available and owned by our public key
135
154
  const claimed = !check.available && check.publicKey === this.keypair.publicKey;
136
155
  // Update internal flag to match server state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtr-dev/rondevu-client",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "TypeScript client for Rondevu with durable WebRTC connections, automatic reconnection, and message queuing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",