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

Method setAppCapability

server/services/openapi/app.service.ts:274–297  ·  view source on GitHub ↗

* 设置应用开放的能力

(
    ctx: TcContext<{
      appId: string;
      capability: string[];
    }>
  )

Source from the content-addressed store, hash-verified

272 * 设置应用开放的能力
273 */
274 async setAppCapability(
275 ctx: TcContext<{
276 appId: string;
277 capability: string[];
278 }>
279 ) {
280 const { appId, capability } = ctx.params;
281 const { userId } = ctx.meta;
282
283 const openapp = await this.adapter.model.findAppByIdAndOwner(appId, userId);
284 if (!openapp) {
285 throw new Error('Not found openapp');
286 }
287
288 await openapp
289 .updateOne({
290 capability: filterAvailableAppCapability(_.uniq(capability)),
291 })
292 .exec();
293
294 await this.cleanAppInfoCache(appId);
295
296 return true;
297 }
298
299 /**
300 * 设置OAuth的设置信息

Callers

nothing calls this directly

Calls 3

cleanAppInfoCacheMethod · 0.95
findAppByIdAndOwnerMethod · 0.80

Tested by

no test coverage detected