@pulsebeam/peer 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.cts CHANGED
@@ -114,9 +114,9 @@ declare class RecvReq$Type extends MessageType<RecvReq> {
114
114
  */
115
115
  interface RecvReq {
116
116
  /**
117
- * @generated from protobuf field: pulsebeam.v1.PeerInfo info = 1;
117
+ * @generated from protobuf field: pulsebeam.v1.PeerInfo src = 1;
118
118
  */
119
- info?: PeerInfo;
119
+ src?: PeerInfo;
120
120
  }
121
121
  /**
122
122
  * @generated MessageType for protobuf message pulsebeam.v1.RecvReq
@@ -146,13 +146,22 @@ declare class PeerInfo$Type extends MessageType<PeerInfo> {
146
146
  */
147
147
  interface PeerInfo {
148
148
  /**
149
- * @generated from protobuf field: uint32 conn_id = 1;
149
+ * @generated from protobuf field: string group_id = 1;
150
150
  */
151
- connId: number;
151
+ groupId: string;
152
+ /**
153
+ * where this message is originated from. Special values: "SYSTEM"
154
+ *
155
+ * @generated from protobuf field: string peer_id = 2;
156
+ */
157
+ peerId: string;
152
158
  /**
153
- * @generated from protobuf field: bool enable_discovery = 2;
159
+ * used for deciding polite vs impolite. higher id wins. It also is used to detect connection breakages
160
+ * WARNING, reserved values: 0-16
161
+ *
162
+ * @generated from protobuf field: uint32 conn_id = 3;
154
163
  */
155
- enableDiscovery: boolean;
164
+ connId: number;
156
165
  }
157
166
  /**
158
167
  * @generated MessageType for protobuf message pulsebeam.v1.PeerInfo
@@ -235,29 +244,13 @@ declare class MessageHeader$Type extends MessageType<MessageHeader> {
235
244
  */
236
245
  interface MessageHeader {
237
246
  /**
238
- * @generated from protobuf field: string group_id = 1;
247
+ * @generated from protobuf field: pulsebeam.v1.PeerInfo src = 1;
239
248
  */
240
- groupId: string;
249
+ src?: PeerInfo;
241
250
  /**
242
- * @generated from protobuf field: string peer_id = 2;
251
+ * @generated from protobuf field: pulsebeam.v1.PeerInfo dst = 2;
243
252
  */
244
- peerId: string;
245
- /**
246
- * @generated from protobuf field: uint32 conn_id = 3;
247
- */
248
- connId: number;
249
- /**
250
- * @generated from protobuf field: string other_group_id = 4;
251
- */
252
- otherGroupId: string;
253
- /**
254
- * @generated from protobuf field: string other_peer_id = 5;
255
- */
256
- otherPeerId: string;
257
- /**
258
- * @generated from protobuf field: uint32 other_conn_id = 6;
259
- */
260
- otherConnId: number;
253
+ dst?: PeerInfo;
261
254
  /**
262
255
  * @generated from protobuf field: uint32 seqnum = 7;
263
256
  */
@@ -520,18 +513,10 @@ interface ISession {
520
513
  close(reason?: string): void;
521
514
  /**
522
515
  * Retrieves the identifier of the other peer in the connection.
523
- * @returns {string} The peer ID of the connected peer. Valid UTF-8 string of 1-16 characters.
524
- * @example ```console.log(`Connected to peer: ${session.otherPeerId()}`);```
525
- */
526
- get otherPeerId(): string;
527
- /**
528
- * Retrieves the connection identifier for the current connection.
529
- * Connection IDs are typically unique and help identify connections.
530
- * @returns {number} The connection ID for the peer connection.
531
- * @example
532
- * ```console.log(`Connection ID: ${mySession.otherConnId()}`);```
516
+ * @returns {PeerInfo} The peer identity of the connected peer. Valid UTF-8 string of 1-16 characters.
517
+ * @example ```console.log(`Connected to peer: ${session.other.peerId()}`);```
533
518
  */
534
- get otherConnId(): number;
519
+ get other(): PeerInfo;
535
520
  }
536
521
  /**
537
522
  * Intended to be used by for internal and advanced usecases.
@@ -674,4 +659,4 @@ declare class Peer {
674
659
  */
675
660
  declare function createPeer(opts: PeerOptions): Promise<Peer>;
676
661
 
677
- export { type ISession, Peer, type PeerOptions, type PeerOptionsFull, type PeerState, createPeer };
662
+ export { type ISession, Peer, PeerInfo, type PeerOptions, type PeerOptionsFull, type PeerState, createPeer };
package/dist/index.d.ts CHANGED
@@ -114,9 +114,9 @@ declare class RecvReq$Type extends MessageType<RecvReq> {
114
114
  */
115
115
  interface RecvReq {
116
116
  /**
117
- * @generated from protobuf field: pulsebeam.v1.PeerInfo info = 1;
117
+ * @generated from protobuf field: pulsebeam.v1.PeerInfo src = 1;
118
118
  */
119
- info?: PeerInfo;
119
+ src?: PeerInfo;
120
120
  }
121
121
  /**
122
122
  * @generated MessageType for protobuf message pulsebeam.v1.RecvReq
@@ -146,13 +146,22 @@ declare class PeerInfo$Type extends MessageType<PeerInfo> {
146
146
  */
147
147
  interface PeerInfo {
148
148
  /**
149
- * @generated from protobuf field: uint32 conn_id = 1;
149
+ * @generated from protobuf field: string group_id = 1;
150
150
  */
151
- connId: number;
151
+ groupId: string;
152
+ /**
153
+ * where this message is originated from. Special values: "SYSTEM"
154
+ *
155
+ * @generated from protobuf field: string peer_id = 2;
156
+ */
157
+ peerId: string;
152
158
  /**
153
- * @generated from protobuf field: bool enable_discovery = 2;
159
+ * used for deciding polite vs impolite. higher id wins. It also is used to detect connection breakages
160
+ * WARNING, reserved values: 0-16
161
+ *
162
+ * @generated from protobuf field: uint32 conn_id = 3;
154
163
  */
155
- enableDiscovery: boolean;
164
+ connId: number;
156
165
  }
157
166
  /**
158
167
  * @generated MessageType for protobuf message pulsebeam.v1.PeerInfo
@@ -235,29 +244,13 @@ declare class MessageHeader$Type extends MessageType<MessageHeader> {
235
244
  */
236
245
  interface MessageHeader {
237
246
  /**
238
- * @generated from protobuf field: string group_id = 1;
247
+ * @generated from protobuf field: pulsebeam.v1.PeerInfo src = 1;
239
248
  */
240
- groupId: string;
249
+ src?: PeerInfo;
241
250
  /**
242
- * @generated from protobuf field: string peer_id = 2;
251
+ * @generated from protobuf field: pulsebeam.v1.PeerInfo dst = 2;
243
252
  */
244
- peerId: string;
245
- /**
246
- * @generated from protobuf field: uint32 conn_id = 3;
247
- */
248
- connId: number;
249
- /**
250
- * @generated from protobuf field: string other_group_id = 4;
251
- */
252
- otherGroupId: string;
253
- /**
254
- * @generated from protobuf field: string other_peer_id = 5;
255
- */
256
- otherPeerId: string;
257
- /**
258
- * @generated from protobuf field: uint32 other_conn_id = 6;
259
- */
260
- otherConnId: number;
253
+ dst?: PeerInfo;
261
254
  /**
262
255
  * @generated from protobuf field: uint32 seqnum = 7;
263
256
  */
@@ -520,18 +513,10 @@ interface ISession {
520
513
  close(reason?: string): void;
521
514
  /**
522
515
  * Retrieves the identifier of the other peer in the connection.
523
- * @returns {string} The peer ID of the connected peer. Valid UTF-8 string of 1-16 characters.
524
- * @example ```console.log(`Connected to peer: ${session.otherPeerId()}`);```
525
- */
526
- get otherPeerId(): string;
527
- /**
528
- * Retrieves the connection identifier for the current connection.
529
- * Connection IDs are typically unique and help identify connections.
530
- * @returns {number} The connection ID for the peer connection.
531
- * @example
532
- * ```console.log(`Connection ID: ${mySession.otherConnId()}`);```
516
+ * @returns {PeerInfo} The peer identity of the connected peer. Valid UTF-8 string of 1-16 characters.
517
+ * @example ```console.log(`Connected to peer: ${session.other.peerId()}`);```
533
518
  */
534
- get otherConnId(): number;
519
+ get other(): PeerInfo;
535
520
  }
536
521
  /**
537
522
  * Intended to be used by for internal and advanced usecases.
@@ -674,4 +659,4 @@ declare class Peer {
674
659
  */
675
660
  declare function createPeer(opts: PeerOptions): Promise<Peer>;
676
661
 
677
- export { type ISession, Peer, type PeerOptions, type PeerOptionsFull, type PeerState, createPeer };
662
+ export { type ISession, Peer, PeerInfo, type PeerOptions, type PeerOptionsFull, type PeerState, createPeer };