@xtr-dev/rondevu-client 0.7.11 → 0.7.12

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/dist/auth.d.ts CHANGED
@@ -9,10 +9,10 @@ export declare class RondevuAuth {
9
9
  constructor(baseUrl: string, fetchFn?: FetchFunction);
10
10
  /**
11
11
  * Register a new peer and receive credentials
12
- * @param customPeerId - Optional custom peer ID (1-128 characters). If not provided, a random ID will be generated.
13
- * @throws Error if registration fails (e.g., peer ID already in use)
12
+ * Generates a cryptographically random peer ID (128-bit)
13
+ * @throws Error if registration fails
14
14
  */
15
- register(customPeerId?: string): Promise<Credentials>;
15
+ register(): Promise<Credentials>;
16
16
  /**
17
17
  * Create Authorization header value
18
18
  */
package/dist/auth.js CHANGED
@@ -11,20 +11,16 @@ export class RondevuAuth {
11
11
  }
12
12
  /**
13
13
  * Register a new peer and receive credentials
14
- * @param customPeerId - Optional custom peer ID (1-128 characters). If not provided, a random ID will be generated.
15
- * @throws Error if registration fails (e.g., peer ID already in use)
14
+ * Generates a cryptographically random peer ID (128-bit)
15
+ * @throws Error if registration fails
16
16
  */
17
- async register(customPeerId) {
18
- const body = {};
19
- if (customPeerId !== undefined) {
20
- body.peerId = customPeerId;
21
- }
17
+ async register() {
22
18
  const response = await this.fetchFn(`${this.baseUrl}/register`, {
23
19
  method: 'POST',
24
20
  headers: {
25
21
  'Content-Type': 'application/json',
26
22
  },
27
- body: JSON.stringify(body),
23
+ body: JSON.stringify({}),
28
24
  });
29
25
  if (!response.ok) {
30
26
  const error = await response.json().catch(() => ({ error: 'Unknown error' }));
package/dist/rondevu.d.ts CHANGED
@@ -72,9 +72,9 @@ export declare class Rondevu {
72
72
  get offers(): RondevuOffers;
73
73
  /**
74
74
  * Register and initialize authenticated client
75
- * @param customPeerId - Optional custom peer ID (1-128 characters). If not provided, a random ID will be generated.
75
+ * Generates a cryptographically random peer ID (128-bit)
76
76
  */
77
- register(customPeerId?: string): Promise<Credentials>;
77
+ register(): Promise<Credentials>;
78
78
  /**
79
79
  * Check if client is authenticated
80
80
  */
package/dist/rondevu.js CHANGED
@@ -25,10 +25,10 @@ export class Rondevu {
25
25
  }
26
26
  /**
27
27
  * Register and initialize authenticated client
28
- * @param customPeerId - Optional custom peer ID (1-128 characters). If not provided, a random ID will be generated.
28
+ * Generates a cryptographically random peer ID (128-bit)
29
29
  */
30
- async register(customPeerId) {
31
- this.credentials = await this.auth.register(customPeerId);
30
+ async register() {
31
+ this.credentials = await this.auth.register();
32
32
  // Create offers API instance
33
33
  this._offers = new RondevuOffers(this.baseUrl, this.credentials, this.fetchFn);
34
34
  return this.credentials;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtr-dev/rondevu-client",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "TypeScript client for Rondevu topic-based peer discovery and signaling server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",