Releases: typedb/typedb-driver-nodejs
TypeDB Client Node.js 2.5.0
NPM package: https://www.npmjs.com/package/typedb-client
Documentation: https://docs.vaticle.com/docs/client-api/nodejs
Installation
npm install typedb-client@2.5.0
New Features
- Enable faster authentication with "user token" mechanism
Authenticating a user by verifying their password introduces a significant overhead, which comes from the fact that the password is hashed with cryptographic hash function. In effect, opening a new session or transaction becomes much slower.
We've now improved the speed of user-authentication by introducing a mechanism for verifying user credential with cheap "user token" rather than password.
Bugs Fixed
Code Refactors
- Remove stub factory
We've renamed the terminology 'name' to 'username' since it's more appropriate.
We've also simplified the architecture of both Core and ClusterServer clients by moving thestubcreation logic from the stub factory classes directly into the client classes.
Other Improvements
TypeDB Client Node.js 2.4.0
NPM package: https://www.npmjs.com/package/typedb-client
Documentation: https://docs.vaticle.com/docs/client-api/nodejs
Installation
npm install typedb-client@2.4.0
New Features
Bugs Fixed
- Improve UX of TypeDBClientError
Previously, theTypeDBClientErrorconstructor was a bit of a mess, meaning that under certain scenarios, the user was interested inerror.message; in other scenarios,error.errorMessage, and this was pretty ridiculous because the two names are basically synonymous.
So we renamederrorMessagetomessageTemplate, and ensured that the content oferror.messageis always a human-readable string.
Code Refactors
Other Improvements
TypeDB Client Node.js 2.2.0
NPM package: https://www.npmjs.com/package/typedb-client
Documentation: https://docs.vaticle.com/docs/client-api/nodejs
Installation
npm install typedb-client@2.2.0
New Features
Bugs Fixed
Code Refactors
-
API refactors for ease of use
We've added an
index.tsfile so that symbols are importable from"typedb-client"as opposed to, say,"typedb-client/api/connection/TypeDBTransaction".Also, we've added casting methods to Concept classes (e.g:
asThingType). These methods perform safe type casting.We've aligned the class/namespace structure fully with client-java - previously, for example,
AttributeType.Boolean.Remotewas flattened toAttributeType.RemoteBoolean. This is no longer the case. -
Replace methods with properties where appropriate
Because client-nodejs is based on Client Java, we were using methods in a lot of places where a property would be more fitting. So, for example, we've changedConcept.getType()to justConcept.type, andType.getLabel()to justType.label. This should allow for writing terser code. -
Use "asX" methods instead of type casts
Our internal code now makes use of the "asX" methods in the Concept package, instead of type casting.
Other Improvements
-
Replace
npmwithyarnWe've found
yarnis faster and more deterministic thannpmfor installing dependencies, so we've updated the build system to useyarn. This does not affect users.(Also, the generated lockfile is much smaller!)
TypeDB Client Node.js 2.1.1
NPM package: https://www.npmjs.com/package/typedb-client
Documentation: https://docs.vaticle.com/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install typedb-client@2.1.1
New Features
- Implement cluster authentication
Implemented authentication secure channels, and user management for typedb cluster.
SSL is now required for connections to TypeDB cluster , because sending username/passwords over plaintext connections is disallowed by gRPC.
Bugs Fixed
Code Refactors
Other Improvements
TypeDB Client Node.js 2.1.0
NPM package: https://www.npmjs.com/package/typedb-client
Documentation: https://docs.vaticle.com/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install typedb-client@2.1.0
New Features
- Fault-tolerant Cluster database operations
We improved the fault tolerance of our Cluster database operations, namely Create, Contains and Delete.
Bugs Fixed
Code Refactors
- Rename batchSize option to prefetchSize
The optionbatchSizewas misleading as we generally use 'batch' to refer to all of the messages sent by a peer (server or client) within a set time window (eg: 1ms). So we renamed it toprefetchSize.
Other Improvements
Grakn Client Node.js 2.0.1
NPM package: https://www.npmjs.com/package/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install grakn-client@2.0.1
New Features
- Encode request IDs as bytes and make isInferred a Local Thing method
Previously the ID of a transaction request was stored as a string, which is an inefficient representation of a UUID. We've changed it to bytes.
Also,isInferredis now a Local method onThing.
Bugs Fixed
Code Refactors
Other Improvements
Please refer to full release notes of 2.0.0-alpha to see the changes contained in 2.0.0.
Grakn Client Node.js 2.0.0
NPM package: https://www.npmjs.com/package/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install grakn-client@2.0.0
New Features
-
Grakn Cluster integration
We now support connecting to Grakn Cluster usingclient = await GraknClient.cluster(addresses)
where
addressesis an array of Cluster server addresses. The API usage of a Cluster client is the same as for a Core client, however, the creation of a Cluster client returns aPromise<GraknClient>(unlike creating a Core client, which returns aGraknClient). It also supports one additional field inGraknOptionsnamedreadAnyReplica, which when set totrueon aSession, allows all of its read transactions to read from secondary database replicas. -
Upgrade to the latest Grakn Core
We upgraded to the latest Grakn Core and aligned the codebase with our Python and Java clients.
This is a breaking change. The new API to instantiate a Grakn client, and create a transaction, is:const { GraknClient, SessionType, TransactionType } = require("grakn-client/GraknClient"); async function graknTest() { const client = GraknClient.core(address); const session = await client.session("grakn", SessionType.SCHEMA); const tx = await session.tx(TransactionType.WRITE); }
The new API to delete a database is
const grakn = await client.databases().get("grakn"); // Throws if the database does not exist await grakn.delete();
Bugs Fixed
Code Refactors
Other Improvements
-
Client refactor and Explanations
We refactor client-nodejs to follow the new architecture set out by client-java in 7963479, and then following typedb/typedb#6271 and the corresponding protocol change in typedb/typedb-protocol#131 we implement Explanations, Explainable concept maps, and the explain() query API, which allows users to stream Explanations on demand note:explainquery or transaction option must be set totrue -
Deploy CommonJS modules to npm
Previously, ournpmpackage used UMD modules, because Bazel'sts_libraryrule does so mandatorily. However this was causing incompatibility with Workbase, because UMD modules are incompatible with Webpack.
Now, ournpmpackage uses the CommonJS module format. This change should retain compatibility with all existing applications.
Please refer to full release notes of 2.0.0-alpha to see the changes contained in 2.0.0.
Grakn Client Node.js 2.0.0-alpha-9
NPM package: https://www.npmjs.com/package/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install grakn-client@2.0.0-alpha-9
New Features
-
Bump protocol to add option for inference tracing
Bump protocol version to include the option fortraceInference, which is now available on the server. -
Use self-hosted Bazel cache
Speed up CI by using self-hosted remote Bazel cache -
Support new Graql Update queries
We synchronised client-nodejs with the current master versions of protocol, behavioural tests, and grakn core server, to enable support for the new update query type, as well as adding support for related tests and automation.
Bugs Fixed
Code Refactors
Other Improvements
- Refactor code to work with latest @graknlabs_dependencies
Latest version of@graknlabs_dependenciesupdatesrules-pythonand therefore all repos that depend on it need to bring imports to an up-to-date state.
Please refer to full release notes of 2.0.0-alpha to see the changes contained in 2.0.0.
Grakn Client Node.js 2.0.0-alpha-8
NPM package: https://www.npmjs.com/package/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install grakn-client@2.0.0-alpha-8
Please refer to full release notes of 2.0.0-alpha to see the changes contained in 2.0.0.
Grakn Client Node.js 2.0.0-alpha-7
NPM package: https://www.npmjs.com/package/grakn-client
Documentation: https://dev.docs.grakn.ai/docs/client-api/nodejs
Distribution
Now officially available through https://npmjs.com
npm install grakn-client@2.0.0-alpha-7
New Features
Bugs Fixed
Code Refactors
Other Improvements
-
** Update dependencies and the version**
We have updatedgrakn-protocolto2.0.0-alpha-6. Additionally, we've updated the version to2.0.0-alpha-7. -
Fix console warnings caused by out of date dependency
FixWARNING: An illegal reflective access operation has occurredwarning caused by an out of date version of protobuf. -
Add ability to retrieve all rules
Since Rule was refactored in Grakn 2.0 to no longer be a subtype of Concept, we lost the ability to retrieve all rules usingmatch $x sub rule; get;.
So, to allow the user to retrieve all rules, we now addgetRulesto theLogicManager, enabling use oftx().logic().getRules(). -
Add support for Graql BDD scenarios
We added full support for our Graql BDD scenarios to guard against regressions and sharply increase our test coverage. -
Finish implementing Concept BDD
Our Concept API BDD tests were partially implemented. We finished implementing the rest of the steps. In doing so we found some minor issues in the client code. -
Fix running matchAggregate queries
Runningtx.query().matchAggregate(q)now returns correct result instead of throwing an exception. Additionally, the answer returned is now printable. -
Fix QueryManager's match methods
Make it possible to execute match aggregate, match group and match group aggregate queries using Grakn Client NodeJS. -
Behavioural Test Interim State
We need to complete Behavioural Tests for client-nodejs -
Close duplex streams when closing transactions
Tests were experiencing intermittent failures due to improper cleanup of transactions. We cleared up the cleanup steps so they're easier to read and less temperamental, and added a step to transaction.close() that actually closes the RPC stream so the tests do not hang sporadically. -
Update automation.yml to include
releasedependencies
Re-add 'release' to dependencies, since dependency-analysis is supporting tags now. -
Bump year in license headers to 2021
License headers are currently out of date (2020) for a while. This PR replaces 2020 with 2021 across all the files. -
Change code owner to Alistair
We've added Alistair as the only code owner. -
Protocol Synchronisation
We synchronised client-nodejs's conceptmanager and concept type structure with the newest protocol for grakn core. -
Behavioural tests
We introduced behavioural tests in alignment with the behavioural tests present in our other clients and core server. This also comes with a more comprehensive set of automated tests, split up in a more sensible way, including but not limited to local integration testing, behavioural tests, and automatic linting checks at the build level. -
Fix GetPlayersByRoleType having 'duplicate' keys
GetPlayersByRoleType was implemented incorrectly and would never assign more than one roleplayer to the same map entry. We fixed it by changing the algorithm that determines if role types should be treated as equivalent. -
Fix Attribute.GetOwners with no parameter
We ensure GetOwners is correctly declared in the Attribute interface and properly implemented in AttributeImpl. Previously it would throw an exception if called with no parameter, but this is legal in client-java. -
Update protocol: repeated fields now pluralised
We updated our repeated field names in our protocol, ensuring they are consistently pluralised in line with the Protocol Buffers style guide. -
Fix errors being swallowed + update protocol
Session pulses were incorrectly swallowing errors. We are making them throw errors as normal, and furthermore, they actually read the server response now and close the session locally if the session is marked as closed remotely.
Also, gRPC errors were being similarly swallowed. We are making them shut down the transaction and inform all response listeners that an error occurred.
We also had a nasty solution to circular dependency issues that was misaligned with client-java: theConceptProtoReader. We are dissolving it in favour of putting the staticofmethods into namespaces whose names match the class name.
Also, thenpmartifact of protocol was renamed tograkn-protocol. -
Add pulse to RPCSession
- To ensure Grakn remains usable after a client holding a schema session terminates abruptly: see typedb/typedb-driver#193
-
Refactor WORKSPACE and add filegroup declaring CI targets
We have refactor the WORKSPACE file to make it clearer. The key change was to properly enclose declarations into appropriate sections. We also add a new toplevel BUILD file declaration for all targets used in CI and elsewhere to ensure these targets are correct at build time.
Please refer to full release notes of 2.0.0-alpha to see the changes contained in 2.0.0.