@skypath-io/web-sdk 0.4.7 → 0.4.13

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +285 -0
  2. package/LICENSE.txt +7 -0
  3. package/README.md +4 -4
  4. package/dist/bundle.cjs.js +6 -0
  5. package/dist/bundle.es.js +6 -0
  6. package/dist/bundle.iife.js +6 -0
  7. package/dist/types/src/core/auth/auth.d.ts +27 -0
  8. package/dist/types/src/core/auth/consts.d.ts +30 -0
  9. package/dist/types/src/core/auth/index.d.ts +1 -0
  10. package/dist/types/src/core/auth/utils.d.ts +3 -0
  11. package/dist/types/src/core/emitter/emitter.d.ts +8 -0
  12. package/dist/types/src/core/emitter/index.d.ts +1 -0
  13. package/dist/types/src/core/flow/consts.d.ts +18 -0
  14. package/dist/types/src/core/flow/flow.d.ts +11 -0
  15. package/dist/types/src/core/flow/index.d.ts +1 -0
  16. package/dist/types/src/core/geo/geo.d.ts +213 -0
  17. package/dist/types/src/core/geo/index.d.ts +1 -0
  18. package/dist/types/src/core/index.d.ts +2 -0
  19. package/dist/types/src/core/monitoring/consts.d.ts +9 -0
  20. package/dist/types/src/core/monitoring/datadog.d.ts +10 -0
  21. package/dist/types/src/core/monitoring/errors.d.ts +29 -0
  22. package/dist/types/src/core/utils/index.d.ts +1 -0
  23. package/dist/types/src/core/utils/utils.d.ts +71 -0
  24. package/dist/types/src/features/adsb/consts.d.ts +26 -0
  25. package/dist/types/src/features/adsb/flow.d.ts +17 -0
  26. package/dist/types/src/features/adsb/index.d.ts +2 -0
  27. package/dist/types/src/features/adsb/service.d.ts +12 -0
  28. package/dist/types/src/features/adsb/utils.d.ts +14 -0
  29. package/dist/types/src/features/aircraft/consts.d.ts +3 -0
  30. package/dist/types/src/features/aircraft/index.d.ts +1 -0
  31. package/dist/types/src/features/aircraft/service.d.ts +31 -0
  32. package/dist/types/src/features/cacheToken/consts.d.ts +3 -0
  33. package/dist/types/src/features/cacheToken/index.d.ts +2 -0
  34. package/dist/types/src/features/cacheToken/service.d.ts +11 -0
  35. package/dist/types/src/features/cacheToken/utils.d.ts +10 -0
  36. package/dist/types/src/features/gtg/consts.d.ts +4 -0
  37. package/dist/types/src/features/gtg/index.d.ts +1 -0
  38. package/dist/types/src/features/gtg/service.d.ts +13 -0
  39. package/dist/types/src/features/gtg/utils.d.ts +3 -0
  40. package/dist/types/src/features/nowcasting/consts.d.ts +20 -0
  41. package/dist/types/src/features/nowcasting/flow.d.ts +55 -0
  42. package/dist/types/src/features/nowcasting/index.d.ts +2 -0
  43. package/dist/types/src/features/nowcasting/service.d.ts +13 -0
  44. package/dist/types/src/features/nowcasting/utils.d.ts +82 -0
  45. package/dist/types/src/features/observations/consts.d.ts +73 -0
  46. package/dist/types/src/features/observations/flow.d.ts +18 -0
  47. package/dist/types/src/features/observations/index.d.ts +2 -0
  48. package/dist/types/src/features/observations/service.d.ts +13 -0
  49. package/dist/types/src/features/observations/utils.d.ts +15 -0
  50. package/dist/types/src/features/oneLayer/consts.d.ts +76 -0
  51. package/dist/types/src/features/oneLayer/flow.d.ts +21 -0
  52. package/dist/types/src/features/oneLayer/index.d.ts +2 -0
  53. package/dist/types/src/features/oneLayer/service.d.ts +19 -0
  54. package/dist/types/src/features/oneLayer/utils.d.ts +79 -0
  55. package/dist/types/src/index.d.ts +123 -0
  56. package/dist/types/src/publicApi.d.ts +25 -0
  57. package/package.json +56 -7
  58. package/bundle.cjs.js +0 -6
  59. package/bundle.es.js +0 -6
  60. package/bundle.iife.js +0 -6
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Nowcasting Flow is a class that manages the flow of fetching nowcasting data.
3
+ *
4
+ * @class
5
+ * @param {Object} options
6
+ * @param {Object} options.cacheTokenService - Cache token service instance
7
+ * @param {Object} options.nowcastingService - Nowcasting service instance
8
+ * @example
9
+ * ```javascript
10
+ * const nowcastingFlow = new NowcastingFlow({
11
+ * cacheTokenService,
12
+ * nowcastingService,
13
+ * });
14
+ *
15
+ * nowcastingFlow.onData(console.log);
16
+ *
17
+ * nowcastingFlow.start();
18
+ * nowcastingFlow.updateConfig({ hexIds });
19
+ * nowcastingFlow.stop();
20
+ * nowcastingFlow.terminate();
21
+ * ```
22
+ */
23
+ export class NowcastingFlow {
24
+ constructor({ cacheTokenService, nowcastingService }: {
25
+ cacheTokenService: any;
26
+ nowcastingService: any;
27
+ });
28
+ /**
29
+ * Subscribe to Nowcasting Flow new data
30
+ *
31
+ * @param {Function} listener - Listener function
32
+ */
33
+ onData: (listener: Function) => void;
34
+ updateConfig: (config?: {}) => void;
35
+ onChangeIsPending: (listener: any) => void;
36
+ /**
37
+ * Start the Nowcasting Flow. Initiates the flow of fetching nowcasting data. Setup listeners and execute the flow.
38
+ *
39
+ * @param {Object} options
40
+ * @param {string[]} [options.hexIds] - Hex IDs for initial nowcasting data fetching
41
+ */
42
+ start(): void;
43
+ /**
44
+ * Stop the Nowcasting Flow. Stops the flow of fetching nowcasting data.
45
+ * No resources are cleaned up. Just stops updating the data.
46
+ */
47
+ stop(): void;
48
+ /**
49
+ * Terminate the Nowcasting Flow. Terminates the flow of fetching nowcasting data.
50
+ * Cleans up all the resources and listeners.
51
+ */
52
+ terminate(): void;
53
+ getState: () => string;
54
+ #private;
55
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./flow";
2
+ export * from "./service";
@@ -0,0 +1,13 @@
1
+ export class NowcastingService {
2
+ constructor({ fetcher }: {
3
+ fetcher: any;
4
+ });
5
+ getInfo(): Promise<any>;
6
+ getData({ resolution, hexId, lastUpdatedAt, token }: {
7
+ resolution: any;
8
+ hexId: any;
9
+ lastUpdatedAt: any;
10
+ token: any;
11
+ }): Promise<any>;
12
+ #private;
13
+ }
@@ -0,0 +1,82 @@
1
+ export type NowcastingItem = {
2
+ /**
3
+ * - Altitude level.
4
+ */
5
+ alt: number;
6
+ /**
7
+ * - Severity level.
8
+ */
9
+ sev: number;
10
+ /**
11
+ * - Forecast accuracy.
12
+ */
13
+ forecast: number;
14
+ /**
15
+ * - Array of hexagonal identifiers.
16
+ */
17
+ hexIds: Array<number>;
18
+ };
19
+ export type NowcastingData = Record<string, Array<NowcastingItem>>;
20
+ /**
21
+ * Filters for slicing nowcasting data.
22
+ */
23
+ export type FilterCriteria = {
24
+ /**
25
+ * - Forecast filter.
26
+ */
27
+ forecast: number;
28
+ /**
29
+ * - Severity filter.
30
+ */
31
+ severity: number;
32
+ /**
33
+ * - Altitude filter.
34
+ */
35
+ altitude: number;
36
+ };
37
+ /**
38
+ * @typedef {Object} NowcastingItem
39
+ * @property {number} alt - Altitude level.
40
+ * @property {number} sev - Severity level.
41
+ * @property {number} forecast - Forecast accuracy.
42
+ * @property {Array<number>} hexIds - Array of hexagonal identifiers.
43
+ */
44
+ /**
45
+ * @typedef {Record<string, Array<NowcastingItem>>} NowcastingData
46
+ */
47
+ /**
48
+ * Filters for slicing nowcasting data.
49
+ * @typedef {Object} FilterCriteria
50
+ * @property {number} forecast - Forecast filter.
51
+ * @property {number} severity - Severity filter.
52
+ * @property {number} altitude - Altitude filter.
53
+ */
54
+ /**
55
+ * Get a slice of the nowcasting data based on the filters.
56
+ *
57
+ * @param {Object} props - The props object containing data and filters.
58
+ * @param {NowcastingData} props.data - The nowcasting data to slice.
59
+ * @param {FilterCriteria} props.filters - The filters to apply.
60
+ * @returns {NowcastingData} - The sliced/filtered nowcasting data.
61
+ */
62
+ export function getNowcastingDataSlice({ data, filters }: {
63
+ data: NowcastingData;
64
+ filters: FilterCriteria;
65
+ }): NowcastingData;
66
+ /**
67
+ * Prepare the nowcasting data for the map hexagons.
68
+ *
69
+ * @param {Object} props - The props object containing data and resolution.
70
+ * @param {NowcastingData} props.data - The nowcasting data to prepare.
71
+ * @param {number} props.resolution - The resolution of the map display.
72
+ * @returns {Array<{alt: number, sev: number, forecast: number, hexId: string}>} - Nowcasting data prepared for the map hexagons.
73
+ */
74
+ export function prepareNowcastingDataForMapHexagons({ data, resolution, }: {
75
+ data: NowcastingData;
76
+ resolution: number;
77
+ }): Array<{
78
+ alt: number;
79
+ sev: number;
80
+ forecast: number;
81
+ hexId: string;
82
+ }>;
@@ -0,0 +1,73 @@
1
+ export namespace PATHS {
2
+ let DATA: string;
3
+ }
4
+ export namespace DEFAULT_FILTER_VALUES {
5
+ let HOURS_AGO: number;
6
+ let SEVERITY: number;
7
+ let ALT_FROM: number;
8
+ let ALT_TO: number;
9
+ }
10
+ export const SIZE_TO_RESOLUTION_MAP: {
11
+ [x: string]: number;
12
+ };
13
+ export const SIZE_TO_MIN_SEVERITY_MAP: {
14
+ [x: string]: number;
15
+ };
16
+ export const SIZE_TO_EXTENSION_FACTOR_MAP: {
17
+ [x: string]: number;
18
+ };
19
+ export const DEBOUNCE_TIME_SEC: number;
20
+ export const REFRESH_TIME_SEC: number;
21
+ export namespace CONFIG_KEYS {
22
+ let POLYGON: string;
23
+ let IS_CORRIDOR_MODE: string;
24
+ let AIRCRAFT_CATEGORY: string;
25
+ }
26
+ export namespace AIRCRAFT_CATEGORY {
27
+ let C10: string;
28
+ let C20: string;
29
+ let C30: string;
30
+ let C40: string;
31
+ let C50: string;
32
+ let C60: string;
33
+ let C70: string;
34
+ let C80: string;
35
+ let C90: string;
36
+ let C100: string;
37
+ let C110: string;
38
+ }
39
+ export namespace HISTORY_HOURS {
40
+ let halfAnHour: string;
41
+ let oneHour: string;
42
+ let twoHours: string;
43
+ let threeHours: string;
44
+ let fourHours: string;
45
+ }
46
+ export namespace SEVERITY {
47
+ let smooth: number;
48
+ let light: number;
49
+ let lightModerate: number;
50
+ let moderate: number;
51
+ let moderateSevere: number;
52
+ }
53
+ export const MAX_ALT: 52;
54
+ export const MIN_ALT: 5;
55
+ export const UPDATE_INTERVAL_MS: number;
56
+ export const GLOBAL_OBSERVATION_DATA_EXPIRY_SEC: number;
57
+ export const HEXAGON_OBSERVATION_DATA_EXPIRY_MS: number;
58
+ export const DEFAULT_RESOLUTION: 1;
59
+ export const MAP_RESOLUTION: 5;
60
+ export namespace FLOW_OPERATION_MODES {
61
+ let DEFAULT: string;
62
+ let CORRIDOR: string;
63
+ }
64
+ export namespace LARGE_POLYGON_HANDLING_BEHAVIOR {
65
+ let IGNORE: string;
66
+ let USE_MIDDLE_AREA: string;
67
+ let EXCLUDE_SMOOTH_SEVERITY: string;
68
+ }
69
+ export const MIDDLE_AREA_EXTENSION_FACTOR: 4;
70
+ export namespace ZOOM_LEVEL_THRESHOLDS {
71
+ let PREVENT_FETCHING: number;
72
+ let LARGE_POLYGON_FETCHING: number;
73
+ }
@@ -0,0 +1,18 @@
1
+ export class ObservationsFlow {
2
+ constructor({ fetcher }: {
3
+ fetcher: any;
4
+ });
5
+ onData: (callback: any) => void;
6
+ onError: (callback: any) => void;
7
+ onIsProcessingChange: (callback: any) => void;
8
+ start: () => void;
9
+ stop: () => void;
10
+ terminate: () => void;
11
+ get isRunning(): any;
12
+ updateConfig: ({ polygon, isCorridorMode, aircraftCategory }: {
13
+ polygon: any;
14
+ isCorridorMode: any;
15
+ aircraftCategory: any;
16
+ }) => void;
17
+ #private;
18
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./flow";
2
+ export * from "./service";
@@ -0,0 +1,13 @@
1
+ export class ObservationsService {
2
+ constructor({ fetcher }: {
3
+ fetcher: any;
4
+ });
5
+ fetch: ({ polygon, polygonSize, aircraftCategory }: {
6
+ polygon: any;
7
+ polygonSize: any;
8
+ aircraftCategory: any;
9
+ }, signal: any) => Promise<any>;
10
+ expire: () => void;
11
+ dispose: () => void;
12
+ #private;
13
+ }
@@ -0,0 +1,15 @@
1
+ export function validateInput({ polygon, isCorridorMode, aircraftCategory }: {
2
+ polygon: any;
3
+ isCorridorMode: any;
4
+ aircraftCategory: any;
5
+ }): void;
6
+ export function mapPolygonToHexIds({ polygon, polygonSize }: {
7
+ polygon: any;
8
+ polygonSize: any;
9
+ }): {
10
+ hexIds: string[];
11
+ childCells: string[];
12
+ };
13
+ export function mapReportsArrayToReportsObject(reports: any): any;
14
+ export function storeToResult(store: any, selector: any, options?: {}): any;
15
+ export function mapResponseToReportsArray(response: any): any;
@@ -0,0 +1,76 @@
1
+ export namespace PATHS {
2
+ let DATA: string;
3
+ }
4
+ export namespace DEFAULT_FILTER_VALUES {
5
+ let HOURS_AGO: number;
6
+ let SEVERITY: number;
7
+ let ALT_FROM: number;
8
+ let ALT_TO: number;
9
+ }
10
+ export const SIZE_TO_RESOLUTION_MAP: {
11
+ [x: string]: number;
12
+ };
13
+ export const SIZE_TO_MIN_SEVERITY_MAP: {
14
+ [x: string]: number;
15
+ };
16
+ export const SIZE_TO_EXTENSION_FACTOR_MAP: {
17
+ [x: string]: number;
18
+ };
19
+ export const DEBOUNCE_TIME_SEC: number;
20
+ export const REFRESH_TIME_SEC: number;
21
+ export namespace CONFIG_KEYS {
22
+ export let POLYGON: string;
23
+ export let IS_CORRIDOR_MODE: string;
24
+ export let AIRCRAFT_CATEGORY: string;
25
+ let HOURS_AGO_1: string;
26
+ export { HOURS_AGO_1 as HOURS_AGO };
27
+ export let FORECAST_TS: string;
28
+ export let NOWCASTING_ALT: string;
29
+ }
30
+ export namespace AIRCRAFT_CATEGORY {
31
+ let C10: string;
32
+ let C20: string;
33
+ let C30: string;
34
+ let C40: string;
35
+ let C50: string;
36
+ let C60: string;
37
+ let C70: string;
38
+ let C80: string;
39
+ let C90: string;
40
+ let C100: string;
41
+ let C110: string;
42
+ }
43
+ export namespace HISTORY_HOURS {
44
+ let halfAnHour: string;
45
+ let oneHour: string;
46
+ let twoHours: string;
47
+ let fourHours: string;
48
+ }
49
+ export namespace SEVERITY {
50
+ let smooth: number;
51
+ let light: number;
52
+ let lightModerate: number;
53
+ let moderate: number;
54
+ let moderateSevere: number;
55
+ }
56
+ export const MAX_ALT: 52;
57
+ export const MIN_ALT: 5;
58
+ export const UPDATE_INTERVAL_MS: number;
59
+ export const GLOBAL_OBSERVATION_DATA_EXPIRY_SEC: number;
60
+ export const HEXAGON_OBSERVATION_DATA_EXPIRY_MS: number;
61
+ export const DEFAULT_RESOLUTION: 1;
62
+ export const MAP_RESOLUTION: 5;
63
+ export namespace FLOW_OPERATION_MODES {
64
+ let DEFAULT: string;
65
+ let CORRIDOR: string;
66
+ }
67
+ export namespace LARGE_POLYGON_HANDLING_BEHAVIOR {
68
+ let IGNORE: string;
69
+ let USE_MIDDLE_AREA: string;
70
+ let EXCLUDE_SMOOTH_SEVERITY: string;
71
+ }
72
+ export const MIDDLE_AREA_EXTENSION_FACTOR: 4;
73
+ export namespace ZOOM_LEVEL_THRESHOLDS {
74
+ let PREVENT_FETCHING: number;
75
+ let LARGE_POLYGON_FETCHING: number;
76
+ }
@@ -0,0 +1,21 @@
1
+ export class OneLayerFlow {
2
+ constructor({ fetcher }: {
3
+ fetcher: any;
4
+ });
5
+ onData: (callback: any) => void;
6
+ onError: (callback: any) => void;
7
+ onIsProcessingChange: (callback: any) => void;
8
+ start: () => void;
9
+ stop: () => void;
10
+ terminate: () => void;
11
+ get isRunning(): any;
12
+ updateConfig: ({ polygon, isCorridorMode, aircraftCategory, hoursAgo, forecastTs, nowcastingAlt, }: {
13
+ polygon: any;
14
+ isCorridorMode: any;
15
+ aircraftCategory: any;
16
+ hoursAgo: any;
17
+ forecastTs: any;
18
+ nowcastingAlt: any;
19
+ }) => void;
20
+ #private;
21
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./flow";
2
+ export * from "./service";
@@ -0,0 +1,19 @@
1
+ export class OneLayerService {
2
+ constructor({ fetcher }: {
3
+ fetcher: any;
4
+ });
5
+ fetch: ({ polygon, polygonSize, aircraftCategory, hoursAgo, forecastTs, nowcastingAlt, shouldIgnorePromises, }: {
6
+ polygon: any;
7
+ polygonSize: any;
8
+ aircraftCategory: any;
9
+ hoursAgo: any;
10
+ forecastTs: any;
11
+ nowcastingAlt: any;
12
+ shouldIgnorePromises: any;
13
+ }, signal: any) => Promise<any>;
14
+ expire: ({ hoursAgo }: {
15
+ hoursAgo: any;
16
+ }) => void;
17
+ dispose: () => void;
18
+ #private;
19
+ }
@@ -0,0 +1,79 @@
1
+ export function validateInput({ polygon, isCorridorMode, aircraftCategory, hoursAgo, forecastTs, nowcastingAlt, }: {
2
+ polygon: any;
3
+ isCorridorMode: any;
4
+ aircraftCategory: any;
5
+ hoursAgo: any;
6
+ forecastTs: any;
7
+ nowcastingAlt: any;
8
+ }): void;
9
+ export function mapPolygonToHexIds({ polygon, polygonSize }: {
10
+ polygon: any;
11
+ polygonSize: any;
12
+ }): {
13
+ hexIds: string[];
14
+ childCells: string[];
15
+ };
16
+ export function margeDeltaReports({ oldReports, newReports }: {
17
+ oldReports: any;
18
+ newReports: any;
19
+ }): any[];
20
+ /**
21
+ * Converts the store data to a result object.
22
+ *
23
+ * @param {Object} params - The parameters.
24
+ * @param {Map} params.oneLayerStore - The store containing one layer data.
25
+ * @param {Object | null} [params.nowcastingData] - The nowcasting response data.
26
+ * @param {Array} params.selector - The selector array.
27
+ * @param {Object} params.options - Additional options.
28
+ * @param {Array} [params.options.childCells] - The child cells.
29
+ * @param {number} params.options.forecastTs - The forecast timestamp.
30
+ * @param {number | null} [params.options.nowcastingAlt] - The nowcasting altitude.
31
+ * @param {number | null} [params.options.hoursAgo] - The event expiration time in hours.
32
+ * @returns {Object} The result object.
33
+ */
34
+ export function storeToResult({ oneLayerStore, nowcastingData, selector, options, }: {
35
+ oneLayerStore: Map<any, any>;
36
+ nowcastingData?: any | null;
37
+ selector: any[];
38
+ options: {
39
+ childCells?: any[];
40
+ forecastTs: number;
41
+ nowcastingAlt?: number | null;
42
+ hoursAgo?: number | null;
43
+ };
44
+ }): any;
45
+ export function mapResponseToReportsArray({ responseData }: {
46
+ responseData: any;
47
+ }): any;
48
+ export function expireOldData({ store, hoursAgo }: {
49
+ store: any;
50
+ hoursAgo: any;
51
+ }): Map<any, any>;
52
+ export function getMostRelevantTimeWindowReport({ reports, forecastTs, hoursAgo }: {
53
+ reports: any;
54
+ forecastTs: any;
55
+ hoursAgo: any;
56
+ }): any;
57
+ export function getForecastTs({ forecastTs }: {
58
+ forecastTs: any;
59
+ }): any;
60
+ export function getNowcastViaForecastTsAndAlt({ nowcasting, forecastTs, nowcastingAlt, }: {
61
+ nowcasting: any;
62
+ forecastTs: any;
63
+ nowcastingAlt: any;
64
+ }): any;
65
+ export function convertNowcastingDataToOnaLayerStructure({ hexId, nowcastItem }: {
66
+ hexId: any;
67
+ nowcastItem: any;
68
+ }): {
69
+ hexId: any;
70
+ alt: any;
71
+ severities: {
72
+ edr: any;
73
+ sev: any;
74
+ sources: number[];
75
+ observationTime: number;
76
+ usedSource: number;
77
+ usedSourceTs: number;
78
+ }[];
79
+ };
@@ -0,0 +1,123 @@
1
+ export default createSkyPathSDK;
2
+ export * from "./publicApi";
3
+ /**
4
+ * The SkyPath SDK object containing factory functions to create different flows.
5
+ */
6
+ export type SkyPathSDK = {
7
+ /**
8
+ * - Factory function to create a NowcastingFlow instance.
9
+ */
10
+ createNowcastingFlow: () => NowcastingFlow;
11
+ /**
12
+ * - Factory function to create a GTGFlow instance.
13
+ */
14
+ createGtgFlow: () => NowcastingFlow;
15
+ /**
16
+ * - Factory function to create an ObservationsFlow instance.
17
+ */
18
+ createObservationsFlow: () => ObservationsFlow;
19
+ /**
20
+ * - Factory function to create an OneLayerFlow instance.
21
+ */
22
+ createOneLayerFlow: () => OneLayerFlow;
23
+ /**
24
+ * - Factory function to create an ADSBFlow instance.
25
+ */
26
+ createAdsbFlow: () => ADSBFlow;
27
+ /**
28
+ * - Converts an aircraft ICAO code to an aircraft type.
29
+ */
30
+ mapAircraftIcaoToAircraftType: (options: {
31
+ icao: string;
32
+ }) => string;
33
+ };
34
+ /**
35
+ * Options to initialize the SkyPath SDK.
36
+ */
37
+ export type SkyPathSDKOptions = {
38
+ /**
39
+ * - The Proxy URL to make API requests.
40
+ */
41
+ proxyUrl?: string;
42
+ /**
43
+ * - Authentication API key.
44
+ */
45
+ apiKey?: string;
46
+ /**
47
+ * - User ID.
48
+ */
49
+ userId?: string;
50
+ /**
51
+ * - Company name.
52
+ */
53
+ companyName?: string;
54
+ /**
55
+ * - The environment to initialize the SDK (default: "staging").
56
+ */
57
+ environment?: string;
58
+ /**
59
+ * - The callback function to authenticate with signed JWT.
60
+ */
61
+ authCallback?: () => Promise<{
62
+ jwt: string;
63
+ partnerId: string;
64
+ }>;
65
+ };
66
+ /**
67
+ * The SkyPath SDK object containing factory functions to create different flows.
68
+ * @typedef {Object} SkyPathSDK
69
+ * @property {() => NowcastingFlow} createNowcastingFlow - Factory function to create a NowcastingFlow instance.
70
+ * @property {() => NowcastingFlow} createGtgFlow - Factory function to create a GTGFlow instance.
71
+ * @property {() => ObservationsFlow} createObservationsFlow - Factory function to create an ObservationsFlow instance.
72
+ * @property {() => OneLayerFlow} createOneLayerFlow - Factory function to create an OneLayerFlow instance.
73
+ * @property {() => ADSBFlow} createAdsbFlow - Factory function to create an ADSBFlow instance.
74
+ * @property {(options: { icao: string }) => string} mapAircraftIcaoToAircraftType - Converts an aircraft ICAO code to an aircraft type.
75
+ */
76
+ /**
77
+ * Options to initialize the SkyPath SDK.
78
+ * @typedef {Object} SkyPathSDKOptions
79
+ * @property {string} [proxyUrl] - The Proxy URL to make API requests.
80
+ * @property {string} [apiKey] - Authentication API key.
81
+ * @property {string} [userId] - User ID.
82
+ * @property {string} [companyName] - Company name.
83
+ * @property {string} [environment] - The environment to initialize the SDK (default: "staging").
84
+ * @property {() => Promise<{ jwt: string, partnerId: string }>} [authCallback] - The callback function to authenticate with signed JWT.
85
+ */
86
+ /**
87
+ * Initializes the SkyPath SDK and returns a promise that resolves to an object with factory functions
88
+ * for creating different flows (e.g. Nowcasting or Observations).
89
+ *
90
+ * @async
91
+ * @function createSkyPathSDK
92
+ * @param {SkyPathSDKOptions} options - The options to initialize the SDK.
93
+ * @returns {Promise<SkyPathSDK>} - An object containing factory functions to create NowcastingFlow, GTGFlow, ObservationsFlow or other flows.
94
+ * @example
95
+ * ```js
96
+ * // Initialize the SkyPath SDK with the API key, user ID, and company name.
97
+ * const skyPathSDK = await createSkyPathSDK({
98
+ * apiKey: "YOUR_API_KEY",
99
+ * userId: "YOUR_USER_ID",
100
+ * companyName: "YOUR_COMPANY_NAME",
101
+ * });
102
+ *
103
+ * // Alternatively, you can use the authCallback function to authenticate with signed JWT.
104
+ * const skyPathSDK = await createSkyPathSDK({
105
+ * authCallback: async () => {
106
+ * return {
107
+ * jwt: "YOUR_SIGNED_JWT",
108
+ * partnerId: "YOUR_PARTNER_ID",
109
+ * };
110
+ * });
111
+ *
112
+ * // Use the factory functions to create different flows.
113
+ * const nowcastingFlow = skyPathSDK.createNowcastingFlow();
114
+ * const gtgFlow = skyPathSDK.createGtgFlow();
115
+ * const observationsFlow = skyPathSDK.createObservationsFlow();
116
+ * const observationsFlow = skyPathSDK.createOneLayerFlow();
117
+ * ```
118
+ */
119
+ declare function createSkyPathSDK({ apiKey, userId, companyName, authCallback, environment, proxyUrl, applicationId, isMonitoringEnabled, shouldCollectConsoleLogs, shouldCollectErrors, }: SkyPathSDKOptions): Promise<SkyPathSDK>;
120
+ import { NowcastingFlow } from "./features/nowcasting";
121
+ import { ObservationsFlow } from "./features/observations";
122
+ import { OneLayerFlow } from "./features/oneLayer";
123
+ import { ADSBFlow } from "./features/adsb";
@@ -0,0 +1,25 @@
1
+ import * as CoreUtils from "./core/utils";
2
+ import * as GeoUtils from "./core/geo";
3
+ export namespace Nowcasting {
4
+ export { getNowcastingDataSlice };
5
+ export { prepareNowcastingDataForMapHexagons };
6
+ }
7
+ export namespace Observations {
8
+ namespace availableConfigInputs {
9
+ export { AIRCRAFT_CATEGORY as aircraftCategory };
10
+ export { HISTORY_HOURS as hours };
11
+ export { SEVERITY as severity };
12
+ export { MAX_ALT as maxAltitude };
13
+ export { MIN_ALT as minAltitude };
14
+ export { LARGE_POLYGON_HANDLING_BEHAVIOR as largePolygonHandlingBehavior };
15
+ }
16
+ }
17
+ import { getNowcastingDataSlice } from "./features/nowcasting/utils";
18
+ import { prepareNowcastingDataForMapHexagons } from "./features/nowcasting/utils";
19
+ import { AIRCRAFT_CATEGORY } from "./features/observations/consts.js";
20
+ import { HISTORY_HOURS } from "./features/observations/consts.js";
21
+ import { SEVERITY } from "./features/observations/consts.js";
22
+ import { MAX_ALT } from "./features/observations/consts.js";
23
+ import { MIN_ALT } from "./features/observations/consts.js";
24
+ import { LARGE_POLYGON_HANDLING_BEHAVIOR } from "./features/observations/consts.js";
25
+ export { CoreUtils, GeoUtils };