hubsight_sdk 1.2.3
hubsight_sdk: ^1.2.3 copied to clipboard
Standard Flutter SDK for HubSight CCTV Surveillance Platform. Provides Zero-Config enrollment (.hscfg), Atomic 401 token refresh, Multi-View WebRTC batching, and Real-time Thumbnails.
Changelog #
All notable changes to this project will be documented in this file.
1.2.3 - 2026-09-18 #
Fixed #
- ONVIF Probe Route: Corrected
Endpoints.onvifProbeto call the core App API route/api/app/v1/onvif/probeinstead of/api/onvif/probe. Added a regression assertion for the absolute route.
1.2.2 - 2026-09-15 #
Added #
- JWT Access Token Claims:
- Added
HubSightJWTClaimsmodel to inspect claims (sub,username,role,session_id,expiresAt,issuedAt,isExpired) directly client-side. - Added
AuthResult.claimsandAuthResult.tokenType(Bearer). - Added
HubSightAuthManager.getClaims()to decode claims from currently stored access tokens without network roundtrips.
- Added
- Multi-View Batching Models & Camera Service API:
- Added strongly-typed batch models:
BatchWebRTCItem(supports bothsdpOfferandoffer),BatchWebRTCResultItem,BatchHeartbeatItem,BatchHeartbeatResponse, andBatchReleaseResponse. - Added
HubSightCameraService.batchWebRTC(),batchHeartbeat(), andbatchRelease()methods. - Updated
MultiViewStreamSessionto support flexible lease andcamera_idspayloads.
- Added strongly-typed batch models:
- Dedicated App v1 Passkeys Endpoints:
- Updated
Endpoints.authPasskeyLoginOptionsandEndpoints.authPasskeyLoginVerifyto align with the new/api/app/v1/auth/passkeys/login/*backend routes.
- Updated
- ONVIF Probe Route:
- Aligned
Endpoints.onvifProbewith backend router path/api/onvif/probe.
- Aligned
1.2.1 - 2026-09-13 #
Added #
- ONVIF Profile S PTZ Controls & Presets:
- Continuous, relative, and stop Pan/Tilt/Zoom movements (
HubSightCameraService.ptz,continuousMove,relativeMove,stopPtz). - Camera preset positions management (
getPresets,gotoPreset,setPreset,removePreset). - ONVIF discovery and inspection probe (
probeONVIF). - Added
onvifEnabledandonvifPtzSupportedfields toCameramodel. - Added strongly-typed PTZ models:
PTZActionType,PTZActionInput,PresetItem,ONVIFDeviceInfo,ONVIFMediaProfile, andONVIFProbeResult.
- Continuous, relative, and stop Pan/Tilt/Zoom movements (
- HubSightPtzPad Flutter Widget:
- Touch-sensitive 8-way continuous D-Pad, center emergency Stop button, Zoom In/Out controls, and preset navigation chips.
- Batch Notifications Alias:
- Added
batchDeleteNotifications()convenience alias inHubSightNotificationService.
- Added
- Standardized ONVIF Error Codes:
- Added
onvifProbeFailed,onvifNotEnabled,onvifPtzNotSupported, andonvifActionFailedwith bilingual English and Vietnamese error resolvers.
- Added
1.2.0 - 2026-09-13 #
Added #
- Batch Notification Deletion: Added
HubSightNotificationService.deleteNotifications()forDELETE /api/app/v1/notifications/batch, including empty/duplicate ID normalization and the typed deleted-record count returned by the HubSight API.
1.1.4 - 2026-09-13 #
Added #
- Standardized Machine-Readable API Error Codes: Aligned with HubSight backend zero-human-readable error response contract (
code,error,details). Added support forauthTwoFactorExpired,authSessionNotFound,authCannotRevokeCurrent,authIncorrectPassword,authPasswordRequired,authMustChangePassword,authPasskeyFailed,streamNotFound,poolUnavailable,databaseError,storageError,storageUnavailable,pushTokenRequired,configInvalidPinLength,configNotFound,configPackFailed,firebaseInspectFailed,invalidInput,notFound,conflict, andtooManyRequests. - Dual-Locale Error Message Resolver: Introduced
HubSightDefaultErrorResolverandHubSightErrorCode.description([locale])with built-in English and Vietnamese message mappings matching HubSight WebApp i18n specifications. - H.264 Passthrough Optimization: Prioritized H.264 video codecs in SDP offers (
_preferH264) to trigger hardware acceleration on devices and avoid server-side CPU transcoding lag. - Rendering Performance: Added
RepaintBoundaryand optimized filter quality onHubSightWebRTCView.
Fixed #
- Regression: Incorrect HTTP API Base URL reintroduced:
HubSightSDK.initialize()had reverted to preferringgateway_urloverapi_base_urlfor the Dio client'sbaseUrl(regression from the 1.1.1 fix, introduced in the 1.1.2/1.1.3 device-metadata changes).initialize()now consistently usesapi_base_url, matchingHubSightApiClient.updateConfig(). - Two-Factor Authentication Status Compatibility:
AuthResult.fromJsonnow accepts bothtwo_factor_requiredand2fa_requiredstatuses.
1.1.1 - 2026-09-13 #
Fixed #
- Incorrect HTTP API Base URL:
HubSightSDK.initialize()andHubSightApiClient.updateConfig()were usinggateway_url(no/apisuffix) instead ofapi_base_urlto configure the Dio client'sbaseUrl, causing all REST API calls to hit the wrong path. Requests now correctly targetapi_base_urlas defined in the.hscfgconfig.
1.1.0 - 2026-09-12 #
Added #
- Geolocation Support in Session Management & Device Metadata:
- Added geolocation coordinates (
geoCity,geoCountry,geoRegion,geoLatitude,geoLongitude,geoAccuracy) and device audit fields (ipAddress,userAgent,deviceFingerprint,deviceLabel,clientType,isNewDevice,isActive,lastActiveAt,revokedAt,revokeReason) toSessionItem. - Extended
HubSightDeviceMetadataandDeviceInfoCollector.collect()to support passing GPS / OS location (latitude,longitude,accuracy,geoCity,geoCountry,geoRegion). - Updated
HubSightAuthManager.login()andHubSightAuthManager.verify2FA()to accept optional geolocation parameters. - Added public getter
deviceMetadataonHubSightApiClient.
- Added geolocation coordinates (
1.0.0 - 2026-09-11 #
Added #
- Zero-Config Enrollment (
.hscfg): Support for decrypting multi-layered.hscfgsecure container with 6-digit PIN using Argon2id (64MB RAM, 4 rounds) + AES-256-GCM (AAD:HSCFG\x01) + Ed25519 digital signature + In-Memory ZIP decompression. - Atomic Token Refresh (Anti Race-Condition 401): Interceptor with Mutex queue and token freshness check preventing duplicate refresh calls when multiple requests fail simultaneously.
- Emergency Kill-Switch (HTTP 503): Automatic handling of
APP_API_DISABLEDandRetry-After: 300headers. - Client Device Metadata Contract: Device fingerprinting (SHA-256) and dual HTTP header injection (
X-Device-Fingerprint,X-Device-Label,X-Client-Type). - Real-time Camera Thumbnails: Camera list snapshot widget
HubSightCameraThumbnailwith automatic refresh andgaplessPlayback: true. - Multi-View Batching: Single SDP exchange request (
batch-webrtc), unified 30s heartbeat (batch-heartbeat), and batch release (batch-release). - NVR Archive & Playback: Calendar recording query, timeline segments, and direct presigned MP4 stream playback.
- FCM Push Notification Lifecycle: Push token registration on login, unregistration on logout, and lightweight badge unread counter.
- Real-time Relay & Remote Session Revocation: Socket.IO client listening for
session:revokedto kick revoked devices immediately. - App Lifecycle Management: Automatic cleanup and stream pausing when app enters background.
- Ready-to-Use UI Widgets:
HubSightCameraThumbnail,HubSightWebRTCView, andHubSightMultiViewGrid. - Comprehensive Test Suite: Unit tests covering crypto, interceptors, services, and models.
- Full Demo Example App: Interactive Flutter demo application in
example/.