@xtr-dev/rondevu-client 0.3.2 → 0.3.3

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 CHANGED
@@ -39,11 +39,11 @@ const rdv = new Rondevu({
39
39
  }
40
40
  });
41
41
 
42
- // Create a connection with custom ID
43
- const connection = await rdv.create('my-room-123');
42
+ // Create an offer with custom ID
43
+ const connection = await rdv.offer('my-room-123');
44
44
 
45
- // Or connect to an existing connection
46
- const connection = await rdv.connect('my-room-123');
45
+ // Or answer an existing offer
46
+ const connection = await rdv.answer('my-room-123');
47
47
 
48
48
  // Use data channels
49
49
  connection.on('connect', () => {
@@ -77,7 +77,7 @@ const rdv = new Rondevu({
77
77
  }
78
78
  });
79
79
 
80
- const connection = await rdv.create('my-room-123');
80
+ const connection = await rdv.offer('my-room-123');
81
81
 
82
82
  connection.on('connect', () => {
83
83
  const channel = connection.dataChannel('chat');
@@ -88,8 +88,8 @@ connection.on('connect', () => {
88
88
  ### API
89
89
 
90
90
  **Main Methods:**
91
- - `rdv.create(id)` - Create connection with custom ID
92
- - `rdv.connect(id)` - Connect to existing connection by ID
91
+ - `rdv.offer(id)` - Create an offer with custom ID
92
+ - `rdv.answer(id)` - Answer an existing offer by ID
93
93
 
94
94
  **Connection Events:**
95
95
  - `connect` - Connection established
package/dist/rondevu.d.ts CHANGED
@@ -38,17 +38,17 @@ export declare class Rondevu {
38
38
  */
39
39
  updatePeerId(newPeerId: string): void;
40
40
  /**
41
- * Create a new connection (offerer role)
42
- * @param id - Connection identifier (custom code)
41
+ * Create an offer (offerer role)
42
+ * @param id - Offer identifier (custom code)
43
43
  * @returns Promise that resolves to RondevuConnection
44
44
  */
45
- create(id: string): Promise<RondevuConnection>;
45
+ offer(id: string): Promise<RondevuConnection>;
46
46
  /**
47
- * Connect to an existing offer by ID (answerer role)
47
+ * Answer an existing offer by ID (answerer role)
48
48
  * @param id - Offer code
49
49
  * @returns Promise that resolves to RondevuConnection
50
50
  */
51
- connect(id: string): Promise<RondevuConnection>;
51
+ answer(id: string): Promise<RondevuConnection>;
52
52
  /**
53
53
  * Wait for ICE gathering to complete
54
54
  */
package/dist/rondevu.js CHANGED
@@ -40,7 +40,7 @@ export class Rondevu {
40
40
  async checkServerVersion() {
41
41
  try {
42
42
  const { version: serverVersion } = await this.api.health();
43
- const clientVersion = '0.3.2'; // Should match package.json
43
+ const clientVersion = '0.3.3'; // Should match package.json
44
44
  if (!this.isVersionCompatible(clientVersion, serverVersion)) {
45
45
  console.warn(`[Rondevu] Version mismatch: client v${clientVersion}, server v${serverVersion}. ` +
46
46
  'This may cause compatibility issues.');
@@ -74,11 +74,11 @@ export class Rondevu {
74
74
  this.peerId = newPeerId;
75
75
  }
76
76
  /**
77
- * Create a new connection (offerer role)
78
- * @param id - Connection identifier (custom code)
77
+ * Create an offer (offerer role)
78
+ * @param id - Offer identifier (custom code)
79
79
  * @returns Promise that resolves to RondevuConnection
80
80
  */
81
- async create(id) {
81
+ async offer(id) {
82
82
  // Create peer connection
83
83
  const pc = new this.RTCPeerConnection(this.rtcConfig);
84
84
  // Create initial data channel for negotiation (required for offer creation)
@@ -111,11 +111,11 @@ export class Rondevu {
111
111
  return connection;
112
112
  }
113
113
  /**
114
- * Connect to an existing offer by ID (answerer role)
114
+ * Answer an existing offer by ID (answerer role)
115
115
  * @param id - Offer code
116
116
  * @returns Promise that resolves to RondevuConnection
117
117
  */
118
- async connect(id) {
118
+ async answer(id) {
119
119
  // Poll server to get offer by ID
120
120
  const offerData = await this.findOfferById(id);
121
121
  if (!offerData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtr-dev/rondevu-client",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "TypeScript client for Rondevu peer signaling and discovery server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",