From e9233dc785ca0b86ffa52eaca336d063fdb98f08 Mon Sep 17 00:00:00 2001 From: Lautaro Bustos Date: Thu, 11 Apr 2024 10:11:25 -0300 Subject: [PATCH] feat: ws and rpc server handlers (#8) * new packages * ws & rpc connections * default expiration * local proto --- .gitignore | 3 +- Makefile | 30 + build-local-proto.sh | 5 + friendships_ea.proto | 158 ++ package.json | 12 +- src/adapters/rpcServer.ts | 80 + src/adapters/ws.ts | 25 + src/components.ts | 15 +- src/controllers/handlers/ws-handler.ts | 79 + src/controllers/routes.ts | 5 +- src/friendships_ea.ts | 2443 ++++++++++++++++++++++++ src/google/protobuf/empty.ts | 73 + src/index.ts | 6 +- src/types.ts | 11 + yarn.lock | 393 +++- 15 files changed, 3317 insertions(+), 21 deletions(-) create mode 100644 Makefile create mode 100755 build-local-proto.sh create mode 100644 friendships_ea.proto create mode 100644 src/adapters/rpcServer.ts create mode 100644 src/adapters/ws.ts create mode 100644 src/controllers/handlers/ws-handler.ts create mode 100644 src/friendships_ea.ts create mode 100644 src/google/protobuf/empty.ts diff --git a/.gitignore b/.gitignore index 86325fb..553ebcb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ dist/ node_modules/ **/.DS_Store coverage -.env \ No newline at end of file +.env +protoc3 \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..df0fa78 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +PROTOBUF_VERSION = 3.19.1 +PROTOC ?= protoc +UNAME := $(shell uname) +PROTO_FILES := $(wildcard src/*.proto) +export PATH := ts-server/node_modules/.bin:/usr/local/include/:protoc3/bin:$(PATH) + +ifeq ($(UNAME),Darwin) +PROTOBUF_ZIP = protoc-$(PROTOBUF_VERSION)-osx-x86_64.zip +else +PROTOBUF_ZIP = protoc-$(PROTOBUF_VERSION)-linux-x86_64.zip +endif + +# for ts +install_compiler: + @# remove local folder + rm -rf protoc3 || true + + @# Make sure you grab the latest version + curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOBUF_VERSION)/$(PROTOBUF_ZIP) + + @# Unzip + unzip $(PROTOBUF_ZIP) -d protoc3 + @# delete the files + rm $(PROTOBUF_ZIP) + + @# move protoc to /usr/local/bin/ + chmod +x protoc3/bin/protoc + +build: install_compiler + @./build-local-proto.sh diff --git a/build-local-proto.sh b/build-local-proto.sh new file mode 100755 index 0000000..c2f2f7a --- /dev/null +++ b/build-local-proto.sh @@ -0,0 +1,5 @@ +./protoc3/bin/protoc \ + --plugin=./node_modules/.bin/protoc-gen-ts_proto \ + --ts_proto_opt=esModuleInterop=true,returnObservable=false,outputServices=generic-definitions \ + --ts_proto_out="$(pwd)/src" -I="$(pwd)" \ + "$(pwd)/friendships_ea.proto" diff --git a/friendships_ea.proto b/friendships_ea.proto new file mode 100644 index 0000000..85f56bc --- /dev/null +++ b/friendships_ea.proto @@ -0,0 +1,158 @@ +// THIS LIVES HERE FOR NOW, BUT IT SHOULD BE MOVED TO @dcl/protcol when release + +syntax = "proto3"; +package decentraland.social.friendships_ea; + +import "google/protobuf/empty.proto"; + + +// This message is a response that is sent from the server to the client +message FriendshipEventResponse { + oneof body { + RequestResponse request = 1; + AcceptResponse accept = 2; + RejectResponse reject = 4; + DeleteResponse delete = 5; + CancelResponse cancel = 6; + } +} + +message FriendshipEventResponses { + repeated FriendshipEventResponse responses = 1; +} + +message FriendshipEventPayload { + oneof body { + RequestPayload request = 1; + AcceptPayload accept = 2; + RejectPayload reject = 4; + DeletePayload delete = 5; + CancelPayload cancel = 6; + } +} + +message User { string address = 1; } + +message Users { repeated User users = 1; } + +message RequestResponse { + User user = 1; + int64 created_at = 2; + optional string message = 3; +} + +message RequestPayload { + User user = 1; + optional string message = 3; +} + +message Requests { + int64 total = 1; // Total amount of friendship requests + repeated RequestResponse items = 2; +} + +message RequestEvents { + Requests outgoing = 1; // Requests the authed user have sent to users + Requests incoming = 2; // Requests the authed user have received from users +} + +message AcceptResponse { User user = 1; } + +message AcceptPayload { User user = 1; } + +message RejectResponse { User user = 1; } + +message RejectPayload { User user = 1; } + +message DeleteResponse { User user = 1; } + +message DeletePayload { User user = 1; } + +message CancelResponse { User user = 1; } + +message CancelPayload { User user = 1; } + +message UpdateFriendshipPayload { + FriendshipEventPayload event = 1; +} + +message MutualFriendsPayload { + User user = 1; +} + +message BadRequestError { + string message = 1; +} +message UnauthorizedError { + string message = 1; +} +message ForbiddenError { + string message = 1; +} +message TooManyRequestsError { + string message = 1; +} +message InternalServerError { + string message = 1; +} + +message UsersResponse { + oneof response { + Users users = 1; + InternalServerError internal_server_error = 2; + UnauthorizedError unauthorized_error = 3; + ForbiddenError forbidden_error = 4; + TooManyRequestsError too_many_requests_error = 5; + BadRequestError bad_request_error = 6; + } +} + +message RequestEventsResponse { + oneof response { + RequestEvents events = 1; + InternalServerError internal_server_error = 2; + UnauthorizedError unauthorized_error = 3; + ForbiddenError forbidden_error = 4; + TooManyRequestsError too_many_requests_error = 5; + } +} + +message UpdateFriendshipResponse { + oneof response { + FriendshipEventResponse event = 1; + InternalServerError internal_server_error = 2; + UnauthorizedError unauthorized_error = 3; + ForbiddenError forbidden_error = 4; + TooManyRequestsError too_many_requests_error = 5; + BadRequestError bad_request_error = 6; + } +} + +message SubscribeFriendshipEventsUpdatesResponse { + oneof response { + FriendshipEventResponses events = 1; + InternalServerError internal_server_error = 2; + UnauthorizedError unauthorized_error = 3; + ForbiddenError forbidden_error = 4; + TooManyRequestsError too_many_requests_error = 5; + } +} + +service FriendshipsService { + // Get the list of friends for the authenticated user + rpc GetFriends(google.protobuf.Empty) returns (stream UsersResponse) {} + + // Get the list of mutual friends between the authenticated user and the one in the parameter + rpc GetMutualFriends(MutualFriendsPayload) returns (stream UsersResponse) {} + + // Get the list of request events for the authenticated user + rpc GetRequestEvents(google.protobuf.Empty) returns (RequestEventsResponse) {} + + // Update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE + rpc UpdateFriendshipEvent(UpdateFriendshipPayload) + returns (UpdateFriendshipResponse) {} + + // Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE + rpc SubscribeFriendshipEventsUpdates(google.protobuf.Empty) + returns (stream SubscribeFriendshipEventsUpdatesResponse) {} +} diff --git a/package.json b/package.json index dfdb081..a8d7491 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "scripts": { "build": "tsc -p tsconfig.json", "start": "node --trace-warnings --abort-on-uncaught-exception --unhandled-rejections=strict dist/index.js", + "dev": "nodemon --watch 'src/**' --ext 'ts,json' --ignore 'src/**/*.spec.ts' --ignore 'src/migrations' --exec 'ts-node src/index.ts'", "test": "jest --forceExit --detectOpenHandles --coverage --verbose", "migrate": "node-pg-migrate --database-url-var PG_COMPONENT_PSQL_CONNECTION_STRING --envPath .env -j ts --tsconfig tsconfig.json -m ./src/migrations", "lint:check": "eslint '**/*.{js,ts}'", @@ -11,8 +12,11 @@ }, "devDependencies": { "@dcl/eslint-config": "^2.0.0", + "@protobuf-ts/protoc": "^2.9.4", "@types/node": "^20.11.28", + "@types/ws": "^8.5.10", "@well-known-components/test-helpers": "^1.5.6", + "nodemon": "^3.1.0", "ts-node": "^10.9.2", "typescript": "^5.4.2" }, @@ -24,12 +28,18 @@ "tabWidth": 2 }, "dependencies": { + "@dcl/platform-crypto-middleware": "^1.0.2", + "@dcl/protocol": "^1.0.0-2569677750.commit-6ce832a", + "@dcl/rpc": "^1.1.2", "@well-known-components/env-config-provider": "^1.2.0", + "@well-known-components/fetch-component": "^2.0.2", "@well-known-components/http-server": "^2.1.0", "@well-known-components/interfaces": "^1.4.3", "@well-known-components/logger": "^3.1.3", "@well-known-components/metrics": "^2.1.0", "@well-known-components/pg-component": "^0.2.2", - "@well-known-components/uws-http-server": "^0.0.1-20240314125425.commit-711dd8f" + "@well-known-components/uws-http-server": "^0.0.1-20240314125425.commit-711dd8f", + "fp-future": "^1.0.1", + "ws": "^8.16.0" } } diff --git a/src/adapters/rpcServer.ts b/src/adapters/rpcServer.ts new file mode 100644 index 0000000..5c441f1 --- /dev/null +++ b/src/adapters/rpcServer.ts @@ -0,0 +1,80 @@ +import { createRpcServer } from '@dcl/rpc' +import { registerService } from '@dcl/rpc/dist/codegen' +import { + FriendshipsServiceDefinition, + UsersResponse, + SubscribeFriendshipEventsUpdatesResponse, + RequestEventsResponse, + UpdateFriendshipResponse +} from '../friendships_ea' +import { AppComponents, RpcServerContext } from '../types' + +export default function createRpcServerComponent(components: Pick) { + const { logs } = components + + const server = createRpcServer({ + logger: logs.getLogger('rpc-server') + }) + + const _logger = logs.getLogger('rpc-server-handler') + // Mocked server until we get the new service definition & db queries done + server.setHandler(async function handler(port) { + registerService(port, FriendshipsServiceDefinition, async () => ({ + getFriends(_request, _context) { + const generator = async function* () { + const response: UsersResponse = { + users: { users: [] } + } + yield response + } + + return generator() + }, + getMutualFriends(_request, _context) { + const generator = async function* () { + const response: UsersResponse = { + users: { users: [] } + } + yield response + } + + return generator() + }, + async getRequestEvents(_request, _context) { + const res: RequestEventsResponse = { + events: { + outgoing: { items: [], total: 0 }, + incoming: { items: [], total: 0 } + } + } + return res + }, + async updateFriendshipEvent(_request, _context) { + const res: UpdateFriendshipResponse = { + event: { + accept: { + user: { + address: '0xa' + } + } + } + } + return res + }, + subscribeFriendshipEventsUpdates(_request, _context) { + const generator = async function* () { + const response: SubscribeFriendshipEventsUpdatesResponse = { + events: { + responses: [] + } + } + yield response + } + + return generator() + } + })) + }) + + return server +} diff --git a/src/adapters/ws.ts b/src/adapters/ws.ts new file mode 100644 index 0000000..da31fe0 --- /dev/null +++ b/src/adapters/ws.ts @@ -0,0 +1,25 @@ +import { WebSocketServer } from 'ws' +import { IWebSocketComponent } from '../types' + +export async function createWsComponent(): Promise { + let wss: WebSocketServer | undefined + + async function start() { + if (wss) return + + wss = new WebSocketServer({ noServer: true }) + } + + async function stop() { + wss?.close() + wss = undefined + } + + await start() + + return { + start, + stop, + ws: wss! + } +} diff --git a/src/components.ts b/src/components.ts index 94ee677..e2ed54e 100644 --- a/src/components.ts +++ b/src/components.ts @@ -11,14 +11,22 @@ import { AppComponents, GlobalContext } from './types' import { metricDeclarations } from './metrics' import { createPgComponent } from '@well-known-components/pg-component' import { createDBComponent } from './adapters/db' +import { createWsComponent } from './adapters/ws' +import createRpcServerComponent from './adapters/rpcServer' +import { createFetchComponent } from '@well-known-components/fetch-component' // Initialize all the components of the app export async function initComponents(): Promise { const config = await createDotEnvConfigComponent({ path: ['.env.default', '.env'] }) const metrics = await createMetricsComponent(metricDeclarations, { config }) const logs = await createLogComponent({ metrics }) - const server = await createServerComponent({ config, logs }, {}) + + const ws = await createWsComponent() + const server = await createServerComponent({ config, logs, ws: ws.ws }, {}) const statusChecks = await createStatusCheckComponent({ server, config }) + const rpcServer = createRpcServerComponent({ logs }) + + const fetcher = createFetchComponent() let databaseUrl: string | undefined = await config.getString('PG_COMPONENT_PSQL_CONNECTION_STRING') if (!databaseUrl) { @@ -54,6 +62,9 @@ export async function initComponents(): Promise { statusChecks, metrics, pg, - db + db, + ws, + rpcServer, + fetcher } } diff --git a/src/controllers/handlers/ws-handler.ts b/src/controllers/handlers/ws-handler.ts new file mode 100644 index 0000000..2ac23d9 --- /dev/null +++ b/src/controllers/handlers/ws-handler.ts @@ -0,0 +1,79 @@ +import { IHttpServerComponent } from '@well-known-components/interfaces' +import { upgradeWebSocketResponse } from '@well-known-components/http-server/dist/ws' +import { WebSocket, MessageEvent } from 'ws' +import { WebSocketTransport } from '@dcl/rpc/dist/transports/WebSocket' +import future from 'fp-future' +import { verify } from '@dcl/platform-crypto-middleware' +import { GlobalContext } from '../../types' + +export async function wsHandler(context: IHttpServerComponent.DefaultContext) { + const { logs, rpcServer, fetcher } = context.components + const logger = logs.getLogger('ws-handler') + + return upgradeWebSocketResponse(async (socket) => { + let isAlive = true + const ws = socket as any as WebSocket + // it's needed bc of cloudflare + const pingInterval = setInterval(() => { + if (isAlive === false) { + logger.warn('terminating ws because of ping timeout') + return ws.terminate() + } + logger.debug('pinging websocket bc of cloudflare') + isAlive = false + ws.ping() + }, 30000) + + ws.on('close', () => { + logger.debug('closing websocket') + clearInterval(pingInterval) + }) + + ws.on('pong', () => { + logger.debug('PONG') + isAlive = true + }) + + const authChainPromise = future() + + function receiveAuthchainAsFirstMessage(event: MessageEvent) { + if (typeof event.data === 'string') { + authChainPromise.resolve(JSON.parse(event.data)) + } else { + authChainPromise.reject(new Error('INVALID_MESSAGE')) + } + } + + ws.addEventListener('message', receiveAuthchainAsFirstMessage) + + try { + const authChain = await Promise.race([sleep30Secs(), authChainPromise]) + ws.removeEventListener('message', receiveAuthchainAsFirstMessage) + + const authchainVerifyResult = await verify('get', '/', authChain, { + fetcher + }) + + const wsTransport = WebSocketTransport(socket) + + logger.debug('addresss > ', { address: authchainVerifyResult.auth }) + + rpcServer.attachTransport(wsTransport, { components: context.components, address: authchainVerifyResult.auth }) + + wsTransport.on('error', (err) => { + if (err && err.message) { + logger.error(err) + } + }) + } catch (error) { + // rejects if timeout, invalid first message or authchain verify error + logger.error(error as Error) + ws.close() + } + }) +} + +const sleep30Secs = () => + new Promise((_resolve, reject) => { + setTimeout(() => reject(new Error('TIMEOUT_WAITING_FOR_AUTCHAIN')), 30000) + }) diff --git a/src/controllers/routes.ts b/src/controllers/routes.ts index e36be14..8f98351 100644 --- a/src/controllers/routes.ts +++ b/src/controllers/routes.ts @@ -1,9 +1,12 @@ import { Router } from '@well-known-components/http-server' +import { wsHandler } from './handlers/ws-handler' import { GlobalContext } from '../types' // We return the entire router because it will be easier to test than a whole server -export async function setupRouter(globalContext: GlobalContext): Promise> { +export async function setupRouter(_globalContext: GlobalContext): Promise> { const router = new Router() + router.get('/', wsHandler) + return router } diff --git a/src/friendships_ea.ts b/src/friendships_ea.ts new file mode 100644 index 0000000..809002b --- /dev/null +++ b/src/friendships_ea.ts @@ -0,0 +1,2443 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Empty } from "./google/protobuf/empty"; + +export const protobufPackage = "decentraland.social.friendships_ea"; + +/** This message is a response that is sent from the server to the client */ +export interface FriendshipEventResponse { + request?: RequestResponse | undefined; + accept?: AcceptResponse | undefined; + reject?: RejectResponse | undefined; + delete?: DeleteResponse | undefined; + cancel?: CancelResponse | undefined; +} + +export interface FriendshipEventResponses { + responses: FriendshipEventResponse[]; +} + +export interface FriendshipEventPayload { + request?: RequestPayload | undefined; + accept?: AcceptPayload | undefined; + reject?: RejectPayload | undefined; + delete?: DeletePayload | undefined; + cancel?: CancelPayload | undefined; +} + +export interface User { + address: string; +} + +export interface Users { + users: User[]; +} + +export interface RequestResponse { + user: User | undefined; + createdAt: number; + message?: string | undefined; +} + +export interface RequestPayload { + user: User | undefined; + message?: string | undefined; +} + +export interface Requests { + /** Total amount of friendship requests */ + total: number; + items: RequestResponse[]; +} + +export interface RequestEvents { + /** Requests the authed user have sent to users */ + outgoing: + | Requests + | undefined; + /** Requests the authed user have received from users */ + incoming: Requests | undefined; +} + +export interface AcceptResponse { + user: User | undefined; +} + +export interface AcceptPayload { + user: User | undefined; +} + +export interface RejectResponse { + user: User | undefined; +} + +export interface RejectPayload { + user: User | undefined; +} + +export interface DeleteResponse { + user: User | undefined; +} + +export interface DeletePayload { + user: User | undefined; +} + +export interface CancelResponse { + user: User | undefined; +} + +export interface CancelPayload { + user: User | undefined; +} + +export interface UpdateFriendshipPayload { + event: FriendshipEventPayload | undefined; +} + +export interface MutualFriendsPayload { + user: User | undefined; +} + +export interface BadRequestError { + message: string; +} + +export interface UnauthorizedError { + message: string; +} + +export interface ForbiddenError { + message: string; +} + +export interface TooManyRequestsError { + message: string; +} + +export interface InternalServerError { + message: string; +} + +export interface UsersResponse { + users?: Users | undefined; + internalServerError?: InternalServerError | undefined; + unauthorizedError?: UnauthorizedError | undefined; + forbiddenError?: ForbiddenError | undefined; + tooManyRequestsError?: TooManyRequestsError | undefined; + badRequestError?: BadRequestError | undefined; +} + +export interface RequestEventsResponse { + events?: RequestEvents | undefined; + internalServerError?: InternalServerError | undefined; + unauthorizedError?: UnauthorizedError | undefined; + forbiddenError?: ForbiddenError | undefined; + tooManyRequestsError?: TooManyRequestsError | undefined; +} + +export interface UpdateFriendshipResponse { + event?: FriendshipEventResponse | undefined; + internalServerError?: InternalServerError | undefined; + unauthorizedError?: UnauthorizedError | undefined; + forbiddenError?: ForbiddenError | undefined; + tooManyRequestsError?: TooManyRequestsError | undefined; + badRequestError?: BadRequestError | undefined; +} + +export interface SubscribeFriendshipEventsUpdatesResponse { + events?: FriendshipEventResponses | undefined; + internalServerError?: InternalServerError | undefined; + unauthorizedError?: UnauthorizedError | undefined; + forbiddenError?: ForbiddenError | undefined; + tooManyRequestsError?: TooManyRequestsError | undefined; +} + +function createBaseFriendshipEventResponse(): FriendshipEventResponse { + return { request: undefined, accept: undefined, reject: undefined, delete: undefined, cancel: undefined }; +} + +export const FriendshipEventResponse = { + encode(message: FriendshipEventResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.request !== undefined) { + RequestResponse.encode(message.request, writer.uint32(10).fork()).ldelim(); + } + if (message.accept !== undefined) { + AcceptResponse.encode(message.accept, writer.uint32(18).fork()).ldelim(); + } + if (message.reject !== undefined) { + RejectResponse.encode(message.reject, writer.uint32(34).fork()).ldelim(); + } + if (message.delete !== undefined) { + DeleteResponse.encode(message.delete, writer.uint32(42).fork()).ldelim(); + } + if (message.cancel !== undefined) { + CancelResponse.encode(message.cancel, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FriendshipEventResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendshipEventResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.request = RequestResponse.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.accept = AcceptResponse.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.reject = RejectResponse.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.delete = DeleteResponse.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.cancel = CancelResponse.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FriendshipEventResponse { + return { + request: isSet(object.request) ? RequestResponse.fromJSON(object.request) : undefined, + accept: isSet(object.accept) ? AcceptResponse.fromJSON(object.accept) : undefined, + reject: isSet(object.reject) ? RejectResponse.fromJSON(object.reject) : undefined, + delete: isSet(object.delete) ? DeleteResponse.fromJSON(object.delete) : undefined, + cancel: isSet(object.cancel) ? CancelResponse.fromJSON(object.cancel) : undefined, + }; + }, + + toJSON(message: FriendshipEventResponse): unknown { + const obj: any = {}; + if (message.request !== undefined) { + obj.request = RequestResponse.toJSON(message.request); + } + if (message.accept !== undefined) { + obj.accept = AcceptResponse.toJSON(message.accept); + } + if (message.reject !== undefined) { + obj.reject = RejectResponse.toJSON(message.reject); + } + if (message.delete !== undefined) { + obj.delete = DeleteResponse.toJSON(message.delete); + } + if (message.cancel !== undefined) { + obj.cancel = CancelResponse.toJSON(message.cancel); + } + return obj; + }, + + create, I>>(base?: I): FriendshipEventResponse { + return FriendshipEventResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FriendshipEventResponse { + const message = createBaseFriendshipEventResponse(); + message.request = (object.request !== undefined && object.request !== null) + ? RequestResponse.fromPartial(object.request) + : undefined; + message.accept = (object.accept !== undefined && object.accept !== null) + ? AcceptResponse.fromPartial(object.accept) + : undefined; + message.reject = (object.reject !== undefined && object.reject !== null) + ? RejectResponse.fromPartial(object.reject) + : undefined; + message.delete = (object.delete !== undefined && object.delete !== null) + ? DeleteResponse.fromPartial(object.delete) + : undefined; + message.cancel = (object.cancel !== undefined && object.cancel !== null) + ? CancelResponse.fromPartial(object.cancel) + : undefined; + return message; + }, +}; + +function createBaseFriendshipEventResponses(): FriendshipEventResponses { + return { responses: [] }; +} + +export const FriendshipEventResponses = { + encode(message: FriendshipEventResponses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.responses) { + FriendshipEventResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FriendshipEventResponses { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendshipEventResponses(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.responses.push(FriendshipEventResponse.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FriendshipEventResponses { + return { + responses: globalThis.Array.isArray(object?.responses) + ? object.responses.map((e: any) => FriendshipEventResponse.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FriendshipEventResponses): unknown { + const obj: any = {}; + if (message.responses?.length) { + obj.responses = message.responses.map((e) => FriendshipEventResponse.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): FriendshipEventResponses { + return FriendshipEventResponses.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FriendshipEventResponses { + const message = createBaseFriendshipEventResponses(); + message.responses = object.responses?.map((e) => FriendshipEventResponse.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFriendshipEventPayload(): FriendshipEventPayload { + return { request: undefined, accept: undefined, reject: undefined, delete: undefined, cancel: undefined }; +} + +export const FriendshipEventPayload = { + encode(message: FriendshipEventPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.request !== undefined) { + RequestPayload.encode(message.request, writer.uint32(10).fork()).ldelim(); + } + if (message.accept !== undefined) { + AcceptPayload.encode(message.accept, writer.uint32(18).fork()).ldelim(); + } + if (message.reject !== undefined) { + RejectPayload.encode(message.reject, writer.uint32(34).fork()).ldelim(); + } + if (message.delete !== undefined) { + DeletePayload.encode(message.delete, writer.uint32(42).fork()).ldelim(); + } + if (message.cancel !== undefined) { + CancelPayload.encode(message.cancel, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FriendshipEventPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendshipEventPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.request = RequestPayload.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.accept = AcceptPayload.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.reject = RejectPayload.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.delete = DeletePayload.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.cancel = CancelPayload.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): FriendshipEventPayload { + return { + request: isSet(object.request) ? RequestPayload.fromJSON(object.request) : undefined, + accept: isSet(object.accept) ? AcceptPayload.fromJSON(object.accept) : undefined, + reject: isSet(object.reject) ? RejectPayload.fromJSON(object.reject) : undefined, + delete: isSet(object.delete) ? DeletePayload.fromJSON(object.delete) : undefined, + cancel: isSet(object.cancel) ? CancelPayload.fromJSON(object.cancel) : undefined, + }; + }, + + toJSON(message: FriendshipEventPayload): unknown { + const obj: any = {}; + if (message.request !== undefined) { + obj.request = RequestPayload.toJSON(message.request); + } + if (message.accept !== undefined) { + obj.accept = AcceptPayload.toJSON(message.accept); + } + if (message.reject !== undefined) { + obj.reject = RejectPayload.toJSON(message.reject); + } + if (message.delete !== undefined) { + obj.delete = DeletePayload.toJSON(message.delete); + } + if (message.cancel !== undefined) { + obj.cancel = CancelPayload.toJSON(message.cancel); + } + return obj; + }, + + create, I>>(base?: I): FriendshipEventPayload { + return FriendshipEventPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): FriendshipEventPayload { + const message = createBaseFriendshipEventPayload(); + message.request = (object.request !== undefined && object.request !== null) + ? RequestPayload.fromPartial(object.request) + : undefined; + message.accept = (object.accept !== undefined && object.accept !== null) + ? AcceptPayload.fromPartial(object.accept) + : undefined; + message.reject = (object.reject !== undefined && object.reject !== null) + ? RejectPayload.fromPartial(object.reject) + : undefined; + message.delete = (object.delete !== undefined && object.delete !== null) + ? DeletePayload.fromPartial(object.delete) + : undefined; + message.cancel = (object.cancel !== undefined && object.cancel !== null) + ? CancelPayload.fromPartial(object.cancel) + : undefined; + return message; + }, +}; + +function createBaseUser(): User { + return { address: "" }; +} + +export const User = { + encode(message: User, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): User { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUser(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.address = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): User { + return { address: isSet(object.address) ? globalThis.String(object.address) : "" }; + }, + + toJSON(message: User): unknown { + const obj: any = {}; + if (message.address !== "") { + obj.address = message.address; + } + return obj; + }, + + create, I>>(base?: I): User { + return User.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): User { + const message = createBaseUser(); + message.address = object.address ?? ""; + return message; + }, +}; + +function createBaseUsers(): Users { + return { users: [] }; +} + +export const Users = { + encode(message: Users, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.users) { + User.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Users { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUsers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.users.push(User.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Users { + return { users: globalThis.Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [] }; + }, + + toJSON(message: Users): unknown { + const obj: any = {}; + if (message.users?.length) { + obj.users = message.users.map((e) => User.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Users { + return Users.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Users { + const message = createBaseUsers(); + message.users = object.users?.map((e) => User.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseRequestResponse(): RequestResponse { + return { user: undefined, createdAt: 0, message: undefined }; +} + +export const RequestResponse = { + encode(message: RequestResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + if (message.createdAt !== 0) { + writer.uint32(16).int64(message.createdAt); + } + if (message.message !== undefined) { + writer.uint32(26).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.createdAt = longToNumber(reader.int64() as Long); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): RequestResponse { + return { + user: isSet(object.user) ? User.fromJSON(object.user) : undefined, + createdAt: isSet(object.createdAt) ? globalThis.Number(object.createdAt) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : undefined, + }; + }, + + toJSON(message: RequestResponse): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + if (message.createdAt !== 0) { + obj.createdAt = Math.round(message.createdAt); + } + if (message.message !== undefined) { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): RequestResponse { + return RequestResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RequestResponse { + const message = createBaseRequestResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + message.createdAt = object.createdAt ?? 0; + message.message = object.message ?? undefined; + return message; + }, +}; + +function createBaseRequestPayload(): RequestPayload { + return { user: undefined, message: undefined }; +} + +export const RequestPayload = { + encode(message: RequestPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + if (message.message !== undefined) { + writer.uint32(26).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): RequestPayload { + return { + user: isSet(object.user) ? User.fromJSON(object.user) : undefined, + message: isSet(object.message) ? globalThis.String(object.message) : undefined, + }; + }, + + toJSON(message: RequestPayload): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + if (message.message !== undefined) { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): RequestPayload { + return RequestPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RequestPayload { + const message = createBaseRequestPayload(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + message.message = object.message ?? undefined; + return message; + }, +}; + +function createBaseRequests(): Requests { + return { total: 0, items: [] }; +} + +export const Requests = { + encode(message: Requests, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.total !== 0) { + writer.uint32(8).int64(message.total); + } + for (const v of message.items) { + RequestResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Requests { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequests(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.total = longToNumber(reader.int64() as Long); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.items.push(RequestResponse.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Requests { + return { + total: isSet(object.total) ? globalThis.Number(object.total) : 0, + items: globalThis.Array.isArray(object?.items) ? object.items.map((e: any) => RequestResponse.fromJSON(e)) : [], + }; + }, + + toJSON(message: Requests): unknown { + const obj: any = {}; + if (message.total !== 0) { + obj.total = Math.round(message.total); + } + if (message.items?.length) { + obj.items = message.items.map((e) => RequestResponse.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): Requests { + return Requests.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Requests { + const message = createBaseRequests(); + message.total = object.total ?? 0; + message.items = object.items?.map((e) => RequestResponse.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseRequestEvents(): RequestEvents { + return { outgoing: undefined, incoming: undefined }; +} + +export const RequestEvents = { + encode(message: RequestEvents, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.outgoing !== undefined) { + Requests.encode(message.outgoing, writer.uint32(10).fork()).ldelim(); + } + if (message.incoming !== undefined) { + Requests.encode(message.incoming, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEvents { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEvents(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.outgoing = Requests.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.incoming = Requests.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): RequestEvents { + return { + outgoing: isSet(object.outgoing) ? Requests.fromJSON(object.outgoing) : undefined, + incoming: isSet(object.incoming) ? Requests.fromJSON(object.incoming) : undefined, + }; + }, + + toJSON(message: RequestEvents): unknown { + const obj: any = {}; + if (message.outgoing !== undefined) { + obj.outgoing = Requests.toJSON(message.outgoing); + } + if (message.incoming !== undefined) { + obj.incoming = Requests.toJSON(message.incoming); + } + return obj; + }, + + create, I>>(base?: I): RequestEvents { + return RequestEvents.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RequestEvents { + const message = createBaseRequestEvents(); + message.outgoing = (object.outgoing !== undefined && object.outgoing !== null) + ? Requests.fromPartial(object.outgoing) + : undefined; + message.incoming = (object.incoming !== undefined && object.incoming !== null) + ? Requests.fromPartial(object.incoming) + : undefined; + return message; + }, +}; + +function createBaseAcceptResponse(): AcceptResponse { + return { user: undefined }; +} + +export const AcceptResponse = { + encode(message: AcceptResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AcceptResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AcceptResponse { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: AcceptResponse): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): AcceptResponse { + return AcceptResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): AcceptResponse { + const message = createBaseAcceptResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseAcceptPayload(): AcceptPayload { + return { user: undefined }; +} + +export const AcceptPayload = { + encode(message: AcceptPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AcceptPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): AcceptPayload { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: AcceptPayload): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): AcceptPayload { + return AcceptPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): AcceptPayload { + const message = createBaseAcceptPayload(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseRejectResponse(): RejectResponse { + return { user: undefined }; +} + +export const RejectResponse = { + encode(message: RejectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RejectResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRejectResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): RejectResponse { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: RejectResponse): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): RejectResponse { + return RejectResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RejectResponse { + const message = createBaseRejectResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseRejectPayload(): RejectPayload { + return { user: undefined }; +} + +export const RejectPayload = { + encode(message: RejectPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RejectPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRejectPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): RejectPayload { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: RejectPayload): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): RejectPayload { + return RejectPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RejectPayload { + const message = createBaseRejectPayload(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseDeleteResponse(): DeleteResponse { + return { user: undefined }; +} + +export const DeleteResponse = { + encode(message: DeleteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteResponse { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: DeleteResponse): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): DeleteResponse { + return DeleteResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DeleteResponse { + const message = createBaseDeleteResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseDeletePayload(): DeletePayload { + return { user: undefined }; +} + +export const DeletePayload = { + encode(message: DeletePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeletePayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeletePayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeletePayload { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: DeletePayload): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): DeletePayload { + return DeletePayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): DeletePayload { + const message = createBaseDeletePayload(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseCancelResponse(): CancelResponse { + return { user: undefined }; +} + +export const CancelResponse = { + encode(message: CancelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelResponse { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: CancelResponse): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): CancelResponse { + return CancelResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CancelResponse { + const message = createBaseCancelResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseCancelPayload(): CancelPayload { + return { user: undefined }; +} + +export const CancelPayload = { + encode(message: CancelPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelPayload { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: CancelPayload): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): CancelPayload { + return CancelPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): CancelPayload { + const message = createBaseCancelPayload(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseUpdateFriendshipPayload(): UpdateFriendshipPayload { + return { event: undefined }; +} + +export const UpdateFriendshipPayload = { + encode(message: UpdateFriendshipPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.event !== undefined) { + FriendshipEventPayload.encode(message.event, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateFriendshipPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFriendshipPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.event = FriendshipEventPayload.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateFriendshipPayload { + return { event: isSet(object.event) ? FriendshipEventPayload.fromJSON(object.event) : undefined }; + }, + + toJSON(message: UpdateFriendshipPayload): unknown { + const obj: any = {}; + if (message.event !== undefined) { + obj.event = FriendshipEventPayload.toJSON(message.event); + } + return obj; + }, + + create, I>>(base?: I): UpdateFriendshipPayload { + return UpdateFriendshipPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UpdateFriendshipPayload { + const message = createBaseUpdateFriendshipPayload(); + message.event = (object.event !== undefined && object.event !== null) + ? FriendshipEventPayload.fromPartial(object.event) + : undefined; + return message; + }, +}; + +function createBaseMutualFriendsPayload(): MutualFriendsPayload { + return { user: undefined }; +} + +export const MutualFriendsPayload = { + encode(message: MutualFriendsPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MutualFriendsPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMutualFriendsPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): MutualFriendsPayload { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; + }, + + toJSON(message: MutualFriendsPayload): unknown { + const obj: any = {}; + if (message.user !== undefined) { + obj.user = User.toJSON(message.user); + } + return obj; + }, + + create, I>>(base?: I): MutualFriendsPayload { + return MutualFriendsPayload.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): MutualFriendsPayload { + const message = createBaseMutualFriendsPayload(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseBadRequestError(): BadRequestError { + return { message: "" }; +} + +export const BadRequestError = { + encode(message: BadRequestError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BadRequestError { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBadRequestError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): BadRequestError { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + + toJSON(message: BadRequestError): unknown { + const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): BadRequestError { + return BadRequestError.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): BadRequestError { + const message = createBaseBadRequestError(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseUnauthorizedError(): UnauthorizedError { + return { message: "" }; +} + +export const UnauthorizedError = { + encode(message: UnauthorizedError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UnauthorizedError { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnauthorizedError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UnauthorizedError { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + + toJSON(message: UnauthorizedError): unknown { + const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): UnauthorizedError { + return UnauthorizedError.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UnauthorizedError { + const message = createBaseUnauthorizedError(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseForbiddenError(): ForbiddenError { + return { message: "" }; +} + +export const ForbiddenError = { + encode(message: ForbiddenError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ForbiddenError { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForbiddenError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ForbiddenError { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + + toJSON(message: ForbiddenError): unknown { + const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): ForbiddenError { + return ForbiddenError.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ForbiddenError { + const message = createBaseForbiddenError(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseTooManyRequestsError(): TooManyRequestsError { + return { message: "" }; +} + +export const TooManyRequestsError = { + encode(message: TooManyRequestsError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TooManyRequestsError { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTooManyRequestsError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): TooManyRequestsError { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + + toJSON(message: TooManyRequestsError): unknown { + const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): TooManyRequestsError { + return TooManyRequestsError.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TooManyRequestsError { + const message = createBaseTooManyRequestsError(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseInternalServerError(): InternalServerError { + return { message: "" }; +} + +export const InternalServerError = { + encode(message: InternalServerError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InternalServerError { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInternalServerError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.message = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): InternalServerError { + return { message: isSet(object.message) ? globalThis.String(object.message) : "" }; + }, + + toJSON(message: InternalServerError): unknown { + const obj: any = {}; + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create, I>>(base?: I): InternalServerError { + return InternalServerError.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): InternalServerError { + const message = createBaseInternalServerError(); + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseUsersResponse(): UsersResponse { + return { + users: undefined, + internalServerError: undefined, + unauthorizedError: undefined, + forbiddenError: undefined, + tooManyRequestsError: undefined, + badRequestError: undefined, + }; +} + +export const UsersResponse = { + encode(message: UsersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.users !== undefined) { + Users.encode(message.users, writer.uint32(10).fork()).ldelim(); + } + if (message.internalServerError !== undefined) { + InternalServerError.encode(message.internalServerError, writer.uint32(18).fork()).ldelim(); + } + if (message.unauthorizedError !== undefined) { + UnauthorizedError.encode(message.unauthorizedError, writer.uint32(26).fork()).ldelim(); + } + if (message.forbiddenError !== undefined) { + ForbiddenError.encode(message.forbiddenError, writer.uint32(34).fork()).ldelim(); + } + if (message.tooManyRequestsError !== undefined) { + TooManyRequestsError.encode(message.tooManyRequestsError, writer.uint32(42).fork()).ldelim(); + } + if (message.badRequestError !== undefined) { + BadRequestError.encode(message.badRequestError, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UsersResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUsersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.users = Users.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.internalServerError = InternalServerError.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.unauthorizedError = UnauthorizedError.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.forbiddenError = ForbiddenError.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.tooManyRequestsError = TooManyRequestsError.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.badRequestError = BadRequestError.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UsersResponse { + return { + users: isSet(object.users) ? Users.fromJSON(object.users) : undefined, + internalServerError: isSet(object.internalServerError) + ? InternalServerError.fromJSON(object.internalServerError) + : undefined, + unauthorizedError: isSet(object.unauthorizedError) + ? UnauthorizedError.fromJSON(object.unauthorizedError) + : undefined, + forbiddenError: isSet(object.forbiddenError) ? ForbiddenError.fromJSON(object.forbiddenError) : undefined, + tooManyRequestsError: isSet(object.tooManyRequestsError) + ? TooManyRequestsError.fromJSON(object.tooManyRequestsError) + : undefined, + badRequestError: isSet(object.badRequestError) ? BadRequestError.fromJSON(object.badRequestError) : undefined, + }; + }, + + toJSON(message: UsersResponse): unknown { + const obj: any = {}; + if (message.users !== undefined) { + obj.users = Users.toJSON(message.users); + } + if (message.internalServerError !== undefined) { + obj.internalServerError = InternalServerError.toJSON(message.internalServerError); + } + if (message.unauthorizedError !== undefined) { + obj.unauthorizedError = UnauthorizedError.toJSON(message.unauthorizedError); + } + if (message.forbiddenError !== undefined) { + obj.forbiddenError = ForbiddenError.toJSON(message.forbiddenError); + } + if (message.tooManyRequestsError !== undefined) { + obj.tooManyRequestsError = TooManyRequestsError.toJSON(message.tooManyRequestsError); + } + if (message.badRequestError !== undefined) { + obj.badRequestError = BadRequestError.toJSON(message.badRequestError); + } + return obj; + }, + + create, I>>(base?: I): UsersResponse { + return UsersResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UsersResponse { + const message = createBaseUsersResponse(); + message.users = (object.users !== undefined && object.users !== null) ? Users.fromPartial(object.users) : undefined; + message.internalServerError = (object.internalServerError !== undefined && object.internalServerError !== null) + ? InternalServerError.fromPartial(object.internalServerError) + : undefined; + message.unauthorizedError = (object.unauthorizedError !== undefined && object.unauthorizedError !== null) + ? UnauthorizedError.fromPartial(object.unauthorizedError) + : undefined; + message.forbiddenError = (object.forbiddenError !== undefined && object.forbiddenError !== null) + ? ForbiddenError.fromPartial(object.forbiddenError) + : undefined; + message.tooManyRequestsError = (object.tooManyRequestsError !== undefined && object.tooManyRequestsError !== null) + ? TooManyRequestsError.fromPartial(object.tooManyRequestsError) + : undefined; + message.badRequestError = (object.badRequestError !== undefined && object.badRequestError !== null) + ? BadRequestError.fromPartial(object.badRequestError) + : undefined; + return message; + }, +}; + +function createBaseRequestEventsResponse(): RequestEventsResponse { + return { + events: undefined, + internalServerError: undefined, + unauthorizedError: undefined, + forbiddenError: undefined, + tooManyRequestsError: undefined, + }; +} + +export const RequestEventsResponse = { + encode(message: RequestEventsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.events !== undefined) { + RequestEvents.encode(message.events, writer.uint32(10).fork()).ldelim(); + } + if (message.internalServerError !== undefined) { + InternalServerError.encode(message.internalServerError, writer.uint32(18).fork()).ldelim(); + } + if (message.unauthorizedError !== undefined) { + UnauthorizedError.encode(message.unauthorizedError, writer.uint32(26).fork()).ldelim(); + } + if (message.forbiddenError !== undefined) { + ForbiddenError.encode(message.forbiddenError, writer.uint32(34).fork()).ldelim(); + } + if (message.tooManyRequestsError !== undefined) { + TooManyRequestsError.encode(message.tooManyRequestsError, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEventsResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestEventsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.events = RequestEvents.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.internalServerError = InternalServerError.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.unauthorizedError = UnauthorizedError.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.forbiddenError = ForbiddenError.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.tooManyRequestsError = TooManyRequestsError.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): RequestEventsResponse { + return { + events: isSet(object.events) ? RequestEvents.fromJSON(object.events) : undefined, + internalServerError: isSet(object.internalServerError) + ? InternalServerError.fromJSON(object.internalServerError) + : undefined, + unauthorizedError: isSet(object.unauthorizedError) + ? UnauthorizedError.fromJSON(object.unauthorizedError) + : undefined, + forbiddenError: isSet(object.forbiddenError) ? ForbiddenError.fromJSON(object.forbiddenError) : undefined, + tooManyRequestsError: isSet(object.tooManyRequestsError) + ? TooManyRequestsError.fromJSON(object.tooManyRequestsError) + : undefined, + }; + }, + + toJSON(message: RequestEventsResponse): unknown { + const obj: any = {}; + if (message.events !== undefined) { + obj.events = RequestEvents.toJSON(message.events); + } + if (message.internalServerError !== undefined) { + obj.internalServerError = InternalServerError.toJSON(message.internalServerError); + } + if (message.unauthorizedError !== undefined) { + obj.unauthorizedError = UnauthorizedError.toJSON(message.unauthorizedError); + } + if (message.forbiddenError !== undefined) { + obj.forbiddenError = ForbiddenError.toJSON(message.forbiddenError); + } + if (message.tooManyRequestsError !== undefined) { + obj.tooManyRequestsError = TooManyRequestsError.toJSON(message.tooManyRequestsError); + } + return obj; + }, + + create, I>>(base?: I): RequestEventsResponse { + return RequestEventsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): RequestEventsResponse { + const message = createBaseRequestEventsResponse(); + message.events = (object.events !== undefined && object.events !== null) + ? RequestEvents.fromPartial(object.events) + : undefined; + message.internalServerError = (object.internalServerError !== undefined && object.internalServerError !== null) + ? InternalServerError.fromPartial(object.internalServerError) + : undefined; + message.unauthorizedError = (object.unauthorizedError !== undefined && object.unauthorizedError !== null) + ? UnauthorizedError.fromPartial(object.unauthorizedError) + : undefined; + message.forbiddenError = (object.forbiddenError !== undefined && object.forbiddenError !== null) + ? ForbiddenError.fromPartial(object.forbiddenError) + : undefined; + message.tooManyRequestsError = (object.tooManyRequestsError !== undefined && object.tooManyRequestsError !== null) + ? TooManyRequestsError.fromPartial(object.tooManyRequestsError) + : undefined; + return message; + }, +}; + +function createBaseUpdateFriendshipResponse(): UpdateFriendshipResponse { + return { + event: undefined, + internalServerError: undefined, + unauthorizedError: undefined, + forbiddenError: undefined, + tooManyRequestsError: undefined, + badRequestError: undefined, + }; +} + +export const UpdateFriendshipResponse = { + encode(message: UpdateFriendshipResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.event !== undefined) { + FriendshipEventResponse.encode(message.event, writer.uint32(10).fork()).ldelim(); + } + if (message.internalServerError !== undefined) { + InternalServerError.encode(message.internalServerError, writer.uint32(18).fork()).ldelim(); + } + if (message.unauthorizedError !== undefined) { + UnauthorizedError.encode(message.unauthorizedError, writer.uint32(26).fork()).ldelim(); + } + if (message.forbiddenError !== undefined) { + ForbiddenError.encode(message.forbiddenError, writer.uint32(34).fork()).ldelim(); + } + if (message.tooManyRequestsError !== undefined) { + TooManyRequestsError.encode(message.tooManyRequestsError, writer.uint32(42).fork()).ldelim(); + } + if (message.badRequestError !== undefined) { + BadRequestError.encode(message.badRequestError, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateFriendshipResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFriendshipResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.event = FriendshipEventResponse.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.internalServerError = InternalServerError.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.unauthorizedError = UnauthorizedError.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.forbiddenError = ForbiddenError.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.tooManyRequestsError = TooManyRequestsError.decode(reader, reader.uint32()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.badRequestError = BadRequestError.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateFriendshipResponse { + return { + event: isSet(object.event) ? FriendshipEventResponse.fromJSON(object.event) : undefined, + internalServerError: isSet(object.internalServerError) + ? InternalServerError.fromJSON(object.internalServerError) + : undefined, + unauthorizedError: isSet(object.unauthorizedError) + ? UnauthorizedError.fromJSON(object.unauthorizedError) + : undefined, + forbiddenError: isSet(object.forbiddenError) ? ForbiddenError.fromJSON(object.forbiddenError) : undefined, + tooManyRequestsError: isSet(object.tooManyRequestsError) + ? TooManyRequestsError.fromJSON(object.tooManyRequestsError) + : undefined, + badRequestError: isSet(object.badRequestError) ? BadRequestError.fromJSON(object.badRequestError) : undefined, + }; + }, + + toJSON(message: UpdateFriendshipResponse): unknown { + const obj: any = {}; + if (message.event !== undefined) { + obj.event = FriendshipEventResponse.toJSON(message.event); + } + if (message.internalServerError !== undefined) { + obj.internalServerError = InternalServerError.toJSON(message.internalServerError); + } + if (message.unauthorizedError !== undefined) { + obj.unauthorizedError = UnauthorizedError.toJSON(message.unauthorizedError); + } + if (message.forbiddenError !== undefined) { + obj.forbiddenError = ForbiddenError.toJSON(message.forbiddenError); + } + if (message.tooManyRequestsError !== undefined) { + obj.tooManyRequestsError = TooManyRequestsError.toJSON(message.tooManyRequestsError); + } + if (message.badRequestError !== undefined) { + obj.badRequestError = BadRequestError.toJSON(message.badRequestError); + } + return obj; + }, + + create, I>>(base?: I): UpdateFriendshipResponse { + return UpdateFriendshipResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UpdateFriendshipResponse { + const message = createBaseUpdateFriendshipResponse(); + message.event = (object.event !== undefined && object.event !== null) + ? FriendshipEventResponse.fromPartial(object.event) + : undefined; + message.internalServerError = (object.internalServerError !== undefined && object.internalServerError !== null) + ? InternalServerError.fromPartial(object.internalServerError) + : undefined; + message.unauthorizedError = (object.unauthorizedError !== undefined && object.unauthorizedError !== null) + ? UnauthorizedError.fromPartial(object.unauthorizedError) + : undefined; + message.forbiddenError = (object.forbiddenError !== undefined && object.forbiddenError !== null) + ? ForbiddenError.fromPartial(object.forbiddenError) + : undefined; + message.tooManyRequestsError = (object.tooManyRequestsError !== undefined && object.tooManyRequestsError !== null) + ? TooManyRequestsError.fromPartial(object.tooManyRequestsError) + : undefined; + message.badRequestError = (object.badRequestError !== undefined && object.badRequestError !== null) + ? BadRequestError.fromPartial(object.badRequestError) + : undefined; + return message; + }, +}; + +function createBaseSubscribeFriendshipEventsUpdatesResponse(): SubscribeFriendshipEventsUpdatesResponse { + return { + events: undefined, + internalServerError: undefined, + unauthorizedError: undefined, + forbiddenError: undefined, + tooManyRequestsError: undefined, + }; +} + +export const SubscribeFriendshipEventsUpdatesResponse = { + encode(message: SubscribeFriendshipEventsUpdatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.events !== undefined) { + FriendshipEventResponses.encode(message.events, writer.uint32(10).fork()).ldelim(); + } + if (message.internalServerError !== undefined) { + InternalServerError.encode(message.internalServerError, writer.uint32(18).fork()).ldelim(); + } + if (message.unauthorizedError !== undefined) { + UnauthorizedError.encode(message.unauthorizedError, writer.uint32(26).fork()).ldelim(); + } + if (message.forbiddenError !== undefined) { + ForbiddenError.encode(message.forbiddenError, writer.uint32(34).fork()).ldelim(); + } + if (message.tooManyRequestsError !== undefined) { + TooManyRequestsError.encode(message.tooManyRequestsError, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeFriendshipEventsUpdatesResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeFriendshipEventsUpdatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.events = FriendshipEventResponses.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.internalServerError = InternalServerError.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.unauthorizedError = UnauthorizedError.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.forbiddenError = ForbiddenError.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.tooManyRequestsError = TooManyRequestsError.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): SubscribeFriendshipEventsUpdatesResponse { + return { + events: isSet(object.events) ? FriendshipEventResponses.fromJSON(object.events) : undefined, + internalServerError: isSet(object.internalServerError) + ? InternalServerError.fromJSON(object.internalServerError) + : undefined, + unauthorizedError: isSet(object.unauthorizedError) + ? UnauthorizedError.fromJSON(object.unauthorizedError) + : undefined, + forbiddenError: isSet(object.forbiddenError) ? ForbiddenError.fromJSON(object.forbiddenError) : undefined, + tooManyRequestsError: isSet(object.tooManyRequestsError) + ? TooManyRequestsError.fromJSON(object.tooManyRequestsError) + : undefined, + }; + }, + + toJSON(message: SubscribeFriendshipEventsUpdatesResponse): unknown { + const obj: any = {}; + if (message.events !== undefined) { + obj.events = FriendshipEventResponses.toJSON(message.events); + } + if (message.internalServerError !== undefined) { + obj.internalServerError = InternalServerError.toJSON(message.internalServerError); + } + if (message.unauthorizedError !== undefined) { + obj.unauthorizedError = UnauthorizedError.toJSON(message.unauthorizedError); + } + if (message.forbiddenError !== undefined) { + obj.forbiddenError = ForbiddenError.toJSON(message.forbiddenError); + } + if (message.tooManyRequestsError !== undefined) { + obj.tooManyRequestsError = TooManyRequestsError.toJSON(message.tooManyRequestsError); + } + return obj; + }, + + create, I>>( + base?: I, + ): SubscribeFriendshipEventsUpdatesResponse { + return SubscribeFriendshipEventsUpdatesResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): SubscribeFriendshipEventsUpdatesResponse { + const message = createBaseSubscribeFriendshipEventsUpdatesResponse(); + message.events = (object.events !== undefined && object.events !== null) + ? FriendshipEventResponses.fromPartial(object.events) + : undefined; + message.internalServerError = (object.internalServerError !== undefined && object.internalServerError !== null) + ? InternalServerError.fromPartial(object.internalServerError) + : undefined; + message.unauthorizedError = (object.unauthorizedError !== undefined && object.unauthorizedError !== null) + ? UnauthorizedError.fromPartial(object.unauthorizedError) + : undefined; + message.forbiddenError = (object.forbiddenError !== undefined && object.forbiddenError !== null) + ? ForbiddenError.fromPartial(object.forbiddenError) + : undefined; + message.tooManyRequestsError = (object.tooManyRequestsError !== undefined && object.tooManyRequestsError !== null) + ? TooManyRequestsError.fromPartial(object.tooManyRequestsError) + : undefined; + return message; + }, +}; + +export type FriendshipsServiceDefinition = typeof FriendshipsServiceDefinition; +export const FriendshipsServiceDefinition = { + name: "FriendshipsService", + fullName: "decentraland.social.friendships_ea.FriendshipsService", + methods: { + /** Get the list of friends for the authenticated user */ + getFriends: { + name: "GetFriends", + requestType: Empty, + requestStream: false, + responseType: UsersResponse, + responseStream: true, + options: {}, + }, + /** Get the list of mutual friends between the authenticated user and the one in the parameter */ + getMutualFriends: { + name: "GetMutualFriends", + requestType: MutualFriendsPayload, + requestStream: false, + responseType: UsersResponse, + responseStream: true, + options: {}, + }, + /** Get the list of request events for the authenticated user */ + getRequestEvents: { + name: "GetRequestEvents", + requestType: Empty, + requestStream: false, + responseType: RequestEventsResponse, + responseStream: false, + options: {}, + }, + /** Update friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE */ + updateFriendshipEvent: { + name: "UpdateFriendshipEvent", + requestType: UpdateFriendshipPayload, + requestStream: false, + responseType: UpdateFriendshipResponse, + responseStream: false, + options: {}, + }, + /** Subscribe to updates of friendship status: REQUEST, ACCEPT, REJECT, CANCEL, DELETE */ + subscribeFriendshipEventsUpdates: { + name: "SubscribeFriendshipEventsUpdates", + requestType: Empty, + requestStream: false, + responseType: SubscribeFriendshipEventsUpdatesResponse, + responseStream: true, + options: {}, + }, + }, +} as const; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/google/protobuf/empty.ts b/src/google/protobuf/empty.ts new file mode 100644 index 0000000..aed6f7c --- /dev/null +++ b/src/google/protobuf/empty.ts @@ -0,0 +1,73 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + */ +export interface Empty { +} + +function createBaseEmpty(): Empty { + return {}; +} + +export const Empty = { + encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Empty { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(_: any): Empty { + return {}; + }, + + toJSON(_: Empty): unknown { + const obj: any = {}; + return obj; + }, + + create, I>>(base?: I): Empty { + return Empty.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(_: I): Empty { + const message = createBaseEmpty(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; diff --git a/src/index.ts b/src/index.ts index 9b2cddb..51be60f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ -import { Lifecycle } from "@well-known-components/interfaces" -import { initComponents } from "./components" -import { main } from "./service" +import { Lifecycle } from '@well-known-components/interfaces' +import { initComponents } from './components' +import { main } from './service' // This file is the program entry point, it only calls the Lifecycle function Lifecycle.run({ main, initComponents }) diff --git a/src/types.ts b/src/types.ts index aa85610..de35bc1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,6 +9,8 @@ import type { import { IPgComponent } from '@well-known-components/pg-component' import { metricDeclarations } from './metrics' import { IDatabaseComponent } from './adapters/db' +import { WebSocketServer } from 'ws' +import { RpcServer } from '@dcl/rpc' export type GlobalContext = { components: BaseComponents @@ -22,6 +24,9 @@ export type BaseComponents = { metrics: IMetricsComponent pg: IPgComponent db: IDatabaseComponent + ws: IWebSocketComponent + rpcServer: RpcServer + fetcher: IFetchComponent } // components used in runtime @@ -47,3 +52,9 @@ export type HandlerContextWithPath< > export type Context = IHttpServerComponent.PathAwareContext + +export type IWebSocketComponent = IBaseComponent & { + ws: WebSocketServer +} + +export type RpcServerContext = GlobalContext & { address: string } diff --git a/yarn.lock b/yarn.lock index 7e5148e..c4b14a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -309,6 +309,15 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@dcl/crypto@^3.4.3": + version "3.4.5" + resolved "https://registry.yarnpkg.com/@dcl/crypto/-/crypto-3.4.5.tgz#95ca2beab46fa3494b4d38f009bf0d49c87ba235" + integrity sha512-uneyjOAOx7pi5kabZsLmPm9kSLkCk4Cok8FUsvT+6k8RquqkjKqocvkGVOMaoWsfU6S3mkLOyaeqEKmOy4ErxA== + dependencies: + "@dcl/schemas" "^9.2.0" + eth-connect "^6.0.3" + ethereum-cryptography "^1.0.3" + "@dcl/eslint-config@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@dcl/eslint-config/-/eslint-config-2.0.0.tgz#3c2d29514fd65b61b08202c470cc6a0af5c356e3" @@ -326,6 +335,37 @@ eslint-plugin-prettier "^5.1.3" prettier "^3.2.4" +"@dcl/platform-crypto-middleware@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@dcl/platform-crypto-middleware/-/platform-crypto-middleware-1.0.2.tgz#3daf9af7f04bd95f833dcf2c421171b37ea1bea6" + integrity sha512-V99zV5XntoXmZclSj5t4S8Ioi0s7jULep7dw1UmpvnXDvozQjUNX9w5sWnXrcAalTocXHbf7bL7xK6sHHDZ0Mw== + dependencies: + "@dcl/crypto" "^3.4.3" + "@well-known-components/fetch-component" "^2.0.2" + "@well-known-components/interfaces" "^1.4.2" + +"@dcl/protocol@^1.0.0-2569677750.commit-6ce832a": + version "1.0.0-2569677750.commit-6ce832a" + resolved "https://registry.yarnpkg.com/@dcl/protocol/-/protocol-1.0.0-2569677750.commit-6ce832a.tgz#e46fd372802c4434b0460c82effad05bfd824edc" + integrity sha512-PqQ340fVpZsjoSKsCPcaIJj6BcI5p1rJOLKfMyKuX2uGsqxcdh8E/H4/nfx1RO5Cz4V4EDvXhYN7fZ+GV3LnqQ== + +"@dcl/rpc@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@dcl/rpc/-/rpc-1.1.2.tgz#789f4f24c8d432a48df3e786b77d017883dda11a" + integrity sha512-HgZe9umoD48ZQRaiKTss+vj/War/HjH/DBnb6pzd5fx2OMInaB1YYso3OZ4dCT/OC0AtNny8Tkb3CUJdYAvj/w== + dependencies: + mitt "^3.0.0" + ts-proto "^1.146.0" + +"@dcl/schemas@^9.2.0": + version "9.15.0" + resolved "https://registry.yarnpkg.com/@dcl/schemas/-/schemas-9.15.0.tgz#81337faa396d21a2d1e704e5ec3cfd7b7b14343e" + integrity sha512-nip5rsOcJplNfBWeImwezuHLprM0gLW03kEeqGIvT9J6HnEBTtvIwkk9+NSt7hzFKEvWGI+C23vyNWbG3nU+SQ== + dependencies: + ajv "^8.11.0" + ajv-errors "^3.0.0" + ajv-keywords "^5.1.0" + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -625,6 +665,16 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -656,6 +706,86 @@ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== +"@protobuf-ts/protoc@^2.9.4": + version "2.9.4" + resolved "https://registry.yarnpkg.com/@protobuf-ts/protoc/-/protoc-2.9.4.tgz#a92262ee64d252998540238701d2140f4ffec081" + integrity sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ== + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + +"@scure/base@~1.1.0": + version "1.1.6" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.6.tgz#8ce5d304b436e4c84f896e0550c83e4d88cb917d" + integrity sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g== + +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" @@ -815,6 +945,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@>=13.7.0": + version "20.12.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.6.tgz#72d068870518d7da1d97b49db401e2d6a1805294" + integrity sha512-3KurE8taB8GCvZBPngVbp0lk5CKi8M9f9k1rsADh0Evdz5SzJ+Q+Hx9uHoFGsLnLnd1xmkDQr2hVhlA0Mn0lKQ== + dependencies: + undici-types "~5.26.4" + "@types/pg@^8.0.0", "@types/pg@^8.6.5": version "8.11.4" resolved "https://registry.npmjs.org/@types/pg/-/pg-8.11.4.tgz" @@ -846,6 +983,13 @@ resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/ws@^8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.10.tgz#4acfb517970853fa6574a3a6886791d04a396787" + integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A== + dependencies: + "@types/node" "*" + "@types/yargs-parser@*": version "21.0.3" resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz" @@ -956,6 +1100,14 @@ dependencies: dotenv "^16.0.1" +"@well-known-components/fetch-component@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@well-known-components/fetch-component/-/fetch-component-2.0.2.tgz#02260611f9d05551efe825c4358cbc628a71c4c0" + integrity sha512-LdY+6n9kuyACg3fcU4qMrNhLZuG7eqPxLSqzDgQyoHKeNjlzggoUqTVJKtIyi6vjPs8pSQ/Fx1xdLuBhOKCgww== + dependencies: + "@well-known-components/interfaces" "^1.4.1" + cross-fetch "^3.1.5" + "@well-known-components/http-server@^2.1.0": version "2.1.0" resolved "https://registry.npmjs.org/@well-known-components/http-server/-/http-server-2.1.0.tgz" @@ -970,7 +1122,7 @@ on-finished "^2.4.1" path-to-regexp "^6.2.1" -"@well-known-components/interfaces@^1.1.0", "@well-known-components/interfaces@^1.4.3": +"@well-known-components/interfaces@^1.1.0", "@well-known-components/interfaces@^1.4.1", "@well-known-components/interfaces@^1.4.2", "@well-known-components/interfaces@^1.4.3": version "1.4.3" resolved "https://registry.npmjs.org/@well-known-components/interfaces/-/interfaces-1.4.3.tgz" integrity sha512-roVtoOHG6uaH+nL4C0ISnAwkkopc2FLsS7fqX+roI22EdX9PAknPoImhPU8/3u6jgRAVpglX5Zj4nWZkSaXPkQ== @@ -1022,6 +1174,11 @@ "@well-known-components/interfaces" "^1.4.3" uWebSockets.js "github:uNetworking/uWebSockets.js#v20.43.0" +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1037,6 +1194,18 @@ acorn@^8.4.1, acorn@^8.9.0: resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +ajv-errors@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-3.0.0.tgz#e54f299f3a3d30fe144161e5f0d8d51196c527bc" + integrity sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ== + +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -1047,6 +1216,16 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.11.0: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" @@ -1078,7 +1257,7 @@ ansi-styles@^5.0.0: resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@^3.0.3: +anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -1178,6 +1357,11 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + bintrees@1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz" @@ -1198,7 +1382,7 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2: +braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -1254,6 +1438,11 @@ caniuse-lite@^1.0.30001587: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001599.tgz" integrity sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA== +case-anything@^2.1.13: + version "2.1.13" + resolved "https://registry.yarnpkg.com/case-anything/-/case-anything-2.1.13.tgz#0cdc16278cb29a7fcdeb072400da3f342ba329e9" + integrity sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng== + chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" @@ -1276,6 +1465,21 @@ char-regex@^1.0.2: resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== +chokidar@^3.5.2: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + ci-info@^3.2.0: version "3.9.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz" @@ -1373,6 +1577,13 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-fetch@^3.1.5: + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + dependencies: + node-fetch "^2.6.12" + cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" @@ -1389,7 +1600,7 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@^4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1431,6 +1642,11 @@ destroy@^1.2.0: resolved "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" @@ -1470,6 +1686,13 @@ dotenv@^16.0.1: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== +dprint-node@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/dprint-node/-/dprint-node-1.0.8.tgz#a02470722d8208a7d7eb3704328afda1d6758625" + integrity sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg== + dependencies: + detect-libc "^1.0.3" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" @@ -1705,6 +1928,21 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +eth-connect@^6.0.3: + version "6.2.4" + resolved "https://registry.yarnpkg.com/eth-connect/-/eth-connect-6.2.4.tgz#81a94bce29f6743b46f336a0ec9d42ed73fbe6fd" + integrity sha512-K0+g+pZoWkcJKKc4hwlYvaruoMBFcARoULIdf50bz/Zk9YdgFoKPjlRQWAtBgSDfxJS7AAHqg40k2Z/uQI0aNw== + +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + execa@^5.0.0: version "5.1.1" resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" @@ -1843,7 +2081,7 @@ form-data@^4.0.0: fp-future@^1.0.1: version "1.0.1" - resolved "https://registry.npmjs.org/fp-future/-/fp-future-1.0.1.tgz" + resolved "https://registry.yarnpkg.com/fp-future/-/fp-future-1.0.1.tgz#72e6247814f7a706d84939e5f459c2d7ec42316f" integrity sha512-2McmZH/KsZqlqHju9+Ox0FC7q7Knve4t6ZeKubbhAz1xpnD7hkCrP8TP5g5QbbD5bA5jBANbXf/ew4x1FjSUrw== fs.realpath@^1.0.0: @@ -1851,7 +2089,7 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.3.2: +fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.3" resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== @@ -1888,7 +2126,7 @@ get-tsconfig@^4.5.0, get-tsconfig@^4.7.2: dependencies: resolve-pkg-maps "^1.0.0" -glob-parent@^5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -1986,6 +2224,11 @@ human-signals@^2.1.0: resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +ignore-by-default@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" + integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA== + ignore@^5.2.0, ignore@^5.2.4: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" @@ -2030,6 +2273,13 @@ is-arrayish@^0.2.1: resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + is-core-module@^2.11.0, is-core-module@^2.13.0: version "2.13.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz" @@ -2052,7 +2302,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -2530,6 +2780,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -2617,6 +2872,11 @@ lodash@^4.17.20: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@^5.0.0, long@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" @@ -2735,7 +2995,7 @@ nise@^5.1.5: just-extend "^6.2.0" path-to-regexp "^6.2.1" -node-fetch@^2.6.9: +node-fetch@^2.6.12, node-fetch@^2.6.9: version "2.7.0" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -2762,7 +3022,30 @@ node-releases@^2.0.14: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz" integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== -normalize-path@^3.0.0: +nodemon@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-3.1.0.tgz#ff7394f2450eb6a5e96fe4180acd5176b29799c9" + integrity sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA== + dependencies: + chokidar "^3.5.2" + debug "^4" + ignore-by-default "^1.0.1" + minimatch "^3.1.2" + pstree.remy "^1.1.8" + semver "^7.5.3" + simple-update-notifier "^2.0.0" + supports-color "^5.5.0" + touch "^3.1.0" + undefsafe "^2.0.5" + +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg== + dependencies: + abbrev "1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== @@ -2995,7 +3278,7 @@ picocolors@^1.0.0: resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -3110,6 +3393,29 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +protobufjs@^7.2.4: + version "7.2.6" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.6.tgz#4a0ccd79eb292717aacf07530a07e0ed20278215" + integrity sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + +pstree.remy@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" + integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== + punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -3130,11 +3436,23 @@ react-is@^18.0.0: resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" @@ -3224,6 +3542,13 @@ signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +simple-update-notifier@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz#d70b92bdab7d6d90dfd73931195a30b6e3d7cebb" + integrity sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w== + dependencies: + semver "^7.5.3" + sinon@^17.0.0: version "17.0.1" resolved "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz" @@ -3330,7 +3655,7 @@ strip-json-comments@^3.1.1: resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@^5.3.0: +supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -3412,6 +3737,13 @@ toidentifier@1.0.1: resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +touch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" + integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== + dependencies: + nopt "~1.0.10" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" @@ -3438,7 +3770,7 @@ ts-jest@^29.1.0: ts-node@^10.9.2: version "10.9.2" - resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== dependencies: "@cspotcode/source-map-support" "^0.8.0" @@ -3455,6 +3787,31 @@ ts-node@^10.9.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +ts-poet@^6.7.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-6.8.0.tgz#fb7304165bf84c764b71d471e7ac9c152d4ca586" + integrity sha512-mjmr0JCUK1l3wyQyJFz6a2KF0iw8Mf5ADOIDEQTWWCsqpGEbJds/fOMA4BHlySc4RlQpGNFABo9JS5TNE9DD3w== + dependencies: + dprint-node "^1.0.8" + +ts-proto-descriptors@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/ts-proto-descriptors/-/ts-proto-descriptors-1.15.0.tgz#e859e3a2887da2d954c552524719b80bdb6ee355" + integrity sha512-TYyJ7+H+7Jsqawdv+mfsEpZPTIj9siDHS6EMCzG/z3b/PZiphsX+mWtqFfFVe5/N0Th6V3elK9lQqjnrgTOfrg== + dependencies: + long "^5.2.3" + protobufjs "^7.2.4" + +ts-proto@^1.146.0: + version "1.171.0" + resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.171.0.tgz#679f9da0d3c9462b4814f422ef63e3f986936fd0" + integrity sha512-NMwiqCixlk6MZ3TAIpVQUuWwUktCXhoP+07V7D7Eo2IlEwulZucOGrU82toHhPL/QTd+oMBM2RDeQk9qs8+ZEQ== + dependencies: + case-anything "^2.1.13" + protobufjs "^7.2.4" + ts-poet "^6.7.0" + ts-proto-descriptors "1.15.0" + tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" @@ -3496,6 +3853,11 @@ typescript@^5.4.2: version "20.43.0" resolved "https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/1977b5039938ad863d42fc4958d48c17e5a1fa06" +undefsafe@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" + integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== + undici-types@~5.26.4: version "5.26.5" resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" @@ -3579,6 +3941,11 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" +ws@^8.16.0: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" + integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== + xtend@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz"