@live-change/db-server 0.8.20 → 0.8.21
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/lib/Server.js +6 -6
- package/package.json +13 -13
- package/LICENSE.md +0 -11
- package/ai/metadata.json.bak +0 -1048
- package/vole-apps.db.bak/metadata.json.bak +0 -2786
package/lib/Server.js
CHANGED
|
@@ -283,14 +283,14 @@ class Server {
|
|
|
283
283
|
}
|
|
284
284
|
async checkInfoIntegrity() {
|
|
285
285
|
for(const dbName in this.metadata.databases) {
|
|
286
|
-
if(dbName
|
|
286
|
+
if(dbName !== 'system') {
|
|
287
287
|
const metadata = this.metadata.databases[dbName]
|
|
288
288
|
const indexesTable = this.databases.get('system').table(dbName + '_indexes')
|
|
289
289
|
const indexesInfo = await indexesTable.rangeGet({})
|
|
290
290
|
const infoByName = new Map()
|
|
291
291
|
for(const indexInfo of indexesInfo) {
|
|
292
292
|
const indexMeta = metadata.indexes[indexInfo.name]
|
|
293
|
-
if(!indexMeta || (indexMeta.uid
|
|
293
|
+
if(!indexMeta || (indexMeta.uid !== indexInfo.id)) {
|
|
294
294
|
console.error("CORRUPTED INDEX INFO", indexInfo.name, indexInfo.id)
|
|
295
295
|
console.log("DELETING CORRUPTED INFO")
|
|
296
296
|
await indexesTable.delete(indexInfo.id)
|
|
@@ -370,7 +370,7 @@ class Server {
|
|
|
370
370
|
})
|
|
371
371
|
wsServer.on("request",(request) => {
|
|
372
372
|
debug("WS URI", request.httpRequest.url, "FROM", request.remoteAddress)
|
|
373
|
-
if(request.httpRequest.url
|
|
373
|
+
if(request.httpRequest.url !== "/api/ws") return request.reject()
|
|
374
374
|
let serverConnection = new ReactiveDaoWebsocketServer(request)
|
|
375
375
|
this.apiServer.handleConnection(serverConnection)
|
|
376
376
|
})
|
|
@@ -412,18 +412,18 @@ class Server {
|
|
|
412
412
|
|
|
413
413
|
const databaseName = pathParts[0]
|
|
414
414
|
const objectDir = pathParts[1]
|
|
415
|
-
if(objectDir
|
|
415
|
+
if(objectDir === 'query.js') {
|
|
416
416
|
console.error("error in query to database", databaseName)
|
|
417
417
|
return
|
|
418
418
|
}
|
|
419
419
|
const database = this.databases.get(databaseName)
|
|
420
|
-
if(objectDir
|
|
420
|
+
if(objectDir !== 'indexes') {
|
|
421
421
|
console.error(`unknown object dir ${objectDir}, something is wrong, exiting...`)
|
|
422
422
|
process.exit(1)
|
|
423
423
|
}
|
|
424
424
|
const indexName = pathParts[2]
|
|
425
425
|
if(!database) {
|
|
426
|
-
if(this.initializingDatabase.name
|
|
426
|
+
if(this.initializingDatabase.name !== databaseName) {
|
|
427
427
|
console.error('error in non existing database?!', databaseName)
|
|
428
428
|
process.exit(1)
|
|
429
429
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.21",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"tape": "^5.7.4"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@live-change/dao": "
|
|
33
|
-
"@live-change/dao-message": "
|
|
34
|
-
"@live-change/dao-sockjs": "
|
|
35
|
-
"@live-change/dao-websocket": "
|
|
36
|
-
"@live-change/db": "
|
|
37
|
-
"@live-change/db-admin": "
|
|
38
|
-
"@live-change/db-client": "
|
|
39
|
-
"@live-change/db-store-level": "
|
|
40
|
-
"@live-change/db-store-lmdb": "
|
|
41
|
-
"@live-change/db-store-observable-db": "
|
|
42
|
-
"@live-change/db-store-rbtree": "
|
|
32
|
+
"@live-change/dao": "0.8.21",
|
|
33
|
+
"@live-change/dao-message": "0.8.21",
|
|
34
|
+
"@live-change/dao-sockjs": "0.8.21",
|
|
35
|
+
"@live-change/dao-websocket": "0.8.21",
|
|
36
|
+
"@live-change/db": "0.8.21",
|
|
37
|
+
"@live-change/db-admin": "0.8.21",
|
|
38
|
+
"@live-change/db-client": "0.8.21",
|
|
39
|
+
"@live-change/db-store-level": "0.8.21",
|
|
40
|
+
"@live-change/db-store-lmdb": "0.8.21",
|
|
41
|
+
"@live-change/db-store-observable-db": "0.8.21",
|
|
42
|
+
"@live-change/db-store-rbtree": "0.8.21",
|
|
43
43
|
"@live-change/sockjs": "0.4.1",
|
|
44
44
|
"express": "^4.18.2",
|
|
45
45
|
"line-reader": "^0.4.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"websocket": "^1.0.34",
|
|
50
50
|
"yargs": "^17.7.2"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "4453aa639a9fe1a857d93d73ebd28a82c97fdd87"
|
|
53
53
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Copyright 2019-2024 Michał Łaszczewski
|
|
2
|
-
|
|
3
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
|
-
|
|
5
|
-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
|
-
|
|
7
|
-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
-
|
|
9
|
-
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
-
|
|
11
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|