@tx5dr/contracts 1.7.12 → 2.5.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/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/schema/__tests__/android-operator-audio.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/android-operator-audio.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/android-operator-audio.schema.test.js +27 -0
- package/dist/schema/__tests__/android-operator-audio.schema.test.js.map +1 -0
- package/dist/schema/__tests__/assisted-queue.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/assisted-queue.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/assisted-queue.schema.test.js +114 -0
- package/dist/schema/__tests__/assisted-queue.schema.test.js.map +1 -0
- package/dist/schema/__tests__/audio-sidecar.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/audio-sidecar.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/audio-sidecar.schema.test.js +42 -0
- package/dist/schema/__tests__/audio-sidecar.schema.test.js.map +1 -0
- package/dist/schema/__tests__/audio.schema.test.js +92 -1
- package/dist/schema/__tests__/audio.schema.test.js.map +1 -1
- package/dist/schema/__tests__/diagnostics.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/diagnostics.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/diagnostics.schema.test.js +31 -0
- package/dist/schema/__tests__/diagnostics.schema.test.js.map +1 -0
- package/dist/schema/__tests__/logbook-health.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/logbook-health.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/logbook-health.schema.test.js +104 -0
- package/dist/schema/__tests__/logbook-health.schema.test.js.map +1 -0
- package/dist/schema/__tests__/meter.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/meter.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/meter.schema.test.js +27 -0
- package/dist/schema/__tests__/meter.schema.test.js.map +1 -0
- package/dist/schema/__tests__/observability.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/observability.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/observability.schema.test.js +12 -0
- package/dist/schema/__tests__/observability.schema.test.js.map +1 -0
- package/dist/schema/__tests__/operator-context-report.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/operator-context-report.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/operator-context-report.schema.test.js +70 -0
- package/dist/schema/__tests__/operator-context-report.schema.test.js.map +1 -0
- package/dist/schema/__tests__/operator.schema.test.js +9 -3
- package/dist/schema/__tests__/operator.schema.test.js.map +1 -1
- package/dist/schema/__tests__/plugin-market.schema.test.js +149 -3
- package/dist/schema/__tests__/plugin-market.schema.test.js.map +1 -1
- package/dist/schema/__tests__/qso.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/qso.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/qso.schema.test.js +70 -0
- package/dist/schema/__tests__/qso.schema.test.js.map +1 -0
- package/dist/schema/__tests__/radio-power-support.test.js +15 -0
- package/dist/schema/__tests__/radio-power-support.test.js.map +1 -1
- package/dist/schema/__tests__/radio-profile.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/radio-profile.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/radio-profile.schema.test.js +36 -0
- package/dist/schema/__tests__/radio-profile.schema.test.js.map +1 -0
- package/dist/schema/__tests__/radio.schema.test.js +92 -1
- package/dist/schema/__tests__/radio.schema.test.js.map +1 -1
- package/dist/schema/__tests__/realtime-settings.schema.test.js +2 -1
- package/dist/schema/__tests__/realtime-settings.schema.test.js.map +1 -1
- package/dist/schema/__tests__/remote-access.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/remote-access.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/remote-access.schema.test.js +18 -0
- package/dist/schema/__tests__/remote-access.schema.test.js.map +1 -0
- package/dist/schema/__tests__/spectrum.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/spectrum.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/spectrum.schema.test.js +107 -0
- package/dist/schema/__tests__/spectrum.schema.test.js.map +1 -0
- package/dist/schema/__tests__/strategy-transmission.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/strategy-transmission.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/strategy-transmission.schema.test.js +95 -0
- package/dist/schema/__tests__/strategy-transmission.schema.test.js.map +1 -0
- package/dist/schema/android-operator-audio.schema.d.ts +174 -0
- package/dist/schema/android-operator-audio.schema.d.ts.map +1 -0
- package/dist/schema/android-operator-audio.schema.js +38 -0
- package/dist/schema/android-operator-audio.schema.js.map +1 -0
- package/dist/schema/api-response.schema.d.ts +503 -44
- package/dist/schema/api-response.schema.d.ts.map +1 -1
- package/dist/schema/api-response.schema.js +9 -0
- package/dist/schema/api-response.schema.js.map +1 -1
- package/dist/schema/audio-sidecar.schema.d.ts +75 -0
- package/dist/schema/audio-sidecar.schema.d.ts.map +1 -1
- package/dist/schema/audio-sidecar.schema.js +32 -0
- package/dist/schema/audio-sidecar.schema.js.map +1 -1
- package/dist/schema/audio.schema.d.ts +4749 -3
- package/dist/schema/audio.schema.d.ts.map +1 -1
- package/dist/schema/audio.schema.js +101 -2
- package/dist/schema/audio.schema.js.map +1 -1
- package/dist/schema/auth.schema.d.ts +173 -14
- package/dist/schema/auth.schema.d.ts.map +1 -1
- package/dist/schema/auth.schema.js +65 -1
- package/dist/schema/auth.schema.js.map +1 -1
- package/dist/schema/cpu-profile.schema.d.ts +2 -2
- package/dist/schema/cw-decoder.schema.d.ts +74 -74
- package/dist/schema/cw-keyer.schema.d.ts +20 -14
- package/dist/schema/cw-keyer.schema.d.ts.map +1 -1
- package/dist/schema/cw-keyer.schema.js +3 -0
- package/dist/schema/cw-keyer.schema.js.map +1 -1
- package/dist/schema/desktop-https.schema.d.ts +6 -6
- package/dist/schema/device-ui.schema.d.ts +16 -16
- package/dist/schema/diagnostics.schema.d.ts +163 -0
- package/dist/schema/diagnostics.schema.d.ts.map +1 -0
- package/dist/schema/diagnostics.schema.js +46 -0
- package/dist/schema/diagnostics.schema.js.map +1 -0
- package/dist/schema/ft8.schema.d.ts +12 -2
- package/dist/schema/ft8.schema.d.ts.map +1 -1
- package/dist/schema/ft8.schema.js +8 -0
- package/dist/schema/ft8.schema.js.map +1 -1
- package/dist/schema/image-radio.schema.d.ts +2597 -0
- package/dist/schema/image-radio.schema.d.ts.map +1 -0
- package/dist/schema/image-radio.schema.js +283 -0
- package/dist/schema/image-radio.schema.js.map +1 -0
- package/dist/schema/logbook.schema.d.ts +2128 -18
- package/dist/schema/logbook.schema.d.ts.map +1 -1
- package/dist/schema/logbook.schema.js +159 -1
- package/dist/schema/logbook.schema.js.map +1 -1
- package/dist/schema/mode.schema.d.ts +4 -6
- package/dist/schema/mode.schema.d.ts.map +1 -1
- package/dist/schema/mode.schema.js +18 -6
- package/dist/schema/mode.schema.js.map +1 -1
- package/dist/schema/observability.schema.d.ts +66 -0
- package/dist/schema/observability.schema.d.ts.map +1 -0
- package/dist/schema/observability.schema.js +20 -0
- package/dist/schema/observability.schema.js.map +1 -0
- package/dist/schema/openwebrx.schema.d.ts +2 -2
- package/dist/schema/operator.schema.d.ts +2682 -6
- package/dist/schema/operator.schema.d.ts.map +1 -1
- package/dist/schema/operator.schema.js +10 -20
- package/dist/schema/operator.schema.js.map +1 -1
- package/dist/schema/plugin.schema.d.ts +1977 -492
- package/dist/schema/plugin.schema.d.ts.map +1 -1
- package/dist/schema/plugin.schema.js +165 -14
- package/dist/schema/plugin.schema.js.map +1 -1
- package/dist/schema/process-monitor.schema.d.ts +132 -132
- package/dist/schema/pskreporter.schema.d.ts +1 -3
- package/dist/schema/pskreporter.schema.d.ts.map +1 -1
- package/dist/schema/pskreporter.schema.js +1 -3
- package/dist/schema/pskreporter.schema.js.map +1 -1
- package/dist/schema/qso.schema.d.ts +246 -1
- package/dist/schema/qso.schema.d.ts.map +1 -1
- package/dist/schema/qso.schema.js +68 -0
- package/dist/schema/qso.schema.js.map +1 -1
- package/dist/schema/radio-capability.schema.d.ts +31 -40
- package/dist/schema/radio-capability.schema.d.ts.map +1 -1
- package/dist/schema/radio-capability.schema.js +8 -15
- package/dist/schema/radio-capability.schema.js.map +1 -1
- package/dist/schema/radio-power-support.d.ts.map +1 -1
- package/dist/schema/radio-power-support.js +3 -0
- package/dist/schema/radio-power-support.js.map +1 -1
- package/dist/schema/radio-power.schema.d.ts +102 -13
- package/dist/schema/radio-power.schema.d.ts.map +1 -1
- package/dist/schema/radio-power.schema.js +15 -8
- package/dist/schema/radio-power.schema.js.map +1 -1
- package/dist/schema/radio-profile.schema.d.ts +1491 -97
- package/dist/schema/radio-profile.schema.d.ts.map +1 -1
- package/dist/schema/radio-profile.schema.js +7 -0
- package/dist/schema/radio-profile.schema.js.map +1 -1
- package/dist/schema/radio.schema.d.ts +442 -48
- package/dist/schema/radio.schema.d.ts.map +1 -1
- package/dist/schema/radio.schema.js +75 -7
- package/dist/schema/radio.schema.js.map +1 -1
- package/dist/schema/realtime.schema.d.ts +60 -52
- package/dist/schema/realtime.schema.d.ts.map +1 -1
- package/dist/schema/realtime.schema.js +9 -1
- package/dist/schema/realtime.schema.js.map +1 -1
- package/dist/schema/rigctld.schema.d.ts +6 -6
- package/dist/schema/slot-info.schema.d.ts +28 -9
- package/dist/schema/slot-info.schema.d.ts.map +1 -1
- package/dist/schema/slot-info.schema.js +17 -10
- package/dist/schema/slot-info.schema.js.map +1 -1
- package/dist/schema/spectrum-config.schema.d.ts +638 -0
- package/dist/schema/spectrum-config.schema.d.ts.map +1 -0
- package/dist/schema/spectrum-config.schema.js +129 -0
- package/dist/schema/spectrum-config.schema.js.map +1 -0
- package/dist/schema/spectrum.schema.d.ts +1323 -30
- package/dist/schema/spectrum.schema.d.ts.map +1 -1
- package/dist/schema/spectrum.schema.js +72 -0
- package/dist/schema/spectrum.schema.js.map +1 -1
- package/dist/schema/station-info.schema.d.ts +5 -0
- package/dist/schema/station-info.schema.d.ts.map +1 -1
- package/dist/schema/station-info.schema.js +5 -0
- package/dist/schema/station-info.schema.js.map +1 -1
- package/dist/schema/system.schema.d.ts +56 -6
- package/dist/schema/system.schema.d.ts.map +1 -1
- package/dist/schema/system.schema.js +22 -0
- package/dist/schema/system.schema.js.map +1 -1
- package/dist/schema/transmission.schema.d.ts +8 -7
- package/dist/schema/transmission.schema.d.ts.map +1 -1
- package/dist/schema/transmission.schema.js +2 -7
- package/dist/schema/transmission.schema.js.map +1 -1
- package/dist/schema/tx-audio-input.schema.d.ts +8 -0
- package/dist/schema/tx-audio-input.schema.d.ts.map +1 -0
- package/dist/schema/tx-audio-input.schema.js +19 -0
- package/dist/schema/tx-audio-input.schema.js.map +1 -0
- package/dist/schema/voice-keyer.schema.d.ts +16 -16
- package/dist/schema/voice.schema.d.ts +1 -1
- package/dist/schema/voice.schema.d.ts.map +1 -1
- package/dist/schema/voice.schema.js +1 -1
- package/dist/schema/voice.schema.js.map +1 -1
- package/dist/schema/websocket.schema.d.ts +35811 -7829
- package/dist/schema/websocket.schema.d.ts.map +1 -1
- package/dist/schema/websocket.schema.js +453 -9
- package/dist/schema/websocket.schema.js.map +1 -1
- package/package.json +6 -1
- package/src/index.ts +7 -0
- package/src/schema/__tests__/android-operator-audio.schema.test.ts +31 -0
- package/src/schema/__tests__/assisted-queue.schema.test.ts +122 -0
- package/src/schema/__tests__/audio-sidecar.schema.test.ts +48 -0
- package/src/schema/__tests__/audio.schema.test.ts +102 -0
- package/src/schema/__tests__/diagnostics.schema.test.ts +32 -0
- package/src/schema/__tests__/logbook-health.schema.test.ts +117 -0
- package/src/schema/__tests__/meter.schema.test.ts +28 -0
- package/src/schema/__tests__/observability.schema.test.ts +15 -0
- package/src/schema/__tests__/operator-context-report.schema.test.ts +77 -0
- package/src/schema/__tests__/operator.schema.test.ts +11 -3
- package/src/schema/__tests__/plugin-market.schema.test.ts +165 -2
- package/src/schema/__tests__/qso.schema.test.ts +91 -0
- package/src/schema/__tests__/radio-power-support.test.ts +17 -0
- package/src/schema/__tests__/radio-profile.schema.test.ts +44 -0
- package/src/schema/__tests__/radio.schema.test.ts +108 -1
- package/src/schema/__tests__/realtime-settings.schema.test.ts +2 -1
- package/src/schema/__tests__/remote-access.schema.test.ts +22 -0
- package/src/schema/__tests__/spectrum.schema.test.ts +119 -0
- package/src/schema/__tests__/strategy-transmission.schema.test.ts +106 -0
- package/src/schema/android-operator-audio.schema.ts +49 -0
- package/src/schema/api-response.schema.ts +11 -0
- package/src/schema/audio-sidecar.schema.ts +35 -0
- package/src/schema/audio.schema.ts +115 -2
- package/src/schema/auth.schema.ts +79 -1
- package/src/schema/cw-keyer.schema.ts +5 -0
- package/src/schema/diagnostics.schema.ts +55 -0
- package/src/schema/ft8.schema.ts +8 -0
- package/src/schema/image-radio.schema.ts +342 -0
- package/src/schema/logbook.schema.ts +205 -1
- package/src/schema/mode.schema.ts +18 -6
- package/src/schema/observability.schema.ts +26 -0
- package/src/schema/operator.schema.ts +11 -20
- package/src/schema/plugin.schema.ts +186 -15
- package/src/schema/pskreporter.schema.ts +1 -3
- package/src/schema/qso.schema.ts +78 -0
- package/src/schema/radio-capability.schema.ts +8 -15
- package/src/schema/radio-power-support.ts +3 -0
- package/src/schema/radio-power.schema.ts +15 -8
- package/src/schema/radio-profile.schema.ts +7 -0
- package/src/schema/radio.schema.ts +90 -7
- package/src/schema/realtime.schema.ts +9 -1
- package/src/schema/slot-info.schema.ts +18 -11
- package/src/schema/spectrum-config.schema.ts +156 -0
- package/src/schema/spectrum.schema.ts +89 -0
- package/src/schema/station-info.schema.ts +5 -0
- package/src/schema/system.schema.ts +29 -0
- package/src/schema/transmission.schema.ts +2 -7
- package/src/schema/tx-audio-input.schema.ts +22 -0
- package/src/schema/voice.schema.ts +1 -1
- package/src/schema/websocket.schema.ts +601 -13
- package/test/image-radio-schema.test.ts +107 -0
- package/test/plugin-slot-schema.test.ts +31 -0
- package/test/radio-capability-schema.test.ts +44 -0
- package/CLAUDE.md +0 -41
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { SpectrumPresetDefinitionSchema, SpectrumRenderConfigSchema } from './spectrum-config.schema.js';
|
|
2
3
|
|
|
3
4
|
export const SpectrumKindSchema = z.enum(['audio', 'radio-sdr', 'openwebrx-sdr']);
|
|
4
5
|
export type SpectrumKind = z.infer<typeof SpectrumKindSchema>;
|
|
@@ -26,10 +27,31 @@ export const SpectrumSessionFrequencyRangeModeSchema = z.enum([
|
|
|
26
27
|
]);
|
|
27
28
|
export type SpectrumSessionFrequencyRangeMode = z.infer<typeof SpectrumSessionFrequencyRangeModeSchema>;
|
|
28
29
|
|
|
30
|
+
export const SpectrumSessionViewModeSchema = z.enum(['wide', 'radio-center']);
|
|
31
|
+
export type SpectrumSessionViewMode = z.infer<typeof SpectrumSessionViewModeSchema>;
|
|
32
|
+
|
|
29
33
|
export const SpectrumFrequencyRangeSchema = z.object({
|
|
30
34
|
min: z.number(),
|
|
31
35
|
max: z.number(),
|
|
32
36
|
});
|
|
37
|
+
export const SpectrumViewportSchema = z.object({
|
|
38
|
+
min: z.number().finite(),
|
|
39
|
+
max: z.number().finite(),
|
|
40
|
+
displayBinCount: z.number().int().positive().max(16384),
|
|
41
|
+
}).refine((range) => range.max > range.min, {
|
|
42
|
+
message: 'Spectrum viewport maximum must be greater than minimum',
|
|
43
|
+
path: ['max'],
|
|
44
|
+
});
|
|
45
|
+
export type SpectrumViewport = z.infer<typeof SpectrumViewportSchema>;
|
|
46
|
+
|
|
47
|
+
export const SpectrumSessionViewportInteractionSchema = z.object({
|
|
48
|
+
enabled: z.boolean(),
|
|
49
|
+
canZoom: z.boolean(),
|
|
50
|
+
canPan: z.boolean(),
|
|
51
|
+
canTuneAtEdge: z.boolean(),
|
|
52
|
+
bounds: SpectrumFrequencyRangeSchema.nullable(),
|
|
53
|
+
});
|
|
54
|
+
export type SpectrumSessionViewportInteraction = z.infer<typeof SpectrumSessionViewportInteractionSchema>;
|
|
33
55
|
|
|
34
56
|
export const SpectrumBinaryFormatSchema = z.object({
|
|
35
57
|
type: z.literal('int16'),
|
|
@@ -43,13 +65,53 @@ export const SpectrumBinaryDataSchema = z.object({
|
|
|
43
65
|
format: SpectrumBinaryFormatSchema,
|
|
44
66
|
});
|
|
45
67
|
|
|
68
|
+
export const SpectrumLevelDomainSchema = z.enum(['dbfs', 'calibrated-db', 'raw']);
|
|
69
|
+
export type SpectrumLevelDomain = z.infer<typeof SpectrumLevelDomainSchema>;
|
|
70
|
+
|
|
71
|
+
export const SpectrumLevelUnitSchema = z.enum(['dBFS', 'dB', 'Level']);
|
|
72
|
+
export type SpectrumLevelUnit = z.infer<typeof SpectrumLevelUnitSchema>;
|
|
73
|
+
|
|
74
|
+
export const SpectrumLevelReferenceSchema = z.enum(['full-scale', 'device', 'none']);
|
|
75
|
+
export type SpectrumLevelReference = z.infer<typeof SpectrumLevelReferenceSchema>;
|
|
76
|
+
|
|
77
|
+
export const SpectrumLevelDescriptorSchema = z.object({
|
|
78
|
+
domain: SpectrumLevelDomainSchema,
|
|
79
|
+
unit: SpectrumLevelUnitSchema,
|
|
80
|
+
reference: SpectrumLevelReferenceSchema,
|
|
81
|
+
calibrated: z.boolean(),
|
|
82
|
+
min: z.number().finite(),
|
|
83
|
+
max: z.number().finite(),
|
|
84
|
+
}).refine((level) => level.max > level.min, {
|
|
85
|
+
message: 'Spectrum level maximum must be greater than minimum',
|
|
86
|
+
path: ['max'],
|
|
87
|
+
});
|
|
88
|
+
export type SpectrumLevelDescriptor = z.infer<typeof SpectrumLevelDescriptorSchema>;
|
|
89
|
+
|
|
90
|
+
/** A lower-resolution, wider-range representation derived from the same FFT. */
|
|
91
|
+
export const SpectrumFrameSupplementSchema = z.object({
|
|
92
|
+
frequencyRange: SpectrumFrequencyRangeSchema,
|
|
93
|
+
binaryData: SpectrumBinaryDataSchema,
|
|
94
|
+
meta: z.object({
|
|
95
|
+
sourceBinCount: z.number().int().positive(),
|
|
96
|
+
displayBinCount: z.number().int().positive(),
|
|
97
|
+
centerFrequency: z.number().optional(),
|
|
98
|
+
spanHz: z.number().optional(),
|
|
99
|
+
level: SpectrumLevelDescriptorSchema.optional(),
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
export type SpectrumFrameSupplement = z.infer<typeof SpectrumFrameSupplementSchema>;
|
|
103
|
+
|
|
46
104
|
export const SpectrumFrameMetaSchema = z.object({
|
|
47
105
|
sourceBinCount: z.number().int().positive(),
|
|
48
106
|
displayBinCount: z.number().int().positive(),
|
|
107
|
+
/** Original source range before a per-client server-side projection. */
|
|
108
|
+
nativeFrequencyRange: SpectrumFrequencyRangeSchema.optional(),
|
|
49
109
|
centerFrequency: z.number().optional(),
|
|
50
110
|
spanHz: z.number().optional(),
|
|
51
111
|
profileId: z.string().nullable().optional(),
|
|
52
112
|
radioModel: z.string().optional(),
|
|
113
|
+
level: SpectrumLevelDescriptorSchema.optional(),
|
|
114
|
+
spectrumConfigRevision: z.number().int().nonnegative().optional(),
|
|
53
115
|
});
|
|
54
116
|
|
|
55
117
|
export const SpectrumFrameSchema = z.object({
|
|
@@ -58,6 +120,7 @@ export const SpectrumFrameSchema = z.object({
|
|
|
58
120
|
frequencyRange: SpectrumFrequencyRangeSchema,
|
|
59
121
|
binaryData: SpectrumBinaryDataSchema,
|
|
60
122
|
meta: SpectrumFrameMetaSchema,
|
|
123
|
+
supplement: SpectrumFrameSupplementSchema.optional(),
|
|
61
124
|
});
|
|
62
125
|
|
|
63
126
|
export const SpectrumSourceAvailabilitySchema = z.object({
|
|
@@ -76,6 +139,8 @@ export const SpectrumCapabilitiesSchema = z.object({
|
|
|
76
139
|
profileId: z.string().nullable(),
|
|
77
140
|
defaultKind: SpectrumKindSchema,
|
|
78
141
|
sources: z.array(SpectrumSourceAvailabilitySchema),
|
|
142
|
+
renderConfig: SpectrumRenderConfigSchema,
|
|
143
|
+
presets: z.array(SpectrumPresetDefinitionSchema),
|
|
79
144
|
});
|
|
80
145
|
|
|
81
146
|
export const SpectrumSessionControlIdSchema = z.enum([
|
|
@@ -120,7 +185,30 @@ export const SpectrumSessionPresetMarkerSchema = z.object({
|
|
|
120
185
|
});
|
|
121
186
|
export type SpectrumSessionPresetMarker = z.infer<typeof SpectrumSessionPresetMarkerSchema>;
|
|
122
187
|
|
|
188
|
+
export const SpectrumSessionFrequencyOverlaySchema = z.object({
|
|
189
|
+
id: z.string(),
|
|
190
|
+
label: z.string(),
|
|
191
|
+
lineFrequency: z.number().finite(),
|
|
192
|
+
rangeStartFrequency: z.number().finite(),
|
|
193
|
+
rangeEndFrequency: z.number().finite(),
|
|
194
|
+
variant: z.enum(['tx', 'rx', 'window']),
|
|
195
|
+
draggable: z.boolean(),
|
|
196
|
+
frequencyTarget: z.enum(['radio-frequency', 'operator-tx', 'split-frequency']).nullable(),
|
|
197
|
+
}).refine((overlay) => overlay.rangeEndFrequency >= overlay.rangeStartFrequency, {
|
|
198
|
+
message: 'Spectrum frequency overlay range is invalid',
|
|
199
|
+
path: ['rangeEndFrequency'],
|
|
200
|
+
});
|
|
201
|
+
export type SpectrumSessionFrequencyOverlay = z.infer<typeof SpectrumSessionFrequencyOverlaySchema>;
|
|
202
|
+
|
|
123
203
|
export const SpectrumSessionInteractionStateSchema = z.object({
|
|
204
|
+
viewMode: SpectrumSessionViewModeSchema.default('radio-center'),
|
|
205
|
+
viewport: SpectrumSessionViewportInteractionSchema.default({
|
|
206
|
+
enabled: false,
|
|
207
|
+
canZoom: false,
|
|
208
|
+
canPan: false,
|
|
209
|
+
canTuneAtEdge: false,
|
|
210
|
+
bounds: null,
|
|
211
|
+
}),
|
|
124
212
|
showTxMarkers: z.boolean(),
|
|
125
213
|
showRxMarkers: z.boolean(),
|
|
126
214
|
canDragTx: z.boolean(),
|
|
@@ -130,6 +218,7 @@ export const SpectrumSessionInteractionStateSchema = z.object({
|
|
|
130
218
|
frequencyGestureTarget: z.enum(['operator-tx', 'radio-frequency']).nullable(),
|
|
131
219
|
frequencyStepHz: z.number().int().positive().nullable(),
|
|
132
220
|
presetMarkers: z.array(SpectrumSessionPresetMarkerSchema),
|
|
221
|
+
frequencyOverlays: z.array(SpectrumSessionFrequencyOverlaySchema),
|
|
133
222
|
canDragVoiceOverlay: z.boolean(),
|
|
134
223
|
showVoiceOverlay: z.boolean(),
|
|
135
224
|
canLocalViewportZoom: z.boolean(),
|
|
@@ -16,6 +16,11 @@ export const StationQthSchema = z.object({
|
|
|
16
16
|
longitude: z.number().min(-180).max(180).optional(),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Public station profile shown to clients and exposed through plugin settings.
|
|
21
|
+
* It contains optional display identity, callsign, Markdown description and QTH
|
|
22
|
+
* coordinates/grid; it never contains authentication or radio credentials.
|
|
23
|
+
*/
|
|
19
24
|
export const StationInfoSchema = z.object({
|
|
20
25
|
/** Station display name, e.g. "BG7XXX Remote Station" */
|
|
21
26
|
name: z.string().max(100).optional(),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { RemoteAccessPresetSchema } from './auth.schema.js';
|
|
3
|
+
import { PluginDistributionSchema } from './plugin.schema.js';
|
|
2
4
|
|
|
3
5
|
// ===== 网络信息 =====
|
|
4
6
|
|
|
@@ -13,10 +15,35 @@ export const NetworkInfoSchema = z.object({
|
|
|
13
15
|
addresses: z.array(NetworkAddressSchema),
|
|
14
16
|
hostname: z.string(),
|
|
15
17
|
webPort: z.number(),
|
|
18
|
+
exposure: RemoteAccessPresetSchema.default('lan'),
|
|
19
|
+
listenHost: z.string().default('0.0.0.0'),
|
|
20
|
+
runtimeManagement: z.enum(['electron', 'external']).default('external'),
|
|
21
|
+
distribution: PluginDistributionSchema.default('generic-server'),
|
|
22
|
+
supportsLocalOnly: z.boolean().default(false),
|
|
23
|
+
supportedPresets: z.array(RemoteAccessPresetSchema).min(1).default(['lan', 'public']),
|
|
24
|
+
activeConnections: z.number().int().nonnegative().default(0),
|
|
25
|
+
maxConnections: z.number().int().positive().default(32),
|
|
16
26
|
});
|
|
17
27
|
|
|
18
28
|
export type NetworkInfo = z.infer<typeof NetworkInfoSchema>;
|
|
19
29
|
|
|
30
|
+
// ===== 日志设置 =====
|
|
31
|
+
|
|
32
|
+
export const SystemLogLevelSchema = z.enum(['debug', 'info', 'warn', 'error']);
|
|
33
|
+
export type SystemLogLevel = z.infer<typeof SystemLogLevelSchema>;
|
|
34
|
+
|
|
35
|
+
export const SystemLoggingSettingsSchema = z.object({
|
|
36
|
+
level: SystemLogLevelSchema.optional(),
|
|
37
|
+
effectiveLevel: SystemLogLevelSchema,
|
|
38
|
+
logsDir: z.string(),
|
|
39
|
+
});
|
|
40
|
+
export type SystemLoggingSettings = z.infer<typeof SystemLoggingSettingsSchema>;
|
|
41
|
+
|
|
42
|
+
export const UpdateSystemLoggingSettingsSchema = z.object({
|
|
43
|
+
level: SystemLogLevelSchema,
|
|
44
|
+
});
|
|
45
|
+
export type UpdateSystemLoggingSettingsRequest = z.infer<typeof UpdateSystemLoggingSettingsSchema>;
|
|
46
|
+
|
|
20
47
|
// ===== 时钟状态 =====
|
|
21
48
|
|
|
22
49
|
export const ClockSyncStateSchema = z.enum(['synced', 'stale', 'never', 'failed']);
|
|
@@ -115,12 +142,14 @@ const NtpServerArraySchema = z.array(NtpServerHostSchema).min(1).superRefine((se
|
|
|
115
142
|
}
|
|
116
143
|
});
|
|
117
144
|
|
|
145
|
+
/** Active NTP server list together with the Host-provided default list. */
|
|
118
146
|
export const NtpServerListSettingsSchema = z.object({
|
|
119
147
|
servers: NtpServerArraySchema,
|
|
120
148
|
defaultServers: NtpServerArraySchema,
|
|
121
149
|
});
|
|
122
150
|
export type NtpServerListSettings = z.infer<typeof NtpServerListSettingsSchema>;
|
|
123
151
|
|
|
152
|
+
/** Complete replacement list accepted by `ctx.settings.ntp.update()`. */
|
|
124
153
|
export const UpdateNtpServerListRequestSchema = z.object({
|
|
125
154
|
servers: NtpServerArraySchema,
|
|
126
155
|
});
|
|
@@ -40,16 +40,11 @@ export const CallRequestSchema = z.object({
|
|
|
40
40
|
|
|
41
41
|
// ========== 传输请求类型 ==========
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
* 传输请求(已在 websocket.schema.ts 中定义)
|
|
45
|
-
* TransmitRequestSchema
|
|
46
|
-
*/
|
|
43
|
+
// TransmitRequestSchema is declared in websocket.schema.ts.
|
|
47
44
|
|
|
48
45
|
// ========== 时隙映射类型 ==========
|
|
49
46
|
|
|
50
|
-
/**
|
|
51
|
-
* 操作员时隙配置
|
|
52
|
-
*/
|
|
47
|
+
/** Transmit-message templates for the six logical slots of one operator. */
|
|
53
48
|
export const OperatorSlotsSchema = z.object({
|
|
54
49
|
TX1: z.string().optional(),
|
|
55
50
|
TX2: z.string().optional(),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Normalized TX audio input routes used by the capability/profile layers. */
|
|
4
|
+
export const TxAudioInputSourceSchema = z.enum([
|
|
5
|
+
'mic',
|
|
6
|
+
'usb',
|
|
7
|
+
'network',
|
|
8
|
+
'accessory',
|
|
9
|
+
'line',
|
|
10
|
+
'spdif',
|
|
11
|
+
'mic+usb',
|
|
12
|
+
'mic+accessory',
|
|
13
|
+
]);
|
|
14
|
+
export type TxAudioInputSource = z.infer<typeof TxAudioInputSourceSchema>;
|
|
15
|
+
|
|
16
|
+
/** Profile policy. `auto` is resolved by the connection/provider. */
|
|
17
|
+
export const TxAudioInputSourcePolicySchema = z.enum([
|
|
18
|
+
'auto',
|
|
19
|
+
'unchanged',
|
|
20
|
+
...TxAudioInputSourceSchema.options,
|
|
21
|
+
]);
|
|
22
|
+
export type TxAudioInputSourcePolicy = z.infer<typeof TxAudioInputSourcePolicySchema>;
|
|
@@ -24,5 +24,5 @@ export type VoicePTTLock = z.infer<typeof VoicePTTLockSchema>;
|
|
|
24
24
|
* digital: FT8/FT4 等数字模式
|
|
25
25
|
* voice: 语音通联模式(SSB/FM/AM)
|
|
26
26
|
*/
|
|
27
|
-
export const EngineModeSchema = z.enum(['digital', 'voice', 'cw']);
|
|
27
|
+
export const EngineModeSchema = z.enum(['digital', 'voice', 'cw', 'image']);
|
|
28
28
|
export type EngineMode = z.infer<typeof EngineModeSchema>;
|