ueberdb2 4.1.8 → 4.1.10

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.
Files changed (37) hide show
  1. package/dist/databases/cassandra_db.js +233 -235
  2. package/dist/databases/couch_db.js +171 -173
  3. package/dist/databases/dirty_db.js +73 -76
  4. package/dist/databases/dirty_git_db.js +57 -75
  5. package/dist/databases/elasticsearch_db.js +241 -267
  6. package/dist/databases/memory_db.js +35 -37
  7. package/dist/databases/mock_db.js +36 -38
  8. package/dist/databases/mongodb_db.js +131 -133
  9. package/dist/databases/mssql_db.js +183 -185
  10. package/dist/databases/mysql_db.js +166 -168
  11. package/dist/databases/postgres_db.js +188 -190
  12. package/dist/databases/postgrespool_db.js +10 -10
  13. package/dist/databases/redis_db.js +118 -120
  14. package/dist/databases/rethink_db.js +119 -121
  15. package/dist/databases/sqlite_db.js +135 -137
  16. package/dist/index.js +195 -213
  17. package/lib/AbstractDatabase.ts +79 -0
  18. package/lib/CacheAndBufferLayer.ts +665 -0
  19. package/lib/logging.ts +32 -0
  20. package/package.json +16 -12
  21. package/dist/lib/AbstractDatabase.js +0 -38
  22. package/dist/lib/CacheAndBufferLayer.js +0 -657
  23. package/dist/lib/logging.js +0 -34
  24. package/dist/test/lib/databases.js +0 -74
  25. package/dist/test/test.js +0 -327
  26. package/dist/test/test_bulk.js +0 -74
  27. package/dist/test/test_elasticsearch.js +0 -157
  28. package/dist/test/test_findKeys.js +0 -69
  29. package/dist/test/test_flush.js +0 -83
  30. package/dist/test/test_getSub.js +0 -57
  31. package/dist/test/test_lru.js +0 -155
  32. package/dist/test/test_memory.js +0 -59
  33. package/dist/test/test_metrics.js +0 -772
  34. package/dist/test/test_mysql.js +0 -90
  35. package/dist/test/test_postgres.js +0 -40
  36. package/dist/test/test_setSub.js +0 -48
  37. package/dist/test/test_tojson.js +0 -62
package/package.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "name": "ueberdb2",
3
3
  "description": "Transform every database into a object key value store",
4
4
  "url": "https://github.com/ether/ueberDB",
5
+ "type": "commonjs",
5
6
  "keywords": [
6
7
  "database",
7
8
  "keyvalue"
@@ -33,7 +34,7 @@
33
34
  "pg": "^8.11.1",
34
35
  "redis": "^4.6.7",
35
36
  "rethinkdb": "^2.4.2",
36
- "semver": "^7.5.3",
37
+ "semver": "^7.5.4",
37
38
  "simple-git": "^3.19.1"
38
39
  },
39
40
  "optionalDependencies": {
@@ -43,41 +44,44 @@
43
44
  "@types/async": "^3.2.20",
44
45
  "@types/mocha": "^10.0.1",
45
46
  "@types/mssql": "^8.1.2",
46
- "@types/mongodb": "^4.0.7",
47
47
  "@types/mysql": "^2.15.21",
48
- "@types/node": "^20.4.0",
48
+ "@types/node": "^20.4.2",
49
49
  "@types/pg": "^8.10.2",
50
50
  "@types/rethinkdb": "^2.3.17",
51
51
  "cli-table": "^0.3.11",
52
52
  "eslint": "^8.44.0",
53
- "eslint-config-etherpad": "^3.0.13",
53
+ "eslint-config-etherpad": "^3.0.16",
54
54
  "mocha": "^10.2.0",
55
55
  "randexp": "^0.5.3",
56
- "ts-migrate": "^0.1.35",
57
- "ts-node": "^10.9.1",
58
56
  "typescript": "^4.9.5",
59
- "wtfnode": "^0.9.1"
57
+ "wtfnode": "^0.9.1",
58
+ "rollup": "^3.26.2",
59
+ "rollup-plugin-typescript2": "^0.35.0",
60
+ "@rollup/plugin-node-resolve": "^15.1.0",
61
+ "glob": "^10.3.3"
60
62
  },
61
63
  "repository": {
62
64
  "type": "git",
63
65
  "url": "https://github.com/ether/ueberDB.git"
64
66
  },
65
67
  "main": "./dist/index",
66
- "version": "4.1.8",
68
+ "version": "4.1.10",
67
69
  "bugs": {
68
70
  "url": "https://github.com/ether/ueberDB/issues"
69
71
  },
70
72
  "files": [
71
- "dist"
73
+ "dist/databases",
74
+ "dist/index.js",
75
+ "lib"
72
76
  ],
73
77
  "homepage": "https://github.com/ether/ueberDB",
74
78
  "scripts": {
75
79
  "lint": "eslint .",
76
80
  "lint:fix": "eslint --fix .",
77
- "test": "tsc && mocha ./dist/test/test*.js",
81
+ "test": "mocha ./dist/test/test*.js",
78
82
  "test:watch": "mocha ./dist/test/test*.js --watch",
79
- "test-debug": "tsc && mocha --inspect-brk ./dist/test/test*.js",
80
- "build": "tsc"
83
+ "test-debug": "npx rollup -c rollup.config.cjs && mocha --inspect-brk ./dist/test/test*.js",
84
+ "build": "npx rollup -c rollup.config.cjs"
81
85
  },
82
86
  "_npmUser": {
83
87
  "name": "johnyma22",
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const logging_1 = require("./logging");
4
- const nullLogger = (0, logging_1.normalizeLogger)(null);
5
- // Format: All characters match themselves except * matches any zero or more characters. No
6
- // backslash escaping is supported, so it is impossible to create a pattern that matches only the
7
- // '*' character.
8
- const simpleGlobToRegExp = (s) => s.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
9
- class AbstractDatabase {
10
- logger;
11
- // @ts-ignore
12
- settings;
13
- constructor() {
14
- if (new.target === module.exports) {
15
- throw new TypeError('cannot instantiate Abstract Database directly');
16
- }
17
- for (const fn of ['init', 'close', 'get', 'findKeys', 'remove', 'set']) {
18
- // @ts-ignore
19
- if (typeof this[fn] !== 'function')
20
- throw new TypeError(`method ${fn} not defined`);
21
- }
22
- this.logger = nullLogger;
23
- }
24
- /**
25
- * For findKey regex. Used by document dbs like mongodb or dirty.
26
- */
27
- createFindRegex(key, notKey) {
28
- let regex = `^(?=${simpleGlobToRegExp(key)}$)`;
29
- if (notKey != null)
30
- regex += `(?!${simpleGlobToRegExp(notKey)}$)`;
31
- return new RegExp(regex);
32
- }
33
- doBulk(operations, cb) {
34
- throw new Error('the doBulk method must be implemented if write caching is enabled');
35
- }
36
- get isAsync() { return false; }
37
- }
38
- exports.default = AbstractDatabase;