@tak-ps/node-cot 12.17.1 → 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 (120) hide show
  1. package/CHANGELOG.md +4 -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/iconset.js +12 -4
  5. package/dist/lib/types/iconset.js.map +1 -1
  6. package/dist/lib/xml/basemap.js +1 -1
  7. package/dist/lib/xml/basemap.js.map +1 -1
  8. package/dist/lib/xml/iconset.js +29 -2
  9. package/dist/lib/xml/iconset.js.map +1 -1
  10. package/dist/package.json +1 -1
  11. package/dist/tsconfig.tsbuildinfo +1 -1
  12. package/lib/data-package.ts +70 -17
  13. package/lib/types/iconset.ts +14 -4
  14. package/lib/xml/basemap.ts +2 -2
  15. package/lib/xml/iconset.ts +36 -3
  16. package/lib/xml-document.ts +1 -1
  17. package/package.json +1 -1
  18. package/tsconfig.json +1 -0
  19. package/dist/test/basemaps.test.js +0 -16
  20. package/dist/test/basemaps.test.js.map +0 -1
  21. package/dist/test/chat.test.js +0 -97
  22. package/dist/test/chat.test.js.map +0 -1
  23. package/dist/test/cot-fileshare.test.js +0 -89
  24. package/dist/test/cot-fileshare.test.js.map +0 -1
  25. package/dist/test/cot-itak.test.js +0 -95
  26. package/dist/test/cot-itak.test.js.map +0 -1
  27. package/dist/test/cot-mma.test.js +0 -108
  28. package/dist/test/cot-mma.test.js.map +0 -1
  29. package/dist/test/cot-polyline.test.js +0 -98
  30. package/dist/test/cot-polyline.test.js.map +0 -1
  31. package/dist/test/cot-range-and-bearing.test.js +0 -98
  32. package/dist/test/cot-range-and-bearing.test.js.map +0 -1
  33. package/dist/test/cot-routes.test.js +0 -466
  34. package/dist/test/cot-routes.test.js.map +0 -1
  35. package/dist/test/cot-types.test.js +0 -7
  36. package/dist/test/cot-types.test.js.map +0 -1
  37. package/dist/test/cot-uas-tool.test.js +0 -286
  38. package/dist/test/cot-uas-tool.test.js.map +0 -1
  39. package/dist/test/cot-video.test.js +0 -196
  40. package/dist/test/cot-video.test.js.map +0 -1
  41. package/dist/test/cot_is.test.js +0 -353
  42. package/dist/test/cot_is.test.js.map +0 -1
  43. package/dist/test/data-package.test.js +0 -234
  44. package/dist/test/data-package.test.js.map +0 -1
  45. package/dist/test/diff.test.js +0 -73
  46. package/dist/test/diff.test.js.map +0 -1
  47. package/dist/test/flow-tags.test.js +0 -19
  48. package/dist/test/flow-tags.test.js.map +0 -1
  49. package/dist/test/force-delete.js +0 -46
  50. package/dist/test/force-delete.js.map +0 -1
  51. package/dist/test/from_geojson.test.js +0 -287
  52. package/dist/test/from_geojson.test.js.map +0 -1
  53. package/dist/test/newlines.test.js +0 -79
  54. package/dist/test/newlines.test.js.map +0 -1
  55. package/dist/test/reversal-geojson.test.js +0 -15
  56. package/dist/test/reversal-geojson.test.js.map +0 -1
  57. package/dist/test/reversal-proto.test.js +0 -54
  58. package/dist/test/reversal-proto.test.js.map +0 -1
  59. package/dist/test/stream.js +0 -10
  60. package/dist/test/stream.js.map +0 -1
  61. package/dist/test/taskings-mission.test.js +0 -140
  62. package/dist/test/taskings-mission.test.js.map +0 -1
  63. package/dist/test/util.test.js +0 -25
  64. package/dist/test/util.test.js.map +0 -1
  65. package/dist/test/validation.test.js +0 -13
  66. package/dist/test/validation.test.js.map +0 -1
  67. package/test/basemaps/Bing_Hybrid.xml +0 -12
  68. package/test/basemaps/Bing_Maps.xml +0 -10
  69. package/test/basemaps/USGSBasemap.xml +0 -10
  70. package/test/basemaps/USGSImageryOnly.xml +0 -10
  71. package/test/basemaps/USGSImageryTopo.xml +0 -10
  72. package/test/basemaps/USGSShadedRelief.xml +0 -10
  73. package/test/basemaps/opentopomap.xml +0 -10
  74. package/test/basemaps.test.ts +0 -19
  75. package/test/chat.test.ts +0 -103
  76. package/test/cot-fileshare.test.ts +0 -92
  77. package/test/cot-itak.test.ts +0 -100
  78. package/test/cot-mma.test.ts +0 -111
  79. package/test/cot-polyline.test.ts +0 -103
  80. package/test/cot-range-and-bearing.test.ts +0 -100
  81. package/test/cot-routes.test.ts +0 -468
  82. package/test/cot-types.test.ts +0 -8
  83. package/test/cot-uas-tool.test.ts +0 -295
  84. package/test/cot-video.test.ts +0 -204
  85. package/test/cot_is.test.ts +0 -431
  86. package/test/data-package.test.ts +0 -314
  87. package/test/diff.test.ts +0 -80
  88. package/test/fixtures/archived.geojson +0 -20
  89. package/test/fixtures/attachments.geojson +0 -20
  90. package/test/fixtures/basic.geojson +0 -19
  91. package/test/fixtures/circle.geojson +0 -30
  92. package/test/fixtures/color.geojson +0 -21
  93. package/test/fixtures/fileshare.geojson +0 -28
  94. package/test/fixtures/geofence.geojson +0 -25
  95. package/test/fixtures/hae.geojson +0 -19
  96. package/test/fixtures/icon.geojson +0 -20
  97. package/test/fixtures/linestring.geojson +0 -28
  98. package/test/fixtures/marti-mission.geojson +0 -22
  99. package/test/fixtures/metadata.geojson +0 -24
  100. package/test/fixtures/mission-layer.geojson +0 -31
  101. package/test/fixtures/mission.geojson +0 -25
  102. package/test/fixtures/polygon.geojson +0 -33
  103. package/test/fixtures/props.geojson +0 -22
  104. package/test/fixtures/sensor.geojson +0 -31
  105. package/test/fixtures/video-connection.geojson +0 -27
  106. package/test/fixtures/video.geojson +0 -24
  107. package/test/flow-tags.test.ts +0 -21
  108. package/test/force-delete.ts +0 -50
  109. package/test/from_geojson.test.ts +0 -323
  110. package/test/newlines.test.ts +0 -83
  111. package/test/packages/AttachmentInManifest.zip +0 -0
  112. package/test/packages/COMilePosts.zip +0 -0
  113. package/test/packages/CameraCOTs.zip +0 -0
  114. package/test/packages/QuickPic.zip +0 -0
  115. package/test/reversal-geojson.test.ts +0 -19
  116. package/test/reversal-proto.test.ts +0 -60
  117. package/test/stream.ts +0 -10
  118. package/test/taskings-mission.test.ts +0 -148
  119. package/test/util.test.ts +0 -34
  120. package/test/validation.test.ts +0 -13
@@ -1,468 +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": "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
- path: '/',
403
- properties: {
404
- callsign: 'Walking Alt Route 5',
405
- center: [ 0, 0, 9999999 ],
406
- type: 'b-m-r',
407
- how: 'h-g-i-g-o',
408
- precisionlocation: {
409
- "geopointsrc": "???",
410
- "altsrc": "???"
411
- },
412
- time: '2024-09-09T21:53:57Z',
413
- start: '2024-09-09T07:28:38Z',
414
- stale: '2024-09-09T07:28:38Z',
415
- metadata: {}
416
- },
417
- geometry: {
418
- type: 'LineString',
419
- coordinates: [
420
- [ -108.547391197293, 38.5144413169673 ],
421
- [ -108.546923921927, 38.5149532310605 ],
422
- [ -108.546926767992, 38.5150249333408 ],
423
- [ -108.546895974379, 38.5151394174434 ],
424
- [ -108.546844612187, 38.5151803514502 ],
425
- [ -108.546651915511, 38.5152636957219 ],
426
- [ -108.546310782148, 38.515552834564 ],
427
- [ -108.546167031945, 38.5157638654036 ],
428
- [ -108.54609208104, 38.5158532626694 ],
429
- [ -108.546076056876, 38.515905780664 ],
430
- [ -108.54597316944, 38.5160187860381 ],
431
- [ -108.545938100192, 38.5160564186505 ],
432
- [ -108.545892411714, 38.5160748431091 ],
433
- [ -108.545661962771, 38.5163298746682 ],
434
- [ -108.545458235843, 38.5164957921584 ],
435
- [ -108.545275877858, 38.5166222378823 ],
436
- [ -108.544850396656, 38.5167698285131 ],
437
- [ -108.54462357225, 38.5168808127812 ],
438
- [ -108.544504597929, 38.5170064645084 ],
439
- [ -108.544303302554, 38.5171414968795 ],
440
- [ -108.544236333091, 38.5172291006172 ],
441
- [ -108.544165746257, 38.5173173331109 ],
442
- [ -108.543976946151, 38.5174202795084 ],
443
- [ -108.543831758696, 38.5175036227552 ],
444
- [ -108.543661143095, 38.517613542356 ],
445
- [ -108.543325809711, 38.5178962265508 ],
446
- [ -108.542564835311, 38.5179179531849 ],
447
- [ -108.542459293982, 38.5179294427309 ],
448
- [ -108.542373804005, 38.5179693454348 ],
449
- [ -108.538496613518, 38.518518678155 ],
450
- [ -108.538285083453, 38.5184750672752 ],
451
- [ -108.538071195872, 38.5184905316775 ],
452
- [ -108.537919778987, 38.5185637113729 ],
453
- [ -108.537699998988, 38.5185823219668 ],
454
- [ -108.537545754848, 38.5186577706628 ],
455
- [ -108.537197876139, 38.5187507810887 ],
456
- [ -108.536844373659, 38.5187772046473 ],
457
- [ -108.536563687344, 38.5188887411569 ],
458
- [ -108.536444249515, 38.5189069741421 ],
459
- [ -108.53616651121, 38.5189739966264 ],
460
- [ -108.536065360801, 38.5189829024848 ],
461
- [ -108.535962334931, 38.5190139289798 ]
462
- ]
463
- }
464
- }, cot.to_geojson());
465
- }
466
-
467
- t.end();
468
- });
@@ -1,8 +0,0 @@
1
- import { CoTTypes } from '../index.js'
2
- import test from 'tape';
3
-
4
- test(`CoTTypes Parsing`, async (t) => {
5
- await CoTTypes.default.load();
6
-
7
- t.end();
8
- });