Skip to content

Commit

Permalink
Fix index parameter for WatchlistGateway.addSymbol and update `uu…
Browse files Browse the repository at this point in the history
…id` package
  • Loading branch information
bryaningl3 committed Apr 17, 2024
1 parent f690b10 commit d178d0f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 0.2
phases:
install:
runtime-versions:
nodejs: 12.x
nodejs: 20.x

pre_build:
commands:
Expand Down
8 changes: 8 additions & 0 deletions docs/content/releases/8.5.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**Bug Fixes**

* Corrected `WatchlistGateway.addSymbol` function — the `index` parameter is now obeyed.

**Technical Enhancements**

* Updated the [`uuid`](https://github.com/uuidjs/uuid) package to the next major version.
* Updated AWS CodeBuild integration to use Node.js version 20.
10 changes: 9 additions & 1 deletion lib/gateway/WatchlistGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,15 @@ module.exports = (() => {
.withLiteralParameter('symbols', 'symbols')
)
.withBodyBuilder((bb) => {
bb.withDelegateParameter('Description', 'body', (b) => ({ entry: b.entry }));
bb.withDelegateParameter('Description', 'body', (b) => {
const payload = { entry: b.entry };

if (is.number(b.index)) {
payload.index = b.index;
}

return payload;
});
})
.withHeadersBuilder((hb) => {
hb.withLiteralParameter('X-Barchart-Client-ID', 'X-Barchart-Client-ID', this._clientId);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"dependencies": {
"@barchart/common-js": "^4.9.0",
"uuid": "^8.3.2"
"uuid": "^9.0.1"
},
"devDependencies": {
"@babel/core": "^7.11.1",
Expand Down

0 comments on commit d178d0f

Please sign in to comment.