@tak-ps/node-cot 3.5.4 → 4.1.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.
@@ -0,0 +1,431 @@
1
+ import test from 'tape';
2
+ import CoT from '../index.js';
3
+
4
+ test('CoT.is_friend', (t) => {
5
+ let cot = CoT.from_geojson({
6
+ type: 'Feature',
7
+ properties: {
8
+ type: 'a-f-B'
9
+ },
10
+ geometry: { type: 'Point', coordinates: [0,0] }
11
+ });
12
+
13
+ t.ok(cot.is_friend());
14
+
15
+ cot = CoT.from_geojson({
16
+ type: 'Feature',
17
+ properties: {
18
+ type: 'a-h-B'
19
+ },
20
+ geometry: { type: 'Point', coordinates: [0,0] }
21
+ });
22
+
23
+ t.notOk(cot.is_friend());
24
+
25
+ t.end();
26
+ });
27
+
28
+ test('CoT.is_hostile', (t) => {
29
+ let cot = CoT.from_geojson({
30
+ type: 'Feature',
31
+ properties: {
32
+ type: 'a-h-B'
33
+ },
34
+ geometry: { type: 'Point', coordinates: [0,0] }
35
+ });
36
+
37
+ t.ok(cot.is_hostile());
38
+
39
+ cot = CoT.from_geojson({
40
+ type: 'Feature',
41
+ properties: {
42
+ type: 'a-f-B'
43
+ },
44
+ geometry: { type: 'Point', coordinates: [0,0] }
45
+ });
46
+
47
+ t.notOk(cot.is_hostile());
48
+
49
+ t.end();
50
+ });
51
+
52
+ test('CoT.is_unknown', (t) => {
53
+ let cot = CoT.from_geojson({
54
+ type: 'Feature',
55
+ properties: {
56
+ type: 'a-u-B'
57
+ },
58
+ geometry: { type: 'Point', coordinates: [0,0] }
59
+ });
60
+
61
+ t.ok(cot.is_unknown());
62
+
63
+ cot = CoT.from_geojson({
64
+ type: 'Feature',
65
+ properties: {
66
+ type: 'a-f-B'
67
+ },
68
+ geometry: { type: 'Point', coordinates: [0,0] }
69
+ });
70
+
71
+ t.notOk(cot.is_unknown());
72
+
73
+ t.end();
74
+ });
75
+
76
+ test('CoT.is_pending', (t) => {
77
+ let cot = CoT.from_geojson({
78
+ type: 'Feature',
79
+ properties: {
80
+ type: 'a-p-B'
81
+ },
82
+ geometry: { type: 'Point', coordinates: [0,0] }
83
+ });
84
+
85
+ t.ok(cot.is_pending());
86
+
87
+ cot = CoT.from_geojson({
88
+ type: 'Feature',
89
+ properties: {
90
+ type: 'a-f-B'
91
+ },
92
+ geometry: { type: 'Point', coordinates: [0,0] }
93
+ });
94
+
95
+ t.notOk(cot.is_pending());
96
+
97
+ t.end();
98
+ });
99
+
100
+ test('CoT.is_assumed', (t) => {
101
+ let cot = CoT.from_geojson({
102
+ type: 'Feature',
103
+ properties: {
104
+ type: 'a-a-B'
105
+ },
106
+ geometry: { type: 'Point', coordinates: [0,0] }
107
+ });
108
+
109
+ t.ok(cot.is_assumed());
110
+
111
+ cot = CoT.from_geojson({
112
+ type: 'Feature',
113
+ properties: {
114
+ type: 'a-f-B'
115
+ },
116
+ geometry: { type: 'Point', coordinates: [0,0] }
117
+ });
118
+
119
+ t.notOk(cot.is_assumed());
120
+ t.end();
121
+ });
122
+
123
+ test('CoT.is_neutral', (t) => {
124
+ let cot = CoT.from_geojson({
125
+ type: 'Feature',
126
+ properties: {
127
+ type: 'a-n-B'
128
+ },
129
+ geometry: { type: 'Point', coordinates: [0,0] }
130
+ });
131
+
132
+ t.ok(cot.is_neutral());
133
+
134
+ cot = CoT.from_geojson({
135
+ type: 'Feature',
136
+ properties: {
137
+ type: 'a-f-B'
138
+ },
139
+ geometry: { type: 'Point', coordinates: [0,0] }
140
+ });
141
+
142
+ t.notOk(cot.is_neutral());
143
+ t.end();
144
+ });
145
+
146
+ test('CoT.is_suspect', (t) => {
147
+ let cot = CoT.from_geojson({
148
+ type: 'Feature',
149
+ properties: {
150
+ type: 'a-s-B'
151
+ },
152
+ geometry: { type: 'Point', coordinates: [0,0] }
153
+ });
154
+
155
+ t.ok(cot.is_suspect());
156
+
157
+ cot = CoT.from_geojson({
158
+ type: 'Feature',
159
+ properties: {
160
+ type: 'a-f-B'
161
+ },
162
+ geometry: { type: 'Point', coordinates: [0,0] }
163
+ });
164
+
165
+ t.notOk(cot.is_suspect());
166
+ t.end();
167
+ });
168
+
169
+ test('CoT.is_joker', (t) => {
170
+ let cot = CoT.from_geojson({
171
+ type: 'Feature',
172
+ properties: {
173
+ type: 'a-j-B'
174
+ },
175
+ geometry: { type: 'Point', coordinates: [0,0] }
176
+ });
177
+
178
+ t.ok(cot.is_joker());
179
+
180
+ cot = CoT.from_geojson({
181
+ type: 'Feature',
182
+ properties: {
183
+ type: 'a-f-B'
184
+ },
185
+ geometry: { type: 'Point', coordinates: [0,0] }
186
+ });
187
+
188
+ t.notOk(cot.is_joker());
189
+ t.end();
190
+ });
191
+
192
+ test('CoT.is_faker', (t) => {
193
+ let cot = CoT.from_geojson({
194
+ type: 'Feature',
195
+ properties: {
196
+ type: 'a-k-B'
197
+ },
198
+ geometry: { type: 'Point', coordinates: [0,0] }
199
+ });
200
+
201
+ t.ok(cot.is_faker());
202
+
203
+ cot = CoT.from_geojson({
204
+ type: 'Feature',
205
+ properties: {
206
+ type: 'a-f-B'
207
+ },
208
+ geometry: { type: 'Point', coordinates: [0,0] }
209
+ });
210
+
211
+ t.notOk(cot.is_faker());
212
+ t.end();
213
+ });
214
+
215
+ test('CoT.is_atom', (t) => {
216
+ let cot = CoT.from_geojson({
217
+ type: 'Feature',
218
+ properties: {
219
+ type: 'a-'
220
+ },
221
+ geometry: { type: 'Point', coordinates: [0,0] }
222
+ });
223
+
224
+ t.ok(cot.is_atom());
225
+
226
+ cot = CoT.from_geojson({
227
+ type: 'Feature',
228
+ properties: {
229
+ type: 'h'
230
+ },
231
+ geometry: { type: 'Point', coordinates: [0,0] }
232
+ });
233
+
234
+ t.notOk(cot.is_atom());
235
+ t.end();
236
+ });
237
+
238
+ test('CoT.is_airborne', (t) => {
239
+ let cot = CoT.from_geojson({
240
+ type: 'Feature',
241
+ properties: {
242
+ type: 'a-f-A'
243
+ },
244
+ geometry: { type: 'Point', coordinates: [0,0] }
245
+ });
246
+
247
+ t.ok(cot.is_airborne());
248
+
249
+ cot = CoT.from_geojson({
250
+ type: 'Feature',
251
+ properties: {
252
+ type: 'a-h-G'
253
+ },
254
+ geometry: { type: 'Point', coordinates: [0,0] }
255
+ });
256
+
257
+ t.notOk(cot.is_airborne());
258
+ t.end();
259
+ });
260
+
261
+ test('CoT.is_ground', (t) => {
262
+ let cot = CoT.from_geojson({
263
+ type: 'Feature',
264
+ properties: {
265
+ type: 'a-f-G'
266
+ },
267
+ geometry: { type: 'Point', coordinates: [0,0] }
268
+ });
269
+
270
+ t.ok(cot.is_ground());
271
+
272
+ cot = CoT.from_geojson({
273
+ type: 'Feature',
274
+ properties: {
275
+ type: 'a-h-A'
276
+ },
277
+ geometry: { type: 'Point', coordinates: [0,0] }
278
+ });
279
+
280
+ t.notOk(cot.is_ground());
281
+ t.end();
282
+ });
283
+
284
+ test('CoT.is_installation', (t) => {
285
+ let cot = CoT.from_geojson({
286
+ type: 'Feature',
287
+ properties: {
288
+ type: 'a-f-G-I'
289
+ },
290
+ geometry: { type: 'Point', coordinates: [0,0] }
291
+ });
292
+
293
+ t.ok(cot.is_installation());
294
+
295
+ cot = CoT.from_geojson({
296
+ type: 'Feature',
297
+ properties: {
298
+ type: 'a-f-G'
299
+ },
300
+ geometry: { type: 'Point', coordinates: [0,0] }
301
+ });
302
+
303
+ t.notOk(cot.is_installation());
304
+
305
+ cot = CoT.from_geojson({
306
+ type: 'Feature',
307
+ properties: {
308
+ type: 'a-h-A'
309
+ },
310
+ geometry: { type: 'Point', coordinates: [0,0] }
311
+ });
312
+
313
+ t.notOk(cot.is_installation());
314
+ t.end();
315
+ });
316
+
317
+ test('CoT.is_vehicle', (t) => {
318
+ let cot = CoT.from_geojson({
319
+ type: 'Feature',
320
+ properties: {
321
+ type: 'a-f-G-E-V'
322
+ },
323
+ geometry: { type: 'Point', coordinates: [0,0] }
324
+ });
325
+
326
+ t.ok(cot.is_vehicle());
327
+
328
+ cot = CoT.from_geojson({
329
+ type: 'Feature',
330
+ properties: {
331
+ type: 'a-h-G-E-V'
332
+ },
333
+ geometry: { type: 'Point', coordinates: [0,0] }
334
+ });
335
+
336
+ t.ok(cot.is_vehicle());
337
+
338
+ cot = CoT.from_geojson({
339
+ type: 'Feature',
340
+ properties: {
341
+ type: 'a-f-G-E'
342
+ },
343
+ geometry: { type: 'Point', coordinates: [0,0] }
344
+ });
345
+
346
+ t.notOk(cot.is_vehicle());
347
+ t.end();
348
+ });
349
+
350
+ test('CoT.is_equipment', (t) => {
351
+ let cot = CoT.from_geojson({
352
+ type: 'Feature',
353
+ properties: {
354
+ type: 'a-f-G-E'
355
+ },
356
+ geometry: { type: 'Point', coordinates: [0,0] }
357
+ });
358
+
359
+ t.ok(cot.is_equipment());
360
+
361
+ cot = CoT.from_geojson({
362
+ type: 'Feature',
363
+ properties: {
364
+ type: 'a-f-G'
365
+ },
366
+ geometry: { type: 'Point', coordinates: [0,0] }
367
+ });
368
+
369
+ t.notOk(cot.is_equipment());
370
+
371
+ t.end();
372
+ });
373
+
374
+ test('CoT.is_surface', (t) => {
375
+ let cot = CoT.from_geojson({
376
+ type: 'Feature',
377
+ properties: {
378
+ type: 'a-f-S'
379
+ },
380
+ geometry: { type: 'Point', coordinates: [0,0] }
381
+ });
382
+
383
+ t.ok(cot.is_surface());
384
+
385
+ cot = CoT.from_geojson({
386
+ type: 'Feature',
387
+ properties: {
388
+ type: 'a-f-G'
389
+ },
390
+ geometry: { type: 'Point', coordinates: [0,0] }
391
+ });
392
+
393
+ t.notOk(cot.is_surface());
394
+ t.end();
395
+ });
396
+
397
+ test('CoT.is_subsurface', (t) => {
398
+ let cot = CoT.from_geojson({
399
+ type: 'Feature',
400
+ properties: {
401
+ type: 'a-f-U'
402
+ },
403
+ geometry: { type: 'Point', coordinates: [0,0] }
404
+ });
405
+
406
+ t.ok(cot.is_subsurface());
407
+
408
+ cot = CoT.from_geojson({
409
+ type: 'Feature',
410
+ properties: {
411
+ type: 'a-f-G'
412
+ },
413
+ geometry: { type: 'Point', coordinates: [0,0] }
414
+ });
415
+
416
+ t.notOk(cot.is_subsurface());
417
+ t.end();
418
+ });
419
+
420
+ test('CoT.is_uav', (t) => {
421
+ let cot = CoT.from_geojson({
422
+ type: 'Feature',
423
+ properties: {
424
+ type: 'a-f-A-M-F-Q-r'
425
+ },
426
+ geometry: { type: 'Point', coordinates: [0,0] }
427
+ });
428
+
429
+ t.ok(cot.is_uav());
430
+ t.end();
431
+ });
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "123",
3
+ "type": "Feature",
4
+ "properties": {
5
+ "type": "a-f-G",
6
+ "how": "m-g",
7
+ "callsign": "BasicTest",
8
+ "time": "2023-08-04T15:17:43.649Z",
9
+ "start": "2023-08-04T15:17:43.649Z",
10
+ "stale": "2023-08-04T15:17:43.649Z"
11
+ },
12
+ "geometry": {
13
+ "type": "Point",
14
+ "coordinates": [1.1, 2.2, 0]
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "123",
3
+ "type": "Feature",
4
+ "properties": {
5
+ "type": "a-f-G",
6
+ "how": "m-g",
7
+ "callsign": "BasicTest",
8
+ "time": "2023-08-04T15:17:43.649Z",
9
+ "start": "2023-08-04T15:17:43.649Z",
10
+ "stale": "2023-08-04T15:17:43.649Z"
11
+ },
12
+ "geometry": {
13
+ "type": "Point",
14
+ "coordinates": [1.1, 2.2, 1234]
15
+ }
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "id": "123",
3
+ "type": "Feature",
4
+ "properties": {
5
+ "type": "a-f-G",
6
+ "how": "m-g",
7
+ "callsign": "BasicTest",
8
+ "time": "2023-08-04T15:17:43.649Z",
9
+ "start": "2023-08-04T15:17:43.649Z",
10
+ "stale": "2023-08-04T15:17:43.649Z",
11
+ "icon": "iconset/test.png"
12
+ },
13
+ "geometry": {
14
+ "type": "Point",
15
+ "coordinates": [1.1, 2.2, 0]
16
+ }
17
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "id": "123",
3
+ "type": "Feature",
4
+ "properties": {
5
+ "type": "a-f-G",
6
+ "how": "m-g",
7
+ "callsign": "BasicTest",
8
+ "time": "2023-08-04T15:17:43.649Z",
9
+ "start": "2023-08-04T15:17:43.649Z",
10
+ "stale": "2023-08-04T15:17:43.649Z",
11
+ "remarks": "test-remarks",
12
+ "course": 260,
13
+ "speed": 120
14
+ },
15
+ "geometry": {
16
+ "type": "Point",
17
+ "coordinates": [1.1, 2.2, 0]
18
+ }
19
+ }
@@ -1,8 +1,8 @@
1
1
  import test from 'tape';
2
- import { XML } from '../index.js';
2
+ import CoT from '../index.js';
3
3
 
4
- test('XML.from_geojson - Point', (t) => {
5
- const geo = XML.from_geojson({
4
+ test('CoT.from_geojson - Point', (t) => {
5
+ const geo = CoT.from_geojson({
6
6
  type: 'Feature',
7
7
  properties: {},
8
8
  geometry: {
@@ -24,14 +24,15 @@ test('XML.from_geojson - Point', (t) => {
24
24
  });
25
25
 
26
26
  t.deepEquals(geo.raw.event.detail, {
27
- contact: { _attributes: { callsign: 'UNKNOWN' } }
27
+ contact: { _attributes: { callsign: 'UNKNOWN' } },
28
+ remarks: { _attributes: {}, _text: '' }
28
29
  });
29
30
 
30
31
  t.end();
31
32
  });
32
33
 
33
- test('XML.from_geojson - Polygon', (t) => {
34
- const geo = XML.from_geojson({
34
+ test('CoT.from_geojson - Polygon', (t) => {
35
+ const geo = CoT.from_geojson({
35
36
  type: 'Feature',
36
37
  properties: {},
37
38
  geometry: {
@@ -78,8 +79,8 @@ test('XML.from_geojson - Polygon', (t) => {
78
79
  t.end();
79
80
  });
80
81
 
81
- test('XML.from_geojson - LineString', (t) => {
82
- const geo = XML.from_geojson({
82
+ test('CoT.from_geojson - LineString', (t) => {
83
+ const geo = CoT.from_geojson({
83
84
  type: 'Feature',
84
85
  properties: {},
85
86
  geometry: {
@@ -126,8 +127,8 @@ test('XML.from_geojson - LineString', (t) => {
126
127
  t.end();
127
128
  });
128
129
 
129
- test('XML.from_geojson - Start', (t) => {
130
- const geo = XML.from_geojson({
130
+ test('CoT.from_geojson - Start', (t) => {
131
+ const geo = CoT.from_geojson({
131
132
  type: 'Feature',
132
133
  properties: {
133
134
  // 1hr in the future
@@ -154,8 +155,8 @@ test('XML.from_geojson - Start', (t) => {
154
155
  t.end();
155
156
  });
156
157
 
157
- test('XML.from_geojson - Start/Stale', (t) => {
158
- const geo = XML.from_geojson({
158
+ test('CoT.from_geojson - Start/Stale', (t) => {
159
+ const geo = CoT.from_geojson({
159
160
  type: 'Feature',
160
161
  properties: {
161
162
  // 1hr in the future
@@ -183,8 +184,8 @@ test('XML.from_geojson - Start/Stale', (t) => {
183
184
  t.end();
184
185
  });
185
186
 
186
- test('XML.from_geojson - Icon', (t) => {
187
- const geo = XML.from_geojson({
187
+ test('CoT.from_geojson - Icon', (t) => {
188
+ const geo = CoT.from_geojson({
188
189
  type: 'Feature',
189
190
  properties: {
190
191
  icon: '66f14976-4b62-4023-8edb-d8d2ebeaa336/Public Safety Air/EMS_ROTOR.png'
@@ -197,14 +198,14 @@ test('XML.from_geojson - Icon', (t) => {
197
198
 
198
199
  t.deepEquals(geo.raw.event.detail, {
199
200
  contact: { _attributes: { callsign: 'UNKNOWN' } },
200
- usericon: { _attributes: { iconsetpath: '66f14976-4b62-4023-8edb-d8d2ebeaa336/Public Safety Air/EMS_ROTOR.png' } }
201
+ usericon: { _attributes: { iconsetpath: '66f14976-4b62-4023-8edb-d8d2ebeaa336/Public Safety Air/EMS_ROTOR.png' } }, remarks: { _attributes: {}, _text: '' }
201
202
  });
202
203
 
203
204
  t.end();
204
205
  });
205
206
 
206
- test('XML.from_geojson - Height Above Earth', (t) => {
207
- t.deepEquals(XML.from_geojson({
207
+ test('CoT.from_geojson - Height Above Earth', (t) => {
208
+ t.deepEquals(CoT.from_geojson({
208
209
  type: 'Feature',
209
210
  properties: {
210
211
  },
@@ -220,7 +221,7 @@ test('XML.from_geojson - Height Above Earth', (t) => {
220
221
  le: '9999999.0'
221
222
  }, 'default hae');
222
223
 
223
- t.deepEquals(XML.from_geojson({
224
+ t.deepEquals(CoT.from_geojson({
224
225
  type: 'Feature',
225
226
  properties: {
226
227
  },
@@ -239,8 +240,8 @@ test('XML.from_geojson - Height Above Earth', (t) => {
239
240
  t.end();
240
241
  });
241
242
 
242
- test('XML.from_geojson - Course & Speed', (t) => {
243
- t.deepEquals(XML.from_geojson({
243
+ test('CoT.from_geojson - Course & Speed', (t) => {
244
+ t.deepEquals(CoT.from_geojson({
244
245
  type: 'Feature',
245
246
  properties: {
246
247
  course: 260,
@@ -260,8 +261,8 @@ test('XML.from_geojson - Course & Speed', (t) => {
260
261
  t.end();
261
262
  });
262
263
 
263
- test('XML.from_geojson - Remarks', (t) => {
264
- t.deepEquals(XML.from_geojson({
264
+ test('CoT.from_geojson - Remarks', (t) => {
265
+ t.deepEquals(CoT.from_geojson({
265
266
  type: 'Feature',
266
267
  properties: {
267
268
  course: 260,
@@ -272,11 +273,9 @@ test('XML.from_geojson - Remarks', (t) => {
272
273
  type: 'Point',
273
274
  coordinates: [1.1, 2.2]
274
275
  }
275
- }).raw.event.detail.track, {
276
- _attributes: {
277
- 'course': '260',
278
- 'speed': '120'
279
- }
276
+ }).raw.event.detail.remarks, {
277
+ _attributes: {},
278
+ _text: 'Test'
280
279
  }, 'track');
281
280
 
282
281
  t.end();
@@ -0,0 +1,17 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import test from 'tape';
4
+ import CoT from '../index.js';
5
+ import { Feature } from 'geojson'
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ test('Reversal Tests', async (t) => {
9
+ for (let fixturename of await fs.readdir(new URL('./fixtures/', import.meta.url))) {
10
+ const fixture: Feature = JSON.parse(String(await fs.readFile(path.join(path.parse(fileURLToPath(import.meta.url)).dir, 'fixtures/', fixturename))));
11
+ const geo = CoT.from_geojson(fixture)
12
+ const output = geo.to_geojson();
13
+ t.deepEquals(fixture, output, fixturename);
14
+ }
15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