@builderbot/database-mongo 1.0.14-alpha.0 → 1.0.15-alpha.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/dist/index.cjs +4 -2
- package/dist/mongoAdapter.d.ts +2 -1
- package/dist/mongoAdapter.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var bot = require('@builderbot/bot');
|
|
3
4
|
var mongodb = require('mongodb');
|
|
4
5
|
|
|
5
|
-
class MongoAdapter {
|
|
6
|
+
class MongoAdapter extends bot.MemoryDB {
|
|
6
7
|
constructor(_credentials) {
|
|
8
|
+
super();
|
|
7
9
|
this.db = null;
|
|
8
10
|
this.listHistory = [];
|
|
9
11
|
this.credentials = { dbUri: null, dbName: null };
|
|
@@ -26,12 +28,12 @@ class MongoAdapter {
|
|
|
26
28
|
return result[0];
|
|
27
29
|
};
|
|
28
30
|
this.save = async (ctx) => {
|
|
31
|
+
this.listHistory.push(ctx);
|
|
29
32
|
const ctxWithDate = {
|
|
30
33
|
...ctx,
|
|
31
34
|
date: new Date(),
|
|
32
35
|
};
|
|
33
36
|
await this.db.collection('history').insertOne(ctxWithDate);
|
|
34
|
-
this.listHistory.push(ctx);
|
|
35
37
|
};
|
|
36
38
|
this.credentials = _credentials;
|
|
37
39
|
this.init().then();
|
package/dist/mongoAdapter.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { MemoryDB } from '@builderbot/bot';
|
|
1
2
|
import { Db } from 'mongodb';
|
|
2
3
|
|
|
3
4
|
import { History, MongoAdapterCredentials } from './types';
|
|
4
|
-
declare class MongoAdapter {
|
|
5
|
+
declare class MongoAdapter extends MemoryDB {
|
|
5
6
|
db: Db | null;
|
|
6
7
|
listHistory: History[];
|
|
7
8
|
credentials: MongoAdapterCredentials;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongoAdapter.d.ts","sourceRoot":"","sources":["../src/mongoAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAE1D,cAAM,
|
|
1
|
+
{"version":3,"file":"mongoAdapter.d.ts","sourceRoot":"","sources":["../src/mongoAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAe,EAAE,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAE1D,cAAM,YAAa,SAAQ,QAAQ;IAC/B,EAAE,EAAE,EAAE,GAAG,IAAI,CAAO;IACpB,WAAW,EAAE,OAAO,EAAE,CAAK;IAC3B,WAAW,EAAE,uBAAuB,CAAgC;gBAExD,YAAY,EAAE,uBAAuB;IAMjD,IAAI,QAAa,QAAQ,OAAO,CAAC,CAahC;IAED,eAAe,SAAgB,MAAM,KAAG,QAAQ,GAAG,CAAC,CAGnD;IAED,IAAI,QAAe,OAAO,KAAG,QAAQ,IAAI,CAAC,CAOzC;CACJ;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builderbot/database-mongo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15-alpha.0",
|
|
4
4
|
"description": "Esto es el conector a mongo DB",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Leifer Mendez <leifer33@gmail.com>",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@builderbot/bot": "^1.0.15-alpha.0",
|
|
33
34
|
"mongodb": "^4.17.2"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
@@ -46,5 +47,5 @@
|
|
|
46
47
|
"tslib": "^2.6.2",
|
|
47
48
|
"tsm": "^2.3.0"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1c27b9a265b8b8649bcc6d5c05c5265077a0047d"
|
|
50
51
|
}
|