@openfeed/sdk-js 1.6.8 → 1.6.10

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.
@@ -1 +1 @@
1
- export declare const version = "1.6.8";
1
+ export declare const version = "1.6.10";
package/dist/index.js CHANGED
@@ -39,19 +39,19 @@ function varint64read() {
39
39
  }
40
40
  throw new Error("invalid varint");
41
41
  }
42
- function varint64write(lo, hi, bytes) {
42
+ function varint64write(lo, hi, bytes2) {
43
43
  for (let i = 0; i < 28; i = i + 7) {
44
44
  const shift = lo >>> i;
45
45
  const hasNext = !(shift >>> 7 == 0 && hi == 0);
46
46
  const byte = (hasNext ? shift | 128 : shift) & 255;
47
- bytes.push(byte);
47
+ bytes2.push(byte);
48
48
  if (!hasNext) {
49
49
  return;
50
50
  }
51
51
  }
52
52
  const splitBits = lo >>> 28 & 15 | (hi & 7) << 4;
53
53
  const hasMoreBits = !(hi >> 3 == 0);
54
- bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255);
54
+ bytes2.push((hasMoreBits ? splitBits | 128 : splitBits) & 255);
55
55
  if (!hasMoreBits) {
56
56
  return;
57
57
  }
@@ -59,12 +59,12 @@ function varint64write(lo, hi, bytes) {
59
59
  const shift = hi >>> i;
60
60
  const hasNext = !(shift >>> 7 == 0);
61
61
  const byte = (hasNext ? shift | 128 : shift) & 255;
62
- bytes.push(byte);
62
+ bytes2.push(byte);
63
63
  if (!hasNext) {
64
64
  return;
65
65
  }
66
66
  }
67
- bytes.push(hi >>> 31 & 1);
67
+ bytes2.push(hi >>> 31 & 1);
68
68
  }
69
69
  const TWO_PWR_32_DBL$1 = 4294967296;
70
70
  function int64FromString(dec) {
@@ -140,19 +140,19 @@ const decimalFrom1e7WithLeadingZeros = (digit1e7) => {
140
140
  const partial = String(digit1e7);
141
141
  return "0000000".slice(partial.length) + partial;
142
142
  };
143
- function varint32write(value, bytes) {
143
+ function varint32write(value, bytes2) {
144
144
  if (value >= 0) {
145
145
  while (value > 127) {
146
- bytes.push(value & 127 | 128);
146
+ bytes2.push(value & 127 | 128);
147
147
  value = value >>> 7;
148
148
  }
149
- bytes.push(value);
149
+ bytes2.push(value);
150
150
  } else {
151
151
  for (let i = 0; i < 9; i++) {
152
- bytes.push(value & 127 | 128);
152
+ bytes2.push(value & 127 | 128);
153
153
  value = value >> 7;
154
154
  }
155
- bytes.push(1);
155
+ bytes2.push(1);
156
156
  }
157
157
  }
158
158
  function varint32read() {
@@ -299,8 +299,8 @@ function getTextEncoding() {
299
299
  encodeUtf8(text) {
300
300
  return te.encode(text);
301
301
  },
302
- decodeUtf8(bytes) {
303
- return td.decode(bytes);
302
+ decodeUtf8(bytes2) {
303
+ return td.decode(bytes2);
304
304
  },
305
305
  checkUtf8(text) {
306
306
  try {
@@ -346,14 +346,14 @@ class BinaryWriter {
346
346
  let len = 0;
347
347
  for (let i = 0; i < this.chunks.length; i++)
348
348
  len += this.chunks[i].length;
349
- let bytes = new Uint8Array(len);
349
+ let bytes2 = new Uint8Array(len);
350
350
  let offset = 0;
351
351
  for (let i = 0; i < this.chunks.length; i++) {
352
- bytes.set(this.chunks[i], offset);
352
+ bytes2.set(this.chunks[i], offset);
353
353
  offset += this.chunks[i].length;
354
354
  }
355
355
  this.chunks = [];
356
- return bytes;
356
+ return bytes2;
357
357
  }
358
358
  /**
359
359
  * Start a new fork for length-delimited data like a message
@@ -1608,20 +1608,20 @@ LongPrototype.toBytesBE = function toBytesBE() {
1608
1608
  lo & 255
1609
1609
  ];
1610
1610
  };
1611
- Long.fromBytes = function fromBytes(bytes, unsigned, le) {
1612
- return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);
1611
+ Long.fromBytes = function fromBytes(bytes2, unsigned, le) {
1612
+ return le ? Long.fromBytesLE(bytes2, unsigned) : Long.fromBytesBE(bytes2, unsigned);
1613
1613
  };
1614
- Long.fromBytesLE = function fromBytesLE(bytes, unsigned) {
1614
+ Long.fromBytesLE = function fromBytesLE(bytes2, unsigned) {
1615
1615
  return new Long(
1616
- bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24,
1617
- bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24,
1616
+ bytes2[0] | bytes2[1] << 8 | bytes2[2] << 16 | bytes2[3] << 24,
1617
+ bytes2[4] | bytes2[5] << 8 | bytes2[6] << 16 | bytes2[7] << 24,
1618
1618
  unsigned
1619
1619
  );
1620
1620
  };
1621
- Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
1621
+ Long.fromBytesBE = function fromBytesBE(bytes2, unsigned) {
1622
1622
  return new Long(
1623
- bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7],
1624
- bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3],
1623
+ bytes2[4] << 24 | bytes2[5] << 16 | bytes2[6] << 8 | bytes2[7],
1624
+ bytes2[0] << 24 | bytes2[1] << 16 | bytes2[2] << 8 | bytes2[3],
1625
1625
  unsigned
1626
1626
  );
1627
1627
  };
@@ -11496,23 +11496,33 @@ const toT = (obj) => obj;
11496
11496
  function encodeMessage(message) {
11497
11497
  return OpenfeedGatewayRequestEncode.encode(message).finish();
11498
11498
  }
11499
- function decodeRequestMessage(bytes) {
11500
- return OpenfeedGatewayRequestDecode.decode(bytes);
11499
+ function decodeRequestMessage(bytes2) {
11500
+ return OpenfeedGatewayRequestDecode.decode(bytes2);
11501
11501
  }
11502
+ const bytes = new Uint8Array(2);
11503
+ bytes[0] = 0;
11504
+ bytes[1] = 0;
11502
11505
  function encodeResponseMessage(message) {
11503
- return OpenfeedGatewayMessageEncode.encode(message).finish();
11506
+ const bw = new BinaryWriter();
11507
+ bw.raw(bytes);
11508
+ OpenfeedGatewayMessageEncode.encode(message, bw);
11509
+ const ret = bw.finish();
11510
+ const len = ret.length - 2;
11511
+ ret[0] = len >> 8;
11512
+ ret[1] = len & 255;
11513
+ return ret;
11504
11514
  }
11505
11515
  function send(socket, message) {
11506
11516
  socket.send(encodeMessage(toT(message)));
11507
11517
  }
11508
11518
  const getShort = (a, b) => a << 8 | b << 0;
11509
- function* decodeMessages(bytes) {
11519
+ function* decodeMessages(bytes2) {
11510
11520
  let currentIndex = 0;
11511
- while (currentIndex < bytes.length) {
11512
- const len = getShort(bytes[currentIndex], bytes[currentIndex + 1]);
11521
+ while (currentIndex < bytes2.length) {
11522
+ const len = getShort(bytes2[currentIndex], bytes2[currentIndex + 1]);
11513
11523
  if (len === 0) break;
11514
11524
  const total = len + 2;
11515
- const currentArray = bytes.subarray(currentIndex + 2, currentIndex + total);
11525
+ const currentArray = bytes2.subarray(currentIndex + 2, currentIndex + total);
11516
11526
  currentIndex += total;
11517
11527
  yield OpenfeedGatewayMessageDecode.decode(currentArray);
11518
11528
  }
@@ -11838,7 +11848,7 @@ class OpenFeedConnection {
11838
11848
  whenDisconnected = () => this.whenDisconnectedSource.whenCompleted;
11839
11849
  dispose = () => this.disconnect(new ConnectionDisposedError("Disposed"));
11840
11850
  }
11841
- const version = "1.6.8";
11851
+ const version = "1.6.10";
11842
11852
  const getClientVersion = async (clientId) => {
11843
11853
  let platformDescription;
11844
11854
  if (typeof window !== "undefined") {
package/dist/node.js CHANGED
@@ -3702,19 +3702,19 @@ function varint64read() {
3702
3702
  }
3703
3703
  throw new Error("invalid varint");
3704
3704
  }
3705
- function varint64write(lo, hi, bytes) {
3705
+ function varint64write(lo, hi, bytes2) {
3706
3706
  for (let i = 0; i < 28; i = i + 7) {
3707
3707
  const shift = lo >>> i;
3708
3708
  const hasNext = !(shift >>> 7 == 0 && hi == 0);
3709
3709
  const byte = (hasNext ? shift | 128 : shift) & 255;
3710
- bytes.push(byte);
3710
+ bytes2.push(byte);
3711
3711
  if (!hasNext) {
3712
3712
  return;
3713
3713
  }
3714
3714
  }
3715
3715
  const splitBits = lo >>> 28 & 15 | (hi & 7) << 4;
3716
3716
  const hasMoreBits = !(hi >> 3 == 0);
3717
- bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255);
3717
+ bytes2.push((hasMoreBits ? splitBits | 128 : splitBits) & 255);
3718
3718
  if (!hasMoreBits) {
3719
3719
  return;
3720
3720
  }
@@ -3722,12 +3722,12 @@ function varint64write(lo, hi, bytes) {
3722
3722
  const shift = hi >>> i;
3723
3723
  const hasNext = !(shift >>> 7 == 0);
3724
3724
  const byte = (hasNext ? shift | 128 : shift) & 255;
3725
- bytes.push(byte);
3725
+ bytes2.push(byte);
3726
3726
  if (!hasNext) {
3727
3727
  return;
3728
3728
  }
3729
3729
  }
3730
- bytes.push(hi >>> 31 & 1);
3730
+ bytes2.push(hi >>> 31 & 1);
3731
3731
  }
3732
3732
  var TWO_PWR_32_DBL = 4294967296;
3733
3733
  function int64FromString(dec) {
@@ -3803,19 +3803,19 @@ var decimalFrom1e7WithLeadingZeros = (digit1e7) => {
3803
3803
  const partial = String(digit1e7);
3804
3804
  return "0000000".slice(partial.length) + partial;
3805
3805
  };
3806
- function varint32write(value, bytes) {
3806
+ function varint32write(value, bytes2) {
3807
3807
  if (value >= 0) {
3808
3808
  while (value > 127) {
3809
- bytes.push(value & 127 | 128);
3809
+ bytes2.push(value & 127 | 128);
3810
3810
  value = value >>> 7;
3811
3811
  }
3812
- bytes.push(value);
3812
+ bytes2.push(value);
3813
3813
  } else {
3814
3814
  for (let i = 0; i < 9; i++) {
3815
- bytes.push(value & 127 | 128);
3815
+ bytes2.push(value & 127 | 128);
3816
3816
  value = value >> 7;
3817
3817
  }
3818
- bytes.push(1);
3818
+ bytes2.push(1);
3819
3819
  }
3820
3820
  }
3821
3821
  function varint32read() {
@@ -3966,8 +3966,8 @@ function getTextEncoding() {
3966
3966
  encodeUtf8(text) {
3967
3967
  return te.encode(text);
3968
3968
  },
3969
- decodeUtf8(bytes) {
3970
- return td.decode(bytes);
3969
+ decodeUtf8(bytes2) {
3970
+ return td.decode(bytes2);
3971
3971
  },
3972
3972
  checkUtf8(text) {
3973
3973
  try {
@@ -4015,14 +4015,14 @@ var BinaryWriter = class {
4015
4015
  let len = 0;
4016
4016
  for (let i = 0; i < this.chunks.length; i++)
4017
4017
  len += this.chunks[i].length;
4018
- let bytes = new Uint8Array(len);
4018
+ let bytes2 = new Uint8Array(len);
4019
4019
  let offset = 0;
4020
4020
  for (let i = 0; i < this.chunks.length; i++) {
4021
- bytes.set(this.chunks[i], offset);
4021
+ bytes2.set(this.chunks[i], offset);
4022
4022
  offset += this.chunks[i].length;
4023
4023
  }
4024
4024
  this.chunks = [];
4025
- return bytes;
4025
+ return bytes2;
4026
4026
  }
4027
4027
  /**
4028
4028
  * Start a new fork for length-delimited data like a message
@@ -5279,20 +5279,20 @@ LongPrototype.toBytesBE = function toBytesBE() {
5279
5279
  lo & 255
5280
5280
  ];
5281
5281
  };
5282
- Long.fromBytes = function fromBytes(bytes, unsigned, le) {
5283
- return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);
5282
+ Long.fromBytes = function fromBytes(bytes2, unsigned, le) {
5283
+ return le ? Long.fromBytesLE(bytes2, unsigned) : Long.fromBytesBE(bytes2, unsigned);
5284
5284
  };
5285
- Long.fromBytesLE = function fromBytesLE(bytes, unsigned) {
5285
+ Long.fromBytesLE = function fromBytesLE(bytes2, unsigned) {
5286
5286
  return new Long(
5287
- bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24,
5288
- bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24,
5287
+ bytes2[0] | bytes2[1] << 8 | bytes2[2] << 16 | bytes2[3] << 24,
5288
+ bytes2[4] | bytes2[5] << 8 | bytes2[6] << 16 | bytes2[7] << 24,
5289
5289
  unsigned
5290
5290
  );
5291
5291
  };
5292
- Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
5292
+ Long.fromBytesBE = function fromBytesBE(bytes2, unsigned) {
5293
5293
  return new Long(
5294
- bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7],
5295
- bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3],
5294
+ bytes2[4] << 24 | bytes2[5] << 16 | bytes2[6] << 8 | bytes2[7],
5295
+ bytes2[0] << 24 | bytes2[1] << 16 | bytes2[2] << 8 | bytes2[3],
5296
5296
  unsigned
5297
5297
  );
5298
5298
  };
@@ -15276,23 +15276,33 @@ var toT = (obj) => obj;
15276
15276
  function encodeMessage(message) {
15277
15277
  return OpenfeedGatewayRequestEncode.encode(message).finish();
15278
15278
  }
15279
- function decodeRequestMessage(bytes) {
15280
- return OpenfeedGatewayRequestDecode.decode(bytes);
15279
+ function decodeRequestMessage(bytes2) {
15280
+ return OpenfeedGatewayRequestDecode.decode(bytes2);
15281
15281
  }
15282
+ var bytes = new Uint8Array(2);
15283
+ bytes[0] = 0;
15284
+ bytes[1] = 0;
15282
15285
  function encodeResponseMessage(message) {
15283
- return OpenfeedGatewayMessageEncode.encode(message).finish();
15286
+ const bw = new BinaryWriter();
15287
+ bw.raw(bytes);
15288
+ OpenfeedGatewayMessageEncode.encode(message, bw);
15289
+ const ret = bw.finish();
15290
+ const len = ret.length - 2;
15291
+ ret[0] = len >> 8;
15292
+ ret[1] = len & 255;
15293
+ return ret;
15284
15294
  }
15285
15295
  function send(socket, message) {
15286
15296
  socket.send(encodeMessage(toT(message)));
15287
15297
  }
15288
15298
  var getShort = (a, b) => a << 8 | b << 0;
15289
- function* decodeMessages(bytes) {
15299
+ function* decodeMessages(bytes2) {
15290
15300
  let currentIndex = 0;
15291
- while (currentIndex < bytes.length) {
15292
- const len = getShort(bytes[currentIndex], bytes[currentIndex + 1]);
15301
+ while (currentIndex < bytes2.length) {
15302
+ const len = getShort(bytes2[currentIndex], bytes2[currentIndex + 1]);
15293
15303
  if (len === 0) break;
15294
15304
  const total = len + 2;
15295
- const currentArray = bytes.subarray(currentIndex + 2, currentIndex + total);
15305
+ const currentArray = bytes2.subarray(currentIndex + 2, currentIndex + total);
15296
15306
  currentIndex += total;
15297
15307
  yield OpenfeedGatewayMessageDecode.decode(currentArray);
15298
15308
  }
@@ -15633,7 +15643,7 @@ var OpenFeedConnection = class {
15633
15643
  };
15634
15644
 
15635
15645
  // generated/version.ts
15636
- var version = "1.6.8";
15646
+ var version = "1.6.10";
15637
15647
 
15638
15648
  // src/utilities/client_version.ts
15639
15649
  var getClientVersion = async (clientId) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfeed/sdk-js",
3
- "version": "1.6.8",
3
+ "version": "1.6.10",
4
4
  "description": "JavaScript SDK for Barchart OpenFeed",
5
5
  "main": "dist/node.js",
6
6
  "browser": "dist/index.js",