@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
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const ImageFamilySchema = z.enum(['sstv', 'fax']);
|
|
4
|
+
export type ImageFamily = z.infer<typeof ImageFamilySchema>;
|
|
5
|
+
|
|
6
|
+
export const ImagePixelFormatSchema = z.enum(['rgb8', 'gray8']);
|
|
7
|
+
export type ImagePixelFormat = z.infer<typeof ImagePixelFormatSchema>;
|
|
8
|
+
|
|
9
|
+
export const ImageSstvReceiveProfileSchema = z.discriminatedUnion('strategy', [
|
|
10
|
+
z.object({ family: z.literal('sstv'), strategy: z.literal('auto') }),
|
|
11
|
+
z.object({ family: z.literal('sstv'), strategy: z.literal('manual'), mode: z.string().min(1) }),
|
|
12
|
+
]);
|
|
13
|
+
export type ImageSstvReceiveProfile = z.infer<typeof ImageSstvReceiveProfileSchema>;
|
|
14
|
+
|
|
15
|
+
export const ImageFaxReceiveProfileSchema = z.discriminatedUnion('strategy', [
|
|
16
|
+
z.object({ family: z.literal('fax'), strategy: z.literal('auto') }),
|
|
17
|
+
z.object({
|
|
18
|
+
family: z.literal('fax'), strategy: z.literal('manual'),
|
|
19
|
+
ioc: z.enum(['ioc288', 'ioc576']), lpm: z.number().int().positive(),
|
|
20
|
+
modulation: z.enum(['fm', 'am']), centerHz: z.number().positive(),
|
|
21
|
+
deviationHz: z.number().positive(),
|
|
22
|
+
}),
|
|
23
|
+
]);
|
|
24
|
+
export type ImageFaxReceiveProfile = z.infer<typeof ImageFaxReceiveProfileSchema>;
|
|
25
|
+
|
|
26
|
+
export const ImageReceiveProfileSchema = z.union([
|
|
27
|
+
ImageSstvReceiveProfileSchema,
|
|
28
|
+
ImageFaxReceiveProfileSchema,
|
|
29
|
+
]);
|
|
30
|
+
export type ImageReceiveProfile = z.infer<typeof ImageReceiveProfileSchema>;
|
|
31
|
+
|
|
32
|
+
export const ImageSstvModeInfoSchema = z.object({
|
|
33
|
+
mode: z.string(), name: z.string(), visCode: z.number().int().nonnegative(),
|
|
34
|
+
width: z.number().int().positive(), height: z.number().int().positive(),
|
|
35
|
+
colorLayout: z.enum(['monochrome', 'rgb', 'yuv']),
|
|
36
|
+
scanLayout: z.enum(['monochrome', 'martin', 'scottie', 'robot', 'pd', 'wraase', 'pasokon']),
|
|
37
|
+
lineSeconds: z.number().positive(), rowsPerLine: z.number().int().positive(),
|
|
38
|
+
status: z.enum(['canonical', 'compatibility']),
|
|
39
|
+
});
|
|
40
|
+
export type ImageSstvModeInfo = z.infer<typeof ImageSstvModeInfoSchema>;
|
|
41
|
+
|
|
42
|
+
export const ImageRadioCapabilitySchema = z.object({
|
|
43
|
+
available: z.boolean(),
|
|
44
|
+
reason: z.string().optional(),
|
|
45
|
+
sstv: z.object({ rx: z.literal(true), tx: z.literal(true) }),
|
|
46
|
+
fax: z.object({ rx: z.literal(true), tx: z.literal(false) }),
|
|
47
|
+
});
|
|
48
|
+
export type ImageRadioCapability = z.infer<typeof ImageRadioCapabilitySchema>;
|
|
49
|
+
|
|
50
|
+
export const ImageRadioServiceStateSchema = z.enum(['stopped', 'starting', 'ready', 'degraded', 'unavailable']);
|
|
51
|
+
export const ImageRxStateSchema = z.enum(['off', 'searching', 'acquiring', 'receiving', 'completed', 'aborted', 'error']);
|
|
52
|
+
export const SstvTxPhaseSchema = z.enum([
|
|
53
|
+
'idle', 'preparing', 'waiting_for_lease', 'keying', 'on_air', 'draining',
|
|
54
|
+
'completed', 'cancelled', 'error', 'ptt_unknown',
|
|
55
|
+
]);
|
|
56
|
+
export const SstvStationIdModeSchema = z.enum(['fsk', 'cw', 'none']);
|
|
57
|
+
export type SstvStationIdMode = z.infer<typeof SstvStationIdModeSchema>;
|
|
58
|
+
export const SstvTxEnvelopeSelectionSchema = z.object({
|
|
59
|
+
enhancedPreamble: z.boolean().default(true),
|
|
60
|
+
stationIdMode: SstvStationIdModeSchema.default('fsk'),
|
|
61
|
+
});
|
|
62
|
+
export type SstvTxEnvelopeSelection = z.infer<typeof SstvTxEnvelopeSelectionSchema>;
|
|
63
|
+
export const SstvTxEnvelopeSnapshotSchema = SstvTxEnvelopeSelectionSchema.extend({
|
|
64
|
+
callsign: z.string().optional(),
|
|
65
|
+
postImageGapMs: z.literal(500),
|
|
66
|
+
endGuardMs: z.literal(300),
|
|
67
|
+
cwWpm: z.literal(20),
|
|
68
|
+
cwToneHz: z.literal(800),
|
|
69
|
+
});
|
|
70
|
+
export type SstvTxEnvelopeSnapshot = z.infer<typeof SstvTxEnvelopeSnapshotSchema>;
|
|
71
|
+
export const SstvTxPreferencesSchema = SstvTxEnvelopeSelectionSchema.extend({
|
|
72
|
+
operatorId: z.string().min(1),
|
|
73
|
+
updatedAt: z.number(),
|
|
74
|
+
});
|
|
75
|
+
export type SstvTxPreferences = z.infer<typeof SstvTxPreferencesSchema>;
|
|
76
|
+
|
|
77
|
+
export const ImageSessionSummarySchema = z.object({
|
|
78
|
+
sessionId: z.string(),
|
|
79
|
+
family: ImageFamilySchema,
|
|
80
|
+
generation: z.number().int().nonnegative(),
|
|
81
|
+
revision: z.number().int().nonnegative(),
|
|
82
|
+
codecMode: z.string().optional(),
|
|
83
|
+
width: z.number().int().positive().optional(),
|
|
84
|
+
height: z.number().int().positive().optional(),
|
|
85
|
+
receivedLines: z.number().int().nonnegative().default(0),
|
|
86
|
+
firstAvailableLine: z.number().int().nonnegative().default(0),
|
|
87
|
+
startedAt: z.number(),
|
|
88
|
+
});
|
|
89
|
+
export type ImageSessionSummary = z.infer<typeof ImageSessionSummarySchema>;
|
|
90
|
+
|
|
91
|
+
export const SstvTxStatusSchema = z.object({
|
|
92
|
+
phase: SstvTxPhaseSchema,
|
|
93
|
+
sessionId: z.string().optional(),
|
|
94
|
+
requestId: z.string().optional(),
|
|
95
|
+
operatorId: z.string().optional(),
|
|
96
|
+
artifactId: z.string().optional(),
|
|
97
|
+
historyId: z.string().optional(),
|
|
98
|
+
mode: z.string().optional(),
|
|
99
|
+
encoderStage: z.enum(['preamble', 'vis', 'raster', 'stationId', 'guard', 'finished']).optional(),
|
|
100
|
+
envelope: SstvTxEnvelopeSnapshotSchema.optional(),
|
|
101
|
+
revision: z.number().int().nonnegative().default(0),
|
|
102
|
+
samplesEmitted: z.number().int().nonnegative().default(0),
|
|
103
|
+
estimatedTotalSamples: z.number().int().nonnegative().default(0),
|
|
104
|
+
currentRow: z.number().int().nonnegative().optional(),
|
|
105
|
+
startedAt: z.number().optional(),
|
|
106
|
+
errorCode: z.string().optional(),
|
|
107
|
+
});
|
|
108
|
+
export type SstvTxStatus = z.infer<typeof SstvTxStatusSchema>;
|
|
109
|
+
|
|
110
|
+
export const ImageRadioStatusSchema = z.object({
|
|
111
|
+
serviceState: ImageRadioServiceStateSchema,
|
|
112
|
+
family: ImageFamilySchema.nullable(),
|
|
113
|
+
receiveProfile: ImageReceiveProfileSchema.nullable(),
|
|
114
|
+
rxState: ImageRxStateSchema,
|
|
115
|
+
rxCaptureActive: z.boolean().default(false),
|
|
116
|
+
capability: ImageRadioCapabilitySchema,
|
|
117
|
+
currentSession: ImageSessionSummarySchema.nullable(),
|
|
118
|
+
tx: SstvTxStatusSchema,
|
|
119
|
+
nativeQueuedSamples: z.number().int().nonnegative().default(0),
|
|
120
|
+
jsBacklogSamples: z.number().int().nonnegative().default(0),
|
|
121
|
+
discontinuities: z.number().int().nonnegative().default(0),
|
|
122
|
+
updatedAt: z.number(),
|
|
123
|
+
});
|
|
124
|
+
export type ImageRadioStatus = z.infer<typeof ImageRadioStatusSchema>;
|
|
125
|
+
|
|
126
|
+
export const ImageRowPatchSchema = z.object({
|
|
127
|
+
rowIndex: z.number().int().nonnegative(),
|
|
128
|
+
width: z.number().int().positive(),
|
|
129
|
+
rowRevision: z.number().int().nonnegative(),
|
|
130
|
+
completeness: z.enum(['provisional', 'final']).optional(),
|
|
131
|
+
dataBase64: z.string(),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export const ImagePaperBoundaryKindSchema = z.enum([
|
|
135
|
+
'initial', 'vis', 'syncTiming', 'aptPhasing', 'protocolEnd',
|
|
136
|
+
'manualMode', 'discontinuity', 'reset', 'truncated', 'protocolObserved',
|
|
137
|
+
'localTxStart', 'localTxEnd',
|
|
138
|
+
]);
|
|
139
|
+
export type ImagePaperBoundaryKind = z.infer<typeof ImagePaperBoundaryKindSchema>;
|
|
140
|
+
export const ImagePaperSourceSchema = z.enum(['rx', 'localTx']);
|
|
141
|
+
export type ImagePaperSource = z.infer<typeof ImagePaperSourceSchema>;
|
|
142
|
+
|
|
143
|
+
export const ImagePaperBoundarySchema = z.object({
|
|
144
|
+
boundaryId: z.string(), lineIndex: z.number().int().nonnegative(),
|
|
145
|
+
kind: ImagePaperBoundaryKindSchema, trusted: z.boolean(),
|
|
146
|
+
codecMode: z.string(), width: z.number().int().positive(),
|
|
147
|
+
pixelFormat: ImagePixelFormatSchema, timestamp: z.number(),
|
|
148
|
+
detection: z.string().optional(), nominalHeight: z.number().int().positive().optional(),
|
|
149
|
+
source: ImagePaperSourceSchema.optional(),
|
|
150
|
+
txSessionId: z.string().optional(),
|
|
151
|
+
txOutcome: z.enum(['completed', 'interrupted']).optional(),
|
|
152
|
+
});
|
|
153
|
+
export type ImagePaperBoundary = z.infer<typeof ImagePaperBoundarySchema>;
|
|
154
|
+
|
|
155
|
+
export const ImageFaxCalibrationPointSchema = z.object({
|
|
156
|
+
revision: z.number().int().nonnegative(),
|
|
157
|
+
referenceLine: z.number().int().nonnegative(),
|
|
158
|
+
phasePixels: z.number().finite(),
|
|
159
|
+
clockPpm: z.number().finite(),
|
|
160
|
+
confidence: z.number().min(0).max(1),
|
|
161
|
+
source: z.enum(['nominal', 'phasing', 'imageContent', 'manual']),
|
|
162
|
+
status: z.enum(['nominal', 'acquiring', 'locked', 'tracking', 'degraded']),
|
|
163
|
+
});
|
|
164
|
+
export type ImageFaxCalibrationPoint = z.infer<typeof ImageFaxCalibrationPointSchema>;
|
|
165
|
+
|
|
166
|
+
export const ImageFaxCalibrationSchema = z.object({
|
|
167
|
+
boundaryId: z.string().min(1),
|
|
168
|
+
revision: z.number().int().nonnegative(),
|
|
169
|
+
autoEnabled: z.boolean(),
|
|
170
|
+
autoPoints: z.array(ImageFaxCalibrationPointSchema).max(256),
|
|
171
|
+
manualPhasePixels: z.number().finite(),
|
|
172
|
+
manualClockPpm: z.number().finite(),
|
|
173
|
+
updatedAt: z.number(),
|
|
174
|
+
});
|
|
175
|
+
export type ImageFaxCalibration = z.infer<typeof ImageFaxCalibrationSchema>;
|
|
176
|
+
|
|
177
|
+
export const ImageRxEventSchema = z.discriminatedUnion('type', [
|
|
178
|
+
z.object({ type: z.literal('paperStarted'), session: ImageSessionSummarySchema, pixelFormat: ImagePixelFormatSchema }),
|
|
179
|
+
z.object({ type: z.literal('boundary'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), boundary: ImagePaperBoundarySchema }),
|
|
180
|
+
z.object({ type: z.literal('faxCalibration'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), calibration: ImageFaxCalibrationSchema }),
|
|
181
|
+
z.object({ type: z.literal('signalDetected'), family: ImageFamilySchema, confidence: z.number().min(0).max(1), candidates: z.array(z.string()), timestamp: z.number() }),
|
|
182
|
+
z.object({ type: z.literal('imageStarted'), session: ImageSessionSummarySchema, pixelFormat: ImagePixelFormatSchema, detection: z.string().optional(), confidence: z.number().min(0).max(1).optional() }),
|
|
183
|
+
z.object({ type: z.literal('rows'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), pixelFormat: ImagePixelFormatSchema, rows: z.array(ImageRowPatchSchema).min(1).max(8) }),
|
|
184
|
+
z.object({ type: z.literal('imageCompleted'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), artifactId: z.string(), previewUrl: z.string(), partial: z.boolean() }),
|
|
185
|
+
z.object({ type: z.literal('imageAborted'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), reason: z.string(), lastRow: z.number().int().nonnegative().optional(), temporary: z.boolean() }),
|
|
186
|
+
z.object({ type: z.literal('snapshotRequired'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), snapshotUrl: z.string() }),
|
|
187
|
+
z.object({ type: z.literal('captureSaved'), sessionId: z.string(), generation: z.number().int().nonnegative(), revision: z.number().int().nonnegative(), artifactId: z.string(), previewUrl: z.string(), saveReason: z.enum(['manual', 'protocolEnd']), complete: z.boolean(), startLine: z.number().int().nonnegative(), endLine: z.number().int().positive() }),
|
|
188
|
+
]);
|
|
189
|
+
export type ImageRxEvent = z.infer<typeof ImageRxEventSchema>;
|
|
190
|
+
|
|
191
|
+
export const ImageArtifactSchema = z.object({
|
|
192
|
+
id: z.string(),
|
|
193
|
+
family: ImageFamilySchema,
|
|
194
|
+
direction: z.enum(['rx', 'tx']),
|
|
195
|
+
operatorId: z.string().optional(),
|
|
196
|
+
codecMode: z.string(),
|
|
197
|
+
pixelFormat: ImagePixelFormatSchema,
|
|
198
|
+
width: z.number().int().positive(),
|
|
199
|
+
height: z.number().int().positive(),
|
|
200
|
+
frequency: z.number().positive(),
|
|
201
|
+
radioMode: z.string().optional(),
|
|
202
|
+
complete: z.boolean(),
|
|
203
|
+
saveReason: z.enum(['manual', 'protocolEnd']).optional(),
|
|
204
|
+
captureStartedAt: z.number().optional(),
|
|
205
|
+
captureEndedAt: z.number().optional(),
|
|
206
|
+
truncated: z.boolean().default(false),
|
|
207
|
+
pinned: z.boolean().default(false),
|
|
208
|
+
qsoId: z.string().optional(),
|
|
209
|
+
contentHash: z.string(),
|
|
210
|
+
createdAt: z.number(),
|
|
211
|
+
imageUrl: z.string(),
|
|
212
|
+
faxCalibration: ImageFaxCalibrationSchema.optional(),
|
|
213
|
+
});
|
|
214
|
+
export type ImageArtifact = z.infer<typeof ImageArtifactSchema>;
|
|
215
|
+
|
|
216
|
+
const ImageHistoryRecordBaseSchema = z.object({
|
|
217
|
+
id: z.string(),
|
|
218
|
+
artifactId: z.string(),
|
|
219
|
+
family: ImageFamilySchema,
|
|
220
|
+
operatorId: z.string().optional(),
|
|
221
|
+
occurredAt: z.number(),
|
|
222
|
+
qsoId: z.string().optional(),
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
export const ImageHistoryRecordSchema = z.discriminatedUnion('direction', [
|
|
226
|
+
ImageHistoryRecordBaseSchema.extend({
|
|
227
|
+
direction: z.literal('rx'),
|
|
228
|
+
saveReason: z.enum(['manual', 'protocolEnd']),
|
|
229
|
+
complete: z.boolean(),
|
|
230
|
+
truncated: z.boolean().default(false),
|
|
231
|
+
}),
|
|
232
|
+
ImageHistoryRecordBaseSchema.extend({
|
|
233
|
+
direction: z.literal('tx'),
|
|
234
|
+
operatorId: z.string().min(1),
|
|
235
|
+
sessionId: z.string().min(1),
|
|
236
|
+
startedAt: z.number(),
|
|
237
|
+
endedAt: z.number().optional(),
|
|
238
|
+
outcome: z.enum(['transmitting', 'completed', 'interrupted']),
|
|
239
|
+
errorCode: z.string().optional(),
|
|
240
|
+
envelope: SstvTxEnvelopeSnapshotSchema.optional(),
|
|
241
|
+
sampleRate: z.number().int().positive().optional(),
|
|
242
|
+
estimatedTotalSamples: z.number().int().nonnegative().optional(),
|
|
243
|
+
}),
|
|
244
|
+
]);
|
|
245
|
+
export type ImageHistoryRecord = z.infer<typeof ImageHistoryRecordSchema>;
|
|
246
|
+
|
|
247
|
+
export const ImageHistoryEntrySchema = z.object({
|
|
248
|
+
record: ImageHistoryRecordSchema,
|
|
249
|
+
artifact: ImageArtifactSchema,
|
|
250
|
+
});
|
|
251
|
+
export type ImageHistoryEntry = z.infer<typeof ImageHistoryEntrySchema>;
|
|
252
|
+
|
|
253
|
+
export const ImageTemplateTextLayerSchema = z.object({
|
|
254
|
+
id: z.string().min(1).max(64),
|
|
255
|
+
text: z.string().max(256),
|
|
256
|
+
x: z.number().min(-2).max(2),
|
|
257
|
+
y: z.number().min(-2).max(2),
|
|
258
|
+
width: z.number().positive().max(4),
|
|
259
|
+
height: z.number().positive().max(4),
|
|
260
|
+
fontSize: z.number().positive().max(1),
|
|
261
|
+
color: z.string().regex(/^#[0-9a-fA-F]{6}$/),
|
|
262
|
+
strokeColor: z.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
263
|
+
strokeWidth: z.number().min(0).max(0.5).default(0.12),
|
|
264
|
+
align: z.enum(['left', 'center', 'right']).default('center'),
|
|
265
|
+
rotation: z.number().min(-180).max(180).default(0),
|
|
266
|
+
});
|
|
267
|
+
export type ImageTemplateTextLayer = z.infer<typeof ImageTemplateTextLayerSchema>;
|
|
268
|
+
|
|
269
|
+
export const ImageTemplateSchema = z.object({
|
|
270
|
+
id: z.string(),
|
|
271
|
+
operatorId: z.string().optional(),
|
|
272
|
+
name: z.string().min(1).max(80),
|
|
273
|
+
builtIn: z.boolean().default(false),
|
|
274
|
+
backgroundArtifactId: z.string().optional(),
|
|
275
|
+
layers: z.array(ImageTemplateTextLayerSchema).max(16),
|
|
276
|
+
createdAt: z.number(),
|
|
277
|
+
updatedAt: z.number(),
|
|
278
|
+
});
|
|
279
|
+
export type ImageTemplate = z.infer<typeof ImageTemplateSchema>;
|
|
280
|
+
|
|
281
|
+
export const ImageComposerBackgroundSchema = z.object({
|
|
282
|
+
operatorId: z.string().min(1),
|
|
283
|
+
width: z.number().int().positive(),
|
|
284
|
+
height: z.number().int().positive(),
|
|
285
|
+
updatedAt: z.number(),
|
|
286
|
+
imageUrl: z.string(),
|
|
287
|
+
});
|
|
288
|
+
export type ImageComposerBackground = z.infer<typeof ImageComposerBackgroundSchema>;
|
|
289
|
+
|
|
290
|
+
export const ImageRxSubscriptionSchema = z.object({ enabled: z.boolean() });
|
|
291
|
+
export const SstvTxStartCommandSchema = z.object({
|
|
292
|
+
requestId: z.string().min(1).max(128),
|
|
293
|
+
operatorId: z.string().min(1),
|
|
294
|
+
artifactId: z.string().min(1),
|
|
295
|
+
mode: z.string().min(1),
|
|
296
|
+
expectedFrequency: z.number().positive(),
|
|
297
|
+
interruptActiveCapture: z.boolean().optional(),
|
|
298
|
+
envelope: SstvTxEnvelopeSelectionSchema.default({ enhancedPreamble: true, stationIdMode: 'fsk' }),
|
|
299
|
+
});
|
|
300
|
+
export type SstvTxStartCommand = z.infer<typeof SstvTxStartCommandSchema>;
|
|
301
|
+
export const SstvTxCancelCommandSchema = z.object({
|
|
302
|
+
requestId: z.string().min(1).max(128),
|
|
303
|
+
operatorId: z.string().min(1),
|
|
304
|
+
sessionId: z.string().min(1),
|
|
305
|
+
expectedRevision: z.number().int().nonnegative(),
|
|
306
|
+
});
|
|
307
|
+
export type SstvTxCancelCommand = z.infer<typeof SstvTxCancelCommandSchema>;
|
|
308
|
+
export const SstvTxCommandResultSchema = z.object({
|
|
309
|
+
requestId: z.string(),
|
|
310
|
+
accepted: z.boolean(),
|
|
311
|
+
sessionId: z.string().optional(),
|
|
312
|
+
errorCode: z.string().optional(),
|
|
313
|
+
});
|
|
314
|
+
export type SstvTxCommandResult = z.infer<typeof SstvTxCommandResultSchema>;
|
|
315
|
+
|
|
316
|
+
export const ImagePaperSaveCommandSchema = z.object({
|
|
317
|
+
requestId: z.string().min(1).max(128),
|
|
318
|
+
operatorId: z.string().min(1),
|
|
319
|
+
expectedRevision: z.number().int().nonnegative(),
|
|
320
|
+
});
|
|
321
|
+
export type ImagePaperSaveCommand = z.infer<typeof ImagePaperSaveCommandSchema>;
|
|
322
|
+
|
|
323
|
+
const FaxCalibrationCommandBaseSchema = z.object({
|
|
324
|
+
requestId: z.string().min(1).max(128),
|
|
325
|
+
operatorId: z.string().min(1),
|
|
326
|
+
sessionId: z.string().min(1),
|
|
327
|
+
boundaryId: z.string().min(1),
|
|
328
|
+
expectedRevision: z.number().int().nonnegative(),
|
|
329
|
+
});
|
|
330
|
+
export const FaxCalibrationSetCommandSchema = FaxCalibrationCommandBaseSchema.extend({
|
|
331
|
+
autoEnabled: z.boolean(),
|
|
332
|
+
phasePixels: z.number().finite(),
|
|
333
|
+
clockPpm: z.number().finite().min(-5000).max(5000),
|
|
334
|
+
});
|
|
335
|
+
export type FaxCalibrationSetCommand = z.infer<typeof FaxCalibrationSetCommandSchema>;
|
|
336
|
+
export const FaxCalibrationResetCommandSchema = FaxCalibrationCommandBaseSchema;
|
|
337
|
+
export type FaxCalibrationResetCommand = z.infer<typeof FaxCalibrationResetCommandSchema>;
|
|
338
|
+
export const FaxCalibrationCommandResultSchema = z.object({
|
|
339
|
+
requestId: z.string(), accepted: z.boolean(),
|
|
340
|
+
calibration: ImageFaxCalibrationSchema.optional(), errorCode: z.string().optional(),
|
|
341
|
+
});
|
|
342
|
+
export type FaxCalibrationCommandResult = z.infer<typeof FaxCalibrationCommandResultSchema>;
|
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { QSORecordSchema } from './qso.schema.js';
|
|
3
|
+
|
|
4
|
+
export const LOGBOOK_OPERATION_ERROR_CODES = [
|
|
5
|
+
'LOGBOOK_LOADING',
|
|
6
|
+
'LOGBOOK_READ_ONLY',
|
|
7
|
+
'LOGBOOK_UNAVAILABLE',
|
|
8
|
+
'LOGBOOK_WRITE_FAILED',
|
|
9
|
+
'LOGBOOK_WRITE_STATE_UNCERTAIN',
|
|
10
|
+
'LOGBOOK_UNSAVED_QSO_NOT_FOUND',
|
|
11
|
+
'LOGBOOK_BACKUP_FAILED',
|
|
12
|
+
'LOGBOOK_BACKUP_UNAVAILABLE',
|
|
13
|
+
'LOGBOOK_BACKUP_CHANGED',
|
|
14
|
+
'LOGBOOK_MAINTENANCE',
|
|
15
|
+
'LOGBOOK_REVISION_CONFLICT',
|
|
16
|
+
'LOGBOOK_REVISION_MISMATCH',
|
|
17
|
+
'LOGBOOK_RESTORE_PRECONDITION_FAILED',
|
|
18
|
+
'LOGBOOK_PRECONDITION_REQUIRED',
|
|
19
|
+
'LOGBOOK_IDEMPOTENCY_CONFLICT',
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
export const LogbookOperationErrorCodeSchema = z.enum(LOGBOOK_OPERATION_ERROR_CODES);
|
|
23
|
+
|
|
24
|
+
export const LogbookHealthStateSchema = z.enum([
|
|
25
|
+
'loading',
|
|
26
|
+
'healthy',
|
|
27
|
+
'degraded',
|
|
28
|
+
'read_only',
|
|
29
|
+
'unavailable',
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
export const LogbookHealthIssueSchema = z.object({
|
|
33
|
+
code: z.string(),
|
|
34
|
+
message: z.string(),
|
|
35
|
+
affectedRecords: z.number().int().nonnegative().optional(),
|
|
36
|
+
affectedBytes: z.number().int().nonnegative().optional(),
|
|
37
|
+
recoveryFileName: z.string().optional(),
|
|
38
|
+
occurredAt: z.number(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const LogbookHealthSchema = z.object({
|
|
42
|
+
state: LogbookHealthStateSchema,
|
|
43
|
+
readable: z.boolean(),
|
|
44
|
+
writable: z.boolean(),
|
|
45
|
+
issues: z.array(LogbookHealthIssueSchema),
|
|
46
|
+
updatedAt: z.number(),
|
|
47
|
+
});
|
|
2
48
|
|
|
3
49
|
export const DxccCountSummarySchema = z.object({
|
|
4
50
|
current: z.number().default(0),
|
|
@@ -27,10 +73,12 @@ export const LogBookInfoSchema = z.object({
|
|
|
27
73
|
id: z.string(),
|
|
28
74
|
name: z.string(),
|
|
29
75
|
description: z.string().optional(),
|
|
30
|
-
|
|
76
|
+
fileName: z.string().min(1).max(255),
|
|
77
|
+
storageKind: z.enum(['managed', 'custom']),
|
|
31
78
|
createdAt: z.number(),
|
|
32
79
|
lastUsed: z.number(),
|
|
33
80
|
isActive: z.boolean(),
|
|
81
|
+
health: LogbookHealthSchema,
|
|
34
82
|
});
|
|
35
83
|
|
|
36
84
|
/**
|
|
@@ -102,6 +150,141 @@ export const LogBookActionResponseSchema = z.object({
|
|
|
102
150
|
data: LogBookInfoSchema.optional(),
|
|
103
151
|
});
|
|
104
152
|
|
|
153
|
+
export const LogbookRecoveryRetryResponseSchema = z.object({
|
|
154
|
+
success: z.boolean(),
|
|
155
|
+
data: z.object({
|
|
156
|
+
logBookId: z.string(),
|
|
157
|
+
health: LogbookHealthSchema,
|
|
158
|
+
}),
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const LogbookRevisionSchema = z.string()
|
|
162
|
+
.min(1)
|
|
163
|
+
.max(256)
|
|
164
|
+
.regex(/^[A-Za-z0-9._:"-]+$/);
|
|
165
|
+
const LogbookIdempotencyKeySchema = z.string()
|
|
166
|
+
.min(8)
|
|
167
|
+
.max(128)
|
|
168
|
+
.regex(/^[A-Za-z0-9._:-]+$/);
|
|
169
|
+
const LogbookRecoveryTokenSchema = z.string()
|
|
170
|
+
.min(8)
|
|
171
|
+
.max(128)
|
|
172
|
+
.regex(/^[A-Za-z0-9._:-]+$/);
|
|
173
|
+
const UnsavedQsoAttemptIdSchema = z.string()
|
|
174
|
+
.min(8)
|
|
175
|
+
.max(128)
|
|
176
|
+
.regex(/^[A-Za-z0-9._:-]+$/);
|
|
177
|
+
|
|
178
|
+
export const LogbookUnsavedQsoSummarySchema = z.object({
|
|
179
|
+
attemptId: UnsavedQsoAttemptIdSchema,
|
|
180
|
+
operatorId: z.string().min(1).max(128),
|
|
181
|
+
createdAt: z.number(),
|
|
182
|
+
callsign: z.string().max(64),
|
|
183
|
+
mode: z.string().max(32),
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
export const LogbookBackupArtifactSchema = z.object({
|
|
187
|
+
createdAt: z.number(),
|
|
188
|
+
size: z.number().int().nonnegative(),
|
|
189
|
+
recordCount: z.number().int().nonnegative().optional(),
|
|
190
|
+
opaqueRecordCount: z.number().int().nonnegative().optional(),
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
export const LogbookBackupOperationSchema = z.object({
|
|
194
|
+
id: z.string().min(1).max(128),
|
|
195
|
+
kind: z.enum(['backup', 'restore-prepare', 'restore']),
|
|
196
|
+
state: z.enum(['queued', 'running', 'succeeded', 'failed']),
|
|
197
|
+
phase: z.string().min(1).max(128),
|
|
198
|
+
processedBytes: z.number().int().nonnegative().optional(),
|
|
199
|
+
totalBytes: z.number().int().nonnegative().optional(),
|
|
200
|
+
errorCode: z.string().min(1).max(128).optional(),
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
export const LogbookBackupStatusSchema = z.object({
|
|
204
|
+
logBookId: z.string(),
|
|
205
|
+
revision: LogbookRevisionSchema,
|
|
206
|
+
mainHealth: LogbookHealthSchema,
|
|
207
|
+
dirty: z.boolean(),
|
|
208
|
+
pendingMutations: z.number().int().nonnegative(),
|
|
209
|
+
latest: LogbookBackupArtifactSchema.optional(),
|
|
210
|
+
preRestore: LogbookBackupArtifactSchema.optional(),
|
|
211
|
+
operation: LogbookBackupOperationSchema.optional(),
|
|
212
|
+
unsaved: z.array(LogbookUnsavedQsoSummarySchema).optional(),
|
|
213
|
+
capabilities: z.object({
|
|
214
|
+
canCreate: z.boolean(),
|
|
215
|
+
canDownload: z.boolean(),
|
|
216
|
+
canRestore: z.boolean(),
|
|
217
|
+
canDownloadPreRestore: z.boolean(),
|
|
218
|
+
}),
|
|
219
|
+
error: z.object({
|
|
220
|
+
code: z.string().min(1).max(128),
|
|
221
|
+
message: z.string(),
|
|
222
|
+
}).optional(),
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
export const LogbookBackupStatusResponseSchema = z.object({
|
|
226
|
+
success: z.literal(true),
|
|
227
|
+
data: LogbookBackupStatusSchema,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
export const CreateLogbookBackupRequestSchema = z.object({
|
|
231
|
+
}).strict();
|
|
232
|
+
|
|
233
|
+
export const PrepareLogbookRestoreRequestSchema = z.object({
|
|
234
|
+
}).strict();
|
|
235
|
+
|
|
236
|
+
export const RestoreLogbookRequestSchema = z.object({
|
|
237
|
+
preflightToken: LogbookRecoveryTokenSchema,
|
|
238
|
+
confirmation: z.string().min(1).max(128),
|
|
239
|
+
}).strict();
|
|
240
|
+
|
|
241
|
+
export const LogbookConditionalMutationHeadersSchema = z.object({
|
|
242
|
+
revision: LogbookRevisionSchema,
|
|
243
|
+
idempotencyKey: LogbookIdempotencyKeySchema,
|
|
244
|
+
}).strict();
|
|
245
|
+
|
|
246
|
+
export const LogbookIdempotentMutationHeadersSchema = z.object({
|
|
247
|
+
idempotencyKey: LogbookIdempotencyKeySchema,
|
|
248
|
+
}).strict();
|
|
249
|
+
|
|
250
|
+
export const LogbookRestoreFileSummarySchema = z.object({
|
|
251
|
+
size: z.number().int().nonnegative(),
|
|
252
|
+
recordCount: z.number().int().nonnegative(),
|
|
253
|
+
opaqueRecordCount: z.number().int().nonnegative(),
|
|
254
|
+
incompleteTail: z.boolean(),
|
|
255
|
+
issueCount: z.number().int().nonnegative(),
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
export const LogbookRestorePreflightSchema = z.object({
|
|
259
|
+
preflightToken: LogbookRecoveryTokenSchema,
|
|
260
|
+
expiresAt: z.number(),
|
|
261
|
+
revision: LogbookRevisionSchema,
|
|
262
|
+
main: LogbookRestoreFileSummarySchema,
|
|
263
|
+
backup: LogbookRestoreFileSummarySchema,
|
|
264
|
+
recordDelta: z.number().int(),
|
|
265
|
+
estimatedLoss: z.number().int().nonnegative(),
|
|
266
|
+
highRisk: z.boolean(),
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
export const LogbookRestorePreflightResponseSchema = z.object({
|
|
270
|
+
success: z.literal(true),
|
|
271
|
+
data: LogbookRestorePreflightSchema,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
export const LogbookUnsavedQsoRetryResponseSchema = z.object({
|
|
275
|
+
success: z.literal(true),
|
|
276
|
+
data: QSORecordSchema,
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
export const LogbookUnsavedQsoDiscardResponseSchema = z.object({
|
|
280
|
+
success: z.literal(true),
|
|
281
|
+
data: z.object({ attemptId: UnsavedQsoAttemptIdSchema }),
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
export const LogbookUnsavedQsoAttemptParamsSchema = z.object({
|
|
285
|
+
attemptId: UnsavedQsoAttemptIdSchema,
|
|
286
|
+
}).strict();
|
|
287
|
+
|
|
105
288
|
/**
|
|
106
289
|
* 日志本QSO查询选项Schema
|
|
107
290
|
*/
|
|
@@ -293,6 +476,10 @@ export const QSOActionResponseSchema = z.object({
|
|
|
293
476
|
// ========== 类型导出 ==========
|
|
294
477
|
|
|
295
478
|
export type LogBookInfo = z.infer<typeof LogBookInfoSchema>;
|
|
479
|
+
export type LogbookOperationErrorCode = z.infer<typeof LogbookOperationErrorCodeSchema>;
|
|
480
|
+
export type LogbookHealthState = z.infer<typeof LogbookHealthStateSchema>;
|
|
481
|
+
export type LogbookHealthIssue = z.infer<typeof LogbookHealthIssueSchema>;
|
|
482
|
+
export type LogbookHealth = z.infer<typeof LogbookHealthSchema>;
|
|
296
483
|
export type CreateLogBookRequest = z.infer<typeof CreateLogBookRequestSchema>;
|
|
297
484
|
export type UpdateLogBookRequest = z.infer<typeof UpdateLogBookRequestSchema>;
|
|
298
485
|
export type ConnectOperatorToLogBookRequest = z.infer<typeof ConnectOperatorToLogBookRequestSchema>;
|
|
@@ -301,6 +488,23 @@ export type LogBookDxccSummary = z.infer<typeof LogBookDxccSummarySchema>;
|
|
|
301
488
|
export type LogBookListResponse = z.infer<typeof LogBookListResponseSchema>;
|
|
302
489
|
export type LogBookDetailResponse = z.infer<typeof LogBookDetailResponseSchema>;
|
|
303
490
|
export type LogBookActionResponse = z.infer<typeof LogBookActionResponseSchema>;
|
|
491
|
+
export type LogbookRecoveryRetryResponse = z.infer<typeof LogbookRecoveryRetryResponseSchema>;
|
|
492
|
+
export type LogbookUnsavedQsoSummary = z.infer<typeof LogbookUnsavedQsoSummarySchema>;
|
|
493
|
+
export type LogbookBackupArtifact = z.infer<typeof LogbookBackupArtifactSchema>;
|
|
494
|
+
export type LogbookBackupOperation = z.infer<typeof LogbookBackupOperationSchema>;
|
|
495
|
+
export type LogbookBackupStatus = z.infer<typeof LogbookBackupStatusSchema>;
|
|
496
|
+
export type LogbookBackupStatusResponse = z.infer<typeof LogbookBackupStatusResponseSchema>;
|
|
497
|
+
export type CreateLogbookBackupRequest = z.infer<typeof CreateLogbookBackupRequestSchema>;
|
|
498
|
+
export type PrepareLogbookRestoreRequest = z.infer<typeof PrepareLogbookRestoreRequestSchema>;
|
|
499
|
+
export type RestoreLogbookRequest = z.infer<typeof RestoreLogbookRequestSchema>;
|
|
500
|
+
export type LogbookConditionalMutationHeaders = z.infer<typeof LogbookConditionalMutationHeadersSchema>;
|
|
501
|
+
export type LogbookIdempotentMutationHeaders = z.infer<typeof LogbookIdempotentMutationHeadersSchema>;
|
|
502
|
+
export type LogbookRestoreFileSummary = z.infer<typeof LogbookRestoreFileSummarySchema>;
|
|
503
|
+
export type LogbookRestorePreflight = z.infer<typeof LogbookRestorePreflightSchema>;
|
|
504
|
+
export type LogbookRestorePreflightResponse = z.infer<typeof LogbookRestorePreflightResponseSchema>;
|
|
505
|
+
export type LogbookUnsavedQsoRetryResponse = z.infer<typeof LogbookUnsavedQsoRetryResponseSchema>;
|
|
506
|
+
export type LogbookUnsavedQsoDiscardResponse = z.infer<typeof LogbookUnsavedQsoDiscardResponseSchema>;
|
|
507
|
+
export type LogbookUnsavedQsoAttemptParams = z.infer<typeof LogbookUnsavedQsoAttemptParamsSchema>;
|
|
304
508
|
export type LogBookQSOQueryOptions = z.infer<typeof LogBookQSOQueryOptionsSchema>;
|
|
305
509
|
export type LogBookRecentGlobeQuery = z.infer<typeof LogBookRecentGlobeQuerySchema>;
|
|
306
510
|
export type LogBookRecentGlobeHomeSource = z.infer<typeof LogBookRecentGlobeHomeSourceSchema>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* 模式描述符 - 定义 FT8/FT4 等模式的时序参数
|
|
5
|
-
*/
|
|
3
|
+
/** Timing, decoder and display parameters for a digital mode such as FT8 or FT4. */
|
|
6
4
|
export const ModeDescriptorSchema = z.object({
|
|
7
5
|
/** 模式名称,如 "FT8", "FT4" */
|
|
8
6
|
name: z.string(),
|
|
@@ -71,6 +69,22 @@ export const MODES = {
|
|
|
71
69
|
transmitTiming: 0,
|
|
72
70
|
encodeAdvance: 0,
|
|
73
71
|
} as ModeDescriptor,
|
|
72
|
+
SSTV: {
|
|
73
|
+
name: 'SSTV',
|
|
74
|
+
slotMs: 0,
|
|
75
|
+
toleranceMs: 0,
|
|
76
|
+
windowTiming: [],
|
|
77
|
+
transmitTiming: 0,
|
|
78
|
+
encodeAdvance: 0,
|
|
79
|
+
} as ModeDescriptor,
|
|
80
|
+
FAX: {
|
|
81
|
+
name: 'FAX',
|
|
82
|
+
slotMs: 0,
|
|
83
|
+
toleranceMs: 0,
|
|
84
|
+
windowTiming: [],
|
|
85
|
+
transmitTiming: 0,
|
|
86
|
+
encodeAdvance: 0,
|
|
87
|
+
} as ModeDescriptor,
|
|
74
88
|
} as const;
|
|
75
89
|
|
|
76
90
|
/**
|
|
@@ -109,9 +123,7 @@ export const FT4_WINDOW_PRESETS: Record<string, number[]> = {
|
|
|
109
123
|
lightweight: [0], // 1 轮:仅末端
|
|
110
124
|
};
|
|
111
125
|
|
|
112
|
-
/**
|
|
113
|
-
* 解码窗口设置 Schema
|
|
114
|
-
*/
|
|
126
|
+
/** Per-mode decode-window presets and optional custom timing windows. */
|
|
115
127
|
export const DecodeWindowSettingsSchema = z.object({
|
|
116
128
|
ft8: z.object({
|
|
117
129
|
preset: z.enum(['maximum', 'balanced', 'lightweight', 'minimum', 'custom']).default('balanced'),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const OBSERVABILITY_NOTICE_VERSION = 1;
|
|
4
|
+
|
|
5
|
+
export const ObservabilitySettingsSchema = z.object({
|
|
6
|
+
enabled: z.boolean(),
|
|
7
|
+
noticeVersion: z.number().int().nonnegative(),
|
|
8
|
+
});
|
|
9
|
+
export type ObservabilitySettings = z.infer<typeof ObservabilitySettingsSchema>;
|
|
10
|
+
|
|
11
|
+
export const UpdateObservabilitySettingsSchema = z.object({
|
|
12
|
+
enabled: z.boolean(),
|
|
13
|
+
noticeVersion: z.literal(OBSERVABILITY_NOTICE_VERSION),
|
|
14
|
+
});
|
|
15
|
+
export type UpdateObservabilitySettingsRequest = z.infer<typeof UpdateObservabilitySettingsSchema>;
|
|
16
|
+
|
|
17
|
+
export const ObservabilityStatusSchema = z.object({
|
|
18
|
+
settings: ObservabilitySettingsSchema,
|
|
19
|
+
effectiveEnabled: z.boolean(),
|
|
20
|
+
noticeRequired: z.boolean(),
|
|
21
|
+
endpointConfigured: z.boolean(),
|
|
22
|
+
queueDepth: z.number().int().nonnegative(),
|
|
23
|
+
lastSentAt: z.number().int().nonnegative().nullable(),
|
|
24
|
+
lastError: z.string().nullable(),
|
|
25
|
+
});
|
|
26
|
+
export type ObservabilityStatus = z.infer<typeof ObservabilityStatusSchema>;
|