This commit is contained in:
Christien Rioux 2023-07-05 17:48:06 -05:00
parent e3d66b60e4
commit d6999c36a9
22 changed files with 9697 additions and 1183 deletions

View File

@ -1,4 +1,5 @@
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
errors:
invalid_annotation_target: ignore

3
veilid-flutter/build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
set -e
dart run build_runner build

10
veilid-flutter/build.yaml Normal file
View File

@ -0,0 +1,10 @@
targets:
$default:
sources:
exclude:
- example/**
builders:
json_serializable:
options:
explicit_to_json: true
field_rename: snake

View File

@ -1,29 +1,5 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
analyzer:
errors:
invalid_annotation_target: ignore

View File

@ -0,0 +1,4 @@
#!/bin/bash
set -e
dart run build_runner build

View File

@ -112,13 +112,16 @@ class _MyAppState extends State<MyApp> with UiLoggy {
if (startup && !_startedUp) {
var config = await getDefaultVeilidConfig("Veilid Plugin Example");
if (const String.fromEnvironment("DELETE_TABLE_STORE") == "1") {
config.tableStore.delete = true;
config = config.copyWith(
tableStore: config.tableStore.copyWith(delete: true));
}
if (const String.fromEnvironment("DELETE_PROTECTED_STORE") == "1") {
config.protectedStore.delete = true;
config = config.copyWith(
protectedStore: config.protectedStore.copyWith(delete: true));
}
if (const String.fromEnvironment("DELETE_BLOCK_STORE") == "1") {
config.blockStore.delete = true;
config = config.copyWith(
blockStore: config.blockStore.copyWith(delete: true));
}
var updateStream = await Veilid.instance.startupVeilidCore(config);

View File

@ -1,6 +1,22 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a
url: "https://pub.dev"
source: hosted
version: "61.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562
url: "https://pub.dev"
source: hosted
version: "5.13.0"
ansicolor:
dependency: "direct main"
description:
@ -9,6 +25,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
args:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.4.2"
async:
dependency: transitive
description:
@ -25,6 +49,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
build:
dependency: transitive
description:
name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
build_config:
dependency: transitive
description:
name: build_config
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
url: "https://pub.dev"
source: hosted
version: "1.1.1"
build_daemon:
dependency: transitive
description:
name: build_daemon
sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b"
url: "https://pub.dev"
source: hosted
version: "2.4.6"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41"
url: "https://pub.dev"
source: hosted
version: "7.2.10"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166"
url: "https://pub.dev"
source: hosted
version: "8.6.1"
change_case:
dependency: transitive
description:
@ -49,6 +137,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
url: "https://pub.dev"
source: hosted
version: "2.0.3"
clock:
dependency: transitive
description:
@ -57,6 +153,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
code_builder:
dependency: transitive
description:
name: code_builder
sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189"
url: "https://pub.dev"
source: hosted
version: "4.5.0"
collection:
dependency: transitive
description:
@ -73,6 +177,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.3"
cupertino_icons:
dependency: "direct main"
description:
@ -81,6 +193,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
equatable:
dependency: transitive
description:
@ -121,6 +241,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter
@ -130,18 +258,18 @@ packages:
dependency: "direct main"
description:
name: flutter_acrylic
sha256: "5aea2c850c560c07717a62434ea9cb1565c2282dc78dd2e60f98a78c05f13d7b"
sha256: a9a1fdf91ff1fb47858fd82507f57e255a132a5d355056694fdb9fd303633b18
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.3"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.0.2"
flutter_test:
dependency: "direct dev"
description: flutter
@ -152,6 +280,38 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
freezed:
dependency: "direct dev"
description:
name: freezed
sha256: a9520490532087cf38bf3f7de478ab6ebeb5f68bb1eb2641546d92719b224445
url: "https://pub.dev"
source: hosted
version: "2.3.5"
freezed_annotation:
dependency: "direct main"
description:
name: freezed_annotation
sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338
url: "https://pub.dev"
source: hosted
version: "2.2.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
glob:
dependency: transitive
description:
name: glob
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
globbing:
dependency: transitive
description:
@ -160,6 +320,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
graphs:
dependency: transitive
description:
name: graphs
sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19
url: "https://pub.dev"
source: hosted
version: "2.3.1"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
io:
dependency: transitive
description:
name: io
sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
js:
dependency: transitive
description:
@ -168,14 +360,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
json_annotation:
dependency: "direct main"
description:
name: json_annotation
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
url: "https://pub.dev"
source: hosted
version: "4.8.1"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969
url: "https://pub.dev"
source: hosted
version: "6.7.1"
lints:
dependency: transitive
description:
name: lints
sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
loggy:
dependency: "direct main"
description:
@ -188,10 +404,10 @@ packages:
dependency: transitive
description:
name: macos_window_utils
sha256: "510de576b5432dd9ef9e4c258abcc021c6dfbb17a78a344688848a6784b352b8"
sha256: b78a210aa70ca7ccad6e7b7b810fb4689c507f4a46e299214900b2a1eb70ea23
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.3"
matcher:
dependency: transitive
description:
@ -216,6 +432,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.1"
mime:
dependency: transitive
description:
name: mime
sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e
url: "https://pub.dev"
source: hosted
version: "1.0.4"
package_config:
dependency: transitive
description:
name: package_config
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
path:
dependency: "direct main"
description:
@ -252,10 +484,10 @@ packages:
dependency: transitive
description:
name: path_provider_linux
sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1"
sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57
url: "https://pub.dev"
source: hosted
version: "2.1.10"
version: "2.1.11"
path_provider_platform_interface:
dependency: transitive
description:
@ -268,10 +500,10 @@ packages:
dependency: transitive
description:
name: path_provider_windows
sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6
sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96"
url: "https://pub.dev"
source: hosted
version: "2.1.6"
version: "2.1.7"
platform:
dependency: transitive
description:
@ -296,6 +528,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
pool:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
process:
dependency: transitive
description:
@ -304,6 +544,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.2.4"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
url: "https://pub.dev"
source: hosted
version: "1.2.3"
quiver:
dependency: transitive
description:
@ -312,11 +568,43 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
shelf:
dependency: transitive
description:
name: shelf
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
url: "https://pub.dev"
source: hosted
version: "1.4.1"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16
url: "https://pub.dev"
source: hosted
version: "1.4.0"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd"
url: "https://pub.dev"
source: hosted
version: "1.3.4"
source_span:
dependency: transitive
description:
@ -341,6 +629,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
stream_transform:
dependency: transitive
description:
name: stream_transform
sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
@ -373,6 +669,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.5.1"
timing:
dependency: transitive
description:
name: timing
sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
typed_data:
dependency: transitive
description:
@ -396,14 +700,30 @@ packages:
relative: true
source: path
version: "0.0.1"
watcher:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
url: "https://pub.dev"
source: hosted
version: "2.4.0"
win32:
dependency: transitive
description:
name: win32
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee
url: "https://pub.dev"
source: hosted
version: "4.1.4"
version: "5.0.5"
xdg_directories:
dependency: transitive
description:
@ -420,6 +740,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.5.0"
yaml:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.0.0 <4.0.0"
flutter: ">=3.7.0"

View File

@ -38,6 +38,8 @@ dependencies:
xterm: ^3.4.0
flutter_acrylic: ^1.0.0+2
ansicolor: ^2.0.1
freezed_annotation: ^2.2.0
json_annotation: ^4.8.1
dev_dependencies:
flutter_test:
@ -49,6 +51,9 @@ dev_dependencies:
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.1
build_runner: ^2.4.6
freezed: ^2.3.5
json_serializable: ^6.7.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

5
veilid-flutter/example/run.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -e
./build.sh
flutter run $@

View File

@ -1,6 +1,9 @@
import 'dart:async';
import 'dart:typed_data';
import 'package:equatable/equatable.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'veilid_stub.dart'
if (dart.library.io) 'veilid_ffi.dart'
if (dart.library.js) 'veilid_js.dart';
@ -56,64 +59,61 @@ List<T> Function(dynamic) jsonListConstructor<T>(
//////////////////////////////////////
/// VeilidVersion
class VeilidVersion {
@immutable
class VeilidVersion extends Equatable {
final int major;
final int minor;
final int patch;
@override
List<Object> get props => [major, minor, patch];
VeilidVersion(this.major, this.minor, this.patch);
const VeilidVersion(this.major, this.minor, this.patch);
}
//////////////////////////////////////
/// Timestamp
class Timestamp {
@immutable
class Timestamp extends Equatable {
final BigInt value;
Timestamp({required this.value});
@override
List<Object> get props => [value];
const Timestamp({required this.value});
@override
String toString() {
return value.toString();
}
String toString() => value.toString();
factory Timestamp.fromString(String s) => Timestamp(value: BigInt.parse(s));
Timestamp.fromString(String s) : value = BigInt.parse(s);
String toJson() => toString();
factory Timestamp.fromJson(dynamic json) =>
Timestamp.fromString(json as String);
Timestamp.fromJson(dynamic json) : this.fromString(json as String);
String toJson() {
return toString();
}
TimestampDuration diff(Timestamp other) =>
TimestampDuration(value: value - other.value);
TimestampDuration diff(Timestamp other) {
return TimestampDuration(value: value - other.value);
}
Timestamp offset(TimestampDuration dur) {
return Timestamp(value: value + dur.value);
}
Timestamp offset(TimestampDuration dur) =>
Timestamp(value: value + dur.value);
}
class TimestampDuration {
@immutable
class TimestampDuration extends Equatable {
final BigInt value;
TimestampDuration({required this.value});
@override
List<Object> get props => [value];
const TimestampDuration({required this.value});
@override
String toString() {
return value.toString();
}
String toString() => value.toString();
factory TimestampDuration.fromString(String s) =>
TimestampDuration(value: BigInt.parse(s));
TimestampDuration.fromString(String s) : value = BigInt.parse(s);
String toJson() => toString();
factory TimestampDuration.fromJson(dynamic json) =>
TimestampDuration.fromString(json as String);
TimestampDuration.fromJson(dynamic json) : this.fromString(json as String);
String toJson() {
return toString();
}
int toMillis() {
return (value ~/ BigInt.from(1000)).toInt();
}
BigInt toMicros(Timestamp other) {
return value;
}
int toMillis() => (value ~/ BigInt.from(1000)).toInt();
BigInt toMicros() => value;
}
//////////////////////////////////////

View File

@ -1,6 +1,9 @@
import 'package:freezed_annotation/freezed_annotation.dart';
//////////////////////////////////////
/// VeilidAPIException
@immutable
abstract class VeilidAPIException implements Exception {
factory VeilidAPIException.fromJson(dynamic json) {
switch (json["kind"]) {
@ -73,6 +76,7 @@ abstract class VeilidAPIException implements Exception {
String toDisplayError();
}
@immutable
class VeilidAPIExceptionNotInitialized implements VeilidAPIException {
@override
String toString() {
@ -85,6 +89,7 @@ class VeilidAPIExceptionNotInitialized implements VeilidAPIException {
}
}
@immutable
class VeilidAPIExceptionAlreadyInitialized implements VeilidAPIException {
@override
String toString() {
@ -97,6 +102,7 @@ class VeilidAPIExceptionAlreadyInitialized implements VeilidAPIException {
}
}
@immutable
class VeilidAPIExceptionTimeout implements VeilidAPIException {
@override
String toString() {
@ -109,6 +115,7 @@ class VeilidAPIExceptionTimeout implements VeilidAPIException {
}
}
@immutable
class VeilidAPIExceptionTryAgain implements VeilidAPIException {
@override
String toString() {
@ -121,6 +128,7 @@ class VeilidAPIExceptionTryAgain implements VeilidAPIException {
}
}
@immutable
class VeilidAPIExceptionShutdown implements VeilidAPIException {
@override
String toString() {
@ -133,6 +141,7 @@ class VeilidAPIExceptionShutdown implements VeilidAPIException {
}
}
@immutable
class VeilidAPIExceptionInvalidTarget implements VeilidAPIException {
@override
String toString() {
@ -145,9 +154,9 @@ class VeilidAPIExceptionInvalidTarget implements VeilidAPIException {
}
}
@immutable
class VeilidAPIExceptionNoConnection implements VeilidAPIException {
final String message;
@override
String toString() {
return "VeilidAPIException: NoConnection (message: $message)";
@ -159,12 +168,12 @@ class VeilidAPIExceptionNoConnection implements VeilidAPIException {
}
//
VeilidAPIExceptionNoConnection(this.message);
const VeilidAPIExceptionNoConnection(this.message);
}
@immutable
class VeilidAPIExceptionKeyNotFound implements VeilidAPIException {
final String key;
@override
String toString() {
return "VeilidAPIException: KeyNotFound (key: $key)";
@ -176,9 +185,10 @@ class VeilidAPIExceptionKeyNotFound implements VeilidAPIException {
}
//
VeilidAPIExceptionKeyNotFound(this.key);
const VeilidAPIExceptionKeyNotFound(this.key);
}
@immutable
class VeilidAPIExceptionInternal implements VeilidAPIException {
final String message;
@ -193,9 +203,10 @@ class VeilidAPIExceptionInternal implements VeilidAPIException {
}
//
VeilidAPIExceptionInternal(this.message);
const VeilidAPIExceptionInternal(this.message);
}
@immutable
class VeilidAPIExceptionUnimplemented implements VeilidAPIException {
final String message;
@ -210,9 +221,10 @@ class VeilidAPIExceptionUnimplemented implements VeilidAPIException {
}
//
VeilidAPIExceptionUnimplemented(this.message);
const VeilidAPIExceptionUnimplemented(this.message);
}
@immutable
class VeilidAPIExceptionParseError implements VeilidAPIException {
final String message;
final String value;
@ -228,9 +240,10 @@ class VeilidAPIExceptionParseError implements VeilidAPIException {
}
//
VeilidAPIExceptionParseError(this.message, this.value);
const VeilidAPIExceptionParseError(this.message, this.value);
}
@immutable
class VeilidAPIExceptionInvalidArgument implements VeilidAPIException {
final String context;
final String argument;
@ -247,9 +260,11 @@ class VeilidAPIExceptionInvalidArgument implements VeilidAPIException {
}
//
VeilidAPIExceptionInvalidArgument(this.context, this.argument, this.value);
const VeilidAPIExceptionInvalidArgument(
this.context, this.argument, this.value);
}
@immutable
class VeilidAPIExceptionMissingArgument implements VeilidAPIException {
final String context;
final String argument;
@ -265,9 +280,10 @@ class VeilidAPIExceptionMissingArgument implements VeilidAPIException {
}
//
VeilidAPIExceptionMissingArgument(this.context, this.argument);
const VeilidAPIExceptionMissingArgument(this.context, this.argument);
}
@immutable
class VeilidAPIExceptionGeneric implements VeilidAPIException {
final String message;
@ -282,5 +298,5 @@ class VeilidAPIExceptionGeneric implements VeilidAPIException {
}
//
VeilidAPIExceptionGeneric(this.message);
const VeilidAPIExceptionGeneric(this.message);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,550 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'veilid_config.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$_VeilidFFIConfigLoggingTerminal _$$_VeilidFFIConfigLoggingTerminalFromJson(
Map<String, dynamic> json) =>
_$_VeilidFFIConfigLoggingTerminal(
enabled: json['enabled'] as bool,
level: VeilidConfigLogLevel.fromJson(json['level']),
);
Map<String, dynamic> _$$_VeilidFFIConfigLoggingTerminalToJson(
_$_VeilidFFIConfigLoggingTerminal instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'level': instance.level.toJson(),
};
_$_VeilidFFIConfigLoggingOtlp _$$_VeilidFFIConfigLoggingOtlpFromJson(
Map<String, dynamic> json) =>
_$_VeilidFFIConfigLoggingOtlp(
enabled: json['enabled'] as bool,
level: VeilidConfigLogLevel.fromJson(json['level']),
grpcEndpoint: json['grpc_endpoint'] as String,
serviceName: json['service_name'] as String,
);
Map<String, dynamic> _$$_VeilidFFIConfigLoggingOtlpToJson(
_$_VeilidFFIConfigLoggingOtlp instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'level': instance.level.toJson(),
'grpc_endpoint': instance.grpcEndpoint,
'service_name': instance.serviceName,
};
_$_VeilidFFIConfigLoggingApi _$$_VeilidFFIConfigLoggingApiFromJson(
Map<String, dynamic> json) =>
_$_VeilidFFIConfigLoggingApi(
enabled: json['enabled'] as bool,
level: VeilidConfigLogLevel.fromJson(json['level']),
);
Map<String, dynamic> _$$_VeilidFFIConfigLoggingApiToJson(
_$_VeilidFFIConfigLoggingApi instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'level': instance.level.toJson(),
};
_$_VeilidFFIConfigLogging _$$_VeilidFFIConfigLoggingFromJson(
Map<String, dynamic> json) =>
_$_VeilidFFIConfigLogging(
terminal: VeilidFFIConfigLoggingTerminal.fromJson(
json['terminal'] as Map<String, dynamic>),
otlp: VeilidFFIConfigLoggingOtlp.fromJson(
json['otlp'] as Map<String, dynamic>),
api: VeilidFFIConfigLoggingApi.fromJson(
json['api'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidFFIConfigLoggingToJson(
_$_VeilidFFIConfigLogging instance) =>
<String, dynamic>{
'terminal': instance.terminal.toJson(),
'otlp': instance.otlp.toJson(),
'api': instance.api.toJson(),
};
_$_VeilidFFIConfig _$$_VeilidFFIConfigFromJson(Map<String, dynamic> json) =>
_$_VeilidFFIConfig(
logging: VeilidFFIConfigLogging.fromJson(
json['logging'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidFFIConfigToJson(_$_VeilidFFIConfig instance) =>
<String, dynamic>{
'logging': instance.logging.toJson(),
};
_$_VeilidWASMConfigLoggingPerformance
_$$_VeilidWASMConfigLoggingPerformanceFromJson(Map<String, dynamic> json) =>
_$_VeilidWASMConfigLoggingPerformance(
enabled: json['enabled'] as bool,
level: VeilidConfigLogLevel.fromJson(json['level']),
logsInTimings: json['logs_in_timings'] as bool,
logsInConsole: json['logs_in_console'] as bool,
);
Map<String, dynamic> _$$_VeilidWASMConfigLoggingPerformanceToJson(
_$_VeilidWASMConfigLoggingPerformance instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'level': instance.level.toJson(),
'logs_in_timings': instance.logsInTimings,
'logs_in_console': instance.logsInConsole,
};
_$_VeilidWASMConfigLoggingApi _$$_VeilidWASMConfigLoggingApiFromJson(
Map<String, dynamic> json) =>
_$_VeilidWASMConfigLoggingApi(
enabled: json['enabled'] as bool,
level: VeilidConfigLogLevel.fromJson(json['level']),
);
Map<String, dynamic> _$$_VeilidWASMConfigLoggingApiToJson(
_$_VeilidWASMConfigLoggingApi instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'level': instance.level.toJson(),
};
_$_VeilidWASMConfigLogging _$$_VeilidWASMConfigLoggingFromJson(
Map<String, dynamic> json) =>
_$_VeilidWASMConfigLogging(
performance: VeilidWASMConfigLoggingPerformance.fromJson(
json['performance'] as Map<String, dynamic>),
api: VeilidWASMConfigLoggingApi.fromJson(
json['api'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidWASMConfigLoggingToJson(
_$_VeilidWASMConfigLogging instance) =>
<String, dynamic>{
'performance': instance.performance.toJson(),
'api': instance.api.toJson(),
};
_$_VeilidWASMConfig _$$_VeilidWASMConfigFromJson(Map<String, dynamic> json) =>
_$_VeilidWASMConfig(
logging: VeilidWASMConfigLogging.fromJson(
json['logging'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidWASMConfigToJson(_$_VeilidWASMConfig instance) =>
<String, dynamic>{
'logging': instance.logging.toJson(),
};
_$_VeilidConfigHTTPS _$$_VeilidConfigHTTPSFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigHTTPS(
enabled: json['enabled'] as bool,
listenAddress: json['listen_address'] as String,
path: json['path'] as String,
url: json['url'] as String?,
);
Map<String, dynamic> _$$_VeilidConfigHTTPSToJson(
_$_VeilidConfigHTTPS instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'listen_address': instance.listenAddress,
'path': instance.path,
'url': instance.url,
};
_$_VeilidConfigHTTP _$$_VeilidConfigHTTPFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigHTTP(
enabled: json['enabled'] as bool,
listenAddress: json['listen_address'] as String,
path: json['path'] as String,
url: json['url'] as String?,
);
Map<String, dynamic> _$$_VeilidConfigHTTPToJson(_$_VeilidConfigHTTP instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'listen_address': instance.listenAddress,
'path': instance.path,
'url': instance.url,
};
_$_VeilidConfigApplication _$$_VeilidConfigApplicationFromJson(
Map<String, dynamic> json) =>
_$_VeilidConfigApplication(
https: VeilidConfigHTTPS.fromJson(json['https'] as Map<String, dynamic>),
http: VeilidConfigHTTP.fromJson(json['http'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidConfigApplicationToJson(
_$_VeilidConfigApplication instance) =>
<String, dynamic>{
'https': instance.https.toJson(),
'http': instance.http.toJson(),
};
_$_VeilidConfigUDP _$$_VeilidConfigUDPFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigUDP(
enabled: json['enabled'] as bool,
socketPoolSize: json['socket_pool_size'] as int,
listenAddress: json['listen_address'] as String,
publicAddress: json['public_address'] as String?,
);
Map<String, dynamic> _$$_VeilidConfigUDPToJson(_$_VeilidConfigUDP instance) =>
<String, dynamic>{
'enabled': instance.enabled,
'socket_pool_size': instance.socketPoolSize,
'listen_address': instance.listenAddress,
'public_address': instance.publicAddress,
};
_$_VeilidConfigTCP _$$_VeilidConfigTCPFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigTCP(
connect: json['connect'] as bool,
listen: json['listen'] as bool,
maxConnections: json['max_connections'] as int,
listenAddress: json['listen_address'] as String,
publicAddress: json['public_address'] as String?,
);
Map<String, dynamic> _$$_VeilidConfigTCPToJson(_$_VeilidConfigTCP instance) =>
<String, dynamic>{
'connect': instance.connect,
'listen': instance.listen,
'max_connections': instance.maxConnections,
'listen_address': instance.listenAddress,
'public_address': instance.publicAddress,
};
_$_VeilidConfigWS _$$_VeilidConfigWSFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigWS(
connect: json['connect'] as bool,
listen: json['listen'] as bool,
maxConnections: json['max_connections'] as int,
listenAddress: json['listen_address'] as String,
path: json['path'] as String,
url: json['url'] as String?,
);
Map<String, dynamic> _$$_VeilidConfigWSToJson(_$_VeilidConfigWS instance) =>
<String, dynamic>{
'connect': instance.connect,
'listen': instance.listen,
'max_connections': instance.maxConnections,
'listen_address': instance.listenAddress,
'path': instance.path,
'url': instance.url,
};
_$_VeilidConfigWSS _$$_VeilidConfigWSSFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigWSS(
connect: json['connect'] as bool,
listen: json['listen'] as bool,
maxConnections: json['max_connections'] as int,
listenAddress: json['listen_address'] as String,
path: json['path'] as String,
url: json['url'] as String?,
);
Map<String, dynamic> _$$_VeilidConfigWSSToJson(_$_VeilidConfigWSS instance) =>
<String, dynamic>{
'connect': instance.connect,
'listen': instance.listen,
'max_connections': instance.maxConnections,
'listen_address': instance.listenAddress,
'path': instance.path,
'url': instance.url,
};
_$_VeilidConfigProtocol _$$_VeilidConfigProtocolFromJson(
Map<String, dynamic> json) =>
_$_VeilidConfigProtocol(
udp: VeilidConfigUDP.fromJson(json['udp'] as Map<String, dynamic>),
tcp: VeilidConfigTCP.fromJson(json['tcp'] as Map<String, dynamic>),
ws: VeilidConfigWS.fromJson(json['ws'] as Map<String, dynamic>),
wss: VeilidConfigWSS.fromJson(json['wss'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidConfigProtocolToJson(
_$_VeilidConfigProtocol instance) =>
<String, dynamic>{
'udp': instance.udp.toJson(),
'tcp': instance.tcp.toJson(),
'ws': instance.ws.toJson(),
'wss': instance.wss.toJson(),
};
_$_VeilidConfigTLS _$$_VeilidConfigTLSFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigTLS(
certificatePath: json['certificate_path'] as String,
privateKeyPath: json['private_key_path'] as String,
connectionInitialTimeoutMs: json['connection_initial_timeout_ms'] as int,
);
Map<String, dynamic> _$$_VeilidConfigTLSToJson(_$_VeilidConfigTLS instance) =>
<String, dynamic>{
'certificate_path': instance.certificatePath,
'private_key_path': instance.privateKeyPath,
'connection_initial_timeout_ms': instance.connectionInitialTimeoutMs,
};
_$_VeilidConfigDHT _$$_VeilidConfigDHTFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigDHT(
resolveNodeTimeoutMs: json['resolve_node_timeout_ms'] as int,
resolveNodeCount: json['resolve_node_count'] as int,
resolveNodeFanout: json['resolve_node_fanout'] as int,
maxFindNodeCount: json['max_find_node_count'] as int,
getValueTimeoutMs: json['get_value_timeout_ms'] as int,
getValueCount: json['get_value_count'] as int,
getValueFanout: json['get_value_fanout'] as int,
setValueTimeoutMs: json['set_value_timeout_ms'] as int,
setValueCount: json['set_value_count'] as int,
setValueFanout: json['set_value_fanout'] as int,
minPeerCount: json['min_peer_count'] as int,
minPeerRefreshTimeMs: json['min_peer_refresh_time_ms'] as int,
validateDialInfoReceiptTimeMs:
json['validate_dial_info_receipt_time_ms'] as int,
localSubkeyCacheSize: json['local_subkey_cache_size'] as int,
localMaxSubkeyCacheMemoryMb:
json['local_max_subkey_cache_memory_mb'] as int,
remoteSubkeyCacheSize: json['remote_subkey_cache_size'] as int,
remoteMaxRecords: json['remote_max_records'] as int,
remoteMaxSubkeyCacheMemoryMb:
json['remote_max_subkey_cache_memory_mb'] as int,
remoteMaxStorageSpaceMb: json['remote_max_storage_space_mb'] as int,
);
Map<String, dynamic> _$$_VeilidConfigDHTToJson(_$_VeilidConfigDHT instance) =>
<String, dynamic>{
'resolve_node_timeout_ms': instance.resolveNodeTimeoutMs,
'resolve_node_count': instance.resolveNodeCount,
'resolve_node_fanout': instance.resolveNodeFanout,
'max_find_node_count': instance.maxFindNodeCount,
'get_value_timeout_ms': instance.getValueTimeoutMs,
'get_value_count': instance.getValueCount,
'get_value_fanout': instance.getValueFanout,
'set_value_timeout_ms': instance.setValueTimeoutMs,
'set_value_count': instance.setValueCount,
'set_value_fanout': instance.setValueFanout,
'min_peer_count': instance.minPeerCount,
'min_peer_refresh_time_ms': instance.minPeerRefreshTimeMs,
'validate_dial_info_receipt_time_ms':
instance.validateDialInfoReceiptTimeMs,
'local_subkey_cache_size': instance.localSubkeyCacheSize,
'local_max_subkey_cache_memory_mb': instance.localMaxSubkeyCacheMemoryMb,
'remote_subkey_cache_size': instance.remoteSubkeyCacheSize,
'remote_max_records': instance.remoteMaxRecords,
'remote_max_subkey_cache_memory_mb':
instance.remoteMaxSubkeyCacheMemoryMb,
'remote_max_storage_space_mb': instance.remoteMaxStorageSpaceMb,
};
_$_VeilidConfigRPC _$$_VeilidConfigRPCFromJson(Map<String, dynamic> json) =>
_$_VeilidConfigRPC(
concurrency: json['concurrency'] as int,
queueSize: json['queue_size'] as int,
maxTimestampBehindMs: json['max_timestamp_behind_ms'] as int?,
maxTimestampAheadMs: json['max_timestamp_ahead_ms'] as int?,
timeoutMs: json['timeout_ms'] as int,
maxRouteHopCount: json['max_route_hop_count'] as int,
defaultRouteHopCount: json['default_route_hop_count'] as int,
);
Map<String, dynamic> _$$_VeilidConfigRPCToJson(_$_VeilidConfigRPC instance) =>
<String, dynamic>{
'concurrency': instance.concurrency,
'queue_size': instance.queueSize,
'max_timestamp_behind_ms': instance.maxTimestampBehindMs,
'max_timestamp_ahead_ms': instance.maxTimestampAheadMs,
'timeout_ms': instance.timeoutMs,
'max_route_hop_count': instance.maxRouteHopCount,
'default_route_hop_count': instance.defaultRouteHopCount,
};
_$_VeilidConfigRoutingTable _$$_VeilidConfigRoutingTableFromJson(
Map<String, dynamic> json) =>
_$_VeilidConfigRoutingTable(
nodeId: (json['node_id'] as List<dynamic>)
.map(Typed<FixedEncodedString43>.fromJson)
.toList(),
nodeIdSecret: (json['node_id_secret'] as List<dynamic>)
.map(Typed<FixedEncodedString43>.fromJson)
.toList(),
bootstrap:
(json['bootstrap'] as List<dynamic>).map((e) => e as String).toList(),
limitOverAttached: json['limit_over_attached'] as int,
limitFullyAttached: json['limit_fully_attached'] as int,
limitAttachedStrong: json['limit_attached_strong'] as int,
limitAttachedGood: json['limit_attached_good'] as int,
limitAttachedWeak: json['limit_attached_weak'] as int,
);
Map<String, dynamic> _$$_VeilidConfigRoutingTableToJson(
_$_VeilidConfigRoutingTable instance) =>
<String, dynamic>{
'node_id': instance.nodeId.map((e) => e.toJson()).toList(),
'node_id_secret': instance.nodeIdSecret.map((e) => e.toJson()).toList(),
'bootstrap': instance.bootstrap,
'limit_over_attached': instance.limitOverAttached,
'limit_fully_attached': instance.limitFullyAttached,
'limit_attached_strong': instance.limitAttachedStrong,
'limit_attached_good': instance.limitAttachedGood,
'limit_attached_weak': instance.limitAttachedWeak,
};
_$_VeilidConfigNetwork _$$_VeilidConfigNetworkFromJson(
Map<String, dynamic> json) =>
_$_VeilidConfigNetwork(
connectionInitialTimeoutMs: json['connection_initial_timeout_ms'] as int,
connectionInactivityTimeoutMs:
json['connection_inactivity_timeout_ms'] as int,
maxConnectionsPerIp4: json['max_connections_per_ip4'] as int,
maxConnectionsPerIp6Prefix: json['max_connections_per_ip6_prefix'] as int,
maxConnectionsPerIp6PrefixSize:
json['max_connections_per_ip6_prefix_size'] as int,
maxConnectionFrequencyPerMin:
json['max_connection_frequency_per_min'] as int,
clientWhitelistTimeoutMs: json['client_whitelist_timeout_ms'] as int,
reverseConnectionReceiptTimeMs:
json['reverse_connection_receipt_time_ms'] as int,
holePunchReceiptTimeMs: json['hole_punch_receipt_time_ms'] as int,
networkKeyPassword: json['network_key_password'] as String?,
routingTable: VeilidConfigRoutingTable.fromJson(
json['routing_table'] as Map<String, dynamic>),
rpc: VeilidConfigRPC.fromJson(json['rpc'] as Map<String, dynamic>),
dht: VeilidConfigDHT.fromJson(json['dht'] as Map<String, dynamic>),
upnp: json['upnp'] as bool,
detectAddressChanges: json['detect_address_changes'] as bool,
restrictedNatRetries: json['restricted_nat_retries'] as int,
tls: VeilidConfigTLS.fromJson(json['tls'] as Map<String, dynamic>),
application: VeilidConfigApplication.fromJson(
json['application'] as Map<String, dynamic>),
protocol: VeilidConfigProtocol.fromJson(
json['protocol'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$_VeilidConfigNetworkToJson(
_$_VeilidConfigNetwork instance) =>
<String, dynamic>{
'connection_initial_timeout_ms': instance.connectionInitialTimeoutMs,
'connection_inactivity_timeout_ms':
instance.connectionInactivityTimeoutMs,
'max_connections_per_ip4': instance.maxConnectionsPerIp4,
'max_connections_per_ip6_prefix': instance.maxConnectionsPerIp6Prefix,
'max_connections_per_ip6_prefix_size':
instance.maxConnectionsPerIp6PrefixSize,
'max_connection_frequency_per_min': instance.maxConnectionFrequencyPerMin,
'client_whitelist_timeout_ms': instance.clientWhitelistTimeoutMs,
'reverse_connection_receipt_time_ms':
instance.reverseConnectionReceiptTimeMs,
'hole_punch_receipt_time_ms': instance.holePunchReceiptTimeMs,
'network_key_password': instance.networkKeyPassword,
'routing_table': instance.routingTable.toJson(),
'rpc': instance.rpc.toJson(),
'dht': instance.dht.toJson(),
'upnp': instance.upnp,
'detect_address_changes': instance.detectAddressChanges,
'restricted_nat_retries': instance.restrictedNatRetries,
'tls': instance.tls.toJson(),
'application': instance.application.toJson(),
'protocol': instance.protocol.toJson(),
};
_$_VeilidConfigTableStore _$$_VeilidConfigTableStoreFromJson(
Map<String, dynamic> json) =>
_$_VeilidConfigTableStore(
directory: json['directory'] as String,
delete: json['delete'] as bool,
);
Map<String, dynamic> _$$_VeilidConfigTableStoreToJson(
_$_VeilidConfigTableStore instance) =>
<String, dynamic>{
'directory': instance.directory,
'delete': instance.delete,
};
_$_VeilidConfigBlockStore _$$_VeilidConfigBlockStoreFromJson(
Map<String, dynamic> json) =>
_$_VeilidConfigBlockStore(
directory: json['directory'] as String,
delete: json['delete'] as bool,
);
Map<String, dynamic> _$$_VeilidConfigBlockStoreToJson(
_$_VeilidConfigBlockStore instance) =>