@skyvexsoftware/stratos-sdk 0.13.0 → 0.14.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/helpers/aircraft.d.ts +6 -0
- package/dist/helpers/aircraft.js +3 -3
- package/dist/helpers/units.d.ts +9 -0
- package/dist/helpers/units.js +5 -0
- package/dist/hooks/context.d.ts +1 -1
- package/dist/hooks/useFlightEvents.d.ts +1 -1
- package/dist/hooks/useLandingAnalysis.d.ts +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +2 -1
- package/dist/shared-types/additional-fields.d.ts +5 -0
- package/dist/shared-types/additional-fields.js +5 -0
- package/dist/shared-types/flight-events.d.ts +55 -0
- package/dist/shared-types/flight-events.js +15 -0
- package/dist/shared-types/flight-manager.d.ts +12 -0
- package/dist/shared-types/flight-manager.js +7 -0
- package/dist/shared-types/index.d.ts +5 -2
- package/dist/shared-types/index.js +2 -1
- package/dist/shared-types/landing.d.ts +149 -0
- package/dist/shared-types/landing.js +5 -0
- package/dist/shared-types/plugin-dialogs.d.ts +7 -0
- package/dist/shared-types/plugin-dialogs.js +2 -5
- package/dist/shared-types/simulator.d.ts +2 -194
- package/dist/shared-types/simulator.js +2 -13
- package/dist/shared-types/socket-events.d.ts +5 -0
- package/dist/shared-types/socket-events.js +2 -28
- package/dist/shared-types/theme.d.ts +6 -1
- package/dist/shared-types/theme.js +5 -0
- package/dist/types/context-ui.d.ts +101 -0
- package/dist/types/context-ui.js +5 -0
- package/dist/types/context.d.ts +35 -173
- package/dist/types/context.js +4 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/manifest.d.ts +5 -3
- package/dist/types/manifest.js +3 -1
- package/dist/types/module.d.ts +4 -2
- package/dist/types/module.js +3 -1
- package/dist/types/settings.d.ts +81 -0
- package/dist/types/settings.js +6 -0
- package/dist/ui/badge.d.ts +2 -0
- package/dist/ui/button.d.ts +6 -0
- package/dist/ui/button.js +5 -0
- package/dist/ui/combobox.d.ts +3 -0
- package/dist/ui/combobox.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @page Simulator Data
|
|
3
|
+
* Standardized flight data, phase detection, and trend types shared across all simulators.
|
|
3
4
|
*
|
|
4
5
|
* These are the canonical definitions of flight data structures.
|
|
5
6
|
* Comprehensive flight data variables for VA platform compatibility.
|
|
@@ -33,15 +34,3 @@ export var FlightPhase;
|
|
|
33
34
|
FlightPhase["ARRIVED"] = "arrived";
|
|
34
35
|
FlightPhase["DEBOARDING"] = "deboarding";
|
|
35
36
|
})(FlightPhase || (FlightPhase = {}));
|
|
36
|
-
// ── Flight Event Types ─────────────────────────────────────────────────
|
|
37
|
-
/** Event categories for filtering/display */
|
|
38
|
-
export var EventCategory;
|
|
39
|
-
(function (EventCategory) {
|
|
40
|
-
EventCategory["SYSTEM"] = "system";
|
|
41
|
-
EventCategory["PHASE"] = "phase";
|
|
42
|
-
EventCategory["CONTROLS"] = "controls";
|
|
43
|
-
EventCategory["ENGINE"] = "engine";
|
|
44
|
-
EventCategory["WARNING"] = "warning";
|
|
45
|
-
EventCategory["POSITION"] = "position";
|
|
46
|
-
EventCategory["COMMENT"] = "comment";
|
|
47
|
-
})(EventCategory || (EventCategory = {}));
|
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Socket
|
|
2
|
+
* @page Socket Events
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* used across the Stratos platform. Both the shell (emitter) and SDK hooks
|
|
6
|
-
* (consumers) import from here so payloads are always in sync.
|
|
7
|
-
*
|
|
8
|
-
* ┌──────────────────────┬──────────────────────────────────────────────┐
|
|
9
|
-
* │ Event │ Payload Type │
|
|
10
|
-
* ├──────────────────────┼──────────────────────────────────────────────┤
|
|
11
|
-
* │ simulator:data │ SimulatorDataPayload │
|
|
12
|
-
* │ simulator:status │ SimulatorStatusPayload │
|
|
13
|
-
* │ flight:phase │ FlightPhasePayload │
|
|
14
|
-
* │ flight:event │ FlightEventPayload │
|
|
15
|
-
* │ flight:landing │ FlightLandingPayload │
|
|
16
|
-
* │ flight:manager │ FlightManagerPayload │
|
|
17
|
-
* │ flight:state │ (reserved for future use) │
|
|
18
|
-
* │ protocol-url │ ProtocolUrlPayload │
|
|
19
|
-
* │ notification │ NotificationPayload │
|
|
20
|
-
* │ system:metrics │ SystemMetricsPayload │
|
|
21
|
-
* │ window:focus │ {} │
|
|
22
|
-
* │ window:blur │ {} │
|
|
23
|
-
* │ window:maximize │ {} │
|
|
24
|
-
* │ window:unmaximize │ {} │
|
|
25
|
-
* │ plugin:loaded │ (plugin-defined) │
|
|
26
|
-
* │ plugin:unloaded │ (plugin-defined) │
|
|
27
|
-
* │ plugin:event │ (plugin-defined) │
|
|
28
|
-
* └──────────────────────┴──────────────────────────────────────────────┘
|
|
29
|
-
*
|
|
30
|
-
* All flight-related events include a `timestamp` field (epoch ms).
|
|
4
|
+
* The Socket.io event catalog and the payload shapes pushed over it.
|
|
31
5
|
*/
|
|
32
6
|
// ── Event Names ──────────────────────────────────────────────────────────
|
|
33
7
|
/** Canonical Socket.io event names shared by shell and SDK. */
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @page UI Context
|
|
3
|
+
* The context the shell injects into a plugin's React tree via PluginShellProvider.
|
|
4
|
+
*/
|
|
5
|
+
import type { AxiosInstance } from "axios";
|
|
6
|
+
import type { PluginLogger } from "./context";
|
|
7
|
+
/** Pilot user profile provided by the shell's auth system */
|
|
8
|
+
export type PluginPilotUser = {
|
|
9
|
+
dbID: number;
|
|
10
|
+
pilotID: string;
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
email: string;
|
|
14
|
+
rank: string;
|
|
15
|
+
rankLevel: number;
|
|
16
|
+
rankImage: string;
|
|
17
|
+
avatar: string;
|
|
18
|
+
};
|
|
19
|
+
/** Navigation helper for plugin UI components */
|
|
20
|
+
export type PluginNavigationHelper = {
|
|
21
|
+
/** Navigate to a route within this plugin */
|
|
22
|
+
navigateTo(path: string): void;
|
|
23
|
+
/** Navigate to a route in another plugin */
|
|
24
|
+
navigateToPlugin(pluginId: string, path: string): void;
|
|
25
|
+
/** Navigate to a shell route */
|
|
26
|
+
navigateToShell(path: string): void;
|
|
27
|
+
/** Get the current route path */
|
|
28
|
+
getCurrentPath(): string;
|
|
29
|
+
};
|
|
30
|
+
/** Toast/notification API for plugin UI */
|
|
31
|
+
export type PluginToastAPI = {
|
|
32
|
+
success(message: string): void;
|
|
33
|
+
error(message: string): void;
|
|
34
|
+
info(message: string): void;
|
|
35
|
+
warning(message: string): void;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* UI context available to plugin renderer components via React context.
|
|
39
|
+
* Provides shared hooks and utilities from the shell.
|
|
40
|
+
*/
|
|
41
|
+
export type PluginUIContext = {
|
|
42
|
+
/**
|
|
43
|
+
* Shared axios instance for the bound airline's API, with auto-refresh on
|
|
44
|
+
* 401. Provided by the shell so all plugin UIs and the shell itself share
|
|
45
|
+
* one in-flight refresh promise — concurrent 401s coalesce to a single
|
|
46
|
+
* `POST /api/auth/va/refresh`. Reach this through `useVaApi()`.
|
|
47
|
+
*/
|
|
48
|
+
vaApi: AxiosInstance;
|
|
49
|
+
/** The plugin's unique ID */
|
|
50
|
+
pluginId: string;
|
|
51
|
+
/** Auth state from the shell */
|
|
52
|
+
auth: {
|
|
53
|
+
isAuthenticated: boolean;
|
|
54
|
+
token: string | null;
|
|
55
|
+
user: PluginPilotUser | null;
|
|
56
|
+
};
|
|
57
|
+
/** Current airline info (from Stratos API). Bundled with the VA bearer
|
|
58
|
+
* so plugins can call the airline backend directly. */
|
|
59
|
+
airline?: {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
icao: string;
|
|
63
|
+
logo_light: string;
|
|
64
|
+
logo_dark: string;
|
|
65
|
+
/** Origin of the VA's API (no trailing slash). */
|
|
66
|
+
base_url: string;
|
|
67
|
+
/** Bearer for this airline's API. Null if the VA session has expired. */
|
|
68
|
+
token: string | null;
|
|
69
|
+
} | null;
|
|
70
|
+
/** Config access hooks */
|
|
71
|
+
config: {
|
|
72
|
+
get<T>(key: string): T | undefined;
|
|
73
|
+
get<T>(key: string, defaultValue: T): T;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Real-time bridge between this plugin's background and UI modules.
|
|
77
|
+
*
|
|
78
|
+
* - `on(event, handler)` subscribes to broadcasts the background made via
|
|
79
|
+
* `ctx.ipc.send(event, payload)`. The shell scopes the channel to the
|
|
80
|
+
* current plugin id automatically — pass the leaf event name on both
|
|
81
|
+
* ends. Plugin A's UI cannot receive plugin B's broadcasts.
|
|
82
|
+
* - `off(event, handler)` removes a previously registered handler.
|
|
83
|
+
* - `emit` is intentionally not implemented. Send UI→background traffic
|
|
84
|
+
* through HTTP routes registered via `ctx.server.registerRouter`.
|
|
85
|
+
* - `connected` is always `true` in the renderer; the underlying Electron
|
|
86
|
+
* IPC pipe has no connection lifecycle.
|
|
87
|
+
*/
|
|
88
|
+
socket: {
|
|
89
|
+
connected: boolean;
|
|
90
|
+
emit(event: string, data: unknown): void;
|
|
91
|
+
on(event: string, handler: (data: unknown) => void): void;
|
|
92
|
+
off(event: string, handler: (data: unknown) => void): void;
|
|
93
|
+
};
|
|
94
|
+
/** Navigation utilities */
|
|
95
|
+
navigation: PluginNavigationHelper;
|
|
96
|
+
/** Toast/notification API */
|
|
97
|
+
toast: PluginToastAPI;
|
|
98
|
+
/** Scoped logger for renderer-side logging */
|
|
99
|
+
logger: PluginLogger;
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=context-ui.d.ts.map
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,86 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @page Background Context
|
|
3
|
+
* The context object the shell passes to a plugin's background module — ctx — and its accessors.
|
|
3
4
|
*
|
|
4
|
-
* Defines the context objects the shell provides to plugins
|
|
5
|
-
*
|
|
5
|
+
* Defines the context objects the shell provides to background plugins
|
|
6
|
+
* (main process). For the renderer-facing surface see context-ui.ts.
|
|
6
7
|
*/
|
|
7
8
|
import type { AxiosInstance } from "axios";
|
|
8
|
-
import type {
|
|
9
|
+
import type { FlightPhasePayload, FlightPhaseSnapshot, SimDataSnapshot } from "../shared-types/simulator";
|
|
10
|
+
import type { EventCategory, FlightLogEvent } from "../shared-types/flight-events";
|
|
11
|
+
import type { FlightLandingPayload, LandingAnalysisSnapshot } from "../shared-types/landing";
|
|
9
12
|
import type { FlightManagerPayload, FlightPlan } from "../shared-types/flight-manager";
|
|
10
|
-
/** All supported setting control types */
|
|
11
|
-
export type PluginSettingType = "boolean" | "text" | "longtext" | "number" | "range" | "list" | "radio" | "date" | "json";
|
|
12
|
-
/** Option entry for list and radio settings */
|
|
13
|
-
export type PluginSettingOption = {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
/** Base fields shared by all setting definitions */
|
|
18
|
-
type PluginSettingBase = {
|
|
19
|
-
key: string;
|
|
20
|
-
name: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
scope: "user" | "airline";
|
|
23
|
-
};
|
|
24
|
-
/** Boolean setting — rendered as a Switch */
|
|
25
|
-
export type BooleanSettingDef = PluginSettingBase & {
|
|
26
|
-
type: "boolean";
|
|
27
|
-
default?: boolean;
|
|
28
|
-
};
|
|
29
|
-
/** Text setting — rendered as an Input */
|
|
30
|
-
export type TextSettingDef = PluginSettingBase & {
|
|
31
|
-
type: "text";
|
|
32
|
-
default?: string;
|
|
33
|
-
pattern?: string;
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
};
|
|
36
|
-
/** Long text setting — rendered as a Textarea */
|
|
37
|
-
export type LongtextSettingDef = PluginSettingBase & {
|
|
38
|
-
type: "longtext";
|
|
39
|
-
default?: string;
|
|
40
|
-
placeholder?: string;
|
|
41
|
-
};
|
|
42
|
-
/** Number setting — rendered as a Number Input */
|
|
43
|
-
export type NumberSettingDef = PluginSettingBase & {
|
|
44
|
-
type: "number";
|
|
45
|
-
default?: number;
|
|
46
|
-
min?: number;
|
|
47
|
-
max?: number;
|
|
48
|
-
step?: number;
|
|
49
|
-
};
|
|
50
|
-
/** Range setting — rendered as a Slider + value label */
|
|
51
|
-
export type RangeSettingDef = PluginSettingBase & {
|
|
52
|
-
type: "range";
|
|
53
|
-
default?: number;
|
|
54
|
-
min: number;
|
|
55
|
-
max: number;
|
|
56
|
-
step?: number;
|
|
57
|
-
};
|
|
58
|
-
/** List setting — rendered as a Select dropdown */
|
|
59
|
-
export type ListSettingDef = PluginSettingBase & {
|
|
60
|
-
type: "list";
|
|
61
|
-
default?: string;
|
|
62
|
-
options: PluginSettingOption[];
|
|
63
|
-
};
|
|
64
|
-
/** Radio setting — rendered as a Radio group */
|
|
65
|
-
export type RadioSettingDef = PluginSettingBase & {
|
|
66
|
-
type: "radio";
|
|
67
|
-
default?: string;
|
|
68
|
-
options: PluginSettingOption[];
|
|
69
|
-
};
|
|
70
|
-
/** Date setting — rendered as a Date input */
|
|
71
|
-
export type DateSettingDef = PluginSettingBase & {
|
|
72
|
-
type: "date";
|
|
73
|
-
default?: string;
|
|
74
|
-
};
|
|
75
|
-
/** JSON setting — rendered as a monospace Textarea */
|
|
76
|
-
export type JsonSettingDef = PluginSettingBase & {
|
|
77
|
-
type: "json";
|
|
78
|
-
default?: string;
|
|
79
|
-
};
|
|
80
|
-
/** Discriminated union of all setting definitions */
|
|
81
|
-
export type PluginSettingDefinition = BooleanSettingDef | TextSettingDef | LongtextSettingDef | NumberSettingDef | RangeSettingDef | ListSettingDef | RadioSettingDef | DateSettingDef | JsonSettingDef;
|
|
82
|
-
/** Array of available settings declared by a plugin */
|
|
83
|
-
export type PluginAvailableSettings = PluginSettingDefinition[];
|
|
84
13
|
/** Scoped logger provided to background plugins (prefixed with plugin ID) */
|
|
85
14
|
export type PluginLogger = {
|
|
86
15
|
info(category: string, message: string, ...args: unknown[]): void;
|
|
@@ -272,6 +201,32 @@ export type PluginToastInput = {
|
|
|
272
201
|
};
|
|
273
202
|
/** Fixed shell-bundled sound catalogue. No plugin-supplied audio. */
|
|
274
203
|
export type PluginAlertSound = "alert" | "warning" | "error" | "success" | "chime";
|
|
204
|
+
/** Visual style of a plugin's sidebar indicator. */
|
|
205
|
+
export type PluginIndicatorType = "notification" | "warning";
|
|
206
|
+
/** Input for `ctx.plugin.setIndicator`. */
|
|
207
|
+
export type PluginIndicatorInput = {
|
|
208
|
+
/** A passive dot ("notification") or an amber warning triangle ("warning"). */
|
|
209
|
+
type: PluginIndicatorType;
|
|
210
|
+
/** Optional hover text shown on the indicator. When omitted, the indicator has no tooltip. */
|
|
211
|
+
tooltip?: string;
|
|
212
|
+
/**
|
|
213
|
+
* When true, the indicator clears automatically the first time the user
|
|
214
|
+
* opens this plugin. Defaults to false — it otherwise persists until
|
|
215
|
+
* `clearIndicator()` or a shell restart.
|
|
216
|
+
*/
|
|
217
|
+
dismissOnOpen?: boolean;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* A plugin's control over its own presence in the shell. Backs `ctx.plugin`.
|
|
221
|
+
* Today: the sidebar indicator. The `error` style is reserved for the system
|
|
222
|
+
* (a crashed plugin) and always takes precedence over a plugin-set indicator.
|
|
223
|
+
*/
|
|
224
|
+
export type PluginSelfApi = {
|
|
225
|
+
/** Set (or replace) this plugin's sidebar indicator. */
|
|
226
|
+
setIndicator(indicator: PluginIndicatorInput): Promise<void>;
|
|
227
|
+
/** Remove this plugin's sidebar indicator, if any. */
|
|
228
|
+
clearIndicator(): Promise<void>;
|
|
229
|
+
};
|
|
275
230
|
/** Input for `ctx.dialog.alert`. */
|
|
276
231
|
export type PluginDialogAlertInput = {
|
|
277
232
|
title: string;
|
|
@@ -391,100 +346,7 @@ export type PluginContext = {
|
|
|
391
346
|
dialog: PluginDialogApi;
|
|
392
347
|
/** Blocking, awaited input prompts (text/number/select). */
|
|
393
348
|
prompt: PluginPromptApi;
|
|
349
|
+
/** Control this plugin's own shell presence (e.g. the sidebar indicator). */
|
|
350
|
+
plugin: PluginSelfApi;
|
|
394
351
|
};
|
|
395
|
-
/** Pilot user profile provided by the shell's auth system */
|
|
396
|
-
export type PluginPilotUser = {
|
|
397
|
-
dbID: number;
|
|
398
|
-
pilotID: string;
|
|
399
|
-
firstName: string;
|
|
400
|
-
lastName: string;
|
|
401
|
-
email: string;
|
|
402
|
-
rank: string;
|
|
403
|
-
rankLevel: number;
|
|
404
|
-
rankImage: string;
|
|
405
|
-
avatar: string;
|
|
406
|
-
};
|
|
407
|
-
/** Navigation helper for plugin UI components */
|
|
408
|
-
export type PluginNavigationHelper = {
|
|
409
|
-
/** Navigate to a route within this plugin */
|
|
410
|
-
navigateTo(path: string): void;
|
|
411
|
-
/** Navigate to a route in another plugin */
|
|
412
|
-
navigateToPlugin(pluginId: string, path: string): void;
|
|
413
|
-
/** Navigate to a shell route */
|
|
414
|
-
navigateToShell(path: string): void;
|
|
415
|
-
/** Get the current route path */
|
|
416
|
-
getCurrentPath(): string;
|
|
417
|
-
};
|
|
418
|
-
/** Toast/notification API for plugin UI */
|
|
419
|
-
export type PluginToastAPI = {
|
|
420
|
-
success(message: string): void;
|
|
421
|
-
error(message: string): void;
|
|
422
|
-
info(message: string): void;
|
|
423
|
-
warning(message: string): void;
|
|
424
|
-
};
|
|
425
|
-
/**
|
|
426
|
-
* UI context available to plugin renderer components via React context.
|
|
427
|
-
* Provides shared hooks and utilities from the shell.
|
|
428
|
-
*/
|
|
429
|
-
export type PluginUIContext = {
|
|
430
|
-
/**
|
|
431
|
-
* Shared axios instance for the bound airline's API, with auto-refresh on
|
|
432
|
-
* 401. Provided by the shell so all plugin UIs and the shell itself share
|
|
433
|
-
* one in-flight refresh promise — concurrent 401s coalesce to a single
|
|
434
|
-
* `POST /api/auth/va/refresh`. Reach this through `useVaApi()`.
|
|
435
|
-
*/
|
|
436
|
-
vaApi: AxiosInstance;
|
|
437
|
-
/** The plugin's unique ID */
|
|
438
|
-
pluginId: string;
|
|
439
|
-
/** Auth state from the shell */
|
|
440
|
-
auth: {
|
|
441
|
-
isAuthenticated: boolean;
|
|
442
|
-
token: string | null;
|
|
443
|
-
user: PluginPilotUser | null;
|
|
444
|
-
};
|
|
445
|
-
/** Current airline info (from Stratos API). Bundled with the VA bearer
|
|
446
|
-
* so plugins can call the airline backend directly. */
|
|
447
|
-
airline?: {
|
|
448
|
-
id: string;
|
|
449
|
-
name: string;
|
|
450
|
-
icao: string;
|
|
451
|
-
logo_light: string;
|
|
452
|
-
logo_dark: string;
|
|
453
|
-
/** Origin of the VA's API (no trailing slash). */
|
|
454
|
-
base_url: string;
|
|
455
|
-
/** Bearer for this airline's API. Null if the VA session has expired. */
|
|
456
|
-
token: string | null;
|
|
457
|
-
} | null;
|
|
458
|
-
/** Config access hooks */
|
|
459
|
-
config: {
|
|
460
|
-
get<T>(key: string): T | undefined;
|
|
461
|
-
get<T>(key: string, defaultValue: T): T;
|
|
462
|
-
};
|
|
463
|
-
/**
|
|
464
|
-
* Real-time bridge between this plugin's background and UI modules.
|
|
465
|
-
*
|
|
466
|
-
* - `on(event, handler)` subscribes to broadcasts the background made via
|
|
467
|
-
* `ctx.ipc.send(event, payload)`. The shell scopes the channel to the
|
|
468
|
-
* current plugin id automatically — pass the leaf event name on both
|
|
469
|
-
* ends. Plugin A's UI cannot receive plugin B's broadcasts.
|
|
470
|
-
* - `off(event, handler)` removes a previously registered handler.
|
|
471
|
-
* - `emit` is intentionally not implemented. Send UI→background traffic
|
|
472
|
-
* through HTTP routes registered via `ctx.server.registerRouter`.
|
|
473
|
-
* - `connected` is always `true` in the renderer; the underlying Electron
|
|
474
|
-
* IPC pipe has no connection lifecycle.
|
|
475
|
-
*/
|
|
476
|
-
socket: {
|
|
477
|
-
connected: boolean;
|
|
478
|
-
emit(event: string, data: unknown): void;
|
|
479
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
480
|
-
off(event: string, handler: (data: unknown) => void): void;
|
|
481
|
-
};
|
|
482
|
-
/** Navigation utilities */
|
|
483
|
-
navigation: PluginNavigationHelper;
|
|
484
|
-
/** Toast/notification API */
|
|
485
|
-
toast: PluginToastAPI;
|
|
486
|
-
/** Scoped logger for renderer-side logging */
|
|
487
|
-
logger: PluginLogger;
|
|
488
|
-
};
|
|
489
|
-
export {};
|
|
490
352
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/types/context.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @page Background Context
|
|
3
|
+
* The context object the shell passes to a plugin's background module — ctx — and its accessors.
|
|
3
4
|
*
|
|
4
|
-
* Defines the context objects the shell provides to plugins
|
|
5
|
-
*
|
|
5
|
+
* Defines the context objects the shell provides to background plugins
|
|
6
|
+
* (main process). For the renderer-facing surface see context-ui.ts.
|
|
6
7
|
*/
|
|
7
8
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { PluginAuthor, PluginManifest } from "./manifest";
|
|
2
|
-
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger,
|
|
2
|
+
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginServerRegistrar, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginNotifier, PluginToastInput, PluginAlertSound, } from "./context";
|
|
3
|
+
export type { PluginNavigationHelper, PluginToastAPI, PluginUIContext, } from "./context-ui";
|
|
3
4
|
export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./module";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/manifest.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin
|
|
2
|
+
* Plugin manifest schema — the contents of every plugin's plugin.json.
|
|
3
3
|
*
|
|
4
4
|
* Defines the structure of a plugin's plugin.json file.
|
|
5
5
|
* Every plugin must include a valid plugin.json at its root.
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
* Background and UI modules are discovered by convention:
|
|
8
8
|
* - background/index.js — background service entry point
|
|
9
9
|
* - ui/index.js — renderer UI entry point
|
|
10
|
+
*
|
|
11
|
+
* @page Manifest
|
|
10
12
|
*/
|
|
11
|
-
import type { PluginSettingDefinition } from "./
|
|
13
|
+
import type { PluginSettingDefinition } from "./settings";
|
|
12
14
|
/** Plugin author information */
|
|
13
15
|
export type PluginAuthor = {
|
|
14
16
|
/** Unique developer slug (e.g. "skyvex-software") */
|
|
15
17
|
id: string;
|
|
16
|
-
/** Display name (e.g. "
|
|
18
|
+
/** Display name (e.g. "Skyvex Software") */
|
|
17
19
|
name: string;
|
|
18
20
|
/** Contact email address (optional) */
|
|
19
21
|
contact?: string;
|
package/dist/types/manifest.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin
|
|
2
|
+
* Plugin manifest schema — the contents of every plugin's plugin.json.
|
|
3
3
|
*
|
|
4
4
|
* Defines the structure of a plugin's plugin.json file.
|
|
5
5
|
* Every plugin must include a valid plugin.json at its root.
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
* Background and UI modules are discovered by convention:
|
|
8
8
|
* - background/index.js — background service entry point
|
|
9
9
|
* - ui/index.js — renderer UI entry point
|
|
10
|
+
*
|
|
11
|
+
* @page Manifest
|
|
10
12
|
*/
|
|
11
13
|
export {};
|
package/dist/types/module.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The background and UI module shapes a plugin's entry points must satisfy.
|
|
3
3
|
*
|
|
4
4
|
* Defines the export shapes for plugin background and UI modules.
|
|
5
|
+
*
|
|
6
|
+
* @page Modules
|
|
5
7
|
*/
|
|
6
8
|
import type { ComponentType, LazyExoticComponent } from "react";
|
|
7
9
|
import type { PluginContext } from "./context";
|
|
@@ -10,7 +12,7 @@ import type { PluginContext } from "./context";
|
|
|
10
12
|
* Each plugin's background entry module must export these functions.
|
|
11
13
|
*/
|
|
12
14
|
export type PluginBackgroundModule = {
|
|
13
|
-
/** Called during shell startup after auth is
|
|
15
|
+
/** Called during shell startup after auth is initialised */
|
|
14
16
|
onStart(ctx: PluginContext): Promise<void>;
|
|
15
17
|
/** Called during shell shutdown for graceful teardown */
|
|
16
18
|
onStop(ctx: PluginContext): Promise<void>;
|
package/dist/types/module.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @page Settings
|
|
3
|
+
*
|
|
4
|
+
* Typed plugin setting definitions — the controls a plugin declares in its manifest's availableSettings.
|
|
5
|
+
*/
|
|
6
|
+
/** All supported setting control types */
|
|
7
|
+
export type PluginSettingType = "boolean" | "text" | "longtext" | "number" | "range" | "list" | "radio" | "date" | "json";
|
|
8
|
+
/** Option entry for list and radio settings */
|
|
9
|
+
export type PluginSettingOption = {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
/** Base fields shared by all setting definitions */
|
|
14
|
+
type PluginSettingBase = {
|
|
15
|
+
key: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
scope: "user" | "airline";
|
|
19
|
+
};
|
|
20
|
+
/** Boolean setting — rendered as a Switch */
|
|
21
|
+
export type BooleanSettingDef = PluginSettingBase & {
|
|
22
|
+
type: "boolean";
|
|
23
|
+
default?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Text setting — rendered as an Input */
|
|
26
|
+
export type TextSettingDef = PluginSettingBase & {
|
|
27
|
+
type: "text";
|
|
28
|
+
default?: string;
|
|
29
|
+
pattern?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
};
|
|
32
|
+
/** Long text setting — rendered as a Textarea */
|
|
33
|
+
export type LongtextSettingDef = PluginSettingBase & {
|
|
34
|
+
type: "longtext";
|
|
35
|
+
default?: string;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Number setting — rendered as a Number Input */
|
|
39
|
+
export type NumberSettingDef = PluginSettingBase & {
|
|
40
|
+
type: "number";
|
|
41
|
+
default?: number;
|
|
42
|
+
min?: number;
|
|
43
|
+
max?: number;
|
|
44
|
+
step?: number;
|
|
45
|
+
};
|
|
46
|
+
/** Range setting — rendered as a Slider + value label */
|
|
47
|
+
export type RangeSettingDef = PluginSettingBase & {
|
|
48
|
+
type: "range";
|
|
49
|
+
default?: number;
|
|
50
|
+
min: number;
|
|
51
|
+
max: number;
|
|
52
|
+
step?: number;
|
|
53
|
+
};
|
|
54
|
+
/** List setting — rendered as a Select dropdown */
|
|
55
|
+
export type ListSettingDef = PluginSettingBase & {
|
|
56
|
+
type: "list";
|
|
57
|
+
default?: string;
|
|
58
|
+
options: PluginSettingOption[];
|
|
59
|
+
};
|
|
60
|
+
/** Radio setting — rendered as a Radio group */
|
|
61
|
+
export type RadioSettingDef = PluginSettingBase & {
|
|
62
|
+
type: "radio";
|
|
63
|
+
default?: string;
|
|
64
|
+
options: PluginSettingOption[];
|
|
65
|
+
};
|
|
66
|
+
/** Date setting — rendered as a Date input */
|
|
67
|
+
export type DateSettingDef = PluginSettingBase & {
|
|
68
|
+
type: "date";
|
|
69
|
+
default?: string;
|
|
70
|
+
};
|
|
71
|
+
/** JSON setting — rendered as a monospace Textarea */
|
|
72
|
+
export type JsonSettingDef = PluginSettingBase & {
|
|
73
|
+
type: "json";
|
|
74
|
+
default?: string;
|
|
75
|
+
};
|
|
76
|
+
/** Discriminated union of all setting definitions */
|
|
77
|
+
export type PluginSettingDefinition = BooleanSettingDef | TextSettingDef | LongtextSettingDef | NumberSettingDef | RangeSettingDef | ListSettingDef | RadioSettingDef | DateSettingDef | JsonSettingDef;
|
|
78
|
+
/** Array of available settings declared by a plugin */
|
|
79
|
+
export type PluginAvailableSettings = PluginSettingDefinition[];
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=settings.d.ts.map
|
package/dist/ui/badge.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/** @page UI Component Props */
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { type VariantProps } from "class-variance-authority";
|
|
3
4
|
declare const badgeVariants: (props?: ({
|
|
4
5
|
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
/** Props for the `Badge` component, extending native div attributes with CVA variants. */
|
|
6
8
|
export type BadgeProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;
|
|
7
9
|
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export { Badge, badgeVariants };
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @page UI Component Props
|
|
3
|
+
*
|
|
4
|
+
* Prop types for the shared SDK UI primitives.
|
|
5
|
+
*/
|
|
1
6
|
import * as React from "react";
|
|
2
7
|
import { type VariantProps } from "class-variance-authority";
|
|
3
8
|
declare const buttonVariants: (props?: ({
|
|
4
9
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "pill-pause" | "pill-resume" | "pill-end" | "pill-submit" | null | undefined;
|
|
5
10
|
size?: "default" | "sm" | "lg" | "icon" | "pill" | null | undefined;
|
|
6
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
/** Props for the `Button` component, extending native button attributes with CVA variants. */
|
|
7
13
|
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
|
|
8
14
|
asChild?: boolean;
|
|
9
15
|
};
|
package/dist/ui/button.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @page UI Component Props
|
|
4
|
+
*
|
|
5
|
+
* Prop types for the shared SDK UI primitives.
|
|
6
|
+
*/
|
|
2
7
|
import * as React from "react";
|
|
3
8
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
9
|
import { cva } from "class-variance-authority";
|
package/dist/ui/combobox.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/** @page UI Component Props */
|
|
2
|
+
/** A single selectable option in the `Combobox` list. */
|
|
1
3
|
export type ComboboxOption = {
|
|
2
4
|
value: string;
|
|
3
5
|
label: string;
|
|
4
6
|
};
|
|
7
|
+
/** Props for the searchable single-select `Combobox` component. */
|
|
5
8
|
export type ComboboxProps = {
|
|
6
9
|
options: ComboboxOption[];
|
|
7
10
|
value?: string;
|
package/dist/ui/combobox.js
CHANGED