@c8y/client 1018.0.152 → 1018.0.159

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/NOTICES CHANGED
@@ -2342,7 +2342,7 @@ SOFTWARE
2342
2342
 
2343
2343
  -----
2344
2344
 
2345
- The following software may be included in this product: @types/babel__core, @types/babel__generator, @types/babel__template, @types/babel__traverse, @types/body-parser, @types/bonjour, @types/connect, @types/connect-history-api-fallback, @types/cron, @types/eslint, @types/eslint-scope, @types/estree, @types/express, @types/express-serve-static-core, @types/file-saver, @types/fs-extra, @types/geojson, @types/graceful-fs, @types/html-minifier-terser, @types/http-proxy, @types/istanbul-lib-coverage, @types/istanbul-reports, @types/jest, @types/jsdom, @types/json-schema, @types/jsonfile, @types/leaflet, @types/marked, @types/mime, @types/node, @types/parse5, @types/prettier, @types/qs, @types/range-parser, @types/resolve, @types/semver, @types/serve-index, @types/serve-static, @types/sinonjs__fake-timers, @types/sizzle, @types/sockjs, @types/stack-utils, @types/three, @types/tough-cookie, @types/webpack, @types/webpack-dev-server, @types/webxr, @types/ws, @types/yargs, @types/yargs-parser, @types/yauzl. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__generator), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__template), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__traverse), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/body-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bonjour), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/connect), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/connect-history-api-fallback), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cron), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/eslint), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/eslint-scope), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/estree), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express-serve-static-core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/file-saver), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/fs-extra), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/geojson), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/graceful-fs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/html-minifier-terser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/http-proxy), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-lib-coverage), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-reports), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jsdom), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/json-schema), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jsonfile), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/leaflet), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/marked), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mime), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/parse5), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prettier), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/qs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/range-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/resolve), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/semver), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/serve-index), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/serve-static), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/sinonjs__fake-timers), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/sizzle), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/sockjs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/stack-utils), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/three), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tough-cookie), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webpack), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webxr), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ws), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yauzl). This software contains the following license and notice below:
2345
+ The following software may be included in this product: @types/babel__core, @types/babel__generator, @types/babel__template, @types/babel__traverse, @types/body-parser, @types/bonjour, @types/cometd, @types/connect, @types/connect-history-api-fallback, @types/cron, @types/eslint, @types/eslint-scope, @types/estree, @types/express, @types/express-serve-static-core, @types/file-saver, @types/fs-extra, @types/geojson, @types/graceful-fs, @types/html-minifier-terser, @types/http-proxy, @types/istanbul-lib-coverage, @types/istanbul-reports, @types/jest, @types/jsdom, @types/json-schema, @types/jsonfile, @types/leaflet, @types/marked, @types/mime, @types/node, @types/parse5, @types/prettier, @types/qs, @types/range-parser, @types/resolve, @types/semver, @types/serve-index, @types/serve-static, @types/sinonjs__fake-timers, @types/sizzle, @types/sockjs, @types/stack-utils, @types/three, @types/tough-cookie, @types/webpack, @types/webpack-dev-server, @types/webxr, @types/ws, @types/yargs, @types/yargs-parser, @types/yauzl. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__generator), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__template), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__traverse), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/body-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bonjour), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cometd), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/connect), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/connect-history-api-fallback), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cron), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/eslint), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/eslint-scope), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/estree), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express-serve-static-core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/file-saver), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/fs-extra), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/geojson), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/graceful-fs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/html-minifier-terser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/http-proxy), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-lib-coverage), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-reports), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jsdom), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/json-schema), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jsonfile), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/leaflet), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/marked), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mime), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/parse5), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prettier), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/qs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/range-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/resolve), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/semver), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/serve-index), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/serve-static), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/sinonjs__fake-timers), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/sizzle), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/sockjs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/stack-utils), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/three), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tough-cookie), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webpack), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webxr), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ws), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yauzl). This software contains the following license and notice below:
2346
2346
 
2347
2347
  MIT License
2348
2348
 
@@ -3452,12 +3452,13 @@
3452
3452
  constructor(client, url = '/notification/realtime', handshakeCallback) {
3453
3453
  this.client = client;
3454
3454
  this.url = url;
3455
- this.cometd = new browser_1();
3456
3455
  this.metaHandshake = msg => {
3457
3456
  if (!msg.successful) {
3458
3457
  throw new Error('Handshake failed');
3459
3458
  }
3460
3459
  };
3460
+ this.cometd = new browser_1({});
3461
+ // does not actually seem to be needed/supported? Just keeping to satisfy unit test snapshots
3461
3462
  this.cometd.websocketEnabled = true;
3462
3463
  this.cometd.addListener(MetaChannel.HANDSHAKE, handshakeCallback || this.metaHandshake);
3463
3464
  }
@@ -3477,11 +3478,41 @@
3477
3478
  unsubscribe(subscription) {
3478
3479
  return this.cometd.unsubscribe(subscription);
3479
3480
  }
3481
+ /**
3482
+ * Allows to listen to Cometd handshake to find out if e.g. the connection was reestablished.
3483
+ */
3484
+ addHandshakeListener(callback) {
3485
+ return this.cometd.addListener(MetaChannel.HANDSHAKE, callback);
3486
+ }
3487
+ /**
3488
+ * Allows to listen to Cometd connection to e.g. detect when connection was lost.
3489
+ */
3490
+ addConnectListener(callback) {
3491
+ return this.cometd.addListener(MetaChannel.CONNECT, callback);
3492
+ }
3493
+ /**
3494
+ * Removes the subscription obtained with a call to `addHandshakeListener` or `addConnectListener`.
3495
+ */
3496
+ removeListener(subscriptionHandle) {
3497
+ return this.cometd.removeListener(subscriptionHandle);
3498
+ }
3499
+ /**
3500
+ * Resubscribes as necessary in case of a re-handshake.
3501
+ */
3502
+ resubscribe(subscriptionHandle) {
3503
+ return this.cometd.resubscribe(subscriptionHandle);
3504
+ }
3480
3505
  /**
3481
3506
  * Disconnects the current connection.
3482
3507
  */
3483
- disconnect() {
3484
- this.cometd.disconnect();
3508
+ disconnect(disconnectCallback = undefined) {
3509
+ this.cometd.disconnect(disconnectCallback);
3510
+ }
3511
+ /**
3512
+ * Returns true if the CometD instance is disconnected or disconnecting.
3513
+ */
3514
+ isDisconnected() {
3515
+ return this.cometd.isDisconnected();
3485
3516
  }
3486
3517
  checkConnection() {
3487
3518
  const { cometd, client, url } = this;
@@ -3496,7 +3527,7 @@
3496
3527
  }
3497
3528
  }
3498
3529
  handshake(config) {
3499
- this.cometd.handshake(config);
3530
+ this.cometd.handshake(config, undefined);
3500
3531
  }
3501
3532
  }
3502
3533