relayx-js 1.0.7 → 1.0.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ V1.0.8
2
+ - History API fetch() to consume()
3
+
1
4
  V1.0.7
2
5
  - History API added
3
6
  - README updated to explain history API usage
@@ -61,7 +61,7 @@ async function run(){
61
61
  var endDate = new Date(past)
62
62
 
63
63
  var history = await realtime.history(topic, pastDate, endDate)
64
- console.log(history)
64
+ // console.log(history)
65
65
  })
66
66
  }else if(input == "off"){
67
67
  rl.question("topic to off(): ", async (topic) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayx-js",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "realtime/realtime.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -485,6 +485,8 @@ export class Realtime {
485
485
  end = end.toISOString();
486
486
  }
487
487
 
488
+ console.log(`END => ${end}`)
489
+
488
490
  await this.#createOrGetStream();
489
491
 
490
492
  var opts = {
@@ -501,9 +503,7 @@ export class Realtime {
501
503
 
502
504
  this.#consumerMap[topic] = consumer;
503
505
 
504
- const msgs = await consumer.fetch({
505
- expires: 10000
506
- });
506
+ const msgs = await consumer.consume();
507
507
 
508
508
  var history = [];
509
509
 
@@ -516,6 +516,8 @@ export class Realtime {
516
516
  }
517
517
  }
518
518
 
519
+ console.log(m.timestamp)
520
+
519
521
  var data = m.json();
520
522
  history.push(data.message);
521
523
  }