@tak-ps/node-cot 14.37.2 → 14.39.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.
@@ -696,11 +696,456 @@ export const ForceDelete = Type.Object({})
696
696
 
697
697
  export const ShapeExtras = Type.Object({
698
698
  _attributes: Type.Object({
699
- cpvis: Type.Optional(Type.Boolean()),
699
+ cpvis: Type.Optional(Type.Boolean({
700
+ description: 'Determines if the center point & callsign are visible when the shape is rendered in TAK clients'
701
+ })),
700
702
  editable: Type.Optional(Type.Boolean()),
701
703
  })
702
704
  });
703
705
 
706
+ // === CBRN Sensor Schemas (RadCoT, ChemCoT, BioCoT) ===
707
+
708
+ // RadCoT Enums
709
+ export const RadMeasurementType = Type.Enum({
710
+ alpha: 'alpha',
711
+ beta: 'beta',
712
+ gamma: 'gamma',
713
+ neutron: 'neutron',
714
+ doserate: 'doserate'
715
+ });
716
+
717
+ export const RadDistanceToSource = Type.Enum({
718
+ MOVE_MUCH_CLOSER: 'MOVE_MUCH_CLOSER',
719
+ MOVE_CLOSER: 'MOVE_CLOSER',
720
+ OPTIMAL: 'OPTIMAL',
721
+ MOVE_AWAY: 'MOVE_AWAY',
722
+ MOVE_FAR_AWAY: 'MOVE_FAR_AWAY'
723
+ });
724
+
725
+ export const RadModuleLocation = Type.Enum({
726
+ FRONT_LEFT: 'FRONT_LEFT',
727
+ FRONT_RIGHT: 'FRONT_RIGHT',
728
+ REAR_LEFT: 'REAR_LEFT',
729
+ REAR_RIGHT: 'REAR_RIGHT',
730
+ CAB: 'CAB'
731
+ });
732
+
733
+ // RadCoT Sensor Data Attributes
734
+ export const RadSensorDataAttributes = Type.Object({
735
+ time: Type.String({
736
+ description: 'epoch time in Long format'
737
+ }),
738
+ model: Type.String({
739
+ description: 'The model of sensor (Micro Detective, IdentiFINDER 2, etc.) in string format'
740
+ }),
741
+ neutronstatus: Type.String({
742
+ description: 'The neutron detector status (Full, Reduced or Unknown). Not available for most sensors, default to Unknown'
743
+ }),
744
+ gammastatus: Type.String({
745
+ description: 'The gamma detector status (Full, Reduced or Unknown). Not available for most sensors, default to Unknown'
746
+ }),
747
+ manufacturer: Type.String({
748
+ description: 'The Manufacturer of the sensor (Ortec, Nucsafe, etc.) in string format'
749
+ }),
750
+ callsign: Type.Optional(Type.String({
751
+ description: 'The name of the given sensor in string format'
752
+ })),
753
+ serialnumber: Type.String({
754
+ description: 'The Serial Number of the Sensor in string format'
755
+ }),
756
+ batterylevel: Type.Optional(Type.Number({
757
+ description: 'The battery level as a percentage, float value'
758
+ })),
759
+ id_algorithm: Type.Optional(Type.String({
760
+ description: 'The ID algorithm used to ID isotopes (ex. GADRAS)'
761
+ })),
762
+ search_algorithm: Type.Optional(Type.String({
763
+ description: 'The search algorithm used (ex. RDAK, SAMBA)'
764
+ })),
765
+ alarm_algorithm: Type.Optional(Type.String({
766
+ description: 'The alarm algorithm used (ex. RDAK, SAMBA)'
767
+ })),
768
+ ordinal: Type.Optional(Type.Integer({
769
+ description: 'Used internally by the CBRN plugin'
770
+ })),
771
+ subchannel: Type.Optional(Type.String({
772
+ description: 'Identifier of this subchannel, if this event is a report from a subchannel of a master sensor'
773
+ })),
774
+ measurement_ref: Type.Optional(Type.Integer({
775
+ description: 'Used to align subchannels'
776
+ })),
777
+ master_sensor_manufacturer: Type.Optional(Type.String({
778
+ description: 'Name of the master sensor, if this event is a report from a subchannel'
779
+ })),
780
+ master_sensor_serial: Type.Optional(Type.String({
781
+ description: 'Serial number of the master sensor, if this event is a report from a subchannel'
782
+ })),
783
+ source_bearing: Type.Optional(Type.Integer({
784
+ description: 'A bearing in positive degrees if the sensor reports back a direction for the detected source, -1 otherwise'
785
+ })),
786
+ source_strength: Type.Optional(Type.Number({
787
+ description: 'A scale from 0 - 0.5 giving the magnitude of the source strength in the direction of source_bearing'
788
+ })),
789
+ relay_type: Type.Optional(Type.String({
790
+ description: 'Used for sensors that can relay data from other sensors, or that can be relayed in that way'
791
+ })),
792
+ module_location: Type.Optional(Type.String({
793
+ description: 'The location of the sensor where it\'s being worn on the vest'
794
+ })),
795
+ detector_number: Type.Optional(Type.Integer({
796
+ description: 'The number from the sensor needed in order to retrieve any specific algorithm calculated data'
797
+ })),
798
+ mission_total_mR: Type.Optional(Type.Integer({
799
+ description: 'The total mR configured for the sensor\'s current mission'
800
+ })),
801
+ mission_stay_time_sec: Type.Optional(Type.Integer({
802
+ description: 'The total seconds remaining of mission time based on current configuration of sensor and acquired dose'
803
+ })),
804
+ mission_acquired_uR: Type.Optional(Type.Integer({
805
+ description: 'The total uR acquired by the sensor for the current mission'
806
+ })),
807
+ sensor_temp_deg_c: Type.Optional(Type.Number({
808
+ description: 'The temperature of the sensor in degrees celsius'
809
+ })),
810
+ heading: Type.Optional(Type.Number({
811
+ description: 'The current directional heading of the sensor'
812
+ })),
813
+ source_distance: Type.Optional(RadDistanceToSource),
814
+ attachedUid: Type.Optional(Type.String({
815
+ description: 'The UID of the TAK marker that this sensor is attached to'
816
+ })),
817
+ simulated: Type.Optional(Type.Boolean({
818
+ description: 'Is the data in this element representative of a simulated sensor'
819
+ }))
820
+ });
821
+
822
+ export const RadSensorData = Type.Object({
823
+ _attributes: RadSensorDataAttributes
824
+ });
825
+
826
+ // RadCoT Measurement
827
+ export const RadMeasurementAttributes = Type.Object({
828
+ nalarmstddev: Type.Integer({
829
+ description: 'Defines the alarm level, could be standard deviations above background. Will default to 0 (no alarm)'
830
+ }),
831
+ alarm: Type.Integer({
832
+ description: 'Alarm flag for the measurement. 1 = alarmed, 0 = not alarmed'
833
+ }),
834
+ measurement: Type.Number({
835
+ description: 'The measurement value as a float. A/B/G/N will be interpreted as CPS. Dose Rate will be interpreted as mR/Hr'
836
+ }),
837
+ name: RadMeasurementType
838
+ });
839
+
840
+ export const RadMeasurement = Type.Object({
841
+ _attributes: RadMeasurementAttributes
842
+ });
843
+
844
+ // RadCoT Physical Module
845
+ export const RadPhysicalModuleAttributes = Type.Object({
846
+ location: RadModuleLocation,
847
+ gamma_cps: Type.Number({
848
+ description: 'Gamma counts per second'
849
+ }),
850
+ gamma_alarm: Type.Integer({
851
+ description: 'Alarm level for the measurement. 0 = not alarmed, > 0 = alarm level'
852
+ }),
853
+ gamma_dose_rate: Type.Number({
854
+ description: 'The gamma dose rate. Will be interpreted as uR/Hr'
855
+ })
856
+ });
857
+
858
+ export const RadPhysicalModule = Type.Object({
859
+ _attributes: RadPhysicalModuleAttributes
860
+ });
861
+
862
+ // RadCoT Search Algorithm
863
+ export const RadSearchAlgorithmAttributes = Type.Object({
864
+ neutron_loc: Type.Number({
865
+ description: 'The Neutron localization value'
866
+ }),
867
+ gamma_loc: Type.Number({
868
+ description: 'The Gamma localization value'
869
+ }),
870
+ neutron_loc_alarm_value: Type.Number({
871
+ description: 'The Neutron localization alarm level'
872
+ }),
873
+ gamma_loc_alarm_value: Type.Number({
874
+ description: 'The Gamma localization alarm level'
875
+ }),
876
+ neutron_loc_alarm: Type.Integer({
877
+ description: 'Alarm flag for the neutron localization value. 1 = alarmed, 0 = not alarmed'
878
+ }),
879
+ gamma_loc_alarm: Type.Integer({
880
+ description: 'Alarm flag for the gamma localization value. 1 = alarmed, 0 = not alarmed'
881
+ })
882
+ });
883
+
884
+ export const RadSearchAlgorithm = Type.Object({
885
+ _attributes: RadSearchAlgorithmAttributes
886
+ });
887
+
888
+ // RadCoT Spectrum
889
+ export const RadSpectrumAttributes = Type.Object({
890
+ zerocompression: Type.Integer({
891
+ description: 'Flag for zero compression. 1 = zero compressed, 0 = not compressed'
892
+ }),
893
+ type: Type.String({
894
+ description: 'FOREGROUND or BACKGROUND'
895
+ }),
896
+ livetime_ms: Type.String({
897
+ description: 'Spectrum live time in epoch time (ms)'
898
+ }),
899
+ realtime_ms: Type.String({
900
+ description: 'Spectrum real time in epoch time (ms)'
901
+ }),
902
+ channeldata: Type.String({
903
+ description: 'The spectral channel data'
904
+ }),
905
+ crystal_id: Type.Optional(Type.String({
906
+ description: 'The ID of the crystal reporting the channel data'
907
+ }))
908
+ });
909
+
910
+ export const RadSpectrum = Type.Object({
911
+ _attributes: RadSpectrumAttributes
912
+ });
913
+
914
+ // RadCoT Isotope
915
+ export const RadIsotopeAttributes = Type.Object({
916
+ confidence: Type.Number({
917
+ description: 'The confidence value as a float representation of a percentage (88.5 NOT 0.885)'
918
+ }),
919
+ name: Type.String({
920
+ description: 'The name of the isotope'
921
+ }),
922
+ type: Type.String({
923
+ description: 'The type of the isotope'
924
+ })
925
+ });
926
+
927
+ export const RadIsotope = Type.Object({
928
+ _attributes: RadIsotopeAttributes
929
+ });
930
+
931
+ // RadCoT Permissions
932
+ export const RadPermissionsAttributes = Type.Object({
933
+ all: Type.Boolean({
934
+ description: 'All is true if all users should have access/permission'
935
+ }),
936
+ contact_list: Type.String({
937
+ description: 'The list of ATAK UIDs that should have access/permission'
938
+ })
939
+ });
940
+
941
+ export const RadDataPermissions = Type.Object({
942
+ _attributes: RadPermissionsAttributes
943
+ });
944
+
945
+ export const RadCommandPermissions = Type.Object({
946
+ _attributes: RadPermissionsAttributes
947
+ });
948
+
949
+ // RadCoT Main Element
950
+ export const RadSensorDetail = Type.Object({
951
+ sensor_data: RadSensorData,
952
+ radmeasurement: Type.Optional(Type.Union([RadMeasurement, Type.Array(RadMeasurement)])),
953
+ physical_module: Type.Optional(Type.Union([RadPhysicalModule, Type.Array(RadPhysicalModule)])),
954
+ search_algorithm: Type.Optional(RadSearchAlgorithm),
955
+ spectrum: Type.Optional(Type.Union([RadSpectrum, Type.Array(RadSpectrum)])),
956
+ isotope: Type.Optional(Type.Union([RadIsotope, Type.Array(RadIsotope)])),
957
+ data_permissions: Type.Optional(RadDataPermissions),
958
+ command_permissions: Type.Optional(RadCommandPermissions)
959
+ });
960
+
961
+ // ChemCoT Sensor Data Attributes
962
+ export const ChemSensorDataAttributes = Type.Object({
963
+ manufacturer: Type.String({
964
+ description: 'The Manufacturer of the sensor in string format'
965
+ }),
966
+ model: Type.String({
967
+ description: 'The model of sensor in string format'
968
+ }),
969
+ serialnumber: Type.String({
970
+ description: 'The Serial Number of the Sensor in string format'
971
+ }),
972
+ batterylevel: Type.Optional(Type.Number({
973
+ description: 'The battery level as a percentage, float value'
974
+ })),
975
+ callsign: Type.Optional(Type.String({
976
+ description: 'The name of the given sensor in string format. Default name is Manufacturer+SerialNum'
977
+ })),
978
+ revision: Type.Optional(Type.Number({
979
+ description: 'The revision of the ChemCoT format, at writing this is "7"'
980
+ })),
981
+ status: Type.Optional(Type.String({
982
+ description: 'General sensor health status'
983
+ })),
984
+ ordinal: Type.Optional(Type.Integer({
985
+ description: 'Used internally by the CBRN plugin'
986
+ })),
987
+ attachedUid: Type.Optional(Type.String({
988
+ description: 'The UID of the TAK marker that this sensor is attached to'
989
+ })),
990
+ simulated: Type.Optional(Type.Boolean({
991
+ description: 'Is the data in this element representative of a simulated sensor'
992
+ }))
993
+ });
994
+
995
+ export const ChemSensorData = Type.Object({
996
+ _attributes: ChemSensorDataAttributes
997
+ });
998
+
999
+ // ChemCoT Detection
1000
+ export const ChemDetectionAttributes = Type.Object({
1001
+ time: Type.String({
1002
+ description: 'Timestamp for the detection, epoch time (ms)'
1003
+ }),
1004
+ agent: Type.String({
1005
+ description: 'Chemical Name in string format'
1006
+ }),
1007
+ quantity: Type.Number({
1008
+ description: 'Amount of chemical detected as a float. Could be mass, density, bars etc.'
1009
+ }),
1010
+ quantityunits: Type.String({
1011
+ description: 'The units used to describe the quantity'
1012
+ }),
1013
+ concentration: Type.Optional(Type.Number({
1014
+ description: 'Concentration of chemical in Kg/m^3'
1015
+ })),
1016
+ alarm: Type.Number({
1017
+ description: 'Alarm state of the sensor. 1 = alarm, 0 = no alarm'
1018
+ }),
1019
+ confidence: Type.Optional(Type.Number({
1020
+ description: 'The confidence of the detection from the sensor as a percentage'
1021
+ })),
1022
+ massfraction: Type.Optional(Type.Number({
1023
+ description: 'The mass fraction of the detection from the sensor in ppm'
1024
+ })),
1025
+ percent: Type.Optional(Type.Number({
1026
+ description: 'The percentage of the detection from the sensor in percent from 0-100'
1027
+ })),
1028
+ class: Type.Optional(Type.String({
1029
+ description: 'The class of chemical detected. Nerve, Blood, TIC, etc.'
1030
+ })),
1031
+ id: Type.Optional(Type.Integer({
1032
+ description: 'The ID number of the detection'
1033
+ }))
1034
+ });
1035
+
1036
+ export const ChemDetection = Type.Object({
1037
+ _attributes: ChemDetectionAttributes
1038
+ });
1039
+
1040
+ // ChemCoT Main Element
1041
+ export const ChemSensorDetail = Type.Object({
1042
+ sensor_data: ChemSensorData,
1043
+ detection: Type.Optional(Type.Union([ChemDetection, Type.Array(ChemDetection)]))
1044
+ });
1045
+
1046
+ // BioCoT Sensor Data Attributes
1047
+ export const BioSensorDataAttributes = Type.Object({
1048
+ manufacturer: Type.String({
1049
+ description: 'The Manufacturer of the sensor in string format'
1050
+ }),
1051
+ model: Type.String({
1052
+ description: 'The model of sensor in string format'
1053
+ }),
1054
+ serialnumber: Type.String({
1055
+ description: 'The Serial Number of the Sensor in string format'
1056
+ }),
1057
+ batterylevel: Type.Optional(Type.Number({
1058
+ description: 'The battery level as a percentage, float value'
1059
+ })),
1060
+ callsign: Type.Optional(Type.String({
1061
+ description: 'The name of the given sensor in string format. Default name is Manufacturer+SerialNum'
1062
+ })),
1063
+ revision: Type.Optional(Type.Number({
1064
+ description: 'The revision of the BioCoT format'
1065
+ })),
1066
+ status: Type.Optional(Type.String({
1067
+ description: 'General sensor health status'
1068
+ })),
1069
+ ordinal: Type.Optional(Type.Integer({
1070
+ description: 'Used internally by the CBRN plugin'
1071
+ })),
1072
+ attachedUid: Type.Optional(Type.String({
1073
+ description: 'The UID of the TAK marker that this sensor is attached to'
1074
+ })),
1075
+ simulated: Type.Optional(Type.Boolean({
1076
+ description: 'Is the data in this element representative of a simulated sensor'
1077
+ }))
1078
+ });
1079
+
1080
+ export const BioSensorData = Type.Object({
1081
+ _attributes: BioSensorDataAttributes
1082
+ });
1083
+
1084
+ // BioCoT Measurement Level
1085
+ export const BioMeasurementLevelAttributes = Type.Object({
1086
+ levelName: Type.String({
1087
+ description: 'The name of this measurement level'
1088
+ }),
1089
+ levelValue: Type.String({
1090
+ description: 'The value of this measurement level'
1091
+ })
1092
+ });
1093
+
1094
+ export const BioMeasurementLevel = Type.Object({
1095
+ _attributes: BioMeasurementLevelAttributes
1096
+ });
1097
+
1098
+ // BioCoT Measurement
1099
+ export const BioMeasurementAttributes = Type.Object({
1100
+ time: Type.String({
1101
+ description: 'Timestamp for the measurement, epoch time (ms)'
1102
+ }),
1103
+ bioClass: Type.Optional(Type.String({
1104
+ description: 'Biological class'
1105
+ })),
1106
+ type: Type.Optional(Type.String({
1107
+ description: 'Biological type'
1108
+ })),
1109
+ channel: Type.Optional(Type.Integer({
1110
+ description: 'Channel identifier'
1111
+ })),
1112
+ harmful: Type.Optional(Type.Boolean({
1113
+ description: 'Is this bio measurement harmful'
1114
+ })),
1115
+ doseTime: Type.Optional(Type.Integer({
1116
+ description: 'Dose Time'
1117
+ })),
1118
+ dose: Type.Number({
1119
+ description: 'Amount of dose'
1120
+ }),
1121
+ confidence: Type.Optional(Type.Number({
1122
+ description: 'The confidence of the measurement from the sensor as a percentage'
1123
+ })),
1124
+ confirmationLevel: Type.Optional(Type.String({
1125
+ description: 'Confirmation level'
1126
+ })),
1127
+ concentration: Type.Optional(Type.Number({
1128
+ description: 'Concentration'
1129
+ })),
1130
+ sampleId: Type.Optional(Type.String({
1131
+ description: 'Sample ID of this measurement'
1132
+ })),
1133
+ persistency: Type.Optional(Type.String({
1134
+ description: 'Persistency'
1135
+ }))
1136
+ });
1137
+
1138
+ export const BioMeasurement = Type.Object({
1139
+ _attributes: BioMeasurementAttributes,
1140
+ level: Type.Optional(Type.Union([BioMeasurementLevel, Type.Array(BioMeasurementLevel)]))
1141
+ });
1142
+
1143
+ // BioCoT Main Element
1144
+ export const BioSensorDetail = Type.Object({
1145
+ sensor_data: BioSensorData,
1146
+ measurement: Type.Optional(Type.Union([BioMeasurement, Type.Array(BioMeasurement)]))
1147
+ });
1148
+
704
1149
  export const Detail = Type.Object({
705
1150
  contact: Type.Optional(Contact),
706
1151
  tog: Type.Optional(TogAttributes),
@@ -727,6 +1172,7 @@ export const Detail = Type.Object({
727
1172
  archive: Type.Optional(Type.Union([GenericStringAttributes, Type.Array(GenericStringAttributes)])),
728
1173
  strokeWeight: Type.Optional(GenericNumberAttributes),
729
1174
  strokeStyle: Type.Optional(GenericStringAttributes),
1175
+ // Controls the display of distance calculation labels on the edge of line/polygon features
730
1176
  labels_on: Type.Optional(GenericBooleanAttributes),
731
1177
  fillColor: Type.Optional(GenericIntegerAttributes),
732
1178
  mission: Type.Optional(Mission),
@@ -759,7 +1205,12 @@ export const Detail = Type.Object({
759
1205
  TakResponse: Type.Optional(TakResponseAttributes),
760
1206
  TakProtocolSupport: Type.Optional(ProtocolSupportAttributes),
761
1207
  TakServerVersionInfo: Type.Optional(ServerVersionAttributes)
762
- }))
1208
+ })),
1209
+
1210
+ // CBRN Sensor Details
1211
+ radsensordetail: Type.Optional(RadSensorDetail),
1212
+ chemsensordetail: Type.Optional(ChemSensorDetail),
1213
+ biosensordetail: Type.Optional(BioSensorDetail)
763
1214
  })
764
1215
 
765
1216
  export const Point = Type.Object({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/node-cot",
3
3
  "type": "module",
4
- "version": "14.37.2",
4
+ "version": "14.39.0",
5
5
  "description": "Lightweight JavaScript library for parsing and manipulating TAK messages",
6
6
  "author": "Nick Ingalls <nick@ingalls.ca>",
7
7
  "types": "index.ts",
@@ -30,6 +30,7 @@
30
30
  "node": ">= 22"
31
31
  },
32
32
  "dependencies": {
33
+ "@archiver/archiver": "^0.0.9",
33
34
  "@openaddresses/batch-error": "^2.4.0",
34
35
  "@orbat-mapper/convert-symbology": "^1.0.2",
35
36
  "@sinclair/typebox": "^0.34.0",
@@ -39,10 +40,8 @@
39
40
  "@turf/point-on-feature": "^7.0.0",
40
41
  "@turf/sector": "^7.1.0",
41
42
  "@turf/truncate": "^7.0.0",
42
- "@types/archiver": "^7.0.0",
43
43
  "@types/geojson": "^7946.0.14",
44
44
  "ajv": "^8.12.0",
45
- "archiver": "^7.0.1",
46
45
  "color": "^5.0.0",
47
46
  "geomagnetism": "^0.2.0",
48
47
  "json-diff-ts": "^4.0.1",