MCPcopy Create free account
hub / github.com/msgbyte/tailchat / call

Method call

apps/github-app/src/client.ts:61–85  ·  view source on GitHub ↗
(action: string, params = {})

Source from the content-addressed store, hash-verified

59 }
60
61 async call(action: string, params = {}) {
62 try {
63 await Promise.resolve(this.loginP);
64 console.log('正在调用服务:', action);
65 const { data } = await this.request.post(
66 '/api/' + action.replace(/\./g, '/'),
67 params
68 );
69
70 return data;
71 } catch (err: any) {
72 console.error('服务调用失败:', err);
73 const data: string = err?.response?.data;
74 if (data) {
75 throw new Error(
76 JSON.stringify({
77 action,
78 data,
79 })
80 );
81 } else {
82 throw err;
83 }
84 }
85 }
86
87 async whoami() {
88 return this.call('user.whoami');

Callers 15

whoamiMethod · 0.95
appFnFunction · 0.45
buildRouterFunction · 0.45
handlerFunction · 0.45
startedFunction · 0.45
healthFunction · 0.45
actionFunction · 0.45
buildHooksFunction · 0.45
handlerFunction · 0.45
setGlobalConfigFunction · 0.45
registerAfterActionHookFunction · 0.45
systemCallFunction · 0.45

Calls 2

errorMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected