@bringg/dashboard-sdk 9.62.0 → 9.62.1-pre.0

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.
@@ -3,6 +3,8 @@ import Session from '../Services/Identity/Session';
3
3
  export default class GeocodingApi {
4
4
  private geocodingEntity;
5
5
  private realTime;
6
+ private persistentConnection;
7
+ private eventHandlers;
6
8
  constructor(session: Session);
7
9
  autoComplete(address: string): Promise<AutoCompleteResponse>;
8
10
  getPlaceDetails(placeId: string): Promise<GetPlaceDetailsResponse>;
@@ -4,12 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var StoreEntity_1 = require("../Core/StoreEntity");
7
+ var PubSubEvents_1 = require("../Services/PubSubEvents");
7
8
  var Geocoding_1 = __importDefault(require("./Entity/Geocoding"));
8
9
  var Geocoding_consts_1 = require("./Geocoding.consts");
9
10
  var GeocodingApi = /** @class */ (function () {
10
11
  function GeocodingApi(session) {
12
+ this.eventHandlers = new Set();
11
13
  this.geocodingEntity = new Geocoding_1.default(session);
12
14
  this.realTime = new StoreEntity_1.RealTimeHandler(session.persistentConnection);
15
+ this.persistentConnection = session.persistentConnection;
13
16
  }
14
17
  GeocodingApi.prototype.autoComplete = function (address) {
15
18
  return this.geocodingEntity.autoComplete(address);
@@ -21,10 +24,16 @@ var GeocodingApi = /** @class */ (function () {
21
24
  return this.geocodingEntity.reverseGeocode(lat, lng);
22
25
  };
23
26
  GeocodingApi.prototype.subscribeToEvent = function (eventHandle) {
24
- return this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
27
+ this.eventHandlers.add(eventHandle);
28
+ this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
25
29
  };
26
30
  GeocodingApi.prototype.unsubscribeToEvent = function (eventHandle) {
27
- this.realTime.off(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
31
+ var _this = this;
32
+ this.eventHandlers.delete(eventHandle);
33
+ this.persistentConnection.unsubscribe(new PubSubEvents_1.PubSubEvent(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED));
34
+ this.eventHandlers.forEach(function (handler) {
35
+ _this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, handler);
36
+ });
28
37
  };
29
38
  return GeocodingApi;
30
39
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"GeocodingApi.js","sourceRoot":"","sources":["../../src/Geocoding/GeocodingApi.ts"],"names":[],"mappings":";;;;;AAEA,mDAAsD;AAEtD,iEAA2C;AAC3C,uDAA6D;AAE7D;IAIC,sBAAY,OAAgB;QAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,mBAAS,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,6BAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnE,CAAC;IAEM,mCAAY,GAAnB,UAAoB,OAAe;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAEM,sCAAe,GAAtB,UAAuB,OAAe;QACrC,OAAO,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAEM,qCAAc,GAArB,UAAsB,GAAW,EAAE,GAAW;QAC7C,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;IAEM,uCAAgB,GAAvB,UAAwB,WAAgB;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,0CAAuB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IACjF,CAAC;IAEM,yCAAkB,GAAzB,UAA0B,WAAgB;QACzC,IAAI,CAAC,QAAQ,CAAC,GAAG,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AI,CAAC,oBAAoB,CAAC,WAAW,CAAC,IAAI,0BAAW,CAAC,0CAAuB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAElG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAA,OAAO;YACjC,KAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,0CAAuB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACJ,CAAC;IACF,mBAAC;AAAD,CAAC,AArCD,IAqCC"}
@@ -56,7 +56,7 @@ var lodash_1 = require("lodash");
56
56
  var BringgException_1 = require("../Core/BringgException");
57
57
  var Logger_1 = __importDefault(require("../Core/Logger"));
58
58
  var abort_1 = require("../utils/abort");
59
- var version = '9.62.0';
59
+ var version = '9.62.1-pre.0';
60
60
  function logErrorResponse(response) {
61
61
  var data = response.data, status = response.status;
62
62
  try {
@@ -11217,12 +11217,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11217
11217
  };
11218
11218
  Object.defineProperty(exports, "__esModule", ({ value: true }));
11219
11219
  var StoreEntity_1 = __webpack_require__(95574);
11220
+ var PubSubEvents_1 = __webpack_require__(74102);
11220
11221
  var Geocoding_1 = __importDefault(__webpack_require__(84431));
11221
11222
  var Geocoding_consts_1 = __webpack_require__(29091);
11222
11223
  var GeocodingApi = /** @class */ (function () {
11223
11224
  function GeocodingApi(session) {
11225
+ this.eventHandlers = new Set();
11224
11226
  this.geocodingEntity = new Geocoding_1.default(session);
11225
11227
  this.realTime = new StoreEntity_1.RealTimeHandler(session.persistentConnection);
11228
+ this.persistentConnection = session.persistentConnection;
11226
11229
  }
11227
11230
  GeocodingApi.prototype.autoComplete = function (address) {
11228
11231
  return this.geocodingEntity.autoComplete(address);
@@ -11234,10 +11237,16 @@ var GeocodingApi = /** @class */ (function () {
11234
11237
  return this.geocodingEntity.reverseGeocode(lat, lng);
11235
11238
  };
11236
11239
  GeocodingApi.prototype.subscribeToEvent = function (eventHandle) {
11237
- return this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
11240
+ this.eventHandlers.add(eventHandle);
11241
+ this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
11238
11242
  };
11239
11243
  GeocodingApi.prototype.unsubscribeToEvent = function (eventHandle) {
11240
- this.realTime.off(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
11244
+ var _this = this;
11245
+ this.eventHandlers.delete(eventHandle);
11246
+ this.persistentConnection.unsubscribe(new PubSubEvents_1.PubSubEvent(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED));
11247
+ this.eventHandlers.forEach(function (handler) {
11248
+ _this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, handler);
11249
+ });
11241
11250
  };
11242
11251
  return GeocodingApi;
11243
11252
  }());
@@ -23291,7 +23300,7 @@ var lodash_1 = __webpack_require__(96486);
23291
23300
  var BringgException_1 = __webpack_require__(43605);
23292
23301
  var Logger_1 = __importDefault(__webpack_require__(55860));
23293
23302
  var abort_1 = __webpack_require__(34179);
23294
- var version = '9.62.0';
23303
+ var version = '9.62.1-pre.0';
23295
23304
  function logErrorResponse(response) {
23296
23305
  var data = response.data, status = response.status;
23297
23306
  try {