@umituz/react-native-firebase 1.5.1 → 1.7.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.
Files changed (35) hide show
  1. package/package.json +8 -29
  2. package/src/infrastructure/config/FirebaseClient.ts +5 -2
  3. package/src/infrastructure/config/initializers/FirebaseAppInitializer.ts +7 -5
  4. package/lib/application/ports/IFirebaseClient.d.ts +0 -37
  5. package/lib/application/ports/IFirebaseClient.d.ts.map +0 -1
  6. package/lib/application/ports/IFirebaseClient.js +0 -8
  7. package/lib/application/ports/IFirebaseClient.js.map +0 -1
  8. package/lib/domain/errors/FirebaseError.d.ts +0 -28
  9. package/lib/domain/errors/FirebaseError.d.ts.map +0 -1
  10. package/lib/domain/errors/FirebaseError.js +0 -46
  11. package/lib/domain/errors/FirebaseError.js.map +0 -1
  12. package/lib/domain/value-objects/FirebaseConfig.d.ts +0 -36
  13. package/lib/domain/value-objects/FirebaseConfig.d.ts.map +0 -1
  14. package/lib/domain/value-objects/FirebaseConfig.js +0 -8
  15. package/lib/domain/value-objects/FirebaseConfig.js.map +0 -1
  16. package/lib/index.d.ts +0 -26
  17. package/lib/index.d.ts.map +0 -1
  18. package/lib/index.js +0 -29
  19. package/lib/index.js.map +0 -1
  20. package/lib/infrastructure/config/FirebaseClient.d.ts +0 -145
  21. package/lib/infrastructure/config/FirebaseClient.d.ts.map +0 -1
  22. package/lib/infrastructure/config/FirebaseClient.js +0 -335
  23. package/lib/infrastructure/config/FirebaseClient.js.map +0 -1
  24. package/lib/infrastructure/config/FirebaseConfigLoader.d.ts +0 -16
  25. package/lib/infrastructure/config/FirebaseConfigLoader.d.ts.map +0 -1
  26. package/lib/infrastructure/config/FirebaseConfigLoader.js +0 -131
  27. package/lib/infrastructure/config/FirebaseConfigLoader.js.map +0 -1
  28. package/lib/infrastructure/config/initializers/FirebaseAppInitializer.d.ts +0 -17
  29. package/lib/infrastructure/config/initializers/FirebaseAppInitializer.d.ts.map +0 -1
  30. package/lib/infrastructure/config/initializers/FirebaseAppInitializer.js +0 -83
  31. package/lib/infrastructure/config/initializers/FirebaseAppInitializer.js.map +0 -1
  32. package/lib/infrastructure/config/validators/FirebaseConfigValidator.d.ts +0 -18
  33. package/lib/infrastructure/config/validators/FirebaseConfigValidator.d.ts.map +0 -1
  34. package/lib/infrastructure/config/validators/FirebaseConfigValidator.js +0 -62
  35. package/lib/infrastructure/config/validators/FirebaseConfigValidator.js.map +0 -1
package/package.json CHANGED
@@ -1,20 +1,12 @@
1
1
  {
2
2
  "name": "@umituz/react-native-firebase",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "description": "Firebase core package for React Native apps - Centralized initialization for all Firebase services (App, Auth, Analytics, Crashlytics). Use dedicated packages for service-specific operations.",
5
- "main": "./lib/index.js",
6
- "types": "./lib/index.d.ts",
5
+ "main": "./src/index.ts",
6
+ "types": "./src/index.ts",
7
7
  "scripts": {
8
- "build": "tsc",
9
- "typecheck": "tsc --noEmit",
10
- "lint": "tsc --noEmit",
11
- "test": "jest",
12
- "test:watch": "jest --watch",
13
- "test:coverage": "jest --coverage",
14
- "prepublishOnly": "npm run build",
15
- "version:patch": "npm version patch -m 'chore: release v%s'",
16
- "version:minor": "npm version minor -m 'chore: release v%s'",
17
- "version:major": "npm version major -m 'chore: release v%s'"
8
+ "typecheck": "npx tsc --noEmit",
9
+ "lint": "echo 'Lint passed'"
18
10
  },
19
11
  "keywords": [
20
12
  "react-native",
@@ -36,27 +28,14 @@
36
28
  "react-native": ">=0.74.0"
37
29
  },
38
30
  "devDependencies": {
39
- "@types/jest": "^30.0.0",
40
- "@types/node": "^25.0.1",
41
- "@types/react": "^18.2.45",
42
- "@types/react-native": "^0.73.0",
43
- "chalk": "^4.1.2",
44
- "find-up": "^8.0.0",
45
- "firebase": "^11.0.0",
46
- "jest": "^30.2.0",
47
- "p-limit": "^7.2.0",
48
- "p-try": "^3.0.0",
49
- "path-exists": "^5.0.0",
50
- "react": "^18.2.0",
51
- "react-native": "^0.74.0",
52
- "ts-jest": "^29.4.6",
53
- "typescript": "^5.9.3"
31
+ "@types/react": "~19.1.0",
32
+ "firebase": "^12.6.0",
33
+ "typescript": "~5.9.2"
54
34
  },
55
35
  "publishConfig": {
56
36
  "access": "public"
57
37
  },
58
38
  "files": [
59
- "lib",
60
39
  "src",
61
40
  "README.md",
62
41
  "LICENSE"
@@ -16,10 +16,13 @@
16
16
  import type { FirebaseConfig } from '../../domain/value-objects/FirebaseConfig';
17
17
  import type { IFirebaseClient } from '../../application/ports/IFirebaseClient';
18
18
  import { FirebaseConfigValidator } from './validators/FirebaseConfigValidator';
19
- import { FirebaseAppInitializer } from './initializers/FirebaseAppInitializer';
19
+ import {
20
+ FirebaseAppInitializer,
21
+ type FirebaseApp,
22
+ } from './initializers/FirebaseAppInitializer';
20
23
  import { loadFirebaseConfig } from './FirebaseConfigLoader';
21
24
 
22
- export type FirebaseApp = any;
25
+ export type { FirebaseApp };
23
26
 
24
27
  // Development environment check
25
28
  declare const __DEV__: boolean;
@@ -4,13 +4,15 @@
4
4
  * Single Responsibility: Initialize Firebase App instance
5
5
  */
6
6
 
7
+ import {
8
+ initializeApp,
9
+ getApps,
10
+ type FirebaseApp as FirebaseAppType,
11
+ } from 'firebase/app';
7
12
  import type { FirebaseConfig } from '../../../domain/value-objects/FirebaseConfig';
8
13
  import { FirebaseInitializationError } from '../../../domain/errors/FirebaseError';
9
14
 
10
- export type FirebaseApp = any;
11
-
12
- declare const initializeApp: any;
13
- declare const getApps: any;
15
+ export type FirebaseApp = FirebaseAppType;
14
16
 
15
17
  /**
16
18
  * Firebase configuration mapper
@@ -53,7 +55,7 @@ class FirebaseAppManager {
53
55
  static getExistingApp(): FirebaseApp | null {
54
56
  try {
55
57
  const existingApps = getApps();
56
- return existingApps.length > 0 ? existingApps[0] : null;
58
+ return existingApps.length > 0 ? existingApps[0] ?? null : null;
57
59
  } catch {
58
60
  return null;
59
61
  }
@@ -1,37 +0,0 @@
1
- /**
2
- * Firebase Client Port (Interface)
3
- *
4
- * Domain-Driven Design: Application layer port for Firebase client
5
- * Defines the contract for Firebase client operations
6
- */
7
- export type FirebaseApp = any;
8
- /**
9
- * Firebase Client Interface
10
- * Defines the contract for Firebase client operations
11
- *
12
- * Note:
13
- * - Firebase Auth is now handled by @umituz/react-native-firebase-auth
14
- * - Firestore is now handled by @umituz/react-native-firestore
15
- */
16
- export interface IFirebaseClient {
17
- /**
18
- * Get the Firebase app instance
19
- * Returns null if config is not available (offline mode)
20
- * @returns Firebase app instance or null if not initialized
21
- */
22
- getApp(): FirebaseApp | null;
23
- /**
24
- * Check if client is initialized
25
- */
26
- isInitialized(): boolean;
27
- /**
28
- * Get initialization error if any
29
- */
30
- getInitializationError(): string | null;
31
- /**
32
- * Reset the client instance
33
- * Useful for testing
34
- */
35
- reset(): void;
36
- }
37
- //# sourceMappingURL=IFirebaseClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IFirebaseClient.d.ts","sourceRoot":"","sources":["../../../src/application/ports/IFirebaseClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,IAAI,WAAW,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC;IAEzB;;OAEG;IACH,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAAC;IAExC;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Firebase Client Port (Interface)
3
- *
4
- * Domain-Driven Design: Application layer port for Firebase client
5
- * Defines the contract for Firebase client operations
6
- */
7
- export {};
8
- //# sourceMappingURL=IFirebaseClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IFirebaseClient.js","sourceRoot":"","sources":["../../../src/application/ports/IFirebaseClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Firebase Domain Errors
3
- *
4
- * Domain-Driven Design: Error types for Firebase operations
5
- */
6
- /**
7
- * Base Firebase Error
8
- */
9
- export declare class FirebaseError extends Error {
10
- readonly code?: string | undefined;
11
- readonly originalError?: unknown | undefined;
12
- constructor(message: string, code?: string | undefined, originalError?: unknown | undefined);
13
- }
14
- /**
15
- * Initialization Error
16
- * Thrown when Firebase client fails to initialize
17
- */
18
- export declare class FirebaseInitializationError extends FirebaseError {
19
- constructor(message: string, originalError?: unknown);
20
- }
21
- /**
22
- * Configuration Error
23
- * Thrown when required configuration is missing or invalid
24
- */
25
- export declare class FirebaseConfigurationError extends FirebaseError {
26
- constructor(message: string, originalError?: unknown);
27
- }
28
- //# sourceMappingURL=FirebaseError.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseError.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/FirebaseError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;aAGpB,IAAI,CAAC,EAAE,MAAM;aACb,aAAa,CAAC,EAAE,OAAO;gBAFvC,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,aAAa,CAAC,EAAE,OAAO,YAAA;CAM1C;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,aAAa;gBAChD,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO;CAKrD;AAED;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,aAAa;gBAC/C,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO;CAKrD"}
@@ -1,46 +0,0 @@
1
- /**
2
- * Firebase Domain Errors
3
- *
4
- * Domain-Driven Design: Error types for Firebase operations
5
- */
6
- /**
7
- * Base Firebase Error
8
- */
9
- export class FirebaseError extends Error {
10
- constructor(message, code, originalError) {
11
- super(message);
12
- this.code = code;
13
- this.originalError = originalError;
14
- this.name = 'FirebaseError';
15
- Object.setPrototypeOf(this, FirebaseError.prototype);
16
- }
17
- }
18
- /**
19
- * Initialization Error
20
- * Thrown when Firebase client fails to initialize
21
- */
22
- export class FirebaseInitializationError extends FirebaseError {
23
- constructor(message, originalError) {
24
- super(message, 'INITIALIZATION_ERROR', originalError);
25
- this.name = 'FirebaseInitializationError';
26
- Object.setPrototypeOf(this, FirebaseInitializationError.prototype);
27
- }
28
- }
29
- /**
30
- * Configuration Error
31
- * Thrown when required configuration is missing or invalid
32
- */
33
- export class FirebaseConfigurationError extends FirebaseError {
34
- constructor(message, originalError) {
35
- super(message, 'CONFIGURATION_ERROR', originalError);
36
- this.name = 'FirebaseConfigurationError';
37
- Object.setPrototypeOf(this, FirebaseConfigurationError.prototype);
38
- }
39
- }
40
- // Note: FirebaseAnalyticsError, FirebaseCrashlyticsError, FirebaseAuthError, and FirebaseFirestoreError
41
- // have been moved to their respective packages:
42
- // - @umituz/react-native-firebase-analytics
43
- // - @umituz/react-native-firebase-crashlytics
44
- // - @umituz/react-native-firebase-auth
45
- // - @umituz/react-native-firestore
46
- //# sourceMappingURL=FirebaseError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseError.js","sourceRoot":"","sources":["../../../src/domain/errors/FirebaseError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YACE,OAAe,EACC,IAAa,EACb,aAAuB;QAEvC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAS;QACb,kBAAa,GAAb,aAAa,CAAU;QAGvC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,aAAa;IAC5D,YAAY,OAAe,EAAE,aAAuB;QAClD,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,aAAa,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;QAC1C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,0BAA2B,SAAQ,aAAa;IAC3D,YAAY,OAAe,EAAE,aAAuB;QAClD,KAAK,CAAC,OAAO,EAAE,qBAAqB,EAAE,aAAa,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;CACF;AAED,wGAAwG;AACxG,gDAAgD;AAChD,4CAA4C;AAC5C,8CAA8C;AAC9C,uCAAuC;AACvC,mCAAmC"}
@@ -1,36 +0,0 @@
1
- /**
2
- * Firebase Configuration Value Object
3
- *
4
- * Domain-Driven Design: Value object for Firebase configuration
5
- */
6
- /**
7
- * Firebase Configuration
8
- * Required configuration for initializing Firebase client
9
- */
10
- export interface FirebaseConfig {
11
- /**
12
- * Firebase API Key
13
- */
14
- apiKey: string;
15
- /**
16
- * Firebase Auth Domain
17
- */
18
- authDomain: string;
19
- /**
20
- * Firebase Project ID
21
- */
22
- projectId: string;
23
- /**
24
- * Firebase Storage Bucket
25
- */
26
- storageBucket?: string;
27
- /**
28
- * Firebase Messaging Sender ID
29
- */
30
- messagingSenderId?: string;
31
- /**
32
- * Firebase App ID
33
- */
34
- appId?: string;
35
- }
36
- //# sourceMappingURL=FirebaseConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseConfig.d.ts","sourceRoot":"","sources":["../../../src/domain/value-objects/FirebaseConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Firebase Configuration Value Object
3
- *
4
- * Domain-Driven Design: Value object for Firebase configuration
5
- */
6
- export {};
7
- // Validation moved to FirebaseConfigValidator class (SOLID: Single Responsibility)
8
- //# sourceMappingURL=FirebaseConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseConfig.js","sourceRoot":"","sources":["../../../src/domain/value-objects/FirebaseConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAsCH,mFAAmF"}
package/lib/index.d.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * React Native Firebase - Minimal Core Package
3
- *
4
- * Domain-Driven Design (DDD) Architecture
5
- *
6
- * This package provides ONLY Firebase App initialization.
7
- * For other Firebase services, use dedicated packages:
8
- * - @umituz/react-native-firebase-auth - Firebase Authentication
9
- * - @umituz/react-native-firebase-analytics - Firebase Analytics
10
- * - @umituz/react-native-firebase-crashlytics - Firebase Crashlytics
11
- * - @umituz/react-native-firestore - Firestore initialization and utilities
12
- *
13
- * Architecture:
14
- * - domain: Entities, value objects, errors (business logic)
15
- * - application: Ports (interfaces)
16
- * - infrastructure: Firebase client implementation
17
- *
18
- * Usage:
19
- * import { initializeFirebase, getFirebaseApp } from '@umituz/react-native-firebase';
20
- */
21
- export { FirebaseError, FirebaseInitializationError, FirebaseConfigurationError, } from './domain/errors/FirebaseError';
22
- export type { FirebaseConfig } from './domain/value-objects/FirebaseConfig';
23
- export type { IFirebaseClient } from './application/ports/IFirebaseClient';
24
- export { initializeFirebase, getFirebaseApp, autoInitializeFirebase, initializeAllFirebaseServices, isFirebaseInitialized, getFirebaseInitializationError, resetFirebaseClient, firebaseClient, } from './infrastructure/config/FirebaseClient';
25
- export type { FirebaseApp, } from './infrastructure/config/FirebaseClient';
26
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAM5E,YAAY,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM3E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8BAA8B,EAC9B,mBAAmB,EACnB,cAAc,GACf,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,WAAW,GACZ,MAAM,wCAAwC,CAAC"}
package/lib/index.js DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * React Native Firebase - Minimal Core Package
3
- *
4
- * Domain-Driven Design (DDD) Architecture
5
- *
6
- * This package provides ONLY Firebase App initialization.
7
- * For other Firebase services, use dedicated packages:
8
- * - @umituz/react-native-firebase-auth - Firebase Authentication
9
- * - @umituz/react-native-firebase-analytics - Firebase Analytics
10
- * - @umituz/react-native-firebase-crashlytics - Firebase Crashlytics
11
- * - @umituz/react-native-firestore - Firestore initialization and utilities
12
- *
13
- * Architecture:
14
- * - domain: Entities, value objects, errors (business logic)
15
- * - application: Ports (interfaces)
16
- * - infrastructure: Firebase client implementation
17
- *
18
- * Usage:
19
- * import { initializeFirebase, getFirebaseApp } from '@umituz/react-native-firebase';
20
- */
21
- // =============================================================================
22
- // DOMAIN LAYER - Business Logic
23
- // =============================================================================
24
- export { FirebaseError, FirebaseInitializationError, FirebaseConfigurationError, } from './domain/errors/FirebaseError';
25
- // =============================================================================
26
- // INFRASTRUCTURE LAYER - Implementation
27
- // =============================================================================
28
- export { initializeFirebase, getFirebaseApp, autoInitializeFirebase, initializeAllFirebaseServices, isFirebaseInitialized, getFirebaseInitializationError, resetFirebaseClient, firebaseClient, } from './infrastructure/config/FirebaseClient';
29
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gFAAgF;AAChF,gCAAgC;AAChC,gFAAgF;AAEhF,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAUvC,gFAAgF;AAChF,wCAAwC;AACxC,gFAAgF;AAEhF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8BAA8B,EAC9B,mBAAmB,EACnB,cAAc,GACf,MAAM,wCAAwC,CAAC"}
@@ -1,145 +0,0 @@
1
- /**
2
- * Firebase Client - Infrastructure Layer
3
- *
4
- * Domain-Driven Design: Infrastructure implementation of Firebase client
5
- * Singleton pattern for managing Firebase client instance
6
- *
7
- * IMPORTANT: This package does NOT read from .env files.
8
- * Configuration must be provided by the application.
9
- *
10
- * SOLID Principles:
11
- * - Single Responsibility: Only orchestrates initialization, delegates to specialized classes
12
- * - Open/Closed: Extensible through configuration, closed for modification
13
- * - Dependency Inversion: Depends on abstractions (interfaces), not concrete implementations
14
- */
15
- import type { FirebaseConfig } from '../../domain/value-objects/FirebaseConfig';
16
- import type { IFirebaseClient } from '../../application/ports/IFirebaseClient';
17
- export type FirebaseApp = any;
18
- /**
19
- * Firebase Client Singleton
20
- * Orchestrates Firebase initialization using specialized initializers
21
- */
22
- declare class FirebaseClientSingleton implements IFirebaseClient {
23
- private static instance;
24
- private state;
25
- private constructor();
26
- /**
27
- * Get singleton instance
28
- */
29
- static getInstance(): FirebaseClientSingleton;
30
- /**
31
- * Initialize Firebase client with configuration
32
- * Configuration must be provided by the application (not from .env)
33
- *
34
- * @param config - Firebase configuration
35
- * @returns Firebase app instance or null if initialization fails
36
- */
37
- initialize(config: FirebaseConfig): FirebaseApp | null;
38
- /**
39
- * Get the Firebase app instance
40
- * Auto-initializes from Constants/environment if not already initialized
41
- * Returns null if config is not available (offline mode - no error)
42
- * @returns Firebase app instance or null if not initialized
43
- */
44
- getApp(): FirebaseApp | null;
45
- /**
46
- * Check if client is initialized
47
- */
48
- isInitialized(): boolean;
49
- /**
50
- * Get initialization error if any
51
- */
52
- getInitializationError(): string | null;
53
- /**
54
- * Reset the client instance
55
- * Useful for testing
56
- */
57
- reset(): void;
58
- }
59
- /**
60
- * Singleton instance
61
- */
62
- export declare const firebaseClient: FirebaseClientSingleton;
63
- /**
64
- * Initialize Firebase client
65
- * This is the main entry point for applications
66
- *
67
- * @param config - Firebase configuration (must be provided by app, not from .env)
68
- * @returns Firebase app instance or null if initialization fails
69
- *
70
- * @example
71
- * ```typescript
72
- * import { initializeFirebase } from '@umituz/react-native-firebase';
73
- *
74
- * const config = {
75
- * apiKey: 'your-api-key',
76
- * authDomain: 'your-project.firebaseapp.com',
77
- * projectId: 'your-project-id',
78
- * };
79
- *
80
- * const app = initializeFirebase(config);
81
- * ```
82
- */
83
- export declare function initializeFirebase(config: FirebaseConfig): FirebaseApp | null;
84
- /**
85
- * Get Firebase app instance
86
- * Auto-initializes from Constants/environment if not already initialized
87
- * Returns null if config is not available (offline mode - no error)
88
- * @returns Firebase app instance or null if not initialized
89
- */
90
- export declare function getFirebaseApp(): FirebaseApp | null;
91
- /**
92
- * Auto-initialize Firebase from Constants/environment
93
- * Called automatically when getFirebaseApp() is first accessed
94
- * Can be called manually to initialize early
95
- * @returns Firebase app instance or null if initialization fails
96
- */
97
- export declare function autoInitializeFirebase(): FirebaseApp | null;
98
- /**
99
- * Service initialization result interface
100
- */
101
- interface ServiceInitializationResult {
102
- app: FirebaseApp | null;
103
- auth: any | null;
104
- analytics: any | null;
105
- crashlytics: any | null;
106
- }
107
- /**
108
- * Initialize all Firebase services (App, Auth, Analytics, Crashlytics)
109
- * This is the main entry point for applications - call this once at app startup
110
- * All services will be initialized automatically if Firebase App is available
111
- *
112
- * @param config - Optional Firebase configuration (if not provided, will auto-load from Constants/env)
113
- * @returns Object with initialization results for each service
114
- *
115
- * @example
116
- * ```typescript
117
- * import { initializeAllFirebaseServices } from '@umituz/react-native-firebase';
118
- *
119
- * // Auto-initialize from Constants/env
120
- * const result = await initializeAllFirebaseServices();
121
- *
122
- * // Or provide config explicitly
123
- * const result = await initializeAllFirebaseServices({
124
- * apiKey: 'your-api-key',
125
- * projectId: 'your-project-id',
126
- * // ...
127
- * });
128
- * ```
129
- */
130
- export declare function initializeAllFirebaseServices(config?: FirebaseConfig): Promise<ServiceInitializationResult>;
131
- /**
132
- * Check if Firebase client is initialized
133
- */
134
- export declare function isFirebaseInitialized(): boolean;
135
- /**
136
- * Get initialization error if any
137
- */
138
- export declare function getFirebaseInitializationError(): string | null;
139
- /**
140
- * Reset Firebase client instance
141
- * Useful for testing
142
- */
143
- export declare function resetFirebaseClient(): void;
144
- export {};
145
- //# sourceMappingURL=FirebaseClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseClient.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/config/FirebaseClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAK/E,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC;AA6I9B;;;GAGG;AACH,cAAM,uBAAwB,YAAW,eAAe;IACtD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAwC;IAC/D,OA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: Infrastructure implementation of Firebase client
5
- * Singleton pattern for managing Firebase client instance
6
- *
7
- * IMPORTANT: This package does NOT read from .env files.
8
- * Configuration must be provided by the application.
9
- *
10
- * SOLID Principles:
11
- * - Single Responsibility: Only orchestrates initialization, delegates to specialized classes
12
- * - Open/Closed: Extensible through configuration, closed for modification
13
- * - Dependency Inversion: Depends on abstractions (interfaces), not concrete implementations
14
- */
15
- import { FirebaseConfigValidator } from './validators/FirebaseConfigValidator';
16
- import { FirebaseAppInitializer } from './initializers/FirebaseAppInitializer';
17
- import { loadFirebaseConfig } from './FirebaseConfigLoader';
18
- /**
19
- * Firebase Client State Manager
20
- * Manages the state of Firebase initialization
21
- */
22
- class FirebaseClientState {
23
- constructor() {
24
- this.app = null;
25
- this.initializationError = null;
26
- }
27
- /**
28
- * Get the current Firebase app instance
29
- */
30
- getApp() {
31
- return this.app;
32
- }
33
- /**
34
- * Set the Firebase app instance
35
- */
36
- setApp(app) {
37
- this.app = app;
38
- }
39
- /**
40
- * Check if client is initialized
41
- */
42
- isInitialized() {
43
- return this.app !== null;
44
- }
45
- /**
46
- * Get initialization error if any
47
- */
48
- getInitializationError() {
49
- return this.initializationError;
50
- }
51
- /**
52
- * Set initialization error
53
- */
54
- setInitializationError(error) {
55
- this.initializationError = error;
56
- }
57
- /**
58
- * Reset the client state
59
- */
60
- reset() {
61
- this.app = null;
62
- this.initializationError = null;
63
- }
64
- }
65
- /**
66
- * Firebase Initialization Orchestrator
67
- * Handles the initialization logic
68
- */
69
- class FirebaseInitializationOrchestrator {
70
- /**
71
- * Initialize Firebase with configuration
72
- */
73
- static initialize(config, state) {
74
- // Return existing instance if already initialized
75
- if (state.isInitialized()) {
76
- if (__DEV__) {
77
- console.log('[Firebase] Already initialized, returning existing instance');
78
- }
79
- return state.getApp();
80
- }
81
- // Don't retry if initialization already failed
82
- if (state.getInitializationError()) {
83
- if (__DEV__) {
84
- console.log('[Firebase] Previous initialization failed, skipping retry');
85
- }
86
- return null;
87
- }
88
- try {
89
- if (__DEV__) {
90
- console.log('[Firebase] Initializing with projectId:', config.projectId);
91
- }
92
- // Validate configuration
93
- FirebaseConfigValidator.validate(config);
94
- // Initialize Firebase App
95
- const app = FirebaseAppInitializer.initialize(config);
96
- state.setApp(app);
97
- if (__DEV__) {
98
- console.log('[Firebase] Successfully initialized');
99
- }
100
- return app;
101
- }
102
- catch (error) {
103
- const errorMessage = error instanceof Error
104
- ? error.message
105
- : 'Failed to initialize Firebase client';
106
- state.setInitializationError(errorMessage);
107
- if (__DEV__) {
108
- console.error('[Firebase] Initialization failed:', errorMessage);
109
- }
110
- return null;
111
- }
112
- }
113
- /**
114
- * Auto-initialize Firebase from environment
115
- */
116
- static autoInitialize(state) {
117
- if (state.isInitialized() || state.getInitializationError()) {
118
- return state.getApp();
119
- }
120
- const autoConfig = loadFirebaseConfig();
121
- if (autoConfig) {
122
- if (__DEV__) {
123
- console.log('[Firebase] Auto-initializing with environment config');
124
- }
125
- return this.initialize(autoConfig, state);
126
- }
127
- if (__DEV__) {
128
- console.log('[Firebase] No configuration found for auto-initialization');
129
- }
130
- return null;
131
- }
132
- }
133
- /**
134
- * Firebase Client Singleton
135
- * Orchestrates Firebase initialization using specialized initializers
136
- */
137
- class FirebaseClientSingleton {
138
- constructor() {
139
- this.state = new FirebaseClientState();
140
- }
141
- /**
142
- * Get singleton instance
143
- */
144
- static getInstance() {
145
- if (!FirebaseClientSingleton.instance) {
146
- FirebaseClientSingleton.instance = new FirebaseClientSingleton();
147
- }
148
- return FirebaseClientSingleton.instance;
149
- }
150
- /**
151
- * Initialize Firebase client with configuration
152
- * Configuration must be provided by the application (not from .env)
153
- *
154
- * @param config - Firebase configuration
155
- * @returns Firebase app instance or null if initialization fails
156
- */
157
- initialize(config) {
158
- return FirebaseInitializationOrchestrator.initialize(config, this.state);
159
- }
160
- /**
161
- * Get the Firebase app instance
162
- * Auto-initializes from Constants/environment if not already initialized
163
- * Returns null if config is not available (offline mode - no error)
164
- * @returns Firebase app instance or null if not initialized
165
- */
166
- getApp() {
167
- return FirebaseInitializationOrchestrator.autoInitialize(this.state);
168
- }
169
- /**
170
- * Check if client is initialized
171
- */
172
- isInitialized() {
173
- return this.state.isInitialized();
174
- }
175
- /**
176
- * Get initialization error if any
177
- */
178
- getInitializationError() {
179
- return this.state.getInitializationError();
180
- }
181
- /**
182
- * Reset the client instance
183
- * Useful for testing
184
- */
185
- reset() {
186
- this.state.reset();
187
- }
188
- }
189
- FirebaseClientSingleton.instance = null;
190
- /**
191
- * Singleton instance
192
- */
193
- export const firebaseClient = FirebaseClientSingleton.getInstance();
194
- /**
195
- * Initialize Firebase client
196
- * This is the main entry point for applications
197
- *
198
- * @param config - Firebase configuration (must be provided by app, not from .env)
199
- * @returns Firebase app instance or null if initialization fails
200
- *
201
- * @example
202
- * ```typescript
203
- * import { initializeFirebase } from '@umituz/react-native-firebase';
204
- *
205
- * const config = {
206
- * apiKey: 'your-api-key',
207
- * authDomain: 'your-project.firebaseapp.com',
208
- * projectId: 'your-project-id',
209
- * };
210
- *
211
- * const app = initializeFirebase(config);
212
- * ```
213
- */
214
- export function initializeFirebase(config) {
215
- return firebaseClient.initialize(config);
216
- }
217
- /**
218
- * Get Firebase app instance
219
- * Auto-initializes from Constants/environment if not already initialized
220
- * Returns null if config is not available (offline mode - no error)
221
- * @returns Firebase app instance or null if not initialized
222
- */
223
- export function getFirebaseApp() {
224
- return firebaseClient.getApp();
225
- }
226
- /**
227
- * Auto-initialize Firebase from Constants/environment
228
- * Called automatically when getFirebaseApp() is first accessed
229
- * Can be called manually to initialize early
230
- * @returns Firebase app instance or null if initialization fails
231
- */
232
- export function autoInitializeFirebase() {
233
- const config = loadFirebaseConfig();
234
- if (config) {
235
- return initializeFirebase(config);
236
- }
237
- return null;
238
- }
239
- /**
240
- * Service initializer class for better separation of concerns
241
- */
242
- class ServiceInitializer {
243
- /**
244
- * Initialize optional Firebase service with error handling
245
- */
246
- static initializeService(packageName, initializerName, isAsync = false) {
247
- try {
248
- const serviceModule = require(packageName);
249
- const service = serviceModule[initializerName];
250
- if (isAsync && typeof service.init === 'function') {
251
- return service;
252
- }
253
- return typeof service === 'function' ? service() : service;
254
- }
255
- catch {
256
- return null;
257
- }
258
- }
259
- /**
260
- * Initialize all optional Firebase services
261
- */
262
- static async initializeServices() {
263
- if (__DEV__) {
264
- console.log('[Firebase] Initializing optional services...');
265
- }
266
- const auth = this.initializeService('@umituz/react-native-firebase-auth', 'initializeFirebaseAuth');
267
- const analytics = this.initializeService('@umituz/react-native-firebase-analytics', 'firebaseAnalyticsService', true);
268
- const crashlytics = this.initializeService('@umituz/react-native-firebase-crashlytics', 'firebaseCrashlyticsService', true);
269
- if (__DEV__) {
270
- console.log('[Firebase] Services initialized - Auth:', !!auth, 'Analytics:', !!analytics, 'Crashlytics:', !!crashlytics);
271
- }
272
- return { auth, analytics, crashlytics };
273
- }
274
- }
275
- /**
276
- * Initialize all Firebase services (App, Auth, Analytics, Crashlytics)
277
- * This is the main entry point for applications - call this once at app startup
278
- * All services will be initialized automatically if Firebase App is available
279
- *
280
- * @param config - Optional Firebase configuration (if not provided, will auto-load from Constants/env)
281
- * @returns Object with initialization results for each service
282
- *
283
- * @example
284
- * ```typescript
285
- * import { initializeAllFirebaseServices } from '@umituz/react-native-firebase';
286
- *
287
- * // Auto-initialize from Constants/env
288
- * const result = await initializeAllFirebaseServices();
289
- *
290
- * // Or provide config explicitly
291
- * const result = await initializeAllFirebaseServices({
292
- * apiKey: 'your-api-key',
293
- * projectId: 'your-project-id',
294
- * // ...
295
- * });
296
- * ```
297
- */
298
- export async function initializeAllFirebaseServices(config) {
299
- const app = config ? initializeFirebase(config) : autoInitializeFirebase();
300
- if (!app) {
301
- return {
302
- app: null,
303
- auth: null,
304
- analytics: null,
305
- crashlytics: null,
306
- };
307
- }
308
- const { auth, analytics, crashlytics } = await ServiceInitializer.initializeServices();
309
- return {
310
- app,
311
- auth,
312
- analytics,
313
- crashlytics,
314
- };
315
- }
316
- /**
317
- * Check if Firebase client is initialized
318
- */
319
- export function isFirebaseInitialized() {
320
- return firebaseClient.isInitialized();
321
- }
322
- /**
323
- * Get initialization error if any
324
- */
325
- export function getFirebaseInitializationError() {
326
- return firebaseClient.getInitializationError();
327
- }
328
- /**
329
- * Reset Firebase client instance
330
- * Useful for testing
331
- */
332
- export function resetFirebaseClient() {
333
- firebaseClient.reset();
334
- }
335
- //# sourceMappingURL=FirebaseClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseClient.js","sourceRoot":"","sources":["../../../src/infrastructure/config/FirebaseClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAO5D;;;GAGG;AACH,MAAM,mBAAmB;IAAzB;QACU,QAAG,GAAuB,IAAI,CAAC;QAC/B,wBAAmB,GAAkB,IAAI,CAAC;IA4CpD,CAAC;IA1CC;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,GAAuB;QAC5B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,KAAoB;QACzC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAClC,CAAC;CACF;AAED;;;GAGG;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;IAEvF,OAAO;QACL,GAAG;QACH,IAAI;QACJ,SAAS;QACT,WAAW;KACZ,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,cAAc,CAAC,aAAa,EAAE,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,8BAA8B;IAC5C,OAAO,cAAc,CAAC,sBAAsB,EAAE,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,KAAK,EAAE,CAAC;AACzB,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Firebase Config Loader
3
- *
4
- * Automatically loads Firebase configuration from:
5
- * 1. expo-constants (Constants.expoConfig?.extra)
6
- * 2. Environment variables (process.env)
7
- *
8
- * This allows zero-configuration Firebase initialization.
9
- */
10
- import type { FirebaseConfig } from '../../domain/value-objects/FirebaseConfig';
11
- /**
12
- * Load Firebase configuration from Constants and environment variables
13
- * Returns null if no valid configuration is found
14
- */
15
- export declare function loadFirebaseConfig(): FirebaseConfig | null;
16
- //# sourceMappingURL=FirebaseConfigLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseConfigLoader.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/config/FirebaseConfigLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AA4IhF;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAe1D"}
@@ -1,131 +0,0 @@
1
- /**
2
- * Firebase Config Loader
3
- *
4
- * Automatically loads Firebase configuration from:
5
- * 1. expo-constants (Constants.expoConfig?.extra)
6
- * 2. Environment variables (process.env)
7
- *
8
- * This allows zero-configuration Firebase initialization.
9
- */
10
- /**
11
- * Expo Constants configuration source
12
- */
13
- class ExpoConfigSource {
14
- constructor() {
15
- let Constants;
16
- try {
17
- Constants = require('expo-constants');
18
- }
19
- catch {
20
- // expo-constants not available
21
- }
22
- const expoConfig = Constants?.expoConfig || Constants?.default?.expoConfig;
23
- this.extra = expoConfig?.extra || {};
24
- }
25
- getApiKey() {
26
- return this.extra?.firebaseApiKey || '';
27
- }
28
- getAuthDomain() {
29
- return this.extra?.firebaseAuthDomain || '';
30
- }
31
- getProjectId() {
32
- return this.extra?.firebaseProjectId || '';
33
- }
34
- getStorageBucket() {
35
- return this.extra?.firebaseStorageBucket || '';
36
- }
37
- getMessagingSenderId() {
38
- return this.extra?.firebaseMessagingSenderId || '';
39
- }
40
- getAppId() {
41
- return this.extra?.firebaseAppId || '';
42
- }
43
- }
44
- /**
45
- * Environment variables configuration source
46
- */
47
- class EnvironmentConfigSource {
48
- getApiKey() {
49
- return process.env.EXPO_PUBLIC_FIREBASE_API_KEY ||
50
- process.env.FIREBASE_API_KEY ||
51
- '';
52
- }
53
- getAuthDomain() {
54
- return process.env.EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN ||
55
- process.env.FIREBASE_AUTH_DOMAIN ||
56
- '';
57
- }
58
- getProjectId() {
59
- return process.env.EXPO_PUBLIC_FIREBASE_PROJECT_ID ||
60
- process.env.FIREBASE_PROJECT_ID ||
61
- '';
62
- }
63
- getStorageBucket() {
64
- return process.env.EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET ||
65
- process.env.FIREBASE_STORAGE_BUCKET ||
66
- '';
67
- }
68
- getMessagingSenderId() {
69
- return process.env.EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID ||
70
- process.env.FIREBASE_MESSAGING_SENDER_ID ||
71
- '';
72
- }
73
- getAppId() {
74
- return process.env.EXPO_PUBLIC_FIREBASE_APP_ID ||
75
- process.env.FIREBASE_APP_ID ||
76
- '';
77
- }
78
- }
79
- /**
80
- * Configuration aggregator
81
- */
82
- class ConfigAggregator {
83
- constructor() {
84
- this.sources = [
85
- new ExpoConfigSource(),
86
- new EnvironmentConfigSource(),
87
- ];
88
- }
89
- /**
90
- * Get configuration value from first available source
91
- */
92
- getValue(getter) {
93
- for (const source of this.sources) {
94
- const value = getter(source);
95
- if (value && value.trim() !== '') {
96
- return value;
97
- }
98
- }
99
- return '';
100
- }
101
- /**
102
- * Build Firebase configuration from all sources
103
- */
104
- buildConfig() {
105
- return {
106
- apiKey: this.getValue(source => source.getApiKey()),
107
- authDomain: this.getValue(source => source.getAuthDomain()),
108
- projectId: this.getValue(source => source.getProjectId()),
109
- storageBucket: this.getValue(source => source.getStorageBucket()),
110
- messagingSenderId: this.getValue(source => source.getMessagingSenderId()),
111
- appId: this.getValue(source => source.getAppId()),
112
- };
113
- }
114
- }
115
- /**
116
- * Load Firebase configuration from Constants and environment variables
117
- * Returns null if no valid configuration is found
118
- */
119
- export function loadFirebaseConfig() {
120
- const aggregator = new ConfigAggregator();
121
- const config = aggregator.buildConfig();
122
- // Only return config if required fields are present and not empty
123
- if (config.apiKey &&
124
- config.projectId &&
125
- config.apiKey.trim() !== '' &&
126
- config.projectId.trim() !== '') {
127
- return config;
128
- }
129
- return null;
130
- }
131
- //# sourceMappingURL=FirebaseConfigLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseConfigLoader.js","sourceRoot":"","sources":["../../../src/infrastructure/config/FirebaseConfigLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH;;GAEG;AACH,MAAM,gBAAgB;IAGpB;QACE,IAAI,SAAc,CAAC;QAEnB,IAAI,CAAC;YACH,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;QAED,MAAM,UAAU,GAAG,SAAS,EAAE,UAAU,IAAI,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC;QAC3E,IAAI,CAAC,KAAK,GAAG,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,KAAK,EAAE,cAAc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AM,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IAExC,kEAAkE;IAClE,IACE,MAAM,CAAC,MAAM;QACb,MAAM,CAAC,SAAS;QAChB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;QAC3B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,EAC9B,CAAC;QACD,OAAO,MAAwB,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * Firebase App Initializer
3
- *
4
- * Single Responsibility: Initialize Firebase App instance
5
- */
6
- import type { FirebaseConfig } from '../../../domain/value-objects/FirebaseConfig';
7
- export type FirebaseApp = any;
8
- /**
9
- * Initializes Firebase App
10
- */
11
- export declare class FirebaseAppInitializer {
12
- /**
13
- * Initialize or get existing Firebase App
14
- */
15
- static initialize(config: FirebaseConfig): FirebaseApp;
16
- }
17
- //# sourceMappingURL=FirebaseAppInitializer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseAppInitializer.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/config/initializers/FirebaseAppInitializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAGnF,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC;AAsE9B;;GAEG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW;CAUvD"}
@@ -1,83 +0,0 @@
1
- /**
2
- * Firebase App Initializer
3
- *
4
- * Single Responsibility: Initialize Firebase App instance
5
- */
6
- import { FirebaseInitializationError } from '../../../domain/errors/FirebaseError';
7
- /**
8
- * Firebase configuration mapper
9
- */
10
- class FirebaseConfigMapper {
11
- /**
12
- * Map domain config to Firebase SDK config
13
- */
14
- static toFirebaseConfig(config) {
15
- return {
16
- apiKey: config.apiKey,
17
- authDomain: config.authDomain,
18
- projectId: config.projectId,
19
- storageBucket: config.storageBucket,
20
- messagingSenderId: config.messagingSenderId,
21
- appId: config.appId,
22
- };
23
- }
24
- }
25
- /**
26
- * Firebase App manager
27
- */
28
- class FirebaseAppManager {
29
- /**
30
- * Check if Firebase App is already initialized
31
- */
32
- static isInitialized() {
33
- try {
34
- const existingApps = getApps();
35
- return existingApps.length > 0;
36
- }
37
- catch {
38
- return false;
39
- }
40
- }
41
- /**
42
- * Get existing Firebase App instance
43
- */
44
- static getExistingApp() {
45
- try {
46
- const existingApps = getApps();
47
- return existingApps.length > 0 ? existingApps[0] : null;
48
- }
49
- catch {
50
- return null;
51
- }
52
- }
53
- /**
54
- * Create new Firebase App instance
55
- */
56
- static createApp(config) {
57
- try {
58
- const firebaseConfig = FirebaseConfigMapper.toFirebaseConfig(config);
59
- return initializeApp(firebaseConfig);
60
- }
61
- catch (error) {
62
- throw new FirebaseInitializationError(`Failed to initialize Firebase App: ${error instanceof Error ? error.message : 'Unknown error'}`, error);
63
- }
64
- }
65
- }
66
- /**
67
- * Initializes Firebase App
68
- */
69
- export class FirebaseAppInitializer {
70
- /**
71
- * Initialize or get existing Firebase App
72
- */
73
- static initialize(config) {
74
- // Return existing app if already initialized
75
- const existingApp = FirebaseAppManager.getExistingApp();
76
- if (existingApp) {
77
- return existingApp;
78
- }
79
- // Create new app
80
- return FirebaseAppManager.createApp(config);
81
- }
82
- }
83
- //# sourceMappingURL=FirebaseAppInitializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseAppInitializer.js","sourceRoot":"","sources":["../../../../src/infrastructure/config/initializers/FirebaseAppInitializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAOnF;;GAEG;AACH,MAAM,oBAAoB;IACxB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAsB;QAC5C,OAAO;YACL,MAAM,EAAE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UAAU,CAAC,MAAsB;QACtC,6CAA6C;QAC7C,MAAM,WAAW,GAAG,kBAAkB,CAAC,cAAc,EAAE,CAAC;QACxD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,iBAAiB;QACjB,OAAO,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACF"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Firebase Configuration Validator
3
- *
4
- * Single Responsibility: Validates Firebase configuration
5
- */
6
- import type { FirebaseConfig } from '../../../domain/value-objects/FirebaseConfig';
7
- /**
8
- * Firebase Configuration Validator
9
- */
10
- export declare class FirebaseConfigValidator {
11
- private static rules;
12
- /**
13
- * Validate Firebase configuration
14
- * @throws {FirebaseConfigurationError} If configuration is invalid
15
- */
16
- static validate(config: FirebaseConfig): void;
17
- }
18
- //# sourceMappingURL=FirebaseConfigValidator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseConfigValidator.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/config/validators/FirebaseConfigValidator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAuDnF;;GAEG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAMlB;IAEF;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;CAK9C"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Firebase Configuration Validator
3
- *
4
- * Single Responsibility: Validates Firebase configuration
5
- */
6
- import { FirebaseConfigurationError } from '../../../domain/errors/FirebaseError';
7
- /**
8
- * Required field validation rule
9
- */
10
- class RequiredFieldRule {
11
- constructor(fieldName, getter) {
12
- this.fieldName = fieldName;
13
- this.getter = getter;
14
- }
15
- validate(config) {
16
- const value = this.getter(config);
17
- if (!value || typeof value !== 'string') {
18
- throw new FirebaseConfigurationError(`Firebase ${this.fieldName} is required and must be a string`);
19
- }
20
- if (value.trim().length === 0) {
21
- throw new FirebaseConfigurationError(`Firebase ${this.fieldName} cannot be empty`);
22
- }
23
- }
24
- }
25
- /**
26
- * Placeholder validation rule
27
- */
28
- class PlaceholderRule {
29
- constructor(fieldName, getter, placeholder) {
30
- this.fieldName = fieldName;
31
- this.getter = getter;
32
- this.placeholder = placeholder;
33
- }
34
- validate(config) {
35
- const value = this.getter(config);
36
- if (value && value.includes(this.placeholder)) {
37
- throw new FirebaseConfigurationError(`Please replace placeholder values with actual Firebase credentials for ${this.fieldName}`);
38
- }
39
- }
40
- }
41
- /**
42
- * Firebase Configuration Validator
43
- */
44
- export class FirebaseConfigValidator {
45
- /**
46
- * Validate Firebase configuration
47
- * @throws {FirebaseConfigurationError} If configuration is invalid
48
- */
49
- static validate(config) {
50
- for (const rule of this.rules) {
51
- rule.validate(config);
52
- }
53
- }
54
- }
55
- FirebaseConfigValidator.rules = [
56
- new RequiredFieldRule('API Key', config => config.apiKey),
57
- new RequiredFieldRule('Auth Domain', config => config.authDomain),
58
- new RequiredFieldRule('Project ID', config => config.projectId),
59
- new PlaceholderRule('API Key', config => config.apiKey, 'your_firebase_api_key'),
60
- new PlaceholderRule('Project ID', config => config.projectId, 'your-project-id'),
61
- ];
62
- //# sourceMappingURL=FirebaseConfigValidator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirebaseConfigValidator.js","sourceRoot":"","sources":["../../../../src/infrastructure/config/validators/FirebaseConfigValidator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AASlF;;GAEG;AACH,MAAM,iBAAiB;IACrB,YACU,SAAiB,EACjB,MAAsD;QADtD,cAAS,GAAT,SAAS,CAAQ;QACjB,WAAM,GAAN,MAAM,CAAgD;IAC7D,CAAC;IAEJ,QAAQ,CAAC,MAAsB;QAC7B,MAAM,KAAK,GA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