*Initial version
This commit is contained in:
parent
92b6c6f7cc
commit
7a13fcee41
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 Lume Web
|
Copyright (c) 2022 Hammer Technologies LLC
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name": "@lumeweb/relay-plugins-core",
|
||||||
|
"type": "module",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"devDependencies": {
|
||||||
|
"@lumeweb/relay": "https://github.com/LumeWeb/relay.git"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
import type {Plugin, PluginAPI} from "@lumeweb/relay";
|
||||||
|
import {RPCResponse} from "@lumeweb/relay";
|
||||||
|
|
||||||
|
const plugin: Plugin = {
|
||||||
|
name: "core",
|
||||||
|
async plugin(api: PluginAPI): Promise<void> {
|
||||||
|
api.registerMethod("ping", {
|
||||||
|
cacheable: false,
|
||||||
|
handler: async (): Promise<RPCResponse | null> => {
|
||||||
|
return {
|
||||||
|
data: "pong"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
api.registerMethod("ping", {
|
||||||
|
cacheable: false,
|
||||||
|
handler: async (): Promise<RPCResponse | null> => {
|
||||||
|
return {
|
||||||
|
data: api.getMethods()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default plugin;
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2020",
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"rootDir": "src",
|
||||||
|
"outDir": "dist",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"resolveJsonModule": true
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue