uranio 0.1.54 → 0.1.56

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.
@@ -33,4 +33,4 @@ class MongoDBClient {
33
33
  }
34
34
  }
35
35
  exports.MongoDBClient = MongoDBClient;
36
- //# sourceMappingURL=mongodb.js.map
36
+ //# sourceMappingURL=mongodb.js.map
@@ -28,6 +28,6 @@
28
28
  "typescript": "^5.2.2"
29
29
  },
30
30
  "dependencies": {
31
- "uranio": "0.1.54"
31
+ "uranio": "0.1.56"
32
32
  }
33
33
  }
@@ -6,7 +6,11 @@
6
6
  *
7
7
  */
8
8
 
9
- import mongodb, {MongoClient, ServerApiVersion} from 'mongodb';
9
+ import mongodb, {
10
+ MongoClient,
11
+ MongoClientOptions,
12
+ ServerApiVersion,
13
+ } from 'mongodb';
10
14
  import {log} from '../log/index';
11
15
 
12
16
  export type MongoDBClientParams = {
@@ -14,17 +18,18 @@ export type MongoDBClientParams = {
14
18
  db_name: string;
15
19
  };
16
20
 
17
- export class MongoDBClient{
21
+ export class MongoDBClient {
18
22
  protected client: mongodb.MongoClient;
19
23
  protected db: mongodb.Db;
20
24
  constructor(params: MongoDBClientParams) {
21
- this.client = new MongoClient(params.uri, {
25
+ const options = {
22
26
  serverApi: {
23
27
  version: ServerApiVersion.v1,
24
28
  strict: true,
25
29
  deprecationErrors: true,
26
30
  },
27
- });
31
+ } as MongoClientOptions;
32
+ this.client = new MongoClient(params.uri, options);
28
33
  this.db = this.client.db(params.db_name);
29
34
  }
30
35
  public async connect() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uranio",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "description": "Uranio is a type-safe ODM for MongoDB",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "build": "yarn tsc -b",
25
25
  "dev": "yarn tsc -w",
26
26
  "dev:base": "node ./dist/index.js",
27
- "dev:bin:generate": "node ./dist/bin.js generate --root ~/repos/avk-47/core",
27
+ "dev:bin:generate": "node ./dist/bin.js generate --root ~/repos/uranio/builder",
28
28
  "dev:bin:init": "node ./dist/bin.js init",
29
29
  "dev:bin:verbose": "node ./dist/bin.js generate -v -d mysql --root ~/repos/avk-47/core",
30
30
  "dev:bin:version": "node ./dist/bin.js --root ~/repos/uranio/builder",
@@ -61,7 +61,7 @@
61
61
  "inquirer": "^8.0.0",
62
62
  "mongodb": "^6.3.0",
63
63
  "mysql2": "^3.7.0",
64
- "plutonio": "^0.6.1",
64
+ "plutonio": "^0.6.4",
65
65
  "r4y": "^0.6.0",
66
66
  "yaml": "^2.3.4"
67
67
  }