@skyvexsoftware/stratos-sdk 0.7.6 → 0.7.7
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 +1 -1
- package/dist/types/context.d.ts +30 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
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, PluginPilotUser, PluginServerRegistrar, PluginToastAPI, PluginUIContext, PluginSettingType, PluginSettingOption, PluginSettingDefinition, PluginAvailableSettings, BooleanSettingDef, TextSettingDef, LongtextSettingDef, NumberSettingDef, RangeSettingDef, ListSettingDef, RadioSettingDef, DateSettingDef, JsonSettingDef, } from "./types/context";
|
|
2
|
+
export type { PluginAirline, PluginAirlineAccessor, 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
|
@@ -112,6 +112,28 @@ export type PluginAuthAccessor = {
|
|
|
112
112
|
/** Check if the user is currently authenticated */
|
|
113
113
|
isAuthenticated(): Promise<boolean>;
|
|
114
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* Airline binding exposed to plugin backgrounds — id, base URL, and the
|
|
117
|
+
* pilot's bearer for that VA. Plugins use these together to call the
|
|
118
|
+
* airline's backend directly:
|
|
119
|
+
*
|
|
120
|
+
* fetch(`${airline.baseUrl}/api/stratos/...`, {
|
|
121
|
+
* headers: { Authorization: `Bearer ${airline.token}` },
|
|
122
|
+
* });
|
|
123
|
+
*/
|
|
124
|
+
export type PluginAirline = {
|
|
125
|
+
/** Airline ID as Stratos knows it */
|
|
126
|
+
id: string;
|
|
127
|
+
/** Origin of the VA's API (no trailing slash) */
|
|
128
|
+
baseUrl: string;
|
|
129
|
+
/** Bearer for this airline's API. Null if the VA session has expired. */
|
|
130
|
+
token: string | null;
|
|
131
|
+
};
|
|
132
|
+
/** Read-only accessor for the currently-bound airline. */
|
|
133
|
+
export type PluginAirlineAccessor = {
|
|
134
|
+
/** Returns the current airline, or null if no VA session is active. */
|
|
135
|
+
getCurrent(): Promise<PluginAirline | null>;
|
|
136
|
+
};
|
|
115
137
|
/** Express route registration helper for background plugins */
|
|
116
138
|
export type PluginServerRegistrar = {
|
|
117
139
|
/** Register an Express router at the given path prefix (e.g. '/api/booking') */
|
|
@@ -139,6 +161,8 @@ export type PluginContext = {
|
|
|
139
161
|
ipc: PluginIPCRegistrar;
|
|
140
162
|
/** Read-only auth token accessor */
|
|
141
163
|
auth: PluginAuthAccessor;
|
|
164
|
+
/** Read-only accessor for the bound airline (id, base URL, VA bearer) */
|
|
165
|
+
airline: PluginAirlineAccessor;
|
|
142
166
|
/** Express server route registrar */
|
|
143
167
|
server: PluginServerRegistrar;
|
|
144
168
|
/** SQLite database accessor (files stored in plugin's data directory) */
|
|
@@ -187,13 +211,18 @@ export type PluginUIContext = {
|
|
|
187
211
|
token: string | null;
|
|
188
212
|
user: PluginPilotUser | null;
|
|
189
213
|
};
|
|
190
|
-
/** Current airline info (from Stratos API)
|
|
214
|
+
/** Current airline info (from Stratos API). Bundled with the VA bearer
|
|
215
|
+
* so plugins can call the airline backend directly. */
|
|
191
216
|
airline?: {
|
|
192
217
|
id: string;
|
|
193
218
|
name: string;
|
|
194
219
|
icao: string;
|
|
195
220
|
logo_light: string;
|
|
196
221
|
logo_dark: string;
|
|
222
|
+
/** Origin of the VA's API (no trailing slash). */
|
|
223
|
+
base_url: string;
|
|
224
|
+
/** Bearer for this airline's API. Null if the VA session has expired. */
|
|
225
|
+
token: string | null;
|
|
197
226
|
} | null;
|
|
198
227
|
/** Config access hooks */
|
|
199
228
|
config: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { PluginAuthor, PluginManifest } from "./manifest";
|
|
2
|
-
export type { PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginServerRegistrar, PluginToastAPI, PluginUIContext, } from "./context";
|
|
2
|
+
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginNavigationHelper, PluginServerRegistrar, PluginToastAPI, PluginUIContext, } from "./context";
|
|
3
3
|
export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./module";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|