@feathersjs/mongodb 5.0.0-pre.34 → 5.0.0-pre.35

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
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **databases:** Make sure adapter method signatures are exported properly ([#2943](https://github.com/feathersjs/feathers/issues/2943)) ([458d668](https://github.com/feathersjs/feathers/commit/458d66859e256c5854e7590f0b4a11b233fe0374))
11
+
12
+ ### Features
13
+
14
+ - **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17))
15
+
6
16
  # [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14)
7
17
 
8
18
  ### Bug Fixes
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PaginationOptions } from '@feathersjs/adapter-commons';
2
2
  import { Paginated, Params } from '@feathersjs/feathers';
3
- import { AdapterId, MongoDbAdapter, MongoDBAdapterParams } from './adapter';
3
+ import { AdapterId, MongoDbAdapter, MongoDBAdapterParams, NullableAdapterId } from './adapter';
4
4
  export * from './adapter';
5
5
  export * from './error-handler';
6
6
  export * from './resolvers';
@@ -15,9 +15,12 @@ export declare class MongoDBService<Result = any, Data = Partial<Result>, Servic
15
15
  get(id: AdapterId, params?: ServiceParams): Promise<Result>;
16
16
  create(data: Data, params?: ServiceParams): Promise<Result>;
17
17
  create(data: Data[], params?: ServiceParams): Promise<Result[]>;
18
+ create(data: Data | Data[], params?: ServiceParams): Promise<Result | Result[]>;
18
19
  update(id: AdapterId, data: Data, params?: ServiceParams): Promise<Result>;
19
20
  patch(id: null, data: PatchData, params?: ServiceParams): Promise<Result[]>;
20
21
  patch(id: AdapterId, data: PatchData, params?: ServiceParams): Promise<Result>;
22
+ patch(id: NullableAdapterId, data: PatchData, params?: ServiceParams): Promise<Result | Result[]>;
21
23
  remove(id: AdapterId, params?: ServiceParams): Promise<Result>;
22
24
  remove(id: null, params?: ServiceParams): Promise<Result[]>;
25
+ remove(id: NullableAdapterId, params?: ServiceParams): Promise<Result | Result[]>;
23
26
  }
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,gDAAyD;AAEzD,uCAA8F;AAE9F,4CAAyB;AACzB,kDAA+B;AAC/B,8CAA2B;AAE3B,MAAa,cAKX,SAAQ,wBAAsD;IAI9D,KAAK,CAAC,IAAI,CAAC,MAAsB;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC;YAChB,GAAG,MAAM;YACT,KAAK,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAa,EAAE,MAAsB;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;YACnB,GAAG,MAAM;YACT,KAAK,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,MAAM,CAAC,IAAmB,EAAE,MAAsB;QACtD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YAC9D,MAAM,IAAI,sBAAgB,CAAC,iCAAiC,CAAC,CAAA;SAC9D;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,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CAAA;IACJ,CAAC;CACF;AAhED,wCAgEC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@feathersjs/mongodb",
3
3
  "description": "Feathers MongoDB service adapter",
4
- "version": "5.0.0-pre.34",
4
+ "version": "5.0.0-pre.35",
5
5
  "homepage": "https://feathersjs.com",
6
6
  "main": "lib/",
7
7
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "scripts": {
42
42
  "prepublish": "npm run compile",
43
- "pack": "npm pack --pack-destination ../cli/test/build",
43
+ "pack": "npm pack --pack-destination ../generators/test/build",
44
44
  "compile": "shx rm -rf lib/ && tsc && npm run pack",
45
45
  "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
46
46
  },
@@ -51,22 +51,22 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@feathersjs/adapter-commons": "^5.0.0-pre.34",
55
- "@feathersjs/commons": "^5.0.0-pre.34",
56
- "@feathersjs/errors": "^5.0.0-pre.34",
57
- "@feathersjs/feathers": "^5.0.0-pre.34"
54
+ "@feathersjs/adapter-commons": "^5.0.0-pre.35",
55
+ "@feathersjs/commons": "^5.0.0-pre.35",
56
+ "@feathersjs/errors": "^5.0.0-pre.35",
57
+ "@feathersjs/feathers": "^5.0.0-pre.35"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "mongodb": "^4.5.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@feathersjs/adapter-tests": "^5.0.0-pre.34",
63
+ "@feathersjs/adapter-tests": "^5.0.0-pre.35",
64
64
  "@types/mocha": "^10.0.1",
65
- "@types/node": "^18.11.10",
66
- "mocha": "^10.1.0",
67
- "mongodb-memory-server": "^8.10.1",
65
+ "@types/node": "^18.11.18",
66
+ "mocha": "^10.2.0",
67
+ "mongodb-memory-server": "^8.10.2",
68
68
  "shx": "^0.3.4",
69
- "typescript": "^4.9.3"
69
+ "typescript": "^4.9.4"
70
70
  },
71
- "gitHead": "42cca600d00f0b3b9d89fa79be30fcd46bc50132"
71
+ "gitHead": "c641598d9a4de3ceda10f56cf2af288a4236b15e"
72
72
  }
package/src/index.ts CHANGED
@@ -32,6 +32,7 @@ export class MongoDBService<
32
32
 
33
33
  async create(data: Data, params?: ServiceParams): Promise<Result>
34
34
  async create(data: Data[], params?: ServiceParams): Promise<Result[]>
35
+ async create(data: Data | Data[], params?: ServiceParams): Promise<Result | Result[]>
35
36
  async create(data: Data | Data[], params?: ServiceParams): Promise<Result | Result[]> {
36
37
  if (Array.isArray(data) && !this.allowsMulti('create', params)) {
37
38
  throw new MethodNotAllowed('Can not create multiple entries')
@@ -49,6 +50,7 @@ export class MongoDBService<
49
50
 
50
51
  async patch(id: null, data: PatchData, params?: ServiceParams): Promise<Result[]>
51
52
  async patch(id: AdapterId, data: PatchData, params?: ServiceParams): Promise<Result>
53
+ async patch(id: NullableAdapterId, data: PatchData, params?: ServiceParams): Promise<Result | Result[]>
52
54
  async patch(id: NullableAdapterId, data: PatchData, params?: ServiceParams): Promise<Result | Result[]> {
53
55
  const { $limit, ...query } = await this.sanitizeQuery(params)
54
56
 
@@ -60,6 +62,7 @@ export class MongoDBService<
60
62
 
61
63
  async remove(id: AdapterId, params?: ServiceParams): Promise<Result>
62
64
  async remove(id: null, params?: ServiceParams): Promise<Result[]>
65
+ async remove(id: NullableAdapterId, params?: ServiceParams): Promise<Result | Result[]>
63
66
  async remove(id: NullableAdapterId, params?: ServiceParams): Promise<Result | Result[]> {
64
67
  const { $limit, ...query } = await this.sanitizeQuery(params)
65
68