@openfeed/sdk-js 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [1.1.3](https://github.com/openfeed-org/sdk-js/compare/1.1.2...1.1.3) (2023-12-20)
6
+
7
+ ### [1.1.2](https://github.com/openfeed-org/sdk-js/compare/1.1.1...1.1.2) (2023-12-20)
8
+
9
+ ### [1.1.1](https://github.com/openfeed-org/sdk-js/compare/v1.1.0...v1.1.1) (2023-12-20)
10
+
11
+ ## [1.1.0](https://github.com/openfeed-org/sdk-js/compare/v1.0.5...v1.1.0) (2023-12-20)
12
+
13
+
14
+ ### Features
15
+
16
+ * update proto files and regenerate ts with newest changes ([1b5ec30](https://github.com/openfeed-org/sdk-js/commit/1b5ec30c42dab7659ab3531d23d4eeeb110a1465))
17
+
18
+ ### [1.0.5](https://github.com/openfeed-org/sdk-js/compare/v1.0.4...v1.0.5) (2023-12-20)
19
+
20
+ ### [1.0.4](https://github.com/openfeed-org/sdk-js/compare/v1.0.3...v1.0.4) (2023-12-20)
21
+
22
+ ### [1.0.3](https://github.com/openfeed-org/sdk-js/compare/v1.0.2...v1.0.3) (2023-12-20)
23
+
24
+ ### [1.0.2](https://github.com/openfeed-org/sdk-js/compare/v1.0.1...v1.0.2) (2023-12-20)
25
+
26
+ ### 1.0.1 (2023-12-20)
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [1.1.4](https://github.com/openfeed-org/sdk-js/compare/1.1.3...1.1.4) (2023-12-21)
package/CHANGELOG.md CHANGED
@@ -2,25 +2,9 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [1.1.3](https://github.com/openfeed-org/sdk-js/compare/1.1.2...1.1.3) (2023-12-20)
5
+ ### [1.1.5](https://github.com/openfeed-org/sdk-js/compare/1.1.4...1.1.5) (2023-12-22)
6
6
 
7
- ### [1.1.2](https://github.com/openfeed-org/sdk-js/compare/1.1.1...1.1.2) (2023-12-20)
8
7
 
9
- ### [1.1.1](https://github.com/openfeed-org/sdk-js/compare/v1.1.0...v1.1.1) (2023-12-20)
8
+ ### Bug Fixes
10
9
 
11
- ## [1.1.0](https://github.com/openfeed-org/sdk-js/compare/v1.0.5...v1.1.0) (2023-12-20)
12
-
13
-
14
- ### Features
15
-
16
- * update proto files and regenerate ts with newest changes ([1b5ec30](https://github.com/openfeed-org/sdk-js/commit/1b5ec30c42dab7659ab3531d23d4eeeb110a1465))
17
-
18
- ### [1.0.5](https://github.com/openfeed-org/sdk-js/compare/v1.0.4...v1.0.5) (2023-12-20)
19
-
20
- ### [1.0.4](https://github.com/openfeed-org/sdk-js/compare/v1.0.3...v1.0.4) (2023-12-20)
21
-
22
- ### [1.0.3](https://github.com/openfeed-org/sdk-js/compare/v1.0.2...v1.0.3) (2023-12-20)
23
-
24
- ### [1.0.2](https://github.com/openfeed-org/sdk-js/compare/v1.0.1...v1.0.2) (2023-12-20)
25
-
26
- ### 1.0.1 (2023-12-20)
10
+ * new approach for listening to alias changes ([69f2d7d](https://github.com/openfeed-org/sdk-js/commit/69f2d7d6e5b64d7abeb6c6cda052c6e7f512aef3))
package/README.md CHANGED
@@ -30,7 +30,7 @@ For updating the version and automatically collecting changes, run:
30
30
 
31
31
  ```shell
32
32
  yarn build:prepare-release
33
- git push --follow-tags
33
+ git push --follow-tags origin master
34
34
  ```
35
35
 
36
36
  ### Updating the Dependencies
@@ -1 +1 @@
1
- export declare const version = "1.1.3";
1
+ export declare const version = "1.1.5";
package/dist/index.js CHANGED
@@ -8031,7 +8031,7 @@ class ResolutionSource {
8031
8031
  return this.onError;
8032
8032
  }
8033
8033
  }
8034
- const version = "1.1.3";
8034
+ const version = "1.1.5";
8035
8035
  const send = (socket, message) => {
8036
8036
  socket.send(OpenfeedGatewayRequestEncode.encode(toT(message)).finish());
8037
8037
  };
@@ -8599,6 +8599,7 @@ class OpenFeedListeners {
8599
8599
  __publicField(this, "instrumentBySymbol", /* @__PURE__ */ new Map());
8600
8600
  __publicField(this, "instrumentByMarketId", /* @__PURE__ */ new Map());
8601
8601
  __publicField(this, "addDetails", (message) => {
8602
+ var _a, _b, _c;
8602
8603
  let def;
8603
8604
  let symbols;
8604
8605
  const getInstrumentDefinition = (marketId) => {
@@ -8617,11 +8618,30 @@ class OpenFeedListeners {
8617
8618
  }
8618
8619
  } else if (message.instrumentDefinition) {
8619
8620
  [def, symbols] = getInstrumentDefinition(message.instrumentDefinition.marketId);
8621
+ const { instrumentDefinition } = message;
8620
8622
  this.instrumentByMarketId.set(message.instrumentDefinition.marketId.toString(), [message.instrumentDefinition, symbols]);
8621
- this.instrumentBySymbol.set(message.instrumentDefinition.symbol, message.instrumentDefinition);
8622
- } else if (message.instrumentAction)
8623
- ;
8624
- else {
8623
+ this.instrumentBySymbol.set(message.instrumentDefinition.symbol, instrumentDefinition);
8624
+ symbols == null ? void 0 : symbols.forEach((s) => this.instrumentBySymbol.set(s, instrumentDefinition));
8625
+ } else if (message.instrumentAction) {
8626
+ const { marketId } = ((_a = message.instrumentAction) == null ? void 0 : _a.instrument) ?? {};
8627
+ if (message.instrumentAction.action === ActionType.ALIAS_CHANGED && marketId) {
8628
+ [def, symbols] = getInstrumentDefinition(marketId);
8629
+ const newSymbols = (symbols == null ? void 0 : symbols.filter((s) => !s.includes("*"))) ?? [];
8630
+ if (!newSymbols.length) {
8631
+ this.instrumentByMarketId.delete(marketId.toString());
8632
+ } else {
8633
+ this.instrumentByMarketId.set(marketId.toString(), [def, newSymbols]);
8634
+ }
8635
+ }
8636
+ if (message.instrumentAction.action === ActionType.EXCHANGE_MOVE && marketId) {
8637
+ [def, symbols] = getInstrumentDefinition(marketId);
8638
+ this.instrumentByMarketId.delete(marketId.toString());
8639
+ const newMarketId = (_c = (_b = message.instrumentAction.newInstrument) == null ? void 0 : _b.marketId) == null ? void 0 : _c.toString();
8640
+ if (newMarketId) {
8641
+ this.instrumentByMarketId.set(newMarketId, [def, symbols]);
8642
+ }
8643
+ }
8644
+ } else {
8625
8645
  for (const getter of IDGetters) {
8626
8646
  const id = getter(message);
8627
8647
  if (id !== void 0) {
package/dist/node.js CHANGED
@@ -11655,7 +11655,7 @@ var ResolutionSource = class {
11655
11655
  };
11656
11656
 
11657
11657
  // generated/version.ts
11658
- var version = "1.1.3";
11658
+ var version = "1.1.5";
11659
11659
 
11660
11660
  // src/connection/connection.ts
11661
11661
  var send = (socket, message) => {
@@ -12228,6 +12228,7 @@ var OpenFeedListeners = class {
12228
12228
  this.onMessage = this.addDetails;
12229
12229
  }
12230
12230
  addDetails = (message) => {
12231
+ var _a, _b, _c;
12231
12232
  let def;
12232
12233
  let symbols;
12233
12234
  const getInstrumentDefinition = (marketId) => {
@@ -12246,9 +12247,29 @@ var OpenFeedListeners = class {
12246
12247
  }
12247
12248
  } else if (message.instrumentDefinition) {
12248
12249
  [def, symbols] = getInstrumentDefinition(message.instrumentDefinition.marketId);
12250
+ const { instrumentDefinition } = message;
12249
12251
  this.instrumentByMarketId.set(message.instrumentDefinition.marketId.toString(), [message.instrumentDefinition, symbols]);
12250
- this.instrumentBySymbol.set(message.instrumentDefinition.symbol, message.instrumentDefinition);
12252
+ this.instrumentBySymbol.set(message.instrumentDefinition.symbol, instrumentDefinition);
12253
+ symbols == null ? void 0 : symbols.forEach((s) => this.instrumentBySymbol.set(s, instrumentDefinition));
12251
12254
  } else if (message.instrumentAction) {
12255
+ const { marketId } = ((_a = message.instrumentAction) == null ? void 0 : _a.instrument) ?? {};
12256
+ if (message.instrumentAction.action === 4 /* ALIAS_CHANGED */ && marketId) {
12257
+ [def, symbols] = getInstrumentDefinition(marketId);
12258
+ const newSymbols = (symbols == null ? void 0 : symbols.filter((s) => !s.includes("*"))) ?? [];
12259
+ if (!newSymbols.length) {
12260
+ this.instrumentByMarketId.delete(marketId.toString());
12261
+ } else {
12262
+ this.instrumentByMarketId.set(marketId.toString(), [def, newSymbols]);
12263
+ }
12264
+ }
12265
+ if (message.instrumentAction.action === 3 /* EXCHANGE_MOVE */ && marketId) {
12266
+ [def, symbols] = getInstrumentDefinition(marketId);
12267
+ this.instrumentByMarketId.delete(marketId.toString());
12268
+ const newMarketId = (_c = (_b = message.instrumentAction.newInstrument) == null ? void 0 : _b.marketId) == null ? void 0 : _c.toString();
12269
+ if (newMarketId) {
12270
+ this.instrumentByMarketId.set(newMarketId, [def, symbols]);
12271
+ }
12272
+ }
12252
12273
  } else {
12253
12274
  for (const getter of IDGetters) {
12254
12275
  const id = getter(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfeed/sdk-js",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "JavaScript SDK for Barchart OpenFeed",
5
5
  "main": "dist/node.js",
6
6
  "browser": "dist/index.js",
@@ -63,5 +63,11 @@
63
63
  "*.md",
64
64
  "LICENSE",
65
65
  "tsconfig.json"
66
- ]
66
+ ],
67
+ "standard-version": {
68
+ "scripts": {
69
+ "prechangelog": "node -e \"const fs = require('fs'), path = require('path'); const version = JSON.parse(fs.readFileSync('package.json')).version; fs.mkdirSync('.releases', { recursive: true }); fs.renameSync('CHANGELOG.md', path.join('.releases', 'CHANGELOG-' + version + '.md'));\"",
70
+ "postcommit": "git add .releases/CHANGELOG-*.md && git commit --amend --no-edit"
71
+ }
72
+ }
67
73
  }