diff --git a/package.json b/package.json index a70179cdf..e574f5d8d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/api-errors.js b/src/api-errors.js index d4821b7d4..cf1263ccc 100644 --- a/src/api-errors.js +++ b/src/api-errors.js @@ -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' // ------------------------------------------------------------------- diff --git a/src/index.js b/src/index.js index f89213417..bd5564e5c 100644 --- a/src/index.js +++ b/src/index.js @@ -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) }