mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-16 05:43:24 +00:00
Add DX improvements and EventEmitter support (v0.18.1)
This release introduces several developer experience improvements: Breaking Changes: - Add EventEmitter support - Rondevu now extends EventEmitter - Consolidate discovery methods into findService() (getService, discoverService, discoverServices methods still exist but findService is the new unified API) New Features: - EventEmitter lifecycle events: - offer:created (offerId, serviceFqn) - offer:answered (offerId, peerUsername) - connection:opened (offerId, dataChannel) - connection:closed (offerId) - ice:candidate:local (offerId, candidate) - locally generated ICE - ice:candidate:remote (offerId, candidate, role) - remote ICE from server - error (error, context) - Unified findService() method with modes: - 'direct' - direct lookup by FQN with username - 'random' - random discovery without username - 'paginated' - paginated results with limit/offset - Typed error classes for better error handling: - RondevuError (base class with context) - NetworkError (network/API failures) - ValidationError (input validation) - ConnectionError (WebRTC connection issues) - Convenience methods: - getOfferCount() - get active offer count - isConnected(offerId) - check connection status - disconnectAll() - close all connections - getServiceStatus() - get service state Type Exports: - Export ActiveOffer interface for getActiveOffers() typing - Export FindServiceOptions, ServiceResult, PaginatedServiceResult - Export all error classes Dependencies: - Add @types/node for EventEmitter support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,13 +81,11 @@ export class NodeCryptoAdapter implements CryptoAdapter {
|
||||
|
||||
bytesToBase64(bytes: Uint8Array): string {
|
||||
// Node.js Buffer provides native base64 encoding
|
||||
// @ts-expect-error - Buffer is available in Node.js but not in browser TypeScript definitions
|
||||
return Buffer.from(bytes).toString('base64')
|
||||
}
|
||||
|
||||
base64ToBytes(base64: string): Uint8Array {
|
||||
// Node.js Buffer provides native base64 decoding
|
||||
// @ts-expect-error - Buffer is available in Node.js but not in browser TypeScript definitions
|
||||
return new Uint8Array(Buffer.from(base64, 'base64'))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user