bare-rpc 0.1.3 → 0.1.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.
package/index.d.ts CHANGED
@@ -24,11 +24,11 @@ declare const constants: {
24
24
  }
25
25
 
26
26
  interface RPCIncomingRequest {
27
- rpc: RPC
28
- id: number
29
- command: string
30
- data: Buffer
31
- sent: boolean
27
+ readonly rpc: RPC
28
+ readonly id: number
29
+ readonly command: string
30
+ readonly data: Buffer
31
+ readonly sent: boolean
32
32
 
33
33
  reply(data: Buffer | string, encoding?: BufferEncoding): void
34
34
 
@@ -41,6 +41,11 @@ declare class RPCIncomingRequest {
41
41
  }
42
42
 
43
43
  interface RPCOutgoingRequest {
44
+ readonly rpc: RPC
45
+ readonly id: number
46
+ readonly command: string
47
+ readonly sent: boolean
48
+
44
49
  send(data: Buffer | string, encoding?: BufferEncoding): void
45
50
 
46
51
  reply(encoding?: BufferEncoding): Promise<Buffer>
package/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = class RPC {
30
30
  }
31
31
 
32
32
  request(command) {
33
- return new OutgoingRequest(++this._id, this, command)
33
+ return new OutgoingRequest(this, ++this._id, command)
34
34
  }
35
35
 
36
36
  _sendMessage(message) {
@@ -2,9 +2,9 @@ const b4a = require('b4a')
2
2
  const errors = require('./errors')
3
3
 
4
4
  module.exports = class RPCOutgoingRequest {
5
- constructor(id, rpc, command) {
6
- this.id = id
5
+ constructor(rpc, id, command) {
7
6
  this.rpc = rpc
7
+ this.id = id
8
8
  this.command = command
9
9
  this.sent = false
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-rpc",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "librpc ABI compatible RPC for Bare",
5
5
  "exports": {
6
6
  ".": {