diff --git a/package-lock.json b/package-lock.json index e90e0261..e3f481a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -120,9 +120,9 @@ } }, "node_modules/@cesium/engine": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-13.1.0.tgz", - "integrity": "sha512-1PX7sMhtgBgaSOtyQ0lTPvG35bMfR1ngtgBZqzNnR67lp+tVv9lNyAg/byBSnijL2b2NJNC2Iec6A6Z/Rj12OA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-14.0.0.tgz", + "integrity": "sha512-nmW0uQCyg4CRqi3a8o30gU9S9bFm3TLh2fRO74iv+6a8FFArvZ1xF7IqG2tyRjSXkyH4c5vpavNRT3R51R8NyQ==", "license": "Apache-2.0", "dependencies": { "@tweenjs/tween.js": "^25.0.0", @@ -162,12 +162,12 @@ "license": "MIT" }, "node_modules/@cesium/widgets": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-10.1.0.tgz", - "integrity": "sha512-IWT+8cCsnJo1Mtr+xrkdVEZrP88/UqF5oDyDPVmlOJ47MPjUauu93k6LeAwxQQ2CYqqgpFIZbIX19mMfQMwSfA==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-10.2.0.tgz", + "integrity": "sha512-f0Wrp3MG02P2KSAopVESHWOhF+2eK9cQR9prEYGWuPM3iF6YktKrZqXzNnsOxCw1KPup0aSXsCrFl2asT5jF9g==", "license": "Apache-2.0", "dependencies": { - "@cesium/engine": "^13.1.0", + "@cesium/engine": "^14.0.0", "nosleep.js": "^0.12.0" }, "engines": { @@ -809,15 +809,14 @@ "license": "MIT" }, "node_modules/@takram/three-geospatial": { - "version": "0.0.1-alpha.5", - "resolved": "https://registry.npmjs.org/@takram/three-geospatial/-/three-geospatial-0.0.1-alpha.5.tgz", - "integrity": "sha512-GR9h9kjPfZ4BDB6QT3xX+K+dja+Fw+ln35ofBli57GmD1bQ0nzlUbRnsMJk3IfIWl/KtYEuPEgNOhkYR+OAXzg==", + "version": "0.0.1-alpha.6", + "resolved": "https://registry.npmjs.org/@takram/three-geospatial/-/three-geospatial-0.0.1-alpha.6.tgz", + "integrity": "sha512-6y/gO8aUoVKDD5769dTwdovvPHn+flrq6FbdS2Y65Ojunno/hRsd9FKegqqyAHJntmQzEGHA8MfyWiUrAcvg4Q==", "license": "MIT", "dependencies": { - "lodash-es": "^4.17.21", "react-merge-refs": "^2.1.1", "tiny-invariant": "^1.3.3", - "type-fest": "^4.32.0" + "type-fest": "^4.33.0" }, "peerDependencies": { "@react-three/fiber": ">=8.17.10", @@ -884,9 +883,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.0.tgz", - "integrity": "sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==", + "version": "22.13.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", + "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", "license": "MIT", "dependencies": { "undici-types": "~6.20.0" @@ -1025,12 +1024,29 @@ } } }, - "node_modules/3d-tiles-renderer/node_modules/@takram/three-geospatial-effects": { + "node_modules/3d-tiles-renderer/node_modules/@takram/three-atmosphere/node_modules/@takram/three-geospatial": { "version": "0.0.1-alpha.5", - "resolved": "https://registry.npmjs.org/@takram/three-geospatial-effects/-/three-geospatial-effects-0.0.1-alpha.5.tgz", - "integrity": "sha512-lnezTH3W9X7KduQhn0zrE/yowMHaS5u1MvECzKMbZrryq5TLlpLpK9JBAv4CTMIQNsSEfKrp5mGlBjXyMrPEMQ==", + "resolved": "https://registry.npmjs.org/@takram/three-geospatial/-/three-geospatial-0.0.1-alpha.5.tgz", + "integrity": "sha512-GR9h9kjPfZ4BDB6QT3xX+K+dja+Fw+ln35ofBli57GmD1bQ0nzlUbRnsMJk3IfIWl/KtYEuPEgNOhkYR+OAXzg==", + "license": "MIT", "dependencies": { - "@takram/three-geospatial": "0.0.1-alpha.5", + "lodash-es": "^4.17.21", + "react-merge-refs": "^2.1.1", + "tiny-invariant": "^1.3.3", + "type-fest": "^4.32.0" + }, + "peerDependencies": { + "@react-three/fiber": ">=8.17.10", + "react": ">=18.0", + "three": ">=0.170.0" + } + }, + "node_modules/3d-tiles-renderer/node_modules/@takram/three-geospatial-effects": { + "version": "0.0.1-alpha.6", + "resolved": "https://registry.npmjs.org/@takram/three-geospatial-effects/-/three-geospatial-effects-0.0.1-alpha.6.tgz", + "integrity": "sha512-YqAp4GY1bTb7bwM5hZu9mhbB23pChW/BSX6Srod+LagEoi9DWAq18ZcEBmGZfjUiFBh7EHEEQigjhdpjbGGi7w==", + "dependencies": { + "@takram/three-geospatial": "0.0.1-alpha.6", "n8ao": "^1.9.4" }, "peerDependencies": { @@ -1507,17 +1523,17 @@ "license": "MIT" }, "node_modules/cesium": { - "version": "1.125.0", - "resolved": "https://registry.npmjs.org/cesium/-/cesium-1.125.0.tgz", - "integrity": "sha512-T6V1xKFQOxydJJtG6ammyDOwKMerkGLdxQJLJSLHhhh6VKqpUyp+GXSKjnzlAmpLDjQLF1UkhbJ98WC59am/fA==", + "version": "1.126.0", + "resolved": "https://registry.npmjs.org/cesium/-/cesium-1.126.0.tgz", + "integrity": "sha512-29Cy6eq9NzTbQUaOXQEnVJyYoHCeizrBTbbB76OClI5+FNq9saUUx+iQXg/J6r8vX+KWt6oD/lVpZ0QMcvAgog==", "license": "Apache-2.0", "workspaces": [ "packages/engine", "packages/widgets" ], "dependencies": { - "@cesium/engine": "^13.1.0", - "@cesium/widgets": "^10.1.0" + "@cesium/engine": "^14.0.0", + "@cesium/widgets": "^10.2.0" }, "engines": { "node": ">=18.18.0" @@ -3615,9 +3631,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -4359,9 +4375,9 @@ } }, "node_modules/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "license": "ISC", "bin": { "semver": "bin/semver.js" diff --git a/services/maat/Maat.js b/services/maat/Maat.js index aadfae28..f5430c5d 100644 --- a/services/maat/Maat.js +++ b/services/maat/Maat.js @@ -11,8 +11,8 @@ const fs = require('fs'); const path = require('path'); const fg = require('fast-glob'); const fsx = require('fs-extra'); -const { creationDate } = require('webdav-server/lib/resource/v1/std/resourceTester/StdMetaData'); //const axios = require('axios'); +//const chokidar = require("chokidar"); /** @@ -45,8 +45,6 @@ Maat.init = ()=>{ Maat.db.stats = {}; - //Maat.scanScenes(); - /* const watcherScenes = chokidar.watch(Core.DIR_SCENES, { ignored: /(^|[\/\\])\../, // ignore dotfiles @@ -64,15 +62,15 @@ Maat.init = ()=>{ }); let onScenesChange = (p)=>{ - Maat._bDirtyCollections = true + console.log("Scenes changed "+p); }; let onCollectionsChange = (p)=>{ - Maat._bDirtyCollections = true; + console.log("Collection changed "+p); }; watcherScenes .on('add', onScenesChange ) - .on('change', onScenesChange ) + //.on('change', onScenesChange ) .on('unlink', onScenesChange ); watcherCollections @@ -85,12 +83,10 @@ Maat.init = ()=>{ /* fs.watch(Core.DIR_SCENES, (eventType, filename) => { console.log("\nThe file " + filename + " was modified! ("+eventType+")"); - Maat._bDirtyScenes = true; }); fs.watch(Core.DIR_COLLECTIONS, (eventType, filename) => { console.log("\nThe file " + filename + " was modified! ("+eventType+")"); - Maat._bDirtyCollections = true; }); */ //Maat._dUpd = setInterval(Maat.update, Maat.INTERVAL); @@ -133,14 +129,14 @@ Maat.addSceneKeyword = (k)=>{ }; Maat.scanScenes = ()=>{ - if (Maat.needScan.scenes === false) return; + if (!Maat.needScan.scenes) return; console.log("Scanning scenes..."); const confSHU = Core.config.shu; - //let files = fg.sync("**/"+Core.STD_SCENEFILE, Core.SCENES_GLOB_OPTS); - fg("**/"+Core.STD_SCENEFILE, Core.SCENES_GLOB_OPTS).then( files => { + let files = fg.sync("**/"+Core.STD_SCENEFILE, Core.SCENES_GLOB_OPTS); + //fg("**/"+Core.STD_SCENEFILE, Core.SCENES_GLOB_OPTS).then( files => { Maat.db.scenes = []; // clear Maat.db.scenesByID = {}; @@ -203,16 +199,15 @@ Maat.scanScenes = ()=>{ //Maat.db.scenes.sort( Maat.sortScenes ); - Maat.needScan.scenes = false; - //console.log(Maat.db.kwords); + Maat.needScan.scenes = false; setTimeout(()=>{ Maat.needScan.scenes = true; }, Maat.INTERVAL); - }); + //}); }; Maat.scanApps = ()=>{ - if (Maat.needScan.apps === false) return; + if (!Maat.needScan.apps) return; let O = {}; O.cwd = Core.DIR_WAPPS; @@ -220,7 +215,8 @@ Maat.scanApps = ()=>{ console.log("Scanning web-apps..."); - fg("*/app.webmanifest", O).then(files => { + let files = fg.sync("*/app.webmanifest", O); + //fg("*/app.webmanifest", O).then(files => { Maat.db.apps = []; for (let f in files){ @@ -234,13 +230,10 @@ Maat.scanApps = ()=>{ data: fs.existsSync(datadir)? true : false }); } + //}); - Maat.needScan.apps = false; - - setTimeout(()=>{ - Maat.needScan.apps = true; - }, Maat.INTERVAL); - }); + Maat.needScan.apps = false; + setTimeout(()=>{ Maat.needScan.apps = true; }, Maat.INTERVAL); }; @@ -248,6 +241,8 @@ Maat.scanApps = ()=>{ Maat.scanCollection = (uid)=>{ if (Maat.needScan.collections[uid] === false) return; + console.log("Scan collection: "+uid); + //const t0 = performance.now(); Maat.scanModels(uid); @@ -259,9 +254,7 @@ Maat.scanCollection = (uid)=>{ Maat.needScan.collections[uid] = false; - setTimeout(()=>{ - Maat.needScan.collections[uid] = true; - }, Maat.INTERVAL); + setTimeout(()=>{ Maat.needScan.collections[uid] = true; }, Maat.INTERVAL); }; Maat.scanModels = (uid)=>{ @@ -275,8 +268,8 @@ Maat.scanModels = (uid)=>{ globopts.cwd = Core.DIR_COLLECTIONS;// + relpath; globopts.follow = true; */ - //let files = fg.sync("**/{*.gltf,*.glb,*.json}", globopts); - fg("{"+uid+",samples}/models/**/{"+Core.mpattern+"}", Core.COLLECTIONS_GLOB_OPTS).then( files =>{ + let files = fg.sync("{"+uid+",samples}/models/**/{"+Core.mpattern+"}", Core.COLLECTIONS_GLOB_OPTS); + //fg("{"+uid+",samples}/models/**/{"+Core.mpattern+"}", Core.COLLECTIONS_GLOB_OPTS).then( files =>{ CC[uid].models = []; @@ -286,7 +279,7 @@ Maat.scanModels = (uid)=>{ //files = Maat.filterTSets(files); for (let f in files) CC[uid].models.push( /*relpath + */files[f] ); - }); + //}); }; Maat.scanPanoramas = (uid)=>{ @@ -300,14 +293,14 @@ Maat.scanPanoramas = (uid)=>{ globopts.cwd = Core.DIR_COLLECTIONS; // + relpath; globopts.follow = true; */ - //let files = fg.sync("**/{*.jpg,*.mp4,*.webm}", globopts); - fg("{"+uid+",samples}/pano/**/{"+Core.panopattern+"}", Core.COLLECTIONS_GLOB_OPTS).then(files => { + let files = fg.sync("{"+uid+",samples}/pano/**/{"+Core.panopattern+"}", Core.COLLECTIONS_GLOB_OPTS); + //fg("{"+uid+",samples}/pano/**/{"+Core.panopattern+"}", Core.COLLECTIONS_GLOB_OPTS).then(files => { CC[uid].panos = []; if (files.length < 1) return; for (let f in files) CC[uid].panos.push( /*relpath +*/ files[f] ); - }); + //}); }; Maat.scanMedia = (uid)=>{ @@ -315,13 +308,14 @@ Maat.scanMedia = (uid)=>{ if (CC[uid] === undefined) CC[uid] = {}; - fg("{"+uid+",samples}/media/**/{"+Core.mediapattern+"}", Core.COLLECTIONS_GLOB_OPTS).then(files =>{ + let files = fg.sync("{"+uid+",samples}/media/**/{"+Core.mediapattern+"}", Core.COLLECTIONS_GLOB_OPTS); + //fg("{"+uid+",samples}/media/**/{"+Core.mediapattern+"}", Core.COLLECTIONS_GLOB_OPTS).then(files =>{ CC[uid].media = []; if (files.length < 1) return; for (let f in files) CC[uid].media.push( files[f] ); - }); + //}); }; // TODO: improve filter alg