supaapps-config-fetcher 1.0.5 → 1.0.6

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.
@@ -5,6 +5,5 @@ export declare class ConfigManager<T> {
5
5
  private configHost;
6
6
  private constructor();
7
7
  static getInstance<T>(appName: string, configHost?: string): ConfigManager<T>;
8
- loadConfig(): Promise<T | null>;
9
- getConfig(): T | null;
8
+ loadConfig(): Promise<T>;
10
9
  }
@@ -36,13 +36,10 @@ class ConfigManager {
36
36
  }
37
37
  catch (error) {
38
38
  console.error("Failed to load config:", error);
39
- return null;
39
+ throw new Error('Received invalid config data');
40
40
  }
41
41
  });
42
42
  }
43
- getConfig() {
44
- return this.config;
45
- }
46
43
  }
47
44
  exports.ConfigManager = ConfigManager;
48
45
  ConfigManager.instances = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supaapps-config-fetcher",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,7 +19,7 @@ export class ConfigManager<T> {
19
19
  return ConfigManager.instances[key] as ConfigManager<T>;
20
20
  }
21
21
 
22
- public async loadConfig(): Promise<T | null> {
22
+ public async loadConfig(): Promise<T> {
23
23
  if (this.config) return this.config;
24
24
  try {
25
25
  const host = typeof window !== 'undefined' ? window.location.hostname : 'localhost';
@@ -28,11 +28,7 @@ export class ConfigManager<T> {
28
28
  return this.config;
29
29
  } catch (error) {
30
30
  console.error("Failed to load config:", error);
31
- return null;
31
+ throw new Error('Received invalid config data');
32
32
  }
33
33
  }
34
-
35
- public getConfig(): T | null {
36
- return this.config;
37
- }
38
34
  }