@tak-ps/node-cot 12.17.0 → 12.18.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/lib/data-package.js +64 -16
  3. package/dist/lib/data-package.js.map +1 -1
  4. package/dist/lib/types/feature.js +1 -1
  5. package/dist/lib/types/feature.js.map +1 -1
  6. package/dist/lib/types/iconset.js +12 -4
  7. package/dist/lib/types/iconset.js.map +1 -1
  8. package/dist/lib/xml/basemap.js +1 -1
  9. package/dist/lib/xml/basemap.js.map +1 -1
  10. package/dist/lib/xml/iconset.js +29 -2
  11. package/dist/lib/xml/iconset.js.map +1 -1
  12. package/dist/package.json +1 -1
  13. package/dist/tsconfig.tsbuildinfo +1 -1
  14. package/lib/data-package.ts +70 -17
  15. package/lib/types/feature.ts +1 -1
  16. package/lib/types/iconset.ts +14 -4
  17. package/lib/xml/basemap.ts +2 -2
  18. package/lib/xml/iconset.ts +36 -3
  19. package/lib/xml-document.ts +1 -1
  20. package/package.json +1 -1
  21. package/tsconfig.json +1 -0
  22. package/dist/test/basemaps.test.js +0 -16
  23. package/dist/test/basemaps.test.js.map +0 -1
  24. package/dist/test/chat.test.js +0 -97
  25. package/dist/test/chat.test.js.map +0 -1
  26. package/dist/test/cot-fileshare.test.js +0 -89
  27. package/dist/test/cot-fileshare.test.js.map +0 -1
  28. package/dist/test/cot-itak.test.js +0 -95
  29. package/dist/test/cot-itak.test.js.map +0 -1
  30. package/dist/test/cot-mma.test.js +0 -108
  31. package/dist/test/cot-mma.test.js.map +0 -1
  32. package/dist/test/cot-polyline.test.js +0 -98
  33. package/dist/test/cot-polyline.test.js.map +0 -1
  34. package/dist/test/cot-range-and-bearing.test.js +0 -98
  35. package/dist/test/cot-range-and-bearing.test.js.map +0 -1
  36. package/dist/test/cot-routes.test.js +0 -466
  37. package/dist/test/cot-routes.test.js.map +0 -1
  38. package/dist/test/cot-types.test.js +0 -7
  39. package/dist/test/cot-types.test.js.map +0 -1
  40. package/dist/test/cot-uas-tool.test.js +0 -286
  41. package/dist/test/cot-uas-tool.test.js.map +0 -1
  42. package/dist/test/cot-video.test.js +0 -196
  43. package/dist/test/cot-video.test.js.map +0 -1
  44. package/dist/test/cot_is.test.js +0 -353
  45. package/dist/test/cot_is.test.js.map +0 -1
  46. package/dist/test/data-package.test.js +0 -234
  47. package/dist/test/data-package.test.js.map +0 -1
  48. package/dist/test/diff.test.js +0 -73
  49. package/dist/test/diff.test.js.map +0 -1
  50. package/dist/test/flow-tags.test.js +0 -19
  51. package/dist/test/flow-tags.test.js.map +0 -1
  52. package/dist/test/force-delete.js +0 -46
  53. package/dist/test/force-delete.js.map +0 -1
  54. package/dist/test/from_geojson.test.js +0 -287
  55. package/dist/test/from_geojson.test.js.map +0 -1
  56. package/dist/test/newlines.test.js +0 -79
  57. package/dist/test/newlines.test.js.map +0 -1
  58. package/dist/test/reversal-geojson.test.js +0 -15
  59. package/dist/test/reversal-geojson.test.js.map +0 -1
  60. package/dist/test/reversal-proto.test.js +0 -54
  61. package/dist/test/reversal-proto.test.js.map +0 -1
  62. package/dist/test/stream.js +0 -10
  63. package/dist/test/stream.js.map +0 -1
  64. package/dist/test/taskings-mission.test.js +0 -140
  65. package/dist/test/taskings-mission.test.js.map +0 -1
  66. package/dist/test/util.test.js +0 -25
  67. package/dist/test/util.test.js.map +0 -1
  68. package/dist/test/validation.test.js +0 -13
  69. package/dist/test/validation.test.js.map +0 -1
  70. package/test/basemaps/Bing_Hybrid.xml +0 -12
  71. package/test/basemaps/Bing_Maps.xml +0 -10
  72. package/test/basemaps/USGSBasemap.xml +0 -10
  73. package/test/basemaps/USGSImageryOnly.xml +0 -10
  74. package/test/basemaps/USGSImageryTopo.xml +0 -10
  75. package/test/basemaps/USGSShadedRelief.xml +0 -10
  76. package/test/basemaps/opentopomap.xml +0 -10
  77. package/test/basemaps.test.ts +0 -19
  78. package/test/chat.test.ts +0 -103
  79. package/test/cot-fileshare.test.ts +0 -92
  80. package/test/cot-itak.test.ts +0 -100
  81. package/test/cot-mma.test.ts +0 -111
  82. package/test/cot-polyline.test.ts +0 -103
  83. package/test/cot-range-and-bearing.test.ts +0 -100
  84. package/test/cot-routes.test.ts +0 -468
  85. package/test/cot-types.test.ts +0 -8
  86. package/test/cot-uas-tool.test.ts +0 -295
  87. package/test/cot-video.test.ts +0 -204
  88. package/test/cot_is.test.ts +0 -431
  89. package/test/data-package.test.ts +0 -314
  90. package/test/diff.test.ts +0 -80
  91. package/test/fixtures/archived.geojson +0 -20
  92. package/test/fixtures/attachments.geojson +0 -20
  93. package/test/fixtures/basic.geojson +0 -19
  94. package/test/fixtures/circle.geojson +0 -30
  95. package/test/fixtures/color.geojson +0 -21
  96. package/test/fixtures/fileshare.geojson +0 -28
  97. package/test/fixtures/geofence.geojson +0 -25
  98. package/test/fixtures/hae.geojson +0 -19
  99. package/test/fixtures/icon.geojson +0 -20
  100. package/test/fixtures/linestring.geojson +0 -28
  101. package/test/fixtures/marti-mission.geojson +0 -22
  102. package/test/fixtures/metadata.geojson +0 -24
  103. package/test/fixtures/mission-layer.geojson +0 -31
  104. package/test/fixtures/mission.geojson +0 -25
  105. package/test/fixtures/polygon.geojson +0 -33
  106. package/test/fixtures/props.geojson +0 -22
  107. package/test/fixtures/sensor.geojson +0 -31
  108. package/test/fixtures/video-connection.geojson +0 -27
  109. package/test/fixtures/video.geojson +0 -24
  110. package/test/flow-tags.test.ts +0 -21
  111. package/test/force-delete.ts +0 -50
  112. package/test/from_geojson.test.ts +0 -323
  113. package/test/newlines.test.ts +0 -83
  114. package/test/packages/AttachmentInManifest.zip +0 -0
  115. package/test/packages/COMilePosts.zip +0 -0
  116. package/test/packages/CameraCOTs.zip +0 -0
  117. package/test/packages/QuickPic.zip +0 -0
  118. package/test/reversal-geojson.test.ts +0 -19
  119. package/test/reversal-proto.test.ts +0 -60
  120. package/test/stream.ts +0 -10
  121. package/test/taskings-mission.test.ts +0 -148
  122. package/test/util.test.ts +0 -34
  123. package/test/validation.test.ts +0 -13
@@ -1,111 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('Decode MultiMissionAircraft CoTs', (t) => {
5
- const cot = new CoT({"event":{"_attributes":{"version":"2.0","uid":"CO-DFPC-WLD27_CO-DFPC-WLD27-SPI","time":"2024-07-01T22:06:41Z","start":"2024-07-01T22:06:38Z","stale":"2024-07-01T22:06:58Z","type":"b-m-p-s-p-i","how":"m-g-n"},"point":{"_attributes":{"lat":"40.066418","lon":"-108.322413","hae":"1899.427151","ce":"9999999","le":"9999999"}},"detail":{"precisionlocation":{"_attributes":{"geopointsrc":"CALC","altsrc":"CALC"}},"contact":{"_attributes":{"name":"CO-DFPC-WLD27-SPI","callsign":"CO-DFPC-WLD27-SPI"}},"link":{"_attributes":{"uid":"CO-DFPC-WLD27_CO-DFPC-WLD27","relation":"p-p"}},"shape":{"polyline":{"_attributes":{"closed":"true","fillColor":"0","color":"-1"},"vertex":[{"_attributes":{"lat":"40.059445","lon":"-108.328368"}},{"_attributes":{"lat":"40.061846","lon":"-108.314776"}},{"_attributes":{"lat":"40.075499","lon":"-108.315566"}},{"_attributes":{"lat":"40.071252","lon":"-108.330782"}}]}},"__group":{},"_flow-tags_":{"_attributes":{"TAK-Server-e87a0e02420b44a08f6032bcf1877745":"2024-07-01T22:06:41Z"}}}}});
6
-
7
- if (!cot.raw.event.detail) {
8
- t.fail('No Detail Section')
9
- } else {
10
- t.ok(cot.raw.event.detail['_flow-tags_']);
11
- delete cot.raw.event.detail['_flow-tags_'];
12
-
13
- t.deepEquals({
14
- "event":{
15
- "_attributes":{
16
- "version":"2.0",
17
- "uid":"CO-DFPC-WLD27_CO-DFPC-WLD27-SPI",
18
- "time":"2024-07-01T22:06:41Z",
19
- "start":"2024-07-01T22:06:38Z",
20
- "stale":"2024-07-01T22:06:58Z",
21
- "type":"b-m-p-s-p-i",
22
- "how":"m-g-n"
23
- },
24
- "point":{
25
- "_attributes":{
26
- "lat":"40.066418",
27
- "lon":"-108.322413",
28
- "hae":"1899.427151",
29
- "ce":"9999999",
30
- "le":"9999999"
31
- }
32
- },
33
- "detail":{
34
- "precisionlocation":{
35
- "_attributes":{
36
- "geopointsrc":"CALC",
37
- "altsrc":"CALC"
38
- }
39
- },
40
- "contact":{
41
- "_attributes":{
42
- "name":"CO-DFPC-WLD27-SPI",
43
- "callsign":"CO-DFPC-WLD27-SPI"
44
- }
45
- },
46
- "link":{
47
- "_attributes": {
48
- "uid":"CO-DFPC-WLD27_CO-DFPC-WLD27",
49
- "relation":"p-p"
50
- }
51
- },
52
- "shape":{
53
- "polyline":{
54
- "_attributes":{
55
- "closed":true,
56
- "fillColor":"0",
57
- "color":"-1"
58
- },
59
- "vertex":[
60
- {"_attributes":{"lat":40.059445,"lon":-108.328368}},
61
- {"_attributes":{"lat":40.061846,"lon":-108.314776}},
62
- {"_attributes":{"lat":40.075499,"lon":-108.315566}},
63
- {"_attributes":{"lat":40.071252,"lon":-108.330782}}
64
- ]
65
- }
66
- },
67
- "__group":{},
68
- }
69
- }
70
- }, cot.raw);
71
-
72
- t.deepEquals({
73
- id: 'CO-DFPC-WLD27_CO-DFPC-WLD27-SPI',
74
- type: 'Feature',
75
- path: '/',
76
- properties: {
77
- callsign: 'CO-DFPC-WLD27-SPI',
78
- type: 'b-m-p-s-p-i',
79
- how: 'm-g-n',
80
- center: [ -108.322413, 40.066418, 1899.427151 ],
81
- fill: "#000000",
82
- "fill-opacity": 0,
83
- stroke: "#FFFFFF",
84
- "stroke-opacity": 1,
85
- time: '2024-07-01T22:06:41Z',
86
- start: '2024-07-01T22:06:38Z',
87
- stale: '2024-07-01T22:06:58Z',
88
- contact: {
89
- name: "CO-DFPC-WLD27-SPI"
90
- },
91
- metadata: {},
92
- precisionlocation: {
93
- "geopointsrc": "CALC",
94
- "altsrc": "CALC"
95
- },
96
- },
97
- geometry: {
98
- type: 'Polygon',
99
- coordinates: [ [
100
- [ -108.328368, 40.059445 ],
101
- [ -108.314776, 40.061846 ],
102
- [ -108.315566, 40.075499 ],
103
- [ -108.330782, 40.071252 ],
104
- [ -108.328368, 40.059445 ],
105
- ] ]
106
- }
107
- }, cot.to_geojson());
108
- }
109
-
110
- t.end();
111
- });
@@ -1,103 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('En-decode polyline', (t) => {
5
- const cot = new CoT({
6
- "event": {
7
- "_attributes": {
8
- "version": "2.0",
9
- "uid": "ebbf42a7-ea71-43a1-baf6-e259c3d115bf",
10
- "type": "u-rb-a",
11
- "how": "h-e",
12
- "time": "2024-08-30T22:28:02Z",
13
- "start": "2024-08-30T22:28:02Z",
14
- "stale": "2024-08-31T22:28:02Z",
15
- "access": "Undefined"
16
- },
17
- "point": {
18
- "_attributes": {
19
- "lat": "39.0981196",
20
- "lon": "-108.7395013",
21
- "hae": "0.0",
22
- "ce": "9999999.0",
23
- "le": "9999999.0"
24
- }
25
- },
26
- "detail": {
27
- "contact": {
28
- "_attributes": {
29
- "callsign": "c"
30
- }
31
- },
32
- "shape": {
33
- "polyline": {
34
- "vertex": [
35
- { "_attributes": { "lat": 47.7047674, "lon": -122.17861 } },
36
- {
37
- "_attributes": { "lat": 47.71376061012636, "lon": -122.17861 }
38
- },
39
- {
40
- "_attributes": { "lat": 47.7047674, "lon": -122.16524615319642 }
41
- },
42
- {
43
- "_attributes": { "lat": 47.695774189873646, "lon": -122.17861 }
44
- },
45
- { "_attributes": { "lat": 47.7047674, "lon": -122.17861 } }
46
- ],
47
- "_attributes": { "closed": true }
48
- }
49
- }
50
- }
51
- }
52
- })
53
-
54
- const cot2 = CoT.from_proto(cot.to_proto())
55
- const vertex = cot2.raw.event.detail?.shape?.polyline?.vertex
56
- t.ok(Array.isArray(vertex) && vertex.length === 5)
57
-
58
- t.end();
59
- });
60
-
61
- test('En-decode 0-length polyline', (t) => {
62
- const cot3 = new CoT({
63
- "event": {
64
- "_attributes": {
65
- "version": "2.0",
66
- "uid": "ebbf42a7-ea71-43a1-baf6-e259c3d115bf",
67
- "type": "u-rb-a",
68
- "how": "h-e",
69
- "time": "2024-08-30T22:28:02Z",
70
- "start": "2024-08-30T22:28:02Z",
71
- "stale": "2024-08-31T22:28:02Z",
72
- "access": "Undefined"
73
- },
74
- "point": {
75
- "_attributes": {
76
- "lat": "39.0981196",
77
- "lon": "-108.7395013",
78
- "hae": "0.0",
79
- "ce": "9999999.0",
80
- "le": "9999999.0"
81
- }
82
- },
83
- "detail": {
84
- "contact": {
85
- "_attributes": {
86
- "callsign": "c"
87
- }
88
- },
89
- "shape": {
90
- "polyline": {
91
- "vertex": [],
92
- }
93
- }
94
- }
95
- }
96
- })
97
-
98
- // xml en-decoding looses empty array, but should work.
99
- const cot4 = CoT.from_proto(cot3.to_proto())
100
- t.ok(cot4.raw.event.detail?.shape?.polyline)
101
-
102
- t.end();
103
- });
@@ -1,100 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('Decode Range & Bearing', (t) => {
5
- const cot = new CoT({
6
- "event": {
7
- "_attributes": {
8
- "version": "2.0",
9
- "uid": "ebbf42a7-ea71-43a1-baf6-e259c3d115bf",
10
- "type": "u-rb-a",
11
- "how": "h-e",
12
- "time": "2024-08-30T22:28:02Z",
13
- "start": "2024-08-30T22:28:02Z",
14
- "stale": "2024-08-31T22:28:02Z",
15
- "access": "Undefined"
16
- },
17
- "point": {
18
- "_attributes": {
19
- "lat": "39.0981196",
20
- "lon": "-108.7395013",
21
- "hae": "0.0",
22
- "ce": "9999999.0",
23
- "le": "9999999.0"
24
- }
25
- },
26
- "detail": {
27
- "contact": {
28
- "_attributes": {
29
- "callsign": "R&B 1"
30
- }
31
- },
32
- "range": {
33
- "_attributes": {
34
- "value": "14806.869682096987"
35
- }
36
- },
37
- "bearing": { "_attributes": { "value": "102.28151464168589" } },
38
- "inclination": { "_attributes": { "value": "5.373568186490131" } },
39
- "rangeUnits": { "_attributes": { "value": "0" } },
40
- "bearingUnits": { "_attributes": { "value": "0" } },
41
- "northRef": { "_attributes": { "value": "1" } },
42
- "strokeColor": { "_attributes": { "value": "-65536" } },
43
- "strokeWeight": { "_attributes": { "value": "3.0" } },
44
- "strokeStyle": { "_attributes": { "value": "solid" } },
45
- "remarks": {},
46
- "labels_on": { "_attributes": { "value": "false" } },
47
- "archive": {},
48
- "link": {
49
- "_attributes": {
50
- "uid": "ANDROID-0ca41830e11d2ef3",
51
- "production_time": "2024-08-30T22:26:28.264Z",
52
- "type": "a-f-G-E-V-C",
53
- "parent_callsign": "DFPC Ingalls Tab",
54
- "relation": "p-p"
55
- }
56
- },
57
- "color": {
58
- "_attributes": {
59
- "value": "-65536"
60
- }
61
- },
62
- "_flow-tags_": {
63
- "_attributes": {
64
- "TAK-Server-e87a0e02420b44a08f6032bcf1877745": "2024-08-30T22:28:02Z"
65
- }
66
- }
67
- }
68
- }
69
- })
70
-
71
- if (!cot.raw.event.detail) {
72
- t.fail('No Detail Section')
73
- } else {
74
- t.ok(cot.raw.event.detail['_flow-tags_']);
75
- delete cot.raw.event.detail['_flow-tags_'];
76
-
77
- t.deepEquals({
78
- id: 'ebbf42a7-ea71-43a1-baf6-e259c3d115bf',
79
- type: 'Feature',
80
- path: '/',
81
- properties: {
82
- archived: true,
83
- callsign: 'R&B 1',
84
- center: [ -108.7395013, 39.0981196, 0 ],
85
- type: 'u-rb-a',
86
- how: 'h-e',
87
- time: '2024-08-30T22:28:02Z',
88
- start: '2024-08-30T22:28:02Z',
89
- stale: '2024-08-31T22:28:02Z',
90
- metadata: {}
91
- },
92
- geometry: {
93
- type: 'Point',
94
- coordinates: [ -108.7395013, 39.0981196, 0 ]
95
- }
96
- }, cot.to_geojson());
97
- }
98
-
99
- t.end();
100
- });