diff --git a/lib/src/accounts/v1/accounts_v1.pbgrpc.dart b/lib/src/accounts/v1/accounts_v1.pbgrpc.dart index 60bb1e9..96fba8f 100644 --- a/lib/src/accounts/v1/accounts_v1.pbgrpc.dart +++ b/lib/src/accounts/v1/accounts_v1.pbgrpc.dart @@ -22,9 +22,9 @@ import 'accounts_v1.pb.dart' as $0; export 'accounts_v1.pb.dart'; /// * -/// Service for handling environments -@$pb.GrpcServiceName('accounts.v1.AccountsService') -class AccountsServiceClient extends $grpc.Client { +/// Service for handling accounts that do not require authentication +@$pb.GrpcServiceName('accounts.v1.AccountsNoAuthService') +class AccountsNoAuthServiceClient extends $grpc.Client { /// The hostname for this service. static const $core.String defaultHost = ''; @@ -33,8 +33,10 @@ class AccountsServiceClient extends $grpc.Client { '', ]; - AccountsServiceClient(super.channel, {super.options, super.interceptors}); + AccountsNoAuthServiceClient(super.channel, + {super.options, super.interceptors}); + /// Create a new user $grpc.ResponseFuture<$1.Empty> signUp( $0.SignUpRequest request, { $grpc.CallOptions? options, @@ -42,6 +44,7 @@ class AccountsServiceClient extends $grpc.Client { return $createUnaryCall(_$signUp, request, options: options); } + /// Sing in into an existing account $grpc.ResponseFuture<$1.Empty> signIn( $0.SignInRequest request, { $grpc.CallOptions? options, @@ -49,6 +52,7 @@ class AccountsServiceClient extends $grpc.Client { return $createUnaryCall(_$signIn, request, options: options); } + /// Reset the password, if it was lost $grpc.ResponseFuture<$1.Empty> resetPassword( $0.ResetPasswordRequest request, { $grpc.CallOptions? options, @@ -56,6 +60,7 @@ class AccountsServiceClient extends $grpc.Client { return $createUnaryCall(_$resetPassword, request, options: options); } + /// Set the new password after reset $grpc.ResponseFuture<$1.Empty> newPassword( $0.NewPasswordRequest request, { $grpc.CallOptions? options, @@ -63,45 +68,47 @@ class AccountsServiceClient extends $grpc.Client { return $createUnaryCall(_$newPassword, request, options: options); } - $grpc.ResponseFuture<$0.IsEmailVerifiedResponse> isEmailVerified( - $0.IsEmailVerifiedRequest request, { + /// Send the refresh token request, token should be passed in the metadata. + /// This rpc does requier auth, but it should be handled not on the middleware level, + /// that's why it set in the NoAuth service + $grpc.ResponseFuture<$1.Empty> refreshToken( + $1.Empty request, { $grpc.CallOptions? options, }) { - return $createUnaryCall(_$isEmailVerified, request, options: options); + return $createUnaryCall(_$refreshToken, request, options: options); } // method descriptors static final _$signUp = $grpc.ClientMethod<$0.SignUpRequest, $1.Empty>( - '/accounts.v1.AccountsService/SignUp', + '/accounts.v1.AccountsNoAuthService/SignUp', ($0.SignUpRequest value) => value.writeToBuffer(), $1.Empty.fromBuffer); static final _$signIn = $grpc.ClientMethod<$0.SignInRequest, $1.Empty>( - '/accounts.v1.AccountsService/SignIn', + '/accounts.v1.AccountsNoAuthService/SignIn', ($0.SignInRequest value) => value.writeToBuffer(), $1.Empty.fromBuffer); static final _$resetPassword = $grpc.ClientMethod<$0.ResetPasswordRequest, $1.Empty>( - '/accounts.v1.AccountsService/ResetPassword', + '/accounts.v1.AccountsNoAuthService/ResetPassword', ($0.ResetPasswordRequest value) => value.writeToBuffer(), $1.Empty.fromBuffer); static final _$newPassword = $grpc.ClientMethod<$0.NewPasswordRequest, $1.Empty>( - '/accounts.v1.AccountsService/NewPassword', + '/accounts.v1.AccountsNoAuthService/NewPassword', ($0.NewPasswordRequest value) => value.writeToBuffer(), $1.Empty.fromBuffer); - static final _$isEmailVerified = - $grpc.ClientMethod<$0.IsEmailVerifiedRequest, $0.IsEmailVerifiedResponse>( - '/accounts.v1.AccountsService/IsEmailVerified', - ($0.IsEmailVerifiedRequest value) => value.writeToBuffer(), - $0.IsEmailVerifiedResponse.fromBuffer); + static final _$refreshToken = $grpc.ClientMethod<$1.Empty, $1.Empty>( + '/accounts.v1.AccountsNoAuthService/RefreshToken', + ($1.Empty value) => value.writeToBuffer(), + $1.Empty.fromBuffer); } -@$pb.GrpcServiceName('accounts.v1.AccountsService') -abstract class AccountsServiceBase extends $grpc.Service { - $core.String get $name => 'accounts.v1.AccountsService'; +@$pb.GrpcServiceName('accounts.v1.AccountsNoAuthService') +abstract class AccountsNoAuthServiceBase extends $grpc.Service { + $core.String get $name => 'accounts.v1.AccountsNoAuthService'; - AccountsServiceBase() { + AccountsNoAuthServiceBase() { $addMethod($grpc.ServiceMethod<$0.SignUpRequest, $1.Empty>( 'SignUp', signUp_Pre, @@ -132,15 +139,13 @@ abstract class AccountsServiceBase extends $grpc.Service { ($core.List<$core.int> value) => $0.NewPasswordRequest.fromBuffer(value), ($1.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.IsEmailVerifiedRequest, - $0.IsEmailVerifiedResponse>( - 'IsEmailVerified', - isEmailVerified_Pre, + $addMethod($grpc.ServiceMethod<$1.Empty, $1.Empty>( + 'RefreshToken', + refreshToken_Pre, false, false, - ($core.List<$core.int> value) => - $0.IsEmailVerifiedRequest.fromBuffer(value), - ($0.IsEmailVerifiedResponse value) => value.writeToBuffer())); + ($core.List<$core.int> value) => $1.Empty.fromBuffer(value), + ($1.Empty value) => value.writeToBuffer())); } $async.Future<$1.Empty> signUp_Pre( @@ -175,6 +180,63 @@ abstract class AccountsServiceBase extends $grpc.Service { $async.Future<$1.Empty> newPassword( $grpc.ServiceCall call, $0.NewPasswordRequest request); + $async.Future<$1.Empty> refreshToken_Pre( + $grpc.ServiceCall $call, $async.Future<$1.Empty> $request) async { + return refreshToken($call, await $request); + } + + $async.Future<$1.Empty> refreshToken( + $grpc.ServiceCall call, $1.Empty request); +} + +/// * +/// Service for handling accounts that do require authentication +/// Tokens should be sent via metadata, so the service is able to authenticate a user for a request +@$pb.GrpcServiceName('accounts.v1.AccountAuthService') +class AccountAuthServiceClient extends $grpc.Client { + /// The hostname for this service. + static const $core.String defaultHost = ''; + + /// OAuth scopes needed for the client. + static const $core.List<$core.String> oauthScopes = [ + '', + ]; + + AccountAuthServiceClient(super.channel, {super.options, super.interceptors}); + + /// Is email for the current account verified + $grpc.ResponseFuture<$0.IsEmailVerifiedResponse> isEmailVerified( + $0.IsEmailVerifiedRequest request, { + $grpc.CallOptions? options, + }) { + return $createUnaryCall(_$isEmailVerified, request, options: options); + } + + // method descriptors + + static final _$isEmailVerified = + $grpc.ClientMethod<$0.IsEmailVerifiedRequest, $0.IsEmailVerifiedResponse>( + '/accounts.v1.AccountAuthService/IsEmailVerified', + ($0.IsEmailVerifiedRequest value) => value.writeToBuffer(), + $0.IsEmailVerifiedResponse.fromBuffer); +} + +@$pb.GrpcServiceName('accounts.v1.AccountAuthService') +abstract class AccountAuthServiceBase extends $grpc.Service { + $core.String get $name => 'accounts.v1.AccountAuthService'; + + AccountAuthServiceBase() { + $addMethod($grpc.ServiceMethod<$0.IsEmailVerifiedRequest, + $0.IsEmailVerifiedResponse>( + 'IsEmailVerified', + isEmailVerified_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.IsEmailVerifiedRequest.fromBuffer(value), + ($0.IsEmailVerifiedResponse value) => value.writeToBuffer())); + } + $async.Future<$0.IsEmailVerifiedResponse> isEmailVerified_Pre( $grpc.ServiceCall $call, $async.Future<$0.IsEmailVerifiedRequest> $request) async {