Comparing version 3.1.4-5d9830f.0 to 3.1.4-8cfe8c1.0
{ | ||
"name": "demux", | ||
"version": "3.1.4-5d9830f.0", | ||
"version": "3.1.4-8cfe8c1.0", | ||
"author": { | ||
@@ -14,2 +14,3 @@ "name": "Julien Heller", | ||
"devDependencies": { | ||
"@blockone/tslint-config-blockone": "^1.0.0", | ||
"@types/bunyan": "^1.8.5", | ||
@@ -22,4 +23,5 @@ "@types/jest": "^23.1.4", | ||
"eslint-plugin-import": "^2.7.0", | ||
"jest": "^22.4.3", | ||
"jest": "^23.6.0", | ||
"release-it": "^7.5.0", | ||
"supertest": "^3.4.1", | ||
"ts-jest": "^23.0.0", | ||
@@ -35,6 +37,7 @@ "tslint": "^5.10.0", | ||
"watch": "tsc -w", | ||
"example": "./run-example.sh", | ||
"example": "./scripts/run-example.sh", | ||
"lint": "tslint -c tslint.json -p tsconfig.json", | ||
"test": "jest", | ||
"build-docs": "./build-docs.sh" | ||
"test": "jest --detectOpenHandles --maxWorkers=2", | ||
"build-docs": "./scripts/build-docs.sh", | ||
"current-version": "echo $npm_package_version" | ||
}, | ||
@@ -59,4 +62,7 @@ "jest": { | ||
"dependencies": { | ||
"bunyan": "^1.8.12" | ||
"@types/express": "^4.16.0", | ||
"@types/supertest": "^2.0.7", | ||
"bunyan": "^1.8.12", | ||
"express": "^4.16.4" | ||
} | ||
} |
@@ -86,2 +86,4 @@ # demux-js [![Build Status](https://travis-ci.org/EOSIO/demux-js.svg?branch=develop)](https://travis-ci.org/EOSIO/demux-js) | ||
* [**`ExpressActionWatcher`**](https://eosio.github.io/demux-js/classes/expressactionwatcher.html): Exposes the API methods from the BaseActionWatcher through an Express server | ||
In order to process actions, we need the following things: | ||
@@ -95,9 +97,46 @@ | ||
- Instantiate the implemented `AbstractActionReader` with any needed configuration | ||
- Instantiate the implemented `AbstractActionHandler`, passing in the `HandlerVersion` and any other needed configuration | ||
- Instantiate the implemented `AbstractActionReader` with any needed configuration | ||
- Instantiate a `BaseActionWatcher`, passing in the above Handler and Reader instances | ||
- Call `watch()` on the Watcher | ||
- Instantiate the `BaseActionWatcher` (or a subclass), passing in the Action Handler and Action Watcher instances | ||
- Start indexing via the Action Watcher's `watch()` method (by either calling it directly or otherwise) | ||
#### Example | ||
```javascript | ||
const { BaseActionWatcher, ExpressActionWatcher } = require("demux") | ||
const { MyActionReader } = require("./MyActionReader") | ||
const { MyActionHandler } = require("./MyActionHandler") | ||
const { handlerVersions } = require("./handlerVersions") | ||
const { readerConfig, handlerConfig, pollInterval, portNumber } = require("./config") | ||
const actionReader = new MyActionReader(readerConfig) | ||
const actioHandler = new MyActionHandler(handlerVersions, handlerConfig) | ||
``` | ||
Then, either | ||
```javascript | ||
const watcher = new BaseActionWatcher( | ||
actionReader, | ||
actionHandler, | ||
pollInterval, | ||
) | ||
watcher.watch() | ||
``` | ||
Or, | ||
```javascript | ||
const expressWatcher = new ExpressActionWatcher( | ||
actionReader, | ||
actionHandler, | ||
pollInterval, | ||
portNumber, | ||
) | ||
expressWatcher.listen() | ||
// You can then make a POST request to `/start` on your configured endpoint | ||
``` | ||
### [**API documentation**](https://eosio.github.io/demux-js/) | ||
### [Learn from a full example](examples/eos-transfers) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
17
1304
141
64491
4
16
+ Added@types/express@^4.16.0
+ Added@types/supertest@^2.0.7
+ Addedexpress@^4.16.4
+ Added@types/body-parser@1.19.5(transitive)
+ Added@types/connect@3.4.38(transitive)
+ Added@types/cookiejar@2.1.5(transitive)
+ Added@types/express@4.17.21(transitive)
+ Added@types/express-serve-static-core@4.19.6(transitive)
+ Added@types/http-errors@2.0.4(transitive)
+ Added@types/methods@1.1.4(transitive)
+ Added@types/mime@1.3.5(transitive)
+ Added@types/node@22.9.3(transitive)
+ Added@types/qs@6.9.17(transitive)
+ Added@types/range-parser@1.2.7(transitive)
+ Added@types/send@0.17.4(transitive)
+ Added@types/serve-static@1.15.7(transitive)
+ Added@types/superagent@8.1.9(transitive)
+ Added@types/supertest@2.0.16(transitive)
+ Addedaccepts@1.3.8(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.7.1(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedexpress@4.21.1(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.3(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.0.02.1.3(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.10(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvary@1.1.2(transitive)