@skypath-io/web-sdk 0.5.31 → 1.0.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/core/auth/auth.d.ts +1 -0
- package/dist/types/src/core/auth/consts.d.ts +6 -0
- package/dist/types/src/core/monitoring/errors.d.ts +1 -0
- 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 +3 -2
- package/dist/types/src/features/oneLayer/consts.d.ts +2 -1
- package/dist/types/src/features/oneLayer/flow.d.ts +6 -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 +29 -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
|
@@ -12,6 +12,7 @@ export namespace PATHS {
|
|
|
12
12
|
let PARTNER_LOGIN_SIGNED: string;
|
|
13
13
|
let PARTNER_REFRESH_TOKEN: string;
|
|
14
14
|
let ME: string;
|
|
15
|
+
let CONFIG: string;
|
|
15
16
|
}
|
|
16
17
|
export const REQUEST_ABORTED_MESSAGE: "[SkyPath SDK]: Old fetch request aborted";
|
|
17
18
|
export namespace ENVIRONMENTS {
|
|
@@ -31,3 +32,8 @@ export namespace NETWORK_ERROR_MESSAGES {
|
|
|
31
32
|
let FIREFOX: string;
|
|
32
33
|
let SAFARI: string;
|
|
33
34
|
}
|
|
35
|
+
export namespace CONFIG_KEYS {
|
|
36
|
+
let ONELAYER_WEB_IS_ENABLED: string;
|
|
37
|
+
let WEB_FORECAST_IS_ENABLED: string;
|
|
38
|
+
let GTG_IS_ENABLED: string;
|
|
39
|
+
}
|
|
@@ -4,6 +4,7 @@ export namespace ERROR_MESSAGES {
|
|
|
4
4
|
let FAILED_TO_AUTHENTICATE_WITH_AUTH_CALLBACK: string;
|
|
5
5
|
let FAILED_TO_AUTHENTICATE_WITH_API_KEY: string;
|
|
6
6
|
let FAILED_TO_GET_AUTH_TOKEN: string;
|
|
7
|
+
let FAILED_TO_FETCH_USER_CONFIG: string;
|
|
7
8
|
}
|
|
8
9
|
export class SkyPathError extends Error {
|
|
9
10
|
/**
|
|
@@ -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;
|
|
@@ -31,7 +32,7 @@ export function filterData({ data, filters, childCells }: {
|
|
|
31
32
|
filters: any;
|
|
32
33
|
childCells: any;
|
|
33
34
|
}): any;
|
|
34
|
-
export function
|
|
35
|
+
export function prepareForecastDataForMapHexagons({ data, resolution, }: {
|
|
35
36
|
data: any;
|
|
36
37
|
resolution?: number;
|
|
37
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,9 @@
|
|
|
1
1
|
export class OneLayerFlow {
|
|
2
|
-
constructor({ fetcher, cacheTokenService,
|
|
2
|
+
constructor({ fetcher, cacheTokenService, forecastService, isForecastActive, }: {
|
|
3
3
|
fetcher: any;
|
|
4
4
|
cacheTokenService: any;
|
|
5
|
-
|
|
5
|
+
forecastService: any;
|
|
6
|
+
isForecastActive: any;
|
|
6
7
|
});
|
|
7
8
|
onData: (callback: any) => void;
|
|
8
9
|
onError: (callback: any) => void;
|
|
@@ -11,13 +12,14 @@ export class OneLayerFlow {
|
|
|
11
12
|
stop: () => void;
|
|
12
13
|
terminate: () => void;
|
|
13
14
|
get isRunning(): any;
|
|
14
|
-
updateConfig: ({ polygon, isCorridorMode, aircraftCategory, hoursAgo, forecastTs,
|
|
15
|
+
updateConfig: ({ polygon, isCorridorMode, isForecastEnabled, aircraftCategory, hoursAgo, forecastTs, forecastAlt, maxAltitude, minAltitude, minSeverity, }: {
|
|
15
16
|
polygon: any;
|
|
16
17
|
isCorridorMode: any;
|
|
18
|
+
isForecastEnabled: any;
|
|
17
19
|
aircraftCategory: any;
|
|
18
20
|
hoursAgo: any;
|
|
19
21
|
forecastTs: any;
|
|
20
|
-
|
|
22
|
+
forecastAlt: any;
|
|
21
23
|
maxAltitude: any;
|
|
22
24
|
minAltitude: any;
|
|
23
25
|
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,29 @@ export * from "./publicApi";
|
|
|
5
5
|
*/
|
|
6
6
|
export type SkyPathSDK = {
|
|
7
7
|
/**
|
|
8
|
-
* -
|
|
8
|
+
* - Whether the forecast flow is available for this user.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
IS_FORECAST_ENABLED: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* - Whether the one-layer flow is available for this user.
|
|
13
|
+
*/
|
|
14
|
+
IS_ONELAYER_ENABLED: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* - Whether the ADSB flow is available for this user.
|
|
17
|
+
*/
|
|
18
|
+
IS_ADSB_ENABLED: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* - Whether the GTG flow is available for this user.
|
|
21
|
+
*/
|
|
22
|
+
IS_GTG_ENABLED: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* - Factory function to create a ForecastFlow instance.
|
|
25
|
+
*/
|
|
26
|
+
createForecastFlow: () => ForecastFlow;
|
|
11
27
|
/**
|
|
12
28
|
* - Factory function to create a createGtgFlow instance.
|
|
13
29
|
*/
|
|
14
|
-
createGtgFlow: () =>
|
|
30
|
+
createGtgFlow: () => ForecastFlow;
|
|
15
31
|
/**
|
|
16
32
|
* - Factory function to create an ObservationsFlow instance.
|
|
17
33
|
*/
|
|
@@ -66,8 +82,12 @@ export type SkyPathSDKOptions = {
|
|
|
66
82
|
/**
|
|
67
83
|
* The SkyPath SDK object containing factory functions to create different flows.
|
|
68
84
|
* @typedef {Object} SkyPathSDK
|
|
69
|
-
* @property {
|
|
70
|
-
* @property {
|
|
85
|
+
* @property {boolean} IS_FORECAST_ENABLED - Whether the forecast flow is available for this user.
|
|
86
|
+
* @property {boolean} IS_ONELAYER_ENABLED - Whether the one-layer flow is available for this user.
|
|
87
|
+
* @property {boolean} IS_ADSB_ENABLED - Whether the ADSB flow is available for this user.
|
|
88
|
+
* @property {boolean} IS_GTG_ENABLED - Whether the GTG flow is available for this user.
|
|
89
|
+
* @property {() => ForecastFlow} createForecastFlow - Factory function to create a ForecastFlow instance.
|
|
90
|
+
* @property {() => ForecastFlow} createGtgFlow - Factory function to create a createGtgFlow instance.
|
|
71
91
|
* @property {() => ObservationsFlow} createObservationsFlow - Factory function to create an ObservationsFlow instance.
|
|
72
92
|
* @property {() => OneLayerFlow} createOneLayerFlow - Factory function to create an OneLayerFlow instance.
|
|
73
93
|
* @property {() => ADSBFlow} createAdsbFlow - Factory function to create an ADSBFlow instance.
|
|
@@ -85,12 +105,12 @@ export type SkyPathSDKOptions = {
|
|
|
85
105
|
*/
|
|
86
106
|
/**
|
|
87
107
|
* Initializes the SkyPath SDK and returns a promise that resolves to an object with factory functions
|
|
88
|
-
* for creating different flows (e.g.
|
|
108
|
+
* for creating different flows (e.g. Forecast or Observations).
|
|
89
109
|
*
|
|
90
110
|
* @async
|
|
91
111
|
* @function createSkyPathSDK
|
|
92
112
|
* @param {SkyPathSDKOptions} options - The options to initialize the SDK.
|
|
93
|
-
* @returns {Promise<SkyPathSDK>} - An object containing factory functions to create
|
|
113
|
+
* @returns {Promise<SkyPathSDK>} - An object containing factory functions to create ForecastFlow, GTGFlow, ObservationsFlow or other flows.
|
|
94
114
|
* @example
|
|
95
115
|
* ```js
|
|
96
116
|
* // Initialize the SkyPath SDK with the API key, user ID, and company name.
|
|
@@ -110,13 +130,13 @@ export type SkyPathSDKOptions = {
|
|
|
110
130
|
* });
|
|
111
131
|
*
|
|
112
132
|
* // Use the factory functions to create different flows.
|
|
113
|
-
* const
|
|
133
|
+
* const forecastFlow = skyPathSDK.createForecastFlow();
|
|
114
134
|
* const observationsFlow = skyPathSDK.createObservationsFlow();
|
|
115
135
|
* const OneLayerFlow = skyPathSDK.createOneLayerFlow();
|
|
116
136
|
* ```
|
|
117
137
|
*/
|
|
118
138
|
declare function createSkyPathSDK({ apiKey, userId, companyName, authCallback, environment, proxyUrl, applicationId, isMonitoringEnabled, shouldCollectConsoleLogs, shouldCollectErrors, }: SkyPathSDKOptions): Promise<SkyPathSDK>;
|
|
119
|
-
import {
|
|
139
|
+
import { ForecastFlow } from "./features/forecast";
|
|
120
140
|
import { ObservationsFlow } from "./features/observations";
|
|
121
141
|
import { OneLayerFlow } from "./features/oneLayer";
|
|
122
142
|
import { ADSBFlow } from "./features/adsb";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|