@tak-ps/node-cot 7.0.0 → 7.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.
- package/.github/workflows/release.yml +1 -2
- package/CHANGELOG.md +14 -0
- package/dist/lib/cot.js +86 -2
- package/dist/lib/cot.js.map +1 -1
- package/dist/lib/feature.js +1 -1
- package/dist/lib/feature.js.map +1 -1
- package/dist/lib/types.js +10 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/test/{reversal.test.js → reversal-geojson.test.js} +7 -7
- package/dist/test/reversal-geojson.test.js.map +1 -0
- package/dist/test/reversal-proto.test.js +16 -0
- package/dist/test/reversal-proto.test.js.map +1 -0
- package/lib/cot.ts +102 -5
- package/lib/feature.ts +1 -1
- package/lib/proto/contact.proto +14 -0
- package/lib/proto/cotevent.proto +44 -0
- package/lib/proto/detail.proto +78 -0
- package/lib/proto/group.proto +13 -0
- package/lib/proto/precisionlocation.proto +13 -0
- package/lib/proto/protocol.txt +352 -0
- package/lib/proto/status.proto +12 -0
- package/lib/proto/takcontrol.proto +24 -0
- package/lib/proto/takmessage.proto +18 -0
- package/lib/proto/takv.proto +15 -0
- package/lib/proto/track.proto +13 -0
- package/lib/types.ts +12 -1
- package/package.json +2 -2
- package/test/{reversal.test.ts → reversal-geojson.test.ts} +7 -7
- package/test/reversal-proto.test.ts +19 -0
- package/dist/test/reversal.test.js.map +0 -1
- package/release +0 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tak-ps/node-cot",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.1.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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"archiver": "^7.0.1",
|
|
24
24
|
"color": "^4.2.3",
|
|
25
25
|
"json-diff-ts": "^4.0.1",
|
|
26
|
-
"protobufjs": "^7.
|
|
26
|
+
"protobufjs": "^7.3.0",
|
|
27
27
|
"xml-js": "^1.6.11"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import Feature from '../lib/feature.js';
|
|
2
|
+
import { Feature } from '../lib/feature.js';
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import test from 'tape';
|
|
6
6
|
import CoT from '../index.js';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
for (const fixturename of await fs.readdir(new URL('./fixtures/', import.meta.url))) {
|
|
10
|
+
test(`GeoJSON Reversal Tests: ${fixturename}`, async (t) => {
|
|
11
11
|
const fixture: Static<typeof Feature> = JSON.parse(String(await fs.readFile(path.join(path.parse(fileURLToPath(import.meta.url)).dir, 'fixtures/', fixturename))));
|
|
12
12
|
const geo = CoT.from_geojson(fixture)
|
|
13
13
|
const output = geo.to_geojson();
|
|
14
|
-
t.deepEquals(
|
|
15
|
-
}
|
|
14
|
+
t.deepEquals(fixture, output, fixturename);
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
});
|
|
16
|
+
t.end();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
import { Feature } from '../lib/feature.js';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import test from 'tape';
|
|
6
|
+
import CoT from '../index.js';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
for (const fixturename of await fs.readdir(new URL('./fixtures/', import.meta.url))) {
|
|
10
|
+
test(`Protobuf Reversal Tests: ${fixturename}`, async (t) => {
|
|
11
|
+
const fixture: Static<typeof Feature> = JSON.parse(String(await fs.readFile(path.join(path.parse(fileURLToPath(import.meta.url)).dir, 'fixtures/', fixturename))));
|
|
12
|
+
const geo = CoT.from_geojson(fixture)
|
|
13
|
+
const intermediate = geo.to_proto();
|
|
14
|
+
const output = CoT.from_proto(intermediate);
|
|
15
|
+
t.deepEquals(fixture, output.to_geojson(), fixturename);
|
|
16
|
+
|
|
17
|
+
t.end();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reversal.test.js","sourceRoot":"","sources":["../../test/reversal.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/B,KAAK,MAAM,WAAW,IAAI,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAClF,MAAM,OAAO,GAA2B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QACnK,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QACrC,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QAChC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC;IAED,CAAC,CAAC,GAAG,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC"}
|