@umituz/react-native-auth 3.4.33 → 3.4.35
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/README.md +323 -442
- package/src/domain/ConfigAndErrors.md +296 -431
- package/src/domain/README.md +361 -210
- package/src/domain/entities/AuthUser.md +231 -372
- package/src/domain/entities/UserProfile.md +271 -441
- package/src/infrastructure/README.md +388 -444
- package/src/infrastructure/services/README.md +386 -312
- package/src/presentation/README.md +631 -563
- package/src/presentation/components/ProfileSection.tsx +3 -1
- package/src/presentation/components/README.md +254 -92
- package/src/presentation/hooks/README.md +247 -83
- package/src/presentation/hooks/useUserProfile.ts +1 -0
- package/src/presentation/screens/README.md +151 -153
package/src/domain/README.md
CHANGED
|
@@ -1,293 +1,444 @@
|
|
|
1
1
|
# Domain Layer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core business logic, domain entities, value objects, and domain rules.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
## Strategy
|
|
8
|
+
|
|
9
|
+
**Purpose**: Contains business rules and domain models independent of external dependencies. Represents the core authentication logic.
|
|
10
|
+
|
|
11
|
+
**When to Use**:
|
|
12
|
+
- Understanding business rules
|
|
13
|
+
- Working with domain entities
|
|
14
|
+
- Implementing validation
|
|
15
|
+
- Learning about data structures
|
|
16
|
+
|
|
17
|
+
**Location**: `src/domain/`
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Structure
|
|
22
|
+
|
|
23
|
+
### Entities
|
|
24
|
+
|
|
25
|
+
**entities/AuthUser.ts** - Provider-agnostic user entity
|
|
26
|
+
**entities/UserProfile.ts** - User profile for Firestore
|
|
27
|
+
|
|
28
|
+
### Value Objects
|
|
29
|
+
|
|
30
|
+
**value-objects/AuthConfig.ts** - Authentication configuration
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
### Errors
|
|
33
|
+
|
|
34
|
+
**errors/AuthError.ts** - Domain-specific error hierarchy
|
|
35
|
+
|
|
36
|
+
### Utils
|
|
37
|
+
|
|
38
|
+
**utils/anonymousNameGenerator.ts** - Anonymous name generation
|
|
39
|
+
**utils/migration.ts** - Data migration utilities
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Domain Entities
|
|
22
44
|
|
|
23
45
|
### AuthUser
|
|
24
46
|
|
|
25
|
-
|
|
47
|
+
**PURPOSE**: Provider-agnostic user entity for authentication
|
|
26
48
|
|
|
49
|
+
**IMPORT PATH**:
|
|
27
50
|
```typescript
|
|
28
51
|
import type { AuthUser } from '@umituz/react-native-auth';
|
|
29
|
-
|
|
30
|
-
const user: AuthUser = {
|
|
31
|
-
uid: 'user-123',
|
|
32
|
-
email: 'user@example.com',
|
|
33
|
-
displayName: 'John Doe',
|
|
34
|
-
photoURL: 'https://...',
|
|
35
|
-
isAnonymous: false,
|
|
36
|
-
provider: 'google',
|
|
37
|
-
emailVerified: true,
|
|
38
|
-
};
|
|
39
52
|
```
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
54
|
+
**PROPERTIES**:
|
|
55
|
+
- `uid: string` - Unique user identifier
|
|
56
|
+
- `email: string | null` - Email address
|
|
57
|
+
- `displayName: string | null` - Display name
|
|
58
|
+
- `photoURL: string | null` - Profile photo URL
|
|
59
|
+
- `isAnonymous: boolean` - Anonymous flag
|
|
60
|
+
- `emailVerified: boolean` - Email verification status
|
|
61
|
+
- `provider: AuthProviderType` - Auth provider type
|
|
46
62
|
|
|
47
|
-
**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
**Rules**:
|
|
64
|
+
- MUST have unique uid
|
|
65
|
+
- MUST NOT have empty uid
|
|
66
|
+
- Anonymous users have null email
|
|
67
|
+
- Provider indicates auth method
|
|
68
|
+
- Email can be null for social auth
|
|
52
69
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
70
|
+
**MUST NOT**:
|
|
71
|
+
- Allow empty uid
|
|
72
|
+
- Change uid after creation
|
|
73
|
+
- Have anonymous user with email
|
|
74
|
+
- Use invalid provider type
|
|
75
|
+
|
|
76
|
+
**Documentation**: `entities/AuthUser.md`
|
|
77
|
+
|
|
78
|
+
---
|
|
57
79
|
|
|
58
80
|
### UserProfile
|
|
59
81
|
|
|
60
|
-
|
|
82
|
+
**PURPOSE**: User profile entity for Firestore document storage
|
|
61
83
|
|
|
84
|
+
**IMPORT PATH**:
|
|
62
85
|
```typescript
|
|
63
86
|
import type { UserProfile } from '@umituz/react-native-auth';
|
|
64
|
-
|
|
65
|
-
const profile: UserProfile = {
|
|
66
|
-
displayName: 'John Doe',
|
|
67
|
-
photoURL: 'https://...',
|
|
68
|
-
bio: 'Software developer',
|
|
69
|
-
location: 'Istanbul',
|
|
70
|
-
website: 'https://johndoe.com',
|
|
71
|
-
};
|
|
72
87
|
```
|
|
73
88
|
|
|
74
|
-
**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
89
|
+
**PROPERTIES**:
|
|
90
|
+
- `uid: string` - User ID
|
|
91
|
+
- `email: string | null` - Email address
|
|
92
|
+
- `displayName: string | null` - Display name
|
|
93
|
+
- `photoURL: string | null` - Profile photo URL
|
|
94
|
+
- `isAnonymous: boolean` - Anonymous flag
|
|
95
|
+
- `createdAt: Date | null` - Account creation date
|
|
96
|
+
- `lastLoginAt: Date | null` - Last login timestamp
|
|
97
|
+
|
|
98
|
+
**Rules**:
|
|
99
|
+
- MUST create on user registration
|
|
100
|
+
- MUST include uid
|
|
101
|
+
- MUST set initial timestamps
|
|
102
|
+
- MUST validate updates
|
|
103
|
+
- MUST handle partial updates
|
|
104
|
+
|
|
105
|
+
**MUST NOT**:
|
|
106
|
+
- Delete existing profiles
|
|
107
|
+
- Skip validation
|
|
108
|
+
- Use client timestamps
|
|
109
|
+
- Overwrite without checking
|
|
110
|
+
|
|
111
|
+
**Documentation**: `entities/UserProfile.md`
|
|
112
|
+
|
|
113
|
+
---
|
|
80
114
|
|
|
81
115
|
## Value Objects
|
|
82
116
|
|
|
83
117
|
### AuthConfig
|
|
84
118
|
|
|
85
|
-
Authentication
|
|
119
|
+
**PURPOSE**: Authentication configuration value object
|
|
86
120
|
|
|
121
|
+
**IMPORT PATH**:
|
|
87
122
|
```typescript
|
|
88
|
-
import { AuthConfig
|
|
89
|
-
|
|
90
|
-
const config: AuthConfig = {
|
|
91
|
-
password: {
|
|
92
|
-
minLength: 8,
|
|
93
|
-
requireUppercase: true,
|
|
94
|
-
requireLowercase: true,
|
|
95
|
-
requireNumbers: true,
|
|
96
|
-
requireSpecialChars: true,
|
|
97
|
-
},
|
|
98
|
-
social: {
|
|
99
|
-
google: {
|
|
100
|
-
iosClientId: '...',
|
|
101
|
-
webClientId: '...',
|
|
102
|
-
},
|
|
103
|
-
apple: {
|
|
104
|
-
enabled: true,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
};
|
|
123
|
+
import type { AuthConfig } from '@umituz/react-native-auth';
|
|
108
124
|
```
|
|
109
125
|
|
|
110
|
-
|
|
126
|
+
**COMPONENTS**:
|
|
127
|
+
- `password: PasswordConfig` - Password requirements
|
|
128
|
+
- `social?: SocialAuthConfig` - Social provider config
|
|
129
|
+
|
|
130
|
+
**PasswordConfig**:
|
|
131
|
+
- `minLength: number` - Minimum password length
|
|
132
|
+
- `requireUppercase: boolean` - Require uppercase
|
|
133
|
+
- `requireLowercase: boolean` - Require lowercase
|
|
134
|
+
- `requireNumber: boolean` - Require number
|
|
135
|
+
- `requireSpecialChar: boolean` - Require special character
|
|
136
|
+
|
|
137
|
+
**Rules**:
|
|
138
|
+
- MUST set minLength between 4-128
|
|
139
|
+
- MUST validate password against config
|
|
140
|
+
- MUST provide password config
|
|
141
|
+
- MAY provide social config
|
|
142
|
+
|
|
143
|
+
**MUST NOT**:
|
|
144
|
+
- Set minLength < 4
|
|
145
|
+
- Set minLength > 128
|
|
146
|
+
- Skip validation
|
|
147
|
+
|
|
148
|
+
**Documentation**: `ConfigAndErrors.md`
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Domain Errors
|
|
111
153
|
|
|
112
154
|
### AuthError Hierarchy
|
|
113
155
|
|
|
156
|
+
**PURPOSE**: Type-safe error handling with clear error types
|
|
157
|
+
|
|
158
|
+
**IMPORT PATH**:
|
|
114
159
|
```typescript
|
|
115
160
|
import {
|
|
116
161
|
AuthError,
|
|
117
|
-
AuthInitializationError,
|
|
118
|
-
AuthConfigurationError,
|
|
119
|
-
AuthValidationError,
|
|
120
|
-
AuthNetworkError,
|
|
121
162
|
AuthUserNotFoundError,
|
|
122
163
|
AuthWrongPasswordError,
|
|
123
164
|
AuthEmailAlreadyInUseError,
|
|
124
165
|
AuthWeakPasswordError,
|
|
125
166
|
AuthInvalidEmailError,
|
|
167
|
+
AuthNetworkError
|
|
126
168
|
} from '@umituz/react-native-auth';
|
|
127
169
|
```
|
|
128
170
|
|
|
129
|
-
**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
171
|
+
**ERROR TYPES**:
|
|
172
|
+
- `AuthUserNotFoundError` - User not found
|
|
173
|
+
- `AuthWrongPasswordError` - Incorrect password
|
|
174
|
+
- `AuthEmailAlreadyInUseError` - Email already registered
|
|
175
|
+
- `AuthWeakPasswordError` - Password too weak
|
|
176
|
+
- `AuthInvalidEmailError` - Invalid email format
|
|
177
|
+
- `AuthNetworkError` - Network connection failure
|
|
178
|
+
|
|
179
|
+
**Rules**:
|
|
180
|
+
- MUST use domain errors (not Firebase)
|
|
181
|
+
- MUST map Firebase errors to domain
|
|
182
|
+
- MUST preserve error context
|
|
183
|
+
- MUST show user-friendly messages
|
|
184
|
+
- MUST not expose system details
|
|
185
|
+
|
|
186
|
+
**MUST NOT**:
|
|
187
|
+
- Throw Firebase errors directly
|
|
188
|
+
- Expose error codes
|
|
189
|
+
- Show stack traces
|
|
190
|
+
- Reveal sensitive information
|
|
191
|
+
|
|
192
|
+
**Documentation**: `ConfigAndErrors.md`
|
|
193
|
+
|
|
194
|
+
---
|
|
143
195
|
|
|
144
|
-
##
|
|
196
|
+
## Domain Utilities
|
|
145
197
|
|
|
146
198
|
### Anonymous Name Generator
|
|
147
199
|
|
|
148
|
-
|
|
200
|
+
**PURPOSE**: Generate random names for anonymous users
|
|
149
201
|
|
|
202
|
+
**IMPORT PATH**:
|
|
150
203
|
```typescript
|
|
151
204
|
import {
|
|
152
205
|
generateAnonymousName,
|
|
153
206
|
getAnonymousDisplayName
|
|
154
207
|
} from '@umituz/react-native-auth';
|
|
208
|
+
```
|
|
155
209
|
|
|
156
|
-
|
|
157
|
-
|
|
210
|
+
**FUNCTIONS**:
|
|
211
|
+
- `generateAnonymousName(uid, config?)` - Generate anonymous name
|
|
212
|
+
- `getAnonymousDisplayName(uid)` - Get display name only
|
|
158
213
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// "Guest_Clever_Fox_456"
|
|
214
|
+
**CONFIGURATION**:
|
|
215
|
+
- `prefix` - Name prefix (default: 'User')
|
|
216
|
+
- `adjectiveCount` - Number of adjectives (default: 2)
|
|
217
|
+
- `nounCount` - Number of nouns (default: 1)
|
|
218
|
+
- `showNumbers` - Include numbers (default: true)
|
|
165
219
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
220
|
+
**Rules**:
|
|
221
|
+
- MUST be deterministic for same uid
|
|
222
|
+
- MUST generate unique names
|
|
223
|
+
- MUST be human-readable
|
|
224
|
+
- MUST not contain offensive words
|
|
225
|
+
- MUST support custom configuration
|
|
169
226
|
|
|
170
|
-
**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
nounCount?: number; // Varsayılan: 1
|
|
176
|
-
showNumbers?: boolean; // Varsayılan: true
|
|
177
|
-
}
|
|
178
|
-
```
|
|
227
|
+
**MUST NOT**:
|
|
228
|
+
- Generate duplicate names
|
|
229
|
+
- Use offensive language
|
|
230
|
+
- Be non-deterministic
|
|
231
|
+
- Ignore configuration
|
|
179
232
|
|
|
180
|
-
|
|
233
|
+
---
|
|
181
234
|
|
|
182
|
-
|
|
235
|
+
### Migration Utilities
|
|
183
236
|
|
|
184
|
-
|
|
185
|
-
import { migrateUserData, configureMigration } from '@umituz/react-native-auth';
|
|
186
|
-
|
|
187
|
-
// Migration konfigürasyonu
|
|
188
|
-
configureMigration({
|
|
189
|
-
from: 'legacy_users',
|
|
190
|
-
to: 'users',
|
|
191
|
-
transform: (legacyData) => ({
|
|
192
|
-
displayName: legacyData.name,
|
|
193
|
-
email: legacyData.email_address,
|
|
194
|
-
createdAt: legacyData.joined_at,
|
|
195
|
-
}),
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
// Migration çalıştırma
|
|
199
|
-
await migrateUserData(userId);
|
|
200
|
-
```
|
|
237
|
+
**PURPOSE**: Migrate user data between collections
|
|
201
238
|
|
|
202
|
-
**
|
|
239
|
+
**IMPORT PATH**:
|
|
203
240
|
```typescript
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
transform: (old) => ({
|
|
209
|
-
displayName: old.full_name,
|
|
210
|
-
email: old.email_addr,
|
|
211
|
-
photoURL: old.profile_pic,
|
|
212
|
-
createdAt: old.created_at,
|
|
213
|
-
metadata: {
|
|
214
|
-
migratedFrom: 'legacy',
|
|
215
|
-
migratedAt: Date.now(),
|
|
216
|
-
},
|
|
217
|
-
}),
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
try {
|
|
221
|
-
await migrateUserData(userId);
|
|
222
|
-
console.log('Migration successful');
|
|
223
|
-
} catch (error) {
|
|
224
|
-
console.error('Migration failed:', error);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
241
|
+
import {
|
|
242
|
+
migrateUserData,
|
|
243
|
+
configureMigration
|
|
244
|
+
} from '@umituz/react-native-auth';
|
|
227
245
|
```
|
|
228
246
|
|
|
229
|
-
|
|
247
|
+
**FUNCTIONS**:
|
|
248
|
+
- `configureMigration(config)` - Configure migration
|
|
249
|
+
- `migrateUserData(userId)` - Run migration
|
|
230
250
|
|
|
231
|
-
|
|
251
|
+
**CONFIGURATION**:
|
|
252
|
+
- `from` - Source collection name
|
|
253
|
+
- `to` - Target collection name
|
|
254
|
+
- `transform` - Data transformation function
|
|
255
|
+
- `verify` - Verification function (optional)
|
|
232
256
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
257
|
+
**Rules**:
|
|
258
|
+
- MUST configure before migrating
|
|
259
|
+
- MUST transform data correctly
|
|
260
|
+
- MUST handle migration errors
|
|
261
|
+
- MUST verify migration success
|
|
262
|
+
- MUST not delete source automatically
|
|
237
263
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
264
|
+
**MUST NOT**:
|
|
265
|
+
- Skip configuration
|
|
266
|
+
- Lose data during migration
|
|
267
|
+
- Assume identical schemas
|
|
268
|
+
- Delete source without verification
|
|
241
269
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
```
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Type Guards
|
|
246
273
|
|
|
247
|
-
|
|
274
|
+
### User Type Guards
|
|
248
275
|
|
|
249
|
-
|
|
276
|
+
**PURPOSE**: Type-safe user checking
|
|
250
277
|
|
|
278
|
+
**IMPORT PATH**:
|
|
251
279
|
```typescript
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (!user.displayName || user.displayName.length < 2) {
|
|
260
|
-
errors.push('Display name must be at least 2 characters');
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return {
|
|
264
|
-
isValid: errors.length === 0,
|
|
265
|
-
errors,
|
|
266
|
-
};
|
|
267
|
-
}
|
|
280
|
+
import {
|
|
281
|
+
isAuthenticatedUser,
|
|
282
|
+
isAnonymousUser,
|
|
283
|
+
hasEmail
|
|
284
|
+
} from '@umituz/react-native-auth';
|
|
268
285
|
```
|
|
269
286
|
|
|
287
|
+
**GUARDS**:
|
|
288
|
+
- `isAuthenticatedUser(user)` - Check if authenticated user
|
|
289
|
+
- `isAnonymousUser(user)` - Check if anonymous user
|
|
290
|
+
- `hasEmail(user)` - Check if has email
|
|
291
|
+
|
|
292
|
+
**Rules**:
|
|
293
|
+
- MUST use for type narrowing
|
|
294
|
+
- MUST validate before operations
|
|
295
|
+
- MUST check null cases
|
|
296
|
+
- MUST return boolean
|
|
297
|
+
|
|
298
|
+
**MUST NOT**:
|
|
299
|
+
- Skip type guards
|
|
300
|
+
- Assume user type
|
|
301
|
+
- Skip null checks
|
|
302
|
+
- Return non-boolean
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
270
306
|
## Domain Rules
|
|
271
307
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
308
|
+
### AuthUser Rules
|
|
309
|
+
|
|
310
|
+
**MUST**:
|
|
311
|
+
- Have unique uid
|
|
312
|
+
- Validate uid not empty
|
|
313
|
+
- Validate email format if provided
|
|
314
|
+
- Check provider is valid
|
|
315
|
+
- Verify required fields
|
|
316
|
+
|
|
317
|
+
**MUST NOT**:
|
|
318
|
+
- Allow empty uid
|
|
319
|
+
- Accept invalid email
|
|
320
|
+
- Use wrong provider type
|
|
321
|
+
- Have anonymous user with email
|
|
322
|
+
|
|
323
|
+
**Constraints**:
|
|
324
|
+
- uid required
|
|
325
|
+
- Email format validated
|
|
326
|
+
- Provider must be known type
|
|
327
|
+
- Anonymous users have null email
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
### UserProfile Rules
|
|
332
|
+
|
|
333
|
+
**MUST**:
|
|
334
|
+
- Validate display name 2-50 characters
|
|
335
|
+
- Validate photo URL format
|
|
336
|
+
- Use server timestamps
|
|
337
|
+
- Handle partial updates
|
|
338
|
+
- Preserve existing data
|
|
339
|
+
|
|
340
|
+
**MUST NOT**:
|
|
341
|
+
- Allow display name < 2 chars
|
|
342
|
+
- Accept invalid URLs
|
|
343
|
+
- Use client timestamps
|
|
344
|
+
- Overwrite existing data
|
|
345
|
+
|
|
346
|
+
**Constraints**:
|
|
347
|
+
- Display name min 2, max 100 chars
|
|
348
|
+
- Cannot be only whitespace
|
|
349
|
+
- Valid URL required for photoURL
|
|
350
|
+
- One profile per uid
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
### Password Rules
|
|
355
|
+
|
|
356
|
+
**MUST**:
|
|
357
|
+
- Enforce minimum length
|
|
358
|
+
- Check uppercase if required
|
|
359
|
+
- Check lowercase if required
|
|
360
|
+
- Check number if required
|
|
361
|
+
- Check special char if required
|
|
362
|
+
|
|
363
|
+
**MUST NOT**:
|
|
364
|
+
- Allow weak passwords
|
|
365
|
+
- Skip validation checks
|
|
366
|
+
- Accept passwords below minimum
|
|
367
|
+
|
|
368
|
+
**Constraints**:
|
|
369
|
+
- Minimum length: 4-128 chars
|
|
370
|
+
- Requirements configurable
|
|
371
|
+
- All requirements optional
|
|
372
|
+
- Default min length: 6 (lenient)
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Best Practices
|
|
377
|
+
|
|
378
|
+
### Entity Usage
|
|
379
|
+
|
|
380
|
+
**MUST**:
|
|
381
|
+
- Use type guards for type narrowing
|
|
382
|
+
- Validate before operations
|
|
383
|
+
- Handle null values appropriately
|
|
384
|
+
- Follow domain rules
|
|
385
|
+
- Use proper error types
|
|
386
|
+
|
|
387
|
+
**MUST NOT**:
|
|
388
|
+
- Skip validation
|
|
389
|
+
- Assume required fields present
|
|
390
|
+
- Ignore null cases
|
|
391
|
+
- Use generic error types
|
|
392
|
+
- Break domain rules
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### Error Handling
|
|
397
|
+
|
|
398
|
+
**MUST**:
|
|
399
|
+
- Use domain error types
|
|
400
|
+
- Map provider errors to domain
|
|
401
|
+
- Provide context
|
|
402
|
+
- Show user-friendly messages
|
|
403
|
+
- Preserve error information
|
|
404
|
+
|
|
405
|
+
**MUST NOT**:
|
|
406
|
+
- Throw provider errors
|
|
407
|
+
- Expose technical details
|
|
408
|
+
- Lose error context
|
|
409
|
+
- Show stack traces
|
|
410
|
+
- Reveal sensitive data
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
### Configuration
|
|
415
|
+
|
|
416
|
+
**MUST**:
|
|
417
|
+
- Validate configuration
|
|
418
|
+
- Use appropriate defaults
|
|
419
|
+
- Test with production config
|
|
420
|
+
- Not use dev config in production
|
|
421
|
+
|
|
422
|
+
**MUST NOT**:
|
|
423
|
+
- Skip validation
|
|
424
|
+
- Use invalid config
|
|
425
|
+
- Ignore environment differences
|
|
426
|
+
- Hardcode production values
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Related Modules
|
|
431
|
+
|
|
432
|
+
- **Application** (`../application/README.md`) - Ports and interfaces
|
|
433
|
+
- **Infrastructure** (`../infrastructure/README.md`) - Implementations
|
|
434
|
+
- **Presentation** (`../presentation/README.md`) - UI components
|
|
276
435
|
|
|
277
|
-
|
|
278
|
-
- `displayName` en az 2 karakter olmalı
|
|
279
|
-
- `email` geçerli formatta olmalı
|
|
280
|
-
- `photoURL` geçerli URL olmalı
|
|
436
|
+
---
|
|
281
437
|
|
|
282
|
-
|
|
283
|
-
- Minimum 8 karakter
|
|
284
|
-
- En az 1 büyük harf
|
|
285
|
-
- En az 1 küçük harf
|
|
286
|
-
- En az 1 rakam
|
|
287
|
-
- En az 1 özel karakter
|
|
438
|
+
## Entity Documentation
|
|
288
439
|
|
|
289
|
-
|
|
440
|
+
### Detailed Entity Docs
|
|
290
441
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
442
|
+
**AuthUser**: `entities/AuthUser.md`
|
|
443
|
+
**UserProfile**: `entities/UserProfile.md`
|
|
444
|
+
**AuthConfig & AuthError**: `ConfigAndErrors.md`
|