Use json-rpc-peer & json-rpc-protocol instead of deprecated @julien-f/json-rpc.
This commit is contained in:
parent
f839e76f4b
commit
206dfeb879
@ -28,7 +28,6 @@
|
||||
"url": "git://github.com/vatesfr/xo-server.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@julien-f/json-rpc": "^0.4.4",
|
||||
"@julien-f/unzip": "^0.2.1",
|
||||
"app-conf": "^0.3.4",
|
||||
"babel-runtime": "^5",
|
||||
@ -47,6 +46,8 @@
|
||||
"http-server-plus": "^0.5.1",
|
||||
"human-format": "^0.3.0",
|
||||
"js-yaml": "^3.2.7",
|
||||
"json-rpc-peer": "^0.9.2",
|
||||
"json-rpc-protocol": "^0.9.0",
|
||||
"lodash.assign": "^3.0.0",
|
||||
"lodash.bind": "^3.0.0",
|
||||
"lodash.clone": "^3.0.1",
|
||||
|
@ -1,9 +1,14 @@
|
||||
import {JsonRpcError} from '@julien-f/json-rpc/errors'
|
||||
import {JsonRpcError} from 'json-rpc-protocol'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// Export standard JSON-RPC errors.
|
||||
export * from '@julien-f/json-rpc/errors'
|
||||
export {
|
||||
InvalidJson,
|
||||
InvalidParameters,
|
||||
InvalidRequest,
|
||||
MethodNotFound
|
||||
} from 'json-rpc-protocol'
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
@ -26,7 +26,7 @@ import {
|
||||
NoSuchObject,
|
||||
NotImplemented
|
||||
} from './api-errors'
|
||||
import {createPeer as createJsonRpcPeer} from '@julien-f/json-rpc'
|
||||
import JsonRpcPeer from 'json-rpc-peer'
|
||||
import {readFile} from 'fs-promise'
|
||||
|
||||
import Api from './api'
|
||||
@ -254,7 +254,7 @@ const setUpApi = (webServer, xo) => {
|
||||
})
|
||||
|
||||
// Create the JSON-RPC server for this connection.
|
||||
const jsonRpc = createJsonRpcPeer(message => {
|
||||
const jsonRpc = new JsonRpcPeer(message => {
|
||||
if (message.type === 'request') {
|
||||
return api.call(connection, message.method, message.params)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user