@umituz/react-native-firebase 1.14.3 → 2.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/package.json +1 -1
- package/src/domains/account-deletion/index.ts +28 -0
- package/src/{auth → domains/account-deletion}/infrastructure/services/account-deletion.service.ts +4 -4
- package/src/{auth → domains/account-deletion}/infrastructure/services/reauthentication.service.ts +5 -5
- package/src/{auth → domains/auth}/index.ts +1 -21
- package/src/{auth → domains/auth}/infrastructure/config/FirebaseAuthClient.ts +2 -2
- package/src/{auth → domains/auth}/infrastructure/services/apple-auth.service.ts +1 -1
- package/src/{auth → domains/auth}/infrastructure/services/auth-listener.service.ts +2 -2
- package/src/{auth → domains/auth}/infrastructure/services/auth-utils.service.ts +1 -1
- package/src/{auth → domains/auth}/infrastructure/services/base/base-auth.service.ts +1 -1
- package/src/{auth → domains/auth}/infrastructure/services/email-auth.service.ts +1 -1
- package/src/{auth → domains/auth}/infrastructure/services/google-auth.service.ts +2 -2
- package/src/{auth → domains/auth}/infrastructure/services/password.service.ts +1 -1
- package/src/{firestore → domains/firestore}/domain/errors/FirebaseFirestoreError.ts +1 -1
- package/src/{firestore → domains/firestore}/infrastructure/config/FirestoreClient.ts +2 -2
- package/src/{firestore → domains/firestore}/infrastructure/services/RequestLoggerService.ts +1 -1
- package/src/{firestore → domains/firestore}/utils/quota-error-detector.util.ts +1 -1
- package/src/{firestore → domains/firestore}/utils/transaction/transaction.util.ts +1 -1
- package/src/index.ts +12 -11
- package/src/init/createFirebaseInitModule.ts +1 -1
- package/src/{domain → shared/domain}/utils/credential.util.ts +1 -1
- package/src/{infrastructure → shared/infrastructure}/config/clients/FirebaseClientSingleton.ts +1 -1
- /package/src/{auth/infrastructure/services → domains/account-deletion/application/ports}/reauthentication.types.ts +0 -0
- /package/src/{auth → domains/auth}/domain/entities/AnonymousUser.ts +0 -0
- /package/src/{auth → domains/auth}/domain/errors/FirebaseAuthError.ts +0 -0
- /package/src/{auth → domains/auth}/domain/errors/README.md +0 -0
- /package/src/{auth → domains/auth}/domain/value-objects/FirebaseAuthConfig.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/config/README.md +0 -0
- /package/src/{auth → domains/auth}/infrastructure/config/initializers/FirebaseAuthInitializer.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/README.md +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/anonymous-auth.service.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/apple-auth.types.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/auth-guard.service.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/crypto.util.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/firestore-utils.service.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/google-auth.types.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/google-oauth.service.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/user-document-builder.util.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/user-document.service.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/services/user-document.types.ts +0 -0
- /package/src/{auth → domains/auth}/infrastructure/stores/auth.store.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/shared/auth-hooks.util.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/shared/hook-utils.util.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/shared/safe-state-hooks.util.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/shared/state-hooks.util.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/useAnonymousAuth.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/useFirebaseAuth.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/useGoogleOAuth.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/useSocialAuth.ts +0 -0
- /package/src/{auth → domains/auth}/presentation/hooks/utils/auth-state-change.handler.ts +0 -0
- /package/src/{firestore → domains/firestore}/domain/README.md +0 -0
- /package/src/{firestore → domains/firestore}/domain/constants/QuotaLimits.ts +0 -0
- /package/src/{firestore → domains/firestore}/domain/constants/README.md +0 -0
- /package/src/{firestore → domains/firestore}/domain/entities/QuotaMetrics.ts +0 -0
- /package/src/{firestore → domains/firestore}/domain/entities/README.md +0 -0
- /package/src/{firestore → domains/firestore}/domain/entities/RequestLog.ts +0 -0
- /package/src/{firestore → domains/firestore}/domain/errors/README.md +0 -0
- /package/src/{firestore → domains/firestore}/domain/services/QuotaCalculator.ts +0 -0
- /package/src/{firestore → domains/firestore}/index.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/config/README.md +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/config/initializers/FirebaseFirestoreInitializer.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/middleware/QueryDeduplicationMiddleware.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/middleware/QuotaTrackingMiddleware.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/middleware/README.md +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/repositories/BasePaginatedRepository.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/repositories/BaseQueryRepository.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/repositories/BaseRepository.ts +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/repositories/README.md +0 -0
- /package/src/{firestore → domains/firestore}/infrastructure/services/README.md +0 -0
- /package/src/{firestore → domains/firestore}/types/pagination/README.md +0 -0
- /package/src/{firestore → domains/firestore}/types/pagination.types.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/README.md +0 -0
- /package/src/{firestore → domains/firestore}/utils/dateUtils/README.md +0 -0
- /package/src/{firestore → domains/firestore}/utils/dateUtils.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/deduplication/pending-query-manager.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/deduplication/query-key-generator.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/deduplication/timer-manager.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/document-mapper.helper/README.md +0 -0
- /package/src/{firestore → domains/firestore}/utils/document-mapper.helper.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/firestore-helper.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/mapper/base-mapper.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/mapper/enrichment-mapper.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/mapper/multi-enrichment-mapper.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/operation/operation-executor.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/pagination.helper/README.md +0 -0
- /package/src/{firestore → domains/firestore}/utils/pagination.helper.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/query/filters.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/query/modifiers.util.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/query-builder/README.md +0 -0
- /package/src/{firestore → domains/firestore}/utils/query-builder.ts +0 -0
- /package/src/{firestore → domains/firestore}/utils/result/result.util.ts +0 -0
- /package/src/{domain → shared/domain}/README.md +0 -0
- /package/src/{domain → shared/domain}/errors/FirebaseError.ts +0 -0
- /package/src/{domain → shared/domain}/guards/firebase-error.guard.ts +0 -0
- /package/src/{domain → shared/domain}/utils/async-executor.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/error-handler.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/error-handlers/error-checkers.ts +0 -0
- /package/src/{domain → shared/domain}/utils/error-handlers/error-converters.ts +0 -0
- /package/src/{domain → shared/domain}/utils/error-handlers/error-messages.ts +0 -0
- /package/src/{domain → shared/domain}/utils/executors/advanced-executors.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/executors/basic-executors.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/executors/batch-executors.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/executors/error-converters.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/id-generator.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/index.ts +0 -0
- /package/src/{domain → shared/domain}/utils/result/result-creators.ts +0 -0
- /package/src/{domain → shared/domain}/utils/result/result-helpers.ts +0 -0
- /package/src/{domain → shared/domain}/utils/result/result-types.ts +0 -0
- /package/src/{domain → shared/domain}/utils/result.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/service-config.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/type-guards.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validation.util.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validators/composite.validator.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validators/firebase.validator.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validators/generic.validator.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validators/string.validator.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validators/url.validator.ts +0 -0
- /package/src/{domain → shared/domain}/utils/validators/user-input.validator.ts +0 -0
- /package/src/{domain → shared/domain}/value-objects/FirebaseConfig.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/README.md +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/FirebaseClient.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/FirebaseConfigLoader.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/README.md +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/base/ClientStateManager.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/base/ServiceClientSingleton.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/initializers/FirebaseAppInitializer.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/orchestrators/FirebaseInitializationOrchestrator.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/services/FirebaseInitializationService.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/services/FirebaseServiceInitializer.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/state/FirebaseClientState.ts +0 -0
- /package/src/{infrastructure → shared/infrastructure}/config/validators/FirebaseConfigValidator.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-firebase",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account Deletion Domain
|
|
3
|
+
* Handles Firebase account deletion with reauthentication
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
deleteCurrentUser,
|
|
8
|
+
deleteUserAccount,
|
|
9
|
+
} from './infrastructure/services/account-deletion.service';
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
AccountDeletionResult,
|
|
13
|
+
} from './infrastructure/services/account-deletion.service';
|
|
14
|
+
|
|
15
|
+
export type {
|
|
16
|
+
AccountDeletionOptions,
|
|
17
|
+
ReauthenticationResult,
|
|
18
|
+
AuthProviderType,
|
|
19
|
+
ReauthCredentialResult,
|
|
20
|
+
} from './application/ports/reauthentication.types';
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
getUserAuthProvider,
|
|
24
|
+
reauthenticateWithPassword,
|
|
25
|
+
reauthenticateWithGoogle,
|
|
26
|
+
reauthenticateWithApple,
|
|
27
|
+
getAppleReauthCredential,
|
|
28
|
+
} from './infrastructure/services/reauthentication.service';
|
package/src/{auth → domains/account-deletion}/infrastructure/services/account-deletion.service.ts
RENAMED
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { deleteUser, type User } from "firebase/auth";
|
|
7
|
-
import { getFirebaseAuth } from "
|
|
7
|
+
import { getFirebaseAuth } from "../../../auth/infrastructure/config/FirebaseAuthClient";
|
|
8
8
|
import {
|
|
9
9
|
getUserAuthProvider,
|
|
10
10
|
reauthenticateWithApple,
|
|
11
11
|
reauthenticateWithPassword,
|
|
12
12
|
reauthenticateWithGoogle,
|
|
13
13
|
} from "./reauthentication.service";
|
|
14
|
-
import { successResult, type Result } from "
|
|
15
|
-
import type { AccountDeletionOptions } from "
|
|
14
|
+
import { successResult, type Result } from "../../../../shared/domain/utils";
|
|
15
|
+
import type { AccountDeletionOptions } from "../../application/ports/reauthentication.types";
|
|
16
16
|
|
|
17
17
|
export interface AccountDeletionResult extends Result<void> {
|
|
18
18
|
requiresReauth?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export type { AccountDeletionOptions } from "
|
|
21
|
+
export type { AccountDeletionOptions } from "../../application/ports/reauthentication.types";
|
|
22
22
|
|
|
23
23
|
export async function deleteCurrentUser(
|
|
24
24
|
options: AccountDeletionOptions = { autoReauthenticate: true }
|
package/src/{auth → domains/account-deletion}/infrastructure/services/reauthentication.service.ts
RENAMED
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
} from "firebase/auth";
|
|
13
13
|
import * as AppleAuthentication from "expo-apple-authentication";
|
|
14
14
|
import { Platform } from "react-native";
|
|
15
|
-
import { generateNonce, hashNonce } from "
|
|
16
|
-
import { executeOperation, failureResultFrom } from "
|
|
17
|
-
import { isCancelledError } from "
|
|
15
|
+
import { generateNonce, hashNonce } from "../../../auth/infrastructure/services/crypto.util";
|
|
16
|
+
import { executeOperation, failureResultFrom } from "../../../../shared/domain/utils";
|
|
17
|
+
import { isCancelledError } from "../../../../shared/domain/utils/error-handler.util";
|
|
18
18
|
import type {
|
|
19
19
|
ReauthenticationResult,
|
|
20
20
|
AuthProviderType,
|
|
21
21
|
ReauthCredentialResult
|
|
22
|
-
} from "
|
|
22
|
+
} from "../../application/ports/reauthentication.types";
|
|
23
23
|
|
|
24
24
|
export type {
|
|
25
25
|
ReauthenticationResult,
|
|
26
26
|
AuthProviderType,
|
|
27
27
|
ReauthCredentialResult
|
|
28
|
-
} from "
|
|
28
|
+
} from "../../application/ports/reauthentication.types";
|
|
29
29
|
|
|
30
30
|
export function getUserAuthProvider(user: User): AuthProviderType {
|
|
31
31
|
if (user.isAnonymous) return "anonymous";
|
|
@@ -74,27 +74,7 @@ export type {
|
|
|
74
74
|
FirestoreQuerySkipReason,
|
|
75
75
|
} from './infrastructure/services/firestore-utils.service';
|
|
76
76
|
|
|
77
|
-
// Account
|
|
78
|
-
export {
|
|
79
|
-
deleteCurrentUser,
|
|
80
|
-
deleteUserAccount,
|
|
81
|
-
} from './infrastructure/services/account-deletion.service';
|
|
82
|
-
|
|
83
|
-
export type { AccountDeletionResult, AccountDeletionOptions } from './infrastructure/services/account-deletion.service';
|
|
84
|
-
|
|
85
|
-
// Reauthentication Service
|
|
86
|
-
export {
|
|
87
|
-
getUserAuthProvider,
|
|
88
|
-
reauthenticateWithGoogle,
|
|
89
|
-
reauthenticateWithApple,
|
|
90
|
-
reauthenticateWithPassword,
|
|
91
|
-
getAppleReauthCredential,
|
|
92
|
-
} from './infrastructure/services/reauthentication.service';
|
|
93
|
-
|
|
94
|
-
export type {
|
|
95
|
-
ReauthenticationResult,
|
|
96
|
-
AuthProviderType,
|
|
97
|
-
} from './infrastructure/services/reauthentication.service';
|
|
77
|
+
// Note: Account deletion moved to domains/account-deletion domain
|
|
98
78
|
|
|
99
79
|
// =============================================================================
|
|
100
80
|
// INFRASTRUCTURE LAYER - Social Auth Services
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { Auth } from 'firebase/auth';
|
|
8
|
-
import { getFirebaseApp } from '
|
|
8
|
+
import { getFirebaseApp } from '../../../../shared/infrastructure/config/FirebaseClient';
|
|
9
9
|
import { FirebaseAuthInitializer } from './initializers/FirebaseAuthInitializer';
|
|
10
10
|
import type { FirebaseAuthConfig } from '../../domain/value-objects/FirebaseAuthConfig';
|
|
11
|
-
import { ServiceClientSingleton } from '
|
|
11
|
+
import { ServiceClientSingleton } from '../../../../shared/infrastructure/config/base/ServiceClientSingleton';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Firebase Auth Client Singleton
|
|
@@ -15,7 +15,7 @@ import type { AppleAuthResult } from "./apple-auth.types";
|
|
|
15
15
|
import {
|
|
16
16
|
isCancellationError,
|
|
17
17
|
} from "./base/base-auth.service";
|
|
18
|
-
import { executeAuthOperation, type Result } from "
|
|
18
|
+
import { executeAuthOperation, type Result } from "../../../../shared/domain/utils";
|
|
19
19
|
|
|
20
20
|
// Conditional import - expo-apple-authentication is optional
|
|
21
21
|
let AppleAuthentication: any = null;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { onIdTokenChanged, type User } from "firebase/auth";
|
|
7
7
|
import { getFirebaseAuth } from "../config/FirebaseAuthClient";
|
|
8
|
-
import type { Result } from "
|
|
9
|
-
import { failureResultFrom } from "
|
|
8
|
+
import type { Result } from "../../../../shared/domain/utils";
|
|
9
|
+
import { failureResultFrom } from "../../../../shared/domain/utils";
|
|
10
10
|
|
|
11
11
|
export interface AuthListenerConfig {
|
|
12
12
|
/**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { User, Auth } from 'firebase/auth';
|
|
7
7
|
import { getFirebaseAuth } from '../config/FirebaseAuthClient';
|
|
8
|
-
import { isValidString } from '
|
|
8
|
+
import { isValidString } from '../../../../shared/domain/utils/validation.util';
|
|
9
9
|
|
|
10
10
|
export interface AuthCheckResult {
|
|
11
11
|
isAuthenticated: boolean;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { UserCredential } from 'firebase/auth';
|
|
9
|
-
import { authErrorConverter, type Result } from '
|
|
9
|
+
import { authErrorConverter, type Result } from '../../../../../shared/domain/utils';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Authentication result with user credential
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type User,
|
|
14
14
|
} from "firebase/auth";
|
|
15
15
|
import { getFirebaseAuth } from "../config/FirebaseAuthClient";
|
|
16
|
-
import { executeOperation, failureResultFrom, successResult, type Result } from "
|
|
16
|
+
import { executeOperation, failureResultFrom, successResult, type Result } from "../../../../shared/domain/utils";
|
|
17
17
|
|
|
18
18
|
export interface EmailCredentials {
|
|
19
19
|
email: string;
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
type Auth,
|
|
10
10
|
} from "firebase/auth";
|
|
11
11
|
import type { GoogleAuthConfig, GoogleAuthResult } from "./google-auth.types";
|
|
12
|
-
import { executeAuthOperation, type Result } from "
|
|
13
|
-
import { ConfigurableService } from "
|
|
12
|
+
import { executeAuthOperation, type Result } from "../../../../shared/domain/utils";
|
|
13
|
+
import { ConfigurableService } from "../../../../shared/domain/utils/service-config.util";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Google Auth Service
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { updatePassword, type User } from 'firebase/auth';
|
|
7
|
-
import { executeAuthOperation, type Result } from '
|
|
7
|
+
import { executeAuthOperation, type Result } from '../../../../shared/domain/utils';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Result of a password update operation
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { Firestore } from 'firebase/firestore';
|
|
12
|
-
import { getFirebaseApp } from '
|
|
12
|
+
import { getFirebaseApp } from '../../../../shared/infrastructure/config/FirebaseClient';
|
|
13
13
|
import { FirebaseFirestoreInitializer } from './initializers/FirebaseFirestoreInitializer';
|
|
14
|
-
import { ServiceClientSingleton } from '
|
|
14
|
+
import { ServiceClientSingleton } from '../../../../shared/infrastructure/config/base/ServiceClientSingleton';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Firestore Client Singleton
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { RequestLog, RequestStats, RequestType } from '../../domain/entities/RequestLog';
|
|
7
|
-
import { generateUniqueId } from '
|
|
7
|
+
import { generateUniqueId } from '../../../../shared/domain/utils/id-generator.util';
|
|
8
8
|
|
|
9
9
|
export class RequestLoggerService {
|
|
10
10
|
private logs: RequestLog[] = [];
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type Transaction,
|
|
10
10
|
} from "firebase/firestore";
|
|
11
11
|
import { getFirestore } from "../../infrastructure/config/FirestoreClient";
|
|
12
|
-
import { hasCodeProperty } from "
|
|
12
|
+
import { hasCodeProperty } from "../../../../shared/domain/utils/type-guards.util";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Execute a transaction with automatic DB instance check.
|
package/src/index.ts
CHANGED
|
@@ -15,10 +15,10 @@ export {
|
|
|
15
15
|
FirebaseError,
|
|
16
16
|
FirebaseInitializationError,
|
|
17
17
|
FirebaseConfigurationError,
|
|
18
|
-
} from "./domain/errors/FirebaseError";
|
|
18
|
+
} from "./shared/domain/errors/FirebaseError";
|
|
19
19
|
|
|
20
20
|
// Core Types
|
|
21
|
-
export type { FirebaseConfig } from "./domain/value-objects/FirebaseConfig";
|
|
21
|
+
export type { FirebaseConfig } from "./shared/domain/value-objects/FirebaseConfig";
|
|
22
22
|
export type { IFirebaseClient } from "./application/ports/IFirebaseClient";
|
|
23
23
|
|
|
24
24
|
// Core Client
|
|
@@ -31,14 +31,14 @@ export {
|
|
|
31
31
|
getFirebaseInitializationError,
|
|
32
32
|
resetFirebaseClient,
|
|
33
33
|
firebaseClient,
|
|
34
|
-
} from "./infrastructure/config/FirebaseClient";
|
|
34
|
+
} from "./shared/infrastructure/config/FirebaseClient";
|
|
35
35
|
|
|
36
36
|
export type {
|
|
37
37
|
FirebaseApp,
|
|
38
38
|
AuthInitializer,
|
|
39
39
|
ServiceInitializationOptions,
|
|
40
40
|
ServiceInitializationResult,
|
|
41
|
-
} from "./infrastructure/config/FirebaseClient";
|
|
41
|
+
} from "./shared/infrastructure/config/FirebaseClient";
|
|
42
42
|
|
|
43
43
|
// Type Guards
|
|
44
44
|
export {
|
|
@@ -50,10 +50,11 @@ export {
|
|
|
50
50
|
isQuotaExceededError,
|
|
51
51
|
getSafeErrorMessage,
|
|
52
52
|
getSafeErrorCode,
|
|
53
|
-
} from "./domain/guards/firebase-error.guard";
|
|
53
|
+
} from "./shared/domain/guards/firebase-error.guard";
|
|
54
54
|
|
|
55
|
-
//
|
|
56
|
-
export * from "./auth";
|
|
55
|
+
// Domain Exports
|
|
56
|
+
export * from "./domains/auth";
|
|
57
|
+
export * from "./domains/account-deletion";
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
|
|
@@ -62,8 +63,8 @@ export {
|
|
|
62
63
|
BaseRepository,
|
|
63
64
|
BaseQueryRepository,
|
|
64
65
|
BasePaginatedRepository,
|
|
65
|
-
} from "./firestore";
|
|
66
|
-
export * from "./firestore";
|
|
66
|
+
} from "./domains/firestore";
|
|
67
|
+
export * from "./domains/firestore";
|
|
67
68
|
export { Timestamp } from "firebase/firestore";
|
|
68
69
|
export type {
|
|
69
70
|
Transaction,
|
|
@@ -86,8 +87,8 @@ export {
|
|
|
86
87
|
createSuccessResult,
|
|
87
88
|
runTransaction,
|
|
88
89
|
serverTimestamp,
|
|
89
|
-
} from "./firestore/utils/firestore-helper";
|
|
90
|
-
export type { FirestoreResult, NoDbResult } from "./firestore/utils/firestore-helper";
|
|
90
|
+
} from "./domains/firestore/utils/firestore-helper";
|
|
91
|
+
export type { FirestoreResult, NoDbResult } from "./domains/firestore/utils/firestore-helper";
|
|
91
92
|
|
|
92
93
|
// Init Module Factory
|
|
93
94
|
export {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { InitModule } from '@umituz/react-native-design-system';
|
|
7
|
-
import { initializeAllFirebaseServices } from '../infrastructure/config/FirebaseClient';
|
|
7
|
+
import { initializeAllFirebaseServices } from '../shared/infrastructure/config/FirebaseClient';
|
|
8
8
|
|
|
9
9
|
export interface FirebaseInitModuleConfig {
|
|
10
10
|
/**
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'firebase/auth';
|
|
12
12
|
import * as AppleAuthentication from 'expo-apple-authentication';
|
|
13
13
|
import { Platform } from 'react-native';
|
|
14
|
-
import { generateNonce, hashNonce } from '
|
|
14
|
+
import { generateNonce, hashNonce } from '../../../domains/auth/infrastructure/services/crypto.util';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Generate Google credential from ID token
|
package/src/{infrastructure → shared/infrastructure}/config/clients/FirebaseClientSingleton.ts
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { FirebaseConfig } from '../../../domain/value-objects/FirebaseConfig';
|
|
7
|
-
import type { IFirebaseClient } from '
|
|
7
|
+
import type { IFirebaseClient } from '../../../../application/ports/IFirebaseClient';
|
|
8
8
|
import type { FirebaseApp } from '../initializers/FirebaseAppInitializer';
|
|
9
9
|
import { FirebaseClientState } from '../state/FirebaseClientState';
|
|
10
10
|
import { FirebaseInitializationOrchestrator } from '../orchestrators/FirebaseInitializationOrchestrator';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{auth → domains/auth}/infrastructure/config/initializers/FirebaseAuthInitializer.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{firestore → domains/firestore}/infrastructure/middleware/QuotaTrackingMiddleware.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/{firestore → domains/firestore}/infrastructure/repositories/BasePaginatedRepository.ts
RENAMED
|
File without changes
|
/package/src/{firestore → domains/firestore}/infrastructure/repositories/BaseQueryRepository.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{firestore → domains/firestore}/utils/deduplication/pending-query-manager.util.ts
RENAMED
|
File without changes
|
/package/src/{firestore → domains/firestore}/utils/deduplication/query-key-generator.util.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{infrastructure → shared/infrastructure}/config/initializers/FirebaseAppInitializer.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{infrastructure → shared/infrastructure}/config/services/FirebaseServiceInitializer.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/{infrastructure → shared/infrastructure}/config/validators/FirebaseConfigValidator.ts
RENAMED
|
File without changes
|