Compare commits

..

5 Commits

Author SHA1 Message Date
Nicolas Dextraze
80f2e7e50f Merge branch 'release-22.10' 2023-01-30 16:17:53 -05:00
Nicolas Dextraze
9bbc961d52 version 22.10.0 2023-01-30 16:17:22 -05:00
Nicolas Dextraze
3a2e30281f Merge branch 'release-22.10' 2023-01-30 15:42:07 -05:00
Nicolas Dextraze
a48e4fa386 compatibility for 22.x 2023-01-30 15:37:10 -05:00
Nicolas Dextraze
c422057f5f start with release-21.10 code changes 2023-01-30 15:08:59 -05:00
24 changed files with 18688 additions and 11559 deletions

1
.gitignore vendored
View File

@ -34,6 +34,7 @@ node_modules
# InteliJ # InteliJ
.idea/workspace.xml .idea/workspace.xml
.idea/shelf
.vscode .vscode
lib/ lib/

View File

@ -24,14 +24,22 @@ If you want to learn more about EventSourcing/EventModeling, you can join one of
Install using `npm install node-eventstore-client` Install using `npm install node-eventstore-client`
Versions to install to match EventStore versions:
- 0.1.x for ES prior to 3.9.4
- 0.2.x for ES from 3.9.4 to 5.x
- 20.10.x for ES 20.10 LTS
- 21.10.x for ES 21.10 LTS
- 22.10.x for ES 22.10 LTS
### Dependencies ### Dependencies
- Node.js >= 4.0 - Node.js >= 14
- Modules: [long](https://www.npmjs.org/package/long), [protobufjs](https://www.npmjs.org/package/protobufjs), [uuid](https://www.npmjs.org/package/uuid), [strict-event-emitter-types](https://www.npmjs.com/package/strict-event-emitter-types) (installed via `npm install`) - Modules: [long](https://www.npmjs.org/package/long), [protobufjs](https://www.npmjs.org/package/protobufjs), [uuid](https://www.npmjs.org/package/uuid), [strict-event-emitter-types](https://www.npmjs.com/package/strict-event-emitter-types) (installed via `npm install`)
### Install and run an Eventstore on localhost ### Install and run an Eventstore on localhost
See https://eventstore.org/docs/introduction/4.1.0/ See https://eventstore.com
*Note: If you are using a version of EventStore prior to 3.9.4, you need to use version 0.1.x of this package `npm install node-eventstore-client@^0.1`.* *Note: If you are using a version of EventStore prior to 3.9.4, you need to use version 0.1.x of this package `npm install node-eventstore-client@^0.1`.*

View File

@ -2,7 +2,7 @@ version: '3.7'
services: services:
eventstore1: eventstore1:
image: eventstore/eventstore:20.10.5-buster-slim image: eventstore/eventstore:22.10.0-buster-slim
environment: environment:
- EVENTSTORE_CLUSTER_SIZE=3 - EVENTSTORE_CLUSTER_SIZE=3
- EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local - EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local
@ -40,7 +40,7 @@ services:
- ./certs:/etc/eventstore/certs:ro - ./certs:/etc/eventstore/certs:ro
eventstore2: eventstore2:
image: eventstore/eventstore:20.10.5-buster-slim image: eventstore/eventstore:22.10.0-buster-slim
environment: environment:
- EVENTSTORE_CLUSTER_SIZE=3 - EVENTSTORE_CLUSTER_SIZE=3
- EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local - EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local
@ -74,7 +74,7 @@ services:
- ./certs:/etc/eventstore/certs:ro - ./certs:/etc/eventstore/certs:ro
eventstore3: eventstore3:
image: eventstore/eventstore:20.10.5-buster-slim image: eventstore/eventstore:22.10.0-buster-slim
environment: environment:
- EVENTSTORE_CLUSTER_SIZE=3 - EVENTSTORE_CLUSTER_SIZE=3
- EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local - EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local

View File

@ -2,7 +2,7 @@ version: '3.4'
services: services:
eventstore: eventstore:
image: eventstore/eventstore:20.10.5-buster-slim image: eventstore/eventstore:22.10.0-buster-slim
environment: environment:
- EVENTSTORE_CLUSTER_SIZE=1 - EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All - EVENTSTORE_RUN_PROJECTIONS=All

279
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "node-eventstore-client", "name": "node-eventstore-client",
"version": "20.10.0", "version": "21.10.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -753,27 +753,32 @@
"@protobufjs/aspromise": { "@protobufjs/aspromise": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
"integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
"dev": true
}, },
"@protobufjs/base64": { "@protobufjs/base64": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
"integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
"dev": true
}, },
"@protobufjs/codegen": { "@protobufjs/codegen": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
"integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",
"dev": true
}, },
"@protobufjs/eventemitter": { "@protobufjs/eventemitter": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
"integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",
"dev": true
}, },
"@protobufjs/fetch": { "@protobufjs/fetch": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
"integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
"dev": true,
"requires": { "requires": {
"@protobufjs/aspromise": "^1.1.1", "@protobufjs/aspromise": "^1.1.1",
"@protobufjs/inquire": "^1.1.0" "@protobufjs/inquire": "^1.1.0"
@ -782,27 +787,32 @@
"@protobufjs/float": { "@protobufjs/float": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
"integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
"dev": true
}, },
"@protobufjs/inquire": { "@protobufjs/inquire": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
"integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",
"dev": true
}, },
"@protobufjs/path": { "@protobufjs/path": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
"integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
"dev": true
}, },
"@protobufjs/pool": { "@protobufjs/pool": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
"integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
"dev": true
}, },
"@protobufjs/utf8": { "@protobufjs/utf8": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
"dev": true
}, },
"@sinclair/typebox": { "@sinclair/typebox": {
"version": "0.25.21", "version": "0.25.21",
@ -940,11 +950,6 @@
"integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==",
"dev": true "dev": true
}, },
"@types/long": {
"version": "3.0.32",
"resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz",
"integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA=="
},
"@types/markdown-it": { "@types/markdown-it": {
"version": "12.2.3", "version": "12.2.3",
"resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz",
@ -1163,6 +1168,12 @@
"integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==",
"dev": true "dev": true
}, },
"acorn-jsx": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true
},
"ajv": { "ajv": {
"version": "6.12.6", "version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@ -1880,6 +1891,12 @@
"integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==",
"dev": true "dev": true
}, },
"deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true
},
"deepmerge": { "deepmerge": {
"version": "4.3.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz",
@ -2078,6 +2095,19 @@
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true "dev": true
}, },
"escodegen": {
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
"integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
"dev": true,
"requires": {
"esprima": "^4.0.1",
"estraverse": "^4.2.0",
"esutils": "^2.0.2",
"optionator": "^0.8.1",
"source-map": "~0.6.1"
}
},
"eslint-scope": { "eslint-scope": {
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
@ -2088,12 +2118,29 @@
"estraverse": "^4.1.1" "estraverse": "^4.1.1"
} }
}, },
"eslint-visitor-keys": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
"integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==",
"dev": true
},
"esm": { "esm": {
"version": "3.2.25", "version": "3.2.25",
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
"integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
"dev": true "dev": true
}, },
"espree": {
"version": "9.4.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
"integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
"dev": true,
"requires": {
"acorn": "^8.8.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.3.0"
}
},
"esprima": { "esprima": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
@ -2123,6 +2170,12 @@
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
"dev": true "dev": true
}, },
"esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true
},
"events": { "events": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
@ -2340,6 +2393,12 @@
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"dev": true "dev": true
}, },
"fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true
},
"fb-watchman": { "fb-watchman": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz",
@ -3870,6 +3929,16 @@
"integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
"dev": true "dev": true
}, },
"levn": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
"integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
"dev": true,
"requires": {
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2"
}
},
"lines-and-columns": { "lines-and-columns": {
"version": "1.2.4", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
@ -3977,9 +4046,9 @@
"dev": true "dev": true
}, },
"long": { "long": {
"version": "3.2.0", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
"integrity": "sha512-ZYvPPOMqUwPoDsbJaR10iQJYnMuZhRTvHYl62ErLIEX7RgFlziSBUUvrt3OVfc47QlHHpzPZYP17g3Fv7oeJkg==" "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
}, },
"lru-cache": { "lru-cache": {
"version": "5.1.1", "version": "5.1.1",
@ -4533,6 +4602,12 @@
"require-main-filename": "^2.0.0" "require-main-filename": "^2.0.0"
} }
}, },
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
"wrap-ansi": { "wrap-ansi": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
@ -4659,6 +4734,20 @@
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==",
"dev": true "dev": true
}, },
"optionator": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
"dev": true,
"requires": {
"deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.6",
"levn": "~0.3.0",
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2",
"word-wrap": "~1.2.3"
}
},
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
@ -4826,6 +4915,12 @@
"integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==",
"dev": true "dev": true
}, },
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
"dev": true
},
"pretty-format": { "pretty-format": {
"version": "29.4.1", "version": "29.4.1",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.4.1.tgz", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.4.1.tgz",
@ -4862,9 +4957,10 @@
} }
}, },
"protobufjs": { "protobufjs": {
"version": "6.11.3", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.0.tgz",
"integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", "integrity": "sha512-hYCqTDuII4iJ4stZqiuGCSU8xxWl5JeXYpwARGtn/tWcKCAro6h3WQz+xpsNbXW0UYqpmTQFEyFWO0G0Kjt64g==",
"dev": true,
"requires": { "requires": {
"@protobufjs/aspromise": "^1.1.2", "@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2", "@protobufjs/base64": "^1.1.2",
@ -4876,20 +4972,88 @@
"@protobufjs/path": "^1.1.2", "@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0", "@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0", "@protobufjs/utf8": "^1.1.0",
"@types/long": "^4.0.1",
"@types/node": ">=13.7.0", "@types/node": ">=13.7.0",
"long": "^4.0.0" "long": "^5.0.0"
}
},
"protobufjs-cli": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.0.tgz",
"integrity": "sha512-VXMQn+z3yG2WbN2E+mx5vcyIHF7yJSg2jqyqfxcZLWNOSTqUzSSgAE5vu04/JEpwxTI04JGyrZRDHC36wr04uw==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"escodegen": "^1.13.0",
"espree": "^9.0.0",
"estraverse": "^5.1.0",
"glob": "^8.0.0",
"jsdoc": "^4.0.0",
"minimist": "^1.2.0",
"semver": "^7.1.2",
"tmp": "^0.2.1",
"uglify-js": "^3.7.7"
}, },
"dependencies": { "dependencies": {
"@types/long": { "brace-expansion": {
"version": "4.0.2", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0"
}
}, },
"long": { "estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"dev": true
},
"glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^5.0.1",
"once": "^1.3.0"
}
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
},
"minimatch": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
"dev": true,
"requires": {
"brace-expansion": "^2.0.1"
}
},
"semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
} }
} }
}, },
@ -5075,6 +5239,14 @@
"tough-cookie": "~2.5.0", "tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0", "tunnel-agent": "^0.6.0",
"uuid": "^3.3.2" "uuid": "^3.3.2"
},
"dependencies": {
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
}
} }
}, },
"require-directory": { "require-directory": {
@ -5884,6 +6056,26 @@
"integrity": "sha512-Ynn2Gsp+oCvYScQXeV+cCs7citRDilq0qDXA6tuvFwDgiYyyaq7D5vKUlAPezzZR5NDobc/QMeN6e5guOYmvxg==", "integrity": "sha512-Ynn2Gsp+oCvYScQXeV+cCs7citRDilq0qDXA6tuvFwDgiYyyaq7D5vKUlAPezzZR5NDobc/QMeN6e5guOYmvxg==",
"dev": true "dev": true
}, },
"tmp": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
"integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==",
"dev": true,
"requires": {
"rimraf": "^3.0.0"
},
"dependencies": {
"rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"dev": true,
"requires": {
"glob": "^7.1.3"
}
}
}
},
"tmpl": { "tmpl": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
@ -6005,6 +6197,15 @@
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
"dev": true "dev": true
}, },
"type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
"integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
"dev": true,
"requires": {
"prelude-ls": "~1.1.2"
}
},
"type-detect": { "type-detect": {
"version": "4.0.8", "version": "4.0.8",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
@ -6029,6 +6230,12 @@
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
"dev": true "dev": true
}, },
"uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true
},
"underscore": { "underscore": {
"version": "1.13.6", "version": "1.13.6",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz",
@ -6158,9 +6365,9 @@
"dev": true "dev": true
}, },
"uuid": { "uuid": {
"version": "3.4.0", "version": "9.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg=="
}, },
"v8-compile-cache": { "v8-compile-cache": {
"version": "2.3.0", "version": "2.3.0",
@ -6590,6 +6797,12 @@
"integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==",
"dev": true "dev": true
}, },
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"dev": true
},
"wrap-ansi": { "wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "node-eventstore-client", "name": "node-eventstore-client",
"version": "20.10.0", "version": "22.10.0",
"description": "A port of the EventStore .Net ClientAPI to Node.js", "description": "A port of the EventStore .Net ClientAPI to Node.js",
"main": "index.js", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",
@ -59,17 +59,17 @@
}, },
"homepage": "https://github.com/nicdex/node-eventstore-client#readme", "homepage": "https://github.com/nicdex/node-eventstore-client#readme",
"dependencies": { "dependencies": {
"@types/long": "^3.0.32", "@types/node": ">=14",
"@types/node": ">=5.10", "long": "^5.2.0",
"long": "^3.2.0",
"protobufjs": "^6.8.8",
"strict-event-emitter-types": "^1.2.0", "strict-event-emitter-types": "^1.2.0",
"uuid": "^3.0.1" "uuid": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {
"jest": "^29.4.1", "jest": "^29.4.1",
"jsdoc": "^4.0.0", "jsdoc": "^4.0.0",
"nodeunit": "^0.11.3", "nodeunit": "^0.11.3",
"protobufjs": "^7.2.0",
"protobufjs-cli": "^1.1.0",
"webpack": "^5.75.0", "webpack": "^5.75.0",
"webpack-cli": "^3.3.10" "webpack-cli": "^3.3.10"
} }

View File

@ -37,7 +37,7 @@ AppendToStreamOperation.prototype._createRequestDto = function() {
eventStreamId: this._stream, eventStreamId: this._stream,
expectedVersion: this._expectedVersion, expectedVersion: this._expectedVersion,
events: dtos, events: dtos,
requireMaster: this._requireMaster}); requireLeader: this._requireMaster});
}; };
AppendToStreamOperation.prototype._inspectResponse = function(response) { AppendToStreamOperation.prototype._inspectResponse = function(response) {

View File

@ -24,7 +24,7 @@ util.inherits(CommitTransactionOperation, OperationBase);
CommitTransactionOperation.prototype._createRequestDto = function() { CommitTransactionOperation.prototype._createRequestDto = function() {
return new ClientMessage.TransactionCommit({ return new ClientMessage.TransactionCommit({
transactionId: this._transactionId, transactionId: this._transactionId,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -27,7 +27,7 @@ DeleteStreamOperation.prototype._createRequestDto = function() {
return new ClientMessage.DeleteStream({ return new ClientMessage.DeleteStream({
eventStreamId: this._stream, eventStreamId: this._stream,
expectedVersion: this._expectedVersion, expectedVersion: this._expectedVersion,
requireMaster: this._requireMaster, requireLeader: this._requireMaster,
hardDelete: this._hardDelete hardDelete: this._hardDelete
}); });
}; };

View File

@ -117,9 +117,9 @@ OperationBase.prototype._inspectNotHandled = function(pkg)
case ClientMessage.NotHandled.NotHandledReason.TooBusy: case ClientMessage.NotHandled.NotHandledReason.TooBusy:
return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy"); return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy");
case ClientMessage.NotHandled.NotHandledReason.NotMaster: case ClientMessage.NotHandled.NotHandledReason.NotLeader:
var masterInfo = ClientMessage.NotHandled.MasterInfo.decode(message.additionalInfo); var masterInfo = ClientMessage.NotHandled.LeaderInfo.decode(message.additionalInfo);
return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotMaster", return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotLeader",
{host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort}, {host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort},
{host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort}); {host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort});

View File

@ -29,7 +29,7 @@ ReadAllEventsBackwardOperation.prototype._createRequestDto = function() {
preparePosition: this._position.preparePosition, preparePosition: this._position.preparePosition,
maxCount: this._maxCount, maxCount: this._maxCount,
resolveLinkTos: this._resolveLinkTos, resolveLinkTos: this._resolveLinkTos,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -29,7 +29,7 @@ ReadAllEventsForwardOperation.prototype._createRequestDto = function() {
preparePosition: this._position.preparePosition, preparePosition: this._position.preparePosition,
maxCount: this._maxCount, maxCount: this._maxCount,
resolveLinkTos: this._resolveLinkTos, resolveLinkTos: this._resolveLinkTos,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -25,7 +25,7 @@ ReadEventOperation.prototype._createRequestDto = function() {
eventStreamId: this._stream, eventStreamId: this._stream,
eventNumber: this._eventNumber, eventNumber: this._eventNumber,
resolveLinkTos: this._resolveLinkTos, resolveLinkTos: this._resolveLinkTos,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -31,7 +31,7 @@ ReadStreamEventsBackwardOperation.prototype._createRequestDto = function() {
fromEventNumber: this._fromEventNumber, fromEventNumber: this._fromEventNumber,
maxCount: this._maxCount, maxCount: this._maxCount,
resolveLinkTos: this._resolveLinkTos, resolveLinkTos: this._resolveLinkTos,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -31,7 +31,7 @@ ReadStreamEventsForwardOperation.prototype._createRequestDto = function() {
fromEventNumber: this._fromEventNumber, fromEventNumber: this._fromEventNumber,
maxCount: this._maxCount, maxCount: this._maxCount,
resolveLinkTos: this._resolveLinkTos, resolveLinkTos: this._resolveLinkTos,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -25,7 +25,7 @@ StartTransactionOperation.prototype._createRequestDto = function() {
return new ClientMessage.TransactionStart({ return new ClientMessage.TransactionStart({
eventStreamId: this._stream, eventStreamId: this._stream,
expectedVersion: this._expectedVersion, expectedVersion: this._expectedVersion,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -137,9 +137,9 @@ SubscriptionOperation.prototype.inspectPackage = function(pkg) {
case ClientMessage.NotHandled.NotHandledReason.TooBusy: case ClientMessage.NotHandled.NotHandledReason.TooBusy:
return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy"); return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy");
case ClientMessage.NotHandled.NotHandledReason.NotMaster: case ClientMessage.NotHandled.NotHandledReason.NotLeader:
var masterInfo = ClientMessage.NotHandled.MasterInfo.decode(message.additionalInfo); var masterInfo = ClientMessage.NotHandled.LeaderInfo.decode(message.additionalInfo);
return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotMaster", return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotLeader",
{host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort}, {host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort},
{host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort}); {host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort});

View File

@ -32,7 +32,7 @@ TransactionalWriteOperation.prototype._createRequestDto = function() {
return new ClientMessage.TransactionWrite({ return new ClientMessage.TransactionWrite({
transactionId: this._transactionId, transactionId: this._transactionId,
events: dtos, events: dtos,
requireMaster: this._requireMaster requireLeader: this._requireMaster
}); });
}; };

View File

@ -8,20 +8,15 @@ const VNodeStates = Object.freeze({
CatchingUp: 4, CatchingUp: 4,
Clone: 5, Clone: 5,
Follower: 6, Follower: 6,
Slave: 6,
PreLeader: 7, PreLeader: 7,
PreMaster: 7,
Leader: 8, Leader: 8,
Master: 8,
Manager: 9, Manager: 9,
ShuttingDown: 10, ShuttingDown: 10,
Shutdown: 11, Shutdown: 11,
ReadOnlyLeaderless: 12, ReadOnlyLeaderless: 12,
ReadOnlyMasterless: 12,
PreReadOnlyReplica: 13, PreReadOnlyReplica: 13,
ReadOnlyReplica: 14, ReadOnlyReplica: 14,
ResigningLeader: 15, ResigningLeader: 15,
ResigningMaster: 15,
}); });
function ClusterInfo(members) { function ClusterInfo(members) {
@ -37,7 +32,7 @@ function ClusterInfo(members) {
ClusterInfo.prototype._getBestNode = function () { ClusterInfo.prototype._getBestNode = function () {
return this._members return this._members
.filter(member => member.isAlive && member.isAllowedToConnect && VNodeStates[member.state] <= VNodeStates.Master) .filter(member => member.isAlive && member.isAllowedToConnect)
.sort(function (a, b) { .sort(function (a, b) {
return VNodeStates[b.state] - VNodeStates[a.state]; return VNodeStates[b.state] - VNodeStates[a.state];
})[0]; })[0];

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
syntax = "proto3";
package EventStore.Client.Messages; package EventStore.Client.Messages;
enum OperationResult enum OperationResult
@ -13,114 +15,115 @@ enum OperationResult
} }
message NewEvent { message NewEvent {
required bytes event_id = 1; bytes event_id = 1;
required string event_type = 2; string event_type = 2;
required int32 data_content_type = 3; int32 data_content_type = 3;
required int32 metadata_content_type = 4; int32 metadata_content_type = 4;
required bytes data = 5; bytes data = 5;
optional bytes metadata = 6; bytes metadata = 6;
} }
message EventRecord { message EventRecord {
required string event_stream_id = 1; string event_stream_id = 1;
required int64 event_number = 2; int64 event_number = 2;
required bytes event_id = 3; bytes event_id = 3;
required string event_type = 4; string event_type = 4;
required int32 data_content_type = 5; int32 data_content_type = 5;
required int32 metadata_content_type = 6; int32 metadata_content_type = 6;
required bytes data = 7; bytes data = 7;
optional bytes metadata = 8; bytes metadata = 8;
optional int64 created = 9; int64 created = 9;
optional int64 created_epoch = 10; int64 created_epoch = 10;
} }
message ResolvedIndexedEvent { message ResolvedIndexedEvent {
optional EventRecord event = 1; EventRecord event = 1;
optional EventRecord link = 2; EventRecord link = 2;
} }
message ResolvedEvent { message ResolvedEvent {
optional EventRecord event = 1; EventRecord event = 1;
optional EventRecord link = 2; EventRecord link = 2;
required int64 commit_position = 3; int64 commit_position = 3;
required int64 prepare_position = 4; int64 prepare_position = 4;
} }
message WriteEvents { message WriteEvents {
required string event_stream_id = 1; string event_stream_id = 1;
required int64 expected_version = 2; int64 expected_version = 2;
repeated NewEvent events = 3; repeated NewEvent events = 3;
required bool require_master = 4; bool require_leader = 4;
} }
message WriteEventsCompleted { message WriteEventsCompleted {
required OperationResult result = 1; OperationResult result = 1;
optional string message = 2; string message = 2;
required int64 first_event_number = 3; int64 first_event_number = 3;
required int64 last_event_number = 4; int64 last_event_number = 4;
optional int64 prepare_position = 5; int64 prepare_position = 5;
optional int64 commit_position = 6; int64 commit_position = 6;
optional int64 current_version = 7; int64 current_version = 7;
} }
message DeleteStream { message DeleteStream {
required string event_stream_id = 1; string event_stream_id = 1;
required int64 expected_version = 2; int64 expected_version = 2;
required bool require_master = 3; bool require_leader = 3;
optional bool hard_delete = 4; bool hard_delete = 4;
} }
message DeleteStreamCompleted { message DeleteStreamCompleted {
required OperationResult result = 1; OperationResult result = 1;
optional string message = 2; string message = 2;
optional int64 prepare_position = 3; int64 prepare_position = 3;
optional int64 commit_position = 4; int64 commit_position = 4;
int64 current_version = 5;
} }
message TransactionStart { message TransactionStart {
required string event_stream_id = 1; string event_stream_id = 1;
required int64 expected_version = 2; int64 expected_version = 2;
required bool require_master = 3; bool require_leader = 3;
} }
message TransactionStartCompleted { message TransactionStartCompleted {
required int64 transaction_id = 1; int64 transaction_id = 1;
required OperationResult result = 2; OperationResult result = 2;
optional string message = 3; string message = 3;
} }
message TransactionWrite { message TransactionWrite {
required int64 transaction_id = 1; int64 transaction_id = 1;
repeated NewEvent events = 2; repeated NewEvent events = 2;
required bool require_master = 3; bool require_leader = 3;
} }
message TransactionWriteCompleted { message TransactionWriteCompleted {
required int64 transaction_id = 1; int64 transaction_id = 1;
required OperationResult result = 2; OperationResult result = 2;
optional string message = 3; string message = 3;
} }
message TransactionCommit { message TransactionCommit {
required int64 transaction_id = 1; int64 transaction_id = 1;
required bool require_master = 2; bool require_leader = 2;
} }
message TransactionCommitCompleted { message TransactionCommitCompleted {
required int64 transaction_id = 1; int64 transaction_id = 1;
required OperationResult result = 2; OperationResult result = 2;
optional string message = 3; string message = 3;
required int64 first_event_number = 4; int64 first_event_number = 4;
required int64 last_event_number = 5; int64 last_event_number = 5;
optional int64 prepare_position = 6; int64 prepare_position = 6;
optional int64 commit_position = 7; int64 commit_position = 7;
} }
message ReadEvent { message ReadEvent {
required string event_stream_id = 1; string event_stream_id = 1;
required int64 event_number = 2; int64 event_number = 2;
required bool resolve_link_tos = 3; bool resolve_link_tos = 3;
required bool require_master = 4; bool require_leader = 4;
} }
message ReadEventCompleted { message ReadEventCompleted {
@ -134,18 +137,18 @@ message ReadEventCompleted {
AccessDenied = 5; AccessDenied = 5;
} }
required ReadEventResult result = 1; ReadEventResult result = 1;
required ResolvedIndexedEvent event = 2; ResolvedIndexedEvent event = 2;
optional string error = 3; string error = 3;
} }
message ReadStreamEvents { message ReadStreamEvents {
required string event_stream_id = 1; string event_stream_id = 1;
required int64 from_event_number = 2; int64 from_event_number = 2;
required int32 max_count = 3; int32 max_count = 3;
required bool resolve_link_tos = 4; bool resolve_link_tos = 4;
required bool require_master = 5; bool require_leader = 5;
} }
message ReadStreamEventsCompleted { message ReadStreamEventsCompleted {
@ -160,21 +163,21 @@ message ReadStreamEventsCompleted {
} }
repeated ResolvedIndexedEvent events = 1; repeated ResolvedIndexedEvent events = 1;
required ReadStreamResult result = 2; ReadStreamResult result = 2;
required int64 next_event_number = 3; int64 next_event_number = 3;
required int64 last_event_number = 4; int64 last_event_number = 4;
required bool is_end_of_stream = 5; bool is_end_of_stream = 5;
required int64 last_commit_position = 6; int64 last_commit_position = 6;
optional string error = 7; string error = 7;
} }
message ReadAllEvents { message ReadAllEvents {
required int64 commit_position = 1; int64 commit_position = 1;
required int64 prepare_position = 2; int64 prepare_position = 2;
required int32 max_count = 3; int32 max_count = 3;
required bool resolve_link_tos = 4; bool resolve_link_tos = 4;
required bool require_master = 5; bool require_leader = 5;
} }
message ReadAllEventsCompleted { message ReadAllEventsCompleted {
@ -186,57 +189,105 @@ message ReadAllEventsCompleted {
AccessDenied = 3; AccessDenied = 3;
} }
required int64 commit_position = 1; int64 commit_position = 1;
required int64 prepare_position = 2; int64 prepare_position = 2;
repeated ResolvedEvent events = 3; repeated ResolvedEvent events = 3;
required int64 next_commit_position = 4; int64 next_commit_position = 4;
required int64 next_prepare_position = 5; int64 next_prepare_position = 5;
optional ReadAllResult result = 6 [default = Success]; ReadAllResult result = 6;
optional string error = 7; string error = 7;
}
message Filter{
enum FilterContext {
StreamId = 0;
EventType = 1;
}
enum FilterType {
Regex = 0;
Prefix = 1;
}
FilterContext context = 1;
FilterType type = 2;
repeated string data = 3;
}
message FilteredReadAllEvents {
int64 commit_position = 1;
int64 prepare_position = 2;
int32 max_count = 3;
int32 max_search_window = 4;
bool resolve_link_tos = 5;
bool require_leader = 6;
Filter filter = 7;
}
message FilteredReadAllEventsCompleted {
enum FilteredReadAllResult {
Success = 0;
NotModified = 1;
Error = 2;
AccessDenied = 3;
}
int64 commit_position = 1;
int64 prepare_position = 2;
repeated ResolvedEvent events = 3;
int64 next_commit_position = 4;
int64 next_prepare_position = 5;
bool is_end_of_stream = 6;
FilteredReadAllResult result = 7;
string error = 8;
} }
message CreatePersistentSubscription { message CreatePersistentSubscription {
required string subscription_group_name = 1; string subscription_group_name = 1;
required string event_stream_id = 2; string event_stream_id = 2;
required bool resolve_link_tos = 3; bool resolve_link_tos = 3;
required int64 start_from = 4; int64 start_from = 4;
required int32 message_timeout_milliseconds = 5; int32 message_timeout_milliseconds = 5;
required bool record_statistics = 6; bool record_statistics = 6;
required int32 live_buffer_size = 7; int32 live_buffer_size = 7;
required int32 read_batch_size = 8; int32 read_batch_size = 8;
required int32 buffer_size = 9; int32 buffer_size = 9;
required int32 max_retry_count = 10; int32 max_retry_count = 10;
required bool prefer_round_robin = 11; bool prefer_round_robin = 11;
required int32 checkpoint_after_time = 12; int32 checkpoint_after_time = 12;
required int32 checkpoint_max_count = 13; int32 checkpoint_max_count = 13;
required int32 checkpoint_min_count = 14; int32 checkpoint_min_count = 14;
required int32 subscriber_max_count = 15; int32 subscriber_max_count = 15;
optional string named_consumer_strategy = 16; string named_consumer_strategy = 16;
} }
message DeletePersistentSubscription { message DeletePersistentSubscription {
required string subscription_group_name = 1; string subscription_group_name = 1;
required string event_stream_id = 2; string event_stream_id = 2;
} }
message UpdatePersistentSubscription { message UpdatePersistentSubscription {
required string subscription_group_name = 1; string subscription_group_name = 1;
required string event_stream_id = 2; string event_stream_id = 2;
required bool resolve_link_tos = 3; bool resolve_link_tos = 3;
required int64 start_from = 4; int64 start_from = 4;
required int32 message_timeout_milliseconds = 5; int32 message_timeout_milliseconds = 5;
required bool record_statistics = 6; bool record_statistics = 6;
required int32 live_buffer_size = 7; int32 live_buffer_size = 7;
required int32 read_batch_size = 8; int32 read_batch_size = 8;
required int32 buffer_size = 9; int32 buffer_size = 9;
required int32 max_retry_count = 10; int32 max_retry_count = 10;
required bool prefer_round_robin = 11; bool prefer_round_robin = 11;
required int32 checkpoint_after_time = 12; int32 checkpoint_after_time = 12;
required int32 checkpoint_max_count = 13; int32 checkpoint_max_count = 13;
required int32 checkpoint_min_count = 14; int32 checkpoint_min_count = 14;
required int32 subscriber_max_count = 15; int32 subscriber_max_count = 15;
optional string named_consumer_strategy = 16; string named_consumer_strategy = 16;
} }
message UpdatePersistentSubscriptionCompleted { message UpdatePersistentSubscriptionCompleted {
@ -246,8 +297,8 @@ message UpdatePersistentSubscriptionCompleted {
Fail = 2; Fail = 2;
AccessDenied=3; AccessDenied=3;
} }
required UpdatePersistentSubscriptionResult result = 1 [default = Success]; UpdatePersistentSubscriptionResult result = 1;
optional string reason = 2; string reason = 2;
} }
message CreatePersistentSubscriptionCompleted { message CreatePersistentSubscriptionCompleted {
@ -257,8 +308,8 @@ message CreatePersistentSubscriptionCompleted {
Fail = 2; Fail = 2;
AccessDenied=3; AccessDenied=3;
} }
required CreatePersistentSubscriptionResult result = 1 [default = Success]; CreatePersistentSubscriptionResult result = 1;
optional string reason = 2; string reason = 2;
} }
message DeletePersistentSubscriptionCompleted { message DeletePersistentSubscriptionCompleted {
@ -268,19 +319,19 @@ message DeletePersistentSubscriptionCompleted {
Fail = 2; Fail = 2;
AccessDenied = 3; AccessDenied = 3;
} }
required DeletePersistentSubscriptionResult result = 1 [default = Success]; DeletePersistentSubscriptionResult result = 1;
optional string reason = 2; string reason = 2;
} }
message ConnectToPersistentSubscription { message ConnectToPersistentSubscription {
required string subscription_id = 1; string subscription_id = 1;
required string event_stream_id = 2; string event_stream_id = 2;
required int32 allowed_in_flight_messages = 3; int32 allowed_in_flight_messages = 3;
} }
message PersistentSubscriptionAckEvents { message PersistentSubscriptionAckEvents {
required string subscription_id = 1; string subscription_id = 1;
repeated bytes processed_event_ids = 2; repeated bytes processed_event_ids = 2;
} }
@ -293,34 +344,47 @@ message PersistentSubscriptionNakEvents {
Stop = 4; Stop = 4;
} }
required string subscription_id = 1; string subscription_id = 1;
repeated bytes processed_event_ids = 2; repeated bytes processed_event_ids = 2;
optional string message = 3; string message = 3;
required NakAction action = 4 [default = Unknown]; NakAction action = 4;
} }
message PersistentSubscriptionConfirmation { message PersistentSubscriptionConfirmation {
required int64 last_commit_position = 1; int64 last_commit_position = 1;
required string subscription_id = 2; string subscription_id = 2;
optional int64 last_event_number = 3; int64 last_event_number = 3;
} }
message PersistentSubscriptionStreamEventAppeared { message PersistentSubscriptionStreamEventAppeared {
required ResolvedIndexedEvent event = 1; ResolvedIndexedEvent event = 1;
int32 retryCount = 2;
} }
message SubscribeToStream { message SubscribeToStream {
required string event_stream_id = 1; string event_stream_id = 1;
required bool resolve_link_tos = 2; bool resolve_link_tos = 2;
}
message FilteredSubscribeToStream {
string event_stream_id = 1;
bool resolve_link_tos = 2;
Filter filter = 3;
int32 checkpoint_interval = 4;
}
message CheckpointReached {
int64 commit_position = 1;
int64 prepare_position = 2;
} }
message SubscriptionConfirmation { message SubscriptionConfirmation {
required int64 last_commit_position = 1; int64 last_commit_position = 1;
optional int64 last_event_number = 2; int64 last_event_number = 2;
} }
message StreamEventAppeared { message StreamEventAppeared {
required ResolvedEvent event = 1; ResolvedEvent event = 1;
} }
message UnsubscribeFromStream { message UnsubscribeFromStream {
@ -336,7 +400,7 @@ message SubscriptionDropped {
SubscriberMaxCountReached=4; SubscriberMaxCountReached=4;
} }
optional SubscriptionDropReason reason = 1 [default = Unsubscribed]; SubscriptionDropReason reason = 1;
} }
message NotHandled { message NotHandled {
@ -344,42 +408,42 @@ message NotHandled {
enum NotHandledReason { enum NotHandledReason {
NotReady = 0; NotReady = 0;
TooBusy = 1; TooBusy = 1;
NotMaster = 2; NotLeader = 2;
IsReadOnly = 3;
} }
required NotHandledReason reason = 1; NotHandledReason reason = 1;
optional bytes additional_info = 2; bytes additional_info = 2;
message MasterInfo { message LeaderInfo {
required string external_tcp_address = 1; string external_tcp_address = 1;
required int32 external_tcp_port = 2; int32 external_tcp_port = 2;
required string external_http_address = 3; string http_address = 3;
required int32 external_http_port = 4; int32 http_port = 4;
optional string external_secure_tcp_address = 5; string external_secure_tcp_address = 5;
optional int32 external_secure_tcp_port = 6; int32 external_secure_tcp_port = 6;
} }
} }
message ScavengeDatabase { message ScavengeDatabase {
} }
message ScavengeDatabaseCompleted { message ScavengeDatabaseResponse {
enum ScavengeResult { enum ScavengeResult {
Success = 0; Started = 0;
InProgress = 1; InProgress = 1;
Failed = 2; Unauthorized = 2;
} }
required ScavengeResult result = 1; ScavengeResult result = 1;
optional string error = 2; string scavengeId = 2;
required int32 total_time_ms = 3;
required int64 total_space_saved = 4;
} }
message IdentifyClient { message IdentifyClient {
required int32 version = 1; int32 version = 1;
optional string connection_name = 2; string connection_name = 2;
} }
message ClientIdentified { message ClientIdentified {

View File

@ -6,7 +6,7 @@ const ProjectionsClient = require('./projectionsClient');
* @param {Logger} log Instance of Logger to use for logging. * @param {Logger} log Instance of Logger to use for logging.
* @param {string} httpEndPoint HTTP endpoint of an Event Store server. * @param {string} httpEndPoint HTTP endpoint of an Event Store server.
* @param {number} operationTimeout Operation timeout in milliseconds. * @param {number} operationTimeout Operation timeout in milliseconds.
* @param {boolean} [rejectUnauthorized] Reject authorized SSL certs (if using SSL) - set to false if using self-signed certs * @param {boolean} [rejectUnauthorized] Reject authorized SSL certs (if using SSL) - set to false is using self-signed certs
* @constructor * @constructor
*/ */
function ProjectionsManager(log, httpEndPoint, operationTimeout, rejectUnauthorized) { function ProjectionsManager(log, httpEndPoint, operationTimeout, rejectUnauthorized) {

View File

@ -13,6 +13,7 @@ protobufJS.configure();
var settings = { var settings = {
log: new NoopLogger(), log: new NoopLogger(),
useSslConnection: true, useSslConnection: true,
validateServer: false
}; };
if (process.env.TESTS_VERBOSE_LOGGING === '1') { if (process.env.TESTS_VERBOSE_LOGGING === '1') {
settings.verboseLogging = true; settings.verboseLogging = true;

4235
yarn.lock Normal file

File diff suppressed because it is too large Load Diff