Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Releases: typedb/typedb-driver-nodejs

TypeDB Client Node.js 2.5.0

13 Oct 10:18
b263297

Choose a tag to compare

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 the stub creation logic from the stub factory classes directly into the client classes.

Other Improvements

TypeDB Client Node.js 2.4.0

17 Sep 13:36

Choose a tag to compare

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, the TypeDBClientError constructor was a bit of a mess, meaning that under certain scenarios, the user was interested in error.message; in other scenarios, error.errorMessage, and this was pretty ridiculous because the two names are basically synonymous.
    So we renamed errorMessage to messageTemplate, and ensured that the content of error.message is always a human-readable string.

Code Refactors

Other Improvements

TypeDB Client Node.js 2.2.0

16 Jul 09:12
6fcca9b

Choose a tag to compare

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.ts file 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.Remote was flattened to AttributeType.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 changed Concept.getType() to just Concept.type, and Type.getLabel() to just Type.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 npm with yarn

    We've found yarn is faster and more deterministic than npm for installing dependencies, so we've updated the build system to use yarn. This does not affect users.

    (Also, the generated lockfile is much smaller!)

TypeDB Client Node.js 2.1.1

10 Jun 08:41

Choose a tag to compare

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

20 May 15:53

Choose a tag to compare

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 option batchSize was 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 to prefetchSize.

Other Improvements

Grakn Client Node.js 2.0.1

13 Apr 19:21
9ad68e7

Choose a tag to compare

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, isInferred is now a Local method on Thing.

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

31 Mar 17:54

Choose a tag to compare

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 using

    client = await GraknClient.cluster(addresses)

    where addresses is 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 a Promise<GraknClient> (unlike creating a Core client, which returns a GraknClient). It also supports one additional field in GraknOptions named readAnyReplica, which when set to true on a Session, 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: explain query or transaction option must be set to true

  • Deploy CommonJS modules to npm
    Previously, our npm package used UMD modules, because Bazel's ts_library rule does so mandatorily. However this was causing incompatibility with Workbase, because UMD modules are incompatible with Webpack.
    Now, our npm package 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

23 Feb 18:56
c2e0e1f

Choose a tag to compare

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 for traceInference, 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_dependencies updates rules-python and 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

04 Feb 23:06

Choose a tag to compare

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

22 Jan 18:32
cb8087d

Choose a tag to compare

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 updated grakn-protocol to 2.0.0-alpha-6. Additionally, we've updated the version to 2.0.0-alpha-7.

  • Fix console warnings caused by out of date dependency
    Fix WARNING: An illegal reflective access operation has occurred warning 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 using match $x sub rule; get;.
    So, to allow the user to retrieve all rules, we now add getRules to the LogicManager, enabling use of tx().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
    Running tx.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 release dependencies
    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: the ConceptProtoReader. We are dissolving it in favour of putting the static of methods into namespaces whose names match the class name.
    Also, the npm artifact of protocol was renamed to grakn-protocol.

  • Add pulse to RPCSession

    1. 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.