diff --git a/package-lock.json b/package-lock.json index ce34083..6de0bd6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@hibas123/realtimedb", - "version": "2.0.1-0", + "version": "2.0.0-beta.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -225,12 +225,6 @@ "@types/mime": "*" } }, - "@types/shortid": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/shortid/-/shortid-0.0.29.tgz", - "integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps=", - "dev": true - }, "@types/ws": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.3.tgz", @@ -3290,14 +3284,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "shortid": { - "version": "2.2.15", - "resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.15.tgz", - "integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==", - "requires": { - "nanoid": "^2.1.0" - } - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", diff --git a/package.json b/package.json index 6fd9b96..f411a48 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "typescript": "^3.6.4" }, "dependencies": { - "@hibas123/logging": "^2.1.1", "@hibas123/nodelogging": "^2.1.1", "@hibas123/utils": "^2.1.1", "dotenv": "^8.2.0", diff --git a/src/config.ts b/src/config.ts index 6d5659f..602734b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,6 @@ import Logging from "@hibas123/nodelogging"; import * as dotenv from "dotenv"; +import { LoggingTypes } from "@hibas123/logging"; dotenv.config() @@ -17,4 +18,8 @@ const config: IConfig = { dev: (process.env.DEV || "").toLowerCase() === "true" } +if (config.dev) { + Logging.logLevel = LoggingTypes.Log; +} + export default config; \ No newline at end of file diff --git a/src/connection.ts b/src/connection.ts index e3ea3ed..62c8869 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -1,7 +1,7 @@ import * as WebSocket from "ws"; import { Server, IncomingMessage } from "http"; import { DatabaseManager } from "./database/database"; -import Logging from "@hibas123/logging"; +import Logging from "@hibas123/nodelogging"; import { Query, CollectionQuery, DocumentQuery } from "./database/query"; import Session from "./database/session"; import nanoid = require("nanoid"); diff --git a/src/database/query.ts b/src/database/query.ts index 5726770..fa568e6 100644 --- a/src/database/query.ts +++ b/src/database/query.ts @@ -440,13 +440,11 @@ export class CollectionQuery extends Query { let data = decode(value); if (this.fitsWhere(data)) { - Logging.debug("Found fitting") - if (this.limit < 0 || value.length < this.limit) { + if (this.limit < 0 || values.length < this.limit) { values.push({ id, data }); - } else { stream.end((err) => err ? no(err) : yes(values)) diff --git a/src/web/helper/hb.ts b/src/web/helper/hb.ts index e25120a..56537a3 100644 --- a/src/web/helper/hb.ts +++ b/src/web/helper/hb.ts @@ -1,7 +1,7 @@ import * as Handlebars from "handlebars"; import { readFileSync } from "fs"; import config from "../../config"; -import Logging from "@hibas123/logging"; +import Logging from "@hibas123/nodelogging"; function checkCondition(v1, operator, v2) { diff --git a/src/web/v1/admin.ts b/src/web/v1/admin.ts index 8fe7dea..3b4da82 100644 --- a/src/web/v1/admin.ts +++ b/src/web/v1/admin.ts @@ -6,7 +6,7 @@ import { BadRequestError, NoPermissionError } from "../helper/errors"; import { DatabaseManager } from "../../database/database"; import { MP } from "../../database/query"; import config from "../../config"; -import Logging from "@hibas123/logging"; +import Logging from "@hibas123/nodelogging"; import { getView } from "../helper/hb"; const AdminRoute = new Router();