MCPcopy Create free account
hub / github.com/PleasureTools/joyBox / RpcMethod

Function RpcMethod

backend/Src/ClientIO/RpcRequestHandler.ts:54–63  ·  view source on GitHub ↗
(name: string, access: AppAccessType = AppAccessType.FULL_ACCESS)

Source from the content-addressed store, hash-verified

52}
53
54export function RpcMethod<T>(name: string, access: AppAccessType = AppAccessType.FULL_ACCESS) {
55 return (target: T, propertyKey: string, descriptor: PropertyDescriptor) => {
56 if (Reflect.hasMetadata('mtable', target)) {
57 const mtable: MTable = Reflect.getMetadata('mtable', target);
58 mtable.set(name, { fn: descriptor.value, access });
59 } else {
60 Reflect.defineMetadata('mtable', new Map([[name, { fn: descriptor.value, access }]]), target);
61 }
62 };
63}
64
65export class RpcRequestHandler {
66 protected clientAccess: AppAccessType = C.DefaultAccess;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected