@flowerforce/flowerbase 1.7.6-beta.9 → 1.8.0

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 CHANGED
@@ -1,3 +1,31 @@
1
+ ## 1.8.0 (2026-03-20)
2
+
3
+
4
+ ### 🚀 Features
5
+
6
+ - add config auth database ([#32](https://github.com/flowerforce/flowerbase/pull/32))
7
+
8
+ - add MongoDB Client-Side Field Level Encryption support ([#35](https://github.com/flowerforce/flowerbase/pull/35))
9
+
10
+ - **monitoring:** add date to time column in events section ([#31](https://github.com/flowerforce/flowerbase/pull/31))
11
+
12
+ - **monitoring:** Add collapsable editor ([#34](https://github.com/flowerforce/flowerbase/pull/34))
13
+
14
+
15
+ ### 🩹 Fixes
16
+
17
+ - watch operationType delete ([afcbec2](https://github.com/flowerforce/flowerbase/commit/afcbec2))
18
+
19
+ - propagate runAsSystem ([#41](https://github.com/flowerforce/flowerbase/pull/41))
20
+
21
+ - add setHeader ([#44](https://github.com/flowerforce/flowerbase/pull/44))
22
+
23
+ - complete reset function ([#45](https://github.com/flowerforce/flowerbase/pull/45))
24
+
25
+ - 401 login ([fd13ff0](https://github.com/flowerforce/flowerbase/commit/fd13ff0))
26
+
27
+ - findOne returns {} instead of null ([#50](https://github.com/flowerforce/flowerbase/pull/50))
28
+
1
29
  ## 1.7.5 (2026-03-02)
2
30
 
3
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/mongodb-atlas/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,QAAQ,EAQT,MAAM,SAAS,CAAA;AAOhB,OAAO,EAGL,oBAAoB,EAErB,MAAM,SAAS,CAAA;AA6JhB,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OA0BnD,CAAA;AA8BD,eAAO,MAAM,2BAA2B,GAAI,UAAU,QAAQ,EAAE,YAK5D,CAAA;AAmzCJ,QAAA,MAAM,YAAY,EAAE,oBAwBlB,CAAA;AAEF,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/mongodb-atlas/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,QAAQ,EAQT,MAAM,SAAS,CAAA;AAOhB,OAAO,EAGL,oBAAoB,EAErB,MAAM,SAAS,CAAA;AA6JhB,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,OA0BnD,CAAA;AA8BD,eAAO,MAAM,2BAA2B,GAAI,UAAU,QAAQ,EAAE,YAK5D,CAAA;AAwzCJ,QAAA,MAAM,YAAY,EAAE,oBAwBlB,CAAA;AAEF,eAAe,YAAY,CAAA"}
@@ -486,6 +486,10 @@ const getOperators = (mongo, { rules, dbName, collName, user, run_as_system, mon
486
486
  result
487
487
  });
488
488
  logService('findOne result', { collName, result });
489
+ if (result === null) {
490
+ emitMongoEvent('findOne');
491
+ return null;
492
+ }
489
493
  const winningRole = (0, utils_2.getWinningRole)(result, user, roles);
490
494
  logDebug('findOne winningRole', {
491
495
  collection: collName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowerforce/flowerbase",
3
- "version": "1.7.6-beta.9",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -268,6 +268,32 @@ describe('mongodb-atlas Realm compatibility', () => {
268
268
  expect(findOne).toHaveBeenCalledWith({}, undefined)
269
269
  })
270
270
 
271
+ it('returns null from findOne when no document matches, even with permissive roles', async () => {
272
+ const findOne = jest.fn().mockResolvedValue(null)
273
+ const collection = {
274
+ collectionName: 'todos',
275
+ findOne
276
+ }
277
+ const operators = MongoDbAtlas(createAppWithCollection(collection) as any, {
278
+ rules: createRules({
279
+ roles: [
280
+ {
281
+ name: 'Others',
282
+ apply_when: {},
283
+ read: true,
284
+ search: true
285
+ } as any
286
+ ]
287
+ }),
288
+ user: { id: 'user-1' }
289
+ }).db('db').collection('todos')
290
+
291
+ const result = await operators.findOne({ _id: new ObjectId() })
292
+
293
+ expect(result).toBeNull()
294
+ expect(findOne).toHaveBeenCalledWith({ $and: [{ _id: expect.any(ObjectId) }] }, undefined)
295
+ })
296
+
271
297
  it('keeps write-only field permissions readable in findOne responses', async () => {
272
298
  const doc = {
273
299
  _id: new ObjectId(),
@@ -599,6 +599,11 @@ const getOperators: GetOperatorsFunction = (
599
599
  })
600
600
  logService('findOne result', { collName, result })
601
601
 
602
+ if (result === null) {
603
+ emitMongoEvent('findOne')
604
+ return null
605
+ }
606
+
602
607
  const winningRole = getWinningRole(result, user, roles)
603
608
 
604
609
  logDebug('findOne winningRole', {