@umituz/react-native-firebase 2.6.2 → 2.6.4
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/application/auth/index.ts +2 -34
- package/src/application/auth/use-cases/index.ts +1 -21
- package/src/domains/account-deletion/domain/index.ts +1 -8
- package/src/domains/account-deletion/index.ts +0 -42
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionExecutor.ts +79 -0
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionTypes.ts +0 -1
- package/src/domains/account-deletion/infrastructure/services/account-deletion.service.ts +2 -14
- package/src/domains/auth/index.ts +3 -12
- package/src/domains/auth/infrastructure.ts +11 -0
- package/src/domains/firestore/domain/entities/Collection.ts +0 -2
- package/src/domains/firestore/domain/index.ts +8 -12
- package/src/domains/firestore/domain/value-objects/{QueryOptions.ts.bak → QueryOptions.ts} +20 -68
- package/src/domains/firestore/domain/value-objects/QueryOptionsFactory.ts +95 -0
- package/src/domains/firestore/domain/value-objects/QueryOptionsHelpers.ts +110 -0
- package/src/domains/firestore/domain/value-objects/WhereClause.ts +115 -0
- package/src/domains/firestore/domain/value-objects/WhereClauseFactory.ts +101 -0
- package/src/domains/firestore/domain/value-objects/WhereClauseHelpers.ts +123 -0
- package/src/domains/firestore/domain/value-objects/WhereClauseValidation.ts +83 -0
- package/src/domains/firestore/presentation/hooks/useFirestoreMutation.ts +1 -1
- package/src/domains/firestore/presentation/hooks/useFirestoreQuery.ts +1 -1
- package/src/shared/infrastructure/config/base/ServiceClientSingleton.ts +29 -0
- package/src/application/auth/ports/AuthPort.ts.bak +0 -164
- package/src/application/auth/ports/AuthPort_part_aa +0 -150
- package/src/application/auth/ports/AuthPort_part_ab +0 -14
- package/src/application/auth/use-cases/SignInUseCase.ts.bak +0 -253
- package/src/application/auth/use-cases/SignInUseCaseHelpers.ts +0 -0
- package/src/application/auth/use-cases/SignInUseCaseMain.ts +0 -0
- package/src/application/auth/use-cases/SignInUseCase_part_aa +0 -150
- package/src/application/auth/use-cases/SignInUseCase_part_ab +0 -103
- package/src/application/auth/use-cases/SignOutUseCase.ts.bak +0 -288
- package/src/application/auth/use-cases/SignOutUseCaseCleanup.ts +0 -0
- package/src/application/auth/use-cases/SignOutUseCaseMain.ts +0 -0
- package/src/application/auth/use-cases/SignOutUseCase_part_aa +0 -150
- package/src/application/auth/use-cases/SignOutUseCase_part_ab +0 -138
- package/src/domains/account-deletion/domain/services/UserValidationHelpers.ts.bak +0 -181
- package/src/domains/account-deletion/domain/services/UserValidationHelpers_part_aa +0 -150
- package/src/domains/account-deletion/domain/services/UserValidationHelpers_part_ab +0 -31
- package/src/domains/account-deletion/domain/services/UserValidationService.ts.bak +0 -286
- package/src/domains/account-deletion/domain/services/UserValidationService_part_aa +0 -150
- package/src/domains/account-deletion/domain/services/UserValidationService_part_ab +0 -136
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionExecutor.ts.bak +0 -230
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionExecutor_part_aa +0 -150
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionExecutor_part_ab +0 -80
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionReauthHandler.ts.bak +0 -174
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionReauthHandler_part_aa +0 -150
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionReauthHandler_part_ab +0 -24
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionRepository.ts.bak +0 -266
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionRepository_part_aa +0 -150
- package/src/domains/account-deletion/infrastructure/services/AccountDeletionRepository_part_ab +0 -116
- package/src/domains/account-deletion/infrastructure/services/reauthentication.service.ts.bak +0 -160
- package/src/domains/account-deletion/infrastructure/services/reauthentication.service_part_aa +0 -150
- package/src/domains/account-deletion/infrastructure/services/reauthentication.service_part_ab +0 -10
- package/src/domains/auth/infrastructure.ts.bak +0 -156
- package/src/domains/auth/infrastructure_part_aa +0 -150
- package/src/domains/auth/infrastructure_part_ab +0 -6
- package/src/domains/auth/presentation/hooks/GoogleOAuthHelpers.ts +0 -0
- package/src/domains/auth/presentation/hooks/GoogleOAuthHookService.ts.bak +0 -247
- package/src/domains/auth/presentation/hooks/GoogleOAuthHookService_part_aa +0 -150
- package/src/domains/auth/presentation/hooks/GoogleOAuthHookService_part_ab +0 -97
- package/src/domains/auth/presentation/hooks/GoogleOAuthService.ts +0 -0
- package/src/domains/firestore/domain/entities/Collection.ts.bak +0 -288
- package/src/domains/firestore/domain/entities/Collection_part_aa +0 -150
- package/src/domains/firestore/domain/entities/Collection_part_ab +0 -138
- package/src/domains/firestore/domain/entities/Document.ts.bak +0 -233
- package/src/domains/firestore/domain/entities/DocumentHelpers.ts +0 -0
- package/src/domains/firestore/domain/entities/DocumentMain.ts +0 -0
- package/src/domains/firestore/domain/entities/Document_part_aa +0 -150
- package/src/domains/firestore/domain/entities/Document_part_ab +0 -83
- package/src/domains/firestore/domain/services/QueryService.ts.bak +0 -182
- package/src/domains/firestore/domain/services/QueryServiceAnalysis.ts.bak +0 -169
- package/src/domains/firestore/domain/services/QueryServiceAnalysis_part_aa +0 -150
- package/src/domains/firestore/domain/services/QueryServiceAnalysis_part_ab +0 -19
- package/src/domains/firestore/domain/services/QueryServiceHelpers.ts.bak +0 -151
- package/src/domains/firestore/domain/services/QueryServiceHelpers_part_aa +0 -150
- package/src/domains/firestore/domain/services/QueryServiceHelpers_part_ab +0 -1
- package/src/domains/firestore/domain/services/QueryService_part_aa +0 -150
- package/src/domains/firestore/domain/services/QueryService_part_ab +0 -32
- package/src/domains/firestore/domain/value-objects/QueryOptionsSerialization.ts.bak +0 -207
- package/src/domains/firestore/domain/value-objects/QueryOptionsSerialization_part_aa +0 -150
- package/src/domains/firestore/domain/value-objects/QueryOptionsSerialization_part_ab +0 -57
- package/src/domains/firestore/domain/value-objects/QueryOptionsValidation.ts.bak +0 -182
- package/src/domains/firestore/domain/value-objects/QueryOptionsValidation_part_aa +0 -150
- package/src/domains/firestore/domain/value-objects/QueryOptionsValidation_part_ab +0 -32
- package/src/domains/firestore/domain/value-objects/QueryOptions_part_aa +0 -150
- package/src/domains/firestore/domain/value-objects/QueryOptions_part_ab +0 -41
- package/src/domains/firestore/domain/value-objects/WhereClause.ts.bak +0 -299
- package/src/domains/firestore/domain/value-objects/WhereClauseFactory.ts.bak +0 -207
- package/src/domains/firestore/domain/value-objects/WhereClauseFactory_part_aa +0 -150
- package/src/domains/firestore/domain/value-objects/WhereClauseFactory_part_ab +0 -57
- package/src/domains/firestore/domain/value-objects/WhereClause_part_aa +0 -150
- package/src/domains/firestore/domain/value-objects/WhereClause_part_ab +0 -149
- package/src/shared/infrastructure/base/ErrorHandler.ts.bak +0 -189
- package/src/shared/infrastructure/base/ErrorHandler_part_aa +0 -150
- package/src/shared/infrastructure/base/ErrorHandler_part_ab +0 -39
- package/src/shared/infrastructure/base/ServiceBase.ts.bak +0 -220
- package/src/shared/infrastructure/base/ServiceBase_part_aa +0 -150
- package/src/shared/infrastructure/base/ServiceBase_part_ab +0 -70
- package/src/shared/infrastructure/config/base/ServiceClientSingleton.ts.bak +0 -155
- package/src/shared/infrastructure/config/base/ServiceClientSingleton_part_aa +0 -150
- package/src/shared/infrastructure/config/base/ServiceClientSingleton_part_ab +0 -5
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Service Client Singleton Base Class
|
|
3
|
-
*
|
|
4
|
-
* Provides a generic singleton pattern for Firebase service clients.
|
|
5
|
-
* Eliminates code duplication across FirebaseClient, FirestoreClient, FirebaseAuthClient.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Generic singleton pattern
|
|
9
|
-
* - Initialization state management
|
|
10
|
-
* - Error handling and tracking
|
|
11
|
-
* - Automatic cleanup
|
|
12
|
-
*
|
|
13
|
-
* @template TInstance - The service instance type (e.g., Firestore, Auth)
|
|
14
|
-
* @template TConfig - The configuration type (optional)
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
interface ServiceClientState<TInstance> {
|
|
18
|
-
instance: TInstance | null;
|
|
19
|
-
initializationError: string | null;
|
|
20
|
-
isInitialized: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface ServiceClientOptions<TInstance, TConfig = unknown> {
|
|
24
|
-
serviceName: string;
|
|
25
|
-
initializer?: (config?: TConfig) => TInstance | null;
|
|
26
|
-
autoInitializer?: () => TInstance | null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Generic service client singleton base class
|
|
31
|
-
* Provides common initialization, state management, and error handling
|
|
32
|
-
*/
|
|
33
|
-
export class ServiceClientSingleton<TInstance, TConfig = unknown> {
|
|
34
|
-
protected state: ServiceClientState<TInstance>;
|
|
35
|
-
private readonly options: ServiceClientOptions<TInstance, TConfig>;
|
|
36
|
-
private initInProgress = false;
|
|
37
|
-
|
|
38
|
-
constructor(options: ServiceClientOptions<TInstance, TConfig>) {
|
|
39
|
-
this.options = options;
|
|
40
|
-
this.state = {
|
|
41
|
-
instance: null,
|
|
42
|
-
initializationError: null,
|
|
43
|
-
isInitialized: false,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Initialize the service with optional configuration
|
|
49
|
-
*/
|
|
50
|
-
initialize(config?: TConfig): TInstance | null {
|
|
51
|
-
if (this.state.isInitialized && this.state.instance) {
|
|
52
|
-
return this.state.instance;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (this.state.initializationError) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Prevent concurrent initialization attempts
|
|
60
|
-
if (this.initInProgress) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
this.initInProgress = true;
|
|
65
|
-
try {
|
|
66
|
-
const instance = this.options.initializer ? this.options.initializer(config) : null;
|
|
67
|
-
if (instance) {
|
|
68
|
-
this.state.instance = instance;
|
|
69
|
-
this.state.isInitialized = true;
|
|
70
|
-
}
|
|
71
|
-
return instance;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
const errorMessage = error instanceof Error ? error.message : `Failed to initialize ${this.options.serviceName}`;
|
|
74
|
-
this.state.initializationError = errorMessage;
|
|
75
|
-
return null;
|
|
76
|
-
} finally {
|
|
77
|
-
this.initInProgress = false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get the service instance, auto-initializing if needed
|
|
83
|
-
*/
|
|
84
|
-
getInstance(autoInit: boolean = false): TInstance | null {
|
|
85
|
-
if (this.state.instance) {
|
|
86
|
-
return this.state.instance;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (this.state.initializationError) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Prevent concurrent auto-initialization attempts
|
|
94
|
-
if (this.initInProgress) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (autoInit && this.options.autoInitializer) {
|
|
99
|
-
this.initInProgress = true;
|
|
100
|
-
try {
|
|
101
|
-
const instance = this.options.autoInitializer();
|
|
102
|
-
if (instance) {
|
|
103
|
-
this.state.instance = instance;
|
|
104
|
-
this.state.isInitialized = true;
|
|
105
|
-
}
|
|
106
|
-
return instance;
|
|
107
|
-
} catch (error) {
|
|
108
|
-
const errorMessage = error instanceof Error ? error.message : `Failed to initialize ${this.options.serviceName}`;
|
|
109
|
-
this.state.initializationError = errorMessage;
|
|
110
|
-
} finally {
|
|
111
|
-
this.initInProgress = false;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Check if the service is initialized
|
|
120
|
-
*/
|
|
121
|
-
isInitialized(): boolean {
|
|
122
|
-
return this.state.isInitialized;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Get the initialization error if any
|
|
127
|
-
*/
|
|
128
|
-
getInitializationError(): string | null {
|
|
129
|
-
return this.state.initializationError;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Reset the service state
|
|
134
|
-
*/
|
|
135
|
-
reset(): void {
|
|
136
|
-
this.state.instance = null;
|
|
137
|
-
this.state.initializationError = null;
|
|
138
|
-
this.state.isInitialized = false;
|
|
139
|
-
this.initInProgress = false;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Get the current instance without initialization
|
|
144
|
-
*/
|
|
145
|
-
protected getCurrentInstance(): TInstance | null {
|
|
146
|
-
return this.state.instance;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Set initialization error
|