@airframes/acars-decoder 1.4.7 → 1.6.1

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 (135) hide show
  1. package/README.md +40 -1
  2. package/dist/index.d.mts +2 -0
  3. package/dist/index.d.ts +2 -4
  4. package/dist/index.js +2869 -19
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +2832 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +15 -18
  9. package/.github/FUNDING.yml +0 -12
  10. package/.github/workflows/yarn-test.yml +0 -21
  11. package/SECURITY.md +0 -18
  12. package/babel.config.js +0 -6
  13. package/coverage/clover.xml +0 -1799
  14. package/coverage/coverage-final.json +0 -24
  15. package/coverage/lcov-report/base.css +0 -224
  16. package/coverage/lcov-report/block-navigation.js +0 -87
  17. package/coverage/lcov-report/favicon.png +0 -0
  18. package/coverage/lcov-report/index.html +0 -131
  19. package/coverage/lcov-report/prettify.css +0 -1
  20. package/coverage/lcov-report/prettify.js +0 -2
  21. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  22. package/coverage/lcov-report/sorter.js +0 -196
  23. package/coverage/lcov.info +0 -2278
  24. package/dist/DateTimeUtils.d.ts +0 -8
  25. package/dist/DateTimeUtils.js +0 -27
  26. package/dist/DecoderPlugin.d.ts +0 -18
  27. package/dist/DecoderPlugin.js +0 -71
  28. package/dist/DecoderPluginInterface.d.ts +0 -7
  29. package/dist/DecoderPluginInterface.js +0 -3
  30. package/dist/IcaoDecoder.d.ts +0 -10
  31. package/dist/IcaoDecoder.js +0 -111
  32. package/dist/MessageDecoder.d.ts +0 -14
  33. package/dist/MessageDecoder.js +0 -129
  34. package/dist/bin/acars-decoder-test.d.ts +0 -2
  35. package/dist/bin/acars-decoder-test.js +0 -53
  36. package/dist/bin/acars-decoder.d.ts +0 -2
  37. package/dist/bin/acars-decoder.js +0 -20
  38. package/dist/plugins/Label_15.d.ts +0 -11
  39. package/dist/plugins/Label_15.js +0 -40
  40. package/dist/plugins/Label_16_N_Space.d.ts +0 -11
  41. package/dist/plugins/Label_16_N_Space.js +0 -80
  42. package/dist/plugins/Label_16_N_Space.test.d.ts +0 -1
  43. package/dist/plugins/Label_16_N_Space.test.js +0 -84
  44. package/dist/plugins/Label_1M_Slash.d.ts +0 -11
  45. package/dist/plugins/Label_1M_Slash.js +0 -61
  46. package/dist/plugins/Label_1M_Slash.test.d.ts +0 -1
  47. package/dist/plugins/Label_1M_Slash.test.js +0 -43
  48. package/dist/plugins/Label_20_CFB.01.d.ts +0 -11
  49. package/dist/plugins/Label_20_CFB.01.js +0 -69
  50. package/dist/plugins/Label_20_POS.d.ts +0 -11
  51. package/dist/plugins/Label_20_POS.js +0 -62
  52. package/dist/plugins/Label_30_Slash_EA.d.ts +0 -11
  53. package/dist/plugins/Label_30_Slash_EA.js +0 -54
  54. package/dist/plugins/Label_30_Slash_EA.test.d.ts +0 -1
  55. package/dist/plugins/Label_30_Slash_EA.test.js +0 -35
  56. package/dist/plugins/Label_44_ETA.d.ts +0 -11
  57. package/dist/plugins/Label_44_ETA.js +0 -69
  58. package/dist/plugins/Label_44_IN.d.ts +0 -11
  59. package/dist/plugins/Label_44_IN.js +0 -69
  60. package/dist/plugins/Label_44_OFF.d.ts +0 -11
  61. package/dist/plugins/Label_44_OFF.js +0 -74
  62. package/dist/plugins/Label_44_ON.d.ts +0 -11
  63. package/dist/plugins/Label_44_ON.js +0 -69
  64. package/dist/plugins/Label_44_POS.d.ts +0 -11
  65. package/dist/plugins/Label_44_POS.js +0 -81
  66. package/dist/plugins/Label_5Z.d.ts +0 -11
  67. package/dist/plugins/Label_5Z.js +0 -120
  68. package/dist/plugins/Label_80.d.ts +0 -12
  69. package/dist/plugins/Label_80.js +0 -203
  70. package/dist/plugins/Label_8E.d.ts +0 -10
  71. package/dist/plugins/Label_8E.js +0 -48
  72. package/dist/plugins/Label_8E.test.d.ts +0 -1
  73. package/dist/plugins/Label_8E.test.js +0 -32
  74. package/dist/plugins/Label_B6.d.ts +0 -11
  75. package/dist/plugins/Label_B6.js +0 -26
  76. package/dist/plugins/Label_ColonComma.d.ts +0 -10
  77. package/dist/plugins/Label_ColonComma.js +0 -28
  78. package/dist/plugins/Label_H1.d.ts +0 -9
  79. package/dist/plugins/Label_H1.js +0 -18
  80. package/dist/plugins/Label_H1_M1BPOS.d.ts +0 -11
  81. package/dist/plugins/Label_H1_M1BPOS.js +0 -54
  82. package/dist/plugins/Label_H1_M1BPRG.d.ts +0 -11
  83. package/dist/plugins/Label_H1_M1BPRG.js +0 -36
  84. package/dist/plugins/Label_QP.d.ts +0 -10
  85. package/dist/plugins/Label_QP.js +0 -49
  86. package/dist/plugins/Label_QQ.d.ts +0 -10
  87. package/dist/plugins/Label_QQ.js +0 -49
  88. package/dist/plugins/Label_QR.d.ts +0 -10
  89. package/dist/plugins/Label_QR.js +0 -49
  90. package/dist/plugins/Label_QS.d.ts +0 -10
  91. package/dist/plugins/Label_QS.js +0 -49
  92. package/dist/plugins/Label_SQ.d.ts +0 -10
  93. package/dist/plugins/Label_SQ.js +0 -104
  94. package/dist/plugins/official.d.ts +0 -22
  95. package/dist/plugins/official.js +0 -38
  96. package/jest.config.ts +0 -195
  97. package/src/DateTimeUtils.ts +0 -26
  98. package/src/DecoderPlugin.ts +0 -83
  99. package/src/DecoderPluginInterface.ts +0 -9
  100. package/src/IcaoDecoder.ts +0 -137
  101. package/src/MessageDecoder.ts +0 -117
  102. package/src/bin/acars-decoder-test.ts +0 -67
  103. package/src/bin/acars-decoder.ts +0 -23
  104. package/src/index.d.ts +0 -15
  105. package/src/index.ts +0 -4
  106. package/src/plugins/Label_15.ts +0 -45
  107. package/src/plugins/Label_16_N_Space.test.ts +0 -94
  108. package/src/plugins/Label_16_N_Space.ts +0 -91
  109. package/src/plugins/Label_1M_Slash.test.ts +0 -45
  110. package/src/plugins/Label_1M_Slash.ts +0 -69
  111. package/src/plugins/Label_20_CFB.01.ts +0 -81
  112. package/src/plugins/Label_20_POS.ts +0 -68
  113. package/src/plugins/Label_30_Slash_EA.test.ts +0 -37
  114. package/src/plugins/Label_30_Slash_EA.ts +0 -60
  115. package/src/plugins/Label_44_ETA.ts +0 -81
  116. package/src/plugins/Label_44_IN.ts +0 -81
  117. package/src/plugins/Label_44_OFF.ts +0 -88
  118. package/src/plugins/Label_44_ON.ts +0 -81
  119. package/src/plugins/Label_44_POS.ts +0 -96
  120. package/src/plugins/Label_5Z.ts +0 -125
  121. package/src/plugins/Label_80.ts +0 -215
  122. package/src/plugins/Label_8E.test.ts +0 -34
  123. package/src/plugins/Label_8E.ts +0 -55
  124. package/src/plugins/Label_B6.ts +0 -28
  125. package/src/plugins/Label_ColonComma.ts +0 -32
  126. package/src/plugins/Label_H1.ts +0 -18
  127. package/src/plugins/Label_H1_M1BPOS.ts +0 -60
  128. package/src/plugins/Label_H1_M1BPRG.ts +0 -40
  129. package/src/plugins/Label_QP.ts +0 -54
  130. package/src/plugins/Label_QQ.ts +0 -54
  131. package/src/plugins/Label_QR.ts +0 -54
  132. package/src/plugins/Label_QS.ts +0 -54
  133. package/src/plugins/Label_SQ.ts +0 -111
  134. package/src/plugins/official.ts +0 -22
  135. package/tsconfig.json +0 -16
@@ -1,54 +0,0 @@
1
- import { DecoderPlugin } from '../DecoderPlugin';
2
-
3
- export class Label_QS extends DecoderPlugin {
4
- name = 'label-qs';
5
-
6
- qualifiers() { // eslint-disable-line class-methods-use-this
7
- return {
8
- labels: ['QS'],
9
- };
10
- }
11
-
12
- decode(message: any, options: any = {}) : any {
13
- const decodeResult: any = this.defaultResult;
14
- decodeResult.decoder.name = this.name;
15
-
16
- decodeResult.raw.origin = message.text.substring(0, 4);
17
- decodeResult.raw.destination = message.text.substring(4, 8);
18
- decodeResult.raw.gate_in = message.text.substring(8, 12);
19
- decodeResult.remaining.text = message.text.substring(12);
20
-
21
- decodeResult.formatted.description = 'IN Report';
22
-
23
- decodeResult.formatted.items = [
24
- {
25
- type: 'origin',
26
- code: 'ORG',
27
- label: 'Origin',
28
- value: decodeResult.raw.origin,
29
- },
30
- {
31
- type: 'destination',
32
- code: 'DST',
33
- label: 'Destination',
34
- value: decodeResult.raw.destination,
35
- },
36
- {
37
- type: 'gate_in',
38
- code: 'GIN',
39
- label: 'Gate IN',
40
- value: decodeResult.raw.gate_in,
41
- }
42
- ];
43
-
44
- decodeResult.decoded = true;
45
- if(decodeResult.remaining.text === "")
46
- decodeResult.decoder.decodeLevel = 'full';
47
- else
48
- decodeResult.decoder.decodeLevel = 'partial';
49
-
50
- return decodeResult;
51
- }
52
- }
53
-
54
- export default {};
@@ -1,111 +0,0 @@
1
- import { DecoderPlugin } from '../DecoderPlugin';
2
-
3
- export class Label_SQ extends DecoderPlugin {
4
- name = 'label-sq';
5
-
6
- qualifiers() { // eslint-disable-line class-methods-use-this
7
- return {
8
- labels: ['SQ'],
9
- };
10
- }
11
-
12
- decode(message: any, options: any = {}) : any {
13
- const decodeResult: any = this.defaultResult;
14
- decodeResult.decoder.name = this.name;
15
-
16
- decodeResult.raw.preamble = message.text.substring(0, 4);
17
- decodeResult.raw.version = message.text.substring(1, 2);
18
- decodeResult.raw.network = message.text.substring(3, 4);
19
-
20
- if (decodeResult.raw.version === '2') {
21
- const regex = /0(\d)X(?<org>\w)(?<iata>\w\w\w)(?<icao>\w\w\w\w)(?<station>\d)(?<lat>\d+)(?<latd>[NS])(?<lng>\d+)(?<lngd>[EW])V(?<vfreq>\d+)\/.*/;
22
- const result = message.text.match(regex);
23
-
24
- if (result && result.length >= 8) {
25
- decodeResult.raw.groundStation = {
26
- number: result.groups.station,
27
- iataCode: result.groups.iata,
28
- icaoCode: result.groups.icao,
29
- coordinates: {
30
- latitude: (Number(result.groups.lat) / 100) * (result.groups.latd === 'S' ? -1 : 1),
31
- longitude: (Number(result.groups.lng) / 100) * (result.groups.lngd === 'W' ? -1 : 1)
32
- }
33
- }
34
- decodeResult.raw.vdlFrequency = result.groups.vfreq / 1000.0;
35
- }
36
- }
37
-
38
- decodeResult.formatted.description = 'Ground Station Squitter';
39
-
40
- var formattedNetwork = 'Unknown';
41
- if (decodeResult.raw.network == 'A') {
42
- formattedNetwork = 'ARINC';
43
- } else if (decodeResult.raw.network == 'S') {
44
- formattedNetwork = 'SITA';
45
- }
46
- decodeResult.formatted.items = [
47
- {
48
- type: 'network',
49
- label: 'Network',
50
- value: formattedNetwork,
51
- },
52
- {
53
- type: 'version',
54
- label: 'Version',
55
- value: decodeResult.raw.version,
56
- }
57
- ];
58
-
59
- if (decodeResult.raw.groundStation) {
60
- if (decodeResult.raw.groundStation.icaoCode && decodeResult.raw.groundStation.number) {
61
- decodeResult.formatted.items.push({
62
- type: 'ground_station',
63
- label: 'Ground Station',
64
- value: `${decodeResult.raw.groundStation.icaoCode}${decodeResult.raw.groundStation.number}`,
65
- });
66
- }
67
- if (decodeResult.raw.groundStation.iataCode) {
68
- decodeResult.formatted.items.push({
69
- type: 'iataCode',
70
- label: 'IATA',
71
- value: decodeResult.raw.groundStation.iataCode,
72
- });
73
- }
74
- if (decodeResult.raw.groundStation.icaoCode) {
75
- decodeResult.formatted.items.push({
76
- type: 'icaoCode',
77
- label: 'ICAO',
78
- value: decodeResult.raw.groundStation.icaoCode,
79
- });
80
- }
81
- if (decodeResult.raw.groundStation.coordinates.latitude) {
82
- decodeResult.formatted.items.push({
83
- type: 'coordinates',
84
- label: 'Ground Station Location',
85
- value: `${decodeResult.raw.groundStation.coordinates.latitude}, ${decodeResult.raw.groundStation.coordinates.longitude}`,
86
- });
87
- }
88
- if (decodeResult.raw.groundStation.airport) {
89
- decodeResult.formatted.items.push({
90
- type: 'airport',
91
- label: 'Airport',
92
- value: `${decodeResult.raw.groundStation.airport.name} (${decodeResult.raw.groundStation.airport.icao}) in ${decodeResult.raw.groundStation.airport.location}`,
93
- });
94
- }
95
- }
96
-
97
- if (decodeResult.raw.vdlFrequency) {
98
- decodeResult.formatted.items.push({
99
- type: 'vdlFrequency',
100
- label: 'VDL Frequency',
101
- value: `${decodeResult.raw.vdlFrequency} MHz`
102
- });
103
- }
104
- decodeResult.decoded = true;
105
- decodeResult.decoder.decodeLevel = 'full';
106
-
107
- return decodeResult;
108
- }
109
- }
110
-
111
- export default {};
@@ -1,22 +0,0 @@
1
- export * from './Label_5Z';
2
- export * from './Label_15';
3
- export * from './Label_16_N_Space';
4
- export * from './Label_20_POS';
5
- export * from './Label_30_Slash_EA';
6
- export * from './Label_44_ETA';
7
- export * from './Label_44_IN';
8
- export * from './Label_44_OFF';
9
- export * from './Label_44_ON';
10
- export * from './Label_44_POS';
11
- export * from './Label_80';
12
- export * from './Label_8E';
13
- export * from './Label_B6';
14
- export * from './Label_ColonComma';
15
- export * from './Label_H1_M1BPOS';
16
- export * from './Label_H1_M1BPRG';
17
- export * from './Label_1M_Slash';
18
- export * from './Label_SQ';
19
- export * from './Label_QR';
20
- export * from './Label_QP';
21
- export * from './Label_QS';
22
- export * from './Label_QQ';
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esNext",
4
- "module": "commonjs",
5
- "declaration": true,
6
- "outDir": "dist",
7
- "esModuleInterop": true,
8
- "strict": true
9
- },
10
- "include": [
11
- "src",
12
- ],
13
- "exclude": [
14
- "node_modules"
15
- ]
16
- }