@smarterplan/ngx-smarterplan-core 1.2.13 → 1.2.15

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.
@@ -1854,22 +1854,24 @@ class PoiService {
1854
1854
  }
1855
1855
  async createPOIForSpaceID(poi) {
1856
1856
  removeNullKeysFromObject(poi);
1857
- this.awsKinesisAnalytics.getInstance().record(
1858
- // @ts-ignore
1859
- {
1860
- data: {
1861
- eventType: 'Object Creation',
1862
- objectType: 'poi',
1863
- poi: poi,
1864
- user: this.userService.cu,
1865
- timestamp: new Date(),
1866
- floorId: this.selectedFloor?.id,
1867
- locationId: this.currentSpaceID,
1868
- zoneId: this.zoneIDFilter,
1869
- },
1870
- streamName: 'smarterplanKinesis-analytics',
1871
- // partitionKey: "",
1872
- }, 'AWSKinesis');
1857
+ if (!!this.awsKinesisAnalytics) {
1858
+ this.awsKinesisAnalytics.getInstance().record(
1859
+ // @ts-ignore
1860
+ {
1861
+ data: {
1862
+ eventType: 'Object Creation',
1863
+ objectType: 'poi',
1864
+ poi: poi,
1865
+ user: this.userService.cu,
1866
+ timestamp: new Date(),
1867
+ floorId: this.selectedFloor?.id,
1868
+ locationId: this.currentSpaceID,
1869
+ zoneId: this.zoneIDFilter,
1870
+ },
1871
+ streamName: 'smarterplanKinesis-analytics',
1872
+ // partitionKey: "",
1873
+ }, 'AWSKinesis');
1874
+ }
1873
1875
  return this.API.__proto__.CreatePOI(poi);
1874
1876
  }
1875
1877
  poiIsVirtual(poi) {
@@ -6745,24 +6747,26 @@ class TicketsService extends BaseObjectService {
6745
6747
  event.ownerID = event.ownerID ? event.ownerID : currentMission.id;
6746
6748
  try {
6747
6749
  const receivedEvent = await this.eventService.createEvent(event);
6748
- this.awsKinesisAnalytics.getInstance().record(
6749
- // @ts-ignore
6750
- {
6751
- data: {
6752
- eventType: 'Ticket Change',
6753
- ticketId: event.ticketID,
6754
- ticket: ticket,
6755
- status: event.status,
6756
- event: event,
6757
- user: this.userService.cu,
6758
- locationId: this.currentSpaceID,
6759
- timestamp: new Date(),
6760
- zoneId: this.zoneIDFilter,
6761
- floorId: this.selectedFloor?.id,
6762
- },
6763
- streamName: 'smarterplanKinesis-analytics',
6764
- // partitionKey: "",
6765
- }, 'AWSKinesis');
6750
+ if (!!this.awsKinesisAnalytics) {
6751
+ this.awsKinesisAnalytics.getInstance().record(
6752
+ // @ts-ignore
6753
+ {
6754
+ data: {
6755
+ eventType: 'Ticket Change',
6756
+ ticketId: event.ticketID,
6757
+ ticket: ticket,
6758
+ status: event.status,
6759
+ event: event,
6760
+ user: this.userService.cu,
6761
+ locationId: this.currentSpaceID,
6762
+ timestamp: new Date(),
6763
+ zoneId: this.zoneIDFilter,
6764
+ floorId: this.selectedFloor?.id,
6765
+ },
6766
+ streamName: 'smarterplanKinesis-analytics',
6767
+ // partitionKey: "",
6768
+ }, 'AWSKinesis');
6769
+ }
6766
6770
  // console.log('Event successfully created !');
6767
6771
  return receivedEvent;
6768
6772
  }
@@ -6867,23 +6871,25 @@ class TicketsService extends BaseObjectService {
6867
6871
  return this.API.__proto__.GetTicket(id);
6868
6872
  }
6869
6873
  async createTicket(input) {
6870
- this.awsKinesisAnalytics.getInstance().record(
6871
- // @ts-ignore
6872
- {
6873
- data: {
6874
- eventType: 'Object Creation',
6875
- objectType: 'ticket',
6876
- //zoneId: input.spaceID, // TODO: check if spaceId == zoneId
6877
- domain: input.domain,
6878
- user: this.userService.cu,
6879
- locationId: this.currentSpaceID,
6880
- timestamp: new Date(),
6881
- zoneId: this.zoneIDFilter,
6882
- floorId: this.selectedFloor?.id,
6883
- },
6884
- streamName: 'smarterplanKinesis-analytics',
6885
- // partitionKey: "",
6886
- }, 'AWSKinesis');
6874
+ if (!!this.awsKinesisAnalytics) {
6875
+ this.awsKinesisAnalytics.getInstance().record(
6876
+ // @ts-ignore
6877
+ {
6878
+ data: {
6879
+ eventType: 'Object Creation',
6880
+ objectType: 'ticket',
6881
+ //zoneId: input.spaceID, // TODO: check if spaceId == zoneId
6882
+ domain: input.domain,
6883
+ user: this.userService.cu,
6884
+ locationId: this.currentSpaceID,
6885
+ timestamp: new Date(),
6886
+ zoneId: this.zoneIDFilter,
6887
+ floorId: this.selectedFloor?.id,
6888
+ },
6889
+ streamName: 'smarterplanKinesis-analytics',
6890
+ // partitionKey: "",
6891
+ }, 'AWSKinesis');
6892
+ }
6887
6893
  return this.API.__proto__.CreateTicket(input);
6888
6894
  }
6889
6895
  async updateTicket(input) {
@@ -7119,22 +7125,24 @@ class EquipmentService extends BaseObjectService {
7119
7125
  }
7120
7126
  async createEquipment(equip, imageFile, documentFile) {
7121
7127
  removeNullKeysFromObject(equip);
7122
- this.awsKinesisAnalytics.getInstance().record(
7123
- // @ts-ignore
7124
- {
7125
- data: {
7126
- eventType: 'Object Creation',
7127
- objectType: 'equipment',
7128
- poi: equip,
7129
- user: this.userService.cu,
7130
- locationId: this.currentSpaceID,
7131
- timestamp: new Date(),
7132
- zoneId: this.currentZone.id,
7133
- floorId: this.selectedFloor?.id,
7134
- },
7135
- streamName: 'smarterplanKinesis-analytics',
7136
- // partitionKey: "",
7137
- }, 'AWSKinesis');
7128
+ if (!!this.awsKinesisAnalytics) {
7129
+ this.awsKinesisAnalytics.getInstance().record(
7130
+ // @ts-ignore
7131
+ {
7132
+ data: {
7133
+ eventType: 'Object Creation',
7134
+ objectType: 'equipment',
7135
+ poi: equip,
7136
+ user: this.userService.cu,
7137
+ locationId: this.currentSpaceID,
7138
+ timestamp: new Date(),
7139
+ zoneId: this.currentZone.id,
7140
+ floorId: this.selectedFloor?.id,
7141
+ },
7142
+ streamName: 'smarterplanKinesis-analytics',
7143
+ // partitionKey: "",
7144
+ }, 'AWSKinesis');
7145
+ }
7138
7146
  return this.API.CreateEquipment(equip).then(async (receivedEquipment) => {
7139
7147
  let equipment = receivedEquipment;
7140
7148
  if (equipment) {
@@ -10412,23 +10420,25 @@ class MeasurementService {
10412
10420
  comment,
10413
10421
  poi,
10414
10422
  };
10415
- this.awsKinesisAnalytics.getInstance().record(
10416
- // @ts-ignore
10417
- {
10418
- data: {
10419
- eventType: 'Object Creation',
10420
- objectType: 'measurement',
10421
- measurement: measurement,
10422
- //zoneId: spaceID,
10423
- user: this.userService.cu,
10424
- locationId: this.currentSpaceID,
10425
- timestamp: new Date(),
10426
- zoneId: this.zoneIDFilter,
10427
- floorId: this.selectedFloor?.id,
10428
- },
10429
- streamName: 'smarterplanKinesis-analytics',
10430
- // partitionKey: "",
10431
- }, 'AWSKinesis');
10423
+ if (!!this.awsKinesisAnalytics) {
10424
+ this.awsKinesisAnalytics.getInstance().record(
10425
+ // @ts-ignore
10426
+ {
10427
+ data: {
10428
+ eventType: 'Object Creation',
10429
+ objectType: 'measurement',
10430
+ measurement: measurement,
10431
+ //zoneId: spaceID,
10432
+ user: this.userService.cu,
10433
+ locationId: this.currentSpaceID,
10434
+ timestamp: new Date(),
10435
+ zoneId: this.zoneIDFilter,
10436
+ floorId: this.selectedFloor?.id,
10437
+ },
10438
+ streamName: 'smarterplanKinesis-analytics',
10439
+ // partitionKey: "",
10440
+ }, 'AWSKinesis');
10441
+ }
10432
10442
  return measurement;
10433
10443
  }
10434
10444
  async getModel3DForMeasurement(measurement) {
@@ -10927,23 +10937,25 @@ class NavigationBarComponent {
10927
10937
  }
10928
10938
  }
10929
10939
  async sendKinesisAnalyticsEventForZone(zoneId, zoneName) {
10930
- this.awsKinesisAnalytics.getInstance().record(
10931
- // @ts-ignore
10932
- {
10933
- data: {
10934
- eventType: 'Zone Change',
10935
- zoneId: zoneId,
10936
- zoneName: zoneName,
10937
- locationId: this.selectedLocation?.id,
10938
- locationName: this.selectedLocation?.name,
10939
- user: this.userService?.cu,
10940
- timestamp: new Date(),
10941
- floorId: this.selectedFloor?.id,
10942
- childZoneId: this.selectedChildZone?.id,
10943
- },
10944
- streamName: 'smarterplanKinesis-analytics',
10945
- // partitionKey: "",
10946
- }, 'AWSKinesis');
10940
+ if (!!this.awsKinesisAnalytics) {
10941
+ this.awsKinesisAnalytics.getInstance().record(
10942
+ // @ts-ignore
10943
+ {
10944
+ data: {
10945
+ eventType: 'Zone Change',
10946
+ zoneId: zoneId,
10947
+ zoneName: zoneName,
10948
+ locationId: this.selectedLocation?.id,
10949
+ locationName: this.selectedLocation?.name,
10950
+ user: this.userService?.cu,
10951
+ timestamp: new Date(),
10952
+ floorId: this.selectedFloor?.id,
10953
+ childZoneId: this.selectedChildZone?.id,
10954
+ },
10955
+ streamName: 'smarterplanKinesis-analytics',
10956
+ // partitionKey: "",
10957
+ }, 'AWSKinesis');
10958
+ }
10947
10959
  }
10948
10960
  async onVisitClick(event) {
10949
10961
  this.clearData(false);
@@ -11378,7 +11390,7 @@ class MatterportImportService {
11378
11390
  this.importingImages = new Subject();
11379
11391
  this.sweepProcessedCount = new Subject();
11380
11392
  this.totalSweepsCount = new Subject();
11381
- this.MAX_SCANS_RELOAD = 5;
11393
+ this.MAX_SCANS_RELOAD = 10;
11382
11394
  }
11383
11395
  get spaceID() {
11384
11396
  return this._spaceID;
@@ -11559,7 +11571,6 @@ class MatterportImportService {
11559
11571
  nmbScans < this.MAX_SCANS_RELOAD
11560
11572
  ? (maxScan = nmbScans)
11561
11573
  : (maxScan = this.MAX_SCANS_RELOAD);
11562
- maxScan;
11563
11574
  }
11564
11575
  for (let index = indexScan; index < maxScan; index += 1) {
11565
11576
  if (!this.stop) {