@data-fair/lib-node 2.8.0 → 2.8.1

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/events-queue.d.ts CHANGED
@@ -4,6 +4,7 @@ import { SessionState } from '@data-fair/lib-common-types/session/index.js';
4
4
  type EventsQueueOptions = {
5
5
  eventsUrl: string;
6
6
  eventsSecret: string;
7
+ inactive?: boolean;
7
8
  };
8
9
  export declare class EventsQueue {
9
10
  _options: EventsQueueOptions | undefined;
package/events-queue.js CHANGED
@@ -66,7 +66,8 @@ export class EventsQueue {
66
66
  }
67
67
 
68
68
  pushEvent (event, sessionState) {
69
- this.options()
69
+ const options = this.options()
70
+ if (options.inactive) { return }
70
71
  if (this.stopped) { throw new Error('events queue has been stopped') }
71
72
  event.date = new Date().toISOString()
72
73
  debug('pushEvent', event)
@@ -97,7 +98,8 @@ export class EventsQueue {
97
98
  }
98
99
 
99
100
  pushNotification (notification) {
100
- this.options()
101
+ const options = this.options()
102
+ if (options.inactive) { return }
101
103
  if (this.stopped) { throw new Error('notifications queue has been stopped') }
102
104
  notification.date = new Date().toISOString()
103
105
  debug('pushNotification', notification)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-node",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Small nodejs related utility functions for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [