- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
65 lines
1.8 KiB
Swift
65 lines
1.8 KiB
Swift
import ExpoModulesCore
|
|
|
|
internal class InvalidKeyException: Exception {
|
|
override var reason: String {
|
|
"Invalid key"
|
|
}
|
|
}
|
|
|
|
internal class MissingPlistKeyException: Exception {
|
|
override var reason: String {
|
|
"You must set `NSFaceIDUsageDescription` in your Info.plist file to use the `requireAuthentication` option"
|
|
}
|
|
}
|
|
|
|
internal class KeyChainException: GenericException<OSStatus> {
|
|
override var reason: String {
|
|
switch param {
|
|
case errSecUnimplemented:
|
|
return "Function or operation not implemented."
|
|
|
|
case errSecIO:
|
|
return "I/O error."
|
|
|
|
case errSecOpWr:
|
|
return "File already open with with write permission."
|
|
|
|
case errSecParam:
|
|
return "One or more parameters passed to a function where not valid."
|
|
|
|
case errSecAllocate:
|
|
return "Failed to allocate memory."
|
|
|
|
case errSecUserCanceled:
|
|
return "User canceled the operation."
|
|
|
|
case errSecBadReq:
|
|
return "Bad parameter or invalid state for operation."
|
|
|
|
case errSecNotAvailable:
|
|
return "No keychain is available. You may need to restart your computer."
|
|
|
|
case errSecDuplicateItem:
|
|
return "The specified item already exists in the keychain."
|
|
|
|
case errSecItemNotFound:
|
|
return "The specified item could not be found in the keychain."
|
|
|
|
case errSecInteractionNotAllowed:
|
|
return "User interaction is not allowed."
|
|
|
|
case errSecDecode:
|
|
return "Unable to decode the provided data."
|
|
|
|
case errSecAuthFailed:
|
|
return "Authentication failed. Provided passphrase/PIN is incorrect or there is no user authentication method configured for this device."
|
|
|
|
default:
|
|
if let errorMessage = SecCopyErrorMessageString(param, nil) as? String {
|
|
return errorMessage
|
|
}
|
|
return "Unknown Keychain Error."
|
|
}
|
|
}
|
|
}
|