EncoreBilisim.VisionSecurity
2.0.0
dotnet add package EncoreBilisim.VisionSecurity --version 2.0.0
NuGet\Install-Package EncoreBilisim.VisionSecurity -Version 2.0.0
<PackageReference Include="EncoreBilisim.VisionSecurity" Version="2.0.0" />
<PackageVersion Include="EncoreBilisim.VisionSecurity" Version="2.0.0" />
<PackageReference Include="EncoreBilisim.VisionSecurity" />
paket add EncoreBilisim.VisionSecurity --version 2.0.0
#r "nuget: EncoreBilisim.VisionSecurity, 2.0.0"
#:package EncoreBilisim.VisionSecurity@2.0.0
#addin nuget:?package=EncoreBilisim.VisionSecurity&version=2.0.0
#tool nuget:?package=EncoreBilisim.VisionSecurity&version=2.0.0
Encore Vision Security
Client library for the SaiGroups Vision Security API (.NET 8, trim/AOT compatible). One process = one self-checkout lane.
dotnet add package EncoreBilisim.VisionSecurity
Setup
using Encore.VisionSecurity.Common.Configuration;
using Encore.VisionSecurity.Common.Primitives;
services
.AddVisionSecurity(options =>
{
options.BaseAddress = new Uri("http://vision-security.store.local:8080");
options.Lane = Lane.Parse(3);
options.StoreNumber = StoreNumber.Parse("1042"); // optional
})
.AddEventQueue() // POS -> AI, ordered, non-blocking
.AddFeed<MyAlertHandler, MyNotificationHandler>(); // AI -> POS, polled in the background
Which entry point
| You are… | Use |
|---|---|
| sending POS flow events (tx-start, scan, scan-info, ui-state, tx-end, …) | IVisionSecurityEventQueue — synchronous, keeps wire order, never blocks the POS thread, stamps Ts at enqueue |
| answering alerts / notifications from the AI | IAlertHandler / INotificationHandler, registered with .AddFeed<,>(); the feed sends the feedback for you |
| calling one endpoint and awaiting its result (tools, diagnostics, tests) | IVisionSecurityClient — async, returns VisionSecurityResult<T> |
Sending events
using Encore.VisionSecurity.Contracts;
using Encore.VisionSecurity.EventQueue;
var queue = provider.GetRequiredService<IVisionSecurityEventQueue>();
queue.TxStart(txId); // every call returns immediately
queue.Scan(txId, Barcode.Parse("8690504010012"), ScanType.Product, ScanMode.Regular, mobileScan: false);
queue.ScanInfo(txId, Barcode.Parse("8690504010012"), "Milk 1L", 32.50m, quantity: 1, weight: 0m, voided: false, scanType: ScanInfoScanType.Product);
queue.UiState(txId, UiState.Payment);
queue.TxEnd(txId, EndType.Complete);
The return value is the enqueue result: Failure(ValidationError) means the request was
invalid (rejected immediately), the queue is full, or the queue is stopped. Send outcomes are
reported through ILogger<VisionSecurityEventQueue> and the encore.visionsecurity.eventqueue.*
metrics. The queue is in-memory: pending events are lost if the process dies.
TxId is yours to supply — derive it from the POS receipt identity so logs on both sides
correlate. Only one transaction may be open per lane; the queue does not enforce this.
Handling alerts
public sealed class MyAlertHandler : IAlertHandler
{
public Task<VisionSecurityResult<AlertFeedbackType>> HandleAsync(AlertResponse alert, CancellationToken ct)
=> Task.FromResult(VisionSecurityResult<AlertFeedbackType>.Success(AlertFeedbackType.NoAction));
}
Never throw from a handler; return a Failure instead. The feed still sends NO_FEEDBACK
if a handler fails, so the AI side never waits on a lost alert.
Errors
Nothing throws after construction. Every operation returns VisionSecurityResult /
VisionSecurityResult<T>; inspect with TryGetValue / TryGetError. Error kinds:
ApiError (4xx/5xx), TransportError, TimeoutError, ParseError, ValidationError,
UnknownEnumError, CancelledError, HandlerError.
Full documentation (architecture, configuration, feed flows, domain rules, library
invariants) lives in the repository: README.md, docs/kurallar.md, docs/invariants.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Options (>= 8.0.2)
- Polly.Core (>= 8.4.0 && < 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.