shernova_core 2.1.0
shernova_core: ^2.1.0 copied to clipboard
Shernova Phone Verification API — core Flutter SDK (headless). Required package for Shernova integration.
2.1.0 #
- Fair-queue visibility:
ShernovaSessionnow parsesqueue_position(1-based rank in the pool's FIFO queue),queue_total(pool size at large),queue_deadline(when the queue slot itself times out) andgateway_expires_at(the fresh dial window the server arms on promotion). All four are nullable — a session from an older server (or a non-queued session) simply carriesnull, so the parse path is byte-identical for every published response. sdkVersionreports2.1.0viaX-Shernova-SDK-Version.- New copy keys
queue_position_line({position}/{total}template) andcancel_button_label, mirrored 1:1 in the server'ssdk-ui-strings.ts(EN + AR) — the parity test keeps both sides locked. shernova_ui2.8.0 consumes the queue position line and thecancel_button_enabledbehavior flag (fallback on).
2.0.9 #
- Server-driven runtime contract: the token response now carries
poll_config(polling intervals, confirmation-window ticks, request timeout) andmaintenance. The SDK applies them with clamped parsing and falls back to the previous hardcoded values when the field is absent, so behaviour is byte-identical against older servers. - Maintenance mode:
createVerificationrefuses to book a new session while the server announces maintenance, throwing a typedmaintenance_modeerror with bilingualuser_message_ar/user_message_encopy. In-flight sessions (poll / cancel / receipt) keep working so users already verifying are never stranded. Absent or inactivemaintenanceis a no-op. - Request timeout is now server-tunable (5–60 s, default 15 s) via
poll_config.request_timeout_ms; the failure still normalizes tonetwork_unavailable. - Version negotiation groundwork: every request sends
X-Shernova-SDK-Version; the server may later reshape responses per version. Old servers ignore the header. behavior_flags(boolean record) is parsed and exposed viaShernovaPollConfig.flag()for future remote behavior switches; unknown keys are ignored.- Old-SDK compatibility locked by
test/old_sdk_compat_test.dart, which replays published-2.0.8 parse paths against a NEW server response; 55 tests total.
2.0.8 #
- Network failures become a typed code:
_sendmaps request timeouts and transport failures (socket closure, connection abort mid-/receipt) tonetwork_unavailableinstead of leaking rawClientException/SocketExceptiontext into host-app dialogs. - Bilingual server copy:
ShernovaErrorreadsuser_message_ar/user_message_enfrom API errordetails, solocalizedMessage(arabic:)returns the server's Arabic text for rate-limit, concurrent-quota, and in-progress-conflict errors without client-side string tables. ui_strings.dartgainsnetwork_error_bodyand the EN/AR key sets now stay in lock-step with the server'ssdk-ui-strings.ts; a new parity test (test/ui_strings_test.dart) fails the build if either side adds a key the other lacks.
2.0.7 #
watch()now stops on terminal failure states (failed/rejected) likeshernova_uialready did, so a headless consumer polling a rejected or phone-mismatch session no longer loops forever.
2.0.6 #
- Queued sessions:
gateway_phone_numberis now nullable (String?) and parses safely when every verification line is busy. Previously the hard cast crashed host apps withtype 'Null' is not a subtype of type 'String' in type castas soon as the server answered a create/poll with no assigned line. - Add
queue_reason(none_online/country_unavailable/all_busy) andisQueued;isWaitingnow covers bothwaitingandqueuedso the SDK keeps polling until promotion lands a line.mapShernovaStatusmapsqueuedto the waiting status. - Add
queued_body/queued_status/queued_card_labelUI strings (English defaults; the API serves localized values) for the queue state on the waiting screen (shernova_ui2.6.1+).
2.0.5 #
- Add optional
unconfirmed_title/unconfirmed_bodyUI strings for the gentle post-call "not confirmed yet" state on the waiting screen (shernova_ui2.6.0+).
2.0.4 #
- Add
ShernovaError.isGatewayUnavailableandlocalizedMessagefor gateway-down UX. - Add
gatewayUnavailableBody(and related) toShernovaUiStringsforshernova_ui2.4.6+.
2.0.3 #
isVerifiedis false whenfailure_reasonisphone_mismatch, including after webhookcompleted.
2.0.2 #
- Add
busy_retry_statusandbusy_retry_hintUI strings (API + defaults) for automatic retry when the verification line is busy.
2.0.1 #
- Parse
ui_themefrom/v1/sdk/token(logo_url, logo/footer sizes) for server-driven SDK branding without app rebuilds.
2.0.0 #
- Breaking: Package renamed from
shernovatoshernova_core. - Import:
package:shernova_core/shernova_core.dart - Test keys now use real gateways (API-side); no mock gateway or Simulate Ring.
1.0.8 #
Previous releases published as shernova on pub.dev.