@skyvexsoftware/stratos-sdk 0.15.3 → 0.16.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.
@@ -38,6 +38,10 @@ type UseTrackingSessionReturn = {
38
38
  success: boolean;
39
39
  error?: string;
40
40
  }>;
41
+ /** Pilot-reported online network for the current flight ("offline" when none selected). */
42
+ network: string;
43
+ /** Set the pilot-reported online network. Resolves false when no flight is in progress. */
44
+ setNetwork: (network: string) => Promise<boolean>;
41
45
  recoverFlight: () => Promise<boolean>;
42
46
  dismissRecovery: () => Promise<boolean>;
43
47
  isLoading: boolean;
@@ -89,6 +89,12 @@ export function useTrackingSession() {
89
89
  const result = await api("/end", "POST", { status });
90
90
  return { success: result.success, error: result.error };
91
91
  }, []);
92
+ const setNetwork = useCallback(async (network) => {
93
+ const result = await api("/network", "POST", {
94
+ network,
95
+ });
96
+ return result.success;
97
+ }, []);
92
98
  const recoverFlight = useCallback(async () => {
93
99
  const result = await api("/recover", "POST");
94
100
  if (result.success) {
@@ -157,6 +163,8 @@ export function useTrackingSession() {
157
163
  pauseFlight,
158
164
  resumeFlight,
159
165
  endFlight,
166
+ network: flight?.network ?? "offline",
167
+ setNetwork,
160
168
  recoverFlight,
161
169
  dismissRecovery,
162
170
  isLoading,
@@ -64,6 +64,11 @@ export type CurrentFlight = {
64
64
  updatesSent: number;
65
65
  updateIntervalMs: number;
66
66
  comments: FlightComment[];
67
+ /**
68
+ * Pilot-reported online network for this flight (e.g. "vatsim").
69
+ * "offline" by default; resets on every flight start.
70
+ */
71
+ network: string;
67
72
  lastError: string | null;
68
73
  };
69
74
  /** Comment attached to an active flight */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyvexsoftware/stratos-sdk",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "description": "Plugin SDK for Stratos — types, hooks, and UI components",
5
5
  "author": {
6
6
  "name": "Skyvex Software Pty Ltd",