@tak-ps/node-cot 12.36.0 → 13.0.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.
@@ -23,6 +23,10 @@ export const Position = Type.Array(Type.Number(), {
23
23
  maxItems: 3
24
24
  })
25
25
 
26
+ export const MilSym = Type.Object({
27
+ id: Type.String()
28
+ })
29
+
26
30
  export const FeaturePropertyMissionLayer = Type.Object({
27
31
  name: Type.Optional(Type.String()),
28
32
  parentUid: Type.Optional(Type.String()),
@@ -86,6 +90,7 @@ export const Properties = Type.Object({
86
90
  ellipse: Type.Optional(ShapeEllipseAttributes)
87
91
  })),
88
92
  remarks: Type.Optional(Type.String()),
93
+ milsym: Type.Optional(MilSym),
89
94
  mission: Type.Optional(FeaturePropertyMission),
90
95
  fileshare: Type.Optional(FileShareAttributes),
91
96
  ackrequest: Type.Optional(ACKRequestAttributes),
@@ -46,6 +46,9 @@ export const LinkAttributes = Type.Object({
46
46
  // Polygon/LineString
47
47
  point: Type.Optional(Type.String()),
48
48
 
49
+ // Used in Routes
50
+ callsign: Type.Optional(Type.String()),
51
+
49
52
  // URL Style Links
50
53
  url: Type.Optional(Type.String()),
51
54
  mime: Type.Optional(Type.String()),
@@ -114,16 +117,37 @@ export const ServerVersionAttributes = Type.Object({
114
117
 
115
118
  export const ColorAttributes = Type.Object({
116
119
  _attributes: Type.Optional(Type.Object({
117
- argb: Type.Optional(Type.String())
120
+ argb: Type.Optional(Type.Integer()),
121
+
122
+ // Have seen this used in range and bearing
123
+ value: Type.Optional(Type.Integer())
118
124
  }))
119
125
  })
120
126
 
121
- export const GenericAttributes = Type.Object({
127
+ export const GenericStringAttributes = Type.Object({
122
128
  _attributes: Type.Optional(Type.Object({
123
129
  value: Type.Optional(Type.String())
124
130
  }))
125
131
  })
126
132
 
133
+ export const GenericBooleanAttributes = Type.Object({
134
+ _attributes: Type.Optional(Type.Object({
135
+ value: Type.Optional(Type.Boolean())
136
+ }))
137
+ })
138
+
139
+ export const GenericIntegerAttributes = Type.Object({
140
+ _attributes: Type.Optional(Type.Object({
141
+ value: Type.Optional(Type.Integer())
142
+ }))
143
+ })
144
+
145
+ export const GenericNumberAttributes = Type.Object({
146
+ _attributes: Type.Optional(Type.Object({
147
+ value: Type.Optional(Type.Integer())
148
+ }))
149
+ })
150
+
127
151
  export const GenericOptionalText = Type.Object({
128
152
  _text: Type.Optional(Type.String())
129
153
  })
@@ -457,7 +481,7 @@ export const Range = Type.Object({
457
481
  });
458
482
 
459
483
  export const RangeUnitsAttributes = Type.Object({
460
- value: Type.String()
484
+ value: Type.Integer()
461
485
  });
462
486
 
463
487
  export const RangeUnits = Type.Object({
@@ -473,7 +497,7 @@ export const Bearing = Type.Object({
473
497
  });
474
498
 
475
499
  export const BearingUnitsAttributes = Type.Object({
476
- value: Type.String()
500
+ value: Type.Integer()
477
501
  });
478
502
 
479
503
  export const BearingUnits = Type.Object({
@@ -481,7 +505,7 @@ export const BearingUnits = Type.Object({
481
505
  });
482
506
 
483
507
  export const InclinationAttributes = Type.Object({
484
- value: Type.String()
508
+ value: Type.Number()
485
509
  });
486
510
 
487
511
  export const Inclination = Type.Object({
@@ -489,7 +513,7 @@ export const Inclination = Type.Object({
489
513
  });
490
514
 
491
515
  export const NorthRefAttributes = Type.Object({
492
- value: Type.String()
516
+ value: Type.Number()
493
517
  });
494
518
 
495
519
  export const NorthRef = Type.Object({
@@ -540,12 +564,12 @@ export const Detail = Type.Object({
540
564
  remarks: Type.Optional(Remarks),
541
565
  precisionlocation: Type.Optional(PrecisionLocation),
542
566
  color: Type.Optional(ColorAttributes),
543
- strokeColor: Type.Optional(GenericAttributes),
544
- archive: Type.Optional(Type.Union([GenericAttributes, Type.Array(GenericAttributes)])),
545
- strokeWeight: Type.Optional(GenericAttributes),
546
- strokeStyle: Type.Optional(GenericAttributes),
547
- labels_on: Type.Optional(GenericAttributes),
548
- fillColor: Type.Optional(GenericAttributes),
567
+ strokeColor: Type.Optional(GenericIntegerAttributes),
568
+ archive: Type.Optional(Type.Union([GenericStringAttributes, Type.Array(GenericStringAttributes)])),
569
+ strokeWeight: Type.Optional(GenericNumberAttributes),
570
+ strokeStyle: Type.Optional(GenericStringAttributes),
571
+ labels_on: Type.Optional(GenericBooleanAttributes),
572
+ fillColor: Type.Optional(GenericIntegerAttributes),
549
573
  mission: Type.Optional(Mission),
550
574
  shape: Type.Optional(Shape),
551
575
 
@@ -575,11 +599,12 @@ export const Detail = Type.Object({
575
599
 
576
600
  export const Point = Type.Object({
577
601
  _attributes: Type.Object({
578
- lat: Type.Union([Type.String(), Type.Number()]),
579
- lon: Type.Union([Type.String(), Type.Number()]),
580
- hae: Type.Union([Type.String(), Type.Number()]),
581
- ce: Type.Union([Type.String(), Type.Number()]),
582
- le: Type.Union([Type.String(), Type.Number()]),
602
+ lat: Type.Number(),
603
+ lon: Type.Number(),
604
+ hae: Type.Number(),
605
+ // Are Occasionally seen as "NaN"
606
+ ce: Type.Union([Type.Number(), Type.String()]),
607
+ le: Type.Union([Type.Number(), Type.String()])
583
608
  })
584
609
  })
585
610
 
package/lib/utils/util.ts CHANGED
@@ -89,11 +89,11 @@ export default class Util {
89
89
  static cot_point(): Static<typeof Point> {
90
90
  return {
91
91
  '_attributes': {
92
- 'lat': '0.000000',
93
- 'lon': '0.000000',
94
- 'hae': '0.0',
95
- 'ce': '9999999.0',
96
- 'le': '9999999.0'
92
+ 'lat': 0.000000,
93
+ 'lon': 0.000000,
94
+ 'hae': 0.0,
95
+ 'ce': 9999999.0,
96
+ 'le': 9999999.0
97
97
  }
98
98
  };
99
99
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/node-cot",
3
3
  "type": "module",
4
- "version": "12.36.0",
4
+ "version": "13.0.0",
5
5
  "description": "Lightweight JavaScript library for parsing and manipulating TAK messages",
6
6
  "author": "Nick Ingalls <nick@ingalls.ca>",
7
7
  "types": "index.ts",
@@ -10,7 +10,7 @@
10
10
  "./2525": "./dist/lib/utils/2525.js"
11
11
  },
12
12
  "scripts": {
13
- "test": "c8 --reporter=lcov ts-node-test test/",
13
+ "test": "c8 --reporter=lcov --reporter html tsx --test test/*.ts",
14
14
  "lint": "eslint *.ts lib/ test/",
15
15
  "doc": "typedoc index.ts",
16
16
  "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/",
@@ -42,13 +42,12 @@
42
42
  "xml-js": "^1.6.11"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "^22.0.0",
45
+ "@types/node": "^24.0.0",
46
46
  "@types/tape": "^5.6.0",
47
47
  "c8": "^10.1.3",
48
48
  "eslint": "^9.0.0",
49
49
  "tape": "^5.6.1",
50
- "ts-node": "^10.9.1",
51
- "ts-node-test": "^0.4.0",
50
+ "tsx": "^4.20.3",
52
51
  "typedoc": "^0.28.0",
53
52
  "typescript": "^5.7.0",
54
53
  "typescript-eslint": "^8.0.0"
package/tsconfig.json CHANGED
@@ -1,7 +1,4 @@
1
1
  {
2
- "ts-node": {
3
- "esm": true
4
- },
5
2
  "compilerOptions": {
6
3
  "strict": true,
7
4
  "strictNullChecks": true,