Skip to content

Commit

Permalink
Compatibility with latest fbp-protocol schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Sep 1, 2020
1 parent c3cfcf4 commit ffba219
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -107,6 +107,8 @@ It is possible to see the internal workings of the library by setting the `DEBUG

## Changes

* 0.4.1 (2020-09-01)
- Updated fbp-protocol schemas to the latest versions
* 0.4.0 (2019-02-26)
- `graph.properties.project` is no longer sent as the graph's "library identifier"
* 0.3.3 (2018-04-06)
Expand Down
8 changes: 5 additions & 3 deletions lib/client.js
Expand Up @@ -153,12 +153,14 @@ class FbpClient extends EventEmitter {
const commands = {};
Object.keys(schemas[protocol].input).forEach((command) => {
commands[command] = (payload = {}) => {
const withSecret = payload;
withSecret.secret = this.definition.secret;
const withSecret = {
...payload,
secret: this.definition.secret,
};
return this.validate(`/${protocol}/${schemas[protocol].input[command].id}`, {
protocol,
command,
payload: withSecret,
payload,
})
.then(() => new Promise((resolve, reject) => {
if (!this.adapter) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "fbp-client",
"version": "0.4.0",
"version": "0.4.1",
"description": "Higher-level client library for the FBP protocol",
"main": "lib/client.js",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"dependencies": {
"ajv": "^5.0.0",
"debug": "^3.1.0",
"fbp-protocol": "^0.9.2",
"fbp-protocol": "^0.9.7",
"fbp-protocol-client": "^0.2.3"
},
"devDependencies": {
Expand Down

0 comments on commit ffba219

Please sign in to comment.