diff --git a/delivery/grpc/handlers/user_handler.go b/delivery/grpc/handlers/user_handler.go new file mode 100644 index 0000000..0b610ad --- /dev/null +++ b/delivery/grpc/handlers/user_handler.go @@ -0,0 +1,48 @@ +package grpc_handlers + +import ( + "context" + "fmt" + + "connectrpc.com/connect" + "github.com/kavkaco/Kavka-Core/delivery/grpc/interceptor" + "github.com/kavkaco/Kavka-Core/internal/service/user" + "github.com/kavkaco/Kavka-Core/log" + userv1 "github.com/kavkaco/Kavka-Core/protobuf/gen/go/protobuf/user/v1" + "github.com/kavkaco/Kavka-Core/protobuf/gen/go/protobuf/user/v1/userv1connect" +) + +type userGrpcServer struct { + logger *log.SubLogger + userService user.UserService +} + +func NewUserGrpcServer(logger *log.SubLogger, userService user.UserService) userv1connect.UserServiceHandler { + return &userGrpcServer{logger, userService} +} + +func (h *userGrpcServer) UploadProfile(ctx context.Context, stream *connect.ClientStream[userv1.UploadProfileRequest]) (*connect.Response[userv1.UploadProfileResponse], error) { + headers := stream.RequestHeader() + + filename := headers.Get("filename") + if filename == "" { + return nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("missing filename")) + } + userID := ctx.Value(interceptor.UserID{}).(string) + if userID == "" { + return nil, connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("missing userID")) + } + + for stream.Receive() { + bytes := stream.Msg().Bytes + + err := h.userService.UpdateProfilePicture(ctx, userID, filename, bytes) + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err.Error) + } + } + + res := connect.NewResponse(&userv1.UploadProfileResponse{}) + + return res, nil +} diff --git a/go.mod b/go.mod index a45b60d..a4b4ee6 100644 --- a/go.mod +++ b/go.mod @@ -90,6 +90,7 @@ require ( golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect + google.golang.org/grpc v1.66.0 gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index fb06337..56e98cb 100644 --- a/go.sum +++ b/go.sum @@ -536,6 +536,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/protobuf/gen/es/protobuf/auth/v1/auth_pb.ts b/protobuf/gen/es/protobuf/auth/v1/auth_pb.ts index 3060f06..775e63d 100644 --- a/protobuf/gen/es/protobuf/auth/v1/auth_pb.ts +++ b/protobuf/gen/es/protobuf/auth/v1/auth_pb.ts @@ -1,59 +1,47 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/auth/v1/auth.proto (package protobuf.auth.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Duration, Message, proto3 } from "@bufbuild/protobuf"; -import { User } from "../../model/user/v1/user_pb.ts"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Duration } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_duration } from "@bufbuild/protobuf/wkt"; +import type { User } from "../../model/user/v1/user_pb.ts"; +import { file_protobuf_model_user_v1_user } from "../../model/user/v1/user_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/auth/v1/auth.proto. + */ +export const file_protobuf_auth_v1_auth: GenFile = /*@__PURE__*/ + fileDesc("Chtwcm90b2J1Zi9hdXRoL3YxL2F1dGgucHJvdG8SEHByb3RvYnVmLmF1dGgudjEiLwoMTG9naW5SZXF1ZXN0Eg0KBWVtYWlsGAEgASgJEhAKCHBhc3N3b3JkGAIgASgJImgKDUxvZ2luUmVzcG9uc2USKgoEdXNlchgBIAEoCzIcLnByb3RvYnVmLm1vZGVsLnVzZXIudjEuVXNlchIUCgxhY2Nlc3NfdG9rZW4YAiABKAkSFQoNcmVmcmVzaF90b2tlbhgDIAEoCSKIAQoPUmVnaXN0ZXJSZXF1ZXN0EgwKBG5hbWUYASABKAkSEQoJbGFzdF9uYW1lGAIgASgJEhAKCHVzZXJuYW1lGAMgASgJEg0KBWVtYWlsGAQgASgJEhAKCHBhc3N3b3JkGAUgASgJEiEKGXZlcmlmeV9lbWFpbF9yZWRpcmVjdF91cmwYBiABKAkiEgoQUmVnaXN0ZXJSZXNwb25zZSIwChJWZXJpZnlFbWFpbFJlcXVlc3QSGgoSdmVyaWZ5X2VtYWlsX3Rva2VuGAEgASgJIhUKE1ZlcmlmeUVtYWlsUmVzcG9uc2UiTgoYU2VuZFJlc2V0UGFzc3dvcmRSZXF1ZXN0Eg0KBWVtYWlsGAEgASgJEiMKG3Jlc2V0X3Bhc3N3b3JkX3JlZGlyZWN0X3VybBgCIAEoCSJlChlTZW5kUmVzZXRQYXNzd29yZFJlc3BvbnNlEhwKFHJlc2V0X3Bhc3N3b3JkX3Rva2VuGAEgASgJEioKB3RpbWVvdXQYAiABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iUAoaU3VibWl0UmVzZXRQYXNzd29yZFJlcXVlc3QSHAoUcmVzZXRfcGFzc3dvcmRfdG9rZW4YASABKAkSFAoMbmV3X3Bhc3N3b3JkGAIgASgJIh0KG1N1Ym1pdFJlc2V0UGFzc3dvcmRSZXNwb25zZSJZChVDaGFuZ2VQYXNzd29yZFJlcXVlc3QSFAoMYWNjZXNzX3Rva2VuGAEgASgJEhQKDG9sZF9wYXNzd29yZBgCIAEoCRIUCgxuZXdfcGFzc3dvcmQYAyABKAkiGAoWQ2hhbmdlUGFzc3dvcmRSZXNwb25zZSIrChNBdXRoZW50aWNhdGVSZXF1ZXN0EhQKDGFjY2Vzc190b2tlbhgBIAEoCSJCChRBdXRoZW50aWNhdGVSZXNwb25zZRIqCgR1c2VyGAEgASgLMhwucHJvdG9idWYubW9kZWwudXNlci52MS5Vc2VyIj0KE1JlZnJlc2hUb2tlblJlcXVlc3QSFQoNcmVmcmVzaF90b2tlbhgBIAEoCRIPCgd1c2VyX2lkGAIgASgJIiwKFFJlZnJlc2hUb2tlblJlc3BvbnNlEhQKDGFjY2Vzc190b2tlbhgBIAEoCTKLBgoLQXV0aFNlcnZpY2USSAoFTG9naW4SHi5wcm90b2J1Zi5hdXRoLnYxLkxvZ2luUmVxdWVzdBofLnByb3RvYnVmLmF1dGgudjEuTG9naW5SZXNwb25zZRJRCghSZWdpc3RlchIhLnByb3RvYnVmLmF1dGgudjEuUmVnaXN0ZXJSZXF1ZXN0GiIucHJvdG9idWYuYXV0aC52MS5SZWdpc3RlclJlc3BvbnNlEloKC1ZlcmlmeUVtYWlsEiQucHJvdG9idWYuYXV0aC52MS5WZXJpZnlFbWFpbFJlcXVlc3QaJS5wcm90b2J1Zi5hdXRoLnYxLlZlcmlmeUVtYWlsUmVzcG9uc2USbAoRU2VuZFJlc2V0UGFzc3dvcmQSKi5wcm90b2J1Zi5hdXRoLnYxLlNlbmRSZXNldFBhc3N3b3JkUmVxdWVzdBorLnByb3RvYnVmLmF1dGgudjEuU2VuZFJlc2V0UGFzc3dvcmRSZXNwb25zZRJyChNTdWJtaXRSZXNldFBhc3N3b3JkEiwucHJvdG9idWYuYXV0aC52MS5TdWJtaXRSZXNldFBhc3N3b3JkUmVxdWVzdBotLnByb3RvYnVmLmF1dGgudjEuU3VibWl0UmVzZXRQYXNzd29yZFJlc3BvbnNlEmMKDkNoYW5nZVBhc3N3b3JkEicucHJvdG9idWYuYXV0aC52MS5DaGFuZ2VQYXNzd29yZFJlcXVlc3QaKC5wcm90b2J1Zi5hdXRoLnYxLkNoYW5nZVBhc3N3b3JkUmVzcG9uc2USXQoMQXV0aGVudGljYXRlEiUucHJvdG9idWYuYXV0aC52MS5BdXRoZW50aWNhdGVSZXF1ZXN0GiYucHJvdG9idWYuYXV0aC52MS5BdXRoZW50aWNhdGVSZXNwb25zZRJdCgxSZWZyZXNoVG9rZW4SJS5wcm90b2J1Zi5hdXRoLnYxLlJlZnJlc2hUb2tlblJlcXVlc3QaJi5wcm90b2J1Zi5hdXRoLnYxLlJlZnJlc2hUb2tlblJlc3BvbnNlQsoBChRjb20ucHJvdG9idWYuYXV0aC52MUIJQXV0aFByb3RvUAFaRWdpdGh1Yi5jb20va2F2a2Fjby9LYXZrYS1Db3JlL3Byb3RvYnVmL2dlbi9nby9wcm90b2J1Zi9hdXRoL3YxO2F1dGh2MaICA1BBWKoCEFByb3RvYnVmLkF1dGguVjHKAhBQcm90b2J1ZlxBdXRoXFYx4gIcUHJvdG9idWZcQXV0aFxWMVxHUEJNZXRhZGF0YeoCElByb3RvYnVmOjpBdXRoOjpWMWIGcHJvdG8z", [file_google_protobuf_duration, file_protobuf_model_user_v1_user]); /** * @generated from message protobuf.auth.v1.LoginRequest */ -export class LoginRequest extends Message { +export type LoginRequest = Message<"protobuf.auth.v1.LoginRequest"> & { /** * @generated from field: string email = 1; */ - email = ""; + email: string; /** * @generated from field: string password = 2; */ - password = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.LoginRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoginRequest { - return new LoginRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoginRequest { - return new LoginRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoginRequest { - return new LoginRequest().fromJsonString(jsonString, options); - } + password: string; +}; - static equals(a: LoginRequest | PlainMessage | undefined, b: LoginRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(LoginRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.LoginRequest. + * Use `create(LoginRequestSchema)` to create a new message. + */ +export const LoginRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 0); /** * @generated from message protobuf.auth.v1.LoginResponse */ -export class LoginResponse extends Message { +export type LoginResponse = Message<"protobuf.auth.v1.LoginResponse"> & { /** * @generated from field: protobuf.model.user.v1.User user = 1; */ @@ -62,600 +50,366 @@ export class LoginResponse extends Message { /** * @generated from field: string access_token = 2; */ - accessToken = ""; + accessToken: string; /** * @generated from field: string refresh_token = 3; */ - refreshToken = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.LoginResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user", kind: "message", T: User }, - { no: 2, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "refresh_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + refreshToken: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): LoginResponse { - return new LoginResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoginResponse { - return new LoginResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoginResponse { - return new LoginResponse().fromJsonString(jsonString, options); - } - - static equals(a: LoginResponse | PlainMessage | undefined, b: LoginResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(LoginResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.LoginResponse. + * Use `create(LoginResponseSchema)` to create a new message. + */ +export const LoginResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 1); /** * @generated from message protobuf.auth.v1.RegisterRequest */ -export class RegisterRequest extends Message { +export type RegisterRequest = Message<"protobuf.auth.v1.RegisterRequest"> & { /** * @generated from field: string name = 1; */ - name = ""; + name: string; /** * @generated from field: string last_name = 2; */ - lastName = ""; + lastName: string; /** * @generated from field: string username = 3; */ - username = ""; + username: string; /** * @generated from field: string email = 4; */ - email = ""; + email: string; /** * @generated from field: string password = 5; */ - password = ""; + password: string; /** * @generated from field: string verify_email_redirect_url = 6; */ - verifyEmailRedirectUrl = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.RegisterRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "last_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "verify_email_redirect_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterRequest { - return new RegisterRequest().fromBinary(bytes, options); - } + verifyEmailRedirectUrl: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterRequest { - return new RegisterRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RegisterRequest { - return new RegisterRequest().fromJsonString(jsonString, options); - } - - static equals(a: RegisterRequest | PlainMessage | undefined, b: RegisterRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.RegisterRequest. + * Use `create(RegisterRequestSchema)` to create a new message. + */ +export const RegisterRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 2); /** * @generated from message protobuf.auth.v1.RegisterResponse */ -export class RegisterResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export type RegisterResponse = Message<"protobuf.auth.v1.RegisterResponse"> & { +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.RegisterResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RegisterResponse { - return new RegisterResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RegisterResponse { - return new RegisterResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RegisterResponse { - return new RegisterResponse().fromJsonString(jsonString, options); - } - - static equals(a: RegisterResponse | PlainMessage | undefined, b: RegisterResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RegisterResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.RegisterResponse. + * Use `create(RegisterResponseSchema)` to create a new message. + */ +export const RegisterResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 3); /** * @generated from message protobuf.auth.v1.VerifyEmailRequest */ -export class VerifyEmailRequest extends Message { +export type VerifyEmailRequest = Message<"protobuf.auth.v1.VerifyEmailRequest"> & { /** * @generated from field: string verify_email_token = 1; */ - verifyEmailToken = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.VerifyEmailRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "verify_email_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + verifyEmailToken: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): VerifyEmailRequest { - return new VerifyEmailRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VerifyEmailRequest { - return new VerifyEmailRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): VerifyEmailRequest { - return new VerifyEmailRequest().fromJsonString(jsonString, options); - } - - static equals(a: VerifyEmailRequest | PlainMessage | undefined, b: VerifyEmailRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(VerifyEmailRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.VerifyEmailRequest. + * Use `create(VerifyEmailRequestSchema)` to create a new message. + */ +export const VerifyEmailRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 4); /** * @generated from message protobuf.auth.v1.VerifyEmailResponse */ -export class VerifyEmailResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.VerifyEmailResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): VerifyEmailResponse { - return new VerifyEmailResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): VerifyEmailResponse { - return new VerifyEmailResponse().fromJson(jsonValue, options); - } +export type VerifyEmailResponse = Message<"protobuf.auth.v1.VerifyEmailResponse"> & { +}; - static fromJsonString(jsonString: string, options?: Partial): VerifyEmailResponse { - return new VerifyEmailResponse().fromJsonString(jsonString, options); - } - - static equals(a: VerifyEmailResponse | PlainMessage | undefined, b: VerifyEmailResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(VerifyEmailResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.VerifyEmailResponse. + * Use `create(VerifyEmailResponseSchema)` to create a new message. + */ +export const VerifyEmailResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 5); /** * @generated from message protobuf.auth.v1.SendResetPasswordRequest */ -export class SendResetPasswordRequest extends Message { +export type SendResetPasswordRequest = Message<"protobuf.auth.v1.SendResetPasswordRequest"> & { /** * @generated from field: string email = 1; */ - email = ""; + email: string; /** * @generated from field: string reset_password_redirect_url = 2; */ - resetPasswordRedirectUrl = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.SendResetPasswordRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "reset_password_redirect_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SendResetPasswordRequest { - return new SendResetPasswordRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendResetPasswordRequest { - return new SendResetPasswordRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendResetPasswordRequest { - return new SendResetPasswordRequest().fromJsonString(jsonString, options); - } + resetPasswordRedirectUrl: string; +}; - static equals(a: SendResetPasswordRequest | PlainMessage | undefined, b: SendResetPasswordRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SendResetPasswordRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.SendResetPasswordRequest. + * Use `create(SendResetPasswordRequestSchema)` to create a new message. + */ +export const SendResetPasswordRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 6); /** * @generated from message protobuf.auth.v1.SendResetPasswordResponse */ -export class SendResetPasswordResponse extends Message { +export type SendResetPasswordResponse = Message<"protobuf.auth.v1.SendResetPasswordResponse"> & { /** * @generated from field: string reset_password_token = 1; */ - resetPasswordToken = ""; + resetPasswordToken: string; /** * @generated from field: google.protobuf.Duration timeout = 2; */ timeout?: Duration; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.SendResetPasswordResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "reset_password_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "timeout", kind: "message", T: Duration }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SendResetPasswordResponse { - return new SendResetPasswordResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendResetPasswordResponse { - return new SendResetPasswordResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendResetPasswordResponse { - return new SendResetPasswordResponse().fromJsonString(jsonString, options); - } - - static equals(a: SendResetPasswordResponse | PlainMessage | undefined, b: SendResetPasswordResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SendResetPasswordResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.SendResetPasswordResponse. + * Use `create(SendResetPasswordResponseSchema)` to create a new message. + */ +export const SendResetPasswordResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 7); /** * @generated from message protobuf.auth.v1.SubmitResetPasswordRequest */ -export class SubmitResetPasswordRequest extends Message { +export type SubmitResetPasswordRequest = Message<"protobuf.auth.v1.SubmitResetPasswordRequest"> & { /** * @generated from field: string reset_password_token = 1; */ - resetPasswordToken = ""; + resetPasswordToken: string; /** * @generated from field: string new_password = 2; */ - newPassword = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.SubmitResetPasswordRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "reset_password_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "new_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SubmitResetPasswordRequest { - return new SubmitResetPasswordRequest().fromBinary(bytes, options); - } + newPassword: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): SubmitResetPasswordRequest { - return new SubmitResetPasswordRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SubmitResetPasswordRequest { - return new SubmitResetPasswordRequest().fromJsonString(jsonString, options); - } - - static equals(a: SubmitResetPasswordRequest | PlainMessage | undefined, b: SubmitResetPasswordRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SubmitResetPasswordRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.SubmitResetPasswordRequest. + * Use `create(SubmitResetPasswordRequestSchema)` to create a new message. + */ +export const SubmitResetPasswordRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 8); /** * @generated from message protobuf.auth.v1.SubmitResetPasswordResponse */ -export class SubmitResetPasswordResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } +export type SubmitResetPasswordResponse = Message<"protobuf.auth.v1.SubmitResetPasswordResponse"> & { +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.SubmitResetPasswordResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SubmitResetPasswordResponse { - return new SubmitResetPasswordResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SubmitResetPasswordResponse { - return new SubmitResetPasswordResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SubmitResetPasswordResponse { - return new SubmitResetPasswordResponse().fromJsonString(jsonString, options); - } - - static equals(a: SubmitResetPasswordResponse | PlainMessage | undefined, b: SubmitResetPasswordResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SubmitResetPasswordResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.SubmitResetPasswordResponse. + * Use `create(SubmitResetPasswordResponseSchema)` to create a new message. + */ +export const SubmitResetPasswordResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 9); /** * @generated from message protobuf.auth.v1.ChangePasswordRequest */ -export class ChangePasswordRequest extends Message { +export type ChangePasswordRequest = Message<"protobuf.auth.v1.ChangePasswordRequest"> & { /** * @generated from field: string access_token = 1; */ - accessToken = ""; + accessToken: string; /** * @generated from field: string old_password = 2; */ - oldPassword = ""; + oldPassword: string; /** * @generated from field: string new_password = 3; */ - newPassword = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.ChangePasswordRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "old_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "new_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + newPassword: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): ChangePasswordRequest { - return new ChangePasswordRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangePasswordRequest { - return new ChangePasswordRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChangePasswordRequest { - return new ChangePasswordRequest().fromJsonString(jsonString, options); - } - - static equals(a: ChangePasswordRequest | PlainMessage | undefined, b: ChangePasswordRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ChangePasswordRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.ChangePasswordRequest. + * Use `create(ChangePasswordRequestSchema)` to create a new message. + */ +export const ChangePasswordRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 10); /** * @generated from message protobuf.auth.v1.ChangePasswordResponse */ -export class ChangePasswordResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.ChangePasswordResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangePasswordResponse { - return new ChangePasswordResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangePasswordResponse { - return new ChangePasswordResponse().fromJson(jsonValue, options); - } +export type ChangePasswordResponse = Message<"protobuf.auth.v1.ChangePasswordResponse"> & { +}; - static fromJsonString(jsonString: string, options?: Partial): ChangePasswordResponse { - return new ChangePasswordResponse().fromJsonString(jsonString, options); - } - - static equals(a: ChangePasswordResponse | PlainMessage | undefined, b: ChangePasswordResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ChangePasswordResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.ChangePasswordResponse. + * Use `create(ChangePasswordResponseSchema)` to create a new message. + */ +export const ChangePasswordResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 11); /** * @generated from message protobuf.auth.v1.AuthenticateRequest */ -export class AuthenticateRequest extends Message { +export type AuthenticateRequest = Message<"protobuf.auth.v1.AuthenticateRequest"> & { /** * @generated from field: string access_token = 1; */ - accessToken = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.AuthenticateRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AuthenticateRequest { - return new AuthenticateRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AuthenticateRequest { - return new AuthenticateRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AuthenticateRequest { - return new AuthenticateRequest().fromJsonString(jsonString, options); - } + accessToken: string; +}; - static equals(a: AuthenticateRequest | PlainMessage | undefined, b: AuthenticateRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(AuthenticateRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.AuthenticateRequest. + * Use `create(AuthenticateRequestSchema)` to create a new message. + */ +export const AuthenticateRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 12); /** * @generated from message protobuf.auth.v1.AuthenticateResponse */ -export class AuthenticateResponse extends Message { +export type AuthenticateResponse = Message<"protobuf.auth.v1.AuthenticateResponse"> & { /** * @generated from field: protobuf.model.user.v1.User user = 1; */ user?: User; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.AuthenticateResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user", kind: "message", T: User }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AuthenticateResponse { - return new AuthenticateResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AuthenticateResponse { - return new AuthenticateResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AuthenticateResponse { - return new AuthenticateResponse().fromJsonString(jsonString, options); - } - - static equals(a: AuthenticateResponse | PlainMessage | undefined, b: AuthenticateResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(AuthenticateResponse, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.AuthenticateResponse. + * Use `create(AuthenticateResponseSchema)` to create a new message. + */ +export const AuthenticateResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 13); /** * @generated from message protobuf.auth.v1.RefreshTokenRequest */ -export class RefreshTokenRequest extends Message { +export type RefreshTokenRequest = Message<"protobuf.auth.v1.RefreshTokenRequest"> & { /** * @generated from field: string refresh_token = 1; */ - refreshToken = ""; + refreshToken: string; /** * @generated from field: string user_id = 2; */ - userId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.RefreshTokenRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "refresh_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RefreshTokenRequest { - return new RefreshTokenRequest().fromBinary(bytes, options); - } + userId: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): RefreshTokenRequest { - return new RefreshTokenRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RefreshTokenRequest { - return new RefreshTokenRequest().fromJsonString(jsonString, options); - } - - static equals(a: RefreshTokenRequest | PlainMessage | undefined, b: RefreshTokenRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(RefreshTokenRequest, a, b); - } -} +/** + * Describes the message protobuf.auth.v1.RefreshTokenRequest. + * Use `create(RefreshTokenRequestSchema)` to create a new message. + */ +export const RefreshTokenRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 14); /** * @generated from message protobuf.auth.v1.RefreshTokenResponse */ -export class RefreshTokenResponse extends Message { +export type RefreshTokenResponse = Message<"protobuf.auth.v1.RefreshTokenResponse"> & { /** * @generated from field: string access_token = 1; */ - accessToken = ""; + accessToken: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.auth.v1.RefreshTokenResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RefreshTokenResponse { - return new RefreshTokenResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RefreshTokenResponse { - return new RefreshTokenResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RefreshTokenResponse { - return new RefreshTokenResponse().fromJsonString(jsonString, options); - } +/** + * Describes the message protobuf.auth.v1.RefreshTokenResponse. + * Use `create(RefreshTokenResponseSchema)` to create a new message. + */ +export const RefreshTokenResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_auth_v1_auth, 15); - static equals(a: RefreshTokenResponse | PlainMessage | undefined, b: RefreshTokenResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(RefreshTokenResponse, a, b); - } -} +/** + * @generated from service protobuf.auth.v1.AuthService + */ +export const AuthService: GenService<{ + /** + * @generated from rpc protobuf.auth.v1.AuthService.Login + */ + login: { + methodKind: "unary"; + input: typeof LoginRequestSchema; + output: typeof LoginResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.Register + */ + register: { + methodKind: "unary"; + input: typeof RegisterRequestSchema; + output: typeof RegisterResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.VerifyEmail + */ + verifyEmail: { + methodKind: "unary"; + input: typeof VerifyEmailRequestSchema; + output: typeof VerifyEmailResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.SendResetPassword + */ + sendResetPassword: { + methodKind: "unary"; + input: typeof SendResetPasswordRequestSchema; + output: typeof SendResetPasswordResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.SubmitResetPassword + */ + submitResetPassword: { + methodKind: "unary"; + input: typeof SubmitResetPasswordRequestSchema; + output: typeof SubmitResetPasswordResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.ChangePassword + */ + changePassword: { + methodKind: "unary"; + input: typeof ChangePasswordRequestSchema; + output: typeof ChangePasswordResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.Authenticate + */ + authenticate: { + methodKind: "unary"; + input: typeof AuthenticateRequestSchema; + output: typeof AuthenticateResponseSchema; + }, + /** + * @generated from rpc protobuf.auth.v1.AuthService.RefreshToken + */ + refreshToken: { + methodKind: "unary"; + input: typeof RefreshTokenRequestSchema; + output: typeof RefreshTokenResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_protobuf_auth_v1_auth, 0); diff --git a/protobuf/gen/es/protobuf/chat/v1/chat_pb.ts b/protobuf/gen/es/protobuf/chat/v1/chat_pb.ts index f9d76d5..c4ebb98 100644 --- a/protobuf/gen/es/protobuf/chat/v1/chat_pb.ts +++ b/protobuf/gen/es/protobuf/chat/v1/chat_pb.ts @@ -1,545 +1,325 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/chat/v1/chat.proto (package protobuf.chat.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { Chat } from "../../model/chat/v1/chat_pb.ts"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Chat } from "../../model/chat/v1/chat_pb.ts"; +import { file_protobuf_model_chat_v1_chat } from "../../model/chat/v1/chat_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/chat/v1/chat.proto. + */ +export const file_protobuf_chat_v1_chat: GenFile = /*@__PURE__*/ + fileDesc("Chtwcm90b2J1Zi9jaGF0L3YxL2NoYXQucHJvdG8SEHByb3RvYnVmLmNoYXQudjEiEgoQQ2hhdEV2ZW50UmVxdWVzdCIhChFDaGF0RXZlbnRSZXNwb25zZRIMCgRkYXRhGAIgASgMIiEKDkdldENoYXRSZXF1ZXN0Eg8KB2NoYXRfaWQYASABKAkiPQoPR2V0Q2hhdFJlc3BvbnNlEioKBGNoYXQYASABKAsyHC5wcm90b2J1Zi5tb2RlbC5jaGF0LnYxLkNoYXQiJgoTR2V0VXNlckNoYXRzUmVxdWVzdBIPCgd1c2VyX2lkGAEgASgJIkMKFEdldFVzZXJDaGF0c1Jlc3BvbnNlEisKBWNoYXRzGAEgAygLMhwucHJvdG9idWYubW9kZWwuY2hhdC52MS5DaGF0IjAKE0NyZWF0ZURpcmVjdFJlcXVlc3QSGQoRcmVjaXBpZW50X3VzZXJfaWQYASABKAkiQgoUQ3JlYXRlRGlyZWN0UmVzcG9uc2USKgoEY2hhdBgBIAEoCzIcLnByb3RvYnVmLm1vZGVsLmNoYXQudjEuQ2hhdCJKChJDcmVhdGVHcm91cFJlcXVlc3QSDQoFdGl0bGUYASABKAkSEAoIdXNlcm5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkiQQoTQ3JlYXRlR3JvdXBSZXNwb25zZRIqCgRjaGF0GAEgASgLMhwucHJvdG9idWYubW9kZWwuY2hhdC52MS5DaGF0IkwKFENyZWF0ZUNoYW5uZWxSZXF1ZXN0Eg0KBXRpdGxlGAEgASgJEhAKCHVzZXJuYW1lGAIgASgJEhMKC2Rlc2NyaXB0aW9uGAMgASgJIkMKFUNyZWF0ZUNoYW5uZWxSZXNwb25zZRIqCgRjaGF0GAEgASgLMhwucHJvdG9idWYubW9kZWwuY2hhdC52MS5DaGF0IiIKD0pvaW5DaGF0UmVxdWVzdBIPCgdjaGF0X2lkGAEgASgJIj4KEEpvaW5DaGF0UmVzcG9uc2USKgoEY2hhdBgBIAEoCzIcLnByb3RvYnVmLm1vZGVsLmNoYXQudjEuQ2hhdDK4BAoLQ2hhdFNlcnZpY2USUAoHR2V0Q2hhdBIgLnByb3RvYnVmLmNoYXQudjEuR2V0Q2hhdFJlcXVlc3QaIS5wcm90b2J1Zi5jaGF0LnYxLkdldENoYXRSZXNwb25zZSIAEl8KDEdldFVzZXJDaGF0cxIlLnByb3RvYnVmLmNoYXQudjEuR2V0VXNlckNoYXRzUmVxdWVzdBomLnByb3RvYnVmLmNoYXQudjEuR2V0VXNlckNoYXRzUmVzcG9uc2UiABJfCgxDcmVhdGVEaXJlY3QSJS5wcm90b2J1Zi5jaGF0LnYxLkNyZWF0ZURpcmVjdFJlcXVlc3QaJi5wcm90b2J1Zi5jaGF0LnYxLkNyZWF0ZURpcmVjdFJlc3BvbnNlIgASXAoLQ3JlYXRlR3JvdXASJC5wcm90b2J1Zi5jaGF0LnYxLkNyZWF0ZUdyb3VwUmVxdWVzdBolLnByb3RvYnVmLmNoYXQudjEuQ3JlYXRlR3JvdXBSZXNwb25zZSIAEmIKDUNyZWF0ZUNoYW5uZWwSJi5wcm90b2J1Zi5jaGF0LnYxLkNyZWF0ZUNoYW5uZWxSZXF1ZXN0GicucHJvdG9idWYuY2hhdC52MS5DcmVhdGVDaGFubmVsUmVzcG9uc2UiABJTCghKb2luQ2hhdBIhLnByb3RvYnVmLmNoYXQudjEuSm9pbkNoYXRSZXF1ZXN0GiIucHJvdG9idWYuY2hhdC52MS5Kb2luQ2hhdFJlc3BvbnNlIgBCygEKFGNvbS5wcm90b2J1Zi5jaGF0LnYxQglDaGF0UHJvdG9QAVpFZ2l0aHViLmNvbS9rYXZrYWNvL0thdmthLUNvcmUvcHJvdG9idWYvZ2VuL2dvL3Byb3RvYnVmL2NoYXQvdjE7Y2hhdHYxogIDUENYqgIQUHJvdG9idWYuQ2hhdC5WMcoCEFByb3RvYnVmXENoYXRcVjHiAhxQcm90b2J1ZlxDaGF0XFYxXEdQQk1ldGFkYXRh6gISUHJvdG9idWY6OkNoYXQ6OlYxYgZwcm90bzM", [file_protobuf_model_chat_v1_chat]); /** * @generated from message protobuf.chat.v1.ChatEventRequest */ -export class ChatEventRequest extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.ChatEventRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChatEventRequest { - return new ChatEventRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChatEventRequest { - return new ChatEventRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChatEventRequest { - return new ChatEventRequest().fromJsonString(jsonString, options); - } - - static equals(a: ChatEventRequest | PlainMessage | undefined, b: ChatEventRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatEventRequest, a, b); - } -} +export type ChatEventRequest = Message<"protobuf.chat.v1.ChatEventRequest"> & { +}; + +/** + * Describes the message protobuf.chat.v1.ChatEventRequest. + * Use `create(ChatEventRequestSchema)` to create a new message. + */ +export const ChatEventRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 0); /** * @generated from message protobuf.chat.v1.ChatEventResponse */ -export class ChatEventResponse extends Message { +export type ChatEventResponse = Message<"protobuf.chat.v1.ChatEventResponse"> & { /** * @generated from field: bytes data = 2; */ - data = new Uint8Array(0); - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + data: Uint8Array; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.ChatEventResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "data", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChatEventResponse { - return new ChatEventResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChatEventResponse { - return new ChatEventResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChatEventResponse { - return new ChatEventResponse().fromJsonString(jsonString, options); - } - - static equals(a: ChatEventResponse | PlainMessage | undefined, b: ChatEventResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatEventResponse, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.ChatEventResponse. + * Use `create(ChatEventResponseSchema)` to create a new message. + */ +export const ChatEventResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 1); /** * @generated from message protobuf.chat.v1.GetChatRequest */ -export class GetChatRequest extends Message { +export type GetChatRequest = Message<"protobuf.chat.v1.GetChatRequest"> & { /** * @generated from field: string chat_id = 1; */ - chatId = ""; + chatId: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.GetChatRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetChatRequest { - return new GetChatRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetChatRequest { - return new GetChatRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetChatRequest { - return new GetChatRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetChatRequest | PlainMessage | undefined, b: GetChatRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetChatRequest, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.GetChatRequest. + * Use `create(GetChatRequestSchema)` to create a new message. + */ +export const GetChatRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 2); /** * @generated from message protobuf.chat.v1.GetChatResponse */ -export class GetChatResponse extends Message { +export type GetChatResponse = Message<"protobuf.chat.v1.GetChatResponse"> & { /** * @generated from field: protobuf.model.chat.v1.Chat chat = 1; */ chat?: Chat; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.GetChatResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat", kind: "message", T: Chat }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetChatResponse { - return new GetChatResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetChatResponse { - return new GetChatResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetChatResponse { - return new GetChatResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetChatResponse | PlainMessage | undefined, b: GetChatResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetChatResponse, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.GetChatResponse. + * Use `create(GetChatResponseSchema)` to create a new message. + */ +export const GetChatResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 3); /** * @generated from message protobuf.chat.v1.GetUserChatsRequest */ -export class GetUserChatsRequest extends Message { +export type GetUserChatsRequest = Message<"protobuf.chat.v1.GetUserChatsRequest"> & { /** * @generated from field: string user_id = 1; */ - userId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.GetUserChatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetUserChatsRequest { - return new GetUserChatsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetUserChatsRequest { - return new GetUserChatsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetUserChatsRequest { - return new GetUserChatsRequest().fromJsonString(jsonString, options); - } + userId: string; +}; - static equals(a: GetUserChatsRequest | PlainMessage | undefined, b: GetUserChatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetUserChatsRequest, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.GetUserChatsRequest. + * Use `create(GetUserChatsRequestSchema)` to create a new message. + */ +export const GetUserChatsRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 4); /** * @generated from message protobuf.chat.v1.GetUserChatsResponse */ -export class GetUserChatsResponse extends Message { +export type GetUserChatsResponse = Message<"protobuf.chat.v1.GetUserChatsResponse"> & { /** * @generated from field: repeated protobuf.model.chat.v1.Chat chats = 1; */ - chats: Chat[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.GetUserChatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chats", kind: "message", T: Chat, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetUserChatsResponse { - return new GetUserChatsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetUserChatsResponse { - return new GetUserChatsResponse().fromJson(jsonValue, options); - } + chats: Chat[]; +}; - static fromJsonString(jsonString: string, options?: Partial): GetUserChatsResponse { - return new GetUserChatsResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetUserChatsResponse | PlainMessage | undefined, b: GetUserChatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetUserChatsResponse, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.GetUserChatsResponse. + * Use `create(GetUserChatsResponseSchema)` to create a new message. + */ +export const GetUserChatsResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 5); /** * @generated from message protobuf.chat.v1.CreateDirectRequest */ -export class CreateDirectRequest extends Message { +export type CreateDirectRequest = Message<"protobuf.chat.v1.CreateDirectRequest"> & { /** * @generated from field: string recipient_user_id = 1; */ - recipientUserId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.CreateDirectRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "recipient_user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateDirectRequest { - return new CreateDirectRequest().fromBinary(bytes, options); - } + recipientUserId: string; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): CreateDirectRequest { - return new CreateDirectRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateDirectRequest { - return new CreateDirectRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateDirectRequest | PlainMessage | undefined, b: CreateDirectRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateDirectRequest, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.CreateDirectRequest. + * Use `create(CreateDirectRequestSchema)` to create a new message. + */ +export const CreateDirectRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 6); /** * @generated from message protobuf.chat.v1.CreateDirectResponse */ -export class CreateDirectResponse extends Message { +export type CreateDirectResponse = Message<"protobuf.chat.v1.CreateDirectResponse"> & { /** * @generated from field: protobuf.model.chat.v1.Chat chat = 1; */ chat?: Chat; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.CreateDirectResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat", kind: "message", T: Chat }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateDirectResponse { - return new CreateDirectResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateDirectResponse { - return new CreateDirectResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateDirectResponse { - return new CreateDirectResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateDirectResponse | PlainMessage | undefined, b: CreateDirectResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateDirectResponse, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.CreateDirectResponse. + * Use `create(CreateDirectResponseSchema)` to create a new message. + */ +export const CreateDirectResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 7); /** * @generated from message protobuf.chat.v1.CreateGroupRequest */ -export class CreateGroupRequest extends Message { +export type CreateGroupRequest = Message<"protobuf.chat.v1.CreateGroupRequest"> & { /** * @generated from field: string title = 1; */ - title = ""; + title: string; /** * @generated from field: string username = 2; */ - username = ""; + username: string; /** * @generated from field: string description = 3; */ - description = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.CreateGroupRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateGroupRequest { - return new CreateGroupRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateGroupRequest { - return new CreateGroupRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateGroupRequest { - return new CreateGroupRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateGroupRequest | PlainMessage | undefined, b: CreateGroupRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateGroupRequest, a, b); - } -} + description: string; +}; + +/** + * Describes the message protobuf.chat.v1.CreateGroupRequest. + * Use `create(CreateGroupRequestSchema)` to create a new message. + */ +export const CreateGroupRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 8); /** * @generated from message protobuf.chat.v1.CreateGroupResponse */ -export class CreateGroupResponse extends Message { +export type CreateGroupResponse = Message<"protobuf.chat.v1.CreateGroupResponse"> & { /** * @generated from field: protobuf.model.chat.v1.Chat chat = 1; */ chat?: Chat; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.CreateGroupResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat", kind: "message", T: Chat }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateGroupResponse { - return new CreateGroupResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateGroupResponse { - return new CreateGroupResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateGroupResponse { - return new CreateGroupResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateGroupResponse | PlainMessage | undefined, b: CreateGroupResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateGroupResponse, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.CreateGroupResponse. + * Use `create(CreateGroupResponseSchema)` to create a new message. + */ +export const CreateGroupResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 9); /** * @generated from message protobuf.chat.v1.CreateChannelRequest */ -export class CreateChannelRequest extends Message { +export type CreateChannelRequest = Message<"protobuf.chat.v1.CreateChannelRequest"> & { /** * @generated from field: string title = 1; */ - title = ""; + title: string; /** * @generated from field: string username = 2; */ - username = ""; + username: string; /** * @generated from field: string description = 3; */ - description = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.CreateChannelRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateChannelRequest { - return new CreateChannelRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateChannelRequest { - return new CreateChannelRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateChannelRequest { - return new CreateChannelRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateChannelRequest | PlainMessage | undefined, b: CreateChannelRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateChannelRequest, a, b); - } -} + description: string; +}; + +/** + * Describes the message protobuf.chat.v1.CreateChannelRequest. + * Use `create(CreateChannelRequestSchema)` to create a new message. + */ +export const CreateChannelRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 10); /** * @generated from message protobuf.chat.v1.CreateChannelResponse */ -export class CreateChannelResponse extends Message { +export type CreateChannelResponse = Message<"protobuf.chat.v1.CreateChannelResponse"> & { /** * @generated from field: protobuf.model.chat.v1.Chat chat = 1; */ chat?: Chat; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.CreateChannelResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat", kind: "message", T: Chat }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateChannelResponse { - return new CreateChannelResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateChannelResponse { - return new CreateChannelResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateChannelResponse { - return new CreateChannelResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateChannelResponse | PlainMessage | undefined, b: CreateChannelResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateChannelResponse, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.CreateChannelResponse. + * Use `create(CreateChannelResponseSchema)` to create a new message. + */ +export const CreateChannelResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 11); /** * @generated from message protobuf.chat.v1.JoinChatRequest */ -export class JoinChatRequest extends Message { +export type JoinChatRequest = Message<"protobuf.chat.v1.JoinChatRequest"> & { /** * @generated from field: string chat_id = 1; */ - chatId = ""; + chatId: string; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.JoinChatRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): JoinChatRequest { - return new JoinChatRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): JoinChatRequest { - return new JoinChatRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): JoinChatRequest { - return new JoinChatRequest().fromJsonString(jsonString, options); - } - - static equals(a: JoinChatRequest | PlainMessage | undefined, b: JoinChatRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(JoinChatRequest, a, b); - } -} +/** + * Describes the message protobuf.chat.v1.JoinChatRequest. + * Use `create(JoinChatRequestSchema)` to create a new message. + */ +export const JoinChatRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 12); /** * @generated from message protobuf.chat.v1.JoinChatResponse */ -export class JoinChatResponse extends Message { +export type JoinChatResponse = Message<"protobuf.chat.v1.JoinChatResponse"> & { /** * @generated from field: protobuf.model.chat.v1.Chat chat = 1; */ chat?: Chat; +}; + +/** + * Describes the message protobuf.chat.v1.JoinChatResponse. + * Use `create(JoinChatResponseSchema)` to create a new message. + */ +export const JoinChatResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_chat_v1_chat, 13); - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.chat.v1.JoinChatResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat", kind: "message", T: Chat }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): JoinChatResponse { - return new JoinChatResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): JoinChatResponse { - return new JoinChatResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): JoinChatResponse { - return new JoinChatResponse().fromJsonString(jsonString, options); - } - - static equals(a: JoinChatResponse | PlainMessage | undefined, b: JoinChatResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(JoinChatResponse, a, b); - } -} +/** + * @generated from service protobuf.chat.v1.ChatService + */ +export const ChatService: GenService<{ + /** + * @generated from rpc protobuf.chat.v1.ChatService.GetChat + */ + getChat: { + methodKind: "unary"; + input: typeof GetChatRequestSchema; + output: typeof GetChatResponseSchema; + }, + /** + * @generated from rpc protobuf.chat.v1.ChatService.GetUserChats + */ + getUserChats: { + methodKind: "unary"; + input: typeof GetUserChatsRequestSchema; + output: typeof GetUserChatsResponseSchema; + }, + /** + * @generated from rpc protobuf.chat.v1.ChatService.CreateDirect + */ + createDirect: { + methodKind: "unary"; + input: typeof CreateDirectRequestSchema; + output: typeof CreateDirectResponseSchema; + }, + /** + * @generated from rpc protobuf.chat.v1.ChatService.CreateGroup + */ + createGroup: { + methodKind: "unary"; + input: typeof CreateGroupRequestSchema; + output: typeof CreateGroupResponseSchema; + }, + /** + * @generated from rpc protobuf.chat.v1.ChatService.CreateChannel + */ + createChannel: { + methodKind: "unary"; + input: typeof CreateChannelRequestSchema; + output: typeof CreateChannelResponseSchema; + }, + /** + * @generated from rpc protobuf.chat.v1.ChatService.JoinChat + */ + joinChat: { + methodKind: "unary"; + input: typeof JoinChatRequestSchema; + output: typeof JoinChatResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_protobuf_chat_v1_chat, 0); diff --git a/protobuf/gen/es/protobuf/events/v1/events_pb.ts b/protobuf/gen/es/protobuf/events/v1/events_pb.ts index af7aada..00ba8ea 100644 --- a/protobuf/gen/es/protobuf/events/v1/events_pb.ts +++ b/protobuf/gen/es/protobuf/events/v1/events_pb.ts @@ -1,106 +1,74 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/events/v1/events.proto (package protobuf.events.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { Chat } from "../../model/chat/v1/chat_pb.ts"; -import { Message as Message$1 } from "../../model/message/v1/message_pb.ts"; +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Chat } from "../../model/chat/v1/chat_pb.ts"; +import { file_protobuf_model_chat_v1_chat } from "../../model/chat/v1/chat_pb.ts"; +import type { Message as Message$1 } from "../../model/message/v1/message_pb.ts"; +import { file_protobuf_model_message_v1_message } from "../../model/message/v1/message_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/events/v1/events.proto. + */ +export const file_protobuf_events_v1_events: GenFile = /*@__PURE__*/ + fileDesc("Ch9wcm90b2J1Zi9ldmVudHMvdjEvZXZlbnRzLnByb3RvEhJwcm90b2J1Zi5ldmVudHMudjEiUQoLU3RyZWFtRXZlbnQSFgoOc2VuZGVyX3VzZXJfaWQYASABKAkSGQoRcmVjZWl2ZXJzX3VzZXJfaWQYAiADKAkSDwoHcGF5bG9hZBgDIAEoDCIeChxTdWJzY3JpYmVFdmVudHNTdHJlYW1SZXF1ZXN0IrgDCh1TdWJzY3JpYmVFdmVudHNTdHJlYW1SZXNwb25zZRIMCgRuYW1lGAEgASgJEkQKBHR5cGUYAiABKA4yNi5wcm90b2J1Zi5ldmVudHMudjEuU3Vic2NyaWJlRXZlbnRzU3RyZWFtUmVzcG9uc2UuVHlwZRIvCghhZGRfY2hhdBgDIAEoCzIbLnByb3RvYnVmLmV2ZW50cy52MS5BZGRDaGF0SAASNQoLYWRkX21lc3NhZ2UYBCABKAsyHi5wcm90b2J1Zi5ldmVudHMudjEuQWRkTWVzc2FnZUgAIs8BCgRUeXBlEhQKEFRZUEVfVU5TUEVDSUZJRUQQABIRCg1UWVBFX0FERF9DSEFUEAESFAoQVFlQRV9SRU1PVkVfQ0hBVBACEhQKEFRZUEVfVVBEQVRFX0NIQVQQAxIUChBUWVBFX0FERF9NRVNTQUdFEAQSFwoTVFlQRV9SRU1PVkVfTUVTU0FHRRAFEhcKE1RZUEVfVVBEQVRFX01FU1NBR0UQBhITCg9UWVBFX0NMRUFSX0NIQVQQBxIVChFUWVBFX01FU1NBR0VfU0VFThAIQgkKB3BheWxvYWQiNQoHQWRkQ2hhdBIqCgRjaGF0GAEgASgLMhwucHJvdG9idWYubW9kZWwuY2hhdC52MS5DaGF0IlIKCkFkZE1lc3NhZ2USDwoHY2hhdF9pZBgBIAEoCRIzCgdtZXNzYWdlGAIgASgLMiIucHJvdG9idWYubW9kZWwubWVzc2FnZS52MS5NZXNzYWdlMpIBCg1FdmVudHNTZXJ2aWNlEoABChVTdWJzY3JpYmVFdmVudHNTdHJlYW0SMC5wcm90b2J1Zi5ldmVudHMudjEuU3Vic2NyaWJlRXZlbnRzU3RyZWFtUmVxdWVzdBoxLnByb3RvYnVmLmV2ZW50cy52MS5TdWJzY3JpYmVFdmVudHNTdHJlYW1SZXNwb25zZSIAMAFC2gEKFmNvbS5wcm90b2J1Zi5ldmVudHMudjFCC0V2ZW50c1Byb3RvUAFaSWdpdGh1Yi5jb20va2F2a2Fjby9LYXZrYS1Db3JlL3Byb3RvYnVmL2dlbi9nby9wcm90b2J1Zi9ldmVudHMvdjE7ZXZlbnRzdjGiAgNQRViqAhJQcm90b2J1Zi5FdmVudHMuVjHKAhJQcm90b2J1ZlxFdmVudHNcVjHiAh5Qcm90b2J1ZlxFdmVudHNcVjFcR1BCTWV0YWRhdGHqAhRQcm90b2J1Zjo6RXZlbnRzOjpWMWIGcHJvdG8z", [file_protobuf_model_chat_v1_chat, file_protobuf_model_message_v1_message]); /** * @generated from message protobuf.events.v1.StreamEvent */ -export class StreamEvent extends Message { +export type StreamEvent = Message<"protobuf.events.v1.StreamEvent"> & { /** * @generated from field: string sender_user_id = 1; */ - senderUserId = ""; + senderUserId: string; /** * @generated from field: repeated string receivers_user_id = 2; */ - receiversUserId: string[] = []; + receiversUserId: string[]; /** * @generated from field: bytes payload = 3; */ - payload = new Uint8Array(0); - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.events.v1.StreamEvent"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "sender_user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "receivers_user_id", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 3, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): StreamEvent { - return new StreamEvent().fromBinary(bytes, options); - } + payload: Uint8Array; +}; - static fromJson(jsonValue: JsonValue, options?: Partial): StreamEvent { - return new StreamEvent().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): StreamEvent { - return new StreamEvent().fromJsonString(jsonString, options); - } - - static equals(a: StreamEvent | PlainMessage | undefined, b: StreamEvent | PlainMessage | undefined): boolean { - return proto3.util.equals(StreamEvent, a, b); - } -} +/** + * Describes the message protobuf.events.v1.StreamEvent. + * Use `create(StreamEventSchema)` to create a new message. + */ +export const StreamEventSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_events_v1_events, 0); /** * @generated from message protobuf.events.v1.SubscribeEventsStreamRequest */ -export class SubscribeEventsStreamRequest extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.events.v1.SubscribeEventsStreamRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); +export type SubscribeEventsStreamRequest = Message<"protobuf.events.v1.SubscribeEventsStreamRequest"> & { +}; - static fromBinary(bytes: Uint8Array, options?: Partial): SubscribeEventsStreamRequest { - return new SubscribeEventsStreamRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SubscribeEventsStreamRequest { - return new SubscribeEventsStreamRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SubscribeEventsStreamRequest { - return new SubscribeEventsStreamRequest().fromJsonString(jsonString, options); - } - - static equals(a: SubscribeEventsStreamRequest | PlainMessage | undefined, b: SubscribeEventsStreamRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SubscribeEventsStreamRequest, a, b); - } -} +/** + * Describes the message protobuf.events.v1.SubscribeEventsStreamRequest. + * Use `create(SubscribeEventsStreamRequestSchema)` to create a new message. + */ +export const SubscribeEventsStreamRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_events_v1_events, 1); /** * @generated from message protobuf.events.v1.SubscribeEventsStreamResponse */ -export class SubscribeEventsStreamResponse extends Message { +export type SubscribeEventsStreamResponse = Message<"protobuf.events.v1.SubscribeEventsStreamResponse"> & { /** * @generated from field: string name = 1; */ - name = ""; + name: string; /** * @generated from field: protobuf.events.v1.SubscribeEventsStreamResponse.Type type = 2; */ - type = SubscribeEventsStreamResponse_Type.UNSPECIFIED; + type: SubscribeEventsStreamResponse_Type; /** * @generated from oneof protobuf.events.v1.SubscribeEventsStreamResponse.payload @@ -117,38 +85,15 @@ export class SubscribeEventsStreamResponse extends Message) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.events.v1.SubscribeEventsStreamResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(SubscribeEventsStreamResponse_Type) }, - { no: 3, name: "add_chat", kind: "message", T: AddChat, oneof: "payload" }, - { no: 4, name: "add_message", kind: "message", T: AddMessage, oneof: "payload" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SubscribeEventsStreamResponse { - return new SubscribeEventsStreamResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SubscribeEventsStreamResponse { - return new SubscribeEventsStreamResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SubscribeEventsStreamResponse { - return new SubscribeEventsStreamResponse().fromJsonString(jsonString, options); - } - - static equals(a: SubscribeEventsStreamResponse | PlainMessage | undefined, b: SubscribeEventsStreamResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SubscribeEventsStreamResponse, a, b); - } -} +/** + * Describes the message protobuf.events.v1.SubscribeEventsStreamResponse. + * Use `create(SubscribeEventsStreamResponseSchema)` to create a new message. + */ +export const SubscribeEventsStreamResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_events_v1_events, 2); /** * @generated from enum protobuf.events.v1.SubscribeEventsStreamResponse.Type @@ -199,96 +144,64 @@ export enum SubscribeEventsStreamResponse_Type { */ MESSAGE_SEEN = 8, } -// Retrieve enum metadata with: proto3.getEnumType(SubscribeEventsStreamResponse_Type) -proto3.util.setEnumType(SubscribeEventsStreamResponse_Type, "protobuf.events.v1.SubscribeEventsStreamResponse.Type", [ - { no: 0, name: "TYPE_UNSPECIFIED" }, - { no: 1, name: "TYPE_ADD_CHAT" }, - { no: 2, name: "TYPE_REMOVE_CHAT" }, - { no: 3, name: "TYPE_UPDATE_CHAT" }, - { no: 4, name: "TYPE_ADD_MESSAGE" }, - { no: 5, name: "TYPE_REMOVE_MESSAGE" }, - { no: 6, name: "TYPE_UPDATE_MESSAGE" }, - { no: 7, name: "TYPE_CLEAR_CHAT" }, - { no: 8, name: "TYPE_MESSAGE_SEEN" }, -]); + +/** + * Describes the enum protobuf.events.v1.SubscribeEventsStreamResponse.Type. + */ +export const SubscribeEventsStreamResponse_TypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_protobuf_events_v1_events, 2, 0); /** * @generated from message protobuf.events.v1.AddChat */ -export class AddChat extends Message { +export type AddChat = Message<"protobuf.events.v1.AddChat"> & { /** * @generated from field: protobuf.model.chat.v1.Chat chat = 1; */ chat?: Chat; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.events.v1.AddChat"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat", kind: "message", T: Chat }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AddChat { - return new AddChat().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AddChat { - return new AddChat().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AddChat { - return new AddChat().fromJsonString(jsonString, options); - } - - static equals(a: AddChat | PlainMessage | undefined, b: AddChat | PlainMessage | undefined): boolean { - return proto3.util.equals(AddChat, a, b); - } -} +/** + * Describes the message protobuf.events.v1.AddChat. + * Use `create(AddChatSchema)` to create a new message. + */ +export const AddChatSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_events_v1_events, 3); /** * @generated from message protobuf.events.v1.AddMessage */ -export class AddMessage extends Message { +export type AddMessage = Message<"protobuf.events.v1.AddMessage"> & { /** * @generated from field: string chat_id = 1; */ - chatId = ""; + chatId: string; /** * @generated from field: protobuf.model.message.v1.Message message = 2; */ message?: Message$1; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.events.v1.AddMessage"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "message", kind: "message", T: Message$1 }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): AddMessage { - return new AddMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): AddMessage { - return new AddMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): AddMessage { - return new AddMessage().fromJsonString(jsonString, options); - } +/** + * Describes the message protobuf.events.v1.AddMessage. + * Use `create(AddMessageSchema)` to create a new message. + */ +export const AddMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_events_v1_events, 4); - static equals(a: AddMessage | PlainMessage | undefined, b: AddMessage | PlainMessage | undefined): boolean { - return proto3.util.equals(AddMessage, a, b); - } -} +/** + * @generated from service protobuf.events.v1.EventsService + */ +export const EventsService: GenService<{ + /** + * @generated from rpc protobuf.events.v1.EventsService.SubscribeEventsStream + */ + subscribeEventsStream: { + methodKind: "server_streaming"; + input: typeof SubscribeEventsStreamRequestSchema; + output: typeof SubscribeEventsStreamResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_protobuf_events_v1_events, 0); diff --git a/protobuf/gen/es/protobuf/message/v1/message_pb.ts b/protobuf/gen/es/protobuf/message/v1/message_pb.ts index b8436be..2aa6403 100644 --- a/protobuf/gen/es/protobuf/message/v1/message_pb.ts +++ b/protobuf/gen/es/protobuf/message/v1/message_pb.ts @@ -1,163 +1,112 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/message/v1/message.proto (package protobuf.message.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { Message as Message$1 } from "../../model/message/v1/message_pb.ts"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message as Message$1 } from "../../model/message/v1/message_pb.ts"; +import { file_protobuf_model_message_v1_message } from "../../model/message/v1/message_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/message/v1/message.proto. + */ +export const file_protobuf_message_v1_message: GenFile = /*@__PURE__*/ + fileDesc("CiFwcm90b2J1Zi9tZXNzYWdlL3YxL21lc3NhZ2UucHJvdG8SE3Byb3RvYnVmLm1lc3NhZ2UudjEiJwoURmV0Y2hNZXNzYWdlc1JlcXVlc3QSDwoHY2hhdF9pZBgBIAEoCSJNChVGZXRjaE1lc3NhZ2VzUmVzcG9uc2USNAoIbWVzc2FnZXMYASADKAsyIi5wcm90b2J1Zi5tb2RlbC5tZXNzYWdlLnYxLk1lc3NhZ2UiNwoWU2VuZFRleHRNZXNzYWdlUmVxdWVzdBIPCgdjaGF0X2lkGAEgASgJEgwKBHRleHQYAiABKAkiTgoXU2VuZFRleHRNZXNzYWdlUmVzcG9uc2USMwoHbWVzc2FnZRgBIAEoCzIiLnByb3RvYnVmLm1vZGVsLm1lc3NhZ2UudjEuTWVzc2FnZTLqAQoOTWVzc2FnZVNlcnZpY2USaAoNRmV0Y2hNZXNzYWdlcxIpLnByb3RvYnVmLm1lc3NhZ2UudjEuRmV0Y2hNZXNzYWdlc1JlcXVlc3QaKi5wcm90b2J1Zi5tZXNzYWdlLnYxLkZldGNoTWVzc2FnZXNSZXNwb25zZSIAEm4KD1NlbmRUZXh0TWVzc2FnZRIrLnByb3RvYnVmLm1lc3NhZ2UudjEuU2VuZFRleHRNZXNzYWdlUmVxdWVzdBosLnByb3RvYnVmLm1lc3NhZ2UudjEuU2VuZFRleHRNZXNzYWdlUmVzcG9uc2UiAELiAQoXY29tLnByb3RvYnVmLm1lc3NhZ2UudjFCDE1lc3NhZ2VQcm90b1ABWktnaXRodWIuY29tL2thdmthY28vS2F2a2EtQ29yZS9wcm90b2J1Zi9nZW4vZ28vcHJvdG9idWYvbWVzc2FnZS92MTttZXNzYWdldjGiAgNQTViqAhNQcm90b2J1Zi5NZXNzYWdlLlYxygITUHJvdG9idWZcTWVzc2FnZVxWMeICH1Byb3RvYnVmXE1lc3NhZ2VcVjFcR1BCTWV0YWRhdGHqAhVQcm90b2J1Zjo6TWVzc2FnZTo6VjFiBnByb3RvMw", [file_protobuf_model_message_v1_message]); /** * @generated from message protobuf.message.v1.FetchMessagesRequest */ -export class FetchMessagesRequest extends Message { +export type FetchMessagesRequest = Message<"protobuf.message.v1.FetchMessagesRequest"> & { /** * @generated from field: string chat_id = 1; */ - chatId = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.message.v1.FetchMessagesRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + chatId: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): FetchMessagesRequest { - return new FetchMessagesRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FetchMessagesRequest { - return new FetchMessagesRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FetchMessagesRequest { - return new FetchMessagesRequest().fromJsonString(jsonString, options); - } - - static equals(a: FetchMessagesRequest | PlainMessage | undefined, b: FetchMessagesRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(FetchMessagesRequest, a, b); - } -} +/** + * Describes the message protobuf.message.v1.FetchMessagesRequest. + * Use `create(FetchMessagesRequestSchema)` to create a new message. + */ +export const FetchMessagesRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_message_v1_message, 0); /** * @generated from message protobuf.message.v1.FetchMessagesResponse */ -export class FetchMessagesResponse extends Message { +export type FetchMessagesResponse = Message<"protobuf.message.v1.FetchMessagesResponse"> & { /** * @generated from field: repeated protobuf.model.message.v1.Message messages = 1; */ - messages: Message$1[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.message.v1.FetchMessagesResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "messages", kind: "message", T: Message$1, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FetchMessagesResponse { - return new FetchMessagesResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FetchMessagesResponse { - return new FetchMessagesResponse().fromJson(jsonValue, options); - } + messages: Message$1[]; +}; - static fromJsonString(jsonString: string, options?: Partial): FetchMessagesResponse { - return new FetchMessagesResponse().fromJsonString(jsonString, options); - } - - static equals(a: FetchMessagesResponse | PlainMessage | undefined, b: FetchMessagesResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(FetchMessagesResponse, a, b); - } -} +/** + * Describes the message protobuf.message.v1.FetchMessagesResponse. + * Use `create(FetchMessagesResponseSchema)` to create a new message. + */ +export const FetchMessagesResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_message_v1_message, 1); /** * @generated from message protobuf.message.v1.SendTextMessageRequest */ -export class SendTextMessageRequest extends Message { +export type SendTextMessageRequest = Message<"protobuf.message.v1.SendTextMessageRequest"> & { /** * @generated from field: string chat_id = 1; */ - chatId = ""; + chatId: string; /** * @generated from field: string text = 2; */ - text = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + text: string; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.message.v1.SendTextMessageRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SendTextMessageRequest { - return new SendTextMessageRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendTextMessageRequest { - return new SendTextMessageRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendTextMessageRequest { - return new SendTextMessageRequest().fromJsonString(jsonString, options); - } - - static equals(a: SendTextMessageRequest | PlainMessage | undefined, b: SendTextMessageRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SendTextMessageRequest, a, b); - } -} +/** + * Describes the message protobuf.message.v1.SendTextMessageRequest. + * Use `create(SendTextMessageRequestSchema)` to create a new message. + */ +export const SendTextMessageRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_message_v1_message, 2); /** * @generated from message protobuf.message.v1.SendTextMessageResponse */ -export class SendTextMessageResponse extends Message { +export type SendTextMessageResponse = Message<"protobuf.message.v1.SendTextMessageResponse"> & { /** * @generated from field: protobuf.model.message.v1.Message message = 1; */ message?: Message$1; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.message.v1.SendTextMessageResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message", kind: "message", T: Message$1 }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SendTextMessageResponse { - return new SendTextMessageResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SendTextMessageResponse { - return new SendTextMessageResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SendTextMessageResponse { - return new SendTextMessageResponse().fromJsonString(jsonString, options); - } +/** + * Describes the message protobuf.message.v1.SendTextMessageResponse. + * Use `create(SendTextMessageResponseSchema)` to create a new message. + */ +export const SendTextMessageResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_message_v1_message, 3); - static equals(a: SendTextMessageResponse | PlainMessage | undefined, b: SendTextMessageResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SendTextMessageResponse, a, b); - } -} +/** + * @generated from service protobuf.message.v1.MessageService + */ +export const MessageService: GenService<{ + /** + * @generated from rpc protobuf.message.v1.MessageService.FetchMessages + */ + fetchMessages: { + methodKind: "unary"; + input: typeof FetchMessagesRequestSchema; + output: typeof FetchMessagesResponseSchema; + }, + /** + * @generated from rpc protobuf.message.v1.MessageService.SendTextMessage + */ + sendTextMessage: { + methodKind: "unary"; + input: typeof SendTextMessageRequestSchema; + output: typeof SendTextMessageResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_protobuf_message_v1_message, 0); diff --git a/protobuf/gen/es/protobuf/model/chat/v1/chat_pb.ts b/protobuf/gen/es/protobuf/model/chat/v1/chat_pb.ts index 17762da..8e7d740 100644 --- a/protobuf/gen/es/protobuf/model/chat/v1/chat_pb.ts +++ b/protobuf/gen/es/protobuf/model/chat/v1/chat_pb.ts @@ -1,140 +1,72 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/model/chat/v1/chat.proto (package protobuf.model.chat.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { User } from "../../user/v1/user_pb.ts"; +import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { User } from "../../user/v1/user_pb.ts"; +import { file_protobuf_model_user_v1_user } from "../../user/v1/user_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; /** - * @generated from enum protobuf.model.chat.v1.ChatType + * Describes the file protobuf/model/chat/v1/chat.proto. */ -export enum ChatType { - /** - * @generated from enum value: CHAT_TYPE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * @generated from enum value: CHAT_TYPE_CHANNEL = 1; - */ - CHANNEL = 1, - - /** - * @generated from enum value: CHAT_TYPE_GROUP = 2; - */ - GROUP = 2, - - /** - * @generated from enum value: CHAT_TYPE_DIRECT = 3; - */ - DIRECT = 3, -} -// Retrieve enum metadata with: proto3.getEnumType(ChatType) -proto3.util.setEnumType(ChatType, "protobuf.model.chat.v1.ChatType", [ - { no: 0, name: "CHAT_TYPE_UNSPECIFIED" }, - { no: 1, name: "CHAT_TYPE_CHANNEL" }, - { no: 2, name: "CHAT_TYPE_GROUP" }, - { no: 3, name: "CHAT_TYPE_DIRECT" }, -]); +export const file_protobuf_model_chat_v1_chat: GenFile = /*@__PURE__*/ + fileDesc("CiFwcm90b2J1Zi9tb2RlbC9jaGF0L3YxL2NoYXQucHJvdG8SFnByb3RvYnVmLm1vZGVsLmNoYXQudjEiOgoGTWVtYmVyEg8KB3VzZXJfaWQYASABKAkSDAoEbmFtZRgCIAEoCRIRCglsYXN0X25hbWUYAyABKAkiPAoLTGFzdE1lc3NhZ2USFAoMbWVzc2FnZV90eXBlGAEgASgJEhcKD21lc3NhZ2VfY2FwdGlvbhgCIAEoCSLpAQoKQ2hhdERldGFpbBJDCg5jaGFubmVsX2RldGFpbBgBIAEoCzIpLnByb3RvYnVmLm1vZGVsLmNoYXQudjEuQ2hhbm5lbENoYXREZXRhaWxIABI/Cgxncm91cF9kZXRhaWwYAiABKAsyJy5wcm90b2J1Zi5tb2RlbC5jaGF0LnYxLkdyb3VwQ2hhdERldGFpbEgAEkEKDWRpcmVjdF9kZXRhaWwYAyABKAsyKC5wcm90b2J1Zi5tb2RlbC5jaGF0LnYxLkRpcmVjdENoYXREZXRhaWxIAEISChBjaGF0X2RldGFpbF90eXBlIpABChFDaGFubmVsQ2hhdERldGFpbBINCgV0aXRsZRgBIAEoCRIPCgdtZW1iZXJzGAIgAygJEg4KBmFkbWlucxgDIAMoCRINCgVvd25lchgEIAEoCRIVCg1yZW1vdmVkX3VzZXJzGAUgAygJEhAKCHVzZXJuYW1lGAYgASgJEhMKC2Rlc2NyaXB0aW9uGAcgASgJIo4BCg9Hcm91cENoYXREZXRhaWwSDQoFdGl0bGUYASABKAkSDwoHbWVtYmVycxgCIAMoCRIOCgZhZG1pbnMYAyADKAkSDQoFb3duZXIYBCABKAkSFQoNcmVtb3ZlZF91c2VycxgFIAMoCRIQCgh1c2VybmFtZRgGIAEoCRITCgtkZXNjcmlwdGlvbhgHIAEoCSJDChBEaXJlY3RDaGF0RGV0YWlsEi8KCXVzZXJfaW5mbxgBIAEoCzIcLnByb3RvYnVmLm1vZGVsLnVzZXIudjEuVXNlciLAAQoEQ2hhdBIPCgdjaGF0X2lkGAEgASgJEjMKCWNoYXRfdHlwZRgCIAEoDjIgLnByb3RvYnVmLm1vZGVsLmNoYXQudjEuQ2hhdFR5cGUSNwoLY2hhdF9kZXRhaWwYAyABKAsyIi5wcm90b2J1Zi5tb2RlbC5jaGF0LnYxLkNoYXREZXRhaWwSOQoMbGFzdF9tZXNzYWdlGAQgASgLMiMucHJvdG9idWYubW9kZWwuY2hhdC52MS5MYXN0TWVzc2FnZSpnCghDaGF0VHlwZRIZChVDSEFUX1RZUEVfVU5TUEVDSUZJRUQQABIVChFDSEFUX1RZUEVfQ0hBTk5FTBABEhMKD0NIQVRfVFlQRV9HUk9VUBACEhQKEENIQVRfVFlQRV9ESVJFQ1QQA0LvAQoaY29tLnByb3RvYnVmLm1vZGVsLmNoYXQudjFCCUNoYXRQcm90b1ABWktnaXRodWIuY29tL2thdmthY28vS2F2a2EtQ29yZS9wcm90b2J1Zi9nZW4vZ28vcHJvdG9idWYvbW9kZWwvY2hhdC92MTtjaGF0djGiAgNQTUOqAhZQcm90b2J1Zi5Nb2RlbC5DaGF0LlYxygIWUHJvdG9idWZcTW9kZWxcQ2hhdFxWMeICIlByb3RvYnVmXE1vZGVsXENoYXRcVjFcR1BCTWV0YWRhdGHqAhlQcm90b2J1Zjo6TW9kZWw6OkNoYXQ6OlYxYgZwcm90bzM", [file_protobuf_model_user_v1_user]); /** * @generated from message protobuf.model.chat.v1.Member */ -export class Member extends Message { +export type Member = Message<"protobuf.model.chat.v1.Member"> & { /** * @generated from field: string user_id = 1; */ - userId = ""; + userId: string; /** * @generated from field: string name = 2; */ - name = ""; + name: string; /** * @generated from field: string last_name = 3; */ - lastName = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.Member"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "last_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Member { - return new Member().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Member { - return new Member().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Member { - return new Member().fromJsonString(jsonString, options); - } - - static equals(a: Member | PlainMessage | undefined, b: Member | PlainMessage | undefined): boolean { - return proto3.util.equals(Member, a, b); - } -} + lastName: string; +}; + +/** + * Describes the message protobuf.model.chat.v1.Member. + * Use `create(MemberSchema)` to create a new message. + */ +export const MemberSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 0); /** * @generated from message protobuf.model.chat.v1.LastMessage */ -export class LastMessage extends Message { +export type LastMessage = Message<"protobuf.model.chat.v1.LastMessage"> & { /** * @generated from field: string message_type = 1; */ - messageType = ""; + messageType: string; /** * @generated from field: string message_caption = 2; */ - messageCaption = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.LastMessage"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "message_caption", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LastMessage { - return new LastMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LastMessage { - return new LastMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LastMessage { - return new LastMessage().fromJsonString(jsonString, options); - } - - static equals(a: LastMessage | PlainMessage | undefined, b: LastMessage | PlainMessage | undefined): boolean { - return proto3.util.equals(LastMessage, a, b); - } -} + messageCaption: string; +}; + +/** + * Describes the message protobuf.model.chat.v1.LastMessage. + * Use `create(LastMessageSchema)` to create a new message. + */ +export const LastMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 1); /** * @generated from message protobuf.model.chat.v1.ChatDetail */ -export class ChatDetail extends Message { +export type ChatDetail = Message<"protobuf.model.chat.v1.ChatDetail"> & { /** * @generated from oneof protobuf.model.chat.v1.ChatDetail.chat_detail_type */ @@ -156,234 +88,140 @@ export class ChatDetail extends Message { */ value: DirectChatDetail; case: "directDetail"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.ChatDetail"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "channel_detail", kind: "message", T: ChannelChatDetail, oneof: "chat_detail_type" }, - { no: 2, name: "group_detail", kind: "message", T: GroupChatDetail, oneof: "chat_detail_type" }, - { no: 3, name: "direct_detail", kind: "message", T: DirectChatDetail, oneof: "chat_detail_type" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChatDetail { - return new ChatDetail().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChatDetail { - return new ChatDetail().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChatDetail { - return new ChatDetail().fromJsonString(jsonString, options); - } - - static equals(a: ChatDetail | PlainMessage | undefined, b: ChatDetail | PlainMessage | undefined): boolean { - return proto3.util.equals(ChatDetail, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message protobuf.model.chat.v1.ChatDetail. + * Use `create(ChatDetailSchema)` to create a new message. + */ +export const ChatDetailSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 2); /** * @generated from message protobuf.model.chat.v1.ChannelChatDetail */ -export class ChannelChatDetail extends Message { +export type ChannelChatDetail = Message<"protobuf.model.chat.v1.ChannelChatDetail"> & { /** * @generated from field: string title = 1; */ - title = ""; + title: string; /** * @generated from field: repeated string members = 2; */ - members: string[] = []; + members: string[]; /** * @generated from field: repeated string admins = 3; */ - admins: string[] = []; + admins: string[]; /** * @generated from field: string owner = 4; */ - owner = ""; + owner: string; /** * @generated from field: repeated string removed_users = 5; */ - removedUsers: string[] = []; + removedUsers: string[]; /** * @generated from field: string username = 6; */ - username = ""; + username: string; /** * @generated from field: string description = 7; */ - description = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.ChannelChatDetail"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "members", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 3, name: "admins", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 4, name: "owner", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "removed_users", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 6, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ChannelChatDetail { - return new ChannelChatDetail().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ChannelChatDetail { - return new ChannelChatDetail().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ChannelChatDetail { - return new ChannelChatDetail().fromJsonString(jsonString, options); - } - - static equals(a: ChannelChatDetail | PlainMessage | undefined, b: ChannelChatDetail | PlainMessage | undefined): boolean { - return proto3.util.equals(ChannelChatDetail, a, b); - } -} + description: string; +}; + +/** + * Describes the message protobuf.model.chat.v1.ChannelChatDetail. + * Use `create(ChannelChatDetailSchema)` to create a new message. + */ +export const ChannelChatDetailSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 3); /** * @generated from message protobuf.model.chat.v1.GroupChatDetail */ -export class GroupChatDetail extends Message { +export type GroupChatDetail = Message<"protobuf.model.chat.v1.GroupChatDetail"> & { /** * @generated from field: string title = 1; */ - title = ""; + title: string; /** * @generated from field: repeated string members = 2; */ - members: string[] = []; + members: string[]; /** * @generated from field: repeated string admins = 3; */ - admins: string[] = []; + admins: string[]; /** * @generated from field: string owner = 4; */ - owner = ""; + owner: string; /** * @generated from field: repeated string removed_users = 5; */ - removedUsers: string[] = []; + removedUsers: string[]; /** * @generated from field: string username = 6; */ - username = ""; + username: string; /** * @generated from field: string description = 7; */ - description = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.GroupChatDetail"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "members", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 3, name: "admins", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 4, name: "owner", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "removed_users", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 6, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GroupChatDetail { - return new GroupChatDetail().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GroupChatDetail { - return new GroupChatDetail().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GroupChatDetail { - return new GroupChatDetail().fromJsonString(jsonString, options); - } - - static equals(a: GroupChatDetail | PlainMessage | undefined, b: GroupChatDetail | PlainMessage | undefined): boolean { - return proto3.util.equals(GroupChatDetail, a, b); - } -} + description: string; +}; + +/** + * Describes the message protobuf.model.chat.v1.GroupChatDetail. + * Use `create(GroupChatDetailSchema)` to create a new message. + */ +export const GroupChatDetailSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 4); /** * @generated from message protobuf.model.chat.v1.DirectChatDetail */ -export class DirectChatDetail extends Message { +export type DirectChatDetail = Message<"protobuf.model.chat.v1.DirectChatDetail"> & { /** * @generated from field: protobuf.model.user.v1.User user_info = 1; */ userInfo?: User; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.DirectChatDetail"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user_info", kind: "message", T: User }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DirectChatDetail { - return new DirectChatDetail().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DirectChatDetail { - return new DirectChatDetail().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DirectChatDetail { - return new DirectChatDetail().fromJsonString(jsonString, options); - } - - static equals(a: DirectChatDetail | PlainMessage | undefined, b: DirectChatDetail | PlainMessage | undefined): boolean { - return proto3.util.equals(DirectChatDetail, a, b); - } -} +/** + * Describes the message protobuf.model.chat.v1.DirectChatDetail. + * Use `create(DirectChatDetailSchema)` to create a new message. + */ +export const DirectChatDetailSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 5); /** * @generated from message protobuf.model.chat.v1.Chat */ -export class Chat extends Message { +export type Chat = Message<"protobuf.model.chat.v1.Chat"> & { /** * @generated from field: string chat_id = 1; */ - chatId = ""; + chatId: string; /** * @generated from field: protobuf.model.chat.v1.ChatType chat_type = 2; */ - chatType = ChatType.UNSPECIFIED; + chatType: ChatType; /** * @generated from field: protobuf.model.chat.v1.ChatDetail chat_detail = 3; @@ -394,35 +232,43 @@ export class Chat extends Message { * @generated from field: protobuf.model.chat.v1.LastMessage last_message = 4; */ lastMessage?: LastMessage; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.chat.v1.Chat"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chat_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "chat_type", kind: "enum", T: proto3.getEnumType(ChatType) }, - { no: 3, name: "chat_detail", kind: "message", T: ChatDetail }, - { no: 4, name: "last_message", kind: "message", T: LastMessage }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Chat { - return new Chat().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Chat { - return new Chat().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Chat { - return new Chat().fromJsonString(jsonString, options); - } - - static equals(a: Chat | PlainMessage | undefined, b: Chat | PlainMessage | undefined): boolean { - return proto3.util.equals(Chat, a, b); - } +/** + * Describes the message protobuf.model.chat.v1.Chat. + * Use `create(ChatSchema)` to create a new message. + */ +export const ChatSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_chat_v1_chat, 6); + +/** + * @generated from enum protobuf.model.chat.v1.ChatType + */ +export enum ChatType { + /** + * @generated from enum value: CHAT_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CHAT_TYPE_CHANNEL = 1; + */ + CHANNEL = 1, + + /** + * @generated from enum value: CHAT_TYPE_GROUP = 2; + */ + GROUP = 2, + + /** + * @generated from enum value: CHAT_TYPE_DIRECT = 3; + */ + DIRECT = 3, } +/** + * Describes the enum protobuf.model.chat.v1.ChatType. + */ +export const ChatTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_protobuf_model_chat_v1_chat, 0); + diff --git a/protobuf/gen/es/protobuf/model/message/v1/message_pb.ts b/protobuf/gen/es/protobuf/model/message/v1/message_pb.ts index 7f1f6f9..f80a02b 100644 --- a/protobuf/gen/es/protobuf/model/message/v1/message_pb.ts +++ b/protobuf/gen/es/protobuf/model/message/v1/message_pb.ts @@ -1,74 +1,57 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/model/message/v1/message.proto (package protobuf.model.message.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message as Message$1, proto3, protoInt64 } from "@bufbuild/protobuf"; +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message as Message$1 } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/model/message/v1/message.proto. + */ +export const file_protobuf_model_message_v1_message: GenFile = /*@__PURE__*/ + fileDesc("Cidwcm90b2J1Zi9tb2RlbC9tZXNzYWdlL3YxL21lc3NhZ2UucHJvdG8SGXByb3RvYnVmLm1vZGVsLm1lc3NhZ2UudjEiUwoNTWVzc2FnZVNlbmRlchIPCgd1c2VyX2lkGAEgASgJEgwKBG5hbWUYAiABKAkSEQoJbGFzdF9uYW1lGAMgASgJEhAKCHVzZXJuYW1lGAQgASgJIqQCCgdNZXNzYWdlEhIKCm1lc3NhZ2VfaWQYASABKAkSOAoGc2VuZGVyGAIgASgLMigucHJvdG9idWYubW9kZWwubWVzc2FnZS52MS5NZXNzYWdlU2VuZGVyEhIKCmNyZWF0ZWRfYXQYAyABKAMSDgoGZWRpdGVkGAQgASgIEgwKBHNlZW4YBSABKAgSDAoEdHlwZRgGIAEoCRI+Cgx0ZXh0X21lc3NhZ2UYByABKAsyJi5wcm90b2J1Zi5tb2RlbC5tZXNzYWdlLnYxLlRleHRNZXNzYWdlSAASQAoNbGFiZWxfbWVzc2FnZRgIIAEoCzInLnByb3RvYnVmLm1vZGVsLm1lc3NhZ2UudjEuTGFiZWxNZXNzYWdlSABCCQoHcGF5bG9hZCIbCgtUZXh0TWVzc2FnZRIMCgR0ZXh0GAEgASgJIhwKDExhYmVsTWVzc2FnZRIMCgR0ZXh0GAEgASgJQocCCh1jb20ucHJvdG9idWYubW9kZWwubWVzc2FnZS52MUIMTWVzc2FnZVByb3RvUAFaUWdpdGh1Yi5jb20va2F2a2Fjby9LYXZrYS1Db3JlL3Byb3RvYnVmL2dlbi9nby9wcm90b2J1Zi9tb2RlbC9tZXNzYWdlL3YxO21lc3NhZ2V2MaICA1BNTaoCGVByb3RvYnVmLk1vZGVsLk1lc3NhZ2UuVjHKAhlQcm90b2J1ZlxNb2RlbFxNZXNzYWdlXFYx4gIlUHJvdG9idWZcTW9kZWxcTWVzc2FnZVxWMVxHUEJNZXRhZGF0YeoCHFByb3RvYnVmOjpNb2RlbDo6TWVzc2FnZTo6VjFiBnByb3RvMw"); /** * @generated from message protobuf.model.message.v1.MessageSender */ -export class MessageSender extends Message$1 { +export type MessageSender = Message$1<"protobuf.model.message.v1.MessageSender"> & { /** * @generated from field: string user_id = 1; */ - userId = ""; + userId: string; /** * @generated from field: string name = 2; */ - name = ""; + name: string; /** * @generated from field: string last_name = 3; */ - lastName = ""; + lastName: string; /** * @generated from field: string username = 4; */ - username = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.message.v1.MessageSender"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "last_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): MessageSender { - return new MessageSender().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): MessageSender { - return new MessageSender().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): MessageSender { - return new MessageSender().fromJsonString(jsonString, options); - } - - static equals(a: MessageSender | PlainMessage | undefined, b: MessageSender | PlainMessage | undefined): boolean { - return proto3.util.equals(MessageSender, a, b); - } -} + username: string; +}; + +/** + * Describes the message protobuf.model.message.v1.MessageSender. + * Use `create(MessageSenderSchema)` to create a new message. + */ +export const MessageSenderSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_message_v1_message, 0); /** * @generated from message protobuf.model.message.v1.Message */ -export class Message extends Message$1 { +export type Message = Message$1<"protobuf.model.message.v1.Message"> & { /** * @generated from field: string message_id = 1; */ - messageId = ""; + messageId: string; /** * @generated from field: protobuf.model.message.v1.MessageSender sender = 2; @@ -78,22 +61,22 @@ export class Message extends Message$1 { /** * @generated from field: int64 created_at = 3; */ - createdAt = protoInt64.zero; + createdAt: bigint; /** * @generated from field: bool edited = 4; */ - edited = false; + edited: boolean; /** * @generated from field: bool seen = 5; */ - seen = false; + seen: boolean; /** * @generated from field: string type = 6; */ - type = ""; + type: string; /** * @generated from oneof protobuf.model.message.v1.Message.payload @@ -110,114 +93,47 @@ export class Message extends Message$1 { */ value: LabelMessage; case: "labelMessage"; - } | { case: undefined; value?: undefined } = { case: undefined }; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.message.v1.Message"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "message_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "sender", kind: "message", T: MessageSender }, - { no: 3, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 4, name: "edited", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 5, name: "seen", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "text_message", kind: "message", T: TextMessage, oneof: "payload" }, - { no: 8, name: "label_message", kind: "message", T: LabelMessage, oneof: "payload" }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Message { - return new Message().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Message { - return new Message().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Message { - return new Message().fromJsonString(jsonString, options); - } - - static equals(a: Message | PlainMessage | undefined, b: Message | PlainMessage | undefined): boolean { - return proto3.util.equals(Message, a, b); - } -} + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message protobuf.model.message.v1.Message. + * Use `create(MessageSchema)` to create a new message. + */ +export const MessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_message_v1_message, 1); /** * @generated from message protobuf.model.message.v1.TextMessage */ -export class TextMessage extends Message$1 { +export type TextMessage = Message$1<"protobuf.model.message.v1.TextMessage"> & { /** * @generated from field: string text = 1; */ - text = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } + text: string; +}; - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.message.v1.TextMessage"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): TextMessage { - return new TextMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): TextMessage { - return new TextMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): TextMessage { - return new TextMessage().fromJsonString(jsonString, options); - } - - static equals(a: TextMessage | PlainMessage | undefined, b: TextMessage | PlainMessage | undefined): boolean { - return proto3.util.equals(TextMessage, a, b); - } -} +/** + * Describes the message protobuf.model.message.v1.TextMessage. + * Use `create(TextMessageSchema)` to create a new message. + */ +export const TextMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_message_v1_message, 2); /** * @generated from message protobuf.model.message.v1.LabelMessage */ -export class LabelMessage extends Message$1 { +export type LabelMessage = Message$1<"protobuf.model.message.v1.LabelMessage"> & { /** * @generated from field: string text = 1; */ - text = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.message.v1.LabelMessage"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LabelMessage { - return new LabelMessage().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LabelMessage { - return new LabelMessage().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LabelMessage { - return new LabelMessage().fromJsonString(jsonString, options); - } - - static equals(a: LabelMessage | PlainMessage | undefined, b: LabelMessage | PlainMessage | undefined): boolean { - return proto3.util.equals(LabelMessage, a, b); - } -} + text: string; +}; + +/** + * Describes the message protobuf.model.message.v1.LabelMessage. + * Use `create(LabelMessageSchema)` to create a new message. + */ +export const LabelMessageSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_message_v1_message, 3); diff --git a/protobuf/gen/es/protobuf/model/user/v1/user_pb.ts b/protobuf/gen/es/protobuf/model/user/v1/user_pb.ts index b690214..1a28b46 100644 --- a/protobuf/gen/es/protobuf/model/user/v1/user_pb.ts +++ b/protobuf/gen/es/protobuf/model/user/v1/user_pb.ts @@ -1,75 +1,56 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/model/user/v1/user.proto (package protobuf.model.user.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/model/user/v1/user.proto. + */ +export const file_protobuf_model_user_v1_user: GenFile = /*@__PURE__*/ + fileDesc("CiFwcm90b2J1Zi9tb2RlbC91c2VyL3YxL3VzZXIucHJvdG8SFnByb3RvYnVmLm1vZGVsLnVzZXIudjEibAoEVXNlchIPCgd1c2VyX2lkGAEgASgJEg0KBWVtYWlsGAIgASgJEhAKCHVzZXJuYW1lGAMgASgJEgwKBG5hbWUYBCABKAkSEQoJbGFzdF9uYW1lGAUgASgJEhEKCWJpb2dyYXBoeRgGIAEoCULvAQoaY29tLnByb3RvYnVmLm1vZGVsLnVzZXIudjFCCVVzZXJQcm90b1ABWktnaXRodWIuY29tL2thdmthY28vS2F2a2EtQ29yZS9wcm90b2J1Zi9nZW4vZ28vcHJvdG9idWYvbW9kZWwvdXNlci92MTt1c2VydjGiAgNQTVWqAhZQcm90b2J1Zi5Nb2RlbC5Vc2VyLlYxygIWUHJvdG9idWZcTW9kZWxcVXNlclxWMeICIlByb3RvYnVmXE1vZGVsXFVzZXJcVjFcR1BCTWV0YWRhdGHqAhlQcm90b2J1Zjo6TW9kZWw6OlVzZXI6OlYxYgZwcm90bzM"); /** * @generated from message protobuf.model.user.v1.User */ -export class User extends Message { +export type User = Message<"protobuf.model.user.v1.User"> & { /** * @generated from field: string user_id = 1; */ - userId = ""; + userId: string; /** * @generated from field: string email = 2; */ - email = ""; + email: string; /** * @generated from field: string username = 3; */ - username = ""; + username: string; /** * @generated from field: string name = 4; */ - name = ""; + name: string; /** * @generated from field: string last_name = 5; */ - lastName = ""; + lastName: string; /** * @generated from field: string biography = 6; */ - biography = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.model.user.v1.User"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "last_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "biography", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); + biography: string; +}; - static fromBinary(bytes: Uint8Array, options?: Partial): User { - return new User().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): User { - return new User().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): User { - return new User().fromJsonString(jsonString, options); - } - - static equals(a: User | PlainMessage | undefined, b: User | PlainMessage | undefined): boolean { - return proto3.util.equals(User, a, b); - } -} +/** + * Describes the message protobuf.model.user.v1.User. + * Use `create(UserSchema)` to create a new message. + */ +export const UserSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_model_user_v1_user, 0); diff --git a/protobuf/gen/es/protobuf/search/v1/search_pb.ts b/protobuf/gen/es/protobuf/search/v1/search_pb.ts index 51bb795..27ded82 100644 --- a/protobuf/gen/es/protobuf/search/v1/search_pb.ts +++ b/protobuf/gen/es/protobuf/search/v1/search_pb.ts @@ -1,127 +1,89 @@ -// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=.ts" +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" // @generated from file protobuf/search/v1/search.proto (package protobuf.search.v1, syntax proto3) /* eslint-disable */ -// @ts-nocheck -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { Chat } from "../../model/chat/v1/chat_pb.ts"; -import { User } from "../../model/user/v1/user_pb.ts"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Chat } from "../../model/chat/v1/chat_pb.ts"; +import { file_protobuf_model_chat_v1_chat } from "../../model/chat/v1/chat_pb.ts"; +import type { User } from "../../model/user/v1/user_pb.ts"; +import { file_protobuf_model_user_v1_user } from "../../model/user/v1/user_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/search/v1/search.proto. + */ +export const file_protobuf_search_v1_search: GenFile = /*@__PURE__*/ + fileDesc("Ch9wcm90b2J1Zi9zZWFyY2gvdjEvc2VhcmNoLnByb3RvEhJwcm90b2J1Zi5zZWFyY2gudjEiHgoNU2VhcmNoUmVxdWVzdBINCgVpbnB1dBgBIAEoCSK7AQoOU2VhcmNoUmVzcG9uc2USPwoGcmVzdWx0GAEgASgLMi8ucHJvdG9idWYuc2VhcmNoLnYxLlNlYXJjaFJlc3BvbnNlLlNlYXJjaFJlc3VsdBpoCgxTZWFyY2hSZXN1bHQSKwoFY2hhdHMYASADKAsyHC5wcm90b2J1Zi5tb2RlbC5jaGF0LnYxLkNoYXQSKwoFdXNlcnMYAiADKAsyHC5wcm90b2J1Zi5tb2RlbC51c2VyLnYxLlVzZXIyYgoNU2VhcmNoU2VydmljZRJRCgZTZWFyY2gSIS5wcm90b2J1Zi5zZWFyY2gudjEuU2VhcmNoUmVxdWVzdBoiLnByb3RvYnVmLnNlYXJjaC52MS5TZWFyY2hSZXNwb25zZSIAQtoBChZjb20ucHJvdG9idWYuc2VhcmNoLnYxQgtTZWFyY2hQcm90b1ABWklnaXRodWIuY29tL2thdmthY28vS2F2a2EtQ29yZS9wcm90b2J1Zi9nZW4vZ28vcHJvdG9idWYvc2VhcmNoL3YxO3NlYXJjaHYxogIDUFNYqgISUHJvdG9idWYuU2VhcmNoLlYxygISUHJvdG9idWZcU2VhcmNoXFYx4gIeUHJvdG9idWZcU2VhcmNoXFYxXEdQQk1ldGFkYXRh6gIUUHJvdG9idWY6OlNlYXJjaDo6VjFiBnByb3RvMw", [file_protobuf_model_chat_v1_chat, file_protobuf_model_user_v1_user]); /** * @generated from message protobuf.search.v1.SearchRequest */ -export class SearchRequest extends Message { +export type SearchRequest = Message<"protobuf.search.v1.SearchRequest"> & { /** * @generated from field: string input = 1; */ - input = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.search.v1.SearchRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "input", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SearchRequest { - return new SearchRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SearchRequest { - return new SearchRequest().fromJson(jsonValue, options); - } + input: string; +}; - static fromJsonString(jsonString: string, options?: Partial): SearchRequest { - return new SearchRequest().fromJsonString(jsonString, options); - } - - static equals(a: SearchRequest | PlainMessage | undefined, b: SearchRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SearchRequest, a, b); - } -} +/** + * Describes the message protobuf.search.v1.SearchRequest. + * Use `create(SearchRequestSchema)` to create a new message. + */ +export const SearchRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_search_v1_search, 0); /** * @generated from message protobuf.search.v1.SearchResponse */ -export class SearchResponse extends Message { +export type SearchResponse = Message<"protobuf.search.v1.SearchResponse"> & { /** * @generated from field: protobuf.search.v1.SearchResponse.SearchResult result = 1; */ result?: SearchResponse_SearchResult; +}; - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.search.v1.SearchResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "result", kind: "message", T: SearchResponse_SearchResult }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SearchResponse { - return new SearchResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SearchResponse { - return new SearchResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SearchResponse { - return new SearchResponse().fromJsonString(jsonString, options); - } - - static equals(a: SearchResponse | PlainMessage | undefined, b: SearchResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SearchResponse, a, b); - } -} +/** + * Describes the message protobuf.search.v1.SearchResponse. + * Use `create(SearchResponseSchema)` to create a new message. + */ +export const SearchResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_search_v1_search, 1); /** * @generated from message protobuf.search.v1.SearchResponse.SearchResult */ -export class SearchResponse_SearchResult extends Message { +export type SearchResponse_SearchResult = Message<"protobuf.search.v1.SearchResponse.SearchResult"> & { /** * @generated from field: repeated protobuf.model.chat.v1.Chat chats = 1; */ - chats: Chat[] = []; + chats: Chat[]; /** * @generated from field: repeated protobuf.model.user.v1.User users = 2; */ - users: User[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "protobuf.search.v1.SearchResponse.SearchResult"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "chats", kind: "message", T: Chat, repeated: true }, - { no: 2, name: "users", kind: "message", T: User, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SearchResponse_SearchResult { - return new SearchResponse_SearchResult().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SearchResponse_SearchResult { - return new SearchResponse_SearchResult().fromJson(jsonValue, options); - } + users: User[]; +}; - static fromJsonString(jsonString: string, options?: Partial): SearchResponse_SearchResult { - return new SearchResponse_SearchResult().fromJsonString(jsonString, options); - } +/** + * Describes the message protobuf.search.v1.SearchResponse.SearchResult. + * Use `create(SearchResponse_SearchResultSchema)` to create a new message. + */ +export const SearchResponse_SearchResultSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_search_v1_search, 1, 0); - static equals(a: SearchResponse_SearchResult | PlainMessage | undefined, b: SearchResponse_SearchResult | PlainMessage | undefined): boolean { - return proto3.util.equals(SearchResponse_SearchResult, a, b); - } -} +/** + * @generated from service protobuf.search.v1.SearchService + */ +export const SearchService: GenService<{ + /** + * @generated from rpc protobuf.search.v1.SearchService.Search + */ + search: { + methodKind: "unary"; + input: typeof SearchRequestSchema; + output: typeof SearchResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_protobuf_search_v1_search, 0); diff --git a/protobuf/gen/es/protobuf/user/v1/user_connect.ts b/protobuf/gen/es/protobuf/user/v1/user_connect.ts new file mode 100644 index 0000000..1feba0c --- /dev/null +++ b/protobuf/gen/es/protobuf/user/v1/user_connect.ts @@ -0,0 +1,26 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts,import_extension=.ts" +// @generated from file protobuf/user/v1/user.proto (package protobuf.user.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { UploadProfileRequest, UploadProfileResponse } from "./user_pb.ts"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service protobuf.user.v1.UserService + */ +export const UserService = { + typeName: "protobuf.user.v1.UserService", + methods: { + /** + * @generated from rpc protobuf.user.v1.UserService.UploadProfile + */ + uploadProfile: { + name: "UploadProfile", + I: UploadProfileRequest, + O: UploadProfileResponse, + kind: MethodKind.ClientStreaming, + }, + } +} as const; + diff --git a/protobuf/gen/es/protobuf/user/v1/user_pb.ts b/protobuf/gen/es/protobuf/user/v1/user_pb.ts new file mode 100644 index 0000000..4c476a8 --- /dev/null +++ b/protobuf/gen/es/protobuf/user/v1/user_pb.ts @@ -0,0 +1,59 @@ +// @generated by protoc-gen-es v2.0.0 with parameter "target=ts,import_extension=.ts" +// @generated from file protobuf/user/v1/user.proto (package protobuf.user.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file protobuf/user/v1/user.proto. + */ +export const file_protobuf_user_v1_user: GenFile = /*@__PURE__*/ + fileDesc("Chtwcm90b2J1Zi91c2VyL3YxL3VzZXIucHJvdG8SEHByb3RvYnVmLnVzZXIudjEiJQoUVXBsb2FkUHJvZmlsZVJlcXVlc3QSDQoFYnl0ZXMYASABKAwiFwoVVXBsb2FkUHJvZmlsZVJlc3BvbnNlMnMKC1VzZXJTZXJ2aWNlEmQKDVVwbG9hZFByb2ZpbGUSJi5wcm90b2J1Zi51c2VyLnYxLlVwbG9hZFByb2ZpbGVSZXF1ZXN0GicucHJvdG9idWYudXNlci52MS5VcGxvYWRQcm9maWxlUmVzcG9uc2UiACgBQsoBChRjb20ucHJvdG9idWYudXNlci52MUIJVXNlclByb3RvUAFaRWdpdGh1Yi5jb20va2F2a2Fjby9LYXZrYS1Db3JlL3Byb3RvYnVmL2dlbi9nby9wcm90b2J1Zi91c2VyL3YxO3VzZXJ2MaICA1BVWKoCEFByb3RvYnVmLlVzZXIuVjHKAhBQcm90b2J1ZlxVc2VyXFYx4gIcUHJvdG9idWZcVXNlclxWMVxHUEJNZXRhZGF0YeoCElByb3RvYnVmOjpVc2VyOjpWMWIGcHJvdG8z"); + +/** + * @generated from message protobuf.user.v1.UploadProfileRequest + */ +export type UploadProfileRequest = Message<"protobuf.user.v1.UploadProfileRequest"> & { + /** + * @generated from field: bytes bytes = 1; + */ + bytes: Uint8Array; +}; + +/** + * Describes the message protobuf.user.v1.UploadProfileRequest. + * Use `create(UploadProfileRequestSchema)` to create a new message. + */ +export const UploadProfileRequestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_user_v1_user, 0); + +/** + * @generated from message protobuf.user.v1.UploadProfileResponse + */ +export type UploadProfileResponse = Message<"protobuf.user.v1.UploadProfileResponse"> & { +}; + +/** + * Describes the message protobuf.user.v1.UploadProfileResponse. + * Use `create(UploadProfileResponseSchema)` to create a new message. + */ +export const UploadProfileResponseSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_protobuf_user_v1_user, 1); + +/** + * @generated from service protobuf.user.v1.UserService + */ +export const UserService: GenService<{ + /** + * @generated from rpc protobuf.user.v1.UserService.UploadProfile + */ + uploadProfile: { + methodKind: "client_streaming"; + input: typeof UploadProfileRequestSchema; + output: typeof UploadProfileResponseSchema; + }, +}> = /*@__PURE__*/ + serviceDesc(file_protobuf_user_v1_user, 0); + diff --git a/protobuf/gen/go/protobuf/user/v1/user.pb.go b/protobuf/gen/go/protobuf/user/v1/user.pb.go new file mode 100644 index 0000000..2d0b768 --- /dev/null +++ b/protobuf/gen/go/protobuf/user/v1/user.pb.go @@ -0,0 +1,217 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: protobuf/user/v1/user.proto + +package userv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UploadProfileRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (x *UploadProfileRequest) Reset() { + *x = UploadProfileRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_user_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadProfileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadProfileRequest) ProtoMessage() {} + +func (x *UploadProfileRequest) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_user_v1_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadProfileRequest.ProtoReflect.Descriptor instead. +func (*UploadProfileRequest) Descriptor() ([]byte, []int) { + return file_protobuf_user_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *UploadProfileRequest) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +type UploadProfileResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UploadProfileResponse) Reset() { + *x = UploadProfileResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_user_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadProfileResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadProfileResponse) ProtoMessage() {} + +func (x *UploadProfileResponse) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_user_v1_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadProfileResponse.ProtoReflect.Descriptor instead. +func (*UploadProfileResponse) Descriptor() ([]byte, []int) { + return file_protobuf_user_v1_user_proto_rawDescGZIP(), []int{1} +} + +var File_protobuf_user_v1_user_proto protoreflect.FileDescriptor + +var file_protobuf_user_v1_user_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, + 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x22, + 0x2c, 0x0a, 0x14, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x17, 0x0a, + 0x15, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x73, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x42, 0xca, 0x01, 0x0a, 0x14, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, + 0x76, 0x6b, 0x61, 0x63, 0x6f, 0x2f, 0x4b, 0x61, 0x76, 0x6b, 0x61, 0x2d, 0x43, 0x6f, 0x72, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, + 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x55, 0x58, 0xaa, 0x02, + 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x10, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x55, 0x73, 0x65, + 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, + 0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, + 0x55, 0x73, 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protobuf_user_v1_user_proto_rawDescOnce sync.Once + file_protobuf_user_v1_user_proto_rawDescData = file_protobuf_user_v1_user_proto_rawDesc +) + +func file_protobuf_user_v1_user_proto_rawDescGZIP() []byte { + file_protobuf_user_v1_user_proto_rawDescOnce.Do(func() { + file_protobuf_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobuf_user_v1_user_proto_rawDescData) + }) + return file_protobuf_user_v1_user_proto_rawDescData +} + +var file_protobuf_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_protobuf_user_v1_user_proto_goTypes = []any{ + (*UploadProfileRequest)(nil), // 0: protobuf.user.v1.UploadProfileRequest + (*UploadProfileResponse)(nil), // 1: protobuf.user.v1.UploadProfileResponse +} +var file_protobuf_user_v1_user_proto_depIdxs = []int32{ + 0, // 0: protobuf.user.v1.UserService.UploadProfile:input_type -> protobuf.user.v1.UploadProfileRequest + 1, // 1: protobuf.user.v1.UserService.UploadProfile:output_type -> protobuf.user.v1.UploadProfileResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_protobuf_user_v1_user_proto_init() } +func file_protobuf_user_v1_user_proto_init() { + if File_protobuf_user_v1_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protobuf_user_v1_user_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*UploadProfileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protobuf_user_v1_user_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*UploadProfileResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protobuf_user_v1_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_protobuf_user_v1_user_proto_goTypes, + DependencyIndexes: file_protobuf_user_v1_user_proto_depIdxs, + MessageInfos: file_protobuf_user_v1_user_proto_msgTypes, + }.Build() + File_protobuf_user_v1_user_proto = out.File + file_protobuf_user_v1_user_proto_rawDesc = nil + file_protobuf_user_v1_user_proto_goTypes = nil + file_protobuf_user_v1_user_proto_depIdxs = nil +} diff --git a/protobuf/gen/go/protobuf/user/v1/userv1connect/user.connect.go b/protobuf/gen/go/protobuf/user/v1/userv1connect/user.connect.go new file mode 100644 index 0000000..e8626d2 --- /dev/null +++ b/protobuf/gen/go/protobuf/user/v1/userv1connect/user.connect.go @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: protobuf/user/v1/user.proto + +package userv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/kavkaco/Kavka-Core/protobuf/gen/go/protobuf/user/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // UserServiceName is the fully-qualified name of the UserService service. + UserServiceName = "protobuf.user.v1.UserService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // UserServiceUploadProfileProcedure is the fully-qualified name of the UserService's UploadProfile + // RPC. + UserServiceUploadProfileProcedure = "/protobuf.user.v1.UserService/UploadProfile" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + userServiceServiceDescriptor = v1.File_protobuf_user_v1_user_proto.Services().ByName("UserService") + userServiceUploadProfileMethodDescriptor = userServiceServiceDescriptor.Methods().ByName("UploadProfile") +) + +// UserServiceClient is a client for the protobuf.user.v1.UserService service. +type UserServiceClient interface { + UploadProfile(context.Context) *connect.ClientStreamForClient[v1.UploadProfileRequest, v1.UploadProfileResponse] +} + +// NewUserServiceClient constructs a client for the protobuf.user.v1.UserService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) UserServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &userServiceClient{ + uploadProfile: connect.NewClient[v1.UploadProfileRequest, v1.UploadProfileResponse]( + httpClient, + baseURL+UserServiceUploadProfileProcedure, + connect.WithSchema(userServiceUploadProfileMethodDescriptor), + connect.WithClientOptions(opts...), + ), + } +} + +// userServiceClient implements UserServiceClient. +type userServiceClient struct { + uploadProfile *connect.Client[v1.UploadProfileRequest, v1.UploadProfileResponse] +} + +// UploadProfile calls protobuf.user.v1.UserService.UploadProfile. +func (c *userServiceClient) UploadProfile(ctx context.Context) *connect.ClientStreamForClient[v1.UploadProfileRequest, v1.UploadProfileResponse] { + return c.uploadProfile.CallClientStream(ctx) +} + +// UserServiceHandler is an implementation of the protobuf.user.v1.UserService service. +type UserServiceHandler interface { + UploadProfile(context.Context, *connect.ClientStream[v1.UploadProfileRequest]) (*connect.Response[v1.UploadProfileResponse], error) +} + +// NewUserServiceHandler builds an HTTP handler from the service implementation. It returns the path +// on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + userServiceUploadProfileHandler := connect.NewClientStreamHandler( + UserServiceUploadProfileProcedure, + svc.UploadProfile, + connect.WithSchema(userServiceUploadProfileMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + return "/protobuf.user.v1.UserService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case UserServiceUploadProfileProcedure: + userServiceUploadProfileHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedUserServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedUserServiceHandler struct{} + +func (UnimplementedUserServiceHandler) UploadProfile(context.Context, *connect.ClientStream[v1.UploadProfileRequest]) (*connect.Response[v1.UploadProfileResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("protobuf.user.v1.UserService.UploadProfile is not implemented")) +} diff --git a/protobuf/user/v1/user.proto b/protobuf/user/v1/user.proto new file mode 100644 index 0000000..f8dba0f --- /dev/null +++ b/protobuf/user/v1/user.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package protobuf.user.v1; + +option go_package = "protobuf/user/v1"; + +service UserService { + rpc UploadProfile(stream UploadProfileRequest)returns(UploadProfileResponse){} +} + +message UploadProfileRequest{ + bytes bytes = 1; +} + +message UploadProfileResponse{} \ No newline at end of file