feat: fai_dart_sdk scaffold

Dart package skeleton for the F∆I gRPC client. Used by F∆I
Studio (Tier-2) and Tier-3 domain apps (DigiScout / J∆I /
Scout). Public surface — HubClient, HubEndpoint — is committed
as a typed stub so downstream apps can compile against it
immediately. Generated proto bindings land in a follow-up
commit once the codegen step (planned: tools/generate.sh
wrapping protoc-gen-dart against ../fai_platform/proto) is
wired in.

Future Forgejo path: fai/dart-sdk.

dart analyze: clean. dart test: 4/4.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-05 14:19:39 +02:00
commit d405a6a9bd
9 changed files with 216 additions and 0 deletions

View file

@ -0,0 +1,31 @@
import 'package:fai_dart_sdk/fai_dart_sdk.dart';
import 'package:test/test.dart';
void main() {
group('HubEndpoint', () {
test('default endpoint targets local fai serve', () {
const e = HubEndpoint();
expect(e.host, '127.0.0.1');
expect(e.port, 50051);
expect(e.secure, false);
expect(e.toString(), 'http://127.0.0.1:50051');
});
test('secure flag flips scheme', () {
const e = HubEndpoint(host: 'hub.example', port: 443, secure: true);
expect(e.toString(), 'https://hub.example:443');
});
});
group('HubClient', () {
test('constructs with default endpoint', () {
final c = HubClient();
expect(c.endpoint.host, '127.0.0.1');
});
test('close is a no-op on the stub', () async {
final c = HubClient();
await c.close();
});
});
}