@openfeed/sdk-js 0.2.0 → 1.0.1

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.
package/CHANGELOG.md ADDED
@@ -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.0.1 (2023-12-20)
package/README.md CHANGED
@@ -2,18 +2,22 @@
2
2
 
3
3
  TypeScript and JavaScript SDK for Barchart OpenFeed is a library that can be used to subscribe to market data messages served by the Barchart [OpenFeed](https://openfeed.com/) servers.
4
4
 
5
+ ## Development
6
+
7
+ This library uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for clarity, tracking changes and versioning. It's recommended to install [Conventional Commits Extension for VS Code](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) when contributing to the library.
8
+
5
9
  ## Obtaining the Library
6
10
 
7
11
  Using npm:
8
12
 
9
13
  ```shell
10
- $ npm i --save <TBD>
14
+ $ npm i --save @openfeed/sdk-js
11
15
  ```
12
16
 
13
17
  Using yarn:
14
18
 
15
19
  ```shell
16
- $ yarn add <TBD>
20
+ $ yarn add @openfeed/sdk-js
17
21
  ```
18
22
 
19
23
  ## User Guide
@@ -1 +1 @@
1
- export declare const version = "0.2.0";
1
+ export declare const version = "1.0.1";
package/dist/index.js CHANGED
@@ -8029,7 +8029,7 @@ class ResolutionSource {
8029
8029
  return this.onError;
8030
8030
  }
8031
8031
  }
8032
- const version = "0.2.0";
8032
+ const version = "1.0.1";
8033
8033
  const send = (socket, message) => {
8034
8034
  socket.send(OpenfeedGatewayRequestEncode.encode(toT(message)).finish());
8035
8035
  };
package/dist/node.js CHANGED
@@ -11653,7 +11653,7 @@ var ResolutionSource = class {
11653
11653
  };
11654
11654
 
11655
11655
  // generated/version.ts
11656
- var version = "0.2.0";
11656
+ var version = "1.0.1";
11657
11657
 
11658
11658
  // src/connection/connection.ts
11659
11659
  var send = (socket, message) => {
@@ -1,36 +1,8 @@
1
- import WebSocket from "isomorphic-ws";
2
1
  import Long from "long";
3
- import type { ExchangeResponse_Exchange, InstrumentReferenceResponse, SubscriptionType } from "@gen/openfeed_api";
4
- import type { InstrumentDefinition } from "@gen/openfeed_instrument";
2
+ import type { SubscriptionType } from "@gen/openfeed_api";
5
3
  import type { Service } from "@gen/openfeed";
6
- import { IOpenFeedClient, IOpenFeedConnection, IOpenFeedLogger, OpenFeedInstrumentReferenceRequest, OpenFeedInstrumentRequest } from "./connection_interfaces";
4
+ import { IOpenFeedClient, IOpenFeedConnection, IOpenFeedLogger } from "./connection_interfaces";
7
5
  import { OpenFeedListeners } from "./listeners";
8
- declare class OpenFeedConnection implements IOpenFeedConnection {
9
- private readonly connectionToken;
10
- private readonly socket;
11
- private readonly listeners;
12
- private readonly logger?;
13
- private readonly subscriptions;
14
- private readonly exchangeRequests;
15
- private readonly instrumentRequests;
16
- private readonly definitionsInFlight;
17
- private readonly instrumentReferenceRequests;
18
- private readonly whenDisconnectedSource;
19
- constructor(connectionToken: string, socket: WebSocket, listeners: OpenFeedListeners, logger?: IOpenFeedLogger | undefined);
20
- private messageTriggered;
21
- private runConnectionWatchLoop;
22
- private onMessage;
23
- private disconnect;
24
- private onError;
25
- private onClose;
26
- subscribe: (service: Service, subscriptionType: SubscriptionType, snapshotIntervalSeconds: number, symbols?: string[] | null, marketIds?: Long[] | null, exchanges?: string[] | null, channels?: number[] | null) => Long;
27
- unsubscribe: (subscriptionId: Long) => void;
28
- getExchanges: () => Promise<ExchangeResponse_Exchange[]>;
29
- getInstrument: (request: OpenFeedInstrumentRequest) => Promise<InstrumentDefinition[]>;
30
- getInstrumentReference: (request: OpenFeedInstrumentReferenceRequest) => Promise<InstrumentReferenceResponse>;
31
- whenDisconnected: () => Promise<void>;
32
- dispose: () => void;
33
- }
34
6
  export declare class OpenFeedClient implements IOpenFeedClient {
35
7
  private readonly url;
36
8
  private readonly username;
@@ -55,7 +27,6 @@ export declare class OpenFeedClient implements IOpenFeedClient {
55
27
  private runSubscribeLoop;
56
28
  subscribe: (service: Service, subscriptionType: SubscriptionType, snapshotIntervalSeconds: number, symbols?: string[] | null, marketIds?: Long[] | null, exchanges?: string[] | null, channels?: number[] | null) => Long;
57
29
  unsubscribe: (subscriptionId: Long) => void;
58
- get connection(): Promise<OpenFeedConnection>;
30
+ get connection(): Promise<IOpenFeedConnection>;
59
31
  dispose: () => void;
60
32
  }
61
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfeed/sdk-js",
3
- "version": "0.2.0",
3
+ "version": "1.0.1",
4
4
  "description": "JavaScript SDK for Barchart OpenFeed",
5
5
  "main": "dist/node.js",
6
6
  "browser": "dist/index.js",
@@ -10,6 +10,7 @@
10
10
  "author": "Dejan Maksimovic <maximovic.d@gmail.com>",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
+ "prepare": "husky install",
13
14
  "generate:proto": "cd node_modules\\proto && ..\\..\\protoc --plugin=..\\..\\node_modules\\.bin\\protoc-gen-ts_proto --ts_proto_opt=outputJsonMethods=false --ts_proto_opt=outputPartialMethods=false --ts_proto_opt=exportCommonSymbols=false --ts_proto_opt=esModuleInterop=true --ts_proto_opt=forceLong=long --ts_proto_opt=useExactTypes=false --ts_proto_out=../../generated *.proto",
14
15
  "generate:version": "genversion --es6 -s -d ./generated/version.ts",
15
16
  "generate:process": "tsx ./scripts/process.ts",
@@ -18,10 +19,14 @@
18
19
  "build:node": "esbuild --bundle --outfile=dist/node.js --platform=node --target=node16 --format=esm --banner:js=\"import { createRequire } from 'module';const require = createRequire(import.meta.url);\" src/index.ts",
19
20
  "build:ts": "yarn generate:version && vite build",
20
21
  "build:types": "tsc -p tsconfig.types.json",
22
+ "build:test-release": "standard-version --dry-run",
23
+ "build:prepare-release": "standard-version",
21
24
  "run:browser": "yarn generate:version && vite dev",
22
25
  "run:node": "yarn generate:version && tsx ./src/test.ts"
23
26
  },
24
27
  "devDependencies": {
28
+ "@commitlint/cli": "^18.4.3",
29
+ "@commitlint/config-conventional": "^18.4.3",
25
30
  "@types/jest": "^29.5.4",
26
31
  "@types/node": "^20.5.6",
27
32
  "@types/ws": "^8.5.5",
@@ -35,9 +40,11 @@
35
40
  "eslint-plugin-prettier": "^5.0.0",
36
41
  "genversion": "^3.1.1",
37
42
  "google-protobuf": "^3.21.2",
43
+ "husky": "^8.0.0",
38
44
  "jest": "^29.6.4",
39
45
  "prettier": "^3.0.2",
40
46
  "proto": "git+ssh://git@github.com/openfeed-org/proto.git#master",
47
+ "standard-version": "^9.5.0",
41
48
  "ts-jest": "^29.1.1",
42
49
  "ts-proto": "^1.156.7",
43
50
  "tsx": "^3.12.7",