diff --git a/.gitignore b/.gitignore index 72237a3..e59b288 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -node_modules/ +src/node_modules/ test.js \ No newline at end of file diff --git a/module.js b/module.js index 0476e51..0f978fa 100644 --- a/module.js +++ b/module.js @@ -2,7 +2,6 @@ exports.printMsg = function() { console.log("Esiur 1.1"); } -module.exports = { Warehouse, DistributedConnection}; - +module.exports = { wh }; let WebSocket = require('ws') diff --git a/src/Net/IIP/DistributedResource.js b/src/Net/IIP/DistributedResource.js index 50a85c2..074682d 100644 --- a/src/Net/IIP/DistributedResource.js +++ b/src/Net/IIP/DistributedResource.js @@ -183,10 +183,18 @@ export default class DistributedResource extends IResource var pt = this.instance.template.getPropertyTemplateByIndex(index); this._p.properties[index] = value; this.instance.emitModification(pt, value); + + // this to invoke other property setters + this._p.neglect = true; + this[pt.name] = null; + this._p.neglect = false; } _set(index, value) { + if (this._p.neglect) + return; + if (index >= this._p.properties.length) return null; diff --git a/src/Resource/Warehouse.js b/src/Resource/Warehouse.js index d746445..10544a9 100644 --- a/src/Resource/Warehouse.js +++ b/src/Resource/Warehouse.js @@ -116,7 +116,7 @@ export class WH extends IEventHandler { var store = this.new(handler, url[0] + "://" + hostname); store.open(settings).then(x=>{ - if (pathname.length > 0 && pathname[1] != "") + if (pathname.length > 0 && pathname != "") store.get(pathname).then(r=>{ rt.trigger(r); }).error(e => rt.triggerError(e)); diff --git a/src/esiur.js b/src/esiur.js index 8adb2ce..7e22082 100644 --- a/src/esiur.js +++ b/src/esiur.js @@ -1,2 +1,7 @@ + import wh from './Resource/Warehouse.js'; -export default wh; \ No newline at end of file + +if (window) + window.wh = wh; + +export default wh; \ No newline at end of file diff --git a/package-lock.json b/src/package-lock.json similarity index 100% rename from package-lock.json rename to src/package-lock.json diff --git a/package.json b/src/package.json similarity index 88% rename from package.json rename to src/package.json index 518d7d0..5477c2d 100644 --- a/package.json +++ b/src/package.json @@ -1,8 +1,8 @@ { "name": "esiur", - "version": "1.2.3", + "version": "1.2.4", "description": "Distributed Object Framework", - "main": "build/esiur-debug-node.js", + "main": "esiur.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },