@umituz/web-firebase 1.0.5 → 2.0.1
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/README.md +555 -0
- package/dist/application/index.d.mts +273 -0
- package/dist/application/index.d.ts +273 -0
- package/dist/application/index.js +490 -0
- package/dist/application/index.mjs +19 -0
- package/dist/chunk-34DL2QWQ.mjs +87 -0
- package/dist/chunk-4FP2ELQ5.mjs +96 -0
- package/dist/chunk-7TX3OU3O.mjs +721 -0
- package/dist/chunk-I6WGBPFB.mjs +439 -0
- package/dist/chunk-RZ4QR6TB.mjs +96 -0
- package/dist/chunk-U2XI4MGO.mjs +397 -0
- package/dist/domain/index.d.mts +325 -0
- package/dist/domain/index.d.ts +325 -0
- package/dist/domain/index.js +662 -0
- package/dist/domain/index.mjs +36 -0
- package/dist/file.repository.interface-v5vHgVsZ.d.mts +241 -0
- package/dist/file.repository.interface-v5vHgVsZ.d.ts +241 -0
- package/dist/firebase.entity-xvfEPjXZ.d.mts +15 -0
- package/dist/firebase.entity-xvfEPjXZ.d.ts +15 -0
- package/dist/index.d.mts +14 -96
- package/dist/index.d.ts +14 -96
- package/dist/index.js +1717 -78
- package/dist/index.mjs +88 -175
- package/dist/infrastructure/index.d.mts +170 -0
- package/dist/infrastructure/index.d.ts +170 -0
- package/dist/infrastructure/index.js +856 -0
- package/dist/infrastructure/index.mjs +46 -0
- package/dist/presentation/index.d.mts +25 -0
- package/dist/presentation/index.d.ts +25 -0
- package/dist/presentation/index.js +105 -0
- package/dist/presentation/index.mjs +6 -0
- package/dist/user.repository.interface-DS74TsJ5.d.mts +298 -0
- package/dist/user.repository.interface-DS74TsJ5.d.ts +298 -0
- package/package.json +37 -11
- package/src/application/dto/auth.dto.ts +69 -0
- package/src/application/dto/index.ts +7 -0
- package/src/application/dto/user.dto.ts +64 -0
- package/src/application/index.ts +7 -0
- package/src/application/use-cases/auth/reset-password.use-case.ts +66 -0
- package/src/application/use-cases/auth/sign-in-with-google.use-case.ts +86 -0
- package/src/application/use-cases/auth/sign-in.use-case.ts +77 -0
- package/src/application/use-cases/auth/sign-out.use-case.ts +22 -0
- package/src/application/use-cases/auth/sign-up.use-case.ts +99 -0
- package/src/application/use-cases/index.ts +12 -0
- package/src/application/use-cases/user/delete-account.use-case.ts +77 -0
- package/src/application/use-cases/user/update-profile.use-case.ts +98 -0
- package/src/domain/entities/file.entity.ts +151 -0
- package/src/domain/entities/timestamp.entity.ts +116 -0
- package/src/domain/entities/user.entity.ts +193 -0
- package/src/domain/errors/auth.errors.ts +115 -0
- package/src/domain/errors/repository.errors.ts +121 -0
- package/src/domain/index.ts +25 -2
- package/src/domain/interfaces/auth.repository.interface.ts +83 -0
- package/src/domain/interfaces/file.repository.interface.ts +143 -0
- package/src/domain/interfaces/user.repository.interface.ts +75 -0
- package/src/domain/value-objects/email.vo.ts +105 -0
- package/src/domain/value-objects/file-path.vo.ts +184 -0
- package/src/domain/value-objects/user-id.vo.ts +87 -0
- package/src/index.ts +19 -4
- package/src/infrastructure/firebase/auth.adapter.ts +220 -0
- package/src/infrastructure/firebase/client.ts +141 -0
- package/src/infrastructure/firebase/firestore.adapter.ts +190 -0
- package/src/infrastructure/firebase/storage.adapter.ts +323 -0
- package/src/infrastructure/index.ts +10 -5
- package/src/infrastructure/utils/storage.util.ts +3 -3
- package/src/presentation/hooks/useAuth.ts +153 -0
- package/src/presentation/hooks/useFirestore.ts +125 -0
- package/src/presentation/hooks/useStorage.ts +141 -0
- package/src/presentation/providers/FirebaseProvider.tsx +40 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,96 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
uid: string;
|
|
16
|
-
email: string | null;
|
|
17
|
-
displayName: string | null;
|
|
18
|
-
photoURL: string | null;
|
|
19
|
-
emailVerified: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Base Repository Interface
|
|
24
|
-
*/
|
|
25
|
-
interface IBaseRepository<T> {
|
|
26
|
-
getById(id: string, parentPath?: string): Promise<T | null>;
|
|
27
|
-
getAll(constraints?: any[], parentPath?: string): Promise<T[]>;
|
|
28
|
-
create(id: string, data: Omit<T, 'id'>, parentPath?: string): Promise<void>;
|
|
29
|
-
update(id: string, data: Partial<T>, parentPath?: string): Promise<void>;
|
|
30
|
-
delete(id: string, parentPath?: string): Promise<void>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Firebase Service Infrastructure
|
|
35
|
-
* @description Initialization and instance management for Firebase
|
|
36
|
-
*/
|
|
37
|
-
interface FirebaseInstances {
|
|
38
|
-
app: FirebaseApp;
|
|
39
|
-
auth: Auth;
|
|
40
|
-
db: Firestore;
|
|
41
|
-
storage: FirebaseStorage;
|
|
42
|
-
functions: Functions;
|
|
43
|
-
}
|
|
44
|
-
declare function initializeFirebase(config: FirebaseOptions, appName?: string): FirebaseInstances;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Firestore Repository Implementation
|
|
48
|
-
* @description Generic CRUD operations for Firestore collections
|
|
49
|
-
*/
|
|
50
|
-
declare class FirestoreRepository<T extends DocumentData> implements IBaseRepository<T> {
|
|
51
|
-
protected db: Firestore;
|
|
52
|
-
protected collectionName: string;
|
|
53
|
-
constructor(db: Firestore, collectionName: string);
|
|
54
|
-
protected getCollection(parentPath?: string): CollectionReference<T>;
|
|
55
|
-
protected getDocRef(id: string, parentPath?: string): _firebase_firestore.DocumentReference<DocumentData, DocumentData>;
|
|
56
|
-
getById(id: string, parentPath?: string): Promise<T | null>;
|
|
57
|
-
getAll(constraints?: QueryConstraint[], parentPath?: string): Promise<T[]>;
|
|
58
|
-
create(id: string, data: Omit<T, 'id'>, parentPath?: string): Promise<void>;
|
|
59
|
-
update(id: string, data: Partial<T>, parentPath?: string): Promise<void>;
|
|
60
|
-
delete(id: string, parentPath?: string): Promise<void>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Firebase Storage Utils
|
|
65
|
-
* @description Upload and delete helpers for Firebase Storage
|
|
66
|
-
*/
|
|
67
|
-
interface UploadResult {
|
|
68
|
-
url: string;
|
|
69
|
-
path: string;
|
|
70
|
-
}
|
|
71
|
-
declare function uploadFile(storage: FirebaseStorage, path: string, file: File | Blob): Promise<UploadResult>;
|
|
72
|
-
declare function uploadBase64(storage: FirebaseStorage, path: string, base64: string, mimeType?: string): Promise<UploadResult>;
|
|
73
|
-
declare function deleteFile(storage: FirebaseStorage, path: string): Promise<void>;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* useFirebaseAuth Hook
|
|
77
|
-
* @description Hook to manage Firebase authentication state and operations
|
|
78
|
-
*/
|
|
79
|
-
interface UseFirebaseAuthOptions {
|
|
80
|
-
onUserChange?: (user: FirebaseUser | null) => void;
|
|
81
|
-
}
|
|
82
|
-
interface UseFirebaseAuthReturn {
|
|
83
|
-
user: FirebaseUser | null;
|
|
84
|
-
loading: boolean;
|
|
85
|
-
isAuthenticated: boolean;
|
|
86
|
-
signIn(email: string, password: string): Promise<UserCredential>;
|
|
87
|
-
signUp(email: string, password: string, name?: string): Promise<UserCredential>;
|
|
88
|
-
signOut(): Promise<void>;
|
|
89
|
-
updateUserProfile(name: string, photoURL?: string): Promise<void>;
|
|
90
|
-
updateUserPassword(newPassword: string): Promise<void>;
|
|
91
|
-
resetPassword(email: string): Promise<void>;
|
|
92
|
-
getIdToken(): Promise<string>;
|
|
93
|
-
}
|
|
94
|
-
declare function useFirebaseAuth(auth: Auth, options?: UseFirebaseAuthOptions): UseFirebaseAuthReturn;
|
|
95
|
-
|
|
96
|
-
export { type FirebaseInstances, type FirebaseTimestamp, type FirebaseUser, FirestoreRepository, type IBaseRepository, type UploadResult, type UseFirebaseAuthOptions, type UseFirebaseAuthReturn, deleteFile, initializeFirebase, uploadBase64, uploadFile, useFirebaseAuth };
|
|
1
|
+
export { F as FirebaseTimestamp, a as FirebaseUser } from './firebase.entity-xvfEPjXZ.js';
|
|
2
|
+
export { A as AccountMetrics, I as IAuthRepository, a as IUserRepository, P as PlatformBreakdown, U as USER_COLLECTIONS, b as USER_SUBCOLLECTIONS, c as User, d as UserAnalytics, e as UserConnectedAccount, f as UserContent, g as UserCredits, h as UserNotifications, i as UserPrivacy, j as UserProfile, k as UserSettings, l as UserSubscription } from './user.repository.interface-DS74TsJ5.js';
|
|
3
|
+
export { F as FileCategory, a as FileErrorCode, b as FileFilters, c as FileMetadata, d as FileQueryResult, e as FileType, f as FileUploadResult, g as FileValidationOptions, I as IFileRepository, S as StorageStats, U as UploadOptions, h as UploadProgress, i as UploadResult, j as UploadState, V as ValidationResult } from './file.repository.interface-v5vHgVsZ.js';
|
|
4
|
+
export { AuthError, AuthErrorCode, Email, FilePath, IBaseRepository, RepositoryError, RepositoryErrorCode, ServerTimestamp, Timestamp, TimestampField, UserId, createAuthError, createRepositoryError, serverTimestamp } from './domain/index.js';
|
|
5
|
+
export { CreateUserDTO, DeleteAccountDTO, DeleteAccountUseCase, ResetPasswordDTO, ResetPasswordUseCase, SignInDTO, SignInUseCase, SignInWithGoogleUseCase, SignOutUseCase, SignUpDTO, SignUpResult, SignUpUseCase, UpdateEmailDTO, UpdatePasswordDTO, UpdateProfileDTO, UpdateProfileUseCase, UpdateUserDTO, UpdateUserSettingsDTO, UpdateUserSubscriptionDTO, UserQueryResult } from './application/index.js';
|
|
6
|
+
export { AuthAdapter, FirebaseInstances, FirestoreAdapter, StorageAdapter, StorageUploadResult, analytics, app, auth, db, deleteFile, functions, getFirebaseAnalytics, getFirebaseApp, getFirebaseAuth, getFirebaseDB, getFirebaseFunctions, getFirebaseInstances, getFirebaseStorage, initializeFirebase, storage, uploadBase64, uploadFile } from './infrastructure/index.js';
|
|
7
|
+
export { UseFirebaseAuthOptions, UseFirebaseAuthReturn, useFirebaseAuth } from './presentation/index.js';
|
|
8
|
+
import 'firebase/auth';
|
|
9
|
+
import 'firebase/firestore';
|
|
10
|
+
import 'firebase/app';
|
|
11
|
+
import 'firebase/storage';
|
|
12
|
+
import 'firebase/analytics';
|
|
13
|
+
import 'firebase/functions';
|
|
14
|
+
import '@firebase/util';
|