From 9eb077c4afcd8daab13f61982af4d7830cabc07e Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 17 Sep 2023 21:12:23 +0800 Subject: [PATCH] chore: update service clients --- web/src/grpcweb.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/src/grpcweb.ts b/web/src/grpcweb.ts index fc5817ff..9e920677 100644 --- a/web/src/grpcweb.ts +++ b/web/src/grpcweb.ts @@ -1,4 +1,8 @@ import { createChannel, createClientFactory, FetchTransport } from "nice-grpc-web"; +import { MemoServiceDefinition } from "./types/proto/api/v2/memo_service"; +import { ResourceServiceDefinition } from "./types/proto/api/v2/resource_service"; +import { SystemServiceDefinition } from "./types/proto/api/v2/system_service"; +import { TagServiceDefinition } from "./types/proto/api/v2/tag_service"; import { UserServiceDefinition } from "./types/proto/api/v2/user_service"; const address = import.meta.env.MODE === "development" ? "http://localhost:8081" : window.location.origin; @@ -13,3 +17,11 @@ const channel = createChannel( const clientFactory = createClientFactory(); export const userServiceClient = clientFactory.create(UserServiceDefinition, channel); + +export const memoServiceClient = clientFactory.create(MemoServiceDefinition, channel); + +export const resourceServiceClient = clientFactory.create(ResourceServiceDefinition, channel); + +export const systemServiceClient = clientFactory.create(SystemServiceDefinition, channel); + +export const tagServiceClient = clientFactory.create(TagServiceDefinition, channel);