@tak-ps/node-cot 12.17.0 → 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 (123) hide show
  1. package/CHANGELOG.md +8 -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/feature.js +1 -1
  5. package/dist/lib/types/feature.js.map +1 -1
  6. package/dist/lib/types/iconset.js +12 -4
  7. package/dist/lib/types/iconset.js.map +1 -1
  8. package/dist/lib/xml/basemap.js +1 -1
  9. package/dist/lib/xml/basemap.js.map +1 -1
  10. package/dist/lib/xml/iconset.js +29 -2
  11. package/dist/lib/xml/iconset.js.map +1 -1
  12. package/dist/package.json +1 -1
  13. package/dist/tsconfig.tsbuildinfo +1 -1
  14. package/lib/data-package.ts +70 -17
  15. package/lib/types/feature.ts +1 -1
  16. package/lib/types/iconset.ts +14 -4
  17. package/lib/xml/basemap.ts +2 -2
  18. package/lib/xml/iconset.ts +36 -3
  19. package/lib/xml-document.ts +1 -1
  20. package/package.json +1 -1
  21. package/tsconfig.json +1 -0
  22. package/dist/test/basemaps.test.js +0 -16
  23. package/dist/test/basemaps.test.js.map +0 -1
  24. package/dist/test/chat.test.js +0 -97
  25. package/dist/test/chat.test.js.map +0 -1
  26. package/dist/test/cot-fileshare.test.js +0 -89
  27. package/dist/test/cot-fileshare.test.js.map +0 -1
  28. package/dist/test/cot-itak.test.js +0 -95
  29. package/dist/test/cot-itak.test.js.map +0 -1
  30. package/dist/test/cot-mma.test.js +0 -108
  31. package/dist/test/cot-mma.test.js.map +0 -1
  32. package/dist/test/cot-polyline.test.js +0 -98
  33. package/dist/test/cot-polyline.test.js.map +0 -1
  34. package/dist/test/cot-range-and-bearing.test.js +0 -98
  35. package/dist/test/cot-range-and-bearing.test.js.map +0 -1
  36. package/dist/test/cot-routes.test.js +0 -466
  37. package/dist/test/cot-routes.test.js.map +0 -1
  38. package/dist/test/cot-types.test.js +0 -7
  39. package/dist/test/cot-types.test.js.map +0 -1
  40. package/dist/test/cot-uas-tool.test.js +0 -286
  41. package/dist/test/cot-uas-tool.test.js.map +0 -1
  42. package/dist/test/cot-video.test.js +0 -196
  43. package/dist/test/cot-video.test.js.map +0 -1
  44. package/dist/test/cot_is.test.js +0 -353
  45. package/dist/test/cot_is.test.js.map +0 -1
  46. package/dist/test/data-package.test.js +0 -234
  47. package/dist/test/data-package.test.js.map +0 -1
  48. package/dist/test/diff.test.js +0 -73
  49. package/dist/test/diff.test.js.map +0 -1
  50. package/dist/test/flow-tags.test.js +0 -19
  51. package/dist/test/flow-tags.test.js.map +0 -1
  52. package/dist/test/force-delete.js +0 -46
  53. package/dist/test/force-delete.js.map +0 -1
  54. package/dist/test/from_geojson.test.js +0 -287
  55. package/dist/test/from_geojson.test.js.map +0 -1
  56. package/dist/test/newlines.test.js +0 -79
  57. package/dist/test/newlines.test.js.map +0 -1
  58. package/dist/test/reversal-geojson.test.js +0 -15
  59. package/dist/test/reversal-geojson.test.js.map +0 -1
  60. package/dist/test/reversal-proto.test.js +0 -54
  61. package/dist/test/reversal-proto.test.js.map +0 -1
  62. package/dist/test/stream.js +0 -10
  63. package/dist/test/stream.js.map +0 -1
  64. package/dist/test/taskings-mission.test.js +0 -140
  65. package/dist/test/taskings-mission.test.js.map +0 -1
  66. package/dist/test/util.test.js +0 -25
  67. package/dist/test/util.test.js.map +0 -1
  68. package/dist/test/validation.test.js +0 -13
  69. package/dist/test/validation.test.js.map +0 -1
  70. package/test/basemaps/Bing_Hybrid.xml +0 -12
  71. package/test/basemaps/Bing_Maps.xml +0 -10
  72. package/test/basemaps/USGSBasemap.xml +0 -10
  73. package/test/basemaps/USGSImageryOnly.xml +0 -10
  74. package/test/basemaps/USGSImageryTopo.xml +0 -10
  75. package/test/basemaps/USGSShadedRelief.xml +0 -10
  76. package/test/basemaps/opentopomap.xml +0 -10
  77. package/test/basemaps.test.ts +0 -19
  78. package/test/chat.test.ts +0 -103
  79. package/test/cot-fileshare.test.ts +0 -92
  80. package/test/cot-itak.test.ts +0 -100
  81. package/test/cot-mma.test.ts +0 -111
  82. package/test/cot-polyline.test.ts +0 -103
  83. package/test/cot-range-and-bearing.test.ts +0 -100
  84. package/test/cot-routes.test.ts +0 -468
  85. package/test/cot-types.test.ts +0 -8
  86. package/test/cot-uas-tool.test.ts +0 -295
  87. package/test/cot-video.test.ts +0 -204
  88. package/test/cot_is.test.ts +0 -431
  89. package/test/data-package.test.ts +0 -314
  90. package/test/diff.test.ts +0 -80
  91. package/test/fixtures/archived.geojson +0 -20
  92. package/test/fixtures/attachments.geojson +0 -20
  93. package/test/fixtures/basic.geojson +0 -19
  94. package/test/fixtures/circle.geojson +0 -30
  95. package/test/fixtures/color.geojson +0 -21
  96. package/test/fixtures/fileshare.geojson +0 -28
  97. package/test/fixtures/geofence.geojson +0 -25
  98. package/test/fixtures/hae.geojson +0 -19
  99. package/test/fixtures/icon.geojson +0 -20
  100. package/test/fixtures/linestring.geojson +0 -28
  101. package/test/fixtures/marti-mission.geojson +0 -22
  102. package/test/fixtures/metadata.geojson +0 -24
  103. package/test/fixtures/mission-layer.geojson +0 -31
  104. package/test/fixtures/mission.geojson +0 -25
  105. package/test/fixtures/polygon.geojson +0 -33
  106. package/test/fixtures/props.geojson +0 -22
  107. package/test/fixtures/sensor.geojson +0 -31
  108. package/test/fixtures/video-connection.geojson +0 -27
  109. package/test/fixtures/video.geojson +0 -24
  110. package/test/flow-tags.test.ts +0 -21
  111. package/test/force-delete.ts +0 -50
  112. package/test/from_geojson.test.ts +0 -323
  113. package/test/newlines.test.ts +0 -83
  114. package/test/packages/AttachmentInManifest.zip +0 -0
  115. package/test/packages/COMilePosts.zip +0 -0
  116. package/test/packages/CameraCOTs.zip +0 -0
  117. package/test/packages/QuickPic.zip +0 -0
  118. package/test/reversal-geojson.test.ts +0 -19
  119. package/test/reversal-proto.test.ts +0 -60
  120. package/test/stream.ts +0 -10
  121. package/test/taskings-mission.test.ts +0 -148
  122. package/test/util.test.ts +0 -34
  123. package/test/validation.test.ts +0 -13
@@ -1,140 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
- test('Decode MissionChange CoTs', (t) => {
4
- const cot = new CoT({ "event": { "_attributes": { "how": "h-g-i-g-o", "type": "t-x-m-c", "version": "2.0", "uid": "f205227b-2e23-40bf-8948-711566116365", "start": "2024-07-17T18:49:03Z", "time": "2024-07-17T18:49:03Z", "stale": "2024-07-17T18:49:23Z" }, "point": { "_attributes": { "ce": "9999999", "le": "9999999", "hae": "0", "lat": "0", "lon": "0" } }, "detail": { "mission": { "_attributes": { "type": "CHANGE", "tool": "public", "name": "2024-07-17 - Lost Hiker", "guid": "4ce8e41d-21e4-4471-a303-09d12bb93bcf", "authorUid": "CN=mesasar-machine-user@ingalls.ca,OU=WILDFIRE,O=CO-TAK" }, "MissionChanges": { "MissionChange": { "contentUid": { "_text": "layer-11-27529-1" }, "creatorUid": { "_text": "CN=mma-etl-user@cotak.gov,OU=WILDFIRE,O=CO-TAK" }, "isFederatedChange": { "_text": "false" }, "missionName": { "_text": "Colorado NIFS Fire Perimeters" }, "timestamp": { "_text": "2024-08-16T15:21:55.361Z" }, "type": { "_text": "ADD_CONTENT" }, "details": { "_attributes": { "type": "t-x-d-d" } } } } } } } });
5
- if (!cot.raw.event.detail) {
6
- t.fail('No Detail Section');
7
- }
8
- else {
9
- t.ok(cot.raw.event.detail['_flow-tags_']);
10
- delete cot.raw.event.detail['_flow-tags_'];
11
- t.deepEquals({
12
- id: 'f205227b-2e23-40bf-8948-711566116365',
13
- type: 'Feature',
14
- path: '/',
15
- properties: {
16
- callsign: 'UNKNOWN',
17
- center: [0, 0, 0],
18
- type: 't-x-m-c',
19
- how: 'h-g-i-g-o',
20
- time: '2024-07-17T18:49:03Z',
21
- start: '2024-07-17T18:49:03Z',
22
- stale: '2024-07-17T18:49:23Z',
23
- mission: {
24
- type: 'CHANGE',
25
- tool: 'public',
26
- name: '2024-07-17 - Lost Hiker',
27
- guid: '4ce8e41d-21e4-4471-a303-09d12bb93bcf',
28
- authorUid: 'CN=mesasar-machine-user@ingalls.ca,OU=WILDFIRE,O=CO-TAK',
29
- missionChanges: [{
30
- contentUid: 'layer-11-27529-1',
31
- creatorUid: 'CN=mma-etl-user@cotak.gov,OU=WILDFIRE,O=CO-TAK',
32
- isFederatedChange: 'false',
33
- missionName: 'Colorado NIFS Fire Perimeters',
34
- timestamp: '2024-08-16T15:21:55.361Z',
35
- type: 'ADD_CONTENT',
36
- details: {
37
- type: 't-x-d-d',
38
- }
39
- }]
40
- },
41
- metadata: {}
42
- },
43
- geometry: {
44
- type: 'Point',
45
- coordinates: [0, 0, 0]
46
- }
47
- }, cot.to_geojson());
48
- }
49
- t.end();
50
- });
51
- test('Decode MissionChange CoTs - #2', (t) => {
52
- const cot = new CoT({ "event": { "_attributes": { "how": "h-g-i-g-o", "type": "t-x-m-c", "version": "2.0", "uid": "f205227b-2e23-40bf-8948-711566116365", "start": "2024-07-17T18:49:03Z", "time": "2024-07-17T18:49:03Z", "stale": "2024-07-17T18:49:23Z" }, "point": { "_attributes": { "ce": "9999999", "le": "9999999", "hae": "0", "lat": "0", "lon": "0" } }, "detail": { "mission": { "_attributes": { "type": "CHANGE", "tool": "public", "name": "2024-07-17 - Lost Hiker", "guid": "4ce8e41d-21e4-4471-a303-09d12bb93bcf", "authorUid": "CN=mesasar-machine-user@ingalls.ca,OU=WILDFIRE,O=CO-TAK" }, "MissionChanges": { "MissionChange": { "contentUid": { "_text": "8fb7b41f-77c5-4537-9a4c-5b7a76a71cb9" }, "creatorUid": { "_text": "CN=mesasar-machine-user@ingalls.ca,OU=WILDFIRE,O=CO-TAK" }, "isFederatedChange": { "_text": "false" }, "missionName": { "_text": "2024-07-17 - Lost Hiker" }, "timestamp": { "_text": "2024-07-17T18:49:03.606Z" }, "type": { "_text": "ADD_CONTENT" }, "details": { "_attributes": { "type": "u-d-p", "callsign": "Third Test", "color": "-65536" }, "location": { "_attributes": { "lat": "39.118611111111115", "lon": "-108.31361111111111" } } } } } } } } });
53
- if (!cot.raw.event.detail) {
54
- t.fail('No Detail Section');
55
- }
56
- else {
57
- t.ok(cot.raw.event.detail['_flow-tags_']);
58
- delete cot.raw.event.detail['_flow-tags_'];
59
- t.deepEquals({
60
- id: 'f205227b-2e23-40bf-8948-711566116365',
61
- type: 'Feature',
62
- path: '/',
63
- properties: {
64
- callsign: 'UNKNOWN',
65
- center: [0, 0, 0],
66
- type: 't-x-m-c',
67
- how: 'h-g-i-g-o',
68
- time: '2024-07-17T18:49:03Z',
69
- start: '2024-07-17T18:49:03Z',
70
- stale: '2024-07-17T18:49:23Z',
71
- mission: {
72
- type: 'CHANGE',
73
- tool: 'public',
74
- name: '2024-07-17 - Lost Hiker',
75
- guid: '4ce8e41d-21e4-4471-a303-09d12bb93bcf',
76
- authorUid: 'CN=mesasar-machine-user@ingalls.ca,OU=WILDFIRE,O=CO-TAK',
77
- missionChanges: [{
78
- contentUid: '8fb7b41f-77c5-4537-9a4c-5b7a76a71cb9',
79
- creatorUid: 'CN=mesasar-machine-user@ingalls.ca,OU=WILDFIRE,O=CO-TAK',
80
- isFederatedChange: 'false',
81
- missionName: '2024-07-17 - Lost Hiker',
82
- timestamp: '2024-07-17T18:49:03.606Z',
83
- type: 'ADD_CONTENT',
84
- details: {
85
- type: 'u-d-p',
86
- callsign: 'Third Test',
87
- color: '-65536',
88
- lat: '39.118611111111115',
89
- lon: '-108.31361111111111'
90
- }
91
- }]
92
- },
93
- metadata: {}
94
- },
95
- geometry: {
96
- type: 'Point',
97
- coordinates: [0, 0, 0]
98
- }
99
- }, cot.to_geojson());
100
- }
101
- t.end();
102
- });
103
- test('Decode MissionChange Logs', (t) => {
104
- const cot = new CoT({ "event": { "_attributes": { "how": "h-g-i-g-o", "type": "t-x-m-c-l", "version": "2.0", "uid": "e77c55da-c5d2-4200-bbc9-9967b3f30b5b", "start": "2024-10-14T15:33:04Z", "time": "2024-10-14T15:33:04Z", "stale": "2024-10-14T15:33:24Z" }, "point": { "_attributes": { "ce": "9999999", "le": "9999999", "hae": "0", "lat": "0", "lon": "0" } }, "detail": { "mission": { "_attributes": { "type": "CHANGE", "tool": "public", "name": "manual test", "guid": "ae2e9ec4-2762-4664-8660-1ef824bde9bc", "authorUid": "ANDROID-0ca41830e11d2ef3" } } } } });
105
- if (!cot.raw.event.detail) {
106
- t.fail('No Detail Section');
107
- }
108
- else {
109
- t.ok(cot.raw.event.detail['_flow-tags_']);
110
- delete cot.raw.event.detail['_flow-tags_'];
111
- t.deepEquals({
112
- id: 'e77c55da-c5d2-4200-bbc9-9967b3f30b5b',
113
- type: 'Feature',
114
- path: '/',
115
- properties: {
116
- callsign: 'UNKNOWN',
117
- center: [0, 0, 0],
118
- type: 't-x-m-c-l',
119
- how: 'h-g-i-g-o',
120
- time: '2024-10-14T15:33:04Z',
121
- start: '2024-10-14T15:33:04Z',
122
- stale: '2024-10-14T15:33:24Z',
123
- mission: {
124
- type: 'CHANGE',
125
- tool: 'public',
126
- name: 'manual test',
127
- guid: 'ae2e9ec4-2762-4664-8660-1ef824bde9bc',
128
- authorUid: 'ANDROID-0ca41830e11d2ef3',
129
- },
130
- metadata: {}
131
- },
132
- geometry: {
133
- type: 'Point',
134
- coordinates: [0, 0, 0]
135
- }
136
- }, cot.to_geojson());
137
- }
138
- t.end();
139
- });
140
- //# sourceMappingURL=taskings-mission.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskings-mission.test.js","sourceRoot":"","sources":["../../test/taskings-mission.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B,IAAI,CAAC,2BAA2B,EAAE,CAAC,CAAC,EAAE,EAAE;IACpC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAC,OAAO,EAAC,EAAC,aAAa,EAAC,EAAC,KAAK,EAAC,WAAW,EAAC,MAAM,EAAC,SAAS,EAAC,SAA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AS;YACf,IAAI,EAAE,GAAG;YACT,UAAU,EAAE;gBACR,QAAQ,EAAE,SAAS;gBACnB,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE;gBACnB,IAAI,EAAE,WAAW;gBACjB,GAAG,EAAE,WAAW;gBAChB,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE,sBAAsB;gBAC7B,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,sCAAsC;oBAC5C,SAAS,EAAE,0BAA0B;iBACxC;gBACD,QAAQ,EAAE,EAAE;aACf;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE;aAC3B;SACJ,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,CAAC,CAAC,GAAG,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC"}
@@ -1,25 +0,0 @@
1
- import test from 'tape';
2
- import Util from '../lib/utils/util.js';
3
- test('Util.cot_date - default', (t) => {
4
- const res = Util.cot_date();
5
- // Within 100ms of current time
6
- t.ok(+new Date(res.time) > +new Date() - 100, 'res.time within 100ms of current time');
7
- // res.start is the same as res.time
8
- t.equals(+new Date(res.start), +new Date(res.time), 'by default res.start === res.time');
9
- // Approx 20s ahead of start
10
- t.ok(+new Date(res.stale) > +new Date(res.start) + 20 * 1000 - 100);
11
- t.ok(+new Date(res.stale) < +new Date(res.start) + 20 * 1000 + 100);
12
- t.end();
13
- });
14
- test('Util.cot_date - stale', (t) => {
15
- const res = Util.cot_date(null, null, 1000);
16
- // Within 100ms of current time
17
- t.ok(+new Date(res.time) > +new Date() - 100, 'res.time within 100ms of current time');
18
- // res.start is the same as res.time
19
- t.equals(+new Date(res.start), +new Date(res.time), 'by default res.start === res.time');
20
- // Approx 1s ahead of start
21
- t.ok(+new Date(res.stale) > +new Date(res.start) + 1 * 1000 - 100);
22
- t.ok(+new Date(res.stale) < +new Date(res.start) + 1 * 1000 + 100);
23
- t.end();
24
- });
25
- //# sourceMappingURL=util.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.test.js","sourceRoot":"","sources":["../../test/util.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC,EAAE,EAAE;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAE5B,+BAA+B;IAC/B,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,GAAG,GAAG,EAAE,uCAAuC,CAAC,CAAC;IAEvF,oCAAoC;IACpC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,mCAAmC,CAAC,CAAC;IAEzF,4BAA4B;IAC5B,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC;IACpE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC;IAEpE,CAAC,CAAC,GAAG,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,EAAE;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAE5C,+BAA+B;IAC/B,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,GAAG,GAAG,EAAE,uCAAuC,CAAC,CAAC;IAEvF,oCAAoC;IACpC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,mCAAmC,CAAC,CAAC;IAEzF,2BAA2B;IAC3B,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC;IACnE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC;IAEnE,CAAC,CAAC,GAAG,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
- test('CoT.from_geojson - Point', (t) => {
4
- try {
5
- new CoT({ event: { _attributes: {} } });
6
- t.fail();
7
- }
8
- catch (err) {
9
- t.ok(String(err).includes('must have required property'));
10
- }
11
- t.end();
12
- });
13
- //# sourceMappingURL=validation.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.test.js","sourceRoot":"","sources":["../../test/validation.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B,IAAI,CAAC,0BAA0B,EAAE,CAAC,CAAC,EAAE,EAAE;IACnC,IAAI,CAAC;QACD,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,CAAC,CAAC,GAAG,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <customMapSource>
3
- <name>Bing Hybrid</name>
4
- <minZoom>0</minZoom>
5
- <maxZoom>20</maxZoom>
6
- <tileType>png</tileType>
7
- <url>https://ecn.t2.tiles.virtualearth.net/tiles/h{$q}?g=761&amp;mkt=en-us</url>
8
- <tileUpdate>None</tileUpdate>
9
- <backgroundColor>#000000</backgroundColor>
10
- <ignoreErrors>false</ignoreErrors>
11
- <serverParts />
12
- </customMapSource>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <customMapSource>
3
- <name>Bing Street</name>
4
- <minZoom>0</minZoom>
5
- <maxZoom>20</maxZoom>
6
- <tileType>png</tileType>
7
- <tileUpdate>None</tileUpdate>
8
- <url>https://r0.ortho.tiles.virtualearth.net/tiles/r{$q}.png?g=45</url>
9
- <backgroundColor>#000000</backgroundColor>
10
- </customMapSource>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <customMapSource>
3
- <name>USGS</name>
4
- <minZoom>0</minZoom>
5
- <maxZoom>15</maxZoom>
6
- <tileType>png</tileType>
7
- <tileUpdate>None</tileUpdate>
8
- <url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSTopo/MapServer/tile/{$z}/{$y}/{$x}</url>
9
- <backgroundColor>#000000</backgroundColor>
10
- </customMapSource>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <customMapSource>
3
- <name>USGSImageryOnly</name>
4
- <minZoom>0</minZoom>
5
- <maxZoom>15</maxZoom>
6
- <tileType>png</tileType>
7
- <tileUpdate>None</tileUpdate>
8
- <url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/{$z}/{$y}/{$x}</url>
9
- <backgroundColor>#000000</backgroundColor>
10
- </customMapSource>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <customMapSource>
3
- <name>USGSImageryTopo</name>
4
- <minZoom>0</minZoom>
5
- <maxZoom>15</maxZoom>
6
- <tileType>png</tileType>
7
- <tileUpdate>None</tileUpdate>
8
- <url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryTopo/MapServer/tile/{$z}/{$y}/{$x}</url>
9
- <backgroundColor>#000000</backgroundColor>
10
- </customMapSource>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <customMapSource>
3
- <name>USGSShadedRelief</name>
4
- <minZoom>0</minZoom>
5
- <maxZoom>15</maxZoom>
6
- <tileType>png</tileType>
7
- <tileUpdate>None</tileUpdate>
8
- <url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/tile/{$z}/{$y}/{$x}</url>
9
- <backgroundColor>#000000</backgroundColor>
10
- </customMapSource>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <customMapSource>
3
- <name>Open Topo Map</name>
4
- <minZoom>1</minZoom>
5
- <maxZoom>17</maxZoom>
6
- <tileType>PNG</tileType>
7
- <tileUpdate>IfNoneMatch</tileUpdate>
8
- <serverParts>a b c</serverParts>
9
- <url>https://{$serverpart}.tile.opentopomap.org/{$z}/{$x}/{$y}.png</url>
10
- </customMapSource>
@@ -1,19 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import test from 'tape';
4
- import { Basemap } from '../index.js';
5
- import { fileURLToPath } from 'node:url';
6
-
7
- for (const fixturename of await fs.readdir(new URL('./basemaps/', import.meta.url))) {
8
- test(`Basemap Test: ${fixturename}`, async (t) => {
9
- const fixture = String(await fs.readFile(path.join(path.parse(fileURLToPath(import.meta.url)).dir, 'basemaps/', fixturename)));
10
- const container = await Basemap.parse(fixture);
11
-
12
- t.ok(container.raw.customMapSource.name._text.length)
13
-
14
- const json = container.to_json();
15
- t.ok(json.name && json.name.length);
16
-
17
- t.end();
18
- });
19
- }
package/test/chat.test.ts DELETED
@@ -1,103 +0,0 @@
1
- import test from 'tape';
2
- import { DirectChat } from '../index.js';
3
-
4
- test('DirectChat - Basic', (t) => {
5
- const cot = new DirectChat({
6
- to: {
7
- uid: '123456',
8
- callsign: 'Alpha Operator'
9
- },
10
- from: {
11
- uid: '654321',
12
- callsign: 'Bravo Operator'
13
- },
14
- message: 'Direct Message Test'
15
- });
16
-
17
- t.equals(cot.is_chat(), true);
18
-
19
- t.ok(cot.raw.event._attributes.uid);
20
- cot.raw.event._attributes.uid = '123';
21
-
22
- if (!cot.raw.event.detail) {
23
- t.fail('No Detail Section')
24
- } else {
25
- t.ok(cot.raw.event.detail['_flow-tags_']);
26
- delete cot.raw.event.detail['_flow-tags_'];
27
-
28
- t.equals(typeof cot.raw.event._attributes.time, 'string');
29
- cot.raw.event._attributes.time = '2024-04-01'
30
- t.equals(typeof cot.raw.event._attributes.start, 'string');
31
- cot.raw.event._attributes.start = '2024-04-01'
32
- t.equals(typeof cot.raw.event._attributes.stale, 'string');
33
- cot.raw.event._attributes.stale = '2024-04-01'
34
-
35
- if (!cot.raw.event.detail.__chat) {
36
- t.fail('No Chat Section')
37
- } else {
38
- t.equals(typeof cot.raw.event.detail.__chat._attributes.messageId, 'string');
39
- cot.raw.event.detail.__chat._attributes.messageId = '123';
40
- }
41
-
42
- if (!cot.raw.event.detail.remarks || !cot.raw.event.detail.remarks._attributes) {
43
- t.fail('No Remarks Section')
44
- } else {
45
- t.equals(typeof cot.raw.event.detail.remarks._attributes.time, 'string');
46
- cot.raw.event.detail.remarks._attributes.time = '123';
47
- }
48
-
49
- t.deepEquals(cot.raw, {
50
- event: {
51
- _attributes: {
52
- uid: '123',
53
- version: '2.0',
54
- type: 'b-t-f',
55
- how: 'h-g-i-g-o',
56
-
57
- time: '2024-04-01',
58
- stale: '2024-04-01',
59
- start: '2024-04-01'
60
- },
61
- point: {
62
- _attributes: { lat: '0.000000', lon: '0.000000', hae: '0.0', ce: '9999999.0', le: '9999999.0' }
63
- },
64
- detail: {
65
- __chat: {
66
- _attributes: {
67
- parent: 'RootContactGroup',
68
- groupOwner: 'false',
69
- messageId: '123',
70
- chatroom: 'Alpha Operator',
71
- id: '123456',
72
- senderCallsign: 'Bravo Operator'
73
- },
74
- chatgrp: {
75
- _attributes: {
76
- uid0: "654321",
77
- uid1:"123456",
78
- id:"123456"
79
- }
80
- }
81
- },
82
- link: {
83
- _attributes: {
84
- uid: '654321',
85
- type: 'a-f-G',
86
- relation: 'p-p'
87
- }
88
- },
89
- remarks: {
90
- _attributes: {
91
- source: '654321',
92
- to: '123456',
93
- time: '123'
94
- },
95
- _text: 'Direct Message Test'
96
- }
97
- }
98
- }
99
- });
100
- }
101
-
102
- t.end();
103
- });
@@ -1,92 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('Decode MultiMissionAircraft CoTs', (t) => {
5
- const cot = new CoT({"event":{"_attributes":{"version":"2.0","uid":"d60e38c2-6c51-4f69-bff9-c5cbc6b44a76","type":"b-f-t-r","how":"h-e","time":"2024-07-02T17:13:20Z","start":"2024-07-02T17:13:19Z","stale":"2024-07-02T17:13:29Z"},"point":{"_attributes":{"lat":"39.07853","lon":"-108.537397","hae":"1400.49561947","ce":"9.9350462","le":"NaN"}},"detail":{"fileshare":{"_attributes":{"filename":"20240615_144641.jpg.zip","senderUrl":"https://18.254.242.65:8443/Marti/sync/content?hash=c18e00d123057a8e33107e91ab02f999ecc6f849aed2a41b84e237ff36106a4e","sizeInBytes":"4233884","sha256":"c18e00d123057a8e33107e91ab02f999ecc6f849aed2a41b84e237ff36106a4e","senderUid":"ANDROID-0ca41830e11d2ef3","senderCallsign":"DFPC Ingalls","name":"20240615_144641.jpg"}},"ackrequest":{"_attributes":{"uid":"814d0d4a-3339-4fd2-8e09-0556444112f3","ackrequested":"true","tag":"20240615_144641.jpg"}},"_flow-tags_":{"_attributes":{"TAK-Server-e87a0e02420b44a08f6032bcf1877745":"2024-07-02T17:13:20Z"}}}}});
6
-
7
- if (!cot.raw.event.detail) {
8
- t.fail('No Detail Section')
9
- } else {
10
- t.ok(cot.raw.event.detail['_flow-tags_']);
11
- delete cot.raw.event.detail['_flow-tags_'];
12
-
13
- t.deepEquals({
14
- "event":{
15
- "_attributes":{
16
- "version":"2.0",
17
- "uid":"d60e38c2-6c51-4f69-bff9-c5cbc6b44a76",
18
- "time":"2024-07-02T17:13:20Z",
19
- "start":"2024-07-02T17:13:19Z",
20
- "stale":"2024-07-02T17:13:29Z",
21
- "type":"b-f-t-r",
22
- "how":"h-e"
23
- },
24
- "point":{
25
- "_attributes":{
26
- "lat":"39.07853",
27
- "lon":"-108.537397",
28
- "hae":"1400.49561947",
29
- "ce":"9.9350462",
30
- "le":"NaN"
31
- }
32
- },
33
- "detail":{
34
- ackrequest: {
35
- "_attributes": {
36
- "uid": "814d0d4a-3339-4fd2-8e09-0556444112f3",
37
- "ackrequested": true,
38
- "tag": "20240615_144641.jpg"
39
- }
40
- },
41
- fileshare: {
42
- "_attributes": {
43
- "filename": "20240615_144641.jpg.zip",
44
- "senderUrl": "https://18.254.242.65:8443/Marti/sync/content?hash=c18e00d123057a8e33107e91ab02f999ecc6f849aed2a41b84e237ff36106a4e",
45
- "sizeInBytes": 4233884,
46
- "sha256": "c18e00d123057a8e33107e91ab02f999ecc6f849aed2a41b84e237ff36106a4e",
47
- "senderUid": "ANDROID-0ca41830e11d2ef3",
48
- "senderCallsign": "DFPC Ingalls",
49
- "name": "20240615_144641.jpg"
50
- }
51
- }
52
- }
53
- }
54
- }, cot.raw);
55
-
56
- t.deepEquals({
57
- id: 'd60e38c2-6c51-4f69-bff9-c5cbc6b44a76',
58
- type: 'Feature',
59
- path: '/',
60
- properties: {
61
- callsign: 'UNKNOWN',
62
- type: 'b-f-t-r',
63
- how: 'h-e',
64
- center: [-108.537397, 39.07853, 1400.49561947],
65
- time: '2024-07-02T17:13:20Z',
66
- start: '2024-07-02T17:13:19Z',
67
- stale: '2024-07-02T17:13:29Z',
68
- ackrequest: {
69
- "uid": "814d0d4a-3339-4fd2-8e09-0556444112f3",
70
- "ackrequested": true,
71
- "tag": "20240615_144641.jpg"
72
- },
73
- fileshare: {
74
- "filename": "20240615_144641.jpg.zip",
75
- "senderUrl": "https://18.254.242.65:8443/Marti/sync/content?hash=c18e00d123057a8e33107e91ab02f999ecc6f849aed2a41b84e237ff36106a4e",
76
- "sizeInBytes": 4233884,
77
- "sha256": "c18e00d123057a8e33107e91ab02f999ecc6f849aed2a41b84e237ff36106a4e",
78
- "senderUid": "ANDROID-0ca41830e11d2ef3",
79
- "senderCallsign": "DFPC Ingalls",
80
- "name": "20240615_144641.jpg"
81
- },
82
- metadata: {},
83
- },
84
- geometry: {
85
- type: 'Point',
86
- coordinates: [-108.537397, 39.07853, 1400.49561947]
87
- }
88
- }, cot.to_geojson());
89
- }
90
-
91
- t.end();
92
- });
@@ -1,100 +0,0 @@
1
- import test from 'tape';
2
- import CoT from '../index.js';
3
-
4
- test('Decode iTAK COT message', (t) => {
5
- const packet = '<event version="2.0" uid="C94B9215-9BD4-4DBE-BDE1-83625F09153F" type="a-f-G-E-V-C" time="2023-07-18T15:23:09.00Z" start="2023-07-18T15:23:09.00Z" stale="2023-07-18T15:25:09.00Z" how="m-g"><point lat="41.52309645" lon="-107.72376567" hae="1681.23725821" ce="9999999" le="9999999" /><detail><contact callsign="DFPC-iSchmidt" phone="7204258729" endpoint="*:-1:stcp" /><uid Droid="DFPC-iSchmidt" /><__group name="Yellow" role="Team Member" /><precisionlocation geopointsrc="GPS" altsrc="???" /><status battery="100" /><takv device="iPhone" platform="iTAK" os="16.5.1" version="2.7.0.609" /><track speed="0.00000000" course="137.23542786" /></detail></event>';
6
-
7
- const cot = new CoT(packet);
8
-
9
- if (!cot.raw.event.detail) {
10
- t.fail('No Detail Section')
11
- } else {
12
- t.ok(cot.raw.event.detail['_flow-tags_']);
13
- delete cot.raw.event.detail['_flow-tags_'];
14
-
15
- t.deepEquals({
16
- 'event': {
17
- '_attributes': {
18
- 'version': '2.0',
19
- 'uid': 'C94B9215-9BD4-4DBE-BDE1-83625F09153F',
20
- 'type': 'a-f-G-E-V-C',
21
- 'time': '2023-07-18T15:23:09.00Z',
22
- 'start': '2023-07-18T15:23:09.00Z',
23
- 'stale': '2023-07-18T15:25:09.00Z',
24
- 'how': 'm-g',
25
- },
26
- 'point': {
27
- '_attributes': {
28
- 'lat': '41.52309645',
29
- 'lon': '-107.72376567',
30
- 'hae': '1681.23725821',
31
- 'ce': '9999999',
32
- 'le': '9999999'
33
- }
34
- },
35
- detail: {
36
- contact: {
37
- _attributes: {
38
- callsign: 'DFPC-iSchmidt',
39
- phone: '7204258729',
40
- endpoint: '*:-1:stcp'
41
- }
42
- },
43
- uid: { _attributes: { Droid: 'DFPC-iSchmidt' } },
44
- __group: { _attributes: { name: 'Yellow', role: 'Team Member' } },
45
- precisionlocation: { _attributes: { geopointsrc: 'GPS', altsrc: '???' } },
46
- status: { _attributes: { battery: '100' } },
47
- takv: { _attributes: { device: 'iPhone', platform: 'iTAK', os: '16.5.1', version: '2.7.0.609' } },
48
- track: { _attributes: { speed: '0.00000000', course: '137.23542786' } }
49
- }
50
- }
51
- }, cot.raw);
52
-
53
- t.deepEquals({
54
- id: 'C94B9215-9BD4-4DBE-BDE1-83625F09153F',
55
- type: 'Feature',
56
- path: '/',
57
- properties: {
58
- callsign: 'DFPC-iSchmidt',
59
- droid: "DFPC-iSchmidt",
60
- type: 'a-f-G-E-V-C',
61
- how: 'm-g',
62
- center: [ -107.72376567, 41.52309645, 1681.23725821 ],
63
- time: '2023-07-18T15:23:09.00Z',
64
- start: '2023-07-18T15:23:09.00Z',
65
- stale: '2023-07-18T15:25:09.00Z',
66
- course: 137.23542786,
67
- speed: 0,
68
- contact: {
69
- "phone": "7204258729",
70
- "endpoint": "*:-1:stcp"
71
- },
72
- metadata: {},
73
- group: {
74
- name: 'Yellow',
75
- role: 'Team Member'
76
- },
77
- precisionlocation: {
78
- "geopointsrc": "GPS",
79
- "altsrc": "???"
80
- },
81
- status: {
82
- "battery": "100"
83
- },
84
- takv: {
85
- "device": "iPhone",
86
- "platform": "iTAK",
87
- "os": "16.5.1",
88
- "version": "2.7.0.609"
89
- }
90
-
91
- },
92
- geometry: {
93
- type: 'Point',
94
- coordinates: [ -107.72376567, 41.52309645, 1681.23725821 ]
95
- }
96
- }, cot.to_geojson());
97
- }
98
-
99
- t.end();
100
- });