*Fix type handling
This commit is contained in:
parent
1c37f7809c
commit
029aab6901
|
@ -4,7 +4,6 @@ import {
|
||||||
PluginAPI,
|
PluginAPI,
|
||||||
RPCBroadcastRequest,
|
RPCBroadcastRequest,
|
||||||
RPCBroadcastResponse,
|
RPCBroadcastResponse,
|
||||||
RPCClearCacheResponse,
|
|
||||||
RPCRequest,
|
RPCRequest,
|
||||||
RPCResponse,
|
RPCResponse,
|
||||||
} from "@lumeweb/relay-types";
|
} from "@lumeweb/relay-types";
|
||||||
|
@ -54,7 +53,7 @@ const plugin: Plugin = {
|
||||||
});
|
});
|
||||||
api.registerMethod("clear_cached_item", {
|
api.registerMethod("clear_cached_item", {
|
||||||
cacheable: false,
|
cacheable: false,
|
||||||
async handler(req: string): Promise<RPCClearCacheResponse> {
|
async handler(req: string): Promise<void> {
|
||||||
if (typeof req !== "string") {
|
if (typeof req !== "string") {
|
||||||
throw new Error("item must be a string");
|
throw new Error("item must be a string");
|
||||||
}
|
}
|
||||||
|
@ -63,10 +62,6 @@ const plugin: Plugin = {
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
data: true,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
api.registerMethod("broadcast_request", {
|
api.registerMethod("broadcast_request", {
|
||||||
|
@ -87,7 +82,7 @@ const plugin: Plugin = {
|
||||||
signedField: "relays",
|
signedField: "relays",
|
||||||
};
|
};
|
||||||
for (const relay in resp) {
|
for (const relay in resp) {
|
||||||
let ret: RPCClearCacheResponse;
|
let ret: RPCResponse;
|
||||||
try {
|
try {
|
||||||
ret = await resp.get(relay);
|
ret = await resp.get(relay);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
|
Loading…
Reference in New Issue