@tak-ps/node-cot 12.0.0 → 12.2.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 (67) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +11 -3
  3. package/dist/index.js +4 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/basemap.js +31 -0
  6. package/dist/lib/basemap.js.map +1 -0
  7. package/dist/lib/chat.js +1 -1
  8. package/dist/lib/chat.js.map +1 -1
  9. package/dist/lib/cot.js +5 -5
  10. package/dist/lib/cot.js.map +1 -1
  11. package/dist/lib/fileshare.js +1 -1
  12. package/dist/lib/fileshare.js.map +1 -1
  13. package/dist/lib/force-delete.js +1 -1
  14. package/dist/lib/force-delete.js.map +1 -1
  15. package/dist/lib/types/basemap.js +28 -0
  16. package/dist/lib/types/basemap.js.map +1 -0
  17. package/dist/lib/types/cot-types.js.map +1 -0
  18. package/dist/lib/types/feature.js.map +1 -0
  19. package/dist/lib/{types.js → types/types.js} +35 -0
  20. package/dist/lib/types/types.js.map +1 -0
  21. package/dist/lib/utils/color.js.map +1 -0
  22. package/dist/lib/utils/util.js.map +1 -0
  23. package/dist/package.json +2 -2
  24. package/dist/test/basemaps.test.js +14 -0
  25. package/dist/test/basemaps.test.js.map +1 -0
  26. package/dist/test/cot-routes.test.js +465 -0
  27. package/dist/test/cot-routes.test.js.map +1 -0
  28. package/dist/test/util.test.js +1 -1
  29. package/dist/test/util.test.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -0
  31. package/index.ts +4 -3
  32. package/lib/basemap.ts +36 -0
  33. package/lib/chat.ts +2 -2
  34. package/lib/cot.ts +7 -7
  35. package/lib/fileshare.ts +3 -3
  36. package/lib/force-delete.ts +2 -2
  37. package/lib/types/basemap.ts +29 -0
  38. package/lib/{types.ts → types/types.ts} +43 -0
  39. package/lib/{util.ts → utils/util.ts} +1 -1
  40. package/package.json +2 -2
  41. package/test/basemaps/Bing_Hybrid.xml +12 -0
  42. package/test/basemaps/Bing_Maps.xml +10 -0
  43. package/test/basemaps/USGSBasemap.xml +10 -0
  44. package/test/basemaps/USGSImageryOnly.xml +10 -0
  45. package/test/basemaps/USGSImageryTopo.xml +10 -0
  46. package/test/basemaps/USGSShadedRelief.xml +10 -0
  47. package/test/basemaps/opentopomap.xml +10 -0
  48. package/test/basemaps.test.ts +16 -0
  49. package/test/cot-routes.test.ts +467 -0
  50. package/test/reversal-geojson.test.ts +1 -1
  51. package/test/reversal-proto.test.ts +1 -1
  52. package/test/util.test.ts +1 -1
  53. package/tsconfig.json +1 -0
  54. package/dist/lib/color.js.map +0 -1
  55. package/dist/lib/cot-types.js.map +0 -1
  56. package/dist/lib/feature.js.map +0 -1
  57. package/dist/lib/types.js.map +0 -1
  58. package/dist/lib/util.js.map +0 -1
  59. /package/dist/lib/{cot-types.js → types/cot-types.js} +0 -0
  60. /package/dist/lib/{cot-types.xml → types/cot-types.xml} +0 -0
  61. /package/dist/lib/{feature.js → types/feature.js} +0 -0
  62. /package/dist/lib/{color.js → utils/color.js} +0 -0
  63. /package/dist/lib/{util.js → utils/util.js} +0 -0
  64. /package/lib/{cot-types.ts → types/cot-types.ts} +0 -0
  65. /package/lib/{cot-types.xml → types/cot-types.xml} +0 -0
  66. /package/lib/{feature.ts → types/feature.ts} +0 -0
  67. /package/lib/{color.ts → utils/color.ts} +0 -0
@@ -58,6 +58,46 @@ export const Link = Type.Object({
58
58
  _attributes: LinkAttributes
59
59
  })
60
60
 
61
+ // Ref: https://git.tak.gov/standards/takcot/-/blob/master/xsd/Route.xsd
62
+ export const LinkAttrRouteFil = Type.Enum({
63
+ Infil: 'Infil',
64
+ Exfil: 'Exfil'
65
+ });
66
+
67
+ export const LinkAttrRouteMethod = Type.Enum({
68
+ Driving: 'Driving',
69
+ Walking: 'Walking',
70
+ Flying: 'Flying',
71
+ Swimming: 'Swimming',
72
+ Watercraft: 'Watercraft'
73
+ });
74
+
75
+ export const LinkAttrRouteType = Type.Enum({
76
+ Primary: 'Primary',
77
+ Secondary: 'Secondary',
78
+ });
79
+
80
+ export const LinkAttrRouteOrder = Type.Enum({
81
+ Ascending: 'Ascending Check Points',
82
+ Descending: 'Descending Check Points',
83
+ });
84
+
85
+ export const LinkAttrAttributes = Type.Object({
86
+ planningmethod: Type.Optional(LinkAttrRouteFil),
87
+ color: Type.Optional(Type.Integer()),
88
+ method: LinkAttrRouteMethod,
89
+ prefix: Type.String(),
90
+ stroke: Type.Optional(Type.String()),
91
+ type: Type.Optional(Type.String()),
92
+ routetype: LinkAttrRouteType,
93
+ direction: Type.Optional(LinkAttrRouteFil),
94
+ order: LinkAttrRouteOrder
95
+ })
96
+
97
+ export const LinkAttr = Type.Object({
98
+ _attributes: LinkAttrAttributes
99
+ })
100
+
61
101
  export const ProtocolSupportAttributes = Type.Object({
62
102
  _attributes: Type.Optional(Type.Object({
63
103
  version: Type.Optional(Type.String())
@@ -436,7 +476,10 @@ export const Detail = Type.Object({
436
476
  fillColor: Type.Optional(GenericAttributes),
437
477
  mission: Type.Optional(Mission),
438
478
  shape: Type.Optional(Shape),
479
+
439
480
  link: Type.Optional(Type.Union([Link, Type.Array(Link)])),
481
+ link_attr: Type.Optional(LinkAttr),
482
+
440
483
  usericon: Type.Optional(UserIcon),
441
484
  track: Type.Optional(Track),
442
485
  sensor: Type.Optional(Sensor),
@@ -5,7 +5,7 @@ import type {
5
5
  TrackAttributes,
6
6
  Detail,
7
7
  Point
8
- } from './types.js';
8
+ } from '../types/types.js';
9
9
 
10
10
  /**
11
11
  * Helper functions for generating CoT data
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/node-cot",
3
3
  "type": "module",
4
- "version": "12.0.0",
4
+ "version": "12.2.0",
5
5
  "description": "Lightweight JavaScript library for parsing and manipulating TAK messages",
6
6
  "author": "Nick Ingalls <nick@ingalls.ca>",
7
7
  "main": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "test": "ts-node-test test/",
11
11
  "lint": "eslint *.ts lib/ test/",
12
12
  "doc": "typedoc index.ts",
13
- "build": "tsc --build && cp package.json dist/ && cp ./lib/*.xml ./dist/lib/ && mkdir -p ./dist/lib/proto/ && cp lib/proto/* ./dist/lib/proto/",
13
+ "build": "tsc --build && cp package.json dist/ && cp ./lib/types/*.xml ./dist/lib/types/ && mkdir -p ./dist/lib/proto/ && cp lib/proto/* ./dist/lib/proto/",
14
14
  "pretest": "npm run lint"
15
15
  },
16
16
  "dependencies": {
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <customMapSource>
3
+ <name>Bing Hybrid</name>
4
+ <minZoom>0</minZoom>
5
+ <maxZoom>20</maxZoom>
6
+ <tileType>png</tileType>
7
+ <url>https://ecn.t2.tiles.virtualearth.net/tiles/h{$q}?g=761&amp;mkt=en-us</url>
8
+ <tileUpdate>None</tileUpdate>
9
+ <backgroundColor>#000000</backgroundColor>
10
+ <ignoreErrors>false</ignoreErrors>
11
+ <serverParts />
12
+ </customMapSource>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <customMapSource>
3
+ <name>Bing Street</name>
4
+ <minZoom>0</minZoom>
5
+ <maxZoom>20</maxZoom>
6
+ <tileType>png</tileType>
7
+ <tileUpdate>None</tileUpdate>
8
+ <url>https://r0.ortho.tiles.virtualearth.net/tiles/r{$q}.png?g=45</url>
9
+ <backgroundColor>#000000</backgroundColor>
10
+ </customMapSource>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <customMapSource>
3
+ <name>USGS</name>
4
+ <minZoom>0</minZoom>
5
+ <maxZoom>15</maxZoom>
6
+ <tileType>png</tileType>
7
+ <tileUpdate>None</tileUpdate>
8
+ <url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSTopo/MapServer/tile/{$z}/{$y}/{$x}</url>
9
+ <backgroundColor>#000000</backgroundColor>
10
+ </customMapSource>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <customMapSource>
3
+ <name>USGSImageryOnly</name>
4
+ <minZoom>0</minZoom>
5
+ <maxZoom>15</maxZoom>
6
+ <tileType>png</tileType>
7
+ <tileUpdate>None</tileUpdate>
8
+ <url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/{$z}/{$y}/{$x}</url>
9
+ <backgroundColor>#000000</backgroundColor>
10
+ </customMapSource>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <customMapSource>
3
+ <name>USGSImageryTopo</name>
4
+ <minZoom>0</minZoom>
5
+ <maxZoom>15</maxZoom>
6
+ <tileType>png</tileType>
7
+ <tileUpdate>None</tileUpdate>
8
+ <url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryTopo/MapServer/tile/{$z}/{$y}/{$x}</url>
9
+ <backgroundColor>#000000</backgroundColor>
10
+ </customMapSource>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <customMapSource>
3
+ <name>USGSShadedRelief</name>
4
+ <minZoom>0</minZoom>
5
+ <maxZoom>15</maxZoom>
6
+ <tileType>png</tileType>
7
+ <tileUpdate>None</tileUpdate>
8
+ <url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/tile/{$z}/{$y}/{$x}</url>
9
+ <backgroundColor>#000000</backgroundColor>
10
+ </customMapSource>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <customMapSource>
3
+ <name>Open Topo Map</name>
4
+ <minZoom>1</minZoom>
5
+ <maxZoom>17</maxZoom>
6
+ <tileType>PNG</tileType>
7
+ <tileUpdate>IfNoneMatch</tileUpdate>
8
+ <serverParts>a b c</serverParts>
9
+ <url>https://{$serverpart}.tile.opentopomap.org/{$z}/{$x}/{$y}.png</url>
10
+ </customMapSource>
@@ -0,0 +1,16 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import test from 'tape';
4
+ import { Basemap } from '../index.js';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ for (const fixturename of await fs.readdir(new URL('./basemaps/', import.meta.url))) {
8
+ test(`Basemap Test: ${fixturename}`, async (t) => {
9
+ const fixture = String(await fs.readFile(path.join(path.parse(fileURLToPath(import.meta.url)).dir, 'basemaps/', fixturename)));
10
+ const container = await Basemap.parse(fixture);
11
+
12
+ t.ok(container.basemap.customMapSource.name._text.length)
13
+
14
+ t.end();
15
+ });
16
+ }
@@ -0,0 +1,467 @@
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": "6da80127-44d4-4bf0-89bd-ecd326afaef1",
10
+ "type": "b-m-r",
11
+ "how": "h-g-i-g-o",
12
+ "time": "2024-09-09T21:53:57Z",
13
+ "start": "2024-09-09T07:28:38Z",
14
+ "stale": "2024-09-09T07:28:38Z"
15
+ },
16
+ "point": {
17
+ "_attributes": {
18
+ "lat": "0.0",
19
+ "lon": "0.0",
20
+ "hae": "9999999.0",
21
+ "ce": "9999999.0",
22
+ "le": "9999999.0"
23
+ }
24
+ },
25
+ "detail": {
26
+ "contact": {
27
+ "_attributes": {
28
+ "callsign": "Walking Alt Route 5"
29
+ }
30
+ },
31
+ "precisionlocation": {
32
+ "_attributes": {
33
+ "geopointsrc": "???",
34
+ "altsrc": "???"
35
+ }
36
+ },
37
+ "link": [
38
+ {
39
+ "_attributes": {
40
+ "uid": "d12c21b6-aabc-4c59-86aa-fac826d14585",
41
+ "callsign": "Walking Alt Route 5 SP",
42
+ "type": "b-m-p-w",
43
+ "point": "38.5144413169673,-108.547391197293"
44
+ }
45
+ },
46
+ {
47
+ "_attributes": {
48
+ "uid": "89a483a4-571b-497c-8763-cfaba6cbb858",
49
+ "callsign": "",
50
+ "type": "b-m-p-c",
51
+ "point": "38.5149532310605,-108.546923921927"
52
+ }
53
+ },
54
+ {
55
+ "_attributes": {
56
+ "uid": "02068dff-ebdc-44b2-a99c-f9991e7c7759",
57
+ "callsign": "",
58
+ "type": "b-m-p-c",
59
+ "point": "38.5150249333408,-108.546926767992"
60
+ }
61
+ },
62
+ {
63
+ "_attributes": {
64
+ "uid": "8c921804-779a-404f-8ef0-428325bc60fc",
65
+ "callsign": "",
66
+ "type": "b-m-p-c",
67
+ "point": "38.5151394174434,-108.546895974379"
68
+ }
69
+ },
70
+ {
71
+ "_attributes": {
72
+ "uid": "60b13bf0-8c57-4786-b694-81201629e1c5",
73
+ "callsign": "",
74
+ "type": "b-m-p-c",
75
+ "point": "38.5151803514502,-108.546844612187"
76
+ }
77
+ },
78
+ {
79
+ "_attributes": {
80
+ "uid": "fd2b6974-a3f0-4892-b140-98a2a87d2013",
81
+ "callsign": "",
82
+ "type": "b-m-p-c",
83
+ "point": "38.5152636957219,-108.546651915511"
84
+ }
85
+ },
86
+ {
87
+ "_attributes": {
88
+ "uid": "cb25f65e-1578-4fd7-8a0c-3476aba257c8",
89
+ "callsign": "",
90
+ "type": "b-m-p-c",
91
+ "point": "38.515552834564,-108.546310782148"
92
+ }
93
+ },
94
+ {
95
+ "_attributes": {
96
+ "uid": "18b9688d-1569-4c81-898f-28e70ad606bf",
97
+ "callsign": "",
98
+ "type": "b-m-p-c",
99
+ "point": "38.5157638654036,-108.546167031945"
100
+ }
101
+ },
102
+ {
103
+ "_attributes": {
104
+ "uid": "113acbcd-e3f8-46c1-b7c2-770b906a788d",
105
+ "callsign": "",
106
+ "type": "b-m-p-c",
107
+ "point": "38.5158532626694,-108.54609208104"
108
+ }
109
+ },
110
+ {
111
+ "_attributes": {
112
+ "uid": "52a1510b-dcd4-4f70-94e1-b8134ca29a3a",
113
+ "callsign": "",
114
+ "type": "b-m-p-c",
115
+ "point": "38.515905780664,-108.546076056876"
116
+ }
117
+ },
118
+ {
119
+ "_attributes": {
120
+ "uid": "86a51fa0-172d-4fda-98ea-ee942ad0eb3b",
121
+ "callsign": "",
122
+ "type": "b-m-p-c",
123
+ "point": "38.5160187860381,-108.54597316944"
124
+ }
125
+ },
126
+ {
127
+ "_attributes": {
128
+ "uid": "70159eb3-76ff-46b3-9b2b-1deaa2b2d184",
129
+ "callsign": "",
130
+ "type": "b-m-p-c",
131
+ "point": "38.5160564186505,-108.545938100192"
132
+ }
133
+ },
134
+ {
135
+ "_attributes": {
136
+ "uid": "f5ccd2e8-e8f7-4d50-8ad2-3942c4533a02",
137
+ "callsign": "",
138
+ "type": "b-m-p-c",
139
+ "point": "38.5160748431091,-108.545892411714"
140
+ }
141
+ },
142
+ {
143
+ "_attributes": {
144
+ "uid": "d516ce2b-7df2-4c03-b173-ec7ccdbb8478",
145
+ "callsign": "",
146
+ "type": "b-m-p-c",
147
+ "point": "38.5163298746682,-108.545661962771"
148
+ }
149
+ },
150
+ {
151
+ "_attributes": {
152
+ "uid": "429be532-07ba-48c8-b513-ef7bac76d028",
153
+ "callsign": "",
154
+ "type": "b-m-p-c",
155
+ "point": "38.5164957921584,-108.545458235843"
156
+ }
157
+ },
158
+ {
159
+ "_attributes": {
160
+ "uid": "e34b7f29-612b-419b-9724-f4ad5da53e2d",
161
+ "callsign": "",
162
+ "type": "b-m-p-c",
163
+ "point": "38.5166222378823,-108.545275877858"
164
+ }
165
+ },
166
+ {
167
+ "_attributes": {
168
+ "uid": "9726f118-c51d-4e21-83c7-badb0c65e60c",
169
+ "callsign": "",
170
+ "type": "b-m-p-c",
171
+ "point": "38.5167698285131,-108.544850396656"
172
+ }
173
+ },
174
+ {
175
+ "_attributes": {
176
+ "uid": "5c3f4891-a0b2-4143-9c0f-37d3d428e892",
177
+ "callsign": "",
178
+ "type": "b-m-p-c",
179
+ "point": "38.5168808127812,-108.54462357225"
180
+ }
181
+ },
182
+ {
183
+ "_attributes": {
184
+ "uid": "7113e124-f7d4-4848-b7d9-d5bb38df336f",
185
+ "callsign": "",
186
+ "type": "b-m-p-c",
187
+ "point": "38.5170064645084,-108.544504597929"
188
+ }
189
+ },
190
+ {
191
+ "_attributes": {
192
+ "uid": "4725ba21-6fcc-455e-aecb-7882046226a5",
193
+ "callsign": "",
194
+ "type": "b-m-p-c",
195
+ "point": "38.5171414968795,-108.544303302554"
196
+ }
197
+ },
198
+ {
199
+ "_attributes": {
200
+ "uid": "26934743-a721-4768-ba2d-0e97a254bd45",
201
+ "callsign": "",
202
+ "type": "b-m-p-c",
203
+ "point": "38.5172291006172,-108.544236333091"
204
+ }
205
+ },
206
+ {
207
+ "_attributes": {
208
+ "uid": "74d82143-89dd-49ea-8053-31d5f0f8ed1e",
209
+ "callsign": "",
210
+ "type": "b-m-p-c",
211
+ "point": "38.5173173331109,-108.544165746257"
212
+ }
213
+ },
214
+ {
215
+ "_attributes": {
216
+ "uid": "4ae15ac5-5839-4cc3-b712-67e9838d0014",
217
+ "callsign": "",
218
+ "type": "b-m-p-c",
219
+ "point": "38.5174202795084,-108.543976946151"
220
+ }
221
+ },
222
+ {
223
+ "_attributes": {
224
+ "uid": "aa7ba4d0-b691-4f18-a3ed-d1a187fff88f",
225
+ "callsign": "",
226
+ "type": "b-m-p-c",
227
+ "point": "38.5175036227552,-108.543831758696"
228
+ }
229
+ },
230
+ {
231
+ "_attributes": {
232
+ "uid": "c506c4e3-9915-4131-88b3-048b948d08f2",
233
+ "callsign": "",
234
+ "type": "b-m-p-c",
235
+ "point": "38.517613542356,-108.543661143095"
236
+ }
237
+ },
238
+ {
239
+ "_attributes": {
240
+ "uid": "01e7a819-668c-4274-9d90-ac055c4da54a",
241
+ "callsign": "",
242
+ "type": "b-m-p-c",
243
+ "point": "38.5178962265508,-108.543325809711"
244
+ }
245
+ },
246
+ {
247
+ "_attributes": {
248
+ "uid": "eae6be64-4e3d-4291-b4ea-d8f713ea2205",
249
+ "callsign": "",
250
+ "type": "b-m-p-c",
251
+ "point": "38.5179179531849,-108.542564835311"
252
+ }
253
+ },
254
+ {
255
+ "_attributes": {
256
+ "uid": "a121deed-8249-4a49-8e56-46a6d9eda53f",
257
+ "callsign": "",
258
+ "type": "b-m-p-c",
259
+ "point": "38.5179294427309,-108.542459293982"
260
+ }
261
+ },
262
+ {
263
+ "_attributes": {
264
+ "uid": "14666337-5cd0-4b1a-955e-cdc4b78fb612",
265
+ "callsign": "",
266
+ "type": "b-m-p-c",
267
+ "point": "38.5179693454348,-108.542373804005"
268
+ }
269
+ },
270
+ {
271
+ "_attributes": {
272
+ "uid": "b4d50ece-d5e9-410b-9938-87da3e6e13d5",
273
+ "callsign": "",
274
+ "point": "38.518518678155,-108.538496613518"
275
+ }
276
+ },
277
+ {
278
+ "_attributes": {
279
+ "uid": "14bbf100-e5cf-423e-9757-edede63f8aeb",
280
+ "callsign": "",
281
+ "type": "b-m-p-c",
282
+ "point": "38.5184750672752,-108.538285083453"
283
+ }
284
+ },
285
+ {
286
+ "_attributes": {
287
+ "uid": "220654a4-be29-4537-93f2-d9dd3a0f8c29",
288
+ "callsign": "",
289
+ "type": "b-m-p-c",
290
+ "point": "38.5184905316775,-108.538071195872"
291
+ }
292
+ },
293
+ {
294
+ "_attributes": {
295
+ "uid": "de932406-0ce6-49d7-8867-18e85395a88a",
296
+ "callsign": "",
297
+ "type": "b-m-p-c",
298
+ "point": "38.5185637113729,-108.537919778987"
299
+ }
300
+ },
301
+ {
302
+ "_attributes": {
303
+ "uid": "52dbaa28-736c-4409-8b1e-ae73e6655688",
304
+ "callsign": "",
305
+ "type": "b-m-p-c",
306
+ "point": "38.5185823219668,-108.537699998988"
307
+ }
308
+ },
309
+ {
310
+ "_attributes": {
311
+ "uid": "44f53570-4ef1-4076-a7e3-f203912c2675",
312
+ "callsign": "",
313
+ "type": "b-m-p-c",
314
+ "point": "38.5186577706628,-108.537545754848"
315
+ }
316
+ },
317
+ {
318
+ "_attributes": {
319
+ "uid": "91c705e6-6052-4cc2-9cd1-0bdd32fb9620",
320
+ "callsign": "",
321
+ "type": "b-m-p-c",
322
+ "point": "38.5187507810887,-108.537197876139"
323
+ }
324
+ },
325
+ {
326
+ "_attributes": {
327
+ "uid": "9c51a2e0-651f-487e-955f-c4723f57c676",
328
+ "callsign": "",
329
+ "type": "b-m-p-c",
330
+ "point": "38.5187772046473,-108.536844373659"
331
+ }
332
+ },
333
+ {
334
+ "_attributes": {
335
+ "uid": "a08ac55e-1e4d-4d3b-8ed9-654c0d0f17a7",
336
+ "callsign": "",
337
+ "type": "b-m-p-c",
338
+ "point": "38.5188887411569,-108.536563687344"
339
+ }
340
+ },
341
+ {
342
+ "_attributes": {
343
+ "uid": "d263cabb-0127-4b1a-b6ec-49ba7955613e",
344
+ "callsign": "",
345
+ "type": "b-m-p-c",
346
+ "point": "38.5189069741421,-108.536444249515"
347
+ }
348
+ },
349
+ {
350
+ "_attributes": {
351
+ "uid": "433be0f6-8e94-4c07-9c2f-12c2ccdbf585",
352
+ "callsign": "",
353
+ "type": "b-m-p-c",
354
+ "point": "38.5189739966264,-108.53616651121"
355
+ }
356
+ },
357
+ {
358
+ "_attributes": {
359
+ "uid": "31978e14-7b66-40ce-8157-6fe281dcb48e",
360
+ "callsign": "",
361
+ "type": "b-m-p-c",
362
+ "point": "38.5189829024848,-108.536065360801"
363
+ }
364
+ },
365
+ {
366
+ "_attributes": {
367
+ "uid": "bb28b040-c5ee-487c-a76b-6f8cedb27354",
368
+ "callsign": "TGT",
369
+ "type": "b-m-p-w",
370
+ "point": "38.5190139289798,-108.535962334931"
371
+ }
372
+ }
373
+ ],
374
+ "link_attr": {
375
+ "_attributes": {
376
+ "color": "-256",
377
+ "method": "Walking",
378
+ "prefix": "CP",
379
+ "direction": "Infil",
380
+ "routetype": "Primary",
381
+ "order": "Ascending Check Points"
382
+ }
383
+ },
384
+ "_flow-tags_": {
385
+ "_attributes": {
386
+ "TAK-Server-e87a0e02420b44a08f6032bcf1877745": "2024-09-09T21:53:57Z"
387
+ }
388
+ }
389
+ }
390
+ }
391
+ })
392
+
393
+ if (!cot.raw.event.detail) {
394
+ t.fail('No Detail Section')
395
+ } else {
396
+ t.ok(cot.raw.event.detail['_flow-tags_']);
397
+ delete cot.raw.event.detail['_flow-tags_'];
398
+
399
+ t.deepEquals({
400
+ id: '6da80127-44d4-4bf0-89bd-ecd326afaef1',
401
+ type: 'Feature',
402
+ properties: {
403
+ callsign: 'Walking Alt Route 5',
404
+ center: [ 0, 0, 9999999 ],
405
+ type: 'b-m-r',
406
+ how: 'h-g-i-g-o',
407
+ precisionlocation: {
408
+ "geopointsrc": "???",
409
+ "altsrc": "???"
410
+ },
411
+ time: '2024-09-09T21:53:57Z',
412
+ start: '2024-09-09T07:28:38Z',
413
+ stale: '2024-09-09T07:28:38Z',
414
+ metadata: {}
415
+ },
416
+ geometry: {
417
+ type: 'LineString',
418
+ coordinates: [
419
+ [ -108.547391197293, 38.5144413169673 ],
420
+ [ -108.546923921927, 38.5149532310605 ],
421
+ [ -108.546926767992, 38.5150249333408 ],
422
+ [ -108.546895974379, 38.5151394174434 ],
423
+ [ -108.546844612187, 38.5151803514502 ],
424
+ [ -108.546651915511, 38.5152636957219 ],
425
+ [ -108.546310782148, 38.515552834564 ],
426
+ [ -108.546167031945, 38.5157638654036 ],
427
+ [ -108.54609208104, 38.5158532626694 ],
428
+ [ -108.546076056876, 38.515905780664 ],
429
+ [ -108.54597316944, 38.5160187860381 ],
430
+ [ -108.545938100192, 38.5160564186505 ],
431
+ [ -108.545892411714, 38.5160748431091 ],
432
+ [ -108.545661962771, 38.5163298746682 ],
433
+ [ -108.545458235843, 38.5164957921584 ],
434
+ [ -108.545275877858, 38.5166222378823 ],
435
+ [ -108.544850396656, 38.5167698285131 ],
436
+ [ -108.54462357225, 38.5168808127812 ],
437
+ [ -108.544504597929, 38.5170064645084 ],
438
+ [ -108.544303302554, 38.5171414968795 ],
439
+ [ -108.544236333091, 38.5172291006172 ],
440
+ [ -108.544165746257, 38.5173173331109 ],
441
+ [ -108.543976946151, 38.5174202795084 ],
442
+ [ -108.543831758696, 38.5175036227552 ],
443
+ [ -108.543661143095, 38.517613542356 ],
444
+ [ -108.543325809711, 38.5178962265508 ],
445
+ [ -108.542564835311, 38.5179179531849 ],
446
+ [ -108.542459293982, 38.5179294427309 ],
447
+ [ -108.542373804005, 38.5179693454348 ],
448
+ [ -108.538496613518, 38.518518678155 ],
449
+ [ -108.538285083453, 38.5184750672752 ],
450
+ [ -108.538071195872, 38.5184905316775 ],
451
+ [ -108.537919778987, 38.5185637113729 ],
452
+ [ -108.537699998988, 38.5185823219668 ],
453
+ [ -108.537545754848, 38.5186577706628 ],
454
+ [ -108.537197876139, 38.5187507810887 ],
455
+ [ -108.536844373659, 38.5187772046473 ],
456
+ [ -108.536563687344, 38.5188887411569 ],
457
+ [ -108.536444249515, 38.5189069741421 ],
458
+ [ -108.53616651121, 38.5189739966264 ],
459
+ [ -108.536065360801, 38.5189829024848 ],
460
+ [ -108.535962334931, 38.5190139289798 ]
461
+ ]
462
+ }
463
+ }, cot.to_geojson());
464
+ }
465
+
466
+ t.end();
467
+ });
@@ -1,5 +1,5 @@
1
1
  import type { Static } from '@sinclair/typebox';
2
- import type { Feature } from '../lib/feature.js';
2
+ import type { Feature } from '../lib/types/feature.js';
3
3
  import fs from 'node:fs/promises';
4
4
  import path from 'node:path';
5
5
  import test from 'tape';
@@ -1,5 +1,5 @@
1
1
  import type { Static } from '@sinclair/typebox';
2
- import type { Feature } from '../lib/feature.js';
2
+ import type { Feature } from '../lib/types/feature.js';
3
3
  import fs from 'node:fs/promises';
4
4
  import path from 'node:path';
5
5
  import test from 'tape';