@furystack/mongodb-store 11.0.3 → 11.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +215 -199
- package/LICENSE +339 -339
- package/README.md +51 -51
- package/esm/store-manager-helpers.d.ts +33 -0
- package/esm/store-manager-helpers.d.ts.map +1 -0
- package/esm/store-manager-helpers.js +15 -0
- package/esm/store-manager-helpers.js.map +1 -0
- package/package.json +7 -7
- package/src/define-mongodb-store.spec.ts +108 -108
- package/src/define-mongodb-store.ts +58 -58
- package/src/index.ts +3 -3
- package/src/mongo-client-factory.ts +45 -45
- package/src/mongodb-store.spec.ts +140 -140
- package/src/mongodb-store.ts +207 -207
package/CHANGELOG.md
CHANGED
|
@@ -1,199 +1,215 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [11.0.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
###
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
###
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
## [
|
|
55
|
-
|
|
56
|
-
###
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
### ⬆️ Dependencies
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- `
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
### ⬆️ Dependencies
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
### 🔧 Chores
|
|
198
|
-
|
|
199
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [11.0.5] - 2026-11-14
|
|
4
|
+
|
|
5
|
+
### Dependencies
|
|
6
|
+
|
|
7
|
+
- Patch release to include updated FuryStack dependency versions
|
|
8
|
+
|
|
9
|
+
### ⬆️ Dependencies
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## [11.0.4] - 2026-09-18
|
|
14
|
+
|
|
15
|
+
### ⬆️ Dependencies
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## [11.0.3] - 2026-08-26
|
|
20
|
+
|
|
21
|
+
### ⬆️ Dependencies
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- Bumped `mongodb` to `7.5.0` and raised dev `typescript` to `^7.0.2`, `@types/node` to `^26.1.1`, and `vitest` to `^4.1.10`. No source changes — dependency bump only.
|
|
25
|
+
|
|
26
|
+
## [11.0.2] - 2026-06-05
|
|
27
|
+
|
|
28
|
+
### 👷 CI
|
|
29
|
+
|
|
30
|
+
- Raised the minimum supported Node.js to `>=24.0.0` (Node 24 LTS) in `engines`, dropping Node 22.
|
|
31
|
+
|
|
32
|
+
### ⬆️ Dependencies
|
|
33
|
+
|
|
34
|
+
- Bumped dev `vitest` to `^4.1.8`. No source changes — dev-tooling bump only.
|
|
35
|
+
|
|
36
|
+
## [11.0.1] - 2026-05-21
|
|
37
|
+
|
|
38
|
+
### ♻️ Refactoring
|
|
39
|
+
|
|
40
|
+
### `update` throws `NotFoundError` for missing entities
|
|
41
|
+
|
|
42
|
+
`MongodbStore.update` now throws `NotFoundError` from `@furystack/core` (instead of a plain `Error`) when no document matches the given id. Callers can branch on `instanceof NotFoundError` without parsing messages. The message was tightened from `... cannot update!` to `... cannot update` — substring matches that look for `cannot update` keep working.
|
|
43
|
+
|
|
44
|
+
### ⬆️ Dependencies
|
|
45
|
+
|
|
46
|
+
- Bump `mongodb` to `7.2.0`.
|
|
47
|
+
- Bump dev `vitest` to `^4.1.5`.
|
|
48
|
+
- Bumped `@types/node` to `^25.9.1` and `vitest` to `^4.1.7`. No source changes — dev-tooling bump only.
|
|
49
|
+
|
|
50
|
+
### 📚 Documentation
|
|
51
|
+
|
|
52
|
+
- Rewrote JSDoc on `MongodbStore`, `defineMongodbStore`, and `MongoClientFactory` to follow the new value-test guidance: dropped restate-the-type narration, called out the lazy-init contract, the `_id`/`ObjectId` coercion behavior, and the fact that the store has no `[Symbol.asyncDispose]` because client lifetime belongs to the factory.
|
|
53
|
+
|
|
54
|
+
## [11.0.0] - 2026-04-25
|
|
55
|
+
|
|
56
|
+
### 💥 Breaking Changes
|
|
57
|
+
|
|
58
|
+
Stores are now first-class DI tokens. See the [v7 migration guide](../../docs/migrations/v7-functional-di.md) for rationale, recipes, and pitfalls.
|
|
59
|
+
|
|
60
|
+
- Removed `useMongoDb(...)`. Declare the store at module scope with `defineMongoDbStore<T, PK>({ name, model, primaryKey, url, db, collection, options? })`.
|
|
61
|
+
- `MongoClientFactory` is now an exported interface + `defineService({ lifetime: 'singleton' })` token. It pools `MongoClient` instances per URL and closes every pooled client on injector teardown.
|
|
62
|
+
- Dropped the unused `EventHub<{ onClientCreated, onDisposed }>` surface from the factory (no consumers in-repo).
|
|
63
|
+
|
|
64
|
+
## [10.1.7] - 2026-04-17
|
|
65
|
+
|
|
66
|
+
### ⬆️ Dependencies
|
|
67
|
+
|
|
68
|
+
- Raised `@types/node` to ^25.6.0, `typescript` to ^6.0.3, and `vitest` to ^4.1.4 so package development matches the workspace toolchain.
|
|
69
|
+
|
|
70
|
+
## [10.1.6] - 2026-03-27
|
|
71
|
+
|
|
72
|
+
### ⬆️ Dependencies
|
|
73
|
+
|
|
74
|
+
- Updated `vitest` to ^4.1.2
|
|
75
|
+
|
|
76
|
+
## [10.1.5] - 2026-03-25
|
|
77
|
+
|
|
78
|
+
### 📦 Build
|
|
79
|
+
|
|
80
|
+
- Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility
|
|
81
|
+
|
|
82
|
+
### ⬆️ Dependencies
|
|
83
|
+
|
|
84
|
+
- Upgraded `typescript` from ^5.9.3 to ^6.0.2
|
|
85
|
+
- Upgraded `vitest` from ^4.1.0 to ^4.1.1
|
|
86
|
+
- Upgraded `mongodb` from 7.1.0 to 7.1.1
|
|
87
|
+
|
|
88
|
+
## [10.1.4] - 2026-03-19
|
|
89
|
+
|
|
90
|
+
### ✨ Features
|
|
91
|
+
|
|
92
|
+
- Updated `@furystack/core` dependency to the latest major version.
|
|
93
|
+
- Added `MongoClientFactory` lifecycle events (`onClientCreated`, `onDisposed`).
|
|
94
|
+
|
|
95
|
+
### ⬆️ Dependencies
|
|
96
|
+
|
|
97
|
+
- Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
|
|
98
|
+
- Upgraded `vitest` from ^4.0.18 to ^4.1.0
|
|
99
|
+
- Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
|
|
100
|
+
|
|
101
|
+
## [10.1.3] - 2026-03-10
|
|
102
|
+
|
|
103
|
+
### ⬆️ Dependencies
|
|
104
|
+
|
|
105
|
+
- Updated `@furystack/core` dependency to the new major version
|
|
106
|
+
|
|
107
|
+
## [10.1.2] - 2026-03-07
|
|
108
|
+
|
|
109
|
+
### ⬆️ Dependencies
|
|
110
|
+
|
|
111
|
+
- Updated `@types/node` from `^25.3.1` to `^25.3.5`
|
|
112
|
+
|
|
113
|
+
## [10.1.1] - 2026-03-06
|
|
114
|
+
|
|
115
|
+
### ⬆️ Dependencies
|
|
116
|
+
|
|
117
|
+
- Updated internal FuryStack dependencies
|
|
118
|
+
|
|
119
|
+
## [10.1.0] - 2026-03-03
|
|
120
|
+
|
|
121
|
+
### ✨ Features
|
|
122
|
+
|
|
123
|
+
### Lifecycle events in `MongoClientFactory`
|
|
124
|
+
|
|
125
|
+
`MongoClientFactory` now extends `EventHub` and emits events for client lifecycle:
|
|
126
|
+
|
|
127
|
+
- `onClientCreated` — emitted when a new MongoDB client is created, with `{ url }`
|
|
128
|
+
- `onDisposed` — emitted when the factory is disposed
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
const factory = injector.getInstance(MongoClientFactory)
|
|
132
|
+
|
|
133
|
+
factory.addListener('onClientCreated', ({ url }) => {
|
|
134
|
+
console.log(`MongoDB client created for ${url}`)
|
|
135
|
+
})
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 🧪 Tests
|
|
139
|
+
|
|
140
|
+
- Added tests for `onClientCreated` event emission on new client creation
|
|
141
|
+
- Added test verifying `onClientCreated` is not emitted when returning a cached client
|
|
142
|
+
|
|
143
|
+
## [10.0.41] - 2026-02-26
|
|
144
|
+
|
|
145
|
+
### ⬆️ Dependencies
|
|
146
|
+
|
|
147
|
+
- Updated internal `@furystack/*` dependencies
|
|
148
|
+
- Bumped `@types/node` from ^25.3.0 to ^25.3.1
|
|
149
|
+
|
|
150
|
+
## [10.0.40] - 2026-02-26
|
|
151
|
+
|
|
152
|
+
### 📝 Documentation
|
|
153
|
+
|
|
154
|
+
- Added tip about wrapping the physical store with a Repository DataSet for application-level data access
|
|
155
|
+
|
|
156
|
+
## [10.0.39] - 2026-02-22
|
|
157
|
+
|
|
158
|
+
### ⬆️ Dependencies
|
|
159
|
+
|
|
160
|
+
- Updated `@furystack/core` dependency
|
|
161
|
+
|
|
162
|
+
## [10.0.38] - 2026-02-19
|
|
163
|
+
|
|
164
|
+
### ⬆️ Dependencies
|
|
165
|
+
|
|
166
|
+
- Updated `@furystack/core`
|
|
167
|
+
|
|
168
|
+
## [10.0.37] - 2026-02-11
|
|
169
|
+
|
|
170
|
+
### ♻️ Refactoring
|
|
171
|
+
|
|
172
|
+
- Replaced semaphore-based initialization lock with promise deduplication for MongoDB collection setup. Concurrent calls to `getCollection()` now reuse a single in-flight initialization promise instead of queuing behind a semaphore. On initialization failure, the promise is reset to allow retry.
|
|
173
|
+
|
|
174
|
+
### ⬆️ Dependencies
|
|
175
|
+
|
|
176
|
+
- Bump `mongodb` from `7.0.0` to `7.1.0`
|
|
177
|
+
- Bump `vitest` from `^4.0.17` to `^4.0.18`
|
|
178
|
+
- Bump `@types/node` from `^25.0.10` to `^25.2.3`
|
|
179
|
+
- Removed `semaphore-async-await` dependency
|
|
180
|
+
- Updated internal dependencies
|
|
181
|
+
|
|
182
|
+
## [10.0.36] - 2026-02-09
|
|
183
|
+
|
|
184
|
+
### ⬆️ Dependencies
|
|
185
|
+
|
|
186
|
+
- Updated `@furystack/core` dependency
|
|
187
|
+
- Updated `@furystack/*` dependencies
|
|
188
|
+
|
|
189
|
+
## [10.0.35] - 2026-01-26
|
|
190
|
+
|
|
191
|
+
### 🔧 Chores
|
|
192
|
+
|
|
193
|
+
- Standardized author format, improved keywords, removed obsolete `gitHead`, added `engines` (Node 22+) and `sideEffects: false`
|
|
194
|
+
|
|
195
|
+
## [10.0.34] - 2026-01-26
|
|
196
|
+
|
|
197
|
+
### 🔧 Chores
|
|
198
|
+
|
|
199
|
+
- Fixed repository URL in package.json from `furystack/core` to `furystack/furystack`
|
|
200
|
+
|
|
201
|
+
## [10.0.33] - 2026-01-26
|
|
202
|
+
|
|
203
|
+
### ⬆️ Dependencies
|
|
204
|
+
|
|
205
|
+
- Updated `@furystack/inject` with fix for singleton injector reference being overwritten by child injectors
|
|
206
|
+
|
|
207
|
+
## [10.0.32] - 2026-01-22
|
|
208
|
+
|
|
209
|
+
### ⬆️ Dependencies
|
|
210
|
+
|
|
211
|
+
- Dependency updates
|
|
212
|
+
|
|
213
|
+
### 🔧 Chores
|
|
214
|
+
|
|
215
|
+
- Migrated to centralized changelog management system
|