@skypath-io/web-sdk 0.5.30 → 0.6.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/CHANGELOG.md +12 -0
- package/dist/bundle.cjs.js +2 -2
- package/dist/bundle.es.js +2 -2
- package/dist/bundle.iife.js +2 -2
- package/dist/types/src/features/{nowcasting → forecast}/consts.d.ts +2 -1
- package/dist/types/src/features/{nowcasting → forecast}/flow.d.ts +3 -2
- package/dist/types/src/features/{nowcasting → forecast}/service.d.ts +1 -1
- package/dist/types/src/features/{nowcasting → forecast}/utils.d.ts +6 -3
- package/dist/types/src/features/oneLayer/consts.d.ts +2 -1
- package/dist/types/src/features/oneLayer/flow.d.ts +5 -4
- package/dist/types/src/features/oneLayer/service.d.ts +2 -2
- package/dist/types/src/features/oneLayer/utils.d.ts +10 -7
- package/dist/types/src/index.d.ts +9 -9
- package/package.json +1 -1
- /package/dist/types/src/features/{nowcasting → forecast}/expandHexIdRanges.d.ts +0 -0
- /package/dist/types/src/features/{nowcasting → forecast}/index.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export namespace
|
|
1
|
+
export namespace FORECAST_PATHS {
|
|
2
2
|
let INFO: string;
|
|
3
3
|
let DATA: string;
|
|
4
4
|
}
|
|
@@ -13,6 +13,7 @@ export const REFRESH_TIME_SEC: number;
|
|
|
13
13
|
export namespace CONFIG_KEYS {
|
|
14
14
|
let POLYGON: string;
|
|
15
15
|
let IS_CORRIDOR_MODE: string;
|
|
16
|
+
let IS_ENABLED: string;
|
|
16
17
|
}
|
|
17
18
|
export const MAP_RESOLUTION: 5;
|
|
18
19
|
export const MAX_FORECAST_HOURS: 24;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class ForecastFlow {
|
|
2
2
|
constructor({ service, cacheTokenService }: {
|
|
3
3
|
service: any;
|
|
4
4
|
cacheTokenService: any;
|
|
@@ -10,9 +10,10 @@ export class NowcastingFlow {
|
|
|
10
10
|
stop: () => void;
|
|
11
11
|
terminate: () => void;
|
|
12
12
|
get isRunning(): any;
|
|
13
|
-
updateConfig: ({ polygon, isCorridorMode, forecast, maxAltitude, minAltitude, minSeverity, }: {
|
|
13
|
+
updateConfig: ({ polygon, isCorridorMode, isEnabled, forecast, maxAltitude, minAltitude, minSeverity, }: {
|
|
14
14
|
polygon: any;
|
|
15
15
|
isCorridorMode: any;
|
|
16
|
+
isEnabled: any;
|
|
16
17
|
forecast: any;
|
|
17
18
|
maxAltitude: any;
|
|
18
19
|
minAltitude: any;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function validateInput({ polygon, forecast, isCorridorMode, maxAltitude, minAltitude, minSeverity, }: {
|
|
1
|
+
export function validateInput({ polygon, forecast, isCorridorMode, isEnabled, maxAltitude, minAltitude, minSeverity, }: {
|
|
2
2
|
polygon: any;
|
|
3
3
|
forecast: any;
|
|
4
4
|
isCorridorMode: any;
|
|
5
|
+
isEnabled: any;
|
|
5
6
|
maxAltitude: any;
|
|
6
7
|
minAltitude: any;
|
|
7
8
|
minSeverity: any;
|
|
@@ -11,6 +12,7 @@ export function mapPolygonToHexIds({ polygon, polygonSize }: {
|
|
|
11
12
|
polygonSize: any;
|
|
12
13
|
}): {
|
|
13
14
|
hexIds: string[];
|
|
15
|
+
childCells: string[];
|
|
14
16
|
};
|
|
15
17
|
export function mapResponseToReportsArray({ response, lastUpdatedAt, parentCell }: {
|
|
16
18
|
response: any;
|
|
@@ -25,11 +27,12 @@ export function buildData(data: any): {
|
|
|
25
27
|
toHexagonsArray: () => any[];
|
|
26
28
|
toFeatureCollection: () => any;
|
|
27
29
|
};
|
|
28
|
-
export function filterData({ data, filters }: {
|
|
30
|
+
export function filterData({ data, filters, childCells }: {
|
|
29
31
|
data: any;
|
|
30
32
|
filters: any;
|
|
33
|
+
childCells: any;
|
|
31
34
|
}): any;
|
|
32
|
-
export function
|
|
35
|
+
export function prepareForecastDataForMapHexagons({ data, resolution, }: {
|
|
33
36
|
data: any;
|
|
34
37
|
resolution?: number;
|
|
35
38
|
}): any[];
|
|
@@ -18,10 +18,11 @@ export const REFRESH_TIME_SEC: number;
|
|
|
18
18
|
export namespace CONFIG_KEYS {
|
|
19
19
|
let POLYGON: string;
|
|
20
20
|
let IS_CORRIDOR_MODE: string;
|
|
21
|
+
let IS_FORECAST_ENABLED: string;
|
|
21
22
|
let AIRCRAFT_CATEGORY: string;
|
|
22
23
|
let HOURS_AGO: string;
|
|
23
24
|
let FORECAST_TS: string;
|
|
24
|
-
let
|
|
25
|
+
let FORECAST_ALT: string;
|
|
25
26
|
}
|
|
26
27
|
export namespace AIRCRAFT_CATEGORY {
|
|
27
28
|
let C10: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class OneLayerFlow {
|
|
2
|
-
constructor({ fetcher, cacheTokenService,
|
|
2
|
+
constructor({ fetcher, cacheTokenService, forecastService }: {
|
|
3
3
|
fetcher: any;
|
|
4
4
|
cacheTokenService: any;
|
|
5
|
-
|
|
5
|
+
forecastService: any;
|
|
6
6
|
});
|
|
7
7
|
onData: (callback: any) => void;
|
|
8
8
|
onError: (callback: any) => void;
|
|
@@ -11,13 +11,14 @@ export class OneLayerFlow {
|
|
|
11
11
|
stop: () => void;
|
|
12
12
|
terminate: () => void;
|
|
13
13
|
get isRunning(): any;
|
|
14
|
-
updateConfig: ({ polygon, isCorridorMode, aircraftCategory, hoursAgo, forecastTs,
|
|
14
|
+
updateConfig: ({ polygon, isCorridorMode, isForecastEnabled, aircraftCategory, hoursAgo, forecastTs, forecastAlt, maxAltitude, minAltitude, minSeverity, }: {
|
|
15
15
|
polygon: any;
|
|
16
16
|
isCorridorMode: any;
|
|
17
|
+
isForecastEnabled: any;
|
|
17
18
|
aircraftCategory: any;
|
|
18
19
|
hoursAgo: any;
|
|
19
20
|
forecastTs: any;
|
|
20
|
-
|
|
21
|
+
forecastAlt: any;
|
|
21
22
|
maxAltitude: any;
|
|
22
23
|
minAltitude: any;
|
|
23
24
|
minSeverity: any;
|
|
@@ -6,10 +6,10 @@ export class OneLayerService {
|
|
|
6
6
|
config: any;
|
|
7
7
|
signal: any;
|
|
8
8
|
}) => Promise<any>;
|
|
9
|
-
getData: ({ config, filters,
|
|
9
|
+
getData: ({ config, filters, forecastData }: {
|
|
10
10
|
config: any;
|
|
11
11
|
filters: any;
|
|
12
|
-
|
|
12
|
+
forecastData: any;
|
|
13
13
|
}) => {
|
|
14
14
|
toRawObject: () => any;
|
|
15
15
|
toHexagonsArray: () => any;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export function validateInput({ polygon, isCorridorMode, aircraftCategory, hoursAgo, maxAltitude, minAltitude, minSeverity, forecastTs,
|
|
1
|
+
export function validateInput({ polygon, isCorridorMode, isForecastEnabled, aircraftCategory, hoursAgo, maxAltitude, minAltitude, minSeverity, forecastTs, forecastAlt, }: {
|
|
2
2
|
polygon: any;
|
|
3
3
|
isCorridorMode: any;
|
|
4
|
+
isForecastEnabled: any;
|
|
4
5
|
aircraftCategory: any;
|
|
5
6
|
hoursAgo: any;
|
|
6
7
|
maxAltitude: any;
|
|
7
8
|
minAltitude: any;
|
|
8
9
|
minSeverity: any;
|
|
9
10
|
forecastTs: any;
|
|
10
|
-
|
|
11
|
+
forecastAlt: any;
|
|
11
12
|
}): void;
|
|
12
13
|
export function mapPolygonToHexIds({ polygon, polygonSize }: {
|
|
13
14
|
polygon: any;
|
|
@@ -25,22 +26,24 @@ export function margeDeltaReports({ oldReports, newReports }: {
|
|
|
25
26
|
*
|
|
26
27
|
* @param {Object} params - The parameters.
|
|
27
28
|
* @param {Map} params.oneLayerStore - The store containing one layer data.
|
|
28
|
-
* @param {Object | null} [params.
|
|
29
|
+
* @param {Object | null} [params.forecastData] - The forecast response data.
|
|
29
30
|
* @param {Array} params.selector - The selector array.
|
|
30
31
|
* @param {Object} params.options - Additional options.
|
|
31
32
|
* @param {Array} [params.options.childCells] - The child cells.
|
|
32
33
|
* @param {number} params.options.forecastTs - The forecast timestamp.
|
|
33
34
|
* @param {number | null} [params.options.hoursAgo] - The event expiration time in hours.
|
|
35
|
+
* @param {boolean} [params.options.isForecastEnabled] - is forecast layer return data.
|
|
34
36
|
* @returns {Object} The result object.
|
|
35
37
|
*/
|
|
36
|
-
export function storeToResult({ oneLayerStore,
|
|
38
|
+
export function storeToResult({ oneLayerStore, forecastData, selector, options: { childCells, forecastTs, hoursAgo, isForecastEnabled }, }: {
|
|
37
39
|
oneLayerStore: Map<any, any>;
|
|
38
|
-
|
|
40
|
+
forecastData?: any | null;
|
|
39
41
|
selector: any[];
|
|
40
42
|
options: {
|
|
41
43
|
childCells?: any[];
|
|
42
44
|
forecastTs: number;
|
|
43
45
|
hoursAgo?: number | null;
|
|
46
|
+
isForecastEnabled?: boolean;
|
|
44
47
|
};
|
|
45
48
|
}): any;
|
|
46
49
|
export function mapResponseToReportsArray({ responseData }: {
|
|
@@ -58,9 +61,9 @@ export function getMostRelevantTimeWindowReport({ reports, forecastTs, hoursAgo
|
|
|
58
61
|
export function getForecastTs({ forecastTs }: {
|
|
59
62
|
forecastTs: any;
|
|
60
63
|
}): any;
|
|
61
|
-
export function
|
|
64
|
+
export function convertForecastDataToOneLayerStructure({ hexId, forecastItem }: {
|
|
62
65
|
hexId: any;
|
|
63
|
-
|
|
66
|
+
forecastItem: any;
|
|
64
67
|
}): {
|
|
65
68
|
hexId: any;
|
|
66
69
|
alt: any;
|
|
@@ -5,13 +5,13 @@ export * from "./publicApi";
|
|
|
5
5
|
*/
|
|
6
6
|
export type SkyPathSDK = {
|
|
7
7
|
/**
|
|
8
|
-
* - Factory function to create a
|
|
8
|
+
* - Factory function to create a ForecastFlow instance.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
createForecastFlow: () => ForecastFlow;
|
|
11
11
|
/**
|
|
12
12
|
* - Factory function to create a createGtgFlow instance.
|
|
13
13
|
*/
|
|
14
|
-
createGtgFlow: () =>
|
|
14
|
+
createGtgFlow: () => ForecastFlow;
|
|
15
15
|
/**
|
|
16
16
|
* - Factory function to create an ObservationsFlow instance.
|
|
17
17
|
*/
|
|
@@ -66,8 +66,8 @@ export type SkyPathSDKOptions = {
|
|
|
66
66
|
/**
|
|
67
67
|
* The SkyPath SDK object containing factory functions to create different flows.
|
|
68
68
|
* @typedef {Object} SkyPathSDK
|
|
69
|
-
* @property {() =>
|
|
70
|
-
* @property {() =>
|
|
69
|
+
* @property {() => ForecastFlow} createForecastFlow - Factory function to create a ForecastFlow instance.
|
|
70
|
+
* @property {() => ForecastFlow} createGtgFlow - Factory function to create a createGtgFlow instance.
|
|
71
71
|
* @property {() => ObservationsFlow} createObservationsFlow - Factory function to create an ObservationsFlow instance.
|
|
72
72
|
* @property {() => OneLayerFlow} createOneLayerFlow - Factory function to create an OneLayerFlow instance.
|
|
73
73
|
* @property {() => ADSBFlow} createAdsbFlow - Factory function to create an ADSBFlow instance.
|
|
@@ -85,12 +85,12 @@ export type SkyPathSDKOptions = {
|
|
|
85
85
|
*/
|
|
86
86
|
/**
|
|
87
87
|
* Initializes the SkyPath SDK and returns a promise that resolves to an object with factory functions
|
|
88
|
-
* for creating different flows (e.g.
|
|
88
|
+
* for creating different flows (e.g. Forecast or Observations).
|
|
89
89
|
*
|
|
90
90
|
* @async
|
|
91
91
|
* @function createSkyPathSDK
|
|
92
92
|
* @param {SkyPathSDKOptions} options - The options to initialize the SDK.
|
|
93
|
-
* @returns {Promise<SkyPathSDK>} - An object containing factory functions to create
|
|
93
|
+
* @returns {Promise<SkyPathSDK>} - An object containing factory functions to create ForecastFlow, GTGFlow, ObservationsFlow or other flows.
|
|
94
94
|
* @example
|
|
95
95
|
* ```js
|
|
96
96
|
* // Initialize the SkyPath SDK with the API key, user ID, and company name.
|
|
@@ -110,13 +110,13 @@ export type SkyPathSDKOptions = {
|
|
|
110
110
|
* });
|
|
111
111
|
*
|
|
112
112
|
* // Use the factory functions to create different flows.
|
|
113
|
-
* const
|
|
113
|
+
* const forecastFlow = skyPathSDK.createForecastFlow();
|
|
114
114
|
* const observationsFlow = skyPathSDK.createObservationsFlow();
|
|
115
115
|
* const OneLayerFlow = skyPathSDK.createOneLayerFlow();
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
118
|
declare function createSkyPathSDK({ apiKey, userId, companyName, authCallback, environment, proxyUrl, applicationId, isMonitoringEnabled, shouldCollectConsoleLogs, shouldCollectErrors, }: SkyPathSDKOptions): Promise<SkyPathSDK>;
|
|
119
|
-
import {
|
|
119
|
+
import { ForecastFlow } from "./features/forecast";
|
|
120
120
|
import { ObservationsFlow } from "./features/observations";
|
|
121
121
|
import { OneLayerFlow } from "./features/oneLayer";
|
|
122
122
|
import { ADSBFlow } from "./features/adsb";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|