Comparing version 3.0.0 to 3.0.1
@@ -31,6 +31,7 @@ "use strict"; | ||
} | ||
}).then(res => res.json()); | ||
}); | ||
} | ||
methodFactory(method) { | ||
return (params) => this.post(this.centOptions.url, JSON.stringify({ method, params })) | ||
.then(res => res.json()) | ||
.then(res => res === null || res === void 0 ? void 0 : res.result) | ||
@@ -42,6 +43,7 @@ .catch(err => { | ||
pipeline(commands) { | ||
return this.post('', commands.map(({ method, params }) => JSON.stringify({ method, params })).join('\n')) | ||
.then(res => res.data | ||
return this.post(this.centOptions.url, commands.map(({ method, params }) => JSON.stringify({ method, params })).join('\n')) | ||
.then(res => res.text()) | ||
.then(res => res | ||
.split('\n') | ||
.map(JSON.parse) | ||
.map(str => JSON.parse(str)) | ||
.map(({ result }) => result)) | ||
@@ -48,0 +50,0 @@ .catch(err => { |
{ | ||
"name": "cent.js", | ||
"description": "Javascript library to communicate with Centrifugo HTTP API", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "build": "rimraf -rf dist && tsc -p tsconfig.json", |
Sorry, the diff of this file is not supported yet
17530
386