discoos / eventstore-client-dart Goto Github PK
View Code? Open in Web Editor NEWA gRPC Client for EventStoreDb
License: BSD 2-Clause "Simplified" License
A gRPC Client for EventStoreDb
License: BSD 2-Clause "Simplified" License
Implement EventStoreMonitoringClient from
service Monitoring {
rpc Stats(StatsReq) returns (stream StatsResp);
}
message StatsReq {
bool use_metadata = 1;
uint64 refresh_time_period_in_ms = 4;
}
message StatsResp {
map<string, string> stats = 1;
}
This will allow developers to pass the public key without access to any local file system.
I am trying to connect to an ES cloud-based instance but I am getting the HostCertificateNotFound
exception, however, I don't think this should happen as there would be nowhere for us to add the certificate to the host.
There are some differences in how we create our settings with C# compared to dart:
var settings = EventStoreClientSettings.Create(eventStoreConfiguration.Endpoint);
settings.DefaultCredentials = new UserCredentials(eventStoreConfiguration.Username, eventStoreConfiguration.Password);
var esClient = new EventStoreClient(settings);
I'm not sure if there is another bit of config I need with dart?!
Implement EventStoreUsersClient from
service Users {
rpc Create (CreateReq) returns (CreateResp);
rpc Update (UpdateReq) returns (UpdateResp);
rpc Delete (DeleteReq) returns (DeleteResp);
rpc Disable (DisableReq) returns (DisableResp);
rpc Enable (EnableReq) returns (EnableResp);
rpc Details (DetailsReq) returns (stream DetailsResp);
rpc ChangePassword (ChangePasswordReq) returns (ChangePasswordResp);
rpc ResetPassword (ResetPasswordReq) returns (ResetPasswordResp);
}
message CreateReq {
Options options = 1;
message Options {
string login_name = 1;
string password = 2;
string full_name = 3;
repeated string groups = 4;
}
}
message CreateResp {
}
message UpdateReq {
Options options = 1;
message Options {
string login_name = 1;
string password = 2;
string full_name = 3;
repeated string groups = 4;
}
}
message UpdateResp {
}
message DeleteReq {
Options options = 1;
message Options {
string login_name = 1;
}
}
message DeleteResp {
}
message EnableReq {
Options options = 1;
message Options {
string login_name = 1;
}
}
message EnableResp {
}
message DisableReq {
Options options = 1;
message Options {
string login_name = 1;
}
}
message DisableResp {
}
message DetailsReq {
Options options = 1;
message Options {
string login_name = 1;
}
}
message DetailsResp {
UserDetails user_details = 1;
message UserDetails {
string login_name = 1;
string full_name = 2;
repeated string groups = 3;
DateTime last_updated = 4;
bool disabled = 5;
message DateTime {
int64 ticks_since_epoch = 1;
}
}
}
message ChangePasswordReq {
Options options = 1;
message Options {
string login_name = 1;
string current_password = 2;
string new_password = 3;
}
}
message ChangePasswordResp {
}
message ResetPasswordReq {
Options options = 1;
message Options {
string login_name = 1;
string new_password = 2;
}
}
message ResetPasswordResp {
}
Since the only documentation on how to configure secure connections with tls is the official on eventstore.org, support issues like #1 is expected. Adding an example of how you should configure tls with the public key used by eventstore will help new users to overcome the lack of documentation specific for Dart in the short term.
It looks like there might be an issue with the compatibility with the latest dart packages. Getting the following errors when trying to build web app - MacOS is building and running fine:
'dart compile js' instead.
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/constants.d
art:7:13:
Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.
const Max = 9223372036854775807;
^^^^^^^^^^^^^^^^^^^
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/client_base
.dart:205:25:
Error: The argument type 'X509Certificate/*1*/' can't be assigned to the parameter type
'X509Certificate/*2*/'.
- 'X509Certificate/*1*/' is from 'dart:io'.
- 'X509Certificate/*2*/' is from 'package:universal_io/src/io/secure_socket.dart'
('../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/secure_socket.d
art').
cert,
^
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/helpers.dar
t:133:53:
Error: The argument type 'X509Certificate/*1*/' can't be assigned to the parameter type
'X509Certificate/*2*/'.
- 'X509Certificate/*1*/' is from 'package:universal_io/src/io/secure_socket.dart'
('../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/secure_socket.d
art').
- 'X509Certificate/*2*/' is from 'dart:io'.
return channelCredentials.onBadCertificate!(cert, host);
^
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/helpers.dar
t:144:7:
Error: A value of type 'bool Function(X509Certificate, String, int)?' can't be assigned to a variable of
type 'bool Function(X509Certificate, String, int)' because 'bool Function(X509Certificate, String, int)?'
is nullable and 'bool Function(X509Certificate, String, int)' isn't.
- 'X509Certificate' is from 'package:universal_io/src/io/secure_socket.dart'
('../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/secure_socket.d
art').
).onBadCertificate;
^
Error: Compilation failed.
As of version 0.6.1, the web platform is not supported because of an transitive dependency on dart:io (see evenstore_client score). It is needed on non-web platforms for configuring secure gRPC and http connections using TLS and certificates. On the web platform, the grpc and universial_io packages only support configuring secure or insecure connections using a boolean flag. We need to rewrite EventStoreClientBase
in client_base.dart
to accommodate the same difference in configurability. The grcp package serves as an example on how this could be done.
This enhancement will resolve bug #6.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.