@@ -50,7 +50,7 @@ function httpGetSessionKeyValues(db) {
50
50
let sessionId = request . zapSessionId
51
51
let sessionKeyValues = await querySession . getAllSessionKeyValues (
52
52
db ,
53
- sessionId ,
53
+ sessionId
54
54
)
55
55
response . status ( StatusCodes . OK ) . json ( sessionKeyValues )
56
56
}
@@ -83,7 +83,7 @@ function httpGetSessionNotifications(db) {
83
83
let sessionId = request . zapSessionId
84
84
let notifications = await querySessionNotification . getNotification (
85
85
db ,
86
- sessionId ,
86
+ sessionId
87
87
)
88
88
response . status ( StatusCodes . OK ) . json ( notifications )
89
89
}
@@ -171,7 +171,7 @@ function httpGetUnseenNotificationAndUpdate(db) {
171
171
let unseenIds = request . query . unseenIds
172
172
let resp = await querySessionNotification . markNotificationsAsSeen (
173
173
db ,
174
- unseenIds ,
174
+ unseenIds
175
175
)
176
176
response . status ( StatusCodes . OK ) . json ( resp )
177
177
}
@@ -212,7 +212,7 @@ function httpPostCluster(db) {
212
212
. getSessionPackagesByType (
213
213
db ,
214
214
sessionId ,
215
- dbEnum . packageType . zclProperties ,
215
+ dbEnum . packageType . zclProperties
216
216
)
217
217
. then ( ( pkgs ) => pkgs ?. shift ( ) ?. id ) // default to always picking first package
218
218
@@ -229,7 +229,7 @@ function httpPostCluster(db) {
229
229
endpointTypeId ,
230
230
id ,
231
231
side ,
232
- flag ,
232
+ flag
233
233
)
234
234
235
235
if ( insertDefault ) {
@@ -271,9 +271,9 @@ function httpPostForcedExternal(db) {
271
271
let sessionId = request . zapSessionId
272
272
let packages = await queryPackage . getPackageSessionPackagePairBySessionId (
273
273
db ,
274
- sessionId ,
274
+ sessionId
275
275
)
276
- let packageIds = packages . map ( ( pkg ) => pkg . id )
276
+ let packageIds = packages . map ( ( item ) => item . pkg . id )
277
277
let forcedExternal = await upgrade . getForcedExternalStorage ( db , packageIds )
278
278
response . status ( StatusCodes . OK ) . json ( forcedExternal )
279
279
}
@@ -330,17 +330,17 @@ function httpPostAttributeUpdate(db) {
330
330
paramArray ,
331
331
reportMinInterval ,
332
332
reportMaxInterval ,
333
- reportableChange ,
334
- ) ,
335
- ) ,
333
+ reportableChange
334
+ )
335
+ )
336
336
)
337
337
338
338
// send latest value to frontend to update UI
339
339
let eptAttr = await queryZcl . selectEndpointTypeAttribute (
340
340
db ,
341
341
endpointTypeIdList [ 0 ] ,
342
342
id ,
343
- clusterRef ,
343
+ clusterRef
344
344
)
345
345
346
346
// only return 1 validation result.
@@ -351,7 +351,7 @@ function httpPostAttributeUpdate(db) {
351
351
endpointTypeIdList [ 0 ] ,
352
352
id ,
353
353
clusterRef ,
354
- request . zapSessionId ,
354
+ request . zapSessionId
355
355
)
356
356
357
357
response . status ( StatusCodes . OK ) . json ( {
@@ -406,9 +406,9 @@ function httpPostCommandUpdate(db) {
406
406
commandSide ,
407
407
id ,
408
408
value ,
409
- isIncoming ,
410
- ) ,
411
- ) ,
409
+ isIncoming
410
+ )
411
+ )
412
412
)
413
413
414
414
response . status ( StatusCodes . OK ) . json ( {
@@ -439,7 +439,7 @@ function httpPostEventUpdate(db) {
439
439
clusterRef ,
440
440
eventSide ,
441
441
id ,
442
- value ,
442
+ value
443
443
)
444
444
445
445
response . status ( StatusCodes . OK ) . json ( {
@@ -498,7 +498,7 @@ function httpGetOption(db) {
498
498
let sessionId = request . zapSessionId
499
499
let packages = await queryPackage . getSessionPackages ( db , sessionId )
500
500
let p = packages . map ( ( pkg ) =>
501
- queryPackage . selectAllOptionsValues ( db , pkg . packageRef , category ) ,
501
+ queryPackage . selectAllOptionsValues ( db , pkg . packageRef , category )
502
502
)
503
503
let data = await Promise . all ( p )
504
504
data = data . flat ( 1 )
@@ -566,24 +566,24 @@ function httpPostAddNewPackage(db) {
566
566
await querySession . selectSessionPartitionInfoFromPackageId (
567
567
db ,
568
568
sessionId ,
569
- data . packageId ,
569
+ data . packageId
570
570
)
571
571
if ( sessionPartitionInfoForNewPackage . length == 0 ) {
572
572
let sessionPartitionInfo =
573
573
await querySession . getAllSessionPartitionInfoForSession (
574
574
db ,
575
- sessionId ,
575
+ sessionId
576
576
)
577
577
let sessionPartitionId = await querySession . insertSessionPartition (
578
578
db ,
579
579
sessionId ,
580
- sessionPartitionInfo . length + 1 ,
580
+ sessionPartitionInfo . length + 1
581
581
)
582
582
await queryPackage . insertSessionPackage (
583
583
db ,
584
584
sessionPartitionId ,
585
585
data . packageId ,
586
- true ,
586
+ true
587
587
)
588
588
}
589
589
status = {
@@ -619,7 +619,7 @@ function httpPostShareClusterStatesAcrossEndpoints(db) {
619
619
let packageIds = await queryPackage . getSessionPackagesByType (
620
620
db ,
621
621
sessionId ,
622
- dbEnum . packageType . zclProperties ,
622
+ dbEnum . packageType . zclProperties
623
623
)
624
624
packageIds = packageIds . map ( function getId ( item ) {
625
625
return item . id
@@ -634,23 +634,23 @@ function httpPostShareClusterStatesAcrossEndpoints(db) {
634
634
db ,
635
635
endpointTypeIdList . map ( ( id ) => {
636
636
return { endpointTypeId : id }
637
- } ) ,
637
+ } )
638
638
)
639
639
. then ( ( list ) => list . filter ( ( entry ) => entry . endpointCount > 1 ) )
640
640
641
641
let attrDefaults = await attributeDefaults (
642
642
db ,
643
643
endpointTypeIdList ,
644
644
sharedClusterList ,
645
- packageIds ,
645
+ packageIds
646
646
)
647
647
await writeAttributeDefaults ( db , attrDefaults )
648
648
649
649
let cmdDefaults = await commandDefaults (
650
650
db ,
651
651
endpointTypeIdList ,
652
652
sharedClusterList ,
653
- packageIds ,
653
+ packageIds
654
654
)
655
655
await writeCommandDefaults ( db , cmdDefaults )
656
656
@@ -665,7 +665,7 @@ async function commandDefaults(
665
665
db ,
666
666
endpointTypeIdList ,
667
667
sharedClusterList ,
668
- packageIds ,
668
+ packageIds
669
669
) {
670
670
let sharedCmdDefaults = { }
671
671
let clusCmdToCmdObj = { }
@@ -675,7 +675,7 @@ async function commandDefaults(
675
675
sharedClusterList . map ( ( c ) => {
676
676
return { endpointTypeClusterRef : c . endpointClusterId }
677
677
} ) ,
678
- packageIds ,
678
+ packageIds
679
679
)
680
680
681
681
for ( const endpointTypeId of endpointTypeIdList ) {
@@ -698,7 +698,7 @@ async function commandDefaults(
698
698
let cmds = await queryEndpoint . selectEndpointClusterCommands (
699
699
db ,
700
700
sharedCmd . clusterId ,
701
- endpointTypeId ,
701
+ endpointTypeId
702
702
)
703
703
704
704
// find attr
@@ -727,8 +727,8 @@ async function writeCommandDefaults(db, defaults) {
727
727
cmd . source ,
728
728
cmd . id ,
729
729
cmd . isIncoming ,
730
- true ,
731
- ) ,
730
+ true
731
+ )
732
732
)
733
733
734
734
promises . push (
@@ -739,8 +739,8 @@ async function writeCommandDefaults(db, defaults) {
739
739
cmd . source ,
740
740
cmd . id ,
741
741
cmd . isOutgoing ,
742
- false ,
743
- ) ,
742
+ false
743
+ )
744
744
)
745
745
}
746
746
}
@@ -751,15 +751,15 @@ async function attributeDefaults(
751
751
db ,
752
752
endpointTypeIdList ,
753
753
sharedClusterList ,
754
- packageIds ,
754
+ packageIds
755
755
) {
756
756
let sharedAttributeDefaults = { }
757
757
let clusterIdnSideToAttrCache = { }
758
758
let sharedAttributeList =
759
759
await queryAttribute . selectAttributeDetailsFromEnabledClusters (
760
760
db ,
761
761
sharedClusterList ,
762
- packageIds ,
762
+ packageIds
763
763
)
764
764
765
765
for ( const endpointTypeId of endpointTypeIdList ) {
@@ -779,19 +779,19 @@ async function attributeDefaults(
779
779
! ( endpointTypeId in sharedAttributeDefaults ) &&
780
780
( sharedAttributeDefaults [ endpointTypeId ] = [ ] )
781
781
sharedAttributeDefaults [ endpointTypeId ] . push (
782
- clusterIdnSideToAttrCache [ clusAttrCacheKey ] ,
782
+ clusterIdnSideToAttrCache [ clusAttrCacheKey ]
783
783
)
784
784
} else {
785
785
let attributes = await queryEndpoint . selectEndpointClusterAttributes (
786
786
db ,
787
787
sharedAttr . clusterId ,
788
788
sharedAttr . side ,
789
- endpointTypeId ,
789
+ endpointTypeId
790
790
)
791
791
792
792
// find attr
793
793
let matched = attributes . filter ( ( attr ) =>
794
- attributeEquals ( attr , sharedAttr ) ,
794
+ attributeEquals ( attr , sharedAttr )
795
795
)
796
796
if ( matched . length ) {
797
797
let m = matched . shift ( )
@@ -843,8 +843,8 @@ async function writeAttributeDefaults(db, defaults) {
843
843
] ,
844
844
attr . min ,
845
845
attr . max ,
846
- attr . reportableChange ,
847
- ) ,
846
+ attr . reportableChange
847
+ )
848
848
)
849
849
}
850
850
}
@@ -881,12 +881,12 @@ function httpDeleteSessionPackage(db) {
881
881
await querySession . selectSessionPartitionInfoFromPackageId (
882
882
db ,
883
883
sessionRef ,
884
- packageRef ,
884
+ packageRef
885
885
)
886
886
let removed = await queryPackage . deleteSessionPackage (
887
887
db ,
888
888
sessionPartitionInfo [ 0 ] . sessionPartitionId ,
889
- packageRef ,
889
+ packageRef
890
890
)
891
891
892
892
response . status ( StatusCodes . OK ) . json ( {
@@ -912,7 +912,7 @@ function httpPostDuplicateEndpoint(db) {
912
912
db ,
913
913
endpointId ,
914
914
endpointIdentifier ,
915
- endpointTypeId ,
915
+ endpointTypeId
916
916
)
917
917
res . status ( StatusCodes . OK ) . json ( { id : id } )
918
918
}
@@ -947,11 +947,11 @@ function httpPostDuplicateEndpointType(db) {
947
947
async function duplicateEndpointTypeClusters (
948
948
db ,
949
949
oldEndpointTypeId ,
950
- newEndpointTypeId ,
950
+ newEndpointTypeId
951
951
) {
952
952
let oldEndpointTypeClusters = await queryConfig . selectEndpointClusters (
953
953
db ,
954
- oldEndpointTypeId ,
954
+ oldEndpointTypeId
955
955
)
956
956
oldEndpointTypeClusters . forEach ( async ( endpointTypeCluster ) => {
957
957
let newEndpointTypeClusterId =
@@ -960,19 +960,19 @@ async function duplicateEndpointTypeClusters(
960
960
newEndpointTypeId ,
961
961
endpointTypeCluster . clusterRef ,
962
962
endpointTypeCluster . side ,
963
- endpointTypeCluster . enabled ,
963
+ endpointTypeCluster . enabled
964
964
)
965
965
let oldAttributes =
966
966
await queryAttribute . selectEndpointTypeAttributesByEndpointTypeRefAndClusterRef (
967
967
db ,
968
968
oldEndpointTypeId ,
969
- endpointTypeCluster . endpointTypeClusterId ,
969
+ endpointTypeCluster . endpointTypeClusterId
970
970
)
971
971
oldAttributes . forEach ( async ( attrubute ) => {
972
972
await queryAttribute . duplicateEndpointTypeAttribute (
973
973
db ,
974
974
newEndpointTypeClusterId ,
975
- attrubute ,
975
+ attrubute
976
976
)
977
977
} )
978
978
} )
0 commit comments