@arifwidianto/rpc-agent
Version:
RPC Agent for both client and server, extends more methods easily
31 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.schema = void 0;
exports.schema = {
echo: {
input: {
message: {
type: "string",
description: "Message to echo back",
required: true,
minLength: 1,
maxLength: 1000,
},
},
output: {
message: {
type: "string",
description: "Echoed message",
},
timestamp: {
type: "string",
description: "ISO 8601 timestamp of when the message was echoed",
},
},
example: {
shell: `echo '{"jsonrpc":"2.0","method":"echo.echo","params":{"message":"Hello, World!"},"id":1}' | nc --tcp localhost 9101`,
node: `node -e "const net = require('net'); const client = new net.Socket(); client.connect(9101, 'localhost', () => { client.write(JSON.stringify({jsonrpc: '2.0', method: 'echo.echo', params: {message: 'Hello, World!'}, id: Date.now()}) + '\\n'); }); client.on('data', (data) => { console.log(data.toString()); client.destroy(); });"`,
},
},
};
//# sourceMappingURL=schema.js.map