*Initial version

This commit is contained in:
Derrick Hammer 2022-08-26 22:43:23 -04:00
parent 92b6c6f7cc
commit 7a13fcee41
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
4 changed files with 51 additions and 1 deletions

View File

@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal

8
package.json Normal file
View File

@ -0,0 +1,8 @@
{
"name": "@lumeweb/relay-plugins-core",
"type": "module",
"version": "0.1.0",
"devDependencies": {
"@lumeweb/relay": "https://github.com/LumeWeb/relay.git"
}
}

28
src/index.ts Normal file
View File

@ -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;

14
tsconfig.json Normal file
View File

@ -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
}
}