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

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,12 +3,13 @@ import Session from '../Services/Identity/Session';
3
3
  export default class GeocodingApi {
4
4
  private geocodingEntity;
5
5
  private realTime;
6
- private persistentConnection;
7
6
  private eventHandlers;
7
+ private isGeocodingChangedSubscribed;
8
+ private onGeocodingChanged;
8
9
  constructor(session: Session);
9
10
  autoComplete(address: string): Promise<AutoCompleteResponse>;
10
11
  getPlaceDetails(placeId: string): Promise<GetPlaceDetailsResponse>;
11
12
  reverseGeocode(lat: number, lng: number): Promise<BringgReverseGeocodedAddress>;
12
- subscribeToEvent(eventHandle: any): void;
13
- unsubscribeToEvent(eventHandle: any): void;
13
+ subscribeToEvent(eventHandle: (event: any) => void): void;
14
+ unsubscribeToEvent(eventHandle: (event: any) => void): void;
14
15
  }
@@ -4,15 +4,18 @@ 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");
8
7
  var Geocoding_1 = __importDefault(require("./Entity/Geocoding"));
9
8
  var Geocoding_consts_1 = require("./Geocoding.consts");
10
9
  var GeocodingApi = /** @class */ (function () {
11
10
  function GeocodingApi(session) {
11
+ var _this = this;
12
12
  this.eventHandlers = new Set();
13
+ this.isGeocodingChangedSubscribed = false;
14
+ this.onGeocodingChanged = function (event) {
15
+ _this.eventHandlers.forEach(function (handler) { return handler(event); });
16
+ };
13
17
  this.geocodingEntity = new Geocoding_1.default(session);
14
18
  this.realTime = new StoreEntity_1.RealTimeHandler(session.persistentConnection);
15
- this.persistentConnection = session.persistentConnection;
16
19
  }
17
20
  GeocodingApi.prototype.autoComplete = function (address) {
18
21
  return this.geocodingEntity.autoComplete(address);
@@ -25,15 +28,13 @@ var GeocodingApi = /** @class */ (function () {
25
28
  };
26
29
  GeocodingApi.prototype.subscribeToEvent = function (eventHandle) {
27
30
  this.eventHandlers.add(eventHandle);
28
- this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
31
+ if (!this.isGeocodingChangedSubscribed) {
32
+ this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, this.onGeocodingChanged);
33
+ this.isGeocodingChangedSubscribed = true;
34
+ }
29
35
  };
30
36
  GeocodingApi.prototype.unsubscribeToEvent = function (eventHandle) {
31
- var _this = this;
32
37
  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
- });
37
38
  };
38
39
  return GeocodingApi;
39
40
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"GeocodingApi.js","sourceRoot":"","sources":["../../src/Geocoding/GeocodingApi.ts"],"names":[],"mappings":";;;;;AAEA,mDAAsD;AAGtD,yDAAuD;AACvD,iEAA2C;AAC3C,uDAA6D;AAE7D;IAMC,sBAAY,OAAgB;QAFpB,kBAAa,GAAkC,IAAI,GAAG,EAAE,CAAC;QAGhE,IAAI,CAAC,eAAe,GAAG,IAAI,mBAAS,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,6BAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAClE,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAEM,mCAAY,GAAnB,UAAoB,OAAe;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAEM,sCAAe,GAAtB,UA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AAC,EAAd,CAAc,CAAC,CAAC;QACvD,CAAC,CAAC;QAGD,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,WAAiC;QACxD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEpC,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE;YACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,0CAAuB,CAAC,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACrF,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC;SACzC;IACF,CAAC;IAEM,yCAAkB,GAAzB,UAA0B,WAAiC;QAC1D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC;IACF,mBAAC;AAAD,CAAC,AAvCD,IAuCC"}
@@ -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.1-pre.0';
59
+ var version = '9.62.1-pre.2';
60
60
  function logErrorResponse(response) {
61
61
  var data = response.data, status = response.status;
62
62
  try {
@@ -11217,15 +11217,18 @@ 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);
11221
11220
  var Geocoding_1 = __importDefault(__webpack_require__(84431));
11222
11221
  var Geocoding_consts_1 = __webpack_require__(29091);
11223
11222
  var GeocodingApi = /** @class */ (function () {
11224
11223
  function GeocodingApi(session) {
11224
+ var _this = this;
11225
11225
  this.eventHandlers = new Set();
11226
+ this.isGeocodingChangedSubscribed = false;
11227
+ this.onGeocodingChanged = function (event) {
11228
+ _this.eventHandlers.forEach(function (handler) { return handler(event); });
11229
+ };
11226
11230
  this.geocodingEntity = new Geocoding_1.default(session);
11227
11231
  this.realTime = new StoreEntity_1.RealTimeHandler(session.persistentConnection);
11228
- this.persistentConnection = session.persistentConnection;
11229
11232
  }
11230
11233
  GeocodingApi.prototype.autoComplete = function (address) {
11231
11234
  return this.geocodingEntity.autoComplete(address);
@@ -11238,15 +11241,13 @@ var GeocodingApi = /** @class */ (function () {
11238
11241
  };
11239
11242
  GeocodingApi.prototype.subscribeToEvent = function (eventHandle) {
11240
11243
  this.eventHandlers.add(eventHandle);
11241
- this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, eventHandle);
11244
+ if (!this.isGeocodingChangedSubscribed) {
11245
+ this.realTime.on(Geocoding_consts_1.RealTimeGeocodingEvents.GEOCODING_CHANGED, this.onGeocodingChanged);
11246
+ this.isGeocodingChangedSubscribed = true;
11247
+ }
11242
11248
  };
11243
11249
  GeocodingApi.prototype.unsubscribeToEvent = function (eventHandle) {
11244
- var _this = this;
11245
11250
  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
- });
11250
11251
  };
11251
11252
  return GeocodingApi;
11252
11253
  }());
@@ -23300,7 +23301,7 @@ var lodash_1 = __webpack_require__(96486);
23300
23301
  var BringgException_1 = __webpack_require__(43605);
23301
23302
  var Logger_1 = __importDefault(__webpack_require__(55860));
23302
23303
  var abort_1 = __webpack_require__(34179);
23303
- var version = '9.62.1-pre.0';
23304
+ var version = '9.62.1-pre.2';
23304
23305
  function logErrorResponse(response) {
23305
23306
  var data = response.data, status = response.status;
23306
23307
  try {