@kadoa/node-sdk 0.19.4-beta.1 → 0.19.4-beta.3

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/dist/index.mjs CHANGED
@@ -5967,6 +5967,7 @@ var Realtime = class {
5967
5967
  this.heartbeatInterval = config.heartbeatInterval || 1e4;
5968
5968
  this.reconnectDelay = config.reconnectDelay || 5e3;
5969
5969
  this.missedHeartbeatsLimit = config.missedHeartbeatsLimit || 3e4;
5970
+ this.source = config.source;
5970
5971
  }
5971
5972
  async connect() {
5972
5973
  if (this.isConnecting) return;
@@ -5991,7 +5992,8 @@ var Realtime = class {
5991
5992
  this.socket.send(
5992
5993
  JSON.stringify({
5993
5994
  action: "subscribe",
5994
- channel: team_id
5995
+ channel: team_id,
5996
+ ...this.source && { source: this.source }
5995
5997
  })
5996
5998
  );
5997
5999
  debug5("Connected to WebSocket");
@@ -6983,6 +6985,7 @@ var KadoaClient = class {
6983
6985
  };
6984
6986
  this.validation = createValidationDomain(coreService, rulesService);
6985
6987
  this.crawler = createCrawlerDomain(this);
6988
+ this._realtimeConfig = config.realtimeConfig;
6986
6989
  if (config.enableRealtime && config.realtimeConfig?.autoConnect !== false) {
6987
6990
  this.connectRealtime();
6988
6991
  }
@@ -7081,7 +7084,18 @@ var KadoaClient = class {
7081
7084
  */
7082
7085
  connectRealtime() {
7083
7086
  if (!this._realtime) {
7084
- this._realtime = new Realtime({ apiKey: this._apiKey });
7087
+ this._realtime = new Realtime({
7088
+ apiKey: this._apiKey,
7089
+ ...this._realtimeConfig?.reconnectDelay != null && {
7090
+ reconnectDelay: this._realtimeConfig.reconnectDelay
7091
+ },
7092
+ ...this._realtimeConfig?.heartbeatInterval != null && {
7093
+ heartbeatInterval: this._realtimeConfig.heartbeatInterval
7094
+ },
7095
+ ...this._realtimeConfig?.source && {
7096
+ source: this._realtimeConfig.source
7097
+ }
7098
+ });
7085
7099
  this._realtime.connect();
7086
7100
  }
7087
7101
  return this._realtime;