@springfield/ham-radio-api 18.0.2 → 18.2.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/README.md CHANGED
@@ -6,6 +6,8 @@ Packages that talk to radios depend on this library. It does not open a serial p
6
6
 
7
7
  Docs: [HamBench developer docs](https://springfield-ham-radio.github.io/ham-radio-docs/developer/)
8
8
 
9
+ Package docs: [radio read/write dialog messages](docs/radio-dialog-messages.md)
10
+
9
11
  ## License
10
12
 
11
13
  MIT — Copyright (c) 2026 Bryan Hunt. See [LICENSE](LICENSE).
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from "./radio/codec-factory.js";
14
14
  export * from "./radio/connection.js";
15
15
  export * from "./radio/ctcss.js";
16
16
  export * from "./radio/dcs.js";
17
+ export * from "./radio/dialog-message.js";
17
18
  export * from "./radio/driver.js";
18
19
  export * from "./radio/driver-provider.js";
19
20
  export * from "./radio/id.js";
@@ -38,6 +39,7 @@ export * from "./spectrum/channel.js";
38
39
  export * from "./spectrum/mode.js";
39
40
  export * from "./spectrum/privilege.js";
40
41
  export * from "./antenna/type.js";
42
+ export * from "./station/geo-point.js";
41
43
  export * from "./station/radio-station.js";
42
44
  export * from "./station/antenna.js";
43
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,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Ac,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AAExC,cAAc,mBAAmB,CAAC;AAElC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ export * from "./radio/codec-factory.js";
14
14
  export * from "./radio/connection.js";
15
15
  export * from "./radio/ctcss.js";
16
16
  export * from "./radio/dcs.js";
17
+ export * from "./radio/dialog-message.js";
17
18
  export * from "./radio/driver.js";
18
19
  export * from "./radio/driver-provider.js";
19
20
  export * from "./radio/id.js";
@@ -38,6 +39,7 @@ export * from "./spectrum/channel.js";
38
39
  export * from "./spectrum/mode.js";
39
40
  export * from "./spectrum/privilege.js";
40
41
  export * from "./antenna/type.js";
42
+ export * from "./station/geo-point.js";
41
43
  export * from "./station/radio-station.js";
42
44
  export * from "./station/antenna.js";
43
45
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AAExC,cAAc,mBAAmB,CAAC;AAElC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,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 -0,0 +1,25 @@
1
+ import type { ValidationResult } from "./validation.js";
2
+ /** UAlert-style severity for optional read/write setup text in HamBench. */
3
+ export type RadioDialogSeverity = "info" | "warning";
4
+ /**
5
+ * Optional setup text shown in HamBench before a memory read or write.
6
+ * Radio modules set this on the driver config JSON (`readMessage` / `writeMessage`).
7
+ */
8
+ export interface RadioDialogMessage {
9
+ /** Short alert title (plain text). */
10
+ title: string;
11
+ /** Alert body (plain text; newlines are line breaks). */
12
+ body: string;
13
+ /**
14
+ * Visual weight in HamBench. Omit for `info`.
15
+ */
16
+ severity?: RadioDialogSeverity;
17
+ }
18
+ export declare const RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH = 80;
19
+ export declare const RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH = 600;
20
+ /**
21
+ * Validate an optional `readMessage` or `writeMessage` value from a radio config.
22
+ * `undefined` is valid (field omitted).
23
+ */
24
+ export declare function validateRadioDialogMessage(fieldPath: string, value: unknown): ValidationResult;
25
+ //# sourceMappingURL=dialog-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-message.d.ts","sourceRoot":"","sources":["../../src/radio/dialog-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,4EAA4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD,eAAO,MAAM,oCAAoC,MAAM,CAAC;AAoBxD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAoD9F"}
@@ -0,0 +1,69 @@
1
+ export const RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH = 80;
2
+ export const RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH = 600;
3
+ const DIALOG_SEVERITIES = new Set(["info", "warning"]);
4
+ function hasDisallowedControlCharacters(text) {
5
+ for (let index = 0; index < text.length; index += 1) {
6
+ const code = text.charCodeAt(index);
7
+ if (code === 9 || code === 10) {
8
+ continue;
9
+ }
10
+ if (code < 32 || code === 127) {
11
+ return true;
12
+ }
13
+ }
14
+ return false;
15
+ }
16
+ /**
17
+ * Validate an optional `readMessage` or `writeMessage` value from a radio config.
18
+ * `undefined` is valid (field omitted).
19
+ */
20
+ export function validateRadioDialogMessage(fieldPath, value) {
21
+ const errors = [];
22
+ const warnings = [];
23
+ if (value === undefined) {
24
+ return { isValid: true, errors, warnings };
25
+ }
26
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
27
+ errors.push(`${fieldPath} must be an object`);
28
+ return { isValid: false, errors, warnings };
29
+ }
30
+ const record = value;
31
+ if (typeof record.title !== "string") {
32
+ errors.push(`${fieldPath}.title must be a string`);
33
+ }
34
+ else {
35
+ const title = record.title.trim();
36
+ if (title.length === 0) {
37
+ errors.push(`${fieldPath}.title must not be empty`);
38
+ }
39
+ else if (title.length > RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH) {
40
+ errors.push(`${fieldPath}.title must be at most ${RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH} characters`);
41
+ }
42
+ }
43
+ if (typeof record.body !== "string") {
44
+ errors.push(`${fieldPath}.body must be a string`);
45
+ }
46
+ else {
47
+ const body = record.body.trim();
48
+ if (body.length === 0) {
49
+ errors.push(`${fieldPath}.body must not be empty`);
50
+ }
51
+ else if (body.length > RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH) {
52
+ errors.push(`${fieldPath}.body must be at most ${RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH} characters`);
53
+ }
54
+ else if (hasDisallowedControlCharacters(record.body)) {
55
+ errors.push(`${fieldPath}.body must not contain control characters other than tab or newline`);
56
+ }
57
+ }
58
+ if (record.severity !== undefined) {
59
+ if (typeof record.severity !== "string" || !DIALOG_SEVERITIES.has(record.severity)) {
60
+ errors.push(`${fieldPath}.severity must be "info" or "warning"`);
61
+ }
62
+ }
63
+ return {
64
+ isValid: errors.length === 0,
65
+ errors,
66
+ warnings,
67
+ };
68
+ }
69
+ //# sourceMappingURL=dialog-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-message.js","sourceRoot":"","sources":["../../src/radio/dialog-message.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,qCAAqC,GAAG,EAAE,CAAC;AACxD,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AAExD,MAAM,iBAAiB,GAAqC,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzF,SAAS,8BAA8B,CAAC,IAAY;IAClD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAC9B,SAAS;QACX,CAAC;QAED,IAAI,IAAI,GAAG,EAAE,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,SAAiB,EAAE,KAAc;IAC1E,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB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AI,IAAI,CAAC,MAAM,GAAG,oCAAoC,EAAE,CAAC;YAC9D,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,yBAAyB,oCAAoC,aAAa,CAAC,CAAC;QACtG,CAAC;aAAM,IAAI,8BAA8B,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,qEAAqE,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,QAA+B,CAAC,EAAE,CAAC;YAC1G,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,uCAAuC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC5B,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -3,11 +3,20 @@ import type { RadioMemoryConfig } from "./memory-config.js";
3
3
  import type { RadioMemoryMap } from "./memory-map.js";
4
4
  import type { RadioProtocolStep } from "./protocol.js";
5
5
  import type { RadioSchema } from "./schema.js";
6
+ import type { RadioDialogMessage } from "./dialog-message.js";
6
7
  import type { RadioSerialConfig } from "./serial-config.js";
7
8
  export interface Radio {
8
9
  id: RadioId;
9
10
  version: string;
10
11
  description: string;
12
+ /**
13
+ * Optional setup text for HamBench **Read from Radio** (plain text; see `RadioDialogMessage`).
14
+ */
15
+ readMessage?: RadioDialogMessage;
16
+ /**
17
+ * Optional setup text for HamBench **Write to Radio** (plain text; see `RadioDialogMessage`).
18
+ */
19
+ writeMessage?: RadioDialogMessage;
11
20
  settingsSchema: RadioSchema;
12
21
  memoryConfig: RadioMemoryConfig;
13
22
  serialConfig: RadioSerialConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,WAAW,CAAC;IAC5B,YAAY,EAAE,iBAAiB,CAAC;IAChC,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/radio/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,cAAc,EAAE,WAAW,CAAC;IAC5B,YAAY,EAAE,iBAAiB,CAAC;IAChC,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Canonical geographic point for station sites and related APIs.
3
+ *
4
+ * **Decision (issue #19):** coordinates are {@link GeoPoint} with signed decimal
5
+ * degrees on WGS84. SQLite stores two REAL columns (`latitude`, `longitude`).
6
+ * GeoJSON Point (`[longitude, latitude]`, RFC 7946) is used only at map/API
7
+ * boundaries — no GeoJSON blobs in the database and no spatial extensions or
8
+ * indexes. Maidenhead grid squares are a derived display format, stored only
9
+ * where exchanged (station `gridsquare`, QSO grids). String sources such as
10
+ * Callook are parsed at the edge; lat/lon in this package are always numbers.
11
+ */
12
+ export declare const MIN_LATITUDE = -90;
13
+ export declare const MAX_LATITUDE = 90;
14
+ export declare const MIN_LONGITUDE = -180;
15
+ export declare const MAX_LONGITUDE = 180;
16
+ /**
17
+ * A point on the WGS84 ellipsoid as signed decimal degrees (south / west negative).
18
+ */
19
+ export interface GeoPoint {
20
+ latitude: number;
21
+ longitude: number;
22
+ }
23
+ /**
24
+ * Returns whether `value` is a {@link GeoPoint} with finite coordinates inside
25
+ * {@link MIN_LATITUDE}–{@link MAX_LATITUDE} and {@link MIN_LONGITUDE}–{@link MAX_LONGITUDE}.
26
+ */
27
+ export declare function isGeoPoint(value: unknown): value is GeoPoint;
28
+ //# sourceMappingURL=geo-point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-point.d.ts","sourceRoot":"","sources":["../../src/station/geo-point.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAgB5D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Canonical geographic point for station sites and related APIs.
3
+ *
4
+ * **Decision (issue #19):** coordinates are {@link GeoPoint} with signed decimal
5
+ * degrees on WGS84. SQLite stores two REAL columns (`latitude`, `longitude`).
6
+ * GeoJSON Point (`[longitude, latitude]`, RFC 7946) is used only at map/API
7
+ * boundaries — no GeoJSON blobs in the database and no spatial extensions or
8
+ * indexes. Maidenhead grid squares are a derived display format, stored only
9
+ * where exchanged (station `gridsquare`, QSO grids). String sources such as
10
+ * Callook are parsed at the edge; lat/lon in this package are always numbers.
11
+ */
12
+ export const MIN_LATITUDE = -90;
13
+ export const MAX_LATITUDE = 90;
14
+ export const MIN_LONGITUDE = -180;
15
+ export const MAX_LONGITUDE = 180;
16
+ /**
17
+ * Returns whether `value` is a {@link GeoPoint} with finite coordinates inside
18
+ * {@link MIN_LATITUDE}–{@link MAX_LATITUDE} and {@link MIN_LONGITUDE}–{@link MAX_LONGITUDE}.
19
+ */
20
+ export function isGeoPoint(value) {
21
+ if (typeof value !== "object" || value === null) {
22
+ return false;
23
+ }
24
+ const candidate = value;
25
+ return (typeof candidate.latitude === "number" &&
26
+ typeof candidate.longitude === "number" &&
27
+ Number.isFinite(candidate.latitude) &&
28
+ Number.isFinite(candidate.longitude) &&
29
+ candidate.latitude >= MIN_LATITUDE &&
30
+ candidate.latitude <= MAX_LATITUDE &&
31
+ candidate.longitude >= MIN_LONGITUDE &&
32
+ candidate.longitude <= MAX_LONGITUDE);
33
+ }
34
+ //# sourceMappingURL=geo-point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-point.js","sourceRoot":"","sources":["../../src/station/geo-point.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAUjC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAG,KAAiB,CAAC;IACpC,OAAO,CACL,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ;QACtC,OAAO,SAAS,CAAC,SAAS,KAAK,QAAQ;QACvC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QACnC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC;QACpC,SAAS,CAAC,QAAQ,IAAI,YAAY;QAClC,SAAS,CAAC,QAAQ,IAAI,YAAY;QAClC,SAAS,CAAC,SAAS,IAAI,aAAa;QACpC,SAAS,CAAC,SAAS,IAAI,aAAa,CACrC,CAAC;AACJ,CAAC"}
@@ -1,11 +1,9 @@
1
+ import type { GeoPoint } from "./geo-point.js";
1
2
  /**
2
3
  * Default Home site id. HamBench always has at least this station.
3
4
  */
4
5
  export declare const HOME_STATION_ID = "station-home";
5
- export declare const MIN_LATITUDE = -90;
6
- export declare const MAX_LATITUDE = 90;
7
- export declare const MIN_LONGITUDE = -180;
8
- export declare const MAX_LONGITUDE = 180;
6
+ export { MAX_LATITUDE, MAX_LONGITUDE, MIN_LATITUDE, MIN_LONGITUDE, } from "./geo-point.js";
9
7
  /**
10
8
  * Whether the operator last edited the Maidenhead grid or the coordinates.
11
9
  *
@@ -19,12 +17,10 @@ export type StationLocationSource = "grid" | "coordinates";
19
17
  * Latitude and longitude are signed decimal degrees (south / west negative).
20
18
  * UIs may collect them as degrees, minutes, and decimal seconds.
21
19
  */
22
- export interface RadioStation {
20
+ export interface RadioStation extends Partial<GeoPoint> {
23
21
  id: string;
24
22
  nickname: string;
25
23
  gridsquare?: string;
26
- latitude?: number;
27
- longitude?: number;
28
24
  locationSource?: StationLocationSource;
29
25
  createdAt: number;
30
26
  updatedAt: number;
@@ -1 +1 @@
1
- {"version":3,"file":"radio-station.d.ts","sourceRoot":"","sources":["../../src/station/radio-station.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,aAAa,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"radio-station.d.ts","sourceRoot":"","sources":["../../src/station/radio-station.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,aAAa,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,OAAO,CAAC,QAAQ,CAAC;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -2,8 +2,5 @@
2
2
  * Default Home site id. HamBench always has at least this station.
3
3
  */
4
4
  export const HOME_STATION_ID = "station-home";
5
- export const MIN_LATITUDE = -90;
6
- export const MAX_LATITUDE = 90;
7
- export const MIN_LONGITUDE = -180;
8
- export const MAX_LONGITUDE = 180;
5
+ export { MAX_LATITUDE, MAX_LONGITUDE, MIN_LATITUDE, MIN_LONGITUDE, } from "./geo-point.js";
9
6
  //# sourceMappingURL=radio-station.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-station.js","sourceRoot":"","sources":["../../src/station/radio-station.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC"}
1
+ {"version":3,"file":"radio-station.js","sourceRoot":"","sources":["../../src/station/radio-station.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springfield/ham-radio-api",
3
- "version": "18.0.2",
3
+ "version": "18.2.0",
4
4
  "author": "Bryan Hunt",
5
5
  "license": "MIT",
6
6
  "files": [
package/src/index.ts CHANGED
@@ -16,6 +16,7 @@ export * from "./radio/codec-factory.js";
16
16
  export * from "./radio/connection.js";
17
17
  export * from "./radio/ctcss.js";
18
18
  export * from "./radio/dcs.js";
19
+ export * from "./radio/dialog-message.js";
19
20
  export * from "./radio/driver.js";
20
21
  export * from "./radio/driver-provider.js";
21
22
  export * from "./radio/id.js";
@@ -43,5 +44,6 @@ export * from "./spectrum/privilege.js";
43
44
 
44
45
  export * from "./antenna/type.js";
45
46
 
47
+ export * from "./station/geo-point.js";
46
48
  export * from "./station/radio-station.js";
47
49
  export * from "./station/antenna.js";
@@ -0,0 +1,98 @@
1
+ import type { ValidationResult } from "./validation.js";
2
+
3
+ /** UAlert-style severity for optional read/write setup text in HamBench. */
4
+ export type RadioDialogSeverity = "info" | "warning";
5
+
6
+ /**
7
+ * Optional setup text shown in HamBench before a memory read or write.
8
+ * Radio modules set this on the driver config JSON (`readMessage` / `writeMessage`).
9
+ */
10
+ export interface RadioDialogMessage {
11
+ /** Short alert title (plain text). */
12
+ title: string;
13
+ /** Alert body (plain text; newlines are line breaks). */
14
+ body: string;
15
+ /**
16
+ * Visual weight in HamBench. Omit for `info`.
17
+ */
18
+ severity?: RadioDialogSeverity;
19
+ }
20
+
21
+ export const RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH = 80;
22
+ export const RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH = 600;
23
+
24
+ const DIALOG_SEVERITIES: ReadonlySet<RadioDialogSeverity> = new Set(["info", "warning"]);
25
+
26
+ function hasDisallowedControlCharacters(text: string): boolean {
27
+ for (let index = 0; index < text.length; index += 1) {
28
+ const code = text.charCodeAt(index);
29
+
30
+ if (code === 9 || code === 10) {
31
+ continue;
32
+ }
33
+
34
+ if (code < 32 || code === 127) {
35
+ return true;
36
+ }
37
+ }
38
+
39
+ return false;
40
+ }
41
+
42
+ /**
43
+ * Validate an optional `readMessage` or `writeMessage` value from a radio config.
44
+ * `undefined` is valid (field omitted).
45
+ */
46
+ export function validateRadioDialogMessage(fieldPath: string, value: unknown): ValidationResult {
47
+ const errors: string[] = [];
48
+ const warnings: string[] = [];
49
+
50
+ if (value === undefined) {
51
+ return { isValid: true, errors, warnings };
52
+ }
53
+
54
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
55
+ errors.push(`${fieldPath} must be an object`);
56
+ return { isValid: false, errors, warnings };
57
+ }
58
+
59
+ const record = value as Record<string, unknown>;
60
+
61
+ if (typeof record.title !== "string") {
62
+ errors.push(`${fieldPath}.title must be a string`);
63
+ } else {
64
+ const title = record.title.trim();
65
+
66
+ if (title.length === 0) {
67
+ errors.push(`${fieldPath}.title must not be empty`);
68
+ } else if (title.length > RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH) {
69
+ errors.push(`${fieldPath}.title must be at most ${RADIO_DIALOG_MESSAGE_TITLE_MAX_LENGTH} characters`);
70
+ }
71
+ }
72
+
73
+ if (typeof record.body !== "string") {
74
+ errors.push(`${fieldPath}.body must be a string`);
75
+ } else {
76
+ const body = record.body.trim();
77
+
78
+ if (body.length === 0) {
79
+ errors.push(`${fieldPath}.body must not be empty`);
80
+ } else if (body.length > RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH) {
81
+ errors.push(`${fieldPath}.body must be at most ${RADIO_DIALOG_MESSAGE_BODY_MAX_LENGTH} characters`);
82
+ } else if (hasDisallowedControlCharacters(record.body)) {
83
+ errors.push(`${fieldPath}.body must not contain control characters other than tab or newline`);
84
+ }
85
+ }
86
+
87
+ if (record.severity !== undefined) {
88
+ if (typeof record.severity !== "string" || !DIALOG_SEVERITIES.has(record.severity as RadioDialogSeverity)) {
89
+ errors.push(`${fieldPath}.severity must be "info" or "warning"`);
90
+ }
91
+ }
92
+
93
+ return {
94
+ isValid: errors.length === 0,
95
+ errors,
96
+ warnings,
97
+ };
98
+ }
@@ -3,12 +3,21 @@ import type { RadioMemoryConfig } from "./memory-config.js";
3
3
  import type { RadioMemoryMap } from "./memory-map.js";
4
4
  import type { RadioProtocolStep } from "./protocol.js";
5
5
  import type { RadioSchema } from "./schema.js";
6
+ import type { RadioDialogMessage } from "./dialog-message.js";
6
7
  import type { RadioSerialConfig } from "./serial-config.js";
7
8
 
8
9
  export interface Radio {
9
10
  id: RadioId;
10
11
  version: string;
11
12
  description: string;
13
+ /**
14
+ * Optional setup text for HamBench **Read from Radio** (plain text; see `RadioDialogMessage`).
15
+ */
16
+ readMessage?: RadioDialogMessage;
17
+ /**
18
+ * Optional setup text for HamBench **Write to Radio** (plain text; see `RadioDialogMessage`).
19
+ */
20
+ writeMessage?: RadioDialogMessage;
12
21
  settingsSchema: RadioSchema;
13
22
  memoryConfig: RadioMemoryConfig;
14
23
  serialConfig: RadioSerialConfig;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Canonical geographic point for station sites and related APIs.
3
+ *
4
+ * **Decision (issue #19):** coordinates are {@link GeoPoint} with signed decimal
5
+ * degrees on WGS84. SQLite stores two REAL columns (`latitude`, `longitude`).
6
+ * GeoJSON Point (`[longitude, latitude]`, RFC 7946) is used only at map/API
7
+ * boundaries — no GeoJSON blobs in the database and no spatial extensions or
8
+ * indexes. Maidenhead grid squares are a derived display format, stored only
9
+ * where exchanged (station `gridsquare`, QSO grids). String sources such as
10
+ * Callook are parsed at the edge; lat/lon in this package are always numbers.
11
+ */
12
+ export const MIN_LATITUDE = -90;
13
+ export const MAX_LATITUDE = 90;
14
+ export const MIN_LONGITUDE = -180;
15
+ export const MAX_LONGITUDE = 180;
16
+
17
+ /**
18
+ * A point on the WGS84 ellipsoid as signed decimal degrees (south / west negative).
19
+ */
20
+ export interface GeoPoint {
21
+ latitude: number;
22
+ longitude: number;
23
+ }
24
+
25
+ /**
26
+ * Returns whether `value` is a {@link GeoPoint} with finite coordinates inside
27
+ * {@link MIN_LATITUDE}–{@link MAX_LATITUDE} and {@link MIN_LONGITUDE}–{@link MAX_LONGITUDE}.
28
+ */
29
+ export function isGeoPoint(value: unknown): value is GeoPoint {
30
+ if (typeof value !== "object" || value === null) {
31
+ return false;
32
+ }
33
+
34
+ const candidate = value as GeoPoint;
35
+ return (
36
+ typeof candidate.latitude === "number" &&
37
+ typeof candidate.longitude === "number" &&
38
+ Number.isFinite(candidate.latitude) &&
39
+ Number.isFinite(candidate.longitude) &&
40
+ candidate.latitude >= MIN_LATITUDE &&
41
+ candidate.latitude <= MAX_LATITUDE &&
42
+ candidate.longitude >= MIN_LONGITUDE &&
43
+ candidate.longitude <= MAX_LONGITUDE
44
+ );
45
+ }
@@ -1,12 +1,16 @@
1
+ import type { GeoPoint } from "./geo-point.js";
2
+
1
3
  /**
2
4
  * Default Home site id. HamBench always has at least this station.
3
5
  */
4
6
  export const HOME_STATION_ID = "station-home";
5
7
 
6
- export const MIN_LATITUDE = -90;
7
- export const MAX_LATITUDE = 90;
8
- export const MIN_LONGITUDE = -180;
9
- export const MAX_LONGITUDE = 180;
8
+ export {
9
+ MAX_LATITUDE,
10
+ MAX_LONGITUDE,
11
+ MIN_LATITUDE,
12
+ MIN_LONGITUDE,
13
+ } from "./geo-point.js";
10
14
 
11
15
  /**
12
16
  * Whether the operator last edited the Maidenhead grid or the coordinates.
@@ -22,12 +26,10 @@ export type StationLocationSource = "grid" | "coordinates";
22
26
  * Latitude and longitude are signed decimal degrees (south / west negative).
23
27
  * UIs may collect them as degrees, minutes, and decimal seconds.
24
28
  */
25
- export interface RadioStation {
29
+ export interface RadioStation extends Partial<GeoPoint> {
26
30
  id: string;
27
31
  nickname: string;
28
32
  gridsquare?: string;
29
- latitude?: number;
30
- longitude?: number;
31
33
  locationSource?: StationLocationSource;
32
34
  createdAt: number;
33
35
  updatedAt: number;