@aeroswarm/codec 0.0.0-stage → 0.1.9

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 (93) hide show
  1. package/README.md +182 -3
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +1249 -0
  5. package/dist/surveillance/adsb/index.d.ts +16 -0
  6. package/dist/surveillance/adsb/index.d.ts.map +1 -0
  7. package/dist/surveillance/aftn/index.d.ts +3 -0
  8. package/dist/surveillance/aftn/index.d.ts.map +1 -0
  9. package/dist/surveillance/aftn/parser.d.ts +16 -0
  10. package/dist/surveillance/aftn/parser.d.ts.map +1 -0
  11. package/dist/surveillance/aftn/parser.test.d.ts +2 -0
  12. package/dist/surveillance/aftn/parser.test.d.ts.map +1 -0
  13. package/dist/surveillance/aftn/types.d.ts +75 -0
  14. package/dist/surveillance/aftn/types.d.ts.map +1 -0
  15. package/dist/surveillance/ais/index.d.ts +17 -0
  16. package/dist/surveillance/ais/index.d.ts.map +1 -0
  17. package/dist/surveillance/asmgcs/index.d.ts +14 -0
  18. package/dist/surveillance/asmgcs/index.d.ts.map +1 -0
  19. package/dist/surveillance/asterix/cat10/index.d.ts +3 -0
  20. package/dist/surveillance/asterix/cat10/index.d.ts.map +1 -0
  21. package/dist/surveillance/asterix/cat21/index.d.ts +5 -0
  22. package/dist/surveillance/asterix/cat21/index.d.ts.map +1 -0
  23. package/dist/surveillance/asterix/cat48/index.d.ts +5 -0
  24. package/dist/surveillance/asterix/cat48/index.d.ts.map +1 -0
  25. package/dist/surveillance/asterix/cat62/index.d.ts +3 -0
  26. package/dist/surveillance/asterix/cat62/index.d.ts.map +1 -0
  27. package/dist/surveillance/asterix/decoder.d.ts +14 -0
  28. package/dist/surveillance/asterix/decoder.d.ts.map +1 -0
  29. package/dist/surveillance/asterix/fields.d.ts +4 -0
  30. package/dist/surveillance/asterix/fields.d.ts.map +1 -0
  31. package/dist/surveillance/asterix/index.d.ts +5 -0
  32. package/dist/surveillance/asterix/index.d.ts.map +1 -0
  33. package/dist/surveillance/asterix/parser.d.ts +16 -0
  34. package/dist/surveillance/asterix/parser.d.ts.map +1 -0
  35. package/dist/surveillance/asterix/parser.test.d.ts +2 -0
  36. package/dist/surveillance/asterix/parser.test.d.ts.map +1 -0
  37. package/dist/surveillance/asterix/resolvers.d.ts +17 -0
  38. package/dist/surveillance/asterix/resolvers.d.ts.map +1 -0
  39. package/dist/surveillance/asterix/types.d.ts +56 -0
  40. package/dist/surveillance/asterix/types.d.ts.map +1 -0
  41. package/dist/surveillance/asterix/values.d.ts +10 -0
  42. package/dist/surveillance/asterix/values.d.ts.map +1 -0
  43. package/dist/surveillance/asterix/xml-loader.d.ts +46 -0
  44. package/dist/surveillance/asterix/xml-loader.d.ts.map +1 -0
  45. package/dist/surveillance/index.d.ts +7 -0
  46. package/dist/surveillance/index.d.ts.map +1 -0
  47. package/dist/surveillance/mlat/index.d.ts +16 -0
  48. package/dist/surveillance/mlat/index.d.ts.map +1 -0
  49. package/package.json +40 -6
  50. package/src/config/asterix.dtd +78 -0
  51. package/src/config/asterix.ini +17 -0
  52. package/src/config/asterix_bds.xml +462 -0
  53. package/src/config/asterix_cat001_1_1.xml +872 -0
  54. package/src/config/asterix_cat001_1_2.xml +836 -0
  55. package/src/config/asterix_cat002_1_0.xml +258 -0
  56. package/src/config/asterix_cat004_1_12.xml +1713 -0
  57. package/src/config/asterix_cat008_1_0.xml +353 -0
  58. package/src/config/asterix_cat010_1_1.xml +791 -0
  59. package/src/config/asterix_cat011_1_2.xml +1691 -0
  60. package/src/config/asterix_cat019_1_2.xml +293 -0
  61. package/src/config/asterix_cat020_1_7.xml +1256 -0
  62. package/src/config/asterix_cat021_0_26.xml +902 -0
  63. package/src/config/asterix_cat021_1_4.xml +1594 -0
  64. package/src/config/asterix_cat021_1_8.xml +1594 -0
  65. package/src/config/asterix_cat021_2_4.xml +2191 -0
  66. package/src/config/asterix_cat023_1_2.xml +357 -0
  67. package/src/config/asterix_cat025_1_2.xml +306 -0
  68. package/src/config/asterix_cat030_6_2.xml +1387 -0
  69. package/src/config/asterix_cat031_6_2.xml +214 -0
  70. package/src/config/asterix_cat032_6_2.xml +465 -0
  71. package/src/config/asterix_cat032_7_0.xml +702 -0
  72. package/src/config/asterix_cat034_1_26.xml +586 -0
  73. package/src/config/asterix_cat034_1_27.xml +683 -0
  74. package/src/config/asterix_cat048_1_14.xml +1142 -0
  75. package/src/config/asterix_cat048_1_21.xml +1241 -0
  76. package/src/config/asterix_cat062_0_17.xml +1442 -0
  77. package/src/config/asterix_cat062_1_16.xml +3031 -0
  78. package/src/config/asterix_cat062_1_18.xml +3303 -0
  79. package/src/config/asterix_cat062_1_7.xml +2817 -0
  80. package/src/config/asterix_cat062_1_9.xml +737 -0
  81. package/src/config/asterix_cat063_1_3.xml +298 -0
  82. package/src/config/asterix_cat065_1_2.xml +168 -0
  83. package/src/config/asterix_cat065_1_3.xml +183 -0
  84. package/src/config/asterix_cat094_0_1.xml +1103 -0
  85. package/src/config/asterix_cat205_1_0.xml +385 -0
  86. package/src/config/asterix_cat240_1_3.xml +289 -0
  87. package/src/config/asterix_cat242_1_0.xml +644 -0
  88. package/src/config/asterix_cat247_1_2.xml +92 -0
  89. package/src/config/asterix_cat252_6_1.xml +1826 -0
  90. package/src/config/asterix_cat252_6_2.xml +1831 -0
  91. package/src/config/asterix_cat252_7_0.xml +1867 -0
  92. package/src/config/eurocontroll_version/asterix-spec.xsd +343 -0
  93. package/src/config/eurocontroll_version/asterix_cat094.xml +457 -0
@@ -0,0 +1,16 @@
1
+ export interface AdsbRawFrame {
2
+ raw: Buffer;
3
+ receivedAt: number;
4
+ }
5
+ export interface AdsbDecodedFrame {
6
+ icao24: string;
7
+ df: number;
8
+ lat?: number;
9
+ lon?: number;
10
+ altitudeFt?: number;
11
+ groundSpeedKt?: number;
12
+ headingDeg?: number;
13
+ callsign?: string;
14
+ }
15
+ export declare function decodeAdsbFrame(_frame: AdsbRawFrame): AdsbDecodedFrame | null;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/surveillance/adsb/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAE7E"}
@@ -0,0 +1,3 @@
1
+ export { parseAftn, splitAftnStream } from "./parser.js";
2
+ export type { AftnMessage, AftnHeader, ParseAftnOptions } from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/surveillance/aftn/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AftnMessage, ParseAftnOptions } from "./types.js";
2
+ /**
3
+ * Parse one AFTN message (raw datagram / TCP-delimited text).
4
+ *
5
+ * Tolerant of gateway framing: control characters (SOH/STX/ETX), a
6
+ * classic `ZCZC` start line, `NNNN` terminator and unknown header lines are
7
+ * ignored. Returns `null` when no `( … )` ATS message body is present.
8
+ */
9
+ export declare function parseAftn(input: string | Buffer, options?: ParseAftnOptions): AftnMessage | null;
10
+ /** Split a TCP byte stream into complete messages: a message ends at `NNNN`
11
+ * or ETX (0x03). Returns the complete messages and the unconsumed tail. */
12
+ export declare function splitAftnStream(buffer: string): {
13
+ messages: string[];
14
+ rest: string;
15
+ };
16
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/surveillance/aftn/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAsN5E;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,WAAW,GAAG,IAAI,CAsCpG;AAED;4EAC4E;AAC5E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAapF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.test.d.ts","sourceRoot":"","sources":["../../../src/surveillance/aftn/parser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ /** Parsed AFTN message header (priority / addressees / origin group). */
2
+ export interface AftnHeader {
3
+ /** Priority indicator: SS, DD, FF, GG or KK */
4
+ priority?: string;
5
+ /** 8-letter addressee indicators */
6
+ addressees: string[];
7
+ /** Origin time group, DDHHMM (UTC) */
8
+ originTime?: string;
9
+ /** 8-letter originator indicator */
10
+ originator?: string;
11
+ }
12
+ /**
13
+ * One parsed ATS message (ICAO Doc 4444 App. 3 formats: FPL, CHG, DLA, DEP,
14
+ * ARR, CNL; any other 3-letter type is returned with identity fields only).
15
+ *
16
+ * Plain JSON — safe to publish on Kafka as-is.
17
+ */
18
+ export interface AftnMessage {
19
+ /** FPL | CHG | DLA | DEP | ARR | CNL | … */
20
+ type: string;
21
+ header: AftnHeader;
22
+ /** Message text from "(" to ")" with line breaks normalised to spaces */
23
+ text: string;
24
+ /** Aircraft identification (item 7), upper-case */
25
+ callsign?: string;
26
+ /** I (IFR) · V (VFR) · Y (IFR→VFR) · Z (VFR→IFR) */
27
+ flightRules?: string;
28
+ /** S scheduled · N non-scheduled · G general · M military · X other */
29
+ flightType?: string;
30
+ /** ICAO aircraft type designator, e.g. A320 */
31
+ aircraftType?: string;
32
+ /** L / M / H / J */
33
+ wake?: string;
34
+ /** Item 10 as sent (communication/navigation/surveillance equipment) */
35
+ equipment?: string;
36
+ /** Departure aerodrome (ICAO) */
37
+ adep?: string;
38
+ /** Destination aerodrome (ICAO) */
39
+ ades?: string;
40
+ /** Estimated off-block time HHMM (FPL), or the new EOBT (DLA) */
41
+ eobt?: string;
42
+ /** Actual time of departure HHMM (DEP) */
43
+ atd?: string;
44
+ /** Actual time of arrival HHMM (ARR) */
45
+ ata?: string;
46
+ /** Estimated elapsed time HHMM (FPL item 16) */
47
+ eet?: string;
48
+ /** Cruising speed group, e.g. N0450 / M078 / K0830 */
49
+ cruiseSpeed?: string;
50
+ /** Cruising level group, e.g. F350 / A045 / S1010 / VFR */
51
+ cruiseLevel?: string;
52
+ /** Route string (airways, fixes, DCT, coordinates) after speed/level */
53
+ route?: string;
54
+ /** Alternate aerodromes */
55
+ alternates?: string[];
56
+ /** Item 18 keyed entries: REG, DOF, EET, CODE, PBN, NAV, OPR, RMK, … */
57
+ other: Record<string, string>;
58
+ /** Aircraft registration (REG/) */
59
+ registration?: string;
60
+ /** 24-bit Mode-S address, lower-case hex (CODE/) — correlates with a track's icao24 */
61
+ icao24?: string;
62
+ /** Date of flight YYMMDD (DOF/) */
63
+ dof?: string;
64
+ /** CHG only: ICAO item number → new data */
65
+ changes?: Record<string, string>;
66
+ /** Epoch ms (UTC) resolved from DOF/origin day + the HHMM groups above */
67
+ eobtAt?: number;
68
+ atdAt?: number;
69
+ ataAt?: number;
70
+ }
71
+ export interface ParseAftnOptions {
72
+ /** Reference time used to resolve month/year when DOF/ is absent. Default: now. */
73
+ now?: number;
74
+ }
75
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/surveillance/aftn/types.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IAEb,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,17 @@
1
+ export interface AisRawSentence {
2
+ raw: string;
3
+ receivedAt: number;
4
+ }
5
+ export interface AisDecodedMessage {
6
+ mmsi: string;
7
+ messageType: number;
8
+ lat?: number;
9
+ lon?: number;
10
+ sog?: number;
11
+ cog?: number;
12
+ heading?: number;
13
+ name?: string;
14
+ callsign?: string;
15
+ }
16
+ export declare function decodeAis(_sentence: AisRawSentence): AisDecodedMessage | null;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/surveillance/ais/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAE7E"}
@@ -0,0 +1,14 @@
1
+ export interface AsmgcsRawFrame {
2
+ raw: Buffer;
3
+ receivedAt: number;
4
+ }
5
+ export interface AsmgcsDecodedFrame {
6
+ targetId: string;
7
+ lat?: number;
8
+ lon?: number;
9
+ heading?: number;
10
+ speed?: number;
11
+ category?: "aircraft" | "vehicle" | "unknown";
12
+ }
13
+ export declare function decodeAsmgcsFrame(_frame: AsmgcsRawFrame): AsmgcsDecodedFrame | null;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asmgcs/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;CAC/C;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,kBAAkB,GAAG,IAAI,CAEnF"}
@@ -0,0 +1,3 @@
1
+ export type { AsterixRecord, AsterixFields } from "../types.js";
2
+ export { parseAsterix } from "../parser.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/surveillance/asterix/cat10/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type { AsterixRecord, AsterixFields } from "../types.js";
2
+ export { parseAsterix } from "../parser.js";
3
+ export { resolveAsterixPosition, resolveAsterixAltitudeFt } from "../resolvers.js";
4
+ export type { RadarSite } from "../resolvers.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/surveillance/asterix/cat21/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AACnF,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type { AsterixRecord, AsterixFields } from "../types.js";
2
+ export { parseAsterix } from "../parser.js";
3
+ export { resolveAsterixPosition, resolveAsterixAltitudeFt } from "../resolvers.js";
4
+ export type { RadarSite } from "../resolvers.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/surveillance/asterix/cat48/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AACnF,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { AsterixRecord, AsterixFields } from "../types.js";
2
+ export { parseAsterix } from "../parser.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/surveillance/asterix/cat62/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { AsterixDef, ItemDef } from './xml-loader.js';
2
+ /** Returns boolean array of data bits (FX bits excluded) and byte length consumed. */
3
+ export declare function parseFspec(buf: Buffer, start?: number): {
4
+ bits: boolean[];
5
+ end: number;
6
+ };
7
+ /** Advance offset past one DataItem, returning new offset. */
8
+ export declare function skipItem(buf: Buffer, off: number, def: ItemDef): number;
9
+ /**
10
+ * Decode one ASTERIX data block (everything after the 3-byte header).
11
+ * Calls `onField(id, bytes, itemDef)` for each present DataItem.
12
+ */
13
+ export declare function decodeBlock(block: Buffer, def: AsterixDef, onField: (id: string, data: Buffer, itemDef: ItemDef) => void): void;
14
+ //# sourceMappingURL=decoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI3D,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG;IAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAUnF;AAID,8DAA8D;AAC9D,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,CAiDvE;AAID;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAC5D,IAAI,CAyBN"}
@@ -0,0 +1,4 @@
1
+ import type { AsterixFields } from './types.js';
2
+ import type { RawValues } from './values.js';
3
+ export declare function decodeKnownField(cat: number, id: string, data: Buffer, out: AsterixFields, raw?: RawValues): void;
4
+ //# sourceMappingURL=fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoE7C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAE,SAAc,GAAG,IAAI,CAWrH"}
@@ -0,0 +1,5 @@
1
+ export { parseAsterix } from './parser.js';
2
+ export { resolveAsterixPosition, resolveAsterixAltitudeFt } from './resolvers.js';
3
+ export type { RadarSite } from './resolvers.js';
4
+ export type { AsterixRecord, AsterixFields } from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AsterixRecord } from './types.js';
2
+ /**
3
+ * Parse raw ASTERIX UDP datagram into structured records.
4
+ *
5
+ * Strategy:
6
+ * 1. Parse the ASTERIX frame header (cat, length).
7
+ * 2. For each category, try editions from latest to oldest.
8
+ * 3. Accept the first decode that produces plausible coordinates.
9
+ * 4. If no edition succeeds, the record is dropped silently.
10
+ *
11
+ * @param buf Raw ASTERIX datagram (may contain multiple records)
12
+ * @param defaultEdition Optional map of category → edition to skip the fallback loop.
13
+ * Use when you know the sender's edition for certainty.
14
+ */
15
+ export declare function parseAsterix(buf: Buffer, defaultEdition?: Record<number, string>): AsterixRecord[];
16
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,YAAY,CAAC;AAsB/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,aAAa,EAAE,CA6CjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.test.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/parser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import type { AsterixFields } from './types.js';
2
+ export interface RadarSite {
3
+ lat: number;
4
+ lon: number;
5
+ }
6
+ /**
7
+ * Resolve a geodetic position from decoded ASTERIX fields.
8
+ * - CAT021 / CAT020: direct lat/lon fields
9
+ * - CAT048: cartesian (NM offset) or polar (range + azimuth) → geodetic via radar site
10
+ */
11
+ export declare function resolveAsterixPosition(fields: AsterixFields, radarSite?: RadarSite | null): {
12
+ lat: number;
13
+ lon: number;
14
+ } | null;
15
+ /** Best altitude (ft) across all category field naming conventions. */
16
+ export declare function resolveAsterixAltitudeFt(fields: AsterixFields): number | undefined;
17
+ //# sourceMappingURL=resolvers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,EACrB,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,GAC3B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA0BrC;AAED,uEAAuE;AACvE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAElF"}
@@ -0,0 +1,56 @@
1
+ export interface AsterixFields {
2
+ icao24?: string;
3
+ lat?: number;
4
+ lon?: number;
5
+ altitudeFt?: number;
6
+ callsign?: string;
7
+ squawk?: string;
8
+ timeOfDay?: number;
9
+ velocity?: {
10
+ groundSpeedKt?: number;
11
+ headingDeg?: number;
12
+ };
13
+ positionCartesian?: {
14
+ xNm?: number;
15
+ yNm?: number;
16
+ };
17
+ measuredPosition?: {
18
+ rangeNm?: number;
19
+ azimuthDeg?: number;
20
+ };
21
+ dataSource?: {
22
+ sac: number;
23
+ sic: number;
24
+ };
25
+ /** I023/000: 1 = ground station status, 2 = service status, 3 = service statistics */
26
+ reportType?: number;
27
+ /** I023/100 first octet: nogo=true means data must not be used operationally */
28
+ gsStatus?: {
29
+ nogo: boolean;
30
+ odp: boolean;
31
+ oxt: boolean;
32
+ msc: boolean;
33
+ tsv: boolean;
34
+ spo: boolean;
35
+ };
36
+ /** I023/200: operational range, 1 NM/LSB */
37
+ operationalRangeNm?: number;
38
+ /** Surface target classification. "vehicle" when a fleet id is present */
39
+ targetType?: 'aircraft' | 'vehicle' | 'unknown';
40
+ /** I010/300 Vehicle Fleet Identification code */
41
+ vehicleFleet?: number;
42
+ /** Sensor-assigned local track number */
43
+ trackNumber?: number;
44
+ /** TST bit — test target */
45
+ testTarget?: boolean;
46
+ /** RAB bit — report from a fixed field-monitor transponder (MLAT RPU etc.) */
47
+ fixedTransponder?: boolean;
48
+ /** SIM bit — simulated target */
49
+ simulated?: boolean;
50
+ }
51
+ export interface AsterixRecord {
52
+ category: number;
53
+ edition: string;
54
+ fields: AsterixFields;
55
+ }
56
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,iBAAiB,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,gBAAgB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D,UAAU,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAE1C,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,CAAC;IACnG,4CAA4C;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IAChD,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;CACvB"}
@@ -0,0 +1,10 @@
1
+ import type { BitFieldDef } from './xml-loader.js';
2
+ /** Raw named values extracted from one DataItem via its XML <Bits> definitions. */
3
+ export type RawValues = Record<string, number | string>;
4
+ /**
5
+ * Extract every named bit-field from a DataItem's raw bytes, applying the
6
+ * signedness, character/octal/hex encoding, and unit scale declared in the XML.
7
+ * Bit positions are 1-based with 1 = LSB of the last byte (ASTERIX convention).
8
+ */
9
+ export declare function extractBitFields(data: Buffer, defs: BitFieldDef[]): RawValues;
10
+ //# sourceMappingURL=values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,mFAAmF;AACnF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAIxD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,SAAS,CAkD7E"}
@@ -0,0 +1,46 @@
1
+ /** One named bit-field inside a DataItem, parsed from the XML <Bits> definition.
2
+ * Bit positions are 1-based, 1 = LSB of the item's last byte. */
3
+ export interface BitFieldDef {
4
+ name: string;
5
+ high: number;
6
+ low: number;
7
+ encode: 'unsigned' | 'signed' | '6bitschar' | 'octal' | 'hex' | 'ascii';
8
+ /** Multiplier from <BitsUnit scale=…>; 1 when absent */
9
+ scale: number;
10
+ }
11
+ export type FixedDef = {
12
+ type: 'fixed';
13
+ bytes: number;
14
+ bits?: BitFieldDef[];
15
+ };
16
+ export type VariableDef = {
17
+ type: 'variable';
18
+ chunkBytes: number;
19
+ bits?: BitFieldDef[];
20
+ };
21
+ export type RepDef = {
22
+ type: 'repetitive';
23
+ repBytes: number;
24
+ itemBytes: number;
25
+ };
26
+ export type CompoundDef = {
27
+ type: 'compound';
28
+ indicatorChunk: number;
29
+ subs: SubItemDef[];
30
+ };
31
+ export type ExplicitDef = {
32
+ type: 'explicit';
33
+ };
34
+ export type SubItemDef = FixedDef | VariableDef | RepDef | ExplicitDef;
35
+ export type ItemDef = FixedDef | VariableDef | RepDef | CompoundDef | ExplicitDef;
36
+ export interface UAPEntry {
37
+ /** FSPEC bit position including FX-placeholder slots (every 8th bit = FX) */
38
+ bit: number;
39
+ id: string;
40
+ }
41
+ export interface AsterixDef {
42
+ uap: UAPEntry[];
43
+ items: Map<string, ItemDef>;
44
+ }
45
+ export declare function loadDef(cat: number, ed: string): AsterixDef | null;
46
+ //# sourceMappingURL=xml-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml-loader.d.ts","sourceRoot":"","sources":["../../../src/surveillance/asterix/xml-loader.ts"],"names":[],"mappings":"AAgBA;kEACkE;AAClE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC;IACxE,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,QAAQ,GAAQ;IAAE,IAAI,EAAE,OAAO,CAAC;IAAM,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AACxF,MAAM,MAAM,WAAW,GAAK;IAAE,IAAI,EAAE,UAAU,CAAC;IAAG,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AAC7F,MAAM,MAAM,MAAM,GAAU;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxF,MAAM,MAAM,WAAW,GAAK;IAAE,IAAI,EAAE,UAAU,CAAC;IAAG,cAAc,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAC/F,MAAM,MAAM,WAAW,GAAK;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AACjD,MAAM,MAAM,UAAU,GAAM,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,CAAC;AAC1E,MAAM,MAAM,OAAO,GAAS,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC;AAExF,MAAM,WAAW,QAAQ;IACvB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,QAAQ,EAAE,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7B;AAgCD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAgBlE"}
@@ -0,0 +1,7 @@
1
+ export * from "./asterix/index.js";
2
+ export * from "./adsb/index.js";
3
+ export * from "./ais/index.js";
4
+ export * from "./mlat/index.js";
5
+ export * from "./asmgcs/index.js";
6
+ export * from "./aftn/index.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/surveillance/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface MlatRawFrame {
2
+ raw: Buffer;
3
+ receivedAt: number;
4
+ stationId?: string;
5
+ }
6
+ export interface MlatDecodedFrame {
7
+ icao24: string;
8
+ lat?: number;
9
+ lon?: number;
10
+ altitudeFt?: number;
11
+ groundSpeedKt?: number;
12
+ headingDeg?: number;
13
+ nAirStations?: number;
14
+ }
15
+ export declare function decodeMlatFrame(_frame: MlatRawFrame): MlatDecodedFrame | null;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/surveillance/mlat/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAE7E"}
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
- {
2
- "name": "@aeroswarm/codec",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@aeroswarm/codec",
3
+ "version": "0.1.9",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "main": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "src/config"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public",
20
+ "registry": "https://registry.npmjs.org/"
21
+ },
22
+ "scripts": {
23
+ "build": "tsup src/index.ts --format esm --clean && tsc --emitDeclarationOnly",
24
+ "dev": "tsup src/index.ts --format esm --dts --watch",
25
+ "test": "vitest run --passWithNoTests",
26
+ "typecheck": "tsc --noEmit",
27
+ "clean": "rm -rf dist",
28
+ "prepublishOnly": "pnpm run typecheck && pnpm run test && pnpm run build",
29
+ "release": "release-it",
30
+ "release:dry": "release-it --dry-run",
31
+ "release:patch": "release-it patch --no-git.requireCleanWorkingDir",
32
+ "release:minor": "release-it minor --no-git.requireCleanWorkingDir",
33
+ "release:major": "release-it major --no-git.requireCleanWorkingDir"
34
+ },
35
+ "devDependencies": {
36
+ "release-it": "^18.1.2",
37
+ "tsup": "^8.5.1",
38
+ "vitest": "^4.1.6"
39
+ }
40
+ }
@@ -0,0 +1,78 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ DTD for Asterix format
5
+
6
+ Author: dsalantic
7
+ Created: 24.12.2008.
8
+ Modified: 28.4.2014. (dsalantic) Removed XIDEF
9
+ Modified: 16.5.2014. (dsalantic) Nested compound enabled
10
+ Explicit can contain all types
11
+ 6.7.2016. (dsalantic) BDS format added
12
+ 28.11.2016. (dsalantic) BDS format fixed
13
+
14
+ -->
15
+
16
+ <!ELEMENT Category (DataItem*,UAP*)>
17
+ <!ATTLIST Category id CDATA #REQUIRED>
18
+ <!ATTLIST Category name CDATA #REQUIRED>
19
+ <!ATTLIST Category ver CDATA #REQUIRED>
20
+
21
+ <!ELEMENT Bits (BitsShortName?,BitsName?,(BitsConst|BitsValue*|BitsUnit|BitsPresence))>
22
+ <!ATTLIST Bits bit CDATA "0">
23
+ <!ATTLIST Bits from CDATA "0">
24
+ <!ATTLIST Bits to CDATA "0">
25
+ <!ATTLIST Bits encode (signed|6bitschar|octal|unsigned|ascii|hex) "unsigned">
26
+ <!ATTLIST Bits fx CDATA "0">
27
+ <!ATTLIST Bits rep CDATA "0">
28
+ <!ELEMENT BitsShortName (#PCDATA)>
29
+ <!ELEMENT BitsName (#PCDATA)>
30
+ <!ELEMENT BitsValue (#PCDATA)>
31
+ <!ATTLIST BitsValue val CDATA "0" >
32
+ <!-- TODO <!ATTLIST BitsValue from CDATA "0" > -->
33
+ <!-- TODO <!ATTLIST BitsValue to CDATA "0" > -->
34
+ <!ELEMENT BitsConst (#PCDATA)>
35
+ <!ELEMENT BitsPresence (#PCDATA)>
36
+ <!ELEMENT BitsUnit (#PCDATA)>
37
+ <!ATTLIST BitsUnit scale CDATA "1" >
38
+ <!ATTLIST BitsUnit min CDATA "0" >
39
+ <!ATTLIST BitsUnit max CDATA "0" >
40
+
41
+ <!ELEMENT DataItem (DataItemName,DataItemDefinition,DataItemFormat,DataItemNote?)>
42
+ <!ATTLIST DataItem id CDATA #REQUIRED>
43
+ <!ATTLIST DataItem rule (mandatory|optional|unknown) "unknown">
44
+ <!ELEMENT DataItemName (#PCDATA)>
45
+ <!ELEMENT DataItemDefinition (#PCDATA)>
46
+ <!ELEMENT DataItemNote (#PCDATA)>
47
+ <!ELEMENT DataItemFormat (Fixed|Explicit|Repetitive|Variable|Compound|BDS)>
48
+ <!ATTLIST DataItemFormat desc CDATA "" >
49
+
50
+ <!-- Fixed length data fields -->
51
+ <!ELEMENT Fixed (Bits+)>
52
+ <!ATTLIST Fixed length CDATA "1" >
53
+
54
+ <!-- Explicit length data fields -->
55
+ <!ELEMENT Explicit (Fixed|Explicit|Repetitive|Variable|Compound)>
56
+
57
+ <!-- Repetitive length data fields -->
58
+ <!ELEMENT Repetitive (Fixed+|BDS)>
59
+
60
+ <!-- Variable (extended) length data fields -->
61
+ <!ELEMENT Variable (Fixed+)>
62
+
63
+ <!-- Compund data fields -->
64
+ <!ELEMENT Compound (Variable,(Fixed|Explicit|Repetitive|Variable|Compound)*)>
65
+
66
+ <!-- BDS is defined in asterix_bds.xml -->
67
+ <!ELEMENT BDS (#PCDATA)>
68
+
69
+ <!-- User Application Profile -->
70
+ <!ELEMENT UAP (UAPItem*)>
71
+ <!ATTLIST UAP use_if_bit_set CDATA "0">
72
+ <!ATTLIST UAP use_if_byte_nr CDATA "0">
73
+ <!ATTLIST UAP is_set_to CDATA "0">
74
+ <!ELEMENT UAPItem (#PCDATA)>
75
+ <!ATTLIST UAPItem bit CDATA #REQUIRED>
76
+ <!ATTLIST UAPItem frn CDATA #REQUIRED>
77
+ <!ATTLIST UAPItem fx CDATA "0">
78
+ <!ATTLIST UAPItem len CDATA "-">
@@ -0,0 +1,17 @@
1
+ asterix_cat010_1_1.xml
2
+ asterix_cat019_1_2.xml
3
+ asterix_cat020_1_7.xml
4
+ asterix_cat021_0_26.xml
5
+ asterix_cat242_1_0.xml
6
+ asterix_cat062_1_16.xml
7
+ asterix_cat063_1_3.xml
8
+ asterix_cat065_1_3.xml
9
+ asterix_cat030_6_2.xml
10
+ asterix_cat031_6_2.xml
11
+ asterix_cat032_6_2.xml
12
+ asterix_cat034_1_26.xml
13
+ asterix_cat252_6_2.xml
14
+ asterix_cat001_1_1.xml
15
+ asterix_cat002_1_0.xml
16
+ asterix_cat048_1_14.xml
17
+ asterix_cat008_1_0.xml