@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.
- package/CHANGELOG.md +8 -0
- package/dist/lib/data-package.js +64 -16
- package/dist/lib/data-package.js.map +1 -1
- package/dist/lib/types/feature.js +1 -1
- package/dist/lib/types/feature.js.map +1 -1
- package/dist/lib/types/iconset.js +12 -4
- package/dist/lib/types/iconset.js.map +1 -1
- package/dist/lib/xml/basemap.js +1 -1
- package/dist/lib/xml/basemap.js.map +1 -1
- package/dist/lib/xml/iconset.js +29 -2
- package/dist/lib/xml/iconset.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/data-package.ts +70 -17
- package/lib/types/feature.ts +1 -1
- package/lib/types/iconset.ts +14 -4
- package/lib/xml/basemap.ts +2 -2
- package/lib/xml/iconset.ts +36 -3
- package/lib/xml-document.ts +1 -1
- package/package.json +1 -1
- package/tsconfig.json +1 -0
- package/dist/test/basemaps.test.js +0 -16
- package/dist/test/basemaps.test.js.map +0 -1
- package/dist/test/chat.test.js +0 -97
- package/dist/test/chat.test.js.map +0 -1
- package/dist/test/cot-fileshare.test.js +0 -89
- package/dist/test/cot-fileshare.test.js.map +0 -1
- package/dist/test/cot-itak.test.js +0 -95
- package/dist/test/cot-itak.test.js.map +0 -1
- package/dist/test/cot-mma.test.js +0 -108
- package/dist/test/cot-mma.test.js.map +0 -1
- package/dist/test/cot-polyline.test.js +0 -98
- package/dist/test/cot-polyline.test.js.map +0 -1
- package/dist/test/cot-range-and-bearing.test.js +0 -98
- package/dist/test/cot-range-and-bearing.test.js.map +0 -1
- package/dist/test/cot-routes.test.js +0 -466
- package/dist/test/cot-routes.test.js.map +0 -1
- package/dist/test/cot-types.test.js +0 -7
- package/dist/test/cot-types.test.js.map +0 -1
- package/dist/test/cot-uas-tool.test.js +0 -286
- package/dist/test/cot-uas-tool.test.js.map +0 -1
- package/dist/test/cot-video.test.js +0 -196
- package/dist/test/cot-video.test.js.map +0 -1
- package/dist/test/cot_is.test.js +0 -353
- package/dist/test/cot_is.test.js.map +0 -1
- package/dist/test/data-package.test.js +0 -234
- package/dist/test/data-package.test.js.map +0 -1
- package/dist/test/diff.test.js +0 -73
- package/dist/test/diff.test.js.map +0 -1
- package/dist/test/flow-tags.test.js +0 -19
- package/dist/test/flow-tags.test.js.map +0 -1
- package/dist/test/force-delete.js +0 -46
- package/dist/test/force-delete.js.map +0 -1
- package/dist/test/from_geojson.test.js +0 -287
- package/dist/test/from_geojson.test.js.map +0 -1
- package/dist/test/newlines.test.js +0 -79
- package/dist/test/newlines.test.js.map +0 -1
- package/dist/test/reversal-geojson.test.js +0 -15
- package/dist/test/reversal-geojson.test.js.map +0 -1
- package/dist/test/reversal-proto.test.js +0 -54
- package/dist/test/reversal-proto.test.js.map +0 -1
- package/dist/test/stream.js +0 -10
- package/dist/test/stream.js.map +0 -1
- package/dist/test/taskings-mission.test.js +0 -140
- package/dist/test/taskings-mission.test.js.map +0 -1
- package/dist/test/util.test.js +0 -25
- package/dist/test/util.test.js.map +0 -1
- package/dist/test/validation.test.js +0 -13
- package/dist/test/validation.test.js.map +0 -1
- package/test/basemaps/Bing_Hybrid.xml +0 -12
- package/test/basemaps/Bing_Maps.xml +0 -10
- package/test/basemaps/USGSBasemap.xml +0 -10
- package/test/basemaps/USGSImageryOnly.xml +0 -10
- package/test/basemaps/USGSImageryTopo.xml +0 -10
- package/test/basemaps/USGSShadedRelief.xml +0 -10
- package/test/basemaps/opentopomap.xml +0 -10
- package/test/basemaps.test.ts +0 -19
- package/test/chat.test.ts +0 -103
- package/test/cot-fileshare.test.ts +0 -92
- package/test/cot-itak.test.ts +0 -100
- package/test/cot-mma.test.ts +0 -111
- package/test/cot-polyline.test.ts +0 -103
- package/test/cot-range-and-bearing.test.ts +0 -100
- package/test/cot-routes.test.ts +0 -468
- package/test/cot-types.test.ts +0 -8
- package/test/cot-uas-tool.test.ts +0 -295
- package/test/cot-video.test.ts +0 -204
- package/test/cot_is.test.ts +0 -431
- package/test/data-package.test.ts +0 -314
- package/test/diff.test.ts +0 -80
- package/test/fixtures/archived.geojson +0 -20
- package/test/fixtures/attachments.geojson +0 -20
- package/test/fixtures/basic.geojson +0 -19
- package/test/fixtures/circle.geojson +0 -30
- package/test/fixtures/color.geojson +0 -21
- package/test/fixtures/fileshare.geojson +0 -28
- package/test/fixtures/geofence.geojson +0 -25
- package/test/fixtures/hae.geojson +0 -19
- package/test/fixtures/icon.geojson +0 -20
- package/test/fixtures/linestring.geojson +0 -28
- package/test/fixtures/marti-mission.geojson +0 -22
- package/test/fixtures/metadata.geojson +0 -24
- package/test/fixtures/mission-layer.geojson +0 -31
- package/test/fixtures/mission.geojson +0 -25
- package/test/fixtures/polygon.geojson +0 -33
- package/test/fixtures/props.geojson +0 -22
- package/test/fixtures/sensor.geojson +0 -31
- package/test/fixtures/video-connection.geojson +0 -27
- package/test/fixtures/video.geojson +0 -24
- package/test/flow-tags.test.ts +0 -21
- package/test/force-delete.ts +0 -50
- package/test/from_geojson.test.ts +0 -323
- package/test/newlines.test.ts +0 -83
- package/test/packages/AttachmentInManifest.zip +0 -0
- package/test/packages/COMilePosts.zip +0 -0
- package/test/packages/CameraCOTs.zip +0 -0
- package/test/packages/QuickPic.zip +0 -0
- package/test/reversal-geojson.test.ts +0 -19
- package/test/reversal-proto.test.ts +0 -60
- package/test/stream.ts +0 -10
- package/test/taskings-mission.test.ts +0 -148
- package/test/util.test.ts +0 -34
- package/test/validation.test.ts +0 -13
package/test/cot-mma.test.ts
DELETED
|
@@ -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
|
-
});
|