@skypath-io/web-sdk 0.6.0 → 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.
@@ -25,6 +25,7 @@ export class AuthService {
25
25
  tokenProvider: {
26
26
  token: any;
27
27
  };
28
+ config: any;
28
29
  }>;
29
30
  #private;
30
31
  }
@@ -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,8 +1,9 @@
1
1
  export class OneLayerFlow {
2
- constructor({ fetcher, cacheTokenService, forecastService }: {
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;
@@ -4,6 +4,22 @@ export * from "./publicApi";
4
4
  * The SkyPath SDK object containing factory functions to create different flows.
5
5
  */
6
6
  export type SkyPathSDK = {
7
+ /**
8
+ * - Whether the forecast flow is available for this user.
9
+ */
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;
7
23
  /**
8
24
  * - Factory function to create a ForecastFlow instance.
9
25
  */
@@ -66,6 +82,10 @@ export type SkyPathSDKOptions = {
66
82
  /**
67
83
  * The SkyPath SDK object containing factory functions to create different flows.
68
84
  * @typedef {Object} SkyPathSDK
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.
69
89
  * @property {() => ForecastFlow} createForecastFlow - Factory function to create a ForecastFlow instance.
70
90
  * @property {() => ForecastFlow} createGtgFlow - Factory function to create a createGtgFlow instance.
71
91
  * @property {() => ObservationsFlow} createObservationsFlow - Factory function to create an ObservationsFlow instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skypath-io/web-sdk",
3
- "version": "0.6.0",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.es.js",