@tak-ps/node-cot 12.37.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.
- package/.github/workflows/doc.yml +1 -1
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/test.yml +4 -1
- package/CHANGELOG.md +5 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cot.js +7 -723
- package/dist/lib/cot.js.map +1 -1
- package/dist/lib/data-package.js +3 -2
- package/dist/lib/data-package.js.map +1 -1
- package/dist/lib/parser.js +742 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/types/types.js +37 -17
- package/dist/lib/types/types.js.map +1 -1
- package/dist/lib/utils/util.js +5 -5
- package/dist/lib/utils/util.js.map +1 -1
- package/dist/package.json +4 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.ts +1 -0
- package/lib/cot.ts +17 -858
- package/lib/data-package.ts +3 -2
- package/lib/parser.ts +906 -0
- package/lib/types/types.ts +42 -17
- package/lib/utils/util.ts +5 -5
- package/package.json +4 -5
- package/tsconfig.json +0 -3
package/lib/types/types.ts
CHANGED
|
@@ -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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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(
|
|
544
|
-
archive: Type.Optional(Type.Union([
|
|
545
|
-
strokeWeight: Type.Optional(
|
|
546
|
-
strokeStyle: Type.Optional(
|
|
547
|
-
labels_on: Type.Optional(
|
|
548
|
-
fillColor: Type.Optional(
|
|
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.
|
|
579
|
-
lon: Type.
|
|
580
|
-
hae: Type.
|
|
581
|
-
|
|
582
|
-
|
|
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':
|
|
93
|
-
'lon':
|
|
94
|
-
'hae':
|
|
95
|
-
'ce':
|
|
96
|
-
'le':
|
|
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": "
|
|
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
|
|
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": "^
|
|
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
|
-
"
|
|
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"
|