Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Nhogs/nestjs-neo4j
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.5.10
Choose a base ref
...
head repository: Nhogs/nestjs-neo4j
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 20 commits
  • 22 files changed
  • 1 contributor

Commits on Jan 5, 2023

  1. add neo4j in gitignore

    Popotojs committed Jan 5, 2023
    Copy the full SHA
    8636c23 View commit details

Commits on Mar 15, 2023

  1. update dependencies neo4j-driver 5.6.0 & nestjs 9.3

    update neo4j docker image to neo4j:5.5.0-enterprise
    run npm audit fix
    Popotojs committed Mar 15, 2023
    Copy the full SHA
    3681a92 View commit details

Commits on May 15, 2023

  1. update dependencies (neo4j-driver 5.8.0 & nestjs 9.4)

    update neo4j docker image to neo4j:5.7.0-enterprise
    add getConfig in Neo4jService
    add support of disableLosslessIntegers in toNeo4j and fromNeo4j in Neo4jModelService this fixes #2
    Use Number() instead of toNumber conversion which also work on number and Neo4j returned Integer
    fix some unit test names
    add e2e and unit tests to cover disableLosslessIntegers Neo4j config on cats example
    Popotojs committed May 15, 2023
    Copy the full SHA
    316d9ac View commit details

Commits on Jun 23, 2023

  1. add nestjs 10 support

    update dependencies (neo4j-driver 5.9.2 & nestjs 9.4)
    update neo4j docker image to neo4j:5.9.0-enterprise
    change tsconfig target to es2021
    rename spec file
    Popotojs committed Jun 23, 2023
    Copy the full SHA
    1a44542 View commit details
  2. Copy the full SHA
    59e5e4e View commit details

Commits on Jul 31, 2023

  1. update node version to 18

    Popotojs committed Jul 31, 2023
    Copy the full SHA
    b046bcd View commit details
  2. Update e2e-test.yml

    change node version to 18
    Popotojs authored Jul 31, 2023
    Copy the full SHA
    687e665 View commit details

Commits on Aug 1, 2023

  1. Copy the full SHA
    a00b207 View commit details
  2. update version to 0.5.14

    update node version to 18
    update neo4j docker image version for e2e test to neo4j:5.10.0-enterprise
    Popotojs committed Aug 1, 2023
    Copy the full SHA
    0d71336 View commit details

Commits on Apr 24, 2024

  1. update version to 0.5.15

    update dependencies
    update neo4j docker image version for e2e test to neo4j:5.19.0-enterprise
    Popotojs committed Apr 24, 2024
    Copy the full SHA
    a2f0082 View commit details
  2. update version to 0.5.15

    update dependencies
    update neo4j docker image version for e2e test to neo4j:5.19.0-enterprise
    Popotojs committed Apr 24, 2024
    Copy the full SHA
    e6bdd54 View commit details
  3. Merge remote-tracking branch 'origin/main'

    # Conflicts:
    #	package-lock.json
    Popotojs committed Apr 24, 2024
    Copy the full SHA
    9090840 View commit details

Commits on Aug 19, 2024

  1. update version to 0.5.16

    update dependencies
    update neo4j docker image version for e2e test to neo4j:5.22.0-enterprise
    refactor peerDependencies to define more precise version ranges
    
    - Updated @nestjs/common and @nestjs/core peerDependencies to ">=7.0.0 <11.0.0" to support all major versions from 7.x to 10.x while avoiding potential breaking changes in future major versions (11.x and beyond).
    - Updated neo4j-driver peerDependency to ">=4.0.0 <6.0.0" to cover versions 4.x and 5.x, preventing compatibility issues with future major releases.
    - Adjusted reflect-metadata peerDependency to ">=0.1.13 <1.0.0" for a more controlled range before the next major release.
    - Limited rxjs peerDependency to ">=7.0.0 <8.0.0" to ensure compatibility within the 7.x series and avoid breaking changes in version 8.x.
    Popotojs committed Aug 19, 2024
    Copy the full SHA
    0212602 View commit details
  2. Copy the full SHA
    b52895f View commit details
  3. Copy the full SHA
    7077d8f View commit details
  4. Copy the full SHA
    51d12a4 View commit details
  5. Copy the full SHA
    e6ba475 View commit details
  6. Copy the full SHA
    261e9c6 View commit details
  7. update actions versions

    Popotojs committed Aug 19, 2024
    Copy the full SHA
    a0b418f View commit details
  8. refactor npm-publish action

    Popotojs committed Aug 19, 2024
    Copy the full SHA
    c0b7ed1 View commit details
10 changes: 5 additions & 5 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -11,20 +11,20 @@ jobs:
name: Run all tests using Docker/Neo4j
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: 'npm'
- name: Docker compose
run: docker-compose up -d --build
run: docker compose up -d --build
- name: Install npm dependencies
run: npm ci
- name: Build code
run: npm run build
- name: Run all the tests
run: npm test
- name: publish code coverage on CC
uses: paambaati/codeclimate-action@v3.0.0
uses: paambaati/codeclimate-action@v8
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
20 changes: 7 additions & 13 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -7,26 +7,20 @@ on:
types: [created]

jobs:
build:
build-and-publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- uses: actions/checkout@v4

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/

- run: npm ci

- run: npm run build

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_AUTOMATION}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -108,3 +108,4 @@ dist
.run
.dist
.neo4j
neo4j
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
[Neo4j](https://neo4j.com/) module for [Nest.js](https://github.com/nestjs/nest).

[![e2e-test](https://github.com/nhogs/nestjs-neo4j/actions/workflows/e2e-test.yml/badge.svg)](https://github.com/Nhogs/nestjs-neo4j/actions/workflows/e2e-test.yml)
[![Docker-tested-version](https://img.shields.io/badge/E2e%20tests%20on-neo4j%3A5.3.0--enterprise-blue?logo=docker)](https://registry.hub.docker.com/_/neo4j/tags)
[![Docker-tested-version](https://img.shields.io/badge/E2e%20tests%20on-neo4j%3A5.19.0--enterprise-blue?logo=docker)](https://registry.hub.docker.com/_/neo4j/tags)
[![Maintainability](https://api.codeclimate.com/v1/badges/2de17798cf9b4d9cfd83/maintainability)](https://codeclimate.com/github/Nhogs/nestjs-neo4j/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/2de17798cf9b4d9cfd83/test_coverage)](https://codeclimate.com/github/Nhogs/nestjs-neo4j/test_coverage)

8 changes: 3 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
version: '3.8'

services:
neo4j:
image: neo4j:5.3.0-enterprise
image: neo4j:5.22.0-enterprise
restart: unless-stopped
ports:
- "7474:7474"
- "7687:7687"
- '7474:7474'
- '7687:7687'
environment:
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
- NEO4J_AUTH=neo4j/test_password
8 changes: 6 additions & 2 deletions lib/service/neo4j.model.service.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,11 @@ export abstract class Neo4jModelService<T> {
public toNeo4j(params: Partial<T>): Record<string, any> {
let result: Record<string, any> = { ...params };
if (this.timestamp && params && params[this.timestamp]) {
result[this.timestamp] = int(params[this.timestamp].getTime());
if (this.neo4jService.getConfig().disableLosslessIntegers) {
result[this.timestamp] = params[this.timestamp].getTime();
} else {
result[this.timestamp] = int(params[this.timestamp].getTime());
}
}
return { ...result };
}
@@ -44,7 +48,7 @@ export abstract class Neo4jModelService<T> {
public fromNeo4j(record: Record<string, any>): T {
let result: Record<string, any> = { ...record };
if (this.timestamp && record && record[this.timestamp]) {
result[this.timestamp] = new Date(result[this.timestamp].toNumber());
result[this.timestamp] = new Date(Number(result[this.timestamp]));
}
return result as T;
}
2 changes: 1 addition & 1 deletion lib/service/neo4j.node.model.service.ts
Original file line number Diff line number Diff line change
@@ -248,7 +248,7 @@ export abstract class Neo4jNodeModelService<T> extends Neo4jModelService<T> {
run: async () => {
const res = await this._run(query);
return res.map(
(r) => <[T, number]>[this.fromNeo4j(r.matched), r.score.toNumber()],
(r) => <[T, number]>[this.fromNeo4j(r.matched), Number(r.score)],
);
},
};
4 changes: 4 additions & 0 deletions lib/service/neo4j.service.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,10 @@ export class Neo4jService implements OnApplicationShutdown {
};
}

getConfig() {
return this.config;
}

/**
* Verifies connectivity of this driver by trying to open a connection with the provided driver options.
*/
Loading