Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b00f3e4
add ts types
icebob Aug 9, 2025
b5233d5
add typings
icebob Aug 10, 2025
4834385
typecheck
icebob Aug 10, 2025
b2221c8
fix index & scopes types
icebob Aug 24, 2025
dfba92e
fix types
icebob Aug 24, 2025
50e48c6
fix ts test
icebob Aug 24, 2025
097f34c
fix types
icebob Aug 24, 2025
eaa358d
add ListResult type
icebob Aug 24, 2025
9c39472
fix validate type
icebob Sep 1, 2025
d645e3d
fix dynamic id field in types
icebob Sep 1, 2025
1e5d8fe
Add type for hook functions
icebob Sep 4, 2025
ca2e58b
Add type for hook functions
icebob Sep 4, 2025
0f2ebec
add virtual to types
icebob Sep 7, 2025
99886a4
Fix TypeScript types for Moleculer 0.15 compatibility
icebob-ai Mar 27, 2026
f5fcbcd
Update safe dependencies to latest versions
icebob-ai Mar 27, 2026
bbb97e3
Upgrade ESLint 8→10 (flat config) and TypeScript 5→6
icebob-ai Mar 27, 2026
c142bfe
Downgrade ESLint 10→9 for plugin compatibility
icebob-ai Mar 27, 2026
c0fe398
Restore ESLint 10, drop eslint-plugin-promise
icebob-ai Mar 27, 2026
d5d27a4
Fix test tsconfig for TypeScript 6 compatibility
icebob-ai Mar 27, 2026
5270e5a
Bump to v0.4.0, require Node 22+ and Moleculer 0.15
icebob-ai Mar 27, 2026
0a078fc
Keep Moleculer 0.14 compatibility in peer dependency
icebob-ai Mar 27, 2026
aac1b36
Fix PR review comments
icebob-ai Mar 27, 2026
98aafbb
Upgrade sqlite3 from 5.x to 6.x
Mar 28, 2026
7977ec5
Regenerate package-lock.json to fix CI
Mar 28, 2026
d48783e
Upgrade remaining dependencies
Mar 28, 2026
56fc71a
Add fsevents optional entry to lockfile for Node 24 CI
Mar 28, 2026
ca4bb9e
Fix CI: use npm ci --omit=optional for Node 24 compatibility
Mar 28, 2026
82795a2
Fix CI: upgrade npm on Node 24 to fix fsevents lockfile bug
Mar 28, 2026
73edce5
Fix CI: use npm install instead of npm ci
Mar 28, 2026
47821e9
Upgrade mongodb driver from 6.x to 7.x
Mar 28, 2026
22ea2ca
Update CHANGELOG with all dependency upgrades and CI fix
Mar 28, 2026
a8bb46f
Switch to released moleculer@0.15.0 and moleculer-web@0.11.0
Mar 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
node-version: [22.x, 24.x]
adapter: ["NeDB", "MongoDB", "Knex-SQLite", "Knex-Postgresql", "Knex-MySQL", "Knex-MySQL2", "Knex-MSSQL"]
fail-fast: false
steps:
Expand All @@ -39,7 +39,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
run: npm install

- name: Start containers for ${{ matrix.adapter }} adapter
run: docker compose up -d mongo && sleep 30
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TypeScript Type Check

on:
push: {}
pull_request: {}

jobs:
typecheck:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x, 24.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Typecheck
run: npm run typecheck

- name: Test TS
run: npm run test:ts
4 changes: 2 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
node-version: [22.x, 24.x]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -38,7 +38,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
run: npm install

- name: Run unit tests
run: npm run test:unit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ dist
*.db-journal
*.sqlite3
*.sqlite3-journal

# Claude Code local settings
.claude/settings.local.json
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
<a name="v0.4.0"></a>

# [0.4.0](https://github.com/moleculerjs/database/compare/v0.3.0...v0.4.0) (2026-03-27)

**Breaking changes**
- minimum Node.js version bumped to 22.
- add Moleculer 0.15 support (peer dependency: `^0.14.12 || ^0.15.0`).
- upgrade ESLint to 10 with flat config (`.eslintrc.js` → `eslint.config.js`).
- upgrade TypeScript to 6.
- remove `eslint-plugin-promise` (not compatible with ESLint 10).
- replace deprecated `eslint-plugin-node` with `eslint-plugin-n`.

**TypeScript**
- fix types for Moleculer 0.15 compatibility (remove `ServiceEvents`, `GenericObject` imports).
- fix `logger` type from `Loggers` namespace to `Logger` interface.
- add TypeScript type definitions (`index.d.ts`).

**Other changes**
- upgrade `mongodb` driver from 6.x to 7.x (accept both `^6.0.0` and `^7.0.0`).
- upgrade `sqlite3` from 5.x to 6.x.
- upgrade `tedious` from 18.x to 19.x.
- upgrade `globals` from 16.x to 17.x.
- upgrade `npm-check-updates` from 16.x to 19.x.
- update all other dependencies to latest minor/patch versions.
- CI: use `npm install` instead of `npm ci` to work around Node 24 fsevents lockfile bug ([npm/cli#8805](https://github.com/npm/cli/issues/8805)).

<a name="v0.3.0"></a>

# [0.3.0](https://github.com/moleculerjs/database/compare/v0.2.1...v0.3.0) (2025-05-31)
Expand Down
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ Update an existing entity. Only the specified fields will be updated.
| `opts.raw` | `Boolean` | `false` | If `true`, the `params` is passed directly to the database client. |
| `opts.transform` | `Boolean` | `true` | If `false`, the result won't be transformed. |
| `opts.permissive` | `Boolean` | `false` | If `true`, readonly and immutable fields can be set and update and field permission is not checked. |
| `opts.scope` | `String|Array<String>|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `opts.scope` | `String\|Array<String>\|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |

It returns the updated entity.

Expand All @@ -1356,7 +1356,7 @@ Update multiple entities by a query. Only the specified fields will be updated.
| `params` | `Object` | `null` | Parameters for method. |
| `params.query` | `Object` | `null` | The query for finding entities. |
| `params.changes` | `Object` | `null` | It contains the changed field values. |
| `params.scope` | `String|Array<String>|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `params.scope` | `String\|Array<String>\|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `opts` | `Object` | `{}` | Other options for internal methods. |
| `opts.raw` | `Boolean` | `false` | If `true`, the `params` is passed directly to the database client. |
| `opts.transform` | `Boolean` | `true` | If `false`, the result won't be transformed. |
Expand All @@ -1377,7 +1377,7 @@ Replace an existing entity.
| `opts` | `Object` | `{}` | Other options for internal methods. |
| `opts.transform` | `Boolean` | `true` | If `false`, the result won't be transformed. |
| `opts.permissive` | `Boolean` | `false` | If `true`, readonly and immutable fields can be set and update and field permission is not checked. |
| `opts.scope` | `String|Array<String>|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `opts.scope` | `String\|Array<String>\|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |

It returns the replaced entity.

Expand All @@ -1393,7 +1393,7 @@ Delete an entity by ID.
| `params` | `Object` | `null` | It contains the entity ID. |
| `opts` | `Object` | `{}` | Other options for internal methods. |
| `opts.transform` | `Boolean` | `true` | If `false`, the result won't be transformed. |
| `opts.scope` | `String|Array<String>|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `opts.scope` | `String\|Array<String>\|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `opts.softDelete` | `Boolean` | `null` | Disable the enabled soft-delete feature. Only `false` value is acceptable. |

The method returns only the ID of the deleted entity.
Expand All @@ -1409,7 +1409,7 @@ Delete multiple entities by a query.
| `ctx` | `Context` | `null` | Moleculer `Context` instance. It can be `null`. |
| `params` | `Object` | `null` | Parameters for method. |
| `params.query` | `Object` | `null` | The query for finding entities. |
| `params.scope` | `String|Array<String>|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `params.scope` | `String\|Array<String>\|Boolean` | `null` |Scopes for the query. If false, the default scopes are disabled. |
| `opts` | `Object` | `{}` | Other options for internal methods. |
| `opts.transform` | `Boolean` | `true` | If `false`, the result won't be transformed. |
| `opts.softDelete` | `Boolean` | `null` | Disable the enabled soft-delete feature. Only `false` value is acceptable. |
Expand Down
40 changes: 40 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const js = require("@eslint/js");
const globals = require("globals");
const pluginN = require("eslint-plugin-n");
const pluginSecurity = require("eslint-plugin-security");
const prettier = require("eslint-config-prettier");

module.exports = [
js.configs.recommended,
pluginSecurity.configs.recommended,
prettier,
{
plugins: {
n: pluginN,
security: pluginSecurity
},
languageOptions: {
ecmaVersion: 2020,
sourceType: "commonjs",
globals: {
...globals.node,
...globals.jest,
...globals.jasmine
}
},
rules: {
"no-var": "error",
"no-console": "warn",
"no-unused-vars": "warn",
"no-trailing-spaces": "error",
"security/detect-object-injection": "off",
"security/detect-non-literal-require": "off",
"security/detect-non-literal-fs-filename": "off",
"no-process-exit": "off",
"n/no-unpublished-require": "off",
"require-atomic-updates": "off",
"object-curly-spacing": ["warn", "always"],
"no-useless-assignment": "off"
}
}
];
Loading
Loading