@skyvexsoftware/stratos-sdk 0.1.7 → 0.1.8
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/hooks/useShellAuth.d.ts +2 -6
- package/dist/hooks/useShellAuth.js +1 -5
- package/dist/hooks/useShellConfig.d.ts +1 -6
- package/dist/hooks/useShellConfig.js +1 -6
- package/dist/hooks/useShellNavigation.d.ts +1 -7
- package/dist/hooks/useShellNavigation.js +1 -7
- package/dist/hooks/useShellToast.d.ts +1 -7
- package/dist/hooks/useShellToast.js +1 -7
- package/dist/index.d.ts +1 -1
- package/dist/types/context.d.ts +14 -2
- package/package.json +9 -8
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Access the shell's auth state from a plugin component.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* const { isAuthenticated, token, user } = useShellAuth();
|
|
7
|
-
* ```
|
|
3
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
8
4
|
*/
|
|
9
5
|
export declare function useShellAuth(): {
|
|
10
6
|
isAuthenticated: boolean;
|
|
11
7
|
token: string | null;
|
|
12
|
-
user:
|
|
8
|
+
user: import("..").PluginPilotUser | null;
|
|
13
9
|
};
|
|
14
10
|
//# sourceMappingURL=useShellAuth.d.ts.map
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { usePluginContext } from "./context";
|
|
2
2
|
/**
|
|
3
3
|
* Access the shell's auth state from a plugin component.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* const { isAuthenticated, token, user } = useShellAuth();
|
|
8
|
-
* ```
|
|
4
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
9
5
|
*/
|
|
10
6
|
export function useShellAuth() {
|
|
11
7
|
return usePluginContext().auth;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Access the shell's config store from a plugin component.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* const config = useShellConfig();
|
|
7
|
-
* const value = config.get<string>("myKey", "default");
|
|
8
|
-
* ```
|
|
3
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
9
4
|
*/
|
|
10
5
|
export declare function useShellConfig(): {
|
|
11
6
|
get<T>(key: string): T | undefined;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { usePluginContext } from "./context";
|
|
2
2
|
/**
|
|
3
3
|
* Access the shell's config store from a plugin component.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* const config = useShellConfig();
|
|
8
|
-
* const value = config.get<string>("myKey", "default");
|
|
9
|
-
* ```
|
|
4
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
10
5
|
*/
|
|
11
6
|
export function useShellConfig() {
|
|
12
7
|
return usePluginContext().config;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Access the shell's navigation helpers from a plugin component.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* const nav = useShellNavigation();
|
|
7
|
-
* nav.navigateTo("settings");
|
|
8
|
-
* nav.navigateToPlugin("flight-tracking", "history");
|
|
9
|
-
* ```
|
|
3
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
10
4
|
*/
|
|
11
5
|
export declare function useShellNavigation(): import("..").PluginNavigationHelper;
|
|
12
6
|
//# sourceMappingURL=useShellNavigation.d.ts.map
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { usePluginContext } from "./context";
|
|
2
2
|
/**
|
|
3
3
|
* Access the shell's navigation helpers from a plugin component.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* const nav = useShellNavigation();
|
|
8
|
-
* nav.navigateTo("settings");
|
|
9
|
-
* nav.navigateToPlugin("flight-tracking", "history");
|
|
10
|
-
* ```
|
|
4
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
11
5
|
*/
|
|
12
6
|
export function useShellNavigation() {
|
|
13
7
|
return usePluginContext().navigation;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Access the shell's toast/notification API from a plugin component.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```tsx
|
|
6
|
-
* const toast = useShellToast();
|
|
7
|
-
* toast.success("Flight saved!");
|
|
8
|
-
* toast.error("Connection lost");
|
|
9
|
-
* ```
|
|
3
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
10
4
|
*/
|
|
11
5
|
export declare function useShellToast(): import("..").PluginToastAPI;
|
|
12
6
|
//# sourceMappingURL=useShellToast.d.ts.map
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { usePluginContext } from "./context";
|
|
2
2
|
/**
|
|
3
3
|
* Access the shell's toast/notification API from a plugin component.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* const toast = useShellToast();
|
|
8
|
-
* toast.success("Flight saved!");
|
|
9
|
-
* toast.error("Connection lost");
|
|
10
|
-
* ```
|
|
4
|
+
* Must be used within a PluginShellProvider (provided by the shell).
|
|
11
5
|
*/
|
|
12
6
|
export function useShellToast() {
|
|
13
7
|
return usePluginContext().toast;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { PluginAuthor, PluginManifest } from "./types/manifest";
|
|
2
|
-
export type { PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginServerRegistrar, PluginToastAPI, PluginUIContext, PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/context";
|
|
2
|
+
export type { PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginPilotUser, PluginServerRegistrar, PluginToastAPI, PluginUIContext, PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/context";
|
|
3
3
|
export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./types/module";
|
|
4
4
|
export { FlightPhase, SimulatorType, EventCategory, } from "./shared-types/simulator";
|
|
5
5
|
export type { BounceData, CapturePoint, FlightData, FlightDataSnapshot, FlightEventPayload, FlightEventsSnapshot, FlightLandingPayload, FlightLogEvent, FlightPhasePayload, FlightPhaseSnapshot, FlightStateDebugInfo, FlightTrends, HistoryReportEntry, LandingAnalysis, LandingAnalysisSnapshot, LandingAnalyzerDebugState, LandingSample, PendingPhaseTransition, SimDataSnapshot, SimulatorStatus, } from "./shared-types/simulator";
|
package/dist/types/context.d.ts
CHANGED
|
@@ -144,6 +144,18 @@ export type PluginContext = {
|
|
|
144
144
|
/** SQLite database accessor (files stored in plugin's data directory) */
|
|
145
145
|
database: PluginDatabaseAccessor;
|
|
146
146
|
};
|
|
147
|
+
/** Pilot user profile provided by the shell's auth system */
|
|
148
|
+
export type PluginPilotUser = {
|
|
149
|
+
dbID: number;
|
|
150
|
+
pilotID: string;
|
|
151
|
+
firstName: string;
|
|
152
|
+
lastName: string;
|
|
153
|
+
email: string;
|
|
154
|
+
rank: string;
|
|
155
|
+
rankLevel: number;
|
|
156
|
+
rankImage: string;
|
|
157
|
+
avatar: string;
|
|
158
|
+
};
|
|
147
159
|
/** Navigation helper for plugin UI components */
|
|
148
160
|
export type PluginNavigationHelper = {
|
|
149
161
|
/** Navigate to a route within this plugin */
|
|
@@ -169,11 +181,11 @@ export type PluginToastAPI = {
|
|
|
169
181
|
export type PluginUIContext = {
|
|
170
182
|
/** The plugin's unique ID */
|
|
171
183
|
pluginId: string;
|
|
172
|
-
/** Auth
|
|
184
|
+
/** Auth state from the shell */
|
|
173
185
|
auth: {
|
|
174
186
|
isAuthenticated: boolean;
|
|
175
187
|
token: string | null;
|
|
176
|
-
user:
|
|
188
|
+
user: PluginPilotUser | null;
|
|
177
189
|
};
|
|
178
190
|
/** Current airline info (from Stratos API) */
|
|
179
191
|
airline?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyvexsoftware/stratos-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Plugin SDK for Stratos — types, hooks, and UI components",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Skyvex Software",
|
|
@@ -52,6 +52,13 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsc -b",
|
|
57
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
58
|
+
"tsc": "tsc --noEmit",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"prepublishOnly": "tsc -b"
|
|
61
|
+
},
|
|
55
62
|
"peerDependencies": {
|
|
56
63
|
"@radix-ui/react-alert-dialog": "^1.1.0",
|
|
57
64
|
"@radix-ui/react-dialog": "^1.1.0",
|
|
@@ -95,11 +102,5 @@
|
|
|
95
102
|
"socket.io-client": "^4.8.3",
|
|
96
103
|
"typescript": "^5.8.3",
|
|
97
104
|
"vite": "^7.3.1"
|
|
98
|
-
},
|
|
99
|
-
"scripts": {
|
|
100
|
-
"build": "tsc -b",
|
|
101
|
-
"lint": "eslint src --ext .ts,.tsx",
|
|
102
|
-
"tsc": "tsc --noEmit",
|
|
103
|
-
"typecheck": "tsc --noEmit"
|
|
104
105
|
}
|
|
105
|
-
}
|
|
106
|
+
}
|